mirror of
https://github.com/gchq/CyberChef.git
synced 2024-11-01 05:31:01 +01:00
2 lines
1.4 MiB
Executable File
2 lines
1.4 MiB
Executable File
/*! For license information please see Ciphers.js.LICENSE.txt */
|
||
(()=>{var __webpack_modules__={42531:function(module){var factory;factory=function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=177)}([function(e,t){"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}},function(e,t,r){var n=r(2),i=n.Buffer;function a(e,t){for(var r in e)t[r]=e[r]}function s(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(a(n,t),t.Buffer=s),a(i,s),s.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},s.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},s.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},s.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},function(e,t,r){"use strict";(function(e){var n=r(169),i=r(168),a=r(76);function s(){return c.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function o(e,t){if(s()<t)throw new RangeError("Invalid typed array length");return c.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=c.prototype:(null===e&&(e=new c(t)),e.length=t),e}function c(e,t,r){if(!(c.TYPED_ARRAY_SUPPORT||this instanceof c))return new c(e,t,r);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return h(this,e)}return u(this,e,t,r)}function u(e,t,r,n){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,r,n){if(t.byteLength,r<0||t.byteLength<r)throw new RangeError("'offset' is out of bounds");if(t.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");return t=void 0===r&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,r):new Uint8Array(t,r,n),c.TYPED_ARRAY_SUPPORT?(e=t).__proto__=c.prototype:e=l(e,t),e}(e,t,r,n):"string"==typeof t?function(e,t,r){if("string"==typeof r&&""!==r||(r="utf8"),!c.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|p(t,r),i=(e=o(e,n)).write(t,r);return i!==n&&(e=e.slice(0,i)),e}(e,t,r):function(e,t){if(c.isBuffer(t)){var r=0|d(t.length);return 0===(e=o(e,r)).length||t.copy(e,0,0,r),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(n=t.length)!=n?o(e,0):l(e,t);if("Buffer"===t.type&&a(t.data))return l(e,t.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function f(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function h(e,t){if(f(t),e=o(e,t<0?0:0|d(t)),!c.TYPED_ARRAY_SUPPORT)for(var r=0;r<t;++r)e[r]=0;return e}function l(e,t){var r=t.length<0?0:0|d(t.length);e=o(e,r);for(var n=0;n<r;n+=1)e[n]=255&t[n];return e}function d(e){if(e>=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|e}function p(e,t){if(c.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return M(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return H(e).length;default:if(n)return M(e).length;t=(""+t).toLowerCase(),n=!0}}function g(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return k(this,t,r);case"utf8":case"utf-8":return x(this,t,r);case"ascii":return I(this,t,r);case"latin1":case"binary":return F(this,t,r);case"base64":return B(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function y(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function v(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=c.from(t,n)),c.isBuffer(t))return 0===t.length?-1:m(e,t,r,n,i);if("number"==typeof t)return t&=255,c.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):m(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function m(e,t,r,n,i){var a,s=1,o=e.length,c=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s=2,o/=2,c/=2,r/=2}function u(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){var f=-1;for(a=r;a<o;a++)if(u(e,a)===u(t,-1===f?0:a-f)){if(-1===f&&(f=a),a-f+1===c)return f*s}else-1!==f&&(a-=a-f),f=-1}else for(r+c>o&&(r=o-c),a=r;a>=0;a--){for(var h=!0,l=0;l<c;l++)if(u(e,a+l)!==u(t,l)){h=!1;break}if(h)return a}return-1}function b(e,t,r,n){r=Number(r)||0;var i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;var a=t.length;if(a%2!=0)throw new TypeError("Invalid hex string");n>a/2&&(n=a/2);for(var s=0;s<n;++s){var o=parseInt(t.substr(2*s,2),16);if(isNaN(o))return s;e[r+s]=o}return s}function w(e,t,r,n){return j(M(t,e.length-r),e,r,n)}function S(e,t,r,n){return j(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function E(e,t,r,n){return S(e,t,r,n)}function C(e,t,r,n){return j(H(t),e,r,n)}function A(e,t,r,n){return j(function(e,t){for(var r,n,i,a=[],s=0;s<e.length&&!((t-=2)<0);++s)n=(r=e.charCodeAt(s))>>8,i=r%256,a.push(i),a.push(n);return a}(t,e.length-r),e,r,n)}function B(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function x(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i<r;){var a,s,o,c,u=e[i],f=null,h=u>239?4:u>223?3:u>191?2:1;if(i+h<=r)switch(h){case 1:u<128&&(f=u);break;case 2:128==(192&(a=e[i+1]))&&(c=(31&u)<<6|63&a)>127&&(f=c);break;case 3:a=e[i+1],s=e[i+2],128==(192&a)&&128==(192&s)&&(c=(15&u)<<12|(63&a)<<6|63&s)>2047&&(c<55296||c>57343)&&(f=c);break;case 4:a=e[i+1],s=e[i+2],o=e[i+3],128==(192&a)&&128==(192&s)&&128==(192&o)&&(c=(15&u)<<18|(63&a)<<12|(63&s)<<6|63&o)>65535&&c<1114112&&(f=c)}null===f?(f=65533,h=1):f>65535&&(f-=65536,n.push(f>>>10&1023|55296),f=56320|1023&f),n.push(f),i+=h}return function(e){var t=e.length;if(t<=T)return String.fromCharCode.apply(String,e);for(var r="",n=0;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=T));return r}(n)}t.Buffer=c,t.SlowBuffer=function(e){return+e!=e&&(e=0),c.alloc(+e)},t.INSPECT_MAX_BYTES=50,c.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),t.kMaxLength=s(),c.poolSize=8192,c._augment=function(e){return e.__proto__=c.prototype,e},c.from=function(e,t,r){return u(null,e,t,r)},c.TYPED_ARRAY_SUPPORT&&(c.prototype.__proto__=Uint8Array.prototype,c.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&c[Symbol.species]===c&&Object.defineProperty(c,Symbol.species,{value:null,configurable:!0})),c.alloc=function(e,t,r){return function(e,t,r,n){return f(t),t<=0?o(e,t):void 0!==r?"string"==typeof n?o(e,t).fill(r,n):o(e,t).fill(r):o(e,t)}(null,e,t,r)},c.allocUnsafe=function(e){return h(null,e)},c.allocUnsafeSlow=function(e){return h(null,e)},c.isBuffer=function(e){return!(null==e||!e._isBuffer)},c.compare=function(e,t){if(!c.isBuffer(e)||!c.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var r=e.length,n=t.length,i=0,a=Math.min(r,n);i<a;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},c.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function(e,t){if(!a(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return c.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var n=c.allocUnsafe(t),i=0;for(r=0;r<e.length;++r){var s=e[r];if(!c.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(n,i),i+=s.length}return n},c.byteLength=p,c.prototype._isBuffer=!0,c.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)y(this,t,t+1);return this},c.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)y(this,t,t+3),y(this,t+1,t+2);return this},c.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)y(this,t,t+7),y(this,t+1,t+6),y(this,t+2,t+5),y(this,t+3,t+4);return this},c.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?x(this,0,e):g.apply(this,arguments)},c.prototype.equals=function(e){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===c.compare(this,e)},c.prototype.inspect=function(){var e="",r=t.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(e+=" ... ")),"<Buffer "+e+">"},c.prototype.compare=function(e,t,r,n,i){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;for(var a=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(t>>>=0),o=Math.min(a,s),u=this.slice(n,i),f=e.slice(t,r),h=0;h<o;++h)if(u[h]!==f[h]){a=u[h],s=f[h];break}return a<s?-1:s<a?1:0},c.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},c.prototype.indexOf=function(e,t,r){return v(this,e,t,r,!0)},c.prototype.lastIndexOf=function(e,t,r){return v(this,e,t,r,!1)},c.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var a=!1;;)switch(n){case"hex":return b(this,e,t,r);case"utf8":case"utf-8":return w(this,e,t,r);case"ascii":return S(this,e,t,r);case"latin1":case"binary":return E(this,e,t,r);case"base64":return C(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,e,t,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var T=4096;function I(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function F(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function k(e,t,r){var n,i=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>i)&&(r=i);for(var a="",s=t;s<r;++s)a+=(n=e[s])<16?"0"+n.toString(16):n.toString(16);return a}function R(e,t,r){for(var n=e.slice(t,r),i="",a=0;a<n.length;a+=2)i+=String.fromCharCode(n[a]+256*n[a+1]);return i}function D(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function _(e,t,r,n,i,a){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<a)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function P(e,t,r,n){t<0&&(t=65535+t+1);for(var i=0,a=Math.min(e.length-r,2);i<a;++i)e[r+i]=(t&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function N(e,t,r,n){t<0&&(t=4294967295+t+1);for(var i=0,a=Math.min(e.length-r,4);i<a;++i)e[r+i]=t>>>8*(n?i:3-i)&255}function O(e,t,r,n,i,a){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function L(e,t,r,n,a){return a||O(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function U(e,t,r,n,a){return a||O(e,0,r,8),i.write(e,t,r,n,52,8),r+8}c.prototype.slice=function(e,t){var r,n=this.length;if((e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e),c.TYPED_ARRAY_SUPPORT)(r=this.subarray(e,t)).__proto__=c.prototype;else{var i=t-e;r=new c(i,void 0);for(var a=0;a<i;++a)r[a]=this[a+e]}return r},c.prototype.readUIntLE=function(e,t,r){e|=0,t|=0,r||D(e,t,this.length);for(var n=this[e],i=1,a=0;++a<t&&(i*=256);)n+=this[e+a]*i;return n},c.prototype.readUIntBE=function(e,t,r){e|=0,t|=0,r||D(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},c.prototype.readUInt8=function(e,t){return t||D(e,1,this.length),this[e]},c.prototype.readUInt16LE=function(e,t){return t||D(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUInt16BE=function(e,t){return t||D(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUInt32LE=function(e,t){return t||D(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUInt32BE=function(e,t){return t||D(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||D(e,t,this.length);for(var n=this[e],i=1,a=0;++a<t&&(i*=256);)n+=this[e+a]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*t)),n},c.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||D(e,t,this.length);for(var n=t,i=1,a=this[e+--n];n>0&&(i*=256);)a+=this[e+--n]*i;return a>=(i*=128)&&(a-=Math.pow(2,8*t)),a},c.prototype.readInt8=function(e,t){return t||D(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){t||D(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(e,t){t||D(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(e,t){return t||D(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return t||D(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readFloatLE=function(e,t){return t||D(e,4,this.length),i.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return t||D(e,4,this.length),i.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return t||D(e,8,this.length),i.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return t||D(e,8,this.length),i.read(this,e,!1,52,8)},c.prototype.writeUIntLE=function(e,t,r,n){e=+e,t|=0,r|=0,n||_(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,a=0;for(this[t]=255&e;++a<r&&(i*=256);)this[t+a]=e/i&255;return t+r},c.prototype.writeUIntBE=function(e,t,r,n){e=+e,t|=0,r|=0,n||_(this,e,t,r,Math.pow(2,8*r)-1,0);var i=r-1,a=1;for(this[t+i]=255&e;--i>=0&&(a*=256);)this[t+i]=e/a&255;return t+r},c.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||_(this,e,t,1,255,0),c.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},c.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||_(this,e,t,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):P(this,e,t,!0),t+2},c.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||_(this,e,t,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):P(this,e,t,!1),t+2},c.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||_(this,e,t,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):N(this,e,t,!0),t+4},c.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||_(this,e,t,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):N(this,e,t,!1),t+4},c.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);_(this,e,t,r,i-1,-i)}var a=0,s=1,o=0;for(this[t]=255&e;++a<r&&(s*=256);)e<0&&0===o&&0!==this[t+a-1]&&(o=1),this[t+a]=(e/s|0)-o&255;return t+r},c.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);_(this,e,t,r,i-1,-i)}var a=r-1,s=1,o=0;for(this[t+a]=255&e;--a>=0&&(s*=256);)e<0&&0===o&&0!==this[t+a+1]&&(o=1),this[t+a]=(e/s|0)-o&255;return t+r},c.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||_(this,e,t,1,127,-128),c.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||_(this,e,t,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):P(this,e,t,!0),t+2},c.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||_(this,e,t,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):P(this,e,t,!1),t+2},c.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||_(this,e,t,4,2147483647,-2147483648),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):N(this,e,t,!0),t+4},c.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||_(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):N(this,e,t,!1),t+4},c.prototype.writeFloatLE=function(e,t,r){return L(this,e,t,!0,r)},c.prototype.writeFloatBE=function(e,t,r){return L(this,e,t,!1,r)},c.prototype.writeDoubleLE=function(e,t,r){return U(this,e,t,!0,r)},c.prototype.writeDoubleBE=function(e,t,r){return U(this,e,t,!1,r)},c.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var i,a=n-r;if(this===e&&r<t&&t<n)for(i=a-1;i>=0;--i)e[i+t]=this[i+r];else if(a<1e3||!c.TYPED_ARRAY_SUPPORT)for(i=0;i<a;++i)e[i+t]=this[i+r];else Uint8Array.prototype.set.call(e,this.subarray(r,r+a),t);return a},c.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===e.length){var i=e.charCodeAt(0);i<256&&(e=i)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!c.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;var a;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(a=t;a<r;++a)this[a]=e;else{var s=c.isBuffer(e)?e:M(new c(e,n).toString()),o=s.length;for(a=0;a<r-t;++a)this[a+t]=s[a%o]}return this};var K=/[^+\/0-9A-Za-z-_]/g;function M(e,t){var r;t=t||1/0;for(var n=e.length,i=null,a=[],s=0;s<n;++s){if((r=e.charCodeAt(s))>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&a.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function H(e){return n.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(K,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function j(e,t,r,n){for(var i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}}).call(this,r(7))},function(e,t,r){(function(e){!function(e,t){"use strict";function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function a(e,t,r){if(a.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var s;"object"==typeof e?e.exports=a:t.BN=a,a.BN=a,a.wordSize=26;try{s=r(130).Buffer}catch(e){}function o(e,t,r){for(var n=0,i=Math.min(e.length,r),a=t;a<i;a++){var s=e.charCodeAt(a)-48;n<<=4,n|=s>=49&&s<=54?s-49+10:s>=17&&s<=22?s-17+10:15&s}return n}function c(e,t,r,n){for(var i=0,a=Math.min(e.length,r),s=t;s<a;s++){var o=e.charCodeAt(s)-48;i*=n,i+=o>=49?o-49+10:o>=17?o-17+10:o}return i}a.isBN=function(e){return e instanceof a||null!==e&&"object"==typeof e&&e.constructor.wordSize===a.wordSize&&Array.isArray(e.words)},a.max=function(e,t){return e.cmp(t)>0?e:t},a.min=function(e,t){return e.cmp(t)<0?e:t},a.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&i++,16===t?this._parseHex(e,i):this._parseBase(e,t,i),"-"===e[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),t,r)},a.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},a.prototype._initArray=function(e,t,r){if(n("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var a,s,o=0;if("be"===r)for(i=e.length-1,a=0;i>=0;i-=3)s=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[a]|=s<<o&67108863,this.words[a+1]=s>>>26-o&67108863,(o+=24)>=26&&(o-=26,a++);else if("le"===r)for(i=0,a=0;i<e.length;i+=3)s=e[i]|e[i+1]<<8|e[i+2]<<16,this.words[a]|=s<<o&67108863,this.words[a+1]=s>>>26-o&67108863,(o+=24)>=26&&(o-=26,a++);return this.strip()},a.prototype._parseHex=function(e,t){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var n,i,a=0;for(r=e.length-6,n=0;r>=t;r-=6)i=o(e,r,r+6),this.words[n]|=i<<a&67108863,this.words[n+1]|=i>>>26-a&4194303,(a+=24)>=26&&(a-=26,n++);r+6!==t&&(i=o(e,t,r+6),this.words[n]|=i<<a&67108863,this.words[n+1]|=i>>>26-a&4194303),this.strip()},a.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var a=e.length-r,s=a%n,o=Math.min(a,a-s)+r,u=0,f=r;f<o;f+=n)u=c(e,f,f+n,t),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==s){var h=1;for(u=c(e,f,e.length,t),f=0;f<s;f++)h*=t;this.imuln(h),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}},a.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},a.prototype.clone=function(){var e=new a(null);return this.copy(e),e},a.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},a.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},a.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},a.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var u=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],f=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],h=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function l(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],a=0|t.words[0],s=i*a,o=67108863&s,c=s/67108864|0;r.words[0]=o;for(var u=1;u<n;u++){for(var f=c>>>26,h=67108863&c,l=Math.min(u,t.length-1),d=Math.max(0,u-e.length+1);d<=l;d++){var p=u-d|0;f+=(s=(i=0|e.words[p])*(a=0|t.words[d])+h)/67108864|0,h=67108863&s}r.words[u]=0|h,c=0|f}return 0!==c?r.words[u]=0|c:r.length--,r.strip()}a.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,a=0,s=0;s<this.length;s++){var o=this.words[s],c=(16777215&(o<<i|a)).toString(16);r=0!=(a=o>>>24-i&16777215)||s!==this.length-1?u[6-c.length]+c+r:c+r,(i+=2)>=26&&(i-=26,s--)}for(0!==a&&(r=a.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var l=f[e],d=h[e];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var g=p.modn(d).toString(e);r=(p=p.idivn(d)).isZero()?g+r:u[l-g.length]+g+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},a.prototype.toJSON=function(){return this.toString(16)},a.prototype.toBuffer=function(e,t){return n(void 0!==s),this.toArrayLike(s,e,t)},a.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},a.prototype.toArrayLike=function(e,t,r){var i=this.byteLength(),a=r||Math.max(1,i);n(i<=a,"byte array longer than desired length"),n(a>0,"Requested array length <= 0"),this.strip();var s,o,c="le"===t,u=new e(a),f=this.clone();if(c){for(o=0;!f.isZero();o++)s=f.andln(255),f.iushrn(8),u[o]=s;for(;o<a;o++)u[o]=0}else{for(o=0;o<a-i;o++)u[o]=0;for(o=0;!f.isZero();o++)s=f.andln(255),f.iushrn(8),u[a-o-1]=s}return u},Math.clz32?a.prototype._countBits=function(e){return 32-Math.clz32(e)}:a.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},a.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 8191&t||(r+=13,t>>>=13),127&t||(r+=7,t>>>=7),15&t||(r+=4,t>>>=4),3&t||(r+=2,t>>>=2),1&t||r++,r},a.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},a.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},a.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},a.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},a.prototype.isNeg=function(){return 0!==this.negative},a.prototype.neg=function(){return this.clone().ineg()},a.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},a.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this.strip()},a.prototype.ior=function(e){return n(!(this.negative|e.negative)),this.iuor(e)},a.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},a.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},a.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this.strip()},a.prototype.iand=function(e){return n(!(this.negative|e.negative)),this.iuand(e)},a.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},a.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},a.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;n<r.length;n++)this.words[n]=t.words[n]^r.words[n];if(this!==t)for(;n<t.length;n++)this.words[n]=t.words[n];return this.length=t.length,this.strip()},a.prototype.ixor=function(e){return n(!(this.negative|e.negative)),this.iuxor(e)},a.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},a.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},a.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i<t;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},a.prototype.notn=function(e){return this.clone().inotn(e)},a.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<<i:this.words[r]&~(1<<i),this.strip()},a.prototype.iadd=function(e){var t,r,n;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,n=e):(r=e,n=this);for(var i=0,a=0;a<n.length;a++)t=(0|r.words[a])+(0|n.words[a])+i,this.words[a]=67108863&t,i=t>>>26;for(;0!==i&&a<r.length;a++)t=(0|r.words[a])+i,this.words[a]=67108863&t,i=t>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;a<r.length;a++)this.words[a]=r.words[a];return this},a.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},a.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var a=0,s=0;s<n.length;s++)a=(t=(0|r.words[s])-(0|n.words[s])+a)>>26,this.words[s]=67108863&t;for(;0!==a&&s<r.length;s++)a=(t=(0|r.words[s])+a)>>26,this.words[s]=67108863&t;if(0===a&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this.strip()},a.prototype.sub=function(e){return this.clone().isub(e)};var d=function(e,t,r){var n,i,a,s=e.words,o=t.words,c=r.words,u=0,f=0|s[0],h=8191&f,l=f>>>13,d=0|s[1],p=8191&d,g=d>>>13,y=0|s[2],v=8191&y,m=y>>>13,b=0|s[3],w=8191&b,S=b>>>13,E=0|s[4],C=8191&E,A=E>>>13,B=0|s[5],x=8191&B,T=B>>>13,I=0|s[6],F=8191&I,k=I>>>13,R=0|s[7],D=8191&R,_=R>>>13,P=0|s[8],N=8191&P,O=P>>>13,L=0|s[9],U=8191&L,K=L>>>13,M=0|o[0],H=8191&M,j=M>>>13,V=0|o[1],G=8191&V,q=V>>>13,z=0|o[2],W=8191&z,X=z>>>13,Y=0|o[3],J=8191&Y,Q=Y>>>13,Z=0|o[4],$=8191&Z,ee=Z>>>13,te=0|o[5],re=8191&te,ne=te>>>13,ie=0|o[6],ae=8191&ie,se=ie>>>13,oe=0|o[7],ce=8191&oe,ue=oe>>>13,fe=0|o[8],he=8191&fe,le=fe>>>13,de=0|o[9],pe=8191&de,ge=de>>>13;r.negative=e.negative^t.negative,r.length=19;var ye=(u+(n=Math.imul(h,H))|0)+((8191&(i=(i=Math.imul(h,j))+Math.imul(l,H)|0))<<13)|0;u=((a=Math.imul(l,j))+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(p,H),i=(i=Math.imul(p,j))+Math.imul(g,H)|0,a=Math.imul(g,j);var ve=(u+(n=n+Math.imul(h,G)|0)|0)+((8191&(i=(i=i+Math.imul(h,q)|0)+Math.imul(l,G)|0))<<13)|0;u=((a=a+Math.imul(l,q)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(v,H),i=(i=Math.imul(v,j))+Math.imul(m,H)|0,a=Math.imul(m,j),n=n+Math.imul(p,G)|0,i=(i=i+Math.imul(p,q)|0)+Math.imul(g,G)|0,a=a+Math.imul(g,q)|0;var me=(u+(n=n+Math.imul(h,W)|0)|0)+((8191&(i=(i=i+Math.imul(h,X)|0)+Math.imul(l,W)|0))<<13)|0;u=((a=a+Math.imul(l,X)|0)+(i>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(w,H),i=(i=Math.imul(w,j))+Math.imul(S,H)|0,a=Math.imul(S,j),n=n+Math.imul(v,G)|0,i=(i=i+Math.imul(v,q)|0)+Math.imul(m,G)|0,a=a+Math.imul(m,q)|0,n=n+Math.imul(p,W)|0,i=(i=i+Math.imul(p,X)|0)+Math.imul(g,W)|0,a=a+Math.imul(g,X)|0;var be=(u+(n=n+Math.imul(h,J)|0)|0)+((8191&(i=(i=i+Math.imul(h,Q)|0)+Math.imul(l,J)|0))<<13)|0;u=((a=a+Math.imul(l,Q)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(C,H),i=(i=Math.imul(C,j))+Math.imul(A,H)|0,a=Math.imul(A,j),n=n+Math.imul(w,G)|0,i=(i=i+Math.imul(w,q)|0)+Math.imul(S,G)|0,a=a+Math.imul(S,q)|0,n=n+Math.imul(v,W)|0,i=(i=i+Math.imul(v,X)|0)+Math.imul(m,W)|0,a=a+Math.imul(m,X)|0,n=n+Math.imul(p,J)|0,i=(i=i+Math.imul(p,Q)|0)+Math.imul(g,J)|0,a=a+Math.imul(g,Q)|0;var we=(u+(n=n+Math.imul(h,$)|0)|0)+((8191&(i=(i=i+Math.imul(h,ee)|0)+Math.imul(l,$)|0))<<13)|0;u=((a=a+Math.imul(l,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(x,H),i=(i=Math.imul(x,j))+Math.imul(T,H)|0,a=Math.imul(T,j),n=n+Math.imul(C,G)|0,i=(i=i+Math.imul(C,q)|0)+Math.imul(A,G)|0,a=a+Math.imul(A,q)|0,n=n+Math.imul(w,W)|0,i=(i=i+Math.imul(w,X)|0)+Math.imul(S,W)|0,a=a+Math.imul(S,X)|0,n=n+Math.imul(v,J)|0,i=(i=i+Math.imul(v,Q)|0)+Math.imul(m,J)|0,a=a+Math.imul(m,Q)|0,n=n+Math.imul(p,$)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(g,$)|0,a=a+Math.imul(g,ee)|0;var Se=(u+(n=n+Math.imul(h,re)|0)|0)+((8191&(i=(i=i+Math.imul(h,ne)|0)+Math.imul(l,re)|0))<<13)|0;u=((a=a+Math.imul(l,ne)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(F,H),i=(i=Math.imul(F,j))+Math.imul(k,H)|0,a=Math.imul(k,j),n=n+Math.imul(x,G)|0,i=(i=i+Math.imul(x,q)|0)+Math.imul(T,G)|0,a=a+Math.imul(T,q)|0,n=n+Math.imul(C,W)|0,i=(i=i+Math.imul(C,X)|0)+Math.imul(A,W)|0,a=a+Math.imul(A,X)|0,n=n+Math.imul(w,J)|0,i=(i=i+Math.imul(w,Q)|0)+Math.imul(S,J)|0,a=a+Math.imul(S,Q)|0,n=n+Math.imul(v,$)|0,i=(i=i+Math.imul(v,ee)|0)+Math.imul(m,$)|0,a=a+Math.imul(m,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(g,re)|0,a=a+Math.imul(g,ne)|0;var Ee=(u+(n=n+Math.imul(h,ae)|0)|0)+((8191&(i=(i=i+Math.imul(h,se)|0)+Math.imul(l,ae)|0))<<13)|0;u=((a=a+Math.imul(l,se)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(D,H),i=(i=Math.imul(D,j))+Math.imul(_,H)|0,a=Math.imul(_,j),n=n+Math.imul(F,G)|0,i=(i=i+Math.imul(F,q)|0)+Math.imul(k,G)|0,a=a+Math.imul(k,q)|0,n=n+Math.imul(x,W)|0,i=(i=i+Math.imul(x,X)|0)+Math.imul(T,W)|0,a=a+Math.imul(T,X)|0,n=n+Math.imul(C,J)|0,i=(i=i+Math.imul(C,Q)|0)+Math.imul(A,J)|0,a=a+Math.imul(A,Q)|0,n=n+Math.imul(w,$)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(S,$)|0,a=a+Math.imul(S,ee)|0,n=n+Math.imul(v,re)|0,i=(i=i+Math.imul(v,ne)|0)+Math.imul(m,re)|0,a=a+Math.imul(m,ne)|0,n=n+Math.imul(p,ae)|0,i=(i=i+Math.imul(p,se)|0)+Math.imul(g,ae)|0,a=a+Math.imul(g,se)|0;var Ce=(u+(n=n+Math.imul(h,ce)|0)|0)+((8191&(i=(i=i+Math.imul(h,ue)|0)+Math.imul(l,ce)|0))<<13)|0;u=((a=a+Math.imul(l,ue)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(N,H),i=(i=Math.imul(N,j))+Math.imul(O,H)|0,a=Math.imul(O,j),n=n+Math.imul(D,G)|0,i=(i=i+Math.imul(D,q)|0)+Math.imul(_,G)|0,a=a+Math.imul(_,q)|0,n=n+Math.imul(F,W)|0,i=(i=i+Math.imul(F,X)|0)+Math.imul(k,W)|0,a=a+Math.imul(k,X)|0,n=n+Math.imul(x,J)|0,i=(i=i+Math.imul(x,Q)|0)+Math.imul(T,J)|0,a=a+Math.imul(T,Q)|0,n=n+Math.imul(C,$)|0,i=(i=i+Math.imul(C,ee)|0)+Math.imul(A,$)|0,a=a+Math.imul(A,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(S,re)|0,a=a+Math.imul(S,ne)|0,n=n+Math.imul(v,ae)|0,i=(i=i+Math.imul(v,se)|0)+Math.imul(m,ae)|0,a=a+Math.imul(m,se)|0,n=n+Math.imul(p,ce)|0,i=(i=i+Math.imul(p,ue)|0)+Math.imul(g,ce)|0,a=a+Math.imul(g,ue)|0;var Ae=(u+(n=n+Math.imul(h,he)|0)|0)+((8191&(i=(i=i+Math.imul(h,le)|0)+Math.imul(l,he)|0))<<13)|0;u=((a=a+Math.imul(l,le)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(U,H),i=(i=Math.imul(U,j))+Math.imul(K,H)|0,a=Math.imul(K,j),n=n+Math.imul(N,G)|0,i=(i=i+Math.imul(N,q)|0)+Math.imul(O,G)|0,a=a+Math.imul(O,q)|0,n=n+Math.imul(D,W)|0,i=(i=i+Math.imul(D,X)|0)+Math.imul(_,W)|0,a=a+Math.imul(_,X)|0,n=n+Math.imul(F,J)|0,i=(i=i+Math.imul(F,Q)|0)+Math.imul(k,J)|0,a=a+Math.imul(k,Q)|0,n=n+Math.imul(x,$)|0,i=(i=i+Math.imul(x,ee)|0)+Math.imul(T,$)|0,a=a+Math.imul(T,ee)|0,n=n+Math.imul(C,re)|0,i=(i=i+Math.imul(C,ne)|0)+Math.imul(A,re)|0,a=a+Math.imul(A,ne)|0,n=n+Math.imul(w,ae)|0,i=(i=i+Math.imul(w,se)|0)+Math.imul(S,ae)|0,a=a+Math.imul(S,se)|0,n=n+Math.imul(v,ce)|0,i=(i=i+Math.imul(v,ue)|0)+Math.imul(m,ce)|0,a=a+Math.imul(m,ue)|0,n=n+Math.imul(p,he)|0,i=(i=i+Math.imul(p,le)|0)+Math.imul(g,he)|0,a=a+Math.imul(g,le)|0;var Be=(u+(n=n+Math.imul(h,pe)|0)|0)+((8191&(i=(i=i+Math.imul(h,ge)|0)+Math.imul(l,pe)|0))<<13)|0;u=((a=a+Math.imul(l,ge)|0)+(i>>>13)|0)+(Be>>>26)|0,Be&=67108863,n=Math.imul(U,G),i=(i=Math.imul(U,q))+Math.imul(K,G)|0,a=Math.imul(K,q),n=n+Math.imul(N,W)|0,i=(i=i+Math.imul(N,X)|0)+Math.imul(O,W)|0,a=a+Math.imul(O,X)|0,n=n+Math.imul(D,J)|0,i=(i=i+Math.imul(D,Q)|0)+Math.imul(_,J)|0,a=a+Math.imul(_,Q)|0,n=n+Math.imul(F,$)|0,i=(i=i+Math.imul(F,ee)|0)+Math.imul(k,$)|0,a=a+Math.imul(k,ee)|0,n=n+Math.imul(x,re)|0,i=(i=i+Math.imul(x,ne)|0)+Math.imul(T,re)|0,a=a+Math.imul(T,ne)|0,n=n+Math.imul(C,ae)|0,i=(i=i+Math.imul(C,se)|0)+Math.imul(A,ae)|0,a=a+Math.imul(A,se)|0,n=n+Math.imul(w,ce)|0,i=(i=i+Math.imul(w,ue)|0)+Math.imul(S,ce)|0,a=a+Math.imul(S,ue)|0,n=n+Math.imul(v,he)|0,i=(i=i+Math.imul(v,le)|0)+Math.imul(m,he)|0,a=a+Math.imul(m,le)|0;var xe=(u+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,ge)|0)+Math.imul(g,pe)|0))<<13)|0;u=((a=a+Math.imul(g,ge)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(U,W),i=(i=Math.imul(U,X))+Math.imul(K,W)|0,a=Math.imul(K,X),n=n+Math.imul(N,J)|0,i=(i=i+Math.imul(N,Q)|0)+Math.imul(O,J)|0,a=a+Math.imul(O,Q)|0,n=n+Math.imul(D,$)|0,i=(i=i+Math.imul(D,ee)|0)+Math.imul(_,$)|0,a=a+Math.imul(_,ee)|0,n=n+Math.imul(F,re)|0,i=(i=i+Math.imul(F,ne)|0)+Math.imul(k,re)|0,a=a+Math.imul(k,ne)|0,n=n+Math.imul(x,ae)|0,i=(i=i+Math.imul(x,se)|0)+Math.imul(T,ae)|0,a=a+Math.imul(T,se)|0,n=n+Math.imul(C,ce)|0,i=(i=i+Math.imul(C,ue)|0)+Math.imul(A,ce)|0,a=a+Math.imul(A,ue)|0,n=n+Math.imul(w,he)|0,i=(i=i+Math.imul(w,le)|0)+Math.imul(S,he)|0,a=a+Math.imul(S,le)|0;var Te=(u+(n=n+Math.imul(v,pe)|0)|0)+((8191&(i=(i=i+Math.imul(v,ge)|0)+Math.imul(m,pe)|0))<<13)|0;u=((a=a+Math.imul(m,ge)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(U,J),i=(i=Math.imul(U,Q))+Math.imul(K,J)|0,a=Math.imul(K,Q),n=n+Math.imul(N,$)|0,i=(i=i+Math.imul(N,ee)|0)+Math.imul(O,$)|0,a=a+Math.imul(O,ee)|0,n=n+Math.imul(D,re)|0,i=(i=i+Math.imul(D,ne)|0)+Math.imul(_,re)|0,a=a+Math.imul(_,ne)|0,n=n+Math.imul(F,ae)|0,i=(i=i+Math.imul(F,se)|0)+Math.imul(k,ae)|0,a=a+Math.imul(k,se)|0,n=n+Math.imul(x,ce)|0,i=(i=i+Math.imul(x,ue)|0)+Math.imul(T,ce)|0,a=a+Math.imul(T,ue)|0,n=n+Math.imul(C,he)|0,i=(i=i+Math.imul(C,le)|0)+Math.imul(A,he)|0,a=a+Math.imul(A,le)|0;var Ie=(u+(n=n+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,ge)|0)+Math.imul(S,pe)|0))<<13)|0;u=((a=a+Math.imul(S,ge)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(U,$),i=(i=Math.imul(U,ee))+Math.imul(K,$)|0,a=Math.imul(K,ee),n=n+Math.imul(N,re)|0,i=(i=i+Math.imul(N,ne)|0)+Math.imul(O,re)|0,a=a+Math.imul(O,ne)|0,n=n+Math.imul(D,ae)|0,i=(i=i+Math.imul(D,se)|0)+Math.imul(_,ae)|0,a=a+Math.imul(_,se)|0,n=n+Math.imul(F,ce)|0,i=(i=i+Math.imul(F,ue)|0)+Math.imul(k,ce)|0,a=a+Math.imul(k,ue)|0,n=n+Math.imul(x,he)|0,i=(i=i+Math.imul(x,le)|0)+Math.imul(T,he)|0,a=a+Math.imul(T,le)|0;var Fe=(u+(n=n+Math.imul(C,pe)|0)|0)+((8191&(i=(i=i+Math.imul(C,ge)|0)+Math.imul(A,pe)|0))<<13)|0;u=((a=a+Math.imul(A,ge)|0)+(i>>>13)|0)+(Fe>>>26)|0,Fe&=67108863,n=Math.imul(U,re),i=(i=Math.imul(U,ne))+Math.imul(K,re)|0,a=Math.imul(K,ne),n=n+Math.imul(N,ae)|0,i=(i=i+Math.imul(N,se)|0)+Math.imul(O,ae)|0,a=a+Math.imul(O,se)|0,n=n+Math.imul(D,ce)|0,i=(i=i+Math.imul(D,ue)|0)+Math.imul(_,ce)|0,a=a+Math.imul(_,ue)|0,n=n+Math.imul(F,he)|0,i=(i=i+Math.imul(F,le)|0)+Math.imul(k,he)|0,a=a+Math.imul(k,le)|0;var ke=(u+(n=n+Math.imul(x,pe)|0)|0)+((8191&(i=(i=i+Math.imul(x,ge)|0)+Math.imul(T,pe)|0))<<13)|0;u=((a=a+Math.imul(T,ge)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(U,ae),i=(i=Math.imul(U,se))+Math.imul(K,ae)|0,a=Math.imul(K,se),n=n+Math.imul(N,ce)|0,i=(i=i+Math.imul(N,ue)|0)+Math.imul(O,ce)|0,a=a+Math.imul(O,ue)|0,n=n+Math.imul(D,he)|0,i=(i=i+Math.imul(D,le)|0)+Math.imul(_,he)|0,a=a+Math.imul(_,le)|0;var Re=(u+(n=n+Math.imul(F,pe)|0)|0)+((8191&(i=(i=i+Math.imul(F,ge)|0)+Math.imul(k,pe)|0))<<13)|0;u=((a=a+Math.imul(k,ge)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(U,ce),i=(i=Math.imul(U,ue))+Math.imul(K,ce)|0,a=Math.imul(K,ue),n=n+Math.imul(N,he)|0,i=(i=i+Math.imul(N,le)|0)+Math.imul(O,he)|0,a=a+Math.imul(O,le)|0;var De=(u+(n=n+Math.imul(D,pe)|0)|0)+((8191&(i=(i=i+Math.imul(D,ge)|0)+Math.imul(_,pe)|0))<<13)|0;u=((a=a+Math.imul(_,ge)|0)+(i>>>13)|0)+(De>>>26)|0,De&=67108863,n=Math.imul(U,he),i=(i=Math.imul(U,le))+Math.imul(K,he)|0,a=Math.imul(K,le);var _e=(u+(n=n+Math.imul(N,pe)|0)|0)+((8191&(i=(i=i+Math.imul(N,ge)|0)+Math.imul(O,pe)|0))<<13)|0;u=((a=a+Math.imul(O,ge)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863;var Pe=(u+(n=Math.imul(U,pe))|0)+((8191&(i=(i=Math.imul(U,ge))+Math.imul(K,pe)|0))<<13)|0;return u=((a=Math.imul(K,ge))+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,c[0]=ye,c[1]=ve,c[2]=me,c[3]=be,c[4]=we,c[5]=Se,c[6]=Ee,c[7]=Ce,c[8]=Ae,c[9]=Be,c[10]=xe,c[11]=Te,c[12]=Ie,c[13]=Fe,c[14]=ke,c[15]=Re,c[16]=De,c[17]=_e,c[18]=Pe,0!==u&&(c[19]=u,r.length++),r};function p(e,t,r){return(new g).mulp(e,t,r)}function g(e,t){this.x=e,this.y=t}Math.imul||(d=l),a.prototype.mulTo=function(e,t){var r,n=this.length+e.length;return r=10===this.length&&10===e.length?d(this,e,t):n<63?l(this,e,t):n<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,a=0;a<r.length-1;a++){var s=i;i=0;for(var o=67108863&n,c=Math.min(a,t.length-1),u=Math.max(0,a-e.length+1);u<=c;u++){var f=a-u,h=(0|e.words[f])*(0|t.words[u]),l=67108863&h;o=67108863&(l=l+o|0),i+=(s=(s=s+(h/67108864|0)|0)+(l>>>26)|0)>>>26,s&=67108863}r.words[a]=o,n=s,s=i}return 0!==n?r.words[a]=n:r.length--,r.strip()}(this,e,t):p(this,e,t),r},g.prototype.makeRBT=function(e){for(var t=new Array(e),r=a.prototype._countBits(e)-1,n=0;n<e;n++)t[n]=this.revBin(n,r,e);return t},g.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var n=0,i=0;i<t;i++)n|=(1&e)<<t-i-1,e>>=1;return n},g.prototype.permute=function(e,t,r,n,i,a){for(var s=0;s<a;s++)n[s]=t[e[s]],i[s]=r[e[s]]},g.prototype.transform=function(e,t,r,n,i,a){this.permute(a,e,t,r,n,i);for(var s=1;s<i;s<<=1)for(var o=s<<1,c=Math.cos(2*Math.PI/o),u=Math.sin(2*Math.PI/o),f=0;f<i;f+=o)for(var h=c,l=u,d=0;d<s;d++){var p=r[f+d],g=n[f+d],y=r[f+d+s],v=n[f+d+s],m=h*y-l*v;v=h*v+l*y,y=m,r[f+d]=p+y,n[f+d]=g+v,r[f+d+s]=p-y,n[f+d+s]=g-v,d!==o&&(m=c*h-u*l,l=c*l+u*h,h=m)}},g.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},g.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=e[n];e[n]=e[r-n-1],e[r-n-1]=i,i=t[n],t[n]=-t[r-n-1],t[r-n-1]=-i}},g.prototype.normalize13b=function(e,t){for(var r=0,n=0;n<t/2;n++){var i=8192*Math.round(e[2*n+1]/t)+Math.round(e[2*n]/t)+r;e[n]=67108863&i,r=i<67108864?0:i/67108864|0}return e},g.prototype.convert13b=function(e,t,r,i){for(var a=0,s=0;s<t;s++)a+=0|e[s],r[2*s]=8191&a,a>>>=13,r[2*s+1]=8191&a,a>>>=13;for(s=2*t;s<i;++s)r[s]=0;n(0===a),n(!(-8192&a))},g.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},g.prototype.mulp=function(e,t,r){var n=2*this.guessLen13b(e.length,t.length),i=this.makeRBT(n),a=this.stub(n),s=new Array(n),o=new Array(n),c=new Array(n),u=new Array(n),f=new Array(n),h=new Array(n),l=r.words;l.length=n,this.convert13b(e.words,e.length,s,n),this.convert13b(t.words,t.length,u,n),this.transform(s,a,o,c,n,i),this.transform(u,a,f,h,n,i);for(var d=0;d<n;d++){var p=o[d]*f[d]-c[d]*h[d];c[d]=o[d]*h[d]+c[d]*f[d],o[d]=p}return this.conjugate(o,c,n),this.transform(o,c,l,a,n,i),this.conjugate(l,a,n),this.normalize13b(l,n),r.negative=e.negative^t.negative,r.length=e.length+t.length,r.strip()},a.prototype.mul=function(e){var t=new a(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},a.prototype.mulf=function(e){var t=new a(null);return t.words=new Array(this.length+e.length),p(this,e,t)},a.prototype.imul=function(e){return this.clone().mulTo(e,this)},a.prototype.imuln=function(e){n("number"==typeof e),n(e<67108864);for(var t=0,r=0;r<this.length;r++){var i=(0|this.words[r])*e,a=(67108863&i)+(67108863&t);t>>=26,t+=i/67108864|0,t+=a>>>26,this.words[r]=67108863&a}return 0!==t&&(this.words[r]=t,this.length++),this},a.prototype.muln=function(e){return this.clone().imuln(e)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var n=r/26|0,i=r%26;t[r]=(e.words[n]&1<<i)>>>i}return t}(e);if(0===t.length)return new a(1);for(var r=this,n=0;n<t.length&&0===t[n];n++,r=r.sqr());if(++n<t.length)for(var i=r.sqr();n<t.length;n++,i=i.sqr())0!==t[n]&&(r=r.mul(i));return r},a.prototype.iushln=function(e){n("number"==typeof e&&e>=0);var t,r=e%26,i=(e-r)/26,a=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(t=0;t<this.length;t++){var o=this.words[t]&a,c=(0|this.words[t])-o<<r;this.words[t]=c|s,s=o>>>26-r}s&&(this.words[t]=s,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t<i;t++)this.words[t]=0;this.length+=i}return this.strip()},a.prototype.ishln=function(e){return n(0===this.negative),this.iushln(e)},a.prototype.iushrn=function(e,t,r){var i;n("number"==typeof e&&e>=0),i=t?(t-t%26)/26:0;var a=e%26,s=Math.min((e-a)/26,this.length),o=67108863^67108863>>>a<<a,c=r;if(i-=s,i=Math.max(0,i),c){for(var u=0;u<s;u++)c.words[u]=this.words[u];c.length=s}if(0===s);else if(this.length>s)for(this.length-=s,u=0;u<this.length;u++)this.words[u]=this.words[u+s];else this.words[0]=0,this.length=1;var f=0;for(u=this.length-1;u>=0&&(0!==f||u>=i);u--){var h=0|this.words[u];this.words[u]=f<<26-a|h>>>a,f=h&o}return c&&0!==f&&(c.words[c.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},a.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},a.prototype.shln=function(e){return this.clone().ishln(e)},a.prototype.ushln=function(e){return this.clone().iushln(e)},a.prototype.shrn=function(e){return this.clone().ishrn(e)},a.prototype.ushrn=function(e){return this.clone().iushrn(e)},a.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<<t;return!(this.length<=r||!(this.words[r]&i))},a.prototype.imaskn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<<t;this.words[this.length-1]&=i}return this.strip()},a.prototype.maskn=function(e){return this.clone().imaskn(e)},a.prototype.iaddn=function(e){return n("number"==typeof e),n(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},a.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},a.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this.strip()},a.prototype.addn=function(e){return this.clone().iaddn(e)},a.prototype.subn=function(e){return this.clone().isubn(e)},a.prototype.iabs=function(){return this.negative=0,this},a.prototype.abs=function(){return this.clone().iabs()},a.prototype._ishlnsubmul=function(e,t,r){var i,a,s=e.length+r;this._expand(s);var o=0;for(i=0;i<e.length;i++){a=(0|this.words[i+r])+o;var c=(0|e.words[i])*t;o=((a-=67108863&c)>>26)-(c/67108864|0),this.words[i+r]=67108863&a}for(;i<this.length-r;i++)o=(a=(0|this.words[i+r])+o)>>26,this.words[i+r]=67108863&a;if(0===o)return this.strip();for(n(-1===o),o=0,i=0;i<this.length;i++)o=(a=-(0|this.words[i])+o)>>26,this.words[i]=67108863&a;return this.negative=1,this.strip()},a.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,s=0|i.words[i.length-1];0!=(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var o,c=n.length-i.length;if("mod"!==t){(o=new a(null)).length=c+1,o.words=new Array(o.length);for(var u=0;u<o.length;u++)o.words[u]=0}var f=n.clone()._ishlnsubmul(i,1,c);0===f.negative&&(n=f,o&&(o.words[c]=1));for(var h=c-1;h>=0;h--){var l=67108864*(0|n.words[i.length+h])+(0|n.words[i.length+h-1]);for(l=Math.min(l/s|0,67108863),n._ishlnsubmul(i,l,h);0!==n.negative;)l--,n.negative=0,n._ishlnsubmul(i,1,h),n.isZero()||(n.negative^=1);o&&(o.words[h]=l)}return o&&o.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:o||null,mod:n}},a.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new a(0),mod:new a(0)}:0!==this.negative&&0===e.negative?(o=this.neg().divmod(e,t),"mod"!==t&&(i=o.div.neg()),"div"!==t&&(s=o.mod.neg(),r&&0!==s.negative&&s.iadd(e)),{div:i,mod:s}):0===this.negative&&0!==e.negative?(o=this.divmod(e.neg(),t),"mod"!==t&&(i=o.div.neg()),{div:i,mod:o.mod}):this.negative&e.negative?(o=this.neg().divmod(e.neg(),t),"div"!==t&&(s=o.mod.neg(),r&&0!==s.negative&&s.isub(e)),{div:o.div,mod:s}):e.length>this.length||this.cmp(e)<0?{div:new a(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new a(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new a(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,s,o},a.prototype.div=function(e){return this.divmod(e,"div",!1).div},a.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},a.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},a.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),a=r.cmp(n);return a<0||1===i&&0===a?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},a.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;i>=0;i--)r=(t*r+(0|this.words[i]))%e;return r},a.prototype.idivn=function(e){n(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},a.prototype.divn=function(e){return this.clone().idivn(e)},a.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new a(1),s=new a(0),o=new a(0),c=new a(1),u=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++u;for(var f=r.clone(),h=t.clone();!t.isZero();){for(var l=0,d=1;!(t.words[0]&d)&&l<26;++l,d<<=1);if(l>0)for(t.iushrn(l);l-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(f),s.isub(h)),i.iushrn(1),s.iushrn(1);for(var p=0,g=1;!(r.words[0]&g)&&p<26;++p,g<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(o.isOdd()||c.isOdd())&&(o.iadd(f),c.isub(h)),o.iushrn(1),c.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(o),s.isub(c)):(r.isub(t),o.isub(i),c.isub(s))}return{a:o,b:c,gcd:r.iushln(u)}},a.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,s=new a(1),o=new a(0),c=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var u=0,f=1;!(t.words[0]&f)&&u<26;++u,f<<=1);if(u>0)for(t.iushrn(u);u-- >0;)s.isOdd()&&s.iadd(c),s.iushrn(1);for(var h=0,l=1;!(r.words[0]&l)&&h<26;++h,l<<=1);if(h>0)for(r.iushrn(h);h-- >0;)o.isOdd()&&o.iadd(c),o.iushrn(1);t.cmp(r)>=0?(t.isub(r),s.isub(o)):(r.isub(t),o.isub(s))}return(i=0===t.cmpn(1)?s:o).cmpn(0)<0&&i.iadd(e),i},a.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var a=t;t=r,r=a}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},a.prototype.invm=function(e){return this.egcd(e).a.umod(e)},a.prototype.isEven=function(){return!(1&this.words[0])},a.prototype.isOdd=function(){return!(1&~this.words[0])},a.prototype.andln=function(e){return this.words[0]&e},a.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,i=1<<t;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var a=i,s=r;0!==a&&s<this.length;s++){var o=0|this.words[s];a=(o+=a)>>>26,o&=67108863,this.words[s]=o}return 0!==a&&(this.words[s]=a,this.length++),this},a.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},a.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:i<e?-1:1}return 0!==this.negative?0|-t:t},a.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},a.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){n<i?t=-1:n>i&&(t=1);break}}return t},a.prototype.gtn=function(e){return 1===this.cmpn(e)},a.prototype.gt=function(e){return 1===this.cmp(e)},a.prototype.gten=function(e){return this.cmpn(e)>=0},a.prototype.gte=function(e){return this.cmp(e)>=0},a.prototype.ltn=function(e){return-1===this.cmpn(e)},a.prototype.lt=function(e){return-1===this.cmp(e)},a.prototype.lten=function(e){return this.cmpn(e)<=0},a.prototype.lte=function(e){return this.cmp(e)<=0},a.prototype.eqn=function(e){return 0===this.cmpn(e)},a.prototype.eq=function(e){return 0===this.cmp(e)},a.red=function(e){return new E(e)},a.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},a.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(e){return this.red=e,this},a.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},a.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},a.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},a.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},a.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},a.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},a.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},a.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},a.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var y={k256:null,p224:null,p192:null,p25519:null};function v(e,t){this.name=e,this.p=new a(t,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function m(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function S(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function E(e){if("string"==typeof e){var t=a._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function C(e){E.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new a(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}v.prototype._tmp=function(){var e=new a(null);return e.words=new Array(Math.ceil(this.n/13)),e},v.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):r.strip(),r},v.prototype.split=function(e,t){e.iushrn(this.n,0,t)},v.prototype.imulK=function(e){return e.imul(this.k)},i(m,v),m.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),i=0;i<n;i++)t.words[i]=e.words[i];if(t.length=n,e.length<=9)return e.words[0]=0,void(e.length=1);var a=e.words[9];for(t.words[t.length++]=a&r,i=10;i<e.length;i++){var s=0|e.words[i];e.words[i-10]=(s&r)<<4|a>>>22,a=s}a>>>=22,e.words[i-10]=a,0===a&&e.length>10?e.length-=10:e.length-=9},m.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var n=0|e.words[r];t+=977*n,e.words[r]=67108863&t,t=64*n+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},i(b,v),i(w,v),i(S,v),S.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var n=19*(0|e.words[r])+t,i=67108863&n;n>>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},a._prime=function(e){if(y[e])return y[e];var t;if("k256"===e)t=new m;else if("p224"===e)t=new b;else if("p192"===e)t=new w;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new S}return y[e]=t,t},E.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},E.prototype._verify2=function(e,t){n(!(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},E.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},E.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},E.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},E.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},E.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},E.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},E.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},E.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},E.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},E.prototype.isqr=function(e){return this.imul(e,e.clone())},E.prototype.sqr=function(e){return this.mul(e,e)},E.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new a(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var o=new a(1).toRed(this),c=o.redNeg(),u=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new a(2*f*f).toRed(this);0!==this.pow(f,u).cmp(c);)f.redIAdd(c);for(var h=this.pow(f,i),l=this.pow(e,i.addn(1).iushrn(1)),d=this.pow(e,i),p=s;0!==d.cmp(o);){for(var g=d,y=0;0!==g.cmp(o);y++)g=g.redSqr();n(y<p);var v=this.pow(h,new a(1).iushln(p-y-1));l=l.redMul(v),h=v.redSqr(),d=d.redMul(h),p=y}return l},E.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},E.prototype.pow=function(e,t){if(t.isZero())return new a(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new a(1).toRed(this),r[1]=e;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],e);var i=r[0],s=0,o=0,c=t.bitLength()%26;for(0===c&&(c=26),n=t.length-1;n>=0;n--){for(var u=t.words[n],f=c-1;f>=0;f--){var h=u>>f&1;i!==r[0]&&(i=this.sqr(i)),0!==h||0!==s?(s<<=1,s|=h,(4==++o||0===n&&0===f)&&(i=this.mul(i,r[s]),o=0,s=0)):o=0}c=26}return i},E.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},E.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},a.mont=function(e){return new C(e)},i(C,E),C.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},C.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},C.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},C.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new a(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},C.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===e||e,this)}).call(this,r(131)(e))},function(e,t,r){"use strict";var n=t;n.version=r(124).version,n.utils=r(123),n.rand=r(54),n.curve=r(21),n.curves=r(118),n.ec=r(110),n.eddsa=r(106)},function(e,t){function r(e,t){if(!e)throw new Error(t||"Assertion failed")}e.exports=r,r.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)}},function(e,t,r){"use strict";var n=r(5),i=r(0);function a(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function s(e){return 1===e.length?"0"+e:e}function o(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}t.inherits=i,t.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),n=0;n<e.length;n+=2)r.push(parseInt(e[n]+e[n+1],16))}else for(var n=0;n<e.length;n++){var i=e.charCodeAt(n),a=i>>8,s=255&i;a?r.push(a,s):r.push(s)}else for(n=0;n<e.length;n++)r[n]=0|e[n];return r},t.toHex=function(e){for(var t="",r=0;r<e.length;r++)t+=s(e[r].toString(16));return t},t.htonl=a,t.toHex32=function(e,t){for(var r="",n=0;n<e.length;n++){var i=e[n];"little"===t&&(i=a(i)),r+=o(i.toString(16))}return r},t.zero2=s,t.zero8=o,t.join32=function(e,t,r,i){var a=r-t;n(a%4==0);for(var s=new Array(a/4),o=0,c=t;o<s.length;o++,c+=4){var u;u="big"===i?e[c]<<24|e[c+1]<<16|e[c+2]<<8|e[c+3]:e[c+3]<<24|e[c+2]<<16|e[c+1]<<8|e[c],s[o]=u>>>0}return s},t.split32=function(e,t){for(var r=new Array(4*e.length),n=0,i=0;n<e.length;n++,i+=4){var a=e[n];"big"===t?(r[i]=a>>>24,r[i+1]=a>>>16&255,r[i+2]=a>>>8&255,r[i+3]=255&a):(r[i+3]=a>>>24,r[i+2]=a>>>16&255,r[i+1]=a>>>8&255,r[i]=255&a)}return r},t.rotr32=function(e,t){return e>>>t|e<<32-t},t.rotl32=function(e,t){return e<<t|e>>>32-t},t.sum32=function(e,t){return e+t>>>0},t.sum32_3=function(e,t,r){return e+t+r>>>0},t.sum32_4=function(e,t,r,n){return e+t+r+n>>>0},t.sum32_5=function(e,t,r,n,i){return e+t+r+n+i>>>0},t.sum64=function(e,t,r,n){var i=e[t],a=n+e[t+1]>>>0,s=(a<n?1:0)+r+i;e[t]=s>>>0,e[t+1]=a},t.sum64_hi=function(e,t,r,n){return(t+n>>>0<t?1:0)+e+r>>>0},t.sum64_lo=function(e,t,r,n){return t+n>>>0},t.sum64_4_hi=function(e,t,r,n,i,a,s,o){var c=0,u=t;return c+=(u=u+n>>>0)<t?1:0,c+=(u=u+a>>>0)<a?1:0,e+r+i+s+(c+=(u=u+o>>>0)<o?1:0)>>>0},t.sum64_4_lo=function(e,t,r,n,i,a,s,o){return t+n+a+o>>>0},t.sum64_5_hi=function(e,t,r,n,i,a,s,o,c,u){var f=0,h=t;return f+=(h=h+n>>>0)<t?1:0,f+=(h=h+a>>>0)<a?1:0,f+=(h=h+o>>>0)<o?1:0,e+r+i+s+c+(f+=(h=h+u>>>0)<u?1:0)>>>0},t.sum64_5_lo=function(e,t,r,n,i,a,s,o,c,u){return t+n+a+o+u>>>0},t.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},t.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},t.shr64_hi=function(e,t,r){return e>>>r},t.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0}},function(e,t){var r;r=function(){return this}();try{r=r||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(r=window)}e.exports=r},function(e,t,r){var n=r(1).Buffer,i=r(37).Transform,a=r(33).StringDecoder;function s(e){i.call(this),this.hashMode="string"==typeof e,this.hashMode?this[e]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}r(0)(s,i),s.prototype.update=function(e,t,r){"string"==typeof e&&(e=n.from(e,t));var i=this._update(e);return this.hashMode?this:(r&&(i=this._toString(i,r)),i)},s.prototype.setAutoPadding=function(){},s.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},s.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},s.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},s.prototype._transform=function(e,t,r){var n;try{this.hashMode?this._update(e):this.push(this._update(e))}catch(e){n=e}finally{r(n)}},s.prototype._flush=function(e){var t;try{this.push(this.__final())}catch(e){t=e}e(t)},s.prototype._finalOrDigest=function(e){var t=this.__final()||n.alloc(0);return e&&(t=this._toString(t,e,!0)),t},s.prototype._toString=function(e,t,r){if(this._decoder||(this._decoder=new a(t),this._encoding=t),this._encoding!==t)throw new Error("can't switch encodings");var n=this._decoder.write(e);return r&&(n+=this._decoder.end()),n},e.exports=s},function(e,t){var r,n,i=e.exports={};function a(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function o(e){if(r===setTimeout)return setTimeout(e,0);if((r===a||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:a}catch(e){r=a}try{n="function"==typeof clearTimeout?clearTimeout:s}catch(e){n=s}}();var c,u=[],f=!1,h=-1;function l(){f&&c&&(f=!1,c.length?u=c.concat(u):h=-1,u.length&&d())}function d(){if(!f){var e=o(l);f=!0;for(var t=u.length;t;){for(c=u,u=[];++h<t;)c&&c[h].run();h=-1,t=u.length}c=null,f=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===s||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{return n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function g(){}i.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];u.push(new p(e,t)),1!==u.length||f||o(d)},p.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=g,i.addListener=g,i.once=g,i.off=g,i.removeListener=g,i.removeAllListeners=g,i.emit=g,i.prependListener=g,i.prependOnceListener=g,i.listeners=function(e){return[]},i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(e,t,r){"use strict";var n=r(24),i=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=h;var a=r(17);a.inherits=r(0);var s=r(74),o=r(34);a.inherits(h,s);for(var c=i(o.prototype),u=0;u<c.length;u++){var f=c[u];h.prototype[f]||(h.prototype[f]=o.prototype[f])}function h(e){if(!(this instanceof h))return new h(e);s.call(this,e),o.call(this,e),e&&!1===e.readable&&(this.readable=!1),e&&!1===e.writable&&(this.writable=!1),this.allowHalfOpen=!0,e&&!1===e.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",l)}function l(){this.allowHalfOpen||this._writableState.ended||n.nextTick(d,this)}function d(e){e.end()}Object.defineProperty(h.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(h.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}),h.prototype._destroy=function(e,t){this.push(null),this.end(),n.nextTick(t,e)}},function(e,t,r){var n=r(1).Buffer;function i(e,t){this._block=n.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}i.prototype.update=function(e,t){"string"==typeof e&&(t=t||"utf8",e=n.from(e,t));for(var r=this._block,i=this._blockSize,a=e.length,s=this._len,o=0;o<a;){for(var c=s%i,u=Math.min(a-o,i-c),f=0;f<u;f++)r[c+f]=e[o+f];o+=u,(s+=u)%i==0&&this._update(r)}return this._len+=a,this},i.prototype.digest=function(e){var t=this._len%this._blockSize;this._block[t]=128,this._block.fill(0,t+1),t>=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(4294967295&r)>>>0,i=(r-n)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var a=this._hash();return e?a.toString(e):a},i.prototype._update=function(){throw new Error("_update must be implemented by subclass")},e.exports=i},function(e,t,r){"use strict";(function(t,n){var i=r(1).Buffer,a=t.crypto||t.msCrypto;a&&a.getRandomValues?e.exports=function(e,r){if(e>65536)throw new Error("requested too many random bytes");var s=new t.Uint8Array(e);e>0&&a.getRandomValues(s);var o=i.from(s.buffer);return"function"==typeof r?n.nextTick((function(){r(null,o)})):o}:e.exports=function(){throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11")}}).call(this,r(7),r(9))},function(e,t,r){var n=t;n.Reporter=r(99).Reporter,n.DecoderBuffer=r(49).DecoderBuffer,n.EncoderBuffer=r(49).EncoderBuffer,n.Node=r(98)},function(e,t,r){var n=t;n.bignum=r(3),n.define=r(102).define,n.base=r(13),n.constants=r(48),n.decoders=r(96),n.encoders=r(94)},function(e,t,r){"use strict";var n=r(6),i=r(5);function a(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}t.BlockHash=a,a.prototype.update=function(e,t){if(e=n.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var r=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=n.join32(e,0,e.length-r,this.endian);for(var i=0;i<e.length;i+=this._delta32)this._update(e,i,i+this._delta32)}return this},a.prototype.digest=function(e){return this.update(this._pad()),i(null===this.pending),this._digest(e)},a.prototype._pad=function(){var e=this.pendingTotal,t=this._delta8,r=t-(e+this.padLength)%t,n=new Array(r+this.padLength);n[0]=128;for(var i=1;i<r;i++)n[i]=0;if(e<<=3,"big"===this.endian){for(var a=8;a<this.padLength;a++)n[i++]=0;n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=e>>>24&255,n[i++]=e>>>16&255,n[i++]=e>>>8&255,n[i++]=255&e}else for(n[i++]=255&e,n[i++]=e>>>8&255,n[i++]=e>>>16&255,n[i++]=e>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,a=8;a<this.padLength;a++)n[i++]=0;return n}},function(e,t,r){(function(t){e.exports=function(e,r){for(var n=Math.min(e.length,r.length),i=new t(n),a=0;a<n;++a)i[a]=e[a]^r[a];return i}}).call(this,r(2).Buffer)},function(e,t,r){(function(e){function r(e){return Object.prototype.toString.call(e)}t.isArray=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===r(e)},t.isBoolean=function(e){return"boolean"==typeof e},t.isNull=function(e){return null===e},t.isNullOrUndefined=function(e){return null==e},t.isNumber=function(e){return"number"==typeof e},t.isString=function(e){return"string"==typeof e},t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=function(e){return void 0===e},t.isRegExp=function(e){return"[object RegExp]"===r(e)},t.isObject=function(e){return"object"==typeof e&&null!==e},t.isDate=function(e){return"[object Date]"===r(e)},t.isError=function(e){return"[object Error]"===r(e)||e instanceof Error},t.isFunction=function(e){return"function"==typeof e},t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=e.isBuffer}).call(this,r(2).Buffer)},function(e,t,r){"use strict";var n=r(0),i=r(38),a=r(32),s=r(31),o=r(8);function c(e){o.call(this,"digest"),this._hash=e}n(c,o),c.prototype._update=function(e){this._hash.update(e)},c.prototype._final=function(){return this._hash.digest()},e.exports=function(e){return"md5"===(e=e.toLowerCase())?new i:"rmd160"===e||"ripemd160"===e?new a:new c(s(e))}},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.NotSupportedError=function(e){function t(){return n(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return a(t,Error),t}(),t.DataError=function(e){function t(){return n(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return a(t,Error),t}(),t.OperationError=function(e){function t(){return n(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return a(t,Error),t}()},function(e,t,r){(function(t){var n=r(103),i=r(91),a=r(90),s=r(29),o=r(65);function c(e){var r;"object"!=typeof e||t.isBuffer(e)||(r=e.passphrase,e=e.key),"string"==typeof e&&(e=new t(e));var c,u,f=a(e,r),h=f.tag,l=f.data;switch(h){case"CERTIFICATE":u=n.certificate.decode(l,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(u||(u=n.PublicKey.decode(l,"der")),c=u.algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return n.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=n.DSAparam.decode(u.subjectPublicKey.data,"der"),{type:"dsa",data:u.algorithm.params};default:throw new Error("unknown key id "+c)}throw new Error("unknown key type "+h);case"ENCRYPTED PRIVATE KEY":l=function(e,r){var n=e.algorithm.decrypt.kde.kdeparams.salt,a=parseInt(e.algorithm.decrypt.kde.kdeparams.iters.toString(),10),c=i[e.algorithm.decrypt.cipher.algo.join(".")],u=e.algorithm.decrypt.cipher.iv,f=e.subjectPrivateKey,h=parseInt(c.split("-")[1],10)/8,l=o.pbkdf2Sync(r,n,a,h),d=s.createDecipheriv(c,l,u),p=[];return p.push(d.update(f)),p.push(d.final()),t.concat(p)}(l=n.EncryptedPrivateKey.decode(l,"der"),r);case"PRIVATE KEY":switch(c=(u=n.PrivateKey.decode(l,"der")).algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return n.RSAPrivateKey.decode(u.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:u.algorithm.curve,privateKey:n.ECPrivateKey.decode(u.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return u.algorithm.params.priv_key=n.DSAparam.decode(u.subjectPrivateKey,"der"),{type:"dsa",params:u.algorithm.params};default:throw new Error("unknown key id "+c)}throw new Error("unknown key type "+h);case"RSA PUBLIC KEY":return n.RSAPublicKey.decode(l,"der");case"RSA PRIVATE KEY":return n.RSAPrivateKey.decode(l,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:n.DSAPrivateKey.decode(l,"der")};case"EC PRIVATE KEY":return{curve:(l=n.ECPrivateKey.decode(l,"der")).parameters.value,privateKey:l.privateKey};default:throw new Error("unknown key type "+h)}}e.exports=c,c.signature=n.signature}).call(this,r(2).Buffer)},function(e,t,r){"use strict";var n=t;n.base=r(122),n.short=r(121),n.mont=r(120),n.edwards=r(119)},function(e,t,r){var n=r(1).Buffer,i=r(38);e.exports=function(e,t,r,a){if(n.isBuffer(e)||(e=n.from(e,"binary")),t&&(n.isBuffer(t)||(t=n.from(t,"binary")),8!==t.length))throw new RangeError("salt should be Buffer with 8 byte length");for(var s=r/8,o=n.alloc(s),c=n.alloc(a||0),u=n.alloc(0);s>0||a>0;){var f=new i;f.update(u),f.update(e),t&&f.update(t),u=f.digest();var h=0;if(s>0){var l=o.length-s;h=Math.min(s,u.length),u.copy(o,l,0,h),s-=h}if(h<u.length&&a>0){var d=c.length-a,p=Math.min(a,u.length-h);u.copy(c,d,h,h+p),a-=p}}return u.fill(0),{key:o,iv:c}}},function(e,t,r){var n=r(1).Buffer;function i(e){n.isBuffer(e)||(e=n.from(e));for(var t=e.length/4|0,r=new Array(t),i=0;i<t;i++)r[i]=e.readUInt32BE(4*i);return r}function a(e){for(;0<e.length;e++)e[0]=0}function s(e,t,r,n,i){for(var a,s,o,c,u=r[0],f=r[1],h=r[2],l=r[3],d=e[0]^t[0],p=e[1]^t[1],g=e[2]^t[2],y=e[3]^t[3],v=4,m=1;m<i;m++)a=u[d>>>24]^f[p>>>16&255]^h[g>>>8&255]^l[255&y]^t[v++],s=u[p>>>24]^f[g>>>16&255]^h[y>>>8&255]^l[255&d]^t[v++],o=u[g>>>24]^f[y>>>16&255]^h[d>>>8&255]^l[255&p]^t[v++],c=u[y>>>24]^f[d>>>16&255]^h[p>>>8&255]^l[255&g]^t[v++],d=a,p=s,g=o,y=c;return a=(n[d>>>24]<<24|n[p>>>16&255]<<16|n[g>>>8&255]<<8|n[255&y])^t[v++],s=(n[p>>>24]<<24|n[g>>>16&255]<<16|n[y>>>8&255]<<8|n[255&d])^t[v++],o=(n[g>>>24]<<24|n[y>>>16&255]<<16|n[d>>>8&255]<<8|n[255&p])^t[v++],c=(n[y>>>24]<<24|n[d>>>16&255]<<16|n[p>>>8&255]<<8|n[255&g])^t[v++],[a>>>=0,s>>>=0,o>>>=0,c>>>=0]}var o=[0,1,2,4,8,16,32,64,128,27,54],c=function(){for(var e=new Array(256),t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;for(var r=[],n=[],i=[[],[],[],[]],a=[[],[],[],[]],s=0,o=0,c=0;c<256;++c){var u=o^o<<1^o<<2^o<<3^o<<4;u=u>>>8^255&u^99,r[s]=u,n[u]=s;var f=e[s],h=e[f],l=e[h],d=257*e[u]^16843008*u;i[0][s]=d<<24|d>>>8,i[1][s]=d<<16|d>>>16,i[2][s]=d<<8|d>>>24,i[3][s]=d,d=16843009*l^65537*h^257*f^16843008*s,a[0][u]=d<<24|d>>>8,a[1][u]=d<<16|d>>>16,a[2][u]=d<<8|d>>>24,a[3][u]=d,0===s?s=o=1:(s=f^e[e[e[l^f]]],o^=e[e[o]])}return{SBOX:r,INV_SBOX:n,SUB_MIX:i,INV_SUB_MIX:a}}();function u(e){this._key=i(e),this._reset()}u.blockSize=16,u.keySize=32,u.prototype.blockSize=u.blockSize,u.prototype.keySize=u.keySize,u.prototype._reset=function(){for(var e=this._key,t=e.length,r=t+6,n=4*(r+1),i=[],a=0;a<t;a++)i[a]=e[a];for(a=t;a<n;a++){var s=i[a-1];a%t==0?(s=s<<8|s>>>24,s=c.SBOX[s>>>24]<<24|c.SBOX[s>>>16&255]<<16|c.SBOX[s>>>8&255]<<8|c.SBOX[255&s],s^=o[a/t|0]<<24):t>6&&a%t==4&&(s=c.SBOX[s>>>24]<<24|c.SBOX[s>>>16&255]<<16|c.SBOX[s>>>8&255]<<8|c.SBOX[255&s]),i[a]=i[a-t]^s}for(var u=[],f=0;f<n;f++){var h=n-f,l=i[h-(f%4?0:4)];u[f]=f<4||h<=4?l:c.INV_SUB_MIX[0][c.SBOX[l>>>24]]^c.INV_SUB_MIX[1][c.SBOX[l>>>16&255]]^c.INV_SUB_MIX[2][c.SBOX[l>>>8&255]]^c.INV_SUB_MIX[3][c.SBOX[255&l]]}this._nRounds=r,this._keySchedule=i,this._invKeySchedule=u},u.prototype.encryptBlockRaw=function(e){return s(e=i(e),this._keySchedule,c.SUB_MIX,c.SBOX,this._nRounds)},u.prototype.encryptBlock=function(e){var t=this.encryptBlockRaw(e),r=n.allocUnsafe(16);return r.writeUInt32BE(t[0],0),r.writeUInt32BE(t[1],4),r.writeUInt32BE(t[2],8),r.writeUInt32BE(t[3],12),r},u.prototype.decryptBlock=function(e){var t=(e=i(e))[1];e[1]=e[3],e[3]=t;var r=s(e,this._invKeySchedule,c.INV_SUB_MIX,c.INV_SBOX,this._nRounds),a=n.allocUnsafe(16);return a.writeUInt32BE(r[0],0),a.writeUInt32BE(r[3],4),a.writeUInt32BE(r[2],8),a.writeUInt32BE(r[1],12),a},u.prototype.scrub=function(){a(this._keySchedule),a(this._invKeySchedule),a(this._key)},e.exports.AES=u},function(e,t,r){"use strict";(function(t){!t.version||0===t.version.indexOf("v0.")||0===t.version.indexOf("v1.")&&0!==t.version.indexOf("v1.8.")?e.exports={nextTick:function(e,r,n,i){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var a,s,o=arguments.length;switch(o){case 0:case 1:return t.nextTick(e);case 2:return t.nextTick((function(){e.call(null,r)}));case 3:return t.nextTick((function(){e.call(null,r,n)}));case 4:return t.nextTick((function(){e.call(null,r,n,i)}));default:for(a=new Array(o-1),s=0;s<a.length;)a[s++]=arguments[s];return t.nextTick((function(){e.apply(null,a)}))}}}:e.exports=t}).call(this,r(9))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSeed=function(e){var t=new n.GostRandom;try{var r=new Uint8Array(Math.ceil(e/8));return t.getRandomValues(r),r}catch(e){throw new Error("Error occurred during random values generation")}},t.randomSeed=function(e){try{return(new n.GostRandom).getRandomValues(e)}catch(e){throw new Error("Error occurred during random values generation")}};var n=r(80)},function(e,t,r){var n=t;n.utils=r(6),n.common=r(15),n.sha=r(117),n.ripemd=r(113),n.hmac=r(112),n.sha1=n.sha.sha1,n.sha256=n.sha.sha256,n.sha224=n.sha.sha224,n.sha384=n.sha.sha384,n.sha512=n.sha.sha512,n.ripemd160=n.ripemd.ripemd160},function(e,t,r){(function(t){var n=r(3),i=r(12);function a(e,r){var i=function(e){var t=s(e);return{blinder:t.toRed(n.mont(e.modulus)).redPow(new n(e.publicExponent)).fromRed(),unblinder:t.invm(e.modulus)}}(r),a=r.modulus.byteLength(),o=(n.mont(r.modulus),new n(e).mul(i.blinder).umod(r.modulus)),c=o.toRed(n.mont(r.prime1)),u=o.toRed(n.mont(r.prime2)),f=r.coefficient,h=r.prime1,l=r.prime2,d=c.redPow(r.exponent1),p=u.redPow(r.exponent2);d=d.fromRed(),p=p.fromRed();var g=d.isub(p).imul(f).umod(h);return g.imul(l),p.iadd(g),new t(p.imul(i.unblinder).umod(r.modulus).toArray(!1,a))}function s(e){for(var t=e.modulus.byteLength(),r=new n(i(t));r.cmp(e.modulus)>=0||!r.umod(e.prime1)||!r.umod(e.prime2);)r=new n(i(t));return r}e.exports=a,a.getr=s}).call(this,r(2).Buffer)},function(e,t,r){var n={ECB:r(141),CBC:r(140),CFB:r(139),CFB8:r(138),CFB1:r(137),OFB:r(136),CTR:r(61),GCM:r(61)},i=r(59);for(var a in i)i[a].module=n[i[a].mode];e.exports=i},function(e,t,r){var n=r(142),i=r(134),a=r(59);t.createCipher=t.Cipher=n.createCipher,t.createCipheriv=t.Cipheriv=n.createCipheriv,t.createDecipher=t.Decipher=i.createDecipher,t.createDecipheriv=t.Decipheriv=i.createDecipheriv,t.listCiphers=t.getCiphers=function(){return Object.keys(a)}},function(e,t,r){"use strict";t.utils=r(147),t.Cipher=r(146),t.DES=r(145),t.CBC=r(144),t.EDE=r(143)},function(e,t,r){(t=e.exports=function(e){e=e.toLowerCase();var r=t[e];if(!r)throw new Error(e+" is not supported (we accept pull requests)");return new r}).sha=r(156),t.sha1=r(155),t.sha224=r(154),t.sha256=r(70),t.sha384=r(153),t.sha512=r(69)},function(e,t,r){"use strict";var n=r(2).Buffer,i=r(0),a=r(75),s=new Array(16),o=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],c=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],u=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],f=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],h=[0,1518500249,1859775393,2400959708,2840853838],l=[1352829926,1548603684,1836072691,2053994217,0];function d(){a.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function p(e,t){return e<<t|e>>>32-t}function g(e,t,r,n,i,a,s,o){return p(e+(t^r^n)+a+s|0,o)+i|0}function y(e,t,r,n,i,a,s,o){return p(e+(t&r|~t&n)+a+s|0,o)+i|0}function v(e,t,r,n,i,a,s,o){return p(e+((t|~r)^n)+a+s|0,o)+i|0}function m(e,t,r,n,i,a,s,o){return p(e+(t&n|r&~n)+a+s|0,o)+i|0}function b(e,t,r,n,i,a,s,o){return p(e+(t^(r|~n))+a+s|0,o)+i|0}i(d,a),d.prototype._update=function(){for(var e=s,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);for(var r=0|this._a,n=0|this._b,i=0|this._c,a=0|this._d,d=0|this._e,w=0|this._a,S=0|this._b,E=0|this._c,C=0|this._d,A=0|this._e,B=0;B<80;B+=1){var x,T;B<16?(x=g(r,n,i,a,d,e[o[B]],h[0],u[B]),T=b(w,S,E,C,A,e[c[B]],l[0],f[B])):B<32?(x=y(r,n,i,a,d,e[o[B]],h[1],u[B]),T=m(w,S,E,C,A,e[c[B]],l[1],f[B])):B<48?(x=v(r,n,i,a,d,e[o[B]],h[2],u[B]),T=v(w,S,E,C,A,e[c[B]],l[2],f[B])):B<64?(x=m(r,n,i,a,d,e[o[B]],h[3],u[B]),T=y(w,S,E,C,A,e[c[B]],l[3],f[B])):(x=b(r,n,i,a,d,e[o[B]],h[4],u[B]),T=g(w,S,E,C,A,e[c[B]],l[4],f[B])),r=d,d=a,a=p(i,10),i=n,n=x,w=A,A=C,C=p(E,10),E=S,S=T}var I=this._b+i+C|0;this._b=this._c+a+A|0,this._c=this._d+d+w|0,this._d=this._e+r+S|0,this._e=this._a+n+E|0,this._a=I},d.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=n.alloc?n.alloc(20):new n(20);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e.writeInt32LE(this._e,16),e},e.exports=d},function(e,t,r){"use strict";var n=r(1).Buffer,i=n.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function a(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(n.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=c,this.end=u,t=4;break;case"utf8":this.fillLast=o,t=4;break;case"base64":this.text=f,this.end=h,t=3;break;default:return this.write=l,void(this.end=d)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function s(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function o(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"<22>";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"<22>";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"<22>"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function c(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function u(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function f(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function h(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function l(e){return e.toString(this.encoding)}function d(e){return e&&e.length?this.write(e):""}t.StringDecoder=a,a.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""},a.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"<22>":t},a.prototype.text=function(e,t){var r=function(e,t,r){var n=t.length-1;if(n<r)return 0;var i=s(t[n]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--n<r||-2===i?0:(i=s(t[n]))>=0?(i>0&&(e.lastNeed=i-2),i):--n<r||-2===i?0:(i=s(t[n]))>=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},a.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},function(e,t,r){"use strict";(function(t,n,i){var a=r(24);function s(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,r){var n=e.entry;for(e.entry=null;n;){var i=n.callback;t.pendingcb--,i(undefined),n=n.next}t.corkedRequestsFree?t.corkedRequestsFree.next=e:t.corkedRequestsFree=e}(t,e)}}e.exports=m;var o,c=!t.browser&&["v0.10","v0.9."].indexOf(t.version.slice(0,5))>-1?n:a.nextTick;m.WritableState=v;var u=r(17);u.inherits=r(0);var f,h={deprecate:r(162)},l=r(73),d=r(1).Buffer,p=i.Uint8Array||function(){},g=r(72);function y(){}function v(e,t){o=o||r(10),e=e||{};var n=t instanceof o;this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var i=e.highWaterMark,u=e.writableHighWaterMark,f=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(u||0===u)?u:f,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var h=!1===e.decodeStrings;this.decodeStrings=!h,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var r=e._writableState,n=r.sync,i=r.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,n,i){--t.pendingcb,r?(a.nextTick(i,n),a.nextTick(A,e,t),e._writableState.errorEmitted=!0,e.emit("error",n)):(i(n),e._writableState.errorEmitted=!0,e.emit("error",n),A(e,t))}(e,r,n,t,i);else{var s=E(r);s||r.corked||r.bufferProcessing||!r.bufferedRequest||S(e,r),n?c(w,e,r,s,i):w(e,r,s,i)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new s(this)}function m(e){if(o=o||r(10),!(f.call(m,this)||this instanceof o))return new m(e);this._writableState=new v(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),l.call(this)}function b(e,t,r,n,i,a,s){t.writelen=n,t.writecb=s,t.writing=!0,t.sync=!0,r?e._writev(i,t.onwrite):e._write(i,a,t.onwrite),t.sync=!1}function w(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),A(e,t)}function S(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,i=new Array(n),a=t.corkedRequestsFree;a.entry=r;for(var o=0,c=!0;r;)i[o]=r,r.isBuf||(c=!1),r=r.next,o+=1;i.allBuffers=c,b(e,t,!0,t.length,i,"",a.finish),t.pendingcb++,t.lastBufferedRequest=null,a.next?(t.corkedRequestsFree=a.next,a.next=null):t.corkedRequestsFree=new s(t),t.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,f=r.encoding,h=r.callback;if(b(e,t,!1,t.objectMode?1:u.length,u,f,h),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function E(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function C(e,t){e._final((function(r){t.pendingcb--,r&&e.emit("error",r),t.prefinished=!0,e.emit("prefinish"),A(e,t)}))}function A(e,t){var r=E(t);return r&&(function(e,t){t.prefinished||t.finalCalled||("function"==typeof e._final?(t.pendingcb++,t.finalCalled=!0,a.nextTick(C,e,t)):(t.prefinished=!0,e.emit("prefinish")))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),r}u.inherits(m,l),v.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(v.prototype,"buffer",{get:h.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(f=Function.prototype[Symbol.hasInstance],Object.defineProperty(m,Symbol.hasInstance,{value:function(e){return!!f.call(this,e)||this===m&&e&&e._writableState instanceof v}})):f=function(e){return e instanceof this},m.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},m.prototype.write=function(e,t,r){var n,i=this._writableState,s=!1,o=!i.objectMode&&(n=e,d.isBuffer(n)||n instanceof p);return o&&!d.isBuffer(e)&&(e=function(e){return d.from(e)}(e)),"function"==typeof t&&(r=t,t=null),o?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof r&&(r=y),i.ended?function(e,t){var r=new Error("write after end");e.emit("error",r),a.nextTick(t,r)}(this,r):(o||function(e,t,r,n){var i=!0,s=!1;return null===r?s=new TypeError("May not write null values to stream"):"string"==typeof r||void 0===r||t.objectMode||(s=new TypeError("Invalid non-string/buffer chunk")),s&&(e.emit("error",s),a.nextTick(n,s),i=!1),i}(this,i,e,r))&&(i.pendingcb++,s=function(e,t,r,n,i,a){if(!r){var s=function(e,t,r){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=d.from(t,r)),t}(t,n,i);n!==s&&(r=!0,i="buffer",n=s)}var o=t.objectMode?1:n.length;t.length+=o;var c=t.length<t.highWaterMark;if(c||(t.needDrain=!0),t.writing||t.corked){var u=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:a,next:null},u?u.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else b(e,t,!1,o,n,i,a);return c}(this,i,o,e,t,r)),s},m.prototype.cork=function(){this._writableState.corked++},m.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.bufferedRequest||S(this,e))},m.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(m.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),m.prototype._write=function(e,t,r){r(new Error("_write() is not implemented"))},m.prototype._writev=null,m.prototype.end=function(e,t,r){var n=this._writableState;"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||n.finished||function(e,t,r){t.ending=!0,A(e,t),r&&(t.finished?a.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}(this,n,r)},Object.defineProperty(m.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),m.prototype.destroy=g.destroy,m.prototype._undestroy=g.undestroy,m.prototype._destroy=function(e,t){this.end(),t(e)}}).call(this,r(9),r(164).setImmediate,r(7))},function(e,t,r){(t=e.exports=r(74)).Stream=t,t.Readable=t,t.Writable=r(34),t.Duplex=r(10),t.Transform=r(71),t.PassThrough=r(161)},function(e,t){function r(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function n(e){return"function"==typeof e}function i(e){return"object"==typeof e&&null!==e}function a(e){return void 0===e}e.exports=r,r.EventEmitter=r,r.prototype._events=void 0,r.prototype._maxListeners=void 0,r.defaultMaxListeners=10,r.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},r.prototype.emit=function(e){var t,r,s,o,c,u;if(this._events||(this._events={}),"error"===e&&(!this._events.error||i(this._events.error)&&!this._events.error.length)){if((t=arguments[1])instanceof Error)throw t;var f=new Error('Uncaught, unspecified "error" event. ('+t+")");throw f.context=t,f}if(a(r=this._events[e]))return!1;if(n(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:o=Array.prototype.slice.call(arguments,1),r.apply(this,o)}else if(i(r))for(o=Array.prototype.slice.call(arguments,1),s=(u=r.slice()).length,c=0;c<s;c++)u[c].apply(this,o);return!0},r.prototype.addListener=function(e,t){var s;if(!n(t))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,n(t.listener)?t.listener:t),this._events[e]?i(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,i(this._events[e])&&!this._events[e].warned&&(s=a(this._maxListeners)?r.defaultMaxListeners:this._maxListeners)&&s>0&&this._events[e].length>s&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace()),this},r.prototype.on=r.prototype.addListener,r.prototype.once=function(e,t){if(!n(t))throw TypeError("listener must be a function");var r=!1;function i(){this.removeListener(e,i),r||(r=!0,t.apply(this,arguments))}return i.listener=t,this.on(e,i),this},r.prototype.removeListener=function(e,t){var r,a,s,o;if(!n(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(s=(r=this._events[e]).length,a=-1,r===t||n(r.listener)&&r.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(i(r)){for(o=s;o-- >0;)if(r[o]===t||r[o].listener&&r[o].listener===t){a=o;break}if(a<0)return this;1===r.length?(r.length=0,delete this._events[e]):r.splice(a,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},r.prototype.removeAllListeners=function(e){var t,r;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(n(r=this._events[e]))this.removeListener(e,r);else if(r)for(;r.length;)this.removeListener(e,r[r.length-1]);return delete this._events[e],this},r.prototype.listeners=function(e){return this._events&&this._events[e]?n(this._events[e])?[this._events[e]]:this._events[e].slice():[]},r.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(n(t))return 1;if(t)return t.length}return 0},r.listenerCount=function(e,t){return e.listenerCount(t)}},function(e,t,r){e.exports=i;var n=r(36).EventEmitter;function i(){n.call(this)}r(0)(i,n),i.Readable=r(35),i.Writable=r(160),i.Duplex=r(159),i.Transform=r(158),i.PassThrough=r(157),i.Stream=i,i.prototype.pipe=function(e,t){var r=this;function i(t){e.writable&&!1===e.write(t)&&r.pause&&r.pause()}function a(){r.readable&&r.resume&&r.resume()}r.on("data",i),e.on("drain",a),e._isStdio||t&&!1===t.end||(r.on("end",o),r.on("close",c));var s=!1;function o(){s||(s=!0,e.end())}function c(){s||(s=!0,"function"==typeof e.destroy&&e.destroy())}function u(e){if(f(),0===n.listenerCount(this,"error"))throw e}function f(){r.removeListener("data",i),e.removeListener("drain",a),r.removeListener("end",o),r.removeListener("close",c),r.removeListener("error",u),e.removeListener("error",u),r.removeListener("end",f),r.removeListener("close",f),e.removeListener("close",f)}return r.on("error",u),e.on("error",u),r.on("end",f),r.on("close",f),e.on("close",f),e.emit("pipe",r),e}},function(e,t,r){"use strict";(function(t){var n=r(0),i=r(75),a=new Array(16);function s(){i.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function o(e,t){return e<<t|e>>>32-t}function c(e,t,r,n,i,a,s){return o(e+(t&r|~t&n)+i+a|0,s)+t|0}function u(e,t,r,n,i,a,s){return o(e+(t&n|r&~n)+i+a|0,s)+t|0}function f(e,t,r,n,i,a,s){return o(e+(t^r^n)+i+a|0,s)+t|0}function h(e,t,r,n,i,a,s){return o(e+(r^(t|~n))+i+a|0,s)+t|0}n(s,i),s.prototype._update=function(){for(var e=a,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var r=this._a,n=this._b,i=this._c,s=this._d;r=c(r,n,i,s,e[0],3614090360,7),s=c(s,r,n,i,e[1],3905402710,12),i=c(i,s,r,n,e[2],606105819,17),n=c(n,i,s,r,e[3],3250441966,22),r=c(r,n,i,s,e[4],4118548399,7),s=c(s,r,n,i,e[5],1200080426,12),i=c(i,s,r,n,e[6],2821735955,17),n=c(n,i,s,r,e[7],4249261313,22),r=c(r,n,i,s,e[8],1770035416,7),s=c(s,r,n,i,e[9],2336552879,12),i=c(i,s,r,n,e[10],4294925233,17),n=c(n,i,s,r,e[11],2304563134,22),r=c(r,n,i,s,e[12],1804603682,7),s=c(s,r,n,i,e[13],4254626195,12),i=c(i,s,r,n,e[14],2792965006,17),r=u(r,n=c(n,i,s,r,e[15],1236535329,22),i,s,e[1],4129170786,5),s=u(s,r,n,i,e[6],3225465664,9),i=u(i,s,r,n,e[11],643717713,14),n=u(n,i,s,r,e[0],3921069994,20),r=u(r,n,i,s,e[5],3593408605,5),s=u(s,r,n,i,e[10],38016083,9),i=u(i,s,r,n,e[15],3634488961,14),n=u(n,i,s,r,e[4],3889429448,20),r=u(r,n,i,s,e[9],568446438,5),s=u(s,r,n,i,e[14],3275163606,9),i=u(i,s,r,n,e[3],4107603335,14),n=u(n,i,s,r,e[8],1163531501,20),r=u(r,n,i,s,e[13],2850285829,5),s=u(s,r,n,i,e[2],4243563512,9),i=u(i,s,r,n,e[7],1735328473,14),r=f(r,n=u(n,i,s,r,e[12],2368359562,20),i,s,e[5],4294588738,4),s=f(s,r,n,i,e[8],2272392833,11),i=f(i,s,r,n,e[11],1839030562,16),n=f(n,i,s,r,e[14],4259657740,23),r=f(r,n,i,s,e[1],2763975236,4),s=f(s,r,n,i,e[4],1272893353,11),i=f(i,s,r,n,e[7],4139469664,16),n=f(n,i,s,r,e[10],3200236656,23),r=f(r,n,i,s,e[13],681279174,4),s=f(s,r,n,i,e[0],3936430074,11),i=f(i,s,r,n,e[3],3572445317,16),n=f(n,i,s,r,e[6],76029189,23),r=f(r,n,i,s,e[9],3654602809,4),s=f(s,r,n,i,e[12],3873151461,11),i=f(i,s,r,n,e[15],530742520,16),r=h(r,n=f(n,i,s,r,e[2],3299628645,23),i,s,e[0],4096336452,6),s=h(s,r,n,i,e[7],1126891415,10),i=h(i,s,r,n,e[14],2878612391,15),n=h(n,i,s,r,e[5],4237533241,21),r=h(r,n,i,s,e[12],1700485571,6),s=h(s,r,n,i,e[3],2399980690,10),i=h(i,s,r,n,e[10],4293915773,15),n=h(n,i,s,r,e[1],2240044497,21),r=h(r,n,i,s,e[8],1873313359,6),s=h(s,r,n,i,e[15],4264355552,10),i=h(i,s,r,n,e[6],2734768916,15),n=h(n,i,s,r,e[13],1309151649,21),r=h(r,n,i,s,e[4],4149444226,6),s=h(s,r,n,i,e[11],3174756917,10),i=h(i,s,r,n,e[2],718787259,15),n=h(n,i,s,r,e[9],3951481745,21),this._a=this._a+r|0,this._b=this._b+n|0,this._c=this._c+i|0,this._d=this._d+s|0},s.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=new t(16);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e},e.exports=s}).call(this,r(2).Buffer)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.gostCodingInstance=void 0,t.GostCoding=s;var n=r(19),i=ArrayBuffer;function a(e){if(e instanceof i)return e;if(e&&e.buffer&&e.buffer instanceof i)return 0===e.byteOffset&&e.byteLength===e.buffer.byteLength?e.buffer:new Uint8Array(new Uint8Array(e,e.byteOffset,e.byteLength)).buffer;throw new n.DataError("CryptoOperationData required")}function s(){}var o={decode:function(e){for(var t,r,n=(e=e.replace(/[^A-Za-z0-9\+\/]/g,"")).length,i=3*n+1>>2,a=new Uint8Array(i),s=0,o=0,c=0;c<n;c++){r=3&c;var u=e.charCodeAt(c);if(s|=(u=u>64&&u<91?u-65:u>96&&u<123?u-71:u>47&&u<58?u+4:43===u?62:47===u?63:0)<<18-6*r,3===r||n-c==1){for(t=0;t<3&&o<i;t++,o++)a[o]=s>>>(16>>>t&24)&255;s=0}}return a.buffer},encode:function(e){for(var t=new Uint8Array(a(e)),r=2,n="",i=t.length,s=0,o=0;o<i;o++)if(r=o%3,o>0&&4*o/3%96==0&&(n+="\r\n"),s|=t[o]<<(16>>>r&24),2===r||i-o==1){for(var c=18;c>=0;c-=6){var u=s>>>c&63;u=u<26?u+65:u<52?u+71:u<62?u-4:62===u?43:63===u?47:65,n+=String.fromCharCode(u)}s=0}return n.substr(0,n.length-2+r)+(2===r?"":1===r?"=":"==")}};s.prototype.Base64=o;var c=function(){var e={1026:128,1027:129,8218:130,1107:131,8222:132,8230:133,8224:134,8225:135,8364:136,8240:137,1033:138,8249:139,1034:140,1036:141,1035:142,1039:143,1106:144,8216:145,8217:146,8220:147,8221:148,8226:149,8211:150,8212:151,8482:153,1113:154,8250:155,1114:156,1116:157,1115:158,1119:159,160:160,1038:161,1118:162,1032:163,164:164,1168:165,166:166,167:167,1025:168,169:169,1028:170,171:171,172:172,173:173,174:174,1031:175,176:176,177:177,1030:178,1110:179,1169:180,181:181,182:182,183:183,1105:184,8470:185,1108:186,187:187,1112:188,1029:189,1109:190,1111:191},t={};for(var r in e)t[e[r]]=r;return{decode:function(t,r){r=(r||"win1251").toLowerCase().replace("-","");for(var n=[],i=0,a=t.length;i<a;i++){var s=t.charCodeAt(i);if("utf8"===r)s<128?n.push(s):s<2048?(n.push(192+(s>>>6)),n.push(128+(63&s))):s<65536?(n.push(224+(s>>>12)),n.push(128+(s>>>6&63)),n.push(128+(63&s))):s<2097152?(n.push(240+(s>>>18)),n.push(128+(s>>>12&63)),n.push(128+(s>>>6&63)),n.push(128+(63&s))):s<67108864?(n.push(248+(s>>>24)),n.push(128+(s>>>18&63)),n.push(128+(s>>>12&63)),n.push(128+(s>>>6&63)),n.push(128+(63&s))):(n.push(252+(s>>>30)),n.push(128+(s>>>24&63)),n.push(128+(s>>>18&63)),n.push(128+(s>>>12&63)),n.push(128+(s>>>6&63)),n.push(128+(63&s)));else if("unicode"===r||"ucs2"===r||"utf16"===r){if(s<55296||s>=57344&&s<=65536)n.push(s>>>8),n.push(255&s);else if(s>=65536&&s<1114112){var o=55296+((1047552&(s-=65536))>>10),c=56320+(1023&s);n.push(o>>>8),n.push(255&o),n.push(c>>>8),n.push(255&c)}}else"utf32"===r||"ucs4"===r?(n.push(s>>>24&255),n.push(s>>>16&255),n.push(s>>>8&255),n.push(255&s)):"win1251"===r?(s>=128&&(s>=1040&&s<1104?s-=848:s=e[s]||0),n.push(s)):n.push(255&s)}return new Uint8Array(n).buffer},encode:function(e,r){r=(r||"win1251").toLowerCase().replace("-","");for(var n=[],i=new Uint8Array(a(e)),s=0,o=i.length;s<o;s++){var c=i[s];"utf8"===r?c=c>=252&&c<254&&s+5<o?1073741824*(c-252)+(i[++s]-128<<24)+(i[++s]-128<<18)+(i[++s]-128<<12)+(i[++s]-128<<6)+i[++s]-128:c>>248&&c<252&&s+4<o?(c-248<<24)+(i[++s]-128<<18)+(i[++s]-128<<12)+(i[++s]-128<<6)+i[++s]-128:c>>240&&c<248&&s+3<o?(c-240<<18)+(i[++s]-128<<12)+(i[++s]-128<<6)+i[++s]-128:c>=224&&c<240&&s+2<o?(c-224<<12)+(i[++s]-128<<6)+i[++s]-128:c>=192&&c<224&&s+1<o?(c-192<<6)+i[++s]-128:c:"unicode"===r||"ucs2"===r||"utf16"===r?(c=(c<<8)+i[++s])>=55296&&c<57344&&(c=(c-55296<<10)+((c=((c=i[++s])<<8)+i[++s])-56320)+65536):"utf32"===r||"ucs4"===r?c=((c=((c=(c<<8)+i[++s])<<8)+i[++s])<<8)+i[++s]:"win1251"===r&&c>=128&&(c>=192&&c<256?c+=848:c=t[c]||0),n.push(String.fromCharCode(c))}return n.join("")}}}();s.prototype.Chars=c;var u={decode:function(e,t){e=e.replace(/[^A-fa-f0-9]/g,"");var r=Math.ceil(e.length/2),n=new Uint8Array(r);if(e=(e.length%2>0?"0":"")+e,t&&("string"!=typeof t||t.toLowerCase().indexOf("little")<0))for(var i=0;i<r;i++)n[i]=parseInt(e.substr(2*(r-i-1),2),16);else for(i=0;i<r;i++)n[i]=parseInt(e.substr(2*i,2),16);return n.buffer},encode:function(e,t){var r=[],n=new Uint8Array(a(e)),i=n.length;if(t&&("string"!=typeof t||t.toLowerCase().indexOf("little")<0))for(var s=0;s<i;s++){var o=i-s-1;r[o]=(o>0&&o%32==0?"\r\n":"")+("00"+n[s].toString(16)).slice(-2)}else for(s=0;s<i;s++)r[s]=(s>0&&s%32==0?"\r\n":"")+("00"+n[s].toString(16)).slice(-2);return r.join("")}};s.prototype.Hex=u;var f={decode:function(e){0===(e=(e||"").replace(/[^\-A-fa-f0-9]/g,"")).length&&(e="0");var t=!1;for("-"===e.charAt(0)&&(t=!0,e=e.substring(1));"0"===e.charAt(0)&&e.length>1;)e=e.substring(1);e=(e.length%2>0?"0":"")+e,(!t&&!/^[0-7]/.test(e)||t&&!/^[0-7]|8[0]+$/.test(e))&&(e="00"+e);for(var r=e.length/2,n=new Uint8Array(r),i=0,a=r-1;a>=0;--a){var s=parseInt(e.substr(2*a,2),16);t&&s+i>0&&(s=256-s-i,i=1),n[a]=s}return n.buffer},encode:function(e){var t=new Uint8Array(a(e)),r=t.length;if(0===t.length)return"0x00";for(var n=[],i=t[0]>127,s=0,o=r-1;o>=0;--o){var c=t[o];i&&c+s>0&&(c=256-c-s,s=1),n[o]=("00"+c.toString(16)).slice(-2)}for(n=n.join("");"0"===n.charAt(0);)n=n.substring(1);return(i?"-":"")+"0x"+n}};s.prototype.Int16=f;var h=function(){function e(t,r,s){var o=t.object;void 0===o&&(o=t);var h=t.tagClass=t.tagClass||0;if(0===h){var l=t.tagNumber;if(void 0===l)if("string"==typeof o)l=""===o?5:/^\-?0x[0-9a-fA-F]+$/.test(o)?2:/^(\d+\.)+\d+$/.test(o)?6:/^[01]+$/.test(o)?3:/^(true|false)$/.test(o)?1:/^[0-9a-fA-F]+$/.test(o)?4:19;else if("number"==typeof o)l=2;else if("boolean"==typeof o)l=1;else if(o instanceof Array)l=16;else if(o instanceof Date)l=24;else{if(!(o instanceof i||o&&o.buffer instanceof i))throw new n.DataError("Unrecognized type for "+o);l=4}}var d,p=t.tagConstructed;if(void 0===p&&(p=t.tagConstructed=o instanceof Array),o instanceof i||o&&o.buffer instanceof i){if(d=new Uint8Array(a(o)),3===l){var g=new Uint8Array(a(d));(d=new Uint8Array(g.length+1))[0]=0,d.set(g,1)}}else if(p){if(!(o instanceof Array))throw new n.DataError("Constracted block can't be primitive");for(var y=0,v=[],m=0,b=0,w=o.length;b<w;b++)v[b]=e(o[b],r),y+=v[b].length;for(17===l&&v.sort((function(e,t){for(var r=0,n=Math.min(e.length,t.length);r<n;r++){var i=e[r]-t[r];if(0!==i)return i}return e.length-t.length})),"CER"===r&&(v[w]=new Uint8Array(2),y+=2),d=new Uint8Array(y),b=0,w=v.length;b<w;b++)d.set(v[b],m),m+=v[b].length}else switch(l){case 1:(d=new Uint8Array(1))[0]=o?255:0;break;case 2:case 10:d=f.decode("number"==typeof o?o.toString(16):o);break;case 3:if("string"==typeof o){var S=7-(o.length+7)%8;for(w=Math.ceil(o.length/8),(d=new Uint8Array(w+1))[0]=S,b=0;b<w;b++){for(var E=0,C=0;C<8;C++){var A;E=(E<<1)+((A=8*b+C)<o.length&&"1"===o.charAt(A)?1:0)}d[b+1]=E}}break;case 4:d=u.decode("number"==typeof o?o.toString(16):o);break;case 6:g=o.match(/\d+/g);var B=[];for(b=1;b<g.length;b++){w=+g[b];var x=[];1===b&&(w+=40*g[0]);do{x.push(127&w),w>>>=7}while(w);for(C=x.length-1;C>=0;--C)B.push(x[C]+(0===C?0:128))}d=new Uint8Array(B);break;case 12:d=c.decode(o,"utf8");break;case 18:case 22:case 19:case 20:case 21:case 25:case 26:case 27:for(b=0,w=o.length;b<w;b++)o.charCodeAt(b)>255&&(l=12);d=12===l?c.decode(o,"utf8"):c.decode(o,"ascii");break;case 23:case 24:var T=o.original;if(!T){var I=new Date(o);I.setMinutes(I.getMinutes()+I.getTimezoneOffset());for(var F=24===l?I.getMilliseconds().toString():"";F.length>0&&"0"===F.charAt(F.length-1);)F=F.substring(0,F.length-1);F.length>0&&(F="."+F),T=(23===l?I.getYear().toString().slice(-2):I.getFullYear().toString())+("00"+(I.getMonth()+1)).slice(-2)+("00"+I.getDate()).slice(-2)+("00"+I.getHours()).slice(-2)+("00"+I.getMinutes()).slice(-2)+("00"+I.getSeconds()).slice(-2)+F+"Z"}d=c.decode(T,"ascii");break;case 28:d=c.decode(o,"utf32");break;case 30:d=c.decode(o,"utf16")}if(d||(d=new Uint8Array(0)),d instanceof i&&(d=new Uint8Array(d)),!p&&"CER"===r)switch(l){case 3:A=1;case 4:case 12:case 18:case 19:case 20:case 21:case 22:case 25:case 26:case 27:case 28:case 30:for(y=0,v=[],m=0,b=A=A||0,w=d.length;b<w;b+=1e3-A)v[b]=e({object:new Unit8Array(d.buffer,b,Math.min(1e3-A,w-b)),tagNumber:l,tagClass:0,tagConstructed:!1},r),y+=v[b].length;for(v[w]=new Uint8Array(2),y+=2,d=new Uint8Array(y),b=0,w=v.length;b<w;b++)d.set(v[b],m),m+=v[b].length}if(t.tagNumber=0===h?l:l=t.tagNumber||0,t.content=d,s)return d;var k=[],R=3===h?192:2===h?128:1===h?64:0;if(p&&(R|=32),l<31)R|=31&l,k.push(R);else{R|=31,k.push(R),w=l;var D=[];do{D.push(127&w),w>>>=7}while(w);for(C=D.length-1;C>=0;--C)k.push(D[C]+(0===C?0:128))}if(p&&"CER"===r)k.push(128);else{var _=d.length;if(_>127){var P=_,N=[];do{N.push(255&P),P>>>=8}while(P);for(k.push(N.length+128),C=N.length-1;C>=0;--C)k.push(N[C])}else k.push(_)}var O=t.header=new Uint8Array(k),L=new Uint8Array(O.length+d.length);return L.set(O,0),L.set(d,O.length),L}function t(e,r){var a,s,o,u,h,l,d,p,g,y=r||0,v=y;if(e.object)a=e.tagNumber,s=e.tagClass,o=e.tagConstructed,u=e.content,h=e.header,l=e.object instanceof i?new Uint8Array(e.object):null,d=e.object instanceof Array?e.object:null,p=l&&l.length||null;else{var m=e,b=m[y++];if(s=b>>6,o=!!(32&b),31==(a=31&b)){a=0;do{if(a>9007199254740864)throw new n.DataError("Convertor not supported tag number more then (2^53 - 1) at position "+r);a=(a<<7)+(127&(b=m[y++]))}while(128&b)}if((p=127&(b=m[y++]))!==b){if(p>6)throw new n.DataError("Length over 48 bits not supported at position "+r);if(0===p)p=null;else{b=0;for(var w=0;w<p;++w)b=(b<<8)+m[y++];p=b}}if(v=y,d=null,o)if(d=[],null!==p){for(var S=v+p;y<S;){var E=t(m,y);d.push(E),y+=E.header.length+E.content.length}if(y!==S)throw new n.DataError("Content size is not correct for container starting at offset "+v)}else try{for(;y+=(E=t(m,y)).header.length+E.content.length,0!==E.tagClass||0!==E.tagNumber;)d.push(E);p=y-v}catch(e){throw new n.DataError("Exception "+e+" while decoding undefined length content at offset "+v)}h=new Uint8Array(m.buffer,r,v-r),l=u=new Uint8Array(m.buffer,v,p)}if(null!==d&&0===s)switch(a){case 3:g=1;case 4:case 12:case 18:case 19:case 20:case 21:case 22:case 25:case 26:case 27:case 28:case 30:if(g=g||0,0===d.length)throw new n.DataError("No constructed encoding content of string type at offset "+v);p=g,w=0;for(var C=d.length;w<C;w++){if((E=d[w]).tagClass!==s||E.tagNumber!==a||E.tagConstructed)throw new n.DataError("Invalid constructed encoding of string type at offset "+v);p+=E.content.length-g}l=new Uint8Array(p),w=0,C=d.length;for(var A=g;w<C;w++)E=d[w],g>0?l.set(E.content.subarray(1),A):l.set(E.content,A),A+=E.content.length-g;o=!1,d=null}var B="";if(null===d){if(null===p)throw new n.DataError("Invalid tag with undefined length at offset "+v);if(0===s)switch(a){case 1:B=0!==l[0];break;case 2:case 10:if(p>6)B=f.encode(l);else{var x=l[0];for(l[0]>127&&(x-=256),w=1;w<p;w++)x=256*x+l[w];B=x}break;case 3:if(p>5)B=new Uint8Array(l.subarray(1)).buffer;else{var T=l[0];for(E=[],w=p-1;w>=1;--w){var I=l[w];for(A=T;A<8;++A)E.push(I>>A&1?"1":"0");T=0}B=E.reverse().join("")}break;case 4:B=new Uint8Array(l).buffer;break;case 6:E="",C=0;var F=0;for(w=0;w<p;++w)C=(C<<7)+(127&(x=l[w])),F+=7,128&x||(""===E?E=(k=C<80?C<40?0:1:2)+"."+(C-40*k):E+="."+C.toString(),C=0,F=0);if(F>0)throw new n.DataError("Incompleted OID at offset "+v);B=E;break;case 16:case 17:B=[];break;case 12:B=c.encode(l,"utf8");break;case 18:case 19:case 20:case 21:case 22:case 25:case 26:case 27:B=c.encode(l,"ascii");break;case 28:B=c.encode(l,"utf32");break;case 30:B=c.encode(l,"utf16");break;case 23:case 24:var k,R=23===a;if(E=c.encode(l,"ascii"),!(k=(R?/^(\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/:/^(\d\d\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/).exec(E)))throw new n.DataError('Unrecognized time format "'+E+'" at offset '+v);R&&(k[1]=+k[1],k[1]+=k[1]<50?2e3:1900);var D=new Date(k[1],+k[2]-1,+k[3],+(k[4]||"0"),+(k[5]||"0"),+(k[6]||"0"),+(k[7]||"0")),_=D.getTimezoneOffset();(k[8]||23===a)&&("Z"!==k[8].toUpperCase()&&k[9]&&(_+=parseInt(k[9])),D.setMinutes(D.getMinutes()-_)),D.original=E,B=D}else B=new Uint8Array(l).buffer}else B=d;return{tagConstructed:o,tagClass:s,tagNumber:a,header:h,content:u,object:B}}return{encode:function(t,r,n){return e(t,r,n).buffer},decode:function(e){return t(e.object?e:new Uint8Array(a(e)),0)}}}();s.prototype.BER=h;var l={encode:function(e,t){return(t?"-----BEGIN "+t.toUpperCase()+"-----\r\n":"")+o.encode(e instanceof i?e:h.encode(e))+(t?"\r\n-----END "+t.toUpperCase()+"-----":"")},decode:function(e,t,r,i){var a=/([A-Za-z0-9\+\/\s\=]+)/g.exec(e);a[1].length!==e.length&&(a=!1),!a&&t&&(a=new RegExp("-----\\s?BEGIN "+t.toUpperCase()+"-----([A-Za-z0-9\\+\\/\\s\\=]+)-----\\s?END "+t.toUpperCase()+"-----","g").exec(e)),a||(a=new RegExp("-----\\s?BEGIN [A-Z0-9\\s]+-----([A-Za-z0-9\\+\\/\\s\\=]+)-----\\s?END [A-Z0-9\\s]+-----","g").exec(e));var s=a&&a[1+(i||0)];if(!s)throw new n.DataError("Not valid PEM format");var c=o.decode(s);return r&&(c=h.decode(c)),c}};s.prototype.PEM=l,t.gostCodingInstance=new s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GostDigest=function(e){switch(e=e||{},this.name=(e.name||"GOST R 34.10")+"-"+(e.version||2012)%100+((e.version||2012)>1?"-"+(e.length||256):"")+("HASH"!==(e.mode||"HASH")?"-"+e.mode:"")+(e.procreator?"/"+e.procreator:"")+("string"==typeof e.sBox?"/"+e.sBox:""),this.procreator=e.procreator,this.bitLength=e.length||256,e.version||2012){case 1:this.digest=l,this.bitLength=160;break;case 1994:this.digest=h,this.sBox=(e.sBox||("SC"===e.procreator?"D-SC":"D-A")).toUpperCase(),this.cipher=new i.GostCipher({name:"GOST 28147",block:"ECB",sBox:this.sBox,procreator:this.procreator});break;case 2012:this.digest=f;break;default:throw new a.NotSupportedError("Algorithm version "+e.version+" not supported")}switch(this.keySize=e.keySize||(e.version<=2?this.bitLength/8:32),e.mode||"HASH"){case"HASH":break;case"HMAC":this.sign=d,this.verify=p,this.generateKey=g;break;case"KDF":this.deriveKey=w,this.deriveBits=v,this.label=e.label,this.context=e.context;break;case"PBKDF2":this.deriveKey=w,this.deriveBits=m,this.generateKey=g,this.salt=e.salt,this.iterations=e.iterations||2e3,this.diversifier=e.diversifier||1;break;case"PFXKDF":this.deriveKey=w,this.deriveBits=y,this.generateKey=g,this.salt=e.salt,this.iterations=e.iterations||2e3,this.diversifier=e.diversifier||1;break;case"CPKDF":this.deriveKey=w,this.deriveBits=b,this.generateKey=g,this.salt=e.salt,this.iterations=e.iterations||2e3;break;default:throw new a.NotSupportedError("Algorithm mode "+e.mode+" not supported")}};var n=r(25),i=r(41),a=r(19);function s(e,t,r,n,i){for(var a=0;a<i;a++)r[n+a]=e[t+a]}function o(e){for(var t=new Uint8Array(e),r=new Uint8Array(t.length),n=0,i=t.length;n<i;n++)r[i-n-1]=t[n];return r.buffer}function c(e){for(var t,r,n=e.length,i=3*n+1>>2,a=new Uint8Array(i),s=0,o=0,c=0;c<n;c++){r=3&c;var u=e.charCodeAt(c);if(s|=(u=u>64&&u<91?u-65:u>96&&u<123?u-71:u>47&&u<58?u+4:43===u?62:47===u?63:0)<<18-6*r,3===r||n-c==1){for(t=0;t<3&&o<i;t++,o++)a[o]=s>>>(16>>>t&24)&255;s=0}}return a.buffer}function u(e){if(e instanceof ArrayBuffer)return e;if(e&&e.buffer&&e.buffer instanceof ArrayBuffer)return 0===e.byteOffset&&e.byteLength===e.buffer.byteLength?e.buffer:new Uint8Array(new Uint8Array(e,e.byteOffset,e.byteLength)).buffer;throw new a.DataError("ArrayBuffer or ArrayBufferView required")}var f=function(){var e=new Int32Array(16),t=new Int32Array(16);t[0]=512;var r,n,i,a=function(e){for(var t=new Int32Array(c("B0Wm8lllgN0jTXTMNnR2BRXTYKQIKkKiAWlnkpHgfEv8xIV1jbhOcRbQRS5DdmovH3xlwIEvy+vp2soe2lsIsbebsSFwBHnmVs3L1xui3VXKpwrbwmG1XFiZ1hJrF7WaMQG1Fg9e1WGYKyMKcur+89e1cA9GneNPGi+dqYq1o2+yCroK9ZYemTHbeoZD9LbCCdtiYDc6ycGxnjWQ5A/i03t7KbEUderyix+cUl9e8QY1hD1qKPw5Cscvzius3HT1LtHjhLy+DCLxN+iToepTNL4DUpMzE7fYddYD7YIs16k/NV5orRxynX08XDN+hY5I3eRxXaDhSPnSZhXos98f71f+bHz9WBdg9WPqqX6iVnoWGicjtwD/36P1OiVHF82/vf8PgNc1njVKEIYWHxwVf2MjqWwMQT+amUdHraxr6ktufWRGekBo+jVPkDZyxXG/tsa+wmYf8gq0t5oct6b6z8aO8Jq0mn8YbKRCUfnEZi3AOTB6O8Okb9nTOh2urk+uk9QUOk1WhojzSjyiTEUXNQQFSiiDaUcGNyyCLcWrkgnJk3oZMz5H08mHv+bHxp45VAkkv/6GrFHsxaruFg7H9B7nAr/UDX+k2ahRWTXCrDYvxKXRK43RaZAGm5LLK4n0msTbTTtEtIke3jaccfi3TkFBbgwCqucDp8mTTUJbH5vbWiODUURhcmAqH8uS3DgOVJwHppqKK3uxzrLbC0QKgIQJDeC3Vdk8JEKJJRs6fTreXxbs2JpMlJsiMRZUWo837ZxFmPvHtHTDtjsV0fqYNvRSdjswbB56SzNprwJn558DYTMbiuH/H9t4iv8c50GJ8/PkskjlKjhSbwWApt6+qxst84HNpMprXdhvwEpZot6Ybkd9Hc2678q5SOrvcR2KeWaEFCGAASBhB6vru2v62JT+WmPNxgIw+4nI79CezXsg1xvxSpK8SJkbstnVF/T6UijhiKqkHeeGzJEYne+AXZufITDUEiD4dx3fvDI8pM16sUkEsIAT0roxFvFn5443")),r=new Array(12),n=0;n<12;n++)r[n]=new Int32Array(t.buffer,64*n,16);return r}(),s=new Int32Array(c("5vh+XFtxH9Alg3eACST6FshJ4H6FLqSoW0aGoY8GwWoLMumi13tBbqvaN6RngVxm9heWqBpoZnb13AtwY5GVS0hi84235kvx/1ximmi9hcXLgn2m/NdXlWbTba9pufCJNWyfdEg9g7B8vOyxI4yZoTanAqwxxHCNnrao0C+839aLGfpR5bOuN5zPtUCKEn0LvAx4tQggj1rlM+OEIojs7c7Cx9N3wV/S7HgXtlBdD165TMLAgzaHHYwgXbTLCwStdjyFWyigiS9YjRt59v8yVz/s9p5DEZM+D8DTn4A6GMnuAQom9fOtgxDv6PRBGXmmXc2hDH3pOhBKG+4dEkjpLFO/8tshhHM5tPUMz6aiPQlftLyc2EeYzeiKLYsHHFb5f3dxaVp1apzF8C5xoLoevKZj+atCFeZyLrGeIt5fu3gNuc4PJZS6FIJSDmOXZk2ELwMeagII6phcfyFEob5r8Ho3yxzRY2Lbg+COK0sxHGTPcEebq5YOMoVrqYa53ucetUeMh3r1bOm4/kKIX2HW/RvdAVaWYjjIYiFXkj74qS78l/9CEUR2+J19NQhWRSzrTJDJsOCnElYjCFAt+8sBbC16A/qnpkhF9G6LOL/GxKu9vvj91HfeujqsTOvIB5t58JyxBeiHnQwn+moQrIpYy4lg58FAHQzqGm+BHko1aSiQxPsHc9GW/0NQGi9gnQqf96UW4MY/N5Yc5KazuNqSUhMkdSw44IqbpahkczvsFU8r8SRXVUmzP9dm2xVEDcXHp9F5455Ct5La3xUaYZl/04agNF7AJxQjONVRe22pOaRlGPB3EEADtAJ5HZClrqLdiNJniZxKXQqTD2bfCihlwk7p1CBFCbCLMlU4kWaFKSpBKQe/xTOoQrJ+K2JUTcZzbFMERWKV4Ada9AbpU1GQih8vO2vBI2Fvw3sJ3FJV5cY5Z9Ezsf5oRCmIOcfw5xHiQJuH9xlk+aLpOK3D20sHGQwLTkf5w+v0VTTVdtNriENGEKBa64sC2CDDzfWCMvJRbeGEDb7Cseeg6N4GsPodCHuFS1QNNDM7QuKaZ7zKW3/YpgiKxDfdDsY7s6nZQ+2BIXFNvV5lo7FnYe3nte6haSQx98jVc6v21R/GheGjZxpeBjzUBBDJLSg6uY8ssEACj+vAbLLy95AX1k8Rb6HTPOBzWfGpnuSqeE7WjHTNwAZuKhnVxztC2ocStBYccEXDNxWC5O2TIW2s45BBSTn2/H7F8SGGIjt8wLCUBCusFvv510U3mlJ+v3N8Py6jtoFoM+e42brSeMqpoyo0wi/+u+SBY8z+370NjllAJG6lpnBRxu9LhCrR5CK60GUnnFCM2RSIwhhgjO4xnqVJH3zaF9OU4SgTTJxgCUv0MnLV47Ob9hKlpKrXkcy72kPSb/0PNN4fPJRq0lBPW1RomV7ha9+fr2/qj3eUJkjqWHDdCSu/x+Vtcdl8Z93msv9PIdVJPCdrRjroYAORdntPr4bHH2ihPng11LmgtowRXwMMn9QUHdLJFlggAZg9j33dUySsZKpwP8wXUlTCyYmUjgK0Jj5edtafRsLeUHRvA1h9gARF2z2CknLx5WBYSgKbVgvz+65Ypz/83GKhWl5ObK1M6EupblXOH7jMCPl0eq6CslPBAhRM9/tHG58EKJjz6442BosnrfLv+3rtypf+jApevneOBRP099jPMCwlAcMri/eNkt38F1xVTfhlxX9GBS9f6vMwG6Ky9CSqaLfsu9YNhpmPDzUBBHVMAAAAAAAAAADxLjFNNNDM7HEFIr4GGCO1rygNmTDABcGX/VziXWk8ZRmkHMYzzJoVlYRBcvjHnrjcVDK3k3aEqZQ2wTokkM9YgCsT8zLI71nEQq45fO1PXPoc2O/jq42C8uWslU0pP9Fq2CPokHobfU0iSfg88EO2A8ud2Hn58z3eLS8nNtgmdCpDpB+JHuLfb5iZnRtsEzrUrUbNPfQ2+rs131AmmCXAlk/cqoE+bYXrQbBTfuWlxAVAunWLFghHpBrkO+e7RK/juMQp0GcXl4GZk7vun765rpqN0eyXVCHzVyzdkX5uMWOT19rir/jOR6IgEjfcUzijI0PeyQPuNXn8VsSompHmAbKASNxXUeASlvVk5Lfbe3X3GINRWXoS222VUr3OLjMenbsjHXQwj1INcpP90yLZ4gpEYQwwRnf+7uLStOrUJcow/e4ggAZ1YerKSkcBWhPnSv4UhyZOMCzIg7J78RmlFmTPWbP2gtyoEap8HnivWx1WJvtkjcOytz6RF99bzjTQX3zwarVvXf0lfwrNEycYV03I5nbFKp4HOaflLriqmlSGVT4PPNmjVv9IrqqSe36+dWUlrY4th30ObPn/28hBOx7MoxRQyplpE74w6YPoQK1REAmVbqccsbW2ui20NU5Eab3KTiWgBRWvUoHKD3HhdEWYy40OK/JZP5sxKqhjt++zim4ppPxja2qjoEwtSp09lesO5r8x46KRw5YVVL/VGBacju+by/URXWi8nU4oRrqHXxj6z3Qg0e38uLbiPr2wBzby8eNkroTZKc5libb+cLei9tpPclUOclPXXG1JKQTyOj1XQVmnCoBp6gssEI5J0HPFa7EaEYqrehk55P/XzQlaCw44rO/J+2A2WXn1SJK95pfWfzQix4kz4QUUvGHhwdm5dcm1StImYWDPG82AmkSS7Xj9hnGzzKsqiBqXk3LOv2Z/4dCI1tRbXZhalCfIEagFjD9V3mX1tDGWtQYZ90+WsdZwbkOFnR6Ly0PTNlqrioXM+j2E+ce/mcKV/P2iH9Wh3ktjD82z73Y7i0VtgD9Z+Hz3w4WyfHO+XzGRPJjjrGYzsEghv2FnTCa4+BgP+8mVxMEwyKqghiAQdhqYYFfzQiEBFqr2PHYMBlTMNS3bRcxmfZBCvPRalkvUA4Jo6KDD7zxvPae9ktJp/3O8KQriAgHtIoe33jTN6IWBj9kB7qfdYQWb1vonMhmgNVPVbxrodMzOyeoxJFwug/VUcDRVXaB75JnOJtKsVue+9/0WGFelBU44ag59pFJ0NtFb2Go4HN6f8sr3dWIxdwwysJqu2eJ5yNBd7xCRxgZ02xEQRqJRXlBFI1Ns5HKYAvzFDLz39bY8+nOhaIfNFx8DfSlBr9nyjb0/Xj60Wk87nYTu/jYbZ3FAPbjj0+cHYnEaOij58g/SSH68fHW0nnYndOXyk8frVlwY3PWeT0eLpAxu9E+prctSxpmBLZjax2B4iwbcbkadDvxl+Op1IexOMKX3IZ6OC1Ur7D9lvKV7a93QSWm68bdemZBM2+OU6lcUsgHR5upA9ruwwIJBKErdUPIEY7+PHf/o1/k7k8usuE2Mto5HfIbowd0bOZImjj98WqESCdYvyy89mKvbNcmuZxNpViv9X/UVweFsNs7igB1+su3485sX2pTTfbAN/gGHe8PsdguK2suEld/hU65EBaJHc7e0ELMShXt4PDKr3463cNBoElE7U2c5udLj5mVYTVficbJkaNeJx4/JhJclqTW7+n0a4QKLFTej36ZBiNDNXZvDeN56Ssgsmk2Az7dCd38bg722IHLSiDodM711XnotS6tqj0H02qtruxyV2ZBc/+f9jTG2g6pkIhGbOB/ArvuEQgIsSaD5CMZjAzrjpCivCASTiCat5Bw0GopTx65xIe535qhdxH9cSiWSnoy1OOmqVc3YYwY3eqna2OspoYroe7MnmJVu39pqNeSEFGt9nRmCUJSn1Bz6VaTobL/lyu3J6kLFnKNsNRwOb8F5UYHk3m+rv4n/8MUwGE0X1J1B6xWEBFiSHA1SUCjXOWHxeOwYDKiFapoFcQGO+BHNQJGifD7178wZrxUjn2Mp0jR0UO/5HrmQ4RtKB43Sd1m5Vh3l/GATMZEvH1otqZPAFlTctluiGRo+Ld4JimuZ64pm1x4PguP+jFGtt9VaCNdFM+UPiUH/fwLm3We9SFns4Giqul321S/CSCbj/0p1pWw5Bw2IrN34ZIZUjEaRpG/Rvr0mE1x8DLMPkwOPFTNKgtmEn8G/mmmcMguoVCD65PpSgkOv+QdnntTWz+loowi4Jf1YLESxR5t2kbxe3LO7x+phkEj+ZRYQY6YfgXryM0fVOGg0CaaTY8LOmExt7TAqn9/YbIHZHXseOwYDKmaUZmCJ6/vZ/YMKWY7mc3UgewdEmhQK/ElfLKilcbZZMjQfmG+KRbvC+zgapKBQs3LCVCOjrdgfrzoXJzwLi4a7bP6DJY3IabWiKHkCv9HJgPH1qUvWazg3r4iACnmyyroSVVBDEAg7DUzfNpQOB7nusgTRp85nkLLFYSQT//EltNwm8SuXxSwST4YII1GmLyis75NjL5k35ec1B7BSKTob5ucsMK5XCpxw01hgQa4UJeDeRXSz151MxJK6IoBAxWha8AsMpdyMJxy+Eofx9pxabvOeMX+x4NyGSV0RQCDsNC1pm0B+PxjNS9yjqdRq1RUoDR0U8nmJaSQAAAAAAAAAAFk+t1+hlsYeLk54FgsRa9htSuewWIh/juZf0BOHLj4Gem3bu9MOxOKsl/yJyq7xsQnMszweGdvhifPqxGLuGGR3cM9JqoetxlbFfsplV/bWA5U92m1s+5o2ko2IRFbgfB7rjzeVn2CNMdYXnE6qqSNvrDrX5cAmYkMEn6ZTmRRWq9NmncBSuO6vAsFTp8IKKzzLA243I8AHk8nCPZDhyizDO8ZeL27X00z/VjOXWCSeselOZDJdaqY34W01lHJCCnn45mG+Yj94UhTZBALHRBNILvH98MiWWxP2m8XsFgmpDogpKBTlkr5OGYtUKhB9cszAD8vrr+cbG0nIRCIrcD4lZBZNqEDp1SDGUT4f9PlmusMgP5EM6Kvy7dHCYcR+8IFMuUWs02Hzlf64lEo5IQVcnPAsFiLWrZcYZfP3cXjpvYe6K5vwofREQAWyWWVdCe11vkgkf7wLdZYSLhfP9Cq0SwkXhel6FZZrhU4nVdqf7uCDkkkTR5EyQypGI8ZSuahGW0etPkN0+LRfJBKxXoskF/bweGRLo/shYv5/3aURS7vMJ52kbcEBc+C90CSidiIgjFmivKCKj8SQbbg2803kuQ10OmZn6nFHteBwX0bvJ4LLKhUIsDnsBl719FsefSG1sYPP0FsQ2+czwGApXHefpzZyOUwBfs9VMhGGwxyB2HIOGg1Fp+07j5l6Pd+JWDr8ecft+ysu6aQZhkPvDs5fCc32e04tN09qa+n6NN8Etq3UcDihI/mNIk0KBX6qocliSLhcG/eo4/2XYDCaLrULKm5bo1GCDetCxOH+p1cilI1YKZodg3N/z5zIZLrUUaVbT7XUtypQCL9Tgc49eZdGptjV5C0E5dIrgPx+MIeWV7aed7VzVKA5aUQdgJfQtDMwyvvz4vDP4o533eC+jMNisS4lnElPRqbOcm+529HKQeJCwe7RTbp2Ay/0eqMPsEWyaKk6zeTMr38L6IRUnQgEg1SzwUaCY5JUNcLIDv7S7k438n/f+6cWejOSDGDxTfsSO1LqA+WESgyrU/27kAed6vY4D3iKGctI7FWPDLMqtZ3Estb+9+Dc28oi9PPsthHfWBNUmpxA4z/e31aKztOgwcgSQyLpwwela4FY+m0NdyeVebHh893ZsYt0QirABLjsLZ//q8KU9Kz4qC11kU97v2mx7ytoeMT2L69Iesfhds6AnMZ+XQxnEdiPkuTBTGJ7mdkkPe3+I0qlw9+2i1GQmx8VJi2/bU9m6gVLYry1GuLPWlKqaui+oFP70M4BSO1oCMDmYxTJQ/4WzRWoJxDNBJIxoGlw9ue8imyXzEywM3zoNfyzucBl3vJYfMeA81IhTt5BMrtQlfFeQ5D0k9+HCDliXdLg8UExPBr7i2avkXIK8FGyEbxHfUJ+1O6lcy47TO72474lgmJ4NOsLzEOcA+PdeOckyCh3MorZhn35FLUZReJDsPJXSw+I9+uX4oi2+piapJQ6GcTwaMsWhYZQ7mQJrxH6733zF9XATqukelZ8VJi0xqm2u/uAT0IYjjzCK887xc0L0EM26qo5dxPwL6wb7DMTLCUG26fw00iN1+Zda/LDGh5eubIWH/gg9YQuBlDEbg+fcWvrHZ6EMAGpM3WMqzFe1D/kFP2ieSJlJ8nxcB7wCTJzpMHKcKdxvpQYS6bnaz0OQNgp/4wUyH4PvsP6x3Z0yzYWqWNKapVyjxORGcJe+Tf1Re1NWuo/nugCSZZQujh7ZDfnvQtYLiLmVZ+J4FPiYYCtUuMFKI38bcVaI+NLmTXeFOD1GtCtCcY5BXimWYZeltdhcQlIfLHi1ss6IRVgAgHpFeV3n67RrbAhP2p33LeYgLduuaGmq12fjSSGRM+b/V5FNsVmJljxxrn+m6y9/erNY0G+mXnE76ciFwhAVXZRB3Hs2I5UPsK6UctnHwQ9CtSCrHGvWHn+eHoEXNrJNrI4rzOOBJrtvYZsyUly7iZhXabrvYECkDKV/dCLLBcR+DQEYHO/CurzCZMpdY/8QhyusT59z6k0uiMHSBGIgysk785Ch0zmXA5X1h+w6doas9G61vmbNDzAdXsciTxFgitRDbhAOpKXXHaYwfHbYUo+DQEY1eaMtNYPSI6FXLTPrpYeDfPLM9k6jlWrFKAO10IXAyhiN4nBg4tt0ZyUYpKJX+997Ts668/LuOZOSjFJBkx+ZC9lw9w9Kz4qTFpj2lvT80CpIQxHtHTRV6FhWTGsWTTaHehyZm7jZRF693ZbyG7TZxawXESbpohcIB1JxbkFOHqINGxFExByxLq53f+/SUYep1GvmdUpd7wc4FuhsPeF5GAn21JUbTC6bld4jDBa1wdlD1auyYfGgmEv8pWlq4lE9fvFcX7VKOdZ8kTKjdy7zix9uIiqFUq+Mo2xuh5hm+mT7OiLCfK9nugTtxd0AapLKF0csyGFjxQxlcruSMOBhBOY0bj8t1DTsvmIiTmoapmNHOG5H4iODORzRlp4mVaDdpeHFgLPKtfuI0G/hccTtbPxoU7/kW/hK0Vn53waAjC30QV1DJj8yF7Km6Wj5/cg2p4GrWpgMaK7sfQ4lz50lH7X0mAs9GY5GMD/ml9Qp/NoZ44kNNmDtKRJ1M1orxt1VZK1h388PQIubeobq/xfW0USH2sNcektKVU1dN/99RBtTwPYCBuoe5+MGcbbfqGjrAmBu7vKEq1mFy36eXBDZgEIKccXkyZ3e/9fnAAAAAAAAAAA6yR2pMkG1xVyTdQvBzjfb7dS7mU43bZfN/+8hj31O6OO+oT8tcFX5unrXHMnJZaqGwvavyU1xDmG4SyHKk1OIJlpoovOPgh6+vsut52cS1UFakFWttksslo65qXevqKWIqOwJqgpJYBTyFs7Nq0VgbEekAEXuHWDxR86Sj/laTDgGeHtzzYhveyBHSWR/LoYRFt9TE1SSh2o2mBp3K7wBVj1zHIwneMp1MBiWWt/9XDOIq0DOdWfmFkc2ZdHAk34i5DFqgMYe1T2Y9J/w1bQ8NhYnpE1tW7VNTCWUdPWehwS+WchzSZzLtKMHD1EGjasSSqUYWQHf2ktHXPcb19RS28KcPQNaNiKYLSzDsoerEHTZQnYM4WYfQs9l0kGMPaonszJCpbEZXeiDuLFrQGofOSatV4OcKPepEKcoYJka6Dal7RG25Yvaszth9TX9t4nKrgYXTelPEafJdzv4VvLpsGcbvn+o+tTp2SjkxvYhM4v0lkLgXwQ9FaiGm2AdDkz5XOgu3nvDQ8VXAygldweI2wsT8aU1DfkEDZN9iMFMpHdMt/Hg2xCZwMmPzKZvO9uZvjNauV7b52MNa4rW+IWWTGzwuISkPh/k70gJ7+RUANpRg6QIg0bVimeJ2+uGdMoY5KMPFOiQy9wgv746Rue0LxveSw+7UD3TEDVN9LeU9t16L+uX8KyYk2pwNKlQf0KTo//4Dz9EmQmIOSVaW+n4+Hw9Ai4qY9s0aojD92m2cLH0BCd0cYoj4p50E90h9WFRpRXm6NxC6I4QX98+oNPaB1HpNsKUAflIGya8UYKZD+hKN33NL1HEoFERwZytyMt8uCGzAIQUpMYLeWNvIkrV8qh+bD4kx37a4kkR8wuWun53RGFBCCkO0vlvraKJD7WVYQlXxnI1l07Z0BOYz+gBqaNtnZsRyof94rHmrTJfiHDU0QuEICq7JpPnblXgucUBbp7yCybMiAxpUZl+LZeT7G2Ufd1R/TUi/oNhXukZoKFqWxaoWqYu5kPrvkI63nJoV43okf0pi12hX3NXSd0HvjFC4AKGCC8vmXcsgH3orRmbRuYb5Qm50zJIb9TxOZIlUEKD5PZykIgzcyqZHuk70KaQGCJChhxDE6k9psys4vM2jYt3jVM05bcI7x8Wy+pwwm7aKqFGrPSYTGnNkjgEwIdxSlB/E2yzVrat3BL5IqneWXZhO1x5jI4b9YXNLuk6C1t1TirckVcIUfqYXe0sV2hq3DPCRzorJB/znK4vf9XyF39lyJ4qKTkTGprb5QNOFGZW08f3+RiV4zK7XG8ntmIK7DAHSwKkXudXRE8UDuiwx4RqHZDxuRjySOjmcHO9xaGxX6odtyHtKlz4JbVCa8NVn2dOlgUtAwqP1ncxvQ2AviEldEh3dPh3T2YNkhK+UXnGqRmiOV1GFR+sqWR9ZNmWHRQwB2JnqgQGGWMBltPVAgMvEYDoy0DhMZRN7893DJQeOyGHirqMKj8eVc/9yFNIDDKBQy2ZfAyK4AWwwxpvpbdGyRwh9uV7pmB4WG40fwYFNnKBfiCDtK7zA3nKWPXYFBDDxTHO8yw6KCdOg+OQHZNVz9UojnRdcHhYXe9EvWjfHNPH0urN8EvH9/CbVZIsWc5XNDxbATtFTe/QqftlxYdFDBAZX1sZ9qrcrgH7Bf6h7pO6Dzfr3nLAwT7wXM/BgVxvEY+eNYcEofpiifQfPSOd7StobnCYlNskN0m4kSbWGCAFgWPwJrX+UH8+/rYzqlL5G0Oo0PyiwYI65+bEmvQSRc0e5qSh0rnaZwiGwF8QsTmnuA6TFxyDuOSVktun14+o5naa6NT9FrYPTXn/uCQTBskJSLQCYMlh+ldhCmAwA8UMOLGs8Cghh4okwh0M6QZ1ynyNB89rdQtbG/uCj+u+7Kljkruc8SQ3TGDqrcttbGhajSpKgQGXiOP33tLNaFoa2/MaiO/bvSmlWwZHLlrhRrTUlXVmNTW3jUayWBN5fKufvMcpsKjqYHhct4vlVGtelOYMCWq/1bI9hYVUh2dHihg2VBv4xz6RQc6GJxV8StkewsBgOyarn6oWXzsi0AFDBBeI1DlGYv5QQTvitM0VcwN1wenvuFtZ3+S5eMluQ3naZdaBhWRom5jerYR7xYYIItGCfTfPrepgaseuweK6H2swLeRA4y2XiMfD9ONRXSwVmBn7fcCweqOvrpfS+CDEjjN48R3ws7+vlwNzkhsNUwb0oxds2QWwxkQJuqe0adicyQDnSmz74Ll658o/ILL8q4CqKronPBdJ4ZDGqz6J3SwKM9HH54xt6k4WBvQuOOSLsi8eBmbQAvvBpD7cce/QvhiHzvrEEYDBJloPnpHtVrY3piPQmOmldGQ2AjHKm5jhFMGJ1J7wxnXy+uwRGbXKZeu5n4MCuJljHwU0vEHsFbIgHEiwywwQAuMinrhH9Xaztug3ts46YoOdK0Qk1TcxhWmC+kaF/ZVzBmN3V/+uL2xSb/lMCiviQrt1lum9bStemp5VvCIKZcifhDoZlUys1L5DlNh39rO/jnOx/MEn8kBYf9itWFnf18ul1zPJtIlh/BR7w+GVDuvYy8eQe8Qy/KPUnImNbu5SoiujbrnM0TwTUEHadNmiP2as6uU3jS7uWaAExeSjfGqm6VkoPDFETxU8THUvr2xoRd/caLz6o71tUCHhUnI9lXDfvFOaUTwXezURmPc9VE32PKs/Q1SM0T8AAAAAAAAAABfvG5ZjvVRWhbPNC7xqoUysDa9bds5XI0TdU/m3TG3Ervfp3otbJCUiefIrDpYKzA8aw4JzfpFncSuBYnH4mUhSXNad39f1GjK/WRWHSybGNoVAgMvn8nhiGckNpQmg2k3ghQeO6+JhJy11TEkcEvp19tKbxrT0jOm+YlDKpPZv501OauKDuOwU/LKrxXH4tFuGSg8dkMPFT3r4pNjhO3EXjyCwyCL+QMzuINMuUoT/WRw3rEuaGtVNZ/RN3pTxDZhyqV5AvNZdQQ6l1KC5Zp5/X9wSCaDEpzFLukTaZzNeCi5/w59rI0dVFV0TnignUPLfYjMs1IzQUS9EhtKE8+6TUnNJf26ThE+dssgjAYILz/2J7oieKB2wolX8gT7supFPf6B5G1n45TB5pU9p2IbLINoXP9JF2TzLBGX/E3spSsk1r2SLmj2sit4RJrFET9I87bt0SF8MS6erXW+tVrWF0/YtF/ULWtO1OSWEjir+pLmtO7+vrXQRqDXMgvvgghHIDuopZEqUST3W/jmnj6W8LE4JBPPCU7+4ln7yQH3dydqcksJHNt9vfj1Ae51R19ZmzwiTeyGkW2EAY+Zwer+dJi45BzbOazgWV5xIXxbtyqkOic8UMCv9QtD7D9UO26Djj4hYnNPcMCUkttFB/9Ycr/qn9/C7mcRaIrPnM36oBqBkNhqmDa5esvZO8YVx5XHMyw6KGCAyoY0RelO6H1Q9pZqX9DW3oXprYFPltXaHHCiL7aePqPVCmn2jVgrZEC4Qo7Jwu51f2BKSeOsjfEsW4b5CwwQyyPh2bLrjwLz7ik5E5TT0iVEyOChf1zQ1qq1jMal96JurYGT+wgjjwLC1caPRlsvn4H8/5zSiP26xXcFkVfzWdxHHSYuOQf/SSv7WCIz5ZrFV92yvOJC+LZzJXe3Ykjgls9vmcSm2D2nTMEUfkHreVcB9IuvdpEqkzc+8p0kmywKGenhYyK2+GIvVTaZQEd1f3qfTVbVpHsLM4IlZ0ZqoRdMuPUFfesIL7LMSMEL9EdfUzcwiNQnXew6lo9DJRgK7RAXPSMs9wFhUa5O0J+Ub8wT/UtHQcRTmHMbWz8N2ZM3ZS/8sJZ7ZEBS4CN20gqJhAyjrjpwMpsY10GcvSM13oUm+v6/EVt8MZkDlwdPhaqbDcWK1PtINrlwvsYL4/xBBKge/zbcS3CHchMf3DPthFO2CETjPjQXZNMP8RtuqzjNOWQ1Hwp3YbhaO1aU9QnPug4whXCEuHJF0Eevs70il6488rpcL29rVUp0vcR2H09w4c/fxkRx7cRe5hB4TB3ArxZ6yinWPBE/KC3tQRd2qFmvrF8hHpmj1e7UhPlJqH7zOzzjbKWW4BPk0SDwmDqdQyxrxARk3Fl1Y2nV9eXRlWyemulfBDaYuyTJ7MjaZqTvRNaVCMilsurGxAwiNcBQO4A4wZO6jGUhAxzux11GvJ6P0zEBGTdRWtHY4uVohuylD7E3EI1XecmRcJ87aQXKQgZP61CDFoDK7+xFavMkG9I4WNZzr+GBq74kL1Tnytm/jAIR8YENzBn9kLxNuw9DxgqVGERqnaB2HaG/y/E/VwEqK95PiWHhcrUnuFOoT3MkgbCx5kPfH0thGMw4Qlw5rGjSt/fXvzfYITEDhkowFMcgFKokY3Kr+lxuYA21TrrFdDlHZXQEA6PzCcIV8Lxx5iMqWLlH6YfwRXtM3xi0d73Ylwm165Bsb+BzCDwmgGDZC/7cQA5B+QN+KElIxuRL6bhyjsroCAZb+wYzDp4XSSsaWVCFYWnnKU665PT85sQ2T8p7z5XjDnRJfX/RhqM+lsJSg2EQ2FrWkE36oQIbTNMSkTq7dYclRPrdRuy5FA8VGD1lmmsehpEUwj8sq9cZEJrXE/4GLdRoNtCmBlay+8HcIhxaed2QlJbv0m28obFJNQ537aAjXk/Jy/05W2to9rkN4OrvpvTUxAQi/x8ahTLn+Wm4Xt7WqpR/biAHrvKPPzrQYjuBqTj+ZiTui3qtoae2gujdyFZge6eMxW8oHiowx5slekX6oI1bQXTgZCsws19ji/9+rgJUS8mvnAwF+AjOWTCK+YtGro/FjanMVcOIgDSWx2dtDrHzPKrh5w3XurtiAjJuorS/1QIPhyAYccudXKdUqbcSzoQWadh96DxWimGEeF62c59CC7pssHQeK/EtW2Dqwc5Hdqw19xKDaRwsa7fZ/s7bX/zNsY9MNRqDH3nAEsMWBYLwq62uYqdMt+GlgByC7wb8Z6IYRfLLI1dRFGZfXfBNnb9A/S10J4ZYoDk9P7cxg9oFpAnRkuOwF6n7KM8LQGX5JamiKUK/PXzbdeInA0Y+ArMm4QxatdBs55aOgpWmLea5c/OzY26tQt9XHTgZwwzl7lSbcinXy8USmSr9ZeLRRvjvTpBWsChktwQeE0Aw4ovALt0q2tUJZ5MrSvSK6V0Hb+b7e8bcR4Qjmqy3VfYWZkAaS+29uAfWSF6o04mvYwWkG8IgrbSxPXU7MriXKfIRmX5YS7MyICkdaDGTztocf/9atsDJn4GOFrvV4n9n46GlnTTuJdIzzZj4roU7VKLZbfcK+ssQXnl5XS6ZubukJY5De2dEM0F4AYb2zohmgvDr8JKjuzR70rzX+mLxjR1VrdnX0BHFVx4L0+Rxsb3/3qpsL4CO6v70XuV9MfbIgKT1D6R/8ET8oBrdycNR9bWV6nZkbTNS+SIAAAAAAAAAAIWQnxb1jr6mRilFc6rxLMwKVRK/Odt9Lnjb2Fcx3SbVKc++CGwta0ghi102WDoPmxUs0q36zXisg6ORiOLHlbzDudplX3+Sap7LoBssHYnDB7X4UJ8vqep+6NbJJpQNzza2fhqvO27KhgeYWXAkJav7eEnf0xqzaUx8V8yTKlHi2WQTpg6KJ/8mPqVmxxWmcWxx/DRDdtyJSk9ZUoRjevja8xTpiyC88lcnaMFKuWaHEIjbfGguyLuIcHX5U3pqYi56RljzAsKiYZEW2+WCCE2ofd4BgybnCdzAGnecaZfo7cOcPax9UMimCjOhoHiowMGoK+RSs4uXP3Rr6hNKiOmiKMy+uv2aJ6vq2U4GjHwE9IlSsXgiflBc9Iyw+wSZWWAX4BVt5Iq9RDi08qc9NTGMUormSf9YhbUV75JN/Pt2DGYcIS6SVjS0kxlcxZp5hpzaUZoh0ZA+MpSBBbW+XC0ZSs6M1F8umEONTKI4Epzbm2+pyr7+OdSBsmAJ7wuMQd7R6/aRpY4VTm2mTZ7mSB9UsG+OzxP9iknYXh0ByeH1r8gmURwJTuP2mKMwde5nrVrHgi7sTbJDjdR8KMGZ2nWJ9oM32xzoks3ON8V8Id2jUwWX3lA8VGBqQvKqVD/3k11yen5zYhup4jKHUwdFnfFWoZ4Pwt/kd8Yd07TNnCJ95Yd/A5hqNBuUnrKkFcb07WIGEZRgKJNAY4DnWuhOEbCL53K21tDxb1CSkJHVls9t6GeV7D6e4N98+SdIK1gUMshqPhTuwm20cRnNp42swPbkAYnNEAy265KtvDoCj9/3sqAXwtLTUpwgDav40FyNazSnj5ui93c347RxnY8jHwFFvkI8L1u3wfceVf79iOVdaFMDK1nz7m5ls+nE/wc6qncqwzma5evsh4Ful/hCp1sRDi2y4EhKSzMSd8s92N7dvVEMrHnrn6U1IXlVKpH1x4qwqWhG4GptQ8foC0vwszoIybNUaxYe5TnxwjXrqZC+wb7yN2YGx7IsIJIzYUVpqusBUjtvwyialGlTq5Nazt0nKDj2PhM0DosEVeyhK6BSd6GyxJeP+KKlUSLKE+VAhiJ2E1hi0/HN243f3gi3bP5dHhLInkoXig5WgWsDlphn7l95lTMD7Vmv7XSLq3jXHW2Sny35PlPu9dio+Lp5jCr2GbFpjjnPa5Xdry90kQTi7CqcgOCIZCfOXI/YgluV6sTg2Zk6xgJxRpnDpRcwdvk9GxUfUKKfQp7VBeorx1lGNGZaz9x/S5hhsftTKSNC98chwAgOhkEwhpPNFpb9e3SHJzGScTaxS9NEbIpjoXIbZpo16KZoDkrKtljyOVCaFqTl3k70Loq5N6dDXug/CNkTTmI54mx/loJ5Gjwt9nSIP27wCoMpFjyOWn5C/etlkVyq7kx5gd21GfI0eFrx6A0lXd3j7Zi9cFCJijKpnMysKMpFGdpOZlauWYgPTLMdIg2XmPo31tsmMvlo8LT/zRqgDwlkTyWFRfo61RdeJN5y9GxUfF2yRhVxPoD7/w9+IHhDzytz0qr6vRfqNq7fYrT9ERus0W+Sz0q6p9vHLWfgs0FrXa1J+tO8oxaySRSoixXRUAaK7PkU4nwd6+Me/EBP5Ix1m+2iI37c/RQbUix4TlBw8XwmaBzmlsrBWBXzvDXSpks7tIGngAz/Kf59/fYe2frD1bqksGwmY6ke9ZnRA8EZkTRAQ0H3rU3tafIFVM2dlkm2G9aryMO95+rbE2jRMYmfsCr7ZR0Y41Lh+ufx2jkjWu98psGhu/XgqO5PepE3eAXPmgseMThxYYC/jlvZ+DrL2zzlgAJ15RXTi4l+Ry0/IfD7vMYtlG63ho6jlbo8JI0hlC4J5yI2Rb/eOYP/ZP65AuQbscl3QWMNENlXw8sXIrWNTsyieuxxnK4MO5n+y1GkjBX7FGWsgm0nMyvhvQR6116/AXn3M6+UGWDFZy7JbEGjxHXCf+umUkaE82Tv0P1144c07Z5gBAdDrhj7jimTue8UTThFPrEMYlqBaXhIB0I1XBJIz0LOFKbunhysH9YGMS3Oe4LWukeS6budFBx7H4caB1YWuA3BHEouuEnBmPIfp3d8qRgByNmlBrE0jkh+wnOtQbINHph7OkR0YKtVo8+744TmKANFdvIKG4fRbYl6YXMP4n3v5F1SWIPN5rjKPb63DCNkftAdERl6Nio+oFkjhLYfQPPxiT8QddRX0UQEcdxFWNo0I3A1uNymEWWH/CBDjZtn08mrJtArC1yI7g4lF2/nejgqtdqQJpzEctnY/jFjxB5G+qjLibervHcWQvUvfR3khS8SbzmoxrowJDOboGAFB9fO6IjIj+6Cxhogr65XokSJJteAEfyl5yg2pFjwByvOu49LTL1Je75K820koTyv6Zu3aVV9EvqevQWntanowEuqW4Nr20JzFI+sO3kFkIOEgShRwSHlV9NQbFWw/XL/mWrLTz1hPtoMjmTi3APwhoNW5rlJ6QTq1yq7Cw/8F6S1E1lncGrjyOFvBNU2f/hPMAKNr1cMGEbI/L06IjJbgSD39sqRCNRvojHs6j6mM02UdFM0ByVYQDlmworSSb7W86eanyH1aMy0g6X+li3QhXUbV+ExWv7QAj3lL9GOSw5bXyDmrd8aMy3pbrGrTKPOEPV7ZcYEEI97qNYsPNerB6OhEHPY4WsNrRKRvtVs8vNmQzUywJcuVXcmss7g1AAAAAAAAAAAywKkdt6bUCnk4y/Ui556wnNLZe4shPdeblOGvM1+EK8BtPyE58vKP8/oc1xlkF/VNhO/2g/0wuYRO4csMef26C/hi6JVBSrr6XS3LrxIoeQKvFZBuJ2Xm7RqpeYiArZuROwmsMS7/4emkDtbJ6UDx39oAZD8meZHl6hKOqcajZzdEu3hYDfqfMVUJR3dDchOiMVMfZVr4xNNkWlgSGYrXbCAcsyZCbmStd5ZYsXJfFGBuAOtGbY3ybL1l9lKgjDsCwiqxV9WXaTxMn/SAXKD1q2YkZ54815jarlRlnZ1H1Mk6SFnClN3T7n9PRwV1G1IkvZhlPvaSF9aNdxzEQFbN97T9HBUd6k9wAoOs4HNDY27iNgJxl/kNhYQSZe+rLpVIbcKyVaTsoxZ9MXiJUEYdtXbXrULIfSZVdehnPVcCW+pcka0w/hRn4VS1IeivTg1VGNdGBKXw1Ajwu/chRg78p9h+W7MDJN5U0iTo53cj+1e3wtZqgpUy6wsbRqfOJRc1667oNiqfecqv6AMCcXvKNhMxk889y+/IAP2TbFYeLOnJMffwG7J+AafMj9ogIaCzClqzVHQHJQFXiuuXMDFw2Jw4sIdYwG2O4QnIDgiGcDS8JAOhGq4JFL8byd6F0XSxpU8jOlNiw/gCfj+MJV1PmVbLHmSKE0LmEo31UNH38Tqta6/iAjipZo/0sCQzFa6nKDg//hM0DhMJZXkr63hYt9nCPSzvGMCv2IPI31U68qTQp0QHBGCYAl9T9CM3dTajC+bVy5g7O9winx/GMS0Hzow26Tf6dP/QAbxmn+w8Htfa/fdTcGe9B9tBkcycW6P+fvMhmpknTMwjI3lZ3REZIlxsPlyoCks1hpHJD9ht9jv64UR1MgnZpYctr5A0UejqrNfJfe4Et52FU5AcEQynVE9drZOVwaT80eax9L5Cqibiy5EdwechSl+uZ09haxpfjfmLfx9QMN3byWk7pOeW+BFyFDdj7Wthu1bpxH/GVLpHQvZz2FrNTfgqyVuQI/7lgf2wDECWnoLAvXhFtI8nfPYSGv7UGUMYhz/J8QIdfV9QMtx+l/TSm2qZhbaopBin181SSPshOLshHw9xQfDswJaNmgEPOIFqL+ebE2sCxn6gIvi6b67lLW5nFJ3x0+jeNm8lfA5e8zjMuUM260mJMdPzhKTMnl+Fyns6y6nCavC1rn2mVTR+F2JjL+6uFUahZp2+xfditsb6FiGNi9/tfZBP4/xNs2K0xEPpbu341wKL+7VFMxNEegwEO3Nfxq5oedd5V9C1YHu3kpVwTshtvL1U1/5ThSADMG0bRiIdh684V/bZSmROy0l6JdacYHCcYF/HOLXpVQuUsXLXFMSS/n3pr7vnCgdnnIufSHy9W7OFw2bgdyn5g6bggUctJQbHnEvYjxJ1zMh5Fz6Qvn33MuOen+Lug9gjpiDGgEPtkZHTM8NjolbI6mShVhPsnqVjMK1cgUzVENC1bjphO/zpQEtGzQCHnGMV6Ziaq50GAv/GfwG49gTEjW6nU1qfG3+ydRMF4+G7WVQZSPmoC5SiAN3LVwGIpOJiwH0/gtpHsD42r2K7YJZkUxOOuyYW2e+sQ3wgn+/lqlqaSea1Pja4eeGidzT1f8ugS4aKx+lU9H7rZDW66DKGBrFQ7I0MQ45FgT33yy5eCemJBxpURifAnU1E8zqr3xeZPKln8hMTvokfSseSJ9fWttk1xirR0xIefSnofInCkAVc9qDKpvrrjSXhnloYhxyUUg40qIwIwTwr2U3/XL2hR0GAj46a0S6Z4WIw85u3XNmqJP3zHCs/9TSTim17anfOFYyFHDqamwHw0GMDlpKgyvLsi9WNbrNBLRs0Ah42QoG7lq4DEQ7DzshH0h2yPnlCVjDiRLu3pjRSznNv4sBWTl7KSBy9Bvgh8BAkxPhaN6tJumIR8qjn04UDIScZ4W71f9VHbfz2FOgykbRXVykDc1gIMeH/jRvhLdtzxXD+1fe/aD8oSHkzkuNe2CWAS09msZCrSmKLGQIddi9EPCvFLNXxup7g3SsTWMh2JpFFjLtqWcJxxmyP/dsJLvzKLwGxmLVJpEsCPI84l7EeJKzZrl4KD9vTzm9wIyPnp1oM/1PORewnnn0N1k94G+ywIwQ1oh4QbHRS9oZsm7uMhOdsLSUh2Z12T4vglk3dxmHwFiQ6ax4PUZhdfGCfgP/bIcJlF3AqDU+uH9FFvllirW5Jj+Vc5h+sCDvuFUzC21RSDEq5qkbVCvLQWMx5BPGFgR5QI+OgYDTEaDv81FhwyVQOtBmIvm9lXDViHbZog1LjUmlUzE1VzoMi+Fo02TfkcQh9BsJ5/UKL48SsJsPJMGhLdpJzCypWT3EH1w0Vj5Xpr9U0U82qFaLgq983+BD9kGa6momhclD+Lzl3L+01+kdK7J63d55nQUga0Q8rtbmq217rpHJ9hvoRT64aKx8rlFjEce2UyLjMqTSPBSRuamS0I+1mC4DEcfKcKxkKODJ1NiJW8KWD1X8xXZCPpDsje/Xb/BQft6ecmc9z0XweozC6kqgYFSUH1yxWBD7W7De/Zxe/qHjvJrGk27dS0rcgAPrdBgI+OixDdIUXsG3KIWaIii8n3NQFylEJwoGQk69zNOXKu30Mxwr9gWZd+QKZqiGJVAwKkqBLtbdio2gpwN3R8UV+HqXDpt7MCPqqWAaxXi346o6c/utpg+2mTEequWXAAAAAAAAAAAxDvGdYgS09CKTcaZE22RVDeyvWRqWB5JcpJeLuKYklhwrGQo4dTU2QaKVtYLNYCwyedzBZCYnfcGhlKqfdkJxE52AOybf0KGuUcTUQegwFtgT+kStZd/BrAvyvEXU0hMjvmqSRsUV2UnXTQiSPc84nQUDISfQZucvf97/Xk1jx6R+KgFVJH0HmbFv8S+ov+1GYdQ5jJcqr9/Qu8ijP5VC3KeWlKUdBsuwIOu2faHnJboPBWNpbao05PGkgNX3bKfEOONOlRDq95OegSQ7ZPL8je+uRgctJc8sCPOjWG/wTtelY3WzzzpWIMlHzkDnhlBD+KPdhvGCKVaLeV6sammHgAMBHx27Il31NhLT9xReAxifddowDew8lXDbnDcgyfO7Ih5Xa3PbuHL2UkDk9TbdRDviUYiryKriH/442bNXqP1Dym7n5PEXyqNhS4mkfuz+NOcy4cZinoN0LEMbmbHUzzoWr4PC1mqq5agESZDpHCYnHXZMo71fkcS3TD9YEPl8bdBF+EGixn8a/Rn+YzFPyPlXI42YnOmnCQddUwbujlX8VAKqSPoOSPpWPJAjvrRl376rylI/dmyHfSLYvOHuzE0784XgReO+u2mzYRVzPhDqrWcg/UMots6xDnHl3Cq9zETvZzfgt1I/FY6kErCNmJx0xS22zmGb61mZK5Rd6Ios78oJd29Mo71rjVt+N4TrRz2xy12JMMP7osKbSqB0nCgYFSXOF2toMxHy0MQ45F/Tute+hLcf/G7RWuX6gJs2zbARbF7+dymRhEdSCVjIopBwuVlgRghTEg66pgzBAToMBHx01ohpaR4KxtLaSWhz20l05utHUXqDiv30BZnJWkrNM7TiH5lgRslPwDSX8OarkujRy46iM1TH9WY4VvHZPuFwr3uuTWFr0nvCKuZ8krOaEDl6g3CryLMwS46YkL+WcodjCwKyW2fWB7b8bhXQMcOXzlU/5ha6WwGwBrUlqJut5ilucMhqH1Jdd9NDW24QNXBXPfoLZg77Khf8lat2Mnqel2NL9kutnWRiRYv18YMMrtvD90jFyPVCZpEx/5UEShzcSLDLiSli3zz4uGawueII6TDBNaFPs/BhGnZ8jSYF8hwWATbWtxki/sxUnjcIlDilkH2LC12jjlgD1JxaW8yc6m88vO2uJG07c//l0rh+D94i7c5eVKuxyoGF7B3n+I/oBWG5rV4ahwE1oIwvKtvWZc7MdleAtaeC9YNYPtyKLu3kez/J2Vw1Br7nD4O+ER1sTgXupgO5CVk2dBAQPIG0gJ/eXSxptgJ9DHdKOZCA19XIeVMJ1B4WSHQGtM3WOxgmUF5f+Z3C9JsCmOic0FQKlDy2f7yoS3+JHxfFcj0ds7eN8qZ4qm5x5ztPLhQz5pmgcWcNhPIb5FRiB4KY3zMntNIPL/BJ3OLTdp5c22xgGZZW63pkh0ayB4tHgzLNI1mNy63PHqSVW/DH2oXpoUNAG51Gtf2Spdm77CG4yBOMeQ4Ljhsu4AuabXulYvhXEriTt/H86yj+2AvqlJ1WSmXrikDqTGyZiOhHSigjRTWJixIdjy2r2MAyMazL9Loukcq5hny9eWC+Pe+OJjoMEal3YC/W8MtQ4a0WyTUn6uIulANf/YkoZtEvXeLOGv8bGEGrm/OQn5M53oz+DUOWRyfIxIoL91JFAsaqrlMcm5xe86wQtBNPovpJQqsypT8WWmLlURIrx0FI2nbm49eSSEDl5GSyp9NyrkPWl4TaIztyoQXhGoakigSRSUGmOLS2hSXJ3nhl3eq6rKbPgAIKl3PCULa9iMKE/7tevTOTi6DfRyyPak4q72y3TZUcMkJ5g3IqMY1Bc/fN/784m7IHTAr5OCwCbIpqDwskOgNab9rlPF+Ikx/Gi5iWflOKw0T/WccaqOY54vzgzkOekimiDN4kedjNQBnon6LI69jp9Ea7z/OYJwxDs1M+IoTkVdgvDc2OlFBGUQZvErJs6CDnOVeva8VCbQgezlpAwW+gOxk9T8W/q3t/5mSI3xdNQg6YFO9wWATYgTeshXw518axczJE4YWoIWlcP4lvEfhn9s8GV+Pv9SQaq/J20Clj1S2jZk51uR5eAom9mBB30iiQwf199BNgjzxVN7b9k6kXqhIQfjkZouAGhtq1MJlreNqmsFWe44Juw04v91YIWodtU1ikT/9BN/xYdZWzWUisfKUJXMfV9n77FH9si3VKwL/rJquR3az5aJbvxWekkXPKmjHhHnxcM7vkQYaxMxWpDdt5O2iav+RwtKArp/ogjuR6OntzB/lRjOzVvhSjaCLu7Um5I7FE2Rdwi024s9wxYIghnydl/tOz+o/c8fJ6CZELLTH8pgmbD1LEo3jtbcxQzL9eutmBNGvVghF/ZipPlM6aUNT92d8rJbz7RSB1JmfEK2YfSfy/SSQg/HIyWd0DQ23UGMK7PB9uRRf4crORoIVjvGmvH2jUPqS67ruGtgHK0EwItWkUrJTKywmAyZhUw9hzmjc4ZCb+xcAtusrC3qnXeL4NOz4ED2ctIO65UOWw6jd7spBF8wqxNsu0JWBiAZwHNxIs++hrkwwTKC+hzBzrVC7lN0tTj9KKohs6CBthIjrYnArBNsJEdK0lFJ96I9Pp90ydBr4h9ueZaMXtz1+GgDYnjHf3BdYb61qcME0rR9FS3OCNX557/cI07Pgkd3hYPc0Y6oZ7pnxEFdWqTOGXnVppiZkAAAAAAAAAAOxk9CEzxpbxtXxVacFrEXHBx5JvRn+Ir2VNlv4PPi6XFfk21ajEDhm4pyxSqfGulalRfaoh2xncWNJxBPoY7pRZGKFI8q2HgFzdFina9lfEgnTBUWT7bPrR+xPbxuBW8n1v2RDPYJ9qtj84vdmpqk09n+f69SbAA3S7xwaHFJne32MHNLa4Uio60+0DzQrCb/reryCDwCPUwA1CI07K4buFOMuoXNdulsQCJQ5uJFjrR7w0EwJqXQWv16cfEUJypJeN94TMP2LjuW38HqFEx4Ehss85FZbIrjGOTo2VCRbzzpVWzD6S5WM4WlCb3X0QRzWBKaC156+j5vOH42NwK3ngdV1WU+lAAXvpA6X/+fQSErU8LJDoDHUzB/MVhX7E24+vuGoMYdMe2eXdgYYhOVJ3+KrSn9Yi4iW9qBQ1eHH+dXEXSo+h8MoTf+xgmF1lYTBEnsGdvH/npUDU3UH0zyzcIGrgrnrpFluRHNDi2lWosjBfkPlHEx00S/nsvVLGt10XxmXSQz7QGCJP7sBesf2eWemShEtkV5pWjr+kpd0Ho8YOaHFtpFR+LLTE16IkVoexdjBMoLy+QTrupjLzNn2ZFeNrvGdmO0DwPuo6Rl9pHC0ow+CwCK1OaCoFSh5bsQXFt2EoW9BE4b+NGltcKRXywGF6wwFMdLf16PHRHMNZY8tMSz+nRe+dGoRGnInfa+M2MIJLK/s91fR09uYO76L1jGuD+y1OGEZ25F8K3zQRIHgfdR0jobq9Ypszgap+0a4dd1MZ9xuw/tHIDaMumoRVCQg/koJRcCmsAWNVV6cOp8lpRVGDHQSOZWgmBNS6ChH2UfiIKrdJ133JbvZ5PYrvJ5n1KwQtzUju8LB6hzDJIvGi7Q1Uc5JhQvHTL9CXx0pnTShq8OLhgP18yXSMvtJxfnBnr09JmpOCkKns0duziOOykzRN0XInNBWMJQ+j1g"));function f(e,t){return e[t>>2]>>((3&t)<<3)&255}function h(e,t){for(var r,n,i=0,a=0;a<16;a++)r=(65535&e[a])+(65535&t[a])+(i||0),n=(e[a]>>>16)+(t[a]>>>16)+(r>>>16),e[a]=65535&r|n<<16,i=n>>>16}function l(e){return new Int32Array(e.buffer,e.byteOffset,16)}function d(e,t){for(var r=0;r<16;r++)e[r]=t[r]}function p(){return new Int32Array(16)}function g(e,t){for(var r=0;r<16;r++)e[r]=e[r]^t[r]}var y=p();function v(e,t){d(y,e),g(y,t);for(var r=0;r<8;r++){var n,i,a=f(y,r)<<1;n=s[a],i=s[a+1];for(var o=1;o<8;o++)a=(o<<9)+(f(y,(o<<3)+r)<<1),n^=s[a],i^=s[a+1];e[r<<1]=n,e[1+(r<<1)]=i}}var m=p(),b=p();function w(e,t,r){var n;for(d(m,e),v(m,t),d(b,m),v(m,r),n=0;n<11;n++)v(b,a[n]),v(m,b);v(b,a[11]),g(m,b),g(e,m),g(e,r)}function S(e){var a=l(e);w(i,n,a),h(n,t),h(r,a)}function E(t){var a=t.length;if(!(a>63)){var s=new Int32Array(16);s[0]=a<<3;for(var o=new Uint8Array(64),c=0;c<a;c++)o[c]=t[c];o[a]=1;var u=l(o),f=l(s);w(i,n,u),h(n,f),h(r,u),w(i,e,n),w(i,e,r)}}return function(e){r=p(),n=p(),i=p();for(var t=0;t<16;t++)256===this.bitLength&&(i[t]=16843009);var a,s=new Uint8Array(u(e)),c=s.length,f=c%64,h=(c-f)/64;for(t=0;t<h;t++)S.call(this,new Uint8Array(s.buffer,64*t,64));if(E.call(this,new Uint8Array(s.buffer,64*h,f)),256===this.bitLength)for(a=new Int32Array(8),t=0;t<8;t++)a[t]=i[8+t];else for(a=new Int32Array(16),t=0;t<16;t++)a[t]=i[t];return"SC"===this.procreator||"VN"===this.procreator?o(a.buffer):a.buffer}}(),h=function(){var e,t,r,n;function i(e){for(var t=new Uint8Array(32),r=0;r<8;r++)t[4*r]=e[r],t[1+4*r]=e[8+r],t[2+4*r]=e[16+r],t[3+4*r]=e[24+r];return t}function a(e){for(var t=new Uint8Array(8),r=0;r<8;r++)t[r]=e[r]^e[r+8];return s(e,8,e,0,24),s(t,0,e,24,8),e}function c(e){var t=new Uint16Array(e.buffer,0,16),r=t[0]^t[1]^t[2]^t[3]^t[12]^t[15];s(t,1,t,0,15),t[15]=r}function f(e,t,r,n,i){var a=new Uint8Array(8);s(n,i,a,0,8),s(new Uint8Array(this.cipher.encrypt(e,a)),0,t,r,8)}function h(n,o){var u=new Uint8Array(32),h=new Uint8Array(32),l=new Uint8Array(32),d=new Uint8Array(32);s(n,o,r,0,32),s(t,0,h,0,32),s(r,0,l,0,32);for(var p=0;p<32;p++)d[p]=h[p]^l[p];f.call(this,i(d),u,0,t,0);for(var g=1;g<4;g++){var y=a(h);for(p=0;p<32;p++)h[p]=y[p]^e[g][p];for(l=a(a(l)),p=0;p<32;p++)d[p]=h[p]^l[p];f.call(this,i(d),u,8*g,t,8*g)}for(var v=0;v<12;v++)c(u);for(v=0;v<32;v++)u[v]=u[v]^r[v];for(c(u),v=0;v<32;v++)u[v]=t[v]^u[v];for(v=0;v<61;v++)c(u);s(u,0,t,0,t.length)}function l(e){for(var t=0,r=0;r<n.length;r++){var i=(255&n[r])+(255&e[r])+t;n[r]=i,t=i>>>8}}var d=new Uint8Array([0,255,0,255,0,255,0,255,255,0,255,0,255,0,255,0,0,255,255,0,255,0,0,255,255,0,0,0,255,255,0,255]);return function(i){t=new Uint8Array(32),r=new Uint8Array(32),n=new Uint8Array(32),e=new Array(4);for(var a=0;a<4;a++)e[a]=new Uint8Array(32);s(d,0,e[2],0,d.length);var c=new Uint8Array(u(i)),f=c.length,p=f%32,g=(f-p)/32;for(a=0;a<g;a++){var y=new Uint8Array(c.buffer,32*a,32);l.call(this,y),h.call(this,y,0)}if(p>0){y=new Uint8Array(c.buffer,32*g);var v=new Uint8Array(32);s(y,0,v,0,p),l.call(this,v),h.call(this,v,0)}for(var m=new Uint8Array(32),b=8*f,w=0;b>0;)m[w++]=255&b,b=Math.floor(b/256);h.call(this,m,0),h.call(this,n,0);var S=t.buffer;return"SC"===this.procreator&&(S=o(S)),S}}(),l=function(){var e,t=new Uint32Array(80);function r(e,t,r,n,i){return i+t+r+n+(e<<5|e>>>27)>>>0}function n(e,t,n,i,a,s){return r(e,a,s,1518500249,i^t&(n^i))}function i(e,t,n,i,a,s){return r(e,a,s,1859775393,t^n^i)}function a(e,t,n,i,a,s){return r(e,a,s,2400959708,t&n|i&(t|n))}function s(e,t,n,i,a,s){return r(e,a,s,3395469782,t^n^i)}function o(e,t){for(var r=e[0],o=e[1],c=e[2],u=e[3],f=e[4],h=n,l=0;l<80;l+=5)20===l?h=i:40===l?h=a:60===l&&(h=s),f=h(r,o,c,u,f,t[l]),u=h(f,r,o=(o<<30|o>>>2)>>>0,c,u,t[l+1]),c=h(u,f,r=(r<<30|r>>>2)>>>0,o,c,t[l+2]),o=h(c,u,f=(f<<30|f>>>2)>>>0,r,o,t[l+3]),r=h(o,c,u=(u<<30|u>>>2)>>>0,f,r,t[l+4]),c=(c<<30|c>>>2)>>>0;e[0]+=r,e[1]+=o,e[2]+=c,e[3]+=u,e[4]+=f}function c(e){return(255&e)<<24|(65280&e)<<8|e>>8&65280|e>>24&255}return function(r){var n=new Uint8Array(u(r)),i=n.length,a=i+9;a%64&&(a+=64-a%64),(e=new Uint32Array(5))[0]=1732584193,e[1]=4023233417,e[2]=2562383102,e[3]=271733878,e[4]=3285377520;for(var s=0;s<a;s+=64){for(var f=0;f<64;f++){var h=0,l=s+f;if(l<i)h=n[l];else if(l===i)h=128;else{var d=a-l-1;d>=0&&d<4&&(h=i<<3>>>8*d&255)}f%4==0?t[f>>2]=h<<24:t[f>>2]|=h<<8*(3-f%4)}for(f=16;f<80;f++){var p=t[f-3]^t[f-8]^t[f-14]^t[f-16];t[f]=p<<1|p>>>31}o(e,t)}for(f=0;f<5;f++)e[f]=c(e[f]);return e.buffer}}();function d(e,t){var r=this.digest===h?32:64,n=this.bitLength/8,i=u(e),a=u(t);if(i.byteLength===r)s=new Uint8Array(i);else{var s=new Uint8Array(r);i.byteLength>r?s.set(new Uint8Array(this.digest(i))):s.set(new Uint8Array(i))}for(var o=new Uint8Array(r+a.byteLength),c=new Uint8Array(r+n),f=0;f<r;f++)o[f]=54^s[f],c[f]=92^s[f];return o.set(new Uint8Array(a),r),c.set(new Uint8Array(this.digest(o)),r),this.digest(c)}function p(e,t,r){var n=new Uint8Array(this.sign(e,r)),i=new Uint8Array(t);if(n.length!==i.length)return!1;for(var a=0,s=n.length;a<s;a++)if(n[a]!==i[a])return!1;return!0}function g(){return(0,n.getSeed)(this.bitLength).buffer}function y(e,t){if(t%8>0)throw new a.DataError("Length must multiple of 8");for(var r=this.bitLength/8,n=this.digest===h?32:64,i=t/8,o=this.iterations,c=this.diversifier,f=new Uint8Array(n),l=0;l<n;l++)f[l]=c;var d=new Uint8Array(u(this.salt)),p=d.length,g=n*Math.ceil(p/n),y=new Uint8Array(g);for(l=0;l<g;l++)y[l]=d[l%p];var v=new Uint8Array(u(e)),m=v.length,b=n*Math.ceil(m/n),w=new Uint8Array(b);for(l=0;l<b;l++)w[l]=v[l%m];var S=new Uint8Array(g+b);s(y,0,S,0,g),s(w,0,S,g,b);var E=Math.ceil(i/r),C=new Uint8Array(E*r);for(l=0;l<E;l++){var A=new Uint8Array(n+g+b);s(f,0,A,0,n),s(S,0,A,n,g+b);for(var B=0;B<o;B++)A=new Uint8Array(this.digest(A));s(A,0,C,l*r,r);var x=new Uint8Array(n);for(B=0;B<n;B++)x[B]=A[B%r];var T=(g+b)/n;for(B=0;B<T;B++)for(var I,F=1,k=n-1;k>=0;--k)F=(I=S[n*B+k]+x[k]+F)>>>8,S[n*B+k]=255&I}var R=new Uint8Array(i);return s(C,0,R,0,i),R.buffer}function v(e,t){if(t%8>0)throw new a.DataError("Length must be multiple of 8");var r,n=t/8,i=new Uint8Array(u(this.context)),s=this.bitLength/8,o=Math.ceil(n/s);r=this.label?new Uint8Array(u(this.label)):new Uint8Array([38,189,184,120]);for(var c=new Uint8Array(n),f=0;f<o;f++){var h=new Uint8Array(r.length+i.length+4);h[0]=f+1,h.set(r,1),h[r.length+1]=0,h.set(i,r.length+2),h[h.length-2]=t>>>8,h[h.length-1]=255&t,c.set(new Uint8Array(d.call(this,e,h),0,f<o-1?s:n-f*s),f*s)}return c.buffer}function m(e,t){var r=this.diversifier||1;if((t*=r)<this.bitLength/2||t%8>0)throw new a.DataError("Length must be more than "+this.bitLength/2+" bits and multiple of 8");var n=this.bitLength/8,i=t/8,o=this.iterations,c=new Uint8Array(u(e)),f=new Uint8Array(u(this.salt)),h=f.byteLength,l=new Uint8Array(h+4);if(s(f,0,l,0,h),i>137438953408)throw new a.DataError("Invalid parameters: Length value");for(var p=Math.ceil(i/n),g=new Uint8Array(i),y=1;y<=p;y++){l[h]=y>>>24&255,l[h+1]=y>>>16&255,l[h+2]=y>>>8&255,l[h+3]=255&y;for(var v=new Uint8Array(d.call(this,c,l)),m=v,b=1;b<o;b++){v=new Uint8Array(d.call(this,c,v));for(var w=0;w<n;w++)m[w]=v[w]^m[w]}var S=(y-1)*n;s(m,0,g,S,Math.min(n,i-S))}if(r>1){var E=i/r,C=new Uint8Array(E);return s(g,i-E,C,0,E),C.buffer}return g.buffer}function b(e,t){if(t>this.bitLength||t%8>0)throw new a.DataError("Length can't be more than "+this.bitLength+" bits and multiple of 8");var r=this.digest===h?32:64,n=this.bitLength/8,i=!!(e&&e.byteLength>0)&&new Uint8Array(u(e)),o=i?i.length:0,c=this.iterations,f=new Uint8Array(u(this.salt)),l=f.length,d=new Uint8Array(l+o);s(f,0,d,0,l),i&&s(i,0,d,l,o);for(var p=new Uint8Array(this.digest(d)),g=new Uint8Array(r),y=new Uint8Array(r),v=new Uint8Array(r),m=0;m<32;m++)g[m]="DENEFH028.760246785.IUEFHWUIO.EF".charCodeAt(m);d=new Uint8Array(2*(r+n));for(var b=0;b<c;b++){for(m=0;m<r;m++)y[m]=54^g[m],v[m]=92^g[m],g[m]=0;s(y,0,d,0,r),s(p,0,d,r,n),s(v,0,d,r+n,r),s(p,0,d,r+n+r,n),s(new Uint8Array(this.digest(d)),0,g,0,n)}for(m=0;m<n;m++)y[m]=54^g[m],v[m]=92^g[m],g[m]=0;if(s(y,0,d=new Uint8Array(2*n+l+o),0,n),s(f,0,d,n,l),s(v,0,d,n+l,n),i&&s(i,0,d,n+l+n,o),p=this.digest(this.digest(d)),t===this.bitLength)return p;var w=t/8,S=new Uint8Array(w);return s(p,0,S,0,w),S.buffer}function w(e){return this.deriveBits(e,8*this.keySize)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GostCipher=function(e){if(!s)throw new n.NotSupportedError("Big endian platform not supported");switch(e=e||{},this.keySize=32,this.blockLength=e.length||64,this.blockSize=this.blockLength>>3,this.name=(e.name||(1===e.version?"RC2":1989===e.version?"GOST 28147":"GOST R 34.12"))+(e.version>4?"-"+(e.version||1989)%100:"")+"-"+(64===this.blockLength?"":this.blockLength+"-")+("MAC"===e.mode?"MAC-"+(e.macLength||this.blockLength>>1):"KW"===e.mode||e.keyWrapping?("NO"!==(e.keyWrapping||"NO")?e.keyWrapping:"")+"KW":(e.block||"ECB")+(("CFB"===e.block||"OFB"===e.block||"CTR"===e.block&&2015===e.version)&&e.shiftBits&&e.shiftBits!==this.blockLength?"-"+e.shiftBits:"")+(e.padding?"-"+(e.padding||("CTR"===e.block||"CFB"===e.block||"OFB"===e.block?"NO":"ZERO"))+"PADDING":"")+("NO"!==(e.keyMeshing||"NO")?"-CPKEYMESHING":""))+(e.procreator?"/"+e.procreator:"")+("string"==typeof e.sBox?"/"+e.sBox:""),this.procreator=e.procreator,e.version||1989){case 1:this.process=O,this.keySchedule=N,this.blockLength=64,this.effectiveLength=e.length||32,this.keySize=8*Math.ceil(this.effectiveLength/8),this.blockSize=this.blockLength>>3;break;case 2015:if(this.version=2015,64===this.blockLength)this.process=R,this.keySchedule=_;else{if(128!==this.blockLength)throw new n.DataError("Invalid block length");this.process=I,this.keySchedule=T}this.processMAC=Y;break;case 1989:if(this.version=1989,this.process=k,this.processMAC=W,this.keySchedule=D,64!==this.blockLength)throw new n.DataError("Invalid block length");break;default:throw new n.NotSupportedError("Algorithm version "+e.version+" not supported")}switch(e.mode||e.keyWrapping&&"KW"||"ES"){case"ES":switch(e.block||"ECB"){case"ECB":this.encrypt=L,this.decrypt=U;break;case"CTR":1989===this.version?(this.encrypt=j,this.decrypt=j):(this.encrypt=V,this.decrypt=V,this.shiftBits=e.shiftBits||this.blockLength);break;case"CBC":this.encrypt=G,this.decrypt=q;break;case"CFB":this.encrypt=K,this.decrypt=M,this.shiftBits=e.shiftBits||this.blockLength;break;case"OFB":this.encrypt=H,this.decrypt=H,this.shiftBits=e.shiftBits||this.blockLength;break;default:throw new n.NotSupportedError("Block mode "+e.block+" not supported")}if("CP"===e.keyMeshing?this.keyMeshing=he:this.keyMeshing=le,this.encrypt===L||this.encrypt===G)switch(e.padding){case"PKCS5P":this.pad=pe,this.unpad=ge;break;case"RANDOM":this.pad=be,this.unpad=de;break;case"BIT":this.pad=ve,this.unpad=me;break;default:this.pad=ye,this.unpad=de}else this.pad=de,this.unpad=de;this.generateKey=z;break;case"MAC":this.sign=J,this.verify=Q,this.generateKey=z,this.macLength=e.macLength||this.blockLength>>1,this.pad=de,this.unpad=de,this.keyMeshing=le;break;case"KW":switch(this.pad=de,this.unpad=de,this.keyMeshing=le,e.keyWrapping){case"CP":this.wrapKey=te,this.unwrapKey=re,this.generateKey=z,this.shiftBits=e.shiftBits||this.blockLength;break;case"SC":this.wrapKey=ae,this.unwrapKey=se,this.generateKey=oe;break;default:this.wrapKey=Z,this.unwrapKey=$,this.generateKey=z}break;case"MASK":this.wrapKey=ue,this.unwrapKey=fe,this.generateKey=z;break;default:throw new n.NotSupportedError("Mode "+e.mode+" not supported")}var t,r=e.sBox;if(r){if("string"==typeof r){if(t=r.toUpperCase(),!(r=c[t]))throw new SyntaxError("Unknown sBox name: "+e.sBox)}else if(!r.length||r.length!==c["E-Z"].length)throw new SyntaxError("Length of sBox must be "+c["E-Z"].length)}else r=2015===this.version?c["E-Z"]:"SC"===this.procreator?c["E-SC"]:c["E-A"];if(this.sBox=r,e.iv){if(this.iv=new Uint8Array(e.iv),this.iv.byteLength!==this.blockSize&&1989===this.version)throw new SyntaxError("Length of iv must be "+this.blockLength+" bits");if(this.iv.byteLength!==this.blockSize>>1&&this.encrypt===V)throw new SyntaxError("Length of iv must be "+this.blockLength>>"1 bits");if(this.iv.byteLength%this.blockSize!=0&&this.encrypt!==V)throw new SyntaxError("Length of iv must be a multiple of "+this.blockLength+" bits")}else this.iv=128===this.blockLength?y:o;if(e.ukm&&(this.ukm=new Uint8Array(e.ukm),8*this.ukm.byteLength!==this.blockLength))throw new SyntaxError("Length of ukm must be "+this.blockLength+" bits")};var n=r(19),i=r(25),a=ArrayBuffer,s=function(){var e=new a(2);return new DataView(e).setInt16(0,256,!0),256===new Int16Array(e)[0]}(),o=new Uint8Array([0,0,0,0,0,0,0,0]),c={"E-TEST":[4,2,15,5,9,1,0,8,14,3,11,12,13,7,10,6,12,9,15,14,8,1,3,10,2,7,4,13,6,0,11,5,13,8,14,12,7,3,9,10,1,5,2,4,6,15,0,11,14,9,11,2,5,15,7,1,0,13,12,6,10,4,3,8,3,14,5,9,6,8,0,13,10,11,7,12,2,1,15,4,8,15,6,11,1,9,12,5,13,3,7,10,0,14,2,4,9,11,12,0,3,6,7,5,4,8,14,15,1,10,2,13,12,6,5,2,11,0,9,13,3,14,7,10,15,4,1,8],"E-A":[9,6,3,2,8,11,1,7,10,4,14,15,12,0,13,5,3,7,14,9,8,10,15,0,5,2,6,12,11,4,13,1,14,4,6,2,11,3,13,8,12,15,5,10,0,7,1,9,14,7,10,12,13,1,3,9,0,2,11,4,15,8,5,6,11,5,1,9,8,13,15,0,14,4,2,3,12,7,10,6,3,10,13,12,1,2,0,11,7,5,9,4,8,15,14,6,1,13,2,9,7,10,6,0,8,12,4,5,15,3,11,14,11,10,15,5,0,12,14,8,6,2,3,9,1,7,13,4],"E-B":[8,4,11,1,3,5,0,9,2,14,10,12,13,6,7,15,0,1,2,10,4,13,5,12,9,7,3,15,11,8,6,14,14,12,0,10,9,2,13,11,7,5,8,15,3,6,1,4,7,5,0,13,11,6,1,2,3,10,12,15,4,14,9,8,2,7,12,15,9,5,10,11,1,4,0,13,6,8,14,3,8,3,2,6,4,13,14,11,12,1,7,15,10,0,9,5,5,2,10,11,9,1,12,3,7,4,13,0,6,15,8,14,0,4,11,14,8,3,7,1,10,2,9,6,15,13,5,12],"E-C":[1,11,12,2,9,13,0,15,4,5,8,14,10,7,6,3,0,1,7,13,11,4,5,2,8,14,15,12,9,10,6,3,8,2,5,0,4,9,15,10,3,7,12,13,6,14,1,11,3,6,0,1,5,13,10,8,11,2,9,7,14,15,12,4,8,13,11,0,4,5,1,2,9,3,12,14,6,15,10,7,12,9,11,1,8,14,2,4,7,3,6,5,10,0,15,13,10,9,6,8,13,14,2,0,15,3,5,11,4,1,12,7,7,4,0,5,10,2,15,14,12,6,1,11,13,9,3,8],"E-D":[15,12,2,10,6,4,5,0,7,9,14,13,1,11,8,3,11,6,3,4,12,15,14,2,7,13,8,0,5,10,9,1,1,12,11,0,15,14,6,5,10,13,4,8,9,3,7,2,1,5,14,12,10,7,0,13,6,2,11,4,9,3,15,8,0,12,8,9,13,2,10,11,7,3,6,5,4,14,15,1,8,0,15,3,2,5,14,11,1,10,4,7,12,9,13,6,3,0,6,15,1,14,9,2,13,8,12,4,11,10,5,7,1,10,6,8,15,11,0,4,12,3,5,9,7,13,2,14],"E-SC":[3,6,1,0,5,7,13,9,4,11,8,12,14,15,2,10,7,1,5,2,8,11,9,12,13,0,3,10,15,14,4,6,15,1,4,6,12,8,9,2,14,3,7,10,11,13,5,0,3,4,15,12,5,9,14,0,6,8,7,10,1,11,13,2,6,9,0,7,11,8,4,12,2,14,10,15,1,13,5,3,6,1,2,15,0,11,9,12,7,13,10,5,8,4,14,3,0,2,14,12,9,1,4,7,3,15,6,8,10,13,11,5,5,2,11,8,4,12,7,1,10,6,14,0,9,3,13,15],"E-Z":[12,4,6,2,10,5,11,9,14,8,13,7,0,3,15,1,6,8,2,3,9,10,5,12,1,14,4,7,11,13,0,15,11,3,5,8,2,15,10,13,14,1,7,4,12,9,6,0,12,8,2,1,13,4,15,6,7,0,10,5,3,14,9,11,7,15,5,10,8,1,6,13,0,9,3,14,11,4,2,12,5,13,15,6,9,2,12,10,11,7,8,1,4,3,14,0,8,14,2,5,6,9,1,12,15,4,11,0,13,10,3,7,1,7,14,13,0,5,8,3,4,15,10,6,9,12,11,2],"D-TEST":[4,10,9,2,13,8,0,14,6,11,1,12,7,15,5,3,14,11,4,12,6,13,15,10,2,3,8,1,0,7,5,9,5,8,1,13,10,3,4,2,14,15,12,7,6,0,9,11,7,13,10,1,0,8,9,15,14,4,6,12,11,2,5,3,6,12,7,1,5,15,13,8,4,10,9,14,0,3,11,2,4,11,10,0,7,2,1,13,3,6,8,5,9,12,15,14,13,11,4,1,3,15,5,9,0,10,14,7,6,8,2,12,1,15,13,0,5,7,10,4,9,2,3,14,6,11,8,12],"D-A":[10,4,5,6,8,1,3,7,13,12,14,0,9,2,11,15,5,15,4,0,2,13,11,9,1,7,6,3,12,14,10,8,7,15,12,14,9,4,1,0,3,11,5,2,6,10,8,13,4,10,7,12,0,15,2,8,14,1,6,5,13,11,9,3,7,6,4,11,9,12,2,10,1,8,0,14,15,13,3,5,7,6,2,4,13,9,15,0,10,1,5,11,8,14,12,3,13,14,4,1,7,0,5,10,3,12,8,15,6,2,9,11,1,3,10,9,5,11,4,15,8,6,7,14,13,0,2,12],"D-SC":[11,13,7,0,5,4,1,15,9,14,6,10,3,12,8,2,1,2,7,9,13,11,15,8,14,12,4,0,5,6,10,3,5,1,13,3,15,6,12,7,9,8,11,2,4,14,0,10,13,1,11,4,9,12,14,0,7,5,8,15,6,2,10,3,2,13,10,15,9,11,3,7,8,12,5,14,6,0,1,4,0,4,6,12,5,3,8,13,10,11,15,2,1,9,7,14,1,3,12,8,10,6,11,0,2,14,7,9,15,4,5,13,10,11,6,0,1,3,4,7,14,13,5,15,8,2,9,12]},u=new Uint8Array([105,0,114,34,100,201,4,35,141,58,219,150,70,233,42,196,24,254,172,148,0,237,7,18,192,134,220,194,239,76,169,43]);function f(e){return e>=2147483648?e-4294967296:e}function h(e){return e<0?e+4294967296:e}function l(e){if(e instanceof a)return e;if(e&&e.buffer&&e.buffer instanceof a)return 0===e.byteOffset&&e.byteLength===e.buffer.byteLength?e.buffer:new Uint8Array(new Uint8Array(e,e.byteOffset,e.byteLength)).buffer;throw new n.DataError("CryptoOperationData required")}function d(e){return new Uint8Array(l(e))}function p(e){return new Uint8Array(d(e))}function g(e){return(255&e)<<24|(65280&e)<<8|e>>8&65280|e>>24&255}var y=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),v=function(){function e(e,t){var r,n,i=0;for(r=0;r<8;r++)1&t&&(i^=e),n=128&e,e=e<<1&255,n&&(e^=195),t>>=1;return 255&i}for(var t=[1,16,32,133,148,192,194,251],r=[],n=0;n<8;n++){r[n]=[];for(var i=0;i<256;i++)r[n][i]=e(t[n],i)}return r}(),m=[4,2,3,1,6,5,0,7,0,5,6,1,3,2,4,0];function b(e){for(var t=0,r=0;r<16;r++)t^=v[m[r]][e[r]];for(r=16;r>0;--r)e[r]=e[r-1];e[0]=t}function w(e){for(var t=e[0],r=0;r<15;r++)e[r]=e[r+1];e[15]=t;var n=0;for(r=0;r<16;r++)n^=v[m[r]][e[r]];e[15]=n}var S=[252,238,221,17,207,110,49,22,251,196,250,218,35,197,4,77,233,119,240,219,147,46,153,186,23,54,241,187,20,205,95,193,249,24,101,90,226,92,239,33,129,28,60,66,139,1,142,79,5,132,2,174,227,106,143,160,6,11,237,152,127,212,211,31,235,52,44,81,234,200,72,171,242,42,104,162,253,58,206,204,181,112,14,86,8,12,118,18,191,114,19,71,156,183,93,135,21,161,150,41,16,123,154,199,243,145,120,111,157,158,178,177,50,117,25,61,255,53,138,126,109,84,198,128,195,189,13,87,223,245,36,169,62,168,67,201,215,121,214,246,124,34,185,3,224,15,236,222,122,148,176,188,220,232,40,80,78,51,10,74,167,151,96,115,30,0,98,68,26,184,56,130,100,159,38,65,173,69,70,146,39,94,85,47,140,163,165,125,105,213,149,59,7,88,179,64,134,172,29,247,48,55,107,228,136,217,231,137,225,27,131,73,76,63,248,254,141,83,170,144,202,216,133,97,32,113,103,164,45,43,9,91,203,155,37,208,190,229,108,82,89,166,116,210,230,244,180,192,209,102,175,194,57,75,99,182],E=function(){for(var e=[],t=0,r=S.length;t<r;t++)e[S[t]]=t;return e}();function C(e,t){for(var r=0;r<16;++r)e[r]^=t[r]}function A(e){for(var t=0;t<16;++t)b(e)}function B(e,t){C(e,t),function(e){for(var t=0;t<16;++t)e[t]=S[e[t]]}(e),A(e)}function x(e,t){for(var r=0;r<15;r++)t[r]=0;t[15]=e,A(t)}function T(e){var t,r,n,i,a=new Uint8Array(160),s=new Uint8Array(16);a.set(d(e));for(var o=0;o<4;o++){var c=32*o,u=32*(o+1);a.set(new Uint8Array(a.buffer,c,32),u);for(var f=1;f<9;f++)x(8*o+f,s),t=new Uint8Array(a.buffer,u,16),r=new Uint8Array(a.buffer,u+16,16),n=s,void 0,i=new Uint8Array(t),B(t,n),C(t,r),r.set(i)}return a}function I(e,t,r,n){r=r||t.byteOffset;var i,a,s=new Uint8Array(t.buffer,r,16);if(n){for(var o=0;o<9;o++)i=s,a=new Uint8Array(e.buffer,16*(9-o),16),C(i,a),function(e){for(var t=0;t<16;++t)w(e)}(i),function(e){for(var t=0;t<16;++t)e[t]=E[e[t]]}(i);C(s,new Uint8Array(e.buffer,0,16))}else{for(o=0;o<9;o++)B(s,new Uint8Array(e.buffer,16*o,16));C(s,new Uint8Array(e.buffer,144,16))}}function F(e,t,r){var n=t[0]+r&4294967295,i=0|e[0+(15&n)];i|=e[16+(n>>4&15)]<<4,i|=e[32+(n>>8&15)]<<8,i|=e[48+(n>>12&15)]<<12,i|=e[64+(n>>16&15)]<<16,i|=e[80+(n>>20&15)]<<20,i|=e[96+(n>>24&15)]<<24,n=(i|=e[112+(n>>28&15)]<<28)<<11|i>>>21,n^=t[1],t[1]=t[0],t[0]=n}function k(e,t,r){r=r||t.byteOffset;for(var n=this.sBox,i=new Int32Array(t.buffer,r,2),a=0;a<32;a++)F(n,i,e[a]);var s=i[0];i[0]=i[1],i[1]=s}function R(e,t,r){r=r||t.byteOffset;var n=this.sBox,i=new Int32Array(t.buffer,r,2),a=g(i[0]);i[0]=g(i[1]),i[1]=a;for(var s=0;s<32;s++)F(n,i,e[s]);i[0]=g(i[0]),i[1]=g(i[1])}function D(e,t){for(var r=new Int32Array(32),n=new Int32Array(l(e)),i=0;i<8;i++)r[i]=n[i];if(t){for(i=0;i<8;i++)r[i+8]=r[7-i];for(i=0;i<8;i++)r[i+16]=r[7-i]}else{for(i=0;i<8;i++)r[i+8]=r[i];for(i=0;i<8;i++)r[i+16]=r[i]}for(i=0;i<8;i++)r[i+24]=r[7-i];return r}function _(e,t){for(var r=new Int32Array(32),n=new Int32Array(l(e)),i=0;i<8;i++)r[i]=g(n[i]);if(t){for(i=0;i<8;i++)r[i+8]=r[7-i];for(i=0;i<8;i++)r[i+16]=r[7-i]}else{for(i=0;i<8;i++)r[i+8]=r[i];for(i=0;i<8;i++)r[i+16]=r[i]}for(i=0;i<8;i++)r[i+24]=r[7-i];return r}var P,N=(P=new Uint8Array([217,120,249,196,25,221,181,237,40,233,253,121,74,160,216,157,198,126,55,131,43,118,83,142,98,76,100,136,68,139,251,162,23,154,89,245,135,179,79,19,97,69,109,141,9,129,125,50,189,143,64,235,134,183,123,11,240,149,33,34,92,107,78,130,84,214,101,147,206,96,178,28,115,86,192,20,167,140,241,220,18,117,202,31,59,190,228,209,66,61,212,48,163,60,182,38,111,191,14,218,70,105,7,87,39,242,29,155,188,148,67,3,248,17,199,246,144,239,62,231,6,195,213,47,200,102,30,215,8,232,234,222,128,82,238,247,132,170,114,172,53,77,106,42,150,26,210,113,90,21,73,116,75,159,208,94,4,24,164,236,194,224,65,110,15,81,203,204,36,145,175,80,161,244,112,57,153,124,58,133,35,184,180,122,252,2,54,91,37,85,151,49,45,93,250,152,227,138,146,174,5,223,41,16,103,108,186,201,211,0,230,207,225,158,168,44,99,22,1,63,88,226,137,169,13,56,52,27,171,51,255,176,187,72,12,95,185,177,205,46,197,243,219,71,229,165,156,119,10,166,32,104,254,127,193,173]),function(e){for(var t=new Uint8Array(l(e)),r=Math.min(t.length,128),n=this.effectiveLength,i=Math.floor((n+7)/8),a=255%Math.pow(2,8+n-8*i),s=new Uint8Array(128),o=new Uint16Array(s.buffer),c=0;c<r;c++)s[c]=t[c];for(c=r;c<128;c++)s[c]=P[(s[c-1]+s[c-r])%256];for(s[128-i]=P[s[128-i]&a],c=127-i;c>=0;--c)s[c]=P[s[c+1]^s[c+i]];return o}),O=function(){var e,t,r,n=new Uint16Array(4),i=new Uint16Array([1,2,3,5]);function a(a){r?(n[a]=function(e,t){return 65535&(e>>>t|e<<16-t)}(n[a],i[a]),n[a]=n[a]-e[t]-(n[(a+3)%4]&n[(a+2)%4])-(~n[(a+3)%4]&n[(a+1)%4]),t-=1):(n[a]=n[a]+e[t]+(n[(a+3)%4]&n[(a+2)%4])+(~n[(a+3)%4]&n[(a+1)%4]),t+=1,n[a]=function(e,t){return 65535&(e<<t|e>>>16-t)}(n[a],i[a]))}function s(t){n[t]=r?n[t]-e[63&n[(t+3)%4]]:n[t]+e[63&n[(t+3)%4]]}function o(e,t){t=t||1;for(var n=0;n<t;n++)if(r)for(var i=3;i>=0;--i)e(i);else for(i=0;i<4;i++)e(i)}return function(i,c,u,f){r=f,n=new Uint16Array(c.buffer,u||c.byteOffset,4),e=i,t=f?63:0,o(a,5),o(s),o(a,6),o(s),o(a,5)}}();function L(e,t){for(var r=this.pad(d(t)),n=this.blockSize,i=r.byteLength/n,a=this.keySchedule(e),s=0;s<i;s++)this.process(a,r,n*s);return r.buffer}function U(e,t){for(var r=p(t),n=this.blockSize,i=r.byteLength/n,a=this.keySchedule(e,1),s=0;s<i;s++)this.process(a,r,n*s,1);return this.unpad(r).buffer}function K(e,t,r){for(var n=new Uint8Array(r||this.iv),i=p(t),a=n.length,s=new Uint8Array(a),o=this.shiftBits>>3,c=i.length,u=c%o,f=(c-u)/o,h=this.keySchedule(e),l=0;l<f;l++){for(var d=0;d<a;d++)s[d]=n[d];for(this.process(h,n),d=0;d<o;d++)i[l*o+d]^=n[d];for(d=0;d<a-o;d++)n[d]=s[o+d];for(d=0;d<o;d++)n[a-o+d]=i[l*o+d];e=this.keyMeshing(e,n,l,h)}if(u>0)for(this.process(h,n),l=0;l<u;l++)i[f*o+l]^=n[l];return i.buffer}function M(e,t,r){for(var n=new Uint8Array(r||this.iv),i=p(t),a=n.length,s=new Uint8Array(a),o=this.shiftBits>>3,c=i.length,u=c%o,f=(c-u)/o,h=this.keySchedule(e),l=0;l<f;l++){for(var d=0;d<a;d++)s[d]=n[d];for(this.process(h,n),d=0;d<o;d++)s[d]=i[l*o+d],i[l*o+d]^=n[d];for(d=0;d<a-o;d++)n[d]=s[o+d];for(d=0;d<o;d++)n[a-o+d]=s[d];e=this.keyMeshing(e,n,l,h)}if(u>0)for(this.process(h,n),l=0;l<u;l++)i[f*o+l]^=n[l];return i.buffer}function H(e,t,r){for(var n=new Uint8Array(r||this.iv),i=p(t),a=n.length,s=new Uint8Array(a),o=this.shiftBits>>3,c=new Uint8Array(o),u=i.length,f=u%o,h=(u-f)/o,l=this.keySchedule(e),d=0;d<h;d++){for(var g=0;g<a;g++)s[g]=n[g];for(this.process(l,n),g=0;g<o;g++)c[g]=n[g];for(g=0;g<o;g++)i[d*o+g]^=n[g];for(g=0;g<a-o;g++)n[g]=s[o+g];for(g=0;g<o;g++)n[a-o+g]=c[g];e=this.keyMeshing(e,n,d,l)}if(f>0)for(this.process(l,n),d=0;d<f;d++)i[h*o+d]^=n[d];return i.buffer}function j(e,t,r){var n=new Uint8Array(r||this.iv),i=p(t),a=this.blockSize,s=new Int8Array(a),o=i.length,c=o%a,u=(o-c)/a,l=this.keySchedule(e),d=new Int32Array(n.buffer);this.process(l,n);for(var g=0;g<u;g++){d[0]=d[0]+16843009&4294967295;var y=h(d[1])+16843012;d[1]=f(y<4294967296?y:y-4294967295);for(var v=0;v<a;v++)s[v]=n[v];for(this.process(l,d),v=0;v<a;v++)i[g*a+v]^=n[v];for(v=0;v<a;v++)n[v]=s[v];e=this.keyMeshing(e,n,g,l)}if(c>0)for(d[0]=d[0]+16843009&4294967295,y=h(d[1])+16843012,d[1]=f(y<4294967296?y:y-4294967295),this.process(l,d),g=0;g<c;g++)i[u*a+g]^=n[g];return i.buffer}function V(e,t,r){var n=p(t),i=this.blockSize,a=this.shiftBits>>3,s=n.length,o=s%a,c=(s-o)/a,u=new Uint8Array(i),f=new Int32Array(i),h=this.keySchedule(e);u.set(r||this.iv);for(var l=0;l<c;l++){for(var d=0;d<i;d++)f[d]=u[d];for(this.process(h,u),d=0;d<a;d++)n[a*l+d]^=u[d];for(d=0;d<i;d++)u[d]=f[d];for(d=i-1;l>=0;--l){if(!(u[d]>254)){u[d]++;break}u[d]-=254}}if(o>0)for(this.process(h,u),d=0;d<o;d++)n[a*c+d]^=u[d];return n.buffer}function G(e,t,r){for(var n=new Uint8Array(r||this.iv),i=this.blockSize,a=n.length,s=this.pad(d(t)),o=this.keySchedule(e),c=0,u=s.length/i;c<u;c++){for(var f=0;f<i;f++)n[f]^=s[c*i+f];for(this.process(o,n),f=0;f<i;f++)s[c*i+f]=n[f];if(a!==i){for(f=0;f<a-i;f++)n[f]=n[i+f];for(f=0;f<i;f++)n[f+a-i]=s[c*i+f]}e=this.keyMeshing(e,n,c,o)}return s.buffer}function q(e,t,r){for(var n=new Uint8Array(r||this.iv),i=this.blockSize,a=n.length,s=p(t),o=new Uint8Array(i),c=this.keySchedule(e,1),u=0,f=s.length/i;u<f;u++){for(var h=0;h<i;h++)o[h]=s[u*i+h];for(this.process(c,s,u*i,1),h=0;h<i;h++)s[u*i+h]^=n[h];if(a!==i)for(h=0;h<a-i;h++)n[h]=n[i+h];for(h=0;h<i;h++)n[h+a-i]=o[h];e=this.keyMeshing(e,n,u,c,1)}return this.unpad(s).buffer}function z(){var e=new Uint8Array(this.keySize);return(0,i.randomSeed)(e),e.buffer}function W(e,t,r){for(var n=ye.call(this,d(r)),i=this.blockSize,a=n.length/i,s=this.sBox,o=new Int32Array(t.buffer),c=0;c<a;c++){for(var u=0;u<i;u++)t[u]^=n[c*i+u];for(u=0;u<16;u++)F(s,o,e[u])}}function X(e){for(var t=0,r=e.length,n=r-1;n>=0;--n){var i=e[n]>>>7;e[n]=e[n]<<1&255|t,t=i}0!==t&&(16===r?e[15]^=135:e[7]^=27)}function Y(e,t,r){var n=this.blockSize,i=(this.sBox,d(r)),a=new Uint8Array(n);this.process(e,a),X(a),r.byteLength%n!=0&&(i=ve.call(this,d(r)),X(a));for(var s=0,o=i.length/n;s<o;s++){for(var c=0;c<n;c++)t[c]^=i[s*n+c];if(s===o-1)for(c=0;c<n;c++)t[c]^=a[c];this.process(e,t)}}function J(e,t,r){var n=this.keySchedule(e),i=new Uint8Array(r||this.iv),a=Math.ceil(this.macLength>>3)||this.blockSize>>1;this.processMAC(n,i,t);var s=new Uint8Array(a);return s.set(new Uint8Array(i.buffer,0,a)),s.buffer}function Q(e,t,r,n){var i=new Uint8Array(J.call(this,e,r,n)),a=d(t);if(i.length!==a.length)return!1;for(var s=0,o=i.length;s<o;s++)if(i[s]!==a[s])return!1;return!0}function Z(e,t){var r=this.blockSize,i=this.keySize,a=i+(r>>1);if(!this.ukm)throw new n.DataError("UKM must be defined");var s=new Uint8Array(this.ukm),o=J.call(this,e,t,s),c=L.call(this,e,t),u=new Uint8Array(a);return u.set(new Uint8Array(c),0),u.set(new Uint8Array(o),i),u.buffer}function $(e,t){var r=this.blockSize,i=this.keySize,a=i+(r>>1),s=l(t);if(s.byteLength!==a)throw new n.DataError("Wrapping key size must be "+a+" bytes");if(!this.ukm)throw new n.DataError("UKM must be defined");var o=new Uint8Array(this.ukm),c=new Uint8Array(s,0,i),u=new Uint8Array(s,i,r>>1),f=U.call(this,e,c);if(!Q.call(this,e,u,f,o))throw new n.DataError("Error verify MAC of wrapping key");return f}function ee(e,t){for(var r=this.blockSize,n=new Int32Array(l(e)),i=[],a=0;a<r;a++){i[a]=[];for(var s=0;s<8;s++)i[a][s]=t[a]>>>s&1}for(a=0;a<r;a++){var o=new Int32Array(2);for(s=0;s<8;s++)i[a][s]?o[0]=o[0]+n[s]&4294967295:o[1]=o[1]+n[s]&4294967295;var c=new Uint8Array(o.buffer);n=new Int32Array(K.call(this,n,n,c))}return n}function te(e,t){var r=this.blockSize,i=this.keySize,a=i+(r>>1);if(!this.ukm)throw new n.DataError("UKM must be defined");var s=new Uint8Array(this.ukm),o=ee.call(this,e,s),c=J.call(this,o,t,s),u=L.call(this,o,t),f=new Uint8Array(a);return f.set(new Uint8Array(u),0),f.set(new Uint8Array(c),i),f.buffer}function re(e,t){var r=this.blockSize,i=this.keySize,a=i+(r>>1),s=l(t);if(s.byteLength!==a)throw new n.DataError("Wrapping key size must be "+a+" bytes");if(!this.ukm)throw new n.DataError("UKM must be defined");var o=new Uint8Array(this.ukm),c=new Uint8Array(s,0,i),u=new Uint8Array(s,i,r>>1),f=ee.call(this,e,o),h=U.call(this,f,c);if(!Q.call(this,f,u,h,o))throw new n.DataError("Error verify MAC of wrapping key");return h}function ne(e,t){var r=this.blockSize>>1,a=this.keySize,s=8,o=new Uint8Array(l(e));if(o.byteLength!==a)throw new n.DataError("Wrong cleartext size "+o.byteLength+" bytes");if(t=t||this.ukm){if(!((t=new Uint8Array(l(t))).byteLength>0&&t.byteLength%a==0))throw new n.DataError("Wrong rand size "+t.byteLength+" bytes");s=t.byteLength/a+1}else(0,i.randomSeed)(t=new Uint8Array((s-1)*a));var c=new Uint8Array(s*a+r+2),u=c.buffer,f=new Uint8Array(a),h=J.call(this,o,f);c[0]=34,c[1]=s,c.set(new Uint8Array(h),2),c.set(t,a+r+2);for(var d=1;d<s;d++)for(var p=new Uint8Array(u,2+r+a*d),g=0;g<a;g++)o[g]^=p[g];return c.set(o,r+2),c.buffer}function ie(e){var t=this.blockSize>>1,r=this.keySize,i=l(e);if(34!==new Uint8Array(i,0,1)[0])throw new n.DataError("Invalid magic number");for(var a=new Uint8Array(i,1,1)[0],s=new Uint8Array(i,2,t),o=new Uint8Array(r),u=0;u<a;u++)for(var f=new Uint8Array(i,2+t+r*u,r),h=0;h<r;h++)o[h]^=f[h];var d=new Uint8Array(r),p=Q.call(this,o,s,d);if(!p)for(var g=["E-A","E-B","E-C","E-D","E-SC"],y=(u=0,g.length);u<y&&(this.sBox=c[g[u]],!(p=Q.call(this,o,s,d)));u++);if(!p)throw new n.DataError("Invalid main key MAC");return o.buffer}function ae(e,t){var r=this.blockSize>>1,n=this.keySize,i=l(e),a=l(t);i.byteLength!==n&&(i=ie.call(this,i));var s=L.call(this,i,a),o=J.call(this,i,a),c=new Uint8Array(r+n);return c.set(new Uint8Array(s),0),c.set(new Uint8Array(o),n),c.buffer}function se(e,t){var r=this.blockSize>>1,i=this.keySize,a=l(e),s=l(t);a.byteLength!==i&&(a=ie.call(this,a));var o=new Uint8Array(s,0,i),c=new Uint8Array(s,i,r),u=U.call(this,a,o);if(!Q.call(this,a,c,u))throw new n.DataError("Invalid key MAC");return u}function oe(){return ne.call(this,z.call(this))}function ce(e,t,r,n){var i=n/4,a=new Int32Array(l(e)),s=new Int32Array(l(t)),o=new Int32Array(i);if(r)for(var c=0;c<i;c++)o[c]=s[c]+a[c]&4294967295;else for(c=0;c<i;c++)o[c]=s[c]-a[c]&4294967295;return o.buffer}function ue(e,t){return ce(e,t,"VN"===this.procreator,this.keySize)}function fe(e,t){return ce(e,t,"VN"!==this.procreator,this.keySize)}function he(e,t,r,n,i){return(r+1)*this.blockSize%1024==0&&(e=U.call(this,e,u),t.set(new Uint8Array(L.call(this,e,t))),n.set(this.keySchedule(e,i))),e}function le(e){return e}function de(e){return new Uint8Array(e)}function pe(e){var t=e.byteLength,r=this.blockSize,n=r-t%r,i=Math.ceil((t+1)/r)*r,a=new Uint8Array(i);a.set(e);for(var s=t;s<i;s++)a[s]=n;return a}function ge(e){var t=e.byteLength,r=this.blockSize,i=e[t-1],a=t-i;if(i>r)throw(0,n.DataError)("Invalid padding");var s=new Uint8Array(a);return a>0&&s.set(new Uint8Array(e.buffer,0,a)),s}function ye(e){var t=e.byteLength,r=this.blockSize,n=Math.ceil(t/r)*r,i=new Uint8Array(n);i.set(e);for(var a=t;a<n;a++)i[a]=0;return i}function ve(e){var t=e.byteLength,r=this.blockSize,n=Math.ceil((t+1)/r)*r,i=new Uint8Array(n);i.set(e),i[t]=1;for(var a=t+1;a<n;a++)i[a]=0;return i}function me(e){for(var t=e.byteLength;t>1&&0===e[t-1];)t--;if(1!==e[t-1])throw(0,n.DataError)("Invalid padding");t--;var r=new Uint8Array(t);return t>0&&r.set(new Uint8Array(e.buffer,0,t)),r}function be(e){var t=e.byteLength,r=this.blockSize,n=r-t%r,a=Math.ceil(t/r)*r,s=new Uint8Array(a),o=new Uint8Array(s.buffer,t,n);return s.set(e),(0,i.randomSeed)(o),s}},function(e,t,r){(function(t){var n=r(3);e.exports=function(e,r){return new t(e.toRed(n.mont(r.modulus)).redPow(new n(r.publicExponent)).fromRed().toArray())}}).call(this,r(2).Buffer)},function(e,t){e.exports=function(e,t){for(var r=e.length,n=-1;++n<r;)e[n]^=t[n];return e}},function(e,t,r){(function(t){var n=r(18);function i(e){var r=new t(4);return r.writeUInt32BE(e,0),r}e.exports=function(e,r){for(var a,s=new t(""),o=0;s.length<r;)a=i(o++),s=t.concat([s,n("sha1").update(e).update(a).digest()]);return s.slice(0,r)}}).call(this,r(2).Buffer)},function(e){e.exports={"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"}},function(e,t,r){var n=r(0),i=r(2).Buffer,a=r(14),s=a.base,o=a.constants.der;function c(e){this.enc="der",this.name=e.name,this.entity=e,this.tree=new u,this.tree._init(e.body)}function u(e){s.Node.call(this,"der",e)}function f(e){return e<10?"0"+e:e}e.exports=c,c.prototype.encode=function(e,t){return this.tree._encode(e,t).join()},n(u,s.Node),u.prototype._encodeComposite=function(e,t,r,n){var a,s=function(e,t,r,n){var i;if("seqof"===e?e="seq":"setof"===e&&(e="set"),o.tagByName.hasOwnProperty(e))i=o.tagByName[e];else{if("number"!=typeof e||(0|e)!==e)return n.error("Unknown tag: "+e);i=e}return i>=31?n.error("Multi-octet tag encoding unsupported"):(t||(i|=32),i|=o.tagClassByName[r||"universal"]<<6)}(e,t,r,this.reporter);if(n.length<128)return(a=new i(2))[0]=s,a[1]=n.length,this._createEncoderBuffer([a,n]);for(var c=1,u=n.length;u>=256;u>>=8)c++;(a=new i(2+c))[0]=s,a[1]=128|c,u=1+c;for(var f=n.length;f>0;u--,f>>=8)a[u]=255&f;return this._createEncoderBuffer([a,n])},u.prototype._encodeStr=function(e,t){if("bitstr"===t)return this._createEncoderBuffer([0|e.unused,e.data]);if("bmpstr"===t){for(var r=new i(2*e.length),n=0;n<e.length;n++)r.writeUInt16BE(e.charCodeAt(n),2*n);return this._createEncoderBuffer(r)}return"numstr"===t?this._isNumstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: numstr supports only digits and space"):"printstr"===t?this._isPrintstr(e)?this._createEncoderBuffer(e):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(t)||"objDesc"===t?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: "+t+" unsupported")},u.prototype._encodeObjid=function(e,t,r){if("string"==typeof e){if(!t)return this.reporter.error("string objid given, but no values map found");if(!t.hasOwnProperty(e))return this.reporter.error("objid not found in values map");e=t[e].split(/[\s\.]+/g);for(var n=0;n<e.length;n++)e[n]|=0}else if(Array.isArray(e))for(e=e.slice(),n=0;n<e.length;n++)e[n]|=0;if(!Array.isArray(e))return this.reporter.error("objid() should be either array or string, got: "+JSON.stringify(e));if(!r){if(e[1]>=40)return this.reporter.error("Second objid identifier OOB");e.splice(0,2,40*e[0]+e[1])}var a=0;for(n=0;n<e.length;n++){var s=e[n];for(a++;s>=128;s>>=7)a++}var o=new i(a),c=o.length-1;for(n=e.length-1;n>=0;n--)for(s=e[n],o[c--]=127&s;(s>>=7)>0;)o[c--]=128|127&s;return this._createEncoderBuffer(o)},u.prototype._encodeTime=function(e,t){var r,n=new Date(e);return"gentime"===t?r=[f(n.getFullYear()),f(n.getUTCMonth()+1),f(n.getUTCDate()),f(n.getUTCHours()),f(n.getUTCMinutes()),f(n.getUTCSeconds()),"Z"].join(""):"utctime"===t?r=[f(n.getFullYear()%100),f(n.getUTCMonth()+1),f(n.getUTCDate()),f(n.getUTCHours()),f(n.getUTCMinutes()),f(n.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+t+" time is not supported yet"),this._encodeStr(r,"octstr")},u.prototype._encodeNull=function(){return this._createEncoderBuffer("")},u.prototype._encodeInt=function(e,t){if("string"==typeof e){if(!t)return this.reporter.error("String int or enum given, but no values map");if(!t.hasOwnProperty(e))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(e));e=t[e]}if("number"!=typeof e&&!i.isBuffer(e)){var r=e.toArray();!e.sign&&128&r[0]&&r.unshift(0),e=new i(r)}if(i.isBuffer(e)){var n=e.length;0===e.length&&n++;var a=new i(n);return e.copy(a),0===e.length&&(a[0]=0),this._createEncoderBuffer(a)}if(e<128)return this._createEncoderBuffer(e);if(e<256)return this._createEncoderBuffer([0,e]);n=1;for(var s=e;s>=256;s>>=8)n++;for(s=(a=new Array(n)).length-1;s>=0;s--)a[s]=255&e,e>>=8;return 128&a[0]&&a.unshift(0),this._createEncoderBuffer(new i(a))},u.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)},u.prototype._use=function(e,t){return"function"==typeof e&&(e=e(t)),e._getEncoder("der").tree},u.prototype._skipDefault=function(e,t,r){var n,i=this._baseState;if(null===i.default)return!1;var a=e.join();if(void 0===i.defaultBuffer&&(i.defaultBuffer=this._encodeValue(i.default,t,r).join()),a.length!==i.defaultBuffer.length)return!1;for(n=0;n<a.length;n++)if(a[n]!==i.defaultBuffer[n])return!1;return!0}},function(e,t,r){var n=r(0),i=r(14),a=i.base,s=i.bignum,o=i.constants.der;function c(e){this.enc="der",this.name=e.name,this.entity=e,this.tree=new u,this.tree._init(e.body)}function u(e){a.Node.call(this,"der",e)}function f(e,t){var r=e.readUInt8(t);if(e.isError(r))return r;var n=o.tagClass[r>>6],i=!(32&r);if(31&~r)r&=31;else{var a=r;for(r=0;!(128&~a);){if(a=e.readUInt8(t),e.isError(a))return a;r<<=7,r|=127&a}}return{cls:n,primitive:i,tag:r,tagStr:o.tag[r]}}function h(e,t,r){var n=e.readUInt8(r);if(e.isError(n))return n;if(!t&&128===n)return null;if(!(128&n))return n;var i=127&n;if(i>4)return e.error("length octect is too long");n=0;for(var a=0;a<i;a++){n<<=8;var s=e.readUInt8(r);if(e.isError(s))return s;n|=s}return n}e.exports=c,c.prototype.decode=function(e,t){return e instanceof a.DecoderBuffer||(e=new a.DecoderBuffer(e,t)),this.tree._decode(e,t)},n(u,a.Node),u.prototype._peekTag=function(e,t,r){if(e.isEmpty())return!1;var n=e.save(),i=f(e,'Failed to peek tag: "'+t+'"');return e.isError(i)?i:(e.restore(n),i.tag===t||i.tagStr===t||i.tagStr+"of"===t||r)},u.prototype._decodeTag=function(e,t,r){var n=f(e,'Failed to decode tag of "'+t+'"');if(e.isError(n))return n;var i=h(e,n.primitive,'Failed to get length of "'+t+'"');if(e.isError(i))return i;if(!r&&n.tag!==t&&n.tagStr!==t&&n.tagStr+"of"!==t)return e.error('Failed to match tag: "'+t+'"');if(n.primitive||null!==i)return e.skip(i,'Failed to match body of: "'+t+'"');var a=e.save(),s=this._skipUntilEnd(e,'Failed to skip indefinite length body: "'+this.tag+'"');return e.isError(s)?s:(i=e.offset-a.offset,e.restore(a),e.skip(i,'Failed to match body of: "'+t+'"'))},u.prototype._skipUntilEnd=function(e,t){for(;;){var r=f(e,t);if(e.isError(r))return r;var n,i=h(e,r.primitive,t);if(e.isError(i))return i;if(n=r.primitive||null!==i?e.skip(i):this._skipUntilEnd(e,t),e.isError(n))return n;if("end"===r.tagStr)break}},u.prototype._decodeList=function(e,t,r,n){for(var i=[];!e.isEmpty();){var a=this._peekTag(e,"end");if(e.isError(a))return a;var s=r.decode(e,"der",n);if(e.isError(s)&&a)break;i.push(s)}return i},u.prototype._decodeStr=function(e,t){if("bitstr"===t){var r=e.readUInt8();return e.isError(r)?r:{unused:r,data:e.raw()}}if("bmpstr"===t){var n=e.raw();if(n.length%2==1)return e.error("Decoding of string type: bmpstr length mismatch");for(var i="",a=0;a<n.length/2;a++)i+=String.fromCharCode(n.readUInt16BE(2*a));return i}if("numstr"===t){var s=e.raw().toString("ascii");return this._isNumstr(s)?s:e.error("Decoding of string type: numstr unsupported characters")}if("octstr"===t)return e.raw();if("objDesc"===t)return e.raw();if("printstr"===t){var o=e.raw().toString("ascii");return this._isPrintstr(o)?o:e.error("Decoding of string type: printstr unsupported characters")}return/str$/.test(t)?e.raw().toString():e.error("Decoding of string type: "+t+" unsupported")},u.prototype._decodeObjid=function(e,t,r){for(var n,i=[],a=0;!e.isEmpty();){var s=e.readUInt8();a<<=7,a|=127&s,128&s||(i.push(a),a=0)}128&s&&i.push(a);var o=i[0]/40|0,c=i[0]%40;if(n=r?i:[o,c].concat(i.slice(1)),t){var u=t[n.join(" ")];void 0===u&&(u=t[n.join(".")]),void 0!==u&&(n=u)}return n},u.prototype._decodeTime=function(e,t){var r=e.raw().toString();if("gentime"===t)var n=0|r.slice(0,4),i=0|r.slice(4,6),a=0|r.slice(6,8),s=0|r.slice(8,10),o=0|r.slice(10,12),c=0|r.slice(12,14);else{if("utctime"!==t)return e.error("Decoding "+t+" time is not supported yet");n=0|r.slice(0,2),i=0|r.slice(2,4),a=0|r.slice(4,6),s=0|r.slice(6,8),o=0|r.slice(8,10),c=0|r.slice(10,12),n=n<70?2e3+n:1900+n}return Date.UTC(n,i-1,a,s,o,c,0)},u.prototype._decodeNull=function(e){return null},u.prototype._decodeBool=function(e){var t=e.readUInt8();return e.isError(t)?t:0!==t},u.prototype._decodeInt=function(e,t){var r=e.raw(),n=new s(r);return t&&(n=t[n.toString(10)]||n),n},u.prototype._use=function(e,t){return"function"==typeof e&&(e=e(t)),e._getDecoder("der").tree}},function(e,t,r){var n=t;n._reverse=function(e){var t={};return Object.keys(e).forEach((function(r){(0|r)==r&&(r|=0);var n=e[r];t[n]=r})),t},n.der=r(97)},function(e,t,r){var n=r(0),i=r(13).Reporter,a=r(2).Buffer;function s(e,t){i.call(this,t),a.isBuffer(e)?(this.base=e,this.offset=0,this.length=e.length):this.error("Input not Buffer")}function o(e,t){if(Array.isArray(e))this.length=0,this.value=e.map((function(e){return e instanceof o||(e=new o(e,t)),this.length+=e.length,e}),this);else if("number"==typeof e){if(!(0<=e&&e<=255))return t.error("non-byte EncoderBuffer value");this.value=e,this.length=1}else if("string"==typeof e)this.value=e,this.length=a.byteLength(e);else{if(!a.isBuffer(e))return t.error("Unsupported type: "+typeof e);this.value=e,this.length=e.length}}n(s,i),t.DecoderBuffer=s,s.prototype.save=function(){return{offset:this.offset,reporter:i.prototype.save.call(this)}},s.prototype.restore=function(e){var t=new s(this.base);return t.offset=e.offset,t.length=this.offset,this.offset=e.offset,i.prototype.restore.call(this,e.reporter),t},s.prototype.isEmpty=function(){return this.offset===this.length},s.prototype.readUInt8=function(e){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(e||"DecoderBuffer overrun")},s.prototype.skip=function(e,t){if(!(this.offset+e<=this.length))return this.error(t||"DecoderBuffer overrun");var r=new s(this.base);return r._reporterState=this._reporterState,r.offset=this.offset,r.length=this.offset+e,this.offset+=e,r},s.prototype.raw=function(e){return this.base.slice(e?e.offset:this.offset,this.length)},t.EncoderBuffer=o,o.prototype.join=function(e,t){return e||(e=new a(this.length)),t||(t=0),0===this.length||(Array.isArray(this.value)?this.value.forEach((function(r){r.join(e,t),t+=r.length})):("number"==typeof this.value?e[t]=this.value:"string"==typeof this.value?e.write(this.value,t):a.isBuffer(this.value)&&this.value.copy(e,t),t+=this.length)),e}},function(e,t,r){"use strict";var n=r(6),i=r(15),a=r(5),s=n.rotr64_hi,o=n.rotr64_lo,c=n.shr64_hi,u=n.shr64_lo,f=n.sum64,h=n.sum64_hi,l=n.sum64_lo,d=n.sum64_4_hi,p=n.sum64_4_lo,g=n.sum64_5_hi,y=n.sum64_5_lo,v=i.BlockHash,m=[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 b(){if(!(this instanceof b))return new b;v.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=m,this.W=new Array(160)}function w(e,t,r,n,i){var a=e&r^~e&i;return a<0&&(a+=4294967296),a}function S(e,t,r,n,i,a){var s=t&n^~t&a;return s<0&&(s+=4294967296),s}function E(e,t,r,n,i){var a=e&r^e&i^r&i;return a<0&&(a+=4294967296),a}function C(e,t,r,n,i,a){var s=t&n^t&a^n&a;return s<0&&(s+=4294967296),s}function A(e,t){var r=s(e,t,28)^s(t,e,2)^s(t,e,7);return r<0&&(r+=4294967296),r}function B(e,t){var r=o(e,t,28)^o(t,e,2)^o(t,e,7);return r<0&&(r+=4294967296),r}function x(e,t){var r=o(e,t,14)^o(e,t,18)^o(t,e,9);return r<0&&(r+=4294967296),r}function T(e,t){var r=s(e,t,1)^s(e,t,8)^c(e,t,7);return r<0&&(r+=4294967296),r}function I(e,t){var r=o(e,t,1)^o(e,t,8)^u(e,t,7);return r<0&&(r+=4294967296),r}function F(e,t){var r=o(e,t,19)^o(t,e,29)^u(e,t,6);return r<0&&(r+=4294967296),r}n.inherits(b,v),e.exports=b,b.blockSize=1024,b.outSize=512,b.hmacStrength=192,b.padLength=128,b.prototype._prepareBlock=function(e,t){for(var r=this.W,n=0;n<32;n++)r[n]=e[t+n];for(;n<r.length;n+=2){var i=(y=r[n-4],v=r[n-3],m=void 0,(m=s(y,v,19)^s(v,y,29)^c(y,v,6))<0&&(m+=4294967296),m),a=F(r[n-4],r[n-3]),o=r[n-14],u=r[n-13],f=T(r[n-30],r[n-29]),h=I(r[n-30],r[n-29]),l=r[n-32],g=r[n-31];r[n]=d(i,a,o,u,f,h,l,g),r[n+1]=p(i,a,o,u,f,h,l,g)}var y,v,m},b.prototype._update=function(e,t){this._prepareBlock(e,t);var r,n,i,o=this.W,c=this.h[0],u=this.h[1],d=this.h[2],p=this.h[3],v=this.h[4],m=this.h[5],b=this.h[6],T=this.h[7],I=this.h[8],F=this.h[9],k=this.h[10],R=this.h[11],D=this.h[12],_=this.h[13],P=this.h[14],N=this.h[15];a(this.k.length===o.length);for(var O=0;O<o.length;O+=2){var L=P,U=N,K=(i=void 0,(i=s(r=I,n=F,14)^s(r,n,18)^s(n,r,9))<0&&(i+=4294967296),i),M=x(I,F),H=w(I,0,k,0,D),j=S(0,F,0,R,0,_),V=this.k[O],G=this.k[O+1],q=o[O],z=o[O+1],W=g(L,U,K,M,H,j,V,G,q,z),X=y(L,U,K,M,H,j,V,G,q,z);L=A(c,u),U=B(c,u),K=E(c,0,d,0,v),M=C(0,u,0,p,0,m);var Y=h(L,U,K,M),J=l(L,U,K,M);P=D,N=_,D=k,_=R,k=I,R=F,I=h(b,T,W,X),F=l(T,T,W,X),b=v,T=m,v=d,m=p,d=c,p=u,c=h(W,X,Y,J),u=l(W,X,Y,J)}f(this.h,0,c,u),f(this.h,2,d,p),f(this.h,4,v,m),f(this.h,6,b,T),f(this.h,8,I,F),f(this.h,10,k,R),f(this.h,12,D,_),f(this.h,14,P,N)},b.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},function(e,t,r){"use strict";var n=r(6),i=r(15),a=r(52),s=r(5),o=n.sum32,c=n.sum32_4,u=n.sum32_5,f=a.ch32,h=a.maj32,l=a.s0_256,d=a.s1_256,p=a.g0_256,g=a.g1_256,y=i.BlockHash,v=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function m(){if(!(this instanceof m))return new m;y.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=v,this.W=new Array(64)}n.inherits(m,y),e.exports=m,m.blockSize=512,m.outSize=256,m.hmacStrength=192,m.padLength=64,m.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n<r.length;n++)r[n]=c(g(r[n-2]),r[n-7],p(r[n-15]),r[n-16]);var i=this.h[0],a=this.h[1],y=this.h[2],v=this.h[3],m=this.h[4],b=this.h[5],w=this.h[6],S=this.h[7];for(s(this.k.length===r.length),n=0;n<r.length;n++){var E=u(S,d(m),f(m,b,w),this.k[n],r[n]),C=o(l(i),h(i,a,y));S=w,w=b,b=m,m=o(v,E),v=y,y=a,a=i,i=o(E,C)}this.h[0]=o(this.h[0],i),this.h[1]=o(this.h[1],a),this.h[2]=o(this.h[2],y),this.h[3]=o(this.h[3],v),this.h[4]=o(this.h[4],m),this.h[5]=o(this.h[5],b),this.h[6]=o(this.h[6],w),this.h[7]=o(this.h[7],S)},m.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},function(e,t,r){"use strict";var n=r(6).rotr32;function i(e,t,r){return e&t^~e&r}function a(e,t,r){return e&t^e&r^t&r}function s(e,t,r){return e^t^r}t.ft_1=function(e,t,r,n){return 0===e?i(t,r,n):1===e||3===e?s(t,r,n):2===e?a(t,r,n):void 0},t.ch32=i,t.maj32=a,t.p32=s,t.s0_256=function(e){return n(e,2)^n(e,13)^n(e,22)},t.s1_256=function(e){return n(e,6)^n(e,11)^n(e,25)},t.g0_256=function(e){return n(e,7)^n(e,18)^e>>>3},t.g1_256=function(e){return n(e,17)^n(e,19)^e>>>10}},function(e,t,r){"use strict";var n=t;function i(e){return 1===e.length?"0"+e:e}function a(e){for(var t="",r=0;r<e.length;r++)t+=i(e[r].toString(16));return t}n.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"!=typeof e){for(var n=0;n<e.length;n++)r[n]=0|e[n];return r}if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),n=0;n<e.length;n+=2)r.push(parseInt(e[n]+e[n+1],16));else for(n=0;n<e.length;n++){var i=e.charCodeAt(n),a=i>>8,s=255&i;a?r.push(a,s):r.push(s)}return r},n.zero2=i,n.toHex=a,n.encode=function(e,t){return"hex"===t?a(e):e}},function(e,t,r){var n;function i(e){this.rand=e}if(e.exports=function(e){return n||(n=new i(null)),n.generate(e)},e.exports.Rand=i,i.prototype.generate=function(e){return this._rand(e)},i.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),r=0;r<t.length;r++)t[r]=this.rand.getByte();return t},"object"==typeof self)self.crypto&&self.crypto.getRandomValues?i.prototype._rand=function(e){var t=new Uint8Array(e);return self.crypto.getRandomValues(t),t}:self.msCrypto&&self.msCrypto.getRandomValues?i.prototype._rand=function(e){var t=new Uint8Array(e);return self.msCrypto.getRandomValues(t),t}:"object"==typeof window&&(i.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var a=r(129);if("function"!=typeof a.randomBytes)throw new Error("Not supported");i.prototype._rand=function(e){return a.randomBytes(e)}}catch(e){}},function(e,t,r){var n=r(3),i=r(54);function a(e){this.rand=e||new i.Rand}e.exports=a,a.create=function(e){return new a(e)},a.prototype._randbelow=function(e){var t=e.bitLength(),r=Math.ceil(t/8);do{var i=new n(this.rand.generate(r))}while(i.cmp(e)>=0);return i},a.prototype._randrange=function(e,t){var r=t.sub(e);return e.add(this._randbelow(r))},a.prototype.test=function(e,t,r){var i=e.bitLength(),a=n.mont(e),s=new n(1).toRed(a);t||(t=Math.max(1,i/48|0));for(var o=e.subn(1),c=0;!o.testn(c);c++);for(var u=e.shrn(c),f=o.toRed(a);t>0;t--){var h=this._randrange(new n(2),o);r&&r(h);var l=h.toRed(a).redPow(u);if(0!==l.cmp(s)&&0!==l.cmp(f)){for(var d=1;d<c;d++){if(0===(l=l.redSqr()).cmp(s))return!1;if(0===l.cmp(f))break}if(d===c)return!1}}return!0},a.prototype.getDivisor=function(e,t){var r=e.bitLength(),i=n.mont(e),a=new n(1).toRed(i);t||(t=Math.max(1,r/48|0));for(var s=e.subn(1),o=0;!s.testn(o);o++);for(var c=e.shrn(o),u=s.toRed(i);t>0;t--){var f=this._randrange(new n(2),s),h=e.gcd(f);if(0!==h.cmpn(1))return h;var l=f.toRed(i).redPow(c);if(0!==l.cmp(a)&&0!==l.cmp(u)){for(var d=1;d<o;d++){if(0===(l=l.redSqr()).cmp(a))return l.fromRed().subn(1).gcd(e);if(0===l.cmp(u))break}if(d===o)return(l=l.redSqr()).fromRed().subn(1).gcd(e)}}return!1}},function(e,t,r){var n=r(12);e.exports=m,m.simpleSieve=y,m.fermatTest=v;var i=r(3),a=new i(24),s=new(r(55)),o=new i(1),c=new i(2),u=new i(5),f=(new i(16),new i(8),new i(10)),h=new i(3),l=(new i(7),new i(11)),d=new i(4),p=(new i(12),null);function g(){if(null!==p)return p;var e=[];e[0]=2;for(var t=1,r=3;r<1048576;r+=2){for(var n=Math.ceil(Math.sqrt(r)),i=0;i<t&&e[i]<=n&&r%e[i]!=0;i++);t!==i&&e[i]<=n||(e[t++]=r)}return p=e,e}function y(e){for(var t=g(),r=0;r<t.length;r++)if(0===e.modn(t[r]))return 0===e.cmpn(t[r]);return!0}function v(e){var t=i.mont(e);return 0===c.toRed(t).redPow(e.subn(1)).fromRed().cmpn(1)}function m(e,t){if(e<16)return new i(2===t||5===t?[140,123]:[140,39]);var r,p;for(t=new i(t);;){for(r=new i(n(Math.ceil(e/8)));r.bitLength()>e;)r.ishrn(1);if(r.isEven()&&r.iadd(o),r.testn(1)||r.iadd(c),t.cmp(c)){if(!t.cmp(u))for(;r.mod(f).cmp(h);)r.iadd(d)}else for(;r.mod(a).cmp(l);)r.iadd(d);if(y(p=r.shrn(1))&&y(r)&&v(p)&&v(r)&&s.test(p)&&s.test(r))return r}}},function(e,t,r){var n=r(23),i=r(1).Buffer,a=r(8);function s(e,t,r,s){a.call(this),this._cipher=new n.AES(t),this._prev=i.from(r),this._cache=i.allocUnsafe(0),this._secCache=i.allocUnsafe(0),this._decrypt=s,this._mode=e}r(0)(s,a),s.prototype._update=function(e){return this._mode.encrypt(this,e,this._decrypt)},s.prototype._final=function(){this._cipher.scrub()},e.exports=s},function(e,t,r){var n=r(23),i=r(1).Buffer,a=r(8),s=r(0),o=r(135),c=r(16),u=r(60);function f(e,t,r,s){a.call(this);var c=i.alloc(4,0);this._cipher=new n.AES(t);var f=this._cipher.encryptBlock(c);this._ghash=new o(f),r=function(e,t,r){if(12===t.length)return e._finID=i.concat([t,i.from([0,0,0,1])]),i.concat([t,i.from([0,0,0,2])]);var n=new o(r),a=t.length,s=a%16;n.update(t),s&&(s=16-s,n.update(i.alloc(s,0))),n.update(i.alloc(8,0));var c=8*a,f=i.alloc(8);f.writeUIntBE(c,0,8),n.update(f),e._finID=n.state;var h=i.from(e._finID);return u(h),h}(this,r,f),this._prev=i.from(r),this._cache=i.allocUnsafe(0),this._secCache=i.allocUnsafe(0),this._decrypt=s,this._alen=0,this._len=0,this._mode=e,this._authTag=null,this._called=!1}s(f,a),f.prototype._update=function(e){if(!this._called&&this._alen){var t=16-this._alen%16;t<16&&(t=i.alloc(t,0),this._ghash.update(t))}this._called=!0;var r=this._mode.encrypt(this,e);return this._decrypt?this._ghash.update(e):this._ghash.update(r),this._len+=e.length,r},f.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var e=c(this._ghash.final(8*this._alen,8*this._len),this._cipher.encryptBlock(this._finID));if(this._decrypt&&function(e,t){var r=0;e.length!==t.length&&r++;for(var n=Math.min(e.length,t.length),i=0;i<n;++i)r+=e[i]^t[i];return r}(e,this._authTag))throw new Error("Unsupported state or unable to authenticate data");this._authTag=e,this._cipher.scrub()},f.prototype.getAuthTag=function(){if(this._decrypt||!i.isBuffer(this._authTag))throw new Error("Attempting to get auth tag in unsupported state");return this._authTag},f.prototype.setAuthTag=function(e){if(!this._decrypt)throw new Error("Attempting to set auth tag in unsupported state");this._authTag=e},f.prototype.setAAD=function(e){if(this._called)throw new Error("Attempting to set AAD in unsupported state");this._ghash.update(e),this._alen+=e.length},e.exports=f},function(e){e.exports={"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"}}},function(e,t){e.exports=function(e){for(var t,r=e.length;r--;){if(255!==(t=e.readUInt8(r))){t++,e.writeUInt8(t,r);break}e.writeUInt8(0,r)}}},function(e,t,r){var n=r(16),i=r(1).Buffer,a=r(60);function s(e){var t=e._cipher.encryptBlockRaw(e._prev);return a(e._prev),t}t.encrypt=function(e,t){var r=Math.ceil(t.length/16),a=e._cache.length;e._cache=i.concat([e._cache,i.allocUnsafe(16*r)]);for(var o=0;o<r;o++){var c=s(e),u=a+16*o;e._cache.writeUInt32BE(c[0],u+0),e._cache.writeUInt32BE(c[1],u+4),e._cache.writeUInt32BE(c[2],u+8),e._cache.writeUInt32BE(c[3],u+12)}var f=e._cache.slice(0,t.length);return e._cache=e._cache.slice(t.length),n(t,f)}},function(e,t,r){var n=r(67),i=r(32),a=r(31),s=r(64),o=r(63),c=r(1).Buffer,u=c.alloc(128),f={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};function h(e,t,r){var s=function(e){return"rmd160"===e||"ripemd160"===e?i:"md5"===e?n:function(t){return a(e).update(t).digest()}}(e),o="sha512"===e||"sha384"===e?128:64;t.length>o?t=s(t):t.length<o&&(t=c.concat([t,u],o));for(var h=c.allocUnsafe(o+f[e]),l=c.allocUnsafe(o+f[e]),d=0;d<o;d++)h[d]=54^t[d],l[d]=92^t[d];var p=c.allocUnsafe(o+r+4);h.copy(p,0,0,o),this.ipad1=p,this.ipad2=h,this.opad=l,this.alg=e,this.blocksize=o,this.hash=s,this.size=f[e]}h.prototype.run=function(e,t){return e.copy(t,this.blocksize),this.hash(t).copy(this.opad,this.blocksize),this.hash(this.opad)},e.exports=function(e,t,r,n,i){s(e,t,r,n),c.isBuffer(e)||(e=c.from(e,o)),c.isBuffer(t)||(t=c.from(t,o));var a=new h(i=i||"sha1",e,t.length),u=c.allocUnsafe(n),l=c.allocUnsafe(t.length+4);t.copy(l,0,0,t.length);for(var d=0,p=f[i],g=Math.ceil(n/p),y=1;y<=g;y++){l.writeUInt32BE(y,t.length);for(var v=a.run(l,a.ipad1),m=v,b=1;b<r;b++){m=a.run(m,a.ipad2);for(var w=0;w<p;w++)v[w]^=m[w]}v.copy(u,d),d+=p}return u}},function(e,t,r){(function(t){var r;r=t.browser||parseInt(t.version.split(".")[0].slice(1),10)>=6?"utf-8":"binary",e.exports=r}).call(this,r(9))},function(e,t,r){(function(t){var r=Math.pow(2,30)-1;function n(e,r){if("string"!=typeof e&&!t.isBuffer(e))throw new TypeError(r+" must be a buffer or string")}e.exports=function(e,t,i,a){if(n(e,"Password"),n(t,"Salt"),"number"!=typeof i)throw new TypeError("Iterations not a number");if(i<0)throw new TypeError("Bad iterations");if("number"!=typeof a)throw new TypeError("Key length not a number");if(a<0||a>r||a!=a)throw new TypeError("Bad key length")}}).call(this,r(2).Buffer)},function(e,t,r){t.pbkdf2=r(150),t.pbkdf2Sync=r(62)},function(e){e.exports={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"}}},function(e,t,r){var n=r(38);e.exports=function(e){return(new n).update(e).digest()}},function(e,t,r){"use strict";var n=r(0),i=r(152),a=r(8),s=r(1).Buffer,o=r(67),c=r(32),u=r(31),f=s.alloc(128);function h(e,t){a.call(this,"digest"),"string"==typeof t&&(t=s.from(t));var r="sha512"===e||"sha384"===e?128:64;this._alg=e,this._key=t,t.length>r?t=("rmd160"===e?new c:u(e)).update(t).digest():t.length<r&&(t=s.concat([t,f],r));for(var n=this._ipad=s.allocUnsafe(r),i=this._opad=s.allocUnsafe(r),o=0;o<r;o++)n[o]=54^t[o],i[o]=92^t[o];this._hash="rmd160"===e?new c:u(e),this._hash.update(n)}n(h,a),h.prototype._update=function(e){this._hash.update(e)},h.prototype._final=function(){var e=this._hash.digest();return("rmd160"===this._alg?new c:u(this._alg)).update(this._opad).update(e).digest()},e.exports=function(e,t){return"rmd160"===(e=e.toLowerCase())||"ripemd160"===e?new h("rmd160",t):"md5"===e?new i(o,t):new h(e,t)}},function(e,t,r){var n=r(0),i=r(11),a=r(1).Buffer,s=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],o=new Array(160);function c(){this.init(),this._w=o,i.call(this,128,112)}function u(e,t,r){return r^e&(t^r)}function f(e,t,r){return e&t|r&(e|t)}function h(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function l(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function d(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function p(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function g(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function y(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function v(e,t){return e>>>0<t>>>0?1:0}n(c,i),c.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},c.prototype._update=function(e){for(var t=this._w,r=0|this._ah,n=0|this._bh,i=0|this._ch,a=0|this._dh,o=0|this._eh,c=0|this._fh,m=0|this._gh,b=0|this._hh,w=0|this._al,S=0|this._bl,E=0|this._cl,C=0|this._dl,A=0|this._el,B=0|this._fl,x=0|this._gl,T=0|this._hl,I=0;I<32;I+=2)t[I]=e.readInt32BE(4*I),t[I+1]=e.readInt32BE(4*I+4);for(;I<160;I+=2){var F=t[I-30],k=t[I-30+1],R=d(F,k),D=p(k,F),_=g(F=t[I-4],k=t[I-4+1]),P=y(k,F),N=t[I-14],O=t[I-14+1],L=t[I-32],U=t[I-32+1],K=D+O|0,M=R+N+v(K,D)|0;M=(M=M+_+v(K=K+P|0,P)|0)+L+v(K=K+U|0,U)|0,t[I]=M,t[I+1]=K}for(var H=0;H<160;H+=2){M=t[H],K=t[H+1];var j=f(r,n,i),V=f(w,S,E),G=h(r,w),q=h(w,r),z=l(o,A),W=l(A,o),X=s[H],Y=s[H+1],J=u(o,c,m),Q=u(A,B,x),Z=T+W|0,$=b+z+v(Z,T)|0;$=($=($=$+J+v(Z=Z+Q|0,Q)|0)+X+v(Z=Z+Y|0,Y)|0)+M+v(Z=Z+K|0,K)|0;var ee=q+V|0,te=G+j+v(ee,q)|0;b=m,T=x,m=c,x=B,c=o,B=A,o=a+$+v(A=C+Z|0,C)|0,a=i,C=E,i=n,E=S,n=r,S=w,r=$+te+v(w=Z+ee|0,Z)|0}this._al=this._al+w|0,this._bl=this._bl+S|0,this._cl=this._cl+E|0,this._dl=this._dl+C|0,this._el=this._el+A|0,this._fl=this._fl+B|0,this._gl=this._gl+x|0,this._hl=this._hl+T|0,this._ah=this._ah+r+v(this._al,w)|0,this._bh=this._bh+n+v(this._bl,S)|0,this._ch=this._ch+i+v(this._cl,E)|0,this._dh=this._dh+a+v(this._dl,C)|0,this._eh=this._eh+o+v(this._el,A)|0,this._fh=this._fh+c+v(this._fl,B)|0,this._gh=this._gh+m+v(this._gl,x)|0,this._hh=this._hh+b+v(this._hl,T)|0},c.prototype._hash=function(){var e=a.allocUnsafe(64);function t(t,r,n){e.writeInt32BE(t,n),e.writeInt32BE(r,n+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e},e.exports=c},function(e,t,r){var n=r(0),i=r(11),a=r(1).Buffer,s=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],o=new Array(64);function c(){this.init(),this._w=o,i.call(this,64,56)}function u(e,t,r){return r^e&(t^r)}function f(e,t,r){return e&t|r&(e|t)}function h(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function l(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function d(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}n(c,i),c.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},c.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,i=0|this._b,a=0|this._c,o=0|this._d,c=0|this._e,p=0|this._f,g=0|this._g,y=0|this._h,v=0;v<16;++v)r[v]=e.readInt32BE(4*v);for(;v<64;++v)r[v]=0|(((t=r[v-2])>>>17|t<<15)^(t>>>19|t<<13)^t>>>10)+r[v-7]+d(r[v-15])+r[v-16];for(var m=0;m<64;++m){var b=y+l(c)+u(c,p,g)+s[m]+r[m]|0,w=h(n)+f(n,i,a)|0;y=g,g=p,p=c,c=o+b|0,o=a,a=i,i=n,n=b+w|0}this._a=n+this._a|0,this._b=i+this._b|0,this._c=a+this._c|0,this._d=o+this._d|0,this._e=c+this._e|0,this._f=p+this._f|0,this._g=g+this._g|0,this._h=y+this._h|0},c.prototype._hash=function(){var e=a.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e},e.exports=c},function(e,t,r){"use strict";e.exports=s;var n=r(10),i=r(17);function a(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(!n)return this.emit("error",new Error("write callback called multiple times"));r.writechunk=null,r.writecb=null,null!=t&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function s(e){if(!(this instanceof s))return new s(e);n.call(this,e),this._transformState={afterTransform:a.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",o)}function o(){var e=this;"function"==typeof this._flush?this._flush((function(t,r){c(e,t,r)})):c(this,null,null)}function c(e,t,r){if(t)return e.emit("error",t);if(null!=r&&e.push(r),e._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(e._transformState.transforming)throw new Error("Calling transform done when still transforming");return e.push(null)}i.inherits=r(0),i.inherits(s,n),s.prototype.push=function(e,t){return this._transformState.needTransform=!1,n.prototype.push.call(this,e,t)},s.prototype._transform=function(e,t,r){throw new Error("_transform() is not implemented")},s.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},s.prototype._read=function(e){var t=this._transformState;null!==t.writechunk&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0},s.prototype._destroy=function(e,t){var r=this;n.prototype._destroy.call(this,e,(function(e){t(e),r.emit("close")}))}},function(e,t,r){"use strict";var n=r(24);function i(e,t){e.emit("error",t)}e.exports={destroy:function(e,t){var r=this,a=this._readableState&&this._readableState.destroyed,s=this._writableState&&this._writableState.destroyed;return a||s?(t?t(e):!e||this._writableState&&this._writableState.errorEmitted||n.nextTick(i,this,e),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!t&&e?(n.nextTick(i,r,e),r._writableState&&(r._writableState.errorEmitted=!0)):t&&t(e)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},function(e,t,r){e.exports=r(36).EventEmitter},function(e,t,r){"use strict";(function(t,n){var i=r(24);e.exports=b;var a,s=r(76);b.ReadableState=m,r(36).EventEmitter;var o=function(e,t){return e.listeners(t).length},c=r(73),u=r(1).Buffer,f=t.Uint8Array||function(){},h=r(17);h.inherits=r(0);var l=r(167),d=void 0;d=l&&l.debuglog?l.debuglog("stream"):function(){};var p,g=r(166),y=r(72);h.inherits(b,c);var v=["error","close","destroy","pause","resume"];function m(e,t){e=e||{};var n=t instanceof(a=a||r(10));this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var i=e.highWaterMark,s=e.readableHighWaterMark,o=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(s||0===s)?s:o,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new g,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(p||(p=r(33).StringDecoder),this.decoder=new p(e.encoding),this.encoding=e.encoding)}function b(e){if(a=a||r(10),!(this instanceof b))return new b(e);this._readableState=new m(e,this),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),c.call(this)}function w(e,t,r,n,i){var a,s=e._readableState;return null===t?(s.reading=!1,function(e,t){if(!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,A(e)}}(e,s)):(i||(a=function(e,t){var r,n;return n=t,u.isBuffer(n)||n instanceof f||"string"==typeof t||void 0===t||e.objectMode||(r=new TypeError("Invalid non-string/buffer chunk")),r}(s,t)),a?e.emit("error",a):s.objectMode||t&&t.length>0?("string"==typeof t||s.objectMode||Object.getPrototypeOf(t)===u.prototype||(t=function(e){return u.from(e)}(t)),n?s.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):S(e,s,t,!0):s.ended?e.emit("error",new Error("stream.push() after EOF")):(s.reading=!1,s.decoder&&!r?(t=s.decoder.write(t),s.objectMode||0!==t.length?S(e,s,t,!1):x(e,s)):S(e,s,t,!1))):n||(s.reading=!1)),function(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}(s)}function S(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(e.emit("data",r),e.read(0)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&A(e)),x(e,t)}Object.defineProperty(b.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),b.prototype.destroy=y.destroy,b.prototype._undestroy=y.undestroy,b.prototype._destroy=function(e,t){this.push(null),t(e)},b.prototype.push=function(e,t){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof e&&((t=t||n.defaultEncoding)!==n.encoding&&(e=u.from(e,t),t=""),r=!0),w(this,e,t,!1,r)},b.prototype.unshift=function(e){return w(this,e,null,!0,!1)},b.prototype.isPaused=function(){return!1===this._readableState.flowing},b.prototype.setEncoding=function(e){return p||(p=r(33).StringDecoder),this._readableState.decoder=new p(e),this._readableState.encoding=e,this};var E=8388608;function C(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=E?e=E:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function A(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(d("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?i.nextTick(B,e):B(e))}function B(e){d("emit readable"),e.emit("readable"),k(e)}function x(e,t){t.readingMore||(t.readingMore=!0,i.nextTick(T,e,t))}function T(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(d("maybeReadMore read 0"),e.read(0),r!==t.length);)r=t.length;t.readingMore=!1}function I(e){d("readable nexttick read 0"),e.read(0)}function F(e,t){t.reading||(d("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),k(e),t.flowing&&!t.reading&&e.read(0)}function k(e){var t=e._readableState;for(d("flow",t.flowing);t.flowing&&null!==e.read(););}function R(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):r=function(e,t,r){var n;return e<t.head.data.length?(n=t.head.data.slice(0,e),t.head.data=t.head.data.slice(e)):n=e===t.head.data.length?t.shift():r?function(e,t){var r=t.head,n=1,i=r.data;for(e-=i.length;r=r.next;){var a=r.data,s=e>a.length?a.length:e;if(s===a.length?i+=a:i+=a.slice(0,e),0==(e-=s)){s===a.length?(++n,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=a.slice(s));break}++n}return t.length-=n,i}(e,t):function(e,t){var r=u.allocUnsafe(e),n=t.head,i=1;for(n.data.copy(r),e-=n.data.length;n=n.next;){var a=n.data,s=e>a.length?a.length:e;if(a.copy(r,r.length-e,0,s),0==(e-=s)){s===a.length?(++i,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=a.slice(s));break}++i}return t.length-=i,r}(e,t),n}(e,t.buffer,t.decoder),r);var r}function D(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,i.nextTick(_,t,e))}function _(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function P(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}b.prototype.read=function(e){d("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return d("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?D(this):A(this),null;if(0===(e=C(e,t))&&t.ended)return 0===t.length&&D(this),null;var n,i=t.needReadable;return d("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&d("length less than watermark",i=!0),t.ended||t.reading?d("reading or ended",i=!1):i&&(d("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=C(r,t))),null===(n=e>0?R(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&D(this)),null!==n&&this.emit("data",n),n},b.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},b.prototype.pipe=function(e,t){var r=this,a=this._readableState;switch(a.pipesCount){case 0:a.pipes=e;break;case 1:a.pipes=[a.pipes,e];break;default:a.pipes.push(e)}a.pipesCount+=1,d("pipe count=%d opts=%j",a.pipesCount,t);var c=t&&!1===t.end||e===n.stdout||e===n.stderr?m:u;function u(){d("onend"),e.end()}a.endEmitted?i.nextTick(c):r.once("end",c),e.on("unpipe",(function t(n,i){d("onunpipe"),n===r&&i&&!1===i.hasUnpiped&&(i.hasUnpiped=!0,d("cleanup"),e.removeListener("close",y),e.removeListener("finish",v),e.removeListener("drain",f),e.removeListener("error",g),e.removeListener("unpipe",t),r.removeListener("end",u),r.removeListener("end",m),r.removeListener("data",p),h=!0,!a.awaitDrain||e._writableState&&!e._writableState.needDrain||f())}));var f=function(e){return function(){var t=e._readableState;d("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&o(e,"data")&&(t.flowing=!0,k(e))}}(r);e.on("drain",f);var h=!1,l=!1;function p(t){d("ondata"),l=!1,!1!==e.write(t)||l||((1===a.pipesCount&&a.pipes===e||a.pipesCount>1&&-1!==P(a.pipes,e))&&!h&&(d("false write response, pause",r._readableState.awaitDrain),r._readableState.awaitDrain++,l=!0),r.pause())}function g(t){d("onerror",t),m(),e.removeListener("error",g),0===o(e,"error")&&e.emit("error",t)}function y(){e.removeListener("finish",v),m()}function v(){d("onfinish"),e.removeListener("close",y),m()}function m(){d("unpipe"),r.unpipe(e)}return r.on("data",p),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?s(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",g),e.once("close",y),e.once("finish",v),e.emit("pipe",r),a.flowing||(d("pipe resume"),r.resume()),e},b.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var a=0;a<i;a++)n[a].emit("unpipe",this,r);return this}var s=P(t.pipes,e);return-1===s||(t.pipes.splice(s,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r)),this},b.prototype.on=function(e,t){var r=c.prototype.on.call(this,e,t);if("data"===e)!1!==this._readableState.flowing&&this.resume();else if("readable"===e){var n=this._readableState;n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.emittedReadable=!1,n.reading?n.length&&A(this):i.nextTick(I,this))}return r},b.prototype.addListener=b.prototype.on,b.prototype.resume=function(){var e=this._readableState;return e.flowing||(d("resume"),e.flowing=!0,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,i.nextTick(F,e,t))}(this,e)),this},b.prototype.pause=function(){return d("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(d("pause"),this._readableState.flowing=!1,this.emit("pause")),this},b.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var i in e.on("end",(function(){if(d("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(i){d("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i||(r.objectMode||i&&i.length)&&(t.push(i)||(n=!0,e.pause()))})),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var a=0;a<v.length;a++)e.on(v[a],this.emit.bind(this,v[a]));return this._read=function(t){d("wrapped _read",t),n&&(n=!1,e.resume())},this},Object.defineProperty(b.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),b._fromList=R}).call(this,r(7),r(9))},function(e,t,r){"use strict";var n=r(1).Buffer,i=r(37).Transform;function a(e){i.call(this),this._block=n.allocUnsafe(e),this._blockSize=e,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}r(0)(a,i),a.prototype._transform=function(e,t,r){var n=null;try{this.update(e,t)}catch(e){n=e}r(n)},a.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(e){t=e}e(t)},a.prototype.update=function(e,t){if(function(e,t){if(!n.isBuffer(e)&&"string"!=typeof e)throw new TypeError("Data must be a string or a buffer")}(e),this._finalized)throw new Error("Digest already called");n.isBuffer(e)||(e=n.from(e,t));for(var r=this._block,i=0;this._blockOffset+e.length-i>=this._blockSize;){for(var a=this._blockOffset;a<this._blockSize;)r[a++]=e[i++];this._update(),this._blockOffset=0}for(;i<e.length;)r[this._blockOffset++]=e[i++];for(var s=0,o=8*e.length;o>0;++s)this._length[s]+=o,(o=this._length[s]/4294967296|0)>0&&(this._length[s]-=4294967296*o);return this},a.prototype._update=function(){throw new Error("_update is not implemented")},a.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var t=this._digest();void 0!==e&&(t=t.toString(e)),this._block.fill(0),this._blockOffset=0;for(var r=0;r<4;++r)this._length[r]=0;return t},a.prototype._digest=function(){throw new Error("_digest is not implemented")},e.exports=a},function(e,t){var r={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==r.call(e)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.gostASN1Instance=void 0;var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.GostASN1=Ta;var i=r(176),a=r(78),s=r(39),o=ArrayBuffer,c=a.gostSecurityInstance.algorithms,u=a.gostSecurityInstance.names,f=a.gostSecurityInstance.identifiers,h=a.gostSecurityInstance.attributes,l=a.gostSecurityInstance.parameters,d=s.gostCodingInstance.BER,p=s.gostCodingInstance.PEM,g=s.gostCodingInstance.Chars,y=s.gostCodingInstance.Hex,v=s.gostCodingInstance.Int16;function m(e){e instanceof o&&(e=new Uint8Array(e));for(var t=new Uint8Array(e.length),r=0,n=e.length;r<n;r++)t[n-r-1]=e[r];return t.buffer}function b(e){return e instanceof o||e.buffer instanceof o}function w(e){return e<=2?e:e<=4?4:e<=8?8:e<=16?16:e<=32?32:e<=64?64:e<=128?128:e<=256?256:e<512?512:e<1024?1024:void 0}var S=function(e,t){return"0x"+y.encode(e,t)},E=function(e,t,r){"number"==typeof e&&(e=e.toString(16));var n,i,a=e.replace("0x","");return r=r||w(a.length),y.decode((i=r,(n=a).length>=i?n:new Array(i-n.length+1).join("0")+n),t)};function C(e){if(e)throw Error("Invalid format")}function A(e,t,r,i){"object"!==(void 0===r?"undefined":n(r))&&(r={value:r}),void 0!==i&&(r.enumerable=i),Object.defineProperty(e,t,r)}function B(e,t,r){for(var n in t)A(e,n,t[n],r)}function x(e,t){return Object.getOwnPropertyDescriptor(e,t)}function T(e,t,r,n,i,a){C(void 0===t);var s={tagNumber:r,tagClass:n||0,tagConstructed:i||!1,object:t};return"DER"!==(e=e||"DER")&&"CER"!==e||(s=d.encode(s,e)),"PEM"===e&&(s=p.encode(s,a)),s}function I(e,t,r,n,i){if(C(void 0===e),"string"==typeof e&&(e=p.decode(e,i,!1)),e instanceof o)try{e=p.decode(g.encode(e),i,!0)}catch(t){e=d.decode(e)}return r=r||0,n=n||!1,void 0===e.tagNumber&&(e=T(!0,e.object,t,r,e.object instanceof Array),e=d.decode(e)),C(e.tagClass!==r||e.tagNumber!==t||e.tagConstructed!==n),0===r&&5===t?null:e.object}function F(e,t,r,n){if("function"!=typeof t&&(n=r,r=t,t=function(){e.apply(this,arguments)}),t.prototype=Object.create(e.prototype,{constructor:{value:t},superclass:{value:e.prototype}}),r&&B(t.prototype,r),e!==Object)for(var i in e)t[i]=e[i];return t.super=e,n&&B(t,n,!0),t}var k,R,D,_=F(Object,(function(e){this.object=e}),{_set:function(e,t,r){e.property(t).set.call(this,r)},_get:function(e,t){return e.property(t).get.call(this)},_call:function(e,t,r){return e.method(t).apply(this,r)},hasProperty:function(e){return this.hasOwnProperty(e)||!!this.constructor.property(e)},encode:function(){return this.object}},{decode:function(e){return new this(e)},property:function(e){for(var t=this.prototype;t;){var r=x(t,e);if(r)return r;t=t.superclass}},method:function(e){for(var t=this.prototype;t;){if(t[e])return t[e];t=t.superclass}}}),P=function(e){return F(_,{encode:function(t){return T(t,this.object,e)}},{decode:function(t){return new this(I(t,e))}})},N=_,O=P(1),L=P(22),U=P(18),K=P(19),M=P(20),H=P(12),j=P(23),V=P(24),G=P(28),q=P(30),z=F(P(5),{object:{get:function(){return null},set:function(e){C(null!==e)}}}),W=function(e){var t=F(P(e),(function(r){if(!(this instanceof t))return n=r,F(P(e),(function(e){t.super.call(this,e)}),{encode:function(t){return T(t,n[this.object],e)}},{decode:function(t){var r=I(t,e);for(var i in n)if(r===n[i])return new this(i);C(!0)}});var n;t.super.apply(this,arguments)}));return t},X=W(2),Y=W(10),J=(k=F(P(4),(function(e){if(!(this instanceof k))return(t=e)?F(t,{encode:function(e){return T(e,t.method("encode").call(this,!0),4)}},{decode:function(e){return t.decode.call(this,I(e,4))}}):k;var t;k.super.apply(this,arguments)})),k),Q=function(){var e=F(P(3),(function(t){if(!(this instanceof e))return"object"===(void 0===t?"undefined":n(t))?(i=t,F(_,(function(e,t){_.call(this,e),this.numbits=t||0}),{encode:function(e){var t=this.object,r=[];if(t instanceof Array){for(var n=0,a=t.length;n<a;n++){var s=i[t[n]];void 0!==s&&(r[s]="1")}for(n=0,a=Math.max(r.length,this.numbits);n<a;n++)r[n]||(r[n]="0");r=r.join("")}else r="0";return T(e,r,3)}},{decode:function(e){var t=I(e,3),r=[];for(var n in i){var a=i[n];"1"===t.charAt(a)&&r.push(n)}return new this(r,t.length)}})):(r=t)?F(r,{encode:function(e){return T(e,r.method("encode").call(this,!0),3)}},{decode:function(e){return r.decode.call(this,I(e,3))}}):e;var r,i;e.super.apply(this,arguments)}));return e}(),Z=function(e){return e.combine=function(t,r){for(var n in e.prototype)e.prototype.hasOwnProperty(n)&&!t.hasProperty(n)&&A(t,n,function(e){return{get:function(){return this[r]&&this[r][e]},set:function(t){this[r]||(this[r]={}),this[r][e]=t},configurable:!1,enumerable:!0}}(n))},e},$=function(e,t){var r=F(_,(function(e,t){A(this,"items",{writable:!0,value:{}}),"string"==typeof e||e instanceof o?this.decode(e):void 0!==e&&(this.object=e,t&&this.check())}),{object:{get:function(){return this},set:function(t){if(t instanceof r)for(var n in this.items=t.items,e)(s=this.getItemClass(n,this.items)).combine&&s.combine(this,n);else{var i={};for(var n in e){var a=t[n],s=this.getItemClass(n,i);void 0!==a?i[n]=new s(a):s.combine&&(i[n]=new s(t)),s.combine&&s.combine(this,n)}this.items=i}}},getItemClass:function(t,r){return e[t]},encode:function(r){var n=[],i=this.items;for(var a in e)if(i[a]){var s=i[a].encode(!0);void 0!==s&&n.push(s)}return T(r,n,16,0,!0,t)},decode:function(e){this.object=this.constructor.decode(e)},check:function(){this.constructor.decode(this.encode(!0))}},{encode:function(e,t){return new this(e).encode(t)},decode:function(r){r=I(r,16,0,!0,t);var n=0,i=new this,a=i.items={};for(var s in e){var o=i.getItemClass(s,a),c=o.decode(r[n]);void 0!==c&&(a[s]=c,o.combine&&o.combine(i,s),n++)}return i}});for(var n in e)A(r.prototype,n,function(t){return{get:function(){return this.items[t]&&this.items[t].object},set:function(e){if(void 0!==e){var r=this.getItemClass(t,this.items);this.items[t]=new r(e)}else delete this.items[t]},configurable:!1,enumerable:!e[t].combine}}(n)),e[n].combine&&e[n].combine(r.prototype,n);return r},ee=function(e,t,r,n,i){var a=$(e,i);return function i(s,o){t=t||"type",r=r||"value",o=o||n||N;var c=F(a,(function(e){if(!(this instanceof c))return i.apply(this,arguments);a.apply(this,arguments)}),{getItemClass:function(n,i){var a=e[n];if(r===n){var c,u=i&&i[t];if(u){var f=u.object;s&&(c="function"==typeof s?s(f):s[f])}c=c||o||N,a=a===N?c:a(c)}return a}});return A(c.prototype,t,{get:function(){return this.items[t]&&this.items[t].object},set:function(){C(!0)},configurable:!1,enumerable:!0}),c}()},te=F(_,{encode:function(e){var t=this.object;return C(!(t=/^(\d+\.)+\d+$/.test(t)?t:f[t])),T(e,t,6)}},{decode:function(e){var t=I(e,6);return new this(u[t]||t)}}),re=function(e){return F(e=e||N,{encode:function(t){var r=e.method("encode").call(this,t);return"string"==typeof r||r instanceof o?r:4===r.tagNumber||0!==r.tagClass||r.object instanceof Array?{object:r.object}:{object:d.encode(r,"DER",!0)}}},{decode:function(t){return"string"==typeof t||t instanceof o||(t={object:t.object,header:t.header,content:t.content}),e.decode.call(this,t)}})},ne=function(e){return F(e=e||N,{encode:function(t){var r=e.method("encode").call(this,t);return"string"==typeof r||r instanceof o?r:{object:[r]}}},{decode:function(t){return"string"==typeof t||t instanceof o?e.decode.call(this,t):e.decode.call(this,t.object[0])}})},ie=function(e,t){return F(t,(function(){t.apply(this,arguments)}),{encode:function(r){var n=t.method("encode").call(this,r);return"string"==typeof n||n instanceof o||(n.tagNumber=e,n.tagClass=2,n.tagConstructed=n.object instanceof Array),n}},{decode:function(r){return C(void 0!==r.tagNumber&&(2!==r.tagClass||r.tagNumber!==e)),t.decode.call(this,r)}})},ae=function(e){return function(t,r){return t=t||N,function n(i,a){var s="function"==typeof t&&void 0!==i?t(i,a):t;if(r){var o=F(_,(function(e){if(!(this instanceof o))return n.apply(this,arguments);A(this,"items",{writable:!0,value:{}}),_.call(this,e||{})}),{object:{get:function(){return this.read(),this},set:function(e){if(e instanceof o)e.read(),this.items=e.items;else{var t={};for(var r in e){var n=e[r];t[r]=this.createItem(n,r)}this.items=t}this.reset()}},createItem:function(e,t){if(r){var n={};n[r.typeName]=t,n[r.valueName]=e}else n=e;return new s(n)},getItemValue:function(e){var t=this.items[e];return r?t.object[r.valueName]:t.object},setItemValue:function(e,t){var n=this.items[e];r?n.object[r.valueName]=t:n.object=t},isItemType:function(e){return r?f[e]:!isNaN(parseInt(e))},reset:function(){var e=this.items;for(var t in this)this.hasOwnProperty(t)&&!this.items[t]&&this.isItemType(t)&&delete this[t];for(var t in e)this[t]=this.getItemValue(t)},read:function(){var e=this.items;for(var t in this)this.isItemType(t)&&(this.items[t]?this.getItemValue(t)!==this[t]&&this.setItemValue(t,this[t]):(e[t]=this.createItem(this[t],t),this[t]=this.getItemValue(t)))},encode:function(t){this.read();var r=this.items,n=[];for(var i in r){var a=r[i].encode(!0);void 0!==a&&n.push(a)}return T(t,n,e,0,!0)},decode:function(e){this.object=this.constructor.decode(e)},check:function(){this.constructor.decode(this.encode(!0))}},{encode:function(e,t){return new this(e).encode(t)},decode:function(t){t=I(t,e,0,!0);for(var n=new this,i=n.items={},a=0,o=t.length;a<o;a++){var c=s.decode(t[a]);i[r?c.object[r.typeName]:a]=c}return n.reset(),n}});return o}var c=F(_,(function(e){if(!(this instanceof c))return n.apply(this,arguments);B(this,{items:{writable:!0,value:[]},values:{writable:!0,value:[]}}),_.call(this,e||[])}),{object:{get:function(){return this.read(),this.values},set:function(e){if(e instanceof c)e.read(),this.items=e.items;else{for(var t=[],r=0,n=e.length;r<n;r++)t[r]=new s(e[r]);this.items=t}this.reset()}},encode:function(t){this.read();for(var r=this.items,n=[],i=0,a=r.length;i<a;i++){var s=r[i].encode(!0);void 0!==s&&n.push(s)}return T(t,n,e,0,!0)},decode:function(e){this.object=this.constructor.decode(e)},check:function(){this.constructor.decode(this.encode(!0))},reset:function(){for(var e=0,t=this.items.length;e<t;e++)this.values.push(this.items[e].object)},read:function(){for(var e=this.items,t=this.values,r=0,n=t.length;r<n;r++)this.items[r]?e[r].object!==t[r]&&(e[r].object=t[r]):(e[r]=new s(t[r]),t[r]=e[r].object)}},{encode:function(e,t){return new this(e).encode(t)},decode:function(t){t=I(t,e,0,!0);var r=new this;r.items=[];for(var n=0,i=t.length;n<i;n++)r.items.push(s.decode(t[n]));return r.reset(),r}});return c}()}},se=ae(16),oe=ae(17),ce=function(e,t){if(t){var r=F(_,{object:{get:function(){return this.item?t.decode(this.item.object):void 0},set:function(r){void 0!==r?this.item=new e(t.encode(r)):delete this.item}},encode:function(e){return this.item.encode(e)}},{decode:function(t){var r=new this;return r.item=e.decode(t),r}});for(var n in e)r[n]||(r[n]=e[n]);return r}return e},ue=function(e){return ce(oe(e),{encode:function(e){return[e]},decode:function(e){return e[0]}})},fe=function(e,t){return F(_,{object:{get:function(){return this.item&&this.item.object},set:function(r){if(r instanceof _)for(var n in e)if(r instanceof e[n])return void(this.item=r);C(!(n="function"==typeof t?t(r):t)||!e[n]),r=new e[n](r),this.item=r}},encode:function(e){return this.item.encode(e)}},{decode:function(t){for(var r in e)try{var n=e[r].decode(t);if(void 0!==n)return new this(n)}catch(e){}C(!0)}})},he=function(e){return F(e=e||N,{encode:function(){return d.encode(e.method("encode").call(this,!0))}},{encode:function(e,t){return new this(e).encode(t)},decode:function(t){return e.decode.call(this,d.decode(t))}})},le=function(e,t){return F(e=e||N,{encode:function(r){if(this.object!==t)return e.method("encode").call(this,r)}},{decode:function(r){if(void 0===r)return new this(t);try{return e.decode.call(this,r)}catch(e){return}}})},de=function(e){return F(e=e||N,{},{decode:function(t){if(void 0!==t)try{return e.decode.call(this,t)}catch(e){return}}})},pe=fe({teletexString:M,printableString:K,universalString:G,utf8String:H,bmpString:q,numericString:U},(function(e){return/^[A-Za-z0-9\.@\+\-\:\=\\\/\?\!\#\$\%\^\&\*\(\)\[\]\{\}\>\<\|\~]*$/.test(e)?"printableString":"utf8String"})),ge=fe({utcTime:j,generalTime:V},(function(e){return e.getYear()>=2050?"generalTime":"utcTime"})),ye=te,ve=N,me=ee({type:ye,value:ve}),be={typeName:"type",valueName:"value"},we=ue(me({serialName:K,countryName:K,dnQualifier:K,emailAddress:L,domainComponent:L,SNILS:U,OGRN:U,INN:U},pe)),Se=se(we,be)(),Ee=fe({rdnSequence:Se},"rdnSequence"),Ce=Z($({notBefore:ge,notAfter:ge})),Ae=X,Be=ee({type:te,value:N}),xe=oe(Be,be),Te=se(Be,be),Ie=X,Fe=$({a:Ie,b:Ie,seed:de(Q)}),ke=J(F(_,{encode:function(){var e=this.object,t=Math.max(w(e.x.length-2),w(e.y.length-2))/2,r=new Uint8Array(2*t+1);return r[0]=4,r.set(new Uint8Array(E(e.x,!1,t)),1),r.set(new Uint8Array(E(e.y,!1,t)),t+1),r.buffer}},{decode:function(e){var t=(e.byteLength-1)/2;return new this({x:S(new Uint8Array(e,1,t)),y:S(new Uint8Array(e,t+1,t))})}})),Re=$({fieldType:te,parameters:X}),De=$({version:Ae,fieldID:Re,curve:Fe,base:ke,order:X,cofactor:de(X)}),_e=$({publicKeyParamSet:te,digestParamSet:te,encryptionParamSet:de(te)}),Pe=function(e,t){return F(e=e||N,{encode:function(r){return this.object===t?new z(null).encode(r):e.method("encode").call(this,r)}},{decode:function(r){if(void 0!==r){if(null===r||5===r.tagNumber&&0===r.tagClass)return new this(t);try{return e.decode.call(this,r)}catch(e){return}}}})}(te,"id-GostR3411-94-CryptoProParamSet"),Ne=fe({namedParameters:te,ecParameters:De,implicitly:de(z)},(function(e){return"string"==typeof e||e instanceof String?"namedParameters":"ecParameters"})),Oe=function(e,t){return ce($({algorithm:te,parameters:de(e)}),t)},Le=function(){var e=Oe(N),t=F(_,(function(e){if(!(this instanceof t))return r(e);t.super.apply(this,arguments)}),{encode:function(t){return new e(this.object).encode(t)}},{decode:function(t){return new this(e.decode(t).object)}}),r=function(e){return F(_,{object:{get:function(){return this.item?this.item.object:void 0},set:function(t){if(t){var r=e[t.id];if(!r)throw new Error("Algorithm not supported");this.item=new r(t)}else delete this.item}},encode:function(e){return this.item.encode(e)}},{decode:function(t){"string"==typeof t&&(t=p.decode(t,void 0,!1)),t instanceof o&&(t=d.decode(t));var r=e[u[t.object[0].object]];if(r){var n=new this;return n.item=r.decode(t),n}throw new Error("Algorithm not supported")}})};return t}(),Ue=Oe(Ne,{encode:function(e){var t;return t="string"==typeof e.namedCurve?h.namedCurve[e.namedCurve]:{version:1,fieldID:{fieldType:"id-prime-Field",parameters:e.curve.p},curve:{a:e.curve.a,b:e.curve.b},base:{x:e.curve.x,y:e.curve.y},order:e.curve.q,cofactor:1},{algorithm:e.id,parameters:t}},decode:function(e){var t=e.parameters,r=c[e.algorithm];if("string"==typeof t||t instanceof String)r=(0,i.expand)(r,l[t]);else{if("object"!==(void 0===t?"undefined":n(t)))throw new DataError("Invalid key paramters");r=(0,i.expand)(r,{curve:{p:t.fieldID.parameters,a:t.curve.a,b:t.curve.b,x:t.base.x,y:t.base.y,q:t.order}})}return r}}),Ke=Oe(_e,{encode:function(e){var t=e.namedCurve?"namedCurve":"namedParam",r=e.name.indexOf("-94")>=0||e.name.indexOf("-2001")>=0||1994===e.version||2001===e.version?e.sBox||"D-A":e.name.indexOf("-512")>=0||512===e.length?"D-512":"D-256";return{algorithm:e.id,parameters:{publicKeyParamSet:h[t][e[t]],digestParamSet:h.sBox[r],encryptionParamSet:e.encParams&&e.encParams.sBox?h.sBox[e.encParams.sBox]:void 0}}},decode:function(e){var t=e.parameters,r=(0,i.expand)(c[e.algorithm],l[t.publicKeyParamSet],l[t.digestParamSet]);return t.encryptionParamSet&&(r.encParams=l[t.encryptionParamSet]),r}}),Me=Oe(N,{encode:function(e){return{algorithm:e.id}},decode:function(e){return c[e.algorithm]}}),He=Oe(z,{encode:function(e){return{algorithm:e.id,parameters:null}},decode:function(e){return c[e.algorithm]}}),je=Oe(Pe,{encode:function(e){return{algorithm:e.id,parameters:h.sBox[e.sBox||e.hash&&e.hash.sBox||"D-A"]}},decode:function(e){var t=(0,i.expand)(c[e.algorithm]),r=l[e.parameters];return t.hash?t.hash=(0,i.expand)(t.hash,r):t=(0,i.expand)(t,r),t}}),Ve=Le({ecdsa:Ue,noSignature:He,rsaEncryption:He,"id-sc-gostR3410-2001":Ue,"id-GostR3410-2001":Ke,"id-GostR3410-94":Ke,"id-GostR3410-2001DH":Ke,"id-GostR3410-94DH":Ke,"id-tc26-gost3410-12-256":Ke,"id-tc26-gost3410-12-512":Ke,"id-tc26-agreement-gost-3410-12-256":Ke,"id-tc26-agreement-gost-3410-12-512":Ke,"id-sc-gost28147-gfb":Me,"id-Gost28147-89":Me}),Ge=Le({noSignature:He,rsaEncryption:He,sha1withRSAEncryption:He,sha256withRSAEncryption:He,sha384withRSAEncryption:He,sha512withRSAEncryption:He,ecdsa:Me,"ecdsa-with-SHA1":Me,"ecdsa-with-SHA256":Me,"ecdsa-with-SHA384":Me,"ecdsa-with-SHA512":Me,"id-GostR3410-94":He,"id-GostR3410-2001":He,"id-GostR3411-94-with-GostR3410-2001":Me,"id-GostR3411-94-with-GostR3410-94":Me,"id-tc26-gost3410-12-256":He,"id-tc26-gost3410-12-512":He,"id-tc26-signwithdigest-gost3410-12-94":Me,"id-tc26-signwithdigest-gost3410-12-256":Me,"id-tc26-signwithdigest-gost3410-12-512":Me,"id-sc-gostR3410-94":He,"id-sc-gostR3410-2001":He,"id-sc-gostR3411-94-with-gostR3410-94":He,"id-sc-gostR3411-94-with-gostR3410-2001":He}),qe=Le({sha1:Me,sha256:He,sha384:He,sha512:He,"id-GostR3411-94":je,"id-tc26-gost3411-94":je,"id-tc26-gost3411-12-256":He,"id-tc26-gost3411-12-512":He,"id-sc-gostR3411-94":Me}),ze=J,We=J,Xe=te,Ye=J,Je=$({iv:Ye,encryptionParamSet:Xe}),Qe=$({encryptionParamSet:Xe,ukm:de(J)}),Ze=Oe(Je,{encode:function(e){return{algorithm:e.id,parameters:{iv:e.iv,encryptionParamSet:h.sBox[e.sBox||"E-A"]}}},decode:function(e){var t=(0,i.expand)(c[e.algorithm],l[e.parameters.encryptionParamSet]);return t.iv=e.parameters.iv,t}}),$e=Oe(Ye,{encode:function(e){return{algorithm:e.id,parameters:e.iv}},decode:function(e){var t=(0,i.expand)(c[e.algorithm]);return t.iv=e.parameters||new Uint8Array([0,0,0,0,0,0,0,0]),t}}),et=Oe(Qe,{encode:function(e){return{algorithm:e.id,parameters:{encryptionParamSet:h.sBox[e.sBox||"E-A"],ukm:e.ukm}}},decode:function(e){var t=(0,i.expand)(c[e.algorithm],l[e.parameters.encryptionParamSet]);return e.parameters.ukm&&(t.ukm=e.parameters.ukm),t}}),tt=Le({"id-Gost28147-89-None-KeyWrap":et,"id-Gost28147-89-CryptoPro-KeyWrap":et}),rt=Oe(tt,{encode:function(e){return{algorithm:e.id,parameters:e.wrapping}},decode:function(e){var t=(0,i.expand)(c[e.algorithm]);return t.wrapping=e.parameters,t}}),nt=Le({"id-sc-gost28147-gfb":$e,"id-Gost28147-89":Ze}),it=Le({"id-Gost28147-89-MAC":Je,"id-HMACGostR3411-94":je,"id-tc26-hmac-gost-3411-12-256":je,"id-tc26-hmac-gost-3411-12-512":je,hmacWithSHA1:Me,hmacWithSHA224:Me,hmacWithSHA256:Me,hmacWithSHA384:Me,hmacWithSHA512:Me,"id-sc-gost28147-mac":Me,"id-sc-hmacWithGostR3411":Me}),at=$({salt:fe({specified:J,otherSource:Le},(function(e){return b(e)?"specified":"otherSource"})),iterationCount:X,keyLength:de(X),prf:it}),st=Oe(at,{encode:function(e){return{algorithm:e.id,parameters:{salt:e.salt,iterationCount:e.iterations,prf:e.hmac}}},decode:function(e){var t=(0,i.expand)(c[e.algorithm]);return t.salt=e.parameters.salt,t.iterations=e.parameters.iterationCount,t.hmac=e.parameters.prf,t.hash=t.hmac.hash,t}}),ot=Le({PBKDF2:st}),ct=$({salt:J,iterationCount:X}),ut=Oe(ct,{paramType:ct,encode:function(e){return{algorithm:e.id,parameters:{salt:e.derivation.salt,iterationCount:e.derivation.iterations}}},decode:function(e){var t=(0,i.expand)(c[e.algorithm]);return t.derivation=(0,i.expand)(t.derivation,{salt:e.parameters.salt,iterations:e.parameters.iterationCount}),t}}),ft=$({keyDerivationFunc:ot,encryptionScheme:nt}),ht=Oe(ft,{encode:function(e){return{algorithm:e.id,parameters:{keyDerivationFunc:e.derivation,encryptionScheme:e.encryption}}},decode:function(e){var t=(0,i.expand)(c[e.algorithm]);return t.derivation=e.parameters.keyDerivationFunc,t.encryption=e.parameters.encryptionScheme,t}}),lt=(Le({"pbeWithSHAAndAES128-CBC":ut,"pbeWithSHAAndAES192-CBC":ut,"pbeWithSHAAndAES256-CBC":ut,"pbeWithSHA256AndAES128-CBC":ut,"pbeWithSHA256AndAES192-CBC":ut,"pbeWithSHA256AndAES256-CBC":ut,"id-sc-pbeWithGost3411AndGost28147":ut,"id-sc-pbeWithGost3411AndGost28147CFB":ut,"pbeWithSHAAnd3-KeyTripleDES-CBC":ut,"pbeWithSHAAnd2-KeyTripleDES-CBC":ut,"pbeWithSHAAnd128BitRC2-CBC":ut,"pbeWithSHAAnd40BitRC2-CBC":ut,pbeUnknownGost:ut,PBES2:ht}),Le({ecdsa:Ue,rsaEncryption:He,"id-sc-gost28147-gfb":$e,"id-Gost28147-89":Ze,"id-sc-gostR3410-2001":Ue,"id-GostR3410-2001":Ke,"id-GostR3410-94":Ke,"id-tc26-gost3410-12-256":Ke,"id-tc26-gost3410-12-512":Ke,"id-GostR3410-94-CryptoPro-ESDH":rt,"id-GostR3410-2001-CryptoPro-ESDH":rt,"id-tc26-agreement-gost-3410-12-256":rt,"id-tc26-agreement-gost-3410-12-512":rt,"id-sc-r3410-ESDH-r3411kdf":He,"id-Gost28147-89-None-KeyWrap":et,"id-Gost28147-89-CryptoPro-KeyWrap":et,"id-sc-cmsGostWrap":Me,"id-sc-cmsGost28147Wrap":Me,"pbeWithSHAAndAES128-CBC":ut,"pbeWithSHAAndAES192-CBC":ut,"pbeWithSHAAndAES256-CBC":ut,"pbeWithSHA256AndAES128-CBC":ut,"pbeWithSHA256AndAES192-CBC":ut,"pbeWithSHA256AndAES256-CBC":ut,"id-sc-pbeWithGost3411AndGost28147":ut,"id-sc-pbeWithGost3411AndGost28147CFB":ut,"pbeWithSHAAnd3-KeyTripleDES-CBC":ut,"pbeWithSHAAnd2-KeyTripleDES-CBC":ut,"pbeWithSHAAnd128BitRC2-CBC":ut,"pbeWithSHAAnd40BitRC2-CBC":ut,pbeUnknownGost:ut,PBES2:ht})),dt=$({keyDerivationFunc:ot,messageAuthScheme:it}),pt=Oe(dt,{encode:function(e){return{algorithm:e.id,parameters:{keyDerivationFunc:e.derivation,messageAuthScheme:e.hmac}}},decode:function(e){var t=(0,i.expand)(c[e.algorithm]);return t.derivation=e.parameters.keyDerivationFunc,t.hmac=e.parameters.messageAuthScheme,t}}),gt=(Le({PBMAC1:pt}),Le({"id-sc-gost28147-gfb":$e,"id-Gost28147-89":Ze,"pbeWithSHAAndAES128-CBC":ut,"pbeWithSHAAndAES192-CBC":ut,"pbeWithSHAAndAES256-CBC":ut,"pbeWithSHA256AndAES128-CBC":ut,"pbeWithSHA256AndAES192-CBC":ut,"pbeWithSHA256AndAES256-CBC":ut,"id-sc-pbeWithGost3411AndGost28147":ut,"id-sc-pbeWithGost3411AndGost28147CFB":ut,"pbeWithSHAAnd3-KeyTripleDES-CBC":ut,"pbeWithSHAAnd2-KeyTripleDES-CBC":ut,"pbeWithSHAAnd128BitRC2-CBC":ut,"pbeWithSHAAnd40BitRC2-CBC":ut,pbeUnknownGost:ut,PBES2:ht})),yt=ce,vt=yt(Q(he(X)),{encode:function(e){return v.encode(m(e))},decode:function(e){return m(v.decode(e))}}),mt=yt(Q(he(J)),{encode:function(e){var t=new Uint8Array(e.byteLength+1),r=m(e),n=e.byteLength/2;return t[0]=4,t.set(new Uint8Array(r,n,n),1),t.set(new Uint8Array(r,0,n),n+1),t.buffer},decode:function(e){C(!(1&e.byteLength));var t=new Uint8Array(e.byteLength-1),r=t.byteLength/2;return t.set(new Uint8Array(e,r+1,r),0),t.set(new Uint8Array(e,1,r),r),m(t)}}),bt=Q(he(J)),wt=$({algorithm:Ve,subjectPublicKey:Q},"PUBLIC KEY"),St=(R={"id-sc-gostR3410-2001":mt,"id-sc-gostR3410-94":vt,"id-GostR3410-2001":bt,"id-GostR3410-94":bt,"id-tc26-gost3410-12-256":bt,"id-tc26-gost3410-12-512":bt},ce(ee({algorithm:Ve,subjectPublicKey:N},"algorithm","subjectPublicKey")((function(e){return R[e.id]})),{encode:function(e){return{algorithm:e.algorithm,subjectPublicKey:e.buffer}},decode:function(e){return{algorithm:e.algorithm,type:"public",extractable:!0,usages:["verify","deriveKey","deriveBits"],buffer:e.subjectPublicKey}}})),Et=J,Ct=yt(Et(he(X)),{encode:function(e){return S(e,!0)},decode:function(e){return E(e,!0)}}),At=J,Bt=$({keyValueMask:At,keyValyePublicKey:J}),xt=fe({privateKey:Et(he(fe({keyValueMask:At,keyValueInfo:Bt},(function(e){return b(e)?"keyValueMask":"keyValueInfo"})))),keyValueMask:At},(function(e){return e.enclosed?"keyValueMask":"privateKey"})),Tt=function(e){return ee({version:Ae,privateKeyAlgorithm:Ve,privateKeyWrapped:yt(Et(he($({keyData:X,keyMac:X}))),{encode:function(e){var t=e.byteLength-4;return{keyData:S(new Uint8Array(e,0,t)),keyMac:S(new Uint8Array(e,t,4))}},decode:function(e){var t=E(e.keyData),r=E(e.keyMac),n=new Uint8Array(t.byteLength+r.byteLength);return n.set(new Uint8Array(t)),n.set(new Uint8Array(r),t.byteLength),n}}),attributes:N},"privateKeyAlgorithm","attributes")((function(t){return de(ie(0,re(xe({"id-sc-gostR3410-2001-publicKey":ue(e[t.id])}))))}))}({"id-sc-gostR3410-2001":mt,"id-sc-gostR3410-94":vt,"id-GostR3410-2001":bt,"id-GostR3410-94":bt,"id-GostR3410-2001DH":bt,"id-GostR3410-94DH":bt,"id-tc26-gost3410-12-256":bt,"id-tc26-gost3410-12-512":bt,"id-tc26-agreement-gost-3410-12-256":bt,"id-tc26-agreement-gost-3410-12-512":bt}),It=$({version:Ae,privateKeyAlgorithm:Ve,privateKey:Et,attributes:de(ie(0,re(xe)))},"PRIVATE KEY"),Ft=Ve,kt=Q,Rt=$({version:Ae,privateKeyAlgorithm:Ft,privateKey:Et,attributes:de(ie(0,re(xe))),publicKey:de(ie(1,re(kt)))}),Dt=se(Rt),_t=function(e){return ce(ee({version:Ae,privateKeyAlgorithm:Ve,privateKey:N,attributes:de(ie(0,re(xe)))},"privateKeyAlgorithm","privateKey")((function(t){return e[t.id]})),{encode:function(e){return{version:0,privateKeyAlgorithm:e.algorithm,privateKey:e.buffer}},decode:function(e){return{algorithm:e.privateKeyAlgorithm,type:"private",extractable:!0,usages:["sign","deriveKey","deriveBits"],buffer:b(e.privateKey)?e.privateKey:e.privateKey.keyValueMask}}})}({"id-sc-gostR3410-2001":Ct,"id-sc-gostR3410-94":Ct,"id-GostR3410-2001":xt,"id-GostR3410-94":xt,"id-GostR3410-2001DH":xt,"id-GostR3410-94DH":xt,"id-tc26-gost3410-12-256":xt,"id-tc26-gost3410-12-512":xt,"id-tc26-agreement-gost-3410-12-256":xt,"id-tc26-agreement-gost-3410-12-512":xt}),Pt=J,Nt=$({encryptionAlgorithm:lt,encryptedData:Pt},"ENCRYPTED PRIVATE KEY"),Ot=Q,Lt=X,Ut=$({cA:le(O,!1),pathLenConstraint:de(X)}),Kt=Q({digitalSignature:0,nonRepudiation:1,keyEncipherment:2,dataEncipherment:3,keyAgreement:4,keyCertSign:5,cRLSign:6,encipherOnly:7,decipherOnly:8}),Mt=te,Ht=se(Mt),jt=J,Vt=$({type:te,value:ie(0,ne(N))}),Gt=$({nameAssigner:de(ie(0,re(pe))),partyName:de(ie(1,re(pe)))}),qt=$({}),zt=fe({otherName:ie(0,re(Vt)),rfc822Name:ie(1,re(pe)),dNSName:ie(2,re(pe)),x400Address:ie(3,re(qt)),directoryName:ie(4,ne(Ee)),ediPartyName:ie(5,re(Gt)),uniformResourceIdentifier:ie(6,re(pe)),iPAddress:ie(7,re(J)),registeredID:ie(8,re(te))},(function(e){return"string"==typeof e||e instanceof String?e.indexOf("@")>=0?"rfc822Name":"dNSName":b(e)?"iPAddress":"directoryName"})),Wt=se(zt),Xt=$({keyIdentifier:de(ie(0,re(jt))),authorityCertIssuer:de(ie(1,re(Wt))),authorityCertSerialNumber:de(ie(2,re(Lt)))}),Yt=$({notBefore:de(ie(0,re(V))),notAfter:de(ie(1,re(V)))}),Jt=te,Qt=$({policyQualifierId:te,qualifier:N}),Zt=$({policyIdentifier:Jt,policyQualifiers:de(se(Qt))}),$t=$({issuerDomainPolicy:Jt,subjectDomainPolicy:Jt}),er=X,tr=se($({base:zt,minimum:le(ie(0,re(er)),0),maximum:de(ie(1,re(er)))})),rr=$({permittedSubtrees:de(ie(0,re(tr))),excludedSubtrees:de(ie(1,re(tr)))}),nr=X,ir=$({requireExplicitPolicy:de(ie(0,re(nr))),inhibitPolicyMapping:de(ie(1,re(nr)))}),ar=Q({unused:0,keyCompromise:1,cACompromise:2,affiliationChanged:3,superseded:4,cessationOfOperation:5,certificateHold:6,privilegeWithdrawn:7,aACompromise:8}),sr=fe({fullName:ie(0,re(Wt)),nameRelativeToCRLIssuer:ie(1,re(we))},(function(e){return e instanceof Array?"fullName":"nameRelativeToCRLIssuer"})),or=se($({distributionPoint:de(ie(0,ne(sr))),reasons:de(ie(1,re(ar))),cRLIssuer:de(ie(2,re(Wt)))})),cr=or,ur=$({accessMethod:te,accessLocation:zt}),fr=function(e,t){var r=F(ee({extnID:te,critical:le(O,!1),extnValue:function(e){return J(he(e))}},"extnID","extnValue")(e),{object:{get:function(){var e=this._get(r.super,"object");return e&&"object"===n(e.extnValue)&&this.defineValue(e.extnValue),e},set:function(e){this._set(r.super,"object",e),e&&e.extnValue&&(void 0!==e.extnValue.critical?this.critical=e.extnValue.critical:void 0===this.critical&&t&&(this.critical=t(this.extnID,e.extnValue)))}},extnValue:{get:function(){var e=this._get(r.super,"extnValue");return"object"===(void 0===e?"undefined":n(e))&&this.defineValue(e),e},set:function(e){this._set(r.super,"extnValue",e),e&&(void 0!==e.critical?this.critical=e.critical:void 0===this.critical&&t&&(this.critical=t(this.extnID,e)))}},defineValue:function(e){if("object"===(void 0===e?"undefined":n(e))&&!x(e,"critical")){var t=this;A(e,"critical",{get:function(){return t.critical},set:function(e){t.critical=e},enumerable:!0,configurable:!1})}}});return r},hr=$({signTool:H,cATool:H,signToolCert:H,cAToolCert:H}),lr=se(fr,{typeName:"extnID",valueName:"extnValue"}),dr=lr({authorityKeyIdentifier:Xt,subjectKeyIdentifier:jt,keyUsage:Kt,privateKeyUsagePeriod:Yt,certificatePolicies:se(Zt),policyMappings:se($t),subjectAltName:Wt,issuerAltName:Wt,subjectDirectoryAttributes:Te,basicConstraints:Ut,nameConstraints:rr,policyConstraints:ir,extKeyUsage:Ht,cRLDistributionPoints:or,inhibitAnyPolicy:nr,freshestCRL:cr,authorityInfoAccess:se(ur),subjectInfoAccess:se(ur),subjectSignTool:H,issuerSignTool:hr},(function(e,t){return"keyUsage"===e||"basicConstraints"===e&&void 0===t.pathLenConstraint})),pr=$({r:X,s:X}),gr=Z($({version:ie(0,ne(Ae)),serialNumber:Lt,signature:Ge,issuer:Ee,validity:Ce,subject:Ee,subjectPublicKeyInfo:wt,issuerUniqueID:de(ie(1,re(Ot))),subjectUniqueID:de(ie(2,re(Ot))),extensions:de(ie(3,ne(dr)))})),yr=$({tbsCertificate:gr,signatureAlgorithm:Ge,signatureValue:Q},"CERTIFICATE"),vr=dr,mr=xe({challengePassword:ue(pe),extensionRequest:ue(vr),msCertExtensions:ue(dr),extendedCertificateAttributes:ue(xe)}),br=Z($({version:X,subject:Ee,subjectPublicKeyInfo:wt,attributes:ie(0,re(mr))})),wr=$({requestInfo:br,signatureAlgorithm:Ge,signatureValue:Q},"CERTIFICATE REQUEST"),Sr=X,Er=Y({unspecified:0,keyCompromise:1,cACompromise:2,affiliationChanged:3,superseded:4,cessationOfOperation:5,certificateHold:6,removeFromCRL:8,privilegeWithdrawn:9,aACompromise:10}),Cr=lr({authorityKeyIdentifier:Xt,issuerAltName:Wt,cRLNumber:Sr,deltaCRLIndicator:Sr,issuingDistributionPoint:$({distributionPoint:de(ie(0,ne(sr))),onlyContainsUserCerts:le(ie(1,re(O)),!1),onlyContainsCACerts:le(ie(2,re(O)),!1),onlySomeReasons:de(ie(3,re(ar))),indirectCRL:le(ie(4,re(O)),!1),onlyContainsAttributeCerts:le(ie(5,re(O)),!1)}),freshestCRL:cr},(function(e){return"cRLNumber"===e})),Ar=lr({cRLReason:Er,instructionCode:te,invalidityDate:V,certificateIssuer:Wt}),Br=Z($({version:de(Ae),signature:Ge,issuer:Ee,thisUpdate:ge,nextUpdate:de(ge),revokedCertificates:de(se($({userCertificate:Lt,revocationDate:ge,crlEntryExtensions:de(Ar)}))),crlExtensions:de(ie(0,ne(Cr)))})),xr=$({tbsCertList:Br,signatureAlgorithm:Ge,signatureValue:Q},"CRL"),Tr=X,Ir=$({digestedObjectType:Y({publicKey:0,publicKeyCert:1,otherObjectTypes:2}),otherObjectTypeID:de(te),digestAlgorithm:qe,objectDigest:Q}),Fr=$({issuer:Wt,serial:Lt,issuerUID:de(Ot)}),kr=$({issuerName:de(Wt),baseCertificateID:de(ie(0,re(Fr))),objectDigestInfo:de(ie(1,re(Ir)))}),Rr=$({targetCertificate:Fr,targetName:de(zt),certDigestInfo:de(Ir)}),Dr=se(fe({targetName:ie(0,ne(zt)),targetGroup:ie(1,ne(zt)),targetCert:ie(2,re(Rr))})),_r=lr({auditIdentity:J,targetInformation:Dr,authorityKeyIdentifier:Xt,authorityInfoAccess:se(ur),cRLDistributionPoints:or,noRevAvail:z},(function(e){return"auditIdentity"===e||"targetInformation"===e})),Pr=$({baseCertificateID:de(ie(0,re(Fr))),entityName:de(ie(1,re(Wt))),objectDigestInfo:de(ie(2,re(Ir)))}),Nr=fe({v1Form:Wt,v2Form:ie(0,re(kr))},"v2Form"),Or=$({notBeforeTime:V,notAfterTime:V}),Lr=$({service:zt,ident:zt,authInfo:de(J)}),Ur=$({roleAuthority:de(ie(0,re(Wt))),roleName:ie(1,ne(zt))}),Kr=Q({unmarked:0,unclassified:1,restricted:2,confidential:3,secret:4,topSecret:5}),Mr=$({type:ie(0,re(te)),value:ie(1,re(N))}),Hr=$({policyId:ie(0,re(te)),classList:le(ie(1,re(Kr)),["unclassified"]),securityCategories:de(ie(2,re(oe(Mr))))}),jr=$({policyAuthority:de(ie(0,re(Wt))),values:se(fe({octets:J,oid:te,string:H},(function(e){return b?"octets":getIdentifier(e)?"oid":"string"})))}),Vr=Z($({version:Tr,holder:Pr,issuer:Nr,signature:Ge,serialNumber:Lt,attrCertValidityPeriod:Or,attributes:Te({authenticationInfo:oe(Lr),accessIdentity:oe(Lr),chargingIdentity:ue(jr),group:ue(jr),role:oe(Ur),clearance:oe(Hr)}),issuerUniqueID:de(Ot),extensions:de(_r)})),Gr=$({acinfo:Vr,signatureAlgorithm:Ge,signatureValue:Q},"ATTRIBUTE CERTIFICATE"),qr=J,zr=J,Wr=J,Xr=($({keyInfo:tt,entityUInfo:de(ie(0,ne(J))),suppPubInfo:ie(2,ne(J))}),ce($({encryptedKey:ze,maskKey:de(ie(0,re(ze))),macKey:We}),{encode:function(e){return{encryptedKey:new Uint8Array(new Uint8Array(e,0,32)).buffer,macKey:new Uint8Array(new Uint8Array(e,32,4)).buffer}},decode:function(e){var t=e.encryptedKey,r=e.maskKey,n=e.macKey;if(r)for(var i=new Int32Array(r),a=new Int32Array(t),s=0,o=i.length/a.length;s<o;s++)for(var c=0,u=a.length;c<u;c++)a[c]=a[c]+i[u*s+c]&4294967295;var f=new Uint8Array(t.byteLength+n.byteLength);return f.set(new Uint8Array(t),0),f.set(new Uint8Array(n),32),f.buffer}})),Yr=$({encryptionParamSet:Xe,ephemeralPublicKey:de(ie(0,re(St))),ukm:J}),Jr=ce($({sessionEncryptedKey:Xr,transportParameters:de(ie(0,re(Yr)))}),{encode:function(e){var t=e.algorithm;return{sessionEncryptedKey:e.sessionEncryptedKey,transportParameters:{encryptionParamSet:h.sBox[t.wrapping.sBox||"E-A"],ephemeralPublicKey:t.public,ukm:t.ukm}}},decode:function(e){return{algorithm:{wrapping:l[e.transportParameters.encryptionParamSet],ukm:e.transportParameters.ukm,public:e.transportParameters.ephemeralPublicKey},sessionEncryptedKey:e.sessionEncryptedKey}}}),Qr=ce($({sessionEncryptedKey:Xr,ukm:$({ephemeralPublicKey:St,addedukm:de(ie(0,ne(Wr)))})}),{encode:function(e){var t=e.algorithm;return{sessionEncryptedKey:e.sessionEncryptedKey,ukm:{ephemeralPublicKey:t.public,addedukm:t.ukm}}},decode:function(e){return{algorithm:{ukm:e.ukm.addedukm,public:e.ukm.ephemeralPublicKey},sessionEncryptedKey:e.sessionEncryptedKey}}}),Zr=(D={"id-sc-gostR3410-2001":Qr,"id-sc-gostR3410-94":Qr,"id-GostR3410-2001":Jr,"id-GostR3410-94":Jr,"id-tc26-gost3410-12-256":Jr,"id-tc26-gost3410-12-512":Jr,"id-GostR3410-94-CryptoPro-ESDH":Xr,"id-GostR3410-2001-CryptoPro-ESDH":Xr,"id-tc26-agreement-gost-3410-12-256":Xr,"id-tc26-agreement-gost-3410-12-512":Xr,"id-sc-r3410-ESDH-r3411kdf":Xr,"id-Gost28147-89-None-KeyWrap":Xr,"id-Gost28147-89-CryptoPro-KeyWrap":Xr,"id-sc-cmsGostWrap":Xr,"id-sc-cmsGost28147Wrap":Xr},function(e){var t=D[e.id];return t?he(t):N}),$r=Q({kccaSoftPassword:0,kccaReservePrimary:1,kccaPrimaryKeyAbsent:2,kccaFKCShared:3}),en=Q({pkaExportable:0,pkaUserProtect:1,pkaExchange:2,pkaEphemeral:3,pkaNonCachable:4,pkaDhAllowed:5}),tn=$({attributes:de(en),privateKeyAlgorithm:de(ie(0,re(Ve)))}),rn=$({path:L,hmac:We}),nn=Le,an=$({containerAlgoritmIdentifier:de(ie(0,re(Le))),containerName:de(L),attributes:$r,primaryPrivateKeyParameters:tn,hmacPassword:de(ie(2,re(We))),secondaryEncryptedPrivateKey:de(ie(3,re(Xr))),secondaryPrivateKeyParameters:de(ie(4,re(tn))),primaryCertificate:de(ie(5,re(J(he(yr))))),secondaryCertificate:de(ie(6,re(J(he(yr))))),encryptionContainerName:de(ie(7,re(L))),primaryCertificateLink:de(ie(8,re(rn))),secondaryCertificateLink:de(ie(9,re(rn))),primaryFP:de(ie(10,re(J))),secondaryFP:de(ie(11,re(J))),passwordPolicy:de(nn),containerSecurityLevel:de(X),extensions:de(ie(12,re(lr({keyValidity:$({notBefore:de(ie(0,re(V))),notAfter:de(ie(1,re(V)))})})))),secondaryEncryptionContainerName:de(ie(13,re(L)))}),sn=$({keyContainerContent:an,hmacKeyContainerContent:We}),on=$({containerName:L,extElem1:de(N)}),cn=$({primaryKey:ze,secondaryKey:de(ze),hmacKey:de(We)}),un=$({mask:ze,randomStatus:J,hmacRandom:We}),fn=$({keyClass:X,keyType:X,algorithm:de(ie(0,ne(Ve))),serialNumber:de(ie(1,ne(J))),addSerialNumber:de(ie(2,ne(J))),certSerialNumber:de(ie(3,ne(J))),subjectUID:de(ie(4,ne(J))),recipientUID:de(ie(5,ne(J))),validity:de(ie(6,ne(fe({validity:Ce,keyValidity:$({notBefore:de(ie(0,re(V))),notAfter:de(ie(1,re(V)))})},(function(){return"keyValidity"}))))),keyUID:de(ie(7,ne(Q))),flags:de(ie(10,ne(X)))}),hn=$({version:X,keyInfo:fn,defenceKeyInfo:fn,certificate:de(ie(0,ne(yr))),publicKey:de(ie(1,ne(J)))}),ln=X,dn=te,pn=ge,gn=J,yn=J,vn=J,mn=X,bn=se(mn),wn=$({bodyPartPath:bn,identifier:te,content:N}),Sn=xe({contentType:ue(dn),signingTime:ue(pn),messageDigest:ue(J)}),En=xe((function(e){return{countersignature:oe(Fn),unsignedData:oe(wn)}[e]})),Cn=Sn,An=xe,Bn=xe,xn=$({issuer:Ee,serialNumber:Lt}),Tn=fe({issuerAndSerialNumber:xn,subjectKeyIdentifier:ie(0,re(gn))},(function(e){return b(e)?"subjectKeyIdentifier":"issuerAndSerialNumber"})),In=$({version:ln,sid:Tn,digestAlgorithm:qe,signedAttrs:de(ie(0,re(Sn))),signatureAlgorithm:Ge,signatureValue:J,unsignedAttrs:de(ie(1,re(En)))}),Fn=In,kn=oe(In),Rn=oe(qe),Dn=Gr,_n=Z($({version:ln,certificate:yr,attributes:An})),Pn=$({extendedCertificateInfo:_n,signatureAlgorithm:Ge,signatureValue:Q}),Nn=$({otherCertFormat:te,otherCert:N}),On=Z($({version:X,subject:fe({baseCertificateID:ie(0,re(Fr)),subjectName:ie(1,re(Wt))},(function(e){return e.issuer?"baseCertificateID":"subjectName"})),issuer:Wt,signature:Ge,serialNumber:Lt,attCertValidityPeriod:Or,attributes:Te,issuerUniqueID:de(Ot),extensions:de(dr)})),Ln=$({acInfo:On,signatureAlgorithm:Ge,signatureValue:Q}),Un=$({eContentType:dn,eContent:de(ie(0,ne(J)))}),Kn=fe({certificate:yr,extendedCertificate:ie(0,re(Pn)),v1AttrCert:ie(1,re(Ln)),v2AttrCert:ie(2,re(Dn)),other:ie(3,re(Nn))},(function(e){return e.holder?"AttributeCertificateV2":e.certificate?"ExtendedCertificate":e.otherCertFormat?"other":"certificate"})),Mn=$({otherRevInfoFormat:te,otherRevInfo:N}),Hn=fe({crl:xr,other:ie(1,re(Mn))},(function(e){return e.otherRevInfoFormat?"other":"crl"})),jn=oe(Kn),Vn=oe(Hn),Gn=$({version:ln,digestAlgorithms:Rn,encapContentInfo:Un,certificates:de(ie(0,re(jn))),crls:de(ie(1,re(Vn))),signerInfos:kn}),qn=fe({issuerAndSerialNumber:xn,subjectKeyIdentifier:ie(0,re(gn))},(function(e){return b(e)?"subjectKeyIdentifier":"issuerAndSerialNumber"})),zn=$({version:ln,rid:qn,keyEncryptionAlgorithm:lt,encryptedKey:qr}),Wn=$({keyAttrId:te,keyAttr:de(N)}),Xn=$({subjectKeyIdentifier:gn,date:de(V),other:de(Wn)}),Yn=fe({issuerAndSerialNumber:xn,rKeyId:ie(0,re(Xn))},(function(e){return b(e)?"rKeyId":"issuerAndSerialNumber"})),Jn=se($({rid:Yn,encryptedKey:qr})),Qn=$({algorithm:Ve,publicKey:Q}),Zn=($({ephemeralPublicKey:Qn,addedukm:de(ie(0,ne(Wr)))}),fe({issuerAndSerialNumber:xn,subjectKeyIdentifier:ie(0,re(gn)),originatorKey:ie(1,re(Qn))},(function(e){return b(e)?"subjectKeyIdentifier":e.algorithm?"originatorKey":"issuerAndSerialNumber"}))),$n=$({version:ln,originator:ie(0,ne(Zn)),ukm:de(ie(1,ne(Wr))),keyEncryptionAlgorithm:lt,recipientEncryptedKeys:Jn}),ei=$({keyIdentifier:J,date:de(V),other:de(Wn)}),ti=$({version:ln,kekid:ei,keyEncryptionAlgorithm:lt,encryptedKey:qr}),ri=$({version:ln,friendlyName:de(ie(0,re(ot))),keyEncryptionAlgorithm:lt,encryptedKey:qr}),ni=$({oriType:te,oriValue:N}),ii=fe({ktri:zn,kari:ie(1,re($n)),kekri:ie(2,re(ti)),pwri:ie(3,re(ri)),ori:ie(4,re(ni))},(function(e){return e.rid?"ktri":e.originator?"kari":e.kekid?"kekri":e.oriType?"ori":"pwri"})),ai=$({certs:de(ie(0,re(jn))),crls:de(ie(1,re(Vn)))}),si=oe(ii),oi=$({contentType:dn,contentEncryptionAlgorithm:gt,encryptedContent:de(ie(0,re(zr)))}),ci=$({version:ln,originatorInfo:de(ie(0,re(ai))),recipientInfos:si,encryptedContentInfo:oi,unprotectedAttrs:de(ie(1,re(Bn)))}),ui=$({version:ln,digestAlgorithm:qe,encapContentInfo:Un,digest:yn}),fi=$({version:ln,encryptedContentInfo:oi,unprotectedAttrs:de(ie(1,re(Bn)))}),hi=$({version:ln,originatorInfo:de(ie(0,re(ai))),recipientInfos:si,macAlgorithm:it,digestAlgorithm:de(ie(1,qe)),encapContentInfo:Un,authAttrs:de(ie(2,re(Cn))),mac:vn,unauthAttrs:de(ie(3,re(An)))}),li=$({version:ln,originatorInfo:de(ie(0,re(ai))),recipientInfos:si,authEncryptedContentInfo:oi,authAttrs:de(ie(1,re(Cn))),mac:vn,unauthAttrs:de(ie(2,re(An)))}),di=fe({encrypted:fi,enveloped:ie(0,re(ci)),authEnveloped:ie(1,re(li))},(function(e){return e.encryptedContentInfo?e.recipientInfos?"enveloped":"encrypted":"authEnveloped"})),pi=ee({contentType:dn=te,content:function(e){return ie(0,ne(e))}},"contentType","content",void 0,"CMS")({data:J,signedData:Z(Gn),envelopedData:Z(ci),digestedData:Z(ui),encryptedData:Z(fi),authData:Z(hi),encryptedKeyPkg:Z(di),aKeyPackage:Z(Dt)}),gi=$({digestAlgorithm:qe,digest:yn}),yi=xe({friendlyName:ue(q),keyProviderNameAttr:ue(q),localKeyId:ue(J),certKeyIdentifierPropId:ue(J)}),vi=te,mi=te,bi=te,wi=It,Si=Nt,Ei=ee({certId:te,certValue:function(e){return ie(0,ne(e))}},"certId","certValue")({x509Certificate:J(he(yr)),sdsiCertificate:L},J),Ci=ee({crlId:mi,crlValue:function(e){return ie(0,ne(e))}},"crlId","crlValue")({x509CRL:J(he(xr))},J),Ai=ee({secretTypeId:bi,secretValue:function(e){return ie(0,ne(e))}},"secretTypeId","secretValue")({secret:J},J),Bi=se(ee({bagId:vi,bagValue:function(e){return ie(0,ne(e))},bagAttributes:de(yi)},"bagId","bagValue")((function(e){return{keyBag:wi,pkcs8ShroudedKeyBag:Si,certBag:Ei,crlBag:Ci,secretBag:Ai,safeContentsBag:Bi}[e]}))),xi=se(pi),Ti=$({mac:gi,macSalt:J,iterations:le(X,1)}),Ii=$({version:X,authSafe:pi,macData:de(Ti)},"PFX"),Fi=H,ki=H,Ri=$({issuer:zt,serialNumber:X}),Di=wt,_i=$({intendedAlg:de(ie(0,re(Le))),symmAlg:de(ie(1,re(Le))),encSymmKey:de(ie(2,re(Q))),keyAlg:de(ie(3,re(Le))),valueHint:de(ie(4,re(J))),encValue:Q}),Pi=J,Ni=(qr=fe({encryptedValue:_i,envelopedData:ie(0,re(ci))},(function(e){return e.encryptedContentInfo?"envelopedData":"encryptedValue"})),fe({encryptedPrivKey:ie(0,qr),keyGenParameters:ie(1,re(Pi)),archiveRemGenPrivKey:ie(2,re(O))})),Oi=$({pubMethod:X({dontCare:0,x500:1,web:2,ldap:3}),pubLocation:de(zt)}),Li=$({action:X({dontPublish:0,pleasePublish:1}),pubInfos:de(se(Oi))}),Ui=X({encrCert:0,challengeResp:1}),Ki=fe({thisMessage:ie(0,re(Q)),subsequentMessage:ie(1,re(Ui)),dhMAC:ie(2,re(Q)),agreeMAC:ie(3,re(Mi)),encryptedKey:ie(4,re(ci))}),Mi=($({salt:J,owf:Le,iterationCount:X,mac:Le}),$({algId:Le,value:Q})),Hi=$({authInfo:fe({sender:ie(0,ne(zt)),publicKeyMAC:Mi}),publicKey:wt}),ji=$({poposkInput:de(ie(0,Hi)),algorithmIdentifier:Le,signature:Q}),Vi=fe({raVerified:ie(0,re(z)),signature:ie(1,re(ji)),keyEncipherment:ie(2,re(Ki)),keyAgreement:ie(3,re(Ki))}),Gi=se(me({regToken:Fi,authenticator:ki,pkiPublicationInfo:Li,pkiArchiveOptions:Ni,oldCertID:Ri,protocolEncrKey:Di})),qi=$({notBefore:de(ie(0,re(ge))),notAfter:de(ie(1,re(ge)))}),zi=$({version:de(ie(0,re(Ae))),serialNumber:de(ie(1,re(X))),signingAlg:de(ie(2,re(Le))),issuer:de(ie(3,re(Ee))),validity:de(ie(4,re(qi))),subject:de(ie(5,re(Ee))),publicKey:de(ie(6,re(wt))),issuerUID:de(ie(7,re(Ot))),subjectUID:de(ie(8,re(Ot))),extensions:de(ie(9,re(lr)))}),Wi=$({certReqId:X,certTemplate:zi,controls:de(Gi)}),Xi=H,Yi=Wi,Ji=$({privateKey:It,identifier:de(fe({string:H,generalName:zt},(function(e){return"string"==typeof e||e instanceof String?"string":"generalName"})))}),Qi=$({certReq:Wi,popo:de(Vi),regInfo:de(se(me({utf8Pairs:Xi,certReq:Yi,encKeyWithID:Ji})))}),Zi=(se(Qi),$({pendToken:J,pendTime:V})),$i=X({success:0,failed:2,pending:3,noSupport:4,confirmRequired:5,popRequired:6,partial:7}),ea=X({badAlg:0,badMessageCheck:1,badRequest:2,badTime:3,badCertId:4,unsupportedExt:5,mustArchiveKeys:6,badIdentity:7,popRequired:8,popFailed:9,noKeyReuse:10,internalCAError:11,tryLater:12,authDataFail:13}),ta=$({cMCStatus:$i,bodyList:se(mn),statusString:de(H),otherInfo:de(fe({failInfo:ea,pendInfo:Zi}))}),ra=$({pkiDataReference:mn,certReferences:se(mn),extensions:se(fr)}),na=$({pkiDataBodyid:mn,bodyIds:se(mn)}),ia=$({issuerName:zt,serialNumber:X}),aa=$({issuerName:Ee,cRLName:de(zt),time:de(V),reasons:de(ar)}),sa=$({issuerName:Ee,serialNumber:X,reason:Er,invalidityDate:de(V),passphrase:de(J),comment:de(H)}),oa=$({bodyPartID:mn,thePOPAlgID:Le,thePOP:J}),ca=xn,ua=fe({bodyPartID:mn,bodyPartPath:bn}),fa=$({cMCStatus:$i,bodyList:se(ua),statusString:de(H),otherInfo:de(fe({failInfo:ea,pendInfo:Zi,extendedFailInfo:$({failInfoOID:te,failInfoValue:ve})}))}),ha=$({seqNumber:X,hashAlgorithm:Le,anchorHashes:se(J)}),la=mn,da=se(mn),pa=$({hashAlg:Le,certHashes:se(J),pubInfo:Li}),ga=$({pkiDataReference:bn,certReferences:da,replace:le(O,!0),certTemplate:zi}),ya=$({bodyList:se(ua)}),va=$({proofAlgID:Le,macAlgId:Le,witness:J}),ma=$({keyGenAlgorithm:Le,macAlgorithm:Le,witness:J}),ba=$({bodyPartID:mn,certificationRequest:wr}),wa=$({bodyPartID:mn,contentInfo:pi}),Sa=$({bodyPartID:mn,otherMsgType:te,otherMsgValue:N}),Ea=fe({tcr:ie(0,re(ba)),crm:ie(1,re(Qi)),orm:ie(2,re($({bodyPartID:mn,requestMessageType:te,requestMessageValue:N})))}),Ca=$({request:Ea,cms:pi,thePOPAlgID:Le,witnessAlgID:Le,witness:J}),Aa=ee({bodyPartID:mn,attrType:te,attrValues:function(e){return oe(e)}},"attrType","attrValues",ve)({statusInfo:ta,identification:H,identityProof:J,dataReturn:J,transactionId:X,senderNonce:J,recipientNonce:J,addExtensions:ra,encryptedPOP:Ca,decryptedPOP:oa,lraPOPWitness:na,getCert:ia,getCRL:aa,revokeRequest:sa,regInfo:J,responseInfo:J,queryPending:J,popLinkRandom:J,popLinkWitness:J,confirmCertAcceptance:ca,statusInfoV2:fa,trustedAnchors:ha,authPublish:la,batchRequests:da,batchResponses:da,publishCert:pa,modCertTemplate:ga,controlProcessed:ya,popLinkWitnessV2:ma,identityProofV2:va}),Ba=$({controlSequence:se(Aa),reqSequence:se(Ea),cmsSequence:se(wa),otherMsgSequence:se(Sa)},"PKI REQUEST"),xa=$({controlSequence:se(Aa),cmsSequence:se(wa),otherMsgSequence:se(Sa)},"PKI RESPONSE");function Ta(){}Ta.prototype={GostPrivateKeyInfo:_t,GostSubjectPublicKeyInfo:St,GostKeyContainer:sn,GostKeyContainerName:on,GostPrivateKeys:cn,GostPrivateMasks:un,ViPNetInfo:hn,GostSignature:pr,GostEncryptedKey:Zr,GostWrappedPrivateKey:Tt,PrivateKeyInfo:It,EncryptedPrivateKeyInfo:Nt,SubjectPublicKeyInfo:wt,TBSCertificate:gr,Certificate:yr,CertificationRequestInfo:br,CertificationRequest:wr,TBSCertList:Br,CertificateList:xr,AttributeCertificateInfo:Vr,AttributeCertificate:Gr,SignedAttributes:Sn,UnsignedAttributes:En,ContentInfo:pi,SafeContents:Bi,AuthenticatedSafe:xi,PFX:Ii,PKIData:Ba,PKIResponse:xa},t.gostASN1Instance=new Ta},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function i(){for(var e={},t=0,r=arguments.length;t<r;t++){var i=arguments[t];if("object"===(void 0===i?"undefined":n(i)))for(var a in i)e[a]=i[a]}return e}t.GostSecurity=l;var a={"1.2.643.2.2":"CryptoPro","1.2.643.2.2.3":"id-GostR3411-94-with-GostR3410-2001","1.2.643.2.2.4":"id-GostR3411-94-with-GostR3410-94","1.2.643.2.2.9":"id-GostR3411-94","1.2.643.2.2.10":"id-HMACGostR3411-94","1.2.643.2.2.13.0":"id-Gost28147-89-None-KeyWrap","1.2.643.2.2.13.1":"id-Gost28147-89-CryptoPro-KeyWrap","1.2.643.2.2.14.0":"id-Gost28147-89-None-KeyMeshing","1.2.643.2.2.14.1":"id-Gost28147-89-CryptoPro-KeyMeshing","1.2.643.2.2.19":"id-GostR3410-2001","1.2.643.2.2.20":"id-GostR3410-94","1.2.643.2.2.20.1":"id-GostR3410-94-a","1.2.643.2.2.20.2":"id-GostR3410-94-aBis","1.2.643.2.2.20.3":"id-GostR3410-94-b","1.2.643.2.2.20.4":"id-GostR3410-94-bBis","1.2.643.2.2.21":"id-Gost28147-89","1.2.643.2.2.22":"id-Gost28147-89-MAC","1.2.643.2.2.30.0":"id-GostR3411-94-TestParamSet","1.2.643.2.2.30.1":"id-GostR3411-94-CryptoProParamSet","1.2.643.2.2.30.2":"id-GostR3411-94-CryptoPro-B-ParamSet","1.2.643.2.2.30.3":"id-GostR3411-94-CryptoPro-C-ParamSet","1.2.643.2.2.30.4":"id-GostR3411-94-CryptoPro-D-ParamSet","1.2.643.2.2.31.0":"id-Gost28147-89-TestParamSet","1.2.643.2.2.31.1":"id-Gost28147-89-CryptoPro-A-ParamSet","1.2.643.2.2.31.2":"id-Gost28147-89-CryptoPro-B-ParamSet","1.2.643.2.2.31.3":"id-Gost28147-89-CryptoPro-C-ParamSet","1.2.643.2.2.31.4":"id-Gost28147-89-CryptoPro-D-ParamSet","1.2.643.2.2.31.5":"id-Gost28147-89-CryptoPro-Oscar-1-1-ParamSet","1.2.643.2.2.31.6":"id-Gost28147-89-CryptoPro-Oscar-1-0-ParamSet","1.2.643.2.2.31.7":"id-Gost28147-89-CryptoPro-RIC-1-ParamSet ","1.2.643.2.2.31.12":"id-Gost28147-89-CryptoPro-tc26-1","1.2.643.2.2.31.13":"id-Gost28147-89-CryptoPro-tc26-2","1.2.643.2.2.31.14":"id-Gost28147-89-CryptoPro-tc26-3","1.2.643.2.2.31.15":"id-Gost28147-89-CryptoPro-tc26-4","1.2.643.2.2.31.16":"id-Gost28147-89-CryptoPro-tc26-5","1.2.643.2.2.31.17":"id-Gost28147-89-CryptoPro-tc26-6","1.2.643.2.2.32.0":"id-GostR3410-94-TestParamSet","1.2.643.2.2.32.2":"id-GostR3410-94-CryptoPro-A-ParamSet","1.2.643.2.2.32.3":"id-GostR3410-94-CryptoPro-B-ParamSet","1.2.643.2.2.32.4":"id-GostR3410-94-CryptoPro-C-ParamSet","1.2.643.2.2.32.5":"id-GostR3410-94-CryptoPro-D-ParamSet","1.2.643.2.2.33.1":"id-GostR3410-94-CryptoPro-XchA-ParamSet","1.2.643.2.2.33.2":"id-GostR3410-94-CryptoPro-XchB-ParamSet","1.2.643.2.2.33.3":"id-GostR3410-94-CryptoPro-XchC-ParamSet","1.2.643.2.2.34.2":"temporaryAccessToRC","1.2.643.2.2.34.3":"internetContentSignature","1.2.643.2.2.34.4":"adminRC","1.2.643.2.2.34.5":"operatorRC","1.2.643.2.2.34.6":"userRC","1.2.643.2.2.34.7":"clientRC","1.2.643.2.2.34.8":"serverRC","1.2.643.2.2.34.9":"sysAdminRC","1.2.643.2.2.34.10":"arcAdminRC","1.2.643.2.2.34.11":"authorityPersonRC","1.2.643.2.2.34.12":"clientCC","1.2.643.2.2.34.13":"sysAdminCC","1.2.643.2.2.34.14":"arcAdminCC","1.2.643.2.2.34.15":"accessIPSecCA","1.2.643.2.2.34.16":"auditAdminHSM","1.2.643.2.2.34.21":"adminHSM","1.2.643.2.2.34.22":"serverAdminHSH","1.2.643.2.2.34.24":"winlogonCA","1.2.643.2.2.34.25":"timestampServiceUser","1.2.643.2.2.34.26":"statusServiceUser","1.2.643.2.2.34.27":"arcAdminHSM","1.2.643.2.2.34.28":"auditorHSM","1.2.643.2.2.35.0":"id-GostR3410-2001-CryptoPro-TestParamSet","1.2.643.2.2.35.1":"id-GostR3410-2001-CryptoPro-A-ParamSet","1.2.643.2.2.35.2":"id-GostR3410-2001-CryptoPro-B-ParamSet","1.2.643.2.2.35.3":"id-GostR3410-2001-CryptoPro-C-ParamSet","1.2.643.2.2.36.0":"id-GostR3410-2001-CryptoPro-XchA-ParamSet","1.2.643.2.2.36.1":"id-GostR3410-2001-CryptoPro-XchB-ParamSet","1.2.643.2.2.37.1":"id-CryptoPro-GostPrivateKeys-V1","1.2.643.2.2.37.2":"id-CryptoPro-GostPrivateKeys-V2","1.2.643.2.2.37.2.1":"id-CryptoPro-GostPrivateKeys-V2-Full","1.2.643.2.2.37.2.2":"id-CryptoPro-GostPrivateKeys-V2-PartOf","1.2.643.2.2.37.3.1":"intermediateCertificates","1.2.643.2.2.37.3.2":"trustedCertificatesSignature","1.2.643.2.2.37.3.3":"trustedCertificatesExchange","1.2.643.2.2.37.3.10":"keyValidity","1.2.643.2.2.38.1":"personalBaseProlicy","1.2.643.2.2.38.2":"networkBasePolicy","1.2.643.2.2.47.1":"id-CryptoPro-ocsp-treats-exp-key-or-exp-cert-rev","1.2.643.2.2.47.2":"id-CryptoPro-ocsp-crl-locator","1.2.643.2.2.47.3":"id-CryptoPro-ocsp-instant-revocation-indicator","1.2.643.2.2.47.4":"id-CryptoPro-ocsp-revocation-announcement-reference","1.2.643.2.2.47.5":"id-CryptoPro-ocsp-historical-request","1.2.643.2.2.49.2":"limitedLicense","1.2.643.2.2.96":"id-GostR3410-2001-CryptoPro-ESDH","1.2.643.2.2.97":"id-GostR3410-94-CryptoPro-ESDH","1.2.643.2.2.98":"id-GostR3410-2001DH","1.2.643.2.2.99":"id-GostR3410-94DH","1.2.643.2.45.1.1.1":"signatureComment","1.2.643.2.45.1.1.2":"resourceName","1.2.643.2.45.1.1.3":"signatureUsage","1.2.643.3.131.1.1":"INN","1.2.643.3.141.1.1":"RNS FSS","1.2.643.3.141.1.2":"KP FSS","1.2.643.7.1":"tc26","1.2.643.7.1.1.1.1":"id-tc26-gost3410-12-256","1.2.643.7.1.1.1.2":"id-tc26-gost3410-12-512","1.2.643.7.1.1.2.1":"id-tc26-gost3411-94","1.2.643.7.1.1.2.2":"id-tc26-gost3411-12-256","1.2.643.7.1.1.2.3":"id-tc26-gost3411-12-512","1.2.643.7.1.1.3.1":"id-tc26-signwithdigest-gost3410-12-94","1.2.643.7.1.1.3.2":"id-tc26-signwithdigest-gost3410-12-256","1.2.643.7.1.1.3.3":"id-tc26-signwithdigest-gost3410-12-512","1.2.643.7.1.1.4.1":"id-tc26-hmac-gost-3411-12-256","1.2.643.7.1.1.4.2":"id-tc26-hmac-gost-3411-12-512","1.2.643.7.1.1.6.1":"id-tc26-agreement-gost-3410-12-256","1.2.643.7.1.1.6.2":"id-tc26-agreement-gost-3410-12-512","1.2.643.7.1.2.1.1.0":"id-tc26-gost-3410-12-256-paramSetTest","1.2.643.7.1.2.1.1.1":"id-tc26-gost-3410-12-256-paramSetA","1.2.643.7.1.2.1.1.2":"id-tc26-gost-3410-12-256-paramSetB","1.2.643.7.1.2.1.2.0":"id-tc26-gost-3410-12-512-paramSetTest","1.2.643.7.1.2.1.2.1":"id-tc26-gost-3410-12-512-paramSetA","1.2.643.7.1.2.1.2.2":"id-tc26-gost-3410-12-512-paramSetB","1.2.643.7.1.2.1.2.3":"id-tc26-gost-3410-12-512-paramSetC","1.2.643.7.1.2.1.2.4":"id-tc26-gost-3410-12-512-paramSetD","1.2.643.7.1.2.5.1.1":"id-tc26-gost-28147-param-Z","1.2.643.100.1":"OGRN","1.2.643.100.2.1":"SMEV-person","1.2.643.100.2.2":"SMEV-government","1.2.643.100.3":"SNILS","1.2.643.100.4":"KPP","1.2.643.100.5":"OGRNIP","1.2.643.100.6":"internal-government","1.2.643.100.111":"subjectSignTool","1.2.643.100.112":"issuerSignTool","1.2.643.100.113.1":"signToolClassKC1","1.2.643.100.113.2":"signToolClassKC2","1.2.643.100.113.3":"signToolClassKC3","1.2.643.100.113.4":"signToolClassKB1","1.2.643.100.113.5":"signToolClassKB2","1.2.643.100.113.6":"signToolClassKA1","1.2.643.100.114.1":"issuerToolClassKC1","1.2.643.100.114.2":"issuerToolClassKC2","1.2.643.100.114.3":"issuerToolClassKC3","1.2.643.100.114.4":"issuerToolClassKB2","1.2.643.100.114.5":"issuerToolClassKB1","1.2.643.100.114.6":"issuerToolClassKA1","1.2.840.10040.4":"x9cm","1.2.840.10040.4.1":"dsa","1.2.840.10040.4.3":"dsa-with-SHA1","1.2.840.10045":"ansi-x962","1.2.840.10045.1":"id-fieldType","1.2.840.10045.1.1":"id-prime-Field","1.2.840.10045.1.2":"id-characteristic-two-field","1.2.840.10045.2.1":"ecPublicKey","1.2.840.10045.3.0":"characteristicTwo","1.2.840.10045.3.1.1":"secp192r1","1.2.840.10045.3.1.2":"prime192v2","1.2.840.10045.3.1.3":"prime192v3","1.2.840.10045.3.1.4":"prime239v1","1.2.840.10045.3.1.5":"prime239v2","1.2.840.10045.3.1.6":"prime239v3","1.2.840.10045.3.1.7":"secp256r1","1.2.840.10045.4":"ecdsa","1.2.840.10045.4.1":"ecdsa-with-SHA1","1.2.840.10045.4.2":"ecdsa-with-Recommended","1.2.840.10045.4.4":"ecdsa-with-SHA2","1.2.840.10045.4.4.1":"ecdsa-with-SHA224","1.2.840.10045.4.4.2":"ecdsa-with-SHA256","1.2.840.10045.4.4.3":"ecdsa-with-SHA384","1.2.840.10045.4.4.4":"ecdsa-with-SHA512","1.2.840.113533.7.66.13":"PasswordBasedMac","1.3.6.1.4.1.22554.1.1.2.1.2":"pbeWithSHAAndAES128-CBC","1.3.6.1.4.1.22554.1.1.2.1.22":"pbeWithSHAAndAES192-CBC","1.3.6.1.4.1.22554.1.1.2.1.42":"pbeWithSHAAndAES256-CBC","1.3.6.1.4.1.22554.1.2.1.2.1.2":"pbeWithSHA256AndAES128-CBC","1.3.6.1.4.1.22554.1.2.1.2.1.22":"pbeWithSHA256AndAES192-CBC","1.3.6.1.4.1.22554.1.2.1.2.1.42":"pbeWithSHA256AndAES256-CBC","1.2.840.113549":"rsa","1.2.840.113549.1.1.1":"rsaEncryption","1.2.840.113549.1.1.2":"md2withRSAEncryption","1.2.840.113549.1.1.3":"md4withRSAEncryption","1.2.840.113549.1.1.4":"md5withRSAEncryption","1.2.840.113549.1.1.5":"sha1withRSAEncryption","1.2.840.113549.1.1.7":"rsaes-oaep","1.2.840.113549.1.1.8":"mgf1","1.2.840.113549.1.1.9":"pSpecified","1.2.840.113549.1.1.10":"rsassa-pss","1.2.840.113549.1.1.11":"sha256withRSAEncryption","1.2.840.113549.1.1.12":"sha384withRSAEncryption","1.2.840.113549.1.1.13":"sha512withRSAEncryption","1.2.840.113549.1.2.7":"hmacWithSHA1","1.2.840.113549.1.2.8":"hmacWithSHA224","1.2.840.113549.1.2.9":"hmacWithSHA256","1.2.840.113549.1.2.10":"hmacWithSHA384","1.2.840.113549.1.2.11":"hmacWithSHA512","1.2.840.113549.1.3.1":"dhKeyAgreement","1.2.840.113549.1.5.12":"PBKDF2","1.2.840.113549.1.5.13":"PBES2","1.2.840.113549.1.5.14":"PBMAC1","1.2.840.113549.1.7.1":"data","1.2.840.113549.1.7.2":"signedData","1.2.840.113549.1.7.3":"envelopedData","1.2.840.113549.1.7.4":"signedAndEnvelopedData","1.2.840.113549.1.7.5":"digestedData","1.2.840.113549.1.7.6":"encryptedData","1.2.840.113549.1.9.1":"emailAddress","1.2.840.113549.1.9.2":"unstructuredName","1.2.840.113549.1.9.3":"contentType","1.2.840.113549.1.9.4":"messageDigest","1.2.840.113549.1.9.5":"signingTime","1.2.840.113549.1.9.6":"countersignature","1.2.840.113549.1.9.7":"challengePassword","1.2.840.113549.1.9.8":"unstructuredAddress","1.2.840.113549.1.9.9":"extendedCertificateAttributes","1.2.840.113549.1.9.10":"issuerAndSerialNumber","1.2.840.113549.1.9.11":"passwordCheck","1.2.840.113549.1.9.12":"publicKey","1.2.840.113549.1.9.13":"signingDescription","1.2.840.113549.1.9.14":"extensionRequest","1.2.840.113549.1.9.15":"sMimeCapabilities","1.2.840.113549.1.9.16":"sMimeObjectIdentifierRegistry","1.2.840.113549.1.9.16.1.2":"authData","1.2.840.113549.1.9.16.1.4 ":"timestampToken","1.2.840.113549.1.9.16.1.17 ":"firmwareLoadReceipt","1.2.840.113549.1.9.16.1.21":"encKeyWithID","1.2.840.113549.1.9.16.1.23":"authEnvelopedData","1.2.840.113549.1.9.16.2":"sMimeAttributes","1.2.840.113549.1.9.16.2.1":"receiptRequest","1.2.840.113549.1.9.16.2.12":"signingCertificate","1.2.840.113549.1.9.16.2.14":"timeStampToken","1.2.840.113549.1.9.16.2.2":"securityLabel","1.2.840.113549.1.9.16.2.3":"mlExpansionHistory","1.2.840.113549.1.9.16.2.34":"unsignedData","1.2.840.113549.1.9.16.2.47":"signingCertificateV2","1.2.840.113549.1.9.16.3.5":"ESDH","1.2.840.113549.1.9.20":"friendlyName","1.2.840.113549.1.9.21":"localKeyId","1.2.840.113549.1.9.22":"certTypes","1.2.840.113549.1.9.22.1":"x509Certificate","1.2.840.113549.1.9.22.2":"sdsiCertificate","1.2.840.113549.1.9.23":"crlTypes","1.2.840.113549.1.9.23.1":"x509CRL","1.2.840.113549.1.9.24":"secretTypes","1.2.840.113549.1.9.24.1":"secret","1.2.840.113549.1.9.25.1":"pkcs15Token","1.2.840.113549.1.9.25.2":"encryptedPrivateKeyInfo","1.2.840.113549.1.9.25.3":"randomNonce","1.2.840.113549.1.9.25.4":"sequenceNumber","1.2.840.113549.1.9.25.5":"pkcs7PDU","1.2.840.113549.1.9.26.1":"pkcs9String","1.2.840.113549.1.9.26.2":"signingTimeString","1.2.840.113549.1.9.27.1":"caseIgnoreMatch","1.2.840.113549.1.9.27.2":"signingTimeMatch","1.2.840.113549.1.12.0.1":"pkcs-12","1.2.840.113549.1.12.1":"pbe","1.2.840.113549.1.12.1.1":"pbeWithSHAAnd128BitRC4","1.2.840.113549.1.12.1.2":"pbeWithSHAAnd40BitRC4","1.2.840.113549.1.12.1.3":"pbeWithSHAAnd3-KeyTripleDES-CBC","1.2.840.113549.1.12.1.4":"pbeWithSHAAnd2-KeyTripleDES-CBC","1.2.840.113549.1.12.1.5":"pbeWithSHAAnd128BitRC2-CBC","1.2.840.113549.1.12.1.6":"pbeWithSHAAnd40BitRC2-CBC","1.2.840.113549.1.12.1.80":"pbeUnknownGost","1.2.840.113549.1.12.2.1":"pkcs8-key-shrouding","1.2.840.113549.1.12.3.1":"keyBagId","1.2.840.113549.1.12.3.2":"certAndCRLBagId","1.2.840.113549.1.12.3.3":"secretBagId","1.2.840.113549.1.12.3.4":"safeContentsId","1.2.840.113549.1.12.3.5":"pkcs-8ShroudedKeyBagId","1.2.840.113549.1.12.4.1":"x509CertCRLBagId","1.2.840.113549.1.12.4.2":"pkcs-12-SDSICertBag","1.2.840.113549.1.12.10.1.1":"keyBag","1.2.840.113549.1.12.10.1.2":"pkcs8ShroudedKeyBag","1.2.840.113549.1.12.10.1.3":"certBag","1.2.840.113549.1.12.10.1.4":"crlBag","1.2.840.113549.1.12.10.1.5":"secretBag","1.2.840.113549.1.12.10.1.6":"safeContentsBag","1.2.840.113549.2.5":"md-5","1.2.840.113549.3.7":"des-EDE3-CBC","1.3.132.0.34":"secp384r1","1.3.132.0.35":"secp521r1","1.3.132.112":"ecDH","1.3.14.3.2.26":"sha1","1.3.6.1.4.1.311.2.1.14":"msCertExtensions","1.3.6.1.4.1.311.17.1":"keyProviderNameAttr","1.3.6.1.4.1.311.17.2":"localMachineKeyset","1.3.6.1.4.1.311.17.3.20":"certKeyIdentifierPropId","1.3.6.1.4.1.5849":"SignalCom","1.3.6.1.4.1.5849.1.1.1":"id-sc-gost28147-ecb","1.3.6.1.4.1.5849.1.1.2":"id-sc-gost28147-gamma","1.3.6.1.4.1.5849.1.1.3":"id-sc-gost28147-gfb","1.3.6.1.4.1.5849.1.1.4":"id-sc-gost28147-mac","1.3.6.1.4.1.5849.1.1.5":"id-sc-gostR3410-94","1.3.6.1.4.1.5849.1.1.6.1.1.1":"id-sc-gostR3410-94-default","1.3.6.1.4.1.5849.1.1.6.1.1.2":"id-sc-gostR3410-94-test","1.3.6.1.4.1.5849.1.2.1":"id-sc-gostR3411-94","1.3.6.1.4.1.5849.1.3.1":"id-sc-gostR3411-94-with-gostR3410-94","1.3.6.1.4.1.5849.1.3.2":"id-sc-gostR3411-94-with-gostR3410-2001","1.3.6.1.4.1.5849.1.4.1":"id-sc-cmsGostWrap","1.3.6.1.4.1.5849.1.4.2":"id-sc-cmsGost28147Wrap","1.3.6.1.4.1.5849.1.5.1":"id-sc-pbeWithGost3411AndGost28147","1.3.6.1.4.1.5849.1.5.2":"id-sc-pbeWithGost3411AndGost28147CFB","1.3.6.1.4.1.5849.1.6.2":"id-sc-gostR3410-2001","1.3.6.1.4.1.5849.1.7.2":"id-sc-hmacWithGostR3411","1.3.6.1.4.1.5849.1.8.1":"id-sc-r3410-ESDH-r3411kdf","1.3.6.1.4.1.5849.1.8.3":"id-sc-ecdh-singlePass-cofactor-r3411kdf","1.3.6.1.4.1.5849.2.2.1":"id-sc-gostR3410-2001-publicKey","1.3.6.1.5.5.7.0.12":"attribute-cert","1.3.6.1.5.5.7.1.1":"authorityInfoAccess","1.3.6.1.5.5.7.1.4":"auditIdentity","1.3.6.1.5.5.7.1.6":"aaControls","1.3.6.1.5.5.7.1.10":"ac-proxying","1.3.6.1.5.5.7.1.11":"subjectInfoAccess","1.3.6.1.5.5.7.3.1":"serverAuth","1.3.6.1.5.5.7.3.2":"clientAuth","1.3.6.1.5.5.7.3.3":"codeSigning","1.3.6.1.5.5.7.3.4":"emailProtection","1.3.6.1.5.5.7.3.5":"ipsecEndSystem","1.3.6.1.5.5.7.3.6":"ipsecTunnel","1.3.6.1.5.5.7.3.7":"ipsecUser","1.3.6.1.5.5.7.3.8":"timeStamping","1.3.6.1.5.5.7.3.9":"OCSPSigning","1.3.6.1.5.5.7.5.1":"regCtrl","1.3.6.1.5.5.7.5.1.1":"regToken","1.3.6.1.5.5.7.5.1.2":"authenticator","1.3.6.1.5.5.7.5.1.3":"pkiPublicationInfo","1.3.6.1.5.5.7.5.1.4":"pkiArchiveOptions","1.3.6.1.5.5.7.5.1.5":"oldCertID","1.3.6.1.5.5.7.5.1.6":"protocolEncrKey","1.3.6.1.5.5.7.5.2":"regInfoAttr","1.3.6.1.5.5.7.5.2.1":"UTF8Pairs","1.3.6.1.5.5.7.5.2.2":"certReq","1.3.6.1.5.5.7.6.2":"noSignature","1.3.6.1.5.5.7.7.1":"statusInfo","1.3.6.1.5.5.7.7.2":"identification","1.3.6.1.5.5.7.7.3":"identityProof","1.3.6.1.5.5.7.7.4":"dataReturn","1.3.6.1.5.5.7.7.5":"transactionId","1.3.6.1.5.5.7.7.6":"senderNonce","1.3.6.1.5.5.7.7.7":"recipientNonce","1.3.6.1.5.5.7.7.8":"addExtensions","1.3.6.1.5.5.7.7.9":"encryptedPOP","1.3.6.1.5.5.7.7.10":"decryptedPOP","1.3.6.1.5.5.7.7.11":"lraPOPWitness","1.3.6.1.5.5.7.7.15":"getCert","1.3.6.1.5.5.7.7.16":"getCRL","1.3.6.1.5.5.7.7.17":"revokeRequest","1.3.6.1.5.5.7.7.18":"regInfo","1.3.6.1.5.5.7.7.19":"responseInfo","1.3.6.1.5.5.7.7.21":"queryPending","1.3.6.1.5.5.7.7.22":"popLinkRandom","1.3.6.1.5.5.7.7.23":"popLinkWitness","1.3.6.1.5.5.7.7.24":"confirmCertAcceptance","1.3.6.1.5.5.7.7.25":"statusInfoV2","1.3.6.1.5.5.7.7.26":"trustedAnchors","1.3.6.1.5.5.7.7.27":"authPublish","1.3.6.1.5.5.7.7.28":"batchRequests","1.3.6.1.5.5.7.7.29":"batchResponses","1.3.6.1.5.5.7.7.30":"publishCert","1.3.6.1.5.5.7.7.31":"modCertTemplate","1.3.6.1.5.5.7.7.32":"controlProcessed","1.3.6.1.5.5.7.7.33":"popLinkWitnessV2","1.3.6.1.5.5.7.7.34":"identityProofV2","1.3.6.1.5.5.7.9.1":"dateOfBirth","1.3.6.1.5.5.7.9.2":"placeOfBirth","1.3.6.1.5.5.7.9.3":"gender","1.3.6.1.5.5.7.9.4":"countryOfCitizenship","1.3.6.1.5.5.7.9.5":"countryOfResidence","1.3.6.1.5.5.7.10.1":"authenticationInfo","1.3.6.1.5.5.7.10.2":"accessIdentity","1.3.6.1.5.5.7.10.3":"chargingIdentity","1.3.6.1.5.5.7.10.4":"group","1.3.6.1.5.5.7.10.6":"encAttrs","1.3.6.1.5.5.7.12.2":"PKIData","1.3.6.1.5.5.7.12.3":"PKIResponse","1.3.6.1.5.5.7.48.1.1":"ocsp-basic","1.3.6.1.5.5.7.48.1.2":"ocsp-nonce","1.3.6.1.5.5.7.48.1.3":"ocsp-crl","1.3.6.1.5.5.7.48.1.4":"ocsp-response","1.3.6.1.5.5.7.48.1.5":"ocsp-nocheck","1.3.6.1.5.5.7.48.1.6":"ocsp-archive-cutoff","1.3.6.1.5.5.7.48.1.7":"ocsp-service-locator","2.16.840.1.101.2.1.2.78.2":"encryptedKeyPkg","2.16.840.1.101.2.1.2.78.3":"keyPackageReceipt","2.16.840.1.101.2.1.2.78.5":"aKeyPackage","2.16.840.1.101.2.1.2.78.6":"keyPackageError","2.16.840.1.101.3.4":"nistAlgorithms","2.16.840.1.101.3.4.1":"aes","2.16.840.1.101.3.4.1.1":"aes128-ECB","2.16.840.1.101.3.4.1.2":"aes128-CBC","2.16.840.1.101.3.4.1.3":"aes128-OFB","2.16.840.1.101.3.4.1.4":"aes128-CFB","2.16.840.1.101.3.4.1.5":"aes128-wrap","2.16.840.1.101.3.4.1.6":"aes128-GCM","2.16.840.1.101.3.4.1.7":"aes128-CCM","2.16.840.1.101.3.4.1.8":"aes128-wrap-pad","2.16.840.1.101.3.4.1.21":"aes192-ECB","2.16.840.1.101.3.4.1.22":"aes192-CBC","2.16.840.1.101.3.4.1.23":"aes192-OFB","2.16.840.1.101.3.4.1.24":"aes192-CFB","2.16.840.1.101.3.4.1.25":"aes192-wrap","2.16.840.1.101.3.4.1.26":"aes192-GCM","2.16.840.1.101.3.4.1.27":"aes192-CCM","2.16.840.1.101.3.4.1.28":"aes192-wrap-pad","2.16.840.1.101.3.4.1.41":"aes256-ECB","2.16.840.1.101.3.4.1.42":"aes256-CBC","2.16.840.1.101.3.4.1.43":"aes256-OFB","2.16.840.1.101.3.4.1.44":"aes256-CFB","2.16.840.1.101.3.4.1.45":"aes256-wrap","2.16.840.1.101.3.4.1.46":"aes256-GCM","2.16.840.1.101.3.4.1.47":"aes256-CCM","2.16.840.1.101.3.4.1.48":"aes256-wrap-pad","2.16.840.1.101.3.4.2.1":"sha256","2.16.840.1.101.3.4.2.2":"sha384","2.16.840.1.101.3.4.2.3":"sha512","2.16.840.1.113730.3.1.216":"userPKCS12","2.5.1.5.55":"clearance","2.5.4.0":"objectClass","2.5.4.1":"aliasedEntryName","2.5.4.2":"knowldgeinformation","2.5.4.3":"commonName","2.5.4.5":"serialName","2.5.4.6":"countryName","2.5.4.7":"localityName","2.5.4.8":"stateOrProvinceName","2.5.4.9":"streetAddress","2.5.4.10":"organizationName","2.5.4.11":"organizationalUnitName","2.5.4.12":"title","2.5.4.13":"description","2.5.4.14":"searchGuide","2.5.4.15":"businessCategory","2.5.4.16":"postalAddress","2.5.4.17":"postalCode","2.5.4.18":"postOfficeBox","2.5.4.19":"physicalDeliveryOfficeName","2.5.4.20":"telephoneNumber","2.5.4.21":"telexNumber","2.5.4.22":"teletexTerminalIdentifier","2.5.4.23":"facsimileTelephoneNumber","2.5.4.24":"x121Address","2.5.4.25":"internationalISDNNumber","2.5.4.26":"registeredAddress","2.5.4.27":"destinationIndicator","2.5.4.28":"preferredDeliveryMethod","2.5.4.29":"presentationAddress","2.5.4.30":"supportedApplicationContext","2.5.4.31":"member","2.5.4.32":"owner","2.5.4.33":"roleOccupant","2.5.4.34":"seeAlso","2.5.4.35":"userPassword","2.5.4.36":"userCertificate","2.5.4.37":"cACertificate","2.5.4.38":"authorityRevocationList","2.5.4.39":"certificateRevocationList","2.5.4.40":"crossCertificatePair","2.5.4.41":"name","2.5.4.42":"givenName","2.5.4.43":"initials","2.5.4.44":"generationQualifier","2.5.4.45":"uniqueIdentifier","2.5.4.46":"dnQualifier","2.5.4.47":"enhancedSearchGuide","2.5.4.48":"protocolInformation","2.5.4.49":"distinguishedName","2.5.4.50":"uniqueMember","2.5.4.51":"houseIdentifier","2.5.4.52":"supportedAlgorithms","2.5.4.53":"deltaRevocationList","2.5.4.58":"attributeCertificate","2.5.4.65":"pseudonym","2.5.4.72":"role","2.5.29.1":"authorityKeyIdentifierX","2.5.29.2":"keyAttributesX","2.5.29.3":"certificatePoliciesX","2.5.29.4":"keyUsageRestriction","2.5.29.5":"policyMapping","2.5.29.6":"subtreesConstraint","2.5.29.7":"subjectAltNameX","2.5.29.8":"issuerAltNameX","2.5.29.9":"subjectDirectoryAttributes","2.5.29.10":"basicConstraintsX","2.5.29.11":"nameConstraintsX","2.5.29.12":"policyConstraintsX","2.5.29.13":"basicConstraintsY","2.5.29.14":"subjectKeyIdentifier","2.5.29.15":"keyUsage","2.5.29.16":"privateKeyUsagePeriod","2.5.29.17":"subjectAltName","2.5.29.18":"issuerAltName","2.5.29.19":"basicConstraints","2.5.29.20":"cRLNumber","2.5.29.21":"cRLReason","2.5.29.22":"expirationDate","2.5.29.23":"instructionCode","2.5.29.24":"invalidityDate","2.5.29.25":"cRLDistributionPointsX","2.5.29.26":"issuingDistributionPointX","2.5.29.27":"deltaCRLIndicator","2.5.29.28":"issuingDistributionPoint","2.5.29.29":"certificateIssuer","2.5.29.30":"nameConstraints","2.5.29.31":"cRLDistributionPoints","2.5.29.32":"certificatePolicies","2.5.29.33":"policyMappings","2.5.29.34":"policyConstraintsY","2.5.29.35":"authorityKeyIdentifier","2.5.29.36":"policyConstraints","2.5.29.37":"extKeyUsage","2.5.29.46":"freshestCRL","2.5.29.54":"inhibitAnyPolicy","2.5.29.55":"targetInformation","2.5.29.56":"noRevAvail"},s={};for(var o in a)s[a[o]]=o;var c={"id-GostR3411-94-with-GostR3410-2001":"GOST R 34.10-2001/GOST R 34.11-94","id-GostR3411-94-with-GostR3410-94":"GOST R 34.10-94/GOST R 34.11-94","id-GostR3411-94":"GOST R 34.11-94","id-HMACGostR3411-94":{name:"HMAC",hash:{name:"GOST R 34.11-94"}},"id-Gost28147-89-None-KeyWrap":"GOST 28147-89-KW","id-Gost28147-89-CryptoPro-KeyWrap":"GOST 28147-89-CPKW","id-GostR3410-2001":"GOST R 34.10-2001","id-GostR3410-94":"GOST R 34.10-94","id-GostR3410-94-a":"GOST R 34.10-94","id-GostR3410-94-aBis":"GOST R 34.10-94","id-GostR3410-94-b":"GOST R 34.10-94","id-GostR3410-94-bBis":"GOST R 34.10-94","id-Gost28147-89":"GOST 28147-89","id-Gost28147-89-MAC":"GOST 28147-89-MAC","id-GostR3410-2001-CryptoPro-ESDH":"GOST R 34.10-2001-DH/GOST R 34.11-94","id-GostR3410-94-CryptoPro-ESDH":"GOST R 34.10-94-DH/GOST R 34.11-94","id-GostR3410-2001DH":"GOST R 34.10-2001-DH","id-GostR3410-94DH":"GOST R 34.10-94-DH","id-tc26-gost3410-12-256":"GOST R 34.10-256","id-tc26-gost3410-12-512":"GOST R 34.10-512","id-tc26-gost3411-94":"GOST R 34.11-94","id-tc26-gost3411-12-256":"GOST R 34.11-256","id-tc26-gost3411-12-512":"GOST R 34.11-512","id-tc26-signwithdigest-gost3410-12-94":"GOST R 34.10-256/GOST R 34.11-94","id-tc26-signwithdigest-gost3410-12-256":"GOST R 34.10-256/GOST R 34.11-256","id-tc26-signwithdigest-gost3410-12-512":"GOST R 34.10-512/GOST R 34.11-512","id-tc26-hmac-gost-3411-12-256":{name:"HMAC",hash:{name:"GOST R 34.11-256"}},"id-tc26-hmac-gost-3411-12-512":{name:"HMAC",hash:{name:"GOST R 34.11-512"}},"id-tc26-agreement-gost-3410-12-256":"GOST R 34.10-256-DH/GOST R 34.11-256","id-tc26-agreement-gost-3410-12-512":"GOST R 34.10-512-DH/GOST R 34.11-256","id-sc-gost28147-ecb":"GOST 28147-89-ECB/SC","id-sc-gost28147-gamma":"GOST 28147-89-CTR/SC","id-sc-gost28147-gfb":"GOST 28147-89-CFB/SC","id-sc-gost28147-mac":"GOST 28147-89-MAC/SC","id-sc-gostR3410-94":"GOST R 34.10-94/SC","id-sc-gostR3410-94-default":"GOST R 34.10-94/SC","id-sc-gostR3410-94-test":"GOST R 34.10-94/SC/S-TEST","id-sc-gostR3411-94":"GOST R 34.11-94/SC","id-sc-gostR3411-94-with-gostR3410-94":"GOST R 34.10-94/GOST R 34.11-94/SC","id-sc-gostR3411-94-with-gostR3410-2001":"GOST R 34.10-2001/GOST R 34.11-94/SC","id-sc-cmsGostWrap":"GOST 28147-89-SCKW/SC","id-sc-cmsGost28147Wrap":"GOST 28147-89-KW/SC","id-sc-pbeWithGost3411AndGost28147":{derivation:{name:"GOST R 34.11-94-PBKDF2/SC"},encryption:{name:"GOST 28147-ECB/SC"}},"id-sc-pbeWithGost3411AndGost28147CFB":{derivation:{name:"GOST R 34.11-94-PBKDF2/SC"},encryption:{name:"GOST 28147-CFB/SC"}},"id-sc-gostR3410-2001":"GOST R 34.10-2001/SC","id-sc-hmacWithGostR3411":{name:"HMAC",hash:{name:"GOST R 34.11-94/SC"}},"id-sc-r3410-ESDH-r3411kdf":"GOST R 34.10-2001-DH/GOST R 34.11-94/SC",noSignature:"NONE",rsaEncryption:{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},sha1withRSAEncryption:{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-1"}},sha256withRSAEncryption:{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},sha384withRSAEncryption:{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-384"}},sha512withRSAEncryption:{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-512"}},"rsaes-oaep":"RSA-OAEP","rsassa-pss":"RSA-PSS",ecdsa:"ECDSA","ecdsa-with-SHA1":{name:"ECDSA",hash:{name:"SHA-1"}},"ecdsa-with-SHA256":{name:"ECDSA",hash:{name:"SHA-256"}},"ecdsa-with-SHA384":{name:"ECDSA",hash:{name:"SHA-384"}},"ecdsa-with-SHA512":{name:"ECDSA",hash:{name:"SHA-512"}},"pbeWithSHAAndAES128-CBC":{derivation:{name:"PBKDF2",hash:{name:"SHA-1"}},encryption:{name:"AES-CBC",length:128}},"pbeWithSHAAndAES192-CBC":{derivation:{name:"PBKDF2",hash:{name:"SHA-1"}},encryption:{name:"AES-CBC",length:192}},"pbeWithSHAAndAES256-CBC":{derivation:{name:"PBKDF2",hash:{name:"SHA-1"}},encryption:{name:"AES-CBC",length:256}},"pbeWithSHA256AndAES128-CBC":{derivation:{name:"PBKDF2",hash:{name:"SHA-256"}},encryption:{name:"AES-CBC",length:128}},"pbeWithSHA256AndAES192-CBC":{derivation:{name:"PBKDF2",hash:{name:"SHA-256"}},encryption:{name:"AES-CBC",length:192}},"pbeWithSHA256AndAES256-CBC":{derivation:{name:"PBKDF2",hash:{name:"SHA-256"}},encryption:{name:"AES-CBC",length:256}},"pbeWithSHAAnd3-KeyTripleDES-CBC":{derivation:{name:"PFXKDF",iterations:2e3,hash:"SHA-1"},encryption:{name:"3DES",block:"CBC"}},"pbeWithSHAAnd2-KeyTripleDES-CBC":{derivation:{name:"PFXKDF",iterations:2e3,hash:"SHA-1"},encryption:{name:"2DES",block:"CBC"}},"pbeWithSHAAnd128BitRC2-CBC":{derivation:{name:"PFXKDF",iterations:2e3,hash:"SHA-1"},encryption:{name:"RC2",block:"CBC",length:128}},"pbeWithSHAAnd40BitRC2-CBC":{derivation:{name:"PFXKDF",iterations:2e3,hash:"SHA-1"},encryption:{name:"RC2",block:"CBC",length:40}},pbeUnknownGost:{derivation:{name:"PFXKDF",iterations:2e3,hash:"GOST R 34.11-94"},encryption:{name:"GOST 28147-89-CFB"}},ecDH:"ECDH",dhKeyAgreement:"DH","aes128-CBC":{name:"AES-CBC",length:128},"aes128-CFB":{name:"AES-CFB-8",length:128},"aes128-GCM":{name:"AES-GCM",length:128},"aes128-wrap":{name:"AES-KW",length:128},"aes192-CBC":{name:"AES-CBC",length:192},"aes192-CFB":{name:"AES-CFB-8",length:192},"aes192-GCM":{name:"AES-GCM",length:192},"aes192-wrap":{name:"AES-KW",length:192},"aes256-CBC":{name:"AES-CBC",length:256},"aes256-CFB":{name:"AES-CFB-8",length:256},"aes256-GCM":{name:"AES-GCM",length:256},"aes256-wrap":{name:"AES-KW",length:256},sha1:"SHA-1",sha256:"SHA-256",sha384:"SHA-384",sha512:"SHA-512",PBKDF2:"PBKDF2",PBES2:{derivation:{name:"PBKDF2"},encryption:{}},PBMAC1:{derivation:{name:"PBKDF2"},hmac:{}},hmacWithSHA1:"SHA-1-HMAC",hmacWithSHA256:{name:"HMAC",hash:{name:"SHA-256"}},hmacWithSHA384:{name:"HMAC",hash:{name:"SHA-384"}},hmacWithSHA512:{name:"HMAC",hash:{name:"SHA-512"}}};for(var u in c){var f=c[u];"string"==typeof f&&(f={name:f}),f.id=u,c[u]=f}var h={"CP-94":{title:"Crypto-Pro GOST R 34.10-94 Cryptographic Service Provider",signature:c["id-GostR3411-94-with-GostR3410-94"],publicKey:{id:"id-GostR3410-94",name:"GOST R 34.10-94",namedParam:"X-A"},privateKey:{id:"id-GostR3410-94DH",name:"GOST R 34.10-94-DH",namedParam:"X-A"},digest:c["id-GostR3411-94"],wrapping:{id:"id-Gost28147-89-CryptoPro-KeyWrap",name:"GOST 28147-89-CPKW",sBox:"E-A"},hmac:c["id-HMACGostR3411-94"],agreement:c["id-GostR3410-94-CryptoPro-ESDH"],encryption:{id:"id-Gost28147-89",name:"GOST 28147-89",block:"CFB",sBox:"E-A",keyMeshing:"CP"},derivation:{id:"PBKDF2",name:"GOST R 34.11-94-PBKDF2",iterations:2e3}},"CP-01":{title:"Crypto-Pro GOST R 34.10-2001 Cryptographic Service Provider",signature:c["id-GostR3411-94-with-GostR3410-2001"],publicKey:{id:"id-GostR3410-2001",name:"GOST R 34.10-2001",namedCurve:"X-256-A"},privateKey:{id:"id-GostR3410-2001DH",name:"GOST R 34.10-2001-DH",namedCurve:"X-256-A"},digest:{id:"id-GostR3411-94",name:"GOST R 34.11-94",sBox:"D-A"},wrapping:{id:"id-Gost28147-89-CryptoPro-KeyWrap",name:"GOST 28147-89-CPKW",sBox:"E-A"},hmac:c["id-HMACGostR3411-94"],agreement:c["id-GostR3410-2001-CryptoPro-ESDH"],encryption:{id:"id-Gost28147-89",name:"GOST 28147-89-CFB-CPKM",sBox:"E-A"},derivation:{id:"PBKDF2",name:"GOST R 34.11-94-PBKDF2",iterations:2e3}},"TC-256":{title:"Crypto-Pro GOST R 34.10-2012 Cryptographic Service Provider",signature:c["id-tc26-signwithdigest-gost3410-12-256"],publicKey:{id:"id-tc26-gost3410-12-256",name:"GOST R 34.10-256",namedCurve:"X-256-A"},privateKey:{id:"id-tc26-agreement-gost-3410-12-256",name:"GOST R 34.10-256-DH/GOST R 34.11-256",namedCurve:"X-256-A"},digest:c["id-tc26-gost3411-12-256"],wrapping:{id:"id-Gost28147-89-CryptoPro-KeyWrap",name:"GOST 28147-89-CPKW",sBox:"E-A"},hmac:c["id-tc26-hmac-gost-3411-12-256"],agreement:c["id-tc26-agreement-gost-3410-12-256"],encryption:{id:"id-Gost28147-89",name:"GOST 28147-89-CFB-CPKM",sBox:"E-A"},derivation:{id:"PBKDF2",name:"GOST R 34.11-256-12-PBKDF2",iterations:2e3}},"TC-512":{title:"Crypto-Pro GOST R 34.10-2012 Strong Cryptographic Service Provider",signature:c["id-tc26-signwithdigest-gost3410-12-512"],publicKey:{id:"id-tc26-gost3410-12-512",name:"GOST R 34.10-512",namedCurve:"T-512-A"},privateKey:{id:"id-tc26-agreement-gost-3410-12-512",name:"GOST R 34.10-512-DH/GOST R 34.11-256",namedCurve:"T-512-A"},digest:c["id-tc26-gost3411-12-512"],wrapping:{id:"id-Gost28147-89-CryptoPro-KeyWrap",name:"GOST 28147-89-CPKW",sBox:"E-A"},hmac:c["id-tc26-hmac-gost-3411-12-512"],agreement:c["id-tc26-agreement-gost-3410-12-512"],encryption:{id:"id-Gost28147-89",name:"GOST 28147-89-CFB-CPKM",sBox:"E-A"},derivation:{id:"PBKDF2",name:"GOST R 34.11-256-PBKDF2",iterations:2e3}},"SC-94":{title:"Signal-COM GOST Cryptographic Provider",signature:c["id-sc-gostR3411-94-with-gostR3410-94"],publicKey:{id:"id-sc-gostR3410-94",name:"GOST R 34.10-94/SC",namedParam:"S-A"},privateKey:{id:"id-sc-gostR3410-94",name:"GOST R 34.10-94/SC",modulusLength:1024,param:{p:"0xB4E25EFB018E3C8B87505E2A67553C5EDC56C2914B7E4F89D23F03F03377E70A2903489DD60E78418D3D851EDB5317C4871E40B04228C3B7902963C4B7D85D52B9AA88F2AFDBEB28DA8869D6DF846A1D98924E925561BD69300B9DDD05D247B5922D967CBB02671881C57D10E5EF72D3E6DAD4223DC82AA1F7D0294651A480DF",q:"0x972432A437178B30BD96195B773789AB2FFF15594B176DD175B63256EE5AF2CF",a:"0x8FD36731237654BBE41F5F1F8453E71CA414FFC22C25D915309E5D2E62A2A26C7111F3FC79568DAFA028042FE1A52A0489805C0DE9A1A469C844C7CABBEE625C3078888C1D85EEA883F1AD5BC4E6776E8E1A0750912DF64F79956499F1E182475B0B60E2632ADCD8CF94E9C54FD1F3B109D81F00BF2AB8CB862ADF7D40B9369A"}},digest:c["id-sc-gostR3411-94"],encryption:{id:"id-sc-gost28147-gfb",name:"GOST 28147-89-CFB/SC"},hmac:c["id-sc-hmacWithGostR3411"],wrapping:["id-sc-cmsGostWrap"],agreement:c["id-sc-r3410-ESDH-r3411kdf"],derivation:{id:"PBKDF2",name:"GOST R 34.11-94-PBKDF2/SC",iterations:2048},pbes:{id:"id-sc-pbeWithGost3411AndGost28147CFB",derivation:{id:"PBKDF2",name:"GOST R 34.11-94-PBKDF2/SC",iterations:2048},encryption:{id:"id-sc-gost28147-gfb",name:"GOST 28147-CFB/SC",iv:new Uint8Array([0,0,0,0,0,0,0,0])}}},"SC-01":{title:"Signal-COM ECGOST Cryptographic Provider",signature:c["id-sc-gostR3411-94-with-gostR3410-2001"],publicKey:{id:"id-sc-gostR3410-2001",name:"GOST R 34.10-2001/SC",namedCurve:"P-256"},privateKey:{id:"id-sc-gostR3410-2001",name:"GOST R 34.10-2001/SC",curve:{p:"0xFFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF",a:"0xFFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC",b:"0x5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B",x:"0x6B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C296",y:"0x4FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5",q:"0xFFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551"}},digest:c["id-sc-gostR3411-94"],encryption:{id:"id-sc-gost28147-gfb",name:"GOST 28147-89-CFB/SC"},hmac:c["id-sc-hmacWithGostR3411"],wrapping:c["id-sc-cmsGostWrap"],agreement:c["id-sc-r3410-ESDH-r3411kdf"],derivation:{id:"PBKDF2",name:"GOST R 34.11-94-PBKDF2/SC",iterations:2048},pbes:{id:"id-sc-pbeWithGost3411AndGost28147CFB",derivation:{id:"PBKDF2",name:"GOST R 34.11-94-PBKDF2/SC",iterations:2048},encryption:{id:"id-sc-gost28147-gfb",name:"GOST 28147-CFB/SC",iv:new Uint8Array([0,0,0,0,0,0,0,0])}}},"RSA-2048":{title:"Microsoft Strong Cryptographic Provider",signature:c.sha256withRSAEncryption,publicKey:{id:"rsaEncryption",name:"RSASSA-PKCS1-v1_5",modulusLength:2048,publicExponent:new Uint8Array([1,0,1]),hash:c.sha256},privateKey:{id:"rsaEncryption",name:"RSASSA-PKCS1-v1_5",modulusLength:2048,publicExponent:new Uint8Array([1,0,1]),hash:c.sha256},digest:c.sha256,encryption:c["aes256-CFB"],hmac:c.hmacWithSHA256},"ECDSA-256":{title:"Microsoft Base DSS and Diffie-Hellman Cryptographic Provider",signature:c["ecdsa-with-SHA256"],publicKey:{id:"ecdsa",name:"ECDSA",namedCurve:"P-256"},privateKey:{id:"ecdsa",name:"ECDSA",namedCurve:"P-256"},digest:c.sha256,encryption:c["aes256-CFB"],hmac:c.hmacWithSHA256,agreement:c.ecDH}};function l(){}["CP-94","CP-01","TC-256","TC-512","SC-94","SC-01"].forEach((function(e){var t=h[e];t.hmac=i(t.hmac,{hash:t.digest}),t.derivation=i(t.derivation,{hash:t.digest,hmac:t.hmac}),t.pbes=t.pbes||{id:"PBES2",derivation:t.derivation,encryption:t.encryption},t.pbmac=t.pbmac||{id:"PBMAC1",derivation:t.derivation,hmac:t.hmac},t.agreement=i(t.agreement,{wrapping:t.wrapping})})),["RSA-2048","ECDSA-256"].forEach((function(e){var t=h[e];t.derivation=t.derivation||{id:"PBKDF2",name:"PBKDF2",iterations:2048,hash:t.digest},t.pbes=t.pbes||{id:"PBES2",derivation:t.derivation,encryption:t.encryption},t.pbmac=t.pbmac||{id:"PBMAC1",derivation:t.derivation,hmac:t.hmac}})),l.prototype={names:a,identifiers:s,algorithms:c,parameters:{"id-GostR3410-94-TestParamSet":{namedParam:"S-TEST"},"id-GostR3410-94-CryptoPro-A-ParamSet":{namedParam:"S-A"},"id-GostR3410-94-CryptoPro-B-ParamSet":{namedParam:"S-B"},"id-GostR3410-94-CryptoPro-C-ParamSet":{namedParam:"S-C"},"id-GostR3410-94-CryptoPro-D-ParamSet":{namedParam:"S-D"},"id-GostR3410-94-CryptoPro-XchA-ParamSet":{namedParam:"X-A"},"id-GostR3410-94-CryptoPro-XchB-ParamSet":{namedParam:"X-B"},"id-GostR3410-94-CryptoPro-XchC-ParamSet":{namedParam:"X-C"},"id-GostR3410-2001-CryptoPro-TestParamSet":{namedCurve:"S-256-TEST"},"id-GostR3410-2001-CryptoPro-A-ParamSet":{namedCurve:"S-256-A"},"id-GostR3410-2001-CryptoPro-B-ParamSet":{namedCurve:"S-256-B"},"id-GostR3410-2001-CryptoPro-C-ParamSet":{namedCurve:"S-256-C"},"id-GostR3410-2001-CryptoPro-XchA-ParamSet":{namedCurve:"X-256-A"},"id-GostR3410-2001-CryptoPro-XchB-ParamSet":{namedCurve:"X-256-B"},"id-tc26-gost-3410-12-256-paramSetTest":{namedCurve:"T-256-TEST"},"id-tc26-gost-3410-12-256-paramSetA":{namedCurve:"T-256-A"},"id-tc26-gost-3410-12-256-paramSetB":{namedCurve:"T-256-B"},"id-tc26-gost-3410-12-512-paramSetTest":{namedCurve:"T-512-TEST"},"id-tc26-gost-3410-12-512-paramSetA":{namedCurve:"T-512-A"},"id-tc26-gost-3410-12-512-paramSetB":{namedCurve:"T-512-B"},"id-tc26-gost-3410-12-512-paramSetC":{namedCurve:"T-512-C"},"id-tc26-gost-3410-12-512-paramSetD":{namedCurve:"T-512-D"},secp256r1:{namedCurve:"P-256"},secp384r:{namedCurve:"P-384"},secp521r:{namedCurve:"P-521"},"id-GostR3411-94-TestParamSet":{sBox:"D-TEST"},"id-GostR3411-94-CryptoProParamSet":{sBox:"D-A"},"id-GostR3411-94-CryptoPro-A-ParamSet":{sBox:"D-B"},"id-GostR3411-94-CryptoPro-B-ParamSet":{sBox:"D-C"},"id-GostR3411-94-CryptoPro-C-ParamSet":{sBox:"D-D"},"id-Gost28147-89-TestParamSet":{block:"CTR",sBox:"E-TEST"},"id-Gost28147-89-CryptoPro-A-ParamSet":{block:"CFB",sBox:"E-A",keyMeshing:"CP"},"id-Gost28147-89-CryptoPro-B-ParamSet":{block:"CFB",sBox:"E-B",keyMeshing:"CP"},"id-Gost28147-89-CryptoPro-C-ParamSet":{block:"CFB",sBox:"E-C",keyMeshing:"CP"},"id-Gost28147-89-CryptoPro-D-ParamSet":{block:"CFB",sBox:"E-D",keyMeshing:"CP"},"id-Gost28147-89-None-KeyMeshing":{keyMeshing:"NO"},"id-Gost28147-89-CryptoPro-KeyMeshing":{keyMeshing:"CP"},"id-tc26-gost-28147-param-Z":{block:"CFB",sBox:"E-Z"}},attributes:{sBox:{"D-TEST":"id-GostR3411-94-TestParamSet","D-A":"id-GostR3411-94-CryptoProParamSet","D-B":"id-GostR3411-94-CryptoPro-A-ParamSet","D-C":"id-GostR3411-94-CryptoPro-B-ParamSet","D-D":"id-GostR3411-94-CryptoPro-C-ParamSet","E-TEST":"id-Gost28147-89-TestParamSet","E-A":"id-Gost28147-89-CryptoPro-A-ParamSet","E-B":"id-Gost28147-89-CryptoPro-B-ParamSet","E-C":"id-Gost28147-89-CryptoPro-C-ParamSet","E-D":"id-Gost28147-89-CryptoPro-D-ParamSet","E-Z":"id-tc26-gost-28147-param-Z","D-256":"id-tc26-gost3411-12-256","D-512":"id-tc26-gost3411-12-512"},namedParam:{"S-TEST":"id-GostR3410-94-TestParamSet","S-A":"id-GostR3410-94-CryptoPro-A-ParamSet","S-B":"id-GostR3410-94-CryptoPro-B-ParamSet","S-C":"id-GostR3410-94-CryptoPro-C-ParamSet","S-D":"id-GostR3410-94-CryptoPro-D-ParamSet","X-A":"id-GostR3410-94-CryptoPro-XchA-ParamSet","X-B":"id-GostR3410-94-CryptoPro-XchB-ParamSet","X-C":"id-GostR3410-94-CryptoPro-XchC-ParamSet"},namedCurve:{"S-256-TEST":"id-GostR3410-2001-CryptoPro-TestParamSet","S-256-A":"id-GostR3410-2001-CryptoPro-A-ParamSet","S-256-B":"id-GostR3410-2001-CryptoPro-B-ParamSet","S-256-C":"id-GostR3410-2001-CryptoPro-C-ParamSet","X-256-A":"id-GostR3410-2001-CryptoPro-XchA-ParamSet","X-256-B":"id-GostR3410-2001-CryptoPro-XchB-ParamSet","P-256":"secp256r1","T-256-TEST":"id-tc26-gost-3410-12-256-paramSetTest","T-256-A":"id-tc26-gost-3410-12-256-paramSetA","T-256-B":"id-tc26-gost-3410-12-256-paramSetB","T-512-TEST":"id-tc26-gost-3410-12-512-paramSetTest","T-512-A":"id-tc26-gost-3410-12-512-paramSetA","T-512-B":"id-tc26-gost-3410-12-512-paramSetB"}},providers:h},t.gostSecurityInstance=new l},function(e,t,r){"use strict";(function(n){Object.defineProperty(t,"__esModule",{value:!0});var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function a(){return s()?n:self}function s(){return"object"===i(t)&&void 0!==e}t.getRoot=a,t.getCryptoModule=function(){var e=a();if(a().hasOwnProperty("crypto"))return e.crypto;if(e.hasOwnProperty("msCrypto"))return e.msCrypto;if(s())return r(170);throw new Error("Your environment does not have сrypto module")},t.isInNode=s,t.isBrowser=function(){return"undefined"!=typeof window},t.isInWebWorker=function(){return"undefined"!=typeof importScripts}}).call(this,r(7))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GostRandom=f;var n=r(79);function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var o={seed:new Uint8Array(1024),getIndex:0,setIndex:0,set:function(e){this.setIndex>=1024&&(this.setIndex=0),this.seed[this.setIndex++]=e},get:function(){return this.getIndex>=1024&&(this.getIndex=0),this.seed[this.getIndex++]}};if((0,n.isBrowser)()){try{document.addEventListener("mousemove",(function(e){o.set(255&(new Date).getTime()^255&(e.clientX||e.pageX)^255&(e.clientY||e.pageY))}),!1)}catch(e){}try{document.addEventListener("keydown",(function(e){o.set(255&(new Date).getTime()^255&e.keyCode)}),!1)}catch(e){}}var c=function(e){function t(){return i(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return s(t,Error),t}(),u=function(e){function t(){return i(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return s(t,Error),t}();function f(){}var h=(0,n.getCryptoModule)();f.prototype.getRandomValues=function(e){if(!e.byteLength)throw new c("Array is not of an integer type (Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, or Uint32Array)");if(e.byteLength>65536)throw new u("Byte length of array can't be greate then 65536");var t=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);if(h&&h.getRandomValues)h.getRandomValues(t);else for(var r=0,n=t.length;r<n;r++)t[r]=255&Math.floor(256*Math.random());for(r=0,n=t.length;r<n;r++)t[r]=t[r]^o.get();return e}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GostSign=function(e){e=e||{},this.name=(e.name||"GOST R 34.10")+"-"+(e.version||2012)%100+"-"+(e.length||256)+("SIGN"!==(e.mode||"SIGN")?"-"+e.mode:"")+("string"==typeof e.namedParam?"/"+e.namedParam:"")+("string"==typeof e.namedCurve?"/"+e.namedCurve:"")+("string"==typeof e.sBox?"/"+e.sBox:"");var t,r,a=e.version||2012;switch(e.mode||"SIGN"){case"SIGN":this.sign=xe,this.verify=Te,this.generateKey=Ie;break;case"DH":this.deriveBits=_e,this.deriveKey=Pe,this.generateKey=Ie;break;case"MASK":this.wrapKey=Re,this.unwrapKey=ke,this.generateKey=Fe}if(1994===a)(s=e.param)||(s=c[this.namedParam=(e.namedParam||"S-A").toUpperCase()]),this.modulusLength=e.modulusLength||s.modulusLength||1024,this.p=be(s.p),this.q=be(s.q),this.a=be(s.a),e.public&&(this.peer_y=ve(e.public));else{var s;(s=e.curve)||(s=o[this.namedCurve=(e.namedCurve||"S-256-A").toUpperCase()]);var u=this.curve=function(e,t,r){var n={};return n.q=e,n.r=new $(e),n.a=te(n,t),n.b=te(n,r),n.infinity=ue(n),n}(be(s.p),be(s.a),be(s.b));if(this.P=ue(u,te(u,be(s.x)),te(u,be(s.y))),this.q=be(s.q),e.public){var f=Ae(e.public);this.peer_Q=new ue(this.curve,te(this.curve,f[0]),te(this.curve,f[1]))}}if(this.curve){if((r=e.length||L(this.q))>508&&r<=512)r=512;else{if(!(r>254&&r<=256))throw new i.NotSupportedError("Support keys only 256 or 512 bits length");r=256}t=r}else{if((r=e.modulusLength||L(this.p))>1016&&r<=1024)r=1024;else{if(!(r>508&&r<=512))throw new i.NotSupportedError("Support keys only 512 or 1024 bits length");r=512}t=256}this.bitLength=t,this.keyLength=r,this.procreator=e.procreator;var h=e.hash;h&&(("string"==typeof h||h instanceof String)&&(h={name:h}),1994===e.version||2001===e.version?(h.version=1994,h.length=256,h.sBox=e.sBox||h.sBox):(h.version=2012,h.length=t),h.procreator=h.procreator||e.procreator,this.hash=new n.GostDigest(h)),e.ukm&&(this.ukm=e.ukm)};var n=r(40),i=r(19),a=r(25),s=ArrayBuffer,o={"S-256-TEST":{a:7,b:"0x5FBFF498AA938CE739B8E022FBAFEF40563F6E6A3472FC2A514C0CE9DAE23B7E",p:"0x8000000000000000000000000000000000000000000000000000000000000431",q:"0x8000000000000000000000000000000150FE8A1892976154C59CFC193ACCF5B3",x:2,y:"0x8E2A8A0E65147D4BD6316030E16D19C85C97F0A9CA267122B96ABBCEA7E8FC8"},"S-256-A":{a:"0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD94",b:166,p:"0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD97",q:"0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF6C611070995AD10045841B09B761B893",x:1,y:"0x8D91E471E0989CDA27DF505A453F2B7635294F2DDF23E3B122ACC99C9E9F1E14"},"S-256-B":{a:"0x8000000000000000000000000000000000000000000000000000000000000C96",b:"0x3E1AF419A269A5F866A7D3C25C3DF80AE979259373FF2B182F49D4CE7E1BBC8B",p:"0x8000000000000000000000000000000000000000000000000000000000000C99",q:"0x800000000000000000000000000000015F700CFFF1A624E5E497161BCC8A198F",x:1,y:"0x3FA8124359F96680B83D1C3EB2C070E5C545C9858D03ECFB744BF8D717717EFC"},"S-256-C":{a:"0x9B9F605F5A858107AB1EC85E6B41C8AACF846E86789051D37998F7B9022D7598",b:32858,p:"0x9B9F605F5A858107AB1EC85E6B41C8AACF846E86789051D37998F7B9022D759B",q:"0x9B9F605F5A858107AB1EC85E6B41C8AA582CA3511EDDFB74F02F3A6598980BB9",x:0,y:"0x41ECE55743711A8C3CBF3783CD08C0EE4D4DC440D4641A8F366E550DFDB3BB67"},"P-256":{p:"0xFFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF",a:"0xFFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC",b:"0x5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B",x:"0x6B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C296",y:"0x4FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5",q:"0xFFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551"},"T-512-TEST":{a:7,b:"0x1CFF0806A31116DA29D8CFA54E57EB748BC5F377E49400FDD788B649ECA1AC4361834013B2AD7322480A89CA58E0CF74BC9E540C2ADD6897FAD0A3084F302ADC",p:"0x4531ACD1FE0023C7550D267B6B2FEE80922B14B2FFB90F04D4EB7C09B5D2D15DF1D852741AF4704A0458047E80E4546D35B8336FAC224DD81664BBF528BE6373",q:"0x4531ACD1FE0023C7550D267B6B2FEE80922B14B2FFB90F04D4EB7C09B5D2D15DA82F2D7ECB1DBAC719905C5EECC423F1D86E25EDBE23C595D644AAF187E6E6DF",x:"0x24D19CC64572EE30F396BF6EBBFD7A6C5213B3B3D7057CC825F91093A68CD762FD60611262CD838DC6B60AA7EEE804E28BC849977FAC33B4B530F1B120248A9A",y:"0x2BB312A43BD2CE6E0D020613C857ACDDCFBF061E91E5F2C3F32447C259F39B2C83AB156D77F1496BF7EB3351E1EE4E43DC1A18B91B24640B6DBB92CB1ADD371E"},"T-512-A":{p:"0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDC7",a:"0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDC4",b:"0xE8C2505DEDFC86DDC1BD0B2B6667F1DA34B82574761CB0E879BD081CFD0B6265EE3CB090F30D27614CB4574010DA90DD862EF9D4EBEE4761503190785A71C760",q:"0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF27E69532F48D89116FF22B8D4E0560609B4B38ABFAD2B85DCACDB1411F10B275",x:3,y:"0x7503CFE87A836AE3A61B8816E25450E6CE5E1C93ACF1ABC1778064FDCBEFA921DF1626BE4FD036E93D75E6A50E3A41E98028FE5FC235F5B889A589CB5215F2A4"},"T-512-B":{p:"0x8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006F",a:"0x8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006C",b:"0x687D1B459DC841457E3E06CF6F5E2517B97C7D614AF138BCBF85DC806C4B289F3E965D2DB1416D217F8B276FAD1AB69C50F78BEE1FA3106EFB8CCBC7C5140116",q:"0x800000000000000000000000000000000000000000000000000000000000000149A1EC142565A545ACFDB77BD9D40CFA8B996712101BEA0EC6346C54374F25BD",x:2,y:"0x1A8F7EDA389B094C2C071E3647A8940F3C123B697578C213BE6DD9E6C8EC7335DCB228FD1EDF4A39152CBCAAF8C0398828041055F94CEEEC7E21340780FE41BD"}};o["X-256-A"]=o["S-256-A"],o["X-256-B"]=o["S-256-C"],o["T-256-TEST"]=o["S-256-TEST"],o["T-256-A"]=o["S-256-A"],o["T-256-B"]=o["S-256-B"],o["T-256-C"]=o["S-256-C"];var c={"S-TEST":{modulusLength:512,p:"0xEE8172AE8996608FB69359B89EB82A69854510E2977A4D63BC97322CE5DC3386EA0A12B343E9190F23177539845839786BB0C345D165976EF2195EC9B1C379E3",q:"0x98915E7EC8265EDFCDA31E88F24809DDB064BDC7285DD50D7289F0AC6F49DD2D",a:"0x9e96031500c8774a869582d4afde2127afad2538b4b6270a6f7c8837b50d50f206755984a49e509304d648be2ab5aab18ebe2cd46ac3d8495b142aa6ce23e21c"},"S-A":{modulusLength:1024,p:"0xB4E25EFB018E3C8B87505E2A67553C5EDC56C2914B7E4F89D23F03F03377E70A2903489DD60E78418D3D851EDB5317C4871E40B04228C3B7902963C4B7D85D52B9AA88F2AFDBEB28DA8869D6DF846A1D98924E925561BD69300B9DDD05D247B5922D967CBB02671881C57D10E5EF72D3E6DAD4223DC82AA1F7D0294651A480DF",q:"0x972432A437178B30BD96195B773789AB2FFF15594B176DD175B63256EE5AF2CF",a:"0x8FD36731237654BBE41F5F1F8453E71CA414FFC22C25D915309E5D2E62A2A26C7111F3FC79568DAFA028042FE1A52A0489805C0DE9A1A469C844C7CABBEE625C3078888C1D85EEA883F1AD5BC4E6776E8E1A0750912DF64F79956499F1E182475B0B60E2632ADCD8CF94E9C54FD1F3B109D81F00BF2AB8CB862ADF7D40B9369A"},"S-B":{modulusLength:1024,p:"0xC6971FC57524B30C9018C5E621DE15499736854F56A6F8AEE65A7A404632B1BCF0349FFCAFCB0A103177971FC1612ADCDB8C8CC938C70225C8FD12AFF01B1D064E0AD6FDE6AB9159166CB9F2FC171D92F0CC7B6A6B2CD7FA342ACBE2C9315A42D576B1ECCE77A963157F3D0BD96A8EB0B0F3502AD238101B05116334F1E5B7AB",q:"0xB09D634C10899CD7D4C3A7657403E05810B07C61A688BAB2C37F475E308B0607",a:"0x3D26B467D94A3FFC9D71BF8DB8934084137264F3C2E9EB16DCA214B8BC7C872485336744934FD2EF5943F9ED0B745B90AA3EC8D70CDC91682478B664A2E1F8FB56CEF2972FEE7EDB084AF746419B854FAD02CC3E3646FF2E1A18DD4BEB3C44F7F2745588029649674546CC9187C207FB8F2CECE8E2293F68395C4704AF04BAB5"},"S-C":{modulusLength:1024,p:"0x9D88E6D7FE3313BD2E745C7CDD2AB9EE4AF3C8899E847DE74A33783EA68BC30588BA1F738C6AAF8AB350531F1854C3837CC3C860FFD7E2E106C3F63B3D8A4C034CE73942A6C3D585B599CF695ED7A3C4A93B2B947B7157BB1A1C043AB41EC8566C6145E938A611906DE0D32E562494569D7E999A0DDA5C879BDD91FE124DF1E9",q:"0xFADD197ABD19A1B4653EECF7ECA4D6A22B1F7F893B641F901641FBB555354FAF",a:"0x7447ED7156310599070B12609947A5C8C8A8625CF1CF252B407B331F93D639DDD1BA392656DECA992DD035354329A1E95A6E32D6F47882D960B8F10ACAFF796D13CD9611F853DAB6D2623483E46788708493937A1A29442598AEC2E0742022563440FE9C18740ECE6765AC05FAF024A64B026E7E408840819E962E7E5F401AE3"},"S-D":{modulusLength:1024,p:"0x80F102D32B0FD167D069C27A307ADAD2C466091904DBAA55D5B8CC7026F2F7A1919B890CB652C40E054E1E9306735B43D7B279EDDF9102001CD9E1A831FE8A163EED89AB07CF2ABE8242AC9DEDDDBF98D62CDDD1EA4F5F15D3A42A6677BDD293B24260C0F27C0F1D15948614D567B66FA902BAA11A69AE3BCEADBB83E399C9B5",q:"0xF0F544C418AAC234F683F033511B65C21651A6078BDA2D69BB9F732867502149",a:"0x6BCC0B4FADB3889C1E06ADD23CC09B8AB6ECDEDF73F04632595EE4250005D6AF5F5ADE44CB1E26E6263C672347CFA26F9E9393681E6B759733784CDE5DBD9A14A39369DFD99FA85CC0D10241C4010343F34A91393A706CF12677CBFA1F578D6B6CFBE8A1242CFCC94B3B653A476E145E3862C18CC3FED8257CFEF74CDB205BF1"},"X-A":{modulusLength:1024,p:"0xCA3B3F2EEE9FD46317D49595A9E7518E6C63D8F4EB4D22D10D28AF0B8839F079F8289E603B03530784B9BB5A1E76859E4850C670C7B71C0DF84CA3E0D6C177FE9F78A9D8433230A883CD82A2B2B5C7A3306980278570CDB79BF01074A69C9623348824B0C53791D53C6A78CAB69E1CFB28368611A397F50F541E16DB348DBE5F",q:"0xCAE4D85F80C147704B0CA48E85FB00A9057AA4ACC44668E17F1996D7152690D9",a:"0xBE27D652F2F1E339DA734211B85B06AE4DE236AA8FBEEB3F1ADCC52CD43853777E834A6A518138678A8ADBD3A55C70A7EAB1BA7A0719548677AAF4E609FFB47F6B9D7E45B0D06D83D7ADC53310ABD85783E7317F7EC73268B6A9C08D260B85D8485696CA39C17B17F044D1E050489036ABD381C5E6BF82BA352A1AFF136601AF"},"X-B":{modulusLength:1024,p:"0x9286DBDA91ECCFC3060AA5598318E2A639F5BA90A4CA656157B2673FB191CD0589EE05F4CEF1BD13508408271458C30851CE7A4EF534742BFB11F4743C8F787B11193BA304C0E6BCA25701BF88AF1CB9B8FD4711D89F88E32B37D95316541BF1E5DBB4989B3DF13659B88C0F97A3C1087B9F2D5317D557DCD4AFC6D0A754E279",q:"0xC966E9B3B8B7CDD82FF0F83AF87036C38F42238EC50A876CD390E43D67B6013F",a:"0x7E9C3096676F51E3B2F9884CF0AC2156779496F410E049CED7E53D8B7B5B366B1A6008E5196605A55E89C3190DABF80B9F1163C979FCD18328DAE5E9048811B370107BB7715F82091BB9DE0E33EE2FED6255474F8769FCE5EAFAEEF1CB5A32E0D5C6C2F0FC0B3447072947F5B4C387666993A333FC06568E534AD56D2338D729"},"X-C":{modulusLength:1024,p:"0xB194036ACE14139D36D64295AE6C50FC4B7D65D8B340711366CA93F383653908EE637BE428051D86612670AD7B402C09B820FA77D9DA29C8111A8496DA6C261A53ED252E4D8A69A20376E6ADDB3BDCD331749A491A184B8FDA6D84C31CF05F9119B5ED35246EA4562D85928BA1136A8D0E5A7E5C764BA8902029A1336C631A1D",q:"0x96120477DF0F3896628E6F4A88D83C93204C210FF262BCCB7DAE450355125259",a:"0x3F1817052BAA7598FE3E4F4FC5C5F616E122CFF9EBD89EF81DC7CE8BF56CC64B43586C80F1C4F56DD5718FDD76300BE336784259CA25AADE5A483F64C02A20CF4A10F9C189C433DEFE31D263E6C9764660A731ECCAECB74C8279303731E8CF69205BC73E5A70BDF93E5BB681DAB4EEB9C733CAAB2F673C475E0ECA921D29782E"}},u=28,f=(1<<u)-1,h=1<<u,l=Math.pow(2,52),d=52-u,p=2*u-52;function g(e,t,r,n,i,a,s){for(var o=16383&r,c=r>>14;--s>=0;){var u=16383&e[t],f=e[t++]>>14,h=c*u+f*o;a=((u=o*u+((16383&h)<<14)+n[i]+a)>>28)+(h>>14)+c*f,n[i++]=268435455&u}return a}function y(e){var t=new Array(Math.ceil(e));return t.s=0,t.t=0,t}function v(e,t){for(var r=e.t-1;r>=0;--r)t[r]=e[r];return t.t=e.t,t.s=e.s,t}function m(e){return v(e,y(e.t))}function b(e,t){return e.t=1,e.s=t<0?-1:0,t>0?e[0]=t:t<-1?e[0]=t+h:e.t=0,e}function w(e){var t=y(1);return b(t,e),t}var S=w(0),E=w(1),C=w(3);function A(e){for(var t=e.s&f;e.t>0&&e[e.t-1]===t;)--e.t;return e}function B(e,t,r){for(var n=0,i=0,a=Math.min(t.t,e.t);n<a;)i+=e[n]-t[n],r[n++]=i&f,i>>=u;if(t.t<e.t){for(i-=t.s;n<e.t;)i+=e[n],r[n++]=i&f,i>>=u;i+=e.s}else{for(i+=e.s;n<t.t;)i-=t[n],r[n++]=i&f,i>>=u;i-=t.s}return r.s=i<0?-1:0,i<-1?r[n++]=h+i:i>0&&(r[n++]=i),r.t=n,A(r)}function x(e,t){return B(e,t,y(e.t))}function T(e,t,r){for(var n=0,i=0,a=Math.min(t.t,e.t);n<a;)i+=e[n]+t[n],r[n++]=i&f,i>>=u;if(t.t<e.t){for(i+=t.s;n<e.t;)i+=e[n],r[n++]=i&f,i>>=u;i+=e.s}else{for(i+=e.s;n<t.t;)i+=t[n],r[n++]=i&f,i>>=u;i+=t.s}return r.s=i<0?-1:0,i>0?r[n++]=i:i<-1&&(r[n++]=h+i),r.t=n,A(r)}function I(e,t){return T(e,t,y(e.t))}function F(e,t){return B(S,e,t)}function k(e){return e.s<0?function(e){return F(e,y(e.t))}(e):e}function R(e,t){var r=e.s-t.s;if(0!==r)return r;var n=e.t;if(0!=(r=n-t.t))return e.s<0?-r:r;for(;--n>=0;)if(0!=(r=e[n]-t[n]))return r;return 0}function D(e){var t,r=1;return 0!=(t=e>>>16)&&(e=t,r+=16),0!=(t=e>>8)&&(e=t,r+=8),0!=(t=e>>4)&&(e=t,r+=4),0!=(t=e>>2)&&(e=t,r+=2),0!=(t=e>>1)&&(e=t,r+=1),r}function _(e,t,r){var n;for(n=e.t-1;n>=0;--n)r[n+t]=e[n];for(n=t-1;n>=0;--n)r[n]=0;return r.t=e.t+t,r.s=e.s,r}function P(e,t,r){for(var n=t;n<e.t;++n)r[n-t]=e[n];return r.t=Math.max(e.t-t,0),r.s=e.s,r}function N(e,t,r){var n,i=t%u,a=u-i,s=(1<<a)-1,o=Math.floor(t/u),c=e.s<<i&f;for(n=e.t-1;n>=0;--n)r[n+o+1]=e[n]>>a|c,c=(e[n]&s)<<i;for(n=o-1;n>=0;--n)r[n]=0;return r[o]=c,r.t=e.t+o+1,r.s=e.s,A(r)}function O(e,t,r){r.s=e.s;var n=Math.floor(t/u);if(!(n>=e.t)){var i=t%u,a=u-i,s=(1<<i)-1;r[0]=e[n]>>i;for(var o=n+1;o<e.t;++o)r[o-n-1]|=(e[o]&s)<<a,r[o-n]=e[o]>>i;return i>0&&(r[e.t-n-1]|=(e.s&s)<<a),r.t=e.t-n,A(r)}r.t=0}function L(e){return e.t<=0?0:u*(e.t-1)+D(e[e.t-1]^e.s&f)}function U(e,t,r){var n=k(e),i=k(t),a=n.t;for(r.t=a+i.t;--a>=0;)r[a]=0;for(a=0;a<i.t;++a)r[a+n.t]=g(n,0,i[a],r,a,0,n.t);return r.s=0,e.s!==t.s&&B(S,r,r),A(r)}function K(e,t){return U(e,t,y(e.t+t.t))}function M(e,t){for(var r=k(e),n=t.t=2*r.t;--n>=0;)t[n]=0;for(n=0;n<r.t-1;++n){var i=g(r,n,r[n],t,2*n,0,1);(t[n+r.t]+=g(r,n+1,2*r[n],t,2*n+1,i,r.t-n-1))>=r.DV&&(t[n+r.t]-=r.DV,t[n+r.t+1]=1)}return t.t>0&&(t[t.t-1]+=g(r,n,r[n],t,2*n,0,1)),t.s=0,A(t)}function H(e,t,r,n){var i=k(t);if(i.t<=0)throw new OperationError("Division by zero");var a=k(e);if(a.t<i.t)return r&&b(r,0),n&&v(e,n),r;n||(n=y(t.t));var s=y(t.t),o=e.s,c=t.s,h=u-D(i[i.t-1]);h>0?(N(i,h,s),N(a,h,n)):(v(i,s),v(a,n));var m=s.t,w=s[m-1];if(0===w)return r;var C=w*(1<<d)+(m>1?s[m-2]>>p:0),x=l/C,T=(1<<d)/C,I=1<<p,F=n.t,L=F-m,U=r||y(Math.max(e.t-t.t,1));for(_(s,L,U),R(n,U)>=0&&(n[n.t++]=1,B(n,U,n)),_(E,m,U),B(U,s,s);s.t<m;)s[s.t++]=0;for(;--L>=0;){var K=n[--F]===w?f:Math.floor(n[F]*x+(n[F-1]+I)*T);if((n[F]+=g(s,0,K,n,L,0,m))<K)for(_(s,L,U),B(n,U,n);n[F]<--K;)B(n,U,n)}return r&&(P(n,m,r),o!==c&&B(S,r,r)),n.t=m,A(n),h>0&&O(n,h,n),o<0&&B(S,n,n),r}function j(e,t,r){return H(k(e),t,null,r),e.s<0&&R(r,S)>0&&B(t,r,r),r}function V(e,t){return j(e,t,y(t.t))}function G(e){return 0===(e.t>0?1&e[0]:e.s)}function q(e){return function(e,t){return 0===R(e,t)}(e,S)}function z(e){return e.s<0?-1:e.t<=0||1===e.t&&e[0]<=0?0:1}function W(e,t){var r=G(t);if(G(e)&&r||0===z(t))return S;for(var n=m(t),i=m(e),a=w(1),s=w(0),o=w(0),c=w(1);0!==z(n);){for(;G(n);)O(n,1,n),r?(G(a)&&G(s)||(T(a,e,a),B(s,t,s)),O(a,1,a)):G(s)||B(s,t,s),O(s,1,s);for(;G(i);)O(i,1,i),r?(G(o)&&G(c)||(T(o,e,o),B(c,t,c)),O(o,1,o)):G(c)||B(c,t,c),O(c,1,c);R(n,i)>=0?(B(n,i,n),r&&B(a,o,a),B(s,c,s)):(B(i,n,i),r&&B(o,a,o),B(c,s,c))}return 0!==R(i,E)?S:R(c,t)>=0?x(c,t):z(c)<0?(T(c,t,c),z(c)<0?I(c,t):c):c}function X(e,t){var r=Math.floor(t/u);return r>=e.t?0!==e.s:!!(e[r]&1<<t%u)}function Y(e,t){for(var r in t)e.prototype[r]=t[r]}var J=function(e){this.m=e};Y(J,{convert:function(e){return e.s<0||R(e,this.m)>=0?V(e,this.m):e},revert:function(e){return e},reduce:function(e){j(e,this.m,e)},sqrTo:function(e,t){M(e,t),this.reduce(t)},mulTo:function(e,t,r){U(e,t,r),this.reduce(r)}});var Q=function(e){this.m=e,this.mp=function(e){if(e.t<1)return 0;var t=e[0];if(!(1&t))return 0;var r=3&t;return(r=(r=(r=(r=r*(2-(15&t)*r)&15)*(2-(255&t)*r)&255)*(2-((65535&t)*r&65535))&65535)*(2-t*r%h)%h)>0?h-r:-r}(e),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<u-15)-1,this.mt2=2*e.t};function Z(e,t,r){if(0!==t){for(;e.t<=r;)e[e.t++]=0;for(e[r]+=t;e[r]>=h;)e[r]-=h,++r>=e.t&&(e[e.t++]=0),++e[r]}}function $(e){var t,r;this.r2=y(2*e.t),this.q3=y(2*e.t),_(E,2*e.t,this.r2),this.mu=H(t=this.r2,r=e,y(Math.max(t.t-r.t,1)),null),this.m=e}function ee(e,t,r){var n,i,a=L(t),s=w(1);if(a<=0)return s;n=a<18?1:a<48?3:a<144?4:a<768?5:6,i=a<8?new J(r):G(r)?new $(r):new Q(r);var o=new Array,c=3,f=n-1,h=(1<<n)-1;if(o[1]=i.convert(e),n>1){var l=y(2*r.t);for(i.sqrTo(o[1],l);c<=h;)o[c]=y(2*r.t),i.mulTo(l,o[c-2],o[c]),c+=2}var d,p,g=t.t-1,m=!0,b=y(2*r.t);for(a=D(t[g])-1;g>=0;){for(a>=f?d=t[g]>>a-f&h:(d=(t[g]&(1<<a+1)-1)<<f-a,g>0&&(d|=t[g-1]>>u+a-f)),c=n;!(1&d);)d>>=1,--c;if((a-=c)<0&&(a+=u,--g),m)v(o[d],s),m=!1;else{for(;c>1;)i.sqrTo(s,b),i.sqrTo(b,s),c-=2;c>0?i.sqrTo(s,b):(p=s,s=b,b=p),i.mulTo(b,o[d],s)}for(;g>=0&&!(t[g]&1<<a);)i.sqrTo(s,b),p=s,s=b,b=p,--a<0&&(a=u-1,--g)}return i.revert(s)}function te(e,t){return e.r.reduce(t),t.q=e.q,t.r=e.r,t}function re(e,t){return t.q=e.q,t.r=e.r,t}function ne(e,t){var r=I(e,t);return R(r,e.q)>0&&B(r,e.q,r),re(e,r)}function ie(e,t){var r=x(e,t);return r.s<0&&T(e.q,r,r),re(e,r)}function ae(e,t){return te(e,K(e,t))}function se(e){return te(e,function(e){return M(e,y(2*e.t))}(e))}function oe(e,t){return te(e,(n=t,i=y((r=e).t),n<0?O(r,-n,i):N(r,n,i),i));var r,n,i}function ce(e){return re(e,W(e,e.q))}function ue(e,t,r,n){return{curve:e,x:t,y:r,z:n||te(e,E)}}function fe(e){return e.zinv||(e.zinv=ce(e.z)),ae(e.x,e.zinv)}function he(e){return e.zinv||(e.zinv=ce(e.z)),ae(e.y,e.zinv)}function le(e){return!e.x&&!e.y||q(e.z)&&!q(e.y)}function de(e){return e.curve.infinity}function pe(e,t){if(le(e))return t;if(le(t))return e;var r=ie(ae(t.y,e.z),ae(e.y,t.z)),n=ie(ae(t.x,e.z),ae(e.x,t.z));if(q(n))return q(r)?ge(e):de(e);var i=e.x,a=e.y,s=se(n),o=ae(s,n),c=ae(i,s),u=ae(se(r),e.z),f=ae(ie(ae(ie(u,oe(c,1)),t.z),o),n),h=ne(ae(ie(ie(ae(ae(c,C),r),ae(a,o)),ae(u,r)),t.z),ae(r,o)),l=ae(ae(o,e.z),t.z);return ue(e.curve,f,h,l)}function ge(e){if(le(e))return e;if(0===z(e.y))return de(e);var t=e.x,r=e.y,n=ae(r,e.z),i=ae(n,r),a=e.curve.a,s=ae(se(t),C);q(a)||(s=ne(s,ae(se(e.z),a)));var o=ae(oe(ie(se(s),ae(oe(t,3),i)),1),n),c=ie(ae(oe(ie(ae(ae(s,C),t),oe(i,1)),2),i),ae(se(s),s)),u=oe(ae(se(n),n),3);return ue(e.curve,o,c,u)}function ye(e,t){if(le(e))return e;if(0===z(t))return de(e);var r,n=t,i=K(n,C),a=function(e){return ue(e.curve,e.x,function(e){return re(e,x(e.q,e))}(e.y),e.z)}(e),s=e;for(r=L(i)-2;r>0;--r){s=ge(s);var o=X(i,r);o!==X(n,r)&&(s=pe(s,o?e:a))}return s}function ve(e){var t=new Uint8Array(e),r=y(8*t.length/u);r.t=0,r.s=0;for(var n=0,i=0,a=t.length;i<a;i++){var s=t[i];0===n?r[r.t++]=s:n+8>u?(r[r.t-1]|=(s&(1<<u-n)-1)<<n,r[r.t++]=s>>u-n):r[r.t-1]|=s<<n,(n+=8)>=u&&(n-=u)}return A(r)}function me(e,t){var r,n=!1,i=[],a=e.t,s=u-a*u%8;if(a-- >0)for(s<u&&(r=e[a]>>s)>0&&(n=!0,i.push(r));a>=0;)s<8?(r=(e[a]&(1<<s)-1)<<8-s,r|=e[--a]>>(s+=u-8)):(r=e[a]>>(s-=8)&255,s<=0&&(s+=u,--a)),r>0&&(n=!0),n&&i.push(r);var o=new Uint8Array(t?t/8:i.length);return n&&o.set(i.reverse()),o.buffer}function be(e){if("number"==typeof e||e instanceof Number)return w(e);(e=e.replace(/[^\-A-Fa-f0-9]/g,""))||(e="0");for(var t=y(e.length/7),r=e.length,n=!1,i=0;--r>=0;)if("-"!==e.charAt(r)){var a=parseInt(e.charAt(r),16);n=!1,0===i?t[t.t++]=a:i+4>u?(t[t.t-1]|=(a&(1<<u-i)-1)<<i,t[t.t++]=a>>u-i):t[t.t-1]|=a<<i,(i+=4)>=u&&(i-=u)}else n=!0;return n&&B(S,t,t),A(t)}function we(e){if(e.s<0)return"-"+we(F(e,y(e.t)));var t,r=!1,n="",i=e.t,a=u-i*u%4;if(i-- >0)for(a<u&&(t=e[i]>>a)>0&&(r=!0,n=t.toString(16));i>=0;)a<4?(t=(e[i]&(1<<a)-1)<<4-a,t|=e[--i]>>(a+=u-4)):(t=e[i]>>(a-=4)&15,a<=0&&(a+=u,--i)),t>0&&(r=!0),r&&(n+=t.toString(16));return"0x"+(r?n:"0")}function Se(e){for(var t=new Uint8Array(e),r=new Uint8Array(t.length),n=0,i=t.length;n<i;n++)r[i-n-1]=t[n];return r.buffer}function Ee(e){return this.hash&&(e=this.hash.digest(e)),("SC"===this.procreator||"VN"===this.procreator&&2012===this.hash.version)&&(e=Se(e)),e}function Ce(e){if(e instanceof s)return e;if(e&&e.buffer&&e.buffer instanceof s)return 0===e.byteOffset&&e.byteLength===e.buffer.byteLength?e.buffer:new Uint8Array(new Uint8Array(e,e.byteOffset,e.byteLength)).buffer;throw new i.DataError("CryptoOperationData or CryptoOperationDataView required")}function Ae(e){var t=Ce(e);if(t.byteLength%2>0)throw new i.DataError("Buffer length must be even");var r=t.byteLength/2;return[ve(new Uint8Array(t,0,r)),ve(new Uint8Array(t,r,r))]}function Be(e,t,r){var n=me(e,r),i=me(t,r),a=new Uint8Array(n.byteLength+i.byteLength);return a.set(new Uint8Array(n)),a.set(new Uint8Array(i),n.byteLength),a.buffer}function xe(e,t){var r=Ce(t),n=ve(Ee.call(this,r)),i=this.q,s=V(ve(Ce(e)),i),o=V(n,i);q(o)&&(o=E);for(var c,u=S;q(u);){for(var f=S;q(f);){var h=V(ve(this.ukm||(0,a.getSeed)(this.bitLength)),i);if(this.curve)f=V(fe(ye(this.P,h)),i);else{var l=this.p;f=V(ee(this.a,h,l),i)}}u=V(I(K(f,s),K(h,o)),i)}return"SC"===this.procreator?c={r:we(f),s:we(u)}:(c=Be(f,u,this.bitLength),"CP"!==this.procreator&&"VN"!==this.procreator||(c=Se(c))),c}function Te(e,t,r){var n,i,a=this.q;if("SC"===this.procreator)n=be(t.r),i=be(t.s);else{"CP"!==this.procreator&&"VN"!==this.procreator||(t=Se(t));var s=Ae(t);i=s[1],n=s[0]}if(R(n,a)>=0||R(i,a)>=0)return!1;var o=Ce(r),c=V(ve(Ee.call(this,o)),a);0===q(c)&&(c=E);var u=W(c,a),f=V(K(i,u),a),h=x(a,V(K(n,u),a));if(this.curve)var l=Ae(e),d=this.curve,p=function(e,t,r,n){var i;i=L(t)>L(n)?L(t)-1:L(n)-1;for(var a=de(e),s=pe(e,r);i>=0;)a=ge(a),X(t,i)?a=X(n,i)?pe(a,s):pe(a,e):X(n,i)&&(a=pe(a,r)),--i;return a}(this.P,f,new ue(d,te(d,l[0]),m=te(d,l[1])),h),g=V(fe(p),a);else{var y=this.p,v=this.a,m=ve(e);g=V(V(K(ee(v,f,y),ee(m,h,y)),y),a)}return 0===R(g,n)}function Ie(){var e=this.curve;if(e){for(var t=e.infinity;le(t);){var r=S;if(this.ukm)r=ve(this.ukm);else for(;q(r);)r=V(ve((0,a.getSeed)(this.bitLength)),this.q);var n=fe(t=ye(this.P,r)),s=he(t)}return{privateKey:me(r,this.bitLength),publicKey:Be(n,s,this.bitLength)}}throw new i.NotSupportedError("Key generation for GOST R 34.10-94 not supported")}function Fe(){if(this.curve){for(var e=S;q(e);)e=V(ve((0,a.getSeed)(this.bitLength)),this.q);return me(e,this.bitLength)}throw new i.NotSupportedError("Key generation for GOST R 34.10-94 not supported")}function ke(e,t){if(this.curve){var r=this.q,n=V(ve(Ce(t)),r),a=V(ve(Ce(e)),r);return me("VN"===this.procreator?V(K(n,a),r):V(K(n,W(a,r)),r))}throw new i.NotSupportedError("Key wrapping GOST R 34.10-94 not supported")}function Re(e,t){if(this.curve){var r=this.q,n=V(ve(Ce(t)),r),a=V(ve(Ce(e)),r);return me("VN"===this.procreator?V(K(n,W(a,r)),r):V(K(n,a),r))}throw new i.NotSupportedError("Key wrapping GOST R 34.10-94 not supported")}function De(e){var t,r=ve(this.ukm),n=this.q,i=V(ve(Ce(e)),n);if(this.curve){var a=ye(this.peer_Q,V(K(r,i),n));t=Be(fe(a),he(a),this.bitLength)}else{var s=this.p;this.a,t=me(ee(this.peer_y,i,s))}return Ee.call(this,t)}function _e(e,t){if(t<8||t>this.bitLength||t%8>0)throw new i.DataError("Length must be no more than "+this.bitLength+" bits and multiple of 8");var r=t/8,n=De.call(this,e),a=new Uint8Array(r);return a.set(new Uint8Array(n,0,r)),a.buffer}function Pe(e){var t=De.call(this,e),r=new Uint8Array(32);return r.set(new Uint8Array(t,0,32)),r.buffer}Y(Q,{convert:function(e){var t=y(e.t);return _(k(e),this.m.t,t),H(t,this.m,null,t),e.s<0&&R(t,S)>0&&B(this.m,t,t),t},revert:function(e){var t=y(e.t);return v(e,t),this.reduce(t),t},reduce:function(e){for(;e.t<=this.mt2;)e[e.t++]=0;for(var t=0;t<this.m.t;++t){var r=32767&e[t],n=r*this.mpl+((r*this.mph+(e[t]>>15)*this.mpl&this.um)<<15)&f;for(e[r=t+this.m.t]+=g(this.m,0,n,e,t,0,this.m.t);e[r]>=h;)e[r]-=h,e[++r]++}A(e),P(e,this.m.t,e),R(e,this.m)>=0&&B(e,this.m,e)},sqrTo:function(e,t){M(e,t),this.reduce(t)},mulTo:function(e,t,r){U(e,t,r),this.reduce(r)}}),Y($,{convert:function(e){if(e.s<0||e.t>2*this.m.t)return V(e,this.m);if(R(e,this.m)<0)return e;var t=y(e.t);return v(e,t),this.reduce(t),t},revert:function(e){return e},reduce:function(e){for(P(e,this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,A(e)),function(e,t,r,n){--r;var i=n.t=e.t+t.t-r;for(n.s=0;--i>=0;)n[i]=0;for(i=Math.max(r-e.t,0);i<t.t;++i)n[e.t+i-r]=g(e,r-i,t[i],n,0,0,e.t+i-r);A(n),P(n,1,n)}(this.mu,this.r2,this.m.t+1,this.q3),function(e,t,r,n){var i,a=Math.min(e.t+t.t,r);for(n.s=0,n.t=a;a>0;)n[--a]=0;for(i=n.t-e.t;a<i;++a)n[a+e.t]=g(e,0,t[a],n,a,0,e.t);for(i=Math.min(t.t,r);a<i;++a)g(e,0,t[a],n,a,0,r-a);A(n)}(this.m,this.q3,this.m.t+1,this.r2);R(e,this.r2)<0;)Z(e,1,this.m.t+1);for(B(e,this.r2,e);R(e,this.m)>=0;)B(e,this.m,e)},sqrTo:function(e,t){M(e,t),this.reduce(t)},mulTo:function(e,t,r){U(e,t,r),this.reduce(r)}})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.gostEngine=void 0;var n=r(41),i=r(40),a=r(81),s=r(19),o={execute:function(e,t,r){var n=function(e,t){if(!t)throw new(SyntaxError||Error)("Algorithm not defined");if(!t.name)throw new(SyntaxError||Error)("Algorithm name not defined");var r=t.name,n=t.mode;if("GOST 28147"!==r&&"GOST R 34.12"!==r&&"RC2"!==r||"generateKey"!==e&&("MAC"!==n||"sign"!==e&&"verify"!==e)&&("KW"!==n&&"MASK"!==n||"wrapKey"!==e&&"unwrapKey"!==e)&&(n&&"ES"!==n||"encrypt"!==e&&"decrypt"!==e)){if("GOST R 34.11"!==r&&"SHA"!==r||"digest"!==e&&("HMAC"!==n||"sign"!==e&&"verify"!==e&&"generateKey"!==e)&&("KDF"!==n&&"PBKDF2"!==n&&"PFXKDF"!==n&&"CPKDF"!==n||"deriveKey"!==e&&"deriveBits"!==e&&"generateKey"!==e)){if("GOST R 34.10"!==r||"generateKey"!==e&&(n&&"SIGN"!==n||"sign"!==e&&"verify"!==e)&&("MASK"!==n||"wrapKey"!==e&&"unwrapKey"!==e)&&("DH"!==n||"deriveKey"!==e&&"deriveBits"!==e))throw new s.NotSupportedError("Algorithm "+r+"-"+n+" is not valid for "+e);return"GostSign"}return"GostDigest"}return"GostCipher"}(t,e),i=this["get"+n](e);return i[t].apply(i,r)},getGostCipher:function(e){return new n.GostCipher(e)},getGostDigest:function(e){return new i.GostDigest(e)},getGostSign:function(e){return new a.GostSign(e)}};t.gostEngine=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.gostSubtleInstance=void 0,t.SubtleCrypto=E;var n=r(82),i=r(79),a=r(19),s=r(77);function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var f=function(e){function t(){return o(this,t),c(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return u(t,Error),t}(),h=function(e){function t(){return o(this,t),c(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return u(t,Error),t}(),l=(0,i.getCryptoModule)();function d(e,t){("string"==typeof e||e instanceof String)&&(e={name:e});var r=e.name;if(!r)throw new SyntaxError("Algorithm name not defined");var n=(n=r.split("/"))[0].split("-").concat(n.slice(1)),i={};if(r=n[0].replace(/[\.\s]/g,""),n=n.slice(1),r.indexOf("28147")>=0)i={name:"GOST 28147",version:1989,mode:(e.mode||("sign"===t||"verify"===t?"MAC":"wrapKey"===t||"unwrapKey"===t?"KW":"ES")).toUpperCase(),length:e.length||64};else if(r.indexOf("3412")>=0)i={name:"GOST R 34.12",version:2015,mode:(e.mode||("sign"===t||"verify"===t?"MAC":"wrapKey"===t||"unwrapKey"===t?"KW":"ES")).toUpperCase(),length:e.length||64};else if(r.indexOf("3411")>=0)i={name:"GOST R 34.11",version:2012,mode:(e.mode||("deriveKey"===t||"deriveBits"===t?"KDF":"sign"===t||"verify"===t?"HMAC":"HASH")).toUpperCase(),length:e.length||256};else if(r.indexOf("3410")>=0)i={name:"GOST R 34.10",version:2012,mode:(e.mode||("deriveKey"===t||"deriveBits"===t?"DH":"SIGN")).toUpperCase(),length:e.length||256};else if(r.indexOf("SHA")>=0)i={name:"SHA",version:160===(e.length||160)?1:2,mode:(e.mode||("deriveKey"===t||"deriveBits"===t?"KDF":"sign"===t||"verify"===t?"HMAC":"HASH")).toUpperCase(),length:e.length||160};else if(r.indexOf("RC2")>=0)i={name:"RC2",version:1,mode:(e.mode||("sign"===t||"verify"===t?"MAC":"wrapKey"===t||"unwrapKey"===t?"KW":"ES")).toUpperCase(),length:e.length||32};else if(r.indexOf("PBKDF2")>=0)(i=d(e.hash,"digest")).mode="PBKDF2";else if(r.indexOf("PFXKDF")>=0)(i=d(e.hash,"digest")).mode="PFXKDF";else if(r.indexOf("CPKDF")>=0)(i=d(e.hash,"digest")).mode="CPKDF";else{if(!(r.indexOf("HMAC")>=0))throw new a.NotSupportedError("Algorithm not supported");(i=d(e.hash,"digest")).mode="HMAC"}switch(n.forEach((function(e){if(e=e.toUpperCase(),/^[0-9]+$/.test(e))if(["8","16","32"].indexOf(e)>=0||"128"===i.length&&"64"===e)if("ES"===i.mode)i.shiftBits=parseInt(e);else{if("MAC"!==i.mode)throw new a.NotSupportedError("Algorithm "+i.name+" mode "+e+" not supported");i.macLength=parseInt(e)}else if(["89","94","01","12","15","1989","1994","2001","2012","2015"].indexOf(e)>=0){var t=parseInt(e);t=t<1900?t<80?2e3+t:1900+t:t,i.version=t}else["1"].indexOf(e)>=0&&"SHA"===i.name?(i.version=1,i.length=160):["256","384","512"].indexOf(e)>=0&&"SHA"===i.name?(i.version=2,i.length=parseInt(e)):["40","128"].indexOf(e)>=0&&"RC2"===i.name?(i.version=1,i.length=parseInt(e)):["64","128","256","512"].indexOf(e)>=0?i.length=parseInt(e):["1000","2000"].indexOf(e)>=0&&(i.iterations=parseInt(e));else if(["E-TEST","E-A","E-B","E-C","E-D","E-SC","E-Z","D-TEST","D-A","D-SC"].indexOf(e)>=0)i.sBox=e;else if(["S-TEST","S-A","S-B","S-C","S-D","X-A","X-B","X-C"].indexOf(e)>=0)i.namedParam=e;else if(["S-256-TEST","S-256-A","S-256-B","S-256-C","P-256","T-512-TEST","T-512-A","T-512-B","X-256-A","X-256-B","T-256-TEST","T-256-A","T-256-B","S-256-B","T-256-C","S-256-C"].indexOf(e)>=0)i.namedCurve=e;else if(["SC","CP","VN"].indexOf(e)>=0)i.procreator=e;else if("GOST 28147"===i.name||"GOST R 34.12"===i.name||"RC2"===i.name)if(["ES","MAC","KW","MASK"].indexOf(e)>=0)i.mode=e;else if(["ECB","CFB","OFB","CTR","CBC"].indexOf(e)>=0)i.mode="ES",i.block=e;else if(["CPKW","NOKW","SCKW"].indexOf(e)>=0)i.mode="KW",i.keyWrapping=e.replace("KW","");else if(["ZEROPADDING","PKCS5PADDING","NOPADDING","RANDOMPADDING","BITPADDING"].indexOf(e)>=0)i.padding=e.replace("PADDING","");else{if(!(["NOKM","CPKM"].indexOf(e)>=0))throw new a.NotSupportedError("Algorithm "+i.name+" mode "+e+" not supported");i.keyMeshing=e.replace("KM","")}else if("GOST R 34.11"===i.name||"SHA"===i.name){if(!(["HASH","KDF","HMAC","PBKDF2","PFXKDF","CPKDF"].indexOf(e)>=0))throw new a.NotSupportedError("Algorithm "+i.name+" mode "+e+" not supported");i.mode=e}else if("GOST R 34.10"===i.name){var r=e.replace(/[\.\s]/g,"");if(r.indexOf("GOST")>=0&&r.indexOf("3411")>=0)i.hash=e;else{if(!["SIGN","DH","MASK"].indexOf(e))throw new a.NotSupportedError("Algorithm "+i.name+" mode "+e+" not supported");i.mode=e}}})),i.procreator=e.procreator||i.procreator||"CP",i.name){case"GOST R 34.10":i.keySize=i.length/(1994===i.version?4:8);break;case"GOST R 34.11":case"GOST 28147":case"GOST R 34.12":i.keySize=32;break;case"RC2":i.keySize=Math.ceil(i.length/8);break;case"SHA":i.keySize=i.length/8}switch("ES"===i.mode&&(e.block&&(i.block=e.block),i.block&&(i.block=i.block.toUpperCase()),e.padding&&(i.padding=e.padding),i.padding&&(i.padding=i.padding.toUpperCase()),e.shiftBits&&(i.shiftBits=e.shiftBits),e.keyMeshing&&(i.keyMeshing=e.keyMeshing),i.keyMeshing&&(i.keyMeshing=i.keyMeshing.toUpperCase()),"importKey"!==t&&"generateKey"!==t&&(i.block=i.block||"ECB",i.padding=i.padding||("CBC"===i.block||"ECB"===i.block?"ZERO":"NO"),"CFB"!==i.block&&"OFB"!==i.block||(i.shiftBits=i.shiftBits||i.length),i.keyMeshing=i.keyMeshing||"NO")),"KW"===i.mode&&(e.keyWrapping&&(i.keyWrapping=e.keyWrapping),i.keyWrapping&&(i.keyWrapping=i.keyWrapping.toUpperCase()),"importKey"!==t&&"generateKey"!==t&&(i.keyWrapping=i.keyWrapping||"NO")),["sBox","namedParam","namedCurve","curve","param","modulusLength"].forEach((function(t){e[t]&&(i[t]=e[t])})),"importKey"!==t&&"generateKey"!==t&&("GOST 28147"===i.name?i.sBox=i.sBox||("SC"===i.procreator?"E-SC":"E-A"):"GOST R 34.12"===i.name&&64===i.length?i.sBox="E-Z":"GOST R 34.11"===i.name&&1994===i.version?i.sBox=i.sBox||("SC"===i.procreator?"D-SC":"D-A"):"GOST R 34.10"===i.name&&1994===i.version?i.namedParam=i.namedParam||("DH"===i.mode?"X-A":"S-A"):("GOST R 34.10"===i.name&&2001===i.version||"GOST R 34.10"===i.name&&2012===i.version)&&(i.namedCurve=i.namedCurve||(256===i.length?"SC"===i.procreator?"P-256":"DH"===i.mode?"X-256-A":"S-256-A":"T-512-A"===i.mode))),i.mode){case"DH":e.ukm&&(i.ukm=e.ukm),e.public&&(i.public=e.public);break;case"SIGN":case"KW":e.ukm&&(i.ukm=e.ukm);break;case"ES":case"MAC":e.iv&&(i.iv=e.iv);break;case"KDF":e.label&&(i.label=e.label),e.contex&&(i.context=e.contex);break;case"PBKDF2":case"PFXKDF":e.salt&&(i.salt=e.salt),e.iterations&&(i.iterations=e.iterations),e.diversifier&&(i.diversifier=e.diversifier);break;case"CPKDF":e.salt&&(i.salt=e.salt),e.iterations&&(i.iterations=e.iterations)}if(t&&("ES"!==i.mode&&"SIGN"!==i.mode&&"MAC"!==i.mode&&"HMAC"!==i.mode&&"KW"!==i.mode&&"DH"!==i.mode&&"MASK"!==i.mode&&"generateKey"===t||"ES"!==i.mode&&("encrypt"===t||"decrypt"===t)||"SIGN"!==i.mode&&"MAC"!==i.mode&&"HMAC"!==i.mode&&("sign"===t||"verify"===t)||"HASH"!==i.mode&&"digest"===t||"KW"!==i.mode&&"MASK"!==i.mode&&("wrapKey"===t||"unwrapKey"===t)||"DH"!==i.mode&&"PBKDF2"!==i.mode&&"PFXKDF"!==i.mode&&"CPKDF"!==i.mode&&"KDF"!==i.mode&&("deriveKey"===t||"deriveBits"===t)))throw new a.NotSupportedError("Algorithm mode "+i.mode+" not valid for method "+t);return e.hash&&(i.hash=e.hash),i.hash&&(("string"==typeof i.hash||i.hash instanceof String)&&i.procreator&&(i.hash=i.hash+"/"+i.procreator),i.hash=d(i.hash,"digest")),e.id&&(i.id=e.id),i}function p(e){if(!l||!l.subtle||!e)return!1;var t="string"==typeof e||e instanceof String?t=e:e.name;return!!t&&(((t=t.toUpperCase()).indexOf("KDF")>=0||t.indexOf("HMAC")>=0)&&e.hash?p(e.hash):-1===t.indexOf("GOST")&&-1===t.indexOf("SHA-1")&&-1===t.indexOf("RC2")&&-1===t.indexOf("?DES"))}function g(e,t){if(!e.algorithm)throw new SyntaxError("Key algorithm not defined");if(!e.algorithm.name)throw new SyntaxError("Key algorithm name not defined");var r=e.algorithm.name,n="GOST 28147"===r||"GOST R 34.12"===r||"RC2"===r,i="GOST R 34.11"===r||"SHA"===r,s="GOST R 34.10"===r;if(!n&&!s&&!i)throw new a.NotSupportedError("Key algorithm "+r+" is unsupproted");if(!e.type)throw new SyntaxError("Key type not defined");if((n||i)&&"secret"!==e.type||s&&"public"!==e.type&&"private"!==e.type)throw new a.DataError("Key type "+e.type+" is not valid for algorithm "+r);if(!e.usages||!e.usages.indexOf)throw new SyntaxError("Key usages not defined");for(var o=0,c=e.usages.length;o<c;o++){var u=e.usages[o];if(("encrypt"===u||"decrypt"===u)&&"secret"!==e.type||"sign"===u&&"public"===e.type||"verify"===u&&"private"===e.type)throw new f("Key type "+e.type+" is not valid for "+u)}if(t&&-1===e.usages.indexOf(t))throw new h("Key usages is not contain method "+t);if(!e.buffer)throw new SyntaxError("Key buffer is not defined");var l=8*e.buffer.byteLength,d=8*e.algorithm.keySize;if("secret"===e.type&&l!==(d||256)&&(e.usages.indexOf("encrypt")>=0||e.usages.indexOf("decrypt")>=0)||"private"===e.type&&256!==l&&512!==l||"public"===e.type&&512!==l&&1024!==l)throw new SyntaxError("Key buffer has wrong size "+l+" bit")}function y(e,t,r){if(g(r,e),t){var n;switch(t.mode){case"ES":n=["sBox","keyMeshing","padding","block"];break;case"SIGN":n=["namedCurve","namedParam","sBox","curve","param","modulusLength"];break;case"MAC":n=["sBox"];break;case"KW":n=["keyWrapping","ukm"];break;case"DH":n=["namedCurve","namedParam","sBox","ukm","curve","param","modulusLength"];break;case"KDF":n=["context","label"];break;case"PBKDF2":n=["sBox","iterations","salt"];break;case"PFXKDF":n=["sBox","iterations","salt","diversifier"];break;case"CPKDF":n=["sBox","salt"]}n&&n.forEach((function(e){r.algorithm[e]&&(t[e]=r.algorithm[e])}))}return r.buffer}function v(e,t,r,n,i){var a={type:i||("GOST R 34.10"===e.name?"private":"secret"),extractable:t||"false",algorithm:e,usages:r||[],buffer:n};return g(a),a}function m(e){e instanceof S&&(e=new Uint8Array(e));for(var t=new Uint8Array(e.length),r=0,n=e.length;r<n;r++)t[n-r-1]=e[r];return t.buffer}function b(e,t,r){return new Promise((function(i,a){try{i(n.gostEngine.execute(e,t,r))}catch(e){a(e)}}))}function w(e){try{e()}catch(e){}}var S=ArrayBuffer;function E(){}E.prototype.encrypt=function(e,t,r){return new Promise(w).then((function(){return p(e)?l.subtle.encrypt(e,t,r):b(e=d(e,"encrypt"),"encrypt",[y("encrypt",e,t),r])}))},E.prototype.decrypt=function(e,t,r){return new Promise(w).then((function(){return p(e)?l.subtle.decrypt(e,t,r):b(e=d(e,"decrypt"),"decrypt",[y("decrypt",e,t),r])}))},E.prototype.sign=function(e,t,r){return new Promise(w).then((function(){if(p(e))return l.subtle.sign(e,t,r);var n=b(e=d(e,"sign"),"sign",[y("sign",e,t),r]).then((function(t){return"SC"===e.procreator&&"SIGN"===e.mode&&(t=s.gostASN1Instance.GostSignature.encode(t)),t}));return n}))},E.prototype.verify=function(e,t,r,n){return new Promise(w).then((function(){if(p(e))return l.subtle.verify(e,t,r,n);if("SC"===(e=d(e,"verify")).procreator&&"SIGN"===e.mode){var i=s.gostASN1Instance.GostSignature.decode(r);r={r:i.r,s:i.s}}return b(e,"verify",[y("verify",e,t),r,n])}))},E.prototype.digest=function(e,t){return new Promise(w).then((function(){return p(e)?l.subtle.digest(e,t):b(e=d(e,"digest"),"digest",[t])}))},E.prototype.generateKey=function(e,t,r){return new Promise(w).then((function(){if(p(e))return l.subtle.generateKey(e,t,r);var n=e.privateKey,i=e.publicKey;return e=d(e,"generateKey"),n=n?d(n,"generateKey"):e,i=i?d(i,"generateKey"):e,b(e,"generateKey",[]).then((function(a){return a.publicKey&&a.privateKey?function(e,t,r,n,i,a){if(!n||!n.indexOf)throw new SyntaxError("Key usages not defined");var s=n.filter((function(e){return"sign"!==e})),o=n.filter((function(e){return"verify"!==e}));return{publicKey:v(e,r,s,i,"public"),privateKey:v(t,r,o,a,"private")}}(i,n,t,r,a.publicKey,a.privateKey):v(e,t,r,a)}))}))},E.prototype.deriveKey=function(e,t,r,n,i){return new Promise(w).then((function(){return p(e)?l.subtle.deriveKey(e,t,r,n,i):(e=d(e,"deriveKey"),r=d(r,"generateKey"),e.keySize=r.keySize,e.public&&(e.public.algorithm=d(e.public.algorithm),e.public=y("deriveKey",e,e.public)),b(e,"deriveKey",[y("deriveKey",e,t)]).then((function(e){return v(r,n,i,e)})))}))},E.prototype.deriveBits=function(e,t,r){return new Promise(w).then((function(){return p(e)?l.subtle.deriveBits(e,t,r):((e=d(e,"deriveBits")).public&&(e.public=y("deriveBits",e,e.public)),b(e,"deriveBits",[y("deriveBits",e,t),r]))}))},E.prototype.importKey=function(e,t,r,n,i){var o;return new Promise(w).then((function(){if(p(r))return l.subtle.importKey(e,t,r,n,i);if("raw"===e){if(r=d(r,"importKey"),i&&i.indexOf){var c=r.name.toUpperCase().replace(/[\.\s]/g,"");c.indexOf("3410")>=0&&i.indexOf("sign")>=0?o="private":c.indexOf("3410")>=0&&i.indexOf("verify")>=0&&(o="public")}return t}var u;if("pkcs8"===e)u=s.gostASN1Instance.GostPrivateKeyInfo.decode(t).object;else{if("spki"!==e)throw new a.NotSupportedError("Key format not supported");u=s.gostASN1Instance.GostSubjectPublicKeyInfo.decode(t).object}if(r=d(u.algorithm,"importKey"),o=u.type,!1!==n&&(n=n||u.extractable),i){for(var f=0;f<i.length;f++)if(u.usages.indexOf(i[f])<0)throw(0,a.DataError)("Key usage not valid for this key")}else i=u.usages;var h=u.buffer,g=r.keySize,y=h.byteLength;if("public"===o||g===y)return h;if(y%g>0)throw new a.DataError("Invalid key size");r.mode="MASK",r.procreator="VN";var v=[];for(f=g;f<y;f+=g)v.push(function(e){return function(t){return b(r,"unwrapKey",[e,t]).then((function(e){var t=v.pop();return t?t(e):(delete r.mode,e)}))}}(new Uint8Array(h,f,g)));return v.pop()(new Uint8Array(h,0,g))})).then((function(e){return v(r,n,i,e,o)}))},E.prototype.exportKey=function(e,t){return new Promise(w).then((function(){if(t&&p(t.algorithm))return l.subtle.exportKey(e,t);if(!t.extractable)throw new h("Key not extractable");var r=y(null,null,t);if("raw"===e)return r;if("pkcs8"===e&&t.algorithm&&t.algorithm.id){if("VN"===t.algorithm.procreator){var n,i=t.algorithm;return i.mode="MASK",b(i,"generateKey").then((function(e){return b(i,"wrapKey",[n=e,t.buffer])})).then((function(e){delete i.mode;var t=new Uint8Array(e.byteLength+n.byteLength);t.set(new Uint8Array(e,0,e.byteLength)),t.set(new Uint8Array(n,0,n.byteLength),e.byteLength);var r=t.buffer;return r.enclosed=!0,s.gostASN1Instance.GostPrivateKeyInfo.encode({algorithm:i,buffer:r})}))}return s.gostASN1Instance.GostPrivateKeyInfo.encode(t)}if("spki"===e&&t.algorithm&&t.algorithm.id)return s.gostASN1Instance.GostSubjectPublicKeyInfo.encode(t);throw new a.NotSupportedError("Key format not supported")}))},E.prototype.wrapKey=function(e,t,r,n){return new Promise(w).then((function(){if(p(n))return l.subtle.wrapKey(e,t,r,n);n=d(n,"wrapKey");var i=y(null,null,t);return"SC"===n.procreator&&"private"===t.type&&(i=m(i)),b(n,"wrapKey",[y("wrapKey",n,r),i]).then((function(t){if("raw"===e)return t;throw new a.NotSupportedError("Key format not supported")}))}))},E.prototype.unwrapKey=function(e,t,r,n,i,s,o){return new Promise(w).then((function(){if(p(n))return l.subtle.unwrapKey(e,t,r,n,i,s,o);if(n=d(n,"unwrapKey"),i=d(i,"importKey"),"raw"!==e)throw new a.NotSupportedError("Key format not supported");return b(n,"unwrapKey",[y("unwrapKey",n,r),t]).then((function(e){var t;if(i&&i.name){var r=i.name.toUpperCase().replace(/[\.\s]/g,"");r.indexOf("3410")>=0&&o.indexOf("sign")>=0?t="private":r.indexOf("3410")>=0&&o.indexOf("verify")>=0&&(t="public")}return"SC"===n.procreator&&"private"===t&&(e=m(e)),v(i,s,o,e,t)}))}))},t.gostSubtleInstance=new E},function(e,t,r){"use strict";(function(e,n){function i(){throw new Error("secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11")}var a=r(1),s=r(12),o=a.Buffer,c=a.kMaxLength,u=e.crypto||e.msCrypto,f=Math.pow(2,32)-1;function h(e,t){if("number"!=typeof e||e!=e)throw new TypeError("offset must be a number");if(e>f||e<0)throw new TypeError("offset must be a uint32");if(e>c||e>t)throw new RangeError("offset out of range")}function l(e,t,r){if("number"!=typeof e||e!=e)throw new TypeError("size must be a number");if(e>f||e<0)throw new TypeError("size must be a uint32");if(e+t>r||e>c)throw new RangeError("buffer too small")}function d(e,t,r,i){if(n.browser){var a=e.buffer,o=new Uint8Array(a,t,r);return u.getRandomValues(o),i?void n.nextTick((function(){i(null,e)})):e}if(!i)return s(r).copy(e,t),e;s(r,(function(r,n){if(r)return i(r);n.copy(e,t),i(null,e)}))}u&&u.getRandomValues||!n.browser?(t.randomFill=function(t,r,n,i){if(!(o.isBuffer(t)||t instanceof e.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if("function"==typeof r)i=r,r=0,n=t.length;else if("function"==typeof n)i=n,n=t.length-r;else if("function"!=typeof i)throw new TypeError('"cb" argument must be a function');return h(r,t.length),l(n,r,t.length),d(t,r,n,i)},t.randomFillSync=function(t,r,n){if(void 0===r&&(r=0),!(o.isBuffer(t)||t instanceof e.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');return h(r,t.length),void 0===n&&(n=t.length-r),l(n,r,t.length),d(t,r,n)}):(t.randomFill=i,t.randomFillSync=i)}).call(this,r(7),r(9))},function(e,t,r){(function(t){var n=r(20),i=r(44),a=r(43),s=r(3),o=r(27),c=r(18),u=r(42);e.exports=function(e,r,f){var h;h=e.padding?e.padding:f?1:4;var l,d=n(e),p=d.modulus.byteLength();if(r.length>p||new s(r).cmp(d.modulus)>=0)throw new Error("decryption error");l=f?u(new s(r),d):o(r,d);var g=new t(p-l.length);if(g.fill(0),l=t.concat([g,l],p),4===h)return function(e,r){e.modulus;var n=e.modulus.byteLength(),s=(r.length,c("sha1").update(new t("")).digest()),o=s.length;if(0!==r[0])throw new Error("decryption error");var u=r.slice(1,o+1),f=r.slice(o+1),h=a(u,i(f,o)),l=a(f,i(h,n-o-1));if(function(e,r){e=new t(e),r=new t(r);var n=0,i=e.length;e.length!==r.length&&(n++,i=Math.min(e.length,r.length));for(var a=-1;++a<i;)n+=e[a]^r[a];return n}(s,l.slice(0,o)))throw new Error("decryption error");for(var d=o;0===l[d];)d++;if(1!==l[d++])throw new Error("decryption error");return l.slice(d)}(d,l);if(1===h)return function(e,t,r){for(var n=t.slice(0,2),i=2,a=0;0!==t[i++];)if(i>=t.length){a++;break}var s=t.slice(2,i-1);if(t.slice(i-1,i),("0002"!==n.toString("hex")&&!r||"0001"!==n.toString("hex")&&r)&&a++,s.length<8&&a++,a)throw new Error("decryption error");return t.slice(i)}(0,l,f);if(3===h)return l;throw new Error("unknown padding")}}).call(this,r(2).Buffer)},function(e,t,r){(function(t){var n=r(20),i=r(12),a=r(18),s=r(44),o=r(43),c=r(3),u=r(42),f=r(27);e.exports=function(e,r,h){var l;l=e.padding?e.padding:h?1:4;var d,p=n(e);if(4===l)d=function(e,r){var n=e.modulus.byteLength(),u=r.length,f=a("sha1").update(new t("")).digest(),h=f.length,l=2*h;if(u>n-l-2)throw new Error("message too long");var d=new t(n-u-l-2);d.fill(0);var p=n-h-1,g=i(h),y=o(t.concat([f,d,new t([1]),r],p),s(g,p)),v=o(g,s(y,h));return new c(t.concat([new t([0]),v,y],n))}(p,r);else if(1===l)d=function(e,r,n){var a,s=r.length,o=e.modulus.byteLength();if(s>o-11)throw new Error("message too long");return n?(a=new t(o-s-3)).fill(255):a=function(e,r){for(var n,a=new t(e),s=0,o=i(2*e),c=0;s<e;)c===o.length&&(o=i(2*e),c=0),(n=o[c++])&&(a[s++]=n);return a}(o-s-3),new c(t.concat([new t([0,n?1:2]),a,new t([0]),r],o))}(p,r,h);else{if(3!==l)throw new Error("unknown padding");if((d=new c(r)).cmp(p.modulus)>=0)throw new Error("data too long for modulus")}return h?f(d,p):u(d,p)}}).call(this,r(2).Buffer)},function(e,t,r){t.publicEncrypt=r(86),t.privateDecrypt=r(85),t.privateEncrypt=function(e,r){return t.publicEncrypt(e,r,!0)},t.publicDecrypt=function(e,r){return t.privateDecrypt(e,r,!0)}},function(e,t,r){(function(t){var n=r(4),i=r(3);e.exports=function(e){return new s(e)};var a={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 s(e){this.curveType=a[e],this.curveType||(this.curveType={name:e}),this.curve=new n.ec(this.curveType.name),this.keys=void 0}function o(e,r,n){Array.isArray(e)||(e=e.toArray());var i=new t(e);if(n&&i.length<n){var a=new t(n-i.length);a.fill(0),i=t.concat([a,i])}return r?i.toString(r):i}a.p224=a.secp224r1,a.p256=a.secp256r1=a.prime256v1,a.p192=a.secp192r1=a.prime192v1,a.p384=a.secp384r1,a.p521=a.secp521r1,s.prototype.generateKeys=function(e,t){return this.keys=this.curve.genKeyPair(),this.getPublicKey(e,t)},s.prototype.computeSecret=function(e,r,n){return r=r||"utf8",t.isBuffer(e)||(e=new t(e,r)),o(this.curve.keyFromPublic(e).getPublic().mul(this.keys.getPrivate()).getX(),n,this.curveType.byteLength)},s.prototype.getPublicKey=function(e,t){var r=this.keys.getPublic("compressed"===t,!0);return"hybrid"===t&&(r[r.length-1]%2?r[0]=7:r[0]=6),o(r,e)},s.prototype.getPrivateKey=function(e){return o(this.keys.getPrivate(),e)},s.prototype.setPublicKey=function(e,r){return r=r||"utf8",t.isBuffer(e)||(e=new t(e,r)),this.keys._importPublic(e),this},s.prototype.setPrivateKey=function(e,r){r=r||"utf8",t.isBuffer(e)||(e=new t(e,r));var n=new i(e);return n=n.toString(16),this.keys=this.curve.genKeyPair(),this.keys._importPrivate(n),this}}).call(this,r(2).Buffer)},function(e,t,r){(function(t){var n=r(3),i=r(4).ec,a=r(20),s=r(45);function o(e,t){if(e.cmpn(0)<=0)throw new Error("invalid sig");if(e.cmp(t)>=t)throw new Error("invalid sig")}e.exports=function(e,r,c,u,f){var h=a(c);if("ec"===h.type){if("ecdsa"!==u&&"ecdsa/rsa"!==u)throw new Error("wrong public key type");return function(e,t,r){var n=s[r.data.algorithm.curve.join(".")];if(!n)throw new Error("unknown curve "+r.data.algorithm.curve.join("."));var a=new i(n),o=r.data.subjectPrivateKey.data;return a.verify(t,e,o)}(e,r,h)}if("dsa"===h.type){if("dsa"!==u)throw new Error("wrong public key type");return function(e,t,r){var i=r.data.p,s=r.data.q,c=r.data.g,u=r.data.pub_key,f=a.signature.decode(e,"der"),h=f.s,l=f.r;o(h,s),o(l,s);var d=n.mont(i),p=h.invm(s);return 0===c.toRed(d).redPow(new n(t).mul(p).mod(s)).fromRed().mul(u.toRed(d).redPow(l.mul(p).mod(s)).fromRed()).mod(i).mod(s).cmp(l)}(e,r,h)}if("rsa"!==u&&"ecdsa/rsa"!==u)throw new Error("wrong public key type");r=t.concat([f,r]);for(var l=h.modulus.byteLength(),d=[1],p=0;r.length+d.length+2<l;)d.push(255),p++;d.push(0);for(var g=-1;++g<r.length;)d.push(r[g]);d=new t(d);var y=n.mont(h.modulus);e=(e=new n(e).toRed(y)).redPow(new n(h.publicExponent)),e=new t(e.fromRed().toArray());var v=p<8?1:0;for(l=Math.min(e.length,d.length),e.length!==d.length&&(v=1),g=-1;++g<l;)v|=e[g]^d[g];return 0===v}}).call(this,r(2).Buffer)},function(e,t,r){(function(t){var n=/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,i=/^-----BEGIN ((?:.* KEY)|CERTIFICATE)-----/m,a=/^-----BEGIN ((?:.* KEY)|CERTIFICATE)-----([0-9A-z\n\r\+\/\=]+)-----END \1-----$/m,s=r(22),o=r(29);e.exports=function(e,r){var c,u=e.toString(),f=u.match(n);if(f){var h="aes"+f[1],l=new t(f[2],"hex"),d=new t(f[3].replace(/[\r\n]/g,""),"base64"),p=s(r,l.slice(0,8),parseInt(f[1],10)).key,g=[],y=o.createDecipheriv(h,p,l);g.push(y.update(d)),g.push(y.final()),c=t.concat(g)}else{var v=u.match(a);c=new t(v[2].replace(/[\r\n]/g,""),"base64")}return{tag:u.match(i)[1],data:c}}}).call(this,r(2).Buffer)},function(e){e.exports={"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"}},function(e,t,r){"use strict";var n=r(14),i=n.define("Time",(function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})})),a=n.define("AttributeTypeValue",(function(){this.seq().obj(this.key("type").objid(),this.key("value").any())})),s=n.define("AlgorithmIdentifier",(function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional())})),o=n.define("SubjectPublicKeyInfo",(function(){this.seq().obj(this.key("algorithm").use(s),this.key("subjectPublicKey").bitstr())})),c=n.define("RelativeDistinguishedName",(function(){this.setof(a)})),u=n.define("RDNSequence",(function(){this.seqof(c)})),f=n.define("Name",(function(){this.choice({rdnSequence:this.use(u)})})),h=n.define("Validity",(function(){this.seq().obj(this.key("notBefore").use(i),this.key("notAfter").use(i))})),l=n.define("Extension",(function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())})),d=n.define("TBSCertificate",(function(){this.seq().obj(this.key("version").explicit(0).int(),this.key("serialNumber").int(),this.key("signature").use(s),this.key("issuer").use(f),this.key("validity").use(h),this.key("subject").use(f),this.key("subjectPublicKeyInfo").use(o),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(l).optional())})),p=n.define("X509Certificate",(function(){this.seq().obj(this.key("tbsCertificate").use(d),this.key("signatureAlgorithm").use(s),this.key("signatureValue").bitstr())}));e.exports=p},function(e,t,r){var n=r(0),i=r(46);function a(e){i.call(this,e),this.enc="pem"}n(a,i),e.exports=a,a.prototype.encode=function(e,t){for(var r=i.prototype.encode.call(this,e).toString("base64"),n=["-----BEGIN "+t.label+"-----"],a=0;a<r.length;a+=64)n.push(r.slice(a,a+64));return n.push("-----END "+t.label+"-----"),n.join("\n")}},function(e,t,r){var n=t;n.der=r(46),n.pem=r(93)},function(e,t,r){var n=r(0),i=r(2).Buffer,a=r(47);function s(e){a.call(this,e),this.enc="pem"}n(s,a),e.exports=s,s.prototype.decode=function(e,t){for(var r=e.toString().split(/[\r\n]+/g),n=t.label.toUpperCase(),s=/^-----(BEGIN|END) ([^-]+)-----$/,o=-1,c=-1,u=0;u<r.length;u++){var f=r[u].match(s);if(null!==f&&f[2]===n){if(-1!==o){if("END"!==f[1])break;c=u;break}if("BEGIN"!==f[1])break;o=u}}if(-1===o||-1===c)throw new Error("PEM section not found for: "+n);var h=r.slice(o+1,c).join("");h.replace(/[^a-z0-9\+\/=]+/gi,"");var l=new i(h,"base64");return a.prototype.decode.call(this,l,t)}},function(e,t,r){var n=t;n.der=r(47),n.pem=r(95)},function(e,t,r){var n=r(48);t.tagClass={0:"universal",1:"application",2:"context",3:"private"},t.tagClassByName=n._reverse(t.tagClass),t.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},t.tagByName=n._reverse(t.tag)},function(e,t,r){var n=r(13).Reporter,i=r(13).EncoderBuffer,a=r(13).DecoderBuffer,s=r(5),o=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],c=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(o);function u(e,t){var r={};this._baseState=r,r.enc=e,r.parent=t||null,r.children=null,r.tag=null,r.args=null,r.reverseArgs=null,r.choice=null,r.optional=!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())}e.exports=u;var f=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];u.prototype.clone=function(){var e=this._baseState,t={};f.forEach((function(r){t[r]=e[r]}));var r=new this.constructor(t.parent);return r._baseState=t,r},u.prototype._wrap=function(){var e=this._baseState;c.forEach((function(t){this[t]=function(){var r=new this.constructor(this);return e.children.push(r),r[t].apply(r,arguments)}}),this)},u.prototype._init=function(e){var t=this._baseState;s(null===t.parent),e.call(this),t.children=t.children.filter((function(e){return e._baseState.parent===this}),this),s.equal(t.children.length,1,"Root node can have only one child")},u.prototype._useArgs=function(e){var t=this._baseState,r=e.filter((function(e){return e instanceof this.constructor}),this);e=e.filter((function(e){return!(e instanceof this.constructor)}),this),0!==r.length&&(s(null===t.children),t.children=r,r.forEach((function(e){e._baseState.parent=this}),this)),0!==e.length&&(s(null===t.args),t.args=e,t.reverseArgs=e.map((function(e){if("object"!=typeof e||e.constructor!==Object)return e;var t={};return Object.keys(e).forEach((function(r){r==(0|r)&&(r|=0);var n=e[r];t[n]=r})),t})))},["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"].forEach((function(e){u.prototype[e]=function(){var t=this._baseState;throw new Error(e+" not implemented for encoding: "+t.enc)}})),o.forEach((function(e){u.prototype[e]=function(){var t=this._baseState,r=Array.prototype.slice.call(arguments);return s(null===t.tag),t.tag=e,this._useArgs(r),this}})),u.prototype.use=function(e){s(e);var t=this._baseState;return s(null===t.use),t.use=e,this},u.prototype.optional=function(){return this._baseState.optional=!0,this},u.prototype.def=function(e){var t=this._baseState;return s(null===t.default),t.default=e,t.optional=!0,this},u.prototype.explicit=function(e){var t=this._baseState;return s(null===t.explicit&&null===t.implicit),t.explicit=e,this},u.prototype.implicit=function(e){var t=this._baseState;return s(null===t.explicit&&null===t.implicit),t.implicit=e,this},u.prototype.obj=function(){var e=this._baseState,t=Array.prototype.slice.call(arguments);return e.obj=!0,0!==t.length&&this._useArgs(t),this},u.prototype.key=function(e){var t=this._baseState;return s(null===t.key),t.key=e,this},u.prototype.any=function(){return this._baseState.any=!0,this},u.prototype.choice=function(e){var t=this._baseState;return s(null===t.choice),t.choice=e,this._useArgs(Object.keys(e).map((function(t){return e[t]}))),this},u.prototype.contains=function(e){var t=this._baseState;return s(null===t.use),t.contains=e,this},u.prototype._decode=function(e,t){var r=this._baseState;if(null===r.parent)return e.wrapResult(r.children[0]._decode(e,t));var n,i=r.default,s=!0,o=null;if(null!==r.key&&(o=e.enterKey(r.key)),r.optional){var c=null;if(null!==r.explicit?c=r.explicit:null!==r.implicit?c=r.implicit:null!==r.tag&&(c=r.tag),null!==c||r.any){if(s=this._peekTag(e,c,r.any),e.isError(s))return s}else{var u=e.save();try{null===r.choice?this._decodeGeneric(r.tag,e,t):this._decodeChoice(e,t),s=!0}catch(e){s=!1}e.restore(u)}}if(r.obj&&s&&(n=e.enterObject()),s){if(null!==r.explicit){var f=this._decodeTag(e,r.explicit);if(e.isError(f))return f;e=f}var h=e.offset;if(null===r.use&&null===r.choice){r.any&&(u=e.save());var l=this._decodeTag(e,null!==r.implicit?r.implicit:r.tag,r.any);if(e.isError(l))return l;r.any?i=e.raw(u):e=l}if(t&&t.track&&null!==r.tag&&t.track(e.path(),h,e.length,"tagged"),t&&t.track&&null!==r.tag&&t.track(e.path(),e.offset,e.length,"content"),r.any||(i=null===r.choice?this._decodeGeneric(r.tag,e,t):this._decodeChoice(e,t)),e.isError(i))return i;if(r.any||null!==r.choice||null===r.children||r.children.forEach((function(r){r._decode(e,t)})),r.contains&&("octstr"===r.tag||"bitstr"===r.tag)){var d=new a(i);i=this._getUse(r.contains,e._reporterState.obj)._decode(d,t)}}return r.obj&&s&&(i=e.leaveObject(n)),null===r.key||null===i&&!0!==s?null!==o&&e.exitKey(o):e.leaveKey(o,r.key,i),i},u.prototype._decodeGeneric=function(e,t,r){var n=this._baseState;return"seq"===e||"set"===e?null:"seqof"===e||"setof"===e?this._decodeList(t,e,n.args[0],r):/str$/.test(e)?this._decodeStr(t,e,r):"objid"===e&&n.args?this._decodeObjid(t,n.args[0],n.args[1],r):"objid"===e?this._decodeObjid(t,null,null,r):"gentime"===e||"utctime"===e?this._decodeTime(t,e,r):"null_"===e?this._decodeNull(t,r):"bool"===e?this._decodeBool(t,r):"objDesc"===e?this._decodeStr(t,e,r):"int"===e||"enum"===e?this._decodeInt(t,n.args&&n.args[0],r):null!==n.use?this._getUse(n.use,t._reporterState.obj)._decode(t,r):t.error("unknown tag: "+e)},u.prototype._getUse=function(e,t){var r=this._baseState;return r.useDecoder=this._use(e,t),s(null===r.useDecoder._baseState.parent),r.useDecoder=r.useDecoder._baseState.children[0],r.implicit!==r.useDecoder._baseState.implicit&&(r.useDecoder=r.useDecoder.clone(),r.useDecoder._baseState.implicit=r.implicit),r.useDecoder},u.prototype._decodeChoice=function(e,t){var r=this._baseState,n=null,i=!1;return Object.keys(r.choice).some((function(a){var s=e.save(),o=r.choice[a];try{var c=o._decode(e,t);if(e.isError(c))return!1;n={type:a,value:c},i=!0}catch(t){return e.restore(s),!1}return!0}),this),i?n:e.error("Choice not matched")},u.prototype._createEncoderBuffer=function(e){return new i(e,this.reporter)},u.prototype._encode=function(e,t,r){var n=this._baseState;if(null===n.default||n.default!==e){var i=this._encodeValue(e,t,r);if(void 0!==i&&!this._skipDefault(i,t,r))return i}},u.prototype._encodeValue=function(e,t,r){var i=this._baseState;if(null===i.parent)return i.children[0]._encode(e,t||new n);var a=null;if(this.reporter=t,i.optional&&void 0===e){if(null===i.default)return;e=i.default}var s=null,o=!1;if(i.any)a=this._createEncoderBuffer(e);else if(i.choice)a=this._encodeChoice(e,t);else if(i.contains)s=this._getUse(i.contains,r)._encode(e,t),o=!0;else if(i.children)s=i.children.map((function(r){if("null_"===r._baseState.tag)return r._encode(null,t,e);if(null===r._baseState.key)return t.error("Child should have a key");var n=t.enterKey(r._baseState.key);if("object"!=typeof e)return t.error("Child expected, but input is not object");var i=r._encode(e[r._baseState.key],t,e);return t.leaveKey(n),i}),this).filter((function(e){return e})),s=this._createEncoderBuffer(s);else if("seqof"===i.tag||"setof"===i.tag){if(!i.args||1!==i.args.length)return t.error("Too many args for : "+i.tag);if(!Array.isArray(e))return t.error("seqof/setof, but data is not Array");var c=this.clone();c._baseState.implicit=null,s=this._createEncoderBuffer(e.map((function(r){var n=this._baseState;return this._getUse(n.args[0],e)._encode(r,t)}),c))}else null!==i.use?a=this._getUse(i.use,r)._encode(e,t):(s=this._encodePrimitive(i.tag,e),o=!0);if(!i.any&&null===i.choice){var u=null!==i.implicit?i.implicit:i.tag,f=null===i.implicit?"universal":"context";null===u?null===i.use&&t.error("Tag could be omitted only for .use()"):null===i.use&&(a=this._encodeComposite(u,o,f,s))}return null!==i.explicit&&(a=this._encodeComposite(i.explicit,!1,"context",a)),a},u.prototype._encodeChoice=function(e,t){var r=this._baseState,n=r.choice[e.type];return n||s(!1,e.type+" not found in "+JSON.stringify(Object.keys(r.choice))),n._encode(e.value,t)},u.prototype._encodePrimitive=function(e,t){var r=this._baseState;if(/str$/.test(e))return this._encodeStr(t,e);if("objid"===e&&r.args)return this._encodeObjid(t,r.reverseArgs[0],r.args[1]);if("objid"===e)return this._encodeObjid(t,null,null);if("gentime"===e||"utctime"===e)return this._encodeTime(t,e);if("null_"===e)return this._encodeNull();if("int"===e||"enum"===e)return this._encodeInt(t,r.args&&r.reverseArgs[0]);if("bool"===e)return this._encodeBool(t);if("objDesc"===e)return this._encodeStr(t,e);throw new Error("Unsupported tag: "+e)},u.prototype._isNumstr=function(e){return/^[0-9 ]*$/.test(e)},u.prototype._isPrintstr=function(e){return/^[A-Za-z0-9 '\(\)\+,\-\.\/:=\?]*$/.test(e)}},function(e,t,r){var n=r(0);function i(e){this._reporterState={obj:null,path:[],options:e||{},errors:[]}}function a(e,t){this.path=e,this.rethrow(t)}t.Reporter=i,i.prototype.isError=function(e){return e instanceof a},i.prototype.save=function(){var e=this._reporterState;return{obj:e.obj,pathLen:e.path.length}},i.prototype.restore=function(e){var t=this._reporterState;t.obj=e.obj,t.path=t.path.slice(0,e.pathLen)},i.prototype.enterKey=function(e){return this._reporterState.path.push(e)},i.prototype.exitKey=function(e){var t=this._reporterState;t.path=t.path.slice(0,e-1)},i.prototype.leaveKey=function(e,t,r){var n=this._reporterState;this.exitKey(e),null!==n.obj&&(n.obj[t]=r)},i.prototype.path=function(){return this._reporterState.path.join("/")},i.prototype.enterObject=function(){var e=this._reporterState,t=e.obj;return e.obj={},t},i.prototype.leaveObject=function(e){var t=this._reporterState,r=t.obj;return t.obj=e,r},i.prototype.error=function(e){var t,r=this._reporterState,n=e instanceof a;if(t=n?e:new a(r.path.map((function(e){return"["+JSON.stringify(e)+"]"})).join(""),e.message||e,e.stack),!r.options.partial)throw t;return n||r.errors.push(t),t},i.prototype.wrapResult=function(e){var t=this._reporterState;return t.options.partial?{result:this.isError(e)?null:e,errors:t.errors}:e},n(a,Error),a.prototype.rethrow=function(e){if(this.message=e+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,a),!this.stack)try{throw new Error(this.message)}catch(e){this.stack=e.stack}return this}},function(e,t){var r=[].indexOf;e.exports=function(e,t){if(r)return e.indexOf(t);for(var n=0;n<e.length;++n)if(e[n]===t)return n;return-1}},function(module,exports,__nested_webpack_require_938008__){var indexOf=__nested_webpack_require_938008__(100),Object_keys=function(e){if(Object.keys)return Object.keys(e);var t=[];for(var r in e)t.push(r);return t},forEach=function(e,t){if(e.forEach)return e.forEach(t);for(var r=0;r<e.length;r++)t(e[r],r,e)},defineProp=function(){try{return Object.defineProperty({},"_",{}),function(e,t,r){Object.defineProperty(e,t,{writable:!0,enumerable:!1,configurable:!0,value:r})}}catch(e){return function(e,t,r){e[t]=r}}}(),globals=["Array","Boolean","Date","Error","EvalError","Function","Infinity","JSON","Math","NaN","Number","Object","RangeError","ReferenceError","RegExp","String","SyntaxError","TypeError","URIError","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","eval","isFinite","isNaN","parseFloat","parseInt","undefined","unescape"];function Context(){}Context.prototype={};var Script=exports.Script=function(e){if(!(this instanceof Script))return new Script(e);this.code=e};Script.prototype.runInContext=function(e){if(!(e instanceof Context))throw new TypeError("needs a 'context' argument.");var t=document.createElement("iframe");t.style||(t.style={}),t.style.display="none",document.body.appendChild(t);var r=t.contentWindow,n=r.eval,i=r.execScript;!n&&i&&(i.call(r,"null"),n=r.eval),forEach(Object_keys(e),(function(t){r[t]=e[t]})),forEach(globals,(function(t){e[t]&&(r[t]=e[t])}));var a=Object_keys(r),s=n.call(r,this.code);return forEach(Object_keys(r),(function(t){(t in e||-1===indexOf(a,t))&&(e[t]=r[t])})),forEach(globals,(function(t){t in e||defineProp(e,t,r[t])})),document.body.removeChild(t),s},Script.prototype.runInThisContext=function(){return eval(this.code)},Script.prototype.runInNewContext=function(e){var t=Script.createContext(e),r=this.runInContext(t);return forEach(Object_keys(t),(function(r){e[r]=t[r]})),r},forEach(Object_keys(Script.prototype),(function(e){exports[e]=Script[e]=function(t){var r=Script(t);return r[e].apply(r,[].slice.call(arguments,1))}})),exports.createScript=function(e){return exports.Script(e)},exports.createContext=Script.createContext=function(e){var t=new Context;return"object"==typeof e&&forEach(Object_keys(e),(function(r){t[r]=e[r]})),t}},function(e,t,r){var n=r(14),i=r(0);function a(e,t){this.name=e,this.body=t,this.decoders={},this.encoders={}}t.define=function(e,t){return new a(e,t)},a.prototype._createNamed=function(e){var t;try{t=r(101).runInThisContext("(function "+this.name+"(entity) {\n this._initNamed(entity);\n})")}catch(e){t=function(e){this._initNamed(e)}}return i(t,e),t.prototype._initNamed=function(t){e.call(this,t)},new t(this)},a.prototype._getDecoder=function(e){return e=e||"der",this.decoders.hasOwnProperty(e)||(this.decoders[e]=this._createNamed(n.decoders[e])),this.decoders[e]},a.prototype.decode=function(e,t,r){return this._getDecoder(t).decode(e,r)},a.prototype._getEncoder=function(e){return e=e||"der",this.encoders.hasOwnProperty(e)||(this.encoders[e]=this._createNamed(n.encoders[e])),this.encoders[e]},a.prototype.encode=function(e,t,r){return this._getEncoder(t).encode(e,r)}},function(e,t,r){"use strict";var n=r(14);t.certificate=r(92);var i=n.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())}));t.RSAPrivateKey=i;var a=n.define("RSAPublicKey",(function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())}));t.RSAPublicKey=a;var s=n.define("SubjectPublicKeyInfo",(function(){this.seq().obj(this.key("algorithm").use(o),this.key("subjectPublicKey").bitstr())}));t.PublicKey=s;var o=n.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())})),c=n.define("PrivateKeyInfo",(function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(o),this.key("subjectPrivateKey").octstr())}));t.PrivateKey=c;var u=n.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())}));t.EncryptedPrivateKey=u;var f=n.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())}));t.DSAPrivateKey=f,t.DSAparam=n.define("DSAparam",(function(){this.int()}));var h=n.define("ECPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(l),this.key("publicKey").optional().explicit(1).bitstr())}));t.ECPrivateKey=h;var l=n.define("ECParameters",(function(){this.choice({namedCurve:this.objid()})}));t.signature=n.define("signature",(function(){this.seq().obj(this.key("r").int(),this.key("s").int())}))},function(e,t,r){"use strict";var n=r(3),i=r(4).utils,a=i.assert,s=i.cachedProperty,o=i.parseBytes;function c(e,t){this.eddsa=e,"object"!=typeof t&&(t=o(t)),Array.isArray(t)&&(t={R:t.slice(0,e.encodingLength),S:t.slice(e.encodingLength)}),a(t.R&&t.S,"Signature without R or S"),e.isPoint(t.R)&&(this._R=t.R),t.S instanceof n&&(this._S=t.S),this._Rencoded=Array.isArray(t.R)?t.R:t.Rencoded,this._Sencoded=Array.isArray(t.S)?t.S:t.Sencoded}s(c,"S",(function(){return this.eddsa.decodeInt(this.Sencoded())})),s(c,"R",(function(){return this.eddsa.decodePoint(this.Rencoded())})),s(c,"Rencoded",(function(){return this.eddsa.encodePoint(this.R())})),s(c,"Sencoded",(function(){return this.eddsa.encodeInt(this.S())})),c.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},c.prototype.toHex=function(){return i.encode(this.toBytes(),"hex").toUpperCase()},e.exports=c},function(e,t,r){"use strict";var n=r(4).utils,i=n.assert,a=n.parseBytes,s=n.cachedProperty;function o(e,t){this.eddsa=e,this._secret=a(t.secret),e.isPoint(t.pub)?this._pub=t.pub:this._pubBytes=a(t.pub)}o.fromPublic=function(e,t){return t instanceof o?t:new o(e,{pub:t})},o.fromSecret=function(e,t){return t instanceof o?t:new o(e,{secret:t})},o.prototype.secret=function(){return this._secret},s(o,"pubBytes",(function(){return this.eddsa.encodePoint(this.pub())})),s(o,"pub",(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())})),s(o,"privBytes",(function(){var e=this.eddsa,t=this.hash(),r=e.encodingLength-1,n=t.slice(0,e.encodingLength);return n[0]&=248,n[r]&=127,n[r]|=64,n})),s(o,"priv",(function(){return this.eddsa.decodeInt(this.privBytes())})),s(o,"hash",(function(){return this.eddsa.hash().update(this.secret()).digest()})),s(o,"messagePrefix",(function(){return this.hash().slice(this.eddsa.encodingLength)})),o.prototype.sign=function(e){return i(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},o.prototype.verify=function(e,t){return this.eddsa.verify(e,t,this)},o.prototype.getSecret=function(e){return i(this._secret,"KeyPair is public only"),n.encode(this.secret(),e)},o.prototype.getPublic=function(e){return n.encode(this.pubBytes(),e)},e.exports=o},function(e,t,r){"use strict";var n=r(26),i=r(4),a=i.utils,s=a.assert,o=a.parseBytes,c=r(105),u=r(104);function f(e){if(s("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof f))return new f(e);e=i.curves[e].curve,this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=n.sha512}e.exports=f,f.prototype.sign=function(e,t){e=o(e);var r=this.keyFromSecret(t),n=this.hashInt(r.messagePrefix(),e),i=this.g.mul(n),a=this.encodePoint(i),s=this.hashInt(a,r.pubBytes(),e).mul(r.priv()),c=n.add(s).umod(this.curve.n);return this.makeSignature({R:i,S:c,Rencoded:a})},f.prototype.verify=function(e,t,r){e=o(e),t=this.makeSignature(t);var n=this.keyFromPublic(r),i=this.hashInt(t.Rencoded(),n.pubBytes(),e),a=this.g.mul(t.S());return t.R().add(n.pub().mul(i)).eq(a)},f.prototype.hashInt=function(){for(var e=this.hash(),t=0;t<arguments.length;t++)e.update(arguments[t]);return a.intFromLE(e.digest()).umod(this.curve.n)},f.prototype.keyFromPublic=function(e){return c.fromPublic(this,e)},f.prototype.keyFromSecret=function(e){return c.fromSecret(this,e)},f.prototype.makeSignature=function(e){return e instanceof u?e:new u(this,e)},f.prototype.encodePoint=function(e){var t=e.getY().toArray("le",this.encodingLength);return t[this.encodingLength-1]|=e.getX().isOdd()?128:0,t},f.prototype.decodePoint=function(e){var t=(e=a.parseBytes(e)).length-1,r=e.slice(0,t).concat(-129&e[t]),n=!!(128&e[t]),i=a.intFromLE(r);return this.curve.pointFromY(i,n)},f.prototype.encodeInt=function(e){return e.toArray("le",this.encodingLength)},f.prototype.decodeInt=function(e){return a.intFromLE(e)},f.prototype.isPoint=function(e){return e instanceof this.pointClass}},function(e,t,r){"use strict";var n=r(3),i=r(4).utils,a=i.assert;function s(e,t){if(e instanceof s)return e;this._importDER(e,t)||(a(e.r&&e.s,"Signature without r or s"),this.r=new n(e.r,16),this.s=new n(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function o(){this.place=0}function c(e,t){var r=e[t.place++];if(!(128&r))return r;for(var n=15&r,i=0,a=0,s=t.place;a<n;a++,s++)i<<=8,i|=e[s];return t.place=s,i}function u(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t<r;)t++;return 0===t?e:e.slice(t)}function f(e,t){if(t<128)e.push(t);else{var r=1+(Math.log(t)/Math.LN2>>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}e.exports=s,s.prototype._importDER=function(e,t){e=i.toArray(e,t);var r=new o;if(48!==e[r.place++])return!1;if(c(e,r)+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var a=c(e,r),s=e.slice(r.place,a+r.place);if(r.place+=a,2!==e[r.place++])return!1;var u=c(e,r);if(e.length!==u+r.place)return!1;var f=e.slice(r.place,u+r.place);return 0===s[0]&&128&s[1]&&(s=s.slice(1)),0===f[0]&&128&f[1]&&(f=f.slice(1)),this.r=new n(s),this.s=new n(f),this.recoveryParam=null,!0},s.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=u(t),r=u(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];f(n,t.length),(n=n.concat(t)).push(2),f(n,r.length);var a=n.concat(r),s=[48];return f(s,a.length),s=s.concat(a),i.encode(s,e)}},function(e,t,r){"use strict";var n=r(3),i=r(4).utils.assert;function a(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}e.exports=a,a.fromPublic=function(e,t,r){return t instanceof a?t:new a(e,{pub:t,pubEnc:r})},a.fromPrivate=function(e,t,r){return t instanceof a?t:new a(e,{priv:t,privEnc:r})},a.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},a.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},a.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},a.prototype._importPrivate=function(e,t){this.priv=new n(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},a.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?i(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||i(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},a.prototype.derive=function(e){return e.mul(this.priv).getX()},a.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},a.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},a.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}},function(e,t,r){"use strict";var n=r(26),i=r(53),a=r(5);function s(e){if(!(this instanceof s))return new s(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=i.toArray(e.entropy,e.entropyEnc||"hex"),r=i.toArray(e.nonce,e.nonceEnc||"hex"),n=i.toArray(e.pers,e.persEnc||"hex");a(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}e.exports=s,s.prototype._init=function(e,t,r){var n=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i<this.V.length;i++)this.K[i]=0,this.V[i]=1;this._update(n),this._reseed=1,this.reseedInterval=281474976710656},s.prototype._hmac=function(){return new n.hmac(this.hash,this.K)},s.prototype._update=function(e){var t=this._hmac().update(this.V).update([0]);e&&(t=t.update(e)),this.K=t.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())},s.prototype.reseed=function(e,t,r,n){"string"!=typeof t&&(n=r,r=t,t=null),e=i.toArray(e,t),r=i.toArray(r,n),a(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},s.prototype.generate=function(e,t,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(n=r,r=t,t=null),r&&(r=i.toArray(r,n||"hex"),this._update(r));for(var a=[];a.length<e;)this.V=this._hmac().update(this.V).digest(),a=a.concat(this.V);var s=a.slice(0,e);return this._update(r),this._reseed++,i.encode(s,t)}},function(e,t,r){"use strict";var n=r(3),i=r(109),a=r(4),s=a.utils.assert,o=r(108),c=r(107);function u(e){if(!(this instanceof u))return new u(e);"string"==typeof e&&(s(a.curves.hasOwnProperty(e),"Unknown curve "+e),e=a.curves[e]),e instanceof a.curves.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}e.exports=u,u.prototype.keyPair=function(e){return new o(this,e)},u.prototype.keyFromPrivate=function(e,t){return o.fromPrivate(this,e,t)},u.prototype.keyFromPublic=function(e,t){return o.fromPublic(this,e,t)},u.prototype.genKeyPair=function(e){e||(e={});for(var t=new i({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||a.rand(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),s=this.n.sub(new n(2));;){var o=new n(t.generate(r));if(!(o.cmp(s)>0))return o.iaddn(1),this.keyFromPrivate(o)}},u.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength();return r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},u.prototype.sign=function(e,t,r,a){"object"==typeof r&&(a=r,r=null),a||(a={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new n(e,16));for(var s=this.n.byteLength(),o=t.getPrivate().toArray("be",s),u=e.toArray("be",s),f=new i({hash:this.hash,entropy:o,nonce:u,pers:a.pers,persEnc:a.persEnc||"utf8"}),h=this.n.sub(new n(1)),l=0;;l++){var d=a.k?a.k(l):new n(f.generate(this.n.byteLength()));if(!((d=this._truncateToN(d,!0)).cmpn(1)<=0||d.cmp(h)>=0)){var p=this.g.mul(d);if(!p.isInfinity()){var g=p.getX(),y=g.umod(this.n);if(0!==y.cmpn(0)){var v=d.invm(this.n).mul(y.mul(t.getPrivate()).iadd(e));if(0!==(v=v.umod(this.n)).cmpn(0)){var m=(p.getY().isOdd()?1:0)|(0!==g.cmp(y)?2:0);return a.canonical&&v.cmp(this.nh)>0&&(v=this.n.sub(v),m^=1),new c({r:y,s:v,recoveryParam:m})}}}}}},u.prototype.verify=function(e,t,r,i){e=this._truncateToN(new n(e,16)),r=this.keyFromPublic(r,i);var a=(t=new c(t,"hex")).r,s=t.s;if(a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;if(s.cmpn(1)<0||s.cmp(this.n)>=0)return!1;var o,u=s.invm(this.n),f=u.mul(e).umod(this.n),h=u.mul(a).umod(this.n);return this.curve._maxwellTrick?!(o=this.g.jmulAdd(f,r.getPublic(),h)).isInfinity()&&o.eqXToP(a):!(o=this.g.mulAdd(f,r.getPublic(),h)).isInfinity()&&0===o.getX().umod(this.n).cmp(a)},u.prototype.recoverPubKey=function(e,t,r,i){s((3&r)===r,"The recovery param is more than two bits"),t=new c(t,i);var a=this.n,o=new n(e),u=t.r,f=t.s,h=1&r,l=r>>1;if(u.cmp(this.curve.p.umod(this.curve.n))>=0&&l)throw new Error("Unable to find sencond key candinate");u=l?this.curve.pointFromX(u.add(this.curve.n),h):this.curve.pointFromX(u,h);var d=t.r.invm(a),p=a.sub(o).mul(d).umod(a),g=f.mul(d).umod(a);return this.g.mulAdd(p,u,g)},u.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new c(t,n)).recoveryParam)return t.recoveryParam;for(var i=0;i<4;i++){var a;try{a=this.recoverPubKey(e,t,i)}catch(e){continue}if(a.eq(r))return i}throw new Error("Unable to find valid recovery factor")}},function(e,t){e.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}},function(e,t,r){"use strict";var n=r(6),i=r(5);function a(e,t,r){if(!(this instanceof a))return new a(e,t,r);this.Hash=e,this.blockSize=e.blockSize/8,this.outSize=e.outSize/8,this.inner=null,this.outer=null,this._init(n.toArray(t,r))}e.exports=a,a.prototype._init=function(e){e.length>this.blockSize&&(e=(new this.Hash).update(e).digest()),i(e.length<=this.blockSize);for(var t=e.length;t<this.blockSize;t++)e.push(0);for(t=0;t<e.length;t++)e[t]^=54;for(this.inner=(new this.Hash).update(e),t=0;t<e.length;t++)e[t]^=106;this.outer=(new this.Hash).update(e)},a.prototype.update=function(e,t){return this.inner.update(e,t),this},a.prototype.digest=function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)}},function(e,t,r){"use strict";var n=r(6),i=r(15),a=n.rotl32,s=n.sum32,o=n.sum32_3,c=n.sum32_4,u=i.BlockHash;function f(){if(!(this instanceof f))return new f;u.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function h(e,t,r,n){return e<=15?t^r^n:e<=31?t&r|~t&n:e<=47?(t|~r)^n:e<=63?t&n|r&~n:t^(r|~n)}function l(e){return e<=15?0:e<=31?1518500249:e<=47?1859775393:e<=63?2400959708:2840853838}function d(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}n.inherits(f,u),t.ripemd160=f,f.blockSize=512,f.outSize=160,f.hmacStrength=192,f.padLength=64,f.prototype._update=function(e,t){for(var r=this.h[0],n=this.h[1],i=this.h[2],u=this.h[3],f=this.h[4],m=r,b=n,w=i,S=u,E=f,C=0;C<80;C++){var A=s(a(c(r,h(C,n,i,u),e[p[C]+t],l(C)),y[C]),f);r=f,f=u,u=a(i,10),i=n,n=A,A=s(a(c(m,h(79-C,b,w,S),e[g[C]+t],d(C)),v[C]),E),m=E,E=S,S=a(w,10),w=b,b=A}A=o(this.h[1],i,S),this.h[1]=o(this.h[2],u,E),this.h[2]=o(this.h[3],f,m),this.h[3]=o(this.h[4],r,b),this.h[4]=o(this.h[0],n,w),this.h[0]=A},f.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"little"):n.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],g=[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],y=[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],v=[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]},function(e,t,r){"use strict";var n=r(6),i=r(50);function a(){if(!(this instanceof a))return new a;i.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}n.inherits(a,i),e.exports=a,a.blockSize=1024,a.outSize=384,a.hmacStrength=192,a.padLength=128,a.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h.slice(0,12),"big"):n.split32(this.h.slice(0,12),"big")}},function(e,t,r){"use strict";var n=r(6),i=r(51);function a(){if(!(this instanceof a))return new a;i.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}n.inherits(a,i),e.exports=a,a.blockSize=512,a.outSize=224,a.hmacStrength=192,a.padLength=64,a.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h.slice(0,7),"big"):n.split32(this.h.slice(0,7),"big")}},function(e,t,r){"use strict";var n=r(6),i=r(15),a=r(52),s=n.rotl32,o=n.sum32,c=n.sum32_5,u=a.ft_1,f=i.BlockHash,h=[1518500249,1859775393,2400959708,3395469782];function l(){if(!(this instanceof l))return new l;f.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}n.inherits(l,f),e.exports=l,l.blockSize=512,l.outSize=160,l.hmacStrength=80,l.padLength=64,l.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n<r.length;n++)r[n]=s(r[n-3]^r[n-8]^r[n-14]^r[n-16],1);var i=this.h[0],a=this.h[1],f=this.h[2],l=this.h[3],d=this.h[4];for(n=0;n<r.length;n++){var p=~~(n/20),g=c(s(i,5),u(p,a,f,l),d,r[n],h[p]);d=l,l=f,f=s(a,30),a=i,i=g}this.h[0]=o(this.h[0],i),this.h[1]=o(this.h[1],a),this.h[2]=o(this.h[2],f),this.h[3]=o(this.h[3],l),this.h[4]=o(this.h[4],d)},l.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},function(e,t,r){"use strict";t.sha1=r(116),t.sha224=r(115),t.sha256=r(51),t.sha384=r(114),t.sha512=r(50)},function(e,t,r){"use strict";var n,i=t,a=r(26),s=r(4),o=s.utils.assert;function c(e){"short"===e.type?this.curve=new s.curve.short(e):"edwards"===e.type?this.curve=new s.curve.edwards(e):this.curve=new s.curve.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,o(this.g.validate(),"Invalid curve"),o(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function u(e,t){Object.defineProperty(i,e,{configurable:!0,enumerable:!0,get:function(){var r=new c(t);return Object.defineProperty(i,e,{configurable:!0,enumerable:!0,value:r}),r}})}i.PresetCurve=c,u("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:a.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),u("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:a.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),u("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:a.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),u("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:a.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),u("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:a.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),u("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:a.sha256,gRed:!1,g:["9"]}),u("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:a.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{n=r(111)}catch(e){n=void 0}u("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:a.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",n]})},function(e,t,r){"use strict";var n=r(21),i=r(4),a=r(3),s=r(0),o=n.base,c=i.utils.assert;function u(e){this.twisted=1!=(0|e.a),this.mOneA=this.twisted&&-1==(0|e.a),this.extended=this.mOneA,o.call(this,"edwards",e),this.a=new a(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new a(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new a(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),c(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|e.c)}function f(e,t,r,n,i){o.BasePoint.call(this,e,"projective"),null===t&&null===r&&null===n?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new a(t,16),this.y=new a(r,16),this.z=n?new a(n,16):this.curve.one,this.t=i&&new a(i,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}s(u,o),e.exports=u,u.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},u.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},u.prototype.jpoint=function(e,t,r,n){return this.point(e,t,r,n)},u.prototype.pointFromX=function(e,t){(e=new a(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=this.c2.redSub(this.a.redMul(r)),i=this.one.redSub(this.c2.redMul(this.d).redMul(r)),s=n.redMul(i.redInvm()),o=s.redSqrt();if(0!==o.redSqr().redSub(s).cmp(this.zero))throw new Error("invalid point");var c=o.fromRed().isOdd();return(t&&!c||!t&&c)&&(o=o.redNeg()),this.point(e,o)},u.prototype.pointFromY=function(e,t){(e=new a(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=r.redSub(this.one),i=r.redMul(this.d).redAdd(this.one),s=n.redMul(i.redInvm());if(0===s.cmp(this.zero)){if(t)throw new Error("invalid point");return this.point(this.zero,e)}var o=s.redSqrt();if(0!==o.redSqr().redSub(s).cmp(this.zero))throw new Error("invalid point");return o.isOdd()!==t&&(o=o.redNeg()),this.point(o,e)},u.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),r=e.y.redSqr(),n=t.redMul(this.a).redAdd(r),i=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(r)));return 0===n.cmp(i)},s(f,o.BasePoint),u.prototype.pointFromJSON=function(e){return f.fromJSON(this,e)},u.prototype.point=function(e,t,r,n){return new f(this,e,t,r,n)},f.fromJSON=function(e,t){return new f(e,t[0],t[1],t[2])},f.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)+">"},f.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&0===this.y.cmp(this.z)},f.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(e),i=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),a=n.redAdd(t),s=a.redSub(r),o=n.redSub(t),c=i.redMul(s),u=a.redMul(o),f=i.redMul(o),h=s.redMul(a);return this.curve.point(c,u,h,f)},f.prototype._projDbl=function(){var e,t,r,n=this.x.redAdd(this.y).redSqr(),i=this.x.redSqr(),a=this.y.redSqr();if(this.curve.twisted){var s=(u=this.curve._mulA(i)).redAdd(a);if(this.zOne)e=n.redSub(i).redSub(a).redMul(s.redSub(this.curve.two)),t=s.redMul(u.redSub(a)),r=s.redSqr().redSub(s).redSub(s);else{var o=this.z.redSqr(),c=s.redSub(o).redISub(o);e=n.redSub(i).redISub(a).redMul(c),t=s.redMul(u.redSub(a)),r=s.redMul(c)}}else{var u=i.redAdd(a);o=this.curve._mulC(this.c.redMul(this.z)).redSqr(),c=u.redSub(o).redSub(o),e=this.curve._mulC(n.redISub(u)).redMul(c),t=this.curve._mulC(u).redMul(i.redISub(a)),r=u.redMul(c)}return this.curve.point(e,t,r)},f.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},f.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),r=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),n=this.t.redMul(this.curve.dd).redMul(e.t),i=this.z.redMul(e.z.redAdd(e.z)),a=r.redSub(t),s=i.redSub(n),o=i.redAdd(n),c=r.redAdd(t),u=a.redMul(s),f=o.redMul(c),h=a.redMul(c),l=s.redMul(o);return this.curve.point(u,f,l,h)},f.prototype._projAdd=function(e){var t,r,n=this.z.redMul(e.z),i=n.redSqr(),a=this.x.redMul(e.x),s=this.y.redMul(e.y),o=this.curve.d.redMul(a).redMul(s),c=i.redSub(o),u=i.redAdd(o),f=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(a).redISub(s),h=n.redMul(c).redMul(f);return this.curve.twisted?(t=n.redMul(u).redMul(s.redSub(this.curve._mulA(a))),r=c.redMul(u)):(t=n.redMul(u).redMul(s.redSub(a)),r=this.curve._mulC(c).redMul(u)),this.curve.point(h,t,r)},f.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},f.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},f.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},f.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},f.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},f.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},f.prototype.getX=function(){return this.normalize(),this.x.fromRed()},f.prototype.getY=function(){return this.normalize(),this.y.fromRed()},f.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},f.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var r=e.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(n),0===this.x.cmp(t))return!0}return!1},f.prototype.toP=f.prototype.normalize,f.prototype.mixedAdd=f.prototype.add},function(e,t,r){"use strict";var n=r(21),i=r(3),a=r(0),s=n.base,o=r(4).utils;function c(e){s.call(this,"mont",e),this.a=new i(e.a,16).toRed(this.red),this.b=new i(e.b,16).toRed(this.red),this.i4=new i(4).toRed(this.red).redInvm(),this.two=new i(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function u(e,t,r){s.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new i(t,16),this.z=new i(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}a(c,s),e.exports=c,c.prototype.validate=function(e){var t=e.normalize().x,r=t.redSqr(),n=r.redMul(t).redAdd(r.redMul(this.a)).redAdd(t);return 0===n.redSqrt().redSqr().cmp(n)},a(u,s.BasePoint),c.prototype.decodePoint=function(e,t){return this.point(o.toArray(e,t),1)},c.prototype.point=function(e,t){return new u(this,e,t)},c.prototype.pointFromJSON=function(e){return u.fromJSON(this,e)},u.prototype.precompute=function(){},u.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},u.fromJSON=function(e,t){return new u(e,t[0],t[1]||e.one)},u.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)+">"},u.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},u.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),r=e.redSub(t),n=e.redMul(t),i=r.redMul(t.redAdd(this.curve.a24.redMul(r)));return this.curve.point(n,i)},u.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),i=e.x.redAdd(e.z),a=e.x.redSub(e.z).redMul(r),s=i.redMul(n),o=t.z.redMul(a.redAdd(s).redSqr()),c=t.x.redMul(a.redISub(s).redSqr());return this.curve.point(o,c)},u.prototype.mul=function(e){for(var t=e.clone(),r=this,n=this.curve.point(null,null),i=[];0!==t.cmpn(0);t.iushrn(1))i.push(t.andln(1));for(var a=i.length-1;a>=0;a--)0===i[a]?(r=r.diffAdd(n,this),n=n.dbl()):(n=r.diffAdd(n,this),r=r.dbl());return n},u.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},u.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},u.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},function(e,t,r){"use strict";var n=r(21),i=r(4),a=r(3),s=r(0),o=n.base,c=i.utils.assert;function u(e){o.call(this,"short",e),this.a=new a(e.a,16).toRed(this.red),this.b=new a(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function f(e,t,r,n){o.BasePoint.call(this,e,"affine"),null===t&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new a(t,16),this.y=new a(r,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function h(e,t,r,n){o.BasePoint.call(this,e,"jacobian"),null===t&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new a(0)):(this.x=new a(t,16),this.y=new a(r,16),this.z=new a(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}s(u,o),e.exports=u,u.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new a(e.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);t=(t=n[0].cmp(n[1])<0?n[0]:n[1]).toRed(this.red)}if(e.lambda)r=new a(e.lambda,16);else{var i=this._getEndoRoots(this.n);0===this.g.mul(i[0]).x.cmp(this.g.x.redMul(t))?r=i[0]:(r=i[1],c(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:r,basis:e.basis?e.basis.map((function(e){return{a:new a(e.a,16),b:new a(e.b,16)}})):this._getEndoBasis(r)}}},u.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:a.mont(e),r=new a(2).toRed(t).redInvm(),n=r.redNeg(),i=new a(3).toRed(t).redNeg().redSqrt().redMul(r);return[n.redAdd(i).fromRed(),n.redSub(i).fromRed()]},u.prototype._getEndoBasis=function(e){for(var t,r,n,i,s,o,c,u,f,h=this.n.ushrn(Math.floor(this.n.bitLength()/2)),l=e,d=this.n.clone(),p=new a(1),g=new a(0),y=new a(0),v=new a(1),m=0;0!==l.cmpn(0);){var b=d.div(l);u=d.sub(b.mul(l)),f=y.sub(b.mul(p));var w=v.sub(b.mul(g));if(!n&&u.cmp(h)<0)t=c.neg(),r=p,n=u.neg(),i=f;else if(n&&2==++m)break;c=u,d=l,l=u,y=p,p=f,v=g,g=w}s=u.neg(),o=f;var S=n.sqr().add(i.sqr());return s.sqr().add(o.sqr()).cmp(S)>=0&&(s=t,o=r),n.negative&&(n=n.neg(),i=i.neg()),s.negative&&(s=s.neg(),o=o.neg()),[{a:n,b:i},{a:s,b:o}]},u.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],i=n.b.mul(e).divRound(this.n),a=r.b.neg().mul(e).divRound(this.n),s=i.mul(r.a),o=a.mul(n.a),c=i.mul(r.b),u=a.mul(n.b);return{k1:e.sub(s).sub(o),k2:c.add(u).neg()}},u.prototype.pointFromX=function(e,t){(e=new a(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var i=n.fromRed().isOdd();return(t&&!i||!t&&i)&&(n=n.redNeg()),this.point(e,n)},u.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,n=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},u.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,a=0;a<e.length;a++){var s=this._endoSplit(t[a]),o=e[a],c=o._getBeta();s.k1.negative&&(s.k1.ineg(),o=o.neg(!0)),s.k2.negative&&(s.k2.ineg(),c=c.neg(!0)),n[2*a]=o,n[2*a+1]=c,i[2*a]=s.k1,i[2*a+1]=s.k2}for(var u=this._wnafMulAdd(1,n,i,2*a,r),f=0;f<2*a;f++)n[f]=null,i[f]=null;return u},s(f,o.BasePoint),u.prototype.point=function(e,t,r){return new f(this,e,t,r)},u.prototype.pointFromJSON=function(e,t){return f.fromJSON(this,e,t)},f.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var t=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var r=this.curve,n=function(e){return r.point(e.x.redMul(r.endo.beta),e.y)};e.beta=t,t.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(n)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(n)}}}return t}},f.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]},f.fromJSON=function(e,t,r){"string"==typeof t&&(t=JSON.parse(t));var n=e.point(t[0],t[1],r);if(!t[2])return n;function i(t){return e.point(t[0],t[1],r)}var a=t[2];return n.precomputed={beta:null,doubles:a.doubles&&{step:a.doubles.step,points:[n].concat(a.doubles.points.map(i))},naf:a.naf&&{wnd:a.naf.wnd,points:[n].concat(a.naf.points.map(i))}},n},f.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)+">"},f.prototype.isInfinity=function(){return this.inf},f.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},f.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),n=e.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(n),a=i.redSqr().redISub(this.x.redAdd(this.x)),s=i.redMul(this.x.redSub(a)).redISub(this.y);return this.curve.point(a,s)},f.prototype.getX=function(){return this.x.fromRed()},f.prototype.getY=function(){return this.y.fromRed()},f.prototype.mul=function(e){return e=new a(e,16),this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},f.prototype.mulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},f.prototype.jmulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},f.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},f.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,n=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return t},f.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},s(h,o.BasePoint),u.prototype.jpoint=function(e,t,r){return new h(this,e,t,r)},h.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(r,n)},h.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},h.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(t),i=e.x.redMul(r),a=this.y.redMul(t.redMul(e.z)),s=e.y.redMul(r.redMul(this.z)),o=n.redSub(i),c=a.redSub(s);if(0===o.cmpn(0))return 0!==c.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=o.redSqr(),f=u.redMul(o),h=n.redMul(u),l=c.redSqr().redIAdd(f).redISub(h).redISub(h),d=c.redMul(h.redISub(l)).redISub(a.redMul(f)),p=this.z.redMul(e.z).redMul(o);return this.curve.jpoint(l,d,p)},h.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),i=this.y,a=e.y.redMul(t).redMul(this.z),s=r.redSub(n),o=i.redSub(a);if(0===s.cmpn(0))return 0!==o.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=s.redSqr(),u=c.redMul(s),f=r.redMul(c),h=o.redSqr().redIAdd(u).redISub(f).redISub(f),l=o.redMul(f.redISub(h)).redISub(i.redMul(u)),d=this.z.redMul(s);return this.curve.jpoint(h,l,d)},h.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var t=this,r=0;r<e;r++)t=t.dbl();return t}var n=this.curve.a,i=this.curve.tinv,a=this.x,s=this.y,o=this.z,c=o.redSqr().redSqr(),u=s.redAdd(s);for(r=0;r<e;r++){var f=a.redSqr(),h=u.redSqr(),l=h.redSqr(),d=f.redAdd(f).redIAdd(f).redIAdd(n.redMul(c)),p=a.redMul(h),g=d.redSqr().redISub(p.redAdd(p)),y=p.redISub(g),v=d.redMul(y);v=v.redIAdd(v).redISub(l);var m=u.redMul(o);r+1<e&&(c=c.redMul(l)),a=g,o=m,u=v}return this.curve.jpoint(a,u.redMul(i),o)},h.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},h.prototype._zeroDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),a=i.redSqr(),s=this.x.redAdd(i).redSqr().redISub(n).redISub(a);s=s.redIAdd(s);var o=n.redAdd(n).redIAdd(n),c=o.redSqr().redISub(s).redISub(s),u=a.redIAdd(a);u=(u=u.redIAdd(u)).redIAdd(u),e=c,t=o.redMul(s.redISub(c)).redISub(u),r=this.y.redAdd(this.y)}else{var f=this.x.redSqr(),h=this.y.redSqr(),l=h.redSqr(),d=this.x.redAdd(h).redSqr().redISub(f).redISub(l);d=d.redIAdd(d);var p=f.redAdd(f).redIAdd(f),g=p.redSqr(),y=l.redIAdd(l);y=(y=y.redIAdd(y)).redIAdd(y),e=g.redISub(d).redISub(d),t=p.redMul(d.redISub(e)).redISub(y),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(e,t,r)},h.prototype._threeDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),a=i.redSqr(),s=this.x.redAdd(i).redSqr().redISub(n).redISub(a);s=s.redIAdd(s);var o=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),c=o.redSqr().redISub(s).redISub(s);e=c;var u=a.redIAdd(a);u=(u=u.redIAdd(u)).redIAdd(u),t=o.redMul(s.redISub(c)).redISub(u),r=this.y.redAdd(this.y)}else{var f=this.z.redSqr(),h=this.y.redSqr(),l=this.x.redMul(h),d=this.x.redSub(f).redMul(this.x.redAdd(f));d=d.redAdd(d).redIAdd(d);var p=l.redIAdd(l),g=(p=p.redIAdd(p)).redAdd(p);e=d.redSqr().redISub(g),r=this.y.redAdd(this.z).redSqr().redISub(h).redISub(f);var y=h.redSqr();y=(y=(y=y.redIAdd(y)).redIAdd(y)).redIAdd(y),t=d.redMul(p.redISub(e)).redISub(y)}return this.curve.jpoint(e,t,r)},h.prototype._dbl=function(){var e=this.curve.a,t=this.x,r=this.y,n=this.z,i=n.redSqr().redSqr(),a=t.redSqr(),s=r.redSqr(),o=a.redAdd(a).redIAdd(a).redIAdd(e.redMul(i)),c=t.redAdd(t),u=(c=c.redIAdd(c)).redMul(s),f=o.redSqr().redISub(u.redAdd(u)),h=u.redISub(f),l=s.redSqr();l=(l=(l=l.redIAdd(l)).redIAdd(l)).redIAdd(l);var d=o.redMul(h).redISub(l),p=r.redAdd(r).redMul(n);return this.curve.jpoint(f,d,p)},h.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr(),n=t.redSqr(),i=e.redAdd(e).redIAdd(e),a=i.redSqr(),s=this.x.redAdd(t).redSqr().redISub(e).redISub(n),o=(s=(s=(s=s.redIAdd(s)).redAdd(s).redIAdd(s)).redISub(a)).redSqr(),c=n.redIAdd(n);c=(c=(c=c.redIAdd(c)).redIAdd(c)).redIAdd(c);var u=i.redIAdd(s).redSqr().redISub(a).redISub(o).redISub(c),f=t.redMul(u);f=(f=f.redIAdd(f)).redIAdd(f);var h=this.x.redMul(o).redISub(f);h=(h=h.redIAdd(h)).redIAdd(h);var l=this.y.redMul(u.redMul(c.redISub(u)).redISub(s.redMul(o)));l=(l=(l=l.redIAdd(l)).redIAdd(l)).redIAdd(l);var d=this.z.redAdd(s).redSqr().redISub(r).redISub(o);return this.curve.jpoint(h,l,d)},h.prototype.mul=function(e,t){return e=new a(e,t),this.curve._wnafMul(this,e)},h.prototype.eq=function(e){if("affine"===e.type)return this.eq(e.toJ());if(this===e)return!0;var t=this.z.redSqr(),r=e.z.redSqr();if(0!==this.x.redMul(r).redISub(e.x.redMul(t)).cmpn(0))return!1;var n=t.redMul(this.z),i=r.redMul(e.z);return 0===this.y.redMul(i).redISub(e.y.redMul(n)).cmpn(0)},h.prototype.eqXToP=function(e){var t=this.z.redSqr(),r=e.toRed(this.curve.red).redMul(t);if(0===this.x.cmp(r))return!0;for(var n=e.clone(),i=this.curve.redN.redMul(t);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}return!1},h.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)+">"},h.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},function(e,t,r){"use strict";var n=r(3),i=r(4).utils,a=i.getNAF,s=i.getJSF,o=i.assert;function c(e,t){this.type=e,this.p=new n(t.p,16),this.red=t.prime?n.red(t.prime):n.mont(this.p),this.zero=new n(0).toRed(this.red),this.one=new n(1).toRed(this.red),this.two=new n(2).toRed(this.red),this.n=t.n&&new n(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4);var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function u(e,t){this.curve=e,this.type=t,this.precomputed=null}e.exports=c,c.prototype.point=function(){throw new Error("Not implemented")},c.prototype.validate=function(){throw new Error("Not implemented")},c.prototype._fixedNafMul=function(e,t){o(e.precomputed);var r=e._getDoubles(),n=a(t,1),i=(1<<r.step+1)-(r.step%2==0?2:1);i/=3;for(var s=[],c=0;c<n.length;c+=r.step){var u=0;for(t=c+r.step-1;t>=c;t--)u=(u<<1)+n[t];s.push(u)}for(var f=this.jpoint(null,null,null),h=this.jpoint(null,null,null),l=i;l>0;l--){for(c=0;c<s.length;c++)(u=s[c])===l?h=h.mixedAdd(r.points[c]):u===-l&&(h=h.mixedAdd(r.points[c].neg()));f=f.add(h)}return f.toP()},c.prototype._wnafMul=function(e,t){var r=4,n=e._getNAFPoints(r);r=n.wnd;for(var i=n.points,s=a(t,r),c=this.jpoint(null,null,null),u=s.length-1;u>=0;u--){for(t=0;u>=0&&0===s[u];u--)t++;if(u>=0&&t++,c=c.dblp(t),u<0)break;var f=s[u];o(0!==f),c="affine"===e.type?f>0?c.mixedAdd(i[f-1>>1]):c.mixedAdd(i[-f-1>>1].neg()):f>0?c.add(i[f-1>>1]):c.add(i[-f-1>>1].neg())}return"affine"===e.type?c.toP():c},c.prototype._wnafMulAdd=function(e,t,r,n,i){for(var o=this._wnafT1,c=this._wnafT2,u=this._wnafT3,f=0,h=0;h<n;h++){var l=(B=t[h])._getNAFPoints(e);o[h]=l.wnd,c[h]=l.points}for(h=n-1;h>=1;h-=2){var d=h-1,p=h;if(1===o[d]&&1===o[p]){var g=[t[d],null,null,t[p]];0===t[d].y.cmp(t[p].y)?(g[1]=t[d].add(t[p]),g[2]=t[d].toJ().mixedAdd(t[p].neg())):0===t[d].y.cmp(t[p].y.redNeg())?(g[1]=t[d].toJ().mixedAdd(t[p]),g[2]=t[d].add(t[p].neg())):(g[1]=t[d].toJ().mixedAdd(t[p]),g[2]=t[d].toJ().mixedAdd(t[p].neg()));var y=[-3,-1,-5,-7,0,7,5,1,3],v=s(r[d],r[p]);f=Math.max(v[0].length,f),u[d]=new Array(f),u[p]=new Array(f);for(var m=0;m<f;m++){var b=0|v[0][m],w=0|v[1][m];u[d][m]=y[3*(b+1)+(w+1)],u[p][m]=0,c[d]=g}}else u[d]=a(r[d],o[d]),u[p]=a(r[p],o[p]),f=Math.max(u[d].length,f),f=Math.max(u[p].length,f)}var S=this.jpoint(null,null,null),E=this._wnafT4;for(h=f;h>=0;h--){for(var C=0;h>=0;){var A=!0;for(m=0;m<n;m++)E[m]=0|u[m][h],0!==E[m]&&(A=!1);if(!A)break;C++,h--}if(h>=0&&C++,S=S.dblp(C),h<0)break;for(m=0;m<n;m++){var B,x=E[m];0!==x&&(x>0?B=c[m][x-1>>1]:x<0&&(B=c[m][-x-1>>1].neg()),S="affine"===B.type?S.mixedAdd(B):S.add(B))}}for(h=0;h<n;h++)c[h]=null;return i?S:S.toP()},c.BasePoint=u,u.prototype.eq=function(){throw new Error("Not implemented")},u.prototype.validate=function(){return this.curve.validate(this)},c.prototype.decodePoint=function(e,t){e=i.toArray(e,t);var r=this.p.byteLength();if((4===e[0]||6===e[0]||7===e[0])&&e.length-1==2*r)return 6===e[0]?o(e[e.length-1]%2==0):7===e[0]&&o(e[e.length-1]%2==1),this.point(e.slice(1,1+r),e.slice(1+r,1+2*r));if((2===e[0]||3===e[0])&&e.length-1===r)return this.pointFromX(e.slice(1,1+r),3===e[0]);throw new Error("Unknown point format")},u.prototype.encodeCompressed=function(e){return this.encode(e,!0)},u.prototype._encode=function(e){var t=this.curve.p.byteLength(),r=this.getX().toArray("be",t);return e?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",t))},u.prototype.encode=function(e,t){return i.encode(this._encode(t),e)},u.prototype.precompute=function(e){if(this.precomputed)return this;var t={doubles:null,naf:null,beta:null};return t.naf=this._getNAFPoints(8),t.doubles=this._getDoubles(4,e),t.beta=this._getBeta(),this.precomputed=t,this},u.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var t=this.precomputed.doubles;return!!t&&t.points.length>=Math.ceil((e.bitLength()+1)/t.step)},u.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i<t;i+=e){for(var a=0;a<e;a++)n=n.dbl();r.push(n)}return{step:e,points:r}},u.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var t=[this],r=(1<<e)-1,n=1===r?null:this.dbl(),i=1;i<r;i++)t[i]=t[i-1].add(n);return{wnd:e,points:t}},u.prototype._getBeta=function(){return null},u.prototype.dblp=function(e){for(var t=this,r=0;r<e;r++)t=t.dbl();return t}},function(e,t,r){"use strict";var n=t,i=r(3),a=r(5),s=r(53);n.assert=a,n.toArray=s.toArray,n.zero2=s.zero2,n.toHex=s.toHex,n.encode=s.encode,n.getNAF=function(e,t){for(var r=[],n=1<<t+1,i=e.clone();i.cmpn(1)>=0;){var a;if(i.isOdd()){var s=i.andln(n-1);a=s>(n>>1)-1?(n>>1)-s:s,i.isubn(a)}else a=0;r.push(a);for(var o=0!==i.cmpn(0)&&0===i.andln(n-1)?t+1:1,c=1;c<o;c++)r.push(0);i.iushrn(o)}return r},n.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var n=0,i=0;e.cmpn(-n)>0||t.cmpn(-i)>0;){var a,s,o,c=e.andln(3)+n&3,u=t.andln(3)+i&3;3===c&&(c=-1),3===u&&(u=-1),a=1&c?3!=(o=e.andln(7)+n&7)&&5!==o||2!==u?c:-c:0,r[0].push(a),s=1&u?3!=(o=t.andln(7)+i&7)&&5!==o||2!==c?u:-u:0,r[1].push(s),2*n===a+1&&(n=1-n),2*i===s+1&&(i=1-i),e.iushrn(1),t.iushrn(1)}return r},n.cachedProperty=function(e,t,r){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},n.parseBytes=function(e){return"string"==typeof e?n.toArray(e,"hex"):e},n.intFromLE=function(e){return new i(e,"hex","le")}},function(e){e.exports={_args:[["elliptic@6.4.0","/Users/mtokarev/projects/js/crypto"]],_development:!0,_from:"elliptic@6.4.0",_id:"elliptic@6.4.0",_inBundle:!1,_integrity:"sha1-ysmvh2LIWDYYcAPI3+GT5eLq5d8=",_location:"/elliptic",_phantomChildren:{},_requested:{type:"version",registry:!0,raw:"elliptic@6.4.0",name:"elliptic",escapedName:"elliptic",rawSpec:"6.4.0",saveSpec:null,fetchSpec:"6.4.0"},_requiredBy:["/browserify-sign","/create-ecdh"],_resolved:"https://registry.npmjs.org/elliptic/-/elliptic-6.4.0.tgz",_spec:"6.4.0",_where:"/Users/mtokarev/projects/js/crypto",author:{name:"Fedor Indutny",email:"fedor@indutny.com"},bugs:{url:"https://github.com/indutny/elliptic/issues"},dependencies:{"bn.js":"^4.4.0",brorand:"^1.0.1","hash.js":"^1.0.0","hmac-drbg":"^1.0.0",inherits:"^2.0.1","minimalistic-assert":"^1.0.0","minimalistic-crypto-utils":"^1.0.0"},description:"EC cryptography",devDependencies:{brfs:"^1.4.3",coveralls:"^2.11.3",grunt:"^0.4.5","grunt-browserify":"^5.0.0","grunt-cli":"^1.2.0","grunt-contrib-connect":"^1.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^1.0.1","grunt-mocha-istanbul":"^3.0.1","grunt-saucelabs":"^8.6.2",istanbul:"^0.4.2",jscs:"^2.9.0",jshint:"^2.6.0",mocha:"^2.1.0"},files:["lib"],homepage:"https://github.com/indutny/elliptic",keywords:["EC","Elliptic","curve","Cryptography"],license:"MIT",main:"lib/elliptic.js",name:"elliptic",repository:{type:"git",url:"git+ssh://git@github.com/indutny/elliptic.git"},scripts:{jscs:"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js",jshint:"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js",lint:"npm run jscs && npm run jshint",test:"npm run lint && npm run unit",unit:"istanbul test _mocha --reporter=spec test/index.js",version:"grunt dist && git add dist/"},version:"6.4.0"}},function(e,t,r){(function(t){var n=r(68),i=r(27),a=r(4).ec,s=r(3),o=r(20),c=r(45);function u(e,r,i,a){if((e=new t(e.toArray())).length<r.byteLength()){var s=new t(r.byteLength()-e.length);s.fill(0),e=t.concat([s,e])}var o=i.length,c=function(e,r){e=(e=f(e,r)).mod(r);var n=new t(e.toArray());if(n.length<r.byteLength()){var i=new t(r.byteLength()-n.length);i.fill(0),n=t.concat([i,n])}return n}(i,r),u=new t(o);u.fill(1);var h=new t(o);return h.fill(0),h=n(a,h).update(u).update(new t([0])).update(e).update(c).digest(),u=n(a,h).update(u).digest(),{k:h=n(a,h).update(u).update(new t([1])).update(e).update(c).digest(),v:u=n(a,h).update(u).digest()}}function f(e,t){var r=new s(e),n=(e.length<<3)-t.bitLength();return n>0&&r.ishrn(n),r}function h(e,r,i){var a,s;do{for(a=new t(0);8*a.length<e.bitLength();)r.v=n(i,r.k).update(r.v).digest(),a=t.concat([a,r.v]);s=f(a,e),r.k=n(i,r.k).update(r.v).update(new t([0])).digest(),r.v=n(i,r.k).update(r.v).digest()}while(-1!==s.cmp(e));return s}function l(e,t,r,n){return e.toRed(s.mont(r)).redPow(t).fromRed().mod(n)}e.exports=function(e,r,n,d,p){var g=o(r);if(g.curve){if("ecdsa"!==d&&"ecdsa/rsa"!==d)throw new Error("wrong private key type");return function(e,r){var n=c[r.curve.join(".")];if(!n)throw new Error("unknown curve "+r.curve.join("."));var i=new a(n).keyFromPrivate(r.privateKey).sign(e);return new t(i.toDER())}(e,g)}if("dsa"===g.type){if("dsa"!==d)throw new Error("wrong private key type");return function(e,r,n){for(var i,a=r.params.priv_key,o=r.params.p,c=r.params.q,d=r.params.g,p=new s(0),g=f(e,c).mod(c),y=!1,v=u(a,c,e,n);!1===y;)p=l(d,i=h(c,v,n),o,c),0===(y=i.invm(c).imul(g.add(a.mul(p))).mod(c)).cmpn(0)&&(y=!1,p=new s(0));return function(e,r){e=e.toArray(),r=r.toArray(),128&e[0]&&(e=[0].concat(e)),128&r[0]&&(r=[0].concat(r));var n=[48,e.length+r.length+4,2,e.length];return n=n.concat(e,[2,r.length],r),new t(n)}(p,y)}(e,g,n)}if("rsa"!==d&&"ecdsa/rsa"!==d)throw new Error("wrong private key type");e=t.concat([p,e]);for(var y=g.modulus.byteLength(),v=[0,1];e.length+v.length+1<y;)v.push(255);v.push(0);for(var m=-1;++m<e.length;)v.push(e[m]);return i(v,g)},e.exports.getKey=u,e.exports.makeKey=h}).call(this,r(2).Buffer)},function(e,t,r){(function(t){var n=r(18),i=r(37),a=r(0),s=r(125),o=r(89),c=r(66);function u(e){i.Writable.call(this);var t=c[e];if(!t)throw new Error("Unknown message digest");this._hashType=t.hash,this._hash=n(t.hash),this._tag=t.id,this._signType=t.sign}function f(e){i.Writable.call(this);var t=c[e];if(!t)throw new Error("Unknown message digest");this._hash=n(t.hash),this._tag=t.id,this._signType=t.sign}function h(e){return new u(e)}function l(e){return new f(e)}Object.keys(c).forEach((function(e){c[e].id=new t(c[e].id,"hex"),c[e.toLowerCase()]=c[e]})),a(u,i.Writable),u.prototype._write=function(e,t,r){this._hash.update(e),r()},u.prototype.update=function(e,r){return"string"==typeof e&&(e=new t(e,r)),this._hash.update(e),this},u.prototype.sign=function(e,t){this.end();var r=this._hash.digest(),n=s(r,e,this._hashType,this._signType,this._tag);return t?n.toString(t):n},a(f,i.Writable),f.prototype._write=function(e,t,r){this._hash.update(e),r()},f.prototype.update=function(e,r){return"string"==typeof e&&(e=new t(e,r)),this._hash.update(e),this},f.prototype.verify=function(e,r,n){"string"==typeof r&&(r=new t(r,n)),this.end();var i=this._hash.digest();return o(r,i,e,this._signType,this._tag)},e.exports={Sign:h,Verify:l,createSign:h,createVerify:l}}).call(this,r(2).Buffer)},function(e,t,r){(function(t){var n=r(3),i=new(r(55)),a=new n(24),s=new n(11),o=new n(10),c=new n(3),u=new n(7),f=r(56),h=r(12);function l(e,r){return r=r||"utf8",t.isBuffer(e)||(e=new t(e,r)),this._pub=new n(e),this}function d(e,r){return r=r||"utf8",t.isBuffer(e)||(e=new t(e,r)),this._priv=new n(e),this}e.exports=g;var p={};function g(e,t,r){this.setGenerator(t),this.__prime=new n(e),this._prime=n.mont(this.__prime),this._primeLen=e.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,r?(this.setPublicKey=l,this.setPrivateKey=d):this._primeCode=8}function y(e,r){var n=new t(e.toArray());return r?n.toString(r):n}Object.defineProperty(g.prototype,"verifyError",{enumerable:!0,get:function(){return"number"!=typeof this._primeCode&&(this._primeCode=function(e,t){var r=t.toString("hex"),n=[r,e.toString(16)].join("_");if(n in p)return p[n];var h,l=0;if(e.isEven()||!f.simpleSieve||!f.fermatTest(e)||!i.test(e))return l+=1,l+="02"===r||"05"===r?8:4,p[n]=l,l;switch(i.test(e.shrn(1))||(l+=2),r){case"02":e.mod(a).cmp(s)&&(l+=8);break;case"05":(h=e.mod(o)).cmp(c)&&h.cmp(u)&&(l+=8);break;default:l+=4}return p[n]=l,l}(this.__prime,this.__gen)),this._primeCode}}),g.prototype.generateKeys=function(){return this._priv||(this._priv=new n(h(this._primeLen))),this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed(),this.getPublicKey()},g.prototype.computeSecret=function(e){var r=(e=(e=new n(e)).toRed(this._prime)).redPow(this._priv).fromRed(),i=new t(r.toArray()),a=this.getPrime();if(i.length<a.length){var s=new t(a.length-i.length);s.fill(0),i=t.concat([s,i])}return i},g.prototype.getPublicKey=function(e){return y(this._pub,e)},g.prototype.getPrivateKey=function(e){return y(this._priv,e)},g.prototype.getPrime=function(e){return y(this.__prime,e)},g.prototype.getGenerator=function(e){return y(this._gen,e)},g.prototype.setGenerator=function(e,r){return r=r||"utf8",t.isBuffer(e)||(e=new t(e,r)),this.__gen=e,this._gen=new n(e),this}}).call(this,r(2).Buffer)},function(e){e.exports={modp1:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},modp2:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},modp5:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},modp14:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},modp15:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},modp16:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},modp17:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},modp18:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"}}},function(e,t){},function(e,t){},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,r){(function(e){var n=r(56),i=r(128),a=r(127),s={binary:!0,hex:!0,base64:!0};t.DiffieHellmanGroup=t.createDiffieHellmanGroup=t.getDiffieHellman=function(t){var r=new e(i[t].prime,"hex"),n=new e(i[t].gen,"hex");return new a(r,n)},t.createDiffieHellman=t.DiffieHellman=function t(r,i,o,c){return e.isBuffer(i)||void 0===s[i]?t(r,"binary",i,o):(i=i||"binary",c=c||"binary",o=o||new e([2]),e.isBuffer(o)||(o=new e(o,c)),"number"==typeof r?new a(n(r,o),o,!0):(e.isBuffer(r)||(r=new e(r,i)),new a(r,o,!0)))}}).call(this,r(2).Buffer)},function(e,t){t["des-ecb"]={key:8,iv:0},t["des-cbc"]=t.des={key:8,iv:8},t["des-ede3-cbc"]=t.des3={key:24,iv:8},t["des-ede3"]={key:24,iv:0},t["des-ede-cbc"]={key:16,iv:8},t["des-ede"]={key:16,iv:0}},function(e,t,r){var n=r(58),i=r(1).Buffer,a=r(28),s=r(57),o=r(8),c=r(23),u=r(22);function f(e,t,r){o.call(this),this._cache=new h,this._last=void 0,this._cipher=new c.AES(t),this._prev=i.from(r),this._mode=e,this._autopadding=!0}function h(){this.cache=i.allocUnsafe(0)}function l(e,t,r){var o=a[e.toLowerCase()];if(!o)throw new TypeError("invalid suite type");if("string"==typeof r&&(r=i.from(r)),"GCM"!==o.mode&&r.length!==o.iv)throw new TypeError("invalid iv length "+r.length);if("string"==typeof t&&(t=i.from(t)),t.length!==o.key/8)throw new TypeError("invalid key length "+t.length);return"stream"===o.type?new s(o.module,t,r,!0):"auth"===o.type?new n(o.module,t,r,!0):new f(o.module,t,r)}r(0)(f,o),f.prototype._update=function(e){var t,r;this._cache.add(e);for(var n=[];t=this._cache.get(this._autopadding);)r=this._mode.decrypt(this,t),n.push(r);return i.concat(n)},f.prototype._final=function(){var e=this._cache.flush();if(this._autopadding)return function(e){var t=e[15];if(t<1||t>16)throw new Error("unable to decrypt data");for(var r=-1;++r<t;)if(e[r+(16-t)]!==t)throw new Error("unable to decrypt data");if(16!==t)return e.slice(0,16-t)}(this._mode.decrypt(this,e));if(e)throw new Error("data not multiple of block length")},f.prototype.setAutoPadding=function(e){return this._autopadding=!!e,this},h.prototype.add=function(e){this.cache=i.concat([this.cache,e])},h.prototype.get=function(e){var t;if(e){if(this.cache.length>16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t}else if(this.cache.length>=16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t;return null},h.prototype.flush=function(){if(this.cache.length)return this.cache},t.createDecipher=function(e,t){var r=a[e.toLowerCase()];if(!r)throw new TypeError("invalid suite type");var n=u(t,!1,r.key,r.iv);return l(e,n.key,n.iv)},t.createDecipheriv=l},function(e,t,r){var n=r(1).Buffer,i=n.alloc(16,0);function a(e){var t=n.allocUnsafe(16);return t.writeUInt32BE(e[0]>>>0,0),t.writeUInt32BE(e[1]>>>0,4),t.writeUInt32BE(e[2]>>>0,8),t.writeUInt32BE(e[3]>>>0,12),t}function s(e){this.h=e,this.state=n.alloc(16,0),this.cache=n.allocUnsafe(0)}s.prototype.ghash=function(e){for(var t=-1;++t<e.length;)this.state[t]^=e[t];this._multiply()},s.prototype._multiply=function(){for(var e,t,r,n=[(e=this.h).readUInt32BE(0),e.readUInt32BE(4),e.readUInt32BE(8),e.readUInt32BE(12)],i=[0,0,0,0],s=-1;++s<128;){for(!!(this.state[~~(s/8)]&1<<7-s%8)&&(i[0]^=n[0],i[1]^=n[1],i[2]^=n[2],i[3]^=n[3]),r=!!(1&n[3]),t=3;t>0;t--)n[t]=n[t]>>>1|(1&n[t-1])<<31;n[0]=n[0]>>>1,r&&(n[0]=n[0]^225<<24)}this.state=a(i)},s.prototype.update=function(e){var t;for(this.cache=n.concat([this.cache,e]);this.cache.length>=16;)t=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(t)},s.prototype.final=function(e,t){return this.cache.length&&this.ghash(n.concat([this.cache,i],16)),this.ghash(a([0,e,0,t])),this.state},e.exports=s},function(e,t,r){(function(e){var n=r(16);function i(e){return e._prev=e._cipher.encryptBlock(e._prev),e._prev}t.encrypt=function(t,r){for(;t._cache.length<r.length;)t._cache=e.concat([t._cache,i(t)]);var a=t._cache.slice(0,r.length);return t._cache=t._cache.slice(r.length),n(r,a)}}).call(this,r(2).Buffer)},function(e,t,r){var n=r(1).Buffer;function i(e,t,r){for(var n,i,s=-1,o=0;++s<8;)n=t&1<<7-s?128:0,o+=(128&(i=e._cipher.encryptBlock(e._prev)[0]^n))>>s%8,e._prev=a(e._prev,r?n:i);return o}function a(e,t){var r=e.length,i=-1,a=n.allocUnsafe(e.length);for(e=n.concat([e,n.from([t])]);++i<r;)a[i]=e[i]<<1|e[i+1]>>7;return a}t.encrypt=function(e,t,r){for(var a=t.length,s=n.allocUnsafe(a),o=-1;++o<a;)s[o]=i(e,t[o],r);return s}},function(e,t,r){var n=r(1).Buffer;function i(e,t,r){var i=e._cipher.encryptBlock(e._prev)[0]^t;return e._prev=n.concat([e._prev.slice(1),n.from([r?t:i])]),i}t.encrypt=function(e,t,r){for(var a=t.length,s=n.allocUnsafe(a),o=-1;++o<a;)s[o]=i(e,t[o],r);return s}},function(e,t,r){var n=r(1).Buffer,i=r(16);function a(e,t,r){var a=t.length,s=i(t,e._cache);return e._cache=e._cache.slice(a),e._prev=n.concat([e._prev,r?t:s]),s}t.encrypt=function(e,t,r){for(var i,s=n.allocUnsafe(0);t.length;){if(0===e._cache.length&&(e._cache=e._cipher.encryptBlock(e._prev),e._prev=n.allocUnsafe(0)),!(e._cache.length<=t.length)){s=n.concat([s,a(e,t,r)]);break}i=e._cache.length,s=n.concat([s,a(e,t.slice(0,i),r)]),t=t.slice(i)}return s}},function(e,t,r){var n=r(16);t.encrypt=function(e,t){var r=n(t,e._prev);return e._prev=e._cipher.encryptBlock(r),e._prev},t.decrypt=function(e,t){var r=e._prev;e._prev=t;var i=e._cipher.decryptBlock(t);return n(i,r)}},function(e,t){t.encrypt=function(e,t){return e._cipher.encryptBlock(t)},t.decrypt=function(e,t){return e._cipher.decryptBlock(t)}},function(e,t,r){var n=r(28),i=r(58),a=r(1).Buffer,s=r(57),o=r(8),c=r(23),u=r(22);function f(e,t,r){o.call(this),this._cache=new l,this._cipher=new c.AES(t),this._prev=a.from(r),this._mode=e,this._autopadding=!0}r(0)(f,o),f.prototype._update=function(e){var t,r;this._cache.add(e);for(var n=[];t=this._cache.get();)r=this._mode.encrypt(this,t),n.push(r);return a.concat(n)};var h=a.alloc(16,16);function l(){this.cache=a.allocUnsafe(0)}function d(e,t,r){var o=n[e.toLowerCase()];if(!o)throw new TypeError("invalid suite type");if("string"==typeof t&&(t=a.from(t)),t.length!==o.key/8)throw new TypeError("invalid key length "+t.length);if("string"==typeof r&&(r=a.from(r)),"GCM"!==o.mode&&r.length!==o.iv)throw new TypeError("invalid iv length "+r.length);return"stream"===o.type?new s(o.module,t,r):"auth"===o.type?new i(o.module,t,r):new f(o.module,t,r)}f.prototype._final=function(){var e=this._cache.flush();if(this._autopadding)return e=this._mode.encrypt(this,e),this._cipher.scrub(),e;if(!e.equals(h))throw this._cipher.scrub(),new Error("data not multiple of block length")},f.prototype.setAutoPadding=function(e){return this._autopadding=!!e,this},l.prototype.add=function(e){this.cache=a.concat([this.cache,e])},l.prototype.get=function(){if(this.cache.length>15){var e=this.cache.slice(0,16);return this.cache=this.cache.slice(16),e}return null},l.prototype.flush=function(){for(var e=16-this.cache.length,t=a.allocUnsafe(e),r=-1;++r<e;)t.writeUInt8(e,r);return a.concat([this.cache,t])},t.createCipheriv=d,t.createCipher=function(e,t){var r=n[e.toLowerCase()];if(!r)throw new TypeError("invalid suite type");var i=u(t,!1,r.key,r.iv);return d(e,i.key,i.iv)}},function(e,t,r){"use strict";var n=r(5),i=r(0),a=r(30),s=a.Cipher,o=a.DES;function c(e,t){n.equal(t.length,24,"Invalid key length");var r=t.slice(0,8),i=t.slice(8,16),a=t.slice(16,24);this.ciphers="encrypt"===e?[o.create({type:"encrypt",key:r}),o.create({type:"decrypt",key:i}),o.create({type:"encrypt",key:a})]:[o.create({type:"decrypt",key:a}),o.create({type:"encrypt",key:i}),o.create({type:"decrypt",key:r})]}function u(e){s.call(this,e);var t=new c(this.type,this.options.key);this._edeState=t}i(u,s),e.exports=u,u.create=function(e){return new u(e)},u.prototype._update=function(e,t,r,n){var i=this._edeState;i.ciphers[0]._update(e,t,r,n),i.ciphers[1]._update(r,n,r,n),i.ciphers[2]._update(r,n,r,n)},u.prototype._pad=o.prototype._pad,u.prototype._unpad=o.prototype._unpad},function(e,t,r){"use strict";var n=r(5),i=r(0),a={};function s(e){n.equal(e.length,8,"Invalid IV length"),this.iv=new Array(8);for(var t=0;t<this.iv.length;t++)this.iv[t]=e[t]}t.instantiate=function(e){function t(t){e.call(this,t),this._cbcInit()}i(t,e);for(var r=Object.keys(a),n=0;n<r.length;n++){var s=r[n];t.prototype[s]=a[s]}return t.create=function(e){return new t(e)},t},a._cbcInit=function(){var e=new s(this.options.iv);this._cbcState=e},a._update=function(e,t,r,n){var i=this._cbcState,a=this.constructor.super_.prototype,s=i.iv;if("encrypt"===this.type){for(var o=0;o<this.blockSize;o++)s[o]^=e[t+o];for(a._update.call(this,s,0,r,n),o=0;o<this.blockSize;o++)s[o]=r[n+o]}else{for(a._update.call(this,e,t,r,n),o=0;o<this.blockSize;o++)r[n+o]^=s[o];for(o=0;o<this.blockSize;o++)s[o]=e[t+o]}}},function(e,t,r){"use strict";var n=r(5),i=r(0),a=r(30),s=a.utils,o=a.Cipher;function c(){this.tmp=new Array(2),this.keys=null}function u(e){o.call(this,e);var t=new c;this._desState=t,this.deriveKeys(t,e.key)}i(u,o),e.exports=u,u.create=function(e){return new u(e)};var f=[1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1];u.prototype.deriveKeys=function(e,t){e.keys=new Array(32),n.equal(t.length,this.blockSize,"Invalid key length");var r=s.readUInt32BE(t,0),i=s.readUInt32BE(t,4);s.pc1(r,i,e.tmp,0),r=e.tmp[0],i=e.tmp[1];for(var a=0;a<e.keys.length;a+=2){var o=f[a>>>1];r=s.r28shl(r,o),i=s.r28shl(i,o),s.pc2(r,i,e.keys,a)}},u.prototype._update=function(e,t,r,n){var i=this._desState,a=s.readUInt32BE(e,t),o=s.readUInt32BE(e,t+4);s.ip(a,o,i.tmp,0),a=i.tmp[0],o=i.tmp[1],"encrypt"===this.type?this._encrypt(i,a,o,i.tmp,0):this._decrypt(i,a,o,i.tmp,0),a=i.tmp[0],o=i.tmp[1],s.writeUInt32BE(r,a,n),s.writeUInt32BE(r,o,n+4)},u.prototype._pad=function(e,t){for(var r=e.length-t,n=t;n<e.length;n++)e[n]=r;return!0},u.prototype._unpad=function(e){for(var t=e[e.length-1],r=e.length-t;r<e.length;r++)n.equal(e[r],t);return e.slice(0,e.length-t)},u.prototype._encrypt=function(e,t,r,n,i){for(var a=t,o=r,c=0;c<e.keys.length;c+=2){var u=e.keys[c],f=e.keys[c+1];s.expand(o,e.tmp,0),u^=e.tmp[0],f^=e.tmp[1];var h=s.substitute(u,f),l=o;o=(a^s.permute(h))>>>0,a=l}s.rip(o,a,n,i)},u.prototype._decrypt=function(e,t,r,n,i){for(var a=r,o=t,c=e.keys.length-2;c>=0;c-=2){var u=e.keys[c],f=e.keys[c+1];s.expand(a,e.tmp,0),u^=e.tmp[0],f^=e.tmp[1];var h=s.substitute(u,f),l=a;a=(o^s.permute(h))>>>0,o=l}s.rip(a,o,n,i)}},function(e,t,r){"use strict";var n=r(5);function i(e){this.options=e,this.type=this.options.type,this.blockSize=8,this._init(),this.buffer=new Array(this.blockSize),this.bufferOff=0}e.exports=i,i.prototype._init=function(){},i.prototype.update=function(e){return 0===e.length?[]:"decrypt"===this.type?this._updateDecrypt(e):this._updateEncrypt(e)},i.prototype._buffer=function(e,t){for(var r=Math.min(this.buffer.length-this.bufferOff,e.length-t),n=0;n<r;n++)this.buffer[this.bufferOff+n]=e[t+n];return this.bufferOff+=r,r},i.prototype._flushBuffer=function(e,t){return this._update(this.buffer,0,e,t),this.bufferOff=0,this.blockSize},i.prototype._updateEncrypt=function(e){var t=0,r=0,n=(this.bufferOff+e.length)/this.blockSize|0,i=new Array(n*this.blockSize);0!==this.bufferOff&&(t+=this._buffer(e,t),this.bufferOff===this.buffer.length&&(r+=this._flushBuffer(i,r)));for(var a=e.length-(e.length-t)%this.blockSize;t<a;t+=this.blockSize)this._update(e,t,i,r),r+=this.blockSize;for(;t<e.length;t++,this.bufferOff++)this.buffer[this.bufferOff]=e[t];return i},i.prototype._updateDecrypt=function(e){for(var t=0,r=0,n=Math.ceil((this.bufferOff+e.length)/this.blockSize)-1,i=new Array(n*this.blockSize);n>0;n--)t+=this._buffer(e,t),r+=this._flushBuffer(i,r);return t+=this._buffer(e,t),i},i.prototype.final=function(e){var t,r;return e&&(t=this.update(e)),r="encrypt"===this.type?this._finalEncrypt():this._finalDecrypt(),t?t.concat(r):r},i.prototype._pad=function(e,t){if(0===t)return!1;for(;t<e.length;)e[t++]=0;return!0},i.prototype._finalEncrypt=function(){if(!this._pad(this.buffer,this.bufferOff))return[];var e=new Array(this.blockSize);return this._update(this.buffer,0,e,0),e},i.prototype._unpad=function(e){return e},i.prototype._finalDecrypt=function(){n.equal(this.bufferOff,this.blockSize,"Not enough data to decrypt");var e=new Array(this.blockSize);return this._flushBuffer(e,0),this._unpad(e)}},function(e,t,r){"use strict";t.readUInt32BE=function(e,t){return(e[0+t]<<24|e[1+t]<<16|e[2+t]<<8|e[3+t])>>>0},t.writeUInt32BE=function(e,t,r){e[0+r]=t>>>24,e[1+r]=t>>>16&255,e[2+r]=t>>>8&255,e[3+r]=255&t},t.ip=function(e,t,r,n){for(var i=0,a=0,s=6;s>=0;s-=2){for(var o=0;o<=24;o+=8)i<<=1,i|=t>>>o+s&1;for(o=0;o<=24;o+=8)i<<=1,i|=e>>>o+s&1}for(s=6;s>=0;s-=2){for(o=1;o<=25;o+=8)a<<=1,a|=t>>>o+s&1;for(o=1;o<=25;o+=8)a<<=1,a|=e>>>o+s&1}r[n+0]=i>>>0,r[n+1]=a>>>0},t.rip=function(e,t,r,n){for(var i=0,a=0,s=0;s<4;s++)for(var o=24;o>=0;o-=8)i<<=1,i|=t>>>o+s&1,i<<=1,i|=e>>>o+s&1;for(s=4;s<8;s++)for(o=24;o>=0;o-=8)a<<=1,a|=t>>>o+s&1,a<<=1,a|=e>>>o+s&1;r[n+0]=i>>>0,r[n+1]=a>>>0},t.pc1=function(e,t,r,n){for(var i=0,a=0,s=7;s>=5;s--){for(var o=0;o<=24;o+=8)i<<=1,i|=t>>o+s&1;for(o=0;o<=24;o+=8)i<<=1,i|=e>>o+s&1}for(o=0;o<=24;o+=8)i<<=1,i|=t>>o+s&1;for(s=1;s<=3;s++){for(o=0;o<=24;o+=8)a<<=1,a|=t>>o+s&1;for(o=0;o<=24;o+=8)a<<=1,a|=e>>o+s&1}for(o=0;o<=24;o+=8)a<<=1,a|=e>>o+s&1;r[n+0]=i>>>0,r[n+1]=a>>>0},t.r28shl=function(e,t){return e<<t&268435455|e>>>28-t};var n=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];t.pc2=function(e,t,r,i){for(var a=0,s=0,o=n.length>>>1,c=0;c<o;c++)a<<=1,a|=e>>>n[c]&1;for(c=o;c<n.length;c++)s<<=1,s|=t>>>n[c]&1;r[i+0]=a>>>0,r[i+1]=s>>>0},t.expand=function(e,t,r){var n=0,i=0;n=(1&e)<<5|e>>>27;for(var a=23;a>=15;a-=4)n<<=6,n|=e>>>a&63;for(a=11;a>=3;a-=4)i|=e>>>a&63,i<<=6;i|=(31&e)<<1|e>>>31,t[r+0]=n>>>0,t[r+1]=i>>>0};var i=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];t.substitute=function(e,t){for(var r=0,n=0;n<4;n++)r<<=4,r|=i[64*n+(e>>>18-6*n&63)];for(n=0;n<4;n++)r<<=4,r|=i[256+64*n+(t>>>18-6*n&63)];return r>>>0};var a=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];t.permute=function(e){for(var t=0,r=0;r<a.length;r++)t<<=1,t|=e>>>a[r]&1;return t>>>0},t.padSplit=function(e,t,r){for(var n=e.toString(2);n.length<t;)n="0"+n;for(var i=[],a=0;a<t;a+=r)i.push(n.slice(a,a+r));return i.join(" ")}},function(e,t,r){(function(t){var n=r(8),i=r(30),a=r(0),s={"des-ede3-cbc":i.CBC.instantiate(i.EDE),"des-ede3":i.EDE,"des-ede-cbc":i.CBC.instantiate(i.EDE),"des-ede":i.EDE,"des-cbc":i.CBC.instantiate(i.DES),"des-ecb":i.DES};function o(e){n.call(this);var r,i=e.mode.toLowerCase(),a=s[i];r=e.decrypt?"decrypt":"encrypt";var o=e.key;"des-ede"!==i&&"des-ede-cbc"!==i||(o=t.concat([o,o.slice(0,8)]));var c=e.iv;this._des=a.create({key:o,iv:c,type:r})}s.des=s["des-cbc"],s.des3=s["des-ede3-cbc"],e.exports=o,a(o,n),o.prototype._update=function(e){return new t(this._des.update(e))},o.prototype._final=function(){return new t(this._des.final())}}).call(this,r(2).Buffer)},function(e,t,r){var n=r(148),i=r(29),a=r(28),s=r(133),o=r(22);function c(e,t,r){if(e=e.toLowerCase(),a[e])return i.createCipheriv(e,t,r);if(s[e])return new n({key:t,iv:r,mode:e});throw new TypeError("invalid suite type")}function u(e,t,r){if(e=e.toLowerCase(),a[e])return i.createDecipheriv(e,t,r);if(s[e])return new n({key:t,iv:r,mode:e,decrypt:!0});throw new TypeError("invalid suite type")}t.createCipher=t.Cipher=function(e,t){var r,n;if(e=e.toLowerCase(),a[e])r=a[e].key,n=a[e].iv;else{if(!s[e])throw new TypeError("invalid suite type");r=8*s[e].key,n=s[e].iv}var i=o(t,!1,r,n);return c(e,i.key,i.iv)},t.createCipheriv=t.Cipheriv=c,t.createDecipher=t.Decipher=function(e,t){var r,n;if(e=e.toLowerCase(),a[e])r=a[e].key,n=a[e].iv;else{if(!s[e])throw new TypeError("invalid suite type");r=8*s[e].key,n=s[e].iv}var i=o(t,!1,r,n);return u(e,i.key,i.iv)},t.createDecipheriv=t.Decipheriv=u,t.listCiphers=t.getCiphers=function(){return Object.keys(s).concat(i.getCiphers())}},function(e,t,r){(function(t,n){var i,a=r(64),s=r(63),o=r(62),c=r(1).Buffer,u=t.crypto&&t.crypto.subtle,f={sha:"SHA-1","sha-1":"SHA-1",sha1:"SHA-1",sha256:"SHA-256","sha-256":"SHA-256",sha384:"SHA-384","sha-384":"SHA-384","sha-512":"SHA-512",sha512:"SHA-512"},h=[];function l(e,t,r,n,i){return u.importKey("raw",e,{name:"PBKDF2"},!1,["deriveBits"]).then((function(e){return u.deriveBits({name:"PBKDF2",salt:t,iterations:r,hash:{name:i}},e,n<<3)})).then((function(e){return c.from(e)}))}e.exports=function(e,r,d,p,g,y){"function"==typeof g&&(y=g,g=void 0);var v=f[(g=g||"sha1").toLowerCase()];if(!v||"function"!=typeof t.Promise)return n.nextTick((function(){var t;try{t=o(e,r,d,p,g)}catch(e){return y(e)}y(null,t)}));if(a(e,r,d,p),"function"!=typeof y)throw new Error("No callback provided to pbkdf2");c.isBuffer(e)||(e=c.from(e,s)),c.isBuffer(r)||(r=c.from(r,s)),function(e,t){e.then((function(e){n.nextTick((function(){t(null,e)}))}),(function(e){n.nextTick((function(){t(e)}))}))}(function(e){if(t.process&&!t.process.browser)return Promise.resolve(!1);if(!u||!u.importKey||!u.deriveBits)return Promise.resolve(!1);if(void 0!==h[e])return h[e];var r=l(i=i||c.alloc(8),i,10,128,e).then((function(){return!0})).catch((function(){return!1}));return h[e]=r,r}(v).then((function(t){return t?l(e,r,d,p,v):o(e,r,d,p,g)})),y)}}).call(this,r(7),r(9))},function(e,t,r){e.exports=r(66)},function(e,t,r){"use strict";var n=r(0),i=r(1).Buffer,a=r(8),s=i.alloc(128),o=64;function c(e,t){a.call(this,"digest"),"string"==typeof t&&(t=i.from(t)),this._alg=e,this._key=t,t.length>o?t=e(t):t.length<o&&(t=i.concat([t,s],o));for(var r=this._ipad=i.allocUnsafe(o),n=this._opad=i.allocUnsafe(o),c=0;c<o;c++)r[c]=54^t[c],n[c]=92^t[c];this._hash=[r]}n(c,a),c.prototype._update=function(e){this._hash.push(e)},c.prototype._final=function(){var e=this._alg(i.concat(this._hash));return this._alg(i.concat([this._opad,e]))},e.exports=c},function(e,t,r){var n=r(0),i=r(69),a=r(11),s=r(1).Buffer,o=new Array(160);function c(){this.init(),this._w=o,a.call(this,128,112)}n(c,i),c.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},c.prototype._hash=function(){var e=s.allocUnsafe(48);function t(t,r,n){e.writeInt32BE(t,n),e.writeInt32BE(r,n+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),e},e.exports=c},function(e,t,r){var n=r(0),i=r(70),a=r(11),s=r(1).Buffer,o=new Array(64);function c(){this.init(),this._w=o,a.call(this,64,56)}n(c,i),c.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},c.prototype._hash=function(){var e=s.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e},e.exports=c},function(e,t,r){var n=r(0),i=r(11),a=r(1).Buffer,s=[1518500249,1859775393,-1894007588,-899497514],o=new Array(80);function c(){this.init(),this._w=o,i.call(this,64,56)}function u(e){return e<<5|e>>>27}function f(e){return e<<30|e>>>2}function h(e,t,r,n){return 0===e?t&r|~t&n:2===e?t&r|t&n|r&n:t^r^n}n(c,i),c.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},c.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,i=0|this._b,a=0|this._c,o=0|this._d,c=0|this._e,l=0;l<16;++l)r[l]=e.readInt32BE(4*l);for(;l<80;++l)r[l]=(t=r[l-3]^r[l-8]^r[l-14]^r[l-16])<<1|t>>>31;for(var d=0;d<80;++d){var p=~~(d/20),g=u(n)+h(p,i,a,o)+c+r[d]+s[p]|0;c=o,o=a,a=f(i),i=n,n=g}this._a=n+this._a|0,this._b=i+this._b|0,this._c=a+this._c|0,this._d=o+this._d|0,this._e=c+this._e|0},c.prototype._hash=function(){var e=a.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=c},function(e,t,r){var n=r(0),i=r(11),a=r(1).Buffer,s=[1518500249,1859775393,-1894007588,-899497514],o=new Array(80);function c(){this.init(),this._w=o,i.call(this,64,56)}function u(e){return e<<30|e>>>2}function f(e,t,r,n){return 0===e?t&r|~t&n:2===e?t&r|t&n|r&n:t^r^n}n(c,i),c.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},c.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,i=0|this._b,a=0|this._c,o=0|this._d,c=0|this._e,h=0;h<16;++h)r[h]=e.readInt32BE(4*h);for(;h<80;++h)r[h]=r[h-3]^r[h-8]^r[h-14]^r[h-16];for(var l=0;l<80;++l){var d=~~(l/20),p=0|((t=n)<<5|t>>>27)+f(d,i,a,o)+c+r[l]+s[d];c=o,o=a,a=u(i),i=n,n=p}this._a=n+this._a|0,this._b=i+this._b|0,this._c=a+this._c|0,this._d=o+this._d|0,this._e=c+this._e|0},c.prototype._hash=function(){var e=a.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=c},function(e,t,r){e.exports=r(35).PassThrough},function(e,t,r){e.exports=r(35).Transform},function(e,t,r){e.exports=r(10)},function(e,t,r){e.exports=r(34)},function(e,t,r){"use strict";e.exports=a;var n=r(71),i=r(17);function a(e){if(!(this instanceof a))return new a(e);n.call(this,e)}i.inherits=r(0),i.inherits(a,n),a.prototype._transform=function(e,t,r){r(null,e)}},function(e,t,r){(function(t){function r(e){try{if(!t.localStorage)return!1}catch(e){return!1}var r=t.localStorage[e];return null!=r&&"true"===String(r).toLowerCase()}e.exports=function(e,t){if(r("noDeprecation"))return e;var n=!1;return function(){if(!n){if(r("throwDeprecation"))throw new Error(t);r("traceDeprecation")?console.trace(t):console.warn(t),n=!0}return e.apply(this,arguments)}}}).call(this,r(7))},function(e,t,r){(function(e,t){!function(e,r){"use strict";if(!e.setImmediate){var n,i,a,s,o,c=1,u={},f=!1,h=e.document,l=Object.getPrototypeOf&&Object.getPrototypeOf(e);l=l&&l.setTimeout?l:e,"[object process]"==={}.toString.call(e.process)?n=function(e){t.nextTick((function(){p(e)}))}:function(){if(e.postMessage&&!e.importScripts){var t=!0,r=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=r,t}}()?(s="setImmediate$"+Math.random()+"$",o=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(s)&&p(+t.data.slice(s.length))},e.addEventListener?e.addEventListener("message",o,!1):e.attachEvent("onmessage",o),n=function(t){e.postMessage(s+t,"*")}):e.MessageChannel?((a=new MessageChannel).port1.onmessage=function(e){p(e.data)},n=function(e){a.port2.postMessage(e)}):h&&"onreadystatechange"in h.createElement("script")?(i=h.documentElement,n=function(e){var t=h.createElement("script");t.onreadystatechange=function(){p(e),t.onreadystatechange=null,i.removeChild(t),t=null},i.appendChild(t)}):n=function(e){setTimeout(p,0,e)},l.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),r=0;r<t.length;r++)t[r]=arguments[r+1];var i={callback:e,args:t};return u[c]=i,n(c),c++},l.clearImmediate=d}function d(e){delete u[e]}function p(e){if(f)setTimeout(p,0,e);else{var t=u[e];if(t){f=!0;try{!function(e){var t=e.callback,r=e.args;switch(r.length){case 0:t();break;case 1:t(r[0]);break;case 2:t(r[0],r[1]);break;case 3:t(r[0],r[1],r[2]);break;default:t.apply(undefined,r)}}(t)}finally{d(e),f=!1}}}}}("undefined"==typeof self?void 0===e?this:e:self)}).call(this,r(7),r(9))},function(e,t,r){(function(e){var n=void 0!==e&&e||"undefined"!=typeof self&&self||window,i=Function.prototype.apply;function a(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new a(i.call(setTimeout,n,arguments),clearTimeout)},t.setInterval=function(){return new a(i.call(setInterval,n,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},a.prototype.unref=a.prototype.ref=function(){},a.prototype.close=function(){this._clearFn.call(n,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},r(163),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,r(7))},function(e,t){},function(e,t,r){"use strict";var n=r(1).Buffer,i=r(165);e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r},e.prototype.concat=function(e){if(0===this.length)return n.alloc(0);if(1===this.length)return this.head.data;for(var t,r,i=n.allocUnsafe(e>>>0),a=this.head,s=0;a;)t=i,r=s,a.data.copy(t,r),s+=a.data.length,a=a.next;return i},e}(),i&&i.inspect&&i.inspect.custom&&(e.exports.prototype[i.inspect.custom]=function(){var e=i.inspect({length:this.length});return this.constructor.name+" "+e})},function(e,t){},function(e,t){t.read=function(e,t,r,n,i){var a,s,o=8*i-n-1,c=(1<<o)-1,u=c>>1,f=-7,h=r?i-1:0,l=r?-1:1,d=e[t+h];for(h+=l,a=d&(1<<-f)-1,d>>=-f,f+=o;f>0;a=256*a+e[t+h],h+=l,f-=8);for(s=a&(1<<-f)-1,a>>=-f,f+=n;f>0;s=256*s+e[t+h],h+=l,f-=8);if(0===a)a=1-u;else{if(a===c)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,n),a-=u}return(d?-1:1)*s*Math.pow(2,a-n)},t.write=function(e,t,r,n,i,a){var s,o,c,u=8*a-i-1,f=(1<<u)-1,h=f>>1,l=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:a-1,p=n?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(o=isNaN(t)?1:0,s=f):(s=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-s))<1&&(s--,c*=2),(t+=s+h>=1?l/c:l*Math.pow(2,1-h))*c>=2&&(s++,c/=2),s+h>=f?(o=0,s=f):s+h>=1?(o=(t*c-1)*Math.pow(2,i),s+=h):(o=t*Math.pow(2,h-1)*Math.pow(2,i),s=0));i>=8;e[r+d]=255&o,d+=p,o/=256,i-=8);for(s=s<<i|o,u+=i;u>0;e[r+d]=255&s,d+=p,s/=256,u-=8);e[r+d-p]|=128*g}},function(e,t,r){"use strict";t.byteLength=function(e){var t=c(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){for(var t,r=c(e),n=r[0],s=r[1],o=new a(function(e,t,r){return 3*(t+r)/4-r}(0,n,s)),u=0,f=s>0?n-4:n,h=0;h<f;h+=4)t=i[e.charCodeAt(h)]<<18|i[e.charCodeAt(h+1)]<<12|i[e.charCodeAt(h+2)]<<6|i[e.charCodeAt(h+3)],o[u++]=t>>16&255,o[u++]=t>>8&255,o[u++]=255&t;return 2===s&&(t=i[e.charCodeAt(h)]<<2|i[e.charCodeAt(h+1)]>>4,o[u++]=255&t),1===s&&(t=i[e.charCodeAt(h)]<<10|i[e.charCodeAt(h+1)]<<4|i[e.charCodeAt(h+2)]>>2,o[u++]=t>>8&255,o[u++]=255&t),o},t.fromByteArray=function(e){for(var t,r=e.length,i=r%3,a=[],s=16383,o=0,c=r-i;o<c;o+=s)a.push(u(e,o,o+s>c?c:o+s));return 1===i?(t=e[r-1],a.push(n[t>>2]+n[t<<4&63]+"==")):2===i&&(t=(e[r-2]<<8)+e[r-1],a.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"=")),a.join("")};for(var n=[],i=[],a="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0;o<64;++o)n[o]=s[o],i[s.charCodeAt(o)]=o;function c(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function u(e,t,r){for(var i,a,s=[],o=t;o<r;o+=3)i=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(255&e[o+2]),s.push(n[(a=i)>>18&63]+n[a>>12&63]+n[a>>6&63]+n[63&a]);return s.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(e,t,r){"use strict";t.randomBytes=t.rng=t.pseudoRandomBytes=t.prng=r(12),t.createHash=t.Hash=r(18),t.createHmac=t.Hmac=r(68);var n=r(151),i=Object.keys(n),a=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(i);t.getHashes=function(){return a};var s=r(65);t.pbkdf2=s.pbkdf2,t.pbkdf2Sync=s.pbkdf2Sync;var o=r(149);t.Cipher=o.Cipher,t.createCipher=o.createCipher,t.Cipheriv=o.Cipheriv,t.createCipheriv=o.createCipheriv,t.Decipher=o.Decipher,t.createDecipher=o.createDecipher,t.Decipheriv=o.Decipheriv,t.createDecipheriv=o.createDecipheriv,t.getCiphers=o.getCiphers,t.listCiphers=o.listCiphers;var c=r(132);t.DiffieHellmanGroup=c.DiffieHellmanGroup,t.createDiffieHellmanGroup=c.createDiffieHellmanGroup,t.getDiffieHellman=c.getDiffieHellman,t.createDiffieHellman=c.createDiffieHellman,t.DiffieHellman=c.DiffieHellman;var u=r(126);t.createSign=u.createSign,t.Sign=u.Sign,t.createVerify=u.createVerify,t.Verify=u.Verify,t.createECDH=r(88);var f=r(87);t.publicEncrypt=f.publicEncrypt,t.privateEncrypt=f.privateEncrypt,t.publicDecrypt=f.publicDecrypt,t.privateDecrypt=f.privateDecrypt;var h=r(84);t.randomFill=h.randomFill,t.randomFillSync=h.randomFillSync,t.createCredentials=function(){throw new Error(["sorry, createCredentials is not implemented yet","we accept pull requests","https://github.com/crypto-browserify/crypto-browserify"].join("\n"))},t.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}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.gostCertInstance=void 0;var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.GostCert=k;var i=r(173),a=r(78),s=r(39),o=r(77),c=r(83),u=ArrayBuffer,f=s.gostCodingInstance,h=a.gostSecurityInstance.providers,l=o.gostASN1Instance,d=c.gostSubtleInstance;function p(e){for(var t=1,r=arguments.length;t<r;t++){var i=arguments[t];if("object"===(void 0===i?"undefined":n(i)))for(var a in i)i.hasOwnProperty(a)&&(e[a]=i[a])}return e}function g(e){var t=function(){};t.prototype=e.prototype;for(var r=[new t],n=1;n<arguments.length;n++)r.push(arguments[n]);return p.apply(this,r)}function y(e){var t=new Date;return t.setHours(0,0,0,0),e&&t.setDate(t.getDate()+e),t}function v(e){try{e()}catch(e){}}var m,b,w=(m=function(e){var t=void 0===e?"undefined":n(e);return"undefined"===t||""===e?"0":"number"===t||e instanceof Number?e.toString(16).toLowerCase():e.replace("0x","").toLowerCase()},b=function(e,t){return(new Array(t+1).join("0")+e).slice(-t)},function(e,t){e=m(e),t=m(t);var r=Math.max(e.length,t.length);return b(e,r)===b(t,r)});function S(e,t){for(var r in e)if(e[r]!==t[r])return!1;for(var r in t)if(e[r]!==t[r])return!1;return!0}function E(e,t){var r=e.extensions&&e.extensions.subjectKeyIdentifier;return e&&t&&(!t.issuer||S(e.issuer,t.issuer))&&(!t.serialNumber||w(e.serialNumber,t.serialNumber))&&(!t.subjectKeyIdentifier||function(e,t){var r=new Uint8Array(e),n=new Uint8Array(t);if(r.length!==n.length)return!1;for(var i=0,a=r.length;i<a;i++)if(r[i]!==n[i])return!1;return!0}(r,t.subjectKeyIdentifier))&&(!t.subject||S(e.subject,t.subject))&&(!t.date||e.notBefore.getTime()<=t.date.getTime()&&e.notAfter.getTime()>t.date.getTime())}function C(e,t,r){var n={subject:e.issuer,date:r},i=t&&t.authorityKeyIdentifier;return i&&(n.subjectKeyIdentifier=i.keyIdentifier,i.authorityCertIssuer&&i.authorityCertIssuer[0]&&i.authorityCertSerialNumber&&(n.issuer=i.authorityCertIssuer[0],n.serialNumber=i.authorityCertSerialNumber)),n}function A(e,t){for(var r=[],n=0,i=e.length;n<i;n++)E(e[n],t)&&r.push(e[n]);return r}function B(e,t){return(!t.issuer||S(e.issuer,t.issuer))&&(!t.date||e.thisUpdate.getTime()<t.date.getTime())}function x(e,t){for(var r=[],n=0,i=e.length;n<i;n++)B(e[n],t)&&r.push(e[n]);return r}function T(e){var t=e.id;for(var r in h){var n=h[r];if(n.publicKey.id===t)return n}}function I(e,t,r,i){"object"!==(void 0===r?"undefined":n(r))&&(r={value:r}),void 0!==i&&(r.enumerable=i),Object.defineProperty(e,t,r)}function F(e,t,r){for(var n in t)I(e,n,t[n],r)}function g(e,t,r,n){if("function"!=typeof t&&(n=r,r=t,t=function(){e.apply(this,arguments)}),t.prototype=Object.create(e.prototype,{constructor:{value:t},superclass:{value:e.prototype}}),r&&F(t.prototype,r,!0),e!==Object)for(var i in e)t[i]=e[i];return t.super=e,n&&F(t,n,!0),t}function k(){}var R={providerName:"CP-01",subject:{countryName:"RU",commonName:"Anonymous"},caKeyUsage:["digitalSignature","nonRepudiation","keyEncipherment","dataEncipherment","keyAgreement","keyCertSign","cRLSign"],caExtKeyUsage:["serverAuth","clientAuth","codeSigning","emailProtection","ipsecEndSystem","ipsecTunnel","ipsecUser","timeStamping","OCSPSigning"],userKeyUsage:["digitalSignature","nonRepudiation","keyEncipherment","dataEncipherment","keyAgreement"],userExtKeyUsage:["clientAuth","emailProtection"],days:7305};k.prototype.options=R;var D=function(e){try{l.Certificate.call(this,e,!0)}catch(r){try{e=new l.CertificationRequest(e,!0)}catch(e){}e=e||{},l.Certificate.call(this,{version:2,serialNumber:e.serialNumber||(t=new Uint8Array(4),i.gostCrypto.getRandomValues(t),t[0]=127&t[0],f.Int16.encode(t)),signature:e.signature||{id:"noSignature"},issuer:e.subject||R.subject,notBefore:e.notBefore||y(),notAfter:e.notAfter||y(e.days||R.days),subject:e.subject||R.subject,subjectPublicKeyInfo:e.subjectPublicKeyInfo||{algorithm:{id:"noSignature"},subjectPublicKey:new u(0)},extensions:e.attributes&&(e.attributes.extensionRequest||e.attributes.msCertExtensions)||e.extensions,signatureAlgorithm:{id:"noSignature"},signatureValue:new u(0)})}var t};g(l.Certificate,D,{sign:function(e,t){var r=this,n=r.subjectPublicKeyInfo;return new Promise(v).then((function(){if(!n||!n.algorithm||"noSignature"===n.algorithm)throw new Error("Key pair was not generated for the certificate");if(!e)throw new Error("The private key of the issuer is not defined");return t=t||r,d.digest("SHA-1",n.subjectPublicKey)})).then((function(n){var i=t.getProvider()||h[R.providerName];r.signature&&"noSignature"!==r.signature.id||(r.signature=i.signature),r.signatureAlgorithm=r.signature,r.issuer=t.subject,r.extensions||(r.extensions={});var a=r.extensions,s=t.extensions;if(r===t)a.keyUsage=a.keyUsage||R.caKeyUsage,a.extKeyUsage=a.extKeyUsage||R.caExtKeyUsage,a.basicConstraints=a.basicConstraints||{cA:!0};else{if(!t.checkUsage("keyCertSign",r.notBefore))throw new Error("The issuer's certificate is not valid for signing a certificate");if(a.keyUsage=a.keyUsage||R.userKeyUsage,a.extKeyUsage=a.extKeyUsage||R.userExtKeyUsage,a.basicConstraints=a.basicConstraints||{cA:a.keyUsage.indexOf("keyCertSign")>=0},a.basicConstraints.cA){var o=s&&s.basicConstraints&&s.pathLenConstraint;if(void 0!==o){if(!(o>0))throw new Error("Path length constraint exceeded");a.basicConstraints.pathLenConstraint=o-1}}}return a.subjectKeyIdentifier=n,s&&s.subjectKeyIdentifier&&(a.authorityKeyIdentifier={keyIdentifier:s.subjectKeyIdentifier,authorityCertIssuer:[t.issuer],authorityCertSerialNumber:t.serialNumber}),d.importKey("pkcs8",e.encode(),e.privateKeyAlgorithm,!1,["sign"])})).then((function(e){return d.sign(r.signatureAlgorithm,e,r.tbsCertificate.encode())})).then((function(e){return r.signatureValue=e,r}))},generate:function(e){var t,r,n=this;return(r=e?h[e]:this.getProvider()||h[R.providerName])&&(e=p(r.publicKey,{privateKey:r.privateKey})),new Promise(v).then((function(){return d.generateKey(e,"true",["sign","verify"])})).then((function(e){return t=e.privateKey,d.exportKey("spki",e.publicKey)})).then((function(e){return n.subjectPublicKeyInfo=new l.SubjectPublicKeyInfo(e),d.exportKey("pkcs8",t)})).then((function(e){return new l.PrivateKeyInfo(e)}))},getPublicKey:function(){var e=this.subjectPublicKeyInfo,t="rsaEncryption"===e.algorithm.id?["verify"]:["verify","deriveKey","deriveBits"];return d.importKey("spki",e.encode(),e.algorithm,"false",t)},getProvider:function(){return T(this.subjectPublicKeyInfo.algorithm)},verify:function(e,t,r){var n=this,i=n.extensions;return new Promise(v).then((function(){if(r=r||y(),n.notBefore.getTime()>r.getTime()||n.notAfter.getTime()<=r.getTime())throw new Error("The certificate has not yet started or expired");for(var t in i)if(i[t].critical&&["authorityKeyIdentifier","subjectKeyIdentifier","keyUsage","certificatePolicies","policyMappings","basicConstraints","nameConstraints","policyConstraints","extKeyUsage"].indexOf(t)<0)throw new Error("The critical extension '"+t+"' is unrecognized");var a=C(n,i,n.notBefore);if(!e&&E(n,a)&&(e=n),e){if(!E(e,a)||!e.checkUsage("keyCertSign",n.notBefore))throw new Error("The issuer's certificate is not valid");return e.verifySignature(n.tbsCertificate.encode(),n.signatureValue,n.signatureAlgorithm)}return!0})).then((function(e){if(!e)throw new Error("The certificate has invalid signature");if(t){if(!B(t,{issuer:n.issuer,date:r}))throw new Error("The issuer's CRL is not valid");if(t.isRevoked(n.serialNumber))throw new Error("The certificate is revoked")}return n}))},verifySignature:function(e,t,r){return this.getPublicKey().then((function(n){return d.verify(r,n,t,e)}))},checkUsage:function(e,t){var r=this,n=r.extensions;return t=t||y(),r.notBefore.getTime()<=t.getTime()&&r.notAfter.getTime()>t.getTime()&&(!n||!(["keyCertSign","cRLSign"].indexOf(e)>0&&n.basicConstraints&&!n.basicConstraints.cA||n.keyUsage&&n.keyUsage.indexOf(e)<0&&n.extKeyUsage&&n.extKeyUsage.indexOf(e)<0))}}),k.prototype.X509=D;var _=function e(t){e.super.call(this,t),this.version||(this.version=1),this.revokedCertificates||(this.revokedCertificates=[]),this.thisUpdate||(this.thisUpdate=y())};function P(e){try{l.CertificationRequest.call(this,e,!0)}catch(t){e=e||{},l.CertificationRequest.call(this,{version:0,subject:e.subject||R.subject,subjectPublicKeyInfo:e.subjectPublicKeyInfo||{algorithm:{id:"noSignature"},subjectPublicKey:new u(0)},attributes:e.attributes||{extensionRequest:{keyUsage:R.userKeyUsage,extKeyUsage:R.userExtKeyUsage}},signatureAlgorithm:{id:"noSignature"},signatureValue:new u(0)})}}function N(e,t){this.certificates=e||[],this.crls=t||[]}function O(e){this.certStore=e}function L(){}function U(e,t,r){this.trustedCACerts=e||[],this.requireCRL=t||!1,this.requireCA=r||!0}g(l.CertificateList,_,{sign:function(e,t){var r=this;return new Promise(v).then((function(){if(!e)throw new Error("The issuer's private key is not defined");if(!t)throw new Error("The issuer's certificate is not defined");if(r.issuer){if(!S(r.issuer,t.issuer))throw new Error("The CRL prototype and authority certificate have different issuers")}else r.issuer=t.issuer;if(!t.checkUsage("cRLSign",r.thisUpdate))throw new Error("The issuer's certificate is not valid for signing a CRL");var n=t.getProvider()||h[R.providerName];r.signature||(r.signature=n.signature),r.signatureAlgorithm=r.signature,r.issuer=t.subject,r.crlExtensions||(r.crlExtensions={});var i=r.crlExtensions,a=t.extensions;return a&&a.subjectKeyIdentifier&&(i.authorityKeyIdentifier={keyIdentifier:a.subjectKeyIdentifier,authorityCertIssuer:[t.issuer],authorityCertSerialNumber:t.serialNumber}),i.cRLNumber=i.cRLNumber||0,d.importKey("pkcs8",e.encode(),e.privateKeyAlgorithm,!1,["sign"])})).then((function(e){return d.sign(r.signatureAlgorithm,e,r.tbsCertList.encode())})).then((function(e){return r.signatureValue=e,r}))},verify:function(e,t){var r=this,n=r.crlExtensions;return new Promise(v).then((function(){if(t=t||y(),!r.thisUpdate.getTime()>t.getTime())throw new Error("The CRL has not yet started");if(e){if(!E(e,C(r,n,r.thisUpdate))||!e.checkUsage("cRLSign",r.thisUpdate))throw new Error("The issuer's certificate is not valid");if(!r.signatureValue||!r.signatureAlgorithm)throw new Error("The has no signature");return e.verifySignature(r.tbsCertList.encode(),r.signatureValue,r.signatureAlgorithm)}})).then((function(e){if(!e)throw new Error("The CRL has invalid signature");return r}))},isRevoked:function(e,t){var r=this.revokedCertificates;t=t||y();for(var n=0;n<r.length;n++)if(t.getTime()>=r[n].revocationDate.getTime()&&w(r[n].userCertificate,e))return!0;return!1}}),k.prototype.CRL=_,g(l.CertificationRequest,P,{generate:function(e){var t,r,n=this;return(r=e?h[e]:this.getProvider()||h[R.providerName])&&(e=p(r.publicKey,{privateKey:r.privateKey})),new Promise(v).then((function(){return d.generateKey(e,"true",["sign","verify"])})).then((function(e){return t=e.privateKey,d.exportKey("spki",e.publicKey)})).then((function(e){return n.subjectPublicKeyInfo=new l.SubjectPublicKeyInfo(e),d.exportKey("pkcs8",t)})).then((function(e){return t=new l.PrivateKeyInfo(e),n.sign(t)})).then((function(){return t}))},getProvider:function(){return T(this.subjectPublicKeyInfo.algorithm)},sign:function(e){var t=this,r=t.subjectPublicKeyInfo;return new Promise(v).then((function(){if(!r||!r.algorithm||"noSignature"===r.algorithm)throw new Error("Key pair was not generated for the certificate");if(!e)throw new Error("The private key is not defined");var n=T(r.algorithm)||h[R.providerName];return t.signatureAlgorithm=n.signature,d.importKey("pkcs8",e.encode(),e.privateKeyAlgorithm,!1,["sign"])})).then((function(e){return d.sign(t.signatureAlgorithm,e,t.requestInfo.encode())})).then((function(e){return t.signatureValue=e,t}))},verify:function(){var e=this,t=e.subjectPublicKeyInfo;return new Promise(v).then((function(){return d.importKey("spki",t.encode(),t.algorithm,"false",["verify"])})).then((function(t){return d.verify(e.signatureAlgorithm,t,e.signatureValue,e.requestInfo.encode())})).then((function(t){if(!t)throw new Error("The certification request has invalid signature");return e}))}}),k.prototype.Request=P,g(Object,N,{getCertificates:function(e){return A(this.certificates,e)},getCRLs:function(e){return x(this.certificates,e)},load:function(e){for(var t=new l.ContentInfo(e),r=t.certificates,n=t.crls,i=0;i<r.length;i++)this.certificates.push(new D(r[i]));for(i=0;i<n.length;i++)this.crls.push(new _(n[i]));return this},store:function(){return new l.ContentInfo({contentType:"signedData",version:0,digestAlgorithms:[],encapContentInfo:{contentType:"data"},certificates:this.certs,crls:this.crls,signerInfos:[]})}}),k.prototype.CertStore=N,g(Object,O,{build:function(e,t){var r=this;return new Promise(v).then((function(){for(var n=new D(e),i=[],a=!1,s=[];n;){var o=[],c=[];if(i.push(n),!a){o=r.certStore.getCRLs({issuer:n.issuer,date:t});var u=C(n,n.extensions,n.notBefore);E(n,u)?a=!0:c=r.certStore.getCertificates(u)}var f=c.length>0&&new D(c[0]),h=o.length>0&&new _(o[0]);h&&s.push(h.verify(f,t)),s.push(n.verify(f,h,t)),n=f}if(!a)throw new Error("Root certificate is not found");return Promise.all(s).then((function(e){for(var t=0;t<e;t++)if(!e[t])throw new Error("Certification path is not validated");return i}))}))}}),k.prototype.CertPath=O,g(Object,L,{getValidCertificate:function(e,t,r){}}),k.prototype.CertificateTrustPolicy=L,g(L,U,{getValidCertificate:function(e,t,r,n){var i,a=this;return new Promise(v).then((function(){t=t||[],r=r||[];var s=A(a.trustedCACerts,e);if(s.length>0)return new D(s[0]);if(0!==(s=A(t,e)).length){var o=new D(s[0]),c=!1,u=[];for(i=[];o;){var f=[],h=[];if(i.push(o),!c){if(0===(f=x(r,{issuer:o.issuer,date:n})).length&&a.requireCRL)return;if(e=C(o,o.extensions,o.notBefore),0===(h=A(a.trustedCACerts,e)).length){if(!E(o,e)){if(!((h=A(t,e)).length>0))return;var l=h[0].extensions;if(a.requireCA){if(!l||!l.basicConstraints||!l.basicConstraints.cA)return;if(void 0!==l.basicConstraints.pathLenConstraint&&l.basicConstraints.pathLenConstraint<i.length-1)return}}}else c=!0}var d=h.length>0&&new D(h[0]),p=f.length>0&&new _(f[0]);p&&u.push(p.verify(d,n)),u.push(o.verify(d,p,n)),o=d}if(!c)throw new Error("Trusted root certificate is not found");return Promise.all(u).then((function(e){for(var t=0;t<e;t++)if(!e[t])throw new Error("Certification path is not validated");return i[0]}))}}))}}),k.prototype.TrustedCAPolicy=U,t.gostCertInstance=new k},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.gostCMSInstance=void 0;var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.GostCMS=_;var i=r(83),a=r(77),s=r(39),o=r(171),c=r(78),u=ArrayBuffer,f=c.gostSecurityInstance.providers,h=s.gostCodingInstance,l=a.gostASN1Instance,d=i.gostSubtleInstance,p=o.gostCertInstance;function g(){for(var e={},t=0,r=arguments.length;t<r;t++){var i=arguments[t];if("object"===(void 0===i?"undefined":n(i)))for(var a in i)i.hasOwnProperty(a)&&(e[a]=i[a])}return e}function y(e,t,r,i){"object"!==(void 0===r?"undefined":n(r))&&(r={value:r}),void 0!==i&&(r.enumerable=i),Object.defineProperty(e,t,r)}function v(e,t,r){for(var n in t)y(e,n,t[n],r)}function m(e,t,r,n){if("function"!=typeof t&&(n=r,r=t,t=function(){e.apply(this,arguments)}),t.prototype=Object.create(e.prototype,{constructor:{value:t},superclass:{value:e.prototype}}),r&&v(t.prototype,r,!0),e!==Object)for(var i in e)t[i]=e[i];return t.super=e,n&&v(t,n,!0),t}function b(e){try{e()}catch(e){}}function w(e,t){var r=new Uint8Array(e),n=new Uint8Array(t);if(r.length!==n.length)return!1;for(var i=0,a=r.length;i<a;i++)if(r[i]!==n[i])return!1;return!0}var S,E,C=(S=function(e){var t=void 0===e?"undefined":n(e);return"undefined"===t||""===e?"0":"number"===t||e instanceof Number?e.toString(16).toLowerCase():e.replace("0x","").toLowerCase()},E=function(e,t){return(new Array(t+1).join("0")+e).slice(-t)},function(e,t){e=S(e),t=S(t);var r=Math.max(e.length,t.length);return E(e,r)===E(t,r)});function A(e,t){for(var r in e)if(e[r]!==t[r])return!1;for(var r in t)if(e[r]!==t[r])return!1;return!0}function B(e,t,r){for(var n=!1,i=0,a=e.length;i<a;i++)if(r(e[i],t)){n=!0;break}n||e.push(t)}function x(e,t){var r=e.content;switch(e.contentType){case"data":e.content=t.content;break;case"digestedData":case"signedData":case"authData":r.encapContentInfo={eContentType:t.contentType,eContent:t.content};break;case"envelopedData":case"encryptedData":r.encryptedContentInfo={contentType:t.contentType,encryptedContent:t.content}}}function T(e){var t=e.content;switch(e.contentType){case"data":return{contentType:e.contentType,content:e.content};case"digestedData":case"signedData":case"authData":var r=t.encapContentInfo;return{contentType:r.eContentType,content:r.eContent};case"envelopedData":case"encryptedData":var n=t.encryptedContentInfo;return{contentType:n.contentType,content:n.encryptedContent}}}function I(e){var t,r;if(e){if("string"==typeof e)try{e=h.PEM.decode(e)}catch(t){e=h.Chars.decode(e)}if(e instanceof u)try{e=l.ContentInfo.decode(e)}catch(t){e={contentType:"data",content:e}}if(!(r=e.contentType))throw new Error("Invalid content object");return(t=e.content)instanceof u||(t=t.encode()),{contentType:r,content:t}}return{contentType:"data"}}function F(e){try{e=new l.ContentInfo(e.content,!0)}catch(e){}switch(e.contentType){case"data":return new N(e);case"digestedData":return new O(e);case"signedData":return new L(e);case"encryptedData":return new U(e);case"envelopedData":return new K(e);default:return new l.ContentInfo(e)}}function k(e,t){return e instanceof u?t.extensions&&w(e,t.extensions.subjectKeyIdentifier):A(t.issuer,e.issuer)&&C(t.serialNumber,e.serialNumber)}function R(e){var t=new Uint8Array(e);return gostCrypto.getRandomValues(t),t.buffer}function D(e,t){if(!t)return new u(0);if(t instanceof u)return t;if("string"!=typeof t)throw new Error("The password must be string or raw data type");if(e.name.indexOf("CPKDF")>=0){for(var r=[],n=0;n<t.length;n++){var i=t.charCodeAt(n);r.push(255&i),r.push(i>>>8&255),r.push(0),r.push(0)}return new Uint8Array(r).buffer}return e.name.indexOf("PFXKDF")>=0?h.Chars.decode(t+"\0","unicode"):h.Chars.decode(t,"utf8")}function _(){}var P={providerName:"CP-01",autoAddCert:!1,useKeyIdentifier:!1};function N(e,t){if(l.ContentInfo.call(this,e||t||{contentType:"data"}),t&&this.contentType!==(t.contentType||"data"))throw new Error("Invalid content type")}function O(e){N.call(this,e,{contentType:"digestedData",version:0,digestAlgorithm:f[P.providerName].digest,encapContentInfo:{eContentType:"data"},digest:new u(0)})}function L(e){N.call(this,e,{contentType:"signedData",version:1,digestAlgorithms:[],encapContentInfo:{eContentType:"data"},signerInfos:[]})}function U(e){N.call(this,e,{contentType:"encryptedData",version:0,encryptedContentInfo:{contentType:"data",contentEncryptionAlgorithm:f[P.providerName].encryption}})}function K(e){N.call(this,e,{contentType:"envelopedData",version:0,recipientInfos:[],encryptedContentInfo:{contentType:"data",contentEncryptionAlgorithm:f[P.providerName].encryption}})}_.prototype.options=P,m(l.ContentInfo,N,{isDetached:{value:!1,enumerable:!0,writable:!0},writeDetached:function(e){this.isDetached=e},encode:function(e){if(this.isDetached){var t=T(this);x(this,{contentType:t.contentType});var r=l.ContentInfo.method("encode").call(this,e);return x(this,t),r}return l.ContentInfo.method("encode").call(this,e)},encloseContent:function(e){var t=this;return new Promise(b).then((function(){return t.setEnclosed(e),t}))},setEnclosed:function(e){x(this,I(e))},getEnclosed:function(){return F(T(this))}}),_.prototype.DataContentInfo=N,m(N,O,{encloseContent:function(e,t){var r=this;return new Promise(b).then((function(){if(r.setEnclosed(e),t){var n=f[t];r.digestAlgorithm=n&&n.digest||t}return d.digest(r.digestAlgorithm,r.encapContentInfo.eContent)})).then((function(e){r.digest=e}))},verify:function(e){var t=this;return new Promise(b).then((function(){if(e&&t.setEnclosed(e),!t.encapContentInfo||!t.encapContentInfo.eContent)throw new Error("Detached content is not found");return d.digest(t.digestAlgorithm,t.encapContentInfo.eContent)})).then((function(e){if(!w(e,t.digest))throw Error("Message digest is not verified");return F({contentType:t.encapContentInfo.eContentType,content:t.encapContentInfo.eContent})}))}}),_.prototype.DigestedDataContentInfo=O,m(N,L,{addSignature:function(e,t,r,i){var a,s,o,c=this;return new Promise(b).then((function(){if(!e||!t)throw new Error("Signer key or certificate is not defined");t instanceof Array?t=(o=t)[0]:o=[t];var u=t.getProvider()||f[P.providerName],h=P.useKeyIdentifier&&t.extensions&&t.extensions.subjectKeyIdentifier;if(s=c.encapContentInfo.eContent,a={version:h?2:0,sid:h?t.extensions.subjectKeyIdentifier:{issuer:t.issuer,serialNumber:t.serialNumber},digestAlgorithm:u.digest,signatureAlgorithm:t.subjectPublicKeyInfo.algorithm},i&&(a.unsignedAttrs=i),r)return"object"!==(void 0===r?"undefined":n(r))&&(r={}),d.digest(a.digestAlgorithm,s)})).then((function(t){return t&&(r.contentType=c.encapContentInfo.eContentType,r.messageDigest=t,r.signingTime=new Date,a.signedAttrs=r,s=l.SignedAttributes.encode(a.signedAttrs)),d.importKey("pkcs8",l.PrivateKeyInfo.encode(e),e.privateKeyAlgorithm,!1,["sign"])})).then((function(e){var t=g(a.signatureAlgorithm,{hash:a.digestAlgorithm});return d.sign(t,e,s)})).then((function(e){if(a.signatureValue=e,B(c.digestAlgorithms,a.digestAlgorithm,(function(e,t){return e.id===t.id})),P.autoAddCert){c.certificates||(c.certificates=[]);for(var t=0,r=o.length;t<r;t++)B(c.certificates,o[t],(function(e,t){return A(e.issuer,t.issuer)&&C(e.serialNumber,t.serialNumber)}))}c.signerInfos.push(a)}))},isDegenerate:{get:function(){return!(this.signerInfos&&this.signerInfos.length>0)}},verify:function(e,t){var r,n=this;return new Promise(b).then((function(){if(t&&n.setEnclosed(t),!n.signerInfos||0===n.signerInfos.length)throw new Error("No signatures found");return Promise.all(n.signerInfos.map((function(t,r){var i,a=t.sid,s=a instanceof u?{subjectKeyIdentifier:a}:{issuer:a.issuer,serialNumber:a.serialNumber};return t.signedAttrs&&t.signedAttrs.signingTime&&(i=t.signedAttrs.signingTime),e.getValidCertificate(s,n.certificates,n.crls,i).catch((function(){}))})))})).then((function(e){var t=[];if(e.forEach((function(e){e&&t.push(n.verifySignature(e).then((function(e){r=e}),(function(){})))})),0===t.length)throw new Error("Valid verification path not found");return Promise.all(t)})).then((function(){if(!r)throw Error("Verification path found but no valid signature");return r}))},verifySignature:function(e,t){var r,n,i,a=this;return new Promise(b).then((function(){if(t&&a.setEnclosed(t),!(n=a.encapContentInfo&&a.encapContentInfo.eContent))throw new Error("Detached content is not found");for(var s=0;s<a.signerInfos.length;s++)if(k(a.signerInfos[s].sid,e)){r=a.signerInfos[s];break}if(!r)throw new Error("Signature not found for the certificate");if(r.signedAttrs){if(!(i=r.signedAttrs.messageDigest))throw new Error("Message digest must present in signed attributes");n=r.signedAttrs.encode()}if(!n)throw new Error("Data for verification not found");var o=g(r.signatureAlgorithm,{hash:r.digestAlgorithm});return e.verifySignature(n,r.signatureValue,o)})).then((function(e){if(!e)throw new Error("Signature not verified");if(r.signedAttrs)return d.digest(r.digestAlgorithm,a.encapContentInfo.eContent)})).then((function(e){if(e&&!w(e,i))throw new Error("Message digest not verified");return F({contentType:a.encapContentInfo.eContentType,content:a.encapContentInfo.eContent})}))}}),_.prototype.SignedDataContentInfo=L,m(N,U,{encloseContent:function(e,t,r){var n,i,a=this;return new Promise(b).then((function(){if(!(e=I(e)).content)throw new Error("Content for encryption must be specified");var a,s="string"==typeof t?"pbes":"encryption";if(r){var o=f[r];r=o&&o[s]||r}else r=f[P.providerName][s];if(r.derivation)return i=g(r.derivation),n=g(r.encryption),i.salt=R(function(e){switch(e.id){case"pbeWithSHAAnd40BitRC2-CBC":case"pbeWithSHAAnd128BitRC2-CBC":return 8;case"pbeUnknownGost":return 16;case"sha1":return 20;default:return 32}}(r)),d.importKey("raw",D(i,t),i,!1,["deriveKey","deriveBits"]).then((function(e){if(a=e,i.name.indexOf("PFXKDF")>=0)return i.diversifier=2,d.deriveBits(i,a,64)})).then((function(e){return e&&(n.iv=e),i.diversifier=1,d.deriveKey(i,a,n,!1,["encrypt"])})).then((function(e){return e}));if(n=g(r),t instanceof u)return d.importKey("raw",t,n,!1,["encrypt"]);if("secret"===t.type)return t;throw new Error("Content encryption key must be raw data or secret key type")})).then((function(t){return n.iv||(n.iv=R(8)),d.encrypt(n,t,e.content)})).then((function(t){return r.derivation?(delete i.diversifier,r=g(r,{derivation:i,encryption:n})):r=n,a.encryptedContentInfo={contentType:e.contentType,contentEncryptionAlgorithm:r,encryptedContent:t},a}))},getEnclosed:function(e,t){var r,n,i,a=this;return new Promise(b).then((function(){if(t&&a.setEnclosed(t),!(i=a.encryptedContentInfo.encryptedContent))throw new Error("Encrypted content must be specified");var s;if((r=g(a.encryptedContentInfo.contentEncryptionAlgorithm)).derivation)return n=g(r.derivation),r=g(r.encryption),d.importKey("raw",D(n,e),n,!1,["deriveKey","deriveBits"]).then((function(e){if(s=e,n.name.indexOf("PFXKDF")>=0)return n.diversifier=2,d.deriveBits(n,s,64)})).then((function(e){return e&&(r.iv=e),n.diversifier=1,d.deriveKey(n,s,r,!1,["decrypt"])}));if(e instanceof u)return d.importKey("raw",e,r,!1,["decrypt"]);if("secret"===e.type)return e;throw new Error("Decryption key must be raw data or secret key type")})).then((function(e){return d.decrypt(r,e,i)})).then((function(e){return F({contentType:a.encryptedContentInfo.contentType,content:e})}))}}),_.prototype.EncryptedDataContentInfo=U,m(N,K,{encloseContent:function(e,t){var r=this;return new Promise(b).then((function(){if(!(e=I(e)).content)throw new Error("Content for encryption must be specified");if(t){var r=f[t];t=r&&r.encryption||t}else t=f[P.providerName].encryption;return d.generateKey(t,!0,["encrypt"])})).then((function(n){return r.contentEncryptionKey=n,t.iv||(t.iv=R(8)),d.encrypt(t,n,e.content)})).then((function(n){return r.encryptedContentInfo={contentType:e.contentType,contentEncryptionAlgorithm:t,encryptedContent:n},r}))},addRecipient:function(e,t,r,n){var i,a,s,o,c=this;return new Promise(b).then((function(){if(e=new p.X509(e),t&&"string"!=typeof t&&!t.algorithm&&(n=r,r=t,t=void 0),a=t?f[t]:e.getProvider(),!c.contentEncryptionKey)throw new Error("The content encryption key is not assigned");if(n){var i;if(n instanceof Array?n=(i=n)[0]:i=[n],P.autoAddCert){c.originatorInfo?c.originatorInfo.certs||(c.originatorInfo.certs=[]):c.originatorInfo={certs:[]};for(var s=0,o=i.length;s<o;s++)B(c.originatorInfo.certs,i[s],(function(e,t){return A(e.issuer,t.issuer)&&C(e.serialNumber,t.serialNumber)}))}if(a?t=g(a.agreement):a=e.getProvider(),e.subjectPublicKeyInfo.algorithm.namedCurve!==n.subjectPublicKeyInfo.algorithm.namedCurve)throw new Error("The sender and the recipient have different public key algorithms");return d.importKey("pkcs8",r.encode(),r.privateKeyAlgorithm,!1,["deriveKey"])}return a?t=g(e.subjectPublicKeyInfo.algorithm):a=e.getProvider(),d.generateKey(t,!0,["deriveKey"]).then((function(e){return t.public=e.publicKey,e.privateKey}))})).then((function(t){return i=t,d.importKey("spki",e.subjectPublicKeyInfo.encode(),e.subjectPublicKeyInfo.algorithm,!1,["deriveKey","deriveBits"])})).then((function(e){return t.ukm=R(8),s=g(a.agreement,{sBox:t.sBox,ukm:t.ukm,public:e}),o=g(t.wrapping||a.wrapping,{ukm:t.ukm}),d.deriveKey(s,i,o,!0,["wrapKey"])})).then((function(e){return t.wrapping=o,d.wrapKey("raw",c.contentEncryptionKey,e,o)})).then((function(r){var i,a=P.useKeyIdentifier&&e.extensions&&e.extensions.subjectKeyIdentifier?e.extensions.subjectKeyIdentifier:{issuer:e.issuer,serialNumber:e.serialNumber};if(n){var s=n.subjectPublicKeyInfo;i={version:3,originator:{algorithm:s.algorithm,publicKey:s.subjectPublicKey},ukm:t.ukm,keyEncryptionAlgorithm:t,recipientEncryptedKeys:[{rid:a,encryptedKey:l.GostEncryptedKey(t).encode(r)}]}}else i={version:0,rid:a,keyEncryptionAlgorithm:t,encryptedKey:l.GostEncryptedKey(t).encode({algorithm:t,sessionEncryptedKey:r})};return c.recipientInfos.push(i),c}))},getEnclosed:function(e,t,r,n){var i,a,s,o,c,u=this;return new Promise(b).then((function(){var e=t.getProvider();if(r&&u.setEnclosed(r),!(a=u.encryptedContentInfo.encryptedContent))throw new Error("Encrypted content must be specified");c=u.encryptedContentInfo.contentEncryptionAlgorithm;for(var f=0;f<u.recipientInfos.length;f++){var h=u.recipientInfos[f],p=g(h.keyEncryptionAlgorithm);if(h.rid){if(k(h.rid,t)){var y=l.GostEncryptedKey(p).decode(h.encryptedKey).object;return i=y.sessionEncryptedKey,p=g(p,y.algorithm),s=g(e.agreement,{ukm:p.ukm,sBox:p.sBox}),o=g(e.wrapping,p.wrapping,{ukm:p.ukm}),p.public}}else{var v=h.recipientEncryptedKeys;if(v)for(var m=0;m<v.length;m++)if(k(v[m].rid,t)){p=g(e.agreement,p,{ukm:h.ukm}),i=l.GostEncryptedKey(p).decode(v[m].encryptedKey).object,s=p,o=g(p.wrapping||e.wrapping,{ukm:h.ukm});var b=h.originator;if(b.algorithm){var w=new l.SubjectPublicKeyInfo({algorithm:b.algorithm,subjectPublicKey:b.publicKey});return d.importKey("spki",w.encode(),w.algorithm,!1,["deriveKey","deriveBits"])}if(n&&k(b,n))return importKey("pkcs",n.subjectPublicKeyInfo.encode(),n.subjectPublicKeyInfo.algorithm,!1,["deriveKey","deriveBits"]);throw Error("Originator certificate not specified or not valid")}}}throw new Error("Recipient not found or format not supported")})).then((function(t){return s.public=t,d.importKey("pkcs8",e.encode(),e.privateKeyAlgorithm,!1,["deriveKey","deriveBits"])})).then((function(e){return d.deriveKey(s,e,o,!0,["unwrapKey"])})).then((function(e){return d.unwrapKey("raw",i,e,o,c,!1,["decrypt"])})).then((function(e){return d.decrypt(c,e,a)})).then((function(e){return F({contentType:u.encryptedContentInfo.contentType,content:e})}))}}),_.prototype.EnvelopedDataContentInfo=K,t.gostCMSInstance=new _},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.gostCrypto=void 0;var n=r(80),i=r(39),a=r(78),s=r(77),o=r(83),c=r(171),u=r(172),f=r(175);(t.gostCrypto={coding:i.gostCodingInstance,security:a.gostSecurityInstance,asn1:s.gostASN1Instance,subtle:o.gostSubtleInstance,cert:c.gostCertInstance,cms:u.gostCMSInstance,keys:f.gostKeysInstance}).getRandomValues=function(e){try{return(new n.GostRandom).getRandomValues(e)}catch(e){throw new Error("Error occurred during random values generation")}}},,function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.gostKeysInstance=void 0;var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.GostKeys=R;var i=r(78),a=r(39),s=r(77),o=r(83),c=r(171),u=r(172),f=ArrayBuffer,h=a.gostCodingInstance,l=i.gostSecurityInstance.providers,d=s.gostASN1Instance,p=o.gostSubtleInstance,g=c.gostCertInstance,y=u.gostCMSInstance;function v(){for(var e={},t=0,r=arguments.length;t<r;t++){var i=arguments[t];if("object"===(void 0===i?"undefined":n(i)))for(var a in i)i.hasOwnProperty(a)&&(e[a]=i[a])}return e}function m(e,t,r,i){"object"!==(void 0===r?"undefined":n(r))&&(r={value:r}),void 0!==i&&(r.enumerable=i),Object.defineProperty(e,t,r)}function b(e,t,r){for(var n in t)m(e,n,t[n],r)}function w(e,t,r,n){if("function"!=typeof t&&(n=r,r=t,t=function(){e.apply(this,arguments)}),t.prototype=Object.create(e.prototype,{constructor:{value:t},superclass:{value:e.prototype}}),r&&b(t.prototype,r,!0),e!==Object)for(var i in e)t[i]=e[i];return t.super=e,n&&b(t,n,!0),t}function S(e){var t=new Uint8Array(e);return gostCrypto.getRandomValues(t),t.buffer}function E(e){try{e()}catch(e){}}function C(e){if(e instanceof f)return e;if(e&&e.buffer&&e.buffer instanceof f)return 0===e.byteOffset&&e.byteLength===e.buffer.byteLength?e.buffer:new Uint8Array(new Uint8Array(e,e.byteOffset,e.byteLength)).buffer;throw new DataError("CryptoOperationData required")}function A(e){var t=new Date;return e&&t.setDate(t.getDate()+e),t}function B(e){var t=A(e);return t.setHours(0,0,0,0),t}function x(e,t){var r=new Uint8Array(e),n=new Uint8Array(t);if(r.length!==n.length)return!1;for(var i=0,a=r.length;i<a;i++)if(r[i]!==n[i])return!1;return!0}function T(e,t){var r=new Uint8Array(e,t,4);return r[3]<<24|r[2]<<16|r[1]<<8|r[0]}function I(e,t,r){var n=new Uint8Array(e,t,4);return n[3]=r>>>24,n[2]=r>>>16&255,n[1]=r>>>8&255,n[0]=255&r,n}function F(e){switch(e.id){case"pbeWithSHAAnd40BitRC2-CBC":case"pbeWithSHAAnd128BitRC2-CBC":return 8;case"pbeUnknownGost":return 16;case"sha1":return 20;default:return 32}}function k(e,t){if(!t)return new f(0);if(e.name.indexOf("CPKDF")>=0){for(var r=[],n=0;n<t.length;n++){var i=t.charCodeAt(n);r.push(255&i),r.push(i>>>8&255),r.push(0),r.push(0)}return new Uint8Array(r).buffer}return e.name.indexOf("PFXKDF")>=0?h.Chars.decode(t+"\0","unicode"):h.Chars.decode(t,"utf8")}function R(){}var D={providerName:"CP-01",days:7305};function _(e){d.PrivateKeyInfo.call(this,e)}function P(e){d.EncryptedPrivateKeyInfo.call(this,e)}function N(e){if(e){var t=this;["mk.db3","masks.db3","kek.opq","rand.opq"].forEach((function(r){t[r]=e[r]}))}}function O(e,t){d.GostWrappedPrivateKey.call(this,e),N.call(this,t)}function L(e){e&&(this.header=d.GostKeyContainer.decode(e.header),this.name=d.GostKeyContainerName.decode(e.name),this.primary=d.GostPrivateKeys.decode(e.primary),this.masks=d.GostPrivateMasks.decode(e.masks),e.primary2&&e.masks2&&(this.primary2=d.GostPrivateKeys.decode(e.primary2),this.masks2=d.GostPrivateMasks.decode(e.masks2)))}function U(e){d.ViPNetInfo.call(this,e||{version:3,keyInfo:{keyClass:1,keyType:43556,flags:1},defenceKeyInfo:{keyClass:1024,keyType:24622,keyUID:S(32),flags:-2147483648}})}function K(e){e&&(e instanceof f||e.buffer instanceof f||"string"==typeof e)?this.decode(e):(e=e||{},this.fileType=e.fileType||"ITCS",this.fileVersion=e.fileVersion||16,e.applicationHeader&&(this.applicationHeader=e.applicationHeader),this.entries=e.entries||[])}function M(e){d.PFX.call(this,e||{version:3,authSafe:{contentType:"data"}})}function H(e){if(this.entries={},e)for(var t in e)this.setEntry(t,e[t])}R.prototype.options=D,w(d.PrivateKeyInfo,_,{getPrivateKey:function(){var e="rsaEncryption"===this.privateKeyAlgorithm.id?["sign"]:["sign","deriveKey","deriveBits"];return p.importKey("pkcs8",this.encode(),this.privateKeyAlgorithm,"true",e)},setPrivateKey:function(e){var t=this;return p.exportKey("pkcs8",e).then((function(e){return d.PrivateKeyInfo.call(t,e),t}))},generate:function(e,t){var r=this;return new Promise(E).then((function(){return e instanceof g.Request||(e=new g.Request(e)),e.generate(t)})).then((function(t){return d.PrivateKeyInfo.call(r,t),e}))}}),R.prototype.PKCS8=_,w(d.EncryptedPrivateKeyInfo,P,{getKey:function(e){var t=this;return new Promise(E).then((function(){return new y.EncryptedDataContentInfo({contentType:"encryptedData",version:0,encryptedContentInfo:{contentType:"data",contentEncryptionAlgorithm:t.encryptionAlgorithm,encryptedContent:t.encryptedData}}).getEnclosed(e)})).then((function(e){return _.decode(e.content)}))},getPrivateKey:function(e){return this.getKey(e).then((function(e){return e.getPrivateKey()}))},setKey:function(e,t,r){var n,i=this;return new Promise(E).then((function(){return e=new _(e),(n=new y.EncryptedDataContentInfo).encloseContent(e.encode(),t,r||D.providerName)})).then((function(){return i.encryptionAlgorithm=n.encryptedContentInfo.contentEncryptionAlgorithm,i.encryptedData=n.encryptedContentInfo.encryptedContent,i}))},setPrivateKey:function(e,t,r){var n=this;return(new _).setPrivateKey(e).then((function(e){return n.setKey(e,t,r)}))},generate:function(e,t,r,n){var i=this;return new Promise(E).then((function(){return e instanceof g.Request||(e=new g.Request(e)),e.generate(r)})).then((function(e){return i.setKey(e,t,n)})).then((function(){return e}))}}),R.prototype.PKCS8Encrypted=P,w(Object,N,{getEncryptionKey:function(e){var t=this,r=l["SC-01"].wrapping,n=l["SC-01"].encryption,i=l["SC-01"].derivation,a=t["masks.db3"],s=t["mk.db3"],o=t["kek.opq"];return new Promise(E).then((function(){if(!a||!s||!o)throw new Error("Not enougth key container files");if(a.byteLength>32){if(e)return p.importKey("raw",h.Chars.decode(e,"utf8"),i,!1,["deriveKey","deriveBits"]).then((function(e){return p.deriveKey(v(i,{salt:new Uint8Array([0,0,0,0,0,0,0,0])}),e,n,!1,["decrypt"])})).then((function(e){return new y.EncryptedDataContentInfo(a).getEnclosed(e)})).then((function(e){return e.verify()})).then((function(e){return e.content}));throw new Error("Key password is required")}if(e)throw new Error("Key password is not required");return a})).then((function(e){a=e;var t=new Uint8Array(s.byteLength+a.byteLength);return t.set(new Uint8Array(s),0),t.set(new Uint8Array(a),s.byteLength),p.importKey("raw",t.buffer,r,!1,["unwrapKey"])})).then((function(e){return p.unwrapKey("raw",o,e,r,n,!1,["wrapKey","unwrapKey"])}))},generateContainer:function(e){var t,r,n=this,i=l["SC-01"].wrapping,a=l["SC-01"].encryption,s=l["SC-01"].derivation,o=l["SC-01"].digest;return new Promise(E).then((function(){return p.generateKey(i,!0,["wrapKey"])})).then((function(t){var i=(r=t).buffer.byteLength;n["mk.db3"]=new Uint8Array(new Uint8Array(r.buffer,0,i-32)).buffer;var c=new Uint8Array(new Uint8Array(r.buffer,i-32,32)).buffer;if(e){var u=new y.EncryptedDataContentInfo,f=new y.DigestedDataContentInfo;return f.encloseContent(c,o).then((function(){return f={contentType:"digestedData",content:f.encode()},p.importKey("raw",h.Chars.decode(e,"utf8"),s,!1,["deriveKey","deriveBits"])})).then((function(e){return p.deriveKey(v(s,{salt:new Uint8Array([0,0,0,0,0,0,0,0])}),e,a,!1,["encrypt"])})).then((function(e){return u.encloseContent(f,e,a)})).then((function(){return u.encode()}))}return c})).then((function(e){return n["masks.db3"]=e,p.generateKey(a,!1,["wrapKey","unwrapKey"])})).then((function(e){return t=e,p.wrapKey("raw",e,r,i)})).then((function(e){return n["kek.opq"]=e,p.generateKey(a,!1,["wrapKey","unwrapKey"])})).then((function(e){return p.wrapKey("raw",e,r,i)})).then((function(e){return n["rand.opq"]=e,t}))}}),R.prototype.SignalComKeyContainer=N,w(d.GostWrappedPrivateKey,O,{getKey:function(e){return this.getPrivateKey(e).then((function(e){return(new _).setPrivateKey(e)}))},getPrivateKey:function(e){var t,r=this,n=l["SC-01"].wrapping;return new Promise(E).then((function(){return r.getEncryptionKey(e,!0)})).then((function(e){return p.unwrapKey("raw",r.privateKeyWrapped,e,n,r.privateKeyAlgorithm,!0,["sign","deriveKey","deriveBits"])})).then((function(e){return(t=r.attributes&&r.attributes["id-sc-gostR3410-2001-publicKey"])?p.generateKey(v(e.algorithm,{ukm:e.buffer}),e.extractable,e.usages):{privateKey:e}})).then((function(e){if(t&&!x(e.publicKey.buffer,t))throw new Error("Check public key failed");return e.privateKey}))},setKey:function(e,t){var r=this;return new _(e).getPrivateKey().then((function(e){return r.setPrivateKey(e,t)}))},setPrivateKey:function(e,t){var r,n=this,i=l["SC-01"].wrapping;return new Promise(E).then((function(){return n.getEncryptionKey(t).catch((function(){return n.generateContainer(t)}))})).then((function(t){return p.wrapKey("raw",e,t,i)})).then((function(t){return r=t,p.generateKey(v(e.algorithm,{ukm:e.buffer}),!0,["sign","verify"])})).then((function(t){return n.object={version:0,privateKeyAlgorithm:e.algorithm,privateKeyWrapped:r,attributes:{"id-sc-gostR3410-2001-publicKey":t.publicKey.buffer}},n}))},changePassword:function(e,t){var r=this;return r.getPrivateKey(e).then((function(e){return r.setPrivateKey(e,t)}))},generate:function(e,t,r){var n,i=this;return new Promise(E).then((function(){return e instanceof g.Request||(e=new g.Request(e)),e.generate(r)})).then((function(e){return n=e,i.setKey(n,t)})).then((function(){return e}))}}),b(O.prototype,N.prototype),R.prototype.SignalComPrivateKeyInfo=O,w(Object,L,function(){function e(e,t,r){var n=function(e){return!(e.name.indexOf("-94")>=0||e.name.indexOf("-2001")>=0||1994===e.version||2001===e.version)}(e)?"GOST R 34.11-256":"GOST R 34.11-94/"+(e.sBox||"D-A"),i={name:"CPKDF",hash:n,salt:r,iterations:t?2e3:2};return p.importKey("raw",k(i,t),i,!1,["deriveKey","deriveBits"]).then((function(e){return p.deriveKey(i,e,"GOST 28147",!1,["sign","verify","encrypt","decrypt"])}))}function t(t,r,n){var i=v({name:"GOST 28147-MAC"},t.encParams);return e(t,r,n).then((function(e){return p.sign(i,e,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]))}))}function r(e,t){var r=v({name:"GOST 28147-MAC"},e.encParams),n=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);return p.importKey("raw",n,r,!1,["sign"]).then((function(e){return p.sign(r,e,t.encode())}))}function n(e,t,r){var n=v({name:"GOST 28147-MAC"},e.encParams),i=64===t.byteLength?new Uint8Array(new Uint8Array(t,32,32)).buffer:t;return p.importKey("raw",i,n,!1,["sign"]).then((function(e){return p.sign(n,e,r)}))}function i(e){return p.generateKey(v(e.algorithm,{ukm:e.buffer}),!0,["sign","verify"]).then((function(e){return new Uint8Array(new Uint8Array(e.publicKey.buffer,0,8)).buffer}))}function a(e,t,r,n,a){var s,o,c={name:"GOST 28147-ECB",sBox:e.encParams&&e.encParams.sBox},u=v(e,{mode:"MASK"});return u.name=u.name.replace("-DH",""),p.decrypt(c,t,r).then((function(e){return o=e,p.importKey("raw",n,u,"false",["sign","unwrapKey"])})).then((function(t){return p.unwrapKey("raw",o,t,u,e,"true",["sign"])})).then((function(e){return i(s=e)})).then((function(e){if(!x(e,a))throw new Error("Incorrect fp");return s}))}function s(t,r,i,s,o){var c=t.primaryPrivateKeyParameters.privateKeyAlgorithm;return new Promise(E).then((function(){if(r.hmacKey)throw new Error("Old key format");if(i.randomStatus.byteLength<12)throw new Error("Invalid random status length");return n(c,i.mask,i.randomStatus)})).then((function(t){if(!x(t,i.hmacRandom))throw new Error("Imita for mask is invalid");return e(c,s,new Uint8Array(i.randomStatus,0,12))})).then((function(e){return o&&r.secondaryKey?a(t.secondaryPrivateKeyParameters.privateKeyAlgorithm,e,r.secondaryKey,i.mask,t.secondaryFP):a(c,e,r.primaryKey,i.mask,t.primaryFP)}))}return{getKey:function(e,t){return this.getPrivateKey(e,t).then((function(e){return(new _).setPrivateKey(e)}))},getPrivateKey:function(e,t){var r=this,n=r.header.keyContainerContent;return s(n,r.primary,r.masks,e,t).catch((function(i){if(r.primary2&&r.masks2)return s(n,r.primary2,r.masks2,e,t);throw i}))},getCertificate:function(e){var t=this.header.keyContainerContent;return new Promise(E).then((function(){return e?new g.X509(t.secondaryCertificate):new g.X509(t.primaryCertificate)}))},getContainerName:function(){return this.name.containerName},setKey:function(e,t,r,n){var i=this;return new _(e).getPrivateKey().then((function(e){return i.setPrivateKey(e,t,r,n)}))},setPrivateKey:function(a,s,o,c){var u,f,h=this;return new Promise(E).then((function(){h.header=h.header||new d.GostKeyContainer({keyContainerContent:{containerAlgoritmIdentifier:{algorithm:"id-CryptoPro-GostPrivateKeys-V2-Full"},attributes:["kccaReservePrimary","kccaPrimaryKeyAbsent"],extensions:{keyValidity:{notAfter:A(c||D.days)}}}}),u=h.header.keyContainerContent;var e=o?u.secondaryPrivateKeyParameters:u.primaryPrivateKeyParameters;if(e)f=e.privateKeyAlgorithm;else if(e={attributes:["pkaExportable","pkaExchange","pkaDhAllowed"],privateKeyAlgorithm:f=v(a.algorithm,{sBox:"D-A",encParams:{block:"CFB",sBox:"E-A",keyMeshing:"CP"}})},o){if(!u.primaryPrivateKeyParameters)throw new Error("Primary key must be defined first");u.secondaryPrivateKeyParameters=e}else{u.primaryPrivateKeyParameters=e;var t=u.attributes.indexOf("kccaPrimaryKeyAbsent");t>=0&&u.attributes.splice(t,1)}var r=[];return[0,1].forEach((function(e){var t="masks"+(e>0?"2":"");h[t]||r.push(function(e){var t,r=v(e,{mode:"MASK"}),i=S(12);return r.name=r.name.replace("-DH",""),p.generateKey(r,!0,["wrapKey","unwrapKey"]).then((function(e){return p.exportKey("raw",e)})).then((function(r){return n(e,t=r,i)})).then((function(e){return new d.GostPrivateMasks({mask:t,randomStatus:i,hmacRandom:e})}))}(f).then((function(e){h[t]=e})))})),Promise.all(r)})).then((function(){var t=[];return[0,1].forEach((function(r){var n="primary"+(r>0?"2":""),i="masks"+(r>0?"2":"");t.push(function(t,r,n,i,a,s){return e(t,i,new Uint8Array(n.randomStatus,0,12)).then((function(e){return function(e,t,r,n){var i={name:"GOST 28147-ECB",sBox:e.encParams&&e.encParams.sBox},a=v(e,{mode:"MASK"});return a.name=a.name.replace("-DH",""),p.importKey("raw",n,a,!1,["sign","wrapKey"]).then((function(e){return p.wrapKey("raw",r,e,a)})).then((function(e){return p.encrypt(i,t,e)}))}(t,e,s,n.mask)})).then((function(e){return r||(r=new d.GostPrivateKeys),a?r.secondaryKey=e:r.primaryKey=e,r}))}(f,h[n],h[i],s,o,a).then((function(e){h[n]=e})))})),Promise.all(t)})).then((function(){return i(a).then((function(e){o?u.secondaryFP=e:u.primaryFP=e}))})).then((function(){var e=u.attributes.indexOf("kccaSoftPassword");if(s)return e<0&&u.attributes.push("kccaSoftPassword"),t(f,s,u.primaryFP);e>=0&&u.attributes.splice(e,1)})).then((function(e){return e&&(u.hmacPassword=e),r(f,u)})).then((function(e){return h.header.hmacKeyContainerContent=e,h}))},setCertificate:function(e,t,n){var i,a,s=this;return new Promise(E).then((function(){return s.header=s.header||new d.GostKeyContainer({keyContainerContent:{containerAlgoritmIdentifier:{algorithm:"id-CryptoPro-GostPrivateKeys-V2-Full"},attributes:["kccaReservePrimary","kccaPrimaryKeyAbsent"],extensions:{keyValidity:{notAfter:A(n||D.days)}}}}),i=s.header.keyContainerContent,e=new g.X509(e),a=i.primaryPrivateKeyParameters&&i.primaryPrivateKeyParameters.privateKeyAlgorithm||v(e.subjectPublicKeyInfo.algorithm,{sBox:"D-A",encParams:{block:"CFB",sBox:"E-A",keyMeshing:"CP"}}),e.getPublicKey()})).then((function(n){if(t){if(i.secondaryFP&&!x(i.secondaryFP,new Uint8Array(n.buffer,0,i.secondaryFP.byteLength)))throw new Error("The public key of the certificate does not match the private key");i.secondaryCertificate=e}else{if(i.primaryFP&&!x(i.primaryFP,new Uint8Array(n.buffer,0,i.primaryFP.byteLength)))throw new Error("The public key of the certificate does not match the private key");i.primaryCertificate=e}return r(a,i)})).then((function(e){return s.header.hmacKeyContainerContent=e,s}))},setContainerName:function(e){this.name=new d.GostKeyContainerName({containerName:e})},verify:function(e){var n,i,a=this;return new Promise(E).then((function(){return n=a.header.keyContainerContent,r(i=n.primaryPrivateKeyParameters.privateKeyAlgorithm,n)})).then((function(r){if(!x(r,a.header.hmacKeyContainerContent))throw new Error("Container is not valid.");var s=n.attributes.indexOf("kccaSoftPassword")>=0;if(!e&&s)throw new Error("Password is required");if(e&&!s)throw new Error("Password is not reqiured.");return e?t(i,e,n.primaryFP).then((function(e){if(!x(e,n.hmacPassword))throw new Error("Password is not valid.");return a})):a}))},changePassword:function(e,t){var r,n=this;return new Promise(E).then((function(){if(!(r=n.header.keyContainerContent).primaryPrivateKeyParameters)throw new Error("Private key not yet defined");return n.getPrivateKey(e).then((function(e){return n.setPrivateKey(e,t)}))})).then((function(){return r.secondaryPrivateKeyParameters?n.getPrivateKey(e,!0).then((function(e){return n.setPrivateKey(e,t,!0)})):n}))},generate:function(e,t,r){var n,i,a=this;return new Promise(E).then((function(){return e instanceof g.Request||(e=new g.Request(e)),e.generate(r)})).then((function(e){return i=e,a.setKey(i,t)})).then((function(){return(n=new g.X509(e)).sign(i)})).then((function(){return a.setCertificate(n)})).then((function(){return e}))},encode:function(e){return{header:this.header.encode(e),name:this.name.encode(e),masks:this.masks.encode(e),primary:this.primary.encode(e),masks2:this.masks2.encode(e),primary2:this.primary2.encode(e)}}}}()),R.prototype.CryptoProKeyContainer=L,w(d.ViPNetInfo,U,function(){function e(e){void 0===e&&(e="");var t,r=h.Chars.decode(e,"win1251");return p.digest("GOST R 34.11-94",r).then((function(e){t=e;var n=new Uint8Array(r.byteLength+t.byteLength);return n.set(new Uint8Array(r),0),n.set(new Uint8Array(t),r.byteLength),p.digest("GOST R 34.11-94",n)})).then((function(e){return p.importKey("raw",e,"GOST 28147",!1,["unwrapKey"])})).then((function(e){return p.unwrapKey("raw",t,e,"GOST 28147-MASK/VN","GOST 28147-89","false",["encrypt","decrypt","sign","verify"])}))}return{getPrivateKey:function(t){var r,n,i=this;return new Promise(E).then((function(){return t&&"string"!=typeof t?t:e(t)})).then((function(e){t=e,r=i.keyPart,n=new Uint8Array(r,0,r.byteLength-4-8);var a=new Uint8Array(r,n.byteLength,4),s=i.keyInfo.encode(),o=new Uint8Array(n.byteLength+s.byteLength);return o.set(new Uint8Array(n),0),o.set(new Uint8Array(s),n.byteLength),p.verify({name:"GOST 28147-89-MAC"},t,a,o)})).then((function(e){if(!e)throw new Error("Invalid key password");var i=new Uint8Array(r,r.byteLength-8,8);return p.decrypt({name:"GOST 28147-89-CFB",iv:i},t,n)})).then((function(e){var t=e.byteLength/2;if(!1&i.keyInfo.keyClass)return p.importKey("raw",new Int32Array(e,t,t),"GOST 28147",!1,["unwrapKey"]).then((function(r){return p.unwrapKey("raw",new Int32Array(e,0,t),r,"GOST 28147-MASK/VN","GOST 28147-89","false",["encrypt","decrypt","sign","verify"])}));var r=i.keyInfo.algorithm||i.certificate&&i.certificate.subjectPublicKeyInfo.algorithm;if(!r)throw new Error("Algorithm is not specified");var n=v(r,{mode:"MASK",procreator:"VN"});n.name=n.name.replace("-DH","");var a=new Uint8Array(e,0,t),s=new Uint8Array(e,t,t);return p.importKey("raw",s,n,"false",["sign","unwrapKey"]).then((function(e){return p.unwrapKey("raw",a,e,n,r,"true",["sign","deriveBits","deriveKey"])})).then((function(e){return i.publicKey?p.generateKey(v(e.algorithm,{ukm:e.buffer}),e.extractable,e.usages):{privateKey:e}})).then((function(e){if(i.publicKey&&!x(e.publicKey.buffer,i.publicKey))throw new Error("Check public key failed");return e.privateKey}))}))},setPrivateKey:function(t,r,n){var i,a,s,o,c=this;return new Promise(E).then((function(){return r&&"string"!=typeof r?r:e(r)})).then((function(e){r=e;var a=t.algorithm;if(c.keyInfo.algorithm=a,c.keyInfo.serialNumber=S(16),c.keyInfo.keyUID=S(8),c.keyInfo.validity={notBefore:B(),notAfter:B(n||D.days)},"private"===t.type)return(i=v(a,{mode:"MASK",procreator:"VN"})).name=i.name.replace("-DH",""),c.keyInfo.keyClass=1,c.keyInfo.keyType=43556,p.generateKey(v(a,{ukm:t.buffer}),!0,["sign","verify"]).then((function(e){if(c.publicKey=e.publicKey.buffer,c.certificate){var t=c.certificate.subjectPublicKeyInfo;return p.importKey("spki",t.encode(),t.algorithm,!0,["verify"])}})).then((function(e){e&&!x(e.buffer,c.publicKey)&&delete c.certificate}));if("secret"!==t.type)throw new Error("Invalid key type");i="GOST 28147/MASK/VN",delete c.certificate,delete c.publicKey,c.keyInfo.keyClass=64,c.keyInfo.keyType=24622})).then((function(){return p.generateKey(i,!0,["wrapKey","unwrapKey"])})).then((function(e){return a=e,p.wrapKey("raw",t,a,i)})).then((function(e){return(s=new Uint8Array(2*e.byteLength)).set(new Uint8Array(e)),p.exportKey("raw",a)})).then((function(e){s.set(new Uint8Array(e),e.byteLength),o=new Uint8Array(s.byteLength+12);var t={name:"GOST 28147-CFB",iv:S(8)};return o.set(new Uint8Array(t.iv),o.byteLength-8),p.encrypt(t,r,s)})).then((function(e){o.set(new Uint8Array(e));var t=c.keyInfo.encode(),n=new Uint8Array(e.byteLength+t.byteLength);return n.set(new Uint8Array(e),0),n.set(new Uint8Array(t),e.byteLength),p.sign({name:"GOST 28147-89-MAC"},r,n)})).then((function(e){return o.set(new Uint8Array(e),o.byteLength-12),c.keyPart=o.buffer,c}))},encode:function(e){var t=d.ViPNetInfo.method("encode").call(this),r=new Uint8Array(8+t.byteLength+this.keyPart.byteLength);return I(r.buffer,0,4+t.byteLength+this.keyPart.byteLength),r.set(new Uint8Array(t),4),I(r.buffer,4+t.byteLength,this.keyPart.byteLength),r.set(new Uint8Array(this.keyPart),8+t.byteLength),"PEM"===e?h.Base64.encode(r.buffer):r.buffer}}}(),{decode:function(e){"string"==typeof e&&(e=h.Base64.decode(e));var t=T(e=C(e),0);if(e.byteLength!==t+4)throw new Error("Invalid container entry size");var r=h.BER.decode(new Uint8Array(e,4,t)),n=d.ViPNetInfo.decode.call(this,r),i=r.header.byteLength+r.content.byteLength,a=T(e,4+i);if(e.byteLength!==i+a+8)throw new Error("Invalid container key part size");return n.keyPart=new Uint8Array(new Uint8Array(e,i+8,a)).buffer,n}}),R.prototype.ViPNetContainerEntry=U,w(Object,K,{getCertificate:function(e){var t=this;return new Promise(E).then((function(){var r=t.entries[e||0];if(!r)throw new Error("Entry not defined");if(r.certificate)return new g.X509(r.certificate)}))},getKey:function(e,t){return this.getPrivateKey(e,t).then((function(e){return(new _).setPrivateKey(e)}))},getPrivateKey:function(e,t){var r=this;return new Promise(E).then((function(){var n=r.entries[t||0];if(!n)throw new Error("Entry not defined");return n.getPrivateKey(e)}))},setCertificate:function(e,t){var r,n=this;return new Promise(E).then((function(){if(r=n.entries[t||0]||(n.entries[t||0]=new U),e=new g.X509(e),r.publicKey)return e.getPublicKey()})).then((function(t){if(t&&!x(r.publicKey,t.buffer))throw new Error("Invalid certificate for private key");return r.certificate=e,n}))},setKey:function(e,t,r,n){var i=this;return new _(e).getPrivateKey().then((function(e){return i.setPrivateKey(e,t,r,n)}))},setPrivateKey:function(e,t,r,n){var i=this;return new Promise(E).then((function(){return(i.entries[r||0]||(i.entries[r||0]=new U)).setPrivateKey(e,t,n)})).then((function(){return i}))},changePassword:function(e,t){var r=this;return new Promise(E).then((function(){return r.getPrivateKey(e).then((function(e){return r.setPrivateKey(e,t)}))}))},generate:function(e,t,r){var n,i,a=this;return new Promise(E).then((function(){return e instanceof g.Request||(e=new g.Request(e)),e.generate(r)})).then((function(e){return i=e,a.setKey(i,t)})).then((function(){return(n=new g.X509(e)).sign(i)})).then((function(){return a.setCertificate(n)})).then((function(){return e}))},encode:function(e){var t=[],r=0;this.entries.forEach((function(e){var n=e.encode();r+=n.byteLength,t.push(n)}));var n=this.applicationHeader?this.applicationHeader.byteLength:0,i=new Uint8Array(12+n+r);i.set(new Uint8Array(h.Chars.decode(this.fileType,"ascii"))),I(i.buffer,4,this.fileVersion),I(i.buffer,8,n),n>0&&i.set(new Uint8Array(this.applicationHeader),12);var a=12+n;return t.forEach((function(e){i.set(new Uint8Array(e),a),a+=e.byteLength})),"PEM"===e?h.Base64.encode(i.buffer):i.buffer},decode:function(e){e=this.constructor.decode(e),this.fileType=e.fileType,this.fileVersion=e.fileVersion,e.applicationHeader&&(this.applicationHeader=e.applicationHeader),this.entries=e.entries}},{encode:function(e,t){return new this(e).encode(t)},decode:function(e){"string"==typeof e&&(e=h.Base64.decode(e)),e=C(e);var t=h.Chars.encode(new Uint8Array(e,0,4),"ascii");if("ITCS"!==t&&"PKEY"!==t&&"_CCK"!==t&&"_LCK"!==t)throw new Error("Unsupported ViPNet container type");var r=T(e,4),n=r>>>16;if(0!==n&&1!==n||(65535&r)>255)throw new Error("Unsupported ViPNet container version");var i,a=T(e,8);a>0&&(i=C(new Uint8Array(e,12,a)));for(var s=12+a,o=[];s<e.byteLength;){var c=T(e,s);o.push(U.decode(new Uint8Array(e,s,c+4))),s=s+c+4}return new K({fileType:t,fileVersion:r,applicationHeader:i,entries:o})}}),R.prototype.ViPNetContainer=K,w(d.PFX,M,function(){function e(e,t,r){var n={name:"HMAC",hash:e.hash};return p.importKey("raw",k(e,t),e,!1,["deriveKey"]).then((function(t){return p.deriveKey(e,t,n,!1,["sign"])})).then((function(e){return p.sign(n,e,r)}))}function t(t,r,n,i){return e(t,r,i).then((function(e){if(!x(n,e))throw new Error("Invalid password, MAC is not verified")}))}return{sign:function(t,r){var n=this;return new Promise(E).then((function(){if(t){var i,a,s;r?s=l[r]:r=l[D.providerName].digest,s?(i=s.digest,a=s.derivation):a={name:"PFXKDF",hash:i=r,iterations:2e3},a=v(a,{salt:S(F(i)),diversifier:3});var o=n.authSafe.content;return e(a,t,o).then((function(e){return n.macData={mac:{digestAlgorithm:i,digest:e},macSalt:a.salt,iterations:a.iterations},n}))}return n}))},verify:function(e){var r,n=this,i=n.authSafe;return new Promise(E).then((function(){if("data"!==i.contentType)throw new Error("Unsupported format");if(n.macData){if(!e)throw new Error("Password must be defined for the MAC verification");r={name:"PFXKDF",hash:n.macData.mac.digestAlgorithm,salt:n.macData.macSalt,iterations:n.macData.iterations,diversifier:3};var a=n.authSafe.content,s=n.macData.mac.digest;return t(r,e,s,a).catch((function(){return r.name="PBKDF2",t(r,e,s,a)}))}})).then((function(){return n}))}}}()),R.prototype.PKCS12=M,w(Object,H,{aliases:function(){var e=[];for(var t in this.entries)e.push(t);return e},containsAlias:function(e){return!!this.entries[e]},deleteEntry:function(e){delete this.entries[e]},setEntry:function(e,t){var r={};if(t.key)try{r.key=new _(t.key,!0)}catch(e){try{r.key=new P(t.key,!0)}catch(e){if(!(t.key instanceof f))throw new Error("Unknown Key format");r.key=t.key}}if(t.certs){for(var n=t.certs instanceof Array?t.certs:[t.certs],i=0;i<n.length;i++)try{n[i]=new g.X509(n[i])}catch(e){}r.certs=n}if(t.crls){var a=t.crls instanceof Array?t.crls:[t.crls];for(i=0;i<a.length;i++)try{a[i]=new g.CRL(a[i])}catch(e){}r.crls=a}this.entries[e]=r},getEntry:function(e){return this.entries[e]},load:function(e,t){var r=this;return new Promise(E).then((function(){return(e=new M(e)).verify(t)})).then((function(){if("data"!==e.authSafe.contentType)throw new Error("Unsupported PFX format");var r=d.AuthenticatedSafe.decode(e.authSafe.content).object,n=[];return r.forEach((function(e){if("data"===e.contentType)n.push(new y.DataContentInfo(e));else{if("encryptedData"!==e.contentType)throw new Error("Unsupported PFX format");n.push(new y.EncryptedDataContentInfo(e).getEnclosed(t))}})),Promise.all(n)})).then((function(e){var r={};e.forEach((function(e){d.SafeContents.decode(e.content).object.forEach((function(e){var t=h.Hex.encode(e.bagAttributes&&e.bagAttributes.localKeyId||S(4),!0),n=r[t]||(r[t]={});switch(e.bagId){case"keyBag":n.key=new _(e.bagValue);break;case"pkcs8ShroudedKeyBag":n.key=new P(e.bagValue);break;case"secretBag":"secret"===e.bagValue.secretTypeId&&(n.key=e.bagValue.secretValue);break;case"certBag":var i=n.certs||(n.certs=[]);"x509Certificate"===e.bagValue.certId&&i.push(new g.X509(e.bagValue.certValue));break;case"crlBag":var a=n.crls||(n.crls=[]);"x509CRL"===e.bagValue.crlId&&a.push(new g.CRL(e.bagValue.crlValue))}e.bagAttributes&&e.bagAttributes.friendlyName&&(n.friendlyName=e.bagAttributes.friendlyName)}))}));var n=[];for(var i in r)n.push(function(e){return e.key instanceof P?e.key.getKey(t).then((function(t){return e.key=t,e})).catch((function(){return e})):e}(r[i]));return Promise.all(n)})).then((function(e){return e.forEach((function(e){var t=e.friendlyName;t?(delete e.friendlyName,r.entries[t]=e):r.entries[function(){for(var e=new Uint8Array(S(16)),t="",r=0;r<16;r++)t+=("00"+e[r].toString(16)).slice(-2);return t.substr(0,8)+"-"+t.substr(8,4)+"-4"+t.substr(13,3)+"-9"+t.substr(17,3)+"-"+t.substr(20,12)}()]=e})),r}))},store:function(e,t,r){var n=this,i=[],a=[],s=[];return new Promise(E).then((function(){for(var s in r=r?l[r]?l[r].pbes:r:t&&l[t]?l[t].pbes:l[D.providerName].pbes,n.entries){var o=new Uint32Array([1]),c=n.entries[s];c.key&&function(t,n){t instanceof f?a.push({bagId:"secretBag",bagValue:{secretTypeId:"secret",secretValue:t,bagAttributes:n}}):t instanceof _?r&&e?i.push((new P).setKey(t,e,r).then((function(e){return{bagId:"pkcs8ShroudedKeyBag",bagValue:e,bagAttributes:n}}))):i.push({bagId:"keyBag",bagValue:t,bagAttributes:n}):t instanceof P&&i.push({bagId:"pkcs8ShroudedKeyBag",bagValue:t,bagAttributes:n})}(c.key,{localKeyId:o,friendlyName:s}),c.certs&&c.certs.forEach((function(e){var t={localKeyId:o};e instanceof g.X509&&a.push({bagId:"certBag",bagValue:{certId:"x509Certificate",certValue:e},bagAttributes:t})})),c.crls&&c.crls.forEach((function(e){var t={localKeyId:o};e instanceof g.CRL&&a.push({bagId:"crlBag",bagValue:{crlId:"x509CRL",crlValue:e},bagAttributes:t})}))}if(i.length>0)return Promise.all(i)})).then((function(t){if(t){var n=d.SafeContents.encode(t);s.push(new y.DataContentInfo({contentType:"data",content:n}))}if(a.length>0)return a=d.SafeContents.encode(a),r&&e?(new y.EncryptedDataContentInfo).encloseContent(a,e,r):(new y.DataContentInfo).encloseContent(a)})).then((function(r){s.push(r),s=new d.AuthenticatedSafe(s);var n=new M;return n.authSafe={contentType:"data",content:s.encode()},n.sign(e,t)}))}}),R.prototype.KeyStore=H,t.gostKeysInstance=new R},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.expand=function(){for(var e={},t=0,r=arguments.length;t<r;t++){var i=arguments[t];if("object"===(void 0===i?"undefined":n(i)))for(var a in i)e[a]=i[a]}return e}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GostEngine=t.CryptoGost=void 0;var n=r(173),i=r(82);t.CryptoGost=n.gostCrypto,t.GostEngine=i.gostEngine}])},module.exports=factory()},2754:(e,t,r)=>{e.exports=r(42531)},67526:(e,t)=>{"use strict";t.byteLength=function(e){var t=o(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,a=o(e),s=a[0],c=a[1],u=new i(function(e,t,r){return 3*(t+r)/4-r}(0,s,c)),f=0,h=c>0?s-4:s;for(r=0;r<h;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],u[f++]=t>>16&255,u[f++]=t>>8&255,u[f++]=255&t;return 2===c&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,u[f++]=255&t),1===c&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,u[f++]=t>>8&255,u[f++]=255&t),u},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,a=[],s=16383,o=0,u=n-i;o<u;o+=s)a.push(c(e,o,o+s>u?u:o+s));return 1===i?(t=e[n-1],a.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],a.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),a.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0;s<64;++s)r[s]=a[s],n[a.charCodeAt(s)]=s;function o(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function c(e,t,n){for(var i,a,s=[],o=t;o<n;o+=3)i=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(255&e[o+2]),s.push(r[(a=i)>>18&63]+r[a>>12&63]+r[a>>6&63]+r[63&a]);return s.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},48287:(e,t,r)=>{"use strict";const n=r(67526),i=r(251),a="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=c,t.INSPECT_MAX_BYTES=50;const s=2147483647;function o(e){if(e>s)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,c.prototype),t}function c(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return h(e)}return u(e,t,r)}function u(e,t,r){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!c.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|g(e,t);let n=o(r);const i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(Y(e,Uint8Array)){const t=new Uint8Array(e);return d(t.buffer,t.byteOffset,t.byteLength)}return l(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(Y(e,ArrayBuffer)||e&&Y(e.buffer,ArrayBuffer))return d(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(Y(e,SharedArrayBuffer)||e&&Y(e.buffer,SharedArrayBuffer)))return d(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return c.from(n,t,r);const i=function(e){if(c.isBuffer(e)){const t=0|p(e.length),r=o(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||J(e.length)?o(0):l(e):"Buffer"===e.type&&Array.isArray(e.data)?l(e.data):void 0}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return c.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function f(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function h(e){return f(e),o(e<0?0:0|p(e))}function l(e){const t=e.length<0?0:0|p(e.length),r=o(t);for(let n=0;n<t;n+=1)r[n]=255&e[n];return r}function d(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,c.prototype),n}function p(e){if(e>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|e}function g(e,t){if(c.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||Y(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return z(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return W(e).length;default:if(i)return n?-1:z(e).length;t=(""+t).toLowerCase(),i=!0}}function y(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return k(this,t,r);case"utf8":case"utf-8":return x(this,t,r);case"ascii":return I(this,t,r);case"latin1":case"binary":return F(this,t,r);case"base64":return B(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function v(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function m(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),J(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=c.from(t,n)),c.isBuffer(t))return 0===t.length?-1:b(e,t,r,n,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):b(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function b(e,t,r,n,i){let a,s=1,o=e.length,c=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s=2,o/=2,c/=2,r/=2}function u(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){let n=-1;for(a=r;a<o;a++)if(u(e,a)===u(t,-1===n?0:a-n)){if(-1===n&&(n=a),a-n+1===c)return n*s}else-1!==n&&(a-=a-n),n=-1}else for(r+c>o&&(r=o-c),a=r;a>=0;a--){let r=!0;for(let n=0;n<c;n++)if(u(e,a+n)!==u(t,n)){r=!1;break}if(r)return a}return-1}function w(e,t,r,n){r=Number(r)||0;const i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;const a=t.length;let s;for(n>a/2&&(n=a/2),s=0;s<n;++s){const n=parseInt(t.substr(2*s,2),16);if(J(n))return s;e[r+s]=n}return s}function S(e,t,r,n){return X(z(t,e.length-r),e,r,n)}function E(e,t,r,n){return X(function(e){const t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function C(e,t,r,n){return X(W(t),e,r,n)}function A(e,t,r,n){return X(function(e,t){let r,n,i;const a=[];for(let s=0;s<e.length&&!((t-=2)<0);++s)r=e.charCodeAt(s),n=r>>8,i=r%256,a.push(i),a.push(n);return a}(t,e.length-r),e,r,n)}function B(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function x(e,t,r){r=Math.min(e.length,r);const n=[];let i=t;for(;i<r;){const t=e[i];let a=null,s=t>239?4:t>223?3:t>191?2:1;if(i+s<=r){let r,n,o,c;switch(s){case 1:t<128&&(a=t);break;case 2:r=e[i+1],128==(192&r)&&(c=(31&t)<<6|63&r,c>127&&(a=c));break;case 3:r=e[i+1],n=e[i+2],128==(192&r)&&128==(192&n)&&(c=(15&t)<<12|(63&r)<<6|63&n,c>2047&&(c<55296||c>57343)&&(a=c));break;case 4:r=e[i+1],n=e[i+2],o=e[i+3],128==(192&r)&&128==(192&n)&&128==(192&o)&&(c=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&o,c>65535&&c<1114112&&(a=c))}}null===a?(a=65533,s=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|1023&a),n.push(a),i+=s}return function(e){const t=e.length;if(t<=T)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=T));return r}(n)}c.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),c.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(c.prototype,"parent",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.buffer}}),Object.defineProperty(c.prototype,"offset",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.byteOffset}}),c.poolSize=8192,c.from=function(e,t,r){return u(e,t,r)},Object.setPrototypeOf(c.prototype,Uint8Array.prototype),Object.setPrototypeOf(c,Uint8Array),c.alloc=function(e,t,r){return function(e,t,r){return f(e),e<=0?o(e):void 0!==t?"string"==typeof r?o(e).fill(t,r):o(e).fill(t):o(e)}(e,t,r)},c.allocUnsafe=function(e){return h(e)},c.allocUnsafeSlow=function(e){return h(e)},c.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==c.prototype},c.compare=function(e,t){if(Y(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),Y(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),!c.isBuffer(e)||!c.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let i=0,a=Math.min(r,n);i<a;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},c.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return c.alloc(0);let r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;const n=c.allocUnsafe(t);let i=0;for(r=0;r<e.length;++r){let t=e[r];if(Y(t,Uint8Array))i+t.length>n.length?(c.isBuffer(t)||(t=c.from(t)),t.copy(n,i)):Uint8Array.prototype.set.call(n,t,i);else{if(!c.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(n,i)}i+=t.length}return n},c.byteLength=g,c.prototype._isBuffer=!0,c.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)v(this,t,t+1);return this},c.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)v(this,t,t+3),v(this,t+1,t+2);return this},c.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)v(this,t,t+7),v(this,t+1,t+6),v(this,t+2,t+5),v(this,t+3,t+4);return this},c.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?x(this,0,e):y.apply(this,arguments)},c.prototype.toLocaleString=c.prototype.toString,c.prototype.equals=function(e){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===c.compare(this,e)},c.prototype.inspect=function(){let e="";const r=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},a&&(c.prototype[a]=c.prototype.inspect),c.prototype.compare=function(e,t,r,n,i){if(Y(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;let a=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(t>>>=0);const o=Math.min(a,s),u=this.slice(n,i),f=e.slice(t,r);for(let e=0;e<o;++e)if(u[e]!==f[e]){a=u[e],s=f[e];break}return a<s?-1:s<a?1:0},c.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},c.prototype.indexOf=function(e,t,r){return m(this,e,t,r,!0)},c.prototype.lastIndexOf=function(e,t,r){return m(this,e,t,r,!1)},c.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let a=!1;for(;;)switch(n){case"hex":return w(this,e,t,r);case"utf8":case"utf-8":return S(this,e,t,r);case"ascii":case"latin1":case"binary":return E(this,e,t,r);case"base64":return C(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,e,t,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const T=4096;function I(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function F(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function k(e,t,r){const n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let i="";for(let n=t;n<r;++n)i+=Q[e[n]];return i}function R(e,t,r){const n=e.slice(t,r);let i="";for(let e=0;e<n.length-1;e+=2)i+=String.fromCharCode(n[e]+256*n[e+1]);return i}function D(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function _(e,t,r,n,i,a){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<a)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function P(e,t,r,n,i){j(t,n,i,e,r,7);let a=Number(t&BigInt(4294967295));e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,r}function N(e,t,r,n,i){j(t,n,i,e,r,7);let a=Number(t&BigInt(4294967295));e[r+7]=a,a>>=8,e[r+6]=a,a>>=8,e[r+5]=a,a>>=8,e[r+4]=a;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=s,s>>=8,e[r+2]=s,s>>=8,e[r+1]=s,s>>=8,e[r]=s,r+8}function O(e,t,r,n,i,a){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function L(e,t,r,n,a){return t=+t,r>>>=0,a||O(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function U(e,t,r,n,a){return t=+t,r>>>=0,a||O(e,0,r,8),i.write(e,t,r,n,52,8),r+8}c.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);const n=this.subarray(e,t);return Object.setPrototypeOf(n,c.prototype),n},c.prototype.readUintLE=c.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||D(e,t,this.length);let n=this[e],i=1,a=0;for(;++a<t&&(i*=256);)n+=this[e+a]*i;return n},c.prototype.readUintBE=c.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||D(e,t,this.length);let n=this[e+--t],i=1;for(;t>0&&(i*=256);)n+=this[e+--t]*i;return n},c.prototype.readUint8=c.prototype.readUInt8=function(e,t){return e>>>=0,t||D(e,1,this.length),this[e]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||D(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||D(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||D(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(e,t){return e>>>=0,t||D(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readBigUInt64LE=Z((function(e){V(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||G(e,this.length-8);const n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,i=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(i)<<BigInt(32))})),c.prototype.readBigUInt64BE=Z((function(e){V(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||G(e,this.length-8);const n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],i=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<<BigInt(32))+BigInt(i)})),c.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||D(e,t,this.length);let n=this[e],i=1,a=0;for(;++a<t&&(i*=256);)n+=this[e+a]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*t)),n},c.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||D(e,t,this.length);let n=t,i=1,a=this[e+--n];for(;n>0&&(i*=256);)a+=this[e+--n]*i;return i*=128,a>=i&&(a-=Math.pow(2,8*t)),a},c.prototype.readInt8=function(e,t){return e>>>=0,t||D(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||D(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(e,t){e>>>=0,t||D(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(e,t){return e>>>=0,t||D(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return e>>>=0,t||D(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readBigInt64LE=Z((function(e){V(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||G(e,this.length-8);const n=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)})),c.prototype.readBigInt64BE=Z((function(e){V(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||G(e,this.length-8);const n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+r)})),c.prototype.readFloatLE=function(e,t){return e>>>=0,t||D(e,4,this.length),i.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||D(e,4,this.length),i.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||D(e,8,this.length),i.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||D(e,8,this.length),i.read(this,e,!1,52,8)},c.prototype.writeUintLE=c.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||_(this,e,t,r,Math.pow(2,8*r)-1,0);let i=1,a=0;for(this[t]=255&e;++a<r&&(i*=256);)this[t+a]=e/i&255;return t+r},c.prototype.writeUintBE=c.prototype.writeUIntBE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||_(this,e,t,r,Math.pow(2,8*r)-1,0);let i=r-1,a=1;for(this[t+i]=255&e;--i>=0&&(a*=256);)this[t+i]=e/a&255;return t+r},c.prototype.writeUint8=c.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||_(this,e,t,1,255,0),this[t]=255&e,t+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||_(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||_(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||_(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||_(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeBigUInt64LE=Z((function(e,t=0){return P(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),c.prototype.writeBigUInt64BE=Z((function(e,t=0){return N(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),c.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);_(this,e,t,r,n-1,-n)}let i=0,a=1,s=0;for(this[t]=255&e;++i<r&&(a*=256);)e<0&&0===s&&0!==this[t+i-1]&&(s=1),this[t+i]=(e/a|0)-s&255;return t+r},c.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);_(this,e,t,r,n-1,-n)}let i=r-1,a=1,s=0;for(this[t+i]=255&e;--i>=0&&(a*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/a|0)-s&255;return t+r},c.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||_(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||_(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||_(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||_(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},c.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||_(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeBigInt64LE=Z((function(e,t=0){return P(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),c.prototype.writeBigInt64BE=Z((function(e,t=0){return N(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),c.prototype.writeFloatLE=function(e,t,r){return L(this,e,t,!0,r)},c.prototype.writeFloatBE=function(e,t,r){return L(this,e,t,!1,r)},c.prototype.writeDoubleLE=function(e,t,r){return U(this,e,t,!0,r)},c.prototype.writeDoubleBE=function(e,t,r){return U(this,e,t,!1,r)},c.prototype.copy=function(e,t,r,n){if(!c.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);const i=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),i},c.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!c.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){const t=e.charCodeAt(0);("utf8"===n&&t<128||"latin1"===n)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;let i;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{const a=c.isBuffer(e)?e:c.from(e,n),s=a.length;if(0===s)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=a[i%s]}return this};const K={};function M(e,t,r){K[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function H(e){let t="",r=e.length;const n="-"===e[0]?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function j(e,t,r,n,i,a){if(e>r||e<t){const n="bigint"==typeof t?"n":"";let i;throw i=a>3?0===t||t===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(a+1)}${n}`:`>= -(2${n} ** ${8*(a+1)-1}${n}) and < 2 ** ${8*(a+1)-1}${n}`:`>= ${t}${n} and <= ${r}${n}`,new K.ERR_OUT_OF_RANGE("value",i,e)}!function(e,t,r){V(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||G(t,e.length-(r+1))}(n,i,a)}function V(e,t){if("number"!=typeof e)throw new K.ERR_INVALID_ARG_TYPE(t,"number",e)}function G(e,t,r){if(Math.floor(e)!==e)throw V(e,r),new K.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new K.ERR_BUFFER_OUT_OF_BOUNDS;throw new K.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}M("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),M("ERR_INVALID_ARG_TYPE",(function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`}),TypeError),M("ERR_OUT_OF_RANGE",(function(e,t,r){let n=`The value of "${e}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=H(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=H(i)),i+="n"),n+=` It must be ${t}. Received ${i}`,n}),RangeError);const q=/[^+/0-9A-Za-z-_]/g;function z(e,t){let r;t=t||1/0;const n=e.length;let i=null;const a=[];for(let s=0;s<n;++s){if(r=e.charCodeAt(s),r>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&a.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function W(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(q,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function X(e,t,r,n){let i;for(i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function Y(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function J(e){return e!=e}const Q=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function Z(e){return"undefined"==typeof BigInt?$:e}function $(){throw new Error("BigInt not supported")}},40955:function(e,t,r){var n;e.exports=(n=r(19021),r(80754),r(84636),r(39506),r(57165),function(){var e=n,t=e.lib.BlockCipher,r=e.algo,i=[],a=[],s=[],o=[],c=[],u=[],f=[],h=[],l=[],d=[];!function(){for(var e=[],t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;var r=0,n=0;for(t=0;t<256;t++){var p=n^n<<1^n<<2^n<<3^n<<4;p=p>>>8^255&p^99,i[r]=p,a[p]=r;var g=e[r],y=e[g],v=e[y],m=257*e[p]^16843008*p;s[r]=m<<24|m>>>8,o[r]=m<<16|m>>>16,c[r]=m<<8|m>>>24,u[r]=m,m=16843009*v^65537*y^257*g^16843008*r,f[p]=m<<24|m>>>8,h[p]=m<<16|m>>>16,l[p]=m<<8|m>>>24,d[p]=m,r?(r=g^e[e[e[v^g]]],n^=e[e[n]]):r=n=1}}();var p=[0,1,2,4,8,16,32,64,128,27,54],g=r.AES=t.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var e=this._keyPriorReset=this._key,t=e.words,r=e.sigBytes/4,n=4*((this._nRounds=r+6)+1),a=this._keySchedule=[],s=0;s<n;s++)s<r?a[s]=t[s]:(u=a[s-1],s%r?r>6&&s%r==4&&(u=i[u>>>24]<<24|i[u>>>16&255]<<16|i[u>>>8&255]<<8|i[255&u]):(u=i[(u=u<<8|u>>>24)>>>24]<<24|i[u>>>16&255]<<16|i[u>>>8&255]<<8|i[255&u],u^=p[s/r|0]<<24),a[s]=a[s-r]^u);for(var o=this._invKeySchedule=[],c=0;c<n;c++){if(s=n-c,c%4)var u=a[s];else u=a[s-4];o[c]=c<4||s<=4?u:f[i[u>>>24]]^h[i[u>>>16&255]]^l[i[u>>>8&255]]^d[i[255&u]]}}},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,s,o,c,u,i)},decryptBlock:function(e,t){var r=e[t+1];e[t+1]=e[t+3],e[t+3]=r,this._doCryptBlock(e,t,this._invKeySchedule,f,h,l,d,a),r=e[t+1],e[t+1]=e[t+3],e[t+3]=r},_doCryptBlock:function(e,t,r,n,i,a,s,o){for(var c=this._nRounds,u=e[t]^r[0],f=e[t+1]^r[1],h=e[t+2]^r[2],l=e[t+3]^r[3],d=4,p=1;p<c;p++){var g=n[u>>>24]^i[f>>>16&255]^a[h>>>8&255]^s[255&l]^r[d++],y=n[f>>>24]^i[h>>>16&255]^a[l>>>8&255]^s[255&u]^r[d++],v=n[h>>>24]^i[l>>>16&255]^a[u>>>8&255]^s[255&f]^r[d++],m=n[l>>>24]^i[u>>>16&255]^a[f>>>8&255]^s[255&h]^r[d++];u=g,f=y,h=v,l=m}g=(o[u>>>24]<<24|o[f>>>16&255]<<16|o[h>>>8&255]<<8|o[255&l])^r[d++],y=(o[f>>>24]<<24|o[h>>>16&255]<<16|o[l>>>8&255]<<8|o[255&u])^r[d++],v=(o[h>>>24]<<24|o[l>>>16&255]<<16|o[u>>>8&255]<<8|o[255&f])^r[d++],m=(o[l>>>24]<<24|o[u>>>16&255]<<16|o[f>>>8&255]<<8|o[255&h])^r[d++],e[t]=g,e[t+1]=y,e[t+2]=v,e[t+3]=m},keySize:8});e.AES=t._createHelper(g)}(),n.AES)},43128:function(e,t,r){var n;e.exports=(n=r(19021),r(80754),r(84636),r(39506),r(57165),function(){var e=n,t=e.lib.BlockCipher,r=e.algo;const i=16,a=[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731],s=[[3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946],[1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055],[3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504],[976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462]];var o={pbox:[],sbox:[]};function c(e,t){let r=t>>24&255,n=t>>16&255,i=t>>8&255,a=255&t,s=e.sbox[0][r]+e.sbox[1][n];return s^=e.sbox[2][i],s+=e.sbox[3][a],s}function u(e,t,r){let n,a=t,s=r;for(let t=0;t<i;++t)a^=e.pbox[t],s=c(e,a)^s,n=a,a=s,s=n;return n=a,a=s,s=n,s^=e.pbox[i],a^=e.pbox[i+1],{left:a,right:s}}var f=r.Blowfish=t.extend({_doReset:function(){if(this._keyPriorReset!==this._key){var e=this._keyPriorReset=this._key,t=e.words,r=e.sigBytes/4;!function(e,t,r){for(let t=0;t<4;t++){e.sbox[t]=[];for(let r=0;r<256;r++)e.sbox[t][r]=s[t][r]}let n=0;for(let s=0;s<i+2;s++)e.pbox[s]=a[s]^t[n],n++,n>=r&&(n=0);let o=0,c=0,f=0;for(let t=0;t<i+2;t+=2)f=u(e,o,c),o=f.left,c=f.right,e.pbox[t]=o,e.pbox[t+1]=c;for(let t=0;t<4;t++)for(let r=0;r<256;r+=2)f=u(e,o,c),o=f.left,c=f.right,e.sbox[t][r]=o,e.sbox[t][r+1]=c}(o,t,r)}},encryptBlock:function(e,t){var r=u(o,e[t],e[t+1]);e[t]=r.left,e[t+1]=r.right},decryptBlock:function(e,t){var r=function(e,t,r){let n,a=t,s=r;for(let t=i+1;t>1;--t)a^=e.pbox[t],s=c(e,a)^s,n=a,a=s,s=n;return n=a,a=s,s=n,s^=e.pbox[1],a^=e.pbox[0],{left:a,right:s}}(o,e[t],e[t+1]);e[t]=r.left,e[t+1]=r.right},blockSize:2,keySize:4,ivSize:2});e.Blowfish=t._createHelper(f)}(),n.Blowfish)},57165:function(e,t,r){var n,i,a,s,o,c,u,f,h,l,d,p,g,y,v,m,b,w,S;e.exports=(n=r(19021),r(39506),void(n.lib.Cipher||(i=n,a=i.lib,s=a.Base,o=a.WordArray,c=a.BufferedBlockAlgorithm,u=i.enc,u.Utf8,f=u.Base64,h=i.algo.EvpKDF,l=a.Cipher=c.extend({cfg:s.extend(),createEncryptor:function(e,t){return this.create(this._ENC_XFORM_MODE,e,t)},createDecryptor:function(e,t){return this.create(this._DEC_XFORM_MODE,e,t)},init:function(e,t,r){this.cfg=this.cfg.extend(r),this._xformMode=e,this._key=t,this.reset()},reset:function(){c.reset.call(this),this._doReset()},process:function(e){return this._append(e),this._process()},finalize:function(e){return e&&this._append(e),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function e(e){return"string"==typeof e?S:b}return function(t){return{encrypt:function(r,n,i){return e(n).encrypt(t,r,n,i)},decrypt:function(r,n,i){return e(n).decrypt(t,r,n,i)}}}}()}),a.StreamCipher=l.extend({_doFinalize:function(){return this._process(!0)},blockSize:1}),d=i.mode={},p=a.BlockCipherMode=s.extend({createEncryptor:function(e,t){return this.Encryptor.create(e,t)},createDecryptor:function(e,t){return this.Decryptor.create(e,t)},init:function(e,t){this._cipher=e,this._iv=t}}),g=d.CBC=function(){var e=p.extend();function t(e,t,r){var n,i=this._iv;i?(n=i,this._iv=void 0):n=this._prevBlock;for(var a=0;a<r;a++)e[t+a]^=n[a]}return e.Encryptor=e.extend({processBlock:function(e,r){var n=this._cipher,i=n.blockSize;t.call(this,e,r,i),n.encryptBlock(e,r),this._prevBlock=e.slice(r,r+i)}}),e.Decryptor=e.extend({processBlock:function(e,r){var n=this._cipher,i=n.blockSize,a=e.slice(r,r+i);n.decryptBlock(e,r),t.call(this,e,r,i),this._prevBlock=a}}),e}(),y=(i.pad={}).Pkcs7={pad:function(e,t){for(var r=4*t,n=r-e.sigBytes%r,i=n<<24|n<<16|n<<8|n,a=[],s=0;s<n;s+=4)a.push(i);var c=o.create(a,n);e.concat(c)},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},a.BlockCipher=l.extend({cfg:l.cfg.extend({mode:g,padding:y}),reset:function(){var e;l.reset.call(this);var t=this.cfg,r=t.iv,n=t.mode;this._xformMode==this._ENC_XFORM_MODE?e=n.createEncryptor:(e=n.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==e?this._mode.init(this,r&&r.words):(this._mode=e.call(n,this,r&&r.words),this._mode.__creator=e)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e,t=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(t.pad(this._data,this.blockSize),e=this._process(!0)):(e=this._process(!0),t.unpad(e)),e},blockSize:4}),v=a.CipherParams=s.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}}),m=(i.format={}).OpenSSL={stringify:function(e){var t=e.ciphertext,r=e.salt;return(r?o.create([1398893684,1701076831]).concat(r).concat(t):t).toString(f)},parse:function(e){var t,r=f.parse(e),n=r.words;return 1398893684==n[0]&&1701076831==n[1]&&(t=o.create(n.slice(2,4)),n.splice(0,4),r.sigBytes-=16),v.create({ciphertext:r,salt:t})}},b=a.SerializableCipher=s.extend({cfg:s.extend({format:m}),encrypt:function(e,t,r,n){n=this.cfg.extend(n);var i=e.createEncryptor(r,n),a=i.finalize(t),s=i.cfg;return v.create({ciphertext:a,key:r,iv:s.iv,algorithm:e,mode:s.mode,padding:s.padding,blockSize:e.blockSize,formatter:n.format})},decrypt:function(e,t,r,n){return n=this.cfg.extend(n),t=this._parse(t,n.format),e.createDecryptor(r,n).finalize(t.ciphertext)},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}}),w=(i.kdf={}).OpenSSL={execute:function(e,t,r,n,i){if(n||(n=o.random(8)),i)a=h.create({keySize:t+r,hasher:i}).compute(e,n);else var a=h.create({keySize:t+r}).compute(e,n);var s=o.create(a.words.slice(t),4*r);return a.sigBytes=4*t,v.create({key:a,iv:s,salt:n})}},S=a.PasswordBasedCipher=b.extend({cfg:b.cfg.extend({kdf:w}),encrypt:function(e,t,r,n){var i=(n=this.cfg.extend(n)).kdf.execute(r,e.keySize,e.ivSize,n.salt,n.hasher);n.iv=i.iv;var a=b.encrypt.call(this,e,t,i.key,n);return a.mixIn(i),a},decrypt:function(e,t,r,n){n=this.cfg.extend(n),t=this._parse(t,n.format);var i=n.kdf.execute(r,e.keySize,e.ivSize,t.salt,n.hasher);return n.iv=i.iv,b.decrypt.call(this,e,t,i.key,n)}}))))},19021:function(e,t,r){var n;e.exports=(n=n||function(e,t){var n;if("undefined"!=typeof window&&window.crypto&&(n=window.crypto),"undefined"!=typeof self&&self.crypto&&(n=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(n=globalThis.crypto),!n&&"undefined"!=typeof window&&window.msCrypto&&(n=window.msCrypto),!n&&void 0!==r.g&&r.g.crypto&&(n=r.g.crypto),!n)try{n=r(50477)}catch(e){}var i=function(){if(n){if("function"==typeof n.getRandomValues)try{return n.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof n.randomBytes)try{return n.randomBytes(4).readInt32LE()}catch(e){}}throw new Error("Native crypto module could not be used to get secure random number.")},a=Object.create||function(){function e(){}return function(t){var r;return e.prototype=t,r=new e,e.prototype=null,r}}(),s={},o=s.lib={},c=o.Base={extend:function(e){var t=a(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},u=o.WordArray=c.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||h).stringify(this)},concat:function(e){var t=this.words,r=e.words,n=this.sigBytes,i=e.sigBytes;if(this.clamp(),n%4)for(var a=0;a<i;a++){var s=r[a>>>2]>>>24-a%4*8&255;t[n+a>>>2]|=s<<24-(n+a)%4*8}else for(var o=0;o<i;o+=4)t[n+o>>>2]=r[o>>>2];return this.sigBytes+=i,this},clamp:function(){var t=this.words,r=this.sigBytes;t[r>>>2]&=4294967295<<32-r%4*8,t.length=e.ceil(r/4)},clone:function(){var e=c.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],r=0;r<e;r+=4)t.push(i());return new u.init(t,e)}}),f=s.enc={},h=f.Hex={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i<r;i++){var a=t[i>>>2]>>>24-i%4*8&255;n.push((a>>>4).toString(16)),n.push((15&a).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n<t;n+=2)r[n>>>3]|=parseInt(e.substr(n,2),16)<<24-n%8*4;return new u.init(r,t/2)}},l=f.Latin1={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i<r;i++){var a=t[i>>>2]>>>24-i%4*8&255;n.push(String.fromCharCode(a))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n<t;n++)r[n>>>2]|=(255&e.charCodeAt(n))<<24-n%4*8;return new u.init(r,t)}},d=f.Utf8={stringify:function(e){try{return decodeURIComponent(escape(l.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return l.parse(unescape(encodeURIComponent(e)))}},p=o.BufferedBlockAlgorithm=c.extend({reset:function(){this._data=new u.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=d.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var r,n=this._data,i=n.words,a=n.sigBytes,s=this.blockSize,o=a/(4*s),c=(o=t?e.ceil(o):e.max((0|o)-this._minBufferSize,0))*s,f=e.min(4*c,a);if(c){for(var h=0;h<c;h+=s)this._doProcessBlock(i,h);r=i.splice(0,c),n.sigBytes-=f}return new u.init(r,f)},clone:function(){var e=c.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0}),g=(o.Hasher=p.extend({cfg:c.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){p.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,r){return new e.init(r).finalize(t)}},_createHmacHelper:function(e){return function(t,r){return new g.HMAC.init(e,r).finalize(t)}}}),s.algo={});return s}(Math),n)},80754:function(e,t,r){var n,i,a;e.exports=(n=r(19021),a=(i=n).lib.WordArray,i.enc.Base64={stringify:function(e){var t=e.words,r=e.sigBytes,n=this._map;e.clamp();for(var i=[],a=0;a<r;a+=3)for(var s=(t[a>>>2]>>>24-a%4*8&255)<<16|(t[a+1>>>2]>>>24-(a+1)%4*8&255)<<8|t[a+2>>>2]>>>24-(a+2)%4*8&255,o=0;o<4&&a+.75*o<r;o++)i.push(n.charAt(s>>>6*(3-o)&63));var c=n.charAt(64);if(c)for(;i.length%4;)i.push(c);return i.join("")},parse:function(e){var t=e.length,r=this._map,n=this._reverseMap;if(!n){n=this._reverseMap=[];for(var i=0;i<r.length;i++)n[r.charCodeAt(i)]=i}var s=r.charAt(64);if(s){var o=e.indexOf(s);-1!==o&&(t=o)}return function(e,t,r){for(var n=[],i=0,s=0;s<t;s++)if(s%4){var o=r[e.charCodeAt(s-1)]<<s%4*2|r[e.charCodeAt(s)]>>>6-s%4*2;n[i>>>2]|=o<<24-i%4*8,i++}return a.create(n,i)}(e,t,n)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},n.enc.Base64)},64725:function(e,t,r){var n,i,a;e.exports=(n=r(19021),a=(i=n).lib.WordArray,i.enc.Base64url={stringify:function(e,t){void 0===t&&(t=!0);var r=e.words,n=e.sigBytes,i=t?this._safe_map:this._map;e.clamp();for(var a=[],s=0;s<n;s+=3)for(var o=(r[s>>>2]>>>24-s%4*8&255)<<16|(r[s+1>>>2]>>>24-(s+1)%4*8&255)<<8|r[s+2>>>2]>>>24-(s+2)%4*8&255,c=0;c<4&&s+.75*c<n;c++)a.push(i.charAt(o>>>6*(3-c)&63));var u=i.charAt(64);if(u)for(;a.length%4;)a.push(u);return a.join("")},parse:function(e,t){void 0===t&&(t=!0);var r=e.length,n=t?this._safe_map:this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var s=0;s<n.length;s++)i[n.charCodeAt(s)]=s}var o=n.charAt(64);if(o){var c=e.indexOf(o);-1!==c&&(r=c)}return function(e,t,r){for(var n=[],i=0,s=0;s<t;s++)if(s%4){var o=r[e.charCodeAt(s-1)]<<s%4*2|r[e.charCodeAt(s)]>>>6-s%4*2;n[i>>>2]|=o<<24-i%4*8,i++}return a.create(n,i)}(e,r,i)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_safe_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"},n.enc.Base64url)},45503:function(e,t,r){var n;e.exports=(n=r(19021),function(){var e=n,t=e.lib.WordArray,r=e.enc;function i(e){return e<<8&4278255360|e>>>8&16711935}r.Utf16=r.Utf16BE={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i<r;i+=2){var a=t[i>>>2]>>>16-i%4*8&65535;n.push(String.fromCharCode(a))}return n.join("")},parse:function(e){for(var r=e.length,n=[],i=0;i<r;i++)n[i>>>1]|=e.charCodeAt(i)<<16-i%2*16;return t.create(n,2*r)}},r.Utf16LE={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],a=0;a<r;a+=2){var s=i(t[a>>>2]>>>16-a%4*8&65535);n.push(String.fromCharCode(s))}return n.join("")},parse:function(e){for(var r=e.length,n=[],a=0;a<r;a++)n[a>>>1]|=i(e.charCodeAt(a)<<16-a%2*16);return t.create(n,2*r)}}}(),n.enc.Utf16)},39506:function(e,t,r){var n,i,a,s,o,c,u,f;e.exports=(f=r(19021),r(45471),r(51025),a=(i=(n=f).lib).Base,s=i.WordArray,c=(o=n.algo).MD5,u=o.EvpKDF=a.extend({cfg:a.extend({keySize:4,hasher:c,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var r,n=this.cfg,i=n.hasher.create(),a=s.create(),o=a.words,c=n.keySize,u=n.iterations;o.length<c;){r&&i.update(r),r=i.update(e).finalize(t),i.reset();for(var f=1;f<u;f++)r=i.finalize(r),i.reset();a.concat(r)}return a.sigBytes=4*c,a}}),n.EvpKDF=function(e,t,r){return u.create(r).compute(e,t)},f.EvpKDF)},70025:function(e,t,r){var n,i,a,s;e.exports=(s=r(19021),r(57165),i=(n=s).lib.CipherParams,a=n.enc.Hex,n.format.Hex={stringify:function(e){return e.ciphertext.toString(a)},parse:function(e){var t=a.parse(e);return i.create({ciphertext:t})}},s.format.Hex)},51025:function(e,t,r){var n,i,a;e.exports=(i=(n=r(19021)).lib.Base,a=n.enc.Utf8,void(n.algo.HMAC=i.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=a.parse(t));var r=e.blockSize,n=4*r;t.sigBytes>n&&(t=e.finalize(t)),t.clamp();for(var i=this._oKey=t.clone(),s=this._iKey=t.clone(),o=i.words,c=s.words,u=0;u<r;u++)o[u]^=1549556828,c[u]^=909522486;i.sigBytes=s.sigBytes=n,this.reset()},reset:function(){var e=this._hasher;e.reset(),e.update(this._iKey)},update:function(e){return this._hasher.update(e),this},finalize:function(e){var t=this._hasher,r=t.finalize(e);return t.reset(),t.finalize(this._oKey.clone().concat(r))}})))},21396:function(e,t,r){var n;e.exports=(n=r(19021),r(43240),r(6440),r(45503),r(80754),r(64725),r(84636),r(45471),r(63009),r(36308),r(81380),r(89557),r(45953),r(78056),r(51025),r(70019),r(39506),r(57165),r(82169),r(96939),r(6372),r(73797),r(38454),r(42073),r(54905),r(10482),r(52155),r(58124),r(70025),r(40955),r(7628),r(77193),r(96298),r(22696),r(43128),n)},6440:function(e,t,r){var n;e.exports=(n=r(19021),function(){if("function"==typeof ArrayBuffer){var e=n.lib.WordArray,t=e.init,r=e.init=function(e){if(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),(e instanceof Int8Array||"undefined"!=typeof Uint8ClampedArray&&e instanceof Uint8ClampedArray||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array)&&(e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength)),e instanceof Uint8Array){for(var r=e.byteLength,n=[],i=0;i<r;i++)n[i>>>2]|=e[i]<<24-i%4*8;t.call(this,n,r)}else t.apply(this,arguments)};r.prototype=e}}(),n.lib.WordArray)},84636:function(e,t,r){var n;e.exports=(n=r(19021),function(e){var t=n,r=t.lib,i=r.WordArray,a=r.Hasher,s=t.algo,o=[];!function(){for(var t=0;t<64;t++)o[t]=4294967296*e.abs(e.sin(t+1))|0}();var c=s.MD5=a.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var r=0;r<16;r++){var n=t+r,i=e[n];e[n]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8)}var a=this._hash.words,s=e[t+0],c=e[t+1],d=e[t+2],p=e[t+3],g=e[t+4],y=e[t+5],v=e[t+6],m=e[t+7],b=e[t+8],w=e[t+9],S=e[t+10],E=e[t+11],C=e[t+12],A=e[t+13],B=e[t+14],x=e[t+15],T=a[0],I=a[1],F=a[2],k=a[3];T=u(T,I,F,k,s,7,o[0]),k=u(k,T,I,F,c,12,o[1]),F=u(F,k,T,I,d,17,o[2]),I=u(I,F,k,T,p,22,o[3]),T=u(T,I,F,k,g,7,o[4]),k=u(k,T,I,F,y,12,o[5]),F=u(F,k,T,I,v,17,o[6]),I=u(I,F,k,T,m,22,o[7]),T=u(T,I,F,k,b,7,o[8]),k=u(k,T,I,F,w,12,o[9]),F=u(F,k,T,I,S,17,o[10]),I=u(I,F,k,T,E,22,o[11]),T=u(T,I,F,k,C,7,o[12]),k=u(k,T,I,F,A,12,o[13]),F=u(F,k,T,I,B,17,o[14]),T=f(T,I=u(I,F,k,T,x,22,o[15]),F,k,c,5,o[16]),k=f(k,T,I,F,v,9,o[17]),F=f(F,k,T,I,E,14,o[18]),I=f(I,F,k,T,s,20,o[19]),T=f(T,I,F,k,y,5,o[20]),k=f(k,T,I,F,S,9,o[21]),F=f(F,k,T,I,x,14,o[22]),I=f(I,F,k,T,g,20,o[23]),T=f(T,I,F,k,w,5,o[24]),k=f(k,T,I,F,B,9,o[25]),F=f(F,k,T,I,p,14,o[26]),I=f(I,F,k,T,b,20,o[27]),T=f(T,I,F,k,A,5,o[28]),k=f(k,T,I,F,d,9,o[29]),F=f(F,k,T,I,m,14,o[30]),T=h(T,I=f(I,F,k,T,C,20,o[31]),F,k,y,4,o[32]),k=h(k,T,I,F,b,11,o[33]),F=h(F,k,T,I,E,16,o[34]),I=h(I,F,k,T,B,23,o[35]),T=h(T,I,F,k,c,4,o[36]),k=h(k,T,I,F,g,11,o[37]),F=h(F,k,T,I,m,16,o[38]),I=h(I,F,k,T,S,23,o[39]),T=h(T,I,F,k,A,4,o[40]),k=h(k,T,I,F,s,11,o[41]),F=h(F,k,T,I,p,16,o[42]),I=h(I,F,k,T,v,23,o[43]),T=h(T,I,F,k,w,4,o[44]),k=h(k,T,I,F,C,11,o[45]),F=h(F,k,T,I,x,16,o[46]),T=l(T,I=h(I,F,k,T,d,23,o[47]),F,k,s,6,o[48]),k=l(k,T,I,F,m,10,o[49]),F=l(F,k,T,I,B,15,o[50]),I=l(I,F,k,T,y,21,o[51]),T=l(T,I,F,k,C,6,o[52]),k=l(k,T,I,F,p,10,o[53]),F=l(F,k,T,I,S,15,o[54]),I=l(I,F,k,T,c,21,o[55]),T=l(T,I,F,k,b,6,o[56]),k=l(k,T,I,F,x,10,o[57]),F=l(F,k,T,I,v,15,o[58]),I=l(I,F,k,T,A,21,o[59]),T=l(T,I,F,k,g,6,o[60]),k=l(k,T,I,F,E,10,o[61]),F=l(F,k,T,I,d,15,o[62]),I=l(I,F,k,T,w,21,o[63]),a[0]=a[0]+T|0,a[1]=a[1]+I|0,a[2]=a[2]+F|0,a[3]=a[3]+k|0},_doFinalize:function(){var t=this._data,r=t.words,n=8*this._nDataBytes,i=8*t.sigBytes;r[i>>>5]|=128<<24-i%32;var a=e.floor(n/4294967296),s=n;r[15+(i+64>>>9<<4)]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),r[14+(i+64>>>9<<4)]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),t.sigBytes=4*(r.length+1),this._process();for(var o=this._hash,c=o.words,u=0;u<4;u++){var f=c[u];c[u]=16711935&(f<<8|f>>>24)|4278255360&(f<<24|f>>>8)}return o},clone:function(){var e=a.clone.call(this);return e._hash=this._hash.clone(),e}});function u(e,t,r,n,i,a,s){var o=e+(t&r|~t&n)+i+s;return(o<<a|o>>>32-a)+t}function f(e,t,r,n,i,a,s){var o=e+(t&n|r&~n)+i+s;return(o<<a|o>>>32-a)+t}function h(e,t,r,n,i,a,s){var o=e+(t^r^n)+i+s;return(o<<a|o>>>32-a)+t}function l(e,t,r,n,i,a,s){var o=e+(r^(t|~n))+i+s;return(o<<a|o>>>32-a)+t}t.MD5=a._createHelper(c),t.HmacMD5=a._createHmacHelper(c)}(Math),n.MD5)},82169:function(e,t,r){var n;e.exports=(n=r(19021),r(57165),n.mode.CFB=function(){var e=n.lib.BlockCipherMode.extend();function t(e,t,r,n){var i,a=this._iv;a?(i=a.slice(0),this._iv=void 0):i=this._prevBlock,n.encryptBlock(i,0);for(var s=0;s<r;s++)e[t+s]^=i[s]}return e.Encryptor=e.extend({processBlock:function(e,r){var n=this._cipher,i=n.blockSize;t.call(this,e,r,i,n),this._prevBlock=e.slice(r,r+i)}}),e.Decryptor=e.extend({processBlock:function(e,r){var n=this._cipher,i=n.blockSize,a=e.slice(r,r+i);t.call(this,e,r,i,n),this._prevBlock=a}}),e}(),n.mode.CFB)},6372:function(e,t,r){var n;e.exports=(n=r(19021),r(57165),n.mode.CTRGladman=function(){var e=n.lib.BlockCipherMode.extend();function t(e){if(255&~(e>>24))e+=1<<24;else{var t=e>>16&255,r=e>>8&255,n=255&e;255===t?(t=0,255===r?(r=0,255===n?n=0:++n):++r):++t,e=0,e+=t<<16,e+=r<<8,e+=n}return e}var r=e.Encryptor=e.extend({processBlock:function(e,r){var n=this._cipher,i=n.blockSize,a=this._iv,s=this._counter;a&&(s=this._counter=a.slice(0),this._iv=void 0),function(e){0===(e[0]=t(e[0]))&&(e[1]=t(e[1]))}(s);var o=s.slice(0);n.encryptBlock(o,0);for(var c=0;c<i;c++)e[r+c]^=o[c]}});return e.Decryptor=r,e}(),n.mode.CTRGladman)},96939:function(e,t,r){var n,i,a;e.exports=(a=r(19021),r(57165),a.mode.CTR=(i=(n=a.lib.BlockCipherMode.extend()).Encryptor=n.extend({processBlock:function(e,t){var r=this._cipher,n=r.blockSize,i=this._iv,a=this._counter;i&&(a=this._counter=i.slice(0),this._iv=void 0);var s=a.slice(0);r.encryptBlock(s,0),a[n-1]=a[n-1]+1|0;for(var o=0;o<n;o++)e[t+o]^=s[o]}}),n.Decryptor=i,n),a.mode.CTR)},38454:function(e,t,r){var n,i;e.exports=(i=r(19021),r(57165),i.mode.ECB=((n=i.lib.BlockCipherMode.extend()).Encryptor=n.extend({processBlock:function(e,t){this._cipher.encryptBlock(e,t)}}),n.Decryptor=n.extend({processBlock:function(e,t){this._cipher.decryptBlock(e,t)}}),n),i.mode.ECB)},73797:function(e,t,r){var n,i,a;e.exports=(a=r(19021),r(57165),a.mode.OFB=(i=(n=a.lib.BlockCipherMode.extend()).Encryptor=n.extend({processBlock:function(e,t){var r=this._cipher,n=r.blockSize,i=this._iv,a=this._keystream;i&&(a=this._keystream=i.slice(0),this._iv=void 0),r.encryptBlock(a,0);for(var s=0;s<n;s++)e[t+s]^=a[s]}}),n.Decryptor=i,n),a.mode.OFB)},42073:function(e,t,r){var n;e.exports=(n=r(19021),r(57165),n.pad.AnsiX923={pad:function(e,t){var r=e.sigBytes,n=4*t,i=n-r%n,a=r+i-1;e.clamp(),e.words[a>>>2]|=i<<24-a%4*8,e.sigBytes+=i},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},n.pad.Ansix923)},54905:function(e,t,r){var n;e.exports=(n=r(19021),r(57165),n.pad.Iso10126={pad:function(e,t){var r=4*t,i=r-e.sigBytes%r;e.concat(n.lib.WordArray.random(i-1)).concat(n.lib.WordArray.create([i<<24],1))},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},n.pad.Iso10126)},10482:function(e,t,r){var n;e.exports=(n=r(19021),r(57165),n.pad.Iso97971={pad:function(e,t){e.concat(n.lib.WordArray.create([2147483648],1)),n.pad.ZeroPadding.pad(e,t)},unpad:function(e){n.pad.ZeroPadding.unpad(e),e.sigBytes--}},n.pad.Iso97971)},58124:function(e,t,r){var n;e.exports=(n=r(19021),r(57165),n.pad.NoPadding={pad:function(){},unpad:function(){}},n.pad.NoPadding)},52155:function(e,t,r){var n;e.exports=(n=r(19021),r(57165),n.pad.ZeroPadding={pad:function(e,t){var r=4*t;e.clamp(),e.sigBytes+=r-(e.sigBytes%r||r)},unpad:function(e){var t=e.words,r=e.sigBytes-1;for(r=e.sigBytes-1;r>=0;r--)if(t[r>>>2]>>>24-r%4*8&255){e.sigBytes=r+1;break}}},n.pad.ZeroPadding)},70019:function(e,t,r){var n,i,a,s,o,c,u,f,h;e.exports=(h=r(19021),r(63009),r(51025),a=(i=(n=h).lib).Base,s=i.WordArray,c=(o=n.algo).SHA256,u=o.HMAC,f=o.PBKDF2=a.extend({cfg:a.extend({keySize:4,hasher:c,iterations:25e4}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var r=this.cfg,n=u.create(r.hasher,e),i=s.create(),a=s.create([1]),o=i.words,c=a.words,f=r.keySize,h=r.iterations;o.length<f;){var l=n.update(t).finalize(a);n.reset();for(var d=l.words,p=d.length,g=l,y=1;y<h;y++){g=n.finalize(g),n.reset();for(var v=g.words,m=0;m<p;m++)d[m]^=v[m]}i.concat(l),c[0]++}return i.sigBytes=4*f,i}}),n.PBKDF2=function(e,t,r){return f.create(r).compute(e,t)},h.PBKDF2)},22696:function(e,t,r){var n;e.exports=(n=r(19021),r(80754),r(84636),r(39506),r(57165),function(){var e=n,t=e.lib.StreamCipher,r=e.algo,i=[],a=[],s=[],o=r.RabbitLegacy=t.extend({_doReset:function(){var e=this._key.words,t=this.cfg.iv,r=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],n=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];this._b=0;for(var i=0;i<4;i++)c.call(this);for(i=0;i<8;i++)n[i]^=r[i+4&7];if(t){var a=t.words,s=a[0],o=a[1],u=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),f=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),h=u>>>16|4294901760&f,l=f<<16|65535&u;for(n[0]^=u,n[1]^=h,n[2]^=f,n[3]^=l,n[4]^=u,n[5]^=h,n[6]^=f,n[7]^=l,i=0;i<4;i++)c.call(this)}},_doProcessBlock:function(e,t){var r=this._X;c.call(this),i[0]=r[0]^r[5]>>>16^r[3]<<16,i[1]=r[2]^r[7]>>>16^r[5]<<16,i[2]=r[4]^r[1]>>>16^r[7]<<16,i[3]=r[6]^r[3]>>>16^r[1]<<16;for(var n=0;n<4;n++)i[n]=16711935&(i[n]<<8|i[n]>>>24)|4278255360&(i[n]<<24|i[n]>>>8),e[t+n]^=i[n]},blockSize:4,ivSize:2});function c(){for(var e=this._X,t=this._C,r=0;r<8;r++)a[r]=t[r];for(t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0<a[0]>>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0<a[1]>>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0<a[2]>>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0<a[3]>>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0<a[4]>>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0<a[5]>>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0<a[6]>>>0?1:0)|0,this._b=t[7]>>>0<a[7]>>>0?1:0,r=0;r<8;r++){var n=e[r]+t[r],i=65535&n,o=n>>>16,c=((i*i>>>17)+i*o>>>15)+o*o,u=((4294901760&n)*n|0)+((65535&n)*n|0);s[r]=c^u}e[0]=s[0]+(s[7]<<16|s[7]>>>16)+(s[6]<<16|s[6]>>>16)|0,e[1]=s[1]+(s[0]<<8|s[0]>>>24)+s[7]|0,e[2]=s[2]+(s[1]<<16|s[1]>>>16)+(s[0]<<16|s[0]>>>16)|0,e[3]=s[3]+(s[2]<<8|s[2]>>>24)+s[1]|0,e[4]=s[4]+(s[3]<<16|s[3]>>>16)+(s[2]<<16|s[2]>>>16)|0,e[5]=s[5]+(s[4]<<8|s[4]>>>24)+s[3]|0,e[6]=s[6]+(s[5]<<16|s[5]>>>16)+(s[4]<<16|s[4]>>>16)|0,e[7]=s[7]+(s[6]<<8|s[6]>>>24)+s[5]|0}e.RabbitLegacy=t._createHelper(o)}(),n.RabbitLegacy)},96298:function(e,t,r){var n;e.exports=(n=r(19021),r(80754),r(84636),r(39506),r(57165),function(){var e=n,t=e.lib.StreamCipher,r=e.algo,i=[],a=[],s=[],o=r.Rabbit=t.extend({_doReset:function(){for(var e=this._key.words,t=this.cfg.iv,r=0;r<4;r++)e[r]=16711935&(e[r]<<8|e[r]>>>24)|4278255360&(e[r]<<24|e[r]>>>8);var n=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],i=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];for(this._b=0,r=0;r<4;r++)c.call(this);for(r=0;r<8;r++)i[r]^=n[r+4&7];if(t){var a=t.words,s=a[0],o=a[1],u=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),f=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),h=u>>>16|4294901760&f,l=f<<16|65535&u;for(i[0]^=u,i[1]^=h,i[2]^=f,i[3]^=l,i[4]^=u,i[5]^=h,i[6]^=f,i[7]^=l,r=0;r<4;r++)c.call(this)}},_doProcessBlock:function(e,t){var r=this._X;c.call(this),i[0]=r[0]^r[5]>>>16^r[3]<<16,i[1]=r[2]^r[7]>>>16^r[5]<<16,i[2]=r[4]^r[1]>>>16^r[7]<<16,i[3]=r[6]^r[3]>>>16^r[1]<<16;for(var n=0;n<4;n++)i[n]=16711935&(i[n]<<8|i[n]>>>24)|4278255360&(i[n]<<24|i[n]>>>8),e[t+n]^=i[n]},blockSize:4,ivSize:2});function c(){for(var e=this._X,t=this._C,r=0;r<8;r++)a[r]=t[r];for(t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0<a[0]>>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0<a[1]>>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0<a[2]>>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0<a[3]>>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0<a[4]>>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0<a[5]>>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0<a[6]>>>0?1:0)|0,this._b=t[7]>>>0<a[7]>>>0?1:0,r=0;r<8;r++){var n=e[r]+t[r],i=65535&n,o=n>>>16,c=((i*i>>>17)+i*o>>>15)+o*o,u=((4294901760&n)*n|0)+((65535&n)*n|0);s[r]=c^u}e[0]=s[0]+(s[7]<<16|s[7]>>>16)+(s[6]<<16|s[6]>>>16)|0,e[1]=s[1]+(s[0]<<8|s[0]>>>24)+s[7]|0,e[2]=s[2]+(s[1]<<16|s[1]>>>16)+(s[0]<<16|s[0]>>>16)|0,e[3]=s[3]+(s[2]<<8|s[2]>>>24)+s[1]|0,e[4]=s[4]+(s[3]<<16|s[3]>>>16)+(s[2]<<16|s[2]>>>16)|0,e[5]=s[5]+(s[4]<<8|s[4]>>>24)+s[3]|0,e[6]=s[6]+(s[5]<<16|s[5]>>>16)+(s[4]<<16|s[4]>>>16)|0,e[7]=s[7]+(s[6]<<8|s[6]>>>24)+s[5]|0}e.Rabbit=t._createHelper(o)}(),n.Rabbit)},77193:function(e,t,r){var n;e.exports=(n=r(19021),r(80754),r(84636),r(39506),r(57165),function(){var e=n,t=e.lib.StreamCipher,r=e.algo,i=r.RC4=t.extend({_doReset:function(){for(var e=this._key,t=e.words,r=e.sigBytes,n=this._S=[],i=0;i<256;i++)n[i]=i;i=0;for(var a=0;i<256;i++){var s=i%r,o=t[s>>>2]>>>24-s%4*8&255;a=(a+n[i]+o)%256;var c=n[i];n[i]=n[a],n[a]=c}this._i=this._j=0},_doProcessBlock:function(e,t){e[t]^=a.call(this)},keySize:8,ivSize:0});function a(){for(var e=this._S,t=this._i,r=this._j,n=0,i=0;i<4;i++){r=(r+e[t=(t+1)%256])%256;var a=e[t];e[t]=e[r],e[r]=a,n|=e[(e[t]+e[r])%256]<<24-8*i}return this._i=t,this._j=r,n}e.RC4=t._createHelper(i);var s=r.RC4Drop=i.extend({cfg:i.cfg.extend({drop:192}),_doReset:function(){i._doReset.call(this);for(var e=this.cfg.drop;e>0;e--)a.call(this)}});e.RC4Drop=t._createHelper(s)}(),n.RC4)},78056:function(e,t,r){var n;e.exports=(n=r(19021),function(e){var t=n,r=t.lib,i=r.WordArray,a=r.Hasher,s=t.algo,o=i.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),c=i.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),u=i.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),f=i.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),h=i.create([0,1518500249,1859775393,2400959708,2840853838]),l=i.create([1352829926,1548603684,1836072691,2053994217,0]),d=s.RIPEMD160=a.extend({_doReset:function(){this._hash=i.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var r=0;r<16;r++){var n=t+r,i=e[n];e[n]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8)}var a,s,d,w,S,E,C,A,B,x,T,I=this._hash.words,F=h.words,k=l.words,R=o.words,D=c.words,_=u.words,P=f.words;for(E=a=I[0],C=s=I[1],A=d=I[2],B=w=I[3],x=S=I[4],r=0;r<80;r+=1)T=a+e[t+R[r]]|0,T+=r<16?p(s,d,w)+F[0]:r<32?g(s,d,w)+F[1]:r<48?y(s,d,w)+F[2]:r<64?v(s,d,w)+F[3]:m(s,d,w)+F[4],T=(T=b(T|=0,_[r]))+S|0,a=S,S=w,w=b(d,10),d=s,s=T,T=E+e[t+D[r]]|0,T+=r<16?m(C,A,B)+k[0]:r<32?v(C,A,B)+k[1]:r<48?y(C,A,B)+k[2]:r<64?g(C,A,B)+k[3]:p(C,A,B)+k[4],T=(T=b(T|=0,P[r]))+x|0,E=x,x=B,B=b(A,10),A=C,C=T;T=I[1]+d+B|0,I[1]=I[2]+w+x|0,I[2]=I[3]+S+E|0,I[3]=I[4]+a+C|0,I[4]=I[0]+s+A|0,I[0]=T},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;t[n>>>5]|=128<<24-n%32,t[14+(n+64>>>9<<4)]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),e.sigBytes=4*(t.length+1),this._process();for(var i=this._hash,a=i.words,s=0;s<5;s++){var o=a[s];a[s]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8)}return i},clone:function(){var e=a.clone.call(this);return e._hash=this._hash.clone(),e}});function p(e,t,r){return e^t^r}function g(e,t,r){return e&t|~e&r}function y(e,t,r){return(e|~t)^r}function v(e,t,r){return e&r|t&~r}function m(e,t,r){return e^(t|~r)}function b(e,t){return e<<t|e>>>32-t}t.RIPEMD160=a._createHelper(d),t.HmacRIPEMD160=a._createHmacHelper(d)}(Math),n.RIPEMD160)},45471:function(e,t,r){var n,i,a,s,o,c,u,f;e.exports=(i=(n=f=r(19021)).lib,a=i.WordArray,s=i.Hasher,o=n.algo,c=[],u=o.SHA1=s.extend({_doReset:function(){this._hash=new a.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],i=r[1],a=r[2],s=r[3],o=r[4],u=0;u<80;u++){if(u<16)c[u]=0|e[t+u];else{var f=c[u-3]^c[u-8]^c[u-14]^c[u-16];c[u]=f<<1|f>>>31}var h=(n<<5|n>>>27)+o+c[u];h+=u<20?1518500249+(i&a|~i&s):u<40?1859775393+(i^a^s):u<60?(i&a|i&s|a&s)-1894007588:(i^a^s)-899497514,o=s,s=a,a=i<<30|i>>>2,i=n,n=h}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+a|0,r[3]=r[3]+s|0,r[4]=r[4]+o|0},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[14+(n+64>>>9<<4)]=Math.floor(r/4294967296),t[15+(n+64>>>9<<4)]=r,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=s.clone.call(this);return e._hash=this._hash.clone(),e}}),n.SHA1=s._createHelper(u),n.HmacSHA1=s._createHmacHelper(u),f.SHA1)},36308:function(e,t,r){var n,i,a,s,o,c;e.exports=(c=r(19021),r(63009),i=(n=c).lib.WordArray,a=n.algo,s=a.SHA256,o=a.SHA224=s.extend({_doReset:function(){this._hash=new i.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var e=s._doFinalize.call(this);return e.sigBytes-=4,e}}),n.SHA224=s._createHelper(o),n.HmacSHA224=s._createHmacHelper(o),c.SHA224)},63009:function(e,t,r){var n;e.exports=(n=r(19021),function(e){var t=n,r=t.lib,i=r.WordArray,a=r.Hasher,s=t.algo,o=[],c=[];!function(){function t(t){for(var r=e.sqrt(t),n=2;n<=r;n++)if(!(t%n))return!1;return!0}function r(e){return 4294967296*(e-(0|e))|0}for(var n=2,i=0;i<64;)t(n)&&(i<8&&(o[i]=r(e.pow(n,.5))),c[i]=r(e.pow(n,1/3)),i++),n++}();var u=[],f=s.SHA256=a.extend({_doReset:function(){this._hash=new i.init(o.slice(0))},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],i=r[1],a=r[2],s=r[3],o=r[4],f=r[5],h=r[6],l=r[7],d=0;d<64;d++){if(d<16)u[d]=0|e[t+d];else{var p=u[d-15],g=(p<<25|p>>>7)^(p<<14|p>>>18)^p>>>3,y=u[d-2],v=(y<<15|y>>>17)^(y<<13|y>>>19)^y>>>10;u[d]=g+u[d-7]+v+u[d-16]}var m=n&i^n&a^i&a,b=(n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22),w=l+((o<<26|o>>>6)^(o<<21|o>>>11)^(o<<7|o>>>25))+(o&f^~o&h)+c[d]+u[d];l=h,h=f,f=o,o=s+w|0,s=a,a=i,i=n,n=w+(b+m)|0}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+a|0,r[3]=r[3]+s|0,r[4]=r[4]+o|0,r[5]=r[5]+f|0,r[6]=r[6]+h|0,r[7]=r[7]+l|0},_doFinalize:function(){var t=this._data,r=t.words,n=8*this._nDataBytes,i=8*t.sigBytes;return r[i>>>5]|=128<<24-i%32,r[14+(i+64>>>9<<4)]=e.floor(n/4294967296),r[15+(i+64>>>9<<4)]=n,t.sigBytes=4*r.length,this._process(),this._hash},clone:function(){var e=a.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA256=a._createHelper(f),t.HmacSHA256=a._createHmacHelper(f)}(Math),n.SHA256)},45953:function(e,t,r){var n;e.exports=(n=r(19021),r(43240),function(e){var t=n,r=t.lib,i=r.WordArray,a=r.Hasher,s=t.x64.Word,o=t.algo,c=[],u=[],f=[];!function(){for(var e=1,t=0,r=0;r<24;r++){c[e+5*t]=(r+1)*(r+2)/2%64;var n=(2*e+3*t)%5;e=t%5,t=n}for(e=0;e<5;e++)for(t=0;t<5;t++)u[e+5*t]=t+(2*e+3*t)%5*5;for(var i=1,a=0;a<24;a++){for(var o=0,h=0,l=0;l<7;l++){if(1&i){var d=(1<<l)-1;d<32?h^=1<<d:o^=1<<d-32}128&i?i=i<<1^113:i<<=1}f[a]=s.create(o,h)}}();var h=[];!function(){for(var e=0;e<25;e++)h[e]=s.create()}();var l=o.SHA3=a.extend({cfg:a.cfg.extend({outputLength:512}),_doReset:function(){for(var e=this._state=[],t=0;t<25;t++)e[t]=new s.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(e,t){for(var r=this._state,n=this.blockSize/2,i=0;i<n;i++){var a=e[t+2*i],s=e[t+2*i+1];a=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),s=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),(I=r[i]).high^=s,I.low^=a}for(var o=0;o<24;o++){for(var l=0;l<5;l++){for(var d=0,p=0,g=0;g<5;g++)d^=(I=r[l+5*g]).high,p^=I.low;var y=h[l];y.high=d,y.low=p}for(l=0;l<5;l++){var v=h[(l+4)%5],m=h[(l+1)%5],b=m.high,w=m.low;for(d=v.high^(b<<1|w>>>31),p=v.low^(w<<1|b>>>31),g=0;g<5;g++)(I=r[l+5*g]).high^=d,I.low^=p}for(var S=1;S<25;S++){var E=(I=r[S]).high,C=I.low,A=c[S];A<32?(d=E<<A|C>>>32-A,p=C<<A|E>>>32-A):(d=C<<A-32|E>>>64-A,p=E<<A-32|C>>>64-A);var B=h[u[S]];B.high=d,B.low=p}var x=h[0],T=r[0];for(x.high=T.high,x.low=T.low,l=0;l<5;l++)for(g=0;g<5;g++){var I=r[S=l+5*g],F=h[S],k=h[(l+1)%5+5*g],R=h[(l+2)%5+5*g];I.high=F.high^~k.high&R.high,I.low=F.low^~k.low&R.low}I=r[0];var D=f[o];I.high^=D.high,I.low^=D.low}},_doFinalize:function(){var t=this._data,r=t.words,n=(this._nDataBytes,8*t.sigBytes),a=32*this.blockSize;r[n>>>5]|=1<<24-n%32,r[(e.ceil((n+1)/a)*a>>>5)-1]|=128,t.sigBytes=4*r.length,this._process();for(var s=this._state,o=this.cfg.outputLength/8,c=o/8,u=[],f=0;f<c;f++){var h=s[f],l=h.high,d=h.low;l=16711935&(l<<8|l>>>24)|4278255360&(l<<24|l>>>8),d=16711935&(d<<8|d>>>24)|4278255360&(d<<24|d>>>8),u.push(d),u.push(l)}return new i.init(u,o)},clone:function(){for(var e=a.clone.call(this),t=e._state=this._state.slice(0),r=0;r<25;r++)t[r]=t[r].clone();return e}});t.SHA3=a._createHelper(l),t.HmacSHA3=a._createHmacHelper(l)}(Math),n.SHA3)},89557:function(e,t,r){var n,i,a,s,o,c,u,f;e.exports=(f=r(19021),r(43240),r(81380),i=(n=f).x64,a=i.Word,s=i.WordArray,o=n.algo,c=o.SHA512,u=o.SHA384=c.extend({_doReset:function(){this._hash=new s.init([new a.init(3418070365,3238371032),new a.init(1654270250,914150663),new a.init(2438529370,812702999),new a.init(355462360,4144912697),new a.init(1731405415,4290775857),new a.init(2394180231,1750603025),new a.init(3675008525,1694076839),new a.init(1203062813,3204075428)])},_doFinalize:function(){var e=c._doFinalize.call(this);return e.sigBytes-=16,e}}),n.SHA384=c._createHelper(u),n.HmacSHA384=c._createHmacHelper(u),f.SHA384)},81380:function(e,t,r){var n;e.exports=(n=r(19021),r(43240),function(){var e=n,t=e.lib.Hasher,r=e.x64,i=r.Word,a=r.WordArray,s=e.algo;function o(){return i.create.apply(i,arguments)}var c=[o(1116352408,3609767458),o(1899447441,602891725),o(3049323471,3964484399),o(3921009573,2173295548),o(961987163,4081628472),o(1508970993,3053834265),o(2453635748,2937671579),o(2870763221,3664609560),o(3624381080,2734883394),o(310598401,1164996542),o(607225278,1323610764),o(1426881987,3590304994),o(1925078388,4068182383),o(2162078206,991336113),o(2614888103,633803317),o(3248222580,3479774868),o(3835390401,2666613458),o(4022224774,944711139),o(264347078,2341262773),o(604807628,2007800933),o(770255983,1495990901),o(1249150122,1856431235),o(1555081692,3175218132),o(1996064986,2198950837),o(2554220882,3999719339),o(2821834349,766784016),o(2952996808,2566594879),o(3210313671,3203337956),o(3336571891,1034457026),o(3584528711,2466948901),o(113926993,3758326383),o(338241895,168717936),o(666307205,1188179964),o(773529912,1546045734),o(1294757372,1522805485),o(1396182291,2643833823),o(1695183700,2343527390),o(1986661051,1014477480),o(2177026350,1206759142),o(2456956037,344077627),o(2730485921,1290863460),o(2820302411,3158454273),o(3259730800,3505952657),o(3345764771,106217008),o(3516065817,3606008344),o(3600352804,1432725776),o(4094571909,1467031594),o(275423344,851169720),o(430227734,3100823752),o(506948616,1363258195),o(659060556,3750685593),o(883997877,3785050280),o(958139571,3318307427),o(1322822218,3812723403),o(1537002063,2003034995),o(1747873779,3602036899),o(1955562222,1575990012),o(2024104815,1125592928),o(2227730452,2716904306),o(2361852424,442776044),o(2428436474,593698344),o(2756734187,3733110249),o(3204031479,2999351573),o(3329325298,3815920427),o(3391569614,3928383900),o(3515267271,566280711),o(3940187606,3454069534),o(4118630271,4000239992),o(116418474,1914138554),o(174292421,2731055270),o(289380356,3203993006),o(460393269,320620315),o(685471733,587496836),o(852142971,1086792851),o(1017036298,365543100),o(1126000580,2618297676),o(1288033470,3409855158),o(1501505948,4234509866),o(1607167915,987167468),o(1816402316,1246189591)],u=[];!function(){for(var e=0;e<80;e++)u[e]=o()}();var f=s.SHA512=t.extend({_doReset:function(){this._hash=new a.init([new i.init(1779033703,4089235720),new i.init(3144134277,2227873595),new i.init(1013904242,4271175723),new i.init(2773480762,1595750129),new i.init(1359893119,2917565137),new i.init(2600822924,725511199),new i.init(528734635,4215389547),new i.init(1541459225,327033209)])},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],i=r[1],a=r[2],s=r[3],o=r[4],f=r[5],h=r[6],l=r[7],d=n.high,p=n.low,g=i.high,y=i.low,v=a.high,m=a.low,b=s.high,w=s.low,S=o.high,E=o.low,C=f.high,A=f.low,B=h.high,x=h.low,T=l.high,I=l.low,F=d,k=p,R=g,D=y,_=v,P=m,N=b,O=w,L=S,U=E,K=C,M=A,H=B,j=x,V=T,G=I,q=0;q<80;q++){var z,W,X=u[q];if(q<16)W=X.high=0|e[t+2*q],z=X.low=0|e[t+2*q+1];else{var Y=u[q-15],J=Y.high,Q=Y.low,Z=(J>>>1|Q<<31)^(J>>>8|Q<<24)^J>>>7,$=(Q>>>1|J<<31)^(Q>>>8|J<<24)^(Q>>>7|J<<25),ee=u[q-2],te=ee.high,re=ee.low,ne=(te>>>19|re<<13)^(te<<3|re>>>29)^te>>>6,ie=(re>>>19|te<<13)^(re<<3|te>>>29)^(re>>>6|te<<26),ae=u[q-7],se=ae.high,oe=ae.low,ce=u[q-16],ue=ce.high,fe=ce.low;W=(W=(W=Z+se+((z=$+oe)>>>0<$>>>0?1:0))+ne+((z+=ie)>>>0<ie>>>0?1:0))+ue+((z+=fe)>>>0<fe>>>0?1:0),X.high=W,X.low=z}var he,le=L&K^~L&H,de=U&M^~U&j,pe=F&R^F&_^R&_,ge=k&D^k&P^D&P,ye=(F>>>28|k<<4)^(F<<30|k>>>2)^(F<<25|k>>>7),ve=(k>>>28|F<<4)^(k<<30|F>>>2)^(k<<25|F>>>7),me=(L>>>14|U<<18)^(L>>>18|U<<14)^(L<<23|U>>>9),be=(U>>>14|L<<18)^(U>>>18|L<<14)^(U<<23|L>>>9),we=c[q],Se=we.high,Ee=we.low,Ce=V+me+((he=G+be)>>>0<G>>>0?1:0),Ae=ve+ge;V=H,G=j,H=K,j=M,K=L,M=U,L=N+(Ce=(Ce=(Ce=Ce+le+((he+=de)>>>0<de>>>0?1:0))+Se+((he+=Ee)>>>0<Ee>>>0?1:0))+W+((he+=z)>>>0<z>>>0?1:0))+((U=O+he|0)>>>0<O>>>0?1:0)|0,N=_,O=P,_=R,P=D,R=F,D=k,F=Ce+(ye+pe+(Ae>>>0<ve>>>0?1:0))+((k=he+Ae|0)>>>0<he>>>0?1:0)|0}p=n.low=p+k,n.high=d+F+(p>>>0<k>>>0?1:0),y=i.low=y+D,i.high=g+R+(y>>>0<D>>>0?1:0),m=a.low=m+P,a.high=v+_+(m>>>0<P>>>0?1:0),w=s.low=w+O,s.high=b+N+(w>>>0<O>>>0?1:0),E=o.low=E+U,o.high=S+L+(E>>>0<U>>>0?1:0),A=f.low=A+M,f.high=C+K+(A>>>0<M>>>0?1:0),x=h.low=x+j,h.high=B+H+(x>>>0<j>>>0?1:0),I=l.low=I+G,l.high=T+V+(I>>>0<G>>>0?1:0)},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[30+(n+128>>>10<<5)]=Math.floor(r/4294967296),t[31+(n+128>>>10<<5)]=r,e.sigBytes=4*t.length,this._process(),this._hash.toX32()},clone:function(){var e=t.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:32});e.SHA512=t._createHelper(f),e.HmacSHA512=t._createHmacHelper(f)}(),n.SHA512)},7628:function(e,t,r){var n;e.exports=(n=r(19021),r(80754),r(84636),r(39506),r(57165),function(){var e=n,t=e.lib,r=t.WordArray,i=t.BlockCipher,a=e.algo,s=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],o=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],c=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],u=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],f=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],h=a.DES=i.extend({_doReset:function(){for(var e=this._key.words,t=[],r=0;r<56;r++){var n=s[r]-1;t[r]=e[n>>>5]>>>31-n%32&1}for(var i=this._subKeys=[],a=0;a<16;a++){var u=i[a]=[],f=c[a];for(r=0;r<24;r++)u[r/6|0]|=t[(o[r]-1+f)%28]<<31-r%6,u[4+(r/6|0)]|=t[28+(o[r+24]-1+f)%28]<<31-r%6;for(u[0]=u[0]<<1|u[0]>>>31,r=1;r<7;r++)u[r]=u[r]>>>4*(r-1)+3;u[7]=u[7]<<5|u[7]>>>27}var h=this._invSubKeys=[];for(r=0;r<16;r++)h[r]=i[15-r]},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._subKeys)},decryptBlock:function(e,t){this._doCryptBlock(e,t,this._invSubKeys)},_doCryptBlock:function(e,t,r){this._lBlock=e[t],this._rBlock=e[t+1],l.call(this,4,252645135),l.call(this,16,65535),d.call(this,2,858993459),d.call(this,8,16711935),l.call(this,1,1431655765);for(var n=0;n<16;n++){for(var i=r[n],a=this._lBlock,s=this._rBlock,o=0,c=0;c<8;c++)o|=u[c][((s^i[c])&f[c])>>>0];this._lBlock=s,this._rBlock=a^o}var h=this._lBlock;this._lBlock=this._rBlock,this._rBlock=h,l.call(this,1,1431655765),d.call(this,8,16711935),d.call(this,2,858993459),l.call(this,16,65535),l.call(this,4,252645135),e[t]=this._lBlock,e[t+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});function l(e,t){var r=(this._lBlock>>>e^this._rBlock)&t;this._rBlock^=r,this._lBlock^=r<<e}function d(e,t){var r=(this._rBlock>>>e^this._lBlock)&t;this._lBlock^=r,this._rBlock^=r<<e}e.DES=i._createHelper(h);var p=a.TripleDES=i.extend({_doReset:function(){var e=this._key.words;if(2!==e.length&&4!==e.length&&e.length<6)throw new Error("Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.");var t=e.slice(0,2),n=e.length<4?e.slice(0,2):e.slice(2,4),i=e.length<6?e.slice(0,2):e.slice(4,6);this._des1=h.createEncryptor(r.create(t)),this._des2=h.createEncryptor(r.create(n)),this._des3=h.createEncryptor(r.create(i))},encryptBlock:function(e,t){this._des1.encryptBlock(e,t),this._des2.decryptBlock(e,t),this._des3.encryptBlock(e,t)},decryptBlock:function(e,t){this._des3.decryptBlock(e,t),this._des2.encryptBlock(e,t),this._des1.decryptBlock(e,t)},keySize:6,ivSize:2,blockSize:2});e.TripleDES=i._createHelper(p)}(),n.TripleDES)},43240:function(e,t,r){var n,i,a,s,o,c;e.exports=(n=r(19021),a=(i=n).lib,s=a.Base,o=a.WordArray,(c=i.x64={}).Word=s.extend({init:function(e,t){this.high=e,this.low=t}}),c.WordArray=s.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:8*e.length},toX32:function(){for(var e=this.words,t=e.length,r=[],n=0;n<t;n++){var i=e[n];r.push(i.high),r.push(i.low)}return o.create(r,this.sigBytes)},clone:function(){for(var e=s.clone.call(this),t=e.words=this.words.slice(0),r=t.length,n=0;n<r;n++)t[n]=t[n].clone();return e}}),n)},251:(e,t)=>{t.read=function(e,t,r,n,i){var a,s,o=8*i-n-1,c=(1<<o)-1,u=c>>1,f=-7,h=r?i-1:0,l=r?-1:1,d=e[t+h];for(h+=l,a=d&(1<<-f)-1,d>>=-f,f+=o;f>0;a=256*a+e[t+h],h+=l,f-=8);for(s=a&(1<<-f)-1,a>>=-f,f+=n;f>0;s=256*s+e[t+h],h+=l,f-=8);if(0===a)a=1-u;else{if(a===c)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,n),a-=u}return(d?-1:1)*s*Math.pow(2,a-n)},t.write=function(e,t,r,n,i,a){var s,o,c,u=8*a-i-1,f=(1<<u)-1,h=f>>1,l=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:a-1,p=n?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(o=isNaN(t)?1:0,s=f):(s=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-s))<1&&(s--,c*=2),(t+=s+h>=1?l/c:l*Math.pow(2,1-h))*c>=2&&(s++,c/=2),s+h>=f?(o=0,s=f):s+h>=1?(o=(t*c-1)*Math.pow(2,i),s+=h):(o=t*Math.pow(2,h-1)*Math.pow(2,i),s=0));i>=8;e[r+d]=255&o,d+=p,o/=256,i-=8);for(s=s<<i|o,u+=i;u>0;e[r+d]=255&s,d+=p,s/=256,u-=8);e[r+d-p]|=128*g}},72057:(e,t,r)=>{var n=r(28413);function i(e,t){n.cipher.registerAlgorithm(e,(function(){return new n.aes.Algorithm(e,t)}))}r(10207),r(19111),r(23564),e.exports=n.aes=n.aes||{},n.aes.startEncrypting=function(e,t,r,n){var i=g({key:e,output:r,decrypt:!1,mode:n});return i.start(t),i},n.aes.createEncryptionCipher=function(e,t){return g({key:e,output:null,decrypt:!1,mode:t})},n.aes.startDecrypting=function(e,t,r,n){var i=g({key:e,output:r,decrypt:!0,mode:n});return i.start(t),i},n.aes.createDecryptionCipher=function(e,t){return g({key:e,output:null,decrypt:!0,mode:t})},n.aes.Algorithm=function(e,t){f||l();var r=this;r.name=e,r.mode=new t({blockSize:16,cipher:{encrypt:function(e,t){return p(r._w,e,t,!1)},decrypt:function(e,t){return p(r._w,e,t,!0)}}}),r._init=!1},n.aes.Algorithm.prototype.initialize=function(e){if(!this._init){var t,r=e.key;if("string"!=typeof r||16!==r.length&&24!==r.length&&32!==r.length){if(n.util.isArray(r)&&(16===r.length||24===r.length||32===r.length)){t=r,r=n.util.createBuffer();for(var i=0;i<t.length;++i)r.putByte(t[i])}}else r=n.util.createBuffer(r);if(!n.util.isArray(r)){t=r,r=[];var a=t.length();if(16===a||24===a||32===a)for(a>>>=2,i=0;i<a;++i)r.push(t.getInt32())}if(!n.util.isArray(r)||4!==r.length&&6!==r.length&&8!==r.length)throw new Error("Invalid key parameter.");var s=this.mode.name,o=-1!==["CFB","OFB","CTR","GCM"].indexOf(s);this._w=d(r,e.decrypt&&!o),this._init=!0}},n.aes._expandKey=function(e,t){return f||l(),d(e,t)},n.aes._updateBlock=p,i("AES-ECB",n.cipher.modes.ecb),i("AES-CBC",n.cipher.modes.cbc),i("AES-CFB",n.cipher.modes.cfb),i("AES-OFB",n.cipher.modes.ofb),i("AES-CTR",n.cipher.modes.ctr),i("AES-GCM",n.cipher.modes.gcm);var a,s,o,c,u,f=!1,h=4;function l(){f=!0,o=[0,1,2,4,8,16,32,64,128,27,54];for(var e=new Array(256),t=0;t<128;++t)e[t]=t<<1,e[t+128]=t+128<<1^283;for(a=new Array(256),s=new Array(256),c=new Array(4),u=new Array(4),t=0;t<4;++t)c[t]=new Array(256),u[t]=new Array(256);var r,n,i,h,l,d,p,g=0,y=0;for(t=0;t<256;++t){h=(h=y^y<<1^y<<2^y<<3^y<<4)>>8^255&h^99,a[g]=h,s[h]=g,d=(l=e[h])<<24^h<<16^h<<8^h^l,p=((r=e[g])^(n=e[r])^(i=e[n]))<<24^(g^i)<<16^(g^n^i)<<8^g^r^i;for(var v=0;v<4;++v)c[v][g]=d,u[v][h]=p,d=d<<24|d>>>8,p=p<<24|p>>>8;0===g?g=y=1:(g=r^e[e[e[r^i]]],y^=e[e[y]])}}function d(e,t){for(var r,n=e.slice(0),i=1,s=n.length,c=h*(s+6+1),f=s;f<c;++f)r=n[f-1],f%s==0?(r=a[r>>>16&255]<<24^a[r>>>8&255]<<16^a[255&r]<<8^a[r>>>24]^o[i]<<24,i++):s>6&&f%s==4&&(r=a[r>>>24]<<24^a[r>>>16&255]<<16^a[r>>>8&255]<<8^a[255&r]),n[f]=n[f-s]^r;if(t){for(var l,d=u[0],p=u[1],g=u[2],y=u[3],v=n.slice(0),m=(f=0,(c=n.length)-h);f<c;f+=h,m-=h)if(0===f||f===c-h)v[f]=n[m],v[f+1]=n[m+3],v[f+2]=n[m+2],v[f+3]=n[m+1];else for(var b=0;b<h;++b)l=n[m+b],v[f+(3&-b)]=d[a[l>>>24]]^p[a[l>>>16&255]]^g[a[l>>>8&255]]^y[a[255&l]];n=v}return n}function p(e,t,r,n){var i,o,f,h,l,d,p,g,y,v,m,b,w=e.length/4-1;n?(i=u[0],o=u[1],f=u[2],h=u[3],l=s):(i=c[0],o=c[1],f=c[2],h=c[3],l=a),d=t[0]^e[0],p=t[n?3:1]^e[1],g=t[2]^e[2],y=t[n?1:3]^e[3];for(var S=3,E=1;E<w;++E)v=i[d>>>24]^o[p>>>16&255]^f[g>>>8&255]^h[255&y]^e[++S],m=i[p>>>24]^o[g>>>16&255]^f[y>>>8&255]^h[255&d]^e[++S],b=i[g>>>24]^o[y>>>16&255]^f[d>>>8&255]^h[255&p]^e[++S],y=i[y>>>24]^o[d>>>16&255]^f[p>>>8&255]^h[255&g]^e[++S],d=v,p=m,g=b;r[0]=l[d>>>24]<<24^l[p>>>16&255]<<16^l[g>>>8&255]<<8^l[255&y]^e[++S],r[n?3:1]=l[p>>>24]<<24^l[g>>>16&255]<<16^l[y>>>8&255]<<8^l[255&d]^e[++S],r[2]=l[g>>>24]<<24^l[y>>>16&255]<<16^l[d>>>8&255]<<8^l[255&p]^e[++S],r[n?1:3]=l[y>>>24]<<24^l[d>>>16&255]<<16^l[p>>>8&255]<<8^l[255&g]^e[++S]}function g(e){var t,r="AES-"+((e=e||{}).mode||"CBC").toUpperCase(),i=(t=e.decrypt?n.cipher.createDecipher(r,e.key):n.cipher.createCipher(r,e.key)).start;return t.start=function(e,r){var a=null;r instanceof n.util.ByteBuffer&&(a=r,r={}),(r=r||{}).output=a,r.iv=e,i.call(t,r)},t}},73115:(e,t,r)=>{var n=r(28413);r(72057),r(88415);var i=e.exports=n.tls;function a(e,t,r){var a=t.entity===n.tls.ConnectionEnd.client;e.read.cipherState={init:!1,cipher:n.cipher.createDecipher("AES-CBC",a?r.keys.server_write_key:r.keys.client_write_key),iv:a?r.keys.server_write_IV:r.keys.client_write_IV},e.write.cipherState={init:!1,cipher:n.cipher.createCipher("AES-CBC",a?r.keys.client_write_key:r.keys.server_write_key),iv:a?r.keys.client_write_IV:r.keys.server_write_IV},e.read.cipherFunction=u,e.write.cipherFunction=s,e.read.macLength=e.write.macLength=r.mac_length,e.read.macFunction=e.write.macFunction=i.hmac_sha1}function s(e,t){var r,a=!1,s=t.macFunction(t.macKey,t.sequenceNumber,e);e.fragment.putBytes(s),t.updateSequenceNumber(),r=e.version.minor===i.Versions.TLS_1_0.minor?t.cipherState.init?null:t.cipherState.iv:n.random.getBytesSync(16),t.cipherState.init=!0;var c=t.cipherState.cipher;return c.start({iv:r}),e.version.minor>=i.Versions.TLS_1_1.minor&&c.output.putBytes(r),c.update(e.fragment),c.finish(o)&&(e.fragment=c.output,e.length=e.fragment.length(),a=!0),a}function o(e,t,r){if(!r){var n=e-t.length()%e;t.fillWithByte(n-1,n)}return!0}function c(e,t,r){var n=!0;if(r){for(var i=t.length(),a=t.last(),s=i-1-a;s<i-1;++s)n=n&&t.at(s)==a;n&&t.truncate(a+1)}return n}function u(e,t){var r,a=!1;r=e.version.minor===i.Versions.TLS_1_0.minor?t.cipherState.init?null:t.cipherState.iv:e.fragment.getBytes(16),t.cipherState.init=!0;var s=t.cipherState.cipher;s.start({iv:r}),s.update(e.fragment),a=s.finish(c);var o=t.macLength,u=n.random.getBytesSync(o),f=s.output.length();f>=o?(e.fragment=s.output.getBytes(f-o),u=s.output.getBytes(o)):e.fragment=s.output.getBytes(),e.fragment=n.util.createBuffer(e.fragment),e.length=e.fragment.length();var h=t.macFunction(t.macKey,t.sequenceNumber,e);return t.updateSequenceNumber(),a=function(e,t,r){var i=n.hmac.create();return i.start("SHA1",e),i.update(t),t=i.digest().getBytes(),i.start(null,null),i.update(r),t===(r=i.digest().getBytes())}(t.macKey,u,h)&&a,a}i.CipherSuites.TLS_RSA_WITH_AES_128_CBC_SHA={id:[0,47],name:"TLS_RSA_WITH_AES_128_CBC_SHA",initSecurityParameters:function(e){e.bulk_cipher_algorithm=i.BulkCipherAlgorithm.aes,e.cipher_type=i.CipherType.block,e.enc_key_length=16,e.block_length=16,e.fixed_iv_length=16,e.record_iv_length=16,e.mac_algorithm=i.MACAlgorithm.hmac_sha1,e.mac_length=20,e.mac_key_length=20},initConnectionState:a},i.CipherSuites.TLS_RSA_WITH_AES_256_CBC_SHA={id:[0,53],name:"TLS_RSA_WITH_AES_256_CBC_SHA",initSecurityParameters:function(e){e.bulk_cipher_algorithm=i.BulkCipherAlgorithm.aes,e.cipher_type=i.CipherType.block,e.enc_key_length=32,e.block_length=16,e.fixed_iv_length=16,e.record_iv_length=16,e.mac_algorithm=i.MACAlgorithm.hmac_sha1,e.mac_length=20,e.mac_key_length=20},initConnectionState:a}},36166:(e,t,r)=>{var n=r(28413);r(25129);var i=n.asn1;t.privateKeyValidator={name:"PrivateKeyInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},t.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{tagClass:i.Class.UNIVERSAL,type:i.Type.BITSTRING,constructed:!1,composed:!0,captureBitStringValue:"ed25519PublicKey"}]}},25129:(e,t,r)=>{var n=r(28413);r(23564),r(12889);var i=e.exports=n.asn1=n.asn1||{};function a(e,t,r){if(r>t){var n=new Error("Too few bytes to parse DER.");throw n.available=e.length(),n.remaining=t,n.requested=r,n}}function s(e,t,r,n){var o;a(e,t,2);var c=e.getByte();t--;var u=192&c,f=31&c;o=e.length();var h,l,d=function(e,t){var r=e.getByte();if(t--,128!==r){var n;if(128&r){var i=127&r;a(e,t,i),n=e.getInt(i<<3)}else n=r;if(n<0)throw new Error("Negative length: "+n);return n}}(e,t);if(t-=o-e.length(),void 0!==d&&d>t){if(n.strict){var p=new Error("Too few bytes to read ASN.1 value.");throw p.available=e.length(),p.remaining=t,p.requested=d,p}d=t}var g=!(32&~c);if(g)if(h=[],void 0===d)for(;;){if(a(e,t,2),e.bytes(2)===String.fromCharCode(0,0)){e.getBytes(2),t-=2;break}o=e.length(),h.push(s(e,t,r+1,n)),t-=o-e.length()}else for(;d>0;)o=e.length(),h.push(s(e,d,r+1,n)),t-=o-e.length(),d-=o-e.length();if(void 0===h&&u===i.Class.UNIVERSAL&&f===i.Type.BITSTRING&&(l=e.bytes(d)),void 0===h&&n.decodeBitStrings&&u===i.Class.UNIVERSAL&&f===i.Type.BITSTRING&&d>1){var y=e.read,v=t,m=0;if(f===i.Type.BITSTRING&&(a(e,t,1),m=e.getByte(),t--),0===m)try{o=e.length();var b=s(e,t,r+1,{strict:!0,decodeBitStrings:!0}),w=o-e.length();t-=w,f==i.Type.BITSTRING&&w++;var S=b.tagClass;w!==d||S!==i.Class.UNIVERSAL&&S!==i.Class.CONTEXT_SPECIFIC||(h=[b])}catch(e){}void 0===h&&(e.read=y,t=v)}if(void 0===h){if(void 0===d){if(n.strict)throw new Error("Non-constructed ASN.1 object of indefinite length.");d=t}if(f===i.Type.BMPSTRING)for(h="";d>0;d-=2)a(e,t,2),h+=String.fromCharCode(e.getInt16()),t-=2;else h=e.getBytes(d),t-=d}var E=void 0===l?null:{bitStringContents:l};return i.create(u,f,g,h,E)}i.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192},i.Type={NONE:0,BOOLEAN:1,INTEGER:2,BITSTRING:3,OCTETSTRING:4,NULL:5,OID:6,ODESC:7,EXTERNAL:8,REAL:9,ENUMERATED:10,EMBEDDED:11,UTF8:12,ROID:13,SEQUENCE:16,SET:17,PRINTABLESTRING:19,IA5STRING:22,UTCTIME:23,GENERALIZEDTIME:24,BMPSTRING:30},i.create=function(e,t,r,a,s){if(n.util.isArray(a)){for(var o=[],c=0;c<a.length;++c)void 0!==a[c]&&o.push(a[c]);a=o}var u={tagClass:e,type:t,constructed:r,composed:r||n.util.isArray(a),value:a};return s&&"bitStringContents"in s&&(u.bitStringContents=s.bitStringContents,u.original=i.copy(u)),u},i.copy=function(e,t){var r;if(n.util.isArray(e)){r=[];for(var a=0;a<e.length;++a)r.push(i.copy(e[a],t));return r}return"string"==typeof e?e:(r={tagClass:e.tagClass,type:e.type,constructed:e.constructed,composed:e.composed,value:i.copy(e.value,t)},t&&!t.excludeBitStringContents&&(r.bitStringContents=e.bitStringContents),r)},i.equals=function(e,t,r){if(n.util.isArray(e)){if(!n.util.isArray(t))return!1;if(e.length!==t.length)return!1;for(var a=0;a<e.length;++a)if(!i.equals(e[a],t[a]))return!1;return!0}if(typeof e!=typeof t)return!1;if("string"==typeof e)return e===t;var s=e.tagClass===t.tagClass&&e.type===t.type&&e.constructed===t.constructed&&e.composed===t.composed&&i.equals(e.value,t.value);return r&&r.includeBitStringContents&&(s=s&&e.bitStringContents===t.bitStringContents),s},i.getBerValueLength=function(e){var t=e.getByte();if(128!==t)return 128&t?e.getInt((127&t)<<3):t},i.fromDer=function(e,t){void 0===t&&(t={strict:!0,parseAllBytes:!0,decodeBitStrings:!0}),"boolean"==typeof t&&(t={strict:t,parseAllBytes:!0,decodeBitStrings:!0}),"strict"in t||(t.strict=!0),"parseAllBytes"in t||(t.parseAllBytes=!0),"decodeBitStrings"in t||(t.decodeBitStrings=!0),"string"==typeof e&&(e=n.util.createBuffer(e));var r=e.length(),i=s(e,e.length(),0,t);if(t.parseAllBytes&&0!==e.length()){var a=new Error("Unparsed DER bytes remain after ASN.1 parsing.");throw a.byteCount=r,a.remaining=e.length(),a}return i},i.toDer=function(e){var t=n.util.createBuffer(),r=e.tagClass|e.type,a=n.util.createBuffer(),s=!1;if("bitStringContents"in e&&(s=!0,e.original&&(s=i.equals(e,e.original))),s)a.putBytes(e.bitStringContents);else if(e.composed){e.constructed?r|=32:a.putByte(0);for(var o=0;o<e.value.length;++o)void 0!==e.value[o]&&a.putBuffer(i.toDer(e.value[o]))}else if(e.type===i.Type.BMPSTRING)for(o=0;o<e.value.length;++o)a.putInt16(e.value.charCodeAt(o));else!(e.type===i.Type.INTEGER&&e.value.length>1)||(0!==e.value.charCodeAt(0)||128&e.value.charCodeAt(1))&&(255!==e.value.charCodeAt(0)||128&~e.value.charCodeAt(1))?a.putBytes(e.value):a.putBytes(e.value.substr(1));if(t.putByte(r),a.length()<=127)t.putByte(127&a.length());else{var c=a.length(),u="";do{u+=String.fromCharCode(255&c),c>>>=8}while(c>0);for(t.putByte(128|u.length),o=u.length-1;o>=0;--o)t.putByte(u.charCodeAt(o))}return t.putBuffer(a),t},i.oidToDer=function(e){var t,r,i,a,s=e.split("."),o=n.util.createBuffer();o.putByte(40*parseInt(s[0],10)+parseInt(s[1],10));for(var c=2;c<s.length;++c){t=!0,r=[],i=parseInt(s[c],10);do{a=127&i,i>>>=7,t||(a|=128),r.push(a),t=!1}while(i>0);for(var u=r.length-1;u>=0;--u)o.putByte(r[u])}return o},i.derToOid=function(e){var t;"string"==typeof e&&(e=n.util.createBuffer(e));var r=e.getByte();t=Math.floor(r/40)+"."+r%40;for(var i=0;e.length()>0;)i<<=7,128&(r=e.getByte())?i+=127&r:(t+="."+(i+r),i=0);return t},i.utcTimeToDate=function(e){var t=new Date,r=parseInt(e.substr(0,2),10);r=r>=50?1900+r:2e3+r;var n=parseInt(e.substr(2,2),10)-1,i=parseInt(e.substr(4,2),10),a=parseInt(e.substr(6,2),10),s=parseInt(e.substr(8,2),10),o=0;if(e.length>11){var c=e.charAt(10),u=10;"+"!==c&&"-"!==c&&(o=parseInt(e.substr(10,2),10),u+=2)}if(t.setUTCFullYear(r,n,i),t.setUTCHours(a,s,o,0),u&&("+"===(c=e.charAt(u))||"-"===c)){var f=60*parseInt(e.substr(u+1,2),10)+parseInt(e.substr(u+4,2),10);f*=6e4,"+"===c?t.setTime(+t-f):t.setTime(+t+f)}return t},i.generalizedTimeToDate=function(e){var t=new Date,r=parseInt(e.substr(0,4),10),n=parseInt(e.substr(4,2),10)-1,i=parseInt(e.substr(6,2),10),a=parseInt(e.substr(8,2),10),s=parseInt(e.substr(10,2),10),o=parseInt(e.substr(12,2),10),c=0,u=0,f=!1;"Z"===e.charAt(e.length-1)&&(f=!0);var h=e.length-5,l=e.charAt(h);return"+"!==l&&"-"!==l||(u=60*parseInt(e.substr(h+1,2),10)+parseInt(e.substr(h+4,2),10),u*=6e4,"+"===l&&(u*=-1),f=!0),"."===e.charAt(14)&&(c=1e3*parseFloat(e.substr(14),10)),f?(t.setUTCFullYear(r,n,i),t.setUTCHours(a,s,o,c),t.setTime(+t+u)):(t.setFullYear(r,n,i),t.setHours(a,s,o,c)),t},i.dateToUtcTime=function(e){if("string"==typeof e)return e;var t="",r=[];r.push((""+e.getUTCFullYear()).substr(2)),r.push(""+(e.getUTCMonth()+1)),r.push(""+e.getUTCDate()),r.push(""+e.getUTCHours()),r.push(""+e.getUTCMinutes()),r.push(""+e.getUTCSeconds());for(var n=0;n<r.length;++n)r[n].length<2&&(t+="0"),t+=r[n];return t+"Z"},i.dateToGeneralizedTime=function(e){if("string"==typeof e)return e;var t="",r=[];r.push(""+e.getUTCFullYear()),r.push(""+(e.getUTCMonth()+1)),r.push(""+e.getUTCDate()),r.push(""+e.getUTCHours()),r.push(""+e.getUTCMinutes()),r.push(""+e.getUTCSeconds());for(var n=0;n<r.length;++n)r[n].length<2&&(t+="0"),t+=r[n];return t+"Z"},i.integerToDer=function(e){var t=n.util.createBuffer();if(e>=-128&&e<128)return t.putSignedInt(e,8);if(e>=-32768&&e<32768)return t.putSignedInt(e,16);if(e>=-8388608&&e<8388608)return t.putSignedInt(e,24);if(e>=-2147483648&&e<2147483648)return t.putSignedInt(e,32);var r=new Error("Integer too large; max is 32-bits.");throw r.integer=e,r},i.derToInteger=function(e){"string"==typeof e&&(e=n.util.createBuffer(e));var t=8*e.length();if(t>32)throw new Error("Integer too large; max is 32-bits.");return e.getSignedInt(t)},i.validate=function(e,t,r,a){var s=!1;if(e.tagClass!==t.tagClass&&void 0!==t.tagClass||e.type!==t.type&&void 0!==t.type)a&&(e.tagClass!==t.tagClass&&a.push("["+t.name+'] Expected tag class "'+t.tagClass+'", got "'+e.tagClass+'"'),e.type!==t.type&&a.push("["+t.name+'] Expected type "'+t.type+'", got "'+e.type+'"'));else if(e.constructed===t.constructed||void 0===t.constructed){if(s=!0,t.value&&n.util.isArray(t.value))for(var o=0,c=0;s&&c<t.value.length;++c)s=t.value[c].optional||!1,e.value[o]&&((s=i.validate(e.value[o],t.value[c],r,a))?++o:t.value[c].optional&&(s=!0)),!s&&a&&a.push("["+t.name+'] Tag class "'+t.tagClass+'", type "'+t.type+'" expected value length "'+t.value.length+'", got "'+e.value.length+'"');if(s&&r&&(t.capture&&(r[t.capture]=e.value),t.captureAsn1&&(r[t.captureAsn1]=e),t.captureBitStringContents&&"bitStringContents"in e&&(r[t.captureBitStringContents]=e.bitStringContents),t.captureBitStringValue&&"bitStringContents"in e))if(e.bitStringContents.length<2)r[t.captureBitStringValue]="";else{if(0!==e.bitStringContents.charCodeAt(0))throw new Error("captureBitStringValue only supported for zero unused bits");r[t.captureBitStringValue]=e.bitStringContents.slice(1)}}else a&&a.push("["+t.name+'] Expected constructed "'+t.constructed+'", got "'+e.constructed+'"');return s};var o=/[^\\u0000-\\u00ff]/;i.prettyPrint=function(e,t,r){var a="";r=r||2,(t=t||0)>0&&(a+="\n");for(var s="",c=0;c<t*r;++c)s+=" ";switch(a+=s+"Tag: ",e.tagClass){case i.Class.UNIVERSAL:a+="Universal:";break;case i.Class.APPLICATION:a+="Application:";break;case i.Class.CONTEXT_SPECIFIC:a+="Context-Specific:";break;case i.Class.PRIVATE:a+="Private:"}if(e.tagClass===i.Class.UNIVERSAL)switch(a+=e.type,e.type){case i.Type.NONE:a+=" (None)";break;case i.Type.BOOLEAN:a+=" (Boolean)";break;case i.Type.INTEGER:a+=" (Integer)";break;case i.Type.BITSTRING:a+=" (Bit string)";break;case i.Type.OCTETSTRING:a+=" (Octet string)";break;case i.Type.NULL:a+=" (Null)";break;case i.Type.OID:a+=" (Object Identifier)";break;case i.Type.ODESC:a+=" (Object Descriptor)";break;case i.Type.EXTERNAL:a+=" (External or Instance of)";break;case i.Type.REAL:a+=" (Real)";break;case i.Type.ENUMERATED:a+=" (Enumerated)";break;case i.Type.EMBEDDED:a+=" (Embedded PDV)";break;case i.Type.UTF8:a+=" (UTF8)";break;case i.Type.ROID:a+=" (Relative Object Identifier)";break;case i.Type.SEQUENCE:a+=" (Sequence)";break;case i.Type.SET:a+=" (Set)";break;case i.Type.PRINTABLESTRING:a+=" (Printable String)";break;case i.Type.IA5String:a+=" (IA5String (ASCII))";break;case i.Type.UTCTIME:a+=" (UTC time)";break;case i.Type.GENERALIZEDTIME:a+=" (Generalized time)";break;case i.Type.BMPSTRING:a+=" (BMP String)"}else a+=e.type;if(a+="\n",a+=s+"Constructed: "+e.constructed+"\n",e.composed){var u=0,f="";for(c=0;c<e.value.length;++c)void 0!==e.value[c]&&(u+=1,f+=i.prettyPrint(e.value[c],t+1,r),c+1<e.value.length&&(f+=","));a+=s+"Sub values: "+u+f}else{if(a+=s+"Value: ",e.type===i.Type.OID){var h=i.derToOid(e.value);a+=h,n.pki&&n.pki.oids&&h in n.pki.oids&&(a+=" ("+n.pki.oids[h]+") ")}if(e.type===i.Type.INTEGER)try{a+=i.derToInteger(e.value)}catch(t){a+="0x"+n.util.bytesToHex(e.value)}else if(e.type===i.Type.BITSTRING){if(e.value.length>1?a+="0x"+n.util.bytesToHex(e.value.slice(1)):a+="(none)",e.value.length>0){var l=e.value.charCodeAt(0);1==l?a+=" (1 unused bit shown)":l>1&&(a+=" ("+l+" unused bits shown)")}}else if(e.type===i.Type.OCTETSTRING)o.test(e.value)||(a+="("+e.value+") "),a+="0x"+n.util.bytesToHex(e.value);else if(e.type===i.Type.UTF8)try{a+=n.util.decodeUtf8(e.value)}catch(t){if("URI malformed"!==t.message)throw t;a+="0x"+n.util.bytesToHex(e.value)+" (malformed UTF8)"}else e.type===i.Type.PRINTABLESTRING||e.type===i.Type.IA5String?a+=e.value:o.test(e.value)?a+="0x"+n.util.bytesToHex(e.value):0===e.value.length?a+="[null]":a+=e.value}return a}},84775:(e,t,r)=>{var n=r(42363).Buffer,i={};e.exports=i;var a={};i.encode=function(e,t,r){if("string"!=typeof t)throw new TypeError('"alphabet" must be a string.');if(void 0!==r&&"number"!=typeof r)throw new TypeError('"maxline" must be a number.');var n="";if(e instanceof Uint8Array){var i=0,a=t.length,s=t.charAt(0),o=[0];for(i=0;i<e.length;++i){for(var c=0,u=e[i];c<o.length;++c)u+=o[c]<<8,o[c]=u%a,u=u/a|0;for(;u>0;)o.push(u%a),u=u/a|0}for(i=0;0===e[i]&&i<e.length-1;++i)n+=s;for(i=o.length-1;i>=0;--i)n+=t[o[i]]}else n=function(e,t){var r=0,n=t.length,i=t.charAt(0),a=[0];for(r=0;r<e.length();++r){for(var s=0,o=e.at(r);s<a.length;++s)o+=a[s]<<8,a[s]=o%n,o=o/n|0;for(;o>0;)a.push(o%n),o=o/n|0}var c="";for(r=0;0===e.at(r)&&r<e.length()-1;++r)c+=i;for(r=a.length-1;r>=0;--r)c+=t[a[r]];return c}(e,t);if(r){var f=new RegExp(".{1,"+r+"}","g");n=n.match(f).join("\r\n")}return n},i.decode=function(e,t){if("string"!=typeof e)throw new TypeError('"input" must be a string.');if("string"!=typeof t)throw new TypeError('"alphabet" must be a string.');var r=a[t];if(!r){r=a[t]=[];for(var i=0;i<t.length;++i)r[t.charCodeAt(i)]=i}e=e.replace(/\s/g,"");var s=t.length,o=t.charAt(0),c=[0];for(i=0;i<e.length;i++){var u=r[e.charCodeAt(i)];if(void 0===u)return;for(var f=0,h=u;f<c.length;++f)h+=c[f]*s,c[f]=255&h,h>>=8;for(;h>0;)c.push(255&h),h>>=8}for(var l=0;e[l]===o&&l<e.length-1;++l)c.push(0);return void 0!==n?n.from(c.reverse()):new Uint8Array(c.reverse())}},10207:(e,t,r)=>{var n=r(28413);r(23564),e.exports=n.cipher=n.cipher||{},n.cipher.algorithms=n.cipher.algorithms||{},n.cipher.createCipher=function(e,t){var r=e;if("string"==typeof r&&(r=n.cipher.getAlgorithm(r))&&(r=r()),!r)throw new Error("Unsupported algorithm: "+e);return new n.cipher.BlockCipher({algorithm:r,key:t,decrypt:!1})},n.cipher.createDecipher=function(e,t){var r=e;if("string"==typeof r&&(r=n.cipher.getAlgorithm(r))&&(r=r()),!r)throw new Error("Unsupported algorithm: "+e);return new n.cipher.BlockCipher({algorithm:r,key:t,decrypt:!0})},n.cipher.registerAlgorithm=function(e,t){e=e.toUpperCase(),n.cipher.algorithms[e]=t},n.cipher.getAlgorithm=function(e){return(e=e.toUpperCase())in n.cipher.algorithms?n.cipher.algorithms[e]:null};var i=n.cipher.BlockCipher=function(e){this.algorithm=e.algorithm,this.mode=this.algorithm.mode,this.blockSize=this.mode.blockSize,this._finish=!1,this._input=null,this.output=null,this._op=e.decrypt?this.mode.decrypt:this.mode.encrypt,this._decrypt=e.decrypt,this.algorithm.initialize(e)};i.prototype.start=function(e){e=e||{};var t={};for(var r in e)t[r]=e[r];t.decrypt=this._decrypt,this._finish=!1,this._input=n.util.createBuffer(),this.output=e.output||n.util.createBuffer(),this.mode.start(t)},i.prototype.update=function(e){for(e&&this._input.putBuffer(e);!this._op.call(this.mode,this._input,this.output,this._finish)&&!this._finish;);this._input.compact()},i.prototype.finish=function(e){!e||"ECB"!==this.mode.name&&"CBC"!==this.mode.name||(this.mode.pad=function(t){return e(this.blockSize,t,!1)},this.mode.unpad=function(t){return e(this.blockSize,t,!0)});var t={};return t.decrypt=this._decrypt,t.overflow=this._input.length()%this.blockSize,!(!this._decrypt&&this.mode.pad&&!this.mode.pad(this._input,t)||(this._finish=!0,this.update(),this._decrypt&&this.mode.unpad&&!this.mode.unpad(this.output,t)||this.mode.afterFinish&&!this.mode.afterFinish(this.output,t)))}},19111:(e,t,r)=>{var n=r(28413);r(23564),n.cipher=n.cipher||{};var i=e.exports=n.cipher.modes=n.cipher.modes||{};function a(e,t){if("string"==typeof e&&(e=n.util.createBuffer(e)),n.util.isArray(e)&&e.length>4){var r=e;e=n.util.createBuffer();for(var i=0;i<r.length;++i)e.putByte(r[i])}if(e.length()<t)throw new Error("Invalid IV length; got "+e.length()+" bytes and expected "+t+" bytes.");if(!n.util.isArray(e)){var a=[],s=t/4;for(i=0;i<s;++i)a.push(e.getInt32());e=a}return e}function s(e){e[e.length-1]=e[e.length-1]+1&4294967295}function o(e){return[e/4294967296|0,4294967295&e]}i.ecb=function(e){e=e||{},this.name="ECB",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)},i.ecb.prototype.start=function(e){},i.ecb.prototype.encrypt=function(e,t,r){if(e.length()<this.blockSize&&!(r&&e.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=e.getInt32();for(this.cipher.encrypt(this._inBlock,this._outBlock),n=0;n<this._ints;++n)t.putInt32(this._outBlock[n])},i.ecb.prototype.decrypt=function(e,t,r){if(e.length()<this.blockSize&&!(r&&e.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=e.getInt32();for(this.cipher.decrypt(this._inBlock,this._outBlock),n=0;n<this._ints;++n)t.putInt32(this._outBlock[n])},i.ecb.prototype.pad=function(e,t){var r=e.length()===this.blockSize?this.blockSize:this.blockSize-e.length();return e.fillWithByte(r,r),!0},i.ecb.prototype.unpad=function(e,t){if(t.overflow>0)return!1;var r=e.length(),n=e.at(r-1);return!(n>this.blockSize<<2||(e.truncate(n),0))},i.cbc=function(e){e=e||{},this.name="CBC",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)},i.cbc.prototype.start=function(e){if(null===e.iv){if(!this._prev)throw new Error("Invalid IV parameter.");this._iv=this._prev.slice(0)}else{if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=a(e.iv,this.blockSize),this._prev=this._iv.slice(0)}},i.cbc.prototype.encrypt=function(e,t,r){if(e.length()<this.blockSize&&!(r&&e.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=this._prev[n]^e.getInt32();for(this.cipher.encrypt(this._inBlock,this._outBlock),n=0;n<this._ints;++n)t.putInt32(this._outBlock[n]);this._prev=this._outBlock},i.cbc.prototype.decrypt=function(e,t,r){if(e.length()<this.blockSize&&!(r&&e.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=e.getInt32();for(this.cipher.decrypt(this._inBlock,this._outBlock),n=0;n<this._ints;++n)t.putInt32(this._prev[n]^this._outBlock[n]);this._prev=this._inBlock.slice(0)},i.cbc.prototype.pad=function(e,t){var r=e.length()===this.blockSize?this.blockSize:this.blockSize-e.length();return e.fillWithByte(r,r),!0},i.cbc.prototype.unpad=function(e,t){if(t.overflow>0)return!1;var r=e.length(),n=e.at(r-1);return!(n>this.blockSize<<2||(e.truncate(n),0))},i.cfb=function(e){e=e||{},this.name="CFB",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialBlock=new Array(this._ints),this._partialOutput=n.util.createBuffer(),this._partialBytes=0},i.cfb.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=a(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},i.cfb.prototype.encrypt=function(e,t,r){var n=e.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var i=0;i<this._ints;++i)this._inBlock[i]=e.getInt32()^this._outBlock[i],t.putInt32(this._inBlock[i]);else{var a=(this.blockSize-n)%this.blockSize;for(a>0&&(a=this.blockSize-a),this._partialOutput.clear(),i=0;i<this._ints;++i)this._partialBlock[i]=e.getInt32()^this._outBlock[i],this._partialOutput.putInt32(this._partialBlock[i]);if(a>0)e.read-=this.blockSize;else for(i=0;i<this._ints;++i)this._inBlock[i]=this._partialBlock[i];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}},i.cfb.prototype.decrypt=function(e,t,r){var n=e.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var i=0;i<this._ints;++i)this._inBlock[i]=e.getInt32(),t.putInt32(this._inBlock[i]^this._outBlock[i]);else{var a=(this.blockSize-n)%this.blockSize;for(a>0&&(a=this.blockSize-a),this._partialOutput.clear(),i=0;i<this._ints;++i)this._partialBlock[i]=e.getInt32(),this._partialOutput.putInt32(this._partialBlock[i]^this._outBlock[i]);if(a>0)e.read-=this.blockSize;else for(i=0;i<this._ints;++i)this._inBlock[i]=this._partialBlock[i];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}},i.ofb=function(e){e=e||{},this.name="OFB",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=n.util.createBuffer(),this._partialBytes=0},i.ofb.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=a(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},i.ofb.prototype.encrypt=function(e,t,r){var n=e.length();if(0===e.length())return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var i=0;i<this._ints;++i)t.putInt32(e.getInt32()^this._outBlock[i]),this._inBlock[i]=this._outBlock[i];else{var a=(this.blockSize-n)%this.blockSize;for(a>0&&(a=this.blockSize-a),this._partialOutput.clear(),i=0;i<this._ints;++i)this._partialOutput.putInt32(e.getInt32()^this._outBlock[i]);if(a>0)e.read-=this.blockSize;else for(i=0;i<this._ints;++i)this._inBlock[i]=this._outBlock[i];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}},i.ofb.prototype.decrypt=i.ofb.prototype.encrypt,i.ctr=function(e){e=e||{},this.name="CTR",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=n.util.createBuffer(),this._partialBytes=0},i.ctr.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=a(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},i.ctr.prototype.encrypt=function(e,t,r){var n=e.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var i=0;i<this._ints;++i)t.putInt32(e.getInt32()^this._outBlock[i]);else{var a=(this.blockSize-n)%this.blockSize;for(a>0&&(a=this.blockSize-a),this._partialOutput.clear(),i=0;i<this._ints;++i)this._partialOutput.putInt32(e.getInt32()^this._outBlock[i]);if(a>0&&(e.read-=this.blockSize),this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}s(this._inBlock)},i.ctr.prototype.decrypt=i.ctr.prototype.encrypt,i.gcm=function(e){e=e||{},this.name="GCM",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints),this._partialOutput=n.util.createBuffer(),this._partialBytes=0,this._R=3774873600},i.gcm.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");var t,r=n.util.createBuffer(e.iv);if(this._cipherLength=0,t="additionalData"in e?n.util.createBuffer(e.additionalData):n.util.createBuffer(),this._tagLength="tagLength"in e?e.tagLength:128,this._tag=null,e.decrypt&&(this._tag=n.util.createBuffer(e.tag).getBytes(),this._tag.length!==this._tagLength/8))throw new Error("Authentication tag does not match tag length.");this._hashBlock=new Array(this._ints),this.tag=null,this._hashSubkey=new Array(this._ints),this.cipher.encrypt([0,0,0,0],this._hashSubkey),this.componentBits=4,this._m=this.generateHashTable(this._hashSubkey,this.componentBits);var i=r.length();if(12===i)this._j0=[r.getInt32(),r.getInt32(),r.getInt32(),1];else{for(this._j0=[0,0,0,0];r.length()>0;)this._j0=this.ghash(this._hashSubkey,this._j0,[r.getInt32(),r.getInt32(),r.getInt32(),r.getInt32()]);this._j0=this.ghash(this._hashSubkey,this._j0,[0,0].concat(o(8*i)))}this._inBlock=this._j0.slice(0),s(this._inBlock),this._partialBytes=0,t=n.util.createBuffer(t),this._aDataLength=o(8*t.length());var a=t.length()%this.blockSize;for(a&&t.fillWithByte(0,this.blockSize-a),this._s=[0,0,0,0];t.length()>0;)this._s=this.ghash(this._hashSubkey,this._s,[t.getInt32(),t.getInt32(),t.getInt32(),t.getInt32()])},i.gcm.prototype.encrypt=function(e,t,r){var n=e.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize){for(var i=0;i<this._ints;++i)t.putInt32(this._outBlock[i]^=e.getInt32());this._cipherLength+=this.blockSize}else{var a=(this.blockSize-n)%this.blockSize;for(a>0&&(a=this.blockSize-a),this._partialOutput.clear(),i=0;i<this._ints;++i)this._partialOutput.putInt32(e.getInt32()^this._outBlock[i]);if(a<=0||r){if(r){var o=n%this.blockSize;this._cipherLength+=o,this._partialOutput.truncate(this.blockSize-o)}else this._cipherLength+=this.blockSize;for(i=0;i<this._ints;++i)this._outBlock[i]=this._partialOutput.getInt32();this._partialOutput.read-=this.blockSize}if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return e.read-=this.blockSize,t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}this._s=this.ghash(this._hashSubkey,this._s,this._outBlock),s(this._inBlock)},i.gcm.prototype.decrypt=function(e,t,r){var n=e.length();if(n<this.blockSize&&!(r&&n>0))return!0;this.cipher.encrypt(this._inBlock,this._outBlock),s(this._inBlock),this._hashBlock[0]=e.getInt32(),this._hashBlock[1]=e.getInt32(),this._hashBlock[2]=e.getInt32(),this._hashBlock[3]=e.getInt32(),this._s=this.ghash(this._hashSubkey,this._s,this._hashBlock);for(var i=0;i<this._ints;++i)t.putInt32(this._outBlock[i]^this._hashBlock[i]);n<this.blockSize?this._cipherLength+=n%this.blockSize:this._cipherLength+=this.blockSize},i.gcm.prototype.afterFinish=function(e,t){var r=!0;t.decrypt&&t.overflow&&e.truncate(this.blockSize-t.overflow),this.tag=n.util.createBuffer();var i=this._aDataLength.concat(o(8*this._cipherLength));this._s=this.ghash(this._hashSubkey,this._s,i);var a=[];this.cipher.encrypt(this._j0,a);for(var s=0;s<this._ints;++s)this.tag.putInt32(this._s[s]^a[s]);return this.tag.truncate(this.tag.length()%(this._tagLength/8)),t.decrypt&&this.tag.bytes()!==this._tag&&(r=!1),r},i.gcm.prototype.multiply=function(e,t){for(var r=[0,0,0,0],n=t.slice(0),i=0;i<128;++i)e[i/32|0]&1<<31-i%32&&(r[0]^=n[0],r[1]^=n[1],r[2]^=n[2],r[3]^=n[3]),this.pow(n,n);return r},i.gcm.prototype.pow=function(e,t){for(var r=1&e[3],n=3;n>0;--n)t[n]=e[n]>>>1|(1&e[n-1])<<31;t[0]=e[0]>>>1,r&&(t[0]^=this._R)},i.gcm.prototype.tableMultiply=function(e){for(var t=[0,0,0,0],r=0;r<32;++r){var n=e[r/8|0]>>>4*(7-r%8)&15,i=this._m[r][n];t[0]^=i[0],t[1]^=i[1],t[2]^=i[2],t[3]^=i[3]}return t},i.gcm.prototype.ghash=function(e,t,r){return t[0]^=r[0],t[1]^=r[1],t[2]^=r[2],t[3]^=r[3],this.tableMultiply(t)},i.gcm.prototype.generateHashTable=function(e,t){for(var r=8/t,n=4*r,i=16*r,a=new Array(i),s=0;s<i;++s){var o=[0,0,0,0],c=(n-1-s%n)*t;o[s/n|0]=1<<t-1<<c,a[s]=this.generateSubHashTable(this.multiply(o,e),t)}return a},i.gcm.prototype.generateSubHashTable=function(e,t){var r=1<<t,n=r>>>1,i=new Array(r);i[n]=e.slice(0);for(var a=n>>>1;a>0;)this.pow(i[2*a],i[a]=[]),a>>=1;for(a=2;a<n;){for(var s=1;s<a;++s){var o=i[a],c=i[s];i[a+s]=[o[0]^c[0],o[1]^c[1],o[2]^c[2],o[3]^c[3]]}a*=2}for(i[0]=[0,0,0,0],a=n+1;a<r;++a){var u=i[a^n];i[a]=[e[0]^u[0],e[1]^u[1],e[2]^u[2],e[3]^u[3]]}return i}},35690:(e,t,r)=>{var n=r(28413);function i(e,t){n.cipher.registerAlgorithm(e,(function(){return new n.des.Algorithm(e,t)}))}r(10207),r(19111),r(23564),e.exports=n.des=n.des||{},n.des.startEncrypting=function(e,t,r,n){var i=p({key:e,output:r,decrypt:!1,mode:n||(null===t?"ECB":"CBC")});return i.start(t),i},n.des.createEncryptionCipher=function(e,t){return p({key:e,output:null,decrypt:!1,mode:t})},n.des.startDecrypting=function(e,t,r,n){var i=p({key:e,output:r,decrypt:!0,mode:n||(null===t?"ECB":"CBC")});return i.start(t),i},n.des.createDecryptionCipher=function(e,t){return p({key:e,output:null,decrypt:!0,mode:t})},n.des.Algorithm=function(e,t){var r=this;r.name=e,r.mode=new t({blockSize:8,cipher:{encrypt:function(e,t){return d(r._keys,e,t,!1)},decrypt:function(e,t){return d(r._keys,e,t,!0)}}}),r._init=!1},n.des.Algorithm.prototype.initialize=function(e){if(!this._init){var t=n.util.createBuffer(e.key);if(0===this.name.indexOf("3DES")&&24!==t.length())throw new Error("Invalid Triple-DES key size: "+8*t.length());this._keys=function(e){for(var t,r=[0,4,536870912,536870916,65536,65540,536936448,536936452,512,516,536871424,536871428,66048,66052,536936960,536936964],n=[0,1,1048576,1048577,67108864,67108865,68157440,68157441,256,257,1048832,1048833,67109120,67109121,68157696,68157697],i=[0,8,2048,2056,16777216,16777224,16779264,16779272,0,8,2048,2056,16777216,16777224,16779264,16779272],a=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],s=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256],o=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,33555488],c=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],u=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],f=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],h=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],l=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],d=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],p=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],g=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],y=e.length()>8?3:1,v=[],m=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],b=0,w=0;w<y;w++){var S=e.getInt32(),E=e.getInt32();S^=(t=252645135&(S>>>4^E))<<4,S^=t=65535&((E^=t)>>>-16^S),S^=(t=858993459&(S>>>2^(E^=t<<-16)))<<2,S^=t=65535&((E^=t)>>>-16^S),S^=(t=1431655765&(S>>>1^(E^=t<<-16)))<<1,S^=t=16711935&((E^=t)>>>8^S),t=(S^=(t=1431655765&(S>>>1^(E^=t<<8)))<<1)<<8|(E^=t)>>>20&240,S=E<<24|E<<8&16711680|E>>>8&65280|E>>>24&240,E=t;for(var C=0;C<m.length;++C){m[C]?(S=S<<2|S>>>26,E=E<<2|E>>>26):(S=S<<1|S>>>27,E=E<<1|E>>>27);var A=r[(S&=-15)>>>28]|n[S>>>24&15]|i[S>>>20&15]|a[S>>>16&15]|s[S>>>12&15]|o[S>>>8&15]|c[S>>>4&15],B=u[(E&=-15)>>>28]|f[E>>>24&15]|h[E>>>20&15]|l[E>>>16&15]|d[E>>>12&15]|p[E>>>8&15]|g[E>>>4&15];t=65535&(B>>>16^A),v[b++]=A^t,v[b++]=B^t<<16}}return v}(t),this._init=!0}},i("DES-ECB",n.cipher.modes.ecb),i("DES-CBC",n.cipher.modes.cbc),i("DES-CFB",n.cipher.modes.cfb),i("DES-OFB",n.cipher.modes.ofb),i("DES-CTR",n.cipher.modes.ctr),i("3DES-ECB",n.cipher.modes.ecb),i("3DES-CBC",n.cipher.modes.cbc),i("3DES-CFB",n.cipher.modes.cfb),i("3DES-OFB",n.cipher.modes.ofb),i("3DES-CTR",n.cipher.modes.ctr);var a=[16843776,0,65536,16843780,16842756,66564,4,65536,1024,16843776,16843780,1024,16778244,16842756,16777216,4,1028,16778240,16778240,66560,66560,16842752,16842752,16778244,65540,16777220,16777220,65540,0,1028,66564,16777216,65536,16843780,4,16842752,16843776,16777216,16777216,1024,16842756,65536,66560,16777220,1024,4,16778244,66564,16843780,65540,16842752,16778244,16777220,1028,66564,16843776,1028,16778240,16778240,0,65540,66560,0,16842756],s=[-2146402272,-2147450880,32768,1081376,1048576,32,-2146435040,-2147450848,-2147483616,-2146402272,-2146402304,-2147483648,-2147450880,1048576,32,-2146435040,1081344,1048608,-2147450848,0,-2147483648,32768,1081376,-2146435072,1048608,-2147483616,0,1081344,32800,-2146402304,-2146435072,32800,0,1081376,-2146435040,1048576,-2147450848,-2146435072,-2146402304,32768,-2146435072,-2147450880,32,-2146402272,1081376,32,32768,-2147483648,32800,-2146402304,1048576,-2147483616,1048608,-2147450848,-2147483616,1048608,1081344,0,-2147450880,32800,-2147483648,-2146435040,-2146402272,1081344],o=[520,134349312,0,134348808,134218240,0,131592,134218240,131080,134217736,134217736,131072,134349320,131080,134348800,520,134217728,8,134349312,512,131584,134348800,134348808,131592,134218248,131584,131072,134218248,8,134349320,512,134217728,134349312,134217728,131080,520,131072,134349312,134218240,0,512,131080,134349320,134218240,134217736,512,0,134348808,134218248,131072,134217728,134349320,8,131592,131584,134217736,134348800,134218248,520,134348800,131592,8,134348808,131584],c=[8396801,8321,8321,128,8396928,8388737,8388609,8193,0,8396800,8396800,8396929,129,0,8388736,8388609,1,8192,8388608,8396801,128,8388608,8193,8320,8388737,1,8320,8388736,8192,8396928,8396929,129,8388736,8388609,8396800,8396929,129,0,0,8396800,8320,8388736,8388737,1,8396801,8321,8321,128,8396929,129,1,8192,8388609,8193,8396928,8388737,8193,8320,8388608,8396801,128,8388608,8192,8396928],u=[256,34078976,34078720,1107296512,524288,256,1073741824,34078720,1074266368,524288,33554688,1074266368,1107296512,1107820544,524544,1073741824,33554432,1074266112,1074266112,0,1073742080,1107820800,1107820800,33554688,1107820544,1073742080,0,1107296256,34078976,33554432,1107296256,524544,524288,1107296512,256,33554432,1073741824,34078720,1107296512,1074266368,33554688,1073741824,1107820544,34078976,1074266368,256,33554432,1107820544,1107820800,524544,1107296256,1107820800,34078720,0,1074266112,1107296256,524544,33554688,1073742080,524288,0,1074266112,34078976,1073742080],f=[536870928,541065216,16384,541081616,541065216,16,541081616,4194304,536887296,4210704,4194304,536870928,4194320,536887296,536870912,16400,0,4194320,536887312,16384,4210688,536887312,16,541065232,541065232,0,4210704,541081600,16400,4210688,541081600,536870912,536887296,16,541065232,4210688,541081616,4194304,16400,536870928,4194304,536887296,536870912,16400,536870928,541081616,4210688,541065216,4210704,541081600,0,541065232,16,16384,541065216,4210704,16384,4194320,536887312,0,541081600,536870912,4194320,536887312],h=[2097152,69206018,67110914,0,2048,67110914,2099202,69208064,69208066,2097152,0,67108866,2,67108864,69206018,2050,67110912,2099202,2097154,67110912,67108866,69206016,69208064,2097154,69206016,2048,2050,69208066,2099200,2,67108864,2099200,67108864,2099200,2097152,67110914,67110914,69206018,69206018,2,2097154,67108864,67110912,2097152,69208064,2050,2099202,69208064,2050,67108866,69208066,69206016,2099200,0,2,69208066,0,2099202,69206016,2048,67108866,67110912,2048,2097154],l=[268439616,4096,262144,268701760,268435456,268439616,64,268435456,262208,268697600,268701760,266240,268701696,266304,4096,64,268697600,268435520,268439552,4160,266240,262208,268697664,268701696,4160,0,0,268697664,268435520,268439552,266304,262144,266304,262144,268701696,4096,64,268697664,4096,266304,268439552,64,268435520,268697600,268697664,268435456,262144,268439616,0,268701760,262208,268435520,268697600,268439552,268439616,0,268701760,266240,266240,4160,4160,262208,268435456,268701696];function d(e,t,r,n){var i,d,p=32===e.length?3:9;i=3===p?n?[30,-2,-2]:[0,32,2]:n?[94,62,-2,32,64,2,30,-2,-2]:[0,32,2,62,30,-2,64,96,2];var g=t[0],y=t[1];g^=(d=252645135&(g>>>4^y))<<4,g^=(d=65535&(g>>>16^(y^=d)))<<16,g^=d=858993459&((y^=d)>>>2^g),g^=d=16711935&((y^=d<<2)>>>8^g),g=(g^=(d=1431655765&(g>>>1^(y^=d<<8)))<<1)<<1|g>>>31,y=(y^=d)<<1|y>>>31;for(var v=0;v<p;v+=3){for(var m=i[v+1],b=i[v+2],w=i[v];w!=m;w+=b){var S=y^e[w],E=(y>>>4|y<<28)^e[w+1];d=g,g=y,y=d^(s[S>>>24&63]|c[S>>>16&63]|f[S>>>8&63]|l[63&S]|a[E>>>24&63]|o[E>>>16&63]|u[E>>>8&63]|h[63&E])}d=g,g=y,y=d}y=y>>>1|y<<31,y^=d=1431655765&((g=g>>>1|g<<31)>>>1^y),y^=(d=16711935&(y>>>8^(g^=d<<1)))<<8,y^=(d=858993459&(y>>>2^(g^=d)))<<2,y^=d=65535&((g^=d)>>>16^y),y^=d=252645135&((g^=d<<16)>>>4^y),g^=d<<4,r[0]=g,r[1]=y}function p(e){var t,r="DES-"+((e=e||{}).mode||"CBC").toUpperCase(),i=(t=e.decrypt?n.cipher.createDecipher(r,e.key):n.cipher.createCipher(r,e.key)).start;return t.start=function(e,r){var a=null;r instanceof n.util.ByteBuffer&&(a=r,r={}),(r=r||{}).output=a,r.iv=e,i.call(t,r)},t}},7931:(e,t,r)=>{var n=r(42363).Buffer,i=r(28413);r(29127),r(93851),r(39194),r(23564);var a=r(36166),s=a.publicKeyValidator,o=a.privateKeyValidator;if(void 0===c)var c=i.jsbn.BigInteger;var u=i.util.ByteBuffer,f=void 0===n?Uint8Array:n;i.pki=i.pki||{},e.exports=i.pki.ed25519=i.ed25519=i.ed25519||{};var h=i.ed25519;function l(e){var t=e.message;if(t instanceof Uint8Array||t instanceof f)return t;var r=e.encoding;if(void 0===t){if(!e.md)throw new TypeError('"options.message" or "options.md" not specified.');t=e.md.digest().getBytes(),r="binary"}if("string"==typeof t&&!r)throw new TypeError('"options.encoding" must be "binary" or "utf8".');if("string"==typeof t){if(void 0!==n)return n.from(t,r);t=new u(t,r)}else if(!(t instanceof u))throw new TypeError('"options.message" must be a node.js Buffer, a Uint8Array, a forge ByteBuffer, or a string with "options.encoding" specifying its encoding.');for(var i=new f(t.length()),a=0;a<i.length;++a)i[a]=t.at(a);return i}h.constants={},h.constants.PUBLIC_KEY_BYTE_LENGTH=32,h.constants.PRIVATE_KEY_BYTE_LENGTH=64,h.constants.SEED_BYTE_LENGTH=32,h.constants.SIGN_BYTE_LENGTH=64,h.constants.HASH_BYTE_LENGTH=64,h.generateKeyPair=function(e){var t=(e=e||{}).seed;if(void 0===t)t=i.random.getBytesSync(h.constants.SEED_BYTE_LENGTH);else if("string"==typeof t){if(t.length!==h.constants.SEED_BYTE_LENGTH)throw new TypeError('"seed" must be '+h.constants.SEED_BYTE_LENGTH+" bytes in length.")}else if(!(t instanceof Uint8Array))throw new TypeError('"seed" must be a node.js Buffer, Uint8Array, or a binary string.');t=l({message:t,encoding:"binary"});for(var r=new f(h.constants.PUBLIC_KEY_BYTE_LENGTH),n=new f(h.constants.PRIVATE_KEY_BYTE_LENGTH),a=0;a<32;++a)n[a]=t[a];return function(e,t){var r,n=[O(),O(),O(),O()],i=S(t,32);for(i[0]&=248,i[31]&=127,i[31]|=64,D(n,i),x(e,n),r=0;r<32;++r)t[r+32]=e[r]}(r,n),{publicKey:r,privateKey:n}},h.privateKeyFromAsn1=function(e){var t={},r=[];if(!i.asn1.validate(e,o,t,r)){var n=new Error("Invalid Key.");throw n.errors=r,n}var a=i.asn1.derToOid(t.privateKeyOid),s=i.oids.EdDSA25519;if(a!==s)throw new Error('Invalid OID "'+a+'"; OID must be "'+s+'".');var c=t.privateKey;return{privateKeyBytes:l({message:i.asn1.fromDer(c).value,encoding:"binary"})}},h.publicKeyFromAsn1=function(e){var t={},r=[];if(!i.asn1.validate(e,s,t,r)){var n=new Error("Invalid Key.");throw n.errors=r,n}var a=i.asn1.derToOid(t.publicKeyOid),o=i.oids.EdDSA25519;if(a!==o)throw new Error('Invalid OID "'+a+'"; OID must be "'+o+'".');var c=t.ed25519PublicKey;if(c.length!==h.constants.PUBLIC_KEY_BYTE_LENGTH)throw new Error("Key length is invalid.");return l({message:c,encoding:"binary"})},h.publicKeyFromPrivateKey=function(e){var t=l({message:(e=e||{}).privateKey,encoding:"binary"});if(t.length!==h.constants.PRIVATE_KEY_BYTE_LENGTH)throw new TypeError('"options.privateKey" must have a byte length of '+h.constants.PRIVATE_KEY_BYTE_LENGTH);for(var r=new f(h.constants.PUBLIC_KEY_BYTE_LENGTH),n=0;n<r.length;++n)r[n]=t[32+n];return r},h.sign=function(e){var t=l(e=e||{}),r=l({message:e.privateKey,encoding:"binary"});if(r.length===h.constants.SEED_BYTE_LENGTH)r=h.generateKeyPair({seed:r}).privateKey;else if(r.length!==h.constants.PRIVATE_KEY_BYTE_LENGTH)throw new TypeError('"options.privateKey" must have a byte length of '+h.constants.SEED_BYTE_LENGTH+" or "+h.constants.PRIVATE_KEY_BYTE_LENGTH);var n=new f(h.constants.SIGN_BYTE_LENGTH+t.length);!function(e,t,r,n){var i,a,s=new Float64Array(64),o=[O(),O(),O(),O()],c=S(n,32);c[0]&=248,c[31]&=127,c[31]|=64;for(i=0;i<r;++i)e[64+i]=t[i];for(i=0;i<32;++i)e[32+i]=c[32+i];var u=S(e.subarray(32),r+32);for(C(u),D(o,u),x(e,o),i=32;i<64;++i)e[i]=n[i];var f=S(e,r+64);for(C(f),i=32;i<64;++i)s[i]=0;for(i=0;i<32;++i)s[i]=u[i];for(i=0;i<32;++i)for(a=0;a<32;a++)s[i+a]+=f[i]*c[a];E(e.subarray(32),s)}(n,t,t.length,r);for(var i=new f(h.constants.SIGN_BYTE_LENGTH),a=0;a<i.length;++a)i[a]=n[a];return i},h.verify=function(e){var t=l(e=e||{});if(void 0===e.signature)throw new TypeError('"options.signature" must be a node.js Buffer, a Uint8Array, a forge ByteBuffer, or a binary string.');var r=l({message:e.signature,encoding:"binary"});if(r.length!==h.constants.SIGN_BYTE_LENGTH)throw new TypeError('"options.signature" must have a byte length of '+h.constants.SIGN_BYTE_LENGTH);var n=l({message:e.publicKey,encoding:"binary"});if(n.length!==h.constants.PUBLIC_KEY_BYTE_LENGTH)throw new TypeError('"options.publicKey" must have a byte length of '+h.constants.PUBLIC_KEY_BYTE_LENGTH);var i,a=new f(h.constants.SIGN_BYTE_LENGTH+t.length),s=new f(h.constants.SIGN_BYTE_LENGTH+t.length);for(i=0;i<h.constants.SIGN_BYTE_LENGTH;++i)a[i]=r[i];for(i=0;i<t.length;++i)a[i+h.constants.SIGN_BYTE_LENGTH]=t[i];return function(e,t,r,n){var i,a=new f(32),s=[O(),O(),O(),O()],o=[O(),O(),O(),O()];if(r<64)return-1;if(function(e,t){var r=O(),n=O(),i=O(),a=O(),s=O(),o=O(),c=O();return _(e[2],p),function(e,t){var r;for(r=0;r<16;++r)e[r]=t[2*r]+(t[2*r+1]<<8);e[15]&=32767}(e[1],t),K(i,e[1]),M(a,i,g),U(i,i,e[2]),L(a,e[2],a),K(s,a),K(o,s),M(c,o,s),M(r,c,i),M(r,r,a),function(e,t){var r,n=O();for(r=0;r<16;++r)n[r]=t[r];for(r=250;r>=0;--r)K(n,n),1!==r&&M(n,n,t);for(r=0;r<16;++r)e[r]=n[r]}(r,r),M(r,r,i),M(r,r,a),M(r,r,a),M(e[0],r,a),K(n,e[0]),M(n,n,a),I(n,i)&&M(e[0],e[0],w),K(n,e[0]),M(n,n,a),I(n,i)?-1:(k(e[0])===t[31]>>7&&U(e[0],d,e[0]),M(e[3],e[0],e[1]),0)}(o,n))return-1;for(i=0;i<r;++i)e[i]=t[i];for(i=0;i<32;++i)e[i+32]=n[i];var c=S(e,r);if(C(c),R(s,o,c),D(o,t.subarray(32)),A(s,o),x(a,s),r-=64,F(t,0,a,0)){for(i=0;i<r;++i)e[i]=0;return-1}for(i=0;i<r;++i)e[i]=t[i+64];return r}(s,a,a.length,n)>=0};var d=O(),p=O([1]),g=O([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),y=O([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),v=O([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),m=O([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),b=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]),w=O([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function S(e,t){var r=i.md.sha512.create(),a=new u(e);r.update(a.getBytes(t),"binary");var s=r.digest().getBytes();if(void 0!==n)return n.from(s,"binary");for(var o=new f(h.constants.HASH_BYTE_LENGTH),c=0;c<64;++c)o[c]=s.charCodeAt(c);return o}function E(e,t){var r,n,i,a;for(n=63;n>=32;--n){for(r=0,i=n-32,a=n-12;i<a;++i)t[i]+=r-16*t[n]*b[i-(n-32)],r=t[i]+128>>8,t[i]-=256*r;t[i]+=r,t[n]=0}for(r=0,i=0;i<32;++i)t[i]+=r-(t[31]>>4)*b[i],r=t[i]>>8,t[i]&=255;for(i=0;i<32;++i)t[i]-=r*b[i];for(n=0;n<32;++n)t[n+1]+=t[n]>>8,e[n]=255&t[n]}function C(e){for(var t=new Float64Array(64),r=0;r<64;++r)t[r]=e[r],e[r]=0;E(e,t)}function A(e,t){var r=O(),n=O(),i=O(),a=O(),s=O(),o=O(),c=O(),u=O(),f=O();U(r,e[1],e[0]),U(f,t[1],t[0]),M(r,r,f),L(n,e[0],e[1]),L(f,t[0],t[1]),M(n,n,f),M(i,e[3],t[3]),M(i,i,y),M(a,e[2],t[2]),L(a,a,a),U(s,n,r),U(o,a,i),L(c,a,i),L(u,n,r),M(e[0],s,o),M(e[1],u,c),M(e[2],c,o),M(e[3],s,u)}function B(e,t,r){for(var n=0;n<4;++n)N(e[n],t[n],r)}function x(e,t){var r=O(),n=O(),i=O();!function(e,t){var r,n=O();for(r=0;r<16;++r)n[r]=t[r];for(r=253;r>=0;--r)K(n,n),2!==r&&4!==r&&M(n,n,t);for(r=0;r<16;++r)e[r]=n[r]}(i,t[2]),M(r,t[0],i),M(n,t[1],i),T(e,n),e[31]^=k(r)<<7}function T(e,t){var r,n,i,a=O(),s=O();for(r=0;r<16;++r)s[r]=t[r];for(P(s),P(s),P(s),n=0;n<2;++n){for(a[0]=s[0]-65517,r=1;r<15;++r)a[r]=s[r]-65535-(a[r-1]>>16&1),a[r-1]&=65535;a[15]=s[15]-32767-(a[14]>>16&1),i=a[15]>>16&1,a[14]&=65535,N(s,a,1-i)}for(r=0;r<16;r++)e[2*r]=255&s[r],e[2*r+1]=s[r]>>8}function I(e,t){var r=new f(32),n=new f(32);return T(r,e),T(n,t),F(r,0,n,0)}function F(e,t,r,n){return function(e,t,r,n,i){var a,s=0;for(a=0;a<32;++a)s|=e[t+a]^r[n+a];return(1&s-1>>>8)-1}(e,t,r,n)}function k(e){var t=new f(32);return T(t,e),1&t[0]}function R(e,t,r){var n,i;for(_(e[0],d),_(e[1],p),_(e[2],p),_(e[3],d),i=255;i>=0;--i)B(e,t,n=r[i/8|0]>>(7&i)&1),A(t,e),A(e,e),B(e,t,n)}function D(e,t){var r=[O(),O(),O(),O()];_(r[0],v),_(r[1],m),_(r[2],p),M(r[3],v,m),R(e,r,t)}function _(e,t){var r;for(r=0;r<16;r++)e[r]=0|t[r]}function P(e){var t,r,n=1;for(t=0;t<16;++t)r=e[t]+n+65535,n=Math.floor(r/65536),e[t]=r-65536*n;e[0]+=n-1+37*(n-1)}function N(e,t,r){for(var n,i=~(r-1),a=0;a<16;++a)n=i&(e[a]^t[a]),e[a]^=n,t[a]^=n}function O(e){var t,r=new Float64Array(16);if(e)for(t=0;t<e.length;++t)r[t]=e[t];return r}function L(e,t,r){for(var n=0;n<16;++n)e[n]=t[n]+r[n]}function U(e,t,r){for(var n=0;n<16;++n)e[n]=t[n]-r[n]}function K(e,t){M(e,t,t)}function M(e,t,r){var n,i,a=0,s=0,o=0,c=0,u=0,f=0,h=0,l=0,d=0,p=0,g=0,y=0,v=0,m=0,b=0,w=0,S=0,E=0,C=0,A=0,B=0,x=0,T=0,I=0,F=0,k=0,R=0,D=0,_=0,P=0,N=0,O=r[0],L=r[1],U=r[2],K=r[3],M=r[4],H=r[5],j=r[6],V=r[7],G=r[8],q=r[9],z=r[10],W=r[11],X=r[12],Y=r[13],J=r[14],Q=r[15];a+=(n=t[0])*O,s+=n*L,o+=n*U,c+=n*K,u+=n*M,f+=n*H,h+=n*j,l+=n*V,d+=n*G,p+=n*q,g+=n*z,y+=n*W,v+=n*X,m+=n*Y,b+=n*J,w+=n*Q,s+=(n=t[1])*O,o+=n*L,c+=n*U,u+=n*K,f+=n*M,h+=n*H,l+=n*j,d+=n*V,p+=n*G,g+=n*q,y+=n*z,v+=n*W,m+=n*X,b+=n*Y,w+=n*J,S+=n*Q,o+=(n=t[2])*O,c+=n*L,u+=n*U,f+=n*K,h+=n*M,l+=n*H,d+=n*j,p+=n*V,g+=n*G,y+=n*q,v+=n*z,m+=n*W,b+=n*X,w+=n*Y,S+=n*J,E+=n*Q,c+=(n=t[3])*O,u+=n*L,f+=n*U,h+=n*K,l+=n*M,d+=n*H,p+=n*j,g+=n*V,y+=n*G,v+=n*q,m+=n*z,b+=n*W,w+=n*X,S+=n*Y,E+=n*J,C+=n*Q,u+=(n=t[4])*O,f+=n*L,h+=n*U,l+=n*K,d+=n*M,p+=n*H,g+=n*j,y+=n*V,v+=n*G,m+=n*q,b+=n*z,w+=n*W,S+=n*X,E+=n*Y,C+=n*J,A+=n*Q,f+=(n=t[5])*O,h+=n*L,l+=n*U,d+=n*K,p+=n*M,g+=n*H,y+=n*j,v+=n*V,m+=n*G,b+=n*q,w+=n*z,S+=n*W,E+=n*X,C+=n*Y,A+=n*J,B+=n*Q,h+=(n=t[6])*O,l+=n*L,d+=n*U,p+=n*K,g+=n*M,y+=n*H,v+=n*j,m+=n*V,b+=n*G,w+=n*q,S+=n*z,E+=n*W,C+=n*X,A+=n*Y,B+=n*J,x+=n*Q,l+=(n=t[7])*O,d+=n*L,p+=n*U,g+=n*K,y+=n*M,v+=n*H,m+=n*j,b+=n*V,w+=n*G,S+=n*q,E+=n*z,C+=n*W,A+=n*X,B+=n*Y,x+=n*J,T+=n*Q,d+=(n=t[8])*O,p+=n*L,g+=n*U,y+=n*K,v+=n*M,m+=n*H,b+=n*j,w+=n*V,S+=n*G,E+=n*q,C+=n*z,A+=n*W,B+=n*X,x+=n*Y,T+=n*J,I+=n*Q,p+=(n=t[9])*O,g+=n*L,y+=n*U,v+=n*K,m+=n*M,b+=n*H,w+=n*j,S+=n*V,E+=n*G,C+=n*q,A+=n*z,B+=n*W,x+=n*X,T+=n*Y,I+=n*J,F+=n*Q,g+=(n=t[10])*O,y+=n*L,v+=n*U,m+=n*K,b+=n*M,w+=n*H,S+=n*j,E+=n*V,C+=n*G,A+=n*q,B+=n*z,x+=n*W,T+=n*X,I+=n*Y,F+=n*J,k+=n*Q,y+=(n=t[11])*O,v+=n*L,m+=n*U,b+=n*K,w+=n*M,S+=n*H,E+=n*j,C+=n*V,A+=n*G,B+=n*q,x+=n*z,T+=n*W,I+=n*X,F+=n*Y,k+=n*J,R+=n*Q,v+=(n=t[12])*O,m+=n*L,b+=n*U,w+=n*K,S+=n*M,E+=n*H,C+=n*j,A+=n*V,B+=n*G,x+=n*q,T+=n*z,I+=n*W,F+=n*X,k+=n*Y,R+=n*J,D+=n*Q,m+=(n=t[13])*O,b+=n*L,w+=n*U,S+=n*K,E+=n*M,C+=n*H,A+=n*j,B+=n*V,x+=n*G,T+=n*q,I+=n*z,F+=n*W,k+=n*X,R+=n*Y,D+=n*J,_+=n*Q,b+=(n=t[14])*O,w+=n*L,S+=n*U,E+=n*K,C+=n*M,A+=n*H,B+=n*j,x+=n*V,T+=n*G,I+=n*q,F+=n*z,k+=n*W,R+=n*X,D+=n*Y,_+=n*J,P+=n*Q,w+=(n=t[15])*O,s+=38*(E+=n*U),o+=38*(C+=n*K),c+=38*(A+=n*M),u+=38*(B+=n*H),f+=38*(x+=n*j),h+=38*(T+=n*V),l+=38*(I+=n*G),d+=38*(F+=n*q),p+=38*(k+=n*z),g+=38*(R+=n*W),y+=38*(D+=n*X),v+=38*(_+=n*Y),m+=38*(P+=n*J),b+=38*(N+=n*Q),a=(n=(a+=38*(S+=n*L))+(i=1)+65535)-65536*(i=Math.floor(n/65536)),s=(n=s+i+65535)-65536*(i=Math.floor(n/65536)),o=(n=o+i+65535)-65536*(i=Math.floor(n/65536)),c=(n=c+i+65535)-65536*(i=Math.floor(n/65536)),u=(n=u+i+65535)-65536*(i=Math.floor(n/65536)),f=(n=f+i+65535)-65536*(i=Math.floor(n/65536)),h=(n=h+i+65535)-65536*(i=Math.floor(n/65536)),l=(n=l+i+65535)-65536*(i=Math.floor(n/65536)),d=(n=d+i+65535)-65536*(i=Math.floor(n/65536)),p=(n=p+i+65535)-65536*(i=Math.floor(n/65536)),g=(n=g+i+65535)-65536*(i=Math.floor(n/65536)),y=(n=y+i+65535)-65536*(i=Math.floor(n/65536)),v=(n=v+i+65535)-65536*(i=Math.floor(n/65536)),m=(n=m+i+65535)-65536*(i=Math.floor(n/65536)),b=(n=b+i+65535)-65536*(i=Math.floor(n/65536)),w=(n=w+i+65535)-65536*(i=Math.floor(n/65536)),a=(n=(a+=i-1+37*(i-1))+(i=1)+65535)-65536*(i=Math.floor(n/65536)),s=(n=s+i+65535)-65536*(i=Math.floor(n/65536)),o=(n=o+i+65535)-65536*(i=Math.floor(n/65536)),c=(n=c+i+65535)-65536*(i=Math.floor(n/65536)),u=(n=u+i+65535)-65536*(i=Math.floor(n/65536)),f=(n=f+i+65535)-65536*(i=Math.floor(n/65536)),h=(n=h+i+65535)-65536*(i=Math.floor(n/65536)),l=(n=l+i+65535)-65536*(i=Math.floor(n/65536)),d=(n=d+i+65535)-65536*(i=Math.floor(n/65536)),p=(n=p+i+65535)-65536*(i=Math.floor(n/65536)),g=(n=g+i+65535)-65536*(i=Math.floor(n/65536)),y=(n=y+i+65535)-65536*(i=Math.floor(n/65536)),v=(n=v+i+65535)-65536*(i=Math.floor(n/65536)),m=(n=m+i+65535)-65536*(i=Math.floor(n/65536)),b=(n=b+i+65535)-65536*(i=Math.floor(n/65536)),w=(n=w+i+65535)-65536*(i=Math.floor(n/65536)),a+=i-1+37*(i-1),e[0]=a,e[1]=s,e[2]=o,e[3]=c,e[4]=u,e[5]=f,e[6]=h,e[7]=l,e[8]=d,e[9]=p,e[10]=g,e[11]=y,e[12]=v,e[13]=m,e[14]=b,e[15]=w}},28413:e=>{e.exports={options:{usePureJavaScript:!1}}},77827:(e,t,r)=>{var n=r(28413);r(25853),r(23564),(e.exports=n.hmac=n.hmac||{}).create=function(){var e=null,t=null,r=null,i=null,a={start:function(a,s){if(null!==a)if("string"==typeof a){if(!((a=a.toLowerCase())in n.md.algorithms))throw new Error('Unknown hash algorithm "'+a+'"');t=n.md.algorithms[a].create()}else t=a;if(null===s)s=e;else{if("string"==typeof s)s=n.util.createBuffer(s);else if(n.util.isArray(s)){var o=s;s=n.util.createBuffer();for(var c=0;c<o.length;++c)s.putByte(o[c])}var u=s.length();for(u>t.blockLength&&(t.start(),t.update(s.bytes()),s=t.digest()),r=n.util.createBuffer(),i=n.util.createBuffer(),u=s.length(),c=0;c<u;++c)o=s.at(c),r.putByte(54^o),i.putByte(92^o);if(u<t.blockLength)for(o=t.blockLength-u,c=0;c<o;++c)r.putByte(54),i.putByte(92);e=s,r=r.bytes(),i=i.bytes()}t.start(),t.update(r)},update:function(e){t.update(e)},getMac:function(){var e=t.digest().bytes();return t.start(),t.update(i),t.update(e),t.digest()}};return a.digest=a.getMac,a}},88802:(e,t,r)=>{e.exports=r(28413),r(72057),r(73115),r(25129),r(10207),r(35690),r(7931),r(77827),r(26177),r(54728),r(53372),r(81321),r(59065),r(67928),r(26036),r(30996),r(43474),r(3174),r(16721),r(71177),r(26892),r(93851),r(94281),r(78560),r(88415),r(23564)},29127:(e,t,r)=>{var n,i=r(28413);function a(e,t,r){this.data=[],null!=e&&("number"==typeof e?this.fromNumber(e,t,r):null==t&&"string"!=typeof e?this.fromString(e,256):this.fromString(e,t))}function s(){return new a(null)}function o(e,t,r,n,i,a){for(var s=16383&t,o=t>>14;--a>=0;){var c=16383&this.data[e],u=this.data[e++]>>14,f=o*c+u*s;i=((c=s*c+((16383&f)<<14)+r.data[n]+i)>>28)+(f>>14)+o*u,r.data[n++]=268435455&c}return i}e.exports=i.jsbn=i.jsbn||{},i.jsbn.BigInteger=a,"undefined"==typeof navigator?(a.prototype.am=o,n=28):"Microsoft Internet Explorer"==navigator.appName?(a.prototype.am=function(e,t,r,n,i,a){for(var s=32767&t,o=t>>15;--a>=0;){var c=32767&this.data[e],u=this.data[e++]>>15,f=o*c+u*s;i=((c=s*c+((32767&f)<<15)+r.data[n]+(1073741823&i))>>>30)+(f>>>15)+o*u+(i>>>30),r.data[n++]=1073741823&c}return i},n=30):"Netscape"!=navigator.appName?(a.prototype.am=function(e,t,r,n,i,a){for(;--a>=0;){var s=t*this.data[e++]+r.data[n]+i;i=Math.floor(s/67108864),r.data[n++]=67108863&s}return i},n=26):(a.prototype.am=o,n=28),a.prototype.DB=n,a.prototype.DM=(1<<n)-1,a.prototype.DV=1<<n,a.prototype.FV=Math.pow(2,52),a.prototype.F1=52-n,a.prototype.F2=2*n-52;var c,u,f=new Array;for(c="0".charCodeAt(0),u=0;u<=9;++u)f[c++]=u;for(c="a".charCodeAt(0),u=10;u<36;++u)f[c++]=u;for(c="A".charCodeAt(0),u=10;u<36;++u)f[c++]=u;function h(e){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(e)}function l(e,t){var r=f[e.charCodeAt(t)];return null==r?-1:r}function d(e){var t=s();return t.fromInt(e),t}function p(e){var t,r=1;return 0!=(t=e>>>16)&&(e=t,r+=16),0!=(t=e>>8)&&(e=t,r+=8),0!=(t=e>>4)&&(e=t,r+=4),0!=(t=e>>2)&&(e=t,r+=2),0!=(t=e>>1)&&(e=t,r+=1),r}function g(e){this.m=e}function y(e){this.m=e,this.mp=e.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<e.DB-15)-1,this.mt2=2*e.t}function v(e,t){return e&t}function m(e,t){return e|t}function b(e,t){return e^t}function w(e,t){return e&~t}function S(e){if(0==e)return-1;var t=0;return 65535&e||(e>>=16,t+=16),255&e||(e>>=8,t+=8),15&e||(e>>=4,t+=4),3&e||(e>>=2,t+=2),1&e||++t,t}function E(e){for(var t=0;0!=e;)e&=e-1,++t;return t}function C(){}function A(e){return e}function B(e){this.r2=s(),this.q3=s(),a.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}g.prototype.convert=function(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e},g.prototype.revert=function(e){return e},g.prototype.reduce=function(e){e.divRemTo(this.m,null,e)},g.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},g.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},y.prototype.convert=function(e){var t=s();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(a.ZERO)>0&&this.m.subTo(t,t),t},y.prototype.revert=function(e){var t=s();return e.copyTo(t),this.reduce(t),t},y.prototype.reduce=function(e){for(;e.t<=this.mt2;)e.data[e.t++]=0;for(var t=0;t<this.m.t;++t){var r=32767&e.data[t],n=r*this.mpl+((r*this.mph+(e.data[t]>>15)*this.mpl&this.um)<<15)&e.DM;for(r=t+this.m.t,e.data[r]+=this.m.am(0,n,e,t,0,this.m.t);e.data[r]>=e.DV;)e.data[r]-=e.DV,e.data[++r]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)},y.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},y.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},a.prototype.copyTo=function(e){for(var t=this.t-1;t>=0;--t)e.data[t]=this.data[t];e.t=this.t,e.s=this.s},a.prototype.fromInt=function(e){this.t=1,this.s=e<0?-1:0,e>0?this.data[0]=e:e<-1?this.data[0]=e+this.DV:this.t=0},a.prototype.fromString=function(e,t){var r;if(16==t)r=4;else if(8==t)r=3;else if(256==t)r=8;else if(2==t)r=1;else if(32==t)r=5;else{if(4!=t)return void this.fromRadix(e,t);r=2}this.t=0,this.s=0;for(var n=e.length,i=!1,s=0;--n>=0;){var o=8==r?255&e[n]:l(e,n);o<0?"-"==e.charAt(n)&&(i=!0):(i=!1,0==s?this.data[this.t++]=o:s+r>this.DB?(this.data[this.t-1]|=(o&(1<<this.DB-s)-1)<<s,this.data[this.t++]=o>>this.DB-s):this.data[this.t-1]|=o<<s,(s+=r)>=this.DB&&(s-=this.DB))}8==r&&128&e[0]&&(this.s=-1,s>0&&(this.data[this.t-1]|=(1<<this.DB-s)-1<<s)),this.clamp(),i&&a.ZERO.subTo(this,this)},a.prototype.clamp=function(){for(var e=this.s&this.DM;this.t>0&&this.data[this.t-1]==e;)--this.t},a.prototype.dlShiftTo=function(e,t){var r;for(r=this.t-1;r>=0;--r)t.data[r+e]=this.data[r];for(r=e-1;r>=0;--r)t.data[r]=0;t.t=this.t+e,t.s=this.s},a.prototype.drShiftTo=function(e,t){for(var r=e;r<this.t;++r)t.data[r-e]=this.data[r];t.t=Math.max(this.t-e,0),t.s=this.s},a.prototype.lShiftTo=function(e,t){var r,n=e%this.DB,i=this.DB-n,a=(1<<i)-1,s=Math.floor(e/this.DB),o=this.s<<n&this.DM;for(r=this.t-1;r>=0;--r)t.data[r+s+1]=this.data[r]>>i|o,o=(this.data[r]&a)<<n;for(r=s-1;r>=0;--r)t.data[r]=0;t.data[s]=o,t.t=this.t+s+1,t.s=this.s,t.clamp()},a.prototype.rShiftTo=function(e,t){t.s=this.s;var r=Math.floor(e/this.DB);if(r>=this.t)t.t=0;else{var n=e%this.DB,i=this.DB-n,a=(1<<n)-1;t.data[0]=this.data[r]>>n;for(var s=r+1;s<this.t;++s)t.data[s-r-1]|=(this.data[s]&a)<<i,t.data[s-r]=this.data[s]>>n;n>0&&(t.data[this.t-r-1]|=(this.s&a)<<i),t.t=this.t-r,t.clamp()}},a.prototype.subTo=function(e,t){for(var r=0,n=0,i=Math.min(e.t,this.t);r<i;)n+=this.data[r]-e.data[r],t.data[r++]=n&this.DM,n>>=this.DB;if(e.t<this.t){for(n-=e.s;r<this.t;)n+=this.data[r],t.data[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<e.t;)n-=e.data[r],t.data[r++]=n&this.DM,n>>=this.DB;n-=e.s}t.s=n<0?-1:0,n<-1?t.data[r++]=this.DV+n:n>0&&(t.data[r++]=n),t.t=r,t.clamp()},a.prototype.multiplyTo=function(e,t){var r=this.abs(),n=e.abs(),i=r.t;for(t.t=i+n.t;--i>=0;)t.data[i]=0;for(i=0;i<n.t;++i)t.data[i+r.t]=r.am(0,n.data[i],t,i,0,r.t);t.s=0,t.clamp(),this.s!=e.s&&a.ZERO.subTo(t,t)},a.prototype.squareTo=function(e){for(var t=this.abs(),r=e.t=2*t.t;--r>=0;)e.data[r]=0;for(r=0;r<t.t-1;++r){var n=t.am(r,t.data[r],e,2*r,0,1);(e.data[r+t.t]+=t.am(r+1,2*t.data[r],e,2*r+1,n,t.t-r-1))>=t.DV&&(e.data[r+t.t]-=t.DV,e.data[r+t.t+1]=1)}e.t>0&&(e.data[e.t-1]+=t.am(r,t.data[r],e,2*r,0,1)),e.s=0,e.clamp()},a.prototype.divRemTo=function(e,t,r){var n=e.abs();if(!(n.t<=0)){var i=this.abs();if(i.t<n.t)return null!=t&&t.fromInt(0),void(null!=r&&this.copyTo(r));null==r&&(r=s());var o=s(),c=this.s,u=e.s,f=this.DB-p(n.data[n.t-1]);f>0?(n.lShiftTo(f,o),i.lShiftTo(f,r)):(n.copyTo(o),i.copyTo(r));var h=o.t,l=o.data[h-1];if(0!=l){var d=l*(1<<this.F1)+(h>1?o.data[h-2]>>this.F2:0),g=this.FV/d,y=(1<<this.F1)/d,v=1<<this.F2,m=r.t,b=m-h,w=null==t?s():t;for(o.dlShiftTo(b,w),r.compareTo(w)>=0&&(r.data[r.t++]=1,r.subTo(w,r)),a.ONE.dlShiftTo(h,w),w.subTo(o,o);o.t<h;)o.data[o.t++]=0;for(;--b>=0;){var S=r.data[--m]==l?this.DM:Math.floor(r.data[m]*g+(r.data[m-1]+v)*y);if((r.data[m]+=o.am(0,S,r,b,0,h))<S)for(o.dlShiftTo(b,w),r.subTo(w,r);r.data[m]<--S;)r.subTo(w,r)}null!=t&&(r.drShiftTo(h,t),c!=u&&a.ZERO.subTo(t,t)),r.t=h,r.clamp(),f>0&&r.rShiftTo(f,r),c<0&&a.ZERO.subTo(r,r)}}},a.prototype.invDigit=function(){if(this.t<1)return 0;var e=this.data[0];if(!(1&e))return 0;var t=3&e;return(t=(t=(t=(t=t*(2-(15&e)*t)&15)*(2-(255&e)*t)&255)*(2-((65535&e)*t&65535))&65535)*(2-e*t%this.DV)%this.DV)>0?this.DV-t:-t},a.prototype.isEven=function(){return 0==(this.t>0?1&this.data[0]:this.s)},a.prototype.exp=function(e,t){if(e>4294967295||e<1)return a.ONE;var r=s(),n=s(),i=t.convert(this),o=p(e)-1;for(i.copyTo(r);--o>=0;)if(t.sqrTo(r,n),(e&1<<o)>0)t.mulTo(n,i,r);else{var c=r;r=n,n=c}return t.revert(r)},a.prototype.toString=function(e){if(this.s<0)return"-"+this.negate().toString(e);var t;if(16==e)t=4;else if(8==e)t=3;else if(2==e)t=1;else if(32==e)t=5;else{if(4!=e)return this.toRadix(e);t=2}var r,n=(1<<t)-1,i=!1,a="",s=this.t,o=this.DB-s*this.DB%t;if(s-- >0)for(o<this.DB&&(r=this.data[s]>>o)>0&&(i=!0,a=h(r));s>=0;)o<t?(r=(this.data[s]&(1<<o)-1)<<t-o,r|=this.data[--s]>>(o+=this.DB-t)):(r=this.data[s]>>(o-=t)&n,o<=0&&(o+=this.DB,--s)),r>0&&(i=!0),i&&(a+=h(r));return i?a:"0"},a.prototype.negate=function(){var e=s();return a.ZERO.subTo(this,e),e},a.prototype.abs=function(){return this.s<0?this.negate():this},a.prototype.compareTo=function(e){var t=this.s-e.s;if(0!=t)return t;var r=this.t;if(0!=(t=r-e.t))return this.s<0?-t:t;for(;--r>=0;)if(0!=(t=this.data[r]-e.data[r]))return t;return 0},a.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+p(this.data[this.t-1]^this.s&this.DM)},a.prototype.mod=function(e){var t=s();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(a.ZERO)>0&&e.subTo(t,t),t},a.prototype.modPowInt=function(e,t){var r;return r=e<256||t.isEven()?new g(t):new y(t),this.exp(e,r)},a.ZERO=d(0),a.ONE=d(1),C.prototype.convert=A,C.prototype.revert=A,C.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r)},C.prototype.sqrTo=function(e,t){e.squareTo(t)},B.prototype.convert=function(e){if(e.s<0||e.t>2*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t=s();return e.copyTo(t),this.reduce(t),t},B.prototype.revert=function(e){return e},B.prototype.reduce=function(e){for(e.drShiftTo(this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,e.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);e.compareTo(this.r2)<0;)e.dAddOffset(1,this.m.t+1);for(e.subTo(this.r2,e);e.compareTo(this.m)>=0;)e.subTo(this.m,e)},B.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},B.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)};var x=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509],T=(1<<26)/x[x.length-1];a.prototype.chunkSize=function(e){return Math.floor(Math.LN2*this.DB/Math.log(e))},a.prototype.toRadix=function(e){if(null==e&&(e=10),0==this.signum()||e<2||e>36)return"0";var t=this.chunkSize(e),r=Math.pow(e,t),n=d(r),i=s(),a=s(),o="";for(this.divRemTo(n,i,a);i.signum()>0;)o=(r+a.intValue()).toString(e).substr(1)+o,i.divRemTo(n,i,a);return a.intValue().toString(e)+o},a.prototype.fromRadix=function(e,t){this.fromInt(0),null==t&&(t=10);for(var r=this.chunkSize(t),n=Math.pow(t,r),i=!1,s=0,o=0,c=0;c<e.length;++c){var u=l(e,c);u<0?"-"==e.charAt(c)&&0==this.signum()&&(i=!0):(o=t*o+u,++s>=r&&(this.dMultiply(n),this.dAddOffset(o,0),s=0,o=0))}s>0&&(this.dMultiply(Math.pow(t,s)),this.dAddOffset(o,0)),i&&a.ZERO.subTo(this,this)},a.prototype.fromNumber=function(e,t,r){if("number"==typeof t)if(e<2)this.fromInt(1);else for(this.fromNumber(e,r),this.testBit(e-1)||this.bitwiseTo(a.ONE.shiftLeft(e-1),m,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(a.ONE.shiftLeft(e-1),this);else{var n=new Array,i=7&e;n.length=1+(e>>3),t.nextBytes(n),i>0?n[0]&=(1<<i)-1:n[0]=0,this.fromString(n,256)}},a.prototype.bitwiseTo=function(e,t,r){var n,i,a=Math.min(e.t,this.t);for(n=0;n<a;++n)r.data[n]=t(this.data[n],e.data[n]);if(e.t<this.t){for(i=e.s&this.DM,n=a;n<this.t;++n)r.data[n]=t(this.data[n],i);r.t=this.t}else{for(i=this.s&this.DM,n=a;n<e.t;++n)r.data[n]=t(i,e.data[n]);r.t=e.t}r.s=t(this.s,e.s),r.clamp()},a.prototype.changeBit=function(e,t){var r=a.ONE.shiftLeft(e);return this.bitwiseTo(r,t,r),r},a.prototype.addTo=function(e,t){for(var r=0,n=0,i=Math.min(e.t,this.t);r<i;)n+=this.data[r]+e.data[r],t.data[r++]=n&this.DM,n>>=this.DB;if(e.t<this.t){for(n+=e.s;r<this.t;)n+=this.data[r],t.data[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<e.t;)n+=e.data[r],t.data[r++]=n&this.DM,n>>=this.DB;n+=e.s}t.s=n<0?-1:0,n>0?t.data[r++]=n:n<-1&&(t.data[r++]=this.DV+n),t.t=r,t.clamp()},a.prototype.dMultiply=function(e){this.data[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()},a.prototype.dAddOffset=function(e,t){if(0!=e){for(;this.t<=t;)this.data[this.t++]=0;for(this.data[t]+=e;this.data[t]>=this.DV;)this.data[t]-=this.DV,++t>=this.t&&(this.data[this.t++]=0),++this.data[t]}},a.prototype.multiplyLowerTo=function(e,t,r){var n,i=Math.min(this.t+e.t,t);for(r.s=0,r.t=i;i>0;)r.data[--i]=0;for(n=r.t-this.t;i<n;++i)r.data[i+this.t]=this.am(0,e.data[i],r,i,0,this.t);for(n=Math.min(e.t,t);i<n;++i)this.am(0,e.data[i],r,i,0,t-i);r.clamp()},a.prototype.multiplyUpperTo=function(e,t,r){--t;var n=r.t=this.t+e.t-t;for(r.s=0;--n>=0;)r.data[n]=0;for(n=Math.max(t-this.t,0);n<e.t;++n)r.data[this.t+n-t]=this.am(t-n,e.data[n],r,0,0,this.t+n-t);r.clamp(),r.drShiftTo(1,r)},a.prototype.modInt=function(e){if(e<=0)return 0;var t=this.DV%e,r=this.s<0?e-1:0;if(this.t>0)if(0==t)r=this.data[0]%e;else for(var n=this.t-1;n>=0;--n)r=(t*r+this.data[n])%e;return r},a.prototype.millerRabin=function(e){var t=this.subtract(a.ONE),r=t.getLowestSetBit();if(r<=0)return!1;for(var n,i=t.shiftRight(r),s={nextBytes:function(e){for(var t=0;t<e.length;++t)e[t]=Math.floor(256*Math.random())}},o=0;o<e;++o){do{n=new a(this.bitLength(),s)}while(n.compareTo(a.ONE)<=0||n.compareTo(t)>=0);var c=n.modPow(i,this);if(0!=c.compareTo(a.ONE)&&0!=c.compareTo(t)){for(var u=1;u++<r&&0!=c.compareTo(t);)if(0==(c=c.modPowInt(2,this)).compareTo(a.ONE))return!1;if(0!=c.compareTo(t))return!1}}return!0},a.prototype.clone=function(){var e=s();return this.copyTo(e),e},a.prototype.intValue=function(){if(this.s<0){if(1==this.t)return this.data[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this.data[0];if(0==this.t)return 0}return(this.data[1]&(1<<32-this.DB)-1)<<this.DB|this.data[0]},a.prototype.byteValue=function(){return 0==this.t?this.s:this.data[0]<<24>>24},a.prototype.shortValue=function(){return 0==this.t?this.s:this.data[0]<<16>>16},a.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this.data[0]<=0?0:1},a.prototype.toByteArray=function(){var e=this.t,t=new Array;t[0]=this.s;var r,n=this.DB-e*this.DB%8,i=0;if(e-- >0)for(n<this.DB&&(r=this.data[e]>>n)!=(this.s&this.DM)>>n&&(t[i++]=r|this.s<<this.DB-n);e>=0;)n<8?(r=(this.data[e]&(1<<n)-1)<<8-n,r|=this.data[--e]>>(n+=this.DB-8)):(r=this.data[e]>>(n-=8)&255,n<=0&&(n+=this.DB,--e)),128&r&&(r|=-256),0==i&&(128&this.s)!=(128&r)&&++i,(i>0||r!=this.s)&&(t[i++]=r);return t},a.prototype.equals=function(e){return 0==this.compareTo(e)},a.prototype.min=function(e){return this.compareTo(e)<0?this:e},a.prototype.max=function(e){return this.compareTo(e)>0?this:e},a.prototype.and=function(e){var t=s();return this.bitwiseTo(e,v,t),t},a.prototype.or=function(e){var t=s();return this.bitwiseTo(e,m,t),t},a.prototype.xor=function(e){var t=s();return this.bitwiseTo(e,b,t),t},a.prototype.andNot=function(e){var t=s();return this.bitwiseTo(e,w,t),t},a.prototype.not=function(){for(var e=s(),t=0;t<this.t;++t)e.data[t]=this.DM&~this.data[t];return e.t=this.t,e.s=~this.s,e},a.prototype.shiftLeft=function(e){var t=s();return e<0?this.rShiftTo(-e,t):this.lShiftTo(e,t),t},a.prototype.shiftRight=function(e){var t=s();return e<0?this.lShiftTo(-e,t):this.rShiftTo(e,t),t},a.prototype.getLowestSetBit=function(){for(var e=0;e<this.t;++e)if(0!=this.data[e])return e*this.DB+S(this.data[e]);return this.s<0?this.t*this.DB:-1},a.prototype.bitCount=function(){for(var e=0,t=this.s&this.DM,r=0;r<this.t;++r)e+=E(this.data[r]^t);return e},a.prototype.testBit=function(e){var t=Math.floor(e/this.DB);return t>=this.t?0!=this.s:!!(this.data[t]&1<<e%this.DB)},a.prototype.setBit=function(e){return this.changeBit(e,m)},a.prototype.clearBit=function(e){return this.changeBit(e,w)},a.prototype.flipBit=function(e){return this.changeBit(e,b)},a.prototype.add=function(e){var t=s();return this.addTo(e,t),t},a.prototype.subtract=function(e){var t=s();return this.subTo(e,t),t},a.prototype.multiply=function(e){var t=s();return this.multiplyTo(e,t),t},a.prototype.divide=function(e){var t=s();return this.divRemTo(e,t,null),t},a.prototype.remainder=function(e){var t=s();return this.divRemTo(e,null,t),t},a.prototype.divideAndRemainder=function(e){var t=s(),r=s();return this.divRemTo(e,t,r),new Array(t,r)},a.prototype.modPow=function(e,t){var r,n,i=e.bitLength(),a=d(1);if(i<=0)return a;r=i<18?1:i<48?3:i<144?4:i<768?5:6,n=i<8?new g(t):t.isEven()?new B(t):new y(t);var o=new Array,c=3,u=r-1,f=(1<<r)-1;if(o[1]=n.convert(this),r>1){var h=s();for(n.sqrTo(o[1],h);c<=f;)o[c]=s(),n.mulTo(h,o[c-2],o[c]),c+=2}var l,v,m=e.t-1,b=!0,w=s();for(i=p(e.data[m])-1;m>=0;){for(i>=u?l=e.data[m]>>i-u&f:(l=(e.data[m]&(1<<i+1)-1)<<u-i,m>0&&(l|=e.data[m-1]>>this.DB+i-u)),c=r;!(1&l);)l>>=1,--c;if((i-=c)<0&&(i+=this.DB,--m),b)o[l].copyTo(a),b=!1;else{for(;c>1;)n.sqrTo(a,w),n.sqrTo(w,a),c-=2;c>0?n.sqrTo(a,w):(v=a,a=w,w=v),n.mulTo(w,o[l],a)}for(;m>=0&&!(e.data[m]&1<<i);)n.sqrTo(a,w),v=a,a=w,w=v,--i<0&&(i=this.DB-1,--m)}return n.revert(a)},a.prototype.modInverse=function(e){var t=e.isEven();if(this.isEven()&&t||0==e.signum())return a.ZERO;for(var r=e.clone(),n=this.clone(),i=d(1),s=d(0),o=d(0),c=d(1);0!=r.signum();){for(;r.isEven();)r.rShiftTo(1,r),t?(i.isEven()&&s.isEven()||(i.addTo(this,i),s.subTo(e,s)),i.rShiftTo(1,i)):s.isEven()||s.subTo(e,s),s.rShiftTo(1,s);for(;n.isEven();)n.rShiftTo(1,n),t?(o.isEven()&&c.isEven()||(o.addTo(this,o),c.subTo(e,c)),o.rShiftTo(1,o)):c.isEven()||c.subTo(e,c),c.rShiftTo(1,c);r.compareTo(n)>=0?(r.subTo(n,r),t&&i.subTo(o,i),s.subTo(c,s)):(n.subTo(r,n),t&&o.subTo(i,o),c.subTo(s,c))}return 0!=n.compareTo(a.ONE)?a.ZERO:c.compareTo(e)>=0?c.subtract(e):c.signum()<0?(c.addTo(e,c),c.signum()<0?c.add(e):c):c},a.prototype.pow=function(e){return this.exp(e,new C)},a.prototype.gcd=function(e){var t=this.s<0?this.negate():this.clone(),r=e.s<0?e.negate():e.clone();if(t.compareTo(r)<0){var n=t;t=r,r=n}var i=t.getLowestSetBit(),a=r.getLowestSetBit();if(a<0)return t;for(i<a&&(a=i),a>0&&(t.rShiftTo(a,t),r.rShiftTo(a,r));t.signum()>0;)(i=t.getLowestSetBit())>0&&t.rShiftTo(i,t),(i=r.getLowestSetBit())>0&&r.rShiftTo(i,r),t.compareTo(r)>=0?(t.subTo(r,t),t.rShiftTo(1,t)):(r.subTo(t,r),r.rShiftTo(1,r));return a>0&&r.lShiftTo(a,r),r},a.prototype.isProbablePrime=function(e){var t,r=this.abs();if(1==r.t&&r.data[0]<=x[x.length-1]){for(t=0;t<x.length;++t)if(r.data[0]==x[t])return!0;return!1}if(r.isEven())return!1;for(t=1;t<x.length;){for(var n=x[t],i=t+1;i<x.length&&n<T;)n*=x[i++];for(n=r.modInt(n);t<i;)if(n%x[t++]==0)return!1}return r.millerRabin(e)}},26177:(e,t,r)=>{var n=r(28413);r(23564),r(93851),r(29127),e.exports=n.kem=n.kem||{};var i=n.jsbn.BigInteger;function a(e,t,r,i){e.generate=function(e,a){for(var s=new n.util.ByteBuffer,o=Math.ceil(a/i)+r,c=new n.util.ByteBuffer,u=r;u<o;++u){c.putInt32(u),t.start(),t.update(e+c.getBytes());var f=t.digest();s.putBytes(f.getBytes(i))}return s.truncate(s.length()-a),s.getBytes()}}n.kem.rsa={},n.kem.rsa.create=function(e,t){var r=(t=t||{}).prng||n.random;return{encrypt:function(t,a){var s,o=Math.ceil(t.n.bitLength()/8);do{s=new i(n.util.bytesToHex(r.getBytesSync(o)),16).mod(t.n)}while(s.compareTo(i.ONE)<=0);var c=o-(s=n.util.hexToBytes(s.toString(16))).length;return c>0&&(s=n.util.fillString(String.fromCharCode(0),c)+s),{encapsulation:t.encrypt(s,"NONE"),key:e.generate(s,a)}},decrypt:function(t,r,n){var i=t.decrypt(r,"NONE");return e.generate(i,n)}}},n.kem.kdf1=function(e,t){a(this,e,0,t||e.digestLength)},n.kem.kdf2=function(e,t){a(this,e,1,t||e.digestLength)}},54728:(e,t,r)=>{var n=r(28413);r(23564),e.exports=n.log=n.log||{},n.log.levels=["none","error","warning","info","debug","verbose","max"];var i={},a=[],s=null;n.log.LEVEL_LOCKED=2,n.log.NO_LEVEL_CHECK=4,n.log.INTERPOLATE=8;for(var o=0;o<n.log.levels.length;++o){var c=n.log.levels[o];i[c]={index:o,name:c.toUpperCase()}}n.log.logMessage=function(e){for(var t=i[e.level].index,r=0;r<a.length;++r){var s=a[r];s.flags&n.log.NO_LEVEL_CHECK?s.f(e):t<=i[s.level].index&&s.f(s,e)}},n.log.prepareStandard=function(e){"standard"in e||(e.standard=i[e.level].name+" ["+e.category+"] "+e.message)},n.log.prepareFull=function(e){if(!("full"in e)){var t=[e.message];t=t.concat([]||0),e.full=n.util.format.apply(this,t)}},n.log.prepareStandardFull=function(e){"standardFull"in e||(n.log.prepareStandard(e),e.standardFull=e.standard)};var u=["error","warning","info","debug","verbose"];for(o=0;o<u.length;++o)!function(e){n.log[e]=function(t,r){var i=Array.prototype.slice.call(arguments).slice(2),a={timestamp:new Date,level:e,category:t,message:r,arguments:i};n.log.logMessage(a)}}(u[o]);if(n.log.makeLogger=function(e){var t={flags:0,f:e};return n.log.setLevel(t,"none"),t},n.log.setLevel=function(e,t){var r=!1;if(e&&!(e.flags&n.log.LEVEL_LOCKED))for(var i=0;i<n.log.levels.length;++i)if(t==n.log.levels[i]){e.level=t,r=!0;break}return r},n.log.lock=function(e,t){void 0===t||t?e.flags|=n.log.LEVEL_LOCKED:e.flags&=~n.log.LEVEL_LOCKED},n.log.addLogger=function(e){a.push(e)},"undefined"!=typeof console&&"log"in console){var f;if(console.error&&console.warn&&console.info&&console.debug){var h={error:console.error,warning:console.warn,info:console.info,debug:console.debug,verbose:console.debug},l=function(e,t){n.log.prepareStandard(t);var r=h[t.level],i=[t.standard];i=i.concat(t.arguments.slice()),r.apply(console,i)};f=n.log.makeLogger(l)}else l=function(e,t){n.log.prepareStandardFull(t),console.log(t.standardFull)},f=n.log.makeLogger(l);n.log.setLevel(f,"debug"),n.log.addLogger(f),s=f}else console={log:function(){}};if(null!==s&&"undefined"!=typeof window&&window.location){var d=new URL(window.location.href).searchParams;d.has("console.level")&&n.log.setLevel(s,d.get("console.level").slice(-1)[0]),d.has("console.lock")&&"true"==d.get("console.lock").slice(-1)[0]&&n.log.lock(s)}n.log.consoleLogger=s},53372:(e,t,r)=>{e.exports=r(25853),r(22926),r(13417),r(24955),r(39194)},25853:(e,t,r)=>{var n=r(28413);e.exports=n.md=n.md||{},n.md.algorithms=n.md.algorithms||{}},22926:(e,t,r)=>{var n=r(28413);r(25853),r(23564);var i=e.exports=n.md5=n.md5||{};n.md.md5=n.md.algorithms.md5=i,i.create=function(){u||function(){a=String.fromCharCode(128),a+=n.util.fillString(String.fromCharCode(0),64),s=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,1,6,11,0,5,10,15,4,9,14,3,8,13,2,7,12,5,8,11,14,1,4,7,10,13,0,3,6,9,12,15,2,0,7,14,5,12,3,10,1,8,15,6,13,4,11,2,9],o=[7,12,17,22,7,12,17,22,7,12,17,22,7,12,17,22,5,9,14,20,5,9,14,20,5,9,14,20,5,9,14,20,4,11,16,23,4,11,16,23,4,11,16,23,4,11,16,23,6,10,15,21,6,10,15,21,6,10,15,21,6,10,15,21],c=new Array(64);for(var e=0;e<64;++e)c[e]=Math.floor(4294967296*Math.abs(Math.sin(e+1)));u=!0}();var e=null,t=n.util.createBuffer(),r=new Array(16),i={algorithm:"md5",blockLength:64,digestLength:16,messageLength:0,fullMessageLength:null,messageLengthSize:8,start:function(){i.messageLength=0,i.fullMessageLength=i.messageLength64=[];for(var r=i.messageLengthSize/4,a=0;a<r;++a)i.fullMessageLength.push(0);return t=n.util.createBuffer(),e={h0:1732584193,h1:4023233417,h2:2562383102,h3:271733878},i}};return i.start(),i.update=function(a,s){"utf8"===s&&(a=n.util.encodeUtf8(a));var o=a.length;i.messageLength+=o,o=[o/4294967296>>>0,o>>>0];for(var c=i.fullMessageLength.length-1;c>=0;--c)i.fullMessageLength[c]+=o[1],o[1]=o[0]+(i.fullMessageLength[c]/4294967296>>>0),i.fullMessageLength[c]=i.fullMessageLength[c]>>>0,o[0]=o[1]/4294967296>>>0;return t.putBytes(a),f(e,r,t),(t.read>2048||0===t.length())&&t.compact(),i},i.digest=function(){var s=n.util.createBuffer();s.putBytes(t.bytes());var o=i.fullMessageLength[i.fullMessageLength.length-1]+i.messageLengthSize&i.blockLength-1;s.putBytes(a.substr(0,i.blockLength-o));for(var c,u=0,h=i.fullMessageLength.length-1;h>=0;--h)u=(c=8*i.fullMessageLength[h]+u)/4294967296>>>0,s.putInt32Le(c>>>0);var l={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3};f(l,r,s);var d=n.util.createBuffer();return d.putInt32Le(l.h0),d.putInt32Le(l.h1),d.putInt32Le(l.h2),d.putInt32Le(l.h3),d},i};var a=null,s=null,o=null,c=null,u=!1;function f(e,t,r){for(var n,i,a,u,f,h,l,d=r.length();d>=64;){for(i=e.h0,a=e.h1,u=e.h2,f=e.h3,l=0;l<16;++l)t[l]=r.getInt32Le(),n=i+(f^a&(u^f))+c[l]+t[l],i=f,f=u,u=a,a+=n<<(h=o[l])|n>>>32-h;for(;l<32;++l)n=i+(u^f&(a^u))+c[l]+t[s[l]],i=f,f=u,u=a,a+=n<<(h=o[l])|n>>>32-h;for(;l<48;++l)n=i+(a^u^f)+c[l]+t[s[l]],i=f,f=u,u=a,a+=n<<(h=o[l])|n>>>32-h;for(;l<64;++l)n=i+(u^(a|~f))+c[l]+t[s[l]],i=f,f=u,u=a,a+=n<<(h=o[l])|n>>>32-h;e.h0=e.h0+i|0,e.h1=e.h1+a|0,e.h2=e.h2+u|0,e.h3=e.h3+f|0,d-=64}}},22328:(e,t,r)=>{var n=r(28413);r(81321),e.exports=n.mgf=n.mgf||{},n.mgf.mgf1=n.mgf1},81321:(e,t,r)=>{var n=r(28413);r(23564),n.mgf=n.mgf||{},(e.exports=n.mgf.mgf1=n.mgf1=n.mgf1||{}).create=function(e){return{generate:function(t,r){for(var i=new n.util.ByteBuffer,a=Math.ceil(r/e.digestLength),s=0;s<a;s++){var o=new n.util.ByteBuffer;o.putInt32(s),e.start(),e.update(t+o.getBytes()),i.putBuffer(e.digest())}return i.truncate(i.length()-r),i.getBytes()}}}},12889:(e,t,r)=>{var n=r(28413);n.pki=n.pki||{};var i=e.exports=n.pki.oids=n.oids=n.oids||{};function a(e,t){i[e]=t,i[t]=e}function s(e,t){i[e]=t}a("1.2.840.113549.1.1.1","rsaEncryption"),a("1.2.840.113549.1.1.4","md5WithRSAEncryption"),a("1.2.840.113549.1.1.5","sha1WithRSAEncryption"),a("1.2.840.113549.1.1.7","RSAES-OAEP"),a("1.2.840.113549.1.1.8","mgf1"),a("1.2.840.113549.1.1.9","pSpecified"),a("1.2.840.113549.1.1.10","RSASSA-PSS"),a("1.2.840.113549.1.1.11","sha256WithRSAEncryption"),a("1.2.840.113549.1.1.12","sha384WithRSAEncryption"),a("1.2.840.113549.1.1.13","sha512WithRSAEncryption"),a("1.3.101.112","EdDSA25519"),a("1.2.840.10040.4.3","dsa-with-sha1"),a("1.3.14.3.2.7","desCBC"),a("1.3.14.3.2.26","sha1"),a("1.3.14.3.2.29","sha1WithRSASignature"),a("2.16.840.1.101.3.4.2.1","sha256"),a("2.16.840.1.101.3.4.2.2","sha384"),a("2.16.840.1.101.3.4.2.3","sha512"),a("2.16.840.1.101.3.4.2.4","sha224"),a("2.16.840.1.101.3.4.2.5","sha512-224"),a("2.16.840.1.101.3.4.2.6","sha512-256"),a("1.2.840.113549.2.2","md2"),a("1.2.840.113549.2.5","md5"),a("1.2.840.113549.1.7.1","data"),a("1.2.840.113549.1.7.2","signedData"),a("1.2.840.113549.1.7.3","envelopedData"),a("1.2.840.113549.1.7.4","signedAndEnvelopedData"),a("1.2.840.113549.1.7.5","digestedData"),a("1.2.840.113549.1.7.6","encryptedData"),a("1.2.840.113549.1.9.1","emailAddress"),a("1.2.840.113549.1.9.2","unstructuredName"),a("1.2.840.113549.1.9.3","contentType"),a("1.2.840.113549.1.9.4","messageDigest"),a("1.2.840.113549.1.9.5","signingTime"),a("1.2.840.113549.1.9.6","counterSignature"),a("1.2.840.113549.1.9.7","challengePassword"),a("1.2.840.113549.1.9.8","unstructuredAddress"),a("1.2.840.113549.1.9.14","extensionRequest"),a("1.2.840.113549.1.9.20","friendlyName"),a("1.2.840.113549.1.9.21","localKeyId"),a("1.2.840.113549.1.9.22.1","x509Certificate"),a("1.2.840.113549.1.12.10.1.1","keyBag"),a("1.2.840.113549.1.12.10.1.2","pkcs8ShroudedKeyBag"),a("1.2.840.113549.1.12.10.1.3","certBag"),a("1.2.840.113549.1.12.10.1.4","crlBag"),a("1.2.840.113549.1.12.10.1.5","secretBag"),a("1.2.840.113549.1.12.10.1.6","safeContentsBag"),a("1.2.840.113549.1.5.13","pkcs5PBES2"),a("1.2.840.113549.1.5.12","pkcs5PBKDF2"),a("1.2.840.113549.1.12.1.1","pbeWithSHAAnd128BitRC4"),a("1.2.840.113549.1.12.1.2","pbeWithSHAAnd40BitRC4"),a("1.2.840.113549.1.12.1.3","pbeWithSHAAnd3-KeyTripleDES-CBC"),a("1.2.840.113549.1.12.1.4","pbeWithSHAAnd2-KeyTripleDES-CBC"),a("1.2.840.113549.1.12.1.5","pbeWithSHAAnd128BitRC2-CBC"),a("1.2.840.113549.1.12.1.6","pbewithSHAAnd40BitRC2-CBC"),a("1.2.840.113549.2.7","hmacWithSHA1"),a("1.2.840.113549.2.8","hmacWithSHA224"),a("1.2.840.113549.2.9","hmacWithSHA256"),a("1.2.840.113549.2.10","hmacWithSHA384"),a("1.2.840.113549.2.11","hmacWithSHA512"),a("1.2.840.113549.3.7","des-EDE3-CBC"),a("2.16.840.1.101.3.4.1.2","aes128-CBC"),a("2.16.840.1.101.3.4.1.22","aes192-CBC"),a("2.16.840.1.101.3.4.1.42","aes256-CBC"),a("2.5.4.3","commonName"),a("2.5.4.4","surname"),a("2.5.4.5","serialNumber"),a("2.5.4.6","countryName"),a("2.5.4.7","localityName"),a("2.5.4.8","stateOrProvinceName"),a("2.5.4.9","streetAddress"),a("2.5.4.10","organizationName"),a("2.5.4.11","organizationalUnitName"),a("2.5.4.12","title"),a("2.5.4.13","description"),a("2.5.4.15","businessCategory"),a("2.5.4.17","postalCode"),a("2.5.4.42","givenName"),a("1.3.6.1.4.1.311.60.2.1.2","jurisdictionOfIncorporationStateOrProvinceName"),a("1.3.6.1.4.1.311.60.2.1.3","jurisdictionOfIncorporationCountryName"),a("2.16.840.1.113730.1.1","nsCertType"),a("2.16.840.1.113730.1.13","nsComment"),s("2.5.29.1","authorityKeyIdentifier"),s("2.5.29.2","keyAttributes"),s("2.5.29.3","certificatePolicies"),s("2.5.29.4","keyUsageRestriction"),s("2.5.29.5","policyMapping"),s("2.5.29.6","subtreesConstraint"),s("2.5.29.7","subjectAltName"),s("2.5.29.8","issuerAltName"),s("2.5.29.9","subjectDirectoryAttributes"),s("2.5.29.10","basicConstraints"),s("2.5.29.11","nameConstraints"),s("2.5.29.12","policyConstraints"),s("2.5.29.13","basicConstraints"),a("2.5.29.14","subjectKeyIdentifier"),a("2.5.29.15","keyUsage"),s("2.5.29.16","privateKeyUsagePeriod"),a("2.5.29.17","subjectAltName"),a("2.5.29.18","issuerAltName"),a("2.5.29.19","basicConstraints"),s("2.5.29.20","cRLNumber"),s("2.5.29.21","cRLReason"),s("2.5.29.22","expirationDate"),s("2.5.29.23","instructionCode"),s("2.5.29.24","invalidityDate"),s("2.5.29.25","cRLDistributionPoints"),s("2.5.29.26","issuingDistributionPoint"),s("2.5.29.27","deltaCRLIndicator"),s("2.5.29.28","issuingDistributionPoint"),s("2.5.29.29","certificateIssuer"),s("2.5.29.30","nameConstraints"),a("2.5.29.31","cRLDistributionPoints"),a("2.5.29.32","certificatePolicies"),s("2.5.29.33","policyMappings"),s("2.5.29.34","policyConstraints"),a("2.5.29.35","authorityKeyIdentifier"),s("2.5.29.36","policyConstraints"),a("2.5.29.37","extKeyUsage"),s("2.5.29.46","freshestCRL"),s("2.5.29.54","inhibitAnyPolicy"),a("1.3.6.1.4.1.11129.2.4.2","timestampList"),a("1.3.6.1.5.5.7.1.1","authorityInfoAccess"),a("1.3.6.1.5.5.7.3.1","serverAuth"),a("1.3.6.1.5.5.7.3.2","clientAuth"),a("1.3.6.1.5.5.7.3.3","codeSigning"),a("1.3.6.1.5.5.7.3.4","emailProtection"),a("1.3.6.1.5.5.7.3.8","timeStamping")},76259:(e,t,r)=>{var n=r(28413);if(r(72057),r(25129),r(35690),r(25853),r(12889),r(59065),r(67928),r(93851),r(94281),r(72112),r(23564),void 0===i)var i=n.jsbn.BigInteger;var a=n.asn1,s=n.pki=n.pki||{};e.exports=s.pbe=n.pbe=n.pbe||{};var o=s.oids,c={name:"EncryptedPrivateKeyInfo",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedPrivateKeyInfo.encryptionAlgorithm",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:a.Class.UNIVERSAL,type:a.Type.OID,constructed:!1,capture:"encryptionOid"},{name:"AlgorithmIdentifier.parameters",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,captureAsn1:"encryptionParams"}]},{name:"EncryptedPrivateKeyInfo.encryptedData",tagClass:a.Class.UNIVERSAL,type:a.Type.OCTETSTRING,constructed:!1,capture:"encryptedData"}]},u={name:"PBES2Algorithms",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc.oid",tagClass:a.Class.UNIVERSAL,type:a.Type.OID,constructed:!1,capture:"kdfOid"},{name:"PBES2Algorithms.params",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.params.salt",tagClass:a.Class.UNIVERSAL,type:a.Type.OCTETSTRING,constructed:!1,capture:"kdfSalt"},{name:"PBES2Algorithms.params.iterationCount",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"kdfIterationCount"},{name:"PBES2Algorithms.params.keyLength",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,optional:!0,capture:"keyLength"},{name:"PBES2Algorithms.params.prf",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,optional:!0,value:[{name:"PBES2Algorithms.params.prf.algorithm",tagClass:a.Class.UNIVERSAL,type:a.Type.OID,constructed:!1,capture:"prfOid"}]}]}]},{name:"PBES2Algorithms.encryptionScheme",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.encryptionScheme.oid",tagClass:a.Class.UNIVERSAL,type:a.Type.OID,constructed:!1,capture:"encOid"},{name:"PBES2Algorithms.encryptionScheme.iv",tagClass:a.Class.UNIVERSAL,type:a.Type.OCTETSTRING,constructed:!1,capture:"encIv"}]}]},f={name:"pkcs-12PbeParams",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"pkcs-12PbeParams.salt",tagClass:a.Class.UNIVERSAL,type:a.Type.OCTETSTRING,constructed:!1,capture:"salt"},{name:"pkcs-12PbeParams.iterations",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"iterations"}]};function h(e,t){return e.start().update(t).digest().getBytes()}function l(e){var t;if(e){if(!(t=s.oids[a.derToOid(e)])){var r=new Error("Unsupported PRF OID.");throw r.oid=e,r.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],r}}else t="hmacWithSHA1";return d(t)}function d(e){var t=n.md;switch(e){case"hmacWithSHA224":t=n.md.sha512;case"hmacWithSHA1":case"hmacWithSHA256":case"hmacWithSHA384":case"hmacWithSHA512":e=e.substr(8).toLowerCase();break;default:var r=new Error("Unsupported PRF algorithm.");throw r.algorithm=e,r.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],r}if(!t||!(e in t))throw new Error("Unknown hash algorithm: "+e);return t[e].create()}s.encryptPrivateKeyInfo=function(e,t,r){(r=r||{}).saltSize=r.saltSize||8,r.count=r.count||2048,r.algorithm=r.algorithm||"aes128",r.prfAlgorithm=r.prfAlgorithm||"sha1";var i,c,u,f=n.random.getBytesSync(r.saltSize),h=r.count,l=a.integerToDer(h);if(0===r.algorithm.indexOf("aes")||"des"===r.algorithm){var p,g,y;switch(r.algorithm){case"aes128":i=16,p=16,g=o["aes128-CBC"],y=n.aes.createEncryptionCipher;break;case"aes192":i=24,p=16,g=o["aes192-CBC"],y=n.aes.createEncryptionCipher;break;case"aes256":i=32,p=16,g=o["aes256-CBC"],y=n.aes.createEncryptionCipher;break;case"des":i=8,p=8,g=o.desCBC,y=n.des.createEncryptionCipher;break;default:throw(E=new Error("Cannot encrypt private key. Unknown encryption algorithm.")).algorithm=r.algorithm,E}var v="hmacWith"+r.prfAlgorithm.toUpperCase(),m=d(v),b=n.pkcs5.pbkdf2(t,f,h,i,m),w=n.random.getBytesSync(p);(C=y(b)).start(w),C.update(a.toDer(e)),C.finish(),u=C.output.getBytes();var S=function(e,t,r,i){var o=a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OCTETSTRING,!1,e),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,t.getBytes())]);return"hmacWithSHA1"!==i&&o.value.push(a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,n.util.hexToBytes(r.toString(16))),a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OID,!1,a.oidToDer(s.oids[i]).getBytes()),a.create(a.Class.UNIVERSAL,a.Type.NULL,!1,"")])),o}(f,l,i,v);c=a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OID,!1,a.oidToDer(o.pkcs5PBES2).getBytes()),a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OID,!1,a.oidToDer(o.pkcs5PBKDF2).getBytes()),S]),a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OID,!1,a.oidToDer(g).getBytes()),a.create(a.Class.UNIVERSAL,a.Type.OCTETSTRING,!1,w)])])])}else{var E;if("3des"!==r.algorithm)throw(E=new Error("Cannot encrypt private key. Unknown encryption algorithm.")).algorithm=r.algorithm,E;i=24;var C,A=new n.util.ByteBuffer(f);b=s.pbe.generatePkcs12Key(t,A,1,h,i),w=s.pbe.generatePkcs12Key(t,A,2,h,i),(C=n.des.createEncryptionCipher(b)).start(w),C.update(a.toDer(e)),C.finish(),u=C.output.getBytes(),c=a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OID,!1,a.oidToDer(o["pbeWithSHAAnd3-KeyTripleDES-CBC"]).getBytes()),a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OCTETSTRING,!1,f),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,l.getBytes())])])}return a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[c,a.create(a.Class.UNIVERSAL,a.Type.OCTETSTRING,!1,u)])},s.decryptPrivateKeyInfo=function(e,t){var r=null,i={},o=[];if(!a.validate(e,c,i,o)){var u=new Error("Cannot read encrypted private key. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw u.errors=o,u}var f=a.derToOid(i.encryptionOid),h=s.pbe.getCipher(f,i.encryptionParams,t),l=n.util.createBuffer(i.encryptedData);return h.update(l),h.finish()&&(r=a.fromDer(h.output)),r},s.encryptedPrivateKeyToPem=function(e,t){var r={type:"ENCRYPTED PRIVATE KEY",body:a.toDer(e).getBytes()};return n.pem.encode(r,{maxline:t})},s.encryptedPrivateKeyFromPem=function(e){var t=n.pem.decode(e)[0];if("ENCRYPTED PRIVATE KEY"!==t.type){var r=new Error('Could not convert encrypted private key from PEM; PEM header type is "ENCRYPTED PRIVATE KEY".');throw r.headerType=t.type,r}if(t.procType&&"ENCRYPTED"===t.procType.type)throw new Error("Could not convert encrypted private key from PEM; PEM is encrypted.");return a.fromDer(t.body)},s.encryptRsaPrivateKey=function(e,t,r){if(!(r=r||{}).legacy){var i=s.wrapRsaPrivateKey(s.privateKeyToAsn1(e));return i=s.encryptPrivateKeyInfo(i,t,r),s.encryptedPrivateKeyToPem(i)}var o,c,u,f;switch(r.algorithm){case"aes128":o="AES-128-CBC",u=16,c=n.random.getBytesSync(16),f=n.aes.createEncryptionCipher;break;case"aes192":o="AES-192-CBC",u=24,c=n.random.getBytesSync(16),f=n.aes.createEncryptionCipher;break;case"aes256":o="AES-256-CBC",u=32,c=n.random.getBytesSync(16),f=n.aes.createEncryptionCipher;break;case"3des":o="DES-EDE3-CBC",u=24,c=n.random.getBytesSync(8),f=n.des.createEncryptionCipher;break;case"des":o="DES-CBC",u=8,c=n.random.getBytesSync(8),f=n.des.createEncryptionCipher;break;default:var h=new Error('Could not encrypt RSA private key; unsupported encryption algorithm "'+r.algorithm+'".');throw h.algorithm=r.algorithm,h}var l=f(n.pbe.opensslDeriveBytes(t,c.substr(0,8),u));l.start(c),l.update(a.toDer(s.privateKeyToAsn1(e))),l.finish();var d={type:"RSA PRIVATE KEY",procType:{version:"4",type:"ENCRYPTED"},dekInfo:{algorithm:o,parameters:n.util.bytesToHex(c).toUpperCase()},body:l.output.getBytes()};return n.pem.encode(d)},s.decryptRsaPrivateKey=function(e,t){var r=null,i=n.pem.decode(e)[0];if("ENCRYPTED PRIVATE KEY"!==i.type&&"PRIVATE KEY"!==i.type&&"RSA PRIVATE KEY"!==i.type)throw(u=new Error('Could not convert private key from PEM; PEM header type is not "ENCRYPTED PRIVATE KEY", "PRIVATE KEY", or "RSA PRIVATE KEY".')).headerType=u,u;if(i.procType&&"ENCRYPTED"===i.procType.type){var o,c;switch(i.dekInfo.algorithm){case"DES-CBC":o=8,c=n.des.createDecryptionCipher;break;case"DES-EDE3-CBC":o=24,c=n.des.createDecryptionCipher;break;case"AES-128-CBC":o=16,c=n.aes.createDecryptionCipher;break;case"AES-192-CBC":o=24,c=n.aes.createDecryptionCipher;break;case"AES-256-CBC":o=32,c=n.aes.createDecryptionCipher;break;case"RC2-40-CBC":o=5,c=function(e){return n.rc2.createDecryptionCipher(e,40)};break;case"RC2-64-CBC":o=8,c=function(e){return n.rc2.createDecryptionCipher(e,64)};break;case"RC2-128-CBC":o=16,c=function(e){return n.rc2.createDecryptionCipher(e,128)};break;default:var u;throw(u=new Error('Could not decrypt private key; unsupported encryption algorithm "'+i.dekInfo.algorithm+'".')).algorithm=i.dekInfo.algorithm,u}var f=n.util.hexToBytes(i.dekInfo.parameters),h=c(n.pbe.opensslDeriveBytes(t,f.substr(0,8),o));if(h.start(f),h.update(n.util.createBuffer(i.body)),!h.finish())return r;r=h.output.getBytes()}else r=i.body;return null!==(r="ENCRYPTED PRIVATE KEY"===i.type?s.decryptPrivateKeyInfo(a.fromDer(r),t):a.fromDer(r))&&(r=s.privateKeyFromAsn1(r)),r},s.pbe.generatePkcs12Key=function(e,t,r,i,a,s){var o,c;if(null==s){if(!("sha1"in n.md))throw new Error('"sha1" hash algorithm unavailable.');s=n.md.sha1.create()}var u=s.digestLength,f=s.blockLength,h=new n.util.ByteBuffer,l=new n.util.ByteBuffer;if(null!=e){for(c=0;c<e.length;c++)l.putInt16(e.charCodeAt(c));l.putInt16(0)}var d=l.length(),p=t.length(),g=new n.util.ByteBuffer;g.fillWithByte(r,f);var y=f*Math.ceil(p/f),v=new n.util.ByteBuffer;for(c=0;c<y;c++)v.putByte(t.at(c%p));var m=f*Math.ceil(d/f),b=new n.util.ByteBuffer;for(c=0;c<m;c++)b.putByte(l.at(c%d));var w=v;w.putBuffer(b);for(var S=Math.ceil(a/u),E=1;E<=S;E++){var C=new n.util.ByteBuffer;C.putBytes(g.bytes()),C.putBytes(w.bytes());for(var A=0;A<i;A++)s.start(),s.update(C.getBytes()),C=s.digest();var B=new n.util.ByteBuffer;for(c=0;c<f;c++)B.putByte(C.at(c%u));var x=Math.ceil(p/f)+Math.ceil(d/f),T=new n.util.ByteBuffer;for(o=0;o<x;o++){var I=new n.util.ByteBuffer(w.getBytes(f)),F=511;for(c=B.length()-1;c>=0;c--)F>>=8,F+=B.at(c)+I.at(c),I.setAt(c,255&F);T.putBuffer(I)}w=T,h.putBuffer(C)}return h.truncate(h.length()-a),h},s.pbe.getCipher=function(e,t,r){switch(e){case s.oids.pkcs5PBES2:return s.pbe.getCipherForPBES2(e,t,r);case s.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case s.oids["pbewithSHAAnd40BitRC2-CBC"]:return s.pbe.getCipherForPKCS12PBE(e,t,r);default:var n=new Error("Cannot read encrypted PBE data block. Unsupported OID.");throw n.oid=e,n.supportedOids=["pkcs5PBES2","pbeWithSHAAnd3-KeyTripleDES-CBC","pbewithSHAAnd40BitRC2-CBC"],n}},s.pbe.getCipherForPBES2=function(e,t,r){var i,o={},c=[];if(!a.validate(t,u,o,c))throw(i=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.")).errors=c,i;if((e=a.derToOid(o.kdfOid))!==s.oids.pkcs5PBKDF2)throw(i=new Error("Cannot read encrypted private key. Unsupported key derivation function OID.")).oid=e,i.supportedOids=["pkcs5PBKDF2"],i;if((e=a.derToOid(o.encOid))!==s.oids["aes128-CBC"]&&e!==s.oids["aes192-CBC"]&&e!==s.oids["aes256-CBC"]&&e!==s.oids["des-EDE3-CBC"]&&e!==s.oids.desCBC)throw(i=new Error("Cannot read encrypted private key. Unsupported encryption scheme OID.")).oid=e,i.supportedOids=["aes128-CBC","aes192-CBC","aes256-CBC","des-EDE3-CBC","desCBC"],i;var f,h,d=o.kdfSalt,p=n.util.createBuffer(o.kdfIterationCount);switch(p=p.getInt(p.length()<<3),s.oids[e]){case"aes128-CBC":f=16,h=n.aes.createDecryptionCipher;break;case"aes192-CBC":f=24,h=n.aes.createDecryptionCipher;break;case"aes256-CBC":f=32,h=n.aes.createDecryptionCipher;break;case"des-EDE3-CBC":f=24,h=n.des.createDecryptionCipher;break;case"desCBC":f=8,h=n.des.createDecryptionCipher}var g=l(o.prfOid),y=n.pkcs5.pbkdf2(r,d,p,f,g),v=o.encIv,m=h(y);return m.start(v),m},s.pbe.getCipherForPKCS12PBE=function(e,t,r){var i={},o=[];if(!a.validate(t,f,i,o))throw(g=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.")).errors=o,g;var c,u,h,d=n.util.createBuffer(i.salt),p=n.util.createBuffer(i.iterations);switch(p=p.getInt(p.length()<<3),e){case s.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:c=24,u=8,h=n.des.startDecrypting;break;case s.oids["pbewithSHAAnd40BitRC2-CBC"]:c=5,u=8,h=function(e,t){var r=n.rc2.createDecryptionCipher(e,40);return r.start(t,null),r};break;default:var g;throw(g=new Error("Cannot read PKCS #12 PBE data block. Unsupported OID.")).oid=e,g}var y=l(i.prfOid),v=s.pbe.generatePkcs12Key(r,d,1,p,c,y);return y.start(),h(v,s.pbe.generatePkcs12Key(r,d,2,p,u,y))},s.pbe.opensslDeriveBytes=function(e,t,r,i){if(null==i){if(!("md5"in n.md))throw new Error('"md5" hash algorithm unavailable.');i=n.md.md5.create()}null===t&&(t="");for(var a=[h(i,e+t)],s=16,o=1;s<r;++o,s+=16)a.push(h(i,a[o-1]+e+t));return a.join("").substr(0,r)}},59065:(e,t,r)=>{var n=r(42363).Buffer,i=r(28413);r(77827),r(25853),r(23564);var a,s=i.pkcs5=i.pkcs5||{};i.util.isNodejs&&!i.options.usePureJavaScript&&(a=r(50310)),e.exports=i.pbkdf2=s.pbkdf2=function(e,t,r,s,o,c){if("function"==typeof o&&(c=o,o=null),i.util.isNodejs&&!i.options.usePureJavaScript&&a.pbkdf2&&(null===o||"object"!=typeof o)&&(a.pbkdf2Sync.length>4||!o||"sha1"===o))return"string"!=typeof o&&(o="sha1"),e=n.from(e,"binary"),t=n.from(t,"binary"),c?4===a.pbkdf2Sync.length?a.pbkdf2(e,t,r,s,(function(e,t){if(e)return c(e);c(null,t.toString("binary"))})):a.pbkdf2(e,t,r,s,o,(function(e,t){if(e)return c(e);c(null,t.toString("binary"))})):4===a.pbkdf2Sync.length?a.pbkdf2Sync(e,t,r,s).toString("binary"):a.pbkdf2Sync(e,t,r,s,o).toString("binary");if(null==o&&(o="sha1"),"string"==typeof o){if(!(o in i.md.algorithms))throw new Error("Unknown hash algorithm: "+o);o=i.md[o].create()}var u=o.digestLength;if(s>4294967295*u){var f=new Error("Derived key is too long.");if(c)return c(f);throw f}var h=Math.ceil(s/u),l=s-(h-1)*u,d=i.hmac.create();d.start(o,e);var p,g,y,v="";if(!c){for(var m=1;m<=h;++m){d.start(null,null),d.update(t),d.update(i.util.int32ToBytes(m)),p=y=d.digest().getBytes();for(var b=2;b<=r;++b)d.start(null,null),d.update(y),g=d.digest().getBytes(),p=i.util.xorBytes(p,g,u),y=g;v+=m<h?p:p.substr(0,l)}return v}function w(){if(m>h)return c(null,v);d.start(null,null),d.update(t),d.update(i.util.int32ToBytes(m)),p=y=d.digest().getBytes(),b=2,S()}function S(){if(b<=r)return d.start(null,null),d.update(y),g=d.digest().getBytes(),p=i.util.xorBytes(p,g,u),y=g,++b,i.util.setImmediate(S);v+=m<h?p:p.substr(0,l),++m,w()}m=1,w()}},67928:(e,t,r)=>{var n=r(28413);r(23564);var i=e.exports=n.pem=n.pem||{};function a(e){for(var t=e.name+": ",r=[],n=function(e,t){return" "+t},i=0;i<e.values.length;++i)r.push(e.values[i].replace(/^(\S+\r\n)/,n));t+=r.join(",")+"\r\n";var a=0,s=-1;for(i=0;i<t.length;++i,++a)if(a>65&&-1!==s){var o=t[s];","===o?(++s,t=t.substr(0,s)+"\r\n "+t.substr(s)):t=t.substr(0,s)+"\r\n"+o+t.substr(s+1),a=i-s-1,s=-1,++i}else" "!==t[i]&&"\t"!==t[i]&&","!==t[i]||(s=i);return t}function s(e){return e.replace(/^\s+/,"")}i.encode=function(e,t){t=t||{};var r,i="-----BEGIN "+e.type+"-----\r\n";if(e.procType&&(i+=a(r={name:"Proc-Type",values:[String(e.procType.version),e.procType.type]})),e.contentDomain&&(i+=a(r={name:"Content-Domain",values:[e.contentDomain]})),e.dekInfo&&(r={name:"DEK-Info",values:[e.dekInfo.algorithm]},e.dekInfo.parameters&&r.values.push(e.dekInfo.parameters),i+=a(r)),e.headers)for(var s=0;s<e.headers.length;++s)i+=a(e.headers[s]);return e.procType&&(i+="\r\n"),(i+=n.util.encode64(e.body,t.maxline||64)+"\r\n")+"-----END "+e.type+"-----\r\n"},i.decode=function(e){for(var t,r=[],i=/\s*-----BEGIN ([A-Z0-9- ]+)-----\r?\n?([\x21-\x7e\s]+?(?:\r?\n\r?\n))?([:A-Za-z0-9+\/=\s]+?)-----END \1-----/g,a=/([\x21-\x7e]+):\s*([\x21-\x7e\s^:]+)/,o=/\r?\n/;t=i.exec(e);){var c=t[1];"NEW CERTIFICATE REQUEST"===c&&(c="CERTIFICATE REQUEST");var u={type:c,procType:null,contentDomain:null,dekInfo:null,headers:[],body:n.util.decode64(t[3])};if(r.push(u),t[2]){for(var f=t[2].split(o),h=0;t&&h<f.length;){for(var l=f[h].replace(/\s+$/,""),d=h+1;d<f.length;++d){var p=f[d];if(!/\s/.test(p[0]))break;l+=p,h=d}if(t=l.match(a)){for(var g={name:t[1],values:[]},y=t[2].split(","),v=0;v<y.length;++v)g.values.push(s(y[v]));if(u.procType)if(u.contentDomain||"Content-Domain"!==g.name)if(u.dekInfo||"DEK-Info"!==g.name)u.headers.push(g);else{if(0===g.values.length)throw new Error('Invalid PEM formatted message. The "DEK-Info" header must have at least one subfield.');u.dekInfo={algorithm:y[0],parameters:y[1]||null}}else u.contentDomain=y[0]||"";else{if("Proc-Type"!==g.name)throw new Error('Invalid PEM formatted message. The first encapsulated header must be "Proc-Type".');if(2!==g.values.length)throw new Error('Invalid PEM formatted message. The "Proc-Type" header must have two subfields.');u.procType={version:y[0],type:y[1]}}}++h}if("ENCRYPTED"===u.procType&&!u.dekInfo)throw new Error('Invalid PEM formatted message. The "DEK-Info" header must be present if "Proc-Type" is "ENCRYPTED".')}}if(0===r.length)throw new Error("Invalid PEM formatted message.");return r}},26036:(e,t,r)=>{var n=r(28413);r(23564),r(93851),r(13417);var i=e.exports=n.pkcs1=n.pkcs1||{};function a(e,t,r){r||(r=n.md.sha1.create());for(var i="",a=Math.ceil(t/r.digestLength),s=0;s<a;++s){var o=String.fromCharCode(s>>24&255,s>>16&255,s>>8&255,255&s);r.start(),r.update(e+o),i+=r.digest().getBytes()}return i.substring(0,t)}i.encode_rsa_oaep=function(e,t,r){var i,s,o,c;"string"==typeof r?(i=r,s=arguments[3]||void 0,o=arguments[4]||void 0):r&&(i=r.label||void 0,s=r.seed||void 0,o=r.md||void 0,r.mgf1&&r.mgf1.md&&(c=r.mgf1.md)),o?o.start():o=n.md.sha1.create(),c||(c=o);var u=Math.ceil(e.n.bitLength()/8),f=u-2*o.digestLength-2;if(t.length>f)throw(y=new Error("RSAES-OAEP input message length is too long.")).length=t.length,y.maxLength=f,y;i||(i=""),o.update(i,"raw");for(var h=o.digest(),l="",d=f-t.length,p=0;p<d;p++)l+="\0";var g=h.getBytes()+l+""+t;if(s){if(s.length!==o.digestLength){var y;throw(y=new Error("Invalid RSAES-OAEP seed. The seed length must match the digest length.")).seedLength=s.length,y.digestLength=o.digestLength,y}}else s=n.random.getBytes(o.digestLength);var v=a(s,u-o.digestLength-1,c),m=n.util.xorBytes(g,v,g.length),b=a(m,o.digestLength,c);return"\0"+n.util.xorBytes(s,b,s.length)+m},i.decode_rsa_oaep=function(e,t,r){var i,s,o;"string"==typeof r?(i=r,s=arguments[3]||void 0):r&&(i=r.label||void 0,s=r.md||void 0,r.mgf1&&r.mgf1.md&&(o=r.mgf1.md));var c=Math.ceil(e.n.bitLength()/8);if(t.length!==c)throw(v=new Error("RSAES-OAEP encoded message length is invalid.")).length=t.length,v.expectedLength=c,v;if(void 0===s?s=n.md.sha1.create():s.start(),o||(o=s),c<2*s.digestLength+2)throw new Error("RSAES-OAEP key is too short for the hash function.");i||(i=""),s.update(i,"raw");for(var u=s.digest().getBytes(),f=t.charAt(0),h=t.substring(1,s.digestLength+1),l=t.substring(1+s.digestLength),d=a(l,s.digestLength,o),p=a(n.util.xorBytes(h,d,h.length),c-s.digestLength-1,o),g=n.util.xorBytes(l,p,l.length),y=g.substring(0,s.digestLength),v="\0"!==f,m=0;m<s.digestLength;++m)v|=u.charAt(m)!==y.charAt(m);for(var b=1,w=s.digestLength,S=s.digestLength;S<g.length;S++){var E=g.charCodeAt(S);v|=E&(b?65534:0),w+=b&=1&E^1}if(v||1!==g.charCodeAt(w))throw new Error("Invalid RSAES-OAEP padding.");return g.substring(w+1)}},30996:(e,t,r)=>{var n=r(28413);r(25129),r(77827),r(12889),r(56435),r(76259),r(93851),r(72112),r(13417),r(23564),r(14284);var i=n.asn1,a=n.pki,s=e.exports=n.pkcs12=n.pkcs12||{},o={name:"ContentInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.contentType",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:i.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"content"}]},c={name:"PFX",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"version"},o,{name:"PFX.macData",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"mac",value:[{name:"PFX.macData.mac",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"macAlgorithm"},{name:"PFX.macData.mac.digestAlgorithm.parameters",tagClass:i.Class.UNIVERSAL,captureAsn1:"macAlgorithmParameters"}]},{name:"PFX.macData.mac.digest",tagClass:i.Class.UNIVERSAL,type:i.Type.OCTETSTRING,constructed:!1,capture:"macDigest"}]},{name:"PFX.macData.macSalt",tagClass:i.Class.UNIVERSAL,type:i.Type.OCTETSTRING,constructed:!1,capture:"macSalt"},{name:"PFX.macData.iterations",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,optional:!0,capture:"macIterations"}]}]},u={name:"SafeBag",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"SafeBag.bagId",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"bagId"},{name:"SafeBag.bagValue",tagClass:i.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"bagValue"},{name:"SafeBag.bagAttributes",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,constructed:!0,optional:!0,capture:"bagAttributes"}]},f={name:"Attribute",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"Attribute.attrId",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"oid"},{name:"Attribute.attrValues",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,constructed:!0,capture:"values"}]},h={name:"CertBag",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"CertBag.certId",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"certId"},{name:"CertBag.certValue",tagClass:i.Class.CONTEXT_SPECIFIC,constructed:!0,value:[{name:"CertBag.certValue[0]",tagClass:i.Class.UNIVERSAL,type:i.Class.OCTETSTRING,constructed:!1,capture:"cert"}]}]};function l(e,t,r,n){for(var i=[],a=0;a<e.length;a++)for(var s=0;s<e[a].safeBags.length;s++){var o=e[a].safeBags[s];void 0!==n&&o.type!==n||(null!==t?void 0!==o.attributes[t]&&o.attributes[t].indexOf(r)>=0&&i.push(o):i.push(o))}return i}function d(e){if(e.composed||e.constructed){for(var t=n.util.createBuffer(),r=0;r<e.value.length;++r)t.putBytes(e.value[r].value);e.composed=e.constructed=!1,e.value=t.getBytes()}return e}function p(e,t){var r={},s=[];if(!i.validate(e,n.pkcs7.asn1.encryptedDataValidator,r,s))throw(o=new Error("Cannot read EncryptedContentInfo.")).errors=s,o;var o,c=i.derToOid(r.contentType);if(c!==a.oids.data)throw(o=new Error("PKCS#12 EncryptedContentInfo ContentType is not Data.")).oid=c,o;c=i.derToOid(r.encAlgorithm);var u=a.pbe.getCipher(c,r.encParameter,t),f=d(r.encryptedContentAsn1),h=n.util.createBuffer(f.value);if(u.update(h),!u.finish())throw new Error("Failed to decrypt PKCS#12 SafeContents.");return u.output.getBytes()}function g(e,t,r){if(!t&&0===e.length)return[];if((e=i.fromDer(e,t)).tagClass!==i.Class.UNIVERSAL||e.type!==i.Type.SEQUENCE||!0!==e.constructed)throw new Error("PKCS#12 SafeContents expected to be a SEQUENCE OF SafeBag.");for(var n=[],s=0;s<e.value.length;s++){var o=e.value[s],c={},f=[];if(!i.validate(o,u,c,f))throw(v=new Error("Cannot read SafeBag.")).errors=f,v;var l,d,p={type:i.derToOid(c.bagId),attributes:y(c.bagAttributes)};n.push(p);var g=c.bagValue.value[0];switch(p.type){case a.oids.pkcs8ShroudedKeyBag:if(null===(g=a.decryptPrivateKeyInfo(g,r)))throw new Error("Unable to decrypt PKCS#8 ShroudedKeyBag, wrong password?");case a.oids.keyBag:try{p.key=a.privateKeyFromAsn1(g)}catch(e){p.key=null,p.asn1=g}continue;case a.oids.certBag:l=h,d=function(){if(i.derToOid(c.certId)!==a.oids.x509Certificate){var e=new Error("Unsupported certificate type, only X.509 supported.");throw e.oid=i.derToOid(c.certId),e}var r=i.fromDer(c.cert,t);try{p.cert=a.certificateFromAsn1(r,!0)}catch(e){p.cert=null,p.asn1=r}};break;default:var v;throw(v=new Error("Unsupported PKCS#12 SafeBag type.")).oid=p.type,v}if(void 0!==l&&!i.validate(g,l,c,f))throw(v=new Error("Cannot read PKCS#12 "+l.name)).errors=f,v;d()}return n}function y(e){var t={};if(void 0!==e)for(var r=0;r<e.length;++r){var n={},s=[];if(!i.validate(e[r],f,n,s)){var o=new Error("Cannot read PKCS#12 BagAttribute.");throw o.errors=s,o}var c=i.derToOid(n.oid);if(void 0!==a.oids[c]){t[a.oids[c]]=[];for(var u=0;u<n.values.length;++u)t[a.oids[c]].push(n.values[u].value)}}return t}s.pkcs12FromAsn1=function(e,t,r){"string"==typeof t?(r=t,t=!0):void 0===t&&(t=!0);var u={};if(!i.validate(e,c,u,[]))throw(f=new Error("Cannot read PKCS#12 PFX. ASN.1 object is not an PKCS#12 PFX.")).errors=f,f;var f,h={version:u.version.charCodeAt(0),safeContents:[],getBags:function(e){var t,r={};return"localKeyId"in e?t=e.localKeyId:"localKeyIdHex"in e&&(t=n.util.hexToBytes(e.localKeyIdHex)),void 0===t&&!("friendlyName"in e)&&"bagType"in e&&(r[e.bagType]=l(h.safeContents,null,null,e.bagType)),void 0!==t&&(r.localKeyId=l(h.safeContents,"localKeyId",t,e.bagType)),"friendlyName"in e&&(r.friendlyName=l(h.safeContents,"friendlyName",e.friendlyName,e.bagType)),r},getBagsByFriendlyName:function(e,t){return l(h.safeContents,"friendlyName",e,t)},getBagsByLocalKeyId:function(e,t){return l(h.safeContents,"localKeyId",e,t)}};if(3!==u.version.charCodeAt(0))throw(f=new Error("PKCS#12 PFX of version other than 3 not supported.")).version=u.version.charCodeAt(0),f;if(i.derToOid(u.contentType)!==a.oids.data)throw(f=new Error("Only PKCS#12 PFX in password integrity mode supported.")).oid=i.derToOid(u.contentType),f;var y=u.content.value[0];if(y.tagClass!==i.Class.UNIVERSAL||y.type!==i.Type.OCTETSTRING)throw new Error("PKCS#12 authSafe content data is not an OCTET STRING.");if(y=d(y),u.mac){var v=null,m=0,b=i.derToOid(u.macAlgorithm);switch(b){case a.oids.sha1:v=n.md.sha1.create(),m=20;break;case a.oids.sha256:v=n.md.sha256.create(),m=32;break;case a.oids.sha384:v=n.md.sha384.create(),m=48;break;case a.oids.sha512:v=n.md.sha512.create(),m=64;break;case a.oids.md5:v=n.md.md5.create(),m=16}if(null===v)throw new Error("PKCS#12 uses unsupported MAC algorithm: "+b);var w=new n.util.ByteBuffer(u.macSalt),S="macIterations"in u?parseInt(n.util.bytesToHex(u.macIterations),16):1,E=s.generateKey(r,w,3,S,m,v),C=n.hmac.create();if(C.start(v,E),C.update(y.value),C.getMac().getBytes()!==u.macDigest)throw new Error("PKCS#12 MAC could not be verified. Invalid password?")}return function(e,t,r,n){if((t=i.fromDer(t,r)).tagClass!==i.Class.UNIVERSAL||t.type!==i.Type.SEQUENCE||!0!==t.constructed)throw new Error("PKCS#12 AuthenticatedSafe expected to be a SEQUENCE OF ContentInfo");for(var s=0;s<t.value.length;s++){var c=t.value[s],u={},f=[];if(!i.validate(c,o,u,f))throw(v=new Error("Cannot read ContentInfo.")).errors=f,v;var h={encrypted:!1},l=null,y=u.content.value[0];switch(i.derToOid(u.contentType)){case a.oids.data:if(y.tagClass!==i.Class.UNIVERSAL||y.type!==i.Type.OCTETSTRING)throw new Error("PKCS#12 SafeContents Data is not an OCTET STRING.");l=d(y).value;break;case a.oids.encryptedData:l=p(y,n),h.encrypted=!0;break;default:var v;throw(v=new Error("Unsupported PKCS#12 contentType.")).contentType=i.derToOid(u.contentType),v}h.safeBags=g(l,r,n),e.safeContents.push(h)}}(h,y.value,t,r),h},s.toPkcs12Asn1=function(e,t,r,o){(o=o||{}).saltSize=o.saltSize||8,o.count=o.count||2048,o.algorithm=o.algorithm||o.encAlgorithm||"aes128","useMac"in o||(o.useMac=!0),"localKeyId"in o||(o.localKeyId=null),"generateLocalKeyId"in o||(o.generateLocalKeyId=!0);var c,u=o.localKeyId;if(null!==u)u=n.util.hexToBytes(u);else if(o.generateLocalKeyId)if(t){var f=n.util.isArray(t)?t[0]:t;"string"==typeof f&&(f=a.certificateFromPem(f)),(T=n.md.sha1.create()).update(i.toDer(a.certificateToAsn1(f)).getBytes()),u=T.digest().getBytes()}else u=n.random.getBytes(20);var h=[];null!==u&&h.push(i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(a.oids.localKeyId).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SET,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,u)])])),"friendlyName"in o&&h.push(i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(a.oids.friendlyName).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SET,!0,[i.create(i.Class.UNIVERSAL,i.Type.BMPSTRING,!1,o.friendlyName)])])),h.length>0&&(c=i.create(i.Class.UNIVERSAL,i.Type.SET,!0,h));var l=[],d=[];null!==t&&(d=n.util.isArray(t)?t:[t]);for(var p=[],g=0;g<d.length;++g){"string"==typeof(t=d[g])&&(t=a.certificateFromPem(t));var y=0===g?c:void 0,v=a.certificateToAsn1(t),m=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(a.oids.certBag).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(a.oids.x509Certificate).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,i.toDer(v).getBytes())])])]),y]);p.push(m)}if(p.length>0){var b=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,p),w=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(a.oids.data).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,i.toDer(b).getBytes())])]);l.push(w)}var S=null;if(null!==e){var E=a.wrapRsaPrivateKey(a.privateKeyToAsn1(e));S=null===r?i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(a.oids.keyBag).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[E]),c]):i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(a.oids.pkcs8ShroudedKeyBag).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[a.encryptPrivateKeyInfo(E,r,o)]),c]);var C=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[S]),A=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(a.oids.data).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,i.toDer(C).getBytes())])]);l.push(A)}var B,x=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,l);if(o.useMac){var T=n.md.sha1.create(),I=new n.util.ByteBuffer(n.random.getBytes(o.saltSize)),F=o.count,k=(e=s.generateKey(r,I,3,F,20),n.hmac.create());k.start(T,e),k.update(i.toDer(x).getBytes());var R=k.getMac();B=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(a.oids.sha1).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")]),i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,R.getBytes())]),i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,I.getBytes()),i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(F).getBytes())])}return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(3).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(a.oids.data).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,i.toDer(x).getBytes())])]),B])},s.generateKey=n.pbe.generatePkcs12Key},43474:(e,t,r)=>{var n=r(28413);r(72057),r(25129),r(35690),r(12889),r(67928),r(56435),r(93851),r(23564),r(14284);var i=n.asn1,a=e.exports=n.pkcs7=n.pkcs7||{};function s(e){var t={},r=[];if(!i.validate(e,a.asn1.recipientInfoValidator,t,r)){var s=new Error("Cannot read PKCS#7 RecipientInfo. ASN.1 object is not an PKCS#7 RecipientInfo.");throw s.errors=r,s}return{version:t.version.charCodeAt(0),issuer:n.pki.RDNAttributesAsArray(t.issuer),serialNumber:n.util.createBuffer(t.serial).toHex(),encryptedContent:{algorithm:i.derToOid(t.encAlgorithm),parameter:t.encParameter?t.encParameter.value:void 0,content:t.encKey}}}function o(e){for(var t,r=[],a=0;a<e.length;++a)r.push((t=e[a],i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(t.version).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[n.pki.distinguishedNameToAsn1({attributes:t.issuer}),i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,n.util.hexToBytes(t.serialNumber))]),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(t.encryptedContent.algorithm).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")]),i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,t.encryptedContent.content)])));return r}function c(e){var t=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(e.version).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[n.pki.distinguishedNameToAsn1({attributes:e.issuer}),i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,n.util.hexToBytes(e.serialNumber))]),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.digestAlgorithm).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")])]);if(e.authenticatedAttributesAsn1&&t.value.push(e.authenticatedAttributesAsn1),t.value.push(i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.signatureAlgorithm).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")])),t.value.push(i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,e.signature)),e.unauthenticatedAttributes.length>0){for(var r=i.create(i.Class.CONTEXT_SPECIFIC,1,!0,[]),a=0;a<e.unauthenticatedAttributes.length;++a){var s=e.unauthenticatedAttributes[a];r.values.push(u(s))}t.value.push(r)}return t}function u(e){var t;if(e.type===n.pki.oids.contentType)t=i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.value).getBytes());else if(e.type===n.pki.oids.messageDigest)t=i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,e.value.bytes());else if(e.type===n.pki.oids.signingTime){var r=new Date("1950-01-01T00:00:00Z"),a=new Date("2050-01-01T00:00:00Z"),s=e.value;if("string"==typeof s){var o=Date.parse(s);s=isNaN(o)?13===s.length?i.utcTimeToDate(s):i.generalizedTimeToDate(s):new Date(o)}t=s>=r&&s<a?i.create(i.Class.UNIVERSAL,i.Type.UTCTIME,!1,i.dateToUtcTime(s)):i.create(i.Class.UNIVERSAL,i.Type.GENERALIZEDTIME,!1,i.dateToGeneralizedTime(s))}return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.type).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SET,!0,[t])])}function f(e,t,r){var a={};if(!i.validate(t,r,a,[])){var s=new Error("Cannot read PKCS#7 message. ASN.1 object is not a supported PKCS#7 message.");throw s.errors=s,s}if(i.derToOid(a.contentType)!==n.pki.oids.data)throw new Error("Unsupported PKCS#7 message. Only wrapped ContentType Data supported.");if(a.encryptedContent){var o="";if(n.util.isArray(a.encryptedContent))for(var c=0;c<a.encryptedContent.length;++c){if(a.encryptedContent[c].type!==i.Type.OCTETSTRING)throw new Error("Malformed PKCS#7 message, expecting encrypted content constructed of only OCTET STRING objects.");o+=a.encryptedContent[c].value}else o=a.encryptedContent;e.encryptedContent={algorithm:i.derToOid(a.encAlgorithm),parameter:n.util.createBuffer(a.encParameter.value),content:n.util.createBuffer(o)}}if(a.content){if(o="",n.util.isArray(a.content))for(c=0;c<a.content.length;++c){if(a.content[c].type!==i.Type.OCTETSTRING)throw new Error("Malformed PKCS#7 message, expecting content constructed of only OCTET STRING objects.");o+=a.content[c].value}else o=a.content;e.content=n.util.createBuffer(o)}return e.version=a.version.charCodeAt(0),e.rawCapture=a,a}function h(e){if(void 0===e.encryptedContent.key)throw new Error("Symmetric key not available.");if(void 0===e.content){var t;switch(e.encryptedContent.algorithm){case n.pki.oids["aes128-CBC"]:case n.pki.oids["aes192-CBC"]:case n.pki.oids["aes256-CBC"]:t=n.aes.createDecryptionCipher(e.encryptedContent.key);break;case n.pki.oids.desCBC:case n.pki.oids["des-EDE3-CBC"]:t=n.des.createDecryptionCipher(e.encryptedContent.key);break;default:throw new Error("Unsupported symmetric cipher, OID "+e.encryptedContent.algorithm)}if(t.start(e.encryptedContent.parameter),t.update(e.encryptedContent.content),!t.finish())throw new Error("Symmetric decryption failed.");e.content=t.output}}a.messageFromPem=function(e){var t=n.pem.decode(e)[0];if("PKCS7"!==t.type){var r=new Error('Could not convert PKCS#7 message from PEM; PEM header type is not "PKCS#7".');throw r.headerType=t.type,r}if(t.procType&&"ENCRYPTED"===t.procType.type)throw new Error("Could not convert PKCS#7 message from PEM; PEM is encrypted.");var s=i.fromDer(t.body);return a.messageFromAsn1(s)},a.messageToPem=function(e,t){var r={type:"PKCS7",body:i.toDer(e.toAsn1()).getBytes()};return n.pem.encode(r,{maxline:t})},a.messageFromAsn1=function(e){var t={},r=[];if(!i.validate(e,a.asn1.contentInfoValidator,t,r)){var s=new Error("Cannot read PKCS#7 message. ASN.1 object is not an PKCS#7 ContentInfo.");throw s.errors=r,s}var o,c=i.derToOid(t.contentType);switch(c){case n.pki.oids.envelopedData:o=a.createEnvelopedData();break;case n.pki.oids.encryptedData:o=a.createEncryptedData();break;case n.pki.oids.signedData:o=a.createSignedData();break;default:throw new Error("Cannot read PKCS#7 message. ContentType with OID "+c+" is not (yet) supported.")}return o.fromAsn1(t.content.value[0]),o},a.createSignedData=function(){var e=null;return e={type:n.pki.oids.signedData,version:1,certificates:[],crls:[],signers:[],digestAlgorithmIdentifiers:[],contentInfo:null,signerInfos:[],fromAsn1:function(t){if(f(e,t,a.asn1.signedDataValidator),e.certificates=[],e.crls=[],e.digestAlgorithmIdentifiers=[],e.contentInfo=null,e.signerInfos=[],e.rawCapture.certificates)for(var r=e.rawCapture.certificates.value,i=0;i<r.length;++i)e.certificates.push(n.pki.certificateFromAsn1(r[i]))},toAsn1:function(){e.contentInfo||e.sign();for(var t=[],r=0;r<e.certificates.length;++r)t.push(n.pki.certificateToAsn1(e.certificates[r]));var a=[],s=i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(e.version).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SET,!0,e.digestAlgorithmIdentifiers),e.contentInfo])]);return t.length>0&&s.value[0].value.push(i.create(i.Class.CONTEXT_SPECIFIC,0,!0,t)),a.length>0&&s.value[0].value.push(i.create(i.Class.CONTEXT_SPECIFIC,1,!0,a)),s.value[0].value.push(i.create(i.Class.UNIVERSAL,i.Type.SET,!0,e.signerInfos)),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.type).getBytes()),s])},addSigner:function(t){var r=t.issuer,i=t.serialNumber;if(t.certificate){var a=t.certificate;"string"==typeof a&&(a=n.pki.certificateFromPem(a)),r=a.issuer.attributes,i=a.serialNumber}var s=t.key;if(!s)throw new Error("Could not add PKCS#7 signer; no private key specified.");"string"==typeof s&&(s=n.pki.privateKeyFromPem(s));var o=t.digestAlgorithm||n.pki.oids.sha1;switch(o){case n.pki.oids.sha1:case n.pki.oids.sha256:case n.pki.oids.sha384:case n.pki.oids.sha512:case n.pki.oids.md5:break;default:throw new Error("Could not add PKCS#7 signer; unknown message digest algorithm: "+o)}var c=t.authenticatedAttributes||[];if(c.length>0){for(var u=!1,f=!1,h=0;h<c.length;++h){var l=c[h];if(u||l.type!==n.pki.oids.contentType){if(f||l.type!==n.pki.oids.messageDigest);else if(f=!0,u)break}else if(u=!0,f)break}if(!u||!f)throw new Error("Invalid signer.authenticatedAttributes. If signer.authenticatedAttributes is specified, then it must contain at least two attributes, PKCS #9 content-type and PKCS #9 message-digest.")}e.signers.push({key:s,version:1,issuer:r,serialNumber:i,digestAlgorithm:o,signatureAlgorithm:n.pki.oids.rsaEncryption,signature:null,authenticatedAttributes:c,unauthenticatedAttributes:[]})},sign:function(t){var r;t=t||{},("object"!=typeof e.content||null===e.contentInfo)&&(e.contentInfo=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(n.pki.oids.data).getBytes())]),"content"in e&&(e.content instanceof n.util.ByteBuffer?r=e.content.bytes():"string"==typeof e.content&&(r=n.util.encodeUtf8(e.content)),t.detached?e.detachedContent=i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,r):e.contentInfo.value.push(i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,r)])))),0!==e.signers.length&&function(t){var r;if(!(r=e.detachedContent?e.detachedContent:(r=e.contentInfo.value[1]).value[0]))throw new Error("Could not sign PKCS#7 message; there is no content to sign.");var a=i.derToOid(e.contentInfo.value[0].value),s=i.toDer(r);for(var o in s.getByte(),i.getBerValueLength(s),s=s.getBytes(),t)t[o].start().update(s);for(var f=new Date,h=0;h<e.signers.length;++h){var l=e.signers[h];if(0===l.authenticatedAttributes.length){if(a!==n.pki.oids.data)throw new Error("Invalid signer; authenticatedAttributes must be present when the ContentInfo content type is not PKCS#7 Data.")}else{l.authenticatedAttributesAsn1=i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[]);for(var d=i.create(i.Class.UNIVERSAL,i.Type.SET,!0,[]),p=0;p<l.authenticatedAttributes.length;++p){var g=l.authenticatedAttributes[p];g.type===n.pki.oids.messageDigest?g.value=t[l.digestAlgorithm].digest():g.type===n.pki.oids.signingTime&&(g.value||(g.value=f)),d.value.push(u(g)),l.authenticatedAttributesAsn1.value.push(u(g))}s=i.toDer(d).getBytes(),l.md.start().update(s)}l.signature=l.key.sign(l.md,"RSASSA-PKCS1-V1_5")}e.signerInfos=function(e){for(var t=[],r=0;r<e.length;++r)t.push(c(e[r]));return t}(e.signers)}(function(){for(var t={},r=0;r<e.signers.length;++r){var a=e.signers[r];(s=a.digestAlgorithm)in t||(t[s]=n.md[n.pki.oids[s]].create()),0===a.authenticatedAttributes.length?a.md=t[s]:a.md=n.md[n.pki.oids[s]].create()}for(var s in e.digestAlgorithmIdentifiers=[],t)e.digestAlgorithmIdentifiers.push(i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(s).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")]));return t}())},verify:function(){throw new Error("PKCS#7 signature verification not yet implemented.")},addCertificate:function(t){"string"==typeof t&&(t=n.pki.certificateFromPem(t)),e.certificates.push(t)},addCertificateRevokationList:function(e){throw new Error("PKCS#7 CRL support not yet implemented.")}}},a.createEncryptedData=function(){var e=null;return e={type:n.pki.oids.encryptedData,version:0,encryptedContent:{algorithm:n.pki.oids["aes256-CBC"]},fromAsn1:function(t){f(e,t,a.asn1.encryptedDataValidator)},decrypt:function(t){void 0!==t&&(e.encryptedContent.key=t),h(e)}}},a.createEnvelopedData=function(){var e=null;return e={type:n.pki.oids.envelopedData,version:0,recipients:[],encryptedContent:{algorithm:n.pki.oids["aes256-CBC"]},fromAsn1:function(t){var r=f(e,t,a.asn1.envelopedDataValidator);e.recipients=function(e){for(var t=[],r=0;r<e.length;++r)t.push(s(e[r]));return t}(r.recipientInfos.value)},toAsn1:function(){return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.type).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(e.version).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SET,!0,o(e.recipients)),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,(t=e.encryptedContent,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(n.pki.oids.data).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(t.algorithm).getBytes()),t.parameter?i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,t.parameter.getBytes()):void 0]),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,t.content.getBytes())])]))])])]);var t},findRecipient:function(t){for(var r=t.issuer.attributes,n=0;n<e.recipients.length;++n){var i=e.recipients[n],a=i.issuer;if(i.serialNumber===t.serialNumber&&a.length===r.length){for(var s=!0,o=0;o<r.length;++o)if(a[o].type!==r[o].type||a[o].value!==r[o].value){s=!1;break}if(s)return i}}return null},decrypt:function(t,r){if(void 0===e.encryptedContent.key&&void 0!==t&&void 0!==r)switch(t.encryptedContent.algorithm){case n.pki.oids.rsaEncryption:case n.pki.oids.desCBC:var i=r.decrypt(t.encryptedContent.content);e.encryptedContent.key=n.util.createBuffer(i);break;default:throw new Error("Unsupported asymmetric cipher, OID "+t.encryptedContent.algorithm)}h(e)},addRecipient:function(t){e.recipients.push({version:0,issuer:t.issuer.attributes,serialNumber:t.serialNumber,encryptedContent:{algorithm:n.pki.oids.rsaEncryption,key:t.publicKey}})},encrypt:function(t,r){if(void 0===e.encryptedContent.content){var i,a,s;switch(r=r||e.encryptedContent.algorithm,t=t||e.encryptedContent.key,r){case n.pki.oids["aes128-CBC"]:i=16,a=16,s=n.aes.createEncryptionCipher;break;case n.pki.oids["aes192-CBC"]:i=24,a=16,s=n.aes.createEncryptionCipher;break;case n.pki.oids["aes256-CBC"]:i=32,a=16,s=n.aes.createEncryptionCipher;break;case n.pki.oids["des-EDE3-CBC"]:i=24,a=8,s=n.des.createEncryptionCipher;break;default:throw new Error("Unsupported symmetric cipher, OID "+r)}if(void 0===t)t=n.util.createBuffer(n.random.getBytes(i));else if(t.length()!=i)throw new Error("Symmetric key has wrong length; got "+t.length()+" bytes, expected "+i+".");e.encryptedContent.algorithm=r,e.encryptedContent.key=t,e.encryptedContent.parameter=n.util.createBuffer(n.random.getBytes(a));var o=s(t);if(o.start(e.encryptedContent.parameter.copy()),o.update(e.content),!o.finish())throw new Error("Symmetric encryption failed.");e.encryptedContent.content=o.output}for(var c=0;c<e.recipients.length;++c){var u=e.recipients[c];if(void 0===u.encryptedContent.content){if(u.encryptedContent.algorithm!==n.pki.oids.rsaEncryption)throw new Error("Unsupported asymmetric cipher, OID "+u.encryptedContent.algorithm);u.encryptedContent.content=u.encryptedContent.key.encrypt(e.encryptedContent.key.data)}}}}}},56435:(e,t,r)=>{var n=r(28413);r(25129),r(23564);var i=n.asn1,a=e.exports=n.pkcs7asn1=n.pkcs7asn1||{};n.pkcs7=n.pkcs7||{},n.pkcs7.asn1=a;var s={name:"ContentInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.ContentType",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,captureAsn1:"content"}]};a.contentInfoValidator=s;var o={name:"EncryptedContentInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentType",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"contentType"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentEncryptionAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm.parameter",tagClass:i.Class.UNIVERSAL,captureAsn1:"encParameter"}]},{name:"EncryptedContentInfo.encryptedContent",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,capture:"encryptedContent",captureAsn1:"encryptedContentAsn1"}]};a.envelopedDataValidator={name:"EnvelopedData",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"EnvelopedData.Version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"version"},{name:"EnvelopedData.RecipientInfos",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,constructed:!0,captureAsn1:"recipientInfos"}].concat(o)},a.encryptedDataValidator={name:"EncryptedData",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedData.Version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"version"}].concat(o)};var c={name:"SignerInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1},{name:"SignerInfo.issuerAndSerialNumber",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.issuerAndSerialNumber.issuer",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"SignerInfo.issuerAndSerialNumber.serialNumber",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"SignerInfo.digestAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.digestAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"digestAlgorithm"},{name:"SignerInfo.digestAlgorithm.parameter",tagClass:i.Class.UNIVERSAL,constructed:!1,captureAsn1:"digestParameter",optional:!0}]},{name:"SignerInfo.authenticatedAttributes",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"authenticatedAttributes"},{name:"SignerInfo.digestEncryptionAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,capture:"signatureAlgorithm"},{name:"SignerInfo.encryptedDigest",tagClass:i.Class.UNIVERSAL,type:i.Type.OCTETSTRING,constructed:!1,capture:"signature"},{name:"SignerInfo.unauthenticatedAttributes",tagClass:i.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,capture:"unauthenticatedAttributes"}]};a.signedDataValidator={name:"SignedData",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"SignedData.Version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"version"},{name:"SignedData.DigestAlgorithms",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,constructed:!0,captureAsn1:"digestAlgorithms"},s,{name:"SignedData.Certificates",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,optional:!0,captureAsn1:"certificates"},{name:"SignedData.CertificateRevocationLists",tagClass:i.Class.CONTEXT_SPECIFIC,type:1,optional:!0,captureAsn1:"crls"},{name:"SignedData.SignerInfos",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,capture:"signerInfos",optional:!0,value:[c]}]},a.recipientInfoValidator={name:"RecipientInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"version"},{name:"RecipientInfo.issuerAndSerial",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.issuerAndSerial.issuer",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"RecipientInfo.issuerAndSerial.serialNumber",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"RecipientInfo.keyEncryptionAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.keyEncryptionAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"RecipientInfo.keyEncryptionAlgorithm.parameter",tagClass:i.Class.UNIVERSAL,constructed:!1,captureAsn1:"encParameter",optional:!0}]},{name:"RecipientInfo.encryptedKey",tagClass:i.Class.UNIVERSAL,type:i.Type.OCTETSTRING,constructed:!1,capture:"encKey"}]}},3174:(e,t,r)=>{var n=r(28413);r(25129),r(12889),r(76259),r(67928),r(59065),r(30996),r(26892),r(72112),r(23564),r(14284);var i=n.asn1,a=e.exports=n.pki=n.pki||{};a.pemToDer=function(e){var t=n.pem.decode(e)[0];if(t.procType&&"ENCRYPTED"===t.procType.type)throw new Error("Could not convert PEM to DER; PEM is encrypted.");return n.util.createBuffer(t.body)},a.privateKeyFromPem=function(e){var t=n.pem.decode(e)[0];if("PRIVATE KEY"!==t.type&&"RSA PRIVATE KEY"!==t.type){var r=new Error('Could not convert private key from PEM; PEM header type is not "PRIVATE KEY" or "RSA PRIVATE KEY".');throw r.headerType=t.type,r}if(t.procType&&"ENCRYPTED"===t.procType.type)throw new Error("Could not convert private key from PEM; PEM is encrypted.");var s=i.fromDer(t.body);return a.privateKeyFromAsn1(s)},a.privateKeyToPem=function(e,t){var r={type:"RSA PRIVATE KEY",body:i.toDer(a.privateKeyToAsn1(e)).getBytes()};return n.pem.encode(r,{maxline:t})},a.privateKeyInfoToPem=function(e,t){var r={type:"PRIVATE KEY",body:i.toDer(e).getBytes()};return n.pem.encode(r,{maxline:t})}},16721:(e,t,r)=>{var n=r(28413);r(23564),r(29127),r(93851),function(){if(n.prime)e.exports=n.prime;else{var t=e.exports=n.prime=n.prime||{},r=n.jsbn.BigInteger,i=[6,4,2,4,2,4,6,2],a=new r(null);a.fromInt(30);var s=function(e,t){return e|t};t.generateProbablePrime=function(e,t,i){"function"==typeof t&&(i=t,t={});var a=(t=t||{}).algorithm||"PRIMEINC";"string"==typeof a&&(a={name:a}),a.options=a.options||{};var s=t.prng||n.random,c={nextBytes:function(e){for(var t=s.getBytesSync(e.length),r=0;r<e.length;++r)e[r]=t.charCodeAt(r)}};if("PRIMEINC"===a.name)return function(e,t,i,a){return"workers"in i?function(e,t,i,a){if("undefined"==typeof Worker)return o(e,t,i,a);var s=u(e,t),c=i.workers,f=i.workLoad||100,h=30*f/8,l=i.workerScript||"forge/prime.worker.js";if(-1===c)return n.util.estimateCores((function(e,t){e&&(t=2),c=t-1,d()}));function d(){c=Math.max(1,c);for(var n=[],i=0;i<c;++i)n[i]=new Worker(l);for(i=0;i<c;++i)n[i].addEventListener("message",d);var o=!1;function d(i){if(!o){var c=i.data;if(c.found){for(var l=0;l<n.length;++l)n[l].terminate();return o=!0,a(null,new r(c.prime,16))}s.bitLength()>e&&(s=u(e,t));var d=s.toString(16);i.target.postMessage({hex:d,workLoad:f}),s.dAddOffset(h,0)}}}d()}(e,t,i,a):o(e,t,i,a)}(e,c,a.options,i);throw new Error("Invalid prime generation algorithm: "+a.name)}}function o(e,t,r,n){var i=u(e,t),a=function(e){return e<=100?27:e<=150?18:e<=200?15:e<=250?12:e<=300?9:e<=350?8:e<=400?7:e<=500?6:e<=600?5:e<=800?4:e<=1250?3:2}(i.bitLength());"millerRabinTests"in r&&(a=r.millerRabinTests);var s=10;"maxBlockTime"in r&&(s=r.maxBlockTime),c(i,e,t,0,a,s,n)}function c(e,t,r,a,s,o,f){var h=+new Date;do{if(e.bitLength()>t&&(e=u(t,r)),e.isProbablePrime(s))return f(null,e);e.dAddOffset(i[a++%8],0)}while(o<0||+new Date-h<o);n.util.setImmediate((function(){c(e,t,r,a,s,o,f)}))}function u(e,t){var n=new r(e,t),i=e-1;return n.testBit(i)||n.bitwiseTo(r.ONE.shiftLeft(i),s,n),n.dAddOffset(31-n.mod(a).byteValue(),0),n}}()},71177:(e,t,r)=>{var n=r(35208),i=r(28413);r(23564);var a=null;!i.util.isNodejs||i.options.usePureJavaScript||n.versions["node-webkit"]||(a=r(50310)),(e.exports=i.prng=i.prng||{}).create=function(e){for(var t={plugin:e,key:null,seed:null,time:null,reseeds:0,generated:0,keyBytes:""},r=e.md,n=new Array(32),s=0;s<32;++s)n[s]=r.create();function o(){if(t.pools[0].messageLength>=32)return c();var e=32-t.pools[0].messageLength<<5;t.collect(t.seedFileSync(e)),c()}function c(){t.reseeds=4294967295===t.reseeds?0:t.reseeds+1;var e=t.plugin.md.create();e.update(t.keyBytes);for(var r=1,n=0;n<32;++n)t.reseeds%r==0&&(e.update(t.pools[n].digest().getBytes()),t.pools[n].start()),r<<=1;t.keyBytes=e.digest().getBytes(),e.start(),e.update(t.keyBytes);var i=e.digest().getBytes();t.key=t.plugin.formatKey(t.keyBytes),t.seed=t.plugin.formatSeed(i),t.generated=0}function u(e){var t=null,r=i.util.globalScope,n=r.crypto||r.msCrypto;n&&n.getRandomValues&&(t=function(e){return n.getRandomValues(e)});var a=i.util.createBuffer();if(t)for(;a.length()<e;){var s=Math.max(1,Math.min(e-a.length(),65536)/4),o=new Uint32Array(Math.floor(s));try{t(o);for(var c=0;c<o.length;++c)a.putInt32(o[c])}catch(e){if(!("undefined"!=typeof QuotaExceededError&&e instanceof QuotaExceededError))throw e}}if(a.length()<e)for(var u,f,h,l=Math.floor(65536*Math.random());a.length()<e;)for(f=16807*(65535&l),f+=(32767&(u=16807*(l>>16)))<<16,l=4294967295&(f=(2147483647&(f+=u>>15))+(f>>31)),c=0;c<3;++c)h=l>>>(c<<3),h^=Math.floor(256*Math.random()),a.putByte(255&h);return a.getBytes(e)}return t.pools=n,t.pool=0,t.generate=function(e,r){if(!r)return t.generateSync(e);var n=t.plugin.cipher,a=t.plugin.increment,s=t.plugin.formatKey,o=t.plugin.formatSeed,u=i.util.createBuffer();t.key=null,function f(h){if(h)return r(h);if(u.length()>=e)return r(null,u.getBytes(e));if(t.generated>1048575&&(t.key=null),null===t.key)return i.util.nextTick((function(){!function(e){if(t.pools[0].messageLength>=32)return c(),e();var r=32-t.pools[0].messageLength<<5;t.seedFile(r,(function(r,n){if(r)return e(r);t.collect(n),c(),e()}))}(f)}));var l=n(t.key,t.seed);t.generated+=l.length,u.putBytes(l),t.key=s(n(t.key,a(t.seed))),t.seed=o(n(t.key,t.seed)),i.util.setImmediate(f)}()},t.generateSync=function(e){var r=t.plugin.cipher,n=t.plugin.increment,a=t.plugin.formatKey,s=t.plugin.formatSeed;t.key=null;for(var c=i.util.createBuffer();c.length()<e;){t.generated>1048575&&(t.key=null),null===t.key&&o();var u=r(t.key,t.seed);t.generated+=u.length,c.putBytes(u),t.key=a(r(t.key,n(t.seed))),t.seed=s(r(t.key,t.seed))}return c.getBytes(e)},a?(t.seedFile=function(e,t){a.randomBytes(e,(function(e,r){if(e)return t(e);t(null,r.toString())}))},t.seedFileSync=function(e){return a.randomBytes(e).toString()}):(t.seedFile=function(e,t){try{t(null,u(e))}catch(e){t(e)}},t.seedFileSync=u),t.collect=function(e){for(var r=e.length,n=0;n<r;++n)t.pools[t.pool].update(e.substr(n,1)),t.pool=31===t.pool?0:t.pool+1},t.collectInt=function(e,r){for(var n="",i=0;i<r;i+=8)n+=String.fromCharCode(e>>i&255);t.collect(n)},t.registerWorker=function(e){e===self?t.seedFile=function(e,t){self.addEventListener("message",(function e(r){var n=r.data;n.forge&&n.forge.prng&&(self.removeEventListener("message",e),t(n.forge.prng.err,n.forge.prng.bytes))})),self.postMessage({forge:{prng:{needed:e}}})}:e.addEventListener("message",(function(r){var n=r.data;n.forge&&n.forge.prng&&t.seedFile(n.forge.prng.needed,(function(t,r){e.postMessage({forge:{prng:{err:t,bytes:r}}})}))}))},t}},26892:(e,t,r)=>{var n=r(28413);r(93851),r(23564),(e.exports=n.pss=n.pss||{}).create=function(e){3===arguments.length&&(e={md:arguments[0],mgf:arguments[1],saltLength:arguments[2]});var t,r=e.md,i=e.mgf,a=r.digestLength,s=e.salt||null;if("string"==typeof s&&(s=n.util.createBuffer(s)),"saltLength"in e)t=e.saltLength;else{if(null===s)throw new Error("Salt length not specified or specific salt not given.");t=s.length()}if(null!==s&&s.length()!==t)throw new Error("Given salt length does not match length of given salt.");var o=e.prng||n.random;return{encode:function(e,c){var u,f,h=c-1,l=Math.ceil(h/8),d=e.digest().getBytes();if(l<a+t+2)throw new Error("Message is too long to encrypt.");f=null===s?o.getBytesSync(t):s.bytes();var p=new n.util.ByteBuffer;p.fillWithByte(0,8),p.putBytes(d),p.putBytes(f),r.start(),r.update(p.getBytes());var g=r.digest().getBytes(),y=new n.util.ByteBuffer;y.fillWithByte(0,l-t-a-2),y.putByte(1),y.putBytes(f);var v=y.getBytes(),m=l-a-1,b=i.generate(g,m),w="";for(u=0;u<m;u++)w+=String.fromCharCode(v.charCodeAt(u)^b.charCodeAt(u));var S=65280>>8*l-h&255;return(w=String.fromCharCode(w.charCodeAt(0)&~S)+w.substr(1))+g+String.fromCharCode(188)},verify:function(e,s,o){var c,u=o-1,f=Math.ceil(u/8);if(s=s.substr(-f),f<a+t+2)throw new Error("Inconsistent parameters to PSS signature verification.");if(188!==s.charCodeAt(f-1))throw new Error("Encoded message does not end in 0xBC.");var h=f-a-1,l=s.substr(0,h),d=s.substr(h,a),p=65280>>8*f-u&255;if(l.charCodeAt(0)&p)throw new Error("Bits beyond keysize not zero as expected.");var g=i.generate(d,h),y="";for(c=0;c<h;c++)y+=String.fromCharCode(l.charCodeAt(c)^g.charCodeAt(c));y=String.fromCharCode(y.charCodeAt(0)&~p)+y.substr(1);var v=f-a-t-2;for(c=0;c<v;c++)if(0!==y.charCodeAt(c))throw new Error("Leftmost octets not zero as expected");if(1!==y.charCodeAt(v))throw new Error("Inconsistent PSS signature, 0x01 marker not found");var m=y.substr(-t),b=new n.util.ByteBuffer;return b.fillWithByte(0,8),b.putBytes(e),b.putBytes(m),r.start(),r.update(b.getBytes()),d===r.digest().getBytes()}}}},93851:(e,t,r)=>{var n=r(28413);r(72057),r(24955),r(71177),r(23564),n.random&&n.random.getBytes?e.exports=n.random:function(t){var r={},i=new Array(4),a=n.util.createBuffer();function s(){var e=n.prng.create(r);return e.getBytes=function(t,r){return e.generate(t,r)},e.getBytesSync=function(t){return e.generate(t)},e}r.formatKey=function(e){var t=n.util.createBuffer(e);return(e=new Array(4))[0]=t.getInt32(),e[1]=t.getInt32(),e[2]=t.getInt32(),e[3]=t.getInt32(),n.aes._expandKey(e,!1)},r.formatSeed=function(e){var t=n.util.createBuffer(e);return(e=new Array(4))[0]=t.getInt32(),e[1]=t.getInt32(),e[2]=t.getInt32(),e[3]=t.getInt32(),e},r.cipher=function(e,t){return n.aes._updateBlock(e,t,i,!1),a.putInt32(i[0]),a.putInt32(i[1]),a.putInt32(i[2]),a.putInt32(i[3]),a.getBytes()},r.increment=function(e){return++e[3],e},r.md=n.md.sha256;var o=s(),c=null,u=n.util.globalScope,f=u.crypto||u.msCrypto;if(f&&f.getRandomValues&&(c=function(e){return f.getRandomValues(e)}),n.options.usePureJavaScript||!n.util.isNodejs&&!c){if("undefined"==typeof window||window.document,o.collectInt(+new Date,32),"undefined"!=typeof navigator){var h="";for(var l in navigator)try{"string"==typeof navigator[l]&&(h+=navigator[l])}catch(e){}o.collect(h),h=null}t&&(t().mousemove((function(e){o.collectInt(e.clientX,16),o.collectInt(e.clientY,16)})),t().keypress((function(e){o.collectInt(e.charCode,8)})))}if(n.random)for(var l in o)n.random[l]=o[l];else n.random=o;n.random.createInstance=s,e.exports=n.random}(!1)},94281:(e,t,r)=>{var n=r(28413);r(23564);var i=[217,120,249,196,25,221,181,237,40,233,253,121,74,160,216,157,198,126,55,131,43,118,83,142,98,76,100,136,68,139,251,162,23,154,89,245,135,179,79,19,97,69,109,141,9,129,125,50,189,143,64,235,134,183,123,11,240,149,33,34,92,107,78,130,84,214,101,147,206,96,178,28,115,86,192,20,167,140,241,220,18,117,202,31,59,190,228,209,66,61,212,48,163,60,182,38,111,191,14,218,70,105,7,87,39,242,29,155,188,148,67,3,248,17,199,246,144,239,62,231,6,195,213,47,200,102,30,215,8,232,234,222,128,82,238,247,132,170,114,172,53,77,106,42,150,26,210,113,90,21,73,116,75,159,208,94,4,24,164,236,194,224,65,110,15,81,203,204,36,145,175,80,161,244,112,57,153,124,58,133,35,184,180,122,252,2,54,91,37,85,151,49,45,93,250,152,227,138,146,174,5,223,41,16,103,108,186,201,211,0,230,207,225,158,168,44,99,22,1,63,88,226,137,169,13,56,52,27,171,51,255,176,187,72,12,95,185,177,205,46,197,243,219,71,229,165,156,119,10,166,32,104,254,127,193,173],a=[1,2,3,5],s=function(e,t){return e<<t&65535|(65535&e)>>16-t},o=function(e,t){return(65535&e)>>t|e<<16-t&65535};e.exports=n.rc2=n.rc2||{},n.rc2.expandKey=function(e,t){"string"==typeof e&&(e=n.util.createBuffer(e)),t=t||128;var r,a=e,s=e.length(),o=t,c=Math.ceil(o/8),u=255>>(7&o);for(r=s;r<128;r++)a.putByte(i[a.at(r-1)+a.at(r-s)&255]);for(a.setAt(128-c,i[a.at(128-c)&u]),r=127-c;r>=0;r--)a.setAt(r,i[a.at(r+1)^a.at(r+c)]);return a};var c=function(e,t,r){var i,c,u,f,h=!1,l=null,d=null,p=null,g=[];for(e=n.rc2.expandKey(e,t),u=0;u<64;u++)g.push(e.getInt16Le());r?(i=function(e){for(u=0;u<4;u++)e[u]+=g[f]+(e[(u+3)%4]&e[(u+2)%4])+(~e[(u+3)%4]&e[(u+1)%4]),e[u]=s(e[u],a[u]),f++},c=function(e){for(u=0;u<4;u++)e[u]+=g[63&e[(u+3)%4]]}):(i=function(e){for(u=3;u>=0;u--)e[u]=o(e[u],a[u]),e[u]-=g[f]+(e[(u+3)%4]&e[(u+2)%4])+(~e[(u+3)%4]&e[(u+1)%4]),f--},c=function(e){for(u=3;u>=0;u--)e[u]-=g[63&e[(u+3)%4]]});var y=function(e){var t=[];for(u=0;u<4;u++){var n=l.getInt16Le();null!==p&&(r?n^=p.getInt16Le():p.putInt16Le(n)),t.push(65535&n)}f=r?0:63;for(var i=0;i<e.length;i++)for(var a=0;a<e[i][0];a++)e[i][1](t);for(u=0;u<4;u++)null!==p&&(r?p.putInt16Le(t[u]):t[u]^=p.getInt16Le()),d.putInt16Le(t[u])},v=null;return v={start:function(e,t){e&&"string"==typeof e&&(e=n.util.createBuffer(e)),h=!1,l=n.util.createBuffer(),d=t||new n.util.createBuffer,p=e,v.output=d},update:function(e){for(h||l.putBuffer(e);l.length()>=8;)y([[5,i],[1,c],[6,i],[1,c],[5,i]])},finish:function(e){var t=!0;if(r)if(e)t=e(8,l,!r);else{var n=8===l.length()?8:8-l.length();l.fillWithByte(n,n)}if(t&&(h=!0,v.update()),!r&&(t=0===l.length()))if(e)t=e(8,d,!r);else{var i=d.length(),a=d.at(i-1);a>i?t=!1:d.truncate(a)}return t}}};n.rc2.startEncrypting=function(e,t,r){var i=n.rc2.createEncryptionCipher(e,128);return i.start(t,r),i},n.rc2.createEncryptionCipher=function(e,t){return c(e,t,!0)},n.rc2.startDecrypting=function(e,t,r){var i=n.rc2.createDecryptionCipher(e,128);return i.start(t,r),i},n.rc2.createDecryptionCipher=function(e,t){return c(e,t,!1)}},72112:(e,t,r)=>{var n=r(28413);if(r(25129),r(29127),r(12889),r(26036),r(16721),r(93851),r(23564),void 0===i)var i=n.jsbn.BigInteger;var a=n.util.isNodejs?r(50310):null,s=n.asn1,o=n.util;n.pki=n.pki||{},e.exports=n.pki.rsa=n.rsa=n.rsa||{};var c=n.pki,u=[6,4,2,4,2,4,6,2],f={name:"PrivateKeyInfo",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:s.Class.UNIVERSAL,type:s.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:s.Class.UNIVERSAL,type:s.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},h={name:"RSAPrivateKey",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},l={name:"RSAPublicKey",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"publicKeyExponent"}]},d=n.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:s.Class.UNIVERSAL,type:s.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:s.Class.UNIVERSAL,type:s.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},p={name:"DigestInfo",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm.algorithmIdentifier",tagClass:s.Class.UNIVERSAL,type:s.Type.OID,constructed:!1,capture:"algorithmIdentifier"},{name:"DigestInfo.DigestAlgorithm.parameters",tagClass:s.Class.UNIVERSAL,type:s.Type.NULL,capture:"parameters",optional:!0,constructed:!1}]},{name:"DigestInfo.digest",tagClass:s.Class.UNIVERSAL,type:s.Type.OCTETSTRING,constructed:!1,capture:"digest"}]},g=function(e){var t;if(!(e.algorithm in c.oids)){var r=new Error("Unknown message digest algorithm.");throw r.algorithm=e.algorithm,r}t=c.oids[e.algorithm];var n=s.oidToDer(t).getBytes(),i=s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[]),a=s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[]);a.value.push(s.create(s.Class.UNIVERSAL,s.Type.OID,!1,n)),a.value.push(s.create(s.Class.UNIVERSAL,s.Type.NULL,!1,""));var o=s.create(s.Class.UNIVERSAL,s.Type.OCTETSTRING,!1,e.digest().getBytes());return i.value.push(a),i.value.push(o),s.toDer(i).getBytes()},y=function(e,t,r){if(r)return e.modPow(t.e,t.n);if(!t.p||!t.q)return e.modPow(t.d,t.n);var a;t.dP||(t.dP=t.d.mod(t.p.subtract(i.ONE))),t.dQ||(t.dQ=t.d.mod(t.q.subtract(i.ONE))),t.qInv||(t.qInv=t.q.modInverse(t.p));do{a=new i(n.util.bytesToHex(n.random.getBytes(t.n.bitLength()/8)),16)}while(a.compareTo(t.n)>=0||!a.gcd(t.n).equals(i.ONE));for(var s=(e=e.multiply(a.modPow(t.e,t.n)).mod(t.n)).mod(t.p).modPow(t.dP,t.p),o=e.mod(t.q).modPow(t.dQ,t.q);s.compareTo(o)<0;)s=s.add(t.p);var c=s.subtract(o).multiply(t.qInv).mod(t.p).multiply(t.q).add(o);return c.multiply(a.modInverse(t.n)).mod(t.n)};function v(e,t,r){var i=n.util.createBuffer(),a=Math.ceil(t.n.bitLength()/8);if(e.length>a-11){var s=new Error("Message is too long for PKCS#1 v1.5 padding.");throw s.length=e.length,s.max=a-11,s}i.putByte(0),i.putByte(r);var o,c=a-3-e.length;if(0===r||1===r){o=0===r?0:255;for(var u=0;u<c;++u)i.putByte(o)}else for(;c>0;){var f=0,h=n.random.getBytes(c);for(u=0;u<c;++u)0===(o=h.charCodeAt(u))?++f:i.putByte(o);c=f}return i.putByte(0),i.putBytes(e),i}function m(e,t,r,i){var a=Math.ceil(t.n.bitLength()/8),s=n.util.createBuffer(e),o=s.getByte(),c=s.getByte();if(0!==o||r&&0!==c&&1!==c||!r&&2!=c||r&&0===c&&void 0===i)throw new Error("Encryption block is invalid.");var u=0;if(0===c){u=a-3-i;for(var f=0;f<u;++f)if(0!==s.getByte())throw new Error("Encryption block is invalid.")}else if(1===c)for(u=0;s.length()>1;){if(255!==s.getByte()){--s.read;break}++u}else if(2===c)for(u=0;s.length()>1;){if(0===s.getByte()){--s.read;break}++u}if(0!==s.getByte()||u!==a-3-s.length())throw new Error("Encryption block is invalid.");return s.getBytes()}function b(e){var t=e.toString(16);t[0]>="8"&&(t="00"+t);var r=n.util.hexToBytes(t);return!(r.length>1)||(0!==r.charCodeAt(0)||128&r.charCodeAt(1))&&(255!==r.charCodeAt(0)||128&~r.charCodeAt(1))?r:r.substr(1)}function w(e){return e<=100?27:e<=150?18:e<=200?15:e<=250?12:e<=300?9:e<=350?8:e<=400?7:e<=500?6:e<=600?5:e<=800?4:e<=1250?3:2}function S(e){return n.util.isNodejs&&"function"==typeof a[e]}function E(e){return void 0!==o.globalScope&&"object"==typeof o.globalScope.crypto&&"object"==typeof o.globalScope.crypto.subtle&&"function"==typeof o.globalScope.crypto.subtle[e]}function C(e){return void 0!==o.globalScope&&"object"==typeof o.globalScope.msCrypto&&"object"==typeof o.globalScope.msCrypto.subtle&&"function"==typeof o.globalScope.msCrypto.subtle[e]}function A(e){for(var t=n.util.hexToBytes(e.toString(16)),r=new Uint8Array(t.length),i=0;i<t.length;++i)r[i]=t.charCodeAt(i);return r}c.rsa.encrypt=function(e,t,r){var a,s=r,o=Math.ceil(t.n.bitLength()/8);!1!==r&&!0!==r?(s=2===r,a=v(e,t,r)):(a=n.util.createBuffer()).putBytes(e);for(var c=new i(a.toHex(),16),u=y(c,t,s).toString(16),f=n.util.createBuffer(),h=o-Math.ceil(u.length/2);h>0;)f.putByte(0),--h;return f.putBytes(n.util.hexToBytes(u)),f.getBytes()},c.rsa.decrypt=function(e,t,r,a){var s=Math.ceil(t.n.bitLength()/8);if(e.length!==s){var o=new Error("Encrypted message length is invalid.");throw o.length=e.length,o.expected=s,o}var c=new i(n.util.createBuffer(e).toHex(),16);if(c.compareTo(t.n)>=0)throw new Error("Encrypted message is invalid.");for(var u=y(c,t,r).toString(16),f=n.util.createBuffer(),h=s-Math.ceil(u.length/2);h>0;)f.putByte(0),--h;return f.putBytes(n.util.hexToBytes(u)),!1!==a?m(f.getBytes(),t,r):f.getBytes()},c.rsa.createKeyPairGenerationState=function(e,t,r){"string"==typeof e&&(e=parseInt(e,10)),e=e||2048;var a,s=(r=r||{}).prng||n.random,o={nextBytes:function(e){for(var t=s.getBytesSync(e.length),r=0;r<e.length;++r)e[r]=t.charCodeAt(r)}},c=r.algorithm||"PRIMEINC";if("PRIMEINC"!==c)throw new Error("Invalid key generation algorithm: "+c);return(a={algorithm:c,state:0,bits:e,rng:o,eInt:t||65537,e:new i(null),p:null,q:null,qBits:e>>1,pBits:e-(e>>1),pqState:0,num:null,keys:null}).e.fromInt(a.eInt),a},c.rsa.stepKeyPairGenerationState=function(e,t){"algorithm"in e||(e.algorithm="PRIMEINC");var r=new i(null);r.fromInt(30);for(var n,a=0,s=function(e,t){return e|t},o=+new Date,f=0;null===e.keys&&(t<=0||f<t);){if(0===e.state){var h=null===e.p?e.pBits:e.qBits,l=h-1;0===e.pqState?(e.num=new i(h,e.rng),e.num.testBit(l)||e.num.bitwiseTo(i.ONE.shiftLeft(l),s,e.num),e.num.dAddOffset(31-e.num.mod(r).byteValue(),0),a=0,++e.pqState):1===e.pqState?e.num.bitLength()>h?e.pqState=0:e.num.isProbablePrime(w(e.num.bitLength()))?++e.pqState:e.num.dAddOffset(u[a++%8],0):2===e.pqState?e.pqState=0===e.num.subtract(i.ONE).gcd(e.e).compareTo(i.ONE)?3:0:3===e.pqState&&(e.pqState=0,null===e.p?e.p=e.num:e.q=e.num,null!==e.p&&null!==e.q&&++e.state,e.num=null)}else if(1===e.state)e.p.compareTo(e.q)<0&&(e.num=e.p,e.p=e.q,e.q=e.num),++e.state;else if(2===e.state)e.p1=e.p.subtract(i.ONE),e.q1=e.q.subtract(i.ONE),e.phi=e.p1.multiply(e.q1),++e.state;else if(3===e.state)0===e.phi.gcd(e.e).compareTo(i.ONE)?++e.state:(e.p=null,e.q=null,e.state=0);else if(4===e.state)e.n=e.p.multiply(e.q),e.n.bitLength()===e.bits?++e.state:(e.q=null,e.state=0);else if(5===e.state){var d=e.e.modInverse(e.phi);e.keys={privateKey:c.rsa.setPrivateKey(e.n,e.e,d,e.p,e.q,d.mod(e.p1),d.mod(e.q1),e.q.modInverse(e.p)),publicKey:c.rsa.setPublicKey(e.n,e.e)}}f+=(n=+new Date)-o,o=n}return null!==e.keys},c.rsa.generateKeyPair=function(e,t,r,u){if(1===arguments.length?"object"==typeof e?(r=e,e=void 0):"function"==typeof e&&(u=e,e=void 0):2===arguments.length?"number"==typeof e?"function"==typeof t?(u=t,t=void 0):"number"!=typeof t&&(r=t,t=void 0):(r=e,u=t,e=void 0,t=void 0):3===arguments.length&&("number"==typeof t?"function"==typeof r&&(u=r,r=void 0):(u=r,r=t,t=void 0)),r=r||{},void 0===e&&(e=r.bits||2048),void 0===t&&(t=r.e||65537),!n.options.usePureJavaScript&&!r.prng&&e>=256&&e<=16384&&(65537===t||3===t))if(u){if(S("generateKeyPair"))return a.generateKeyPair("rsa",{modulusLength:e,publicExponent:t,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}},(function(e,t,r){if(e)return u(e);u(null,{privateKey:c.privateKeyFromPem(r),publicKey:c.publicKeyFromPem(t)})}));if(E("generateKey")&&E("exportKey"))return o.globalScope.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:e,publicExponent:A(t),hash:{name:"SHA-256"}},!0,["sign","verify"]).then((function(e){return o.globalScope.crypto.subtle.exportKey("pkcs8",e.privateKey)})).then(void 0,(function(e){u(e)})).then((function(e){if(e){var t=c.privateKeyFromAsn1(s.fromDer(n.util.createBuffer(e)));u(null,{privateKey:t,publicKey:c.setRsaPublicKey(t.n,t.e)})}}));if(C("generateKey")&&C("exportKey")){var f=o.globalScope.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:e,publicExponent:A(t),hash:{name:"SHA-256"}},!0,["sign","verify"]);return f.oncomplete=function(e){var t=e.target.result,r=o.globalScope.msCrypto.subtle.exportKey("pkcs8",t.privateKey);r.oncomplete=function(e){var t=e.target.result,r=c.privateKeyFromAsn1(s.fromDer(n.util.createBuffer(t)));u(null,{privateKey:r,publicKey:c.setRsaPublicKey(r.n,r.e)})},r.onerror=function(e){u(e)}},void(f.onerror=function(e){u(e)})}}else if(S("generateKeyPairSync")){var h=a.generateKeyPairSync("rsa",{modulusLength:e,publicExponent:t,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});return{privateKey:c.privateKeyFromPem(h.privateKey),publicKey:c.publicKeyFromPem(h.publicKey)}}var l=c.rsa.createKeyPairGenerationState(e,t,r);if(!u)return c.rsa.stepKeyPairGenerationState(l,0),l.keys;!function(e,t,r){"function"==typeof t&&(r=t,t={});var a={algorithm:{name:(t=t||{}).algorithm||"PRIMEINC",options:{workers:t.workers||2,workLoad:t.workLoad||100,workerScript:t.workerScript}}};function s(){o(e.pBits,(function(t,n){return t?r(t):(e.p=n,null!==e.q?u(t,e.q):void o(e.qBits,u))}))}function o(e,t){n.prime.generateProbablePrime(e,a,t)}function u(t,n){if(t)return r(t);if(e.q=n,e.p.compareTo(e.q)<0){var a=e.p;e.p=e.q,e.q=a}if(0!==e.p.subtract(i.ONE).gcd(e.e).compareTo(i.ONE))return e.p=null,void s();if(0!==e.q.subtract(i.ONE).gcd(e.e).compareTo(i.ONE))return e.q=null,void o(e.qBits,u);if(e.p1=e.p.subtract(i.ONE),e.q1=e.q.subtract(i.ONE),e.phi=e.p1.multiply(e.q1),0!==e.phi.gcd(e.e).compareTo(i.ONE))return e.p=e.q=null,void s();if(e.n=e.p.multiply(e.q),e.n.bitLength()!==e.bits)return e.q=null,void o(e.qBits,u);var f=e.e.modInverse(e.phi);e.keys={privateKey:c.rsa.setPrivateKey(e.n,e.e,f,e.p,e.q,f.mod(e.p1),f.mod(e.q1),e.q.modInverse(e.p)),publicKey:c.rsa.setPublicKey(e.n,e.e)},r(null,e.keys)}"prng"in t&&(a.prng=t.prng),s()}(l,r,u)},c.setRsaPublicKey=c.rsa.setPublicKey=function(e,t){var r={n:e,e:t,encrypt:function(e,t,i){if("string"==typeof t?t=t.toUpperCase():void 0===t&&(t="RSAES-PKCS1-V1_5"),"RSAES-PKCS1-V1_5"===t)t={encode:function(e,t,r){return v(e,t,2).getBytes()}};else if("RSA-OAEP"===t||"RSAES-OAEP"===t)t={encode:function(e,t){return n.pkcs1.encode_rsa_oaep(t,e,i)}};else if(-1!==["RAW","NONE","NULL",null].indexOf(t))t={encode:function(e){return e}};else if("string"==typeof t)throw new Error('Unsupported encryption scheme: "'+t+'".');var a=t.encode(e,r,!0);return c.rsa.encrypt(a,r,!0)},verify:function(e,t,i,a){"string"==typeof i?i=i.toUpperCase():void 0===i&&(i="RSASSA-PKCS1-V1_5"),void 0===a&&(a={_parseAllDigestBytes:!0}),"_parseAllDigestBytes"in a||(a._parseAllDigestBytes=!0),"RSASSA-PKCS1-V1_5"===i?i={verify:function(e,t){t=m(t,r,!0);var i=s.fromDer(t,{parseAllBytes:a._parseAllDigestBytes}),o={},c=[];if(!s.validate(i,p,o,c))throw(u=new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value.")).errors=c,u;var u,f=s.derToOid(o.algorithmIdentifier);if(f!==n.oids.md2&&f!==n.oids.md5&&f!==n.oids.sha1&&f!==n.oids.sha224&&f!==n.oids.sha256&&f!==n.oids.sha384&&f!==n.oids.sha512&&f!==n.oids["sha512-224"]&&f!==n.oids["sha512-256"])throw(u=new Error("Unknown RSASSA-PKCS1-v1_5 DigestAlgorithm identifier.")).oid=f,u;if((f===n.oids.md2||f===n.oids.md5)&&!("parameters"in o))throw new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value. Missing algorithm identifer NULL parameters.");return e===o.digest}}:"NONE"!==i&&"NULL"!==i&&null!==i||(i={verify:function(e,t){return e===m(t,r,!0)}});var o=c.rsa.decrypt(t,r,!0,!1);return i.verify(e,o,r.n.bitLength())}};return r},c.setRsaPrivateKey=c.rsa.setPrivateKey=function(e,t,r,i,a,s,o,u){var f={n:e,e:t,d:r,p:i,q:a,dP:s,dQ:o,qInv:u,decrypt:function(e,t,r){"string"==typeof t?t=t.toUpperCase():void 0===t&&(t="RSAES-PKCS1-V1_5");var i=c.rsa.decrypt(e,f,!1,!1);if("RSAES-PKCS1-V1_5"===t)t={decode:m};else if("RSA-OAEP"===t||"RSAES-OAEP"===t)t={decode:function(e,t){return n.pkcs1.decode_rsa_oaep(t,e,r)}};else{if(-1===["RAW","NONE","NULL",null].indexOf(t))throw new Error('Unsupported encryption scheme: "'+t+'".');t={decode:function(e){return e}}}return t.decode(i,f,!1)},sign:function(e,t){var r=!1;"string"==typeof t&&(t=t.toUpperCase()),void 0===t||"RSASSA-PKCS1-V1_5"===t?(t={encode:g},r=1):"NONE"!==t&&"NULL"!==t&&null!==t||(t={encode:function(){return e}},r=1);var n=t.encode(e,f.n.bitLength());return c.rsa.encrypt(n,f,r)}};return f},c.wrapRsaPrivateKey=function(e){return s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,s.integerToDer(0).getBytes()),s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.OID,!1,s.oidToDer(c.oids.rsaEncryption).getBytes()),s.create(s.Class.UNIVERSAL,s.Type.NULL,!1,"")]),s.create(s.Class.UNIVERSAL,s.Type.OCTETSTRING,!1,s.toDer(e).getBytes())])},c.privateKeyFromAsn1=function(e){var t,r,a,o,u,l,d,p,g={},y=[];if(s.validate(e,f,g,y)&&(e=s.fromDer(n.util.createBuffer(g.privateKey))),g={},y=[],!s.validate(e,h,g,y)){var v=new Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey.");throw v.errors=y,v}return t=n.util.createBuffer(g.privateKeyModulus).toHex(),r=n.util.createBuffer(g.privateKeyPublicExponent).toHex(),a=n.util.createBuffer(g.privateKeyPrivateExponent).toHex(),o=n.util.createBuffer(g.privateKeyPrime1).toHex(),u=n.util.createBuffer(g.privateKeyPrime2).toHex(),l=n.util.createBuffer(g.privateKeyExponent1).toHex(),d=n.util.createBuffer(g.privateKeyExponent2).toHex(),p=n.util.createBuffer(g.privateKeyCoefficient).toHex(),c.setRsaPrivateKey(new i(t,16),new i(r,16),new i(a,16),new i(o,16),new i(u,16),new i(l,16),new i(d,16),new i(p,16))},c.privateKeyToAsn1=c.privateKeyToRSAPrivateKey=function(e){return s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,s.integerToDer(0).getBytes()),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,b(e.n)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,b(e.e)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,b(e.d)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,b(e.p)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,b(e.q)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,b(e.dP)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,b(e.dQ)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,b(e.qInv))])},c.publicKeyFromAsn1=function(e){var t={},r=[];if(s.validate(e,d,t,r)){var a,o=s.derToOid(t.publicKeyOid);if(o!==c.oids.rsaEncryption)throw(a=new Error("Cannot read public key. Unknown OID.")).oid=o,a;e=t.rsaPublicKey}if(r=[],!s.validate(e,l,t,r))throw(a=new Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey.")).errors=r,a;var u=n.util.createBuffer(t.publicKeyModulus).toHex(),f=n.util.createBuffer(t.publicKeyExponent).toHex();return c.setRsaPublicKey(new i(u,16),new i(f,16))},c.publicKeyToAsn1=c.publicKeyToSubjectPublicKeyInfo=function(e){return s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.OID,!1,s.oidToDer(c.oids.rsaEncryption).getBytes()),s.create(s.Class.UNIVERSAL,s.Type.NULL,!1,"")]),s.create(s.Class.UNIVERSAL,s.Type.BITSTRING,!1,[c.publicKeyToRSAPublicKey(e)])])},c.publicKeyToRSAPublicKey=function(e){return s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,b(e.n)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,b(e.e))])}},13417:(e,t,r)=>{var n=r(28413);r(25853),r(23564);var i=e.exports=n.sha1=n.sha1||{};n.md.sha1=n.md.algorithms.sha1=i,i.create=function(){s||(a=String.fromCharCode(128),a+=n.util.fillString(String.fromCharCode(0),64),s=!0);var e=null,t=n.util.createBuffer(),r=new Array(80),i={algorithm:"sha1",blockLength:64,digestLength:20,messageLength:0,fullMessageLength:null,messageLengthSize:8,start:function(){i.messageLength=0,i.fullMessageLength=i.messageLength64=[];for(var r=i.messageLengthSize/4,a=0;a<r;++a)i.fullMessageLength.push(0);return t=n.util.createBuffer(),e={h0:1732584193,h1:4023233417,h2:2562383102,h3:271733878,h4:3285377520},i}};return i.start(),i.update=function(a,s){"utf8"===s&&(a=n.util.encodeUtf8(a));var c=a.length;i.messageLength+=c,c=[c/4294967296>>>0,c>>>0];for(var u=i.fullMessageLength.length-1;u>=0;--u)i.fullMessageLength[u]+=c[1],c[1]=c[0]+(i.fullMessageLength[u]/4294967296>>>0),i.fullMessageLength[u]=i.fullMessageLength[u]>>>0,c[0]=c[1]/4294967296>>>0;return t.putBytes(a),o(e,r,t),(t.read>2048||0===t.length())&&t.compact(),i},i.digest=function(){var s=n.util.createBuffer();s.putBytes(t.bytes());var c,u=i.fullMessageLength[i.fullMessageLength.length-1]+i.messageLengthSize&i.blockLength-1;s.putBytes(a.substr(0,i.blockLength-u));for(var f=8*i.fullMessageLength[0],h=0;h<i.fullMessageLength.length-1;++h)f+=(c=8*i.fullMessageLength[h+1])/4294967296>>>0,s.putInt32(f>>>0),f=c>>>0;s.putInt32(f);var l={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4};o(l,r,s);var d=n.util.createBuffer();return d.putInt32(l.h0),d.putInt32(l.h1),d.putInt32(l.h2),d.putInt32(l.h3),d.putInt32(l.h4),d},i};var a=null,s=!1;function o(e,t,r){for(var n,i,a,s,o,c,u,f=r.length();f>=64;){for(i=e.h0,a=e.h1,s=e.h2,o=e.h3,c=e.h4,u=0;u<16;++u)n=r.getInt32(),t[u]=n,n=(i<<5|i>>>27)+(o^a&(s^o))+c+1518500249+n,c=o,o=s,s=(a<<30|a>>>2)>>>0,a=i,i=n;for(;u<20;++u)n=(n=t[u-3]^t[u-8]^t[u-14]^t[u-16])<<1|n>>>31,t[u]=n,n=(i<<5|i>>>27)+(o^a&(s^o))+c+1518500249+n,c=o,o=s,s=(a<<30|a>>>2)>>>0,a=i,i=n;for(;u<32;++u)n=(n=t[u-3]^t[u-8]^t[u-14]^t[u-16])<<1|n>>>31,t[u]=n,n=(i<<5|i>>>27)+(a^s^o)+c+1859775393+n,c=o,o=s,s=(a<<30|a>>>2)>>>0,a=i,i=n;for(;u<40;++u)n=(n=t[u-6]^t[u-16]^t[u-28]^t[u-32])<<2|n>>>30,t[u]=n,n=(i<<5|i>>>27)+(a^s^o)+c+1859775393+n,c=o,o=s,s=(a<<30|a>>>2)>>>0,a=i,i=n;for(;u<60;++u)n=(n=t[u-6]^t[u-16]^t[u-28]^t[u-32])<<2|n>>>30,t[u]=n,n=(i<<5|i>>>27)+(a&s|o&(a^s))+c+2400959708+n,c=o,o=s,s=(a<<30|a>>>2)>>>0,a=i,i=n;for(;u<80;++u)n=(n=t[u-6]^t[u-16]^t[u-28]^t[u-32])<<2|n>>>30,t[u]=n,n=(i<<5|i>>>27)+(a^s^o)+c+3395469782+n,c=o,o=s,s=(a<<30|a>>>2)>>>0,a=i,i=n;e.h0=e.h0+i|0,e.h1=e.h1+a|0,e.h2=e.h2+s|0,e.h3=e.h3+o|0,e.h4=e.h4+c|0,f-=64}}},24955:(e,t,r)=>{var n=r(28413);r(25853),r(23564);var i=e.exports=n.sha256=n.sha256||{};n.md.sha256=n.md.algorithms.sha256=i,i.create=function(){s||(a=String.fromCharCode(128),a+=n.util.fillString(String.fromCharCode(0),64),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],s=!0);var e=null,t=n.util.createBuffer(),r=new Array(64),i={algorithm:"sha256",blockLength:64,digestLength:32,messageLength:0,fullMessageLength:null,messageLengthSize:8,start:function(){i.messageLength=0,i.fullMessageLength=i.messageLength64=[];for(var r=i.messageLengthSize/4,a=0;a<r;++a)i.fullMessageLength.push(0);return t=n.util.createBuffer(),e={h0:1779033703,h1:3144134277,h2:1013904242,h3:2773480762,h4:1359893119,h5:2600822924,h6:528734635,h7:1541459225},i}};return i.start(),i.update=function(a,s){"utf8"===s&&(a=n.util.encodeUtf8(a));var o=a.length;i.messageLength+=o,o=[o/4294967296>>>0,o>>>0];for(var u=i.fullMessageLength.length-1;u>=0;--u)i.fullMessageLength[u]+=o[1],o[1]=o[0]+(i.fullMessageLength[u]/4294967296>>>0),i.fullMessageLength[u]=i.fullMessageLength[u]>>>0,o[0]=o[1]/4294967296>>>0;return t.putBytes(a),c(e,r,t),(t.read>2048||0===t.length())&&t.compact(),i},i.digest=function(){var s=n.util.createBuffer();s.putBytes(t.bytes());var o,u=i.fullMessageLength[i.fullMessageLength.length-1]+i.messageLengthSize&i.blockLength-1;s.putBytes(a.substr(0,i.blockLength-u));for(var f=8*i.fullMessageLength[0],h=0;h<i.fullMessageLength.length-1;++h)f+=(o=8*i.fullMessageLength[h+1])/4294967296>>>0,s.putInt32(f>>>0),f=o>>>0;s.putInt32(f);var l={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4,h5:e.h5,h6:e.h6,h7:e.h7};c(l,r,s);var d=n.util.createBuffer();return d.putInt32(l.h0),d.putInt32(l.h1),d.putInt32(l.h2),d.putInt32(l.h3),d.putInt32(l.h4),d.putInt32(l.h5),d.putInt32(l.h6),d.putInt32(l.h7),d},i};var a=null,s=!1,o=null;function c(e,t,r){for(var n,i,a,s,c,u,f,h,l,d,p,g,y,v=r.length();v>=64;){for(c=0;c<16;++c)t[c]=r.getInt32();for(;c<64;++c)n=((n=t[c-2])>>>17|n<<15)^(n>>>19|n<<13)^n>>>10,i=((i=t[c-15])>>>7|i<<25)^(i>>>18|i<<14)^i>>>3,t[c]=n+t[c-7]+i+t[c-16]|0;for(u=e.h0,f=e.h1,h=e.h2,l=e.h3,d=e.h4,p=e.h5,g=e.h6,y=e.h7,c=0;c<64;++c)a=(u>>>2|u<<30)^(u>>>13|u<<19)^(u>>>22|u<<10),s=u&f|h&(u^f),n=y+((d>>>6|d<<26)^(d>>>11|d<<21)^(d>>>25|d<<7))+(g^d&(p^g))+o[c]+t[c],y=g,g=p,p=d,d=l+n>>>0,l=h,h=f,f=u,u=n+(i=a+s)>>>0;e.h0=e.h0+u|0,e.h1=e.h1+f|0,e.h2=e.h2+h|0,e.h3=e.h3+l|0,e.h4=e.h4+d|0,e.h5=e.h5+p|0,e.h6=e.h6+g|0,e.h7=e.h7+y|0,v-=64}}},39194:(e,t,r)=>{var n=r(28413);r(25853),r(23564);var i=e.exports=n.sha512=n.sha512||{};n.md.sha512=n.md.algorithms.sha512=i;var a=n.sha384=n.sha512.sha384=n.sha512.sha384||{};a.create=function(){return i.create("SHA-384")},n.md.sha384=n.md.algorithms.sha384=a,n.sha512.sha256=n.sha512.sha256||{create:function(){return i.create("SHA-512/256")}},n.md["sha512/256"]=n.md.algorithms["sha512/256"]=n.sha512.sha256,n.sha512.sha224=n.sha512.sha224||{create:function(){return i.create("SHA-512/224")}},n.md["sha512/224"]=n.md.algorithms["sha512/224"]=n.sha512.sha224,i.create=function(e){if(o||(s=String.fromCharCode(128),s+=n.util.fillString(String.fromCharCode(0),128),c=[[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]],(u={})["SHA-512"]=[[1779033703,4089235720],[3144134277,2227873595],[1013904242,4271175723],[2773480762,1595750129],[1359893119,2917565137],[2600822924,725511199],[528734635,4215389547],[1541459225,327033209]],u["SHA-384"]=[[3418070365,3238371032],[1654270250,914150663],[2438529370,812702999],[355462360,4144912697],[1731405415,4290775857],[2394180231,1750603025],[3675008525,1694076839],[1203062813,3204075428]],u["SHA-512/256"]=[[573645204,4230739756],[2673172387,3360449730],[596883563,1867755857],[2520282905,1497426621],[2519219938,2827943907],[3193839141,1401305490],[721525244,746961066],[246885852,2177182882]],u["SHA-512/224"]=[[2352822216,424955298],[1944164710,2312950998],[502970286,855612546],[1738396948,1479516111],[258812777,2077511080],[2011393907,79989058],[1067287976,1780299464],[286451373,2446758561]],o=!0),void 0===e&&(e="SHA-512"),!(e in u))throw new Error("Invalid SHA-512 algorithm: "+e);for(var t=u[e],r=null,i=n.util.createBuffer(),a=new Array(80),h=0;h<80;++h)a[h]=new Array(2);var l=64;switch(e){case"SHA-384":l=48;break;case"SHA-512/256":l=32;break;case"SHA-512/224":l=28}var d={algorithm:e.replace("-","").toLowerCase(),blockLength:128,digestLength:l,messageLength:0,fullMessageLength:null,messageLengthSize:16,start:function(){d.messageLength=0,d.fullMessageLength=d.messageLength128=[];for(var e=d.messageLengthSize/4,a=0;a<e;++a)d.fullMessageLength.push(0);for(i=n.util.createBuffer(),r=new Array(t.length),a=0;a<t.length;++a)r[a]=t[a].slice(0);return d}};return d.start(),d.update=function(e,t){"utf8"===t&&(e=n.util.encodeUtf8(e));var s=e.length;d.messageLength+=s,s=[s/4294967296>>>0,s>>>0];for(var o=d.fullMessageLength.length-1;o>=0;--o)d.fullMessageLength[o]+=s[1],s[1]=s[0]+(d.fullMessageLength[o]/4294967296>>>0),d.fullMessageLength[o]=d.fullMessageLength[o]>>>0,s[0]=s[1]/4294967296>>>0;return i.putBytes(e),f(r,a,i),(i.read>2048||0===i.length())&&i.compact(),d},d.digest=function(){var t=n.util.createBuffer();t.putBytes(i.bytes());var o,c=d.fullMessageLength[d.fullMessageLength.length-1]+d.messageLengthSize&d.blockLength-1;t.putBytes(s.substr(0,d.blockLength-c));for(var u=8*d.fullMessageLength[0],h=0;h<d.fullMessageLength.length-1;++h)u+=(o=8*d.fullMessageLength[h+1])/4294967296>>>0,t.putInt32(u>>>0),u=o>>>0;t.putInt32(u);var l=new Array(r.length);for(h=0;h<r.length;++h)l[h]=r[h].slice(0);f(l,a,t);var p,g=n.util.createBuffer();for(p="SHA-512"===e?l.length:"SHA-384"===e?l.length-2:l.length-4,h=0;h<p;++h)g.putInt32(l[h][0]),h===p-1&&"SHA-512/224"===e||g.putInt32(l[h][1]);return g},d};var s=null,o=!1,c=null,u=null;function f(e,t,r){for(var n,i,a,s,o,u,f,h,l,d,p,g,y,v,m,b,w,S,E,C,A,B,x,T,I,F,k,R,D,_,P,N,O,L=r.length();L>=128;){for(k=0;k<16;++k)t[k][0]=r.getInt32()>>>0,t[k][1]=r.getInt32()>>>0;for(;k<80;++k)n=(((R=(_=t[k-2])[0])>>>19|(D=_[1])<<13)^(D>>>29|R<<3)^R>>>6)>>>0,i=((R<<13|D>>>19)^(D<<3|R>>>29)^(R<<26|D>>>6))>>>0,a=(((R=(N=t[k-15])[0])>>>1|(D=N[1])<<31)^(R>>>8|D<<24)^R>>>7)>>>0,s=((R<<31|D>>>1)^(R<<24|D>>>8)^(R<<25|D>>>7))>>>0,P=t[k-7],O=t[k-16],D=i+P[1]+s+O[1],t[k][0]=n+P[0]+a+O[0]+(D/4294967296>>>0)>>>0,t[k][1]=D>>>0;for(p=e[0][0],g=e[0][1],y=e[1][0],v=e[1][1],m=e[2][0],b=e[2][1],w=e[3][0],S=e[3][1],E=e[4][0],C=e[4][1],A=e[5][0],B=e[5][1],x=e[6][0],T=e[6][1],I=e[7][0],F=e[7][1],k=0;k<80;++k)f=((E>>>14|C<<18)^(E>>>18|C<<14)^(C>>>9|E<<23))>>>0,h=(x^E&(A^x))>>>0,o=((p>>>28|g<<4)^(g>>>2|p<<30)^(g>>>7|p<<25))>>>0,u=((p<<4|g>>>28)^(g<<30|p>>>2)^(g<<25|p>>>7))>>>0,l=(p&y|m&(p^y))>>>0,d=(g&v|b&(g^v))>>>0,D=F+(((E<<18|C>>>14)^(E<<14|C>>>18)^(C<<23|E>>>9))>>>0)+((T^C&(B^T))>>>0)+c[k][1]+t[k][1],n=I+f+h+c[k][0]+t[k][0]+(D/4294967296>>>0)>>>0,i=D>>>0,a=o+l+((D=u+d)/4294967296>>>0)>>>0,s=D>>>0,I=x,F=T,x=A,T=B,A=E,B=C,E=w+n+((D=S+i)/4294967296>>>0)>>>0,C=D>>>0,w=m,S=b,m=y,b=v,y=p,v=g,p=n+a+((D=i+s)/4294967296>>>0)>>>0,g=D>>>0;D=e[0][1]+g,e[0][0]=e[0][0]+p+(D/4294967296>>>0)>>>0,e[0][1]=D>>>0,D=e[1][1]+v,e[1][0]=e[1][0]+y+(D/4294967296>>>0)>>>0,e[1][1]=D>>>0,D=e[2][1]+b,e[2][0]=e[2][0]+m+(D/4294967296>>>0)>>>0,e[2][1]=D>>>0,D=e[3][1]+S,e[3][0]=e[3][0]+w+(D/4294967296>>>0)>>>0,e[3][1]=D>>>0,D=e[4][1]+C,e[4][0]=e[4][0]+E+(D/4294967296>>>0)>>>0,e[4][1]=D>>>0,D=e[5][1]+B,e[5][0]=e[5][0]+A+(D/4294967296>>>0)>>>0,e[5][1]=D>>>0,D=e[6][1]+T,e[6][0]=e[6][0]+x+(D/4294967296>>>0)>>>0,e[6][1]=D>>>0,D=e[7][1]+F,e[7][0]=e[7][0]+I+(D/4294967296>>>0)>>>0,e[7][1]=D>>>0,L-=128}}},78560:(e,t,r)=>{var n=r(28413);r(72057),r(77827),r(22926),r(13417),r(23564);var i=e.exports=n.ssh=n.ssh||{};function a(e,t){var r=t.toString(16);r[0]>="8"&&(r="00"+r);var i=n.util.hexToBytes(r);e.putInt32(i.length),e.putBytes(i)}function s(e,t){e.putInt32(t.length),e.putString(t)}function o(){for(var e=n.md.sha1.create(),t=arguments.length,r=0;r<t;++r)e.update(arguments[r]);return e.digest()}i.privateKeyToPutty=function(e,t,r){var i="ssh-rsa",c=""===(t=t||"")?"none":"aes256-cbc",u="PuTTY-User-Key-File-2: "+i+"\r\n";u+="Encryption: "+c+"\r\n",u+="Comment: "+(r=r||"")+"\r\n";var f=n.util.createBuffer();s(f,i),a(f,e.e),a(f,e.n);var h=n.util.encode64(f.bytes(),64),l=Math.floor(h.length/66)+1;u+="Public-Lines: "+l+"\r\n",u+=h;var d,p=n.util.createBuffer();if(a(p,e.d),a(p,e.p),a(p,e.q),a(p,e.qInv),t){var g=p.length()+16-1;g-=g%16;var y=o(p.bytes());y.truncate(y.length()-g+p.length()),p.putBuffer(y);var v=n.util.createBuffer();v.putBuffer(o("\0\0\0\0",t)),v.putBuffer(o("\0\0\0",t));var m=n.aes.createEncryptionCipher(v.truncate(8),"CBC");m.start(n.util.createBuffer().fillWithByte(0,16)),m.update(p.copy()),m.finish();var b=m.output;b.truncate(16),d=n.util.encode64(b.bytes(),64)}else d=n.util.encode64(p.bytes(),64);u+="\r\nPrivate-Lines: "+(l=Math.floor(d.length/66)+1)+"\r\n",u+=d;var w=o("putty-private-key-file-mac-key",t),S=n.util.createBuffer();s(S,i),s(S,c),s(S,r),S.putInt32(f.length()),S.putBuffer(f),S.putInt32(p.length()),S.putBuffer(p);var E=n.hmac.create();return E.start("sha1",w),E.update(S.bytes()),u+"\r\nPrivate-MAC: "+E.digest().toHex()+"\r\n"},i.publicKeyToOpenSSH=function(e,t){var r="ssh-rsa";t=t||"";var i=n.util.createBuffer();return s(i,r),a(i,e.e),a(i,e.n),r+" "+n.util.encode64(i.bytes())+" "+t},i.privateKeyToOpenSSH=function(e,t){return t?n.pki.encryptRsaPrivateKey(e,t,{legacy:!0,algorithm:"aes128"}):n.pki.privateKeyToPem(e)},i.getPublicKeyFingerprint=function(e,t){var r=(t=t||{}).md||n.md.md5.create(),i=n.util.createBuffer();s(i,"ssh-rsa"),a(i,e.e),a(i,e.n),r.start(),r.update(i.getBytes());var o=r.digest();if("hex"===t.encoding){var c=o.toHex();return t.delimiter?c.match(/.{2}/g).join(t.delimiter):c}if("binary"===t.encoding)return o.getBytes();if(t.encoding)throw new Error('Unknown encoding "'+t.encoding+'".');return o}},88415:(e,t,r)=>{var n=r(28413);r(25129),r(77827),r(22926),r(67928),r(3174),r(93851),r(13417),r(23564);var i=function(e,t,r,i){var a=n.util.createBuffer(),s=e.length>>1,o=s+(1&e.length),c=e.substr(0,o),u=e.substr(s,o),f=n.util.createBuffer(),h=n.hmac.create();r=t+r;var l=Math.ceil(i/16),d=Math.ceil(i/20);h.start("MD5",c);var p=n.util.createBuffer();f.putBytes(r);for(var g=0;g<l;++g)h.start(null,null),h.update(f.getBytes()),f.putBuffer(h.digest()),h.start(null,null),h.update(f.bytes()+r),p.putBuffer(h.digest());h.start("SHA1",u);var y=n.util.createBuffer();for(f.clear(),f.putBytes(r),g=0;g<d;++g)h.start(null,null),h.update(f.getBytes()),f.putBuffer(h.digest()),h.start(null,null),h.update(f.bytes()+r),y.putBuffer(h.digest());return a.putBytes(n.util.xorBytes(p.getBytes(),y.getBytes(),i)),a},a=function(e,t,r){var i=!1;try{var a=e.deflate(t.fragment.getBytes());t.fragment=n.util.createBuffer(a),t.length=a.length,i=!0}catch(e){}return i},s=function(e,t,r){var i=!1;try{var a=e.inflate(t.fragment.getBytes());t.fragment=n.util.createBuffer(a),t.length=a.length,i=!0}catch(e){}return i},o=function(e,t){var r=0;switch(t){case 1:r=e.getByte();break;case 2:r=e.getInt16();break;case 3:r=e.getInt24();break;case 4:r=e.getInt32()}return n.util.createBuffer(e.getBytes(r))},c=function(e,t,r){e.putInt(r.length(),t<<3),e.putBuffer(r)},u={Versions:{TLS_1_0:{major:3,minor:1},TLS_1_1:{major:3,minor:2},TLS_1_2:{major:3,minor:3}}};u.SupportedVersions=[u.Versions.TLS_1_1,u.Versions.TLS_1_0],u.Version=u.SupportedVersions[0],u.MaxFragment=15360,u.ConnectionEnd={server:0,client:1},u.PRFAlgorithm={tls_prf_sha256:0},u.BulkCipherAlgorithm={none:null,rc4:0,des3:1,aes:2},u.CipherType={stream:0,block:1,aead:2},u.MACAlgorithm={none:null,hmac_md5:0,hmac_sha1:1,hmac_sha256:2,hmac_sha384:3,hmac_sha512:4},u.CompressionMethod={none:0,deflate:1},u.ContentType={change_cipher_spec:20,alert:21,handshake:22,application_data:23,heartbeat:24},u.HandshakeType={hello_request:0,client_hello:1,server_hello:2,certificate:11,server_key_exchange:12,certificate_request:13,server_hello_done:14,certificate_verify:15,client_key_exchange:16,finished:20},u.Alert={},u.Alert.Level={warning:1,fatal:2},u.Alert.Description={close_notify:0,unexpected_message:10,bad_record_mac:20,decryption_failed:21,record_overflow:22,decompression_failure:30,handshake_failure:40,bad_certificate:42,unsupported_certificate:43,certificate_revoked:44,certificate_expired:45,certificate_unknown:46,illegal_parameter:47,unknown_ca:48,access_denied:49,decode_error:50,decrypt_error:51,export_restriction:60,protocol_version:70,insufficient_security:71,internal_error:80,user_canceled:90,no_renegotiation:100},u.HeartbeatMessageType={heartbeat_request:1,heartbeat_response:2},u.CipherSuites={},u.getCipherSuite=function(e){var t=null;for(var r in u.CipherSuites){var n=u.CipherSuites[r];if(n.id[0]===e.charCodeAt(0)&&n.id[1]===e.charCodeAt(1)){t=n;break}}return t},u.handleUnexpected=function(e,t){!e.open&&e.entity===u.ConnectionEnd.client||e.error(e,{message:"Unexpected message. Received TLS record out of order.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.unexpected_message}})},u.handleHelloRequest=function(e,t,r){!e.handshaking&&e.handshakes>0&&(u.queue(e,u.createAlert(e,{level:u.Alert.Level.warning,description:u.Alert.Description.no_renegotiation})),u.flush(e)),e.process()},u.parseHelloMessage=function(e,t,r){var i=null,a=e.entity===u.ConnectionEnd.client;if(r<38)e.error(e,{message:a?"Invalid ServerHello message. Message too short.":"Invalid ClientHello message. Message too short.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.illegal_parameter}});else{var s=t.fragment,c=s.length();if(i={version:{major:s.getByte(),minor:s.getByte()},random:n.util.createBuffer(s.getBytes(32)),session_id:o(s,1),extensions:[]},a?(i.cipher_suite=s.getBytes(2),i.compression_method=s.getByte()):(i.cipher_suites=o(s,2),i.compression_methods=o(s,1)),(c=r-(c-s.length()))>0){for(var f=o(s,2);f.length()>0;)i.extensions.push({type:[f.getByte(),f.getByte()],data:o(f,2)});if(!a)for(var h=0;h<i.extensions.length;++h){var l=i.extensions[h];if(0===l.type[0]&&0===l.type[1])for(var d=o(l.data,2);d.length()>0&&0===d.getByte();)e.session.extensions.server_name.serverNameList.push(o(d,2).getBytes())}}if(e.session.version&&(i.version.major!==e.session.version.major||i.version.minor!==e.session.version.minor))return e.error(e,{message:"TLS version change is disallowed during renegotiation.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.protocol_version}});if(a)e.session.cipherSuite=u.getCipherSuite(i.cipher_suite);else for(var p=n.util.createBuffer(i.cipher_suites.bytes());p.length()>0&&(e.session.cipherSuite=u.getCipherSuite(p.getBytes(2)),null===e.session.cipherSuite););if(null===e.session.cipherSuite)return e.error(e,{message:"No cipher suites in common.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.handshake_failure},cipherSuite:n.util.bytesToHex(i.cipher_suite)});e.session.compressionMethod=a?i.compression_method:u.CompressionMethod.none}return i},u.createSecurityParameters=function(e,t){var r=e.entity===u.ConnectionEnd.client,n=t.random.bytes(),i=r?e.session.sp.client_random:n,a=r?n:u.createRandom().getBytes();e.session.sp={entity:e.entity,prf_algorithm:u.PRFAlgorithm.tls_prf_sha256,bulk_cipher_algorithm:null,cipher_type:null,enc_key_length:null,block_length:null,fixed_iv_length:null,record_iv_length:null,mac_algorithm:null,mac_length:null,mac_key_length:null,compression_algorithm:e.session.compressionMethod,pre_master_secret:null,master_secret:null,client_random:i,server_random:a}},u.handleServerHello=function(e,t,r){var n=u.parseHelloMessage(e,t,r);if(!e.fail){if(!(n.version.minor<=e.version.minor))return e.error(e,{message:"Incompatible TLS version.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.protocol_version}});e.version.minor=n.version.minor,e.session.version=e.version;var i=n.session_id.bytes();i.length>0&&i===e.session.id?(e.expect=p,e.session.resuming=!0,e.session.sp.server_random=n.random.bytes()):(e.expect=f,e.session.resuming=!1,u.createSecurityParameters(e,n)),e.session.id=i,e.process()}},u.handleClientHello=function(e,t,r){var i=u.parseHelloMessage(e,t,r);if(!e.fail){var a=i.session_id.bytes(),s=null;if(e.sessionCache&&(null===(s=e.sessionCache.getSession(a))?a="":(s.version.major!==i.version.major||s.version.minor>i.version.minor)&&(s=null,a="")),0===a.length&&(a=n.random.getBytes(32)),e.session.id=a,e.session.clientHelloVersion=i.version,e.session.sp={},s)e.version=e.session.version=s.version,e.session.sp=s.sp;else{for(var o,c=1;c<u.SupportedVersions.length&&!((o=u.SupportedVersions[c]).minor<=i.version.minor);++c);e.version={major:o.major,minor:o.minor},e.session.version=e.version}null!==s?(e.expect=S,e.session.resuming=!0,e.session.sp.client_random=i.random.bytes()):(e.expect=!1!==e.verifyClient?m:b,e.session.resuming=!1,u.createSecurityParameters(e,i)),e.open=!0,u.queue(e,u.createRecord(e,{type:u.ContentType.handshake,data:u.createServerHello(e)})),e.session.resuming?(u.queue(e,u.createRecord(e,{type:u.ContentType.change_cipher_spec,data:u.createChangeCipherSpec()})),e.state.pending=u.createConnectionState(e),e.state.current.write=e.state.pending.write,u.queue(e,u.createRecord(e,{type:u.ContentType.handshake,data:u.createFinished(e)}))):(u.queue(e,u.createRecord(e,{type:u.ContentType.handshake,data:u.createCertificate(e)})),e.fail||(u.queue(e,u.createRecord(e,{type:u.ContentType.handshake,data:u.createServerKeyExchange(e)})),!1!==e.verifyClient&&u.queue(e,u.createRecord(e,{type:u.ContentType.handshake,data:u.createCertificateRequest(e)})),u.queue(e,u.createRecord(e,{type:u.ContentType.handshake,data:u.createServerHelloDone(e)})))),u.flush(e),e.process()}},u.handleCertificate=function(e,t,r){if(r<3)return e.error(e,{message:"Invalid Certificate message. Message too short.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.illegal_parameter}});var i,a,s=t.fragment,c={certificate_list:o(s,3)},f=[];try{for(;c.certificate_list.length()>0;)i=o(c.certificate_list,3),a=n.asn1.fromDer(i),i=n.pki.certificateFromAsn1(a,!0),f.push(i)}catch(t){return e.error(e,{message:"Could not parse certificate list.",cause:t,send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.bad_certificate}})}var l=e.entity===u.ConnectionEnd.client;!l&&!0!==e.verifyClient||0!==f.length?0===f.length?e.expect=l?h:b:(l?e.session.serverCertificate=f[0]:e.session.clientCertificate=f[0],u.verifyCertificateChain(e,f)&&(e.expect=l?h:b)):e.error(e,{message:l?"No server certificate provided.":"No client certificate provided.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.illegal_parameter}}),e.process()},u.handleServerKeyExchange=function(e,t,r){if(r>0)return e.error(e,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.unsupported_certificate}});e.expect=l,e.process()},u.handleClientKeyExchange=function(e,t,r){if(r<48)return e.error(e,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.unsupported_certificate}});var i=t.fragment,a={enc_pre_master_secret:o(i,2).getBytes()},s=null;if(e.getPrivateKey)try{s=e.getPrivateKey(e,e.session.serverCertificate),s=n.pki.privateKeyFromPem(s)}catch(t){e.error(e,{message:"Could not get private key.",cause:t,send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.internal_error}})}if(null===s)return e.error(e,{message:"No private key set.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.internal_error}});try{var c=e.session.sp;c.pre_master_secret=s.decrypt(a.enc_pre_master_secret);var f=e.session.clientHelloVersion;if(f.major!==c.pre_master_secret.charCodeAt(0)||f.minor!==c.pre_master_secret.charCodeAt(1))throw new Error("TLS version rollback attack detected.")}catch(e){c.pre_master_secret=n.random.getBytes(48)}e.expect=S,null!==e.session.clientCertificate&&(e.expect=w),e.process()},u.handleCertificateRequest=function(e,t,r){if(r<3)return e.error(e,{message:"Invalid CertificateRequest. Message too short.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.illegal_parameter}});var n=t.fragment,i={certificate_types:o(n,1),certificate_authorities:o(n,2)};e.session.certificateRequest=i,e.expect=d,e.process()},u.handleCertificateVerify=function(e,t,r){if(r<2)return e.error(e,{message:"Invalid CertificateVerify. Message too short.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.illegal_parameter}});var i=t.fragment;i.read-=4;var a=i.bytes();i.read+=4;var s={signature:o(i,2).getBytes()},c=n.util.createBuffer();c.putBuffer(e.session.md5.digest()),c.putBuffer(e.session.sha1.digest()),c=c.getBytes();try{if(!e.session.clientCertificate.publicKey.verify(c,s.signature,"NONE"))throw new Error("CertificateVerify signature does not match.");e.session.md5.update(a),e.session.sha1.update(a)}catch(t){return e.error(e,{message:"Bad signature in CertificateVerify.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.handshake_failure}})}e.expect=S,e.process()},u.handleServerHelloDone=function(e,t,r){if(r>0)return e.error(e,{message:"Invalid ServerHelloDone message. Invalid length.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.record_overflow}});if(null===e.serverCertificate){var i={message:"No server certificate provided. Not enough security.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.insufficient_security}},a=e.verify(e,i.alert.description,0,[]);if(!0!==a)return(a||0===a)&&("object"!=typeof a||n.util.isArray(a)?"number"==typeof a&&(i.alert.description=a):(a.message&&(i.message=a.message),a.alert&&(i.alert.description=a.alert))),e.error(e,i)}null!==e.session.certificateRequest&&(t=u.createRecord(e,{type:u.ContentType.handshake,data:u.createCertificate(e)}),u.queue(e,t)),t=u.createRecord(e,{type:u.ContentType.handshake,data:u.createClientKeyExchange(e)}),u.queue(e,t),e.expect=v;var s=function(e,t){null!==e.session.certificateRequest&&null!==e.session.clientCertificate&&u.queue(e,u.createRecord(e,{type:u.ContentType.handshake,data:u.createCertificateVerify(e,t)})),u.queue(e,u.createRecord(e,{type:u.ContentType.change_cipher_spec,data:u.createChangeCipherSpec()})),e.state.pending=u.createConnectionState(e),e.state.current.write=e.state.pending.write,u.queue(e,u.createRecord(e,{type:u.ContentType.handshake,data:u.createFinished(e)})),e.expect=p,u.flush(e),e.process()};if(null===e.session.certificateRequest||null===e.session.clientCertificate)return s(e,null);u.getClientSignature(e,s)},u.handleChangeCipherSpec=function(e,t){if(1!==t.fragment.getByte())return e.error(e,{message:"Invalid ChangeCipherSpec message received.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.illegal_parameter}});var r=e.entity===u.ConnectionEnd.client;(e.session.resuming&&r||!e.session.resuming&&!r)&&(e.state.pending=u.createConnectionState(e)),e.state.current.read=e.state.pending.read,(!e.session.resuming&&r||e.session.resuming&&!r)&&(e.state.pending=null),e.expect=r?g:E,e.process()},u.handleFinished=function(e,t,r){var a=t.fragment;a.read-=4;var s=a.bytes();a.read+=4;var o=t.fragment.getBytes();(a=n.util.createBuffer()).putBuffer(e.session.md5.digest()),a.putBuffer(e.session.sha1.digest());var c=e.entity===u.ConnectionEnd.client,f=c?"server finished":"client finished",h=e.session.sp;if((a=i(h.master_secret,f,a.getBytes(),12)).getBytes()!==o)return e.error(e,{message:"Invalid verify_data in Finished message.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.decrypt_error}});e.session.md5.update(s),e.session.sha1.update(s),(e.session.resuming&&c||!e.session.resuming&&!c)&&(u.queue(e,u.createRecord(e,{type:u.ContentType.change_cipher_spec,data:u.createChangeCipherSpec()})),e.state.current.write=e.state.pending.write,e.state.pending=null,u.queue(e,u.createRecord(e,{type:u.ContentType.handshake,data:u.createFinished(e)}))),e.expect=c?y:C,e.handshaking=!1,++e.handshakes,e.peerCertificate=c?e.session.serverCertificate:e.session.clientCertificate,u.flush(e),e.isConnected=!0,e.connected(e),e.process()},u.handleAlert=function(e,t){var r,n=t.fragment,i={level:n.getByte(),description:n.getByte()};switch(i.description){case u.Alert.Description.close_notify:r="Connection closed.";break;case u.Alert.Description.unexpected_message:r="Unexpected message.";break;case u.Alert.Description.bad_record_mac:r="Bad record MAC.";break;case u.Alert.Description.decryption_failed:r="Decryption failed.";break;case u.Alert.Description.record_overflow:r="Record overflow.";break;case u.Alert.Description.decompression_failure:r="Decompression failed.";break;case u.Alert.Description.handshake_failure:r="Handshake failure.";break;case u.Alert.Description.bad_certificate:r="Bad certificate.";break;case u.Alert.Description.unsupported_certificate:r="Unsupported certificate.";break;case u.Alert.Description.certificate_revoked:r="Certificate revoked.";break;case u.Alert.Description.certificate_expired:r="Certificate expired.";break;case u.Alert.Description.certificate_unknown:r="Certificate unknown.";break;case u.Alert.Description.illegal_parameter:r="Illegal parameter.";break;case u.Alert.Description.unknown_ca:r="Unknown certificate authority.";break;case u.Alert.Description.access_denied:r="Access denied.";break;case u.Alert.Description.decode_error:r="Decode error.";break;case u.Alert.Description.decrypt_error:r="Decrypt error.";break;case u.Alert.Description.export_restriction:r="Export restriction.";break;case u.Alert.Description.protocol_version:r="Unsupported protocol version.";break;case u.Alert.Description.insufficient_security:r="Insufficient security.";break;case u.Alert.Description.internal_error:r="Internal error.";break;case u.Alert.Description.user_canceled:r="User canceled.";break;case u.Alert.Description.no_renegotiation:r="Renegotiation not supported.";break;default:r="Unknown error."}if(i.description===u.Alert.Description.close_notify)return e.close();e.error(e,{message:r,send:!1,origin:e.entity===u.ConnectionEnd.client?"server":"client",alert:i}),e.process()},u.handleHandshake=function(e,t){var r=t.fragment,i=r.getByte(),a=r.getInt24();if(a>r.length())return e.fragmented=t,t.fragment=n.util.createBuffer(),r.read-=4,e.process();e.fragmented=null,r.read-=4;var s=r.bytes(a+4);r.read+=4,i in U[e.entity][e.expect]?(e.entity!==u.ConnectionEnd.server||e.open||e.fail||(e.handshaking=!0,e.session={version:null,extensions:{server_name:{serverNameList:[]}},cipherSuite:null,compressionMethod:null,serverCertificate:null,clientCertificate:null,md5:n.md.md5.create(),sha1:n.md.sha1.create()}),i!==u.HandshakeType.hello_request&&i!==u.HandshakeType.certificate_verify&&i!==u.HandshakeType.finished&&(e.session.md5.update(s),e.session.sha1.update(s)),U[e.entity][e.expect][i](e,t,a)):u.handleUnexpected(e,t)},u.handleApplicationData=function(e,t){e.data.putBuffer(t.fragment),e.dataReady(e),e.process()},u.handleHeartbeat=function(e,t){var r=t.fragment,i=r.getByte(),a=r.getInt16(),s=r.getBytes(a);if(i===u.HeartbeatMessageType.heartbeat_request){if(e.handshaking||a>s.length)return e.process();u.queue(e,u.createRecord(e,{type:u.ContentType.heartbeat,data:u.createHeartbeat(u.HeartbeatMessageType.heartbeat_response,s)})),u.flush(e)}else if(i===u.HeartbeatMessageType.heartbeat_response){if(s!==e.expectedHeartbeatPayload)return e.process();e.heartbeatReceived&&e.heartbeatReceived(e,n.util.createBuffer(s))}e.process()};var f=1,h=2,l=3,d=4,p=5,g=6,y=7,v=8,m=1,b=2,w=3,S=4,E=5,C=6,A=u.handleUnexpected,B=u.handleChangeCipherSpec,x=u.handleAlert,T=u.handleHandshake,I=u.handleApplicationData,F=u.handleHeartbeat,k=[];k[u.ConnectionEnd.client]=[[A,x,T,A,F],[A,x,T,A,F],[A,x,T,A,F],[A,x,T,A,F],[A,x,T,A,F],[B,x,A,A,F],[A,x,T,A,F],[A,x,T,I,F],[A,x,T,A,F]],k[u.ConnectionEnd.server]=[[A,x,T,A,F],[A,x,T,A,F],[A,x,T,A,F],[A,x,T,A,F],[B,x,A,A,F],[A,x,T,A,F],[A,x,T,I,F],[A,x,T,A,F]];var R=u.handleHelloRequest,D=u.handleServerHello,_=u.handleCertificate,P=u.handleServerKeyExchange,N=u.handleCertificateRequest,O=u.handleServerHelloDone,L=u.handleFinished,U=[];U[u.ConnectionEnd.client]=[[A,A,D,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A],[R,A,A,A,A,A,A,A,A,A,A,_,P,N,O,A,A,A,A,A,A],[R,A,A,A,A,A,A,A,A,A,A,A,P,N,O,A,A,A,A,A,A],[R,A,A,A,A,A,A,A,A,A,A,A,A,N,O,A,A,A,A,A,A],[R,A,A,A,A,A,A,A,A,A,A,A,A,A,O,A,A,A,A,A,A],[R,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A],[R,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,L],[R,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A],[R,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A]];var K=u.handleClientHello,M=u.handleClientKeyExchange,H=u.handleCertificateVerify;U[u.ConnectionEnd.server]=[[A,K,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A],[A,A,A,A,A,A,A,A,A,A,A,_,A,A,A,A,A,A,A,A,A],[A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,M,A,A,A,A],[A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,H,A,A,A,A,A],[A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A],[A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,L],[A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A],[A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A]],u.generateKeys=function(e,t){var r=i,n=t.client_random+t.server_random;e.session.resuming||(t.master_secret=r(t.pre_master_secret,"master secret",n,48).bytes(),t.pre_master_secret=null),n=t.server_random+t.client_random;var a=2*t.mac_key_length+2*t.enc_key_length,s=e.version.major===u.Versions.TLS_1_0.major&&e.version.minor===u.Versions.TLS_1_0.minor;s&&(a+=2*t.fixed_iv_length);var o=r(t.master_secret,"key expansion",n,a),c={client_write_MAC_key:o.getBytes(t.mac_key_length),server_write_MAC_key:o.getBytes(t.mac_key_length),client_write_key:o.getBytes(t.enc_key_length),server_write_key:o.getBytes(t.enc_key_length)};return s&&(c.client_write_IV=o.getBytes(t.fixed_iv_length),c.server_write_IV=o.getBytes(t.fixed_iv_length)),c},u.createConnectionState=function(e){var t=e.entity===u.ConnectionEnd.client,r=function(){var e={sequenceNumber:[0,0],macKey:null,macLength:0,macFunction:null,cipherState:null,cipherFunction:function(e){return!0},compressionState:null,compressFunction:function(e){return!0},updateSequenceNumber:function(){4294967295===e.sequenceNumber[1]?(e.sequenceNumber[1]=0,++e.sequenceNumber[0]):++e.sequenceNumber[1]}};return e},n={read:r(),write:r()};if(n.read.update=function(e,t){return n.read.cipherFunction(t,n.read)?n.read.compressFunction(e,t,n.read)||e.error(e,{message:"Could not decompress record.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.decompression_failure}}):e.error(e,{message:"Could not decrypt record or bad MAC.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.bad_record_mac}}),!e.fail},n.write.update=function(e,t){return n.write.compressFunction(e,t,n.write)?n.write.cipherFunction(t,n.write)||e.error(e,{message:"Could not encrypt record.",send:!1,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.internal_error}}):e.error(e,{message:"Could not compress record.",send:!1,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.internal_error}}),!e.fail},e.session){var i=e.session.sp;switch(e.session.cipherSuite.initSecurityParameters(i),i.keys=u.generateKeys(e,i),n.read.macKey=t?i.keys.server_write_MAC_key:i.keys.client_write_MAC_key,n.write.macKey=t?i.keys.client_write_MAC_key:i.keys.server_write_MAC_key,e.session.cipherSuite.initConnectionState(n,e,i),i.compression_algorithm){case u.CompressionMethod.none:break;case u.CompressionMethod.deflate:n.read.compressFunction=s,n.write.compressFunction=a;break;default:throw new Error("Unsupported compression algorithm.")}}return n},u.createRandom=function(){var e=new Date,t=+e+6e4*e.getTimezoneOffset(),r=n.util.createBuffer();return r.putInt32(t),r.putBytes(n.random.getBytes(28)),r},u.createRecord=function(e,t){return t.data?{type:t.type,version:{major:e.version.major,minor:e.version.minor},length:t.data.length(),fragment:t.data}:null},u.createAlert=function(e,t){var r=n.util.createBuffer();return r.putByte(t.level),r.putByte(t.description),u.createRecord(e,{type:u.ContentType.alert,data:r})},u.createClientHello=function(e){e.session.clientHelloVersion={major:e.version.major,minor:e.version.minor};for(var t=n.util.createBuffer(),r=0;r<e.cipherSuites.length;++r){var i=e.cipherSuites[r];t.putByte(i.id[0]),t.putByte(i.id[1])}var a=t.length(),s=n.util.createBuffer();s.putByte(u.CompressionMethod.none);var o=s.length(),f=n.util.createBuffer();if(e.virtualHost){var h=n.util.createBuffer();h.putByte(0),h.putByte(0);var l=n.util.createBuffer();l.putByte(0),c(l,2,n.util.createBuffer(e.virtualHost));var d=n.util.createBuffer();c(d,2,l),c(h,2,d),f.putBuffer(h)}var p=f.length();p>0&&(p+=2);var g=e.session.id,y=g.length+1+2+4+28+2+a+1+o+p,v=n.util.createBuffer();return v.putByte(u.HandshakeType.client_hello),v.putInt24(y),v.putByte(e.version.major),v.putByte(e.version.minor),v.putBytes(e.session.sp.client_random),c(v,1,n.util.createBuffer(g)),c(v,2,t),c(v,1,s),p>0&&c(v,2,f),v},u.createServerHello=function(e){var t=e.session.id,r=t.length+1+2+4+28+2+1,i=n.util.createBuffer();return i.putByte(u.HandshakeType.server_hello),i.putInt24(r),i.putByte(e.version.major),i.putByte(e.version.minor),i.putBytes(e.session.sp.server_random),c(i,1,n.util.createBuffer(t)),i.putByte(e.session.cipherSuite.id[0]),i.putByte(e.session.cipherSuite.id[1]),i.putByte(e.session.compressionMethod),i},u.createCertificate=function(e){var t,r=e.entity===u.ConnectionEnd.client,i=null;e.getCertificate&&(t=r?e.session.certificateRequest:e.session.extensions.server_name.serverNameList,i=e.getCertificate(e,t));var a=n.util.createBuffer();if(null!==i)try{n.util.isArray(i)||(i=[i]);for(var s=null,o=0;o<i.length;++o){var f=n.pem.decode(i[o])[0];if("CERTIFICATE"!==f.type&&"X509 CERTIFICATE"!==f.type&&"TRUSTED CERTIFICATE"!==f.type){var h=new Error('Could not convert certificate from PEM; PEM header type is not "CERTIFICATE", "X509 CERTIFICATE", or "TRUSTED CERTIFICATE".');throw h.headerType=f.type,h}if(f.procType&&"ENCRYPTED"===f.procType.type)throw new Error("Could not convert certificate from PEM; PEM is encrypted.");var l=n.util.createBuffer(f.body);null===s&&(s=n.asn1.fromDer(l.bytes(),!1));var d=n.util.createBuffer();c(d,3,l),a.putBuffer(d)}i=n.pki.certificateFromAsn1(s),r?e.session.clientCertificate=i:e.session.serverCertificate=i}catch(t){return e.error(e,{message:"Could not send certificate list.",cause:t,send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.bad_certificate}})}var p=3+a.length(),g=n.util.createBuffer();return g.putByte(u.HandshakeType.certificate),g.putInt24(p),c(g,3,a),g},u.createClientKeyExchange=function(e){var t=n.util.createBuffer();t.putByte(e.session.clientHelloVersion.major),t.putByte(e.session.clientHelloVersion.minor),t.putBytes(n.random.getBytes(46));var r=e.session.sp;r.pre_master_secret=t.getBytes();var i=(t=e.session.serverCertificate.publicKey.encrypt(r.pre_master_secret)).length+2,a=n.util.createBuffer();return a.putByte(u.HandshakeType.client_key_exchange),a.putInt24(i),a.putInt16(t.length),a.putBytes(t),a},u.createServerKeyExchange=function(e){return n.util.createBuffer()},u.getClientSignature=function(e,t){var r=n.util.createBuffer();r.putBuffer(e.session.md5.digest()),r.putBuffer(e.session.sha1.digest()),r=r.getBytes(),e.getSignature=e.getSignature||function(e,t,r){var i=null;if(e.getPrivateKey)try{i=e.getPrivateKey(e,e.session.clientCertificate),i=n.pki.privateKeyFromPem(i)}catch(t){e.error(e,{message:"Could not get private key.",cause:t,send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.internal_error}})}null===i?e.error(e,{message:"No private key set.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.internal_error}}):t=i.sign(t,null),r(e,t)},e.getSignature(e,r,t)},u.createCertificateVerify=function(e,t){var r=t.length+2,i=n.util.createBuffer();return i.putByte(u.HandshakeType.certificate_verify),i.putInt24(r),i.putInt16(t.length),i.putBytes(t),i},u.createCertificateRequest=function(e){var t=n.util.createBuffer();t.putByte(1);var r=n.util.createBuffer();for(var i in e.caStore.certs){var a=e.caStore.certs[i],s=n.pki.distinguishedNameToAsn1(a.subject),o=n.asn1.toDer(s);r.putInt16(o.length()),r.putBuffer(o)}var f=1+t.length()+2+r.length(),h=n.util.createBuffer();return h.putByte(u.HandshakeType.certificate_request),h.putInt24(f),c(h,1,t),c(h,2,r),h},u.createServerHelloDone=function(e){var t=n.util.createBuffer();return t.putByte(u.HandshakeType.server_hello_done),t.putInt24(0),t},u.createChangeCipherSpec=function(){var e=n.util.createBuffer();return e.putByte(1),e},u.createFinished=function(e){var t=n.util.createBuffer();t.putBuffer(e.session.md5.digest()),t.putBuffer(e.session.sha1.digest());var r=e.entity===u.ConnectionEnd.client,a=e.session.sp,s=r?"client finished":"server finished";t=i(a.master_secret,s,t.getBytes(),12);var o=n.util.createBuffer();return o.putByte(u.HandshakeType.finished),o.putInt24(t.length()),o.putBuffer(t),o},u.createHeartbeat=function(e,t,r){void 0===r&&(r=t.length);var i=n.util.createBuffer();i.putByte(e),i.putInt16(r),i.putBytes(t);var a=i.length(),s=Math.max(16,a-r-3);return i.putBytes(n.random.getBytes(s)),i},u.queue=function(e,t){if(t&&(0!==t.fragment.length()||t.type!==u.ContentType.handshake&&t.type!==u.ContentType.alert&&t.type!==u.ContentType.change_cipher_spec)){if(t.type===u.ContentType.handshake){var r=t.fragment.bytes();e.session.md5.update(r),e.session.sha1.update(r),r=null}var i;if(t.fragment.length()<=u.MaxFragment)i=[t];else{i=[];for(var a=t.fragment.bytes();a.length>u.MaxFragment;)i.push(u.createRecord(e,{type:t.type,data:n.util.createBuffer(a.slice(0,u.MaxFragment))})),a=a.slice(u.MaxFragment);a.length>0&&i.push(u.createRecord(e,{type:t.type,data:n.util.createBuffer(a)}))}for(var s=0;s<i.length&&!e.fail;++s){var o=i[s];e.state.current.write.update(e,o)&&e.records.push(o)}}},u.flush=function(e){for(var t=0;t<e.records.length;++t){var r=e.records[t];e.tlsData.putByte(r.type),e.tlsData.putByte(r.version.major),e.tlsData.putByte(r.version.minor),e.tlsData.putInt16(r.fragment.length()),e.tlsData.putBuffer(e.records[t].fragment)}return e.records=[],e.tlsDataReady(e)};var j=function(e){switch(e){case!0:return!0;case n.pki.certificateError.bad_certificate:return u.Alert.Description.bad_certificate;case n.pki.certificateError.unsupported_certificate:return u.Alert.Description.unsupported_certificate;case n.pki.certificateError.certificate_revoked:return u.Alert.Description.certificate_revoked;case n.pki.certificateError.certificate_expired:return u.Alert.Description.certificate_expired;case n.pki.certificateError.certificate_unknown:return u.Alert.Description.certificate_unknown;case n.pki.certificateError.unknown_ca:return u.Alert.Description.unknown_ca;default:return u.Alert.Description.bad_certificate}};for(var V in u.verifyCertificateChain=function(e,t){try{var r={};for(var i in e.verifyOptions)r[i]=e.verifyOptions[i];r.verify=function(t,r,i){j(t);var a=e.verify(e,t,r,i);if(!0!==a){if("object"==typeof a&&!n.util.isArray(a)){var s=new Error("The application rejected the certificate.");throw s.send=!0,s.alert={level:u.Alert.Level.fatal,description:u.Alert.Description.bad_certificate},a.message&&(s.message=a.message),a.alert&&(s.alert.description=a.alert),s}a!==t&&(a=function(e){switch(e){case!0:return!0;case u.Alert.Description.bad_certificate:return n.pki.certificateError.bad_certificate;case u.Alert.Description.unsupported_certificate:return n.pki.certificateError.unsupported_certificate;case u.Alert.Description.certificate_revoked:return n.pki.certificateError.certificate_revoked;case u.Alert.Description.certificate_expired:return n.pki.certificateError.certificate_expired;case u.Alert.Description.certificate_unknown:return n.pki.certificateError.certificate_unknown;case u.Alert.Description.unknown_ca:return n.pki.certificateError.unknown_ca;default:return n.pki.certificateError.bad_certificate}}(a))}return a},n.pki.verifyCertificateChain(e.caStore,t,r)}catch(t){var a=t;("object"!=typeof a||n.util.isArray(a))&&(a={send:!0,alert:{level:u.Alert.Level.fatal,description:j(t)}}),"send"in a||(a.send=!0),"alert"in a||(a.alert={level:u.Alert.Level.fatal,description:j(a.error)}),e.error(e,a)}return!e.fail},u.createSessionCache=function(e,t){var r=null;if(e&&e.getSession&&e.setSession&&e.order)r=e;else{for(var i in(r={}).cache=e||{},r.capacity=Math.max(t||100,1),r.order=[],e)r.order.length<=t?r.order.push(i):delete e[i];r.getSession=function(e){var t=null,i=null;if(e?i=n.util.bytesToHex(e):r.order.length>0&&(i=r.order[0]),null!==i&&i in r.cache)for(var a in t=r.cache[i],delete r.cache[i],r.order)if(r.order[a]===i){r.order.splice(a,1);break}return t},r.setSession=function(e,t){if(r.order.length===r.capacity){var i=r.order.shift();delete r.cache[i]}i=n.util.bytesToHex(e),r.order.push(i),r.cache[i]=t}}return r},u.createConnection=function(e){var t;t=e.caStore?n.util.isArray(e.caStore)?n.pki.createCaStore(e.caStore):e.caStore:n.pki.createCaStore();var r=e.cipherSuites||null;if(null===r)for(var i in r=[],u.CipherSuites)r.push(u.CipherSuites[i]);var a=e.server?u.ConnectionEnd.server:u.ConnectionEnd.client,s=e.sessionCache?u.createSessionCache(e.sessionCache):null,o={version:{major:u.Version.major,minor:u.Version.minor},entity:a,sessionId:e.sessionId,caStore:t,sessionCache:s,cipherSuites:r,connected:e.connected,virtualHost:e.virtualHost||null,verifyClient:e.verifyClient||!1,verify:e.verify||function(e,t,r,n){return t},verifyOptions:e.verifyOptions||{},getCertificate:e.getCertificate||null,getPrivateKey:e.getPrivateKey||null,getSignature:e.getSignature||null,input:n.util.createBuffer(),tlsData:n.util.createBuffer(),data:n.util.createBuffer(),tlsDataReady:e.tlsDataReady,dataReady:e.dataReady,heartbeatReceived:e.heartbeatReceived,closed:e.closed,error:function(t,r){r.origin=r.origin||(t.entity===u.ConnectionEnd.client?"client":"server"),r.send&&(u.queue(t,u.createAlert(t,r.alert)),u.flush(t));var n=!1!==r.fatal;n&&(t.fail=!0),e.error(t,r),n&&t.close(!1)},deflate:e.deflate||null,inflate:e.inflate||null,reset:function(e){o.version={major:u.Version.major,minor:u.Version.minor},o.record=null,o.session=null,o.peerCertificate=null,o.state={pending:null,current:null},o.expect=(o.entity,u.ConnectionEnd.client,0),o.fragmented=null,o.records=[],o.open=!1,o.handshakes=0,o.handshaking=!1,o.isConnected=!1,o.fail=!(e||void 0===e),o.input.clear(),o.tlsData.clear(),o.data.clear(),o.state.current=u.createConnectionState(o)}};return o.reset(),o.handshake=function(e){if(o.entity!==u.ConnectionEnd.client)o.error(o,{message:"Cannot initiate handshake as a server.",fatal:!1});else if(o.handshaking)o.error(o,{message:"Handshake already in progress.",fatal:!1});else{o.fail&&!o.open&&0===o.handshakes&&(o.fail=!1),o.handshaking=!0;var t=null;(e=e||"").length>0&&(o.sessionCache&&(t=o.sessionCache.getSession(e)),null===t&&(e="")),0===e.length&&o.sessionCache&&null!==(t=o.sessionCache.getSession())&&(e=t.id),o.session={id:e,version:null,cipherSuite:null,compressionMethod:null,serverCertificate:null,certificateRequest:null,clientCertificate:null,sp:{},md5:n.md.md5.create(),sha1:n.md.sha1.create()},t&&(o.version=t.version,o.session.sp=t.sp),o.session.sp.client_random=u.createRandom().getBytes(),o.open=!0,u.queue(o,u.createRecord(o,{type:u.ContentType.handshake,data:u.createClientHello(o)})),u.flush(o)}},o.process=function(e){var t=0;return e&&o.input.putBytes(e),o.fail||(null!==o.record&&o.record.ready&&o.record.fragment.isEmpty()&&(o.record=null),null===o.record&&(t=function(e){var t=0,r=e.input,i=r.length();if(i<5)t=5-i;else{e.record={type:r.getByte(),version:{major:r.getByte(),minor:r.getByte()},length:r.getInt16(),fragment:n.util.createBuffer(),ready:!1};var a=e.record.version.major===e.version.major;a&&e.session&&e.session.version&&(a=e.record.version.minor===e.version.minor),a||e.error(e,{message:"Incompatible TLS version.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.protocol_version}})}return t}(o)),o.fail||null===o.record||o.record.ready||(t=function(e){var t=0,r=e.input,n=r.length();return n<e.record.length?t=e.record.length-n:(e.record.fragment.putBytes(r.getBytes(e.record.length)),r.compact(),e.state.current.read.update(e,e.record)&&(null!==e.fragmented&&(e.fragmented.type===e.record.type?(e.fragmented.fragment.putBuffer(e.record.fragment),e.record=e.fragmented):e.error(e,{message:"Invalid fragmented record.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.unexpected_message}})),e.record.ready=!0)),t}(o)),!o.fail&&null!==o.record&&o.record.ready&&function(e,t){var r=t.type-u.ContentType.change_cipher_spec,n=k[e.entity][e.expect];r in n?n[r](e,t):u.handleUnexpected(e,t)}(o,o.record)),t},o.prepare=function(e){return u.queue(o,u.createRecord(o,{type:u.ContentType.application_data,data:n.util.createBuffer(e)})),u.flush(o)},o.prepareHeartbeatRequest=function(e,t){return e instanceof n.util.ByteBuffer&&(e=e.bytes()),void 0===t&&(t=e.length),o.expectedHeartbeatPayload=e,u.queue(o,u.createRecord(o,{type:u.ContentType.heartbeat,data:u.createHeartbeat(u.HeartbeatMessageType.heartbeat_request,e,t)})),u.flush(o)},o.close=function(e){if(!o.fail&&o.sessionCache&&o.session){var t={id:o.session.id,version:o.session.version,sp:o.session.sp};t.sp.keys=null,o.sessionCache.setSession(t.id,t)}o.open&&(o.open=!1,o.input.clear(),(o.isConnected||o.handshaking)&&(o.isConnected=o.handshaking=!1,u.queue(o,u.createAlert(o,{level:u.Alert.Level.warning,description:u.Alert.Description.close_notify})),u.flush(o)),o.closed(o)),o.reset(e)},o},e.exports=n.tls=n.tls||{},u)"function"!=typeof u[V]&&(n.tls[V]=u[V]);n.tls.prf_tls1=i,n.tls.hmac_sha1=function(e,t,r){var i=n.hmac.create();i.start("SHA1",e);var a=n.util.createBuffer();return a.putInt32(t[0]),a.putInt32(t[1]),a.putByte(r.type),a.putByte(r.version.major),a.putByte(r.version.minor),a.putInt16(r.length),a.putBytes(r.fragment.bytes()),i.update(a.getBytes()),i.digest().getBytes()},n.tls.createSessionCache=u.createSessionCache,n.tls.createConnection=u.createConnection},23564:(e,t,r)=>{var n=r(35208),i=r(42363).Buffer,a=r(28413),s=r(84775),o=e.exports=a.util=a.util||{};function c(e){if(8!==e&&16!==e&&24!==e&&32!==e)throw new Error("Only 8, 16, 24, or 32 bits supported: "+e)}function u(e){if(this.data="",this.read=0,"string"==typeof e)this.data=e;else if(o.isArrayBuffer(e)||o.isArrayBufferView(e))if(void 0!==i&&e instanceof i)this.data=e.toString("binary");else{var t=new Uint8Array(e);try{this.data=String.fromCharCode.apply(null,t)}catch(e){for(var r=0;r<t.length;++r)this.putByte(t[r])}}else(e instanceof u||"object"==typeof e&&"string"==typeof e.data&&"number"==typeof e.read)&&(this.data=e.data,this.read=e.read);this._constructedStringLength=0}!function(){if(void 0!==n&&n.nextTick,"function"==typeof setImmediate)return o.setImmediate=function(){return setImmediate.apply(void 0,arguments)},void(o.nextTick=function(e){return setImmediate(e)});if(o.setImmediate=function(e){setTimeout(e,0)},"undefined"!=typeof window&&"function"==typeof window.postMessage){var e="forge.setImmediate",t=[];o.setImmediate=function(r){t.push(r),1===t.length&&window.postMessage(e,"*")},window.addEventListener("message",(function(r){if(r.source===window&&r.data===e){r.stopPropagation();var n=t.slice();t.length=0,n.forEach((function(e){e()}))}}),!0)}if("undefined"!=typeof MutationObserver){var r=Date.now(),i=!0,a=document.createElement("div");t=[],new MutationObserver((function(){var e=t.slice();t.length=0,e.forEach((function(e){e()}))})).observe(a,{attributes:!0});var s=o.setImmediate;o.setImmediate=function(e){Date.now()-r>15?(r=Date.now(),s(e)):(t.push(e),1===t.length&&a.setAttribute("a",i=!i))}}o.nextTick=o.setImmediate}(),o.isNodejs=void 0!==n&&n.versions&&n.versions.node,o.globalScope=o.isNodejs?r.g:"undefined"==typeof self?window:self,o.isArray=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},o.isArrayBuffer=function(e){return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer},o.isArrayBufferView=function(e){return e&&o.isArrayBuffer(e.buffer)&&void 0!==e.byteLength},o.ByteBuffer=u,o.ByteStringBuffer=u,o.ByteStringBuffer.prototype._optimizeConstructedString=function(e){this._constructedStringLength+=e,this._constructedStringLength>4096&&(this.data.substr(0,1),this._constructedStringLength=0)},o.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read},o.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0},o.ByteStringBuffer.prototype.putByte=function(e){return this.putBytes(String.fromCharCode(e))},o.ByteStringBuffer.prototype.fillWithByte=function(e,t){e=String.fromCharCode(e);for(var r=this.data;t>0;)1&t&&(r+=e),(t>>>=1)>0&&(e+=e);return this.data=r,this._optimizeConstructedString(t),this},o.ByteStringBuffer.prototype.putBytes=function(e){return this.data+=e,this._optimizeConstructedString(e.length),this},o.ByteStringBuffer.prototype.putString=function(e){return this.putBytes(o.encodeUtf8(e))},o.ByteStringBuffer.prototype.putInt16=function(e){return this.putBytes(String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},o.ByteStringBuffer.prototype.putInt24=function(e){return this.putBytes(String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},o.ByteStringBuffer.prototype.putInt32=function(e){return this.putBytes(String.fromCharCode(e>>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},o.ByteStringBuffer.prototype.putInt16Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255))},o.ByteStringBuffer.prototype.putInt24Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255))},o.ByteStringBuffer.prototype.putInt32Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>24&255))},o.ByteStringBuffer.prototype.putInt=function(e,t){c(t);var r="";do{t-=8,r+=String.fromCharCode(e>>t&255)}while(t>0);return this.putBytes(r)},o.ByteStringBuffer.prototype.putSignedInt=function(e,t){return e<0&&(e+=2<<t-1),this.putInt(e,t)},o.ByteStringBuffer.prototype.putBuffer=function(e){return this.putBytes(e.getBytes())},o.ByteStringBuffer.prototype.getByte=function(){return this.data.charCodeAt(this.read++)},o.ByteStringBuffer.prototype.getInt16=function(){var e=this.data.charCodeAt(this.read)<<8^this.data.charCodeAt(this.read+1);return this.read+=2,e},o.ByteStringBuffer.prototype.getInt24=function(){var e=this.data.charCodeAt(this.read)<<16^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2);return this.read+=3,e},o.ByteStringBuffer.prototype.getInt32=function(){var e=this.data.charCodeAt(this.read)<<24^this.data.charCodeAt(this.read+1)<<16^this.data.charCodeAt(this.read+2)<<8^this.data.charCodeAt(this.read+3);return this.read+=4,e},o.ByteStringBuffer.prototype.getInt16Le=function(){var e=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8;return this.read+=2,e},o.ByteStringBuffer.prototype.getInt24Le=function(){var e=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16;return this.read+=3,e},o.ByteStringBuffer.prototype.getInt32Le=function(){var e=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16^this.data.charCodeAt(this.read+3)<<24;return this.read+=4,e},o.ByteStringBuffer.prototype.getInt=function(e){c(e);var t=0;do{t=(t<<8)+this.data.charCodeAt(this.read++),e-=8}while(e>0);return t},o.ByteStringBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),r=2<<e-2;return t>=r&&(t-=r<<1),t},o.ByteStringBuffer.prototype.getBytes=function(e){var t;return e?(e=Math.min(this.length(),e),t=this.data.slice(this.read,this.read+e),this.read+=e):0===e?t="":(t=0===this.read?this.data:this.data.slice(this.read),this.clear()),t},o.ByteStringBuffer.prototype.bytes=function(e){return void 0===e?this.data.slice(this.read):this.data.slice(this.read,this.read+e)},o.ByteStringBuffer.prototype.at=function(e){return this.data.charCodeAt(this.read+e)},o.ByteStringBuffer.prototype.setAt=function(e,t){return this.data=this.data.substr(0,this.read+e)+String.fromCharCode(t)+this.data.substr(this.read+e+1),this},o.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)},o.ByteStringBuffer.prototype.copy=function(){var e=o.createBuffer(this.data);return e.read=this.read,e},o.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this},o.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this},o.ByteStringBuffer.prototype.truncate=function(e){var t=Math.max(0,this.length()-e);return this.data=this.data.substr(this.read,t),this.read=0,this},o.ByteStringBuffer.prototype.toHex=function(){for(var e="",t=this.read;t<this.data.length;++t){var r=this.data.charCodeAt(t);r<16&&(e+="0"),e+=r.toString(16)}return e},o.ByteStringBuffer.prototype.toString=function(){return o.decodeUtf8(this.bytes())},o.DataBuffer=function(e,t){t=t||{},this.read=t.readOffset||0,this.growSize=t.growSize||1024;var r=o.isArrayBuffer(e),n=o.isArrayBufferView(e);if(r||n)return this.data=r?new DataView(e):new DataView(e.buffer,e.byteOffset,e.byteLength),void(this.write="writeOffset"in t?t.writeOffset:this.data.byteLength);this.data=new DataView(new ArrayBuffer(0)),this.write=0,null!=e&&this.putBytes(e),"writeOffset"in t&&(this.write=t.writeOffset)},o.DataBuffer.prototype.length=function(){return this.write-this.read},o.DataBuffer.prototype.isEmpty=function(){return this.length()<=0},o.DataBuffer.prototype.accommodate=function(e,t){if(this.length()>=e)return this;t=Math.max(t||this.growSize,e);var r=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),n=new Uint8Array(this.length()+t);return n.set(r),this.data=new DataView(n.buffer),this},o.DataBuffer.prototype.putByte=function(e){return this.accommodate(1),this.data.setUint8(this.write++,e),this},o.DataBuffer.prototype.fillWithByte=function(e,t){this.accommodate(t);for(var r=0;r<t;++r)this.data.setUint8(e);return this},o.DataBuffer.prototype.putBytes=function(e,t){if(o.isArrayBufferView(e)){var r=(n=new Uint8Array(e.buffer,e.byteOffset,e.byteLength)).byteLength-n.byteOffset;return this.accommodate(r),new Uint8Array(this.data.buffer,this.write).set(n),this.write+=r,this}if(o.isArrayBuffer(e)){var n=new Uint8Array(e);return this.accommodate(n.byteLength),new Uint8Array(this.data.buffer).set(n,this.write),this.write+=n.byteLength,this}if(e instanceof o.DataBuffer||"object"==typeof e&&"number"==typeof e.read&&"number"==typeof e.write&&o.isArrayBufferView(e.data))return n=new Uint8Array(e.data.byteLength,e.read,e.length()),this.accommodate(n.byteLength),new Uint8Array(e.data.byteLength,this.write).set(n),this.write+=n.byteLength,this;if(e instanceof o.ByteStringBuffer&&(e=e.data,t="binary"),t=t||"binary","string"==typeof e){var i;if("hex"===t)return this.accommodate(Math.ceil(e.length/2)),i=new Uint8Array(this.data.buffer,this.write),this.write+=o.binary.hex.decode(e,i,this.write),this;if("base64"===t)return this.accommodate(3*Math.ceil(e.length/4)),i=new Uint8Array(this.data.buffer,this.write),this.write+=o.binary.base64.decode(e,i,this.write),this;if("utf8"===t&&(e=o.encodeUtf8(e),t="binary"),"binary"===t||"raw"===t)return this.accommodate(e.length),i=new Uint8Array(this.data.buffer,this.write),this.write+=o.binary.raw.decode(i),this;if("utf16"===t)return this.accommodate(2*e.length),i=new Uint16Array(this.data.buffer,this.write),this.write+=o.text.utf16.encode(i),this;throw new Error("Invalid encoding: "+t)}throw Error("Invalid parameter: "+e)},o.DataBuffer.prototype.putBuffer=function(e){return this.putBytes(e),e.clear(),this},o.DataBuffer.prototype.putString=function(e){return this.putBytes(e,"utf16")},o.DataBuffer.prototype.putInt16=function(e){return this.accommodate(2),this.data.setInt16(this.write,e),this.write+=2,this},o.DataBuffer.prototype.putInt24=function(e){return this.accommodate(3),this.data.setInt16(this.write,e>>8&65535),this.data.setInt8(this.write,e>>16&255),this.write+=3,this},o.DataBuffer.prototype.putInt32=function(e){return this.accommodate(4),this.data.setInt32(this.write,e),this.write+=4,this},o.DataBuffer.prototype.putInt16Le=function(e){return this.accommodate(2),this.data.setInt16(this.write,e,!0),this.write+=2,this},o.DataBuffer.prototype.putInt24Le=function(e){return this.accommodate(3),this.data.setInt8(this.write,e>>16&255),this.data.setInt16(this.write,e>>8&65535,!0),this.write+=3,this},o.DataBuffer.prototype.putInt32Le=function(e){return this.accommodate(4),this.data.setInt32(this.write,e,!0),this.write+=4,this},o.DataBuffer.prototype.putInt=function(e,t){c(t),this.accommodate(t/8);do{t-=8,this.data.setInt8(this.write++,e>>t&255)}while(t>0);return this},o.DataBuffer.prototype.putSignedInt=function(e,t){return c(t),this.accommodate(t/8),e<0&&(e+=2<<t-1),this.putInt(e,t)},o.DataBuffer.prototype.getByte=function(){return this.data.getInt8(this.read++)},o.DataBuffer.prototype.getInt16=function(){var e=this.data.getInt16(this.read);return this.read+=2,e},o.DataBuffer.prototype.getInt24=function(){var e=this.data.getInt16(this.read)<<8^this.data.getInt8(this.read+2);return this.read+=3,e},o.DataBuffer.prototype.getInt32=function(){var e=this.data.getInt32(this.read);return this.read+=4,e},o.DataBuffer.prototype.getInt16Le=function(){var e=this.data.getInt16(this.read,!0);return this.read+=2,e},o.DataBuffer.prototype.getInt24Le=function(){var e=this.data.getInt8(this.read)^this.data.getInt16(this.read+1,!0)<<8;return this.read+=3,e},o.DataBuffer.prototype.getInt32Le=function(){var e=this.data.getInt32(this.read,!0);return this.read+=4,e},o.DataBuffer.prototype.getInt=function(e){c(e);var t=0;do{t=(t<<8)+this.data.getInt8(this.read++),e-=8}while(e>0);return t},o.DataBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),r=2<<e-2;return t>=r&&(t-=r<<1),t},o.DataBuffer.prototype.getBytes=function(e){var t;return e?(e=Math.min(this.length(),e),t=this.data.slice(this.read,this.read+e),this.read+=e):0===e?t="":(t=0===this.read?this.data:this.data.slice(this.read),this.clear()),t},o.DataBuffer.prototype.bytes=function(e){return void 0===e?this.data.slice(this.read):this.data.slice(this.read,this.read+e)},o.DataBuffer.prototype.at=function(e){return this.data.getUint8(this.read+e)},o.DataBuffer.prototype.setAt=function(e,t){return this.data.setUint8(e,t),this},o.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)},o.DataBuffer.prototype.copy=function(){return new o.DataBuffer(this)},o.DataBuffer.prototype.compact=function(){if(this.read>0){var e=new Uint8Array(this.data.buffer,this.read),t=new Uint8Array(e.byteLength);t.set(e),this.data=new DataView(t),this.write-=this.read,this.read=0}return this},o.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this},o.DataBuffer.prototype.truncate=function(e){return this.write=Math.max(0,this.length()-e),this.read=Math.min(this.read,this.write),this},o.DataBuffer.prototype.toHex=function(){for(var e="",t=this.read;t<this.data.byteLength;++t){var r=this.data.getUint8(t);r<16&&(e+="0"),e+=r.toString(16)}return e},o.DataBuffer.prototype.toString=function(e){var t=new Uint8Array(this.data,this.read,this.length());if("binary"===(e=e||"utf8")||"raw"===e)return o.binary.raw.encode(t);if("hex"===e)return o.binary.hex.encode(t);if("base64"===e)return o.binary.base64.encode(t);if("utf8"===e)return o.text.utf8.decode(t);if("utf16"===e)return o.text.utf16.decode(t);throw new Error("Invalid encoding: "+e)},o.createBuffer=function(e,t){return t=t||"raw",void 0!==e&&"utf8"===t&&(e=o.encodeUtf8(e)),new o.ByteBuffer(e)},o.fillString=function(e,t){for(var r="";t>0;)1&t&&(r+=e),(t>>>=1)>0&&(e+=e);return r},o.xorBytes=function(e,t,r){for(var n="",i="",a="",s=0,o=0;r>0;--r,++s)i=e.charCodeAt(s)^t.charCodeAt(s),o>=10&&(n+=a,a="",o=0),a+=String.fromCharCode(i),++o;return n+a},o.hexToBytes=function(e){var t="",r=0;for(!0&e.length&&(r=1,t+=String.fromCharCode(parseInt(e[0],16)));r<e.length;r+=2)t+=String.fromCharCode(parseInt(e.substr(r,2),16));return t},o.bytesToHex=function(e){return o.createBuffer(e).toHex()},o.int32ToBytes=function(e){return String.fromCharCode(e>>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e)};var f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",h=[62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,64,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],l="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";o.encode64=function(e,t){for(var r,n,i,a="",s="",o=0;o<e.length;)r=e.charCodeAt(o++),n=e.charCodeAt(o++),i=e.charCodeAt(o++),a+=f.charAt(r>>2),a+=f.charAt((3&r)<<4|n>>4),isNaN(n)?a+="==":(a+=f.charAt((15&n)<<2|i>>6),a+=isNaN(i)?"=":f.charAt(63&i)),t&&a.length>t&&(s+=a.substr(0,t)+"\r\n",a=a.substr(t));return s+a},o.decode64=function(e){e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var t,r,n,i,a="",s=0;s<e.length;)t=h[e.charCodeAt(s++)-43],r=h[e.charCodeAt(s++)-43],n=h[e.charCodeAt(s++)-43],i=h[e.charCodeAt(s++)-43],a+=String.fromCharCode(t<<2|r>>4),64!==n&&(a+=String.fromCharCode((15&r)<<4|n>>2),64!==i&&(a+=String.fromCharCode((3&n)<<6|i)));return a},o.encodeUtf8=function(e){return unescape(encodeURIComponent(e))},o.decodeUtf8=function(e){return decodeURIComponent(escape(e))},o.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:s.encode,decode:s.decode}},o.binary.raw.encode=function(e){return String.fromCharCode.apply(null,e)},o.binary.raw.decode=function(e,t,r){var n=t;n||(n=new Uint8Array(e.length));for(var i=r=r||0,a=0;a<e.length;++a)n[i++]=e.charCodeAt(a);return t?i-r:n},o.binary.hex.encode=o.bytesToHex,o.binary.hex.decode=function(e,t,r){var n=t;n||(n=new Uint8Array(Math.ceil(e.length/2)));var i=0,a=r=r||0;for(1&e.length&&(i=1,n[a++]=parseInt(e[0],16));i<e.length;i+=2)n[a++]=parseInt(e.substr(i,2),16);return t?a-r:n},o.binary.base64.encode=function(e,t){for(var r,n,i,a="",s="",o=0;o<e.byteLength;)r=e[o++],n=e[o++],i=e[o++],a+=f.charAt(r>>2),a+=f.charAt((3&r)<<4|n>>4),isNaN(n)?a+="==":(a+=f.charAt((15&n)<<2|i>>6),a+=isNaN(i)?"=":f.charAt(63&i)),t&&a.length>t&&(s+=a.substr(0,t)+"\r\n",a=a.substr(t));return s+a},o.binary.base64.decode=function(e,t,r){var n,i,a,s,o=t;o||(o=new Uint8Array(3*Math.ceil(e.length/4))),e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var c=0,u=r=r||0;c<e.length;)n=h[e.charCodeAt(c++)-43],i=h[e.charCodeAt(c++)-43],a=h[e.charCodeAt(c++)-43],s=h[e.charCodeAt(c++)-43],o[u++]=n<<2|i>>4,64!==a&&(o[u++]=(15&i)<<4|a>>2,64!==s&&(o[u++]=(3&a)<<6|s));return t?u-r:o.subarray(0,u)},o.binary.base58.encode=function(e,t){return o.binary.baseN.encode(e,l,t)},o.binary.base58.decode=function(e,t){return o.binary.baseN.decode(e,l,t)},o.text={utf8:{},utf16:{}},o.text.utf8.encode=function(e,t,r){e=o.encodeUtf8(e);var n=t;n||(n=new Uint8Array(e.length));for(var i=r=r||0,a=0;a<e.length;++a)n[i++]=e.charCodeAt(a);return t?i-r:n},o.text.utf8.decode=function(e){return o.decodeUtf8(String.fromCharCode.apply(null,e))},o.text.utf16.encode=function(e,t,r){var n=t;n||(n=new Uint8Array(2*e.length));for(var i=new Uint16Array(n.buffer),a=r=r||0,s=r,o=0;o<e.length;++o)i[s++]=e.charCodeAt(o),a+=2;return t?a-r:n},o.text.utf16.decode=function(e){return String.fromCharCode.apply(null,new Uint16Array(e.buffer))},o.deflate=function(e,t,r){if(t=o.decode64(e.deflate(o.encode64(t)).rval),r){var n=2;32&t.charCodeAt(1)&&(n=6),t=t.substring(n,t.length-4)}return t},o.inflate=function(e,t,r){var n=e.inflate(o.encode64(t)).rval;return null===n?null:o.decode64(n)};var d=function(e,t,r){if(!e)throw new Error("WebStorage not available.");var n;if(null===r?n=e.removeItem(t):(r=o.encode64(JSON.stringify(r)),n=e.setItem(t,r)),void 0!==n&&!0!==n.rval){var i=new Error(n.error.message);throw i.id=n.error.id,i.name=n.error.name,i}},p=function(e,t){if(!e)throw new Error("WebStorage not available.");var r=e.getItem(t);if(e.init)if(null===r.rval){if(r.error){var n=new Error(r.error.message);throw n.id=r.error.id,n.name=r.error.name,n}r=null}else r=r.rval;return null!==r&&(r=JSON.parse(o.decode64(r))),r},g=function(e,t,r,n){var i=p(e,t);null===i&&(i={}),i[r]=n,d(e,t,i)},y=function(e,t,r){var n=p(e,t);return null!==n&&(n=r in n?n[r]:null),n},v=function(e,t,r){var n=p(e,t);if(null!==n&&r in n){delete n[r];var i=!0;for(var a in n){i=!1;break}i&&(n=null),d(e,t,n)}},m=function(e,t){d(e,t,null)},b=function(e,t,r){var n,i=null;void 0===r&&(r=["web","flash"]);var a=!1,s=null;for(var o in r){n=r[o];try{if("flash"===n||"both"===n){if(null===t[0])throw new Error("Flash local storage not available.");i=e.apply(this,t),a="flash"===n}"web"!==n&&"both"!==n||(t[0]=localStorage,i=e.apply(this,t),a=!0)}catch(e){s=e}if(a)break}if(!a)throw s;return i};o.setItem=function(e,t,r,n,i){b(g,arguments,i)},o.getItem=function(e,t,r,n){return b(y,arguments,n)},o.removeItem=function(e,t,r,n){b(v,arguments,n)},o.clearItems=function(e,t,r){b(m,arguments,r)},o.isEmpty=function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0},o.format=function(e){for(var t,r,n=/%./g,i=0,a=[],s=0;t=n.exec(e);){(r=e.substring(s,n.lastIndex-2)).length>0&&a.push(r),s=n.lastIndex;var o=t[0][1];switch(o){case"s":case"o":i<arguments.length?a.push(arguments[1+i++]):a.push("<?>");break;case"%":a.push("%");break;default:a.push("<%"+o+"?>")}}return a.push(e.substring(s)),a.join("")},o.formatNumber=function(e,t,r,n){var i=e,a=isNaN(t=Math.abs(t))?2:t,s=void 0===r?",":r,o=void 0===n?".":n,c=i<0?"-":"",u=parseInt(i=Math.abs(+i||0).toFixed(a),10)+"",f=u.length>3?u.length%3:0;return c+(f?u.substr(0,f)+o:"")+u.substr(f).replace(/(\d{3})(?=\d)/g,"$1"+o)+(a?s+Math.abs(i-u).toFixed(a).slice(2):"")},o.formatSize=function(e){return e>=1073741824?o.formatNumber(e/1073741824,2,".","")+" GiB":e>=1048576?o.formatNumber(e/1048576,2,".","")+" MiB":e>=1024?o.formatNumber(e/1024,0)+" KiB":o.formatNumber(e,0)+" bytes"},o.bytesFromIP=function(e){return-1!==e.indexOf(".")?o.bytesFromIPv4(e):-1!==e.indexOf(":")?o.bytesFromIPv6(e):null},o.bytesFromIPv4=function(e){if(4!==(e=e.split(".")).length)return null;for(var t=o.createBuffer(),r=0;r<e.length;++r){var n=parseInt(e[r],10);if(isNaN(n))return null;t.putByte(n)}return t.getBytes()},o.bytesFromIPv6=function(e){for(var t=0,r=2*(8-(e=e.split(":").filter((function(e){return 0===e.length&&++t,!0}))).length+t),n=o.createBuffer(),i=0;i<8;++i)if(e[i]&&0!==e[i].length){var a=o.hexToBytes(e[i]);a.length<2&&n.putByte(0),n.putBytes(a)}else n.fillWithByte(0,r),r=0;return n.getBytes()},o.bytesToIP=function(e){return 4===e.length?o.bytesToIPv4(e):16===e.length?o.bytesToIPv6(e):null},o.bytesToIPv4=function(e){if(4!==e.length)return null;for(var t=[],r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t.join(".")},o.bytesToIPv6=function(e){if(16!==e.length)return null;for(var t=[],r=[],n=0,i=0;i<e.length;i+=2){for(var a=o.bytesToHex(e[i]+e[i+1]);"0"===a[0]&&"0"!==a;)a=a.substr(1);if("0"===a){var s=r[r.length-1],c=t.length;s&&c===s.end+1?(s.end=c,s.end-s.start>r[n].end-r[n].start&&(n=r.length-1)):r.push({start:c,end:c})}t.push(a)}if(r.length>0){var u=r[n];u.end-u.start>0&&(t.splice(u.start,u.end-u.start+1,""),0===u.start&&t.unshift(""),7===u.end&&t.push(""))}return t.join(":")},o.estimateCores=function(e,t){if("function"==typeof e&&(t=e,e={}),e=e||{},"cores"in o&&!e.update)return t(null,o.cores);if("undefined"!=typeof navigator&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return o.cores=navigator.hardwareConcurrency,t(null,o.cores);if("undefined"==typeof Worker)return o.cores=1,t(null,o.cores);if("undefined"==typeof Blob)return o.cores=2,t(null,o.cores);var r=URL.createObjectURL(new Blob(["(",function(){self.addEventListener("message",(function(e){for(var t=Date.now(),r=t+4;Date.now()<r;);self.postMessage({st:t,et:r})}))}.toString(),")()"],{type:"application/javascript"}));!function e(n,i,a){if(0===i){var s=Math.floor(n.reduce((function(e,t){return e+t}),0)/n.length);return o.cores=Math.max(1,s),URL.revokeObjectURL(r),t(null,o.cores)}!function(e,t){for(var n=[],i=[],a=0;a<e;++a){var s=new Worker(r);s.addEventListener("message",(function(r){if(i.push(r.data),i.length===e){for(var a=0;a<e;++a)n[a].terminate();t(0,i)}})),n.push(s)}for(a=0;a<e;++a)n[a].postMessage(a)}(a,(function(t,r){n.push(function(e,t){for(var r=[],n=0;n<e;++n)for(var i=t[n],a=r[n]=[],s=0;s<e;++s)if(n!==s){var o=t[s];(i.st>o.st&&i.st<o.et||o.st>i.st&&o.st<i.et)&&a.push(s)}return r.reduce((function(e,t){return Math.max(e,t.length)}),0)}(a,r)),e(n,i-1,a)}))}([],5,16)}},14284:(e,t,r)=>{var n=r(28413);r(72057),r(25129),r(35690),r(25853),r(22328),r(12889),r(67928),r(26892),r(72112),r(23564);var i=n.asn1,a=e.exports=n.pki=n.pki||{},s=a.oids,o={};o.CN=s.commonName,o.commonName="CN",o.C=s.countryName,o.countryName="C",o.L=s.localityName,o.localityName="L",o.ST=s.stateOrProvinceName,o.stateOrProvinceName="ST",o.O=s.organizationName,o.organizationName="O",o.OU=s.organizationalUnitName,o.organizationalUnitName="OU",o.E=s.emailAddress,o.emailAddress="E";var c=n.pki.rsa.publicKeyValidator,u={name:"Certificate",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"tbsCertificate",value:[{name:"Certificate.TBSCertificate.version",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.version.integer",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"certVersion"}]},{name:"Certificate.TBSCertificate.serialNumber",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"certSerialNumber"},{name:"Certificate.TBSCertificate.signature",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.signature.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"certinfoSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:i.Class.UNIVERSAL,optional:!0,captureAsn1:"certinfoSignatureParams"}]},{name:"Certificate.TBSCertificate.issuer",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"certIssuer"},{name:"Certificate.TBSCertificate.validity",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.validity.notBefore (utc)",tagClass:i.Class.UNIVERSAL,type:i.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity1UTCTime"},{name:"Certificate.TBSCertificate.validity.notBefore (generalized)",tagClass:i.Class.UNIVERSAL,type:i.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity2GeneralizedTime"},{name:"Certificate.TBSCertificate.validity.notAfter (utc)",tagClass:i.Class.UNIVERSAL,type:i.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity3UTCTime"},{name:"Certificate.TBSCertificate.validity.notAfter (generalized)",tagClass:i.Class.UNIVERSAL,type:i.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity4GeneralizedTime"}]},{name:"Certificate.TBSCertificate.subject",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"certSubject"},c,{name:"Certificate.TBSCertificate.issuerUniqueID",tagClass:i.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.issuerUniqueID.id",tagClass:i.Class.UNIVERSAL,type:i.Type.BITSTRING,constructed:!1,captureBitStringValue:"certIssuerUniqueId"}]},{name:"Certificate.TBSCertificate.subjectUniqueID",tagClass:i.Class.CONTEXT_SPECIFIC,type:2,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.subjectUniqueID.id",tagClass:i.Class.UNIVERSAL,type:i.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSubjectUniqueId"}]},{name:"Certificate.TBSCertificate.extensions",tagClass:i.Class.CONTEXT_SPECIFIC,type:3,constructed:!0,captureAsn1:"certExtensions",optional:!0}]},{name:"Certificate.signatureAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.signatureAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"certSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:i.Class.UNIVERSAL,optional:!0,captureAsn1:"certSignatureParams"}]},{name:"Certificate.signatureValue",tagClass:i.Class.UNIVERSAL,type:i.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSignature"}]},f={name:"rsapss",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.hashAlgorithm",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier",tagClass:i.Class.UNIVERSAL,type:i.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"hashOid"}]}]},{name:"rsapss.maskGenAlgorithm",tagClass:i.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier",tagClass:i.Class.UNIVERSAL,type:i.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"maskGenOid"},{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"maskGenHashOid"}]}]}]},{name:"rsapss.saltLength",tagClass:i.Class.CONTEXT_SPECIFIC,type:2,optional:!0,value:[{name:"rsapss.saltLength.saltLength",tagClass:i.Class.UNIVERSAL,type:i.Class.INTEGER,constructed:!1,capture:"saltLength"}]},{name:"rsapss.trailerField",tagClass:i.Class.CONTEXT_SPECIFIC,type:3,optional:!0,value:[{name:"rsapss.trailer.trailer",tagClass:i.Class.UNIVERSAL,type:i.Class.INTEGER,constructed:!1,capture:"trailer"}]}]},h={name:"CertificationRequestInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfo",value:[{name:"CertificationRequestInfo.integer",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"certificationRequestInfoVersion"},{name:"CertificationRequestInfo.subject",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfoSubject"},c,{name:"CertificationRequestInfo.attributes",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"certificationRequestInfoAttributes",value:[{name:"CertificationRequestInfo.attributes",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequestInfo.attributes.type",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1},{name:"CertificationRequestInfo.attributes.value",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,constructed:!0}]}]}]},l={name:"CertificationRequest",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"csr",value:[h,{name:"CertificationRequest.signatureAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequest.signatureAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"csrSignatureOid"},{name:"CertificationRequest.signatureAlgorithm.parameters",tagClass:i.Class.UNIVERSAL,optional:!0,captureAsn1:"csrSignatureParams"}]},{name:"CertificationRequest.signature",tagClass:i.Class.UNIVERSAL,type:i.Type.BITSTRING,constructed:!1,captureBitStringValue:"csrSignature"}]};function d(e,t){"string"==typeof t&&(t={shortName:t});for(var r,n=null,i=0;null===n&&i<e.attributes.length;++i)r=e.attributes[i],(t.type&&t.type===r.type||t.name&&t.name===r.name||t.shortName&&t.shortName===r.shortName)&&(n=r);return n}a.RDNAttributesAsArray=function(e,t){for(var r,n,a,c=[],u=0;u<e.value.length;++u){r=e.value[u];for(var f=0;f<r.value.length;++f)a={},n=r.value[f],a.type=i.derToOid(n.value[0].value),a.value=n.value[1].value,a.valueTagClass=n.value[1].type,a.type in s&&(a.name=s[a.type],a.name in o&&(a.shortName=o[a.name])),t&&(t.update(a.type),t.update(a.value)),c.push(a)}return c},a.CRIAttributesAsArray=function(e){for(var t=[],r=0;r<e.length;++r)for(var n=e[r],c=i.derToOid(n.value[0].value),u=n.value[1].value,f=0;f<u.length;++f){var h={};if(h.type=c,h.value=u[f].value,h.valueTagClass=u[f].type,h.type in s&&(h.name=s[h.type],h.name in o&&(h.shortName=o[h.name])),h.type===s.extensionRequest){h.extensions=[];for(var l=0;l<h.value.length;++l)h.extensions.push(a.certificateExtensionFromAsn1(h.value[l]))}t.push(h)}return t};var p=function(e,t,r){var n={};if(e!==s["RSASSA-PSS"])return n;r&&(n={hash:{algorithmOid:s.sha1},mgf:{algorithmOid:s.mgf1,hash:{algorithmOid:s.sha1}},saltLength:20});var a={},o=[];if(!i.validate(t,f,a,o)){var c=new Error("Cannot read RSASSA-PSS parameter block.");throw c.errors=o,c}return void 0!==a.hashOid&&(n.hash=n.hash||{},n.hash.algorithmOid=i.derToOid(a.hashOid)),void 0!==a.maskGenOid&&(n.mgf=n.mgf||{},n.mgf.algorithmOid=i.derToOid(a.maskGenOid),n.mgf.hash=n.mgf.hash||{},n.mgf.hash.algorithmOid=i.derToOid(a.maskGenHashOid)),void 0!==a.saltLength&&(n.saltLength=a.saltLength.charCodeAt(0)),n},g=function(e){switch(s[e.signatureOid]){case"sha1WithRSAEncryption":case"sha1WithRSASignature":return n.md.sha1.create();case"md5WithRSAEncryption":return n.md.md5.create();case"sha256WithRSAEncryption":case"RSASSA-PSS":return n.md.sha256.create();case"sha384WithRSAEncryption":return n.md.sha384.create();case"sha512WithRSAEncryption":return n.md.sha512.create();default:var t=new Error("Could not compute "+e.type+" digest. Unknown signature OID.");throw t.signatureOid=e.signatureOid,t}},y=function(e){var t,r=e.certificate;switch(r.signatureOid){case s.sha1WithRSAEncryption:case s.sha1WithRSASignature:break;case s["RSASSA-PSS"]:var i,a,o;if(void 0===(i=s[r.signatureParameters.mgf.hash.algorithmOid])||void 0===n.md[i])throw(o=new Error("Unsupported MGF hash function.")).oid=r.signatureParameters.mgf.hash.algorithmOid,o.name=i,o;if(void 0===(a=s[r.signatureParameters.mgf.algorithmOid])||void 0===n.mgf[a])throw(o=new Error("Unsupported MGF function.")).oid=r.signatureParameters.mgf.algorithmOid,o.name=a,o;if(a=n.mgf[a].create(n.md[i].create()),void 0===(i=s[r.signatureParameters.hash.algorithmOid])||void 0===n.md[i])throw(o=new Error("Unsupported RSASSA-PSS hash function.")).oid=r.signatureParameters.hash.algorithmOid,o.name=i,o;t=n.pss.create(n.md[i].create(),a,r.signatureParameters.saltLength)}return r.publicKey.verify(e.md.digest().getBytes(),e.signature,t)};function v(e){for(var t,r,a=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]),s=e.attributes,o=0;o<s.length;++o){var c=(t=s[o]).value,u=i.Type.PRINTABLESTRING;"valueTagClass"in t&&(u=t.valueTagClass)===i.Type.UTF8&&(c=n.util.encodeUtf8(c)),r=i.create(i.Class.UNIVERSAL,i.Type.SET,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(t.type).getBytes()),i.create(i.Class.UNIVERSAL,u,!1,c)])]),a.value.push(r)}return a}function m(e){for(var t,r=0;r<e.length;++r){if(void 0===(t=e[r]).name&&(t.type&&t.type in a.oids?t.name=a.oids[t.type]:t.shortName&&t.shortName in o&&(t.name=a.oids[o[t.shortName]])),void 0===t.type){if(!t.name||!(t.name in a.oids))throw(c=new Error("Attribute type not specified.")).attribute=t,c;t.type=a.oids[t.name]}if(void 0===t.shortName&&t.name&&t.name in o&&(t.shortName=o[t.name]),t.type===s.extensionRequest&&(t.valueConstructed=!0,t.valueTagClass=i.Type.SEQUENCE,!t.value&&t.extensions)){t.value=[];for(var n=0;n<t.extensions.length;++n)t.value.push(a.certificateExtensionToAsn1(b(t.extensions[n])))}var c;if(void 0===t.value)throw(c=new Error("Attribute value not specified.")).attribute=t,c}}function b(e,t){if(t=t||{},void 0===e.name&&e.id&&e.id in a.oids&&(e.name=a.oids[e.id]),void 0===e.id){if(!e.name||!(e.name in a.oids))throw(S=new Error("Extension ID not specified.")).extension=e,S;e.id=a.oids[e.name]}if(void 0!==e.value)return e;if("keyUsage"===e.name){var r=0,o=0,c=0;e.digitalSignature&&(o|=128,r=7),e.nonRepudiation&&(o|=64,r=6),e.keyEncipherment&&(o|=32,r=5),e.dataEncipherment&&(o|=16,r=4),e.keyAgreement&&(o|=8,r=3),e.keyCertSign&&(o|=4,r=2),e.cRLSign&&(o|=2,r=1),e.encipherOnly&&(o|=1,r=0),e.decipherOnly&&(c|=128,r=7);var u=String.fromCharCode(r);0!==c?u+=String.fromCharCode(o)+String.fromCharCode(c):0!==o&&(u+=String.fromCharCode(o)),e.value=i.create(i.Class.UNIVERSAL,i.Type.BITSTRING,!1,u)}else if("basicConstraints"===e.name)e.value=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]),e.cA&&e.value.value.push(i.create(i.Class.UNIVERSAL,i.Type.BOOLEAN,!1,String.fromCharCode(255))),"pathLenConstraint"in e&&e.value.value.push(i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(e.pathLenConstraint).getBytes()));else if("extKeyUsage"===e.name){e.value=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]);var f=e.value.value;for(var h in e)!0===e[h]&&(h in s?f.push(i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(s[h]).getBytes())):-1!==h.indexOf(".")&&f.push(i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(h).getBytes())))}else if("nsCertType"===e.name)r=0,o=0,e.client&&(o|=128,r=7),e.server&&(o|=64,r=6),e.email&&(o|=32,r=5),e.objsign&&(o|=16,r=4),e.reserved&&(o|=8,r=3),e.sslCA&&(o|=4,r=2),e.emailCA&&(o|=2,r=1),e.objCA&&(o|=1,r=0),u=String.fromCharCode(r),0!==o&&(u+=String.fromCharCode(o)),e.value=i.create(i.Class.UNIVERSAL,i.Type.BITSTRING,!1,u);else if("subjectAltName"===e.name||"issuerAltName"===e.name){e.value=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]);for(var l=0;l<e.altNames.length;++l){if(u=(m=e.altNames[l]).value,7===m.type&&m.ip){if(null===(u=n.util.bytesFromIP(m.ip)))throw(S=new Error('Extension "ip" value is not a valid IPv4 or IPv6 address.')).extension=e,S}else 8===m.type&&(u=m.oid?i.oidToDer(i.oidToDer(m.oid)):i.oidToDer(u));e.value.value.push(i.create(i.Class.CONTEXT_SPECIFIC,m.type,!1,u))}}else if("nsComment"===e.name&&t.cert){if(!/^[\x00-\x7F]*$/.test(e.comment)||e.comment.length<1||e.comment.length>128)throw new Error('Invalid "nsComment" content.');e.value=i.create(i.Class.UNIVERSAL,i.Type.IA5STRING,!1,e.comment)}else if("subjectKeyIdentifier"===e.name&&t.cert){var d=t.cert.generateSubjectKeyIdentifier();e.subjectKeyIdentifier=d.toHex(),e.value=i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,d.getBytes())}else if("authorityKeyIdentifier"===e.name&&t.cert){if(e.value=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]),f=e.value.value,e.keyIdentifier){var p=!0===e.keyIdentifier?t.cert.generateSubjectKeyIdentifier().getBytes():e.keyIdentifier;f.push(i.create(i.Class.CONTEXT_SPECIFIC,0,!1,p))}if(e.authorityCertIssuer){var g=[i.create(i.Class.CONTEXT_SPECIFIC,4,!0,[v(!0===e.authorityCertIssuer?t.cert.issuer:e.authorityCertIssuer)])];f.push(i.create(i.Class.CONTEXT_SPECIFIC,1,!0,g))}if(e.serialNumber){var y=n.util.hexToBytes(!0===e.serialNumber?t.cert.serialNumber:e.serialNumber);f.push(i.create(i.Class.CONTEXT_SPECIFIC,2,!1,y))}}else if("cRLDistributionPoints"===e.name){e.value=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]),f=e.value.value;var m,b=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]),w=i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[]);for(l=0;l<e.altNames.length;++l){if(u=(m=e.altNames[l]).value,7===m.type&&m.ip){if(null===(u=n.util.bytesFromIP(m.ip)))throw(S=new Error('Extension "ip" value is not a valid IPv4 or IPv6 address.')).extension=e,S}else 8===m.type&&(u=m.oid?i.oidToDer(i.oidToDer(m.oid)):i.oidToDer(u));w.value.push(i.create(i.Class.CONTEXT_SPECIFIC,m.type,!1,u))}b.value.push(i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[w])),f.push(b)}var S;if(void 0===e.value)throw(S=new Error("Extension value not specified.")).extension=e,S;return e}function w(e,t){if(e===s["RSASSA-PSS"]){var r=[];return void 0!==t.hash.algorithmOid&&r.push(i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(t.hash.algorithmOid).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")])])),void 0!==t.mgf.algorithmOid&&r.push(i.create(i.Class.CONTEXT_SPECIFIC,1,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(t.mgf.algorithmOid).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(t.mgf.hash.algorithmOid).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")])])])),void 0!==t.saltLength&&r.push(i.create(i.Class.CONTEXT_SPECIFIC,2,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(t.saltLength).getBytes())])),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,r)}return i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")}function S(e){var t=i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[]);if(0===e.attributes.length)return t;for(var r=e.attributes,a=0;a<r.length;++a){var s=r[a],o=s.value,c=i.Type.UTF8;"valueTagClass"in s&&(c=s.valueTagClass),c===i.Type.UTF8&&(o=n.util.encodeUtf8(o));var u=!1;"valueConstructed"in s&&(u=s.valueConstructed);var f=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(s.type).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SET,!0,[i.create(i.Class.UNIVERSAL,c,u,o)])]);t.value.push(f)}return t}a.certificateFromPem=function(e,t,r){var s=n.pem.decode(e)[0];if("CERTIFICATE"!==s.type&&"X509 CERTIFICATE"!==s.type&&"TRUSTED CERTIFICATE"!==s.type){var o=new Error('Could not convert certificate from PEM; PEM header type is not "CERTIFICATE", "X509 CERTIFICATE", or "TRUSTED CERTIFICATE".');throw o.headerType=s.type,o}if(s.procType&&"ENCRYPTED"===s.procType.type)throw new Error("Could not convert certificate from PEM; PEM is encrypted.");var c=i.fromDer(s.body,r);return a.certificateFromAsn1(c,t)},a.certificateToPem=function(e,t){var r={type:"CERTIFICATE",body:i.toDer(a.certificateToAsn1(e)).getBytes()};return n.pem.encode(r,{maxline:t})},a.publicKeyFromPem=function(e){var t=n.pem.decode(e)[0];if("PUBLIC KEY"!==t.type&&"RSA PUBLIC KEY"!==t.type){var r=new Error('Could not convert public key from PEM; PEM header type is not "PUBLIC KEY" or "RSA PUBLIC KEY".');throw r.headerType=t.type,r}if(t.procType&&"ENCRYPTED"===t.procType.type)throw new Error("Could not convert public key from PEM; PEM is encrypted.");var s=i.fromDer(t.body);return a.publicKeyFromAsn1(s)},a.publicKeyToPem=function(e,t){var r={type:"PUBLIC KEY",body:i.toDer(a.publicKeyToAsn1(e)).getBytes()};return n.pem.encode(r,{maxline:t})},a.publicKeyToRSAPublicKeyPem=function(e,t){var r={type:"RSA PUBLIC KEY",body:i.toDer(a.publicKeyToRSAPublicKey(e)).getBytes()};return n.pem.encode(r,{maxline:t})},a.getPublicKeyFingerprint=function(e,t){var r,s=(t=t||{}).md||n.md.sha1.create();switch(t.type||"RSAPublicKey"){case"RSAPublicKey":r=i.toDer(a.publicKeyToRSAPublicKey(e)).getBytes();break;case"SubjectPublicKeyInfo":r=i.toDer(a.publicKeyToAsn1(e)).getBytes();break;default:throw new Error('Unknown fingerprint type "'+t.type+'".')}s.start(),s.update(r);var o=s.digest();if("hex"===t.encoding){var c=o.toHex();return t.delimiter?c.match(/.{2}/g).join(t.delimiter):c}if("binary"===t.encoding)return o.getBytes();if(t.encoding)throw new Error('Unknown encoding "'+t.encoding+'".');return o},a.certificationRequestFromPem=function(e,t,r){var s=n.pem.decode(e)[0];if("CERTIFICATE REQUEST"!==s.type){var o=new Error('Could not convert certification request from PEM; PEM header type is not "CERTIFICATE REQUEST".');throw o.headerType=s.type,o}if(s.procType&&"ENCRYPTED"===s.procType.type)throw new Error("Could not convert certification request from PEM; PEM is encrypted.");var c=i.fromDer(s.body,r);return a.certificationRequestFromAsn1(c,t)},a.certificationRequestToPem=function(e,t){var r={type:"CERTIFICATE REQUEST",body:i.toDer(a.certificationRequestToAsn1(e)).getBytes()};return n.pem.encode(r,{maxline:t})},a.createCertificate=function(){var e={version:2,serialNumber:"00",signatureOid:null,signature:null,siginfo:{}};return e.siginfo.algorithmOid=null,e.validity={},e.validity.notBefore=new Date,e.validity.notAfter=new Date,e.issuer={},e.issuer.getField=function(t){return d(e.issuer,t)},e.issuer.addField=function(t){m([t]),e.issuer.attributes.push(t)},e.issuer.attributes=[],e.issuer.hash=null,e.subject={},e.subject.getField=function(t){return d(e.subject,t)},e.subject.addField=function(t){m([t]),e.subject.attributes.push(t)},e.subject.attributes=[],e.subject.hash=null,e.extensions=[],e.publicKey=null,e.md=null,e.setSubject=function(t,r){m(t),e.subject.attributes=t,delete e.subject.uniqueId,r&&(e.subject.uniqueId=r),e.subject.hash=null},e.setIssuer=function(t,r){m(t),e.issuer.attributes=t,delete e.issuer.uniqueId,r&&(e.issuer.uniqueId=r),e.issuer.hash=null},e.setExtensions=function(t){for(var r=0;r<t.length;++r)b(t[r],{cert:e});e.extensions=t},e.getExtension=function(t){"string"==typeof t&&(t={name:t});for(var r,n=null,i=0;null===n&&i<e.extensions.length;++i)r=e.extensions[i],(t.id&&r.id===t.id||t.name&&r.name===t.name)&&(n=r);return n},e.sign=function(t,r){e.md=r||n.md.sha1.create();var o=s[e.md.algorithm+"WithRSAEncryption"];if(!o){var c=new Error("Could not compute certificate digest. Unknown message digest algorithm OID.");throw c.algorithm=e.md.algorithm,c}e.signatureOid=e.siginfo.algorithmOid=o,e.tbsCertificate=a.getTBSCertificate(e);var u=i.toDer(e.tbsCertificate);e.md.update(u.getBytes()),e.signature=t.sign(e.md)},e.verify=function(t){var r=!1;if(!e.issued(t)){var n=t.issuer,s=e.subject,o=new Error("The parent certificate did not issue the given child certificate; the child certificate's issuer does not match the parent's subject.");throw o.expectedIssuer=s.attributes,o.actualIssuer=n.attributes,o}var c=t.md;if(null===c){c=g({signatureOid:t.signatureOid,type:"certificate"});var u=t.tbsCertificate||a.getTBSCertificate(t),f=i.toDer(u);c.update(f.getBytes())}return null!==c&&(r=y({certificate:e,md:c,signature:t.signature})),r},e.isIssuer=function(t){var r=!1,n=e.issuer,i=t.subject;if(n.hash&&i.hash)r=n.hash===i.hash;else if(n.attributes.length===i.attributes.length){var a,s;r=!0;for(var o=0;r&&o<n.attributes.length;++o)a=n.attributes[o],s=i.attributes[o],a.type===s.type&&a.value===s.value||(r=!1)}return r},e.issued=function(t){return t.isIssuer(e)},e.generateSubjectKeyIdentifier=function(){return a.getPublicKeyFingerprint(e.publicKey,{type:"RSAPublicKey"})},e.verifySubjectKeyIdentifier=function(){for(var t=s.subjectKeyIdentifier,r=0;r<e.extensions.length;++r){var i=e.extensions[r];if(i.id===t){var a=e.generateSubjectKeyIdentifier().getBytes();return n.util.hexToBytes(i.subjectKeyIdentifier)===a}}return!1},e},a.certificateFromAsn1=function(e,t){var r={},s=[];if(!i.validate(e,u,r,s)){var o=new Error("Cannot read X.509 certificate. ASN.1 object is not an X509v3 Certificate.");throw o.errors=s,o}if(i.derToOid(r.publicKeyOid)!==a.oids.rsaEncryption)throw new Error("Cannot read public key. OID is not RSA.");var c=a.createCertificate();c.version=r.certVersion?r.certVersion.charCodeAt(0):0;var f=n.util.createBuffer(r.certSerialNumber);c.serialNumber=f.toHex(),c.signatureOid=n.asn1.derToOid(r.certSignatureOid),c.signatureParameters=p(c.signatureOid,r.certSignatureParams,!0),c.siginfo.algorithmOid=n.asn1.derToOid(r.certinfoSignatureOid),c.siginfo.parameters=p(c.siginfo.algorithmOid,r.certinfoSignatureParams,!1),c.signature=r.certSignature;var h=[];if(void 0!==r.certValidity1UTCTime&&h.push(i.utcTimeToDate(r.certValidity1UTCTime)),void 0!==r.certValidity2GeneralizedTime&&h.push(i.generalizedTimeToDate(r.certValidity2GeneralizedTime)),void 0!==r.certValidity3UTCTime&&h.push(i.utcTimeToDate(r.certValidity3UTCTime)),void 0!==r.certValidity4GeneralizedTime&&h.push(i.generalizedTimeToDate(r.certValidity4GeneralizedTime)),h.length>2)throw new Error("Cannot read notBefore/notAfter validity times; more than two times were provided in the certificate.");if(h.length<2)throw new Error("Cannot read notBefore/notAfter validity times; they were not provided as either UTCTime or GeneralizedTime.");if(c.validity.notBefore=h[0],c.validity.notAfter=h[1],c.tbsCertificate=r.tbsCertificate,t){c.md=g({signatureOid:c.signatureOid,type:"certificate"});var l=i.toDer(c.tbsCertificate);c.md.update(l.getBytes())}var y=n.md.sha1.create(),v=i.toDer(r.certIssuer);y.update(v.getBytes()),c.issuer.getField=function(e){return d(c.issuer,e)},c.issuer.addField=function(e){m([e]),c.issuer.attributes.push(e)},c.issuer.attributes=a.RDNAttributesAsArray(r.certIssuer),r.certIssuerUniqueId&&(c.issuer.uniqueId=r.certIssuerUniqueId),c.issuer.hash=y.digest().toHex();var b=n.md.sha1.create(),w=i.toDer(r.certSubject);return b.update(w.getBytes()),c.subject.getField=function(e){return d(c.subject,e)},c.subject.addField=function(e){m([e]),c.subject.attributes.push(e)},c.subject.attributes=a.RDNAttributesAsArray(r.certSubject),r.certSubjectUniqueId&&(c.subject.uniqueId=r.certSubjectUniqueId),c.subject.hash=b.digest().toHex(),r.certExtensions?c.extensions=a.certificateExtensionsFromAsn1(r.certExtensions):c.extensions=[],c.publicKey=a.publicKeyFromAsn1(r.subjectPublicKeyInfo),c},a.certificateExtensionsFromAsn1=function(e){for(var t=[],r=0;r<e.value.length;++r)for(var n=e.value[r],i=0;i<n.value.length;++i)t.push(a.certificateExtensionFromAsn1(n.value[i]));return t},a.certificateExtensionFromAsn1=function(e){var t={};if(t.id=i.derToOid(e.value[0].value),t.critical=!1,e.value[1].type===i.Type.BOOLEAN?(t.critical=0!==e.value[1].value.charCodeAt(0),t.value=e.value[2].value):t.value=e.value[1].value,t.id in s)if(t.name=s[t.id],"keyUsage"===t.name){var r=0,a=0;(c=i.fromDer(t.value)).value.length>1&&(r=c.value.charCodeAt(1),a=c.value.length>2?c.value.charCodeAt(2):0),t.digitalSignature=!(128&~r),t.nonRepudiation=!(64&~r),t.keyEncipherment=!(32&~r),t.dataEncipherment=!(16&~r),t.keyAgreement=!(8&~r),t.keyCertSign=!(4&~r),t.cRLSign=!(2&~r),t.encipherOnly=!(1&~r),t.decipherOnly=!(128&~a)}else if("basicConstraints"===t.name){(c=i.fromDer(t.value)).value.length>0&&c.value[0].type===i.Type.BOOLEAN?t.cA=0!==c.value[0].value.charCodeAt(0):t.cA=!1;var o=null;c.value.length>0&&c.value[0].type===i.Type.INTEGER?o=c.value[0].value:c.value.length>1&&(o=c.value[1].value),null!==o&&(t.pathLenConstraint=i.derToInteger(o))}else if("extKeyUsage"===t.name)for(var c=i.fromDer(t.value),u=0;u<c.value.length;++u){var f=i.derToOid(c.value[u].value);f in s?t[s[f]]=!0:t[f]=!0}else if("nsCertType"===t.name)r=0,(c=i.fromDer(t.value)).value.length>1&&(r=c.value.charCodeAt(1)),t.client=!(128&~r),t.server=!(64&~r),t.email=!(32&~r),t.objsign=!(16&~r),t.reserved=!(8&~r),t.sslCA=!(4&~r),t.emailCA=!(2&~r),t.objCA=!(1&~r);else if("subjectAltName"===t.name||"issuerAltName"===t.name){var h;t.altNames=[],c=i.fromDer(t.value);for(var l=0;l<c.value.length;++l){var d={type:(h=c.value[l]).type,value:h.value};switch(t.altNames.push(d),h.type){case 1:case 2:case 6:break;case 7:d.ip=n.util.bytesToIP(h.value);break;case 8:d.oid=i.derToOid(h.value)}}}else"subjectKeyIdentifier"===t.name&&(c=i.fromDer(t.value),t.subjectKeyIdentifier=n.util.bytesToHex(c.value));return t},a.certificationRequestFromAsn1=function(e,t){var r={},s=[];if(!i.validate(e,l,r,s)){var o=new Error("Cannot read PKCS#10 certificate request. ASN.1 object is not a PKCS#10 CertificationRequest.");throw o.errors=s,o}if(i.derToOid(r.publicKeyOid)!==a.oids.rsaEncryption)throw new Error("Cannot read public key. OID is not RSA.");var c=a.createCertificationRequest();if(c.version=r.csrVersion?r.csrVersion.charCodeAt(0):0,c.signatureOid=n.asn1.derToOid(r.csrSignatureOid),c.signatureParameters=p(c.signatureOid,r.csrSignatureParams,!0),c.siginfo.algorithmOid=n.asn1.derToOid(r.csrSignatureOid),c.siginfo.parameters=p(c.siginfo.algorithmOid,r.csrSignatureParams,!1),c.signature=r.csrSignature,c.certificationRequestInfo=r.certificationRequestInfo,t){c.md=g({signatureOid:c.signatureOid,type:"certification request"});var u=i.toDer(c.certificationRequestInfo);c.md.update(u.getBytes())}var f=n.md.sha1.create();return c.subject.getField=function(e){return d(c.subject,e)},c.subject.addField=function(e){m([e]),c.subject.attributes.push(e)},c.subject.attributes=a.RDNAttributesAsArray(r.certificationRequestInfoSubject,f),c.subject.hash=f.digest().toHex(),c.publicKey=a.publicKeyFromAsn1(r.subjectPublicKeyInfo),c.getAttribute=function(e){return d(c,e)},c.addAttribute=function(e){m([e]),c.attributes.push(e)},c.attributes=a.CRIAttributesAsArray(r.certificationRequestInfoAttributes||[]),c},a.createCertificationRequest=function(){var e={version:0,signatureOid:null,signature:null,siginfo:{}};return e.siginfo.algorithmOid=null,e.subject={},e.subject.getField=function(t){return d(e.subject,t)},e.subject.addField=function(t){m([t]),e.subject.attributes.push(t)},e.subject.attributes=[],e.subject.hash=null,e.publicKey=null,e.attributes=[],e.getAttribute=function(t){return d(e,t)},e.addAttribute=function(t){m([t]),e.attributes.push(t)},e.md=null,e.setSubject=function(t){m(t),e.subject.attributes=t,e.subject.hash=null},e.setAttributes=function(t){m(t),e.attributes=t},e.sign=function(t,r){e.md=r||n.md.sha1.create();var o=s[e.md.algorithm+"WithRSAEncryption"];if(!o){var c=new Error("Could not compute certification request digest. Unknown message digest algorithm OID.");throw c.algorithm=e.md.algorithm,c}e.signatureOid=e.siginfo.algorithmOid=o,e.certificationRequestInfo=a.getCertificationRequestInfo(e);var u=i.toDer(e.certificationRequestInfo);e.md.update(u.getBytes()),e.signature=t.sign(e.md)},e.verify=function(){var t=!1,r=e.md;if(null===r){r=g({signatureOid:e.signatureOid,type:"certification request"});var n=e.certificationRequestInfo||a.getCertificationRequestInfo(e),s=i.toDer(n);r.update(s.getBytes())}return null!==r&&(t=y({certificate:e,md:r,signature:e.signature})),t},e};var E=new Date("1950-01-01T00:00:00Z"),C=new Date("2050-01-01T00:00:00Z");function A(e){return e>=E&&e<C?i.create(i.Class.UNIVERSAL,i.Type.UTCTIME,!1,i.dateToUtcTime(e)):i.create(i.Class.UNIVERSAL,i.Type.GENERALIZEDTIME,!1,i.dateToGeneralizedTime(e))}a.getTBSCertificate=function(e){var t=A(e.validity.notBefore),r=A(e.validity.notAfter),s=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(e.version).getBytes())]),i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,n.util.hexToBytes(e.serialNumber)),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.siginfo.algorithmOid).getBytes()),w(e.siginfo.algorithmOid,e.siginfo.parameters)]),v(e.issuer),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[t,r]),v(e.subject),a.publicKeyToAsn1(e.publicKey)]);return e.issuer.uniqueId&&s.value.push(i.create(i.Class.CONTEXT_SPECIFIC,1,!0,[i.create(i.Class.UNIVERSAL,i.Type.BITSTRING,!1,String.fromCharCode(0)+e.issuer.uniqueId)])),e.subject.uniqueId&&s.value.push(i.create(i.Class.CONTEXT_SPECIFIC,2,!0,[i.create(i.Class.UNIVERSAL,i.Type.BITSTRING,!1,String.fromCharCode(0)+e.subject.uniqueId)])),e.extensions.length>0&&s.value.push(a.certificateExtensionsToAsn1(e.extensions)),s},a.getCertificationRequestInfo=function(e){return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(e.version).getBytes()),v(e.subject),a.publicKeyToAsn1(e.publicKey),S(e)])},a.distinguishedNameToAsn1=function(e){return v(e)},a.certificateToAsn1=function(e){var t=e.tbsCertificate||a.getTBSCertificate(e);return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[t,i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.signatureOid).getBytes()),w(e.signatureOid,e.signatureParameters)]),i.create(i.Class.UNIVERSAL,i.Type.BITSTRING,!1,String.fromCharCode(0)+e.signature)])},a.certificateExtensionsToAsn1=function(e){var t=i.create(i.Class.CONTEXT_SPECIFIC,3,!0,[]),r=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]);t.value.push(r);for(var n=0;n<e.length;++n)r.value.push(a.certificateExtensionToAsn1(e[n]));return t},a.certificateExtensionToAsn1=function(e){var t=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]);t.value.push(i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.id).getBytes())),e.critical&&t.value.push(i.create(i.Class.UNIVERSAL,i.Type.BOOLEAN,!1,String.fromCharCode(255)));var r=e.value;return"string"!=typeof e.value&&(r=i.toDer(r).getBytes()),t.value.push(i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,r)),t},a.certificationRequestToAsn1=function(e){var t=e.certificationRequestInfo||a.getCertificationRequestInfo(e);return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[t,i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.signatureOid).getBytes()),w(e.signatureOid,e.signatureParameters)]),i.create(i.Class.UNIVERSAL,i.Type.BITSTRING,!1,String.fromCharCode(0)+e.signature)])},a.createCaStore=function(e){var t={certs:{}};function r(e){return s(e),t.certs[e.hash]||null}function s(e){if(!e.hash){var t=n.md.sha1.create();e.attributes=a.RDNAttributesAsArray(v(e),t),e.hash=t.digest().toHex()}}if(t.getIssuer=function(e){return r(e.issuer)},t.addCertificate=function(e){if("string"==typeof e&&(e=n.pki.certificateFromPem(e)),s(e.subject),!t.hasCertificate(e))if(e.subject.hash in t.certs){var r=t.certs[e.subject.hash];n.util.isArray(r)||(r=[r]),r.push(e),t.certs[e.subject.hash]=r}else t.certs[e.subject.hash]=e},t.hasCertificate=function(e){"string"==typeof e&&(e=n.pki.certificateFromPem(e));var t=r(e.subject);if(!t)return!1;n.util.isArray(t)||(t=[t]);for(var s=i.toDer(a.certificateToAsn1(e)).getBytes(),o=0;o<t.length;++o)if(s===i.toDer(a.certificateToAsn1(t[o])).getBytes())return!0;return!1},t.listAllCertificates=function(){var e=[];for(var r in t.certs)if(t.certs.hasOwnProperty(r)){var i=t.certs[r];if(n.util.isArray(i))for(var a=0;a<i.length;++a)e.push(i[a]);else e.push(i)}return e},t.removeCertificate=function(e){var o;if("string"==typeof e&&(e=n.pki.certificateFromPem(e)),s(e.subject),!t.hasCertificate(e))return null;var c=r(e.subject);if(!n.util.isArray(c))return o=t.certs[e.subject.hash],delete t.certs[e.subject.hash],o;for(var u=i.toDer(a.certificateToAsn1(e)).getBytes(),f=0;f<c.length;++f)u===i.toDer(a.certificateToAsn1(c[f])).getBytes()&&(o=c[f],c.splice(f,1));return 0===c.length&&delete t.certs[e.subject.hash],o},e)for(var o=0;o<e.length;++o){var c=e[o];t.addCertificate(c)}return t},a.certificateError={bad_certificate:"forge.pki.BadCertificate",unsupported_certificate:"forge.pki.UnsupportedCertificate",certificate_revoked:"forge.pki.CertificateRevoked",certificate_expired:"forge.pki.CertificateExpired",certificate_unknown:"forge.pki.CertificateUnknown",unknown_ca:"forge.pki.UnknownCertificateAuthority"},a.verifyCertificateChain=function(e,t,r){"function"==typeof r&&(r={verify:r}),r=r||{};var i=(t=t.slice(0)).slice(0),s=r.validityCheckDate;void 0===s&&(s=new Date);var o=!0,c=null,u=0;do{var f=t.shift(),h=null,l=!1;if(s&&(s<f.validity.notBefore||s>f.validity.notAfter)&&(c={message:"Certificate is not valid yet or has expired.",error:a.certificateError.certificate_expired,notBefore:f.validity.notBefore,notAfter:f.validity.notAfter,now:s}),null===c){if(null===(h=t[0]||e.getIssuer(f))&&f.isIssuer(f)&&(l=!0,h=f),h){var d=h;n.util.isArray(d)||(d=[d]);for(var p=!1;!p&&d.length>0;){h=d.shift();try{p=h.verify(f)}catch(e){}}p||(c={message:"Certificate signature is invalid.",error:a.certificateError.bad_certificate})}null!==c||h&&!l||e.hasCertificate(f)||(c={message:"Certificate is not trusted.",error:a.certificateError.unknown_ca})}if(null===c&&h&&!f.isIssuer(h)&&(c={message:"Certificate issuer is invalid.",error:a.certificateError.bad_certificate}),null===c)for(var g={keyUsage:!0,basicConstraints:!0},y=0;null===c&&y<f.extensions.length;++y){var v=f.extensions[y];v.critical&&!(v.name in g)&&(c={message:"Certificate has an unsupported critical extension.",error:a.certificateError.unsupported_certificate})}if(null===c&&(!o||0===t.length&&(!h||l))){var m=f.getExtension("basicConstraints"),b=f.getExtension("keyUsage");null!==b&&(b.keyCertSign&&null!==m||(c={message:"Certificate keyUsage or basicConstraints conflict or indicate that the certificate is not a CA. If the certificate is the only one in the chain or isn't the first then the certificate must be a valid CA.",error:a.certificateError.bad_certificate})),null!==c||null===m||m.cA||(c={message:"Certificate basicConstraints indicates the certificate is not a CA.",error:a.certificateError.bad_certificate}),null===c&&null!==b&&"pathLenConstraint"in m&&u-1>m.pathLenConstraint&&(c={message:"Certificate basicConstraints pathLenConstraint violated.",error:a.certificateError.bad_certificate})}var w=null===c||c.error,S=r.verify?r.verify(w,u,i):w;if(!0!==S)throw!0===w&&(c={message:"The application rejected the certificate.",error:a.certificateError.bad_certificate}),(S||0===S)&&("object"!=typeof S||n.util.isArray(S)?"string"==typeof S&&(c.error=S):(S.message&&(c.message=S.message),S.error&&(c.error=S.error))),c;c=null,o=!1,++u}while(t.length>0);return!0}},95355:(e,t,r)=>{var n,i,a,s,o,c,u,f,h,l,d,p=r(48287).Buffer,g={userAgent:!1},y={},v=v||(n=Math,a=(i={}).lib={},s=a.Base=function(){function e(){}return{extend:function(t){e.prototype=this;var r=new e;return t&&r.mixIn(t),r.hasOwnProperty("init")||(r.init=function(){r.$super.init.apply(this,arguments)}),r.init.prototype=r,r.$super=this,r},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),o=a.WordArray=s.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||u).stringify(this)},concat:function(e){var t=this.words,r=e.words,n=this.sigBytes,i=e.sigBytes;if(this.clamp(),n%4)for(var a=0;a<i;a++){var s=r[a>>>2]>>>24-a%4*8&255;t[n+a>>>2]|=s<<24-(n+a)%4*8}else for(a=0;a<i;a+=4)t[n+a>>>2]=r[a>>>2];return this.sigBytes+=i,this},clamp:function(){var e=this.words,t=this.sigBytes;e[t>>>2]&=4294967295<<32-t%4*8,e.length=n.ceil(t/4)},clone:function(){var e=s.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],r=0;r<e;r+=4)t.push(4294967296*n.random()|0);return new o.init(t,e)}}),c=i.enc={},u=c.Hex={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i<r;i++){var a=t[i>>>2]>>>24-i%4*8&255;n.push((a>>>4).toString(16)),n.push((15&a).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n<t;n+=2)r[n>>>3]|=parseInt(e.substr(n,2),16)<<24-n%8*4;return new o.init(r,t/2)}},f=c.Latin1={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i<r;i++){var a=t[i>>>2]>>>24-i%4*8&255;n.push(String.fromCharCode(a))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n<t;n++)r[n>>>2]|=(255&e.charCodeAt(n))<<24-n%4*8;return new o.init(r,t)}},h=c.Utf8={stringify:function(e){try{return decodeURIComponent(escape(f.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return f.parse(unescape(encodeURIComponent(e)))}},l=a.BufferedBlockAlgorithm=s.extend({reset:function(){this._data=new o.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=h.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(e){var t=this._data,r=t.words,i=t.sigBytes,a=this.blockSize,s=i/(4*a),c=(s=e?n.ceil(s):n.max((0|s)-this._minBufferSize,0))*a,u=n.min(4*c,i);if(c){for(var f=0;f<c;f+=a)this._doProcessBlock(r,f);var h=r.splice(0,c);t.sigBytes-=u}return new o.init(h,u)},clone:function(){var e=s.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0}),a.Hasher=l.extend({cfg:s.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){l.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,r){return new e.init(r).finalize(t)}},_createHmacHelper:function(e){return function(t,r){return new d.HMAC.init(e,r).finalize(t)}}}),d=i.algo={},i);!function(e){var t,r=(t=v).lib,n=r.Base,i=r.WordArray;(t=t.x64={}).Word=n.extend({init:function(e,t){this.high=e,this.low=t}}),t.WordArray=n.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:8*e.length},toX32:function(){for(var e=this.words,t=e.length,r=[],n=0;n<t;n++){var a=e[n];r.push(a.high),r.push(a.low)}return i.create(r,this.sigBytes)},clone:function(){for(var e=n.clone.call(this),t=e.words=this.words.slice(0),r=t.length,i=0;i<r;i++)t[i]=t[i].clone();return e}})}(),v.lib.Cipher||function(e){var t=(d=v).lib,r=t.Base,n=t.WordArray,i=t.BufferedBlockAlgorithm,a=d.enc.Base64,s=d.algo.EvpKDF,o=t.Cipher=i.extend({cfg:r.extend(),createEncryptor:function(e,t){return this.create(this._ENC_XFORM_MODE,e,t)},createDecryptor:function(e,t){return this.create(this._DEC_XFORM_MODE,e,t)},init:function(e,t,r){this.cfg=this.cfg.extend(r),this._xformMode=e,this._key=t,this.reset()},reset:function(){i.reset.call(this),this._doReset()},process:function(e){return this._append(e),this._process()},finalize:function(e){return e&&this._append(e),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(e){return{encrypt:function(t,r,n){return("string"==typeof r?p:l).encrypt(e,t,r,n)},decrypt:function(t,r,n){return("string"==typeof r?p:l).decrypt(e,t,r,n)}}}});t.StreamCipher=o.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var c=d.mode={},u=function(e,t,r){var n=this._iv;n?this._iv=void 0:n=this._prevBlock;for(var i=0;i<r;i++)e[t+i]^=n[i]},f=(t.BlockCipherMode=r.extend({createEncryptor:function(e,t){return this.Encryptor.create(e,t)},createDecryptor:function(e,t){return this.Decryptor.create(e,t)},init:function(e,t){this._cipher=e,this._iv=t}})).extend();f.Encryptor=f.extend({processBlock:function(e,t){var r=this._cipher,n=r.blockSize;u.call(this,e,t,n),r.encryptBlock(e,t),this._prevBlock=e.slice(t,t+n)}}),f.Decryptor=f.extend({processBlock:function(e,t){var r=this._cipher,n=r.blockSize,i=e.slice(t,t+n);r.decryptBlock(e,t),u.call(this,e,t,n),this._prevBlock=i}}),c=c.CBC=f,f=(d.pad={}).Pkcs7={pad:function(e,t){for(var r,i=(r=(r=4*t)-e.sigBytes%r)<<24|r<<16|r<<8|r,a=[],s=0;s<r;s+=4)a.push(i);r=n.create(a,r),e.concat(r)},unpad:function(e){e.sigBytes-=255&e.words[e.sigBytes-1>>>2]}},t.BlockCipher=o.extend({cfg:o.cfg.extend({mode:c,padding:f}),reset:function(){o.reset.call(this);var e=(t=this.cfg).iv,t=t.mode;if(this._xformMode==this._ENC_XFORM_MODE)var r=t.createEncryptor;else r=t.createDecryptor,this._minBufferSize=1;this._mode=r.call(t,this,e&&e.words)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){e.pad(this._data,this.blockSize);var t=this._process(!0)}else t=this._process(!0),e.unpad(t);return t},blockSize:4});var h=t.CipherParams=r.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}}),l=(c=(d.format={}).OpenSSL={stringify:function(e){var t=e.ciphertext;return((e=e.salt)?n.create([1398893684,1701076831]).concat(e).concat(t):t).toString(a)},parse:function(e){var t=(e=a.parse(e)).words;if(1398893684==t[0]&&1701076831==t[1]){var r=n.create(t.slice(2,4));t.splice(0,4),e.sigBytes-=16}return h.create({ciphertext:e,salt:r})}},t.SerializableCipher=r.extend({cfg:r.extend({format:c}),encrypt:function(e,t,r,n){n=this.cfg.extend(n);var i=e.createEncryptor(r,n);return t=i.finalize(t),i=i.cfg,h.create({ciphertext:t,key:r,iv:i.iv,algorithm:e,mode:i.mode,padding:i.padding,blockSize:e.blockSize,formatter:n.format})},decrypt:function(e,t,r,n){return n=this.cfg.extend(n),t=this._parse(t,n.format),e.createDecryptor(r,n).finalize(t.ciphertext)},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}})),d=(d.kdf={}).OpenSSL={execute:function(e,t,r,i){return i||(i=n.random(8)),e=s.create({keySize:t+r}).compute(e,i),r=n.create(e.words.slice(t),4*r),e.sigBytes=4*t,h.create({key:e,iv:r,salt:i})}},p=t.PasswordBasedCipher=l.extend({cfg:l.cfg.extend({kdf:d}),encrypt:function(e,t,r,n){return r=(n=this.cfg.extend(n)).kdf.execute(r,e.keySize,e.ivSize),n.iv=r.iv,(e=l.encrypt.call(this,e,t,r.key,n)).mixIn(r),e},decrypt:function(e,t,r,n){return n=this.cfg.extend(n),t=this._parse(t,n.format),r=n.kdf.execute(r,e.keySize,e.ivSize,t.salt),n.iv=r.iv,l.decrypt.call(this,e,t,r.key,n)}})}(),function(){for(var e=v,t=e.lib.BlockCipher,r=e.algo,n=[],i=[],a=[],s=[],o=[],c=[],u=[],f=[],h=[],l=[],d=[],p=0;256>p;p++)d[p]=128>p?p<<1:p<<1^283;var g=0,y=0;for(p=0;256>p;p++){var m=(m=y^y<<1^y<<2^y<<3^y<<4)>>>8^255&m^99;n[g]=m,i[m]=g;var b=d[g],w=d[b],S=d[w],E=257*d[m]^16843008*m;a[g]=E<<24|E>>>8,s[g]=E<<16|E>>>16,o[g]=E<<8|E>>>24,c[g]=E,E=16843009*S^65537*w^257*b^16843008*g,u[m]=E<<24|E>>>8,f[m]=E<<16|E>>>16,h[m]=E<<8|E>>>24,l[m]=E,g?(g=b^d[d[d[S^b]]],y^=d[d[y]]):g=y=1}var C=[0,1,2,4,8,16,32,64,128,27,54];r=r.AES=t.extend({_doReset:function(){for(var e=(r=this._key).words,t=r.sigBytes/4,r=4*((this._nRounds=t+6)+1),i=this._keySchedule=[],a=0;a<r;a++)if(a<t)i[a]=e[a];else{var s=i[a-1];a%t?6<t&&4==a%t&&(s=n[s>>>24]<<24|n[s>>>16&255]<<16|n[s>>>8&255]<<8|n[255&s]):(s=n[(s=s<<8|s>>>24)>>>24]<<24|n[s>>>16&255]<<16|n[s>>>8&255]<<8|n[255&s],s^=C[a/t|0]<<24),i[a]=i[a-t]^s}for(e=this._invKeySchedule=[],t=0;t<r;t++)a=r-t,s=t%4?i[a]:i[a-4],e[t]=4>t||4>=a?s:u[n[s>>>24]]^f[n[s>>>16&255]]^h[n[s>>>8&255]]^l[n[255&s]]},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,a,s,o,c,n)},decryptBlock:function(e,t){var r=e[t+1];e[t+1]=e[t+3],e[t+3]=r,this._doCryptBlock(e,t,this._invKeySchedule,u,f,h,l,i),r=e[t+1],e[t+1]=e[t+3],e[t+3]=r},_doCryptBlock:function(e,t,r,n,i,a,s,o){for(var c=this._nRounds,u=e[t]^r[0],f=e[t+1]^r[1],h=e[t+2]^r[2],l=e[t+3]^r[3],d=4,p=1;p<c;p++){var g=n[u>>>24]^i[f>>>16&255]^a[h>>>8&255]^s[255&l]^r[d++],y=n[f>>>24]^i[h>>>16&255]^a[l>>>8&255]^s[255&u]^r[d++],v=n[h>>>24]^i[l>>>16&255]^a[u>>>8&255]^s[255&f]^r[d++];l=n[l>>>24]^i[u>>>16&255]^a[f>>>8&255]^s[255&h]^r[d++],u=g,f=y,h=v}g=(o[u>>>24]<<24|o[f>>>16&255]<<16|o[h>>>8&255]<<8|o[255&l])^r[d++],y=(o[f>>>24]<<24|o[h>>>16&255]<<16|o[l>>>8&255]<<8|o[255&u])^r[d++],v=(o[h>>>24]<<24|o[l>>>16&255]<<16|o[u>>>8&255]<<8|o[255&f])^r[d++],l=(o[l>>>24]<<24|o[u>>>16&255]<<16|o[f>>>8&255]<<8|o[255&h])^r[d++],e[t]=g,e[t+1]=y,e[t+2]=v,e[t+3]=l},keySize:8}),e.AES=t._createHelper(r)}(),function(){function e(e,t){var r=(this._lBlock>>>e^this._rBlock)&t;this._rBlock^=r,this._lBlock^=r<<e}function t(e,t){var r=(this._rBlock>>>e^this._lBlock)&t;this._lBlock^=r,this._rBlock^=r<<e}var r=v,n=(i=r.lib).WordArray,i=i.BlockCipher,a=r.algo,s=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],o=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],c=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],u=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],f=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],h=a.DES=i.extend({_doReset:function(){for(var e=this._key.words,t=[],r=0;56>r;r++){var n=s[r]-1;t[r]=e[n>>>5]>>>31-n%32&1}for(e=this._subKeys=[],n=0;16>n;n++){var i=e[n]=[],a=c[n];for(r=0;24>r;r++)i[r/6|0]|=t[(o[r]-1+a)%28]<<31-r%6,i[4+(r/6|0)]|=t[28+(o[r+24]-1+a)%28]<<31-r%6;for(i[0]=i[0]<<1|i[0]>>>31,r=1;7>r;r++)i[r]>>>=4*(r-1)+3;i[7]=i[7]<<5|i[7]>>>27}for(t=this._invSubKeys=[],r=0;16>r;r++)t[r]=e[15-r]},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._subKeys)},decryptBlock:function(e,t){this._doCryptBlock(e,t,this._invSubKeys)},_doCryptBlock:function(r,n,i){this._lBlock=r[n],this._rBlock=r[n+1],e.call(this,4,252645135),e.call(this,16,65535),t.call(this,2,858993459),t.call(this,8,16711935),e.call(this,1,1431655765);for(var a=0;16>a;a++){for(var s=i[a],o=this._lBlock,c=this._rBlock,h=0,l=0;8>l;l++)h|=u[l][((c^s[l])&f[l])>>>0];this._lBlock=c,this._rBlock=o^h}i=this._lBlock,this._lBlock=this._rBlock,this._rBlock=i,e.call(this,1,1431655765),t.call(this,8,16711935),t.call(this,2,858993459),e.call(this,16,65535),e.call(this,4,252645135),r[n]=this._lBlock,r[n+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});r.DES=i._createHelper(h),a=a.TripleDES=i.extend({_doReset:function(){var e=this._key.words;this._des1=h.createEncryptor(n.create(e.slice(0,2))),this._des2=h.createEncryptor(n.create(e.slice(2,4))),this._des3=h.createEncryptor(n.create(e.slice(4,6)))},encryptBlock:function(e,t){this._des1.encryptBlock(e,t),this._des2.decryptBlock(e,t),this._des3.encryptBlock(e,t)},decryptBlock:function(e,t){this._des3.decryptBlock(e,t),this._des2.encryptBlock(e,t),this._des1.decryptBlock(e,t)},keySize:6,ivSize:2,blockSize:2}),r.TripleDES=i._createHelper(a)}(),function(){var e=v,t=e.lib.WordArray;e.enc.Base64={stringify:function(e){var t=e.words,r=e.sigBytes,n=this._map;e.clamp(),e=[];for(var i=0;i<r;i+=3)for(var a=(t[i>>>2]>>>24-i%4*8&255)<<16|(t[i+1>>>2]>>>24-(i+1)%4*8&255)<<8|t[i+2>>>2]>>>24-(i+2)%4*8&255,s=0;4>s&&i+.75*s<r;s++)e.push(n.charAt(a>>>6*(3-s)&63));if(t=n.charAt(64))for(;e.length%4;)e.push(t);return e.join("")},parse:function(e){var r=e.length,n=this._map;(i=n.charAt(64))&&-1!=(i=e.indexOf(i))&&(r=i);for(var i=[],a=0,s=0;s<r;s++)if(s%4){var o=n.indexOf(e.charAt(s-1))<<s%4*2,c=n.indexOf(e.charAt(s))>>>6-s%4*2;i[a>>>2]|=(o|c)<<24-a%4*8,a++}return t.create(i,a)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),function(e){function t(e,t,r,n,i,a,s){return((e=e+(t&r|~t&n)+i+s)<<a|e>>>32-a)+t}function r(e,t,r,n,i,a,s){return((e=e+(t&n|r&~n)+i+s)<<a|e>>>32-a)+t}function n(e,t,r,n,i,a,s){return((e=e+(t^r^n)+i+s)<<a|e>>>32-a)+t}function i(e,t,r,n,i,a,s){return((e=e+(r^(t|~n))+i+s)<<a|e>>>32-a)+t}for(var a=v,s=(c=a.lib).WordArray,o=c.Hasher,c=a.algo,u=[],f=0;64>f;f++)u[f]=4294967296*e.abs(e.sin(f+1))|0;c=c.MD5=o.extend({_doReset:function(){this._hash=new s.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,a){for(var s=0;16>s;s++){var o=e[c=a+s];e[c]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8)}s=this._hash.words;var c=e[a+0],f=(o=e[a+1],e[a+2]),h=e[a+3],l=e[a+4],d=e[a+5],p=e[a+6],g=e[a+7],y=e[a+8],v=e[a+9],m=e[a+10],b=e[a+11],w=e[a+12],S=e[a+13],E=e[a+14],C=e[a+15],A=t(A=s[0],T=s[1],x=s[2],B=s[3],c,7,u[0]),B=t(B,A,T,x,o,12,u[1]),x=t(x,B,A,T,f,17,u[2]),T=t(T,x,B,A,h,22,u[3]);A=t(A,T,x,B,l,7,u[4]),B=t(B,A,T,x,d,12,u[5]),x=t(x,B,A,T,p,17,u[6]),T=t(T,x,B,A,g,22,u[7]),A=t(A,T,x,B,y,7,u[8]),B=t(B,A,T,x,v,12,u[9]),x=t(x,B,A,T,m,17,u[10]),T=t(T,x,B,A,b,22,u[11]),A=t(A,T,x,B,w,7,u[12]),B=t(B,A,T,x,S,12,u[13]),x=t(x,B,A,T,E,17,u[14]),A=r(A,T=t(T,x,B,A,C,22,u[15]),x,B,o,5,u[16]),B=r(B,A,T,x,p,9,u[17]),x=r(x,B,A,T,b,14,u[18]),T=r(T,x,B,A,c,20,u[19]),A=r(A,T,x,B,d,5,u[20]),B=r(B,A,T,x,m,9,u[21]),x=r(x,B,A,T,C,14,u[22]),T=r(T,x,B,A,l,20,u[23]),A=r(A,T,x,B,v,5,u[24]),B=r(B,A,T,x,E,9,u[25]),x=r(x,B,A,T,h,14,u[26]),T=r(T,x,B,A,y,20,u[27]),A=r(A,T,x,B,S,5,u[28]),B=r(B,A,T,x,f,9,u[29]),x=r(x,B,A,T,g,14,u[30]),A=n(A,T=r(T,x,B,A,w,20,u[31]),x,B,d,4,u[32]),B=n(B,A,T,x,y,11,u[33]),x=n(x,B,A,T,b,16,u[34]),T=n(T,x,B,A,E,23,u[35]),A=n(A,T,x,B,o,4,u[36]),B=n(B,A,T,x,l,11,u[37]),x=n(x,B,A,T,g,16,u[38]),T=n(T,x,B,A,m,23,u[39]),A=n(A,T,x,B,S,4,u[40]),B=n(B,A,T,x,c,11,u[41]),x=n(x,B,A,T,h,16,u[42]),T=n(T,x,B,A,p,23,u[43]),A=n(A,T,x,B,v,4,u[44]),B=n(B,A,T,x,w,11,u[45]),x=n(x,B,A,T,C,16,u[46]),A=i(A,T=n(T,x,B,A,f,23,u[47]),x,B,c,6,u[48]),B=i(B,A,T,x,g,10,u[49]),x=i(x,B,A,T,E,15,u[50]),T=i(T,x,B,A,d,21,u[51]),A=i(A,T,x,B,w,6,u[52]),B=i(B,A,T,x,h,10,u[53]),x=i(x,B,A,T,m,15,u[54]),T=i(T,x,B,A,o,21,u[55]),A=i(A,T,x,B,y,6,u[56]),B=i(B,A,T,x,C,10,u[57]),x=i(x,B,A,T,p,15,u[58]),T=i(T,x,B,A,S,21,u[59]),A=i(A,T,x,B,l,6,u[60]),B=i(B,A,T,x,b,10,u[61]),x=i(x,B,A,T,f,15,u[62]),T=i(T,x,B,A,v,21,u[63]),s[0]=s[0]+A|0,s[1]=s[1]+T|0,s[2]=s[2]+x|0,s[3]=s[3]+B|0},_doFinalize:function(){var t=this._data,r=t.words,n=8*this._nDataBytes,i=8*t.sigBytes;r[i>>>5]|=128<<24-i%32;var a=e.floor(n/4294967296);for(r[15+(i+64>>>9<<4)]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),r[14+(i+64>>>9<<4)]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8),t.sigBytes=4*(r.length+1),this._process(),r=(t=this._hash).words,n=0;4>n;n++)i=r[n],r[n]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8);return t},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}}),a.MD5=o._createHelper(c),a.HmacMD5=o._createHmacHelper(c)}(Math),function(){var e=v,t=(i=e.lib).WordArray,r=i.Hasher,n=[],i=e.algo.SHA1=r.extend({_doReset:function(){this._hash=new t.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var r=this._hash.words,i=r[0],a=r[1],s=r[2],o=r[3],c=r[4],u=0;80>u;u++){if(16>u)n[u]=0|e[t+u];else{var f=n[u-3]^n[u-8]^n[u-14]^n[u-16];n[u]=f<<1|f>>>31}f=(i<<5|i>>>27)+c+n[u],f=20>u?f+(1518500249+(a&s|~a&o)):40>u?f+(1859775393+(a^s^o)):60>u?f+((a&s|a&o|s&o)-1894007588):f+((a^s^o)-899497514),c=o,o=s,s=a<<30|a>>>2,a=i,i=f}r[0]=r[0]+i|0,r[1]=r[1]+a|0,r[2]=r[2]+s|0,r[3]=r[3]+o|0,r[4]=r[4]+c|0},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[14+(n+64>>>9<<4)]=Math.floor(r/4294967296),t[15+(n+64>>>9<<4)]=r,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=r.clone.call(this);return e._hash=this._hash.clone(),e}});e.SHA1=r._createHelper(i),e.HmacSHA1=r._createHmacHelper(i)}(),function(e){for(var t=v,r=(i=t.lib).WordArray,n=i.Hasher,i=t.algo,a=[],s=[],o=function(e){return 4294967296*(e-(0|e))|0},c=2,u=0;64>u;){var f;e:{f=c;for(var h=e.sqrt(f),l=2;l<=h;l++)if(!(f%l)){f=!1;break e}f=!0}f&&(8>u&&(a[u]=o(e.pow(c,.5))),s[u]=o(e.pow(c,1/3)),u++),c++}var d=[];i=i.SHA256=n.extend({_doReset:function(){this._hash=new r.init(a.slice(0))},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],i=r[1],a=r[2],o=r[3],c=r[4],u=r[5],f=r[6],h=r[7],l=0;64>l;l++){if(16>l)d[l]=0|e[t+l];else{var p=d[l-15],g=d[l-2];d[l]=((p<<25|p>>>7)^(p<<14|p>>>18)^p>>>3)+d[l-7]+((g<<15|g>>>17)^(g<<13|g>>>19)^g>>>10)+d[l-16]}p=h+((c<<26|c>>>6)^(c<<21|c>>>11)^(c<<7|c>>>25))+(c&u^~c&f)+s[l]+d[l],g=((n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22))+(n&i^n&a^i&a),h=f,f=u,u=c,c=o+p|0,o=a,a=i,i=n,n=p+g|0}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+a|0,r[3]=r[3]+o|0,r[4]=r[4]+c|0,r[5]=r[5]+u|0,r[6]=r[6]+f|0,r[7]=r[7]+h|0},_doFinalize:function(){var t=this._data,r=t.words,n=8*this._nDataBytes,i=8*t.sigBytes;return r[i>>>5]|=128<<24-i%32,r[14+(i+64>>>9<<4)]=e.floor(n/4294967296),r[15+(i+64>>>9<<4)]=n,t.sigBytes=4*r.length,this._process(),this._hash},clone:function(){var e=n.clone.call(this);return e._hash=this._hash.clone(),e}}),t.SHA256=n._createHelper(i),t.HmacSHA256=n._createHmacHelper(i)}(Math),function(){var e=v,t=e.lib.WordArray,r=(n=e.algo).SHA256,n=n.SHA224=r.extend({_doReset:function(){this._hash=new t.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var e=r._doFinalize.call(this);return e.sigBytes-=4,e}});e.SHA224=r._createHelper(n),e.HmacSHA224=r._createHmacHelper(n)}(),function(){function e(){return n.create.apply(n,arguments)}for(var t=v,r=t.lib.Hasher,n=(a=t.x64).Word,i=a.WordArray,a=t.algo,s=[e(1116352408,3609767458),e(1899447441,602891725),e(3049323471,3964484399),e(3921009573,2173295548),e(961987163,4081628472),e(1508970993,3053834265),e(2453635748,2937671579),e(2870763221,3664609560),e(3624381080,2734883394),e(310598401,1164996542),e(607225278,1323610764),e(1426881987,3590304994),e(1925078388,4068182383),e(2162078206,991336113),e(2614888103,633803317),e(3248222580,3479774868),e(3835390401,2666613458),e(4022224774,944711139),e(264347078,2341262773),e(604807628,2007800933),e(770255983,1495990901),e(1249150122,1856431235),e(1555081692,3175218132),e(1996064986,2198950837),e(2554220882,3999719339),e(2821834349,766784016),e(2952996808,2566594879),e(3210313671,3203337956),e(3336571891,1034457026),e(3584528711,2466948901),e(113926993,3758326383),e(338241895,168717936),e(666307205,1188179964),e(773529912,1546045734),e(1294757372,1522805485),e(1396182291,2643833823),e(1695183700,2343527390),e(1986661051,1014477480),e(2177026350,1206759142),e(2456956037,344077627),e(2730485921,1290863460),e(2820302411,3158454273),e(3259730800,3505952657),e(3345764771,106217008),e(3516065817,3606008344),e(3600352804,1432725776),e(4094571909,1467031594),e(275423344,851169720),e(430227734,3100823752),e(506948616,1363258195),e(659060556,3750685593),e(883997877,3785050280),e(958139571,3318307427),e(1322822218,3812723403),e(1537002063,2003034995),e(1747873779,3602036899),e(1955562222,1575990012),e(2024104815,1125592928),e(2227730452,2716904306),e(2361852424,442776044),e(2428436474,593698344),e(2756734187,3733110249),e(3204031479,2999351573),e(3329325298,3815920427),e(3391569614,3928383900),e(3515267271,566280711),e(3940187606,3454069534),e(4118630271,4000239992),e(116418474,1914138554),e(174292421,2731055270),e(289380356,3203993006),e(460393269,320620315),e(685471733,587496836),e(852142971,1086792851),e(1017036298,365543100),e(1126000580,2618297676),e(1288033470,3409855158),e(1501505948,4234509866),e(1607167915,987167468),e(1816402316,1246189591)],o=[],c=0;80>c;c++)o[c]=e();a=a.SHA512=r.extend({_doReset:function(){this._hash=new i.init([new n.init(1779033703,4089235720),new n.init(3144134277,2227873595),new n.init(1013904242,4271175723),new n.init(2773480762,1595750129),new n.init(1359893119,2917565137),new n.init(2600822924,725511199),new n.init(528734635,4215389547),new n.init(1541459225,327033209)])},_doProcessBlock:function(e,t){for(var r=(h=this._hash.words)[0],n=h[1],i=h[2],a=h[3],c=h[4],u=h[5],f=h[6],h=h[7],l=r.high,d=r.low,p=n.high,g=n.low,y=i.high,v=i.low,m=a.high,b=a.low,w=c.high,S=c.low,E=u.high,C=u.low,A=f.high,B=f.low,x=h.high,T=h.low,I=l,F=d,k=p,R=g,D=y,_=v,P=m,N=b,O=w,L=S,U=E,K=C,M=A,H=B,j=x,V=T,G=0;80>G;G++){var q=o[G];if(16>G)var z=q.high=0|e[t+2*G],W=q.low=0|e[t+2*G+1];else{z=((W=(z=o[G-15]).high)>>>1|(X=z.low)<<31)^(W>>>8|X<<24)^W>>>7;var X=(X>>>1|W<<31)^(X>>>8|W<<24)^(X>>>7|W<<25),Y=((W=(Y=o[G-2]).high)>>>19|(J=Y.low)<<13)^(W<<3|J>>>29)^W>>>6,J=(J>>>19|W<<13)^(J<<3|W>>>29)^(J>>>6|W<<26),Q=(W=o[G-7]).high,Z=($=o[G-16]).high,$=$.low;z=(z=(z=z+Q+((W=X+W.low)>>>0<X>>>0?1:0))+Y+((W+=J)>>>0<J>>>0?1:0))+Z+((W+=$)>>>0<$>>>0?1:0),q.high=z,q.low=W}Q=O&U^~O&M,$=L&K^~L&H,q=I&k^I&D^k&D;var ee=F&R^F&_^R&_,te=(X=(I>>>28|F<<4)^(I<<30|F>>>2)^(I<<25|F>>>7),Y=(F>>>28|I<<4)^(F<<30|I>>>2)^(F<<25|I>>>7),(J=s[G]).high),re=J.low;Z=j+((O>>>14|L<<18)^(O>>>18|L<<14)^(O<<23|L>>>9))+((J=V+((L>>>14|O<<18)^(L>>>18|O<<14)^(L<<23|O>>>9)))>>>0<V>>>0?1:0),j=M,V=H,M=U,H=K,U=O,K=L,O=P+(Z=(Z=(Z=Z+Q+((J+=$)>>>0<$>>>0?1:0))+te+((J+=re)>>>0<re>>>0?1:0))+z+((J+=W)>>>0<W>>>0?1:0))+((L=N+J|0)>>>0<N>>>0?1:0)|0,P=D,N=_,D=k,_=R,k=I,R=F,I=Z+(q=X+q+((W=Y+ee)>>>0<Y>>>0?1:0))+((F=J+W|0)>>>0<J>>>0?1:0)|0}d=r.low=d+F,r.high=l+I+(d>>>0<F>>>0?1:0),g=n.low=g+R,n.high=p+k+(g>>>0<R>>>0?1:0),v=i.low=v+_,i.high=y+D+(v>>>0<_>>>0?1:0),b=a.low=b+N,a.high=m+P+(b>>>0<N>>>0?1:0),S=c.low=S+L,c.high=w+O+(S>>>0<L>>>0?1:0),C=u.low=C+K,u.high=E+U+(C>>>0<K>>>0?1:0),B=f.low=B+H,f.high=A+M+(B>>>0<H>>>0?1:0),T=h.low=T+V,h.high=x+j+(T>>>0<V>>>0?1:0)},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[30+(n+128>>>10<<5)]=Math.floor(r/4294967296),t[31+(n+128>>>10<<5)]=r,e.sigBytes=4*t.length,this._process(),this._hash.toX32()},clone:function(){var e=r.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:32}),t.SHA512=r._createHelper(a),t.HmacSHA512=r._createHmacHelper(a)}(),function(){var e=v,t=(i=e.x64).Word,r=i.WordArray,n=(i=e.algo).SHA512,i=i.SHA384=n.extend({_doReset:function(){this._hash=new r.init([new t.init(3418070365,3238371032),new t.init(1654270250,914150663),new t.init(2438529370,812702999),new t.init(355462360,4144912697),new t.init(1731405415,4290775857),new t.init(2394180231,1750603025),new t.init(3675008525,1694076839),new t.init(1203062813,3204075428)])},_doFinalize:function(){var e=n._doFinalize.call(this);return e.sigBytes-=16,e}});e.SHA384=n._createHelper(i),e.HmacSHA384=n._createHmacHelper(i)}(),function(){var e=v,t=(n=e.lib).WordArray,r=n.Hasher,n=e.algo,i=t.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),a=t.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),s=t.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),o=t.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),c=t.create([0,1518500249,1859775393,2400959708,2840853838]),u=t.create([1352829926,1548603684,1836072691,2053994217,0]);n=n.RIPEMD160=r.extend({_doReset:function(){this._hash=t.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var r=0;16>r;r++){var n=e[S=t+r];e[S]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8)}var f,h,l,d,p,g,y,v,m,b,w,S=this._hash.words,E=(n=c.words,u.words),C=i.words,A=a.words,B=s.words,x=o.words;for(g=f=S[0],y=h=S[1],v=l=S[2],m=d=S[3],b=p=S[4],r=0;80>r;r+=1)w=f+e[t+C[r]]|0,w=16>r?w+((h^l^d)+n[0]):32>r?w+((h&l|~h&d)+n[1]):48>r?w+(((h|~l)^d)+n[2]):64>r?w+((h&d|l&~d)+n[3]):w+((h^(l|~d))+n[4]),w=(w=(w|=0)<<B[r]|w>>>32-B[r])+p|0,f=p,p=d,d=l<<10|l>>>22,l=h,h=w,w=g+e[t+A[r]]|0,w=16>r?w+((y^(v|~m))+E[0]):32>r?w+((y&m|v&~m)+E[1]):48>r?w+(((y|~v)^m)+E[2]):64>r?w+((y&v|~y&m)+E[3]):w+((y^v^m)+E[4]),w=(w=(w|=0)<<x[r]|w>>>32-x[r])+b|0,g=b,b=m,m=v<<10|v>>>22,v=y,y=w;w=S[1]+l+m|0,S[1]=S[2]+d+b|0,S[2]=S[3]+p+g|0,S[3]=S[4]+f+y|0,S[4]=S[0]+h+v|0,S[0]=w},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;for(t[n>>>5]|=128<<24-n%32,t[14+(n+64>>>9<<4)]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),e.sigBytes=4*(t.length+1),this._process(),t=(e=this._hash).words,r=0;5>r;r++)n=t[r],t[r]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8);return e},clone:function(){var e=r.clone.call(this);return e._hash=this._hash.clone(),e}}),e.RIPEMD160=r._createHelper(n),e.HmacRIPEMD160=r._createHmacHelper(n)}(Math),function(){var e=v,t=e.enc.Utf8;e.algo.HMAC=e.lib.Base.extend({init:function(e,r){e=this._hasher=new e.init,"string"==typeof r&&(r=t.parse(r));var n=e.blockSize,i=4*n;r.sigBytes>i&&(r=e.finalize(r)),r.clamp();for(var a=this._oKey=r.clone(),s=this._iKey=r.clone(),o=a.words,c=s.words,u=0;u<n;u++)o[u]^=1549556828,c[u]^=909522486;a.sigBytes=s.sigBytes=i,this.reset()},reset:function(){var e=this._hasher;e.reset(),e.update(this._iKey)},update:function(e){return this._hasher.update(e),this},finalize:function(e){var t=this._hasher;return e=t.finalize(e),t.reset(),t.finalize(this._oKey.clone().concat(e))}})}(),function(){var e,t=v,r=(e=t.lib).Base,n=e.WordArray,i=(e=t.algo).HMAC,a=e.PBKDF2=r.extend({cfg:r.extend({keySize:4,hasher:e.SHA1,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){var r=this.cfg,a=i.create(r.hasher,e),s=n.create(),o=n.create([1]),c=s.words,u=o.words,f=r.keySize;for(r=r.iterations;c.length<f;){var h=a.update(t).finalize(o);a.reset();for(var l=h.words,d=l.length,p=h,g=1;g<r;g++){p=a.finalize(p),a.reset();for(var y=p.words,v=0;v<d;v++)l[v]^=y[v]}s.concat(h),u[0]++}return s.sigBytes=4*f,s}});t.PBKDF2=function(e,t,r){return a.create(r).compute(e,t)}}();var m,b="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",w="=";function S(e){var t,r,n="";for(t=0;t+3<=e.length;t+=3)r=parseInt(e.substring(t,t+3),16),n+=b.charAt(r>>6)+b.charAt(63&r);if(t+1==e.length?(r=parseInt(e.substring(t,t+1),16),n+=b.charAt(r<<2)):t+2==e.length&&(r=parseInt(e.substring(t,t+2),16),n+=b.charAt(r>>2)+b.charAt((3&r)<<4)),w)for(;(3&n.length)>0;)n+=w;return n}function E(e){var t,r,n,i="",a=0;for(t=0;t<e.length&&e.charAt(t)!=w;++t)(n=b.indexOf(e.charAt(t)))<0||(0==a?(i+=F(n>>2),r=3&n,a=1):1==a?(i+=F(r<<2|n>>4),r=15&n,a=2):2==a?(i+=F(r),i+=F(n>>2),r=3&n,a=3):(i+=F(r<<2|n>>4),i+=F(15&n),a=0));return 1==a&&(i+=F(r<<2)),i}function C(e,t,r){null!=e&&("number"==typeof e?this.fromNumber(e,t,r):null==t&&"string"!=typeof e?this.fromString(e,256):this.fromString(e,t))}function A(){return new C(null)}"Microsoft Internet Explorer"==g.appName?(C.prototype.am=function(e,t,r,n,i,a){for(var s=32767&t,o=t>>15;--a>=0;){var c=32767&this[e],u=this[e++]>>15,f=o*c+u*s;i=((c=s*c+((32767&f)<<15)+r[n]+(1073741823&i))>>>30)+(f>>>15)+o*u+(i>>>30),r[n++]=1073741823&c}return i},m=30):"Netscape"!=g.appName?(C.prototype.am=function(e,t,r,n,i,a){for(;--a>=0;){var s=t*this[e++]+r[n]+i;i=Math.floor(s/67108864),r[n++]=67108863&s}return i},m=26):(C.prototype.am=function(e,t,r,n,i,a){for(var s=16383&t,o=t>>14;--a>=0;){var c=16383&this[e],u=this[e++]>>14,f=o*c+u*s;i=((c=s*c+((16383&f)<<14)+r[n]+i)>>28)+(f>>14)+o*u,r[n++]=268435455&c}return i},m=28),C.prototype.DB=m,C.prototype.DM=(1<<m)-1,C.prototype.DV=1<<m,C.prototype.FV=Math.pow(2,52),C.prototype.F1=52-m,C.prototype.F2=2*m-52;var B,x,T="0123456789abcdefghijklmnopqrstuvwxyz",I=new Array;for(B="0".charCodeAt(0),x=0;x<=9;++x)I[B++]=x;for(B="a".charCodeAt(0),x=10;x<36;++x)I[B++]=x;for(B="A".charCodeAt(0),x=10;x<36;++x)I[B++]=x;function F(e){return T.charAt(e)}function k(e,t){var r=I[e.charCodeAt(t)];return null==r?-1:r}function R(e){var t=A();return t.fromInt(e),t}function D(e){var t,r=1;return 0!=(t=e>>>16)&&(e=t,r+=16),0!=(t=e>>8)&&(e=t,r+=8),0!=(t=e>>4)&&(e=t,r+=4),0!=(t=e>>2)&&(e=t,r+=2),0!=(t=e>>1)&&(e=t,r+=1),r}function _(e){this.m=e}function P(e){this.m=e,this.mp=e.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<e.DB-15)-1,this.mt2=2*e.t}function N(e,t){return e&t}function O(e,t){return e|t}function L(e,t){return e^t}function U(e,t){return e&~t}function K(e){if(0==e)return-1;var t=0;return 65535&e||(e>>=16,t+=16),255&e||(e>>=8,t+=8),15&e||(e>>=4,t+=4),3&e||(e>>=2,t+=2),1&e||++t,t}function M(e){for(var t=0;0!=e;)e&=e-1,++t;return t}function H(){}function j(e){return e}function V(e){this.r2=A(),this.q3=A(),C.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}_.prototype.convert=function(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e},_.prototype.revert=function(e){return e},_.prototype.reduce=function(e){e.divRemTo(this.m,null,e)},_.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},_.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},P.prototype.convert=function(e){var t=A();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(C.ZERO)>0&&this.m.subTo(t,t),t},P.prototype.revert=function(e){var t=A();return e.copyTo(t),this.reduce(t),t},P.prototype.reduce=function(e){for(;e.t<=this.mt2;)e[e.t++]=0;for(var t=0;t<this.m.t;++t){var r=32767&e[t],n=r*this.mpl+((r*this.mph+(e[t]>>15)*this.mpl&this.um)<<15)&e.DM;for(e[r=t+this.m.t]+=this.m.am(0,n,e,t,0,this.m.t);e[r]>=e.DV;)e[r]-=e.DV,e[++r]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)},P.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},P.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},C.prototype.copyTo=function(e){for(var t=this.t-1;t>=0;--t)e[t]=this[t];e.t=this.t,e.s=this.s},C.prototype.fromInt=function(e){this.t=1,this.s=e<0?-1:0,e>0?this[0]=e:e<-1?this[0]=e+this.DV:this.t=0},C.prototype.fromString=function(e,t){var r;if(16==t)r=4;else if(8==t)r=3;else if(256==t)r=8;else if(2==t)r=1;else if(32==t)r=5;else{if(4!=t)return void this.fromRadix(e,t);r=2}this.t=0,this.s=0;for(var n=e.length,i=!1,a=0;--n>=0;){var s=8==r?255&e[n]:k(e,n);s<0?"-"==e.charAt(n)&&(i=!0):(i=!1,0==a?this[this.t++]=s:a+r>this.DB?(this[this.t-1]|=(s&(1<<this.DB-a)-1)<<a,this[this.t++]=s>>this.DB-a):this[this.t-1]|=s<<a,(a+=r)>=this.DB&&(a-=this.DB))}8==r&&128&e[0]&&(this.s=-1,a>0&&(this[this.t-1]|=(1<<this.DB-a)-1<<a)),this.clamp(),i&&C.ZERO.subTo(this,this)},C.prototype.clamp=function(){for(var e=this.s&this.DM;this.t>0&&this[this.t-1]==e;)--this.t},C.prototype.dlShiftTo=function(e,t){var r;for(r=this.t-1;r>=0;--r)t[r+e]=this[r];for(r=e-1;r>=0;--r)t[r]=0;t.t=this.t+e,t.s=this.s},C.prototype.drShiftTo=function(e,t){for(var r=e;r<this.t;++r)t[r-e]=this[r];t.t=Math.max(this.t-e,0),t.s=this.s},C.prototype.lShiftTo=function(e,t){var r,n=e%this.DB,i=this.DB-n,a=(1<<i)-1,s=Math.floor(e/this.DB),o=this.s<<n&this.DM;for(r=this.t-1;r>=0;--r)t[r+s+1]=this[r]>>i|o,o=(this[r]&a)<<n;for(r=s-1;r>=0;--r)t[r]=0;t[s]=o,t.t=this.t+s+1,t.s=this.s,t.clamp()},C.prototype.rShiftTo=function(e,t){t.s=this.s;var r=Math.floor(e/this.DB);if(r>=this.t)t.t=0;else{var n=e%this.DB,i=this.DB-n,a=(1<<n)-1;t[0]=this[r]>>n;for(var s=r+1;s<this.t;++s)t[s-r-1]|=(this[s]&a)<<i,t[s-r]=this[s]>>n;n>0&&(t[this.t-r-1]|=(this.s&a)<<i),t.t=this.t-r,t.clamp()}},C.prototype.subTo=function(e,t){for(var r=0,n=0,i=Math.min(e.t,this.t);r<i;)n+=this[r]-e[r],t[r++]=n&this.DM,n>>=this.DB;if(e.t<this.t){for(n-=e.s;r<this.t;)n+=this[r],t[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<e.t;)n-=e[r],t[r++]=n&this.DM,n>>=this.DB;n-=e.s}t.s=n<0?-1:0,n<-1?t[r++]=this.DV+n:n>0&&(t[r++]=n),t.t=r,t.clamp()},C.prototype.multiplyTo=function(e,t){var r=this.abs(),n=e.abs(),i=r.t;for(t.t=i+n.t;--i>=0;)t[i]=0;for(i=0;i<n.t;++i)t[i+r.t]=r.am(0,n[i],t,i,0,r.t);t.s=0,t.clamp(),this.s!=e.s&&C.ZERO.subTo(t,t)},C.prototype.squareTo=function(e){for(var t=this.abs(),r=e.t=2*t.t;--r>=0;)e[r]=0;for(r=0;r<t.t-1;++r){var n=t.am(r,t[r],e,2*r,0,1);(e[r+t.t]+=t.am(r+1,2*t[r],e,2*r+1,n,t.t-r-1))>=t.DV&&(e[r+t.t]-=t.DV,e[r+t.t+1]=1)}e.t>0&&(e[e.t-1]+=t.am(r,t[r],e,2*r,0,1)),e.s=0,e.clamp()},C.prototype.divRemTo=function(e,t,r){var n=e.abs();if(!(n.t<=0)){var i=this.abs();if(i.t<n.t)return null!=t&&t.fromInt(0),void(null!=r&&this.copyTo(r));null==r&&(r=A());var a=A(),s=this.s,o=e.s,c=this.DB-D(n[n.t-1]);c>0?(n.lShiftTo(c,a),i.lShiftTo(c,r)):(n.copyTo(a),i.copyTo(r));var u=a.t,f=a[u-1];if(0!=f){var h=f*(1<<this.F1)+(u>1?a[u-2]>>this.F2:0),l=this.FV/h,d=(1<<this.F1)/h,p=1<<this.F2,g=r.t,y=g-u,v=null==t?A():t;for(a.dlShiftTo(y,v),r.compareTo(v)>=0&&(r[r.t++]=1,r.subTo(v,r)),C.ONE.dlShiftTo(u,v),v.subTo(a,a);a.t<u;)a[a.t++]=0;for(;--y>=0;){var m=r[--g]==f?this.DM:Math.floor(r[g]*l+(r[g-1]+p)*d);if((r[g]+=a.am(0,m,r,y,0,u))<m)for(a.dlShiftTo(y,v),r.subTo(v,r);r[g]<--m;)r.subTo(v,r)}null!=t&&(r.drShiftTo(u,t),s!=o&&C.ZERO.subTo(t,t)),r.t=u,r.clamp(),c>0&&r.rShiftTo(c,r),s<0&&C.ZERO.subTo(r,r)}}},C.prototype.invDigit=function(){if(this.t<1)return 0;var e=this[0];if(!(1&e))return 0;var t=3&e;return(t=(t=(t=(t=t*(2-(15&e)*t)&15)*(2-(255&e)*t)&255)*(2-((65535&e)*t&65535))&65535)*(2-e*t%this.DV)%this.DV)>0?this.DV-t:-t},C.prototype.isEven=function(){return 0==(this.t>0?1&this[0]:this.s)},C.prototype.exp=function(e,t){if(e>4294967295||e<1)return C.ONE;var r=A(),n=A(),i=t.convert(this),a=D(e)-1;for(i.copyTo(r);--a>=0;)if(t.sqrTo(r,n),(e&1<<a)>0)t.mulTo(n,i,r);else{var s=r;r=n,n=s}return t.revert(r)},C.prototype.toString=function(e){if(this.s<0)return"-"+this.negate().toString(e);var t;if(16==e)t=4;else if(8==e)t=3;else if(2==e)t=1;else if(32==e)t=5;else{if(4!=e)return this.toRadix(e);t=2}var r,n=(1<<t)-1,i=!1,a="",s=this.t,o=this.DB-s*this.DB%t;if(s-- >0)for(o<this.DB&&(r=this[s]>>o)>0&&(i=!0,a=F(r));s>=0;)o<t?(r=(this[s]&(1<<o)-1)<<t-o,r|=this[--s]>>(o+=this.DB-t)):(r=this[s]>>(o-=t)&n,o<=0&&(o+=this.DB,--s)),r>0&&(i=!0),i&&(a+=F(r));return i?a:"0"},C.prototype.negate=function(){var e=A();return C.ZERO.subTo(this,e),e},C.prototype.abs=function(){return this.s<0?this.negate():this},C.prototype.compareTo=function(e){var t=this.s-e.s;if(0!=t)return t;var r=this.t;if(0!=(t=r-e.t))return this.s<0?-t:t;for(;--r>=0;)if(0!=(t=this[r]-e[r]))return t;return 0},C.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+D(this[this.t-1]^this.s&this.DM)},C.prototype.mod=function(e){var t=A();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(C.ZERO)>0&&e.subTo(t,t),t},C.prototype.modPowInt=function(e,t){var r;return r=e<256||t.isEven()?new _(t):new P(t),this.exp(e,r)},C.ZERO=R(0),C.ONE=R(1),H.prototype.convert=j,H.prototype.revert=j,H.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r)},H.prototype.sqrTo=function(e,t){e.squareTo(t)},V.prototype.convert=function(e){if(e.s<0||e.t>2*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t=A();return e.copyTo(t),this.reduce(t),t},V.prototype.revert=function(e){return e},V.prototype.reduce=function(e){for(e.drShiftTo(this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,e.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);e.compareTo(this.r2)<0;)e.dAddOffset(1,this.m.t+1);for(e.subTo(this.r2,e);e.compareTo(this.m)>=0;)e.subTo(this.m,e)},V.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},V.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)};var G=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],q=(1<<26)/G[G.length-1];function z(){this.i=0,this.j=0,this.S=new Array}C.prototype.chunkSize=function(e){return Math.floor(Math.LN2*this.DB/Math.log(e))},C.prototype.toRadix=function(e){if(null==e&&(e=10),0==this.signum()||e<2||e>36)return"0";var t=this.chunkSize(e),r=Math.pow(e,t),n=R(r),i=A(),a=A(),s="";for(this.divRemTo(n,i,a);i.signum()>0;)s=(r+a.intValue()).toString(e).substr(1)+s,i.divRemTo(n,i,a);return a.intValue().toString(e)+s},C.prototype.fromRadix=function(e,t){this.fromInt(0),null==t&&(t=10);for(var r=this.chunkSize(t),n=Math.pow(t,r),i=!1,a=0,s=0,o=0;o<e.length;++o){var c=k(e,o);c<0?"-"==e.charAt(o)&&0==this.signum()&&(i=!0):(s=t*s+c,++a>=r&&(this.dMultiply(n),this.dAddOffset(s,0),a=0,s=0))}a>0&&(this.dMultiply(Math.pow(t,a)),this.dAddOffset(s,0)),i&&C.ZERO.subTo(this,this)},C.prototype.fromNumber=function(e,t,r){if("number"==typeof t)if(e<2)this.fromInt(1);else for(this.fromNumber(e,r),this.testBit(e-1)||this.bitwiseTo(C.ONE.shiftLeft(e-1),O,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(C.ONE.shiftLeft(e-1),this);else{var n=new Array,i=7&e;n.length=1+(e>>3),t.nextBytes(n),i>0?n[0]&=(1<<i)-1:n[0]=0,this.fromString(n,256)}},C.prototype.bitwiseTo=function(e,t,r){var n,i,a=Math.min(e.t,this.t);for(n=0;n<a;++n)r[n]=t(this[n],e[n]);if(e.t<this.t){for(i=e.s&this.DM,n=a;n<this.t;++n)r[n]=t(this[n],i);r.t=this.t}else{for(i=this.s&this.DM,n=a;n<e.t;++n)r[n]=t(i,e[n]);r.t=e.t}r.s=t(this.s,e.s),r.clamp()},C.prototype.changeBit=function(e,t){var r=C.ONE.shiftLeft(e);return this.bitwiseTo(r,t,r),r},C.prototype.addTo=function(e,t){for(var r=0,n=0,i=Math.min(e.t,this.t);r<i;)n+=this[r]+e[r],t[r++]=n&this.DM,n>>=this.DB;if(e.t<this.t){for(n+=e.s;r<this.t;)n+=this[r],t[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<e.t;)n+=e[r],t[r++]=n&this.DM,n>>=this.DB;n+=e.s}t.s=n<0?-1:0,n>0?t[r++]=n:n<-1&&(t[r++]=this.DV+n),t.t=r,t.clamp()},C.prototype.dMultiply=function(e){this[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()},C.prototype.dAddOffset=function(e,t){if(0!=e){for(;this.t<=t;)this[this.t++]=0;for(this[t]+=e;this[t]>=this.DV;)this[t]-=this.DV,++t>=this.t&&(this[this.t++]=0),++this[t]}},C.prototype.multiplyLowerTo=function(e,t,r){var n,i=Math.min(this.t+e.t,t);for(r.s=0,r.t=i;i>0;)r[--i]=0;for(n=r.t-this.t;i<n;++i)r[i+this.t]=this.am(0,e[i],r,i,0,this.t);for(n=Math.min(e.t,t);i<n;++i)this.am(0,e[i],r,i,0,t-i);r.clamp()},C.prototype.multiplyUpperTo=function(e,t,r){--t;var n=r.t=this.t+e.t-t;for(r.s=0;--n>=0;)r[n]=0;for(n=Math.max(t-this.t,0);n<e.t;++n)r[this.t+n-t]=this.am(t-n,e[n],r,0,0,this.t+n-t);r.clamp(),r.drShiftTo(1,r)},C.prototype.modInt=function(e){if(e<=0)return 0;var t=this.DV%e,r=this.s<0?e-1:0;if(this.t>0)if(0==t)r=this[0]%e;else for(var n=this.t-1;n>=0;--n)r=(t*r+this[n])%e;return r},C.prototype.millerRabin=function(e){var t=this.subtract(C.ONE),r=t.getLowestSetBit();if(r<=0)return!1;var n=t.shiftRight(r);(e=e+1>>1)>G.length&&(e=G.length);for(var i=A(),a=0;a<e;++a){i.fromInt(G[Math.floor(Math.random()*G.length)]);var s=i.modPow(n,this);if(0!=s.compareTo(C.ONE)&&0!=s.compareTo(t)){for(var o=1;o++<r&&0!=s.compareTo(t);)if(0==(s=s.modPowInt(2,this)).compareTo(C.ONE))return!1;if(0!=s.compareTo(t))return!1}}return!0},C.prototype.clone=function(){var e=A();return this.copyTo(e),e},C.prototype.intValue=function(){if(this.s<0){if(1==this.t)return this[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this[0];if(0==this.t)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]},C.prototype.byteValue=function(){return 0==this.t?this.s:this[0]<<24>>24},C.prototype.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16},C.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1},C.prototype.toByteArray=function(){var e=this.t,t=new Array;t[0]=this.s;var r,n=this.DB-e*this.DB%8,i=0;if(e-- >0)for(n<this.DB&&(r=this[e]>>n)!=(this.s&this.DM)>>n&&(t[i++]=r|this.s<<this.DB-n);e>=0;)n<8?(r=(this[e]&(1<<n)-1)<<8-n,r|=this[--e]>>(n+=this.DB-8)):(r=this[e]>>(n-=8)&255,n<=0&&(n+=this.DB,--e)),128&r&&(r|=-256),0==i&&(128&this.s)!=(128&r)&&++i,(i>0||r!=this.s)&&(t[i++]=r);return t},C.prototype.equals=function(e){return 0==this.compareTo(e)},C.prototype.min=function(e){return this.compareTo(e)<0?this:e},C.prototype.max=function(e){return this.compareTo(e)>0?this:e},C.prototype.and=function(e){var t=A();return this.bitwiseTo(e,N,t),t},C.prototype.or=function(e){var t=A();return this.bitwiseTo(e,O,t),t},C.prototype.xor=function(e){var t=A();return this.bitwiseTo(e,L,t),t},C.prototype.andNot=function(e){var t=A();return this.bitwiseTo(e,U,t),t},C.prototype.not=function(){for(var e=A(),t=0;t<this.t;++t)e[t]=this.DM&~this[t];return e.t=this.t,e.s=~this.s,e},C.prototype.shiftLeft=function(e){var t=A();return e<0?this.rShiftTo(-e,t):this.lShiftTo(e,t),t},C.prototype.shiftRight=function(e){var t=A();return e<0?this.lShiftTo(-e,t):this.rShiftTo(e,t),t},C.prototype.getLowestSetBit=function(){for(var e=0;e<this.t;++e)if(0!=this[e])return e*this.DB+K(this[e]);return this.s<0?this.t*this.DB:-1},C.prototype.bitCount=function(){for(var e=0,t=this.s&this.DM,r=0;r<this.t;++r)e+=M(this[r]^t);return e},C.prototype.testBit=function(e){var t=Math.floor(e/this.DB);return t>=this.t?0!=this.s:!!(this[t]&1<<e%this.DB)},C.prototype.setBit=function(e){return this.changeBit(e,O)},C.prototype.clearBit=function(e){return this.changeBit(e,U)},C.prototype.flipBit=function(e){return this.changeBit(e,L)},C.prototype.add=function(e){var t=A();return this.addTo(e,t),t},C.prototype.subtract=function(e){var t=A();return this.subTo(e,t),t},C.prototype.multiply=function(e){var t=A();return this.multiplyTo(e,t),t},C.prototype.divide=function(e){var t=A();return this.divRemTo(e,t,null),t},C.prototype.remainder=function(e){var t=A();return this.divRemTo(e,null,t),t},C.prototype.divideAndRemainder=function(e){var t=A(),r=A();return this.divRemTo(e,t,r),new Array(t,r)},C.prototype.modPow=function(e,t){var r,n,i=e.bitLength(),a=R(1);if(i<=0)return a;r=i<18?1:i<48?3:i<144?4:i<768?5:6,n=i<8?new _(t):t.isEven()?new V(t):new P(t);var s=new Array,o=3,c=r-1,u=(1<<r)-1;if(s[1]=n.convert(this),r>1){var f=A();for(n.sqrTo(s[1],f);o<=u;)s[o]=A(),n.mulTo(f,s[o-2],s[o]),o+=2}var h,l,d=e.t-1,p=!0,g=A();for(i=D(e[d])-1;d>=0;){for(i>=c?h=e[d]>>i-c&u:(h=(e[d]&(1<<i+1)-1)<<c-i,d>0&&(h|=e[d-1]>>this.DB+i-c)),o=r;!(1&h);)h>>=1,--o;if((i-=o)<0&&(i+=this.DB,--d),p)s[h].copyTo(a),p=!1;else{for(;o>1;)n.sqrTo(a,g),n.sqrTo(g,a),o-=2;o>0?n.sqrTo(a,g):(l=a,a=g,g=l),n.mulTo(g,s[h],a)}for(;d>=0&&!(e[d]&1<<i);)n.sqrTo(a,g),l=a,a=g,g=l,--i<0&&(i=this.DB-1,--d)}return n.revert(a)},C.prototype.modInverse=function(e){var t=e.isEven();if(this.isEven()&&t||0==e.signum())return C.ZERO;for(var r=e.clone(),n=this.clone(),i=R(1),a=R(0),s=R(0),o=R(1);0!=r.signum();){for(;r.isEven();)r.rShiftTo(1,r),t?(i.isEven()&&a.isEven()||(i.addTo(this,i),a.subTo(e,a)),i.rShiftTo(1,i)):a.isEven()||a.subTo(e,a),a.rShiftTo(1,a);for(;n.isEven();)n.rShiftTo(1,n),t?(s.isEven()&&o.isEven()||(s.addTo(this,s),o.subTo(e,o)),s.rShiftTo(1,s)):o.isEven()||o.subTo(e,o),o.rShiftTo(1,o);r.compareTo(n)>=0?(r.subTo(n,r),t&&i.subTo(s,i),a.subTo(o,a)):(n.subTo(r,n),t&&s.subTo(i,s),o.subTo(a,o))}return 0!=n.compareTo(C.ONE)?C.ZERO:o.compareTo(e)>=0?o.subtract(e):o.signum()<0?(o.addTo(e,o),o.signum()<0?o.add(e):o):o},C.prototype.pow=function(e){return this.exp(e,new H)},C.prototype.gcd=function(e){var t=this.s<0?this.negate():this.clone(),r=e.s<0?e.negate():e.clone();if(t.compareTo(r)<0){var n=t;t=r,r=n}var i=t.getLowestSetBit(),a=r.getLowestSetBit();if(a<0)return t;for(i<a&&(a=i),a>0&&(t.rShiftTo(a,t),r.rShiftTo(a,r));t.signum()>0;)(i=t.getLowestSetBit())>0&&t.rShiftTo(i,t),(i=r.getLowestSetBit())>0&&r.rShiftTo(i,r),t.compareTo(r)>=0?(t.subTo(r,t),t.rShiftTo(1,t)):(r.subTo(t,r),r.rShiftTo(1,r));return a>0&&r.lShiftTo(a,r),r},C.prototype.isProbablePrime=function(e){var t,r=this.abs();if(1==r.t&&r[0]<=G[G.length-1]){for(t=0;t<G.length;++t)if(r[0]==G[t])return!0;return!1}if(r.isEven())return!1;for(t=1;t<G.length;){for(var n=G[t],i=t+1;i<G.length&&n<q;)n*=G[i++];for(n=r.modInt(n);t<i;)if(n%G[t++]==0)return!1}return r.millerRabin(e)},C.prototype.square=function(){var e=A();return this.squareTo(e),e},z.prototype.init=function(e){var t,r,n;for(t=0;t<256;++t)this.S[t]=t;for(r=0,t=0;t<256;++t)r=r+this.S[t]+e[t%e.length]&255,n=this.S[t],this.S[t]=this.S[r],this.S[r]=n;this.i=0,this.j=0},z.prototype.next=function(){var e;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,e=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=e,this.S[e+this.S[this.i]&255]};var W,X,Y,J=256;function Q(){!function(e){X[Y++]^=255&e,X[Y++]^=e>>8&255,X[Y++]^=e>>16&255,X[Y++]^=e>>24&255,Y>=J&&(Y-=J)}((new Date).getTime())}if(null==X){var Z;if(X=new Array,Y=0,void 0!==y&&(void 0!==y.crypto||void 0!==y.msCrypto)){var $=y.crypto||y.msCrypto;if($.getRandomValues){var ee=new Uint8Array(32);for($.getRandomValues(ee),Z=0;Z<32;++Z)X[Y++]=ee[Z]}else if("Netscape"==g.appName&&g.appVersion<"5"){var te=y.crypto.random(32);for(Z=0;Z<te.length;++Z)X[Y++]=255&te.charCodeAt(Z)}}for(;Y<J;)Z=Math.floor(65536*Math.random()),X[Y++]=Z>>>8,X[Y++]=255&Z;Y=0,Q()}function re(){if(null==W){for(Q(),(W=new z).init(X),Y=0;Y<X.length;++Y)X[Y]=0;Y=0}return W.next()}function ne(){}function ie(e,t){return new C(e,t)}function ae(){this.n=null,this.e=0,this.d=null,this.p=null,this.q=null,this.dmp1=null,this.dmq1=null,this.coeff=null}function se(e,t){this.x=t,this.q=e}function oe(e,t,r,n){this.curve=e,this.x=t,this.y=r,this.z=null==n?C.ONE:n,this.zinv=null}function ce(e,t,r){this.q=e,this.a=this.fromBigInteger(t),this.b=this.fromBigInteger(r),this.infinity=new oe(this,null,null)}ne.prototype.nextBytes=function(e){var t;for(t=0;t<e.length;++t)e[t]=re()},ae.prototype.doPublic=function(e){return e.modPowInt(this.e,this.n)},ae.prototype.setPublic=function(e,t){if(this.isPublic=!0,this.isPrivate=!1,"string"!=typeof e)this.n=e,this.e=t;else{if(!(null!=e&&null!=t&&e.length>0&&t.length>0))throw"Invalid RSA public key";this.n=ie(e,16),this.e=parseInt(t,16)}},ae.prototype.type="RSA",ae.prototype.doPrivate=function(e){if(null==this.p||null==this.q)return e.modPow(this.d,this.n);for(var t=e.mod(this.p).modPow(this.dmp1,this.p),r=e.mod(this.q).modPow(this.dmq1,this.q);t.compareTo(r)<0;)t=t.add(this.p);return t.subtract(r).multiply(this.coeff).mod(this.p).multiply(this.q).add(r)},ae.prototype.setPrivate=function(e,t,r){if(this.isPrivate=!0,"string"!=typeof e)this.n=e,this.e=t,this.d=r;else{if(!(null!=e&&null!=t&&e.length>0&&t.length>0))throw"Invalid RSA private key";this.n=ie(e,16),this.e=parseInt(t,16),this.d=ie(r,16)}},ae.prototype.setPrivateEx=function(e,t,r,n,i,a,s,o){if(this.isPrivate=!0,this.isPublic=!1,null==e)throw"RSASetPrivateEx N == null";if(null==t)throw"RSASetPrivateEx E == null";if(0==e.length)throw"RSASetPrivateEx N.length == 0";if(0==t.length)throw"RSASetPrivateEx E.length == 0";if(!(null!=e&&null!=t&&e.length>0&&t.length>0))throw"Invalid RSA private key in RSASetPrivateEx";this.n=ie(e,16),this.e=parseInt(t,16),this.d=ie(r,16),this.p=ie(n,16),this.q=ie(i,16),this.dmp1=ie(a,16),this.dmq1=ie(s,16),this.coeff=ie(o,16)},ae.prototype.generate=function(e,t){var r=new ne,n=e>>1;this.e=parseInt(t,16);for(var i=new C(t,16),a=e/2-100,s=C.ONE.shiftLeft(a);;){for(;this.p=new C(e-n,1,r),0!=this.p.subtract(C.ONE).gcd(i).compareTo(C.ONE)||!this.p.isProbablePrime(10););for(;this.q=new C(n,1,r),0!=this.q.subtract(C.ONE).gcd(i).compareTo(C.ONE)||!this.q.isProbablePrime(10););if(this.p.compareTo(this.q)<=0){var o=this.p;this.p=this.q,this.q=o}var c=this.q.subtract(this.p).abs();if(!(c.bitLength()<a||c.compareTo(s)<=0)){var u=this.p.subtract(C.ONE),f=this.q.subtract(C.ONE),h=u.multiply(f);if(0==h.gcd(i).compareTo(C.ONE)&&(this.n=this.p.multiply(this.q),this.n.bitLength()==e)){this.d=i.modInverse(h),this.dmp1=this.d.mod(u),this.dmq1=this.d.mod(f),this.coeff=this.q.modInverse(this.p);break}}}this.isPrivate=!0},se.prototype.equals=function(e){return e==this||this.q.equals(e.q)&&this.x.equals(e.x)},se.prototype.toBigInteger=function(){return this.x},se.prototype.negate=function(){return new se(this.q,this.x.negate().mod(this.q))},se.prototype.add=function(e){return new se(this.q,this.x.add(e.toBigInteger()).mod(this.q))},se.prototype.subtract=function(e){return new se(this.q,this.x.subtract(e.toBigInteger()).mod(this.q))},se.prototype.multiply=function(e){return new se(this.q,this.x.multiply(e.toBigInteger()).mod(this.q))},se.prototype.square=function(){return new se(this.q,this.x.square().mod(this.q))},se.prototype.divide=function(e){return new se(this.q,this.x.multiply(e.toBigInteger().modInverse(this.q)).mod(this.q))},se.prototype.sqrt=function(){return new se(this.q,this.x.sqrt().mod(this.q))},oe.prototype.getX=function(){return null==this.zinv&&(this.zinv=this.z.modInverse(this.curve.q)),this.curve.fromBigInteger(this.x.toBigInteger().multiply(this.zinv).mod(this.curve.q))},oe.prototype.getY=function(){return null==this.zinv&&(this.zinv=this.z.modInverse(this.curve.q)),this.curve.fromBigInteger(this.y.toBigInteger().multiply(this.zinv).mod(this.curve.q))},oe.prototype.equals=function(e){return e==this||(this.isInfinity()?e.isInfinity():e.isInfinity()?this.isInfinity():!!e.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(e.z)).mod(this.curve.q).equals(C.ZERO)&&e.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(e.z)).mod(this.curve.q).equals(C.ZERO))},oe.prototype.isInfinity=function(){return null==this.x&&null==this.y||this.z.equals(C.ZERO)&&!this.y.toBigInteger().equals(C.ZERO)},oe.prototype.negate=function(){return new oe(this.curve,this.x,this.y.negate(),this.z)},oe.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(e.z)).mod(this.curve.q),r=e.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(e.z)).mod(this.curve.q);if(C.ZERO.equals(r))return C.ZERO.equals(t)?this.twice():this.curve.getInfinity();var n=new C("3"),i=this.x.toBigInteger(),a=this.y.toBigInteger(),s=(e.x.toBigInteger(),e.y.toBigInteger(),r.square()),o=s.multiply(r),c=i.multiply(s),u=t.square().multiply(this.z),f=u.subtract(c.shiftLeft(1)).multiply(e.z).subtract(o).multiply(r).mod(this.curve.q),h=c.multiply(n).multiply(t).subtract(a.multiply(o)).subtract(u.multiply(t)).multiply(e.z).add(t.multiply(o)).mod(this.curve.q),l=o.multiply(this.z).multiply(e.z).mod(this.curve.q);return new oe(this.curve,this.curve.fromBigInteger(f),this.curve.fromBigInteger(h),l)},oe.prototype.twice=function(){if(this.isInfinity())return this;if(0==this.y.toBigInteger().signum())return this.curve.getInfinity();var e=new C("3"),t=this.x.toBigInteger(),r=this.y.toBigInteger(),n=r.multiply(this.z),i=n.multiply(r).mod(this.curve.q),a=this.curve.a.toBigInteger(),s=t.square().multiply(e);C.ZERO.equals(a)||(s=s.add(this.z.square().multiply(a)));var o=(s=s.mod(this.curve.q)).square().subtract(t.shiftLeft(3).multiply(i)).shiftLeft(1).multiply(n).mod(this.curve.q),c=s.multiply(e).multiply(t).subtract(i.shiftLeft(1)).shiftLeft(2).multiply(i).subtract(s.square().multiply(s)).mod(this.curve.q),u=n.square().multiply(n).shiftLeft(3).mod(this.curve.q);return new oe(this.curve,this.curve.fromBigInteger(o),this.curve.fromBigInteger(c),u)},oe.prototype.multiply=function(e){if(this.isInfinity())return this;if(0==e.signum())return this.curve.getInfinity();var t,r=e,n=r.multiply(new C("3")),i=this.negate(),a=this,s=this.curve.q.subtract(e),o=s.multiply(new C("3")),c=new oe(this.curve,this.x,this.y),u=c.negate();for(t=n.bitLength()-2;t>0;--t){a=a.twice();var f=n.testBit(t);f!=r.testBit(t)&&(a=a.add(f?this:i))}for(t=o.bitLength()-2;t>0;--t){c=c.twice();var h=o.testBit(t);h!=s.testBit(t)&&(c=c.add(h?c:u))}return a},oe.prototype.multiplyTwo=function(e,t,r){var n;n=e.bitLength()>r.bitLength()?e.bitLength()-1:r.bitLength()-1;for(var i=this.curve.getInfinity(),a=this.add(t);n>=0;)i=i.twice(),e.testBit(n)?i=r.testBit(n)?i.add(a):i.add(this):r.testBit(n)&&(i=i.add(t)),--n;return i},ce.prototype.getQ=function(){return this.q},ce.prototype.getA=function(){return this.a},ce.prototype.getB=function(){return this.b},ce.prototype.equals=function(e){return e==this||this.q.equals(e.q)&&this.a.equals(e.a)&&this.b.equals(e.b)},ce.prototype.getInfinity=function(){return this.infinity},ce.prototype.fromBigInteger=function(e){return new se(this.q,e)},ce.prototype.decodePointHex=function(e){switch(parseInt(e.substr(0,2),16)){case 0:return this.infinity;case 2:case 3:var t=e.substr(0,2),r=(e.substr(2),this.fromBigInteger(new C(o,16))),n=this.getA(),i=this.getB(),a=r.square().add(n).multiply(r).add(i).sqrt();return"03"==t&&(a=a.negate()),new oe(this,r,a);case 4:case 6:case 7:var s=(e.length-2)/2,o=e.substr(2,s),c=e.substr(s+2,s);return new oe(this,this.fromBigInteger(new C(o,16)),this.fromBigInteger(new C(c,16)));default:return null}},se.prototype.getByteLength=function(){return Math.floor((this.toBigInteger().bitLength()+7)/8)},oe.prototype.getEncoded=function(e){var t=function(e,t){var r=e.toByteArrayUnsigned();if(t<r.length)r=r.slice(r.length-t);else for(;t>r.length;)r.unshift(0);return r},r=this.getX().toBigInteger(),n=this.getY().toBigInteger(),i=t(r,32);return e?n.isEven()?i.unshift(2):i.unshift(3):(i.unshift(4),i=i.concat(t(n,32))),i},oe.decodeFrom=function(e,t){t[0];var r=t.length-1,n=t.slice(1,1+r/2),i=t.slice(1+r/2,1+r);n.unshift(0),i.unshift(0);var a=new C(n),s=new C(i);return new oe(e,e.fromBigInteger(a),e.fromBigInteger(s))},oe.decodeFromHex=function(e,t){t.substr(0,2);var r=t.length-2,n=t.substr(2,r/2),i=t.substr(2+r/2,r/2),a=new C(n,16),s=new C(i,16);return new oe(e,e.fromBigInteger(a),e.fromBigInteger(s))},oe.prototype.add2D=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;if(this.x.equals(e.x))return this.y.equals(e.y)?this.twice():this.curve.getInfinity();var t=e.x.subtract(this.x),r=e.y.subtract(this.y).divide(t),n=r.square().subtract(this.x).subtract(e.x),i=r.multiply(this.x.subtract(n)).subtract(this.y);return new oe(this.curve,n,i)},oe.prototype.twice2D=function(){if(this.isInfinity())return this;if(0==this.y.toBigInteger().signum())return this.curve.getInfinity();var e=this.curve.fromBigInteger(C.valueOf(2)),t=this.curve.fromBigInteger(C.valueOf(3)),r=this.x.square().multiply(t).add(this.curve.a).divide(this.y.multiply(e)),n=r.square().subtract(this.x.multiply(e)),i=r.multiply(this.x.subtract(n)).subtract(this.y);return new oe(this.curve,n,i)},oe.prototype.multiply2D=function(e){if(this.isInfinity())return this;if(0==e.signum())return this.curve.getInfinity();var t,r=e,n=r.multiply(new C("3")),i=this.negate(),a=this;for(t=n.bitLength()-2;t>0;--t){a=a.twice();var s=n.testBit(t);s!=r.testBit(t)&&(a=a.add2D(s?this:i))}return a},oe.prototype.isOnCurve=function(){var e=this.getX().toBigInteger(),t=this.getY().toBigInteger(),r=this.curve.getA().toBigInteger(),n=this.curve.getB().toBigInteger(),i=this.curve.getQ(),a=t.multiply(t).mod(i),s=e.multiply(e).multiply(e).add(r.multiply(e)).add(n).mod(i);return a.equals(s)},oe.prototype.toString=function(){return"("+this.getX().toBigInteger().toString()+","+this.getY().toBigInteger().toString()+")"},oe.prototype.validate=function(){var e=this.curve.getQ();if(this.isInfinity())throw new Error("Point is at infinity.");var t=this.getX().toBigInteger(),r=this.getY().toBigInteger();if(t.compareTo(C.ONE)<0||t.compareTo(e.subtract(C.ONE))>0)throw new Error("x coordinate out of bounds");if(r.compareTo(C.ONE)<0||r.compareTo(e.subtract(C.ONE))>0)throw new Error("y coordinate out of bounds");if(!this.isOnCurve())throw new Error("Point is not on the curve.");if(this.multiply(e).isInfinity())throw new Error("Point is not a scalar multiple of G.");return!0};var ue=function(){var e=new RegExp('(?:false|true|null|[\\{\\}\\[\\]]|(?:-?\\b(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?(?:[eE][+-]?[0-9]+)?\\b)|(?:"(?:[^\\0-\\x08\\x0a-\\x1f"\\\\]|\\\\(?:["/\\\\bfnrt]|u[0-9A-Fa-f]{4}))*"))',"g"),t=new RegExp("\\\\(?:([^u])|u(.{4}))","g"),r={'"':'"',"/":"/","\\":"\\",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"};function n(e,t,n){return t?r[t]:String.fromCharCode(parseInt(n,16))}var i=new String(""),a=Object.hasOwnProperty;return function(r,s){var o,c,u=r.match(e),f=u[0],h=!1;"{"===f?o={}:"["===f?o=[]:(o=[],h=!0);for(var l=[o],d=1-h,p=u.length;d<p;++d){var g;switch((f=u[d]).charCodeAt(0)){default:(g=l[0])[c||g.length]=+f,c=void 0;break;case 34:if(-1!==(f=f.substring(1,f.length-1)).indexOf("\\")&&(f=f.replace(t,n)),g=l[0],!c){if(!(g instanceof Array)){c=f||i;break}c=g.length}g[c]=f,c=void 0;break;case 91:g=l[0],l.unshift(g[c||g.length]=[]),c=void 0;break;case 93:case 125:l.shift();break;case 102:(g=l[0])[c||g.length]=!1,c=void 0;break;case 110:(g=l[0])[c||g.length]=null,c=void 0;break;case 116:(g=l[0])[c||g.length]=!0,c=void 0;break;case 123:g=l[0],l.unshift(g[c||g.length]={}),c=void 0}}if(h){if(1!==l.length)throw new Error;o=o[0]}else if(l.length)throw new Error;if(s){var y=function(e,t){var r=e[t];if(r&&"object"==typeof r){var n=null;for(var i in r)if(a.call(r,i)&&r!==e){var o=y(r,i);void 0!==o?r[i]=o:(n||(n=[]),n.push(i))}if(n)for(var c=n.length;--c>=0;)delete r[n[c]]}return s.call(e,t,r)};o=y({"":o},"")}return o}}();void 0!==fe&&fe||(fe={}),void 0!==fe.asn1&&fe.asn1||(fe.asn1={}),fe.asn1.ASN1Util=new function(){this.integerToByteHex=function(e){var t=e.toString(16);return t.length%2==1&&(t="0"+t),t},this.bigIntToMinTwosComplementsHex=function(e){return Ve(e)},this.getPEMStringFromHex=function(e,t){return Be(e,t)},this.newObject=function(e){var t=fe.asn1,r=t.ASN1Object,n=t.DERBoolean,i=t.DERInteger,a=t.DERBitString,s=t.DEROctetString,o=t.DERNull,c=t.DERObjectIdentifier,u=t.DEREnumerated,f=t.DERUTF8String,h=t.DERNumericString,l=t.DERPrintableString,d=t.DERTeletexString,p=t.DERIA5String,g=t.DERUTCTime,y=t.DERGeneralizedTime,v=t.DERVisibleString,m=t.DERBMPString,b=t.DERSequence,w=t.DERSet,S=t.DERTaggedObject,E=t.ASN1Util.newObject;if(e instanceof t.ASN1Object)return e;var C=Object.keys(e);if(1!=C.length)throw new Error("key of param shall be only one.");var A=C[0];if(-1==":asn1:bool:int:bitstr:octstr:null:oid:enum:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:visstr:bmpstr:seq:set:tag:".indexOf(":"+A+":"))throw new Error("undefined key: "+A);if("bool"==A)return new n(e[A]);if("int"==A)return new i(e[A]);if("bitstr"==A)return new a(e[A]);if("octstr"==A)return new s(e[A]);if("null"==A)return new o(e[A]);if("oid"==A)return new c(e[A]);if("enum"==A)return new u(e[A]);if("utf8str"==A)return new f(e[A]);if("numstr"==A)return new h(e[A]);if("prnstr"==A)return new l(e[A]);if("telstr"==A)return new d(e[A]);if("ia5str"==A)return new p(e[A]);if("utctime"==A)return new g(e[A]);if("gentime"==A)return new y(e[A]);if("visstr"==A)return new v(e[A]);if("bmpstr"==A)return new m(e[A]);if("asn1"==A)return new r(e[A]);if("seq"==A){for(var B=e[A],x=[],T=0;T<B.length;T++){var I=E(B[T]);x.push(I)}return new b({array:x})}if("set"==A){for(B=e[A],x=[],T=0;T<B.length;T++)I=E(B[T]),x.push(I);return new w({array:x})}if("tag"==A){var F=e[A];if("[object Array]"===Object.prototype.toString.call(F)&&3==F.length){var k=E(F[2]);return new S({tag:F[0],explicit:F[1],obj:k})}return new S(F)}},this.jsonToASN1HEX=function(e){return this.newObject(e).tohex()}},fe.asn1.ASN1Util.oidHexToInt=function(e){for(var t="",r=parseInt(e.substr(0,2),16),n=(t=Math.floor(r/40)+"."+r%40,""),i=2;i<e.length;i+=2){var a=("00000000"+parseInt(e.substr(i,2),16).toString(2)).slice(-8);n+=a.substr(1,7),"0"==a.substr(0,1)&&(t=t+"."+new C(n,2).toString(10),n="")}return t},fe.asn1.ASN1Util.oidIntToHex=function(e){var t=function(e){var t=e.toString(16);return 1==t.length&&(t="0"+t),t},r=function(e){var r="",n=new C(e,10).toString(2),i=7-n.length%7;7==i&&(i=0);for(var a="",s=0;s<i;s++)a+="0";for(n=a+n,s=0;s<n.length-1;s+=7){var o=n.substr(s,7);s!=n.length-7&&(o="1"+o),r+=t(parseInt(o,2))}return r};if(!e.match(/^[0-9.]+$/))throw"malformed oid string: "+e;var n="",i=e.split("."),a=40*parseInt(i[0])+parseInt(i[1]);n+=t(a),i.splice(0,2);for(var s=0;s<i.length;s++)n+=r(i[s]);return n},fe.asn1.ASN1Object=function(e){this.params=null,this.getLengthHexFromValue=function(){if(void 0===this.hV||null==this.hV)throw new Error("this.hV is null or undefined");if(this.hV.length%2==1)throw new Error("value hex must be even length: n=0,v="+this.hV);var e=this.hV.length/2,t=e.toString(16);if(t.length%2==1&&(t="0"+t),e<128)return t;var r=t.length/2;if(r>15)throw new Error("ASN.1 length too long to represent by 8x: n = "+e.toString(16));return(128+r).toString(16)+t},this.tohex=function(){return(null==this.hTLV||this.isModified)&&(this.hV=this.getFreshValueHex(),this.hL=this.getLengthHexFromValue(),this.hTLV=this.hT+this.hL+this.hV,this.isModified=!1),this.hTLV},this.getEncodedHex=function(){return this.tohex()},this.getValueHex=function(){return this.tohex(),this.hV},this.getFreshValueHex=function(){return""},this.setByParam=function(e){this.params=e},null!=e&&null!=e.tlv&&(this.hTLV=e.tlv,this.isModified=!1)},fe.asn1.DERAbstractString=function(e){fe.asn1.DERAbstractString.superclass.constructor.call(this),this.getString=function(){return this.s},this.setString=function(e){this.hTLV=null,this.isModified=!0,this.s=e,this.hV=we(this.s).toLowerCase()},this.setStringHex=function(e){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=e},this.getFreshValueHex=function(){return this.hV},void 0!==e&&("string"==typeof e?this.setString(e):void 0!==e.str?this.setString(e.str):void 0!==e.hex&&this.setStringHex(e.hex))},We(fe.asn1.DERAbstractString,fe.asn1.ASN1Object),fe.asn1.DERAbstractTime=function(e){fe.asn1.DERAbstractTime.superclass.constructor.call(this),this.localDateToUTC=function(e){var t=e.getTime()+6e4*e.getTimezoneOffset();return new Date(t)},this.formatDate=function(e,t,r){var n=this.zeroPadding,i=this.localDateToUTC(e),a=String(i.getFullYear());"utc"==t&&(a=a.substr(2,2));var s=a+n(String(i.getMonth()+1),2)+n(String(i.getDate()),2)+n(String(i.getHours()),2)+n(String(i.getMinutes()),2)+n(String(i.getSeconds()),2);if(!0===r){var o=i.getMilliseconds();if(0!=o){var c=n(String(o),3);s=s+"."+(c=c.replace(/[0]+$/,""))}}return s+"Z"},this.zeroPadding=function(e,t){return e.length>=t?e:new Array(t-e.length+1).join("0")+e},this.setByParam=function(e){this.hV=null,this.hTLV=null,this.params=e},this.getString=function(){},this.setString=function(e){this.hTLV=null,this.isModified=!0,null==this.params&&(this.params={}),this.params.str=e},this.setByDate=function(e){this.hTLV=null,this.isModified=!0,null==this.params&&(this.params={}),this.params.date=e},this.setByDateValue=function(e,t,r,n,i,a){var s=new Date(Date.UTC(e,t-1,r,n,i,a,0));this.setByDate(s)},this.getFreshValueHex=function(){return this.hV}},We(fe.asn1.DERAbstractTime,fe.asn1.ASN1Object),fe.asn1.DERAbstractStructured=function(e){fe.asn1.DERAbstractString.superclass.constructor.call(this),this.setByASN1ObjectArray=function(e){this.hTLV=null,this.isModified=!0,this.asn1Array=e},this.appendASN1Object=function(e){this.hTLV=null,this.isModified=!0,this.asn1Array.push(e)},this.asn1Array=new Array,void 0!==e&&void 0!==e.array&&(this.asn1Array=e.array)},We(fe.asn1.DERAbstractStructured,fe.asn1.ASN1Object),fe.asn1.DERBoolean=function(e){fe.asn1.DERBoolean.superclass.constructor.call(this),this.hT="01",this.hTLV=0==e?"010100":"0101ff"},We(fe.asn1.DERBoolean,fe.asn1.ASN1Object),fe.asn1.DERInteger=function(e){fe.asn1.DERInteger.superclass.constructor.call(this),this.hT="02",this.params=null;var t=Ve;this.setByBigInteger=function(e){this.isModified=!0,this.params={bigint:e}},this.setByInteger=function(e){this.isModified=!0,this.params=e},this.setValueHex=function(e){this.isModified=!0,this.params={hex:e}},this.getFreshValueHex=function(){var e=this.params,r=null;if(null==e)throw new Error("value not set");if("object"==typeof e&&null!=e.hex)return this.hV=e.hex,this.hV;if("number"==typeof e)r=new C(String(e),10);else if(null!=e.int)r=new C(String(e.int),10);else{if(null==e.bigint)throw new Error("wrong parameter");r=e.bigint}return this.hV=t(r),this.hV},null!=e&&(this.params=e)},We(fe.asn1.DERInteger,fe.asn1.ASN1Object),fe.asn1.DERBitString=function(e){if(void 0!==e&&void 0!==e.obj){var t=fe.asn1.ASN1Util.newObject(e.obj);e.hex="00"+t.tohex()}fe.asn1.DERBitString.superclass.constructor.call(this),this.hT="03",this.setHexValueIncludingUnusedBits=function(e){this.hTLV=null,this.isModified=!0,this.hV=e},this.setUnusedBitsAndHexValue=function(e,t){if(e<0||7<e)throw"unused bits shall be from 0 to 7: u = "+e;var r="0"+e;this.hTLV=null,this.isModified=!0,this.hV=r+t},this.setByBinaryString=function(e){var t=8-(e=e.replace(/0+$/,"")).length%8;8==t&&(t=0),e+="0000000".substr(0,t);for(var r="",n=0;n<e.length-1;n+=8){var i=e.substr(n,8),a=parseInt(i,2).toString(16);1==a.length&&(a="0"+a),r+=a}this.hTLV=null,this.isModified=!0,this.hV="0"+t+r},this.setByBooleanArray=function(e){for(var t="",r=0;r<e.length;r++)1==e[r]?t+="1":t+="0";this.setByBinaryString(t)},this.newFalseArray=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=!1;return t},this.getFreshValueHex=function(){return this.hV},void 0!==e&&("string"==typeof e&&e.toLowerCase().match(/^[0-9a-f]+$/)?this.setHexValueIncludingUnusedBits(e):void 0!==e.hex?this.setHexValueIncludingUnusedBits(e.hex):void 0!==e.bin?this.setByBinaryString(e.bin):void 0!==e.array&&this.setByBooleanArray(e.array))},We(fe.asn1.DERBitString,fe.asn1.ASN1Object),fe.asn1.DEROctetString=function(e){if(void 0!==e&&void 0!==e.obj){var t=fe.asn1.ASN1Util.newObject(e.obj);e.hex=t.tohex()}fe.asn1.DEROctetString.superclass.constructor.call(this,e),this.hT="04"},We(fe.asn1.DEROctetString,fe.asn1.DERAbstractString),fe.asn1.DERNull=function(){fe.asn1.DERNull.superclass.constructor.call(this),this.hT="05",this.hTLV="0500"},We(fe.asn1.DERNull,fe.asn1.ASN1Object),fe.asn1.DERObjectIdentifier=function(e){fe.asn1.DERObjectIdentifier.superclass.constructor.call(this),this.hT="06",this.setValueHex=function(e){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=e},this.setValueOidString=function(e){var t=function(e){var t=function(e){var t=e.toString(16);return 1==t.length&&(t="0"+t),t},r=function(e){var r="",n=parseInt(e,10).toString(2),i=7-n.length%7;7==i&&(i=0);for(var a="",s=0;s<i;s++)a+="0";for(n=a+n,s=0;s<n.length-1;s+=7){var o=n.substr(s,7);s!=n.length-7&&(o="1"+o),r+=t(parseInt(o,2))}return r};try{if(!e.match(/^[0-9.]+$/))return null;var n="",i=e.split("."),a=40*parseInt(i[0],10)+parseInt(i[1],10);n+=t(a),i.splice(0,2);for(var s=0;s<i.length;s++)n+=r(i[s]);return n}catch(e){return null}}(e);if(null==t)throw new Error("malformed oid string: "+e);this.hTLV=null,this.isModified=!0,this.s=null,this.hV=t},this.setValueName=function(e){var t=fe.asn1.x509.OID.name2oid(e);if(""===t)throw new Error("DERObjectIdentifier oidName undefined: "+e);this.setValueOidString(t)},this.setValueNameOrOid=function(e){e.match(/^[0-2].[0-9.]+$/)?this.setValueOidString(e):this.setValueName(e)},this.getFreshValueHex=function(){return this.hV},this.setByParam=function(e){"string"==typeof e?this.setValueNameOrOid(e):void 0!==e.oid?this.setValueNameOrOid(e.oid):void 0!==e.name?this.setValueNameOrOid(e.name):void 0!==e.hex&&this.setValueHex(e.hex)},void 0!==e&&this.setByParam(e)},We(fe.asn1.DERObjectIdentifier,fe.asn1.ASN1Object),fe.asn1.DEREnumerated=function(e){fe.asn1.DEREnumerated.superclass.constructor.call(this),this.hT="0a",this.setByBigInteger=function(e){this.hTLV=null,this.isModified=!0,this.hV=Ve(e)},this.setByInteger=function(e){var t=new C(String(e),10);this.setByBigInteger(t)},this.setValueHex=function(e){this.hV=e},this.getFreshValueHex=function(){return this.hV},void 0!==e&&(void 0!==e.int?this.setByInteger(e.int):"number"==typeof e?this.setByInteger(e):void 0!==e.hex&&this.setValueHex(e.hex))},We(fe.asn1.DEREnumerated,fe.asn1.ASN1Object),fe.asn1.DERUTF8String=function(e){fe.asn1.DERUTF8String.superclass.constructor.call(this,e),this.hT="0c"},We(fe.asn1.DERUTF8String,fe.asn1.DERAbstractString),fe.asn1.DERNumericString=function(e){fe.asn1.DERNumericString.superclass.constructor.call(this,e),this.hT="12"},We(fe.asn1.DERNumericString,fe.asn1.DERAbstractString),fe.asn1.DERPrintableString=function(e){fe.asn1.DERPrintableString.superclass.constructor.call(this,e),this.hT="13"},We(fe.asn1.DERPrintableString,fe.asn1.DERAbstractString),fe.asn1.DERTeletexString=function(e){fe.asn1.DERTeletexString.superclass.constructor.call(this,e),this.hT="14"},We(fe.asn1.DERTeletexString,fe.asn1.DERAbstractString),fe.asn1.DERIA5String=function(e){fe.asn1.DERIA5String.superclass.constructor.call(this,e),this.hT="16"},We(fe.asn1.DERIA5String,fe.asn1.DERAbstractString),fe.asn1.DERVisibleString=function(e){fe.asn1.DERIA5String.superclass.constructor.call(this,e),this.hT="1a"},We(fe.asn1.DERVisibleString,fe.asn1.DERAbstractString),fe.asn1.DERBMPString=function(e){fe.asn1.DERBMPString.superclass.constructor.call(this,e),this.hT="1e"},We(fe.asn1.DERBMPString,fe.asn1.DERAbstractString),fe.asn1.DERUTCTime=function(e){fe.asn1.DERUTCTime.superclass.constructor.call(this,e),this.hT="17",this.params=void 0,this.getFreshValueHex=function(){var e=this.params;if(null==this.params&&(e={date:new Date}),"string"==typeof e){if(!e.match(/^[0-9]{12}Z$/)&&!e.match(/^[0-9]{12}\.[0-9]+Z$/))throw new Error("malformed string for UTCTime: "+e);this.hV=ge(e)}else if(null!=e.str)this.hV=ge(e.str);else if(null==e.date&&1==e.millis){var t=new Date;this.hV=ge(this.formatDate(t,"utc",!0))}else if(null!=e.date&&e.date instanceof Date){var r=!0===e.millis;this.hV=ge(this.formatDate(e.date,"utc",r))}else e instanceof Date&&(this.hV=ge(this.formatDate(e,"utc")));if(null==this.hV)throw new Error("parameter not specified properly for UTCTime");return this.hV},null!=e&&this.setByParam(e)},We(fe.asn1.DERUTCTime,fe.asn1.DERAbstractTime),fe.asn1.DERGeneralizedTime=function(e){fe.asn1.DERGeneralizedTime.superclass.constructor.call(this,e),this.hT="18",this.params=e,this.getFreshValueHex=function(){var e=this.params;if(null==this.params&&(e={date:new Date}),"string"==typeof e){if(!e.match(/^[0-9]{14}Z$/)&&!e.match(/^[0-9]{14}\.[0-9]+Z$/))throw new Error("malformed string for GeneralizedTime: "+e);this.hV=ge(e)}else if(null!=e.str)this.hV=ge(e.str);else if(null==e.date&&1==e.millis){var t=new Date;this.hV=ge(this.formatDate(t,"gen",!0))}else if(null!=e.date&&e.date instanceof Date){var r=!0===e.millis;this.hV=ge(this.formatDate(e.date,"gen",r))}else e instanceof Date&&(this.hV=ge(this.formatDate(e,"gen")));if(null==this.hV)throw new Error("parameter not specified properly for GeneralizedTime");return this.hV},null!=e&&this.setByParam(e)},We(fe.asn1.DERGeneralizedTime,fe.asn1.DERAbstractTime),fe.asn1.DERSequence=function(e){fe.asn1.DERSequence.superclass.constructor.call(this,e),this.hT="30",this.getFreshValueHex=function(){for(var e="",t=0;t<this.asn1Array.length;t++)e+=this.asn1Array[t].tohex();return this.hV=e,this.hV}},We(fe.asn1.DERSequence,fe.asn1.DERAbstractStructured),fe.asn1.DERSet=function(e){fe.asn1.DERSet.superclass.constructor.call(this,e),this.hT="31",this.sortFlag=!0,this.getFreshValueHex=function(){for(var e=new Array,t=0;t<this.asn1Array.length;t++){var r=this.asn1Array[t];e.push(r.tohex())}return 1==this.sortFlag&&e.sort(),this.hV=e.join(""),this.hV},void 0!==e&&void 0!==e.sortflag&&0==e.sortflag&&(this.sortFlag=!1)},We(fe.asn1.DERSet,fe.asn1.DERAbstractStructured),fe.asn1.DERTaggedObject=function(e){fe.asn1.DERTaggedObject.superclass.constructor.call(this);var t=fe.asn1,r=de,n=r.getV,i=(r.isASN1HEX,t.ASN1Util.newObject);this.hT="a0",this.hV="",this.isExplicit=!0,this.asn1Object=null,this.params={tag:"a0",explicit:!0},this.setASN1Object=function(e,t,r){this.params={tag:t,explicit:e,obj:r}},this.getFreshValueHex=function(){var e=this.params;if(null==e.explicit&&(e.explicit=!0),null!=e.tage&&(e.tag=e.tage,e.explicit=!0),null!=e.tagi&&(e.tag=e.tagi,e.explicit=!1),null!=e.str)this.hV=we(e.str);else if(null!=e.hex)this.hV=e.hex;else{if(null==e.obj)throw new Error("str, hex nor obj not specified");var r;e.obj instanceof t.ASN1Object?r=e.obj.tohex():"object"==typeof e.obj&&(r=i(e.obj).tohex()),e.explicit?this.hV=r:this.hV=n(r,0)}return null==e.tag&&(e.tag="a0"),this.hT=e.tag,this.hTLV=null,this.isModified=!0,this.hV},this.setByParam=function(e){this.params=e},void 0!==e&&this.setByParam(e)},We(fe.asn1.DERTaggedObject,fe.asn1.ASN1Object);var fe,he,le,de=new function(){};function pe(e){for(var t="",r=0;r<e.length;r++){var n=e[r].toString(16);1==n.length&&(n="0"+n),t+=n}return t}function ge(e){return pe(function(e){for(var t=new Array,r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}(e))}function ye(e){return(e=(e=e.replace(/\=/g,"")).replace(/\+/g,"-")).replace(/\//g,"_")}function ve(e){return e.length%4==2?e+="==":e.length%4==3&&(e+="="),(e=e.replace(/-/g,"+")).replace(/_/g,"/")}function me(e){return e.length%2==1&&(e="0"+e),ye(S(e))}function be(e){return E(ve(e))}function we(e){return Ie(Le(e)).toLowerCase()}function Se(e){try{return decodeURIComponent(Fe(e))}catch(e){return null}}function Ee(e){return Se(function(e){for(var t=e.match(/.{1,2}/g),r=[],n=0;n<t.length;n++){var i=parseInt(t[n],16);161<=i&&i<=191?(r.push("c2"),r.push(t[n])):192<=i&&i<=255?(r.push("c3"),r.push((i-64).toString(16))):r.push(t[n])}return r.join("")}(e))}function Ce(e){for(var t="",r=0;r<e.length-1;r+=2)t+=String.fromCharCode(parseInt(e.substr(r,2),16));return t}function Ae(e){for(var t="",r=0;r<e.length;r++)t+=("0"+e.charCodeAt(r).toString(16)).slice(-2);return t}function Be(e,t){return"-----BEGIN "+t+"-----\r\n"+function(e,t){return(e=e.replace(new RegExp("(.{"+t+"})","g"),"$1\r\n")).replace(/\s+$/,"")}(function(e){return S(e)}(e),64)+"\r\n-----END "+t+"-----\r\n"}function xe(e,t){if(-1==e.indexOf("-----BEGIN "))throw new Error("can't find PEM header");return function(e){return E(e.replace(/[^0-9A-Za-z\/+=]*/g,""))}(e=void 0!==t?(e=e.replace(new RegExp("^[^]*-----BEGIN "+t+"-----"),"")).replace(new RegExp("-----END "+t+"-----[^]*$"),""):(e=e.replace(/^[^]*-----BEGIN [^-]+-----/,"")).replace(/-----END [^-]+-----[^]*$/,""))}function Te(e){return Math.round(function(e){var t,r,n,i,a,s,o,c,u,f;if(f=(e=function(e){return e.match(/^[0-9]{12}Z$/)||e.match(/^[0-9]{12}[.][0-9]*Z$/)?e.match(/^[0-4]/)?"20"+e:"19"+e:e}(e)).match(/^(\d{4})(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)(|\.\d+)Z$/))return t=parseInt(f[1]),r=parseInt(f[2])-1,n=parseInt(f[3]),i=parseInt(f[4]),a=parseInt(f[5]),s=parseInt(f[6]),o=0,""!==(c=f[7])&&(u=(c.substr(1)+"00").substr(0,3),o=parseInt(u)),Date.UTC(t,r,n,i,a,s,o);throw new Error("unsupported zulu format: "+e)}(e)/1e3)}function Ie(e){return e.replace(/%/g,"")}function Fe(e){return e.replace(/(..)/g,"%$1")}function ke(e){var t="malformed IPv6 address";if(!e.match(/^[0-9A-Fa-f:]+$/))throw t;var r=(e=e.toLowerCase()).split(":").length-1;if(r<2)throw t;var n=":".repeat(7-r+2),i=(e=e.replace("::",n)).split(":");if(8!=i.length)throw t;for(var a=0;a<8;a++)i[a]=("0000"+i[a]).slice(-4);return i.join("")}function Re(e){if(!e.match(/^[0-9A-Fa-f]{32}$/))throw new Error("malformed IPv6 address: "+e);var t=(e=e.toLowerCase()).match(/.{1,4}/g);t=t.map((function(e){return e.replace(/^0+/,"")})),t=t.map((function(e){return""==e?"0":e}));var r=(e=":"+t.join(":")+":").match(/:(0:){2,}/g);if(null==r)return e.slice(1,-1);var n=r.sort().slice(-1)[0];return"::"!=(e=e.replace(n.substr(0,n.length-1),":")).substr(0,2)&&(e=e.substr(1)),"::"!=e.substr(-2,2)&&(e=e.substr(0,e.length-1)),e}function De(e){var t=new Error("malformed hex value");if(!e.match(/^([0-9A-Fa-f][0-9A-Fa-f]){1,}$/))throw t;if(8==e.length)try{return parseInt(e.substr(0,2),16)+"."+parseInt(e.substr(2,2),16)+"."+parseInt(e.substr(4,2),16)+"."+parseInt(e.substr(6,2),16)}catch(e){throw t}else{if(16!=e.length){if(32==e.length)return Re(e);if(64==e.length){try{return Re(e.substr(0,32))+"/"+_e(e.substr(32))}catch(e){throw t}return}return e}try{return De(e.substr(0,8))+"/"+_e(e.substr(8))}catch(e){throw t}}}function _e(e){var t,r=new Error("malformed mask");try{t=new C(e,16).toString(2)}catch(e){throw r}if(!t.match(/^1*0*$/))throw r;return t.replace(/0+$/,"").length}function Pe(e){var t=new Error("malformed IP address");if(!(e=e.toLowerCase(e)).match(/^[0-9a-f.:/]+$/))throw t;if(!e.match(/^[0-9.]+$/)){var r;if(e.match(/^[0-9.]+\/[0-9]+$/))return Pe((r=e.split("/"))[0])+Ne(parseInt(r[1]),32);if(e.match(/^[0-9a-f:]+$/)&&-1!==e.indexOf(":"))return ke(e);if(e.match(/^[0-9a-f:]+\/[0-9]+$/)&&-1!==e.indexOf(":"))return ke((r=e.split("/"))[0])+Ne(parseInt(r[1]),128);throw t}var n=e.split(".");if(4!==n.length)throw t;var i="";try{for(var a=0;a<4;a++)i+=("0"+parseInt(n[a]).toString(16)).slice(-2);return i}catch(e){throw t}}function Ne(e,t){return 32==t&&0==e?"00000000":128==t&&0==e?"00000000000000000000000000000000":new C(Array(e+1).join("1")+Array(t-e+1).join("0"),2).toString(16)}function Oe(e){var t=e.match(/.{4}/g).map((function(e){var t=parseInt(e.substr(0,2),16),r=parseInt(e.substr(2),16);if(0==t&r<128)return String.fromCharCode(r);if(t<8){var n=128|63&r;return Se((192|(7&t)<<3|(192&r)>>6).toString(16)+n.toString(16))}n=128|(15&t)<<2|(192&r)>>6;var i=128|63&r;return Se((224|(240&t)>>4).toString(16)+n.toString(16)+i.toString(16))}));return t.join("")}function Le(e){for(var t=encodeURIComponent(e),r="",n=0;n<t.length;n++)"%"==t[n]?(r+=t.substr(n,3),n+=2):r=r+"%"+ge(t[n]);return r}function Ue(e){return!(e.length%2!=0||!e.match(/^[0-9a-f]+$/)&&!e.match(/^[0-9A-F]+$/))}function Ke(e){return!!e.match(/^[0-9A-Za-z-_.]+$/)}function Me(e){return e.length%2==1?"0"+e:e.substr(0,1)>"7"?"00"+e:e}function He(e){if(!Ue(e))return null;try{var t=[],r=e.substr(0,2),n=parseInt(r,16);t[0]=new String(Math.floor(n/40)),t[1]=new String(n%40);for(var i=e.substr(2),a=[],s=0;s<i.length/2;s++)a.push(parseInt(i.substr(2*s,2),16));var o=[],c="";for(s=0;s<a.length;s++)128&a[s]?c+=Ge((127&a[s]).toString(2),7):(c+=Ge((127&a[s]).toString(2),7),o.push(new String(parseInt(c,2))),c="");var u=t.join(".");return o.length>0&&(u=u+"."+o.join(".")),u}catch(e){return null}}function je(e){return Ve(new C(String(e),10))}function Ve(e){var t=e.toString(16);if("-"!=t.substr(0,1))return t.length%2==1?t="0"+t:t.match(/^[0-7]/)||(t="00"+t),t;var r=t.substr(1).length;r%2==1?r+=1:t.match(/^[0-7]/)||(r+=2);for(var n="",i=0;i<r;i++)n+="f";return new C(n,16).xor(e).add(C.ONE).toString(16).replace(/^-/,"")}de.getLblen=function(e,t){if("8"!=e.substr(t+2,1))return 1;var r=parseInt(e.substr(t+3,1));return 0==r?-1:0<r&&r<10?r+1:-2},de.getL=function(e,t){var r=de.getLblen(e,t);return r<1?"":e.substr(t+2,2*r)},de.getVblen=function(e,t){var r;return""==(r=de.getL(e,t))?-1:("8"===r.substr(0,1)?new C(r.substr(2),16):new C(r,16)).intValue()},de.getVidx=function(e,t){var r=de.getLblen(e,t);return r<0?r:t+2*(r+1)},de.getV=function(e,t){var r=de.getVidx(e,t),n=de.getVblen(e,t);return e.substr(r,2*n)},de.getTLV=function(e,t){return e.substr(t,2)+de.getL(e,t)+de.getV(e,t)},de.getTLVblen=function(e,t){return 2+2*de.getLblen(e,t)+2*de.getVblen(e,t)},de.getNextSiblingIdx=function(e,t){return de.getVidx(e,t)+2*de.getVblen(e,t)},de.getChildIdx=function(e,t){var r,n,i,a=de,s=[];r=a.getVidx(e,t),n=2*a.getVblen(e,t),"03"==e.substr(t,2)&&(r+=2,n-=2),i=0;for(var o=r;i<=n;){var c=a.getTLVblen(e,o);if((i+=c)<=n&&s.push(o),o+=c,i>=n)break}return s},de.getNthChildIdx=function(e,t,r){return de.getChildIdx(e,t)[r]},de.getIdxbyList=function(e,t,r,n){var i,a,s=de;return 0==r.length?void 0!==n&&e.substr(t,2)!==n?-1:t:(i=r.shift())>=(a=s.getChildIdx(e,t)).length?-1:s.getIdxbyList(e,a[i],r,n)},de.getIdxbyListEx=function(e,t,r,n){var i,a,s=de;if(0==r.length)return void 0!==n&&e.substr(t,2)!==n?-1:t;i=r.shift(),a=s.getChildIdx(e,t);for(var o=0,c=0;c<a.length;c++){var u=e.substr(a[c],2);if("number"==typeof i&&!s.isContextTag(u)&&o==i||"string"==typeof i&&s.isContextTag(u,i))return s.getIdxbyListEx(e,a[c],r,n);s.isContextTag(u)||o++}return-1},de.getTLVbyList=function(e,t,r,n){var i=de,a=i.getIdxbyList(e,t,r,n);return-1==a||a>=e.length?null:i.getTLV(e,a)},de.getTLVbyListEx=function(e,t,r,n){var i=de,a=i.getIdxbyListEx(e,t,r,n);return-1==a?null:i.getTLV(e,a)},de.getVbyList=function(e,t,r,n,i){var a,s,o=de;return-1==(a=o.getIdxbyList(e,t,r,n))||a>=e.length?null:(s=o.getV(e,a),!0===i&&(s=s.substr(2)),s)},de.getVbyListEx=function(e,t,r,n,i){var a,s,o=de;return-1==(a=o.getIdxbyListEx(e,t,r,n))?null:(s=o.getV(e,a),"03"==e.substr(a,2)&&!1!==i&&(s=s.substr(2)),s)},de.getInt=function(e,t,r){null==r&&(r=-1);try{var n=e.substr(t,2);if("02"!=n&&"03"!=n)return r;var i=de.getV(e,t);return"02"==n?parseInt(i,16):function(e){if(e.length%2!=0)return-1;if(null==(e=e.toLowerCase()).match(/^[0-9a-f]+$/))return-1;try{var t=e.substr(0,2);if("00"==t)return parseInt(e.substr(2),16);var r=parseInt(t,16);if(r>7)return-1;var n=e.substr(2),i=parseInt(n,16).toString(2);"0"==i&&(i="00000000"),i=i.slice(0,0-r);var a=parseInt(i,2);return NaN==a?-1:a}catch(e){return-1}}(i)}catch(e){return r}},de.getOID=function(e,t,r){null==r&&(r=null);try{return"06"!=e.substr(t,2)?r:He(de.getV(e,t))}catch(e){return r}},de.getOIDName=function(e,t,r){null==r&&(r=null);try{var n=de.getOID(e,t,r);if(n==r)return r;var i=fe.asn1.x509.OID.oid2name(n);return""==i?n:i}catch(e){return r}},de.getString=function(e,t,r){null==r&&(r=null);try{return Ce(de.getV(e,t))}catch(e){return r}},de.hextooidstr=function(e){var t=function(e,t){return e.length>=t?e:new Array(t-e.length+1).join("0")+e},r=[],n=e.substr(0,2),i=parseInt(n,16);r[0]=new String(Math.floor(i/40)),r[1]=new String(i%40);for(var a=e.substr(2),s=[],o=0;o<a.length/2;o++)s.push(parseInt(a.substr(2*o,2),16));var c=[],u="";for(o=0;o<s.length;o++)128&s[o]?u+=t((127&s[o]).toString(2),7):(u+=t((127&s[o]).toString(2),7),c.push(new String(parseInt(u,2))),u="");var f=r.join(".");return c.length>0&&(f=f+"."+c.join(".")),f},de.dump=function(e,t,r,n){var i=de,a=i.getV,s=i.dump,o=i.getChildIdx,c=e;e instanceof fe.asn1.ASN1Object&&(c=e.tohex());var u=function(e,t){return e.length<=2*t?e:e.substr(0,t)+"..(total "+e.length/2+"bytes).."+e.substr(e.length-t,t)};void 0===t&&(t={ommit_long_octet:32}),void 0===r&&(r=0),void 0===n&&(n="");var f,h=t.ommit_long_octet;if("01"==(f=c.substr(r,2)))return"00"==(l=a(c,r))?n+"BOOLEAN FALSE\n":n+"BOOLEAN TRUE\n";if("02"==f)return n+"INTEGER "+u(l=a(c,r),h)+"\n";if("03"==f){var l=a(c,r);return i.isASN1HEX(l.substr(2))?(S=n+"BITSTRING, encapsulates\n")+s(l.substr(2),t,0,n+" "):n+"BITSTRING "+u(l,h)+"\n"}if("04"==f)return l=a(c,r),i.isASN1HEX(l)?(S=n+"OCTETSTRING, encapsulates\n")+s(l,t,0,n+" "):n+"OCTETSTRING "+u(l,h)+"\n";if("05"==f)return n+"NULL\n";if("06"==f){var d=a(c,r),p=fe.asn1.ASN1Util.oidHexToInt(d),g=fe.asn1.x509.OID.oid2name(p),y=p.replace(/\./g," ");return""!=g?n+"ObjectIdentifier "+g+" ("+y+")\n":n+"ObjectIdentifier ("+y+")\n"}if("0a"==f)return n+"ENUMERATED "+parseInt(a(c,r))+"\n";if("0c"==f)return n+"UTF8String '"+Se(a(c,r))+"'\n";if("13"==f)return n+"PrintableString '"+Se(a(c,r))+"'\n";if("14"==f)return n+"TeletexString '"+Se(a(c,r))+"'\n";if("16"==f)return n+"IA5String '"+Se(a(c,r))+"'\n";if("17"==f)return n+"UTCTime "+Se(a(c,r))+"\n";if("18"==f)return n+"GeneralizedTime "+Se(a(c,r))+"\n";if("1a"==f)return n+"VisualString '"+Se(a(c,r))+"'\n";if("1e"==f)return n+"BMPString '"+Oe(a(c,r))+"'\n";if("30"==f){if("3000"==c.substr(r,4))return n+"SEQUENCE {}\n";S=n+"SEQUENCE\n";var v=t;if((2==(w=o(c,r)).length||3==w.length)&&"06"==c.substr(w[0],2)&&"04"==c.substr(w[w.length-1],2)){g=i.oidname(a(c,w[0]));var m=JSON.parse(JSON.stringify(t));m.x509ExtName=g,v=m}for(var b=0;b<w.length;b++)S+=s(c,v,w[b],n+" ");return S}if("31"==f){S=n+"SET\n";var w=o(c,r);for(b=0;b<w.length;b++)S+=s(c,t,w[b],n+" ");return S}if(128&(f=parseInt(f,16))){var S,E=31&f;if(32&f){for(S=n+"["+E+"]\n",w=o(c,r),b=0;b<w.length;b++)S+=s(c,t,w[b],n+" ");return S}return l=a(c,r),de.isASN1HEX(l)?(S=n+"["+E+"]\n")+s(l,t,0,n+" "):(("68747470"==l.substr(0,8)||"subjectAltName"===t.x509ExtName&&2==E)&&(l=Se(l)),n+"["+E+"] "+l+"\n")}return n+"UNKNOWN("+f+") "+a(c,r)+"\n"},de.parse=function(e){var t=de,r=t.parse,n=t.isASN1HEX,i=t.getV,a=t.getTLV,s=t.getChildIdx,o=fe.asn1,c=o.ASN1Util.oidHexToInt,u=o.x509.OID.oid2name,f=Se,h=Oe,l=Ee,d={"0c":"utf8str",12:"numstr",13:"prnstr",14:"telstr",16:"ia5str",17:"utctime",18:"gentime","1a":"visstr","1e":"bmpstr",30:"seq",31:"set"},p=e.substr(0,2),g={},y=i(e,0);if("01"==p)return"0101ff"==e?{bool:!0}:{bool:!1};if("02"==p)return{int:{hex:y}};if("03"==p)try{if("00"!=y.substr(0,2))throw"not encap";var v=y.substr(2);if(!n(v))throw"not encap";return{bitstr:{obj:r(v)}}}catch(e){var m=null;return y.length<=10&&(m=function(e){if("string"!=typeof e)return null;if(e.length%2!=0)return null;if(!e.match(/^[0-9a-f]+$/))return null;try{var t=parseInt(e.substr(0,2),16);if(t<0||7<t)return null;for(var r=e.substr(2),n="",i=0;i<r.length;i+=2){var a=r.substr(i,2),s=parseInt(a,16).toString(2);n+=s=("0000000"+s).slice(-8)}return n.substr(0,n.length-t)}catch(e){return null}}(y)),null==m?{bitstr:{hex:y}}:{bitstr:{bin:m}}}else if("04"==p)try{if(!n(y))throw"not encap";return{octstr:{obj:r(y)}}}catch(e){return{octstr:{hex:y}}}else{if("05"==p)return{null:""};if("06"==p){var b=c(y),w=u(b);return""==w?{oid:b}:{oid:w}}if("0a"==p)return y.length>4?{enum:{hex:y}}:{enum:parseInt(y,16)};if("30"==p||"31"==p)return g[d[p]]=function(e){for(var t=[],n=s(e,0),i=0;i<n.length;i++){var o=n[i],c=a(e,o),u=r(c);t.push(u)}return t}(e),g;if("14"==p){var S=l(y);return g[d[p]]={str:S},g}if("1e"==p)return S=h(y),g[d[p]]={str:S},g;if(-1!=":0c:12:13:16:17:18:1a:".indexOf(p))return S=f(y),g[d[p]]={str:S},g;if(p.match(/^8[0-9]$/))return null==(S=f(y))|""==S||null!=S.match(/[\x00-\x1F\x7F-\x9F]/)||null!=S.match(/[\u0000-\u001F\u0080–\u009F]/)?{tag:{tag:p,explicit:!1,hex:y}}:{tag:{tag:p,explicit:!1,str:S}};if(!p.match(/^a[0-9]$/)){var E=new fe.asn1.ASN1Object;return E.hV=y,{asn1:{tlv:p+E.getLengthHexFromValue()+y}}}try{if(!n(y))throw new Error("not encap");return{tag:{tag:p,explicit:!0,obj:r(y)}}}catch(e){return{tag:{tag:p,explicit:!0,hex:y}}}}},de.isContextTag=function(e,t){var r,n;e=e.toLowerCase();try{r=parseInt(e,16)}catch(e){return-1}if(void 0===t)return 128==(192&r);try{return null!=t.match(/^\[[0-9]+\]$/)&&!((n=parseInt(t.substr(1,t.length-1),10))>31)&&128==(192&r)&&(31&r)==n}catch(e){return!1}},de.isASN1HEX=function(e){var t=de;if(e.length%2==1)return!1;var r=t.getVblen(e,0),n=e.substr(0,2),i=t.getL(e,0);return e.length-n.length-i.length==2*r},de.checkStrictDER=function(e,t,r,n,i){var a=de;if(void 0===r){if("string"!=typeof e)throw new Error("not hex string");if(e=e.toLowerCase(),!fe.lang.String.isHex(e))throw new Error("not hex string");r=e.length,i=(n=e.length/2)<128?1:Math.ceil(n.toString(16))+1}if(a.getL(e,t).length>2*i)throw new Error("L of TLV too long: idx="+t);var s=a.getVblen(e,t);if(s>n)throw new Error("value of L too long than hex: idx="+t);var o=a.getTLV(e,t),c=o.length-2-a.getL(e,t).length;if(c!==2*s)throw new Error("V string length and L's value not the same:"+c+"/"+2*s);if(0===t&&e.length!=o.length)throw new Error("total length and TLV length unmatch:"+e.length+"!="+o.length);var u=e.substr(t,2);if("02"===u){var f=a.getVidx(e,t);if("00"==e.substr(f,2)&&e.charCodeAt(f+2)<56)throw new Error("not least zeros for DER INTEGER")}if(32&parseInt(u,16)){for(var h=a.getVblen(e,t),l=0,d=a.getChildIdx(e,t),p=0;p<d.length;p++)l+=a.getTLV(e,d[p]).length,a.checkStrictDER(e,d[p],r,n,i);if(2*h!=l)throw new Error("sum of children's TLV length and L unmatch: "+2*h+"!="+l)}},de.oidname=function(e){var t=fe.asn1;fe.lang.String.isHex(e)&&(e=t.ASN1Util.oidHexToInt(e));var r=t.x509.OID.oid2name(e);return""===r&&(r=e),r},void 0!==fe&&fe||(fe={}),void 0!==fe.asn1&&fe.asn1||(fe.asn1={}),void 0!==fe.asn1.x509&&fe.asn1.x509||(fe.asn1.x509={}),fe.asn1.x509.Certificate=function(e){fe.asn1.x509.Certificate.superclass.constructor.call(this);var t=fe.asn1,r=t.DERBitString,n=t.DERSequence,i=t.x509,a=i.TBSCertificate,s=i.AlgorithmIdentifier;this.params=void 0,this.setByParam=function(e){this.params=e},this.sign=function(){var e=this.params,t=e.sigalg;null!=e.sigalg.name&&(t=e.sigalg.name);var r=e.tbsobj.tohex(),n=new fe.crypto.Signature({alg:t});n.init(e.cakey),n.updateHex(r),e.sighex=n.sign()},this.getPEM=function(){return Be(this.tohex(),"CERTIFICATE")},this.tohex=function(){var e=this.params;if(null!=e.tbsobj&&null!=e.tbsobj||(e.tbsobj=new a(e)),null==e.sighex&&null!=e.cakey&&this.sign(),null==e.sighex)throw new Error("sighex or cakey parameter not defined");var t=[];return t.push(e.tbsobj),t.push(new s({name:e.sigalg})),t.push(new r({hex:"00"+e.sighex})),new n({array:t}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=e&&(this.params=e)},We(fe.asn1.x509.Certificate,fe.asn1.ASN1Object),fe.asn1.x509.TBSCertificate=function(e){fe.asn1.x509.TBSCertificate.superclass.constructor.call(this);var t=fe.asn1,r=t.x509,n=t.DERTaggedObject,i=t.DERInteger,a=t.DERSequence,s=r.AlgorithmIdentifier,o=r.Time,c=r.X500Name,u=r.Extensions,f=r.SubjectPublicKeyInfo;this.params=null,this.setByParam=function(e){this.params=e},this.tohex=function(){var e=[],t=this.params;if(null!=t.version||1!=t.version){var r=2;null!=t.version&&(r=t.version-1);var h=new n({obj:new i({int:r})});e.push(h)}return e.push(new i(t.serial)),e.push(new s({name:t.sigalg})),e.push(new c(t.issuer)),e.push(new a({array:[new o(t.notbefore),new o(t.notafter)]})),e.push(new c(t.subject)),e.push(new f(Xe.getKey(t.sbjpubkey))),void 0!==t.ext&&t.ext.length>0&&e.push(new n({tag:"a3",obj:new u(t.ext)})),new fe.asn1.DERSequence({array:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==e&&this.setByParam(e)},We(fe.asn1.x509.TBSCertificate,fe.asn1.ASN1Object),fe.asn1.x509.Extensions=function(e){fe.asn1.x509.Extensions.superclass.constructor.call(this);var t=fe.asn1,r=t.DERSequence,n=t.x509;this.aParam=[],this.setByParam=function(e){this.aParam=e},this.tohex=function(){for(var e=[],t=0;t<this.aParam.length;t++){var i=this.aParam[t],a=i.extname,s=null;if(null!=i.extn)s=new n.PrivateExtension(i);else if("subjectKeyIdentifier"==a)s=new n.SubjectKeyIdentifier(i);else if("keyUsage"==a)s=new n.KeyUsage(i);else if("subjectAltName"==a)s=new n.SubjectAltName(i);else if("issuerAltName"==a)s=new n.IssuerAltName(i);else if("basicConstraints"==a)s=new n.BasicConstraints(i);else if("nameConstraints"==a)s=new n.NameConstraints(i);else if("cRLDistributionPoints"==a)s=new n.CRLDistributionPoints(i);else if("certificatePolicies"==a)s=new n.CertificatePolicies(i);else if("policyMappings"==a)s=new n.PolicyMappings(i);else if("policyConstraints"==a)s=new n.PolicyConstraints(i);else if("inhibitAnyPolicy"==a)s=new n.InhibitAnyPolicy(i);else if("authorityKeyIdentifier"==a)s=new n.AuthorityKeyIdentifier(i);else if("extKeyUsage"==a)s=new n.ExtKeyUsage(i);else if("authorityInfoAccess"==a)s=new n.AuthorityInfoAccess(i);else if("cRLNumber"==a)s=new n.CRLNumber(i);else if("cRLReason"==a)s=new n.CRLReason(i);else if("ocspNonce"==a)s=new n.OCSPNonce(i);else if("ocspNoCheck"==a)s=new n.OCSPNoCheck(i);else if("adobeTimeStamp"==a)s=new n.AdobeTimeStamp(i);else{if("subjectDirectoryAttributes"!=a)throw new Error("extension not supported:"+JSON.stringify(i));s=new n.SubjectDirectoryAttributes(i)}null!=s&&e.push(s)}return new r({array:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=e&&this.setByParam(e)},We(fe.asn1.x509.Extensions,fe.asn1.ASN1Object),fe.asn1.x509.Extension=function(e){fe.asn1.x509.Extension.superclass.constructor.call(this);var t=fe.asn1,r=t.DERObjectIdentifier,n=t.DEROctetString,i=(t.DERBitString,t.DERBoolean),a=t.DERSequence;this.tohex=function(){var e=new r({oid:this.oid}),t=new n({hex:this.getExtnValueHex()}),s=new Array;return s.push(e),this.critical&&s.push(new i),s.push(t),new a({array:s}).tohex()},this.getEncodedHex=function(){return this.tohex()},this.critical=!1,void 0!==e&&void 0!==e.critical&&(this.critical=e.critical)},We(fe.asn1.x509.Extension,fe.asn1.ASN1Object),fe.asn1.x509.KeyUsage=function(e){fe.asn1.x509.KeyUsage.superclass.constructor.call(this,e);var t=Error,r={digitalSignature:0,nonRepudiation:1,keyEncipherment:2,dataEncipherment:3,keyAgreement:4,keyCertSign:5,cRLSign:6,encipherOnly:7,decipherOnly:8};this.getExtnValueHex=function(){var e=this.getBinValue();return this.asn1ExtnValue=new fe.asn1.DERBitString({bin:e}),this.asn1ExtnValue.tohex()},this.getBinValue=function(){var e=this.params;if("object"!=typeof e||"object"!=typeof e.names&&"string"!=typeof e.bin)throw new t("parameter not yet set");if(null!=e.names)return qe(e.names,r);if(null!=e.bin)return e.bin;throw new t("parameter not set properly")},this.oid="2.5.29.15",void 0!==e&&(this.params=e)},We(fe.asn1.x509.KeyUsage,fe.asn1.x509.Extension),fe.asn1.x509.BasicConstraints=function(e){fe.asn1.x509.BasicConstraints.superclass.constructor.call(this,e);var t=fe.asn1,r=t.DERBoolean,n=t.DERInteger,i=t.DERSequence;this.getExtnValueHex=function(){var e=new Array;this.cA&&e.push(new r),this.pathLen>-1&&e.push(new n({int:this.pathLen}));var t=new i({array:e});return this.asn1ExtnValue=t,this.asn1ExtnValue.tohex()},this.oid="2.5.29.19",this.cA=!1,this.pathLen=-1,void 0!==e&&(void 0!==e.cA&&(this.cA=e.cA),void 0!==e.pathLen&&(this.pathLen=e.pathLen))},We(fe.asn1.x509.BasicConstraints,fe.asn1.x509.Extension),fe.asn1.x509.CRLDistributionPoints=function(e){fe.asn1.x509.CRLDistributionPoints.superclass.constructor.call(this,e);var t=fe.asn1,r=t.x509;this.getExtnValueHex=function(){return this.asn1ExtnValue.tohex()},this.setByDPArray=function(e){for(var n=[],i=0;i<e.length;i++)if(e[i]instanceof fe.asn1.ASN1Object)n.push(e[i]);else{var a=new r.DistributionPoint(e[i]);n.push(a)}this.asn1ExtnValue=new t.DERSequence({array:n})},this.setByOneURI=function(e){var t=new r.DistributionPoint({fulluri:e});this.setByDPArray([t])},this.oid="2.5.29.31",void 0!==e&&(void 0!==e.array?this.setByDPArray(e.array):void 0!==e.uri&&this.setByOneURI(e.uri))},We(fe.asn1.x509.CRLDistributionPoints,fe.asn1.x509.Extension),fe.asn1.x509.DistributionPoint=function(e){fe.asn1.x509.DistributionPoint.superclass.constructor.call(this);var t=fe.asn1,r=t.x509.DistributionPointName;this.tohex=function(){var e=new t.DERSequence;if(null!=this.asn1DP){var r=new t.DERTaggedObject({explicit:!0,tag:"a0",obj:this.asn1DP});e.appendASN1Object(r)}return this.hTLV=e.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},void 0!==e&&(void 0!==e.dpobj?this.asn1DP=e.dpobj:void 0!==e.dpname?this.asn1DP=new r(e.dpname):void 0!==e.fulluri&&(this.asn1DP=new r({full:[{uri:e.fulluri}]})))},We(fe.asn1.x509.DistributionPoint,fe.asn1.ASN1Object),fe.asn1.x509.DistributionPointName=function(e){fe.asn1.x509.DistributionPointName.superclass.constructor.call(this);var t=fe.asn1,r=t.DERTaggedObject;if(this.tohex=function(){if("full"!=this.type)throw new Error("currently type shall be 'full': "+this.type);return this.asn1Obj=new r({explicit:!1,tag:this.tag,obj:this.asn1V}),this.hTLV=this.asn1Obj.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},void 0!==e)if(t.x509.GeneralNames.prototype.isPrototypeOf(e))this.type="full",this.tag="a0",this.asn1V=e;else{if(void 0===e.full)throw new Error("This class supports GeneralNames only as argument");this.type="full",this.tag="a0",this.asn1V=new t.x509.GeneralNames(e.full)}},We(fe.asn1.x509.DistributionPointName,fe.asn1.ASN1Object),fe.asn1.x509.CertificatePolicies=function(e){fe.asn1.x509.CertificatePolicies.superclass.constructor.call(this,e);var t=fe.asn1,r=t.x509,n=t.DERSequence,i=r.PolicyInformation;this.params=null,this.getExtnValueHex=function(){for(var e=[],t=0;t<this.params.array.length;t++)e.push(new i(this.params.array[t]));var r=new n({array:e});return this.asn1ExtnValue=r,this.asn1ExtnValue.tohex()},this.oid="2.5.29.32",void 0!==e&&(this.params=e)},We(fe.asn1.x509.CertificatePolicies,fe.asn1.x509.Extension),fe.asn1.x509.PolicyInformation=function(e){fe.asn1.x509.PolicyInformation.superclass.constructor.call(this,e);var t=fe.asn1,r=t.DERSequence,n=t.DERObjectIdentifier,i=t.x509.PolicyQualifierInfo;this.params=null,this.tohex=function(){if(void 0===this.params.policyoid&&void 0===this.params.array)throw new Error("parameter oid and array missing");var e=[new n(this.params.policyoid)];if(void 0!==this.params.array){for(var t=[],a=0;a<this.params.array.length;a++)t.push(new i(this.params.array[a]));t.length>0&&e.push(new r({array:t}))}return new r({array:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==e&&(this.params=e)},We(fe.asn1.x509.PolicyInformation,fe.asn1.ASN1Object),fe.asn1.x509.PolicyQualifierInfo=function(e){fe.asn1.x509.PolicyQualifierInfo.superclass.constructor.call(this,e);var t=fe.asn1,r=t.DERSequence,n=t.DERIA5String,i=t.DERObjectIdentifier,a=t.x509.UserNotice;this.params=null,this.tohex=function(){return void 0!==this.params.cps?new r({array:[new i({oid:"1.3.6.1.5.5.7.2.1"}),new n({str:this.params.cps})]}).tohex():null!=this.params.unotice?new r({array:[new i({oid:"1.3.6.1.5.5.7.2.2"}),new a(this.params.unotice)]}).tohex():void 0},this.getEncodedHex=function(){return this.tohex()},void 0!==e&&(this.params=e)},We(fe.asn1.x509.PolicyQualifierInfo,fe.asn1.ASN1Object),fe.asn1.x509.UserNotice=function(e){fe.asn1.x509.UserNotice.superclass.constructor.call(this,e);var t=fe.asn1.DERSequence,r=(fe.asn1.DERInteger,fe.asn1.x509.DisplayText),n=fe.asn1.x509.NoticeReference;this.params=null,this.tohex=function(){var e=[];return void 0!==this.params.noticeref&&e.push(new n(this.params.noticeref)),void 0!==this.params.exptext&&e.push(new r(this.params.exptext)),new t({array:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==e&&(this.params=e)},We(fe.asn1.x509.UserNotice,fe.asn1.ASN1Object),fe.asn1.x509.NoticeReference=function(e){fe.asn1.x509.NoticeReference.superclass.constructor.call(this,e);var t=fe.asn1.DERSequence,r=fe.asn1.DERInteger,n=fe.asn1.x509.DisplayText;this.params=null,this.tohex=function(){var e=[];if(void 0!==this.params.org&&e.push(new n(this.params.org)),void 0!==this.params.noticenum){for(var i=[],a=this.params.noticenum,s=0;s<a.length;s++)i.push(new r(a[s]));e.push(new t({array:i}))}if(0==e.length)throw new Error("parameter is empty");return new t({array:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==e&&(this.params=e)},We(fe.asn1.x509.NoticeReference,fe.asn1.ASN1Object),fe.asn1.x509.DisplayText=function(e){fe.asn1.x509.DisplayText.superclass.constructor.call(this,e),this.hT="0c",void 0!==e&&("ia5"===e.type?this.hT="16":"vis"===e.type?this.hT="1a":"bmp"===e.type&&(this.hT="1e"))},We(fe.asn1.x509.DisplayText,fe.asn1.DERAbstractString),fe.asn1.x509.PolicyMappings=function(e){fe.asn1.x509.PolicyMappings.superclass.constructor.call(this,e);var t=fe.asn1,r=(t.x509,t.ASN1Util.newObject);this.params=null,this.getExtnValueHex=function(){for(var e=this.params,t=[],n=0;n<e.array.length;n++){var i=e.array[n];t.push({seq:[{oid:i[0]},{oid:i[1]}]})}return this.asn1ExtnValue=r({seq:t}),this.asn1ExtnValue.tohex()},this.oid="2.5.29.33",void 0!==e&&(this.params=e)},We(fe.asn1.x509.PolicyMappings,fe.asn1.x509.Extension),fe.asn1.x509.PolicyConstraints=function(e){fe.asn1.x509.PolicyConstraints.superclass.constructor.call(this,e);var t=fe.asn1,r=(t.x509,t.ASN1Util.newObject);this.params=null,this.getExtnValueHex=function(){var e=this.params,t=[];return null!=e.reqexp&&t.push({tag:{tagi:"80",obj:{int:e.reqexp}}}),null!=e.inhibit&&t.push({tag:{tagi:"81",obj:{int:e.inhibit}}}),this.asn1ExtnValue=r({seq:t}),this.asn1ExtnValue.tohex()},this.oid="2.5.29.36",void 0!==e&&(this.params=e)},We(fe.asn1.x509.PolicyConstraints,fe.asn1.x509.Extension),fe.asn1.x509.InhibitAnyPolicy=function(e){fe.asn1.x509.InhibitAnyPolicy.superclass.constructor.call(this,e);var t=fe.asn1,r=(t.x509,t.ASN1Util.newObject);this.params=null,this.getExtnValueHex=function(){return this.asn1ExtnValue=r({int:this.params.skip}),this.asn1ExtnValue.tohex()},this.oid="2.5.29.54",void 0!==e&&(this.params=e)},We(fe.asn1.x509.InhibitAnyPolicy,fe.asn1.x509.Extension),fe.asn1.x509.NameConstraints=function(e){fe.asn1.x509.NameConstraints.superclass.constructor.call(this,e);var t=fe.asn1,r=t.x509,n=t.ASN1Util.newObject,i=r.GeneralSubtree;this.params=null,this.getExtnValueHex=function(){var e=this.params,t=[];if(null!=e.permit&&null!=e.permit.length){for(var r=[],a=0;a<e.permit.length;a++)r.push(new i(e.permit[a]));t.push({tag:{tagi:"a0",obj:{seq:r}}})}if(null!=e.exclude&&null!=e.exclude.length){var s=[];for(a=0;a<e.exclude.length;a++)s.push(new i(e.exclude[a]));t.push({tag:{tagi:"a1",obj:{seq:s}}})}return this.asn1ExtnValue=n({seq:t}),this.asn1ExtnValue.tohex()},this.oid="2.5.29.30",void 0!==e&&(this.params=e)},We(fe.asn1.x509.NameConstraints,fe.asn1.x509.Extension),fe.asn1.x509.GeneralSubtree=function(e){fe.asn1.x509.GeneralSubtree.superclass.constructor.call(this);var t=fe.asn1,r=t.x509.GeneralName,n=t.ASN1Util.newObject;this.params=null,this.setByParam=function(e){this.params=e},this.tohex=function(){var e=this.params,t=[new r(e)];return null!=e.min&&t.push({tag:{tagi:"80",obj:{int:e.min}}}),null!=e.max&&t.push({tag:{tagi:"81",obj:{int:e.max}}}),n({seq:t}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==e&&this.setByParam(e)},We(fe.asn1.x509.GeneralSubtree,fe.asn1.ASN1Object),fe.asn1.x509.ExtKeyUsage=function(e){fe.asn1.x509.ExtKeyUsage.superclass.constructor.call(this,e);var t=fe.asn1;this.setPurposeArray=function(e){this.asn1ExtnValue=new t.DERSequence;for(var r=0;r<e.length;r++){var n=new t.DERObjectIdentifier(e[r]);this.asn1ExtnValue.appendASN1Object(n)}},this.getExtnValueHex=function(){return this.asn1ExtnValue.tohex()},this.oid="2.5.29.37",void 0!==e&&void 0!==e.array&&this.setPurposeArray(e.array)},We(fe.asn1.x509.ExtKeyUsage,fe.asn1.x509.Extension),fe.asn1.x509.AuthorityKeyIdentifier=function(e){fe.asn1.x509.AuthorityKeyIdentifier.superclass.constructor.call(this,e);var t=fe,r=t.asn1,n=r.DERTaggedObject,i=r.x509.GeneralNames;t.crypto.Util.isKey,this.asn1KID=null,this.asn1CertIssuer=null,this.asn1CertSN=null,this.getExtnValueHex=function(){var e=new Array;this.asn1KID&&e.push(new n({explicit:!1,tag:"80",obj:this.asn1KID})),this.asn1CertIssuer&&e.push(new n({explicit:!1,tag:"a1",obj:new i([{dn:this.asn1CertIssuer}])})),this.asn1CertSN&&e.push(new n({explicit:!1,tag:"82",obj:this.asn1CertSN}));var t=new r.DERSequence({array:e});return this.asn1ExtnValue=t,this.asn1ExtnValue.tohex()},this.setKIDByParam=function(e){if(void 0!==e.str||void 0!==e.hex)this.asn1KID=new fe.asn1.DEROctetString(e);else if("object"==typeof e&&fe.crypto.Util.isKey(e)||"string"==typeof e&&-1!=e.indexOf("BEGIN ")){var t=e;"string"==typeof e&&(t=Xe.getKey(e));var r=Xe.getKeyID(t);this.asn1KID=new fe.asn1.DEROctetString({hex:r})}},this.setCertIssuerByParam=function(e){void 0!==e.str||void 0!==e.ldapstr||void 0!==e.hex||void 0!==e.certsubject||void 0!==e.certissuer?this.asn1CertIssuer=new fe.asn1.x509.X500Name(e):"string"==typeof e&&-1!=e.indexOf("BEGIN ")&&-1!=e.indexOf("CERTIFICATE")&&(this.asn1CertIssuer=new fe.asn1.x509.X500Name({certissuer:e}))},this.setCertSNByParam=function(e){if(void 0!==e.str||void 0!==e.bigint||void 0!==e.hex)this.asn1CertSN=new fe.asn1.DERInteger(e);else if("string"==typeof e&&-1!=e.indexOf("BEGIN ")&&e.indexOf("CERTIFICATE")){var t=new Ze;t.readCertPEM(e);var r=t.getSerialNumberHex();this.asn1CertSN=new fe.asn1.DERInteger({hex:r})}},this.oid="2.5.29.35",void 0!==e&&(void 0!==e.kid&&this.setKIDByParam(e.kid),void 0!==e.issuer&&this.setCertIssuerByParam(e.issuer),void 0!==e.sn&&this.setCertSNByParam(e.sn),void 0!==e.issuersn&&"string"==typeof e.issuersn&&-1!=e.issuersn.indexOf("BEGIN ")&&e.issuersn.indexOf("CERTIFICATE")&&(this.setCertSNByParam(e.issuersn),this.setCertIssuerByParam(e.issuersn)))},We(fe.asn1.x509.AuthorityKeyIdentifier,fe.asn1.x509.Extension),fe.asn1.x509.SubjectKeyIdentifier=function(e){fe.asn1.x509.SubjectKeyIdentifier.superclass.constructor.call(this,e);var t=fe.asn1.DEROctetString;this.asn1KID=null,this.getExtnValueHex=function(){return this.asn1ExtnValue=this.asn1KID,this.asn1ExtnValue.tohex()},this.setKIDByParam=function(e){if(void 0!==e.str||void 0!==e.hex)this.asn1KID=new t(e);else if("object"==typeof e&&fe.crypto.Util.isKey(e)||"string"==typeof e&&-1!=e.indexOf("BEGIN")){var r=e;"string"==typeof e&&(r=Xe.getKey(e));var n=Xe.getKeyID(r);this.asn1KID=new fe.asn1.DEROctetString({hex:n})}},this.oid="2.5.29.14",void 0!==e&&void 0!==e.kid&&this.setKIDByParam(e.kid)},We(fe.asn1.x509.SubjectKeyIdentifier,fe.asn1.x509.Extension),fe.asn1.x509.AuthorityInfoAccess=function(e){fe.asn1.x509.AuthorityInfoAccess.superclass.constructor.call(this,e),this.setAccessDescriptionArray=function(e){for(var t=new Array,r=fe.asn1,n=r.DERSequence,i=r.DERObjectIdentifier,a=r.x509.GeneralName,s=0;s<e.length;s++){var o,c=e[s];if(void 0!==c.ocsp)o=new n({array:[new i({oid:"1.3.6.1.5.5.7.48.1"}),new a({uri:c.ocsp})]});else{if(void 0===c.caissuer)throw new Error("unknown AccessMethod parameter: "+JSON.stringify(c));o=new n({array:[new i({oid:"1.3.6.1.5.5.7.48.2"}),new a({uri:c.caissuer})]})}t.push(o)}this.asn1ExtnValue=new n({array:t})},this.getExtnValueHex=function(){return this.asn1ExtnValue.tohex()},this.oid="1.3.6.1.5.5.7.1.1",void 0!==e&&void 0!==e.array&&this.setAccessDescriptionArray(e.array)},We(fe.asn1.x509.AuthorityInfoAccess,fe.asn1.x509.Extension),fe.asn1.x509.SubjectAltName=function(e){fe.asn1.x509.SubjectAltName.superclass.constructor.call(this,e),this.setNameArray=function(e){this.asn1ExtnValue=new fe.asn1.x509.GeneralNames(e)},this.getExtnValueHex=function(){return this.asn1ExtnValue.tohex()},this.oid="2.5.29.17",void 0!==e&&void 0!==e.array&&this.setNameArray(e.array)},We(fe.asn1.x509.SubjectAltName,fe.asn1.x509.Extension),fe.asn1.x509.IssuerAltName=function(e){fe.asn1.x509.IssuerAltName.superclass.constructor.call(this,e),this.setNameArray=function(e){this.asn1ExtnValue=new fe.asn1.x509.GeneralNames(e)},this.getExtnValueHex=function(){return this.asn1ExtnValue.tohex()},this.oid="2.5.29.18",void 0!==e&&void 0!==e.array&&this.setNameArray(e.array)},We(fe.asn1.x509.IssuerAltName,fe.asn1.x509.Extension),fe.asn1.x509.SubjectDirectoryAttributes=function(e){fe.asn1.x509.SubjectDirectoryAttributes.superclass.constructor.call(this,e);var t=fe.asn1,r=t.DERSequence,n=t.ASN1Util.newObject,i=t.x509.OID.name2oid;this.params=null,this.getExtnValueHex=function(){for(var e=[],t=0;t<this.params.array.length;t++){var a=this.params.array[t];if(null==a.attr||null==a.array){var s={seq:[{oid:"1.2.3.4"},{set:[{utf8str:"DE"}]}]};if("dateOfBirth"==a.attr)s.seq[0].oid=i(a.attr),s.seq[1].set[0]={gentime:a.str};else if("placeOfBirth"==a.attr)s.seq[0].oid=i(a.attr),s.seq[1].set[0]={utf8str:a.str};else if("gender"==a.attr)s.seq[0].oid=i(a.attr),s.seq[1].set[0]={prnstr:a.str};else if("countryOfCitizenship"==a.attr)s.seq[0].oid=i(a.attr),s.seq[1].set[0]={prnstr:a.str};else{if("countryOfResidence"!=a.attr)throw new Error("unsupported attribute: "+a.attr);s.seq[0].oid=i(a.attr),s.seq[1].set[0]={prnstr:a.str}}e.push(new n(s))}else{var o={seq:[{oid:a.attr},{set:a.array}]};e.push(n(o))}}var c=new r({array:e});return this.asn1ExtnValue=c,this.asn1ExtnValue.tohex()},this.oid="2.5.29.9",void 0!==e&&(this.params=e)},We(fe.asn1.x509.SubjectDirectoryAttributes,fe.asn1.x509.Extension),fe.asn1.x509.PrivateExtension=function(e){fe.asn1.x509.PrivateExtension.superclass.constructor.call(this,e);var t=fe,r=t.lang.String.isHex,n=t.asn1,i=n.x509.OID.name2oid,a=n.ASN1Util.newObject;this.params=null,this.setByParam=function(e){this.oid=i(e.extname),this.params=e},this.getExtnValueHex=function(){if(null==this.params.extname||null==this.params.extn)throw new Error("extname or extnhex not specified");var e=this.params.extn;if("string"==typeof e&&r(e))return e;if("object"==typeof e)try{return a(e).tohex()}catch(e){}throw new Error("unsupported extn value")},null!=e&&this.setByParam(e)},We(fe.asn1.x509.PrivateExtension,fe.asn1.x509.Extension),fe.asn1.x509.CRL=function(e){fe.asn1.x509.CRL.superclass.constructor.call(this);var t=fe.asn1,r=t.DERSequence,n=t.DERBitString,i=t.x509,a=i.AlgorithmIdentifier,s=i.TBSCertList;this.params=void 0,this.setByParam=function(e){this.params=e},this.sign=function(){var e=new s(this.params).tohex(),t=new fe.crypto.Signature({alg:this.params.sigalg});t.init(this.params.cakey),t.updateHex(e);var r=t.sign();this.params.sighex=r},this.getPEM=function(){return Be(this.tohex(),"X509 CRL")},this.tohex=function(){var e=this.params;if(null==e.tbsobj&&(e.tbsobj=new s(e)),null==e.sighex&&null!=e.cakey&&this.sign(),null==e.sighex)throw new Error("sighex or cakey parameter not defined");var t=[];return t.push(e.tbsobj),t.push(new a({name:e.sigalg})),t.push(new n({hex:"00"+e.sighex})),new r({array:t}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=e&&(this.params=e)},We(fe.asn1.x509.CRL,fe.asn1.ASN1Object),fe.asn1.x509.TBSCertList=function(e){fe.asn1.x509.TBSCertList.superclass.constructor.call(this);var t=fe.asn1,r=t.DERInteger,n=t.DERSequence,i=t.DERTaggedObject,a=(t.DERObjectIdentifier,t.x509),s=a.AlgorithmIdentifier,o=a.Time,c=a.Extensions,u=a.X500Name;this.params=null,this.setByParam=function(e){this.params=e},this.getRevCertSequence=function(){for(var e=[],t=this.params.revcert,i=0;i<t.length;i++){var a=[new r(t[i].sn),new o(t[i].date)];null!=t[i].ext&&a.push(new c(t[i].ext)),e.push(new n({array:a}))}return new n({array:e})},this.tohex=function(){var e=[],t=this.params;if(null!=t.version){var a=t.version-1,f=new r({int:a});e.push(f)}if(e.push(new s({name:t.sigalg})),e.push(new u(t.issuer)),e.push(new o(t.thisupdate)),null!=t.nextupdate&&e.push(new o(t.nextupdate)),null!=t.revcert&&e.push(this.getRevCertSequence()),null!=t.ext){var h=new c(t.ext);e.push(new i({tag:"a0",explicit:!0,obj:h}))}return new n({array:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==e&&this.setByParam(e)},We(fe.asn1.x509.TBSCertList,fe.asn1.ASN1Object),fe.asn1.x509.CRLEntry=function(e){fe.asn1.x509.CRLEntry.superclass.constructor.call(this);var t=fe.asn1;this.setCertSerial=function(e){this.sn=new t.DERInteger(e)},this.setRevocationDate=function(e){this.time=new t.x509.Time(e)},this.tohex=function(){var e=new t.DERSequence({array:[this.sn,this.time]});return this.TLV=e.tohex(),this.TLV},this.getEncodedHex=function(){return this.tohex()},void 0!==e&&(void 0!==e.time&&this.setRevocationDate(e.time),void 0!==e.sn&&this.setCertSerial(e.sn))},We(fe.asn1.x509.CRLEntry,fe.asn1.ASN1Object),fe.asn1.x509.CRLNumber=function(e){fe.asn1.x509.CRLNumber.superclass.constructor.call(this,e),this.params=void 0,this.getExtnValueHex=function(){return this.asn1ExtnValue=new fe.asn1.DERInteger(this.params.num),this.asn1ExtnValue.tohex()},this.oid="2.5.29.20",null!=e&&(this.params=e)},We(fe.asn1.x509.CRLNumber,fe.asn1.x509.Extension),fe.asn1.x509.CRLReason=function(e){fe.asn1.x509.CRLReason.superclass.constructor.call(this,e),this.params=void 0,this.getExtnValueHex=function(){return this.asn1ExtnValue=new fe.asn1.DEREnumerated(this.params.code),this.asn1ExtnValue.tohex()},this.oid="2.5.29.21",null!=e&&(this.params=e)},We(fe.asn1.x509.CRLReason,fe.asn1.x509.Extension),fe.asn1.x509.OCSPNonce=function(e){fe.asn1.x509.OCSPNonce.superclass.constructor.call(this,e),this.params=void 0,this.getExtnValueHex=function(){return this.asn1ExtnValue=new fe.asn1.DEROctetString(this.params),this.asn1ExtnValue.tohex()},this.oid="1.3.6.1.5.5.7.48.1.2",null!=e&&(this.params=e)},We(fe.asn1.x509.OCSPNonce,fe.asn1.x509.Extension),fe.asn1.x509.OCSPNoCheck=function(e){fe.asn1.x509.OCSPNoCheck.superclass.constructor.call(this,e),this.params=void 0,this.getExtnValueHex=function(){return this.asn1ExtnValue=new fe.asn1.DERNull,this.asn1ExtnValue.tohex()},this.oid="1.3.6.1.5.5.7.48.1.5",null!=e&&(this.params=e)},We(fe.asn1.x509.OCSPNoCheck,fe.asn1.x509.Extension),fe.asn1.x509.AdobeTimeStamp=function(e){fe.asn1.x509.AdobeTimeStamp.superclass.constructor.call(this,e);var t=fe.asn1,r=t.DERInteger,n=t.DERBoolean,i=t.DERSequence,a=t.x509.GeneralName;this.params=null,this.getExtnValueHex=function(){var e=this.params,t=[new r(1)];return t.push(new a({uri:e.uri})),null!=e.reqauth&&t.push(new n(e.reqauth)),this.asn1ExtnValue=new i({array:t}),this.asn1ExtnValue.tohex()},this.oid="1.2.840.113583.1.1.9.1",void 0!==e&&this.setByParam(e)},We(fe.asn1.x509.AdobeTimeStamp,fe.asn1.x509.Extension),fe.asn1.x509.X500Name=function(e){fe.asn1.x509.X500Name.superclass.constructor.call(this),this.asn1Array=[],this.paramArray=[],this.sRule="utf8";var t=fe.asn1,r=t.x509,n=r.RDN;this.setByString=function(e,t){void 0!==t&&(this.sRule=t);var r=e.split("/");r.shift();for(var i=[],a=0;a<r.length;a++)if(r[a].match(/^[^=]+=.+$/))i.push(r[a]);else{var s=i.length-1;i[s]=i[s]+"/"+r[a]}for(a=0;a<i.length;a++)this.asn1Array.push(new n({str:i[a],rule:this.sRule}))},this.setByLdapString=function(e,t){void 0!==t&&(this.sRule=t);var n=r.X500Name.ldapToCompat(e);this.setByString(n,t)},this.setByObject=function(e,t){for(var r in void 0!==t&&(this.sRule=t),e)if(e.hasOwnProperty(r)){var i=new n({str:r+"="+e[r],rule:this.sRule});this.asn1Array?this.asn1Array.push(i):this.asn1Array=[i]}},this.setByParam=function(e){var t;void 0!==e.rule&&(this.sRule=e.rule),void 0!==e.array?this.paramArray=e.array:void 0!==e.str?this.setByString(e.str):void 0!==e.ldapstr?this.setByLdapString(e.ldapstr):void 0!==e.hex?this.hTLV=e.hex:void 0!==e.certissuer?((t=new Ze).readCertPEM(e.certissuer),this.hTLV=t.getIssuerHex()):void 0!==e.certsubject?((t=new Ze).readCertPEM(e.certsubject),this.hTLV=t.getSubjectHex()):"object"==typeof e&&void 0===e.certsubject&&void 0===e.certissuer&&this.setByObject(e)},this.tohex=function(){if("string"==typeof this.hTLV)return this.hTLV;if(0==this.asn1Array.length&&this.paramArray.length>0)for(var e=0;e<this.paramArray.length;e++){var r={array:this.paramArray[e]};"utf8"!=this.sRule&&(r.rule=this.sRule);var i=new n(r);this.asn1Array.push(i)}var a=new t.DERSequence({array:this.asn1Array});return this.hTLV=a.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},void 0!==e&&this.setByParam(e)},We(fe.asn1.x509.X500Name,fe.asn1.ASN1Object),fe.asn1.x509.X500Name.compatToLDAP=function(e){if("/"!==e.substr(0,1))throw"malformed input";var t=(e=e.substr(1)).split("/");return t.reverse(),t=t.map((function(e){return e.replace(/,/,"\\,")})),t.join(",")},fe.asn1.x509.X500Name.onelineToLDAP=function(e){return fe.asn1.x509.X500Name.compatToLDAP(e)},fe.asn1.x509.X500Name.ldapToCompat=function(e){for(var t=e.split(","),r=!1,n=[],i=0;t.length>0;i++){var a=t.shift();if(!0===r){var s=(n.pop()+","+a).replace(/\\,/g,",");n.push(s),r=!1}else n.push(a);"\\"===a.substr(-1,1)&&(r=!0)}return n=n.map((function(e){return e.replace("/","\\/")})),n.reverse(),"/"+n.join("/")},fe.asn1.x509.X500Name.ldapToOneline=function(e){return fe.asn1.x509.X500Name.ldapToCompat(e)},fe.asn1.x509.RDN=function(e){fe.asn1.x509.RDN.superclass.constructor.call(this),this.asn1Array=[],this.paramArray=[],this.sRule="utf8";var t=fe.asn1.x509.AttributeTypeAndValue;this.setByParam=function(e){void 0!==e.rule&&(this.sRule=e.rule),void 0!==e.str&&this.addByMultiValuedString(e.str),void 0!==e.array&&(this.paramArray=e.array)},this.addByString=function(e){this.asn1Array.push(new fe.asn1.x509.AttributeTypeAndValue({str:e,rule:this.sRule}))},this.addByMultiValuedString=function(e){for(var t=fe.asn1.x509.RDN.parseString(e),r=0;r<t.length;r++)this.addByString(t[r])},this.tohex=function(){if(0==this.asn1Array.length&&this.paramArray.length>0)for(var e=0;e<this.paramArray.length;e++){var r=this.paramArray[e];void 0!==r.rule&&"utf8"!=this.sRule&&(r.rule=this.sRule);var n=new t(r);this.asn1Array.push(n)}var i=new fe.asn1.DERSet({array:this.asn1Array});return this.TLV=i.tohex(),this.TLV},this.getEncodedHex=function(){return this.tohex()},void 0!==e&&this.setByParam(e)},We(fe.asn1.x509.RDN,fe.asn1.ASN1Object),fe.asn1.x509.RDN.parseString=function(e){for(var t=e.split(/\+/),r=!1,n=[],i=0;t.length>0;i++){var a=t.shift();if(!0===r){var s=(n.pop()+"+"+a).replace(/\\\+/g,"+");n.push(s),r=!1}else n.push(a);"\\"===a.substr(-1,1)&&(r=!0)}var o=!1,c=[];for(i=0;n.length>0;i++){if(a=n.shift(),!0===o){var u=c.pop();a.match(/"$/)?(s=(u+"+"+a).replace(/^([^=]+)="(.*)"$/,"$1=$2"),c.push(s),o=!1):c.push(u+"+"+a)}else c.push(a);a.match(/^[^=]+="/)&&(o=!0)}return c},fe.asn1.x509.AttributeTypeAndValue=function(e){fe.asn1.x509.AttributeTypeAndValue.superclass.constructor.call(this),this.sRule="utf8",this.sType=null,this.sValue=null,this.dsType=null;var t=fe,r=t.asn1,n=r.DERSequence,i=r.DERUTF8String,a=r.DERPrintableString,s=r.DERTeletexString,o=r.DERIA5String,c=r.DERVisibleString,u=r.DERBMPString,f=t.lang.String.isMail,h=t.lang.String.isPrintable;this.setByParam=function(e){if(void 0!==e.rule&&(this.sRule=e.rule),void 0!==e.ds&&(this.dsType=e.ds),void 0===e.value&&void 0!==e.str){var t=e.str.match(/^([^=]+)=(.+)$/);if(!t)throw new Error("malformed attrTypeAndValueStr: "+attrTypeAndValueStr);this.sType=t[1],this.sValue=t[2]}else this.sType=e.type,this.sValue=e.value},this.setByString=function(e,t){void 0!==t&&(this.sRule=t);var r=e.match(/^([^=]+)=(.+)$/);if(!r)throw new Error("malformed attrTypeAndValueStr: "+attrTypeAndValueStr);this.setByAttrTypeAndValueStr(r[1],r[2])},this._getDsType=function(){var e=this.sType,t=this.sValue,r=this.sRule;return"prn"===r?"CN"==e&&f(t)?"ia5":h(t)?"prn":"utf8":"utf8"===r?"CN"==e&&f(t)?"ia5":"C"==e?"prn":"utf8":"utf8"},this.setByAttrTypeAndValueStr=function(e,t,r){void 0!==r&&(this.sRule=r),this.sType=e,this.sValue=t},this.getValueObj=function(e,t){if("utf8"==e)return new i({str:t});if("prn"==e)return new a({str:t});if("tel"==e)return new s({str:t});if("ia5"==e)return new o({str:t});if("vis"==e)return new c({str:t});if("bmp"==e)return new u({str:t});throw new Error("unsupported directory string type: type="+e+" value="+t)},this.tohex=function(){null==this.dsType&&(this.dsType=this._getDsType());var e=fe.asn1.x509.OID.atype2obj(this.sType),t=this.getValueObj(this.dsType,this.sValue),r=new n({array:[e,t]});return this.TLV=r.tohex(),this.TLV},this.getEncodedHex=function(){return this.tohex()},void 0!==e&&this.setByParam(e)},We(fe.asn1.x509.AttributeTypeAndValue,fe.asn1.ASN1Object),fe.asn1.x509.SubjectPublicKeyInfo=function(e){fe.asn1.x509.SubjectPublicKeyInfo.superclass.constructor.call(this);var t=fe,r=t.asn1,n=r.DERInteger,i=r.DERBitString,a=r.DERObjectIdentifier,s=r.DERSequence,o=r.ASN1Util.newObject,c=r.x509.AlgorithmIdentifier,u=t.crypto;u.ECDSA,u.DSA,this.getASN1Object=function(){if(null==this.asn1AlgId||null==this.asn1SubjPKey)throw"algId and/or subjPubKey not set";return new s({array:[this.asn1AlgId,this.asn1SubjPKey]})},this.tohex=function(){var e=this.getASN1Object();return this.hTLV=e.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},this.setPubKey=function(e){try{if(e instanceof ae){var t=o({seq:[{int:{bigint:e.n}},{int:{int:e.e}}]}).tohex();this.asn1AlgId=new c({name:"rsaEncryption"}),this.asn1SubjPKey=new i({hex:"00"+t})}}catch(e){}try{if(e instanceof fe.crypto.ECDSA){var r=new a({name:e.curveName});this.asn1AlgId=new c({name:"ecPublicKey",asn1params:r}),this.asn1SubjPKey=new i({hex:"00"+e.pubKeyHex})}}catch(e){}try{if(e instanceof fe.crypto.DSA){r=new o({seq:[{int:{bigint:e.p}},{int:{bigint:e.q}},{int:{bigint:e.g}}]}),this.asn1AlgId=new c({name:"dsa",asn1params:r});var s=new n({bigint:e.y});this.asn1SubjPKey=new i({hex:"00"+s.tohex()})}}catch(e){}},void 0!==e&&this.setPubKey(e)},We(fe.asn1.x509.SubjectPublicKeyInfo,fe.asn1.ASN1Object),fe.asn1.x509.Time=function(e){fe.asn1.x509.Time.superclass.constructor.call(this);var t=fe.asn1,r=t.DERUTCTime,n=t.DERGeneralizedTime;this.params=null,this.type=null,this.setTimeParams=function(e){this.timeParams=e},this.setByParam=function(e){this.params=e},this.getType=function(e){return e.match(/^[0-9]{12}Z$/)?"utc":e.match(/^[0-9]{14}Z$/)?"gen":e.match(/^[0-9]{12}\.[0-9]+Z$/)?"utc":e.match(/^[0-9]{14}\.[0-9]+Z$/)?"gen":null},this.tohex=function(){var e=this.params,t=null;if("string"==typeof e&&(e={str:e}),null==e||!e.str||null!=e.type&&null!=e.type||(e.type=this.getType(e.str)),null!=e&&e.str?("utc"==e.type&&(t=new r(e.str)),"gen"==e.type&&(t=new n(e.str))):t="gen"==this.type?new n:new r,null==t)throw new Error("wrong setting for Time");return this.TLV=t.tohex(),this.TLV},this.getEncodedHex=function(){return this.tohex()},null!=e&&this.setByParam(e)},fe.asn1.x509.Time_bak=function(e){fe.asn1.x509.Time_bak.superclass.constructor.call(this);var t=fe.asn1,r=t.DERUTCTime,n=t.DERGeneralizedTime;this.setTimeParams=function(e){this.timeParams=e},this.tohex=function(){var e=null;return e=null!=this.timeParams?"utc"==this.type?new r(this.timeParams):new n(this.timeParams):"utc"==this.type?new r:new n,this.TLV=e.tohex(),this.TLV},this.getEncodedHex=function(){return this.tohex()},this.type="utc",void 0!==e&&(void 0!==e.type?this.type=e.type:void 0!==e.str&&(e.str.match(/^[0-9]{12}Z$/)&&(this.type="utc"),e.str.match(/^[0-9]{14}Z$/)&&(this.type="gen")),this.timeParams=e)},We(fe.asn1.x509.Time,fe.asn1.ASN1Object),fe.asn1.x509.AlgorithmIdentifier=function(e){fe.asn1.x509.AlgorithmIdentifier.superclass.constructor.call(this),this.nameAlg=null,this.asn1Alg=null,this.asn1Params=null,this.paramEmpty=!1;var t=fe.asn1,r=t.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV;if(this.tohex=function(){if(null===this.nameAlg&&null===this.asn1Alg)throw new Error("algorithm not specified");if(null!==this.nameAlg){var e=null;for(var n in r)n===this.nameAlg&&(e=r[n]);if(null!==e)return this.hTLV=e,this.hTLV}null!==this.nameAlg&&null===this.asn1Alg&&(this.asn1Alg=t.x509.OID.name2obj(this.nameAlg));var i=[this.asn1Alg];null!==this.asn1Params&&i.push(this.asn1Params);var a=new t.DERSequence({array:i});return this.hTLV=a.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},void 0!==e&&(void 0!==e.name&&(this.nameAlg=e.name),void 0!==e.asn1params&&(this.asn1Params=e.asn1params),void 0!==e.paramempty&&(this.paramEmpty=e.paramempty)),null===this.asn1Params&&!1===this.paramEmpty&&null!==this.nameAlg){void 0!==this.nameAlg.name&&(this.nameAlg=this.nameAlg.name);var n=this.nameAlg.toLowerCase();"withdsa"!==n.substr(-7,7)&&"withecdsa"!==n.substr(-9,9)&&(this.asn1Params=new t.DERNull)}},We(fe.asn1.x509.AlgorithmIdentifier,fe.asn1.ASN1Object),fe.asn1.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV={SHAwithRSAandMGF1:"300d06092a864886f70d01010a3000",SHA256withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040201a11a301806092a864886f70d010108300b0609608648016503040201a203020120",SHA384withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040202a11a301806092a864886f70d010108300b0609608648016503040202a203020130",SHA512withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040203a11a301806092a864886f70d010108300b0609608648016503040203a203020140"},fe.asn1.x509.GeneralName=function(e){fe.asn1.x509.GeneralName.superclass.constructor.call(this);var t=fe.asn1,r=t.x509,n=r.X500Name,i=r.OtherName,a=t.DERIA5String,s=(t.DERPrintableString,t.DEROctetString),o=t.DERTaggedObject,c=t.ASN1Object,u=Error;this.params=null,this.setByParam=function(e){this.params=e},this.tohex=function(){var e,t,r=this.params,f=!1;if(void 0!==r.other)e="a0",t=new i(r.other);else if(void 0!==r.rfc822)e="81",t=new a({str:r.rfc822});else if(void 0!==r.dns)e="82",t=new a({str:r.dns});else if(void 0!==r.dn)e="a4",f=!0,t="string"==typeof r.dn?new n({str:r.dn}):r.dn instanceof fe.asn1.x509.X500Name?r.dn:new n(r.dn);else if(void 0!==r.ldapdn)e="a4",f=!0,t=new n({ldapstr:r.ldapdn});else if(void 0!==r.certissuer||void 0!==r.certsubj){var h,l;e="a4",f=!0;var d=null;if(void 0!==r.certsubj?(h=!1,l=r.certsubj):(h=!0,l=r.certissuer),l.match(/^[0-9A-Fa-f]+$/),-1!=l.indexOf("-----BEGIN ")&&(d=xe(l)),null==d)throw new Error("certsubj/certissuer not cert");var p,g=new Ze;g.hex=d,p=h?g.getIssuerHex():g.getSubjectHex(),(t=new c).hTLV=p}else if(void 0!==r.uri)e="86",t=new a({str:r.uri});else{if(void 0===r.ip)throw new u("improper params");var y;e="87";var v=r.ip;try{if(v.match(/^[0-9a-f]+$/)){var m=v.length;if(8!=m&&16!=m&&32!=m&&64!=m)throw"err";y=v}else y=Pe(v)}catch(e){throw new u("malformed IP address: "+r.ip+":"+e.message)}t=new s({hex:y})}return new o({tag:e,explicit:f,obj:t}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==e&&this.setByParam(e)},We(fe.asn1.x509.GeneralName,fe.asn1.ASN1Object),fe.asn1.x509.GeneralNames=function(e){fe.asn1.x509.GeneralNames.superclass.constructor.call(this);var t=fe.asn1;this.setByParamArray=function(e){for(var r=0;r<e.length;r++){var n=new t.x509.GeneralName(e[r]);this.asn1Array.push(n)}},this.tohex=function(){return new t.DERSequence({array:this.asn1Array}).tohex()},this.getEncodedHex=function(){return this.tohex()},this.asn1Array=new Array,void 0!==e&&this.setByParamArray(e)},We(fe.asn1.x509.GeneralNames,fe.asn1.ASN1Object),fe.asn1.x509.OtherName=function(e){fe.asn1.x509.OtherName.superclass.constructor.call(this);var t=fe.asn1,r=t.DERObjectIdentifier,n=t.DERSequence,i=t.ASN1Util.newObject;this.params=null,this.setByParam=function(e){this.params=e},this.tohex=function(){var e=this.params;if(null==e.oid||null==e.value)throw new Error("oid or value not specified");var t=new r({oid:e.oid}),a=i({tag:{tag:"a0",explicit:!0,obj:e.value}});return new n({array:[t,a]}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==e&&this.setByParam(e)},We(fe.asn1.x509.OtherName,fe.asn1.ASN1Object),fe.asn1.x509.OID=new function(){var e=fe.asn1.DERObjectIdentifier;this.name2oidList={"aes128-CBC":"2.16.840.1.101.3.4.1.2","aes256-CBC":"2.16.840.1.101.3.4.1.42",sha1:"1.3.14.3.2.26",sha256:"2.16.840.1.101.3.4.2.1",sha384:"2.16.840.1.101.3.4.2.2",sha512:"2.16.840.1.101.3.4.2.3",sha224:"2.16.840.1.101.3.4.2.4",md5:"1.2.840.113549.2.5",md2:"1.3.14.7.2.2.1",ripemd160:"1.3.36.3.2.1",hmacWithSHA1:"1.2.840.113549.2.7",hmacWithSHA224:"1.2.840.113549.2.8",hmacWithSHA256:"1.2.840.113549.2.9",hmacWithSHA384:"1.2.840.113549.2.10",hmacWithSHA512:"1.2.840.113549.2.11",MD2withRSA:"1.2.840.113549.1.1.2",MD4withRSA:"1.2.840.113549.1.1.3",MD5withRSA:"1.2.840.113549.1.1.4",SHA1withRSA:"1.2.840.113549.1.1.5","pkcs1-MGF":"1.2.840.113549.1.1.8",rsaPSS:"1.2.840.113549.1.1.10",SHA224withRSA:"1.2.840.113549.1.1.14",SHA256withRSA:"1.2.840.113549.1.1.11",SHA384withRSA:"1.2.840.113549.1.1.12",SHA512withRSA:"1.2.840.113549.1.1.13",SHA1withECDSA:"1.2.840.10045.4.1",SHA224withECDSA:"1.2.840.10045.4.3.1",SHA256withECDSA:"1.2.840.10045.4.3.2",SHA384withECDSA:"1.2.840.10045.4.3.3",SHA512withECDSA:"1.2.840.10045.4.3.4",dsa:"1.2.840.10040.4.1",SHA1withDSA:"1.2.840.10040.4.3",SHA224withDSA:"2.16.840.1.101.3.4.3.1",SHA256withDSA:"2.16.840.1.101.3.4.3.2",rsaEncryption:"1.2.840.113549.1.1.1",commonName:"2.5.4.3",countryName:"2.5.4.6",localityName:"2.5.4.7",stateOrProvinceName:"2.5.4.8",streetAddress:"2.5.4.9",organizationName:"2.5.4.10",organizationalUnitName:"2.5.4.11",domainComponent:"0.9.2342.19200300.100.1.25",userId:"0.9.2342.19200300.100.1.1",surname:"2.5.4.4",givenName:"2.5.4.42",title:"2.5.4.12",distinguishedName:"2.5.4.49",emailAddress:"1.2.840.113549.1.9.1",description:"2.5.4.13",businessCategory:"2.5.4.15",postalCode:"2.5.4.17",uniqueIdentifier:"2.5.4.45",organizationIdentifier:"2.5.4.97",jurisdictionOfIncorporationL:"1.3.6.1.4.1.311.60.2.1.1",jurisdictionOfIncorporationSP:"1.3.6.1.4.1.311.60.2.1.2",jurisdictionOfIncorporationC:"1.3.6.1.4.1.311.60.2.1.3",subjectDirectoryAttributes:"2.5.29.9",subjectKeyIdentifier:"2.5.29.14",keyUsage:"2.5.29.15",subjectAltName:"2.5.29.17",issuerAltName:"2.5.29.18",basicConstraints:"2.5.29.19",cRLNumber:"2.5.29.20",cRLReason:"2.5.29.21",nameConstraints:"2.5.29.30",cRLDistributionPoints:"2.5.29.31",certificatePolicies:"2.5.29.32",anyPolicy:"2.5.29.32.0",policyMappings:"2.5.29.33",authorityKeyIdentifier:"2.5.29.35",policyConstraints:"2.5.29.36",extKeyUsage:"2.5.29.37",inhibitAnyPolicy:"2.5.29.54",authorityInfoAccess:"1.3.6.1.5.5.7.1.1",ocsp:"1.3.6.1.5.5.7.48.1",ocspBasic:"1.3.6.1.5.5.7.48.1.1",ocspNonce:"1.3.6.1.5.5.7.48.1.2",ocspNoCheck:"1.3.6.1.5.5.7.48.1.5",caIssuers:"1.3.6.1.5.5.7.48.2",anyExtendedKeyUsage:"2.5.29.37.0",serverAuth:"1.3.6.1.5.5.7.3.1",clientAuth:"1.3.6.1.5.5.7.3.2",codeSigning:"1.3.6.1.5.5.7.3.3",emailProtection:"1.3.6.1.5.5.7.3.4",timeStamping:"1.3.6.1.5.5.7.3.8",ocspSigning:"1.3.6.1.5.5.7.3.9",smtpUTF8Mailbox:"1.3.6.1.5.5.7.8.9",dateOfBirth:"1.3.6.1.5.5.7.9.1",placeOfBirth:"1.3.6.1.5.5.7.9.2",gender:"1.3.6.1.5.5.7.9.3",countryOfCitizenship:"1.3.6.1.5.5.7.9.4",countryOfResidence:"1.3.6.1.5.5.7.9.5",ecPublicKey:"1.2.840.10045.2.1","P-256":"1.2.840.10045.3.1.7",secp256r1:"1.2.840.10045.3.1.7",secp256k1:"1.3.132.0.10",secp384r1:"1.3.132.0.34",secp521r1:"1.3.132.0.35",pkcs5PBES2:"1.2.840.113549.1.5.13",pkcs5PBKDF2:"1.2.840.113549.1.5.12","des-EDE3-CBC":"1.2.840.113549.3.7",data:"1.2.840.113549.1.7.1","signed-data":"1.2.840.113549.1.7.2","enveloped-data":"1.2.840.113549.1.7.3","digested-data":"1.2.840.113549.1.7.5","encrypted-data":"1.2.840.113549.1.7.6","authenticated-data":"1.2.840.113549.1.9.16.1.2",tstinfo:"1.2.840.113549.1.9.16.1.4",signingCertificate:"1.2.840.113549.1.9.16.2.12",timeStampToken:"1.2.840.113549.1.9.16.2.14",signaturePolicyIdentifier:"1.2.840.113549.1.9.16.2.15",etsArchiveTimeStamp:"1.2.840.113549.1.9.16.2.27",signingCertificateV2:"1.2.840.113549.1.9.16.2.47",etsArchiveTimeStampV2:"1.2.840.113549.1.9.16.2.48",extensionRequest:"1.2.840.113549.1.9.14",contentType:"1.2.840.113549.1.9.3",messageDigest:"1.2.840.113549.1.9.4",signingTime:"1.2.840.113549.1.9.5",counterSignature:"1.2.840.113549.1.9.6",archiveTimeStampV3:"0.4.0.1733.2.4",pdfRevocationInfoArchival:"1.2.840.113583.1.1.8",adobeTimeStamp:"1.2.840.113583.1.1.9.1",smimeMailboxLegacy:"2.23.140.1.5.1.1",smimeMailboxMulti:"2.23.140.1.5.1.2",smimeMailboxStrict:"2.23.140.1.5.1.3",smimeOrganizationLegacy:"2.23.140.1.5.2.1",smimeOrganizationMulti:"2.23.140.1.5.2.2",smimeOrganizationStrict:"2.23.140.1.5.2.3",smimeSponsorLegacy:"2.23.140.1.5.3.1",smimeSponsorMulti:"2.23.140.1.5.3.2",smimeSponsorStrict:"2.23.140.1.5.3.3",smimeIndividualLegacy:"2.23.140.1.5.4.1",smimeIndividualMulti:"2.23.140.1.5.4.2",smimeIndividualStrict:"2.23.140.1.5.4.3"},this.atype2oidList={CN:"2.5.4.3",L:"2.5.4.7",ST:"2.5.4.8",O:"2.5.4.10",OU:"2.5.4.11",C:"2.5.4.6",STREET:"2.5.4.9",DC:"0.9.2342.19200300.100.1.25",UID:"0.9.2342.19200300.100.1.1",SN:"2.5.4.4",T:"2.5.4.12",GN:"2.5.4.42",DN:"2.5.4.49",E:"1.2.840.113549.1.9.1",description:"2.5.4.13",businessCategory:"2.5.4.15",postalCode:"2.5.4.17",serialNumber:"2.5.4.5",uniqueIdentifier:"2.5.4.45",organizationIdentifier:"2.5.4.97",jurisdictionOfIncorporationL:"1.3.6.1.4.1.311.60.2.1.1",jurisdictionOfIncorporationSP:"1.3.6.1.4.1.311.60.2.1.2",jurisdictionOfIncorporationC:"1.3.6.1.4.1.311.60.2.1.3"},this.objCache={},this.name2obj=function(t){if(void 0!==this.objCache[t])return this.objCache[t];if(void 0===this.name2oidList[t])throw"Name of ObjectIdentifier not defined: "+t;var r=this.name2oidList[t],n=new e({oid:r});return this.objCache[t]=n,n},this.atype2obj=function(t){if(void 0!==this.objCache[t])return this.objCache[t];var r;if(t.match(/^\d+\.\d+\.[0-9.]+$/))r=t;else if(void 0!==this.atype2oidList[t])r=this.atype2oidList[t];else{if(void 0===this.name2oidList[t])throw new Error("AttributeType name undefined: "+t);r=this.name2oidList[t]}var n=new e({oid:r});return this.objCache[t]=n,n},this.registerOIDs=function(e){if(this.checkOIDs(e))for(var t in e)this.name2oidList[t]=e[t]},this.checkOIDs=function(e){try{var t=Object.keys(e);return 0!=t.length&&(t.map((function(e,t,r){if(!this[e].match(/^[0-2]\.[0-9.]+$/))throw new Error("value is not OID")}),e),!0)}catch(e){return!1}}},fe.asn1.x509.OID.oid2name=function(e){var t=fe.asn1.x509.OID.name2oidList;for(var r in t)if(t[r]==e)return r;return""},fe.asn1.x509.OID.oid2atype=function(e){var t=fe.asn1.x509.OID.atype2oidList;for(var r in t)if(t[r]==e)return r;return e},fe.asn1.x509.OID.name2oid=function(e){if(e.match(/^[0-9.]+$/))return e;var t=fe.asn1.x509.OID.name2oidList;return void 0===t[e]?"":t[e]},fe.asn1.x509.X509Util={},fe.asn1.x509.X509Util.newCertPEM=function(e){var t=fe.asn1.x509;return t.TBSCertificate,new(0,t.Certificate)(e).getPEM()},void 0!==fe&&fe||(fe={}),void 0!==fe.asn1&&fe.asn1||(fe.asn1={}),void 0!==fe.asn1.cms&&fe.asn1.cms||(fe.asn1.cms={}),fe.asn1.cms.Attribute=function(e){var t=Error,r=fe.asn1,n=r.DERSequence,i=r.DERSet,a=r.DERObjectIdentifier;this.params=null,this.typeOid=null,this.setByParam=function(e){this.params=e},this.getValueArray=function(){throw new t("not yet implemented abstract")},this.tohex=function(){var e=new a({oid:this.typeOid}),t=new i({array:this.getValueArray()});return new n({array:[e,t]}).tohex()},this.getEncodedHex=function(){return this.tohex()}},We(fe.asn1.cms.Attribute,fe.asn1.ASN1Object),fe.asn1.cms.ContentType=function(e){var t=fe.asn1;t.cms.ContentType.superclass.constructor.call(this),this.typeOid="1.2.840.113549.1.9.3",this.getValueArray=function(){return[new t.DERObjectIdentifier(this.params.type)]},null!=e&&this.setByParam(e)},We(fe.asn1.cms.ContentType,fe.asn1.cms.Attribute),fe.asn1.cms.MessageDigest=function(e){var t=fe.asn1,r=t.DEROctetString;t.cms.MessageDigest.superclass.constructor.call(this),this.typeOid="1.2.840.113549.1.9.4",this.getValueArray=function(){return[new r(this.params)]},null!=e&&this.setByParam(e)},We(fe.asn1.cms.MessageDigest,fe.asn1.cms.Attribute),fe.asn1.cms.SigningTime=function(e){var t=fe.asn1;t.cms.SigningTime.superclass.constructor.call(this),this.typeOid="1.2.840.113549.1.9.5",this.getValueArray=function(){return[new t.x509.Time(this.params)]},null!=e&&this.setByParam(e)},We(fe.asn1.cms.SigningTime,fe.asn1.cms.Attribute),fe.asn1.cms.SigningCertificate=function(e){var t=Error,r=fe,n=r.asn1,i=n.DERSequence,a=n.cms,s=a.ESSCertID;r.crypto,a.SigningCertificate.superclass.constructor.call(this),this.typeOid="1.2.840.113549.1.9.16.2.12",this.getValueArray=function(){if(null==this.params||null==this.params||null==this.params.array)throw new t("parameter 'array' not specified");for(var r=this.params.array,n=[],a=0;a<r.length;a++){var o=r[a];0!=e.hasis||"string"!=typeof o||-1==o.indexOf("-----BEGIN")&&!de.isASN1HEX(o)||(o={cert:o}),0!=o.hasis&&0==e.hasis&&(o.hasis=!1),n.push(new s(o))}var c=new i({array:n});return[new i({array:[c]})]},null!=e&&this.setByParam(e)},We(fe.asn1.cms.SigningCertificate,fe.asn1.cms.Attribute),fe.asn1.cms.ESSCertID=function(e){fe.asn1.cms.ESSCertID.superclass.constructor.call(this);var t=Error,r=fe,n=r.asn1,i=n.DEROctetString,a=n.DERSequence,s=n.cms.IssuerSerial;this.params=null,this.getCertHash=function(e,n){if(null!=e.hash)return e.hash;if("string"==typeof e&&-1==e.indexOf("-----BEGIN")&&!de.isASN1HEX(e))return e;var i,a,s;if("string"==typeof e)i=e;else{if(null==e.cert)throw new t("hash nor cert unspecified");i=e.cert}if(a=-1!=i.indexOf("-----BEGIN")?xe(i):i,"string"==typeof e&&(-1!=e.indexOf("-----BEGIN")?a=xe(e):de.isASN1HEX(e)&&(a=e)),null!=e.alg)s=e.alg;else{if(null==n)throw new t("hash alg unspecified");s=n}return r.crypto.Util.hashHex(a,s)},this.tohex=function(){var e=this.params,t=this.getCertHash(e,"sha1"),r=[];return r.push(new i({hex:t})),("string"==typeof e&&-1!=e.indexOf("-----BEGIN")||null!=e.cert&&0!=e.hasis||null!=e.issuer&&null!=e.serial)&&r.push(new s(e)),new a({array:r}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=e&&this.setByParam(e)},We(fe.asn1.cms.ESSCertID,fe.asn1.ASN1Object),fe.asn1.cms.SigningCertificateV2=function(e){var t=Error,r=fe,n=r.asn1,i=n.DERSequence,a=(n.x509,n.cms),s=a.ESSCertIDv2;r.crypto,a.SigningCertificateV2.superclass.constructor.call(this),this.typeOid="1.2.840.113549.1.9.16.2.47",this.getValueArray=function(){if(null==this.params||null==this.params||null==this.params.array)throw new t("parameter 'array' not specified");for(var r=this.params.array,n=[],a=0;a<r.length;a++){var o=r[a];null==e.alg&&0!=e.hasis||"string"!=typeof o||-1==o.indexOf("-----BEGIN")&&!de.isASN1HEX(o)||(o={cert:o}),null==o.alg&&null!=e.alg&&(o.alg=e.alg),0!=o.hasis&&0==e.hasis&&(o.hasis=!1),n.push(new s(o))}var c=new i({array:n});return[new i({array:[c]})]},null!=e&&this.setByParam(e)},We(fe.asn1.cms.SigningCertificateV2,fe.asn1.cms.Attribute),fe.asn1.cms.ESSCertIDv2=function(e){fe.asn1.cms.ESSCertIDv2.superclass.constructor.call(this),Error;var t=fe.asn1,r=t.DEROctetString,n=t.DERSequence,i=t.cms.IssuerSerial,a=t.x509.AlgorithmIdentifier;this.params=null,this.tohex=function(){var e=this.params,t=this.getCertHash(e,"sha256"),s=[];return null!=e.alg&&"sha256"!=e.alg&&s.push(new a({name:e.alg})),s.push(new r({hex:t})),("string"==typeof e&&-1!=e.indexOf("-----BEGIN")||null!=e.cert&&0!=e.hasis||null!=e.issuer&&null!=e.serial)&&s.push(new i(e)),new n({array:s}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=e&&this.setByParam(e)},We(fe.asn1.cms.ESSCertIDv2,fe.asn1.cms.ESSCertID),fe.asn1.cms.IssuerSerial=function(e){var t=Error,r=fe.asn1,n=r.DERInteger,i=r.DERSequence,a=r.cms,s=r.x509.GeneralNames,o=Ze;a.IssuerSerial.superclass.constructor.call(this),this.setByParam=function(e){this.params=e},this.tohex=function(){var e,r,a=this.params;if("string"==typeof a&&-1!=a.indexOf("-----BEGIN")||null!=a.cert){var c;c=null!=a.cert?a.cert:a;var u=new o;u.readCertPEM(c),e=u.getIssuer(),r={hex:u.getSerialNumberHex()}}else{if(null==a.issuer||!a.serial)throw new t("cert or issuer and serial parameter not specified");e=a.issuer,r=a.serial}var f=new s([{dn:e}]),h=new n(r);return new i({array:[f,h]}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=e&&this.setByParam(e)},We(fe.asn1.cms.IssuerSerial,fe.asn1.ASN1Object),fe.asn1.cms.SignerIdentifier=function(e){var t=fe.asn1,r=(t.DERInteger,t.DERSequence,t.cms),n=r.IssuerAndSerialNumber,i=r.SubjectKeyIdentifier;t.x509.X500Name,Error,r.SignerIdentifier.superclass.constructor.call(this),this.params=null,this.tohex=function(){var e=this.params;if("isssn"==e.type)return new n(e).tohex();if("skid"==e.type)return new i(e).tohex();throw new Error("wrong property for isssn or skid")},this.getEncodedHex=function(){return this.tohex()},null!=e&&this.setByParam(e)},We(fe.asn1.cms.SignerIdentifier,fe.asn1.ASN1Object),fe.asn1.cms.IssuerAndSerialNumber=function(e){var t=fe.asn1,r=t.DERInteger,n=t.DERSequence,i=t.cms,a=t.x509.X500Name,s=Ze,o=Error;i.IssuerAndSerialNumber.superclass.constructor.call(this),this.params=null,this.tohex=function(){var e,t,i=this.params;if("string"==typeof i&&-1!=i.indexOf("-----BEGIN")||null!=i.cert){var c;c=null!=i.cert?i.cert:i;var u=new s;u.readCertPEM(c),e=u.getIssuer(),t={hex:u.getSerialNumberHex()}}else{if(null==i.issuer||!i.serial)throw new o("cert or issuer and serial parameter not specified");e=i.issuer,t=i.serial}var f=new a(e),h=new r(t);return new n({array:[f,h]}).tohex()},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(e){this.params=e},null!=e&&this.setByParam(e)},We(fe.asn1.cms.IssuerAndSerialNumber,fe.asn1.ASN1Object),fe.asn1.cms.SubjectKeyIdentifier=function(e){var t=fe.asn1,r=(t.DERInteger,t.DERSequence,t.ASN1Util.newObject),n=t.cms,i=(n.IssuerAndSerialName,n.SubjectKeyIdentifier,t.x509.X500Name,Ze),a=Error;n.SubjectKeyIdentifier.superclass.constructor.call(this),this.tohex=function(){var e,t=this.params;if(null==t.cert&&null==t.skid)throw new a("property cert nor skid undefined");return null!=t.cert?e=new i(t.cert).getExtSubjectKeyIdentifier().kid.hex:null!=t.skid&&(e=t.skid),r({tag:{tage:"a0",obj:{octstr:{hex:e}}}}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=e&&this.setByParam(e)},We(fe.asn1.cms.SubjectKeyIdentifier,fe.asn1.ASN1Object),fe.asn1.cms.AttributeList=function(e){var t=Error,r=fe.asn1,n=r.DERSet,i=r.cms;i.AttributeList.superclass.constructor.call(this),this.params=null,this.hTLV=null,this.setByParam=function(e){this.params=e},this.tohex=function(){var e=this.params;if(null!=this.hTLV)return this.hTLV;var r=!0;null!=e.sortflag&&(r=e.sortflag);for(var a=e.array,s=[],o=0;o<a.length;o++){var c=a[o],u=c.attr;if("contentType"==u)s.push(new i.ContentType(c));else if("messageDigest"==u)s.push(new i.MessageDigest(c));else if("signingTime"==u)s.push(new i.SigningTime(c));else if("signingCertificate"==u)s.push(new i.SigningCertificate(c));else if("signingCertificateV2"==u)s.push(new i.SigningCertificateV2(c));else if("signaturePolicyIdentifier"==u)s.push(new fe.asn1.cades.SignaturePolicyIdentifier(c));else{if("signatureTimeStamp"!=u&&"timeStampToken"!=u)throw new t("unknown attr: "+u);s.push(new fe.asn1.cades.SignatureTimeStamp(c))}}var f=new n({array:s,sortflag:r});return this.hTLV=f.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},null!=e&&this.setByParam(e)},We(fe.asn1.cms.AttributeList,fe.asn1.ASN1Object),fe.asn1.cms.SignerInfo=function(e){var t=Error,r=fe,n=r.asn1,i=n.DERInteger,a=n.DEROctetString,s=n.DERSequence,o=n.DERTaggedObject,c=n.cms,u=c.SignerIdentifier,f=c.AttributeList,h=(c.ContentType,c.EncapsulatedContentInfo,c.MessageDigest,c.SignedData,n.x509.AlgorithmIdentifier),l=r.crypto,d=Xe;c.SignerInfo.superclass.constructor.call(this),this.params=null,this.sign=function(){var e=this.params,t=e.sigalg,r=new f(e.sattrs).tohex(),n=d.getKey(e.signkey),i=new l.Signature({alg:t});i.init(n),i.updateHex(r);var a=i.sign();e.sighex=a},this.tohex=function(){var e=this.params,r=[];if(r.push(new i({int:e.version})),r.push(new u(e.id)),r.push(new h({name:e.hashalg})),null!=e.sattrs){var n=new f(e.sattrs);try{r.push(new o({tag:"a0",explicit:!1,obj:n}))}catch(e){throw new t("si sattr error: "+e)}}if(null!=e.sigalgfield?r.push(new h({name:e.sigalgfield})):r.push(new h({name:e.sigalg})),null==e.sighex&&null!=e.signkey&&this.sign(),r.push(new a({hex:e.sighex})),null!=e.uattrs){n=new f(e.uattrs);try{r.push(new o({tag:"a1",explicit:!1,obj:n}))}catch(e){throw new t("si uattr error: "+e)}}return new s({array:r}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=e&&this.setByParam(e)},We(fe.asn1.cms.SignerInfo,fe.asn1.ASN1Object),fe.asn1.cms.EncapsulatedContentInfo=function(e){var t=fe.asn1,r=t.DERTaggedObject,n=t.DERSequence,i=t.DERObjectIdentifier,a=t.DEROctetString;t.cms.EncapsulatedContentInfo.superclass.constructor.call(this),this.params=null,this.tohex=function(){var e=this.params,t=[];if(t.push(new i(e.type)),null!=e.content&&(null!=e.content.hex||null!=e.content.str)&&1!=e.isDetached){var s=new a(e.content),o=new r({tag:"a0",explicit:!0,obj:s});t.push(o)}return new n({array:t}).tohex()},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(e){this.params=e},null!=e&&this.setByParam(e)},We(fe.asn1.cms.EncapsulatedContentInfo,fe.asn1.ASN1Object),fe.asn1.cms.ContentInfo=function(e){var t=fe.asn1,r=t.DERTaggedObject,n=t.DERSequence,i=t.DERObjectIdentifier;t.x509.OID.name2obj,fe.asn1.cms.ContentInfo.superclass.constructor.call(this),this.params=null,this.tohex=function(){var e=this.params,t=[];t.push(new i(e.type));var a=new r({tag:"a0",explicit:!0,obj:e.obj});return t.push(a),new n({array:t}).tohex()},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(e){this.params=e},null!=e&&this.setByParam(e)},We(fe.asn1.cms.ContentInfo,fe.asn1.ASN1Object),fe.asn1.cms.SignedData=function(e){Error;var t=fe.asn1,r=(t.ASN1Object,t.DERInteger),n=t.DERSet,i=t.DERSequence,a=(t.DERTaggedObject,t.cms),s=a.EncapsulatedContentInfo,o=a.SignerInfo,c=a.ContentInfo,u=a.CertificateSet,f=a.RevocationInfoChoices,h=t.x509.AlgorithmIdentifier;fe.asn1.cms.SignedData.superclass.constructor.call(this),this.params=null,this.checkAndFixParam=function(){var e=this.params;this._setDigestAlgs(e),this._setContentTypeByEContent(e),this._setMessageDigestByEContent(e),this._setSignerInfoVersion(e),this._setSignedDataVersion(e)},this._setDigestAlgs=function(e){for(var t={},r=e.sinfos,n=0;n<r.length;n++)t[r[n].hashalg]=1;e.hashalgs=Object.keys(t).sort()},this._setContentTypeByEContent=function(e){for(var t=e.econtent.type,r=e.sinfos,n=0;n<r.length;n++){var i=r[n];this._getAttrParamByName(i,"contentType").type=t}},this._setMessageDigestByEContent=function(e){var t=e.econtent,r=(e.econtent.type,t.content.hex);null==r&&"data"==t.type&&null!=t.content.str&&(r=Ae(t.content.str));for(var n=e.sinfos,i=0;i<n.length;i++){var a=n[i],s=a.hashalg,o=this._getAttrParamByName(a,"messageDigest"),c=fe.crypto.Util.hashHex(r,s);o.hex=c}},this._getAttrParamByName=function(e,t){for(var r=e.sattrs.array,n=0;n<r.length;n++)if(r[n].attr==t)return r[n]},this._setSignerInfoVersion=function(e){for(var t=e.sinfos,r=0;r<t.length;r++){var n=t[r],i=1;"skid"==n.id.type&&(i=3),n.version=i}},this._setSignedDataVersion=function(e){var t=this._getSignedDataVersion(e);e.version=t},this._getSignedDataVersion=function(e){if(null!=e.revinfos)for(var t=e.revinfos,r=0;r<t.length;r++)if(null!=t[r].ocsp)return 5;var n=e.sinfos;for(r=0;r<n.length;r++)if(3==e.sinfos[r].version)return 3;return"data"!=e.econtent.type?3:1},this.tohex=function(){var e=this.params;null!=this.getEncodedHexPrepare&&this.getEncodedHexPrepare(),1!=e.fixed&&this.checkAndFixParam();var t=[];t.push(new r({int:e.version}));for(var a=[],c=0;c<e.hashalgs.length;c++){var l=e.hashalgs[c];a.push(new h({name:l}))}t.push(new n({array:a})),t.push(new s(e.econtent)),null!=e.certs&&t.push(new u(e.certs)),null!=e.revinfos&&t.push(new f(e.revinfos));var d=[];for(c=0;c<e.sinfos.length;c++){var p=e.sinfos[c];d.push(new o(p))}return t.push(new n({array:d})),new i({array:t}).tohex()},this.getEncodedHex=function(){return this.tohex()},this.getContentInfo=function(){return new c({type:"signed-data",obj:this})},this.getContentInfoEncodedHex=function(){return this.getContentInfo().tohex()},null!=e&&this.setByParam(e)},We(fe.asn1.cms.SignedData,fe.asn1.ASN1Object),fe.asn1.cms.CertificateSet=function(e){fe.asn1.cms.CertificateSet.superclass.constructor.call(this);var t=Error,r=fe.asn1,n=r.DERTaggedObject,i=r.DERSet,a=r.ASN1Object;this.params=null,this.tohex=function(){var e,r=this.params,s=[];if(r instanceof Array)e=r;else{if(null==r.array)throw new t("cert array not specified");e=r.array}for(var o=0;o<e.length;o++){var c=xe(e[o]),u=new a;u.hTLV=c,s.push(u)}var f={array:s};0==r.sortflag&&(f.sortflag=!1);var h=new i(f);return new n({tag:"a0",explicit:!1,obj:h}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=e&&this.setByParam(e)},We(fe.asn1.cms.CertificateSet,fe.asn1.ASN1Object),fe.asn1.cms.RevocationInfoChoices=function(e){fe.asn1.cms.RevocationInfoChoices.superclass.constructor.call(this),this.params=null,this.tohex=function(){var e=this.params;if(!e instanceof Array)throw new Error("params is not array");for(var t=[],r=0;r<e.length;r++)t.push(new fe.asn1.cms.RevocationInfoChoice(e[r]));return fe.asn1.ASN1Util.newObject({tag:{tagi:"a1",obj:{set:t}}}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=e&&this.setByParam(e)},We(fe.asn1.cms.RevocationInfoChoices,fe.asn1.ASN1Object),fe.asn1.cms.RevocationInfoChoice=function(e){fe.asn1.cms.RevocationInfoChoice.superclass.constructor.call(this),this.params=null,this.tohex=function(){var e=this.params;if(null!=e.crl&&"string"==typeof e.crl){var t=e.crl;return-1!=e.crl.indexOf("-----BEGIN")&&(t=xe(e.crl)),t}if(null!=e.ocsp)return fe.asn1.ASN1Util.newObject({tag:{tagi:"a1",obj:new fe.asn1.cms.OtherRevocationFormat(e)}}).tohex();throw new Error("property crl or ocsp undefined")},this.getEncodedHex=function(){return this.tohex()},null!=e&&this.setByParam(e)},We(fe.asn1.cms.RevocationInfoChoice,fe.asn1.ASN1Object),fe.asn1.cms.OtherRevocationFormat=function(e){fe.asn1.cms.OtherRevocationFormat.superclass.constructor.call(this);var t=Error,r=fe,n=r.asn1.ASN1Util.newObject,i=r.lang.String.isHex;this.params=null,this.tohex=function(){var e=this.params;if(null==e.ocsp)throw new t("property ocsp not specified");if(!i(e.ocsp)||!de.isASN1HEX(e.ocsp))throw new t("ocsp value not ASN.1 hex string");return n({seq:[{oid:"1.3.6.1.5.5.7.16.2"},{asn1:{tlv:e.ocsp}}]}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=e&&this.setByParam(e)},We(fe.asn1.cms.OtherRevocationFormat,fe.asn1.ASN1Object),fe.asn1.cms.CMSUtil=new function(){},fe.asn1.cms.CMSUtil.newSignedData=function(e){return new fe.asn1.cms.SignedData(e)},fe.asn1.cms.CMSUtil.verifySignedData=function(e){var t=fe,r=t.asn1,n=r.cms,i=(n.SignerInfo,n.SignedData,n.SigningTime,n.SigningCertificate,n.SigningCertificateV2,r.cades.SignaturePolicyIdentifier,t.lang.String.isHex),a=de,s=a.getVbyList,o=a.getTLVbyList,c=a.getIdxbyList,u=a.getChildIdx,f=a.getTLV,h=a.oidname,l=t.crypto.Util.hashHex;void 0===e.cms&&i(e.cms);var d=e.cms,p=function(e,t){var r=t.idx;t.signerid_issuer1=o(e,r,[1,0],"30"),t.signerid_serial1=s(e,r,[1,1],"02"),t.hashalg=h(s(e,r,[2,0],"06"));var n=c(e,r,[3],"a0");t.idxSignedAttrs=n,g(e,t,n);var i=u(e,r).length;if(i<6)throw"malformed SignerInfo";t.sigalg=h(s(e,r,[i-2,0],"06")),t.sigval=s(e,r,[i-1],"04")},g=function(e,t,r){var n=u(e,r);t.signedAttrIdxList=n;for(var i=0;i<n.length;i++){var a,o=n[i],c=s(e,o,[0],"06");"2a864886f70d010905"===c?(a=Se(s(e,o,[1,0])),t.saSigningTime=a):"2a864886f70d010904"===c&&(a=s(e,o,[1,0],"04"),t.saMessageDigest=a)}},y=function(e,t,r,n){r.verifyDetail={};var i=r.verifyDetail,a=t.parse.econtent,s=r.hashalg,o=r.saMessageDigest;i.validMessageDigest=!1,l(a,s)===o&&(i.validMessageDigest=!0),function(e,t,r,n){var i,a=t.parse.certsIdx;if(void 0===t.certs){i=[],t.certkeys=[];for(var s=u(e,a),o=0;o<s.length;o++){var c=f(e,s[o]),h=new Ze;h.readCertHex(c),i[o]=h,t.certkeys[o]=h.getPublicKey()}t.certs=i}else i=t.certs;for(t.cccc=i.length,t.cccci=s.length,o=0;o<i.length;o++){var l=h.getIssuerHex(),d=h.getSerialNumberHex();r.signerid_issuer1===l&&r.signerid_serial1===d&&(r.certkey_idx=o)}}(e,t,r),i.validSignatureValue=!1;var c=r.sigalg,h="31"+f(e,r.idxSignedAttrs).substr(2);r.signedattrshex=h;var d=t.certs[r.certkey_idx].getPublicKey(),p=new fe.crypto.Signature({alg:c});p.init(d),p.updateHex(h);var g=p.verify(r.sigval);i.validSignatureValue_isValid=g,!0===g&&(i.validSignatureValue=!0),r.isValid=!1,i.validMessageDigest&&i.validSignatureValue&&(r.isValid=!0)},v={isValid:!1,parse:{}};return function(e,t){if("2a864886f70d010702"!==s(e,0,[0],"06"))return t;t.cmsType="signedData",t.econtent=s(e,0,[1,0,2,1,0]),function(e,t){for(var r,n=3;n<6;n++)if(void 0!==(r=c(e,0,[1,0,n]))){var i=e.substr(r,2);"a0"===i&&(t.certsIdx=r),"a1"===i&&(t.revinfosIdx=r),"31"===i&&(t.signerinfosIdx=r)}}(e,t),t.signerInfos=[],function(e,t){var r=t.signerinfosIdx;if(void 0!==r){var n=u(e,r);t.signerInfoIdxList=n;for(var i=0;i<n.length;i++){var a={idx:n[i]};p(e,a),t.signerInfos.push(a)}}}(e,t)}(d,v.parse),function(e,t){for(var r=t.parse.signerInfos,n=r.length,i=!0,a=0;a<n;a++){var s=r[a];y(e,t,s),s.isValid||(i=!1)}t.isValid=i}(d,v),v},fe.asn1.cms.CMSParser=function(){var e=Error,t=Ze,r=new t,n=de,i=n.getV,a=n.getTLV,s=(n.getIdxbyList,n.getTLVbyList),o=n.getTLVbyListEx,c=n.getVbyList,u=n.getVbyListEx,f=n.getChildIdx;this.getCMSSignedData=function(e){var t=s(e,0,[1,0]);return this.getSignedData(t)},this.getSignedData=function(e){var t=f(e,0),r={},n=i(e,t[0]),s=parseInt(n,16);r.version=s;var c=a(e,t[1]);r.hashalgs=this.getHashAlgArray(c);var u=a(e,t[2]);r.econtent=this.getEContent(u);var h=o(e,0,["[0]"]);null!=h&&(r.certs=this.getCertificateSet(h)),o(e,0,["[1]"]);var l=o(e,0,[3]);return r.sinfos=this.getSignerInfos(l),r},this.getHashAlgArray=function(e){for(var r=f(e,0),n=new t,i=[],s=0;s<r.length;s++){var o=a(e,r[s]),c=n.getAlgorithmIdentifierName(o);i.push(c)}return i},this.getEContent=function(e){var t={},r=c(e,0,[0]),n=c(e,0,[1,0]);return t.type=fe.asn1.x509.OID.oid2name(de.hextooidstr(r)),t.content={hex:n},t},this.getSignerInfos=function(e){for(var t=[],r=f(e,0),n=0;n<r.length;n++){var i=a(e,r[n]),s=this.getSignerInfo(i);t.push(s)}return t},this.getSignerInfo=function(e){var t={},i=f(e,0),s=n.getInt(e,i[0],-1);-1!=s&&(t.version=s);var c=a(e,i[1]),h=this.getIssuerAndSerialNumber(c);t.id=h;var l=a(e,i[2]),d=r.getAlgorithmIdentifierName(l);t.hashalg=d;var p=o(e,0,["[0]"]);if(null!=p){var g=this.getAttributeList(p);t.sattrs=g}var y=o(e,0,[3]),v=r.getAlgorithmIdentifierName(y);t.sigalg=v;var m=u(e,0,[4]);t.sighex=m;var b=o(e,0,["[1]"]);if(null!=b){var w=this.getAttributeList(b);t.uattrs=w}return t},this.getSignerIdentifier=function(e){if("30"==e.substr(0,2))return this.getIssuerAndSerialNumber(e);throw new Error("SKID of signerIdentifier not supported")},this.getIssuerAndSerialNumber=function(e){var t={type:"isssn"},n=f(e,0),s=a(e,n[0]);t.issuer=r.getX500Name(s);var o=i(e,n[1]);return t.serial={hex:o},t},this.getAttributeList=function(e){for(var t=[],r=f(e,0),n=0;n<r.length;n++){var i=a(e,r[n]),s=this.getAttribute(i);t.push(s)}return{array:t}},this.getAttribute=function(e){var t={},r=f(e,0),i=n.getOID(e,r[0]),s=fe.asn1.x509.OID.oid2name(i);t.attr=s;var o=a(e,r[1]),c=f(o,0);if(1==c.length)t.valhex=a(o,c[0]);else{for(var u=[],h=0;h<c.length;h++)u.push(a(o,c[h]));t.valhex=u}return"contentType"==s?this.setContentType(t):"messageDigest"==s?this.setMessageDigest(t):"signingTime"==s?this.setSigningTime(t):"signingCertificate"==s?this.setSigningCertificate(t):"signingCertificateV2"==s?this.setSigningCertificateV2(t):"signaturePolicyIdentifier"==s&&this.setSignaturePolicyIdentifier(t),t},this.setContentType=function(e){var t=n.getOIDName(e.valhex,0,null);null!=t&&(e.type=t,delete e.valhex)},this.setSigningTime=function(e){var t=Se(i(e.valhex,0));e.str=t,delete e.valhex},this.setMessageDigest=function(e){var t=i(e.valhex,0);e.hex=t,delete e.valhex},this.setSigningCertificate=function(e){var t=f(e.valhex,0);if(t.length>0){for(var r=a(e.valhex,t[0]),n=f(r,0),i=[],s=0;s<n.length;s++){var o=a(r,n[s]),c=this.getESSCertID(o);i.push(c)}e.array=i}if(t.length>1){var u=a(e.valhex,t[1]);e.polhex=u}delete e.valhex},this.setSignaturePolicyIdentifier=function(e){var r=f(e.valhex,0);if(r.length>0){var s=n.getOID(e.valhex,r[0]);e.oid=s}if(r.length>1){var o=new t,c=f(e.valhex,r[1]),u=a(e.valhex,c[0]),h=o.getAlgorithmIdentifierName(u);e.alg=h;var l=i(e.valhex,c[1]);e.hash=l}delete e.valhex},this.setSigningCertificateV2=function(e){var t=f(e.valhex,0);if(t.length>0){for(var r=a(e.valhex,t[0]),n=f(r,0),i=[],s=0;s<n.length;s++){var o=a(r,n[s]),c=this.getESSCertIDv2(o);i.push(c)}e.array=i}if(t.length>1){var u=a(e.valhex,t[1]);e.polhex=u}delete e.valhex},this.getESSCertID=function(e){var t={},r=f(e,0);if(r.length>0){var n=i(e,r[0]);t.hash=n}if(r.length>1){var s=a(e,r[1]),o=this.getIssuerSerial(s);null!=o.serial&&(t.serial=o.serial),null!=o.issuer&&(t.issuer=o.issuer)}return t},this.getESSCertIDv2=function(t){var n={},s=f(t,0);if(s.length<1||3<s.length)throw new e("wrong number of elements");var o=0;if("30"==t.substr(s[0],2)){var c=a(t,s[0]);n.alg=r.getAlgorithmIdentifierName(c),o++}else n.alg="sha256";var u=i(t,s[o]);if(n.hash=u,s.length>o+1){var h=a(t,s[o+1]),l=this.getIssuerSerial(h);n.issuer=l.issuer,n.serial=l.serial}return n},this.getIssuerSerial=function(e){var t={},n=f(e,0),s=a(e,n[0]),o=r.getGeneralNames(s)[0].dn;t.issuer=o;var c=i(e,n[1]);return t.serial={hex:c},t},this.getCertificateSet=function(e){for(var t=f(e,0),r=[],n=0;n<t.length;n++){var i=a(e,t[n]);if("30"==i.substr(0,2)){var s=Be(i,"CERTIFICATE");r.push(s)}}return{array:r,sortflag:!1}}},void 0!==fe&&fe||(fe={}),void 0!==fe.asn1&&fe.asn1||(fe.asn1={}),void 0!==fe.asn1.tsp&&fe.asn1.tsp||(fe.asn1.tsp={}),fe.asn1.tsp.TimeStampToken=function(e){var t=fe.asn1.tsp;t.TimeStampToken.superclass.constructor.call(this),this.params=null,this.getEncodedHexPrepare=function(){var e=new t.TSTInfo(this.params.econtent.content);this.params.econtent.content.hex=e.tohex()},null!=e&&this.setByParam(e)},We(fe.asn1.tsp.TimeStampToken,fe.asn1.cms.SignedData),fe.asn1.tsp.TSTInfo=function(e){Error;var t=fe.asn1,r=t.DERSequence,n=t.DERInteger,i=t.DERBoolean,a=t.DERGeneralizedTime,s=t.DERObjectIdentifier,o=t.DERTaggedObject,c=t.tsp,u=c.MessageImprint,f=c.Accuracy,h=(t.x509.X500Name,t.x509.GeneralName);if(c.TSTInfo.superclass.constructor.call(this),this.dVersion=new n({int:1}),this.dPolicy=null,this.dMessageImprint=null,this.dSerial=null,this.dGenTime=null,this.dAccuracy=null,this.dOrdering=null,this.dNonce=null,this.dTsa=null,this.tohex=function(){var e=[this.dVersion];if(null==this.dPolicy)throw new Error("policy shall be specified.");if(e.push(this.dPolicy),null==this.dMessageImprint)throw new Error("messageImprint shall be specified.");if(e.push(this.dMessageImprint),null==this.dSerial)throw new Error("serialNumber shall be specified.");if(e.push(this.dSerial),null==this.dGenTime)throw new Error("genTime shall be specified.");e.push(this.dGenTime),null!=this.dAccuracy&&e.push(this.dAccuracy),null!=this.dOrdering&&e.push(this.dOrdering),null!=this.dNonce&&e.push(this.dNonce),null!=this.dTsa&&e.push(this.dTsa);var t=new r({array:e});return this.hTLV=t.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},void 0!==e){if("string"==typeof e.policy){if(!e.policy.match(/^[0-9.]+$/))throw"policy shall be oid like 0.1.4.134";this.dPolicy=new s({oid:e.policy})}void 0!==e.messageImprint&&(this.dMessageImprint=new u(e.messageImprint)),void 0!==e.serial&&(this.dSerial=new n(e.serial)),void 0!==e.genTime&&(this.dGenTime=new a(e.genTime)),void 0!==e.accuracy&&(this.dAccuracy=new f(e.accuracy)),void 0!==e.ordering&&1==e.ordering&&(this.dOrdering=new i),void 0!==e.nonce&&(this.dNonce=new n(e.nonce)),void 0!==e.tsa&&(this.dTsa=new o({tag:"a0",explicit:!0,obj:new h({dn:e.tsa})}))}},We(fe.asn1.tsp.TSTInfo,fe.asn1.ASN1Object),fe.asn1.tsp.Accuracy=function(e){var t=fe.asn1,r=t.ASN1Util.newObject;t.tsp.Accuracy.superclass.constructor.call(this),this.params=null,this.tohex=function(){var e=this.params,t=[];return null!=e.seconds&&"number"==typeof e.seconds&&t.push({int:e.seconds}),null!=e.millis&&"number"==typeof e.millis&&t.push({tag:{tagi:"80",obj:{int:e.millis}}}),null!=e.micros&&"number"==typeof e.micros&&t.push({tag:{tagi:"81",obj:{int:e.micros}}}),r({seq:t}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=e&&this.setByParam(e)},We(fe.asn1.tsp.Accuracy,fe.asn1.ASN1Object),fe.asn1.tsp.MessageImprint=function(e){var t=fe.asn1,r=t.DERSequence,n=t.DEROctetString,i=t.x509.AlgorithmIdentifier;t.tsp.MessageImprint.superclass.constructor.call(this),this.params=null,this.tohex=function(){var e=this.params,t=new i({name:e.alg}),a=new n({hex:e.hash});return new r({array:[t,a]}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==e&&this.setByParam(e)},We(fe.asn1.tsp.MessageImprint,fe.asn1.ASN1Object),fe.asn1.tsp.TimeStampReq=function(e){var t=fe.asn1,r=t.DERSequence,n=t.DERInteger,i=t.DERBoolean,a=(t.ASN1Object,t.DERObjectIdentifier),s=t.tsp,o=s.MessageImprint;s.TimeStampReq.superclass.constructor.call(this),this.params=null,this.tohex=function(){var e=this.params,t=[];return t.push(new n({int:1})),e.messageImprint instanceof fe.asn1.ASN1Object?t.push(e.messageImprint):t.push(new o(e.messageImprint)),null!=e.policy&&t.push(new a(e.policy)),null!=e.nonce&&t.push(new n(e.nonce)),1==e.certreq&&t.push(new i),new r({array:t}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=e&&this.setByParam(e)},We(fe.asn1.tsp.TimeStampReq,fe.asn1.ASN1Object),fe.asn1.tsp.TimeStampResp=function(e){var t=fe.asn1,r=t.DERSequence,n=(t.ASN1Object,t.tsp),i=n.PKIStatusInfo;n.TimeStampResp.superclass.constructor.call(this),this.params=null,this.tohex=function(){var e=this.params,a=[];if(null!=e.econtent||null!=e.tst)if(null!=e.statusinfo?a.push(new i(e.statusinfo)):a.push(new i("granted")),null!=e.econtent)a.push(new n.TimeStampToken(e).getContentInfo());else{if(!(e.tst instanceof t.ASN1Object))throw new Error("improper member tst value");a.push(e.tst)}else{if(null==e.statusinfo)throw new Error("parameter for token nor statusinfo not specified");a.push(new i(e.statusinfo))}return new r({array:a}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=e&&this.setByParam(e)},We(fe.asn1.tsp.TimeStampResp,fe.asn1.ASN1Object),fe.asn1.tsp.PKIStatusInfo=function(e){var t=Error,r=fe.asn1,n=r.DERSequence,i=r.tsp,a=i.PKIStatus,s=i.PKIFreeText,o=i.PKIFailureInfo;i.PKIStatusInfo.superclass.constructor.call(this),this.params=null,this.tohex=function(){var e=this.params,r=[];if("string"==typeof e)r.push(new a(e));else{if(null==e.status)throw new t("property 'status' unspecified");r.push(new a(e.status)),null!=e.statusstr&&r.push(new s(e.statusstr)),null!=e.failinfo&&r.push(new o(e.failinfo))}return new n({array:r}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=e&&this.setByParam(e)},We(fe.asn1.tsp.PKIStatusInfo,fe.asn1.ASN1Object),fe.asn1.tsp.PKIStatus=function(e){var t=Error,r=fe.asn1,n=r.DERInteger;r.tsp.PKIStatus.superclass.constructor.call(this);var i={granted:0,grantedWithMods:1,rejection:2,waiting:3,revocationWarning:4,revocationNotification:5};this.params=null,this.tohex=function(){var e,r=this.params;if("string"==typeof r)try{e=i[r]}catch(e){throw new t("undefined name: "+r)}else{if("number"!=typeof r)throw new t("unsupported params");e=r}return new n({int:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=e&&this.setByParam(e)},We(fe.asn1.tsp.PKIStatus,fe.asn1.ASN1Object),fe.asn1.tsp.PKIFreeText=function(e){var t=Error,r=fe.asn1,n=r.DERSequence,i=r.DERUTF8String;r.tsp.PKIFreeText.superclass.constructor.call(this),this.params=null,this.tohex=function(){var e=this.params;if(!e instanceof Array)throw new t("wrong params: not array");for(var r=[],a=0;a<e.length;a++)r.push(new i({str:e[a]}));return new n({array:r}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=e&&this.setByParam(e)},We(fe.asn1.tsp.PKIFreeText,fe.asn1.ASN1Object),fe.asn1.tsp.PKIFailureInfo=function(e){var t=Error,r=fe.asn1,n=r.DERBitString,i=r.tsp.PKIFailureInfo,a={badAlg:0,badRequest:2,badDataFormat:5,timeNotAvailable:14,unacceptedPolicy:15,unacceptedExtension:16,addInfoNotAvailable:17,systemFailure:25};i.superclass.constructor.call(this),this.params=null,this.getBinValue=function(){var e=this.params,r=0;if("number"==typeof e&&0<=e&&e<=25){for(var n=(r|=1<<e).toString(2),i="",s=n.length-1;s>=0;s--)i+=n[s];return i}if("string"==typeof e&&null!=a[e])return qe([e],a);if("object"==typeof e&&null!=e.length)return qe(e,a);throw new t("wrong params")},this.tohex=function(){this.params;var e=this.getBinValue();return new n({bin:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=e&&this.setByParam(e)},We(fe.asn1.tsp.PKIFailureInfo,fe.asn1.ASN1Object),fe.asn1.tsp.AbstractTSAAdapter=function(e){this.getTSTHex=function(e,t){throw"not implemented yet"}},fe.asn1.tsp.SimpleTSAAdapter=function(e){var t=fe,r=t.asn1.tsp,n=t.crypto.Util.hashHex;r.SimpleTSAAdapter.superclass.constructor.call(this),this.params=null,this.serial=0,this.getTSTHex=function(e,t){var i=n(e,t);this.params.econtent.content.messageImprint={alg:t,hash:i},this.params.econtent.content.serial={int:this.serial++};var a=Math.floor(1e9*Math.random());return this.params.econtent.content.nonce={int:a},new r.TimeStampToken(this.params).getContentInfoEncodedHex()},void 0!==e&&(this.params=e)},We(fe.asn1.tsp.SimpleTSAAdapter,fe.asn1.tsp.AbstractTSAAdapter),fe.asn1.tsp.FixedTSAAdapter=function(e){var t=fe,r=t.asn1.tsp,n=t.crypto.Util.hashHex;r.FixedTSAAdapter.superclass.constructor.call(this),this.params=null,this.getTSTHex=function(e,t){var i=n(e,t);return this.params.econtent.content.messageImprint={alg:t,hash:i},new r.TimeStampToken(this.params).getContentInfoEncodedHex()},void 0!==e&&(this.params=e)},We(fe.asn1.tsp.FixedTSAAdapter,fe.asn1.tsp.AbstractTSAAdapter),fe.asn1.tsp.TSPUtil=new function(){},fe.asn1.tsp.TSPUtil.newTimeStampToken=function(e){return new fe.asn1.tsp.TimeStampToken(e)},fe.asn1.tsp.TSPUtil.parseTimeStampReq=function(e){return(new fe.asn1.tsp.TSPParser).getTimeStampReq(e)},fe.asn1.tsp.TSPUtil.parseMessageImprint=function(e){return(new fe.asn1.tsp.TSPParser).getMessageImprint(e)},fe.asn1.tsp.TSPParser=function(){Error;var e=new Ze,t=de,r=t.getV,n=t.getTLV,i=t.getIdxbyList,a=(t.getTLVbyListEx,t.getChildIdx),s=["granted","grantedWithMods","rejection","waiting","revocationWarning","revocationNotification"],o={0:"badAlg",2:"badRequest",5:"badDataFormat",14:"timeNotAvailable",15:"unacceptedPolicy",16:"unacceptedExtension",17:"addInfoNotAvailable",25:"systemFailure"};this.getResponse=function(e){var t=a(e,0);if(1==t.length)return this.getPKIStatusInfo(n(e,t[0]));if(t.length>1){var r=this.getPKIStatusInfo(n(e,t[0])),i=n(e,t[1]),s=this.getToken(i);return s.statusinfo=r,s}},this.getToken=function(e){var t=(new fe.asn1.cms.CMSParser).getCMSSignedData(e);return this.setTSTInfo(t),t},this.setTSTInfo=function(e){var t=e.econtent;if("tstinfo"==t.type){var r=t.content.hex,n=this.getTSTInfo(r);t.content=n}},this.getTSTInfo=function(t){var i={},s=a(t,0),o=r(t,s[1]);i.policy=He(o);var c=n(t,s[2]);i.messageImprint=this.getMessageImprint(c);var u=r(t,s[3]);i.serial={hex:u};var f=r(t,s[4]);i.genTime={str:Se(f)};var h=0;if(s.length>5&&"30"==t.substr(s[5],2)){var l=n(t,s[5]);i.accuracy=this.getAccuracy(l),h++}if(s.length>5+h&&"01"==t.substr(s[5+h],2)&&("ff"==r(t,s[5+h])&&(i.ordering=!0),h++),s.length>5+h&&"02"==t.substr(s[5+h],2)){var d=r(t,s[5+h]);i.nonce={hex:d},h++}if(s.length>5+h&&"a0"==t.substr(s[5+h],2)){var p=n(t,s[5+h]);p="30"+p.substr(2),pGeneralNames=e.getGeneralNames(p);var g=pGeneralNames[0].dn;i.tsa=g,h++}if(s.length>5+h&&"a1"==t.substr(s[5+h],2)){var y=n(t,s[5+h]);y="30"+y.substr(2);var v=e.getExtParamArray(y);i.ext=v,h++}return i},this.getAccuracy=function(e){for(var t={},n=a(e,0),i=0;i<n.length;i++){var s=e.substr(n[i],2),o=r(e,n[i]),c=parseInt(o,16);"02"==s?t.seconds=c:"80"==s?t.millis=c:"81"==s&&(t.micros=c)}return t},this.getMessageImprint=function(e){if("30"!=e.substr(0,2))throw new Error("head of messageImprint hex shall be x30");var n={},s=(a(e,0),i(e,0,[0,0])),o=r(e,s),c=t.hextooidstr(o),u=fe.asn1.x509.OID.oid2name(c);if(""==u)throw new Error("hashAlg name undefined: "+c);var f=u,h=i(e,0,[1]);return n.alg=f,n.hash=r(e,h),n},this.getPKIStatusInfo=function(e){var t={},i=a(e,0),o=0;try{var c=r(e,i[0]),u=parseInt(c,16);t.status=s[u]}catch(e){}if(i.length>1&&"30"==e.substr(i[1],2)){var f=n(e,i[1]);t.statusstr=this.getPKIFreeText(f),o++}if(i.length>o&&"03"==e.substr(i[1+o],2)){var h=n(e,i[1+o]);t.failinfo=this.getPKIFailureInfo(h)}return t},this.getPKIFreeText=function(e){for(var r=[],n=a(e,0),i=0;i<n.length;i++)r.push(t.getString(e,n[i]));return r},this.getPKIFailureInfo=function(e){var r=t.getInt(e,0);return null!=o[r]?o[r]:r},this.getTimeStampReq=function(e){var i={certreq:!1},s=a(e,0);if(s.length<2)throw new Error("TimeStampReq must have at least 2 items");var o=n(e,s[1]);i.messageImprint=fe.asn1.tsp.TSPUtil.parseMessageImprint(o);for(var c=2;c<s.length;c++){var u=s[c],f=e.substr(u,2);if("06"==f){var h=r(e,u);i.policy=t.hextooidstr(h)}"02"==f&&(i.nonce=r(e,u)),"01"==f&&(i.certreq=!0)}return i}},void 0!==fe&&fe||(fe={}),void 0!==fe.asn1&&fe.asn1||(fe.asn1={}),void 0!==fe.asn1.cades&&fe.asn1.cades||(fe.asn1.cades={}),fe.asn1.cades.SignaturePolicyIdentifier=function(e){var t=fe.asn1.cades,r=t.SignaturePolicyId;t.SignaturePolicyIdentifier.superclass.constructor.call(this),this.typeOid="1.2.840.113549.1.9.16.2.15",this.params=null,this.getValueArray=function(){return[new r(this.params)]},this.setByParam=function(e){this.params=e},null!=e&&this.setByParam(e)},We(fe.asn1.cades.SignaturePolicyIdentifier,fe.asn1.cms.Attribute),fe.asn1.cades.SignaturePolicyId=function(e){var t=fe.asn1,r=t.DERSequence,n=t.DERObjectIdentifier,i=(t.x509.AlgorithmIdentifier,t.cades),a=i.SignaturePolicyId,s=i.OtherHashAlgAndValue;a.superclass.constructor.call(this),this.params=null,this.tohex=function(){var e=this.params,t=[];return t.push(new n(e.oid)),t.push(new s(e)),new r({array:t}).tohex()},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(e){this.params=e},null!=e&&this.setByParam(e)},We(fe.asn1.cades.SignaturePolicyId,fe.asn1.ASN1Object),fe.asn1.cades.OtherHashAlgAndValue=function(e){var t=Error,r=fe.asn1,n=r.DERSequence,i=r.DEROctetString,a=r.x509.AlgorithmIdentifier;r.cades.OtherHashAlgAndValue.superclass.constructor.call(this),this.params=null,this.tohex=function(){var e=this.params;if(null==e.alg)throw new t("property 'alg' not specified");if(null==e.hash&&null==e.cert)throw new t("property 'hash' nor 'cert' not specified");var r=null;if(null!=e.hash)r=e.hash;else if(null!=e.cert){if("string"!=typeof e.cert)throw new t("cert not string");var s=e.cert;-1!=e.cert.indexOf("-----BEGIN")&&(s=xe(e.cert)),r=fe.crypto.Util.hashHex(s,e.alg)}var o=[];return o.push(new a({name:e.alg})),o.push(new i({hex:r})),new n({array:o}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=e&&this.setByParam(e)},We(fe.asn1.cades.OtherHashAlgAndValue,fe.asn1.ASN1Object),fe.asn1.cades.OtherHashValue=function(e){fe.asn1.cades.OtherHashValue.superclass.constructor.call(this);var t=Error,r=fe,n=(r.lang.String.isHex,r.asn1.DEROctetString);r.crypto.Util.hashHex,this.params=null,this.tohex=function(){var e=this.params;if(null==e.hash&&null==e.cert)throw new t("hash or cert not specified");var r=null;if(null!=e.hash)r=e.hash;else if(null!=e.cert){if("string"!=typeof e.cert)throw new t("cert not string");var i=e.cert;-1!=e.cert.indexOf("-----BEGIN")&&(i=xe(e.cert)),r=fe.crypto.Util.hashHex(i,"sha1")}return new n({hex:r}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=e&&this.setByParam(e)},We(fe.asn1.cades.OtherHashValue,fe.asn1.ASN1Object),fe.asn1.cades.SignatureTimeStamp=function(e){var t=Error,r=fe,n=r.lang.String.isHex,i=r.asn1,a=i.ASN1Object;i.x509,i.cades.SignatureTimeStamp.superclass.constructor.call(this),this.typeOid="1.2.840.113549.1.9.16.2.14",this.params=null,this.getValueArray=function(){var e=this.params;if(null!=e.tst){if(n(e.tst))return(r=new a).hTLV=e.tst,[r];if(e.tst instanceof a)return[e.tst];throw new t("params.tst has wrong value")}if(null!=e.res){var r,i=e.res;if(i instanceof a&&(i=i.tohex()),"string"!=typeof i||!n(i))throw new t("params.res has wrong value");return de.getTLVbyList(i,0,[1]),(r=new a).hTLV=e.tst,[r]}},null!=e&&this.setByParam(e)},We(fe.asn1.cades.SignatureTimeStamp,fe.asn1.cms.Attribute),fe.asn1.cades.CompleteCertificateRefs=function(e){var t=Error,r=fe,n=r.asn1,i=n.DERSequence,a=n.cades,s=a.OtherCertID,o=r.lang.String.isHex;a.CompleteCertificateRefs.superclass.constructor.call(this),this.typeOid="1.2.840.113549.1.9.16.2.21",this.params=null,this.getValueArray=function(){for(var e=this.params,r=[],n=0;n<e.array.length;n++){var a=e.array[n];if("string"==typeof a)if(-1!=a.indexOf("-----BEGIN"))a={cert:a};else{if(!o(a))throw new t("unsupported value: "+a);a={hash:a}}null!=e.alg&&null==a.alg&&(a.alg=e.alg),null!=e.hasis&&null==a.hasis&&(a.hasis=e.hasis);var c=new s(a);r.push(c)}return[new i({array:r})]},null!=e&&this.setByParam(e)},We(fe.asn1.cades.CompleteCertificateRefs,fe.asn1.cms.Attribute),fe.asn1.cades.OtherCertID=function(e){var t=fe.asn1,r=t.DERSequence,n=t.cms.IssuerSerial,i=t.cades,a=i.OtherHashValue,s=i.OtherHashAlgAndValue;i.OtherCertID.superclass.constructor.call(this),this.params=e,this.tohex=function(){var e=this.params;"string"==typeof e&&(-1!=e.indexOf("-----BEGIN")?e={cert:e}:_isHex(e)&&(e={hash:e}));var t,i=[];if(t=null!=e.alg?new s(e):new a(e),i.push(t),null!=e.cert&&1==e.hasis||null!=e.issuer&&null!=e.serial){var o=new n(e);i.push(o)}return new r({array:i}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=e&&this.setByParam(e)},We(fe.asn1.cades.OtherCertID,fe.asn1.ASN1Object),fe.asn1.cades.OtherHash=function(e){Error;var t=fe,r=t.asn1,n=(r.cms,r.cades),i=n.OtherHashAlgAndValue,a=n.OtherHashValue,s=(t.crypto.Util.hashHex,t.lang.String.isHex);n.OtherHash.superclass.constructor.call(this),this.params=null,this.tohex=function(){var e=this.params;return"string"==typeof e&&(-1!=e.indexOf("-----BEGIN")?e={cert:e}:s(e)&&(e={hash:e})),(null!=e.alg?new i(e):new a(e)).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=e&&this.setByParam(e)},We(fe.asn1.cades.OtherHash,fe.asn1.ASN1Object),fe.asn1.cades.CAdESUtil=new function(){},fe.asn1.cades.CAdESUtil.parseSignedDataForAddingUnsigned=function(e){return(new fe.asn1.cms.CMSParser).getCMSSignedData(e)},fe.asn1.cades.CAdESUtil.parseSignerInfoForAddingUnsigned=function(e,t,r){var n=de,i=n.getChildIdx,a=n.getTLV,s=n.getV,o=fe.asn1,c=o.ASN1Object,u=o.cms,f=u.AttributeList,h=u.SignerInfo,l={},d=i(e,t);if(6!=d.length)throw"not supported items for SignerInfo (!=6)";var p=d.shift();l.version=a(e,p);var g=d.shift();l.si=a(e,g);var y=d.shift();l.digalg=a(e,y);var v=d.shift();l.sattrs=a(e,v);var m=d.shift();l.sigalg=a(e,m);var b=d.shift();l.sig=a(e,b),l.sigval=s(e,b);var w=null;return l.obj=new h,(w=new c).hTLV=l.version,l.obj.dCMSVersion=w,(w=new c).hTLV=l.si,l.obj.dSignerIdentifier=w,(w=new c).hTLV=l.digalg,l.obj.dDigestAlgorithm=w,(w=new c).hTLV=l.sattrs,l.obj.dSignedAttrs=w,(w=new c).hTLV=l.sigalg,l.obj.dSigAlg=w,(w=new c).hTLV=l.sig,l.obj.dSig=w,l.obj.dUnsignedAttrs=new f,l},void 0!==fe.asn1.csr&&fe.asn1.csr||(fe.asn1.csr={}),fe.asn1.csr.CertificationRequest=function(e){var t=fe.asn1,r=t.DERBitString,n=t.DERSequence,i=t.csr,a=(t.x509,i.CertificationRequestInfo);i.CertificationRequest.superclass.constructor.call(this),this.setByParam=function(e){this.params=e},this.sign=function(){var e=new a(this.params).tohex(),t=new fe.crypto.Signature({alg:this.params.sigalg});t.init(this.params.sbjprvkey),t.updateHex(e);var r=t.sign();this.params.sighex=r},this.getPEM=function(){return Be(this.tohex(),"CERTIFICATE REQUEST")},this.tohex=function(){var e=this.params,t=new fe.asn1.csr.CertificationRequestInfo(this.params),i=new fe.asn1.x509.AlgorithmIdentifier({name:e.sigalg});if(null==e.sighex&&null!=e.sbjprvkey&&this.sign(),null==e.sighex)throw new Error("sighex or sbjprvkey parameter not defined");var a=new r({hex:"00"+e.sighex});return new n({array:[t,i,a]}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==e&&this.setByParam(e)},We(fe.asn1.csr.CertificationRequest,fe.asn1.ASN1Object),fe.asn1.csr.CertificationRequestInfo=function(e){var t=fe.asn1,r=(t.DERBitString,t.DERSequence),n=t.DERInteger,i=t.DERUTF8String,a=t.DERTaggedObject,s=t.ASN1Util.newObject,o=t.csr,c=t.x509,u=c.X500Name,f=c.Extensions,h=c.SubjectPublicKeyInfo;o.AttributeList,o.CertificationRequestInfo.superclass.constructor.call(this),this.params=null,this.setByParam=function(e){null!=e&&(this.params=e)},this.tohex=function(){var e=this.params,t=[];if(t.push(new n({int:0})),t.push(new u(e.subject)),t.push(new h(Xe.getKey(e.sbjpubkey))),null!=e.attrs){var o=function(e){for(var t=Error,r=fe.asn1.x509.Extensions,n=[],i=0;i<e.length;i++){var a=e[i],s=a.attr;if("extensionRequest"==s){var o={seq:[{oid:"1.2.840.113549.1.9.14"},{set:[new r(a.ext)]}]};n.push(o)}else if("unstructuredName"==s)o={seq:[{oid:"1.2.840.113549.1.9.2"},{set:a.names}]},n.push(o);else{if("challengePassword"!=s)throw new t("unknown CSR attribute");o={seq:[{oid:"1.2.840.113549.1.9.7"},{set:[{utf8str:a.password}]}]},n.push(o)}}return{set:n}}(e.attrs),c=s({tag:{tage:"a0",obj:o}});t.push(c)}else if(null!=e.extreq){var l=new f(e.extreq);c=s({tag:{tage:"a0",obj:{seq:[{oid:"1.2.840.113549.1.9.14"},{set:[l]}]}}}),t.push(c)}else t.push(new a({tag:"a0",explicit:!1,obj:new i({str:""})}));return new r({array:t}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=e&&this.setByParam(e)},We(fe.asn1.csr.CertificationRequestInfo,fe.asn1.ASN1Object),fe.asn1.csr.AttributeList=function(e){},We(fe.asn1.csr.AttributeList,fe.asn1.ASN1Object),fe.asn1.csr.CSRUtil=new function(){},fe.asn1.csr.CSRUtil.newCSRPEM=function(e){return new fe.asn1.csr.CertificationRequest(e).getPEM()},fe.asn1.csr.CSRUtil.getParam=function(e,t){var r=de,n=r.getV,i=r.getIdxbyList,a=r.getTLVbyList,s=r.getTLVbyListEx,o=r.getVbyListEx,c={};if(-1==e.indexOf("-----BEGIN CERTIFICATE REQUEST"))throw new Error("argument is not PEM file");var u=xe(e,"CERTIFICATE REQUEST");t&&(c.tbs=a(u,0,[0]));try{var f=s(u,0,[0,1]);if("3000"==f)c.subject={};else{var h=new Ze;c.subject=h.getX500Name(f)}}catch(e){}var l=s(u,0,[0,2]),d=Xe.getKey(l,null,"pkcs8pub");c.sbjpubkey=Xe.getPEM(d,"PKCS8PUB");var p=function(e){var t=i(e,0,[0,3,0,0],"06");return"2a864886f70d01090e"!=n(e,t)?null:a(e,0,[0,3,0,1,0],"30")}(u);h=new Ze,null!=p&&(c.extreq=h.getExtParamArray(p));try{var g=s(u,0,[1],"30");h=new Ze,c.sigalg=h.getAlgorithmIdentifierName(g)}catch(e){}try{var y=o(u,0,[2]);c.sighex=y}catch(e){}return c},fe.asn1.csr.CSRUtil.verifySignature=function(e){try{var t=null;if("string"==typeof e&&-1!=e.indexOf("-----BEGIN CERTIFICATE REQUEST")?t=fe.asn1.csr.CSRUtil.getParam(e,!0):"object"==typeof e&&null!=e.sbjpubkey&&null!=e.sigalg&&null!=e.sighex&&null!=e.tbs&&(t=e),null==t)return!1;var r=new fe.crypto.Signature({alg:t.sigalg});return r.init(t.sbjpubkey),r.updateHex(t.tbs),r.verify(t.sighex)}catch(e){return alert(e),!1}},void 0!==fe&&fe||(fe={}),void 0!==fe.asn1&&fe.asn1||(fe.asn1={}),void 0!==fe.asn1.ocsp&&fe.asn1.ocsp||(fe.asn1.ocsp={}),fe.asn1.ocsp.DEFAULT_HASH="sha1",fe.asn1.ocsp.OCSPResponse=function(e){fe.asn1.ocsp.OCSPResponse.superclass.constructor.call(this),fe.asn1.DEREnumerated;var t=fe.asn1.ASN1Util.newObject,r=fe.asn1.ocsp.ResponseBytes,n=["successful","malformedRequest","internalError","tryLater","_not_used_","sigRequired","unauthorized"];this.params=null,this._getStatusCode=function(){var e=this.params.resstatus;return"number"==typeof e?e:"string"!=typeof e?-1:n.indexOf(e)},this.setByParam=function(e){this.params=e},this.tohex=function(){var e=this.params,n=this._getStatusCode();if(-1==n)throw new Error("responseStatus not supported: "+e.resstatus);if(0!=n)return t({seq:[{enum:{int:n}}]}).tohex();var i=new r(e);return t({seq:[{enum:{int:0}},{tag:{tag:"a0",explicit:!0,obj:i}}]}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==e&&this.setByParam(e)},We(fe.asn1.ocsp.OCSPResponse,fe.asn1.ASN1Object),fe.asn1.ocsp.ResponseBytes=function(e){fe.asn1.ocsp.ResponseBytes.superclass.constructor.call(this);var t=fe.asn1,r=t.DERSequence,n=t.DERObjectIdentifier,i=t.DEROctetString,a=t.ocsp.BasicOCSPResponse;this.params=null,this.setByParam=function(e){this.params=e},this.tohex=function(){var e=this.params;if("ocspBasic"!=e.restype)throw new Error("not supported responseType: "+e.restype);var t=new a(e),s=[];return s.push(new n({name:"ocspBasic"})),s.push(new i({hex:t.tohex()})),new r({array:s}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==e&&this.setByParam(e)},We(fe.asn1.ocsp.ResponseBytes,fe.asn1.ASN1Object),fe.asn1.ocsp.BasicOCSPResponse=function(e){fe.asn1.ocsp.BasicOCSPResponse.superclass.constructor.call(this);var t=Error,r=fe.asn1,n=r.ASN1Object,i=r.DERSequence,a=(r.DERGeneralizedTime,r.DERTaggedObject),s=r.DERBitString,o=(r.x509.Extensions,r.x509.AlgorithmIdentifier),c=r.ocsp;c.ResponderID,_SingleResponseList=c.SingleResponseList,_ResponseData=c.ResponseData,this.params=null,this.setByParam=function(e){this.params=e},this.sign=function(){var e=this.params,t=e.tbsresp.tohex(),r=new fe.crypto.Signature({alg:e.sigalg});r.init(e.reskey),r.updateHex(t),e.sighex=r.sign()},this.tohex=function(){var e=this.params;null==e.tbsresp&&(e.tbsresp=new _ResponseData(e)),null==e.sighex&&null!=e.reskey&&this.sign();var r=[];if(r.push(e.tbsresp),r.push(new o({name:e.sigalg})),r.push(new s({hex:"00"+e.sighex})),null!=e.certs&&null!=e.certs.length){for(var c=[],u=0;u<e.certs.length;u++){var f=e.certs[u],h=null;if(de.isASN1HEX(f))h=f;else{if(!f.match(/-----BEGIN/))throw new t("certs["+u+"] not hex or PEM");h=xe(f)}c.push(new n({tlv:h}))}var l=new i({array:c});r.push(new a({tag:"a0",explicit:!0,obj:l}))}return new i({array:r}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==e&&this.setByParam(e)},We(fe.asn1.ocsp.BasicOCSPResponse,fe.asn1.ASN1Object),fe.asn1.ocsp.ResponseData=function(e){fe.asn1.ocsp.ResponseData.superclass.constructor.call(this);var t=Error,r=fe.asn1,n=r.DERSequence,i=r.DERGeneralizedTime,a=r.DERTaggedObject,s=r.x509.Extensions,o=r.ocsp,c=o.ResponderID;_SingleResponseList=o.SingleResponseList,this.params=null,this.tohex=function(){var e=this.params;null!=e.respid&&new t("respid not specified"),null!=e.prodat&&new t("prodat not specified"),null!=e.array&&new t("array not specified");var r=[];if(r.push(new c(e.respid)),r.push(new i(e.prodat)),r.push(new _SingleResponseList(e.array)),null!=e.ext){var o=new s(e.ext);r.push(new a({tag:"a1",explicit:!0,obj:o}))}return new n({array:r}).tohex()},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(e){this.params=e},void 0!==e&&this.setByParam(e)},We(fe.asn1.ocsp.ResponseData,fe.asn1.ASN1Object),fe.asn1.ocsp.ResponderID=function(e){fe.asn1.ocsp.ResponderID.superclass.constructor.call(this);var t=fe,r=t.asn1,n=r.ASN1Util.newObject,i=r.x509.X500Name,a=t.lang.String.isHex,s=Error;this.params=null,this.tohex=function(){var e=this.params;if(null!=e.key){var t,r=null;if("string"==typeof e.key?(a(e.key)&&(r=e.key),e.key.match(/-----BEGIN CERTIFICATE/)&&null!=(t=new Ze(e.key).getExtSubjectKeyIdentifier())&&(r=t.kid.hex)):e.key instanceof Ze&&null!=(t=e.key.getExtSubjectKeyIdentifier())&&(r=t.kid.hex),null==r)throw new s("wrong key member value");return n({tag:{tag:"a2",explicit:!0,obj:{octstr:{hex:r}}}}).tohex()}if(null!=e.name){var o=null;if("string"==typeof e.name&&e.name.match(/-----BEGIN CERTIFICATE/)?o=new Ze(e.name).getSubject():e.name instanceof Ze?o=e.name.getSubject():"object"!=typeof e.name||null==e.name.array&&null==e.name.str||(o=e.name),null==o)throw new s("wrong name member value");return n({tag:{tag:"a1",explicit:!0,obj:new i(o)}}).tohex()}throw new s("key or name not specified")},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(e){this.params=e},void 0!==e&&this.setByParam(e)},We(fe.asn1.ocsp.ResponderID,fe.asn1.ASN1Object),fe.asn1.ocsp.SingleResponseList=function(e){fe.asn1.ocsp.SingleResponseList.superclass.constructor.call(this);var t=fe.asn1,r=t.DERSequence,n=t.ocsp.SingleResponse;this.params=null,this.tohex=function(){var e=this.params;if("object"!=typeof e||null==e.length)throw new Error("params not specified properly");for(var t=[],i=0;i<e.length;i++)t.push(new n(e[i]));return new r({array:t}).tohex()},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(e){this.params=e},void 0!==e&&this.setByParam(e)},We(fe.asn1.ocsp.SingleResponseList,fe.asn1.ASN1Object),fe.asn1.ocsp.SingleResponse=function(e){var t=Error,r=fe.asn1,n=r.DERSequence,i=r.DERGeneralizedTime,a=r.DERTaggedObject,s=r.ocsp,o=s.CertID,c=s.CertStatus,u=r.x509.Extensions;s.SingleResponse.superclass.constructor.call(this),this.params=null,this.tohex=function(){var e=this.params,r=[];if(null==e.certid)throw new t("certid unspecified");if(null==e.status)throw new t("status unspecified");if(null==e.thisupdate)throw new t("thisupdate unspecified");if(r.push(new o(e.certid)),r.push(new c(e.status)),r.push(new i(e.thisupdate)),null!=e.nextupdate){var s=new i(e.nextupdate);r.push(new a({tag:"a0",explicit:!0,obj:s}))}if(null!=e.ext){var f=new u(e.ext);r.push(new a({tag:"a1",explicit:!0,obj:f}))}return new n({array:r}).tohex()},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(e){this.params=e},void 0!==e&&this.setByParam(e)},We(fe.asn1.ocsp.SingleResponse,fe.asn1.ASN1Object),fe.asn1.ocsp.CertID=function(e){var t=fe,r=t.asn1,n=r.DEROctetString,i=r.DERInteger,a=r.DERSequence,s=r.x509.AlgorithmIdentifier,o=r.ocsp,c=(o.DEFAULT_HASH,t.crypto.Util.hashHex),u=Ze,f=de.getVbyList;o.CertID.superclass.constructor.call(this),this.DEFAULT_HASH="sha1",this.params=null,this.setByValue=function(e,t,r,n){null==n&&(n=this.DEFAULT_HASH),this.params={alg:n,issname:e,isskey:t,sbjsn:r}},this.setByCert=function(e,t,r){null==r&&(r=this.DEFAULT_HASH),this.params={alg:r,issuerCert:e,subjectCert:t}},this.getParamByCerts=function(e,t,r){null==r&&(r=this.DEFAULT_HASH);var n=new u(e),i=new u(t),a=c(n.getSubjectHex(),r),s=n.getPublicKeyHex();return{alg:r,issname:a,isskey:c(f(s,0,[1],"03",!0),r),sbjsn:i.getSerialNumberHex()}},this.tohex=function(){if("object"!=typeof this.params)throw new Error("params not set");var e,t,r,o,c=this.params;if(o=null==c.alg?this.DEFAULT_HASH:c.alg,null!=c.issuerCert&&null!=c.subjectCert){var u=this.getParamByCerts(c.issuerCert,c.subjectCert,o);e=u.issname,t=u.isskey,r=u.sbjsn}else{if(null==c.issname||null==c.isskey||null==c.sbjsn)throw new Error("required param members not defined");e=c.issname,t=c.isskey,r=c.sbjsn}var f=new s({name:o}),h=new n({hex:e}),l=new n({hex:t}),d=new i({hex:r}),p=new a({array:[f,h,l,d]});return this.hTLV=p.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},void 0!==e&&this.setByParam(e)},We(fe.asn1.ocsp.CertID,fe.asn1.ASN1Object),fe.asn1.ocsp.CertStatus=function(e){fe.asn1.ocsp.CertStatus.superclass.constructor.call(this),this.params=null,this.tohex=function(){var e=this.params;if("good"==e.status)return"8000";if("unknown"==e.status)return"8200";if("revoked"==e.status){var t=[{gentime:{str:e.time}}];null!=e.reason&&t.push({tag:{tag:"a0",explicit:!0,obj:{enum:{int:e.reason}}}});var r={tag:"a1",explicit:!1,obj:{seq:t}};return fe.asn1.ASN1Util.newObject({tag:r}).tohex()}throw new Error("bad status")},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(e){this.params=e},void 0!==e&&this.setByParam(e)},We(fe.asn1.ocsp.CertStatus,fe.asn1.ASN1Object),fe.asn1.ocsp.Request=function(e){var t=fe.asn1,r=t.DERSequence,n=t.ocsp;if(n.Request.superclass.constructor.call(this),this.dReqCert=null,this.dExt=null,this.tohex=function(){var e=[];if(null===this.dReqCert)throw"reqCert not set";e.push(this.dReqCert);var t=new r({array:e});return this.hTLV=t.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},void 0!==e){var i=new n.CertID(e);this.dReqCert=i}},We(fe.asn1.ocsp.Request,fe.asn1.ASN1Object),fe.asn1.ocsp.TBSRequest=function(e){var t=fe.asn1,r=t.DERSequence,n=t.ocsp;n.TBSRequest.superclass.constructor.call(this),this.version=0,this.dRequestorName=null,this.dRequestList=[],this.dRequestExt=null,this.setRequestListByParam=function(e){for(var t=[],r=0;r<e.length;r++){var i=new n.Request(e[0]);t.push(i)}this.dRequestList=t},this.tohex=function(){var e=[];if(0!==this.version)throw"not supported version: "+this.version;if(null!==this.dRequestorName)throw"requestorName not supported";var t=new r({array:this.dRequestList});if(e.push(t),null!==this.dRequestExt)throw"requestExtensions not supported";var n=new r({array:e});return this.hTLV=n.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},void 0!==e&&void 0!==e.reqList&&this.setRequestListByParam(e.reqList)},We(fe.asn1.ocsp.TBSRequest,fe.asn1.ASN1Object),fe.asn1.ocsp.OCSPRequest=function(e){var t=fe.asn1,r=t.DERSequence,n=t.ocsp;if(n.OCSPRequest.superclass.constructor.call(this),this.dTbsRequest=null,this.dOptionalSignature=null,this.tohex=function(){var e=[];if(null===this.dTbsRequest)throw"tbsRequest not set";if(e.push(this.dTbsRequest),null!==this.dOptionalSignature)throw"optionalSignature not supported";var t=new r({array:e});return this.hTLV=t.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},void 0!==e&&void 0!==e.reqList){var i=new n.TBSRequest(e);this.dTbsRequest=i}},We(fe.asn1.ocsp.OCSPRequest,fe.asn1.ASN1Object),fe.asn1.ocsp.OCSPUtil={},fe.asn1.ocsp.OCSPUtil.getRequestHex=function(e,t,r){var n=fe.asn1.ocsp;void 0===r&&(r=n.DEFAULT_HASH);var i={alg:r,issuerCert:e,subjectCert:t};return new n.OCSPRequest({reqList:[i]}).tohex()},fe.asn1.ocsp.OCSPUtil.getOCSPResponseInfo=function(e){var t=de,r=t.getVbyList,n=t.getVbyListEx,i=t.getIdxbyList,a=(t.getIdxbyListEx,t.getV),s={};try{var o=n(e,0,[0],"0a");s.responseStatus=parseInt(o,16)}catch(e){}if(0!==s.responseStatus)return s;try{var c=i(e,0,[1,0,1,0,0,2,0,1]);"80"===e.substr(c,2)?s.certStatus="good":"a1"===e.substr(c,2)?(s.certStatus="revoked",s.revocationTime=Se(r(e,c,[0]))):"82"===e.substr(c,2)&&(s.certStatus="unknown")}catch(e){}try{var u=i(e,0,[1,0,1,0,0,2,0,2]);s.thisUpdate=Se(a(e,u))}catch(e){}try{var f=i(e,0,[1,0,1,0,0,2,0,3]);"a0"===e.substr(f,2)&&(s.nextUpdate=Se(r(e,f,[0])))}catch(e){}return s},fe.asn1.ocsp.OCSPParser=function(){var e=Error,t=Ze,r=new t,n=de,i=n.getV,a=n.getTLV,s=n.getIdxbyList,o=n.getVbyList,c=n.getTLVbyList,u=n.getVbyListEx,f=n.getTLVbyListEx,h=n.getChildIdx;this.getOCSPRequest=function(t){var r=h(t,0);if(1!=r.length&&2!=r.length)throw new e("wrong number elements: "+r.length);return this.getTBSRequest(a(t,r[0]))},this.getTBSRequest=function(e){var t={},n=f(e,0,[0],"30");t.array=this.getRequestList(n);var i=f(e,0,["[2]",0],"30");return null!=i&&(t.ext=r.getExtParamArray(i)),t},this.getRequestList=function(e){for(var t=[],r=h(e,0),n=0;n<r.length;n++)e=a(e,r[n]),t.push(this.getRequest(e));return t},this.getRequest=function(t){var n=h(t,0);if(1!=n.length&&2!=n.length)throw new e("wrong number elements: "+n.length);var i=this.getCertID(a(t,n[0]));if(2==n.length){var o=s(t,0,[1,0]);i.ext=r.getExtParamArray(a(t,o))}return i},this.getCertID=function(r){var n=h(r,0);if(4!=n.length)throw new e("wrong number elements: "+n.length);var s=new t,o={};return o.alg=s.getAlgorithmIdentifierName(a(r,n[0])),o.issname=i(r,n[1]),o.isskey=i(r,n[2]),o.sbjsn=i(r,n[3]),o},this.getOCSPResponse=function(e){var t,r=h(e,0),n=i(e,r[0]),a=parseInt(n);if(1==r.length)return{resstatus:a};var s=c(e,0,[1,0]);return(t=this.getResponseBytes(s)).resstatus=a,t},this.getResponseBytes=function(e){var t,r=h(e,0),n=c(e,0,[1,0]);t=this.getBasicOCSPResponse(n);var a=i(e,r[0]);return t.restype=fe.asn1.x509.OID.oid2name(He(a)),t},this.getBasicOCSPResponse=function(e){var t,r=h(e,0);t=this.getResponseData(a(e,r[0]));var n=new Ze;t.alg=n.getAlgorithmIdentifierName(a(e,r[1]));var s=i(e,r[2]);t.sighex=s.substr(2);var o=u(e,0,["[0]"]);if(null!=o){for(var c=h(o,0),f=[],l=0;l<c.length;l++){var d=a(o,c[l]);f.push(d)}t.certs=f}return t},this.getResponseData=function(e){var t=h(e,0),r=t.length,n={},s=0;"a0"==e.substr(t[0],2)&&s++,n.respid=this.getResponderID(a(e,t[s++]));var o=i(e,t[s++]);if(n.prodat=Se(o),n.array=this.getSingleResponseList(a(e,t[s++])),"a1"==e.substr(t[r-1],2)){var u=c(e,t[r-1],[0]),f=new Ze;n.ext=f.getExtParamArray(u)}return n},this.getResponderID=function(e){var t={};if("a2"==e.substr(0,2)){var r=o(e,0,[0]);t.key=r}if("a1"==e.substr(0,2)){var n=c(e,0,[0]),i=new Ze;t.name=i.getX500Name(n)}return t},this.getSingleResponseList=function(e){for(var t=h(e,0),r=[],n=0;n<t.length;n++){var i=this.getSingleResponse(a(e,t[n]));r.push(i)}return r},this.getSingleResponse=function(e){var t=h(e,0),r={},n=this.getCertID(a(e,t[0]));r.certid=n;var s=this.getCertStatus(a(e,t[1]));if(r.status=s,"18"==e.substr(t[2],2)){var u=i(e,t[2]);r.thisupdate=Se(u)}for(var f=3;f<t.length;f++){if("a0"==e.substr(t[f],2)){var l=o(e,t[f],[0],"18");r.nextupdate=Se(l)}if("a1"==e.substr(t[f],2)){var d=new Ze,p=c(e,0,[f,0]);r.ext=d.getExtParamArray(p)}}return r},this.getCertStatus=function(e){var t={};if("8000"==e)return{status:"good"};if("8200"==e)return{status:"unknown"};if("a1"==e.substr(0,2)){t.status="revoked";var r=Se(o(e,0,[0]));t.time=r}return t}},void 0!==fe&&fe||(fe={}),void 0!==fe.lang&&fe.lang||(fe.lang={}),fe.lang.String=function(){},"function"==typeof p?(he=function(e){return ye(p.from(e,"utf8").toString("base64"))},le=function(e){return p.from(ve(e),"base64").toString("utf8")}):(he=function(e){return me(Ie(Le(e)))},le=function(e){return decodeURIComponent(Fe(be(e)))}),fe.lang.String.isInteger=function(e){return!!e.match(/^[0-9]+$/)||!!e.match(/^-[0-9]+$/)},fe.lang.String.isHex=function(e){return Ue(e)},fe.lang.String.isBase64=function(e){return!(!(e=e.replace(/\s+/g,"")).match(/^[0-9A-Za-z+\/]+={0,3}$/)||e.length%4!=0)},fe.lang.String.isBase64URL=function(e){return!e.match(/[+/=]/)&&(e=ve(e),fe.lang.String.isBase64(e))},fe.lang.String.isIntegerArray=function(e){return!!(e=e.replace(/\s+/g,"")).match(/^\[[0-9,]+\]$/)},fe.lang.String.isPrintable=function(e){return null!==e.match(/^[0-9A-Za-z '()+,-./:=?]*$/)},fe.lang.String.isIA5=function(e){return null!==e.match(/^[\x20-\x21\x23-\x7f]*$/)},fe.lang.String.isMail=function(e){return null!==e.match(/^[A-Za-z0-9]{1}[A-Za-z0-9_.-]*@{1}[A-Za-z0-9_.-]{1,}\.[A-Za-z0-9]{1,}$/)};var Ge=function(e,t,r){return null==r&&(r="0"),e.length>=t?e:new Array(t-e.length+1).join(r)+e};function qe(e,t){for(var r=0,n=0;n<e.length;n++)r|=1<<t[e[n]];var i=r.toString(2),a="";for(n=i.length-1;n>=0;n--)a+=i[n];return a}function ze(e,t,r){if("object"==typeof e){t=String(t).split(".");for(var n=0;n<t.length&&e;n++){var i=t[n];i.match(/^[0-9]+$/)&&(i=parseInt(i)),e=e[i]}return e||!1===e?e:r}}function We(e,t){var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e,e.superclass=t.prototype,t.prototype.constructor==Object.prototype.constructor&&(t.prototype.constructor=t)}void 0!==fe&&fe||(fe={}),void 0!==fe.crypto&&fe.crypto||(fe.crypto={}),fe.crypto.Util=new function(){this.DIGESTINFOHEAD={sha1:"3021300906052b0e03021a05000414",sha224:"302d300d06096086480165030402040500041c",sha256:"3031300d060960864801650304020105000420",sha384:"3041300d060960864801650304020205000430",sha512:"3051300d060960864801650304020305000440",md2:"3020300c06082a864886f70d020205000410",md5:"3020300c06082a864886f70d020505000410",ripemd160:"3021300906052b2403020105000414"},this.DEFAULTPROVIDER={md5:"cryptojs",sha1:"cryptojs",sha224:"cryptojs",sha256:"cryptojs",sha384:"cryptojs",sha512:"cryptojs",ripemd160:"cryptojs",hmacmd5:"cryptojs",hmacsha1:"cryptojs",hmacsha224:"cryptojs",hmacsha256:"cryptojs",hmacsha384:"cryptojs",hmacsha512:"cryptojs",hmacripemd160:"cryptojs",MD5withRSA:"cryptojs/jsrsa",SHA1withRSA:"cryptojs/jsrsa",SHA224withRSA:"cryptojs/jsrsa",SHA256withRSA:"cryptojs/jsrsa",SHA384withRSA:"cryptojs/jsrsa",SHA512withRSA:"cryptojs/jsrsa",RIPEMD160withRSA:"cryptojs/jsrsa",MD5withECDSA:"cryptojs/jsrsa",SHA1withECDSA:"cryptojs/jsrsa",SHA224withECDSA:"cryptojs/jsrsa",SHA256withECDSA:"cryptojs/jsrsa",SHA384withECDSA:"cryptojs/jsrsa",SHA512withECDSA:"cryptojs/jsrsa",RIPEMD160withECDSA:"cryptojs/jsrsa",SHA1withDSA:"cryptojs/jsrsa",SHA224withDSA:"cryptojs/jsrsa",SHA256withDSA:"cryptojs/jsrsa",MD5withRSAandMGF1:"cryptojs/jsrsa",SHAwithRSAandMGF1:"cryptojs/jsrsa",SHA1withRSAandMGF1:"cryptojs/jsrsa",SHA224withRSAandMGF1:"cryptojs/jsrsa",SHA256withRSAandMGF1:"cryptojs/jsrsa",SHA384withRSAandMGF1:"cryptojs/jsrsa",SHA512withRSAandMGF1:"cryptojs/jsrsa",RIPEMD160withRSAandMGF1:"cryptojs/jsrsa"},this.CRYPTOJSMESSAGEDIGESTNAME={md5:v.algo.MD5,sha1:v.algo.SHA1,sha224:v.algo.SHA224,sha256:v.algo.SHA256,sha384:v.algo.SHA384,sha512:v.algo.SHA512,ripemd160:v.algo.RIPEMD160},this.getDigestInfoHex=function(e,t){if(void 0===this.DIGESTINFOHEAD[t])throw"alg not supported in Util.DIGESTINFOHEAD: "+t;return this.DIGESTINFOHEAD[t]+e},this.getPaddedDigestInfoHex=function(e,t,r){var n=this.getDigestInfoHex(e,t),i=r/4;if(n.length+22>i)throw"key is too short for SigAlg: keylen="+r+","+t;for(var a="00"+n,s="",o=i-4-a.length,c=0;c<o;c+=2)s+="ff";return"0001"+s+a},this.hashString=function(e,t){return new fe.crypto.MessageDigest({alg:t}).digestString(e)},this.hashHex=function(e,t){return new fe.crypto.MessageDigest({alg:t}).digestHex(e)},this.sha1=function(e){return this.hashString(e,"sha1")},this.sha256=function(e){return this.hashString(e,"sha256")},this.sha256Hex=function(e){return this.hashHex(e,"sha256")},this.sha512=function(e){return this.hashString(e,"sha512")},this.sha512Hex=function(e){return this.hashHex(e,"sha512")},this.isKey=function(e){return e instanceof ae||e instanceof fe.crypto.DSA||e instanceof fe.crypto.ECDSA}},fe.crypto.Util.md5=function(e){return new fe.crypto.MessageDigest({alg:"md5",prov:"cryptojs"}).digestString(e)},fe.crypto.Util.ripemd160=function(e){return new fe.crypto.MessageDigest({alg:"ripemd160",prov:"cryptojs"}).digestString(e)},fe.crypto.Util.SECURERANDOMGEN=new ne,fe.crypto.Util.getRandomHexOfNbytes=function(e){var t=new Array(e);return fe.crypto.Util.SECURERANDOMGEN.nextBytes(t),pe(t)},fe.crypto.Util.getRandomBigIntegerOfNbytes=function(e){return new C(fe.crypto.Util.getRandomHexOfNbytes(e),16)},fe.crypto.Util.getRandomHexOfNbits=function(e){var t=e%8,r=new Array((e-t)/8+1);return fe.crypto.Util.SECURERANDOMGEN.nextBytes(r),r[0]=(255<<t&255^255)&r[0],pe(r)},fe.crypto.Util.getRandomBigIntegerOfNbits=function(e){return new C(fe.crypto.Util.getRandomHexOfNbits(e),16)},fe.crypto.Util.getRandomBigIntegerZeroToMax=function(e){for(var t=e.bitLength();;){var r=fe.crypto.Util.getRandomBigIntegerOfNbits(t);if(-1!=e.compareTo(r))return r}},fe.crypto.Util.getRandomBigIntegerMinToMax=function(e,t){var r=e.compareTo(t);if(1==r)throw"biMin is greater than biMax";if(0==r)return e;var n=t.subtract(e);return fe.crypto.Util.getRandomBigIntegerZeroToMax(n).add(e)},fe.crypto.MessageDigest=function(e){this.setAlgAndProvider=function(e,t){if(null!==(e=fe.crypto.MessageDigest.getCanonicalAlgName(e))&&void 0===t&&(t=fe.crypto.Util.DEFAULTPROVIDER[e]),-1!=":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(e)&&"cryptojs"==t){try{this.md=fe.crypto.Util.CRYPTOJSMESSAGEDIGESTNAME[e].create()}catch(t){throw"setAlgAndProvider hash alg set fail alg="+e+"/"+t}this.updateString=function(e){this.md.update(e)},this.updateHex=function(e){var t=v.enc.Hex.parse(e);this.md.update(t)},this.digest=function(){return this.md.finalize().toString(v.enc.Hex)},this.digestString=function(e){return this.updateString(e),this.digest()},this.digestHex=function(e){return this.updateHex(e),this.digest()}}if(-1!=":sha256:".indexOf(e)&&"sjcl"==t){try{this.md=new sjcl.hash.sha256}catch(t){throw"setAlgAndProvider hash alg set fail alg="+e+"/"+t}this.updateString=function(e){this.md.update(e)},this.updateHex=function(e){var t=sjcl.codec.hex.toBits(e);this.md.update(t)},this.digest=function(){var e=this.md.finalize();return sjcl.codec.hex.fromBits(e)},this.digestString=function(e){return this.updateString(e),this.digest()},this.digestHex=function(e){return this.updateHex(e),this.digest()}}},this.updateString=function(e){throw"updateString(str) not supported for this alg/prov: "+this.algName+"/"+this.provName},this.updateHex=function(e){throw"updateHex(hex) not supported for this alg/prov: "+this.algName+"/"+this.provName},this.digest=function(){throw"digest() not supported for this alg/prov: "+this.algName+"/"+this.provName},this.digestString=function(e){throw"digestString(str) not supported for this alg/prov: "+this.algName+"/"+this.provName},this.digestHex=function(e){throw"digestHex(hex) not supported for this alg/prov: "+this.algName+"/"+this.provName},void 0!==e&&void 0!==e.alg&&(this.algName=e.alg,void 0===e.prov&&(this.provName=fe.crypto.Util.DEFAULTPROVIDER[this.algName]),this.setAlgAndProvider(this.algName,this.provName))},fe.crypto.MessageDigest.getCanonicalAlgName=function(e){return"string"==typeof e&&(e=(e=e.toLowerCase()).replace(/-/,"")),e},fe.crypto.MessageDigest.getHashLength=function(e){var t=fe.crypto.MessageDigest,r=t.getCanonicalAlgName(e);if(void 0===t.HASHLENGTH[r])throw"not supported algorithm: "+e;return t.HASHLENGTH[r]},fe.crypto.MessageDigest.HASHLENGTH={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,ripemd160:20},fe.crypto.Mac=function(e){this.setAlgAndProvider=function(e,t){if(null==(e=e.toLowerCase())&&(e="hmacsha1"),"hmac"!=(e=e.toLowerCase()).substr(0,4))throw"setAlgAndProvider unsupported HMAC alg: "+e;void 0===t&&(t=fe.crypto.Util.DEFAULTPROVIDER[e]),this.algProv=e+"/"+t;var r=e.substr(4);if(-1!=":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(r)&&"cryptojs"==t){try{var n=fe.crypto.Util.CRYPTOJSMESSAGEDIGESTNAME[r];this.mac=v.algo.HMAC.create(n,this.pass)}catch(e){throw"setAlgAndProvider hash alg set fail hashAlg="+r+"/"+e}this.updateString=function(e){this.mac.update(e)},this.updateHex=function(e){var t=v.enc.Hex.parse(e);this.mac.update(t)},this.doFinal=function(){return this.mac.finalize().toString(v.enc.Hex)},this.doFinalString=function(e){return this.updateString(e),this.doFinal()},this.doFinalHex=function(e){return this.updateHex(e),this.doFinal()}}},this.updateString=function(e){throw"updateString(str) not supported for this alg/prov: "+this.algProv},this.updateHex=function(e){throw"updateHex(hex) not supported for this alg/prov: "+this.algProv},this.doFinal=function(){throw"digest() not supported for this alg/prov: "+this.algProv},this.doFinalString=function(e){throw"digestString(str) not supported for this alg/prov: "+this.algProv},this.doFinalHex=function(e){throw"digestHex(hex) not supported for this alg/prov: "+this.algProv},this.setPassword=function(e){if("string"==typeof e){var t=e;return e.length%2!=1&&e.match(/^[0-9A-Fa-f]+$/)||(t=Ae(e)),void(this.pass=v.enc.Hex.parse(t))}if("object"!=typeof e)throw"KJUR.crypto.Mac unsupported password type: "+e;if(t=null,void 0!==e.hex){if(e.hex.length%2!=0||!e.hex.match(/^[0-9A-Fa-f]+$/))throw"Mac: wrong hex password: "+e.hex;t=e.hex}if(void 0!==e.utf8&&(t=we(e.utf8)),void 0!==e.rstr&&(t=Ae(e.rstr)),void 0!==e.b64&&(t=E(e.b64)),void 0!==e.b64u&&(t=be(e.b64u)),null==t)throw"KJUR.crypto.Mac unsupported password type: "+e;this.pass=v.enc.Hex.parse(t)},void 0!==e&&(void 0!==e.pass&&this.setPassword(e.pass),void 0!==e.alg&&(this.algName=e.alg,void 0===e.prov&&(this.provName=fe.crypto.Util.DEFAULTPROVIDER[this.algName]),this.setAlgAndProvider(this.algName,this.provName)))},fe.crypto.Signature=function(e){var t=null;if(this._setAlgNames=function(){var e=this.algName.match(/^(.+)with(.+)$/);e&&(this.mdAlgName=e[1].toLowerCase(),this.pubkeyAlgName=e[2].toLowerCase(),"rsaandmgf1"==this.pubkeyAlgName&&"sha"==this.mdAlgName&&(this.mdAlgName="sha1"))},this._zeroPaddingOfSignature=function(e,t){for(var r="",n=t/4-e.length,i=0;i<n;i++)r+="0";return r+e},this.setAlgAndProvider=function(e,t){if(this._setAlgNames(),"cryptojs/jsrsa"!=t)throw new Error("provider not supported: "+t);if(-1!=":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(this.mdAlgName)){try{this.md=new fe.crypto.MessageDigest({alg:this.mdAlgName})}catch(e){throw new Error("setAlgAndProvider hash alg set fail alg="+this.mdAlgName+"/"+e)}this.init=function(e,t){var r=null;try{r=void 0===t?Xe.getKey(e):Xe.getKey(e,t)}catch(e){throw"init failed:"+e}if(!0===r.isPrivate)this.prvKey=r,this.state="SIGN";else{if(!0!==r.isPublic)throw"init failed.:"+r;this.pubKey=r,this.state="VERIFY"}},this.updateString=function(e){this.md.updateString(e)},this.updateHex=function(e){this.md.updateHex(e)},this.sign=function(){if(this.sHashHex=this.md.digest(),void 0===this.prvKey&&void 0!==this.ecprvhex&&void 0!==this.eccurvename&&void 0!==fe.crypto.ECDSA&&(this.prvKey=new fe.crypto.ECDSA({curve:this.eccurvename,prv:this.ecprvhex})),this.prvKey instanceof ae&&"rsaandmgf1"===this.pubkeyAlgName)this.hSign=this.prvKey.signWithMessageHashPSS(this.sHashHex,this.mdAlgName,this.pssSaltLen);else if(this.prvKey instanceof ae&&"rsa"===this.pubkeyAlgName)this.hSign=this.prvKey.signWithMessageHash(this.sHashHex,this.mdAlgName);else if(this.prvKey instanceof fe.crypto.ECDSA)this.hSign=this.prvKey.signWithMessageHash(this.sHashHex);else{if(!(this.prvKey instanceof fe.crypto.DSA))throw"Signature: unsupported private key alg: "+this.pubkeyAlgName;this.hSign=this.prvKey.signWithMessageHash(this.sHashHex)}return this.hSign},this.signString=function(e){return this.updateString(e),this.sign()},this.signHex=function(e){return this.updateHex(e),this.sign()},this.verify=function(e){if(this.sHashHex=this.md.digest(),void 0===this.pubKey&&void 0!==this.ecpubhex&&void 0!==this.eccurvename&&void 0!==fe.crypto.ECDSA&&(this.pubKey=new fe.crypto.ECDSA({curve:this.eccurvename,pub:this.ecpubhex})),this.pubKey instanceof ae&&"rsaandmgf1"===this.pubkeyAlgName)return this.pubKey.verifyWithMessageHashPSS(this.sHashHex,e,this.mdAlgName,this.pssSaltLen);if(this.pubKey instanceof ae&&"rsa"===this.pubkeyAlgName)return this.pubKey.verifyWithMessageHash(this.sHashHex,e);if(void 0!==fe.crypto.ECDSA&&this.pubKey instanceof fe.crypto.ECDSA)return this.pubKey.verifyWithMessageHash(this.sHashHex,e);if(void 0!==fe.crypto.DSA&&this.pubKey instanceof fe.crypto.DSA)return this.pubKey.verifyWithMessageHash(this.sHashHex,e);throw"Signature: unsupported public key alg: "+this.pubkeyAlgName}}},this.init=function(e,t){throw"init(key, pass) not supported for this alg:prov="+this.algProvName},this.updateString=function(e){throw"updateString(str) not supported for this alg:prov="+this.algProvName},this.updateHex=function(e){throw"updateHex(hex) not supported for this alg:prov="+this.algProvName},this.sign=function(){throw"sign() not supported for this alg:prov="+this.algProvName},this.signString=function(e){throw"digestString(str) not supported for this alg:prov="+this.algProvName},this.signHex=function(e){throw"digestHex(hex) not supported for this alg:prov="+this.algProvName},this.verify=function(e){throw"verify(hSigVal) not supported for this alg:prov="+this.algProvName},this.initParams=e,void 0!==e&&(void 0!==e.alg&&(this.algName=e.alg,void 0===e.prov?this.provName=fe.crypto.Util.DEFAULTPROVIDER[this.algName]:this.provName=e.prov,this.algProvName=this.algName+":"+this.provName,this.setAlgAndProvider(this.algName,this.provName),this._setAlgNames()),void 0!==e.psssaltlen&&(this.pssSaltLen=e.psssaltlen),void 0!==e.prvkeypem)){if(void 0!==e.prvkeypas)throw"both prvkeypem and prvkeypas parameters not supported";try{t=Xe.getKey(e.prvkeypem),this.init(t)}catch(e){throw"fatal error to load pem private key: "+e}}},fe.crypto.Cipher=function(e){},fe.crypto.Cipher.encrypt=function(e,t,r,n){if(null!=ze(n,"enclag")&&(r=n.encalg),"string"==typeof r&&"-CBC"==r.substr(-4)){var i=t,a=e;null!=ze(n,"key")&&(i=n.key),null!=ze(n,"enc")&&(hEnc=n.enc);var s,o=v.enc.Hex.parse(i),c=v.enc.Hex.parse(a),u=v.enc.Hex.parse(n.iv);if("des-EDE3-CBC"==r)s=v.TripleDES.encrypt(c,o,{iv:u});else{if("aes128-CBC"!=r&&"aes256-CBC"!=r)throw new Error("unsupported algorithm: "+r);s=v.AES.encrypt(c,o,{iv:u})}return s+""}throw new Error("Cipher.encrypt: unsupported key or algorithm")},fe.crypto.Cipher.decrypt=function(e,t,r,n){if(null!=ze(n,"enclag")&&(r=n.encalg),"string"==typeof r&&"-CBC"==r.substr(-4)){var i=t,a=e;null!=ze(n,"key")&&(i=n.key),null!=ze(n,"enc")&&(a=n.enc);var s,o=v.enc.Hex.parse(i),c=v.enc.Hex.parse(a),u=v.enc.Hex.parse(n.iv);if("des-EDE3-CBC"==r)s=v.TripleDES.decrypt({ciphertext:c},o,{iv:u});else{if("aes128-CBC"!=r&&"aes256-CBC"!=r)throw new Error("unsupported algorithm: "+r);s=v.AES.decrypt({ciphertext:c},o,{iv:u})}return v.enc.Hex.stringify(s)}throw new Error("Cipher.decrypt: unsupported key or algorithm")},fe.crypto.OID=new function(){this.oidhex2name={"2a864886f70d010101":"rsaEncryption","2a8648ce3d0201":"ecPublicKey","2a8648ce380401":"dsa","2a8648ce3d030107":"secp256r1","2b8104001f":"secp192k1","2b81040021":"secp224r1","2b8104000a":"secp256k1","2b81040022":"secp384r1","2b81040023":"secp521r1","2a8648ce380403":"SHA1withDSA","608648016503040301":"SHA224withDSA","608648016503040302":"SHA256withDSA"}},void 0!==fe&&fe||(fe={}),void 0!==fe.crypto&&fe.crypto||(fe.crypto={}),fe.crypto.ECDSA=function(e){var t=Error,r=C,n=oe,i=fe.crypto.ECDSA,a=fe.crypto.ECParameterDB,s=i.getName,o=de,c=o.getVbyListEx,u=o.isASN1HEX,f=new ne;this.type="EC",this.isPrivate=!1,this.isPublic=!1,this.getBigRandom=function(e){return new r(e.bitLength(),f).mod(e.subtract(r.ONE)).add(r.ONE)},this.setNamedCurve=function(e){this.ecparams=a.getByName(e),this.prvKeyHex=null,this.pubKeyHex=null,this.curveName=e},this.setPrivateKeyHex=function(e){this.isPrivate=!0,this.prvKeyHex=e},this.setPublicKeyHex=function(e){this.isPublic=!0,this.pubKeyHex=e},this.getPublicKeyXYHex=function(){var e=this.pubKeyHex;if("04"!==e.substr(0,2))throw"this method supports uncompressed format(04) only";var t=this.ecparams.keycharlen;if(e.length!==2+2*t)throw"malformed public key hex length";var r={};return r.x=e.substr(2,t),r.y=e.substr(2+t),r},this.getShortNISTPCurveName=function(){var e=this.curveName;return"secp256r1"===e||"NIST P-256"===e||"P-256"===e||"prime256v1"===e?"P-256":"secp384r1"===e||"NIST P-384"===e||"P-384"===e?"P-384":"secp521r1"===e||"NIST P-521"===e||"P-521"===e?"P-521":null},this.generateKeyPairHex=function(){var e=this.ecparams.n,t=this.getBigRandom(e),r=this.ecparams.keycharlen,n=("0000000000"+t.toString(16)).slice(-r);return this.setPrivateKeyHex(n),{ecprvhex:n,ecpubhex:this.generatePublicKeyHex()}},this.generatePublicKeyHex=function(){var e=new r(this.prvKeyHex,16),t=this.ecparams.G.multiply(e),n=t.getX().toBigInteger(),i=t.getY().toBigInteger(),a=this.ecparams.keycharlen,s="04"+("0000000000"+n.toString(16)).slice(-a)+("0000000000"+i.toString(16)).slice(-a);return this.setPublicKeyHex(s),s},this.signWithMessageHash=function(e){return this.signHex(e,this.prvKeyHex)},this.signHex=function(e,t){var n=new r(t,16),a=this.ecparams.n,s=new r(e.substring(0,this.ecparams.keycharlen),16);do{var o=this.getBigRandom(a),c=this.ecparams.G.multiply(o).getX().toBigInteger().mod(a)}while(c.compareTo(r.ZERO)<=0);var u=o.modInverse(a).multiply(s.add(n.multiply(c))).mod(a);return i.biRSSigToASN1Sig(c,u)},this.sign=function(e,t){var n=t,i=this.ecparams.n,a=r.fromByteArrayUnsigned(e);do{var s=this.getBigRandom(i),o=this.ecparams.G.multiply(s).getX().toBigInteger().mod(i)}while(o.compareTo(C.ZERO)<=0);var c=s.modInverse(i).multiply(a.add(n.multiply(o))).mod(i);return this.serializeSig(o,c)},this.verifyWithMessageHash=function(e,t){return this.verifyHex(e,t,this.pubKeyHex)},this.verifyHex=function(e,t,a){try{var s,o,c=i.parseSigHex(t);s=c.r,o=c.s;var u=n.decodeFromHex(this.ecparams.curve,a),f=new r(e.substring(0,this.ecparams.keycharlen),16);return this.verifyRaw(f,s,o,u)}catch(e){return!1}},this.verify=function(e,t,i){var a,s,o;if(Bitcoin.Util.isArray(t)){var c=this.parseSig(t);a=c.r,s=c.s}else{if("object"!=typeof t||!t.r||!t.s)throw"Invalid value for signature";a=t.r,s=t.s}if(i instanceof oe)o=i;else{if(!Bitcoin.Util.isArray(i))throw"Invalid format for pubkey value, must be byte array or ECPointFp";o=n.decodeFrom(this.ecparams.curve,i)}var u=r.fromByteArrayUnsigned(e);return this.verifyRaw(u,a,s,o)},this.verifyRaw=function(e,t,n,i){var a=this.ecparams.n,s=this.ecparams.G;if(t.compareTo(r.ONE)<0||t.compareTo(a)>=0)return!1;if(n.compareTo(r.ONE)<0||n.compareTo(a)>=0)return!1;var o=n.modInverse(a),c=e.multiply(o).mod(a),u=t.multiply(o).mod(a);return s.multiply(c).add(i.multiply(u)).getX().toBigInteger().mod(a).equals(t)},this.serializeSig=function(e,t){var r=e.toByteArraySigned(),n=t.toByteArraySigned(),i=[];return i.push(2),i.push(r.length),(i=i.concat(r)).push(2),i.push(n.length),(i=i.concat(n)).unshift(i.length),i.unshift(48),i},this.parseSig=function(e){var t;if(48!=e[0])throw new Error("Signature not a valid DERSequence");if(2!=e[t=2])throw new Error("First element in signature must be a DERInteger");var n=e.slice(t+2,t+2+e[t+1]);if(2!=e[t+=2+e[t+1]])throw new Error("Second element in signature must be a DERInteger");var i=e.slice(t+2,t+2+e[t+1]);return t+=2+e[t+1],{r:r.fromByteArrayUnsigned(n),s:r.fromByteArrayUnsigned(i)}},this.parseSigCompact=function(e){if(65!==e.length)throw"Signature has the wrong length";var t=e[0]-27;if(t<0||t>7)throw"Invalid signature type";var n=this.ecparams.n;return{r:r.fromByteArrayUnsigned(e.slice(1,33)).mod(n),s:r.fromByteArrayUnsigned(e.slice(33,65)).mod(n),i:t}},this.readPKCS5PrvKeyHex=function(e){if(!1===u(e))throw new Error("not ASN.1 hex string");var t,r,n;try{t=c(e,0,["[0]",0],"06"),r=c(e,0,[1],"04");try{n=c(e,0,["[1]",0],"03")}catch(e){}}catch(e){throw new Error("malformed PKCS#1/5 plain ECC private key")}if(this.curveName=s(t),void 0===this.curveName)throw"unsupported curve name";this.setNamedCurve(this.curveName),this.setPublicKeyHex(n),this.setPrivateKeyHex(r),this.isPublic=!1},this.readPKCS8PrvKeyHex=function(e){if(!1===u(e))throw new t("not ASN.1 hex string");var r,n,i;try{c(e,0,[1,0],"06"),r=c(e,0,[1,1],"06"),n=c(e,0,[2,0,1],"04");try{i=c(e,0,[2,0,"[1]",0],"03")}catch(e){}}catch(e){throw new t("malformed PKCS#8 plain ECC private key")}if(this.curveName=s(r),void 0===this.curveName)throw new t("unsupported curve name");this.setNamedCurve(this.curveName),this.setPublicKeyHex(i),this.setPrivateKeyHex(n),this.isPublic=!1},this.readPKCS8PubKeyHex=function(e){if(!1===u(e))throw new t("not ASN.1 hex string");var r,n;try{c(e,0,[0,0],"06"),r=c(e,0,[0,1],"06"),n=c(e,0,[1],"03")}catch(e){throw new t("malformed PKCS#8 ECC public key")}if(this.curveName=s(r),null===this.curveName)throw new t("unsupported curve name");this.setNamedCurve(this.curveName),this.setPublicKeyHex(n)},this.readCertPubKeyHex=function(e,r){if(!1===u(e))throw new t("not ASN.1 hex string");var n,i;try{n=c(e,0,[0,5,0,1],"06"),i=c(e,0,[0,5,1],"03")}catch(e){throw new t("malformed X.509 certificate ECC public key")}if(this.curveName=s(n),null===this.curveName)throw new t("unsupported curve name");this.setNamedCurve(this.curveName),this.setPublicKeyHex(i)},void 0!==e&&void 0!==e.curve&&(this.curveName=e.curve),void 0===this.curveName&&(this.curveName="secp256r1"),this.setNamedCurve(this.curveName),void 0!==e&&(void 0!==e.prv&&this.setPrivateKeyHex(e.prv),void 0!==e.pub&&this.setPublicKeyHex(e.pub))},fe.crypto.ECDSA.parseSigHex=function(e){var t=fe.crypto.ECDSA.parseSigHexInHexRS(e);return{r:new C(t.r,16),s:new C(t.s,16)}},fe.crypto.ECDSA.parseSigHexInHexRS=function(e){var t=de,r=t.getChildIdx,n=t.getV;if(t.checkStrictDER(e,0),"30"!=e.substr(0,2))throw new Error("signature is not a ASN.1 sequence");var i=r(e,0);if(2!=i.length)throw new Error("signature shall have two elements");var a=i[0],s=i[1];if("02"!=e.substr(a,2))throw new Error("1st item not ASN.1 integer");if("02"!=e.substr(s,2))throw new Error("2nd item not ASN.1 integer");return{r:n(e,a),s:n(e,s)}},fe.crypto.ECDSA.asn1SigToConcatSig=function(e){var t=fe.crypto.ECDSA.parseSigHexInHexRS(e),r=t.r,n=t.s;if(r.length>=130&&r.length<=134){if(r.length%2!=0)throw Error("unknown ECDSA sig r length error");if(n.length%2!=0)throw Error("unknown ECDSA sig s length error");"00"==r.substr(0,2)&&(r=r.substr(2)),"00"==n.substr(0,2)&&(n=n.substr(2));var i=Math.max(r.length,n.length);return(r=("000000"+r).slice(-i))+("000000"+n).slice(-i)}if("00"==r.substr(0,2)&&r.length%32==2&&(r=r.substr(2)),"00"==n.substr(0,2)&&n.length%32==2&&(n=n.substr(2)),r.length%32==30&&(r="00"+r),n.length%32==30&&(n="00"+n),r.length%32!=0)throw Error("unknown ECDSA sig r length error");if(n.length%32!=0)throw Error("unknown ECDSA sig s length error");return r+n},fe.crypto.ECDSA.concatSigToASN1Sig=function(e){if(e.length%4!=0)throw Error("unknown ECDSA concatinated r-s sig length error");var t=e.substr(0,e.length/2),r=e.substr(e.length/2);return fe.crypto.ECDSA.hexRSSigToASN1Sig(t,r)},fe.crypto.ECDSA.hexRSSigToASN1Sig=function(e,t){var r=new C(e,16),n=new C(t,16);return fe.crypto.ECDSA.biRSSigToASN1Sig(r,n)},fe.crypto.ECDSA.biRSSigToASN1Sig=function(e,t){var r=fe.asn1,n=new r.DERInteger({bigint:e}),i=new r.DERInteger({bigint:t});return new r.DERSequence({array:[n,i]}).tohex()},fe.crypto.ECDSA.getName=function(e){return"2b8104001f"===e?"secp192k1":"2a8648ce3d030107"===e?"secp256r1":"2b8104000a"===e?"secp256k1":"2b81040021"===e?"secp224r1":"2b81040022"===e?"secp384r1":"2b81040023"===e?"secp521r1":-1!=="|secp256r1|NIST P-256|P-256|prime256v1|".indexOf(e)?"secp256r1":-1!=="|secp256k1|".indexOf(e)?"secp256k1":-1!=="|secp224r1|NIST P-224|P-224|".indexOf(e)?"secp224r1":-1!=="|secp384r1|NIST P-384|P-384|".indexOf(e)?"secp384r1":-1!=="|secp521r1|NIST P-521|P-521|".indexOf(e)?"secp521r1":null},void 0!==fe&&fe||(fe={}),void 0!==fe.crypto&&fe.crypto||(fe.crypto={}),fe.crypto.ECParameterDB=new function(){var e={},t={};function r(e){return new C(e,16)}this.getByName=function(r){var n=r;if(void 0!==t[n]&&(n=t[r]),void 0!==e[n])return e[n];throw"unregistered EC curve name: "+n},this.regist=function(n,i,a,s,o,c,u,f,h,l,d,p){e[n]={};var g=r(a),y=r(s),v=r(o),m=r(c),b=r(u),w=new ce(g,y,v),S=w.decodePointHex("04"+f+h);e[n].name=n,e[n].keylen=i,e[n].keycharlen=2*Math.ceil(i/8),e[n].curve=w,e[n].G=S,e[n].n=m,e[n].h=b,e[n].oid=d,e[n].info=p;for(var E=0;E<l.length;E++)t[l[E]]=n}},fe.crypto.ECParameterDB.regist("secp128r1",128,"FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFF","FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFC","E87579C11079F43DD824993C2CEE5ED3","FFFFFFFE0000000075A30D1B9038A115","1","161FF7528B899B2D0C28607CA52C5B86","CF5AC8395BAFEB13C02DA292DDED7A83",[],"","secp128r1 : SECG curve over a 128 bit prime field"),fe.crypto.ECParameterDB.regist("secp160k1",160,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC73","0","7","0100000000000000000001B8FA16DFAB9ACA16B6B3","1","3B4C382CE37AA192A4019E763036F4F5DD4D7EBB","938CF935318FDCED6BC28286531733C3F03C4FEE",[],"","secp160k1 : SECG curve over a 160 bit prime field"),fe.crypto.ECParameterDB.regist("secp160r1",160,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFC","1C97BEFC54BD7A8B65ACF89F81D4D4ADC565FA45","0100000000000000000001F4C8F927AED3CA752257","1","4A96B5688EF573284664698968C38BB913CBFC82","23A628553168947D59DCC912042351377AC5FB32",[],"","secp160r1 : SECG curve over a 160 bit prime field"),fe.crypto.ECParameterDB.regist("secp192k1",192,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFEE37","0","3","FFFFFFFFFFFFFFFFFFFFFFFE26F2FC170F69466A74DEFD8D","1","DB4FF10EC057E9AE26B07D0280B7F4341DA5D1B1EAE06C7D","9B2F2F6D9C5628A7844163D015BE86344082AA88D95E2F9D",[]),fe.crypto.ECParameterDB.regist("secp192r1",192,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFC","64210519E59C80E70FA7E9AB72243049FEB8DEECC146B9B1","FFFFFFFFFFFFFFFFFFFFFFFF99DEF836146BC9B1B4D22831","1","188DA80EB03090F67CBF20EB43A18800F4FF0AFD82FF1012","07192B95FFC8DA78631011ED6B24CDD573F977A11E794811",[]),fe.crypto.ECParameterDB.regist("secp224r1",224,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFE","B4050A850C04B3ABF54132565044B0B7D7BFD8BA270B39432355FFB4","FFFFFFFFFFFFFFFFFFFFFFFFFFFF16A2E0B8F03E13DD29455C5C2A3D","1","B70E0CBD6BB4BF7F321390B94A03C1D356C21122343280D6115C1D21","BD376388B5F723FB4C22DFE6CD4375A05A07476444D5819985007E34",[]),fe.crypto.ECParameterDB.regist("secp256k1",256,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F","0","7","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141","1","79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798","483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8",[]),fe.crypto.ECParameterDB.regist("secp256r1",256,"FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF","FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC","5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B","FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551","1","6B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C296","4FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5",["NIST P-256","P-256","prime256v1"]),fe.crypto.ECParameterDB.regist("secp384r1",384,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFC","B3312FA7E23EE7E4988E056BE3F82D19181D9C6EFE8141120314088F5013875AC656398D8A2ED19D2A85C8EDD3EC2AEF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC7634D81F4372DDF581A0DB248B0A77AECEC196ACCC52973","1","AA87CA22BE8B05378EB1C71EF320AD746E1D3B628BA79B9859F741E082542A385502F25DBF55296C3A545E3872760AB7","3617de4a96262c6f5d9e98bf9292dc29f8f41dbd289a147ce9da3113b5f0b8c00a60b1ce1d7e819d7a431d7c90ea0e5f",["NIST P-384","P-384"]),fe.crypto.ECParameterDB.regist("secp521r1",521,"1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF","1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC","051953EB9618E1C9A1F929A21A0B68540EEA2DA725B99B315F3B8B489918EF109E156193951EC7E937B1652C0BD3BB1BF073573DF883D2C34F1EF451FD46B503F00","1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA51868783BF2F966B7FCC0148F709A5D03BB5C9B8899C47AEBB6FB71E91386409","1","00C6858E06B70404E9CD9E3ECB662395B4429C648139053FB521F828AF606B4D3DBAA14B5E77EFE75928FE1DC127A2FFA8DE3348B3C1856A429BF97E7E31C2E5BD66","011839296a789a3bc0045c8a5fb42c7d1bd998f54449579b446817afbd17273e662c97ee72995ef42640c550b9013fad0761353c7086a272c24088be94769fd16650",["NIST P-521","P-521"]),void 0!==fe&&fe||(fe={}),void 0!==fe.crypto&&fe.crypto||(fe.crypto={}),fe.crypto.DSA=function(){var e=de,t=(e.getVbyList,e.getVbyListEx),r=e.isASN1HEX,n=C;this.p=null,this.q=null,this.g=null,this.y=null,this.x=null,this.type="DSA",this.isPrivate=!1,this.isPublic=!1,this.setPrivate=function(e,t,r,n,i){this.isPrivate=!0,this.p=e,this.q=t,this.g=r,this.y=n,this.x=i},this.setPrivateHex=function(e,t,r,n,i){var a,s,o,c,u;a=new C(e,16),s=new C(t,16),o=new C(r,16),c="string"==typeof n&&n.length>1?new C(n,16):null,u=new C(i,16),this.setPrivate(a,s,o,c,u)},this.setPublic=function(e,t,r,n){this.isPublic=!0,this.p=e,this.q=t,this.g=r,this.y=n,this.x=null},this.setPublicHex=function(e,t,r,n){var i,a,s,o;i=new C(e,16),a=new C(t,16),s=new C(r,16),o=new C(n,16),this.setPublic(i,a,s,o)},this.signWithMessageHash=function(e){var t=this.p,r=this.q,n=this.g,i=(this.y,this.x),a=fe.crypto.Util.getRandomBigIntegerMinToMax(C.ONE.add(C.ONE),r.subtract(C.ONE)),s=new C(e.substr(0,r.bitLength()/4),16),o=n.modPow(a,t).mod(r),c=a.modInverse(r).multiply(s.add(i.multiply(o))).mod(r);return fe.asn1.ASN1Util.jsonToASN1HEX({seq:[{int:{bigint:o}},{int:{bigint:c}}]})},this.verifyWithMessageHash=function(e,t){var r=this.p,n=this.q,i=this.g,a=this.y,s=this.parseASN1Signature(t),o=s[0],c=s[1],u=new C(e.substr(0,n.bitLength()/4),16);if(C.ZERO.compareTo(o)>0||o.compareTo(n)>0)throw"invalid DSA signature";if(C.ZERO.compareTo(c)>=0||c.compareTo(n)>0)throw"invalid DSA signature";var f=c.modInverse(n),h=u.multiply(f).mod(n),l=o.multiply(f).mod(n);return 0==i.modPow(h,r).multiply(a.modPow(l,r)).mod(r).mod(n).compareTo(o)},this.parseASN1Signature=function(e){try{return[new n(t(e,0,[0],"02"),16),new n(t(e,0,[1],"02"),16)]}catch(e){throw new Error("malformed ASN.1 DSA signature")}},this.readPKCS5PrvKeyHex=function(e){var n,i,a,s,o;if(!1===r(e))throw new Error("not ASN.1 hex string");try{n=t(e,0,[1],"02"),i=t(e,0,[2],"02"),a=t(e,0,[3],"02"),s=t(e,0,[4],"02"),o=t(e,0,[5],"02")}catch(e){throw new Error("malformed PKCS#1/5 plain DSA private key")}this.setPrivateHex(n,i,a,s,o)},this.readPKCS8PrvKeyHex=function(e){var n,i,a,s;if(!1===r(e))throw new Error("not ASN.1 hex string");try{n=t(e,0,[1,1,0],"02"),i=t(e,0,[1,1,1],"02"),a=t(e,0,[1,1,2],"02"),s=t(e,0,[2,0],"02")}catch(e){throw new Error("malformed PKCS#8 plain DSA private key")}this.setPrivateHex(n,i,a,null,s)},this.readPKCS8PubKeyHex=function(e){var n,i,a,s;if(!1===r(e))throw new Error("not ASN.1 hex string");try{n=t(e,0,[0,1,0],"02"),i=t(e,0,[0,1,1],"02"),a=t(e,0,[0,1,2],"02"),s=t(e,0,[1,0],"02")}catch(e){throw new Error("malformed PKCS#8 DSA public key")}this.setPublicHex(n,i,a,s)},this.readCertPubKeyHex=function(e,n){var i,a,s,o;if(!1===r(e))throw new Error("not ASN.1 hex string");try{i=t(e,0,[0,5,0,1,0],"02"),a=t(e,0,[0,5,0,1,1],"02"),s=t(e,0,[0,5,0,1,2],"02"),o=t(e,0,[0,5,1,0],"02")}catch(e){throw new Error("malformed X.509 certificate DSA public key")}this.setPublicHex(i,a,s,o)}};var Xe=function(){var e=function(e,r,n){return t(v.AES,e,r,n)},t=function(e,t,r,n){var i=v.enc.Hex.parse(t),a=v.enc.Hex.parse(r),s=v.enc.Hex.parse(n),o={};o.key=a,o.iv=s,o.ciphertext=i;var c=e.decrypt(o,a,{iv:s});return v.enc.Hex.stringify(c)},r=function(e,t,r){return n(v.AES,e,t,r)},n=function(e,t,r,n){var i=v.enc.Hex.parse(t),a=v.enc.Hex.parse(r),s=v.enc.Hex.parse(n),o=e.encrypt(i,a,{iv:s}),c=v.enc.Hex.parse(o.toString());return v.enc.Base64.stringify(c)},i={"AES-256-CBC":{proc:e,eproc:r,keylen:32,ivlen:16},"AES-192-CBC":{proc:e,eproc:r,keylen:24,ivlen:16},"AES-128-CBC":{proc:e,eproc:r,keylen:16,ivlen:16},"DES-EDE3-CBC":{proc:function(e,r,n){return t(v.TripleDES,e,r,n)},eproc:function(e,t,r){return n(v.TripleDES,e,t,r)},keylen:24,ivlen:8},"DES-CBC":{proc:function(e,r,n){return t(v.DES,e,r,n)},eproc:function(e,t,r){return n(v.DES,e,t,r)},keylen:8,ivlen:8}},a=function(e){var t={},r=e.match(new RegExp("DEK-Info: ([^,]+),([0-9A-Fa-f]+)","m"));r&&(t.cipher=r[1],t.ivsalt=r[2]);var n=e.match(new RegExp("-----BEGIN ([A-Z]+) PRIVATE KEY-----"));n&&(t.type=n[1]);var i=-1,a=0;-1!=e.indexOf("\r\n\r\n")&&(i=e.indexOf("\r\n\r\n"),a=2),-1!=e.indexOf("\n\n")&&(i=e.indexOf("\n\n"),a=1);var s=e.indexOf("-----END");if(-1!=i&&-1!=s){var o=e.substring(i+2*a,s-a);o=o.replace(/\s+/g,""),t.data=o}return t},s=function(e,t,r){for(var n=r.substring(0,16),a=v.enc.Hex.parse(n),s=v.enc.Utf8.parse(t),o=i[e].keylen+i[e].ivlen,c="",u=null;;){var f=v.algo.MD5.create();if(null!=u&&f.update(u),f.update(s),f.update(a),u=f.finalize(),(c+=v.enc.Hex.stringify(u)).length>=2*o)break}var h={};return h.keyhex=c.substr(0,2*i[e].keylen),h.ivhex=c.substr(2*i[e].keylen,2*i[e].ivlen),h},o=function(e,t,r,n){var a=v.enc.Base64.parse(e),s=v.enc.Hex.stringify(a);return(0,i[t].proc)(s,r,n)};return{version:"1.0.0",parsePKCS5PEM:function(e){return a(e)},getKeyAndUnusedIvByPasscodeAndIvsalt:function(e,t,r){return s(e,t,r)},decryptKeyB64:function(e,t,r,n){return o(e,t,r,n)},getDecryptedKeyHex:function(e,t){var r=a(e),n=(r.type,r.cipher),i=r.ivsalt,c=r.data,u=s(n,t,i).keyhex;return o(c,n,u,i)},getEncryptedPKCS5PEMFromPrvKeyHex:function(e,t,r,n,a){var o="";if(void 0!==n&&null!=n||(n="AES-256-CBC"),void 0===i[n])throw new Error("KEYUTIL unsupported algorithm: "+n);if(void 0===a||null==a){var c=function(e){var t=v.lib.WordArray.random(e);return v.enc.Hex.stringify(t)}(i[n].ivlen);a=c.toUpperCase()}var u=function(e,t,r,n){return(0,i[t].eproc)(e,r,n)}(t,n,s(n,r,a).keyhex,a);return o="-----BEGIN "+e+" PRIVATE KEY-----\r\n",o+="Proc-Type: 4,ENCRYPTED\r\n",o+="DEK-Info: "+n+","+a+"\r\n",o+="\r\n",(o+=u.replace(/(.{64})/g,"$1\r\n"))+"\r\n-----END "+e+" PRIVATE KEY-----\r\n"},getEncryptedPKCS8PEM:function(e,t,r){return Be(this.getEncryptedPKCS8Hex(e,t,r),"ENCRYPTED PRIVATE KEY")},getEncryptedPKCS8Hex:function(e,t,r){var n;(n=null==r||null==r?{}:JSON.parse(JSON.stringify(r))).plain=e,this.initPBES2Param(n),this.encryptPBES2Param(n,t);var i=this.generatePBES2ASN1Param(n);return fe.asn1.ASN1Util.newObject(i).tohex()},initPBES2Param:function(e){var t;null==ze(e,"encalg")&&(e.encalg="aes256-CBC"),null==ze(e,"iter")&&(e.iter=2048),null==ze(e,"prf")&&(e.prf="hmacWithSHA256"),null==ze(e,"salt")&&(e.salt=v.enc.Hex.stringify(v.lib.WordArray.random(8))),null==ze(e,"enciv")&&("des-EDE3-CBC"==e.encalg&&(t=8),"aes128-CBC"==e.encalg&&(t=16),"aes256-CBC"==e.encalg&&(t=16),e.enciv=v.enc.Hex.stringify(v.lib.WordArray.random(t)))},encryptPBES2Param:function(e,t){var r=Xe.getDKFromPBES2Param(e,t);try{var n=fe.crypto.Cipher.encrypt(e.plain,r,e.encalg,{iv:e.enciv})}catch(t){throw new Error("encrypt error: "+e.plain+" "+r+" "+e.encalg+" "+e.enciv)}e.enc=n},generatePBES2ASN1Param:function(e){var t={seq:[{seq:[{oid:"pkcs5PBES2"},{seq:[{seq:[{oid:"pkcs5PBKDF2"},{seq:[{octstr:{hex:e.salt}},{int:{hex:je(e.iter)}}]}]},{seq:[{oid:e.encalg},{octstr:{hex:e.enciv}}]}]}]},{octstr:{hex:e.enc}}]};return"hmacWithSHA1"!=e.prf&&t.seq[0].seq[1].seq[0].seq[1].seq.push({seq:[{oid:e.prf},{null:""}]}),t},parseHexOfEncryptedPKCS8:function(e){var t=de,r=t.getChildIdx,n=t.getV,i={},a=r(e,0);if(2!=a.length)throw new Error("malformed format: SEQUENCE(0).items != 2: "+a.length);i.ciphertext=n(e,a[1]);var s=r(e,a[0]);if(2!=s.length)throw new Error("malformed format: SEQUENCE(0.0).items != 2: "+s.length);if("2a864886f70d01050d"!=n(e,s[0]))throw new Error("this only supports pkcs5PBES2");var o=r(e,s[1]);if(2!=s.length)throw new Error("malformed format: SEQUENCE(0.0.1).items != 2: "+o.length);var c=r(e,o[1]);if(2!=c.length)throw new Error("malformed format: SEQUENCE(0.0.1.1).items != 2: "+c.length);if("2a864886f70d0307"!=n(e,c[0]))throw"this only supports TripleDES";i.encryptionSchemeAlg="TripleDES",i.encryptionSchemeIV=n(e,c[1]);var u=r(e,o[0]);if(2!=u.length)throw new Error("malformed format: SEQUENCE(0.0.1.0).items != 2: "+u.length);if("2a864886f70d01050c"!=n(e,u[0]))throw new Error("this only supports pkcs5PBKDF2");var f=r(e,u[1]);if(f.length<2)throw new Error("malformed format: SEQUENCE(0.0.1.0.1).items < 2: "+f.length);i.pbkdf2Salt=n(e,f[0]);var h=n(e,f[1]);try{i.pbkdf2Iter=parseInt(h,16)}catch(e){throw new Error("malformed format pbkdf2Iter: "+h)}return i},getPBKDF2KeyHexFromParam:function(e,t){var r=v.enc.Hex.parse(e.pbkdf2Salt),n=e.pbkdf2Iter,i=v.PBKDF2(t,r,{keySize:6,iterations:n});return v.enc.Hex.stringify(i)},_getPlainPKCS8HexFromEncryptedPKCS8PEM:function(e,t){var r=xe(e,"ENCRYPTED PRIVATE KEY"),n=this.parseHexOfEncryptedPKCS8(r),i=Xe.getPBKDF2KeyHexFromParam(n,t),a={};a.ciphertext=v.enc.Hex.parse(n.ciphertext);var s=v.enc.Hex.parse(i),o=v.enc.Hex.parse(n.encryptionSchemeIV),c=v.TripleDES.decrypt(a,s,{iv:o});return v.enc.Hex.stringify(c)},parsePBES2:function(e){var t=de.parse(e);if("pkcs5PBES2"!=ze(t,"seq.0.seq.0.oid")||"pkcs5PBKDF2"!=ze(t,"seq.0.seq.1.seq.0.seq.0.oid"))throw new Error("not pkcs5PBES2 and pkcs5PBKDF2 used");var r=ze(t,"seq.0.seq.1.seq.0.seq.1.seq");if(null==r)throw new Error("PBKDF2 parameter not found");var n=ze(r,"0.octstr.hex"),i=ze(r,"1.int.hex"),a=ze(r,"2.seq.0.oid","hmacWithSHA1"),s=-1;try{s=parseInt(i,16)}catch(e){throw new Error("iter not proper value")}var o=ze(t,"seq.0.seq.1.seq.1.seq.0.oid"),c=ze(t,"seq.0.seq.1.seq.1.seq.1.octstr.hex"),u=ze(t,"seq.1.octstr.hex");if(null==o||null==c||null==u)throw new Error("encalg, enciv or enc is undefined");return{salt:n,iter:s,prf:a,encalg:o,enciv:c,enc:u}},getDKFromPBES2Param:function(e,t){var r={hmacWithSHA1:v.algo.SHA1,hmacWithSHA224:v.algo.SHA224,hmacWithSHA256:v.algo.SHA256,hmacWithSHA384:v.algo.SHA384,hmacWithSHA512:v.algo.SHA512}[e.prf];if(null==r)throw new Error("unsupported prf");var n={"des-EDE3-CBC":6,"aes128-CBC":4,"aes256-CBC":8}[e.encalg];if(null==n)throw new Error("unsupported encalg");var i=v.enc.Hex.parse(e.salt),a=e.iter;try{var s=v.PBKDF2(t,i,{keySize:n,iterations:a,hasher:r});return v.enc.Hex.stringify(s)}catch(r){throw new Error("PBKDF2 error: "+r+" "+JSON.stringify(e)+" "+t)}},getPlainHexFromEncryptedPKCS8PEM:function(e,t){if(-1==e.indexOf("BEGIN ENCRYPTED PRIVATE KEY"))throw new Error("not Encrypted PKCS#8 PEM string");var r,n=xe(e);try{r=Xe.parsePBES2(n)}catch(e){throw new Error("malformed PBES2 format: "+e.message)}var i=Xe.getDKFromPBES2Param(r,t);return fe.crypto.Cipher.decrypt(r.enc,i,r.encalg,{iv:r.enciv})},getKeyFromEncryptedPKCS8PEM:function(e,t){var r=this.getPlainHexFromEncryptedPKCS8PEM(e,t);return this.getKeyFromPlainPrivatePKCS8Hex(r)},parsePlainPrivatePKCS8Hex:function(e){var t=de,r=t.getChildIdx,n=t.getV,i={algparam:null};if("30"!=e.substr(0,2))throw new Error("malformed plain PKCS8 private key(code:001)");var a=r(e,0);if(a.length<3)throw new Error("malformed plain PKCS8 private key(code:002)");if("30"!=e.substr(a[1],2))throw new Error("malformed PKCS8 private key(code:003)");var s=r(e,a[1]);if(2!=s.length)throw new Error("malformed PKCS8 private key(code:004)");if("06"!=e.substr(s[0],2))throw new Error("malformed PKCS8 private key(code:005)");if(i.algoid=n(e,s[0]),"06"==e.substr(s[1],2)&&(i.algparam=n(e,s[1])),"04"!=e.substr(a[2],2))throw new Error("malformed PKCS8 private key(code:006)");return i.keyidx=t.getVidx(e,a[2]),i},getKeyFromPlainPrivatePKCS8PEM:function(e){var t=xe(e,"PRIVATE KEY");return this.getKeyFromPlainPrivatePKCS8Hex(t)},getKeyFromPlainPrivatePKCS8Hex:function(e){var t,r=this.parsePlainPrivatePKCS8Hex(e);if("2a864886f70d010101"==r.algoid)t=new ae;else if("2a8648ce380401"==r.algoid)t=new fe.crypto.DSA;else{if("2a8648ce3d0201"!=r.algoid)throw new Error("unsupported private key algorithm");t=new fe.crypto.ECDSA}return t.readPKCS8PrvKeyHex(e),t},_getKeyFromPublicPKCS8Hex:function(e){var t,r=de.getVbyList(e,0,[0,0],"06");if("2a864886f70d010101"===r)t=new ae;else if("2a8648ce380401"===r)t=new fe.crypto.DSA;else{if("2a8648ce3d0201"!==r)throw new Error("unsupported PKCS#8 public key hex");t=new fe.crypto.ECDSA}return t.readPKCS8PubKeyHex(e),t},parsePublicRawRSAKeyHex:function(e){var t=de,r=t.getChildIdx,n=t.getV,i={};if("30"!=e.substr(0,2))throw new Error("malformed RSA key(code:001)");var a=r(e,0);if(2!=a.length)throw new Error("malformed RSA key(code:002)");if("02"!=e.substr(a[0],2))throw new Error("malformed RSA key(code:003)");if(i.n=n(e,a[0]),"02"!=e.substr(a[1],2))throw new Error("malformed RSA key(code:004)");return i.e=n(e,a[1]),i},parsePublicPKCS8Hex:function(e){var t=de,r=t.getChildIdx,n=t.getV,i={algparam:null},a=r(e,0);if(2!=a.length)throw new Error("outer DERSequence shall have 2 elements: "+a.length);var s=a[0];if("30"!=e.substr(s,2))throw new Error("malformed PKCS8 public key(code:001)");var o=r(e,s);if(2!=o.length)throw new Error("malformed PKCS8 public key(code:002)");if("06"!=e.substr(o[0],2))throw new Error("malformed PKCS8 public key(code:003)");if(i.algoid=n(e,o[0]),"06"==e.substr(o[1],2)?i.algparam=n(e,o[1]):"30"==e.substr(o[1],2)&&(i.algparam={},i.algparam.p=t.getVbyList(e,o[1],[0],"02"),i.algparam.q=t.getVbyList(e,o[1],[1],"02"),i.algparam.g=t.getVbyList(e,o[1],[2],"02")),"03"!=e.substr(a[1],2))throw new Error("malformed PKCS8 public key(code:004)");return i.key=n(e,a[1]).substr(2),i}}}();function Ye(e,t){for(var r="",n=t/4-e.length,i=0;i<n;i++)r+="0";return r+e}function Je(e,t,r){for(var n="",i=0;n.length<t;)n+=Ce(r(Ae(e+String.fromCharCode.apply(String,[(4278190080&i)>>24,(16711680&i)>>16,(65280&i)>>8,255&i])))),i+=1;return n}function Qe(e){for(var t in fe.crypto.Util.DIGESTINFOHEAD){var r=fe.crypto.Util.DIGESTINFOHEAD[t],n=r.length;if(e.substring(0,n)==r)return[t,e.substring(n)]}return[]}function Ze(e){var t,r=de,n=r.getChildIdx,i=r.getV,a=(r.dump,r.parse),s=r.getTLV,o=r.getVbyList,c=r.getVbyListEx,u=r.getTLVbyList,f=r.getTLVbyListEx,h=r.getIdxbyList,l=r.getIdxbyListEx,d=r.getVidx,p=r.getInt,g=r.oidname,y=r.hextooidstr,v=xe,m=Error;try{t=fe.asn1.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV}catch(e){}this.HEX2STAG={"0c":"utf8",13:"prn",16:"ia5","1a":"vis","1e":"bmp"},this.hex=null,this.version=0,this.foffset=0,this.aExtInfo=null,this.getVersion=function(){if(null===this.hex||0!==this.version)return this.version;var e=u(this.hex,0,[0,0]);if("a0"==e.substr(0,2)){var t=u(e,0,[0]),r=p(t,0);if(r<0||2<r)throw new Error("malformed version field");return this.version=r+1,this.version}return this.version=1,this.foffset=-1,1},this.getSerialNumberHex=function(){return c(this.hex,0,[0,0],"02")},this.getSignatureAlgorithmField=function(){var e=f(this.hex,0,[0,1]);return this.getAlgorithmIdentifierName(e)},this.getAlgorithmIdentifierName=function(e){for(var r in t)if(e===t[r])return r;return g(c(e,0,[0],"06"))},this.getIssuer=function(e,t){return this.getX500Name(this.getIssuerHex(),e,t)},this.getIssuerHex=function(){return u(this.hex,0,[0,3+this.foffset],"30")},this.getIssuerString=function(){return this.getIssuer().str},this.getSubject=function(e,t){return this.getX500Name(this.getSubjectHex(),e,t)},this.getSubjectHex=function(){return u(this.hex,0,[0,5+this.foffset],"30")},this.getSubjectString=function(){return this.getSubject().str},this.getNotBefore=function(){var e=o(this.hex,0,[0,4+this.foffset,0]);return e=e.replace(/(..)/g,"%$1"),decodeURIComponent(e)},this.getNotAfter=function(){var e=o(this.hex,0,[0,4+this.foffset,1]);return e=e.replace(/(..)/g,"%$1"),decodeURIComponent(e)},this.getPublicKeyHex=function(){return this.getSPKI()},this.getSPKI=function(){return u(this.hex,0,[0,6+this.foffset],"30")},this.getSPKIValue=function(){var e=this.getSPKI();return null==e?null:o(e,0,[1],"03",!0)},this.getPublicKeyIdx=function(){return h(this.hex,0,[0,6+this.foffset],"30")},this.getPublicKeyContentIdx=function(){var e=this.getPublicKeyIdx();return h(this.hex,e,[1,0],"30")},this.getPublicKey=function(){return Xe.getKey(this.getPublicKeyHex(),null,"pkcs8pub")},this.getSignatureAlgorithmName=function(){var e=u(this.hex,0,[1],"30");return this.getAlgorithmIdentifierName(e)},this.getSignatureValueHex=function(){return o(this.hex,0,[2],"03",!0)},this.verifySignature=function(e){var t=this.getSignatureAlgorithmField(),r=this.getSignatureValueHex(),n=u(this.hex,0,[0],"30"),i=new fe.crypto.Signature({alg:t});return i.init(e),i.updateHex(n),i.verify(r)},this.parseExt=function(e){var t,a,s;if(void 0===e){if(s=this.hex,3!==this.version)return-1;t=h(s,0,[0,7,0],"30"),a=n(s,t)}else{s=xe(e);var c=h(s,0,[0,3,0,0],"06");if("2a864886f70d01090e"!=i(s,c))return void(this.aExtInfo=new Array);t=h(s,0,[0,3,0,1,0],"30"),a=n(s,t),this.hex=s}this.aExtInfo=new Array;for(var u=0;u<a.length;u++){var f={critical:!1},l=0;3===n(s,a[u]).length&&(f.critical=!0,l=1),f.oid=r.hextooidstr(o(s,a[u],[0],"06"));var p=h(s,a[u],[1+l]);f.vidx=d(s,p),this.aExtInfo.push(f)}},this.getExtInfo=function(e){var t=this.aExtInfo,r=e;if(e.match(/^[0-9.]+$/)||(r=fe.asn1.x509.OID.name2oid(e)),""!==r)for(var n=0;n<t.length;n++)if(t[n].oid===r)return t[n]},this.getCriticalExtV=function(e,t,r){if(null!=t)return[t,r];var n=this.getExtInfo(e);return null==n?[null,null]:[s(this.hex,n.vidx),n.critical]},this.getExtBasicConstraints=function(e,t){if(void 0===e&&void 0===t){var r=this.getExtInfo("basicConstraints");if(void 0===r)return;e=s(this.hex,r.vidx),t=r.critical}var n={extname:"basicConstraints"};if(t&&(n.critical=!0),"3000"===e)return n;if("30030101ff"===e)return n.cA=!0,n;if("30060101ff02"===e.substr(0,12)){var a=i(e,10),o=parseInt(a,16);return n.cA=!0,n.pathLen=o,n}throw new Error("hExtV parse error: "+e)},this.getExtNameConstraints=function(e,t){var r=this.getCriticalExtV("nameConstraints",e,t);if(e=r[0],t=r[1],null!=e){var i={extname:"nameConstraints"};t&&(i.critical=!0);for(var a=n(e,0),o=0;o<a.length;o++){for(var c=[],u=n(e,a[o]),f=0;f<u.length;f++){var h=s(e,u[f]),l=this.getGeneralSubtree(h);c.push(l)}var d=e.substr(a[o],2);"a0"==d?i.permit=c:"a1"==d&&(i.exclude=c)}return i}},this.getGeneralSubtree=function(e){var t=n(e,0),r=t.length;if(r<1||2<r)throw new Error("wrong num elements");for(var a=this.getGeneralName(s(e,t[0])),o=1;o<r;o++){var c=e.substr(t[o],2),u=i(e,t[o]),f=parseInt(u,16);"80"==c&&(a.min=f),"81"==c&&(a.max=f)}return a},this.getExtKeyUsage=function(e,t){var r=this.getCriticalExtV("keyUsage",e,t);if(e=r[0],t=r[1],null!=e){var n={extname:"keyUsage"};return t&&(n.critical=!0),n.names=this.getExtKeyUsageString(e).split(","),n}},this.getExtKeyUsageBin=function(e){if(void 0===e){var t=this.getExtInfo("keyUsage");if(void 0===t)return"";e=s(this.hex,t.vidx)}if(8!=e.length&&10!=e.length)throw new Error("malformed key usage value: "+e);var r="000000000000000"+parseInt(e.substr(6),16).toString(2);return 8==e.length&&(r=r.slice(-8)),10==e.length&&(r=r.slice(-16)),""==(r=r.replace(/0+$/,""))&&(r="0"),r},this.getExtKeyUsageString=function(e){for(var t=this.getExtKeyUsageBin(e),r=new Array,n=0;n<t.length;n++)"1"==t.substr(n,1)&&r.push(Ze.KEYUSAGE_NAME[n]);return r.join(",")},this.getExtSubjectKeyIdentifier=function(e,t){if(void 0===e&&void 0===t){var r=this.getExtInfo("subjectKeyIdentifier");if(void 0===r)return;e=s(this.hex,r.vidx),t=r.critical}var n={extname:"subjectKeyIdentifier"};t&&(n.critical=!0);var a=i(e,0);return n.kid={hex:a},n},this.getExtAuthorityKeyIdentifier=function(e,t){if(void 0===e&&void 0===t){var r=this.getExtInfo("authorityKeyIdentifier");if(void 0===r)return;e=s(this.hex,r.vidx),t=r.critical}var a={extname:"authorityKeyIdentifier"};t&&(a.critical=!0);for(var o=n(e,0),c=0;c<o.length;c++){var u=e.substr(o[c],2);if("80"===u&&(a.kid={hex:i(e,o[c])}),"a1"===u){var f=s(e,o[c]),h=this.getGeneralNames(f);a.issuer=h[0].dn}"82"===u&&(a.sn={hex:i(e,o[c])})}return a},this.getExtExtKeyUsage=function(e,t){if(void 0===e&&void 0===t){var r=this.getExtInfo("extKeyUsage");if(void 0===r)return;e=s(this.hex,r.vidx),t=r.critical}var a={extname:"extKeyUsage",array:[]};t&&(a.critical=!0);for(var o=n(e,0),c=0;c<o.length;c++)a.array.push(g(i(e,o[c])));return a},this.getExtExtKeyUsageName=function(){var e=this.getExtInfo("extKeyUsage");if(void 0===e)return e;var t=new Array,r=s(this.hex,e.vidx);if(""===r)return t;for(var a=n(r,0),o=0;o<a.length;o++)t.push(g(i(r,a[o])));return t},this.getExtSubjectAltName=function(e,t){if(void 0===e&&void 0===t){var r=this.getExtInfo("subjectAltName");if(void 0===r)return;e=s(this.hex,r.vidx),t=r.critical}var n={extname:"subjectAltName",array:[]};return t&&(n.critical=!0),n.array=this.getGeneralNames(e),n},this.getExtIssuerAltName=function(e,t){if(void 0===e&&void 0===t){var r=this.getExtInfo("issuerAltName");if(void 0===r)return;e=s(this.hex,r.vidx),t=r.critical}var n={extname:"issuerAltName",array:[]};return t&&(n.critical=!0),n.array=this.getGeneralNames(e),n},this.getGeneralNames=function(e){for(var t=n(e,0),r=[],i=0;i<t.length;i++){var a=this.getGeneralName(s(e,t[i]));void 0!==a&&r.push(a)}return r},this.getGeneralName=function(e){var t=e.substr(0,2),r=i(e,0),n=Ce(r);return"81"==t?{rfc822:n}:"82"==t?{dns:n}:"86"==t?{uri:n}:"87"==t?{ip:De(r)}:"a4"==t?{dn:this.getX500Name(r)}:"a0"==t?{other:this.getOtherName(e)}:void 0},this.getExtSubjectAltName2=function(){var e,t,r,a=this.getExtInfo("subjectAltName");if(void 0===a)return a;for(var o=new Array,c=s(this.hex,a.vidx),u=n(c,0),f=0;f<u.length;f++)r=c.substr(u[f],2),e=i(c,u[f]),"81"===r&&(t=Se(e),o.push(["MAIL",t])),"82"===r&&(t=Se(e),o.push(["DNS",t])),"84"===r&&(t=Ze.hex2dn(e,0),o.push(["DN",t])),"86"===r&&(t=Se(e),o.push(["URI",t])),"87"===r&&(t=De(e),o.push(["IP",t]));return o},this.getExtCRLDistributionPoints=function(e,t){if(void 0===e&&void 0===t){var r=this.getExtInfo("cRLDistributionPoints");if(void 0===r)return;e=s(this.hex,r.vidx),t=r.critical}var i={extname:"cRLDistributionPoints",array:[]};t&&(i.critical=!0);for(var a=n(e,0),o=0;o<a.length;o++){var c=s(e,a[o]);i.array.push(this.getDistributionPoint(c))}return i},this.getDistributionPoint=function(e){for(var t={},r=n(e,0),i=0;i<r.length;i++){var a=e.substr(r[i],2),o=s(e,r[i]);"a0"==a&&(t.dpname=this.getDistributionPointName(o))}return t},this.getDistributionPointName=function(e){for(var t={},r=n(e,0),i=0;i<r.length;i++){var a=e.substr(r[i],2),o=s(e,r[i]);"a0"==a&&(t.full=this.getGeneralNames(o))}return t},this.getExtCRLDistributionPointsURI=function(){var e=this.getExtCRLDistributionPoints();if(null==e)return e;for(var t=e.array,r=[],n=0;n<t.length;n++)try{null!=t[n].dpname.full[0].uri&&r.push(t[n].dpname.full[0].uri)}catch(e){}return r},this.getExtAIAInfo=function(){var e=this.getExtInfo("authorityInfoAccess");if(void 0===e)return e;for(var t={ocsp:[],caissuer:[]},r=n(this.hex,e.vidx),i=0;i<r.length;i++){var a=o(this.hex,r[i],[0],"06"),s=o(this.hex,r[i],[1],"86");"2b06010505073001"===a&&t.ocsp.push(Se(s)),"2b06010505073002"===a&&t.caissuer.push(Se(s))}return t},this.getExtAuthorityInfoAccess=function(e,t){if(void 0===e&&void 0===t){var r=this.getExtInfo("authorityInfoAccess");if(void 0===r)return;e=s(this.hex,r.vidx),t=r.critical}var i={extname:"authorityInfoAccess",array:[]};t&&(i.critical=!0);for(var a=n(e,0),u=0;u<a.length;u++){var f=c(e,a[u],[0],"06"),h=Se(o(e,a[u],[1],"86"));if("2b06010505073001"==f)i.array.push({ocsp:h});else{if("2b06010505073002"!=f)throw new Error("unknown method: "+f);i.array.push({caissuer:h})}}return i},this.getExtCertificatePolicies=function(e,t){if(void 0===e&&void 0===t){var r=this.getExtInfo("certificatePolicies");if(void 0===r)return;e=s(this.hex,r.vidx),t=r.critical}var i={extname:"certificatePolicies",array:[]};t&&(i.critical=!0);for(var a=n(e,0),o=0;o<a.length;o++){var c=s(e,a[o]),u=this.getPolicyInformation(c);i.array.push(u)}return i},this.getPolicyInformation=function(e){var t={},r=o(e,0,[0],"06");t.policyoid=g(r);var i=l(e,0,[1],"30");if(-1!=i){t.array=[];for(var a=n(e,i),c=0;c<a.length;c++){var u=s(e,a[c]),f=this.getPolicyQualifierInfo(u);t.array.push(f)}}return t},this.getOtherName=function(e){var t={},r=n(e,0),i=o(e,r[0],[],"06"),s=o(e,r[1],[]);return t.oid=g(i),t.value=a(s),t},this.getPolicyQualifierInfo=function(e){var t={},r=o(e,0,[0],"06");if("2b06010505070201"===r){var n=c(e,0,[1],"16");t.cps=Ce(n)}else if("2b06010505070202"===r){var i=u(e,0,[1],"30");t.unotice=this.getUserNotice(i)}return t},this.getUserNotice=function(e){var t=null;try{return t=r.parse(e),this._asn1ToUnotice(t)}catch(e){return}},this._asn1ToUnotice=function(e){try{for(var t={},r=ze(e,"seq"),n=0;n<r.length;n++){var i=this._asn1ToNoticeRef(r[n]);null!=i&&(t.noticeref=i);var a=this.asn1ToDisplayText(r[n]);null!=a&&(t.exptext=a)}return Object.keys(t).length>0?t:void 0}catch(e){return}},this._asn1ToNoticeRef=function(e){try{for(var t={},r=ze(e,"seq"),n=0;n<r.length;n++){var i=this._asn1ToNoticeNum(r[n]);null!=i&&(t.noticenum=i);var a=this.asn1ToDisplayText(r[n]);null!=a&&(t.org=a)}return Object.keys(t).length>0?t:void 0}catch(e){return}},this._asn1ToNoticeNum=function(e){try{for(var t=ze(e,"seq"),r=[],n=0;n<t.length;n++){var i=t[n];r.push(parseInt(ze(i,"int.hex"),16))}return r}catch(e){return}},this.getDisplayText=function(e){var t={};return t.type={"0c":"utf8",16:"ia5","1a":"vis","1e":"bmp"}[e.substr(0,2)],t.str=Ce(i(e,0)),t},this.asn1ToDisplayText=function(e){return null!=e.utf8str?{type:"utf8",str:e.utf8str.str}:null!=e.ia5str?{type:"ia5",str:e.ia5str.str}:null!=e.visstr?{type:"vis",str:e.visstr.str}:null!=e.bmpstr?{type:"bmp",str:e.bmpstr.str}:null!=e.prnstr?{type:"prn",str:e.prnstr.str}:void 0},this.getExtPolicyMappings=function(e,t){var r=this.getCriticalExtV("policyMappings",e,t);if(e=r[0],t=r[1],null!=e){var n={extname:"policyMappings"};t&&(n.critical=!0);try{for(var i=a(e).seq,s=[],o=0;o<i.length;o++){var c=i[o].seq;s.push([c[0].oid,c[1].oid])}n.array=s}catch(e){throw new m("malformed policyMappings")}return n}},this.getExtPolicyConstraints=function(e,t){var r=this.getCriticalExtV("policyConstraints",e,t);if(e=r[0],t=r[1],null!=e){var n={extname:"policyConstraints"};t&&(n.critical=!0);var i=a(e);try{for(var s=i.seq,o=0;o<s.length;o++){var c=s[o].tag;0==c.explicit&&("80"==c.tag&&(n.reqexp=parseInt(c.hex,16)),"81"==c.tag&&(n.inhibit=parseInt(c.hex,16)))}}catch(e){return new m("malformed policyConstraints value")}return n}},this.getExtInhibitAnyPolicy=function(e,t){var r=this.getCriticalExtV("inhibitAnyPolicy",e,t);if(e=r[0],t=r[1],null!=e){var n={extname:"inhibitAnyPolicy"};t&&(n.critical=!0);var i=p(e,0);return-1==i?new m("wrong value"):(n.skip=i,n)}},this.getExtCRLNumber=function(e,t){var r={extname:"cRLNumber"};if(t&&(r.critical=!0),"02"==e.substr(0,2))return r.num={hex:i(e,0)},r;throw new m("hExtV parse error: "+e)},this.getExtCRLReason=function(e,t){var r={extname:"cRLReason"};if(t&&(r.critical=!0),"0a"==e.substr(0,2))return r.code=parseInt(i(e,0),16),r;throw new Error("hExtV parse error: "+e)},this.getExtOcspNonce=function(e,t){var r={extname:"ocspNonce"};t&&(r.critical=!0);var n=i(e,0);return r.hex=n,r},this.getExtOcspNoCheck=function(e,t){var r={extname:"ocspNoCheck"};return t&&(r.critical=!0),r},this.getExtAdobeTimeStamp=function(e,t){if(void 0===e&&void 0===t){var r=this.getExtInfo("adobeTimeStamp");if(void 0===r)return;e=s(this.hex,r.vidx),t=r.critical}var i={extname:"adobeTimeStamp"};t&&(i.critical=!0);var a=n(e,0);if(a.length>1){var o=s(e,a[1]),c=this.getGeneralName(o);null!=c.uri&&(i.uri=c.uri)}if(a.length>2){var u=s(e,a[2]);"0101ff"==u&&(i.reqauth=!0),"010100"==u&&(i.reqauth=!1)}return i},this.getExtSubjectDirectoryAttributes=function(e,t){if(void 0===e&&void 0===t){var r=this.getExtInfo("subjectDirectoryAttributes");if(void 0===r)return;e=s(this.hex,r.vidx),t=r.critical}var n={extname:"subjectDirectoryAttributes"};t&&(n.critical=!0);try{for(var i=a(e),o=[],c=0;c<i.seq.length;c++){var u=i.seq[c],f=ze(u,"seq.0.oid"),h=ze(u,"seq.1.set");if(null==f||null==h)throw"error";o.push({attr:f,array:h})}return n.array=o,n}catch(e){throw new Error("malformed subjectDirectoryAttributes extension value")}};var b=function(e){var t={};try{var r=e.seq[0].oid,n=fe.asn1.x509.OID.name2oid(r);t.type=fe.asn1.x509.OID.oid2atype(n);var i=e.seq[1];if(null!=i.utf8str)t.ds="utf8",t.value=i.utf8str.str;else if(null!=i.numstr)t.ds="num",t.value=i.numstr.str;else if(null!=i.telstr)t.ds="tel",t.value=i.telstr.str;else if(null!=i.prnstr)t.ds="prn",t.value=i.prnstr.str;else if(null!=i.ia5str)t.ds="ia5",t.value=i.ia5str.str;else if(null!=i.visstr)t.ds="vis",t.value=i.visstr.str;else{if(null==i.bmpstr)throw"error";t.ds="bmp",t.value=i.bmpstr.str}return t}catch(e){throw new Erorr("improper ASN.1 parsed AttrTypeAndValue")}},w=function(e){try{return e.set.map((function(e){return b(e)}))}catch(e){throw new Error("improper ASN.1 parsed RDN: "+e)}};this.getX500NameRule=function(e){for(var t=null,r=[],n=0;n<e.length;n++)for(var i=e[n],a=0;a<i.length;a++)r.push(i[a]);for(n=0;n<r.length;n++){var s=r[n],o=s.ds,c=s.value,u=s.type;if("prn"!=o&&"utf8"!=o&&"ia5"!=o)return"mixed";if("ia5"==o){if("CN"!=u)return"mixed";if(fe.lang.String.isMail(c))continue;return"mixed"}if("C"==u){if("prn"==o)continue;return"mixed"}if(null==t)t=o;else if(t!==o)return"mixed"}return null==t?"prn":t},this.getAttrTypeAndValue=function(e){var t=a(e);return b(t)},this.getRDN=function(e){var t=a(e);return w(t)},this.getX500NameArray=function(e){return function(e){try{return e.seq.map((function(e){return w(e)}))}catch(e){throw new Error("improper ASN.1 parsed X500Name: "+e)}}(a(e))},this.getX500Name=function(e,t,r){var n=this.getX500NameArray(e),i={str:this.dnarraytostr(n)};return i.array=n,1==r&&(i.hex=e),1==t&&(i.canon=this.c14nRDNArray(n)),i},this.readCertPEM=function(e){this.readCertHex(v(e))},this.readCertHex=function(e){this.hex=e,this.getVersion();try{h(this.hex,0,[0,7],"a3"),this.parseExt()}catch(e){}},this.getParam=function(e){var t={};return null==e&&(e={}),t.version=this.getVersion(),t.serial={hex:this.getSerialNumberHex()},t.sigalg=this.getSignatureAlgorithmField(),t.issuer=this.getIssuer(e.dncanon,e.dnhex),t.notbefore=this.getNotBefore(),t.notafter=this.getNotAfter(),t.subject=this.getSubject(e.dncanon,e.dnhex),t.sbjpubkey=Be(this.getPublicKeyHex(),"PUBLIC KEY"),null!=this.aExtInfo&&this.aExtInfo.length>0&&(t.ext=this.getExtParamArray()),t.sighex=this.getSignatureValueHex(),1==e.tbshex&&(t.tbshex=u(this.hex,0,[0])),1==e.nodnarray&&(delete t.issuer.array,delete t.subject.array),t},this.getExtParamArray=function(e){null==e&&-1!=l(this.hex,0,[0,"[3]"])&&(e=f(this.hex,0,[0,"[3]",0],"30"));for(var t=[],r=n(e,0),i=0;i<r.length;i++){var a=s(e,r[i]),o=this.getExtParam(a);null!=o&&t.push(o)}return t},this.getExtParam=function(e){var t=n(e,0).length;if(2!=t&&3!=t)throw new Error("wrong number elements in Extension: "+t+" "+e);var r=y(o(e,0,[0],"06")),i=!1;3==t&&"0101ff"==u(e,0,[1])&&(i=!0);var s=u(e,0,[t-1,0]),c=void 0;if("2.5.29.14"==r?c=this.getExtSubjectKeyIdentifier(s,i):"2.5.29.15"==r?c=this.getExtKeyUsage(s,i):"2.5.29.17"==r?c=this.getExtSubjectAltName(s,i):"2.5.29.18"==r?c=this.getExtIssuerAltName(s,i):"2.5.29.19"==r?c=this.getExtBasicConstraints(s,i):"2.5.29.30"==r?c=this.getExtNameConstraints(s,i):"2.5.29.31"==r?c=this.getExtCRLDistributionPoints(s,i):"2.5.29.32"==r?c=this.getExtCertificatePolicies(s,i):"2.5.29.33"==r?c=this.getExtPolicyMappings(s,i):"2.5.29.35"==r?c=this.getExtAuthorityKeyIdentifier(s,i):"2.5.29.36"==r?c=this.getExtPolicyConstraints(s,i):"2.5.29.37"==r?c=this.getExtExtKeyUsage(s,i):"2.5.29.54"==r?c=this.getExtInhibitAnyPolicy(s,i):"1.3.6.1.5.5.7.1.1"==r?c=this.getExtAuthorityInfoAccess(s,i):"2.5.29.20"==r?c=this.getExtCRLNumber(s,i):"2.5.29.21"==r?c=this.getExtCRLReason(s,i):"2.5.29.9"==r?c=this.getExtSubjectDirectoryAttributes(s,i):"1.3.6.1.5.5.7.48.1.2"==r?c=this.getExtOcspNonce(s,i):"1.3.6.1.5.5.7.48.1.5"==r?c=this.getExtOcspNoCheck(s,i):"1.2.840.113583.1.1.9.1"==r?c=this.getExtAdobeTimeStamp(s,i):null!=Ze.EXT_PARSER[r]&&(c=Ze.EXT_PARSER[r](r,i,s)),null!=c)return c;var f={extname:r,extn:s};try{f.extn=a(s)}catch(e){}return i&&(f.critical=!0),f},this.findExt=function(e,t){for(var r=0;r<e.length;r++)if(e[r].extname==t)return e[r];return null},this.updateExtCDPFullURI=function(e,t){var r=this.findExt(e,"cRLDistributionPoints");if(null!=r&&null!=r.array)for(var n=r.array,i=0;i<n.length;i++)if(null!=n[i].dpname&&null!=n[i].dpname.full)for(var a=n[i].dpname.full,s=0;s<a.length;s++){var o=a[i];null!=o.uri&&(o.uri=t)}},this.updateExtAIAOCSP=function(e,t){var r=this.findExt(e,"authorityInfoAccess");if(null!=r&&null!=r.array)for(var n=r.array,i=0;i<n.length;i++)null!=n[i].ocsp&&(n[i].ocsp=t)},this.updateExtAIACAIssuer=function(e,t){var r=this.findExt(e,"authorityInfoAccess");if(null!=r&&null!=r.array)for(var n=r.array,i=0;i<n.length;i++)null!=n[i].caissuer&&(n[i].caissuer=t)},this.dnarraytostr=function(e){return"/"+e.map((function(e){return function(e){return e.map((function(e){return function(e){return e.type+"="+e.value}(e).replace(/\+/,"\\+")})).join("+")}(e).replace(/\//,"\\/")})).join("/")},this.setCanonicalizedDN=function(e){var t;if(null!=e.str&&null==e.array){var r=new fe.asn1.x509.X500Name({str:e.str}).tohex();t=this.getX500NameArray(r)}else t=e.array;null==e.canon&&(e.canon=this.c14nRDNArray(t))},this.c14nRDNArray=function(e){for(var t=[],r=0;r<e.length;r++){for(var n=e[r],i=[],a=0;a<n.length;a++){var s=n[a],o=s.value;o=(o=(o=(o=o.replace(/^\s*/,"")).replace(/\s*$/,"")).replace(/\s+/g," ")).toLowerCase(),i.push(s.type.toLowerCase()+"="+o)}t.push(i.join("+"))}return"/"+t.join("/")},this.getInfo=function(){var e,t,r,n=function(e){for(var t="",r=" ",n="\n",i=e.array,a=0;a<i.length;a++){var s=i[a];null!=s.dn&&(t+=r+"dn: "+s.dn.str+n),null!=s.ip&&(t+=r+"ip: "+s.ip+n),null!=s.rfc822&&(t+=r+"rfc822: "+s.rfc822+n),null!=s.dns&&(t+=r+"dns: "+s.dns+n),null!=s.uri&&(t+=r+"uri: "+s.uri+n),null!=s.other&&(t+=r+"other: "+s.other.oid+"="+JSON.stringify(s.other.value).replace(/\"/g,"")+n)}return t.replace(/\n$/,"")},i=function(e){for(var t="",r=e.array,n=0;n<r.length;n++){var i=r[n];if(t+=" policy oid: "+i.policyoid+"\n",void 0!==i.array)for(var a=0;a<i.array.length;a++){var s=i.array[a];void 0!==s.cps&&(t+=" cps: "+s.cps+"\n")}}return t},a=function(e){for(var t="",r=e.array,n=0;n<r.length;n++){var i=r[n];try{void 0!==i.dpname.full[0].uri&&(t+=" "+i.dpname.full[0].uri+"\n")}catch(e){}try{void 0!==i.dname.full[0].dn.hex&&(t+=" "+Ze.hex2dn(i.dpname.full[0].dn.hex)+"\n")}catch(e){}}return t},s=function(e){for(var t="",r=e.array,n=0;n<r.length;n++){var i=r[n];void 0!==i.caissuer&&(t+=" caissuer: "+i.caissuer+"\n"),void 0!==i.ocsp&&(t+=" ocsp: "+i.ocsp+"\n")}return t};if(e="Basic Fields\n",e+=" serial number: "+this.getSerialNumberHex()+"\n",e+=" signature algorithm: "+this.getSignatureAlgorithmField()+"\n",e+=" issuer: "+this.getIssuerString()+"\n",e+=" notBefore: "+this.getNotBefore()+"\n",e+=" notAfter: "+this.getNotAfter()+"\n",e+=" subject: "+this.getSubjectString()+"\n",e+=" subject public key info: \n",e+=" key algorithm: "+(t=this.getPublicKey()).type+"\n","RSA"===t.type&&(e+=" n="+Me(t.n.toString(16)).substr(0,16)+"...\n",e+=" e="+Me(t.e.toString(16))+"\n"),null!=(r=this.aExtInfo)){e+="X509v3 Extensions:\n";for(var o=0;o<r.length;o++){var c=r[o],u=fe.asn1.x509.OID.oid2name(c.oid);""===u&&(u=c.oid);var f="";if(!0===c.critical&&(f="CRITICAL"),e+=" "+u+" "+f+":\n","basicConstraints"===u){var h=this.getExtBasicConstraints();void 0===h.cA?e+=" {}\n":(e+=" cA=true",void 0!==h.pathLen&&(e+=", pathLen="+h.pathLen),e+="\n")}else{var l;if("policyMappings"==u)e+=" "+this.getExtPolicyMappings().array.map((function(e){var t=e;return t[0]+":"+t[1]})).join(", ")+"\n";else if("policyConstraints"==u)e+=" ",null!=(l=this.getExtPolicyConstraints()).reqexp&&(e+=" reqexp="+l.reqexp),null!=l.inhibit&&(e+=" inhibit="+l.inhibit),e+="\n";else if("inhibitAnyPolicy"==u)e+=" skip="+(l=this.getExtInhibitAnyPolicy()).skip+"\n";else if("keyUsage"==u)e+=" "+this.getExtKeyUsageString()+"\n";else if("subjectKeyIdentifier"==u)e+=" "+this.getExtSubjectKeyIdentifier().kid.hex+"\n";else if("authorityKeyIdentifier"==u){var d=this.getExtAuthorityKeyIdentifier();void 0!==d.kid&&(e+=" kid="+d.kid.hex+"\n")}else"extKeyUsage"==u?e+=" "+this.getExtExtKeyUsage().array.join(", ")+"\n":"subjectAltName"==u?e+=n(this.getExtSubjectAltName())+"\n":"cRLDistributionPoints"==u?e+=a(this.getExtCRLDistributionPoints()):"authorityInfoAccess"==u?e+=s(this.getExtAuthorityInfoAccess()):"certificatePolicies"==u&&(e+=i(this.getExtCertificatePolicies()))}}}return(e+="signature algorithm: "+this.getSignatureAlgorithmName()+"\n")+"signature: "+this.getSignatureValueHex().substr(0,16)+"...\n"},"string"==typeof e&&(-1!=e.indexOf("-----BEGIN")?this.readCertPEM(e):fe.lang.String.isHex(e)&&this.readCertHex(e))}Xe.getKey=function(e,t,r){var n,i=(v=de).getChildIdx,a=(v.getV,v.getVbyList),s=fe.crypto,o=s.ECDSA,c=s.DSA,u=ae,f=xe,h=Xe;if(void 0!==u&&e instanceof u)return e;if(void 0!==o&&e instanceof o)return e;if(void 0!==c&&e instanceof c)return e;if(void 0!==e.curve&&void 0!==e.xy&&void 0===e.d)return new o({pub:e.xy,curve:e.curve});if(void 0!==e.curve&&void 0!==e.d)return new o({prv:e.d,curve:e.curve});if(void 0===e.kty&&void 0!==e.n&&void 0!==e.e&&void 0===e.d)return(F=new u).setPublic(e.n,e.e),F;if(void 0===e.kty&&void 0!==e.n&&void 0!==e.e&&void 0!==e.d&&void 0!==e.p&&void 0!==e.q&&void 0!==e.dp&&void 0!==e.dq&&void 0!==e.co&&void 0===e.qi)return(F=new u).setPrivateEx(e.n,e.e,e.d,e.p,e.q,e.dp,e.dq,e.co),F;if(void 0===e.kty&&void 0!==e.n&&void 0!==e.e&&void 0!==e.d&&void 0===e.p)return(F=new u).setPrivate(e.n,e.e,e.d),F;if(void 0!==e.p&&void 0!==e.q&&void 0!==e.g&&void 0!==e.y&&void 0===e.x)return(F=new c).setPublic(e.p,e.q,e.g,e.y),F;if(void 0!==e.p&&void 0!==e.q&&void 0!==e.g&&void 0!==e.y&&void 0!==e.x)return(F=new c).setPrivate(e.p,e.q,e.g,e.y,e.x),F;if("RSA"===e.kty&&void 0!==e.n&&void 0!==e.e&&void 0===e.d)return(F=new u).setPublic(be(e.n),be(e.e)),F;if("RSA"===e.kty&&void 0!==e.n&&void 0!==e.e&&void 0!==e.d&&void 0!==e.p&&void 0!==e.q&&void 0!==e.dp&&void 0!==e.dq&&void 0!==e.qi)return(F=new u).setPrivateEx(be(e.n),be(e.e),be(e.d),be(e.p),be(e.q),be(e.dp),be(e.dq),be(e.qi)),F;if("RSA"===e.kty&&void 0!==e.n&&void 0!==e.e&&void 0!==e.d)return(F=new u).setPrivate(be(e.n),be(e.e),be(e.d)),F;if("EC"===e.kty&&void 0!==e.crv&&void 0!==e.x&&void 0!==e.y&&void 0===e.d){var l=(I=new o({curve:e.crv})).ecparams.keycharlen,d="04"+("0000000000"+be(e.x)).slice(-l)+("0000000000"+be(e.y)).slice(-l);return I.setPublicKeyHex(d),I}if("EC"===e.kty&&void 0!==e.crv&&void 0!==e.x&&void 0!==e.y&&void 0!==e.d){l=(I=new o({curve:e.crv})).ecparams.keycharlen,d="04"+("0000000000"+be(e.x)).slice(-l)+("0000000000"+be(e.y)).slice(-l);var p=("0000000000"+be(e.d)).slice(-l);return I.setPublicKeyHex(d),I.setPrivateKeyHex(p),I}if("pkcs5prv"===r){var g,y=e,v=de;if(9===(g=i(y,0)).length)(F=new u).readPKCS5PrvKeyHex(y);else if(6===g.length)(F=new c).readPKCS5PrvKeyHex(y);else{if(!(g.length>2&&"04"===y.substr(g[1],2)))throw new Error("unsupported PKCS#1/5 hexadecimal key");(F=new o).readPKCS5PrvKeyHex(y)}return F}if("pkcs8prv"===r)return h.getKeyFromPlainPrivatePKCS8Hex(e);if("pkcs8pub"===r)return h._getKeyFromPublicPKCS8Hex(e);if("x509pub"===r)return Ze.getPublicKeyFromCertHex(e);if(-1!=e.indexOf("-END CERTIFICATE-",0)||-1!=e.indexOf("-END X509 CERTIFICATE-",0)||-1!=e.indexOf("-END TRUSTED CERTIFICATE-",0))return Ze.getPublicKeyFromCertPEM(e);if(-1!=e.indexOf("-END PUBLIC KEY-")){var m=xe(e,"PUBLIC KEY");return h._getKeyFromPublicPKCS8Hex(m)}if(-1!=e.indexOf("-END RSA PRIVATE KEY-")&&-1==e.indexOf("4,ENCRYPTED")){var b=f(e,"RSA PRIVATE KEY");return h.getKey(b,null,"pkcs5prv")}if(-1!=e.indexOf("-END DSA PRIVATE KEY-")&&-1==e.indexOf("4,ENCRYPTED")){var w=a(n=f(e,"DSA PRIVATE KEY"),0,[1],"02"),S=a(n,0,[2],"02"),E=a(n,0,[3],"02"),A=a(n,0,[4],"02"),B=a(n,0,[5],"02");return(F=new c).setPrivate(new C(w,16),new C(S,16),new C(E,16),new C(A,16),new C(B,16)),F}if(-1!=e.indexOf("-END EC PRIVATE KEY-")&&-1==e.indexOf("4,ENCRYPTED"))return b=f(e,"EC PRIVATE KEY"),h.getKey(b,null,"pkcs5prv");if(-1!=e.indexOf("-END PRIVATE KEY-"))return h.getKeyFromPlainPrivatePKCS8PEM(e);if(-1!=e.indexOf("-END RSA PRIVATE KEY-")&&-1!=e.indexOf("4,ENCRYPTED")){var x=h.getDecryptedKeyHex(e,t),T=new ae;return T.readPKCS5PrvKeyHex(x),T}if(-1!=e.indexOf("-END EC PRIVATE KEY-")&&-1!=e.indexOf("4,ENCRYPTED")){var I,F=a(n=h.getDecryptedKeyHex(e,t),0,[1],"04"),k=a(n,0,[2,0],"06"),R=a(n,0,[3,0],"03").substr(2);if(void 0===fe.crypto.OID.oidhex2name[k])throw new Error("undefined OID(hex) in KJUR.crypto.OID: "+k);return(I=new o({curve:fe.crypto.OID.oidhex2name[k]})).setPublicKeyHex(R),I.setPrivateKeyHex(F),I.isPublic=!1,I}if(-1!=e.indexOf("-END DSA PRIVATE KEY-")&&-1!=e.indexOf("4,ENCRYPTED"))return w=a(n=h.getDecryptedKeyHex(e,t),0,[1],"02"),S=a(n,0,[2],"02"),E=a(n,0,[3],"02"),A=a(n,0,[4],"02"),B=a(n,0,[5],"02"),(F=new c).setPrivate(new C(w,16),new C(S,16),new C(E,16),new C(A,16),new C(B,16)),F;if(-1!=e.indexOf("-END ENCRYPTED PRIVATE KEY-"))return h.getKeyFromEncryptedPKCS8PEM(e,t);throw new Error("not supported argument")},Xe.generateKeypair=function(e,t){if("RSA"==e){var r=t;(s=new ae).generate(r,"10001"),s.isPrivate=!0,s.isPublic=!0;var n=new ae,i=s.n.toString(16),a=s.e.toString(16);return n.setPublic(i,a),n.isPrivate=!1,n.isPublic=!0,(o={}).prvKeyObj=s,o.pubKeyObj=n,o}if("EC"==e){var s,o,c=t,u=new fe.crypto.ECDSA({curve:c}).generateKeyPairHex();return(s=new fe.crypto.ECDSA({curve:c})).setPublicKeyHex(u.ecpubhex),s.setPrivateKeyHex(u.ecprvhex),s.isPrivate=!0,s.isPublic=!1,(n=new fe.crypto.ECDSA({curve:c})).setPublicKeyHex(u.ecpubhex),n.isPrivate=!1,n.isPublic=!0,(o={}).prvKeyObj=s,o.pubKeyObj=n,o}throw new Error("unknown algorithm: "+e)},Xe.getPEM=function(e,t,r,n,i,a){var s=fe,o=s.asn1,c=o.DERObjectIdentifier,u=o.DERInteger,f=o.ASN1Util.newObject,h=o.x509.SubjectPublicKeyInfo,l=s.crypto,d=l.DSA,p=l.ECDSA,g=ae;function y(e){return f({seq:[{int:0},{int:{bigint:e.n}},{int:e.e},{int:{bigint:e.d}},{int:{bigint:e.p}},{int:{bigint:e.q}},{int:{bigint:e.dmp1}},{int:{bigint:e.dmq1}},{int:{bigint:e.coeff}}]})}function v(e){return f({seq:[{int:1},{octstr:{hex:e.prvKeyHex}},{tag:["a0",!0,{oid:{name:e.curveName}}]},{tag:["a1",!0,{bitstr:{hex:"00"+e.pubKeyHex}}]}]})}function m(e){return f({seq:[{int:0},{int:{bigint:e.p}},{int:{bigint:e.q}},{int:{bigint:e.g}},{int:{bigint:e.y}},{int:{bigint:e.x}}]})}if((void 0!==g&&e instanceof g||void 0!==d&&e instanceof d||void 0!==p&&e instanceof p)&&1==e.isPublic&&(void 0===t||"PKCS8PUB"==t))return Be(E=new h(e).tohex(),"PUBLIC KEY");if("PKCS1PRV"==t&&void 0!==g&&e instanceof g&&(void 0===r||null==r)&&1==e.isPrivate)return Be(E=y(e).tohex(),"RSA PRIVATE KEY");if("PKCS1PRV"==t&&void 0!==p&&e instanceof p&&(void 0===r||null==r)&&1==e.isPrivate){var b=new c({name:e.curveName}).tohex(),w=v(e).tohex(),S="";return(S+=Be(b,"EC PARAMETERS"))+Be(w,"EC PRIVATE KEY")}if("PKCS1PRV"==t&&void 0!==d&&e instanceof d&&(void 0===r||null==r)&&1==e.isPrivate)return Be(E=m(e).tohex(),"DSA PRIVATE KEY");if("PKCS5PRV"==t&&void 0!==g&&e instanceof g&&void 0!==r&&null!=r&&1==e.isPrivate){var E=y(e).tohex();return void 0===n&&(n="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("RSA",E,r,n,a)}if("PKCS5PRV"==t&&void 0!==p&&e instanceof p&&void 0!==r&&null!=r&&1==e.isPrivate)return E=v(e).tohex(),void 0===n&&(n="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("EC",E,r,n,a);if("PKCS5PRV"==t&&void 0!==d&&e instanceof d&&void 0!==r&&null!=r&&1==e.isPrivate)return E=m(e).tohex(),void 0===n&&(n="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("DSA",E,r,n,a);var C=function(e,t){if("string"==typeof t)return Xe.getEncryptedPKCS8PEM(e,t);if("object"==typeof t&&null!=ze(t,"passcode")){var r=JSON.parse(JSON.stringify(t)),n=r.passcode;return delete r.passcode,Xe.getEncryptedPKCS8PEM(e,n,r)}};if("PKCS8PRV"==t&&null!=g&&e instanceof g&&1==e.isPrivate){var A=y(e).tohex();return E=f({seq:[{int:0},{seq:[{oid:{name:"rsaEncryption"}},{null:!0}]},{octstr:{hex:A}}]}).tohex(),void 0===r||null==r?Be(E,"PRIVATE KEY"):C(E,r)}if("PKCS8PRV"==t&&void 0!==p&&e instanceof p&&1==e.isPrivate){var B={seq:[{int:1},{octstr:{hex:e.prvKeyHex}}]};return"string"==typeof e.pubKeyHex&&B.seq.push({tag:["a1",!0,{bitstr:{hex:"00"+e.pubKeyHex}}]}),A=new f(B).tohex(),E=f({seq:[{int:0},{seq:[{oid:{name:"ecPublicKey"}},{oid:{name:e.curveName}}]},{octstr:{hex:A}}]}).tohex(),void 0===r||null==r?Be(E,"PRIVATE KEY"):C(E,r)}if("PKCS8PRV"==t&&void 0!==d&&e instanceof d&&1==e.isPrivate)return A=new u({bigint:e.x}).tohex(),E=f({seq:[{int:0},{seq:[{oid:{name:"dsa"}},{seq:[{int:{bigint:e.p}},{int:{bigint:e.q}},{int:{bigint:e.g}}]}]},{octstr:{hex:A}}]}).tohex(),void 0===r||null==r?Be(E,"PRIVATE KEY"):C(E,r);throw new Error("unsupported object nor format")},Xe.getKeyFromCSRPEM=function(e){var t=xe(e,"CERTIFICATE REQUEST");return Xe.getKeyFromCSRHex(t)},Xe.getKeyFromCSRHex=function(e){var t=Xe.parseCSRHex(e);return Xe.getKey(t.p8pubkeyhex,null,"pkcs8pub")},Xe.parseCSRHex=function(e){var t=de,r=t.getChildIdx,n=t.getTLV,i={},a=e;if("30"!=a.substr(0,2))throw new Error("malformed CSR(code:001)");var s=r(a,0);if(s.length<1)throw new Error("malformed CSR(code:002)");if("30"!=a.substr(s[0],2))throw new Error("malformed CSR(code:003)");var o=r(a,s[0]);if(o.length<3)throw new Error("malformed CSR(code:004)");return i.p8pubkeyhex=n(a,o[2]),i},Xe.getKeyID=function(e){var t=Xe,r=de;"string"==typeof e&&-1!=e.indexOf("BEGIN ")&&(e=t.getKey(e));var n=xe(t.getPEM(e)),i=r.getIdxbyList(n,0,[1]),a=r.getV(n,i).substring(2);return fe.crypto.Util.hashHex(a,"sha1")},Xe.getJWK=function(e,t,r,n,i){var a,s,o={},c=fe.crypto.Util.hashHex;if("string"==typeof e)a=Xe.getKey(e),-1!=e.indexOf("CERTIFICATE")&&(s=xe(e));else{if("object"!=typeof e)throw new Error("unsupported keyinfo type");e instanceof Ze?(a=e.getPublicKey(),s=e.hex):a=e}if(a instanceof ae&&a.isPrivate)o.kty="RSA",o.n=me(a.n.toString(16)),o.e=me(a.e.toString(16)),o.d=me(a.d.toString(16)),o.p=me(a.p.toString(16)),o.q=me(a.q.toString(16)),o.dp=me(a.dmp1.toString(16)),o.dq=me(a.dmq1.toString(16)),o.qi=me(a.coeff.toString(16));else if(a instanceof ae&&a.isPublic)o.kty="RSA",o.n=me(a.n.toString(16)),o.e=me(a.e.toString(16));else if(a instanceof fe.crypto.ECDSA&&a.isPrivate){if("P-256"!==(f=a.getShortNISTPCurveName())&&"P-384"!==f&&"P-521"!==f)throw new Error("unsupported curve name for JWT: "+f);var u=a.getPublicKeyXYHex();o.kty="EC",o.crv=f,o.x=me(u.x),o.y=me(u.y),o.d=me(a.prvKeyHex)}else if(a instanceof fe.crypto.ECDSA&&a.isPublic){var f;if("P-256"!==(f=a.getShortNISTPCurveName())&&"P-384"!==f&&"P-521"!==f)throw new Error("unsupported curve name for JWT: "+f);u=a.getPublicKeyXYHex(),o.kty="EC",o.crv=f,o.x=me(u.x),o.y=me(u.y)}if(null==o.kty)throw new Error("unsupported keyinfo");return a.isPrivate||1==t||(o.kid=fe.jws.JWS.getJWKthumbprint(o)),null!=s&&1!=r&&(o.x5c=[S(s)]),null!=s&&1!=n&&(o.x5t=ye(S(c(s,"sha1")))),null!=s&&1!=i&&(o["x5t#S256"]=ye(S(c(s,"sha256")))),o},Xe.getJWKFromKey=function(e){return Xe.getJWK(e,!0,!0,!0,!0)},ae.getPosArrayOfChildrenFromHex=function(e){return de.getChildIdx(e,0)},ae.getHexValueArrayOfChildrenFromHex=function(e){var t,r=de.getV,n=r(e,(t=ae.getPosArrayOfChildrenFromHex(e))[0]),i=r(e,t[1]),a=r(e,t[2]),s=r(e,t[3]),o=r(e,t[4]),c=r(e,t[5]),u=r(e,t[6]),f=r(e,t[7]),h=r(e,t[8]);return(t=new Array).push(n,i,a,s,o,c,u,f,h),t},ae.prototype.readPrivateKeyFromPEMString=function(e){var t=xe(e),r=ae.getHexValueArrayOfChildrenFromHex(t);this.setPrivateEx(r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8])},ae.prototype.readPKCS5PrvKeyHex=function(e){var t=ae.getHexValueArrayOfChildrenFromHex(e);this.setPrivateEx(t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])},ae.prototype.readPKCS8PrvKeyHex=function(e){var t,r,n,i,a,s,o,c,u=de,f=u.getVbyListEx;if(!1===u.isASN1HEX(e))throw new Error("not ASN.1 hex string");try{t=f(e,0,[2,0,1],"02"),r=f(e,0,[2,0,2],"02"),n=f(e,0,[2,0,3],"02"),i=f(e,0,[2,0,4],"02"),a=f(e,0,[2,0,5],"02"),s=f(e,0,[2,0,6],"02"),o=f(e,0,[2,0,7],"02"),c=f(e,0,[2,0,8],"02")}catch(e){throw new Error("malformed PKCS#8 plain RSA private key")}this.setPrivateEx(t,r,n,i,a,s,o,c)},ae.prototype.readPKCS5PubKeyHex=function(e){var t=de,r=t.getV;if(!1===t.isASN1HEX(e))throw new Error("keyHex is not ASN.1 hex string");var n=t.getChildIdx(e,0);if(2!==n.length||"02"!==e.substr(n[0],2)||"02"!==e.substr(n[1],2))throw new Error("wrong hex for PKCS#5 public key");var i=r(e,n[0]),a=r(e,n[1]);this.setPublic(i,a)},ae.prototype.readPKCS8PubKeyHex=function(e){var t=de;if(!1===t.isASN1HEX(e))throw new Error("not ASN.1 hex string");if("06092a864886f70d010101"!==t.getTLVbyListEx(e,0,[0,0]))throw new Error("not PKCS8 RSA public key");var r=t.getTLVbyListEx(e,0,[1,0]);this.readPKCS5PubKeyHex(r)},ae.prototype.readCertPubKeyHex=function(e,t){var r,n;(r=new Ze).readCertHex(e),n=r.getPublicKeyHex(),this.readPKCS8PubKeyHex(n)},ae.prototype.sign=function(e,t){var r=function(e){return fe.crypto.Util.hashString(e,t)}(e);return this.signWithMessageHash(r,t)},ae.prototype.signWithMessageHash=function(e,t){var r=ie(fe.crypto.Util.getPaddedDigestInfoHex(e,t,this.n.bitLength()),16);return Ye(this.doPrivate(r).toString(16),this.n.bitLength())},ae.prototype.signPSS=function(e,t,r){var n,i=(n=Ae(e),fe.crypto.Util.hashHex(n,t));return void 0===r&&(r=-1),this.signWithMessageHashPSS(i,t,r)},ae.prototype.signWithMessageHashPSS=function(e,t,r){var n,i=Ce(e),a=i.length,s=this.n.bitLength()-1,o=Math.ceil(s/8),c=function(e){return fe.crypto.Util.hashHex(e,t)};if(-1===r||void 0===r)r=a;else if(-2===r)r=o-a-2;else if(r<-2)throw new Error("invalid salt length");if(o<a+r+2)throw new Error("data too long");var u="";r>0&&(u=new Array(r),(new ne).nextBytes(u),u=String.fromCharCode.apply(String,u));var f=Ce(c(Ae("\0\0\0\0\0\0\0\0"+i+u))),h=[];for(n=0;n<o-r-a-2;n+=1)h[n]=0;var l=String.fromCharCode.apply(String,h)+""+u,d=Je(f,l.length,c),p=[];for(n=0;n<l.length;n+=1)p[n]=l.charCodeAt(n)^d.charCodeAt(n);var g=65280>>8*o-s&255;for(p[0]&=~g,n=0;n<a;n++)p.push(f.charCodeAt(n));return p.push(188),Ye(this.doPrivate(new C(p)).toString(16),this.n.bitLength())},ae.prototype.verify=function(e,t){if(null==(t=t.toLowerCase()).match(/^[0-9a-f]+$/))return!1;var r=ie(t,16),n=this.n.bitLength();if(r.bitLength()>n)return!1;var i=this.doPublic(r).toString(16);if(i.length+3!=n/4)return!1;var a=Qe(i.replace(/^1f+00/,""));if(0==a.length)return!1;var s=a[0],o=a[1],c=function(e){return fe.crypto.Util.hashString(e,s)}(e);return o==c},ae.prototype.verifyWithMessageHash=function(e,t){if(t.length!=Math.ceil(this.n.bitLength()/4))return!1;var r=ie(t,16);if(r.bitLength()>this.n.bitLength())return 0;var n=Qe(this.doPublic(r).toString(16).replace(/^1f+00/,""));return 0!=n.length&&(n[0],n[1]==e)},ae.prototype.verifyPSS=function(e,t,r,n){var i,a=(i=Ae(e),fe.crypto.Util.hashHex(i,r));return void 0===n&&(n=-1),this.verifyWithMessageHashPSS(a,t,r,n)},ae.prototype.verifyWithMessageHashPSS=function(e,t,r,n){if(t.length!=Math.ceil(this.n.bitLength()/4))return!1;var i,a=new C(t,16),s=function(e){return fe.crypto.Util.hashHex(e,r)},o=Ce(e),c=o.length,u=this.n.bitLength()-1,f=Math.ceil(u/8);if(-1===n||void 0===n)n=c;else if(-2===n)n=f-c-2;else if(n<-2)throw new Error("invalid salt length");if(f<c+n+2)throw new Error("data too long");var h=this.doPublic(a).toByteArray();for(i=0;i<h.length;i+=1)h[i]&=255;for(;h.length<f;)h.unshift(0);if(188!==h[f-1])throw new Error("encoded message does not end in 0xbc");var l=(h=String.fromCharCode.apply(String,h)).substr(0,f-c-1),d=h.substr(l.length,c),p=65280>>8*f-u&255;if(l.charCodeAt(0)&p)throw new Error("bits beyond keysize not zero");var g=Je(d,l.length,s),y=[];for(i=0;i<l.length;i+=1)y[i]=l.charCodeAt(i)^g.charCodeAt(i);y[0]&=~p;var v=f-c-n-2;for(i=0;i<v;i+=1)if(0!==y[i])throw new Error("leftmost octets not zero");if(1!==y[v])throw new Error("0x01 marker not found");return d===Ce(s(Ae("\0\0\0\0\0\0\0\0"+o+String.fromCharCode.apply(String,y.slice(-n)))))},ae.SALT_LEN_HLEN=-1,ae.SALT_LEN_MAX=-2,ae.SALT_LEN_RECOVER=-2,Ze.EXT_PARSER={},Ze.registExtParser=function(e,t){Ze.EXT_PARSER[e]=t},Ze.hex2dn=function(e,t){void 0===t&&(t=0);var r=new Ze;return de.getTLV(e,t),r.getX500Name(e).str},Ze.hex2rdn=function(e,t){if(void 0===t&&(t=0),"31"!==e.substr(t,2))throw new Error("malformed RDN");for(var r=new Array,n=de.getChildIdx(e,t),i=0;i<n.length;i++)r.push(Ze.hex2attrTypeValue(e,n[i]));return r=r.map((function(e){return e.replace("+","\\+")})),r.join("+")},Ze.hex2attrTypeValue=function(e,t){var r=de,n=r.getV;if(void 0===t&&(t=0),"30"!==e.substr(t,2))throw new Error("malformed attribute type and value");var i=r.getChildIdx(e,t);2!==i.length||e.substr(i[0],2);var a=n(e,i[0]),s=fe.asn1.ASN1Util.oidHexToInt(a);return fe.asn1.x509.OID.oid2atype(s)+"="+Ce(n(e,i[1]))},Ze.getPublicKeyFromCertHex=function(e){var t=new Ze;return t.readCertHex(e),t.getPublicKey()},Ze.getPublicKeyFromCertPEM=function(e){var t=new Ze;return t.readCertPEM(e),t.getPublicKey()},Ze.getPublicKeyInfoPropOfCertPEM=function(e){var t,r,n=de.getVbyList,i={algparam:null};return(t=new Ze).readCertPEM(e),r=t.getPublicKeyHex(),i.keyhex=n(r,0,[1],"03").substr(2),i.algoid=n(r,0,[0,0],"06"),"2a8648ce3d0201"===i.algoid&&(i.algparam=n(r,0,[0,1],"06")),i},Ze.KEYUSAGE_NAME=["digitalSignature","nonRepudiation","keyEncipherment","dataEncipherment","keyAgreement","keyCertSign","cRLSign","encipherOnly","decipherOnly"],void 0!==fe&&fe||(fe={}),void 0!==fe.jws&&fe.jws||(fe.jws={}),fe.jws.JWS=function(){var e=fe.jws.JWS.isSafeJSONString;this.parseJWS=function(t,r){if(void 0===this.parsedJWS||!r&&void 0===this.parsedJWS.sigvalH){var n=t.match(/^([^.]+)\.([^.]+)\.([^.]+)$/);if(null==n)throw"JWS signature is not a form of 'Head.Payload.SigValue'.";var i=n[1],a=n[2],s=n[3],o=i+"."+a;if(this.parsedJWS={},this.parsedJWS.headB64U=i,this.parsedJWS.payloadB64U=a,this.parsedJWS.sigvalB64U=s,this.parsedJWS.si=o,!r){var c=be(s),u=ie(c,16);this.parsedJWS.sigvalH=c,this.parsedJWS.sigvalBI=u}var f=le(i),h=le(a);if(this.parsedJWS.headS=f,this.parsedJWS.payloadS=h,!e(f,this.parsedJWS,"headP"))throw"malformed JSON string for JWS Head: "+f}}},fe.jws.JWS.sign=function(e,t,r,n,i){var a,s,o,c=fe,u=c.jws.JWS,f=u.readSafeJSONString,h=u.isSafeJSONString,l=c.crypto,d=(l.ECDSA,l.Mac),p=l.Signature,g=JSON;if("string"!=typeof t&&"object"!=typeof t)throw"spHeader must be JSON string or object: "+t;if("object"==typeof t&&(s=t,a=g.stringify(s)),"string"==typeof t){if(!h(a=t))throw"JWS Head is not safe JSON string: "+a;s=f(a)}if(o=r,"object"==typeof r&&(o=g.stringify(r)),""!=e&&null!=e||void 0===s.alg||(e=s.alg),""!=e&&null!=e&&void 0===s.alg&&(s.alg=e,a=g.stringify(s)),e!==s.alg)throw"alg and sHeader.alg doesn't match: "+e+"!="+s.alg;var y=null;if(void 0===u.jwsalg2sigalg[e])throw"unsupported alg name: "+e;y=u.jwsalg2sigalg[e];var v=he(a)+"."+he(o),m="";if("Hmac"==y.substr(0,4)){if(void 0===n)throw"mac key shall be specified for HS* alg";var b=new d({alg:y,prov:"cryptojs",pass:n});b.updateString(v),m=b.doFinal()}else if(-1!=y.indexOf("withECDSA")){(S=new p({alg:y})).init(n,i),S.updateString(v);var w=S.sign();m=fe.crypto.ECDSA.asn1SigToConcatSig(w)}else{var S;"none"!=y&&((S=new p({alg:y})).init(n,i),S.updateString(v),m=S.sign())}return v+"."+me(m)},fe.jws.JWS.verify=function(e,t,r){var n,i=fe,a=i.jws.JWS,s=a.readSafeJSONString,o=i.crypto,c=o.ECDSA,u=o.Mac,f=o.Signature;if(n=ae,!Ke(e))return!1;var h=e.split(".");if(3!==h.length)return!1;var l,d=h[0]+"."+h[1],p=be(h[2]),g=s(le(h[0])),y=null;if(void 0===g.alg)throw"algorithm not specified in header";if(l=(y=g.alg).substr(0,2),null!=r&&"[object Array]"===Object.prototype.toString.call(r)&&r.length>0&&-1==(":"+r.join(":")+":").indexOf(":"+y+":"))throw"algorithm '"+y+"' not accepted in the list";if("none"!=y&&null===t)throw"key shall be specified to verify.";if("string"==typeof t&&-1!=t.indexOf("-----BEGIN ")&&(t=Xe.getKey(t)),!("RS"!=l&&"PS"!=l||t instanceof n))throw"key shall be a RSAKey obj for RS* and PS* algs";if("ES"==l&&!(t instanceof c))throw"key shall be a ECDSA obj for ES* algs";var v=null;if(void 0===a.jwsalg2sigalg[g.alg])throw"unsupported alg name: "+y;if("none"==(v=a.jwsalg2sigalg[y]))throw"not supported";if("Hmac"==v.substr(0,4)){if(void 0===t)throw"hexadecimal key shall be specified for HMAC";var m=new u({alg:v,pass:t});return m.updateString(d),p==m.doFinal()}if(-1!=v.indexOf("withECDSA")){var b,w=null;try{w=c.concatSigToASN1Sig(p)}catch(e){return!1}return(b=new f({alg:v})).init(t),b.updateString(d),b.verify(w)}return(b=new f({alg:v})).init(t),b.updateString(d),b.verify(p)},fe.jws.JWS.parse=function(e){var t,r,n,i=e.split("."),a={};if(2!=i.length&&3!=i.length)throw"malformed sJWS: wrong number of '.' splitted elements";return t=i[0],r=i[1],3==i.length&&(n=i[2]),a.headerObj=fe.jws.JWS.readSafeJSONString(le(t)),a.payloadObj=fe.jws.JWS.readSafeJSONString(le(r)),a.headerPP=JSON.stringify(a.headerObj,null," "),null==a.payloadObj?a.payloadPP=le(r):a.payloadPP=JSON.stringify(a.payloadObj,null," "),void 0!==n&&(a.sigHex=be(n)),a},fe.jws.JWS.verifyJWT=function(e,t,r){var n=fe.jws,i=n.JWS,a=i.readSafeJSONString,s=i.inArray,o=i.includedArray;if(!Ke(e))return!1;var c=e.split(".");if(3!=c.length)return!1;var u=c[0],f=c[1],h=(be(c[2]),a(le(u))),l=a(le(f));if(void 0===h.alg)return!1;if(void 0===r.alg)throw"acceptField.alg shall be specified";if(!s(h.alg,r.alg))return!1;if(void 0!==l.iss&&"object"==typeof r.iss&&!s(l.iss,r.iss))return!1;if(void 0!==l.sub&&"object"==typeof r.sub&&!s(l.sub,r.sub))return!1;if(void 0!==l.aud&&"object"==typeof r.aud)if("string"==typeof l.aud){if(!s(l.aud,r.aud))return!1}else if("object"==typeof l.aud&&!o(l.aud,r.aud))return!1;var d=n.IntDate.getNow();return void 0!==r.verifyAt&&"number"==typeof r.verifyAt&&(d=r.verifyAt),void 0!==r.gracePeriod&&"number"==typeof r.gracePeriod||(r.gracePeriod=0),!(void 0!==l.exp&&"number"==typeof l.exp&&l.exp+r.gracePeriod<d||void 0!==l.nbf&&"number"==typeof l.nbf&&d<l.nbf-r.gracePeriod||void 0!==l.iat&&"number"==typeof l.iat&&d<l.iat-r.gracePeriod||void 0!==l.jti&&void 0!==r.jti&&l.jti!==r.jti||!i.verify(e,t,r.alg))},fe.jws.JWS.includedArray=function(e,t){var r=fe.jws.JWS.inArray;if(null===e)return!1;if("object"!=typeof e)return!1;if("number"!=typeof e.length)return!1;for(var n=0;n<e.length;n++)if(!r(e[n],t))return!1;return!0},fe.jws.JWS.inArray=function(e,t){if(null===t)return!1;if("object"!=typeof t)return!1;if("number"!=typeof t.length)return!1;for(var r=0;r<t.length;r++)if(t[r]==e)return!0;return!1},fe.jws.JWS.jwsalg2sigalg={HS256:"HmacSHA256",HS384:"HmacSHA384",HS512:"HmacSHA512",RS256:"SHA256withRSA",RS384:"SHA384withRSA",RS512:"SHA512withRSA",ES256:"SHA256withECDSA",ES384:"SHA384withECDSA",ES512:"SHA512withECDSA",PS256:"SHA256withRSAandMGF1",PS384:"SHA384withRSAandMGF1",PS512:"SHA512withRSAandMGF1",none:"none"},fe.jws.JWS.isSafeJSONString=function(e,t,r){var n=null;try{return"object"!=typeof(n=ue(e))||n.constructor===Array?0:(t&&(t[r]=n),1)}catch(e){return 0}},fe.jws.JWS.readSafeJSONString=function(e){var t=null;try{return"object"!=typeof(t=ue(e))||t.constructor===Array?null:t}catch(e){return null}},fe.jws.JWS.getEncodedSignatureValueFromJWS=function(e){var t=e.match(/^[^.]+\.[^.]+\.([^.]+)$/);if(null==t)throw"JWS signature is not a form of 'Head.Payload.SigValue'.";return t[1]},fe.jws.JWS.getJWKthumbprint=function(e){if("RSA"!==e.kty&&"EC"!==e.kty&&"oct"!==e.kty)throw"unsupported algorithm for JWK Thumprint";var t="{";if("RSA"===e.kty){if("string"!=typeof e.n||"string"!=typeof e.e)throw"wrong n and e value for RSA key";t+='"e":"'+e.e+'",',t+='"kty":"'+e.kty+'",',t+='"n":"'+e.n+'"}'}else if("EC"===e.kty){if("string"!=typeof e.crv||"string"!=typeof e.x||"string"!=typeof e.y)throw"wrong crv, x and y value for EC key";t+='"crv":"'+e.crv+'",',t+='"kty":"'+e.kty+'",',t+='"x":"'+e.x+'",',t+='"y":"'+e.y+'"}'}else if("oct"===e.kty){if("string"!=typeof e.k)throw"wrong k value for oct(symmetric) key";t+='"kty":"'+e.kty+'",',t+='"k":"'+e.k+'"}'}var r=Ae(t);return me(fe.crypto.Util.hashHex(r,"sha256"))},fe.jws.IntDate={},fe.jws.IntDate.get=function(e){var t=fe.jws.IntDate,r=t.getNow,n=t.getZulu;if("now"==e)return r();if("now + 1hour"==e)return r()+3600;if("now + 1day"==e)return r()+86400;if("now + 1month"==e)return r()+2592e3;if("now + 1year"==e)return r()+31536e3;if(e.match(/Z$/))return n(e);if(e.match(/^[0-9]+$/))return parseInt(e);throw"unsupported format: "+e},fe.jws.IntDate.getZulu=function(e){return Te(e)},fe.jws.IntDate.getNow=function(){return~~(new Date/1e3)},fe.jws.IntDate.intDate2UTCString=function(e){return new Date(1e3*e).toUTCString()},fe.jws.IntDate.intDate2Zulu=function(e){var t=new Date(1e3*e);return("0000"+t.getUTCFullYear()).slice(-4)+("00"+(t.getUTCMonth()+1)).slice(-2)+("00"+t.getUTCDate()).slice(-2)+("00"+t.getUTCHours()).slice(-2)+("00"+t.getUTCMinutes()).slice(-2)+("00"+t.getUTCSeconds()).slice(-2)+"Z"},void 0!==fe&&fe||(fe={}),void 0!==fe.jws&&fe.jws||(fe.jws={}),fe.jws.JWSJS=function(){var e=fe.jws.JWS,t=e.readSafeJSONString;this.aHeader=[],this.sPayload="",this.aSignature=[],this.init=function(){this.aHeader=[],this.sPayload=void 0,this.aSignature=[]},this.initWithJWS=function(e){this.init();var t=e.split(".");if(3!=t.length)throw"malformed input JWS";this.aHeader.push(t[0]),this.sPayload=t[1],this.aSignature.push(t[2])},this.addSignature=function(e,t,r,n){if(void 0===this.sPayload||null===this.sPayload)throw"there's no JSON-JS signature to add.";var i=this.aHeader.length;if(this.aHeader.length!=this.aSignature.length)throw"aHeader.length != aSignature.length";try{var a=fe.jws.JWS.sign(e,t,this.sPayload,r,n).split(".");a[0],a[2],this.aHeader.push(a[0]),this.aSignature.push(a[2])}catch(e){throw this.aHeader.length>i&&this.aHeader.pop(),this.aSignature.length>i&&this.aSignature.pop(),"addSignature failed: "+e}},this.verifyAll=function(e){if(this.aHeader.length!==e.length||this.aSignature.length!==e.length)return!1;for(var t=0;t<e.length;t++){var r=e[t];if(2!==r.length)return!1;if(!1===this.verifyNth(t,r[0],r[1]))return!1}return!0},this.verifyNth=function(t,r,n){if(this.aHeader.length<=t||this.aSignature.length<=t)return!1;var i=this.aHeader[t],a=this.aSignature[t],s=i+"."+this.sPayload+"."+a,o=!1;try{o=e.verify(s,r,n)}catch(e){return!1}return o},this.readJWSJS=function(e){if("string"==typeof e){var r=t(e);if(null==r)throw"argument is not safe JSON object string";this.aHeader=r.headers,this.sPayload=r.payload,this.aSignature=r.signatures}else try{if(!(e.headers.length>0))throw"malformed header";if(this.aHeader=e.headers,"string"!=typeof e.payload)throw"malformed signatures";if(this.sPayload=e.payload,!(e.signatures.length>0))throw"malformed signatures";this.aSignature=e.signatures}catch(e){throw"malformed JWS-JS JSON object: "+e}},this.getJSON=function(){return{headers:this.aHeader,payload:this.sPayload,signatures:this.aSignature}},this.isEmpty=function(){return 0==this.aHeader.length?1:0}},fe.crypto.ECDSA,fe.crypto.DSA,fe.crypto.Signature,fe.crypto.MessageDigest,fe.crypto.Mac,t.ym=Xe,t.d6=de,t.pj=fe,fe.crypto,fe.asn1,fe.jws,fe.lang},73065:function(e,t,r){var n,i;!function(a,s){"use strict";n=function(){var e=function(){},t="undefined",r=typeof window!==t&&typeof window.navigator!==t&&/Trident\/|MSIE /.test(window.navigator.userAgent),n=["trace","debug","info","warn","error"],i={},a=null;function s(e,t){var r=e[t];if("function"==typeof r.bind)return r.bind(e);try{return Function.prototype.bind.call(r,e)}catch(t){return function(){return Function.prototype.apply.apply(r,[e,arguments])}}}function o(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function c(){for(var r=this.getLevel(),i=0;i<n.length;i++){var a=n[i];this[a]=i<r?e:this.methodFactory(a,r,this.name)}if(this.log=this.debug,typeof console===t&&r<this.levels.SILENT)return"No console available for logging"}function u(e){return function(){typeof console!==t&&(c.call(this),this[e].apply(this,arguments))}}function f(n,i,a){return function(n){return"debug"===n&&(n="log"),typeof console!==t&&("trace"===n&&r?o:void 0!==console[n]?s(console,n):void 0!==console.log?s(console,"log"):e)}(n)||u.apply(this,arguments)}function h(e,r){var s,o,u,h=this,l="loglevel";function d(){var e;if(typeof window!==t&&l){try{e=window.localStorage[l]}catch(e){}if(typeof e===t)try{var r=window.document.cookie,n=encodeURIComponent(l),i=r.indexOf(n+"=");-1!==i&&(e=/^([^;]+)/.exec(r.slice(i+n.length+1))[1])}catch(e){}return void 0===h.levels[e]&&(e=void 0),e}}function p(e){var t=e;if("string"==typeof t&&void 0!==h.levels[t.toUpperCase()]&&(t=h.levels[t.toUpperCase()]),"number"==typeof t&&t>=0&&t<=h.levels.SILENT)return t;throw new TypeError("log.setLevel() called with invalid level: "+e)}"string"==typeof e?l+=":"+e:"symbol"==typeof e&&(l=void 0),h.name=e,h.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},h.methodFactory=r||f,h.getLevel=function(){return null!=u?u:null!=o?o:s},h.setLevel=function(e,r){return u=p(e),!1!==r&&function(e){var r=(n[e]||"silent").toUpperCase();if(typeof window!==t&&l){try{return void(window.localStorage[l]=r)}catch(e){}try{window.document.cookie=encodeURIComponent(l)+"="+r+";"}catch(e){}}}(u),c.call(h)},h.setDefaultLevel=function(e){o=p(e),d()||h.setLevel(e,!1)},h.resetLevel=function(){u=null,function(){if(typeof window!==t&&l){try{window.localStorage.removeItem(l)}catch(e){}try{window.document.cookie=encodeURIComponent(l)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch(e){}}}(),c.call(h)},h.enableAll=function(e){h.setLevel(h.levels.TRACE,e)},h.disableAll=function(e){h.setLevel(h.levels.SILENT,e)},h.rebuild=function(){if(a!==h&&(s=p(a.getLevel())),c.call(h),a===h)for(var e in i)i[e].rebuild()},s=p(a?a.getLevel():"WARN");var g=d();null!=g&&(u=p(g)),c.call(h)}(a=new h).getLogger=function(e){if("symbol"!=typeof e&&"string"!=typeof e||""===e)throw new TypeError("You must supply a name when creating a logger.");var t=i[e];return t||(t=i[e]=new h(e,a.methodFactory)),t};var l=typeof window!==t?window.log:void 0;return a.noConflict=function(){return typeof window!==t&&window.log===a&&(window.log=l),a},a.getLoggers=function(){return i},a.default=a,a},void 0===(i=n.call(t,r,t,e))||(e.exports=i)}()},65606:e=>{var t,r,n=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(e){if(t===setTimeout)return setTimeout(e,0);if((t===i||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:i}catch(e){t=i}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(e){r=a}}();var o,c=[],u=!1,f=-1;function h(){u&&o&&(u=!1,o.length?c=o.concat(c):f=-1,c.length&&l())}function l(){if(!u){var e=s(h);u=!0;for(var t=c.length;t;){for(o=c,c=[];++f<t;)o&&o[f].run();f=-1,t=c.length}o=null,u=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{return r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function d(e,t){this.fun=e,this.array=t}function p(){}n.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];c.push(new d(e,t)),1!==c.length||u||s(l)},d.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=p,n.addListener=p,n.once=p,n.off=p,n.removeListener=p,n.removeAllListeners=p,n.emit=p,n.prependListener=p,n.prependOnceListener=p,n.listeners=function(e){return[]},n.binding=function(e){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(e){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},90031:(e,t)=>{!function(e){var t,r,n,i=String.fromCharCode;function a(e){for(var t,r,n=[],i=0,a=e.length;i<a;)(t=e.charCodeAt(i++))>=55296&&t<=56319&&i<a?56320==(64512&(r=e.charCodeAt(i++)))?n.push(((1023&t)<<10)+(1023&r)+65536):(n.push(t),i--):n.push(t);return n}function s(e){if(e>=55296&&e<=57343)throw Error("Lone surrogate U+"+e.toString(16).toUpperCase()+" is not a scalar value")}function o(e,t){return i(e>>t&63|128)}function c(e){if(!(4294967168&e))return i(e);var t="";return 4294965248&e?4294901760&e?4292870144&e||(t=i(e>>18&7|240),t+=o(e,12),t+=o(e,6)):(s(e),t=i(e>>12&15|224),t+=o(e,6)):t=i(e>>6&31|192),t+i(63&e|128)}function u(){if(n>=r)throw Error("Invalid byte index");var e=255&t[n];if(n++,128==(192&e))return 63&e;throw Error("Invalid continuation byte")}function f(){var e,i;if(n>r)throw Error("Invalid byte index");if(n==r)return!1;if(e=255&t[n],n++,!(128&e))return e;if(192==(224&e)){if((i=(31&e)<<6|u())>=128)return i;throw Error("Invalid continuation byte")}if(224==(240&e)){if((i=(15&e)<<12|u()<<6|u())>=2048)return s(i),i;throw Error("Invalid continuation byte")}if(240==(248&e)&&(i=(7&e)<<18|u()<<12|u()<<6|u())>=65536&&i<=1114111)return i;throw Error("Invalid UTF-8 detected")}e.version="3.0.0",e.encode=function(e){for(var t=a(e),r=t.length,n=-1,i="";++n<r;)i+=c(t[n]);return i},e.decode=function(e){t=a(e),r=t.length,n=0;for(var s,o=[];!1!==(s=f());)o.push(s);return function(e){for(var t,r=e.length,n=-1,a="";++n<r;)(t=e[n])>65535&&(a+=i((t-=65536)>>>10&1023|55296),t=56320|1023&t),a+=i(t);return a}(o)}}(t)},50477:()=>{},42363:()=>{},50310:()=>{},35208:()=>{},4633:(e,t,r)=>{var n=r(73738).default;function i(){"use strict";e.exports=i=function(){return r},e.exports.__esModule=!0,e.exports.default=e.exports;var t,r={},a=Object.prototype,s=a.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},c="function"==typeof Symbol?Symbol:{},u=c.iterator||"@@iterator",f=c.asyncIterator||"@@asyncIterator",h=c.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(t){l=function(e,t,r){return e[t]=r}}function d(e,t,r,n){var i=t&&t.prototype instanceof w?t:w,a=Object.create(i.prototype),s=new _(n||[]);return o(a,"_invoke",{value:F(e,r,s)}),a}function p(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}r.wrap=d;var g="suspendedStart",y="suspendedYield",v="executing",m="completed",b={};function w(){}function S(){}function E(){}var C={};l(C,u,(function(){return this}));var A=Object.getPrototypeOf,B=A&&A(A(P([])));B&&B!==a&&s.call(B,u)&&(C=B);var x=E.prototype=w.prototype=Object.create(C);function T(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function I(e,t){function r(i,a,o,c){var u=p(e[i],e,a);if("throw"!==u.type){var f=u.arg,h=f.value;return h&&"object"==n(h)&&s.call(h,"__await")?t.resolve(h.__await).then((function(e){r("next",e,o,c)}),(function(e){r("throw",e,o,c)})):t.resolve(h).then((function(e){f.value=e,o(f)}),(function(e){return r("throw",e,o,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(e,n){function a(){return new t((function(t,i){r(e,n,t,i)}))}return i=i?i.then(a,a):a()}})}function F(e,r,n){var i=g;return function(a,s){if(i===v)throw Error("Generator is already running");if(i===m){if("throw"===a)throw s;return{value:t,done:!0}}for(n.method=a,n.arg=s;;){var o=n.delegate;if(o){var c=k(o,n);if(c){if(c===b)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===g)throw i=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=v;var u=p(e,r,n);if("normal"===u.type){if(i=n.done?m:y,u.arg===b)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(i=m,n.method="throw",n.arg=u.arg)}}}function k(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,k(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var a=p(i,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,b;var s=a.arg;return s?s.done?(r[e.resultName]=s.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,b):s:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function R(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function D(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function _(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(R,this),this.reset(!0)}function P(e){if(e||""===e){var r=e[u];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function r(){for(;++i<e.length;)if(s.call(e,i))return r.value=e[i],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(n(e)+" is not iterable")}return S.prototype=E,o(x,"constructor",{value:E,configurable:!0}),o(E,"constructor",{value:S,configurable:!0}),S.displayName=l(E,h,"GeneratorFunction"),r.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===S||"GeneratorFunction"===(t.displayName||t.name))},r.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,l(e,h,"GeneratorFunction")),e.prototype=Object.create(x),e},r.awrap=function(e){return{__await:e}},T(I.prototype),l(I.prototype,f,(function(){return this})),r.AsyncIterator=I,r.async=function(e,t,n,i,a){void 0===a&&(a=Promise);var s=new I(d(e,t,n,i),a);return r.isGeneratorFunction(t)?s:s.next().then((function(e){return e.done?e.value:s.next()}))},T(x),l(x,h,"Generator"),l(x,u,(function(){return this})),l(x,"toString",(function(){return"[object Generator]"})),r.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},r.values=P,_.prototype={constructor:_,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(D),!e)for(var r in this)"t"===r.charAt(0)&&s.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function n(n,i){return o.type="throw",o.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],o=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var c=s.call(a,"catchLoc"),u=s.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&s.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var i=n;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,b):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),b},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),D(r),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;D(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:P(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),b}},r}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports},73738:e=>{function t(r){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},54756:(e,t,r)=>{var n=r(4633)();e.exports=n;try{regeneratorRuntime=n}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var r=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e].call(r.exports,r,r.exports,__webpack_require__),r.exports}__webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=(e,t)=>{for(var r in t)__webpack_require__.o(t,r)&&!__webpack_require__.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var __webpack_exports__={};(()=>{"use strict";function e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(e)}function r(e){var r=function(e,r){if("object"!=t(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,"string");if("object"!=t(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==t(r)?r:r+""}function n(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,r(i.key),i)}}function i(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function a(e,r){if(r&&("object"==t(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function s(e){return s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},s(e)}function o(e,t){return o=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},o(e,t)}function c(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&o(e,t)}function u(e,t,r,n,i,a,s){try{var o=e[a](s),c=o.value}catch(e){return void r(e)}o.done?t(c):Promise.resolve(c).then(n,i)}function f(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var a=e.apply(t,r);function s(e){u(a,n,i,s,o,"next",e)}function o(e){u(a,n,i,s,o,"throw",e)}s(void 0)}))}}var h=__webpack_require__(54756),l=__webpack_require__.n(h);function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function p(e,t){if(e){if("string"==typeof e)return d(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?d(e,t):void 0}}function g(e){return function(e){if(Array.isArray(e))return d(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||p(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var y=__webpack_require__(73065),v=__webpack_require__.n(y),m=__webpack_require__(90031),b=__webpack_require__.n(m);function w(e,t,r){return t=s(t),a(e,S()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function S(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(S=function(){return!!e})()}const E=function(t){function r(){var t;e(this,r);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return(t=w(this,r,[].concat(i))).type="OperationError",Error.captureStackTrace&&Error.captureStackTrace(t,r),t}return c(r,t),i(r)}(function(e){function t(){var t=Reflect.construct(e,Array.from(arguments));return Object.setPrototypeOf(t,Object.getPrototypeOf(this)),t}return t.prototype=Object.create(e.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e,t}(Error));function C(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"A-Za-z0-9+/=";if(!e)return"";if("string"==typeof e&&(e=O.strToArrayBuffer(e)),e instanceof ArrayBuffer&&(e=new Uint8Array(e)),64!==(t=O.expandAlphRange(t).join("")).length&&65!==t.length)throw new E(`Invalid Base64 alphabet length (${t.length}): ${t}`);for(var r,n,i,a,s,o,c,u="",f=0;f<e.length;)a=(r=e[f++])>>2,s=(3&r)<<4|(n=e[f++])>>4,o=(15&n)<<2|(i=e[f++])>>6,c=63&i,isNaN(n)?o=c=64:isNaN(i)&&(c=64),u+=t.charAt(a)+t.charAt(s)+t.charAt(o)+t.charAt(c);return u}function A(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"A-Za-z0-9+/=",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"string",n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(!e)return"string"===r?"":[];if(t=t||"A-Za-z0-9+/=",64!==(t=O.expandAlphRange(t).join("")).length&&65!==t.length)throw new E(`Error: Base64 alphabet should be 64 characters long, or 65 with a padding character. Found ${t.length}: ${t}`);if(n){var a=new RegExp("[^"+t.replace(/[[\]\\\-^$]/g,"\\$&")+"]","g");e=e.replace(a,"")}if(i){if(e.length%4==1)throw new E(`Error: Invalid Base64 input length (${e.length}). Cannot be 4n+1, even without padding chars.`);if(65===t.length){var s=t.charAt(64),o=e.indexOf(s);if(o>=0){if(o<e.length-2||e.charAt(e.length-1)!==s)throw new E(`Error: Base64 padding character (${s}) not used in the correct place.`);if(e.length%4!=0)throw new E("Error: Base64 not padded to a multiple of 4.")}}}for(var c,u,f,h,l,d,p,g=[],y=0;y<e.length;){if(h=t.indexOf(e.charAt(y++)||null),l=t.indexOf(e.charAt(y++)||null),d=t.indexOf(e.charAt(y++)||null),p=t.indexOf(e.charAt(y++)||null),i&&(h<0||l<0||d<0||p<0))throw new E("Error: Base64 input contains non-alphabet char(s)");u=(15&l)<<4|d>>2,f=(3&d)<<6|p,(c=h<<2|l>>4)>=0&&c<256&&g.push(c),u>=0&&u<256&&64!==d&&g.push(u),f>=0&&f<256&&64!==p&&g.push(f)}return"string"===r?O.byteArrayToUtf8(g):g}function B(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:" ",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;if(!e)return"";e instanceof ArrayBuffer&&(e=new Uint8Array(e));for(var a="",s="0x"===t||"\\x"===t,o=0;o<e.length;o++){var c=e[o].toString(16).padStart(r,"0");a+=s?t+c:c+t,n&&(a+=n),o!==e.length-1&&(o+1)%i==0&&(a+="\n")}var u=n.length+(s?0:t.length);return u?a.slice(0,-u):a}function x(e){if(!e)return"";e instanceof ArrayBuffer&&(e=new Uint8Array(e));for(var t=[],r=0;r<e.length;r++)t.push((e[r]>>>4).toString(16)),t.push((15&e[r]).toString(16));return t.join("")}function T(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Auto",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2;if(r<1||Math.round(r)!==r)throw new E("Byte length must be a positive integer");if("None"!==t){var n="Auto"===t?/[^a-f\d]|0x/gi:O.regexRep(t);e=e.split(n)}else e=[e];for(var i=[],a=0;a<e.length;a++)for(var s=0;s<e[a].length;s+=r)i.push(parseInt(e[a].substr(s,r),16));return i}function I(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Auto";t=O.charRep(t);var r=[],n=e.split(t);""===n[n.length-1]&&(n=n.slice(0,n.length-1));for(var i=0;i<n.length;i++)r[i]=parseInt(n[i],10);return r}function F(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Space",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:8;if(r<1||Math.round(r)!==r)throw new E("Byte length must be a positive integer");var n=O.regexRep(t);e=e.replace(n,"");for(var i=[],a=0;a<e.length;a+=r)i.push(parseInt(e.substr(a,r),2));return i}["Auto"].concat(["Space","Percent","Comma","Semi-colon","Colon","Line feed","CRLF","0x","0x with comma","\\x","None"]);var k=__webpack_require__(48287).Buffer,R=__webpack_require__(65606),D=function(){function t(){e(this,t)}return i(t,null,[{key:"chr",value:function(e){if(e>65535){e-=65536;var t=String.fromCharCode(e>>>10&1023|55296);return e=56320|1023&e,t+String.fromCharCode(e)}return String.fromCharCode(e)}},{key:"ord",value:function(e){if(2===e.length){var t=e.charCodeAt(0),r=e.charCodeAt(1);if(t>=55296&&t<56320&&r>=56320&&r<57344)return 1024*(t-55296)+r-56320+65536}return e.charCodeAt(0)}},{key:"padBytesRight",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=new Array(t);return n.fill(r),g(e).forEach((function(e,t){n[t]=e})),n}},{key:"truncate",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"...";return e.length>t&&(e=e.slice(0,t-r.length)+r),e}},{key:"hex",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return(e="string"==typeof e?t.ord(e):e).toString(16).padStart(r,"0")}},{key:"bin",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8;return(e="string"==typeof e?t.ord(e):e).toString(2).padStart(r,"0")}},{key:"printable",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return arguments.length>2&&void 0!==arguments[2]&&arguments[2]?e.replace(/[^\x20-\x7f]/g,"."):(e=e.replace(/[\0-\x08\x0B-\x0C\x0E-\x1F\x7F-\x9F\xAD\u0378\u0379\u037F-\u0383\u038B\u038D\u03A2\u0528-\u0530\u0557\u0558\u0560\u0588\u058B-\u058E\u0590\u05C8-\u05CF\u05EB-\u05EF\u05F5-\u0605\u061C\u061D\u06DD\u070E\u070F\u074B\u074C\u07B2-\u07BF\u07FB-\u07FF\u082E\u082F\u083F\u085C\u085D\u085F-\u089F\u08A1\u08AD-\u08E3\u08FF\u0978\u0980\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09FC-\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A76-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF2-\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B55\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B78-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BFB-\u0C00\u0C04\u0C0D\u0C11\u0C29\u0C34\u0C3A-\u0C3C\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5A-\u0C5F\u0C64\u0C65\u0C70-\u0C77\u0C80\u0C81\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDD\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0D01\u0D04\u0D0D\u0D11\u0D3B\u0D3C\u0D45\u0D49\u0D4F-\u0D56\u0D58-\u0D5F\u0D64\u0D65\u0D76-\u0D78\u0D80\u0D81\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DF1\u0DF5-\u0E00\u0E3B-\u0E3E\u0E5C-\u0E80\u0E83\u0E85\u0E86\u0E89\u0E8B\u0E8C\u0E8E-\u0E93\u0E98\u0EA0\u0EA4\u0EA6\u0EA8\u0EA9\u0EAC\u0EBA\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F48\u0F6D-\u0F70\u0F98\u0FBD\u0FCD\u0FDB-\u0FFF\u10C6\u10C8-\u10CC\u10CE\u10CF\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u137D-\u137F\u139A-\u139F\u13F5-\u13FF\u169D-\u169F\u16F1-\u16FF\u170D\u1715-\u171F\u1737-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17DE\u17DF\u17EA-\u17EF\u17FA-\u17FF\u180F\u181A-\u181F\u1878-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191D-\u191F\u192C-\u192F\u193C-\u193F\u1941-\u1943\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DB-\u19DD\u1A1C\u1A1D\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1A9F\u1AAE-\u1AFF\u1B4C-\u1B4F\u1B7D-\u1B7F\u1BF4-\u1BFB\u1C38-\u1C3A\u1C4A-\u1C4C\u1C80-\u1CBF\u1CC8-\u1CCF\u1CF7-\u1CFF\u1DE7-\u1DFB\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FC5\u1FD4\u1FD5\u1FDC\u1FF0\u1FF1\u1FF5\u1FFF\u200B-\u200F\u202A-\u202E\u2060-\u206F\u2072\u2073\u208F\u209D-\u209F\u20BB-\u20CF\u20F1-\u20FF\u218A-\u218F\u23F4-\u23FF\u2427-\u243F\u244B-\u245F\u2700\u2B4D-\u2B4F\u2B5A-\u2BFF\u2C2F\u2C5F\u2CF4-\u2CF8\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D71-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E3C-\u2E7F\u2E9A\u2EF4-\u2EFF\u2FD6-\u2FEF\u2FFC-\u2FFF\u3040\u3097\u3098\u3100-\u3104\u312E-\u3130\u318F\u31BB-\u31BF\u31E4-\u31EF\u321F\u32FF\u4DB6-\u4DBF\u9FCD-\u9FFF\uA48D-\uA48F\uA4C7-\uA4CF\uA62C-\uA63F\uA698-\uA69E\uA6F8-\uA6FF\uA78F\uA794-\uA79F\uA7AB-\uA7F7\uA82C-\uA82F\uA83A-\uA83F\uA878-\uA87F\uA8C5-\uA8CD\uA8DA-\uA8DF\uA8FC-\uA8FF\uA954-\uA95E\uA97D-\uA97F\uA9CE\uA9DA-\uA9DD\uA9E0-\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A\uAA5B\uAA7C-\uAA7F\uAAC3-\uAADA\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F-\uABBF\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uD7FF\uE000-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBC2-\uFBD2\uFD40-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFE\uFDFF\uFE1A-\uFE1F\uFE27-\uFE2F\uFE53\uFE67\uFE6C-\uFE6F\uFE75\uFEFD-\uFF00\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFDF\uFFE7\uFFEF-\uFFFB\uFFFE\uFFFF]/g,"."),t||(e=e.replace(/[\x09-\x10\u2028\u2029]/g,".")),e)}},{key:"escapeWhitespace",value:function(e){return e.replace(/[\x09-\x10]/g,(function(e){return String.fromCharCode(57344+e.charCodeAt(0))}))}},{key:"parseEscapedChars",value:function(e){return e.replace(/\\([abfnrtv'"]|[0-3][0-7]{2}|[0-7]{1,2}|x[\da-fA-F]{2}|u[\da-fA-F]{4}|u\{[\da-fA-F]{1,6}\}|\\)/g,(function(e,t){switch(t[0]){case"\\":return"\\";case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":return String.fromCharCode(parseInt(t,8));case"a":return String.fromCharCode(7);case"b":return"\b";case"t":return"\t";case"n":return"\n";case"v":return"\v";case"f":return"\f";case"r":return"\r";case'"':return'"';case"'":return"'";case"x":return String.fromCharCode(parseInt(t.substr(1),16));case"u":return"{"===t[1]?String.fromCodePoint(parseInt(t.slice(2,-1),16)):String.fromCharCode(parseInt(t.substr(1),16))}}))}},{key:"escapeRegex",value:function(e){return e.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")}},{key:"expandAlphRange",value:function(e){for(var r=[],n=0;n<e.length;n++)if(n<e.length-2&&"-"===e[n+1]&&"\\"!==e[n]){for(var i=t.ord(e[n]),a=t.ord(e[n+2]),s=i;s<=a;s++)r.push(t.chr(s));n+=2}else n<e.length-2&&"\\"===e[n]&&"-"===e[n+1]?(r.push("-"),n++):r.push(e[n]);return r}},{key:"convertToByteArray",value:function(e,r){switch(r.toLowerCase()){case"binary":return F(e);case"hex":return T(e);case"decimal":return I(e);case"base64":return A(e,null,"byteArray");case"utf8":return t.strToUtf8ByteArray(e);default:return t.strToByteArray(e)}}},{key:"convertToByteString",value:function(e,r){switch(r.toLowerCase()){case"binary":return t.byteArrayToChars(F(e));case"hex":return t.byteArrayToChars(T(e));case"decimal":return t.byteArrayToChars(I(e));case"base64":return t.byteArrayToChars(A(e,null,"byteArray"));case"utf8":return b().encode(e);default:return e}}},{key:"byteArrayToInt",value:function(e,t){var r=0;if("big"===t)for(var n=0;n<e.length;n++)r=256*r+e[n];else for(var i=e.length-1;i>=0;i--)r=256*r+e[i];return r}},{key:"intToByteArray",value:function(e,t,r){var n=new Array(t);if("little"===r)for(var i=0;i<t;i++)n[i]=255&e,e>>>=8;else for(var a=t-1;a>=0;a--)n[a]=255&e,e>>>=8;return n}},{key:"strToArrayBuffer",value:function(e){if(v().debug(`Converting string[${null==e?void 0:e.length}] to array buffer`),!e)return new ArrayBuffer;for(var r,n=new Uint8Array(e.length),i=e.length;i--;)if(r=e.charCodeAt(i),n[i]=r,r>255)return t.strToUtf8ArrayBuffer(e);return n.buffer}},{key:"strToUtf8ArrayBuffer",value:function(e){if(v().debug(`Converting string[${null==e?void 0:e.length}] to UTF8 array buffer`),!e)return new ArrayBuffer;var t=new TextEncoder("utf-8").encode(e);return e.length!==t.length&&(N()&&self&&"function"==typeof self.setOption?self.setOption("attemptHighlight",!1):P()&&(window.app.options.attemptHighlight=!1)),t.buffer}},{key:"strToByteArray",value:function(e){if(v().debug(`Converting string[${null==e?void 0:e.length}] to byte array`),!e)return[];for(var r,n=new Array(e.length),i=e.length;i--;)if(r=e.charCodeAt(i),n[i]=r,r>255)return t.strToUtf8ByteArray(e);return n}},{key:"strToUtf8ByteArray",value:function(e){if(v().debug(`Converting string[${null==e?void 0:e.length}] to UTF8 byte array`),!e)return[];var r=b().encode(e);return e.length!==r.length&&(N()?self.setOption("attemptHighlight",!1):P()&&(window.app.options.attemptHighlight=!1)),t.strToByteArray(r)}},{key:"strToCharcode",value:function(e){if(v().debug(`Converting string[${null==e?void 0:e.length}] to charcode`),!e)return[];for(var r=[],n=0;n<e.length;n++){var i=e.charCodeAt(n);if(n<e.length-1&&i>=55296&&i<56320){var a=e[n+1].charCodeAt(0);a>=56320&&a<57344&&(i=t.ord(e[n]+e[++n]))}r.push(i)}return r}},{key:"byteArrayToUtf8",value:function(e){var r;if(v().debug(`Converting byte array[${null===(r=e)||void 0===r?void 0:r.length}] to UTF8`),!e||!e.length)return"";e instanceof Uint8Array||(e=new Uint8Array(e));try{var n=new TextDecoder("utf-8",{fatal:!0}).decode(e);return n.length!==e.length&&(N()?self.setOption("attemptHighlight",!1):P()&&(window.app.options.attemptHighlight=!1)),n}catch(r){return t.byteArrayToChars(e)}}},{key:"byteArrayToChars",value:function(e){if(v().debug(`Converting byte array[${null==e?void 0:e.length}] to chars`),!e||!e.length)return"";for(var t="",r=0;r<e.length;r+=2e4)t+=String.fromCharCode.apply(String,g(e.slice(r,r+2e4)));return t}},{key:"arrayBufferToStr",value:function(e){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(v().debug(`Converting array buffer[${null==e?void 0:e.byteLength}] to str`),!e||!e.byteLength)return"";var n=new Uint8Array(e);return r?t.byteArrayToUtf8(n):t.byteArrayToChars(n)}},{key:"calculateShannonEntropy",value:function(e){e instanceof ArrayBuffer&&(e=new Uint8Array(e));var t,r=[],n=new Array(256).fill(0);for(t=0;t<e.length;t++)n[e[t]]++;for(t=0;t<n.length;t++)n[t]>0&&r.push(n[t]/e.length);var i,a=0;for(t=0;t<r.length;t++)a+=(i=r[t])*Math.log(i)/Math.log(2);return-a}},{key:"parseCSV",value:function(e){var t,r,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[","],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:["\n","\r"],a=!1,s=!1,o="",c=[],u=[];e.length&&"\ufeff"===e[0]&&(e=e.substr(1));for(var f=0;f<e.length;f++)t=e[f],r=e[f+1]||"",a?(o+=t,a=!1):'"'!==t||s?'"'===t&&s?'"'===r?a=!0:s=!1:!s&&n.indexOf(t)>=0?(c.push(o),o=""):!s&&i.indexOf(t)>=0?(c.push(o),o="",u.push(c),c=[],i.indexOf(r)>=0&&r!==t&&f++):o+=t:s=!0;return c.length&&(c.push(o),u.push(c)),u}},{key:"stripHtmlTags",value:function(e){function t(e,r){var n=r.replace(e,"");return n.length===r.length?n:t(e,n)}return arguments.length>1&&void 0!==arguments[1]&&arguments[1]&&(e=t(/<script[^>]*>(\s|\S)*?<\/script[^>]*>/gi,e),e=t(/<style[^>]*>(\s|\S)*?<\/style[^>]*>/gi,e)),t(/<[^>]+>/g,e)}},{key:"escapeHtml",value:function(e){var t={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`","\0":""};return e?e.replace(/[&<>"'`\u0000]/g,(function(e){return t[e]})):e}},{key:"unescapeHtml",value:function(e){var t={"&":"&","<":"<",">":">",""":'"',"'":"'","/":"/","`":"`","":"\0"};return e.replace(/(&#?x?[a-z0-9]{2,4};|\ue000)/gi,(function(e){return t[e]||e}))}},{key:"toTitleCase",value:function(e){return e.replace(/\w\S*/g,(function(e){return e.charAt(0).toUpperCase()+e.substr(1).toLowerCase()}))}},{key:"encodeURIFragment",value:function(e){var t={"%2D":"-","%2E":".","%5F":"_","%7E":"~","%21":"!","%24":"$","%27":"'","%28":"(","%29":")","%2A":"*","%2C":",","%3B":";","%3A":":","%40":"@","%2F":"/","%3F":"?"};return(e=encodeURIComponent(e)).replace(/%[0-9A-F]{2}/g,(function(e){return t[e]||e}))}},{key:"generatePrettyRecipe",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r="",n="",i="",a="",s="";return e.forEach((function(e){n=e.op.replace(/ /g,"_"),i=JSON.stringify(e.args).slice(1,-1).replace(/'/g,"\\'").replace(/"((?:[^"\\]|\\.)*)"/g,"'$1'").replace(/\\"/g,'"'),a=e.disabled?"/disabled":"",s=e.breakpoint?"/breakpoint":"",r+=`${n}(${i}${a}${s})`,t&&(r+="\n")})),r}},{key:"parseRecipeConfig",value:function(e){if(0===(e=e.trim()).length)return[];if("["===e[0])return JSON.parse(e);var t,r;e=e.replace(/\n/g,"");for(var n=/([^(]+)\(((?:'[^'\\]*(?:\\.[^'\\]*)*'|[^)/'])*)(\/[^)]+)?\)/g,i=[];t=n.exec(e);){r="["+(r=t[2].replace(/"/g,'\\"').replace(/(^|,|{|:)'/g,'$1"').replace(/([^\\]|(?:\\\\)+)'(,|:|}|$)/g,'$1"$2').replace(/\\'/g,"'"))+"]";var a={op:t[1].replace(/_/g," "),args:JSON.parse(r)};t[3]&&t[3].indexOf("disabled")>0&&(a.disabled=!0),t[3]&&t[3].indexOf("breakpoint")>0&&(a.breakpoint=!0),i.push(a)}return i}},{key:"displayFilesAsHTML",value:(r=f(l().mark((function e(r){var n,i,a,s,o;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=function(e){return`<div class='card' style='white-space: normal;'>\n <div class='card-header'>\n <h6 class="mb-0">\n ${t.escapeHtml(e.name)}\n </h6>\n </div>\n </div>`},i=function(e,r){if(r.startsWith("image")){var n="data:";return n+=r+";","<img style='max-width: 100%;' src='"+(n+="base64,"+C(e))+"'>"}return`<pre>${t.escapeHtml(t.arrayBufferToStr(e.buffer))}</pre>`},a=function(){var e=f(l().mark((function e(r,n){var a,s,o,c;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.readFile(r);case 2:return a=e.sent,s=new Blob([a],{type:r.type||"octet/stream"}),o=URL.createObjectURL(s),c=`<div class='card' style='white-space: normal;'>\n <div class='card-header' id='heading${n}'>\n <h6 class='mb-0'>\n <a class='collapsed'\n data-toggle='collapse'\n href='#collapse${n}'\n aria-expanded='false'\n aria-controls='collapse${n}'\n title="Show/hide contents of '${t.escapeHtml(r.name)}'">\n ${t.escapeHtml(r.name)}</a>\n <span class='float-right' style="margin-top: -3px">\n ${r.size.toLocaleString()} bytes\n <a title="Download ${t.escapeHtml(r.name)}"\n href="${o}"\n download="${t.escapeHtml(r.name)}"\n data-toggle="tooltip">\n <i class="material-icons" style="vertical-align: bottom">save</i>\n </a>\n <a title="Move to input"\n href="#"\n blob-url="${o}"\n file-name="${t.escapeHtml(r.name)}"\n class="extract-file"\n data-toggle="tooltip">\n <i class="material-icons" style="vertical-align: bottom">open_in_browser</i>\n </a>\n </span>\n </h6>\n </div>\n <div id='collapse${n}' class='collapse' aria-labelledby='heading${n}' data-parent="#files">\n <div class='card-body'>\n ${i(a,r.type)}\n </div>\n </div>\n </div>`,e.abrupt("return",c);case 7:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),s=`<div style='padding: 5px; white-space: normal;'>\n ${r.length} file(s) found\n </div><div id="files" style="padding: 20px">`,o=0;case 5:if(!(o<r.length)){e.next=17;break}if(!r[o].name.endsWith("/")){e.next=10;break}s+=n(r[o]),e.next=14;break;case 10:return e.t0=s,e.next=13,a(r[o],o);case 13:s=e.t0+=e.sent;case 14:o++,e.next=5;break;case 17:return e.abrupt("return",s+="</div>");case 18:case"end":return e.stop()}}),e)}))),function(e){return r.apply(this,arguments)})},{key:"parseURIParams",value:function(e){if(""===e)return{};"?"!==e[0]&&"#"!==e[0]||(e=e.substr(1));for(var t=e.split("&"),r={},n=0;n<t.length;n++){var i=t[n].split("=");2!==i.length?r[t[n]]=!0:r[i[0]]=decodeURIComponent(i[1].replace(/\+/g," "))}return r}},{key:"readFile",value:function(e){return _()?k.from(e).buffer:new Promise((function(t,r){var n=new FileReader,i=new Uint8Array(e.size),a=0,s=10485760,o=function(){if(a>=e.size)t(i);else{var r=e.slice(a,a+s);n.readAsArrayBuffer(r)}};n.onload=function(e){i.set(new Uint8Array(n.result),a),a+=s,o()},n.onerror=function(e){r(n.error.message)},o()}))}},{key:"readFileSync",value:function(e){if(!_())throw new TypeError("Browser environment cannot support readFileSync");return Uint8Array.from(e.data).buffer}},{key:"mod",value:function(e,t){return(e%t+t)%t}},{key:"gcd",value:function(e,r){return r?t.gcd(r,e%r):e}},{key:"modInv",value:function(e,t){e%=t;for(var r=1;r<t;r++)if(e*r%26==1)return r}},{key:"charRep",value:function(e){return{Space:" ",Percent:"%",Comma:",","Semi-colon":";",Colon:":",Tab:"\t","Line feed":"\n",CRLF:"\r\n","Forward slash":"/",Backslash:"\\","0x":"0x","\\x":"\\x","Nothing (separate chars)":"",None:""}[e]}},{key:"regexRep",value:function(e){return{Space:/\s+/g,Percent:/%/g,Comma:/,/g,"Semi-colon":/;/g,Colon:/:/g,"Line feed":/\n/g,CRLF:/\r\n/g,"Forward slash":/\//g,Backslash:/\\/g,"0x with comma":/,?0x/g,"0x":/0x/g,"\\x":/\\x/g,None:/\s+/g}[e]}},{key:"chunked",value:l().mark((function e(t,r){var n,i,a,s;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=t[Symbol.iterator]();case 1:i=[],a=0;case 4:if(!(a<r)){e.next=12;break}if(!(s=n.next()).done){e.next=8;break}return e.abrupt("break",12);case 8:i.push(s.value);case 9:a++,e.next=4;break;case 12:if(!i.length){e.next=17;break}return e.next=15,i;case 15:e.next=18;break;case 17:return e.abrupt("return");case 18:e.next=1;break;case 20:case"end":return e.stop()}}),e)}))}]);var r}();function _(){return void 0!==R&&null!=R.versions&&null!=R.versions.node}function P(){return"object"==typeof window}function N(){return"function"==typeof importScripts}const O=D;function L(e,t,r){return t=s(t),a(e,U()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function U(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(U=function(){return!!e})()}Array.prototype.unique=function(){for(var e={},t=[],r=0,n=this.length;r<n;r++)Object.prototype.hasOwnProperty.call(e,this[r])||(t.push(this[r]),e[this[r]]=1);return t},Array.prototype.max=function(){return Math.max.apply(null,this)},Array.prototype.min=function(){return Math.min.apply(null,this)},Array.prototype.sum=function(){return this.reduce((function(e,t){return e+t}),0)},Array.prototype.equals=function(e){if(!e)return!1;var t=this.length;if(t!==e.length)return!1;for(;t--;)if(this[t]!==e[t])return!1;return!0},String.prototype.count=function(e){return this.split(e).length-1},String.prototype.padStart||(String.prototype.padStart=function(e,t){return e|=0,t=String(void 0!==t?t:" "),this.length>e?String(this):((e-=this.length)>t.length&&(t+=t.repeat(e/t.length)),t.slice(0,e)+String(this))}),String.prototype.padEnd||(String.prototype.padEnd=function(e,t){return e|=0,t=String(void 0!==t?t:" "),this.length>e?String(this):((e-=this.length)>t.length&&(t+=t.repeat(e/t.length)),String(this)+t.slice(0,e))});const K=function(t){function r(){var t;e(this,r);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return(t=L(this,r,[].concat(i))).type="DishError",Error.captureStackTrace&&Error.captureStackTrace(t,r),t}return c(r,t),i(r)}(function(e){function t(){var t=Reflect.construct(e,Array.from(arguments));return Object.setPrototypeOf(t,Object.getPrototypeOf(this)),t}return t.prototype=Object.create(e.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e,t}(Error));var M=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,H=Math.ceil,j=Math.floor,V="[BigNumber Error] ",G=V+"Number primitive has more than 15 significant digits: ",q=1e14,z=14,W=9007199254740991,X=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],Y=1e7,J=1e9;function Q(e){var t=0|e;return e>0||e===t?t:t-1}function Z(e){for(var t,r,n=1,i=e.length,a=e[0]+"";n<i;){for(t=e[n++]+"",r=z-t.length;r--;t="0"+t);a+=t}for(i=a.length;48===a.charCodeAt(--i););return a.slice(0,i+1||1)}function $(e,t){var r,n,i=e.c,a=t.c,s=e.s,o=t.s,c=e.e,u=t.e;if(!s||!o)return null;if(r=i&&!i[0],n=a&&!a[0],r||n)return r?n?0:-o:s;if(s!=o)return s;if(r=s<0,n=c==u,!i||!a)return n?0:!i^r?1:-1;if(!n)return c>u^r?1:-1;for(o=(c=i.length)<(u=a.length)?c:u,s=0;s<o;s++)if(i[s]!=a[s])return i[s]>a[s]^r?1:-1;return c==u?0:c>u^r?1:-1}function ee(e,t,r,n){if(e<t||e>r||e!==j(e))throw Error(V+(n||"Argument")+("number"==typeof e?e<t||e>r?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function te(e){var t=e.c.length-1;return Q(e.e/z)==t&&e.c[t]%2!=0}function re(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function ne(e,t,r){var n,i;if(t<0){for(i=r+".";++t;i+=r);e=i+e}else if(++t>(n=e.length)){for(i=r,t-=n;--t;i+=r);e+=i}else t<n&&(e=e.slice(0,t)+"."+e.slice(t));return e}var ie=function e(t){var r,n,i,a,s,o,c,u,f,h,l=x.prototype={constructor:x,toString:null,valueOf:null},d=new x(1),p=20,g=4,y=-7,v=21,m=-1e7,b=1e7,w=!1,S=1,E=0,C={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},A="0123456789abcdefghijklmnopqrstuvwxyz",B=!0;function x(e,t){var r,a,s,o,c,u,f,h,l=this;if(!(l instanceof x))return new x(e,t);if(null==t){if(e&&!0===e._isBigNumber)return l.s=e.s,void(!e.c||e.e>b?l.c=l.e=null:e.e<m?l.c=[l.e=0]:(l.e=e.e,l.c=e.c.slice()));if((u="number"==typeof e)&&0*e==0){if(l.s=1/e<0?(e=-e,-1):1,e===~~e){for(o=0,c=e;c>=10;c/=10,o++);return void(o>b?l.c=l.e=null:(l.e=o,l.c=[e]))}h=String(e)}else{if(!M.test(h=String(e)))return i(l,h,u);l.s=45==h.charCodeAt(0)?(h=h.slice(1),-1):1}(o=h.indexOf("."))>-1&&(h=h.replace(".","")),(c=h.search(/e/i))>0?(o<0&&(o=c),o+=+h.slice(c+1),h=h.substring(0,c)):o<0&&(o=h.length)}else{if(ee(t,2,A.length,"Base"),10==t&&B)return k(l=new x(e),p+l.e+1,g);if(h=String(e),u="number"==typeof e){if(0*e!=0)return i(l,h,u,t);if(l.s=1/e<0?(h=h.slice(1),-1):1,x.DEBUG&&h.replace(/^0\.0*|\./,"").length>15)throw Error(G+e)}else l.s=45===h.charCodeAt(0)?(h=h.slice(1),-1):1;for(r=A.slice(0,t),o=c=0,f=h.length;c<f;c++)if(r.indexOf(a=h.charAt(c))<0){if("."==a){if(c>o){o=f;continue}}else if(!s&&(h==h.toUpperCase()&&(h=h.toLowerCase())||h==h.toLowerCase()&&(h=h.toUpperCase()))){s=!0,c=-1,o=0;continue}return i(l,String(e),u,t)}u=!1,(o=(h=n(h,t,10,l.s)).indexOf("."))>-1?h=h.replace(".",""):o=h.length}for(c=0;48===h.charCodeAt(c);c++);for(f=h.length;48===h.charCodeAt(--f););if(h=h.slice(c,++f)){if(f-=c,u&&x.DEBUG&&f>15&&(e>W||e!==j(e)))throw Error(G+l.s*e);if((o=o-c-1)>b)l.c=l.e=null;else if(o<m)l.c=[l.e=0];else{if(l.e=o,l.c=[],c=(o+1)%z,o<0&&(c+=z),c<f){for(c&&l.c.push(+h.slice(0,c)),f-=z;c<f;)l.c.push(+h.slice(c,c+=z));c=z-(h=h.slice(c)).length}else c-=f;for(;c--;h+="0");l.c.push(+h)}}else l.c=[l.e=0]}function T(e,t,r,n){var i,a,s,o,c;if(null==r?r=g:ee(r,0,8),!e.c)return e.toString();if(i=e.c[0],s=e.e,null==t)c=Z(e.c),c=1==n||2==n&&(s<=y||s>=v)?re(c,s):ne(c,s,"0");else if(a=(e=k(new x(e),t,r)).e,o=(c=Z(e.c)).length,1==n||2==n&&(t<=a||a<=y)){for(;o<t;c+="0",o++);c=re(c,a)}else if(t-=s,c=ne(c,a,"0"),a+1>o){if(--t>0)for(c+=".";t--;c+="0");}else if((t+=a-o)>0)for(a+1==o&&(c+=".");t--;c+="0");return e.s<0&&i?"-"+c:c}function I(e,t){for(var r,n,i=1,a=new x(e[0]);i<e.length;i++)(!(n=new x(e[i])).s||(r=$(a,n))===t||0===r&&a.s===t)&&(a=n);return a}function F(e,t,r){for(var n=1,i=t.length;!t[--i];t.pop());for(i=t[0];i>=10;i/=10,n++);return(r=n+r*z-1)>b?e.c=e.e=null:r<m?e.c=[e.e=0]:(e.e=r,e.c=t),e}function k(e,t,r,n){var i,a,s,o,c,u,f,h=e.c,l=X;if(h){e:{for(i=1,o=h[0];o>=10;o/=10,i++);if((a=t-i)<0)a+=z,s=t,c=h[u=0],f=j(c/l[i-s-1]%10);else if((u=H((a+1)/z))>=h.length){if(!n)break e;for(;h.length<=u;h.push(0));c=f=0,i=1,s=(a%=z)-z+1}else{for(c=o=h[u],i=1;o>=10;o/=10,i++);f=(s=(a%=z)-z+i)<0?0:j(c/l[i-s-1]%10)}if(n=n||t<0||null!=h[u+1]||(s<0?c:c%l[i-s-1]),n=r<4?(f||n)&&(0==r||r==(e.s<0?3:2)):f>5||5==f&&(4==r||n||6==r&&(a>0?s>0?c/l[i-s]:0:h[u-1])%10&1||r==(e.s<0?8:7)),t<1||!h[0])return h.length=0,n?(t-=e.e+1,h[0]=l[(z-t%z)%z],e.e=-t||0):h[0]=e.e=0,e;if(0==a?(h.length=u,o=1,u--):(h.length=u+1,o=l[z-a],h[u]=s>0?j(c/l[i-s]%l[s])*o:0),n)for(;;){if(0==u){for(a=1,s=h[0];s>=10;s/=10,a++);for(s=h[0]+=o,o=1;s>=10;s/=10,o++);a!=o&&(e.e++,h[0]==q&&(h[0]=1));break}if(h[u]+=o,h[u]!=q)break;h[u--]=0,o=1}for(a=h.length;0===h[--a];h.pop());}e.e>b?e.c=e.e=null:e.e<m&&(e.c=[e.e=0])}return e}function R(e){var t,r=e.e;return null===r?e.toString():(t=Z(e.c),t=r<=y||r>=v?re(t,r):ne(t,r,"0"),e.s<0?"-"+t:t)}return x.clone=e,x.ROUND_UP=0,x.ROUND_DOWN=1,x.ROUND_CEIL=2,x.ROUND_FLOOR=3,x.ROUND_HALF_UP=4,x.ROUND_HALF_DOWN=5,x.ROUND_HALF_EVEN=6,x.ROUND_HALF_CEIL=7,x.ROUND_HALF_FLOOR=8,x.EUCLID=9,x.config=x.set=function(e){var t,r;if(null!=e){if("object"!=typeof e)throw Error(V+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(ee(r=e[t],0,J,t),p=r),e.hasOwnProperty(t="ROUNDING_MODE")&&(ee(r=e[t],0,8,t),g=r),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((r=e[t])&&r.pop?(ee(r[0],-J,0,t),ee(r[1],0,J,t),y=r[0],v=r[1]):(ee(r,-J,J,t),y=-(v=r<0?-r:r))),e.hasOwnProperty(t="RANGE"))if((r=e[t])&&r.pop)ee(r[0],-J,-1,t),ee(r[1],1,J,t),m=r[0],b=r[1];else{if(ee(r,-J,J,t),!r)throw Error(V+t+" cannot be zero: "+r);m=-(b=r<0?-r:r)}if(e.hasOwnProperty(t="CRYPTO")){if((r=e[t])!==!!r)throw Error(V+t+" not true or false: "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw w=!r,Error(V+"crypto unavailable");w=r}else w=r}if(e.hasOwnProperty(t="MODULO_MODE")&&(ee(r=e[t],0,9,t),S=r),e.hasOwnProperty(t="POW_PRECISION")&&(ee(r=e[t],0,J,t),E=r),e.hasOwnProperty(t="FORMAT")){if("object"!=typeof(r=e[t]))throw Error(V+t+" not an object: "+r);C=r}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(r=e[t])||/^.?$|[+\-.\s]|(.).*\1/.test(r))throw Error(V+t+" invalid: "+r);B="0123456789"==r.slice(0,10),A=r}}return{DECIMAL_PLACES:p,ROUNDING_MODE:g,EXPONENTIAL_AT:[y,v],RANGE:[m,b],CRYPTO:w,MODULO_MODE:S,POW_PRECISION:E,FORMAT:C,ALPHABET:A}},x.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!x.DEBUG)return!0;var t,r,n=e.c,i=e.e,a=e.s;e:if("[object Array]"=={}.toString.call(n)){if((1===a||-1===a)&&i>=-J&&i<=J&&i===j(i)){if(0===n[0]){if(0===i&&1===n.length)return!0;break e}if((t=(i+1)%z)<1&&(t+=z),String(n[0]).length==t){for(t=0;t<n.length;t++)if((r=n[t])<0||r>=q||r!==j(r))break e;if(0!==r)return!0}}}else if(null===n&&null===i&&(null===a||1===a||-1===a))return!0;throw Error(V+"Invalid BigNumber: "+e)},x.maximum=x.max=function(){return I(arguments,-1)},x.minimum=x.min=function(){return I(arguments,1)},x.random=(a=9007199254740992,s=Math.random()*a&2097151?function(){return j(Math.random()*a)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,r,n,i,a,o=0,c=[],u=new x(d);if(null==e?e=p:ee(e,0,J),i=H(e/z),w)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(i*=2));o<i;)(a=131072*t[o]+(t[o+1]>>>11))>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),t[o]=r[0],t[o+1]=r[1]):(c.push(a%1e14),o+=2);o=i/2}else{if(!crypto.randomBytes)throw w=!1,Error(V+"crypto unavailable");for(t=crypto.randomBytes(i*=7);o<i;)(a=281474976710656*(31&t[o])+1099511627776*t[o+1]+4294967296*t[o+2]+16777216*t[o+3]+(t[o+4]<<16)+(t[o+5]<<8)+t[o+6])>=9e15?crypto.randomBytes(7).copy(t,o):(c.push(a%1e14),o+=7);o=i/7}if(!w)for(;o<i;)(a=s())<9e15&&(c[o++]=a%1e14);for(i=c[--o],e%=z,i&&e&&(a=X[z-e],c[o]=j(i/a)*a);0===c[o];c.pop(),o--);if(o<0)c=[n=0];else{for(n=-1;0===c[0];c.splice(0,1),n-=z);for(o=1,a=c[0];a>=10;a/=10,o++);o<z&&(n-=z-o)}return u.e=n,u.c=c,u}),x.sum=function(){for(var e=1,t=arguments,r=new x(t[0]);e<t.length;)r=r.plus(t[e++]);return r},n=function(){var e="0123456789";function t(e,t,r,n){for(var i,a,s=[0],o=0,c=e.length;o<c;){for(a=s.length;a--;s[a]*=t);for(s[0]+=n.indexOf(e.charAt(o++)),i=0;i<s.length;i++)s[i]>r-1&&(null==s[i+1]&&(s[i+1]=0),s[i+1]+=s[i]/r|0,s[i]%=r)}return s.reverse()}return function(n,i,a,s,o){var c,u,f,h,l,d,y,v,m=n.indexOf("."),b=p,w=g;for(m>=0&&(h=E,E=0,n=n.replace(".",""),d=(v=new x(i)).pow(n.length-m),E=h,v.c=t(ne(Z(d.c),d.e,"0"),10,a,e),v.e=v.c.length),f=h=(y=t(n,i,a,o?(c=A,e):(c=e,A))).length;0==y[--h];y.pop());if(!y[0])return c.charAt(0);if(m<0?--f:(d.c=y,d.e=f,d.s=s,y=(d=r(d,v,b,w,a)).c,l=d.r,f=d.e),m=y[u=f+b+1],h=a/2,l=l||u<0||null!=y[u+1],l=w<4?(null!=m||l)&&(0==w||w==(d.s<0?3:2)):m>h||m==h&&(4==w||l||6==w&&1&y[u-1]||w==(d.s<0?8:7)),u<1||!y[0])n=l?ne(c.charAt(1),-b,c.charAt(0)):c.charAt(0);else{if(y.length=u,l)for(--a;++y[--u]>a;)y[u]=0,u||(++f,y=[1].concat(y));for(h=y.length;!y[--h];);for(m=0,n="";m<=h;n+=c.charAt(y[m++]));n=ne(n,f,c.charAt(0))}return n}}(),r=function(){function e(e,t,r){var n,i,a,s,o=0,c=e.length,u=t%Y,f=t/Y|0;for(e=e.slice();c--;)o=((i=u*(a=e[c]%Y)+(n=f*a+(s=e[c]/Y|0)*u)%Y*Y+o)/r|0)+(n/Y|0)+f*s,e[c]=i%r;return o&&(e=[o].concat(e)),e}function t(e,t,r,n){var i,a;if(r!=n)a=r>n?1:-1;else for(i=a=0;i<r;i++)if(e[i]!=t[i]){a=e[i]>t[i]?1:-1;break}return a}function r(e,t,r,n){for(var i=0;r--;)e[r]-=i,i=e[r]<t[r]?1:0,e[r]=i*n+e[r]-t[r];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(n,i,a,s,o){var c,u,f,h,l,d,p,g,y,v,m,b,w,S,E,C,A,B=n.s==i.s?1:-1,T=n.c,I=i.c;if(!(T&&T[0]&&I&&I[0]))return new x(n.s&&i.s&&(T?!I||T[0]!=I[0]:I)?T&&0==T[0]||!I?0*B:B/0:NaN);for(y=(g=new x(B)).c=[],B=a+(u=n.e-i.e)+1,o||(o=q,u=Q(n.e/z)-Q(i.e/z),B=B/z|0),f=0;I[f]==(T[f]||0);f++);if(I[f]>(T[f]||0)&&u--,B<0)y.push(1),h=!0;else{for(S=T.length,C=I.length,f=0,B+=2,(l=j(o/(I[0]+1)))>1&&(I=e(I,l,o),T=e(T,l,o),C=I.length,S=T.length),w=C,m=(v=T.slice(0,C)).length;m<C;v[m++]=0);A=I.slice(),A=[0].concat(A),E=I[0],I[1]>=o/2&&E++;do{if(l=0,(c=t(I,v,C,m))<0){if(b=v[0],C!=m&&(b=b*o+(v[1]||0)),(l=j(b/E))>1)for(l>=o&&(l=o-1),p=(d=e(I,l,o)).length,m=v.length;1==t(d,v,p,m);)l--,r(d,C<p?A:I,p,o),p=d.length,c=1;else 0==l&&(c=l=1),p=(d=I.slice()).length;if(p<m&&(d=[0].concat(d)),r(v,d,m,o),m=v.length,-1==c)for(;t(I,v,C,m)<1;)l++,r(v,C<m?A:I,m,o),m=v.length}else 0===c&&(l++,v=[0]);y[f++]=l,v[0]?v[m++]=T[w]||0:(v=[T[w]],m=1)}while((w++<S||null!=v[0])&&B--);h=null!=v[0],y[0]||y.splice(0,1)}if(o==q){for(f=1,B=y[0];B>=10;B/=10,f++);k(g,a+(g.e=f+u*z-1)+1,s,h)}else g.e=u,g.r=+h;return g}}(),o=/^(-?)0([xbo])(?=\w[\w.]*$)/i,c=/^([^.]+)\.$/,u=/^\.([^.]+)$/,f=/^-?(Infinity|NaN)$/,h=/^\s*\+(?=[\w.])|^\s+|\s+$/g,i=function(e,t,r,n){var i,a=r?t:t.replace(h,"");if(f.test(a))e.s=isNaN(a)?null:a<0?-1:1;else{if(!r&&(a=a.replace(o,(function(e,t,r){return i="x"==(r=r.toLowerCase())?16:"b"==r?2:8,n&&n!=i?e:t})),n&&(i=n,a=a.replace(c,"$1").replace(u,"0.$1")),t!=a))return new x(a,i);if(x.DEBUG)throw Error(V+"Not a"+(n?" base "+n:"")+" number: "+t);e.s=null}e.c=e.e=null},l.absoluteValue=l.abs=function(){var e=new x(this);return e.s<0&&(e.s=1),e},l.comparedTo=function(e,t){return $(this,new x(e,t))},l.decimalPlaces=l.dp=function(e,t){var r,n,i,a=this;if(null!=e)return ee(e,0,J),null==t?t=g:ee(t,0,8),k(new x(a),e+a.e+1,t);if(!(r=a.c))return null;if(n=((i=r.length-1)-Q(this.e/z))*z,i=r[i])for(;i%10==0;i/=10,n--);return n<0&&(n=0),n},l.dividedBy=l.div=function(e,t){return r(this,new x(e,t),p,g)},l.dividedToIntegerBy=l.idiv=function(e,t){return r(this,new x(e,t),0,1)},l.exponentiatedBy=l.pow=function(e,t){var r,n,i,a,s,o,c,u,f=this;if((e=new x(e)).c&&!e.isInteger())throw Error(V+"Exponent not an integer: "+R(e));if(null!=t&&(t=new x(t)),s=e.e>14,!f.c||!f.c[0]||1==f.c[0]&&!f.e&&1==f.c.length||!e.c||!e.c[0])return u=new x(Math.pow(+R(f),s?e.s*(2-te(e)):+R(e))),t?u.mod(t):u;if(o=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new x(NaN);(n=!o&&f.isInteger()&&t.isInteger())&&(f=f.mod(t))}else{if(e.e>9&&(f.e>0||f.e<-1||(0==f.e?f.c[0]>1||s&&f.c[1]>=24e7:f.c[0]<8e13||s&&f.c[0]<=9999975e7)))return a=f.s<0&&te(e)?-0:0,f.e>-1&&(a=1/a),new x(o?1/a:a);E&&(a=H(E/z+2))}for(s?(r=new x(.5),o&&(e.s=1),c=te(e)):c=(i=Math.abs(+R(e)))%2,u=new x(d);;){if(c){if(!(u=u.times(f)).c)break;a?u.c.length>a&&(u.c.length=a):n&&(u=u.mod(t))}if(i){if(0===(i=j(i/2)))break;c=i%2}else if(k(e=e.times(r),e.e+1,1),e.e>14)c=te(e);else{if(0==(i=+R(e)))break;c=i%2}f=f.times(f),a?f.c&&f.c.length>a&&(f.c.length=a):n&&(f=f.mod(t))}return n?u:(o&&(u=d.div(u)),t?u.mod(t):a?k(u,E,g,void 0):u)},l.integerValue=function(e){var t=new x(this);return null==e?e=g:ee(e,0,8),k(t,t.e+1,e)},l.isEqualTo=l.eq=function(e,t){return 0===$(this,new x(e,t))},l.isFinite=function(){return!!this.c},l.isGreaterThan=l.gt=function(e,t){return $(this,new x(e,t))>0},l.isGreaterThanOrEqualTo=l.gte=function(e,t){return 1===(t=$(this,new x(e,t)))||0===t},l.isInteger=function(){return!!this.c&&Q(this.e/z)>this.c.length-2},l.isLessThan=l.lt=function(e,t){return $(this,new x(e,t))<0},l.isLessThanOrEqualTo=l.lte=function(e,t){return-1===(t=$(this,new x(e,t)))||0===t},l.isNaN=function(){return!this.s},l.isNegative=function(){return this.s<0},l.isPositive=function(){return this.s>0},l.isZero=function(){return!!this.c&&0==this.c[0]},l.minus=function(e,t){var r,n,i,a,s=this,o=s.s;if(t=(e=new x(e,t)).s,!o||!t)return new x(NaN);if(o!=t)return e.s=-t,s.plus(e);var c=s.e/z,u=e.e/z,f=s.c,h=e.c;if(!c||!u){if(!f||!h)return f?(e.s=-t,e):new x(h?s:NaN);if(!f[0]||!h[0])return h[0]?(e.s=-t,e):new x(f[0]?s:3==g?-0:0)}if(c=Q(c),u=Q(u),f=f.slice(),o=c-u){for((a=o<0)?(o=-o,i=f):(u=c,i=h),i.reverse(),t=o;t--;i.push(0));i.reverse()}else for(n=(a=(o=f.length)<(t=h.length))?o:t,o=t=0;t<n;t++)if(f[t]!=h[t]){a=f[t]<h[t];break}if(a&&(i=f,f=h,h=i,e.s=-e.s),(t=(n=h.length)-(r=f.length))>0)for(;t--;f[r++]=0);for(t=q-1;n>o;){if(f[--n]<h[n]){for(r=n;r&&!f[--r];f[r]=t);--f[r],f[n]+=q}f[n]-=h[n]}for(;0==f[0];f.splice(0,1),--u);return f[0]?F(e,f,u):(e.s=3==g?-1:1,e.c=[e.e=0],e)},l.modulo=l.mod=function(e,t){var n,i,a=this;return e=new x(e,t),!a.c||!e.s||e.c&&!e.c[0]?new x(NaN):!e.c||a.c&&!a.c[0]?new x(a):(9==S?(i=e.s,e.s=1,n=r(a,e,0,3),e.s=i,n.s*=i):n=r(a,e,0,S),(e=a.minus(n.times(e))).c[0]||1!=S||(e.s=a.s),e)},l.multipliedBy=l.times=function(e,t){var r,n,i,a,s,o,c,u,f,h,l,d,p,g,y,v=this,m=v.c,b=(e=new x(e,t)).c;if(!(m&&b&&m[0]&&b[0]))return!v.s||!e.s||m&&!m[0]&&!b||b&&!b[0]&&!m?e.c=e.e=e.s=null:(e.s*=v.s,m&&b?(e.c=[0],e.e=0):e.c=e.e=null),e;for(n=Q(v.e/z)+Q(e.e/z),e.s*=v.s,(c=m.length)<(h=b.length)&&(p=m,m=b,b=p,i=c,c=h,h=i),i=c+h,p=[];i--;p.push(0));for(g=q,y=Y,i=h;--i>=0;){for(r=0,l=b[i]%y,d=b[i]/y|0,a=i+(s=c);a>i;)r=((u=l*(u=m[--s]%y)+(o=d*u+(f=m[s]/y|0)*l)%y*y+p[a]+r)/g|0)+(o/y|0)+d*f,p[a--]=u%g;p[a]=r}return r?++n:p.splice(0,1),F(e,p,n)},l.negated=function(){var e=new x(this);return e.s=-e.s||null,e},l.plus=function(e,t){var r,n=this,i=n.s;if(t=(e=new x(e,t)).s,!i||!t)return new x(NaN);if(i!=t)return e.s=-t,n.minus(e);var a=n.e/z,s=e.e/z,o=n.c,c=e.c;if(!a||!s){if(!o||!c)return new x(i/0);if(!o[0]||!c[0])return c[0]?e:new x(o[0]?n:0*i)}if(a=Q(a),s=Q(s),o=o.slice(),i=a-s){for(i>0?(s=a,r=c):(i=-i,r=o),r.reverse();i--;r.push(0));r.reverse()}for((i=o.length)-(t=c.length)<0&&(r=c,c=o,o=r,t=i),i=0;t;)i=(o[--t]=o[t]+c[t]+i)/q|0,o[t]=q===o[t]?0:o[t]%q;return i&&(o=[i].concat(o),++s),F(e,o,s)},l.precision=l.sd=function(e,t){var r,n,i,a=this;if(null!=e&&e!==!!e)return ee(e,1,J),null==t?t=g:ee(t,0,8),k(new x(a),e,t);if(!(r=a.c))return null;if(n=(i=r.length-1)*z+1,i=r[i]){for(;i%10==0;i/=10,n--);for(i=r[0];i>=10;i/=10,n++);}return e&&a.e+1>n&&(n=a.e+1),n},l.shiftedBy=function(e){return ee(e,-9007199254740991,W),this.times("1e"+e)},l.squareRoot=l.sqrt=function(){var e,t,n,i,a,s=this,o=s.c,c=s.s,u=s.e,f=p+4,h=new x("0.5");if(1!==c||!o||!o[0])return new x(!c||c<0&&(!o||o[0])?NaN:o?s:1/0);if(0==(c=Math.sqrt(+R(s)))||c==1/0?(((t=Z(o)).length+u)%2==0&&(t+="0"),c=Math.sqrt(+t),u=Q((u+1)/2)-(u<0||u%2),n=new x(t=c==1/0?"5e"+u:(t=c.toExponential()).slice(0,t.indexOf("e")+1)+u)):n=new x(c+""),n.c[0])for((c=(u=n.e)+f)<3&&(c=0);;)if(a=n,n=h.times(a.plus(r(s,a,f,1))),Z(a.c).slice(0,c)===(t=Z(n.c)).slice(0,c)){if(n.e<u&&--c,"9999"!=(t=t.slice(c-3,c+1))&&(i||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(k(n,n.e+p+2,1),e=!n.times(n).eq(s));break}if(!i&&(k(a,a.e+p+2,0),a.times(a).eq(s))){n=a;break}f+=4,c+=4,i=1}return k(n,n.e+p+1,g,e)},l.toExponential=function(e,t){return null!=e&&(ee(e,0,J),e++),T(this,e,t,1)},l.toFixed=function(e,t){return null!=e&&(ee(e,0,J),e=e+this.e+1),T(this,e,t)},l.toFormat=function(e,t,r){var n,i=this;if(null==r)null!=e&&t&&"object"==typeof t?(r=t,t=null):e&&"object"==typeof e?(r=e,e=t=null):r=C;else if("object"!=typeof r)throw Error(V+"Argument not an object: "+r);if(n=i.toFixed(e,t),i.c){var a,s=n.split("."),o=+r.groupSize,c=+r.secondaryGroupSize,u=r.groupSeparator||"",f=s[0],h=s[1],l=i.s<0,d=l?f.slice(1):f,p=d.length;if(c&&(a=o,o=c,c=a,p-=a),o>0&&p>0){for(a=p%o||o,f=d.substr(0,a);a<p;a+=o)f+=u+d.substr(a,o);c>0&&(f+=u+d.slice(a)),l&&(f="-"+f)}n=h?f+(r.decimalSeparator||"")+((c=+r.fractionGroupSize)?h.replace(new RegExp("\\d{"+c+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):h):f}return(r.prefix||"")+n+(r.suffix||"")},l.toFraction=function(e){var t,n,i,a,s,o,c,u,f,h,l,p,y=this,v=y.c;if(null!=e&&(!(c=new x(e)).isInteger()&&(c.c||1!==c.s)||c.lt(d)))throw Error(V+"Argument "+(c.isInteger()?"out of range: ":"not an integer: ")+R(c));if(!v)return new x(y);for(t=new x(d),f=n=new x(d),i=u=new x(d),p=Z(v),s=t.e=p.length-y.e-1,t.c[0]=X[(o=s%z)<0?z+o:o],e=!e||c.comparedTo(t)>0?s>0?t:f:c,o=b,b=1/0,c=new x(p),u.c[0]=0;h=r(c,t,0,1),1!=(a=n.plus(h.times(i))).comparedTo(e);)n=i,i=a,f=u.plus(h.times(a=f)),u=a,t=c.minus(h.times(a=t)),c=a;return a=r(e.minus(n),i,0,1),u=u.plus(a.times(f)),n=n.plus(a.times(i)),u.s=f.s=y.s,l=r(f,i,s*=2,g).minus(y).abs().comparedTo(r(u,n,s,g).minus(y).abs())<1?[f,i]:[u,n],b=o,l},l.toNumber=function(){return+R(this)},l.toPrecision=function(e,t){return null!=e&&ee(e,1,J),T(this,e,t,2)},l.toString=function(e){var t,r=this,i=r.s,a=r.e;return null===a?i?(t="Infinity",i<0&&(t="-"+t)):t="NaN":(null==e?t=a<=y||a>=v?re(Z(r.c),a):ne(Z(r.c),a,"0"):10===e&&B?t=ne(Z((r=k(new x(r),p+a+1,g)).c),r.e,"0"):(ee(e,2,A.length,"Base"),t=n(ne(Z(r.c),a,"0"),10,e,i,!0)),i<0&&r.c[0]&&(t="-"+t)),t},l.valueOf=l.toJSON=function(){return R(this)},l._isBigNumber=!0,l[Symbol.toStringTag]="BigNumber",l[Symbol.for("nodejs.util.inspect.custom")]=l.valueOf,null!=t&&x.set(t),x}();const ae=ie;function se(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,a,s,o=[],c=!0,u=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=a.call(r)).done)&&(o.push(n.value),o.length!==t);c=!0);}catch(e){u=!0,i=e}finally{try{if(!c&&null!=r.return&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw i}}return o}}(e,t)||p(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var oe=function(){function t(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;e(this,t),this.bytes=r,this.length=this.bytes.length,this.position=n,this.bitPos=i}return i(t,[{key:"clone",value:function(){return new t(this.bytes,this.position,this.bitPos)}},{key:"getBytes",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(!(this.position>this.length)){var t=null!==e?this.position+e:this.length,r=this.bytes.slice(this.position,t);return this.position=t,this.bitPos=0,r}}},{key:"readString",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;if(!(this.position>this.length)){-1===e&&(e=this.length-this.position);for(var t="",r=this.position;r<this.position+e;r++){var n=this.bytes[r];if(0===n)break;t+=String.fromCharCode(n)}return this.position+=e,this.bitPos=0,t}}},{key:"readInt",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"be";if(!(this.position>this.length)){var r=0;if("be"===t)for(var n=this.position;n<this.position+e;n++)r<<=8,r|=this.bytes[n];else for(var i=this.position+e-1;i>=this.position;i--)r<<=8,r|=this.bytes[i];return this.position+=e,this.bitPos=0,r}}},{key:"readBits",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"be";if(!(this.position>this.length)){var r,n=0,i=0;for(n=this.bytes[this.position++]&(r=this.bitPos,"be"===t?(1<<8-r)-1:256-(1<<r)),"be"!==t&&(n>>>=this.bitPos),i=8-this.bitPos,this.bitPos=0;i<e;)"be"===t?n=n<<i|this.bytes[this.position++]:n|=this.bytes[this.position++]<<i,i+=8;if(i>e){var a=i-e;"be"===t?n>>>=a:n&=(1<<e)-1,i-=a,this.position--,this.bitPos=8-a}return n}}},{key:"continueUntil",value:function(e){if(!(this.position>this.length))if(this.bitPos=0,"number"!=typeof e){var t=e.length,r=e[t-1];this.position=t;for(var n,i=function(e,t){var r=new Array;return e.forEach((function(e,n){r[e]=t-n})),r}(e,t);this.position<this.length;){for(;this.position<this.length&&this.bytes[this.position++]!==r;);n=!0;for(var a=t-1;a>=0;a--)if(this.bytes[this.position-t+a]!==e[a]){n=!1,this.position+=i[e[a]];break}if(n){this.position-=t;break}}}else for(;++this.position<this.length&&this.bytes[this.position]!==e;);}},{key:"consumeWhile",value:function(e){for(;this.position<this.length&&this.bytes[this.position]===e;)this.position++;this.bitPos=0}},{key:"consumeIf",value:function(e){this.bytes[this.position]===e&&(this.position++,this.bitPos=0)}},{key:"moveForwardsBy",value:function(e){var t=this.position+e;if(t<0||t>this.length)throw new Error("Cannot move to position "+t+" in stream. Out of bounds.");this.position=t,this.bitPos=0}},{key:"moveBackwardsBy",value:function(e){var t=this.position-e;if(t<0||t>this.length)throw new Error("Cannot move to position "+t+" in stream. Out of bounds.");this.position=t,this.bitPos=0}},{key:"moveBackwardsByBits",value:function(e){if(e<=this.bitPos)this.bitPos-=e;else for(this.bitPos>0&&(e-=this.bitPos,this.bitPos=0);e>0;)this.moveBackwardsBy(1),this.bitPos=8,this.moveBackwardsByBits(e),e-=8}},{key:"moveTo",value:function(e){if(e<0||e>this.length)throw new Error("Cannot move to position "+e+" in stream. Out of bounds.");this.position=e,this.bitPos=0}},{key:"hasMore",value:function(){return this.position<this.length}},{key:"carve",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.position;return this.bitPos>0&&t++,this.bytes.slice(e,t)}}])}();function ce(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return ue(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ue(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,o=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return s=e.done,e},e:function(e){o=!0,a=e},f:function(){try{s||null==r.return||r.return()}finally{if(o)throw a}}}}function ue(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var fe={Images:[{name:"Joint Photographic Experts Group image",extension:"jpg,jpeg,jpe,thm,mpo",mime:"image/jpeg",description:"",signature:{0:255,1:216,2:255,3:[192,196,219,221,224,225,226,227,228,229,231,232,234,235,236,237,238,254]},extractor:function(e,t){for(var r=new oe(e.slice(t));r.hasMore();){var n=r.getBytes(2);if(255!==n[0])throw new Error(`Invalid marker while parsing JPEG at pos ${r.position}: ${n}`);var i=0;switch(n[1]){case 216:case 1:break;case 217:return r.carve();case 192:case 193:case 194:case 195:case 196:case 197:case 198:case 199:case 200:case 201:case 202:case 203:case 204:case 205:case 206:case 207:case 219:case 222:case 224:case 225:case 226:case 227:case 228:case 229:case 230:case 231:case 232:case 233:case 234:case 235:case 236:case 237:case 238:case 239:case 254:i=r.readInt(2,"be"),r.position+=i-2;break;case 223:r.position++;break;case 220:case 221:r.position+=2;break;case 218:i=r.readInt(2,"be"),r.position+=i-2,r.continueUntil(255);break;default:r.continueUntil(255)}}throw new Error("Unable to parse JPEG successfully")}},{name:"Graphics Interchange Format image",extension:"gif",mime:"image/gif",description:"",signature:{0:71,1:73,2:70,3:56,4:[55,57],5:97},extractor:function(e,t){var r=new oe(e.slice(t));for(r.continueUntil([33,255]),r.continueUntil([33,249]),r.moveForwardsBy(2);r.hasMore();){for(r.moveForwardsBy(r.readInt(1)+1),r.moveForwardsBy(11);!Array.from(r.getBytes(2)).equals([33,249])&&(r.moveBackwardsBy(2),r.moveForwardsBy(r.readInt(1)),r.readInt(1));)r.moveBackwardsBy(1);if(59===r.readInt(1))break;r.moveForwardsBy(1)}return r.carve()}},{name:"Portable Network Graphics image",extension:"png",mime:"image/png",description:"",signature:{0:137,1:80,2:78,3:71,4:13,5:10,6:26,7:10},extractor:function(e,t){var r=new oe(e.slice(t));r.moveForwardsBy(8);for(var n=0,i="";"IEND"!==i;)n=r.readInt(4,"be"),i=r.readString(4),r.moveForwardsBy(n+4);return r.carve()}},{name:"WEBP Image",extension:"webp",mime:"image/webp",description:"",signature:{8:87,9:69,10:66,11:80},extractor:function(e,t){var r=new oe(e.slice(t));r.moveForwardsBy(4);var n=r.readInt(4,"le");return r.moveForwardsBy(n),r.carve()}},{name:"High Efficiency Image File Format",extension:"heic,heif",mime:"image/heif",description:"",signature:{0:0,1:0,2:0,3:[36,24],4:102,5:116,6:121,7:112,8:104,9:101,10:105,11:99},extractor:null},{name:"Camera Image File Format",extension:"crw",mime:"image/x-canon-crw",description:"",signature:{6:72,7:69,8:65,9:80,10:67,11:67,12:68,13:82},extractor:null},{name:"Canon CR2 raw image",extension:"cr2",mime:"image/x-canon-cr2",description:"",signature:[{0:73,1:73,2:42,3:0,8:67,9:82},{0:77,1:77,2:0,3:42,8:67,9:82}],extractor:null},{name:"Tagged Image File Format image",extension:"tif",mime:"image/tiff",description:"",signature:[{0:73,1:73,2:42,3:0},{0:77,1:77,2:0,3:42}],extractor:null},{name:"Bitmap image",extension:"bmp",mime:"image/bmp",description:"",signature:{0:66,1:77,7:0,9:0,14:[12,40,56,64,108,124],15:0,16:0,17:0},extractor:function(e,t){var r=new oe(e.slice(t));r.moveForwardsBy(2);var n=r.readInt(4,"le");return r.moveForwardsBy(n-6),r.carve()}},{name:"JPEG Extended Range image",extension:"jxr",mime:"image/vnd.ms-photo",description:"",signature:{0:73,1:73,2:188},extractor:null},{name:"Photoshop image",extension:"psd",mime:"image/vnd.adobe.photoshop",description:"",signature:{0:56,1:66,2:80,3:83,4:0,5:1,6:0,7:0,8:0,9:0,10:0,11:0},extractor:null},{name:"Photoshop Large Document",extension:"psb",mime:"application/x-photoshop",description:"",signature:{0:56,1:66,2:80,3:83,4:0,5:2,6:0,7:0,8:0,9:0,10:0,11:0,12:0},extractor:null},{name:"Paint Shop Pro image",extension:"psp",mime:"image/psp",description:"",signature:[{0:80,1:97,2:105,3:110,4:116,5:32,6:83,7:104,8:111,9:112,10:32,11:80,12:114,13:111,14:32,15:73,16:109},{0:126,1:66,2:75,3:0}],extractor:null},{name:"The GIMP image",extension:"xcf",mime:"image/x-xcf",description:"",signature:{0:103,1:105,2:109,3:112,4:32,5:120,6:99,7:102,8:32,9:[102,118],10:[105,48],11:[108,48],12:[101,49,50,51]},extractor:null},{name:"Icon image",extension:"ico",mime:"image/x-icon",description:"",signature:{0:0,1:0,2:1,3:0,4:[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21],5:0,6:[16,32,48,64,128],7:[16,32,48,64,128],9:0,10:[0,1]},extractor:function(e,t){var r=new oe(e.slice(t));r.moveTo(4);var n=r.readInt(2,"le");r.moveForwardsBy(8+16*(n-1));var i=r.readInt(4,"le"),a=r.readInt(4,"le");return r.moveTo(a+i),r.carve()}},{name:"Radiance High Dynamic Range image",extension:"hdr",mime:"image/vnd.radiance",description:"",signature:{0:35,1:63,2:82,3:65,4:68,5:73,6:65,7:78,8:67,9:69,10:10},extractor:null},{name:"Sony ARW image",extension:"arw",mime:"image/x-raw",description:"",signature:{0:5,1:0,2:0,3:0,4:65,5:87,6:49,7:46},extractor:null},{name:"Fujifilm Raw Image",extension:"raf",mime:"image/x-raw",description:"",signature:{0:70,1:85,2:74,3:73,4:70,5:73,6:76,7:77,8:67,9:67,10:68,11:45,12:82,13:65,14:87},extractor:null},{name:"Minolta RAW image",extension:"mrw",mime:"image/x-raw",description:"",signature:{0:0,1:77,2:82,3:77},extractor:null},{name:"Adobe Bridge Thumbnail Cache",extension:"bct",mime:"application/octet-stream",description:"",signature:{0:108,1:110,2:98,3:116,4:2,5:0,6:0,7:0},extractor:null},{name:"Microsoft Document Imaging",extension:"mdi",mime:"image/vnd.ms-modi",description:"",signature:{0:69,1:80,2:42,3:0},extractor:null},{name:"Joint Photographic Experts Group image (under Base64)",extension:"B64",mime:"application/octet-stream",description:"",signature:{0:47,1:57,2:106,3:47,4:52},extractor:null},{name:"Portable Network Graphics image (under Base64)",extension:"B64",mime:"application/octet-stream",description:"",signature:{0:105,1:86,2:66,3:79,4:82,5:119,6:48},extractor:null},{name:"AutoCAD Drawing",extension:"dwg,123d",mime:"application/acad",description:"",signature:{0:65,1:67,2:49,3:48,4:[48,49],5:[48,49,50,51,52,53],6:0},extractor:null},{name:"AutoCAD Drawing",extension:"dwg,dwt",mime:"application/acad",description:"",signature:[{0:65,1:67,2:49,3:48,4:49,5:56,6:0},{0:65,1:67,2:49,3:48,4:50,5:52,6:0},{0:65,1:67,2:49,3:48,4:50,5:55,6:0}],extractor:null},{name:"Targa Image",extension:"tga",mime:"image/x-targa",description:"",signature:[{0:84,1:82,2:85,3:69,4:86,5:73,6:83,7:73,8:79,9:78,10:45,11:88,12:70,13:73,14:76,15:69,16:46}],extractor:function(e,t){var r=new oe(e);r.moveTo(t-8);var n=r.readInt(4,"le"),i=r.readInt(4,"le");function a(e,t){for(var n=0;n<e;n++){r.moveBackwardsBy(1);var i=r.readInt(t,"le")-1;if(r.moveBackwardsBy(t),i===n)break}}return r.moveBackwardsBy(8),n||i?n?(a(65535,2),r.moveBackwardsBy(n)):i&&(a(4294967295,4),r.moveBackwardsBy(6),r.moveBackwardsBy(i)):(function(){r.moveBackwardsBy(5);for(var e=0;e<1048576&&r.readInt(2,"le")*r.readInt(2,"le")*r.readInt(1)/8!=e-1;e++)r.moveBackwardsBy(6)}(),r.moveBackwardsBy(17)),r.carve(r.position,t+18)}}],Video:[{name:"Matroska Multimedia Container",extension:"mkv",mime:"video/x-matroska",description:"",signature:{31:109,32:97,33:116,34:114,35:111,36:115,37:107,38:97},extractor:null},{name:"WEBM video",extension:"webm",mime:"video/webm",description:"",signature:{0:26,1:69,2:223,3:163},extractor:null},{name:"Flash MP4 video",extension:"f4v",mime:"video/mp4",description:"",signature:{4:102,5:116,6:121,7:112,8:[102,70],9:52,10:[118,86],11:32},extractor:null},{name:"MPEG-4 video",extension:"mp4",mime:"video/mp4",description:"",signature:[{0:0,1:0,2:0,3:[24,32],4:102,5:116,6:121,7:112},{0:51,1:103,2:112,3:53},{0:0,1:0,2:0,3:28,4:102,5:116,6:121,7:112,8:109,9:112,10:52,11:50,16:109,17:112,18:52,19:49,20:109,21:112,22:52,23:50,24:105,25:115,26:111,27:109}],extractor:null},{name:"M4V video",extension:"m4v",mime:"video/x-m4v",description:"",signature:{0:0,1:0,2:0,3:28,4:102,5:116,6:121,7:112,8:77,9:52,10:86},extractor:null},{name:"Quicktime video",extension:"mov",mime:"video/quicktime",description:"",signature:{0:0,1:0,2:0,3:20,4:102,5:116,6:121,7:112},extractor:null},{name:"Audio Video Interleave",extension:"avi",mime:"video/x-msvideo",description:"",signature:{0:82,1:73,2:70,3:70,8:65,9:86,10:73},extractor:null},{name:"Windows Media Video",extension:"wmv",mime:"video/x-ms-wmv",description:"",signature:{0:48,1:38,2:178,3:117,4:142,5:102,6:207,7:17,8:166,9:217},extractor:null},{name:"MPEG video",extension:"mpg",mime:"video/mpeg",description:"",signature:{0:0,1:0,2:1,3:186},extractor:null},{name:"Flash Video",extension:"flv",mime:"video/x-flv",description:"",signature:{0:70,1:76,2:86,3:1},extractor:function(e,t){var r=new oe(e.slice(t));r.moveForwardsBy(5);var n=r.readInt(4,"be");r.moveForwardsBy(n-9);for(var i=-11;r.hasMore();){var a=r.readInt(4,"be"),s=r.readInt(1);if([8,9,18].indexOf(s)<0){r.moveBackwardsBy(1);break}if(a!==i+11){r.moveBackwardsBy(i+11+5);break}i=r.readInt(3,"be"),r.moveForwardsBy(7+i)}return r.carve()}},{name:"OGG Video",extension:"ogv,ogm,opus,ogx",mime:"video/ogg",description:"",signature:[{0:79,1:103,2:103,3:83,4:0,5:2,28:1,29:118,30:105,31:100,32:101,33:111},{0:79,1:103,2:103,3:83,4:0,5:2,28:128,29:116,30:104,31:101,32:111,33:114,34:97},{0:79,1:103,2:103,3:83,4:0,5:2,28:102,29:105,30:115,31:104,32:101,33:97,34:100}],extractor:null}],Audio:[{name:"Waveform Audio",extension:"wav",mime:"audio/x-wav",description:"",signature:{0:82,1:73,2:70,3:70,8:87,9:65,10:86,11:69},extractor:function(e,t){var r=new oe(e.slice(t));return r.moveTo(4),r.moveTo(r.readInt(4,"le")+8),r.carve()}},{name:"OGG audio",extension:"ogg",mime:"audio/ogg",description:"",signature:{0:79,1:103,2:103,3:83},extractor:null},{name:"Musical Instrument Digital Interface audio",extension:"midi",mime:"audio/midi",description:"",signature:{0:77,1:84,2:104,3:100},extractor:null},{name:"MPEG-3 audio",extension:"mp3",mime:"audio/mpeg",description:"",signature:[{0:73,1:68,2:51},{0:255,1:251}],extractor:function(e,t){var r=new oe(e.slice(t)),n=["free",32e3,4e4,48e3,56e3,64e3,8e4,96e3,112e3,128e3,16e4,192e3,224e3,256e3,32e4,"bad"],i=[44100,48e3,32e3,"reserved"];if(r.getBytes(3).toString()===[73,68,51].toString()){r.moveTo(6);var a=r.readInt(1)<<21|r.readInt(1)<<14|r.readInt(1)<<7|r.readInt(1);r.moveForwardsBy(a)}else r.moveTo(0);for(;r.hasMore();){if(r.getBytes(3)===[84,65,71].toString()){r.moveForwardsBy(125);break}if(r.getBytes(2).toString()!==[255,251].toString()){r.moveBackwardsBy(2);break}var s=r.readInt(1),o=n[s>>4],c=i[(15&s)>>2],u=(2&s)>>1;if("free"===o||"bad"===o||"reserved"===c){r.moveBackwardsBy(1);break}var f=Math.floor(144*o/c+u);if(r.position+f>r.length){r.moveTo(r.length);break}r.moveForwardsBy(f-3)}return r.carve()}},{name:"MPEG-4 Part 14 audio",extension:"m4a",mime:"audio/m4a",description:"",signature:[{4:102,5:116,6:121,7:112,8:77,9:52,10:65},{0:77,1:52,2:65,3:32}],extractor:null},{name:"Free Lossless Audio Codec",extension:"flac",mime:"audio/x-flac",description:"",signature:{0:102,1:76,2:97,3:67},extractor:null},{name:"Adaptive Multi-Rate audio codec",extension:"amr",mime:"audio/amr",description:"",signature:{0:35,1:33,2:65,3:77,4:82,5:10},extractor:null},{name:"Audacity",extension:"au",mime:"audio/x-au",description:"",signature:{0:100,1:110,2:115,3:46,24:65,25:117,26:100,27:97,28:99,29:105,30:116,31:121,32:66,33:108,34:111,35:99,36:107,37:70,38:105,39:108,40:101},extractor:null},{name:"Audacity Block",extension:"auf",mime:"application/octet-stream",description:"",signature:{0:65,1:117,2:100,3:97,4:99,5:105,6:116,7:121,8:66,9:108,10:111,11:99,12:107,13:70,14:105,15:108,16:101},extractor:null},{name:"Audio Interchange File",extension:"aif",mime:"audio/x-aiff",description:"",signature:{0:70,1:79,2:82,3:77,8:65,9:73,10:70,11:70},extractor:null},{name:"Audio Interchange File (compressed)",extension:"aifc",mime:"audio/x-aifc",description:"",signature:{0:70,1:79,2:82,3:77,8:65,9:73,10:70,11:67},extractor:null}],Documents:[{name:"Portable Document Format",extension:"pdf",mime:"application/pdf",description:"",signature:{0:37,1:80,2:68,3:70},extractor:function(e,t){var r=new oe(e.slice(t));return r.continueUntil([37,37,69,79,70]),r.moveForwardsBy(5),r.consumeIf(13),r.consumeIf(10),r.carve()}},{name:"Portable Document Format (under Base64)",extension:"B64",mime:"application/octet-stream",description:"",signature:{0:65,1:74,2:86,3:66,4:69,5:82,6:105},extractor:null},{name:"Adobe PostScript",extension:"ps,eps,ai,pfa",mime:"application/postscript",description:"",signature:{0:37,1:33,2:80,3:83,4:45,5:65,6:100,7:111,8:98,9:101},extractor:null},{name:"PostScript",extension:"ps",mime:"application/postscript",description:"",signature:{0:37,1:33},extractor:null},{name:"Encapsulated PostScript",extension:"eps,ai",mime:"application/eps",description:"",signature:{0:197,1:208,2:211,3:198},extractor:null},{name:"Rich Text Format",extension:"rtf",mime:"application/rtf",description:"",signature:{0:123,1:92,2:114,3:116},extractor:function(e,t){var r=new oe(e.slice(t)),n=0;if(123!==r.readInt(1))throw new Error("Not a valid RTF file");for(n++;n>0&&r.hasMore();)switch(r.readInt(1)){case 123:n++;break;case 125:n--;break;case 92:r.consumeIf(92),r.position++}return r.carve()}},{name:"Microsoft Office document/OLE2",extension:"ole2,doc,xls,dot,ppt,xla,ppa,pps,pot,msi,sdw,db,vsd,msg",mime:"application/msword,application/vnd.ms-excel,application/vnd.ms-powerpoint",description:"Microsoft Office documents",signature:{0:208,1:207,2:17,3:224,4:161,5:177,6:26,7:225},extractor:null},{name:"Microsoft Office document/OLE2 (under Base64)",extension:"B64",mime:"application/octet-stream",description:"",signature:{0:48,1:77,2:56,3:82,4:52,5:75,6:71,7:120},extractor:null},{name:"Microsoft Office 2007+ document",extension:"docx,xlsx,pptx",mime:"application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.openxmlformats-officedocument.presentationml.presentation",description:"",signature:{38:95,39:84,40:121,41:112,42:101,43:115,44:93,45:46,46:120,47:109,48:108},extractor:he},{name:"Microsoft Access database",extension:"mdb,mda,mde,mdt,fdb,psa",mime:"application/msaccess",description:"",signature:{0:0,1:1,2:0,3:0,4:83,5:116,6:97,7:110,8:100,9:97,10:114,11:100,12:32,13:74,14:101,15:116},extractor:null},{name:"Microsoft Access 2007+ database",extension:"accdb,accde,accda,accdu",mime:"application/msaccess",description:"",signature:{0:0,1:1,2:0,3:0,4:83,5:116,6:97,7:110,8:100,9:97,10:114,11:100,12:32,13:65,14:67,15:69,16:32},extractor:null},{name:"Microsoft OneNote document",extension:"one",mime:"application/onenote",description:"",signature:{0:228,1:82,2:92,3:123,4:140,5:216,6:167,7:77,8:174,9:177,10:83,11:120,12:208,13:41,14:150,15:211},extractor:null},{name:"Outlook Express database",extension:"dbx",mime:"application/octet-stream",description:"",signature:{0:207,1:173,2:18,3:254,4:[48,197,198,199],11:17},extractor:null},{name:"Personal Storage Table (Outlook)",extension:"pst,ost,fdb,pab",mime:"application/octet-stream",description:"",signature:{0:33,1:66,2:68,3:78},extractor:null},{name:"Microsoft Exchange Database",extension:"edb",mime:"application/octet-stream",description:"",signature:{4:239,5:205,6:171,7:137,8:[32,35],9:6,10:0,11:0,12:[0,1],13:0,14:0,15:0},extractor:null},{name:"WordPerfect document",extension:"wpd,wp,wp5,wp6,wpp,bk!,wcm",mime:"application/wordperfect",description:"",signature:{0:255,1:87,2:80,3:67,7:[0,1,2],8:1,9:10},extractor:null},{name:"EPUB e-book",extension:"epub",mime:"application/epub+zip",description:"",signature:{0:80,1:75,2:3,3:4,30:109,31:105,32:109,33:101,34:116,35:121,36:112,37:101,38:97,39:112,40:112,41:108,42:105,43:99,44:97,45:116,46:105,47:111,48:110,49:47,50:101,51:112,52:117,53:98,54:43,55:122,56:105,57:112},extractor:he}],Applications:[{name:"Windows Portable Executable",extension:"exe,dll,drv,vxd,sys,ocx,vbx,com,fon,scr",mime:"application/vnd.microsoft.portable-executable",description:"",signature:{0:77,1:90,3:[0,1,2],5:[0,1,2]},extractor:function(e,t){var r=new oe(e.slice(t));r.moveTo(60);var n=r.readInt(4,"le");r.moveTo(n),r.moveForwardsBy(6);var i=r.readInt(2,"le");r.moveForwardsBy(16);var a=523===r.readInt(2,"le")?112:96;r.moveForwardsBy(a-2),r.moveForwardsBy(32);var s=r.readInt(4,"le"),o=r.readInt(4,"le");if(s>0)return r.moveTo(s+o),r.carve();r.moveForwardsBy(88),r.moveForwardsBy(40*(i-1)),r.moveForwardsBy(16);var c=r.readInt(4,"le"),u=r.readInt(4,"le");return r.moveTo(u+c),r.carve()}},{name:"Executable and Linkable Format",extension:"elf,bin,axf,o,prx,so",mime:"application/x-executable",description:"Executable and Linkable Format file. No standard file extension.",signature:{0:127,1:69,2:76,3:70},extractor:function(e,t){var r=new oe(e.slice(t));r.moveForwardsBy(4);var n=1===r.readInt(1),i=1===r.readInt(1)?"le":"be";r.moveForwardsBy(n?26:34);var a=n?r.readInt(4,i):r.readInt(8,i);r.moveForwardsBy(10);var s=r.readInt(2,i),o=r.readInt(2,i);return r.moveTo(a),r.moveForwardsBy(s*o),r.carve()}},{name:"MacOS Mach-O object",extension:"dylib",mime:"application/octet-stream",description:"",signature:[{0:202,1:254,2:186,3:190,4:0,5:0,6:0,7:[1,2,3]},{0:206,1:250,2:237,3:254,4:7,5:0,6:0,7:0,8:[1,2,3]}],extractor:le},{name:"MacOS Mach-O 64-bit object",extension:"dylib",mime:"application/octet-stream",description:"",signature:{0:207,1:250,2:237,3:254},extractor:le},{name:"Adobe Flash",extension:"swf",mime:"application/x-shockwave-flash",description:"",signature:{0:[67,70],1:87,2:83},extractor:null},{name:"Java Class",extension:"class",mime:"application/java-vm",description:"",signature:{0:202,1:254,2:186,3:190},extractor:null},{name:"Dalvik Executable",extension:"dex",mime:"application/octet-stream",description:"Dalvik Executable as used by Android",signature:{0:100,1:101,2:120,3:10,4:48,5:51,6:53,7:0},extractor:null},{name:"Google Chrome Extension",extension:"crx",mime:"application/crx",description:"Google Chrome extension or packaged app",signature:{0:67,1:114,2:50,3:52},extractor:null}],Archives:[{name:"PKZIP archive",extension:"zip",mime:"application/zip",description:"",signature:{0:80,1:75,2:[3,5,7],3:[4,6,8]},extractor:he},{name:"PKZIP archive (under Base64)",extension:"B64",mime:"application/octet-stream",description:"",signature:{0:85,1:69,2:115,3:68,4:66,5:66},extractor:null},{name:"TAR archive",extension:"tar",mime:"application/x-tar",description:"",signature:{257:117,258:115,259:116,260:97,261:114},extractor:function(e,t){for(var r=new oe(e.slice(t)),n=function(){if(r.moveForwardsBy(257),r.getBytes(5).join("")!==[117,115,116,97,114].join(""))return r.moveBackwardsBy(262),1;r.moveBackwardsBy(138);var e=0;r.getBytes(11).forEach((function(t,r){e+=(t-48).toString()})),e=512*Math.ceil(parseInt(e,8)/512),r.moveForwardsBy(e+377)};r.hasMore()&&!n(););return r.consumeWhile(0),r.carve()}},{name:"Roshal Archive",extension:"rar",mime:"application/x-rar-compressed",description:"",signature:{0:82,1:97,2:114,3:33,4:26,5:7,6:[0,1]},extractor:null},{name:"Gzip",extension:"gz",mime:"application/gzip",description:"",signature:{0:31,1:139,2:8},extractor:function(e,t){var r=new oe(e.slice(t));r.moveForwardsBy(3);var n=r.readInt(1);if(r.moveForwardsBy(4),r.readInt(1),r.moveForwardsBy(1),4&n){var i=r.readInt(2,"le");r.moveForwardsby(i)}return 8&n&&(r.continueUntil(0),r.moveForwardsBy(1)),16&n&&(r.continueUntil(0),r.moveForwardsBy(1)),2&n&&r.moveForwardsBy(2),me(r),r.moveForwardsBy(8),r.carve()}},{name:"Bzip2",extension:"bz2",mime:"application/x-bzip2",description:"",signature:{0:66,1:90,2:104},extractor:function(e,t){for(var r=new oe(e.slice(t)),n=[[119,36,83,133,9],[238,72,167,10,18],[220,145,78,20,36],[185,34,156,40,72],[114,69,56,80,144],[187,146,41,194,132],[93,201,20,225,66],[46,228,138,112,161],[23,114,69,56,80]],i=0;i<n.length&&(r.continueUntil(n[i]),r.getBytes(5).join("")!==n[i].join(""));i++)r.moveTo(0);return r.moveForwardsBy(4),r.carve()}},{name:"7zip",extension:"7z",mime:"application/x-7z-compressed",description:"",signature:{0:55,1:122,2:188,3:175,4:39,5:28},extractor:null},{name:"Zlib Deflate",extension:"zlib",mime:"application/x-deflate",description:"",signature:{0:120,1:[1,156,218,94]},extractor:function(e,t){var r=new oe(e.slice(t));return r.moveForwardsBy(1),32&r.readInt(1)&&r.moveForwardsBy(4),me(r),r.moveForwardsBy(4),r.carve()}},{name:"xz compression",extension:"xz",mime:"application/x-xz",description:"",signature:{0:253,1:55,2:122,3:88,4:90,5:0},extractor:function(e,t){var r=new oe(e.slice(t));return r.continueUntil([0,0,0,0,4,89,90]),r.moveForwardsBy(7),r.carve()}},{name:"Tarball",extension:"tar.z",mime:"application/x-gtar",description:"",signature:{0:31,1:[157,160]},extractor:null},{name:"ISO disk image",extension:"iso",mime:"application/octet-stream",description:"ISO 9660 CD/DVD image file",signature:[{32769:67,32770:68,32771:48,32772:48,32773:49},{34817:67,34818:68,34819:48,34820:48,34821:49},{36865:67,36866:68,36867:48,36868:48,36869:49}],extractor:null},{name:"Virtual Machine Disk",extension:"vmdk",mime:"application/vmdk,application/x-virtualbox-vmdk",description:"",signature:{0:75,1:68,2:77,3:86,5:0,6:0,7:0},extractor:null},{name:"Virtual Hard Drive",extension:"vhd",mime:"application/x-vhd",description:"",signature:{0:99,1:111,2:110,3:101,4:99,5:116,6:105,7:120},extractor:null},{name:"Macintosh disk image",extension:"dmf,dmg",mime:"application/octet-stream",description:"",signature:{0:120,1:1,2:115,3:13,4:98,5:98,6:96,7:96},extractor:null},{name:"ARJ Archive",extension:"arj",mime:"application/x-arj-compressed",description:"",signature:{0:96,1:234,8:[0,16,20],9:0,10:2},extractor:null},{name:"WinAce Archive",extension:"ace",mime:"application/x-ace-compressed",description:"",signature:{7:42,8:42,9:65,10:67,11:69,12:42,13:42},extractor:null},{name:"Macintosh BinHex Encoded File",extension:"hqx",mime:"application/mac-binhex",description:"",signature:{11:109,12:117,13:115,14:116,15:32,16:98,17:101,18:32,19:99,20:111,21:110,22:118,23:101,24:114,25:116,26:101,27:100,28:32,29:119,30:105,31:116,32:104,33:32,34:66,35:105,36:110,37:72,38:101,39:120},extractor:null},{name:"ALZip Archive",extension:"alz",mime:"application/octet-stream",description:"",signature:{0:65,1:76,2:90,3:1,4:10,5:0,6:0,7:0},extractor:null},{name:"KGB Compressed Archive",extension:"kgb",mime:"application/x-kgb-compressed",description:"",signature:{0:75,1:71,2:66,3:95,4:97,5:114,6:99,7:104,8:32,9:45},extractor:null},{name:"Microsoft Cabinet",extension:"cab",mime:"vnd.ms-cab-compressed",description:"",signature:{0:77,1:83,2:67,3:70,4:0,5:0,6:0,7:0},extractor:null},{name:"Jar Archive",extension:"jar",mime:"application/java-archive",description:"",signature:{0:95,1:39,2:168,3:137},extractor:null},{name:"Jar Archive",extension:"jar",mime:"application/java-archive",description:"",signature:{0:80,1:75,2:3,3:4,4:20,5:0,6:8,7:0,8:8,9:0},extractor:he},{name:"lzop compressed",extension:"lzop,lzo",mime:"application/x-lzop",description:"",signature:{0:137,1:76,2:90,3:79,4:0,5:13,6:10,7:26},extractor:function(e,t){var r=new oe(e.slice(t)),n=0,i=0;r.moveForwardsBy(9);var a=r.readInt(2,"be");r.moveForwardsBy(6);var s=r.readInt(4,"be");2048&a&&r.moveForwardsBy(4),2&s&&n++,512&s&&n++,1&s&&i++,256&s&&i++,r.moveForwardsBy(8),a>=2368&&r.moveForwardsBy(4);var o=r.readInt(1,"be");if(r.moveForwardsBy(o),64&s){var c=r.readInt(4,"be");r.moveForwardsBy(c)}for(r.moveForwardsBy(4);r.hasMore();){var u=r.readInt(4,"be");if(0===u)break;var f=r.readInt(4,"be"),h=u===f?i:i+n;r.moveForwardsBy(f+4*h)}return r.carve()}},{name:"Linux deb package",extension:"deb",mime:"application/vnd.debian.binary-package",description:"",signature:{0:33,1:60,2:97,3:114,4:99,5:104,6:62},extractor:function(e,t){var r=new oe(e.slice(t));for(r.moveForwardsBy(8);r.hasMore();){r.moveForwardsBy(48);var n,i="",a=ce(r.getBytes(10));try{for(a.s();!(n=a.n()).done;){var s=n.value;i+=String.fromCharCode(s)}}catch(e){a.e(e)}finally{a.f()}i=parseInt(i.trim(),10),r.moveForwardsBy(2),r.moveForwardsBy(i)}return r.carve()}},{name:"Apple Disk Image",extension:"dmg",mime:"application/x-apple-diskimage",description:"",signature:{0:120,1:1,2:115,3:13,4:98,5:98,6:96},extractor:null}],Miscellaneous:[{name:"UTF-8 text",extension:"txt",mime:"text/plain",description:"UTF-8 encoded Unicode byte order mark, commonly but not exclusively seen in text files.",signature:{0:239,1:187,2:191},extractor:null},{name:"UTF-32 LE text",extension:"utf32le",mime:"charset/utf32le",description:"Little-endian UTF-32 encoded Unicode byte order mark.",signature:{0:255,1:254,2:0,3:0},extractor:null},{name:"UTF-16 LE text",extension:"utf16le",mime:"charset/utf16le",description:"Little-endian UTF-16 encoded Unicode byte order mark.",signature:{0:255,1:254},extractor:null},{name:"Web Open Font Format",extension:"woff",mime:"application/font-woff",description:"",signature:{0:119,1:79,2:70,3:70,4:0,5:1,6:0,7:0},extractor:null},{name:"Web Open Font Format 2",extension:"woff2",mime:"application/font-woff",description:"",signature:{0:119,1:79,2:70,3:50,4:0,5:1,6:0,7:0},extractor:null},{name:"Embedded OpenType font",extension:"eot",mime:"application/octet-stream",description:"",signature:[{8:2,9:0,10:1,34:76,35:80},{8:1,9:0,10:0,34:76,35:80},{8:2,9:0,10:2,34:76,35:80}],extractor:null},{name:"TrueType Font",extension:"ttf",mime:"application/font-sfnt",description:"",signature:{0:0,1:1,2:0,3:0,4:0},extractor:null},{name:"OpenType Font",extension:"otf",mime:"application/font-sfnt",description:"",signature:{0:79,1:84,2:84,3:79,4:0},extractor:null},{name:"SQLite",extension:"sqlite",mime:"application/x-sqlite3",description:"",signature:{0:83,1:81,2:76,3:105},extractor:function(e,t){var r=new oe(e.slice(t));r.moveTo(16);var n=r.readInt(2);r.moveTo(28);var i=r.readInt(4);return r.moveTo(n*i),r.carve()}},{name:"BitTorrent link",extension:"torrent",mime:"application/x-bittorrent",description:"",signature:[{0:100,1:56,2:58,3:97,4:110,5:110,6:111,7:117,8:110,9:99,10:101,11:35,12:35,13:58},{0:100,1:52,2:58,3:105,4:110,5:102,6:111,7:100,8:[52,53,54],9:58}],extractor:null},{name:"Cryptocurrency wallet",extension:"wallet",mime:"application/octet-stream",description:"",signature:{0:0,1:0,2:0,3:0,4:1,5:0,6:0,7:0,8:0,9:0,10:0,11:0,12:98,13:49,14:5,15:0},extractor:null},{name:"Registry fragment",extension:"hbin",mime:"application/octet-stream",description:"",signature:{0:104,1:98,2:105,3:110,4:0},extractor:null},{name:"Registry script",extension:"rgs",mime:"application/octet-stream",description:"",signature:{0:72,1:75,2:67,3:82,4:13,5:10,6:92,7:123},extractor:null},{name:"WinNT Registry Hive",extension:"registry",mime:"application/octet-stream",description:"",signature:{0:114,1:101,2:103,3:102},extractor:null},{name:"Windows Event Log",extension:"evt",mime:"application/octet-stream",description:"",signature:{0:48,1:0,2:0,3:0,4:76,5:102,6:76,7:101},extractor:function(e,t){var r=new oe(e.slice(t));r.moveTo(20);var n=r.readInt(4,"le");r.moveTo(n);var i=r.readInt(4,"le");return r.moveForwardsBy(i-4),r.carve()}},{name:"Windows Event Log",extension:"evtx",mime:"application/octet-stream",description:"",signature:{0:69,1:108,2:102,3:70,4:105,5:108,6:101},extractor:function(e,t){var r=new oe(e.slice(t));r.moveTo(40);var n=r.readInt(4,"le")-44;for(r.moveForwardsBy(n);r.hasMore()&&r.getBytes(7).join("")===[69,108,102,67,104,110,107].join("");)r.moveForwardsBy(65529);return r.consumeWhile(0),r.carve()}},{name:"Windows Pagedump",extension:"dmp",mime:"application/octet-stream",description:"",signature:{0:80,1:65,2:71,3:69,4:68,5:85,6:[77,54],7:[80,52]},extractor:function(e,t){var r=new oe(e.slice(t));return r.moveTo(112),r.moveTo(4096*(r.readInt(4,"le")+1)),r.carve()}},{name:"Windows Prefetch",extension:"pf",mime:"application/x-pf",description:"",signature:{0:[17,23,26],1:0,2:0,3:0,4:83,5:67,6:67,7:65},extractor:function(e,t){var r=new oe(e.slice(t));return r.moveTo(12),r.moveTo(r.readInt(4,"be")),r.carve()}},{name:"Windows Prefetch (Win 10)",extension:"pf",mime:"application/x-pf",description:"",signature:{0:77,1:65,2:77,3:4,7:0},extractor:function(e,t){var r=new oe(e.slice(t));return r.moveTo(r.readInt(4,"be")),r.carve()}},{name:"PList (XML)",extension:"plist",mime:"application/xml",description:"",signature:{39:60,40:33,41:68,42:79,43:67,44:84,45:89,46:80,47:69,48:32,49:112,50:108,51:105,52:115,53:116},extractor:function(e,t){var r=new oe(e.slice(t)),n=0;for(r.continueUntil([60,112,108,105,115,116]),r.moveForwardsBy(6),n++;n>0&&r.hasMore();)60===r.readInt(1)&&(r.getBytes(5).join("")===[112,108,105,115,116].join("")?n++:r.moveBackwardsBy(5),r.getBytes(7).join("")===[47,112,108,105,115,116,62].join("")?n--:r.moveBackwardsBy(7));return r.consumeIf(10),r.carve()}},{name:"PList (binary)",extension:"bplist,plist,ipmeta,abcdp,mdbackup,mdinfo,strings,nib,ichat,qtz,webbookmark,webhistory",mime:"application/x-plist",description:"",signature:{0:98,1:112,2:108,3:105,4:115,5:116,6:48,7:48},extractor:null},{name:"MacOS X Keychain",extension:"keychain",mime:"application/octet-stream",description:"",signature:{0:107,1:121,2:99,3:104,4:0,5:1},extractor:function(e,t){var r=new oe(e.slice(t));return r.moveTo(20),r.moveForwardsBy(r.readInt(4)),r.carve()}},{name:"TCP Packet",extension:"tcp",mime:"application/tcp",description:"",signature:{12:8,13:0,14:69,15:0,21:0,22:function(e){return e>=1&&e<=128},23:6},extractor:null},{name:"UDP Packet",extension:"udp",mime:"application/udp",description:"",signature:{12:8,13:0,14:69,15:0,16:[0,1,2,3,4,5],22:function(e){return e>=1&&e<=128},23:17},extractor:null},{name:"Compiled HTML",extension:"chm,chw,chi",mime:"application/vnd.ms-htmlhelp",description:"",signature:{0:73,1:84,2:83,3:70,4:3,5:0,6:0,7:0},extractor:null},{name:"Windows Password",extension:"pwl",mime:"application/octet-stream",description:"",signature:{0:227,1:130,2:133,3:150},extractor:null},{name:"Bitlocker recovery key",extension:"bitlocker",mime:"application/octet-stream",description:"",signature:{0:255,1:254,2:66,3:0,4:105,5:0,6:116,7:0,8:76,9:0,10:111,11:0,12:99,13:0,14:107,15:0,16:101,17:0,18:114,19:0,20:32,21:0},extractor:null},{name:"Certificate",extension:"cer,cat,p7b,p7c,p7m,p7s,swz,rsa,crl,crt,der",mime:"application/pkix-cert",description:"",signature:{0:48,1:130,4:[6,10,48]},extractor:null},{name:"Certificate",extension:"cat,swz,p7m",mime:"application/vnd.ms-pki.seccat",description:"",signature:{0:48,1:131,2:function(e){return 0!==e},5:6,6:9},extractor:null},{name:"PGP pubring",extension:"pkr,gpg",mime:"application/pgp-keys",description:"",signature:{0:153,1:1,2:[13,162],3:4},extractor:null},{name:"PGP secring",extension:"skr",mime:"application/pgp-keys",description:"",signature:[{0:149,1:1,2:207,3:4},{0:149,1:3,2:198,3:4},{0:149,1:5,2:134,3:4}],extractor:null},{name:"PGP Safe",extension:"pgd",mime:"application/pgp-keys",description:"",signature:{0:80,1:71,2:80,3:100,4:77,5:65,6:73,7:78,8:96,9:1,10:0},extractor:null},{name:"Task Scheduler",extension:"job",mime:"application/octet-stream",description:"",signature:{0:[0,1,2,3],1:[5,6],2:1,3:0,20:70,21:0},extractor:null},{name:"Windows Shortcut",extension:"lnk",mime:"application/x-ms-shortcut",description:"",signature:{0:76,1:0,2:0,3:0,4:1,5:20,6:2,7:0,8:0,9:0,10:0,11:0,12:192,13:0,14:0,15:0,16:0,17:0,18:0,19:70},extractor:function(e,t){var r=new oe(e.slice(t));return r.moveTo(52),r.moveTo(r.readInt(4,"le")),r.carve()}},{name:"Bash",extension:"bash",mime:"application/bash",description:"",signature:{0:35,1:33,2:47,3:98,4:105,5:110,6:47,7:98,8:97,9:115,10:104},extractor:null},{name:"Shell",extension:"sh",mime:"application/sh",description:"",signature:{0:35,1:33,2:47,3:98,4:105,5:110,6:47,7:115,8:104},extractor:null},{name:"Python",extension:"py,pyc,pyd,pyo,pyw,pyz",mime:"application/python",description:"",signature:{0:35,1:33,2:47,3:117,4:115,5:114,6:47,7:98,8:105,9:110,10:47,11:112,12:121,13:116,14:104,15:111,16:110,17:[50,51,10,13]},extractor:null},{name:"Ruby",extension:"rb",mime:"application/ruby",description:"",signature:{0:35,1:33,2:47,3:117,4:115,5:114,6:47,7:98,8:105,9:110,10:47,11:114,12:117,13:98,14:121},extractor:null},{name:"perl",extension:"pl,pm,t,pod",mime:"application/perl",description:"",signature:{0:35,1:33,2:47,3:117,4:115,5:114,6:47,7:98,8:105,9:110,10:47,11:112,12:101,13:114,14:108},extractor:null},{name:"php",extension:"php,phtml,php3,php4,php5,php7,phps,php-s,pht,phar",mime:"application/php",description:"",signature:{0:60,1:63,2:112,3:104,4:112},extractor:null},{name:"Smile",extension:"sml",mime:"\tapplication/x-jackson-smile",description:"",signature:{0:58,1:41,2:10},extractor:null},{name:"Lua Bytecode",extension:"luac",mime:"application/x-lua",description:"",signature:{0:27,1:76,2:117,3:97},extractor:null},{name:"WebAssembly binary",extension:"wasm",mime:"application/octet-stream",description:"",signature:{0:0,1:97,2:115,3:109},extractor:null}]};function he(e,t){var r=new oe(e.slice(t));r.continueUntil([80,75,5,6]),r.moveForwardsBy(20);var n=r.readInt(2,"le");return r.moveForwardsBy(n),r.carve()}function le(e,t){var r="207250237254",n=new oe(e.slice(t)),i=n.getBytes(4).join("");return n.moveTo(function(e,t,r){var n=28;t&&(n+=4),e.moveTo(16);var i=e.readInt(4,r);return function(e,t,r,n){for(var i=0,a=0;a<n;a++){e.moveTo(t);var s=e.readInt(4,r);25===s?(e.moveTo(t+48),i+=e.readInt(8,r),e.moveTo(t+4),t+=e.readInt(4,r)):1===s&&(e.moveTo(t+36),i+=e.readInt(4,r),e.moveTo(t+4),t+=e.readInt(4,r))}return i}(e,n,r,i)}(n,function(e){return e===r||"254237250207"===e}(i),function(e){return"206250237254"===e||e===r}(i)?"le":"be")),n.carve()}for(var de=new Array(288),pe=0;pe<de.length;pe++)de[pe]=pe<=143?8:pe<=255?9:pe<=279?7:8;var ge=Ee(de),ye=Ee(new Array(30).fill(5)),ve=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];function me(e){for(var t=0;!t;){t=e.readBits(1,"le");var r=e.readBits(2,"le");if(0===r){e.moveForwardsBy(1);var n=e.readInt(2,"le");e.moveForwardsBy(2+n)}else if(1===r)Se(e,ge,ye);else{if(2!==r)throw new Error(`Invalid block type while parsing DEFLATE stream at pos ${e.position}`);for(var i=e.readBits(5,"le")+257,a=e.readBits(5,"le")+1,s=e.readBits(4,"le")+4,o=new Uint8Array(ve.length),c=0;c<s;c++)o[ve[c]]=e.readBits(3,"le");for(var u=Ee(o),f=new Uint8Array(i+a),h=void 0,l=void 0,d=void 0,p=0;p<i+a;)switch(h=Ce(e,u)){case 16:for(l=3+e.readBits(2,"le");l--;)f[p++]=d;break;case 17:for(l=3+e.readBits(3,"le");l--;)f[p++]=0;d=0;break;case 18:for(l=11+e.readBits(7,"le");l--;)f[p++]=0;d=0;break;default:f[p++]=h,d=h}Se(e,Ee(f.subarray(0,i)),Ee(f.subarray(i)))}}e.bitPos>0&&e.moveForwardsBy(1)}var be=[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,0,0],we=[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];function Se(e,t,r){for(var n,i=0;(n=Ce(e,t))&&256!==n;){if(++i>1e4)throw new Error("Caught in probable infinite loop while parsing Huffman Block");n<256||(e.readBits(be[n-257],"le"),n=Ce(e,r),e.readBits(we[n],"le"))}}function Ee(e){for(var t=Math.max.apply(Math,e),r=Math.min.apply(Math,e),n=1<<t,i=new Uint32Array(n),a=1,s=0,o=2;a<=t;){for(var c=0;c<e.length;c++)if(e[c]===a){var u=void 0,f=void 0,h=void 0;for(u=0,f=s,h=0;h<a;h++)u=u<<1|1&f,f>>=1;for(var l=a<<16|c,d=u;d<n;d+=o)i[d]=l;s++}a++,s<<=1,o<<=1}return[i,t,r]}function Ce(e,t){var r=se(t,2),n=r[0],i=r[1],a=n[e.readBits(i,"le")&(1<<i)-1],s=a>>>16;if(s>i)throw new Error(`Invalid Huffman Code length while parsing DEFLATE block at pos ${e.position}: ${s}`);return e.moveBackwardsByBits(i-s),65535&a}function Ae(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(e.length){for(var n=0;n<e.length;n++)if(Be(e[n],t,r))return!0;return!1}return Be(e,t,r)}function Be(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;for(var n in e){var i=parseInt(n,10)+r;switch(typeof e[n]){case"number":if(t[i]!==e[n])return!1;break;case"object":if(e[n].indexOf(t[i])<0)return!1;break;case"function":if(!e[n](t[i]))return!1;break;default:throw new Error(`Unrecognised signature type at offset ${n}`)}}return!0}const xe=function(){return i((function t(){e(this,t)}),null,[{key:"checkForValue",value:function(e){if(void 0===e)throw new Error("only use translation methods with .bind")}},{key:"toArrayBuffer",value:function(){throw new Error("toArrayBuffer has not been implemented")}},{key:"fromArrayBuffer",value:function(){throw new Error("fromArrayBuffer has not been implemented")}}])}();function Te(e,t,r){return t=s(t),a(e,Ie()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function Ie(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ie=function(){return!!e})()}const Fe=function(t){function r(){return e(this,r),Te(this,r,arguments)}return c(r,t),i(r,null,[{key:"toArrayBuffer",value:function(){r.checkForValue(this.value),this.value=new Uint8Array(this.value).buffer}},{key:"fromArrayBuffer",value:function(){r.checkForValue(this.value),this.value=Array.prototype.slice.call(new Uint8Array(this.value))}}])}(xe);function ke(e,t,r){return t=s(t),a(e,Re()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function Re(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Re=function(){return!!e})()}const De=function(t){function r(){return e(this,r),ke(this,r,arguments)}return c(r,t),i(r,null,[{key:"toArrayBuffer",value:function(){r.checkForValue(this.value),this.value=ae.isBigNumber(this.value)?O.strToArrayBuffer(this.value.toFixed()):new ArrayBuffer}},{key:"fromArrayBuffer",value:function(){r.checkForValue(this.value);try{this.value=new ae(O.arrayBufferToStr(this.value))}catch(e){this.value=new ae(NaN)}}}])}(xe);function _e(e,t,r){return t=s(t),a(e,Pe()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function Pe(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Pe=function(){return!!e})()}const Ne=function(t){function r(){return e(this,r),_e(this,r,arguments)}return c(r,t),i(r,null,[{key:"toArrayBuffer",value:function(){var e=this;if(r.checkForValue(this.value),!_())return new Promise((function(t,r){O.readFile(e.value).then((function(t){return e.value=t.buffer})).then(t).catch(r)}));this.value=O.readFileSync(this.value)}},{key:"fromArrayBuffer",value:function(){r.checkForValue(this.value),this.value=new File(this.value,"unknown")}}])}(xe);function Oe(e,t,r){return t=s(t),a(e,Le()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function Le(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Le=function(){return!!e})()}const Ue=function(t){function r(){return e(this,r),Oe(this,r,arguments)}return c(r,t),i(r,null,[{key:"toArrayBuffer",value:function(){r.checkForValue(this.value),this.value=this.value?O.strToArrayBuffer(this.value):new ArrayBuffer}},{key:"fromArrayBuffer",value:function(){r.checkForValue(this.value),this.value=this.value?O.arrayBufferToStr(this.value):""}}])}(xe);function Ke(e,t,r){return t=s(t),a(e,Me()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function Me(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Me=function(){return!!e})()}const He=function(t){function r(){return e(this,r),Ke(this,r,arguments)}return c(r,t),i(r,null,[{key:"toArrayBuffer",value:function(){r.checkForValue(this.value),this.value=this.value?O.strToArrayBuffer(O.unescapeHtml(O.stripHtmlTags(this.value,!0))):new ArrayBuffer}}])}(Ue);function je(e,t,r){return t=s(t),a(e,Ve()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function Ve(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ve=function(){return!!e})()}const Ge=function(t){function r(){return e(this,r),je(this,r,arguments)}return c(r,t),i(r,null,[{key:"toArrayBuffer",value:function(){r.checkForValue(this.value),this.value=void 0!==this.value?O.strToArrayBuffer(JSON.stringify(this.value,null,4)):new ArrayBuffer}},{key:"fromArrayBuffer",value:function(){r.checkForValue(this.value),this.value=JSON.parse(O.arrayBufferToStr(this.value))}}])}(xe);function qe(e,t,r){return t=s(t),a(e,ze()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function ze(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ze=function(){return!!e})()}const We=function(t){function r(){return e(this,r),qe(this,r,arguments)}return c(r,t),i(r,null,[{key:"toArrayBuffer",value:(a=f(l().mark((function e(){return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r.checkForValue(this.value),!_()){e.next=5;break}this.value=this.value.map((function(e){return Uint8Array.from(e.data)})),e.next=8;break;case 5:return e.next=7,r.concatenateTypedArraysWithTypedElements.apply(r,g(this.value));case 7:this.value=e.sent;case 8:case"end":return e.stop()}}),e,this)}))),function(){return a.apply(this,arguments)})},{key:"fromArrayBuffer",value:function(){r.checkForValue(this.value),this.value=[new File(this.value,"unknown")]}},{key:"concatenateTypedArraysWithTypedElements",value:(n=f(l().mark((function e(){var t,r,n,i,a,s,o,c,u,f,h,d,p,g=arguments;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(t=0,r=g.length,n=new Array(r),i=0;i<r;i++)n[i]=g[i];for(a=0,s=n;a<s.length;a++)o=s[a],t+=o.size;c=new Uint8Array(t),u=0,f=0,h=n;case 6:if(!(f<h.length)){e.next=16;break}return d=h[f],e.next=10,O.readFile(d);case 10:p=e.sent,c.set(p,u),u+=p.length;case 13:f++,e.next=6;break;case 16:return e.abrupt("return",c);case 17:case"end":return e.stop()}}),e)}))),function(){return n.apply(this,arguments)})},{key:"concatenateTypedArrays",value:function(){for(var e=0,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];for(var i=0,a=r;i<a.length;i++)e+=a[i].length;for(var s=new Uint8Array(e),o=0,c=0,u=r;c<u.length;c++){var f=u[c];s.set(f,o),o+=f.length}return s}}]);var n,a}(xe);function Xe(e,t,r){return t=s(t),a(e,Ye()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function Ye(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ye=function(){return!!e})()}const Je=function(t){function r(){return e(this,r),Xe(this,r,arguments)}return c(r,t),i(r,null,[{key:"toArrayBuffer",value:function(){r.checkForValue(this.value),this.value="number"==typeof this.value?O.strToArrayBuffer(this.value.toString()):new ArrayBuffer}},{key:"fromArrayBuffer",value:function(){r.checkForValue(this.value),this.value=this.value?parseFloat(O.arrayBufferToStr(this.value)):0}}])}(xe);var Qe=function(){function t(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(e(this,t),this.value=new ArrayBuffer(0),this.type=t.ARRAY_BUFFER,r&&Object.prototype.hasOwnProperty.call(r,"value")&&Object.prototype.hasOwnProperty.call(r,"type"))this.set(r.value,r.type);else if(r&&null!==n)this.set(r,n);else if(r){var i=t.typeEnum(r.constructor.name);this.set(r,i)}}return i(t,[{key:"get",value:function(e){var r=this;return"string"==typeof e&&(e=t.typeEnum(e)),this.type!==e?_()?(this._translate(e),this.value):new Promise((function(t,n){r._translate(e).then((function(){t(r.value)})).catch(n)})):this.value}},{key:"set",value:function(e,r){if("string"==typeof r&&(r=t.typeEnum(r)),v().debug("Dish type: "+t.enumLookup(r)),this.value=e,this.type=r,!this.valid()){var n=O.truncate(JSON.stringify(this.value),25);throw new K(`Data is not a valid ${t.enumLookup(r)}: ${n}`)}}},{key:"presentAs",value:function(e){return this.clone().get(e)}},{key:"detectDishType",value:function(){var e=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object.keys(fe);if(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),!(e&&e.length>1))return[];var r=[],n={};for(var i in fe)t.includes(i)&&(n[i]=fe[i]);for(var a in n)n[a].forEach((function(t){Ae(t.signature,e)&&r.push(t)}));return r}(new Uint8Array(this.value.slice(0,2048)));return e.length&&e[0].mime&&"text/plain"===e[0].mime?e[0].mime:null}},{key:"getTitle",value:(r=f(l().mark((function e(r){var n,i;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n="",e.t0=this.type,e.next=e.t0===t.FILE?4:e.t0===t.LIST_FILE?6:e.t0===t.JSON?8:e.t0===t.NUMBER||e.t0===t.BIG_NUMBER?10:e.t0===t.ARRAY_BUFFER||e.t0===t.BYTE_ARRAY?12:15;break;case 4:return n=this.value.name,e.abrupt("break",26);case 6:return n=`${this.value.length} file(s)`,e.abrupt("break",26);case 8:return n="application/json",e.abrupt("break",26);case 10:return n=this.value.toString(),e.abrupt("break",26);case 12:if(null===(n=this.detectDishType())){e.next=15;break}return e.abrupt("break",26);case 15:return e.prev=15,(i=this.clone()).value=i.value.slice(0,256),e.next=20,i.get(t.STRING);case 20:n=e.sent,e.next=26;break;case 23:e.prev=23,e.t1=e.catch(15),v().error(`${t.enumLookup(this.type)} cannot be sliced. ${e.t1}`);case 26:return e.abrupt("return",n.slice(0,r));case 27:case"end":return e.stop()}}),e,this,[[15,23]])}))),function(e){return r.apply(this,arguments)})},{key:"valid",value:function(){switch(this.type){case t.BYTE_ARRAY:if(!(this.value instanceof Uint8Array||this.value instanceof Array))return!1;for(var e=0;e<this.value.length;e++)if("number"!=typeof this.value[e]||this.value[e]<0||this.value[e]>255)return!1;return!0;case t.STRING:case t.HTML:return"string"==typeof this.value;case t.NUMBER:return"number"==typeof this.value;case t.ARRAY_BUFFER:return this.value instanceof ArrayBuffer;case t.BIG_NUMBER:if(ae.isBigNumber(this.value))return!0;if(Object.keys(this.value).sort().equals(["c","e","s"])){var r=new ae;return r.c=this.value.c,r.e=this.value.e,r.s=this.value.s,this.value=r,!0}return!1;case t.JSON:return!0;case t.FILE:return this.value instanceof File;case t.LIST_FILE:return this.value instanceof Array&&this.value.reduce((function(e,t){return e&&t instanceof File}),!0);default:return!1}}},{key:"size",get:function(){switch(this.type){case t.BYTE_ARRAY:case t.STRING:case t.HTML:return this.value.length;case t.NUMBER:case t.BIG_NUMBER:return this.value.toString().length;case t.ARRAY_BUFFER:return this.value.byteLength;case t.JSON:return JSON.stringify(this.value).length;case t.FILE:return this.value.size;case t.LIST_FILE:return this.value.reduce((function(e,t){return e+t.size}),0);default:return-1}}},{key:"clone",value:function(){var e=new t;switch(this.type){case t.STRING:case t.HTML:case t.NUMBER:case t.BIG_NUMBER:e.set(this.value,this.type);break;case t.BYTE_ARRAY:case t.JSON:e.set(JSON.parse(JSON.stringify(this.value)),this.type);break;case t.ARRAY_BUFFER:e.set(this.value.slice(0),this.type);break;case t.FILE:e.set(new File([this.value],this.value.name,{type:this.value.type,lastModified:this.value.lastModified}),this.type);break;case t.LIST_FILE:e.set(this.value.map((function(e){return new File([e],e.name,{type:e.type,lastModified:e.lastModified})})),this.type);break;default:throw new K("Cannot clone Dish, unknown type")}return e}},{key:"_translate",value:function(e){var r=this;if(v().debug(`Translating Dish from ${t.enumLookup(this.type)} to ${t.enumLookup(e)}`),!_())return new Promise((function(n,i){r._toArrayBuffer().then((function(){return r.type=t.ARRAY_BUFFER})).then((function(){r._fromArrayBuffer(e),n()})).catch(i)}));this._toArrayBuffer(),this.type=t.ARRAY_BUFFER,this._fromArrayBuffer(e)}},{key:"_toArrayBuffer",value:function(){var e=this,r={browser:{[t.STRING]:function(){return Promise.resolve(Ue.toArrayBuffer.bind(e)())},[t.NUMBER]:function(){return Promise.resolve(Je.toArrayBuffer.bind(e)())},[t.HTML]:function(){return Promise.resolve(He.toArrayBuffer.bind(e)())},[t.ARRAY_BUFFER]:function(){return Promise.resolve()},[t.BIG_NUMBER]:function(){return Promise.resolve(De.toArrayBuffer.bind(e)())},[t.JSON]:function(){return Promise.resolve(Ge.toArrayBuffer.bind(e)())},[t.FILE]:function(){return Ne.toArrayBuffer.bind(e)()},[t.LIST_FILE]:function(){return Promise.resolve(We.toArrayBuffer.bind(e)())},[t.BYTE_ARRAY]:function(){return Promise.resolve(Fe.toArrayBuffer.bind(e)())}},node:{[t.STRING]:function(){return Ue.toArrayBuffer.bind(e)()},[t.NUMBER]:function(){return Je.toArrayBuffer.bind(e)()},[t.HTML]:function(){return He.toArrayBuffer.bind(e)()},[t.ARRAY_BUFFER]:function(){},[t.BIG_NUMBER]:function(){return De.toArrayBuffer.bind(e)()},[t.JSON]:function(){return Ge.toArrayBuffer.bind(e)()},[t.FILE]:function(){return Ne.toArrayBuffer.bind(e)()},[t.LIST_FILE]:function(){return We.toArrayBuffer.bind(e)()},[t.BYTE_ARRAY]:function(){return Fe.toArrayBuffer.bind(e)()}}};try{return r[_()?"node":"browser"][this.type]()}catch(e){throw new K(`Error translating from ${t.enumLookup(this.type)} to ArrayBuffer: ${e}`)}}},{key:"_fromArrayBuffer",value:function(e){var r=this,n={[t.STRING]:function(){return Ue.fromArrayBuffer.bind(r)()},[t.NUMBER]:function(){return Je.fromArrayBuffer.bind(r)()},[t.HTML]:function(){return He.fromArrayBuffer.bind(r)()},[t.ARRAY_BUFFER]:function(){},[t.BIG_NUMBER]:function(){return De.fromArrayBuffer.bind(r)()},[t.JSON]:function(){return Ge.fromArrayBuffer.bind(r)()},[t.FILE]:function(){return Ne.fromArrayBuffer.bind(r)()},[t.LIST_FILE]:function(){return We.fromArrayBuffer.bind(r)()},[t.BYTE_ARRAY]:function(){return Fe.fromArrayBuffer.bind(r)()}};try{n[e](),this.type=e}catch(r){throw new K(`Error translating from ArrayBuffer to ${t.enumLookup(e)}: ${r}`)}}}],[{key:"typeEnum",value:function(e){switch(e.toLowerCase()){case"bytearray":case"byte array":return t.BYTE_ARRAY;case"string":return t.STRING;case"number":return t.NUMBER;case"html":return t.HTML;case"arraybuffer":case"array buffer":return t.ARRAY_BUFFER;case"bignumber":case"big number":return t.BIG_NUMBER;case"json":case"object":return t.JSON;case"file":return t.FILE;case"list<file>":return t.LIST_FILE;default:throw new K("Invalid data type string. No matching enum.")}}},{key:"enumLookup",value:function(e){switch(e){case t.BYTE_ARRAY:return"byteArray";case t.STRING:return"string";case t.NUMBER:return"number";case t.HTML:return"html";case t.ARRAY_BUFFER:return"ArrayBuffer";case t.BIG_NUMBER:return"BigNumber";case t.JSON:return"JSON";case t.FILE:return"File";case t.LIST_FILE:return"List<File>";default:throw new K("Invalid data type enum. No matching type.")}}}]);var r}();Qe.BYTE_ARRAY=0,Qe.STRING=1,Qe.NUMBER=2,Qe.HTML=3,Qe.ARRAY_BUFFER=4,Qe.BIG_NUMBER=5,Qe.JSON=6,Qe.FILE=7,Qe.LIST_FILE=8;const Ze=Qe,$e=function(){function t(r){e(this,t),this.name="",this.type="",this._value=null,this.disabled=!1,this.hint="",this.rows=0,this.toggleValues=[],this.target=null,this.defaultIndex=0,this.maxLength=null,this.min=null,this.max=null,this.step=1,r&&this._parseConfig(r)}return i(t,[{key:"_parseConfig",value:function(e){this.name=e.name,this.type=e.type,this.defaultValue=e.value,this.disabled=!!e.disabled,this.hint=e.hint||!1,this.rows=e.rows||!1,this.toggleValues=e.toggleValues,this.target=void 0!==e.target?e.target:null,this.defaultIndex=void 0!==e.defaultIndex?e.defaultIndex:0,this.maxLength=e.maxLength||null,this.min=e.min,this.max=e.max,this.step=e.step}},{key:"config",get:function(){return this._value}},{key:"value",get:function(){return this._value},set:function(e){this._value=t.prepare(e,this.type)}}],[{key:"prepare",value:function(e,t){var r;switch(t){case"binaryString":case"binaryShortString":case"editableOption":case"editableOptionShort":return O.parseEscapedChars(e);case"byteArray":return"string"==typeof e?T(e=e.replace(/\s+/g,"")):e;case"number":if(null===e)return e;if(r=parseFloat(e),isNaN(r))throw"Invalid ingredient value. Not a number: "+O.truncate(e.toString(),10);return r;default:return e}}}])}();var et=function(){return i((function t(){e(this,t),this._inputType=-1,this._outputType=-1,this._presentType=-1,this._breakpoint=!1,this._disabled=!1,this._flowControl=!1,this._manualBake=!1,this._ingList=[],this.name="",this.module="",this.description="",this.infoURL=null}),[{key:"run",value:function(e,t){return e}},{key:"highlight",value:function(e,t){return!1}},{key:"highlightReverse",value:function(e,t){return!1}},{key:"present",value:function(e,t){return e}},{key:"inputType",get:function(){return Ze.enumLookup(this._inputType)},set:function(e){this._inputType=Ze.typeEnum(e)}},{key:"outputType",get:function(){return Ze.enumLookup(this._outputType)},set:function(e){this._outputType=Ze.typeEnum(e),this._presentType<0&&(this._presentType=this._outputType)}},{key:"presentType",get:function(){return Ze.enumLookup(this._presentType)},set:function(e){this._presentType=Ze.typeEnum(e)}},{key:"args",get:function(){return this._ingList.map((function(e){var t={name:e.name,type:e.type,value:e.defaultValue};return e.toggleValues&&(t.toggleValues=e.toggleValues),e.hint&&(t.hint=e.hint),e.rows&&(t.rows=e.rows),e.disabled&&(t.disabled=e.disabled),e.target&&(t.target=e.target),e.defaultIndex&&(t.defaultIndex=e.defaultIndex),e.maxLength&&(t.maxLength=e.maxLength),"number"==typeof e.min&&(t.min=e.min),"number"==typeof e.max&&(t.max=e.max),e.step&&(t.step=e.step),t}))},set:function(e){var t=this;e.forEach((function(e){var r=new $e(e);t.addIngredient(r)}))}},{key:"config",get:function(){return{op:this.name,args:this._ingList.map((function(e){return e.config}))}}},{key:"addIngredient",value:function(e){this._ingList.push(e)}},{key:"ingValues",get:function(){return this._ingList.map((function(e){return e.value}))},set:function(e){var t=this;e.forEach((function(e,r){t._ingList[r].value=e}))}},{key:"breakpoint",get:function(){return this._breakpoint},set:function(e){this._breakpoint=!!e}},{key:"disabled",get:function(){return this._disabled},set:function(e){this._disabled=!!e}},{key:"flowControl",get:function(){return this._flowControl},set:function(e){this._flowControl=!!e}},{key:"manualBake",get:function(){return this._manualBake},set:function(e){this._manualBake=!!e}}])}();const tt=et;var rt=["Space","Comma","Semi-colon","Colon","Line feed","CRLF"];function nt(e,t,r){return t=s(t),a(e,it()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function it(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(it=function(){return!!e})()}var at=function(t){function r(){var t;return e(this,r),(t=nt(this,r)).name="A1Z26 Cipher Decode",t.module="Ciphers",t.description="Converts alphabet order numbers into their corresponding alphabet character.<br><br>e.g. <code>1</code> becomes <code>a</code> and <code>2</code> becomes <code>b</code>.",t.infoURL="",t.inputType="string",t.outputType="string",t.args=[{name:"Delimiter",type:"option",value:rt}],t.checks=[{pattern:"^\\s*([12]?[0-9] )+[12]?[0-9]\\s*$",flags:"",args:["Space"]},{pattern:"^\\s*([12]?[0-9],)+[12]?[0-9]\\s*$",flags:"",args:["Comma"]},{pattern:"^\\s*([12]?[0-9];)+[12]?[0-9]\\s*$",flags:"",args:["Semi-colon"]},{pattern:"^\\s*([12]?[0-9]:)+[12]?[0-9]\\s*$",flags:"",args:["Colon"]},{pattern:"^\\s*([12]?[0-9]\\n)+[12]?[0-9]\\s*$",flags:"",args:["Line feed"]},{pattern:"^\\s*([12]?[0-9]\\r\\n)+[12]?[0-9]\\s*$",flags:"",args:["CRLF"]}],t}return c(r,t),i(r,[{key:"run",value:function(e,t){var r=O.charRep(t[0]||"Space");if(0===e.length)return[];for(var n=e.split(r),i="",a=0;a<n.length;a++){if(n[a]<1||n[a]>26)throw new E("Error: all numbers must be between 1 and 26.");i+=O.chr(parseInt(n[a],10)+96)}return i}}])}(tt);const st=at;function ot(e,t,r){return t=s(t),a(e,ct()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function ct(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ct=function(){return!!e})()}var ut=function(t){function r(){var t;return e(this,r),(t=ot(this,r)).name="A1Z26 Cipher Encode",t.module="Ciphers",t.description="Converts alphabet characters into their corresponding alphabet order number.<br><br>e.g. <code>a</code> becomes <code>1</code> and <code>b</code> becomes <code>2</code>.<br><br>Non-alphabet characters are dropped.",t.infoURL="",t.inputType="string",t.outputType="string",t.args=[{name:"Delimiter",type:"option",value:rt}],t}return c(r,t),i(r,[{key:"run",value:function(e,t){for(var r=O.charRep(t[0]||"Space"),n="",i=e.toLowerCase(),a=O.strToCharcode(i),s=0;s<a.length;s++){var o=a[s]-96;o>0&&o<=26&&(n+=o.toString(10)+r)}return n.slice(0,-r.length)}}])}(tt);const ft=ut;var ht=__webpack_require__(88802),lt=__webpack_require__.n(ht);function dt(e,t,r){return t=s(t),a(e,pt()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function pt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(pt=function(){return!!e})()}const gt=function(t){function r(){var t;return e(this,r),(t=dt(this,r)).name="AES Decrypt",t.module="Ciphers",t.description="Advanced Encryption Standard (AES) is a U.S. Federal Information Processing Standard (FIPS). It was selected after a 5-year process where 15 competing designs were evaluated.<br><br><b>Key:</b> The following algorithms will be used based on the size of the key:<ul><li>16 bytes = AES-128</li><li>24 bytes = AES-192</li><li>32 bytes = AES-256</li></ul><br><br><b>IV:</b> The Initialization Vector should be 16 bytes long. If not entered, it will default to 16 null bytes.<br><br><b>Padding:</b> In CBC and ECB mode, PKCS#7 padding will be used as a default.<br><br><b>GCM Tag:</b> This field is ignored unless 'GCM' mode is used.",t.infoURL="https://wikipedia.org/wiki/Advanced_Encryption_Standard",t.inputType="string",t.outputType="string",t.args=[{name:"Key",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]},{name:"IV",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]},{name:"Mode",type:"argSelector",value:[{name:"CBC",off:[5,6]},{name:"CFB",off:[5,6]},{name:"OFB",off:[5,6]},{name:"CTR",off:[5,6]},{name:"GCM",on:[5,6]},{name:"ECB",off:[5,6]},{name:"CBC/NoPadding",off:[5,6]},{name:"ECB/NoPadding",off:[5,6]}]},{name:"Input",type:"option",value:["Hex","Raw"]},{name:"Output",type:"option",value:["Raw","Hex"]},{name:"GCM Tag",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]},{name:"Additional Authenticated Data",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]}],t}return c(r,t),i(r,[{key:"run",value:function(e,t){var r=O.convertToByteString(t[0].string,t[0].option),n=O.convertToByteString(t[1].string,t[1].option),i=t[2].substring(0,3),a=t[2].endsWith("NoPadding"),s=t[3],o=t[4],c=O.convertToByteString(t[5].string,t[5].option),u=O.convertToByteString(t[6].string,t[6].option);if([16,24,32].indexOf(r.length)<0)throw new E(`Invalid key length: ${r.length} bytes\n\nThe following algorithms will be used based on the size of the key:\n 16 bytes = AES-128\n 24 bytes = AES-192\n 32 bytes = AES-256`);e=O.convertToByteString(e,s);var f=lt().cipher.createDecipher("AES-"+i,r);if(a&&(f.mode.unpad=function(e,t){return!0}),f.start({iv:0===n.length?"":n,tag:"GCM"===i?c:void 0,additionalData:"GCM"===i?u:void 0}),f.update(lt().util.createBuffer(e)),f.finish())return"Hex"===o?f.output.toHex():f.output.getBytes();throw new E("Unable to decrypt input with these parameters.")}}])}(tt);function yt(e,t,r){return t=s(t),a(e,vt()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function vt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(vt=function(){return!!e})()}const mt=function(t){function r(){var t;return e(this,r),(t=yt(this,r)).name="AES Encrypt",t.module="Ciphers",t.description="Advanced Encryption Standard (AES) is a U.S. Federal Information Processing Standard (FIPS). It was selected after a 5-year process where 15 competing designs were evaluated.<br><br><b>Key:</b> The following algorithms will be used based on the size of the key:<ul><li>16 bytes = AES-128</li><li>24 bytes = AES-192</li><li>32 bytes = AES-256</li></ul>You can generate a password-based key using one of the KDF operations.<br><br><b>IV:</b> The Initialization Vector should be 16 bytes long. If not entered, it will default to 16 null bytes.<br><br><b>Padding:</b> In CBC and ECB mode, PKCS#7 padding will be used.",t.infoURL="https://wikipedia.org/wiki/Advanced_Encryption_Standard",t.inputType="string",t.outputType="string",t.args=[{name:"Key",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]},{name:"IV",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]},{name:"Mode",type:"argSelector",value:[{name:"CBC",off:[5]},{name:"CFB",off:[5]},{name:"OFB",off:[5]},{name:"CTR",off:[5]},{name:"GCM",on:[5]},{name:"ECB",off:[5]}]},{name:"Input",type:"option",value:["Raw","Hex"]},{name:"Output",type:"option",value:["Hex","Raw"]},{name:"Additional Authenticated Data",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]}],t}return c(r,t),i(r,[{key:"run",value:function(e,t){var r=O.convertToByteString(t[0].string,t[0].option),n=O.convertToByteString(t[1].string,t[1].option),i=t[2],a=t[3],s=t[4],o=O.convertToByteString(t[5].string,t[5].option);if([16,24,32].indexOf(r.length)<0)throw new E(`Invalid key length: ${r.length} bytes\n\nThe following algorithms will be used based on the size of the key:\n 16 bytes = AES-128\n 24 bytes = AES-192\n 32 bytes = AES-256`);e=O.convertToByteString(e,a);var c=lt().cipher.createCipher("AES-"+i,r);return c.start({iv:n,additionalData:"GCM"===i?o:void 0}),c.update(lt().util.createBuffer(e)),c.finish(),"Hex"===s?"GCM"===i?c.output.toHex()+"\n\nTag: "+c.mode.tag.toHex():c.output.toHex():"GCM"===i?c.output.getBytes()+"\n\nTag: "+c.mode.tag.getBytes():c.output.getBytes()}}])}(tt);function bt(e,t,r){return t=s(t),a(e,wt()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function wt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(wt=function(){return!!e})()}var St=function(t){function r(){var t;return e(this,r),(t=bt(this,r)).name="AES Key Unwrap",t.module="Ciphers",t.description="Decryptor for a key wrapping algorithm defined in RFC3394, which is used to protect keys in untrusted storage or communications, using AES.<br><br>This algorithm uses an AES key (KEK: key-encryption key) and a 64-bit IV to decrypt 64-bit blocks.",t.infoURL="https://wikipedia.org/wiki/Key_wrap",t.inputType="string",t.outputType="string",t.args=[{name:"Key (KEK)",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]},{name:"IV",type:"toggleString",value:"a6a6a6a6a6a6a6a6",toggleValues:["Hex","UTF8","Latin1","Base64"]},{name:"Input",type:"option",value:["Hex","Raw"]},{name:"Output",type:"option",value:["Hex","Raw"]}],t}return c(r,t),i(r,[{key:"run",value:function(e,t){var r=O.convertToByteString(t[0].string,t[0].option),n=O.convertToByteString(t[1].string,t[1].option),i=t[2],a=t[3];if(16!==r.length&&24!==r.length&&32!==r.length)throw new E("KEK must be either 16, 24, or 32 bytes (currently "+r.length+" bytes)");if(8!==n.length)throw new E("IV must be 8 bytes (currently "+n.length+" bytes)");var s=O.convertToByteString(e,i);if(s.length%8!=0||s.length<24)throw new E("input must be 8n (n>=3) bytes (currently "+s.length+" bytes)");var o=lt().cipher.createCipher("AES-ECB",r);o.start(),o.update(lt().util.createBuffer("")),o.finish();for(var c=o.output.getBytes(),u=lt().cipher.createDecipher("AES-ECB",r),f=s.substring(0,8),h=[],l=8;l<s.length;l+=8)h.push(s.substring(l,l+8));var d=h.length>>>0,p=h.length/(4*(1<<30))>>>0;p=6*p+(6*d/(4*(1<<30))>>>0),d=6*d>>>0;for(var g=5;g>=0;g--)for(var y=h.length-1;y>=0;y--){var v=O.strToArrayBuffer(f),m=new DataView(v);m.setUint32(0,m.getUint32(0)^p),m.setUint32(4,m.getUint32(4)^d),f=O.arrayBufferToStr(v,!1),u.start(),u.update(lt().util.createBuffer(f+h[y]+c)),u.finish();var b=u.output.getBytes();f=b.substring(0,8),h[y]=b.substring(8,16),--d<0&&(p--,d=4294967295)}if(f!==n)throw new E("IV mismatch");var w=h.join("");return"Hex"===a?x(O.strToArrayBuffer(w)):w}}])}(tt);const Et=St;function Ct(e,t,r){return t=s(t),a(e,At()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function At(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(At=function(){return!!e})()}var Bt=function(t){function r(){var t;return e(this,r),(t=Ct(this,r)).name="AES Key Wrap",t.module="Ciphers",t.description="A key wrapping algorithm defined in RFC3394, which is used to protect keys in untrusted storage or communications, using AES.<br><br>This algorithm uses an AES key (KEK: key-encryption key) and a 64-bit IV to encrypt 64-bit blocks.",t.infoURL="https://wikipedia.org/wiki/Key_wrap",t.inputType="string",t.outputType="string",t.args=[{name:"Key (KEK)",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]},{name:"IV",type:"toggleString",value:"a6a6a6a6a6a6a6a6",toggleValues:["Hex","UTF8","Latin1","Base64"]},{name:"Input",type:"option",value:["Hex","Raw"]},{name:"Output",type:"option",value:["Hex","Raw"]}],t}return c(r,t),i(r,[{key:"run",value:function(e,t){var r=O.convertToByteString(t[0].string,t[0].option),n=O.convertToByteString(t[1].string,t[1].option),i=t[2],a=t[3];if(16!==r.length&&24!==r.length&&32!==r.length)throw new E("KEK must be either 16, 24, or 32 bytes (currently "+r.length+" bytes)");if(8!==n.length)throw new E("IV must be 8 bytes (currently "+n.length+" bytes)");var s=O.convertToByteString(e,i);if(s.length%8!=0||s.length<16)throw new E("input must be 8n (n>=2) bytes (currently "+s.length+" bytes)");for(var o=lt().cipher.createCipher("AES-ECB",r),c=n,u=[],f=0;f<s.length;f+=8)u.push(s.substring(f,f+8));for(var h=1,l=0,d=0;d<6;d++)for(var p=0;p<u.length;p++){o.start(),o.update(lt().util.createBuffer(c+u[p])),o.finish();var g=o.output.getBytes(),y=O.strToArrayBuffer(g.substring(0,8)),v=new DataView(y);v.setUint32(0,v.getUint32(0)^l),v.setUint32(4,v.getUint32(4)^h),c=O.arrayBufferToStr(y,!1),u[p]=g.substring(8,16),++h>4294967295&&(l++,h=0)}var m=c+u.join("");return"Hex"===a?x(O.strToArrayBuffer(m)):m}}])}(tt);const xt=Bt;function Tt(e,t,r){return t=s(t),a(e,It()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function It(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(It=function(){return!!e})()}var Ft=function(t){function r(){var t;return e(this,r),(t=Tt(this,r)).name="Affine Cipher Decode",t.module="Ciphers",t.description="The Affine cipher is a type of monoalphabetic substitution cipher. To decrypt, each letter in an alphabet is mapped to its numeric equivalent, decrypted by a mathematical function, and converted back to a letter.",t.infoURL="https://wikipedia.org/wiki/Affine_cipher",t.inputType="string",t.outputType="string",t.args=[{name:"a",type:"number",value:1},{name:"b",type:"number",value:0}],t}return c(r,t),i(r,[{key:"run",value:function(e,t){var r="abcdefghijklmnopqrstuvwxyz",n=se(t,2),i=n[0],a=n[1],s=O.modInv(i,26),o="";if(!/^\+?(0|[1-9]\d*)$/.test(i)||!/^\+?(0|[1-9]\d*)$/.test(a))throw new E("The values of a and b can only be integers.");if(1!==O.gcd(i,26))throw new E("The value of `a` must be coprime to 26.");for(var c=0;c<e.length;c++)r.indexOf(e[c])>=0?o+=r[O.mod((r.indexOf(e[c])-a)*s,26)]:r.indexOf(e[c].toLowerCase())>=0?o+=r[O.mod((r.indexOf(e[c].toLowerCase())-a)*s,26)].toUpperCase():o+=e[c];return o}},{key:"highlight",value:function(e,t){return e}},{key:"highlightReverse",value:function(e,t){return e}}])}(tt);const kt=Ft;var Rt=__webpack_require__(21396),Dt=__webpack_require__.n(Rt);function _t(e,t){var r="abcdefghijklmnopqrstuvwxyz",n=t[0],i=t[1],a="";if(!/^\+?(0|[1-9]\d*)$/.test(n)||!/^\+?(0|[1-9]\d*)$/.test(i))throw new E("The values of a and b can only be integers.");if(1!==O.gcd(n,26))throw new E("The value of `a` must be coprime to 26.");for(var s=0;s<e.length;s++)r.indexOf(e[s])>=0?a+=r[(n*r.indexOf(e[s])+i)%26]:r.indexOf(e[s].toLowerCase())>=0?a+=r[(n*r.indexOf(e[s].toLowerCase())+i)%26].toUpperCase():a+=e[s];return a}function Pt(e){for(var t=`${e}ABCDEFGHIKLMNOPQRSTUVWXYZ`.split("").unique(),r=[],n=0;n<5;n++)r[n]=t.slice(5*n,5*n+5);return r}var Nt={Hex:Dt().enc.Hex,Base64:Dt().enc.Base64,UTF8:Dt().enc.Utf8,UTF16:Dt().enc.Utf16,UTF16LE:Dt().enc.Utf16LE,UTF16BE:Dt().enc.Utf16BE,Latin1:Dt().enc.Latin1};function Ot(e,t,r){return t=s(t),a(e,Lt()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function Lt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Lt=function(){return!!e})()}const Ut=function(t){function r(){var t;return e(this,r),(t=Ot(this,r)).name="Affine Cipher Encode",t.module="Ciphers",t.description="The Affine cipher is a type of monoalphabetic substitution cipher, wherein each letter in an alphabet is mapped to its numeric equivalent, encrypted using simple mathematical function, <code>(ax + b) % 26</code>, and converted back to a letter.",t.infoURL="https://wikipedia.org/wiki/Affine_cipher",t.inputType="string",t.outputType="string",t.args=[{name:"a",type:"number",value:1},{name:"b",type:"number",value:0}],t}return c(r,t),i(r,[{key:"run",value:function(e,t){return _t(e,t)}},{key:"highlight",value:function(e,t){return e}},{key:"highlightReverse",value:function(e,t){return e}}])}(tt);function Kt(e,t,r){return t=s(t),a(e,Mt()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function Mt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Mt=function(){return!!e})()}const Ht=function(t){function r(){var t;return e(this,r),(t=Kt(this,r)).name="Atbash Cipher",t.module="Ciphers",t.description="Atbash is a mono-alphabetic substitution cipher originally used to encode the Hebrew alphabet. It has been modified here for use with the Latin alphabet.",t.infoURL="https://wikipedia.org/wiki/Atbash",t.inputType="string",t.outputType="string",t.args=[],t}return c(r,t),i(r,[{key:"run",value:function(e,t){return _t(e,[25,25])}},{key:"highlight",value:function(e,t){return e}},{key:"highlightReverse",value:function(e,t){return e}}])}(tt);function jt(e,t,r){return t=s(t),a(e,Vt()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function Vt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Vt=function(){return!!e})()}var Gt=function(t){function r(){var t;return e(this,r),(t=jt(this,r)).name="Bifid Cipher Decode",t.module="Ciphers",t.description="The Bifid cipher is a cipher which uses a Polybius square in conjunction with transposition, which can be fairly difficult to decipher without knowing the alphabet keyword.",t.infoURL="https://wikipedia.org/wiki/Bifid_cipher",t.inputType="string",t.outputType="string",t.args=[{name:"Keyword",type:"string",value:""}],t}return c(r,t),i(r,[{key:"run",value:function(e,t){var r=t[0].toUpperCase().replace("J","I"),n=r.split("").unique(),i="ABCDEFGHIKLMNOPQRSTUVWXYZ",a=[],s="",o=0,c="";if(!/^[A-Z]+$/.test(r)&&n.length>0)throw new E("The key must consist only of letters in the English alphabet");var u=Pt(r);return e.replace("J","I").split("").forEach((function(e){var t,r=i.split("").indexOf(e.toLocaleUpperCase())>=0;if(r){for(var n=0;n<5;n++)(t=u[n].indexOf(e.toLocaleUpperCase()))>=0&&(c+=`${n}${t}`);i.split("").indexOf(e)>=0?a.push(!0):r&&a.push(!1)}else a.push(e)})),a.forEach((function(e){if("boolean"==typeof e){var t=[c[o],c[o+c.length/2]];s+=e?u[t[0]][t[1]]:u[t[0]][t[1]].toLocaleLowerCase(),o++}else s+=e})),s}},{key:"highlight",value:function(e,t){return e}},{key:"highlightReverse",value:function(e,t){return e}}])}(tt);const qt=Gt;function zt(e,t,r){return t=s(t),a(e,Wt()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function Wt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Wt=function(){return!!e})()}var Xt=function(t){function r(){var t;return e(this,r),(t=zt(this,r)).name="Bifid Cipher Encode",t.module="Ciphers",t.description="The Bifid cipher is a cipher which uses a Polybius square in conjunction with transposition, which can be fairly difficult to decipher without knowing the alphabet keyword.",t.infoURL="https://wikipedia.org/wiki/Bifid_cipher",t.inputType="string",t.outputType="string",t.args=[{name:"Keyword",type:"string",value:""}],t}return c(r,t),i(r,[{key:"run",value:function(e,t){var r=t[0].toUpperCase().replace("J","I"),n=r.split("").unique(),i="ABCDEFGHIKLMNOPQRSTUVWXYZ",a=[],s=[],o=[],c="",u=0;if(!/^[A-Z]+$/.test(r)&&n.length>0)throw new E("The key must consist only of letters in the English alphabet");var f=Pt(r);e.replace("J","I").split("").forEach((function(e){var t,r=i.split("").indexOf(e.toLocaleUpperCase())>=0;if(r){for(var n=0;n<5;n++)(t=f[n].indexOf(e.toLocaleUpperCase()))>=0&&(a.push(t),s.push(n));i.split("").indexOf(e)>=0?o.push(!0):r&&o.push(!1)}else o.push(e)}));var h=`${s.join("")}${a.join("")}`;return o.forEach((function(e){if("boolean"==typeof e){var t=h.substr(2*u,2).split("");c+=e?f[t[0]][t[1]]:f[t[0]][t[1]].toLocaleLowerCase(),u++}else c+=e})),c}},{key:"highlight",value:function(e,t){return e}},{key:"highlightReverse",value:function(e,t){return e}}])}(tt);const Yt=Xt;var Jt={},Qt=function(e){return"string"==typeof e||e instanceof String},Zt=function(e,t,r,n){var i=0,a=e&&e.length||0,s=new(n||Array)(a);if(a&&"string"==typeof e&&(e=e.split("")),r)for(;i<a;++i)s[i]=t.call(r,e[i],i,e);else for(;i<a;++i)s[i]=t(e[i],i,e);return s},$t={p:[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731],s0:[3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946],s1:[1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055],s2:[3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504],s3:[976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462]},er=function(e,t){return(e>>16^t>>16)<<16|65535&(65535&e^65535&t)},tr=function(e,t){var r=t.s3[255&e];e>>=8;var n=t.s2[255&e];e>>=8;var i=t.s1[255&e];e>>=8;var a=t.s0[255&e],s=(a>>16)+(i>>16)+((65535&a)+(65535&i)>>16)<<16|(65535&a)+(65535&i)&65535;return((s=(s>>16^n>>16)<<16|65535&(65535&s^65535&n))>>16)+(r>>16)+((65535&s)+(65535&r)>>16)<<16|(65535&s)+(65535&r)&65535},rr=function(e,t){var r=e.left,n=e.right;r=er(r,t.p[0]),n=er(n,er(tr(r,t),t.p[1])),r=er(r,er(tr(n,t),t.p[2])),n=er(n,er(tr(r,t),t.p[3])),r=er(r,er(tr(n,t),t.p[4])),n=er(n,er(tr(r,t),t.p[5])),r=er(r,er(tr(n,t),t.p[6])),n=er(n,er(tr(r,t),t.p[7])),r=er(r,er(tr(n,t),t.p[8])),n=er(n,er(tr(r,t),t.p[9])),r=er(r,er(tr(n,t),t.p[10])),n=er(n,er(tr(r,t),t.p[11])),r=er(r,er(tr(n,t),t.p[12])),n=er(n,er(tr(r,t),t.p[13])),r=er(r,er(tr(n,t),t.p[14])),n=er(n,er(tr(r,t),t.p[15])),r=er(r,er(tr(n,t),t.p[16])),e.right=r,e.left=er(n,t.p[17])};Jt.Blowfish=new function(){this.createCipher=function(e,t){return new(lt().cipher.BlockCipher)({algorithm:new nr.Algorithm(e,t),key:e,decrypt:!1})},this.createDecipher=function(e,t){return new(lt().cipher.BlockCipher)({algorithm:new nr.Algorithm(e,t),key:e,decrypt:!0})}},Jt.Blowfish.Algorithm=function(e,t){this.initialize({key:e});var r=this.box,n={blockSize:8,cipher:{encrypt:function(e,t){!function(e,t,r){var n={};n.left=e[0],n.right=e[1],rr(n,r),t[0]=n.left,t[1]=n.right}(e,t,r)},decrypt:function(e,t){!function(e,t,r){var n={};n.left=e[0],n.right=e[1],function(e,t){var r=e.left,n=e.right;r=er(r,t.p[17]),n=er(n,er(tr(r,t),t.p[16])),r=er(r,er(tr(n,t),t.p[15])),n=er(n,er(tr(r,t),t.p[14])),r=er(r,er(tr(n,t),t.p[13])),n=er(n,er(tr(r,t),t.p[12])),r=er(r,er(tr(n,t),t.p[11])),n=er(n,er(tr(r,t),t.p[10])),r=er(r,er(tr(n,t),t.p[9])),n=er(n,er(tr(r,t),t.p[8])),r=er(r,er(tr(n,t),t.p[7])),n=er(n,er(tr(r,t),t.p[6])),r=er(r,er(tr(n,t),t.p[5])),n=er(n,er(tr(r,t),t.p[4])),r=er(r,er(tr(n,t),t.p[3])),n=er(n,er(tr(r,t),t.p[2])),r=er(r,er(tr(n,t),t.p[1])),e.right=r,e.left=er(n,t.p[0])}(n,r),t[0]=n.left,t[1]=n.right}(e,t,r)}}};switch(t.toLowerCase()){case"ecb":default:this.mode=new(lt().cipher.modes.ecb)(n);break;case"cbc":this.mode=new(lt().cipher.modes.cbc)(n);break;case"cfb":this.mode=new(lt().cipher.modes.cfb)(n);break;case"ofb":this.mode=new(lt().cipher.modes.ofb)(n);break;case"ctr":this.mode=new(lt().cipher.modes.ctr)(n)}},Jt.Blowfish.Algorithm.prototype.initialize=function(e){var t=Math.pow(2,8),r=e.key;Qt(r)&&(r=Zt(r.split(""),(function(e){return 255&e.charCodeAt(0)})));for(var n=0,i=0,a={left:0,right:0},s={p:Zt($t.p.slice(0),(function(e){for(var a=r.length,s=0;s<4;s++)i=i*t|r[n++%a];return(e>>16^i>>16)<<16|65535&(65535&e^65535&i)})),s0:$t.s0.slice(0),s1:$t.s1.slice(0),s2:$t.s2.slice(0),s3:$t.s3.slice(0)},o=0,c=s.p.length;o<c;)rr(a,s),s.p[o++]=a.left,s.p[o++]=a.right;for(var u=0;u<4;u++)for(var f=0,h=s["s"+u].length;f<h;)rr(a,s),s["s"+u][f++]=a.left,s["s"+u][f++]=a.right;this.box=s};var nr=Jt.Blowfish;function ir(e,t,r){return t=s(t),a(e,ar()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function ar(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ar=function(){return!!e})()}const sr=function(t){function r(){var t;return e(this,r),(t=ir(this,r)).name="Blowfish Decrypt",t.module="Ciphers",t.description="Blowfish is a symmetric-key block cipher designed in 1993 by Bruce Schneier and included in a large number of cipher suites and encryption products. AES now receives more attention.<br><br><b>IV:</b> The Initialization Vector should be 8 bytes long. If not entered, it will default to 8 null bytes.",t.infoURL="https://wikipedia.org/wiki/Blowfish_(cipher)",t.inputType="string",t.outputType="string",t.args=[{name:"Key",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]},{name:"IV",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]},{name:"Mode",type:"option",value:["CBC","CFB","OFB","CTR","ECB"]},{name:"Input",type:"option",value:["Hex","Raw"]},{name:"Output",type:"option",value:["Raw","Hex"]}],t}return c(r,t),i(r,[{key:"run",value:function(e,t){var r=O.convertToByteString(t[0].string,t[0].option),n=O.convertToByteString(t[1].string,t[1].option),i=t[2],a=t[3],s=t[4];if(r.length<4||r.length>56)throw new E(`Invalid key length: ${r.length} bytes\n\nBlowfish's key length needs to be between 4 and 56 bytes (32-448 bits).`);if(8!==n.length)throw new E(`Invalid IV length: ${n.length} bytes. Expected 8 bytes`);e=O.convertToByteString(e,a);var o=nr.createDecipher(r,i);if(o.start({iv:n}),o.update(lt().util.createBuffer(e)),o.finish())return"Hex"===s?o.output.toHex():o.output.getBytes();throw new E("Unable to decrypt input with these parameters.")}}])}(tt);function or(e,t,r){return t=s(t),a(e,cr()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function cr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(cr=function(){return!!e})()}const ur=function(t){function r(){var t;return e(this,r),(t=or(this,r)).name="Blowfish Encrypt",t.module="Ciphers",t.description="Blowfish is a symmetric-key block cipher designed in 1993 by Bruce Schneier and included in a large number of cipher suites and encryption products. AES now receives more attention.<br><br><b>IV:</b> The Initialization Vector should be 8 bytes long. If not entered, it will default to 8 null bytes.",t.infoURL="https://wikipedia.org/wiki/Blowfish_(cipher)",t.inputType="string",t.outputType="string",t.args=[{name:"Key",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]},{name:"IV",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]},{name:"Mode",type:"option",value:["CBC","CFB","OFB","CTR","ECB"]},{name:"Input",type:"option",value:["Raw","Hex"]},{name:"Output",type:"option",value:["Hex","Raw"]}],t}return c(r,t),i(r,[{key:"run",value:function(e,t){var r=O.convertToByteString(t[0].string,t[0].option),n=O.convertToByteString(t[1].string,t[1].option),i=t[2],a=t[3],s=t[4];if(r.length<4||r.length>56)throw new E(`Invalid key length: ${r.length} bytes\n \nBlowfish's key length needs to be between 4 and 56 bytes (32-448 bits).`);if(8!==n.length)throw new E(`Invalid IV length: ${n.length} bytes. Expected 8 bytes`);e=O.convertToByteString(e,a);var o=nr.createCipher(r,i);return o.start({iv:n}),o.update(lt().util.createBuffer(e)),o.finish(),"Hex"===s?o.output.toHex():o.output.getBytes()}}])}(tt);function fr(e,t,r){return t=s(t),a(e,hr()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function hr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(hr=function(){return!!e})()}var lr=function(t){function r(){var t;return e(this,r),(t=fr(this,r)).name="Caesar Box Cipher",t.module="Ciphers",t.description="Caesar Box is a transposition cipher used in the Roman Empire, in which letters of the message are written in rows in a square (or a rectangle) and then, read by column.",t.infoURL="https://www.dcode.fr/caesar-box-cipher",t.inputType="string",t.outputType="string",t.args=[{name:"Box Height",type:"number",value:1}],t}return c(r,t),i(r,[{key:"run",value:function(e,t){for(var r=t[0],n=Math.ceil(e.length/r);-1!==e.indexOf(" ");)e=e.replace(" ","");for(var i=0;i<r*n-e.length;i++)e+="\0";for(var a="",s=0;s<r;s++)for(var o=s;o<e.length;o+=r)"\0"!==e.charAt(o)&&(a+=e.charAt(o));return a}}])}(tt);const dr=lr;function pr(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function gr(e,t,r){return t=s(t),a(e,yr()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function yr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(yr=function(){return!!e})()}var vr=function(t){function r(){var t;return e(this,r),(t=gr(this,r)).name="Cetacean Cipher Decode",t.module="Ciphers",t.description="Decode Cetacean Cipher input. <br/><br/>e.g. <code>EEEEEEEEEeeEeEEEEEEEEEEEEeeEeEEe</code> becomes <code>hi</code>",t.infoURL="https://hitchhikers.fandom.com/wiki/Dolphins",t.inputType="string",t.outputType="string",t.checks=[{pattern:"^(?:[eE]{16,})(?: [eE]{16,})*$",flags:"",args:[]}],t}return c(r,t),i(r,[{key:"run",value:function(e,t){var r,n=[],i=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return pr(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?pr(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,o=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return s=e.done,e},e:function(e){o=!0,a=e},f:function(){try{s||null==r.return||r.return()}finally{if(o)throw a}}}}(e);try{for(i.s();!(r=i.n()).done;){var a=r.value;" "===a?n.push.apply(n,[0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0]):n.push("e"===a?1:0)}}catch(e){i.e(e)}finally{i.f()}for(var s=[],o=0;o<n.length;o+=16)s.push(n.slice(o,o+16).join(""));return s.map((function(e){return String.fromCharCode(parseInt(e,2))})).join("")}}])}(tt);const mr=vr;function br(e,t,r){return t=s(t),a(e,wr()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function wr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(wr=function(){return!!e})()}var Sr=function(t){function r(){var t;return e(this,r),(t=br(this,r)).name="Cetacean Cipher Encode",t.module="Ciphers",t.description="Converts any input into Cetacean Cipher. <br/><br/>e.g. <code>hi</code> becomes <code>EEEEEEEEEeeEeEEEEEEEEEEEEeeEeEEe</code>",t.infoURL="https://hitchhikers.fandom.com/wiki/Dolphins",t.inputType="string",t.outputType="string",t}return c(r,t),i(r,[{key:"run",value:function(e,t){var r=[];return e.split("").map((function(e){if(" "===e)r.push(e);else{var t=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Space",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:8;if(null==e)throw new E("Unable to convert to binary: Empty input data enocuntered");t=O.charRep(t);var n="";if(!e.length)return"number"==typeof e?e.toString(2).padStart(r,"0"):"";for(var i=0;i<e.length;i++)n+=e[i].toString(2).padStart(r,"0"),i!==e.length-1&&(n+=t);return n}(e.charCodeAt(0),"None",16).split("");r.push(t.map((function(e){return"1"===e?"e":"E"})).join(""))}})),r.join("")}}])}(tt);const Er=Sr;function Cr(e,t,r){return t=s(t),a(e,Ar()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function Ar(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ar=function(){return!!e})()}function Br(e,t,r,n){var i;i=(i=16===e.length?O.strToByteArray("expand 16-byte k").concat(e).concat(e):O.strToByteArray("expand 32-byte k").concat(e)).concat(r).concat(t);for(var a=Array(),s=0;s<64;s+=4)a.push(O.byteArrayToInt(i.slice(s,s+4),"little"));var o=[].concat(a);function c(e,t){return e<<t&4294967295|e>>>32-t}function u(e,t,r,n,i){e[t]=e[t]+e[r]&4294967295,e[i]=c(e[i]^e[t],16),e[n]=e[n]+e[i]&4294967295,e[r]=c(e[r]^e[n],12),e[t]=e[t]+e[r]&4294967295,e[i]=c(e[i]^e[t],8),e[n]=e[n]+e[i]&4294967295,e[r]=c(e[r]^e[n],7)}for(var f=0;f<n/2;f++)u(a,0,4,8,12),u(a,1,5,9,13),u(a,2,6,10,14),u(a,3,7,11,15),u(a,0,5,10,15),u(a,1,6,11,12),u(a,2,7,8,13),u(a,3,4,9,14);for(var h=0;h<16;h++)a[h]=a[h]+o[h]&4294967295;for(var l=Array(),d=0;d<16;d++)l=l.concat(O.intToByteArray(a[d],4,"little"));return l}var xr=function(t){function r(){var t;return e(this,r),(t=Cr(this,r)).name="ChaCha",t.module="Ciphers",t.description="ChaCha is a stream cipher designed by Daniel J. Bernstein. It is a variant of the Salsa stream cipher. Several parameterizations exist; 'ChaCha' may refer to the original construction, or to the variant as described in RFC-8439. ChaCha is often used with Poly1305, in the ChaCha20-Poly1305 AEAD construction.<br><br><b>Key:</b> ChaCha uses a key of 16 or 32 bytes (128 or 256 bits).<br><br><b>Nonce:</b> ChaCha uses a nonce of 8 or 12 bytes (64 or 96 bits).<br><br><b>Counter:</b> ChaCha uses a counter of 4 or 8 bytes (32 or 64 bits); together, the nonce and counter must add up to 16 bytes. The counter starts at zero at the start of the keystream, and is incremented at every 64 bytes.",t.infoURL="https://wikipedia.org/wiki/Salsa20#ChaCha_variant",t.inputType="string",t.outputType="string",t.args=[{name:"Key",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]},{name:"Nonce",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64","Integer"]},{name:"Counter",type:"number",value:0,min:0},{name:"Rounds",type:"option",value:["20","12","8"]},{name:"Input",type:"option",value:["Hex","Raw"]},{name:"Output",type:"option",value:["Raw","Hex"]}],t}return c(r,t),i(r,[{key:"run",value:function(e,t){var r,n,i,a=O.convertToByteArray(t[0].string,t[0].option),s=t[1].option,o=parseInt(t[3],10),c=t[4],u=t[5];if(16!==a.length&&32!==a.length)throw new E(`Invalid key length: ${a.length} bytes.\n\nChaCha uses a key of 16 or 32 bytes (128 or 256 bits).`);if("Integer"===s)n=O.intToByteArray(parseInt(t[1].string,10),12,"little"),i=4;else{if(12!==(n=O.convertToByteArray(t[1].string,t[1].option)).length&&8!==n.length)throw new E(`Invalid nonce length: ${n.length} bytes.\n\nChaCha uses a nonce of 8 or 12 bytes (64 or 96 bits).`);i=16-n.length}r=O.intToByteArray(t[2],i,"little");var f=[];e=O.convertToByteArray(e,c);for(var h=O.byteArrayToInt(r,"little"),l=0;l<e.length;l+=64){for(var d=Br(a,n,r=O.intToByteArray(h,i,"little"),o),p=0;p<64&&l+p<e.length;p++)f.push(e[l+p]^d[p]);h++}return"Hex"===u?B(f):O.arrayBufferToStr(Uint8Array.from(f).buffer)}},{key:"highlight",value:function(e,t){var r=t[4],n=t[5];if("Raw"===r&&"Raw"===n)return e}},{key:"highlightReverse",value:function(e,t){var r=t[4],n=t[5];if("Raw"===r&&"Raw"===n)return e}}])}(tt);const Tr=xr;function Ir(e,t,r){return t=s(t),a(e,Fr()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function Fr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Fr=function(){return!!e})()}const kr=function(t){function r(){var t;return e(this,r),(t=Ir(this,r)).name="DES Decrypt",t.module="Ciphers",t.description="DES is a previously dominant algorithm for encryption, and was published as an official U.S. Federal Information Processing Standard (FIPS). It is now considered to be insecure due to its small key size.<br><br><b>Key:</b> DES uses a key length of 8 bytes (64 bits).<br>Triple DES uses a key length of 24 bytes (192 bits).<br><br><b>IV:</b> The Initialization Vector should be 8 bytes long. If not entered, it will default to 8 null bytes.<br><br><b>Padding:</b> In CBC and ECB mode, PKCS#7 padding will be used as a default.",t.infoURL="https://wikipedia.org/wiki/Data_Encryption_Standard",t.inputType="string",t.outputType="string",t.args=[{name:"Key",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]},{name:"IV",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]},{name:"Mode",type:"option",value:["CBC","CFB","OFB","CTR","ECB","CBC/NoPadding","ECB/NoPadding"]},{name:"Input",type:"option",value:["Hex","Raw"]},{name:"Output",type:"option",value:["Raw","Hex"]}],t}return c(r,t),i(r,[{key:"run",value:function(e,t){var r=O.convertToByteString(t[0].string,t[0].option),n=O.convertToByteArray(t[1].string,t[1].option),i=t[2].substring(0,3),a=t[2].endsWith("NoPadding"),s=se(t,5),o=s[3],c=s[4];if(8!==r.length)throw new E(`Invalid key length: ${r.length} bytes\n\nDES uses a key length of 8 bytes (64 bits).\nTriple DES uses a key length of 24 bytes (192 bits).`);if(8!==n.length&&"ECB"!==i)throw new E(`Invalid IV length: ${n.length} bytes\n\nDES uses an IV length of 8 bytes (64 bits).\nMake sure you have specified the type correctly (e.g. Hex vs UTF8).`);e=O.convertToByteString(e,o);var u=lt().cipher.createDecipher("DES-"+i,r);if(a&&(u.mode.unpad=function(e,t){return!0}),u.start({iv:n}),u.update(lt().util.createBuffer(e)),u.finish())return"Hex"===c?u.output.toHex():u.output.getBytes();throw new E("Unable to decrypt input with these parameters.")}}])}(tt);function Rr(e,t,r){return t=s(t),a(e,Dr()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function Dr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Dr=function(){return!!e})()}const _r=function(t){function r(){var t;return e(this,r),(t=Rr(this,r)).name="DES Encrypt",t.module="Ciphers",t.description="DES is a previously dominant algorithm for encryption, and was published as an official U.S. Federal Information Processing Standard (FIPS). It is now considered to be insecure due to its small key size.<br><br><b>Key:</b> DES uses a key length of 8 bytes (64 bits).<br>Triple DES uses a key length of 24 bytes (192 bits).<br><br>You can generate a password-based key using one of the KDF operations.<br><br><b>IV:</b> The Initialization Vector should be 8 bytes long. If not entered, it will default to 8 null bytes.<br><br><b>Padding:</b> In CBC and ECB mode, PKCS#7 padding will be used.",t.infoURL="https://wikipedia.org/wiki/Data_Encryption_Standard",t.inputType="string",t.outputType="string",t.args=[{name:"Key",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]},{name:"IV",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]},{name:"Mode",type:"option",value:["CBC","CFB","OFB","CTR","ECB"]},{name:"Input",type:"option",value:["Raw","Hex"]},{name:"Output",type:"option",value:["Hex","Raw"]}],t}return c(r,t),i(r,[{key:"run",value:function(e,t){var r=O.convertToByteString(t[0].string,t[0].option),n=O.convertToByteArray(t[1].string,t[1].option),i=se(t,5),a=i[2],s=i[3],o=i[4];if(8!==r.length)throw new E(`Invalid key length: ${r.length} bytes\n\nDES uses a key length of 8 bytes (64 bits).\nTriple DES uses a key length of 24 bytes (192 bits).`);if(8!==n.length&&"ECB"!==a)throw new E(`Invalid IV length: ${n.length} bytes\n\nDES uses an IV length of 8 bytes (64 bits).\nMake sure you have specified the type correctly (e.g. Hex vs UTF8).`);e=O.convertToByteString(e,s);var c=lt().cipher.createCipher("DES-"+a,r);return c.start({iv:n}),c.update(lt().util.createBuffer(e)),c.finish(),"Hex"===o?c.output.toHex():c.output.getBytes()}}])}(tt);function Pr(e,t,r){return t=s(t),a(e,Nr()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function Nr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Nr=function(){return!!e})()}const Or=function(t){function r(){var t;return e(this,r),(t=Pr(this,r)).name="Derive EVP key",t.module="Ciphers",t.description="This operation performs a password-based key derivation function (PBKDF) used extensively in OpenSSL. In many applications of cryptography, user security is ultimately dependent on a password, and because a password usually can't be used directly as a cryptographic key, some processing is required.<br><br>A salt provides a large set of keys for any given password, and an iteration count increases the cost of producing keys from a password, thereby also increasing the difficulty of attack.<br><br>If you leave the salt argument empty, a random salt will be generated.",t.infoURL="https://wikipedia.org/wiki/Key_derivation_function",t.inputType="string",t.outputType="string",t.args=[{name:"Passphrase",type:"toggleString",value:"",toggleValues:["UTF8","Latin1","Hex","Base64"]},{name:"Key size",type:"number",value:128},{name:"Iterations",type:"number",value:1},{name:"Hashing function",type:"option",value:["SHA1","SHA256","SHA384","SHA512","MD5"]},{name:"Salt",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]}],t}return c(r,t),i(r,[{key:"run",value:function(e,t){var r=Dt().enc.Latin1.parse(O.convertToByteString(t[0].string,t[0].option)),n=t[1]/32,i=t[2],a=t[3],s=Dt().enc.Latin1.parse(O.convertToByteString(t[4].string,t[4].option));return Dt().EvpKDF(r,s,{keySize:n,hasher:Dt().algo[a],iterations:i}).toString(Dt().enc.Hex)}}])}(tt);function Lr(e,t,r){return t=s(t),a(e,Ur()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function Ur(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ur=function(){return!!e})()}Dt().kdf.OpenSSL.execute=function(e,t,r,n){null==n&&(n=Dt().lib.WordArray.random(8));var i=Dt().algo.EvpKDF.create({keySize:t+r}).compute(e,n),a=Dt().lib.WordArray.create(i.words.slice(t),4*r);return i.sigBytes=4*t,Dt().lib.CipherParams.create({key:i,iv:a,salt:n})},Dt().enc.Hex.parse=function(e){for(var t=(e=e.replace(/\s/g,"")).length,r=[],n=0;n<t;n+=2)r[n>>>3]|=parseInt(e.substr(n,2),16)<<24-n%8*4;return new(Dt().lib.WordArray.init)(r,t/2)};const Kr=function(t){function r(){var t;return e(this,r),(t=Lr(this,r)).name="Derive PBKDF2 key",t.module="Ciphers",t.description="PBKDF2 is a password-based key derivation function. It is part of RSA Laboratories' Public-Key Cryptography Standards (PKCS) series, specifically PKCS #5 v2.0, also published as Internet Engineering Task Force's RFC 2898.<br><br>In many applications of cryptography, user security is ultimately dependent on a password, and because a password usually can't be used directly as a cryptographic key, some processing is required.<br><br>A salt provides a large set of keys for any given password, and an iteration count increases the cost of producing keys from a password, thereby also increasing the difficulty of attack.<br><br>If you leave the salt argument empty, a random salt will be generated.",t.infoURL="https://wikipedia.org/wiki/PBKDF2",t.inputType="string",t.outputType="string",t.args=[{name:"Passphrase",type:"toggleString",value:"",toggleValues:["UTF8","Latin1","Hex","Base64"]},{name:"Key size",type:"number",value:128},{name:"Iterations",type:"number",value:1},{name:"Hashing function",type:"option",value:["SHA1","SHA256","SHA384","SHA512","MD5"]},{name:"Salt",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]}],t}return c(r,t),i(r,[{key:"run",value:function(e,t){var r=O.convertToByteString(t[0].string,t[0].option),n=t[1],i=t[2],a=t[3],s=O.convertToByteString(t[4].string,t[4].option)||lt().random.getBytesSync(n),o=lt().pkcs5.pbkdf2(r,s,i,n/8,a.toLowerCase());return lt().util.bytesToHex(o)}}])}(tt);var Mr=__webpack_require__(95355);function Hr(e,t,r){return t=s(t),a(e,jr()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function jr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(jr=function(){return!!e})()}const Vr=function(t){function r(){var t;return e(this,r),(t=Hr(this,r)).name="ECDSA Sign",t.module="Ciphers",t.description="Sign a plaintext message with a PEM encoded EC key.",t.infoURL="https://wikipedia.org/wiki/Elliptic_Curve_Digital_Signature_Algorithm",t.inputType="string",t.outputType="string",t.args=[{name:"ECDSA Private Key (PEM)",type:"text",value:"-----BEGIN EC PRIVATE KEY-----"},{name:"Message Digest Algorithm",type:"option",value:["SHA-256","SHA-384","SHA-512","SHA-1","MD5"]},{name:"Output Format",type:"option",value:["ASN.1 HEX","P1363 HEX","JSON Web Signature","Raw JSON"]}],t}return c(r,t),i(r,[{key:"run",value:function(e,t){var r=se(t,3),n=r[0],i=r[1],a=r[2];if(0===n.replace("-----BEGIN EC PRIVATE KEY-----","").length)throw new E("Please enter a private key.");var s=i.replace("-","")+"withECDSA",o=new Mr.pj.crypto.Signature({alg:s}),c=Mr.ym.getKey(n);if("EC"!==c.type)throw new E("Provided key is not an EC key.");if(!c.isPrivate)throw new E("Provided key is not a private key.");o.init(c);var u,f=o.signString(e);switch(a){case"ASN.1 HEX":u=f;break;case"P1363 HEX":u=Mr.pj.crypto.ECDSA.asn1SigToConcatSig(f);break;case"JSON Web Signature":u=C(T(u=Mr.pj.crypto.ECDSA.asn1SigToConcatSig(f)),"A-Za-z0-9-_");break;case"Raw JSON":var h=Mr.pj.crypto.ECDSA.parseSigHexInHexRS(f);u=JSON.stringify(h)}return u}}])}(tt);function Gr(e,t,r){return t=s(t),a(e,qr()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function qr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(qr=function(){return!!e})()}const zr=function(t){function r(){var t;return e(this,r),(t=Gr(this,r)).name="ECDSA Signature Conversion",t.module="Ciphers",t.description="Convert an ECDSA signature between hex, asn1 and json.",t.infoURL="https://wikipedia.org/wiki/Elliptic_Curve_Digital_Signature_Algorithm",t.inputType="string",t.outputType="string",t.args=[{name:"Input Format",type:"option",value:["Auto","ASN.1 HEX","P1363 HEX","JSON Web Signature","Raw JSON"]},{name:"Output Format",type:"option",value:["ASN.1 HEX","P1363 HEX","JSON Web Signature","Raw JSON"]}],t}return c(r,t),i(r,[{key:"run",value:function(e,t){var r,n,i,a,s=t[0],o=t[1];if("Auto"===s)try{"object"==typeof(r=JSON.parse(e))&&(s="Raw JSON")}catch(e){}if("Auto"===s&&/^[a-f\d]{2,}$/gi.test(e)&&(s="30"===e.substring(0,2)&&Mr.d6.isASN1HEX(e)?"ASN.1 HEX":"P1363 HEX"),"Auto"===s)try{n=A(e,"A-Za-z0-9-_",!1),s="JSON Web Signature"}catch(e){}switch(s){case"Auto":throw new E("Signature format could not be detected");case"ASN.1 HEX":i=e;break;case"P1363 HEX":i=Mr.pj.crypto.ECDSA.concatSigToASN1Sig(e);break;case"JSON Web Signature":n||(n=A(e,"A-Za-z0-9-_")),i=Mr.pj.crypto.ECDSA.concatSigToASN1Sig(x(n));break;case"Raw JSON":if(r||(r=JSON.parse(e)),!r.r)throw new E('No "r" value in the signature JSON');if(!r.s)throw new E('No "s" value in the signature JSON');i=Mr.pj.crypto.ECDSA.hexRSSigToASN1Sig(r.r,r.s)}switch(o){case"ASN.1 HEX":a=i;break;case"P1363 HEX":a=Mr.pj.crypto.ECDSA.asn1SigToConcatSig(i);break;case"JSON Web Signature":a=C(T(a=Mr.pj.crypto.ECDSA.asn1SigToConcatSig(i)),"A-Za-z0-9-_");break;case"Raw JSON":var c=Mr.pj.crypto.ECDSA.parseSigHexInHexRS(i);a=JSON.stringify(c)}return a}}])}(tt);function Wr(e,t,r){return t=s(t),a(e,Xr()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function Xr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Xr=function(){return!!e})()}const Yr=function(t){function r(){var t;return e(this,r),(t=Wr(this,r)).name="ECDSA Verify",t.module="Ciphers",t.description="Verify a message against a signature and a public PEM encoded EC key.",t.infoURL="https://wikipedia.org/wiki/Elliptic_Curve_Digital_Signature_Algorithm",t.inputType="string",t.outputType="string",t.args=[{name:"Input Format",type:"option",value:["Auto","ASN.1 HEX","P1363 HEX","JSON Web Signature","Raw JSON"]},{name:"Message Digest Algorithm",type:"option",value:["SHA-256","SHA-384","SHA-512","SHA-1","MD5"]},{name:"ECDSA Public Key (PEM)",type:"text",value:"-----BEGIN PUBLIC KEY-----"},{name:"Message",type:"text",value:""}],t}return c(r,t),i(r,[{key:"run",value:function(e,t){var r,n,i,a=t[0],s=se(t,4),o=s[1],c=s[2],u=s[3];if(0===c.replace("-----BEGIN PUBLIC KEY-----","").length)throw new E("Please enter a public key.");if("Auto"===a)try{"object"==typeof(r=JSON.parse(e))&&(a="Raw JSON")}catch(e){}if("Auto"===a&&/^[a-f\d]{2,}$/gi.test(e)&&(a="30"===e.substring(0,2)&&Mr.d6.isASN1HEX(e)?"ASN.1 HEX":"P1363 HEX"),"Auto"===a)try{n=A(e,"A-Za-z0-9-_",!1),a="JSON Web Signature"}catch(e){}switch(a){case"Auto":throw new E("Signature format could not be detected");case"ASN.1 HEX":i=e;break;case"P1363 HEX":i=Mr.pj.crypto.ECDSA.concatSigToASN1Sig(e);break;case"JSON Web Signature":n||(n=A(e,"A-Za-z0-9-_")),i=Mr.pj.crypto.ECDSA.concatSigToASN1Sig(x(n));break;case"Raw JSON":if(r||(r=JSON.parse(e)),!r.r)throw new E('No "r" value in the signature JSON');if(!r.s)throw new E('No "s" value in the signature JSON');i=Mr.pj.crypto.ECDSA.hexRSSigToASN1Sig(r.r,r.s)}var f=o.replace("-","")+"withECDSA",h=new Mr.pj.crypto.Signature({alg:f}),l=Mr.ym.getKey(c);if("EC"!==l.type)throw new E("Provided key is not an EC key.");if(!l.isPublic)throw new E("Provided key is not a public key.");return h.init(l),h.updateString(u),h.verify(i)?"Verified OK":"Verification Failure"}}])}(tt);var Jr=__webpack_require__(2754);function Qr(e,t,r){return t=s(t),a(e,Zr()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function Zr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Zr=function(){return!!e})()}const $r=function(t){function r(){var t;return e(this,r),(t=Qr(this,r)).name="GOST Decrypt",t.module="Ciphers",t.description="The GOST block cipher (Magma), defined in the standard GOST 28147-89 (RFC 5830), is a Soviet and Russian government standard symmetric key block cipher with a block size of 64 bits. The original standard, published in 1989, did not give the cipher any name, but the most recent revision of the standard, GOST R 34.12-2015 (RFC 7801, RFC 8891), specifies that it may be referred to as Magma. The GOST hash function is based on this cipher. The new standard also specifies a new 128-bit block cipher called Kuznyechik.<br><br>Developed in the 1970s, the standard had been marked 'Top Secret' and then downgraded to 'Secret' in 1990. Shortly after the dissolution of the USSR, it was declassified and it was released to the public in 1994. GOST 28147 was a Soviet alternative to the United States standard algorithm, DES. Thus, the two are very similar in structure.",t.infoURL="https://wikipedia.org/wiki/GOST_(block_cipher)",t.inputType="string",t.outputType="string",t.args=[{name:"Key",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]},{name:"IV",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]},{name:"Input type",type:"option",value:["Hex","Raw"]},{name:"Output type",type:"option",value:["Raw","Hex"]},{name:"Algorithm",type:"argSelector",value:[{name:"GOST 28147 (1989)",on:[5]},{name:"GOST R 34.12 (Magma, 2015)",off:[5]},{name:"GOST R 34.12 (Kuznyechik, 2015)",off:[5]}]},{name:"sBox",type:"option",value:["E-TEST","E-A","E-B","E-C","E-D","E-SC","E-Z","D-TEST","D-A","D-SC"]},{name:"Block mode",type:"option",value:["ECB","CFB","OFB","CTR","CBC"]},{name:"Key meshing mode",type:"option",value:["NO","CP"]},{name:"Padding",type:"option",value:["NO","PKCS5","ZERO","RANDOM","BIT"]}],t}return c(r,t),i(r,[{key:"run",value:(n=f(l().mark((function e(t,r){var n,i,a,s,o,c,u,f,h,d,p,g,y,v,m,b,w,S;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=se(r,9),i=n[0],a=n[1],s=n[2],o=n[3],c=n[4],u=n[5],f=n[6],h=n[7],d=n[8],p=x(O.convertToByteArray(i.string,i.option)),g=x(O.convertToByteArray(a.string,a.option)),t="Hex"===s?t:x(O.strToArrayBuffer(t)),e.t0=c,e.next="GOST 28147 (1989)"===e.t0?7:"GOST R 34.12 (Magma, 2015)"===e.t0?10:"GOST R 34.12 (Kuznyechik, 2015)"===e.t0?13:16;break;case 7:return v=1989,y=64,e.abrupt("break",17);case 10:return v=2015,y=64,e.abrupt("break",17);case 13:return v=2015,y=128,e.abrupt("break",17);case 16:throw new E(`Unknown algorithm version: ${c}`);case 17:return m={version:v,length:y,mode:"ES",sBox:1989===v?u:null,block:f,keyMeshing:h,padding:d},e.prev=19,b=Jr.CryptoGost.coding.Hex,g&&(m.iv=b.decode(g)),w=Jr.GostEngine.getGostCipher(m),S=b.encode(w.decrypt(b.decode(p),b.decode(t))),e.abrupt("return","Hex"===o?S:O.byteArrayToChars(T(S)));case 27:throw e.prev=27,e.t1=e.catch(19),new E(e.t1);case 30:case"end":return e.stop()}}),e,null,[[19,27]])}))),function(e,t){return n.apply(this,arguments)})}]);var n}(tt);function en(e,t,r){return t=s(t),a(e,tn()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function tn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(tn=function(){return!!e})()}const rn=function(t){function r(){var t;return e(this,r),(t=en(this,r)).name="GOST Encrypt",t.module="Ciphers",t.description="The GOST block cipher (Magma), defined in the standard GOST 28147-89 (RFC 5830), is a Soviet and Russian government standard symmetric key block cipher with a block size of 64 bits. The original standard, published in 1989, did not give the cipher any name, but the most recent revision of the standard, GOST R 34.12-2015 (RFC 7801, RFC 8891), specifies that it may be referred to as Magma. The GOST hash function is based on this cipher. The new standard also specifies a new 128-bit block cipher called Kuznyechik.<br><br>Developed in the 1970s, the standard had been marked 'Top Secret' and then downgraded to 'Secret' in 1990. Shortly after the dissolution of the USSR, it was declassified and it was released to the public in 1994. GOST 28147 was a Soviet alternative to the United States standard algorithm, DES. Thus, the two are very similar in structure.",t.infoURL="https://wikipedia.org/wiki/GOST_(block_cipher)",t.inputType="string",t.outputType="string",t.args=[{name:"Key",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]},{name:"IV",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]},{name:"Input type",type:"option",value:["Raw","Hex"]},{name:"Output type",type:"option",value:["Hex","Raw"]},{name:"Algorithm",type:"argSelector",value:[{name:"GOST 28147 (1989)",on:[5]},{name:"GOST R 34.12 (Magma, 2015)",off:[5]},{name:"GOST R 34.12 (Kuznyechik, 2015)",off:[5]}]},{name:"sBox",type:"option",value:["E-TEST","E-A","E-B","E-C","E-D","E-SC","E-Z","D-TEST","D-A","D-SC"]},{name:"Block mode",type:"option",value:["ECB","CFB","OFB","CTR","CBC"]},{name:"Key meshing mode",type:"option",value:["NO","CP"]},{name:"Padding",type:"option",value:["NO","PKCS5","ZERO","RANDOM","BIT"]}],t}return c(r,t),i(r,[{key:"run",value:(n=f(l().mark((function e(t,r){var n,i,a,s,o,c,u,f,h,d,p,g,y,v,m,b,w,S;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=se(r,9),i=n[0],a=n[1],s=n[2],o=n[3],c=n[4],u=n[5],f=n[6],h=n[7],d=n[8],p=x(O.convertToByteArray(i.string,i.option)),g=x(O.convertToByteArray(a.string,a.option)),t="Hex"===s?t:x(O.strToArrayBuffer(t)),e.t0=c,e.next="GOST 28147 (1989)"===e.t0?7:"GOST R 34.12 (Magma, 2015)"===e.t0?10:"GOST R 34.12 (Kuznyechik, 2015)"===e.t0?13:16;break;case 7:return v=1989,y=64,e.abrupt("break",17);case 10:return v=2015,y=64,e.abrupt("break",17);case 13:return v=2015,y=128,e.abrupt("break",17);case 16:throw new E(`Unknown algorithm version: ${c}`);case 17:return m={version:v,length:y,mode:"ES",sBox:1989===v?u:null,block:f,keyMeshing:h,padding:d},e.prev=19,b=Jr.CryptoGost.coding.Hex,g&&(m.iv=b.decode(g)),w=Jr.GostEngine.getGostCipher(m),S=b.encode(w.encrypt(b.decode(p),b.decode(t))),e.abrupt("return","Hex"===o?S:O.byteArrayToChars(T(S)));case 27:throw e.prev=27,e.t1=e.catch(19),new E(e.t1);case 30:case"end":return e.stop()}}),e,null,[[19,27]])}))),function(e,t){return n.apply(this,arguments)})}]);var n}(tt);function nn(e,t,r){return t=s(t),a(e,an()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function an(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(an=function(){return!!e})()}const sn=function(t){function r(){var t;return e(this,r),(t=nn(this,r)).name="GOST Key Unwrap",t.module="Ciphers",t.description="A decryptor for keys wrapped using one of the GOST block ciphers.",t.infoURL="https://wikipedia.org/wiki/GOST_(block_cipher)",t.inputType="string",t.outputType="string",t.args=[{name:"Key",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]},{name:"User Key Material",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]},{name:"Input type",type:"option",value:["Hex","Raw"]},{name:"Output type",type:"option",value:["Raw","Hex"]},{name:"Algorithm",type:"argSelector",value:[{name:"GOST 28147 (1989)",on:[5]},{name:"GOST R 34.12 (Magma, 2015)",off:[5]},{name:"GOST R 34.12 (Kuznyechik, 2015)",off:[5]}]},{name:"sBox",type:"option",value:["E-TEST","E-A","E-B","E-C","E-D","E-SC","E-Z","D-TEST","D-A","D-SC"]},{name:"Key wrapping",type:"option",value:["NO","CP","SC"]}],t}return c(r,t),i(r,[{key:"run",value:(n=f(l().mark((function e(t,r){var n,i,a,s,o,c,u,f,h,d,p,g,y,v,m,b;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=se(r,7),i=n[0],a=n[1],s=n[2],o=n[3],c=n[4],u=n[5],f=n[6],h=x(O.convertToByteArray(i.string,i.option)),d=x(O.convertToByteArray(a.string,a.option)),t="Hex"===s?t:x(O.strToArrayBuffer(t)),e.t0=c,e.next="GOST 28147 (1989)"===e.t0?7:"GOST R 34.12 (Magma, 2015)"===e.t0?10:"GOST R 34.12 (Kuznyechik, 2015)"===e.t0?13:16;break;case 7:return g=1989,p=64,e.abrupt("break",17);case 10:return g=2015,p=64,e.abrupt("break",17);case 13:return g=2015,p=128,e.abrupt("break",17);case 16:throw new E(`Unknown algorithm version: ${c}`);case 17:return y={version:g,length:p,mode:"KW",sBox:1989===g?u:null,keyWrapping:f},e.prev=19,v=Jr.CryptoGost.coding.Hex,y.ukm=v.decode(d),m=Jr.GostEngine.getGostCipher(y),b=v.encode(m.unwrapKey(v.decode(h),v.decode(t))),e.abrupt("return","Hex"===o?b:O.byteArrayToChars(T(b)));case 27:if(e.prev=27,e.t1=e.catch(19),!e.t1.toString().includes("Invalid typed array length")){e.next=31;break}throw new E("Incorrect input length. Must be a multiple of the block size.");case 31:throw new E(e.t1);case 32:case"end":return e.stop()}}),e,null,[[19,27]])}))),function(e,t){return n.apply(this,arguments)})}]);var n}(tt);function on(e,t,r){return t=s(t),a(e,cn()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function cn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(cn=function(){return!!e})()}const un=function(t){function r(){var t;return e(this,r),(t=on(this,r)).name="GOST Key Wrap",t.module="Ciphers",t.description="A key wrapping algorithm for protecting keys in untrusted storage using one of the GOST block cipers.",t.infoURL="https://wikipedia.org/wiki/GOST_(block_cipher)",t.inputType="string",t.outputType="string",t.args=[{name:"Key",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]},{name:"User Key Material",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]},{name:"Input type",type:"option",value:["Raw","Hex"]},{name:"Output type",type:"option",value:["Hex","Raw"]},{name:"Algorithm",type:"argSelector",value:[{name:"GOST 28147 (1989)",on:[5]},{name:"GOST R 34.12 (Magma, 2015)",off:[5]},{name:"GOST R 34.12 (Kuznyechik, 2015)",off:[5]}]},{name:"sBox",type:"option",value:["E-TEST","E-A","E-B","E-C","E-D","E-SC","E-Z","D-TEST","D-A","D-SC"]},{name:"Key wrapping",type:"option",value:["NO","CP","SC"]}],t}return c(r,t),i(r,[{key:"run",value:(n=f(l().mark((function e(t,r){var n,i,a,s,o,c,u,f,h,d,p,g,y,v,m,b;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=se(r,7),i=n[0],a=n[1],s=n[2],o=n[3],c=n[4],u=n[5],f=n[6],h=x(O.convertToByteArray(i.string,i.option)),d=x(O.convertToByteArray(a.string,a.option)),t="Hex"===s?t:x(O.strToArrayBuffer(t)),e.t0=c,e.next="GOST 28147 (1989)"===e.t0?7:"GOST R 34.12 (Magma, 2015)"===e.t0?10:"GOST R 34.12 (Kuznyechik, 2015)"===e.t0?13:16;break;case 7:return g=1989,p=64,e.abrupt("break",17);case 10:return g=2015,p=64,e.abrupt("break",17);case 13:return g=2015,p=128,e.abrupt("break",17);case 16:throw new E(`Unknown algorithm version: ${c}`);case 17:return y={version:g,length:p,mode:"KW",sBox:1989===g?u:null,keyWrapping:f},e.prev=19,v=Jr.CryptoGost.coding.Hex,y.ukm=v.decode(d),m=Jr.GostEngine.getGostCipher(y),b=v.encode(m.wrapKey(v.decode(h),v.decode(t))),e.abrupt("return","Hex"===o?b:O.byteArrayToChars(T(b)));case 27:if(e.prev=27,e.t1=e.catch(19),!e.t1.toString().includes("Invalid typed array length")){e.next=31;break}throw new E("Incorrect input length. Must be a multiple of the block size.");case 31:throw new E(e.t1);case 32:case"end":return e.stop()}}),e,null,[[19,27]])}))),function(e,t){return n.apply(this,arguments)})}]);var n}(tt);function fn(e,t,r){return t=s(t),a(e,hn()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function hn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(hn=function(){return!!e})()}const ln=function(t){function r(){var t;return e(this,r),(t=fn(this,r)).name="GOST Sign",t.module="Ciphers",t.description="Sign a plaintext message using one of the GOST block ciphers.",t.infoURL="https://wikipedia.org/wiki/GOST_(block_cipher)",t.inputType="string",t.outputType="string",t.args=[{name:"Key",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]},{name:"IV",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]},{name:"Input type",type:"option",value:["Raw","Hex"]},{name:"Output type",type:"option",value:["Hex","Raw"]},{name:"Algorithm",type:"argSelector",value:[{name:"GOST 28147 (1989)",on:[5]},{name:"GOST R 34.12 (Magma, 2015)",off:[5]},{name:"GOST R 34.12 (Kuznyechik, 2015)",off:[5]}]},{name:"sBox",type:"option",value:["E-TEST","E-A","E-B","E-C","E-D","E-SC","E-Z","D-TEST","D-A","D-SC"]},{name:"MAC length",type:"number",value:32,min:8,max:64,step:8}],t}return c(r,t),i(r,[{key:"run",value:(n=f(l().mark((function e(t,r){var n,i,a,s,o,c,u,f,h,d,p,g,y,v,m,b;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=se(r,7),i=n[0],a=n[1],s=n[2],o=n[3],c=n[4],u=n[5],f=n[6],h=x(O.convertToByteArray(i.string,i.option)),d=x(O.convertToByteArray(a.string,a.option)),t="Hex"===s?t:x(O.strToArrayBuffer(t)),e.t0=c,e.next="GOST 28147 (1989)"===e.t0?7:"GOST R 34.12 (Magma, 2015)"===e.t0?10:"GOST R 34.12 (Kuznyechik, 2015)"===e.t0?13:16;break;case 7:return g=1989,p=64,e.abrupt("break",17);case 10:return g=2015,p=64,e.abrupt("break",17);case 13:return g=2015,p=128,e.abrupt("break",17);case 16:throw new E(`Unknown algorithm version: ${c}`);case 17:return y={version:g,length:p,mode:"MAC",sBox:1989===g?u:null,macLength:f},e.prev=19,v=Jr.CryptoGost.coding.Hex,d&&(y.iv=v.decode(d)),m=Jr.GostEngine.getGostCipher(y),b=v.encode(m.sign(v.decode(h),v.decode(t))),e.abrupt("return","Hex"===o?b:O.byteArrayToChars(T(b)));case 27:throw e.prev=27,e.t1=e.catch(19),new E(e.t1);case 30:case"end":return e.stop()}}),e,null,[[19,27]])}))),function(e,t){return n.apply(this,arguments)})}]);var n}(tt);function dn(e,t,r){return t=s(t),a(e,pn()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function pn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(pn=function(){return!!e})()}const gn=function(t){function r(){var t;return e(this,r),(t=dn(this,r)).name="GOST Verify",t.module="Ciphers",t.description="Verify the signature of a plaintext message using one of the GOST block ciphers. Enter the signature in the MAC field.",t.infoURL="https://wikipedia.org/wiki/GOST_(block_cipher)",t.inputType="string",t.outputType="string",t.args=[{name:"Key",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]},{name:"IV",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]},{name:"MAC",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]},{name:"Input type",type:"option",value:["Raw","Hex"]},{name:"Algorithm",type:"argSelector",value:[{name:"GOST 28147 (1989)",on:[5]},{name:"GOST R 34.12 (Magma, 2015)",off:[5]},{name:"GOST R 34.12 (Kuznyechik, 2015)",off:[5]}]},{name:"sBox",type:"option",value:["E-TEST","E-A","E-B","E-C","E-D","E-SC","E-Z","D-TEST","D-A","D-SC"]}],t}return c(r,t),i(r,[{key:"run",value:(n=f(l().mark((function e(t,r){var n,i,a,s,o,c,u,f,h,d,p,g,y,v,m,b;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=se(r,6),i=n[0],a=n[1],s=n[2],o=n[3],c=n[4],u=n[5],f=x(O.convertToByteArray(i.string,i.option)),h=x(O.convertToByteArray(a.string,a.option)),d=x(O.convertToByteArray(s.string,s.option)),t="Hex"===o?t:x(O.strToArrayBuffer(t)),e.t0=c,e.next="GOST 28147 (1989)"===e.t0?8:"GOST R 34.12 (Magma, 2015)"===e.t0?11:"GOST R 34.12 (Kuznyechik, 2015)"===e.t0?14:17;break;case 8:return g=1989,p=64,e.abrupt("break",18);case 11:return g=2015,p=64,e.abrupt("break",18);case 14:return g=2015,p=128,e.abrupt("break",18);case 17:throw new E(`Unknown algorithm version: ${c}`);case 18:return y={version:g,length:p,mode:"MAC",sBox:1989===g?u:null,macLength:4*d.length},e.prev=20,v=Jr.CryptoGost.coding.Hex,h&&(y.iv=v.decode(h)),m=Jr.GostEngine.getGostCipher(y),b=m.verify(v.decode(f),v.decode(d),v.decode(t)),e.abrupt("return",b?"The signature matches":"The signature does not match");case 28:throw e.prev=28,e.t1=e.catch(20),new E(e.t1);case 31:case"end":return e.stop()}}),e,null,[[20,28]])}))),function(e,t){return n.apply(this,arguments)})}]);var n}(tt);var yn="WARNING: Cryptographic operations in CyberChef should not be relied upon to provide security in any situation. No guarantee is offered for their correctness. We advise you not to use keys generated from CyberChef in operational contexts.";function vn(e,t,r){return t=s(t),a(e,mn()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function mn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(mn=function(){return!!e})()}const bn=function(t){function r(){var t;return e(this,r),(t=vn(this,r)).name="Generate ECDSA Key Pair",t.module="Ciphers",t.description=`Generate an ECDSA key pair with a given Curve.<br><br>${yn}`,t.infoURL="https://wikipedia.org/wiki/Elliptic_Curve_Digital_Signature_Algorithm",t.inputType="string",t.outputType="string",t.args=[{name:"Elliptic Curve",type:"option",value:["P-256","P-384","P-521"]},{name:"Output Format",type:"option",value:["PEM","DER","JWK"]}],t}return c(r,t),i(r,[{key:"run",value:(n=f(l().mark((function e(t,r){var n,i,a;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=se(r,2),i=n[0],a=n[1],e.abrupt("return",new Promise((function(e,t){var r;switch(i){case"P-256":r="secp256r1";break;case"P-384":r="secp384r1";break;case"P-521":r="secp521r1"}var n,s,o,c=Mr.ym.generateKeypair("EC",r);switch(a){case"PEM":o=(n=Mr.ym.getPEM(c.pubKeyObj).replace(/\r/g,""))+"\n"+(s=Mr.ym.getPEM(c.prvKeyObj,"PKCS8PRV").replace(/\r/g,""));break;case"DER":o=c.prvKeyObj.prvKeyHex;break;case"JWK":(n=Mr.ym.getJWKFromKey(c.pubKeyObj)).key_ops=["verify"],n.kid="PublicKey",(s=Mr.ym.getJWKFromKey(c.prvKeyObj)).key_ops=["sign"],s.kid="PrivateKey",o=JSON.stringify({keys:[s,n]},null,4)}e(o)})));case 2:case"end":return e.stop()}}),e)}))),function(e,t){return n.apply(this,arguments)})}]);var n}(tt);function wn(e,t,r){return t=s(t),a(e,Sn()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function Sn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Sn=function(){return!!e})()}const En=function(t){function r(){var t;return e(this,r),(t=wn(this,r)).name="Generate RSA Key Pair",t.module="Ciphers",t.description=`Generate an RSA key pair with a given number of bits.<br><br>${yn}`,t.infoURL="https://wikipedia.org/wiki/RSA_(cryptosystem)",t.inputType="string",t.outputType="string",t.args=[{name:"RSA Key Length",type:"option",value:["1024","2048","4096"]},{name:"Output Format",type:"option",value:["PEM","JSON","DER"]}],t}return c(r,t),i(r,[{key:"run",value:(n=f(l().mark((function e(t,r){var n,i,a;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=se(r,2),i=n[0],a=n[1],e.abrupt("return",new Promise((function(e,t){lt().pki.rsa.generateKeyPair({bits:Number(i),workers:-1,workerScript:"assets/forge/prime.worker.min.js"},(function(r,n){if(r)return t(r);var i;switch(a){case"PEM":i=lt().pki.publicKeyToPem(n.publicKey)+"\n"+lt().pki.privateKeyToPem(n.privateKey);break;case"JSON":i=JSON.stringify(n);break;case"DER":i=lt().asn1.toDer(lt().pki.privateKeyToAsn1(n.privateKey)).getBytes()}e(i)}))})));case 2:case"end":return e.stop()}}),e)}))),function(e,t){return n.apply(this,arguments)})}]);var n}(tt);function Cn(e,t,r){return t=s(t),a(e,An()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function An(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(An=function(){return!!e})()}var Bn=function(t){function r(){var t;return e(this,r),(t=Cn(this,r)).name="Pseudo-Random Number Generator",t.module="Ciphers",t.description="A cryptographically-secure pseudo-random number generator (PRNG).<br><br>This operation uses the browser's built-in <code>crypto.getRandomValues()</code> method if available. If this cannot be found, it falls back to a Fortuna-based PRNG algorithm.",t.infoURL="https://wikipedia.org/wiki/Pseudorandom_number_generator",t.inputType="string",t.outputType="string",t.args=[{name:"Number of bytes",type:"number",value:32},{name:"Output as",type:"option",value:["Hex","Integer","Byte array","Raw"]}],t}return c(r,t),i(r,[{key:"run",value:function(e,t){var r,n=se(t,2),i=n[0],a=n[1];if(N()&&self.crypto){r=new ArrayBuffer(i);for(var s=0;s<i;s+=65536)self.crypto.getRandomValues(new Uint8Array(r,s,Math.min(i-s,65536)));r=O.arrayBufferToStr(r)}else r=lt().random.getBytesSync(i);var o,c=new ae(0);switch(a){case"Hex":return lt().util.bytesToHex(r);case"Integer":for(o=r.length-1;o>=0;o--)c=c.times(256).plus(r.charCodeAt(o));return c.toFixed();case"Byte array":return JSON.stringify(O.strToCharcode(r));default:return r}}}])}(tt);const xn=Bn;function Tn(e,t,r){return t=s(t),a(e,In()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function In(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(In=function(){return!!e})()}const Fn=function(t){function r(){var t;return e(this,r),(t=Tn(this,r)).name="RC2 Decrypt",t.module="Ciphers",t.description="RC2 (also known as ARC2) is a symmetric-key block cipher designed by Ron Rivest in 1987. 'RC' stands for 'Rivest Cipher'.<br><br><b>Key:</b> RC2 uses a variable size key.<br><br><b>IV:</b> To run the cipher in CBC mode, the Initialization Vector should be 8 bytes long. If the IV is left blank, the cipher will run in ECB mode.<br><br><b>Padding:</b> In both CBC and ECB mode, PKCS#7 padding will be used.",t.infoURL="https://wikipedia.org/wiki/RC2",t.inputType="string",t.outputType="string",t.args=[{name:"Key",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]},{name:"IV",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]},{name:"Input",type:"option",value:["Hex","Raw"]},{name:"Output",type:"option",value:["Raw","Hex"]}],t}return c(r,t),i(r,[{key:"run",value:function(e,t){var r=O.convertToByteString(t[0].string,t[0].option),n=O.convertToByteString(t[1].string,t[1].option),i=se(t,4),a=i[2],s=i[3],o=lt().rc2.createDecryptionCipher(r);return e=O.convertToByteString(e,a),o.start(n||null),o.update(lt().util.createBuffer(e)),o.finish(),"Hex"===s?o.output.toHex():o.output.getBytes()}}])}(tt);function kn(e,t,r){return t=s(t),a(e,Rn()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function Rn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Rn=function(){return!!e})()}const Dn=function(t){function r(){var t;return e(this,r),(t=kn(this,r)).name="RC2 Encrypt",t.module="Ciphers",t.description="RC2 (also known as ARC2) is a symmetric-key block cipher designed by Ron Rivest in 1987. 'RC' stands for 'Rivest Cipher'.<br><br><b>Key:</b> RC2 uses a variable size key.<br><br>You can generate a password-based key using one of the KDF operations.<br><br><b>IV:</b> To run the cipher in CBC mode, the Initialization Vector should be 8 bytes long. If the IV is left blank, the cipher will run in ECB mode.<br><br><b>Padding:</b> In both CBC and ECB mode, PKCS#7 padding will be used.",t.infoURL="https://wikipedia.org/wiki/RC2",t.inputType="string",t.outputType="string",t.args=[{name:"Key",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]},{name:"IV",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]},{name:"Input",type:"option",value:["Raw","Hex"]},{name:"Output",type:"option",value:["Hex","Raw"]}],t}return c(r,t),i(r,[{key:"run",value:function(e,t){var r=O.convertToByteString(t[0].string,t[0].option),n=O.convertToByteString(t[1].string,t[1].option),i=se(t,4),a=i[2],s=i[3],o=lt().rc2.createEncryptionCipher(r);return e=O.convertToByteString(e,a),o.start(n||null),o.update(lt().util.createBuffer(e)),o.finish(),"Hex"===s?o.output.toHex():o.output.getBytes()}}])}(tt);function _n(e,t,r){return t=s(t),a(e,Pn()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function Pn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Pn=function(){return!!e})()}const Nn=function(t){function r(){var t;return e(this,r),(t=_n(this,r)).name="RC4",t.module="Ciphers",t.description="RC4 (also known as ARC4) is a widely-used stream cipher designed by Ron Rivest. It is used in popular protocols such as SSL and WEP. Although remarkable for its simplicity and speed, the algorithm's history doesn't inspire confidence in its security.",t.infoURL="https://wikipedia.org/wiki/RC4",t.inputType="string",t.outputType="string",t.args=[{name:"Passphrase",type:"toggleString",value:"",toggleValues:["UTF8","UTF16","UTF16LE","UTF16BE","Latin1","Hex","Base64"]},{name:"Input format",type:"option",value:["Latin1","UTF8","UTF16","UTF16LE","UTF16BE","Hex","Base64"]},{name:"Output format",type:"option",value:["Latin1","UTF8","UTF16","UTF16LE","UTF16BE","Hex","Base64"]}],t}return c(r,t),i(r,[{key:"run",value:function(e,t){var r=Nt[t[1]].parse(e),n=Nt[t[0].option].parse(t[0].string);return Dt().RC4.encrypt(r,n).ciphertext.toString(Nt[t[2]])}},{key:"highlight",value:function(e,t){return e}},{key:"highlightReverse",value:function(e,t){return e}}])}(tt);function On(e,t,r){return t=s(t),a(e,Ln()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function Ln(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ln=function(){return!!e})()}const Un=function(t){function r(){var t;return e(this,r),(t=On(this,r)).name="RC4 Drop",t.module="Ciphers",t.description="It was discovered that the first few bytes of the RC4 keystream are strongly non-random and leak information about the key. We can defend against this attack by discarding the initial portion of the keystream. This modified algorithm is traditionally called RC4-drop.",t.infoURL="https://wikipedia.org/wiki/RC4#Fluhrer,_Mantin_and_Shamir_attack",t.inputType="string",t.outputType="string",t.args=[{name:"Passphrase",type:"toggleString",value:"",toggleValues:["UTF8","UTF16","UTF16LE","UTF16BE","Latin1","Hex","Base64"]},{name:"Input format",type:"option",value:["Latin1","UTF8","UTF16","UTF16LE","UTF16BE","Hex","Base64"]},{name:"Output format",type:"option",value:["Latin1","UTF8","UTF16","UTF16LE","UTF16BE","Hex","Base64"]},{name:"Number of dwords to drop",type:"number",value:192}],t}return c(r,t),i(r,[{key:"run",value:function(e,t){var r=Nt[t[1]].parse(e),n=Nt[t[0].option].parse(t[0].string),i=t[3];return Dt().RC4Drop.encrypt(r,n,{drop:i}).ciphertext.toString(Nt[t[2]])}},{key:"highlight",value:function(e,t){return e}},{key:"highlightReverse",value:function(e,t){return e}}])}(tt);var Kn={"SHA-1":lt().md.sha1,MD5:lt().md.md5,"SHA-256":lt().md.sha256,"SHA-384":lt().md.sha384,"SHA-512":lt().md.sha512};function Mn(e,t,r){return t=s(t),a(e,Hn()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function Hn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Hn=function(){return!!e})()}const jn=function(t){function r(){var t;return e(this,r),(t=Mn(this,r)).name="RSA Decrypt",t.module="Ciphers",t.description="Decrypt an RSA encrypted message with a PEM encoded private key.",t.infoURL="https://wikipedia.org/wiki/RSA_(cryptosystem)",t.inputType="string",t.outputType="string",t.args=[{name:"RSA Private Key (PEM)",type:"text",value:"-----BEGIN RSA PRIVATE KEY-----"},{name:"Key Password",type:"text",value:""},{name:"Encryption Scheme",type:"argSelector",value:[{name:"RSA-OAEP",on:[3]},{name:"RSAES-PKCS1-V1_5",off:[3]},{name:"RAW",off:[3]}]},{name:"Message Digest Algorithm",type:"option",value:Object.keys(Kn)}],t}return c(r,t),i(r,[{key:"run",value:function(e,t){var r=se(t,4),n=r[0],i=r[1],a=r[2],s=r[3];if(0===n.replace("-----BEGIN RSA PRIVATE KEY-----","").length)throw new E("Please enter a private key.");try{var o=lt().pki.decryptRsaPrivateKey(n,i).decrypt(e,a,{md:Kn[s].create()});return lt().util.decodeUtf8(o)}catch(e){throw new E(e)}}}])}(tt);function Vn(e,t,r){return t=s(t),a(e,Gn()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function Gn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Gn=function(){return!!e})()}const qn=function(t){function r(){var t;return e(this,r),(t=Vn(this,r)).name="RSA Encrypt",t.module="Ciphers",t.description="Encrypt a message with a PEM encoded RSA public key.",t.infoURL="https://wikipedia.org/wiki/RSA_(cryptosystem)",t.inputType="string",t.outputType="string",t.args=[{name:"RSA Public Key (PEM)",type:"text",value:"-----BEGIN RSA PUBLIC KEY-----"},{name:"Encryption Scheme",type:"argSelector",value:[{name:"RSA-OAEP",on:[2]},{name:"RSAES-PKCS1-V1_5",off:[2]},{name:"RAW",off:[2]}]},{name:"Message Digest Algorithm",type:"option",value:Object.keys(Kn)}],t}return c(r,t),i(r,[{key:"run",value:function(e,t){var r=se(t,3),n=r[0],i=r[1],a=r[2];if(0===n.replace("-----BEGIN RSA PUBLIC KEY-----","").length)throw new E("Please enter a public key.");try{var s=lt().pki.publicKeyFromPem(n),o=lt().util.encodeUtf8(e);return s.encrypt(o,i,{md:Kn[a].create()})}catch(e){if("RSAES-OAEP input message length is too long."===e.message)throw new E(`RSAES-OAEP input message length (${e.length}) is longer than the maximum allowed length (${e.maxLength}).`);throw new E(e)}}}])}(tt);function zn(e,t,r){return t=s(t),a(e,Wn()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function Wn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Wn=function(){return!!e})()}const Xn=function(t){function r(){var t;return e(this,r),(t=zn(this,r)).name="RSA Sign",t.module="Ciphers",t.description="Sign a plaintext message with a PEM encoded RSA key.",t.infoURL="https://wikipedia.org/wiki/RSA_(cryptosystem)",t.inputType="string",t.outputType="string",t.args=[{name:"RSA Private Key (PEM)",type:"text",value:"-----BEGIN RSA PRIVATE KEY-----"},{name:"Key Password",type:"text",value:""},{name:"Message Digest Algorithm",type:"option",value:Object.keys(Kn)}],t}return c(r,t),i(r,[{key:"run",value:function(e,t){var r=se(t,3),n=r[0],i=r[1],a=r[2];if(0===n.replace("-----BEGIN RSA PRIVATE KEY-----","").length)throw new E("Please enter a private key.");try{var s=lt().pki.decryptRsaPrivateKey(n,i),o=Kn[a].create();return o.update(e,"raw"),s.sign(o)}catch(e){throw new E(e)}}}])}(tt);function Yn(e,t,r){return t=s(t),a(e,Jn()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function Jn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Jn=function(){return!!e})()}var Qn=function(t){function r(){var t;return e(this,r),(t=Yn(this,r)).name="RSA Verify",t.module="Ciphers",t.description="Verify a message against a signature and a public PEM encoded RSA key.",t.infoURL="https://wikipedia.org/wiki/RSA_(cryptosystem)",t.inputType="string",t.outputType="string",t.args=[{name:"RSA Public Key (PEM)",type:"text",value:"-----BEGIN RSA PUBLIC KEY-----"},{name:"Message",type:"text",value:""},{name:"Message format",type:"option",value:["Raw","Hex","Base64"]},{name:"Message Digest Algorithm",type:"option",value:Object.keys(Kn)}],t}return c(r,t),i(r,[{key:"run",value:function(e,t){var r=se(t,4),n=r[0],i=r[1],a=r[2],s=r[3];if(0===n.replace("-----BEGIN RSA PUBLIC KEY-----","").length)throw new E("Please enter a public key.");try{var o=lt().pki.publicKeyFromPem(n),c=Kn[s].create(),u=O.convertToByteString(i,a);return c.update(u,"raw"),o.verify(c.digest().bytes(),e)?"Verified OK":"Verification Failure"}catch(e){if("Encrypted message length is invalid."===e.message)throw new E(`Signature length (${e.length}) does not match expected length based on key (${e.expected}).`);throw new E(e)}}}])}(tt);const Zn=Qn;function $n(e,t,r){return t=s(t),a(e,ei()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function ei(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ei=function(){return!!e})()}var ti=function(t){function r(){var t;return e(this,r),(t=$n(this,r)).name="Rabbit",t.module="Ciphers",t.description="Rabbit is a high-speed stream cipher introduced in 2003 and defined in RFC 4503.<br><br>The cipher uses a 128-bit key and an optional 64-bit initialization vector (IV).<br><br>big-endian: based on RFC4503 and RFC3447<br>little-endian: compatible with Crypto++",t.infoURL="https://wikipedia.org/wiki/Rabbit_(cipher)",t.inputType="string",t.outputType="string",t.args=[{name:"Key",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]},{name:"IV",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]},{name:"Endianness",type:"option",value:["Big","Little"]},{name:"Input",type:"option",value:["Raw","Hex"]},{name:"Output",type:"option",value:["Raw","Hex"]}],t}return c(r,t),i(r,[{key:"run",value:function(e,t){var r=O.convertToByteArray(t[0].string,t[0].option),n=O.convertToByteArray(t[1].string,t[1].option),i=t[2],a=t[3],s=t[4],o="Little"===i;if(16!==r.length)throw new E(`Invalid key length: ${r.length} bytes (expected: 16)`);if(0!==n.length&&8!==n.length)throw new E(`Invalid IV length: ${n.length} bytes (expected: 0 or 8)`);var c=new Uint32Array(8),u=new Uint32Array(8),f=0,h=[1295307597,3545052371,886263092,1295307597,3545052371,886263092,1295307597,3545052371],l=function(){for(var e=0;e<8;e++){var t=u[e]+h[e]+f;f=t/(4*(1<<30))>>>0,u[e]=t}},d=function(e,t){return e<<t|e>>>32-t},p=function(e,t,r){return e+d(t,16)+d(r,16)},g=function(e,t,r){return e+d(t,8)+r},y=new Uint32Array(8),v=function(){for(var e=0;e<8;e++)y[e]=(void 0,void 0,void 0,void 0,void 0,(a=(n=65535&(t=c[e]+u[e]>>>0))*n+65536*(65535&(i=2*(r=t>>>16)*n)))>>>0^r*r+(i/65536>>>0)+(a/(4*(1<<30))>>>0));var t,r,n,i,a;c[0]=p(y[0],y[7],y[6]),c[1]=g(y[1],y[0],y[7]),c[2]=p(y[2],y[1],y[0]),c[3]=g(y[3],y[2],y[1]),c[4]=p(y[4],y[3],y[2]),c[5]=g(y[5],y[4],y[3]),c[6]=p(y[6],y[5],y[4]),c[7]=g(y[7],y[6],y[5])},m=new Uint16Array(8);if(o)for(var b=0;b<8;b++)m[b]=r[1+2*b]<<8|r[2*b];else for(var w=0;w<8;w++)m[w]=r[14-2*w]<<8|r[15-2*w];for(var S=0;S<8;S++)S%2==0?(c[S]=m[(S+1)%8]<<16|m[S],u[S]=m[(S+4)%8]<<16|m[(S+5)%8]):(c[S]=m[(S+5)%8]<<16|m[(S+4)%8],u[S]=m[S]<<16|m[(S+1)%8]);for(var C=0;C<4;C++)l(),v();for(var A=0;A<8;A++)u[A]=u[A]^c[(A+4)%8];if(8===n.length){var B=function(e,t,r,i){return o?n[e]<<24|n[t]<<16|n[r]<<8|n[i]:n[7-e]<<24|n[7-t]<<16|n[7-r]<<8|n[7-i]};u[0]=u[0]^B(3,2,1,0),u[1]=u[1]^B(7,6,3,2),u[2]=u[2]^B(7,6,5,4),u[3]=u[3]^B(5,4,1,0),u[4]=u[4]^B(3,2,1,0),u[5]=u[5]^B(7,6,3,2),u[6]=u[6]^B(7,6,5,4),u[7]=u[7]^B(5,4,1,0);for(var T=0;T<4;T++)l(),v()}for(var I=new Uint8Array(16),F=function(){var e=0,t=function(t){I[e++]=t>>>8,I[e++]=255&t};if(l(),v(),t(c[6]>>>16^65535&c[1]),t(65535&c[6]^c[3]>>>16),t(c[4]>>>16^65535&c[7]),t(65535&c[4]^c[1]>>>16),t(c[2]>>>16^65535&c[5]),t(65535&c[2]^c[7]>>>16),t(c[0]>>>16^65535&c[3]),t(65535&c[0]^c[5]>>>16),o)for(var r=0,n=I.length-1;r<n;){var i=I[r];I[r]=I[n],I[n]=i,r++,n--}},k=O.convertToByteString(e,a),R=new Uint8Array(k.length),D=0;D<=k.length-16;D+=16){F();for(var _=0;_<16;_++)R[D+_]=k.charCodeAt(D+_)^I[_]}if(k.length%16!=0){var P=k.length-k.length%16,N=k.length-P;if(F(),o)for(var L=0;L<N;L++)R[P+L]=k.charCodeAt(P+L)^I[L];else for(var U=0;U<N;U++)R[P+U]=k.charCodeAt(P+U)^I[16-N+U]}return"Hex"===s?x(R):O.byteArrayToChars(R)}}])}(tt);const ri=ti;function ni(e,t,r){return t=s(t),a(e,ii()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function ii(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ii=function(){return!!e})()}const ai=function(t){function r(){var t;return e(this,r),(t=ni(this,r)).name="Rail Fence Cipher Decode",t.module="Ciphers",t.description="Decodes Strings that were created using the Rail fence Cipher provided a key and an offset",t.infoURL="https://wikipedia.org/wiki/Rail_fence_cipher",t.inputType="string",t.outputType="string",t.args=[{name:"Key",type:"number",value:2},{name:"Offset",type:"number",value:0}],t}return c(r,t),i(r,[{key:"run",value:function(e,t){var r=se(t,2),n=r[0],i=r[1],a=e;if(n<2)throw new E("Key has to be bigger than 2");if(n>a.length)throw new E("Key should be smaller than the cipher's length");if(i<0)throw new E("Offset has to be a positive integer");var s,o,c=2*(n-1),u=new Array(a.length),f=0;for(o=0;o<n;o++)for(s=0;s<a.length;s++)(o+s+i)%c!=0&&(o-s-i)%c!=0||(u[s]=a[f++]);return u.join("").trim()}}])}(tt);function si(e,t,r){return t=s(t),a(e,oi()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function oi(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(oi=function(){return!!e})()}const ci=function(t){function r(){var t;return e(this,r),(t=si(this,r)).name="Rail Fence Cipher Encode",t.module="Ciphers",t.description="Encodes Strings using the Rail fence Cipher provided a key and an offset",t.infoURL="https://wikipedia.org/wiki/Rail_fence_cipher",t.inputType="string",t.outputType="string",t.args=[{name:"Key",type:"number",value:2},{name:"Offset",type:"number",value:0}],t}return c(r,t),i(r,[{key:"run",value:function(e,t){var r=se(t,2),n=r[0],i=r[1],a=e;if(n<2)throw new E("Key has to be bigger than 2");if(n>a.length)throw new E("Key should be smaller than the plain text's length");if(i<0)throw new E("Offset has to be a positive integer");for(var s=2*(n-1),o=new Array(n).fill(""),c=0;c<a.length;c++)o[n-1-Math.abs(s/2-(c+i)%s)]+=a[c];return o.join("").trim()}}])}(tt);var ui=16,fi=[214,144,233,254,204,225,61,183,22,182,20,194,40,251,44,5,43,103,154,118,42,190,4,195,170,68,19,38,73,134,6,153,156,66,80,244,145,239,152,122,51,84,11,67,237,207,172,98,228,179,28,169,201,8,232,149,128,223,148,250,117,143,63,166,71,7,167,252,243,115,23,186,131,89,60,25,230,133,79,168,104,107,129,178,113,100,218,139,248,235,15,75,112,86,157,53,30,36,14,94,99,88,209,162,37,34,124,59,1,33,120,135,212,0,70,87,159,211,39,82,76,54,2,231,160,196,200,158,234,191,138,210,64,199,56,181,163,247,242,206,249,97,21,161,224,174,93,164,155,52,26,85,173,147,50,48,245,140,177,227,29,246,226,46,130,102,202,96,192,41,35,171,13,83,78,111,213,219,55,69,222,253,142,47,3,255,106,114,109,108,91,81,141,27,175,146,187,221,188,127,17,217,92,65,31,16,90,216,10,193,49,136,165,205,123,189,45,116,208,18,184,229,180,176,137,105,151,74,12,150,119,126,101,185,241,9,197,110,198,132,24,240,125,236,58,220,77,32,121,238,95,62,215,203,57,72],hi=[462357,472066609,943670861,1415275113,1886879365,2358483617,2830087869,3301692121,3773296373,4228057617,404694573,876298825,1347903077,1819507329,2291111581,2762715833,3234320085,3705924337,4177462797,337322537,808926789,1280531041,1752135293,2223739545,2695343797,3166948049,3638552301,4110090761,269950501,741554753,1213159005,1684763257],li=[2746333894,1453994832,1736282519,2993693404];function di(e,t){return e<<t|e>>>32-t}function pi(e){for(var t,r=e.map((function(e,t){return e^li[t]})),n=[],i=0;i<32;i++)n[i]=r[i+4]=r[i]^(t=r[i+1]^r[i+2]^r[i+3]^hi[i],(t=fi[t>>>24&255]<<24|fi[t>>>16&255]<<16|fi[t>>>8&255]<<8|fi[255&t])^di(t,13)^di(t,23));return n}function gi(e,t){for(var r=0;r<32;r++)e[r+4]=e[r]^(n=e[r+1]^e[r+2]^e[r+3]^t[r],(n=fi[n>>>24&255]<<24|fi[n>>>16&255]<<16|fi[n>>>8&255]<<8|fi[255&n])^di(n,2)^di(n,10)^di(n,18)^di(n,24));var n;return[e[35],e[34],e[33],e[32]]}function yi(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return[e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3],e[t+=4]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3],e[t+=4]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3],e[t+=4]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3]]}function vi(e){for(var t=[],r=0;r<e.length;r++)t.push(e[r]>>24&255),t.push(e[r]>>16&255),t.push(e[r]>>8&255),t.push(255&e[r]);return t}function mi(e,t,r){return t=s(t),a(e,bi()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function bi(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(bi=function(){return!!e})()}var wi=function(t){function r(){var t;return e(this,r),(t=mi(this,r)).name="SM4 Decrypt",t.module="Ciphers",t.description="SM4 is a 128-bit block cipher, currently established as a national standard (GB/T 32907-2016) of China.",t.infoURL="https://wikipedia.org/wiki/SM4_(cipher)",t.inputType="string",t.outputType="string",t.args=[{name:"Key",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]},{name:"IV",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]},{name:"Mode",type:"option",value:["CBC","CFB","OFB","CTR","ECB","CBC/NoPadding","ECB/NoPadding"]},{name:"Input",type:"option",value:["Raw","Hex"]},{name:"Output",type:"option",value:["Hex","Raw"]}],t}return c(r,t),i(r,[{key:"run",value:function(e,t){var r=O.convertToByteArray(t[0].string,t[0].option),n=O.convertToByteArray(t[1].string,t[1].option),i=se(t,5),a=i[2],s=i[3],o=i[4];if(16!==r.length)throw new E(`Invalid key length: ${r.length} bytes\n\nSM4 uses a key length of 16 bytes (128 bits).`);if(16!==n.length&&!a.startsWith("ECB"))throw new E(`Invalid IV length: ${n.length} bytes\n\nSM4 uses an IV length of 16 bytes (128 bits).\nMake sure you have specified the type correctly (e.g. Hex vs UTF8).`);var c=function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"ECB",i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],a=e.length;if(0===a)return[];var s=pi(yi(t,0));if("ECB"===n||"CBC"===n){if(s=s.reverse(),15&a&&!i)throw new E(`With ECB or CBC modes, the input must be divisible into 16 byte blocks. (${15&e.length} bytes extra)`)}else for(;15&e.length;)e.push(0);var o=[];switch(n){case"ECB":for(var c=0;c<e.length;c+=ui)Array.prototype.push.apply(o,vi(gi(yi(e,c),s)));break;case"CBC":r=yi(r,0);for(var u=0;u<e.length;u+=ui){var f=gi(yi(e,u),s);f[0]^=r[0],f[1]^=r[1],f[2]^=r[2],f[3]^=r[3],Array.prototype.push.apply(o,vi(f)),r=yi(e,u)}break;case"CFB":r=yi(r,0);for(var h=0;h<e.length;h+=ui){r=gi(r,s);var l=yi(e,h);l[0]^=r[0],l[1]^=r[1],l[2]^=r[2],l[3]^=r[3],Array.prototype.push.apply(o,vi(l)),r=yi(e,h)}break;case"OFB":r=yi(r,0);for(var d=0;d<e.length;d+=ui){r=gi(r,s);var p=yi(e,d);p[0]^=r[0],p[1]^=r[1],p[2]^=r[2],p[3]^=r[3],Array.prototype.push.apply(o,vi(p))}break;case"CTR":r=yi(r,0);for(var y=0;y<e.length;y+=ui){var v=g(r);v[3]+=y>>4,v=gi(v,s);var m=yi(e,y);m[0]^=v[0],m[1]^=v[1],m[2]^=v[2],m[3]^=v[3],Array.prototype.push.apply(o,vi(m))}break;default:throw new E(`Invalid block cipher mode: ${n}`)}if("ECB"===n||"CBC"===n){if(i)return o;var b=o[o.length-1];if(b>16)throw new E("Invalid PKCS#7 padding.");for(var w=0;w<b;w++)if(o[o.length-w-1]!==b)throw new E("Invalid PKCS#7 padding.");return o.slice(0,o.length-b)}return o.slice(0,a)}(e=O.convertToByteArray(e,s),r,n,a.substring(0,3),a.endsWith("NoPadding"));return"Hex"===o?B(c):O.byteArrayToUtf8(c)}}])}(tt);const Si=wi;function Ei(e,t,r){return t=s(t),a(e,Ci()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function Ci(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ci=function(){return!!e})()}var Ai=function(t){function r(){var t;return e(this,r),(t=Ei(this,r)).name="SM4 Encrypt",t.module="Ciphers",t.description="SM4 is a 128-bit block cipher, currently established as a national standard (GB/T 32907-2016) of China. Multiple block cipher modes are supported. When using CBC or ECB mode, the PKCS#7 padding scheme is used.",t.infoURL="https://wikipedia.org/wiki/SM4_(cipher)",t.inputType="string",t.outputType="string",t.args=[{name:"Key",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]},{name:"IV",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]},{name:"Mode",type:"option",value:["CBC","CFB","OFB","CTR","ECB"]},{name:"Input",type:"option",value:["Raw","Hex"]},{name:"Output",type:"option",value:["Hex","Raw"]}],t}return c(r,t),i(r,[{key:"run",value:function(e,t){var r=O.convertToByteArray(t[0].string,t[0].option),n=O.convertToByteArray(t[1].string,t[1].option),i=se(t,5),a=i[2],s=i[3],o=i[4];if(16!==r.length)throw new E(`Invalid key length: ${r.length} bytes\n\nSM4 uses a key length of 16 bytes (128 bits).`);if(16!==n.length&&!a.startsWith("ECB"))throw new E(`Invalid IV length: ${n.length} bytes\n\nSM4 uses an IV length of 16 bytes (128 bits).\nMake sure you have specified the type correctly (e.g. Hex vs UTF8).`);var c=function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"ECB",i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],a=e.length;if(0===a)return[];var s=pi(yi(t,0)),o=0,c=16-(15&e.length);if("ECB"===n||"CBC"===n)if(i){if(16!==c)throw new E(`No padding requested in ${n} mode but input is not a 16-byte multiple.`);c=0}else o=c;for(var u=0;u<c;u++)e.push(o);var f=[];switch(n){case"ECB":for(var h=0;h<e.length;h+=ui)Array.prototype.push.apply(f,vi(gi(yi(e,h),s)));break;case"CBC":r=yi(r,0);for(var l=0;l<e.length;l+=ui){var d=yi(e,l);d[0]^=r[0],d[1]^=r[1],d[2]^=r[2],d[3]^=r[3],r=gi(d,s),Array.prototype.push.apply(f,vi(r))}break;case"CFB":r=yi(r,0);for(var p=0;p<e.length;p+=ui){r=gi(r,s);var y=yi(e,p);y[0]^=r[0],y[1]^=r[1],y[2]^=r[2],y[3]^=r[3],Array.prototype.push.apply(f,vi(y)),r=y}break;case"OFB":r=yi(r,0);for(var v=0;v<e.length;v+=ui){r=gi(r,s);var m=yi(e,v);m[0]^=r[0],m[1]^=r[1],m[2]^=r[2],m[3]^=r[3],Array.prototype.push.apply(f,vi(m))}break;case"CTR":r=yi(r,0);for(var b=0;b<e.length;b+=ui){var w=g(r);w[3]+=b>>4,w=gi(w,s);var S=yi(e,b);S[0]^=w[0],S[1]^=w[1],S[2]^=w[2],S[3]^=w[3],Array.prototype.push.apply(f,vi(S))}break;default:throw new E("Invalid block cipher mode: "+n)}return"ECB"!==n&&"CBC"!==n?f.slice(0,a):f}(e=O.convertToByteArray(e,s),r,n,a.substring(0,3),a.endsWith("NoPadding"));return"Hex"===o?B(c):O.byteArrayToUtf8(c)}}])}(tt);const Bi=Ai;function xi(e,t){function r(e,t){return e<<t&4294967295|e>>>32-t}function n(e,t,n,i,a){e[n]^=r(e[t]+e[a]&4294967295,7),e[i]^=r(e[n]+e[t]&4294967295,9),e[a]^=r(e[i]+e[n]&4294967295,13),e[t]^=r(e[a]+e[i]&4294967295,18)}for(var i=0;i<t/2;i++)n(e,0,4,8,12),n(e,5,9,13,1),n(e,10,14,2,6),n(e,15,3,7,11),n(e,0,1,2,3),n(e,5,6,7,4),n(e,10,11,8,9),n(e,15,12,13,14)}function Ti(e,t,r,n){var i,a;16===e.length?(a=O.strToByteArray("expand 16-byte k"),e=e.concat(e)):a=O.strToByteArray("expand 32-byte k"),i=(i=(i=(i=(i=(i=(i=(i=a.slice(0,4)).concat(e.slice(0,16))).concat(a.slice(4,8))).concat(t)).concat(r)).concat(a.slice(8,12))).concat(e.slice(16,32))).concat(a.slice(12,16));for(var s=Array(),o=0;o<64;o+=4)s.push(O.byteArrayToInt(i.slice(o,o+4),"little"));var c=[].concat(s);xi(s,n);for(var u=0;u<16;u++)s[u]=s[u]+c[u]&4294967295;for(var f=Array(),h=0;h<16;h++)f=f.concat(O.intToByteArray(s[h],4,"little"));return f}function Ii(e,t,r){return t=s(t),a(e,Fi()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function Fi(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Fi=function(){return!!e})()}var ki=function(t){function r(){var t;return e(this,r),(t=Ii(this,r)).name="Salsa20",t.module="Ciphers",t.description="Salsa20 is a stream cipher designed by Daniel J. Bernstein and submitted to the eSTREAM project; Salsa20/8 and Salsa20/12 are round-reduced variants. It is closely related to the ChaCha stream cipher.<br><br><b>Key:</b> Salsa20 uses a key of 16 or 32 bytes (128 or 256 bits).<br><br><b>Nonce:</b> Salsa20 uses a nonce of 8 bytes (64 bits).<br><br><b>Counter:</b> Salsa uses a counter of 8 bytes (64 bits). The counter starts at zero at the start of the keystream, and is incremented at every 64 bytes.",t.infoURL="https://wikipedia.org/wiki/Salsa20",t.inputType="string",t.outputType="string",t.args=[{name:"Key",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]},{name:"Nonce",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64","Integer"]},{name:"Counter",type:"number",value:0,min:0},{name:"Rounds",type:"option",value:["20","12","8"]},{name:"Input",type:"option",value:["Hex","Raw"]},{name:"Output",type:"option",value:["Raw","Hex"]}],t}return c(r,t),i(r,[{key:"run",value:function(e,t){var r,n,i=O.convertToByteArray(t[0].string,t[0].option),a=t[1].option,s=parseInt(t[3],10),o=t[4],c=t[5];if(16!==i.length&&32!==i.length)throw new E(`Invalid key length: ${i.length} bytes.\n\nSalsa20 uses a key of 16 or 32 bytes (128 or 256 bits).`);if("Integer"===a)n=O.intToByteArray(parseInt(t[1].string,10),8,"little");else if(8!==(n=O.convertToByteArray(t[1].string,t[1].option)).length)throw new E(`Invalid nonce length: ${n.length} bytes.\n\nSalsa20 uses a nonce of 8 bytes (64 bits).`);r=O.intToByteArray(t[2],8,"little");var u=[];e=O.convertToByteArray(e,o);for(var f=O.byteArrayToInt(r,"little"),h=0;h<e.length;h+=64){for(var l=Ti(i,n,r=O.intToByteArray(f,8,"little"),s),d=0;d<64&&h+d<e.length;d++)u.push(e[h+d]^l[d]);f++}return"Hex"===c?B(u):O.arrayBufferToStr(Uint8Array.from(u).buffer)}},{key:"highlight",value:function(e,t){var r=t[4],n=t[5];if("Raw"===r&&"Raw"===n)return e}},{key:"highlightReverse",value:function(e,t){var r=t[4],n=t[5];if("Raw"===r&&"Raw"===n)return e}}])}(tt);const Ri=ki;function Di(e,t,r){return t=s(t),a(e,_i()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function _i(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(_i=function(){return!!e})()}const Pi=function(t){function r(){var t;return e(this,r),(t=Di(this,r)).name="Triple DES Decrypt",t.module="Ciphers",t.description="Triple DES applies DES three times to each block to increase key size.<br><br><b>Key:</b> Triple DES uses a key length of 24 bytes (192 bits).<br>DES uses a key length of 8 bytes (64 bits).<br><br><b>IV:</b> The Initialization Vector should be 8 bytes long. If not entered, it will default to 8 null bytes.<br><br><b>Padding:</b> In CBC and ECB mode, PKCS#7 padding will be used as a default.",t.infoURL="https://wikipedia.org/wiki/Triple_DES",t.inputType="string",t.outputType="string",t.args=[{name:"Key",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]},{name:"IV",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]},{name:"Mode",type:"option",value:["CBC","CFB","OFB","CTR","ECB","CBC/NoPadding","ECB/NoPadding"]},{name:"Input",type:"option",value:["Hex","Raw"]},{name:"Output",type:"option",value:["Raw","Hex"]}],t}return c(r,t),i(r,[{key:"run",value:function(e,t){var r=O.convertToByteString(t[0].string,t[0].option),n=O.convertToByteArray(t[1].string,t[1].option),i=t[2].substring(0,3),a=t[2].endsWith("NoPadding"),s=t[3],o=t[4];if(24!==r.length&&16!==r.length)throw new E(`Invalid key length: ${r.length} bytes\n\nTriple DES uses a key length of 24 bytes (192 bits).\nDES uses a key length of 8 bytes (64 bits).`);if(8!==n.length&&"ECB"!==i)throw new E(`Invalid IV length: ${n.length} bytes\n\nTriple DES uses an IV length of 8 bytes (64 bits).\nMake sure you have specified the type correctly (e.g. Hex vs UTF8).`);e=O.convertToByteString(e,s);var c=lt().cipher.createDecipher("3DES-"+i,16===r.length?r+r.substring(0,8):r);if(a&&(c.mode.unpad=function(e,t){return!0}),c.start({iv:n}),c.update(lt().util.createBuffer(e)),c.finish())return"Hex"===o?c.output.toHex():c.output.getBytes();throw new E("Unable to decrypt input with these parameters.")}}])}(tt);function Ni(e,t,r){return t=s(t),a(e,Oi()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function Oi(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Oi=function(){return!!e})()}const Li=function(t){function r(){var t;return e(this,r),(t=Ni(this,r)).name="Triple DES Encrypt",t.module="Ciphers",t.description="Triple DES applies DES three times to each block to increase key size.<br><br><b>Key:</b> Triple DES uses a key length of 24 bytes (192 bits).<br>DES uses a key length of 8 bytes (64 bits).<br><br>You can generate a password-based key using one of the KDF operations.<br><br><b>IV:</b> The Initialization Vector should be 8 bytes long. If not entered, it will default to 8 null bytes.<br><br><b>Padding:</b> In CBC and ECB mode, PKCS#7 padding will be used.",t.infoURL="https://wikipedia.org/wiki/Triple_DES",t.inputType="string",t.outputType="string",t.args=[{name:"Key",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]},{name:"IV",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]},{name:"Mode",type:"option",value:["CBC","CFB","OFB","CTR","ECB"]},{name:"Input",type:"option",value:["Raw","Hex"]},{name:"Output",type:"option",value:["Hex","Raw"]}],t}return c(r,t),i(r,[{key:"run",value:function(e,t){var r=O.convertToByteString(t[0].string,t[0].option),n=O.convertToByteArray(t[1].string,t[1].option),i=t[2],a=t[3],s=t[4];if(24!==r.length&&16!==r.length)throw new E(`Invalid key length: ${r.length} bytes\n\nTriple DES uses a key length of 24 bytes (192 bits).\nDES uses a key length of 8 bytes (64 bits).`);if(8!==n.length&&"ECB"!==i)throw new E(`Invalid IV length: ${n.length} bytes\n\nTriple DES uses an IV length of 8 bytes (64 bits).\nMake sure you have specified the type correctly (e.g. Hex vs UTF8).`);e=O.convertToByteString(e,a);var o=lt().cipher.createCipher("3DES-"+i,16===r.length?r+r.substring(0,8):r);return o.start({iv:n}),o.update(lt().util.createBuffer(e)),o.finish(),"Hex"===s?o.output.toHex():o.output.getBytes()}}])}(tt);function Ui(e,t,r){return t=s(t),a(e,Ki()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function Ki(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ki=function(){return!!e})()}var Mi=function(t){function r(){var t;return e(this,r),(t=Ui(this,r)).name="Vigenère Decode",t.module="Ciphers",t.description="The Vigenere cipher is a method of encrypting alphabetic text by using a series of different Caesar ciphers based on the letters of a keyword. It is a simple form of polyalphabetic substitution.",t.infoURL="https://wikipedia.org/wiki/Vigenère_cipher",t.inputType="string",t.outputType="string",t.args=[{name:"Key",type:"string",value:""}],t}return c(r,t),i(r,[{key:"run",value:function(e,t){var r,n,i,a="abcdefghijklmnopqrstuvwxyz",s=t[0].toLowerCase(),o="",c=0;if(!s)throw new E("No key entered");if(!/^[a-zA-Z]+$/.test(s))throw new E("The key must consist only of letters");for(var u=0;u<e.length;u++)a.indexOf(e[u])>=0?(i=s[(u-c)%s.length],r=a.indexOf(i),n=a.indexOf(e[u]),o+=a[(n-r+26)%26]):a.indexOf(e[u].toLowerCase())>=0?(i=s[(u-c)%s.length].toLowerCase(),r=a.indexOf(i),n=a.indexOf(e[u].toLowerCase()),o+=a[(n+26-r)%26].toUpperCase()):(o+=e[u],c++);return o}},{key:"highlight",value:function(e,t){return e}},{key:"highlightReverse",value:function(e,t){return e}}])}(tt);const Hi=Mi;function ji(e,t,r){return t=s(t),a(e,Vi()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function Vi(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Vi=function(){return!!e})()}var Gi=function(t){function r(){var t;return e(this,r),(t=ji(this,r)).name="Vigenère Encode",t.module="Ciphers",t.description="The Vigenere cipher is a method of encrypting alphabetic text by using a series of different Caesar ciphers based on the letters of a keyword. It is a simple form of polyalphabetic substitution.",t.infoURL="https://wikipedia.org/wiki/Vigenère_cipher",t.inputType="string",t.outputType="string",t.args=[{name:"Key",type:"string",value:""}],t}return c(r,t),i(r,[{key:"run",value:function(e,t){var r,n,i,a="abcdefghijklmnopqrstuvwxyz",s=t[0].toLowerCase(),o="",c=0;if(!s)throw new E("No key entered");if(!/^[a-zA-Z]+$/.test(s))throw new E("The key must consist only of letters");for(var u=0;u<e.length;u++)a.indexOf(e[u])>=0?(i=s[(u-c)%s.length],r=a.indexOf(i),n=a.indexOf(e[u]),o+=a[(r+n)%26]):a.indexOf(e[u].toLowerCase())>=0?(i=s[(u-c)%s.length].toLowerCase(),r=a.indexOf(i),n=a.indexOf(e[u].toLowerCase()),o+=a[(r+n)%26].toUpperCase()):(o+=e[u],c++);return o}},{key:"highlight",value:function(e,t){return e}},{key:"highlightReverse",value:function(e,t){return e}}])}(tt);const qi=Gi;function zi(e,t,r){return t=s(t),a(e,Wi()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function Wi(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Wi=function(){return!!e})()}var Xi=function(t){function r(){var t;return e(this,r),(t=zi(this,r)).name="XSalsa20",t.module="Ciphers",t.description="XSalsa20 is a variant of the Salsa20 stream cipher designed by Daniel J. Bernstein; XSalsa uses longer nonces.<br><br><b>Key:</b> XSalsa20 uses a key of 16 or 32 bytes (128 or 256 bits).<br><br><b>Nonce:</b> XSalsa20 uses a nonce of 24 bytes (192 bits).<br><br><b>Counter:</b> XSalsa uses a counter of 8 bytes (64 bits). The counter starts at zero at the start of the keystream, and is incremented at every 64 bytes.",t.infoURL="https://en.wikipedia.org/wiki/Salsa20#XSalsa20_with_192-bit_nonce",t.inputType="string",t.outputType="string",t.args=[{name:"Key",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]},{name:"Nonce",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64","Integer"]},{name:"Counter",type:"number",value:0,min:0},{name:"Rounds",type:"option",value:["20","12","8"]},{name:"Input",type:"option",value:["Hex","Raw"]},{name:"Output",type:"option",value:["Raw","Hex"]}],t}return c(r,t),i(r,[{key:"run",value:function(e,t){var r,n,i=O.convertToByteArray(t[0].string,t[0].option),a=t[1].option,s=parseInt(t[3],10),o=t[4],c=t[5];if(16!==i.length&&32!==i.length)throw new E(`Invalid key length: ${i.length} bytes.\n\nXSalsa20 uses a key of 16 or 32 bytes (128 or 256 bits).`);if("Integer"===a)n=O.intToByteArray(parseInt(t[1].string,10),8,"little");else if(24!==(n=O.convertToByteArray(t[1].string,t[1].option)).length)throw new E(`Invalid nonce length: ${n.length} bytes.\n\nXSalsa20 uses a nonce of 24 bytes (192 bits).`);r=O.intToByteArray(t[2],8,"little");var u=function(e,t,r){var n,i;16===e.length?(i=O.strToByteArray("expand 16-byte k"),e=e.concat(e)):i=O.strToByteArray("expand 32-byte k"),n=(n=(n=(n=(n=(n=(n=i.slice(0,4)).concat(e.slice(0,16))).concat(i.slice(4,8))).concat(t)).concat(i.slice(8,12))).concat(e.slice(16,32))).concat(i.slice(12,16));for(var a=Array(),s=0;s<64;s+=4)a.push(O.byteArrayToInt(n.slice(s,s+4),"little"));xi(a,r);for(var o=Array(),c=[0,5,10,15,6,7,8,9],u=0;u<8;u++)o=o.concat(O.intToByteArray(a[c[u]],4,"little"));return o}(i,n.slice(0,16),s),f=[];e=O.convertToByteArray(e,o);for(var h=O.byteArrayToInt(r,"little"),l=0;l<e.length;l+=64){r=O.intToByteArray(h,8,"little");for(var d=Ti(u,n.slice(16,24),r,s),p=0;p<64&&l+p<e.length;p++)f.push(e[l+p]^d[p]);h++}return"Hex"===c?B(f):O.arrayBufferToStr(Uint8Array.from(f).buffer)}},{key:"highlight",value:function(e,t){var r=t[4],n=t[5];if("Raw"===r&&"Raw"===n)return e}},{key:"highlightReverse",value:function(e,t){var r=t[4],n=t[5];if("Raw"===r&&"Raw"===n)return e}}])}(tt);const Yi=Xi;var Ji=2654435769;function Qi(e,t){var r=e.length,n=r<<2;if(t){var i=e[r-1];if(i<(n-=4)-3||i>n)return null;n=i}for(var a=new Uint8Array(n),s=0;s<n;s++)a[s]=e[s>>2]>>((3&s)<<3);return a}function Zi(e,t){var r,n=e.length,i=n>>2;3&n&&++i,t?(r=new Uint32Array(i+1))[i]=n:r=new Uint32Array(i);for(var a=0;a<n;++a)r[a>>2]|=e[a]<<((3&a)<<3);return r}function $i(e){return 4294967295&e}function ea(e,t,r,n,i,a){return(r>>>5^t<<2)+(t>>>3^r<<4)^(e^t)+(a[3&n^i]^r)}function ta(e){if(e.length<16){var t=new Uint8Array(16);return t.set(e),t}return e}function ra(e,t,r){return t=s(t),a(e,na()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function na(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(na=function(){return!!e})()}const ia=function(t){function r(){var t;return e(this,r),(t=ra(this,r)).name="XXTEA Decrypt",t.module="Ciphers",t.description="Corrected Block TEA (often referred to as XXTEA) is a block cipher designed to correct weaknesses in the original Block TEA. XXTEA operates on variable-length blocks that are some arbitrary multiple of 32 bits in size (minimum 64 bits). The number of full cycles depends on the block size, but there are at least six (rising to 32 for small block sizes). The original Block TEA applies the XTEA round function to each word in the block and combines it additively with its leftmost neighbour. Slow diffusion rate of the decryption process was immediately exploited to break the cipher. Corrected Block TEA uses a more involved round function which makes use of both immediate neighbours in processing each word in the block.",t.infoURL="https://wikipedia.org/wiki/XXTEA",t.inputType="ArrayBuffer",t.outputType="ArrayBuffer",t.args=[{name:"Key",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]}],t}return c(r,t),i(r,[{key:"run",value:function(e,t){var r=new Uint8Array(O.convertToByteArray(t[0].string,t[0].option));try{return function(e,t){return null==e||0===e.length?e:Qi(function(e,t){var r,n,i,a,s,o=e.length,c=o-1;for(r=e[0],i=$i(Math.floor(6+52/o)*Ji);0!==i;i=$i(i-Ji)){for(a=i>>>2&3,s=c;s>0;--s)n=e[s-1],r=e[s]=$i(e[s]-ea(i,r,n,s,a,t));n=e[c],r=e[0]=$i(e[0]-ea(i,r,n,0,a,t))}return e}(Zi(e,!1),Zi(ta(t),!1)),!0)}(new Uint8Array(e),r).buffer}catch(e){throw new E("Unable to decrypt using this key")}}}])}(tt);function aa(e,t,r){return t=s(t),a(e,sa()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function sa(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(sa=function(){return!!e})()}const oa=function(t){function r(){var t;return e(this,r),(t=aa(this,r)).name="XXTEA Encrypt",t.module="Ciphers",t.description="Corrected Block TEA (often referred to as XXTEA) is a block cipher designed to correct weaknesses in the original Block TEA. XXTEA operates on variable-length blocks that are some arbitrary multiple of 32 bits in size (minimum 64 bits). The number of full cycles depends on the block size, but there are at least six (rising to 32 for small block sizes). The original Block TEA applies the XTEA round function to each word in the block and combines it additively with its leftmost neighbour. Slow diffusion rate of the decryption process was immediately exploited to break the cipher. Corrected Block TEA uses a more involved round function which makes use of both immediate neighbours in processing each word in the block.",t.infoURL="https://wikipedia.org/wiki/XXTEA",t.inputType="ArrayBuffer",t.outputType="ArrayBuffer",t.args=[{name:"Key",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]}],t}return c(r,t),i(r,[{key:"run",value:function(e,t){var r=new Uint8Array(O.convertToByteArray(t[0].string,t[0].option));return function(e,t){return null==e||0===e.length?e:Qi(function(e,t){var r,n,i,a,s,o,c=e.length,u=c-1;for(n=e[u],i=0,o=0|Math.floor(6+52/c);o>0;--o){for(a=(i=$i(i+Ji))>>>2&3,s=0;s<u;++s)r=e[s+1],n=e[s]=$i(e[s]+ea(i,r,n,s,a,t));r=e[0],n=e[u]=$i(e[u]+ea(i,r,n,u,a,t))}return e}(Zi(e,!0),Zi(ta(t),!1)),!1)}(new Uint8Array(e),r).buffer}}])}(tt);("undefined"==typeof self?{}:self.OpModules||{}).Ciphers={"A1Z26 Cipher Decode":st,"A1Z26 Cipher Encode":ft,"AES Decrypt":gt,"AES Encrypt":mt,"AES Key Unwrap":Et,"AES Key Wrap":xt,"Affine Cipher Decode":kt,"Affine Cipher Encode":Ut,"Atbash Cipher":Ht,"Bifid Cipher Decode":qt,"Bifid Cipher Encode":Yt,"Blowfish Decrypt":sr,"Blowfish Encrypt":ur,"Caesar Box Cipher":dr,"Cetacean Cipher Decode":mr,"Cetacean Cipher Encode":Er,ChaCha:Tr,"DES Decrypt":kr,"DES Encrypt":_r,"Derive EVP key":Or,"Derive PBKDF2 key":Kr,"ECDSA Sign":Vr,"ECDSA Signature Conversion":zr,"ECDSA Verify":Yr,"GOST Decrypt":$r,"GOST Encrypt":rn,"GOST Key Unwrap":sn,"GOST Key Wrap":un,"GOST Sign":ln,"GOST Verify":gn,"Generate ECDSA Key Pair":bn,"Generate RSA Key Pair":En,"Pseudo-Random Number Generator":xn,"RC2 Decrypt":Fn,"RC2 Encrypt":Dn,RC4:Nn,"RC4 Drop":Un,"RSA Decrypt":jn,"RSA Encrypt":qn,"RSA Sign":Xn,"RSA Verify":Zn,Rabbit:ri,"Rail Fence Cipher Decode":ai,"Rail Fence Cipher Encode":ci,"SM4 Decrypt":Si,"SM4 Encrypt":Bi,Salsa20:Ri,"Triple DES Decrypt":Pi,"Triple DES Encrypt":Li,"Vigenère Decode":Hi,"Vigenère Encode":qi,XSalsa20:Yi,"XXTEA Decrypt":ia,"XXTEA Encrypt":oa}})()})(); |