@certd/plugin-cert 1.20.9 → 1.20.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/bundle.js CHANGED
@@ -1 +1 @@
1
- "use strict";var e=require("@certd/pipeline"),t=require("dayjs"),r=require("@certd/acme-client"),n=require("lodash"),i=require("fs"),a=require("os"),s=require("crypto"),o=require("path"),u=require("stream"),c=require("events"),l=require("buffer"),h=require("util");function f(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var d=f(r);function p(e,t,r,n){var i,a=arguments.length,s=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var o=e.length-1;o>=0;o--)(i=e[o])&&(s=(a<3?i(s):a>3?i(t,r,s):i(t,r))||s);return a>3&&s&&Object.defineProperty(t,r,s),s}class g{userContext;logger;constructor(e){this.userContext=e.userContext,this.logger=e.logger,d.setLogger((e=>{this.logger.info(e)}))}async getAccountConfig(e){return await this.userContext.getObj(this.buildAccountKey(e))||{}}buildAccountKey(e){return"acme.config."+e}async saveAccountConfig(e,t){await this.userContext.setObj(this.buildAccountKey(e),t)}async getAcmeClient(e,t=!1){const r=await this.getAccountConfig(e);null==r.key&&(r.key=await this.createNewKey(),await this.saveAccountConfig(e,r));const n=new d.Client({directoryUrl:t?d.directory.letsencrypt.staging:d.directory.letsencrypt.production,accountKey:r.key,accountUrl:r.accountUrl,backoffAttempts:20,backoffMin:5e3,backoffMax:1e4});if(null==r.accountUrl){const t={termsOfServiceAgreed:!0,contact:[`mailto:${e}`]};await n.createAccount(t),r.accountUrl=n.getAccountUrl(),await this.saveAccountConfig(e,r)}return n}async createNewKey(){return(await d.forge.createPrivateKey()).toString()}async challengeCreateFn(e,t,r,n){if(this.logger.info("Triggered challengeCreateFn()"),"http-01"===t.type){const n=`/var/www/html/.well-known/acme-challenge/${t.token}`,i=r;this.logger.info(`Creating challenge response for ${e.identifier.value} at path: ${n}`),this.logger.info(`Would write "${i}" to path "${n}"`)}else if("dns-01"===t.type){const t=`_acme-challenge.${e.identifier.value}`,i=r;return this.logger.info(`Creating TXT record for ${e.identifier.value}: ${t}`),this.logger.info(`Would create TXT record "${t}" with value "${i}"`),await n.createRecord({fullRecord:t,type:"TXT",value:i})}}async challengeRemoveFn(e,t,r,n,i){if(this.logger.info("Triggered challengeRemoveFn()"),"http-01"===t.type){const r=`/var/www/html/.well-known/acme-challenge/${t.token}`;this.logger.info(`Removing challenge response for ${e.identifier.value} at path: ${r}`),this.logger.info(`Would remove file on path "${r}"`)}else if("dns-01"===t.type){const t=`_acme-challenge.${e.identifier.value}`,a=r;this.logger.info(`Removing TXT record for ${e.identifier.value}: ${t}`),this.logger.info(`Would remove TXT record "${t}" with value "${a}"`);try{await i.removeRecord({fullRecord:t,type:"TXT",value:r,record:n})}catch(e){throw this.logger.error("删除解析记录出错:",e),e}}}async order(e){const{email:t,isTest:r,domains:n,csrInfo:i,dnsProvider:a}=e,s=await this.getAcmeClient(t,r),{commonName:o,altNames:u}=this.buildCommonNameByDomains(n),[c,l]=await d.forge.createCsr({commonName:o,...i,altNames:u});if(null==a)throw new Error("dnsProvider 不能为空");const h={crt:(await s.auto({csr:l,email:t,termsOfServiceAgreed:!0,challengePriority:["dns-01"],challengeCreateFn:async(e,t,r)=>await this.challengeCreateFn(e,t,r,a),challengeRemoveFn:async(e,t,r,n)=>await this.challengeRemoveFn(e,t,r,n,a)})).toString(),key:c.toString(),csr:l.toString()};return this.logger.debug(`CSR:\n${h.csr}`),this.logger.debug(`Certificate:\n${h.crt}`),this.logger.info("证书申请成功"),h}buildCommonNameByDomains(e){if("string"==typeof e&&(e=e.split(",")),0===e.length)throw new Error("domain can not be empty");const t=e[0];let r;return e.length>1&&(r=n.slice(e,1)),{commonName:t,altNames:r}}}const y=new e.Registry,m="pipeline:dns-provider";var v="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function C(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var E={},b={get exports(){return E},set exports(e){E=e}},S={options:{usePureJavaScript:!1}},T={},_=T,w={};T.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 u=0,c=e[i];u<o.length;++u)c+=o[u]<<8,o[u]=c%a,c=c/a|0;for(;c>0;)o.push(c%a),c=c/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 u="";for(r=0;0===e.at(r)&&r<e.length()-1;++r)u+=i;for(r=a.length-1;r>=0;--r)u+=t[a[r]];return u}(e,t);if(r){var l=new RegExp(".{1,"+r+"}","g");n=n.match(l).join("\r\n")}return n},T.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=w[t];if(!r){r=w[t]=[];for(var n=0;n<t.length;++n)r[t.charCodeAt(n)]=n}e=e.replace(/\s/g,"");var i=t.length,a=t.charAt(0),s=[0];for(n=0;n<e.length;n++){var o=r[e.charCodeAt(n)];if(void 0===o)return;for(var u=0,c=o;u<s.length;++u)c+=s[u]*i,s[u]=255&c,c>>=8;for(;c>0;)s.push(255&c),c>>=8}for(var l=0;e[l]===a&&l<e.length-1;++l)s.push(0);return"undefined"!=typeof Buffer?Buffer.from(s.reverse()):new Uint8Array(s.reverse())};var I=S,A=_,B=I.util=I.util||{};function k(e){if(8!==e&&16!==e&&24!==e&&32!==e)throw new Error("Only 8, 16, 24, or 32 bits supported: "+e)}function N(e){if(this.data="",this.read=0,"string"==typeof e)this.data=e;else if(B.isArrayBuffer(e)||B.isArrayBufferView(e))if("undefined"!=typeof Buffer&&e instanceof Buffer)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 N||"object"==typeof e&&"string"==typeof e.data&&"number"==typeof e.read)&&(this.data=e.data,this.read=e.read);this._constructedStringLength=0}!function(){if("undefined"!=typeof process&&process.nextTick&&!process.browser)return B.nextTick=process.nextTick,void("function"==typeof setImmediate?B.setImmediate=setImmediate:B.setImmediate=B.nextTick);if("function"==typeof setImmediate)return B.setImmediate=function(){return setImmediate.apply(void 0,arguments)},void(B.nextTick=function(e){return setImmediate(e)});if(B.setImmediate=function(e){setTimeout(e,0)},"undefined"!=typeof window&&"function"==typeof window.postMessage){var e="forge.setImmediate",t=[];function s(r){if(r.source===window&&r.data===e){r.stopPropagation();var n=t.slice();t.length=0,n.forEach((function(e){e()}))}}B.setImmediate=function(r){t.push(r),1===t.length&&window.postMessage(e,"*")},window.addEventListener("message",s,!0)}if("undefined"!=typeof MutationObserver){var r=Date.now(),n=!0,i=document.createElement("div");t=[];new MutationObserver((function(){var e=t.slice();t.length=0,e.forEach((function(e){e()}))})).observe(i,{attributes:!0});var a=B.setImmediate;B.setImmediate=function(e){Date.now()-r>15?(r=Date.now(),a(e)):(t.push(e),1===t.length&&i.setAttribute("a",n=!n))}}B.nextTick=B.setImmediate}(),B.isNodejs="undefined"!=typeof process&&process.versions&&process.versions.node,B.globalScope=B.isNodejs?v:"undefined"==typeof self?window:self,B.isArray=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},B.isArrayBuffer=function(e){return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer},B.isArrayBufferView=function(e){return e&&B.isArrayBuffer(e.buffer)&&void 0!==e.byteLength},B.ByteBuffer=N,B.ByteStringBuffer=N;B.ByteStringBuffer.prototype._optimizeConstructedString=function(e){this._constructedStringLength+=e,this._constructedStringLength>4096&&(this.data.substr(0,1),this._constructedStringLength=0)},B.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read},B.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0},B.ByteStringBuffer.prototype.putByte=function(e){return this.putBytes(String.fromCharCode(e))},B.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},B.ByteStringBuffer.prototype.putBytes=function(e){return this.data+=e,this._optimizeConstructedString(e.length),this},B.ByteStringBuffer.prototype.putString=function(e){return this.putBytes(B.encodeUtf8(e))},B.ByteStringBuffer.prototype.putInt16=function(e){return this.putBytes(String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},B.ByteStringBuffer.prototype.putInt24=function(e){return this.putBytes(String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},B.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))},B.ByteStringBuffer.prototype.putInt16Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255))},B.ByteStringBuffer.prototype.putInt24Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255))},B.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))},B.ByteStringBuffer.prototype.putInt=function(e,t){k(t);var r="";do{t-=8,r+=String.fromCharCode(e>>t&255)}while(t>0);return this.putBytes(r)},B.ByteStringBuffer.prototype.putSignedInt=function(e,t){return e<0&&(e+=2<<t-1),this.putInt(e,t)},B.ByteStringBuffer.prototype.putBuffer=function(e){return this.putBytes(e.getBytes())},B.ByteStringBuffer.prototype.getByte=function(){return this.data.charCodeAt(this.read++)},B.ByteStringBuffer.prototype.getInt16=function(){var e=this.data.charCodeAt(this.read)<<8^this.data.charCodeAt(this.read+1);return this.read+=2,e},B.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},B.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},B.ByteStringBuffer.prototype.getInt16Le=function(){var e=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8;return this.read+=2,e},B.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},B.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},B.ByteStringBuffer.prototype.getInt=function(e){k(e);var t=0;do{t=(t<<8)+this.data.charCodeAt(this.read++),e-=8}while(e>0);return t},B.ByteStringBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),r=2<<e-2;return t>=r&&(t-=r<<1),t},B.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},B.ByteStringBuffer.prototype.bytes=function(e){return void 0===e?this.data.slice(this.read):this.data.slice(this.read,this.read+e)},B.ByteStringBuffer.prototype.at=function(e){return this.data.charCodeAt(this.read+e)},B.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},B.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)},B.ByteStringBuffer.prototype.copy=function(){var e=B.createBuffer(this.data);return e.read=this.read,e},B.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this},B.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this},B.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},B.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},B.ByteStringBuffer.prototype.toString=function(){return B.decodeUtf8(this.bytes())},B.DataBuffer=function(e,t){t=t||{},this.read=t.readOffset||0,this.growSize=t.growSize||1024;var r=B.isArrayBuffer(e),n=B.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)},B.DataBuffer.prototype.length=function(){return this.write-this.read},B.DataBuffer.prototype.isEmpty=function(){return this.length()<=0},B.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},B.DataBuffer.prototype.putByte=function(e){return this.accommodate(1),this.data.setUint8(this.write++,e),this},B.DataBuffer.prototype.fillWithByte=function(e,t){this.accommodate(t);for(var r=0;r<t;++r)this.data.setUint8(e);return this},B.DataBuffer.prototype.putBytes=function(e,t){if(B.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(B.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 B.DataBuffer||"object"==typeof e&&"number"==typeof e.read&&"number"==typeof e.write&&B.isArrayBufferView(e.data)){n=new Uint8Array(e.data.byteLength,e.read,e.length());return this.accommodate(n.byteLength),new Uint8Array(e.data.byteLength,this.write).set(n),this.write+=n.byteLength,this}if(e instanceof B.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+=B.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+=B.binary.base64.decode(e,i,this.write),this;if("utf8"===t&&(e=B.encodeUtf8(e),t="binary"),"binary"===t||"raw"===t)return this.accommodate(e.length),i=new Uint8Array(this.data.buffer,this.write),this.write+=B.binary.raw.decode(i),this;if("utf16"===t)return this.accommodate(2*e.length),i=new Uint16Array(this.data.buffer,this.write),this.write+=B.text.utf16.encode(i),this;throw new Error("Invalid encoding: "+t)}throw Error("Invalid parameter: "+e)},B.DataBuffer.prototype.putBuffer=function(e){return this.putBytes(e),e.clear(),this},B.DataBuffer.prototype.putString=function(e){return this.putBytes(e,"utf16")},B.DataBuffer.prototype.putInt16=function(e){return this.accommodate(2),this.data.setInt16(this.write,e),this.write+=2,this},B.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},B.DataBuffer.prototype.putInt32=function(e){return this.accommodate(4),this.data.setInt32(this.write,e),this.write+=4,this},B.DataBuffer.prototype.putInt16Le=function(e){return this.accommodate(2),this.data.setInt16(this.write,e,!0),this.write+=2,this},B.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},B.DataBuffer.prototype.putInt32Le=function(e){return this.accommodate(4),this.data.setInt32(this.write,e,!0),this.write+=4,this},B.DataBuffer.prototype.putInt=function(e,t){k(t),this.accommodate(t/8);do{t-=8,this.data.setInt8(this.write++,e>>t&255)}while(t>0);return this},B.DataBuffer.prototype.putSignedInt=function(e,t){return k(t),this.accommodate(t/8),e<0&&(e+=2<<t-1),this.putInt(e,t)},B.DataBuffer.prototype.getByte=function(){return this.data.getInt8(this.read++)},B.DataBuffer.prototype.getInt16=function(){var e=this.data.getInt16(this.read);return this.read+=2,e},B.DataBuffer.prototype.getInt24=function(){var e=this.data.getInt16(this.read)<<8^this.data.getInt8(this.read+2);return this.read+=3,e},B.DataBuffer.prototype.getInt32=function(){var e=this.data.getInt32(this.read);return this.read+=4,e},B.DataBuffer.prototype.getInt16Le=function(){var e=this.data.getInt16(this.read,!0);return this.read+=2,e},B.DataBuffer.prototype.getInt24Le=function(){var e=this.data.getInt8(this.read)^this.data.getInt16(this.read+1,!0)<<8;return this.read+=3,e},B.DataBuffer.prototype.getInt32Le=function(){var e=this.data.getInt32(this.read,!0);return this.read+=4,e},B.DataBuffer.prototype.getInt=function(e){k(e);var t=0;do{t=(t<<8)+this.data.getInt8(this.read++),e-=8}while(e>0);return t},B.DataBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),r=2<<e-2;return t>=r&&(t-=r<<1),t},B.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},B.DataBuffer.prototype.bytes=function(e){return void 0===e?this.data.slice(this.read):this.data.slice(this.read,this.read+e)},B.DataBuffer.prototype.at=function(e){return this.data.getUint8(this.read+e)},B.DataBuffer.prototype.setAt=function(e,t){return this.data.setUint8(e,t),this},B.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)},B.DataBuffer.prototype.copy=function(){return new B.DataBuffer(this)},B.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},B.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this},B.DataBuffer.prototype.truncate=function(e){return this.write=Math.max(0,this.length()-e),this.read=Math.min(this.read,this.write),this},B.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},B.DataBuffer.prototype.toString=function(e){var t=new Uint8Array(this.data,this.read,this.length());if("binary"===(e=e||"utf8")||"raw"===e)return B.binary.raw.encode(t);if("hex"===e)return B.binary.hex.encode(t);if("base64"===e)return B.binary.base64.encode(t);if("utf8"===e)return B.text.utf8.decode(t);if("utf16"===e)return B.text.utf16.decode(t);throw new Error("Invalid encoding: "+e)},B.createBuffer=function(e,t){return t=t||"raw",void 0!==e&&"utf8"===t&&(e=B.encodeUtf8(e)),new B.ByteBuffer(e)},B.fillString=function(e,t){for(var r="";t>0;)1&t&&(r+=e),(t>>>=1)>0&&(e+=e);return r},B.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},B.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},B.bytesToHex=function(e){return B.createBuffer(e).toHex()},B.int32ToBytes=function(e){return String.fromCharCode(e>>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e)};var R="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",L=[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],D="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";B.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+=R.charAt(r>>2),a+=R.charAt((3&r)<<4|n>>4),isNaN(n)?a+="==":(a+=R.charAt((15&n)<<2|i>>6),a+=isNaN(i)?"=":R.charAt(63&i)),t&&a.length>t&&(s+=a.substr(0,t)+"\r\n",a=a.substr(t));return s+=a},B.decode64=function(e){e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var t,r,n,i,a="",s=0;s<e.length;)t=L[e.charCodeAt(s++)-43],r=L[e.charCodeAt(s++)-43],n=L[e.charCodeAt(s++)-43],i=L[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},B.encodeUtf8=function(e){return unescape(encodeURIComponent(e))},B.decodeUtf8=function(e){return decodeURIComponent(escape(e))},B.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:A.encode,decode:A.decode}},B.binary.raw.encode=function(e){return String.fromCharCode.apply(null,e)},B.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},B.binary.hex.encode=B.bytesToHex,B.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},B.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+=R.charAt(r>>2),a+=R.charAt((3&r)<<4|n>>4),isNaN(n)?a+="==":(a+=R.charAt((15&n)<<2|i>>6),a+=isNaN(i)?"=":R.charAt(63&i)),t&&a.length>t&&(s+=a.substr(0,t)+"\r\n",a=a.substr(t));return s+=a},B.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 u=0,c=r=r||0;u<e.length;)n=L[e.charCodeAt(u++)-43],i=L[e.charCodeAt(u++)-43],a=L[e.charCodeAt(u++)-43],s=L[e.charCodeAt(u++)-43],o[c++]=n<<2|i>>4,64!==a&&(o[c++]=(15&i)<<4|a>>2,64!==s&&(o[c++]=(3&a)<<6|s));return t?c-r:o.subarray(0,c)},B.binary.base58.encode=function(e,t){return B.binary.baseN.encode(e,D,t)},B.binary.base58.decode=function(e,t){return B.binary.baseN.decode(e,D,t)},B.text={utf8:{},utf16:{}},B.text.utf8.encode=function(e,t,r){e=B.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},B.text.utf8.decode=function(e){return B.decodeUtf8(String.fromCharCode.apply(null,e))},B.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},B.text.utf16.decode=function(e){return String.fromCharCode.apply(null,new Uint16Array(e.buffer))},B.deflate=function(e,t,r){if(t=B.decode64(e.deflate(B.encode64(t)).rval),r){var n=2;32&t.charCodeAt(1)&&(n=6),t=t.substring(n,t.length-4)}return t},B.inflate=function(e,t,r){var n=e.inflate(B.encode64(t)).rval;return null===n?null:B.decode64(n)};var U=function(e,t,r){if(!e)throw new Error("WebStorage not available.");var n;if(null===r?n=e.removeItem(t):(r=B.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}},x=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(B.decode64(r))),r},O=function(e,t,r,n){var i=x(e,t);null===i&&(i={}),i[r]=n,U(e,t,i)},P=function(e,t,r){var n=x(e,t);return null!==n&&(n=r in n?n[r]:null),n},V=function(e,t,r){var n=x(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),U(e,t,n)}},K=function(e,t){U(e,t,null)},M=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};B.setItem=function(e,t,r,n,i){M(O,arguments,i)},B.getItem=function(e,t,r,n){return M(P,arguments,n)},B.removeItem=function(e,t,r,n){M(V,arguments,n)},B.clearItems=function(e,t,r){M(K,arguments,r)},B.parseUrl=function(e){var t=/^(https?):\/\/([^:&^\/]*):?(\d*)(.*)$/g;t.lastIndex=0;var r=t.exec(e),n=null===r?null:{full:e,scheme:r[1],host:r[2],port:r[3],path:r[4]};return n&&(n.fullHost=n.host,n.port?(80!==n.port&&"http"===n.scheme||443!==n.port&&"https"===n.scheme)&&(n.fullHost+=":"+n.port):"http"===n.scheme?n.port=80:"https"===n.scheme&&(n.port=443),n.full=n.scheme+"://"+n.fullHost),n};var F=null;B.getQueryVariables=function(e){var t,r=function(e){for(var t={},r=e.split("&"),n=0;n<r.length;n++){var i,a,s=r[n].indexOf("=");s>0?(i=r[n].substring(0,s),a=r[n].substring(s+1)):(i=r[n],a=null),i in t||(t[i]=[]),i in Object.prototype||null===a||t[i].push(unescape(a))}return t};return void 0===e?(null===F&&(F="undefined"!=typeof window&&window.location&&window.location.search?r(window.location.search.substring(1)):{}),t=F):t=r(e),t},B.parseFragment=function(e){var t=e,r="",n=e.indexOf("?");n>0&&(t=e.substring(0,n),r=e.substring(n+1));var i=t.split("/");return i.length>0&&""===i[0]&&i.shift(),{pathString:t,queryString:r,path:i,query:""===r?{}:B.getQueryVariables(r)}},B.makeRequest=function(e){var t=B.parseFragment(e),r={path:t.pathString,query:t.queryString,getPath:function(e){return void 0===e?t.path:t.path[e]},getQuery:function(e,r){var n;return void 0===e?n=t.query:(n=t.query[e])&&void 0!==r&&(n=n[r]),n},getQueryLast:function(e,t){var n=r.getQuery(e);return n?n[n.length-1]:t}};return r},B.makeLink=function(e,t,r){e=jQuery.isArray(e)?e.join("/"):e;var n=jQuery.param(t||{});return r=r||"",e+(n.length>0?"?"+n:"")+(r.length>0?"#"+r:"")},B.isEmpty=function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0},B.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("")},B.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,u=i<0?"-":"",c=parseInt(i=Math.abs(+i||0).toFixed(a),10)+"",l=c.length>3?c.length%3:0;return u+(l?c.substr(0,l)+o:"")+c.substr(l).replace(/(\d{3})(?=\d)/g,"$1"+o)+(a?s+Math.abs(i-c).toFixed(a).slice(2):"")},B.formatSize=function(e){return e=e>=1073741824?B.formatNumber(e/1073741824,2,".","")+" GiB":e>=1048576?B.formatNumber(e/1048576,2,".","")+" MiB":e>=1024?B.formatNumber(e/1024,0)+" KiB":B.formatNumber(e,0)+" bytes"},B.bytesFromIP=function(e){return-1!==e.indexOf(".")?B.bytesFromIPv4(e):-1!==e.indexOf(":")?B.bytesFromIPv6(e):null},B.bytesFromIPv4=function(e){if(4!==(e=e.split(".")).length)return null;for(var t=B.createBuffer(),r=0;r<e.length;++r){var n=parseInt(e[r],10);if(isNaN(n))return null;t.putByte(n)}return t.getBytes()},B.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=B.createBuffer(),i=0;i<8;++i)if(e[i]&&0!==e[i].length){var a=B.hexToBytes(e[i]);a.length<2&&n.putByte(0),n.putBytes(a)}else n.fillWithByte(0,r),r=0;return n.getBytes()},B.bytesToIP=function(e){return 4===e.length?B.bytesToIPv4(e):16===e.length?B.bytesToIPv6(e):null},B.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(".")},B.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=B.bytesToHex(e[i]+e[i+1]);"0"===a[0]&&"0"!==a;)a=a.substr(1);if("0"===a){var s=r[r.length-1],o=t.length;s&&o===s.end+1?(s.end=o,s.end-s.start>r[n].end-r[n].start&&(n=r.length-1)):r.push({start:o,end:o})}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(":")},B.estimateCores=function(e,t){if("function"==typeof e&&(t=e,e={}),e=e||{},"cores"in B&&!e.update)return t(null,B.cores);if("undefined"!=typeof navigator&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return B.cores=navigator.hardwareConcurrency,t(null,B.cores);if("undefined"==typeof Worker)return B.cores=1,t(null,B.cores);if("undefined"==typeof Blob)return B.cores=2,t(null,B.cores);var r=URL.createObjectURL(new Blob(["(",function(){self.addEventListener("message",(function(e){var t=Date.now(),r=t+4;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 B.cores=Math.max(1,s),URL.revokeObjectURL(r),t(null,B.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(null,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)};var z=S;z.cipher=z.cipher||{},z.cipher.algorithms=z.cipher.algorithms||{},z.cipher.createCipher=function(e,t){var r=e;if("string"==typeof r&&(r=z.cipher.getAlgorithm(r))&&(r=r()),!r)throw new Error("Unsupported algorithm: "+e);return new z.cipher.BlockCipher({algorithm:r,key:t,decrypt:!1})},z.cipher.createDecipher=function(e,t){var r=e;if("string"==typeof r&&(r=z.cipher.getAlgorithm(r))&&(r=r()),!r)throw new Error("Unsupported algorithm: "+e);return new z.cipher.BlockCipher({algorithm:r,key:t,decrypt:!0})},z.cipher.registerAlgorithm=function(e,t){e=e.toUpperCase(),z.cipher.algorithms[e]=t},z.cipher.getAlgorithm=function(e){return(e=e.toUpperCase())in z.cipher.algorithms?z.cipher.algorithms[e]:null};var j=z.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)};j.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=z.util.createBuffer(),this.output=e.output||z.util.createBuffer(),this.mode.start(t)},j.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()},j.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)))};var q=S;q.cipher=q.cipher||{};var H=q.cipher.modes=q.cipher.modes||{};function G(e,t){if("string"==typeof e&&(e=q.util.createBuffer(e)),q.util.isArray(e)&&e.length>4){var r=e;e=q.util.createBuffer();for(var n=0;n<r.length;++n)e.putByte(r[n])}if(e.length()<t)throw new Error("Invalid IV length; got "+e.length()+" bytes and expected "+t+" bytes.");if(!q.util.isArray(e)){var i=[],a=t/4;for(n=0;n<a;++n)i.push(e.getInt32());e=i}return e}function W(e){e[e.length-1]=e[e.length-1]+1&4294967295}function Q(e){return[e/4294967296|0,4294967295&e]}H.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)},H.ecb.prototype.start=function(e){},H.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();this.cipher.encrypt(this._inBlock,this._outBlock);for(n=0;n<this._ints;++n)t.putInt32(this._outBlock[n])},H.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();this.cipher.decrypt(this._inBlock,this._outBlock);for(n=0;n<this._ints;++n)t.putInt32(this._outBlock[n])},H.ecb.prototype.pad=function(e,t){var r=e.length()===this.blockSize?this.blockSize:this.blockSize-e.length();return e.fillWithByte(r,r),!0},H.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)},H.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)},H.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=G(e.iv,this.blockSize),this._prev=this._iv.slice(0)}},H.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();this.cipher.encrypt(this._inBlock,this._outBlock);for(n=0;n<this._ints;++n)t.putInt32(this._outBlock[n]);this._prev=this._outBlock},H.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();this.cipher.decrypt(this._inBlock,this._outBlock);for(n=0;n<this._ints;++n)t.putInt32(this._prev[n]^this._outBlock[n]);this._prev=this._inBlock.slice(0)},H.cbc.prototype.pad=function(e,t){var r=e.length()===this.blockSize?this.blockSize:this.blockSize-e.length();return e.fillWithByte(r,r),!0},H.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)},H.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=q.util.createBuffer(),this._partialBytes=0},H.cfb.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=G(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},H.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;a>0&&(a=this.blockSize-a),this._partialOutput.clear();for(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}},H.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;a>0&&(a=this.blockSize-a),this._partialOutput.clear();for(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}},H.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=q.util.createBuffer(),this._partialBytes=0},H.ofb.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=G(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},H.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;a>0&&(a=this.blockSize-a),this._partialOutput.clear();for(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}},H.ofb.prototype.decrypt=H.ofb.prototype.encrypt,H.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=q.util.createBuffer(),this._partialBytes=0},H.ctr.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=G(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},H.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;a>0&&(a=this.blockSize-a),this._partialOutput.clear();for(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}W(this._inBlock)},H.ctr.prototype.decrypt=H.ctr.prototype.encrypt,H.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=q.util.createBuffer(),this._partialBytes=0,this._R=3774873600},H.gcm.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");var t,r=q.util.createBuffer(e.iv);if(this._cipherLength=0,t="additionalData"in e?q.util.createBuffer(e.additionalData):q.util.createBuffer(),this._tagLength="tagLength"in e?e.tagLength:128,this._tag=null,e.decrypt&&(this._tag=q.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 n=r.length();if(12===n)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(Q(8*n)))}this._inBlock=this._j0.slice(0),W(this._inBlock),this._partialBytes=0,t=q.util.createBuffer(t),this._aDataLength=Q(8*t.length());var i=t.length()%this.blockSize;for(i&&t.fillWithByte(0,this.blockSize-i),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()])},H.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;a>0&&(a=this.blockSize-a),this._partialOutput.clear();for(i=0;i<this._ints;++i)this._partialOutput.putInt32(e.getInt32()^this._outBlock[i]);if(a<=0||r){if(r){var s=n%this.blockSize;this._cipherLength+=s,this._partialOutput.truncate(this.blockSize-s)}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),W(this._inBlock)},H.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),W(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},H.gcm.prototype.afterFinish=function(e,t){var r=!0;t.decrypt&&t.overflow&&e.truncate(this.blockSize-t.overflow),this.tag=q.util.createBuffer();var n=this._aDataLength.concat(Q(8*this._cipherLength));this._s=this.ghash(this._hashSubkey,this._s,n);var i=[];this.cipher.encrypt(this._j0,i);for(var a=0;a<this._ints;++a)this.tag.putInt32(this._s[a]^i[a]);return this.tag.truncate(this.tag.length()%(this._tagLength/8)),t.decrypt&&this.tag.bytes()!==this._tag&&(r=!1),r},H.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},H.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)},H.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},H.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)},H.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],u=(n-1-s%n)*t;o[s/n|0]=1<<t-1<<u,a[s]=this.generateSubHashTable(this.multiply(o,e),t)}return a},H.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],u=i[s];i[a+s]=[o[0]^u[0],o[1]^u[1],o[2]^u[2],o[3]^u[3]]}a*=2}for(i[0]=[0,0,0,0],a=n+1;a<r;++a){var c=i[a^n];i[a]=[e[0]^c[0],e[1]^c[1],e[2]^c[2],e[3]^c[3]]}return i};var Y=S;function Z(e,t){Y.cipher.registerAlgorithm(e,(function(){return new Y.aes.Algorithm(e,t)}))}Y.aes=Y.aes||{},Y.aes.startEncrypting=function(e,t,r,n){var i=oe({key:e,output:r,decrypt:!1,mode:n});return i.start(t),i},Y.aes.createEncryptionCipher=function(e,t){return oe({key:e,output:null,decrypt:!1,mode:t})},Y.aes.startDecrypting=function(e,t,r,n){var i=oe({key:e,output:r,decrypt:!0,mode:n});return i.start(t),i},Y.aes.createDecryptionCipher=function(e,t){return oe({key:e,output:null,decrypt:!0,mode:t})},Y.aes.Algorithm=function(e,t){re||ie();var r=this;r.name=e,r.mode=new t({blockSize:16,cipher:{encrypt:function(e,t){return se(r._w,e,t,!1)},decrypt:function(e,t){return se(r._w,e,t,!0)}}}),r._init=!1},Y.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(Y.util.isArray(r)&&(16===r.length||24===r.length||32===r.length)){t=r,r=Y.util.createBuffer();for(var n=0;n<t.length;++n)r.putByte(t[n])}}else r=Y.util.createBuffer(r);if(!Y.util.isArray(r)){t=r,r=[];var i=t.length();if(16===i||24===i||32===i){i>>>=2;for(n=0;n<i;++n)r.push(t.getInt32())}}if(!Y.util.isArray(r)||4!==r.length&&6!==r.length&&8!==r.length)throw new Error("Invalid key parameter.");var a=this.mode.name,s=-1!==["CFB","OFB","CTR","GCM"].indexOf(a);this._w=ae(r,e.decrypt&&!s),this._init=!0}},Y.aes._expandKey=function(e,t){return re||ie(),ae(e,t)},Y.aes._updateBlock=se,Z("AES-ECB",Y.cipher.modes.ecb),Z("AES-CBC",Y.cipher.modes.cbc),Z("AES-CFB",Y.cipher.modes.cfb),Z("AES-OFB",Y.cipher.modes.ofb),Z("AES-CTR",Y.cipher.modes.ctr),Z("AES-GCM",Y.cipher.modes.gcm);var X,$,J,ee,te,re=!1,ne=4;function ie(){re=!0,J=[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;X=new Array(256),$=new Array(256),ee=new Array(4),te=new Array(4);for(t=0;t<4;++t)ee[t]=new Array(256),te[t]=new Array(256);var r,n,i,a,s,o,u,c=0,l=0;for(t=0;t<256;++t){a=(a=l^l<<1^l<<2^l<<3^l<<4)>>8^255&a^99,X[c]=a,$[a]=c,o=(s=e[a])<<24^a<<16^a<<8^a^s,u=((r=e[c])^(n=e[r])^(i=e[n]))<<24^(c^i)<<16^(c^n^i)<<8^c^r^i;for(var h=0;h<4;++h)ee[h][c]=o,te[h][a]=u,o=o<<24|o>>>8,u=u<<24|u>>>8;0===c?c=l=1:(c=r^e[e[e[r^i]]],l^=e[e[l]])}}function ae(e,t){for(var r,n=e.slice(0),i=1,a=n.length,s=ne*(a+6+1),o=a;o<s;++o)r=n[o-1],o%a==0?(r=X[r>>>16&255]<<24^X[r>>>8&255]<<16^X[255&r]<<8^X[r>>>24]^J[i]<<24,i++):a>6&&o%a==4&&(r=X[r>>>24]<<24^X[r>>>16&255]<<16^X[r>>>8&255]<<8^X[255&r]),n[o]=n[o-a]^r;if(t){for(var u,c=te[0],l=te[1],h=te[2],f=te[3],d=n.slice(0),p=(o=0,(s=n.length)-ne);o<s;o+=ne,p-=ne)if(0===o||o===s-ne)d[o]=n[p],d[o+1]=n[p+3],d[o+2]=n[p+2],d[o+3]=n[p+1];else for(var g=0;g<ne;++g)u=n[p+g],d[o+(3&-g)]=c[X[u>>>24]]^l[X[u>>>16&255]]^h[X[u>>>8&255]]^f[X[255&u]];n=d}return n}function se(e,t,r,n){var i,a,s,o,u,c,l,h,f,d,p,g,y=e.length/4-1;n?(i=te[0],a=te[1],s=te[2],o=te[3],u=$):(i=ee[0],a=ee[1],s=ee[2],o=ee[3],u=X),c=t[0]^e[0],l=t[n?3:1]^e[1],h=t[2]^e[2],f=t[n?1:3]^e[3];for(var m=3,v=1;v<y;++v)d=i[c>>>24]^a[l>>>16&255]^s[h>>>8&255]^o[255&f]^e[++m],p=i[l>>>24]^a[h>>>16&255]^s[f>>>8&255]^o[255&c]^e[++m],g=i[h>>>24]^a[f>>>16&255]^s[c>>>8&255]^o[255&l]^e[++m],f=i[f>>>24]^a[c>>>16&255]^s[l>>>8&255]^o[255&h]^e[++m],c=d,l=p,h=g;r[0]=u[c>>>24]<<24^u[l>>>16&255]<<16^u[h>>>8&255]<<8^u[255&f]^e[++m],r[n?3:1]=u[l>>>24]<<24^u[h>>>16&255]<<16^u[f>>>8&255]<<8^u[255&c]^e[++m],r[2]=u[h>>>24]<<24^u[f>>>16&255]<<16^u[c>>>8&255]<<8^u[255&l]^e[++m],r[n?1:3]=u[f>>>24]<<24^u[c>>>16&255]<<16^u[l>>>8&255]<<8^u[255&h]^e[++m]}function oe(e){var t,r="AES-"+((e=e||{}).mode||"CBC").toUpperCase(),n=(t=e.decrypt?Y.cipher.createDecipher(r,e.key):Y.cipher.createCipher(r,e.key)).start;return t.start=function(e,r){var i=null;r instanceof Y.util.ByteBuffer&&(i=r,r={}),(r=r||{}).output=i,r.iv=e,n.call(t,r)},t}var ue=S;ue.pki=ue.pki||{};var ce=ue.pki.oids=ue.oids=ue.oids||{};function le(e,t){ce[e]=t,ce[t]=e}function he(e,t){ce[e]=t}le("1.2.840.113549.1.1.1","rsaEncryption"),le("1.2.840.113549.1.1.4","md5WithRSAEncryption"),le("1.2.840.113549.1.1.5","sha1WithRSAEncryption"),le("1.2.840.113549.1.1.7","RSAES-OAEP"),le("1.2.840.113549.1.1.8","mgf1"),le("1.2.840.113549.1.1.9","pSpecified"),le("1.2.840.113549.1.1.10","RSASSA-PSS"),le("1.2.840.113549.1.1.11","sha256WithRSAEncryption"),le("1.2.840.113549.1.1.12","sha384WithRSAEncryption"),le("1.2.840.113549.1.1.13","sha512WithRSAEncryption"),le("1.3.101.112","EdDSA25519"),le("1.2.840.10040.4.3","dsa-with-sha1"),le("1.3.14.3.2.7","desCBC"),le("1.3.14.3.2.26","sha1"),le("2.16.840.1.101.3.4.2.1","sha256"),le("2.16.840.1.101.3.4.2.2","sha384"),le("2.16.840.1.101.3.4.2.3","sha512"),le("1.2.840.113549.2.5","md5"),le("1.2.840.113549.1.7.1","data"),le("1.2.840.113549.1.7.2","signedData"),le("1.2.840.113549.1.7.3","envelopedData"),le("1.2.840.113549.1.7.4","signedAndEnvelopedData"),le("1.2.840.113549.1.7.5","digestedData"),le("1.2.840.113549.1.7.6","encryptedData"),le("1.2.840.113549.1.9.1","emailAddress"),le("1.2.840.113549.1.9.2","unstructuredName"),le("1.2.840.113549.1.9.3","contentType"),le("1.2.840.113549.1.9.4","messageDigest"),le("1.2.840.113549.1.9.5","signingTime"),le("1.2.840.113549.1.9.6","counterSignature"),le("1.2.840.113549.1.9.7","challengePassword"),le("1.2.840.113549.1.9.8","unstructuredAddress"),le("1.2.840.113549.1.9.14","extensionRequest"),le("1.2.840.113549.1.9.20","friendlyName"),le("1.2.840.113549.1.9.21","localKeyId"),le("1.2.840.113549.1.9.22.1","x509Certificate"),le("1.2.840.113549.1.12.10.1.1","keyBag"),le("1.2.840.113549.1.12.10.1.2","pkcs8ShroudedKeyBag"),le("1.2.840.113549.1.12.10.1.3","certBag"),le("1.2.840.113549.1.12.10.1.4","crlBag"),le("1.2.840.113549.1.12.10.1.5","secretBag"),le("1.2.840.113549.1.12.10.1.6","safeContentsBag"),le("1.2.840.113549.1.5.13","pkcs5PBES2"),le("1.2.840.113549.1.5.12","pkcs5PBKDF2"),le("1.2.840.113549.1.12.1.1","pbeWithSHAAnd128BitRC4"),le("1.2.840.113549.1.12.1.2","pbeWithSHAAnd40BitRC4"),le("1.2.840.113549.1.12.1.3","pbeWithSHAAnd3-KeyTripleDES-CBC"),le("1.2.840.113549.1.12.1.4","pbeWithSHAAnd2-KeyTripleDES-CBC"),le("1.2.840.113549.1.12.1.5","pbeWithSHAAnd128BitRC2-CBC"),le("1.2.840.113549.1.12.1.6","pbewithSHAAnd40BitRC2-CBC"),le("1.2.840.113549.2.7","hmacWithSHA1"),le("1.2.840.113549.2.8","hmacWithSHA224"),le("1.2.840.113549.2.9","hmacWithSHA256"),le("1.2.840.113549.2.10","hmacWithSHA384"),le("1.2.840.113549.2.11","hmacWithSHA512"),le("1.2.840.113549.3.7","des-EDE3-CBC"),le("2.16.840.1.101.3.4.1.2","aes128-CBC"),le("2.16.840.1.101.3.4.1.22","aes192-CBC"),le("2.16.840.1.101.3.4.1.42","aes256-CBC"),le("2.5.4.3","commonName"),le("2.5.4.5","serialName"),le("2.5.4.6","countryName"),le("2.5.4.7","localityName"),le("2.5.4.8","stateOrProvinceName"),le("2.5.4.9","streetAddress"),le("2.5.4.10","organizationName"),le("2.5.4.11","organizationalUnitName"),le("2.5.4.13","description"),le("2.5.4.15","businessCategory"),le("2.5.4.17","postalCode"),le("1.3.6.1.4.1.311.60.2.1.2","jurisdictionOfIncorporationStateOrProvinceName"),le("1.3.6.1.4.1.311.60.2.1.3","jurisdictionOfIncorporationCountryName"),le("2.16.840.1.113730.1.1","nsCertType"),le("2.16.840.1.113730.1.13","nsComment"),he("2.5.29.1","authorityKeyIdentifier"),he("2.5.29.2","keyAttributes"),he("2.5.29.3","certificatePolicies"),he("2.5.29.4","keyUsageRestriction"),he("2.5.29.5","policyMapping"),he("2.5.29.6","subtreesConstraint"),he("2.5.29.7","subjectAltName"),he("2.5.29.8","issuerAltName"),he("2.5.29.9","subjectDirectoryAttributes"),he("2.5.29.10","basicConstraints"),he("2.5.29.11","nameConstraints"),he("2.5.29.12","policyConstraints"),he("2.5.29.13","basicConstraints"),le("2.5.29.14","subjectKeyIdentifier"),le("2.5.29.15","keyUsage"),he("2.5.29.16","privateKeyUsagePeriod"),le("2.5.29.17","subjectAltName"),le("2.5.29.18","issuerAltName"),le("2.5.29.19","basicConstraints"),he("2.5.29.20","cRLNumber"),he("2.5.29.21","cRLReason"),he("2.5.29.22","expirationDate"),he("2.5.29.23","instructionCode"),he("2.5.29.24","invalidityDate"),he("2.5.29.25","cRLDistributionPoints"),he("2.5.29.26","issuingDistributionPoint"),he("2.5.29.27","deltaCRLIndicator"),he("2.5.29.28","issuingDistributionPoint"),he("2.5.29.29","certificateIssuer"),he("2.5.29.30","nameConstraints"),le("2.5.29.31","cRLDistributionPoints"),le("2.5.29.32","certificatePolicies"),he("2.5.29.33","policyMappings"),he("2.5.29.34","policyConstraints"),le("2.5.29.35","authorityKeyIdentifier"),he("2.5.29.36","policyConstraints"),le("2.5.29.37","extKeyUsage"),he("2.5.29.46","freshestCRL"),he("2.5.29.54","inhibitAnyPolicy"),le("1.3.6.1.4.1.11129.2.4.2","timestampList"),le("1.3.6.1.5.5.7.1.1","authorityInfoAccess"),le("1.3.6.1.5.5.7.3.1","serverAuth"),le("1.3.6.1.5.5.7.3.2","clientAuth"),le("1.3.6.1.5.5.7.3.3","codeSigning"),le("1.3.6.1.5.5.7.3.4","emailProtection"),le("1.3.6.1.5.5.7.3.8","timeStamping");var fe=S,de=fe.asn1=fe.asn1||{};function pe(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}}de.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192},de.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},de.create=function(e,t,r,n,i){if(fe.util.isArray(n)){for(var a=[],s=0;s<n.length;++s)void 0!==n[s]&&a.push(n[s]);n=a}var o={tagClass:e,type:t,constructed:r,composed:r||fe.util.isArray(n),value:n};return i&&"bitStringContents"in i&&(o.bitStringContents=i.bitStringContents,o.original=de.copy(o)),o},de.copy=function(e,t){var r;if(fe.util.isArray(e)){r=[];for(var n=0;n<e.length;++n)r.push(de.copy(e[n],t));return r}return"string"==typeof e?e:(r={tagClass:e.tagClass,type:e.type,constructed:e.constructed,composed:e.composed,value:de.copy(e.value,t)},t&&!t.excludeBitStringContents&&(r.bitStringContents=e.bitStringContents),r)},de.equals=function(e,t,r){if(fe.util.isArray(e)){if(!fe.util.isArray(t))return!1;if(e.length!==t.length)return!1;for(var n=0;n<e.length;++n)if(!de.equals(e[n],t[n]))return!1;return!0}if(typeof e!=typeof t)return!1;if("string"==typeof e)return e===t;var i=e.tagClass===t.tagClass&&e.type===t.type&&e.constructed===t.constructed&&e.composed===t.composed&&de.equals(e.value,t.value);return r&&r.includeBitStringContents&&(i=i&&e.bitStringContents===t.bitStringContents),i},de.getBerValueLength=function(e){var t=e.getByte();if(128!==t)return 128&t?e.getInt((127&t)<<3):t};function ge(e,t,r,n){var i;pe(e,t,2);var a=e.getByte();t--;var s=192&a,o=31&a;i=e.length();var u,c,l=function(e,t){var r=e.getByte();if(t--,128!==r){var n;if(128&r){var i=127&r;pe(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-=i-e.length(),void 0!==l&&l>t){if(n.strict){var h=new Error("Too few bytes to read ASN.1 value.");throw h.available=e.length(),h.remaining=t,h.requested=l,h}l=t}var f=32==(32&a);if(f)if(u=[],void 0===l)for(;;){if(pe(e,t,2),e.bytes(2)===String.fromCharCode(0,0)){e.getBytes(2),t-=2;break}i=e.length(),u.push(ge(e,t,r+1,n)),t-=i-e.length()}else for(;l>0;)i=e.length(),u.push(ge(e,l,r+1,n)),t-=i-e.length(),l-=i-e.length();if(void 0===u&&s===de.Class.UNIVERSAL&&o===de.Type.BITSTRING&&(c=e.bytes(l)),void 0===u&&n.decodeBitStrings&&s===de.Class.UNIVERSAL&&o===de.Type.BITSTRING&&l>1){var d=e.read,p=t,g=0;if(o===de.Type.BITSTRING&&(pe(e,t,1),g=e.getByte(),t--),0===g)try{i=e.length();var y=ge(e,t,r+1,{verbose:n.verbose,strict:!0,decodeBitStrings:!0}),m=i-e.length();t-=m,o==de.Type.BITSTRING&&m++;var v=y.tagClass;m!==l||v!==de.Class.UNIVERSAL&&v!==de.Class.CONTEXT_SPECIFIC||(u=[y])}catch(e){}void 0===u&&(e.read=d,t=p)}if(void 0===u){if(void 0===l){if(n.strict)throw new Error("Non-constructed ASN.1 object of indefinite length.");l=t}if(o===de.Type.BMPSTRING)for(u="";l>0;l-=2)pe(e,t,2),u+=String.fromCharCode(e.getInt16()),t-=2;else u=e.getBytes(l)}var C=void 0===c?null:{bitStringContents:c};return de.create(s,o,f,u,C)}de.fromDer=function(e,t){return void 0===t&&(t={strict:!0,decodeBitStrings:!0}),"boolean"==typeof t&&(t={strict:t,decodeBitStrings:!0}),"strict"in t||(t.strict=!0),"decodeBitStrings"in t||(t.decodeBitStrings=!0),"string"==typeof e&&(e=fe.util.createBuffer(e)),ge(e,e.length(),0,t)},de.toDer=function(e){var t=fe.util.createBuffer(),r=e.tagClass|e.type,n=fe.util.createBuffer(),i=!1;if("bitStringContents"in e&&(i=!0,e.original&&(i=de.equals(e,e.original))),i)n.putBytes(e.bitStringContents);else if(e.composed){e.constructed?r|=32:n.putByte(0);for(var a=0;a<e.value.length;++a)void 0!==e.value[a]&&n.putBuffer(de.toDer(e.value[a]))}else if(e.type===de.Type.BMPSTRING)for(a=0;a<e.value.length;++a)n.putInt16(e.value.charCodeAt(a));else e.type===de.Type.INTEGER&&e.value.length>1&&(0===e.value.charCodeAt(0)&&0==(128&e.value.charCodeAt(1))||255===e.value.charCodeAt(0)&&128==(128&e.value.charCodeAt(1)))?n.putBytes(e.value.substr(1)):n.putBytes(e.value);if(t.putByte(r),n.length()<=127)t.putByte(127&n.length());else{var s=n.length(),o="";do{o+=String.fromCharCode(255&s),s>>>=8}while(s>0);t.putByte(128|o.length);for(a=o.length-1;a>=0;--a)t.putByte(o.charCodeAt(a))}return t.putBuffer(n),t},de.oidToDer=function(e){var t,r,n,i,a=e.split("."),s=fe.util.createBuffer();s.putByte(40*parseInt(a[0],10)+parseInt(a[1],10));for(var o=2;o<a.length;++o){t=!0,r=[],n=parseInt(a[o],10);do{i=127&n,n>>>=7,t||(i|=128),r.push(i),t=!1}while(n>0);for(var u=r.length-1;u>=0;--u)s.putByte(r[u])}return s},de.derToOid=function(e){var t;"string"==typeof e&&(e=fe.util.createBuffer(e));var r=e.getByte();t=Math.floor(r/40)+"."+r%40;for(var n=0;e.length()>0;)n<<=7,128&(r=e.getByte())?n+=127&r:(t+="."+(n+r),n=0);return t},de.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 u=e.charAt(10),c=10;"+"!==u&&"-"!==u&&(o=parseInt(e.substr(10,2),10),c+=2)}if(t.setUTCFullYear(r,n,i),t.setUTCHours(a,s,o,0),c&&("+"===(u=e.charAt(c))||"-"===u)){var l=60*parseInt(e.substr(c+1,2),10)+parseInt(e.substr(c+4,2),10);l*=6e4,"+"===u?t.setTime(+t-l):t.setTime(+t+l)}return t},de.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),u=0,c=0,l=!1;"Z"===e.charAt(e.length-1)&&(l=!0);var h=e.length-5,f=e.charAt(h);"+"!==f&&"-"!==f||(c=60*parseInt(e.substr(h+1,2),10)+parseInt(e.substr(h+4,2),10),c*=6e4,"+"===f&&(c*=-1),l=!0);return"."===e.charAt(14)&&(u=1e3*parseFloat(e.substr(14),10)),l?(t.setUTCFullYear(r,n,i),t.setUTCHours(a,s,o,u),t.setTime(+t+c)):(t.setFullYear(r,n,i),t.setHours(a,s,o,u)),t},de.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"},de.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"},de.integerToDer=function(e){var t=fe.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},de.derToInteger=function(e){"string"==typeof e&&(e=fe.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)},de.validate=function(e,t,r,n){var i=!1;if(e.tagClass!==t.tagClass&&void 0!==t.tagClass||e.type!==t.type&&void 0!==t.type)n&&(e.tagClass!==t.tagClass&&n.push("["+t.name+'] Expected tag class "'+t.tagClass+'", got "'+e.tagClass+'"'),e.type!==t.type&&n.push("["+t.name+'] Expected type "'+t.type+'", got "'+e.type+'"'));else if(e.constructed===t.constructed||void 0===t.constructed){if(i=!0,t.value&&fe.util.isArray(t.value))for(var a=0,s=0;i&&s<t.value.length;++s)i=t.value[s].optional||!1,e.value[a]&&((i=de.validate(e.value[a],t.value[s],r,n))?++a:t.value[s].optional&&(i=!0)),!i&&n&&n.push("["+t.name+'] Tag class "'+t.tagClass+'", type "'+t.type+'" expected value length "'+t.value.length+'", got "'+e.value.length+'"');if(i&&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 n&&n.push("["+t.name+'] Expected constructed "'+t.constructed+'", got "'+e.constructed+'"');return i};var ye=/[^\\u0000-\\u00ff]/;de.prettyPrint=function(e,t,r){var n="";r=r||2,(t=t||0)>0&&(n+="\n");for(var i="",a=0;a<t*r;++a)i+=" ";switch(n+=i+"Tag: ",e.tagClass){case de.Class.UNIVERSAL:n+="Universal:";break;case de.Class.APPLICATION:n+="Application:";break;case de.Class.CONTEXT_SPECIFIC:n+="Context-Specific:";break;case de.Class.PRIVATE:n+="Private:"}if(e.tagClass===de.Class.UNIVERSAL)switch(n+=e.type,e.type){case de.Type.NONE:n+=" (None)";break;case de.Type.BOOLEAN:n+=" (Boolean)";break;case de.Type.INTEGER:n+=" (Integer)";break;case de.Type.BITSTRING:n+=" (Bit string)";break;case de.Type.OCTETSTRING:n+=" (Octet string)";break;case de.Type.NULL:n+=" (Null)";break;case de.Type.OID:n+=" (Object Identifier)";break;case de.Type.ODESC:n+=" (Object Descriptor)";break;case de.Type.EXTERNAL:n+=" (External or Instance of)";break;case de.Type.REAL:n+=" (Real)";break;case de.Type.ENUMERATED:n+=" (Enumerated)";break;case de.Type.EMBEDDED:n+=" (Embedded PDV)";break;case de.Type.UTF8:n+=" (UTF8)";break;case de.Type.ROID:n+=" (Relative Object Identifier)";break;case de.Type.SEQUENCE:n+=" (Sequence)";break;case de.Type.SET:n+=" (Set)";break;case de.Type.PRINTABLESTRING:n+=" (Printable String)";break;case de.Type.IA5String:n+=" (IA5String (ASCII))";break;case de.Type.UTCTIME:n+=" (UTC time)";break;case de.Type.GENERALIZEDTIME:n+=" (Generalized time)";break;case de.Type.BMPSTRING:n+=" (BMP String)"}else n+=e.type;if(n+="\n",n+=i+"Constructed: "+e.constructed+"\n",e.composed){var s=0,o="";for(a=0;a<e.value.length;++a)void 0!==e.value[a]&&(s+=1,o+=de.prettyPrint(e.value[a],t+1,r),a+1<e.value.length&&(o+=","));n+=i+"Sub values: "+s+o}else{if(n+=i+"Value: ",e.type===de.Type.OID){var u=de.derToOid(e.value);n+=u,fe.pki&&fe.pki.oids&&u in fe.pki.oids&&(n+=" ("+fe.pki.oids[u]+") ")}if(e.type===de.Type.INTEGER)try{n+=de.derToInteger(e.value)}catch(t){n+="0x"+fe.util.bytesToHex(e.value)}else if(e.type===de.Type.BITSTRING){if(e.value.length>1?n+="0x"+fe.util.bytesToHex(e.value.slice(1)):n+="(none)",e.value.length>0){var c=e.value.charCodeAt(0);1==c?n+=" (1 unused bit shown)":c>1&&(n+=" ("+c+" unused bits shown)")}}else e.type===de.Type.OCTETSTRING?(ye.test(e.value)||(n+="("+e.value+") "),n+="0x"+fe.util.bytesToHex(e.value)):e.type===de.Type.UTF8?n+=fe.util.decodeUtf8(e.value):e.type===de.Type.PRINTABLESTRING||e.type===de.Type.IA5String?n+=e.value:ye.test(e.value)?n+="0x"+fe.util.bytesToHex(e.value):0===e.value.length?n+="[null]":n+=e.value}return n};var me=S,ve=me.md=me.md||{};me.md.algorithms=me.md.algorithms||{};var Ce=S;(Ce.hmac=Ce.hmac||{}).create=function(){var e=null,t=null,r=null,n=null,i={start:function(i,a){if(null!==i)if("string"==typeof i){if(!((i=i.toLowerCase())in Ce.md.algorithms))throw new Error('Unknown hash algorithm "'+i+'"');t=Ce.md.algorithms[i].create()}else t=i;if(null===a)a=e;else{if("string"==typeof a)a=Ce.util.createBuffer(a);else if(Ce.util.isArray(a)){var s=a;a=Ce.util.createBuffer();for(var o=0;o<s.length;++o)a.putByte(s[o])}var u=a.length();u>t.blockLength&&(t.start(),t.update(a.bytes()),a=t.digest()),r=Ce.util.createBuffer(),n=Ce.util.createBuffer(),u=a.length();for(o=0;o<u;++o){s=a.at(o);r.putByte(54^s),n.putByte(92^s)}if(u<t.blockLength)for(s=t.blockLength-u,o=0;o<s;++o)r.putByte(54),n.putByte(92);e=a,r=r.bytes(),n=n.bytes()}t.start(),t.update(r)},update:function(e){t.update(e)},getMac:function(){var e=t.digest().bytes();return t.start(),t.update(n),t.update(e),t.digest()}};return i.digest=i.getMac,i};var Ee=S,be=Ee.md5=Ee.md5||{};Ee.md.md5=Ee.md.algorithms.md5=be,be.create=function(){Ie||function(){Se=String.fromCharCode(128),Se+=Ee.util.fillString(String.fromCharCode(0),64),Te=[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],_e=[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],we=new Array(64);for(var e=0;e<64;++e)we[e]=Math.floor(4294967296*Math.abs(Math.sin(e+1)));Ie=!0}();var e=null,t=Ee.util.createBuffer(),r=new Array(16),n={algorithm:"md5",blockLength:64,digestLength:16,messageLength:0,fullMessageLength:null,messageLengthSize:8,start:function(){n.messageLength=0,n.fullMessageLength=n.messageLength64=[];for(var r=n.messageLengthSize/4,i=0;i<r;++i)n.fullMessageLength.push(0);return t=Ee.util.createBuffer(),e={h0:1732584193,h1:4023233417,h2:2562383102,h3:271733878},n}};return n.start(),n.update=function(i,a){"utf8"===a&&(i=Ee.util.encodeUtf8(i));var s=i.length;n.messageLength+=s,s=[s/4294967296>>>0,s>>>0];for(var o=n.fullMessageLength.length-1;o>=0;--o)n.fullMessageLength[o]+=s[1],s[1]=s[0]+(n.fullMessageLength[o]/4294967296>>>0),n.fullMessageLength[o]=n.fullMessageLength[o]>>>0,s[0]=s[1]/4294967296>>>0;return t.putBytes(i),Ae(e,r,t),(t.read>2048||0===t.length())&&t.compact(),n},n.digest=function(){var i=Ee.util.createBuffer();i.putBytes(t.bytes());var a=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize&n.blockLength-1;i.putBytes(Se.substr(0,n.blockLength-a));for(var s,o=0,u=n.fullMessageLength.length-1;u>=0;--u)o=(s=8*n.fullMessageLength[u]+o)/4294967296>>>0,i.putInt32Le(s>>>0);var c={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3};Ae(c,r,i);var l=Ee.util.createBuffer();return l.putInt32Le(c.h0),l.putInt32Le(c.h1),l.putInt32Le(c.h2),l.putInt32Le(c.h3),l},n};var Se=null,Te=null,_e=null,we=null,Ie=!1;function Ae(e,t,r){for(var n,i,a,s,o,u,c,l=r.length();l>=64;){for(i=e.h0,a=e.h1,s=e.h2,o=e.h3,c=0;c<16;++c)t[c]=r.getInt32Le(),n=i+(o^a&(s^o))+we[c]+t[c],i=o,o=s,s=a,a+=n<<(u=_e[c])|n>>>32-u;for(;c<32;++c)n=i+(s^o&(a^s))+we[c]+t[Te[c]],i=o,o=s,s=a,a+=n<<(u=_e[c])|n>>>32-u;for(;c<48;++c)n=i+(a^s^o)+we[c]+t[Te[c]],i=o,o=s,s=a,a+=n<<(u=_e[c])|n>>>32-u;for(;c<64;++c)n=i+(s^(a|~o))+we[c]+t[Te[c]],i=o,o=s,s=a,a+=n<<(u=_e[c])|n>>>32-u;e.h0=e.h0+i|0,e.h1=e.h1+a|0,e.h2=e.h2+s|0,e.h3=e.h3+o|0,l-=64}}var Be=S,ke=Be.pem=Be.pem||{};function Ne(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 Re(e){return e.replace(/^\s+/,"")}ke.encode=function(e,t){t=t||{};var r,n="-----BEGIN "+e.type+"-----\r\n";if(e.procType&&(n+=Ne(r={name:"Proc-Type",values:[String(e.procType.version),e.procType.type]})),e.contentDomain&&(n+=Ne(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),n+=Ne(r)),e.headers)for(var i=0;i<e.headers.length;++i)n+=Ne(e.headers[i]);return e.procType&&(n+="\r\n"),n+=Be.util.encode64(e.body,t.maxline||64)+"\r\n",n+="-----END "+e.type+"-----\r\n"},ke.decode=function(e){for(var t,r=[],n=/\s*-----BEGIN ([A-Z0-9- ]+)-----\r?\n?([\x21-\x7e\s]+?(?:\r?\n\r?\n))?([:A-Za-z0-9+\/=\s]+?)-----END \1-----/g,i=/([\x21-\x7e]+):\s*([\x21-\x7e\s^:]+)/,a=/\r?\n/;t=n.exec(e);){var s={type:t[1],procType:null,contentDomain:null,dekInfo:null,headers:[],body:Be.util.decode64(t[3])};if(r.push(s),t[2]){for(var o=t[2].split(a),u=0;t&&u<o.length;){for(var c=o[u].replace(/\s+$/,""),l=u+1;l<o.length;++l){var h=o[l];if(!/\s/.test(h[0]))break;c+=h,u=l}if(t=c.match(i)){for(var f={name:t[1],values:[]},d=t[2].split(","),p=0;p<d.length;++p)f.values.push(Re(d[p]));if(s.procType)if(s.contentDomain||"Content-Domain"!==f.name)if(s.dekInfo||"DEK-Info"!==f.name)s.headers.push(f);else{if(0===f.values.length)throw new Error('Invalid PEM formatted message. The "DEK-Info" header must have at least one subfield.');s.dekInfo={algorithm:d[0],parameters:d[1]||null}}else s.contentDomain=d[0]||"";else{if("Proc-Type"!==f.name)throw new Error('Invalid PEM formatted message. The first encapsulated header must be "Proc-Type".');if(2!==f.values.length)throw new Error('Invalid PEM formatted message. The "Proc-Type" header must have two subfields.');s.procType={version:d[0],type:d[1]}}}++u}if("ENCRYPTED"===s.procType&&!s.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};var Le=S;function De(e,t){Le.cipher.registerAlgorithm(e,(function(){return new Le.des.Algorithm(e,t)}))}Le.des=Le.des||{},Le.des.startEncrypting=function(e,t,r,n){var i=je({key:e,output:r,decrypt:!1,mode:n||(null===t?"ECB":"CBC")});return i.start(t),i},Le.des.createEncryptionCipher=function(e,t){return je({key:e,output:null,decrypt:!1,mode:t})},Le.des.startDecrypting=function(e,t,r,n){var i=je({key:e,output:r,decrypt:!0,mode:n||(null===t?"ECB":"CBC")});return i.start(t),i},Le.des.createDecryptionCipher=function(e,t){return je({key:e,output:null,decrypt:!0,mode:t})},Le.des.Algorithm=function(e,t){var r=this;r.name=e,r.mode=new t({blockSize:8,cipher:{encrypt:function(e,t){return ze(r._keys,e,t,!1)},decrypt:function(e,t){return ze(r._keys,e,t,!0)}}}),r._init=!1},Le.des.Algorithm.prototype.initialize=function(e){if(!this._init){var t=Le.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],u=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],c=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],l=[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],f=[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,m=[],v=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],C=0,E=0;E<y;E++){var b=e.getInt32(),S=e.getInt32();b^=(t=252645135&(b>>>4^S))<<4,b^=t=65535&((S^=t)>>>-16^b),b^=(t=858993459&(b>>>2^(S^=t<<-16)))<<2,b^=t=65535&((S^=t)>>>-16^b),b^=(t=1431655765&(b>>>1^(S^=t<<-16)))<<1,b^=t=16711935&((S^=t)>>>8^b),t=(b^=(t=1431655765&(b>>>1^(S^=t<<8)))<<1)<<8|(S^=t)>>>20&240,b=S<<24|S<<8&16711680|S>>>8&65280|S>>>24&240,S=t;for(var T=0;T<v.length;++T){v[T]?(b=b<<2|b>>>26,S=S<<2|S>>>26):(b=b<<1|b>>>27,S=S<<1|S>>>27),S&=-15;var _=r[(b&=-15)>>>28]|n[b>>>24&15]|i[b>>>20&15]|a[b>>>16&15]|s[b>>>12&15]|o[b>>>8&15]|u[b>>>4&15],w=c[S>>>28]|l[S>>>24&15]|h[S>>>20&15]|f[S>>>16&15]|d[S>>>12&15]|p[S>>>8&15]|g[S>>>4&15];t=65535&(w>>>16^_),m[C++]=_^t,m[C++]=w^t<<16}}return m}(t),this._init=!0}},De("DES-ECB",Le.cipher.modes.ecb),De("DES-CBC",Le.cipher.modes.cbc),De("DES-CFB",Le.cipher.modes.cfb),De("DES-OFB",Le.cipher.modes.ofb),De("DES-CTR",Le.cipher.modes.ctr),De("3DES-ECB",Le.cipher.modes.ecb),De("3DES-CBC",Le.cipher.modes.cbc),De("3DES-CFB",Le.cipher.modes.cfb),De("3DES-OFB",Le.cipher.modes.ofb),De("3DES-CTR",Le.cipher.modes.ctr);var Ue=[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],xe=[-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],Oe=[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],Pe=[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],Ve=[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],Ke=[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],Me=[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],Fe=[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 ze(e,t,r,n){var i,a,s=32===e.length?3:9;i=3===s?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 o=t[0],u=t[1];o^=(a=252645135&(o>>>4^u))<<4,o^=(a=65535&(o>>>16^(u^=a)))<<16,o^=a=858993459&((u^=a)>>>2^o),o^=a=16711935&((u^=a<<2)>>>8^o),o=(o^=(a=1431655765&(o>>>1^(u^=a<<8)))<<1)<<1|o>>>31,u=(u^=a)<<1|u>>>31;for(var c=0;c<s;c+=3){for(var l=i[c+1],h=i[c+2],f=i[c];f!=l;f+=h){var d=u^e[f],p=(u>>>4|u<<28)^e[f+1];a=o,o=u,u=a^(xe[d>>>24&63]|Pe[d>>>16&63]|Ke[d>>>8&63]|Fe[63&d]|Ue[p>>>24&63]|Oe[p>>>16&63]|Ve[p>>>8&63]|Me[63&p])}a=o,o=u,u=a}u=u>>>1|u<<31,u^=a=1431655765&((o=o>>>1|o<<31)>>>1^u),u^=(a=16711935&(u>>>8^(o^=a<<1)))<<8,u^=(a=858993459&(u>>>2^(o^=a)))<<2,u^=a=65535&((o^=a)>>>16^u),u^=a=252645135&((o^=a<<16)>>>4^u),o^=a<<4,r[0]=o,r[1]=u}function je(e){var t,r="DES-"+((e=e||{}).mode||"CBC").toUpperCase(),n=(t=e.decrypt?Le.cipher.createDecipher(r,e.key):Le.cipher.createCipher(r,e.key)).start;return t.start=function(e,r){var i=null;r instanceof Le.util.ByteBuffer&&(i=r,r={}),(r=r||{}).output=i,r.iv=e,n.call(t,r)},t}var qe,He=S,Ge=He.pkcs5=He.pkcs5||{};He.util.isNodejs&&!He.options.usePureJavaScript&&(qe=s),He.pbkdf2=Ge.pbkdf2=function(e,t,r,n,i,a){if("function"==typeof i&&(a=i,i=null),He.util.isNodejs&&!He.options.usePureJavaScript&&qe.pbkdf2&&(null===i||"object"!=typeof i)&&(qe.pbkdf2Sync.length>4||!i||"sha1"===i))return"string"!=typeof i&&(i="sha1"),e=Buffer.from(e,"binary"),t=Buffer.from(t,"binary"),a?4===qe.pbkdf2Sync.length?qe.pbkdf2(e,t,r,n,(function(e,t){if(e)return a(e);a(null,t.toString("binary"))})):qe.pbkdf2(e,t,r,n,i,(function(e,t){if(e)return a(e);a(null,t.toString("binary"))})):4===qe.pbkdf2Sync.length?qe.pbkdf2Sync(e,t,r,n).toString("binary"):qe.pbkdf2Sync(e,t,r,n,i).toString("binary");if(null==i&&(i="sha1"),"string"==typeof i){if(!(i in He.md.algorithms))throw new Error("Unknown hash algorithm: "+i);i=He.md[i].create()}var s=i.digestLength;if(n>4294967295*s){var o=new Error("Derived key is too long.");if(a)return a(o);throw o}var u=Math.ceil(n/s),c=n-(u-1)*s,l=He.hmac.create();l.start(i,e);var h,f,d,p="";if(!a){for(var g=1;g<=u;++g){l.start(null,null),l.update(t),l.update(He.util.int32ToBytes(g)),h=d=l.digest().getBytes();for(var y=2;y<=r;++y)l.start(null,null),l.update(d),f=l.digest().getBytes(),h=He.util.xorBytes(h,f,s),d=f;p+=g<u?h:h.substr(0,c)}return p}g=1;function m(){if(g>u)return a(null,p);l.start(null,null),l.update(t),l.update(He.util.int32ToBytes(g)),h=d=l.digest().getBytes(),y=2,v()}function v(){if(y<=r)return l.start(null,null),l.update(d),f=l.digest().getBytes(),h=He.util.xorBytes(h,f,s),d=f,++y,He.util.setImmediate(v);p+=g<u?h:h.substr(0,c),++g,m()}m()};var We=S,Qe=We.sha256=We.sha256||{};We.md.sha256=We.md.algorithms.sha256=Qe,Qe.create=function(){Ze||(Ye=String.fromCharCode(128),Ye+=We.util.fillString(String.fromCharCode(0),64),Xe=[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],Ze=!0);var e=null,t=We.util.createBuffer(),r=new Array(64),n={algorithm:"sha256",blockLength:64,digestLength:32,messageLength:0,fullMessageLength:null,messageLengthSize:8,start:function(){n.messageLength=0,n.fullMessageLength=n.messageLength64=[];for(var r=n.messageLengthSize/4,i=0;i<r;++i)n.fullMessageLength.push(0);return t=We.util.createBuffer(),e={h0:1779033703,h1:3144134277,h2:1013904242,h3:2773480762,h4:1359893119,h5:2600822924,h6:528734635,h7:1541459225},n}};return n.start(),n.update=function(i,a){"utf8"===a&&(i=We.util.encodeUtf8(i));var s=i.length;n.messageLength+=s,s=[s/4294967296>>>0,s>>>0];for(var o=n.fullMessageLength.length-1;o>=0;--o)n.fullMessageLength[o]+=s[1],s[1]=s[0]+(n.fullMessageLength[o]/4294967296>>>0),n.fullMessageLength[o]=n.fullMessageLength[o]>>>0,s[0]=s[1]/4294967296>>>0;return t.putBytes(i),$e(e,r,t),(t.read>2048||0===t.length())&&t.compact(),n},n.digest=function(){var i=We.util.createBuffer();i.putBytes(t.bytes());var a,s=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize&n.blockLength-1;i.putBytes(Ye.substr(0,n.blockLength-s));for(var o=8*n.fullMessageLength[0],u=0;u<n.fullMessageLength.length-1;++u)o+=(a=8*n.fullMessageLength[u+1])/4294967296>>>0,i.putInt32(o>>>0),o=a>>>0;i.putInt32(o);var c={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4,h5:e.h5,h6:e.h6,h7:e.h7};$e(c,r,i);var l=We.util.createBuffer();return l.putInt32(c.h0),l.putInt32(c.h1),l.putInt32(c.h2),l.putInt32(c.h3),l.putInt32(c.h4),l.putInt32(c.h5),l.putInt32(c.h6),l.putInt32(c.h7),l},n};var Ye=null,Ze=!1,Xe=null;function $e(e,t,r){for(var n,i,a,s,o,u,c,l,h,f,d,p,g,y=r.length();y>=64;){for(o=0;o<16;++o)t[o]=r.getInt32();for(;o<64;++o)n=((n=t[o-2])>>>17|n<<15)^(n>>>19|n<<13)^n>>>10,i=((i=t[o-15])>>>7|i<<25)^(i>>>18|i<<14)^i>>>3,t[o]=n+t[o-7]+i+t[o-16]|0;for(u=e.h0,c=e.h1,l=e.h2,h=e.h3,f=e.h4,d=e.h5,p=e.h6,g=e.h7,o=0;o<64;++o)a=(u>>>2|u<<30)^(u>>>13|u<<19)^(u>>>22|u<<10),s=u&c|l&(u^c),n=g+((f>>>6|f<<26)^(f>>>11|f<<21)^(f>>>25|f<<7))+(p^f&(d^p))+Xe[o]+t[o],g=p,p=d,d=f,f=h+n>>>0,h=l,l=c,c=u,u=n+(i=a+s)>>>0;e.h0=e.h0+u|0,e.h1=e.h1+c|0,e.h2=e.h2+l|0,e.h3=e.h3+h|0,e.h4=e.h4+f|0,e.h5=e.h5+d|0,e.h6=e.h6+p|0,e.h7=e.h7+g|0,y-=64}}var Je=S,et=null;!Je.util.isNodejs||Je.options.usePureJavaScript||process.versions["node-webkit"]||(et=s),(Je.prng=Je.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),i=0;i<32;++i)n[i]=r.create();function a(){if(t.pools[0].messageLength>=32)return s();var e=32-t.pools[0].messageLength<<5;t.collect(t.seedFileSync(e)),s()}function s(){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 o(e){var t=null,r=Je.util.globalScope,n=r.crypto||r.msCrypto;n&&n.getRandomValues&&(t=function(e){return n.getRandomValues(e)});var i=Je.util.createBuffer();if(t)for(;i.length()<e;){var a=Math.max(1,Math.min(e-i.length(),65536)/4),s=new Uint32Array(Math.floor(a));try{t(s);for(var o=0;o<s.length;++o)i.putInt32(s[o])}catch(e){if(!("undefined"!=typeof QuotaExceededError&&e instanceof QuotaExceededError))throw e}}if(i.length()<e)for(var u,c,l,h=Math.floor(65536*Math.random());i.length()<e;){c=16807*(65535&h),c+=(32767&(u=16807*(h>>16)))<<16,h=4294967295&(c=(2147483647&(c+=u>>15))+(c>>31));for(o=0;o<3;++o)l=h>>>(o<<3),l^=Math.floor(256*Math.random()),i.putByte(String.fromCharCode(255&l))}return i.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,i=t.plugin.increment,a=t.plugin.formatKey,o=t.plugin.formatSeed,u=Je.util.createBuffer();t.key=null,function c(l){if(l)return r(l);if(u.length()>=e)return r(null,u.getBytes(e));t.generated>1048575&&(t.key=null);if(null===t.key)return Je.util.nextTick((function(){!function(e){if(t.pools[0].messageLength>=32)return s(),e();var r=32-t.pools[0].messageLength<<5;t.seedFile(r,(function(r,n){if(r)return e(r);t.collect(n),s(),e()}))}(c)}));var h=n(t.key,t.seed);t.generated+=h.length,u.putBytes(h),t.key=a(n(t.key,i(t.seed))),t.seed=o(n(t.key,t.seed)),Je.util.setImmediate(c)}()},t.generateSync=function(e){var r=t.plugin.cipher,n=t.plugin.increment,i=t.plugin.formatKey,s=t.plugin.formatSeed;t.key=null;for(var o=Je.util.createBuffer();o.length()<e;){t.generated>1048575&&(t.key=null),null===t.key&&a();var u=r(t.key,t.seed);t.generated+=u.length,o.putBytes(u),t.key=i(r(t.key,n(t.seed))),t.seed=s(r(t.key,t.seed))}return o.getBytes(e)},et?(t.seedFile=function(e,t){et.randomBytes(e,(function(e,r){if(e)return t(e);t(null,r.toString())}))},t.seedFileSync=function(e){return et.randomBytes(e).toString()}):(t.seedFile=function(e,t){try{t(null,o(e))}catch(e){t(e)}},t.seedFileSync=o),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){if(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}}})};else{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};var tt=S;tt.random&&tt.random.getBytes?tt.random:function(e){var t={},r=new Array(4),n=tt.util.createBuffer();function i(){var e=tt.prng.create(t);return e.getBytes=function(t,r){return e.generate(t,r)},e.getBytesSync=function(t){return e.generate(t)},e}t.formatKey=function(e){var t=tt.util.createBuffer(e);return(e=new Array(4))[0]=t.getInt32(),e[1]=t.getInt32(),e[2]=t.getInt32(),e[3]=t.getInt32(),tt.aes._expandKey(e,!1)},t.formatSeed=function(e){var t=tt.util.createBuffer(e);return(e=new Array(4))[0]=t.getInt32(),e[1]=t.getInt32(),e[2]=t.getInt32(),e[3]=t.getInt32(),e},t.cipher=function(e,t){return tt.aes._updateBlock(e,t,r,!1),n.putInt32(r[0]),n.putInt32(r[1]),n.putInt32(r[2]),n.putInt32(r[3]),n.getBytes()},t.increment=function(e){return++e[3],e},t.md=tt.md.sha256;var a=i(),s=null,o=tt.util.globalScope,u=o.crypto||o.msCrypto;if(u&&u.getRandomValues&&(s=function(e){return u.getRandomValues(e)}),tt.options.usePureJavaScript||!tt.util.isNodejs&&!s){if(a.collectInt(+new Date,32),"undefined"!=typeof navigator){var c="";for(var l in navigator)try{"string"==typeof navigator[l]&&(c+=navigator[l])}catch(e){}a.collect(c),c=null}e&&(e().mousemove((function(e){a.collectInt(e.clientX,16),a.collectInt(e.clientY,16)})),e().keypress((function(e){a.collectInt(e.charCode,8)})))}if(tt.random)for(var l in a)tt.random[l]=a[l];else tt.random=a;tt.random.createInstance=i,tt.random}("undefined"!=typeof jQuery?jQuery:null);var rt=S,nt=[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],it=[1,2,3,5],at=function(e,t){return e<<t&65535|(65535&e)>>16-t},st=function(e,t){return(65535&e)>>t|e<<16-t&65535};rt.rc2=rt.rc2||{},rt.rc2.expandKey=function(e,t){"string"==typeof e&&(e=rt.util.createBuffer(e)),t=t||128;var r,n=e,i=e.length(),a=t,s=Math.ceil(a/8),o=255>>(7&a);for(r=i;r<128;r++)n.putByte(nt[n.at(r-1)+n.at(r-i)&255]);for(n.setAt(128-s,nt[n.at(128-s)&o]),r=127-s;r>=0;r--)n.setAt(r,nt[n.at(r+1)^n.at(r+s)]);return n};var ot=function(e,t,r){var n,i,a,s,o=!1,u=null,c=null,l=null,h=[];for(e=rt.rc2.expandKey(e,t),a=0;a<64;a++)h.push(e.getInt16Le());r?(n=function(e){for(a=0;a<4;a++)e[a]+=h[s]+(e[(a+3)%4]&e[(a+2)%4])+(~e[(a+3)%4]&e[(a+1)%4]),e[a]=at(e[a],it[a]),s++},i=function(e){for(a=0;a<4;a++)e[a]+=h[63&e[(a+3)%4]]}):(n=function(e){for(a=3;a>=0;a--)e[a]=st(e[a],it[a]),e[a]-=h[s]+(e[(a+3)%4]&e[(a+2)%4])+(~e[(a+3)%4]&e[(a+1)%4]),s--},i=function(e){for(a=3;a>=0;a--)e[a]-=h[63&e[(a+3)%4]]});var f=function(e){var t=[];for(a=0;a<4;a++){var n=u.getInt16Le();null!==l&&(r?n^=l.getInt16Le():l.putInt16Le(n)),t.push(65535&n)}s=r?0:63;for(var i=0;i<e.length;i++)for(var o=0;o<e[i][0];o++)e[i][1](t);for(a=0;a<4;a++)null!==l&&(r?l.putInt16Le(t[a]):t[a]^=l.getInt16Le()),c.putInt16Le(t[a])},d=null;return d={start:function(e,t){e&&"string"==typeof e&&(e=rt.util.createBuffer(e)),o=!1,u=rt.util.createBuffer(),c=t||new rt.util.createBuffer,l=e,d.output=c},update:function(e){for(o||u.putBuffer(e);u.length()>=8;)f([[5,n],[1,i],[6,n],[1,i],[5,n]])},finish:function(e){var t=!0;if(r)if(e)t=e(8,u,!r);else{var n=8===u.length()?8:8-u.length();u.fillWithByte(n,n)}if(t&&(o=!0,d.update()),!r&&(t=0===u.length()))if(e)t=e(8,c,!r);else{var i=c.length(),a=c.at(i-1);a>i?t=!1:c.truncate(a)}return t}}};rt.rc2.startEncrypting=function(e,t,r){var n=rt.rc2.createEncryptionCipher(e,128);return n.start(t,r),n},rt.rc2.createEncryptionCipher=function(e,t){return ot(e,t,!0)},rt.rc2.startDecrypting=function(e,t,r){var n=rt.rc2.createDecryptionCipher(e,128);return n.start(t,r),n},rt.rc2.createDecryptionCipher=function(e,t){return ot(e,t,!1)};var ut,ct=S;function lt(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 ht(){return new lt(null)}function ft(e,t,r,n,i,a){for(var s=16383&t,o=t>>14;--a>=0;){var u=16383&this.data[e],c=this.data[e++]>>14,l=o*u+c*s;i=((u=s*u+((16383&l)<<14)+r.data[n]+i)>>28)+(l>>14)+o*c,r.data[n++]=268435455&u}return i}ct.jsbn=ct.jsbn||{},ct.jsbn.BigInteger=lt,"undefined"==typeof navigator?(lt.prototype.am=ft,ut=28):"Microsoft Internet Explorer"==navigator.appName?(lt.prototype.am=function(e,t,r,n,i,a){for(var s=32767&t,o=t>>15;--a>=0;){var u=32767&this.data[e],c=this.data[e++]>>15,l=o*u+c*s;i=((u=s*u+((32767&l)<<15)+r.data[n]+(1073741823&i))>>>30)+(l>>>15)+o*c+(i>>>30),r.data[n++]=1073741823&u}return i},ut=30):"Netscape"!=navigator.appName?(lt.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},ut=26):(lt.prototype.am=ft,ut=28),lt.prototype.DB=ut,lt.prototype.DM=(1<<ut)-1,lt.prototype.DV=1<<ut;lt.prototype.FV=Math.pow(2,52),lt.prototype.F1=52-ut,lt.prototype.F2=2*ut-52;var dt,pt,gt="0123456789abcdefghijklmnopqrstuvwxyz",yt=new Array;for(dt="0".charCodeAt(0),pt=0;pt<=9;++pt)yt[dt++]=pt;for(dt="a".charCodeAt(0),pt=10;pt<36;++pt)yt[dt++]=pt;for(dt="A".charCodeAt(0),pt=10;pt<36;++pt)yt[dt++]=pt;function mt(e){return gt.charAt(e)}function vt(e,t){var r=yt[e.charCodeAt(t)];return null==r?-1:r}function Ct(e){var t=ht();return t.fromInt(e),t}function Et(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 bt(e){this.m=e}function St(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 Tt(e,t){return e&t}function _t(e,t){return e|t}function wt(e,t){return e^t}function It(e,t){return e&~t}function At(e){if(0==e)return-1;var t=0;return 0==(65535&e)&&(e>>=16,t+=16),0==(255&e)&&(e>>=8,t+=8),0==(15&e)&&(e>>=4,t+=4),0==(3&e)&&(e>>=2,t+=2),0==(1&e)&&++t,t}function Bt(e){for(var t=0;0!=e;)e&=e-1,++t;return t}function kt(){}function Nt(e){return e}function Rt(e){this.r2=ht(),this.q3=ht(),lt.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}bt.prototype.convert=function(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e},bt.prototype.revert=function(e){return e},bt.prototype.reduce=function(e){e.divRemTo(this.m,null,e)},bt.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},bt.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},St.prototype.convert=function(e){var t=ht();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(lt.ZERO)>0&&this.m.subTo(t,t),t},St.prototype.revert=function(e){var t=ht();return e.copyTo(t),this.reduce(t),t},St.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)},St.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},St.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},lt.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},lt.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},lt.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]:vt(e,n);s<0?"-"==e.charAt(n)&&(i=!0):(i=!1,0==a?this.data[this.t++]=s:a+r>this.DB?(this.data[this.t-1]|=(s&(1<<this.DB-a)-1)<<a,this.data[this.t++]=s>>this.DB-a):this.data[this.t-1]|=s<<a,(a+=r)>=this.DB&&(a-=this.DB))}8==r&&0!=(128&e[0])&&(this.s=-1,a>0&&(this.data[this.t-1]|=(1<<this.DB-a)-1<<a)),this.clamp(),i&&lt.ZERO.subTo(this,this)},lt.prototype.clamp=function(){for(var e=this.s&this.DM;this.t>0&&this.data[this.t-1]==e;)--this.t},lt.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},lt.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},lt.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()},lt.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()}},lt.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()},lt.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&&lt.ZERO.subTo(t,t)},lt.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()},lt.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=ht());var a=ht(),s=this.s,o=e.s,u=this.DB-Et(n.data[n.t-1]);u>0?(n.lShiftTo(u,a),i.lShiftTo(u,r)):(n.copyTo(a),i.copyTo(r));var c=a.t,l=a.data[c-1];if(0!=l){var h=l*(1<<this.F1)+(c>1?a.data[c-2]>>this.F2:0),f=this.FV/h,d=(1<<this.F1)/h,p=1<<this.F2,g=r.t,y=g-c,m=null==t?ht():t;for(a.dlShiftTo(y,m),r.compareTo(m)>=0&&(r.data[r.t++]=1,r.subTo(m,r)),lt.ONE.dlShiftTo(c,m),m.subTo(a,a);a.t<c;)a.data[a.t++]=0;for(;--y>=0;){var v=r.data[--g]==l?this.DM:Math.floor(r.data[g]*f+(r.data[g-1]+p)*d);if((r.data[g]+=a.am(0,v,r,y,0,c))<v)for(a.dlShiftTo(y,m),r.subTo(m,r);r.data[g]<--v;)r.subTo(m,r)}null!=t&&(r.drShiftTo(c,t),s!=o&&lt.ZERO.subTo(t,t)),r.t=c,r.clamp(),u>0&&r.rShiftTo(u,r),s<0&&lt.ZERO.subTo(r,r)}}},lt.prototype.invDigit=function(){if(this.t<1)return 0;var e=this.data[0];if(0==(1&e))return 0;var t=3&e;return(t=(t=(t=(t=t*(2-(15&e)*t)&15)*(2-(255&e)*t)&255)*(2-((65535&e)*t&65535))&65535)*(2-e*t%this.DV)%this.DV)>0?this.DV-t:-t},lt.prototype.isEven=function(){return 0==(this.t>0?1&this.data[0]:this.s)},lt.prototype.exp=function(e,t){if(e>4294967295||e<1)return lt.ONE;var r=ht(),n=ht(),i=t.convert(this),a=Et(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)},lt.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=mt(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+=mt(r));return i?a:"0"},lt.prototype.negate=function(){var e=ht();return lt.ZERO.subTo(this,e),e},lt.prototype.abs=function(){return this.s<0?this.negate():this},lt.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},lt.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+Et(this.data[this.t-1]^this.s&this.DM)},lt.prototype.mod=function(e){var t=ht();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(lt.ZERO)>0&&e.subTo(t,t),t},lt.prototype.modPowInt=function(e,t){var r;return r=e<256||t.isEven()?new bt(t):new St(t),this.exp(e,r)},lt.ZERO=Ct(0),lt.ONE=Ct(1),kt.prototype.convert=Nt,kt.prototype.revert=Nt,kt.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r)},kt.prototype.sqrTo=function(e,t){e.squareTo(t)},Rt.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=ht();return e.copyTo(t),this.reduce(t),t},Rt.prototype.revert=function(e){return e},Rt.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)},Rt.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},Rt.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)};var Lt=[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],Dt=(1<<26)/Lt[Lt.length-1];lt.prototype.chunkSize=function(e){return Math.floor(Math.LN2*this.DB/Math.log(e))},lt.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=Ct(r),i=ht(),a=ht(),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},lt.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 u=vt(e,o);u<0?"-"==e.charAt(o)&&0==this.signum()&&(i=!0):(s=t*s+u,++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&&lt.ZERO.subTo(this,this)},lt.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(lt.ONE.shiftLeft(e-1),_t,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(lt.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)}},lt.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()},lt.prototype.changeBit=function(e,t){var r=lt.ONE.shiftLeft(e);return this.bitwiseTo(r,t,r),r},lt.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()},lt.prototype.dMultiply=function(e){this.data[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()},lt.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]}},lt.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()},lt.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)},lt.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},lt.prototype.millerRabin=function(e){var t=this.subtract(lt.ONE),r=t.getLowestSetBit();if(r<=0)return!1;for(var n,i=t.shiftRight(r),a={nextBytes:function(e){for(var t=0;t<e.length;++t)e[t]=Math.floor(256*Math.random())}},s=0;s<e;++s){do{n=new lt(this.bitLength(),a)}while(n.compareTo(lt.ONE)<=0||n.compareTo(t)>=0);var o=n.modPow(i,this);if(0!=o.compareTo(lt.ONE)&&0!=o.compareTo(t)){for(var u=1;u++<r&&0!=o.compareTo(t);)if(0==(o=o.modPowInt(2,this)).compareTo(lt.ONE))return!1;if(0!=o.compareTo(t))return!1}}return!0},lt.prototype.clone=function(){var e=ht();return this.copyTo(e),e},lt.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]},lt.prototype.byteValue=function(){return 0==this.t?this.s:this.data[0]<<24>>24},lt.prototype.shortValue=function(){return 0==this.t?this.s:this.data[0]<<16>>16},lt.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this.data[0]<=0?0:1},lt.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)),0!=(128&r)&&(r|=-256),0==i&&(128&this.s)!=(128&r)&&++i,(i>0||r!=this.s)&&(t[i++]=r);return t},lt.prototype.equals=function(e){return 0==this.compareTo(e)},lt.prototype.min=function(e){return this.compareTo(e)<0?this:e},lt.prototype.max=function(e){return this.compareTo(e)>0?this:e},lt.prototype.and=function(e){var t=ht();return this.bitwiseTo(e,Tt,t),t},lt.prototype.or=function(e){var t=ht();return this.bitwiseTo(e,_t,t),t},lt.prototype.xor=function(e){var t=ht();return this.bitwiseTo(e,wt,t),t},lt.prototype.andNot=function(e){var t=ht();return this.bitwiseTo(e,It,t),t},lt.prototype.not=function(){for(var e=ht(),t=0;t<this.t;++t)e.data[t]=this.DM&~this.data[t];return e.t=this.t,e.s=~this.s,e},lt.prototype.shiftLeft=function(e){var t=ht();return e<0?this.rShiftTo(-e,t):this.lShiftTo(e,t),t},lt.prototype.shiftRight=function(e){var t=ht();return e<0?this.lShiftTo(-e,t):this.rShiftTo(e,t),t},lt.prototype.getLowestSetBit=function(){for(var e=0;e<this.t;++e)if(0!=this.data[e])return e*this.DB+At(this.data[e]);return this.s<0?this.t*this.DB:-1},lt.prototype.bitCount=function(){for(var e=0,t=this.s&this.DM,r=0;r<this.t;++r)e+=Bt(this.data[r]^t);return e},lt.prototype.testBit=function(e){var t=Math.floor(e/this.DB);return t>=this.t?0!=this.s:0!=(this.data[t]&1<<e%this.DB)},lt.prototype.setBit=function(e){return this.changeBit(e,_t)},lt.prototype.clearBit=function(e){return this.changeBit(e,It)},lt.prototype.flipBit=function(e){return this.changeBit(e,wt)},lt.prototype.add=function(e){var t=ht();return this.addTo(e,t),t},lt.prototype.subtract=function(e){var t=ht();return this.subTo(e,t),t},lt.prototype.multiply=function(e){var t=ht();return this.multiplyTo(e,t),t},lt.prototype.divide=function(e){var t=ht();return this.divRemTo(e,t,null),t},lt.prototype.remainder=function(e){var t=ht();return this.divRemTo(e,null,t),t},lt.prototype.divideAndRemainder=function(e){var t=ht(),r=ht();return this.divRemTo(e,t,r),new Array(t,r)},lt.prototype.modPow=function(e,t){var r,n,i=e.bitLength(),a=Ct(1);if(i<=0)return a;r=i<18?1:i<48?3:i<144?4:i<768?5:6,n=i<8?new bt(t):t.isEven()?new Rt(t):new St(t);var s=new Array,o=3,u=r-1,c=(1<<r)-1;if(s[1]=n.convert(this),r>1){var l=ht();for(n.sqrTo(s[1],l);o<=c;)s[o]=ht(),n.mulTo(l,s[o-2],s[o]),o+=2}var h,f,d=e.t-1,p=!0,g=ht();for(i=Et(e.data[d])-1;d>=0;){for(i>=u?h=e.data[d]>>i-u&c:(h=(e.data[d]&(1<<i+1)-1)<<u-i,d>0&&(h|=e.data[d-1]>>this.DB+i-u)),o=r;0==(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):(f=a,a=g,g=f),n.mulTo(g,s[h],a)}for(;d>=0&&0==(e.data[d]&1<<i);)n.sqrTo(a,g),f=a,a=g,g=f,--i<0&&(i=this.DB-1,--d)}return n.revert(a)},lt.prototype.modInverse=function(e){var t=e.isEven();if(this.isEven()&&t||0==e.signum())return lt.ZERO;for(var r=e.clone(),n=this.clone(),i=Ct(1),a=Ct(0),s=Ct(0),o=Ct(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(lt.ONE)?lt.ZERO:o.compareTo(e)>=0?o.subtract(e):o.signum()<0?(o.addTo(e,o),o.signum()<0?o.add(e):o):o},lt.prototype.pow=function(e){return this.exp(e,new kt)},lt.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},lt.prototype.isProbablePrime=function(e){var t,r=this.abs();if(1==r.t&&r.data[0]<=Lt[Lt.length-1]){for(t=0;t<Lt.length;++t)if(r.data[0]==Lt[t])return!0;return!1}if(r.isEven())return!1;for(t=1;t<Lt.length;){for(var n=Lt[t],i=t+1;i<Lt.length&&n<Dt;)n*=Lt[i++];for(n=r.modInt(n);t<i;)if(n%Lt[t++]==0)return!1}return r.millerRabin(e)};var Ut=S,xt=Ut.sha1=Ut.sha1||{};Ut.md.sha1=Ut.md.algorithms.sha1=xt,xt.create=function(){Pt||(Ot=String.fromCharCode(128),Ot+=Ut.util.fillString(String.fromCharCode(0),64),Pt=!0);var e=null,t=Ut.util.createBuffer(),r=new Array(80),n={algorithm:"sha1",blockLength:64,digestLength:20,messageLength:0,fullMessageLength:null,messageLengthSize:8,start:function(){n.messageLength=0,n.fullMessageLength=n.messageLength64=[];for(var r=n.messageLengthSize/4,i=0;i<r;++i)n.fullMessageLength.push(0);return t=Ut.util.createBuffer(),e={h0:1732584193,h1:4023233417,h2:2562383102,h3:271733878,h4:3285377520},n}};return n.start(),n.update=function(i,a){"utf8"===a&&(i=Ut.util.encodeUtf8(i));var s=i.length;n.messageLength+=s,s=[s/4294967296>>>0,s>>>0];for(var o=n.fullMessageLength.length-1;o>=0;--o)n.fullMessageLength[o]+=s[1],s[1]=s[0]+(n.fullMessageLength[o]/4294967296>>>0),n.fullMessageLength[o]=n.fullMessageLength[o]>>>0,s[0]=s[1]/4294967296>>>0;return t.putBytes(i),Vt(e,r,t),(t.read>2048||0===t.length())&&t.compact(),n},n.digest=function(){var i=Ut.util.createBuffer();i.putBytes(t.bytes());var a,s=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize&n.blockLength-1;i.putBytes(Ot.substr(0,n.blockLength-s));for(var o=8*n.fullMessageLength[0],u=0;u<n.fullMessageLength.length-1;++u)o+=(a=8*n.fullMessageLength[u+1])/4294967296>>>0,i.putInt32(o>>>0),o=a>>>0;i.putInt32(o);var c={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4};Vt(c,r,i);var l=Ut.util.createBuffer();return l.putInt32(c.h0),l.putInt32(c.h1),l.putInt32(c.h2),l.putInt32(c.h3),l.putInt32(c.h4),l},n};var Ot=null,Pt=!1;function Vt(e,t,r){for(var n,i,a,s,o,u,c,l=r.length();l>=64;){for(i=e.h0,a=e.h1,s=e.h2,o=e.h3,u=e.h4,c=0;c<16;++c)n=r.getInt32(),t[c]=n,n=(i<<5|i>>>27)+(o^a&(s^o))+u+1518500249+n,u=o,o=s,s=(a<<30|a>>>2)>>>0,a=i,i=n;for(;c<20;++c)n=(n=t[c-3]^t[c-8]^t[c-14]^t[c-16])<<1|n>>>31,t[c]=n,n=(i<<5|i>>>27)+(o^a&(s^o))+u+1518500249+n,u=o,o=s,s=(a<<30|a>>>2)>>>0,a=i,i=n;for(;c<32;++c)n=(n=t[c-3]^t[c-8]^t[c-14]^t[c-16])<<1|n>>>31,t[c]=n,n=(i<<5|i>>>27)+(a^s^o)+u+1859775393+n,u=o,o=s,s=(a<<30|a>>>2)>>>0,a=i,i=n;for(;c<40;++c)n=(n=t[c-6]^t[c-16]^t[c-28]^t[c-32])<<2|n>>>30,t[c]=n,n=(i<<5|i>>>27)+(a^s^o)+u+1859775393+n,u=o,o=s,s=(a<<30|a>>>2)>>>0,a=i,i=n;for(;c<60;++c)n=(n=t[c-6]^t[c-16]^t[c-28]^t[c-32])<<2|n>>>30,t[c]=n,n=(i<<5|i>>>27)+(a&s|o&(a^s))+u+2400959708+n,u=o,o=s,s=(a<<30|a>>>2)>>>0,a=i,i=n;for(;c<80;++c)n=(n=t[c-6]^t[c-16]^t[c-28]^t[c-32])<<2|n>>>30,t[c]=n,n=(i<<5|i>>>27)+(a^s^o)+u+3395469782+n,u=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+u|0,l-=64}}var Kt=S,Mt=Kt.pkcs1=Kt.pkcs1||{};function Ft(e,t,r){r||(r=Kt.md.sha1.create());for(var n="",i=Math.ceil(t/r.digestLength),a=0;a<i;++a){var s=String.fromCharCode(a>>24&255,a>>16&255,a>>8&255,255&a);r.start(),r.update(e+s),n+=r.digest().getBytes()}return n.substring(0,t)}Mt.encode_rsa_oaep=function(e,t,r){var n,i,a,s;"string"==typeof r?(n=r,i=arguments[3]||void 0,a=arguments[4]||void 0):r&&(n=r.label||void 0,i=r.seed||void 0,a=r.md||void 0,r.mgf1&&r.mgf1.md&&(s=r.mgf1.md)),a?a.start():a=Kt.md.sha1.create(),s||(s=a);var o=Math.ceil(e.n.bitLength()/8),u=o-2*a.digestLength-2;if(t.length>u)throw(p=new Error("RSAES-OAEP input message length is too long.")).length=t.length,p.maxLength=u,p;n||(n=""),a.update(n,"raw");for(var c=a.digest(),l="",h=u-t.length,f=0;f<h;f++)l+="\0";var d=c.getBytes()+l+""+t;if(i){if(i.length!==a.digestLength){var p;throw(p=new Error("Invalid RSAES-OAEP seed. The seed length must match the digest length.")).seedLength=i.length,p.digestLength=a.digestLength,p}}else i=Kt.random.getBytes(a.digestLength);var g=Ft(i,o-a.digestLength-1,s),y=Kt.util.xorBytes(d,g,d.length),m=Ft(y,a.digestLength,s);return"\0"+Kt.util.xorBytes(i,m,i.length)+y},Mt.decode_rsa_oaep=function(e,t,r){var n,i,a;"string"==typeof r?(n=r,i=arguments[3]||void 0):r&&(n=r.label||void 0,i=r.md||void 0,r.mgf1&&r.mgf1.md&&(a=r.mgf1.md));var s=Math.ceil(e.n.bitLength()/8);if(t.length!==s)throw(g=new Error("RSAES-OAEP encoded message length is invalid.")).length=t.length,g.expectedLength=s,g;if(void 0===i?i=Kt.md.sha1.create():i.start(),a||(a=i),s<2*i.digestLength+2)throw new Error("RSAES-OAEP key is too short for the hash function.");n||(n=""),i.update(n,"raw");for(var o=i.digest().getBytes(),u=t.charAt(0),c=t.substring(1,i.digestLength+1),l=t.substring(1+i.digestLength),h=Ft(l,i.digestLength,a),f=Ft(Kt.util.xorBytes(c,h,c.length),s-i.digestLength-1,a),d=Kt.util.xorBytes(l,f,l.length),p=d.substring(0,i.digestLength),g="\0"!==u,y=0;y<i.digestLength;++y)g|=o.charAt(y)!==p.charAt(y);for(var m=1,v=i.digestLength,C=i.digestLength;C<d.length;C++){var E=d.charCodeAt(C);g|=E&(m?65534:0),v+=m&=1&E^1}if(g||1!==d.charCodeAt(v))throw new Error("Invalid RSAES-OAEP padding.");return d.substring(v+1)};var zt=S;!function(){if(zt.prime)zt.prime;else{var e=zt.prime=zt.prime||{},t=zt.jsbn.BigInteger,r=[6,4,2,4,2,4,6,2],n=new t(null);n.fromInt(30);var i=function(e,t){return e|t};e.generateProbablePrime=function(e,r,n){"function"==typeof r&&(n=r,r={});var i=(r=r||{}).algorithm||"PRIMEINC";"string"==typeof i&&(i={name:i}),i.options=i.options||{};var s=r.prng||zt.random,u={nextBytes:function(e){for(var t=s.getBytesSync(e.length),r=0;r<e.length;++r)e[r]=t.charCodeAt(r)}};if("PRIMEINC"===i.name)return function(e,r,n,i){if("workers"in n)return function(e,r,n,i){if("undefined"==typeof Worker)return a(e,r,n,i);var s=o(e,r),u=n.workers,c=n.workLoad||100,l=30*c/8,h=n.workerScript||"forge/prime.worker.js";if(-1===u)return zt.util.estimateCores((function(e,t){e&&(t=2),u=t-1,f()}));function f(){u=Math.max(1,u);for(var n=[],a=0;a<u;++a)n[a]=new Worker(h);for(a=0;a<u;++a)n[a].addEventListener("message",d);var f=!1;function d(a){if(!f){var u=a.data;if(u.found){for(var h=0;h<n.length;++h)n[h].terminate();return f=!0,i(null,new t(u.prime,16))}s.bitLength()>e&&(s=o(e,r));var d=s.toString(16);a.target.postMessage({hex:d,workLoad:c}),s.dAddOffset(l,0)}}}f()}(e,r,n,i);return a(e,r,n,i)}(e,u,i.options,n);throw new Error("Invalid prime generation algorithm: "+i.name)}}function a(e,t,r,n){var i=o(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 u=10;"maxBlockTime"in r&&(u=r.maxBlockTime),s(i,e,t,0,a,u,n)}function s(e,t,n,i,a,u,c){var l=+new Date;do{if(e.bitLength()>t&&(e=o(t,n)),e.isProbablePrime(a))return c(null,e);e.dAddOffset(r[i++%8],0)}while(u<0||+new Date-l<u);zt.util.setImmediate((function(){s(e,t,n,i,a,u,c)}))}function o(e,r){var a=new t(e,r),s=e-1;return a.testBit(s)||a.bitwiseTo(t.ONE.shiftLeft(s),i,a),a.dAddOffset(31-a.mod(n).byteValue(),0),a}}();var jt=S;if(void 0===qt)var qt=jt.jsbn.BigInteger;var Ht=jt.util.isNodejs?s:null,Gt=jt.asn1,Wt=jt.util;jt.pki=jt.pki||{},jt.pki.rsa=jt.rsa=jt.rsa||{};var Qt=jt.pki,Yt=[6,4,2,4,2,4,6,2],Zt={name:"PrivateKeyInfo",tagClass:Gt.Class.UNIVERSAL,type:Gt.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:Gt.Class.UNIVERSAL,type:Gt.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:Gt.Class.UNIVERSAL,type:Gt.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:Gt.Class.UNIVERSAL,type:Gt.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:Gt.Class.UNIVERSAL,type:Gt.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},Xt={name:"RSAPrivateKey",tagClass:Gt.Class.UNIVERSAL,type:Gt.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:Gt.Class.UNIVERSAL,type:Gt.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",tagClass:Gt.Class.UNIVERSAL,type:Gt.Type.INTEGER,constructed:!1,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",tagClass:Gt.Class.UNIVERSAL,type:Gt.Type.INTEGER,constructed:!1,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",tagClass:Gt.Class.UNIVERSAL,type:Gt.Type.INTEGER,constructed:!1,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",tagClass:Gt.Class.UNIVERSAL,type:Gt.Type.INTEGER,constructed:!1,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",tagClass:Gt.Class.UNIVERSAL,type:Gt.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:Gt.Class.UNIVERSAL,type:Gt.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:Gt.Class.UNIVERSAL,type:Gt.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:Gt.Class.UNIVERSAL,type:Gt.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},$t={name:"RSAPublicKey",tagClass:Gt.Class.UNIVERSAL,type:Gt.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:Gt.Class.UNIVERSAL,type:Gt.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:Gt.Class.UNIVERSAL,type:Gt.Type.INTEGER,constructed:!1,capture:"publicKeyExponent"}]},Jt=jt.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:Gt.Class.UNIVERSAL,type:Gt.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:Gt.Class.UNIVERSAL,type:Gt.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:Gt.Class.UNIVERSAL,type:Gt.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:Gt.Class.UNIVERSAL,type:Gt.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:Gt.Class.UNIVERSAL,type:Gt.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},er=function(e){var t;if(!(e.algorithm in Qt.oids)){var r=new Error("Unknown message digest algorithm.");throw r.algorithm=e.algorithm,r}t=Qt.oids[e.algorithm];var n=Gt.oidToDer(t).getBytes(),i=Gt.create(Gt.Class.UNIVERSAL,Gt.Type.SEQUENCE,!0,[]),a=Gt.create(Gt.Class.UNIVERSAL,Gt.Type.SEQUENCE,!0,[]);a.value.push(Gt.create(Gt.Class.UNIVERSAL,Gt.Type.OID,!1,n)),a.value.push(Gt.create(Gt.Class.UNIVERSAL,Gt.Type.NULL,!1,""));var s=Gt.create(Gt.Class.UNIVERSAL,Gt.Type.OCTETSTRING,!1,e.digest().getBytes());return i.value.push(a),i.value.push(s),Gt.toDer(i).getBytes()},tr=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 n;t.dP||(t.dP=t.d.mod(t.p.subtract(qt.ONE))),t.dQ||(t.dQ=t.d.mod(t.q.subtract(qt.ONE))),t.qInv||(t.qInv=t.q.modInverse(t.p));do{n=new qt(jt.util.bytesToHex(jt.random.getBytes(t.n.bitLength()/8)),16)}while(n.compareTo(t.n)>=0||!n.gcd(t.n).equals(qt.ONE));for(var i=(e=e.multiply(n.modPow(t.e,t.n)).mod(t.n)).mod(t.p).modPow(t.dP,t.p),a=e.mod(t.q).modPow(t.dQ,t.q);i.compareTo(a)<0;)i=i.add(t.p);var s=i.subtract(a).multiply(t.qInv).mod(t.p).multiply(t.q).add(a);return s=s.multiply(n.modInverse(t.n)).mod(t.n)};function rr(e,t,r){var n=jt.util.createBuffer(),i=Math.ceil(t.n.bitLength()/8);if(e.length>i-11){var a=new Error("Message is too long for PKCS#1 v1.5 padding.");throw a.length=e.length,a.max=i-11,a}n.putByte(0),n.putByte(r);var s,o=i-3-e.length;if(0===r||1===r){s=0===r?0:255;for(var u=0;u<o;++u)n.putByte(s)}else for(;o>0;){var c=0,l=jt.random.getBytes(o);for(u=0;u<o;++u)0===(s=l.charCodeAt(u))?++c:n.putByte(s);o=c}return n.putByte(0),n.putBytes(e),n}function nr(e,t,r,n){var i=Math.ceil(t.n.bitLength()/8),a=jt.util.createBuffer(e),s=a.getByte(),o=a.getByte();if(0!==s||r&&0!==o&&1!==o||!r&&2!=o||r&&0===o&&void 0===n)throw new Error("Encryption block is invalid.");var u=0;if(0===o){u=i-3-n;for(var c=0;c<u;++c)if(0!==a.getByte())throw new Error("Encryption block is invalid.")}else if(1===o)for(u=0;a.length()>1;){if(255!==a.getByte()){--a.read;break}++u}else if(2===o)for(u=0;a.length()>1;){if(0===a.getByte()){--a.read;break}++u}if(0!==a.getByte()||u!==i-3-a.length())throw new Error("Encryption block is invalid.");return a.getBytes()}function ir(e){var t=e.toString(16);t[0]>="8"&&(t="00"+t);var r=jt.util.hexToBytes(t);return r.length>1&&(0===r.charCodeAt(0)&&0==(128&r.charCodeAt(1))||255===r.charCodeAt(0)&&128==(128&r.charCodeAt(1)))?r.substr(1):r}function ar(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 sr(e){return jt.util.isNodejs&&"function"==typeof Ht[e]}function or(e){return void 0!==Wt.globalScope&&"object"==typeof Wt.globalScope.crypto&&"object"==typeof Wt.globalScope.crypto.subtle&&"function"==typeof Wt.globalScope.crypto.subtle[e]}function ur(e){return void 0!==Wt.globalScope&&"object"==typeof Wt.globalScope.msCrypto&&"object"==typeof Wt.globalScope.msCrypto.subtle&&"function"==typeof Wt.globalScope.msCrypto.subtle[e]}function cr(e){for(var t=jt.util.hexToBytes(e.toString(16)),r=new Uint8Array(t.length),n=0;n<t.length;++n)r[n]=t.charCodeAt(n);return r}Qt.rsa.encrypt=function(e,t,r){var n,i=r,a=Math.ceil(t.n.bitLength()/8);!1!==r&&!0!==r?(i=2===r,n=rr(e,t,r)):(n=jt.util.createBuffer()).putBytes(e);for(var s=new qt(n.toHex(),16),o=tr(s,t,i).toString(16),u=jt.util.createBuffer(),c=a-Math.ceil(o.length/2);c>0;)u.putByte(0),--c;return u.putBytes(jt.util.hexToBytes(o)),u.getBytes()},Qt.rsa.decrypt=function(e,t,r,n){var i=Math.ceil(t.n.bitLength()/8);if(e.length!==i){var a=new Error("Encrypted message length is invalid.");throw a.length=e.length,a.expected=i,a}var s=new qt(jt.util.createBuffer(e).toHex(),16);if(s.compareTo(t.n)>=0)throw new Error("Encrypted message is invalid.");for(var o=tr(s,t,r).toString(16),u=jt.util.createBuffer(),c=i-Math.ceil(o.length/2);c>0;)u.putByte(0),--c;return u.putBytes(jt.util.hexToBytes(o)),!1!==n?nr(u.getBytes(),t,r):u.getBytes()},Qt.rsa.createKeyPairGenerationState=function(e,t,r){"string"==typeof e&&(e=parseInt(e,10)),e=e||2048;var n,i=(r=r||{}).prng||jt.random,a={nextBytes:function(e){for(var t=i.getBytesSync(e.length),r=0;r<e.length;++r)e[r]=t.charCodeAt(r)}},s=r.algorithm||"PRIMEINC";if("PRIMEINC"!==s)throw new Error("Invalid key generation algorithm: "+s);return(n={algorithm:s,state:0,bits:e,rng:a,eInt:t||65537,e:new qt(null),p:null,q:null,qBits:e>>1,pBits:e-(e>>1),pqState:0,num:null,keys:null}).e.fromInt(n.eInt),n},Qt.rsa.stepKeyPairGenerationState=function(e,t){"algorithm"in e||(e.algorithm="PRIMEINC");var r=new qt(null);r.fromInt(30);for(var n,i=0,a=function(e,t){return e|t},s=+new Date,o=0;null===e.keys&&(t<=0||o<t);){if(0===e.state){var u=null===e.p?e.pBits:e.qBits,c=u-1;0===e.pqState?(e.num=new qt(u,e.rng),e.num.testBit(c)||e.num.bitwiseTo(qt.ONE.shiftLeft(c),a,e.num),e.num.dAddOffset(31-e.num.mod(r).byteValue(),0),i=0,++e.pqState):1===e.pqState?e.num.bitLength()>u?e.pqState=0:e.num.isProbablePrime(ar(e.num.bitLength()))?++e.pqState:e.num.dAddOffset(Yt[i++%8],0):2===e.pqState?e.pqState=0===e.num.subtract(qt.ONE).gcd(e.e).compareTo(qt.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(qt.ONE),e.q1=e.q.subtract(qt.ONE),e.phi=e.p1.multiply(e.q1),++e.state;else if(3===e.state)0===e.phi.gcd(e.e).compareTo(qt.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 l=e.e.modInverse(e.phi);e.keys={privateKey:Qt.rsa.setPrivateKey(e.n,e.e,l,e.p,e.q,l.mod(e.p1),l.mod(e.q1),e.q.modInverse(e.p)),publicKey:Qt.rsa.setPublicKey(e.n,e.e)}}o+=(n=+new Date)-s,s=n}return null!==e.keys},Qt.rsa.generateKeyPair=function(e,t,r,n){if(1===arguments.length?"object"==typeof e?(r=e,e=void 0):"function"==typeof e&&(n=e,e=void 0):2===arguments.length?"number"==typeof e?"function"==typeof t?(n=t,t=void 0):"number"!=typeof t&&(r=t,t=void 0):(r=e,n=t,e=void 0,t=void 0):3===arguments.length&&("number"==typeof t?"function"==typeof r&&(n=r,r=void 0):(n=r,r=t,t=void 0)),r=r||{},void 0===e&&(e=r.bits||2048),void 0===t&&(t=r.e||65537),!jt.options.usePureJavaScript&&!r.prng&&e>=256&&e<=16384&&(65537===t||3===t))if(n){if(sr("generateKeyPair"))return Ht.generateKeyPair("rsa",{modulusLength:e,publicExponent:t,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}},(function(e,t,r){if(e)return n(e);n(null,{privateKey:Qt.privateKeyFromPem(r),publicKey:Qt.publicKeyFromPem(t)})}));if(or("generateKey")&&or("exportKey"))return Wt.globalScope.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:e,publicExponent:cr(t),hash:{name:"SHA-256"}},!0,["sign","verify"]).then((function(e){return Wt.globalScope.crypto.subtle.exportKey("pkcs8",e.privateKey)})).then(void 0,(function(e){n(e)})).then((function(e){if(e){var t=Qt.privateKeyFromAsn1(Gt.fromDer(jt.util.createBuffer(e)));n(null,{privateKey:t,publicKey:Qt.setRsaPublicKey(t.n,t.e)})}}));if(ur("generateKey")&&ur("exportKey")){var i=Wt.globalScope.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:e,publicExponent:cr(t),hash:{name:"SHA-256"}},!0,["sign","verify"]);return i.oncomplete=function(e){var t=e.target.result,r=Wt.globalScope.msCrypto.subtle.exportKey("pkcs8",t.privateKey);r.oncomplete=function(e){var t=e.target.result,r=Qt.privateKeyFromAsn1(Gt.fromDer(jt.util.createBuffer(t)));n(null,{privateKey:r,publicKey:Qt.setRsaPublicKey(r.n,r.e)})},r.onerror=function(e){n(e)}},void(i.onerror=function(e){n(e)})}}else if(sr("generateKeyPairSync")){var a=Ht.generateKeyPairSync("rsa",{modulusLength:e,publicExponent:t,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});return{privateKey:Qt.privateKeyFromPem(a.privateKey),publicKey:Qt.publicKeyFromPem(a.publicKey)}}var s=Qt.rsa.createKeyPairGenerationState(e,t,r);if(!n)return Qt.rsa.stepKeyPairGenerationState(s,0),s.keys;!function(e,t,r){"function"==typeof t&&(r=t,t={});t=t||{};var n={algorithm:{name:t.algorithm||"PRIMEINC",options:{workers:t.workers||2,workLoad:t.workLoad||100,workerScript:t.workerScript}}};"prng"in t&&(n.prng=t.prng);function i(){a(e.pBits,(function(t,n){return t?r(t):(e.p=n,null!==e.q?s(t,e.q):void a(e.qBits,s))}))}function a(e,t){jt.prime.generateProbablePrime(e,n,t)}function s(t,n){if(t)return r(t);if(e.q=n,e.p.compareTo(e.q)<0){var o=e.p;e.p=e.q,e.q=o}if(0!==e.p.subtract(qt.ONE).gcd(e.e).compareTo(qt.ONE))return e.p=null,void i();if(0!==e.q.subtract(qt.ONE).gcd(e.e).compareTo(qt.ONE))return e.q=null,void a(e.qBits,s);if(e.p1=e.p.subtract(qt.ONE),e.q1=e.q.subtract(qt.ONE),e.phi=e.p1.multiply(e.q1),0!==e.phi.gcd(e.e).compareTo(qt.ONE))return e.p=e.q=null,void i();if(e.n=e.p.multiply(e.q),e.n.bitLength()!==e.bits)return e.q=null,void a(e.qBits,s);var u=e.e.modInverse(e.phi);e.keys={privateKey:Qt.rsa.setPrivateKey(e.n,e.e,u,e.p,e.q,u.mod(e.p1),u.mod(e.q1),e.q.modInverse(e.p)),publicKey:Qt.rsa.setPublicKey(e.n,e.e)},r(null,e.keys)}i()}(s,r,n)},Qt.setRsaPublicKey=Qt.rsa.setPublicKey=function(e,t){var r={n:e,e:t,encrypt:function(e,t,n){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 rr(e,t,2).getBytes()}};else if("RSA-OAEP"===t||"RSAES-OAEP"===t)t={encode:function(e,t){return jt.pkcs1.encode_rsa_oaep(t,e,n)}};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 i=t.encode(e,r,!0);return Qt.rsa.encrypt(i,r,!0)},verify:function(e,t,n){"string"==typeof n?n=n.toUpperCase():void 0===n&&(n="RSASSA-PKCS1-V1_5"),"RSASSA-PKCS1-V1_5"===n?n={verify:function(e,t){return t=nr(t,r,!0),e===Gt.fromDer(t).value[1].value}}:"NONE"!==n&&"NULL"!==n&&null!==n||(n={verify:function(e,t){return e===(t=nr(t,r,!0))}});var i=Qt.rsa.decrypt(t,r,!0,!1);return n.verify(e,i,r.n.bitLength())}};return r},Qt.setRsaPrivateKey=Qt.rsa.setPrivateKey=function(e,t,r,n,i,a,s,o){var u={n:e,e:t,d:r,p:n,q:i,dP:a,dQ:s,qInv:o,decrypt:function(e,t,r){"string"==typeof t?t=t.toUpperCase():void 0===t&&(t="RSAES-PKCS1-V1_5");var n=Qt.rsa.decrypt(e,u,!1,!1);if("RSAES-PKCS1-V1_5"===t)t={decode:nr};else if("RSA-OAEP"===t||"RSAES-OAEP"===t)t={decode:function(e,t){return jt.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(n,u,!1)},sign:function(e,t){var r=!1;"string"==typeof t&&(t=t.toUpperCase()),void 0===t||"RSASSA-PKCS1-V1_5"===t?(t={encode:er},r=1):"NONE"!==t&&"NULL"!==t&&null!==t||(t={encode:function(){return e}},r=1);var n=t.encode(e,u.n.bitLength());return Qt.rsa.encrypt(n,u,r)}};return u},Qt.wrapRsaPrivateKey=function(e){return Gt.create(Gt.Class.UNIVERSAL,Gt.Type.SEQUENCE,!0,[Gt.create(Gt.Class.UNIVERSAL,Gt.Type.INTEGER,!1,Gt.integerToDer(0).getBytes()),Gt.create(Gt.Class.UNIVERSAL,Gt.Type.SEQUENCE,!0,[Gt.create(Gt.Class.UNIVERSAL,Gt.Type.OID,!1,Gt.oidToDer(Qt.oids.rsaEncryption).getBytes()),Gt.create(Gt.Class.UNIVERSAL,Gt.Type.NULL,!1,"")]),Gt.create(Gt.Class.UNIVERSAL,Gt.Type.OCTETSTRING,!1,Gt.toDer(e).getBytes())])},Qt.privateKeyFromAsn1=function(e){var t,r,n,i,a,s,o,u,c={},l=[];if(Gt.validate(e,Zt,c,l)&&(e=Gt.fromDer(jt.util.createBuffer(c.privateKey))),c={},l=[],!Gt.validate(e,Xt,c,l)){var h=new Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey.");throw h.errors=l,h}return t=jt.util.createBuffer(c.privateKeyModulus).toHex(),r=jt.util.createBuffer(c.privateKeyPublicExponent).toHex(),n=jt.util.createBuffer(c.privateKeyPrivateExponent).toHex(),i=jt.util.createBuffer(c.privateKeyPrime1).toHex(),a=jt.util.createBuffer(c.privateKeyPrime2).toHex(),s=jt.util.createBuffer(c.privateKeyExponent1).toHex(),o=jt.util.createBuffer(c.privateKeyExponent2).toHex(),u=jt.util.createBuffer(c.privateKeyCoefficient).toHex(),Qt.setRsaPrivateKey(new qt(t,16),new qt(r,16),new qt(n,16),new qt(i,16),new qt(a,16),new qt(s,16),new qt(o,16),new qt(u,16))},Qt.privateKeyToAsn1=Qt.privateKeyToRSAPrivateKey=function(e){return Gt.create(Gt.Class.UNIVERSAL,Gt.Type.SEQUENCE,!0,[Gt.create(Gt.Class.UNIVERSAL,Gt.Type.INTEGER,!1,Gt.integerToDer(0).getBytes()),Gt.create(Gt.Class.UNIVERSAL,Gt.Type.INTEGER,!1,ir(e.n)),Gt.create(Gt.Class.UNIVERSAL,Gt.Type.INTEGER,!1,ir(e.e)),Gt.create(Gt.Class.UNIVERSAL,Gt.Type.INTEGER,!1,ir(e.d)),Gt.create(Gt.Class.UNIVERSAL,Gt.Type.INTEGER,!1,ir(e.p)),Gt.create(Gt.Class.UNIVERSAL,Gt.Type.INTEGER,!1,ir(e.q)),Gt.create(Gt.Class.UNIVERSAL,Gt.Type.INTEGER,!1,ir(e.dP)),Gt.create(Gt.Class.UNIVERSAL,Gt.Type.INTEGER,!1,ir(e.dQ)),Gt.create(Gt.Class.UNIVERSAL,Gt.Type.INTEGER,!1,ir(e.qInv))])},Qt.publicKeyFromAsn1=function(e){var t={},r=[];if(Gt.validate(e,Jt,t,r)){var n,i=Gt.derToOid(t.publicKeyOid);if(i!==Qt.oids.rsaEncryption)throw(n=new Error("Cannot read public key. Unknown OID.")).oid=i,n;e=t.rsaPublicKey}if(r=[],!Gt.validate(e,$t,t,r))throw(n=new Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey.")).errors=r,n;var a=jt.util.createBuffer(t.publicKeyModulus).toHex(),s=jt.util.createBuffer(t.publicKeyExponent).toHex();return Qt.setRsaPublicKey(new qt(a,16),new qt(s,16))},Qt.publicKeyToAsn1=Qt.publicKeyToSubjectPublicKeyInfo=function(e){return Gt.create(Gt.Class.UNIVERSAL,Gt.Type.SEQUENCE,!0,[Gt.create(Gt.Class.UNIVERSAL,Gt.Type.SEQUENCE,!0,[Gt.create(Gt.Class.UNIVERSAL,Gt.Type.OID,!1,Gt.oidToDer(Qt.oids.rsaEncryption).getBytes()),Gt.create(Gt.Class.UNIVERSAL,Gt.Type.NULL,!1,"")]),Gt.create(Gt.Class.UNIVERSAL,Gt.Type.BITSTRING,!1,[Qt.publicKeyToRSAPublicKey(e)])])},Qt.publicKeyToRSAPublicKey=function(e){return Gt.create(Gt.Class.UNIVERSAL,Gt.Type.SEQUENCE,!0,[Gt.create(Gt.Class.UNIVERSAL,Gt.Type.INTEGER,!1,ir(e.n)),Gt.create(Gt.Class.UNIVERSAL,Gt.Type.INTEGER,!1,ir(e.e))])};var lr=S;if(void 0===hr)var hr=lr.jsbn.BigInteger;var fr=lr.asn1,dr=lr.pki=lr.pki||{};dr.pbe=lr.pbe=lr.pbe||{};var pr=dr.oids,gr={name:"EncryptedPrivateKeyInfo",tagClass:fr.Class.UNIVERSAL,type:fr.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedPrivateKeyInfo.encryptionAlgorithm",tagClass:fr.Class.UNIVERSAL,type:fr.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:fr.Class.UNIVERSAL,type:fr.Type.OID,constructed:!1,capture:"encryptionOid"},{name:"AlgorithmIdentifier.parameters",tagClass:fr.Class.UNIVERSAL,type:fr.Type.SEQUENCE,constructed:!0,captureAsn1:"encryptionParams"}]},{name:"EncryptedPrivateKeyInfo.encryptedData",tagClass:fr.Class.UNIVERSAL,type:fr.Type.OCTETSTRING,constructed:!1,capture:"encryptedData"}]},yr={name:"PBES2Algorithms",tagClass:fr.Class.UNIVERSAL,type:fr.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc",tagClass:fr.Class.UNIVERSAL,type:fr.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc.oid",tagClass:fr.Class.UNIVERSAL,type:fr.Type.OID,constructed:!1,capture:"kdfOid"},{name:"PBES2Algorithms.params",tagClass:fr.Class.UNIVERSAL,type:fr.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.params.salt",tagClass:fr.Class.UNIVERSAL,type:fr.Type.OCTETSTRING,constructed:!1,capture:"kdfSalt"},{name:"PBES2Algorithms.params.iterationCount",tagClass:fr.Class.UNIVERSAL,type:fr.Type.INTEGER,constructed:!1,capture:"kdfIterationCount"},{name:"PBES2Algorithms.params.keyLength",tagClass:fr.Class.UNIVERSAL,type:fr.Type.INTEGER,constructed:!1,optional:!0,capture:"keyLength"},{name:"PBES2Algorithms.params.prf",tagClass:fr.Class.UNIVERSAL,type:fr.Type.SEQUENCE,constructed:!0,optional:!0,value:[{name:"PBES2Algorithms.params.prf.algorithm",tagClass:fr.Class.UNIVERSAL,type:fr.Type.OID,constructed:!1,capture:"prfOid"}]}]}]},{name:"PBES2Algorithms.encryptionScheme",tagClass:fr.Class.UNIVERSAL,type:fr.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.encryptionScheme.oid",tagClass:fr.Class.UNIVERSAL,type:fr.Type.OID,constructed:!1,capture:"encOid"},{name:"PBES2Algorithms.encryptionScheme.iv",tagClass:fr.Class.UNIVERSAL,type:fr.Type.OCTETSTRING,constructed:!1,capture:"encIv"}]}]},mr={name:"pkcs-12PbeParams",tagClass:fr.Class.UNIVERSAL,type:fr.Type.SEQUENCE,constructed:!0,value:[{name:"pkcs-12PbeParams.salt",tagClass:fr.Class.UNIVERSAL,type:fr.Type.OCTETSTRING,constructed:!1,capture:"salt"},{name:"pkcs-12PbeParams.iterations",tagClass:fr.Class.UNIVERSAL,type:fr.Type.INTEGER,constructed:!1,capture:"iterations"}]};function vr(e,t){return e.start().update(t).digest().getBytes()}function Cr(e){var t;if(e){if(!(t=dr.oids[fr.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 Er(t)}function Er(e){var t=lr.md;switch(e){case"hmacWithSHA224":t=lr.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()}dr.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 n,i,a,s=lr.random.getBytesSync(r.saltSize),o=r.count,u=fr.integerToDer(o);if(0===r.algorithm.indexOf("aes")||"des"===r.algorithm){var c,l,h;switch(r.algorithm){case"aes128":n=16,c=16,l=pr["aes128-CBC"],h=lr.aes.createEncryptionCipher;break;case"aes192":n=24,c=16,l=pr["aes192-CBC"],h=lr.aes.createEncryptionCipher;break;case"aes256":n=32,c=16,l=pr["aes256-CBC"],h=lr.aes.createEncryptionCipher;break;case"des":n=8,c=8,l=pr.desCBC,h=lr.des.createEncryptionCipher;break;default:throw(m=new Error("Cannot encrypt private key. Unknown encryption algorithm.")).algorithm=r.algorithm,m}var f="hmacWith"+r.prfAlgorithm.toUpperCase(),d=Er(f),p=lr.pkcs5.pbkdf2(t,s,o,n,d),g=lr.random.getBytesSync(c);(v=h(p)).start(g),v.update(fr.toDer(e)),v.finish(),a=v.output.getBytes();var y=function(e,t,r,n){var i=fr.create(fr.Class.UNIVERSAL,fr.Type.SEQUENCE,!0,[fr.create(fr.Class.UNIVERSAL,fr.Type.OCTETSTRING,!1,e),fr.create(fr.Class.UNIVERSAL,fr.Type.INTEGER,!1,t.getBytes())]);"hmacWithSHA1"!==n&&i.value.push(fr.create(fr.Class.UNIVERSAL,fr.Type.INTEGER,!1,lr.util.hexToBytes(r.toString(16))),fr.create(fr.Class.UNIVERSAL,fr.Type.SEQUENCE,!0,[fr.create(fr.Class.UNIVERSAL,fr.Type.OID,!1,fr.oidToDer(dr.oids[n]).getBytes()),fr.create(fr.Class.UNIVERSAL,fr.Type.NULL,!1,"")]));return i}(s,u,n,f);i=fr.create(fr.Class.UNIVERSAL,fr.Type.SEQUENCE,!0,[fr.create(fr.Class.UNIVERSAL,fr.Type.OID,!1,fr.oidToDer(pr.pkcs5PBES2).getBytes()),fr.create(fr.Class.UNIVERSAL,fr.Type.SEQUENCE,!0,[fr.create(fr.Class.UNIVERSAL,fr.Type.SEQUENCE,!0,[fr.create(fr.Class.UNIVERSAL,fr.Type.OID,!1,fr.oidToDer(pr.pkcs5PBKDF2).getBytes()),y]),fr.create(fr.Class.UNIVERSAL,fr.Type.SEQUENCE,!0,[fr.create(fr.Class.UNIVERSAL,fr.Type.OID,!1,fr.oidToDer(l).getBytes()),fr.create(fr.Class.UNIVERSAL,fr.Type.OCTETSTRING,!1,g)])])])}else{var m;if("3des"!==r.algorithm)throw(m=new Error("Cannot encrypt private key. Unknown encryption algorithm.")).algorithm=r.algorithm,m;n=24;var v,C=new lr.util.ByteBuffer(s);p=dr.pbe.generatePkcs12Key(t,C,1,o,n),g=dr.pbe.generatePkcs12Key(t,C,2,o,n);(v=lr.des.createEncryptionCipher(p)).start(g),v.update(fr.toDer(e)),v.finish(),a=v.output.getBytes(),i=fr.create(fr.Class.UNIVERSAL,fr.Type.SEQUENCE,!0,[fr.create(fr.Class.UNIVERSAL,fr.Type.OID,!1,fr.oidToDer(pr["pbeWithSHAAnd3-KeyTripleDES-CBC"]).getBytes()),fr.create(fr.Class.UNIVERSAL,fr.Type.SEQUENCE,!0,[fr.create(fr.Class.UNIVERSAL,fr.Type.OCTETSTRING,!1,s),fr.create(fr.Class.UNIVERSAL,fr.Type.INTEGER,!1,u.getBytes())])])}return fr.create(fr.Class.UNIVERSAL,fr.Type.SEQUENCE,!0,[i,fr.create(fr.Class.UNIVERSAL,fr.Type.OCTETSTRING,!1,a)])},dr.decryptPrivateKeyInfo=function(e,t){var r=null,n={},i=[];if(!fr.validate(e,gr,n,i)){var a=new Error("Cannot read encrypted private key. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw a.errors=i,a}var s=fr.derToOid(n.encryptionOid),o=dr.pbe.getCipher(s,n.encryptionParams,t),u=lr.util.createBuffer(n.encryptedData);return o.update(u),o.finish()&&(r=fr.fromDer(o.output)),r},dr.encryptedPrivateKeyToPem=function(e,t){var r={type:"ENCRYPTED PRIVATE KEY",body:fr.toDer(e).getBytes()};return lr.pem.encode(r,{maxline:t})},dr.encryptedPrivateKeyFromPem=function(e){var t=lr.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 fr.fromDer(t.body)},dr.encryptRsaPrivateKey=function(e,t,r){if(!(r=r||{}).legacy){var n=dr.wrapRsaPrivateKey(dr.privateKeyToAsn1(e));return n=dr.encryptPrivateKeyInfo(n,t,r),dr.encryptedPrivateKeyToPem(n)}var i,a,s,o;switch(r.algorithm){case"aes128":i="AES-128-CBC",s=16,a=lr.random.getBytesSync(16),o=lr.aes.createEncryptionCipher;break;case"aes192":i="AES-192-CBC",s=24,a=lr.random.getBytesSync(16),o=lr.aes.createEncryptionCipher;break;case"aes256":i="AES-256-CBC",s=32,a=lr.random.getBytesSync(16),o=lr.aes.createEncryptionCipher;break;case"3des":i="DES-EDE3-CBC",s=24,a=lr.random.getBytesSync(8),o=lr.des.createEncryptionCipher;break;case"des":i="DES-CBC",s=8,a=lr.random.getBytesSync(8),o=lr.des.createEncryptionCipher;break;default:var u=new Error('Could not encrypt RSA private key; unsupported encryption algorithm "'+r.algorithm+'".');throw u.algorithm=r.algorithm,u}var c=o(lr.pbe.opensslDeriveBytes(t,a.substr(0,8),s));c.start(a),c.update(fr.toDer(dr.privateKeyToAsn1(e))),c.finish();var l={type:"RSA PRIVATE KEY",procType:{version:"4",type:"ENCRYPTED"},dekInfo:{algorithm:i,parameters:lr.util.bytesToHex(a).toUpperCase()},body:c.output.getBytes()};return lr.pem.encode(l)},dr.decryptRsaPrivateKey=function(e,t){var r=null,n=lr.pem.decode(e)[0];if("ENCRYPTED PRIVATE KEY"!==n.type&&"PRIVATE KEY"!==n.type&&"RSA PRIVATE KEY"!==n.type)throw(s=new Error('Could not convert private key from PEM; PEM header type is not "ENCRYPTED PRIVATE KEY", "PRIVATE KEY", or "RSA PRIVATE KEY".')).headerType=s,s;if(n.procType&&"ENCRYPTED"===n.procType.type){var i,a;switch(n.dekInfo.algorithm){case"DES-CBC":i=8,a=lr.des.createDecryptionCipher;break;case"DES-EDE3-CBC":i=24,a=lr.des.createDecryptionCipher;break;case"AES-128-CBC":i=16,a=lr.aes.createDecryptionCipher;break;case"AES-192-CBC":i=24,a=lr.aes.createDecryptionCipher;break;case"AES-256-CBC":i=32,a=lr.aes.createDecryptionCipher;break;case"RC2-40-CBC":i=5,a=function(e){return lr.rc2.createDecryptionCipher(e,40)};break;case"RC2-64-CBC":i=8,a=function(e){return lr.rc2.createDecryptionCipher(e,64)};break;case"RC2-128-CBC":i=16,a=function(e){return lr.rc2.createDecryptionCipher(e,128)};break;default:var s;throw(s=new Error('Could not decrypt private key; unsupported encryption algorithm "'+n.dekInfo.algorithm+'".')).algorithm=n.dekInfo.algorithm,s}var o=lr.util.hexToBytes(n.dekInfo.parameters),u=a(lr.pbe.opensslDeriveBytes(t,o.substr(0,8),i));if(u.start(o),u.update(lr.util.createBuffer(n.body)),!u.finish())return r;r=u.output.getBytes()}else r=n.body;return null!==(r="ENCRYPTED PRIVATE KEY"===n.type?dr.decryptPrivateKeyInfo(fr.fromDer(r),t):fr.fromDer(r))&&(r=dr.privateKeyFromAsn1(r)),r},dr.pbe.generatePkcs12Key=function(e,t,r,n,i,a){var s,o;if(null==a){if(!("sha1"in lr.md))throw new Error('"sha1" hash algorithm unavailable.');a=lr.md.sha1.create()}var u=a.digestLength,c=a.blockLength,l=new lr.util.ByteBuffer,h=new lr.util.ByteBuffer;if(null!=e){for(o=0;o<e.length;o++)h.putInt16(e.charCodeAt(o));h.putInt16(0)}var f=h.length(),d=t.length(),p=new lr.util.ByteBuffer;p.fillWithByte(r,c);var g=c*Math.ceil(d/c),y=new lr.util.ByteBuffer;for(o=0;o<g;o++)y.putByte(t.at(o%d));var m=c*Math.ceil(f/c),v=new lr.util.ByteBuffer;for(o=0;o<m;o++)v.putByte(h.at(o%f));var C=y;C.putBuffer(v);for(var E=Math.ceil(i/u),b=1;b<=E;b++){var S=new lr.util.ByteBuffer;S.putBytes(p.bytes()),S.putBytes(C.bytes());for(var T=0;T<n;T++)a.start(),a.update(S.getBytes()),S=a.digest();var _=new lr.util.ByteBuffer;for(o=0;o<c;o++)_.putByte(S.at(o%u));var w=Math.ceil(d/c)+Math.ceil(f/c),I=new lr.util.ByteBuffer;for(s=0;s<w;s++){var A=new lr.util.ByteBuffer(C.getBytes(c)),B=511;for(o=_.length()-1;o>=0;o--)B>>=8,B+=_.at(o)+A.at(o),A.setAt(o,255&B);I.putBuffer(A)}C=I,l.putBuffer(S)}return l.truncate(l.length()-i),l},dr.pbe.getCipher=function(e,t,r){switch(e){case dr.oids.pkcs5PBES2:return dr.pbe.getCipherForPBES2(e,t,r);case dr.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case dr.oids["pbewithSHAAnd40BitRC2-CBC"]:return dr.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}},dr.pbe.getCipherForPBES2=function(e,t,r){var n,i={},a=[];if(!fr.validate(t,yr,i,a))throw(n=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.")).errors=a,n;if((e=fr.derToOid(i.kdfOid))!==dr.oids.pkcs5PBKDF2)throw(n=new Error("Cannot read encrypted private key. Unsupported key derivation function OID.")).oid=e,n.supportedOids=["pkcs5PBKDF2"],n;if((e=fr.derToOid(i.encOid))!==dr.oids["aes128-CBC"]&&e!==dr.oids["aes192-CBC"]&&e!==dr.oids["aes256-CBC"]&&e!==dr.oids["des-EDE3-CBC"]&&e!==dr.oids.desCBC)throw(n=new Error("Cannot read encrypted private key. Unsupported encryption scheme OID.")).oid=e,n.supportedOids=["aes128-CBC","aes192-CBC","aes256-CBC","des-EDE3-CBC","desCBC"],n;var s,o,u=i.kdfSalt,c=lr.util.createBuffer(i.kdfIterationCount);switch(c=c.getInt(c.length()<<3),dr.oids[e]){case"aes128-CBC":s=16,o=lr.aes.createDecryptionCipher;break;case"aes192-CBC":s=24,o=lr.aes.createDecryptionCipher;break;case"aes256-CBC":s=32,o=lr.aes.createDecryptionCipher;break;case"des-EDE3-CBC":s=24,o=lr.des.createDecryptionCipher;break;case"desCBC":s=8,o=lr.des.createDecryptionCipher}var l=Cr(i.prfOid),h=lr.pkcs5.pbkdf2(r,u,c,s,l),f=i.encIv,d=o(h);return d.start(f),d},dr.pbe.getCipherForPKCS12PBE=function(e,t,r){var n={},i=[];if(!fr.validate(t,mr,n,i))throw(l=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.")).errors=i,l;var a,s,o,u=lr.util.createBuffer(n.salt),c=lr.util.createBuffer(n.iterations);switch(c=c.getInt(c.length()<<3),e){case dr.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:a=24,s=8,o=lr.des.startDecrypting;break;case dr.oids["pbewithSHAAnd40BitRC2-CBC"]:a=5,s=8,o=function(e,t){var r=lr.rc2.createDecryptionCipher(e,40);return r.start(t,null),r};break;default:var l;throw(l=new Error("Cannot read PKCS #12 PBE data block. Unsupported OID.")).oid=e,l}var h=Cr(n.prfOid),f=dr.pbe.generatePkcs12Key(r,u,1,c,a,h);return h.start(),o(f,dr.pbe.generatePkcs12Key(r,u,2,c,s,h))},dr.pbe.opensslDeriveBytes=function(e,t,r,n){if(null==n){if(!("md5"in lr.md))throw new Error('"md5" hash algorithm unavailable.');n=lr.md.md5.create()}null===t&&(t="");for(var i=[vr(n,e+t)],a=16,s=1;a<r;++s,a+=16)i.push(vr(n,i[s-1]+e+t));return i.join("").substr(0,r)};var br=S,Sr=br.asn1,Tr=br.pkcs7asn1=br.pkcs7asn1||{};br.pkcs7=br.pkcs7||{},br.pkcs7.asn1=Tr;var _r={name:"ContentInfo",tagClass:Sr.Class.UNIVERSAL,type:Sr.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.ContentType",tagClass:Sr.Class.UNIVERSAL,type:Sr.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:Sr.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,captureAsn1:"content"}]};Tr.contentInfoValidator=_r;var wr={name:"EncryptedContentInfo",tagClass:Sr.Class.UNIVERSAL,type:Sr.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentType",tagClass:Sr.Class.UNIVERSAL,type:Sr.Type.OID,constructed:!1,capture:"contentType"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm",tagClass:Sr.Class.UNIVERSAL,type:Sr.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentEncryptionAlgorithm.algorithm",tagClass:Sr.Class.UNIVERSAL,type:Sr.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm.parameter",tagClass:Sr.Class.UNIVERSAL,captureAsn1:"encParameter"}]},{name:"EncryptedContentInfo.encryptedContent",tagClass:Sr.Class.CONTEXT_SPECIFIC,type:0,capture:"encryptedContent",captureAsn1:"encryptedContentAsn1"}]};Tr.envelopedDataValidator={name:"EnvelopedData",tagClass:Sr.Class.UNIVERSAL,type:Sr.Type.SEQUENCE,constructed:!0,value:[{name:"EnvelopedData.Version",tagClass:Sr.Class.UNIVERSAL,type:Sr.Type.INTEGER,constructed:!1,capture:"version"},{name:"EnvelopedData.RecipientInfos",tagClass:Sr.Class.UNIVERSAL,type:Sr.Type.SET,constructed:!0,captureAsn1:"recipientInfos"}].concat(wr)},Tr.encryptedDataValidator={name:"EncryptedData",tagClass:Sr.Class.UNIVERSAL,type:Sr.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedData.Version",tagClass:Sr.Class.UNIVERSAL,type:Sr.Type.INTEGER,constructed:!1,capture:"version"}].concat(wr)};var Ir={name:"SignerInfo",tagClass:Sr.Class.UNIVERSAL,type:Sr.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.version",tagClass:Sr.Class.UNIVERSAL,type:Sr.Type.INTEGER,constructed:!1},{name:"SignerInfo.issuerAndSerialNumber",tagClass:Sr.Class.UNIVERSAL,type:Sr.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.issuerAndSerialNumber.issuer",tagClass:Sr.Class.UNIVERSAL,type:Sr.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"SignerInfo.issuerAndSerialNumber.serialNumber",tagClass:Sr.Class.UNIVERSAL,type:Sr.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"SignerInfo.digestAlgorithm",tagClass:Sr.Class.UNIVERSAL,type:Sr.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.digestAlgorithm.algorithm",tagClass:Sr.Class.UNIVERSAL,type:Sr.Type.OID,constructed:!1,capture:"digestAlgorithm"},{name:"SignerInfo.digestAlgorithm.parameter",tagClass:Sr.Class.UNIVERSAL,constructed:!1,captureAsn1:"digestParameter",optional:!0}]},{name:"SignerInfo.authenticatedAttributes",tagClass:Sr.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"authenticatedAttributes"},{name:"SignerInfo.digestEncryptionAlgorithm",tagClass:Sr.Class.UNIVERSAL,type:Sr.Type.SEQUENCE,constructed:!0,capture:"signatureAlgorithm"},{name:"SignerInfo.encryptedDigest",tagClass:Sr.Class.UNIVERSAL,type:Sr.Type.OCTETSTRING,constructed:!1,capture:"signature"},{name:"SignerInfo.unauthenticatedAttributes",tagClass:Sr.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,capture:"unauthenticatedAttributes"}]};Tr.signedDataValidator={name:"SignedData",tagClass:Sr.Class.UNIVERSAL,type:Sr.Type.SEQUENCE,constructed:!0,value:[{name:"SignedData.Version",tagClass:Sr.Class.UNIVERSAL,type:Sr.Type.INTEGER,constructed:!1,capture:"version"},{name:"SignedData.DigestAlgorithms",tagClass:Sr.Class.UNIVERSAL,type:Sr.Type.SET,constructed:!0,captureAsn1:"digestAlgorithms"},_r,{name:"SignedData.Certificates",tagClass:Sr.Class.CONTEXT_SPECIFIC,type:0,optional:!0,captureAsn1:"certificates"},{name:"SignedData.CertificateRevocationLists",tagClass:Sr.Class.CONTEXT_SPECIFIC,type:1,optional:!0,captureAsn1:"crls"},{name:"SignedData.SignerInfos",tagClass:Sr.Class.UNIVERSAL,type:Sr.Type.SET,capture:"signerInfos",optional:!0,value:[Ir]}]},Tr.recipientInfoValidator={name:"RecipientInfo",tagClass:Sr.Class.UNIVERSAL,type:Sr.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.version",tagClass:Sr.Class.UNIVERSAL,type:Sr.Type.INTEGER,constructed:!1,capture:"version"},{name:"RecipientInfo.issuerAndSerial",tagClass:Sr.Class.UNIVERSAL,type:Sr.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.issuerAndSerial.issuer",tagClass:Sr.Class.UNIVERSAL,type:Sr.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"RecipientInfo.issuerAndSerial.serialNumber",tagClass:Sr.Class.UNIVERSAL,type:Sr.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"RecipientInfo.keyEncryptionAlgorithm",tagClass:Sr.Class.UNIVERSAL,type:Sr.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.keyEncryptionAlgorithm.algorithm",tagClass:Sr.Class.UNIVERSAL,type:Sr.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"RecipientInfo.keyEncryptionAlgorithm.parameter",tagClass:Sr.Class.UNIVERSAL,constructed:!1,captureAsn1:"encParameter"}]},{name:"RecipientInfo.encryptedKey",tagClass:Sr.Class.UNIVERSAL,type:Sr.Type.OCTETSTRING,constructed:!1,capture:"encKey"}]};var Ar=S;Ar.mgf=Ar.mgf||{},(Ar.mgf.mgf1=Ar.mgf1=Ar.mgf1||{}).create=function(e){var t={generate:function(t,r){for(var n=new Ar.util.ByteBuffer,i=Math.ceil(r/e.digestLength),a=0;a<i;a++){var s=new Ar.util.ByteBuffer;s.putInt32(a),e.start(),e.update(t+s.getBytes()),n.putBuffer(e.digest())}return n.truncate(n.length()-r),n.getBytes()}};return t};var Br=S;Br.mgf=Br.mgf||{},Br.mgf.mgf1=Br.mgf1;var kr=S;(kr.pss=kr.pss||{}).create=function(e){3===arguments.length&&(e={md:arguments[0],mgf:arguments[1],saltLength:arguments[2]});var t,r=e.md,n=e.mgf,i=r.digestLength,a=e.salt||null;if("string"==typeof a&&(a=kr.util.createBuffer(a)),"saltLength"in e)t=e.saltLength;else{if(null===a)throw new Error("Salt length not specified or specific salt not given.");t=a.length()}if(null!==a&&a.length()!==t)throw new Error("Given salt length does not match length of given salt.");var s=e.prng||kr.random,o={encode:function(e,o){var u,c,l=o-1,h=Math.ceil(l/8),f=e.digest().getBytes();if(h<i+t+2)throw new Error("Message is too long to encrypt.");c=null===a?s.getBytesSync(t):a.bytes();var d=new kr.util.ByteBuffer;d.fillWithByte(0,8),d.putBytes(f),d.putBytes(c),r.start(),r.update(d.getBytes());var p=r.digest().getBytes(),g=new kr.util.ByteBuffer;g.fillWithByte(0,h-t-i-2),g.putByte(1),g.putBytes(c);var y=g.getBytes(),m=h-i-1,v=n.generate(p,m),C="";for(u=0;u<m;u++)C+=String.fromCharCode(y.charCodeAt(u)^v.charCodeAt(u));var E=65280>>8*h-l&255;return(C=String.fromCharCode(C.charCodeAt(0)&~E)+C.substr(1))+p+String.fromCharCode(188)},verify:function(e,a,s){var o,u=s-1,c=Math.ceil(u/8);if(a=a.substr(-c),c<i+t+2)throw new Error("Inconsistent parameters to PSS signature verification.");if(188!==a.charCodeAt(c-1))throw new Error("Encoded message does not end in 0xBC.");var l=c-i-1,h=a.substr(0,l),f=a.substr(l,i),d=65280>>8*c-u&255;if(0!=(h.charCodeAt(0)&d))throw new Error("Bits beyond keysize not zero as expected.");var p=n.generate(f,l),g="";for(o=0;o<l;o++)g+=String.fromCharCode(h.charCodeAt(o)^p.charCodeAt(o));g=String.fromCharCode(g.charCodeAt(0)&~d)+g.substr(1);var y=c-i-t-2;for(o=0;o<y;o++)if(0!==g.charCodeAt(o))throw new Error("Leftmost octets not zero as expected");if(1!==g.charCodeAt(y))throw new Error("Inconsistent PSS signature, 0x01 marker not found");var m=g.substr(-t),v=new kr.util.ByteBuffer;return v.fillWithByte(0,8),v.putBytes(e),v.putBytes(m),r.start(),r.update(v.getBytes()),f===r.digest().getBytes()}};return o};var Nr=S,Rr=Nr.asn1,Lr=Nr.pki=Nr.pki||{},Dr=Lr.oids,Ur={};Ur.CN=Dr.commonName,Ur.commonName="CN",Ur.C=Dr.countryName,Ur.countryName="C",Ur.L=Dr.localityName,Ur.localityName="L",Ur.ST=Dr.stateOrProvinceName,Ur.stateOrProvinceName="ST",Ur.O=Dr.organizationName,Ur.organizationName="O",Ur.OU=Dr.organizationalUnitName,Ur.organizationalUnitName="OU",Ur.E=Dr.emailAddress,Ur.emailAddress="E";var xr=Nr.pki.rsa.publicKeyValidator,Or={name:"Certificate",tagClass:Rr.Class.UNIVERSAL,type:Rr.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate",tagClass:Rr.Class.UNIVERSAL,type:Rr.Type.SEQUENCE,constructed:!0,captureAsn1:"tbsCertificate",value:[{name:"Certificate.TBSCertificate.version",tagClass:Rr.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.version.integer",tagClass:Rr.Class.UNIVERSAL,type:Rr.Type.INTEGER,constructed:!1,capture:"certVersion"}]},{name:"Certificate.TBSCertificate.serialNumber",tagClass:Rr.Class.UNIVERSAL,type:Rr.Type.INTEGER,constructed:!1,capture:"certSerialNumber"},{name:"Certificate.TBSCertificate.signature",tagClass:Rr.Class.UNIVERSAL,type:Rr.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.signature.algorithm",tagClass:Rr.Class.UNIVERSAL,type:Rr.Type.OID,constructed:!1,capture:"certinfoSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:Rr.Class.UNIVERSAL,optional:!0,captureAsn1:"certinfoSignatureParams"}]},{name:"Certificate.TBSCertificate.issuer",tagClass:Rr.Class.UNIVERSAL,type:Rr.Type.SEQUENCE,constructed:!0,captureAsn1:"certIssuer"},{name:"Certificate.TBSCertificate.validity",tagClass:Rr.Class.UNIVERSAL,type:Rr.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.validity.notBefore (utc)",tagClass:Rr.Class.UNIVERSAL,type:Rr.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity1UTCTime"},{name:"Certificate.TBSCertificate.validity.notBefore (generalized)",tagClass:Rr.Class.UNIVERSAL,type:Rr.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity2GeneralizedTime"},{name:"Certificate.TBSCertificate.validity.notAfter (utc)",tagClass:Rr.Class.UNIVERSAL,type:Rr.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity3UTCTime"},{name:"Certificate.TBSCertificate.validity.notAfter (generalized)",tagClass:Rr.Class.UNIVERSAL,type:Rr.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity4GeneralizedTime"}]},{name:"Certificate.TBSCertificate.subject",tagClass:Rr.Class.UNIVERSAL,type:Rr.Type.SEQUENCE,constructed:!0,captureAsn1:"certSubject"},xr,{name:"Certificate.TBSCertificate.issuerUniqueID",tagClass:Rr.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.issuerUniqueID.id",tagClass:Rr.Class.UNIVERSAL,type:Rr.Type.BITSTRING,constructed:!1,captureBitStringValue:"certIssuerUniqueId"}]},{name:"Certificate.TBSCertificate.subjectUniqueID",tagClass:Rr.Class.CONTEXT_SPECIFIC,type:2,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.subjectUniqueID.id",tagClass:Rr.Class.UNIVERSAL,type:Rr.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSubjectUniqueId"}]},{name:"Certificate.TBSCertificate.extensions",tagClass:Rr.Class.CONTEXT_SPECIFIC,type:3,constructed:!0,captureAsn1:"certExtensions",optional:!0}]},{name:"Certificate.signatureAlgorithm",tagClass:Rr.Class.UNIVERSAL,type:Rr.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.signatureAlgorithm.algorithm",tagClass:Rr.Class.UNIVERSAL,type:Rr.Type.OID,constructed:!1,capture:"certSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:Rr.Class.UNIVERSAL,optional:!0,captureAsn1:"certSignatureParams"}]},{name:"Certificate.signatureValue",tagClass:Rr.Class.UNIVERSAL,type:Rr.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSignature"}]},Pr={name:"rsapss",tagClass:Rr.Class.UNIVERSAL,type:Rr.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.hashAlgorithm",tagClass:Rr.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier",tagClass:Rr.Class.UNIVERSAL,type:Rr.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier.algorithm",tagClass:Rr.Class.UNIVERSAL,type:Rr.Type.OID,constructed:!1,capture:"hashOid"}]}]},{name:"rsapss.maskGenAlgorithm",tagClass:Rr.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier",tagClass:Rr.Class.UNIVERSAL,type:Rr.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.algorithm",tagClass:Rr.Class.UNIVERSAL,type:Rr.Type.OID,constructed:!1,capture:"maskGenOid"},{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params",tagClass:Rr.Class.UNIVERSAL,type:Rr.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params.algorithm",tagClass:Rr.Class.UNIVERSAL,type:Rr.Type.OID,constructed:!1,capture:"maskGenHashOid"}]}]}]},{name:"rsapss.saltLength",tagClass:Rr.Class.CONTEXT_SPECIFIC,type:2,optional:!0,value:[{name:"rsapss.saltLength.saltLength",tagClass:Rr.Class.UNIVERSAL,type:Rr.Class.INTEGER,constructed:!1,capture:"saltLength"}]},{name:"rsapss.trailerField",tagClass:Rr.Class.CONTEXT_SPECIFIC,type:3,optional:!0,value:[{name:"rsapss.trailer.trailer",tagClass:Rr.Class.UNIVERSAL,type:Rr.Class.INTEGER,constructed:!1,capture:"trailer"}]}]},Vr={name:"CertificationRequestInfo",tagClass:Rr.Class.UNIVERSAL,type:Rr.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfo",value:[{name:"CertificationRequestInfo.integer",tagClass:Rr.Class.UNIVERSAL,type:Rr.Type.INTEGER,constructed:!1,capture:"certificationRequestInfoVersion"},{name:"CertificationRequestInfo.subject",tagClass:Rr.Class.UNIVERSAL,type:Rr.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfoSubject"},xr,{name:"CertificationRequestInfo.attributes",tagClass:Rr.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"certificationRequestInfoAttributes",value:[{name:"CertificationRequestInfo.attributes",tagClass:Rr.Class.UNIVERSAL,type:Rr.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequestInfo.attributes.type",tagClass:Rr.Class.UNIVERSAL,type:Rr.Type.OID,constructed:!1},{name:"CertificationRequestInfo.attributes.value",tagClass:Rr.Class.UNIVERSAL,type:Rr.Type.SET,constructed:!0}]}]}]},Kr={name:"CertificationRequest",tagClass:Rr.Class.UNIVERSAL,type:Rr.Type.SEQUENCE,constructed:!0,captureAsn1:"csr",value:[Vr,{name:"CertificationRequest.signatureAlgorithm",tagClass:Rr.Class.UNIVERSAL,type:Rr.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequest.signatureAlgorithm.algorithm",tagClass:Rr.Class.UNIVERSAL,type:Rr.Type.OID,constructed:!1,capture:"csrSignatureOid"},{name:"CertificationRequest.signatureAlgorithm.parameters",tagClass:Rr.Class.UNIVERSAL,optional:!0,captureAsn1:"csrSignatureParams"}]},{name:"CertificationRequest.signature",tagClass:Rr.Class.UNIVERSAL,type:Rr.Type.BITSTRING,constructed:!1,captureBitStringValue:"csrSignature"}]};function Mr(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}Lr.RDNAttributesAsArray=function(e,t){for(var r,n,i,a=[],s=0;s<e.value.length;++s){r=e.value[s];for(var o=0;o<r.value.length;++o)i={},n=r.value[o],i.type=Rr.derToOid(n.value[0].value),i.value=n.value[1].value,i.valueTagClass=n.value[1].type,i.type in Dr&&(i.name=Dr[i.type],i.name in Ur&&(i.shortName=Ur[i.name])),t&&(t.update(i.type),t.update(i.value)),a.push(i)}return a},Lr.CRIAttributesAsArray=function(e){for(var t=[],r=0;r<e.length;++r)for(var n=e[r],i=Rr.derToOid(n.value[0].value),a=n.value[1].value,s=0;s<a.length;++s){var o={};if(o.type=i,o.value=a[s].value,o.valueTagClass=a[s].type,o.type in Dr&&(o.name=Dr[o.type],o.name in Ur&&(o.shortName=Ur[o.name])),o.type===Dr.extensionRequest){o.extensions=[];for(var u=0;u<o.value.length;++u)o.extensions.push(Lr.certificateExtensionFromAsn1(o.value[u]))}t.push(o)}return t};var Fr=function(e,t,r){var n={};if(e!==Dr["RSASSA-PSS"])return n;r&&(n={hash:{algorithmOid:Dr.sha1},mgf:{algorithmOid:Dr.mgf1,hash:{algorithmOid:Dr.sha1}},saltLength:20});var i={},a=[];if(!Rr.validate(t,Pr,i,a)){var s=new Error("Cannot read RSASSA-PSS parameter block.");throw s.errors=a,s}return void 0!==i.hashOid&&(n.hash=n.hash||{},n.hash.algorithmOid=Rr.derToOid(i.hashOid)),void 0!==i.maskGenOid&&(n.mgf=n.mgf||{},n.mgf.algorithmOid=Rr.derToOid(i.maskGenOid),n.mgf.hash=n.mgf.hash||{},n.mgf.hash.algorithmOid=Rr.derToOid(i.maskGenHashOid)),void 0!==i.saltLength&&(n.saltLength=i.saltLength.charCodeAt(0)),n};function zr(e){for(var t,r,n=Rr.create(Rr.Class.UNIVERSAL,Rr.Type.SEQUENCE,!0,[]),i=e.attributes,a=0;a<i.length;++a){var s=(t=i[a]).value,o=Rr.Type.PRINTABLESTRING;"valueTagClass"in t&&(o=t.valueTagClass)===Rr.Type.UTF8&&(s=Nr.util.encodeUtf8(s)),r=Rr.create(Rr.Class.UNIVERSAL,Rr.Type.SET,!0,[Rr.create(Rr.Class.UNIVERSAL,Rr.Type.SEQUENCE,!0,[Rr.create(Rr.Class.UNIVERSAL,Rr.Type.OID,!1,Rr.oidToDer(t.type).getBytes()),Rr.create(Rr.Class.UNIVERSAL,o,!1,s)])]),n.value.push(r)}return n}function jr(e){for(var t,r=0;r<e.length;++r){if(void 0===(t=e[r]).name&&(t.type&&t.type in Lr.oids?t.name=Lr.oids[t.type]:t.shortName&&t.shortName in Ur&&(t.name=Lr.oids[Ur[t.shortName]])),void 0===t.type){if(!t.name||!(t.name in Lr.oids))throw(i=new Error("Attribute type not specified.")).attribute=t,i;t.type=Lr.oids[t.name]}if(void 0===t.shortName&&t.name&&t.name in Ur&&(t.shortName=Ur[t.name]),t.type===Dr.extensionRequest&&(t.valueConstructed=!0,t.valueTagClass=Rr.Type.SEQUENCE,!t.value&&t.extensions)){t.value=[];for(var n=0;n<t.extensions.length;++n)t.value.push(Lr.certificateExtensionToAsn1(qr(t.extensions[n])))}var i;if(void 0===t.value)throw(i=new Error("Attribute value not specified.")).attribute=t,i}}function qr(e,t){if(t=t||{},void 0===e.name&&e.id&&e.id in Lr.oids&&(e.name=Lr.oids[e.id]),void 0===e.id){if(!e.name||!(e.name in Lr.oids))throw(y=new Error("Extension ID not specified.")).extension=e,y;e.id=Lr.oids[e.name]}if(void 0!==e.value)return e;if("keyUsage"===e.name){var r=0,n=0,i=0;e.digitalSignature&&(n|=128,r=7),e.nonRepudiation&&(n|=64,r=6),e.keyEncipherment&&(n|=32,r=5),e.dataEncipherment&&(n|=16,r=4),e.keyAgreement&&(n|=8,r=3),e.keyCertSign&&(n|=4,r=2),e.cRLSign&&(n|=2,r=1),e.encipherOnly&&(n|=1,r=0),e.decipherOnly&&(i|=128,r=7);var a=String.fromCharCode(r);0!==i?a+=String.fromCharCode(n)+String.fromCharCode(i):0!==n&&(a+=String.fromCharCode(n)),e.value=Rr.create(Rr.Class.UNIVERSAL,Rr.Type.BITSTRING,!1,a)}else if("basicConstraints"===e.name)e.value=Rr.create(Rr.Class.UNIVERSAL,Rr.Type.SEQUENCE,!0,[]),e.cA&&e.value.value.push(Rr.create(Rr.Class.UNIVERSAL,Rr.Type.BOOLEAN,!1,String.fromCharCode(255))),"pathLenConstraint"in e&&e.value.value.push(Rr.create(Rr.Class.UNIVERSAL,Rr.Type.INTEGER,!1,Rr.integerToDer(e.pathLenConstraint).getBytes()));else if("extKeyUsage"===e.name){e.value=Rr.create(Rr.Class.UNIVERSAL,Rr.Type.SEQUENCE,!0,[]);var s=e.value.value;for(var o in e)!0===e[o]&&(o in Dr?s.push(Rr.create(Rr.Class.UNIVERSAL,Rr.Type.OID,!1,Rr.oidToDer(Dr[o]).getBytes())):-1!==o.indexOf(".")&&s.push(Rr.create(Rr.Class.UNIVERSAL,Rr.Type.OID,!1,Rr.oidToDer(o).getBytes())))}else if("nsCertType"===e.name){r=0,n=0;e.client&&(n|=128,r=7),e.server&&(n|=64,r=6),e.email&&(n|=32,r=5),e.objsign&&(n|=16,r=4),e.reserved&&(n|=8,r=3),e.sslCA&&(n|=4,r=2),e.emailCA&&(n|=2,r=1),e.objCA&&(n|=1,r=0);a=String.fromCharCode(r);0!==n&&(a+=String.fromCharCode(n)),e.value=Rr.create(Rr.Class.UNIVERSAL,Rr.Type.BITSTRING,!1,a)}else if("subjectAltName"===e.name||"issuerAltName"===e.name){e.value=Rr.create(Rr.Class.UNIVERSAL,Rr.Type.SEQUENCE,!0,[]);for(var u=0;u<e.altNames.length;++u){a=(d=e.altNames[u]).value;if(7===d.type&&d.ip){if(null===(a=Nr.util.bytesFromIP(d.ip)))throw(y=new Error('Extension "ip" value is not a valid IPv4 or IPv6 address.')).extension=e,y}else 8===d.type&&(a=d.oid?Rr.oidToDer(Rr.oidToDer(d.oid)):Rr.oidToDer(a));e.value.value.push(Rr.create(Rr.Class.CONTEXT_SPECIFIC,d.type,!1,a))}}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=Rr.create(Rr.Class.UNIVERSAL,Rr.Type.IA5STRING,!1,e.comment)}else if("subjectKeyIdentifier"===e.name&&t.cert){var c=t.cert.generateSubjectKeyIdentifier();e.subjectKeyIdentifier=c.toHex(),e.value=Rr.create(Rr.Class.UNIVERSAL,Rr.Type.OCTETSTRING,!1,c.getBytes())}else if("authorityKeyIdentifier"===e.name&&t.cert){e.value=Rr.create(Rr.Class.UNIVERSAL,Rr.Type.SEQUENCE,!0,[]);s=e.value.value;if(e.keyIdentifier){var l=!0===e.keyIdentifier?t.cert.generateSubjectKeyIdentifier().getBytes():e.keyIdentifier;s.push(Rr.create(Rr.Class.CONTEXT_SPECIFIC,0,!1,l))}if(e.authorityCertIssuer){var h=[Rr.create(Rr.Class.CONTEXT_SPECIFIC,4,!0,[zr(!0===e.authorityCertIssuer?t.cert.issuer:e.authorityCertIssuer)])];s.push(Rr.create(Rr.Class.CONTEXT_SPECIFIC,1,!0,h))}if(e.serialNumber){var f=Nr.util.hexToBytes(!0===e.serialNumber?t.cert.serialNumber:e.serialNumber);s.push(Rr.create(Rr.Class.CONTEXT_SPECIFIC,2,!1,f))}}else if("cRLDistributionPoints"===e.name){e.value=Rr.create(Rr.Class.UNIVERSAL,Rr.Type.SEQUENCE,!0,[]);s=e.value.value;var d,p=Rr.create(Rr.Class.UNIVERSAL,Rr.Type.SEQUENCE,!0,[]),g=Rr.create(Rr.Class.CONTEXT_SPECIFIC,0,!0,[]);for(u=0;u<e.altNames.length;++u){a=(d=e.altNames[u]).value;if(7===d.type&&d.ip){if(null===(a=Nr.util.bytesFromIP(d.ip)))throw(y=new Error('Extension "ip" value is not a valid IPv4 or IPv6 address.')).extension=e,y}else 8===d.type&&(a=d.oid?Rr.oidToDer(Rr.oidToDer(d.oid)):Rr.oidToDer(a));g.value.push(Rr.create(Rr.Class.CONTEXT_SPECIFIC,d.type,!1,a))}p.value.push(Rr.create(Rr.Class.CONTEXT_SPECIFIC,0,!0,[g])),s.push(p)}var y;if(void 0===e.value)throw(y=new Error("Extension value not specified.")).extension=e,y;return e}function Hr(e,t){if(e===Dr["RSASSA-PSS"]){var r=[];return void 0!==t.hash.algorithmOid&&r.push(Rr.create(Rr.Class.CONTEXT_SPECIFIC,0,!0,[Rr.create(Rr.Class.UNIVERSAL,Rr.Type.SEQUENCE,!0,[Rr.create(Rr.Class.UNIVERSAL,Rr.Type.OID,!1,Rr.oidToDer(t.hash.algorithmOid).getBytes()),Rr.create(Rr.Class.UNIVERSAL,Rr.Type.NULL,!1,"")])])),void 0!==t.mgf.algorithmOid&&r.push(Rr.create(Rr.Class.CONTEXT_SPECIFIC,1,!0,[Rr.create(Rr.Class.UNIVERSAL,Rr.Type.SEQUENCE,!0,[Rr.create(Rr.Class.UNIVERSAL,Rr.Type.OID,!1,Rr.oidToDer(t.mgf.algorithmOid).getBytes()),Rr.create(Rr.Class.UNIVERSAL,Rr.Type.SEQUENCE,!0,[Rr.create(Rr.Class.UNIVERSAL,Rr.Type.OID,!1,Rr.oidToDer(t.mgf.hash.algorithmOid).getBytes()),Rr.create(Rr.Class.UNIVERSAL,Rr.Type.NULL,!1,"")])])])),void 0!==t.saltLength&&r.push(Rr.create(Rr.Class.CONTEXT_SPECIFIC,2,!0,[Rr.create(Rr.Class.UNIVERSAL,Rr.Type.INTEGER,!1,Rr.integerToDer(t.saltLength).getBytes())])),Rr.create(Rr.Class.UNIVERSAL,Rr.Type.SEQUENCE,!0,r)}return Rr.create(Rr.Class.UNIVERSAL,Rr.Type.NULL,!1,"")}function Gr(e){var t=Rr.create(Rr.Class.CONTEXT_SPECIFIC,0,!0,[]);if(0===e.attributes.length)return t;for(var r=e.attributes,n=0;n<r.length;++n){var i=r[n],a=i.value,s=Rr.Type.UTF8;"valueTagClass"in i&&(s=i.valueTagClass),s===Rr.Type.UTF8&&(a=Nr.util.encodeUtf8(a));var o=!1;"valueConstructed"in i&&(o=i.valueConstructed);var u=Rr.create(Rr.Class.UNIVERSAL,Rr.Type.SEQUENCE,!0,[Rr.create(Rr.Class.UNIVERSAL,Rr.Type.OID,!1,Rr.oidToDer(i.type).getBytes()),Rr.create(Rr.Class.UNIVERSAL,Rr.Type.SET,!0,[Rr.create(Rr.Class.UNIVERSAL,s,o,a)])]);t.value.push(u)}return t}Lr.certificateFromPem=function(e,t,r){var n=Nr.pem.decode(e)[0];if("CERTIFICATE"!==n.type&&"X509 CERTIFICATE"!==n.type&&"TRUSTED CERTIFICATE"!==n.type){var i=new Error('Could not convert certificate from PEM; PEM header type is not "CERTIFICATE", "X509 CERTIFICATE", or "TRUSTED CERTIFICATE".');throw i.headerType=n.type,i}if(n.procType&&"ENCRYPTED"===n.procType.type)throw new Error("Could not convert certificate from PEM; PEM is encrypted.");var a=Rr.fromDer(n.body,r);return Lr.certificateFromAsn1(a,t)},Lr.certificateToPem=function(e,t){var r={type:"CERTIFICATE",body:Rr.toDer(Lr.certificateToAsn1(e)).getBytes()};return Nr.pem.encode(r,{maxline:t})},Lr.publicKeyFromPem=function(e){var t=Nr.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 n=Rr.fromDer(t.body);return Lr.publicKeyFromAsn1(n)},Lr.publicKeyToPem=function(e,t){var r={type:"PUBLIC KEY",body:Rr.toDer(Lr.publicKeyToAsn1(e)).getBytes()};return Nr.pem.encode(r,{maxline:t})},Lr.publicKeyToRSAPublicKeyPem=function(e,t){var r={type:"RSA PUBLIC KEY",body:Rr.toDer(Lr.publicKeyToRSAPublicKey(e)).getBytes()};return Nr.pem.encode(r,{maxline:t})},Lr.getPublicKeyFingerprint=function(e,t){var r,n=(t=t||{}).md||Nr.md.sha1.create();switch(t.type||"RSAPublicKey"){case"RSAPublicKey":r=Rr.toDer(Lr.publicKeyToRSAPublicKey(e)).getBytes();break;case"SubjectPublicKeyInfo":r=Rr.toDer(Lr.publicKeyToAsn1(e)).getBytes();break;default:throw new Error('Unknown fingerprint type "'+t.type+'".')}n.start(),n.update(r);var i=n.digest();if("hex"===t.encoding){var a=i.toHex();return t.delimiter?a.match(/.{2}/g).join(t.delimiter):a}if("binary"===t.encoding)return i.getBytes();if(t.encoding)throw new Error('Unknown encoding "'+t.encoding+'".');return i},Lr.certificationRequestFromPem=function(e,t,r){var n=Nr.pem.decode(e)[0];if("CERTIFICATE REQUEST"!==n.type){var i=new Error('Could not convert certification request from PEM; PEM header type is not "CERTIFICATE REQUEST".');throw i.headerType=n.type,i}if(n.procType&&"ENCRYPTED"===n.procType.type)throw new Error("Could not convert certification request from PEM; PEM is encrypted.");var a=Rr.fromDer(n.body,r);return Lr.certificationRequestFromAsn1(a,t)},Lr.certificationRequestToPem=function(e,t){var r={type:"CERTIFICATE REQUEST",body:Rr.toDer(Lr.certificationRequestToAsn1(e)).getBytes()};return Nr.pem.encode(r,{maxline:t})},Lr.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 Mr(e.issuer,t)},e.issuer.addField=function(t){jr([t]),e.issuer.attributes.push(t)},e.issuer.attributes=[],e.issuer.hash=null,e.subject={},e.subject.getField=function(t){return Mr(e.subject,t)},e.subject.addField=function(t){jr([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){jr(t),e.subject.attributes=t,delete e.subject.uniqueId,r&&(e.subject.uniqueId=r),e.subject.hash=null},e.setIssuer=function(t,r){jr(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)qr(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||Nr.md.sha1.create();var n=Dr[e.md.algorithm+"WithRSAEncryption"];if(!n){var i=new Error("Could not compute certificate digest. Unknown message digest algorithm OID.");throw i.algorithm=e.md.algorithm,i}e.signatureOid=e.siginfo.algorithmOid=n,e.tbsCertificate=Lr.getTBSCertificate(e);var a=Rr.toDer(e.tbsCertificate);e.md.update(a.getBytes()),e.signature=t.sign(e.md)},e.verify=function(t){var r=!1;if(!e.issued(t)){var n=t.issuer,i=e.subject;throw(h=new Error("The parent certificate did not issue the given child certificate; the child certificate's issuer does not match the parent's subject.")).expectedIssuer=n.attributes,h.actualIssuer=i.attributes,h}var a=t.md;if(null===a){if(t.signatureOid in Dr)switch(Dr[t.signatureOid]){case"sha1WithRSAEncryption":a=Nr.md.sha1.create();break;case"md5WithRSAEncryption":a=Nr.md.md5.create();break;case"sha256WithRSAEncryption":case"RSASSA-PSS":a=Nr.md.sha256.create();break;case"sha384WithRSAEncryption":a=Nr.md.sha384.create();break;case"sha512WithRSAEncryption":a=Nr.md.sha512.create()}if(null===a)throw(h=new Error("Could not compute certificate digest. Unknown signature OID.")).signatureOid=t.signatureOid,h;var s=t.tbsCertificate||Lr.getTBSCertificate(t),o=Rr.toDer(s);a.update(o.getBytes())}if(null!==a){var u;switch(t.signatureOid){case Dr.sha1WithRSAEncryption:u=void 0;break;case Dr["RSASSA-PSS"]:var c,l,h;if(void 0===(c=Dr[t.signatureParameters.mgf.hash.algorithmOid])||void 0===Nr.md[c])throw(h=new Error("Unsupported MGF hash function.")).oid=t.signatureParameters.mgf.hash.algorithmOid,h.name=c,h;if(void 0===(l=Dr[t.signatureParameters.mgf.algorithmOid])||void 0===Nr.mgf[l])throw(h=new Error("Unsupported MGF function.")).oid=t.signatureParameters.mgf.algorithmOid,h.name=l,h;if(l=Nr.mgf[l].create(Nr.md[c].create()),void 0===(c=Dr[t.signatureParameters.hash.algorithmOid])||void 0===Nr.md[c])throw{message:"Unsupported RSASSA-PSS hash function.",oid:t.signatureParameters.hash.algorithmOid,name:c};u=Nr.pss.create(Nr.md[c].create(),l,t.signatureParameters.saltLength)}r=e.publicKey.verify(a.digest().getBytes(),t.signature,u)}return 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 Lr.getPublicKeyFingerprint(e.publicKey,{type:"RSAPublicKey"})},e.verifySubjectKeyIdentifier=function(){for(var t=Dr.subjectKeyIdentifier,r=0;r<e.extensions.length;++r){var n=e.extensions[r];if(n.id===t){var i=e.generateSubjectKeyIdentifier().getBytes();return Nr.util.hexToBytes(n.subjectKeyIdentifier)===i}}return!1},e},Lr.certificateFromAsn1=function(e,t){var r={},n=[];if(!Rr.validate(e,Or,r,n))throw(o=new Error("Cannot read X.509 certificate. ASN.1 object is not an X509v3 Certificate.")).errors=n,o;if(Rr.derToOid(r.publicKeyOid)!==Lr.oids.rsaEncryption)throw new Error("Cannot read public key. OID is not RSA.");var i=Lr.createCertificate();i.version=r.certVersion?r.certVersion.charCodeAt(0):0;var a=Nr.util.createBuffer(r.certSerialNumber);i.serialNumber=a.toHex(),i.signatureOid=Nr.asn1.derToOid(r.certSignatureOid),i.signatureParameters=Fr(i.signatureOid,r.certSignatureParams,!0),i.siginfo.algorithmOid=Nr.asn1.derToOid(r.certinfoSignatureOid),i.siginfo.parameters=Fr(i.siginfo.algorithmOid,r.certinfoSignatureParams,!1),i.signature=r.certSignature;var s=[];if(void 0!==r.certValidity1UTCTime&&s.push(Rr.utcTimeToDate(r.certValidity1UTCTime)),void 0!==r.certValidity2GeneralizedTime&&s.push(Rr.generalizedTimeToDate(r.certValidity2GeneralizedTime)),void 0!==r.certValidity3UTCTime&&s.push(Rr.utcTimeToDate(r.certValidity3UTCTime)),void 0!==r.certValidity4GeneralizedTime&&s.push(Rr.generalizedTimeToDate(r.certValidity4GeneralizedTime)),s.length>2)throw new Error("Cannot read notBefore/notAfter validity times; more than two times were provided in the certificate.");if(s.length<2)throw new Error("Cannot read notBefore/notAfter validity times; they were not provided as either UTCTime or GeneralizedTime.");if(i.validity.notBefore=s[0],i.validity.notAfter=s[1],i.tbsCertificate=r.tbsCertificate,t){var o;if(i.md=null,i.signatureOid in Dr)switch(Dr[i.signatureOid]){case"sha1WithRSAEncryption":i.md=Nr.md.sha1.create();break;case"md5WithRSAEncryption":i.md=Nr.md.md5.create();break;case"sha256WithRSAEncryption":case"RSASSA-PSS":i.md=Nr.md.sha256.create();break;case"sha384WithRSAEncryption":i.md=Nr.md.sha384.create();break;case"sha512WithRSAEncryption":i.md=Nr.md.sha512.create()}if(null===i.md)throw(o=new Error("Could not compute certificate digest. Unknown signature OID.")).signatureOid=i.signatureOid,o;var u=Rr.toDer(i.tbsCertificate);i.md.update(u.getBytes())}var c=Nr.md.sha1.create();i.issuer.getField=function(e){return Mr(i.issuer,e)},i.issuer.addField=function(e){jr([e]),i.issuer.attributes.push(e)},i.issuer.attributes=Lr.RDNAttributesAsArray(r.certIssuer,c),r.certIssuerUniqueId&&(i.issuer.uniqueId=r.certIssuerUniqueId),i.issuer.hash=c.digest().toHex();var l=Nr.md.sha1.create();return i.subject.getField=function(e){return Mr(i.subject,e)},i.subject.addField=function(e){jr([e]),i.subject.attributes.push(e)},i.subject.attributes=Lr.RDNAttributesAsArray(r.certSubject,l),r.certSubjectUniqueId&&(i.subject.uniqueId=r.certSubjectUniqueId),i.subject.hash=l.digest().toHex(),r.certExtensions?i.extensions=Lr.certificateExtensionsFromAsn1(r.certExtensions):i.extensions=[],i.publicKey=Lr.publicKeyFromAsn1(r.subjectPublicKeyInfo),i},Lr.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(Lr.certificateExtensionFromAsn1(n.value[i]));return t},Lr.certificateExtensionFromAsn1=function(e){var t={};if(t.id=Rr.derToOid(e.value[0].value),t.critical=!1,e.value[1].type===Rr.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 Dr)if(t.name=Dr[t.id],"keyUsage"===t.name){var r=0,n=0;(a=Rr.fromDer(t.value)).value.length>1&&(r=a.value.charCodeAt(1),n=a.value.length>2?a.value.charCodeAt(2):0),t.digitalSignature=128==(128&r),t.nonRepudiation=64==(64&r),t.keyEncipherment=32==(32&r),t.dataEncipherment=16==(16&r),t.keyAgreement=8==(8&r),t.keyCertSign=4==(4&r),t.cRLSign=2==(2&r),t.encipherOnly=1==(1&r),t.decipherOnly=128==(128&n)}else if("basicConstraints"===t.name){(a=Rr.fromDer(t.value)).value.length>0&&a.value[0].type===Rr.Type.BOOLEAN?t.cA=0!==a.value[0].value.charCodeAt(0):t.cA=!1;var i=null;a.value.length>0&&a.value[0].type===Rr.Type.INTEGER?i=a.value[0].value:a.value.length>1&&(i=a.value[1].value),null!==i&&(t.pathLenConstraint=Rr.derToInteger(i))}else if("extKeyUsage"===t.name)for(var a=Rr.fromDer(t.value),s=0;s<a.value.length;++s){var o=Rr.derToOid(a.value[s].value);o in Dr?t[Dr[o]]=!0:t[o]=!0}else if("nsCertType"===t.name){r=0;(a=Rr.fromDer(t.value)).value.length>1&&(r=a.value.charCodeAt(1)),t.client=128==(128&r),t.server=64==(64&r),t.email=32==(32&r),t.objsign=16==(16&r),t.reserved=8==(8&r),t.sslCA=4==(4&r),t.emailCA=2==(2&r),t.objCA=1==(1&r)}else if("subjectAltName"===t.name||"issuerAltName"===t.name){var u;t.altNames=[];a=Rr.fromDer(t.value);for(var c=0;c<a.value.length;++c){var l={type:(u=a.value[c]).type,value:u.value};switch(t.altNames.push(l),u.type){case 1:case 2:case 6:break;case 7:l.ip=Nr.util.bytesToIP(u.value);break;case 8:l.oid=Rr.derToOid(u.value)}}}else if("subjectKeyIdentifier"===t.name){a=Rr.fromDer(t.value);t.subjectKeyIdentifier=Nr.util.bytesToHex(a.value)}return t},Lr.certificationRequestFromAsn1=function(e,t){var r={},n=[];if(!Rr.validate(e,Kr,r,n))throw(a=new Error("Cannot read PKCS#10 certificate request. ASN.1 object is not a PKCS#10 CertificationRequest.")).errors=n,a;if(Rr.derToOid(r.publicKeyOid)!==Lr.oids.rsaEncryption)throw new Error("Cannot read public key. OID is not RSA.");var i=Lr.createCertificationRequest();if(i.version=r.csrVersion?r.csrVersion.charCodeAt(0):0,i.signatureOid=Nr.asn1.derToOid(r.csrSignatureOid),i.signatureParameters=Fr(i.signatureOid,r.csrSignatureParams,!0),i.siginfo.algorithmOid=Nr.asn1.derToOid(r.csrSignatureOid),i.siginfo.parameters=Fr(i.siginfo.algorithmOid,r.csrSignatureParams,!1),i.signature=r.csrSignature,i.certificationRequestInfo=r.certificationRequestInfo,t){var a;if(i.md=null,i.signatureOid in Dr)switch(Dr[i.signatureOid]){case"sha1WithRSAEncryption":i.md=Nr.md.sha1.create();break;case"md5WithRSAEncryption":i.md=Nr.md.md5.create();break;case"sha256WithRSAEncryption":case"RSASSA-PSS":i.md=Nr.md.sha256.create();break;case"sha384WithRSAEncryption":i.md=Nr.md.sha384.create();break;case"sha512WithRSAEncryption":i.md=Nr.md.sha512.create()}if(null===i.md)throw(a=new Error("Could not compute certification request digest. Unknown signature OID.")).signatureOid=i.signatureOid,a;var s=Rr.toDer(i.certificationRequestInfo);i.md.update(s.getBytes())}var o=Nr.md.sha1.create();return i.subject.getField=function(e){return Mr(i.subject,e)},i.subject.addField=function(e){jr([e]),i.subject.attributes.push(e)},i.subject.attributes=Lr.RDNAttributesAsArray(r.certificationRequestInfoSubject,o),i.subject.hash=o.digest().toHex(),i.publicKey=Lr.publicKeyFromAsn1(r.subjectPublicKeyInfo),i.getAttribute=function(e){return Mr(i,e)},i.addAttribute=function(e){jr([e]),i.attributes.push(e)},i.attributes=Lr.CRIAttributesAsArray(r.certificationRequestInfoAttributes||[]),i},Lr.createCertificationRequest=function(){var e={version:0,signatureOid:null,signature:null,siginfo:{}};return e.siginfo.algorithmOid=null,e.subject={},e.subject.getField=function(t){return Mr(e.subject,t)},e.subject.addField=function(t){jr([t]),e.subject.attributes.push(t)},e.subject.attributes=[],e.subject.hash=null,e.publicKey=null,e.attributes=[],e.getAttribute=function(t){return Mr(e,t)},e.addAttribute=function(t){jr([t]),e.attributes.push(t)},e.md=null,e.setSubject=function(t){jr(t),e.subject.attributes=t,e.subject.hash=null},e.setAttributes=function(t){jr(t),e.attributes=t},e.sign=function(t,r){e.md=r||Nr.md.sha1.create();var n=Dr[e.md.algorithm+"WithRSAEncryption"];if(!n){var i=new Error("Could not compute certification request digest. Unknown message digest algorithm OID.");throw i.algorithm=e.md.algorithm,i}e.signatureOid=e.siginfo.algorithmOid=n,e.certificationRequestInfo=Lr.getCertificationRequestInfo(e);var a=Rr.toDer(e.certificationRequestInfo);e.md.update(a.getBytes()),e.signature=t.sign(e.md)},e.verify=function(){var t=!1,r=e.md;if(null===r){if(e.signatureOid in Dr)switch(Dr[e.signatureOid]){case"sha1WithRSAEncryption":r=Nr.md.sha1.create();break;case"md5WithRSAEncryption":r=Nr.md.md5.create();break;case"sha256WithRSAEncryption":case"RSASSA-PSS":r=Nr.md.sha256.create();break;case"sha384WithRSAEncryption":r=Nr.md.sha384.create();break;case"sha512WithRSAEncryption":r=Nr.md.sha512.create()}if(null===r)throw(u=new Error("Could not compute certification request digest. Unknown signature OID.")).signatureOid=e.signatureOid,u;var n=e.certificationRequestInfo||Lr.getCertificationRequestInfo(e),i=Rr.toDer(n);r.update(i.getBytes())}if(null!==r){var a;switch(e.signatureOid){case Dr.sha1WithRSAEncryption:break;case Dr["RSASSA-PSS"]:var s,o,u;if(void 0===(s=Dr[e.signatureParameters.mgf.hash.algorithmOid])||void 0===Nr.md[s])throw(u=new Error("Unsupported MGF hash function.")).oid=e.signatureParameters.mgf.hash.algorithmOid,u.name=s,u;if(void 0===(o=Dr[e.signatureParameters.mgf.algorithmOid])||void 0===Nr.mgf[o])throw(u=new Error("Unsupported MGF function.")).oid=e.signatureParameters.mgf.algorithmOid,u.name=o,u;if(o=Nr.mgf[o].create(Nr.md[s].create()),void 0===(s=Dr[e.signatureParameters.hash.algorithmOid])||void 0===Nr.md[s])throw(u=new Error("Unsupported RSASSA-PSS hash function.")).oid=e.signatureParameters.hash.algorithmOid,u.name=s,u;a=Nr.pss.create(Nr.md[s].create(),o,e.signatureParameters.saltLength)}t=e.publicKey.verify(r.digest().getBytes(),e.signature,a)}return t},e};var Wr=new Date("1950-01-01T00:00:00Z"),Qr=new Date("2050-01-01T00:00:00Z");function Yr(e){return e>=Wr&&e<Qr?Rr.create(Rr.Class.UNIVERSAL,Rr.Type.UTCTIME,!1,Rr.dateToUtcTime(e)):Rr.create(Rr.Class.UNIVERSAL,Rr.Type.GENERALIZEDTIME,!1,Rr.dateToGeneralizedTime(e))}Lr.getTBSCertificate=function(e){var t=Yr(e.validity.notBefore),r=Yr(e.validity.notAfter),n=Rr.create(Rr.Class.UNIVERSAL,Rr.Type.SEQUENCE,!0,[Rr.create(Rr.Class.CONTEXT_SPECIFIC,0,!0,[Rr.create(Rr.Class.UNIVERSAL,Rr.Type.INTEGER,!1,Rr.integerToDer(e.version).getBytes())]),Rr.create(Rr.Class.UNIVERSAL,Rr.Type.INTEGER,!1,Nr.util.hexToBytes(e.serialNumber)),Rr.create(Rr.Class.UNIVERSAL,Rr.Type.SEQUENCE,!0,[Rr.create(Rr.Class.UNIVERSAL,Rr.Type.OID,!1,Rr.oidToDer(e.siginfo.algorithmOid).getBytes()),Hr(e.siginfo.algorithmOid,e.siginfo.parameters)]),zr(e.issuer),Rr.create(Rr.Class.UNIVERSAL,Rr.Type.SEQUENCE,!0,[t,r]),zr(e.subject),Lr.publicKeyToAsn1(e.publicKey)]);return e.issuer.uniqueId&&n.value.push(Rr.create(Rr.Class.CONTEXT_SPECIFIC,1,!0,[Rr.create(Rr.Class.UNIVERSAL,Rr.Type.BITSTRING,!1,String.fromCharCode(0)+e.issuer.uniqueId)])),e.subject.uniqueId&&n.value.push(Rr.create(Rr.Class.CONTEXT_SPECIFIC,2,!0,[Rr.create(Rr.Class.UNIVERSAL,Rr.Type.BITSTRING,!1,String.fromCharCode(0)+e.subject.uniqueId)])),e.extensions.length>0&&n.value.push(Lr.certificateExtensionsToAsn1(e.extensions)),n},Lr.getCertificationRequestInfo=function(e){return Rr.create(Rr.Class.UNIVERSAL,Rr.Type.SEQUENCE,!0,[Rr.create(Rr.Class.UNIVERSAL,Rr.Type.INTEGER,!1,Rr.integerToDer(e.version).getBytes()),zr(e.subject),Lr.publicKeyToAsn1(e.publicKey),Gr(e)])},Lr.distinguishedNameToAsn1=function(e){return zr(e)},Lr.certificateToAsn1=function(e){var t=e.tbsCertificate||Lr.getTBSCertificate(e);return Rr.create(Rr.Class.UNIVERSAL,Rr.Type.SEQUENCE,!0,[t,Rr.create(Rr.Class.UNIVERSAL,Rr.Type.SEQUENCE,!0,[Rr.create(Rr.Class.UNIVERSAL,Rr.Type.OID,!1,Rr.oidToDer(e.signatureOid).getBytes()),Hr(e.signatureOid,e.signatureParameters)]),Rr.create(Rr.Class.UNIVERSAL,Rr.Type.BITSTRING,!1,String.fromCharCode(0)+e.signature)])},Lr.certificateExtensionsToAsn1=function(e){var t=Rr.create(Rr.Class.CONTEXT_SPECIFIC,3,!0,[]),r=Rr.create(Rr.Class.UNIVERSAL,Rr.Type.SEQUENCE,!0,[]);t.value.push(r);for(var n=0;n<e.length;++n)r.value.push(Lr.certificateExtensionToAsn1(e[n]));return t},Lr.certificateExtensionToAsn1=function(e){var t=Rr.create(Rr.Class.UNIVERSAL,Rr.Type.SEQUENCE,!0,[]);t.value.push(Rr.create(Rr.Class.UNIVERSAL,Rr.Type.OID,!1,Rr.oidToDer(e.id).getBytes())),e.critical&&t.value.push(Rr.create(Rr.Class.UNIVERSAL,Rr.Type.BOOLEAN,!1,String.fromCharCode(255)));var r=e.value;return"string"!=typeof e.value&&(r=Rr.toDer(r).getBytes()),t.value.push(Rr.create(Rr.Class.UNIVERSAL,Rr.Type.OCTETSTRING,!1,r)),t},Lr.certificationRequestToAsn1=function(e){var t=e.certificationRequestInfo||Lr.getCertificationRequestInfo(e);return Rr.create(Rr.Class.UNIVERSAL,Rr.Type.SEQUENCE,!0,[t,Rr.create(Rr.Class.UNIVERSAL,Rr.Type.SEQUENCE,!0,[Rr.create(Rr.Class.UNIVERSAL,Rr.Type.OID,!1,Rr.oidToDer(e.signatureOid).getBytes()),Hr(e.signatureOid,e.signatureParameters)]),Rr.create(Rr.Class.UNIVERSAL,Rr.Type.BITSTRING,!1,String.fromCharCode(0)+e.signature)])},Lr.createCaStore=function(e){var t={certs:{}};function r(e){return n(e),t.certs[e.hash]||null}function n(e){if(!e.hash){var t=Nr.md.sha1.create();e.attributes=Lr.RDNAttributesAsArray(zr(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=Nr.pki.certificateFromPem(e)),n(e.subject),!t.hasCertificate(e))if(e.subject.hash in t.certs){var r=t.certs[e.subject.hash];Nr.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=Nr.pki.certificateFromPem(e));var t=r(e.subject);if(!t)return!1;Nr.util.isArray(t)||(t=[t]);for(var n=Rr.toDer(Lr.certificateToAsn1(e)).getBytes(),i=0;i<t.length;++i){if(n===Rr.toDer(Lr.certificateToAsn1(t[i])).getBytes())return!0}return!1},t.listAllCertificates=function(){var e=[];for(var r in t.certs)if(t.certs.hasOwnProperty(r)){var n=t.certs[r];if(Nr.util.isArray(n))for(var i=0;i<n.length;++i)e.push(n[i]);else e.push(n)}return e},t.removeCertificate=function(e){var i;if("string"==typeof e&&(e=Nr.pki.certificateFromPem(e)),n(e.subject),!t.hasCertificate(e))return null;var a=r(e.subject);if(!Nr.util.isArray(a))return i=t.certs[e.subject.hash],delete t.certs[e.subject.hash],i;for(var s=Rr.toDer(Lr.certificateToAsn1(e)).getBytes(),o=0;o<a.length;++o){s===Rr.toDer(Lr.certificateToAsn1(a[o])).getBytes()&&(i=a[o],a.splice(o,1))}return 0===a.length&&delete t.certs[e.subject.hash],i},e)for(var i=0;i<e.length;++i){var a=e[i];t.addCertificate(a)}return t},Lr.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"},Lr.verifyCertificateChain=function(e,t,r){"function"==typeof r&&(r={verify:r}),r=r||{};var n=(t=t.slice(0)).slice(0),i=r.validityCheckDate;void 0===i&&(i=new Date);var a=!0,s=null,o=0;do{var u=t.shift(),c=null,l=!1;if(i&&(i<u.validity.notBefore||i>u.validity.notAfter)&&(s={message:"Certificate is not valid yet or has expired.",error:Lr.certificateError.certificate_expired,notBefore:u.validity.notBefore,notAfter:u.validity.notAfter,now:i}),null===s){if(null===(c=t[0]||e.getIssuer(u))&&u.isIssuer(u)&&(l=!0,c=u),c){var h=c;Nr.util.isArray(h)||(h=[h]);for(var f=!1;!f&&h.length>0;){c=h.shift();try{f=c.verify(u)}catch(e){}}f||(s={message:"Certificate signature is invalid.",error:Lr.certificateError.bad_certificate})}null!==s||c&&!l||e.hasCertificate(u)||(s={message:"Certificate is not trusted.",error:Lr.certificateError.unknown_ca})}if(null===s&&c&&!u.isIssuer(c)&&(s={message:"Certificate issuer is invalid.",error:Lr.certificateError.bad_certificate}),null===s)for(var d={keyUsage:!0,basicConstraints:!0},p=0;null===s&&p<u.extensions.length;++p){var g=u.extensions[p];g.critical&&!(g.name in d)&&(s={message:"Certificate has an unsupported critical extension.",error:Lr.certificateError.unsupported_certificate})}if(null===s&&(!a||0===t.length&&(!c||l))){var y=u.getExtension("basicConstraints"),m=u.getExtension("keyUsage");if(null!==m&&(m.keyCertSign&&null!==y||(s={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:Lr.certificateError.bad_certificate})),null!==s||null===y||y.cA||(s={message:"Certificate basicConstraints indicates the certificate is not a CA.",error:Lr.certificateError.bad_certificate}),null===s&&null!==m&&"pathLenConstraint"in y)o-1>y.pathLenConstraint&&(s={message:"Certificate basicConstraints pathLenConstraint violated.",error:Lr.certificateError.bad_certificate})}var v=null===s||s.error,C=r.verify?r.verify(v,o,n):v;if(!0!==C)throw!0===v&&(s={message:"The application rejected the certificate.",error:Lr.certificateError.bad_certificate}),(C||0===C)&&("object"!=typeof C||Nr.util.isArray(C)?"string"==typeof C&&(s.error=C):(C.message&&(s.message=C.message),C.error&&(s.error=C.error))),s;s=null,a=!1,++o}while(t.length>0);return!0};var Zr=S,Xr=Zr.asn1,$r=Zr.pki,Jr=Zr.pkcs12=Zr.pkcs12||{},en={name:"ContentInfo",tagClass:Xr.Class.UNIVERSAL,type:Xr.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.contentType",tagClass:Xr.Class.UNIVERSAL,type:Xr.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:Xr.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"content"}]},tn={name:"PFX",tagClass:Xr.Class.UNIVERSAL,type:Xr.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.version",tagClass:Xr.Class.UNIVERSAL,type:Xr.Type.INTEGER,constructed:!1,capture:"version"},en,{name:"PFX.macData",tagClass:Xr.Class.UNIVERSAL,type:Xr.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"mac",value:[{name:"PFX.macData.mac",tagClass:Xr.Class.UNIVERSAL,type:Xr.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm",tagClass:Xr.Class.UNIVERSAL,type:Xr.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm.algorithm",tagClass:Xr.Class.UNIVERSAL,type:Xr.Type.OID,constructed:!1,capture:"macAlgorithm"},{name:"PFX.macData.mac.digestAlgorithm.parameters",tagClass:Xr.Class.UNIVERSAL,captureAsn1:"macAlgorithmParameters"}]},{name:"PFX.macData.mac.digest",tagClass:Xr.Class.UNIVERSAL,type:Xr.Type.OCTETSTRING,constructed:!1,capture:"macDigest"}]},{name:"PFX.macData.macSalt",tagClass:Xr.Class.UNIVERSAL,type:Xr.Type.OCTETSTRING,constructed:!1,capture:"macSalt"},{name:"PFX.macData.iterations",tagClass:Xr.Class.UNIVERSAL,type:Xr.Type.INTEGER,constructed:!1,optional:!0,capture:"macIterations"}]}]},rn={name:"SafeBag",tagClass:Xr.Class.UNIVERSAL,type:Xr.Type.SEQUENCE,constructed:!0,value:[{name:"SafeBag.bagId",tagClass:Xr.Class.UNIVERSAL,type:Xr.Type.OID,constructed:!1,capture:"bagId"},{name:"SafeBag.bagValue",tagClass:Xr.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"bagValue"},{name:"SafeBag.bagAttributes",tagClass:Xr.Class.UNIVERSAL,type:Xr.Type.SET,constructed:!0,optional:!0,capture:"bagAttributes"}]},nn={name:"Attribute",tagClass:Xr.Class.UNIVERSAL,type:Xr.Type.SEQUENCE,constructed:!0,value:[{name:"Attribute.attrId",tagClass:Xr.Class.UNIVERSAL,type:Xr.Type.OID,constructed:!1,capture:"oid"},{name:"Attribute.attrValues",tagClass:Xr.Class.UNIVERSAL,type:Xr.Type.SET,constructed:!0,capture:"values"}]},an={name:"CertBag",tagClass:Xr.Class.UNIVERSAL,type:Xr.Type.SEQUENCE,constructed:!0,value:[{name:"CertBag.certId",tagClass:Xr.Class.UNIVERSAL,type:Xr.Type.OID,constructed:!1,capture:"certId"},{name:"CertBag.certValue",tagClass:Xr.Class.CONTEXT_SPECIFIC,constructed:!0,value:[{name:"CertBag.certValue[0]",tagClass:Xr.Class.UNIVERSAL,type:Xr.Class.OCTETSTRING,constructed:!1,capture:"cert"}]}]};function sn(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 on(e){if(e.composed||e.constructed){for(var t=Zr.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 un(e,t){var r={},n=[];if(!Xr.validate(e,Zr.pkcs7.asn1.encryptedDataValidator,r,n))throw(i=new Error("Cannot read EncryptedContentInfo.")).errors=n,i;var i,a=Xr.derToOid(r.contentType);if(a!==$r.oids.data)throw(i=new Error("PKCS#12 EncryptedContentInfo ContentType is not Data.")).oid=a,i;a=Xr.derToOid(r.encAlgorithm);var s=$r.pbe.getCipher(a,r.encParameter,t),o=on(r.encryptedContentAsn1),u=Zr.util.createBuffer(o.value);if(s.update(u),!s.finish())throw new Error("Failed to decrypt PKCS#12 SafeContents.");return s.output.getBytes()}function cn(e,t,r){if(!t&&0===e.length)return[];if((e=Xr.fromDer(e,t)).tagClass!==Xr.Class.UNIVERSAL||e.type!==Xr.Type.SEQUENCE||!0!==e.constructed)throw new Error("PKCS#12 SafeContents expected to be a SEQUENCE OF SafeBag.");for(var n=[],i=0;i<e.value.length;i++){var a=e.value[i],s={},o=[];if(!Xr.validate(a,rn,s,o))throw(f=new Error("Cannot read SafeBag.")).errors=o,f;var u,c,l={type:Xr.derToOid(s.bagId),attributes:ln(s.bagAttributes)};n.push(l);var h=s.bagValue.value[0];switch(l.type){case $r.oids.pkcs8ShroudedKeyBag:if(null===(h=$r.decryptPrivateKeyInfo(h,r)))throw new Error("Unable to decrypt PKCS#8 ShroudedKeyBag, wrong password?");case $r.oids.keyBag:try{l.key=$r.privateKeyFromAsn1(h)}catch(e){l.key=null,l.asn1=h}continue;case $r.oids.certBag:u=an,c=function(){if(Xr.derToOid(s.certId)!==$r.oids.x509Certificate){var e=new Error("Unsupported certificate type, only X.509 supported.");throw e.oid=Xr.derToOid(s.certId),e}var r=Xr.fromDer(s.cert,t);try{l.cert=$r.certificateFromAsn1(r,!0)}catch(e){l.cert=null,l.asn1=r}};break;default:var f;throw(f=new Error("Unsupported PKCS#12 SafeBag type.")).oid=l.type,f}if(void 0!==u&&!Xr.validate(h,u,s,o))throw(f=new Error("Cannot read PKCS#12 "+u.name)).errors=o,f;c()}return n}function ln(e){var t={};if(void 0!==e)for(var r=0;r<e.length;++r){var n={},i=[];if(!Xr.validate(e[r],nn,n,i)){var a=new Error("Cannot read PKCS#12 BagAttribute.");throw a.errors=i,a}var s=Xr.derToOid(n.oid);if(void 0!==$r.oids[s]){t[$r.oids[s]]=[];for(var o=0;o<n.values.length;++o)t[$r.oids[s]].push(n.values[o].value)}}return t}Jr.pkcs12FromAsn1=function(e,t,r){"string"==typeof t?(r=t,t=!0):void 0===t&&(t=!0);var n={};if(!Xr.validate(e,tn,n,[]))throw(i=new Error("Cannot read PKCS#12 PFX. ASN.1 object is not an PKCS#12 PFX.")).errors=i,i;var i,a={version:n.version.charCodeAt(0),safeContents:[],getBags:function(e){var t,r={};return"localKeyId"in e?t=e.localKeyId:"localKeyIdHex"in e&&(t=Zr.util.hexToBytes(e.localKeyIdHex)),void 0===t&&!("friendlyName"in e)&&"bagType"in e&&(r[e.bagType]=sn(a.safeContents,null,null,e.bagType)),void 0!==t&&(r.localKeyId=sn(a.safeContents,"localKeyId",t,e.bagType)),"friendlyName"in e&&(r.friendlyName=sn(a.safeContents,"friendlyName",e.friendlyName,e.bagType)),r},getBagsByFriendlyName:function(e,t){return sn(a.safeContents,"friendlyName",e,t)},getBagsByLocalKeyId:function(e,t){return sn(a.safeContents,"localKeyId",e,t)}};if(3!==n.version.charCodeAt(0))throw(i=new Error("PKCS#12 PFX of version other than 3 not supported.")).version=n.version.charCodeAt(0),i;if(Xr.derToOid(n.contentType)!==$r.oids.data)throw(i=new Error("Only PKCS#12 PFX in password integrity mode supported.")).oid=Xr.derToOid(n.contentType),i;var s=n.content.value[0];if(s.tagClass!==Xr.Class.UNIVERSAL||s.type!==Xr.Type.OCTETSTRING)throw new Error("PKCS#12 authSafe content data is not an OCTET STRING.");if(s=on(s),n.mac){var o=null,u=0,c=Xr.derToOid(n.macAlgorithm);switch(c){case $r.oids.sha1:o=Zr.md.sha1.create(),u=20;break;case $r.oids.sha256:o=Zr.md.sha256.create(),u=32;break;case $r.oids.sha384:o=Zr.md.sha384.create(),u=48;break;case $r.oids.sha512:o=Zr.md.sha512.create(),u=64;break;case $r.oids.md5:o=Zr.md.md5.create(),u=16}if(null===o)throw new Error("PKCS#12 uses unsupported MAC algorithm: "+c);var l=new Zr.util.ByteBuffer(n.macSalt),h="macIterations"in n?parseInt(Zr.util.bytesToHex(n.macIterations),16):1,f=Jr.generateKey(r,l,3,h,u,o),d=Zr.hmac.create();if(d.start(o,f),d.update(s.value),d.getMac().getBytes()!==n.macDigest)throw new Error("PKCS#12 MAC could not be verified. Invalid password?")}return function(e,t,r,n){if(t=Xr.fromDer(t,r),t.tagClass!==Xr.Class.UNIVERSAL||t.type!==Xr.Type.SEQUENCE||!0!==t.constructed)throw new Error("PKCS#12 AuthenticatedSafe expected to be a SEQUENCE OF ContentInfo");for(var i=0;i<t.value.length;i++){var a=t.value[i],s={},o=[];if(!Xr.validate(a,en,s,o))throw(h=new Error("Cannot read ContentInfo.")).errors=o,h;var u={encrypted:!1},c=null,l=s.content.value[0];switch(Xr.derToOid(s.contentType)){case $r.oids.data:if(l.tagClass!==Xr.Class.UNIVERSAL||l.type!==Xr.Type.OCTETSTRING)throw new Error("PKCS#12 SafeContents Data is not an OCTET STRING.");c=on(l).value;break;case $r.oids.encryptedData:c=un(l,n),u.encrypted=!0;break;default:var h;throw(h=new Error("Unsupported PKCS#12 contentType.")).contentType=Xr.derToOid(s.contentType),h}u.safeBags=cn(c,r,n),e.safeContents.push(u)}}(a,s.value,t,r),a},Jr.toPkcs12Asn1=function(e,t,r,n){(n=n||{}).saltSize=n.saltSize||8,n.count=n.count||2048,n.algorithm=n.algorithm||n.encAlgorithm||"aes128","useMac"in n||(n.useMac=!0),"localKeyId"in n||(n.localKeyId=null),"generateLocalKeyId"in n||(n.generateLocalKeyId=!0);var i,a=n.localKeyId;if(null!==a)a=Zr.util.hexToBytes(a);else if(n.generateLocalKeyId)if(t){var s=Zr.util.isArray(t)?t[0]:t;"string"==typeof s&&(s=$r.certificateFromPem(s)),(T=Zr.md.sha1.create()).update(Xr.toDer($r.certificateToAsn1(s)).getBytes()),a=T.digest().getBytes()}else a=Zr.random.getBytes(20);var o=[];null!==a&&o.push(Xr.create(Xr.Class.UNIVERSAL,Xr.Type.SEQUENCE,!0,[Xr.create(Xr.Class.UNIVERSAL,Xr.Type.OID,!1,Xr.oidToDer($r.oids.localKeyId).getBytes()),Xr.create(Xr.Class.UNIVERSAL,Xr.Type.SET,!0,[Xr.create(Xr.Class.UNIVERSAL,Xr.Type.OCTETSTRING,!1,a)])])),"friendlyName"in n&&o.push(Xr.create(Xr.Class.UNIVERSAL,Xr.Type.SEQUENCE,!0,[Xr.create(Xr.Class.UNIVERSAL,Xr.Type.OID,!1,Xr.oidToDer($r.oids.friendlyName).getBytes()),Xr.create(Xr.Class.UNIVERSAL,Xr.Type.SET,!0,[Xr.create(Xr.Class.UNIVERSAL,Xr.Type.BMPSTRING,!1,n.friendlyName)])])),o.length>0&&(i=Xr.create(Xr.Class.UNIVERSAL,Xr.Type.SET,!0,o));var u=[],c=[];null!==t&&(c=Zr.util.isArray(t)?t:[t]);for(var l=[],h=0;h<c.length;++h){"string"==typeof(t=c[h])&&(t=$r.certificateFromPem(t));var f=0===h?i:void 0,d=$r.certificateToAsn1(t),p=Xr.create(Xr.Class.UNIVERSAL,Xr.Type.SEQUENCE,!0,[Xr.create(Xr.Class.UNIVERSAL,Xr.Type.OID,!1,Xr.oidToDer($r.oids.certBag).getBytes()),Xr.create(Xr.Class.CONTEXT_SPECIFIC,0,!0,[Xr.create(Xr.Class.UNIVERSAL,Xr.Type.SEQUENCE,!0,[Xr.create(Xr.Class.UNIVERSAL,Xr.Type.OID,!1,Xr.oidToDer($r.oids.x509Certificate).getBytes()),Xr.create(Xr.Class.CONTEXT_SPECIFIC,0,!0,[Xr.create(Xr.Class.UNIVERSAL,Xr.Type.OCTETSTRING,!1,Xr.toDer(d).getBytes())])])]),f]);l.push(p)}if(l.length>0){var g=Xr.create(Xr.Class.UNIVERSAL,Xr.Type.SEQUENCE,!0,l),y=Xr.create(Xr.Class.UNIVERSAL,Xr.Type.SEQUENCE,!0,[Xr.create(Xr.Class.UNIVERSAL,Xr.Type.OID,!1,Xr.oidToDer($r.oids.data).getBytes()),Xr.create(Xr.Class.CONTEXT_SPECIFIC,0,!0,[Xr.create(Xr.Class.UNIVERSAL,Xr.Type.OCTETSTRING,!1,Xr.toDer(g).getBytes())])]);u.push(y)}var m=null;if(null!==e){var v=$r.wrapRsaPrivateKey($r.privateKeyToAsn1(e));m=null===r?Xr.create(Xr.Class.UNIVERSAL,Xr.Type.SEQUENCE,!0,[Xr.create(Xr.Class.UNIVERSAL,Xr.Type.OID,!1,Xr.oidToDer($r.oids.keyBag).getBytes()),Xr.create(Xr.Class.CONTEXT_SPECIFIC,0,!0,[v]),i]):Xr.create(Xr.Class.UNIVERSAL,Xr.Type.SEQUENCE,!0,[Xr.create(Xr.Class.UNIVERSAL,Xr.Type.OID,!1,Xr.oidToDer($r.oids.pkcs8ShroudedKeyBag).getBytes()),Xr.create(Xr.Class.CONTEXT_SPECIFIC,0,!0,[$r.encryptPrivateKeyInfo(v,r,n)]),i]);var C=Xr.create(Xr.Class.UNIVERSAL,Xr.Type.SEQUENCE,!0,[m]),E=Xr.create(Xr.Class.UNIVERSAL,Xr.Type.SEQUENCE,!0,[Xr.create(Xr.Class.UNIVERSAL,Xr.Type.OID,!1,Xr.oidToDer($r.oids.data).getBytes()),Xr.create(Xr.Class.CONTEXT_SPECIFIC,0,!0,[Xr.create(Xr.Class.UNIVERSAL,Xr.Type.OCTETSTRING,!1,Xr.toDer(C).getBytes())])]);u.push(E)}var b,S=Xr.create(Xr.Class.UNIVERSAL,Xr.Type.SEQUENCE,!0,u);if(n.useMac){var T=Zr.md.sha1.create(),_=new Zr.util.ByteBuffer(Zr.random.getBytes(n.saltSize)),w=n.count,I=(e=Jr.generateKey(r,_,3,w,20),Zr.hmac.create());I.start(T,e),I.update(Xr.toDer(S).getBytes());var A=I.getMac();b=Xr.create(Xr.Class.UNIVERSAL,Xr.Type.SEQUENCE,!0,[Xr.create(Xr.Class.UNIVERSAL,Xr.Type.SEQUENCE,!0,[Xr.create(Xr.Class.UNIVERSAL,Xr.Type.SEQUENCE,!0,[Xr.create(Xr.Class.UNIVERSAL,Xr.Type.OID,!1,Xr.oidToDer($r.oids.sha1).getBytes()),Xr.create(Xr.Class.UNIVERSAL,Xr.Type.NULL,!1,"")]),Xr.create(Xr.Class.UNIVERSAL,Xr.Type.OCTETSTRING,!1,A.getBytes())]),Xr.create(Xr.Class.UNIVERSAL,Xr.Type.OCTETSTRING,!1,_.getBytes()),Xr.create(Xr.Class.UNIVERSAL,Xr.Type.INTEGER,!1,Xr.integerToDer(w).getBytes())])}return Xr.create(Xr.Class.UNIVERSAL,Xr.Type.SEQUENCE,!0,[Xr.create(Xr.Class.UNIVERSAL,Xr.Type.INTEGER,!1,Xr.integerToDer(3).getBytes()),Xr.create(Xr.Class.UNIVERSAL,Xr.Type.SEQUENCE,!0,[Xr.create(Xr.Class.UNIVERSAL,Xr.Type.OID,!1,Xr.oidToDer($r.oids.data).getBytes()),Xr.create(Xr.Class.CONTEXT_SPECIFIC,0,!0,[Xr.create(Xr.Class.UNIVERSAL,Xr.Type.OCTETSTRING,!1,Xr.toDer(S).getBytes())])]),b])},Jr.generateKey=Zr.pbe.generatePkcs12Key;var hn=S,fn=hn.asn1,dn=hn.pki=hn.pki||{};dn.pemToDer=function(e){var t=hn.pem.decode(e)[0];if(t.procType&&"ENCRYPTED"===t.procType.type)throw new Error("Could not convert PEM to DER; PEM is encrypted.");return hn.util.createBuffer(t.body)},dn.privateKeyFromPem=function(e){var t=hn.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 n=fn.fromDer(t.body);return dn.privateKeyFromAsn1(n)},dn.privateKeyToPem=function(e,t){var r={type:"RSA PRIVATE KEY",body:fn.toDer(dn.privateKeyToAsn1(e)).getBytes()};return hn.pem.encode(r,{maxline:t})},dn.privateKeyInfoToPem=function(e,t){var r={type:"PRIVATE KEY",body:fn.toDer(e).getBytes()};return hn.pem.encode(r,{maxline:t})};var pn=S,gn=function(e,t,r,n){var i=pn.util.createBuffer(),a=e.length>>1,s=a+(1&e.length),o=e.substr(0,s),u=e.substr(a,s),c=pn.util.createBuffer(),l=pn.hmac.create();r=t+r;var h=Math.ceil(n/16),f=Math.ceil(n/20);l.start("MD5",o);var d=pn.util.createBuffer();c.putBytes(r);for(var p=0;p<h;++p)l.start(null,null),l.update(c.getBytes()),c.putBuffer(l.digest()),l.start(null,null),l.update(c.bytes()+r),d.putBuffer(l.digest());l.start("SHA1",u);var g=pn.util.createBuffer();c.clear(),c.putBytes(r);for(p=0;p<f;++p)l.start(null,null),l.update(c.getBytes()),c.putBuffer(l.digest()),l.start(null,null),l.update(c.bytes()+r),g.putBuffer(l.digest());return i.putBytes(pn.util.xorBytes(d.getBytes(),g.getBytes(),n)),i},yn=function(e,t,r){var n=!1;try{var i=e.deflate(t.fragment.getBytes());t.fragment=pn.util.createBuffer(i),t.length=i.length,n=!0}catch(e){}return n},mn=function(e,t,r){var n=!1;try{var i=e.inflate(t.fragment.getBytes());t.fragment=pn.util.createBuffer(i),t.length=i.length,n=!0}catch(e){}return n},vn=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 pn.util.createBuffer(e.getBytes(r))},Cn=function(e,t,r){e.putInt(r.length(),t<<3),e.putBuffer(r)},En={Versions:{TLS_1_0:{major:3,minor:1},TLS_1_1:{major:3,minor:2},TLS_1_2:{major:3,minor:3}}};En.SupportedVersions=[En.Versions.TLS_1_1,En.Versions.TLS_1_0],En.Version=En.SupportedVersions[0],En.MaxFragment=15360,En.ConnectionEnd={server:0,client:1},En.PRFAlgorithm={tls_prf_sha256:0},En.BulkCipherAlgorithm={none:null,rc4:0,des3:1,aes:2},En.CipherType={stream:0,block:1,aead:2},En.MACAlgorithm={none:null,hmac_md5:0,hmac_sha1:1,hmac_sha256:2,hmac_sha384:3,hmac_sha512:4},En.CompressionMethod={none:0,deflate:1},En.ContentType={change_cipher_spec:20,alert:21,handshake:22,application_data:23,heartbeat:24},En.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},En.Alert={},En.Alert.Level={warning:1,fatal:2},En.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},En.HeartbeatMessageType={heartbeat_request:1,heartbeat_response:2},En.CipherSuites={},En.getCipherSuite=function(e){var t=null;for(var r in En.CipherSuites){var n=En.CipherSuites[r];if(n.id[0]===e.charCodeAt(0)&&n.id[1]===e.charCodeAt(1)){t=n;break}}return t},En.handleUnexpected=function(e,t){!e.open&&e.entity===En.ConnectionEnd.client||e.error(e,{message:"Unexpected message. Received TLS record out of order.",send:!0,alert:{level:En.Alert.Level.fatal,description:En.Alert.Description.unexpected_message}})},En.handleHelloRequest=function(e,t,r){!e.handshaking&&e.handshakes>0&&(En.queue(e,En.createAlert(e,{level:En.Alert.Level.warning,description:En.Alert.Description.no_renegotiation})),En.flush(e)),e.process()},En.parseHelloMessage=function(e,t,r){var n=null,i=e.entity===En.ConnectionEnd.client;if(r<38)e.error(e,{message:i?"Invalid ServerHello message. Message too short.":"Invalid ClientHello message. Message too short.",send:!0,alert:{level:En.Alert.Level.fatal,description:En.Alert.Description.illegal_parameter}});else{var a=t.fragment,s=a.length();if(n={version:{major:a.getByte(),minor:a.getByte()},random:pn.util.createBuffer(a.getBytes(32)),session_id:vn(a,1),extensions:[]},i?(n.cipher_suite=a.getBytes(2),n.compression_method=a.getByte()):(n.cipher_suites=vn(a,2),n.compression_methods=vn(a,1)),(s=r-(s-a.length()))>0){for(var o=vn(a,2);o.length()>0;)n.extensions.push({type:[o.getByte(),o.getByte()],data:vn(o,2)});if(!i)for(var u=0;u<n.extensions.length;++u){var c=n.extensions[u];if(0===c.type[0]&&0===c.type[1])for(var l=vn(c.data,2);l.length()>0;){if(0!==l.getByte())break;e.session.extensions.server_name.serverNameList.push(vn(l,2).getBytes())}}}if(e.session.version&&(n.version.major!==e.session.version.major||n.version.minor!==e.session.version.minor))return e.error(e,{message:"TLS version change is disallowed during renegotiation.",send:!0,alert:{level:En.Alert.Level.fatal,description:En.Alert.Description.protocol_version}});if(i)e.session.cipherSuite=En.getCipherSuite(n.cipher_suite);else for(var h=pn.util.createBuffer(n.cipher_suites.bytes());h.length()>0&&(e.session.cipherSuite=En.getCipherSuite(h.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:En.Alert.Level.fatal,description:En.Alert.Description.handshake_failure},cipherSuite:pn.util.bytesToHex(n.cipher_suite)});e.session.compressionMethod=i?n.compression_method:En.CompressionMethod.none}return n},En.createSecurityParameters=function(e,t){var r=e.entity===En.ConnectionEnd.client,n=t.random.bytes(),i=r?e.session.sp.client_random:n,a=r?n:En.createRandom().getBytes();e.session.sp={entity:e.entity,prf_algorithm:En.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}},En.handleServerHello=function(e,t,r){var n=En.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:En.Alert.Level.fatal,description:En.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=wn,e.session.resuming=!0,e.session.sp.server_random=n.random.bytes()):(e.expect=bn,e.session.resuming=!1,En.createSecurityParameters(e,n)),e.session.id=i,e.process()}},En.handleClientHello=function(e,t,r){var n=En.parseHelloMessage(e,t,r);if(!e.fail){var i=n.session_id.bytes(),a=null;if(e.sessionCache&&(null===(a=e.sessionCache.getSession(i))?i="":(a.version.major!==n.version.major||a.version.minor>n.version.minor)&&(a=null,i="")),0===i.length&&(i=pn.random.getBytes(32)),e.session.id=i,e.session.clientHelloVersion=n.version,e.session.sp={},a)e.version=e.session.version=a.version,e.session.sp=a.sp;else{for(var s,o=1;o<En.SupportedVersions.length&&!((s=En.SupportedVersions[o]).minor<=n.version.minor);++o);e.version={major:s.major,minor:s.minor},e.session.version=e.version}null!==a?(e.expect=Ln,e.session.resuming=!0,e.session.sp.client_random=n.random.bytes()):(e.expect=!1!==e.verifyClient?kn:Nn,e.session.resuming=!1,En.createSecurityParameters(e,n)),e.open=!0,En.queue(e,En.createRecord(e,{type:En.ContentType.handshake,data:En.createServerHello(e)})),e.session.resuming?(En.queue(e,En.createRecord(e,{type:En.ContentType.change_cipher_spec,data:En.createChangeCipherSpec()})),e.state.pending=En.createConnectionState(e),e.state.current.write=e.state.pending.write,En.queue(e,En.createRecord(e,{type:En.ContentType.handshake,data:En.createFinished(e)}))):(En.queue(e,En.createRecord(e,{type:En.ContentType.handshake,data:En.createCertificate(e)})),e.fail||(En.queue(e,En.createRecord(e,{type:En.ContentType.handshake,data:En.createServerKeyExchange(e)})),!1!==e.verifyClient&&En.queue(e,En.createRecord(e,{type:En.ContentType.handshake,data:En.createCertificateRequest(e)})),En.queue(e,En.createRecord(e,{type:En.ContentType.handshake,data:En.createServerHelloDone(e)})))),En.flush(e),e.process()}},En.handleCertificate=function(e,t,r){if(r<3)return e.error(e,{message:"Invalid Certificate message. Message too short.",send:!0,alert:{level:En.Alert.Level.fatal,description:En.Alert.Description.illegal_parameter}});var n,i,a=t.fragment,s={certificate_list:vn(a,3)},o=[];try{for(;s.certificate_list.length()>0;)n=vn(s.certificate_list,3),i=pn.asn1.fromDer(n),n=pn.pki.certificateFromAsn1(i,!0),o.push(n)}catch(t){return e.error(e,{message:"Could not parse certificate list.",cause:t,send:!0,alert:{level:En.Alert.Level.fatal,description:En.Alert.Description.bad_certificate}})}var u=e.entity===En.ConnectionEnd.client;!u&&!0!==e.verifyClient||0!==o.length?0===o.length?e.expect=u?Sn:Nn:(u?e.session.serverCertificate=o[0]:e.session.clientCertificate=o[0],En.verifyCertificateChain(e,o)&&(e.expect=u?Sn:Nn)):e.error(e,{message:u?"No server certificate provided.":"No client certificate provided.",send:!0,alert:{level:En.Alert.Level.fatal,description:En.Alert.Description.illegal_parameter}}),e.process()},En.handleServerKeyExchange=function(e,t,r){if(r>0)return e.error(e,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:En.Alert.Level.fatal,description:En.Alert.Description.unsupported_certificate}});e.expect=Tn,e.process()},En.handleClientKeyExchange=function(e,t,r){if(r<48)return e.error(e,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:En.Alert.Level.fatal,description:En.Alert.Description.unsupported_certificate}});var n=t.fragment,i={enc_pre_master_secret:vn(n,2).getBytes()},a=null;if(e.getPrivateKey)try{a=e.getPrivateKey(e,e.session.serverCertificate),a=pn.pki.privateKeyFromPem(a)}catch(t){e.error(e,{message:"Could not get private key.",cause:t,send:!0,alert:{level:En.Alert.Level.fatal,description:En.Alert.Description.internal_error}})}if(null===a)return e.error(e,{message:"No private key set.",send:!0,alert:{level:En.Alert.Level.fatal,description:En.Alert.Description.internal_error}});try{var s=e.session.sp;s.pre_master_secret=a.decrypt(i.enc_pre_master_secret);var o=e.session.clientHelloVersion;if(o.major!==s.pre_master_secret.charCodeAt(0)||o.minor!==s.pre_master_secret.charCodeAt(1))throw new Error("TLS version rollback attack detected.")}catch(e){s.pre_master_secret=pn.random.getBytes(48)}e.expect=Ln,null!==e.session.clientCertificate&&(e.expect=Rn),e.process()},En.handleCertificateRequest=function(e,t,r){if(r<3)return e.error(e,{message:"Invalid CertificateRequest. Message too short.",send:!0,alert:{level:En.Alert.Level.fatal,description:En.Alert.Description.illegal_parameter}});var n=t.fragment,i={certificate_types:vn(n,1),certificate_authorities:vn(n,2)};e.session.certificateRequest=i,e.expect=_n,e.process()},En.handleCertificateVerify=function(e,t,r){if(r<2)return e.error(e,{message:"Invalid CertificateVerify. Message too short.",send:!0,alert:{level:En.Alert.Level.fatal,description:En.Alert.Description.illegal_parameter}});var n=t.fragment;n.read-=4;var i=n.bytes();n.read+=4;var a={signature:vn(n,2).getBytes()},s=pn.util.createBuffer();s.putBuffer(e.session.md5.digest()),s.putBuffer(e.session.sha1.digest()),s=s.getBytes();try{if(!e.session.clientCertificate.publicKey.verify(s,a.signature,"NONE"))throw new Error("CertificateVerify signature does not match.");e.session.md5.update(i),e.session.sha1.update(i)}catch(t){return e.error(e,{message:"Bad signature in CertificateVerify.",send:!0,alert:{level:En.Alert.Level.fatal,description:En.Alert.Description.handshake_failure}})}e.expect=Ln,e.process()},En.handleServerHelloDone=function(e,t,r){if(r>0)return e.error(e,{message:"Invalid ServerHelloDone message. Invalid length.",send:!0,alert:{level:En.Alert.Level.fatal,description:En.Alert.Description.record_overflow}});if(null===e.serverCertificate){var n={message:"No server certificate provided. Not enough security.",send:!0,alert:{level:En.Alert.Level.fatal,description:En.Alert.Description.insufficient_security}},i=e.verify(e,n.alert.description,0,[]);if(!0!==i)return(i||0===i)&&("object"!=typeof i||pn.util.isArray(i)?"number"==typeof i&&(n.alert.description=i):(i.message&&(n.message=i.message),i.alert&&(n.alert.description=i.alert))),e.error(e,n)}null!==e.session.certificateRequest&&(t=En.createRecord(e,{type:En.ContentType.handshake,data:En.createCertificate(e)}),En.queue(e,t)),t=En.createRecord(e,{type:En.ContentType.handshake,data:En.createClientKeyExchange(e)}),En.queue(e,t),e.expect=Bn;var a=function(e,t){null!==e.session.certificateRequest&&null!==e.session.clientCertificate&&En.queue(e,En.createRecord(e,{type:En.ContentType.handshake,data:En.createCertificateVerify(e,t)})),En.queue(e,En.createRecord(e,{type:En.ContentType.change_cipher_spec,data:En.createChangeCipherSpec()})),e.state.pending=En.createConnectionState(e),e.state.current.write=e.state.pending.write,En.queue(e,En.createRecord(e,{type:En.ContentType.handshake,data:En.createFinished(e)})),e.expect=wn,En.flush(e),e.process()};if(null===e.session.certificateRequest||null===e.session.clientCertificate)return a(e,null);En.getClientSignature(e,a)},En.handleChangeCipherSpec=function(e,t){if(1!==t.fragment.getByte())return e.error(e,{message:"Invalid ChangeCipherSpec message received.",send:!0,alert:{level:En.Alert.Level.fatal,description:En.Alert.Description.illegal_parameter}});var r=e.entity===En.ConnectionEnd.client;(e.session.resuming&&r||!e.session.resuming&&!r)&&(e.state.pending=En.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?In:Dn,e.process()},En.handleFinished=function(e,t,r){var n=t.fragment;n.read-=4;var i=n.bytes();n.read+=4;var a=t.fragment.getBytes();(n=pn.util.createBuffer()).putBuffer(e.session.md5.digest()),n.putBuffer(e.session.sha1.digest());var s=e.entity===En.ConnectionEnd.client,o=s?"server finished":"client finished",u=e.session.sp;if((n=gn(u.master_secret,o,n.getBytes(),12)).getBytes()!==a)return e.error(e,{message:"Invalid verify_data in Finished message.",send:!0,alert:{level:En.Alert.Level.fatal,description:En.Alert.Description.decrypt_error}});e.session.md5.update(i),e.session.sha1.update(i),(e.session.resuming&&s||!e.session.resuming&&!s)&&(En.queue(e,En.createRecord(e,{type:En.ContentType.change_cipher_spec,data:En.createChangeCipherSpec()})),e.state.current.write=e.state.pending.write,e.state.pending=null,En.queue(e,En.createRecord(e,{type:En.ContentType.handshake,data:En.createFinished(e)}))),e.expect=s?An:Un,e.handshaking=!1,++e.handshakes,e.peerCertificate=s?e.session.serverCertificate:e.session.clientCertificate,En.flush(e),e.isConnected=!0,e.connected(e),e.process()},En.handleAlert=function(e,t){var r,n=t.fragment,i={level:n.getByte(),description:n.getByte()};switch(i.description){case En.Alert.Description.close_notify:r="Connection closed.";break;case En.Alert.Description.unexpected_message:r="Unexpected message.";break;case En.Alert.Description.bad_record_mac:r="Bad record MAC.";break;case En.Alert.Description.decryption_failed:r="Decryption failed.";break;case En.Alert.Description.record_overflow:r="Record overflow.";break;case En.Alert.Description.decompression_failure:r="Decompression failed.";break;case En.Alert.Description.handshake_failure:r="Handshake failure.";break;case En.Alert.Description.bad_certificate:r="Bad certificate.";break;case En.Alert.Description.unsupported_certificate:r="Unsupported certificate.";break;case En.Alert.Description.certificate_revoked:r="Certificate revoked.";break;case En.Alert.Description.certificate_expired:r="Certificate expired.";break;case En.Alert.Description.certificate_unknown:r="Certificate unknown.";break;case En.Alert.Description.illegal_parameter:r="Illegal parameter.";break;case En.Alert.Description.unknown_ca:r="Unknown certificate authority.";break;case En.Alert.Description.access_denied:r="Access denied.";break;case En.Alert.Description.decode_error:r="Decode error.";break;case En.Alert.Description.decrypt_error:r="Decrypt error.";break;case En.Alert.Description.export_restriction:r="Export restriction.";break;case En.Alert.Description.protocol_version:r="Unsupported protocol version.";break;case En.Alert.Description.insufficient_security:r="Insufficient security.";break;case En.Alert.Description.internal_error:r="Internal error.";break;case En.Alert.Description.user_canceled:r="User canceled.";break;case En.Alert.Description.no_renegotiation:r="Renegotiation not supported.";break;default:r="Unknown error."}if(i.description===En.Alert.Description.close_notify)return e.close();e.error(e,{message:r,send:!1,origin:e.entity===En.ConnectionEnd.client?"server":"client",alert:i}),e.process()},En.handleHandshake=function(e,t){var r=t.fragment,n=r.getByte(),i=r.getInt24();if(i>r.length())return e.fragmented=t,t.fragment=pn.util.createBuffer(),r.read-=4,e.process();e.fragmented=null,r.read-=4;var a=r.bytes(i+4);r.read+=4,n in Yn[e.entity][e.expect]?(e.entity!==En.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:pn.md.md5.create(),sha1:pn.md.sha1.create()}),n!==En.HandshakeType.hello_request&&n!==En.HandshakeType.certificate_verify&&n!==En.HandshakeType.finished&&(e.session.md5.update(a),e.session.sha1.update(a)),Yn[e.entity][e.expect][n](e,t,i)):En.handleUnexpected(e,t)},En.handleApplicationData=function(e,t){e.data.putBuffer(t.fragment),e.dataReady(e),e.process()},En.handleHeartbeat=function(e,t){var r=t.fragment,n=r.getByte(),i=r.getInt16(),a=r.getBytes(i);if(n===En.HeartbeatMessageType.heartbeat_request){if(e.handshaking||i>a.length)return e.process();En.queue(e,En.createRecord(e,{type:En.ContentType.heartbeat,data:En.createHeartbeat(En.HeartbeatMessageType.heartbeat_response,a)})),En.flush(e)}else if(n===En.HeartbeatMessageType.heartbeat_response){if(a!==e.expectedHeartbeatPayload)return e.process();e.heartbeatReceived&&e.heartbeatReceived(e,pn.util.createBuffer(a))}e.process()};var bn=1,Sn=2,Tn=3,_n=4,wn=5,In=6,An=7,Bn=8,kn=1,Nn=2,Rn=3,Ln=4,Dn=5,Un=6,xn=En.handleUnexpected,On=En.handleChangeCipherSpec,Pn=En.handleAlert,Vn=En.handleHandshake,Kn=En.handleApplicationData,Mn=En.handleHeartbeat,Fn=[];Fn[En.ConnectionEnd.client]=[[xn,Pn,Vn,xn,Mn],[xn,Pn,Vn,xn,Mn],[xn,Pn,Vn,xn,Mn],[xn,Pn,Vn,xn,Mn],[xn,Pn,Vn,xn,Mn],[On,Pn,xn,xn,Mn],[xn,Pn,Vn,xn,Mn],[xn,Pn,Vn,Kn,Mn],[xn,Pn,Vn,xn,Mn]],Fn[En.ConnectionEnd.server]=[[xn,Pn,Vn,xn,Mn],[xn,Pn,Vn,xn,Mn],[xn,Pn,Vn,xn,Mn],[xn,Pn,Vn,xn,Mn],[On,Pn,xn,xn,Mn],[xn,Pn,Vn,xn,Mn],[xn,Pn,Vn,Kn,Mn],[xn,Pn,Vn,xn,Mn]];var zn=En.handleHelloRequest,jn=En.handleServerHello,qn=En.handleCertificate,Hn=En.handleServerKeyExchange,Gn=En.handleCertificateRequest,Wn=En.handleServerHelloDone,Qn=En.handleFinished,Yn=[];Yn[En.ConnectionEnd.client]=[[xn,xn,jn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn],[zn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,qn,Hn,Gn,Wn,xn,xn,xn,xn,xn,xn],[zn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,Hn,Gn,Wn,xn,xn,xn,xn,xn,xn],[zn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,Gn,Wn,xn,xn,xn,xn,xn,xn],[zn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,Wn,xn,xn,xn,xn,xn,xn],[zn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn],[zn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,Qn],[zn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn],[zn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn]];var Zn=En.handleClientHello,Xn=En.handleClientKeyExchange,$n=En.handleCertificateVerify;Yn[En.ConnectionEnd.server]=[[xn,Zn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn],[xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,qn,xn,xn,xn,xn,xn,xn,xn,xn,xn],[xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,Xn,xn,xn,xn,xn],[xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,$n,xn,xn,xn,xn,xn],[xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn],[xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,Qn],[xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn],[xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn,xn]],En.generateKeys=function(e,t){var r=gn,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 i=2*t.mac_key_length+2*t.enc_key_length,a=e.version.major===En.Versions.TLS_1_0.major&&e.version.minor===En.Versions.TLS_1_0.minor;a&&(i+=2*t.fixed_iv_length);var s=r(t.master_secret,"key expansion",n,i),o={client_write_MAC_key:s.getBytes(t.mac_key_length),server_write_MAC_key:s.getBytes(t.mac_key_length),client_write_key:s.getBytes(t.enc_key_length),server_write_key:s.getBytes(t.enc_key_length)};return a&&(o.client_write_IV=s.getBytes(t.fixed_iv_length),o.server_write_IV=s.getBytes(t.fixed_iv_length)),o},En.createConnectionState=function(e){var t=e.entity===En.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:En.Alert.Level.fatal,description:En.Alert.Description.decompression_failure}}):e.error(e,{message:"Could not decrypt record or bad MAC.",send:!0,alert:{level:En.Alert.Level.fatal,description:En.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:En.Alert.Level.fatal,description:En.Alert.Description.internal_error}}):e.error(e,{message:"Could not compress record.",send:!1,alert:{level:En.Alert.Level.fatal,description:En.Alert.Description.internal_error}}),!e.fail},e.session){var i=e.session.sp;switch(e.session.cipherSuite.initSecurityParameters(i),i.keys=En.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 En.CompressionMethod.none:break;case En.CompressionMethod.deflate:n.read.compressFunction=mn,n.write.compressFunction=yn;break;default:throw new Error("Unsupported compression algorithm.")}}return n},En.createRandom=function(){var e=new Date,t=+e+6e4*e.getTimezoneOffset(),r=pn.util.createBuffer();return r.putInt32(t),r.putBytes(pn.random.getBytes(28)),r},En.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},En.createAlert=function(e,t){var r=pn.util.createBuffer();return r.putByte(t.level),r.putByte(t.description),En.createRecord(e,{type:En.ContentType.alert,data:r})},En.createClientHello=function(e){e.session.clientHelloVersion={major:e.version.major,minor:e.version.minor};for(var t=pn.util.createBuffer(),r=0;r<e.cipherSuites.length;++r){var n=e.cipherSuites[r];t.putByte(n.id[0]),t.putByte(n.id[1])}var i=t.length(),a=pn.util.createBuffer();a.putByte(En.CompressionMethod.none);var s=a.length(),o=pn.util.createBuffer();if(e.virtualHost){var u=pn.util.createBuffer();u.putByte(0),u.putByte(0);var c=pn.util.createBuffer();c.putByte(0),Cn(c,2,pn.util.createBuffer(e.virtualHost));var l=pn.util.createBuffer();Cn(l,2,c),Cn(u,2,l),o.putBuffer(u)}var h=o.length();h>0&&(h+=2);var f=e.session.id,d=f.length+1+2+4+28+2+i+1+s+h,p=pn.util.createBuffer();return p.putByte(En.HandshakeType.client_hello),p.putInt24(d),p.putByte(e.version.major),p.putByte(e.version.minor),p.putBytes(e.session.sp.client_random),Cn(p,1,pn.util.createBuffer(f)),Cn(p,2,t),Cn(p,1,a),h>0&&Cn(p,2,o),p},En.createServerHello=function(e){var t=e.session.id,r=t.length+1+2+4+28+2+1,n=pn.util.createBuffer();return n.putByte(En.HandshakeType.server_hello),n.putInt24(r),n.putByte(e.version.major),n.putByte(e.version.minor),n.putBytes(e.session.sp.server_random),Cn(n,1,pn.util.createBuffer(t)),n.putByte(e.session.cipherSuite.id[0]),n.putByte(e.session.cipherSuite.id[1]),n.putByte(e.session.compressionMethod),n},En.createCertificate=function(e){var t,r=e.entity===En.ConnectionEnd.client,n=null;e.getCertificate&&(t=r?e.session.certificateRequest:e.session.extensions.server_name.serverNameList,n=e.getCertificate(e,t));var i=pn.util.createBuffer();if(null!==n)try{pn.util.isArray(n)||(n=[n]);for(var a=null,s=0;s<n.length;++s){var o=pn.pem.decode(n[s])[0];if("CERTIFICATE"!==o.type&&"X509 CERTIFICATE"!==o.type&&"TRUSTED CERTIFICATE"!==o.type){var u=new Error('Could not convert certificate from PEM; PEM header type is not "CERTIFICATE", "X509 CERTIFICATE", or "TRUSTED CERTIFICATE".');throw u.headerType=o.type,u}if(o.procType&&"ENCRYPTED"===o.procType.type)throw new Error("Could not convert certificate from PEM; PEM is encrypted.");var c=pn.util.createBuffer(o.body);null===a&&(a=pn.asn1.fromDer(c.bytes(),!1));var l=pn.util.createBuffer();Cn(l,3,c),i.putBuffer(l)}n=pn.pki.certificateFromAsn1(a),r?e.session.clientCertificate=n:e.session.serverCertificate=n}catch(t){return e.error(e,{message:"Could not send certificate list.",cause:t,send:!0,alert:{level:En.Alert.Level.fatal,description:En.Alert.Description.bad_certificate}})}var h=3+i.length(),f=pn.util.createBuffer();return f.putByte(En.HandshakeType.certificate),f.putInt24(h),Cn(f,3,i),f},En.createClientKeyExchange=function(e){var t=pn.util.createBuffer();t.putByte(e.session.clientHelloVersion.major),t.putByte(e.session.clientHelloVersion.minor),t.putBytes(pn.random.getBytes(46));var r=e.session.sp;r.pre_master_secret=t.getBytes();var n=(t=e.session.serverCertificate.publicKey.encrypt(r.pre_master_secret)).length+2,i=pn.util.createBuffer();return i.putByte(En.HandshakeType.client_key_exchange),i.putInt24(n),i.putInt16(t.length),i.putBytes(t),i},En.createServerKeyExchange=function(e){return pn.util.createBuffer()},En.getClientSignature=function(e,t){var r=pn.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 n=null;if(e.getPrivateKey)try{n=e.getPrivateKey(e,e.session.clientCertificate),n=pn.pki.privateKeyFromPem(n)}catch(t){e.error(e,{message:"Could not get private key.",cause:t,send:!0,alert:{level:En.Alert.Level.fatal,description:En.Alert.Description.internal_error}})}null===n?e.error(e,{message:"No private key set.",send:!0,alert:{level:En.Alert.Level.fatal,description:En.Alert.Description.internal_error}}):t=n.sign(t,null),r(e,t)},e.getSignature(e,r,t)},En.createCertificateVerify=function(e,t){var r=t.length+2,n=pn.util.createBuffer();return n.putByte(En.HandshakeType.certificate_verify),n.putInt24(r),n.putInt16(t.length),n.putBytes(t),n},En.createCertificateRequest=function(e){var t=pn.util.createBuffer();t.putByte(1);var r=pn.util.createBuffer();for(var n in e.caStore.certs){var i=e.caStore.certs[n],a=pn.pki.distinguishedNameToAsn1(i.subject),s=pn.asn1.toDer(a);r.putInt16(s.length()),r.putBuffer(s)}var o=1+t.length()+2+r.length(),u=pn.util.createBuffer();return u.putByte(En.HandshakeType.certificate_request),u.putInt24(o),Cn(u,1,t),Cn(u,2,r),u},En.createServerHelloDone=function(e){var t=pn.util.createBuffer();return t.putByte(En.HandshakeType.server_hello_done),t.putInt24(0),t},En.createChangeCipherSpec=function(){var e=pn.util.createBuffer();return e.putByte(1),e},En.createFinished=function(e){var t=pn.util.createBuffer();t.putBuffer(e.session.md5.digest()),t.putBuffer(e.session.sha1.digest());var r=e.entity===En.ConnectionEnd.client,n=e.session.sp,i=r?"client finished":"server finished";t=gn(n.master_secret,i,t.getBytes(),12);var a=pn.util.createBuffer();return a.putByte(En.HandshakeType.finished),a.putInt24(t.length()),a.putBuffer(t),a},En.createHeartbeat=function(e,t,r){void 0===r&&(r=t.length);var n=pn.util.createBuffer();n.putByte(e),n.putInt16(r),n.putBytes(t);var i=n.length(),a=Math.max(16,i-r-3);return n.putBytes(pn.random.getBytes(a)),n},En.queue=function(e,t){if(t&&(0!==t.fragment.length()||t.type!==En.ContentType.handshake&&t.type!==En.ContentType.alert&&t.type!==En.ContentType.change_cipher_spec)){if(t.type===En.ContentType.handshake){var r=t.fragment.bytes();e.session.md5.update(r),e.session.sha1.update(r),r=null}var n;if(t.fragment.length()<=En.MaxFragment)n=[t];else{n=[];for(var i=t.fragment.bytes();i.length>En.MaxFragment;)n.push(En.createRecord(e,{type:t.type,data:pn.util.createBuffer(i.slice(0,En.MaxFragment))})),i=i.slice(En.MaxFragment);i.length>0&&n.push(En.createRecord(e,{type:t.type,data:pn.util.createBuffer(i)}))}for(var a=0;a<n.length&&!e.fail;++a){var s=n[a];e.state.current.write.update(e,s)&&e.records.push(s)}}},En.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 Jn=function(e){switch(e){case!0:return!0;case pn.pki.certificateError.bad_certificate:return En.Alert.Description.bad_certificate;case pn.pki.certificateError.unsupported_certificate:return En.Alert.Description.unsupported_certificate;case pn.pki.certificateError.certificate_revoked:return En.Alert.Description.certificate_revoked;case pn.pki.certificateError.certificate_expired:return En.Alert.Description.certificate_expired;case pn.pki.certificateError.certificate_unknown:return En.Alert.Description.certificate_unknown;case pn.pki.certificateError.unknown_ca:return En.Alert.Description.unknown_ca;default:return En.Alert.Description.bad_certificate}};for(var ei in En.verifyCertificateChain=function(e,t){try{var r={};for(var n in e.verifyOptions)r[n]=e.verifyOptions[n];r.verify=function(t,r,n){Jn(t);var i=e.verify(e,t,r,n);if(!0!==i){if("object"==typeof i&&!pn.util.isArray(i)){var a=new Error("The application rejected the certificate.");throw a.send=!0,a.alert={level:En.Alert.Level.fatal,description:En.Alert.Description.bad_certificate},i.message&&(a.message=i.message),i.alert&&(a.alert.description=i.alert),a}i!==t&&(i=function(e){switch(e){case!0:return!0;case En.Alert.Description.bad_certificate:return pn.pki.certificateError.bad_certificate;case En.Alert.Description.unsupported_certificate:return pn.pki.certificateError.unsupported_certificate;case En.Alert.Description.certificate_revoked:return pn.pki.certificateError.certificate_revoked;case En.Alert.Description.certificate_expired:return pn.pki.certificateError.certificate_expired;case En.Alert.Description.certificate_unknown:return pn.pki.certificateError.certificate_unknown;case En.Alert.Description.unknown_ca:return pn.pki.certificateError.unknown_ca;default:return pn.pki.certificateError.bad_certificate}}(i))}return i},pn.pki.verifyCertificateChain(e.caStore,t,r)}catch(t){var i=t;("object"!=typeof i||pn.util.isArray(i))&&(i={send:!0,alert:{level:En.Alert.Level.fatal,description:Jn(t)}}),"send"in i||(i.send=!0),"alert"in i||(i.alert={level:En.Alert.Level.fatal,description:Jn(i.error)}),e.error(e,i)}return!e.fail},En.createSessionCache=function(e,t){var r=null;if(e&&e.getSession&&e.setSession&&e.order)r=e;else{for(var n in(r={}).cache=e||{},r.capacity=Math.max(t||100,1),r.order=[],e)r.order.length<=t?r.order.push(n):delete e[n];r.getSession=function(e){var t=null,n=null;if(e?n=pn.util.bytesToHex(e):r.order.length>0&&(n=r.order[0]),null!==n&&n in r.cache)for(var i in t=r.cache[n],delete r.cache[n],r.order)if(r.order[i]===n){r.order.splice(i,1);break}return t},r.setSession=function(e,t){if(r.order.length===r.capacity){var n=r.order.shift();delete r.cache[n]}n=pn.util.bytesToHex(e);r.order.push(n),r.cache[n]=t}}return r},En.createConnection=function(e){var t=null;t=e.caStore?pn.util.isArray(e.caStore)?pn.pki.createCaStore(e.caStore):e.caStore:pn.pki.createCaStore();var r=e.cipherSuites||null;if(null===r)for(var n in r=[],En.CipherSuites)r.push(En.CipherSuites[n]);var i=e.server?En.ConnectionEnd.server:En.ConnectionEnd.client,a=e.sessionCache?En.createSessionCache(e.sessionCache):null,s={version:{major:En.Version.major,minor:En.Version.minor},entity:i,sessionId:e.sessionId,caStore:t,sessionCache:a,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:pn.util.createBuffer(),tlsData:pn.util.createBuffer(),data:pn.util.createBuffer(),tlsDataReady:e.tlsDataReady,dataReady:e.dataReady,heartbeatReceived:e.heartbeatReceived,closed:e.closed,error:function(t,r){r.origin=r.origin||(t.entity===En.ConnectionEnd.client?"client":"server"),r.send&&(En.queue(t,En.createAlert(t,r.alert)),En.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){s.version={major:En.Version.major,minor:En.Version.minor},s.record=null,s.session=null,s.peerCertificate=null,s.state={pending:null,current:null},s.expect=(s.entity,En.ConnectionEnd.client,0),s.fragmented=null,s.records=[],s.open=!1,s.handshakes=0,s.handshaking=!1,s.isConnected=!1,s.fail=!(e||void 0===e),s.input.clear(),s.tlsData.clear(),s.data.clear(),s.state.current=En.createConnectionState(s)}};s.reset();return s.handshake=function(e){if(s.entity!==En.ConnectionEnd.client)s.error(s,{message:"Cannot initiate handshake as a server.",fatal:!1});else if(s.handshaking)s.error(s,{message:"Handshake already in progress.",fatal:!1});else{s.fail&&!s.open&&0===s.handshakes&&(s.fail=!1),s.handshaking=!0;var t=null;(e=e||"").length>0&&(s.sessionCache&&(t=s.sessionCache.getSession(e)),null===t&&(e="")),0===e.length&&s.sessionCache&&null!==(t=s.sessionCache.getSession())&&(e=t.id),s.session={id:e,version:null,cipherSuite:null,compressionMethod:null,serverCertificate:null,certificateRequest:null,clientCertificate:null,sp:{},md5:pn.md.md5.create(),sha1:pn.md.sha1.create()},t&&(s.version=t.version,s.session.sp=t.sp),s.session.sp.client_random=En.createRandom().getBytes(),s.open=!0,En.queue(s,En.createRecord(s,{type:En.ContentType.handshake,data:En.createClientHello(s)})),En.flush(s)}},s.process=function(e){var t=0;return e&&s.input.putBytes(e),s.fail||(null!==s.record&&s.record.ready&&s.record.fragment.isEmpty()&&(s.record=null),null===s.record&&(t=function(e){var t=0,r=e.input,n=r.length();if(n<5)t=5-n;else{e.record={type:r.getByte(),version:{major:r.getByte(),minor:r.getByte()},length:r.getInt16(),fragment:pn.util.createBuffer(),ready:!1};var i=e.record.version.major===e.version.major;i&&e.session&&e.session.version&&(i=e.record.version.minor===e.version.minor),i||e.error(e,{message:"Incompatible TLS version.",send:!0,alert:{level:En.Alert.Level.fatal,description:En.Alert.Description.protocol_version}})}return t}(s)),s.fail||null===s.record||s.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:En.Alert.Level.fatal,description:En.Alert.Description.unexpected_message}})),e.record.ready=!0)),t}(s)),!s.fail&&null!==s.record&&s.record.ready&&function(e,t){var r=t.type-En.ContentType.change_cipher_spec,n=Fn[e.entity][e.expect];r in n?n[r](e,t):En.handleUnexpected(e,t)}(s,s.record)),t},s.prepare=function(e){return En.queue(s,En.createRecord(s,{type:En.ContentType.application_data,data:pn.util.createBuffer(e)})),En.flush(s)},s.prepareHeartbeatRequest=function(e,t){return e instanceof pn.util.ByteBuffer&&(e=e.bytes()),void 0===t&&(t=e.length),s.expectedHeartbeatPayload=e,En.queue(s,En.createRecord(s,{type:En.ContentType.heartbeat,data:En.createHeartbeat(En.HeartbeatMessageType.heartbeat_request,e,t)})),En.flush(s)},s.close=function(e){if(!s.fail&&s.sessionCache&&s.session){var t={id:s.session.id,version:s.session.version,sp:s.session.sp};t.sp.keys=null,s.sessionCache.setSession(t.id,t)}s.open&&(s.open=!1,s.input.clear(),(s.isConnected||s.handshaking)&&(s.isConnected=s.handshaking=!1,En.queue(s,En.createAlert(s,{level:En.Alert.Level.warning,description:En.Alert.Description.close_notify})),En.flush(s)),s.closed(s)),s.reset(e)},s},pn.tls=pn.tls||{},En)"function"!=typeof En[ei]&&(pn.tls[ei]=En[ei]);pn.tls.prf_tls1=gn,pn.tls.hmac_sha1=function(e,t,r){var n=pn.hmac.create();n.start("SHA1",e);var i=pn.util.createBuffer();return i.putInt32(t[0]),i.putInt32(t[1]),i.putByte(r.type),i.putByte(r.version.major),i.putByte(r.version.minor),i.putInt16(r.length),i.putBytes(r.fragment.bytes()),n.update(i.getBytes()),n.digest().getBytes()},pn.tls.createSessionCache=En.createSessionCache,pn.tls.createConnection=En.createConnection;var ti=S,ri=ti.tls;function ni(e,t,r){var n=t.entity===ti.tls.ConnectionEnd.client;e.read.cipherState={init:!1,cipher:ti.cipher.createDecipher("AES-CBC",n?r.keys.server_write_key:r.keys.client_write_key),iv:n?r.keys.server_write_IV:r.keys.client_write_IV},e.write.cipherState={init:!1,cipher:ti.cipher.createCipher("AES-CBC",n?r.keys.client_write_key:r.keys.server_write_key),iv:n?r.keys.client_write_IV:r.keys.server_write_IV},e.read.cipherFunction=oi,e.write.cipherFunction=ii,e.read.macLength=e.write.macLength=r.mac_length,e.read.macFunction=e.write.macFunction=ri.hmac_sha1}function ii(e,t){var r,n=!1,i=t.macFunction(t.macKey,t.sequenceNumber,e);e.fragment.putBytes(i),t.updateSequenceNumber(),r=e.version.minor===ri.Versions.TLS_1_0.minor?t.cipherState.init?null:t.cipherState.iv:ti.random.getBytesSync(16),t.cipherState.init=!0;var a=t.cipherState.cipher;return a.start({iv:r}),e.version.minor>=ri.Versions.TLS_1_1.minor&&a.output.putBytes(r),a.update(e.fragment),a.finish(ai)&&(e.fragment=a.output,e.length=e.fragment.length(),n=!0),n}function ai(e,t,r){if(!r){var n=e-t.length()%e;t.fillWithByte(n-1,n)}return!0}function si(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 oi(e,t){var r,n=!1;r=e.version.minor===ri.Versions.TLS_1_0.minor?t.cipherState.init?null:t.cipherState.iv:e.fragment.getBytes(16),t.cipherState.init=!0;var i=t.cipherState.cipher;i.start({iv:r}),i.update(e.fragment),n=i.finish(si);var a=t.macLength,s=ti.random.getBytesSync(a),o=i.output.length();o>=a?(e.fragment=i.output.getBytes(o-a),s=i.output.getBytes(a)):e.fragment=i.output.getBytes(),e.fragment=ti.util.createBuffer(e.fragment),e.length=e.fragment.length();var u=t.macFunction(t.macKey,t.sequenceNumber,e);return t.updateSequenceNumber(),n=function(e,t,r){var n=ti.hmac.create();return n.start("SHA1",e),n.update(t),t=n.digest().getBytes(),n.start(null,null),n.update(r),r=n.digest().getBytes(),t===r}(t.macKey,s,u)&&n,n}ri.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=ri.BulkCipherAlgorithm.aes,e.cipher_type=ri.CipherType.block,e.enc_key_length=16,e.block_length=16,e.fixed_iv_length=16,e.record_iv_length=16,e.mac_algorithm=ri.MACAlgorithm.hmac_sha1,e.mac_length=20,e.mac_key_length=20},initConnectionState:ni},ri.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=ri.BulkCipherAlgorithm.aes,e.cipher_type=ri.CipherType.block,e.enc_key_length=32,e.block_length=16,e.fixed_iv_length=16,e.record_iv_length=16,e.mac_algorithm=ri.MACAlgorithm.hmac_sha1,e.mac_length=20,e.mac_key_length=20},initConnectionState:ni};var ui=S;ui.debug=ui.debug||{},ui.debug.storage={},ui.debug.get=function(e,t){var r;return void 0===e?r=ui.debug.storage:e in ui.debug.storage&&(r=void 0===t?ui.debug.storage[e]:ui.debug.storage[e][t]),r},ui.debug.set=function(e,t,r){e in ui.debug.storage||(ui.debug.storage[e]={}),ui.debug.storage[e][t]=r},ui.debug.clear=function(e,t){void 0===e?ui.debug.storage={}:e in ui.debug.storage&&(void 0===t?delete ui.debug.storage[e]:delete ui.debug.storage[e][t])};var ci=S,li=ci.sha512=ci.sha512||{};ci.md.sha512=ci.md.algorithms.sha512=li;var hi=ci.sha384=ci.sha512.sha384=ci.sha512.sha384||{};hi.create=function(){return li.create("SHA-384")},ci.md.sha384=ci.md.algorithms.sha384=hi,ci.sha512.sha256=ci.sha512.sha256||{create:function(){return li.create("SHA-512/256")}},ci.md["sha512/256"]=ci.md.algorithms["sha512/256"]=ci.sha512.sha256,ci.sha512.sha224=ci.sha512.sha224||{create:function(){return li.create("SHA-512/224")}},ci.md["sha512/224"]=ci.md.algorithms["sha512/224"]=ci.sha512.sha224,li.create=function(e){if(di||(fi=String.fromCharCode(128),fi+=ci.util.fillString(String.fromCharCode(0),128),pi=[[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]],(gi={})["SHA-512"]=[[1779033703,4089235720],[3144134277,2227873595],[1013904242,4271175723],[2773480762,1595750129],[1359893119,2917565137],[2600822924,725511199],[528734635,4215389547],[1541459225,327033209]],gi["SHA-384"]=[[3418070365,3238371032],[1654270250,914150663],[2438529370,812702999],[355462360,4144912697],[1731405415,4290775857],[2394180231,1750603025],[3675008525,1694076839],[1203062813,3204075428]],gi["SHA-512/256"]=[[573645204,4230739756],[2673172387,3360449730],[596883563,1867755857],[2520282905,1497426621],[2519219938,2827943907],[3193839141,1401305490],[721525244,746961066],[246885852,2177182882]],gi["SHA-512/224"]=[[2352822216,424955298],[1944164710,2312950998],[502970286,855612546],[1738396948,1479516111],[258812777,2077511080],[2011393907,79989058],[1067287976,1780299464],[286451373,2446758561]],di=!0),void 0===e&&(e="SHA-512"),!(e in gi))throw new Error("Invalid SHA-512 algorithm: "+e);for(var t=gi[e],r=null,n=ci.util.createBuffer(),i=new Array(80),a=0;a<80;++a)i[a]=new Array(2);var s=64;switch(e){case"SHA-384":s=48;break;case"SHA-512/256":s=32;break;case"SHA-512/224":s=28}var o={algorithm:e.replace("-","").toLowerCase(),blockLength:128,digestLength:s,messageLength:0,fullMessageLength:null,messageLengthSize:16,start:function(){o.messageLength=0,o.fullMessageLength=o.messageLength128=[];for(var e=o.messageLengthSize/4,i=0;i<e;++i)o.fullMessageLength.push(0);n=ci.util.createBuffer(),r=new Array(t.length);for(i=0;i<t.length;++i)r[i]=t[i].slice(0);return o}};return o.start(),o.update=function(e,t){"utf8"===t&&(e=ci.util.encodeUtf8(e));var a=e.length;o.messageLength+=a,a=[a/4294967296>>>0,a>>>0];for(var s=o.fullMessageLength.length-1;s>=0;--s)o.fullMessageLength[s]+=a[1],a[1]=a[0]+(o.fullMessageLength[s]/4294967296>>>0),o.fullMessageLength[s]=o.fullMessageLength[s]>>>0,a[0]=a[1]/4294967296>>>0;return n.putBytes(e),yi(r,i,n),(n.read>2048||0===n.length())&&n.compact(),o},o.digest=function(){var t=ci.util.createBuffer();t.putBytes(n.bytes());var a,s=o.fullMessageLength[o.fullMessageLength.length-1]+o.messageLengthSize&o.blockLength-1;t.putBytes(fi.substr(0,o.blockLength-s));for(var u=8*o.fullMessageLength[0],c=0;c<o.fullMessageLength.length-1;++c)u+=(a=8*o.fullMessageLength[c+1])/4294967296>>>0,t.putInt32(u>>>0),u=a>>>0;t.putInt32(u);var l=new Array(r.length);for(c=0;c<r.length;++c)l[c]=r[c].slice(0);yi(l,i,t);var h,f=ci.util.createBuffer();h="SHA-512"===e?l.length:"SHA-384"===e?l.length-2:l.length-4;for(c=0;c<h;++c)f.putInt32(l[c][0]),c===h-1&&"SHA-512/224"===e||f.putInt32(l[c][1]);return f},o};var fi=null,di=!1,pi=null,gi=null;function yi(e,t,r){for(var n,i,a,s,o,u,c,l,h,f,d,p,g,y,m,v,C,E,b,S,T,_,w,I,A,B,k,N,R,L,D,U,x,O=r.length();O>=128;){for(k=0;k<16;++k)t[k][0]=r.getInt32()>>>0,t[k][1]=r.getInt32()>>>0;for(;k<80;++k)n=(((N=(L=t[k-2])[0])>>>19|(R=L[1])<<13)^(R>>>29|N<<3)^N>>>6)>>>0,i=((N<<13|R>>>19)^(R<<3|N>>>29)^(N<<26|R>>>6))>>>0,a=(((N=(U=t[k-15])[0])>>>1|(R=U[1])<<31)^(N>>>8|R<<24)^N>>>7)>>>0,s=((N<<31|R>>>1)^(N<<24|R>>>8)^(N<<25|R>>>7))>>>0,D=t[k-7],x=t[k-16],R=i+D[1]+s+x[1],t[k][0]=n+D[0]+a+x[0]+(R/4294967296>>>0)>>>0,t[k][1]=R>>>0;for(d=e[0][0],p=e[0][1],g=e[1][0],y=e[1][1],m=e[2][0],v=e[2][1],C=e[3][0],E=e[3][1],b=e[4][0],S=e[4][1],T=e[5][0],_=e[5][1],w=e[6][0],I=e[6][1],A=e[7][0],B=e[7][1],k=0;k<80;++k)c=((b>>>14|S<<18)^(b>>>18|S<<14)^(S>>>9|b<<23))>>>0,l=(w^b&(T^w))>>>0,o=((d>>>28|p<<4)^(p>>>2|d<<30)^(p>>>7|d<<25))>>>0,u=((d<<4|p>>>28)^(p<<30|d>>>2)^(p<<25|d>>>7))>>>0,h=(d&g|m&(d^g))>>>0,f=(p&y|v&(p^y))>>>0,R=B+(((b<<18|S>>>14)^(b<<14|S>>>18)^(S<<23|b>>>9))>>>0)+((I^S&(_^I))>>>0)+pi[k][1]+t[k][1],n=A+c+l+pi[k][0]+t[k][0]+(R/4294967296>>>0)>>>0,i=R>>>0,a=o+h+((R=u+f)/4294967296>>>0)>>>0,s=R>>>0,A=w,B=I,w=T,I=_,T=b,_=S,b=C+n+((R=E+i)/4294967296>>>0)>>>0,S=R>>>0,C=m,E=v,m=g,v=y,g=d,y=p,d=n+a+((R=i+s)/4294967296>>>0)>>>0,p=R>>>0;R=e[0][1]+p,e[0][0]=e[0][0]+d+(R/4294967296>>>0)>>>0,e[0][1]=R>>>0,R=e[1][1]+y,e[1][0]=e[1][0]+g+(R/4294967296>>>0)>>>0,e[1][1]=R>>>0,R=e[2][1]+v,e[2][0]=e[2][0]+m+(R/4294967296>>>0)>>>0,e[2][1]=R>>>0,R=e[3][1]+E,e[3][0]=e[3][0]+C+(R/4294967296>>>0)>>>0,e[3][1]=R>>>0,R=e[4][1]+S,e[4][0]=e[4][0]+b+(R/4294967296>>>0)>>>0,e[4][1]=R>>>0,R=e[5][1]+_,e[5][0]=e[5][0]+T+(R/4294967296>>>0)>>>0,e[5][1]=R>>>0,R=e[6][1]+I,e[6][0]=e[6][0]+w+(R/4294967296>>>0)>>>0,e[6][1]=R>>>0,R=e[7][1]+B,e[7][0]=e[7][0]+A+(R/4294967296>>>0)>>>0,e[7][1]=R>>>0,O-=128}}var mi={},vi=S.asn1;mi.privateKeyValidator={name:"PrivateKeyInfo",tagClass:vi.Class.UNIVERSAL,type:vi.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:vi.Class.UNIVERSAL,type:vi.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:vi.Class.UNIVERSAL,type:vi.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:vi.Class.UNIVERSAL,type:vi.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:vi.Class.UNIVERSAL,type:vi.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},mi.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:vi.Class.UNIVERSAL,type:vi.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:vi.Class.UNIVERSAL,type:vi.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:vi.Class.UNIVERSAL,type:vi.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{tagClass:vi.Class.UNIVERSAL,type:vi.Type.BITSTRING,constructed:!1,composed:!0,captureBitStringValue:"ed25519PublicKey"}]};var Ci=S,Ei=mi,bi=Ei.publicKeyValidator,Si=Ei.privateKeyValidator;if(void 0===Ti)var Ti=Ci.jsbn.BigInteger;var _i=Ci.util.ByteBuffer,wi="undefined"==typeof Buffer?Uint8Array:Buffer;Ci.pki=Ci.pki||{},Ci.pki.ed25519=Ci.ed25519=Ci.ed25519||{};var Ii=Ci.ed25519;function Ai(e){var t=e.message;if(t instanceof Uint8Array||t instanceof wi)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("undefined"!=typeof Buffer)return Buffer.from(t,r);t=new _i(t,r)}else if(!(t instanceof _i))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 n=new wi(t.length()),i=0;i<n.length;++i)n[i]=t.at(i);return n}Ii.constants={},Ii.constants.PUBLIC_KEY_BYTE_LENGTH=32,Ii.constants.PRIVATE_KEY_BYTE_LENGTH=64,Ii.constants.SEED_BYTE_LENGTH=32,Ii.constants.SIGN_BYTE_LENGTH=64,Ii.constants.HASH_BYTE_LENGTH=64,Ii.generateKeyPair=function(e){var t=(e=e||{}).seed;if(void 0===t)t=Ci.random.getBytesSync(Ii.constants.SEED_BYTE_LENGTH);else if("string"==typeof t){if(t.length!==Ii.constants.SEED_BYTE_LENGTH)throw new TypeError('"seed" must be '+Ii.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=Ai({message:t,encoding:"binary"});for(var r=new wi(Ii.constants.PUBLIC_KEY_BYTE_LENGTH),n=new wi(Ii.constants.PRIVATE_KEY_BYTE_LENGTH),i=0;i<32;++i)n[i]=t[i];return function(e,t){var r,n=[Xi(),Xi(),Xi(),Xi()],i=Oi(t,32);for(i[0]&=248,i[31]&=127,i[31]|=64,Wi(n,i),Fi(e,n),r=0;r<32;++r)t[r+32]=e[r]}(r,n),{publicKey:r,privateKey:n}},Ii.privateKeyFromAsn1=function(e){var t={},r=[];if(!Ci.asn1.validate(e,Si,t,r)){var n=new Error("Invalid Key.");throw n.errors=r,n}var i=Ci.asn1.derToOid(t.privateKeyOid),a=Ci.oids.EdDSA25519;if(i!==a)throw new Error('Invalid OID "'+i+'"; OID must be "'+a+'".');var s=t.privateKey;return{privateKeyBytes:Ai({message:Ci.asn1.fromDer(s).value,encoding:"binary"})}},Ii.publicKeyFromAsn1=function(e){var t={},r=[];if(!Ci.asn1.validate(e,bi,t,r)){var n=new Error("Invalid Key.");throw n.errors=r,n}var i=Ci.asn1.derToOid(t.publicKeyOid),a=Ci.oids.EdDSA25519;if(i!==a)throw new Error('Invalid OID "'+i+'"; OID must be "'+a+'".');var s=t.ed25519PublicKey;if(s.length!==Ii.constants.PUBLIC_KEY_BYTE_LENGTH)throw new Error("Key length is invalid.");return Ai({message:s,encoding:"binary"})},Ii.publicKeyFromPrivateKey=function(e){var t=Ai({message:(e=e||{}).privateKey,encoding:"binary"});if(t.length!==Ii.constants.PRIVATE_KEY_BYTE_LENGTH)throw new TypeError('"options.privateKey" must have a byte length of '+Ii.constants.PRIVATE_KEY_BYTE_LENGTH);for(var r=new wi(Ii.constants.PUBLIC_KEY_BYTE_LENGTH),n=0;n<r.length;++n)r[n]=t[32+n];return r},Ii.sign=function(e){var t=Ai(e=e||{}),r=Ai({message:e.privateKey,encoding:"binary"});if(r.length===Ii.constants.SEED_BYTE_LENGTH)r=Ii.generateKeyPair({seed:r}).privateKey;else if(r.length!==Ii.constants.PRIVATE_KEY_BYTE_LENGTH)throw new TypeError('"options.privateKey" must have a byte length of '+Ii.constants.SEED_BYTE_LENGTH+" or "+Ii.constants.PRIVATE_KEY_BYTE_LENGTH);var n=new wi(Ii.constants.SIGN_BYTE_LENGTH+t.length);!function(e,t,r,n){var i,a,s=new Float64Array(64),o=[Xi(),Xi(),Xi(),Xi()],u=Oi(n,32);u[0]&=248,u[31]&=127,u[31]|=64;var c=r+64;for(i=0;i<r;++i)e[64+i]=t[i];for(i=0;i<32;++i)e[32+i]=u[32+i];var l=Oi(e.subarray(32),r+32);for(Vi(l),Wi(o,l),Fi(e,o),i=32;i<64;++i)e[i]=n[i];var h=Oi(e,r+64);for(Vi(h),i=32;i<64;++i)s[i]=0;for(i=0;i<32;++i)s[i]=l[i];for(i=0;i<32;++i)for(a=0;a<32;a++)s[i+a]+=h[i]*u[a];Pi(e.subarray(32),s)}(n,t,t.length,r);for(var i=new wi(Ii.constants.SIGN_BYTE_LENGTH),a=0;a<i.length;++a)i[a]=n[a];return i},Ii.verify=function(e){var t=Ai(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=Ai({message:e.signature,encoding:"binary"});if(r.length!==Ii.constants.SIGN_BYTE_LENGTH)throw new TypeError('"options.signature" must have a byte length of '+Ii.constants.SIGN_BYTE_LENGTH);var n=Ai({message:e.publicKey,encoding:"binary"});if(n.length!==Ii.constants.PUBLIC_KEY_BYTE_LENGTH)throw new TypeError('"options.publicKey" must have a byte length of '+Ii.constants.PUBLIC_KEY_BYTE_LENGTH);var i,a=new wi(Ii.constants.SIGN_BYTE_LENGTH+t.length),s=new wi(Ii.constants.SIGN_BYTE_LENGTH+t.length);for(i=0;i<Ii.constants.SIGN_BYTE_LENGTH;++i)a[i]=r[i];for(i=0;i<t.length;++i)a[i+Ii.constants.SIGN_BYTE_LENGTH]=t[i];return function(e,t,r,n){var i,a=new wi(32),s=[Xi(),Xi(),Xi(),Xi()],o=[Xi(),Xi(),Xi(),Xi()];if(-1,r<64)return-1;if(function(e,t){var r=Xi(),n=Xi(),i=Xi(),a=Xi(),s=Xi(),o=Xi(),u=Xi();Qi(e[2],ki),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),ea(i,e[1]),ta(a,i,Ni),Ji(i,i,e[2]),$i(a,e[2],a),ea(s,a),ea(o,s),ta(u,o,s),ta(r,u,i),ta(r,r,a),function(e,t){var r,n=Xi();for(r=0;r<16;++r)n[r]=t[r];for(r=250;r>=0;--r)ea(n,n),1!==r&&ta(n,n,t);for(r=0;r<16;++r)e[r]=n[r]}(r,r),ta(r,r,i),ta(r,r,a),ta(r,r,a),ta(e[0],r,a),ea(n,e[0]),ta(n,n,a),ji(n,i)&&ta(e[0],e[0],xi);if(ea(n,e[0]),ta(n,n,a),ji(n,i))return-1;Hi(e[0])===t[31]>>7&&Ji(e[0],Bi,e[0]);return ta(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 u=Oi(e,r);if(Vi(u),Gi(s,o,u),Wi(o,t.subarray(32)),Ki(s,o),Fi(a,s),r-=64,qi(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 Bi=Xi(),ki=Xi([1]),Ni=Xi([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),Ri=Xi([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),Li=Xi([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),Di=Xi([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),Ui=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]),xi=Xi([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function Oi(e,t){var r=Ci.md.sha512.create(),n=new _i(e);r.update(n.getBytes(t),"binary");var i=r.digest().getBytes();if("undefined"!=typeof Buffer)return Buffer.from(i,"binary");for(var a=new wi(Ii.constants.HASH_BYTE_LENGTH),s=0;s<64;++s)a[s]=i.charCodeAt(s);return a}function Pi(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]*Ui[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)*Ui[i],r=t[i]>>8,t[i]&=255;for(i=0;i<32;++i)t[i]-=r*Ui[i];for(n=0;n<32;++n)t[n+1]+=t[n]>>8,e[n]=255&t[n]}function Vi(e){for(var t=new Float64Array(64),r=0;r<64;++r)t[r]=e[r],e[r]=0;Pi(e,t)}function Ki(e,t){var r=Xi(),n=Xi(),i=Xi(),a=Xi(),s=Xi(),o=Xi(),u=Xi(),c=Xi(),l=Xi();Ji(r,e[1],e[0]),Ji(l,t[1],t[0]),ta(r,r,l),$i(n,e[0],e[1]),$i(l,t[0],t[1]),ta(n,n,l),ta(i,e[3],t[3]),ta(i,i,Ri),ta(a,e[2],t[2]),$i(a,a,a),Ji(s,n,r),Ji(o,a,i),$i(u,a,i),$i(c,n,r),ta(e[0],s,o),ta(e[1],c,u),ta(e[2],u,o),ta(e[3],s,c)}function Mi(e,t,r){for(var n=0;n<4;++n)Zi(e[n],t[n],r)}function Fi(e,t){var r=Xi(),n=Xi(),i=Xi();!function(e,t){var r,n=Xi();for(r=0;r<16;++r)n[r]=t[r];for(r=253;r>=0;--r)ea(n,n),2!==r&&4!==r&&ta(n,n,t);for(r=0;r<16;++r)e[r]=n[r]}(i,t[2]),ta(r,t[0],i),ta(n,t[1],i),zi(e,n),e[31]^=Hi(r)<<7}function zi(e,t){var r,n,i,a=Xi(),s=Xi();for(r=0;r<16;++r)s[r]=t[r];for(Yi(s),Yi(s),Yi(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,Zi(s,a,1-i)}for(r=0;r<16;r++)e[2*r]=255&s[r],e[2*r+1]=s[r]>>8}function ji(e,t){var r=new wi(32),n=new wi(32);return zi(r,e),zi(n,t),qi(r,0,n,0)}function qi(e,t,r,n){return function(e,t,r,n,i){var a,s=0;for(a=0;a<i;++a)s|=e[t+a]^r[n+a];return(1&s-1>>>8)-1}(e,t,r,n,32)}function Hi(e){var t=new wi(32);return zi(t,e),1&t[0]}function Gi(e,t,r){var n,i;for(Qi(e[0],Bi),Qi(e[1],ki),Qi(e[2],ki),Qi(e[3],Bi),i=255;i>=0;--i)Mi(e,t,n=r[i/8|0]>>(7&i)&1),Ki(t,e),Ki(e,e),Mi(e,t,n)}function Wi(e,t){var r=[Xi(),Xi(),Xi(),Xi()];Qi(r[0],Li),Qi(r[1],Di),Qi(r[2],ki),ta(r[3],Li,Di),Gi(e,r,t)}function Qi(e,t){var r;for(r=0;r<16;r++)e[r]=0|t[r]}function Yi(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 Zi(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 Xi(e){var t,r=new Float64Array(16);if(e)for(t=0;t<e.length;++t)r[t]=e[t];return r}function $i(e,t,r){for(var n=0;n<16;++n)e[n]=t[n]+r[n]}function Ji(e,t,r){for(var n=0;n<16;++n)e[n]=t[n]-r[n]}function ea(e,t){ta(e,t,t)}function ta(e,t,r){var n,i,a=0,s=0,o=0,u=0,c=0,l=0,h=0,f=0,d=0,p=0,g=0,y=0,m=0,v=0,C=0,E=0,b=0,S=0,T=0,_=0,w=0,I=0,A=0,B=0,k=0,N=0,R=0,L=0,D=0,U=0,x=0,O=r[0],P=r[1],V=r[2],K=r[3],M=r[4],F=r[5],z=r[6],j=r[7],q=r[8],H=r[9],G=r[10],W=r[11],Q=r[12],Y=r[13],Z=r[14],X=r[15];a+=(n=t[0])*O,s+=n*P,o+=n*V,u+=n*K,c+=n*M,l+=n*F,h+=n*z,f+=n*j,d+=n*q,p+=n*H,g+=n*G,y+=n*W,m+=n*Q,v+=n*Y,C+=n*Z,E+=n*X,s+=(n=t[1])*O,o+=n*P,u+=n*V,c+=n*K,l+=n*M,h+=n*F,f+=n*z,d+=n*j,p+=n*q,g+=n*H,y+=n*G,m+=n*W,v+=n*Q,C+=n*Y,E+=n*Z,b+=n*X,o+=(n=t[2])*O,u+=n*P,c+=n*V,l+=n*K,h+=n*M,f+=n*F,d+=n*z,p+=n*j,g+=n*q,y+=n*H,m+=n*G,v+=n*W,C+=n*Q,E+=n*Y,b+=n*Z,S+=n*X,u+=(n=t[3])*O,c+=n*P,l+=n*V,h+=n*K,f+=n*M,d+=n*F,p+=n*z,g+=n*j,y+=n*q,m+=n*H,v+=n*G,C+=n*W,E+=n*Q,b+=n*Y,S+=n*Z,T+=n*X,c+=(n=t[4])*O,l+=n*P,h+=n*V,f+=n*K,d+=n*M,p+=n*F,g+=n*z,y+=n*j,m+=n*q,v+=n*H,C+=n*G,E+=n*W,b+=n*Q,S+=n*Y,T+=n*Z,_+=n*X,l+=(n=t[5])*O,h+=n*P,f+=n*V,d+=n*K,p+=n*M,g+=n*F,y+=n*z,m+=n*j,v+=n*q,C+=n*H,E+=n*G,b+=n*W,S+=n*Q,T+=n*Y,_+=n*Z,w+=n*X,h+=(n=t[6])*O,f+=n*P,d+=n*V,p+=n*K,g+=n*M,y+=n*F,m+=n*z,v+=n*j,C+=n*q,E+=n*H,b+=n*G,S+=n*W,T+=n*Q,_+=n*Y,w+=n*Z,I+=n*X,f+=(n=t[7])*O,d+=n*P,p+=n*V,g+=n*K,y+=n*M,m+=n*F,v+=n*z,C+=n*j,E+=n*q,b+=n*H,S+=n*G,T+=n*W,_+=n*Q,w+=n*Y,I+=n*Z,A+=n*X,d+=(n=t[8])*O,p+=n*P,g+=n*V,y+=n*K,m+=n*M,v+=n*F,C+=n*z,E+=n*j,b+=n*q,S+=n*H,T+=n*G,_+=n*W,w+=n*Q,I+=n*Y,A+=n*Z,B+=n*X,p+=(n=t[9])*O,g+=n*P,y+=n*V,m+=n*K,v+=n*M,C+=n*F,E+=n*z,b+=n*j,S+=n*q,T+=n*H,_+=n*G,w+=n*W,I+=n*Q,A+=n*Y,B+=n*Z,k+=n*X,g+=(n=t[10])*O,y+=n*P,m+=n*V,v+=n*K,C+=n*M,E+=n*F,b+=n*z,S+=n*j,T+=n*q,_+=n*H,w+=n*G,I+=n*W,A+=n*Q,B+=n*Y,k+=n*Z,N+=n*X,y+=(n=t[11])*O,m+=n*P,v+=n*V,C+=n*K,E+=n*M,b+=n*F,S+=n*z,T+=n*j,_+=n*q,w+=n*H,I+=n*G,A+=n*W,B+=n*Q,k+=n*Y,N+=n*Z,R+=n*X,m+=(n=t[12])*O,v+=n*P,C+=n*V,E+=n*K,b+=n*M,S+=n*F,T+=n*z,_+=n*j,w+=n*q,I+=n*H,A+=n*G,B+=n*W,k+=n*Q,N+=n*Y,R+=n*Z,L+=n*X,v+=(n=t[13])*O,C+=n*P,E+=n*V,b+=n*K,S+=n*M,T+=n*F,_+=n*z,w+=n*j,I+=n*q,A+=n*H,B+=n*G,k+=n*W,N+=n*Q,R+=n*Y,L+=n*Z,D+=n*X,C+=(n=t[14])*O,E+=n*P,b+=n*V,S+=n*K,T+=n*M,_+=n*F,w+=n*z,I+=n*j,A+=n*q,B+=n*H,k+=n*G,N+=n*W,R+=n*Q,L+=n*Y,D+=n*Z,U+=n*X,E+=(n=t[15])*O,s+=38*(S+=n*V),o+=38*(T+=n*K),u+=38*(_+=n*M),c+=38*(w+=n*F),l+=38*(I+=n*z),h+=38*(A+=n*j),f+=38*(B+=n*q),d+=38*(k+=n*H),p+=38*(N+=n*G),g+=38*(R+=n*W),y+=38*(L+=n*Q),m+=38*(D+=n*Y),v+=38*(U+=n*Z),C+=38*(x+=n*X),a=(n=(a+=38*(b+=n*P))+(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)),u=(n=u+i+65535)-65536*(i=Math.floor(n/65536)),c=(n=c+i+65535)-65536*(i=Math.floor(n/65536)),l=(n=l+i+65535)-65536*(i=Math.floor(n/65536)),h=(n=h+i+65535)-65536*(i=Math.floor(n/65536)),f=(n=f+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)),m=(n=m+i+65535)-65536*(i=Math.floor(n/65536)),v=(n=v+i+65535)-65536*(i=Math.floor(n/65536)),C=(n=C+i+65535)-65536*(i=Math.floor(n/65536)),E=(n=E+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)),u=(n=u+i+65535)-65536*(i=Math.floor(n/65536)),c=(n=c+i+65535)-65536*(i=Math.floor(n/65536)),l=(n=l+i+65535)-65536*(i=Math.floor(n/65536)),h=(n=h+i+65535)-65536*(i=Math.floor(n/65536)),f=(n=f+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)),m=(n=m+i+65535)-65536*(i=Math.floor(n/65536)),v=(n=v+i+65535)-65536*(i=Math.floor(n/65536)),C=(n=C+i+65535)-65536*(i=Math.floor(n/65536)),E=(n=E+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]=u,e[4]=c,e[5]=l,e[6]=h,e[7]=f,e[8]=d,e[9]=p,e[10]=g,e[11]=y,e[12]=m,e[13]=v,e[14]=C,e[15]=E}var ra=S;ra.kem=ra.kem||{};var na=ra.jsbn.BigInteger;function ia(e,t,r,n){e.generate=function(e,i){for(var a=new ra.util.ByteBuffer,s=Math.ceil(i/n)+r,o=new ra.util.ByteBuffer,u=r;u<s;++u){o.putInt32(u),t.start(),t.update(e+o.getBytes());var c=t.digest();a.putBytes(c.getBytes(n))}return a.truncate(a.length()-i),a.getBytes()}}ra.kem.rsa={},ra.kem.rsa.create=function(e,t){var r=(t=t||{}).prng||ra.random,n={encrypt:function(t,n){var i,a=Math.ceil(t.n.bitLength()/8);do{i=new na(ra.util.bytesToHex(r.getBytesSync(a)),16).mod(t.n)}while(i.compareTo(na.ONE)<=0);var s=a-(i=ra.util.hexToBytes(i.toString(16))).length;return s>0&&(i=ra.util.fillString(String.fromCharCode(0),s)+i),{encapsulation:t.encrypt(i,"NONE"),key:e.generate(i,n)}},decrypt:function(t,r,n){var i=t.decrypt(r,"NONE");return e.generate(i,n)}};return n},ra.kem.kdf1=function(e,t){ia(this,e,0,t||e.digestLength)},ra.kem.kdf2=function(e,t){ia(this,e,1,t||e.digestLength)};var aa=S;aa.log=aa.log||{},aa.log.levels=["none","error","warning","info","debug","verbose","max"];var sa={},oa=[],ua=null;aa.log.LEVEL_LOCKED=2,aa.log.NO_LEVEL_CHECK=4,aa.log.INTERPOLATE=8;for(var ca=0;ca<aa.log.levels.length;++ca){var la=aa.log.levels[ca];sa[la]={index:ca,name:la.toUpperCase()}}aa.log.logMessage=function(e){for(var t=sa[e.level].index,r=0;r<oa.length;++r){var n=oa[r];if(n.flags&aa.log.NO_LEVEL_CHECK)n.f(e);else t<=sa[n.level].index&&n.f(n,e)}},aa.log.prepareStandard=function(e){"standard"in e||(e.standard=sa[e.level].name+" ["+e.category+"] "+e.message)},aa.log.prepareFull=function(e){if(!("full"in e)){var t=[e.message];t=t.concat([]||e.arguments),e.full=aa.util.format.apply(this,t)}},aa.log.prepareStandardFull=function(e){"standardFull"in e||(aa.log.prepareStandard(e),e.standardFull=e.standard)};var ha=["error","warning","info","debug","verbose"];for(ca=0;ca<ha.length;++ca)!function(e){aa.log[e]=function(t,r){var n=Array.prototype.slice.call(arguments).slice(2),i={timestamp:new Date,level:e,category:t,message:r,arguments:n};aa.log.logMessage(i)}}(ha[ca]);if(aa.log.makeLogger=function(e){var t={flags:0,f:e};return aa.log.setLevel(t,"none"),t},aa.log.setLevel=function(e,t){var r=!1;if(e&&!(e.flags&aa.log.LEVEL_LOCKED))for(var n=0;n<aa.log.levels.length;++n){if(t==aa.log.levels[n]){e.level=t,r=!0;break}}return r},aa.log.lock=function(e,t){void 0===t||t?e.flags|=aa.log.LEVEL_LOCKED:e.flags&=~aa.log.LEVEL_LOCKED},aa.log.addLogger=function(e){oa.push(e)},"undefined"!=typeof console&&"log"in console){var fa;if(console.error&&console.warn&&console.info&&console.debug){var da={error:console.error,warning:console.warn,info:console.info,debug:console.debug,verbose:console.debug},pa=function(e,t){aa.log.prepareStandard(t);var r=da[t.level],n=[t.standard];n=n.concat(t.arguments.slice()),r.apply(console,n)};fa=aa.log.makeLogger(pa)}else{pa=function(e,t){aa.log.prepareStandardFull(t),console.log(t.standardFull)};fa=aa.log.makeLogger(pa)}aa.log.setLevel(fa,"debug"),aa.log.addLogger(fa),ua=fa}else console={log:function(){}};if(null!==ua){var ga=aa.util.getQueryVariables();if("console.level"in ga&&aa.log.setLevel(ua,ga["console.level"].slice(-1)[0]),"console.lock"in ga)"true"==ga["console.lock"].slice(-1)[0]&&aa.log.lock(ua)}aa.log.consoleLogger=ua;var ya={};({get exports(){return ya},set exports(e){ya=e}}).exports=ve;var ma=S,va=ma.asn1,Ca=ma.pkcs7=ma.pkcs7||{};function Ea(e){var t={},r=[];if(!va.validate(e,Ca.asn1.recipientInfoValidator,t,r)){var n=new Error("Cannot read PKCS#7 RecipientInfo. ASN.1 object is not an PKCS#7 RecipientInfo.");throw n.errors=r,n}return{version:t.version.charCodeAt(0),issuer:ma.pki.RDNAttributesAsArray(t.issuer),serialNumber:ma.util.createBuffer(t.serial).toHex(),encryptedContent:{algorithm:va.derToOid(t.encAlgorithm),parameter:t.encParameter.value,content:t.encKey}}}function ba(e){for(var t,r=[],n=0;n<e.length;++n)r.push((t=e[n],va.create(va.Class.UNIVERSAL,va.Type.SEQUENCE,!0,[va.create(va.Class.UNIVERSAL,va.Type.INTEGER,!1,va.integerToDer(t.version).getBytes()),va.create(va.Class.UNIVERSAL,va.Type.SEQUENCE,!0,[ma.pki.distinguishedNameToAsn1({attributes:t.issuer}),va.create(va.Class.UNIVERSAL,va.Type.INTEGER,!1,ma.util.hexToBytes(t.serialNumber))]),va.create(va.Class.UNIVERSAL,va.Type.SEQUENCE,!0,[va.create(va.Class.UNIVERSAL,va.Type.OID,!1,va.oidToDer(t.encryptedContent.algorithm).getBytes()),va.create(va.Class.UNIVERSAL,va.Type.NULL,!1,"")]),va.create(va.Class.UNIVERSAL,va.Type.OCTETSTRING,!1,t.encryptedContent.content)])));return r}function Sa(e){var t=va.create(va.Class.UNIVERSAL,va.Type.SEQUENCE,!0,[va.create(va.Class.UNIVERSAL,va.Type.INTEGER,!1,va.integerToDer(e.version).getBytes()),va.create(va.Class.UNIVERSAL,va.Type.SEQUENCE,!0,[ma.pki.distinguishedNameToAsn1({attributes:e.issuer}),va.create(va.Class.UNIVERSAL,va.Type.INTEGER,!1,ma.util.hexToBytes(e.serialNumber))]),va.create(va.Class.UNIVERSAL,va.Type.SEQUENCE,!0,[va.create(va.Class.UNIVERSAL,va.Type.OID,!1,va.oidToDer(e.digestAlgorithm).getBytes()),va.create(va.Class.UNIVERSAL,va.Type.NULL,!1,"")])]);if(e.authenticatedAttributesAsn1&&t.value.push(e.authenticatedAttributesAsn1),t.value.push(va.create(va.Class.UNIVERSAL,va.Type.SEQUENCE,!0,[va.create(va.Class.UNIVERSAL,va.Type.OID,!1,va.oidToDer(e.signatureAlgorithm).getBytes()),va.create(va.Class.UNIVERSAL,va.Type.NULL,!1,"")])),t.value.push(va.create(va.Class.UNIVERSAL,va.Type.OCTETSTRING,!1,e.signature)),e.unauthenticatedAttributes.length>0){for(var r=va.create(va.Class.CONTEXT_SPECIFIC,1,!0,[]),n=0;n<e.unauthenticatedAttributes.length;++n){var i=e.unauthenticatedAttributes[n];r.values.push(Ta(i))}t.value.push(r)}return t}function Ta(e){var t;if(e.type===ma.pki.oids.contentType)t=va.create(va.Class.UNIVERSAL,va.Type.OID,!1,va.oidToDer(e.value).getBytes());else if(e.type===ma.pki.oids.messageDigest)t=va.create(va.Class.UNIVERSAL,va.Type.OCTETSTRING,!1,e.value.bytes());else if(e.type===ma.pki.oids.signingTime){var r=new Date("1950-01-01T00:00:00Z"),n=new Date("2050-01-01T00:00:00Z"),i=e.value;if("string"==typeof i){var a=Date.parse(i);i=isNaN(a)?13===i.length?va.utcTimeToDate(i):va.generalizedTimeToDate(i):new Date(a)}t=i>=r&&i<n?va.create(va.Class.UNIVERSAL,va.Type.UTCTIME,!1,va.dateToUtcTime(i)):va.create(va.Class.UNIVERSAL,va.Type.GENERALIZEDTIME,!1,va.dateToGeneralizedTime(i))}return va.create(va.Class.UNIVERSAL,va.Type.SEQUENCE,!0,[va.create(va.Class.UNIVERSAL,va.Type.OID,!1,va.oidToDer(e.type).getBytes()),va.create(va.Class.UNIVERSAL,va.Type.SET,!0,[t])])}function _a(e,t,r){var n={};if(!va.validate(t,r,n,[])){var i=new Error("Cannot read PKCS#7 message. ASN.1 object is not a supported PKCS#7 message.");throw i.errors=i,i}if(va.derToOid(n.contentType)!==ma.pki.oids.data)throw new Error("Unsupported PKCS#7 message. Only wrapped ContentType Data supported.");if(n.encryptedContent){var a="";if(ma.util.isArray(n.encryptedContent))for(var s=0;s<n.encryptedContent.length;++s){if(n.encryptedContent[s].type!==va.Type.OCTETSTRING)throw new Error("Malformed PKCS#7 message, expecting encrypted content constructed of only OCTET STRING objects.");a+=n.encryptedContent[s].value}else a=n.encryptedContent;e.encryptedContent={algorithm:va.derToOid(n.encAlgorithm),parameter:ma.util.createBuffer(n.encParameter.value),content:ma.util.createBuffer(a)}}if(n.content){a="";if(ma.util.isArray(n.content))for(s=0;s<n.content.length;++s){if(n.content[s].type!==va.Type.OCTETSTRING)throw new Error("Malformed PKCS#7 message, expecting content constructed of only OCTET STRING objects.");a+=n.content[s].value}else a=n.content;e.content=ma.util.createBuffer(a)}return e.version=n.version.charCodeAt(0),e.rawCapture=n,n}function wa(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 ma.pki.oids["aes128-CBC"]:case ma.pki.oids["aes192-CBC"]:case ma.pki.oids["aes256-CBC"]:t=ma.aes.createDecryptionCipher(e.encryptedContent.key);break;case ma.pki.oids.desCBC:case ma.pki.oids["des-EDE3-CBC"]:t=ma.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}}Ca.messageFromPem=function(e){var t=ma.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 n=va.fromDer(t.body);return Ca.messageFromAsn1(n)},Ca.messageToPem=function(e,t){var r={type:"PKCS7",body:va.toDer(e.toAsn1()).getBytes()};return ma.pem.encode(r,{maxline:t})},Ca.messageFromAsn1=function(e){var t={},r=[];if(!va.validate(e,Ca.asn1.contentInfoValidator,t,r)){var n=new Error("Cannot read PKCS#7 message. ASN.1 object is not an PKCS#7 ContentInfo.");throw n.errors=r,n}var i,a=va.derToOid(t.contentType);switch(a){case ma.pki.oids.envelopedData:i=Ca.createEnvelopedData();break;case ma.pki.oids.encryptedData:i=Ca.createEncryptedData();break;case ma.pki.oids.signedData:i=Ca.createSignedData();break;default:throw new Error("Cannot read PKCS#7 message. ContentType with OID "+a+" is not (yet) supported.")}return i.fromAsn1(t.content.value[0]),i},Ca.createSignedData=function(){var e=null;return e={type:ma.pki.oids.signedData,version:1,certificates:[],crls:[],signers:[],digestAlgorithmIdentifiers:[],contentInfo:null,signerInfos:[],fromAsn1:function(t){if(_a(e,t,Ca.asn1.signedDataValidator),e.certificates=[],e.crls=[],e.digestAlgorithmIdentifiers=[],e.contentInfo=null,e.signerInfos=[],e.rawCapture.certificates)for(var r=e.rawCapture.certificates.value,n=0;n<r.length;++n)e.certificates.push(ma.pki.certificateFromAsn1(r[n]))},toAsn1:function(){e.contentInfo||e.sign();for(var t=[],r=0;r<e.certificates.length;++r)t.push(ma.pki.certificateToAsn1(e.certificates[r]));var n=[],i=va.create(va.Class.CONTEXT_SPECIFIC,0,!0,[va.create(va.Class.UNIVERSAL,va.Type.SEQUENCE,!0,[va.create(va.Class.UNIVERSAL,va.Type.INTEGER,!1,va.integerToDer(e.version).getBytes()),va.create(va.Class.UNIVERSAL,va.Type.SET,!0,e.digestAlgorithmIdentifiers),e.contentInfo])]);return t.length>0&&i.value[0].value.push(va.create(va.Class.CONTEXT_SPECIFIC,0,!0,t)),n.length>0&&i.value[0].value.push(va.create(va.Class.CONTEXT_SPECIFIC,1,!0,n)),i.value[0].value.push(va.create(va.Class.UNIVERSAL,va.Type.SET,!0,e.signerInfos)),va.create(va.Class.UNIVERSAL,va.Type.SEQUENCE,!0,[va.create(va.Class.UNIVERSAL,va.Type.OID,!1,va.oidToDer(e.type).getBytes()),i])},addSigner:function(t){var r=t.issuer,n=t.serialNumber;if(t.certificate){var i=t.certificate;"string"==typeof i&&(i=ma.pki.certificateFromPem(i)),r=i.issuer.attributes,n=i.serialNumber}var a=t.key;if(!a)throw new Error("Could not add PKCS#7 signer; no private key specified.");"string"==typeof a&&(a=ma.pki.privateKeyFromPem(a));var s=t.digestAlgorithm||ma.pki.oids.sha1;switch(s){case ma.pki.oids.sha1:case ma.pki.oids.sha256:case ma.pki.oids.sha384:case ma.pki.oids.sha512:case ma.pki.oids.md5:break;default:throw new Error("Could not add PKCS#7 signer; unknown message digest algorithm: "+s)}var o=t.authenticatedAttributes||[];if(o.length>0){for(var u=!1,c=!1,l=0;l<o.length;++l){var h=o[l];if(u||h.type!==ma.pki.oids.contentType){if(c||h.type!==ma.pki.oids.messageDigest);else if(c=!0,u)break}else if(u=!0,c)break}if(!u||!c)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:a,version:1,issuer:r,serialNumber:n,digestAlgorithm:s,signatureAlgorithm:ma.pki.oids.rsaEncryption,signature:null,authenticatedAttributes:o,unauthenticatedAttributes:[]})},sign:function(t){var r;(t=t||{},"object"!=typeof e.content||null===e.contentInfo)&&(e.contentInfo=va.create(va.Class.UNIVERSAL,va.Type.SEQUENCE,!0,[va.create(va.Class.UNIVERSAL,va.Type.OID,!1,va.oidToDer(ma.pki.oids.data).getBytes())]),"content"in e&&(e.content instanceof ma.util.ByteBuffer?r=e.content.bytes():"string"==typeof e.content&&(r=ma.util.encodeUtf8(e.content)),t.detached?e.detachedContent=va.create(va.Class.UNIVERSAL,va.Type.OCTETSTRING,!1,r):e.contentInfo.value.push(va.create(va.Class.CONTEXT_SPECIFIC,0,!0,[va.create(va.Class.UNIVERSAL,va.Type.OCTETSTRING,!1,r)]))));if(0!==e.signers.length){var n=function(){for(var t={},r=0;r<e.signers.length;++r){var n=e.signers[r];(i=n.digestAlgorithm)in t||(t[i]=ma.md[ma.pki.oids[i]].create()),0===n.authenticatedAttributes.length?n.md=t[i]:n.md=ma.md[ma.pki.oids[i]].create()}for(var i in e.digestAlgorithmIdentifiers=[],t)e.digestAlgorithmIdentifiers.push(va.create(va.Class.UNIVERSAL,va.Type.SEQUENCE,!0,[va.create(va.Class.UNIVERSAL,va.Type.OID,!1,va.oidToDer(i).getBytes()),va.create(va.Class.UNIVERSAL,va.Type.NULL,!1,"")]));return t}();!function(t){var r;r=e.detachedContent?e.detachedContent:(r=e.contentInfo.value[1]).value[0];if(!r)throw new Error("Could not sign PKCS#7 message; there is no content to sign.");var n=va.derToOid(e.contentInfo.value[0].value),i=va.toDer(r);for(var a in i.getByte(),va.getBerValueLength(i),i=i.getBytes(),t)t[a].start().update(i);for(var s=new Date,o=0;o<e.signers.length;++o){var u=e.signers[o];if(0===u.authenticatedAttributes.length){if(n!==ma.pki.oids.data)throw new Error("Invalid signer; authenticatedAttributes must be present when the ContentInfo content type is not PKCS#7 Data.")}else{u.authenticatedAttributesAsn1=va.create(va.Class.CONTEXT_SPECIFIC,0,!0,[]);for(var c=va.create(va.Class.UNIVERSAL,va.Type.SET,!0,[]),l=0;l<u.authenticatedAttributes.length;++l){var h=u.authenticatedAttributes[l];h.type===ma.pki.oids.messageDigest?h.value=t[u.digestAlgorithm].digest():h.type===ma.pki.oids.signingTime&&(h.value||(h.value=s)),c.value.push(Ta(h)),u.authenticatedAttributesAsn1.value.push(Ta(h))}i=va.toDer(c).getBytes(),u.md.start().update(i)}u.signature=u.key.sign(u.md,"RSASSA-PKCS1-V1_5")}e.signerInfos=function(e){for(var t=[],r=0;r<e.length;++r)t.push(Sa(e[r]));return t}(e.signers)}(n)}},verify:function(){throw new Error("PKCS#7 signature verification not yet implemented.")},addCertificate:function(t){"string"==typeof t&&(t=ma.pki.certificateFromPem(t)),e.certificates.push(t)},addCertificateRevokationList:function(e){throw new Error("PKCS#7 CRL support not yet implemented.")}},e},Ca.createEncryptedData=function(){var e=null;return e={type:ma.pki.oids.encryptedData,version:0,encryptedContent:{algorithm:ma.pki.oids["aes256-CBC"]},fromAsn1:function(t){_a(e,t,Ca.asn1.encryptedDataValidator)},decrypt:function(t){void 0!==t&&(e.encryptedContent.key=t),wa(e)}},e},Ca.createEnvelopedData=function(){var e=null;return e={type:ma.pki.oids.envelopedData,version:0,recipients:[],encryptedContent:{algorithm:ma.pki.oids["aes256-CBC"]},fromAsn1:function(t){var r=_a(e,t,Ca.asn1.envelopedDataValidator);e.recipients=function(e){for(var t=[],r=0;r<e.length;++r)t.push(Ea(e[r]));return t}(r.recipientInfos.value)},toAsn1:function(){return va.create(va.Class.UNIVERSAL,va.Type.SEQUENCE,!0,[va.create(va.Class.UNIVERSAL,va.Type.OID,!1,va.oidToDer(e.type).getBytes()),va.create(va.Class.CONTEXT_SPECIFIC,0,!0,[va.create(va.Class.UNIVERSAL,va.Type.SEQUENCE,!0,[va.create(va.Class.UNIVERSAL,va.Type.INTEGER,!1,va.integerToDer(e.version).getBytes()),va.create(va.Class.UNIVERSAL,va.Type.SET,!0,ba(e.recipients)),va.create(va.Class.UNIVERSAL,va.Type.SEQUENCE,!0,(t=e.encryptedContent,[va.create(va.Class.UNIVERSAL,va.Type.OID,!1,va.oidToDer(ma.pki.oids.data).getBytes()),va.create(va.Class.UNIVERSAL,va.Type.SEQUENCE,!0,[va.create(va.Class.UNIVERSAL,va.Type.OID,!1,va.oidToDer(t.algorithm).getBytes()),va.create(va.Class.UNIVERSAL,va.Type.OCTETSTRING,!1,t.parameter.getBytes())]),va.create(va.Class.CONTEXT_SPECIFIC,0,!0,[va.create(va.Class.UNIVERSAL,va.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 ma.pki.oids.rsaEncryption:case ma.pki.oids.desCBC:var n=r.decrypt(t.encryptedContent.content);e.encryptedContent.key=ma.util.createBuffer(n);break;default:throw new Error("Unsupported asymmetric cipher, OID "+t.encryptedContent.algorithm)}wa(e)},addRecipient:function(t){e.recipients.push({version:0,issuer:t.issuer.attributes,serialNumber:t.serialNumber,encryptedContent:{algorithm:ma.pki.oids.rsaEncryption,key:t.publicKey}})},encrypt:function(t,r){if(void 0===e.encryptedContent.content){var n,i,a;switch(r=r||e.encryptedContent.algorithm,t=t||e.encryptedContent.key,r){case ma.pki.oids["aes128-CBC"]:n=16,i=16,a=ma.aes.createEncryptionCipher;break;case ma.pki.oids["aes192-CBC"]:n=24,i=16,a=ma.aes.createEncryptionCipher;break;case ma.pki.oids["aes256-CBC"]:n=32,i=16,a=ma.aes.createEncryptionCipher;break;case ma.pki.oids["des-EDE3-CBC"]:n=24,i=8,a=ma.des.createEncryptionCipher;break;default:throw new Error("Unsupported symmetric cipher, OID "+r)}if(void 0===t)t=ma.util.createBuffer(ma.random.getBytes(n));else if(t.length()!=n)throw new Error("Symmetric key has wrong length; got "+t.length()+" bytes, expected "+n+".");e.encryptedContent.algorithm=r,e.encryptedContent.key=t,e.encryptedContent.parameter=ma.util.createBuffer(ma.random.getBytes(i));var s=a(t);if(s.start(e.encryptedContent.parameter.copy()),s.update(e.content),!s.finish())throw new Error("Symmetric encryption failed.");e.encryptedContent.content=s.output}for(var o=0;o<e.recipients.length;++o){var u=e.recipients[o];if(void 0===u.encryptedContent.content){if(u.encryptedContent.algorithm!==ma.pki.oids.rsaEncryption)throw new Error("Unsupported asymmetric cipher, OID "+u.encryptedContent.algorithm);u.encryptedContent.content=u.encryptedContent.key.encrypt(e.encryptedContent.key.data)}}}},e};var Ia=S,Aa=Ia.ssh=Ia.ssh||{};function Ba(e,t){var r=t.toString(16);r[0]>="8"&&(r="00"+r);var n=Ia.util.hexToBytes(r);e.putInt32(n.length),e.putBytes(n)}function ka(e,t){e.putInt32(t.length),e.putString(t)}function Na(){for(var e=Ia.md.sha1.create(),t=arguments.length,r=0;r<t;++r)e.update(arguments[r]);return e.digest()}Aa.privateKeyToPutty=function(e,t,r){var n="ssh-rsa",i=""===(t=t||"")?"none":"aes256-cbc",a="PuTTY-User-Key-File-2: "+n+"\r\n";a+="Encryption: "+i+"\r\n",a+="Comment: "+(r=r||"")+"\r\n";var s=Ia.util.createBuffer();ka(s,n),Ba(s,e.e),Ba(s,e.n);var o=Ia.util.encode64(s.bytes(),64),u=Math.floor(o.length/66)+1;a+="Public-Lines: "+u+"\r\n",a+=o;var c,l=Ia.util.createBuffer();if(Ba(l,e.d),Ba(l,e.p),Ba(l,e.q),Ba(l,e.qInv),t){var h=l.length()+16-1;h-=h%16;var f=Na(l.bytes());f.truncate(f.length()-h+l.length()),l.putBuffer(f);var d=Ia.util.createBuffer();d.putBuffer(Na("\0\0\0\0",t)),d.putBuffer(Na("\0\0\0",t));var p=Ia.aes.createEncryptionCipher(d.truncate(8),"CBC");p.start(Ia.util.createBuffer().fillWithByte(0,16)),p.update(l.copy()),p.finish();var g=p.output;g.truncate(16),c=Ia.util.encode64(g.bytes(),64)}else c=Ia.util.encode64(l.bytes(),64);a+="\r\nPrivate-Lines: "+(u=Math.floor(c.length/66)+1)+"\r\n",a+=c;var y=Na("putty-private-key-file-mac-key",t),m=Ia.util.createBuffer();ka(m,n),ka(m,i),ka(m,r),m.putInt32(s.length()),m.putBuffer(s),m.putInt32(l.length()),m.putBuffer(l);var v=Ia.hmac.create();return v.start("sha1",y),v.update(m.bytes()),a+="\r\nPrivate-MAC: "+v.digest().toHex()+"\r\n"},Aa.publicKeyToOpenSSH=function(e,t){var r="ssh-rsa";t=t||"";var n=Ia.util.createBuffer();return ka(n,r),Ba(n,e.e),Ba(n,e.n),r+" "+Ia.util.encode64(n.bytes())+" "+t},Aa.privateKeyToOpenSSH=function(e,t){return t?Ia.pki.encryptRsaPrivateKey(e,t,{legacy:!0,algorithm:"aes128"}):Ia.pki.privateKeyToPem(e)},Aa.getPublicKeyFingerprint=function(e,t){var r=(t=t||{}).md||Ia.md.md5.create(),n=Ia.util.createBuffer();ka(n,"ssh-rsa"),Ba(n,e.e),Ba(n,e.n),r.start(),r.update(n.getBytes());var i=r.digest();if("hex"===t.encoding){var a=i.toHex();return t.delimiter?a.match(/.{2}/g).join(t.delimiter):a}if("binary"===t.encoding)return i.getBytes();if(t.encoding)throw new Error('Unknown encoding "'+t.encoding+'".');return i};var Ra=S,La="forge.task",Da={},Ua=0;Ra.debug.set(La,"tasks",Da);var xa={};Ra.debug.set(La,"queues",xa);var Oa="ready",Pa="running",Va="blocked",Ka="sleeping",Ma="done",Fa="error",za="stop",ja="start",qa="block",Ha="unblock",Ga="sleep",Wa="wakeup",Qa="cancel",Ya="fail",Za={};Za[Oa]={},Za[Oa][za]=Oa,Za[Oa][ja]=Pa,Za[Oa][Qa]=Ma,Za[Oa][Ya]=Fa,Za[Pa]={},Za[Pa][za]=Oa,Za[Pa][ja]=Pa,Za[Pa][qa]=Va,Za[Pa][Ha]=Pa,Za[Pa][Ga]=Ka,Za[Pa][Wa]=Pa,Za[Pa][Qa]=Ma,Za[Pa][Ya]=Fa,Za[Va]={},Za[Va][za]=Va,Za[Va][ja]=Va,Za[Va][qa]=Va,Za[Va][Ha]=Va,Za[Va][Ga]=Va,Za[Va][Wa]=Va,Za[Va][Qa]=Ma,Za[Va][Ya]=Fa,Za[Ka]={},Za[Ka][za]=Ka,Za[Ka][ja]=Ka,Za[Ka][qa]=Ka,Za[Ka][Ha]=Ka,Za[Ka][Ga]=Ka,Za[Ka][Wa]=Ka,Za[Ka][Qa]=Ma,Za[Ka][Ya]=Fa,Za[Ma]={},Za[Ma][za]=Ma,Za[Ma][ja]=Ma,Za[Ma][qa]=Ma,Za[Ma][Ha]=Ma,Za[Ma][Ga]=Ma,Za[Ma][Wa]=Ma,Za[Ma][Qa]=Ma,Za[Ma][Ya]=Fa,Za[Fa]={},Za[Fa][za]=Fa,Za[Fa][ja]=Fa,Za[Fa][qa]=Fa,Za[Fa][Ha]=Fa,Za[Fa][Ga]=Fa,Za[Fa][Wa]=Fa,Za[Fa][Qa]=Fa,Za[Fa][Ya]=Fa;var Xa=function(e){this.id=-1,this.name=e.name||"?",this.parent=e.parent||null,this.run=e.run,this.subtasks=[],this.error=!1,this.state=Oa,this.blocks=0,this.timeoutId=null,this.swapTime=null,this.userData=null,this.id=Ua++,Da[this.id]=this};Xa.prototype.debug=function(e){e=e||"",Ra.log.debug(La,e,"[%s][%s] task:",this.id,this.name,this,"subtasks:",this.subtasks.length,"queue:",xa)},Xa.prototype.next=function(e,t){"function"==typeof e&&(t=e,e=this.name);var r=new Xa({run:t,name:e,parent:this});return r.state=Pa,r.type=this.type,r.successCallback=this.successCallback||null,r.failureCallback=this.failureCallback||null,this.subtasks.push(r),this},Xa.prototype.parallel=function(e,t){return Ra.util.isArray(e)&&(t=e,e=this.name),this.next(e,(function(r){var n=r;n.block(t.length);for(var i=function(e,r){Ra.task.start({type:e,run:function(e){t[r](e)},success:function(e){n.unblock()},failure:function(e){n.unblock()}})},a=0;a<t.length;a++){i(e+"__parallel-"+r.id+"-"+a,a)}}))},Xa.prototype.stop=function(){this.state=Za[this.state][za]},Xa.prototype.start=function(){this.error=!1,this.state=Za[this.state][ja],this.state===Pa&&(this.start=new Date,this.run(this),$a(this,0))},Xa.prototype.block=function(e){e=void 0===e?1:e,this.blocks+=e,this.blocks>0&&(this.state=Za[this.state][qa])},Xa.prototype.unblock=function(e){return e=void 0===e?1:e,this.blocks-=e,0===this.blocks&&this.state!==Ma&&(this.state=Pa,$a(this,0)),this.blocks},Xa.prototype.sleep=function(e){e=void 0===e?0:e,this.state=Za[this.state][Ga];var t=this;this.timeoutId=setTimeout((function(){t.timeoutId=null,t.state=Pa,$a(t,0)}),e)},Xa.prototype.wait=function(e){e.wait(this)},Xa.prototype.wakeup=function(){this.state===Ka&&(cancelTimeout(this.timeoutId),this.timeoutId=null,this.state=Pa,$a(this,0))},Xa.prototype.cancel=function(){this.state=Za[this.state][Qa],this.permitsNeeded=0,null!==this.timeoutId&&(cancelTimeout(this.timeoutId),this.timeoutId=null),this.subtasks=[]},Xa.prototype.fail=function(e){if(this.error=!0,Ja(this,!0),e)e.error=this.error,e.swapTime=this.swapTime,e.userData=this.userData,$a(e,0);else{if(null!==this.parent){for(var t=this.parent;null!==t.parent;)t.error=this.error,t.swapTime=this.swapTime,t.userData=this.userData,t=t.parent;Ja(t,!0)}this.failureCallback&&this.failureCallback(this)}};var $a=function(e,t){var r=t>30||+new Date-e.swapTime>20,n=function(t){if(t++,e.state===Pa)if(r&&(e.swapTime=+new Date),e.subtasks.length>0){var n=e.subtasks.shift();n.error=e.error,n.swapTime=e.swapTime,n.userData=e.userData,n.run(n),n.error||$a(n,t)}else Ja(e),e.error||null!==e.parent&&(e.parent.error=e.error,e.parent.swapTime=e.swapTime,e.parent.userData=e.userData,$a(e.parent,t))};r?setTimeout(n,0):n(t)},Ja=function(e,t){e.state=Ma,delete Da[e.id],null===e.parent&&(e.type in xa?0===xa[e.type].length?Ra.log.error(La,"[%s][%s] task queue empty [%s]",e.id,e.name,e.type):xa[e.type][0]!==e?Ra.log.error(La,"[%s][%s] task not first in queue [%s]",e.id,e.name,e.type):(xa[e.type].shift(),0===xa[e.type].length?delete xa[e.type]:xa[e.type][0].start()):Ra.log.error(La,"[%s][%s] task queue missing [%s]",e.id,e.name,e.type),t||(e.error&&e.failureCallback?e.failureCallback(e):!e.error&&e.successCallback&&e.successCallback(e)))};Ra.task=Ra.task||{},Ra.task.start=function(e){var t=new Xa({run:e.run,name:e.name||"?"});t.type=e.type,t.successCallback=e.success||null,t.failureCallback=e.failure||null,t.type in xa?xa[e.type].push(t):(xa[t.type]=[t],function(e){e.error=!1,e.state=Za[e.state][ja],setTimeout((function(){e.state===Pa&&(e.swapTime=+new Date,e.run(e),$a(e,0))}),0)}(t))},Ra.task.cancel=function(e){e in xa&&(xa[e]=[xa[e][0]])},Ra.task.createCondition=function(){var e={tasks:{},wait:function(t){t.id in e.tasks||(t.block(),e.tasks[t.id]=t)},notify:function(){var t=e.tasks;for(var r in e.tasks={},t)t[r].unblock()}};return e},b.exports=S;var es=C(E);class ts{crt;key;csr;detail;expires;constructor(e){this.crt=e.crt,this.key=e.key,this.csr=e.csr;const{detail:t,expires:r}=this.getCrtDetail(this.crt);this.detail=t,this.expires=r.getTime()}toCertInfo(){return{crt:this.crt,key:this.key,csr:this.csr}}getCrtDetail(e){const t=es.pki.certificateFromPem(e.toString());return{detail:t,expires:t.validity.notAfter}}saveToFile(e,t){null==t&&(t=o.join(a.tmpdir(),"/certd/tmp/",Math.floor(1e6*Math.random())+"",`cert.${e}`));const r=o.dirname(t);return i.existsSync(r)||i.mkdirSync(r,{recursive:!0}),i.writeFileSync(t,this[e]),t}}var rs,ns,is,as={},ss={},os={},us={},cs={get exports(){return us},set exports(e){us=e}},ls={},hs={get exports(){return ls},set exports(e){ls=e}};function fs(){if(rs)return ls;return rs=1,"undefined"==typeof process||!process.version||0===process.version.indexOf("v0.")||0===process.version.indexOf("v1.")&&0!==process.version.indexOf("v1.8.")?hs.exports={nextTick:function(e,t,r,n){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var i,a,s=arguments.length;switch(s){case 0:case 1:return process.nextTick(e);case 2:return process.nextTick((function(){e.call(null,t)}));case 3:return process.nextTick((function(){e.call(null,t,r)}));case 4:return process.nextTick((function(){e.call(null,t,r,n)}));default:for(i=new Array(s-1),a=0;a<i.length;)i[a++]=arguments[a];return process.nextTick((function(){e.apply(null,i)}))}}}:hs.exports=process,ls}var ds,ps={},gs={get exports(){return ps},set exports(e){ps=e}};function ys(){return ds||(ds=1,gs.exports=u),ps}var ms,vs={},Cs={get exports(){return vs},set exports(e){vs=e}};function Es(){return ms||(ms=1,function(e,t){var r=l,n=r.Buffer;function i(e,t){for(var r in e)t[r]=e[r]}function a(e,t,r){return n(e,t,r)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?e.exports=r:(i(r,t),t.Buffer=a),i(n,a),a.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return n(e,t,r)},a.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var i=n(e);return void 0!==t?"string"==typeof r?i.fill(t,r):i.fill(t):i.fill(0),i},a.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}}(Cs,vs)),vs}var bs,Ss={};function Ts(){if(bs)return Ss;function e(e){return Object.prototype.toString.call(e)}return bs=1,Ss.isArray=function(t){return Array.isArray?Array.isArray(t):"[object Array]"===e(t)},Ss.isBoolean=function(e){return"boolean"==typeof e},Ss.isNull=function(e){return null===e},Ss.isNullOrUndefined=function(e){return null==e},Ss.isNumber=function(e){return"number"==typeof e},Ss.isString=function(e){return"string"==typeof e},Ss.isSymbol=function(e){return"symbol"==typeof e},Ss.isUndefined=function(e){return void 0===e},Ss.isRegExp=function(t){return"[object RegExp]"===e(t)},Ss.isObject=function(e){return"object"==typeof e&&null!==e},Ss.isDate=function(t){return"[object Date]"===e(t)},Ss.isError=function(t){return"[object Error]"===e(t)||t instanceof Error},Ss.isFunction=function(e){return"function"==typeof e},Ss.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},Ss.isBuffer=l.Buffer.isBuffer,Ss}var _s,ws,Is={},As={get exports(){return Is},set exports(e){Is=e}},Bs={},ks={get exports(){return Bs},set exports(e){Bs=e}};function Ns(){return ws||(ws=1,function(e){try{var t=require("util");if("function"!=typeof t.inherits)throw"";e.exports=t.inherits}catch(t){e.exports=(_s||(_s=1,"function"==typeof Object.create?ks.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:ks.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}),Bs)}}(As)),Is}var Rs,Ls,Ds,Us,xs,Os,Ps,Vs,Ks,Ms={},Fs={get exports(){return Ms},set exports(e){Ms=e}};function zs(){return Rs||(Rs=1,function(e){var t=Es().Buffer,r=h;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 t.alloc(0);for(var r,n,i,a=t.allocUnsafe(e>>>0),s=this.head,o=0;s;)r=s.data,n=a,i=o,r.copy(n,i),o+=s.data.length,s=s.next;return a},e}(),r&&r.inspect&&r.inspect.custom&&(e.exports.prototype[r.inspect.custom]=function(){var e=r.inspect({length:this.length});return this.constructor.name+" "+e})}(Fs)),Ms}function js(){if(Ds)return Ls;Ds=1;var e=fs();function t(e,t){e.emit("error",t)}return Ls={destroy:function(r,n){var i=this,a=this._readableState&&this._readableState.destroyed,s=this._writableState&&this._writableState.destroyed;return a||s?(n?n(r):r&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,e.nextTick(t,this,r)):e.nextTick(t,this,r)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(r||null,(function(r){!n&&r?i._writableState?i._writableState.errorEmitted||(i._writableState.errorEmitted=!0,e.nextTick(t,i,r)):e.nextTick(t,i,r):n&&n(r)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}},Ls}function qs(){if(Ps)return Os;Ps=1;var e=fs();function t(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,r){var n=e.entry;e.entry=null;for(;n;){var i=n.callback;t.pendingcb--,i(r),n=n.next}t.corkedRequestsFree.next=e}(t,e)}}Os=p;var r,n=!process.browser&&["v0.10","v0.9."].indexOf(process.version.slice(0,5))>-1?setImmediate:e.nextTick;p.WritableState=d;var i=Object.create(Ts());i.inherits=Ns();var a={deprecate:xs?Us:(xs=1,Us=h.deprecate)},s=ys(),o=Es().Buffer,u=(void 0!==v?v:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var c,l=js();function f(){}function d(i,a){r=r||Hs(),i=i||{};var s=a instanceof r;this.objectMode=!!i.objectMode,s&&(this.objectMode=this.objectMode||!!i.writableObjectMode);var o=i.highWaterMark,u=i.writableHighWaterMark,c=this.objectMode?16:16384;this.highWaterMark=o||0===o?o:s&&(u||0===u)?u:c,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var l=!1===i.decodeStrings;this.decodeStrings=!l,this.defaultEncoding=i.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,r){var i=t._writableState,a=i.sync,s=i.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(i),r)!function(t,r,n,i,a){--r.pendingcb,n?(e.nextTick(a,i),e.nextTick(b,t,r),t._writableState.errorEmitted=!0,t.emit("error",i)):(a(i),t._writableState.errorEmitted=!0,t.emit("error",i),b(t,r))}(t,i,a,r,s);else{var o=C(i);o||i.corked||i.bufferProcessing||!i.bufferedRequest||m(t,i),a?n(y,t,i,o,s):y(t,i,o,s)}}(a,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new t(this)}function p(e){if(r=r||Hs(),!(c.call(p,this)||this instanceof r))return new p(e);this._writableState=new d(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)),s.call(this)}function g(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 y(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),b(e,t)}function m(e,r){r.bufferProcessing=!0;var n=r.bufferedRequest;if(e._writev&&n&&n.next){var i=r.bufferedRequestCount,a=new Array(i),s=r.corkedRequestsFree;s.entry=n;for(var o=0,u=!0;n;)a[o]=n,n.isBuf||(u=!1),n=n.next,o+=1;a.allBuffers=u,g(e,r,!0,r.length,a,"",s.finish),r.pendingcb++,r.lastBufferedRequest=null,s.next?(r.corkedRequestsFree=s.next,s.next=null):r.corkedRequestsFree=new t(r),r.bufferedRequestCount=0}else{for(;n;){var c=n.chunk,l=n.encoding,h=n.callback;if(g(e,r,!1,r.objectMode?1:c.length,c,l,h),n=n.next,r.bufferedRequestCount--,r.writing)break}null===n&&(r.lastBufferedRequest=null)}r.bufferedRequest=n,r.bufferProcessing=!1}function C(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function E(e,t){e._final((function(r){t.pendingcb--,r&&e.emit("error",r),t.prefinished=!0,e.emit("prefinish"),b(e,t)}))}function b(t,r){var n=C(r);return n&&(!function(t,r){r.prefinished||r.finalCalled||("function"==typeof t._final?(r.pendingcb++,r.finalCalled=!0,e.nextTick(E,t,r)):(r.prefinished=!0,t.emit("prefinish")))}(t,r),0===r.pendingcb&&(r.finished=!0,t.emit("finish"))),n}return i.inherits(p,s),d.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(d.prototype,"buffer",{get:a.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(c=Function.prototype[Symbol.hasInstance],Object.defineProperty(p,Symbol.hasInstance,{value:function(e){return!!c.call(this,e)||this===p&&(e&&e._writableState instanceof d)}})):c=function(e){return e instanceof this},p.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},p.prototype.write=function(t,r,n){var i,a=this._writableState,s=!1,c=!a.objectMode&&(i=t,o.isBuffer(i)||i instanceof u);return c&&!o.isBuffer(t)&&(t=function(e){return o.from(e)}(t)),"function"==typeof r&&(n=r,r=null),c?r="buffer":r||(r=a.defaultEncoding),"function"!=typeof n&&(n=f),a.ended?function(t,r){var n=new Error("write after end");t.emit("error",n),e.nextTick(r,n)}(this,n):(c||function(t,r,n,i){var a=!0,s=!1;return null===n?s=new TypeError("May not write null values to stream"):"string"==typeof n||void 0===n||r.objectMode||(s=new TypeError("Invalid non-string/buffer chunk")),s&&(t.emit("error",s),e.nextTick(i,s),a=!1),a}(this,a,t,n))&&(a.pendingcb++,s=function(e,t,r,n,i,a){if(!r){var s=function(e,t,r){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=o.from(t,r));return t}(t,n,i);n!==s&&(r=!0,i="buffer",n=s)}var u=t.objectMode?1:n.length;t.length+=u;var c=t.length<t.highWaterMark;c||(t.needDrain=!0);if(t.writing||t.corked){var l=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:a,next:null},l?l.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else g(e,t,!1,u,n,i,a);return c}(this,a,c,t,r,n)),s},p.prototype.cork=function(){this._writableState.corked++},p.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||m(this,e))},p.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(p.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),p.prototype._write=function(e,t,r){r(new Error("_write() is not implemented"))},p.prototype._writev=null,p.prototype.end=function(t,r,n){var i=this._writableState;"function"==typeof t?(n=t,t=null,r=null):"function"==typeof r&&(n=r,r=null),null!=t&&this.write(t,r),i.corked&&(i.corked=1,this.uncork()),i.ending||function(t,r,n){r.ending=!0,b(t,r),n&&(r.finished?e.nextTick(n):t.once("finish",n));r.ended=!0,t.writable=!1}(this,i,n)},Object.defineProperty(p.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),p.prototype.destroy=l.destroy,p.prototype._undestroy=l.undestroy,p.prototype._destroy=function(e,t){this.end(),t(e)},Os}function Hs(){if(Ks)return Vs;Ks=1;var e=fs(),t=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};Vs=u;var r=Object.create(Ts());r.inherits=Ns();var n=ro(),i=qs();r.inherits(u,n);for(var a=t(i.prototype),s=0;s<a.length;s++){var o=a[s];u.prototype[o]||(u.prototype[o]=i.prototype[o])}function u(e){if(!(this instanceof u))return new u(e);n.call(this,e),i.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",c)}function c(){this.allowHalfOpen||this._writableState.ended||e.nextTick(l,this)}function l(e){e.end()}return Object.defineProperty(u.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(u.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)}}),u.prototype._destroy=function(t,r){this.push(null),this.end(),e.nextTick(r,t)},Vs}var Gs,Ws,Qs,Ys,Zs,Xs,$s,Js,eo={};function to(){if(Gs)return eo;Gs=1;var e=Es().Buffer,t=e.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 r(r){var n;switch(this.encoding=function(r){var n=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}}(r);if("string"!=typeof n&&(e.isEncoding===t||!t(r)))throw new Error("Unknown encoding: "+r);return n||r}(r),this.encoding){case"utf16le":this.text=a,this.end=s,n=4;break;case"utf8":this.fillLast=i,n=4;break;case"base64":this.text=o,this.end=u,n=3;break;default:return this.write=c,void(this.end=l)}this.lastNeed=0,this.lastTotal=0,this.lastChar=e.allocUnsafe(n)}function n(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function i(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(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 a(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 s(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 o(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 u(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function c(e){return e.toString(this.encoding)}function l(e){return e&&e.length?this.write(e):""}return eo.StringDecoder=r,r.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||""},r.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},r.prototype.text=function(e,t){var r=function(e,t,r){var i=t.length-1;if(i<r)return 0;var a=n(t[i]);if(a>=0)return a>0&&(e.lastNeed=a-1),a;if(--i<r||-2===a)return 0;if(a=n(t[i]),a>=0)return a>0&&(e.lastNeed=a-2),a;if(--i<r||-2===a)return 0;if(a=n(t[i]),a>=0)return a>0&&(2===a?a=0:e.lastNeed=a-3),a;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var i=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,i),e.toString("utf8",t,i)},r.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},eo}function ro(){if(Qs)return Ws;Qs=1;var e=fs();Ws=m;var t,r=function(){if(is)return ns;is=1;var e={}.toString;return ns=Array.isArray||function(t){return"[object Array]"==e.call(t)}}();m.ReadableState=y,c.EventEmitter;var n=function(e,t){return e.listeners(t).length},i=ys(),a=Es().Buffer,s=(void 0!==v?v:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var o=Object.create(Ts());o.inherits=Ns();var u=h,l=void 0;l=u&&u.debuglog?u.debuglog("stream"):function(){};var f,d=zs(),p=js();o.inherits(m,i);var g=["error","close","destroy","pause","resume"];function y(e,r){e=e||{};var n=r instanceof(t=t||Hs());this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var i=e.highWaterMark,a=e.readableHighWaterMark,s=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(a||0===a)?a:s,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new d,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&&(f||(f=to().StringDecoder),this.decoder=new f(e.encoding),this.encoding=e.encoding)}function m(e){if(t=t||Hs(),!(this instanceof m))return new m(e);this._readableState=new y(e,this),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),i.call(this)}function C(e,t,r,n,i){var o,u=e._readableState;null===t?(u.reading=!1,function(e,t){if(t.ended)return;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,T(e)}(e,u)):(i||(o=function(e,t){var r;n=t,a.isBuffer(n)||n instanceof s||"string"==typeof t||void 0===t||e.objectMode||(r=new TypeError("Invalid non-string/buffer chunk"));var n;return r}(u,t)),o?e.emit("error",o):u.objectMode||t&&t.length>0?("string"==typeof t||u.objectMode||Object.getPrototypeOf(t)===a.prototype||(t=function(e){return a.from(e)}(t)),n?u.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):E(e,u,t,!0):u.ended?e.emit("error",new Error("stream.push() after EOF")):(u.reading=!1,u.decoder&&!r?(t=u.decoder.write(t),u.objectMode||0!==t.length?E(e,u,t,!1):w(e,u)):E(e,u,t,!1))):n||(u.reading=!1));return function(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}(u)}function E(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&&T(e)),w(e,t)}Object.defineProperty(m.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),m.prototype.destroy=p.destroy,m.prototype._undestroy=p.undestroy,m.prototype._destroy=function(e,t){this.push(null),t(e)},m.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=a.from(e,t),t=""),r=!0),C(this,e,t,!1,r)},m.prototype.unshift=function(e){return C(this,e,null,!0,!1)},m.prototype.isPaused=function(){return!1===this._readableState.flowing},m.prototype.setEncoding=function(e){return f||(f=to().StringDecoder),this._readableState.decoder=new f(e),this._readableState.encoding=e,this};var b=8388608;function S(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>=b?e=b:(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 T(t){var r=t._readableState;r.needReadable=!1,r.emittedReadable||(l("emitReadable",r.flowing),r.emittedReadable=!0,r.sync?e.nextTick(_,t):_(t))}function _(e){l("emit readable"),e.emit("readable"),k(e)}function w(t,r){r.readingMore||(r.readingMore=!0,e.nextTick(I,t,r))}function I(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(l("maybeReadMore read 0"),e.read(0),r!==t.length);)r=t.length;t.readingMore=!1}function A(e){l("readable nexttick read 0"),e.read(0)}function B(e,t){t.reading||(l("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(l("flow",t.flowing);t.flowing&&null!==e.read(););}function N(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;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;e-=i.length;for(;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=a.allocUnsafe(e),n=t.head,i=1;n.data.copy(r),e-=n.data.length;for(;n=n.next;){var s=n.data,o=e>s.length?s.length:e;if(s.copy(r,r.length-e,0,o),0===(e-=o)){o===s.length?(++i,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=s.slice(o));break}++i}return t.length-=i,r}(e,t);return n}(e,t.buffer,t.decoder),r);var r}function R(t){var r=t._readableState;if(r.length>0)throw new Error('"endReadable()" called on non-empty stream');r.endEmitted||(r.ended=!0,e.nextTick(L,r,t))}function L(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function D(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}return m.prototype.read=function(e){l("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 l("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?R(this):T(this),null;if(0===(e=S(e,t))&&t.ended)return 0===t.length&&R(this),null;var n,i=t.needReadable;return l("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&l("length less than watermark",i=!0),t.ended||t.reading?l("reading or ended",i=!1):i&&(l("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=S(r,t))),null===(n=e>0?N(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&R(this)),null!==n&&this.emit("data",n),n},m.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},m.prototype.pipe=function(t,i){var a=this,s=this._readableState;switch(s.pipesCount){case 0:s.pipes=t;break;case 1:s.pipes=[s.pipes,t];break;default:s.pipes.push(t)}s.pipesCount+=1,l("pipe count=%d opts=%j",s.pipesCount,i);var o=(!i||!1!==i.end)&&t!==process.stdout&&t!==process.stderr?c:v;function u(e,r){l("onunpipe"),e===a&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,l("cleanup"),t.removeListener("close",y),t.removeListener("finish",m),t.removeListener("drain",h),t.removeListener("error",g),t.removeListener("unpipe",u),a.removeListener("end",c),a.removeListener("end",v),a.removeListener("data",p),f=!0,!s.awaitDrain||t._writableState&&!t._writableState.needDrain||h())}function c(){l("onend"),t.end()}s.endEmitted?e.nextTick(o):a.once("end",o),t.on("unpipe",u);var h=function(e){return function(){var t=e._readableState;l("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&n(e,"data")&&(t.flowing=!0,k(e))}}(a);t.on("drain",h);var f=!1;var d=!1;function p(e){l("ondata"),d=!1,!1!==t.write(e)||d||((1===s.pipesCount&&s.pipes===t||s.pipesCount>1&&-1!==D(s.pipes,t))&&!f&&(l("false write response, pause",s.awaitDrain),s.awaitDrain++,d=!0),a.pause())}function g(e){l("onerror",e),v(),t.removeListener("error",g),0===n(t,"error")&&t.emit("error",e)}function y(){t.removeListener("finish",m),v()}function m(){l("onfinish"),t.removeListener("close",y),v()}function v(){l("unpipe"),a.unpipe(t)}return a.on("data",p),function(e,t,n){if("function"==typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?r(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}(t,"error",g),t.once("close",y),t.once("finish",m),t.emit("pipe",a),s.flowing||(l("pipe resume"),a.resume()),t},m.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var a=0;a<i;a++)n[a].emit("unpipe",this,{hasUnpiped:!1});return this}var s=D(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},m.prototype.on=function(t,r){var n=i.prototype.on.call(this,t,r);if("data"===t)!1!==this._readableState.flowing&&this.resume();else if("readable"===t){var a=this._readableState;a.endEmitted||a.readableListening||(a.readableListening=a.needReadable=!0,a.emittedReadable=!1,a.reading?a.length&&T(this):e.nextTick(A,this))}return n},m.prototype.addListener=m.prototype.on,m.prototype.resume=function(){var t=this._readableState;return t.flowing||(l("resume"),t.flowing=!0,function(t,r){r.resumeScheduled||(r.resumeScheduled=!0,e.nextTick(B,t,r))}(this,t)),this},m.prototype.pause=function(){return l("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(l("pause"),this._readableState.flowing=!1,this.emit("pause")),this},m.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var i in e.on("end",(function(){if(l("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){(l("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<g.length;a++)e.on(g[a],this.emit.bind(this,g[a]));return this._read=function(t){l("wrapped _read",t),n&&(n=!1,e.resume())},this},Object.defineProperty(m.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),m._fromList=N,Ws}function no(){if(Zs)return Ys;Zs=1,Ys=n;var e=Hs(),t=Object.create(Ts());function r(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 n(t){if(!(this instanceof n))return new n(t);e.call(this,t),this._transformState={afterTransform:r.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&("function"==typeof t.transform&&(this._transform=t.transform),"function"==typeof t.flush&&(this._flush=t.flush)),this.on("prefinish",i)}function i(){var e=this;"function"==typeof this._flush?this._flush((function(t,r){a(e,t,r)})):a(this,null,null)}function a(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)}return t.inherits=Ns(),t.inherits(n,e),n.prototype.push=function(t,r){return this._transformState.needTransform=!1,e.prototype.push.call(this,t,r)},n.prototype._transform=function(e,t,r){throw new Error("_transform() is not implemented")},n.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)}},n.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},n.prototype._destroy=function(t,r){var n=this;e.prototype._destroy.call(this,t,(function(e){r(e),n.emit("close")}))},Ys}function io(){return Js||(Js=1,function(e,t){var r=u;"disable"===process.env.READABLE_STREAM&&r?(e.exports=r,(t=e.exports=r.Readable).Readable=r.Readable,t.Writable=r.Writable,t.Duplex=r.Duplex,t.Transform=r.Transform,t.PassThrough=r.PassThrough,t.Stream=r):((t=e.exports=ro()).Stream=r||t,t.Readable=t,t.Writable=qs(),t.Duplex=Hs(),t.Transform=no(),t.PassThrough=function(){if($s)return Xs;$s=1,Xs=r;var e=no(),t=Object.create(Ts());function r(t){if(!(this instanceof r))return new r(t);e.call(this,t)}return t.inherits=Ns(),t.inherits(r,e),r.prototype._transform=function(e,t,r){r(null,e)},Xs}())}(cs,us)),us}if(os.base64=!0,os.array=!0,os.string=!0,os.arraybuffer="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array,os.nodebuffer="undefined"!=typeof Buffer,os.uint8array="undefined"!=typeof Uint8Array,"undefined"==typeof ArrayBuffer)os.blob=!1;else{var ao=new ArrayBuffer(0);try{os.blob=0===new Blob([ao],{type:"application/zip"}).size}catch(e){try{var so=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);so.append(ao),os.blob=0===so.getBlob("application/zip").size}catch(e){os.blob=!1}}}try{os.nodestream=!!io().Readable}catch(e){os.nodestream=!1}var oo,uo={};function co(){if(oo)return uo;oo=1;var e=Co(),t=os,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";return uo.encode=function(t){for(var n,i,a,s,o,u,c,l=[],h=0,f=t.length,d=f,p="string"!==e.getTypeOf(t);h<t.length;)d=f-h,p?(n=t[h++],i=h<f?t[h++]:0,a=h<f?t[h++]:0):(n=t.charCodeAt(h++),i=h<f?t.charCodeAt(h++):0,a=h<f?t.charCodeAt(h++):0),s=n>>2,o=(3&n)<<4|i>>4,u=d>1?(15&i)<<2|a>>6:64,c=d>2?63&a:64,l.push(r.charAt(s)+r.charAt(o)+r.charAt(u)+r.charAt(c));return l.join("")},uo.decode=function(e){var n,i,a,s,o,u,c=0,l=0,h="data:";if(e.substr(0,5)===h)throw new Error("Invalid base64 input, it looks like a data url.");var f,d=3*(e=e.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(e.charAt(e.length-1)===r.charAt(64)&&d--,e.charAt(e.length-2)===r.charAt(64)&&d--,d%1!=0)throw new Error("Invalid base64 input, bad content length.");for(f=t.uint8array?new Uint8Array(0|d):new Array(0|d);c<e.length;)n=r.indexOf(e.charAt(c++))<<2|(s=r.indexOf(e.charAt(c++)))>>4,i=(15&s)<<4|(o=r.indexOf(e.charAt(c++)))>>2,a=(3&o)<<6|(u=r.indexOf(e.charAt(c++))),f[l++]=n,64!==o&&(f[l++]=i),64!==u&&(f[l++]=a);return f},uo}var lo,ho,fo,po,go={isNode:"undefined"!=typeof Buffer,newBufferFrom:function(e,t){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(e,t);if("number"==typeof e)throw new Error('The "data" argument must not be a number');return new Buffer(e,t)},allocBuffer:function(e){if(Buffer.alloc)return Buffer.alloc(e);var t=new Buffer(e);return t.fill(0),t},isBuffer:function(e){return Buffer.isBuffer(e)},isStream:function(e){return e&&"function"==typeof e.on&&"function"==typeof e.pause&&"function"==typeof e.resume}};var yo=null;yo="undefined"!=typeof Promise?Promise:function(){if(po)return fo;po=1;var e=function(){if(ho)return lo;ho=1;var e,t,r=v.MutationObserver||v.WebKitMutationObserver;if(process.browser)if(r){var n=0,i=new r(u),a=v.document.createTextNode("");i.observe(a,{characterData:!0}),e=function(){a.data=n=++n%2}}else if(v.setImmediate||void 0===v.MessageChannel)e="document"in v&&"onreadystatechange"in v.document.createElement("script")?function(){var e=v.document.createElement("script");e.onreadystatechange=function(){u(),e.onreadystatechange=null,e.parentNode.removeChild(e),e=null},v.document.documentElement.appendChild(e)}:function(){setTimeout(u,0)};else{var s=new v.MessageChannel;s.port1.onmessage=u,e=function(){s.port2.postMessage(0)}}else e=function(){process.nextTick(u)};var o=[];function u(){var e,r;t=!0;for(var n=o.length;n;){for(r=o,o=[],e=-1;++e<n;)r[e]();n=o.length}t=!1}return lo=function(r){1!==o.push(r)||t||e()}}();function t(){}var r={},n=["REJECTED"],i=["FULFILLED"],a=["PENDING"];if(!process.browser)var s=["UNHANDLED"];function o(e){if("function"!=typeof e)throw new TypeError("resolver must be a function");this.state=a,this.queue=[],this.outcome=void 0,process.browser||(this.handled=s),e!==t&&h(this,e)}function u(e,t,r){this.promise=e,"function"==typeof t&&(this.onFulfilled=t,this.callFulfilled=this.otherCallFulfilled),"function"==typeof r&&(this.onRejected=r,this.callRejected=this.otherCallRejected)}function c(t,n,i){e((function(){var e;try{e=n(i)}catch(e){return r.reject(t,e)}e===t?r.reject(t,new TypeError("Cannot resolve promise with itself")):r.resolve(t,e)}))}function l(e){var t=e&&e.then;if(e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof t)return function(){t.apply(e,arguments)}}function h(e,t){var n=!1;function i(t){n||(n=!0,r.reject(e,t))}function a(t){n||(n=!0,r.resolve(e,t))}var s=f((function(){t(a,i)}));"error"===s.status&&i(s.value)}function f(e,t){var r={};try{r.value=e(t),r.status="success"}catch(e){r.status="error",r.value=e}return r}return fo=o,o.prototype.finally=function(e){if("function"!=typeof e)return this;var t=this.constructor;return this.then((function(r){return t.resolve(e()).then((function(){return r}))}),(function(r){return t.resolve(e()).then((function(){throw r}))}))},o.prototype.catch=function(e){return this.then(null,e)},o.prototype.then=function(e,r){if("function"!=typeof e&&this.state===i||"function"!=typeof r&&this.state===n)return this;var o=new this.constructor(t);return process.browser||this.handled===s&&(this.handled=null),this.state!==a?c(o,this.state===i?e:r,this.outcome):this.queue.push(new u(o,e,r)),o},u.prototype.callFulfilled=function(e){r.resolve(this.promise,e)},u.prototype.otherCallFulfilled=function(e){c(this.promise,this.onFulfilled,e)},u.prototype.callRejected=function(e){r.reject(this.promise,e)},u.prototype.otherCallRejected=function(e){c(this.promise,this.onRejected,e)},r.resolve=function(e,t){var n=f(l,t);if("error"===n.status)return r.reject(e,n.value);var a=n.value;if(a)h(e,a);else{e.state=i,e.outcome=t;for(var s=-1,o=e.queue.length;++s<o;)e.queue[s].callFulfilled(t)}return e},r.reject=function(t,r){t.state=n,t.outcome=r,process.browser||t.handled===s&&e((function(){t.handled===s&&process.emit("unhandledRejection",r,t)}));for(var i=-1,a=t.queue.length;++i<a;)t.queue[i].callRejected(r);return t},o.resolve=function(e){return e instanceof this?e:r.resolve(new this(t),e)},o.reject=function(e){var n=new this(t);return r.reject(n,e)},o.all=function(e){var n=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var i=e.length,a=!1;if(!i)return this.resolve([]);for(var s=new Array(i),o=0,u=-1,c=new this(t);++u<i;)l(e[u],u);return c;function l(e,t){n.resolve(e).then((function(e){s[t]=e,++o!==i||a||(a=!0,r.resolve(c,s))}),(function(e){a||(a=!0,r.reject(c,e))}))}},o.race=function(e){var n=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var i=e.length,a=!1;if(!i)return this.resolve([]);for(var s,o=-1,u=new this(t);++o<i;)s=e[o],n.resolve(s).then((function(e){a||(a=!0,r.resolve(u,e))}),(function(e){a||(a=!0,r.reject(u,e))}));return u},fo}();var mo,vo={Promise:yo};function Co(){return mo||(mo=1,function(e){var t=os,r=co(),n=go,i=vo;function a(e){return e}function s(e,t){for(var r=0;r<e.length;++r)t[r]=255&e.charCodeAt(r);return t}e.newBlob=function(t,r){e.checkSupport("blob");try{return new Blob([t],{type:r})}catch(e){try{var n=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return n.append(t),n.getBlob(r)}catch(e){throw new Error("Bug : can't construct the Blob.")}}};var o={stringifyByChunk:function(e,t,r){var n=[],i=0,a=e.length;if(a<=r)return String.fromCharCode.apply(null,e);for(;i<a;)"array"===t||"nodebuffer"===t?n.push(String.fromCharCode.apply(null,e.slice(i,Math.min(i+r,a)))):n.push(String.fromCharCode.apply(null,e.subarray(i,Math.min(i+r,a)))),i+=r;return n.join("")},stringifyByChar:function(e){for(var t="",r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t},applyCanBeUsed:{uint8array:function(){try{return t.uint8array&&1===String.fromCharCode.apply(null,new Uint8Array(1)).length}catch(e){return!1}}(),nodebuffer:function(){try{return t.nodebuffer&&1===String.fromCharCode.apply(null,n.allocBuffer(1)).length}catch(e){return!1}}()}};function u(t){var r=65536,n=e.getTypeOf(t),i=!0;if("uint8array"===n?i=o.applyCanBeUsed.uint8array:"nodebuffer"===n&&(i=o.applyCanBeUsed.nodebuffer),i)for(;r>1;)try{return o.stringifyByChunk(t,n,r)}catch(e){r=Math.floor(r/2)}return o.stringifyByChar(t)}function c(e,t){for(var r=0;r<e.length;r++)t[r]=e[r];return t}e.applyFromCharCode=u;var l={};l.string={string:a,array:function(e){return s(e,new Array(e.length))},arraybuffer:function(e){return l.string.uint8array(e).buffer},uint8array:function(e){return s(e,new Uint8Array(e.length))},nodebuffer:function(e){return s(e,n.allocBuffer(e.length))}},l.array={string:u,array:a,arraybuffer:function(e){return new Uint8Array(e).buffer},uint8array:function(e){return new Uint8Array(e)},nodebuffer:function(e){return n.newBufferFrom(e)}},l.arraybuffer={string:function(e){return u(new Uint8Array(e))},array:function(e){return c(new Uint8Array(e),new Array(e.byteLength))},arraybuffer:a,uint8array:function(e){return new Uint8Array(e)},nodebuffer:function(e){return n.newBufferFrom(new Uint8Array(e))}},l.uint8array={string:u,array:function(e){return c(e,new Array(e.length))},arraybuffer:function(e){return e.buffer},uint8array:a,nodebuffer:function(e){return n.newBufferFrom(e)}},l.nodebuffer={string:u,array:function(e){return c(e,new Array(e.length))},arraybuffer:function(e){return l.nodebuffer.uint8array(e).buffer},uint8array:function(e){return c(e,new Uint8Array(e.length))},nodebuffer:a},e.transformTo=function(t,r){if(r||(r=""),!t)return r;e.checkSupport(t);var n=e.getTypeOf(r);return l[n][t](r)},e.resolve=function(e){for(var t=e.split("/"),r=[],n=0;n<t.length;n++){var i=t[n];"."===i||""===i&&0!==n&&n!==t.length-1||(".."===i?r.pop():r.push(i))}return r.join("/")},e.getTypeOf=function(e){return"string"==typeof e?"string":"[object Array]"===Object.prototype.toString.call(e)?"array":t.nodebuffer&&n.isBuffer(e)?"nodebuffer":t.uint8array&&e instanceof Uint8Array?"uint8array":t.arraybuffer&&e instanceof ArrayBuffer?"arraybuffer":void 0},e.checkSupport=function(e){if(!t[e.toLowerCase()])throw new Error(e+" is not supported by this platform")},e.MAX_VALUE_16BITS=65535,e.MAX_VALUE_32BITS=-1,e.pretty=function(e){var t,r,n="";for(r=0;r<(e||"").length;r++)n+="\\x"+((t=e.charCodeAt(r))<16?"0":"")+t.toString(16).toUpperCase();return n},e.delay=function(e,t,r){setImmediate((function(){e.apply(r||null,t||[])}))},e.inherits=function(e,t){var r=function(){};r.prototype=t.prototype,e.prototype=new r},e.extend=function(){var e,t,r={};for(e=0;e<arguments.length;e++)for(t in arguments[e])Object.prototype.hasOwnProperty.call(arguments[e],t)&&void 0===r[t]&&(r[t]=arguments[e][t]);return r},e.prepareContent=function(n,a,o,u,c){return i.Promise.resolve(a).then((function(e){return t.blob&&(e instanceof Blob||-1!==["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(e)))&&"undefined"!=typeof FileReader?new i.Promise((function(t,r){var n=new FileReader;n.onload=function(e){t(e.target.result)},n.onerror=function(e){r(e.target.error)},n.readAsArrayBuffer(e)})):e})).then((function(a){var l,h=e.getTypeOf(a);return h?("arraybuffer"===h?a=e.transformTo("uint8array",a):"string"===h&&(c?a=r.decode(a):o&&!0!==u&&(a=s(l=a,t.uint8array?new Uint8Array(l.length):new Array(l.length)))),a):i.Promise.reject(new Error("Can't read the data of '"+n+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))}))}}(ss)),ss}function Eo(e){this.name=e||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}!function(e,t){if(!e.setImmediate){var r,n,i,a,s,o=1,u={},c=!1,l=e.document,h=Object.getPrototypeOf&&Object.getPrototypeOf(e);h=h&&h.setTimeout?h:e,"[object process]"==={}.toString.call(e.process)?r=function(e){process.nextTick((function(){d(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}}()?e.MessageChannel?((i=new MessageChannel).port1.onmessage=function(e){d(e.data)},r=function(e){i.port2.postMessage(e)}):l&&"onreadystatechange"in l.createElement("script")?(n=l.documentElement,r=function(e){var t=l.createElement("script");t.onreadystatechange=function(){d(e),t.onreadystatechange=null,n.removeChild(t),t=null},n.appendChild(t)}):r=function(e){setTimeout(d,0,e)}:(a="setImmediate$"+Math.random()+"$",s=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(a)&&d(+t.data.slice(a.length))},e.addEventListener?e.addEventListener("message",s,!1):e.attachEvent("onmessage",s),r=function(t){e.postMessage(a+t,"*")}),h.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n<t.length;n++)t[n]=arguments[n+1];var i={callback:e,args:t};return u[o]=i,r(o),o++},h.clearImmediate=f}function f(e){delete u[e]}function d(e){if(c)setTimeout(d,0,e);else{var r=u[e];if(r){c=!0;try{!function(e){var r=e.callback,n=e.args;switch(n.length){case 0:r();break;case 1:r(n[0]);break;case 2:r(n[0],n[1]);break;case 3:r(n[0],n[1],n[2]);break;default:r.apply(t,n)}}(r)}finally{f(e),c=!1}}}}}("undefined"==typeof self?v:self),Eo.prototype={push:function(e){this.emit("data",e)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(e){this.emit("error",e)}return!0},error:function(e){return!this.isFinished&&(this.isPaused?this.generatedError=e:(this.isFinished=!0,this.emit("error",e),this.previous&&this.previous.error(e),this.cleanUp()),!0)},on:function(e,t){return this._listeners[e].push(t),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(e,t){if(this._listeners[e])for(var r=0;r<this._listeners[e].length;r++)this._listeners[e][r].call(this,t)},pipe:function(e){return e.registerPrevious(this)},registerPrevious:function(e){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=e.streamInfo,this.mergeStreamInfo(),this.previous=e;var t=this;return e.on("data",(function(e){t.processChunk(e)})),e.on("end",(function(){t.end()})),e.on("error",(function(e){t.error(e)})),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;this.isPaused=!1;var e=!1;return this.generatedError&&(this.error(this.generatedError),e=!0),this.previous&&this.previous.resume(),!e},flush:function(){},processChunk:function(e){this.push(e)},withStreamInfo:function(e,t){return this.extraStreamInfo[e]=t,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var e in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,e)&&(this.streamInfo[e]=this.extraStreamInfo[e])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var e="Worker "+this.name;return this.previous?this.previous+" -> "+e:e}};var bo=Eo;!function(e){for(var t=Co(),r=os,n=go,i=bo,a=new Array(256),s=0;s<256;s++)a[s]=s>=252?6:s>=248?5:s>=240?4:s>=224?3:s>=192?2:1;a[254]=a[254]=1;function o(){i.call(this,"utf-8 decode"),this.leftOver=null}function u(){i.call(this,"utf-8 encode")}e.utf8encode=function(e){return r.nodebuffer?n.newBufferFrom(e,"utf-8"):function(e){var t,n,i,a,s,o=e.length,u=0;for(a=0;a<o;a++)55296==(64512&(n=e.charCodeAt(a)))&&a+1<o&&56320==(64512&(i=e.charCodeAt(a+1)))&&(n=65536+(n-55296<<10)+(i-56320),a++),u+=n<128?1:n<2048?2:n<65536?3:4;for(t=r.uint8array?new Uint8Array(u):new Array(u),s=0,a=0;s<u;a++)55296==(64512&(n=e.charCodeAt(a)))&&a+1<o&&56320==(64512&(i=e.charCodeAt(a+1)))&&(n=65536+(n-55296<<10)+(i-56320),a++),n<128?t[s++]=n:n<2048?(t[s++]=192|n>>>6,t[s++]=128|63&n):n<65536?(t[s++]=224|n>>>12,t[s++]=128|n>>>6&63,t[s++]=128|63&n):(t[s++]=240|n>>>18,t[s++]=128|n>>>12&63,t[s++]=128|n>>>6&63,t[s++]=128|63&n);return t}(e)},e.utf8decode=function(e){return r.nodebuffer?t.transformTo("nodebuffer",e).toString("utf-8"):function(e){var r,n,i,s,o=e.length,u=new Array(2*o);for(n=0,r=0;r<o;)if((i=e[r++])<128)u[n++]=i;else if((s=a[i])>4)u[n++]=65533,r+=s-1;else{for(i&=2===s?31:3===s?15:7;s>1&&r<o;)i=i<<6|63&e[r++],s--;s>1?u[n++]=65533:i<65536?u[n++]=i:(i-=65536,u[n++]=55296|i>>10&1023,u[n++]=56320|1023&i)}return u.length!==n&&(u.subarray?u=u.subarray(0,n):u.length=n),t.applyFromCharCode(u)}(e=t.transformTo(r.uint8array?"uint8array":"array",e))},t.inherits(o,i),o.prototype.processChunk=function(n){var i=t.transformTo(r.uint8array?"uint8array":"array",n.data);if(this.leftOver&&this.leftOver.length){if(r.uint8array){var s=i;(i=new Uint8Array(s.length+this.leftOver.length)).set(this.leftOver,0),i.set(s,this.leftOver.length)}else i=this.leftOver.concat(i);this.leftOver=null}var o=function(e,t){var r;for((t=t||e.length)>e.length&&(t=e.length),r=t-1;r>=0&&128==(192&e[r]);)r--;return r<0||0===r?t:r+a[e[r]]>t?r:t}(i),u=i;o!==i.length&&(r.uint8array?(u=i.subarray(0,o),this.leftOver=i.subarray(o,i.length)):(u=i.slice(0,o),this.leftOver=i.slice(o,i.length))),this.push({data:e.utf8decode(u),meta:n.meta})},o.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:e.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},e.Utf8DecodeWorker=o,t.inherits(u,i),u.prototype.processChunk=function(t){this.push({data:e.utf8encode(t.data),meta:t.meta})},e.Utf8EncodeWorker=u}(as);var So=bo,To=Co();function _o(e){So.call(this,"ConvertWorker to "+e),this.destType=e}To.inherits(_o,So),_o.prototype.processChunk=function(e){this.push({data:To.transformTo(this.destType,e.data),meta:e.meta})};var wo,Io,Ao=_o;var Bo=Co(),ko=Ao,No=bo,Ro=co(),Lo=vo,Do=null;if(os.nodestream)try{Do=function(){if(Io)return wo;Io=1;var e=io().Readable;function t(t,r,n){e.call(this,r),this._helper=t;var i=this;t.on("data",(function(e,t){i.push(e)||i._helper.pause(),n&&n(t)})).on("error",(function(e){i.emit("error",e)})).on("end",(function(){i.push(null)}))}return Co().inherits(t,e),t.prototype._read=function(){this._helper.resume()},wo=t}()}catch(e){}function Uo(e,t){return new Lo.Promise((function(r,n){var i=[],a=e._internalType,s=e._outputType,o=e._mimeType;e.on("data",(function(e,r){i.push(e),t&&t(r)})).on("error",(function(e){i=[],n(e)})).on("end",(function(){try{var e=function(e,t,r){switch(e){case"blob":return Bo.newBlob(Bo.transformTo("arraybuffer",t),r);case"base64":return Ro.encode(t);default:return Bo.transformTo(e,t)}}(s,function(e,t){var r,n=0,i=null,a=0;for(r=0;r<t.length;r++)a+=t[r].length;switch(e){case"string":return t.join("");case"array":return Array.prototype.concat.apply([],t);case"uint8array":for(i=new Uint8Array(a),r=0;r<t.length;r++)i.set(t[r],n),n+=t[r].length;return i;case"nodebuffer":return Buffer.concat(t);default:throw new Error("concat : unsupported type '"+e+"'")}}(a,i),o);r(e)}catch(e){n(e)}i=[]})).resume()}))}function xo(e,t,r){var n=t;switch(t){case"blob":case"arraybuffer":n="uint8array";break;case"base64":n="string"}try{this._internalType=n,this._outputType=t,this._mimeType=r,Bo.checkSupport(n),this._worker=e.pipe(new ko(n)),e.lock()}catch(e){this._worker=new No("error"),this._worker.error(e)}}xo.prototype={accumulate:function(e){return Uo(this,e)},on:function(e,t){var r=this;return"data"===e?this._worker.on(e,(function(e){t.call(r,e.data,e.meta)})):this._worker.on(e,(function(){Bo.delay(t,arguments,r)})),this},resume:function(){return Bo.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(e){if(Bo.checkSupport("nodestream"),"nodebuffer"!==this._outputType)throw new Error(this._outputType+" is not supported by this method");return new Do(this,{objectMode:"nodebuffer"!==this._outputType},e)}};var Oo=xo,Po={base64:!1,binary:!1,dir:!1,createFolders:!0,date:null,compression:null,compressionOptions:null,comment:null,unixPermissions:null,dosPermissions:null},Vo=Co(),Ko=bo;function Mo(e){Ko.call(this,"DataWorker");var t=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,e.then((function(e){t.dataIsReady=!0,t.data=e,t.max=e&&e.length||0,t.type=Vo.getTypeOf(e),t.isPaused||t._tickAndRepeat()}),(function(e){t.error(e)}))}Vo.inherits(Mo,Ko),Mo.prototype.cleanUp=function(){Ko.prototype.cleanUp.call(this),this.data=null},Mo.prototype.resume=function(){return!!Ko.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,Vo.delay(this._tickAndRepeat,[],this)),!0)},Mo.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(Vo.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},Mo.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var e=null,t=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":e=this.data.substring(this.index,t);break;case"uint8array":e=this.data.subarray(this.index,t);break;case"array":case"nodebuffer":e=this.data.slice(this.index,t)}return this.index=t,this.push({data:e,meta:{percent:this.max?this.index/this.max*100:0}})};var Fo=Mo,zo=Co();var jo=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();var qo=function(e,t){return void 0!==e&&e.length?"string"!==zo.getTypeOf(e)?function(e,t,r,n){var i=jo,a=n+r;e^=-1;for(var s=n;s<a;s++)e=e>>>8^i[255&(e^t[s])];return-1^e}(0|t,e,e.length,0):function(e,t,r,n){var i=jo,a=n+r;e^=-1;for(var s=n;s<a;s++)e=e>>>8^i[255&(e^t.charCodeAt(s))];return-1^e}(0|t,e,e.length,0):0},Ho=bo,Go=qo;function Wo(){Ho.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}Co().inherits(Wo,Ho),Wo.prototype.processChunk=function(e){this.streamInfo.crc32=Go(e.data,this.streamInfo.crc32||0),this.push(e)};var Qo=Wo,Yo=Co(),Zo=bo;function Xo(e){Zo.call(this,"DataLengthProbe for "+e),this.propName=e,this.withStreamInfo(e,0)}Yo.inherits(Xo,Zo),Xo.prototype.processChunk=function(e){if(e){var t=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=t+e.data.length}Zo.prototype.processChunk.call(this,e)};var $o=vo,Jo=Fo,eu=Qo,tu=Xo;function ru(e,t,r,n,i){this.compressedSize=e,this.uncompressedSize=t,this.crc32=r,this.compression=n,this.compressedContent=i}ru.prototype={getContentWorker:function(){var e=new Jo($o.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new tu("data_length")),t=this;return e.on("end",(function(){if(this.streamInfo.data_length!==t.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")})),e},getCompressedWorker:function(){return new Jo($o.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},ru.createWorkerFrom=function(e,t,r){return e.pipe(new eu).pipe(new tu("uncompressedSize")).pipe(t.compressWorker(r)).pipe(new tu("compressedSize")).withStreamInfo("compression",t)};var nu=ru,iu=Oo,au=Fo,su=as,ou=nu,uu=bo,cu=function(e,t,r){this.name=e,this.dir=r.dir,this.date=r.date,this.comment=r.comment,this.unixPermissions=r.unixPermissions,this.dosPermissions=r.dosPermissions,this._data=t,this._dataBinary=r.binary,this.options={compression:r.compression,compressionOptions:r.compressionOptions}};cu.prototype={internalStream:function(e){var t=null,r="string";try{if(!e)throw new Error("No output type specified.");var n="string"===(r=e.toLowerCase())||"text"===r;"binarystring"!==r&&"text"!==r||(r="string"),t=this._decompressWorker();var i=!this._dataBinary;i&&!n&&(t=t.pipe(new su.Utf8EncodeWorker)),!i&&n&&(t=t.pipe(new su.Utf8DecodeWorker))}catch(e){(t=new uu("error")).error(e)}return new iu(t,r,"")},async:function(e,t){return this.internalStream(e).accumulate(t)},nodeStream:function(e,t){return this.internalStream(e||"nodebuffer").toNodejsStream(t)},_compressWorker:function(e,t){if(this._data instanceof ou&&this._data.compression.magic===e.magic)return this._data.getCompressedWorker();var r=this._decompressWorker();return this._dataBinary||(r=r.pipe(new su.Utf8EncodeWorker)),ou.createWorkerFrom(r,e,t)},_decompressWorker:function(){return this._data instanceof ou?this._data.getContentWorker():this._data instanceof uu?this._data:new au(this._data)}};for(var lu=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],hu=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},fu=0;fu<lu.length;fu++)cu.prototype[lu[fu]]=hu;var du=cu,pu={},gu={},yu={},mu={};!function(e){var t="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;function r(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var n=t.shift();if(n){if("object"!=typeof n)throw new TypeError(n+"must be non-object");for(var i in n)r(n,i)&&(e[i]=n[i])}}return e},e.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var n={arraySet:function(e,t,r,n,i){if(t.subarray&&e.subarray)e.set(t.subarray(r,r+n),i);else for(var a=0;a<n;a++)e[i+a]=t[r+a]},flattenChunks:function(e){var t,r,n,i,a,s;for(n=0,t=0,r=e.length;t<r;t++)n+=e[t].length;for(s=new Uint8Array(n),i=0,t=0,r=e.length;t<r;t++)a=e[t],s.set(a,i),i+=a.length;return s}},i={arraySet:function(e,t,r,n,i){for(var a=0;a<n;a++)e[i+a]=t[r+a]},flattenChunks:function(e){return[].concat.apply([],e)}};e.setTyped=function(t){t?(e.Buf8=Uint8Array,e.Buf16=Uint16Array,e.Buf32=Int32Array,e.assign(e,n)):(e.Buf8=Array,e.Buf16=Array,e.Buf32=Array,e.assign(e,i))},e.setTyped(t)}(mu);var vu={},Cu={},Eu={},bu=mu,Su=0,Tu=1;function _u(e){for(var t=e.length;--t>=0;)e[t]=0}var wu=0,Iu=29,Au=256,Bu=Au+1+Iu,ku=30,Nu=19,Ru=2*Bu+1,Lu=15,Du=16,Uu=7,xu=256,Ou=16,Pu=17,Vu=18,Ku=[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],Mu=[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],Fu=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],zu=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],ju=new Array(2*(Bu+2));_u(ju);var qu=new Array(2*ku);_u(qu);var Hu=new Array(512);_u(Hu);var Gu=new Array(256);_u(Gu);var Wu=new Array(Iu);_u(Wu);var Qu,Yu,Zu,Xu=new Array(ku);function $u(e,t,r,n,i){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=e&&e.length}function Ju(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function ec(e){return e<256?Hu[e]:Hu[256+(e>>>7)]}function tc(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function rc(e,t,r){e.bi_valid>Du-r?(e.bi_buf|=t<<e.bi_valid&65535,tc(e,e.bi_buf),e.bi_buf=t>>Du-e.bi_valid,e.bi_valid+=r-Du):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=r)}function nc(e,t,r){rc(e,r[2*t],r[2*t+1])}function ic(e,t){var r=0;do{r|=1&e,e>>>=1,r<<=1}while(--t>0);return r>>>1}function ac(e,t,r){var n,i,a=new Array(Lu+1),s=0;for(n=1;n<=Lu;n++)a[n]=s=s+r[n-1]<<1;for(i=0;i<=t;i++){var o=e[2*i+1];0!==o&&(e[2*i]=ic(a[o]++,o))}}function sc(e){var t;for(t=0;t<Bu;t++)e.dyn_ltree[2*t]=0;for(t=0;t<ku;t++)e.dyn_dtree[2*t]=0;for(t=0;t<Nu;t++)e.bl_tree[2*t]=0;e.dyn_ltree[2*xu]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function oc(e){e.bi_valid>8?tc(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function uc(e,t,r,n){var i=2*t,a=2*r;return e[i]<e[a]||e[i]===e[a]&&n[t]<=n[r]}function cc(e,t,r){for(var n=e.heap[r],i=r<<1;i<=e.heap_len&&(i<e.heap_len&&uc(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!uc(t,n,e.heap[i],e.depth));)e.heap[r]=e.heap[i],r=i,i<<=1;e.heap[r]=n}function lc(e,t,r){var n,i,a,s,o=0;if(0!==e.last_lit)do{n=e.pending_buf[e.d_buf+2*o]<<8|e.pending_buf[e.d_buf+2*o+1],i=e.pending_buf[e.l_buf+o],o++,0===n?nc(e,i,t):(nc(e,(a=Gu[i])+Au+1,t),0!==(s=Ku[a])&&rc(e,i-=Wu[a],s),nc(e,a=ec(--n),r),0!==(s=Mu[a])&&rc(e,n-=Xu[a],s))}while(o<e.last_lit);nc(e,xu,t)}function hc(e,t){var r,n,i,a=t.dyn_tree,s=t.stat_desc.static_tree,o=t.stat_desc.has_stree,u=t.stat_desc.elems,c=-1;for(e.heap_len=0,e.heap_max=Ru,r=0;r<u;r++)0!==a[2*r]?(e.heap[++e.heap_len]=c=r,e.depth[r]=0):a[2*r+1]=0;for(;e.heap_len<2;)a[2*(i=e.heap[++e.heap_len]=c<2?++c:0)]=1,e.depth[i]=0,e.opt_len--,o&&(e.static_len-=s[2*i+1]);for(t.max_code=c,r=e.heap_len>>1;r>=1;r--)cc(e,a,r);i=u;do{r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],cc(e,a,1),n=e.heap[1],e.heap[--e.heap_max]=r,e.heap[--e.heap_max]=n,a[2*i]=a[2*r]+a[2*n],e.depth[i]=(e.depth[r]>=e.depth[n]?e.depth[r]:e.depth[n])+1,a[2*r+1]=a[2*n+1]=i,e.heap[1]=i++,cc(e,a,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],function(e,t){var r,n,i,a,s,o,u=t.dyn_tree,c=t.max_code,l=t.stat_desc.static_tree,h=t.stat_desc.has_stree,f=t.stat_desc.extra_bits,d=t.stat_desc.extra_base,p=t.stat_desc.max_length,g=0;for(a=0;a<=Lu;a++)e.bl_count[a]=0;for(u[2*e.heap[e.heap_max]+1]=0,r=e.heap_max+1;r<Ru;r++)(a=u[2*u[2*(n=e.heap[r])+1]+1]+1)>p&&(a=p,g++),u[2*n+1]=a,n>c||(e.bl_count[a]++,s=0,n>=d&&(s=f[n-d]),o=u[2*n],e.opt_len+=o*(a+s),h&&(e.static_len+=o*(l[2*n+1]+s)));if(0!==g){do{for(a=p-1;0===e.bl_count[a];)a--;e.bl_count[a]--,e.bl_count[a+1]+=2,e.bl_count[p]--,g-=2}while(g>0);for(a=p;0!==a;a--)for(n=e.bl_count[a];0!==n;)(i=e.heap[--r])>c||(u[2*i+1]!==a&&(e.opt_len+=(a-u[2*i+1])*u[2*i],u[2*i+1]=a),n--)}}(e,t),ac(a,c,e.bl_count)}function fc(e,t,r){var n,i,a=-1,s=t[1],o=0,u=7,c=4;for(0===s&&(u=138,c=3),t[2*(r+1)+1]=65535,n=0;n<=r;n++)i=s,s=t[2*(n+1)+1],++o<u&&i===s||(o<c?e.bl_tree[2*i]+=o:0!==i?(i!==a&&e.bl_tree[2*i]++,e.bl_tree[2*Ou]++):o<=10?e.bl_tree[2*Pu]++:e.bl_tree[2*Vu]++,o=0,a=i,0===s?(u=138,c=3):i===s?(u=6,c=3):(u=7,c=4))}function dc(e,t,r){var n,i,a=-1,s=t[1],o=0,u=7,c=4;for(0===s&&(u=138,c=3),n=0;n<=r;n++)if(i=s,s=t[2*(n+1)+1],!(++o<u&&i===s)){if(o<c)do{nc(e,i,e.bl_tree)}while(0!=--o);else 0!==i?(i!==a&&(nc(e,i,e.bl_tree),o--),nc(e,Ou,e.bl_tree),rc(e,o-3,2)):o<=10?(nc(e,Pu,e.bl_tree),rc(e,o-3,3)):(nc(e,Vu,e.bl_tree),rc(e,o-11,7));o=0,a=i,0===s?(u=138,c=3):i===s?(u=6,c=3):(u=7,c=4)}}_u(Xu);var pc=!1;function gc(e,t,r,n){rc(e,(wu<<1)+(n?1:0),3),function(e,t,r,n){oc(e),n&&(tc(e,r),tc(e,~r)),bu.arraySet(e.pending_buf,e.window,t,r,e.pending),e.pending+=r}(e,t,r,!0)}Eu._tr_init=function(e){pc||(!function(){var e,t,r,n,i,a=new Array(Lu+1);for(r=0,n=0;n<Iu-1;n++)for(Wu[n]=r,e=0;e<1<<Ku[n];e++)Gu[r++]=n;for(Gu[r-1]=n,i=0,n=0;n<16;n++)for(Xu[n]=i,e=0;e<1<<Mu[n];e++)Hu[i++]=n;for(i>>=7;n<ku;n++)for(Xu[n]=i<<7,e=0;e<1<<Mu[n]-7;e++)Hu[256+i++]=n;for(t=0;t<=Lu;t++)a[t]=0;for(e=0;e<=143;)ju[2*e+1]=8,e++,a[8]++;for(;e<=255;)ju[2*e+1]=9,e++,a[9]++;for(;e<=279;)ju[2*e+1]=7,e++,a[7]++;for(;e<=287;)ju[2*e+1]=8,e++,a[8]++;for(ac(ju,Bu+1,a),e=0;e<ku;e++)qu[2*e+1]=5,qu[2*e]=ic(e,5);Qu=new $u(ju,Ku,Au+1,Bu,Lu),Yu=new $u(qu,Mu,0,ku,Lu),Zu=new $u(new Array(0),Fu,0,Nu,Uu)}(),pc=!0),e.l_desc=new Ju(e.dyn_ltree,Qu),e.d_desc=new Ju(e.dyn_dtree,Yu),e.bl_desc=new Ju(e.bl_tree,Zu),e.bi_buf=0,e.bi_valid=0,sc(e)},Eu._tr_stored_block=gc,Eu._tr_flush_block=function(e,t,r,n){var i,a,s=0;e.level>0?(2===e.strm.data_type&&(e.strm.data_type=function(e){var t,r=4093624447;for(t=0;t<=31;t++,r>>>=1)if(1&r&&0!==e.dyn_ltree[2*t])return Su;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return Tu;for(t=32;t<Au;t++)if(0!==e.dyn_ltree[2*t])return Tu;return Su}(e)),hc(e,e.l_desc),hc(e,e.d_desc),s=function(e){var t;for(fc(e,e.dyn_ltree,e.l_desc.max_code),fc(e,e.dyn_dtree,e.d_desc.max_code),hc(e,e.bl_desc),t=Nu-1;t>=3&&0===e.bl_tree[2*zu[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),i=e.opt_len+3+7>>>3,(a=e.static_len+3+7>>>3)<=i&&(i=a)):i=a=r+5,r+4<=i&&-1!==t?gc(e,t,r,n):4===e.strategy||a===i?(rc(e,2+(n?1:0),3),lc(e,ju,qu)):(rc(e,4+(n?1:0),3),function(e,t,r,n){var i;for(rc(e,t-257,5),rc(e,r-1,5),rc(e,n-4,4),i=0;i<n;i++)rc(e,e.bl_tree[2*zu[i]+1],3);dc(e,e.dyn_ltree,t-1),dc(e,e.dyn_dtree,r-1)}(e,e.l_desc.max_code+1,e.d_desc.max_code+1,s+1),lc(e,e.dyn_ltree,e.dyn_dtree)),sc(e),n&&oc(e)},Eu._tr_tally=function(e,t,r){return e.pending_buf[e.d_buf+2*e.last_lit]=t>>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&r,e.last_lit++,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(Gu[r]+Au+1)]++,e.dyn_dtree[2*ec(t)]++),e.last_lit===e.lit_bufsize-1},Eu._tr_align=function(e){rc(e,2,3),nc(e,xu,ju),function(e){16===e.bi_valid?(tc(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)};var yc=function(e,t,r,n){for(var i=65535&e|0,a=e>>>16&65535|0,s=0;0!==r;){r-=s=r>2e3?2e3:r;do{a=a+(i=i+t[n++]|0)|0}while(--s);i%=65521,a%=65521}return i|a<<16|0};var mc=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();var vc,Cc=function(e,t,r,n){var i=mc,a=n+r;e^=-1;for(var s=n;s<a;s++)e=e>>>8^i[255&(e^t[s])];return-1^e},Ec={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},bc=mu,Sc=Eu,Tc=yc,_c=Cc,wc=Ec,Ic=0,Ac=4,Bc=0,kc=-2,Nc=-1,Rc=4,Lc=2,Dc=8,Uc=9,xc=286,Oc=30,Pc=19,Vc=2*xc+1,Kc=15,Mc=3,Fc=258,zc=Fc+Mc+1,jc=42,qc=103,Hc=113,Gc=666,Wc=1,Qc=2,Yc=3,Zc=4;function Xc(e,t){return e.msg=wc[t],t}function $c(e){return(e<<1)-(e>4?9:0)}function Jc(e){for(var t=e.length;--t>=0;)e[t]=0}function el(e){var t=e.state,r=t.pending;r>e.avail_out&&(r=e.avail_out),0!==r&&(bc.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))}function tl(e,t){Sc._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,el(e.strm)}function rl(e,t){e.pending_buf[e.pending++]=t}function nl(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function il(e,t,r,n){var i=e.avail_in;return i>n&&(i=n),0===i?0:(e.avail_in-=i,bc.arraySet(t,e.input,e.next_in,i,r),1===e.state.wrap?e.adler=Tc(e.adler,t,i,r):2===e.state.wrap&&(e.adler=_c(e.adler,t,i,r)),e.next_in+=i,e.total_in+=i,i)}function al(e,t){var r,n,i=e.max_chain_length,a=e.strstart,s=e.prev_length,o=e.nice_match,u=e.strstart>e.w_size-zc?e.strstart-(e.w_size-zc):0,c=e.window,l=e.w_mask,h=e.prev,f=e.strstart+Fc,d=c[a+s-1],p=c[a+s];e.prev_length>=e.good_match&&(i>>=2),o>e.lookahead&&(o=e.lookahead);do{if(c[(r=t)+s]===p&&c[r+s-1]===d&&c[r]===c[a]&&c[++r]===c[a+1]){a+=2,r++;do{}while(c[++a]===c[++r]&&c[++a]===c[++r]&&c[++a]===c[++r]&&c[++a]===c[++r]&&c[++a]===c[++r]&&c[++a]===c[++r]&&c[++a]===c[++r]&&c[++a]===c[++r]&&a<f);if(n=Fc-(f-a),a=f-Fc,n>s){if(e.match_start=t,s=n,n>=o)break;d=c[a+s-1],p=c[a+s]}}}while((t=h[t&l])>u&&0!=--i);return s<=e.lookahead?s:e.lookahead}function sl(e){var t,r,n,i,a,s=e.w_size;do{if(i=e.window_size-e.lookahead-e.strstart,e.strstart>=s+(s-zc)){bc.arraySet(e.window,e.window,s,s,0),e.match_start-=s,e.strstart-=s,e.block_start-=s,t=r=e.hash_size;do{n=e.head[--t],e.head[t]=n>=s?n-s:0}while(--r);t=r=s;do{n=e.prev[--t],e.prev[t]=n>=s?n-s:0}while(--r);i+=s}if(0===e.strm.avail_in)break;if(r=il(e.strm,e.window,e.strstart+e.lookahead,i),e.lookahead+=r,e.lookahead+e.insert>=Mc)for(a=e.strstart-e.insert,e.ins_h=e.window[a],e.ins_h=(e.ins_h<<e.hash_shift^e.window[a+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[a+Mc-1])&e.hash_mask,e.prev[a&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=a,a++,e.insert--,!(e.lookahead+e.insert<Mc)););}while(e.lookahead<zc&&0!==e.strm.avail_in)}function ol(e,t){for(var r,n;;){if(e.lookahead<zc){if(sl(e),e.lookahead<zc&&t===Ic)return Wc;if(0===e.lookahead)break}if(r=0,e.lookahead>=Mc&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+Mc-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==r&&e.strstart-r<=e.w_size-zc&&(e.match_length=al(e,r)),e.match_length>=Mc)if(n=Sc._tr_tally(e,e.strstart-e.match_start,e.match_length-Mc),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=Mc){e.match_length--;do{e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+Mc-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart}while(0!=--e.match_length);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else n=Sc._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(n&&(tl(e,!1),0===e.strm.avail_out))return Wc}return e.insert=e.strstart<Mc-1?e.strstart:Mc-1,t===Ac?(tl(e,!0),0===e.strm.avail_out?Yc:Zc):e.last_lit&&(tl(e,!1),0===e.strm.avail_out)?Wc:Qc}function ul(e,t){for(var r,n,i;;){if(e.lookahead<zc){if(sl(e),e.lookahead<zc&&t===Ic)return Wc;if(0===e.lookahead)break}if(r=0,e.lookahead>=Mc&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+Mc-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=Mc-1,0!==r&&e.prev_length<e.max_lazy_match&&e.strstart-r<=e.w_size-zc&&(e.match_length=al(e,r),e.match_length<=5&&(1===e.strategy||e.match_length===Mc&&e.strstart-e.match_start>4096)&&(e.match_length=Mc-1)),e.prev_length>=Mc&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-Mc,n=Sc._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-Mc),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=i&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+Mc-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart)}while(0!=--e.prev_length);if(e.match_available=0,e.match_length=Mc-1,e.strstart++,n&&(tl(e,!1),0===e.strm.avail_out))return Wc}else if(e.match_available){if((n=Sc._tr_tally(e,0,e.window[e.strstart-1]))&&tl(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return Wc}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(n=Sc._tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<Mc-1?e.strstart:Mc-1,t===Ac?(tl(e,!0),0===e.strm.avail_out?Yc:Zc):e.last_lit&&(tl(e,!1),0===e.strm.avail_out)?Wc:Qc}function cl(e,t,r,n,i){this.good_length=e,this.max_lazy=t,this.nice_length=r,this.max_chain=n,this.func=i}function ll(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=Dc,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new bc.Buf16(2*Vc),this.dyn_dtree=new bc.Buf16(2*(2*Oc+1)),this.bl_tree=new bc.Buf16(2*(2*Pc+1)),Jc(this.dyn_ltree),Jc(this.dyn_dtree),Jc(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new bc.Buf16(Kc+1),this.heap=new bc.Buf16(2*xc+1),Jc(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new bc.Buf16(2*xc+1),Jc(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function hl(e){var t;return e&&e.state?(e.total_in=e.total_out=0,e.data_type=Lc,(t=e.state).pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?jc:Hc,e.adler=2===t.wrap?0:1,t.last_flush=Ic,Sc._tr_init(t),Bc):Xc(e,kc)}function fl(e){var t=hl(e);return t===Bc&&function(e){e.window_size=2*e.w_size,Jc(e.head),e.max_lazy_match=vc[e.level].max_lazy,e.good_match=vc[e.level].good_length,e.nice_match=vc[e.level].nice_length,e.max_chain_length=vc[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=Mc-1,e.match_available=0,e.ins_h=0}(e.state),t}function dl(e,t,r,n,i,a){if(!e)return kc;var s=1;if(t===Nc&&(t=6),n<0?(s=0,n=-n):n>15&&(s=2,n-=16),i<1||i>Uc||r!==Dc||n<8||n>15||t<0||t>9||a<0||a>Rc)return Xc(e,kc);8===n&&(n=9);var o=new ll;return e.state=o,o.strm=e,o.wrap=s,o.gzhead=null,o.w_bits=n,o.w_size=1<<o.w_bits,o.w_mask=o.w_size-1,o.hash_bits=i+7,o.hash_size=1<<o.hash_bits,o.hash_mask=o.hash_size-1,o.hash_shift=~~((o.hash_bits+Mc-1)/Mc),o.window=new bc.Buf8(2*o.w_size),o.head=new bc.Buf16(o.hash_size),o.prev=new bc.Buf16(o.w_size),o.lit_bufsize=1<<i+6,o.pending_buf_size=4*o.lit_bufsize,o.pending_buf=new bc.Buf8(o.pending_buf_size),o.d_buf=1*o.lit_bufsize,o.l_buf=3*o.lit_bufsize,o.level=t,o.strategy=a,o.method=r,fl(e)}vc=[new cl(0,0,0,0,(function(e,t){var r=65535;for(r>e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(sl(e),0===e.lookahead&&t===Ic)return Wc;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var n=e.block_start+r;if((0===e.strstart||e.strstart>=n)&&(e.lookahead=e.strstart-n,e.strstart=n,tl(e,!1),0===e.strm.avail_out))return Wc;if(e.strstart-e.block_start>=e.w_size-zc&&(tl(e,!1),0===e.strm.avail_out))return Wc}return e.insert=0,t===Ac?(tl(e,!0),0===e.strm.avail_out?Yc:Zc):(e.strstart>e.block_start&&(tl(e,!1),e.strm.avail_out),Wc)})),new cl(4,4,8,4,ol),new cl(4,5,16,8,ol),new cl(4,6,32,32,ol),new cl(4,4,16,16,ul),new cl(8,16,32,32,ul),new cl(8,16,128,128,ul),new cl(8,32,128,256,ul),new cl(32,128,258,1024,ul),new cl(32,258,258,4096,ul)],Cu.deflateInit=function(e,t){return dl(e,t,Dc,15,8,0)},Cu.deflateInit2=dl,Cu.deflateReset=fl,Cu.deflateResetKeep=hl,Cu.deflateSetHeader=function(e,t){return e&&e.state?2!==e.state.wrap?kc:(e.state.gzhead=t,Bc):kc},Cu.deflate=function(e,t){var r,n,i,a;if(!e||!e.state||t>5||t<0)return e?Xc(e,kc):kc;if(n=e.state,!e.output||!e.input&&0!==e.avail_in||n.status===Gc&&t!==Ac)return Xc(e,0===e.avail_out?-5:kc);if(n.strm=e,r=n.last_flush,n.last_flush=t,n.status===jc)if(2===n.wrap)e.adler=0,rl(n,31),rl(n,139),rl(n,8),n.gzhead?(rl(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),rl(n,255&n.gzhead.time),rl(n,n.gzhead.time>>8&255),rl(n,n.gzhead.time>>16&255),rl(n,n.gzhead.time>>24&255),rl(n,9===n.level?2:n.strategy>=2||n.level<2?4:0),rl(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(rl(n,255&n.gzhead.extra.length),rl(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=_c(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=69):(rl(n,0),rl(n,0),rl(n,0),rl(n,0),rl(n,0),rl(n,9===n.level?2:n.strategy>=2||n.level<2?4:0),rl(n,3),n.status=Hc);else{var s=Dc+(n.w_bits-8<<4)<<8;s|=(n.strategy>=2||n.level<2?0:n.level<6?1:6===n.level?2:3)<<6,0!==n.strstart&&(s|=32),s+=31-s%31,n.status=Hc,nl(n,s),0!==n.strstart&&(nl(n,e.adler>>>16),nl(n,65535&e.adler)),e.adler=1}if(69===n.status)if(n.gzhead.extra){for(i=n.pending;n.gzindex<(65535&n.gzhead.extra.length)&&(n.pending!==n.pending_buf_size||(n.gzhead.hcrc&&n.pending>i&&(e.adler=_c(e.adler,n.pending_buf,n.pending-i,i)),el(e),i=n.pending,n.pending!==n.pending_buf_size));)rl(n,255&n.gzhead.extra[n.gzindex]),n.gzindex++;n.gzhead.hcrc&&n.pending>i&&(e.adler=_c(e.adler,n.pending_buf,n.pending-i,i)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=73)}else n.status=73;if(73===n.status)if(n.gzhead.name){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(e.adler=_c(e.adler,n.pending_buf,n.pending-i,i)),el(e),i=n.pending,n.pending===n.pending_buf_size)){a=1;break}a=n.gzindex<n.gzhead.name.length?255&n.gzhead.name.charCodeAt(n.gzindex++):0,rl(n,a)}while(0!==a);n.gzhead.hcrc&&n.pending>i&&(e.adler=_c(e.adler,n.pending_buf,n.pending-i,i)),0===a&&(n.gzindex=0,n.status=91)}else n.status=91;if(91===n.status)if(n.gzhead.comment){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(e.adler=_c(e.adler,n.pending_buf,n.pending-i,i)),el(e),i=n.pending,n.pending===n.pending_buf_size)){a=1;break}a=n.gzindex<n.gzhead.comment.length?255&n.gzhead.comment.charCodeAt(n.gzindex++):0,rl(n,a)}while(0!==a);n.gzhead.hcrc&&n.pending>i&&(e.adler=_c(e.adler,n.pending_buf,n.pending-i,i)),0===a&&(n.status=qc)}else n.status=qc;if(n.status===qc&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&el(e),n.pending+2<=n.pending_buf_size&&(rl(n,255&e.adler),rl(n,e.adler>>8&255),e.adler=0,n.status=Hc)):n.status=Hc),0!==n.pending){if(el(e),0===e.avail_out)return n.last_flush=-1,Bc}else if(0===e.avail_in&&$c(t)<=$c(r)&&t!==Ac)return Xc(e,-5);if(n.status===Gc&&0!==e.avail_in)return Xc(e,-5);if(0!==e.avail_in||0!==n.lookahead||t!==Ic&&n.status!==Gc){var o=2===n.strategy?function(e,t){for(var r;;){if(0===e.lookahead&&(sl(e),0===e.lookahead)){if(t===Ic)return Wc;break}if(e.match_length=0,r=Sc._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(tl(e,!1),0===e.strm.avail_out))return Wc}return e.insert=0,t===Ac?(tl(e,!0),0===e.strm.avail_out?Yc:Zc):e.last_lit&&(tl(e,!1),0===e.strm.avail_out)?Wc:Qc}(n,t):3===n.strategy?function(e,t){for(var r,n,i,a,s=e.window;;){if(e.lookahead<=Fc){if(sl(e),e.lookahead<=Fc&&t===Ic)return Wc;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=Mc&&e.strstart>0&&(n=s[i=e.strstart-1])===s[++i]&&n===s[++i]&&n===s[++i]){a=e.strstart+Fc;do{}while(n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&i<a);e.match_length=Fc-(a-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=Mc?(r=Sc._tr_tally(e,1,e.match_length-Mc),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=Sc._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(tl(e,!1),0===e.strm.avail_out))return Wc}return e.insert=0,t===Ac?(tl(e,!0),0===e.strm.avail_out?Yc:Zc):e.last_lit&&(tl(e,!1),0===e.strm.avail_out)?Wc:Qc}(n,t):vc[n.level].func(n,t);if(o!==Yc&&o!==Zc||(n.status=Gc),o===Wc||o===Yc)return 0===e.avail_out&&(n.last_flush=-1),Bc;if(o===Qc&&(1===t?Sc._tr_align(n):5!==t&&(Sc._tr_stored_block(n,0,0,!1),3===t&&(Jc(n.head),0===n.lookahead&&(n.strstart=0,n.block_start=0,n.insert=0))),el(e),0===e.avail_out))return n.last_flush=-1,Bc}return t!==Ac?Bc:n.wrap<=0?1:(2===n.wrap?(rl(n,255&e.adler),rl(n,e.adler>>8&255),rl(n,e.adler>>16&255),rl(n,e.adler>>24&255),rl(n,255&e.total_in),rl(n,e.total_in>>8&255),rl(n,e.total_in>>16&255),rl(n,e.total_in>>24&255)):(nl(n,e.adler>>>16),nl(n,65535&e.adler)),el(e),n.wrap>0&&(n.wrap=-n.wrap),0!==n.pending?Bc:1)},Cu.deflateEnd=function(e){var t;return e&&e.state?(t=e.state.status)!==jc&&69!==t&&73!==t&&91!==t&&t!==qc&&t!==Hc&&t!==Gc?Xc(e,kc):(e.state=null,t===Hc?Xc(e,-3):Bc):kc},Cu.deflateSetDictionary=function(e,t){var r,n,i,a,s,o,u,c,l=t.length;if(!e||!e.state)return kc;if(2===(a=(r=e.state).wrap)||1===a&&r.status!==jc||r.lookahead)return kc;for(1===a&&(e.adler=Tc(e.adler,t,l,0)),r.wrap=0,l>=r.w_size&&(0===a&&(Jc(r.head),r.strstart=0,r.block_start=0,r.insert=0),c=new bc.Buf8(r.w_size),bc.arraySet(c,t,l-r.w_size,r.w_size,0),t=c,l=r.w_size),s=e.avail_in,o=e.next_in,u=e.input,e.avail_in=l,e.next_in=0,e.input=t,sl(r);r.lookahead>=Mc;){n=r.strstart,i=r.lookahead-(Mc-1);do{r.ins_h=(r.ins_h<<r.hash_shift^r.window[n+Mc-1])&r.hash_mask,r.prev[n&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=n,n++}while(--i);r.strstart=n,r.lookahead=Mc-1,sl(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=Mc-1,r.match_available=0,e.next_in=o,e.input=u,e.avail_in=s,r.wrap=a,Bc},Cu.deflateInfo="pako deflate (from Nodeca project)";var pl={},gl=mu,yl=!0,ml=!0;try{String.fromCharCode.apply(null,[0])}catch(xn){yl=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(xn){ml=!1}for(var vl=new gl.Buf8(256),Cl=0;Cl<256;Cl++)vl[Cl]=Cl>=252?6:Cl>=248?5:Cl>=240?4:Cl>=224?3:Cl>=192?2:1;function El(e,t){if(t<65534&&(e.subarray&&ml||!e.subarray&&yl))return String.fromCharCode.apply(null,gl.shrinkBuf(e,t));for(var r="",n=0;n<t;n++)r+=String.fromCharCode(e[n]);return r}vl[254]=vl[254]=1,pl.string2buf=function(e){var t,r,n,i,a,s=e.length,o=0;for(i=0;i<s;i++)55296==(64512&(r=e.charCodeAt(i)))&&i+1<s&&56320==(64512&(n=e.charCodeAt(i+1)))&&(r=65536+(r-55296<<10)+(n-56320),i++),o+=r<128?1:r<2048?2:r<65536?3:4;for(t=new gl.Buf8(o),a=0,i=0;a<o;i++)55296==(64512&(r=e.charCodeAt(i)))&&i+1<s&&56320==(64512&(n=e.charCodeAt(i+1)))&&(r=65536+(r-55296<<10)+(n-56320),i++),r<128?t[a++]=r:r<2048?(t[a++]=192|r>>>6,t[a++]=128|63&r):r<65536?(t[a++]=224|r>>>12,t[a++]=128|r>>>6&63,t[a++]=128|63&r):(t[a++]=240|r>>>18,t[a++]=128|r>>>12&63,t[a++]=128|r>>>6&63,t[a++]=128|63&r);return t},pl.buf2binstring=function(e){return El(e,e.length)},pl.binstring2buf=function(e){for(var t=new gl.Buf8(e.length),r=0,n=t.length;r<n;r++)t[r]=e.charCodeAt(r);return t},pl.buf2string=function(e,t){var r,n,i,a,s=t||e.length,o=new Array(2*s);for(n=0,r=0;r<s;)if((i=e[r++])<128)o[n++]=i;else if((a=vl[i])>4)o[n++]=65533,r+=a-1;else{for(i&=2===a?31:3===a?15:7;a>1&&r<s;)i=i<<6|63&e[r++],a--;a>1?o[n++]=65533:i<65536?o[n++]=i:(i-=65536,o[n++]=55296|i>>10&1023,o[n++]=56320|1023&i)}return El(o,n)},pl.utf8border=function(e,t){var r;for((t=t||e.length)>e.length&&(t=e.length),r=t-1;r>=0&&128==(192&e[r]);)r--;return r<0||0===r?t:r+vl[e[r]]>t?r:t};var bl=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0},Sl=Cu,Tl=mu,_l=pl,wl=Ec,Il=bl,Al=Object.prototype.toString,Bl=0,kl=-1,Nl=0,Rl=8;function Ll(e){if(!(this instanceof Ll))return new Ll(e);this.options=Tl.assign({level:kl,method:Rl,chunkSize:16384,windowBits:15,memLevel:8,strategy:Nl,to:""},e||{});var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Il,this.strm.avail_out=0;var r=Sl.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(r!==Bl)throw new Error(wl[r]);if(t.header&&Sl.deflateSetHeader(this.strm,t.header),t.dictionary){var n;if(n="string"==typeof t.dictionary?_l.string2buf(t.dictionary):"[object ArrayBuffer]"===Al.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,(r=Sl.deflateSetDictionary(this.strm,n))!==Bl)throw new Error(wl[r]);this._dict_set=!0}}function Dl(e,t){var r=new Ll(t);if(r.push(e,!0),r.err)throw r.msg||wl[r.err];return r.result}Ll.prototype.push=function(e,t){var r,n,i=this.strm,a=this.options.chunkSize;if(this.ended)return!1;n=t===~~t?t:!0===t?4:0,"string"==typeof e?i.input=_l.string2buf(e):"[object ArrayBuffer]"===Al.call(e)?i.input=new Uint8Array(e):i.input=e,i.next_in=0,i.avail_in=i.input.length;do{if(0===i.avail_out&&(i.output=new Tl.Buf8(a),i.next_out=0,i.avail_out=a),1!==(r=Sl.deflate(i,n))&&r!==Bl)return this.onEnd(r),this.ended=!0,!1;0!==i.avail_out&&(0!==i.avail_in||4!==n&&2!==n)||("string"===this.options.to?this.onData(_l.buf2binstring(Tl.shrinkBuf(i.output,i.next_out))):this.onData(Tl.shrinkBuf(i.output,i.next_out)))}while((i.avail_in>0||0===i.avail_out)&&1!==r);return 4===n?(r=Sl.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===Bl):2!==n||(this.onEnd(Bl),i.avail_out=0,!0)},Ll.prototype.onData=function(e){this.chunks.push(e)},Ll.prototype.onEnd=function(e){e===Bl&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=Tl.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},vu.Deflate=Ll,vu.deflate=Dl,vu.deflateRaw=function(e,t){return(t=t||{}).raw=!0,Dl(e,t)},vu.gzip=function(e,t){return(t=t||{}).gzip=!0,Dl(e,t)};var Ul={},xl={},Ol=mu,Pl=15,Vl=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],Kl=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],Ml=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],Fl=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64],zl=mu,jl=yc,ql=Cc,Hl=function(e,t){var r,n,i,a,s,o,u,c,l,h,f,d,p,g,y,m,v,C,E,b,S,T,_,w,I;r=e.state,n=e.next_in,w=e.input,i=n+(e.avail_in-5),a=e.next_out,I=e.output,s=a-(t-e.avail_out),o=a+(e.avail_out-257),u=r.dmax,c=r.wsize,l=r.whave,h=r.wnext,f=r.window,d=r.hold,p=r.bits,g=r.lencode,y=r.distcode,m=(1<<r.lenbits)-1,v=(1<<r.distbits)-1;e:do{p<15&&(d+=w[n++]<<p,p+=8,d+=w[n++]<<p,p+=8),C=g[d&m];t:for(;;){if(d>>>=E=C>>>24,p-=E,0===(E=C>>>16&255))I[a++]=65535&C;else{if(!(16&E)){if(0==(64&E)){C=g[(65535&C)+(d&(1<<E)-1)];continue t}if(32&E){r.mode=12;break e}e.msg="invalid literal/length code",r.mode=30;break e}b=65535&C,(E&=15)&&(p<E&&(d+=w[n++]<<p,p+=8),b+=d&(1<<E)-1,d>>>=E,p-=E),p<15&&(d+=w[n++]<<p,p+=8,d+=w[n++]<<p,p+=8),C=y[d&v];r:for(;;){if(d>>>=E=C>>>24,p-=E,!(16&(E=C>>>16&255))){if(0==(64&E)){C=y[(65535&C)+(d&(1<<E)-1)];continue r}e.msg="invalid distance code",r.mode=30;break e}if(S=65535&C,p<(E&=15)&&(d+=w[n++]<<p,(p+=8)<E&&(d+=w[n++]<<p,p+=8)),(S+=d&(1<<E)-1)>u){e.msg="invalid distance too far back",r.mode=30;break e}if(d>>>=E,p-=E,S>(E=a-s)){if((E=S-E)>l&&r.sane){e.msg="invalid distance too far back",r.mode=30;break e}if(T=0,_=f,0===h){if(T+=c-E,E<b){b-=E;do{I[a++]=f[T++]}while(--E);T=a-S,_=I}}else if(h<E){if(T+=c+h-E,(E-=h)<b){b-=E;do{I[a++]=f[T++]}while(--E);if(T=0,h<b){b-=E=h;do{I[a++]=f[T++]}while(--E);T=a-S,_=I}}}else if(T+=h-E,E<b){b-=E;do{I[a++]=f[T++]}while(--E);T=a-S,_=I}for(;b>2;)I[a++]=_[T++],I[a++]=_[T++],I[a++]=_[T++],b-=3;b&&(I[a++]=_[T++],b>1&&(I[a++]=_[T++]))}else{T=a-S;do{I[a++]=I[T++],I[a++]=I[T++],I[a++]=I[T++],b-=3}while(b>2);b&&(I[a++]=I[T++],b>1&&(I[a++]=I[T++]))}break}}break}}while(n<i&&a<o);n-=b=p>>3,d&=(1<<(p-=b<<3))-1,e.next_in=n,e.next_out=a,e.avail_in=n<i?i-n+5:5-(n-i),e.avail_out=a<o?o-a+257:257-(a-o),r.hold=d,r.bits=p},Gl=function(e,t,r,n,i,a,s,o){var u,c,l,h,f,d,p,g,y,m=o.bits,v=0,C=0,E=0,b=0,S=0,T=0,_=0,w=0,I=0,A=0,B=null,k=0,N=new Ol.Buf16(16),R=new Ol.Buf16(16),L=null,D=0;for(v=0;v<=Pl;v++)N[v]=0;for(C=0;C<n;C++)N[t[r+C]]++;for(S=m,b=Pl;b>=1&&0===N[b];b--);if(S>b&&(S=b),0===b)return i[a++]=20971520,i[a++]=20971520,o.bits=1,0;for(E=1;E<b&&0===N[E];E++);for(S<E&&(S=E),w=1,v=1;v<=Pl;v++)if(w<<=1,(w-=N[v])<0)return-1;if(w>0&&(0===e||1!==b))return-1;for(R[1]=0,v=1;v<Pl;v++)R[v+1]=R[v]+N[v];for(C=0;C<n;C++)0!==t[r+C]&&(s[R[t[r+C]]++]=C);if(0===e?(B=L=s,d=19):1===e?(B=Vl,k-=257,L=Kl,D-=257,d=256):(B=Ml,L=Fl,d=-1),A=0,C=0,v=E,f=a,T=S,_=0,l=-1,h=(I=1<<S)-1,1===e&&I>852||2===e&&I>592)return 1;for(;;){p=v-_,s[C]<d?(g=0,y=s[C]):s[C]>d?(g=L[D+s[C]],y=B[k+s[C]]):(g=96,y=0),u=1<<v-_,E=c=1<<T;do{i[f+(A>>_)+(c-=u)]=p<<24|g<<16|y|0}while(0!==c);for(u=1<<v-1;A&u;)u>>=1;if(0!==u?(A&=u-1,A+=u):A=0,C++,0==--N[v]){if(v===b)break;v=t[r+s[C]]}if(v>S&&(A&h)!==l){for(0===_&&(_=S),f+=E,w=1<<(T=v-_);T+_<b&&!((w-=N[T+_])<=0);)T++,w<<=1;if(I+=1<<T,1===e&&I>852||2===e&&I>592)return 1;i[l=A&h]=S<<24|T<<16|f-a|0}}return 0!==A&&(i[f+A]=v-_<<24|64<<16|0),o.bits=S,0},Wl=1,Ql=2,Yl=0,Zl=-2,Xl=1,$l=12,Jl=30,eh=852,th=592;function rh(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function nh(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new zl.Buf16(320),this.work=new zl.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function ih(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=Xl,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new zl.Buf32(eh),t.distcode=t.distdyn=new zl.Buf32(th),t.sane=1,t.back=-1,Yl):Zl}function ah(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,ih(e)):Zl}function sh(e,t){var r,n;return e&&e.state?(n=e.state,t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?Zl:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,ah(e))):Zl}function oh(e,t){var r,n;return e?(n=new nh,e.state=n,n.window=null,(r=sh(e,t))!==Yl&&(e.state=null),r):Zl}var uh,ch,lh=!0;function hh(e){if(lh){var t;for(uh=new zl.Buf32(512),ch=new zl.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(Gl(Wl,e.lens,0,288,uh,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;Gl(Ql,e.lens,0,32,ch,0,e.work,{bits:5}),lh=!1}e.lencode=uh,e.lenbits=9,e.distcode=ch,e.distbits=5}function fh(e,t,r,n){var i,a=e.state;return null===a.window&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new zl.Buf8(a.wsize)),n>=a.wsize?(zl.arraySet(a.window,t,r-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):((i=a.wsize-a.wnext)>n&&(i=n),zl.arraySet(a.window,t,r-n,i,a.wnext),(n-=i)?(zl.arraySet(a.window,t,r-n,n,0),a.wnext=n,a.whave=a.wsize):(a.wnext+=i,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=i))),0}xl.inflateReset=ah,xl.inflateReset2=sh,xl.inflateResetKeep=ih,xl.inflateInit=function(e){return oh(e,15)},xl.inflateInit2=oh,xl.inflate=function(e,t){var r,n,i,a,s,o,u,c,l,h,f,d,p,g,y,m,v,C,E,b,S,T,_,w,I=0,A=new zl.Buf8(4),B=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&0!==e.avail_in)return Zl;(r=e.state).mode===$l&&(r.mode=13),s=e.next_out,i=e.output,u=e.avail_out,a=e.next_in,n=e.input,o=e.avail_in,c=r.hold,l=r.bits,h=o,f=u,T=Yl;e:for(;;)switch(r.mode){case Xl:if(0===r.wrap){r.mode=13;break}for(;l<16;){if(0===o)break e;o--,c+=n[a++]<<l,l+=8}if(2&r.wrap&&35615===c){r.check=0,A[0]=255&c,A[1]=c>>>8&255,r.check=ql(r.check,A,2,0),c=0,l=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&c)<<8)+(c>>8))%31){e.msg="incorrect header check",r.mode=Jl;break}if(8!=(15&c)){e.msg="unknown compression method",r.mode=Jl;break}if(l-=4,S=8+(15&(c>>>=4)),0===r.wbits)r.wbits=S;else if(S>r.wbits){e.msg="invalid window size",r.mode=Jl;break}r.dmax=1<<S,e.adler=r.check=1,r.mode=512&c?10:$l,c=0,l=0;break;case 2:for(;l<16;){if(0===o)break e;o--,c+=n[a++]<<l,l+=8}if(r.flags=c,8!=(255&r.flags)){e.msg="unknown compression method",r.mode=Jl;break}if(57344&r.flags){e.msg="unknown header flags set",r.mode=Jl;break}r.head&&(r.head.text=c>>8&1),512&r.flags&&(A[0]=255&c,A[1]=c>>>8&255,r.check=ql(r.check,A,2,0)),c=0,l=0,r.mode=3;case 3:for(;l<32;){if(0===o)break e;o--,c+=n[a++]<<l,l+=8}r.head&&(r.head.time=c),512&r.flags&&(A[0]=255&c,A[1]=c>>>8&255,A[2]=c>>>16&255,A[3]=c>>>24&255,r.check=ql(r.check,A,4,0)),c=0,l=0,r.mode=4;case 4:for(;l<16;){if(0===o)break e;o--,c+=n[a++]<<l,l+=8}r.head&&(r.head.xflags=255&c,r.head.os=c>>8),512&r.flags&&(A[0]=255&c,A[1]=c>>>8&255,r.check=ql(r.check,A,2,0)),c=0,l=0,r.mode=5;case 5:if(1024&r.flags){for(;l<16;){if(0===o)break e;o--,c+=n[a++]<<l,l+=8}r.length=c,r.head&&(r.head.extra_len=c),512&r.flags&&(A[0]=255&c,A[1]=c>>>8&255,r.check=ql(r.check,A,2,0)),c=0,l=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&((d=r.length)>o&&(d=o),d&&(r.head&&(S=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),zl.arraySet(r.head.extra,n,a,d,S)),512&r.flags&&(r.check=ql(r.check,n,d,a)),o-=d,a+=d,r.length-=d),r.length))break e;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===o)break e;d=0;do{S=n[a+d++],r.head&&S&&r.length<65536&&(r.head.name+=String.fromCharCode(S))}while(S&&d<o);if(512&r.flags&&(r.check=ql(r.check,n,d,a)),o-=d,a+=d,S)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=8;case 8:if(4096&r.flags){if(0===o)break e;d=0;do{S=n[a+d++],r.head&&S&&r.length<65536&&(r.head.comment+=String.fromCharCode(S))}while(S&&d<o);if(512&r.flags&&(r.check=ql(r.check,n,d,a)),o-=d,a+=d,S)break e}else r.head&&(r.head.comment=null);r.mode=9;case 9:if(512&r.flags){for(;l<16;){if(0===o)break e;o--,c+=n[a++]<<l,l+=8}if(c!==(65535&r.check)){e.msg="header crc mismatch",r.mode=Jl;break}c=0,l=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=$l;break;case 10:for(;l<32;){if(0===o)break e;o--,c+=n[a++]<<l,l+=8}e.adler=r.check=rh(c),c=0,l=0,r.mode=11;case 11:if(0===r.havedict)return e.next_out=s,e.avail_out=u,e.next_in=a,e.avail_in=o,r.hold=c,r.bits=l,2;e.adler=r.check=1,r.mode=$l;case $l:if(5===t||6===t)break e;case 13:if(r.last){c>>>=7&l,l-=7&l,r.mode=27;break}for(;l<3;){if(0===o)break e;o--,c+=n[a++]<<l,l+=8}switch(r.last=1&c,l-=1,3&(c>>>=1)){case 0:r.mode=14;break;case 1:if(hh(r),r.mode=20,6===t){c>>>=2,l-=2;break e}break;case 2:r.mode=17;break;case 3:e.msg="invalid block type",r.mode=Jl}c>>>=2,l-=2;break;case 14:for(c>>>=7&l,l-=7&l;l<32;){if(0===o)break e;o--,c+=n[a++]<<l,l+=8}if((65535&c)!=(c>>>16^65535)){e.msg="invalid stored block lengths",r.mode=Jl;break}if(r.length=65535&c,c=0,l=0,r.mode=15,6===t)break e;case 15:r.mode=16;case 16:if(d=r.length){if(d>o&&(d=o),d>u&&(d=u),0===d)break e;zl.arraySet(i,n,a,d,s),o-=d,a+=d,u-=d,s+=d,r.length-=d;break}r.mode=$l;break;case 17:for(;l<14;){if(0===o)break e;o--,c+=n[a++]<<l,l+=8}if(r.nlen=257+(31&c),c>>>=5,l-=5,r.ndist=1+(31&c),c>>>=5,l-=5,r.ncode=4+(15&c),c>>>=4,l-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=Jl;break}r.have=0,r.mode=18;case 18:for(;r.have<r.ncode;){for(;l<3;){if(0===o)break e;o--,c+=n[a++]<<l,l+=8}r.lens[B[r.have++]]=7&c,c>>>=3,l-=3}for(;r.have<19;)r.lens[B[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,_={bits:r.lenbits},T=Gl(0,r.lens,0,19,r.lencode,0,r.work,_),r.lenbits=_.bits,T){e.msg="invalid code lengths set",r.mode=Jl;break}r.have=0,r.mode=19;case 19:for(;r.have<r.nlen+r.ndist;){for(;m=(I=r.lencode[c&(1<<r.lenbits)-1])>>>16&255,v=65535&I,!((y=I>>>24)<=l);){if(0===o)break e;o--,c+=n[a++]<<l,l+=8}if(v<16)c>>>=y,l-=y,r.lens[r.have++]=v;else{if(16===v){for(w=y+2;l<w;){if(0===o)break e;o--,c+=n[a++]<<l,l+=8}if(c>>>=y,l-=y,0===r.have){e.msg="invalid bit length repeat",r.mode=Jl;break}S=r.lens[r.have-1],d=3+(3&c),c>>>=2,l-=2}else if(17===v){for(w=y+3;l<w;){if(0===o)break e;o--,c+=n[a++]<<l,l+=8}l-=y,S=0,d=3+(7&(c>>>=y)),c>>>=3,l-=3}else{for(w=y+7;l<w;){if(0===o)break e;o--,c+=n[a++]<<l,l+=8}l-=y,S=0,d=11+(127&(c>>>=y)),c>>>=7,l-=7}if(r.have+d>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=Jl;break}for(;d--;)r.lens[r.have++]=S}}if(r.mode===Jl)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=Jl;break}if(r.lenbits=9,_={bits:r.lenbits},T=Gl(Wl,r.lens,0,r.nlen,r.lencode,0,r.work,_),r.lenbits=_.bits,T){e.msg="invalid literal/lengths set",r.mode=Jl;break}if(r.distbits=6,r.distcode=r.distdyn,_={bits:r.distbits},T=Gl(Ql,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,_),r.distbits=_.bits,T){e.msg="invalid distances set",r.mode=Jl;break}if(r.mode=20,6===t)break e;case 20:r.mode=21;case 21:if(o>=6&&u>=258){e.next_out=s,e.avail_out=u,e.next_in=a,e.avail_in=o,r.hold=c,r.bits=l,Hl(e,f),s=e.next_out,i=e.output,u=e.avail_out,a=e.next_in,n=e.input,o=e.avail_in,c=r.hold,l=r.bits,r.mode===$l&&(r.back=-1);break}for(r.back=0;m=(I=r.lencode[c&(1<<r.lenbits)-1])>>>16&255,v=65535&I,!((y=I>>>24)<=l);){if(0===o)break e;o--,c+=n[a++]<<l,l+=8}if(m&&0==(240&m)){for(C=y,E=m,b=v;m=(I=r.lencode[b+((c&(1<<C+E)-1)>>C)])>>>16&255,v=65535&I,!(C+(y=I>>>24)<=l);){if(0===o)break e;o--,c+=n[a++]<<l,l+=8}c>>>=C,l-=C,r.back+=C}if(c>>>=y,l-=y,r.back+=y,r.length=v,0===m){r.mode=26;break}if(32&m){r.back=-1,r.mode=$l;break}if(64&m){e.msg="invalid literal/length code",r.mode=Jl;break}r.extra=15&m,r.mode=22;case 22:if(r.extra){for(w=r.extra;l<w;){if(0===o)break e;o--,c+=n[a++]<<l,l+=8}r.length+=c&(1<<r.extra)-1,c>>>=r.extra,l-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;m=(I=r.distcode[c&(1<<r.distbits)-1])>>>16&255,v=65535&I,!((y=I>>>24)<=l);){if(0===o)break e;o--,c+=n[a++]<<l,l+=8}if(0==(240&m)){for(C=y,E=m,b=v;m=(I=r.distcode[b+((c&(1<<C+E)-1)>>C)])>>>16&255,v=65535&I,!(C+(y=I>>>24)<=l);){if(0===o)break e;o--,c+=n[a++]<<l,l+=8}c>>>=C,l-=C,r.back+=C}if(c>>>=y,l-=y,r.back+=y,64&m){e.msg="invalid distance code",r.mode=Jl;break}r.offset=v,r.extra=15&m,r.mode=24;case 24:if(r.extra){for(w=r.extra;l<w;){if(0===o)break e;o--,c+=n[a++]<<l,l+=8}r.offset+=c&(1<<r.extra)-1,c>>>=r.extra,l-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=Jl;break}r.mode=25;case 25:if(0===u)break e;if(d=f-u,r.offset>d){if((d=r.offset-d)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=Jl;break}d>r.wnext?(d-=r.wnext,p=r.wsize-d):p=r.wnext-d,d>r.length&&(d=r.length),g=r.window}else g=i,p=s-r.offset,d=r.length;d>u&&(d=u),u-=d,r.length-=d;do{i[s++]=g[p++]}while(--d);0===r.length&&(r.mode=21);break;case 26:if(0===u)break e;i[s++]=r.length,u--,r.mode=21;break;case 27:if(r.wrap){for(;l<32;){if(0===o)break e;o--,c|=n[a++]<<l,l+=8}if(f-=u,e.total_out+=f,r.total+=f,f&&(e.adler=r.check=r.flags?ql(r.check,i,f,s-f):jl(r.check,i,f,s-f)),f=u,(r.flags?c:rh(c))!==r.check){e.msg="incorrect data check",r.mode=Jl;break}c=0,l=0}r.mode=28;case 28:if(r.wrap&&r.flags){for(;l<32;){if(0===o)break e;o--,c+=n[a++]<<l,l+=8}if(c!==(4294967295&r.total)){e.msg="incorrect length check",r.mode=Jl;break}c=0,l=0}r.mode=29;case 29:T=1;break e;case Jl:T=-3;break e;case 31:return-4;default:return Zl}return e.next_out=s,e.avail_out=u,e.next_in=a,e.avail_in=o,r.hold=c,r.bits=l,(r.wsize||f!==e.avail_out&&r.mode<Jl&&(r.mode<27||4!==t))&&fh(e,e.output,e.next_out,f-e.avail_out),h-=e.avail_in,f-=e.avail_out,e.total_in+=h,e.total_out+=f,r.total+=f,r.wrap&&f&&(e.adler=r.check=r.flags?ql(r.check,i,f,e.next_out-f):jl(r.check,i,f,e.next_out-f)),e.data_type=r.bits+(r.last?64:0)+(r.mode===$l?128:0)+(20===r.mode||15===r.mode?256:0),(0===h&&0===f||4===t)&&T===Yl&&(T=-5),T},xl.inflateEnd=function(e){if(!e||!e.state)return Zl;var t=e.state;return t.window&&(t.window=null),e.state=null,Yl},xl.inflateGetHeader=function(e,t){var r;return e&&e.state?0==(2&(r=e.state).wrap)?Zl:(r.head=t,t.done=!1,Yl):Zl},xl.inflateSetDictionary=function(e,t){var r,n=t.length;return e&&e.state?0!==(r=e.state).wrap&&11!==r.mode?Zl:11===r.mode&&jl(1,t,n,0)!==r.check?-3:fh(e,t,n,n)?(r.mode=31,-4):(r.havedict=1,Yl):Zl},xl.inflateInfo="pako inflate (from Nodeca project)";var dh={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};var ph=xl,gh=mu,yh=pl,mh=dh,vh=Ec,Ch=bl,Eh=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1},bh=Object.prototype.toString;function Sh(e){if(!(this instanceof Sh))return new Sh(e);this.options=gh.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Ch,this.strm.avail_out=0;var r=ph.inflateInit2(this.strm,t.windowBits);if(r!==mh.Z_OK)throw new Error(vh[r]);if(this.header=new Eh,ph.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=yh.string2buf(t.dictionary):"[object ArrayBuffer]"===bh.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(r=ph.inflateSetDictionary(this.strm,t.dictionary))!==mh.Z_OK))throw new Error(vh[r])}function Th(e,t){var r=new Sh(t);if(r.push(e,!0),r.err)throw r.msg||vh[r.err];return r.result}Sh.prototype.push=function(e,t){var r,n,i,a,s,o=this.strm,u=this.options.chunkSize,c=this.options.dictionary,l=!1;if(this.ended)return!1;n=t===~~t?t:!0===t?mh.Z_FINISH:mh.Z_NO_FLUSH,"string"==typeof e?o.input=yh.binstring2buf(e):"[object ArrayBuffer]"===bh.call(e)?o.input=new Uint8Array(e):o.input=e,o.next_in=0,o.avail_in=o.input.length;do{if(0===o.avail_out&&(o.output=new gh.Buf8(u),o.next_out=0,o.avail_out=u),(r=ph.inflate(o,mh.Z_NO_FLUSH))===mh.Z_NEED_DICT&&c&&(r=ph.inflateSetDictionary(this.strm,c)),r===mh.Z_BUF_ERROR&&!0===l&&(r=mh.Z_OK,l=!1),r!==mh.Z_STREAM_END&&r!==mh.Z_OK)return this.onEnd(r),this.ended=!0,!1;o.next_out&&(0!==o.avail_out&&r!==mh.Z_STREAM_END&&(0!==o.avail_in||n!==mh.Z_FINISH&&n!==mh.Z_SYNC_FLUSH)||("string"===this.options.to?(i=yh.utf8border(o.output,o.next_out),a=o.next_out-i,s=yh.buf2string(o.output,i),o.next_out=a,o.avail_out=u-a,a&&gh.arraySet(o.output,o.output,i,a,0),this.onData(s)):this.onData(gh.shrinkBuf(o.output,o.next_out)))),0===o.avail_in&&0===o.avail_out&&(l=!0)}while((o.avail_in>0||0===o.avail_out)&&r!==mh.Z_STREAM_END);return r===mh.Z_STREAM_END&&(n=mh.Z_FINISH),n===mh.Z_FINISH?(r=ph.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===mh.Z_OK):n!==mh.Z_SYNC_FLUSH||(this.onEnd(mh.Z_OK),o.avail_out=0,!0)},Sh.prototype.onData=function(e){this.chunks.push(e)},Sh.prototype.onEnd=function(e){e===mh.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=gh.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},Ul.Inflate=Sh,Ul.inflate=Th,Ul.inflateRaw=function(e,t){return(t=t||{}).raw=!0,Th(e,t)},Ul.ungzip=Th;var _h={};(0,mu.assign)(_h,vu,Ul,dh);var wh="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array,Ih=_h,Ah=Co(),Bh=bo,kh=wh?"uint8array":"array";function Nh(e,t){Bh.call(this,"FlateWorker/"+e),this._pako=null,this._pakoAction=e,this._pakoOptions=t,this.meta={}}yu.magic="\b\0",Ah.inherits(Nh,Bh),Nh.prototype.processChunk=function(e){this.meta=e.meta,null===this._pako&&this._createPako(),this._pako.push(Ah.transformTo(kh,e.data),!1)},Nh.prototype.flush=function(){Bh.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0)},Nh.prototype.cleanUp=function(){Bh.prototype.cleanUp.call(this),this._pako=null},Nh.prototype._createPako=function(){this._pako=new Ih[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var e=this;this._pako.onData=function(t){e.push({data:t,meta:e.meta})}},yu.compressWorker=function(e){return new Nh("Deflate",e)},yu.uncompressWorker=function(){return new Nh("Inflate",{})};var Rh=bo;gu.STORE={magic:"\0\0",compressWorker:function(){return new Rh("STORE compression")},uncompressWorker:function(){return new Rh("STORE decompression")}},gu.DEFLATE=yu;var Lh={LOCAL_FILE_HEADER:"PK",CENTRAL_FILE_HEADER:"PK",CENTRAL_DIRECTORY_END:"PK",ZIP64_CENTRAL_DIRECTORY_LOCATOR:"PK",ZIP64_CENTRAL_DIRECTORY_END:"PK",DATA_DESCRIPTOR:"PK\b"},Dh=Co(),Uh=bo,xh=as,Oh=qo,Ph=Lh,Vh=function(e,t){var r,n="";for(r=0;r<t;r++)n+=String.fromCharCode(255&e),e>>>=8;return n},Kh=function(e,t,r,n,i,a){var s,o,u=e.file,c=e.compression,l=a!==xh.utf8encode,h=Dh.transformTo("string",a(u.name)),f=Dh.transformTo("string",xh.utf8encode(u.name)),d=u.comment,p=Dh.transformTo("string",a(d)),g=Dh.transformTo("string",xh.utf8encode(d)),y=f.length!==u.name.length,m=g.length!==d.length,v="",C="",E="",b=u.dir,S=u.date,T={crc32:0,compressedSize:0,uncompressedSize:0};t&&!r||(T.crc32=e.crc32,T.compressedSize=e.compressedSize,T.uncompressedSize=e.uncompressedSize);var _=0;t&&(_|=8),l||!y&&!m||(_|=2048);var w,I,A,B=0,k=0;b&&(B|=16),"UNIX"===i?(k=798,B|=(w=u.unixPermissions,I=b,A=w,w||(A=I?16893:33204),(65535&A)<<16)):(k=20,B|=63&(u.dosPermissions||0)),s=S.getUTCHours(),s<<=6,s|=S.getUTCMinutes(),s<<=5,s|=S.getUTCSeconds()/2,o=S.getUTCFullYear()-1980,o<<=4,o|=S.getUTCMonth()+1,o<<=5,o|=S.getUTCDate(),y&&(C=Vh(1,1)+Vh(Oh(h),4)+f,v+="up"+Vh(C.length,2)+C),m&&(E=Vh(1,1)+Vh(Oh(p),4)+g,v+="uc"+Vh(E.length,2)+E);var N="";return N+="\n\0",N+=Vh(_,2),N+=c.magic,N+=Vh(s,2),N+=Vh(o,2),N+=Vh(T.crc32,4),N+=Vh(T.compressedSize,4),N+=Vh(T.uncompressedSize,4),N+=Vh(h.length,2),N+=Vh(v.length,2),{fileRecord:Ph.LOCAL_FILE_HEADER+N+h+v,dirRecord:Ph.CENTRAL_FILE_HEADER+Vh(k,2)+N+Vh(p.length,2)+"\0\0\0\0"+Vh(B,4)+Vh(n,4)+h+v+p}},Mh=function(e){return Ph.DATA_DESCRIPTOR+Vh(e.crc32,4)+Vh(e.compressedSize,4)+Vh(e.uncompressedSize,4)};function Fh(e,t,r,n){Uh.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=t,this.zipPlatform=r,this.encodeFileName=n,this.streamFiles=e,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}Dh.inherits(Fh,Uh),Fh.prototype.push=function(e){var t=e.meta.percent||0,r=this.entriesCount,n=this._sources.length;this.accumulate?this.contentBuffer.push(e):(this.bytesWritten+=e.data.length,Uh.prototype.push.call(this,{data:e.data,meta:{currentFile:this.currentFile,percent:r?(t+100*(r-n-1))/r:100}}))},Fh.prototype.openedSource=function(e){this.currentSourceOffset=this.bytesWritten,this.currentFile=e.file.name;var t=this.streamFiles&&!e.file.dir;if(t){var r=Kh(e,t,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:r.fileRecord,meta:{percent:0}})}else this.accumulate=!0},Fh.prototype.closedSource=function(e){this.accumulate=!1;var t=this.streamFiles&&!e.file.dir,r=Kh(e,t,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(r.dirRecord),t)this.push({data:Mh(e),meta:{percent:100}});else for(this.push({data:r.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},Fh.prototype.flush=function(){for(var e=this.bytesWritten,t=0;t<this.dirRecords.length;t++)this.push({data:this.dirRecords[t],meta:{percent:100}});var r=this.bytesWritten-e,n=function(e,t,r,n,i){var a=Dh.transformTo("string",i(n));return Ph.CENTRAL_DIRECTORY_END+"\0\0\0\0"+Vh(e,2)+Vh(e,2)+Vh(t,4)+Vh(r,4)+Vh(a.length,2)+a}(this.dirRecords.length,r,e,this.zipComment,this.encodeFileName);this.push({data:n,meta:{percent:100}})},Fh.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},Fh.prototype.registerPrevious=function(e){this._sources.push(e);var t=this;return e.on("data",(function(e){t.processChunk(e)})),e.on("end",(function(){t.closedSource(t.previous.streamInfo),t._sources.length?t.prepareNextSource():t.end()})),e.on("error",(function(e){t.error(e)})),this},Fh.prototype.resume=function(){return!!Uh.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},Fh.prototype.error=function(e){var t=this._sources;if(!Uh.prototype.error.call(this,e))return!1;for(var r=0;r<t.length;r++)try{t[r].error(e)}catch(e){}return!0},Fh.prototype.lock=function(){Uh.prototype.lock.call(this);for(var e=this._sources,t=0;t<e.length;t++)e[t].lock()};var zh=gu,jh=Fh;pu.generateWorker=function(e,t,r){var n=new jh(t.streamFiles,r,t.platform,t.encodeFileName),i=0;try{e.forEach((function(e,r){i++;var a=function(e,t){var r=e||t,n=zh[r];if(!n)throw new Error(r+" is not a valid compression method !");return n}(r.options.compression,t.compression),s=r.options.compressionOptions||t.compressionOptions||{},o=r.dir,u=r.date;r._compressWorker(a,s).withStreamInfo("file",{name:e,dir:o,date:u,comment:r.comment||"",unixPermissions:r.unixPermissions,dosPermissions:r.dosPermissions}).pipe(n)})),n.entriesCount=i}catch(e){n.error(e)}return n};var qh=Co(),Hh=bo;function Gh(e,t){Hh.call(this,"Nodejs stream input adapter for "+e),this._upstreamEnded=!1,this._bindStream(t)}qh.inherits(Gh,Hh),Gh.prototype._bindStream=function(e){var t=this;this._stream=e,e.pause(),e.on("data",(function(e){t.push({data:e,meta:{percent:0}})})).on("error",(function(e){t.isPaused?this.generatedError=e:t.error(e)})).on("end",(function(){t.isPaused?t._upstreamEnded=!0:t.end()}))},Gh.prototype.pause=function(){return!!Hh.prototype.pause.call(this)&&(this._stream.pause(),!0)},Gh.prototype.resume=function(){return!!Hh.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)};var Wh=Gh,Qh=as,Yh=Co(),Zh=bo,Xh=Oo,$h=Po,Jh=nu,ef=du,tf=pu,rf=go,nf=Wh,af=function(e,t,r){var n,i=Yh.getTypeOf(t),a=Yh.extend(r||{},$h);a.date=a.date||new Date,null!==a.compression&&(a.compression=a.compression.toUpperCase()),"string"==typeof a.unixPermissions&&(a.unixPermissions=parseInt(a.unixPermissions,8)),a.unixPermissions&&16384&a.unixPermissions&&(a.dir=!0),a.dosPermissions&&16&a.dosPermissions&&(a.dir=!0),a.dir&&(e=of(e)),a.createFolders&&(n=sf(e))&&uf.call(this,n,!0);var s="string"===i&&!1===a.binary&&!1===a.base64;r&&void 0!==r.binary||(a.binary=!s),(t instanceof Jh&&0===t.uncompressedSize||a.dir||!t||0===t.length)&&(a.base64=!1,a.binary=!0,t="",a.compression="STORE",i="string");var o=null;o=t instanceof Jh||t instanceof Zh?t:rf.isNode&&rf.isStream(t)?new nf(e,t):Yh.prepareContent(e,t,a.binary,a.optimizedBinaryString,a.base64);var u=new ef(e,o,a);this.files[e]=u},sf=function(e){"/"===e.slice(-1)&&(e=e.substring(0,e.length-1));var t=e.lastIndexOf("/");return t>0?e.substring(0,t):""},of=function(e){return"/"!==e.slice(-1)&&(e+="/"),e},uf=function(e,t){return t=void 0!==t?t:$h.createFolders,e=of(e),this.files[e]||af.call(this,e,null,{dir:!0,createFolders:t}),this.files[e]};function cf(e){return"[object RegExp]"===Object.prototype.toString.call(e)}var lf={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(e){var t,r,n;for(t in this.files)n=this.files[t],(r=t.slice(this.root.length,t.length))&&t.slice(0,this.root.length)===this.root&&e(r,n)},filter:function(e){var t=[];return this.forEach((function(r,n){e(r,n)&&t.push(n)})),t},file:function(e,t,r){if(1===arguments.length){if(cf(e)){var n=e;return this.filter((function(e,t){return!t.dir&&n.test(e)}))}var i=this.files[this.root+e];return i&&!i.dir?i:null}return e=this.root+e,af.call(this,e,t,r),this},folder:function(e){if(!e)return this;if(cf(e))return this.filter((function(t,r){return r.dir&&e.test(t)}));var t=this.root+e,r=uf.call(this,t),n=this.clone();return n.root=r.name,n},remove:function(e){e=this.root+e;var t=this.files[e];if(t||("/"!==e.slice(-1)&&(e+="/"),t=this.files[e]),t&&!t.dir)delete this.files[e];else for(var r=this.filter((function(t,r){return r.name.slice(0,e.length)===e})),n=0;n<r.length;n++)delete this.files[r[n].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(e){var t,r={};try{if((r=Yh.extend(e||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:Qh.utf8encode})).type=r.type.toLowerCase(),r.compression=r.compression.toUpperCase(),"binarystring"===r.type&&(r.type="string"),!r.type)throw new Error("No output type specified.");Yh.checkSupport(r.type),"darwin"!==r.platform&&"freebsd"!==r.platform&&"linux"!==r.platform&&"sunos"!==r.platform||(r.platform="UNIX"),"win32"===r.platform&&(r.platform="DOS");var n=r.comment||this.comment||"";t=tf.generateWorker(this,r,n)}catch(e){(t=new Zh("error")).error(e)}return new Xh(t,r.type||"string",r.mimeType)},generateAsync:function(e,t){return this.generateInternalStream(e).accumulate(t)},generateNodeStream:function(e,t){return(e=e||{}).type||(e.type="nodebuffer"),this.generateInternalStream(e).toNodejsStream(t)}},hf=lf,ff=Co();function df(e){this.data=e,this.length=e.length,this.index=0,this.zero=0}df.prototype={checkOffset:function(e){this.checkIndex(this.index+e)},checkIndex:function(e){if(this.length<this.zero+e||e<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+e+"). Corrupted zip ?")},setIndex:function(e){this.checkIndex(e),this.index=e},skip:function(e){this.setIndex(this.index+e)},byteAt:function(){},readInt:function(e){var t,r=0;for(this.checkOffset(e),t=this.index+e-1;t>=this.index;t--)r=(r<<8)+this.byteAt(t);return this.index+=e,r},readString:function(e){return ff.transformTo("string",this.readData(e))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var e=this.readInt(4);return new Date(Date.UTC(1980+(e>>25&127),(e>>21&15)-1,e>>16&31,e>>11&31,e>>5&63,(31&e)<<1))}};var pf=df,gf=pf;function yf(e){gf.call(this,e);for(var t=0;t<this.data.length;t++)e[t]=255&e[t]}Co().inherits(yf,gf),yf.prototype.byteAt=function(e){return this.data[this.zero+e]},yf.prototype.lastIndexOfSignature=function(e){for(var t=e.charCodeAt(0),r=e.charCodeAt(1),n=e.charCodeAt(2),i=e.charCodeAt(3),a=this.length-4;a>=0;--a)if(this.data[a]===t&&this.data[a+1]===r&&this.data[a+2]===n&&this.data[a+3]===i)return a-this.zero;return-1},yf.prototype.readAndCheckSignature=function(e){var t=e.charCodeAt(0),r=e.charCodeAt(1),n=e.charCodeAt(2),i=e.charCodeAt(3),a=this.readData(4);return t===a[0]&&r===a[1]&&n===a[2]&&i===a[3]},yf.prototype.readData=function(e){if(this.checkOffset(e),0===e)return[];var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t};var mf=yf,vf=pf;function Cf(e){vf.call(this,e)}Co().inherits(Cf,vf),Cf.prototype.byteAt=function(e){return this.data.charCodeAt(this.zero+e)},Cf.prototype.lastIndexOfSignature=function(e){return this.data.lastIndexOf(e)-this.zero},Cf.prototype.readAndCheckSignature=function(e){return e===this.readData(4)},Cf.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t};var Ef=Cf,bf=mf;function Sf(e){bf.call(this,e)}Co().inherits(Sf,bf),Sf.prototype.readData=function(e){if(this.checkOffset(e),0===e)return new Uint8Array(0);var t=this.data.subarray(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t};var Tf=Sf,_f=Tf;function wf(e){_f.call(this,e)}Co().inherits(wf,_f),wf.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t};var If=wf,Af=Co(),Bf=os,kf=mf,Nf=Ef,Rf=If,Lf=Tf,Df=function(e){var t=Af.getTypeOf(e);return Af.checkSupport(t),"string"!==t||Bf.uint8array?"nodebuffer"===t?new Rf(e):Bf.uint8array?new Lf(Af.transformTo("uint8array",e)):new kf(Af.transformTo("array",e)):new Nf(e)},Uf=Df,xf=Co(),Of=nu,Pf=qo,Vf=as,Kf=gu,Mf=os;function Ff(e,t){this.options=e,this.loadOptions=t}Ff.prototype={isEncrypted:function(){return 1==(1&this.bitFlag)},useUTF8:function(){return 2048==(2048&this.bitFlag)},readLocalPart:function(e){var t,r;if(e.skip(22),this.fileNameLength=e.readInt(2),r=e.readInt(2),this.fileName=e.readData(this.fileNameLength),e.skip(r),-1===this.compressedSize||-1===this.uncompressedSize)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if(null===(t=function(e){for(var t in Kf)if(Object.prototype.hasOwnProperty.call(Kf,t)&&Kf[t].magic===e)return Kf[t];return null}(this.compressionMethod)))throw new Error("Corrupted zip : compression "+xf.pretty(this.compressionMethod)+" unknown (inner file : "+xf.transformTo("string",this.fileName)+")");this.decompressed=new Of(this.compressedSize,this.uncompressedSize,this.crc32,t,e.readData(this.compressedSize))},readCentralPart:function(e){this.versionMadeBy=e.readInt(2),e.skip(2),this.bitFlag=e.readInt(2),this.compressionMethod=e.readString(2),this.date=e.readDate(),this.crc32=e.readInt(4),this.compressedSize=e.readInt(4),this.uncompressedSize=e.readInt(4);var t=e.readInt(2);if(this.extraFieldsLength=e.readInt(2),this.fileCommentLength=e.readInt(2),this.diskNumberStart=e.readInt(2),this.internalFileAttributes=e.readInt(2),this.externalFileAttributes=e.readInt(4),this.localHeaderOffset=e.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");e.skip(t),this.readExtraFields(e),this.parseZIP64ExtraField(e),this.fileComment=e.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var e=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),0===e&&(this.dosPermissions=63&this.externalFileAttributes),3===e&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||"/"!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var e=Uf(this.extraFields[1].value);this.uncompressedSize===xf.MAX_VALUE_32BITS&&(this.uncompressedSize=e.readInt(8)),this.compressedSize===xf.MAX_VALUE_32BITS&&(this.compressedSize=e.readInt(8)),this.localHeaderOffset===xf.MAX_VALUE_32BITS&&(this.localHeaderOffset=e.readInt(8)),this.diskNumberStart===xf.MAX_VALUE_32BITS&&(this.diskNumberStart=e.readInt(4))}},readExtraFields:function(e){var t,r,n,i=e.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});e.index+4<i;)t=e.readInt(2),r=e.readInt(2),n=e.readData(r),this.extraFields[t]={id:t,length:r,value:n};e.setIndex(i)},handleUTF8:function(){var e=Mf.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=Vf.utf8decode(this.fileName),this.fileCommentStr=Vf.utf8decode(this.fileComment);else{var t=this.findExtraFieldUnicodePath();if(null!==t)this.fileNameStr=t;else{var r=xf.transformTo(e,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(r)}var n=this.findExtraFieldUnicodeComment();if(null!==n)this.fileCommentStr=n;else{var i=xf.transformTo(e,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(i)}}},findExtraFieldUnicodePath:function(){var e=this.extraFields[28789];if(e){var t=Uf(e.value);return 1!==t.readInt(1)||Pf(this.fileName)!==t.readInt(4)?null:Vf.utf8decode(t.readData(e.length-5))}return null},findExtraFieldUnicodeComment:function(){var e=this.extraFields[25461];if(e){var t=Uf(e.value);return 1!==t.readInt(1)||Pf(this.fileComment)!==t.readInt(4)?null:Vf.utf8decode(t.readData(e.length-5))}return null}};var zf=Ff,jf=Df,qf=Co(),Hf=Lh,Gf=zf,Wf=os;function Qf(e){this.files=[],this.loadOptions=e}Qf.prototype={checkSignature:function(e){if(!this.reader.readAndCheckSignature(e)){this.reader.index-=4;var t=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+qf.pretty(t)+", expected "+qf.pretty(e)+")")}},isSignature:function(e,t){var r=this.reader.index;this.reader.setIndex(e);var n=this.reader.readString(4)===t;return this.reader.setIndex(r),n},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var e=this.reader.readData(this.zipCommentLength),t=Wf.uint8array?"uint8array":"array",r=qf.transformTo(t,e);this.zipComment=this.loadOptions.decodeFileName(r)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var e,t,r,n=this.zip64EndOfCentralSize-44;0<n;)e=this.reader.readInt(2),t=this.reader.readInt(4),r=this.reader.readData(t),this.zip64ExtensibleData[e]={id:e,length:t,value:r}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),this.disksCount>1)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var e,t;for(e=0;e<this.files.length;e++)t=this.files[e],this.reader.setIndex(t.localHeaderOffset),this.checkSignature(Hf.LOCAL_FILE_HEADER),t.readLocalPart(this.reader),t.handleUTF8(),t.processAttributes()},readCentralDir:function(){var e;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(Hf.CENTRAL_FILE_HEADER);)(e=new Gf({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(e);if(this.centralDirRecords!==this.files.length&&0!==this.centralDirRecords&&0===this.files.length)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var e=this.reader.lastIndexOfSignature(Hf.CENTRAL_DIRECTORY_END);if(e<0)throw!this.isSignature(0,Hf.LOCAL_FILE_HEADER)?new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html"):new Error("Corrupted zip: can't find end of central directory");this.reader.setIndex(e);var t=e;if(this.checkSignature(Hf.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===qf.MAX_VALUE_16BITS||this.diskWithCentralDirStart===qf.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===qf.MAX_VALUE_16BITS||this.centralDirRecords===qf.MAX_VALUE_16BITS||this.centralDirSize===qf.MAX_VALUE_32BITS||this.centralDirOffset===qf.MAX_VALUE_32BITS){if(this.zip64=!0,(e=this.reader.lastIndexOfSignature(Hf.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(e),this.checkSignature(Hf.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,Hf.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(Hf.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(Hf.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var r=this.centralDirOffset+this.centralDirSize;this.zip64&&(r+=20,r+=12+this.zip64EndOfCentralSize);var n=t-r;if(n>0)this.isSignature(t,Hf.CENTRAL_FILE_HEADER)||(this.reader.zero=n);else if(n<0)throw new Error("Corrupted zip: missing "+Math.abs(n)+" bytes.")},prepareReader:function(e){this.reader=jf(e)},load:function(e){this.prepareReader(e),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}};var Yf=Qf,Zf=Co(),Xf=vo,$f=as,Jf=Yf,ed=Qo,td=go;function rd(e){return new Xf.Promise((function(t,r){var n=e.decompressed.getContentWorker().pipe(new ed);n.on("error",(function(e){r(e)})).on("end",(function(){n.streamInfo.crc32!==e.decompressed.crc32?r(new Error("Corrupted zip : CRC32 mismatch")):t()})).resume()}))}function nd(){if(!(this instanceof nd))return new nd;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var e=new nd;for(var t in this)"function"!=typeof this[t]&&(e[t]=this[t]);return e}}nd.prototype=hf,nd.prototype.loadAsync=function(e,t){var r=this;return t=Zf.extend(t||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:$f.utf8decode}),td.isNode&&td.isStream(e)?Xf.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):Zf.prepareContent("the loaded zip file",e,!0,t.optimizedBinaryString,t.base64).then((function(e){var r=new Jf(t);return r.load(e),r})).then((function(e){var r=[Xf.Promise.resolve(e)],n=e.files;if(t.checkCRC32)for(var i=0;i<n.length;i++)r.push(rd(n[i]));return Xf.Promise.all(r)})).then((function(e){for(var n=e.shift(),i=n.files,a=0;a<i.length;a++){var s=i[a],o=s.fileNameStr,u=Zf.resolve(s.fileNameStr);r.file(u,s.decompressed,{binary:!0,optimizedBinaryString:!0,date:s.date,dir:s.dir,comment:s.fileCommentStr.length?s.fileCommentStr:null,unixPermissions:s.unixPermissions,dosPermissions:s.dosPermissions,createFolders:t.createFolders}),s.dir||(r.file(u).unsafeOriginalName=o)}return n.zipComment.length&&(r.comment=n.zipComment),r}))},nd.support=os,nd.defaults=Po,nd.version="3.10.1",nd.loadAsync=function(e,t){return(new nd).loadAsync(e,t)},nd.external=vo;var id=nd;exports.CertApplyPlugin=class extends e.AbstractTaskPlugin{domains;email;dnsProviderType;dnsProviderAccess;renewDays;forceUpdate;csrInfo;acme;logger;userContext;accessService;http;lastStatus;cert;async onInstance(){this.accessService=this.ctx.accessService,this.logger=this.ctx.logger,this.userContext=this.ctx.userContext,this.http=this.ctx.http,this.lastStatus=this.ctx.lastStatus,this.acme=new g({userContext:this.userContext,logger:this.logger})}async execute(){const e=await this.condition();if(null!=e)return await this.output(e.toCertInfo());const t=await this.doCertApply();if(null==t)throw new Error("申请证书失败");await this.output(t.toCertInfo()),this.clearLastStatus()}async output(e){this.cert=e,await this.zipCert(e)}async zipCert(e){const t=new id;t.file("cert.crt",e.crt),t.file("cert.key",e.key);const r=await t.generateAsync({type:"nodebuffer"});this.saveFile("cert.zip",r)}async condition(){if(this.forceUpdate)return null;let e=!1;let r;JSON.stringify(this.lastStatus?.input?.domains)!==JSON.stringify(this.domains)&&(e=!0);try{r=await this.readLastCert()}catch(e){this.logger.warn("读取cert失败:",e)}if(null==r)return this.logger.info("还未申请过,准备申请新证书"),null;if(e)return this.logger.info("输入参数变更,申请新证书"),null;const n=this.isWillExpire(r.expires,this.renewDays);return n.isWillExpire?(this.logger.info("即将过期,开始更新证书"),null):(this.logger.info(`证书还未过期:过期时间${t(r.expires).format("YYYY-MM-DD HH:mm:ss")},剩余${n.leftDays}天`),r)}async doCertApply(){const t=this.email,r=this.domains,i=this.dnsProviderType,a=this.dnsProviderAccess,s=n.merge({country:"CN",state:"GuangDong",locality:"ShengZhen",organization:"CertD Org.",organizationUnit:"IT Department",emailAddress:t},this.csrInfo);this.logger.info("开始申请证书,",t,r);const o=y.get(i),u=o.target,c=o.define,l=await this.accessService.getById(a),h=new u,f={access:l,logger:this.logger,http:this.http};e.Decorator.inject(c.autowire,h,f),await h.onInstance();const d=await this.acme.order({email:t,domains:r,dnsProvider:h,csrInfo:s,isTest:!1}),p=this.formatCerts(d);return new ts(p)}formatCert(e){return e=(e=(e=e.replace(/\r/g,"")).replace(/\n\n/g,"\n")).replace(/\n$/g,"")}formatCerts(e){return{crt:this.formatCert(e.crt),key:this.formatCert(e.key),csr:this.formatCert(e.csr)}}async readLastCert(){const e=this.lastStatus?.status?.output?.cert;if(null!=e)return new ts(e)}isWillExpire(e,r=20){if(null==e)throw new Error("过期时间不能为空");const n=t(e).diff(t(),"day");return{isWillExpire:n<r,leftDays:n}}},p([e.TaskInput({title:"域名",component:{name:"a-select",vModel:"value",mode:"tags",open:!1},required:!0,col:{span:24},helper:"支持通配符域名,例如: *.foo.com、foo.com、*.test.handsfree.work\n支持多个域名、多个子域名、多个通配符域名打到一个证书上(域名必须是在同一个DNS提供商解析)\n多级子域名要分成多个域名输入(*.foo.com的证书不能用于xxx.yyy.foo.com、foo.com)\n输入一个回车之后,再输入下一个"})],exports.CertApplyPlugin.prototype,"domains",void 0),p([e.TaskInput({title:"邮箱",component:{name:"a-input",vModel:"value"},required:!0,helper:"请输入邮箱"})],exports.CertApplyPlugin.prototype,"email",void 0),p([e.TaskInput({title:"DNS提供商",component:{name:"pi-dns-provider-selector"},required:!0,helper:"请选择dns解析提供商"})],exports.CertApplyPlugin.prototype,"dnsProviderType",void 0),p([e.TaskInput({title:"DNS解析授权",component:{name:"pi-access-selector"},required:!0,helper:"请选择dns解析提供商授权",reference:[{src:"form.dnsProviderType",dest:"component.type",type:"computed"}]})],exports.CertApplyPlugin.prototype,"dnsProviderAccess",void 0),p([e.TaskInput({title:"更新天数",component:{name:"a-input-number",vModel:"value"},required:!0,helper:"到期前多少天后更新证书"})],exports.CertApplyPlugin.prototype,"renewDays",void 0),p([e.TaskInput({title:"强制更新",component:{name:"a-switch",vModel:"checked"},helper:"是否强制重新申请证书"})],exports.CertApplyPlugin.prototype,"forceUpdate",void 0),p([e.TaskInput({title:"CsrInfo"})],exports.CertApplyPlugin.prototype,"csrInfo",void 0),p([e.TaskOutput({title:"域名证书"})],exports.CertApplyPlugin.prototype,"cert",void 0),exports.CertApplyPlugin=p([e.IsTaskPlugin({name:"CertApply",title:"证书申请",desc:"免费通配符域名证书申请,支持多个域名打到同一个证书上",default:{input:{renewDays:20,forceUpdate:!1},strategy:{runStrategy:e.RunStrategy.AlwaysRun}}})],exports.CertApplyPlugin),new exports.CertApplyPlugin,exports.CertReader=ts,exports.DNS_PROVIDER_CLASS_KEY=m,exports.IsDnsProvider=function(t){return r=>{r=e.Decorator.target(r);const i={},a=e.Decorator.getClassProperties(r);for(const t in a){const n=Reflect.getMetadata(e.AUTOWIRE_KEY,r,t);n&&(i[t]=n)}n.merge(t,{autowire:i}),Reflect.defineMetadata(m,t,r),r.define=t,y.register(t.name,{define:t,target:r})}},exports.dnsProviderRegistry=y;
1
+ "use strict";var e=require("@certd/pipeline"),t=require("dayjs"),a=require("@certd/acme-client"),r=require("lodash"),i=require("punycode"),n=require("fs"),o=require("os"),s=require("crypto"),u=require("path"),c=require("stream"),l=require("events"),p=require("buffer"),h=require("util");function d(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(a){if("default"!==a){var r=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,r.get?r:{enumerable:!0,get:function(){return e[a]}})}})),t.default=e,Object.freeze(t)}var m=d(a);function f(e,t,a,r){var i,n=arguments.length,o=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,a):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,a,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n<3?i(o):n>3?i(t,a,o):i(t,a))||o);return n>3&&o&&Object.defineProperty(t,a,o),o}var g="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function y(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var k={},v=["ac","com.ac","edu.ac","gov.ac","net.ac","mil.ac","org.ac","ad","nom.ad","ae","co.ae","net.ae","org.ae","sch.ae","ac.ae","gov.ae","mil.ae","aero","accident-investigation.aero","accident-prevention.aero","aerobatic.aero","aeroclub.aero","aerodrome.aero","agents.aero","aircraft.aero","airline.aero","airport.aero","air-surveillance.aero","airtraffic.aero","air-traffic-control.aero","ambulance.aero","amusement.aero","association.aero","author.aero","ballooning.aero","broker.aero","caa.aero","cargo.aero","catering.aero","certification.aero","championship.aero","charter.aero","civilaviation.aero","club.aero","conference.aero","consultant.aero","consulting.aero","control.aero","council.aero","crew.aero","design.aero","dgca.aero","educator.aero","emergency.aero","engine.aero","engineer.aero","entertainment.aero","equipment.aero","exchange.aero","express.aero","federation.aero","flight.aero","fuel.aero","gliding.aero","government.aero","groundhandling.aero","group.aero","hanggliding.aero","homebuilt.aero","insurance.aero","journal.aero","journalist.aero","leasing.aero","logistics.aero","magazine.aero","maintenance.aero","media.aero","microlight.aero","modelling.aero","navigation.aero","parachuting.aero","paragliding.aero","passenger-association.aero","pilot.aero","press.aero","production.aero","recreation.aero","repbody.aero","res.aero","research.aero","rotorcraft.aero","safety.aero","scientist.aero","services.aero","show.aero","skydiving.aero","software.aero","student.aero","trader.aero","trading.aero","trainer.aero","union.aero","workinggroup.aero","works.aero","af","gov.af","com.af","org.af","net.af","edu.af","ag","com.ag","org.ag","net.ag","co.ag","nom.ag","ai","off.ai","com.ai","net.ai","org.ai","al","com.al","edu.al","gov.al","mil.al","net.al","org.al","am","co.am","com.am","commune.am","net.am","org.am","ao","ed.ao","gv.ao","og.ao","co.ao","pb.ao","it.ao","aq","ar","bet.ar","com.ar","coop.ar","edu.ar","gob.ar","gov.ar","int.ar","mil.ar","musica.ar","mutual.ar","net.ar","org.ar","senasa.ar","tur.ar","arpa","e164.arpa","in-addr.arpa","ip6.arpa","iris.arpa","uri.arpa","urn.arpa","as","gov.as","asia","at","ac.at","co.at","gv.at","or.at","sth.ac.at","au","com.au","net.au","org.au","edu.au","gov.au","asn.au","id.au","info.au","conf.au","oz.au","act.au","nsw.au","nt.au","qld.au","sa.au","tas.au","vic.au","wa.au","act.edu.au","catholic.edu.au","nsw.edu.au","nt.edu.au","qld.edu.au","sa.edu.au","tas.edu.au","vic.edu.au","wa.edu.au","qld.gov.au","sa.gov.au","tas.gov.au","vic.gov.au","wa.gov.au","schools.nsw.edu.au","aw","com.aw","ax","az","com.az","net.az","int.az","gov.az","org.az","edu.az","info.az","pp.az","mil.az","name.az","pro.az","biz.az","ba","com.ba","edu.ba","gov.ba","mil.ba","net.ba","org.ba","bb","biz.bb","co.bb","com.bb","edu.bb","gov.bb","info.bb","net.bb","org.bb","store.bb","tv.bb","*.bd","be","ac.be","bf","gov.bf","bg","a.bg","b.bg","c.bg","d.bg","e.bg","f.bg","g.bg","h.bg","i.bg","j.bg","k.bg","l.bg","m.bg","n.bg","o.bg","p.bg","q.bg","r.bg","s.bg","t.bg","u.bg","v.bg","w.bg","x.bg","y.bg","z.bg","0.bg","1.bg","2.bg","3.bg","4.bg","5.bg","6.bg","7.bg","8.bg","9.bg","bh","com.bh","edu.bh","net.bh","org.bh","gov.bh","bi","co.bi","com.bi","edu.bi","or.bi","org.bi","biz","bj","asso.bj","barreau.bj","gouv.bj","bm","com.bm","edu.bm","gov.bm","net.bm","org.bm","bn","com.bn","edu.bn","gov.bn","net.bn","org.bn","bo","com.bo","edu.bo","gob.bo","int.bo","org.bo","net.bo","mil.bo","tv.bo","web.bo","academia.bo","agro.bo","arte.bo","blog.bo","bolivia.bo","ciencia.bo","cooperativa.bo","democracia.bo","deporte.bo","ecologia.bo","economia.bo","empresa.bo","indigena.bo","industria.bo","info.bo","medicina.bo","movimiento.bo","musica.bo","natural.bo","nombre.bo","noticias.bo","patria.bo","politica.bo","profesional.bo","plurinacional.bo","pueblo.bo","revista.bo","salud.bo","tecnologia.bo","tksat.bo","transporte.bo","wiki.bo","br","9guacu.br","abc.br","adm.br","adv.br","agr.br","aju.br","am.br","anani.br","aparecida.br","app.br","arq.br","art.br","ato.br","b.br","barueri.br","belem.br","bhz.br","bib.br","bio.br","blog.br","bmd.br","boavista.br","bsb.br","campinagrande.br","campinas.br","caxias.br","cim.br","cng.br","cnt.br","com.br","contagem.br","coop.br","coz.br","cri.br","cuiaba.br","curitiba.br","def.br","des.br","det.br","dev.br","ecn.br","eco.br","edu.br","emp.br","enf.br","eng.br","esp.br","etc.br","eti.br","far.br","feira.br","flog.br","floripa.br","fm.br","fnd.br","fortal.br","fot.br","foz.br","fst.br","g12.br","geo.br","ggf.br","goiania.br","gov.br","ac.gov.br","al.gov.br","am.gov.br","ap.gov.br","ba.gov.br","ce.gov.br","df.gov.br","es.gov.br","go.gov.br","ma.gov.br","mg.gov.br","ms.gov.br","mt.gov.br","pa.gov.br","pb.gov.br","pe.gov.br","pi.gov.br","pr.gov.br","rj.gov.br","rn.gov.br","ro.gov.br","rr.gov.br","rs.gov.br","sc.gov.br","se.gov.br","sp.gov.br","to.gov.br","gru.br","imb.br","ind.br","inf.br","jab.br","jampa.br","jdf.br","joinville.br","jor.br","jus.br","leg.br","lel.br","log.br","londrina.br","macapa.br","maceio.br","manaus.br","maringa.br","mat.br","med.br","mil.br","morena.br","mp.br","mus.br","natal.br","net.br","niteroi.br","*.nom.br","not.br","ntr.br","odo.br","ong.br","org.br","osasco.br","palmas.br","poa.br","ppg.br","pro.br","psc.br","psi.br","pvh.br","qsl.br","radio.br","rec.br","recife.br","rep.br","ribeirao.br","rio.br","riobranco.br","riopreto.br","salvador.br","sampa.br","santamaria.br","santoandre.br","saobernardo.br","saogonca.br","seg.br","sjc.br","slg.br","slz.br","sorocaba.br","srv.br","taxi.br","tc.br","tec.br","teo.br","the.br","tmp.br","trd.br","tur.br","tv.br","udi.br","vet.br","vix.br","vlog.br","wiki.br","zlg.br","bs","com.bs","net.bs","org.bs","edu.bs","gov.bs","bt","com.bt","edu.bt","gov.bt","net.bt","org.bt","bv","bw","co.bw","org.bw","by","gov.by","mil.by","com.by","of.by","bz","com.bz","net.bz","org.bz","edu.bz","gov.bz","ca","ab.ca","bc.ca","mb.ca","nb.ca","nf.ca","nl.ca","ns.ca","nt.ca","nu.ca","on.ca","pe.ca","qc.ca","sk.ca","yk.ca","gc.ca","cat","cc","cd","gov.cd","cf","cg","ch","ci","org.ci","or.ci","com.ci","co.ci","edu.ci","ed.ci","ac.ci","net.ci","go.ci","asso.ci","aéroport.ci","int.ci","presse.ci","md.ci","gouv.ci","*.ck","!www.ck","cl","co.cl","gob.cl","gov.cl","mil.cl","cm","co.cm","com.cm","gov.cm","net.cm","cn","ac.cn","com.cn","edu.cn","gov.cn","net.cn","org.cn","mil.cn","公司.cn","网络.cn","網絡.cn","ah.cn","bj.cn","cq.cn","fj.cn","gd.cn","gs.cn","gz.cn","gx.cn","ha.cn","hb.cn","he.cn","hi.cn","hl.cn","hn.cn","jl.cn","js.cn","jx.cn","ln.cn","nm.cn","nx.cn","qh.cn","sc.cn","sd.cn","sh.cn","sn.cn","sx.cn","tj.cn","xj.cn","xz.cn","yn.cn","zj.cn","hk.cn","mo.cn","tw.cn","co","arts.co","com.co","edu.co","firm.co","gov.co","info.co","int.co","mil.co","net.co","nom.co","org.co","rec.co","web.co","com","coop","cr","ac.cr","co.cr","ed.cr","fi.cr","go.cr","or.cr","sa.cr","cu","com.cu","edu.cu","org.cu","net.cu","gov.cu","inf.cu","cv","com.cv","edu.cv","int.cv","nome.cv","org.cv","cw","com.cw","edu.cw","net.cw","org.cw","cx","gov.cx","cy","ac.cy","biz.cy","com.cy","ekloges.cy","gov.cy","ltd.cy","mil.cy","net.cy","org.cy","press.cy","pro.cy","tm.cy","cz","de","dj","dk","dm","com.dm","net.dm","org.dm","edu.dm","gov.dm","do","art.do","com.do","edu.do","gob.do","gov.do","mil.do","net.do","org.do","sld.do","web.do","dz","art.dz","asso.dz","com.dz","edu.dz","gov.dz","org.dz","net.dz","pol.dz","soc.dz","tm.dz","ec","com.ec","info.ec","net.ec","fin.ec","k12.ec","med.ec","pro.ec","org.ec","edu.ec","gov.ec","gob.ec","mil.ec","edu","ee","edu.ee","gov.ee","riik.ee","lib.ee","med.ee","com.ee","pri.ee","aip.ee","org.ee","fie.ee","eg","com.eg","edu.eg","eun.eg","gov.eg","mil.eg","name.eg","net.eg","org.eg","sci.eg","*.er","es","com.es","nom.es","org.es","gob.es","edu.es","et","com.et","gov.et","org.et","edu.et","biz.et","name.et","info.et","net.et","eu","fi","aland.fi","fj","ac.fj","biz.fj","com.fj","gov.fj","info.fj","mil.fj","name.fj","net.fj","org.fj","pro.fj","*.fk","com.fm","edu.fm","net.fm","org.fm","fm","fo","fr","asso.fr","com.fr","gouv.fr","nom.fr","prd.fr","tm.fr","aeroport.fr","avocat.fr","avoues.fr","cci.fr","chambagri.fr","chirurgiens-dentistes.fr","experts-comptables.fr","geometre-expert.fr","greta.fr","huissier-justice.fr","medecin.fr","notaires.fr","pharmacien.fr","port.fr","veterinaire.fr","ga","gb","edu.gd","gov.gd","gd","ge","com.ge","edu.ge","gov.ge","org.ge","mil.ge","net.ge","pvt.ge","gf","gg","co.gg","net.gg","org.gg","gh","com.gh","edu.gh","gov.gh","org.gh","mil.gh","gi","com.gi","ltd.gi","gov.gi","mod.gi","edu.gi","org.gi","gl","co.gl","com.gl","edu.gl","net.gl","org.gl","gm","gn","ac.gn","com.gn","edu.gn","gov.gn","org.gn","net.gn","gov","gp","com.gp","net.gp","mobi.gp","edu.gp","org.gp","asso.gp","gq","gr","com.gr","edu.gr","net.gr","org.gr","gov.gr","gs","gt","com.gt","edu.gt","gob.gt","ind.gt","mil.gt","net.gt","org.gt","gu","com.gu","edu.gu","gov.gu","guam.gu","info.gu","net.gu","org.gu","web.gu","gw","gy","co.gy","com.gy","edu.gy","gov.gy","net.gy","org.gy","hk","com.hk","edu.hk","gov.hk","idv.hk","net.hk","org.hk","公司.hk","教育.hk","敎育.hk","政府.hk","個人.hk","个��.hk","箇人.hk","網络.hk","网络.hk","组織.hk","網絡.hk","网絡.hk","组织.hk","組織.hk","組织.hk","hm","hn","com.hn","edu.hn","org.hn","net.hn","mil.hn","gob.hn","hr","iz.hr","from.hr","name.hr","com.hr","ht","com.ht","shop.ht","firm.ht","info.ht","adult.ht","net.ht","pro.ht","org.ht","med.ht","art.ht","coop.ht","pol.ht","asso.ht","edu.ht","rel.ht","gouv.ht","perso.ht","hu","co.hu","info.hu","org.hu","priv.hu","sport.hu","tm.hu","2000.hu","agrar.hu","bolt.hu","casino.hu","city.hu","erotica.hu","erotika.hu","film.hu","forum.hu","games.hu","hotel.hu","ingatlan.hu","jogasz.hu","konyvelo.hu","lakas.hu","media.hu","news.hu","reklam.hu","sex.hu","shop.hu","suli.hu","szex.hu","tozsde.hu","utazas.hu","video.hu","id","ac.id","biz.id","co.id","desa.id","go.id","mil.id","my.id","net.id","or.id","ponpes.id","sch.id","web.id","ie","gov.ie","il","ac.il","co.il","gov.il","idf.il","k12.il","muni.il","net.il","org.il","im","ac.im","co.im","com.im","ltd.co.im","net.im","org.im","plc.co.im","tt.im","tv.im","in","co.in","firm.in","net.in","org.in","gen.in","ind.in","nic.in","ac.in","edu.in","res.in","gov.in","mil.in","info","int","eu.int","io","com.io","iq","gov.iq","edu.iq","mil.iq","com.iq","org.iq","net.iq","ir","ac.ir","co.ir","gov.ir","id.ir","net.ir","org.ir","sch.ir","ایران.ir","ايران.ir","is","net.is","com.is","edu.is","gov.is","org.is","int.is","it","gov.it","edu.it","abr.it","abruzzo.it","aosta-valley.it","aostavalley.it","bas.it","basilicata.it","cal.it","calabria.it","cam.it","campania.it","emilia-romagna.it","emiliaromagna.it","emr.it","friuli-v-giulia.it","friuli-ve-giulia.it","friuli-vegiulia.it","friuli-venezia-giulia.it","friuli-veneziagiulia.it","friuli-vgiulia.it","friuliv-giulia.it","friulive-giulia.it","friulivegiulia.it","friulivenezia-giulia.it","friuliveneziagiulia.it","friulivgiulia.it","fvg.it","laz.it","lazio.it","lig.it","liguria.it","lom.it","lombardia.it","lombardy.it","lucania.it","mar.it","marche.it","mol.it","molise.it","piedmont.it","piemonte.it","pmn.it","pug.it","puglia.it","sar.it","sardegna.it","sardinia.it","sic.it","sicilia.it","sicily.it","taa.it","tos.it","toscana.it","trentin-sud-tirol.it","trentin-süd-tirol.it","trentin-sudtirol.it","trentin-südtirol.it","trentin-sued-tirol.it","trentin-suedtirol.it","trentino-a-adige.it","trentino-aadige.it","trentino-alto-adige.it","trentino-altoadige.it","trentino-s-tirol.it","trentino-stirol.it","trentino-sud-tirol.it","trentino-süd-tirol.it","trentino-sudtirol.it","trentino-südtirol.it","trentino-sued-tirol.it","trentino-suedtirol.it","trentino.it","trentinoa-adige.it","trentinoaadige.it","trentinoalto-adige.it","trentinoaltoadige.it","trentinos-tirol.it","trentinostirol.it","trentinosud-tirol.it","trentinosüd-tirol.it","trentinosudtirol.it","trentinosüdtirol.it","trentinosued-tirol.it","trentinosuedtirol.it","trentinsud-tirol.it","trentinsüd-tirol.it","trentinsudtirol.it","trentinsüdtirol.it","trentinsued-tirol.it","trentinsuedtirol.it","tuscany.it","umb.it","umbria.it","val-d-aosta.it","val-daosta.it","vald-aosta.it","valdaosta.it","valle-aosta.it","valle-d-aosta.it","valle-daosta.it","valleaosta.it","valled-aosta.it","valledaosta.it","vallee-aoste.it","vallée-aoste.it","vallee-d-aoste.it","vallée-d-aoste.it","valleeaoste.it","valléeaoste.it","valleedaoste.it","valléedaoste.it","vao.it","vda.it","ven.it","veneto.it","ag.it","agrigento.it","al.it","alessandria.it","alto-adige.it","altoadige.it","an.it","ancona.it","andria-barletta-trani.it","andria-trani-barletta.it","andriabarlettatrani.it","andriatranibarletta.it","ao.it","aosta.it","aoste.it","ap.it","aq.it","aquila.it","ar.it","arezzo.it","ascoli-piceno.it","ascolipiceno.it","asti.it","at.it","av.it","avellino.it","ba.it","balsan-sudtirol.it","balsan-südtirol.it","balsan-suedtirol.it","balsan.it","bari.it","barletta-trani-andria.it","barlettatraniandria.it","belluno.it","benevento.it","bergamo.it","bg.it","bi.it","biella.it","bl.it","bn.it","bo.it","bologna.it","bolzano-altoadige.it","bolzano.it","bozen-sudtirol.it","bozen-südtirol.it","bozen-suedtirol.it","bozen.it","br.it","brescia.it","brindisi.it","bs.it","bt.it","bulsan-sudtirol.it","bulsan-südtirol.it","bulsan-suedtirol.it","bulsan.it","bz.it","ca.it","cagliari.it","caltanissetta.it","campidano-medio.it","campidanomedio.it","campobasso.it","carbonia-iglesias.it","carboniaiglesias.it","carrara-massa.it","carraramassa.it","caserta.it","catania.it","catanzaro.it","cb.it","ce.it","cesena-forli.it","cesena-forlì.it","cesenaforli.it","cesenaforlì.it","ch.it","chieti.it","ci.it","cl.it","cn.it","co.it","como.it","cosenza.it","cr.it","cremona.it","crotone.it","cs.it","ct.it","cuneo.it","cz.it","dell-ogliastra.it","dellogliastra.it","en.it","enna.it","fc.it","fe.it","fermo.it","ferrara.it","fg.it","fi.it","firenze.it","florence.it","fm.it","foggia.it","forli-cesena.it","forlì-cesena.it","forlicesena.it","forlìcesena.it","fr.it","frosinone.it","ge.it","genoa.it","genova.it","go.it","gorizia.it","gr.it","grosseto.it","iglesias-carbonia.it","iglesiascarbonia.it","im.it","imperia.it","is.it","isernia.it","kr.it","la-spezia.it","laquila.it","laspezia.it","latina.it","lc.it","le.it","lecce.it","lecco.it","li.it","livorno.it","lo.it","lodi.it","lt.it","lu.it","lucca.it","macerata.it","mantova.it","massa-carrara.it","massacarrara.it","matera.it","mb.it","mc.it","me.it","medio-campidano.it","mediocampidano.it","messina.it","mi.it","milan.it","milano.it","mn.it","mo.it","modena.it","monza-brianza.it","monza-e-della-brianza.it","monza.it","monzabrianza.it","monzaebrianza.it","monzaedellabrianza.it","ms.it","mt.it","na.it","naples.it","napoli.it","no.it","novara.it","nu.it","nuoro.it","og.it","ogliastra.it","olbia-tempio.it","olbiatempio.it","or.it","oristano.it","ot.it","pa.it","padova.it","padua.it","palermo.it","parma.it","pavia.it","pc.it","pd.it","pe.it","perugia.it","pesaro-urbino.it","pesarourbino.it","pescara.it","pg.it","pi.it","piacenza.it","pisa.it","pistoia.it","pn.it","po.it","pordenone.it","potenza.it","pr.it","prato.it","pt.it","pu.it","pv.it","pz.it","ra.it","ragusa.it","ravenna.it","rc.it","re.it","reggio-calabria.it","reggio-emilia.it","reggiocalabria.it","reggioemilia.it","rg.it","ri.it","rieti.it","rimini.it","rm.it","rn.it","ro.it","roma.it","rome.it","rovigo.it","sa.it","salerno.it","sassari.it","savona.it","si.it","siena.it","siracusa.it","so.it","sondrio.it","sp.it","sr.it","ss.it","suedtirol.it","südtirol.it","sv.it","ta.it","taranto.it","te.it","tempio-olbia.it","tempioolbia.it","teramo.it","terni.it","tn.it","to.it","torino.it","tp.it","tr.it","trani-andria-barletta.it","trani-barletta-andria.it","traniandriabarletta.it","tranibarlettaandria.it","trapani.it","trento.it","treviso.it","trieste.it","ts.it","turin.it","tv.it","ud.it","udine.it","urbino-pesaro.it","urbinopesaro.it","va.it","varese.it","vb.it","vc.it","ve.it","venezia.it","venice.it","verbania.it","vercelli.it","verona.it","vi.it","vibo-valentia.it","vibovalentia.it","vicenza.it","viterbo.it","vr.it","vs.it","vt.it","vv.it","je","co.je","net.je","org.je","*.jm","jo","com.jo","org.jo","net.jo","edu.jo","sch.jo","gov.jo","mil.jo","name.jo","jobs","jp","ac.jp","ad.jp","co.jp","ed.jp","go.jp","gr.jp","lg.jp","ne.jp","or.jp","aichi.jp","akita.jp","aomori.jp","chiba.jp","ehime.jp","fukui.jp","fukuoka.jp","fukushima.jp","gifu.jp","gunma.jp","hiroshima.jp","hokkaido.jp","hyogo.jp","ibaraki.jp","ishikawa.jp","iwate.jp","kagawa.jp","kagoshima.jp","kanagawa.jp","kochi.jp","kumamoto.jp","kyoto.jp","mie.jp","miyagi.jp","miyazaki.jp","nagano.jp","nagasaki.jp","nara.jp","niigata.jp","oita.jp","okayama.jp","okinawa.jp","osaka.jp","saga.jp","saitama.jp","shiga.jp","shimane.jp","shizuoka.jp","tochigi.jp","tokushima.jp","tokyo.jp","tottori.jp","toyama.jp","wakayama.jp","yamagata.jp","yamaguchi.jp","yamanashi.jp","栃木.jp","愛知.jp","愛媛.jp","兵庫.jp","熊本.jp","茨城.jp","北海道.jp","千葉.jp","和歌山.jp","長崎.jp","長野.jp","新潟.jp","青森.jp","静岡.jp","東京.jp","石川.jp","埼玉.jp","三重.jp","京都.jp","佐賀.jp","大分.jp","大阪.jp","奈良.jp","宮城.jp","宮崎.jp","富山.jp","山口.jp","山形.jp","山梨.jp","岩手.jp","岐阜.jp","岡山.jp","島根.jp","広島.jp","徳島.jp","沖縄.jp","滋賀.jp","神奈川.jp","福井.jp","福岡.jp","福島.jp","秋田.jp","群馬.jp","香川.jp","高知.jp","鳥取.jp","鹿児島.jp","*.kawasaki.jp","*.kitakyushu.jp","*.kobe.jp","*.nagoya.jp","*.sapporo.jp","*.sendai.jp","*.yokohama.jp","!city.kawasaki.jp","!city.kitakyushu.jp","!city.kobe.jp","!city.nagoya.jp","!city.sapporo.jp","!city.sendai.jp","!city.yokohama.jp","aisai.aichi.jp","ama.aichi.jp","anjo.aichi.jp","asuke.aichi.jp","chiryu.aichi.jp","chita.aichi.jp","fuso.aichi.jp","gamagori.aichi.jp","handa.aichi.jp","hazu.aichi.jp","hekinan.aichi.jp","higashiura.aichi.jp","ichinomiya.aichi.jp","inazawa.aichi.jp","inuyama.aichi.jp","isshiki.aichi.jp","iwakura.aichi.jp","kanie.aichi.jp","kariya.aichi.jp","kasugai.aichi.jp","kira.aichi.jp","kiyosu.aichi.jp","komaki.aichi.jp","konan.aichi.jp","kota.aichi.jp","mihama.aichi.jp","miyoshi.aichi.jp","nishio.aichi.jp","nisshin.aichi.jp","obu.aichi.jp","oguchi.aichi.jp","oharu.aichi.jp","okazaki.aichi.jp","owariasahi.aichi.jp","seto.aichi.jp","shikatsu.aichi.jp","shinshiro.aichi.jp","shitara.aichi.jp","tahara.aichi.jp","takahama.aichi.jp","tobishima.aichi.jp","toei.aichi.jp","togo.aichi.jp","tokai.aichi.jp","tokoname.aichi.jp","toyoake.aichi.jp","toyohashi.aichi.jp","toyokawa.aichi.jp","toyone.aichi.jp","toyota.aichi.jp","tsushima.aichi.jp","yatomi.aichi.jp","akita.akita.jp","daisen.akita.jp","fujisato.akita.jp","gojome.akita.jp","hachirogata.akita.jp","happou.akita.jp","higashinaruse.akita.jp","honjo.akita.jp","honjyo.akita.jp","ikawa.akita.jp","kamikoani.akita.jp","kamioka.akita.jp","katagami.akita.jp","kazuno.akita.jp","kitaakita.akita.jp","kosaka.akita.jp","kyowa.akita.jp","misato.akita.jp","mitane.akita.jp","moriyoshi.akita.jp","nikaho.akita.jp","noshiro.akita.jp","odate.akita.jp","oga.akita.jp","ogata.akita.jp","semboku.akita.jp","yokote.akita.jp","yurihonjo.akita.jp","aomori.aomori.jp","gonohe.aomori.jp","hachinohe.aomori.jp","hashikami.aomori.jp","hiranai.aomori.jp","hirosaki.aomori.jp","itayanagi.aomori.jp","kuroishi.aomori.jp","misawa.aomori.jp","mutsu.aomori.jp","nakadomari.aomori.jp","noheji.aomori.jp","oirase.aomori.jp","owani.aomori.jp","rokunohe.aomori.jp","sannohe.aomori.jp","shichinohe.aomori.jp","shingo.aomori.jp","takko.aomori.jp","towada.aomori.jp","tsugaru.aomori.jp","tsuruta.aomori.jp","abiko.chiba.jp","asahi.chiba.jp","chonan.chiba.jp","chosei.chiba.jp","choshi.chiba.jp","chuo.chiba.jp","funabashi.chiba.jp","futtsu.chiba.jp","hanamigawa.chiba.jp","ichihara.chiba.jp","ichikawa.chiba.jp","ichinomiya.chiba.jp","inzai.chiba.jp","isumi.chiba.jp","kamagaya.chiba.jp","kamogawa.chiba.jp","kashiwa.chiba.jp","katori.chiba.jp","katsuura.chiba.jp","kimitsu.chiba.jp","kisarazu.chiba.jp","kozaki.chiba.jp","kujukuri.chiba.jp","kyonan.chiba.jp","matsudo.chiba.jp","midori.chiba.jp","mihama.chiba.jp","minamiboso.chiba.jp","mobara.chiba.jp","mutsuzawa.chiba.jp","nagara.chiba.jp","nagareyama.chiba.jp","narashino.chiba.jp","narita.chiba.jp","noda.chiba.jp","oamishirasato.chiba.jp","omigawa.chiba.jp","onjuku.chiba.jp","otaki.chiba.jp","sakae.chiba.jp","sakura.chiba.jp","shimofusa.chiba.jp","shirako.chiba.jp","shiroi.chiba.jp","shisui.chiba.jp","sodegaura.chiba.jp","sosa.chiba.jp","tako.chiba.jp","tateyama.chiba.jp","togane.chiba.jp","tohnosho.chiba.jp","tomisato.chiba.jp","urayasu.chiba.jp","yachimata.chiba.jp","yachiyo.chiba.jp","yokaichiba.chiba.jp","yokoshibahikari.chiba.jp","yotsukaido.chiba.jp","ainan.ehime.jp","honai.ehime.jp","ikata.ehime.jp","imabari.ehime.jp","iyo.ehime.jp","kamijima.ehime.jp","kihoku.ehime.jp","kumakogen.ehime.jp","masaki.ehime.jp","matsuno.ehime.jp","matsuyama.ehime.jp","namikata.ehime.jp","niihama.ehime.jp","ozu.ehime.jp","saijo.ehime.jp","seiyo.ehime.jp","shikokuchuo.ehime.jp","tobe.ehime.jp","toon.ehime.jp","uchiko.ehime.jp","uwajima.ehime.jp","yawatahama.ehime.jp","echizen.fukui.jp","eiheiji.fukui.jp","fukui.fukui.jp","ikeda.fukui.jp","katsuyama.fukui.jp","mihama.fukui.jp","minamiechizen.fukui.jp","obama.fukui.jp","ohi.fukui.jp","ono.fukui.jp","sabae.fukui.jp","sakai.fukui.jp","takahama.fukui.jp","tsuruga.fukui.jp","wakasa.fukui.jp","ashiya.fukuoka.jp","buzen.fukuoka.jp","chikugo.fukuoka.jp","chikuho.fukuoka.jp","chikujo.fukuoka.jp","chikushino.fukuoka.jp","chikuzen.fukuoka.jp","chuo.fukuoka.jp","dazaifu.fukuoka.jp","fukuchi.fukuoka.jp","hakata.fukuoka.jp","higashi.fukuoka.jp","hirokawa.fukuoka.jp","hisayama.fukuoka.jp","iizuka.fukuoka.jp","inatsuki.fukuoka.jp","kaho.fukuoka.jp","kasuga.fukuoka.jp","kasuya.fukuoka.jp","kawara.fukuoka.jp","keisen.fukuoka.jp","koga.fukuoka.jp","kurate.fukuoka.jp","kurogi.fukuoka.jp","kurume.fukuoka.jp","minami.fukuoka.jp","miyako.fukuoka.jp","miyama.fukuoka.jp","miyawaka.fukuoka.jp","mizumaki.fukuoka.jp","munakata.fukuoka.jp","nakagawa.fukuoka.jp","nakama.fukuoka.jp","nishi.fukuoka.jp","nogata.fukuoka.jp","ogori.fukuoka.jp","okagaki.fukuoka.jp","okawa.fukuoka.jp","oki.fukuoka.jp","omuta.fukuoka.jp","onga.fukuoka.jp","onojo.fukuoka.jp","oto.fukuoka.jp","saigawa.fukuoka.jp","sasaguri.fukuoka.jp","shingu.fukuoka.jp","shinyoshitomi.fukuoka.jp","shonai.fukuoka.jp","soeda.fukuoka.jp","sue.fukuoka.jp","tachiarai.fukuoka.jp","tagawa.fukuoka.jp","takata.fukuoka.jp","toho.fukuoka.jp","toyotsu.fukuoka.jp","tsuiki.fukuoka.jp","ukiha.fukuoka.jp","umi.fukuoka.jp","usui.fukuoka.jp","yamada.fukuoka.jp","yame.fukuoka.jp","yanagawa.fukuoka.jp","yukuhashi.fukuoka.jp","aizubange.fukushima.jp","aizumisato.fukushima.jp","aizuwakamatsu.fukushima.jp","asakawa.fukushima.jp","bandai.fukushima.jp","date.fukushima.jp","fukushima.fukushima.jp","furudono.fukushima.jp","futaba.fukushima.jp","hanawa.fukushima.jp","higashi.fukushima.jp","hirata.fukushima.jp","hirono.fukushima.jp","iitate.fukushima.jp","inawashiro.fukushima.jp","ishikawa.fukushima.jp","iwaki.fukushima.jp","izumizaki.fukushima.jp","kagamiishi.fukushima.jp","kaneyama.fukushima.jp","kawamata.fukushima.jp","kitakata.fukushima.jp","kitashiobara.fukushima.jp","koori.fukushima.jp","koriyama.fukushima.jp","kunimi.fukushima.jp","miharu.fukushima.jp","mishima.fukushima.jp","namie.fukushima.jp","nango.fukushima.jp","nishiaizu.fukushima.jp","nishigo.fukushima.jp","okuma.fukushima.jp","omotego.fukushima.jp","ono.fukushima.jp","otama.fukushima.jp","samegawa.fukushima.jp","shimogo.fukushima.jp","shirakawa.fukushima.jp","showa.fukushima.jp","soma.fukushima.jp","sukagawa.fukushima.jp","taishin.fukushima.jp","tamakawa.fukushima.jp","tanagura.fukushima.jp","tenei.fukushima.jp","yabuki.fukushima.jp","yamato.fukushima.jp","yamatsuri.fukushima.jp","yanaizu.fukushima.jp","yugawa.fukushima.jp","anpachi.gifu.jp","ena.gifu.jp","gifu.gifu.jp","ginan.gifu.jp","godo.gifu.jp","gujo.gifu.jp","hashima.gifu.jp","hichiso.gifu.jp","hida.gifu.jp","higashishirakawa.gifu.jp","ibigawa.gifu.jp","ikeda.gifu.jp","kakamigahara.gifu.jp","kani.gifu.jp","kasahara.gifu.jp","kasamatsu.gifu.jp","kawaue.gifu.jp","kitagata.gifu.jp","mino.gifu.jp","minokamo.gifu.jp","mitake.gifu.jp","mizunami.gifu.jp","motosu.gifu.jp","nakatsugawa.gifu.jp","ogaki.gifu.jp","sakahogi.gifu.jp","seki.gifu.jp","sekigahara.gifu.jp","shirakawa.gifu.jp","tajimi.gifu.jp","takayama.gifu.jp","tarui.gifu.jp","toki.gifu.jp","tomika.gifu.jp","wanouchi.gifu.jp","yamagata.gifu.jp","yaotsu.gifu.jp","yoro.gifu.jp","annaka.gunma.jp","chiyoda.gunma.jp","fujioka.gunma.jp","higashiagatsuma.gunma.jp","isesaki.gunma.jp","itakura.gunma.jp","kanna.gunma.jp","kanra.gunma.jp","katashina.gunma.jp","kawaba.gunma.jp","kiryu.gunma.jp","kusatsu.gunma.jp","maebashi.gunma.jp","meiwa.gunma.jp","midori.gunma.jp","minakami.gunma.jp","naganohara.gunma.jp","nakanojo.gunma.jp","nanmoku.gunma.jp","numata.gunma.jp","oizumi.gunma.jp","ora.gunma.jp","ota.gunma.jp","shibukawa.gunma.jp","shimonita.gunma.jp","shinto.gunma.jp","showa.gunma.jp","takasaki.gunma.jp","takayama.gunma.jp","tamamura.gunma.jp","tatebayashi.gunma.jp","tomioka.gunma.jp","tsukiyono.gunma.jp","tsumagoi.gunma.jp","ueno.gunma.jp","yoshioka.gunma.jp","asaminami.hiroshima.jp","daiwa.hiroshima.jp","etajima.hiroshima.jp","fuchu.hiroshima.jp","fukuyama.hiroshima.jp","hatsukaichi.hiroshima.jp","higashihiroshima.hiroshima.jp","hongo.hiroshima.jp","jinsekikogen.hiroshima.jp","kaita.hiroshima.jp","kui.hiroshima.jp","kumano.hiroshima.jp","kure.hiroshima.jp","mihara.hiroshima.jp","miyoshi.hiroshima.jp","naka.hiroshima.jp","onomichi.hiroshima.jp","osakikamijima.hiroshima.jp","otake.hiroshima.jp","saka.hiroshima.jp","sera.hiroshima.jp","seranishi.hiroshima.jp","shinichi.hiroshima.jp","shobara.hiroshima.jp","takehara.hiroshima.jp","abashiri.hokkaido.jp","abira.hokkaido.jp","aibetsu.hokkaido.jp","akabira.hokkaido.jp","akkeshi.hokkaido.jp","asahikawa.hokkaido.jp","ashibetsu.hokkaido.jp","ashoro.hokkaido.jp","assabu.hokkaido.jp","atsuma.hokkaido.jp","bibai.hokkaido.jp","biei.hokkaido.jp","bifuka.hokkaido.jp","bihoro.hokkaido.jp","biratori.hokkaido.jp","chippubetsu.hokkaido.jp","chitose.hokkaido.jp","date.hokkaido.jp","ebetsu.hokkaido.jp","embetsu.hokkaido.jp","eniwa.hokkaido.jp","erimo.hokkaido.jp","esan.hokkaido.jp","esashi.hokkaido.jp","fukagawa.hokkaido.jp","fukushima.hokkaido.jp","furano.hokkaido.jp","furubira.hokkaido.jp","haboro.hokkaido.jp","hakodate.hokkaido.jp","hamatonbetsu.hokkaido.jp","hidaka.hokkaido.jp","higashikagura.hokkaido.jp","higashikawa.hokkaido.jp","hiroo.hokkaido.jp","hokuryu.hokkaido.jp","hokuto.hokkaido.jp","honbetsu.hokkaido.jp","horokanai.hokkaido.jp","horonobe.hokkaido.jp","ikeda.hokkaido.jp","imakane.hokkaido.jp","ishikari.hokkaido.jp","iwamizawa.hokkaido.jp","iwanai.hokkaido.jp","kamifurano.hokkaido.jp","kamikawa.hokkaido.jp","kamishihoro.hokkaido.jp","kamisunagawa.hokkaido.jp","kamoenai.hokkaido.jp","kayabe.hokkaido.jp","kembuchi.hokkaido.jp","kikonai.hokkaido.jp","kimobetsu.hokkaido.jp","kitahiroshima.hokkaido.jp","kitami.hokkaido.jp","kiyosato.hokkaido.jp","koshimizu.hokkaido.jp","kunneppu.hokkaido.jp","kuriyama.hokkaido.jp","kuromatsunai.hokkaido.jp","kushiro.hokkaido.jp","kutchan.hokkaido.jp","kyowa.hokkaido.jp","mashike.hokkaido.jp","matsumae.hokkaido.jp","mikasa.hokkaido.jp","minamifurano.hokkaido.jp","mombetsu.hokkaido.jp","moseushi.hokkaido.jp","mukawa.hokkaido.jp","muroran.hokkaido.jp","naie.hokkaido.jp","nakagawa.hokkaido.jp","nakasatsunai.hokkaido.jp","nakatombetsu.hokkaido.jp","nanae.hokkaido.jp","nanporo.hokkaido.jp","nayoro.hokkaido.jp","nemuro.hokkaido.jp","niikappu.hokkaido.jp","niki.hokkaido.jp","nishiokoppe.hokkaido.jp","noboribetsu.hokkaido.jp","numata.hokkaido.jp","obihiro.hokkaido.jp","obira.hokkaido.jp","oketo.hokkaido.jp","okoppe.hokkaido.jp","otaru.hokkaido.jp","otobe.hokkaido.jp","otofuke.hokkaido.jp","otoineppu.hokkaido.jp","oumu.hokkaido.jp","ozora.hokkaido.jp","pippu.hokkaido.jp","rankoshi.hokkaido.jp","rebun.hokkaido.jp","rikubetsu.hokkaido.jp","rishiri.hokkaido.jp","rishirifuji.hokkaido.jp","saroma.hokkaido.jp","sarufutsu.hokkaido.jp","shakotan.hokkaido.jp","shari.hokkaido.jp","shibecha.hokkaido.jp","shibetsu.hokkaido.jp","shikabe.hokkaido.jp","shikaoi.hokkaido.jp","shimamaki.hokkaido.jp","shimizu.hokkaido.jp","shimokawa.hokkaido.jp","shinshinotsu.hokkaido.jp","shintoku.hokkaido.jp","shiranuka.hokkaido.jp","shiraoi.hokkaido.jp","shiriuchi.hokkaido.jp","sobetsu.hokkaido.jp","sunagawa.hokkaido.jp","taiki.hokkaido.jp","takasu.hokkaido.jp","takikawa.hokkaido.jp","takinoue.hokkaido.jp","teshikaga.hokkaido.jp","tobetsu.hokkaido.jp","tohma.hokkaido.jp","tomakomai.hokkaido.jp","tomari.hokkaido.jp","toya.hokkaido.jp","toyako.hokkaido.jp","toyotomi.hokkaido.jp","toyoura.hokkaido.jp","tsubetsu.hokkaido.jp","tsukigata.hokkaido.jp","urakawa.hokkaido.jp","urausu.hokkaido.jp","uryu.hokkaido.jp","utashinai.hokkaido.jp","wakkanai.hokkaido.jp","wassamu.hokkaido.jp","yakumo.hokkaido.jp","yoichi.hokkaido.jp","aioi.hyogo.jp","akashi.hyogo.jp","ako.hyogo.jp","amagasaki.hyogo.jp","aogaki.hyogo.jp","asago.hyogo.jp","ashiya.hyogo.jp","awaji.hyogo.jp","fukusaki.hyogo.jp","goshiki.hyogo.jp","harima.hyogo.jp","himeji.hyogo.jp","ichikawa.hyogo.jp","inagawa.hyogo.jp","itami.hyogo.jp","kakogawa.hyogo.jp","kamigori.hyogo.jp","kamikawa.hyogo.jp","kasai.hyogo.jp","kasuga.hyogo.jp","kawanishi.hyogo.jp","miki.hyogo.jp","minamiawaji.hyogo.jp","nishinomiya.hyogo.jp","nishiwaki.hyogo.jp","ono.hyogo.jp","sanda.hyogo.jp","sannan.hyogo.jp","sasayama.hyogo.jp","sayo.hyogo.jp","shingu.hyogo.jp","shinonsen.hyogo.jp","shiso.hyogo.jp","sumoto.hyogo.jp","taishi.hyogo.jp","taka.hyogo.jp","takarazuka.hyogo.jp","takasago.hyogo.jp","takino.hyogo.jp","tamba.hyogo.jp","tatsuno.hyogo.jp","toyooka.hyogo.jp","yabu.hyogo.jp","yashiro.hyogo.jp","yoka.hyogo.jp","yokawa.hyogo.jp","ami.ibaraki.jp","asahi.ibaraki.jp","bando.ibaraki.jp","chikusei.ibaraki.jp","daigo.ibaraki.jp","fujishiro.ibaraki.jp","hitachi.ibaraki.jp","hitachinaka.ibaraki.jp","hitachiomiya.ibaraki.jp","hitachiota.ibaraki.jp","ibaraki.ibaraki.jp","ina.ibaraki.jp","inashiki.ibaraki.jp","itako.ibaraki.jp","iwama.ibaraki.jp","joso.ibaraki.jp","kamisu.ibaraki.jp","kasama.ibaraki.jp","kashima.ibaraki.jp","kasumigaura.ibaraki.jp","koga.ibaraki.jp","miho.ibaraki.jp","mito.ibaraki.jp","moriya.ibaraki.jp","naka.ibaraki.jp","namegata.ibaraki.jp","oarai.ibaraki.jp","ogawa.ibaraki.jp","omitama.ibaraki.jp","ryugasaki.ibaraki.jp","sakai.ibaraki.jp","sakuragawa.ibaraki.jp","shimodate.ibaraki.jp","shimotsuma.ibaraki.jp","shirosato.ibaraki.jp","sowa.ibaraki.jp","suifu.ibaraki.jp","takahagi.ibaraki.jp","tamatsukuri.ibaraki.jp","tokai.ibaraki.jp","tomobe.ibaraki.jp","tone.ibaraki.jp","toride.ibaraki.jp","tsuchiura.ibaraki.jp","tsukuba.ibaraki.jp","uchihara.ibaraki.jp","ushiku.ibaraki.jp","yachiyo.ibaraki.jp","yamagata.ibaraki.jp","yawara.ibaraki.jp","yuki.ibaraki.jp","anamizu.ishikawa.jp","hakui.ishikawa.jp","hakusan.ishikawa.jp","kaga.ishikawa.jp","kahoku.ishikawa.jp","kanazawa.ishikawa.jp","kawakita.ishikawa.jp","komatsu.ishikawa.jp","nakanoto.ishikawa.jp","nanao.ishikawa.jp","nomi.ishikawa.jp","nonoichi.ishikawa.jp","noto.ishikawa.jp","shika.ishikawa.jp","suzu.ishikawa.jp","tsubata.ishikawa.jp","tsurugi.ishikawa.jp","uchinada.ishikawa.jp","wajima.ishikawa.jp","fudai.iwate.jp","fujisawa.iwate.jp","hanamaki.iwate.jp","hiraizumi.iwate.jp","hirono.iwate.jp","ichinohe.iwate.jp","ichinoseki.iwate.jp","iwaizumi.iwate.jp","iwate.iwate.jp","joboji.iwate.jp","kamaishi.iwate.jp","kanegasaki.iwate.jp","karumai.iwate.jp","kawai.iwate.jp","kitakami.iwate.jp","kuji.iwate.jp","kunohe.iwate.jp","kuzumaki.iwate.jp","miyako.iwate.jp","mizusawa.iwate.jp","morioka.iwate.jp","ninohe.iwate.jp","noda.iwate.jp","ofunato.iwate.jp","oshu.iwate.jp","otsuchi.iwate.jp","rikuzentakata.iwate.jp","shiwa.iwate.jp","shizukuishi.iwate.jp","sumita.iwate.jp","tanohata.iwate.jp","tono.iwate.jp","yahaba.iwate.jp","yamada.iwate.jp","ayagawa.kagawa.jp","higashikagawa.kagawa.jp","kanonji.kagawa.jp","kotohira.kagawa.jp","manno.kagawa.jp","marugame.kagawa.jp","mitoyo.kagawa.jp","naoshima.kagawa.jp","sanuki.kagawa.jp","tadotsu.kagawa.jp","takamatsu.kagawa.jp","tonosho.kagawa.jp","uchinomi.kagawa.jp","utazu.kagawa.jp","zentsuji.kagawa.jp","akune.kagoshima.jp","amami.kagoshima.jp","hioki.kagoshima.jp","isa.kagoshima.jp","isen.kagoshima.jp","izumi.kagoshima.jp","kagoshima.kagoshima.jp","kanoya.kagoshima.jp","kawanabe.kagoshima.jp","kinko.kagoshima.jp","kouyama.kagoshima.jp","makurazaki.kagoshima.jp","matsumoto.kagoshima.jp","minamitane.kagoshima.jp","nakatane.kagoshima.jp","nishinoomote.kagoshima.jp","satsumasendai.kagoshima.jp","soo.kagoshima.jp","tarumizu.kagoshima.jp","yusui.kagoshima.jp","aikawa.kanagawa.jp","atsugi.kanagawa.jp","ayase.kanagawa.jp","chigasaki.kanagawa.jp","ebina.kanagawa.jp","fujisawa.kanagawa.jp","hadano.kanagawa.jp","hakone.kanagawa.jp","hiratsuka.kanagawa.jp","isehara.kanagawa.jp","kaisei.kanagawa.jp","kamakura.kanagawa.jp","kiyokawa.kanagawa.jp","matsuda.kanagawa.jp","minamiashigara.kanagawa.jp","miura.kanagawa.jp","nakai.kanagawa.jp","ninomiya.kanagawa.jp","odawara.kanagawa.jp","oi.kanagawa.jp","oiso.kanagawa.jp","sagamihara.kanagawa.jp","samukawa.kanagawa.jp","tsukui.kanagawa.jp","yamakita.kanagawa.jp","yamato.kanagawa.jp","yokosuka.kanagawa.jp","yugawara.kanagawa.jp","zama.kanagawa.jp","zushi.kanagawa.jp","aki.kochi.jp","geisei.kochi.jp","hidaka.kochi.jp","higashitsuno.kochi.jp","ino.kochi.jp","kagami.kochi.jp","kami.kochi.jp","kitagawa.kochi.jp","kochi.kochi.jp","mihara.kochi.jp","motoyama.kochi.jp","muroto.kochi.jp","nahari.kochi.jp","nakamura.kochi.jp","nankoku.kochi.jp","nishitosa.kochi.jp","niyodogawa.kochi.jp","ochi.kochi.jp","okawa.kochi.jp","otoyo.kochi.jp","otsuki.kochi.jp","sakawa.kochi.jp","sukumo.kochi.jp","susaki.kochi.jp","tosa.kochi.jp","tosashimizu.kochi.jp","toyo.kochi.jp","tsuno.kochi.jp","umaji.kochi.jp","yasuda.kochi.jp","yusuhara.kochi.jp","amakusa.kumamoto.jp","arao.kumamoto.jp","aso.kumamoto.jp","choyo.kumamoto.jp","gyokuto.kumamoto.jp","kamiamakusa.kumamoto.jp","kikuchi.kumamoto.jp","kumamoto.kumamoto.jp","mashiki.kumamoto.jp","mifune.kumamoto.jp","minamata.kumamoto.jp","minamioguni.kumamoto.jp","nagasu.kumamoto.jp","nishihara.kumamoto.jp","oguni.kumamoto.jp","ozu.kumamoto.jp","sumoto.kumamoto.jp","takamori.kumamoto.jp","uki.kumamoto.jp","uto.kumamoto.jp","yamaga.kumamoto.jp","yamato.kumamoto.jp","yatsushiro.kumamoto.jp","ayabe.kyoto.jp","fukuchiyama.kyoto.jp","higashiyama.kyoto.jp","ide.kyoto.jp","ine.kyoto.jp","joyo.kyoto.jp","kameoka.kyoto.jp","kamo.kyoto.jp","kita.kyoto.jp","kizu.kyoto.jp","kumiyama.kyoto.jp","kyotamba.kyoto.jp","kyotanabe.kyoto.jp","kyotango.kyoto.jp","maizuru.kyoto.jp","minami.kyoto.jp","minamiyamashiro.kyoto.jp","miyazu.kyoto.jp","muko.kyoto.jp","nagaokakyo.kyoto.jp","nakagyo.kyoto.jp","nantan.kyoto.jp","oyamazaki.kyoto.jp","sakyo.kyoto.jp","seika.kyoto.jp","tanabe.kyoto.jp","uji.kyoto.jp","ujitawara.kyoto.jp","wazuka.kyoto.jp","yamashina.kyoto.jp","yawata.kyoto.jp","asahi.mie.jp","inabe.mie.jp","ise.mie.jp","kameyama.mie.jp","kawagoe.mie.jp","kiho.mie.jp","kisosaki.mie.jp","kiwa.mie.jp","komono.mie.jp","kumano.mie.jp","kuwana.mie.jp","matsusaka.mie.jp","meiwa.mie.jp","mihama.mie.jp","minamiise.mie.jp","misugi.mie.jp","miyama.mie.jp","nabari.mie.jp","shima.mie.jp","suzuka.mie.jp","tado.mie.jp","taiki.mie.jp","taki.mie.jp","tamaki.mie.jp","toba.mie.jp","tsu.mie.jp","udono.mie.jp","ureshino.mie.jp","watarai.mie.jp","yokkaichi.mie.jp","furukawa.miyagi.jp","higashimatsushima.miyagi.jp","ishinomaki.miyagi.jp","iwanuma.miyagi.jp","kakuda.miyagi.jp","kami.miyagi.jp","kawasaki.miyagi.jp","marumori.miyagi.jp","matsushima.miyagi.jp","minamisanriku.miyagi.jp","misato.miyagi.jp","murata.miyagi.jp","natori.miyagi.jp","ogawara.miyagi.jp","ohira.miyagi.jp","onagawa.miyagi.jp","osaki.miyagi.jp","rifu.miyagi.jp","semine.miyagi.jp","shibata.miyagi.jp","shichikashuku.miyagi.jp","shikama.miyagi.jp","shiogama.miyagi.jp","shiroishi.miyagi.jp","tagajo.miyagi.jp","taiwa.miyagi.jp","tome.miyagi.jp","tomiya.miyagi.jp","wakuya.miyagi.jp","watari.miyagi.jp","yamamoto.miyagi.jp","zao.miyagi.jp","aya.miyazaki.jp","ebino.miyazaki.jp","gokase.miyazaki.jp","hyuga.miyazaki.jp","kadogawa.miyazaki.jp","kawaminami.miyazaki.jp","kijo.miyazaki.jp","kitagawa.miyazaki.jp","kitakata.miyazaki.jp","kitaura.miyazaki.jp","kobayashi.miyazaki.jp","kunitomi.miyazaki.jp","kushima.miyazaki.jp","mimata.miyazaki.jp","miyakonojo.miyazaki.jp","miyazaki.miyazaki.jp","morotsuka.miyazaki.jp","nichinan.miyazaki.jp","nishimera.miyazaki.jp","nobeoka.miyazaki.jp","saito.miyazaki.jp","shiiba.miyazaki.jp","shintomi.miyazaki.jp","takaharu.miyazaki.jp","takanabe.miyazaki.jp","takazaki.miyazaki.jp","tsuno.miyazaki.jp","achi.nagano.jp","agematsu.nagano.jp","anan.nagano.jp","aoki.nagano.jp","asahi.nagano.jp","azumino.nagano.jp","chikuhoku.nagano.jp","chikuma.nagano.jp","chino.nagano.jp","fujimi.nagano.jp","hakuba.nagano.jp","hara.nagano.jp","hiraya.nagano.jp","iida.nagano.jp","iijima.nagano.jp","iiyama.nagano.jp","iizuna.nagano.jp","ikeda.nagano.jp","ikusaka.nagano.jp","ina.nagano.jp","karuizawa.nagano.jp","kawakami.nagano.jp","kiso.nagano.jp","kisofukushima.nagano.jp","kitaaiki.nagano.jp","komagane.nagano.jp","komoro.nagano.jp","matsukawa.nagano.jp","matsumoto.nagano.jp","miasa.nagano.jp","minamiaiki.nagano.jp","minamimaki.nagano.jp","minamiminowa.nagano.jp","minowa.nagano.jp","miyada.nagano.jp","miyota.nagano.jp","mochizuki.nagano.jp","nagano.nagano.jp","nagawa.nagano.jp","nagiso.nagano.jp","nakagawa.nagano.jp","nakano.nagano.jp","nozawaonsen.nagano.jp","obuse.nagano.jp","ogawa.nagano.jp","okaya.nagano.jp","omachi.nagano.jp","omi.nagano.jp","ookuwa.nagano.jp","ooshika.nagano.jp","otaki.nagano.jp","otari.nagano.jp","sakae.nagano.jp","sakaki.nagano.jp","saku.nagano.jp","sakuho.nagano.jp","shimosuwa.nagano.jp","shinanomachi.nagano.jp","shiojiri.nagano.jp","suwa.nagano.jp","suzaka.nagano.jp","takagi.nagano.jp","takamori.nagano.jp","takayama.nagano.jp","tateshina.nagano.jp","tatsuno.nagano.jp","togakushi.nagano.jp","togura.nagano.jp","tomi.nagano.jp","ueda.nagano.jp","wada.nagano.jp","yamagata.nagano.jp","yamanouchi.nagano.jp","yasaka.nagano.jp","yasuoka.nagano.jp","chijiwa.nagasaki.jp","futsu.nagasaki.jp","goto.nagasaki.jp","hasami.nagasaki.jp","hirado.nagasaki.jp","iki.nagasaki.jp","isahaya.nagasaki.jp","kawatana.nagasaki.jp","kuchinotsu.nagasaki.jp","matsuura.nagasaki.jp","nagasaki.nagasaki.jp","obama.nagasaki.jp","omura.nagasaki.jp","oseto.nagasaki.jp","saikai.nagasaki.jp","sasebo.nagasaki.jp","seihi.nagasaki.jp","shimabara.nagasaki.jp","shinkamigoto.nagasaki.jp","togitsu.nagasaki.jp","tsushima.nagasaki.jp","unzen.nagasaki.jp","ando.nara.jp","gose.nara.jp","heguri.nara.jp","higashiyoshino.nara.jp","ikaruga.nara.jp","ikoma.nara.jp","kamikitayama.nara.jp","kanmaki.nara.jp","kashiba.nara.jp","kashihara.nara.jp","katsuragi.nara.jp","kawai.nara.jp","kawakami.nara.jp","kawanishi.nara.jp","koryo.nara.jp","kurotaki.nara.jp","mitsue.nara.jp","miyake.nara.jp","nara.nara.jp","nosegawa.nara.jp","oji.nara.jp","ouda.nara.jp","oyodo.nara.jp","sakurai.nara.jp","sango.nara.jp","shimoichi.nara.jp","shimokitayama.nara.jp","shinjo.nara.jp","soni.nara.jp","takatori.nara.jp","tawaramoto.nara.jp","tenkawa.nara.jp","tenri.nara.jp","uda.nara.jp","yamatokoriyama.nara.jp","yamatotakada.nara.jp","yamazoe.nara.jp","yoshino.nara.jp","aga.niigata.jp","agano.niigata.jp","gosen.niigata.jp","itoigawa.niigata.jp","izumozaki.niigata.jp","joetsu.niigata.jp","kamo.niigata.jp","kariwa.niigata.jp","kashiwazaki.niigata.jp","minamiuonuma.niigata.jp","mitsuke.niigata.jp","muika.niigata.jp","murakami.niigata.jp","myoko.niigata.jp","nagaoka.niigata.jp","niigata.niigata.jp","ojiya.niigata.jp","omi.niigata.jp","sado.niigata.jp","sanjo.niigata.jp","seiro.niigata.jp","seirou.niigata.jp","sekikawa.niigata.jp","shibata.niigata.jp","tagami.niigata.jp","tainai.niigata.jp","tochio.niigata.jp","tokamachi.niigata.jp","tsubame.niigata.jp","tsunan.niigata.jp","uonuma.niigata.jp","yahiko.niigata.jp","yoita.niigata.jp","yuzawa.niigata.jp","beppu.oita.jp","bungoono.oita.jp","bungotakada.oita.jp","hasama.oita.jp","hiji.oita.jp","himeshima.oita.jp","hita.oita.jp","kamitsue.oita.jp","kokonoe.oita.jp","kuju.oita.jp","kunisaki.oita.jp","kusu.oita.jp","oita.oita.jp","saiki.oita.jp","taketa.oita.jp","tsukumi.oita.jp","usa.oita.jp","usuki.oita.jp","yufu.oita.jp","akaiwa.okayama.jp","asakuchi.okayama.jp","bizen.okayama.jp","hayashima.okayama.jp","ibara.okayama.jp","kagamino.okayama.jp","kasaoka.okayama.jp","kibichuo.okayama.jp","kumenan.okayama.jp","kurashiki.okayama.jp","maniwa.okayama.jp","misaki.okayama.jp","nagi.okayama.jp","niimi.okayama.jp","nishiawakura.okayama.jp","okayama.okayama.jp","satosho.okayama.jp","setouchi.okayama.jp","shinjo.okayama.jp","shoo.okayama.jp","soja.okayama.jp","takahashi.okayama.jp","tamano.okayama.jp","tsuyama.okayama.jp","wake.okayama.jp","yakage.okayama.jp","aguni.okinawa.jp","ginowan.okinawa.jp","ginoza.okinawa.jp","gushikami.okinawa.jp","haebaru.okinawa.jp","higashi.okinawa.jp","hirara.okinawa.jp","iheya.okinawa.jp","ishigaki.okinawa.jp","ishikawa.okinawa.jp","itoman.okinawa.jp","izena.okinawa.jp","kadena.okinawa.jp","kin.okinawa.jp","kitadaito.okinawa.jp","kitanakagusuku.okinawa.jp","kumejima.okinawa.jp","kunigami.okinawa.jp","minamidaito.okinawa.jp","motobu.okinawa.jp","nago.okinawa.jp","naha.okinawa.jp","nakagusuku.okinawa.jp","nakijin.okinawa.jp","nanjo.okinawa.jp","nishihara.okinawa.jp","ogimi.okinawa.jp","okinawa.okinawa.jp","onna.okinawa.jp","shimoji.okinawa.jp","taketomi.okinawa.jp","tarama.okinawa.jp","tokashiki.okinawa.jp","tomigusuku.okinawa.jp","tonaki.okinawa.jp","urasoe.okinawa.jp","uruma.okinawa.jp","yaese.okinawa.jp","yomitan.okinawa.jp","yonabaru.okinawa.jp","yonaguni.okinawa.jp","zamami.okinawa.jp","abeno.osaka.jp","chihayaakasaka.osaka.jp","chuo.osaka.jp","daito.osaka.jp","fujiidera.osaka.jp","habikino.osaka.jp","hannan.osaka.jp","higashiosaka.osaka.jp","higashisumiyoshi.osaka.jp","higashiyodogawa.osaka.jp","hirakata.osaka.jp","ibaraki.osaka.jp","ikeda.osaka.jp","izumi.osaka.jp","izumiotsu.osaka.jp","izumisano.osaka.jp","kadoma.osaka.jp","kaizuka.osaka.jp","kanan.osaka.jp","kashiwara.osaka.jp","katano.osaka.jp","kawachinagano.osaka.jp","kishiwada.osaka.jp","kita.osaka.jp","kumatori.osaka.jp","matsubara.osaka.jp","minato.osaka.jp","minoh.osaka.jp","misaki.osaka.jp","moriguchi.osaka.jp","neyagawa.osaka.jp","nishi.osaka.jp","nose.osaka.jp","osakasayama.osaka.jp","sakai.osaka.jp","sayama.osaka.jp","sennan.osaka.jp","settsu.osaka.jp","shijonawate.osaka.jp","shimamoto.osaka.jp","suita.osaka.jp","tadaoka.osaka.jp","taishi.osaka.jp","tajiri.osaka.jp","takaishi.osaka.jp","takatsuki.osaka.jp","tondabayashi.osaka.jp","toyonaka.osaka.jp","toyono.osaka.jp","yao.osaka.jp","ariake.saga.jp","arita.saga.jp","fukudomi.saga.jp","genkai.saga.jp","hamatama.saga.jp","hizen.saga.jp","imari.saga.jp","kamimine.saga.jp","kanzaki.saga.jp","karatsu.saga.jp","kashima.saga.jp","kitagata.saga.jp","kitahata.saga.jp","kiyama.saga.jp","kouhoku.saga.jp","kyuragi.saga.jp","nishiarita.saga.jp","ogi.saga.jp","omachi.saga.jp","ouchi.saga.jp","saga.saga.jp","shiroishi.saga.jp","taku.saga.jp","tara.saga.jp","tosu.saga.jp","yoshinogari.saga.jp","arakawa.saitama.jp","asaka.saitama.jp","chichibu.saitama.jp","fujimi.saitama.jp","fujimino.saitama.jp","fukaya.saitama.jp","hanno.saitama.jp","hanyu.saitama.jp","hasuda.saitama.jp","hatogaya.saitama.jp","hatoyama.saitama.jp","hidaka.saitama.jp","higashichichibu.saitama.jp","higashimatsuyama.saitama.jp","honjo.saitama.jp","ina.saitama.jp","iruma.saitama.jp","iwatsuki.saitama.jp","kamiizumi.saitama.jp","kamikawa.saitama.jp","kamisato.saitama.jp","kasukabe.saitama.jp","kawagoe.saitama.jp","kawaguchi.saitama.jp","kawajima.saitama.jp","kazo.saitama.jp","kitamoto.saitama.jp","koshigaya.saitama.jp","kounosu.saitama.jp","kuki.saitama.jp","kumagaya.saitama.jp","matsubushi.saitama.jp","minano.saitama.jp","misato.saitama.jp","miyashiro.saitama.jp","miyoshi.saitama.jp","moroyama.saitama.jp","nagatoro.saitama.jp","namegawa.saitama.jp","niiza.saitama.jp","ogano.saitama.jp","ogawa.saitama.jp","ogose.saitama.jp","okegawa.saitama.jp","omiya.saitama.jp","otaki.saitama.jp","ranzan.saitama.jp","ryokami.saitama.jp","saitama.saitama.jp","sakado.saitama.jp","satte.saitama.jp","sayama.saitama.jp","shiki.saitama.jp","shiraoka.saitama.jp","soka.saitama.jp","sugito.saitama.jp","toda.saitama.jp","tokigawa.saitama.jp","tokorozawa.saitama.jp","tsurugashima.saitama.jp","urawa.saitama.jp","warabi.saitama.jp","yashio.saitama.jp","yokoze.saitama.jp","yono.saitama.jp","yorii.saitama.jp","yoshida.saitama.jp","yoshikawa.saitama.jp","yoshimi.saitama.jp","aisho.shiga.jp","gamo.shiga.jp","higashiomi.shiga.jp","hikone.shiga.jp","koka.shiga.jp","konan.shiga.jp","kosei.shiga.jp","koto.shiga.jp","kusatsu.shiga.jp","maibara.shiga.jp","moriyama.shiga.jp","nagahama.shiga.jp","nishiazai.shiga.jp","notogawa.shiga.jp","omihachiman.shiga.jp","otsu.shiga.jp","ritto.shiga.jp","ryuoh.shiga.jp","takashima.shiga.jp","takatsuki.shiga.jp","torahime.shiga.jp","toyosato.shiga.jp","yasu.shiga.jp","akagi.shimane.jp","ama.shimane.jp","gotsu.shimane.jp","hamada.shimane.jp","higashiizumo.shimane.jp","hikawa.shimane.jp","hikimi.shimane.jp","izumo.shimane.jp","kakinoki.shimane.jp","masuda.shimane.jp","matsue.shimane.jp","misato.shimane.jp","nishinoshima.shimane.jp","ohda.shimane.jp","okinoshima.shimane.jp","okuizumo.shimane.jp","shimane.shimane.jp","tamayu.shimane.jp","tsuwano.shimane.jp","unnan.shimane.jp","yakumo.shimane.jp","yasugi.shimane.jp","yatsuka.shimane.jp","arai.shizuoka.jp","atami.shizuoka.jp","fuji.shizuoka.jp","fujieda.shizuoka.jp","fujikawa.shizuoka.jp","fujinomiya.shizuoka.jp","fukuroi.shizuoka.jp","gotemba.shizuoka.jp","haibara.shizuoka.jp","hamamatsu.shizuoka.jp","higashiizu.shizuoka.jp","ito.shizuoka.jp","iwata.shizuoka.jp","izu.shizuoka.jp","izunokuni.shizuoka.jp","kakegawa.shizuoka.jp","kannami.shizuoka.jp","kawanehon.shizuoka.jp","kawazu.shizuoka.jp","kikugawa.shizuoka.jp","kosai.shizuoka.jp","makinohara.shizuoka.jp","matsuzaki.shizuoka.jp","minamiizu.shizuoka.jp","mishima.shizuoka.jp","morimachi.shizuoka.jp","nishiizu.shizuoka.jp","numazu.shizuoka.jp","omaezaki.shizuoka.jp","shimada.shizuoka.jp","shimizu.shizuoka.jp","shimoda.shizuoka.jp","shizuoka.shizuoka.jp","susono.shizuoka.jp","yaizu.shizuoka.jp","yoshida.shizuoka.jp","ashikaga.tochigi.jp","bato.tochigi.jp","haga.tochigi.jp","ichikai.tochigi.jp","iwafune.tochigi.jp","kaminokawa.tochigi.jp","kanuma.tochigi.jp","karasuyama.tochigi.jp","kuroiso.tochigi.jp","mashiko.tochigi.jp","mibu.tochigi.jp","moka.tochigi.jp","motegi.tochigi.jp","nasu.tochigi.jp","nasushiobara.tochigi.jp","nikko.tochigi.jp","nishikata.tochigi.jp","nogi.tochigi.jp","ohira.tochigi.jp","ohtawara.tochigi.jp","oyama.tochigi.jp","sakura.tochigi.jp","sano.tochigi.jp","shimotsuke.tochigi.jp","shioya.tochigi.jp","takanezawa.tochigi.jp","tochigi.tochigi.jp","tsuga.tochigi.jp","ujiie.tochigi.jp","utsunomiya.tochigi.jp","yaita.tochigi.jp","aizumi.tokushima.jp","anan.tokushima.jp","ichiba.tokushima.jp","itano.tokushima.jp","kainan.tokushima.jp","komatsushima.tokushima.jp","matsushige.tokushima.jp","mima.tokushima.jp","minami.tokushima.jp","miyoshi.tokushima.jp","mugi.tokushima.jp","nakagawa.tokushima.jp","naruto.tokushima.jp","sanagochi.tokushima.jp","shishikui.tokushima.jp","tokushima.tokushima.jp","wajiki.tokushima.jp","adachi.tokyo.jp","akiruno.tokyo.jp","akishima.tokyo.jp","aogashima.tokyo.jp","arakawa.tokyo.jp","bunkyo.tokyo.jp","chiyoda.tokyo.jp","chofu.tokyo.jp","chuo.tokyo.jp","edogawa.tokyo.jp","fuchu.tokyo.jp","fussa.tokyo.jp","hachijo.tokyo.jp","hachioji.tokyo.jp","hamura.tokyo.jp","higashikurume.tokyo.jp","higashimurayama.tokyo.jp","higashiyamato.tokyo.jp","hino.tokyo.jp","hinode.tokyo.jp","hinohara.tokyo.jp","inagi.tokyo.jp","itabashi.tokyo.jp","katsushika.tokyo.jp","kita.tokyo.jp","kiyose.tokyo.jp","kodaira.tokyo.jp","koganei.tokyo.jp","kokubunji.tokyo.jp","komae.tokyo.jp","koto.tokyo.jp","kouzushima.tokyo.jp","kunitachi.tokyo.jp","machida.tokyo.jp","meguro.tokyo.jp","minato.tokyo.jp","mitaka.tokyo.jp","mizuho.tokyo.jp","musashimurayama.tokyo.jp","musashino.tokyo.jp","nakano.tokyo.jp","nerima.tokyo.jp","ogasawara.tokyo.jp","okutama.tokyo.jp","ome.tokyo.jp","oshima.tokyo.jp","ota.tokyo.jp","setagaya.tokyo.jp","shibuya.tokyo.jp","shinagawa.tokyo.jp","shinjuku.tokyo.jp","suginami.tokyo.jp","sumida.tokyo.jp","tachikawa.tokyo.jp","taito.tokyo.jp","tama.tokyo.jp","toshima.tokyo.jp","chizu.tottori.jp","hino.tottori.jp","kawahara.tottori.jp","koge.tottori.jp","kotoura.tottori.jp","misasa.tottori.jp","nanbu.tottori.jp","nichinan.tottori.jp","sakaiminato.tottori.jp","tottori.tottori.jp","wakasa.tottori.jp","yazu.tottori.jp","yonago.tottori.jp","asahi.toyama.jp","fuchu.toyama.jp","fukumitsu.toyama.jp","funahashi.toyama.jp","himi.toyama.jp","imizu.toyama.jp","inami.toyama.jp","johana.toyama.jp","kamiichi.toyama.jp","kurobe.toyama.jp","nakaniikawa.toyama.jp","namerikawa.toyama.jp","nanto.toyama.jp","nyuzen.toyama.jp","oyabe.toyama.jp","taira.toyama.jp","takaoka.toyama.jp","tateyama.toyama.jp","toga.toyama.jp","tonami.toyama.jp","toyama.toyama.jp","unazuki.toyama.jp","uozu.toyama.jp","yamada.toyama.jp","arida.wakayama.jp","aridagawa.wakayama.jp","gobo.wakayama.jp","hashimoto.wakayama.jp","hidaka.wakayama.jp","hirogawa.wakayama.jp","inami.wakayama.jp","iwade.wakayama.jp","kainan.wakayama.jp","kamitonda.wakayama.jp","katsuragi.wakayama.jp","kimino.wakayama.jp","kinokawa.wakayama.jp","kitayama.wakayama.jp","koya.wakayama.jp","koza.wakayama.jp","kozagawa.wakayama.jp","kudoyama.wakayama.jp","kushimoto.wakayama.jp","mihama.wakayama.jp","misato.wakayama.jp","nachikatsuura.wakayama.jp","shingu.wakayama.jp","shirahama.wakayama.jp","taiji.wakayama.jp","tanabe.wakayama.jp","wakayama.wakayama.jp","yuasa.wakayama.jp","yura.wakayama.jp","asahi.yamagata.jp","funagata.yamagata.jp","higashine.yamagata.jp","iide.yamagata.jp","kahoku.yamagata.jp","kaminoyama.yamagata.jp","kaneyama.yamagata.jp","kawanishi.yamagata.jp","mamurogawa.yamagata.jp","mikawa.yamagata.jp","murayama.yamagata.jp","nagai.yamagata.jp","nakayama.yamagata.jp","nanyo.yamagata.jp","nishikawa.yamagata.jp","obanazawa.yamagata.jp","oe.yamagata.jp","oguni.yamagata.jp","ohkura.yamagata.jp","oishida.yamagata.jp","sagae.yamagata.jp","sakata.yamagata.jp","sakegawa.yamagata.jp","shinjo.yamagata.jp","shirataka.yamagata.jp","shonai.yamagata.jp","takahata.yamagata.jp","tendo.yamagata.jp","tozawa.yamagata.jp","tsuruoka.yamagata.jp","yamagata.yamagata.jp","yamanobe.yamagata.jp","yonezawa.yamagata.jp","yuza.yamagata.jp","abu.yamaguchi.jp","hagi.yamaguchi.jp","hikari.yamaguchi.jp","hofu.yamaguchi.jp","iwakuni.yamaguchi.jp","kudamatsu.yamaguchi.jp","mitou.yamaguchi.jp","nagato.yamaguchi.jp","oshima.yamaguchi.jp","shimonoseki.yamaguchi.jp","shunan.yamaguchi.jp","tabuse.yamaguchi.jp","tokuyama.yamaguchi.jp","toyota.yamaguchi.jp","ube.yamaguchi.jp","yuu.yamaguchi.jp","chuo.yamanashi.jp","doshi.yamanashi.jp","fuefuki.yamanashi.jp","fujikawa.yamanashi.jp","fujikawaguchiko.yamanashi.jp","fujiyoshida.yamanashi.jp","hayakawa.yamanashi.jp","hokuto.yamanashi.jp","ichikawamisato.yamanashi.jp","kai.yamanashi.jp","kofu.yamanashi.jp","koshu.yamanashi.jp","kosuge.yamanashi.jp","minami-alps.yamanashi.jp","minobu.yamanashi.jp","nakamichi.yamanashi.jp","nanbu.yamanashi.jp","narusawa.yamanashi.jp","nirasaki.yamanashi.jp","nishikatsura.yamanashi.jp","oshino.yamanashi.jp","otsuki.yamanashi.jp","showa.yamanashi.jp","tabayama.yamanashi.jp","tsuru.yamanashi.jp","uenohara.yamanashi.jp","yamanakako.yamanashi.jp","yamanashi.yamanashi.jp","ke","ac.ke","co.ke","go.ke","info.ke","me.ke","mobi.ke","ne.ke","or.ke","sc.ke","kg","org.kg","net.kg","com.kg","edu.kg","gov.kg","mil.kg","*.kh","ki","edu.ki","biz.ki","net.ki","org.ki","gov.ki","info.ki","com.ki","km","org.km","nom.km","gov.km","prd.km","tm.km","edu.km","mil.km","ass.km","com.km","coop.km","asso.km","presse.km","medecin.km","notaires.km","pharmaciens.km","veterinaire.km","gouv.km","kn","net.kn","org.kn","edu.kn","gov.kn","kp","com.kp","edu.kp","gov.kp","org.kp","rep.kp","tra.kp","kr","ac.kr","co.kr","es.kr","go.kr","hs.kr","kg.kr","mil.kr","ms.kr","ne.kr","or.kr","pe.kr","re.kr","sc.kr","busan.kr","chungbuk.kr","chungnam.kr","daegu.kr","daejeon.kr","gangwon.kr","gwangju.kr","gyeongbuk.kr","gyeonggi.kr","gyeongnam.kr","incheon.kr","jeju.kr","jeonbuk.kr","jeonnam.kr","seoul.kr","ulsan.kr","kw","com.kw","edu.kw","emb.kw","gov.kw","ind.kw","net.kw","org.kw","ky","com.ky","edu.ky","net.ky","org.ky","kz","org.kz","edu.kz","net.kz","gov.kz","mil.kz","com.kz","la","int.la","net.la","info.la","edu.la","gov.la","per.la","com.la","org.la","lb","com.lb","edu.lb","gov.lb","net.lb","org.lb","lc","com.lc","net.lc","co.lc","org.lc","edu.lc","gov.lc","li","lk","gov.lk","sch.lk","net.lk","int.lk","com.lk","org.lk","edu.lk","ngo.lk","soc.lk","web.lk","ltd.lk","assn.lk","grp.lk","hotel.lk","ac.lk","lr","com.lr","edu.lr","gov.lr","org.lr","net.lr","ls","ac.ls","biz.ls","co.ls","edu.ls","gov.ls","info.ls","net.ls","org.ls","sc.ls","lt","gov.lt","lu","lv","com.lv","edu.lv","gov.lv","org.lv","mil.lv","id.lv","net.lv","asn.lv","conf.lv","ly","com.ly","net.ly","gov.ly","plc.ly","edu.ly","sch.ly","med.ly","org.ly","id.ly","ma","co.ma","net.ma","gov.ma","org.ma","ac.ma","press.ma","mc","tm.mc","asso.mc","md","me","co.me","net.me","org.me","edu.me","ac.me","gov.me","its.me","priv.me","mg","org.mg","nom.mg","gov.mg","prd.mg","tm.mg","edu.mg","mil.mg","com.mg","co.mg","mh","mil","mk","com.mk","org.mk","net.mk","edu.mk","gov.mk","inf.mk","name.mk","ml","com.ml","edu.ml","gouv.ml","gov.ml","net.ml","org.ml","presse.ml","*.mm","mn","gov.mn","edu.mn","org.mn","mo","com.mo","net.mo","org.mo","edu.mo","gov.mo","mobi","mp","mq","mr","gov.mr","ms","com.ms","edu.ms","gov.ms","net.ms","org.ms","mt","com.mt","edu.mt","net.mt","org.mt","mu","com.mu","net.mu","org.mu","gov.mu","ac.mu","co.mu","or.mu","museum","academy.museum","agriculture.museum","air.museum","airguard.museum","alabama.museum","alaska.museum","amber.museum","ambulance.museum","american.museum","americana.museum","americanantiques.museum","americanart.museum","amsterdam.museum","and.museum","annefrank.museum","anthro.museum","anthropology.museum","antiques.museum","aquarium.museum","arboretum.museum","archaeological.museum","archaeology.museum","architecture.museum","art.museum","artanddesign.museum","artcenter.museum","artdeco.museum","arteducation.museum","artgallery.museum","arts.museum","artsandcrafts.museum","asmatart.museum","assassination.museum","assisi.museum","association.museum","astronomy.museum","atlanta.museum","austin.museum","australia.museum","automotive.museum","aviation.museum","axis.museum","badajoz.museum","baghdad.museum","bahn.museum","bale.museum","baltimore.museum","barcelona.museum","baseball.museum","basel.museum","baths.museum","bauern.museum","beauxarts.museum","beeldengeluid.museum","bellevue.museum","bergbau.museum","berkeley.museum","berlin.museum","bern.museum","bible.museum","bilbao.museum","bill.museum","birdart.museum","birthplace.museum","bonn.museum","boston.museum","botanical.museum","botanicalgarden.museum","botanicgarden.museum","botany.museum","brandywinevalley.museum","brasil.museum","bristol.museum","british.museum","britishcolumbia.museum","broadcast.museum","brunel.museum","brussel.museum","brussels.museum","bruxelles.museum","building.museum","burghof.museum","bus.museum","bushey.museum","cadaques.museum","california.museum","cambridge.museum","can.museum","canada.museum","capebreton.museum","carrier.museum","cartoonart.museum","casadelamoneda.museum","castle.museum","castres.museum","celtic.museum","center.museum","chattanooga.museum","cheltenham.museum","chesapeakebay.museum","chicago.museum","children.museum","childrens.museum","childrensgarden.museum","chiropractic.museum","chocolate.museum","christiansburg.museum","cincinnati.museum","cinema.museum","circus.museum","civilisation.museum","civilization.museum","civilwar.museum","clinton.museum","clock.museum","coal.museum","coastaldefence.museum","cody.museum","coldwar.museum","collection.museum","colonialwilliamsburg.museum","coloradoplateau.museum","columbia.museum","columbus.museum","communication.museum","communications.museum","community.museum","computer.museum","computerhistory.museum","comunicações.museum","contemporary.museum","contemporaryart.museum","convent.museum","copenhagen.museum","corporation.museum","correios-e-telecomunicações.museum","corvette.museum","costume.museum","countryestate.museum","county.museum","crafts.museum","cranbrook.museum","creation.museum","cultural.museum","culturalcenter.museum","culture.museum","cyber.museum","cymru.museum","dali.museum","dallas.museum","database.museum","ddr.museum","decorativearts.museum","delaware.museum","delmenhorst.museum","denmark.museum","depot.museum","design.museum","detroit.museum","dinosaur.museum","discovery.museum","dolls.museum","donostia.museum","durham.museum","eastafrica.museum","eastcoast.museum","education.museum","educational.museum","egyptian.museum","eisenbahn.museum","elburg.museum","elvendrell.museum","embroidery.museum","encyclopedic.museum","england.museum","entomology.museum","environment.museum","environmentalconservation.museum","epilepsy.museum","essex.museum","estate.museum","ethnology.museum","exeter.museum","exhibition.museum","family.museum","farm.museum","farmequipment.museum","farmers.museum","farmstead.museum","field.museum","figueres.museum","filatelia.museum","film.museum","fineart.museum","finearts.museum","finland.museum","flanders.museum","florida.museum","force.museum","fortmissoula.museum","fortworth.museum","foundation.museum","francaise.museum","frankfurt.museum","franziskaner.museum","freemasonry.museum","freiburg.museum","fribourg.museum","frog.museum","fundacio.museum","furniture.museum","gallery.museum","garden.museum","gateway.museum","geelvinck.museum","gemological.museum","geology.museum","georgia.museum","giessen.museum","glas.museum","glass.museum","gorge.museum","grandrapids.museum","graz.museum","guernsey.museum","halloffame.museum","hamburg.museum","handson.museum","harvestcelebration.museum","hawaii.museum","health.museum","heimatunduhren.museum","hellas.museum","helsinki.museum","hembygdsforbund.museum","heritage.museum","histoire.museum","historical.museum","historicalsociety.museum","historichouses.museum","historisch.museum","historisches.museum","history.museum","historyofscience.museum","horology.museum","house.museum","humanities.museum","illustration.museum","imageandsound.museum","indian.museum","indiana.museum","indianapolis.museum","indianmarket.museum","intelligence.museum","interactive.museum","iraq.museum","iron.museum","isleofman.museum","jamison.museum","jefferson.museum","jerusalem.museum","jewelry.museum","jewish.museum","jewishart.museum","jfk.museum","journalism.museum","judaica.museum","judygarland.museum","juedisches.museum","juif.museum","karate.museum","karikatur.museum","kids.museum","koebenhavn.museum","koeln.museum","kunst.museum","kunstsammlung.museum","kunstunddesign.museum","labor.museum","labour.museum","lajolla.museum","lancashire.museum","landes.museum","lans.museum","läns.museum","larsson.museum","lewismiller.museum","lincoln.museum","linz.museum","living.museum","livinghistory.museum","localhistory.museum","london.museum","losangeles.museum","louvre.museum","loyalist.museum","lucerne.museum","luxembourg.museum","luzern.museum","mad.museum","madrid.museum","mallorca.museum","manchester.museum","mansion.museum","mansions.museum","manx.museum","marburg.museum","maritime.museum","maritimo.museum","maryland.museum","marylhurst.museum","media.museum","medical.museum","medizinhistorisches.museum","meeres.museum","memorial.museum","mesaverde.museum","michigan.museum","midatlantic.museum","military.museum","mill.museum","miners.museum","mining.museum","minnesota.museum","missile.museum","missoula.museum","modern.museum","moma.museum","money.museum","monmouth.museum","monticello.museum","montreal.museum","moscow.museum","motorcycle.museum","muenchen.museum","muenster.museum","mulhouse.museum","muncie.museum","museet.museum","museumcenter.museum","museumvereniging.museum","music.museum","national.museum","nationalfirearms.museum","nationalheritage.museum","nativeamerican.museum","naturalhistory.museum","naturalhistorymuseum.museum","naturalsciences.museum","nature.museum","naturhistorisches.museum","natuurwetenschappen.museum","naumburg.museum","naval.museum","nebraska.museum","neues.museum","newhampshire.museum","newjersey.museum","newmexico.museum","newport.museum","newspaper.museum","newyork.museum","niepce.museum","norfolk.museum","north.museum","nrw.museum","nyc.museum","nyny.museum","oceanographic.museum","oceanographique.museum","omaha.museum","online.museum","ontario.museum","openair.museum","oregon.museum","oregontrail.museum","otago.museum","oxford.museum","pacific.museum","paderborn.museum","palace.museum","paleo.museum","palmsprings.museum","panama.museum","paris.museum","pasadena.museum","pharmacy.museum","philadelphia.museum","philadelphiaarea.museum","philately.museum","phoenix.museum","photography.museum","pilots.museum","pittsburgh.museum","planetarium.museum","plantation.museum","plants.museum","plaza.museum","portal.museum","portland.museum","portlligat.museum","posts-and-telecommunications.museum","preservation.museum","presidio.museum","press.museum","project.museum","public.museum","pubol.museum","quebec.museum","railroad.museum","railway.museum","research.museum","resistance.museum","riodejaneiro.museum","rochester.museum","rockart.museum","roma.museum","russia.museum","saintlouis.museum","salem.museum","salvadordali.museum","salzburg.museum","sandiego.museum","sanfrancisco.museum","santabarbara.museum","santacruz.museum","santafe.museum","saskatchewan.museum","satx.museum","savannahga.museum","schlesisches.museum","schoenbrunn.museum","schokoladen.museum","school.museum","schweiz.museum","science.museum","scienceandhistory.museum","scienceandindustry.museum","sciencecenter.museum","sciencecenters.museum","science-fiction.museum","sciencehistory.museum","sciences.museum","sciencesnaturelles.museum","scotland.museum","seaport.museum","settlement.museum","settlers.museum","shell.museum","sherbrooke.museum","sibenik.museum","silk.museum","ski.museum","skole.museum","society.museum","sologne.museum","soundandvision.museum","southcarolina.museum","southwest.museum","space.museum","spy.museum","square.museum","stadt.museum","stalbans.museum","starnberg.museum","state.museum","stateofdelaware.museum","station.museum","steam.museum","steiermark.museum","stjohn.museum","stockholm.museum","stpetersburg.museum","stuttgart.museum","suisse.museum","surgeonshall.museum","surrey.museum","svizzera.museum","sweden.museum","sydney.museum","tank.museum","tcm.museum","technology.museum","telekommunikation.museum","television.museum","texas.museum","textile.museum","theater.museum","time.museum","timekeeping.museum","topology.museum","torino.museum","touch.museum","town.museum","transport.museum","tree.museum","trolley.museum","trust.museum","trustee.museum","uhren.museum","ulm.museum","undersea.museum","university.museum","usa.museum","usantiques.museum","usarts.museum","uscountryestate.museum","usculture.museum","usdecorativearts.museum","usgarden.museum","ushistory.museum","ushuaia.museum","uslivinghistory.museum","utah.museum","uvic.museum","valley.museum","vantaa.museum","versailles.museum","viking.museum","village.museum","virginia.museum","virtual.museum","virtuel.museum","vlaanderen.museum","volkenkunde.museum","wales.museum","wallonie.museum","war.museum","washingtondc.museum","watchandclock.museum","watch-and-clock.museum","western.museum","westfalen.museum","whaling.museum","wildlife.museum","williamsburg.museum","windmill.museum","workshop.museum","york.museum","yorkshire.museum","yosemite.museum","youth.museum","zoological.museum","zoology.museum","ירושלים.museum","иком.museum","mv","aero.mv","biz.mv","com.mv","coop.mv","edu.mv","gov.mv","info.mv","int.mv","mil.mv","museum.mv","name.mv","net.mv","org.mv","pro.mv","mw","ac.mw","biz.mw","co.mw","com.mw","coop.mw","edu.mw","gov.mw","int.mw","museum.mw","net.mw","org.mw","mx","com.mx","org.mx","gob.mx","edu.mx","net.mx","my","biz.my","com.my","edu.my","gov.my","mil.my","name.my","net.my","org.my","mz","ac.mz","adv.mz","co.mz","edu.mz","gov.mz","mil.mz","net.mz","org.mz","na","info.na","pro.na","name.na","school.na","or.na","dr.na","us.na","mx.na","ca.na","in.na","cc.na","tv.na","ws.na","mobi.na","co.na","com.na","org.na","name","nc","asso.nc","nom.nc","ne","net","nf","com.nf","net.nf","per.nf","rec.nf","web.nf","arts.nf","firm.nf","info.nf","other.nf","store.nf","ng","com.ng","edu.ng","gov.ng","i.ng","mil.ng","mobi.ng","name.ng","net.ng","org.ng","sch.ng","ni","ac.ni","biz.ni","co.ni","com.ni","edu.ni","gob.ni","in.ni","info.ni","int.ni","mil.ni","net.ni","nom.ni","org.ni","web.ni","nl","no","fhs.no","vgs.no","fylkesbibl.no","folkebibl.no","museum.no","idrett.no","priv.no","mil.no","stat.no","dep.no","kommune.no","herad.no","aa.no","ah.no","bu.no","fm.no","hl.no","hm.no","jan-mayen.no","mr.no","nl.no","nt.no","of.no","ol.no","oslo.no","rl.no","sf.no","st.no","svalbard.no","tm.no","tr.no","va.no","vf.no","gs.aa.no","gs.ah.no","gs.bu.no","gs.fm.no","gs.hl.no","gs.hm.no","gs.jan-mayen.no","gs.mr.no","gs.nl.no","gs.nt.no","gs.of.no","gs.ol.no","gs.oslo.no","gs.rl.no","gs.sf.no","gs.st.no","gs.svalbard.no","gs.tm.no","gs.tr.no","gs.va.no","gs.vf.no","akrehamn.no","åkrehamn.no","algard.no","ålgård.no","arna.no","brumunddal.no","bryne.no","bronnoysund.no","brønnøysund.no","drobak.no","drøbak.no","egersund.no","fetsund.no","floro.no","florø.no","fredrikstad.no","hokksund.no","honefoss.no","hønefoss.no","jessheim.no","jorpeland.no","jørpeland.no","kirkenes.no","kopervik.no","krokstadelva.no","langevag.no","langevåg.no","leirvik.no","mjondalen.no","mjøndalen.no","mo-i-rana.no","mosjoen.no","mosjøen.no","nesoddtangen.no","orkanger.no","osoyro.no","osøyro.no","raholt.no","råholt.no","sandnessjoen.no","sandnessjøen.no","skedsmokorset.no","slattum.no","spjelkavik.no","stathelle.no","stavern.no","stjordalshalsen.no","stjørdalshalsen.no","tananger.no","tranby.no","vossevangen.no","afjord.no","åfjord.no","agdenes.no","al.no","ål.no","alesund.no","ålesund.no","alstahaug.no","alta.no","áltá.no","alaheadju.no","álaheadju.no","alvdal.no","amli.no","åmli.no","amot.no","åmot.no","andebu.no","andoy.no","andøy.no","andasuolo.no","ardal.no","årdal.no","aremark.no","arendal.no","ås.no","aseral.no","åseral.no","asker.no","askim.no","askvoll.no","askoy.no","askøy.no","asnes.no","åsnes.no","audnedaln.no","aukra.no","aure.no","aurland.no","aurskog-holand.no","aurskog-høland.no","austevoll.no","austrheim.no","averoy.no","averøy.no","balestrand.no","ballangen.no","balat.no","bálát.no","balsfjord.no","bahccavuotna.no","báhccavuotna.no","bamble.no","bardu.no","beardu.no","beiarn.no","bajddar.no","bájddar.no","baidar.no","báidár.no","berg.no","bergen.no","berlevag.no","berlevåg.no","bearalvahki.no","bearalváhki.no","bindal.no","birkenes.no","bjarkoy.no","bjarkøy.no","bjerkreim.no","bjugn.no","bodo.no","bodø.no","badaddja.no","bådåddjå.no","budejju.no","bokn.no","bremanger.no","bronnoy.no","brønnøy.no","bygland.no","bykle.no","barum.no","bærum.no","bo.telemark.no","bø.telemark.no","bo.nordland.no","bø.nordland.no","bievat.no","bievát.no","bomlo.no","bømlo.no","batsfjord.no","båtsfjord.no","bahcavuotna.no","báhcavuotna.no","dovre.no","drammen.no","drangedal.no","dyroy.no","dyrøy.no","donna.no","dønna.no","eid.no","eidfjord.no","eidsberg.no","eidskog.no","eidsvoll.no","eigersund.no","elverum.no","enebakk.no","engerdal.no","etne.no","etnedal.no","evenes.no","evenassi.no","evenášši.no","evje-og-hornnes.no","farsund.no","fauske.no","fuossko.no","fuoisku.no","fedje.no","fet.no","finnoy.no","finnøy.no","fitjar.no","fjaler.no","fjell.no","flakstad.no","flatanger.no","flekkefjord.no","flesberg.no","flora.no","fla.no","flå.no","folldal.no","forsand.no","fosnes.no","frei.no","frogn.no","froland.no","frosta.no","frana.no","fræna.no","froya.no","frøya.no","fusa.no","fyresdal.no","forde.no","førde.no","gamvik.no","gangaviika.no","gáŋgaviika.no","gaular.no","gausdal.no","gildeskal.no","gildeskål.no","giske.no","gjemnes.no","gjerdrum.no","gjerstad.no","gjesdal.no","gjovik.no","gjøvik.no","gloppen.no","gol.no","gran.no","grane.no","granvin.no","gratangen.no","grimstad.no","grong.no","kraanghke.no","kråanghke.no","grue.no","gulen.no","hadsel.no","halden.no","halsa.no","hamar.no","hamaroy.no","habmer.no","hábmer.no","hapmir.no","hápmir.no","hammerfest.no","hammarfeasta.no","hámmárfeasta.no","haram.no","hareid.no","harstad.no","hasvik.no","aknoluokta.no","ákŋoluokta.no","hattfjelldal.no","aarborte.no","haugesund.no","hemne.no","hemnes.no","hemsedal.no","heroy.more-og-romsdal.no","herøy.møre-og-romsdal.no","heroy.nordland.no","herøy.nordland.no","hitra.no","hjartdal.no","hjelmeland.no","hobol.no","hobøl.no","hof.no","hol.no","hole.no","holmestrand.no","holtalen.no","holtålen.no","hornindal.no","horten.no","hurdal.no","hurum.no","hvaler.no","hyllestad.no","hagebostad.no","hægebostad.no","hoyanger.no","høyanger.no","hoylandet.no","høylandet.no","ha.no","hå.no","ibestad.no","inderoy.no","inderøy.no","iveland.no","jevnaker.no","jondal.no","jolster.no","jølster.no","karasjok.no","karasjohka.no","kárášjohka.no","karlsoy.no","galsa.no","gálsá.no","karmoy.no","karmøy.no","kautokeino.no","guovdageaidnu.no","klepp.no","klabu.no","klæbu.no","kongsberg.no","kongsvinger.no","kragero.no","kragerø.no","kristiansand.no","kristiansund.no","krodsherad.no","krødsherad.no","kvalsund.no","rahkkeravju.no","ráhkkerávju.no","kvam.no","kvinesdal.no","kvinnherad.no","kviteseid.no","kvitsoy.no","kvitsøy.no","kvafjord.no","kvæfjord.no","giehtavuoatna.no","kvanangen.no","kvænangen.no","navuotna.no","návuotna.no","kafjord.no","kåfjord.no","gaivuotna.no","gáivuotna.no","larvik.no","lavangen.no","lavagis.no","loabat.no","loabát.no","lebesby.no","davvesiida.no","leikanger.no","leirfjord.no","leka.no","leksvik.no","lenvik.no","leangaviika.no","leaŋgaviika.no","lesja.no","levanger.no","lier.no","lierne.no","lillehammer.no","lillesand.no","lindesnes.no","lindas.no","lindås.no","lom.no","loppa.no","lahppi.no","láhppi.no","lund.no","lunner.no","luroy.no","lurøy.no","luster.no","lyngdal.no","lyngen.no","ivgu.no","lardal.no","lerdal.no","lærdal.no","lodingen.no","lødingen.no","lorenskog.no","lørenskog.no","loten.no","løten.no","malvik.no","masoy.no","måsøy.no","muosat.no","muosát.no","mandal.no","marker.no","marnardal.no","masfjorden.no","meland.no","meldal.no","melhus.no","meloy.no","meløy.no","meraker.no","meråker.no","moareke.no","moåreke.no","midsund.no","midtre-gauldal.no","modalen.no","modum.no","molde.no","moskenes.no","moss.no","mosvik.no","malselv.no","målselv.no","malatvuopmi.no","málatvuopmi.no","namdalseid.no","aejrie.no","namsos.no","namsskogan.no","naamesjevuemie.no","nååmesjevuemie.no","laakesvuemie.no","nannestad.no","narvik.no","narviika.no","naustdal.no","nedre-eiker.no","nes.akershus.no","nes.buskerud.no","nesna.no","nesodden.no","nesseby.no","unjarga.no","unjárga.no","nesset.no","nissedal.no","nittedal.no","nord-aurdal.no","nord-fron.no","nord-odal.no","norddal.no","nordkapp.no","davvenjarga.no","davvenjárga.no","nordre-land.no","nordreisa.no","raisa.no","ráisa.no","nore-og-uvdal.no","notodden.no","naroy.no","nærøy.no","notteroy.no","nøtterøy.no","odda.no","oksnes.no","øksnes.no","oppdal.no","oppegard.no","oppegård.no","orkdal.no","orland.no","ørland.no","orskog.no","ørskog.no","orsta.no","ørsta.no","os.hedmark.no","os.hordaland.no","osen.no","osteroy.no","osterøy.no","ostre-toten.no","østre-toten.no","overhalla.no","ovre-eiker.no","øvre-eiker.no","oyer.no","øyer.no","oygarden.no","øygarden.no","oystre-slidre.no","øystre-slidre.no","porsanger.no","porsangu.no","porsáŋgu.no","porsgrunn.no","radoy.no","radøy.no","rakkestad.no","rana.no","ruovat.no","randaberg.no","rauma.no","rendalen.no","rennebu.no","rennesoy.no","rennesøy.no","rindal.no","ringebu.no","ringerike.no","ringsaker.no","rissa.no","risor.no","risør.no","roan.no","rollag.no","rygge.no","ralingen.no","rælingen.no","rodoy.no","rødøy.no","romskog.no","rømskog.no","roros.no","røros.no","rost.no","røst.no","royken.no","røyken.no","royrvik.no","røyrvik.no","rade.no","råde.no","salangen.no","siellak.no","saltdal.no","salat.no","sálát.no","sálat.no","samnanger.no","sande.more-og-romsdal.no","sande.møre-og-romsdal.no","sande.vestfold.no","sandefjord.no","sandnes.no","sandoy.no","sandøy.no","sarpsborg.no","sauda.no","sauherad.no","sel.no","selbu.no","selje.no","seljord.no","sigdal.no","siljan.no","sirdal.no","skaun.no","skedsmo.no","ski.no","skien.no","skiptvet.no","skjervoy.no","skjervøy.no","skierva.no","skiervá.no","skjak.no","skjåk.no","skodje.no","skanland.no","skånland.no","skanit.no","skánit.no","smola.no","smøla.no","snillfjord.no","snasa.no","snåsa.no","snoasa.no","snaase.no","snåase.no","sogndal.no","sokndal.no","sola.no","solund.no","songdalen.no","sortland.no","spydeberg.no","stange.no","stavanger.no","steigen.no","steinkjer.no","stjordal.no","stjørdal.no","stokke.no","stor-elvdal.no","stord.no","stordal.no","storfjord.no","omasvuotna.no","strand.no","stranda.no","stryn.no","sula.no","suldal.no","sund.no","sunndal.no","surnadal.no","sveio.no","svelvik.no","sykkylven.no","sogne.no","søgne.no","somna.no","sømna.no","sondre-land.no","søndre-land.no","sor-aurdal.no","sør-aurdal.no","sor-fron.no","sør-fron.no","sor-odal.no","sør-odal.no","sor-varanger.no","sør-varanger.no","matta-varjjat.no","mátta-várjjat.no","sorfold.no","sørfold.no","sorreisa.no","sørreisa.no","sorum.no","sørum.no","tana.no","deatnu.no","time.no","tingvoll.no","tinn.no","tjeldsund.no","dielddanuorri.no","tjome.no","tjøme.no","tokke.no","tolga.no","torsken.no","tranoy.no","tranøy.no","tromso.no","tromsø.no","tromsa.no","romsa.no","trondheim.no","troandin.no","trysil.no","trana.no","træna.no","trogstad.no","trøgstad.no","tvedestrand.no","tydal.no","tynset.no","tysfjord.no","divtasvuodna.no","divttasvuotna.no","tysnes.no","tysvar.no","tysvær.no","tonsberg.no","tønsberg.no","ullensaker.no","ullensvang.no","ulvik.no","utsira.no","vadso.no","vadsø.no","cahcesuolo.no","čáhcesuolo.no","vaksdal.no","valle.no","vang.no","vanylven.no","vardo.no","vardø.no","varggat.no","várggát.no","vefsn.no","vaapste.no","vega.no","vegarshei.no","vegårshei.no","vennesla.no","verdal.no","verran.no","vestby.no","vestnes.no","vestre-slidre.no","vestre-toten.no","vestvagoy.no","vestvågøy.no","vevelstad.no","vik.no","vikna.no","vindafjord.no","volda.no","voss.no","varoy.no","værøy.no","vagan.no","vågan.no","voagat.no","vagsoy.no","vågsøy.no","vaga.no","vågå.no","valer.ostfold.no","våler.østfold.no","valer.hedmark.no","våler.hedmark.no","*.np","nr","biz.nr","info.nr","gov.nr","edu.nr","org.nr","net.nr","com.nr","nu","nz","ac.nz","co.nz","cri.nz","geek.nz","gen.nz","govt.nz","health.nz","iwi.nz","kiwi.nz","maori.nz","mil.nz","māori.nz","net.nz","org.nz","parliament.nz","school.nz","om","co.om","com.om","edu.om","gov.om","med.om","museum.om","net.om","org.om","pro.om","onion","org","pa","ac.pa","gob.pa","com.pa","org.pa","sld.pa","edu.pa","net.pa","ing.pa","abo.pa","med.pa","nom.pa","pe","edu.pe","gob.pe","nom.pe","mil.pe","org.pe","com.pe","net.pe","pf","com.pf","org.pf","edu.pf","*.pg","ph","com.ph","net.ph","org.ph","gov.ph","edu.ph","ngo.ph","mil.ph","i.ph","pk","com.pk","net.pk","edu.pk","org.pk","fam.pk","biz.pk","web.pk","gov.pk","gob.pk","gok.pk","gon.pk","gop.pk","gos.pk","info.pk","pl","com.pl","net.pl","org.pl","aid.pl","agro.pl","atm.pl","auto.pl","biz.pl","edu.pl","gmina.pl","gsm.pl","info.pl","mail.pl","miasta.pl","media.pl","mil.pl","nieruchomosci.pl","nom.pl","pc.pl","powiat.pl","priv.pl","realestate.pl","rel.pl","sex.pl","shop.pl","sklep.pl","sos.pl","szkola.pl","targi.pl","tm.pl","tourism.pl","travel.pl","turystyka.pl","gov.pl","ap.gov.pl","ic.gov.pl","is.gov.pl","us.gov.pl","kmpsp.gov.pl","kppsp.gov.pl","kwpsp.gov.pl","psp.gov.pl","wskr.gov.pl","kwp.gov.pl","mw.gov.pl","ug.gov.pl","um.gov.pl","umig.gov.pl","ugim.gov.pl","upow.gov.pl","uw.gov.pl","starostwo.gov.pl","pa.gov.pl","po.gov.pl","psse.gov.pl","pup.gov.pl","rzgw.gov.pl","sa.gov.pl","so.gov.pl","sr.gov.pl","wsa.gov.pl","sko.gov.pl","uzs.gov.pl","wiih.gov.pl","winb.gov.pl","pinb.gov.pl","wios.gov.pl","witd.gov.pl","wzmiuw.gov.pl","piw.gov.pl","wiw.gov.pl","griw.gov.pl","wif.gov.pl","oum.gov.pl","sdn.gov.pl","zp.gov.pl","uppo.gov.pl","mup.gov.pl","wuoz.gov.pl","konsulat.gov.pl","oirm.gov.pl","augustow.pl","babia-gora.pl","bedzin.pl","beskidy.pl","bialowieza.pl","bialystok.pl","bielawa.pl","bieszczady.pl","boleslawiec.pl","bydgoszcz.pl","bytom.pl","cieszyn.pl","czeladz.pl","czest.pl","dlugoleka.pl","elblag.pl","elk.pl","glogow.pl","gniezno.pl","gorlice.pl","grajewo.pl","ilawa.pl","jaworzno.pl","jelenia-gora.pl","jgora.pl","kalisz.pl","kazimierz-dolny.pl","karpacz.pl","kartuzy.pl","kaszuby.pl","katowice.pl","kepno.pl","ketrzyn.pl","klodzko.pl","kobierzyce.pl","kolobrzeg.pl","konin.pl","konskowola.pl","kutno.pl","lapy.pl","lebork.pl","legnica.pl","lezajsk.pl","limanowa.pl","lomza.pl","lowicz.pl","lubin.pl","lukow.pl","malbork.pl","malopolska.pl","mazowsze.pl","mazury.pl","mielec.pl","mielno.pl","mragowo.pl","naklo.pl","nowaruda.pl","nysa.pl","olawa.pl","olecko.pl","olkusz.pl","olsztyn.pl","opoczno.pl","opole.pl","ostroda.pl","ostroleka.pl","ostrowiec.pl","ostrowwlkp.pl","pila.pl","pisz.pl","podhale.pl","podlasie.pl","polkowice.pl","pomorze.pl","pomorskie.pl","prochowice.pl","pruszkow.pl","przeworsk.pl","pulawy.pl","radom.pl","rawa-maz.pl","rybnik.pl","rzeszow.pl","sanok.pl","sejny.pl","slask.pl","slupsk.pl","sosnowiec.pl","stalowa-wola.pl","skoczow.pl","starachowice.pl","stargard.pl","suwalki.pl","swidnica.pl","swiebodzin.pl","swinoujscie.pl","szczecin.pl","szczytno.pl","tarnobrzeg.pl","tgory.pl","turek.pl","tychy.pl","ustka.pl","walbrzych.pl","warmia.pl","warszawa.pl","waw.pl","wegrow.pl","wielun.pl","wlocl.pl","wloclawek.pl","wodzislaw.pl","wolomin.pl","wroclaw.pl","zachpomor.pl","zagan.pl","zarow.pl","zgora.pl","zgorzelec.pl","pm","pn","gov.pn","co.pn","org.pn","edu.pn","net.pn","post","pr","com.pr","net.pr","org.pr","gov.pr","edu.pr","isla.pr","pro.pr","biz.pr","info.pr","name.pr","est.pr","prof.pr","ac.pr","pro","aaa.pro","aca.pro","acct.pro","avocat.pro","bar.pro","cpa.pro","eng.pro","jur.pro","law.pro","med.pro","recht.pro","ps","edu.ps","gov.ps","sec.ps","plo.ps","com.ps","org.ps","net.ps","pt","net.pt","gov.pt","org.pt","edu.pt","int.pt","publ.pt","com.pt","nome.pt","pw","co.pw","ne.pw","or.pw","ed.pw","go.pw","belau.pw","py","com.py","coop.py","edu.py","gov.py","mil.py","net.py","org.py","qa","com.qa","edu.qa","gov.qa","mil.qa","name.qa","net.qa","org.qa","sch.qa","re","asso.re","com.re","nom.re","ro","arts.ro","com.ro","firm.ro","info.ro","nom.ro","nt.ro","org.ro","rec.ro","store.ro","tm.ro","www.ro","rs","ac.rs","co.rs","edu.rs","gov.rs","in.rs","org.rs","ru","rw","ac.rw","co.rw","coop.rw","gov.rw","mil.rw","net.rw","org.rw","sa","com.sa","net.sa","org.sa","gov.sa","med.sa","pub.sa","edu.sa","sch.sa","sb","com.sb","edu.sb","gov.sb","net.sb","org.sb","sc","com.sc","gov.sc","net.sc","org.sc","edu.sc","sd","com.sd","net.sd","org.sd","edu.sd","med.sd","tv.sd","gov.sd","info.sd","se","a.se","ac.se","b.se","bd.se","brand.se","c.se","d.se","e.se","f.se","fh.se","fhsk.se","fhv.se","g.se","h.se","i.se","k.se","komforb.se","kommunalforbund.se","komvux.se","l.se","lanbib.se","m.se","n.se","naturbruksgymn.se","o.se","org.se","p.se","parti.se","pp.se","press.se","r.se","s.se","t.se","tm.se","u.se","w.se","x.se","y.se","z.se","sg","com.sg","net.sg","org.sg","gov.sg","edu.sg","per.sg","sh","com.sh","net.sh","gov.sh","org.sh","mil.sh","si","sj","sk","sl","com.sl","net.sl","edu.sl","gov.sl","org.sl","sm","sn","art.sn","com.sn","edu.sn","gouv.sn","org.sn","perso.sn","univ.sn","so","com.so","edu.so","gov.so","me.so","net.so","org.so","sr","ss","biz.ss","com.ss","edu.ss","gov.ss","me.ss","net.ss","org.ss","sch.ss","st","co.st","com.st","consulado.st","edu.st","embaixada.st","mil.st","net.st","org.st","principe.st","saotome.st","store.st","su","sv","com.sv","edu.sv","gob.sv","org.sv","red.sv","sx","gov.sx","sy","edu.sy","gov.sy","net.sy","mil.sy","com.sy","org.sy","sz","co.sz","ac.sz","org.sz","tc","td","tel","tf","tg","th","ac.th","co.th","go.th","in.th","mi.th","net.th","or.th","tj","ac.tj","biz.tj","co.tj","com.tj","edu.tj","go.tj","gov.tj","int.tj","mil.tj","name.tj","net.tj","nic.tj","org.tj","test.tj","web.tj","tk","tl","gov.tl","tm","com.tm","co.tm","org.tm","net.tm","nom.tm","gov.tm","mil.tm","edu.tm","tn","com.tn","ens.tn","fin.tn","gov.tn","ind.tn","info.tn","intl.tn","mincom.tn","nat.tn","net.tn","org.tn","perso.tn","tourism.tn","to","com.to","gov.to","net.to","org.to","edu.to","mil.to","tr","av.tr","bbs.tr","bel.tr","biz.tr","com.tr","dr.tr","edu.tr","gen.tr","gov.tr","info.tr","mil.tr","k12.tr","kep.tr","name.tr","net.tr","org.tr","pol.tr","tel.tr","tsk.tr","tv.tr","web.tr","nc.tr","gov.nc.tr","tt","co.tt","com.tt","org.tt","net.tt","biz.tt","info.tt","pro.tt","int.tt","coop.tt","jobs.tt","mobi.tt","travel.tt","museum.tt","aero.tt","name.tt","gov.tt","edu.tt","tv","tw","edu.tw","gov.tw","mil.tw","com.tw","net.tw","org.tw","idv.tw","game.tw","ebiz.tw","club.tw","網路.tw","組織.tw","商業.tw","tz","ac.tz","co.tz","go.tz","hotel.tz","info.tz","me.tz","mil.tz","mobi.tz","ne.tz","or.tz","sc.tz","tv.tz","ua","com.ua","edu.ua","gov.ua","in.ua","net.ua","org.ua","cherkassy.ua","cherkasy.ua","chernigov.ua","chernihiv.ua","chernivtsi.ua","chernovtsy.ua","ck.ua","cn.ua","cr.ua","crimea.ua","cv.ua","dn.ua","dnepropetrovsk.ua","dnipropetrovsk.ua","donetsk.ua","dp.ua","if.ua","ivano-frankivsk.ua","kh.ua","kharkiv.ua","kharkov.ua","kherson.ua","khmelnitskiy.ua","khmelnytskyi.ua","kiev.ua","kirovograd.ua","km.ua","kr.ua","krym.ua","ks.ua","kv.ua","kyiv.ua","lg.ua","lt.ua","lugansk.ua","lutsk.ua","lv.ua","lviv.ua","mk.ua","mykolaiv.ua","nikolaev.ua","od.ua","odesa.ua","odessa.ua","pl.ua","poltava.ua","rivne.ua","rovno.ua","rv.ua","sb.ua","sebastopol.ua","sevastopol.ua","sm.ua","sumy.ua","te.ua","ternopil.ua","uz.ua","uzhgorod.ua","vinnica.ua","vinnytsia.ua","vn.ua","volyn.ua","yalta.ua","zaporizhzhe.ua","zaporizhzhia.ua","zhitomir.ua","zhytomyr.ua","zp.ua","zt.ua","ug","co.ug","or.ug","ac.ug","sc.ug","go.ug","ne.ug","com.ug","org.ug","uk","ac.uk","co.uk","gov.uk","ltd.uk","me.uk","net.uk","nhs.uk","org.uk","plc.uk","police.uk","*.sch.uk","us","dni.us","fed.us","isa.us","kids.us","nsn.us","ak.us","al.us","ar.us","as.us","az.us","ca.us","co.us","ct.us","dc.us","de.us","fl.us","ga.us","gu.us","hi.us","ia.us","id.us","il.us","in.us","ks.us","ky.us","la.us","ma.us","md.us","me.us","mi.us","mn.us","mo.us","ms.us","mt.us","nc.us","nd.us","ne.us","nh.us","nj.us","nm.us","nv.us","ny.us","oh.us","ok.us","or.us","pa.us","pr.us","ri.us","sc.us","sd.us","tn.us","tx.us","ut.us","vi.us","vt.us","va.us","wa.us","wi.us","wv.us","wy.us","k12.ak.us","k12.al.us","k12.ar.us","k12.as.us","k12.az.us","k12.ca.us","k12.co.us","k12.ct.us","k12.dc.us","k12.de.us","k12.fl.us","k12.ga.us","k12.gu.us","k12.ia.us","k12.id.us","k12.il.us","k12.in.us","k12.ks.us","k12.ky.us","k12.la.us","k12.ma.us","k12.md.us","k12.me.us","k12.mi.us","k12.mn.us","k12.mo.us","k12.ms.us","k12.mt.us","k12.nc.us","k12.ne.us","k12.nh.us","k12.nj.us","k12.nm.us","k12.nv.us","k12.ny.us","k12.oh.us","k12.ok.us","k12.or.us","k12.pa.us","k12.pr.us","k12.sc.us","k12.tn.us","k12.tx.us","k12.ut.us","k12.vi.us","k12.vt.us","k12.va.us","k12.wa.us","k12.wi.us","k12.wy.us","cc.ak.us","cc.al.us","cc.ar.us","cc.as.us","cc.az.us","cc.ca.us","cc.co.us","cc.ct.us","cc.dc.us","cc.de.us","cc.fl.us","cc.ga.us","cc.gu.us","cc.hi.us","cc.ia.us","cc.id.us","cc.il.us","cc.in.us","cc.ks.us","cc.ky.us","cc.la.us","cc.ma.us","cc.md.us","cc.me.us","cc.mi.us","cc.mn.us","cc.mo.us","cc.ms.us","cc.mt.us","cc.nc.us","cc.nd.us","cc.ne.us","cc.nh.us","cc.nj.us","cc.nm.us","cc.nv.us","cc.ny.us","cc.oh.us","cc.ok.us","cc.or.us","cc.pa.us","cc.pr.us","cc.ri.us","cc.sc.us","cc.sd.us","cc.tn.us","cc.tx.us","cc.ut.us","cc.vi.us","cc.vt.us","cc.va.us","cc.wa.us","cc.wi.us","cc.wv.us","cc.wy.us","lib.ak.us","lib.al.us","lib.ar.us","lib.as.us","lib.az.us","lib.ca.us","lib.co.us","lib.ct.us","lib.dc.us","lib.fl.us","lib.ga.us","lib.gu.us","lib.hi.us","lib.ia.us","lib.id.us","lib.il.us","lib.in.us","lib.ks.us","lib.ky.us","lib.la.us","lib.ma.us","lib.md.us","lib.me.us","lib.mi.us","lib.mn.us","lib.mo.us","lib.ms.us","lib.mt.us","lib.nc.us","lib.nd.us","lib.ne.us","lib.nh.us","lib.nj.us","lib.nm.us","lib.nv.us","lib.ny.us","lib.oh.us","lib.ok.us","lib.or.us","lib.pa.us","lib.pr.us","lib.ri.us","lib.sc.us","lib.sd.us","lib.tn.us","lib.tx.us","lib.ut.us","lib.vi.us","lib.vt.us","lib.va.us","lib.wa.us","lib.wi.us","lib.wy.us","pvt.k12.ma.us","chtr.k12.ma.us","paroch.k12.ma.us","ann-arbor.mi.us","cog.mi.us","dst.mi.us","eaton.mi.us","gen.mi.us","mus.mi.us","tec.mi.us","washtenaw.mi.us","uy","com.uy","edu.uy","gub.uy","mil.uy","net.uy","org.uy","uz","co.uz","com.uz","net.uz","org.uz","va","vc","com.vc","net.vc","org.vc","gov.vc","mil.vc","edu.vc","ve","arts.ve","bib.ve","co.ve","com.ve","e12.ve","edu.ve","firm.ve","gob.ve","gov.ve","info.ve","int.ve","mil.ve","net.ve","nom.ve","org.ve","rar.ve","rec.ve","store.ve","tec.ve","web.ve","vg","vi","co.vi","com.vi","k12.vi","net.vi","org.vi","vn","com.vn","net.vn","org.vn","edu.vn","gov.vn","int.vn","ac.vn","biz.vn","info.vn","name.vn","pro.vn","health.vn","vu","com.vu","edu.vu","net.vu","org.vu","wf","ws","com.ws","net.ws","org.ws","gov.ws","edu.ws","yt","امارات","հայ","বাংলা","бг","البحرين","бел","中国","中國","الجزائر","مصر","ею","ευ","موريتانيا","გე","ελ","香港","公司.香港","教育.香港","政府.香港","個人.香港","網絡.香港","組織.香港","ಭಾರತ","ଭାରତ","ভাৰত","भारतम्","भारोत","ڀارت","ഭാരതം","भारत","بارت","بھارت","భారత్","ભારત","ਭਾਰਤ","ভারত","இந்தியா","ایران","ايران","عراق","الاردن","한국","қаз","ລາວ","ලංකා","இலங்கை","المغرب","мкд","мон","澳門","澳门","مليسيا","عمان","پاکستان","پاكستان","فلسطين","срб","пр.срб","орг.срб","обр.срб","од.срб","упр.срб","ак.срб","рф","قطر","السعودية","السعودیة","السعودیۃ","السعوديه","سودان","新加坡","சிங்கப்பூர்","سورية","سوريا","ไทย","ศึกษา.ไทย","ธุรกิจ.ไทย","รัฐบาล.ไทย","ทหาร.ไทย","เน็ต.ไทย","องค์กร.ไทย","تونس","台灣","台湾","臺灣","укр","اليمن","xxx","ye","com.ye","edu.ye","gov.ye","net.ye","mil.ye","org.ye","ac.za","agric.za","alt.za","co.za","edu.za","gov.za","grondar.za","law.za","mil.za","net.za","ngo.za","nic.za","nis.za","nom.za","org.za","school.za","tm.za","web.za","zm","ac.zm","biz.zm","co.zm","com.zm","edu.zm","gov.zm","info.zm","mil.zm","net.zm","org.zm","sch.zm","zw","ac.zw","co.zw","gov.zw","mil.zw","org.zw","aaa","aarp","abarth","abb","abbott","abbvie","abc","able","abogado","abudhabi","academy","accenture","accountant","accountants","aco","actor","adac","ads","adult","aeg","aetna","afl","africa","agakhan","agency","aig","airbus","airforce","airtel","akdn","alfaromeo","alibaba","alipay","allfinanz","allstate","ally","alsace","alstom","amazon","americanexpress","americanfamily","amex","amfam","amica","amsterdam","analytics","android","anquan","anz","aol","apartments","app","apple","aquarelle","arab","aramco","archi","army","art","arte","asda","associates","athleta","attorney","auction","audi","audible","audio","auspost","author","auto","autos","avianca","aws","axa","azure","baby","baidu","banamex","bananarepublic","band","bank","bar","barcelona","barclaycard","barclays","barefoot","bargains","baseball","basketball","bauhaus","bayern","bbc","bbt","bbva","bcg","bcn","beats","beauty","beer","bentley","berlin","best","bestbuy","bet","bharti","bible","bid","bike","bing","bingo","bio","black","blackfriday","blockbuster","blog","bloomberg","blue","bms","bmw","bnpparibas","boats","boehringer","bofa","bom","bond","boo","book","booking","bosch","bostik","boston","bot","boutique","box","bradesco","bridgestone","broadway","broker","brother","brussels","bugatti","build","builders","business","buy","buzz","bzh","cab","cafe","cal","call","calvinklein","cam","camera","camp","cancerresearch","canon","capetown","capital","capitalone","car","caravan","cards","care","career","careers","cars","casa","case","cash","casino","catering","catholic","cba","cbn","cbre","cbs","center","ceo","cern","cfa","cfd","chanel","channel","charity","chase","chat","cheap","chintai","christmas","chrome","church","cipriani","circle","cisco","citadel","citi","citic","city","cityeats","claims","cleaning","click","clinic","clinique","clothing","cloud","club","clubmed","coach","codes","coffee","college","cologne","comcast","commbank","community","company","compare","computer","comsec","condos","construction","consulting","contact","contractors","cooking","cookingchannel","cool","corsica","country","coupon","coupons","courses","cpa","credit","creditcard","creditunion","cricket","crown","crs","cruise","cruises","cuisinella","cymru","cyou","dabur","dad","dance","data","date","dating","datsun","day","dclk","dds","deal","dealer","deals","degree","delivery","dell","deloitte","delta","democrat","dental","dentist","desi","design","dev","dhl","diamonds","diet","digital","direct","directory","discount","discover","dish","diy","dnp","docs","doctor","dog","domains","dot","download","drive","dtv","dubai","dunlop","dupont","durban","dvag","dvr","earth","eat","eco","edeka","education","email","emerck","energy","engineer","engineering","enterprises","epson","equipment","ericsson","erni","esq","estate","etisalat","eurovision","eus","events","exchange","expert","exposed","express","extraspace","fage","fail","fairwinds","faith","family","fan","fans","farm","farmers","fashion","fast","fedex","feedback","ferrari","ferrero","fiat","fidelity","fido","film","final","finance","financial","fire","firestone","firmdale","fish","fishing","fit","fitness","flickr","flights","flir","florist","flowers","fly","foo","food","foodnetwork","football","ford","forex","forsale","forum","foundation","fox","free","fresenius","frl","frogans","frontdoor","frontier","ftr","fujitsu","fun","fund","furniture","futbol","fyi","gal","gallery","gallo","gallup","game","games","gap","garden","gay","gbiz","gdn","gea","gent","genting","george","ggee","gift","gifts","gives","giving","glass","gle","global","globo","gmail","gmbh","gmo","gmx","godaddy","gold","goldpoint","golf","goo","goodyear","goog","google","gop","got","grainger","graphics","gratis","green","gripe","grocery","group","guardian","gucci","guge","guide","guitars","guru","hair","hamburg","hangout","haus","hbo","hdfc","hdfcbank","health","healthcare","help","helsinki","here","hermes","hgtv","hiphop","hisamitsu","hitachi","hiv","hkt","hockey","holdings","holiday","homedepot","homegoods","homes","homesense","honda","horse","hospital","host","hosting","hot","hoteles","hotels","hotmail","house","how","hsbc","hughes","hyatt","hyundai","ibm","icbc","ice","icu","ieee","ifm","ikano","imamat","imdb","immo","immobilien","inc","industries","infiniti","ing","ink","institute","insurance","insure","international","intuit","investments","ipiranga","irish","ismaili","ist","istanbul","itau","itv","jaguar","java","jcb","jeep","jetzt","jewelry","jio","jll","jmp","jnj","joburg","jot","joy","jpmorgan","jprs","juegos","juniper","kaufen","kddi","kerryhotels","kerrylogistics","kerryproperties","kfh","kia","kids","kim","kinder","kindle","kitchen","kiwi","koeln","komatsu","kosher","kpmg","kpn","krd","kred","kuokgroup","kyoto","lacaixa","lamborghini","lamer","lancaster","lancia","land","landrover","lanxess","lasalle","lat","latino","latrobe","law","lawyer","lds","lease","leclerc","lefrak","legal","lego","lexus","lgbt","lidl","life","lifeinsurance","lifestyle","lighting","like","lilly","limited","limo","lincoln","linde","link","lipsy","live","living","llc","llp","loan","loans","locker","locus","loft","lol","london","lotte","lotto","love","lpl","lplfinancial","ltd","ltda","lundbeck","luxe","luxury","macys","madrid","maif","maison","makeup","man","management","mango","map","market","marketing","markets","marriott","marshalls","maserati","mattel","mba","mckinsey","med","media","meet","melbourne","meme","memorial","men","menu","merckmsd","miami","microsoft","mini","mint","mit","mitsubishi","mlb","mls","mma","mobile","moda","moe","moi","mom","monash","money","monster","mormon","mortgage","moscow","moto","motorcycles","mov","movie","msd","mtn","mtr","music","mutual","nab","nagoya","natura","navy","nba","nec","netbank","netflix","network","neustar","new","news","next","nextdirect","nexus","nfl","ngo","nhk","nico","nike","nikon","ninja","nissan","nissay","nokia","northwesternmutual","norton","now","nowruz","nowtv","nra","nrw","ntt","nyc","obi","observer","office","okinawa","olayan","olayangroup","oldnavy","ollo","omega","one","ong","onl","online","ooo","open","oracle","orange","organic","origins","osaka","otsuka","ott","ovh","page","panasonic","paris","pars","partners","parts","party","passagens","pay","pccw","pet","pfizer","pharmacy","phd","philips","phone","photo","photography","photos","physio","pics","pictet","pictures","pid","pin","ping","pink","pioneer","pizza","place","play","playstation","plumbing","plus","pnc","pohl","poker","politie","porn","pramerica","praxi","press","prime","prod","productions","prof","progressive","promo","properties","property","protection","pru","prudential","pub","pwc","qpon","quebec","quest","racing","radio","read","realestate","realtor","realty","recipes","red","redstone","redumbrella","rehab","reise","reisen","reit","reliance","ren","rent","rentals","repair","report","republican","rest","restaurant","review","reviews","rexroth","rich","richardli","ricoh","ril","rio","rip","rocher","rocks","rodeo","rogers","room","rsvp","rugby","ruhr","run","rwe","ryukyu","saarland","safe","safety","sakura","sale","salon","samsclub","samsung","sandvik","sandvikcoromant","sanofi","sap","sarl","sas","save","saxo","sbi","sbs","sca","scb","schaeffler","schmidt","scholarships","school","schule","schwarz","science","scot","search","seat","secure","security","seek","select","sener","services","ses","seven","sew","sex","sexy","sfr","shangrila","sharp","shaw","shell","shia","shiksha","shoes","shop","shopping","shouji","show","showtime","silk","sina","singles","site","ski","skin","sky","skype","sling","smart","smile","sncf","soccer","social","softbank","software","sohu","solar","solutions","song","sony","soy","spa","space","sport","spot","srl","stada","staples","star","statebank","statefarm","stc","stcgroup","stockholm","storage","store","stream","studio","study","style","sucks","supplies","supply","support","surf","surgery","suzuki","swatch","swiss","sydney","systems","tab","taipei","talk","taobao","target","tatamotors","tatar","tattoo","tax","taxi","tci","tdk","team","tech","technology","temasek","tennis","teva","thd","theater","theatre","tiaa","tickets","tienda","tiffany","tips","tires","tirol","tjmaxx","tjx","tkmaxx","tmall","today","tokyo","tools","top","toray","toshiba","total","tours","town","toyota","toys","trade","trading","training","travel","travelchannel","travelers","travelersinsurance","trust","trv","tube","tui","tunes","tushu","tvs","ubank","ubs","unicom","university","uno","uol","ups","vacations","vana","vanguard","vegas","ventures","verisign","versicherung","vet","viajes","video","vig","viking","villas","vin","vip","virgin","visa","vision","viva","vivo","vlaanderen","vodka","volkswagen","volvo","vote","voting","voto","voyage","vuelos","wales","walmart","walter","wang","wanggou","watch","watches","weather","weatherchannel","webcam","weber","website","wedding","weibo","weir","whoswho","wien","wiki","williamhill","win","windows","wine","winners","wme","wolterskluwer","woodside","work","works","world","wow","wtc","wtf","xbox","xerox","xfinity","xihuan","xin","कॉम","セール","佛山","慈善","集团","在线","点看","คอม","八卦","موقع","公益","公司","香格里拉","网站","移动","我爱你","москва","католик","онлайн","сайт","联通","קום","时尚","微博","淡马锡","ファッション","орг","नेट","ストア","アマゾン","삼성","商标","商店","商城","дети","ポイント","新闻","家電","كوم","中文网","中信","娱乐","谷歌","電訊盈科","购物","クラウド","通販","网店","संगठन","餐厅","网络","ком","亚马逊","诺基亚","食品","飞利浦","手机","ارامكو","العليان","اتصالات","بازار","ابوظبي","كاثوليك","همراه","닷컴","政府","شبكة","بيتك","عرب","机构","组织机构","健康","招聘","рус","大拿","みんな","グーグル","世界","書籍","网址","닷넷","コム","天主教","游戏","vermögensberater","vermögensberatung","企业","信息","嘉里大酒店","嘉里","广东","政务","xyz","yachts","yahoo","yamaxun","yandex","yodobashi","yoga","yokohama","you","youtube","yun","zappos","zara","zero","zip","zone","zuerich","cc.ua","inf.ua","ltd.ua","611.to","graphox.us","*.devcdnaccesso.com","adobeaemcloud.com","*.dev.adobeaemcloud.com","hlx.live","adobeaemcloud.net","hlx.page","hlx3.page","beep.pl","airkitapps.com","airkitapps-au.com","airkitapps.eu","aivencloud.com","barsy.ca","*.compute.estate","*.alces.network","kasserver.com","altervista.org","alwaysdata.net","cloudfront.net","*.compute.amazonaws.com","*.compute-1.amazonaws.com","*.compute.amazonaws.com.cn","us-east-1.amazonaws.com","cn-north-1.eb.amazonaws.com.cn","cn-northwest-1.eb.amazonaws.com.cn","elasticbeanstalk.com","ap-northeast-1.elasticbeanstalk.com","ap-northeast-2.elasticbeanstalk.com","ap-northeast-3.elasticbeanstalk.com","ap-south-1.elasticbeanstalk.com","ap-southeast-1.elasticbeanstalk.com","ap-southeast-2.elasticbeanstalk.com","ca-central-1.elasticbeanstalk.com","eu-central-1.elasticbeanstalk.com","eu-west-1.elasticbeanstalk.com","eu-west-2.elasticbeanstalk.com","eu-west-3.elasticbeanstalk.com","sa-east-1.elasticbeanstalk.com","us-east-1.elasticbeanstalk.com","us-east-2.elasticbeanstalk.com","us-gov-west-1.elasticbeanstalk.com","us-west-1.elasticbeanstalk.com","us-west-2.elasticbeanstalk.com","*.elb.amazonaws.com","*.elb.amazonaws.com.cn","awsglobalaccelerator.com","s3.amazonaws.com","s3-ap-northeast-1.amazonaws.com","s3-ap-northeast-2.amazonaws.com","s3-ap-south-1.amazonaws.com","s3-ap-southeast-1.amazonaws.com","s3-ap-southeast-2.amazonaws.com","s3-ca-central-1.amazonaws.com","s3-eu-central-1.amazonaws.com","s3-eu-west-1.amazonaws.com","s3-eu-west-2.amazonaws.com","s3-eu-west-3.amazonaws.com","s3-external-1.amazonaws.com","s3-fips-us-gov-west-1.amazonaws.com","s3-sa-east-1.amazonaws.com","s3-us-gov-west-1.amazonaws.com","s3-us-east-2.amazonaws.com","s3-us-west-1.amazonaws.com","s3-us-west-2.amazonaws.com","s3.ap-northeast-2.amazonaws.com","s3.ap-south-1.amazonaws.com","s3.cn-north-1.amazonaws.com.cn","s3.ca-central-1.amazonaws.com","s3.eu-central-1.amazonaws.com","s3.eu-west-2.amazonaws.com","s3.eu-west-3.amazonaws.com","s3.us-east-2.amazonaws.com","s3.dualstack.ap-northeast-1.amazonaws.com","s3.dualstack.ap-northeast-2.amazonaws.com","s3.dualstack.ap-south-1.amazonaws.com","s3.dualstack.ap-southeast-1.amazonaws.com","s3.dualstack.ap-southeast-2.amazonaws.com","s3.dualstack.ca-central-1.amazonaws.com","s3.dualstack.eu-central-1.amazonaws.com","s3.dualstack.eu-west-1.amazonaws.com","s3.dualstack.eu-west-2.amazonaws.com","s3.dualstack.eu-west-3.amazonaws.com","s3.dualstack.sa-east-1.amazonaws.com","s3.dualstack.us-east-1.amazonaws.com","s3.dualstack.us-east-2.amazonaws.com","s3-website-us-east-1.amazonaws.com","s3-website-us-west-1.amazonaws.com","s3-website-us-west-2.amazonaws.com","s3-website-ap-northeast-1.amazonaws.com","s3-website-ap-southeast-1.amazonaws.com","s3-website-ap-southeast-2.amazonaws.com","s3-website-eu-west-1.amazonaws.com","s3-website-sa-east-1.amazonaws.com","s3-website.ap-northeast-2.amazonaws.com","s3-website.ap-south-1.amazonaws.com","s3-website.ca-central-1.amazonaws.com","s3-website.eu-central-1.amazonaws.com","s3-website.eu-west-2.amazonaws.com","s3-website.eu-west-3.amazonaws.com","s3-website.us-east-2.amazonaws.com","t3l3p0rt.net","tele.amune.org","apigee.io","siiites.com","appspacehosted.com","appspaceusercontent.com","appudo.net","on-aptible.com","user.aseinet.ne.jp","gv.vc","d.gv.vc","user.party.eus","pimienta.org","poivron.org","potager.org","sweetpepper.org","myasustor.com","cdn.prod.atlassian-dev.net","translated.page","myfritz.net","onavstack.net","*.awdev.ca","*.advisor.ws","ecommerce-shop.pl","b-data.io","backplaneapp.io","balena-devices.com","rs.ba","*.banzai.cloud","app.banzaicloud.io","*.backyards.banzaicloud.io","base.ec","official.ec","buyshop.jp","fashionstore.jp","handcrafted.jp","kawaiishop.jp","supersale.jp","theshop.jp","shopselect.net","base.shop","*.beget.app","betainabox.com","bnr.la","bitbucket.io","blackbaudcdn.net","of.je","bluebite.io","boomla.net","boutir.com","boxfuse.io","square7.ch","bplaced.com","bplaced.de","square7.de","bplaced.net","square7.net","shop.brendly.rs","browsersafetymark.io","uk0.bigv.io","dh.bytemark.co.uk","vm.bytemark.co.uk","cafjs.com","mycd.eu","drr.ac","uwu.ai","carrd.co","crd.co","ju.mp","ae.org","br.com","cn.com","com.de","com.se","de.com","eu.com","gb.net","hu.net","jp.net","jpn.com","mex.com","ru.com","sa.com","se.net","uk.com","uk.net","us.com","za.bz","za.com","ar.com","hu.com","kr.com","no.com","qc.com","uy.com","africa.com","gr.com","in.net","web.in","us.org","co.com","aus.basketball","nz.basketball","radio.am","radio.fm","c.la","certmgr.org","cx.ua","discourse.group","discourse.team","cleverapps.io","clerk.app","clerkstage.app","*.lcl.dev","*.lclstage.dev","*.stg.dev","*.stgstage.dev","clickrising.net","c66.me","cloud66.ws","cloud66.zone","jdevcloud.com","wpdevcloud.com","cloudaccess.host","freesite.host","cloudaccess.net","cloudcontrolled.com","cloudcontrolapp.com","*.cloudera.site","pages.dev","trycloudflare.com","workers.dev","wnext.app","co.ca","*.otap.co","co.cz","c.cdn77.org","cdn77-ssl.net","r.cdn77.net","rsc.cdn77.org","ssl.origin.cdn77-secure.org","cloudns.asia","cloudns.biz","cloudns.club","cloudns.cc","cloudns.eu","cloudns.in","cloudns.info","cloudns.org","cloudns.pro","cloudns.pw","cloudns.us","cnpy.gdn","codeberg.page","co.nl","co.no","webhosting.be","hosting-cluster.nl","ac.ru","edu.ru","gov.ru","int.ru","mil.ru","test.ru","dyn.cosidns.de","dynamisches-dns.de","dnsupdater.de","internet-dns.de","l-o-g-i-n.de","dynamic-dns.info","feste-ip.net","knx-server.net","static-access.net","realm.cz","*.cryptonomic.net","cupcake.is","curv.dev","*.customer-oci.com","*.oci.customer-oci.com","*.ocp.customer-oci.com","*.ocs.customer-oci.com","cyon.link","cyon.site","fnwk.site","folionetwork.site","platform0.app","daplie.me","localhost.daplie.me","dattolocal.com","dattorelay.com","dattoweb.com","mydatto.com","dattolocal.net","mydatto.net","biz.dk","co.dk","firm.dk","reg.dk","store.dk","dyndns.dappnode.io","*.dapps.earth","*.bzz.dapps.earth","builtwithdark.com","demo.datadetect.com","instance.datadetect.com","edgestack.me","ddns5.com","debian.net","deno.dev","deno-staging.dev","dedyn.io","deta.app","deta.dev","*.rss.my.id","*.diher.solutions","discordsays.com","discordsez.com","jozi.biz","dnshome.de","online.th","shop.th","drayddns.com","shoparena.pl","dreamhosters.com","mydrobo.com","drud.io","drud.us","duckdns.org","bip.sh","bitbridge.net","dy.fi","tunk.org","dyndns-at-home.com","dyndns-at-work.com","dyndns-blog.com","dyndns-free.com","dyndns-home.com","dyndns-ip.com","dyndns-mail.com","dyndns-office.com","dyndns-pics.com","dyndns-remote.com","dyndns-server.com","dyndns-web.com","dyndns-wiki.com","dyndns-work.com","dyndns.biz","dyndns.info","dyndns.org","dyndns.tv","at-band-camp.net","ath.cx","barrel-of-knowledge.info","barrell-of-knowledge.info","better-than.tv","blogdns.com","blogdns.net","blogdns.org","blogsite.org","boldlygoingnowhere.org","broke-it.net","buyshouses.net","cechire.com","dnsalias.com","dnsalias.net","dnsalias.org","dnsdojo.com","dnsdojo.net","dnsdojo.org","does-it.net","doesntexist.com","doesntexist.org","dontexist.com","dontexist.net","dontexist.org","doomdns.com","doomdns.org","dvrdns.org","dyn-o-saur.com","dynalias.com","dynalias.net","dynalias.org","dynathome.net","dyndns.ws","endofinternet.net","endofinternet.org","endoftheinternet.org","est-a-la-maison.com","est-a-la-masion.com","est-le-patron.com","est-mon-blogueur.com","for-better.biz","for-more.biz","for-our.info","for-some.biz","for-the.biz","forgot.her.name","forgot.his.name","from-ak.com","from-al.com","from-ar.com","from-az.net","from-ca.com","from-co.net","from-ct.com","from-dc.com","from-de.com","from-fl.com","from-ga.com","from-hi.com","from-ia.com","from-id.com","from-il.com","from-in.com","from-ks.com","from-ky.com","from-la.net","from-ma.com","from-md.com","from-me.org","from-mi.com","from-mn.com","from-mo.com","from-ms.com","from-mt.com","from-nc.com","from-nd.com","from-ne.com","from-nh.com","from-nj.com","from-nm.com","from-nv.com","from-ny.net","from-oh.com","from-ok.com","from-or.com","from-pa.com","from-pr.com","from-ri.com","from-sc.com","from-sd.com","from-tn.com","from-tx.com","from-ut.com","from-va.com","from-vt.com","from-wa.com","from-wi.com","from-wv.com","from-wy.com","ftpaccess.cc","fuettertdasnetz.de","game-host.org","game-server.cc","getmyip.com","gets-it.net","go.dyndns.org","gotdns.com","gotdns.org","groks-the.info","groks-this.info","ham-radio-op.net","here-for-more.info","hobby-site.com","hobby-site.org","home.dyndns.org","homedns.org","homeftp.net","homeftp.org","homeip.net","homelinux.com","homelinux.net","homelinux.org","homeunix.com","homeunix.net","homeunix.org","iamallama.com","in-the-band.net","is-a-anarchist.com","is-a-blogger.com","is-a-bookkeeper.com","is-a-bruinsfan.org","is-a-bulls-fan.com","is-a-candidate.org","is-a-caterer.com","is-a-celticsfan.org","is-a-chef.com","is-a-chef.net","is-a-chef.org","is-a-conservative.com","is-a-cpa.com","is-a-cubicle-slave.com","is-a-democrat.com","is-a-designer.com","is-a-doctor.com","is-a-financialadvisor.com","is-a-geek.com","is-a-geek.net","is-a-geek.org","is-a-green.com","is-a-guru.com","is-a-hard-worker.com","is-a-hunter.com","is-a-knight.org","is-a-landscaper.com","is-a-lawyer.com","is-a-liberal.com","is-a-libertarian.com","is-a-linux-user.org","is-a-llama.com","is-a-musician.com","is-a-nascarfan.com","is-a-nurse.com","is-a-painter.com","is-a-patsfan.org","is-a-personaltrainer.com","is-a-photographer.com","is-a-player.com","is-a-republican.com","is-a-rockstar.com","is-a-socialist.com","is-a-soxfan.org","is-a-student.com","is-a-teacher.com","is-a-techie.com","is-a-therapist.com","is-an-accountant.com","is-an-actor.com","is-an-actress.com","is-an-anarchist.com","is-an-artist.com","is-an-engineer.com","is-an-entertainer.com","is-by.us","is-certified.com","is-found.org","is-gone.com","is-into-anime.com","is-into-cars.com","is-into-cartoons.com","is-into-games.com","is-leet.com","is-lost.org","is-not-certified.com","is-saved.org","is-slick.com","is-uberleet.com","is-very-bad.org","is-very-evil.org","is-very-good.org","is-very-nice.org","is-very-sweet.org","is-with-theband.com","isa-geek.com","isa-geek.net","isa-geek.org","isa-hockeynut.com","issmarterthanyou.com","isteingeek.de","istmein.de","kicks-ass.net","kicks-ass.org","knowsitall.info","land-4-sale.us","lebtimnetz.de","leitungsen.de","likes-pie.com","likescandy.com","merseine.nu","mine.nu","misconfused.org","mypets.ws","myphotos.cc","neat-url.com","office-on-the.net","on-the-web.tv","podzone.net","podzone.org","readmyblog.org","saves-the-whales.com","scrapper-site.net","scrapping.cc","selfip.biz","selfip.com","selfip.info","selfip.net","selfip.org","sells-for-less.com","sells-for-u.com","sells-it.net","sellsyourhome.org","servebbs.com","servebbs.net","servebbs.org","serveftp.net","serveftp.org","servegame.org","shacknet.nu","simple-url.com","space-to-rent.com","stuff-4-sale.org","stuff-4-sale.us","teaches-yoga.com","thruhere.net","traeumtgerade.de","webhop.biz","webhop.info","webhop.net","webhop.org","worse-than.tv","writesthisblog.com","ddnss.de","dyn.ddnss.de","dyndns.ddnss.de","dyndns1.de","dyn-ip24.de","home-webserver.de","dyn.home-webserver.de","myhome-server.de","ddnss.org","definima.net","definima.io","ondigitalocean.app","*.digitaloceanspaces.com","bci.dnstrace.pro","ddnsfree.com","ddnsgeek.com","giize.com","gleeze.com","kozow.com","loseyourip.com","ooguy.com","theworkpc.com","casacam.net","dynu.net","accesscam.org","camdvr.org","freeddns.org","mywire.org","webredirect.org","myddns.rocks","blogsite.xyz","dynv6.net","e4.cz","eero.online","eero-stage.online","elementor.cloud","elementor.cool","en-root.fr","mytuleap.com","tuleap-partners.com","encr.app","encoreapi.com","onred.one","staging.onred.one","eu.encoway.cloud","eu.org","al.eu.org","asso.eu.org","at.eu.org","au.eu.org","be.eu.org","bg.eu.org","ca.eu.org","cd.eu.org","ch.eu.org","cn.eu.org","cy.eu.org","cz.eu.org","de.eu.org","dk.eu.org","edu.eu.org","ee.eu.org","es.eu.org","fi.eu.org","fr.eu.org","gr.eu.org","hr.eu.org","hu.eu.org","ie.eu.org","il.eu.org","in.eu.org","int.eu.org","is.eu.org","it.eu.org","jp.eu.org","kr.eu.org","lt.eu.org","lu.eu.org","lv.eu.org","mc.eu.org","me.eu.org","mk.eu.org","mt.eu.org","my.eu.org","net.eu.org","ng.eu.org","nl.eu.org","no.eu.org","nz.eu.org","paris.eu.org","pl.eu.org","pt.eu.org","q-a.eu.org","ro.eu.org","ru.eu.org","se.eu.org","si.eu.org","sk.eu.org","tr.eu.org","uk.eu.org","us.eu.org","eurodir.ru","eu-1.evennode.com","eu-2.evennode.com","eu-3.evennode.com","eu-4.evennode.com","us-1.evennode.com","us-2.evennode.com","us-3.evennode.com","us-4.evennode.com","twmail.cc","twmail.net","twmail.org","mymailer.com.tw","url.tw","onfabrica.com","apps.fbsbx.com","ru.net","adygeya.ru","bashkiria.ru","bir.ru","cbg.ru","com.ru","dagestan.ru","grozny.ru","kalmykia.ru","kustanai.ru","marine.ru","mordovia.ru","msk.ru","mytis.ru","nalchik.ru","nov.ru","pyatigorsk.ru","spb.ru","vladikavkaz.ru","vladimir.ru","abkhazia.su","adygeya.su","aktyubinsk.su","arkhangelsk.su","armenia.su","ashgabad.su","azerbaijan.su","balashov.su","bashkiria.su","bryansk.su","bukhara.su","chimkent.su","dagestan.su","east-kazakhstan.su","exnet.su","georgia.su","grozny.su","ivanovo.su","jambyl.su","kalmykia.su","kaluga.su","karacol.su","karaganda.su","karelia.su","khakassia.su","krasnodar.su","kurgan.su","kustanai.su","lenug.su","mangyshlak.su","mordovia.su","msk.su","murmansk.su","nalchik.su","navoi.su","north-kazakhstan.su","nov.su","obninsk.su","penza.su","pokrovsk.su","sochi.su","spb.su","tashkent.su","termez.su","togliatti.su","troitsk.su","tselinograd.su","tula.su","tuva.su","vladikavkaz.su","vladimir.su","vologda.su","channelsdvr.net","u.channelsdvr.net","edgecompute.app","fastly-terrarium.com","fastlylb.net","map.fastlylb.net","freetls.fastly.net","map.fastly.net","a.prod.fastly.net","global.prod.fastly.net","a.ssl.fastly.net","b.ssl.fastly.net","global.ssl.fastly.net","fastvps-server.com","fastvps.host","myfast.host","fastvps.site","myfast.space","fedorainfracloud.org","fedorapeople.org","cloud.fedoraproject.org","app.os.fedoraproject.org","app.os.stg.fedoraproject.org","conn.uk","copro.uk","hosp.uk","mydobiss.com","fh-muenster.io","filegear.me","filegear-au.me","filegear-de.me","filegear-gb.me","filegear-ie.me","filegear-jp.me","filegear-sg.me","firebaseapp.com","fireweb.app","flap.id","onflashdrive.app","fldrv.com","fly.dev","edgeapp.net","shw.io","flynnhosting.net","forgeblocks.com","id.forgerock.io","framer.app","framercanvas.com","*.frusky.de","ravpage.co.il","0e.vc","freebox-os.com","freeboxos.com","fbx-os.fr","fbxos.fr","freebox-os.fr","freeboxos.fr","freedesktop.org","freemyip.com","wien.funkfeuer.at","*.futurecms.at","*.ex.futurecms.at","*.in.futurecms.at","futurehosting.at","futuremailing.at","*.ex.ortsinfo.at","*.kunden.ortsinfo.at","*.statics.cloud","independent-commission.uk","independent-inquest.uk","independent-inquiry.uk","independent-panel.uk","independent-review.uk","public-inquiry.uk","royal-commission.uk","campaign.gov.uk","service.gov.uk","api.gov.uk","gehirn.ne.jp","usercontent.jp","gentapps.com","gentlentapis.com","lab.ms","cdn-edges.net","ghost.io","gsj.bz","githubusercontent.com","githubpreview.dev","github.io","gitlab.io","gitapp.si","gitpage.si","glitch.me","nog.community","co.ro","shop.ro","lolipop.io","angry.jp","babyblue.jp","babymilk.jp","backdrop.jp","bambina.jp","bitter.jp","blush.jp","boo.jp","boy.jp","boyfriend.jp","but.jp","candypop.jp","capoo.jp","catfood.jp","cheap.jp","chicappa.jp","chillout.jp","chips.jp","chowder.jp","chu.jp","ciao.jp","cocotte.jp","coolblog.jp","cranky.jp","cutegirl.jp","daa.jp","deca.jp","deci.jp","digick.jp","egoism.jp","fakefur.jp","fem.jp","flier.jp","floppy.jp","fool.jp","frenchkiss.jp","girlfriend.jp","girly.jp","gloomy.jp","gonna.jp","greater.jp","hacca.jp","heavy.jp","her.jp","hiho.jp","hippy.jp","holy.jp","hungry.jp","icurus.jp","itigo.jp","jellybean.jp","kikirara.jp","kill.jp","kilo.jp","kuron.jp","littlestar.jp","lolipopmc.jp","lolitapunk.jp","lomo.jp","lovepop.jp","lovesick.jp","main.jp","mods.jp","mond.jp","mongolian.jp","moo.jp","namaste.jp","nikita.jp","nobushi.jp","noor.jp","oops.jp","parallel.jp","parasite.jp","pecori.jp","peewee.jp","penne.jp","pepper.jp","perma.jp","pigboat.jp","pinoko.jp","punyu.jp","pupu.jp","pussycat.jp","pya.jp","raindrop.jp","readymade.jp","sadist.jp","schoolbus.jp","secret.jp","staba.jp","stripper.jp","sub.jp","sunnyday.jp","thick.jp","tonkotsu.jp","under.jp","upper.jp","velvet.jp","verse.jp","versus.jp","vivian.jp","watson.jp","weblike.jp","whitesnow.jp","zombie.jp","heteml.net","cloudapps.digital","london.cloudapps.digital","pymnt.uk","homeoffice.gov.uk","ro.im","goip.de","run.app","a.run.app","web.app","*.0emm.com","appspot.com","*.r.appspot.com","codespot.com","googleapis.com","googlecode.com","pagespeedmobilizer.com","publishproxy.com","withgoogle.com","withyoutube.com","*.gateway.dev","cloud.goog","translate.goog","*.usercontent.goog","cloudfunctions.net","blogspot.ae","blogspot.al","blogspot.am","blogspot.ba","blogspot.be","blogspot.bg","blogspot.bj","blogspot.ca","blogspot.cf","blogspot.ch","blogspot.cl","blogspot.co.at","blogspot.co.id","blogspot.co.il","blogspot.co.ke","blogspot.co.nz","blogspot.co.uk","blogspot.co.za","blogspot.com","blogspot.com.ar","blogspot.com.au","blogspot.com.br","blogspot.com.by","blogspot.com.co","blogspot.com.cy","blogspot.com.ee","blogspot.com.eg","blogspot.com.es","blogspot.com.mt","blogspot.com.ng","blogspot.com.tr","blogspot.com.uy","blogspot.cv","blogspot.cz","blogspot.de","blogspot.dk","blogspot.fi","blogspot.fr","blogspot.gr","blogspot.hk","blogspot.hr","blogspot.hu","blogspot.ie","blogspot.in","blogspot.is","blogspot.it","blogspot.jp","blogspot.kr","blogspot.li","blogspot.lt","blogspot.lu","blogspot.md","blogspot.mk","blogspot.mr","blogspot.mx","blogspot.my","blogspot.nl","blogspot.no","blogspot.pe","blogspot.pt","blogspot.qa","blogspot.re","blogspot.ro","blogspot.rs","blogspot.ru","blogspot.se","blogspot.sg","blogspot.si","blogspot.sk","blogspot.sn","blogspot.td","blogspot.tw","blogspot.ug","blogspot.vn","goupile.fr","gov.nl","awsmppl.com","günstigbestellen.de","günstigliefern.de","fin.ci","free.hr","caa.li","ua.rs","conf.se","hs.zone","hs.run","hashbang.sh","hasura.app","hasura-app.io","pages.it.hs-heilbronn.de","hepforge.org","herokuapp.com","herokussl.com","ravendb.cloud","myravendb.com","ravendb.community","ravendb.me","development.run","ravendb.run","homesklep.pl","secaas.hk","hoplix.shop","orx.biz","biz.gl","col.ng","firm.ng","gen.ng","ltd.ng","ngo.ng","edu.scot","sch.so","hostyhosting.io","häkkinen.fi","*.moonscale.io","moonscale.net","iki.fi","ibxos.it","iliadboxos.it","impertrixcdn.com","impertrix.com","smushcdn.com","wphostedmail.com","wpmucdn.com","tempurl.host","wpmudev.host","dyn-berlin.de","in-berlin.de","in-brb.de","in-butter.de","in-dsl.de","in-dsl.net","in-dsl.org","in-vpn.de","in-vpn.net","in-vpn.org","biz.at","info.at","info.cx","ac.leg.br","al.leg.br","am.leg.br","ap.leg.br","ba.leg.br","ce.leg.br","df.leg.br","es.leg.br","go.leg.br","ma.leg.br","mg.leg.br","ms.leg.br","mt.leg.br","pa.leg.br","pb.leg.br","pe.leg.br","pi.leg.br","pr.leg.br","rj.leg.br","rn.leg.br","ro.leg.br","rr.leg.br","rs.leg.br","sc.leg.br","se.leg.br","sp.leg.br","to.leg.br","pixolino.com","na4u.ru","iopsys.se","ipifony.net","iservschule.de","mein-iserv.de","schulplattform.de","schulserver.de","test-iserv.de","iserv.dev","iobb.net","mel.cloudlets.com.au","cloud.interhostsolutions.be","users.scale.virtualcloud.com.br","mycloud.by","alp1.ae.flow.ch","appengine.flow.ch","es-1.axarnet.cloud","diadem.cloud","vip.jelastic.cloud","jele.cloud","it1.eur.aruba.jenv-aruba.cloud","it1.jenv-aruba.cloud","keliweb.cloud","cs.keliweb.cloud","oxa.cloud","tn.oxa.cloud","uk.oxa.cloud","primetel.cloud","uk.primetel.cloud","ca.reclaim.cloud","uk.reclaim.cloud","us.reclaim.cloud","ch.trendhosting.cloud","de.trendhosting.cloud","jele.club","amscompute.com","clicketcloud.com","dopaas.com","hidora.com","paas.hosted-by-previder.com","rag-cloud.hosteur.com","rag-cloud-ch.hosteur.com","jcloud.ik-server.com","jcloud-ver-jpc.ik-server.com","demo.jelastic.com","kilatiron.com","paas.massivegrid.com","jed.wafaicloud.com","lon.wafaicloud.com","ryd.wafaicloud.com","j.scaleforce.com.cy","jelastic.dogado.eu","fi.cloudplatform.fi","demo.datacenter.fi","paas.datacenter.fi","jele.host","mircloud.host","paas.beebyte.io","sekd1.beebyteapp.io","jele.io","cloud-fr1.unispace.io","jc.neen.it","cloud.jelastic.open.tim.it","jcloud.kz","upaas.kazteleport.kz","cloudjiffy.net","fra1-de.cloudjiffy.net","west1-us.cloudjiffy.net","jls-sto1.elastx.net","jls-sto2.elastx.net","jls-sto3.elastx.net","faststacks.net","fr-1.paas.massivegrid.net","lon-1.paas.massivegrid.net","lon-2.paas.massivegrid.net","ny-1.paas.massivegrid.net","ny-2.paas.massivegrid.net","sg-1.paas.massivegrid.net","jelastic.saveincloud.net","nordeste-idc.saveincloud.net","j.scaleforce.net","jelastic.tsukaeru.net","sdscloud.pl","unicloud.pl","mircloud.ru","jelastic.regruhosting.ru","enscaled.sg","jele.site","jelastic.team","orangecloud.tn","j.layershift.co.uk","phx.enscaled.us","mircloud.us","myjino.ru","*.hosting.myjino.ru","*.landing.myjino.ru","*.spectrum.myjino.ru","*.vps.myjino.ru","jotelulu.cloud","*.triton.zone","*.cns.joyent.com","js.org","kaas.gg","khplay.nl","ktistory.com","kapsi.fi","keymachine.de","kinghost.net","uni5.net","knightpoint.systems","koobin.events","oya.to","kuleuven.cloud","ezproxy.kuleuven.be","co.krd","edu.krd","krellian.net","webthings.io","git-repos.de","lcube-server.de","svn-repos.de","leadpages.co","lpages.co","lpusercontent.com","lelux.site","co.business","co.education","co.events","co.financial","co.network","co.place","co.technology","app.lmpm.com","linkyard.cloud","linkyard-cloud.ch","members.linode.com","*.nodebalancer.linode.com","*.linodeobjects.com","ip.linodeusercontent.com","we.bs","*.user.localcert.dev","localzone.xyz","loginline.app","loginline.dev","loginline.io","loginline.services","loginline.site","servers.run","lohmus.me","krasnik.pl","leczna.pl","lubartow.pl","lublin.pl","poniatowa.pl","swidnik.pl","glug.org.uk","lug.org.uk","lugs.org.uk","barsy.bg","barsy.co.uk","barsyonline.co.uk","barsycenter.com","barsyonline.com","barsy.club","barsy.de","barsy.eu","barsy.in","barsy.info","barsy.io","barsy.me","barsy.menu","barsy.mobi","barsy.net","barsy.online","barsy.org","barsy.pro","barsy.pub","barsy.ro","barsy.shop","barsy.site","barsy.support","barsy.uk","*.magentosite.cloud","mayfirst.info","mayfirst.org","hb.cldmail.ru","cn.vu","mazeplay.com","mcpe.me","mcdir.me","mcdir.ru","mcpre.ru","vps.mcdir.ru","mediatech.by","mediatech.dev","hra.health","miniserver.com","memset.net","messerli.app","*.cloud.metacentrum.cz","custom.metacentrum.cz","flt.cloud.muni.cz","usr.cloud.muni.cz","meteorapp.com","eu.meteorapp.com","co.pl","*.azurecontainer.io","azurewebsites.net","azure-mobile.net","cloudapp.net","azurestaticapps.net","1.azurestaticapps.net","centralus.azurestaticapps.net","eastasia.azurestaticapps.net","eastus2.azurestaticapps.net","westeurope.azurestaticapps.net","westus2.azurestaticapps.net","csx.cc","mintere.site","forte.id","mozilla-iot.org","bmoattachments.org","net.ru","org.ru","pp.ru","hostedpi.com","customer.mythic-beasts.com","caracal.mythic-beasts.com","fentiger.mythic-beasts.com","lynx.mythic-beasts.com","ocelot.mythic-beasts.com","oncilla.mythic-beasts.com","onza.mythic-beasts.com","sphinx.mythic-beasts.com","vs.mythic-beasts.com","x.mythic-beasts.com","yali.mythic-beasts.com","cust.retrosnub.co.uk","ui.nabu.casa","pony.club","of.fashion","in.london","of.london","from.marketing","with.marketing","for.men","repair.men","and.mom","for.mom","for.one","under.one","for.sale","that.win","from.work","to.work","cloud.nospamproxy.com","netlify.app","4u.com","ngrok.io","nh-serv.co.uk","nfshost.com","*.developer.app","noop.app","*.northflank.app","*.build.run","*.code.run","*.database.run","*.migration.run","noticeable.news","dnsking.ch","mypi.co","n4t.co","001www.com","ddnslive.com","myiphost.com","forumz.info","16-b.it","32-b.it","64-b.it","soundcast.me","tcp4.me","dnsup.net","hicam.net","now-dns.net","ownip.net","vpndns.net","dynserv.org","now-dns.org","x443.pw","now-dns.top","ntdll.top","freeddns.us","crafting.xyz","zapto.xyz","nsupdate.info","nerdpol.ovh","blogsyte.com","brasilia.me","cable-modem.org","ciscofreak.com","collegefan.org","couchpotatofries.org","damnserver.com","ddns.me","ditchyourip.com","dnsfor.me","dnsiskinky.com","dvrcam.info","dynns.com","eating-organic.net","fantasyleague.cc","geekgalaxy.com","golffan.us","health-carereform.com","homesecuritymac.com","homesecuritypc.com","hopto.me","ilovecollege.info","loginto.me","mlbfan.org","mmafan.biz","myactivedirectory.com","mydissent.net","myeffect.net","mymediapc.net","mypsx.net","mysecuritycamera.com","mysecuritycamera.net","mysecuritycamera.org","net-freaks.com","nflfan.org","nhlfan.net","no-ip.ca","no-ip.co.uk","no-ip.net","noip.us","onthewifi.com","pgafan.net","point2this.com","pointto.us","privatizehealthinsurance.net","quicksytes.com","read-books.org","securitytactics.com","serveexchange.com","servehumour.com","servep2p.com","servesarcasm.com","stufftoread.com","ufcfan.org","unusualperson.com","workisboring.com","3utilities.com","bounceme.net","ddns.net","ddnsking.com","gotdns.ch","hopto.org","myftp.biz","myftp.org","myvnc.com","no-ip.biz","no-ip.info","no-ip.org","noip.me","redirectme.net","servebeer.com","serveblog.net","servecounterstrike.com","serveftp.com","servegame.com","servehalflife.com","servehttp.com","serveirc.com","serveminecraft.net","servemp3.com","servepics.com","servequake.com","sytes.net","webhop.me","zapto.org","stage.nodeart.io","pcloud.host","nyc.mn","static.observableusercontent.com","cya.gg","omg.lol","cloudycluster.net","omniwe.site","service.one","nid.io","opensocial.site","opencraft.hosting","orsites.com","operaunite.com","tech.orange","authgear-staging.com","authgearapps.com","skygearapp.com","outsystemscloud.com","*.webpaas.ovh.net","*.hosting.ovh.net","ownprovider.com","own.pm","*.owo.codes","ox.rs","oy.lc","pgfog.com","pagefrontapp.com","pagexl.com","*.paywhirl.com","bar0.net","bar1.net","bar2.net","rdv.to","art.pl","gliwice.pl","krakow.pl","poznan.pl","wroc.pl","zakopane.pl","pantheonsite.io","gotpantheon.com","mypep.link","perspecta.cloud","lk3.ru","on-web.fr","bc.platform.sh","ent.platform.sh","eu.platform.sh","us.platform.sh","*.platformsh.site","*.tst.site","platter-app.com","platter-app.dev","platterp.us","pdns.page","plesk.page","pleskns.com","dyn53.io","onporter.run","co.bn","postman-echo.com","pstmn.io","mock.pstmn.io","httpbin.org","prequalifyme.today","xen.prgmr.com","priv.at","prvcy.page","*.dweb.link","protonet.io","chirurgiens-dentistes-en-france.fr","byen.site","pubtls.org","pythonanywhere.com","eu.pythonanywhere.com","qoto.io","qualifioapp.com","qbuser.com","cloudsite.builders","instances.spawn.cc","instantcloud.cn","ras.ru","qa2.com","qcx.io","*.sys.qcx.io","dev-myqnapcloud.com","alpha-myqnapcloud.com","myqnapcloud.com","*.quipelements.com","vapor.cloud","vaporcloud.io","rackmaze.com","rackmaze.net","g.vbrplsbx.io","*.on-k3s.io","*.on-rancher.cloud","*.on-rio.io","readthedocs.io","rhcloud.com","app.render.com","onrender.com","repl.co","id.repl.co","repl.run","resindevice.io","devices.resinstaging.io","hzc.io","wellbeingzone.eu","wellbeingzone.co.uk","adimo.co.uk","itcouldbewor.se","git-pages.rit.edu","rocky.page","биз.рус","ком.рус","крым.рус","мир.рус","мск.рус","орг.рус","самара.рус","сочи.рус","спб.рус","я.рус","*.builder.code.com","*.dev-builder.code.com","*.stg-builder.code.com","sandcats.io","logoip.de","logoip.com","fr-par-1.baremetal.scw.cloud","fr-par-2.baremetal.scw.cloud","nl-ams-1.baremetal.scw.cloud","fnc.fr-par.scw.cloud","functions.fnc.fr-par.scw.cloud","k8s.fr-par.scw.cloud","nodes.k8s.fr-par.scw.cloud","s3.fr-par.scw.cloud","s3-website.fr-par.scw.cloud","whm.fr-par.scw.cloud","priv.instances.scw.cloud","pub.instances.scw.cloud","k8s.scw.cloud","k8s.nl-ams.scw.cloud","nodes.k8s.nl-ams.scw.cloud","s3.nl-ams.scw.cloud","s3-website.nl-ams.scw.cloud","whm.nl-ams.scw.cloud","k8s.pl-waw.scw.cloud","nodes.k8s.pl-waw.scw.cloud","s3.pl-waw.scw.cloud","s3-website.pl-waw.scw.cloud","scalebook.scw.cloud","smartlabeling.scw.cloud","dedibox.fr","schokokeks.net","gov.scot","service.gov.scot","scrysec.com","firewall-gateway.com","firewall-gateway.de","my-gateway.de","my-router.de","spdns.de","spdns.eu","firewall-gateway.net","my-firewall.org","myfirewall.org","spdns.org","seidat.net","sellfy.store","senseering.net","minisite.ms","magnet.page","biz.ua","co.ua","pp.ua","shiftcrypto.dev","shiftcrypto.io","shiftedit.io","myshopblocks.com","myshopify.com","shopitsite.com","shopware.store","mo-siemens.io","1kapp.com","appchizi.com","applinzi.com","sinaapp.com","vipsinaapp.com","siteleaf.net","bounty-full.com","alpha.bounty-full.com","beta.bounty-full.com","small-web.org","vp4.me","try-snowplow.com","srht.site","stackhero-network.com","musician.io","novecore.site","static.land","dev.static.land","sites.static.land","storebase.store","vps-host.net","atl.jelastic.vps-host.net","njs.jelastic.vps-host.net","ric.jelastic.vps-host.net","playstation-cloud.com","apps.lair.io","*.stolos.io","spacekit.io","customer.speedpartner.de","myspreadshop.at","myspreadshop.com.au","myspreadshop.be","myspreadshop.ca","myspreadshop.ch","myspreadshop.com","myspreadshop.de","myspreadshop.dk","myspreadshop.es","myspreadshop.fi","myspreadshop.fr","myspreadshop.ie","myspreadshop.it","myspreadshop.net","myspreadshop.nl","myspreadshop.no","myspreadshop.pl","myspreadshop.se","myspreadshop.co.uk","api.stdlib.com","storj.farm","utwente.io","soc.srcf.net","user.srcf.net","temp-dns.com","supabase.co","supabase.in","supabase.net","su.paba.se","*.s5y.io","*.sensiosite.cloud","syncloud.it","dscloud.biz","direct.quickconnect.cn","dsmynas.com","familyds.com","diskstation.me","dscloud.me","i234.me","myds.me","synology.me","dscloud.mobi","dsmynas.net","familyds.net","dsmynas.org","familyds.org","vpnplus.to","direct.quickconnect.to","tabitorder.co.il","taifun-dns.de","beta.tailscale.net","ts.net","gda.pl","gdansk.pl","gdynia.pl","med.pl","sopot.pl","site.tb-hosting.com","edugit.io","s3.teckids.org","telebit.app","telebit.io","*.telebit.xyz","gwiddle.co.uk","*.firenet.ch","*.svc.firenet.ch","reservd.com","thingdustdata.com","cust.dev.thingdust.io","cust.disrec.thingdust.io","cust.prod.thingdust.io","cust.testing.thingdust.io","reservd.dev.thingdust.io","reservd.disrec.thingdust.io","reservd.testing.thingdust.io","tickets.io","arvo.network","azimuth.network","tlon.network","torproject.net","pages.torproject.net","bloxcms.com","townnews-staging.com","tbits.me","12hp.at","2ix.at","4lima.at","lima-city.at","12hp.ch","2ix.ch","4lima.ch","lima-city.ch","trafficplex.cloud","de.cool","12hp.de","2ix.de","4lima.de","lima-city.de","1337.pictures","clan.rip","lima-city.rocks","webspace.rocks","lima.zone","*.transurl.be","*.transurl.eu","*.transurl.nl","site.transip.me","tuxfamily.org","dd-dns.de","diskstation.eu","diskstation.org","dray-dns.de","draydns.de","dyn-vpn.de","dynvpn.de","mein-vigor.de","my-vigor.de","my-wan.de","syno-ds.de","synology-diskstation.de","synology-ds.de","typedream.app","pro.typeform.com","uber.space","*.uberspace.de","hk.com","hk.org","ltd.hk","inc.hk","name.pm","sch.tf","biz.wf","sch.wf","org.yt","virtualuser.de","virtual-user.de","upli.io","urown.cloud","dnsupdate.info","lib.de.us","2038.io","vercel.app","vercel.dev","now.sh","router.management","v-info.info","voorloper.cloud","neko.am","nyaa.am","be.ax","cat.ax","es.ax","eu.ax","gg.ax","mc.ax","us.ax","xy.ax","nl.ci","xx.gl","app.gp","blog.gt","de.gt","to.gt","be.gy","cc.hn","blog.kg","io.kg","jp.kg","tv.kg","uk.kg","us.kg","de.ls","at.md","de.md","jp.md","to.md","indie.porn","vxl.sh","ch.tc","me.tc","we.tc","nyan.to","at.vg","blog.vu","dev.vu","me.vu","v.ua","*.vultrobjects.com","wafflecell.com","*.webhare.dev","reserve-online.net","reserve-online.com","bookonline.app","hotelwithflight.com","wedeploy.io","wedeploy.me","wedeploy.sh","remotewd.com","pages.wiardweb.com","wmflabs.org","toolforge.org","wmcloud.org","panel.gg","daemon.panel.gg","messwithdns.com","woltlab-demo.com","myforum.community","community-pro.de","diskussionsbereich.de","community-pro.net","meinforum.net","affinitylottery.org.uk","raffleentry.org.uk","weeklylottery.org.uk","wpenginepowered.com","js.wpenginepowered.com","wixsite.com","editorx.io","half.host","xnbay.com","u2.xnbay.com","u2-local.xnbay.com","cistron.nl","demon.nl","xs4all.space","yandexcloud.net","storage.yandexcloud.net","website.yandexcloud.net","official.academy","yolasite.com","ybo.faith","yombo.me","homelink.one","ybo.party","ybo.review","ybo.science","ybo.trade","ynh.fr","nohost.me","noho.st","za.net","za.org","bss.design","basicserver.io","virtualserver.io","enterprisecloud.nu"];!function(e){var t=i,a={};a.rules=v.map((function(e){return{rule:e,suffix:e.replace(/^(\*\.|\!)/,""),punySuffix:-1,wildcard:"*"===e.charAt(0),exception:"!"===e.charAt(0)}})),a.endsWith=function(e,t){return-1!==e.indexOf(t,e.length-t.length)},a.findRule=function(e){var r=t.toASCII(e);return a.rules.reduce((function(e,i){return-1===i.punySuffix&&(i.punySuffix=t.toASCII(i.suffix)),a.endsWith(r,"."+i.punySuffix)||r===i.punySuffix?i:e}),null)},e.errorCodes={DOMAIN_TOO_SHORT:"Domain name too short.",DOMAIN_TOO_LONG:"Domain name too long. It should be no more than 255 chars.",LABEL_STARTS_WITH_DASH:"Domain name label can not start with a dash.",LABEL_ENDS_WITH_DASH:"Domain name label can not end with a dash.",LABEL_TOO_LONG:"Domain name label should be at most 63 chars long.",LABEL_TOO_SHORT:"Domain name label should be at least 1 character long.",LABEL_INVALID_CHARS:"Domain name label can only contain alphanumeric characters or dashes."},a.validate=function(e){var a=t.toASCII(e);if(a.length<1)return"DOMAIN_TOO_SHORT";if(a.length>255)return"DOMAIN_TOO_LONG";for(var r,i=a.split("."),n=0;n<i.length;++n){if(!(r=i[n]).length)return"LABEL_TOO_SHORT";if(r.length>63)return"LABEL_TOO_LONG";if("-"===r.charAt(0))return"LABEL_STARTS_WITH_DASH";if("-"===r.charAt(r.length-1))return"LABEL_ENDS_WITH_DASH";if(!/^[a-z0-9\-]+$/.test(r))return"LABEL_INVALID_CHARS"}},e.parse=function(r){if("string"!=typeof r)throw new TypeError("Domain name must be a string.");var i=r.slice(0).toLowerCase();"."===i.charAt(i.length-1)&&(i=i.slice(0,i.length-1));var n=a.validate(i);if(n)return{input:r,error:{message:e.errorCodes[n],code:n}};var o={input:r,tld:null,sld:null,domain:null,subdomain:null,listed:!1},s=i.split(".");if("local"===s[s.length-1])return o;var u=function(){return/xn--/.test(i)?(o.domain&&(o.domain=t.toASCII(o.domain)),o.subdomain&&(o.subdomain=t.toASCII(o.subdomain)),o):o},c=a.findRule(i);if(!c)return s.length<2?o:(o.tld=s.pop(),o.sld=s.pop(),o.domain=[o.sld,o.tld].join("."),s.length&&(o.subdomain=s.pop()),u());o.listed=!0;var l=c.suffix.split("."),p=s.slice(0,s.length-l.length);return c.exception&&p.push(l.shift()),o.tld=l.join("."),p.length?(c.wildcard&&(l.unshift(p.pop()),o.tld=l.join(".")),p.length?(o.sld=p.pop(),o.domain=[o.sld,o.tld].join("."),p.length&&(o.subdomain=p.join(".")),u()):u()):u()},e.get=function(t){return t&&e.parse(t).domain||null},e.isValid=function(t){var a=e.parse(t);return Boolean(a.domain&&a.listed)}}(k);class b{userContext;logger;constructor(e){this.userContext=e.userContext,this.logger=e.logger,m.setLogger((e=>{this.logger.info(e)}))}async getAccountConfig(e){return await this.userContext.getObj(this.buildAccountKey(e))||{}}buildAccountKey(e){return"acme.config."+e}async saveAccountConfig(e,t){await this.userContext.setObj(this.buildAccountKey(e),t)}async getAcmeClient(e,t=!1){const a=await this.getAccountConfig(e);null==a.key&&(a.key=await this.createNewKey(),await this.saveAccountConfig(e,a));const r=new m.Client({directoryUrl:t?m.directory.letsencrypt.staging:m.directory.letsencrypt.production,accountKey:a.key,accountUrl:a.accountUrl,backoffAttempts:20,backoffMin:5e3,backoffMax:1e4});if(null==a.accountUrl){const t={termsOfServiceAgreed:!0,contact:[`mailto:${e}`]};await r.createAccount(t),a.accountUrl=r.getAccountUrl(),await this.saveAccountConfig(e,a)}return r}async createNewKey(){return(await m.forge.createPrivateKey()).toString()}parseDomain(e){const t=k.parse(e);if(t.error)throw new Error(`解析${e}域名失败:`+JSON.stringify(t.error));return t.domain}async challengeCreateFn(e,t,a,r){this.logger.info("Triggered challengeCreateFn()");const i=e.identifier.value;if("http-01"===t.type){const e=`/var/www/html/.well-known/acme-challenge/${t.token}`,r=a;this.logger.info(`Creating challenge response for ${i} at path: ${e}`),this.logger.info(`Would write "${r}" to path "${e}"`)}else if("dns-01"===t.type){const e=`_acme-challenge.${i}`,t=a;this.logger.info(`Creating TXT record for ${i}: ${e}`),this.logger.info(`Would create TXT record "${e}" with value "${t}"`);const n=this.parseDomain(i);return this.logger.info("解析到域名domain=",n),await r.createRecord({fullRecord:e,type:"TXT",value:t,domain:n})}}async challengeRemoveFn(e,t,a,r,i){this.logger.info("Triggered challengeRemoveFn()");const n=e.identifier.value;if("http-01"===t.type){const e=`/var/www/html/.well-known/acme-challenge/${t.token}`;this.logger.info(`Removing challenge response for ${n} at path: ${e}`),this.logger.info(`Would remove file on path "${e}"`)}else if("dns-01"===t.type){const e=`_acme-challenge.${n}`,t=a;this.logger.info(`Removing TXT record for ${n}: ${e}`),this.logger.info(`Would remove TXT record "${e}" with value "${t}"`);const o=this.parseDomain(n);try{await i.removeRecord({fullRecord:e,type:"TXT",value:a,record:r,domain:o})}catch(e){throw this.logger.error("删除解析记录出错:",e),e}}}async order(e){const{email:t,isTest:a,domains:r,csrInfo:i,dnsProvider:n}=e,o=await this.getAcmeClient(t,a),{commonName:s,altNames:u}=this.buildCommonNameByDomains(r),[c,l]=await m.forge.createCsr({commonName:s,...i,altNames:u});if(null==n)throw new Error("dnsProvider 不能为空");const p={crt:(await o.auto({csr:l,email:t,termsOfServiceAgreed:!0,challengePriority:["dns-01"],challengeCreateFn:async(e,t,a)=>await this.challengeCreateFn(e,t,a,n),challengeRemoveFn:async(e,t,a,r)=>await this.challengeRemoveFn(e,t,a,r,n)})).toString(),key:c.toString(),csr:l.toString()};return this.logger.debug(`CSR:\n${p.csr}`),this.logger.debug(`Certificate:\n${p.crt}`),this.logger.info("证书申请成功"),p}buildCommonNameByDomains(e){if("string"==typeof e&&(e=e.split(",")),0===e.length)throw new Error("domain can not be empty");const t=e[0];let a;return e.length>1&&(a=r.slice(e,1)),{commonName:t,altNames:a}}}const w=new e.Registry("dnsProvider"),j="pipeline:dns-provider";var C={},E={get exports(){return C},set exports(e){C=e}},S={options:{usePureJavaScript:!1}},T={},_=T,I={};T.encode=function(e,t,a){if("string"!=typeof t)throw new TypeError('"alphabet" must be a string.');if(void 0!==a&&"number"!=typeof a)throw new TypeError('"maxline" must be a number.');var r="";if(e instanceof Uint8Array){var i=0,n=t.length,o=t.charAt(0),s=[0];for(i=0;i<e.length;++i){for(var u=0,c=e[i];u<s.length;++u)c+=s[u]<<8,s[u]=c%n,c=c/n|0;for(;c>0;)s.push(c%n),c=c/n|0}for(i=0;0===e[i]&&i<e.length-1;++i)r+=o;for(i=s.length-1;i>=0;--i)r+=t[s[i]]}else r=function(e,t){var a=0,r=t.length,i=t.charAt(0),n=[0];for(a=0;a<e.length();++a){for(var o=0,s=e.at(a);o<n.length;++o)s+=n[o]<<8,n[o]=s%r,s=s/r|0;for(;s>0;)n.push(s%r),s=s/r|0}var u="";for(a=0;0===e.at(a)&&a<e.length()-1;++a)u+=i;for(a=n.length-1;a>=0;--a)u+=t[n[a]];return u}(e,t);if(a){var l=new RegExp(".{1,"+a+"}","g");r=r.match(l).join("\r\n")}return r},T.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 a=I[t];if(!a){a=I[t]=[];for(var r=0;r<t.length;++r)a[t.charCodeAt(r)]=r}e=e.replace(/\s/g,"");var i=t.length,n=t.charAt(0),o=[0];for(r=0;r<e.length;r++){var s=a[e.charCodeAt(r)];if(void 0===s)return;for(var u=0,c=s;u<o.length;++u)c+=o[u]*i,o[u]=255&c,c>>=8;for(;c>0;)o.push(255&c),c>>=8}for(var l=0;e[l]===n&&l<e.length-1;++l)o.push(0);return"undefined"!=typeof Buffer?Buffer.from(o.reverse()):new Uint8Array(o.reverse())};var A=S,B=_,N=A.util=A.util||{};function R(e){if(8!==e&&16!==e&&24!==e&&32!==e)throw new Error("Only 8, 16, 24, or 32 bits supported: "+e)}function z(e){if(this.data="",this.read=0,"string"==typeof e)this.data=e;else if(N.isArrayBuffer(e)||N.isArrayBufferView(e))if("undefined"!=typeof Buffer&&e instanceof Buffer)this.data=e.toString("binary");else{var t=new Uint8Array(e);try{this.data=String.fromCharCode.apply(null,t)}catch(e){for(var a=0;a<t.length;++a)this.putByte(t[a])}}else(e instanceof z||"object"==typeof e&&"string"==typeof e.data&&"number"==typeof e.read)&&(this.data=e.data,this.read=e.read);this._constructedStringLength=0}!function(){if("undefined"!=typeof process&&process.nextTick&&!process.browser)return N.nextTick=process.nextTick,void("function"==typeof setImmediate?N.setImmediate=setImmediate:N.setImmediate=N.nextTick);if("function"==typeof setImmediate)return N.setImmediate=function(){return setImmediate.apply(void 0,arguments)},void(N.nextTick=function(e){return setImmediate(e)});if(N.setImmediate=function(e){setTimeout(e,0)},"undefined"!=typeof window&&"function"==typeof window.postMessage){var e="forge.setImmediate",t=[];function o(a){if(a.source===window&&a.data===e){a.stopPropagation();var r=t.slice();t.length=0,r.forEach((function(e){e()}))}}N.setImmediate=function(a){t.push(a),1===t.length&&window.postMessage(e,"*")},window.addEventListener("message",o,!0)}if("undefined"!=typeof MutationObserver){var a=Date.now(),r=!0,i=document.createElement("div");t=[];new MutationObserver((function(){var e=t.slice();t.length=0,e.forEach((function(e){e()}))})).observe(i,{attributes:!0});var n=N.setImmediate;N.setImmediate=function(e){Date.now()-a>15?(a=Date.now(),n(e)):(t.push(e),1===t.length&&i.setAttribute("a",r=!r))}}N.nextTick=N.setImmediate}(),N.isNodejs="undefined"!=typeof process&&process.versions&&process.versions.node,N.globalScope=N.isNodejs?g:"undefined"==typeof self?window:self,N.isArray=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},N.isArrayBuffer=function(e){return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer},N.isArrayBufferView=function(e){return e&&N.isArrayBuffer(e.buffer)&&void 0!==e.byteLength},N.ByteBuffer=z,N.ByteStringBuffer=z;N.ByteStringBuffer.prototype._optimizeConstructedString=function(e){this._constructedStringLength+=e,this._constructedStringLength>4096&&(this.data.substr(0,1),this._constructedStringLength=0)},N.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read},N.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0},N.ByteStringBuffer.prototype.putByte=function(e){return this.putBytes(String.fromCharCode(e))},N.ByteStringBuffer.prototype.fillWithByte=function(e,t){e=String.fromCharCode(e);for(var a=this.data;t>0;)1&t&&(a+=e),(t>>>=1)>0&&(e+=e);return this.data=a,this._optimizeConstructedString(t),this},N.ByteStringBuffer.prototype.putBytes=function(e){return this.data+=e,this._optimizeConstructedString(e.length),this},N.ByteStringBuffer.prototype.putString=function(e){return this.putBytes(N.encodeUtf8(e))},N.ByteStringBuffer.prototype.putInt16=function(e){return this.putBytes(String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},N.ByteStringBuffer.prototype.putInt24=function(e){return this.putBytes(String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},N.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))},N.ByteStringBuffer.prototype.putInt16Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255))},N.ByteStringBuffer.prototype.putInt24Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255))},N.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))},N.ByteStringBuffer.prototype.putInt=function(e,t){R(t);var a="";do{t-=8,a+=String.fromCharCode(e>>t&255)}while(t>0);return this.putBytes(a)},N.ByteStringBuffer.prototype.putSignedInt=function(e,t){return e<0&&(e+=2<<t-1),this.putInt(e,t)},N.ByteStringBuffer.prototype.putBuffer=function(e){return this.putBytes(e.getBytes())},N.ByteStringBuffer.prototype.getByte=function(){return this.data.charCodeAt(this.read++)},N.ByteStringBuffer.prototype.getInt16=function(){var e=this.data.charCodeAt(this.read)<<8^this.data.charCodeAt(this.read+1);return this.read+=2,e},N.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},N.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},N.ByteStringBuffer.prototype.getInt16Le=function(){var e=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8;return this.read+=2,e},N.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},N.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},N.ByteStringBuffer.prototype.getInt=function(e){R(e);var t=0;do{t=(t<<8)+this.data.charCodeAt(this.read++),e-=8}while(e>0);return t},N.ByteStringBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),a=2<<e-2;return t>=a&&(t-=a<<1),t},N.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},N.ByteStringBuffer.prototype.bytes=function(e){return void 0===e?this.data.slice(this.read):this.data.slice(this.read,this.read+e)},N.ByteStringBuffer.prototype.at=function(e){return this.data.charCodeAt(this.read+e)},N.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},N.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)},N.ByteStringBuffer.prototype.copy=function(){var e=N.createBuffer(this.data);return e.read=this.read,e},N.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this},N.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this},N.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},N.ByteStringBuffer.prototype.toHex=function(){for(var e="",t=this.read;t<this.data.length;++t){var a=this.data.charCodeAt(t);a<16&&(e+="0"),e+=a.toString(16)}return e},N.ByteStringBuffer.prototype.toString=function(){return N.decodeUtf8(this.bytes())},N.DataBuffer=function(e,t){t=t||{},this.read=t.readOffset||0,this.growSize=t.growSize||1024;var a=N.isArrayBuffer(e),r=N.isArrayBufferView(e);if(a||r)return this.data=a?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)},N.DataBuffer.prototype.length=function(){return this.write-this.read},N.DataBuffer.prototype.isEmpty=function(){return this.length()<=0},N.DataBuffer.prototype.accommodate=function(e,t){if(this.length()>=e)return this;t=Math.max(t||this.growSize,e);var a=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),r=new Uint8Array(this.length()+t);return r.set(a),this.data=new DataView(r.buffer),this},N.DataBuffer.prototype.putByte=function(e){return this.accommodate(1),this.data.setUint8(this.write++,e),this},N.DataBuffer.prototype.fillWithByte=function(e,t){this.accommodate(t);for(var a=0;a<t;++a)this.data.setUint8(e);return this},N.DataBuffer.prototype.putBytes=function(e,t){if(N.isArrayBufferView(e)){var a=(r=new Uint8Array(e.buffer,e.byteOffset,e.byteLength)).byteLength-r.byteOffset;return this.accommodate(a),new Uint8Array(this.data.buffer,this.write).set(r),this.write+=a,this}if(N.isArrayBuffer(e)){var r=new Uint8Array(e);return this.accommodate(r.byteLength),new Uint8Array(this.data.buffer).set(r,this.write),this.write+=r.byteLength,this}if(e instanceof N.DataBuffer||"object"==typeof e&&"number"==typeof e.read&&"number"==typeof e.write&&N.isArrayBufferView(e.data)){r=new Uint8Array(e.data.byteLength,e.read,e.length());return this.accommodate(r.byteLength),new Uint8Array(e.data.byteLength,this.write).set(r),this.write+=r.byteLength,this}if(e instanceof N.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+=N.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+=N.binary.base64.decode(e,i,this.write),this;if("utf8"===t&&(e=N.encodeUtf8(e),t="binary"),"binary"===t||"raw"===t)return this.accommodate(e.length),i=new Uint8Array(this.data.buffer,this.write),this.write+=N.binary.raw.decode(i),this;if("utf16"===t)return this.accommodate(2*e.length),i=new Uint16Array(this.data.buffer,this.write),this.write+=N.text.utf16.encode(i),this;throw new Error("Invalid encoding: "+t)}throw Error("Invalid parameter: "+e)},N.DataBuffer.prototype.putBuffer=function(e){return this.putBytes(e),e.clear(),this},N.DataBuffer.prototype.putString=function(e){return this.putBytes(e,"utf16")},N.DataBuffer.prototype.putInt16=function(e){return this.accommodate(2),this.data.setInt16(this.write,e),this.write+=2,this},N.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},N.DataBuffer.prototype.putInt32=function(e){return this.accommodate(4),this.data.setInt32(this.write,e),this.write+=4,this},N.DataBuffer.prototype.putInt16Le=function(e){return this.accommodate(2),this.data.setInt16(this.write,e,!0),this.write+=2,this},N.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},N.DataBuffer.prototype.putInt32Le=function(e){return this.accommodate(4),this.data.setInt32(this.write,e,!0),this.write+=4,this},N.DataBuffer.prototype.putInt=function(e,t){R(t),this.accommodate(t/8);do{t-=8,this.data.setInt8(this.write++,e>>t&255)}while(t>0);return this},N.DataBuffer.prototype.putSignedInt=function(e,t){return R(t),this.accommodate(t/8),e<0&&(e+=2<<t-1),this.putInt(e,t)},N.DataBuffer.prototype.getByte=function(){return this.data.getInt8(this.read++)},N.DataBuffer.prototype.getInt16=function(){var e=this.data.getInt16(this.read);return this.read+=2,e},N.DataBuffer.prototype.getInt24=function(){var e=this.data.getInt16(this.read)<<8^this.data.getInt8(this.read+2);return this.read+=3,e},N.DataBuffer.prototype.getInt32=function(){var e=this.data.getInt32(this.read);return this.read+=4,e},N.DataBuffer.prototype.getInt16Le=function(){var e=this.data.getInt16(this.read,!0);return this.read+=2,e},N.DataBuffer.prototype.getInt24Le=function(){var e=this.data.getInt8(this.read)^this.data.getInt16(this.read+1,!0)<<8;return this.read+=3,e},N.DataBuffer.prototype.getInt32Le=function(){var e=this.data.getInt32(this.read,!0);return this.read+=4,e},N.DataBuffer.prototype.getInt=function(e){R(e);var t=0;do{t=(t<<8)+this.data.getInt8(this.read++),e-=8}while(e>0);return t},N.DataBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),a=2<<e-2;return t>=a&&(t-=a<<1),t},N.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},N.DataBuffer.prototype.bytes=function(e){return void 0===e?this.data.slice(this.read):this.data.slice(this.read,this.read+e)},N.DataBuffer.prototype.at=function(e){return this.data.getUint8(this.read+e)},N.DataBuffer.prototype.setAt=function(e,t){return this.data.setUint8(e,t),this},N.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)},N.DataBuffer.prototype.copy=function(){return new N.DataBuffer(this)},N.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},N.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this},N.DataBuffer.prototype.truncate=function(e){return this.write=Math.max(0,this.length()-e),this.read=Math.min(this.read,this.write),this},N.DataBuffer.prototype.toHex=function(){for(var e="",t=this.read;t<this.data.byteLength;++t){var a=this.data.getUint8(t);a<16&&(e+="0"),e+=a.toString(16)}return e},N.DataBuffer.prototype.toString=function(e){var t=new Uint8Array(this.data,this.read,this.length());if("binary"===(e=e||"utf8")||"raw"===e)return N.binary.raw.encode(t);if("hex"===e)return N.binary.hex.encode(t);if("base64"===e)return N.binary.base64.encode(t);if("utf8"===e)return N.text.utf8.decode(t);if("utf16"===e)return N.text.utf16.decode(t);throw new Error("Invalid encoding: "+e)},N.createBuffer=function(e,t){return t=t||"raw",void 0!==e&&"utf8"===t&&(e=N.encodeUtf8(e)),new N.ByteBuffer(e)},N.fillString=function(e,t){for(var a="";t>0;)1&t&&(a+=e),(t>>>=1)>0&&(e+=e);return a},N.xorBytes=function(e,t,a){for(var r="",i="",n="",o=0,s=0;a>0;--a,++o)i=e.charCodeAt(o)^t.charCodeAt(o),s>=10&&(r+=n,n="",s=0),n+=String.fromCharCode(i),++s;return r+=n},N.hexToBytes=function(e){var t="",a=0;for(!0&e.length&&(a=1,t+=String.fromCharCode(parseInt(e[0],16)));a<e.length;a+=2)t+=String.fromCharCode(parseInt(e.substr(a,2),16));return t},N.bytesToHex=function(e){return N.createBuffer(e).toHex()},N.int32ToBytes=function(e){return String.fromCharCode(e>>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e)};var L="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",x=[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],D="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";N.encode64=function(e,t){for(var a,r,i,n="",o="",s=0;s<e.length;)a=e.charCodeAt(s++),r=e.charCodeAt(s++),i=e.charCodeAt(s++),n+=L.charAt(a>>2),n+=L.charAt((3&a)<<4|r>>4),isNaN(r)?n+="==":(n+=L.charAt((15&r)<<2|i>>6),n+=isNaN(i)?"=":L.charAt(63&i)),t&&n.length>t&&(o+=n.substr(0,t)+"\r\n",n=n.substr(t));return o+=n},N.decode64=function(e){e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var t,a,r,i,n="",o=0;o<e.length;)t=x[e.charCodeAt(o++)-43],a=x[e.charCodeAt(o++)-43],r=x[e.charCodeAt(o++)-43],i=x[e.charCodeAt(o++)-43],n+=String.fromCharCode(t<<2|a>>4),64!==r&&(n+=String.fromCharCode((15&a)<<4|r>>2),64!==i&&(n+=String.fromCharCode((3&r)<<6|i)));return n},N.encodeUtf8=function(e){return unescape(encodeURIComponent(e))},N.decodeUtf8=function(e){return decodeURIComponent(escape(e))},N.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:B.encode,decode:B.decode}},N.binary.raw.encode=function(e){return String.fromCharCode.apply(null,e)},N.binary.raw.decode=function(e,t,a){var r=t;r||(r=new Uint8Array(e.length));for(var i=a=a||0,n=0;n<e.length;++n)r[i++]=e.charCodeAt(n);return t?i-a:r},N.binary.hex.encode=N.bytesToHex,N.binary.hex.decode=function(e,t,a){var r=t;r||(r=new Uint8Array(Math.ceil(e.length/2)));var i=0,n=a=a||0;for(1&e.length&&(i=1,r[n++]=parseInt(e[0],16));i<e.length;i+=2)r[n++]=parseInt(e.substr(i,2),16);return t?n-a:r},N.binary.base64.encode=function(e,t){for(var a,r,i,n="",o="",s=0;s<e.byteLength;)a=e[s++],r=e[s++],i=e[s++],n+=L.charAt(a>>2),n+=L.charAt((3&a)<<4|r>>4),isNaN(r)?n+="==":(n+=L.charAt((15&r)<<2|i>>6),n+=isNaN(i)?"=":L.charAt(63&i)),t&&n.length>t&&(o+=n.substr(0,t)+"\r\n",n=n.substr(t));return o+=n},N.binary.base64.decode=function(e,t,a){var r,i,n,o,s=t;s||(s=new Uint8Array(3*Math.ceil(e.length/4))),e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var u=0,c=a=a||0;u<e.length;)r=x[e.charCodeAt(u++)-43],i=x[e.charCodeAt(u++)-43],n=x[e.charCodeAt(u++)-43],o=x[e.charCodeAt(u++)-43],s[c++]=r<<2|i>>4,64!==n&&(s[c++]=(15&i)<<4|n>>2,64!==o&&(s[c++]=(3&n)<<6|o));return t?c-a:s.subarray(0,c)},N.binary.base58.encode=function(e,t){return N.binary.baseN.encode(e,D,t)},N.binary.base58.decode=function(e,t){return N.binary.baseN.decode(e,D,t)},N.text={utf8:{},utf16:{}},N.text.utf8.encode=function(e,t,a){e=N.encodeUtf8(e);var r=t;r||(r=new Uint8Array(e.length));for(var i=a=a||0,n=0;n<e.length;++n)r[i++]=e.charCodeAt(n);return t?i-a:r},N.text.utf8.decode=function(e){return N.decodeUtf8(String.fromCharCode.apply(null,e))},N.text.utf16.encode=function(e,t,a){var r=t;r||(r=new Uint8Array(2*e.length));for(var i=new Uint16Array(r.buffer),n=a=a||0,o=a,s=0;s<e.length;++s)i[o++]=e.charCodeAt(s),n+=2;return t?n-a:r},N.text.utf16.decode=function(e){return String.fromCharCode.apply(null,new Uint16Array(e.buffer))},N.deflate=function(e,t,a){if(t=N.decode64(e.deflate(N.encode64(t)).rval),a){var r=2;32&t.charCodeAt(1)&&(r=6),t=t.substring(r,t.length-4)}return t},N.inflate=function(e,t,a){var r=e.inflate(N.encode64(t)).rval;return null===r?null:N.decode64(r)};var U=function(e,t,a){if(!e)throw new Error("WebStorage not available.");var r;if(null===a?r=e.removeItem(t):(a=N.encode64(JSON.stringify(a)),r=e.setItem(t,a)),void 0!==r&&!0!==r.rval){var i=new Error(r.error.message);throw i.id=r.error.id,i.name=r.error.name,i}},O=function(e,t){if(!e)throw new Error("WebStorage not available.");var a=e.getItem(t);if(e.init)if(null===a.rval){if(a.error){var r=new Error(a.error.message);throw r.id=a.error.id,r.name=a.error.name,r}a=null}else a=a.rval;return null!==a&&(a=JSON.parse(N.decode64(a))),a},P=function(e,t,a,r){var i=O(e,t);null===i&&(i={}),i[a]=r,U(e,t,i)},V=function(e,t,a){var r=O(e,t);return null!==r&&(r=a in r?r[a]:null),r},M=function(e,t,a){var r=O(e,t);if(null!==r&&a in r){delete r[a];var i=!0;for(var n in r){i=!1;break}i&&(r=null),U(e,t,r)}},K=function(e,t){U(e,t,null)},F=function(e,t,a){var r,i=null;void 0===a&&(a=["web","flash"]);var n=!1,o=null;for(var s in a){r=a[s];try{if("flash"===r||"both"===r){if(null===t[0])throw new Error("Flash local storage not available.");i=e.apply(this,t),n="flash"===r}"web"!==r&&"both"!==r||(t[0]=localStorage,i=e.apply(this,t),n=!0)}catch(e){o=e}if(n)break}if(!n)throw o;return i};N.setItem=function(e,t,a,r,i){F(P,arguments,i)},N.getItem=function(e,t,a,r){return F(V,arguments,r)},N.removeItem=function(e,t,a,r){F(M,arguments,r)},N.clearItems=function(e,t,a){F(K,arguments,a)},N.parseUrl=function(e){var t=/^(https?):\/\/([^:&^\/]*):?(\d*)(.*)$/g;t.lastIndex=0;var a=t.exec(e),r=null===a?null:{full:e,scheme:a[1],host:a[2],port:a[3],path:a[4]};return r&&(r.fullHost=r.host,r.port?(80!==r.port&&"http"===r.scheme||443!==r.port&&"https"===r.scheme)&&(r.fullHost+=":"+r.port):"http"===r.scheme?r.port=80:"https"===r.scheme&&(r.port=443),r.full=r.scheme+"://"+r.fullHost),r};var q=null;N.getQueryVariables=function(e){var t,a=function(e){for(var t={},a=e.split("&"),r=0;r<a.length;r++){var i,n,o=a[r].indexOf("=");o>0?(i=a[r].substring(0,o),n=a[r].substring(o+1)):(i=a[r],n=null),i in t||(t[i]=[]),i in Object.prototype||null===n||t[i].push(unescape(n))}return t};return void 0===e?(null===q&&(q="undefined"!=typeof window&&window.location&&window.location.search?a(window.location.search.substring(1)):{}),t=q):t=a(e),t},N.parseFragment=function(e){var t=e,a="",r=e.indexOf("?");r>0&&(t=e.substring(0,r),a=e.substring(r+1));var i=t.split("/");return i.length>0&&""===i[0]&&i.shift(),{pathString:t,queryString:a,path:i,query:""===a?{}:N.getQueryVariables(a)}},N.makeRequest=function(e){var t=N.parseFragment(e),a={path:t.pathString,query:t.queryString,getPath:function(e){return void 0===e?t.path:t.path[e]},getQuery:function(e,a){var r;return void 0===e?r=t.query:(r=t.query[e])&&void 0!==a&&(r=r[a]),r},getQueryLast:function(e,t){var r=a.getQuery(e);return r?r[r.length-1]:t}};return a},N.makeLink=function(e,t,a){e=jQuery.isArray(e)?e.join("/"):e;var r=jQuery.param(t||{});return a=a||"",e+(r.length>0?"?"+r:"")+(a.length>0?"#"+a:"")},N.isEmpty=function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0},N.format=function(e){for(var t,a,r=/%./g,i=0,n=[],o=0;t=r.exec(e);){(a=e.substring(o,r.lastIndex-2)).length>0&&n.push(a),o=r.lastIndex;var s=t[0][1];switch(s){case"s":case"o":i<arguments.length?n.push(arguments[1+i++]):n.push("<?>");break;case"%":n.push("%");break;default:n.push("<%"+s+"?>")}}return n.push(e.substring(o)),n.join("")},N.formatNumber=function(e,t,a,r){var i=e,n=isNaN(t=Math.abs(t))?2:t,o=void 0===a?",":a,s=void 0===r?".":r,u=i<0?"-":"",c=parseInt(i=Math.abs(+i||0).toFixed(n),10)+"",l=c.length>3?c.length%3:0;return u+(l?c.substr(0,l)+s:"")+c.substr(l).replace(/(\d{3})(?=\d)/g,"$1"+s)+(n?o+Math.abs(i-c).toFixed(n).slice(2):"")},N.formatSize=function(e){return e=e>=1073741824?N.formatNumber(e/1073741824,2,".","")+" GiB":e>=1048576?N.formatNumber(e/1048576,2,".","")+" MiB":e>=1024?N.formatNumber(e/1024,0)+" KiB":N.formatNumber(e,0)+" bytes"},N.bytesFromIP=function(e){return-1!==e.indexOf(".")?N.bytesFromIPv4(e):-1!==e.indexOf(":")?N.bytesFromIPv6(e):null},N.bytesFromIPv4=function(e){if(4!==(e=e.split(".")).length)return null;for(var t=N.createBuffer(),a=0;a<e.length;++a){var r=parseInt(e[a],10);if(isNaN(r))return null;t.putByte(r)}return t.getBytes()},N.bytesFromIPv6=function(e){for(var t=0,a=2*(8-(e=e.split(":").filter((function(e){return 0===e.length&&++t,!0}))).length+t),r=N.createBuffer(),i=0;i<8;++i)if(e[i]&&0!==e[i].length){var n=N.hexToBytes(e[i]);n.length<2&&r.putByte(0),r.putBytes(n)}else r.fillWithByte(0,a),a=0;return r.getBytes()},N.bytesToIP=function(e){return 4===e.length?N.bytesToIPv4(e):16===e.length?N.bytesToIPv6(e):null},N.bytesToIPv4=function(e){if(4!==e.length)return null;for(var t=[],a=0;a<e.length;++a)t.push(e.charCodeAt(a));return t.join(".")},N.bytesToIPv6=function(e){if(16!==e.length)return null;for(var t=[],a=[],r=0,i=0;i<e.length;i+=2){for(var n=N.bytesToHex(e[i]+e[i+1]);"0"===n[0]&&"0"!==n;)n=n.substr(1);if("0"===n){var o=a[a.length-1],s=t.length;o&&s===o.end+1?(o.end=s,o.end-o.start>a[r].end-a[r].start&&(r=a.length-1)):a.push({start:s,end:s})}t.push(n)}if(a.length>0){var u=a[r];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(":")},N.estimateCores=function(e,t){if("function"==typeof e&&(t=e,e={}),e=e||{},"cores"in N&&!e.update)return t(null,N.cores);if("undefined"!=typeof navigator&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return N.cores=navigator.hardwareConcurrency,t(null,N.cores);if("undefined"==typeof Worker)return N.cores=1,t(null,N.cores);if("undefined"==typeof Blob)return N.cores=2,t(null,N.cores);var a=URL.createObjectURL(new Blob(["(",function(){self.addEventListener("message",(function(e){var t=Date.now(),a=t+4;self.postMessage({st:t,et:a})}))}.toString(),")()"],{type:"application/javascript"}));!function e(r,i,n){if(0===i){var o=Math.floor(r.reduce((function(e,t){return e+t}),0)/r.length);return N.cores=Math.max(1,o),URL.revokeObjectURL(a),t(null,N.cores)}!function(e,t){for(var r=[],i=[],n=0;n<e;++n){var o=new Worker(a);o.addEventListener("message",(function(a){if(i.push(a.data),i.length===e){for(var n=0;n<e;++n)r[n].terminate();t(null,i)}})),r.push(o)}for(n=0;n<e;++n)r[n].postMessage(n)}(n,(function(t,a){r.push(function(e,t){for(var a=[],r=0;r<e;++r)for(var i=t[r],n=a[r]=[],o=0;o<e;++o)if(r!==o){var s=t[o];(i.st>s.st&&i.st<s.et||s.st>i.st&&s.st<i.et)&&n.push(o)}return a.reduce((function(e,t){return Math.max(e,t.length)}),0)}(n,a)),e(r,i-1,n)}))}([],5,16)};var H=S;H.cipher=H.cipher||{},H.cipher.algorithms=H.cipher.algorithms||{},H.cipher.createCipher=function(e,t){var a=e;if("string"==typeof a&&(a=H.cipher.getAlgorithm(a))&&(a=a()),!a)throw new Error("Unsupported algorithm: "+e);return new H.cipher.BlockCipher({algorithm:a,key:t,decrypt:!1})},H.cipher.createDecipher=function(e,t){var a=e;if("string"==typeof a&&(a=H.cipher.getAlgorithm(a))&&(a=a()),!a)throw new Error("Unsupported algorithm: "+e);return new H.cipher.BlockCipher({algorithm:a,key:t,decrypt:!0})},H.cipher.registerAlgorithm=function(e,t){e=e.toUpperCase(),H.cipher.algorithms[e]=t},H.cipher.getAlgorithm=function(e){return(e=e.toUpperCase())in H.cipher.algorithms?H.cipher.algorithms[e]:null};var G=H.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)};G.prototype.start=function(e){e=e||{};var t={};for(var a in e)t[a]=e[a];t.decrypt=this._decrypt,this._finish=!1,this._input=H.util.createBuffer(),this.output=e.output||H.util.createBuffer(),this.mode.start(t)},G.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()},G.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)))};var W=S;W.cipher=W.cipher||{};var Q=W.cipher.modes=W.cipher.modes||{};function Y(e,t){if("string"==typeof e&&(e=W.util.createBuffer(e)),W.util.isArray(e)&&e.length>4){var a=e;e=W.util.createBuffer();for(var r=0;r<a.length;++r)e.putByte(a[r])}if(e.length()<t)throw new Error("Invalid IV length; got "+e.length()+" bytes and expected "+t+" bytes.");if(!W.util.isArray(e)){var i=[],n=t/4;for(r=0;r<n;++r)i.push(e.getInt32());e=i}return e}function Z(e){e[e.length-1]=e[e.length-1]+1&4294967295}function X(e){return[e/4294967296|0,4294967295&e]}Q.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)},Q.ecb.prototype.start=function(e){},Q.ecb.prototype.encrypt=function(e,t,a){if(e.length()<this.blockSize&&!(a&&e.length()>0))return!0;for(var r=0;r<this._ints;++r)this._inBlock[r]=e.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(r=0;r<this._ints;++r)t.putInt32(this._outBlock[r])},Q.ecb.prototype.decrypt=function(e,t,a){if(e.length()<this.blockSize&&!(a&&e.length()>0))return!0;for(var r=0;r<this._ints;++r)this._inBlock[r]=e.getInt32();this.cipher.decrypt(this._inBlock,this._outBlock);for(r=0;r<this._ints;++r)t.putInt32(this._outBlock[r])},Q.ecb.prototype.pad=function(e,t){var a=e.length()===this.blockSize?this.blockSize:this.blockSize-e.length();return e.fillWithByte(a,a),!0},Q.ecb.prototype.unpad=function(e,t){if(t.overflow>0)return!1;var a=e.length(),r=e.at(a-1);return!(r>this.blockSize<<2)&&(e.truncate(r),!0)},Q.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)},Q.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=Y(e.iv,this.blockSize),this._prev=this._iv.slice(0)}},Q.cbc.prototype.encrypt=function(e,t,a){if(e.length()<this.blockSize&&!(a&&e.length()>0))return!0;for(var r=0;r<this._ints;++r)this._inBlock[r]=this._prev[r]^e.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(r=0;r<this._ints;++r)t.putInt32(this._outBlock[r]);this._prev=this._outBlock},Q.cbc.prototype.decrypt=function(e,t,a){if(e.length()<this.blockSize&&!(a&&e.length()>0))return!0;for(var r=0;r<this._ints;++r)this._inBlock[r]=e.getInt32();this.cipher.decrypt(this._inBlock,this._outBlock);for(r=0;r<this._ints;++r)t.putInt32(this._prev[r]^this._outBlock[r]);this._prev=this._inBlock.slice(0)},Q.cbc.prototype.pad=function(e,t){var a=e.length()===this.blockSize?this.blockSize:this.blockSize-e.length();return e.fillWithByte(a,a),!0},Q.cbc.prototype.unpad=function(e,t){if(t.overflow>0)return!1;var a=e.length(),r=e.at(a-1);return!(r>this.blockSize<<2)&&(e.truncate(r),!0)},Q.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=W.util.createBuffer(),this._partialBytes=0},Q.cfb.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=Y(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},Q.cfb.prototype.encrypt=function(e,t,a){var r=e.length();if(0===r)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&r>=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 n=(this.blockSize-r)%this.blockSize;n>0&&(n=this.blockSize-n),this._partialOutput.clear();for(i=0;i<this._ints;++i)this._partialBlock[i]=e.getInt32()^this._outBlock[i],this._partialOutput.putInt32(this._partialBlock[i]);if(n>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),n>0&&!a)return t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=n,!0;t.putBytes(this._partialOutput.getBytes(r-this._partialBytes)),this._partialBytes=0}},Q.cfb.prototype.decrypt=function(e,t,a){var r=e.length();if(0===r)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&r>=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 n=(this.blockSize-r)%this.blockSize;n>0&&(n=this.blockSize-n),this._partialOutput.clear();for(i=0;i<this._ints;++i)this._partialBlock[i]=e.getInt32(),this._partialOutput.putInt32(this._partialBlock[i]^this._outBlock[i]);if(n>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),n>0&&!a)return t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=n,!0;t.putBytes(this._partialOutput.getBytes(r-this._partialBytes)),this._partialBytes=0}},Q.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=W.util.createBuffer(),this._partialBytes=0},Q.ofb.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=Y(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},Q.ofb.prototype.encrypt=function(e,t,a){var r=e.length();if(0===e.length())return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&r>=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 n=(this.blockSize-r)%this.blockSize;n>0&&(n=this.blockSize-n),this._partialOutput.clear();for(i=0;i<this._ints;++i)this._partialOutput.putInt32(e.getInt32()^this._outBlock[i]);if(n>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),n>0&&!a)return t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=n,!0;t.putBytes(this._partialOutput.getBytes(r-this._partialBytes)),this._partialBytes=0}},Q.ofb.prototype.decrypt=Q.ofb.prototype.encrypt,Q.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=W.util.createBuffer(),this._partialBytes=0},Q.ctr.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=Y(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},Q.ctr.prototype.encrypt=function(e,t,a){var r=e.length();if(0===r)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&r>=this.blockSize)for(var i=0;i<this._ints;++i)t.putInt32(e.getInt32()^this._outBlock[i]);else{var n=(this.blockSize-r)%this.blockSize;n>0&&(n=this.blockSize-n),this._partialOutput.clear();for(i=0;i<this._ints;++i)this._partialOutput.putInt32(e.getInt32()^this._outBlock[i]);if(n>0&&(e.read-=this.blockSize),this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),n>0&&!a)return t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=n,!0;t.putBytes(this._partialOutput.getBytes(r-this._partialBytes)),this._partialBytes=0}Z(this._inBlock)},Q.ctr.prototype.decrypt=Q.ctr.prototype.encrypt,Q.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=W.util.createBuffer(),this._partialBytes=0,this._R=3774873600},Q.gcm.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");var t,a=W.util.createBuffer(e.iv);if(this._cipherLength=0,t="additionalData"in e?W.util.createBuffer(e.additionalData):W.util.createBuffer(),this._tagLength="tagLength"in e?e.tagLength:128,this._tag=null,e.decrypt&&(this._tag=W.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 r=a.length();if(12===r)this._j0=[a.getInt32(),a.getInt32(),a.getInt32(),1];else{for(this._j0=[0,0,0,0];a.length()>0;)this._j0=this.ghash(this._hashSubkey,this._j0,[a.getInt32(),a.getInt32(),a.getInt32(),a.getInt32()]);this._j0=this.ghash(this._hashSubkey,this._j0,[0,0].concat(X(8*r)))}this._inBlock=this._j0.slice(0),Z(this._inBlock),this._partialBytes=0,t=W.util.createBuffer(t),this._aDataLength=X(8*t.length());var i=t.length()%this.blockSize;for(i&&t.fillWithByte(0,this.blockSize-i),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()])},Q.gcm.prototype.encrypt=function(e,t,a){var r=e.length();if(0===r)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&r>=this.blockSize){for(var i=0;i<this._ints;++i)t.putInt32(this._outBlock[i]^=e.getInt32());this._cipherLength+=this.blockSize}else{var n=(this.blockSize-r)%this.blockSize;n>0&&(n=this.blockSize-n),this._partialOutput.clear();for(i=0;i<this._ints;++i)this._partialOutput.putInt32(e.getInt32()^this._outBlock[i]);if(n<=0||a){if(a){var o=r%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),n>0&&!a)return e.read-=this.blockSize,t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=n,!0;t.putBytes(this._partialOutput.getBytes(r-this._partialBytes)),this._partialBytes=0}this._s=this.ghash(this._hashSubkey,this._s,this._outBlock),Z(this._inBlock)},Q.gcm.prototype.decrypt=function(e,t,a){var r=e.length();if(r<this.blockSize&&!(a&&r>0))return!0;this.cipher.encrypt(this._inBlock,this._outBlock),Z(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]);r<this.blockSize?this._cipherLength+=r%this.blockSize:this._cipherLength+=this.blockSize},Q.gcm.prototype.afterFinish=function(e,t){var a=!0;t.decrypt&&t.overflow&&e.truncate(this.blockSize-t.overflow),this.tag=W.util.createBuffer();var r=this._aDataLength.concat(X(8*this._cipherLength));this._s=this.ghash(this._hashSubkey,this._s,r);var i=[];this.cipher.encrypt(this._j0,i);for(var n=0;n<this._ints;++n)this.tag.putInt32(this._s[n]^i[n]);return this.tag.truncate(this.tag.length()%(this._tagLength/8)),t.decrypt&&this.tag.bytes()!==this._tag&&(a=!1),a},Q.gcm.prototype.multiply=function(e,t){for(var a=[0,0,0,0],r=t.slice(0),i=0;i<128;++i){e[i/32|0]&1<<31-i%32&&(a[0]^=r[0],a[1]^=r[1],a[2]^=r[2],a[3]^=r[3]),this.pow(r,r)}return a},Q.gcm.prototype.pow=function(e,t){for(var a=1&e[3],r=3;r>0;--r)t[r]=e[r]>>>1|(1&e[r-1])<<31;t[0]=e[0]>>>1,a&&(t[0]^=this._R)},Q.gcm.prototype.tableMultiply=function(e){for(var t=[0,0,0,0],a=0;a<32;++a){var r=e[a/8|0]>>>4*(7-a%8)&15,i=this._m[a][r];t[0]^=i[0],t[1]^=i[1],t[2]^=i[2],t[3]^=i[3]}return t},Q.gcm.prototype.ghash=function(e,t,a){return t[0]^=a[0],t[1]^=a[1],t[2]^=a[2],t[3]^=a[3],this.tableMultiply(t)},Q.gcm.prototype.generateHashTable=function(e,t){for(var a=8/t,r=4*a,i=16*a,n=new Array(i),o=0;o<i;++o){var s=[0,0,0,0],u=(r-1-o%r)*t;s[o/r|0]=1<<t-1<<u,n[o]=this.generateSubHashTable(this.multiply(s,e),t)}return n},Q.gcm.prototype.generateSubHashTable=function(e,t){var a=1<<t,r=a>>>1,i=new Array(a);i[r]=e.slice(0);for(var n=r>>>1;n>0;)this.pow(i[2*n],i[n]=[]),n>>=1;for(n=2;n<r;){for(var o=1;o<n;++o){var s=i[n],u=i[o];i[n+o]=[s[0]^u[0],s[1]^u[1],s[2]^u[2],s[3]^u[3]]}n*=2}for(i[0]=[0,0,0,0],n=r+1;n<a;++n){var c=i[n^r];i[n]=[e[0]^c[0],e[1]^c[1],e[2]^c[2],e[3]^c[3]]}return i};var $=S;function J(e,t){$.cipher.registerAlgorithm(e,(function(){return new $.aes.Algorithm(e,t)}))}$.aes=$.aes||{},$.aes.startEncrypting=function(e,t,a,r){var i=le({key:e,output:a,decrypt:!1,mode:r});return i.start(t),i},$.aes.createEncryptionCipher=function(e,t){return le({key:e,output:null,decrypt:!1,mode:t})},$.aes.startDecrypting=function(e,t,a,r){var i=le({key:e,output:a,decrypt:!0,mode:r});return i.start(t),i},$.aes.createDecryptionCipher=function(e,t){return le({key:e,output:null,decrypt:!0,mode:t})},$.aes.Algorithm=function(e,t){ne||se();var a=this;a.name=e,a.mode=new t({blockSize:16,cipher:{encrypt:function(e,t){return ce(a._w,e,t,!1)},decrypt:function(e,t){return ce(a._w,e,t,!0)}}}),a._init=!1},$.aes.Algorithm.prototype.initialize=function(e){if(!this._init){var t,a=e.key;if("string"!=typeof a||16!==a.length&&24!==a.length&&32!==a.length){if($.util.isArray(a)&&(16===a.length||24===a.length||32===a.length)){t=a,a=$.util.createBuffer();for(var r=0;r<t.length;++r)a.putByte(t[r])}}else a=$.util.createBuffer(a);if(!$.util.isArray(a)){t=a,a=[];var i=t.length();if(16===i||24===i||32===i){i>>>=2;for(r=0;r<i;++r)a.push(t.getInt32())}}if(!$.util.isArray(a)||4!==a.length&&6!==a.length&&8!==a.length)throw new Error("Invalid key parameter.");var n=this.mode.name,o=-1!==["CFB","OFB","CTR","GCM"].indexOf(n);this._w=ue(a,e.decrypt&&!o),this._init=!0}},$.aes._expandKey=function(e,t){return ne||se(),ue(e,t)},$.aes._updateBlock=ce,J("AES-ECB",$.cipher.modes.ecb),J("AES-CBC",$.cipher.modes.cbc),J("AES-CFB",$.cipher.modes.cfb),J("AES-OFB",$.cipher.modes.ofb),J("AES-CTR",$.cipher.modes.ctr),J("AES-GCM",$.cipher.modes.gcm);var ee,te,ae,re,ie,ne=!1,oe=4;function se(){ne=!0,ae=[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;ee=new Array(256),te=new Array(256),re=new Array(4),ie=new Array(4);for(t=0;t<4;++t)re[t]=new Array(256),ie[t]=new Array(256);var a,r,i,n,o,s,u,c=0,l=0;for(t=0;t<256;++t){n=(n=l^l<<1^l<<2^l<<3^l<<4)>>8^255&n^99,ee[c]=n,te[n]=c,s=(o=e[n])<<24^n<<16^n<<8^n^o,u=((a=e[c])^(r=e[a])^(i=e[r]))<<24^(c^i)<<16^(c^r^i)<<8^c^a^i;for(var p=0;p<4;++p)re[p][c]=s,ie[p][n]=u,s=s<<24|s>>>8,u=u<<24|u>>>8;0===c?c=l=1:(c=a^e[e[e[a^i]]],l^=e[e[l]])}}function ue(e,t){for(var a,r=e.slice(0),i=1,n=r.length,o=oe*(n+6+1),s=n;s<o;++s)a=r[s-1],s%n==0?(a=ee[a>>>16&255]<<24^ee[a>>>8&255]<<16^ee[255&a]<<8^ee[a>>>24]^ae[i]<<24,i++):n>6&&s%n==4&&(a=ee[a>>>24]<<24^ee[a>>>16&255]<<16^ee[a>>>8&255]<<8^ee[255&a]),r[s]=r[s-n]^a;if(t){for(var u,c=ie[0],l=ie[1],p=ie[2],h=ie[3],d=r.slice(0),m=(s=0,(o=r.length)-oe);s<o;s+=oe,m-=oe)if(0===s||s===o-oe)d[s]=r[m],d[s+1]=r[m+3],d[s+2]=r[m+2],d[s+3]=r[m+1];else for(var f=0;f<oe;++f)u=r[m+f],d[s+(3&-f)]=c[ee[u>>>24]]^l[ee[u>>>16&255]]^p[ee[u>>>8&255]]^h[ee[255&u]];r=d}return r}function ce(e,t,a,r){var i,n,o,s,u,c,l,p,h,d,m,f,g=e.length/4-1;r?(i=ie[0],n=ie[1],o=ie[2],s=ie[3],u=te):(i=re[0],n=re[1],o=re[2],s=re[3],u=ee),c=t[0]^e[0],l=t[r?3:1]^e[1],p=t[2]^e[2],h=t[r?1:3]^e[3];for(var y=3,k=1;k<g;++k)d=i[c>>>24]^n[l>>>16&255]^o[p>>>8&255]^s[255&h]^e[++y],m=i[l>>>24]^n[p>>>16&255]^o[h>>>8&255]^s[255&c]^e[++y],f=i[p>>>24]^n[h>>>16&255]^o[c>>>8&255]^s[255&l]^e[++y],h=i[h>>>24]^n[c>>>16&255]^o[l>>>8&255]^s[255&p]^e[++y],c=d,l=m,p=f;a[0]=u[c>>>24]<<24^u[l>>>16&255]<<16^u[p>>>8&255]<<8^u[255&h]^e[++y],a[r?3:1]=u[l>>>24]<<24^u[p>>>16&255]<<16^u[h>>>8&255]<<8^u[255&c]^e[++y],a[2]=u[p>>>24]<<24^u[h>>>16&255]<<16^u[c>>>8&255]<<8^u[255&l]^e[++y],a[r?1:3]=u[h>>>24]<<24^u[c>>>16&255]<<16^u[l>>>8&255]<<8^u[255&p]^e[++y]}function le(e){var t,a="AES-"+((e=e||{}).mode||"CBC").toUpperCase(),r=(t=e.decrypt?$.cipher.createDecipher(a,e.key):$.cipher.createCipher(a,e.key)).start;return t.start=function(e,a){var i=null;a instanceof $.util.ByteBuffer&&(i=a,a={}),(a=a||{}).output=i,a.iv=e,r.call(t,a)},t}var pe=S;pe.pki=pe.pki||{};var he=pe.pki.oids=pe.oids=pe.oids||{};function de(e,t){he[e]=t,he[t]=e}function me(e,t){he[e]=t}de("1.2.840.113549.1.1.1","rsaEncryption"),de("1.2.840.113549.1.1.4","md5WithRSAEncryption"),de("1.2.840.113549.1.1.5","sha1WithRSAEncryption"),de("1.2.840.113549.1.1.7","RSAES-OAEP"),de("1.2.840.113549.1.1.8","mgf1"),de("1.2.840.113549.1.1.9","pSpecified"),de("1.2.840.113549.1.1.10","RSASSA-PSS"),de("1.2.840.113549.1.1.11","sha256WithRSAEncryption"),de("1.2.840.113549.1.1.12","sha384WithRSAEncryption"),de("1.2.840.113549.1.1.13","sha512WithRSAEncryption"),de("1.3.101.112","EdDSA25519"),de("1.2.840.10040.4.3","dsa-with-sha1"),de("1.3.14.3.2.7","desCBC"),de("1.3.14.3.2.26","sha1"),de("2.16.840.1.101.3.4.2.1","sha256"),de("2.16.840.1.101.3.4.2.2","sha384"),de("2.16.840.1.101.3.4.2.3","sha512"),de("1.2.840.113549.2.5","md5"),de("1.2.840.113549.1.7.1","data"),de("1.2.840.113549.1.7.2","signedData"),de("1.2.840.113549.1.7.3","envelopedData"),de("1.2.840.113549.1.7.4","signedAndEnvelopedData"),de("1.2.840.113549.1.7.5","digestedData"),de("1.2.840.113549.1.7.6","encryptedData"),de("1.2.840.113549.1.9.1","emailAddress"),de("1.2.840.113549.1.9.2","unstructuredName"),de("1.2.840.113549.1.9.3","contentType"),de("1.2.840.113549.1.9.4","messageDigest"),de("1.2.840.113549.1.9.5","signingTime"),de("1.2.840.113549.1.9.6","counterSignature"),de("1.2.840.113549.1.9.7","challengePassword"),de("1.2.840.113549.1.9.8","unstructuredAddress"),de("1.2.840.113549.1.9.14","extensionRequest"),de("1.2.840.113549.1.9.20","friendlyName"),de("1.2.840.113549.1.9.21","localKeyId"),de("1.2.840.113549.1.9.22.1","x509Certificate"),de("1.2.840.113549.1.12.10.1.1","keyBag"),de("1.2.840.113549.1.12.10.1.2","pkcs8ShroudedKeyBag"),de("1.2.840.113549.1.12.10.1.3","certBag"),de("1.2.840.113549.1.12.10.1.4","crlBag"),de("1.2.840.113549.1.12.10.1.5","secretBag"),de("1.2.840.113549.1.12.10.1.6","safeContentsBag"),de("1.2.840.113549.1.5.13","pkcs5PBES2"),de("1.2.840.113549.1.5.12","pkcs5PBKDF2"),de("1.2.840.113549.1.12.1.1","pbeWithSHAAnd128BitRC4"),de("1.2.840.113549.1.12.1.2","pbeWithSHAAnd40BitRC4"),de("1.2.840.113549.1.12.1.3","pbeWithSHAAnd3-KeyTripleDES-CBC"),de("1.2.840.113549.1.12.1.4","pbeWithSHAAnd2-KeyTripleDES-CBC"),de("1.2.840.113549.1.12.1.5","pbeWithSHAAnd128BitRC2-CBC"),de("1.2.840.113549.1.12.1.6","pbewithSHAAnd40BitRC2-CBC"),de("1.2.840.113549.2.7","hmacWithSHA1"),de("1.2.840.113549.2.8","hmacWithSHA224"),de("1.2.840.113549.2.9","hmacWithSHA256"),de("1.2.840.113549.2.10","hmacWithSHA384"),de("1.2.840.113549.2.11","hmacWithSHA512"),de("1.2.840.113549.3.7","des-EDE3-CBC"),de("2.16.840.1.101.3.4.1.2","aes128-CBC"),de("2.16.840.1.101.3.4.1.22","aes192-CBC"),de("2.16.840.1.101.3.4.1.42","aes256-CBC"),de("2.5.4.3","commonName"),de("2.5.4.5","serialName"),de("2.5.4.6","countryName"),de("2.5.4.7","localityName"),de("2.5.4.8","stateOrProvinceName"),de("2.5.4.9","streetAddress"),de("2.5.4.10","organizationName"),de("2.5.4.11","organizationalUnitName"),de("2.5.4.13","description"),de("2.5.4.15","businessCategory"),de("2.5.4.17","postalCode"),de("1.3.6.1.4.1.311.60.2.1.2","jurisdictionOfIncorporationStateOrProvinceName"),de("1.3.6.1.4.1.311.60.2.1.3","jurisdictionOfIncorporationCountryName"),de("2.16.840.1.113730.1.1","nsCertType"),de("2.16.840.1.113730.1.13","nsComment"),me("2.5.29.1","authorityKeyIdentifier"),me("2.5.29.2","keyAttributes"),me("2.5.29.3","certificatePolicies"),me("2.5.29.4","keyUsageRestriction"),me("2.5.29.5","policyMapping"),me("2.5.29.6","subtreesConstraint"),me("2.5.29.7","subjectAltName"),me("2.5.29.8","issuerAltName"),me("2.5.29.9","subjectDirectoryAttributes"),me("2.5.29.10","basicConstraints"),me("2.5.29.11","nameConstraints"),me("2.5.29.12","policyConstraints"),me("2.5.29.13","basicConstraints"),de("2.5.29.14","subjectKeyIdentifier"),de("2.5.29.15","keyUsage"),me("2.5.29.16","privateKeyUsagePeriod"),de("2.5.29.17","subjectAltName"),de("2.5.29.18","issuerAltName"),de("2.5.29.19","basicConstraints"),me("2.5.29.20","cRLNumber"),me("2.5.29.21","cRLReason"),me("2.5.29.22","expirationDate"),me("2.5.29.23","instructionCode"),me("2.5.29.24","invalidityDate"),me("2.5.29.25","cRLDistributionPoints"),me("2.5.29.26","issuingDistributionPoint"),me("2.5.29.27","deltaCRLIndicator"),me("2.5.29.28","issuingDistributionPoint"),me("2.5.29.29","certificateIssuer"),me("2.5.29.30","nameConstraints"),de("2.5.29.31","cRLDistributionPoints"),de("2.5.29.32","certificatePolicies"),me("2.5.29.33","policyMappings"),me("2.5.29.34","policyConstraints"),de("2.5.29.35","authorityKeyIdentifier"),me("2.5.29.36","policyConstraints"),de("2.5.29.37","extKeyUsage"),me("2.5.29.46","freshestCRL"),me("2.5.29.54","inhibitAnyPolicy"),de("1.3.6.1.4.1.11129.2.4.2","timestampList"),de("1.3.6.1.5.5.7.1.1","authorityInfoAccess"),de("1.3.6.1.5.5.7.3.1","serverAuth"),de("1.3.6.1.5.5.7.3.2","clientAuth"),de("1.3.6.1.5.5.7.3.3","codeSigning"),de("1.3.6.1.5.5.7.3.4","emailProtection"),de("1.3.6.1.5.5.7.3.8","timeStamping");var fe=S,ge=fe.asn1=fe.asn1||{};function ye(e,t,a){if(a>t){var r=new Error("Too few bytes to parse DER.");throw r.available=e.length(),r.remaining=t,r.requested=a,r}}ge.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192},ge.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},ge.create=function(e,t,a,r,i){if(fe.util.isArray(r)){for(var n=[],o=0;o<r.length;++o)void 0!==r[o]&&n.push(r[o]);r=n}var s={tagClass:e,type:t,constructed:a,composed:a||fe.util.isArray(r),value:r};return i&&"bitStringContents"in i&&(s.bitStringContents=i.bitStringContents,s.original=ge.copy(s)),s},ge.copy=function(e,t){var a;if(fe.util.isArray(e)){a=[];for(var r=0;r<e.length;++r)a.push(ge.copy(e[r],t));return a}return"string"==typeof e?e:(a={tagClass:e.tagClass,type:e.type,constructed:e.constructed,composed:e.composed,value:ge.copy(e.value,t)},t&&!t.excludeBitStringContents&&(a.bitStringContents=e.bitStringContents),a)},ge.equals=function(e,t,a){if(fe.util.isArray(e)){if(!fe.util.isArray(t))return!1;if(e.length!==t.length)return!1;for(var r=0;r<e.length;++r)if(!ge.equals(e[r],t[r]))return!1;return!0}if(typeof e!=typeof t)return!1;if("string"==typeof e)return e===t;var i=e.tagClass===t.tagClass&&e.type===t.type&&e.constructed===t.constructed&&e.composed===t.composed&&ge.equals(e.value,t.value);return a&&a.includeBitStringContents&&(i=i&&e.bitStringContents===t.bitStringContents),i},ge.getBerValueLength=function(e){var t=e.getByte();if(128!==t)return 128&t?e.getInt((127&t)<<3):t};function ke(e,t,a,r){var i;ye(e,t,2);var n=e.getByte();t--;var o=192&n,s=31&n;i=e.length();var u,c,l=function(e,t){var a=e.getByte();if(t--,128!==a){var r;if(128&a){var i=127&a;ye(e,t,i),r=e.getInt(i<<3)}else r=a;if(r<0)throw new Error("Negative length: "+r);return r}}(e,t);if(t-=i-e.length(),void 0!==l&&l>t){if(r.strict){var p=new Error("Too few bytes to read ASN.1 value.");throw p.available=e.length(),p.remaining=t,p.requested=l,p}l=t}var h=32==(32&n);if(h)if(u=[],void 0===l)for(;;){if(ye(e,t,2),e.bytes(2)===String.fromCharCode(0,0)){e.getBytes(2),t-=2;break}i=e.length(),u.push(ke(e,t,a+1,r)),t-=i-e.length()}else for(;l>0;)i=e.length(),u.push(ke(e,l,a+1,r)),t-=i-e.length(),l-=i-e.length();if(void 0===u&&o===ge.Class.UNIVERSAL&&s===ge.Type.BITSTRING&&(c=e.bytes(l)),void 0===u&&r.decodeBitStrings&&o===ge.Class.UNIVERSAL&&s===ge.Type.BITSTRING&&l>1){var d=e.read,m=t,f=0;if(s===ge.Type.BITSTRING&&(ye(e,t,1),f=e.getByte(),t--),0===f)try{i=e.length();var g=ke(e,t,a+1,{verbose:r.verbose,strict:!0,decodeBitStrings:!0}),y=i-e.length();t-=y,s==ge.Type.BITSTRING&&y++;var k=g.tagClass;y!==l||k!==ge.Class.UNIVERSAL&&k!==ge.Class.CONTEXT_SPECIFIC||(u=[g])}catch(e){}void 0===u&&(e.read=d,t=m)}if(void 0===u){if(void 0===l){if(r.strict)throw new Error("Non-constructed ASN.1 object of indefinite length.");l=t}if(s===ge.Type.BMPSTRING)for(u="";l>0;l-=2)ye(e,t,2),u+=String.fromCharCode(e.getInt16()),t-=2;else u=e.getBytes(l)}var v=void 0===c?null:{bitStringContents:c};return ge.create(o,s,h,u,v)}ge.fromDer=function(e,t){return void 0===t&&(t={strict:!0,decodeBitStrings:!0}),"boolean"==typeof t&&(t={strict:t,decodeBitStrings:!0}),"strict"in t||(t.strict=!0),"decodeBitStrings"in t||(t.decodeBitStrings=!0),"string"==typeof e&&(e=fe.util.createBuffer(e)),ke(e,e.length(),0,t)},ge.toDer=function(e){var t=fe.util.createBuffer(),a=e.tagClass|e.type,r=fe.util.createBuffer(),i=!1;if("bitStringContents"in e&&(i=!0,e.original&&(i=ge.equals(e,e.original))),i)r.putBytes(e.bitStringContents);else if(e.composed){e.constructed?a|=32:r.putByte(0);for(var n=0;n<e.value.length;++n)void 0!==e.value[n]&&r.putBuffer(ge.toDer(e.value[n]))}else if(e.type===ge.Type.BMPSTRING)for(n=0;n<e.value.length;++n)r.putInt16(e.value.charCodeAt(n));else e.type===ge.Type.INTEGER&&e.value.length>1&&(0===e.value.charCodeAt(0)&&0==(128&e.value.charCodeAt(1))||255===e.value.charCodeAt(0)&&128==(128&e.value.charCodeAt(1)))?r.putBytes(e.value.substr(1)):r.putBytes(e.value);if(t.putByte(a),r.length()<=127)t.putByte(127&r.length());else{var o=r.length(),s="";do{s+=String.fromCharCode(255&o),o>>>=8}while(o>0);t.putByte(128|s.length);for(n=s.length-1;n>=0;--n)t.putByte(s.charCodeAt(n))}return t.putBuffer(r),t},ge.oidToDer=function(e){var t,a,r,i,n=e.split("."),o=fe.util.createBuffer();o.putByte(40*parseInt(n[0],10)+parseInt(n[1],10));for(var s=2;s<n.length;++s){t=!0,a=[],r=parseInt(n[s],10);do{i=127&r,r>>>=7,t||(i|=128),a.push(i),t=!1}while(r>0);for(var u=a.length-1;u>=0;--u)o.putByte(a[u])}return o},ge.derToOid=function(e){var t;"string"==typeof e&&(e=fe.util.createBuffer(e));var a=e.getByte();t=Math.floor(a/40)+"."+a%40;for(var r=0;e.length()>0;)r<<=7,128&(a=e.getByte())?r+=127&a:(t+="."+(r+a),r=0);return t},ge.utcTimeToDate=function(e){var t=new Date,a=parseInt(e.substr(0,2),10);a=a>=50?1900+a:2e3+a;var r=parseInt(e.substr(2,2),10)-1,i=parseInt(e.substr(4,2),10),n=parseInt(e.substr(6,2),10),o=parseInt(e.substr(8,2),10),s=0;if(e.length>11){var u=e.charAt(10),c=10;"+"!==u&&"-"!==u&&(s=parseInt(e.substr(10,2),10),c+=2)}if(t.setUTCFullYear(a,r,i),t.setUTCHours(n,o,s,0),c&&("+"===(u=e.charAt(c))||"-"===u)){var l=60*parseInt(e.substr(c+1,2),10)+parseInt(e.substr(c+4,2),10);l*=6e4,"+"===u?t.setTime(+t-l):t.setTime(+t+l)}return t},ge.generalizedTimeToDate=function(e){var t=new Date,a=parseInt(e.substr(0,4),10),r=parseInt(e.substr(4,2),10)-1,i=parseInt(e.substr(6,2),10),n=parseInt(e.substr(8,2),10),o=parseInt(e.substr(10,2),10),s=parseInt(e.substr(12,2),10),u=0,c=0,l=!1;"Z"===e.charAt(e.length-1)&&(l=!0);var p=e.length-5,h=e.charAt(p);"+"!==h&&"-"!==h||(c=60*parseInt(e.substr(p+1,2),10)+parseInt(e.substr(p+4,2),10),c*=6e4,"+"===h&&(c*=-1),l=!0);return"."===e.charAt(14)&&(u=1e3*parseFloat(e.substr(14),10)),l?(t.setUTCFullYear(a,r,i),t.setUTCHours(n,o,s,u),t.setTime(+t+c)):(t.setFullYear(a,r,i),t.setHours(n,o,s,u)),t},ge.dateToUtcTime=function(e){if("string"==typeof e)return e;var t="",a=[];a.push((""+e.getUTCFullYear()).substr(2)),a.push(""+(e.getUTCMonth()+1)),a.push(""+e.getUTCDate()),a.push(""+e.getUTCHours()),a.push(""+e.getUTCMinutes()),a.push(""+e.getUTCSeconds());for(var r=0;r<a.length;++r)a[r].length<2&&(t+="0"),t+=a[r];return t+="Z"},ge.dateToGeneralizedTime=function(e){if("string"==typeof e)return e;var t="",a=[];a.push(""+e.getUTCFullYear()),a.push(""+(e.getUTCMonth()+1)),a.push(""+e.getUTCDate()),a.push(""+e.getUTCHours()),a.push(""+e.getUTCMinutes()),a.push(""+e.getUTCSeconds());for(var r=0;r<a.length;++r)a[r].length<2&&(t+="0"),t+=a[r];return t+="Z"},ge.integerToDer=function(e){var t=fe.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 a=new Error("Integer too large; max is 32-bits.");throw a.integer=e,a},ge.derToInteger=function(e){"string"==typeof e&&(e=fe.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)},ge.validate=function(e,t,a,r){var i=!1;if(e.tagClass!==t.tagClass&&void 0!==t.tagClass||e.type!==t.type&&void 0!==t.type)r&&(e.tagClass!==t.tagClass&&r.push("["+t.name+'] Expected tag class "'+t.tagClass+'", got "'+e.tagClass+'"'),e.type!==t.type&&r.push("["+t.name+'] Expected type "'+t.type+'", got "'+e.type+'"'));else if(e.constructed===t.constructed||void 0===t.constructed){if(i=!0,t.value&&fe.util.isArray(t.value))for(var n=0,o=0;i&&o<t.value.length;++o)i=t.value[o].optional||!1,e.value[n]&&((i=ge.validate(e.value[n],t.value[o],a,r))?++n:t.value[o].optional&&(i=!0)),!i&&r&&r.push("["+t.name+'] Tag class "'+t.tagClass+'", type "'+t.type+'" expected value length "'+t.value.length+'", got "'+e.value.length+'"');if(i&&a&&(t.capture&&(a[t.capture]=e.value),t.captureAsn1&&(a[t.captureAsn1]=e),t.captureBitStringContents&&"bitStringContents"in e&&(a[t.captureBitStringContents]=e.bitStringContents),t.captureBitStringValue&&"bitStringContents"in e))if(e.bitStringContents.length<2)a[t.captureBitStringValue]="";else{if(0!==e.bitStringContents.charCodeAt(0))throw new Error("captureBitStringValue only supported for zero unused bits");a[t.captureBitStringValue]=e.bitStringContents.slice(1)}}else r&&r.push("["+t.name+'] Expected constructed "'+t.constructed+'", got "'+e.constructed+'"');return i};var ve=/[^\\u0000-\\u00ff]/;ge.prettyPrint=function(e,t,a){var r="";a=a||2,(t=t||0)>0&&(r+="\n");for(var i="",n=0;n<t*a;++n)i+=" ";switch(r+=i+"Tag: ",e.tagClass){case ge.Class.UNIVERSAL:r+="Universal:";break;case ge.Class.APPLICATION:r+="Application:";break;case ge.Class.CONTEXT_SPECIFIC:r+="Context-Specific:";break;case ge.Class.PRIVATE:r+="Private:"}if(e.tagClass===ge.Class.UNIVERSAL)switch(r+=e.type,e.type){case ge.Type.NONE:r+=" (None)";break;case ge.Type.BOOLEAN:r+=" (Boolean)";break;case ge.Type.INTEGER:r+=" (Integer)";break;case ge.Type.BITSTRING:r+=" (Bit string)";break;case ge.Type.OCTETSTRING:r+=" (Octet string)";break;case ge.Type.NULL:r+=" (Null)";break;case ge.Type.OID:r+=" (Object Identifier)";break;case ge.Type.ODESC:r+=" (Object Descriptor)";break;case ge.Type.EXTERNAL:r+=" (External or Instance of)";break;case ge.Type.REAL:r+=" (Real)";break;case ge.Type.ENUMERATED:r+=" (Enumerated)";break;case ge.Type.EMBEDDED:r+=" (Embedded PDV)";break;case ge.Type.UTF8:r+=" (UTF8)";break;case ge.Type.ROID:r+=" (Relative Object Identifier)";break;case ge.Type.SEQUENCE:r+=" (Sequence)";break;case ge.Type.SET:r+=" (Set)";break;case ge.Type.PRINTABLESTRING:r+=" (Printable String)";break;case ge.Type.IA5String:r+=" (IA5String (ASCII))";break;case ge.Type.UTCTIME:r+=" (UTC time)";break;case ge.Type.GENERALIZEDTIME:r+=" (Generalized time)";break;case ge.Type.BMPSTRING:r+=" (BMP String)"}else r+=e.type;if(r+="\n",r+=i+"Constructed: "+e.constructed+"\n",e.composed){var o=0,s="";for(n=0;n<e.value.length;++n)void 0!==e.value[n]&&(o+=1,s+=ge.prettyPrint(e.value[n],t+1,a),n+1<e.value.length&&(s+=","));r+=i+"Sub values: "+o+s}else{if(r+=i+"Value: ",e.type===ge.Type.OID){var u=ge.derToOid(e.value);r+=u,fe.pki&&fe.pki.oids&&u in fe.pki.oids&&(r+=" ("+fe.pki.oids[u]+") ")}if(e.type===ge.Type.INTEGER)try{r+=ge.derToInteger(e.value)}catch(t){r+="0x"+fe.util.bytesToHex(e.value)}else if(e.type===ge.Type.BITSTRING){if(e.value.length>1?r+="0x"+fe.util.bytesToHex(e.value.slice(1)):r+="(none)",e.value.length>0){var c=e.value.charCodeAt(0);1==c?r+=" (1 unused bit shown)":c>1&&(r+=" ("+c+" unused bits shown)")}}else e.type===ge.Type.OCTETSTRING?(ve.test(e.value)||(r+="("+e.value+") "),r+="0x"+fe.util.bytesToHex(e.value)):e.type===ge.Type.UTF8?r+=fe.util.decodeUtf8(e.value):e.type===ge.Type.PRINTABLESTRING||e.type===ge.Type.IA5String?r+=e.value:ve.test(e.value)?r+="0x"+fe.util.bytesToHex(e.value):0===e.value.length?r+="[null]":r+=e.value}return r};var be=S,we=be.md=be.md||{};be.md.algorithms=be.md.algorithms||{};var je=S;(je.hmac=je.hmac||{}).create=function(){var e=null,t=null,a=null,r=null,i={start:function(i,n){if(null!==i)if("string"==typeof i){if(!((i=i.toLowerCase())in je.md.algorithms))throw new Error('Unknown hash algorithm "'+i+'"');t=je.md.algorithms[i].create()}else t=i;if(null===n)n=e;else{if("string"==typeof n)n=je.util.createBuffer(n);else if(je.util.isArray(n)){var o=n;n=je.util.createBuffer();for(var s=0;s<o.length;++s)n.putByte(o[s])}var u=n.length();u>t.blockLength&&(t.start(),t.update(n.bytes()),n=t.digest()),a=je.util.createBuffer(),r=je.util.createBuffer(),u=n.length();for(s=0;s<u;++s){o=n.at(s);a.putByte(54^o),r.putByte(92^o)}if(u<t.blockLength)for(o=t.blockLength-u,s=0;s<o;++s)a.putByte(54),r.putByte(92);e=n,a=a.bytes(),r=r.bytes()}t.start(),t.update(a)},update:function(e){t.update(e)},getMac:function(){var e=t.digest().bytes();return t.start(),t.update(r),t.update(e),t.digest()}};return i.digest=i.getMac,i};var Ce=S,Ee=Ce.md5=Ce.md5||{};Ce.md.md5=Ce.md.algorithms.md5=Ee,Ee.create=function(){Ae||function(){Se=String.fromCharCode(128),Se+=Ce.util.fillString(String.fromCharCode(0),64),Te=[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],_e=[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],Ie=new Array(64);for(var e=0;e<64;++e)Ie[e]=Math.floor(4294967296*Math.abs(Math.sin(e+1)));Ae=!0}();var e=null,t=Ce.util.createBuffer(),a=new Array(16),r={algorithm:"md5",blockLength:64,digestLength:16,messageLength:0,fullMessageLength:null,messageLengthSize:8,start:function(){r.messageLength=0,r.fullMessageLength=r.messageLength64=[];for(var a=r.messageLengthSize/4,i=0;i<a;++i)r.fullMessageLength.push(0);return t=Ce.util.createBuffer(),e={h0:1732584193,h1:4023233417,h2:2562383102,h3:271733878},r}};return r.start(),r.update=function(i,n){"utf8"===n&&(i=Ce.util.encodeUtf8(i));var o=i.length;r.messageLength+=o,o=[o/4294967296>>>0,o>>>0];for(var s=r.fullMessageLength.length-1;s>=0;--s)r.fullMessageLength[s]+=o[1],o[1]=o[0]+(r.fullMessageLength[s]/4294967296>>>0),r.fullMessageLength[s]=r.fullMessageLength[s]>>>0,o[0]=o[1]/4294967296>>>0;return t.putBytes(i),Be(e,a,t),(t.read>2048||0===t.length())&&t.compact(),r},r.digest=function(){var i=Ce.util.createBuffer();i.putBytes(t.bytes());var n=r.fullMessageLength[r.fullMessageLength.length-1]+r.messageLengthSize&r.blockLength-1;i.putBytes(Se.substr(0,r.blockLength-n));for(var o,s=0,u=r.fullMessageLength.length-1;u>=0;--u)s=(o=8*r.fullMessageLength[u]+s)/4294967296>>>0,i.putInt32Le(o>>>0);var c={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3};Be(c,a,i);var l=Ce.util.createBuffer();return l.putInt32Le(c.h0),l.putInt32Le(c.h1),l.putInt32Le(c.h2),l.putInt32Le(c.h3),l},r};var Se=null,Te=null,_e=null,Ie=null,Ae=!1;function Be(e,t,a){for(var r,i,n,o,s,u,c,l=a.length();l>=64;){for(i=e.h0,n=e.h1,o=e.h2,s=e.h3,c=0;c<16;++c)t[c]=a.getInt32Le(),r=i+(s^n&(o^s))+Ie[c]+t[c],i=s,s=o,o=n,n+=r<<(u=_e[c])|r>>>32-u;for(;c<32;++c)r=i+(o^s&(n^o))+Ie[c]+t[Te[c]],i=s,s=o,o=n,n+=r<<(u=_e[c])|r>>>32-u;for(;c<48;++c)r=i+(n^o^s)+Ie[c]+t[Te[c]],i=s,s=o,o=n,n+=r<<(u=_e[c])|r>>>32-u;for(;c<64;++c)r=i+(o^(n|~s))+Ie[c]+t[Te[c]],i=s,s=o,o=n,n+=r<<(u=_e[c])|r>>>32-u;e.h0=e.h0+i|0,e.h1=e.h1+n|0,e.h2=e.h2+o|0,e.h3=e.h3+s|0,l-=64}}var Ne=S,Re=Ne.pem=Ne.pem||{};function ze(e){for(var t=e.name+": ",a=[],r=function(e,t){return" "+t},i=0;i<e.values.length;++i)a.push(e.values[i].replace(/^(\S+\r\n)/,r));t+=a.join(",")+"\r\n";var n=0,o=-1;for(i=0;i<t.length;++i,++n)if(n>65&&-1!==o){var s=t[o];","===s?(++o,t=t.substr(0,o)+"\r\n "+t.substr(o)):t=t.substr(0,o)+"\r\n"+s+t.substr(o+1),n=i-o-1,o=-1,++i}else" "!==t[i]&&"\t"!==t[i]&&","!==t[i]||(o=i);return t}function Le(e){return e.replace(/^\s+/,"")}Re.encode=function(e,t){t=t||{};var a,r="-----BEGIN "+e.type+"-----\r\n";if(e.procType&&(r+=ze(a={name:"Proc-Type",values:[String(e.procType.version),e.procType.type]})),e.contentDomain&&(r+=ze(a={name:"Content-Domain",values:[e.contentDomain]})),e.dekInfo&&(a={name:"DEK-Info",values:[e.dekInfo.algorithm]},e.dekInfo.parameters&&a.values.push(e.dekInfo.parameters),r+=ze(a)),e.headers)for(var i=0;i<e.headers.length;++i)r+=ze(e.headers[i]);return e.procType&&(r+="\r\n"),r+=Ne.util.encode64(e.body,t.maxline||64)+"\r\n",r+="-----END "+e.type+"-----\r\n"},Re.decode=function(e){for(var t,a=[],r=/\s*-----BEGIN ([A-Z0-9- ]+)-----\r?\n?([\x21-\x7e\s]+?(?:\r?\n\r?\n))?([:A-Za-z0-9+\/=\s]+?)-----END \1-----/g,i=/([\x21-\x7e]+):\s*([\x21-\x7e\s^:]+)/,n=/\r?\n/;t=r.exec(e);){var o={type:t[1],procType:null,contentDomain:null,dekInfo:null,headers:[],body:Ne.util.decode64(t[3])};if(a.push(o),t[2]){for(var s=t[2].split(n),u=0;t&&u<s.length;){for(var c=s[u].replace(/\s+$/,""),l=u+1;l<s.length;++l){var p=s[l];if(!/\s/.test(p[0]))break;c+=p,u=l}if(t=c.match(i)){for(var h={name:t[1],values:[]},d=t[2].split(","),m=0;m<d.length;++m)h.values.push(Le(d[m]));if(o.procType)if(o.contentDomain||"Content-Domain"!==h.name)if(o.dekInfo||"DEK-Info"!==h.name)o.headers.push(h);else{if(0===h.values.length)throw new Error('Invalid PEM formatted message. The "DEK-Info" header must have at least one subfield.');o.dekInfo={algorithm:d[0],parameters:d[1]||null}}else o.contentDomain=d[0]||"";else{if("Proc-Type"!==h.name)throw new Error('Invalid PEM formatted message. The first encapsulated header must be "Proc-Type".');if(2!==h.values.length)throw new Error('Invalid PEM formatted message. The "Proc-Type" header must have two subfields.');o.procType={version:d[0],type:d[1]}}}++u}if("ENCRYPTED"===o.procType&&!o.dekInfo)throw new Error('Invalid PEM formatted message. The "DEK-Info" header must be present if "Proc-Type" is "ENCRYPTED".')}}if(0===a.length)throw new Error("Invalid PEM formatted message.");return a};var xe=S;function De(e,t){xe.cipher.registerAlgorithm(e,(function(){return new xe.des.Algorithm(e,t)}))}xe.des=xe.des||{},xe.des.startEncrypting=function(e,t,a,r){var i=Ge({key:e,output:a,decrypt:!1,mode:r||(null===t?"ECB":"CBC")});return i.start(t),i},xe.des.createEncryptionCipher=function(e,t){return Ge({key:e,output:null,decrypt:!1,mode:t})},xe.des.startDecrypting=function(e,t,a,r){var i=Ge({key:e,output:a,decrypt:!0,mode:r||(null===t?"ECB":"CBC")});return i.start(t),i},xe.des.createDecryptionCipher=function(e,t){return Ge({key:e,output:null,decrypt:!0,mode:t})},xe.des.Algorithm=function(e,t){var a=this;a.name=e,a.mode=new t({blockSize:8,cipher:{encrypt:function(e,t){return He(a._keys,e,t,!1)},decrypt:function(e,t){return He(a._keys,e,t,!0)}}}),a._init=!1},xe.des.Algorithm.prototype.initialize=function(e){if(!this._init){var t=xe.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,a=[0,4,536870912,536870916,65536,65540,536936448,536936452,512,516,536871424,536871428,66048,66052,536936960,536936964],r=[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],n=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],o=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256],s=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,33555488],u=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],c=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],l=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],p=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],h=[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],m=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],f=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],g=e.length()>8?3:1,y=[],k=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],v=0,b=0;b<g;b++){var w=e.getInt32(),j=e.getInt32();w^=(t=252645135&(w>>>4^j))<<4,w^=t=65535&((j^=t)>>>-16^w),w^=(t=858993459&(w>>>2^(j^=t<<-16)))<<2,w^=t=65535&((j^=t)>>>-16^w),w^=(t=1431655765&(w>>>1^(j^=t<<-16)))<<1,w^=t=16711935&((j^=t)>>>8^w),t=(w^=(t=1431655765&(w>>>1^(j^=t<<8)))<<1)<<8|(j^=t)>>>20&240,w=j<<24|j<<8&16711680|j>>>8&65280|j>>>24&240,j=t;for(var C=0;C<k.length;++C){k[C]?(w=w<<2|w>>>26,j=j<<2|j>>>26):(w=w<<1|w>>>27,j=j<<1|j>>>27),j&=-15;var E=a[(w&=-15)>>>28]|r[w>>>24&15]|i[w>>>20&15]|n[w>>>16&15]|o[w>>>12&15]|s[w>>>8&15]|u[w>>>4&15],S=c[j>>>28]|l[j>>>24&15]|p[j>>>20&15]|h[j>>>16&15]|d[j>>>12&15]|m[j>>>8&15]|f[j>>>4&15];t=65535&(S>>>16^E),y[v++]=E^t,y[v++]=S^t<<16}}return y}(t),this._init=!0}},De("DES-ECB",xe.cipher.modes.ecb),De("DES-CBC",xe.cipher.modes.cbc),De("DES-CFB",xe.cipher.modes.cfb),De("DES-OFB",xe.cipher.modes.ofb),De("DES-CTR",xe.cipher.modes.ctr),De("3DES-ECB",xe.cipher.modes.ecb),De("3DES-CBC",xe.cipher.modes.cbc),De("3DES-CFB",xe.cipher.modes.cfb),De("3DES-OFB",xe.cipher.modes.ofb),De("3DES-CTR",xe.cipher.modes.ctr);var Ue=[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],Oe=[-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],Pe=[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],Ve=[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],Me=[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],Ke=[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],Fe=[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],qe=[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 He(e,t,a,r){var i,n,o=32===e.length?3:9;i=3===o?r?[30,-2,-2]:[0,32,2]:r?[94,62,-2,32,64,2,30,-2,-2]:[0,32,2,62,30,-2,64,96,2];var s=t[0],u=t[1];s^=(n=252645135&(s>>>4^u))<<4,s^=(n=65535&(s>>>16^(u^=n)))<<16,s^=n=858993459&((u^=n)>>>2^s),s^=n=16711935&((u^=n<<2)>>>8^s),s=(s^=(n=1431655765&(s>>>1^(u^=n<<8)))<<1)<<1|s>>>31,u=(u^=n)<<1|u>>>31;for(var c=0;c<o;c+=3){for(var l=i[c+1],p=i[c+2],h=i[c];h!=l;h+=p){var d=u^e[h],m=(u>>>4|u<<28)^e[h+1];n=s,s=u,u=n^(Oe[d>>>24&63]|Ve[d>>>16&63]|Ke[d>>>8&63]|qe[63&d]|Ue[m>>>24&63]|Pe[m>>>16&63]|Me[m>>>8&63]|Fe[63&m])}n=s,s=u,u=n}u=u>>>1|u<<31,u^=n=1431655765&((s=s>>>1|s<<31)>>>1^u),u^=(n=16711935&(u>>>8^(s^=n<<1)))<<8,u^=(n=858993459&(u>>>2^(s^=n)))<<2,u^=n=65535&((s^=n)>>>16^u),u^=n=252645135&((s^=n<<16)>>>4^u),s^=n<<4,a[0]=s,a[1]=u}function Ge(e){var t,a="DES-"+((e=e||{}).mode||"CBC").toUpperCase(),r=(t=e.decrypt?xe.cipher.createDecipher(a,e.key):xe.cipher.createCipher(a,e.key)).start;return t.start=function(e,a){var i=null;a instanceof xe.util.ByteBuffer&&(i=a,a={}),(a=a||{}).output=i,a.iv=e,r.call(t,a)},t}var We,Qe=S,Ye=Qe.pkcs5=Qe.pkcs5||{};Qe.util.isNodejs&&!Qe.options.usePureJavaScript&&(We=s),Qe.pbkdf2=Ye.pbkdf2=function(e,t,a,r,i,n){if("function"==typeof i&&(n=i,i=null),Qe.util.isNodejs&&!Qe.options.usePureJavaScript&&We.pbkdf2&&(null===i||"object"!=typeof i)&&(We.pbkdf2Sync.length>4||!i||"sha1"===i))return"string"!=typeof i&&(i="sha1"),e=Buffer.from(e,"binary"),t=Buffer.from(t,"binary"),n?4===We.pbkdf2Sync.length?We.pbkdf2(e,t,a,r,(function(e,t){if(e)return n(e);n(null,t.toString("binary"))})):We.pbkdf2(e,t,a,r,i,(function(e,t){if(e)return n(e);n(null,t.toString("binary"))})):4===We.pbkdf2Sync.length?We.pbkdf2Sync(e,t,a,r).toString("binary"):We.pbkdf2Sync(e,t,a,r,i).toString("binary");if(null==i&&(i="sha1"),"string"==typeof i){if(!(i in Qe.md.algorithms))throw new Error("Unknown hash algorithm: "+i);i=Qe.md[i].create()}var o=i.digestLength;if(r>4294967295*o){var s=new Error("Derived key is too long.");if(n)return n(s);throw s}var u=Math.ceil(r/o),c=r-(u-1)*o,l=Qe.hmac.create();l.start(i,e);var p,h,d,m="";if(!n){for(var f=1;f<=u;++f){l.start(null,null),l.update(t),l.update(Qe.util.int32ToBytes(f)),p=d=l.digest().getBytes();for(var g=2;g<=a;++g)l.start(null,null),l.update(d),h=l.digest().getBytes(),p=Qe.util.xorBytes(p,h,o),d=h;m+=f<u?p:p.substr(0,c)}return m}f=1;function y(){if(f>u)return n(null,m);l.start(null,null),l.update(t),l.update(Qe.util.int32ToBytes(f)),p=d=l.digest().getBytes(),g=2,k()}function k(){if(g<=a)return l.start(null,null),l.update(d),h=l.digest().getBytes(),p=Qe.util.xorBytes(p,h,o),d=h,++g,Qe.util.setImmediate(k);m+=f<u?p:p.substr(0,c),++f,y()}y()};var Ze=S,Xe=Ze.sha256=Ze.sha256||{};Ze.md.sha256=Ze.md.algorithms.sha256=Xe,Xe.create=function(){Je||($e=String.fromCharCode(128),$e+=Ze.util.fillString(String.fromCharCode(0),64),et=[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],Je=!0);var e=null,t=Ze.util.createBuffer(),a=new Array(64),r={algorithm:"sha256",blockLength:64,digestLength:32,messageLength:0,fullMessageLength:null,messageLengthSize:8,start:function(){r.messageLength=0,r.fullMessageLength=r.messageLength64=[];for(var a=r.messageLengthSize/4,i=0;i<a;++i)r.fullMessageLength.push(0);return t=Ze.util.createBuffer(),e={h0:1779033703,h1:3144134277,h2:1013904242,h3:2773480762,h4:1359893119,h5:2600822924,h6:528734635,h7:1541459225},r}};return r.start(),r.update=function(i,n){"utf8"===n&&(i=Ze.util.encodeUtf8(i));var o=i.length;r.messageLength+=o,o=[o/4294967296>>>0,o>>>0];for(var s=r.fullMessageLength.length-1;s>=0;--s)r.fullMessageLength[s]+=o[1],o[1]=o[0]+(r.fullMessageLength[s]/4294967296>>>0),r.fullMessageLength[s]=r.fullMessageLength[s]>>>0,o[0]=o[1]/4294967296>>>0;return t.putBytes(i),tt(e,a,t),(t.read>2048||0===t.length())&&t.compact(),r},r.digest=function(){var i=Ze.util.createBuffer();i.putBytes(t.bytes());var n,o=r.fullMessageLength[r.fullMessageLength.length-1]+r.messageLengthSize&r.blockLength-1;i.putBytes($e.substr(0,r.blockLength-o));for(var s=8*r.fullMessageLength[0],u=0;u<r.fullMessageLength.length-1;++u)s+=(n=8*r.fullMessageLength[u+1])/4294967296>>>0,i.putInt32(s>>>0),s=n>>>0;i.putInt32(s);var c={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4,h5:e.h5,h6:e.h6,h7:e.h7};tt(c,a,i);var l=Ze.util.createBuffer();return l.putInt32(c.h0),l.putInt32(c.h1),l.putInt32(c.h2),l.putInt32(c.h3),l.putInt32(c.h4),l.putInt32(c.h5),l.putInt32(c.h6),l.putInt32(c.h7),l},r};var $e=null,Je=!1,et=null;function tt(e,t,a){for(var r,i,n,o,s,u,c,l,p,h,d,m,f,g=a.length();g>=64;){for(s=0;s<16;++s)t[s]=a.getInt32();for(;s<64;++s)r=((r=t[s-2])>>>17|r<<15)^(r>>>19|r<<13)^r>>>10,i=((i=t[s-15])>>>7|i<<25)^(i>>>18|i<<14)^i>>>3,t[s]=r+t[s-7]+i+t[s-16]|0;for(u=e.h0,c=e.h1,l=e.h2,p=e.h3,h=e.h4,d=e.h5,m=e.h6,f=e.h7,s=0;s<64;++s)n=(u>>>2|u<<30)^(u>>>13|u<<19)^(u>>>22|u<<10),o=u&c|l&(u^c),r=f+((h>>>6|h<<26)^(h>>>11|h<<21)^(h>>>25|h<<7))+(m^h&(d^m))+et[s]+t[s],f=m,m=d,d=h,h=p+r>>>0,p=l,l=c,c=u,u=r+(i=n+o)>>>0;e.h0=e.h0+u|0,e.h1=e.h1+c|0,e.h2=e.h2+l|0,e.h3=e.h3+p|0,e.h4=e.h4+h|0,e.h5=e.h5+d|0,e.h6=e.h6+m|0,e.h7=e.h7+f|0,g-=64}}var at=S,rt=null;!at.util.isNodejs||at.options.usePureJavaScript||process.versions["node-webkit"]||(rt=s),(at.prng=at.prng||{}).create=function(e){for(var t={plugin:e,key:null,seed:null,time:null,reseeds:0,generated:0,keyBytes:""},a=e.md,r=new Array(32),i=0;i<32;++i)r[i]=a.create();function n(){if(t.pools[0].messageLength>=32)return o();var e=32-t.pools[0].messageLength<<5;t.collect(t.seedFileSync(e)),o()}function o(){t.reseeds=4294967295===t.reseeds?0:t.reseeds+1;var e=t.plugin.md.create();e.update(t.keyBytes);for(var a=1,r=0;r<32;++r)t.reseeds%a==0&&(e.update(t.pools[r].digest().getBytes()),t.pools[r].start()),a<<=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 s(e){var t=null,a=at.util.globalScope,r=a.crypto||a.msCrypto;r&&r.getRandomValues&&(t=function(e){return r.getRandomValues(e)});var i=at.util.createBuffer();if(t)for(;i.length()<e;){var n=Math.max(1,Math.min(e-i.length(),65536)/4),o=new Uint32Array(Math.floor(n));try{t(o);for(var s=0;s<o.length;++s)i.putInt32(o[s])}catch(e){if(!("undefined"!=typeof QuotaExceededError&&e instanceof QuotaExceededError))throw e}}if(i.length()<e)for(var u,c,l,p=Math.floor(65536*Math.random());i.length()<e;){c=16807*(65535&p),c+=(32767&(u=16807*(p>>16)))<<16,p=4294967295&(c=(2147483647&(c+=u>>15))+(c>>31));for(s=0;s<3;++s)l=p>>>(s<<3),l^=Math.floor(256*Math.random()),i.putByte(String.fromCharCode(255&l))}return i.getBytes(e)}return t.pools=r,t.pool=0,t.generate=function(e,a){if(!a)return t.generateSync(e);var r=t.plugin.cipher,i=t.plugin.increment,n=t.plugin.formatKey,s=t.plugin.formatSeed,u=at.util.createBuffer();t.key=null,function c(l){if(l)return a(l);if(u.length()>=e)return a(null,u.getBytes(e));t.generated>1048575&&(t.key=null);if(null===t.key)return at.util.nextTick((function(){!function(e){if(t.pools[0].messageLength>=32)return o(),e();var a=32-t.pools[0].messageLength<<5;t.seedFile(a,(function(a,r){if(a)return e(a);t.collect(r),o(),e()}))}(c)}));var p=r(t.key,t.seed);t.generated+=p.length,u.putBytes(p),t.key=n(r(t.key,i(t.seed))),t.seed=s(r(t.key,t.seed)),at.util.setImmediate(c)}()},t.generateSync=function(e){var a=t.plugin.cipher,r=t.plugin.increment,i=t.plugin.formatKey,o=t.plugin.formatSeed;t.key=null;for(var s=at.util.createBuffer();s.length()<e;){t.generated>1048575&&(t.key=null),null===t.key&&n();var u=a(t.key,t.seed);t.generated+=u.length,s.putBytes(u),t.key=i(a(t.key,r(t.seed))),t.seed=o(a(t.key,t.seed))}return s.getBytes(e)},rt?(t.seedFile=function(e,t){rt.randomBytes(e,(function(e,a){if(e)return t(e);t(null,a.toString())}))},t.seedFileSync=function(e){return rt.randomBytes(e).toString()}):(t.seedFile=function(e,t){try{t(null,s(e))}catch(e){t(e)}},t.seedFileSync=s),t.collect=function(e){for(var a=e.length,r=0;r<a;++r)t.pools[t.pool].update(e.substr(r,1)),t.pool=31===t.pool?0:t.pool+1},t.collectInt=function(e,a){for(var r="",i=0;i<a;i+=8)r+=String.fromCharCode(e>>i&255);t.collect(r)},t.registerWorker=function(e){if(e===self)t.seedFile=function(e,t){self.addEventListener("message",(function e(a){var r=a.data;r.forge&&r.forge.prng&&(self.removeEventListener("message",e),t(r.forge.prng.err,r.forge.prng.bytes))})),self.postMessage({forge:{prng:{needed:e}}})};else{e.addEventListener("message",(function(a){var r=a.data;r.forge&&r.forge.prng&&t.seedFile(r.forge.prng.needed,(function(t,a){e.postMessage({forge:{prng:{err:t,bytes:a}}})}))}))}},t};var it=S;it.random&&it.random.getBytes?it.random:function(e){var t={},a=new Array(4),r=it.util.createBuffer();function i(){var e=it.prng.create(t);return e.getBytes=function(t,a){return e.generate(t,a)},e.getBytesSync=function(t){return e.generate(t)},e}t.formatKey=function(e){var t=it.util.createBuffer(e);return(e=new Array(4))[0]=t.getInt32(),e[1]=t.getInt32(),e[2]=t.getInt32(),e[3]=t.getInt32(),it.aes._expandKey(e,!1)},t.formatSeed=function(e){var t=it.util.createBuffer(e);return(e=new Array(4))[0]=t.getInt32(),e[1]=t.getInt32(),e[2]=t.getInt32(),e[3]=t.getInt32(),e},t.cipher=function(e,t){return it.aes._updateBlock(e,t,a,!1),r.putInt32(a[0]),r.putInt32(a[1]),r.putInt32(a[2]),r.putInt32(a[3]),r.getBytes()},t.increment=function(e){return++e[3],e},t.md=it.md.sha256;var n=i(),o=null,s=it.util.globalScope,u=s.crypto||s.msCrypto;if(u&&u.getRandomValues&&(o=function(e){return u.getRandomValues(e)}),it.options.usePureJavaScript||!it.util.isNodejs&&!o){if(n.collectInt(+new Date,32),"undefined"!=typeof navigator){var c="";for(var l in navigator)try{"string"==typeof navigator[l]&&(c+=navigator[l])}catch(e){}n.collect(c),c=null}e&&(e().mousemove((function(e){n.collectInt(e.clientX,16),n.collectInt(e.clientY,16)})),e().keypress((function(e){n.collectInt(e.charCode,8)})))}if(it.random)for(var l in n)it.random[l]=n[l];else it.random=n;it.random.createInstance=i,it.random}("undefined"!=typeof jQuery?jQuery:null);var nt=S,ot=[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],st=[1,2,3,5],ut=function(e,t){return e<<t&65535|(65535&e)>>16-t},ct=function(e,t){return(65535&e)>>t|e<<16-t&65535};nt.rc2=nt.rc2||{},nt.rc2.expandKey=function(e,t){"string"==typeof e&&(e=nt.util.createBuffer(e)),t=t||128;var a,r=e,i=e.length(),n=t,o=Math.ceil(n/8),s=255>>(7&n);for(a=i;a<128;a++)r.putByte(ot[r.at(a-1)+r.at(a-i)&255]);for(r.setAt(128-o,ot[r.at(128-o)&s]),a=127-o;a>=0;a--)r.setAt(a,ot[r.at(a+1)^r.at(a+o)]);return r};var lt=function(e,t,a){var r,i,n,o,s=!1,u=null,c=null,l=null,p=[];for(e=nt.rc2.expandKey(e,t),n=0;n<64;n++)p.push(e.getInt16Le());a?(r=function(e){for(n=0;n<4;n++)e[n]+=p[o]+(e[(n+3)%4]&e[(n+2)%4])+(~e[(n+3)%4]&e[(n+1)%4]),e[n]=ut(e[n],st[n]),o++},i=function(e){for(n=0;n<4;n++)e[n]+=p[63&e[(n+3)%4]]}):(r=function(e){for(n=3;n>=0;n--)e[n]=ct(e[n],st[n]),e[n]-=p[o]+(e[(n+3)%4]&e[(n+2)%4])+(~e[(n+3)%4]&e[(n+1)%4]),o--},i=function(e){for(n=3;n>=0;n--)e[n]-=p[63&e[(n+3)%4]]});var h=function(e){var t=[];for(n=0;n<4;n++){var r=u.getInt16Le();null!==l&&(a?r^=l.getInt16Le():l.putInt16Le(r)),t.push(65535&r)}o=a?0:63;for(var i=0;i<e.length;i++)for(var s=0;s<e[i][0];s++)e[i][1](t);for(n=0;n<4;n++)null!==l&&(a?l.putInt16Le(t[n]):t[n]^=l.getInt16Le()),c.putInt16Le(t[n])},d=null;return d={start:function(e,t){e&&"string"==typeof e&&(e=nt.util.createBuffer(e)),s=!1,u=nt.util.createBuffer(),c=t||new nt.util.createBuffer,l=e,d.output=c},update:function(e){for(s||u.putBuffer(e);u.length()>=8;)h([[5,r],[1,i],[6,r],[1,i],[5,r]])},finish:function(e){var t=!0;if(a)if(e)t=e(8,u,!a);else{var r=8===u.length()?8:8-u.length();u.fillWithByte(r,r)}if(t&&(s=!0,d.update()),!a&&(t=0===u.length()))if(e)t=e(8,c,!a);else{var i=c.length(),n=c.at(i-1);n>i?t=!1:c.truncate(n)}return t}}};nt.rc2.startEncrypting=function(e,t,a){var r=nt.rc2.createEncryptionCipher(e,128);return r.start(t,a),r},nt.rc2.createEncryptionCipher=function(e,t){return lt(e,t,!0)},nt.rc2.startDecrypting=function(e,t,a){var r=nt.rc2.createDecryptionCipher(e,128);return r.start(t,a),r},nt.rc2.createDecryptionCipher=function(e,t){return lt(e,t,!1)};var pt,ht=S;function dt(e,t,a){this.data=[],null!=e&&("number"==typeof e?this.fromNumber(e,t,a):null==t&&"string"!=typeof e?this.fromString(e,256):this.fromString(e,t))}function mt(){return new dt(null)}function ft(e,t,a,r,i,n){for(var o=16383&t,s=t>>14;--n>=0;){var u=16383&this.data[e],c=this.data[e++]>>14,l=s*u+c*o;i=((u=o*u+((16383&l)<<14)+a.data[r]+i)>>28)+(l>>14)+s*c,a.data[r++]=268435455&u}return i}ht.jsbn=ht.jsbn||{},ht.jsbn.BigInteger=dt,"undefined"==typeof navigator?(dt.prototype.am=ft,pt=28):"Microsoft Internet Explorer"==navigator.appName?(dt.prototype.am=function(e,t,a,r,i,n){for(var o=32767&t,s=t>>15;--n>=0;){var u=32767&this.data[e],c=this.data[e++]>>15,l=s*u+c*o;i=((u=o*u+((32767&l)<<15)+a.data[r]+(1073741823&i))>>>30)+(l>>>15)+s*c+(i>>>30),a.data[r++]=1073741823&u}return i},pt=30):"Netscape"!=navigator.appName?(dt.prototype.am=function(e,t,a,r,i,n){for(;--n>=0;){var o=t*this.data[e++]+a.data[r]+i;i=Math.floor(o/67108864),a.data[r++]=67108863&o}return i},pt=26):(dt.prototype.am=ft,pt=28),dt.prototype.DB=pt,dt.prototype.DM=(1<<pt)-1,dt.prototype.DV=1<<pt;dt.prototype.FV=Math.pow(2,52),dt.prototype.F1=52-pt,dt.prototype.F2=2*pt-52;var gt,yt,kt="0123456789abcdefghijklmnopqrstuvwxyz",vt=new Array;for(gt="0".charCodeAt(0),yt=0;yt<=9;++yt)vt[gt++]=yt;for(gt="a".charCodeAt(0),yt=10;yt<36;++yt)vt[gt++]=yt;for(gt="A".charCodeAt(0),yt=10;yt<36;++yt)vt[gt++]=yt;function bt(e){return kt.charAt(e)}function wt(e,t){var a=vt[e.charCodeAt(t)];return null==a?-1:a}function jt(e){var t=mt();return t.fromInt(e),t}function Ct(e){var t,a=1;return 0!=(t=e>>>16)&&(e=t,a+=16),0!=(t=e>>8)&&(e=t,a+=8),0!=(t=e>>4)&&(e=t,a+=4),0!=(t=e>>2)&&(e=t,a+=2),0!=(t=e>>1)&&(e=t,a+=1),a}function Et(e){this.m=e}function St(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 Tt(e,t){return e&t}function _t(e,t){return e|t}function It(e,t){return e^t}function At(e,t){return e&~t}function Bt(e){if(0==e)return-1;var t=0;return 0==(65535&e)&&(e>>=16,t+=16),0==(255&e)&&(e>>=8,t+=8),0==(15&e)&&(e>>=4,t+=4),0==(3&e)&&(e>>=2,t+=2),0==(1&e)&&++t,t}function Nt(e){for(var t=0;0!=e;)e&=e-1,++t;return t}function Rt(){}function zt(e){return e}function Lt(e){this.r2=mt(),this.q3=mt(),dt.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}Et.prototype.convert=function(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e},Et.prototype.revert=function(e){return e},Et.prototype.reduce=function(e){e.divRemTo(this.m,null,e)},Et.prototype.mulTo=function(e,t,a){e.multiplyTo(t,a),this.reduce(a)},Et.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},St.prototype.convert=function(e){var t=mt();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(dt.ZERO)>0&&this.m.subTo(t,t),t},St.prototype.revert=function(e){var t=mt();return e.copyTo(t),this.reduce(t),t},St.prototype.reduce=function(e){for(;e.t<=this.mt2;)e.data[e.t++]=0;for(var t=0;t<this.m.t;++t){var a=32767&e.data[t],r=a*this.mpl+((a*this.mph+(e.data[t]>>15)*this.mpl&this.um)<<15)&e.DM;for(a=t+this.m.t,e.data[a]+=this.m.am(0,r,e,t,0,this.m.t);e.data[a]>=e.DV;)e.data[a]-=e.DV,e.data[++a]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)},St.prototype.mulTo=function(e,t,a){e.multiplyTo(t,a),this.reduce(a)},St.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},dt.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},dt.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},dt.prototype.fromString=function(e,t){var a;if(16==t)a=4;else if(8==t)a=3;else if(256==t)a=8;else if(2==t)a=1;else if(32==t)a=5;else{if(4!=t)return void this.fromRadix(e,t);a=2}this.t=0,this.s=0;for(var r=e.length,i=!1,n=0;--r>=0;){var o=8==a?255&e[r]:wt(e,r);o<0?"-"==e.charAt(r)&&(i=!0):(i=!1,0==n?this.data[this.t++]=o:n+a>this.DB?(this.data[this.t-1]|=(o&(1<<this.DB-n)-1)<<n,this.data[this.t++]=o>>this.DB-n):this.data[this.t-1]|=o<<n,(n+=a)>=this.DB&&(n-=this.DB))}8==a&&0!=(128&e[0])&&(this.s=-1,n>0&&(this.data[this.t-1]|=(1<<this.DB-n)-1<<n)),this.clamp(),i&&dt.ZERO.subTo(this,this)},dt.prototype.clamp=function(){for(var e=this.s&this.DM;this.t>0&&this.data[this.t-1]==e;)--this.t},dt.prototype.dlShiftTo=function(e,t){var a;for(a=this.t-1;a>=0;--a)t.data[a+e]=this.data[a];for(a=e-1;a>=0;--a)t.data[a]=0;t.t=this.t+e,t.s=this.s},dt.prototype.drShiftTo=function(e,t){for(var a=e;a<this.t;++a)t.data[a-e]=this.data[a];t.t=Math.max(this.t-e,0),t.s=this.s},dt.prototype.lShiftTo=function(e,t){var a,r=e%this.DB,i=this.DB-r,n=(1<<i)-1,o=Math.floor(e/this.DB),s=this.s<<r&this.DM;for(a=this.t-1;a>=0;--a)t.data[a+o+1]=this.data[a]>>i|s,s=(this.data[a]&n)<<r;for(a=o-1;a>=0;--a)t.data[a]=0;t.data[o]=s,t.t=this.t+o+1,t.s=this.s,t.clamp()},dt.prototype.rShiftTo=function(e,t){t.s=this.s;var a=Math.floor(e/this.DB);if(a>=this.t)t.t=0;else{var r=e%this.DB,i=this.DB-r,n=(1<<r)-1;t.data[0]=this.data[a]>>r;for(var o=a+1;o<this.t;++o)t.data[o-a-1]|=(this.data[o]&n)<<i,t.data[o-a]=this.data[o]>>r;r>0&&(t.data[this.t-a-1]|=(this.s&n)<<i),t.t=this.t-a,t.clamp()}},dt.prototype.subTo=function(e,t){for(var a=0,r=0,i=Math.min(e.t,this.t);a<i;)r+=this.data[a]-e.data[a],t.data[a++]=r&this.DM,r>>=this.DB;if(e.t<this.t){for(r-=e.s;a<this.t;)r+=this.data[a],t.data[a++]=r&this.DM,r>>=this.DB;r+=this.s}else{for(r+=this.s;a<e.t;)r-=e.data[a],t.data[a++]=r&this.DM,r>>=this.DB;r-=e.s}t.s=r<0?-1:0,r<-1?t.data[a++]=this.DV+r:r>0&&(t.data[a++]=r),t.t=a,t.clamp()},dt.prototype.multiplyTo=function(e,t){var a=this.abs(),r=e.abs(),i=a.t;for(t.t=i+r.t;--i>=0;)t.data[i]=0;for(i=0;i<r.t;++i)t.data[i+a.t]=a.am(0,r.data[i],t,i,0,a.t);t.s=0,t.clamp(),this.s!=e.s&&dt.ZERO.subTo(t,t)},dt.prototype.squareTo=function(e){for(var t=this.abs(),a=e.t=2*t.t;--a>=0;)e.data[a]=0;for(a=0;a<t.t-1;++a){var r=t.am(a,t.data[a],e,2*a,0,1);(e.data[a+t.t]+=t.am(a+1,2*t.data[a],e,2*a+1,r,t.t-a-1))>=t.DV&&(e.data[a+t.t]-=t.DV,e.data[a+t.t+1]=1)}e.t>0&&(e.data[e.t-1]+=t.am(a,t.data[a],e,2*a,0,1)),e.s=0,e.clamp()},dt.prototype.divRemTo=function(e,t,a){var r=e.abs();if(!(r.t<=0)){var i=this.abs();if(i.t<r.t)return null!=t&&t.fromInt(0),void(null!=a&&this.copyTo(a));null==a&&(a=mt());var n=mt(),o=this.s,s=e.s,u=this.DB-Ct(r.data[r.t-1]);u>0?(r.lShiftTo(u,n),i.lShiftTo(u,a)):(r.copyTo(n),i.copyTo(a));var c=n.t,l=n.data[c-1];if(0!=l){var p=l*(1<<this.F1)+(c>1?n.data[c-2]>>this.F2:0),h=this.FV/p,d=(1<<this.F1)/p,m=1<<this.F2,f=a.t,g=f-c,y=null==t?mt():t;for(n.dlShiftTo(g,y),a.compareTo(y)>=0&&(a.data[a.t++]=1,a.subTo(y,a)),dt.ONE.dlShiftTo(c,y),y.subTo(n,n);n.t<c;)n.data[n.t++]=0;for(;--g>=0;){var k=a.data[--f]==l?this.DM:Math.floor(a.data[f]*h+(a.data[f-1]+m)*d);if((a.data[f]+=n.am(0,k,a,g,0,c))<k)for(n.dlShiftTo(g,y),a.subTo(y,a);a.data[f]<--k;)a.subTo(y,a)}null!=t&&(a.drShiftTo(c,t),o!=s&&dt.ZERO.subTo(t,t)),a.t=c,a.clamp(),u>0&&a.rShiftTo(u,a),o<0&&dt.ZERO.subTo(a,a)}}},dt.prototype.invDigit=function(){if(this.t<1)return 0;var e=this.data[0];if(0==(1&e))return 0;var t=3&e;return(t=(t=(t=(t=t*(2-(15&e)*t)&15)*(2-(255&e)*t)&255)*(2-((65535&e)*t&65535))&65535)*(2-e*t%this.DV)%this.DV)>0?this.DV-t:-t},dt.prototype.isEven=function(){return 0==(this.t>0?1&this.data[0]:this.s)},dt.prototype.exp=function(e,t){if(e>4294967295||e<1)return dt.ONE;var a=mt(),r=mt(),i=t.convert(this),n=Ct(e)-1;for(i.copyTo(a);--n>=0;)if(t.sqrTo(a,r),(e&1<<n)>0)t.mulTo(r,i,a);else{var o=a;a=r,r=o}return t.revert(a)},dt.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 a,r=(1<<t)-1,i=!1,n="",o=this.t,s=this.DB-o*this.DB%t;if(o-- >0)for(s<this.DB&&(a=this.data[o]>>s)>0&&(i=!0,n=bt(a));o>=0;)s<t?(a=(this.data[o]&(1<<s)-1)<<t-s,a|=this.data[--o]>>(s+=this.DB-t)):(a=this.data[o]>>(s-=t)&r,s<=0&&(s+=this.DB,--o)),a>0&&(i=!0),i&&(n+=bt(a));return i?n:"0"},dt.prototype.negate=function(){var e=mt();return dt.ZERO.subTo(this,e),e},dt.prototype.abs=function(){return this.s<0?this.negate():this},dt.prototype.compareTo=function(e){var t=this.s-e.s;if(0!=t)return t;var a=this.t;if(0!=(t=a-e.t))return this.s<0?-t:t;for(;--a>=0;)if(0!=(t=this.data[a]-e.data[a]))return t;return 0},dt.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+Ct(this.data[this.t-1]^this.s&this.DM)},dt.prototype.mod=function(e){var t=mt();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(dt.ZERO)>0&&e.subTo(t,t),t},dt.prototype.modPowInt=function(e,t){var a;return a=e<256||t.isEven()?new Et(t):new St(t),this.exp(e,a)},dt.ZERO=jt(0),dt.ONE=jt(1),Rt.prototype.convert=zt,Rt.prototype.revert=zt,Rt.prototype.mulTo=function(e,t,a){e.multiplyTo(t,a)},Rt.prototype.sqrTo=function(e,t){e.squareTo(t)},Lt.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=mt();return e.copyTo(t),this.reduce(t),t},Lt.prototype.revert=function(e){return e},Lt.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)},Lt.prototype.mulTo=function(e,t,a){e.multiplyTo(t,a),this.reduce(a)},Lt.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)};var xt=[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],Dt=(1<<26)/xt[xt.length-1];dt.prototype.chunkSize=function(e){return Math.floor(Math.LN2*this.DB/Math.log(e))},dt.prototype.toRadix=function(e){if(null==e&&(e=10),0==this.signum()||e<2||e>36)return"0";var t=this.chunkSize(e),a=Math.pow(e,t),r=jt(a),i=mt(),n=mt(),o="";for(this.divRemTo(r,i,n);i.signum()>0;)o=(a+n.intValue()).toString(e).substr(1)+o,i.divRemTo(r,i,n);return n.intValue().toString(e)+o},dt.prototype.fromRadix=function(e,t){this.fromInt(0),null==t&&(t=10);for(var a=this.chunkSize(t),r=Math.pow(t,a),i=!1,n=0,o=0,s=0;s<e.length;++s){var u=wt(e,s);u<0?"-"==e.charAt(s)&&0==this.signum()&&(i=!0):(o=t*o+u,++n>=a&&(this.dMultiply(r),this.dAddOffset(o,0),n=0,o=0))}n>0&&(this.dMultiply(Math.pow(t,n)),this.dAddOffset(o,0)),i&&dt.ZERO.subTo(this,this)},dt.prototype.fromNumber=function(e,t,a){if("number"==typeof t)if(e<2)this.fromInt(1);else for(this.fromNumber(e,a),this.testBit(e-1)||this.bitwiseTo(dt.ONE.shiftLeft(e-1),_t,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(dt.ONE.shiftLeft(e-1),this);else{var r=new Array,i=7&e;r.length=1+(e>>3),t.nextBytes(r),i>0?r[0]&=(1<<i)-1:r[0]=0,this.fromString(r,256)}},dt.prototype.bitwiseTo=function(e,t,a){var r,i,n=Math.min(e.t,this.t);for(r=0;r<n;++r)a.data[r]=t(this.data[r],e.data[r]);if(e.t<this.t){for(i=e.s&this.DM,r=n;r<this.t;++r)a.data[r]=t(this.data[r],i);a.t=this.t}else{for(i=this.s&this.DM,r=n;r<e.t;++r)a.data[r]=t(i,e.data[r]);a.t=e.t}a.s=t(this.s,e.s),a.clamp()},dt.prototype.changeBit=function(e,t){var a=dt.ONE.shiftLeft(e);return this.bitwiseTo(a,t,a),a},dt.prototype.addTo=function(e,t){for(var a=0,r=0,i=Math.min(e.t,this.t);a<i;)r+=this.data[a]+e.data[a],t.data[a++]=r&this.DM,r>>=this.DB;if(e.t<this.t){for(r+=e.s;a<this.t;)r+=this.data[a],t.data[a++]=r&this.DM,r>>=this.DB;r+=this.s}else{for(r+=this.s;a<e.t;)r+=e.data[a],t.data[a++]=r&this.DM,r>>=this.DB;r+=e.s}t.s=r<0?-1:0,r>0?t.data[a++]=r:r<-1&&(t.data[a++]=this.DV+r),t.t=a,t.clamp()},dt.prototype.dMultiply=function(e){this.data[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()},dt.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]}},dt.prototype.multiplyLowerTo=function(e,t,a){var r,i=Math.min(this.t+e.t,t);for(a.s=0,a.t=i;i>0;)a.data[--i]=0;for(r=a.t-this.t;i<r;++i)a.data[i+this.t]=this.am(0,e.data[i],a,i,0,this.t);for(r=Math.min(e.t,t);i<r;++i)this.am(0,e.data[i],a,i,0,t-i);a.clamp()},dt.prototype.multiplyUpperTo=function(e,t,a){--t;var r=a.t=this.t+e.t-t;for(a.s=0;--r>=0;)a.data[r]=0;for(r=Math.max(t-this.t,0);r<e.t;++r)a.data[this.t+r-t]=this.am(t-r,e.data[r],a,0,0,this.t+r-t);a.clamp(),a.drShiftTo(1,a)},dt.prototype.modInt=function(e){if(e<=0)return 0;var t=this.DV%e,a=this.s<0?e-1:0;if(this.t>0)if(0==t)a=this.data[0]%e;else for(var r=this.t-1;r>=0;--r)a=(t*a+this.data[r])%e;return a},dt.prototype.millerRabin=function(e){var t=this.subtract(dt.ONE),a=t.getLowestSetBit();if(a<=0)return!1;for(var r,i=t.shiftRight(a),n={nextBytes:function(e){for(var t=0;t<e.length;++t)e[t]=Math.floor(256*Math.random())}},o=0;o<e;++o){do{r=new dt(this.bitLength(),n)}while(r.compareTo(dt.ONE)<=0||r.compareTo(t)>=0);var s=r.modPow(i,this);if(0!=s.compareTo(dt.ONE)&&0!=s.compareTo(t)){for(var u=1;u++<a&&0!=s.compareTo(t);)if(0==(s=s.modPowInt(2,this)).compareTo(dt.ONE))return!1;if(0!=s.compareTo(t))return!1}}return!0},dt.prototype.clone=function(){var e=mt();return this.copyTo(e),e},dt.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]},dt.prototype.byteValue=function(){return 0==this.t?this.s:this.data[0]<<24>>24},dt.prototype.shortValue=function(){return 0==this.t?this.s:this.data[0]<<16>>16},dt.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this.data[0]<=0?0:1},dt.prototype.toByteArray=function(){var e=this.t,t=new Array;t[0]=this.s;var a,r=this.DB-e*this.DB%8,i=0;if(e-- >0)for(r<this.DB&&(a=this.data[e]>>r)!=(this.s&this.DM)>>r&&(t[i++]=a|this.s<<this.DB-r);e>=0;)r<8?(a=(this.data[e]&(1<<r)-1)<<8-r,a|=this.data[--e]>>(r+=this.DB-8)):(a=this.data[e]>>(r-=8)&255,r<=0&&(r+=this.DB,--e)),0!=(128&a)&&(a|=-256),0==i&&(128&this.s)!=(128&a)&&++i,(i>0||a!=this.s)&&(t[i++]=a);return t},dt.prototype.equals=function(e){return 0==this.compareTo(e)},dt.prototype.min=function(e){return this.compareTo(e)<0?this:e},dt.prototype.max=function(e){return this.compareTo(e)>0?this:e},dt.prototype.and=function(e){var t=mt();return this.bitwiseTo(e,Tt,t),t},dt.prototype.or=function(e){var t=mt();return this.bitwiseTo(e,_t,t),t},dt.prototype.xor=function(e){var t=mt();return this.bitwiseTo(e,It,t),t},dt.prototype.andNot=function(e){var t=mt();return this.bitwiseTo(e,At,t),t},dt.prototype.not=function(){for(var e=mt(),t=0;t<this.t;++t)e.data[t]=this.DM&~this.data[t];return e.t=this.t,e.s=~this.s,e},dt.prototype.shiftLeft=function(e){var t=mt();return e<0?this.rShiftTo(-e,t):this.lShiftTo(e,t),t},dt.prototype.shiftRight=function(e){var t=mt();return e<0?this.lShiftTo(-e,t):this.rShiftTo(e,t),t},dt.prototype.getLowestSetBit=function(){for(var e=0;e<this.t;++e)if(0!=this.data[e])return e*this.DB+Bt(this.data[e]);return this.s<0?this.t*this.DB:-1},dt.prototype.bitCount=function(){for(var e=0,t=this.s&this.DM,a=0;a<this.t;++a)e+=Nt(this.data[a]^t);return e},dt.prototype.testBit=function(e){var t=Math.floor(e/this.DB);return t>=this.t?0!=this.s:0!=(this.data[t]&1<<e%this.DB)},dt.prototype.setBit=function(e){return this.changeBit(e,_t)},dt.prototype.clearBit=function(e){return this.changeBit(e,At)},dt.prototype.flipBit=function(e){return this.changeBit(e,It)},dt.prototype.add=function(e){var t=mt();return this.addTo(e,t),t},dt.prototype.subtract=function(e){var t=mt();return this.subTo(e,t),t},dt.prototype.multiply=function(e){var t=mt();return this.multiplyTo(e,t),t},dt.prototype.divide=function(e){var t=mt();return this.divRemTo(e,t,null),t},dt.prototype.remainder=function(e){var t=mt();return this.divRemTo(e,null,t),t},dt.prototype.divideAndRemainder=function(e){var t=mt(),a=mt();return this.divRemTo(e,t,a),new Array(t,a)},dt.prototype.modPow=function(e,t){var a,r,i=e.bitLength(),n=jt(1);if(i<=0)return n;a=i<18?1:i<48?3:i<144?4:i<768?5:6,r=i<8?new Et(t):t.isEven()?new Lt(t):new St(t);var o=new Array,s=3,u=a-1,c=(1<<a)-1;if(o[1]=r.convert(this),a>1){var l=mt();for(r.sqrTo(o[1],l);s<=c;)o[s]=mt(),r.mulTo(l,o[s-2],o[s]),s+=2}var p,h,d=e.t-1,m=!0,f=mt();for(i=Ct(e.data[d])-1;d>=0;){for(i>=u?p=e.data[d]>>i-u&c:(p=(e.data[d]&(1<<i+1)-1)<<u-i,d>0&&(p|=e.data[d-1]>>this.DB+i-u)),s=a;0==(1&p);)p>>=1,--s;if((i-=s)<0&&(i+=this.DB,--d),m)o[p].copyTo(n),m=!1;else{for(;s>1;)r.sqrTo(n,f),r.sqrTo(f,n),s-=2;s>0?r.sqrTo(n,f):(h=n,n=f,f=h),r.mulTo(f,o[p],n)}for(;d>=0&&0==(e.data[d]&1<<i);)r.sqrTo(n,f),h=n,n=f,f=h,--i<0&&(i=this.DB-1,--d)}return r.revert(n)},dt.prototype.modInverse=function(e){var t=e.isEven();if(this.isEven()&&t||0==e.signum())return dt.ZERO;for(var a=e.clone(),r=this.clone(),i=jt(1),n=jt(0),o=jt(0),s=jt(1);0!=a.signum();){for(;a.isEven();)a.rShiftTo(1,a),t?(i.isEven()&&n.isEven()||(i.addTo(this,i),n.subTo(e,n)),i.rShiftTo(1,i)):n.isEven()||n.subTo(e,n),n.rShiftTo(1,n);for(;r.isEven();)r.rShiftTo(1,r),t?(o.isEven()&&s.isEven()||(o.addTo(this,o),s.subTo(e,s)),o.rShiftTo(1,o)):s.isEven()||s.subTo(e,s),s.rShiftTo(1,s);a.compareTo(r)>=0?(a.subTo(r,a),t&&i.subTo(o,i),n.subTo(s,n)):(r.subTo(a,r),t&&o.subTo(i,o),s.subTo(n,s))}return 0!=r.compareTo(dt.ONE)?dt.ZERO:s.compareTo(e)>=0?s.subtract(e):s.signum()<0?(s.addTo(e,s),s.signum()<0?s.add(e):s):s},dt.prototype.pow=function(e){return this.exp(e,new Rt)},dt.prototype.gcd=function(e){var t=this.s<0?this.negate():this.clone(),a=e.s<0?e.negate():e.clone();if(t.compareTo(a)<0){var r=t;t=a,a=r}var i=t.getLowestSetBit(),n=a.getLowestSetBit();if(n<0)return t;for(i<n&&(n=i),n>0&&(t.rShiftTo(n,t),a.rShiftTo(n,a));t.signum()>0;)(i=t.getLowestSetBit())>0&&t.rShiftTo(i,t),(i=a.getLowestSetBit())>0&&a.rShiftTo(i,a),t.compareTo(a)>=0?(t.subTo(a,t),t.rShiftTo(1,t)):(a.subTo(t,a),a.rShiftTo(1,a));return n>0&&a.lShiftTo(n,a),a},dt.prototype.isProbablePrime=function(e){var t,a=this.abs();if(1==a.t&&a.data[0]<=xt[xt.length-1]){for(t=0;t<xt.length;++t)if(a.data[0]==xt[t])return!0;return!1}if(a.isEven())return!1;for(t=1;t<xt.length;){for(var r=xt[t],i=t+1;i<xt.length&&r<Dt;)r*=xt[i++];for(r=a.modInt(r);t<i;)if(r%xt[t++]==0)return!1}return a.millerRabin(e)};var Ut=S,Ot=Ut.sha1=Ut.sha1||{};Ut.md.sha1=Ut.md.algorithms.sha1=Ot,Ot.create=function(){Vt||(Pt=String.fromCharCode(128),Pt+=Ut.util.fillString(String.fromCharCode(0),64),Vt=!0);var e=null,t=Ut.util.createBuffer(),a=new Array(80),r={algorithm:"sha1",blockLength:64,digestLength:20,messageLength:0,fullMessageLength:null,messageLengthSize:8,start:function(){r.messageLength=0,r.fullMessageLength=r.messageLength64=[];for(var a=r.messageLengthSize/4,i=0;i<a;++i)r.fullMessageLength.push(0);return t=Ut.util.createBuffer(),e={h0:1732584193,h1:4023233417,h2:2562383102,h3:271733878,h4:3285377520},r}};return r.start(),r.update=function(i,n){"utf8"===n&&(i=Ut.util.encodeUtf8(i));var o=i.length;r.messageLength+=o,o=[o/4294967296>>>0,o>>>0];for(var s=r.fullMessageLength.length-1;s>=0;--s)r.fullMessageLength[s]+=o[1],o[1]=o[0]+(r.fullMessageLength[s]/4294967296>>>0),r.fullMessageLength[s]=r.fullMessageLength[s]>>>0,o[0]=o[1]/4294967296>>>0;return t.putBytes(i),Mt(e,a,t),(t.read>2048||0===t.length())&&t.compact(),r},r.digest=function(){var i=Ut.util.createBuffer();i.putBytes(t.bytes());var n,o=r.fullMessageLength[r.fullMessageLength.length-1]+r.messageLengthSize&r.blockLength-1;i.putBytes(Pt.substr(0,r.blockLength-o));for(var s=8*r.fullMessageLength[0],u=0;u<r.fullMessageLength.length-1;++u)s+=(n=8*r.fullMessageLength[u+1])/4294967296>>>0,i.putInt32(s>>>0),s=n>>>0;i.putInt32(s);var c={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4};Mt(c,a,i);var l=Ut.util.createBuffer();return l.putInt32(c.h0),l.putInt32(c.h1),l.putInt32(c.h2),l.putInt32(c.h3),l.putInt32(c.h4),l},r};var Pt=null,Vt=!1;function Mt(e,t,a){for(var r,i,n,o,s,u,c,l=a.length();l>=64;){for(i=e.h0,n=e.h1,o=e.h2,s=e.h3,u=e.h4,c=0;c<16;++c)r=a.getInt32(),t[c]=r,r=(i<<5|i>>>27)+(s^n&(o^s))+u+1518500249+r,u=s,s=o,o=(n<<30|n>>>2)>>>0,n=i,i=r;for(;c<20;++c)r=(r=t[c-3]^t[c-8]^t[c-14]^t[c-16])<<1|r>>>31,t[c]=r,r=(i<<5|i>>>27)+(s^n&(o^s))+u+1518500249+r,u=s,s=o,o=(n<<30|n>>>2)>>>0,n=i,i=r;for(;c<32;++c)r=(r=t[c-3]^t[c-8]^t[c-14]^t[c-16])<<1|r>>>31,t[c]=r,r=(i<<5|i>>>27)+(n^o^s)+u+1859775393+r,u=s,s=o,o=(n<<30|n>>>2)>>>0,n=i,i=r;for(;c<40;++c)r=(r=t[c-6]^t[c-16]^t[c-28]^t[c-32])<<2|r>>>30,t[c]=r,r=(i<<5|i>>>27)+(n^o^s)+u+1859775393+r,u=s,s=o,o=(n<<30|n>>>2)>>>0,n=i,i=r;for(;c<60;++c)r=(r=t[c-6]^t[c-16]^t[c-28]^t[c-32])<<2|r>>>30,t[c]=r,r=(i<<5|i>>>27)+(n&o|s&(n^o))+u+2400959708+r,u=s,s=o,o=(n<<30|n>>>2)>>>0,n=i,i=r;for(;c<80;++c)r=(r=t[c-6]^t[c-16]^t[c-28]^t[c-32])<<2|r>>>30,t[c]=r,r=(i<<5|i>>>27)+(n^o^s)+u+3395469782+r,u=s,s=o,o=(n<<30|n>>>2)>>>0,n=i,i=r;e.h0=e.h0+i|0,e.h1=e.h1+n|0,e.h2=e.h2+o|0,e.h3=e.h3+s|0,e.h4=e.h4+u|0,l-=64}}var Kt=S,Ft=Kt.pkcs1=Kt.pkcs1||{};function qt(e,t,a){a||(a=Kt.md.sha1.create());for(var r="",i=Math.ceil(t/a.digestLength),n=0;n<i;++n){var o=String.fromCharCode(n>>24&255,n>>16&255,n>>8&255,255&n);a.start(),a.update(e+o),r+=a.digest().getBytes()}return r.substring(0,t)}Ft.encode_rsa_oaep=function(e,t,a){var r,i,n,o;"string"==typeof a?(r=a,i=arguments[3]||void 0,n=arguments[4]||void 0):a&&(r=a.label||void 0,i=a.seed||void 0,n=a.md||void 0,a.mgf1&&a.mgf1.md&&(o=a.mgf1.md)),n?n.start():n=Kt.md.sha1.create(),o||(o=n);var s=Math.ceil(e.n.bitLength()/8),u=s-2*n.digestLength-2;if(t.length>u)throw(m=new Error("RSAES-OAEP input message length is too long.")).length=t.length,m.maxLength=u,m;r||(r=""),n.update(r,"raw");for(var c=n.digest(),l="",p=u-t.length,h=0;h<p;h++)l+="\0";var d=c.getBytes()+l+""+t;if(i){if(i.length!==n.digestLength){var m;throw(m=new Error("Invalid RSAES-OAEP seed. The seed length must match the digest length.")).seedLength=i.length,m.digestLength=n.digestLength,m}}else i=Kt.random.getBytes(n.digestLength);var f=qt(i,s-n.digestLength-1,o),g=Kt.util.xorBytes(d,f,d.length),y=qt(g,n.digestLength,o);return"\0"+Kt.util.xorBytes(i,y,i.length)+g},Ft.decode_rsa_oaep=function(e,t,a){var r,i,n;"string"==typeof a?(r=a,i=arguments[3]||void 0):a&&(r=a.label||void 0,i=a.md||void 0,a.mgf1&&a.mgf1.md&&(n=a.mgf1.md));var o=Math.ceil(e.n.bitLength()/8);if(t.length!==o)throw(f=new Error("RSAES-OAEP encoded message length is invalid.")).length=t.length,f.expectedLength=o,f;if(void 0===i?i=Kt.md.sha1.create():i.start(),n||(n=i),o<2*i.digestLength+2)throw new Error("RSAES-OAEP key is too short for the hash function.");r||(r=""),i.update(r,"raw");for(var s=i.digest().getBytes(),u=t.charAt(0),c=t.substring(1,i.digestLength+1),l=t.substring(1+i.digestLength),p=qt(l,i.digestLength,n),h=qt(Kt.util.xorBytes(c,p,c.length),o-i.digestLength-1,n),d=Kt.util.xorBytes(l,h,l.length),m=d.substring(0,i.digestLength),f="\0"!==u,g=0;g<i.digestLength;++g)f|=s.charAt(g)!==m.charAt(g);for(var y=1,k=i.digestLength,v=i.digestLength;v<d.length;v++){var b=d.charCodeAt(v);f|=b&(y?65534:0),k+=y&=1&b^1}if(f||1!==d.charCodeAt(k))throw new Error("Invalid RSAES-OAEP padding.");return d.substring(k+1)};var Ht=S;!function(){if(Ht.prime)Ht.prime;else{var e=Ht.prime=Ht.prime||{},t=Ht.jsbn.BigInteger,a=[6,4,2,4,2,4,6,2],r=new t(null);r.fromInt(30);var i=function(e,t){return e|t};e.generateProbablePrime=function(e,a,r){"function"==typeof a&&(r=a,a={});var i=(a=a||{}).algorithm||"PRIMEINC";"string"==typeof i&&(i={name:i}),i.options=i.options||{};var o=a.prng||Ht.random,u={nextBytes:function(e){for(var t=o.getBytesSync(e.length),a=0;a<e.length;++a)e[a]=t.charCodeAt(a)}};if("PRIMEINC"===i.name)return function(e,a,r,i){if("workers"in r)return function(e,a,r,i){if("undefined"==typeof Worker)return n(e,a,r,i);var o=s(e,a),u=r.workers,c=r.workLoad||100,l=30*c/8,p=r.workerScript||"forge/prime.worker.js";if(-1===u)return Ht.util.estimateCores((function(e,t){e&&(t=2),u=t-1,h()}));function h(){u=Math.max(1,u);for(var r=[],n=0;n<u;++n)r[n]=new Worker(p);for(n=0;n<u;++n)r[n].addEventListener("message",d);var h=!1;function d(n){if(!h){var u=n.data;if(u.found){for(var p=0;p<r.length;++p)r[p].terminate();return h=!0,i(null,new t(u.prime,16))}o.bitLength()>e&&(o=s(e,a));var d=o.toString(16);n.target.postMessage({hex:d,workLoad:c}),o.dAddOffset(l,0)}}}h()}(e,a,r,i);return n(e,a,r,i)}(e,u,i.options,r);throw new Error("Invalid prime generation algorithm: "+i.name)}}function n(e,t,a,r){var i=s(e,t),n=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 a&&(n=a.millerRabinTests);var u=10;"maxBlockTime"in a&&(u=a.maxBlockTime),o(i,e,t,0,n,u,r)}function o(e,t,r,i,n,u,c){var l=+new Date;do{if(e.bitLength()>t&&(e=s(t,r)),e.isProbablePrime(n))return c(null,e);e.dAddOffset(a[i++%8],0)}while(u<0||+new Date-l<u);Ht.util.setImmediate((function(){o(e,t,r,i,n,u,c)}))}function s(e,a){var n=new t(e,a),o=e-1;return n.testBit(o)||n.bitwiseTo(t.ONE.shiftLeft(o),i,n),n.dAddOffset(31-n.mod(r).byteValue(),0),n}}();var Gt=S;if(void 0===Wt)var Wt=Gt.jsbn.BigInteger;var Qt=Gt.util.isNodejs?s:null,Yt=Gt.asn1,Zt=Gt.util;Gt.pki=Gt.pki||{},Gt.pki.rsa=Gt.rsa=Gt.rsa||{};var Xt=Gt.pki,$t=[6,4,2,4,2,4,6,2],Jt={name:"PrivateKeyInfo",tagClass:Yt.Class.UNIVERSAL,type:Yt.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:Yt.Class.UNIVERSAL,type:Yt.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:Yt.Class.UNIVERSAL,type:Yt.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:Yt.Class.UNIVERSAL,type:Yt.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:Yt.Class.UNIVERSAL,type:Yt.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},ea={name:"RSAPrivateKey",tagClass:Yt.Class.UNIVERSAL,type:Yt.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:Yt.Class.UNIVERSAL,type:Yt.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",tagClass:Yt.Class.UNIVERSAL,type:Yt.Type.INTEGER,constructed:!1,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",tagClass:Yt.Class.UNIVERSAL,type:Yt.Type.INTEGER,constructed:!1,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",tagClass:Yt.Class.UNIVERSAL,type:Yt.Type.INTEGER,constructed:!1,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",tagClass:Yt.Class.UNIVERSAL,type:Yt.Type.INTEGER,constructed:!1,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",tagClass:Yt.Class.UNIVERSAL,type:Yt.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:Yt.Class.UNIVERSAL,type:Yt.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:Yt.Class.UNIVERSAL,type:Yt.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:Yt.Class.UNIVERSAL,type:Yt.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},ta={name:"RSAPublicKey",tagClass:Yt.Class.UNIVERSAL,type:Yt.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:Yt.Class.UNIVERSAL,type:Yt.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:Yt.Class.UNIVERSAL,type:Yt.Type.INTEGER,constructed:!1,capture:"publicKeyExponent"}]},aa=Gt.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:Yt.Class.UNIVERSAL,type:Yt.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:Yt.Class.UNIVERSAL,type:Yt.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:Yt.Class.UNIVERSAL,type:Yt.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:Yt.Class.UNIVERSAL,type:Yt.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:Yt.Class.UNIVERSAL,type:Yt.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},ra=function(e){var t;if(!(e.algorithm in Xt.oids)){var a=new Error("Unknown message digest algorithm.");throw a.algorithm=e.algorithm,a}t=Xt.oids[e.algorithm];var r=Yt.oidToDer(t).getBytes(),i=Yt.create(Yt.Class.UNIVERSAL,Yt.Type.SEQUENCE,!0,[]),n=Yt.create(Yt.Class.UNIVERSAL,Yt.Type.SEQUENCE,!0,[]);n.value.push(Yt.create(Yt.Class.UNIVERSAL,Yt.Type.OID,!1,r)),n.value.push(Yt.create(Yt.Class.UNIVERSAL,Yt.Type.NULL,!1,""));var o=Yt.create(Yt.Class.UNIVERSAL,Yt.Type.OCTETSTRING,!1,e.digest().getBytes());return i.value.push(n),i.value.push(o),Yt.toDer(i).getBytes()},ia=function(e,t,a){if(a)return e.modPow(t.e,t.n);if(!t.p||!t.q)return e.modPow(t.d,t.n);var r;t.dP||(t.dP=t.d.mod(t.p.subtract(Wt.ONE))),t.dQ||(t.dQ=t.d.mod(t.q.subtract(Wt.ONE))),t.qInv||(t.qInv=t.q.modInverse(t.p));do{r=new Wt(Gt.util.bytesToHex(Gt.random.getBytes(t.n.bitLength()/8)),16)}while(r.compareTo(t.n)>=0||!r.gcd(t.n).equals(Wt.ONE));for(var i=(e=e.multiply(r.modPow(t.e,t.n)).mod(t.n)).mod(t.p).modPow(t.dP,t.p),n=e.mod(t.q).modPow(t.dQ,t.q);i.compareTo(n)<0;)i=i.add(t.p);var o=i.subtract(n).multiply(t.qInv).mod(t.p).multiply(t.q).add(n);return o=o.multiply(r.modInverse(t.n)).mod(t.n)};function na(e,t,a){var r=Gt.util.createBuffer(),i=Math.ceil(t.n.bitLength()/8);if(e.length>i-11){var n=new Error("Message is too long for PKCS#1 v1.5 padding.");throw n.length=e.length,n.max=i-11,n}r.putByte(0),r.putByte(a);var o,s=i-3-e.length;if(0===a||1===a){o=0===a?0:255;for(var u=0;u<s;++u)r.putByte(o)}else for(;s>0;){var c=0,l=Gt.random.getBytes(s);for(u=0;u<s;++u)0===(o=l.charCodeAt(u))?++c:r.putByte(o);s=c}return r.putByte(0),r.putBytes(e),r}function oa(e,t,a,r){var i=Math.ceil(t.n.bitLength()/8),n=Gt.util.createBuffer(e),o=n.getByte(),s=n.getByte();if(0!==o||a&&0!==s&&1!==s||!a&&2!=s||a&&0===s&&void 0===r)throw new Error("Encryption block is invalid.");var u=0;if(0===s){u=i-3-r;for(var c=0;c<u;++c)if(0!==n.getByte())throw new Error("Encryption block is invalid.")}else if(1===s)for(u=0;n.length()>1;){if(255!==n.getByte()){--n.read;break}++u}else if(2===s)for(u=0;n.length()>1;){if(0===n.getByte()){--n.read;break}++u}if(0!==n.getByte()||u!==i-3-n.length())throw new Error("Encryption block is invalid.");return n.getBytes()}function sa(e){var t=e.toString(16);t[0]>="8"&&(t="00"+t);var a=Gt.util.hexToBytes(t);return a.length>1&&(0===a.charCodeAt(0)&&0==(128&a.charCodeAt(1))||255===a.charCodeAt(0)&&128==(128&a.charCodeAt(1)))?a.substr(1):a}function ua(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 ca(e){return Gt.util.isNodejs&&"function"==typeof Qt[e]}function la(e){return void 0!==Zt.globalScope&&"object"==typeof Zt.globalScope.crypto&&"object"==typeof Zt.globalScope.crypto.subtle&&"function"==typeof Zt.globalScope.crypto.subtle[e]}function pa(e){return void 0!==Zt.globalScope&&"object"==typeof Zt.globalScope.msCrypto&&"object"==typeof Zt.globalScope.msCrypto.subtle&&"function"==typeof Zt.globalScope.msCrypto.subtle[e]}function ha(e){for(var t=Gt.util.hexToBytes(e.toString(16)),a=new Uint8Array(t.length),r=0;r<t.length;++r)a[r]=t.charCodeAt(r);return a}Xt.rsa.encrypt=function(e,t,a){var r,i=a,n=Math.ceil(t.n.bitLength()/8);!1!==a&&!0!==a?(i=2===a,r=na(e,t,a)):(r=Gt.util.createBuffer()).putBytes(e);for(var o=new Wt(r.toHex(),16),s=ia(o,t,i).toString(16),u=Gt.util.createBuffer(),c=n-Math.ceil(s.length/2);c>0;)u.putByte(0),--c;return u.putBytes(Gt.util.hexToBytes(s)),u.getBytes()},Xt.rsa.decrypt=function(e,t,a,r){var i=Math.ceil(t.n.bitLength()/8);if(e.length!==i){var n=new Error("Encrypted message length is invalid.");throw n.length=e.length,n.expected=i,n}var o=new Wt(Gt.util.createBuffer(e).toHex(),16);if(o.compareTo(t.n)>=0)throw new Error("Encrypted message is invalid.");for(var s=ia(o,t,a).toString(16),u=Gt.util.createBuffer(),c=i-Math.ceil(s.length/2);c>0;)u.putByte(0),--c;return u.putBytes(Gt.util.hexToBytes(s)),!1!==r?oa(u.getBytes(),t,a):u.getBytes()},Xt.rsa.createKeyPairGenerationState=function(e,t,a){"string"==typeof e&&(e=parseInt(e,10)),e=e||2048;var r,i=(a=a||{}).prng||Gt.random,n={nextBytes:function(e){for(var t=i.getBytesSync(e.length),a=0;a<e.length;++a)e[a]=t.charCodeAt(a)}},o=a.algorithm||"PRIMEINC";if("PRIMEINC"!==o)throw new Error("Invalid key generation algorithm: "+o);return(r={algorithm:o,state:0,bits:e,rng:n,eInt:t||65537,e:new Wt(null),p:null,q:null,qBits:e>>1,pBits:e-(e>>1),pqState:0,num:null,keys:null}).e.fromInt(r.eInt),r},Xt.rsa.stepKeyPairGenerationState=function(e,t){"algorithm"in e||(e.algorithm="PRIMEINC");var a=new Wt(null);a.fromInt(30);for(var r,i=0,n=function(e,t){return e|t},o=+new Date,s=0;null===e.keys&&(t<=0||s<t);){if(0===e.state){var u=null===e.p?e.pBits:e.qBits,c=u-1;0===e.pqState?(e.num=new Wt(u,e.rng),e.num.testBit(c)||e.num.bitwiseTo(Wt.ONE.shiftLeft(c),n,e.num),e.num.dAddOffset(31-e.num.mod(a).byteValue(),0),i=0,++e.pqState):1===e.pqState?e.num.bitLength()>u?e.pqState=0:e.num.isProbablePrime(ua(e.num.bitLength()))?++e.pqState:e.num.dAddOffset($t[i++%8],0):2===e.pqState?e.pqState=0===e.num.subtract(Wt.ONE).gcd(e.e).compareTo(Wt.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(Wt.ONE),e.q1=e.q.subtract(Wt.ONE),e.phi=e.p1.multiply(e.q1),++e.state;else if(3===e.state)0===e.phi.gcd(e.e).compareTo(Wt.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 l=e.e.modInverse(e.phi);e.keys={privateKey:Xt.rsa.setPrivateKey(e.n,e.e,l,e.p,e.q,l.mod(e.p1),l.mod(e.q1),e.q.modInverse(e.p)),publicKey:Xt.rsa.setPublicKey(e.n,e.e)}}s+=(r=+new Date)-o,o=r}return null!==e.keys},Xt.rsa.generateKeyPair=function(e,t,a,r){if(1===arguments.length?"object"==typeof e?(a=e,e=void 0):"function"==typeof e&&(r=e,e=void 0):2===arguments.length?"number"==typeof e?"function"==typeof t?(r=t,t=void 0):"number"!=typeof t&&(a=t,t=void 0):(a=e,r=t,e=void 0,t=void 0):3===arguments.length&&("number"==typeof t?"function"==typeof a&&(r=a,a=void 0):(r=a,a=t,t=void 0)),a=a||{},void 0===e&&(e=a.bits||2048),void 0===t&&(t=a.e||65537),!Gt.options.usePureJavaScript&&!a.prng&&e>=256&&e<=16384&&(65537===t||3===t))if(r){if(ca("generateKeyPair"))return Qt.generateKeyPair("rsa",{modulusLength:e,publicExponent:t,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}},(function(e,t,a){if(e)return r(e);r(null,{privateKey:Xt.privateKeyFromPem(a),publicKey:Xt.publicKeyFromPem(t)})}));if(la("generateKey")&&la("exportKey"))return Zt.globalScope.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:e,publicExponent:ha(t),hash:{name:"SHA-256"}},!0,["sign","verify"]).then((function(e){return Zt.globalScope.crypto.subtle.exportKey("pkcs8",e.privateKey)})).then(void 0,(function(e){r(e)})).then((function(e){if(e){var t=Xt.privateKeyFromAsn1(Yt.fromDer(Gt.util.createBuffer(e)));r(null,{privateKey:t,publicKey:Xt.setRsaPublicKey(t.n,t.e)})}}));if(pa("generateKey")&&pa("exportKey")){var i=Zt.globalScope.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:e,publicExponent:ha(t),hash:{name:"SHA-256"}},!0,["sign","verify"]);return i.oncomplete=function(e){var t=e.target.result,a=Zt.globalScope.msCrypto.subtle.exportKey("pkcs8",t.privateKey);a.oncomplete=function(e){var t=e.target.result,a=Xt.privateKeyFromAsn1(Yt.fromDer(Gt.util.createBuffer(t)));r(null,{privateKey:a,publicKey:Xt.setRsaPublicKey(a.n,a.e)})},a.onerror=function(e){r(e)}},void(i.onerror=function(e){r(e)})}}else if(ca("generateKeyPairSync")){var n=Qt.generateKeyPairSync("rsa",{modulusLength:e,publicExponent:t,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});return{privateKey:Xt.privateKeyFromPem(n.privateKey),publicKey:Xt.publicKeyFromPem(n.publicKey)}}var o=Xt.rsa.createKeyPairGenerationState(e,t,a);if(!r)return Xt.rsa.stepKeyPairGenerationState(o,0),o.keys;!function(e,t,a){"function"==typeof t&&(a=t,t={});t=t||{};var r={algorithm:{name:t.algorithm||"PRIMEINC",options:{workers:t.workers||2,workLoad:t.workLoad||100,workerScript:t.workerScript}}};"prng"in t&&(r.prng=t.prng);function i(){n(e.pBits,(function(t,r){return t?a(t):(e.p=r,null!==e.q?o(t,e.q):void n(e.qBits,o))}))}function n(e,t){Gt.prime.generateProbablePrime(e,r,t)}function o(t,r){if(t)return a(t);if(e.q=r,e.p.compareTo(e.q)<0){var s=e.p;e.p=e.q,e.q=s}if(0!==e.p.subtract(Wt.ONE).gcd(e.e).compareTo(Wt.ONE))return e.p=null,void i();if(0!==e.q.subtract(Wt.ONE).gcd(e.e).compareTo(Wt.ONE))return e.q=null,void n(e.qBits,o);if(e.p1=e.p.subtract(Wt.ONE),e.q1=e.q.subtract(Wt.ONE),e.phi=e.p1.multiply(e.q1),0!==e.phi.gcd(e.e).compareTo(Wt.ONE))return e.p=e.q=null,void i();if(e.n=e.p.multiply(e.q),e.n.bitLength()!==e.bits)return e.q=null,void n(e.qBits,o);var u=e.e.modInverse(e.phi);e.keys={privateKey:Xt.rsa.setPrivateKey(e.n,e.e,u,e.p,e.q,u.mod(e.p1),u.mod(e.q1),e.q.modInverse(e.p)),publicKey:Xt.rsa.setPublicKey(e.n,e.e)},a(null,e.keys)}i()}(o,a,r)},Xt.setRsaPublicKey=Xt.rsa.setPublicKey=function(e,t){var a={n:e,e:t,encrypt:function(e,t,r){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,a){return na(e,t,2).getBytes()}};else if("RSA-OAEP"===t||"RSAES-OAEP"===t)t={encode:function(e,t){return Gt.pkcs1.encode_rsa_oaep(t,e,r)}};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 i=t.encode(e,a,!0);return Xt.rsa.encrypt(i,a,!0)},verify:function(e,t,r){"string"==typeof r?r=r.toUpperCase():void 0===r&&(r="RSASSA-PKCS1-V1_5"),"RSASSA-PKCS1-V1_5"===r?r={verify:function(e,t){return t=oa(t,a,!0),e===Yt.fromDer(t).value[1].value}}:"NONE"!==r&&"NULL"!==r&&null!==r||(r={verify:function(e,t){return e===(t=oa(t,a,!0))}});var i=Xt.rsa.decrypt(t,a,!0,!1);return r.verify(e,i,a.n.bitLength())}};return a},Xt.setRsaPrivateKey=Xt.rsa.setPrivateKey=function(e,t,a,r,i,n,o,s){var u={n:e,e:t,d:a,p:r,q:i,dP:n,dQ:o,qInv:s,decrypt:function(e,t,a){"string"==typeof t?t=t.toUpperCase():void 0===t&&(t="RSAES-PKCS1-V1_5");var r=Xt.rsa.decrypt(e,u,!1,!1);if("RSAES-PKCS1-V1_5"===t)t={decode:oa};else if("RSA-OAEP"===t||"RSAES-OAEP"===t)t={decode:function(e,t){return Gt.pkcs1.decode_rsa_oaep(t,e,a)}};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(r,u,!1)},sign:function(e,t){var a=!1;"string"==typeof t&&(t=t.toUpperCase()),void 0===t||"RSASSA-PKCS1-V1_5"===t?(t={encode:ra},a=1):"NONE"!==t&&"NULL"!==t&&null!==t||(t={encode:function(){return e}},a=1);var r=t.encode(e,u.n.bitLength());return Xt.rsa.encrypt(r,u,a)}};return u},Xt.wrapRsaPrivateKey=function(e){return Yt.create(Yt.Class.UNIVERSAL,Yt.Type.SEQUENCE,!0,[Yt.create(Yt.Class.UNIVERSAL,Yt.Type.INTEGER,!1,Yt.integerToDer(0).getBytes()),Yt.create(Yt.Class.UNIVERSAL,Yt.Type.SEQUENCE,!0,[Yt.create(Yt.Class.UNIVERSAL,Yt.Type.OID,!1,Yt.oidToDer(Xt.oids.rsaEncryption).getBytes()),Yt.create(Yt.Class.UNIVERSAL,Yt.Type.NULL,!1,"")]),Yt.create(Yt.Class.UNIVERSAL,Yt.Type.OCTETSTRING,!1,Yt.toDer(e).getBytes())])},Xt.privateKeyFromAsn1=function(e){var t,a,r,i,n,o,s,u,c={},l=[];if(Yt.validate(e,Jt,c,l)&&(e=Yt.fromDer(Gt.util.createBuffer(c.privateKey))),c={},l=[],!Yt.validate(e,ea,c,l)){var p=new Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey.");throw p.errors=l,p}return t=Gt.util.createBuffer(c.privateKeyModulus).toHex(),a=Gt.util.createBuffer(c.privateKeyPublicExponent).toHex(),r=Gt.util.createBuffer(c.privateKeyPrivateExponent).toHex(),i=Gt.util.createBuffer(c.privateKeyPrime1).toHex(),n=Gt.util.createBuffer(c.privateKeyPrime2).toHex(),o=Gt.util.createBuffer(c.privateKeyExponent1).toHex(),s=Gt.util.createBuffer(c.privateKeyExponent2).toHex(),u=Gt.util.createBuffer(c.privateKeyCoefficient).toHex(),Xt.setRsaPrivateKey(new Wt(t,16),new Wt(a,16),new Wt(r,16),new Wt(i,16),new Wt(n,16),new Wt(o,16),new Wt(s,16),new Wt(u,16))},Xt.privateKeyToAsn1=Xt.privateKeyToRSAPrivateKey=function(e){return Yt.create(Yt.Class.UNIVERSAL,Yt.Type.SEQUENCE,!0,[Yt.create(Yt.Class.UNIVERSAL,Yt.Type.INTEGER,!1,Yt.integerToDer(0).getBytes()),Yt.create(Yt.Class.UNIVERSAL,Yt.Type.INTEGER,!1,sa(e.n)),Yt.create(Yt.Class.UNIVERSAL,Yt.Type.INTEGER,!1,sa(e.e)),Yt.create(Yt.Class.UNIVERSAL,Yt.Type.INTEGER,!1,sa(e.d)),Yt.create(Yt.Class.UNIVERSAL,Yt.Type.INTEGER,!1,sa(e.p)),Yt.create(Yt.Class.UNIVERSAL,Yt.Type.INTEGER,!1,sa(e.q)),Yt.create(Yt.Class.UNIVERSAL,Yt.Type.INTEGER,!1,sa(e.dP)),Yt.create(Yt.Class.UNIVERSAL,Yt.Type.INTEGER,!1,sa(e.dQ)),Yt.create(Yt.Class.UNIVERSAL,Yt.Type.INTEGER,!1,sa(e.qInv))])},Xt.publicKeyFromAsn1=function(e){var t={},a=[];if(Yt.validate(e,aa,t,a)){var r,i=Yt.derToOid(t.publicKeyOid);if(i!==Xt.oids.rsaEncryption)throw(r=new Error("Cannot read public key. Unknown OID.")).oid=i,r;e=t.rsaPublicKey}if(a=[],!Yt.validate(e,ta,t,a))throw(r=new Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey.")).errors=a,r;var n=Gt.util.createBuffer(t.publicKeyModulus).toHex(),o=Gt.util.createBuffer(t.publicKeyExponent).toHex();return Xt.setRsaPublicKey(new Wt(n,16),new Wt(o,16))},Xt.publicKeyToAsn1=Xt.publicKeyToSubjectPublicKeyInfo=function(e){return Yt.create(Yt.Class.UNIVERSAL,Yt.Type.SEQUENCE,!0,[Yt.create(Yt.Class.UNIVERSAL,Yt.Type.SEQUENCE,!0,[Yt.create(Yt.Class.UNIVERSAL,Yt.Type.OID,!1,Yt.oidToDer(Xt.oids.rsaEncryption).getBytes()),Yt.create(Yt.Class.UNIVERSAL,Yt.Type.NULL,!1,"")]),Yt.create(Yt.Class.UNIVERSAL,Yt.Type.BITSTRING,!1,[Xt.publicKeyToRSAPublicKey(e)])])},Xt.publicKeyToRSAPublicKey=function(e){return Yt.create(Yt.Class.UNIVERSAL,Yt.Type.SEQUENCE,!0,[Yt.create(Yt.Class.UNIVERSAL,Yt.Type.INTEGER,!1,sa(e.n)),Yt.create(Yt.Class.UNIVERSAL,Yt.Type.INTEGER,!1,sa(e.e))])};var da=S;if(void 0===ma)var ma=da.jsbn.BigInteger;var fa=da.asn1,ga=da.pki=da.pki||{};ga.pbe=da.pbe=da.pbe||{};var ya=ga.oids,ka={name:"EncryptedPrivateKeyInfo",tagClass:fa.Class.UNIVERSAL,type:fa.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedPrivateKeyInfo.encryptionAlgorithm",tagClass:fa.Class.UNIVERSAL,type:fa.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:fa.Class.UNIVERSAL,type:fa.Type.OID,constructed:!1,capture:"encryptionOid"},{name:"AlgorithmIdentifier.parameters",tagClass:fa.Class.UNIVERSAL,type:fa.Type.SEQUENCE,constructed:!0,captureAsn1:"encryptionParams"}]},{name:"EncryptedPrivateKeyInfo.encryptedData",tagClass:fa.Class.UNIVERSAL,type:fa.Type.OCTETSTRING,constructed:!1,capture:"encryptedData"}]},va={name:"PBES2Algorithms",tagClass:fa.Class.UNIVERSAL,type:fa.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc",tagClass:fa.Class.UNIVERSAL,type:fa.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc.oid",tagClass:fa.Class.UNIVERSAL,type:fa.Type.OID,constructed:!1,capture:"kdfOid"},{name:"PBES2Algorithms.params",tagClass:fa.Class.UNIVERSAL,type:fa.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.params.salt",tagClass:fa.Class.UNIVERSAL,type:fa.Type.OCTETSTRING,constructed:!1,capture:"kdfSalt"},{name:"PBES2Algorithms.params.iterationCount",tagClass:fa.Class.UNIVERSAL,type:fa.Type.INTEGER,constructed:!1,capture:"kdfIterationCount"},{name:"PBES2Algorithms.params.keyLength",tagClass:fa.Class.UNIVERSAL,type:fa.Type.INTEGER,constructed:!1,optional:!0,capture:"keyLength"},{name:"PBES2Algorithms.params.prf",tagClass:fa.Class.UNIVERSAL,type:fa.Type.SEQUENCE,constructed:!0,optional:!0,value:[{name:"PBES2Algorithms.params.prf.algorithm",tagClass:fa.Class.UNIVERSAL,type:fa.Type.OID,constructed:!1,capture:"prfOid"}]}]}]},{name:"PBES2Algorithms.encryptionScheme",tagClass:fa.Class.UNIVERSAL,type:fa.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.encryptionScheme.oid",tagClass:fa.Class.UNIVERSAL,type:fa.Type.OID,constructed:!1,capture:"encOid"},{name:"PBES2Algorithms.encryptionScheme.iv",tagClass:fa.Class.UNIVERSAL,type:fa.Type.OCTETSTRING,constructed:!1,capture:"encIv"}]}]},ba={name:"pkcs-12PbeParams",tagClass:fa.Class.UNIVERSAL,type:fa.Type.SEQUENCE,constructed:!0,value:[{name:"pkcs-12PbeParams.salt",tagClass:fa.Class.UNIVERSAL,type:fa.Type.OCTETSTRING,constructed:!1,capture:"salt"},{name:"pkcs-12PbeParams.iterations",tagClass:fa.Class.UNIVERSAL,type:fa.Type.INTEGER,constructed:!1,capture:"iterations"}]};function wa(e,t){return e.start().update(t).digest().getBytes()}function ja(e){var t;if(e){if(!(t=ga.oids[fa.derToOid(e)])){var a=new Error("Unsupported PRF OID.");throw a.oid=e,a.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],a}}else t="hmacWithSHA1";return Ca(t)}function Ca(e){var t=da.md;switch(e){case"hmacWithSHA224":t=da.md.sha512;case"hmacWithSHA1":case"hmacWithSHA256":case"hmacWithSHA384":case"hmacWithSHA512":e=e.substr(8).toLowerCase();break;default:var a=new Error("Unsupported PRF algorithm.");throw a.algorithm=e,a.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],a}if(!t||!(e in t))throw new Error("Unknown hash algorithm: "+e);return t[e].create()}ga.encryptPrivateKeyInfo=function(e,t,a){(a=a||{}).saltSize=a.saltSize||8,a.count=a.count||2048,a.algorithm=a.algorithm||"aes128",a.prfAlgorithm=a.prfAlgorithm||"sha1";var r,i,n,o=da.random.getBytesSync(a.saltSize),s=a.count,u=fa.integerToDer(s);if(0===a.algorithm.indexOf("aes")||"des"===a.algorithm){var c,l,p;switch(a.algorithm){case"aes128":r=16,c=16,l=ya["aes128-CBC"],p=da.aes.createEncryptionCipher;break;case"aes192":r=24,c=16,l=ya["aes192-CBC"],p=da.aes.createEncryptionCipher;break;case"aes256":r=32,c=16,l=ya["aes256-CBC"],p=da.aes.createEncryptionCipher;break;case"des":r=8,c=8,l=ya.desCBC,p=da.des.createEncryptionCipher;break;default:throw(y=new Error("Cannot encrypt private key. Unknown encryption algorithm.")).algorithm=a.algorithm,y}var h="hmacWith"+a.prfAlgorithm.toUpperCase(),d=Ca(h),m=da.pkcs5.pbkdf2(t,o,s,r,d),f=da.random.getBytesSync(c);(k=p(m)).start(f),k.update(fa.toDer(e)),k.finish(),n=k.output.getBytes();var g=function(e,t,a,r){var i=fa.create(fa.Class.UNIVERSAL,fa.Type.SEQUENCE,!0,[fa.create(fa.Class.UNIVERSAL,fa.Type.OCTETSTRING,!1,e),fa.create(fa.Class.UNIVERSAL,fa.Type.INTEGER,!1,t.getBytes())]);"hmacWithSHA1"!==r&&i.value.push(fa.create(fa.Class.UNIVERSAL,fa.Type.INTEGER,!1,da.util.hexToBytes(a.toString(16))),fa.create(fa.Class.UNIVERSAL,fa.Type.SEQUENCE,!0,[fa.create(fa.Class.UNIVERSAL,fa.Type.OID,!1,fa.oidToDer(ga.oids[r]).getBytes()),fa.create(fa.Class.UNIVERSAL,fa.Type.NULL,!1,"")]));return i}(o,u,r,h);i=fa.create(fa.Class.UNIVERSAL,fa.Type.SEQUENCE,!0,[fa.create(fa.Class.UNIVERSAL,fa.Type.OID,!1,fa.oidToDer(ya.pkcs5PBES2).getBytes()),fa.create(fa.Class.UNIVERSAL,fa.Type.SEQUENCE,!0,[fa.create(fa.Class.UNIVERSAL,fa.Type.SEQUENCE,!0,[fa.create(fa.Class.UNIVERSAL,fa.Type.OID,!1,fa.oidToDer(ya.pkcs5PBKDF2).getBytes()),g]),fa.create(fa.Class.UNIVERSAL,fa.Type.SEQUENCE,!0,[fa.create(fa.Class.UNIVERSAL,fa.Type.OID,!1,fa.oidToDer(l).getBytes()),fa.create(fa.Class.UNIVERSAL,fa.Type.OCTETSTRING,!1,f)])])])}else{var y;if("3des"!==a.algorithm)throw(y=new Error("Cannot encrypt private key. Unknown encryption algorithm.")).algorithm=a.algorithm,y;r=24;var k,v=new da.util.ByteBuffer(o);m=ga.pbe.generatePkcs12Key(t,v,1,s,r),f=ga.pbe.generatePkcs12Key(t,v,2,s,r);(k=da.des.createEncryptionCipher(m)).start(f),k.update(fa.toDer(e)),k.finish(),n=k.output.getBytes(),i=fa.create(fa.Class.UNIVERSAL,fa.Type.SEQUENCE,!0,[fa.create(fa.Class.UNIVERSAL,fa.Type.OID,!1,fa.oidToDer(ya["pbeWithSHAAnd3-KeyTripleDES-CBC"]).getBytes()),fa.create(fa.Class.UNIVERSAL,fa.Type.SEQUENCE,!0,[fa.create(fa.Class.UNIVERSAL,fa.Type.OCTETSTRING,!1,o),fa.create(fa.Class.UNIVERSAL,fa.Type.INTEGER,!1,u.getBytes())])])}return fa.create(fa.Class.UNIVERSAL,fa.Type.SEQUENCE,!0,[i,fa.create(fa.Class.UNIVERSAL,fa.Type.OCTETSTRING,!1,n)])},ga.decryptPrivateKeyInfo=function(e,t){var a=null,r={},i=[];if(!fa.validate(e,ka,r,i)){var n=new Error("Cannot read encrypted private key. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw n.errors=i,n}var o=fa.derToOid(r.encryptionOid),s=ga.pbe.getCipher(o,r.encryptionParams,t),u=da.util.createBuffer(r.encryptedData);return s.update(u),s.finish()&&(a=fa.fromDer(s.output)),a},ga.encryptedPrivateKeyToPem=function(e,t){var a={type:"ENCRYPTED PRIVATE KEY",body:fa.toDer(e).getBytes()};return da.pem.encode(a,{maxline:t})},ga.encryptedPrivateKeyFromPem=function(e){var t=da.pem.decode(e)[0];if("ENCRYPTED PRIVATE KEY"!==t.type){var a=new Error('Could not convert encrypted private key from PEM; PEM header type is "ENCRYPTED PRIVATE KEY".');throw a.headerType=t.type,a}if(t.procType&&"ENCRYPTED"===t.procType.type)throw new Error("Could not convert encrypted private key from PEM; PEM is encrypted.");return fa.fromDer(t.body)},ga.encryptRsaPrivateKey=function(e,t,a){if(!(a=a||{}).legacy){var r=ga.wrapRsaPrivateKey(ga.privateKeyToAsn1(e));return r=ga.encryptPrivateKeyInfo(r,t,a),ga.encryptedPrivateKeyToPem(r)}var i,n,o,s;switch(a.algorithm){case"aes128":i="AES-128-CBC",o=16,n=da.random.getBytesSync(16),s=da.aes.createEncryptionCipher;break;case"aes192":i="AES-192-CBC",o=24,n=da.random.getBytesSync(16),s=da.aes.createEncryptionCipher;break;case"aes256":i="AES-256-CBC",o=32,n=da.random.getBytesSync(16),s=da.aes.createEncryptionCipher;break;case"3des":i="DES-EDE3-CBC",o=24,n=da.random.getBytesSync(8),s=da.des.createEncryptionCipher;break;case"des":i="DES-CBC",o=8,n=da.random.getBytesSync(8),s=da.des.createEncryptionCipher;break;default:var u=new Error('Could not encrypt RSA private key; unsupported encryption algorithm "'+a.algorithm+'".');throw u.algorithm=a.algorithm,u}var c=s(da.pbe.opensslDeriveBytes(t,n.substr(0,8),o));c.start(n),c.update(fa.toDer(ga.privateKeyToAsn1(e))),c.finish();var l={type:"RSA PRIVATE KEY",procType:{version:"4",type:"ENCRYPTED"},dekInfo:{algorithm:i,parameters:da.util.bytesToHex(n).toUpperCase()},body:c.output.getBytes()};return da.pem.encode(l)},ga.decryptRsaPrivateKey=function(e,t){var a=null,r=da.pem.decode(e)[0];if("ENCRYPTED PRIVATE KEY"!==r.type&&"PRIVATE KEY"!==r.type&&"RSA PRIVATE KEY"!==r.type)throw(o=new Error('Could not convert private key from PEM; PEM header type is not "ENCRYPTED PRIVATE KEY", "PRIVATE KEY", or "RSA PRIVATE KEY".')).headerType=o,o;if(r.procType&&"ENCRYPTED"===r.procType.type){var i,n;switch(r.dekInfo.algorithm){case"DES-CBC":i=8,n=da.des.createDecryptionCipher;break;case"DES-EDE3-CBC":i=24,n=da.des.createDecryptionCipher;break;case"AES-128-CBC":i=16,n=da.aes.createDecryptionCipher;break;case"AES-192-CBC":i=24,n=da.aes.createDecryptionCipher;break;case"AES-256-CBC":i=32,n=da.aes.createDecryptionCipher;break;case"RC2-40-CBC":i=5,n=function(e){return da.rc2.createDecryptionCipher(e,40)};break;case"RC2-64-CBC":i=8,n=function(e){return da.rc2.createDecryptionCipher(e,64)};break;case"RC2-128-CBC":i=16,n=function(e){return da.rc2.createDecryptionCipher(e,128)};break;default:var o;throw(o=new Error('Could not decrypt private key; unsupported encryption algorithm "'+r.dekInfo.algorithm+'".')).algorithm=r.dekInfo.algorithm,o}var s=da.util.hexToBytes(r.dekInfo.parameters),u=n(da.pbe.opensslDeriveBytes(t,s.substr(0,8),i));if(u.start(s),u.update(da.util.createBuffer(r.body)),!u.finish())return a;a=u.output.getBytes()}else a=r.body;return null!==(a="ENCRYPTED PRIVATE KEY"===r.type?ga.decryptPrivateKeyInfo(fa.fromDer(a),t):fa.fromDer(a))&&(a=ga.privateKeyFromAsn1(a)),a},ga.pbe.generatePkcs12Key=function(e,t,a,r,i,n){var o,s;if(null==n){if(!("sha1"in da.md))throw new Error('"sha1" hash algorithm unavailable.');n=da.md.sha1.create()}var u=n.digestLength,c=n.blockLength,l=new da.util.ByteBuffer,p=new da.util.ByteBuffer;if(null!=e){for(s=0;s<e.length;s++)p.putInt16(e.charCodeAt(s));p.putInt16(0)}var h=p.length(),d=t.length(),m=new da.util.ByteBuffer;m.fillWithByte(a,c);var f=c*Math.ceil(d/c),g=new da.util.ByteBuffer;for(s=0;s<f;s++)g.putByte(t.at(s%d));var y=c*Math.ceil(h/c),k=new da.util.ByteBuffer;for(s=0;s<y;s++)k.putByte(p.at(s%h));var v=g;v.putBuffer(k);for(var b=Math.ceil(i/u),w=1;w<=b;w++){var j=new da.util.ByteBuffer;j.putBytes(m.bytes()),j.putBytes(v.bytes());for(var C=0;C<r;C++)n.start(),n.update(j.getBytes()),j=n.digest();var E=new da.util.ByteBuffer;for(s=0;s<c;s++)E.putByte(j.at(s%u));var S=Math.ceil(d/c)+Math.ceil(h/c),T=new da.util.ByteBuffer;for(o=0;o<S;o++){var _=new da.util.ByteBuffer(v.getBytes(c)),I=511;for(s=E.length()-1;s>=0;s--)I>>=8,I+=E.at(s)+_.at(s),_.setAt(s,255&I);T.putBuffer(_)}v=T,l.putBuffer(j)}return l.truncate(l.length()-i),l},ga.pbe.getCipher=function(e,t,a){switch(e){case ga.oids.pkcs5PBES2:return ga.pbe.getCipherForPBES2(e,t,a);case ga.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case ga.oids["pbewithSHAAnd40BitRC2-CBC"]:return ga.pbe.getCipherForPKCS12PBE(e,t,a);default:var r=new Error("Cannot read encrypted PBE data block. Unsupported OID.");throw r.oid=e,r.supportedOids=["pkcs5PBES2","pbeWithSHAAnd3-KeyTripleDES-CBC","pbewithSHAAnd40BitRC2-CBC"],r}},ga.pbe.getCipherForPBES2=function(e,t,a){var r,i={},n=[];if(!fa.validate(t,va,i,n))throw(r=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.")).errors=n,r;if((e=fa.derToOid(i.kdfOid))!==ga.oids.pkcs5PBKDF2)throw(r=new Error("Cannot read encrypted private key. Unsupported key derivation function OID.")).oid=e,r.supportedOids=["pkcs5PBKDF2"],r;if((e=fa.derToOid(i.encOid))!==ga.oids["aes128-CBC"]&&e!==ga.oids["aes192-CBC"]&&e!==ga.oids["aes256-CBC"]&&e!==ga.oids["des-EDE3-CBC"]&&e!==ga.oids.desCBC)throw(r=new Error("Cannot read encrypted private key. Unsupported encryption scheme OID.")).oid=e,r.supportedOids=["aes128-CBC","aes192-CBC","aes256-CBC","des-EDE3-CBC","desCBC"],r;var o,s,u=i.kdfSalt,c=da.util.createBuffer(i.kdfIterationCount);switch(c=c.getInt(c.length()<<3),ga.oids[e]){case"aes128-CBC":o=16,s=da.aes.createDecryptionCipher;break;case"aes192-CBC":o=24,s=da.aes.createDecryptionCipher;break;case"aes256-CBC":o=32,s=da.aes.createDecryptionCipher;break;case"des-EDE3-CBC":o=24,s=da.des.createDecryptionCipher;break;case"desCBC":o=8,s=da.des.createDecryptionCipher}var l=ja(i.prfOid),p=da.pkcs5.pbkdf2(a,u,c,o,l),h=i.encIv,d=s(p);return d.start(h),d},ga.pbe.getCipherForPKCS12PBE=function(e,t,a){var r={},i=[];if(!fa.validate(t,ba,r,i))throw(l=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.")).errors=i,l;var n,o,s,u=da.util.createBuffer(r.salt),c=da.util.createBuffer(r.iterations);switch(c=c.getInt(c.length()<<3),e){case ga.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:n=24,o=8,s=da.des.startDecrypting;break;case ga.oids["pbewithSHAAnd40BitRC2-CBC"]:n=5,o=8,s=function(e,t){var a=da.rc2.createDecryptionCipher(e,40);return a.start(t,null),a};break;default:var l;throw(l=new Error("Cannot read PKCS #12 PBE data block. Unsupported OID.")).oid=e,l}var p=ja(r.prfOid),h=ga.pbe.generatePkcs12Key(a,u,1,c,n,p);return p.start(),s(h,ga.pbe.generatePkcs12Key(a,u,2,c,o,p))},ga.pbe.opensslDeriveBytes=function(e,t,a,r){if(null==r){if(!("md5"in da.md))throw new Error('"md5" hash algorithm unavailable.');r=da.md.md5.create()}null===t&&(t="");for(var i=[wa(r,e+t)],n=16,o=1;n<a;++o,n+=16)i.push(wa(r,i[o-1]+e+t));return i.join("").substr(0,a)};var Ea=S,Sa=Ea.asn1,Ta=Ea.pkcs7asn1=Ea.pkcs7asn1||{};Ea.pkcs7=Ea.pkcs7||{},Ea.pkcs7.asn1=Ta;var _a={name:"ContentInfo",tagClass:Sa.Class.UNIVERSAL,type:Sa.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.ContentType",tagClass:Sa.Class.UNIVERSAL,type:Sa.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:Sa.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,captureAsn1:"content"}]};Ta.contentInfoValidator=_a;var Ia={name:"EncryptedContentInfo",tagClass:Sa.Class.UNIVERSAL,type:Sa.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentType",tagClass:Sa.Class.UNIVERSAL,type:Sa.Type.OID,constructed:!1,capture:"contentType"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm",tagClass:Sa.Class.UNIVERSAL,type:Sa.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentEncryptionAlgorithm.algorithm",tagClass:Sa.Class.UNIVERSAL,type:Sa.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm.parameter",tagClass:Sa.Class.UNIVERSAL,captureAsn1:"encParameter"}]},{name:"EncryptedContentInfo.encryptedContent",tagClass:Sa.Class.CONTEXT_SPECIFIC,type:0,capture:"encryptedContent",captureAsn1:"encryptedContentAsn1"}]};Ta.envelopedDataValidator={name:"EnvelopedData",tagClass:Sa.Class.UNIVERSAL,type:Sa.Type.SEQUENCE,constructed:!0,value:[{name:"EnvelopedData.Version",tagClass:Sa.Class.UNIVERSAL,type:Sa.Type.INTEGER,constructed:!1,capture:"version"},{name:"EnvelopedData.RecipientInfos",tagClass:Sa.Class.UNIVERSAL,type:Sa.Type.SET,constructed:!0,captureAsn1:"recipientInfos"}].concat(Ia)},Ta.encryptedDataValidator={name:"EncryptedData",tagClass:Sa.Class.UNIVERSAL,type:Sa.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedData.Version",tagClass:Sa.Class.UNIVERSAL,type:Sa.Type.INTEGER,constructed:!1,capture:"version"}].concat(Ia)};var Aa={name:"SignerInfo",tagClass:Sa.Class.UNIVERSAL,type:Sa.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.version",tagClass:Sa.Class.UNIVERSAL,type:Sa.Type.INTEGER,constructed:!1},{name:"SignerInfo.issuerAndSerialNumber",tagClass:Sa.Class.UNIVERSAL,type:Sa.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.issuerAndSerialNumber.issuer",tagClass:Sa.Class.UNIVERSAL,type:Sa.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"SignerInfo.issuerAndSerialNumber.serialNumber",tagClass:Sa.Class.UNIVERSAL,type:Sa.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"SignerInfo.digestAlgorithm",tagClass:Sa.Class.UNIVERSAL,type:Sa.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.digestAlgorithm.algorithm",tagClass:Sa.Class.UNIVERSAL,type:Sa.Type.OID,constructed:!1,capture:"digestAlgorithm"},{name:"SignerInfo.digestAlgorithm.parameter",tagClass:Sa.Class.UNIVERSAL,constructed:!1,captureAsn1:"digestParameter",optional:!0}]},{name:"SignerInfo.authenticatedAttributes",tagClass:Sa.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"authenticatedAttributes"},{name:"SignerInfo.digestEncryptionAlgorithm",tagClass:Sa.Class.UNIVERSAL,type:Sa.Type.SEQUENCE,constructed:!0,capture:"signatureAlgorithm"},{name:"SignerInfo.encryptedDigest",tagClass:Sa.Class.UNIVERSAL,type:Sa.Type.OCTETSTRING,constructed:!1,capture:"signature"},{name:"SignerInfo.unauthenticatedAttributes",tagClass:Sa.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,capture:"unauthenticatedAttributes"}]};Ta.signedDataValidator={name:"SignedData",tagClass:Sa.Class.UNIVERSAL,type:Sa.Type.SEQUENCE,constructed:!0,value:[{name:"SignedData.Version",tagClass:Sa.Class.UNIVERSAL,type:Sa.Type.INTEGER,constructed:!1,capture:"version"},{name:"SignedData.DigestAlgorithms",tagClass:Sa.Class.UNIVERSAL,type:Sa.Type.SET,constructed:!0,captureAsn1:"digestAlgorithms"},_a,{name:"SignedData.Certificates",tagClass:Sa.Class.CONTEXT_SPECIFIC,type:0,optional:!0,captureAsn1:"certificates"},{name:"SignedData.CertificateRevocationLists",tagClass:Sa.Class.CONTEXT_SPECIFIC,type:1,optional:!0,captureAsn1:"crls"},{name:"SignedData.SignerInfos",tagClass:Sa.Class.UNIVERSAL,type:Sa.Type.SET,capture:"signerInfos",optional:!0,value:[Aa]}]},Ta.recipientInfoValidator={name:"RecipientInfo",tagClass:Sa.Class.UNIVERSAL,type:Sa.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.version",tagClass:Sa.Class.UNIVERSAL,type:Sa.Type.INTEGER,constructed:!1,capture:"version"},{name:"RecipientInfo.issuerAndSerial",tagClass:Sa.Class.UNIVERSAL,type:Sa.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.issuerAndSerial.issuer",tagClass:Sa.Class.UNIVERSAL,type:Sa.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"RecipientInfo.issuerAndSerial.serialNumber",tagClass:Sa.Class.UNIVERSAL,type:Sa.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"RecipientInfo.keyEncryptionAlgorithm",tagClass:Sa.Class.UNIVERSAL,type:Sa.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.keyEncryptionAlgorithm.algorithm",tagClass:Sa.Class.UNIVERSAL,type:Sa.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"RecipientInfo.keyEncryptionAlgorithm.parameter",tagClass:Sa.Class.UNIVERSAL,constructed:!1,captureAsn1:"encParameter"}]},{name:"RecipientInfo.encryptedKey",tagClass:Sa.Class.UNIVERSAL,type:Sa.Type.OCTETSTRING,constructed:!1,capture:"encKey"}]};var Ba=S;Ba.mgf=Ba.mgf||{},(Ba.mgf.mgf1=Ba.mgf1=Ba.mgf1||{}).create=function(e){var t={generate:function(t,a){for(var r=new Ba.util.ByteBuffer,i=Math.ceil(a/e.digestLength),n=0;n<i;n++){var o=new Ba.util.ByteBuffer;o.putInt32(n),e.start(),e.update(t+o.getBytes()),r.putBuffer(e.digest())}return r.truncate(r.length()-a),r.getBytes()}};return t};var Na=S;Na.mgf=Na.mgf||{},Na.mgf.mgf1=Na.mgf1;var Ra=S;(Ra.pss=Ra.pss||{}).create=function(e){3===arguments.length&&(e={md:arguments[0],mgf:arguments[1],saltLength:arguments[2]});var t,a=e.md,r=e.mgf,i=a.digestLength,n=e.salt||null;if("string"==typeof n&&(n=Ra.util.createBuffer(n)),"saltLength"in e)t=e.saltLength;else{if(null===n)throw new Error("Salt length not specified or specific salt not given.");t=n.length()}if(null!==n&&n.length()!==t)throw new Error("Given salt length does not match length of given salt.");var o=e.prng||Ra.random,s={encode:function(e,s){var u,c,l=s-1,p=Math.ceil(l/8),h=e.digest().getBytes();if(p<i+t+2)throw new Error("Message is too long to encrypt.");c=null===n?o.getBytesSync(t):n.bytes();var d=new Ra.util.ByteBuffer;d.fillWithByte(0,8),d.putBytes(h),d.putBytes(c),a.start(),a.update(d.getBytes());var m=a.digest().getBytes(),f=new Ra.util.ByteBuffer;f.fillWithByte(0,p-t-i-2),f.putByte(1),f.putBytes(c);var g=f.getBytes(),y=p-i-1,k=r.generate(m,y),v="";for(u=0;u<y;u++)v+=String.fromCharCode(g.charCodeAt(u)^k.charCodeAt(u));var b=65280>>8*p-l&255;return(v=String.fromCharCode(v.charCodeAt(0)&~b)+v.substr(1))+m+String.fromCharCode(188)},verify:function(e,n,o){var s,u=o-1,c=Math.ceil(u/8);if(n=n.substr(-c),c<i+t+2)throw new Error("Inconsistent parameters to PSS signature verification.");if(188!==n.charCodeAt(c-1))throw new Error("Encoded message does not end in 0xBC.");var l=c-i-1,p=n.substr(0,l),h=n.substr(l,i),d=65280>>8*c-u&255;if(0!=(p.charCodeAt(0)&d))throw new Error("Bits beyond keysize not zero as expected.");var m=r.generate(h,l),f="";for(s=0;s<l;s++)f+=String.fromCharCode(p.charCodeAt(s)^m.charCodeAt(s));f=String.fromCharCode(f.charCodeAt(0)&~d)+f.substr(1);var g=c-i-t-2;for(s=0;s<g;s++)if(0!==f.charCodeAt(s))throw new Error("Leftmost octets not zero as expected");if(1!==f.charCodeAt(g))throw new Error("Inconsistent PSS signature, 0x01 marker not found");var y=f.substr(-t),k=new Ra.util.ByteBuffer;return k.fillWithByte(0,8),k.putBytes(e),k.putBytes(y),a.start(),a.update(k.getBytes()),h===a.digest().getBytes()}};return s};var za=S,La=za.asn1,xa=za.pki=za.pki||{},Da=xa.oids,Ua={};Ua.CN=Da.commonName,Ua.commonName="CN",Ua.C=Da.countryName,Ua.countryName="C",Ua.L=Da.localityName,Ua.localityName="L",Ua.ST=Da.stateOrProvinceName,Ua.stateOrProvinceName="ST",Ua.O=Da.organizationName,Ua.organizationName="O",Ua.OU=Da.organizationalUnitName,Ua.organizationalUnitName="OU",Ua.E=Da.emailAddress,Ua.emailAddress="E";var Oa=za.pki.rsa.publicKeyValidator,Pa={name:"Certificate",tagClass:La.Class.UNIVERSAL,type:La.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate",tagClass:La.Class.UNIVERSAL,type:La.Type.SEQUENCE,constructed:!0,captureAsn1:"tbsCertificate",value:[{name:"Certificate.TBSCertificate.version",tagClass:La.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.version.integer",tagClass:La.Class.UNIVERSAL,type:La.Type.INTEGER,constructed:!1,capture:"certVersion"}]},{name:"Certificate.TBSCertificate.serialNumber",tagClass:La.Class.UNIVERSAL,type:La.Type.INTEGER,constructed:!1,capture:"certSerialNumber"},{name:"Certificate.TBSCertificate.signature",tagClass:La.Class.UNIVERSAL,type:La.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.signature.algorithm",tagClass:La.Class.UNIVERSAL,type:La.Type.OID,constructed:!1,capture:"certinfoSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:La.Class.UNIVERSAL,optional:!0,captureAsn1:"certinfoSignatureParams"}]},{name:"Certificate.TBSCertificate.issuer",tagClass:La.Class.UNIVERSAL,type:La.Type.SEQUENCE,constructed:!0,captureAsn1:"certIssuer"},{name:"Certificate.TBSCertificate.validity",tagClass:La.Class.UNIVERSAL,type:La.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.validity.notBefore (utc)",tagClass:La.Class.UNIVERSAL,type:La.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity1UTCTime"},{name:"Certificate.TBSCertificate.validity.notBefore (generalized)",tagClass:La.Class.UNIVERSAL,type:La.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity2GeneralizedTime"},{name:"Certificate.TBSCertificate.validity.notAfter (utc)",tagClass:La.Class.UNIVERSAL,type:La.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity3UTCTime"},{name:"Certificate.TBSCertificate.validity.notAfter (generalized)",tagClass:La.Class.UNIVERSAL,type:La.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity4GeneralizedTime"}]},{name:"Certificate.TBSCertificate.subject",tagClass:La.Class.UNIVERSAL,type:La.Type.SEQUENCE,constructed:!0,captureAsn1:"certSubject"},Oa,{name:"Certificate.TBSCertificate.issuerUniqueID",tagClass:La.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.issuerUniqueID.id",tagClass:La.Class.UNIVERSAL,type:La.Type.BITSTRING,constructed:!1,captureBitStringValue:"certIssuerUniqueId"}]},{name:"Certificate.TBSCertificate.subjectUniqueID",tagClass:La.Class.CONTEXT_SPECIFIC,type:2,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.subjectUniqueID.id",tagClass:La.Class.UNIVERSAL,type:La.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSubjectUniqueId"}]},{name:"Certificate.TBSCertificate.extensions",tagClass:La.Class.CONTEXT_SPECIFIC,type:3,constructed:!0,captureAsn1:"certExtensions",optional:!0}]},{name:"Certificate.signatureAlgorithm",tagClass:La.Class.UNIVERSAL,type:La.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.signatureAlgorithm.algorithm",tagClass:La.Class.UNIVERSAL,type:La.Type.OID,constructed:!1,capture:"certSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:La.Class.UNIVERSAL,optional:!0,captureAsn1:"certSignatureParams"}]},{name:"Certificate.signatureValue",tagClass:La.Class.UNIVERSAL,type:La.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSignature"}]},Va={name:"rsapss",tagClass:La.Class.UNIVERSAL,type:La.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.hashAlgorithm",tagClass:La.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier",tagClass:La.Class.UNIVERSAL,type:La.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier.algorithm",tagClass:La.Class.UNIVERSAL,type:La.Type.OID,constructed:!1,capture:"hashOid"}]}]},{name:"rsapss.maskGenAlgorithm",tagClass:La.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier",tagClass:La.Class.UNIVERSAL,type:La.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.algorithm",tagClass:La.Class.UNIVERSAL,type:La.Type.OID,constructed:!1,capture:"maskGenOid"},{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params",tagClass:La.Class.UNIVERSAL,type:La.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params.algorithm",tagClass:La.Class.UNIVERSAL,type:La.Type.OID,constructed:!1,capture:"maskGenHashOid"}]}]}]},{name:"rsapss.saltLength",tagClass:La.Class.CONTEXT_SPECIFIC,type:2,optional:!0,value:[{name:"rsapss.saltLength.saltLength",tagClass:La.Class.UNIVERSAL,type:La.Class.INTEGER,constructed:!1,capture:"saltLength"}]},{name:"rsapss.trailerField",tagClass:La.Class.CONTEXT_SPECIFIC,type:3,optional:!0,value:[{name:"rsapss.trailer.trailer",tagClass:La.Class.UNIVERSAL,type:La.Class.INTEGER,constructed:!1,capture:"trailer"}]}]},Ma={name:"CertificationRequestInfo",tagClass:La.Class.UNIVERSAL,type:La.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfo",value:[{name:"CertificationRequestInfo.integer",tagClass:La.Class.UNIVERSAL,type:La.Type.INTEGER,constructed:!1,capture:"certificationRequestInfoVersion"},{name:"CertificationRequestInfo.subject",tagClass:La.Class.UNIVERSAL,type:La.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfoSubject"},Oa,{name:"CertificationRequestInfo.attributes",tagClass:La.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"certificationRequestInfoAttributes",value:[{name:"CertificationRequestInfo.attributes",tagClass:La.Class.UNIVERSAL,type:La.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequestInfo.attributes.type",tagClass:La.Class.UNIVERSAL,type:La.Type.OID,constructed:!1},{name:"CertificationRequestInfo.attributes.value",tagClass:La.Class.UNIVERSAL,type:La.Type.SET,constructed:!0}]}]}]},Ka={name:"CertificationRequest",tagClass:La.Class.UNIVERSAL,type:La.Type.SEQUENCE,constructed:!0,captureAsn1:"csr",value:[Ma,{name:"CertificationRequest.signatureAlgorithm",tagClass:La.Class.UNIVERSAL,type:La.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequest.signatureAlgorithm.algorithm",tagClass:La.Class.UNIVERSAL,type:La.Type.OID,constructed:!1,capture:"csrSignatureOid"},{name:"CertificationRequest.signatureAlgorithm.parameters",tagClass:La.Class.UNIVERSAL,optional:!0,captureAsn1:"csrSignatureParams"}]},{name:"CertificationRequest.signature",tagClass:La.Class.UNIVERSAL,type:La.Type.BITSTRING,constructed:!1,captureBitStringValue:"csrSignature"}]};function Fa(e,t){"string"==typeof t&&(t={shortName:t});for(var a,r=null,i=0;null===r&&i<e.attributes.length;++i)a=e.attributes[i],(t.type&&t.type===a.type||t.name&&t.name===a.name||t.shortName&&t.shortName===a.shortName)&&(r=a);return r}xa.RDNAttributesAsArray=function(e,t){for(var a,r,i,n=[],o=0;o<e.value.length;++o){a=e.value[o];for(var s=0;s<a.value.length;++s)i={},r=a.value[s],i.type=La.derToOid(r.value[0].value),i.value=r.value[1].value,i.valueTagClass=r.value[1].type,i.type in Da&&(i.name=Da[i.type],i.name in Ua&&(i.shortName=Ua[i.name])),t&&(t.update(i.type),t.update(i.value)),n.push(i)}return n},xa.CRIAttributesAsArray=function(e){for(var t=[],a=0;a<e.length;++a)for(var r=e[a],i=La.derToOid(r.value[0].value),n=r.value[1].value,o=0;o<n.length;++o){var s={};if(s.type=i,s.value=n[o].value,s.valueTagClass=n[o].type,s.type in Da&&(s.name=Da[s.type],s.name in Ua&&(s.shortName=Ua[s.name])),s.type===Da.extensionRequest){s.extensions=[];for(var u=0;u<s.value.length;++u)s.extensions.push(xa.certificateExtensionFromAsn1(s.value[u]))}t.push(s)}return t};var qa=function(e,t,a){var r={};if(e!==Da["RSASSA-PSS"])return r;a&&(r={hash:{algorithmOid:Da.sha1},mgf:{algorithmOid:Da.mgf1,hash:{algorithmOid:Da.sha1}},saltLength:20});var i={},n=[];if(!La.validate(t,Va,i,n)){var o=new Error("Cannot read RSASSA-PSS parameter block.");throw o.errors=n,o}return void 0!==i.hashOid&&(r.hash=r.hash||{},r.hash.algorithmOid=La.derToOid(i.hashOid)),void 0!==i.maskGenOid&&(r.mgf=r.mgf||{},r.mgf.algorithmOid=La.derToOid(i.maskGenOid),r.mgf.hash=r.mgf.hash||{},r.mgf.hash.algorithmOid=La.derToOid(i.maskGenHashOid)),void 0!==i.saltLength&&(r.saltLength=i.saltLength.charCodeAt(0)),r};function Ha(e){for(var t,a,r=La.create(La.Class.UNIVERSAL,La.Type.SEQUENCE,!0,[]),i=e.attributes,n=0;n<i.length;++n){var o=(t=i[n]).value,s=La.Type.PRINTABLESTRING;"valueTagClass"in t&&(s=t.valueTagClass)===La.Type.UTF8&&(o=za.util.encodeUtf8(o)),a=La.create(La.Class.UNIVERSAL,La.Type.SET,!0,[La.create(La.Class.UNIVERSAL,La.Type.SEQUENCE,!0,[La.create(La.Class.UNIVERSAL,La.Type.OID,!1,La.oidToDer(t.type).getBytes()),La.create(La.Class.UNIVERSAL,s,!1,o)])]),r.value.push(a)}return r}function Ga(e){for(var t,a=0;a<e.length;++a){if(void 0===(t=e[a]).name&&(t.type&&t.type in xa.oids?t.name=xa.oids[t.type]:t.shortName&&t.shortName in Ua&&(t.name=xa.oids[Ua[t.shortName]])),void 0===t.type){if(!t.name||!(t.name in xa.oids))throw(i=new Error("Attribute type not specified.")).attribute=t,i;t.type=xa.oids[t.name]}if(void 0===t.shortName&&t.name&&t.name in Ua&&(t.shortName=Ua[t.name]),t.type===Da.extensionRequest&&(t.valueConstructed=!0,t.valueTagClass=La.Type.SEQUENCE,!t.value&&t.extensions)){t.value=[];for(var r=0;r<t.extensions.length;++r)t.value.push(xa.certificateExtensionToAsn1(Wa(t.extensions[r])))}var i;if(void 0===t.value)throw(i=new Error("Attribute value not specified.")).attribute=t,i}}function Wa(e,t){if(t=t||{},void 0===e.name&&e.id&&e.id in xa.oids&&(e.name=xa.oids[e.id]),void 0===e.id){if(!e.name||!(e.name in xa.oids))throw(g=new Error("Extension ID not specified.")).extension=e,g;e.id=xa.oids[e.name]}if(void 0!==e.value)return e;if("keyUsage"===e.name){var a=0,r=0,i=0;e.digitalSignature&&(r|=128,a=7),e.nonRepudiation&&(r|=64,a=6),e.keyEncipherment&&(r|=32,a=5),e.dataEncipherment&&(r|=16,a=4),e.keyAgreement&&(r|=8,a=3),e.keyCertSign&&(r|=4,a=2),e.cRLSign&&(r|=2,a=1),e.encipherOnly&&(r|=1,a=0),e.decipherOnly&&(i|=128,a=7);var n=String.fromCharCode(a);0!==i?n+=String.fromCharCode(r)+String.fromCharCode(i):0!==r&&(n+=String.fromCharCode(r)),e.value=La.create(La.Class.UNIVERSAL,La.Type.BITSTRING,!1,n)}else if("basicConstraints"===e.name)e.value=La.create(La.Class.UNIVERSAL,La.Type.SEQUENCE,!0,[]),e.cA&&e.value.value.push(La.create(La.Class.UNIVERSAL,La.Type.BOOLEAN,!1,String.fromCharCode(255))),"pathLenConstraint"in e&&e.value.value.push(La.create(La.Class.UNIVERSAL,La.Type.INTEGER,!1,La.integerToDer(e.pathLenConstraint).getBytes()));else if("extKeyUsage"===e.name){e.value=La.create(La.Class.UNIVERSAL,La.Type.SEQUENCE,!0,[]);var o=e.value.value;for(var s in e)!0===e[s]&&(s in Da?o.push(La.create(La.Class.UNIVERSAL,La.Type.OID,!1,La.oidToDer(Da[s]).getBytes())):-1!==s.indexOf(".")&&o.push(La.create(La.Class.UNIVERSAL,La.Type.OID,!1,La.oidToDer(s).getBytes())))}else if("nsCertType"===e.name){a=0,r=0;e.client&&(r|=128,a=7),e.server&&(r|=64,a=6),e.email&&(r|=32,a=5),e.objsign&&(r|=16,a=4),e.reserved&&(r|=8,a=3),e.sslCA&&(r|=4,a=2),e.emailCA&&(r|=2,a=1),e.objCA&&(r|=1,a=0);n=String.fromCharCode(a);0!==r&&(n+=String.fromCharCode(r)),e.value=La.create(La.Class.UNIVERSAL,La.Type.BITSTRING,!1,n)}else if("subjectAltName"===e.name||"issuerAltName"===e.name){e.value=La.create(La.Class.UNIVERSAL,La.Type.SEQUENCE,!0,[]);for(var u=0;u<e.altNames.length;++u){n=(d=e.altNames[u]).value;if(7===d.type&&d.ip){if(null===(n=za.util.bytesFromIP(d.ip)))throw(g=new Error('Extension "ip" value is not a valid IPv4 or IPv6 address.')).extension=e,g}else 8===d.type&&(n=d.oid?La.oidToDer(La.oidToDer(d.oid)):La.oidToDer(n));e.value.value.push(La.create(La.Class.CONTEXT_SPECIFIC,d.type,!1,n))}}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=La.create(La.Class.UNIVERSAL,La.Type.IA5STRING,!1,e.comment)}else if("subjectKeyIdentifier"===e.name&&t.cert){var c=t.cert.generateSubjectKeyIdentifier();e.subjectKeyIdentifier=c.toHex(),e.value=La.create(La.Class.UNIVERSAL,La.Type.OCTETSTRING,!1,c.getBytes())}else if("authorityKeyIdentifier"===e.name&&t.cert){e.value=La.create(La.Class.UNIVERSAL,La.Type.SEQUENCE,!0,[]);o=e.value.value;if(e.keyIdentifier){var l=!0===e.keyIdentifier?t.cert.generateSubjectKeyIdentifier().getBytes():e.keyIdentifier;o.push(La.create(La.Class.CONTEXT_SPECIFIC,0,!1,l))}if(e.authorityCertIssuer){var p=[La.create(La.Class.CONTEXT_SPECIFIC,4,!0,[Ha(!0===e.authorityCertIssuer?t.cert.issuer:e.authorityCertIssuer)])];o.push(La.create(La.Class.CONTEXT_SPECIFIC,1,!0,p))}if(e.serialNumber){var h=za.util.hexToBytes(!0===e.serialNumber?t.cert.serialNumber:e.serialNumber);o.push(La.create(La.Class.CONTEXT_SPECIFIC,2,!1,h))}}else if("cRLDistributionPoints"===e.name){e.value=La.create(La.Class.UNIVERSAL,La.Type.SEQUENCE,!0,[]);o=e.value.value;var d,m=La.create(La.Class.UNIVERSAL,La.Type.SEQUENCE,!0,[]),f=La.create(La.Class.CONTEXT_SPECIFIC,0,!0,[]);for(u=0;u<e.altNames.length;++u){n=(d=e.altNames[u]).value;if(7===d.type&&d.ip){if(null===(n=za.util.bytesFromIP(d.ip)))throw(g=new Error('Extension "ip" value is not a valid IPv4 or IPv6 address.')).extension=e,g}else 8===d.type&&(n=d.oid?La.oidToDer(La.oidToDer(d.oid)):La.oidToDer(n));f.value.push(La.create(La.Class.CONTEXT_SPECIFIC,d.type,!1,n))}m.value.push(La.create(La.Class.CONTEXT_SPECIFIC,0,!0,[f])),o.push(m)}var g;if(void 0===e.value)throw(g=new Error("Extension value not specified.")).extension=e,g;return e}function Qa(e,t){if(e===Da["RSASSA-PSS"]){var a=[];return void 0!==t.hash.algorithmOid&&a.push(La.create(La.Class.CONTEXT_SPECIFIC,0,!0,[La.create(La.Class.UNIVERSAL,La.Type.SEQUENCE,!0,[La.create(La.Class.UNIVERSAL,La.Type.OID,!1,La.oidToDer(t.hash.algorithmOid).getBytes()),La.create(La.Class.UNIVERSAL,La.Type.NULL,!1,"")])])),void 0!==t.mgf.algorithmOid&&a.push(La.create(La.Class.CONTEXT_SPECIFIC,1,!0,[La.create(La.Class.UNIVERSAL,La.Type.SEQUENCE,!0,[La.create(La.Class.UNIVERSAL,La.Type.OID,!1,La.oidToDer(t.mgf.algorithmOid).getBytes()),La.create(La.Class.UNIVERSAL,La.Type.SEQUENCE,!0,[La.create(La.Class.UNIVERSAL,La.Type.OID,!1,La.oidToDer(t.mgf.hash.algorithmOid).getBytes()),La.create(La.Class.UNIVERSAL,La.Type.NULL,!1,"")])])])),void 0!==t.saltLength&&a.push(La.create(La.Class.CONTEXT_SPECIFIC,2,!0,[La.create(La.Class.UNIVERSAL,La.Type.INTEGER,!1,La.integerToDer(t.saltLength).getBytes())])),La.create(La.Class.UNIVERSAL,La.Type.SEQUENCE,!0,a)}return La.create(La.Class.UNIVERSAL,La.Type.NULL,!1,"")}function Ya(e){var t=La.create(La.Class.CONTEXT_SPECIFIC,0,!0,[]);if(0===e.attributes.length)return t;for(var a=e.attributes,r=0;r<a.length;++r){var i=a[r],n=i.value,o=La.Type.UTF8;"valueTagClass"in i&&(o=i.valueTagClass),o===La.Type.UTF8&&(n=za.util.encodeUtf8(n));var s=!1;"valueConstructed"in i&&(s=i.valueConstructed);var u=La.create(La.Class.UNIVERSAL,La.Type.SEQUENCE,!0,[La.create(La.Class.UNIVERSAL,La.Type.OID,!1,La.oidToDer(i.type).getBytes()),La.create(La.Class.UNIVERSAL,La.Type.SET,!0,[La.create(La.Class.UNIVERSAL,o,s,n)])]);t.value.push(u)}return t}xa.certificateFromPem=function(e,t,a){var r=za.pem.decode(e)[0];if("CERTIFICATE"!==r.type&&"X509 CERTIFICATE"!==r.type&&"TRUSTED CERTIFICATE"!==r.type){var i=new Error('Could not convert certificate from PEM; PEM header type is not "CERTIFICATE", "X509 CERTIFICATE", or "TRUSTED CERTIFICATE".');throw i.headerType=r.type,i}if(r.procType&&"ENCRYPTED"===r.procType.type)throw new Error("Could not convert certificate from PEM; PEM is encrypted.");var n=La.fromDer(r.body,a);return xa.certificateFromAsn1(n,t)},xa.certificateToPem=function(e,t){var a={type:"CERTIFICATE",body:La.toDer(xa.certificateToAsn1(e)).getBytes()};return za.pem.encode(a,{maxline:t})},xa.publicKeyFromPem=function(e){var t=za.pem.decode(e)[0];if("PUBLIC KEY"!==t.type&&"RSA PUBLIC KEY"!==t.type){var a=new Error('Could not convert public key from PEM; PEM header type is not "PUBLIC KEY" or "RSA PUBLIC KEY".');throw a.headerType=t.type,a}if(t.procType&&"ENCRYPTED"===t.procType.type)throw new Error("Could not convert public key from PEM; PEM is encrypted.");var r=La.fromDer(t.body);return xa.publicKeyFromAsn1(r)},xa.publicKeyToPem=function(e,t){var a={type:"PUBLIC KEY",body:La.toDer(xa.publicKeyToAsn1(e)).getBytes()};return za.pem.encode(a,{maxline:t})},xa.publicKeyToRSAPublicKeyPem=function(e,t){var a={type:"RSA PUBLIC KEY",body:La.toDer(xa.publicKeyToRSAPublicKey(e)).getBytes()};return za.pem.encode(a,{maxline:t})},xa.getPublicKeyFingerprint=function(e,t){var a,r=(t=t||{}).md||za.md.sha1.create();switch(t.type||"RSAPublicKey"){case"RSAPublicKey":a=La.toDer(xa.publicKeyToRSAPublicKey(e)).getBytes();break;case"SubjectPublicKeyInfo":a=La.toDer(xa.publicKeyToAsn1(e)).getBytes();break;default:throw new Error('Unknown fingerprint type "'+t.type+'".')}r.start(),r.update(a);var i=r.digest();if("hex"===t.encoding){var n=i.toHex();return t.delimiter?n.match(/.{2}/g).join(t.delimiter):n}if("binary"===t.encoding)return i.getBytes();if(t.encoding)throw new Error('Unknown encoding "'+t.encoding+'".');return i},xa.certificationRequestFromPem=function(e,t,a){var r=za.pem.decode(e)[0];if("CERTIFICATE REQUEST"!==r.type){var i=new Error('Could not convert certification request from PEM; PEM header type is not "CERTIFICATE REQUEST".');throw i.headerType=r.type,i}if(r.procType&&"ENCRYPTED"===r.procType.type)throw new Error("Could not convert certification request from PEM; PEM is encrypted.");var n=La.fromDer(r.body,a);return xa.certificationRequestFromAsn1(n,t)},xa.certificationRequestToPem=function(e,t){var a={type:"CERTIFICATE REQUEST",body:La.toDer(xa.certificationRequestToAsn1(e)).getBytes()};return za.pem.encode(a,{maxline:t})},xa.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 Fa(e.issuer,t)},e.issuer.addField=function(t){Ga([t]),e.issuer.attributes.push(t)},e.issuer.attributes=[],e.issuer.hash=null,e.subject={},e.subject.getField=function(t){return Fa(e.subject,t)},e.subject.addField=function(t){Ga([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,a){Ga(t),e.subject.attributes=t,delete e.subject.uniqueId,a&&(e.subject.uniqueId=a),e.subject.hash=null},e.setIssuer=function(t,a){Ga(t),e.issuer.attributes=t,delete e.issuer.uniqueId,a&&(e.issuer.uniqueId=a),e.issuer.hash=null},e.setExtensions=function(t){for(var a=0;a<t.length;++a)Wa(t[a],{cert:e});e.extensions=t},e.getExtension=function(t){"string"==typeof t&&(t={name:t});for(var a,r=null,i=0;null===r&&i<e.extensions.length;++i)a=e.extensions[i],(t.id&&a.id===t.id||t.name&&a.name===t.name)&&(r=a);return r},e.sign=function(t,a){e.md=a||za.md.sha1.create();var r=Da[e.md.algorithm+"WithRSAEncryption"];if(!r){var i=new Error("Could not compute certificate digest. Unknown message digest algorithm OID.");throw i.algorithm=e.md.algorithm,i}e.signatureOid=e.siginfo.algorithmOid=r,e.tbsCertificate=xa.getTBSCertificate(e);var n=La.toDer(e.tbsCertificate);e.md.update(n.getBytes()),e.signature=t.sign(e.md)},e.verify=function(t){var a=!1;if(!e.issued(t)){var r=t.issuer,i=e.subject;throw(p=new Error("The parent certificate did not issue the given child certificate; the child certificate's issuer does not match the parent's subject.")).expectedIssuer=r.attributes,p.actualIssuer=i.attributes,p}var n=t.md;if(null===n){if(t.signatureOid in Da)switch(Da[t.signatureOid]){case"sha1WithRSAEncryption":n=za.md.sha1.create();break;case"md5WithRSAEncryption":n=za.md.md5.create();break;case"sha256WithRSAEncryption":case"RSASSA-PSS":n=za.md.sha256.create();break;case"sha384WithRSAEncryption":n=za.md.sha384.create();break;case"sha512WithRSAEncryption":n=za.md.sha512.create()}if(null===n)throw(p=new Error("Could not compute certificate digest. Unknown signature OID.")).signatureOid=t.signatureOid,p;var o=t.tbsCertificate||xa.getTBSCertificate(t),s=La.toDer(o);n.update(s.getBytes())}if(null!==n){var u;switch(t.signatureOid){case Da.sha1WithRSAEncryption:u=void 0;break;case Da["RSASSA-PSS"]:var c,l,p;if(void 0===(c=Da[t.signatureParameters.mgf.hash.algorithmOid])||void 0===za.md[c])throw(p=new Error("Unsupported MGF hash function.")).oid=t.signatureParameters.mgf.hash.algorithmOid,p.name=c,p;if(void 0===(l=Da[t.signatureParameters.mgf.algorithmOid])||void 0===za.mgf[l])throw(p=new Error("Unsupported MGF function.")).oid=t.signatureParameters.mgf.algorithmOid,p.name=l,p;if(l=za.mgf[l].create(za.md[c].create()),void 0===(c=Da[t.signatureParameters.hash.algorithmOid])||void 0===za.md[c])throw{message:"Unsupported RSASSA-PSS hash function.",oid:t.signatureParameters.hash.algorithmOid,name:c};u=za.pss.create(za.md[c].create(),l,t.signatureParameters.saltLength)}a=e.publicKey.verify(n.digest().getBytes(),t.signature,u)}return a},e.isIssuer=function(t){var a=!1,r=e.issuer,i=t.subject;if(r.hash&&i.hash)a=r.hash===i.hash;else if(r.attributes.length===i.attributes.length){var n,o;a=!0;for(var s=0;a&&s<r.attributes.length;++s)n=r.attributes[s],o=i.attributes[s],n.type===o.type&&n.value===o.value||(a=!1)}return a},e.issued=function(t){return t.isIssuer(e)},e.generateSubjectKeyIdentifier=function(){return xa.getPublicKeyFingerprint(e.publicKey,{type:"RSAPublicKey"})},e.verifySubjectKeyIdentifier=function(){for(var t=Da.subjectKeyIdentifier,a=0;a<e.extensions.length;++a){var r=e.extensions[a];if(r.id===t){var i=e.generateSubjectKeyIdentifier().getBytes();return za.util.hexToBytes(r.subjectKeyIdentifier)===i}}return!1},e},xa.certificateFromAsn1=function(e,t){var a={},r=[];if(!La.validate(e,Pa,a,r))throw(s=new Error("Cannot read X.509 certificate. ASN.1 object is not an X509v3 Certificate.")).errors=r,s;if(La.derToOid(a.publicKeyOid)!==xa.oids.rsaEncryption)throw new Error("Cannot read public key. OID is not RSA.");var i=xa.createCertificate();i.version=a.certVersion?a.certVersion.charCodeAt(0):0;var n=za.util.createBuffer(a.certSerialNumber);i.serialNumber=n.toHex(),i.signatureOid=za.asn1.derToOid(a.certSignatureOid),i.signatureParameters=qa(i.signatureOid,a.certSignatureParams,!0),i.siginfo.algorithmOid=za.asn1.derToOid(a.certinfoSignatureOid),i.siginfo.parameters=qa(i.siginfo.algorithmOid,a.certinfoSignatureParams,!1),i.signature=a.certSignature;var o=[];if(void 0!==a.certValidity1UTCTime&&o.push(La.utcTimeToDate(a.certValidity1UTCTime)),void 0!==a.certValidity2GeneralizedTime&&o.push(La.generalizedTimeToDate(a.certValidity2GeneralizedTime)),void 0!==a.certValidity3UTCTime&&o.push(La.utcTimeToDate(a.certValidity3UTCTime)),void 0!==a.certValidity4GeneralizedTime&&o.push(La.generalizedTimeToDate(a.certValidity4GeneralizedTime)),o.length>2)throw new Error("Cannot read notBefore/notAfter validity times; more than two times were provided in the certificate.");if(o.length<2)throw new Error("Cannot read notBefore/notAfter validity times; they were not provided as either UTCTime or GeneralizedTime.");if(i.validity.notBefore=o[0],i.validity.notAfter=o[1],i.tbsCertificate=a.tbsCertificate,t){var s;if(i.md=null,i.signatureOid in Da)switch(Da[i.signatureOid]){case"sha1WithRSAEncryption":i.md=za.md.sha1.create();break;case"md5WithRSAEncryption":i.md=za.md.md5.create();break;case"sha256WithRSAEncryption":case"RSASSA-PSS":i.md=za.md.sha256.create();break;case"sha384WithRSAEncryption":i.md=za.md.sha384.create();break;case"sha512WithRSAEncryption":i.md=za.md.sha512.create()}if(null===i.md)throw(s=new Error("Could not compute certificate digest. Unknown signature OID.")).signatureOid=i.signatureOid,s;var u=La.toDer(i.tbsCertificate);i.md.update(u.getBytes())}var c=za.md.sha1.create();i.issuer.getField=function(e){return Fa(i.issuer,e)},i.issuer.addField=function(e){Ga([e]),i.issuer.attributes.push(e)},i.issuer.attributes=xa.RDNAttributesAsArray(a.certIssuer,c),a.certIssuerUniqueId&&(i.issuer.uniqueId=a.certIssuerUniqueId),i.issuer.hash=c.digest().toHex();var l=za.md.sha1.create();return i.subject.getField=function(e){return Fa(i.subject,e)},i.subject.addField=function(e){Ga([e]),i.subject.attributes.push(e)},i.subject.attributes=xa.RDNAttributesAsArray(a.certSubject,l),a.certSubjectUniqueId&&(i.subject.uniqueId=a.certSubjectUniqueId),i.subject.hash=l.digest().toHex(),a.certExtensions?i.extensions=xa.certificateExtensionsFromAsn1(a.certExtensions):i.extensions=[],i.publicKey=xa.publicKeyFromAsn1(a.subjectPublicKeyInfo),i},xa.certificateExtensionsFromAsn1=function(e){for(var t=[],a=0;a<e.value.length;++a)for(var r=e.value[a],i=0;i<r.value.length;++i)t.push(xa.certificateExtensionFromAsn1(r.value[i]));return t},xa.certificateExtensionFromAsn1=function(e){var t={};if(t.id=La.derToOid(e.value[0].value),t.critical=!1,e.value[1].type===La.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 Da)if(t.name=Da[t.id],"keyUsage"===t.name){var a=0,r=0;(n=La.fromDer(t.value)).value.length>1&&(a=n.value.charCodeAt(1),r=n.value.length>2?n.value.charCodeAt(2):0),t.digitalSignature=128==(128&a),t.nonRepudiation=64==(64&a),t.keyEncipherment=32==(32&a),t.dataEncipherment=16==(16&a),t.keyAgreement=8==(8&a),t.keyCertSign=4==(4&a),t.cRLSign=2==(2&a),t.encipherOnly=1==(1&a),t.decipherOnly=128==(128&r)}else if("basicConstraints"===t.name){(n=La.fromDer(t.value)).value.length>0&&n.value[0].type===La.Type.BOOLEAN?t.cA=0!==n.value[0].value.charCodeAt(0):t.cA=!1;var i=null;n.value.length>0&&n.value[0].type===La.Type.INTEGER?i=n.value[0].value:n.value.length>1&&(i=n.value[1].value),null!==i&&(t.pathLenConstraint=La.derToInteger(i))}else if("extKeyUsage"===t.name)for(var n=La.fromDer(t.value),o=0;o<n.value.length;++o){var s=La.derToOid(n.value[o].value);s in Da?t[Da[s]]=!0:t[s]=!0}else if("nsCertType"===t.name){a=0;(n=La.fromDer(t.value)).value.length>1&&(a=n.value.charCodeAt(1)),t.client=128==(128&a),t.server=64==(64&a),t.email=32==(32&a),t.objsign=16==(16&a),t.reserved=8==(8&a),t.sslCA=4==(4&a),t.emailCA=2==(2&a),t.objCA=1==(1&a)}else if("subjectAltName"===t.name||"issuerAltName"===t.name){var u;t.altNames=[];n=La.fromDer(t.value);for(var c=0;c<n.value.length;++c){var l={type:(u=n.value[c]).type,value:u.value};switch(t.altNames.push(l),u.type){case 1:case 2:case 6:break;case 7:l.ip=za.util.bytesToIP(u.value);break;case 8:l.oid=La.derToOid(u.value)}}}else if("subjectKeyIdentifier"===t.name){n=La.fromDer(t.value);t.subjectKeyIdentifier=za.util.bytesToHex(n.value)}return t},xa.certificationRequestFromAsn1=function(e,t){var a={},r=[];if(!La.validate(e,Ka,a,r))throw(n=new Error("Cannot read PKCS#10 certificate request. ASN.1 object is not a PKCS#10 CertificationRequest.")).errors=r,n;if(La.derToOid(a.publicKeyOid)!==xa.oids.rsaEncryption)throw new Error("Cannot read public key. OID is not RSA.");var i=xa.createCertificationRequest();if(i.version=a.csrVersion?a.csrVersion.charCodeAt(0):0,i.signatureOid=za.asn1.derToOid(a.csrSignatureOid),i.signatureParameters=qa(i.signatureOid,a.csrSignatureParams,!0),i.siginfo.algorithmOid=za.asn1.derToOid(a.csrSignatureOid),i.siginfo.parameters=qa(i.siginfo.algorithmOid,a.csrSignatureParams,!1),i.signature=a.csrSignature,i.certificationRequestInfo=a.certificationRequestInfo,t){var n;if(i.md=null,i.signatureOid in Da)switch(Da[i.signatureOid]){case"sha1WithRSAEncryption":i.md=za.md.sha1.create();break;case"md5WithRSAEncryption":i.md=za.md.md5.create();break;case"sha256WithRSAEncryption":case"RSASSA-PSS":i.md=za.md.sha256.create();break;case"sha384WithRSAEncryption":i.md=za.md.sha384.create();break;case"sha512WithRSAEncryption":i.md=za.md.sha512.create()}if(null===i.md)throw(n=new Error("Could not compute certification request digest. Unknown signature OID.")).signatureOid=i.signatureOid,n;var o=La.toDer(i.certificationRequestInfo);i.md.update(o.getBytes())}var s=za.md.sha1.create();return i.subject.getField=function(e){return Fa(i.subject,e)},i.subject.addField=function(e){Ga([e]),i.subject.attributes.push(e)},i.subject.attributes=xa.RDNAttributesAsArray(a.certificationRequestInfoSubject,s),i.subject.hash=s.digest().toHex(),i.publicKey=xa.publicKeyFromAsn1(a.subjectPublicKeyInfo),i.getAttribute=function(e){return Fa(i,e)},i.addAttribute=function(e){Ga([e]),i.attributes.push(e)},i.attributes=xa.CRIAttributesAsArray(a.certificationRequestInfoAttributes||[]),i},xa.createCertificationRequest=function(){var e={version:0,signatureOid:null,signature:null,siginfo:{}};return e.siginfo.algorithmOid=null,e.subject={},e.subject.getField=function(t){return Fa(e.subject,t)},e.subject.addField=function(t){Ga([t]),e.subject.attributes.push(t)},e.subject.attributes=[],e.subject.hash=null,e.publicKey=null,e.attributes=[],e.getAttribute=function(t){return Fa(e,t)},e.addAttribute=function(t){Ga([t]),e.attributes.push(t)},e.md=null,e.setSubject=function(t){Ga(t),e.subject.attributes=t,e.subject.hash=null},e.setAttributes=function(t){Ga(t),e.attributes=t},e.sign=function(t,a){e.md=a||za.md.sha1.create();var r=Da[e.md.algorithm+"WithRSAEncryption"];if(!r){var i=new Error("Could not compute certification request digest. Unknown message digest algorithm OID.");throw i.algorithm=e.md.algorithm,i}e.signatureOid=e.siginfo.algorithmOid=r,e.certificationRequestInfo=xa.getCertificationRequestInfo(e);var n=La.toDer(e.certificationRequestInfo);e.md.update(n.getBytes()),e.signature=t.sign(e.md)},e.verify=function(){var t=!1,a=e.md;if(null===a){if(e.signatureOid in Da)switch(Da[e.signatureOid]){case"sha1WithRSAEncryption":a=za.md.sha1.create();break;case"md5WithRSAEncryption":a=za.md.md5.create();break;case"sha256WithRSAEncryption":case"RSASSA-PSS":a=za.md.sha256.create();break;case"sha384WithRSAEncryption":a=za.md.sha384.create();break;case"sha512WithRSAEncryption":a=za.md.sha512.create()}if(null===a)throw(u=new Error("Could not compute certification request digest. Unknown signature OID.")).signatureOid=e.signatureOid,u;var r=e.certificationRequestInfo||xa.getCertificationRequestInfo(e),i=La.toDer(r);a.update(i.getBytes())}if(null!==a){var n;switch(e.signatureOid){case Da.sha1WithRSAEncryption:break;case Da["RSASSA-PSS"]:var o,s,u;if(void 0===(o=Da[e.signatureParameters.mgf.hash.algorithmOid])||void 0===za.md[o])throw(u=new Error("Unsupported MGF hash function.")).oid=e.signatureParameters.mgf.hash.algorithmOid,u.name=o,u;if(void 0===(s=Da[e.signatureParameters.mgf.algorithmOid])||void 0===za.mgf[s])throw(u=new Error("Unsupported MGF function.")).oid=e.signatureParameters.mgf.algorithmOid,u.name=s,u;if(s=za.mgf[s].create(za.md[o].create()),void 0===(o=Da[e.signatureParameters.hash.algorithmOid])||void 0===za.md[o])throw(u=new Error("Unsupported RSASSA-PSS hash function.")).oid=e.signatureParameters.hash.algorithmOid,u.name=o,u;n=za.pss.create(za.md[o].create(),s,e.signatureParameters.saltLength)}t=e.publicKey.verify(a.digest().getBytes(),e.signature,n)}return t},e};var Za=new Date("1950-01-01T00:00:00Z"),Xa=new Date("2050-01-01T00:00:00Z");function $a(e){return e>=Za&&e<Xa?La.create(La.Class.UNIVERSAL,La.Type.UTCTIME,!1,La.dateToUtcTime(e)):La.create(La.Class.UNIVERSAL,La.Type.GENERALIZEDTIME,!1,La.dateToGeneralizedTime(e))}xa.getTBSCertificate=function(e){var t=$a(e.validity.notBefore),a=$a(e.validity.notAfter),r=La.create(La.Class.UNIVERSAL,La.Type.SEQUENCE,!0,[La.create(La.Class.CONTEXT_SPECIFIC,0,!0,[La.create(La.Class.UNIVERSAL,La.Type.INTEGER,!1,La.integerToDer(e.version).getBytes())]),La.create(La.Class.UNIVERSAL,La.Type.INTEGER,!1,za.util.hexToBytes(e.serialNumber)),La.create(La.Class.UNIVERSAL,La.Type.SEQUENCE,!0,[La.create(La.Class.UNIVERSAL,La.Type.OID,!1,La.oidToDer(e.siginfo.algorithmOid).getBytes()),Qa(e.siginfo.algorithmOid,e.siginfo.parameters)]),Ha(e.issuer),La.create(La.Class.UNIVERSAL,La.Type.SEQUENCE,!0,[t,a]),Ha(e.subject),xa.publicKeyToAsn1(e.publicKey)]);return e.issuer.uniqueId&&r.value.push(La.create(La.Class.CONTEXT_SPECIFIC,1,!0,[La.create(La.Class.UNIVERSAL,La.Type.BITSTRING,!1,String.fromCharCode(0)+e.issuer.uniqueId)])),e.subject.uniqueId&&r.value.push(La.create(La.Class.CONTEXT_SPECIFIC,2,!0,[La.create(La.Class.UNIVERSAL,La.Type.BITSTRING,!1,String.fromCharCode(0)+e.subject.uniqueId)])),e.extensions.length>0&&r.value.push(xa.certificateExtensionsToAsn1(e.extensions)),r},xa.getCertificationRequestInfo=function(e){return La.create(La.Class.UNIVERSAL,La.Type.SEQUENCE,!0,[La.create(La.Class.UNIVERSAL,La.Type.INTEGER,!1,La.integerToDer(e.version).getBytes()),Ha(e.subject),xa.publicKeyToAsn1(e.publicKey),Ya(e)])},xa.distinguishedNameToAsn1=function(e){return Ha(e)},xa.certificateToAsn1=function(e){var t=e.tbsCertificate||xa.getTBSCertificate(e);return La.create(La.Class.UNIVERSAL,La.Type.SEQUENCE,!0,[t,La.create(La.Class.UNIVERSAL,La.Type.SEQUENCE,!0,[La.create(La.Class.UNIVERSAL,La.Type.OID,!1,La.oidToDer(e.signatureOid).getBytes()),Qa(e.signatureOid,e.signatureParameters)]),La.create(La.Class.UNIVERSAL,La.Type.BITSTRING,!1,String.fromCharCode(0)+e.signature)])},xa.certificateExtensionsToAsn1=function(e){var t=La.create(La.Class.CONTEXT_SPECIFIC,3,!0,[]),a=La.create(La.Class.UNIVERSAL,La.Type.SEQUENCE,!0,[]);t.value.push(a);for(var r=0;r<e.length;++r)a.value.push(xa.certificateExtensionToAsn1(e[r]));return t},xa.certificateExtensionToAsn1=function(e){var t=La.create(La.Class.UNIVERSAL,La.Type.SEQUENCE,!0,[]);t.value.push(La.create(La.Class.UNIVERSAL,La.Type.OID,!1,La.oidToDer(e.id).getBytes())),e.critical&&t.value.push(La.create(La.Class.UNIVERSAL,La.Type.BOOLEAN,!1,String.fromCharCode(255)));var a=e.value;return"string"!=typeof e.value&&(a=La.toDer(a).getBytes()),t.value.push(La.create(La.Class.UNIVERSAL,La.Type.OCTETSTRING,!1,a)),t},xa.certificationRequestToAsn1=function(e){var t=e.certificationRequestInfo||xa.getCertificationRequestInfo(e);return La.create(La.Class.UNIVERSAL,La.Type.SEQUENCE,!0,[t,La.create(La.Class.UNIVERSAL,La.Type.SEQUENCE,!0,[La.create(La.Class.UNIVERSAL,La.Type.OID,!1,La.oidToDer(e.signatureOid).getBytes()),Qa(e.signatureOid,e.signatureParameters)]),La.create(La.Class.UNIVERSAL,La.Type.BITSTRING,!1,String.fromCharCode(0)+e.signature)])},xa.createCaStore=function(e){var t={certs:{}};function a(e){return r(e),t.certs[e.hash]||null}function r(e){if(!e.hash){var t=za.md.sha1.create();e.attributes=xa.RDNAttributesAsArray(Ha(e),t),e.hash=t.digest().toHex()}}if(t.getIssuer=function(e){return a(e.issuer)},t.addCertificate=function(e){if("string"==typeof e&&(e=za.pki.certificateFromPem(e)),r(e.subject),!t.hasCertificate(e))if(e.subject.hash in t.certs){var a=t.certs[e.subject.hash];za.util.isArray(a)||(a=[a]),a.push(e),t.certs[e.subject.hash]=a}else t.certs[e.subject.hash]=e},t.hasCertificate=function(e){"string"==typeof e&&(e=za.pki.certificateFromPem(e));var t=a(e.subject);if(!t)return!1;za.util.isArray(t)||(t=[t]);for(var r=La.toDer(xa.certificateToAsn1(e)).getBytes(),i=0;i<t.length;++i){if(r===La.toDer(xa.certificateToAsn1(t[i])).getBytes())return!0}return!1},t.listAllCertificates=function(){var e=[];for(var a in t.certs)if(t.certs.hasOwnProperty(a)){var r=t.certs[a];if(za.util.isArray(r))for(var i=0;i<r.length;++i)e.push(r[i]);else e.push(r)}return e},t.removeCertificate=function(e){var i;if("string"==typeof e&&(e=za.pki.certificateFromPem(e)),r(e.subject),!t.hasCertificate(e))return null;var n=a(e.subject);if(!za.util.isArray(n))return i=t.certs[e.subject.hash],delete t.certs[e.subject.hash],i;for(var o=La.toDer(xa.certificateToAsn1(e)).getBytes(),s=0;s<n.length;++s){o===La.toDer(xa.certificateToAsn1(n[s])).getBytes()&&(i=n[s],n.splice(s,1))}return 0===n.length&&delete t.certs[e.subject.hash],i},e)for(var i=0;i<e.length;++i){var n=e[i];t.addCertificate(n)}return t},xa.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"},xa.verifyCertificateChain=function(e,t,a){"function"==typeof a&&(a={verify:a}),a=a||{};var r=(t=t.slice(0)).slice(0),i=a.validityCheckDate;void 0===i&&(i=new Date);var n=!0,o=null,s=0;do{var u=t.shift(),c=null,l=!1;if(i&&(i<u.validity.notBefore||i>u.validity.notAfter)&&(o={message:"Certificate is not valid yet or has expired.",error:xa.certificateError.certificate_expired,notBefore:u.validity.notBefore,notAfter:u.validity.notAfter,now:i}),null===o){if(null===(c=t[0]||e.getIssuer(u))&&u.isIssuer(u)&&(l=!0,c=u),c){var p=c;za.util.isArray(p)||(p=[p]);for(var h=!1;!h&&p.length>0;){c=p.shift();try{h=c.verify(u)}catch(e){}}h||(o={message:"Certificate signature is invalid.",error:xa.certificateError.bad_certificate})}null!==o||c&&!l||e.hasCertificate(u)||(o={message:"Certificate is not trusted.",error:xa.certificateError.unknown_ca})}if(null===o&&c&&!u.isIssuer(c)&&(o={message:"Certificate issuer is invalid.",error:xa.certificateError.bad_certificate}),null===o)for(var d={keyUsage:!0,basicConstraints:!0},m=0;null===o&&m<u.extensions.length;++m){var f=u.extensions[m];f.critical&&!(f.name in d)&&(o={message:"Certificate has an unsupported critical extension.",error:xa.certificateError.unsupported_certificate})}if(null===o&&(!n||0===t.length&&(!c||l))){var g=u.getExtension("basicConstraints"),y=u.getExtension("keyUsage");if(null!==y&&(y.keyCertSign&&null!==g||(o={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:xa.certificateError.bad_certificate})),null!==o||null===g||g.cA||(o={message:"Certificate basicConstraints indicates the certificate is not a CA.",error:xa.certificateError.bad_certificate}),null===o&&null!==y&&"pathLenConstraint"in g)s-1>g.pathLenConstraint&&(o={message:"Certificate basicConstraints pathLenConstraint violated.",error:xa.certificateError.bad_certificate})}var k=null===o||o.error,v=a.verify?a.verify(k,s,r):k;if(!0!==v)throw!0===k&&(o={message:"The application rejected the certificate.",error:xa.certificateError.bad_certificate}),(v||0===v)&&("object"!=typeof v||za.util.isArray(v)?"string"==typeof v&&(o.error=v):(v.message&&(o.message=v.message),v.error&&(o.error=v.error))),o;o=null,n=!1,++s}while(t.length>0);return!0};var Ja=S,er=Ja.asn1,tr=Ja.pki,ar=Ja.pkcs12=Ja.pkcs12||{},rr={name:"ContentInfo",tagClass:er.Class.UNIVERSAL,type:er.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.contentType",tagClass:er.Class.UNIVERSAL,type:er.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:er.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"content"}]},ir={name:"PFX",tagClass:er.Class.UNIVERSAL,type:er.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.version",tagClass:er.Class.UNIVERSAL,type:er.Type.INTEGER,constructed:!1,capture:"version"},rr,{name:"PFX.macData",tagClass:er.Class.UNIVERSAL,type:er.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"mac",value:[{name:"PFX.macData.mac",tagClass:er.Class.UNIVERSAL,type:er.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm",tagClass:er.Class.UNIVERSAL,type:er.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm.algorithm",tagClass:er.Class.UNIVERSAL,type:er.Type.OID,constructed:!1,capture:"macAlgorithm"},{name:"PFX.macData.mac.digestAlgorithm.parameters",tagClass:er.Class.UNIVERSAL,captureAsn1:"macAlgorithmParameters"}]},{name:"PFX.macData.mac.digest",tagClass:er.Class.UNIVERSAL,type:er.Type.OCTETSTRING,constructed:!1,capture:"macDigest"}]},{name:"PFX.macData.macSalt",tagClass:er.Class.UNIVERSAL,type:er.Type.OCTETSTRING,constructed:!1,capture:"macSalt"},{name:"PFX.macData.iterations",tagClass:er.Class.UNIVERSAL,type:er.Type.INTEGER,constructed:!1,optional:!0,capture:"macIterations"}]}]},nr={name:"SafeBag",tagClass:er.Class.UNIVERSAL,type:er.Type.SEQUENCE,constructed:!0,value:[{name:"SafeBag.bagId",tagClass:er.Class.UNIVERSAL,type:er.Type.OID,constructed:!1,capture:"bagId"},{name:"SafeBag.bagValue",tagClass:er.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"bagValue"},{name:"SafeBag.bagAttributes",tagClass:er.Class.UNIVERSAL,type:er.Type.SET,constructed:!0,optional:!0,capture:"bagAttributes"}]},or={name:"Attribute",tagClass:er.Class.UNIVERSAL,type:er.Type.SEQUENCE,constructed:!0,value:[{name:"Attribute.attrId",tagClass:er.Class.UNIVERSAL,type:er.Type.OID,constructed:!1,capture:"oid"},{name:"Attribute.attrValues",tagClass:er.Class.UNIVERSAL,type:er.Type.SET,constructed:!0,capture:"values"}]},sr={name:"CertBag",tagClass:er.Class.UNIVERSAL,type:er.Type.SEQUENCE,constructed:!0,value:[{name:"CertBag.certId",tagClass:er.Class.UNIVERSAL,type:er.Type.OID,constructed:!1,capture:"certId"},{name:"CertBag.certValue",tagClass:er.Class.CONTEXT_SPECIFIC,constructed:!0,value:[{name:"CertBag.certValue[0]",tagClass:er.Class.UNIVERSAL,type:er.Class.OCTETSTRING,constructed:!1,capture:"cert"}]}]};function ur(e,t,a,r){for(var i=[],n=0;n<e.length;n++)for(var o=0;o<e[n].safeBags.length;o++){var s=e[n].safeBags[o];void 0!==r&&s.type!==r||(null!==t?void 0!==s.attributes[t]&&s.attributes[t].indexOf(a)>=0&&i.push(s):i.push(s))}return i}function cr(e){if(e.composed||e.constructed){for(var t=Ja.util.createBuffer(),a=0;a<e.value.length;++a)t.putBytes(e.value[a].value);e.composed=e.constructed=!1,e.value=t.getBytes()}return e}function lr(e,t){var a={},r=[];if(!er.validate(e,Ja.pkcs7.asn1.encryptedDataValidator,a,r))throw(i=new Error("Cannot read EncryptedContentInfo.")).errors=r,i;var i,n=er.derToOid(a.contentType);if(n!==tr.oids.data)throw(i=new Error("PKCS#12 EncryptedContentInfo ContentType is not Data.")).oid=n,i;n=er.derToOid(a.encAlgorithm);var o=tr.pbe.getCipher(n,a.encParameter,t),s=cr(a.encryptedContentAsn1),u=Ja.util.createBuffer(s.value);if(o.update(u),!o.finish())throw new Error("Failed to decrypt PKCS#12 SafeContents.");return o.output.getBytes()}function pr(e,t,a){if(!t&&0===e.length)return[];if((e=er.fromDer(e,t)).tagClass!==er.Class.UNIVERSAL||e.type!==er.Type.SEQUENCE||!0!==e.constructed)throw new Error("PKCS#12 SafeContents expected to be a SEQUENCE OF SafeBag.");for(var r=[],i=0;i<e.value.length;i++){var n=e.value[i],o={},s=[];if(!er.validate(n,nr,o,s))throw(h=new Error("Cannot read SafeBag.")).errors=s,h;var u,c,l={type:er.derToOid(o.bagId),attributes:hr(o.bagAttributes)};r.push(l);var p=o.bagValue.value[0];switch(l.type){case tr.oids.pkcs8ShroudedKeyBag:if(null===(p=tr.decryptPrivateKeyInfo(p,a)))throw new Error("Unable to decrypt PKCS#8 ShroudedKeyBag, wrong password?");case tr.oids.keyBag:try{l.key=tr.privateKeyFromAsn1(p)}catch(e){l.key=null,l.asn1=p}continue;case tr.oids.certBag:u=sr,c=function(){if(er.derToOid(o.certId)!==tr.oids.x509Certificate){var e=new Error("Unsupported certificate type, only X.509 supported.");throw e.oid=er.derToOid(o.certId),e}var a=er.fromDer(o.cert,t);try{l.cert=tr.certificateFromAsn1(a,!0)}catch(e){l.cert=null,l.asn1=a}};break;default:var h;throw(h=new Error("Unsupported PKCS#12 SafeBag type.")).oid=l.type,h}if(void 0!==u&&!er.validate(p,u,o,s))throw(h=new Error("Cannot read PKCS#12 "+u.name)).errors=s,h;c()}return r}function hr(e){var t={};if(void 0!==e)for(var a=0;a<e.length;++a){var r={},i=[];if(!er.validate(e[a],or,r,i)){var n=new Error("Cannot read PKCS#12 BagAttribute.");throw n.errors=i,n}var o=er.derToOid(r.oid);if(void 0!==tr.oids[o]){t[tr.oids[o]]=[];for(var s=0;s<r.values.length;++s)t[tr.oids[o]].push(r.values[s].value)}}return t}ar.pkcs12FromAsn1=function(e,t,a){"string"==typeof t?(a=t,t=!0):void 0===t&&(t=!0);var r={};if(!er.validate(e,ir,r,[]))throw(i=new Error("Cannot read PKCS#12 PFX. ASN.1 object is not an PKCS#12 PFX.")).errors=i,i;var i,n={version:r.version.charCodeAt(0),safeContents:[],getBags:function(e){var t,a={};return"localKeyId"in e?t=e.localKeyId:"localKeyIdHex"in e&&(t=Ja.util.hexToBytes(e.localKeyIdHex)),void 0===t&&!("friendlyName"in e)&&"bagType"in e&&(a[e.bagType]=ur(n.safeContents,null,null,e.bagType)),void 0!==t&&(a.localKeyId=ur(n.safeContents,"localKeyId",t,e.bagType)),"friendlyName"in e&&(a.friendlyName=ur(n.safeContents,"friendlyName",e.friendlyName,e.bagType)),a},getBagsByFriendlyName:function(e,t){return ur(n.safeContents,"friendlyName",e,t)},getBagsByLocalKeyId:function(e,t){return ur(n.safeContents,"localKeyId",e,t)}};if(3!==r.version.charCodeAt(0))throw(i=new Error("PKCS#12 PFX of version other than 3 not supported.")).version=r.version.charCodeAt(0),i;if(er.derToOid(r.contentType)!==tr.oids.data)throw(i=new Error("Only PKCS#12 PFX in password integrity mode supported.")).oid=er.derToOid(r.contentType),i;var o=r.content.value[0];if(o.tagClass!==er.Class.UNIVERSAL||o.type!==er.Type.OCTETSTRING)throw new Error("PKCS#12 authSafe content data is not an OCTET STRING.");if(o=cr(o),r.mac){var s=null,u=0,c=er.derToOid(r.macAlgorithm);switch(c){case tr.oids.sha1:s=Ja.md.sha1.create(),u=20;break;case tr.oids.sha256:s=Ja.md.sha256.create(),u=32;break;case tr.oids.sha384:s=Ja.md.sha384.create(),u=48;break;case tr.oids.sha512:s=Ja.md.sha512.create(),u=64;break;case tr.oids.md5:s=Ja.md.md5.create(),u=16}if(null===s)throw new Error("PKCS#12 uses unsupported MAC algorithm: "+c);var l=new Ja.util.ByteBuffer(r.macSalt),p="macIterations"in r?parseInt(Ja.util.bytesToHex(r.macIterations),16):1,h=ar.generateKey(a,l,3,p,u,s),d=Ja.hmac.create();if(d.start(s,h),d.update(o.value),d.getMac().getBytes()!==r.macDigest)throw new Error("PKCS#12 MAC could not be verified. Invalid password?")}return function(e,t,a,r){if(t=er.fromDer(t,a),t.tagClass!==er.Class.UNIVERSAL||t.type!==er.Type.SEQUENCE||!0!==t.constructed)throw new Error("PKCS#12 AuthenticatedSafe expected to be a SEQUENCE OF ContentInfo");for(var i=0;i<t.value.length;i++){var n=t.value[i],o={},s=[];if(!er.validate(n,rr,o,s))throw(p=new Error("Cannot read ContentInfo.")).errors=s,p;var u={encrypted:!1},c=null,l=o.content.value[0];switch(er.derToOid(o.contentType)){case tr.oids.data:if(l.tagClass!==er.Class.UNIVERSAL||l.type!==er.Type.OCTETSTRING)throw new Error("PKCS#12 SafeContents Data is not an OCTET STRING.");c=cr(l).value;break;case tr.oids.encryptedData:c=lr(l,r),u.encrypted=!0;break;default:var p;throw(p=new Error("Unsupported PKCS#12 contentType.")).contentType=er.derToOid(o.contentType),p}u.safeBags=pr(c,a,r),e.safeContents.push(u)}}(n,o.value,t,a),n},ar.toPkcs12Asn1=function(e,t,a,r){(r=r||{}).saltSize=r.saltSize||8,r.count=r.count||2048,r.algorithm=r.algorithm||r.encAlgorithm||"aes128","useMac"in r||(r.useMac=!0),"localKeyId"in r||(r.localKeyId=null),"generateLocalKeyId"in r||(r.generateLocalKeyId=!0);var i,n=r.localKeyId;if(null!==n)n=Ja.util.hexToBytes(n);else if(r.generateLocalKeyId)if(t){var o=Ja.util.isArray(t)?t[0]:t;"string"==typeof o&&(o=tr.certificateFromPem(o)),(C=Ja.md.sha1.create()).update(er.toDer(tr.certificateToAsn1(o)).getBytes()),n=C.digest().getBytes()}else n=Ja.random.getBytes(20);var s=[];null!==n&&s.push(er.create(er.Class.UNIVERSAL,er.Type.SEQUENCE,!0,[er.create(er.Class.UNIVERSAL,er.Type.OID,!1,er.oidToDer(tr.oids.localKeyId).getBytes()),er.create(er.Class.UNIVERSAL,er.Type.SET,!0,[er.create(er.Class.UNIVERSAL,er.Type.OCTETSTRING,!1,n)])])),"friendlyName"in r&&s.push(er.create(er.Class.UNIVERSAL,er.Type.SEQUENCE,!0,[er.create(er.Class.UNIVERSAL,er.Type.OID,!1,er.oidToDer(tr.oids.friendlyName).getBytes()),er.create(er.Class.UNIVERSAL,er.Type.SET,!0,[er.create(er.Class.UNIVERSAL,er.Type.BMPSTRING,!1,r.friendlyName)])])),s.length>0&&(i=er.create(er.Class.UNIVERSAL,er.Type.SET,!0,s));var u=[],c=[];null!==t&&(c=Ja.util.isArray(t)?t:[t]);for(var l=[],p=0;p<c.length;++p){"string"==typeof(t=c[p])&&(t=tr.certificateFromPem(t));var h=0===p?i:void 0,d=tr.certificateToAsn1(t),m=er.create(er.Class.UNIVERSAL,er.Type.SEQUENCE,!0,[er.create(er.Class.UNIVERSAL,er.Type.OID,!1,er.oidToDer(tr.oids.certBag).getBytes()),er.create(er.Class.CONTEXT_SPECIFIC,0,!0,[er.create(er.Class.UNIVERSAL,er.Type.SEQUENCE,!0,[er.create(er.Class.UNIVERSAL,er.Type.OID,!1,er.oidToDer(tr.oids.x509Certificate).getBytes()),er.create(er.Class.CONTEXT_SPECIFIC,0,!0,[er.create(er.Class.UNIVERSAL,er.Type.OCTETSTRING,!1,er.toDer(d).getBytes())])])]),h]);l.push(m)}if(l.length>0){var f=er.create(er.Class.UNIVERSAL,er.Type.SEQUENCE,!0,l),g=er.create(er.Class.UNIVERSAL,er.Type.SEQUENCE,!0,[er.create(er.Class.UNIVERSAL,er.Type.OID,!1,er.oidToDer(tr.oids.data).getBytes()),er.create(er.Class.CONTEXT_SPECIFIC,0,!0,[er.create(er.Class.UNIVERSAL,er.Type.OCTETSTRING,!1,er.toDer(f).getBytes())])]);u.push(g)}var y=null;if(null!==e){var k=tr.wrapRsaPrivateKey(tr.privateKeyToAsn1(e));y=null===a?er.create(er.Class.UNIVERSAL,er.Type.SEQUENCE,!0,[er.create(er.Class.UNIVERSAL,er.Type.OID,!1,er.oidToDer(tr.oids.keyBag).getBytes()),er.create(er.Class.CONTEXT_SPECIFIC,0,!0,[k]),i]):er.create(er.Class.UNIVERSAL,er.Type.SEQUENCE,!0,[er.create(er.Class.UNIVERSAL,er.Type.OID,!1,er.oidToDer(tr.oids.pkcs8ShroudedKeyBag).getBytes()),er.create(er.Class.CONTEXT_SPECIFIC,0,!0,[tr.encryptPrivateKeyInfo(k,a,r)]),i]);var v=er.create(er.Class.UNIVERSAL,er.Type.SEQUENCE,!0,[y]),b=er.create(er.Class.UNIVERSAL,er.Type.SEQUENCE,!0,[er.create(er.Class.UNIVERSAL,er.Type.OID,!1,er.oidToDer(tr.oids.data).getBytes()),er.create(er.Class.CONTEXT_SPECIFIC,0,!0,[er.create(er.Class.UNIVERSAL,er.Type.OCTETSTRING,!1,er.toDer(v).getBytes())])]);u.push(b)}var w,j=er.create(er.Class.UNIVERSAL,er.Type.SEQUENCE,!0,u);if(r.useMac){var C=Ja.md.sha1.create(),E=new Ja.util.ByteBuffer(Ja.random.getBytes(r.saltSize)),S=r.count,T=(e=ar.generateKey(a,E,3,S,20),Ja.hmac.create());T.start(C,e),T.update(er.toDer(j).getBytes());var _=T.getMac();w=er.create(er.Class.UNIVERSAL,er.Type.SEQUENCE,!0,[er.create(er.Class.UNIVERSAL,er.Type.SEQUENCE,!0,[er.create(er.Class.UNIVERSAL,er.Type.SEQUENCE,!0,[er.create(er.Class.UNIVERSAL,er.Type.OID,!1,er.oidToDer(tr.oids.sha1).getBytes()),er.create(er.Class.UNIVERSAL,er.Type.NULL,!1,"")]),er.create(er.Class.UNIVERSAL,er.Type.OCTETSTRING,!1,_.getBytes())]),er.create(er.Class.UNIVERSAL,er.Type.OCTETSTRING,!1,E.getBytes()),er.create(er.Class.UNIVERSAL,er.Type.INTEGER,!1,er.integerToDer(S).getBytes())])}return er.create(er.Class.UNIVERSAL,er.Type.SEQUENCE,!0,[er.create(er.Class.UNIVERSAL,er.Type.INTEGER,!1,er.integerToDer(3).getBytes()),er.create(er.Class.UNIVERSAL,er.Type.SEQUENCE,!0,[er.create(er.Class.UNIVERSAL,er.Type.OID,!1,er.oidToDer(tr.oids.data).getBytes()),er.create(er.Class.CONTEXT_SPECIFIC,0,!0,[er.create(er.Class.UNIVERSAL,er.Type.OCTETSTRING,!1,er.toDer(j).getBytes())])]),w])},ar.generateKey=Ja.pbe.generatePkcs12Key;var dr=S,mr=dr.asn1,fr=dr.pki=dr.pki||{};fr.pemToDer=function(e){var t=dr.pem.decode(e)[0];if(t.procType&&"ENCRYPTED"===t.procType.type)throw new Error("Could not convert PEM to DER; PEM is encrypted.");return dr.util.createBuffer(t.body)},fr.privateKeyFromPem=function(e){var t=dr.pem.decode(e)[0];if("PRIVATE KEY"!==t.type&&"RSA PRIVATE KEY"!==t.type){var a=new Error('Could not convert private key from PEM; PEM header type is not "PRIVATE KEY" or "RSA PRIVATE KEY".');throw a.headerType=t.type,a}if(t.procType&&"ENCRYPTED"===t.procType.type)throw new Error("Could not convert private key from PEM; PEM is encrypted.");var r=mr.fromDer(t.body);return fr.privateKeyFromAsn1(r)},fr.privateKeyToPem=function(e,t){var a={type:"RSA PRIVATE KEY",body:mr.toDer(fr.privateKeyToAsn1(e)).getBytes()};return dr.pem.encode(a,{maxline:t})},fr.privateKeyInfoToPem=function(e,t){var a={type:"PRIVATE KEY",body:mr.toDer(e).getBytes()};return dr.pem.encode(a,{maxline:t})};var gr=S,yr=function(e,t,a,r){var i=gr.util.createBuffer(),n=e.length>>1,o=n+(1&e.length),s=e.substr(0,o),u=e.substr(n,o),c=gr.util.createBuffer(),l=gr.hmac.create();a=t+a;var p=Math.ceil(r/16),h=Math.ceil(r/20);l.start("MD5",s);var d=gr.util.createBuffer();c.putBytes(a);for(var m=0;m<p;++m)l.start(null,null),l.update(c.getBytes()),c.putBuffer(l.digest()),l.start(null,null),l.update(c.bytes()+a),d.putBuffer(l.digest());l.start("SHA1",u);var f=gr.util.createBuffer();c.clear(),c.putBytes(a);for(m=0;m<h;++m)l.start(null,null),l.update(c.getBytes()),c.putBuffer(l.digest()),l.start(null,null),l.update(c.bytes()+a),f.putBuffer(l.digest());return i.putBytes(gr.util.xorBytes(d.getBytes(),f.getBytes(),r)),i},kr=function(e,t,a){var r=!1;try{var i=e.deflate(t.fragment.getBytes());t.fragment=gr.util.createBuffer(i),t.length=i.length,r=!0}catch(e){}return r},vr=function(e,t,a){var r=!1;try{var i=e.inflate(t.fragment.getBytes());t.fragment=gr.util.createBuffer(i),t.length=i.length,r=!0}catch(e){}return r},br=function(e,t){var a=0;switch(t){case 1:a=e.getByte();break;case 2:a=e.getInt16();break;case 3:a=e.getInt24();break;case 4:a=e.getInt32()}return gr.util.createBuffer(e.getBytes(a))},wr=function(e,t,a){e.putInt(a.length(),t<<3),e.putBuffer(a)},jr={Versions:{TLS_1_0:{major:3,minor:1},TLS_1_1:{major:3,minor:2},TLS_1_2:{major:3,minor:3}}};jr.SupportedVersions=[jr.Versions.TLS_1_1,jr.Versions.TLS_1_0],jr.Version=jr.SupportedVersions[0],jr.MaxFragment=15360,jr.ConnectionEnd={server:0,client:1},jr.PRFAlgorithm={tls_prf_sha256:0},jr.BulkCipherAlgorithm={none:null,rc4:0,des3:1,aes:2},jr.CipherType={stream:0,block:1,aead:2},jr.MACAlgorithm={none:null,hmac_md5:0,hmac_sha1:1,hmac_sha256:2,hmac_sha384:3,hmac_sha512:4},jr.CompressionMethod={none:0,deflate:1},jr.ContentType={change_cipher_spec:20,alert:21,handshake:22,application_data:23,heartbeat:24},jr.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},jr.Alert={},jr.Alert.Level={warning:1,fatal:2},jr.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},jr.HeartbeatMessageType={heartbeat_request:1,heartbeat_response:2},jr.CipherSuites={},jr.getCipherSuite=function(e){var t=null;for(var a in jr.CipherSuites){var r=jr.CipherSuites[a];if(r.id[0]===e.charCodeAt(0)&&r.id[1]===e.charCodeAt(1)){t=r;break}}return t},jr.handleUnexpected=function(e,t){!e.open&&e.entity===jr.ConnectionEnd.client||e.error(e,{message:"Unexpected message. Received TLS record out of order.",send:!0,alert:{level:jr.Alert.Level.fatal,description:jr.Alert.Description.unexpected_message}})},jr.handleHelloRequest=function(e,t,a){!e.handshaking&&e.handshakes>0&&(jr.queue(e,jr.createAlert(e,{level:jr.Alert.Level.warning,description:jr.Alert.Description.no_renegotiation})),jr.flush(e)),e.process()},jr.parseHelloMessage=function(e,t,a){var r=null,i=e.entity===jr.ConnectionEnd.client;if(a<38)e.error(e,{message:i?"Invalid ServerHello message. Message too short.":"Invalid ClientHello message. Message too short.",send:!0,alert:{level:jr.Alert.Level.fatal,description:jr.Alert.Description.illegal_parameter}});else{var n=t.fragment,o=n.length();if(r={version:{major:n.getByte(),minor:n.getByte()},random:gr.util.createBuffer(n.getBytes(32)),session_id:br(n,1),extensions:[]},i?(r.cipher_suite=n.getBytes(2),r.compression_method=n.getByte()):(r.cipher_suites=br(n,2),r.compression_methods=br(n,1)),(o=a-(o-n.length()))>0){for(var s=br(n,2);s.length()>0;)r.extensions.push({type:[s.getByte(),s.getByte()],data:br(s,2)});if(!i)for(var u=0;u<r.extensions.length;++u){var c=r.extensions[u];if(0===c.type[0]&&0===c.type[1])for(var l=br(c.data,2);l.length()>0;){if(0!==l.getByte())break;e.session.extensions.server_name.serverNameList.push(br(l,2).getBytes())}}}if(e.session.version&&(r.version.major!==e.session.version.major||r.version.minor!==e.session.version.minor))return e.error(e,{message:"TLS version change is disallowed during renegotiation.",send:!0,alert:{level:jr.Alert.Level.fatal,description:jr.Alert.Description.protocol_version}});if(i)e.session.cipherSuite=jr.getCipherSuite(r.cipher_suite);else for(var p=gr.util.createBuffer(r.cipher_suites.bytes());p.length()>0&&(e.session.cipherSuite=jr.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:jr.Alert.Level.fatal,description:jr.Alert.Description.handshake_failure},cipherSuite:gr.util.bytesToHex(r.cipher_suite)});e.session.compressionMethod=i?r.compression_method:jr.CompressionMethod.none}return r},jr.createSecurityParameters=function(e,t){var a=e.entity===jr.ConnectionEnd.client,r=t.random.bytes(),i=a?e.session.sp.client_random:r,n=a?r:jr.createRandom().getBytes();e.session.sp={entity:e.entity,prf_algorithm:jr.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:n}},jr.handleServerHello=function(e,t,a){var r=jr.parseHelloMessage(e,t,a);if(!e.fail){if(!(r.version.minor<=e.version.minor))return e.error(e,{message:"Incompatible TLS version.",send:!0,alert:{level:jr.Alert.Level.fatal,description:jr.Alert.Description.protocol_version}});e.version.minor=r.version.minor,e.session.version=e.version;var i=r.session_id.bytes();i.length>0&&i===e.session.id?(e.expect=_r,e.session.resuming=!0,e.session.sp.server_random=r.random.bytes()):(e.expect=Cr,e.session.resuming=!1,jr.createSecurityParameters(e,r)),e.session.id=i,e.process()}},jr.handleClientHello=function(e,t,a){var r=jr.parseHelloMessage(e,t,a);if(!e.fail){var i=r.session_id.bytes(),n=null;if(e.sessionCache&&(null===(n=e.sessionCache.getSession(i))?i="":(n.version.major!==r.version.major||n.version.minor>r.version.minor)&&(n=null,i="")),0===i.length&&(i=gr.random.getBytes(32)),e.session.id=i,e.session.clientHelloVersion=r.version,e.session.sp={},n)e.version=e.session.version=n.version,e.session.sp=n.sp;else{for(var o,s=1;s<jr.SupportedVersions.length&&!((o=jr.SupportedVersions[s]).minor<=r.version.minor);++s);e.version={major:o.major,minor:o.minor},e.session.version=e.version}null!==n?(e.expect=Lr,e.session.resuming=!0,e.session.sp.client_random=r.random.bytes()):(e.expect=!1!==e.verifyClient?Nr:Rr,e.session.resuming=!1,jr.createSecurityParameters(e,r)),e.open=!0,jr.queue(e,jr.createRecord(e,{type:jr.ContentType.handshake,data:jr.createServerHello(e)})),e.session.resuming?(jr.queue(e,jr.createRecord(e,{type:jr.ContentType.change_cipher_spec,data:jr.createChangeCipherSpec()})),e.state.pending=jr.createConnectionState(e),e.state.current.write=e.state.pending.write,jr.queue(e,jr.createRecord(e,{type:jr.ContentType.handshake,data:jr.createFinished(e)}))):(jr.queue(e,jr.createRecord(e,{type:jr.ContentType.handshake,data:jr.createCertificate(e)})),e.fail||(jr.queue(e,jr.createRecord(e,{type:jr.ContentType.handshake,data:jr.createServerKeyExchange(e)})),!1!==e.verifyClient&&jr.queue(e,jr.createRecord(e,{type:jr.ContentType.handshake,data:jr.createCertificateRequest(e)})),jr.queue(e,jr.createRecord(e,{type:jr.ContentType.handshake,data:jr.createServerHelloDone(e)})))),jr.flush(e),e.process()}},jr.handleCertificate=function(e,t,a){if(a<3)return e.error(e,{message:"Invalid Certificate message. Message too short.",send:!0,alert:{level:jr.Alert.Level.fatal,description:jr.Alert.Description.illegal_parameter}});var r,i,n=t.fragment,o={certificate_list:br(n,3)},s=[];try{for(;o.certificate_list.length()>0;)r=br(o.certificate_list,3),i=gr.asn1.fromDer(r),r=gr.pki.certificateFromAsn1(i,!0),s.push(r)}catch(t){return e.error(e,{message:"Could not parse certificate list.",cause:t,send:!0,alert:{level:jr.Alert.Level.fatal,description:jr.Alert.Description.bad_certificate}})}var u=e.entity===jr.ConnectionEnd.client;!u&&!0!==e.verifyClient||0!==s.length?0===s.length?e.expect=u?Er:Rr:(u?e.session.serverCertificate=s[0]:e.session.clientCertificate=s[0],jr.verifyCertificateChain(e,s)&&(e.expect=u?Er:Rr)):e.error(e,{message:u?"No server certificate provided.":"No client certificate provided.",send:!0,alert:{level:jr.Alert.Level.fatal,description:jr.Alert.Description.illegal_parameter}}),e.process()},jr.handleServerKeyExchange=function(e,t,a){if(a>0)return e.error(e,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:jr.Alert.Level.fatal,description:jr.Alert.Description.unsupported_certificate}});e.expect=Sr,e.process()},jr.handleClientKeyExchange=function(e,t,a){if(a<48)return e.error(e,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:jr.Alert.Level.fatal,description:jr.Alert.Description.unsupported_certificate}});var r=t.fragment,i={enc_pre_master_secret:br(r,2).getBytes()},n=null;if(e.getPrivateKey)try{n=e.getPrivateKey(e,e.session.serverCertificate),n=gr.pki.privateKeyFromPem(n)}catch(t){e.error(e,{message:"Could not get private key.",cause:t,send:!0,alert:{level:jr.Alert.Level.fatal,description:jr.Alert.Description.internal_error}})}if(null===n)return e.error(e,{message:"No private key set.",send:!0,alert:{level:jr.Alert.Level.fatal,description:jr.Alert.Description.internal_error}});try{var o=e.session.sp;o.pre_master_secret=n.decrypt(i.enc_pre_master_secret);var s=e.session.clientHelloVersion;if(s.major!==o.pre_master_secret.charCodeAt(0)||s.minor!==o.pre_master_secret.charCodeAt(1))throw new Error("TLS version rollback attack detected.")}catch(e){o.pre_master_secret=gr.random.getBytes(48)}e.expect=Lr,null!==e.session.clientCertificate&&(e.expect=zr),e.process()},jr.handleCertificateRequest=function(e,t,a){if(a<3)return e.error(e,{message:"Invalid CertificateRequest. Message too short.",send:!0,alert:{level:jr.Alert.Level.fatal,description:jr.Alert.Description.illegal_parameter}});var r=t.fragment,i={certificate_types:br(r,1),certificate_authorities:br(r,2)};e.session.certificateRequest=i,e.expect=Tr,e.process()},jr.handleCertificateVerify=function(e,t,a){if(a<2)return e.error(e,{message:"Invalid CertificateVerify. Message too short.",send:!0,alert:{level:jr.Alert.Level.fatal,description:jr.Alert.Description.illegal_parameter}});var r=t.fragment;r.read-=4;var i=r.bytes();r.read+=4;var n={signature:br(r,2).getBytes()},o=gr.util.createBuffer();o.putBuffer(e.session.md5.digest()),o.putBuffer(e.session.sha1.digest()),o=o.getBytes();try{if(!e.session.clientCertificate.publicKey.verify(o,n.signature,"NONE"))throw new Error("CertificateVerify signature does not match.");e.session.md5.update(i),e.session.sha1.update(i)}catch(t){return e.error(e,{message:"Bad signature in CertificateVerify.",send:!0,alert:{level:jr.Alert.Level.fatal,description:jr.Alert.Description.handshake_failure}})}e.expect=Lr,e.process()},jr.handleServerHelloDone=function(e,t,a){if(a>0)return e.error(e,{message:"Invalid ServerHelloDone message. Invalid length.",send:!0,alert:{level:jr.Alert.Level.fatal,description:jr.Alert.Description.record_overflow}});if(null===e.serverCertificate){var r={message:"No server certificate provided. Not enough security.",send:!0,alert:{level:jr.Alert.Level.fatal,description:jr.Alert.Description.insufficient_security}},i=e.verify(e,r.alert.description,0,[]);if(!0!==i)return(i||0===i)&&("object"!=typeof i||gr.util.isArray(i)?"number"==typeof i&&(r.alert.description=i):(i.message&&(r.message=i.message),i.alert&&(r.alert.description=i.alert))),e.error(e,r)}null!==e.session.certificateRequest&&(t=jr.createRecord(e,{type:jr.ContentType.handshake,data:jr.createCertificate(e)}),jr.queue(e,t)),t=jr.createRecord(e,{type:jr.ContentType.handshake,data:jr.createClientKeyExchange(e)}),jr.queue(e,t),e.expect=Br;var n=function(e,t){null!==e.session.certificateRequest&&null!==e.session.clientCertificate&&jr.queue(e,jr.createRecord(e,{type:jr.ContentType.handshake,data:jr.createCertificateVerify(e,t)})),jr.queue(e,jr.createRecord(e,{type:jr.ContentType.change_cipher_spec,data:jr.createChangeCipherSpec()})),e.state.pending=jr.createConnectionState(e),e.state.current.write=e.state.pending.write,jr.queue(e,jr.createRecord(e,{type:jr.ContentType.handshake,data:jr.createFinished(e)})),e.expect=_r,jr.flush(e),e.process()};if(null===e.session.certificateRequest||null===e.session.clientCertificate)return n(e,null);jr.getClientSignature(e,n)},jr.handleChangeCipherSpec=function(e,t){if(1!==t.fragment.getByte())return e.error(e,{message:"Invalid ChangeCipherSpec message received.",send:!0,alert:{level:jr.Alert.Level.fatal,description:jr.Alert.Description.illegal_parameter}});var a=e.entity===jr.ConnectionEnd.client;(e.session.resuming&&a||!e.session.resuming&&!a)&&(e.state.pending=jr.createConnectionState(e)),e.state.current.read=e.state.pending.read,(!e.session.resuming&&a||e.session.resuming&&!a)&&(e.state.pending=null),e.expect=a?Ir:xr,e.process()},jr.handleFinished=function(e,t,a){var r=t.fragment;r.read-=4;var i=r.bytes();r.read+=4;var n=t.fragment.getBytes();(r=gr.util.createBuffer()).putBuffer(e.session.md5.digest()),r.putBuffer(e.session.sha1.digest());var o=e.entity===jr.ConnectionEnd.client,s=o?"server finished":"client finished",u=e.session.sp;if((r=yr(u.master_secret,s,r.getBytes(),12)).getBytes()!==n)return e.error(e,{message:"Invalid verify_data in Finished message.",send:!0,alert:{level:jr.Alert.Level.fatal,description:jr.Alert.Description.decrypt_error}});e.session.md5.update(i),e.session.sha1.update(i),(e.session.resuming&&o||!e.session.resuming&&!o)&&(jr.queue(e,jr.createRecord(e,{type:jr.ContentType.change_cipher_spec,data:jr.createChangeCipherSpec()})),e.state.current.write=e.state.pending.write,e.state.pending=null,jr.queue(e,jr.createRecord(e,{type:jr.ContentType.handshake,data:jr.createFinished(e)}))),e.expect=o?Ar:Dr,e.handshaking=!1,++e.handshakes,e.peerCertificate=o?e.session.serverCertificate:e.session.clientCertificate,jr.flush(e),e.isConnected=!0,e.connected(e),e.process()},jr.handleAlert=function(e,t){var a,r=t.fragment,i={level:r.getByte(),description:r.getByte()};switch(i.description){case jr.Alert.Description.close_notify:a="Connection closed.";break;case jr.Alert.Description.unexpected_message:a="Unexpected message.";break;case jr.Alert.Description.bad_record_mac:a="Bad record MAC.";break;case jr.Alert.Description.decryption_failed:a="Decryption failed.";break;case jr.Alert.Description.record_overflow:a="Record overflow.";break;case jr.Alert.Description.decompression_failure:a="Decompression failed.";break;case jr.Alert.Description.handshake_failure:a="Handshake failure.";break;case jr.Alert.Description.bad_certificate:a="Bad certificate.";break;case jr.Alert.Description.unsupported_certificate:a="Unsupported certificate.";break;case jr.Alert.Description.certificate_revoked:a="Certificate revoked.";break;case jr.Alert.Description.certificate_expired:a="Certificate expired.";break;case jr.Alert.Description.certificate_unknown:a="Certificate unknown.";break;case jr.Alert.Description.illegal_parameter:a="Illegal parameter.";break;case jr.Alert.Description.unknown_ca:a="Unknown certificate authority.";break;case jr.Alert.Description.access_denied:a="Access denied.";break;case jr.Alert.Description.decode_error:a="Decode error.";break;case jr.Alert.Description.decrypt_error:a="Decrypt error.";break;case jr.Alert.Description.export_restriction:a="Export restriction.";break;case jr.Alert.Description.protocol_version:a="Unsupported protocol version.";break;case jr.Alert.Description.insufficient_security:a="Insufficient security.";break;case jr.Alert.Description.internal_error:a="Internal error.";break;case jr.Alert.Description.user_canceled:a="User canceled.";break;case jr.Alert.Description.no_renegotiation:a="Renegotiation not supported.";break;default:a="Unknown error."}if(i.description===jr.Alert.Description.close_notify)return e.close();e.error(e,{message:a,send:!1,origin:e.entity===jr.ConnectionEnd.client?"server":"client",alert:i}),e.process()},jr.handleHandshake=function(e,t){var a=t.fragment,r=a.getByte(),i=a.getInt24();if(i>a.length())return e.fragmented=t,t.fragment=gr.util.createBuffer(),a.read-=4,e.process();e.fragmented=null,a.read-=4;var n=a.bytes(i+4);a.read+=4,r in Xr[e.entity][e.expect]?(e.entity!==jr.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:gr.md.md5.create(),sha1:gr.md.sha1.create()}),r!==jr.HandshakeType.hello_request&&r!==jr.HandshakeType.certificate_verify&&r!==jr.HandshakeType.finished&&(e.session.md5.update(n),e.session.sha1.update(n)),Xr[e.entity][e.expect][r](e,t,i)):jr.handleUnexpected(e,t)},jr.handleApplicationData=function(e,t){e.data.putBuffer(t.fragment),e.dataReady(e),e.process()},jr.handleHeartbeat=function(e,t){var a=t.fragment,r=a.getByte(),i=a.getInt16(),n=a.getBytes(i);if(r===jr.HeartbeatMessageType.heartbeat_request){if(e.handshaking||i>n.length)return e.process();jr.queue(e,jr.createRecord(e,{type:jr.ContentType.heartbeat,data:jr.createHeartbeat(jr.HeartbeatMessageType.heartbeat_response,n)})),jr.flush(e)}else if(r===jr.HeartbeatMessageType.heartbeat_response){if(n!==e.expectedHeartbeatPayload)return e.process();e.heartbeatReceived&&e.heartbeatReceived(e,gr.util.createBuffer(n))}e.process()};var Cr=1,Er=2,Sr=3,Tr=4,_r=5,Ir=6,Ar=7,Br=8,Nr=1,Rr=2,zr=3,Lr=4,xr=5,Dr=6,Ur=jr.handleUnexpected,Or=jr.handleChangeCipherSpec,Pr=jr.handleAlert,Vr=jr.handleHandshake,Mr=jr.handleApplicationData,Kr=jr.handleHeartbeat,Fr=[];Fr[jr.ConnectionEnd.client]=[[Ur,Pr,Vr,Ur,Kr],[Ur,Pr,Vr,Ur,Kr],[Ur,Pr,Vr,Ur,Kr],[Ur,Pr,Vr,Ur,Kr],[Ur,Pr,Vr,Ur,Kr],[Or,Pr,Ur,Ur,Kr],[Ur,Pr,Vr,Ur,Kr],[Ur,Pr,Vr,Mr,Kr],[Ur,Pr,Vr,Ur,Kr]],Fr[jr.ConnectionEnd.server]=[[Ur,Pr,Vr,Ur,Kr],[Ur,Pr,Vr,Ur,Kr],[Ur,Pr,Vr,Ur,Kr],[Ur,Pr,Vr,Ur,Kr],[Or,Pr,Ur,Ur,Kr],[Ur,Pr,Vr,Ur,Kr],[Ur,Pr,Vr,Mr,Kr],[Ur,Pr,Vr,Ur,Kr]];var qr=jr.handleHelloRequest,Hr=jr.handleServerHello,Gr=jr.handleCertificate,Wr=jr.handleServerKeyExchange,Qr=jr.handleCertificateRequest,Yr=jr.handleServerHelloDone,Zr=jr.handleFinished,Xr=[];Xr[jr.ConnectionEnd.client]=[[Ur,Ur,Hr,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur],[qr,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Gr,Wr,Qr,Yr,Ur,Ur,Ur,Ur,Ur,Ur],[qr,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Wr,Qr,Yr,Ur,Ur,Ur,Ur,Ur,Ur],[qr,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Qr,Yr,Ur,Ur,Ur,Ur,Ur,Ur],[qr,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Yr,Ur,Ur,Ur,Ur,Ur,Ur],[qr,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur],[qr,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Zr],[qr,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur],[qr,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur]];var $r=jr.handleClientHello,Jr=jr.handleClientKeyExchange,ei=jr.handleCertificateVerify;Xr[jr.ConnectionEnd.server]=[[Ur,$r,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur],[Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Gr,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur],[Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Jr,Ur,Ur,Ur,Ur],[Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,ei,Ur,Ur,Ur,Ur,Ur],[Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur],[Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Zr],[Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur],[Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur,Ur]],jr.generateKeys=function(e,t){var a=yr,r=t.client_random+t.server_random;e.session.resuming||(t.master_secret=a(t.pre_master_secret,"master secret",r,48).bytes(),t.pre_master_secret=null),r=t.server_random+t.client_random;var i=2*t.mac_key_length+2*t.enc_key_length,n=e.version.major===jr.Versions.TLS_1_0.major&&e.version.minor===jr.Versions.TLS_1_0.minor;n&&(i+=2*t.fixed_iv_length);var o=a(t.master_secret,"key expansion",r,i),s={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 n&&(s.client_write_IV=o.getBytes(t.fixed_iv_length),s.server_write_IV=o.getBytes(t.fixed_iv_length)),s},jr.createConnectionState=function(e){var t=e.entity===jr.ConnectionEnd.client,a=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},r={read:a(),write:a()};if(r.read.update=function(e,t){return r.read.cipherFunction(t,r.read)?r.read.compressFunction(e,t,r.read)||e.error(e,{message:"Could not decompress record.",send:!0,alert:{level:jr.Alert.Level.fatal,description:jr.Alert.Description.decompression_failure}}):e.error(e,{message:"Could not decrypt record or bad MAC.",send:!0,alert:{level:jr.Alert.Level.fatal,description:jr.Alert.Description.bad_record_mac}}),!e.fail},r.write.update=function(e,t){return r.write.compressFunction(e,t,r.write)?r.write.cipherFunction(t,r.write)||e.error(e,{message:"Could not encrypt record.",send:!1,alert:{level:jr.Alert.Level.fatal,description:jr.Alert.Description.internal_error}}):e.error(e,{message:"Could not compress record.",send:!1,alert:{level:jr.Alert.Level.fatal,description:jr.Alert.Description.internal_error}}),!e.fail},e.session){var i=e.session.sp;switch(e.session.cipherSuite.initSecurityParameters(i),i.keys=jr.generateKeys(e,i),r.read.macKey=t?i.keys.server_write_MAC_key:i.keys.client_write_MAC_key,r.write.macKey=t?i.keys.client_write_MAC_key:i.keys.server_write_MAC_key,e.session.cipherSuite.initConnectionState(r,e,i),i.compression_algorithm){case jr.CompressionMethod.none:break;case jr.CompressionMethod.deflate:r.read.compressFunction=vr,r.write.compressFunction=kr;break;default:throw new Error("Unsupported compression algorithm.")}}return r},jr.createRandom=function(){var e=new Date,t=+e+6e4*e.getTimezoneOffset(),a=gr.util.createBuffer();return a.putInt32(t),a.putBytes(gr.random.getBytes(28)),a},jr.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},jr.createAlert=function(e,t){var a=gr.util.createBuffer();return a.putByte(t.level),a.putByte(t.description),jr.createRecord(e,{type:jr.ContentType.alert,data:a})},jr.createClientHello=function(e){e.session.clientHelloVersion={major:e.version.major,minor:e.version.minor};for(var t=gr.util.createBuffer(),a=0;a<e.cipherSuites.length;++a){var r=e.cipherSuites[a];t.putByte(r.id[0]),t.putByte(r.id[1])}var i=t.length(),n=gr.util.createBuffer();n.putByte(jr.CompressionMethod.none);var o=n.length(),s=gr.util.createBuffer();if(e.virtualHost){var u=gr.util.createBuffer();u.putByte(0),u.putByte(0);var c=gr.util.createBuffer();c.putByte(0),wr(c,2,gr.util.createBuffer(e.virtualHost));var l=gr.util.createBuffer();wr(l,2,c),wr(u,2,l),s.putBuffer(u)}var p=s.length();p>0&&(p+=2);var h=e.session.id,d=h.length+1+2+4+28+2+i+1+o+p,m=gr.util.createBuffer();return m.putByte(jr.HandshakeType.client_hello),m.putInt24(d),m.putByte(e.version.major),m.putByte(e.version.minor),m.putBytes(e.session.sp.client_random),wr(m,1,gr.util.createBuffer(h)),wr(m,2,t),wr(m,1,n),p>0&&wr(m,2,s),m},jr.createServerHello=function(e){var t=e.session.id,a=t.length+1+2+4+28+2+1,r=gr.util.createBuffer();return r.putByte(jr.HandshakeType.server_hello),r.putInt24(a),r.putByte(e.version.major),r.putByte(e.version.minor),r.putBytes(e.session.sp.server_random),wr(r,1,gr.util.createBuffer(t)),r.putByte(e.session.cipherSuite.id[0]),r.putByte(e.session.cipherSuite.id[1]),r.putByte(e.session.compressionMethod),r},jr.createCertificate=function(e){var t,a=e.entity===jr.ConnectionEnd.client,r=null;e.getCertificate&&(t=a?e.session.certificateRequest:e.session.extensions.server_name.serverNameList,r=e.getCertificate(e,t));var i=gr.util.createBuffer();if(null!==r)try{gr.util.isArray(r)||(r=[r]);for(var n=null,o=0;o<r.length;++o){var s=gr.pem.decode(r[o])[0];if("CERTIFICATE"!==s.type&&"X509 CERTIFICATE"!==s.type&&"TRUSTED CERTIFICATE"!==s.type){var u=new Error('Could not convert certificate from PEM; PEM header type is not "CERTIFICATE", "X509 CERTIFICATE", or "TRUSTED CERTIFICATE".');throw u.headerType=s.type,u}if(s.procType&&"ENCRYPTED"===s.procType.type)throw new Error("Could not convert certificate from PEM; PEM is encrypted.");var c=gr.util.createBuffer(s.body);null===n&&(n=gr.asn1.fromDer(c.bytes(),!1));var l=gr.util.createBuffer();wr(l,3,c),i.putBuffer(l)}r=gr.pki.certificateFromAsn1(n),a?e.session.clientCertificate=r:e.session.serverCertificate=r}catch(t){return e.error(e,{message:"Could not send certificate list.",cause:t,send:!0,alert:{level:jr.Alert.Level.fatal,description:jr.Alert.Description.bad_certificate}})}var p=3+i.length(),h=gr.util.createBuffer();return h.putByte(jr.HandshakeType.certificate),h.putInt24(p),wr(h,3,i),h},jr.createClientKeyExchange=function(e){var t=gr.util.createBuffer();t.putByte(e.session.clientHelloVersion.major),t.putByte(e.session.clientHelloVersion.minor),t.putBytes(gr.random.getBytes(46));var a=e.session.sp;a.pre_master_secret=t.getBytes();var r=(t=e.session.serverCertificate.publicKey.encrypt(a.pre_master_secret)).length+2,i=gr.util.createBuffer();return i.putByte(jr.HandshakeType.client_key_exchange),i.putInt24(r),i.putInt16(t.length),i.putBytes(t),i},jr.createServerKeyExchange=function(e){return gr.util.createBuffer()},jr.getClientSignature=function(e,t){var a=gr.util.createBuffer();a.putBuffer(e.session.md5.digest()),a.putBuffer(e.session.sha1.digest()),a=a.getBytes(),e.getSignature=e.getSignature||function(e,t,a){var r=null;if(e.getPrivateKey)try{r=e.getPrivateKey(e,e.session.clientCertificate),r=gr.pki.privateKeyFromPem(r)}catch(t){e.error(e,{message:"Could not get private key.",cause:t,send:!0,alert:{level:jr.Alert.Level.fatal,description:jr.Alert.Description.internal_error}})}null===r?e.error(e,{message:"No private key set.",send:!0,alert:{level:jr.Alert.Level.fatal,description:jr.Alert.Description.internal_error}}):t=r.sign(t,null),a(e,t)},e.getSignature(e,a,t)},jr.createCertificateVerify=function(e,t){var a=t.length+2,r=gr.util.createBuffer();return r.putByte(jr.HandshakeType.certificate_verify),r.putInt24(a),r.putInt16(t.length),r.putBytes(t),r},jr.createCertificateRequest=function(e){var t=gr.util.createBuffer();t.putByte(1);var a=gr.util.createBuffer();for(var r in e.caStore.certs){var i=e.caStore.certs[r],n=gr.pki.distinguishedNameToAsn1(i.subject),o=gr.asn1.toDer(n);a.putInt16(o.length()),a.putBuffer(o)}var s=1+t.length()+2+a.length(),u=gr.util.createBuffer();return u.putByte(jr.HandshakeType.certificate_request),u.putInt24(s),wr(u,1,t),wr(u,2,a),u},jr.createServerHelloDone=function(e){var t=gr.util.createBuffer();return t.putByte(jr.HandshakeType.server_hello_done),t.putInt24(0),t},jr.createChangeCipherSpec=function(){var e=gr.util.createBuffer();return e.putByte(1),e},jr.createFinished=function(e){var t=gr.util.createBuffer();t.putBuffer(e.session.md5.digest()),t.putBuffer(e.session.sha1.digest());var a=e.entity===jr.ConnectionEnd.client,r=e.session.sp,i=a?"client finished":"server finished";t=yr(r.master_secret,i,t.getBytes(),12);var n=gr.util.createBuffer();return n.putByte(jr.HandshakeType.finished),n.putInt24(t.length()),n.putBuffer(t),n},jr.createHeartbeat=function(e,t,a){void 0===a&&(a=t.length);var r=gr.util.createBuffer();r.putByte(e),r.putInt16(a),r.putBytes(t);var i=r.length(),n=Math.max(16,i-a-3);return r.putBytes(gr.random.getBytes(n)),r},jr.queue=function(e,t){if(t&&(0!==t.fragment.length()||t.type!==jr.ContentType.handshake&&t.type!==jr.ContentType.alert&&t.type!==jr.ContentType.change_cipher_spec)){if(t.type===jr.ContentType.handshake){var a=t.fragment.bytes();e.session.md5.update(a),e.session.sha1.update(a),a=null}var r;if(t.fragment.length()<=jr.MaxFragment)r=[t];else{r=[];for(var i=t.fragment.bytes();i.length>jr.MaxFragment;)r.push(jr.createRecord(e,{type:t.type,data:gr.util.createBuffer(i.slice(0,jr.MaxFragment))})),i=i.slice(jr.MaxFragment);i.length>0&&r.push(jr.createRecord(e,{type:t.type,data:gr.util.createBuffer(i)}))}for(var n=0;n<r.length&&!e.fail;++n){var o=r[n];e.state.current.write.update(e,o)&&e.records.push(o)}}},jr.flush=function(e){for(var t=0;t<e.records.length;++t){var a=e.records[t];e.tlsData.putByte(a.type),e.tlsData.putByte(a.version.major),e.tlsData.putByte(a.version.minor),e.tlsData.putInt16(a.fragment.length()),e.tlsData.putBuffer(e.records[t].fragment)}return e.records=[],e.tlsDataReady(e)};var ti=function(e){switch(e){case!0:return!0;case gr.pki.certificateError.bad_certificate:return jr.Alert.Description.bad_certificate;case gr.pki.certificateError.unsupported_certificate:return jr.Alert.Description.unsupported_certificate;case gr.pki.certificateError.certificate_revoked:return jr.Alert.Description.certificate_revoked;case gr.pki.certificateError.certificate_expired:return jr.Alert.Description.certificate_expired;case gr.pki.certificateError.certificate_unknown:return jr.Alert.Description.certificate_unknown;case gr.pki.certificateError.unknown_ca:return jr.Alert.Description.unknown_ca;default:return jr.Alert.Description.bad_certificate}};for(var ai in jr.verifyCertificateChain=function(e,t){try{var a={};for(var r in e.verifyOptions)a[r]=e.verifyOptions[r];a.verify=function(t,a,r){ti(t);var i=e.verify(e,t,a,r);if(!0!==i){if("object"==typeof i&&!gr.util.isArray(i)){var n=new Error("The application rejected the certificate.");throw n.send=!0,n.alert={level:jr.Alert.Level.fatal,description:jr.Alert.Description.bad_certificate},i.message&&(n.message=i.message),i.alert&&(n.alert.description=i.alert),n}i!==t&&(i=function(e){switch(e){case!0:return!0;case jr.Alert.Description.bad_certificate:return gr.pki.certificateError.bad_certificate;case jr.Alert.Description.unsupported_certificate:return gr.pki.certificateError.unsupported_certificate;case jr.Alert.Description.certificate_revoked:return gr.pki.certificateError.certificate_revoked;case jr.Alert.Description.certificate_expired:return gr.pki.certificateError.certificate_expired;case jr.Alert.Description.certificate_unknown:return gr.pki.certificateError.certificate_unknown;case jr.Alert.Description.unknown_ca:return gr.pki.certificateError.unknown_ca;default:return gr.pki.certificateError.bad_certificate}}(i))}return i},gr.pki.verifyCertificateChain(e.caStore,t,a)}catch(t){var i=t;("object"!=typeof i||gr.util.isArray(i))&&(i={send:!0,alert:{level:jr.Alert.Level.fatal,description:ti(t)}}),"send"in i||(i.send=!0),"alert"in i||(i.alert={level:jr.Alert.Level.fatal,description:ti(i.error)}),e.error(e,i)}return!e.fail},jr.createSessionCache=function(e,t){var a=null;if(e&&e.getSession&&e.setSession&&e.order)a=e;else{for(var r in(a={}).cache=e||{},a.capacity=Math.max(t||100,1),a.order=[],e)a.order.length<=t?a.order.push(r):delete e[r];a.getSession=function(e){var t=null,r=null;if(e?r=gr.util.bytesToHex(e):a.order.length>0&&(r=a.order[0]),null!==r&&r in a.cache)for(var i in t=a.cache[r],delete a.cache[r],a.order)if(a.order[i]===r){a.order.splice(i,1);break}return t},a.setSession=function(e,t){if(a.order.length===a.capacity){var r=a.order.shift();delete a.cache[r]}r=gr.util.bytesToHex(e);a.order.push(r),a.cache[r]=t}}return a},jr.createConnection=function(e){var t=null;t=e.caStore?gr.util.isArray(e.caStore)?gr.pki.createCaStore(e.caStore):e.caStore:gr.pki.createCaStore();var a=e.cipherSuites||null;if(null===a)for(var r in a=[],jr.CipherSuites)a.push(jr.CipherSuites[r]);var i=e.server?jr.ConnectionEnd.server:jr.ConnectionEnd.client,n=e.sessionCache?jr.createSessionCache(e.sessionCache):null,o={version:{major:jr.Version.major,minor:jr.Version.minor},entity:i,sessionId:e.sessionId,caStore:t,sessionCache:n,cipherSuites:a,connected:e.connected,virtualHost:e.virtualHost||null,verifyClient:e.verifyClient||!1,verify:e.verify||function(e,t,a,r){return t},verifyOptions:e.verifyOptions||{},getCertificate:e.getCertificate||null,getPrivateKey:e.getPrivateKey||null,getSignature:e.getSignature||null,input:gr.util.createBuffer(),tlsData:gr.util.createBuffer(),data:gr.util.createBuffer(),tlsDataReady:e.tlsDataReady,dataReady:e.dataReady,heartbeatReceived:e.heartbeatReceived,closed:e.closed,error:function(t,a){a.origin=a.origin||(t.entity===jr.ConnectionEnd.client?"client":"server"),a.send&&(jr.queue(t,jr.createAlert(t,a.alert)),jr.flush(t));var r=!1!==a.fatal;r&&(t.fail=!0),e.error(t,a),r&&t.close(!1)},deflate:e.deflate||null,inflate:e.inflate||null,reset:function(e){o.version={major:jr.Version.major,minor:jr.Version.minor},o.record=null,o.session=null,o.peerCertificate=null,o.state={pending:null,current:null},o.expect=(o.entity,jr.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=jr.createConnectionState(o)}};o.reset();return o.handshake=function(e){if(o.entity!==jr.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:gr.md.md5.create(),sha1:gr.md.sha1.create()},t&&(o.version=t.version,o.session.sp=t.sp),o.session.sp.client_random=jr.createRandom().getBytes(),o.open=!0,jr.queue(o,jr.createRecord(o,{type:jr.ContentType.handshake,data:jr.createClientHello(o)})),jr.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,a=e.input,r=a.length();if(r<5)t=5-r;else{e.record={type:a.getByte(),version:{major:a.getByte(),minor:a.getByte()},length:a.getInt16(),fragment:gr.util.createBuffer(),ready:!1};var i=e.record.version.major===e.version.major;i&&e.session&&e.session.version&&(i=e.record.version.minor===e.version.minor),i||e.error(e,{message:"Incompatible TLS version.",send:!0,alert:{level:jr.Alert.Level.fatal,description:jr.Alert.Description.protocol_version}})}return t}(o)),o.fail||null===o.record||o.record.ready||(t=function(e){var t=0,a=e.input,r=a.length();return r<e.record.length?t=e.record.length-r:(e.record.fragment.putBytes(a.getBytes(e.record.length)),a.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:jr.Alert.Level.fatal,description:jr.Alert.Description.unexpected_message}})),e.record.ready=!0)),t}(o)),!o.fail&&null!==o.record&&o.record.ready&&function(e,t){var a=t.type-jr.ContentType.change_cipher_spec,r=Fr[e.entity][e.expect];a in r?r[a](e,t):jr.handleUnexpected(e,t)}(o,o.record)),t},o.prepare=function(e){return jr.queue(o,jr.createRecord(o,{type:jr.ContentType.application_data,data:gr.util.createBuffer(e)})),jr.flush(o)},o.prepareHeartbeatRequest=function(e,t){return e instanceof gr.util.ByteBuffer&&(e=e.bytes()),void 0===t&&(t=e.length),o.expectedHeartbeatPayload=e,jr.queue(o,jr.createRecord(o,{type:jr.ContentType.heartbeat,data:jr.createHeartbeat(jr.HeartbeatMessageType.heartbeat_request,e,t)})),jr.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,jr.queue(o,jr.createAlert(o,{level:jr.Alert.Level.warning,description:jr.Alert.Description.close_notify})),jr.flush(o)),o.closed(o)),o.reset(e)},o},gr.tls=gr.tls||{},jr)"function"!=typeof jr[ai]&&(gr.tls[ai]=jr[ai]);gr.tls.prf_tls1=yr,gr.tls.hmac_sha1=function(e,t,a){var r=gr.hmac.create();r.start("SHA1",e);var i=gr.util.createBuffer();return i.putInt32(t[0]),i.putInt32(t[1]),i.putByte(a.type),i.putByte(a.version.major),i.putByte(a.version.minor),i.putInt16(a.length),i.putBytes(a.fragment.bytes()),r.update(i.getBytes()),r.digest().getBytes()},gr.tls.createSessionCache=jr.createSessionCache,gr.tls.createConnection=jr.createConnection;var ri=S,ii=ri.tls;function ni(e,t,a){var r=t.entity===ri.tls.ConnectionEnd.client;e.read.cipherState={init:!1,cipher:ri.cipher.createDecipher("AES-CBC",r?a.keys.server_write_key:a.keys.client_write_key),iv:r?a.keys.server_write_IV:a.keys.client_write_IV},e.write.cipherState={init:!1,cipher:ri.cipher.createCipher("AES-CBC",r?a.keys.client_write_key:a.keys.server_write_key),iv:r?a.keys.client_write_IV:a.keys.server_write_IV},e.read.cipherFunction=ci,e.write.cipherFunction=oi,e.read.macLength=e.write.macLength=a.mac_length,e.read.macFunction=e.write.macFunction=ii.hmac_sha1}function oi(e,t){var a,r=!1,i=t.macFunction(t.macKey,t.sequenceNumber,e);e.fragment.putBytes(i),t.updateSequenceNumber(),a=e.version.minor===ii.Versions.TLS_1_0.minor?t.cipherState.init?null:t.cipherState.iv:ri.random.getBytesSync(16),t.cipherState.init=!0;var n=t.cipherState.cipher;return n.start({iv:a}),e.version.minor>=ii.Versions.TLS_1_1.minor&&n.output.putBytes(a),n.update(e.fragment),n.finish(si)&&(e.fragment=n.output,e.length=e.fragment.length(),r=!0),r}function si(e,t,a){if(!a){var r=e-t.length()%e;t.fillWithByte(r-1,r)}return!0}function ui(e,t,a){var r=!0;if(a){for(var i=t.length(),n=t.last(),o=i-1-n;o<i-1;++o)r=r&&t.at(o)==n;r&&t.truncate(n+1)}return r}function ci(e,t){var a,r=!1;a=e.version.minor===ii.Versions.TLS_1_0.minor?t.cipherState.init?null:t.cipherState.iv:e.fragment.getBytes(16),t.cipherState.init=!0;var i=t.cipherState.cipher;i.start({iv:a}),i.update(e.fragment),r=i.finish(ui);var n=t.macLength,o=ri.random.getBytesSync(n),s=i.output.length();s>=n?(e.fragment=i.output.getBytes(s-n),o=i.output.getBytes(n)):e.fragment=i.output.getBytes(),e.fragment=ri.util.createBuffer(e.fragment),e.length=e.fragment.length();var u=t.macFunction(t.macKey,t.sequenceNumber,e);return t.updateSequenceNumber(),r=function(e,t,a){var r=ri.hmac.create();return r.start("SHA1",e),r.update(t),t=r.digest().getBytes(),r.start(null,null),r.update(a),a=r.digest().getBytes(),t===a}(t.macKey,o,u)&&r,r}ii.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=ii.BulkCipherAlgorithm.aes,e.cipher_type=ii.CipherType.block,e.enc_key_length=16,e.block_length=16,e.fixed_iv_length=16,e.record_iv_length=16,e.mac_algorithm=ii.MACAlgorithm.hmac_sha1,e.mac_length=20,e.mac_key_length=20},initConnectionState:ni},ii.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=ii.BulkCipherAlgorithm.aes,e.cipher_type=ii.CipherType.block,e.enc_key_length=32,e.block_length=16,e.fixed_iv_length=16,e.record_iv_length=16,e.mac_algorithm=ii.MACAlgorithm.hmac_sha1,e.mac_length=20,e.mac_key_length=20},initConnectionState:ni};var li=S;li.debug=li.debug||{},li.debug.storage={},li.debug.get=function(e,t){var a;return void 0===e?a=li.debug.storage:e in li.debug.storage&&(a=void 0===t?li.debug.storage[e]:li.debug.storage[e][t]),a},li.debug.set=function(e,t,a){e in li.debug.storage||(li.debug.storage[e]={}),li.debug.storage[e][t]=a},li.debug.clear=function(e,t){void 0===e?li.debug.storage={}:e in li.debug.storage&&(void 0===t?delete li.debug.storage[e]:delete li.debug.storage[e][t])};var pi=S,hi=pi.sha512=pi.sha512||{};pi.md.sha512=pi.md.algorithms.sha512=hi;var di=pi.sha384=pi.sha512.sha384=pi.sha512.sha384||{};di.create=function(){return hi.create("SHA-384")},pi.md.sha384=pi.md.algorithms.sha384=di,pi.sha512.sha256=pi.sha512.sha256||{create:function(){return hi.create("SHA-512/256")}},pi.md["sha512/256"]=pi.md.algorithms["sha512/256"]=pi.sha512.sha256,pi.sha512.sha224=pi.sha512.sha224||{create:function(){return hi.create("SHA-512/224")}},pi.md["sha512/224"]=pi.md.algorithms["sha512/224"]=pi.sha512.sha224,hi.create=function(e){if(fi||(mi=String.fromCharCode(128),mi+=pi.util.fillString(String.fromCharCode(0),128),gi=[[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]],(yi={})["SHA-512"]=[[1779033703,4089235720],[3144134277,2227873595],[1013904242,4271175723],[2773480762,1595750129],[1359893119,2917565137],[2600822924,725511199],[528734635,4215389547],[1541459225,327033209]],yi["SHA-384"]=[[3418070365,3238371032],[1654270250,914150663],[2438529370,812702999],[355462360,4144912697],[1731405415,4290775857],[2394180231,1750603025],[3675008525,1694076839],[1203062813,3204075428]],yi["SHA-512/256"]=[[573645204,4230739756],[2673172387,3360449730],[596883563,1867755857],[2520282905,1497426621],[2519219938,2827943907],[3193839141,1401305490],[721525244,746961066],[246885852,2177182882]],yi["SHA-512/224"]=[[2352822216,424955298],[1944164710,2312950998],[502970286,855612546],[1738396948,1479516111],[258812777,2077511080],[2011393907,79989058],[1067287976,1780299464],[286451373,2446758561]],fi=!0),void 0===e&&(e="SHA-512"),!(e in yi))throw new Error("Invalid SHA-512 algorithm: "+e);for(var t=yi[e],a=null,r=pi.util.createBuffer(),i=new Array(80),n=0;n<80;++n)i[n]=new Array(2);var o=64;switch(e){case"SHA-384":o=48;break;case"SHA-512/256":o=32;break;case"SHA-512/224":o=28}var s={algorithm:e.replace("-","").toLowerCase(),blockLength:128,digestLength:o,messageLength:0,fullMessageLength:null,messageLengthSize:16,start:function(){s.messageLength=0,s.fullMessageLength=s.messageLength128=[];for(var e=s.messageLengthSize/4,i=0;i<e;++i)s.fullMessageLength.push(0);r=pi.util.createBuffer(),a=new Array(t.length);for(i=0;i<t.length;++i)a[i]=t[i].slice(0);return s}};return s.start(),s.update=function(e,t){"utf8"===t&&(e=pi.util.encodeUtf8(e));var n=e.length;s.messageLength+=n,n=[n/4294967296>>>0,n>>>0];for(var o=s.fullMessageLength.length-1;o>=0;--o)s.fullMessageLength[o]+=n[1],n[1]=n[0]+(s.fullMessageLength[o]/4294967296>>>0),s.fullMessageLength[o]=s.fullMessageLength[o]>>>0,n[0]=n[1]/4294967296>>>0;return r.putBytes(e),ki(a,i,r),(r.read>2048||0===r.length())&&r.compact(),s},s.digest=function(){var t=pi.util.createBuffer();t.putBytes(r.bytes());var n,o=s.fullMessageLength[s.fullMessageLength.length-1]+s.messageLengthSize&s.blockLength-1;t.putBytes(mi.substr(0,s.blockLength-o));for(var u=8*s.fullMessageLength[0],c=0;c<s.fullMessageLength.length-1;++c)u+=(n=8*s.fullMessageLength[c+1])/4294967296>>>0,t.putInt32(u>>>0),u=n>>>0;t.putInt32(u);var l=new Array(a.length);for(c=0;c<a.length;++c)l[c]=a[c].slice(0);ki(l,i,t);var p,h=pi.util.createBuffer();p="SHA-512"===e?l.length:"SHA-384"===e?l.length-2:l.length-4;for(c=0;c<p;++c)h.putInt32(l[c][0]),c===p-1&&"SHA-512/224"===e||h.putInt32(l[c][1]);return h},s};var mi=null,fi=!1,gi=null,yi=null;function ki(e,t,a){for(var r,i,n,o,s,u,c,l,p,h,d,m,f,g,y,k,v,b,w,j,C,E,S,T,_,I,A,B,N,R,z,L,x,D=a.length();D>=128;){for(A=0;A<16;++A)t[A][0]=a.getInt32()>>>0,t[A][1]=a.getInt32()>>>0;for(;A<80;++A)r=(((B=(R=t[A-2])[0])>>>19|(N=R[1])<<13)^(N>>>29|B<<3)^B>>>6)>>>0,i=((B<<13|N>>>19)^(N<<3|B>>>29)^(B<<26|N>>>6))>>>0,n=(((B=(L=t[A-15])[0])>>>1|(N=L[1])<<31)^(B>>>8|N<<24)^B>>>7)>>>0,o=((B<<31|N>>>1)^(B<<24|N>>>8)^(B<<25|N>>>7))>>>0,z=t[A-7],x=t[A-16],N=i+z[1]+o+x[1],t[A][0]=r+z[0]+n+x[0]+(N/4294967296>>>0)>>>0,t[A][1]=N>>>0;for(d=e[0][0],m=e[0][1],f=e[1][0],g=e[1][1],y=e[2][0],k=e[2][1],v=e[3][0],b=e[3][1],w=e[4][0],j=e[4][1],C=e[5][0],E=e[5][1],S=e[6][0],T=e[6][1],_=e[7][0],I=e[7][1],A=0;A<80;++A)c=((w>>>14|j<<18)^(w>>>18|j<<14)^(j>>>9|w<<23))>>>0,l=(S^w&(C^S))>>>0,s=((d>>>28|m<<4)^(m>>>2|d<<30)^(m>>>7|d<<25))>>>0,u=((d<<4|m>>>28)^(m<<30|d>>>2)^(m<<25|d>>>7))>>>0,p=(d&f|y&(d^f))>>>0,h=(m&g|k&(m^g))>>>0,N=I+(((w<<18|j>>>14)^(w<<14|j>>>18)^(j<<23|w>>>9))>>>0)+((T^j&(E^T))>>>0)+gi[A][1]+t[A][1],r=_+c+l+gi[A][0]+t[A][0]+(N/4294967296>>>0)>>>0,i=N>>>0,n=s+p+((N=u+h)/4294967296>>>0)>>>0,o=N>>>0,_=S,I=T,S=C,T=E,C=w,E=j,w=v+r+((N=b+i)/4294967296>>>0)>>>0,j=N>>>0,v=y,b=k,y=f,k=g,f=d,g=m,d=r+n+((N=i+o)/4294967296>>>0)>>>0,m=N>>>0;N=e[0][1]+m,e[0][0]=e[0][0]+d+(N/4294967296>>>0)>>>0,e[0][1]=N>>>0,N=e[1][1]+g,e[1][0]=e[1][0]+f+(N/4294967296>>>0)>>>0,e[1][1]=N>>>0,N=e[2][1]+k,e[2][0]=e[2][0]+y+(N/4294967296>>>0)>>>0,e[2][1]=N>>>0,N=e[3][1]+b,e[3][0]=e[3][0]+v+(N/4294967296>>>0)>>>0,e[3][1]=N>>>0,N=e[4][1]+j,e[4][0]=e[4][0]+w+(N/4294967296>>>0)>>>0,e[4][1]=N>>>0,N=e[5][1]+E,e[5][0]=e[5][0]+C+(N/4294967296>>>0)>>>0,e[5][1]=N>>>0,N=e[6][1]+T,e[6][0]=e[6][0]+S+(N/4294967296>>>0)>>>0,e[6][1]=N>>>0,N=e[7][1]+I,e[7][0]=e[7][0]+_+(N/4294967296>>>0)>>>0,e[7][1]=N>>>0,D-=128}}var vi={},bi=S.asn1;vi.privateKeyValidator={name:"PrivateKeyInfo",tagClass:bi.Class.UNIVERSAL,type:bi.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:bi.Class.UNIVERSAL,type:bi.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:bi.Class.UNIVERSAL,type:bi.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:bi.Class.UNIVERSAL,type:bi.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:bi.Class.UNIVERSAL,type:bi.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},vi.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:bi.Class.UNIVERSAL,type:bi.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:bi.Class.UNIVERSAL,type:bi.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:bi.Class.UNIVERSAL,type:bi.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{tagClass:bi.Class.UNIVERSAL,type:bi.Type.BITSTRING,constructed:!1,composed:!0,captureBitStringValue:"ed25519PublicKey"}]};var wi=S,ji=vi,Ci=ji.publicKeyValidator,Ei=ji.privateKeyValidator;if(void 0===Si)var Si=wi.jsbn.BigInteger;var Ti=wi.util.ByteBuffer,_i="undefined"==typeof Buffer?Uint8Array:Buffer;wi.pki=wi.pki||{},wi.pki.ed25519=wi.ed25519=wi.ed25519||{};var Ii=wi.ed25519;function Ai(e){var t=e.message;if(t instanceof Uint8Array||t instanceof _i)return t;var a=e.encoding;if(void 0===t){if(!e.md)throw new TypeError('"options.message" or "options.md" not specified.');t=e.md.digest().getBytes(),a="binary"}if("string"==typeof t&&!a)throw new TypeError('"options.encoding" must be "binary" or "utf8".');if("string"==typeof t){if("undefined"!=typeof Buffer)return Buffer.from(t,a);t=new Ti(t,a)}else if(!(t instanceof Ti))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 r=new _i(t.length()),i=0;i<r.length;++i)r[i]=t.at(i);return r}Ii.constants={},Ii.constants.PUBLIC_KEY_BYTE_LENGTH=32,Ii.constants.PRIVATE_KEY_BYTE_LENGTH=64,Ii.constants.SEED_BYTE_LENGTH=32,Ii.constants.SIGN_BYTE_LENGTH=64,Ii.constants.HASH_BYTE_LENGTH=64,Ii.generateKeyPair=function(e){var t=(e=e||{}).seed;if(void 0===t)t=wi.random.getBytesSync(Ii.constants.SEED_BYTE_LENGTH);else if("string"==typeof t){if(t.length!==Ii.constants.SEED_BYTE_LENGTH)throw new TypeError('"seed" must be '+Ii.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=Ai({message:t,encoding:"binary"});for(var a=new _i(Ii.constants.PUBLIC_KEY_BYTE_LENGTH),r=new _i(Ii.constants.PRIVATE_KEY_BYTE_LENGTH),i=0;i<32;++i)r[i]=t[i];return function(e,t){var a,r=[Ji(),Ji(),Ji(),Ji()],i=Oi(t,32);for(i[0]&=248,i[31]&=127,i[31]|=64,Yi(r,i),Fi(e,r),a=0;a<32;++a)t[a+32]=e[a]}(a,r),{publicKey:a,privateKey:r}},Ii.privateKeyFromAsn1=function(e){var t={},a=[];if(!wi.asn1.validate(e,Ei,t,a)){var r=new Error("Invalid Key.");throw r.errors=a,r}var i=wi.asn1.derToOid(t.privateKeyOid),n=wi.oids.EdDSA25519;if(i!==n)throw new Error('Invalid OID "'+i+'"; OID must be "'+n+'".');var o=t.privateKey;return{privateKeyBytes:Ai({message:wi.asn1.fromDer(o).value,encoding:"binary"})}},Ii.publicKeyFromAsn1=function(e){var t={},a=[];if(!wi.asn1.validate(e,Ci,t,a)){var r=new Error("Invalid Key.");throw r.errors=a,r}var i=wi.asn1.derToOid(t.publicKeyOid),n=wi.oids.EdDSA25519;if(i!==n)throw new Error('Invalid OID "'+i+'"; OID must be "'+n+'".');var o=t.ed25519PublicKey;if(o.length!==Ii.constants.PUBLIC_KEY_BYTE_LENGTH)throw new Error("Key length is invalid.");return Ai({message:o,encoding:"binary"})},Ii.publicKeyFromPrivateKey=function(e){var t=Ai({message:(e=e||{}).privateKey,encoding:"binary"});if(t.length!==Ii.constants.PRIVATE_KEY_BYTE_LENGTH)throw new TypeError('"options.privateKey" must have a byte length of '+Ii.constants.PRIVATE_KEY_BYTE_LENGTH);for(var a=new _i(Ii.constants.PUBLIC_KEY_BYTE_LENGTH),r=0;r<a.length;++r)a[r]=t[32+r];return a},Ii.sign=function(e){var t=Ai(e=e||{}),a=Ai({message:e.privateKey,encoding:"binary"});if(a.length===Ii.constants.SEED_BYTE_LENGTH)a=Ii.generateKeyPair({seed:a}).privateKey;else if(a.length!==Ii.constants.PRIVATE_KEY_BYTE_LENGTH)throw new TypeError('"options.privateKey" must have a byte length of '+Ii.constants.SEED_BYTE_LENGTH+" or "+Ii.constants.PRIVATE_KEY_BYTE_LENGTH);var r=new _i(Ii.constants.SIGN_BYTE_LENGTH+t.length);!function(e,t,a,r){var i,n,o=new Float64Array(64),s=[Ji(),Ji(),Ji(),Ji()],u=Oi(r,32);u[0]&=248,u[31]&=127,u[31]|=64;var c=a+64;for(i=0;i<a;++i)e[64+i]=t[i];for(i=0;i<32;++i)e[32+i]=u[32+i];var l=Oi(e.subarray(32),a+32);for(Vi(l),Yi(s,l),Fi(e,s),i=32;i<64;++i)e[i]=r[i];var p=Oi(e,a+64);for(Vi(p),i=32;i<64;++i)o[i]=0;for(i=0;i<32;++i)o[i]=l[i];for(i=0;i<32;++i)for(n=0;n<32;n++)o[i+n]+=p[i]*u[n];Pi(e.subarray(32),o)}(r,t,t.length,a);for(var i=new _i(Ii.constants.SIGN_BYTE_LENGTH),n=0;n<i.length;++n)i[n]=r[n];return i},Ii.verify=function(e){var t=Ai(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 a=Ai({message:e.signature,encoding:"binary"});if(a.length!==Ii.constants.SIGN_BYTE_LENGTH)throw new TypeError('"options.signature" must have a byte length of '+Ii.constants.SIGN_BYTE_LENGTH);var r=Ai({message:e.publicKey,encoding:"binary"});if(r.length!==Ii.constants.PUBLIC_KEY_BYTE_LENGTH)throw new TypeError('"options.publicKey" must have a byte length of '+Ii.constants.PUBLIC_KEY_BYTE_LENGTH);var i,n=new _i(Ii.constants.SIGN_BYTE_LENGTH+t.length),o=new _i(Ii.constants.SIGN_BYTE_LENGTH+t.length);for(i=0;i<Ii.constants.SIGN_BYTE_LENGTH;++i)n[i]=a[i];for(i=0;i<t.length;++i)n[i+Ii.constants.SIGN_BYTE_LENGTH]=t[i];return function(e,t,a,r){var i,n=new _i(32),o=[Ji(),Ji(),Ji(),Ji()],s=[Ji(),Ji(),Ji(),Ji()];if(-1,a<64)return-1;if(function(e,t){var a=Ji(),r=Ji(),i=Ji(),n=Ji(),o=Ji(),s=Ji(),u=Ji();Zi(e[2],Ni),function(e,t){var a;for(a=0;a<16;++a)e[a]=t[2*a]+(t[2*a+1]<<8);e[15]&=32767}(e[1],t),an(i,e[1]),rn(n,i,Ri),tn(i,i,e[2]),en(n,e[2],n),an(o,n),an(s,o),rn(u,s,o),rn(a,u,i),rn(a,a,n),function(e,t){var a,r=Ji();for(a=0;a<16;++a)r[a]=t[a];for(a=250;a>=0;--a)an(r,r),1!==a&&rn(r,r,t);for(a=0;a<16;++a)e[a]=r[a]}(a,a),rn(a,a,i),rn(a,a,n),rn(a,a,n),rn(e[0],a,n),an(r,e[0]),rn(r,r,n),Hi(r,i)&&rn(e[0],e[0],Ui);if(an(r,e[0]),rn(r,r,n),Hi(r,i))return-1;Wi(e[0])===t[31]>>7&&tn(e[0],Bi,e[0]);return rn(e[3],e[0],e[1]),0}(s,r))return-1;for(i=0;i<a;++i)e[i]=t[i];for(i=0;i<32;++i)e[i+32]=r[i];var u=Oi(e,a);if(Vi(u),Qi(o,s,u),Yi(s,t.subarray(32)),Mi(o,s),Fi(n,o),a-=64,Gi(t,0,n,0)){for(i=0;i<a;++i)e[i]=0;return-1}for(i=0;i<a;++i)e[i]=t[i+64];return a}(o,n,n.length,r)>=0};var Bi=Ji(),Ni=Ji([1]),Ri=Ji([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),zi=Ji([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),Li=Ji([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),xi=Ji([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),Di=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]),Ui=Ji([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function Oi(e,t){var a=wi.md.sha512.create(),r=new Ti(e);a.update(r.getBytes(t),"binary");var i=a.digest().getBytes();if("undefined"!=typeof Buffer)return Buffer.from(i,"binary");for(var n=new _i(Ii.constants.HASH_BYTE_LENGTH),o=0;o<64;++o)n[o]=i.charCodeAt(o);return n}function Pi(e,t){var a,r,i,n;for(r=63;r>=32;--r){for(a=0,i=r-32,n=r-12;i<n;++i)t[i]+=a-16*t[r]*Di[i-(r-32)],a=t[i]+128>>8,t[i]-=256*a;t[i]+=a,t[r]=0}for(a=0,i=0;i<32;++i)t[i]+=a-(t[31]>>4)*Di[i],a=t[i]>>8,t[i]&=255;for(i=0;i<32;++i)t[i]-=a*Di[i];for(r=0;r<32;++r)t[r+1]+=t[r]>>8,e[r]=255&t[r]}function Vi(e){for(var t=new Float64Array(64),a=0;a<64;++a)t[a]=e[a],e[a]=0;Pi(e,t)}function Mi(e,t){var a=Ji(),r=Ji(),i=Ji(),n=Ji(),o=Ji(),s=Ji(),u=Ji(),c=Ji(),l=Ji();tn(a,e[1],e[0]),tn(l,t[1],t[0]),rn(a,a,l),en(r,e[0],e[1]),en(l,t[0],t[1]),rn(r,r,l),rn(i,e[3],t[3]),rn(i,i,zi),rn(n,e[2],t[2]),en(n,n,n),tn(o,r,a),tn(s,n,i),en(u,n,i),en(c,r,a),rn(e[0],o,s),rn(e[1],c,u),rn(e[2],u,s),rn(e[3],o,c)}function Ki(e,t,a){for(var r=0;r<4;++r)$i(e[r],t[r],a)}function Fi(e,t){var a=Ji(),r=Ji(),i=Ji();!function(e,t){var a,r=Ji();for(a=0;a<16;++a)r[a]=t[a];for(a=253;a>=0;--a)an(r,r),2!==a&&4!==a&&rn(r,r,t);for(a=0;a<16;++a)e[a]=r[a]}(i,t[2]),rn(a,t[0],i),rn(r,t[1],i),qi(e,r),e[31]^=Wi(a)<<7}function qi(e,t){var a,r,i,n=Ji(),o=Ji();for(a=0;a<16;++a)o[a]=t[a];for(Xi(o),Xi(o),Xi(o),r=0;r<2;++r){for(n[0]=o[0]-65517,a=1;a<15;++a)n[a]=o[a]-65535-(n[a-1]>>16&1),n[a-1]&=65535;n[15]=o[15]-32767-(n[14]>>16&1),i=n[15]>>16&1,n[14]&=65535,$i(o,n,1-i)}for(a=0;a<16;a++)e[2*a]=255&o[a],e[2*a+1]=o[a]>>8}function Hi(e,t){var a=new _i(32),r=new _i(32);return qi(a,e),qi(r,t),Gi(a,0,r,0)}function Gi(e,t,a,r){return function(e,t,a,r,i){var n,o=0;for(n=0;n<i;++n)o|=e[t+n]^a[r+n];return(1&o-1>>>8)-1}(e,t,a,r,32)}function Wi(e){var t=new _i(32);return qi(t,e),1&t[0]}function Qi(e,t,a){var r,i;for(Zi(e[0],Bi),Zi(e[1],Ni),Zi(e[2],Ni),Zi(e[3],Bi),i=255;i>=0;--i)Ki(e,t,r=a[i/8|0]>>(7&i)&1),Mi(t,e),Mi(e,e),Ki(e,t,r)}function Yi(e,t){var a=[Ji(),Ji(),Ji(),Ji()];Zi(a[0],Li),Zi(a[1],xi),Zi(a[2],Ni),rn(a[3],Li,xi),Qi(e,a,t)}function Zi(e,t){var a;for(a=0;a<16;a++)e[a]=0|t[a]}function Xi(e){var t,a,r=1;for(t=0;t<16;++t)a=e[t]+r+65535,r=Math.floor(a/65536),e[t]=a-65536*r;e[0]+=r-1+37*(r-1)}function $i(e,t,a){for(var r,i=~(a-1),n=0;n<16;++n)r=i&(e[n]^t[n]),e[n]^=r,t[n]^=r}function Ji(e){var t,a=new Float64Array(16);if(e)for(t=0;t<e.length;++t)a[t]=e[t];return a}function en(e,t,a){for(var r=0;r<16;++r)e[r]=t[r]+a[r]}function tn(e,t,a){for(var r=0;r<16;++r)e[r]=t[r]-a[r]}function an(e,t){rn(e,t,t)}function rn(e,t,a){var r,i,n=0,o=0,s=0,u=0,c=0,l=0,p=0,h=0,d=0,m=0,f=0,g=0,y=0,k=0,v=0,b=0,w=0,j=0,C=0,E=0,S=0,T=0,_=0,I=0,A=0,B=0,N=0,R=0,z=0,L=0,x=0,D=a[0],U=a[1],O=a[2],P=a[3],V=a[4],M=a[5],K=a[6],F=a[7],q=a[8],H=a[9],G=a[10],W=a[11],Q=a[12],Y=a[13],Z=a[14],X=a[15];n+=(r=t[0])*D,o+=r*U,s+=r*O,u+=r*P,c+=r*V,l+=r*M,p+=r*K,h+=r*F,d+=r*q,m+=r*H,f+=r*G,g+=r*W,y+=r*Q,k+=r*Y,v+=r*Z,b+=r*X,o+=(r=t[1])*D,s+=r*U,u+=r*O,c+=r*P,l+=r*V,p+=r*M,h+=r*K,d+=r*F,m+=r*q,f+=r*H,g+=r*G,y+=r*W,k+=r*Q,v+=r*Y,b+=r*Z,w+=r*X,s+=(r=t[2])*D,u+=r*U,c+=r*O,l+=r*P,p+=r*V,h+=r*M,d+=r*K,m+=r*F,f+=r*q,g+=r*H,y+=r*G,k+=r*W,v+=r*Q,b+=r*Y,w+=r*Z,j+=r*X,u+=(r=t[3])*D,c+=r*U,l+=r*O,p+=r*P,h+=r*V,d+=r*M,m+=r*K,f+=r*F,g+=r*q,y+=r*H,k+=r*G,v+=r*W,b+=r*Q,w+=r*Y,j+=r*Z,C+=r*X,c+=(r=t[4])*D,l+=r*U,p+=r*O,h+=r*P,d+=r*V,m+=r*M,f+=r*K,g+=r*F,y+=r*q,k+=r*H,v+=r*G,b+=r*W,w+=r*Q,j+=r*Y,C+=r*Z,E+=r*X,l+=(r=t[5])*D,p+=r*U,h+=r*O,d+=r*P,m+=r*V,f+=r*M,g+=r*K,y+=r*F,k+=r*q,v+=r*H,b+=r*G,w+=r*W,j+=r*Q,C+=r*Y,E+=r*Z,S+=r*X,p+=(r=t[6])*D,h+=r*U,d+=r*O,m+=r*P,f+=r*V,g+=r*M,y+=r*K,k+=r*F,v+=r*q,b+=r*H,w+=r*G,j+=r*W,C+=r*Q,E+=r*Y,S+=r*Z,T+=r*X,h+=(r=t[7])*D,d+=r*U,m+=r*O,f+=r*P,g+=r*V,y+=r*M,k+=r*K,v+=r*F,b+=r*q,w+=r*H,j+=r*G,C+=r*W,E+=r*Q,S+=r*Y,T+=r*Z,_+=r*X,d+=(r=t[8])*D,m+=r*U,f+=r*O,g+=r*P,y+=r*V,k+=r*M,v+=r*K,b+=r*F,w+=r*q,j+=r*H,C+=r*G,E+=r*W,S+=r*Q,T+=r*Y,_+=r*Z,I+=r*X,m+=(r=t[9])*D,f+=r*U,g+=r*O,y+=r*P,k+=r*V,v+=r*M,b+=r*K,w+=r*F,j+=r*q,C+=r*H,E+=r*G,S+=r*W,T+=r*Q,_+=r*Y,I+=r*Z,A+=r*X,f+=(r=t[10])*D,g+=r*U,y+=r*O,k+=r*P,v+=r*V,b+=r*M,w+=r*K,j+=r*F,C+=r*q,E+=r*H,S+=r*G,T+=r*W,_+=r*Q,I+=r*Y,A+=r*Z,B+=r*X,g+=(r=t[11])*D,y+=r*U,k+=r*O,v+=r*P,b+=r*V,w+=r*M,j+=r*K,C+=r*F,E+=r*q,S+=r*H,T+=r*G,_+=r*W,I+=r*Q,A+=r*Y,B+=r*Z,N+=r*X,y+=(r=t[12])*D,k+=r*U,v+=r*O,b+=r*P,w+=r*V,j+=r*M,C+=r*K,E+=r*F,S+=r*q,T+=r*H,_+=r*G,I+=r*W,A+=r*Q,B+=r*Y,N+=r*Z,R+=r*X,k+=(r=t[13])*D,v+=r*U,b+=r*O,w+=r*P,j+=r*V,C+=r*M,E+=r*K,S+=r*F,T+=r*q,_+=r*H,I+=r*G,A+=r*W,B+=r*Q,N+=r*Y,R+=r*Z,z+=r*X,v+=(r=t[14])*D,b+=r*U,w+=r*O,j+=r*P,C+=r*V,E+=r*M,S+=r*K,T+=r*F,_+=r*q,I+=r*H,A+=r*G,B+=r*W,N+=r*Q,R+=r*Y,z+=r*Z,L+=r*X,b+=(r=t[15])*D,o+=38*(j+=r*O),s+=38*(C+=r*P),u+=38*(E+=r*V),c+=38*(S+=r*M),l+=38*(T+=r*K),p+=38*(_+=r*F),h+=38*(I+=r*q),d+=38*(A+=r*H),m+=38*(B+=r*G),f+=38*(N+=r*W),g+=38*(R+=r*Q),y+=38*(z+=r*Y),k+=38*(L+=r*Z),v+=38*(x+=r*X),n=(r=(n+=38*(w+=r*U))+(i=1)+65535)-65536*(i=Math.floor(r/65536)),o=(r=o+i+65535)-65536*(i=Math.floor(r/65536)),s=(r=s+i+65535)-65536*(i=Math.floor(r/65536)),u=(r=u+i+65535)-65536*(i=Math.floor(r/65536)),c=(r=c+i+65535)-65536*(i=Math.floor(r/65536)),l=(r=l+i+65535)-65536*(i=Math.floor(r/65536)),p=(r=p+i+65535)-65536*(i=Math.floor(r/65536)),h=(r=h+i+65535)-65536*(i=Math.floor(r/65536)),d=(r=d+i+65535)-65536*(i=Math.floor(r/65536)),m=(r=m+i+65535)-65536*(i=Math.floor(r/65536)),f=(r=f+i+65535)-65536*(i=Math.floor(r/65536)),g=(r=g+i+65535)-65536*(i=Math.floor(r/65536)),y=(r=y+i+65535)-65536*(i=Math.floor(r/65536)),k=(r=k+i+65535)-65536*(i=Math.floor(r/65536)),v=(r=v+i+65535)-65536*(i=Math.floor(r/65536)),b=(r=b+i+65535)-65536*(i=Math.floor(r/65536)),n=(r=(n+=i-1+37*(i-1))+(i=1)+65535)-65536*(i=Math.floor(r/65536)),o=(r=o+i+65535)-65536*(i=Math.floor(r/65536)),s=(r=s+i+65535)-65536*(i=Math.floor(r/65536)),u=(r=u+i+65535)-65536*(i=Math.floor(r/65536)),c=(r=c+i+65535)-65536*(i=Math.floor(r/65536)),l=(r=l+i+65535)-65536*(i=Math.floor(r/65536)),p=(r=p+i+65535)-65536*(i=Math.floor(r/65536)),h=(r=h+i+65535)-65536*(i=Math.floor(r/65536)),d=(r=d+i+65535)-65536*(i=Math.floor(r/65536)),m=(r=m+i+65535)-65536*(i=Math.floor(r/65536)),f=(r=f+i+65535)-65536*(i=Math.floor(r/65536)),g=(r=g+i+65535)-65536*(i=Math.floor(r/65536)),y=(r=y+i+65535)-65536*(i=Math.floor(r/65536)),k=(r=k+i+65535)-65536*(i=Math.floor(r/65536)),v=(r=v+i+65535)-65536*(i=Math.floor(r/65536)),b=(r=b+i+65535)-65536*(i=Math.floor(r/65536)),n+=i-1+37*(i-1),e[0]=n,e[1]=o,e[2]=s,e[3]=u,e[4]=c,e[5]=l,e[6]=p,e[7]=h,e[8]=d,e[9]=m,e[10]=f,e[11]=g,e[12]=y,e[13]=k,e[14]=v,e[15]=b}var nn=S;nn.kem=nn.kem||{};var on=nn.jsbn.BigInteger;function sn(e,t,a,r){e.generate=function(e,i){for(var n=new nn.util.ByteBuffer,o=Math.ceil(i/r)+a,s=new nn.util.ByteBuffer,u=a;u<o;++u){s.putInt32(u),t.start(),t.update(e+s.getBytes());var c=t.digest();n.putBytes(c.getBytes(r))}return n.truncate(n.length()-i),n.getBytes()}}nn.kem.rsa={},nn.kem.rsa.create=function(e,t){var a=(t=t||{}).prng||nn.random,r={encrypt:function(t,r){var i,n=Math.ceil(t.n.bitLength()/8);do{i=new on(nn.util.bytesToHex(a.getBytesSync(n)),16).mod(t.n)}while(i.compareTo(on.ONE)<=0);var o=n-(i=nn.util.hexToBytes(i.toString(16))).length;return o>0&&(i=nn.util.fillString(String.fromCharCode(0),o)+i),{encapsulation:t.encrypt(i,"NONE"),key:e.generate(i,r)}},decrypt:function(t,a,r){var i=t.decrypt(a,"NONE");return e.generate(i,r)}};return r},nn.kem.kdf1=function(e,t){sn(this,e,0,t||e.digestLength)},nn.kem.kdf2=function(e,t){sn(this,e,1,t||e.digestLength)};var un=S;un.log=un.log||{},un.log.levels=["none","error","warning","info","debug","verbose","max"];var cn={},ln=[],pn=null;un.log.LEVEL_LOCKED=2,un.log.NO_LEVEL_CHECK=4,un.log.INTERPOLATE=8;for(var hn=0;hn<un.log.levels.length;++hn){var dn=un.log.levels[hn];cn[dn]={index:hn,name:dn.toUpperCase()}}un.log.logMessage=function(e){for(var t=cn[e.level].index,a=0;a<ln.length;++a){var r=ln[a];if(r.flags&un.log.NO_LEVEL_CHECK)r.f(e);else t<=cn[r.level].index&&r.f(r,e)}},un.log.prepareStandard=function(e){"standard"in e||(e.standard=cn[e.level].name+" ["+e.category+"] "+e.message)},un.log.prepareFull=function(e){if(!("full"in e)){var t=[e.message];t=t.concat([]||e.arguments),e.full=un.util.format.apply(this,t)}},un.log.prepareStandardFull=function(e){"standardFull"in e||(un.log.prepareStandard(e),e.standardFull=e.standard)};var mn=["error","warning","info","debug","verbose"];for(hn=0;hn<mn.length;++hn)!function(e){un.log[e]=function(t,a){var r=Array.prototype.slice.call(arguments).slice(2),i={timestamp:new Date,level:e,category:t,message:a,arguments:r};un.log.logMessage(i)}}(mn[hn]);if(un.log.makeLogger=function(e){var t={flags:0,f:e};return un.log.setLevel(t,"none"),t},un.log.setLevel=function(e,t){var a=!1;if(e&&!(e.flags&un.log.LEVEL_LOCKED))for(var r=0;r<un.log.levels.length;++r){if(t==un.log.levels[r]){e.level=t,a=!0;break}}return a},un.log.lock=function(e,t){void 0===t||t?e.flags|=un.log.LEVEL_LOCKED:e.flags&=~un.log.LEVEL_LOCKED},un.log.addLogger=function(e){ln.push(e)},"undefined"!=typeof console&&"log"in console){var fn;if(console.error&&console.warn&&console.info&&console.debug){var gn={error:console.error,warning:console.warn,info:console.info,debug:console.debug,verbose:console.debug},yn=function(e,t){un.log.prepareStandard(t);var a=gn[t.level],r=[t.standard];r=r.concat(t.arguments.slice()),a.apply(console,r)};fn=un.log.makeLogger(yn)}else{yn=function(e,t){un.log.prepareStandardFull(t),console.log(t.standardFull)};fn=un.log.makeLogger(yn)}un.log.setLevel(fn,"debug"),un.log.addLogger(fn),pn=fn}else console={log:function(){}};if(null!==pn){var kn=un.util.getQueryVariables();if("console.level"in kn&&un.log.setLevel(pn,kn["console.level"].slice(-1)[0]),"console.lock"in kn)"true"==kn["console.lock"].slice(-1)[0]&&un.log.lock(pn)}un.log.consoleLogger=pn;var vn={};({get exports(){return vn},set exports(e){vn=e}}).exports=we;var bn=S,wn=bn.asn1,jn=bn.pkcs7=bn.pkcs7||{};function Cn(e){var t={},a=[];if(!wn.validate(e,jn.asn1.recipientInfoValidator,t,a)){var r=new Error("Cannot read PKCS#7 RecipientInfo. ASN.1 object is not an PKCS#7 RecipientInfo.");throw r.errors=a,r}return{version:t.version.charCodeAt(0),issuer:bn.pki.RDNAttributesAsArray(t.issuer),serialNumber:bn.util.createBuffer(t.serial).toHex(),encryptedContent:{algorithm:wn.derToOid(t.encAlgorithm),parameter:t.encParameter.value,content:t.encKey}}}function En(e){for(var t,a=[],r=0;r<e.length;++r)a.push((t=e[r],wn.create(wn.Class.UNIVERSAL,wn.Type.SEQUENCE,!0,[wn.create(wn.Class.UNIVERSAL,wn.Type.INTEGER,!1,wn.integerToDer(t.version).getBytes()),wn.create(wn.Class.UNIVERSAL,wn.Type.SEQUENCE,!0,[bn.pki.distinguishedNameToAsn1({attributes:t.issuer}),wn.create(wn.Class.UNIVERSAL,wn.Type.INTEGER,!1,bn.util.hexToBytes(t.serialNumber))]),wn.create(wn.Class.UNIVERSAL,wn.Type.SEQUENCE,!0,[wn.create(wn.Class.UNIVERSAL,wn.Type.OID,!1,wn.oidToDer(t.encryptedContent.algorithm).getBytes()),wn.create(wn.Class.UNIVERSAL,wn.Type.NULL,!1,"")]),wn.create(wn.Class.UNIVERSAL,wn.Type.OCTETSTRING,!1,t.encryptedContent.content)])));return a}function Sn(e){var t=wn.create(wn.Class.UNIVERSAL,wn.Type.SEQUENCE,!0,[wn.create(wn.Class.UNIVERSAL,wn.Type.INTEGER,!1,wn.integerToDer(e.version).getBytes()),wn.create(wn.Class.UNIVERSAL,wn.Type.SEQUENCE,!0,[bn.pki.distinguishedNameToAsn1({attributes:e.issuer}),wn.create(wn.Class.UNIVERSAL,wn.Type.INTEGER,!1,bn.util.hexToBytes(e.serialNumber))]),wn.create(wn.Class.UNIVERSAL,wn.Type.SEQUENCE,!0,[wn.create(wn.Class.UNIVERSAL,wn.Type.OID,!1,wn.oidToDer(e.digestAlgorithm).getBytes()),wn.create(wn.Class.UNIVERSAL,wn.Type.NULL,!1,"")])]);if(e.authenticatedAttributesAsn1&&t.value.push(e.authenticatedAttributesAsn1),t.value.push(wn.create(wn.Class.UNIVERSAL,wn.Type.SEQUENCE,!0,[wn.create(wn.Class.UNIVERSAL,wn.Type.OID,!1,wn.oidToDer(e.signatureAlgorithm).getBytes()),wn.create(wn.Class.UNIVERSAL,wn.Type.NULL,!1,"")])),t.value.push(wn.create(wn.Class.UNIVERSAL,wn.Type.OCTETSTRING,!1,e.signature)),e.unauthenticatedAttributes.length>0){for(var a=wn.create(wn.Class.CONTEXT_SPECIFIC,1,!0,[]),r=0;r<e.unauthenticatedAttributes.length;++r){var i=e.unauthenticatedAttributes[r];a.values.push(Tn(i))}t.value.push(a)}return t}function Tn(e){var t;if(e.type===bn.pki.oids.contentType)t=wn.create(wn.Class.UNIVERSAL,wn.Type.OID,!1,wn.oidToDer(e.value).getBytes());else if(e.type===bn.pki.oids.messageDigest)t=wn.create(wn.Class.UNIVERSAL,wn.Type.OCTETSTRING,!1,e.value.bytes());else if(e.type===bn.pki.oids.signingTime){var a=new Date("1950-01-01T00:00:00Z"),r=new Date("2050-01-01T00:00:00Z"),i=e.value;if("string"==typeof i){var n=Date.parse(i);i=isNaN(n)?13===i.length?wn.utcTimeToDate(i):wn.generalizedTimeToDate(i):new Date(n)}t=i>=a&&i<r?wn.create(wn.Class.UNIVERSAL,wn.Type.UTCTIME,!1,wn.dateToUtcTime(i)):wn.create(wn.Class.UNIVERSAL,wn.Type.GENERALIZEDTIME,!1,wn.dateToGeneralizedTime(i))}return wn.create(wn.Class.UNIVERSAL,wn.Type.SEQUENCE,!0,[wn.create(wn.Class.UNIVERSAL,wn.Type.OID,!1,wn.oidToDer(e.type).getBytes()),wn.create(wn.Class.UNIVERSAL,wn.Type.SET,!0,[t])])}function _n(e,t,a){var r={};if(!wn.validate(t,a,r,[])){var i=new Error("Cannot read PKCS#7 message. ASN.1 object is not a supported PKCS#7 message.");throw i.errors=i,i}if(wn.derToOid(r.contentType)!==bn.pki.oids.data)throw new Error("Unsupported PKCS#7 message. Only wrapped ContentType Data supported.");if(r.encryptedContent){var n="";if(bn.util.isArray(r.encryptedContent))for(var o=0;o<r.encryptedContent.length;++o){if(r.encryptedContent[o].type!==wn.Type.OCTETSTRING)throw new Error("Malformed PKCS#7 message, expecting encrypted content constructed of only OCTET STRING objects.");n+=r.encryptedContent[o].value}else n=r.encryptedContent;e.encryptedContent={algorithm:wn.derToOid(r.encAlgorithm),parameter:bn.util.createBuffer(r.encParameter.value),content:bn.util.createBuffer(n)}}if(r.content){n="";if(bn.util.isArray(r.content))for(o=0;o<r.content.length;++o){if(r.content[o].type!==wn.Type.OCTETSTRING)throw new Error("Malformed PKCS#7 message, expecting content constructed of only OCTET STRING objects.");n+=r.content[o].value}else n=r.content;e.content=bn.util.createBuffer(n)}return e.version=r.version.charCodeAt(0),e.rawCapture=r,r}function In(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 bn.pki.oids["aes128-CBC"]:case bn.pki.oids["aes192-CBC"]:case bn.pki.oids["aes256-CBC"]:t=bn.aes.createDecryptionCipher(e.encryptedContent.key);break;case bn.pki.oids.desCBC:case bn.pki.oids["des-EDE3-CBC"]:t=bn.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}}jn.messageFromPem=function(e){var t=bn.pem.decode(e)[0];if("PKCS7"!==t.type){var a=new Error('Could not convert PKCS#7 message from PEM; PEM header type is not "PKCS#7".');throw a.headerType=t.type,a}if(t.procType&&"ENCRYPTED"===t.procType.type)throw new Error("Could not convert PKCS#7 message from PEM; PEM is encrypted.");var r=wn.fromDer(t.body);return jn.messageFromAsn1(r)},jn.messageToPem=function(e,t){var a={type:"PKCS7",body:wn.toDer(e.toAsn1()).getBytes()};return bn.pem.encode(a,{maxline:t})},jn.messageFromAsn1=function(e){var t={},a=[];if(!wn.validate(e,jn.asn1.contentInfoValidator,t,a)){var r=new Error("Cannot read PKCS#7 message. ASN.1 object is not an PKCS#7 ContentInfo.");throw r.errors=a,r}var i,n=wn.derToOid(t.contentType);switch(n){case bn.pki.oids.envelopedData:i=jn.createEnvelopedData();break;case bn.pki.oids.encryptedData:i=jn.createEncryptedData();break;case bn.pki.oids.signedData:i=jn.createSignedData();break;default:throw new Error("Cannot read PKCS#7 message. ContentType with OID "+n+" is not (yet) supported.")}return i.fromAsn1(t.content.value[0]),i},jn.createSignedData=function(){var e=null;return e={type:bn.pki.oids.signedData,version:1,certificates:[],crls:[],signers:[],digestAlgorithmIdentifiers:[],contentInfo:null,signerInfos:[],fromAsn1:function(t){if(_n(e,t,jn.asn1.signedDataValidator),e.certificates=[],e.crls=[],e.digestAlgorithmIdentifiers=[],e.contentInfo=null,e.signerInfos=[],e.rawCapture.certificates)for(var a=e.rawCapture.certificates.value,r=0;r<a.length;++r)e.certificates.push(bn.pki.certificateFromAsn1(a[r]))},toAsn1:function(){e.contentInfo||e.sign();for(var t=[],a=0;a<e.certificates.length;++a)t.push(bn.pki.certificateToAsn1(e.certificates[a]));var r=[],i=wn.create(wn.Class.CONTEXT_SPECIFIC,0,!0,[wn.create(wn.Class.UNIVERSAL,wn.Type.SEQUENCE,!0,[wn.create(wn.Class.UNIVERSAL,wn.Type.INTEGER,!1,wn.integerToDer(e.version).getBytes()),wn.create(wn.Class.UNIVERSAL,wn.Type.SET,!0,e.digestAlgorithmIdentifiers),e.contentInfo])]);return t.length>0&&i.value[0].value.push(wn.create(wn.Class.CONTEXT_SPECIFIC,0,!0,t)),r.length>0&&i.value[0].value.push(wn.create(wn.Class.CONTEXT_SPECIFIC,1,!0,r)),i.value[0].value.push(wn.create(wn.Class.UNIVERSAL,wn.Type.SET,!0,e.signerInfos)),wn.create(wn.Class.UNIVERSAL,wn.Type.SEQUENCE,!0,[wn.create(wn.Class.UNIVERSAL,wn.Type.OID,!1,wn.oidToDer(e.type).getBytes()),i])},addSigner:function(t){var a=t.issuer,r=t.serialNumber;if(t.certificate){var i=t.certificate;"string"==typeof i&&(i=bn.pki.certificateFromPem(i)),a=i.issuer.attributes,r=i.serialNumber}var n=t.key;if(!n)throw new Error("Could not add PKCS#7 signer; no private key specified.");"string"==typeof n&&(n=bn.pki.privateKeyFromPem(n));var o=t.digestAlgorithm||bn.pki.oids.sha1;switch(o){case bn.pki.oids.sha1:case bn.pki.oids.sha256:case bn.pki.oids.sha384:case bn.pki.oids.sha512:case bn.pki.oids.md5:break;default:throw new Error("Could not add PKCS#7 signer; unknown message digest algorithm: "+o)}var s=t.authenticatedAttributes||[];if(s.length>0){for(var u=!1,c=!1,l=0;l<s.length;++l){var p=s[l];if(u||p.type!==bn.pki.oids.contentType){if(c||p.type!==bn.pki.oids.messageDigest);else if(c=!0,u)break}else if(u=!0,c)break}if(!u||!c)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:n,version:1,issuer:a,serialNumber:r,digestAlgorithm:o,signatureAlgorithm:bn.pki.oids.rsaEncryption,signature:null,authenticatedAttributes:s,unauthenticatedAttributes:[]})},sign:function(t){var a;(t=t||{},"object"!=typeof e.content||null===e.contentInfo)&&(e.contentInfo=wn.create(wn.Class.UNIVERSAL,wn.Type.SEQUENCE,!0,[wn.create(wn.Class.UNIVERSAL,wn.Type.OID,!1,wn.oidToDer(bn.pki.oids.data).getBytes())]),"content"in e&&(e.content instanceof bn.util.ByteBuffer?a=e.content.bytes():"string"==typeof e.content&&(a=bn.util.encodeUtf8(e.content)),t.detached?e.detachedContent=wn.create(wn.Class.UNIVERSAL,wn.Type.OCTETSTRING,!1,a):e.contentInfo.value.push(wn.create(wn.Class.CONTEXT_SPECIFIC,0,!0,[wn.create(wn.Class.UNIVERSAL,wn.Type.OCTETSTRING,!1,a)]))));if(0!==e.signers.length){var r=function(){for(var t={},a=0;a<e.signers.length;++a){var r=e.signers[a];(i=r.digestAlgorithm)in t||(t[i]=bn.md[bn.pki.oids[i]].create()),0===r.authenticatedAttributes.length?r.md=t[i]:r.md=bn.md[bn.pki.oids[i]].create()}for(var i in e.digestAlgorithmIdentifiers=[],t)e.digestAlgorithmIdentifiers.push(wn.create(wn.Class.UNIVERSAL,wn.Type.SEQUENCE,!0,[wn.create(wn.Class.UNIVERSAL,wn.Type.OID,!1,wn.oidToDer(i).getBytes()),wn.create(wn.Class.UNIVERSAL,wn.Type.NULL,!1,"")]));return t}();!function(t){var a;a=e.detachedContent?e.detachedContent:(a=e.contentInfo.value[1]).value[0];if(!a)throw new Error("Could not sign PKCS#7 message; there is no content to sign.");var r=wn.derToOid(e.contentInfo.value[0].value),i=wn.toDer(a);for(var n in i.getByte(),wn.getBerValueLength(i),i=i.getBytes(),t)t[n].start().update(i);for(var o=new Date,s=0;s<e.signers.length;++s){var u=e.signers[s];if(0===u.authenticatedAttributes.length){if(r!==bn.pki.oids.data)throw new Error("Invalid signer; authenticatedAttributes must be present when the ContentInfo content type is not PKCS#7 Data.")}else{u.authenticatedAttributesAsn1=wn.create(wn.Class.CONTEXT_SPECIFIC,0,!0,[]);for(var c=wn.create(wn.Class.UNIVERSAL,wn.Type.SET,!0,[]),l=0;l<u.authenticatedAttributes.length;++l){var p=u.authenticatedAttributes[l];p.type===bn.pki.oids.messageDigest?p.value=t[u.digestAlgorithm].digest():p.type===bn.pki.oids.signingTime&&(p.value||(p.value=o)),c.value.push(Tn(p)),u.authenticatedAttributesAsn1.value.push(Tn(p))}i=wn.toDer(c).getBytes(),u.md.start().update(i)}u.signature=u.key.sign(u.md,"RSASSA-PKCS1-V1_5")}e.signerInfos=function(e){for(var t=[],a=0;a<e.length;++a)t.push(Sn(e[a]));return t}(e.signers)}(r)}},verify:function(){throw new Error("PKCS#7 signature verification not yet implemented.")},addCertificate:function(t){"string"==typeof t&&(t=bn.pki.certificateFromPem(t)),e.certificates.push(t)},addCertificateRevokationList:function(e){throw new Error("PKCS#7 CRL support not yet implemented.")}},e},jn.createEncryptedData=function(){var e=null;return e={type:bn.pki.oids.encryptedData,version:0,encryptedContent:{algorithm:bn.pki.oids["aes256-CBC"]},fromAsn1:function(t){_n(e,t,jn.asn1.encryptedDataValidator)},decrypt:function(t){void 0!==t&&(e.encryptedContent.key=t),In(e)}},e},jn.createEnvelopedData=function(){var e=null;return e={type:bn.pki.oids.envelopedData,version:0,recipients:[],encryptedContent:{algorithm:bn.pki.oids["aes256-CBC"]},fromAsn1:function(t){var a=_n(e,t,jn.asn1.envelopedDataValidator);e.recipients=function(e){for(var t=[],a=0;a<e.length;++a)t.push(Cn(e[a]));return t}(a.recipientInfos.value)},toAsn1:function(){return wn.create(wn.Class.UNIVERSAL,wn.Type.SEQUENCE,!0,[wn.create(wn.Class.UNIVERSAL,wn.Type.OID,!1,wn.oidToDer(e.type).getBytes()),wn.create(wn.Class.CONTEXT_SPECIFIC,0,!0,[wn.create(wn.Class.UNIVERSAL,wn.Type.SEQUENCE,!0,[wn.create(wn.Class.UNIVERSAL,wn.Type.INTEGER,!1,wn.integerToDer(e.version).getBytes()),wn.create(wn.Class.UNIVERSAL,wn.Type.SET,!0,En(e.recipients)),wn.create(wn.Class.UNIVERSAL,wn.Type.SEQUENCE,!0,(t=e.encryptedContent,[wn.create(wn.Class.UNIVERSAL,wn.Type.OID,!1,wn.oidToDer(bn.pki.oids.data).getBytes()),wn.create(wn.Class.UNIVERSAL,wn.Type.SEQUENCE,!0,[wn.create(wn.Class.UNIVERSAL,wn.Type.OID,!1,wn.oidToDer(t.algorithm).getBytes()),wn.create(wn.Class.UNIVERSAL,wn.Type.OCTETSTRING,!1,t.parameter.getBytes())]),wn.create(wn.Class.CONTEXT_SPECIFIC,0,!0,[wn.create(wn.Class.UNIVERSAL,wn.Type.OCTETSTRING,!1,t.content.getBytes())])]))])])]);var t},findRecipient:function(t){for(var a=t.issuer.attributes,r=0;r<e.recipients.length;++r){var i=e.recipients[r],n=i.issuer;if(i.serialNumber===t.serialNumber&&n.length===a.length){for(var o=!0,s=0;s<a.length;++s)if(n[s].type!==a[s].type||n[s].value!==a[s].value){o=!1;break}if(o)return i}}return null},decrypt:function(t,a){if(void 0===e.encryptedContent.key&&void 0!==t&&void 0!==a)switch(t.encryptedContent.algorithm){case bn.pki.oids.rsaEncryption:case bn.pki.oids.desCBC:var r=a.decrypt(t.encryptedContent.content);e.encryptedContent.key=bn.util.createBuffer(r);break;default:throw new Error("Unsupported asymmetric cipher, OID "+t.encryptedContent.algorithm)}In(e)},addRecipient:function(t){e.recipients.push({version:0,issuer:t.issuer.attributes,serialNumber:t.serialNumber,encryptedContent:{algorithm:bn.pki.oids.rsaEncryption,key:t.publicKey}})},encrypt:function(t,a){if(void 0===e.encryptedContent.content){var r,i,n;switch(a=a||e.encryptedContent.algorithm,t=t||e.encryptedContent.key,a){case bn.pki.oids["aes128-CBC"]:r=16,i=16,n=bn.aes.createEncryptionCipher;break;case bn.pki.oids["aes192-CBC"]:r=24,i=16,n=bn.aes.createEncryptionCipher;break;case bn.pki.oids["aes256-CBC"]:r=32,i=16,n=bn.aes.createEncryptionCipher;break;case bn.pki.oids["des-EDE3-CBC"]:r=24,i=8,n=bn.des.createEncryptionCipher;break;default:throw new Error("Unsupported symmetric cipher, OID "+a)}if(void 0===t)t=bn.util.createBuffer(bn.random.getBytes(r));else if(t.length()!=r)throw new Error("Symmetric key has wrong length; got "+t.length()+" bytes, expected "+r+".");e.encryptedContent.algorithm=a,e.encryptedContent.key=t,e.encryptedContent.parameter=bn.util.createBuffer(bn.random.getBytes(i));var o=n(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 s=0;s<e.recipients.length;++s){var u=e.recipients[s];if(void 0===u.encryptedContent.content){if(u.encryptedContent.algorithm!==bn.pki.oids.rsaEncryption)throw new Error("Unsupported asymmetric cipher, OID "+u.encryptedContent.algorithm);u.encryptedContent.content=u.encryptedContent.key.encrypt(e.encryptedContent.key.data)}}}},e};var An=S,Bn=An.ssh=An.ssh||{};function Nn(e,t){var a=t.toString(16);a[0]>="8"&&(a="00"+a);var r=An.util.hexToBytes(a);e.putInt32(r.length),e.putBytes(r)}function Rn(e,t){e.putInt32(t.length),e.putString(t)}function zn(){for(var e=An.md.sha1.create(),t=arguments.length,a=0;a<t;++a)e.update(arguments[a]);return e.digest()}Bn.privateKeyToPutty=function(e,t,a){var r="ssh-rsa",i=""===(t=t||"")?"none":"aes256-cbc",n="PuTTY-User-Key-File-2: "+r+"\r\n";n+="Encryption: "+i+"\r\n",n+="Comment: "+(a=a||"")+"\r\n";var o=An.util.createBuffer();Rn(o,r),Nn(o,e.e),Nn(o,e.n);var s=An.util.encode64(o.bytes(),64),u=Math.floor(s.length/66)+1;n+="Public-Lines: "+u+"\r\n",n+=s;var c,l=An.util.createBuffer();if(Nn(l,e.d),Nn(l,e.p),Nn(l,e.q),Nn(l,e.qInv),t){var p=l.length()+16-1;p-=p%16;var h=zn(l.bytes());h.truncate(h.length()-p+l.length()),l.putBuffer(h);var d=An.util.createBuffer();d.putBuffer(zn("\0\0\0\0",t)),d.putBuffer(zn("\0\0\0",t));var m=An.aes.createEncryptionCipher(d.truncate(8),"CBC");m.start(An.util.createBuffer().fillWithByte(0,16)),m.update(l.copy()),m.finish();var f=m.output;f.truncate(16),c=An.util.encode64(f.bytes(),64)}else c=An.util.encode64(l.bytes(),64);n+="\r\nPrivate-Lines: "+(u=Math.floor(c.length/66)+1)+"\r\n",n+=c;var g=zn("putty-private-key-file-mac-key",t),y=An.util.createBuffer();Rn(y,r),Rn(y,i),Rn(y,a),y.putInt32(o.length()),y.putBuffer(o),y.putInt32(l.length()),y.putBuffer(l);var k=An.hmac.create();return k.start("sha1",g),k.update(y.bytes()),n+="\r\nPrivate-MAC: "+k.digest().toHex()+"\r\n"},Bn.publicKeyToOpenSSH=function(e,t){var a="ssh-rsa";t=t||"";var r=An.util.createBuffer();return Rn(r,a),Nn(r,e.e),Nn(r,e.n),a+" "+An.util.encode64(r.bytes())+" "+t},Bn.privateKeyToOpenSSH=function(e,t){return t?An.pki.encryptRsaPrivateKey(e,t,{legacy:!0,algorithm:"aes128"}):An.pki.privateKeyToPem(e)},Bn.getPublicKeyFingerprint=function(e,t){var a=(t=t||{}).md||An.md.md5.create(),r=An.util.createBuffer();Rn(r,"ssh-rsa"),Nn(r,e.e),Nn(r,e.n),a.start(),a.update(r.getBytes());var i=a.digest();if("hex"===t.encoding){var n=i.toHex();return t.delimiter?n.match(/.{2}/g).join(t.delimiter):n}if("binary"===t.encoding)return i.getBytes();if(t.encoding)throw new Error('Unknown encoding "'+t.encoding+'".');return i};var Ln=S,xn="forge.task",Dn={},Un=0;Ln.debug.set(xn,"tasks",Dn);var On={};Ln.debug.set(xn,"queues",On);var Pn="ready",Vn="running",Mn="blocked",Kn="sleeping",Fn="done",qn="error",Hn="stop",Gn="start",Wn="block",Qn="unblock",Yn="sleep",Zn="wakeup",Xn="cancel",$n="fail",Jn={};Jn[Pn]={},Jn[Pn][Hn]=Pn,Jn[Pn][Gn]=Vn,Jn[Pn][Xn]=Fn,Jn[Pn][$n]=qn,Jn[Vn]={},Jn[Vn][Hn]=Pn,Jn[Vn][Gn]=Vn,Jn[Vn][Wn]=Mn,Jn[Vn][Qn]=Vn,Jn[Vn][Yn]=Kn,Jn[Vn][Zn]=Vn,Jn[Vn][Xn]=Fn,Jn[Vn][$n]=qn,Jn[Mn]={},Jn[Mn][Hn]=Mn,Jn[Mn][Gn]=Mn,Jn[Mn][Wn]=Mn,Jn[Mn][Qn]=Mn,Jn[Mn][Yn]=Mn,Jn[Mn][Zn]=Mn,Jn[Mn][Xn]=Fn,Jn[Mn][$n]=qn,Jn[Kn]={},Jn[Kn][Hn]=Kn,Jn[Kn][Gn]=Kn,Jn[Kn][Wn]=Kn,Jn[Kn][Qn]=Kn,Jn[Kn][Yn]=Kn,Jn[Kn][Zn]=Kn,Jn[Kn][Xn]=Fn,Jn[Kn][$n]=qn,Jn[Fn]={},Jn[Fn][Hn]=Fn,Jn[Fn][Gn]=Fn,Jn[Fn][Wn]=Fn,Jn[Fn][Qn]=Fn,Jn[Fn][Yn]=Fn,Jn[Fn][Zn]=Fn,Jn[Fn][Xn]=Fn,Jn[Fn][$n]=qn,Jn[qn]={},Jn[qn][Hn]=qn,Jn[qn][Gn]=qn,Jn[qn][Wn]=qn,Jn[qn][Qn]=qn,Jn[qn][Yn]=qn,Jn[qn][Zn]=qn,Jn[qn][Xn]=qn,Jn[qn][$n]=qn;var eo=function(e){this.id=-1,this.name=e.name||"?",this.parent=e.parent||null,this.run=e.run,this.subtasks=[],this.error=!1,this.state=Pn,this.blocks=0,this.timeoutId=null,this.swapTime=null,this.userData=null,this.id=Un++,Dn[this.id]=this};eo.prototype.debug=function(e){e=e||"",Ln.log.debug(xn,e,"[%s][%s] task:",this.id,this.name,this,"subtasks:",this.subtasks.length,"queue:",On)},eo.prototype.next=function(e,t){"function"==typeof e&&(t=e,e=this.name);var a=new eo({run:t,name:e,parent:this});return a.state=Vn,a.type=this.type,a.successCallback=this.successCallback||null,a.failureCallback=this.failureCallback||null,this.subtasks.push(a),this},eo.prototype.parallel=function(e,t){return Ln.util.isArray(e)&&(t=e,e=this.name),this.next(e,(function(a){var r=a;r.block(t.length);for(var i=function(e,a){Ln.task.start({type:e,run:function(e){t[a](e)},success:function(e){r.unblock()},failure:function(e){r.unblock()}})},n=0;n<t.length;n++){i(e+"__parallel-"+a.id+"-"+n,n)}}))},eo.prototype.stop=function(){this.state=Jn[this.state][Hn]},eo.prototype.start=function(){this.error=!1,this.state=Jn[this.state][Gn],this.state===Vn&&(this.start=new Date,this.run(this),to(this,0))},eo.prototype.block=function(e){e=void 0===e?1:e,this.blocks+=e,this.blocks>0&&(this.state=Jn[this.state][Wn])},eo.prototype.unblock=function(e){return e=void 0===e?1:e,this.blocks-=e,0===this.blocks&&this.state!==Fn&&(this.state=Vn,to(this,0)),this.blocks},eo.prototype.sleep=function(e){e=void 0===e?0:e,this.state=Jn[this.state][Yn];var t=this;this.timeoutId=setTimeout((function(){t.timeoutId=null,t.state=Vn,to(t,0)}),e)},eo.prototype.wait=function(e){e.wait(this)},eo.prototype.wakeup=function(){this.state===Kn&&(cancelTimeout(this.timeoutId),this.timeoutId=null,this.state=Vn,to(this,0))},eo.prototype.cancel=function(){this.state=Jn[this.state][Xn],this.permitsNeeded=0,null!==this.timeoutId&&(cancelTimeout(this.timeoutId),this.timeoutId=null),this.subtasks=[]},eo.prototype.fail=function(e){if(this.error=!0,ao(this,!0),e)e.error=this.error,e.swapTime=this.swapTime,e.userData=this.userData,to(e,0);else{if(null!==this.parent){for(var t=this.parent;null!==t.parent;)t.error=this.error,t.swapTime=this.swapTime,t.userData=this.userData,t=t.parent;ao(t,!0)}this.failureCallback&&this.failureCallback(this)}};var to=function(e,t){var a=t>30||+new Date-e.swapTime>20,r=function(t){if(t++,e.state===Vn)if(a&&(e.swapTime=+new Date),e.subtasks.length>0){var r=e.subtasks.shift();r.error=e.error,r.swapTime=e.swapTime,r.userData=e.userData,r.run(r),r.error||to(r,t)}else ao(e),e.error||null!==e.parent&&(e.parent.error=e.error,e.parent.swapTime=e.swapTime,e.parent.userData=e.userData,to(e.parent,t))};a?setTimeout(r,0):r(t)},ao=function(e,t){e.state=Fn,delete Dn[e.id],null===e.parent&&(e.type in On?0===On[e.type].length?Ln.log.error(xn,"[%s][%s] task queue empty [%s]",e.id,e.name,e.type):On[e.type][0]!==e?Ln.log.error(xn,"[%s][%s] task not first in queue [%s]",e.id,e.name,e.type):(On[e.type].shift(),0===On[e.type].length?delete On[e.type]:On[e.type][0].start()):Ln.log.error(xn,"[%s][%s] task queue missing [%s]",e.id,e.name,e.type),t||(e.error&&e.failureCallback?e.failureCallback(e):!e.error&&e.successCallback&&e.successCallback(e)))};Ln.task=Ln.task||{},Ln.task.start=function(e){var t=new eo({run:e.run,name:e.name||"?"});t.type=e.type,t.successCallback=e.success||null,t.failureCallback=e.failure||null,t.type in On?On[e.type].push(t):(On[t.type]=[t],function(e){e.error=!1,e.state=Jn[e.state][Gn],setTimeout((function(){e.state===Vn&&(e.swapTime=+new Date,e.run(e),to(e,0))}),0)}(t))},Ln.task.cancel=function(e){e in On&&(On[e]=[On[e][0]])},Ln.task.createCondition=function(){var e={tasks:{},wait:function(t){t.id in e.tasks||(t.block(),e.tasks[t.id]=t)},notify:function(){var t=e.tasks;for(var a in e.tasks={},t)t[a].unblock()}};return e},E.exports=S;var ro=y(C);class io{crt;key;csr;detail;expires;constructor(e){this.crt=e.crt,this.key=e.key,this.csr=e.csr;const{detail:t,expires:a}=this.getCrtDetail(this.crt);this.detail=t,this.expires=a.getTime()}toCertInfo(){return{crt:this.crt,key:this.key,csr:this.csr}}getCrtDetail(e){const t=ro.pki.certificateFromPem(e.toString());return{detail:t,expires:t.validity.notAfter}}saveToFile(e,t){null==t&&(t=u.join(o.tmpdir(),"/certd/tmp/",Math.floor(1e6*Math.random())+"",`cert.${e}`));const a=u.dirname(t);return n.existsSync(a)||n.mkdirSync(a,{recursive:!0}),n.writeFileSync(t,this[e]),t}}var no,oo,so,uo={},co={},lo={},po={},ho={get exports(){return po},set exports(e){po=e}},mo={},fo={get exports(){return mo},set exports(e){mo=e}};function go(){if(no)return mo;return no=1,"undefined"==typeof process||!process.version||0===process.version.indexOf("v0.")||0===process.version.indexOf("v1.")&&0!==process.version.indexOf("v1.8.")?fo.exports={nextTick:function(e,t,a,r){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var i,n,o=arguments.length;switch(o){case 0:case 1:return process.nextTick(e);case 2:return process.nextTick((function(){e.call(null,t)}));case 3:return process.nextTick((function(){e.call(null,t,a)}));case 4:return process.nextTick((function(){e.call(null,t,a,r)}));default:for(i=new Array(o-1),n=0;n<i.length;)i[n++]=arguments[n];return process.nextTick((function(){e.apply(null,i)}))}}}:fo.exports=process,mo}var yo,ko={},vo={get exports(){return ko},set exports(e){ko=e}};function bo(){return yo||(yo=1,vo.exports=c),ko}var wo,jo={},Co={get exports(){return jo},set exports(e){jo=e}};function Eo(){return wo||(wo=1,function(e,t){var a=p,r=a.Buffer;function i(e,t){for(var a in e)t[a]=e[a]}function n(e,t,a){return r(e,t,a)}r.from&&r.alloc&&r.allocUnsafe&&r.allocUnsafeSlow?e.exports=a:(i(a,t),t.Buffer=n),i(r,n),n.from=function(e,t,a){if("number"==typeof e)throw new TypeError("Argument must not be a number");return r(e,t,a)},n.alloc=function(e,t,a){if("number"!=typeof e)throw new TypeError("Argument must be a number");var i=r(e);return void 0!==t?"string"==typeof a?i.fill(t,a):i.fill(t):i.fill(0),i},n.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r(e)},n.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return a.SlowBuffer(e)}}(Co,jo)),jo}var So,To={};function _o(){if(So)return To;function e(e){return Object.prototype.toString.call(e)}return So=1,To.isArray=function(t){return Array.isArray?Array.isArray(t):"[object Array]"===e(t)},To.isBoolean=function(e){return"boolean"==typeof e},To.isNull=function(e){return null===e},To.isNullOrUndefined=function(e){return null==e},To.isNumber=function(e){return"number"==typeof e},To.isString=function(e){return"string"==typeof e},To.isSymbol=function(e){return"symbol"==typeof e},To.isUndefined=function(e){return void 0===e},To.isRegExp=function(t){return"[object RegExp]"===e(t)},To.isObject=function(e){return"object"==typeof e&&null!==e},To.isDate=function(t){return"[object Date]"===e(t)},To.isError=function(t){return"[object Error]"===e(t)||t instanceof Error},To.isFunction=function(e){return"function"==typeof e},To.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},To.isBuffer=p.Buffer.isBuffer,To}var Io,Ao,Bo={},No={get exports(){return Bo},set exports(e){Bo=e}},Ro={},zo={get exports(){return Ro},set exports(e){Ro=e}};function Lo(){return Ao||(Ao=1,function(e){try{var t=require("util");if("function"!=typeof t.inherits)throw"";e.exports=t.inherits}catch(t){e.exports=(Io||(Io=1,"function"==typeof Object.create?zo.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:zo.exports=function(e,t){if(t){e.super_=t;var a=function(){};a.prototype=t.prototype,e.prototype=new a,e.prototype.constructor=e}}),Ro)}}(No)),Bo}var xo,Do,Uo,Oo,Po,Vo,Mo,Ko,Fo,qo={},Ho={get exports(){return qo},set exports(e){qo=e}};function Go(){return xo||(xo=1,function(e){var t=Eo().Buffer,a=h;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,a=""+t.data;t=t.next;)a+=e+t.data;return a},e.prototype.concat=function(e){if(0===this.length)return t.alloc(0);for(var a,r,i,n=t.allocUnsafe(e>>>0),o=this.head,s=0;o;)a=o.data,r=n,i=s,a.copy(r,i),s+=o.data.length,o=o.next;return n},e}(),a&&a.inspect&&a.inspect.custom&&(e.exports.prototype[a.inspect.custom]=function(){var e=a.inspect({length:this.length});return this.constructor.name+" "+e})}(Ho)),qo}function Wo(){if(Uo)return Do;Uo=1;var e=go();function t(e,t){e.emit("error",t)}return Do={destroy:function(a,r){var i=this,n=this._readableState&&this._readableState.destroyed,o=this._writableState&&this._writableState.destroyed;return n||o?(r?r(a):a&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,e.nextTick(t,this,a)):e.nextTick(t,this,a)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(a||null,(function(a){!r&&a?i._writableState?i._writableState.errorEmitted||(i._writableState.errorEmitted=!0,e.nextTick(t,i,a)):e.nextTick(t,i,a):r&&r(a)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}},Do}function Qo(){if(Mo)return Vo;Mo=1;var e=go();function t(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,a){var r=e.entry;e.entry=null;for(;r;){var i=r.callback;t.pendingcb--,i(a),r=r.next}t.corkedRequestsFree.next=e}(t,e)}}Vo=m;var a,r=!process.browser&&["v0.10","v0.9."].indexOf(process.version.slice(0,5))>-1?setImmediate:e.nextTick;m.WritableState=d;var i=Object.create(_o());i.inherits=Lo();var n={deprecate:Po?Oo:(Po=1,Oo=h.deprecate)},o=bo(),s=Eo().Buffer,u=(void 0!==g?g:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var c,l=Wo();function p(){}function d(i,n){a=a||Yo(),i=i||{};var o=n instanceof a;this.objectMode=!!i.objectMode,o&&(this.objectMode=this.objectMode||!!i.writableObjectMode);var s=i.highWaterMark,u=i.writableHighWaterMark,c=this.objectMode?16:16384;this.highWaterMark=s||0===s?s:o&&(u||0===u)?u:c,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var l=!1===i.decodeStrings;this.decodeStrings=!l,this.defaultEncoding=i.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,a){var i=t._writableState,n=i.sync,o=i.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(i),a)!function(t,a,r,i,n){--a.pendingcb,r?(e.nextTick(n,i),e.nextTick(w,t,a),t._writableState.errorEmitted=!0,t.emit("error",i)):(n(i),t._writableState.errorEmitted=!0,t.emit("error",i),w(t,a))}(t,i,n,a,o);else{var s=v(i);s||i.corked||i.bufferProcessing||!i.bufferedRequest||k(t,i),n?r(y,t,i,s,o):y(t,i,s,o)}}(n,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new t(this)}function m(e){if(a=a||Yo(),!(c.call(m,this)||this instanceof a))return new m(e);this._writableState=new d(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)),o.call(this)}function f(e,t,a,r,i,n,o){t.writelen=r,t.writecb=o,t.writing=!0,t.sync=!0,a?e._writev(i,t.onwrite):e._write(i,n,t.onwrite),t.sync=!1}function y(e,t,a,r){a||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,r(),w(e,t)}function k(e,a){a.bufferProcessing=!0;var r=a.bufferedRequest;if(e._writev&&r&&r.next){var i=a.bufferedRequestCount,n=new Array(i),o=a.corkedRequestsFree;o.entry=r;for(var s=0,u=!0;r;)n[s]=r,r.isBuf||(u=!1),r=r.next,s+=1;n.allBuffers=u,f(e,a,!0,a.length,n,"",o.finish),a.pendingcb++,a.lastBufferedRequest=null,o.next?(a.corkedRequestsFree=o.next,o.next=null):a.corkedRequestsFree=new t(a),a.bufferedRequestCount=0}else{for(;r;){var c=r.chunk,l=r.encoding,p=r.callback;if(f(e,a,!1,a.objectMode?1:c.length,c,l,p),r=r.next,a.bufferedRequestCount--,a.writing)break}null===r&&(a.lastBufferedRequest=null)}a.bufferedRequest=r,a.bufferProcessing=!1}function v(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function b(e,t){e._final((function(a){t.pendingcb--,a&&e.emit("error",a),t.prefinished=!0,e.emit("prefinish"),w(e,t)}))}function w(t,a){var r=v(a);return r&&(!function(t,a){a.prefinished||a.finalCalled||("function"==typeof t._final?(a.pendingcb++,a.finalCalled=!0,e.nextTick(b,t,a)):(a.prefinished=!0,t.emit("prefinish")))}(t,a),0===a.pendingcb&&(a.finished=!0,t.emit("finish"))),r}return i.inherits(m,o),d.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(d.prototype,"buffer",{get:n.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(c=Function.prototype[Symbol.hasInstance],Object.defineProperty(m,Symbol.hasInstance,{value:function(e){return!!c.call(this,e)||this===m&&(e&&e._writableState instanceof d)}})):c=function(e){return e instanceof this},m.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},m.prototype.write=function(t,a,r){var i,n=this._writableState,o=!1,c=!n.objectMode&&(i=t,s.isBuffer(i)||i instanceof u);return c&&!s.isBuffer(t)&&(t=function(e){return s.from(e)}(t)),"function"==typeof a&&(r=a,a=null),c?a="buffer":a||(a=n.defaultEncoding),"function"!=typeof r&&(r=p),n.ended?function(t,a){var r=new Error("write after end");t.emit("error",r),e.nextTick(a,r)}(this,r):(c||function(t,a,r,i){var n=!0,o=!1;return null===r?o=new TypeError("May not write null values to stream"):"string"==typeof r||void 0===r||a.objectMode||(o=new TypeError("Invalid non-string/buffer chunk")),o&&(t.emit("error",o),e.nextTick(i,o),n=!1),n}(this,n,t,r))&&(n.pendingcb++,o=function(e,t,a,r,i,n){if(!a){var o=function(e,t,a){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=s.from(t,a));return t}(t,r,i);r!==o&&(a=!0,i="buffer",r=o)}var u=t.objectMode?1:r.length;t.length+=u;var c=t.length<t.highWaterMark;c||(t.needDrain=!0);if(t.writing||t.corked){var l=t.lastBufferedRequest;t.lastBufferedRequest={chunk:r,encoding:i,isBuf:a,callback:n,next:null},l?l.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else f(e,t,!1,u,r,i,n);return c}(this,n,c,t,a,r)),o},m.prototype.cork=function(){this._writableState.corked++},m.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||k(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,a){a(new Error("_write() is not implemented"))},m.prototype._writev=null,m.prototype.end=function(t,a,r){var i=this._writableState;"function"==typeof t?(r=t,t=null,a=null):"function"==typeof a&&(r=a,a=null),null!=t&&this.write(t,a),i.corked&&(i.corked=1,this.uncork()),i.ending||function(t,a,r){a.ending=!0,w(t,a),r&&(a.finished?e.nextTick(r):t.once("finish",r));a.ended=!0,t.writable=!1}(this,i,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=l.destroy,m.prototype._undestroy=l.undestroy,m.prototype._destroy=function(e,t){this.end(),t(e)},Vo}function Yo(){if(Fo)return Ko;Fo=1;var e=go(),t=Object.keys||function(e){var t=[];for(var a in e)t.push(a);return t};Ko=u;var a=Object.create(_o());a.inherits=Lo();var r=os(),i=Qo();a.inherits(u,r);for(var n=t(i.prototype),o=0;o<n.length;o++){var s=n[o];u.prototype[s]||(u.prototype[s]=i.prototype[s])}function u(e){if(!(this instanceof u))return new u(e);r.call(this,e),i.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",c)}function c(){this.allowHalfOpen||this._writableState.ended||e.nextTick(l,this)}function l(e){e.end()}return Object.defineProperty(u.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(u.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)}}),u.prototype._destroy=function(t,a){this.push(null),this.end(),e.nextTick(a,t)},Ko}var Zo,Xo,$o,Jo,es,ts,as,rs,is={};function ns(){if(Zo)return is;Zo=1;var e=Eo().Buffer,t=e.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(a){var r;switch(this.encoding=function(a){var r=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}}(a);if("string"!=typeof r&&(e.isEncoding===t||!t(a)))throw new Error("Unknown encoding: "+a);return r||a}(a),this.encoding){case"utf16le":this.text=n,this.end=o,r=4;break;case"utf8":this.fillLast=i,r=4;break;case"base64":this.text=s,this.end=u,r=3;break;default:return this.write=c,void(this.end=l)}this.lastNeed=0,this.lastTotal=0,this.lastChar=e.allocUnsafe(r)}function r(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function i(e){var t=this.lastTotal-this.lastNeed,a=function(e,t,a){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==a?a: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 n(e,t){if((e.length-t)%2==0){var a=e.toString("utf16le",t);if(a){var r=a.charCodeAt(a.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],a.slice(0,-1)}return a}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function o(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var a=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,a)}return t}function s(e,t){var a=(e.length-t)%3;return 0===a?e.toString("base64",t):(this.lastNeed=3-a,this.lastTotal=3,1===a?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-a))}function u(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function c(e){return e.toString(this.encoding)}function l(e){return e&&e.length?this.write(e):""}return is.StringDecoder=a,a.prototype.write=function(e){if(0===e.length)return"";var t,a;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";a=this.lastNeed,this.lastNeed=0}else a=0;return a<e.length?t?t+this.text(e,a):this.text(e,a):t||""},a.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},a.prototype.text=function(e,t){var a=function(e,t,a){var i=t.length-1;if(i<a)return 0;var n=r(t[i]);if(n>=0)return n>0&&(e.lastNeed=n-1),n;if(--i<a||-2===n)return 0;if(n=r(t[i]),n>=0)return n>0&&(e.lastNeed=n-2),n;if(--i<a||-2===n)return 0;if(n=r(t[i]),n>=0)return n>0&&(2===n?n=0:e.lastNeed=n-3),n;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=a;var i=e.length-(a-this.lastNeed);return e.copy(this.lastChar,0,i),e.toString("utf8",t,i)},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},is}function os(){if($o)return Xo;$o=1;var e=go();Xo=k;var t,a=function(){if(so)return oo;so=1;var e={}.toString;return oo=Array.isArray||function(t){return"[object Array]"==e.call(t)}}();k.ReadableState=y,l.EventEmitter;var r=function(e,t){return e.listeners(t).length},i=bo(),n=Eo().Buffer,o=(void 0!==g?g:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var s=Object.create(_o());s.inherits=Lo();var u=h,c=void 0;c=u&&u.debuglog?u.debuglog("stream"):function(){};var p,d=Go(),m=Wo();s.inherits(k,i);var f=["error","close","destroy","pause","resume"];function y(e,a){e=e||{};var r=a instanceof(t=t||Yo());this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var i=e.highWaterMark,n=e.readableHighWaterMark,o=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:r&&(n||0===n)?n:o,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new d,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=ns().StringDecoder),this.decoder=new p(e.encoding),this.encoding=e.encoding)}function k(e){if(t=t||Yo(),!(this instanceof k))return new k(e);this._readableState=new y(e,this),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),i.call(this)}function v(e,t,a,r,i){var s,u=e._readableState;null===t?(u.reading=!1,function(e,t){if(t.ended)return;if(t.decoder){var a=t.decoder.end();a&&a.length&&(t.buffer.push(a),t.length+=t.objectMode?1:a.length)}t.ended=!0,C(e)}(e,u)):(i||(s=function(e,t){var a;r=t,n.isBuffer(r)||r instanceof o||"string"==typeof t||void 0===t||e.objectMode||(a=new TypeError("Invalid non-string/buffer chunk"));var r;return a}(u,t)),s?e.emit("error",s):u.objectMode||t&&t.length>0?("string"==typeof t||u.objectMode||Object.getPrototypeOf(t)===n.prototype||(t=function(e){return n.from(e)}(t)),r?u.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):b(e,u,t,!0):u.ended?e.emit("error",new Error("stream.push() after EOF")):(u.reading=!1,u.decoder&&!a?(t=u.decoder.write(t),u.objectMode||0!==t.length?b(e,u,t,!1):S(e,u)):b(e,u,t,!1))):r||(u.reading=!1));return function(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}(u)}function b(e,t,a,r){t.flowing&&0===t.length&&!t.sync?(e.emit("data",a),e.read(0)):(t.length+=t.objectMode?1:a.length,r?t.buffer.unshift(a):t.buffer.push(a),t.needReadable&&C(e)),S(e,t)}Object.defineProperty(k.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),k.prototype.destroy=m.destroy,k.prototype._undestroy=m.undestroy,k.prototype._destroy=function(e,t){this.push(null),t(e)},k.prototype.push=function(e,t){var a,r=this._readableState;return r.objectMode?a=!0:"string"==typeof e&&((t=t||r.defaultEncoding)!==r.encoding&&(e=n.from(e,t),t=""),a=!0),v(this,e,t,!1,a)},k.prototype.unshift=function(e){return v(this,e,null,!0,!1)},k.prototype.isPaused=function(){return!1===this._readableState.flowing},k.prototype.setEncoding=function(e){return p||(p=ns().StringDecoder),this._readableState.decoder=new p(e),this._readableState.encoding=e,this};var w=8388608;function j(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>=w?e=w:(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 C(t){var a=t._readableState;a.needReadable=!1,a.emittedReadable||(c("emitReadable",a.flowing),a.emittedReadable=!0,a.sync?e.nextTick(E,t):E(t))}function E(e){c("emit readable"),e.emit("readable"),A(e)}function S(t,a){a.readingMore||(a.readingMore=!0,e.nextTick(T,t,a))}function T(e,t){for(var a=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(c("maybeReadMore read 0"),e.read(0),a!==t.length);)a=t.length;t.readingMore=!1}function _(e){c("readable nexttick read 0"),e.read(0)}function I(e,t){t.reading||(c("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),A(e),t.flowing&&!t.reading&&e.read(0)}function A(e){var t=e._readableState;for(c("flow",t.flowing);t.flowing&&null!==e.read(););}function B(e,t){return 0===t.length?null:(t.objectMode?a=t.buffer.shift():!e||e>=t.length?(a=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):a=function(e,t,a){var r;e<t.head.data.length?(r=t.head.data.slice(0,e),t.head.data=t.head.data.slice(e)):r=e===t.head.data.length?t.shift():a?function(e,t){var a=t.head,r=1,i=a.data;e-=i.length;for(;a=a.next;){var n=a.data,o=e>n.length?n.length:e;if(o===n.length?i+=n:i+=n.slice(0,e),0===(e-=o)){o===n.length?(++r,a.next?t.head=a.next:t.head=t.tail=null):(t.head=a,a.data=n.slice(o));break}++r}return t.length-=r,i}(e,t):function(e,t){var a=n.allocUnsafe(e),r=t.head,i=1;r.data.copy(a),e-=r.data.length;for(;r=r.next;){var o=r.data,s=e>o.length?o.length:e;if(o.copy(a,a.length-e,0,s),0===(e-=s)){s===o.length?(++i,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=o.slice(s));break}++i}return t.length-=i,a}(e,t);return r}(e,t.buffer,t.decoder),a);var a}function N(t){var a=t._readableState;if(a.length>0)throw new Error('"endReadable()" called on non-empty stream');a.endEmitted||(a.ended=!0,e.nextTick(R,a,t))}function R(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function z(e,t){for(var a=0,r=e.length;a<r;a++)if(e[a]===t)return a;return-1}return k.prototype.read=function(e){c("read",e),e=parseInt(e,10);var t=this._readableState,a=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return c("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?N(this):C(this),null;if(0===(e=j(e,t))&&t.ended)return 0===t.length&&N(this),null;var r,i=t.needReadable;return c("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&c("length less than watermark",i=!0),t.ended||t.reading?c("reading or ended",i=!1):i&&(c("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=j(a,t))),null===(r=e>0?B(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),a!==e&&t.ended&&N(this)),null!==r&&this.emit("data",r),r},k.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},k.prototype.pipe=function(t,i){var n=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=t;break;case 1:o.pipes=[o.pipes,t];break;default:o.pipes.push(t)}o.pipesCount+=1,c("pipe count=%d opts=%j",o.pipesCount,i);var s=(!i||!1!==i.end)&&t!==process.stdout&&t!==process.stderr?l:k;function u(e,a){c("onunpipe"),e===n&&a&&!1===a.hasUnpiped&&(a.hasUnpiped=!0,c("cleanup"),t.removeListener("close",g),t.removeListener("finish",y),t.removeListener("drain",p),t.removeListener("error",f),t.removeListener("unpipe",u),n.removeListener("end",l),n.removeListener("end",k),n.removeListener("data",m),h=!0,!o.awaitDrain||t._writableState&&!t._writableState.needDrain||p())}function l(){c("onend"),t.end()}o.endEmitted?e.nextTick(s):n.once("end",s),t.on("unpipe",u);var p=function(e){return function(){var t=e._readableState;c("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&r(e,"data")&&(t.flowing=!0,A(e))}}(n);t.on("drain",p);var h=!1;var d=!1;function m(e){c("ondata"),d=!1,!1!==t.write(e)||d||((1===o.pipesCount&&o.pipes===t||o.pipesCount>1&&-1!==z(o.pipes,t))&&!h&&(c("false write response, pause",o.awaitDrain),o.awaitDrain++,d=!0),n.pause())}function f(e){c("onerror",e),k(),t.removeListener("error",f),0===r(t,"error")&&t.emit("error",e)}function g(){t.removeListener("finish",y),k()}function y(){c("onfinish"),t.removeListener("close",g),k()}function k(){c("unpipe"),n.unpipe(t)}return n.on("data",m),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?a(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(t,"error",f),t.once("close",g),t.once("finish",y),t.emit("pipe",n),o.flowing||(c("pipe resume"),n.resume()),t},k.prototype.unpipe=function(e){var t=this._readableState,a={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,a)),this;if(!e){var r=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var n=0;n<i;n++)r[n].emit("unpipe",this,{hasUnpiped:!1});return this}var o=z(t.pipes,e);return-1===o||(t.pipes.splice(o,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,a)),this},k.prototype.on=function(t,a){var r=i.prototype.on.call(this,t,a);if("data"===t)!1!==this._readableState.flowing&&this.resume();else if("readable"===t){var n=this._readableState;n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.emittedReadable=!1,n.reading?n.length&&C(this):e.nextTick(_,this))}return r},k.prototype.addListener=k.prototype.on,k.prototype.resume=function(){var t=this._readableState;return t.flowing||(c("resume"),t.flowing=!0,function(t,a){a.resumeScheduled||(a.resumeScheduled=!0,e.nextTick(I,t,a))}(this,t)),this},k.prototype.pause=function(){return c("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(c("pause"),this._readableState.flowing=!1,this.emit("pause")),this},k.prototype.wrap=function(e){var t=this,a=this._readableState,r=!1;for(var i in e.on("end",(function(){if(c("wrapped end"),a.decoder&&!a.ended){var e=a.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(i){(c("wrapped data"),a.decoder&&(i=a.decoder.write(i)),a.objectMode&&null==i)||(a.objectMode||i&&i.length)&&(t.push(i)||(r=!0,e.pause()))})),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var n=0;n<f.length;n++)e.on(f[n],this.emit.bind(this,f[n]));return this._read=function(t){c("wrapped _read",t),r&&(r=!1,e.resume())},this},Object.defineProperty(k.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),k._fromList=B,Xo}function ss(){if(es)return Jo;es=1,Jo=r;var e=Yo(),t=Object.create(_o());function a(e,t){var a=this._transformState;a.transforming=!1;var r=a.writecb;if(!r)return this.emit("error",new Error("write callback called multiple times"));a.writechunk=null,a.writecb=null,null!=t&&this.push(t),r(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function r(t){if(!(this instanceof r))return new r(t);e.call(this,t),this._transformState={afterTransform:a.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&("function"==typeof t.transform&&(this._transform=t.transform),"function"==typeof t.flush&&(this._flush=t.flush)),this.on("prefinish",i)}function i(){var e=this;"function"==typeof this._flush?this._flush((function(t,a){n(e,t,a)})):n(this,null,null)}function n(e,t,a){if(t)return e.emit("error",t);if(null!=a&&e.push(a),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)}return t.inherits=Lo(),t.inherits(r,e),r.prototype.push=function(t,a){return this._transformState.needTransform=!1,e.prototype.push.call(this,t,a)},r.prototype._transform=function(e,t,a){throw new Error("_transform() is not implemented")},r.prototype._write=function(e,t,a){var r=this._transformState;if(r.writecb=a,r.writechunk=e,r.writeencoding=t,!r.transforming){var i=this._readableState;(r.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},r.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},r.prototype._destroy=function(t,a){var r=this;e.prototype._destroy.call(this,t,(function(e){a(e),r.emit("close")}))},Jo}function us(){return rs||(rs=1,function(e,t){var a=c;"disable"===process.env.READABLE_STREAM&&a?(e.exports=a,(t=e.exports=a.Readable).Readable=a.Readable,t.Writable=a.Writable,t.Duplex=a.Duplex,t.Transform=a.Transform,t.PassThrough=a.PassThrough,t.Stream=a):((t=e.exports=os()).Stream=a||t,t.Readable=t,t.Writable=Qo(),t.Duplex=Yo(),t.Transform=ss(),t.PassThrough=function(){if(as)return ts;as=1,ts=a;var e=ss(),t=Object.create(_o());function a(t){if(!(this instanceof a))return new a(t);e.call(this,t)}return t.inherits=Lo(),t.inherits(a,e),a.prototype._transform=function(e,t,a){a(null,e)},ts}())}(ho,po)),po}if(lo.base64=!0,lo.array=!0,lo.string=!0,lo.arraybuffer="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array,lo.nodebuffer="undefined"!=typeof Buffer,lo.uint8array="undefined"!=typeof Uint8Array,"undefined"==typeof ArrayBuffer)lo.blob=!1;else{var cs=new ArrayBuffer(0);try{lo.blob=0===new Blob([cs],{type:"application/zip"}).size}catch(e){try{var ls=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);ls.append(cs),lo.blob=0===ls.getBlob("application/zip").size}catch(e){lo.blob=!1}}}try{lo.nodestream=!!us().Readable}catch(e){lo.nodestream=!1}var ps,hs={};function ds(){if(ps)return hs;ps=1;var e=js(),t=lo,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";return hs.encode=function(t){for(var r,i,n,o,s,u,c,l=[],p=0,h=t.length,d=h,m="string"!==e.getTypeOf(t);p<t.length;)d=h-p,m?(r=t[p++],i=p<h?t[p++]:0,n=p<h?t[p++]:0):(r=t.charCodeAt(p++),i=p<h?t.charCodeAt(p++):0,n=p<h?t.charCodeAt(p++):0),o=r>>2,s=(3&r)<<4|i>>4,u=d>1?(15&i)<<2|n>>6:64,c=d>2?63&n:64,l.push(a.charAt(o)+a.charAt(s)+a.charAt(u)+a.charAt(c));return l.join("")},hs.decode=function(e){var r,i,n,o,s,u,c=0,l=0,p="data:";if(e.substr(0,5)===p)throw new Error("Invalid base64 input, it looks like a data url.");var h,d=3*(e=e.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(e.charAt(e.length-1)===a.charAt(64)&&d--,e.charAt(e.length-2)===a.charAt(64)&&d--,d%1!=0)throw new Error("Invalid base64 input, bad content length.");for(h=t.uint8array?new Uint8Array(0|d):new Array(0|d);c<e.length;)r=a.indexOf(e.charAt(c++))<<2|(o=a.indexOf(e.charAt(c++)))>>4,i=(15&o)<<4|(s=a.indexOf(e.charAt(c++)))>>2,n=(3&s)<<6|(u=a.indexOf(e.charAt(c++))),h[l++]=r,64!==s&&(h[l++]=i),64!==u&&(h[l++]=n);return h},hs}var ms,fs,gs,ys,ks={isNode:"undefined"!=typeof Buffer,newBufferFrom:function(e,t){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(e,t);if("number"==typeof e)throw new Error('The "data" argument must not be a number');return new Buffer(e,t)},allocBuffer:function(e){if(Buffer.alloc)return Buffer.alloc(e);var t=new Buffer(e);return t.fill(0),t},isBuffer:function(e){return Buffer.isBuffer(e)},isStream:function(e){return e&&"function"==typeof e.on&&"function"==typeof e.pause&&"function"==typeof e.resume}};var vs=null;vs="undefined"!=typeof Promise?Promise:function(){if(ys)return gs;ys=1;var e=function(){if(fs)return ms;fs=1;var e,t,a=g.MutationObserver||g.WebKitMutationObserver;if(process.browser)if(a){var r=0,i=new a(u),n=g.document.createTextNode("");i.observe(n,{characterData:!0}),e=function(){n.data=r=++r%2}}else if(g.setImmediate||void 0===g.MessageChannel)e="document"in g&&"onreadystatechange"in g.document.createElement("script")?function(){var e=g.document.createElement("script");e.onreadystatechange=function(){u(),e.onreadystatechange=null,e.parentNode.removeChild(e),e=null},g.document.documentElement.appendChild(e)}:function(){setTimeout(u,0)};else{var o=new g.MessageChannel;o.port1.onmessage=u,e=function(){o.port2.postMessage(0)}}else e=function(){process.nextTick(u)};var s=[];function u(){var e,a;t=!0;for(var r=s.length;r;){for(a=s,s=[],e=-1;++e<r;)a[e]();r=s.length}t=!1}return ms=function(a){1!==s.push(a)||t||e()}}();function t(){}var a={},r=["REJECTED"],i=["FULFILLED"],n=["PENDING"];if(!process.browser)var o=["UNHANDLED"];function s(e){if("function"!=typeof e)throw new TypeError("resolver must be a function");this.state=n,this.queue=[],this.outcome=void 0,process.browser||(this.handled=o),e!==t&&p(this,e)}function u(e,t,a){this.promise=e,"function"==typeof t&&(this.onFulfilled=t,this.callFulfilled=this.otherCallFulfilled),"function"==typeof a&&(this.onRejected=a,this.callRejected=this.otherCallRejected)}function c(t,r,i){e((function(){var e;try{e=r(i)}catch(e){return a.reject(t,e)}e===t?a.reject(t,new TypeError("Cannot resolve promise with itself")):a.resolve(t,e)}))}function l(e){var t=e&&e.then;if(e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof t)return function(){t.apply(e,arguments)}}function p(e,t){var r=!1;function i(t){r||(r=!0,a.reject(e,t))}function n(t){r||(r=!0,a.resolve(e,t))}var o=h((function(){t(n,i)}));"error"===o.status&&i(o.value)}function h(e,t){var a={};try{a.value=e(t),a.status="success"}catch(e){a.status="error",a.value=e}return a}return gs=s,s.prototype.finally=function(e){if("function"!=typeof e)return this;var t=this.constructor;return this.then((function(a){return t.resolve(e()).then((function(){return a}))}),(function(a){return t.resolve(e()).then((function(){throw a}))}))},s.prototype.catch=function(e){return this.then(null,e)},s.prototype.then=function(e,a){if("function"!=typeof e&&this.state===i||"function"!=typeof a&&this.state===r)return this;var s=new this.constructor(t);return process.browser||this.handled===o&&(this.handled=null),this.state!==n?c(s,this.state===i?e:a,this.outcome):this.queue.push(new u(s,e,a)),s},u.prototype.callFulfilled=function(e){a.resolve(this.promise,e)},u.prototype.otherCallFulfilled=function(e){c(this.promise,this.onFulfilled,e)},u.prototype.callRejected=function(e){a.reject(this.promise,e)},u.prototype.otherCallRejected=function(e){c(this.promise,this.onRejected,e)},a.resolve=function(e,t){var r=h(l,t);if("error"===r.status)return a.reject(e,r.value);var n=r.value;if(n)p(e,n);else{e.state=i,e.outcome=t;for(var o=-1,s=e.queue.length;++o<s;)e.queue[o].callFulfilled(t)}return e},a.reject=function(t,a){t.state=r,t.outcome=a,process.browser||t.handled===o&&e((function(){t.handled===o&&process.emit("unhandledRejection",a,t)}));for(var i=-1,n=t.queue.length;++i<n;)t.queue[i].callRejected(a);return t},s.resolve=function(e){return e instanceof this?e:a.resolve(new this(t),e)},s.reject=function(e){var r=new this(t);return a.reject(r,e)},s.all=function(e){var r=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var i=e.length,n=!1;if(!i)return this.resolve([]);for(var o=new Array(i),s=0,u=-1,c=new this(t);++u<i;)l(e[u],u);return c;function l(e,t){r.resolve(e).then((function(e){o[t]=e,++s!==i||n||(n=!0,a.resolve(c,o))}),(function(e){n||(n=!0,a.reject(c,e))}))}},s.race=function(e){var r=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var i=e.length,n=!1;if(!i)return this.resolve([]);for(var o,s=-1,u=new this(t);++s<i;)o=e[s],r.resolve(o).then((function(e){n||(n=!0,a.resolve(u,e))}),(function(e){n||(n=!0,a.reject(u,e))}));return u},gs}();var bs,ws={Promise:vs};function js(){return bs||(bs=1,function(e){var t=lo,a=ds(),r=ks,i=ws;function n(e){return e}function o(e,t){for(var a=0;a<e.length;++a)t[a]=255&e.charCodeAt(a);return t}e.newBlob=function(t,a){e.checkSupport("blob");try{return new Blob([t],{type:a})}catch(e){try{var r=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return r.append(t),r.getBlob(a)}catch(e){throw new Error("Bug : can't construct the Blob.")}}};var s={stringifyByChunk:function(e,t,a){var r=[],i=0,n=e.length;if(n<=a)return String.fromCharCode.apply(null,e);for(;i<n;)"array"===t||"nodebuffer"===t?r.push(String.fromCharCode.apply(null,e.slice(i,Math.min(i+a,n)))):r.push(String.fromCharCode.apply(null,e.subarray(i,Math.min(i+a,n)))),i+=a;return r.join("")},stringifyByChar:function(e){for(var t="",a=0;a<e.length;a++)t+=String.fromCharCode(e[a]);return t},applyCanBeUsed:{uint8array:function(){try{return t.uint8array&&1===String.fromCharCode.apply(null,new Uint8Array(1)).length}catch(e){return!1}}(),nodebuffer:function(){try{return t.nodebuffer&&1===String.fromCharCode.apply(null,r.allocBuffer(1)).length}catch(e){return!1}}()}};function u(t){var a=65536,r=e.getTypeOf(t),i=!0;if("uint8array"===r?i=s.applyCanBeUsed.uint8array:"nodebuffer"===r&&(i=s.applyCanBeUsed.nodebuffer),i)for(;a>1;)try{return s.stringifyByChunk(t,r,a)}catch(e){a=Math.floor(a/2)}return s.stringifyByChar(t)}function c(e,t){for(var a=0;a<e.length;a++)t[a]=e[a];return t}e.applyFromCharCode=u;var l={};l.string={string:n,array:function(e){return o(e,new Array(e.length))},arraybuffer:function(e){return l.string.uint8array(e).buffer},uint8array:function(e){return o(e,new Uint8Array(e.length))},nodebuffer:function(e){return o(e,r.allocBuffer(e.length))}},l.array={string:u,array:n,arraybuffer:function(e){return new Uint8Array(e).buffer},uint8array:function(e){return new Uint8Array(e)},nodebuffer:function(e){return r.newBufferFrom(e)}},l.arraybuffer={string:function(e){return u(new Uint8Array(e))},array:function(e){return c(new Uint8Array(e),new Array(e.byteLength))},arraybuffer:n,uint8array:function(e){return new Uint8Array(e)},nodebuffer:function(e){return r.newBufferFrom(new Uint8Array(e))}},l.uint8array={string:u,array:function(e){return c(e,new Array(e.length))},arraybuffer:function(e){return e.buffer},uint8array:n,nodebuffer:function(e){return r.newBufferFrom(e)}},l.nodebuffer={string:u,array:function(e){return c(e,new Array(e.length))},arraybuffer:function(e){return l.nodebuffer.uint8array(e).buffer},uint8array:function(e){return c(e,new Uint8Array(e.length))},nodebuffer:n},e.transformTo=function(t,a){if(a||(a=""),!t)return a;e.checkSupport(t);var r=e.getTypeOf(a);return l[r][t](a)},e.resolve=function(e){for(var t=e.split("/"),a=[],r=0;r<t.length;r++){var i=t[r];"."===i||""===i&&0!==r&&r!==t.length-1||(".."===i?a.pop():a.push(i))}return a.join("/")},e.getTypeOf=function(e){return"string"==typeof e?"string":"[object Array]"===Object.prototype.toString.call(e)?"array":t.nodebuffer&&r.isBuffer(e)?"nodebuffer":t.uint8array&&e instanceof Uint8Array?"uint8array":t.arraybuffer&&e instanceof ArrayBuffer?"arraybuffer":void 0},e.checkSupport=function(e){if(!t[e.toLowerCase()])throw new Error(e+" is not supported by this platform")},e.MAX_VALUE_16BITS=65535,e.MAX_VALUE_32BITS=-1,e.pretty=function(e){var t,a,r="";for(a=0;a<(e||"").length;a++)r+="\\x"+((t=e.charCodeAt(a))<16?"0":"")+t.toString(16).toUpperCase();return r},e.delay=function(e,t,a){setImmediate((function(){e.apply(a||null,t||[])}))},e.inherits=function(e,t){var a=function(){};a.prototype=t.prototype,e.prototype=new a},e.extend=function(){var e,t,a={};for(e=0;e<arguments.length;e++)for(t in arguments[e])Object.prototype.hasOwnProperty.call(arguments[e],t)&&void 0===a[t]&&(a[t]=arguments[e][t]);return a},e.prepareContent=function(r,n,s,u,c){return i.Promise.resolve(n).then((function(e){return t.blob&&(e instanceof Blob||-1!==["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(e)))&&"undefined"!=typeof FileReader?new i.Promise((function(t,a){var r=new FileReader;r.onload=function(e){t(e.target.result)},r.onerror=function(e){a(e.target.error)},r.readAsArrayBuffer(e)})):e})).then((function(n){var l,p=e.getTypeOf(n);return p?("arraybuffer"===p?n=e.transformTo("uint8array",n):"string"===p&&(c?n=a.decode(n):s&&!0!==u&&(n=o(l=n,t.uint8array?new Uint8Array(l.length):new Array(l.length)))),n):i.Promise.reject(new Error("Can't read the data of '"+r+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))}))}}(co)),co}function Cs(e){this.name=e||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}!function(e,t){if(!e.setImmediate){var a,r,i,n,o,s=1,u={},c=!1,l=e.document,p=Object.getPrototypeOf&&Object.getPrototypeOf(e);p=p&&p.setTimeout?p:e,"[object process]"==={}.toString.call(e.process)?a=function(e){process.nextTick((function(){d(e)}))}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,a=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=a,t}}()?e.MessageChannel?((i=new MessageChannel).port1.onmessage=function(e){d(e.data)},a=function(e){i.port2.postMessage(e)}):l&&"onreadystatechange"in l.createElement("script")?(r=l.documentElement,a=function(e){var t=l.createElement("script");t.onreadystatechange=function(){d(e),t.onreadystatechange=null,r.removeChild(t),t=null},r.appendChild(t)}):a=function(e){setTimeout(d,0,e)}:(n="setImmediate$"+Math.random()+"$",o=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(n)&&d(+t.data.slice(n.length))},e.addEventListener?e.addEventListener("message",o,!1):e.attachEvent("onmessage",o),a=function(t){e.postMessage(n+t,"*")}),p.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[s]=i,a(s),s++},p.clearImmediate=h}function h(e){delete u[e]}function d(e){if(c)setTimeout(d,0,e);else{var a=u[e];if(a){c=!0;try{!function(e){var a=e.callback,r=e.args;switch(r.length){case 0:a();break;case 1:a(r[0]);break;case 2:a(r[0],r[1]);break;case 3:a(r[0],r[1],r[2]);break;default:a.apply(t,r)}}(a)}finally{h(e),c=!1}}}}}("undefined"==typeof self?g:self),Cs.prototype={push:function(e){this.emit("data",e)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(e){this.emit("error",e)}return!0},error:function(e){return!this.isFinished&&(this.isPaused?this.generatedError=e:(this.isFinished=!0,this.emit("error",e),this.previous&&this.previous.error(e),this.cleanUp()),!0)},on:function(e,t){return this._listeners[e].push(t),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(e,t){if(this._listeners[e])for(var a=0;a<this._listeners[e].length;a++)this._listeners[e][a].call(this,t)},pipe:function(e){return e.registerPrevious(this)},registerPrevious:function(e){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=e.streamInfo,this.mergeStreamInfo(),this.previous=e;var t=this;return e.on("data",(function(e){t.processChunk(e)})),e.on("end",(function(){t.end()})),e.on("error",(function(e){t.error(e)})),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;this.isPaused=!1;var e=!1;return this.generatedError&&(this.error(this.generatedError),e=!0),this.previous&&this.previous.resume(),!e},flush:function(){},processChunk:function(e){this.push(e)},withStreamInfo:function(e,t){return this.extraStreamInfo[e]=t,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var e in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,e)&&(this.streamInfo[e]=this.extraStreamInfo[e])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var e="Worker "+this.name;return this.previous?this.previous+" -> "+e:e}};var Es=Cs;!function(e){for(var t=js(),a=lo,r=ks,i=Es,n=new Array(256),o=0;o<256;o++)n[o]=o>=252?6:o>=248?5:o>=240?4:o>=224?3:o>=192?2:1;n[254]=n[254]=1;function s(){i.call(this,"utf-8 decode"),this.leftOver=null}function u(){i.call(this,"utf-8 encode")}e.utf8encode=function(e){return a.nodebuffer?r.newBufferFrom(e,"utf-8"):function(e){var t,r,i,n,o,s=e.length,u=0;for(n=0;n<s;n++)55296==(64512&(r=e.charCodeAt(n)))&&n+1<s&&56320==(64512&(i=e.charCodeAt(n+1)))&&(r=65536+(r-55296<<10)+(i-56320),n++),u+=r<128?1:r<2048?2:r<65536?3:4;for(t=a.uint8array?new Uint8Array(u):new Array(u),o=0,n=0;o<u;n++)55296==(64512&(r=e.charCodeAt(n)))&&n+1<s&&56320==(64512&(i=e.charCodeAt(n+1)))&&(r=65536+(r-55296<<10)+(i-56320),n++),r<128?t[o++]=r:r<2048?(t[o++]=192|r>>>6,t[o++]=128|63&r):r<65536?(t[o++]=224|r>>>12,t[o++]=128|r>>>6&63,t[o++]=128|63&r):(t[o++]=240|r>>>18,t[o++]=128|r>>>12&63,t[o++]=128|r>>>6&63,t[o++]=128|63&r);return t}(e)},e.utf8decode=function(e){return a.nodebuffer?t.transformTo("nodebuffer",e).toString("utf-8"):function(e){var a,r,i,o,s=e.length,u=new Array(2*s);for(r=0,a=0;a<s;)if((i=e[a++])<128)u[r++]=i;else if((o=n[i])>4)u[r++]=65533,a+=o-1;else{for(i&=2===o?31:3===o?15:7;o>1&&a<s;)i=i<<6|63&e[a++],o--;o>1?u[r++]=65533:i<65536?u[r++]=i:(i-=65536,u[r++]=55296|i>>10&1023,u[r++]=56320|1023&i)}return u.length!==r&&(u.subarray?u=u.subarray(0,r):u.length=r),t.applyFromCharCode(u)}(e=t.transformTo(a.uint8array?"uint8array":"array",e))},t.inherits(s,i),s.prototype.processChunk=function(r){var i=t.transformTo(a.uint8array?"uint8array":"array",r.data);if(this.leftOver&&this.leftOver.length){if(a.uint8array){var o=i;(i=new Uint8Array(o.length+this.leftOver.length)).set(this.leftOver,0),i.set(o,this.leftOver.length)}else i=this.leftOver.concat(i);this.leftOver=null}var s=function(e,t){var a;for((t=t||e.length)>e.length&&(t=e.length),a=t-1;a>=0&&128==(192&e[a]);)a--;return a<0||0===a?t:a+n[e[a]]>t?a:t}(i),u=i;s!==i.length&&(a.uint8array?(u=i.subarray(0,s),this.leftOver=i.subarray(s,i.length)):(u=i.slice(0,s),this.leftOver=i.slice(s,i.length))),this.push({data:e.utf8decode(u),meta:r.meta})},s.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:e.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},e.Utf8DecodeWorker=s,t.inherits(u,i),u.prototype.processChunk=function(t){this.push({data:e.utf8encode(t.data),meta:t.meta})},e.Utf8EncodeWorker=u}(uo);var Ss=Es,Ts=js();function _s(e){Ss.call(this,"ConvertWorker to "+e),this.destType=e}Ts.inherits(_s,Ss),_s.prototype.processChunk=function(e){this.push({data:Ts.transformTo(this.destType,e.data),meta:e.meta})};var Is,As,Bs=_s;var Ns=js(),Rs=Bs,zs=Es,Ls=ds(),xs=ws,Ds=null;if(lo.nodestream)try{Ds=function(){if(As)return Is;As=1;var e=us().Readable;function t(t,a,r){e.call(this,a),this._helper=t;var i=this;t.on("data",(function(e,t){i.push(e)||i._helper.pause(),r&&r(t)})).on("error",(function(e){i.emit("error",e)})).on("end",(function(){i.push(null)}))}return js().inherits(t,e),t.prototype._read=function(){this._helper.resume()},Is=t}()}catch(e){}function Us(e,t){return new xs.Promise((function(a,r){var i=[],n=e._internalType,o=e._outputType,s=e._mimeType;e.on("data",(function(e,a){i.push(e),t&&t(a)})).on("error",(function(e){i=[],r(e)})).on("end",(function(){try{var e=function(e,t,a){switch(e){case"blob":return Ns.newBlob(Ns.transformTo("arraybuffer",t),a);case"base64":return Ls.encode(t);default:return Ns.transformTo(e,t)}}(o,function(e,t){var a,r=0,i=null,n=0;for(a=0;a<t.length;a++)n+=t[a].length;switch(e){case"string":return t.join("");case"array":return Array.prototype.concat.apply([],t);case"uint8array":for(i=new Uint8Array(n),a=0;a<t.length;a++)i.set(t[a],r),r+=t[a].length;return i;case"nodebuffer":return Buffer.concat(t);default:throw new Error("concat : unsupported type '"+e+"'")}}(n,i),s);a(e)}catch(e){r(e)}i=[]})).resume()}))}function Os(e,t,a){var r=t;switch(t){case"blob":case"arraybuffer":r="uint8array";break;case"base64":r="string"}try{this._internalType=r,this._outputType=t,this._mimeType=a,Ns.checkSupport(r),this._worker=e.pipe(new Rs(r)),e.lock()}catch(e){this._worker=new zs("error"),this._worker.error(e)}}Os.prototype={accumulate:function(e){return Us(this,e)},on:function(e,t){var a=this;return"data"===e?this._worker.on(e,(function(e){t.call(a,e.data,e.meta)})):this._worker.on(e,(function(){Ns.delay(t,arguments,a)})),this},resume:function(){return Ns.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(e){if(Ns.checkSupport("nodestream"),"nodebuffer"!==this._outputType)throw new Error(this._outputType+" is not supported by this method");return new Ds(this,{objectMode:"nodebuffer"!==this._outputType},e)}};var Ps=Os,Vs={base64:!1,binary:!1,dir:!1,createFolders:!0,date:null,compression:null,compressionOptions:null,comment:null,unixPermissions:null,dosPermissions:null},Ms=js(),Ks=Es;function Fs(e){Ks.call(this,"DataWorker");var t=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,e.then((function(e){t.dataIsReady=!0,t.data=e,t.max=e&&e.length||0,t.type=Ms.getTypeOf(e),t.isPaused||t._tickAndRepeat()}),(function(e){t.error(e)}))}Ms.inherits(Fs,Ks),Fs.prototype.cleanUp=function(){Ks.prototype.cleanUp.call(this),this.data=null},Fs.prototype.resume=function(){return!!Ks.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,Ms.delay(this._tickAndRepeat,[],this)),!0)},Fs.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(Ms.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},Fs.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var e=null,t=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":e=this.data.substring(this.index,t);break;case"uint8array":e=this.data.subarray(this.index,t);break;case"array":case"nodebuffer":e=this.data.slice(this.index,t)}return this.index=t,this.push({data:e,meta:{percent:this.max?this.index/this.max*100:0}})};var qs=Fs,Hs=js();var Gs=function(){for(var e,t=[],a=0;a<256;a++){e=a;for(var r=0;r<8;r++)e=1&e?3988292384^e>>>1:e>>>1;t[a]=e}return t}();var Ws=function(e,t){return void 0!==e&&e.length?"string"!==Hs.getTypeOf(e)?function(e,t,a,r){var i=Gs,n=r+a;e^=-1;for(var o=r;o<n;o++)e=e>>>8^i[255&(e^t[o])];return-1^e}(0|t,e,e.length,0):function(e,t,a,r){var i=Gs,n=r+a;e^=-1;for(var o=r;o<n;o++)e=e>>>8^i[255&(e^t.charCodeAt(o))];return-1^e}(0|t,e,e.length,0):0},Qs=Es,Ys=Ws;function Zs(){Qs.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}js().inherits(Zs,Qs),Zs.prototype.processChunk=function(e){this.streamInfo.crc32=Ys(e.data,this.streamInfo.crc32||0),this.push(e)};var Xs=Zs,$s=js(),Js=Es;function eu(e){Js.call(this,"DataLengthProbe for "+e),this.propName=e,this.withStreamInfo(e,0)}$s.inherits(eu,Js),eu.prototype.processChunk=function(e){if(e){var t=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=t+e.data.length}Js.prototype.processChunk.call(this,e)};var tu=ws,au=qs,ru=Xs,iu=eu;function nu(e,t,a,r,i){this.compressedSize=e,this.uncompressedSize=t,this.crc32=a,this.compression=r,this.compressedContent=i}nu.prototype={getContentWorker:function(){var e=new au(tu.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new iu("data_length")),t=this;return e.on("end",(function(){if(this.streamInfo.data_length!==t.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")})),e},getCompressedWorker:function(){return new au(tu.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},nu.createWorkerFrom=function(e,t,a){return e.pipe(new ru).pipe(new iu("uncompressedSize")).pipe(t.compressWorker(a)).pipe(new iu("compressedSize")).withStreamInfo("compression",t)};var ou=nu,su=Ps,uu=qs,cu=uo,lu=ou,pu=Es,hu=function(e,t,a){this.name=e,this.dir=a.dir,this.date=a.date,this.comment=a.comment,this.unixPermissions=a.unixPermissions,this.dosPermissions=a.dosPermissions,this._data=t,this._dataBinary=a.binary,this.options={compression:a.compression,compressionOptions:a.compressionOptions}};hu.prototype={internalStream:function(e){var t=null,a="string";try{if(!e)throw new Error("No output type specified.");var r="string"===(a=e.toLowerCase())||"text"===a;"binarystring"!==a&&"text"!==a||(a="string"),t=this._decompressWorker();var i=!this._dataBinary;i&&!r&&(t=t.pipe(new cu.Utf8EncodeWorker)),!i&&r&&(t=t.pipe(new cu.Utf8DecodeWorker))}catch(e){(t=new pu("error")).error(e)}return new su(t,a,"")},async:function(e,t){return this.internalStream(e).accumulate(t)},nodeStream:function(e,t){return this.internalStream(e||"nodebuffer").toNodejsStream(t)},_compressWorker:function(e,t){if(this._data instanceof lu&&this._data.compression.magic===e.magic)return this._data.getCompressedWorker();var a=this._decompressWorker();return this._dataBinary||(a=a.pipe(new cu.Utf8EncodeWorker)),lu.createWorkerFrom(a,e,t)},_decompressWorker:function(){return this._data instanceof lu?this._data.getContentWorker():this._data instanceof pu?this._data:new uu(this._data)}};for(var du=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],mu=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},fu=0;fu<du.length;fu++)hu.prototype[du[fu]]=mu;var gu=hu,yu={},ku={},vu={},bu={};!function(e){var t="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;function a(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var r=t.shift();if(r){if("object"!=typeof r)throw new TypeError(r+"must be non-object");for(var i in r)a(r,i)&&(e[i]=r[i])}}return e},e.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var r={arraySet:function(e,t,a,r,i){if(t.subarray&&e.subarray)e.set(t.subarray(a,a+r),i);else for(var n=0;n<r;n++)e[i+n]=t[a+n]},flattenChunks:function(e){var t,a,r,i,n,o;for(r=0,t=0,a=e.length;t<a;t++)r+=e[t].length;for(o=new Uint8Array(r),i=0,t=0,a=e.length;t<a;t++)n=e[t],o.set(n,i),i+=n.length;return o}},i={arraySet:function(e,t,a,r,i){for(var n=0;n<r;n++)e[i+n]=t[a+n]},flattenChunks:function(e){return[].concat.apply([],e)}};e.setTyped=function(t){t?(e.Buf8=Uint8Array,e.Buf16=Uint16Array,e.Buf32=Int32Array,e.assign(e,r)):(e.Buf8=Array,e.Buf16=Array,e.Buf32=Array,e.assign(e,i))},e.setTyped(t)}(bu);var wu={},ju={},Cu={},Eu=bu,Su=0,Tu=1;function _u(e){for(var t=e.length;--t>=0;)e[t]=0}var Iu=0,Au=29,Bu=256,Nu=Bu+1+Au,Ru=30,zu=19,Lu=2*Nu+1,xu=15,Du=16,Uu=7,Ou=256,Pu=16,Vu=17,Mu=18,Ku=[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],Fu=[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],qu=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],Hu=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],Gu=new Array(2*(Nu+2));_u(Gu);var Wu=new Array(2*Ru);_u(Wu);var Qu=new Array(512);_u(Qu);var Yu=new Array(256);_u(Yu);var Zu=new Array(Au);_u(Zu);var Xu,$u,Ju,ec=new Array(Ru);function tc(e,t,a,r,i){this.static_tree=e,this.extra_bits=t,this.extra_base=a,this.elems=r,this.max_length=i,this.has_stree=e&&e.length}function ac(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function rc(e){return e<256?Qu[e]:Qu[256+(e>>>7)]}function ic(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function nc(e,t,a){e.bi_valid>Du-a?(e.bi_buf|=t<<e.bi_valid&65535,ic(e,e.bi_buf),e.bi_buf=t>>Du-e.bi_valid,e.bi_valid+=a-Du):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=a)}function oc(e,t,a){nc(e,a[2*t],a[2*t+1])}function sc(e,t){var a=0;do{a|=1&e,e>>>=1,a<<=1}while(--t>0);return a>>>1}function uc(e,t,a){var r,i,n=new Array(xu+1),o=0;for(r=1;r<=xu;r++)n[r]=o=o+a[r-1]<<1;for(i=0;i<=t;i++){var s=e[2*i+1];0!==s&&(e[2*i]=sc(n[s]++,s))}}function cc(e){var t;for(t=0;t<Nu;t++)e.dyn_ltree[2*t]=0;for(t=0;t<Ru;t++)e.dyn_dtree[2*t]=0;for(t=0;t<zu;t++)e.bl_tree[2*t]=0;e.dyn_ltree[2*Ou]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function lc(e){e.bi_valid>8?ic(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function pc(e,t,a,r){var i=2*t,n=2*a;return e[i]<e[n]||e[i]===e[n]&&r[t]<=r[a]}function hc(e,t,a){for(var r=e.heap[a],i=a<<1;i<=e.heap_len&&(i<e.heap_len&&pc(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!pc(t,r,e.heap[i],e.depth));)e.heap[a]=e.heap[i],a=i,i<<=1;e.heap[a]=r}function dc(e,t,a){var r,i,n,o,s=0;if(0!==e.last_lit)do{r=e.pending_buf[e.d_buf+2*s]<<8|e.pending_buf[e.d_buf+2*s+1],i=e.pending_buf[e.l_buf+s],s++,0===r?oc(e,i,t):(oc(e,(n=Yu[i])+Bu+1,t),0!==(o=Ku[n])&&nc(e,i-=Zu[n],o),oc(e,n=rc(--r),a),0!==(o=Fu[n])&&nc(e,r-=ec[n],o))}while(s<e.last_lit);oc(e,Ou,t)}function mc(e,t){var a,r,i,n=t.dyn_tree,o=t.stat_desc.static_tree,s=t.stat_desc.has_stree,u=t.stat_desc.elems,c=-1;for(e.heap_len=0,e.heap_max=Lu,a=0;a<u;a++)0!==n[2*a]?(e.heap[++e.heap_len]=c=a,e.depth[a]=0):n[2*a+1]=0;for(;e.heap_len<2;)n[2*(i=e.heap[++e.heap_len]=c<2?++c:0)]=1,e.depth[i]=0,e.opt_len--,s&&(e.static_len-=o[2*i+1]);for(t.max_code=c,a=e.heap_len>>1;a>=1;a--)hc(e,n,a);i=u;do{a=e.heap[1],e.heap[1]=e.heap[e.heap_len--],hc(e,n,1),r=e.heap[1],e.heap[--e.heap_max]=a,e.heap[--e.heap_max]=r,n[2*i]=n[2*a]+n[2*r],e.depth[i]=(e.depth[a]>=e.depth[r]?e.depth[a]:e.depth[r])+1,n[2*a+1]=n[2*r+1]=i,e.heap[1]=i++,hc(e,n,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],function(e,t){var a,r,i,n,o,s,u=t.dyn_tree,c=t.max_code,l=t.stat_desc.static_tree,p=t.stat_desc.has_stree,h=t.stat_desc.extra_bits,d=t.stat_desc.extra_base,m=t.stat_desc.max_length,f=0;for(n=0;n<=xu;n++)e.bl_count[n]=0;for(u[2*e.heap[e.heap_max]+1]=0,a=e.heap_max+1;a<Lu;a++)(n=u[2*u[2*(r=e.heap[a])+1]+1]+1)>m&&(n=m,f++),u[2*r+1]=n,r>c||(e.bl_count[n]++,o=0,r>=d&&(o=h[r-d]),s=u[2*r],e.opt_len+=s*(n+o),p&&(e.static_len+=s*(l[2*r+1]+o)));if(0!==f){do{for(n=m-1;0===e.bl_count[n];)n--;e.bl_count[n]--,e.bl_count[n+1]+=2,e.bl_count[m]--,f-=2}while(f>0);for(n=m;0!==n;n--)for(r=e.bl_count[n];0!==r;)(i=e.heap[--a])>c||(u[2*i+1]!==n&&(e.opt_len+=(n-u[2*i+1])*u[2*i],u[2*i+1]=n),r--)}}(e,t),uc(n,c,e.bl_count)}function fc(e,t,a){var r,i,n=-1,o=t[1],s=0,u=7,c=4;for(0===o&&(u=138,c=3),t[2*(a+1)+1]=65535,r=0;r<=a;r++)i=o,o=t[2*(r+1)+1],++s<u&&i===o||(s<c?e.bl_tree[2*i]+=s:0!==i?(i!==n&&e.bl_tree[2*i]++,e.bl_tree[2*Pu]++):s<=10?e.bl_tree[2*Vu]++:e.bl_tree[2*Mu]++,s=0,n=i,0===o?(u=138,c=3):i===o?(u=6,c=3):(u=7,c=4))}function gc(e,t,a){var r,i,n=-1,o=t[1],s=0,u=7,c=4;for(0===o&&(u=138,c=3),r=0;r<=a;r++)if(i=o,o=t[2*(r+1)+1],!(++s<u&&i===o)){if(s<c)do{oc(e,i,e.bl_tree)}while(0!=--s);else 0!==i?(i!==n&&(oc(e,i,e.bl_tree),s--),oc(e,Pu,e.bl_tree),nc(e,s-3,2)):s<=10?(oc(e,Vu,e.bl_tree),nc(e,s-3,3)):(oc(e,Mu,e.bl_tree),nc(e,s-11,7));s=0,n=i,0===o?(u=138,c=3):i===o?(u=6,c=3):(u=7,c=4)}}_u(ec);var yc=!1;function kc(e,t,a,r){nc(e,(Iu<<1)+(r?1:0),3),function(e,t,a,r){lc(e),r&&(ic(e,a),ic(e,~a)),Eu.arraySet(e.pending_buf,e.window,t,a,e.pending),e.pending+=a}(e,t,a,!0)}Cu._tr_init=function(e){yc||(!function(){var e,t,a,r,i,n=new Array(xu+1);for(a=0,r=0;r<Au-1;r++)for(Zu[r]=a,e=0;e<1<<Ku[r];e++)Yu[a++]=r;for(Yu[a-1]=r,i=0,r=0;r<16;r++)for(ec[r]=i,e=0;e<1<<Fu[r];e++)Qu[i++]=r;for(i>>=7;r<Ru;r++)for(ec[r]=i<<7,e=0;e<1<<Fu[r]-7;e++)Qu[256+i++]=r;for(t=0;t<=xu;t++)n[t]=0;for(e=0;e<=143;)Gu[2*e+1]=8,e++,n[8]++;for(;e<=255;)Gu[2*e+1]=9,e++,n[9]++;for(;e<=279;)Gu[2*e+1]=7,e++,n[7]++;for(;e<=287;)Gu[2*e+1]=8,e++,n[8]++;for(uc(Gu,Nu+1,n),e=0;e<Ru;e++)Wu[2*e+1]=5,Wu[2*e]=sc(e,5);Xu=new tc(Gu,Ku,Bu+1,Nu,xu),$u=new tc(Wu,Fu,0,Ru,xu),Ju=new tc(new Array(0),qu,0,zu,Uu)}(),yc=!0),e.l_desc=new ac(e.dyn_ltree,Xu),e.d_desc=new ac(e.dyn_dtree,$u),e.bl_desc=new ac(e.bl_tree,Ju),e.bi_buf=0,e.bi_valid=0,cc(e)},Cu._tr_stored_block=kc,Cu._tr_flush_block=function(e,t,a,r){var i,n,o=0;e.level>0?(2===e.strm.data_type&&(e.strm.data_type=function(e){var t,a=4093624447;for(t=0;t<=31;t++,a>>>=1)if(1&a&&0!==e.dyn_ltree[2*t])return Su;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return Tu;for(t=32;t<Bu;t++)if(0!==e.dyn_ltree[2*t])return Tu;return Su}(e)),mc(e,e.l_desc),mc(e,e.d_desc),o=function(e){var t;for(fc(e,e.dyn_ltree,e.l_desc.max_code),fc(e,e.dyn_dtree,e.d_desc.max_code),mc(e,e.bl_desc),t=zu-1;t>=3&&0===e.bl_tree[2*Hu[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),i=e.opt_len+3+7>>>3,(n=e.static_len+3+7>>>3)<=i&&(i=n)):i=n=a+5,a+4<=i&&-1!==t?kc(e,t,a,r):4===e.strategy||n===i?(nc(e,2+(r?1:0),3),dc(e,Gu,Wu)):(nc(e,4+(r?1:0),3),function(e,t,a,r){var i;for(nc(e,t-257,5),nc(e,a-1,5),nc(e,r-4,4),i=0;i<r;i++)nc(e,e.bl_tree[2*Hu[i]+1],3);gc(e,e.dyn_ltree,t-1),gc(e,e.dyn_dtree,a-1)}(e,e.l_desc.max_code+1,e.d_desc.max_code+1,o+1),dc(e,e.dyn_ltree,e.dyn_dtree)),cc(e),r&&lc(e)},Cu._tr_tally=function(e,t,a){return e.pending_buf[e.d_buf+2*e.last_lit]=t>>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&a,e.last_lit++,0===t?e.dyn_ltree[2*a]++:(e.matches++,t--,e.dyn_ltree[2*(Yu[a]+Bu+1)]++,e.dyn_dtree[2*rc(t)]++),e.last_lit===e.lit_bufsize-1},Cu._tr_align=function(e){nc(e,2,3),oc(e,Ou,Gu),function(e){16===e.bi_valid?(ic(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)};var vc=function(e,t,a,r){for(var i=65535&e|0,n=e>>>16&65535|0,o=0;0!==a;){a-=o=a>2e3?2e3:a;do{n=n+(i=i+t[r++]|0)|0}while(--o);i%=65521,n%=65521}return i|n<<16|0};var bc=function(){for(var e,t=[],a=0;a<256;a++){e=a;for(var r=0;r<8;r++)e=1&e?3988292384^e>>>1:e>>>1;t[a]=e}return t}();var wc,jc=function(e,t,a,r){var i=bc,n=r+a;e^=-1;for(var o=r;o<n;o++)e=e>>>8^i[255&(e^t[o])];return-1^e},Cc={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},Ec=bu,Sc=Cu,Tc=vc,_c=jc,Ic=Cc,Ac=0,Bc=4,Nc=0,Rc=-2,zc=-1,Lc=4,xc=2,Dc=8,Uc=9,Oc=286,Pc=30,Vc=19,Mc=2*Oc+1,Kc=15,Fc=3,qc=258,Hc=qc+Fc+1,Gc=42,Wc=103,Qc=113,Yc=666,Zc=1,Xc=2,$c=3,Jc=4;function el(e,t){return e.msg=Ic[t],t}function tl(e){return(e<<1)-(e>4?9:0)}function al(e){for(var t=e.length;--t>=0;)e[t]=0}function rl(e){var t=e.state,a=t.pending;a>e.avail_out&&(a=e.avail_out),0!==a&&(Ec.arraySet(e.output,t.pending_buf,t.pending_out,a,e.next_out),e.next_out+=a,t.pending_out+=a,e.total_out+=a,e.avail_out-=a,t.pending-=a,0===t.pending&&(t.pending_out=0))}function il(e,t){Sc._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,rl(e.strm)}function nl(e,t){e.pending_buf[e.pending++]=t}function ol(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function sl(e,t,a,r){var i=e.avail_in;return i>r&&(i=r),0===i?0:(e.avail_in-=i,Ec.arraySet(t,e.input,e.next_in,i,a),1===e.state.wrap?e.adler=Tc(e.adler,t,i,a):2===e.state.wrap&&(e.adler=_c(e.adler,t,i,a)),e.next_in+=i,e.total_in+=i,i)}function ul(e,t){var a,r,i=e.max_chain_length,n=e.strstart,o=e.prev_length,s=e.nice_match,u=e.strstart>e.w_size-Hc?e.strstart-(e.w_size-Hc):0,c=e.window,l=e.w_mask,p=e.prev,h=e.strstart+qc,d=c[n+o-1],m=c[n+o];e.prev_length>=e.good_match&&(i>>=2),s>e.lookahead&&(s=e.lookahead);do{if(c[(a=t)+o]===m&&c[a+o-1]===d&&c[a]===c[n]&&c[++a]===c[n+1]){n+=2,a++;do{}while(c[++n]===c[++a]&&c[++n]===c[++a]&&c[++n]===c[++a]&&c[++n]===c[++a]&&c[++n]===c[++a]&&c[++n]===c[++a]&&c[++n]===c[++a]&&c[++n]===c[++a]&&n<h);if(r=qc-(h-n),n=h-qc,r>o){if(e.match_start=t,o=r,r>=s)break;d=c[n+o-1],m=c[n+o]}}}while((t=p[t&l])>u&&0!=--i);return o<=e.lookahead?o:e.lookahead}function cl(e){var t,a,r,i,n,o=e.w_size;do{if(i=e.window_size-e.lookahead-e.strstart,e.strstart>=o+(o-Hc)){Ec.arraySet(e.window,e.window,o,o,0),e.match_start-=o,e.strstart-=o,e.block_start-=o,t=a=e.hash_size;do{r=e.head[--t],e.head[t]=r>=o?r-o:0}while(--a);t=a=o;do{r=e.prev[--t],e.prev[t]=r>=o?r-o:0}while(--a);i+=o}if(0===e.strm.avail_in)break;if(a=sl(e.strm,e.window,e.strstart+e.lookahead,i),e.lookahead+=a,e.lookahead+e.insert>=Fc)for(n=e.strstart-e.insert,e.ins_h=e.window[n],e.ins_h=(e.ins_h<<e.hash_shift^e.window[n+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[n+Fc-1])&e.hash_mask,e.prev[n&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=n,n++,e.insert--,!(e.lookahead+e.insert<Fc)););}while(e.lookahead<Hc&&0!==e.strm.avail_in)}function ll(e,t){for(var a,r;;){if(e.lookahead<Hc){if(cl(e),e.lookahead<Hc&&t===Ac)return Zc;if(0===e.lookahead)break}if(a=0,e.lookahead>=Fc&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+Fc-1])&e.hash_mask,a=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==a&&e.strstart-a<=e.w_size-Hc&&(e.match_length=ul(e,a)),e.match_length>=Fc)if(r=Sc._tr_tally(e,e.strstart-e.match_start,e.match_length-Fc),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=Fc){e.match_length--;do{e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+Fc-1])&e.hash_mask,a=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart}while(0!=--e.match_length);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else r=Sc._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(il(e,!1),0===e.strm.avail_out))return Zc}return e.insert=e.strstart<Fc-1?e.strstart:Fc-1,t===Bc?(il(e,!0),0===e.strm.avail_out?$c:Jc):e.last_lit&&(il(e,!1),0===e.strm.avail_out)?Zc:Xc}function pl(e,t){for(var a,r,i;;){if(e.lookahead<Hc){if(cl(e),e.lookahead<Hc&&t===Ac)return Zc;if(0===e.lookahead)break}if(a=0,e.lookahead>=Fc&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+Fc-1])&e.hash_mask,a=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=Fc-1,0!==a&&e.prev_length<e.max_lazy_match&&e.strstart-a<=e.w_size-Hc&&(e.match_length=ul(e,a),e.match_length<=5&&(1===e.strategy||e.match_length===Fc&&e.strstart-e.match_start>4096)&&(e.match_length=Fc-1)),e.prev_length>=Fc&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-Fc,r=Sc._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-Fc),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=i&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+Fc-1])&e.hash_mask,a=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart)}while(0!=--e.prev_length);if(e.match_available=0,e.match_length=Fc-1,e.strstart++,r&&(il(e,!1),0===e.strm.avail_out))return Zc}else if(e.match_available){if((r=Sc._tr_tally(e,0,e.window[e.strstart-1]))&&il(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return Zc}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(r=Sc._tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<Fc-1?e.strstart:Fc-1,t===Bc?(il(e,!0),0===e.strm.avail_out?$c:Jc):e.last_lit&&(il(e,!1),0===e.strm.avail_out)?Zc:Xc}function hl(e,t,a,r,i){this.good_length=e,this.max_lazy=t,this.nice_length=a,this.max_chain=r,this.func=i}function dl(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=Dc,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Ec.Buf16(2*Mc),this.dyn_dtree=new Ec.Buf16(2*(2*Pc+1)),this.bl_tree=new Ec.Buf16(2*(2*Vc+1)),al(this.dyn_ltree),al(this.dyn_dtree),al(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Ec.Buf16(Kc+1),this.heap=new Ec.Buf16(2*Oc+1),al(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Ec.Buf16(2*Oc+1),al(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function ml(e){var t;return e&&e.state?(e.total_in=e.total_out=0,e.data_type=xc,(t=e.state).pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?Gc:Qc,e.adler=2===t.wrap?0:1,t.last_flush=Ac,Sc._tr_init(t),Nc):el(e,Rc)}function fl(e){var t=ml(e);return t===Nc&&function(e){e.window_size=2*e.w_size,al(e.head),e.max_lazy_match=wc[e.level].max_lazy,e.good_match=wc[e.level].good_length,e.nice_match=wc[e.level].nice_length,e.max_chain_length=wc[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=Fc-1,e.match_available=0,e.ins_h=0}(e.state),t}function gl(e,t,a,r,i,n){if(!e)return Rc;var o=1;if(t===zc&&(t=6),r<0?(o=0,r=-r):r>15&&(o=2,r-=16),i<1||i>Uc||a!==Dc||r<8||r>15||t<0||t>9||n<0||n>Lc)return el(e,Rc);8===r&&(r=9);var s=new dl;return e.state=s,s.strm=e,s.wrap=o,s.gzhead=null,s.w_bits=r,s.w_size=1<<s.w_bits,s.w_mask=s.w_size-1,s.hash_bits=i+7,s.hash_size=1<<s.hash_bits,s.hash_mask=s.hash_size-1,s.hash_shift=~~((s.hash_bits+Fc-1)/Fc),s.window=new Ec.Buf8(2*s.w_size),s.head=new Ec.Buf16(s.hash_size),s.prev=new Ec.Buf16(s.w_size),s.lit_bufsize=1<<i+6,s.pending_buf_size=4*s.lit_bufsize,s.pending_buf=new Ec.Buf8(s.pending_buf_size),s.d_buf=1*s.lit_bufsize,s.l_buf=3*s.lit_bufsize,s.level=t,s.strategy=n,s.method=a,fl(e)}wc=[new hl(0,0,0,0,(function(e,t){var a=65535;for(a>e.pending_buf_size-5&&(a=e.pending_buf_size-5);;){if(e.lookahead<=1){if(cl(e),0===e.lookahead&&t===Ac)return Zc;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var r=e.block_start+a;if((0===e.strstart||e.strstart>=r)&&(e.lookahead=e.strstart-r,e.strstart=r,il(e,!1),0===e.strm.avail_out))return Zc;if(e.strstart-e.block_start>=e.w_size-Hc&&(il(e,!1),0===e.strm.avail_out))return Zc}return e.insert=0,t===Bc?(il(e,!0),0===e.strm.avail_out?$c:Jc):(e.strstart>e.block_start&&(il(e,!1),e.strm.avail_out),Zc)})),new hl(4,4,8,4,ll),new hl(4,5,16,8,ll),new hl(4,6,32,32,ll),new hl(4,4,16,16,pl),new hl(8,16,32,32,pl),new hl(8,16,128,128,pl),new hl(8,32,128,256,pl),new hl(32,128,258,1024,pl),new hl(32,258,258,4096,pl)],ju.deflateInit=function(e,t){return gl(e,t,Dc,15,8,0)},ju.deflateInit2=gl,ju.deflateReset=fl,ju.deflateResetKeep=ml,ju.deflateSetHeader=function(e,t){return e&&e.state?2!==e.state.wrap?Rc:(e.state.gzhead=t,Nc):Rc},ju.deflate=function(e,t){var a,r,i,n;if(!e||!e.state||t>5||t<0)return e?el(e,Rc):Rc;if(r=e.state,!e.output||!e.input&&0!==e.avail_in||r.status===Yc&&t!==Bc)return el(e,0===e.avail_out?-5:Rc);if(r.strm=e,a=r.last_flush,r.last_flush=t,r.status===Gc)if(2===r.wrap)e.adler=0,nl(r,31),nl(r,139),nl(r,8),r.gzhead?(nl(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),nl(r,255&r.gzhead.time),nl(r,r.gzhead.time>>8&255),nl(r,r.gzhead.time>>16&255),nl(r,r.gzhead.time>>24&255),nl(r,9===r.level?2:r.strategy>=2||r.level<2?4:0),nl(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(nl(r,255&r.gzhead.extra.length),nl(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(e.adler=_c(e.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69):(nl(r,0),nl(r,0),nl(r,0),nl(r,0),nl(r,0),nl(r,9===r.level?2:r.strategy>=2||r.level<2?4:0),nl(r,3),r.status=Qc);else{var o=Dc+(r.w_bits-8<<4)<<8;o|=(r.strategy>=2||r.level<2?0:r.level<6?1:6===r.level?2:3)<<6,0!==r.strstart&&(o|=32),o+=31-o%31,r.status=Qc,ol(r,o),0!==r.strstart&&(ol(r,e.adler>>>16),ol(r,65535&e.adler)),e.adler=1}if(69===r.status)if(r.gzhead.extra){for(i=r.pending;r.gzindex<(65535&r.gzhead.extra.length)&&(r.pending!==r.pending_buf_size||(r.gzhead.hcrc&&r.pending>i&&(e.adler=_c(e.adler,r.pending_buf,r.pending-i,i)),rl(e),i=r.pending,r.pending!==r.pending_buf_size));)nl(r,255&r.gzhead.extra[r.gzindex]),r.gzindex++;r.gzhead.hcrc&&r.pending>i&&(e.adler=_c(e.adler,r.pending_buf,r.pending-i,i)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=73)}else r.status=73;if(73===r.status)if(r.gzhead.name){i=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>i&&(e.adler=_c(e.adler,r.pending_buf,r.pending-i,i)),rl(e),i=r.pending,r.pending===r.pending_buf_size)){n=1;break}n=r.gzindex<r.gzhead.name.length?255&r.gzhead.name.charCodeAt(r.gzindex++):0,nl(r,n)}while(0!==n);r.gzhead.hcrc&&r.pending>i&&(e.adler=_c(e.adler,r.pending_buf,r.pending-i,i)),0===n&&(r.gzindex=0,r.status=91)}else r.status=91;if(91===r.status)if(r.gzhead.comment){i=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>i&&(e.adler=_c(e.adler,r.pending_buf,r.pending-i,i)),rl(e),i=r.pending,r.pending===r.pending_buf_size)){n=1;break}n=r.gzindex<r.gzhead.comment.length?255&r.gzhead.comment.charCodeAt(r.gzindex++):0,nl(r,n)}while(0!==n);r.gzhead.hcrc&&r.pending>i&&(e.adler=_c(e.adler,r.pending_buf,r.pending-i,i)),0===n&&(r.status=Wc)}else r.status=Wc;if(r.status===Wc&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&rl(e),r.pending+2<=r.pending_buf_size&&(nl(r,255&e.adler),nl(r,e.adler>>8&255),e.adler=0,r.status=Qc)):r.status=Qc),0!==r.pending){if(rl(e),0===e.avail_out)return r.last_flush=-1,Nc}else if(0===e.avail_in&&tl(t)<=tl(a)&&t!==Bc)return el(e,-5);if(r.status===Yc&&0!==e.avail_in)return el(e,-5);if(0!==e.avail_in||0!==r.lookahead||t!==Ac&&r.status!==Yc){var s=2===r.strategy?function(e,t){for(var a;;){if(0===e.lookahead&&(cl(e),0===e.lookahead)){if(t===Ac)return Zc;break}if(e.match_length=0,a=Sc._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,a&&(il(e,!1),0===e.strm.avail_out))return Zc}return e.insert=0,t===Bc?(il(e,!0),0===e.strm.avail_out?$c:Jc):e.last_lit&&(il(e,!1),0===e.strm.avail_out)?Zc:Xc}(r,t):3===r.strategy?function(e,t){for(var a,r,i,n,o=e.window;;){if(e.lookahead<=qc){if(cl(e),e.lookahead<=qc&&t===Ac)return Zc;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=Fc&&e.strstart>0&&(r=o[i=e.strstart-1])===o[++i]&&r===o[++i]&&r===o[++i]){n=e.strstart+qc;do{}while(r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&i<n);e.match_length=qc-(n-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=Fc?(a=Sc._tr_tally(e,1,e.match_length-Fc),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(a=Sc._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),a&&(il(e,!1),0===e.strm.avail_out))return Zc}return e.insert=0,t===Bc?(il(e,!0),0===e.strm.avail_out?$c:Jc):e.last_lit&&(il(e,!1),0===e.strm.avail_out)?Zc:Xc}(r,t):wc[r.level].func(r,t);if(s!==$c&&s!==Jc||(r.status=Yc),s===Zc||s===$c)return 0===e.avail_out&&(r.last_flush=-1),Nc;if(s===Xc&&(1===t?Sc._tr_align(r):5!==t&&(Sc._tr_stored_block(r,0,0,!1),3===t&&(al(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),rl(e),0===e.avail_out))return r.last_flush=-1,Nc}return t!==Bc?Nc:r.wrap<=0?1:(2===r.wrap?(nl(r,255&e.adler),nl(r,e.adler>>8&255),nl(r,e.adler>>16&255),nl(r,e.adler>>24&255),nl(r,255&e.total_in),nl(r,e.total_in>>8&255),nl(r,e.total_in>>16&255),nl(r,e.total_in>>24&255)):(ol(r,e.adler>>>16),ol(r,65535&e.adler)),rl(e),r.wrap>0&&(r.wrap=-r.wrap),0!==r.pending?Nc:1)},ju.deflateEnd=function(e){var t;return e&&e.state?(t=e.state.status)!==Gc&&69!==t&&73!==t&&91!==t&&t!==Wc&&t!==Qc&&t!==Yc?el(e,Rc):(e.state=null,t===Qc?el(e,-3):Nc):Rc},ju.deflateSetDictionary=function(e,t){var a,r,i,n,o,s,u,c,l=t.length;if(!e||!e.state)return Rc;if(2===(n=(a=e.state).wrap)||1===n&&a.status!==Gc||a.lookahead)return Rc;for(1===n&&(e.adler=Tc(e.adler,t,l,0)),a.wrap=0,l>=a.w_size&&(0===n&&(al(a.head),a.strstart=0,a.block_start=0,a.insert=0),c=new Ec.Buf8(a.w_size),Ec.arraySet(c,t,l-a.w_size,a.w_size,0),t=c,l=a.w_size),o=e.avail_in,s=e.next_in,u=e.input,e.avail_in=l,e.next_in=0,e.input=t,cl(a);a.lookahead>=Fc;){r=a.strstart,i=a.lookahead-(Fc-1);do{a.ins_h=(a.ins_h<<a.hash_shift^a.window[r+Fc-1])&a.hash_mask,a.prev[r&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=r,r++}while(--i);a.strstart=r,a.lookahead=Fc-1,cl(a)}return a.strstart+=a.lookahead,a.block_start=a.strstart,a.insert=a.lookahead,a.lookahead=0,a.match_length=a.prev_length=Fc-1,a.match_available=0,e.next_in=s,e.input=u,e.avail_in=o,a.wrap=n,Nc},ju.deflateInfo="pako deflate (from Nodeca project)";var yl={},kl=bu,vl=!0,bl=!0;try{String.fromCharCode.apply(null,[0])}catch(Ur){vl=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(Ur){bl=!1}for(var wl=new kl.Buf8(256),jl=0;jl<256;jl++)wl[jl]=jl>=252?6:jl>=248?5:jl>=240?4:jl>=224?3:jl>=192?2:1;function Cl(e,t){if(t<65534&&(e.subarray&&bl||!e.subarray&&vl))return String.fromCharCode.apply(null,kl.shrinkBuf(e,t));for(var a="",r=0;r<t;r++)a+=String.fromCharCode(e[r]);return a}wl[254]=wl[254]=1,yl.string2buf=function(e){var t,a,r,i,n,o=e.length,s=0;for(i=0;i<o;i++)55296==(64512&(a=e.charCodeAt(i)))&&i+1<o&&56320==(64512&(r=e.charCodeAt(i+1)))&&(a=65536+(a-55296<<10)+(r-56320),i++),s+=a<128?1:a<2048?2:a<65536?3:4;for(t=new kl.Buf8(s),n=0,i=0;n<s;i++)55296==(64512&(a=e.charCodeAt(i)))&&i+1<o&&56320==(64512&(r=e.charCodeAt(i+1)))&&(a=65536+(a-55296<<10)+(r-56320),i++),a<128?t[n++]=a:a<2048?(t[n++]=192|a>>>6,t[n++]=128|63&a):a<65536?(t[n++]=224|a>>>12,t[n++]=128|a>>>6&63,t[n++]=128|63&a):(t[n++]=240|a>>>18,t[n++]=128|a>>>12&63,t[n++]=128|a>>>6&63,t[n++]=128|63&a);return t},yl.buf2binstring=function(e){return Cl(e,e.length)},yl.binstring2buf=function(e){for(var t=new kl.Buf8(e.length),a=0,r=t.length;a<r;a++)t[a]=e.charCodeAt(a);return t},yl.buf2string=function(e,t){var a,r,i,n,o=t||e.length,s=new Array(2*o);for(r=0,a=0;a<o;)if((i=e[a++])<128)s[r++]=i;else if((n=wl[i])>4)s[r++]=65533,a+=n-1;else{for(i&=2===n?31:3===n?15:7;n>1&&a<o;)i=i<<6|63&e[a++],n--;n>1?s[r++]=65533:i<65536?s[r++]=i:(i-=65536,s[r++]=55296|i>>10&1023,s[r++]=56320|1023&i)}return Cl(s,r)},yl.utf8border=function(e,t){var a;for((t=t||e.length)>e.length&&(t=e.length),a=t-1;a>=0&&128==(192&e[a]);)a--;return a<0||0===a?t:a+wl[e[a]]>t?a:t};var El=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0},Sl=ju,Tl=bu,_l=yl,Il=Cc,Al=El,Bl=Object.prototype.toString,Nl=0,Rl=-1,zl=0,Ll=8;function xl(e){if(!(this instanceof xl))return new xl(e);this.options=Tl.assign({level:Rl,method:Ll,chunkSize:16384,windowBits:15,memLevel:8,strategy:zl,to:""},e||{});var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Al,this.strm.avail_out=0;var a=Sl.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(a!==Nl)throw new Error(Il[a]);if(t.header&&Sl.deflateSetHeader(this.strm,t.header),t.dictionary){var r;if(r="string"==typeof t.dictionary?_l.string2buf(t.dictionary):"[object ArrayBuffer]"===Bl.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,(a=Sl.deflateSetDictionary(this.strm,r))!==Nl)throw new Error(Il[a]);this._dict_set=!0}}function Dl(e,t){var a=new xl(t);if(a.push(e,!0),a.err)throw a.msg||Il[a.err];return a.result}xl.prototype.push=function(e,t){var a,r,i=this.strm,n=this.options.chunkSize;if(this.ended)return!1;r=t===~~t?t:!0===t?4:0,"string"==typeof e?i.input=_l.string2buf(e):"[object ArrayBuffer]"===Bl.call(e)?i.input=new Uint8Array(e):i.input=e,i.next_in=0,i.avail_in=i.input.length;do{if(0===i.avail_out&&(i.output=new Tl.Buf8(n),i.next_out=0,i.avail_out=n),1!==(a=Sl.deflate(i,r))&&a!==Nl)return this.onEnd(a),this.ended=!0,!1;0!==i.avail_out&&(0!==i.avail_in||4!==r&&2!==r)||("string"===this.options.to?this.onData(_l.buf2binstring(Tl.shrinkBuf(i.output,i.next_out))):this.onData(Tl.shrinkBuf(i.output,i.next_out)))}while((i.avail_in>0||0===i.avail_out)&&1!==a);return 4===r?(a=Sl.deflateEnd(this.strm),this.onEnd(a),this.ended=!0,a===Nl):2!==r||(this.onEnd(Nl),i.avail_out=0,!0)},xl.prototype.onData=function(e){this.chunks.push(e)},xl.prototype.onEnd=function(e){e===Nl&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=Tl.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},wu.Deflate=xl,wu.deflate=Dl,wu.deflateRaw=function(e,t){return(t=t||{}).raw=!0,Dl(e,t)},wu.gzip=function(e,t){return(t=t||{}).gzip=!0,Dl(e,t)};var Ul={},Ol={},Pl=bu,Vl=15,Ml=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],Kl=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],Fl=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],ql=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64],Hl=bu,Gl=vc,Wl=jc,Ql=function(e,t){var a,r,i,n,o,s,u,c,l,p,h,d,m,f,g,y,k,v,b,w,j,C,E,S,T;a=e.state,r=e.next_in,S=e.input,i=r+(e.avail_in-5),n=e.next_out,T=e.output,o=n-(t-e.avail_out),s=n+(e.avail_out-257),u=a.dmax,c=a.wsize,l=a.whave,p=a.wnext,h=a.window,d=a.hold,m=a.bits,f=a.lencode,g=a.distcode,y=(1<<a.lenbits)-1,k=(1<<a.distbits)-1;e:do{m<15&&(d+=S[r++]<<m,m+=8,d+=S[r++]<<m,m+=8),v=f[d&y];t:for(;;){if(d>>>=b=v>>>24,m-=b,0===(b=v>>>16&255))T[n++]=65535&v;else{if(!(16&b)){if(0==(64&b)){v=f[(65535&v)+(d&(1<<b)-1)];continue t}if(32&b){a.mode=12;break e}e.msg="invalid literal/length code",a.mode=30;break e}w=65535&v,(b&=15)&&(m<b&&(d+=S[r++]<<m,m+=8),w+=d&(1<<b)-1,d>>>=b,m-=b),m<15&&(d+=S[r++]<<m,m+=8,d+=S[r++]<<m,m+=8),v=g[d&k];a:for(;;){if(d>>>=b=v>>>24,m-=b,!(16&(b=v>>>16&255))){if(0==(64&b)){v=g[(65535&v)+(d&(1<<b)-1)];continue a}e.msg="invalid distance code",a.mode=30;break e}if(j=65535&v,m<(b&=15)&&(d+=S[r++]<<m,(m+=8)<b&&(d+=S[r++]<<m,m+=8)),(j+=d&(1<<b)-1)>u){e.msg="invalid distance too far back",a.mode=30;break e}if(d>>>=b,m-=b,j>(b=n-o)){if((b=j-b)>l&&a.sane){e.msg="invalid distance too far back",a.mode=30;break e}if(C=0,E=h,0===p){if(C+=c-b,b<w){w-=b;do{T[n++]=h[C++]}while(--b);C=n-j,E=T}}else if(p<b){if(C+=c+p-b,(b-=p)<w){w-=b;do{T[n++]=h[C++]}while(--b);if(C=0,p<w){w-=b=p;do{T[n++]=h[C++]}while(--b);C=n-j,E=T}}}else if(C+=p-b,b<w){w-=b;do{T[n++]=h[C++]}while(--b);C=n-j,E=T}for(;w>2;)T[n++]=E[C++],T[n++]=E[C++],T[n++]=E[C++],w-=3;w&&(T[n++]=E[C++],w>1&&(T[n++]=E[C++]))}else{C=n-j;do{T[n++]=T[C++],T[n++]=T[C++],T[n++]=T[C++],w-=3}while(w>2);w&&(T[n++]=T[C++],w>1&&(T[n++]=T[C++]))}break}}break}}while(r<i&&n<s);r-=w=m>>3,d&=(1<<(m-=w<<3))-1,e.next_in=r,e.next_out=n,e.avail_in=r<i?i-r+5:5-(r-i),e.avail_out=n<s?s-n+257:257-(n-s),a.hold=d,a.bits=m},Yl=function(e,t,a,r,i,n,o,s){var u,c,l,p,h,d,m,f,g,y=s.bits,k=0,v=0,b=0,w=0,j=0,C=0,E=0,S=0,T=0,_=0,I=null,A=0,B=new Pl.Buf16(16),N=new Pl.Buf16(16),R=null,z=0;for(k=0;k<=Vl;k++)B[k]=0;for(v=0;v<r;v++)B[t[a+v]]++;for(j=y,w=Vl;w>=1&&0===B[w];w--);if(j>w&&(j=w),0===w)return i[n++]=20971520,i[n++]=20971520,s.bits=1,0;for(b=1;b<w&&0===B[b];b++);for(j<b&&(j=b),S=1,k=1;k<=Vl;k++)if(S<<=1,(S-=B[k])<0)return-1;if(S>0&&(0===e||1!==w))return-1;for(N[1]=0,k=1;k<Vl;k++)N[k+1]=N[k]+B[k];for(v=0;v<r;v++)0!==t[a+v]&&(o[N[t[a+v]]++]=v);if(0===e?(I=R=o,d=19):1===e?(I=Ml,A-=257,R=Kl,z-=257,d=256):(I=Fl,R=ql,d=-1),_=0,v=0,k=b,h=n,C=j,E=0,l=-1,p=(T=1<<j)-1,1===e&&T>852||2===e&&T>592)return 1;for(;;){m=k-E,o[v]<d?(f=0,g=o[v]):o[v]>d?(f=R[z+o[v]],g=I[A+o[v]]):(f=96,g=0),u=1<<k-E,b=c=1<<C;do{i[h+(_>>E)+(c-=u)]=m<<24|f<<16|g|0}while(0!==c);for(u=1<<k-1;_&u;)u>>=1;if(0!==u?(_&=u-1,_+=u):_=0,v++,0==--B[k]){if(k===w)break;k=t[a+o[v]]}if(k>j&&(_&p)!==l){for(0===E&&(E=j),h+=b,S=1<<(C=k-E);C+E<w&&!((S-=B[C+E])<=0);)C++,S<<=1;if(T+=1<<C,1===e&&T>852||2===e&&T>592)return 1;i[l=_&p]=j<<24|C<<16|h-n|0}}return 0!==_&&(i[h+_]=k-E<<24|64<<16|0),s.bits=j,0},Zl=1,Xl=2,$l=0,Jl=-2,ep=1,tp=12,ap=30,rp=852,ip=592;function np(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function op(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Hl.Buf16(320),this.work=new Hl.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function sp(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=ep,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Hl.Buf32(rp),t.distcode=t.distdyn=new Hl.Buf32(ip),t.sane=1,t.back=-1,$l):Jl}function up(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,sp(e)):Jl}function cp(e,t){var a,r;return e&&e.state?(r=e.state,t<0?(a=0,t=-t):(a=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?Jl:(null!==r.window&&r.wbits!==t&&(r.window=null),r.wrap=a,r.wbits=t,up(e))):Jl}function lp(e,t){var a,r;return e?(r=new op,e.state=r,r.window=null,(a=cp(e,t))!==$l&&(e.state=null),a):Jl}var pp,hp,dp=!0;function mp(e){if(dp){var t;for(pp=new Hl.Buf32(512),hp=new Hl.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(Yl(Zl,e.lens,0,288,pp,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;Yl(Xl,e.lens,0,32,hp,0,e.work,{bits:5}),dp=!1}e.lencode=pp,e.lenbits=9,e.distcode=hp,e.distbits=5}function fp(e,t,a,r){var i,n=e.state;return null===n.window&&(n.wsize=1<<n.wbits,n.wnext=0,n.whave=0,n.window=new Hl.Buf8(n.wsize)),r>=n.wsize?(Hl.arraySet(n.window,t,a-n.wsize,n.wsize,0),n.wnext=0,n.whave=n.wsize):((i=n.wsize-n.wnext)>r&&(i=r),Hl.arraySet(n.window,t,a-r,i,n.wnext),(r-=i)?(Hl.arraySet(n.window,t,a-r,r,0),n.wnext=r,n.whave=n.wsize):(n.wnext+=i,n.wnext===n.wsize&&(n.wnext=0),n.whave<n.wsize&&(n.whave+=i))),0}Ol.inflateReset=up,Ol.inflateReset2=cp,Ol.inflateResetKeep=sp,Ol.inflateInit=function(e){return lp(e,15)},Ol.inflateInit2=lp,Ol.inflate=function(e,t){var a,r,i,n,o,s,u,c,l,p,h,d,m,f,g,y,k,v,b,w,j,C,E,S,T=0,_=new Hl.Buf8(4),I=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&0!==e.avail_in)return Jl;(a=e.state).mode===tp&&(a.mode=13),o=e.next_out,i=e.output,u=e.avail_out,n=e.next_in,r=e.input,s=e.avail_in,c=a.hold,l=a.bits,p=s,h=u,C=$l;e:for(;;)switch(a.mode){case ep:if(0===a.wrap){a.mode=13;break}for(;l<16;){if(0===s)break e;s--,c+=r[n++]<<l,l+=8}if(2&a.wrap&&35615===c){a.check=0,_[0]=255&c,_[1]=c>>>8&255,a.check=Wl(a.check,_,2,0),c=0,l=0,a.mode=2;break}if(a.flags=0,a.head&&(a.head.done=!1),!(1&a.wrap)||(((255&c)<<8)+(c>>8))%31){e.msg="incorrect header check",a.mode=ap;break}if(8!=(15&c)){e.msg="unknown compression method",a.mode=ap;break}if(l-=4,j=8+(15&(c>>>=4)),0===a.wbits)a.wbits=j;else if(j>a.wbits){e.msg="invalid window size",a.mode=ap;break}a.dmax=1<<j,e.adler=a.check=1,a.mode=512&c?10:tp,c=0,l=0;break;case 2:for(;l<16;){if(0===s)break e;s--,c+=r[n++]<<l,l+=8}if(a.flags=c,8!=(255&a.flags)){e.msg="unknown compression method",a.mode=ap;break}if(57344&a.flags){e.msg="unknown header flags set",a.mode=ap;break}a.head&&(a.head.text=c>>8&1),512&a.flags&&(_[0]=255&c,_[1]=c>>>8&255,a.check=Wl(a.check,_,2,0)),c=0,l=0,a.mode=3;case 3:for(;l<32;){if(0===s)break e;s--,c+=r[n++]<<l,l+=8}a.head&&(a.head.time=c),512&a.flags&&(_[0]=255&c,_[1]=c>>>8&255,_[2]=c>>>16&255,_[3]=c>>>24&255,a.check=Wl(a.check,_,4,0)),c=0,l=0,a.mode=4;case 4:for(;l<16;){if(0===s)break e;s--,c+=r[n++]<<l,l+=8}a.head&&(a.head.xflags=255&c,a.head.os=c>>8),512&a.flags&&(_[0]=255&c,_[1]=c>>>8&255,a.check=Wl(a.check,_,2,0)),c=0,l=0,a.mode=5;case 5:if(1024&a.flags){for(;l<16;){if(0===s)break e;s--,c+=r[n++]<<l,l+=8}a.length=c,a.head&&(a.head.extra_len=c),512&a.flags&&(_[0]=255&c,_[1]=c>>>8&255,a.check=Wl(a.check,_,2,0)),c=0,l=0}else a.head&&(a.head.extra=null);a.mode=6;case 6:if(1024&a.flags&&((d=a.length)>s&&(d=s),d&&(a.head&&(j=a.head.extra_len-a.length,a.head.extra||(a.head.extra=new Array(a.head.extra_len)),Hl.arraySet(a.head.extra,r,n,d,j)),512&a.flags&&(a.check=Wl(a.check,r,d,n)),s-=d,n+=d,a.length-=d),a.length))break e;a.length=0,a.mode=7;case 7:if(2048&a.flags){if(0===s)break e;d=0;do{j=r[n+d++],a.head&&j&&a.length<65536&&(a.head.name+=String.fromCharCode(j))}while(j&&d<s);if(512&a.flags&&(a.check=Wl(a.check,r,d,n)),s-=d,n+=d,j)break e}else a.head&&(a.head.name=null);a.length=0,a.mode=8;case 8:if(4096&a.flags){if(0===s)break e;d=0;do{j=r[n+d++],a.head&&j&&a.length<65536&&(a.head.comment+=String.fromCharCode(j))}while(j&&d<s);if(512&a.flags&&(a.check=Wl(a.check,r,d,n)),s-=d,n+=d,j)break e}else a.head&&(a.head.comment=null);a.mode=9;case 9:if(512&a.flags){for(;l<16;){if(0===s)break e;s--,c+=r[n++]<<l,l+=8}if(c!==(65535&a.check)){e.msg="header crc mismatch",a.mode=ap;break}c=0,l=0}a.head&&(a.head.hcrc=a.flags>>9&1,a.head.done=!0),e.adler=a.check=0,a.mode=tp;break;case 10:for(;l<32;){if(0===s)break e;s--,c+=r[n++]<<l,l+=8}e.adler=a.check=np(c),c=0,l=0,a.mode=11;case 11:if(0===a.havedict)return e.next_out=o,e.avail_out=u,e.next_in=n,e.avail_in=s,a.hold=c,a.bits=l,2;e.adler=a.check=1,a.mode=tp;case tp:if(5===t||6===t)break e;case 13:if(a.last){c>>>=7&l,l-=7&l,a.mode=27;break}for(;l<3;){if(0===s)break e;s--,c+=r[n++]<<l,l+=8}switch(a.last=1&c,l-=1,3&(c>>>=1)){case 0:a.mode=14;break;case 1:if(mp(a),a.mode=20,6===t){c>>>=2,l-=2;break e}break;case 2:a.mode=17;break;case 3:e.msg="invalid block type",a.mode=ap}c>>>=2,l-=2;break;case 14:for(c>>>=7&l,l-=7&l;l<32;){if(0===s)break e;s--,c+=r[n++]<<l,l+=8}if((65535&c)!=(c>>>16^65535)){e.msg="invalid stored block lengths",a.mode=ap;break}if(a.length=65535&c,c=0,l=0,a.mode=15,6===t)break e;case 15:a.mode=16;case 16:if(d=a.length){if(d>s&&(d=s),d>u&&(d=u),0===d)break e;Hl.arraySet(i,r,n,d,o),s-=d,n+=d,u-=d,o+=d,a.length-=d;break}a.mode=tp;break;case 17:for(;l<14;){if(0===s)break e;s--,c+=r[n++]<<l,l+=8}if(a.nlen=257+(31&c),c>>>=5,l-=5,a.ndist=1+(31&c),c>>>=5,l-=5,a.ncode=4+(15&c),c>>>=4,l-=4,a.nlen>286||a.ndist>30){e.msg="too many length or distance symbols",a.mode=ap;break}a.have=0,a.mode=18;case 18:for(;a.have<a.ncode;){for(;l<3;){if(0===s)break e;s--,c+=r[n++]<<l,l+=8}a.lens[I[a.have++]]=7&c,c>>>=3,l-=3}for(;a.have<19;)a.lens[I[a.have++]]=0;if(a.lencode=a.lendyn,a.lenbits=7,E={bits:a.lenbits},C=Yl(0,a.lens,0,19,a.lencode,0,a.work,E),a.lenbits=E.bits,C){e.msg="invalid code lengths set",a.mode=ap;break}a.have=0,a.mode=19;case 19:for(;a.have<a.nlen+a.ndist;){for(;y=(T=a.lencode[c&(1<<a.lenbits)-1])>>>16&255,k=65535&T,!((g=T>>>24)<=l);){if(0===s)break e;s--,c+=r[n++]<<l,l+=8}if(k<16)c>>>=g,l-=g,a.lens[a.have++]=k;else{if(16===k){for(S=g+2;l<S;){if(0===s)break e;s--,c+=r[n++]<<l,l+=8}if(c>>>=g,l-=g,0===a.have){e.msg="invalid bit length repeat",a.mode=ap;break}j=a.lens[a.have-1],d=3+(3&c),c>>>=2,l-=2}else if(17===k){for(S=g+3;l<S;){if(0===s)break e;s--,c+=r[n++]<<l,l+=8}l-=g,j=0,d=3+(7&(c>>>=g)),c>>>=3,l-=3}else{for(S=g+7;l<S;){if(0===s)break e;s--,c+=r[n++]<<l,l+=8}l-=g,j=0,d=11+(127&(c>>>=g)),c>>>=7,l-=7}if(a.have+d>a.nlen+a.ndist){e.msg="invalid bit length repeat",a.mode=ap;break}for(;d--;)a.lens[a.have++]=j}}if(a.mode===ap)break;if(0===a.lens[256]){e.msg="invalid code -- missing end-of-block",a.mode=ap;break}if(a.lenbits=9,E={bits:a.lenbits},C=Yl(Zl,a.lens,0,a.nlen,a.lencode,0,a.work,E),a.lenbits=E.bits,C){e.msg="invalid literal/lengths set",a.mode=ap;break}if(a.distbits=6,a.distcode=a.distdyn,E={bits:a.distbits},C=Yl(Xl,a.lens,a.nlen,a.ndist,a.distcode,0,a.work,E),a.distbits=E.bits,C){e.msg="invalid distances set",a.mode=ap;break}if(a.mode=20,6===t)break e;case 20:a.mode=21;case 21:if(s>=6&&u>=258){e.next_out=o,e.avail_out=u,e.next_in=n,e.avail_in=s,a.hold=c,a.bits=l,Ql(e,h),o=e.next_out,i=e.output,u=e.avail_out,n=e.next_in,r=e.input,s=e.avail_in,c=a.hold,l=a.bits,a.mode===tp&&(a.back=-1);break}for(a.back=0;y=(T=a.lencode[c&(1<<a.lenbits)-1])>>>16&255,k=65535&T,!((g=T>>>24)<=l);){if(0===s)break e;s--,c+=r[n++]<<l,l+=8}if(y&&0==(240&y)){for(v=g,b=y,w=k;y=(T=a.lencode[w+((c&(1<<v+b)-1)>>v)])>>>16&255,k=65535&T,!(v+(g=T>>>24)<=l);){if(0===s)break e;s--,c+=r[n++]<<l,l+=8}c>>>=v,l-=v,a.back+=v}if(c>>>=g,l-=g,a.back+=g,a.length=k,0===y){a.mode=26;break}if(32&y){a.back=-1,a.mode=tp;break}if(64&y){e.msg="invalid literal/length code",a.mode=ap;break}a.extra=15&y,a.mode=22;case 22:if(a.extra){for(S=a.extra;l<S;){if(0===s)break e;s--,c+=r[n++]<<l,l+=8}a.length+=c&(1<<a.extra)-1,c>>>=a.extra,l-=a.extra,a.back+=a.extra}a.was=a.length,a.mode=23;case 23:for(;y=(T=a.distcode[c&(1<<a.distbits)-1])>>>16&255,k=65535&T,!((g=T>>>24)<=l);){if(0===s)break e;s--,c+=r[n++]<<l,l+=8}if(0==(240&y)){for(v=g,b=y,w=k;y=(T=a.distcode[w+((c&(1<<v+b)-1)>>v)])>>>16&255,k=65535&T,!(v+(g=T>>>24)<=l);){if(0===s)break e;s--,c+=r[n++]<<l,l+=8}c>>>=v,l-=v,a.back+=v}if(c>>>=g,l-=g,a.back+=g,64&y){e.msg="invalid distance code",a.mode=ap;break}a.offset=k,a.extra=15&y,a.mode=24;case 24:if(a.extra){for(S=a.extra;l<S;){if(0===s)break e;s--,c+=r[n++]<<l,l+=8}a.offset+=c&(1<<a.extra)-1,c>>>=a.extra,l-=a.extra,a.back+=a.extra}if(a.offset>a.dmax){e.msg="invalid distance too far back",a.mode=ap;break}a.mode=25;case 25:if(0===u)break e;if(d=h-u,a.offset>d){if((d=a.offset-d)>a.whave&&a.sane){e.msg="invalid distance too far back",a.mode=ap;break}d>a.wnext?(d-=a.wnext,m=a.wsize-d):m=a.wnext-d,d>a.length&&(d=a.length),f=a.window}else f=i,m=o-a.offset,d=a.length;d>u&&(d=u),u-=d,a.length-=d;do{i[o++]=f[m++]}while(--d);0===a.length&&(a.mode=21);break;case 26:if(0===u)break e;i[o++]=a.length,u--,a.mode=21;break;case 27:if(a.wrap){for(;l<32;){if(0===s)break e;s--,c|=r[n++]<<l,l+=8}if(h-=u,e.total_out+=h,a.total+=h,h&&(e.adler=a.check=a.flags?Wl(a.check,i,h,o-h):Gl(a.check,i,h,o-h)),h=u,(a.flags?c:np(c))!==a.check){e.msg="incorrect data check",a.mode=ap;break}c=0,l=0}a.mode=28;case 28:if(a.wrap&&a.flags){for(;l<32;){if(0===s)break e;s--,c+=r[n++]<<l,l+=8}if(c!==(4294967295&a.total)){e.msg="incorrect length check",a.mode=ap;break}c=0,l=0}a.mode=29;case 29:C=1;break e;case ap:C=-3;break e;case 31:return-4;default:return Jl}return e.next_out=o,e.avail_out=u,e.next_in=n,e.avail_in=s,a.hold=c,a.bits=l,(a.wsize||h!==e.avail_out&&a.mode<ap&&(a.mode<27||4!==t))&&fp(e,e.output,e.next_out,h-e.avail_out),p-=e.avail_in,h-=e.avail_out,e.total_in+=p,e.total_out+=h,a.total+=h,a.wrap&&h&&(e.adler=a.check=a.flags?Wl(a.check,i,h,e.next_out-h):Gl(a.check,i,h,e.next_out-h)),e.data_type=a.bits+(a.last?64:0)+(a.mode===tp?128:0)+(20===a.mode||15===a.mode?256:0),(0===p&&0===h||4===t)&&C===$l&&(C=-5),C},Ol.inflateEnd=function(e){if(!e||!e.state)return Jl;var t=e.state;return t.window&&(t.window=null),e.state=null,$l},Ol.inflateGetHeader=function(e,t){var a;return e&&e.state?0==(2&(a=e.state).wrap)?Jl:(a.head=t,t.done=!1,$l):Jl},Ol.inflateSetDictionary=function(e,t){var a,r=t.length;return e&&e.state?0!==(a=e.state).wrap&&11!==a.mode?Jl:11===a.mode&&Gl(1,t,r,0)!==a.check?-3:fp(e,t,r,r)?(a.mode=31,-4):(a.havedict=1,$l):Jl},Ol.inflateInfo="pako inflate (from Nodeca project)";var gp={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};var yp=Ol,kp=bu,vp=yl,bp=gp,wp=Cc,jp=El,Cp=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1},Ep=Object.prototype.toString;function Sp(e){if(!(this instanceof Sp))return new Sp(e);this.options=kp.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new jp,this.strm.avail_out=0;var a=yp.inflateInit2(this.strm,t.windowBits);if(a!==bp.Z_OK)throw new Error(wp[a]);if(this.header=new Cp,yp.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=vp.string2buf(t.dictionary):"[object ArrayBuffer]"===Ep.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(a=yp.inflateSetDictionary(this.strm,t.dictionary))!==bp.Z_OK))throw new Error(wp[a])}function Tp(e,t){var a=new Sp(t);if(a.push(e,!0),a.err)throw a.msg||wp[a.err];return a.result}Sp.prototype.push=function(e,t){var a,r,i,n,o,s=this.strm,u=this.options.chunkSize,c=this.options.dictionary,l=!1;if(this.ended)return!1;r=t===~~t?t:!0===t?bp.Z_FINISH:bp.Z_NO_FLUSH,"string"==typeof e?s.input=vp.binstring2buf(e):"[object ArrayBuffer]"===Ep.call(e)?s.input=new Uint8Array(e):s.input=e,s.next_in=0,s.avail_in=s.input.length;do{if(0===s.avail_out&&(s.output=new kp.Buf8(u),s.next_out=0,s.avail_out=u),(a=yp.inflate(s,bp.Z_NO_FLUSH))===bp.Z_NEED_DICT&&c&&(a=yp.inflateSetDictionary(this.strm,c)),a===bp.Z_BUF_ERROR&&!0===l&&(a=bp.Z_OK,l=!1),a!==bp.Z_STREAM_END&&a!==bp.Z_OK)return this.onEnd(a),this.ended=!0,!1;s.next_out&&(0!==s.avail_out&&a!==bp.Z_STREAM_END&&(0!==s.avail_in||r!==bp.Z_FINISH&&r!==bp.Z_SYNC_FLUSH)||("string"===this.options.to?(i=vp.utf8border(s.output,s.next_out),n=s.next_out-i,o=vp.buf2string(s.output,i),s.next_out=n,s.avail_out=u-n,n&&kp.arraySet(s.output,s.output,i,n,0),this.onData(o)):this.onData(kp.shrinkBuf(s.output,s.next_out)))),0===s.avail_in&&0===s.avail_out&&(l=!0)}while((s.avail_in>0||0===s.avail_out)&&a!==bp.Z_STREAM_END);return a===bp.Z_STREAM_END&&(r=bp.Z_FINISH),r===bp.Z_FINISH?(a=yp.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,a===bp.Z_OK):r!==bp.Z_SYNC_FLUSH||(this.onEnd(bp.Z_OK),s.avail_out=0,!0)},Sp.prototype.onData=function(e){this.chunks.push(e)},Sp.prototype.onEnd=function(e){e===bp.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=kp.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},Ul.Inflate=Sp,Ul.inflate=Tp,Ul.inflateRaw=function(e,t){return(t=t||{}).raw=!0,Tp(e,t)},Ul.ungzip=Tp;var _p={};(0,bu.assign)(_p,wu,Ul,gp);var Ip="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array,Ap=_p,Bp=js(),Np=Es,Rp=Ip?"uint8array":"array";function zp(e,t){Np.call(this,"FlateWorker/"+e),this._pako=null,this._pakoAction=e,this._pakoOptions=t,this.meta={}}vu.magic="\b\0",Bp.inherits(zp,Np),zp.prototype.processChunk=function(e){this.meta=e.meta,null===this._pako&&this._createPako(),this._pako.push(Bp.transformTo(Rp,e.data),!1)},zp.prototype.flush=function(){Np.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0)},zp.prototype.cleanUp=function(){Np.prototype.cleanUp.call(this),this._pako=null},zp.prototype._createPako=function(){this._pako=new Ap[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var e=this;this._pako.onData=function(t){e.push({data:t,meta:e.meta})}},vu.compressWorker=function(e){return new zp("Deflate",e)},vu.uncompressWorker=function(){return new zp("Inflate",{})};var Lp=Es;ku.STORE={magic:"\0\0",compressWorker:function(){return new Lp("STORE compression")},uncompressWorker:function(){return new Lp("STORE decompression")}},ku.DEFLATE=vu;var xp={LOCAL_FILE_HEADER:"PK",CENTRAL_FILE_HEADER:"PK",CENTRAL_DIRECTORY_END:"PK",ZIP64_CENTRAL_DIRECTORY_LOCATOR:"PK",ZIP64_CENTRAL_DIRECTORY_END:"PK",DATA_DESCRIPTOR:"PK\b"},Dp=js(),Up=Es,Op=uo,Pp=Ws,Vp=xp,Mp=function(e,t){var a,r="";for(a=0;a<t;a++)r+=String.fromCharCode(255&e),e>>>=8;return r},Kp=function(e,t,a,r,i,n){var o,s,u=e.file,c=e.compression,l=n!==Op.utf8encode,p=Dp.transformTo("string",n(u.name)),h=Dp.transformTo("string",Op.utf8encode(u.name)),d=u.comment,m=Dp.transformTo("string",n(d)),f=Dp.transformTo("string",Op.utf8encode(d)),g=h.length!==u.name.length,y=f.length!==d.length,k="",v="",b="",w=u.dir,j=u.date,C={crc32:0,compressedSize:0,uncompressedSize:0};t&&!a||(C.crc32=e.crc32,C.compressedSize=e.compressedSize,C.uncompressedSize=e.uncompressedSize);var E=0;t&&(E|=8),l||!g&&!y||(E|=2048);var S,T,_,I=0,A=0;w&&(I|=16),"UNIX"===i?(A=798,I|=(S=u.unixPermissions,T=w,_=S,S||(_=T?16893:33204),(65535&_)<<16)):(A=20,I|=63&(u.dosPermissions||0)),o=j.getUTCHours(),o<<=6,o|=j.getUTCMinutes(),o<<=5,o|=j.getUTCSeconds()/2,s=j.getUTCFullYear()-1980,s<<=4,s|=j.getUTCMonth()+1,s<<=5,s|=j.getUTCDate(),g&&(v=Mp(1,1)+Mp(Pp(p),4)+h,k+="up"+Mp(v.length,2)+v),y&&(b=Mp(1,1)+Mp(Pp(m),4)+f,k+="uc"+Mp(b.length,2)+b);var B="";return B+="\n\0",B+=Mp(E,2),B+=c.magic,B+=Mp(o,2),B+=Mp(s,2),B+=Mp(C.crc32,4),B+=Mp(C.compressedSize,4),B+=Mp(C.uncompressedSize,4),B+=Mp(p.length,2),B+=Mp(k.length,2),{fileRecord:Vp.LOCAL_FILE_HEADER+B+p+k,dirRecord:Vp.CENTRAL_FILE_HEADER+Mp(A,2)+B+Mp(m.length,2)+"\0\0\0\0"+Mp(I,4)+Mp(r,4)+p+k+m}},Fp=function(e){return Vp.DATA_DESCRIPTOR+Mp(e.crc32,4)+Mp(e.compressedSize,4)+Mp(e.uncompressedSize,4)};function qp(e,t,a,r){Up.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=t,this.zipPlatform=a,this.encodeFileName=r,this.streamFiles=e,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}Dp.inherits(qp,Up),qp.prototype.push=function(e){var t=e.meta.percent||0,a=this.entriesCount,r=this._sources.length;this.accumulate?this.contentBuffer.push(e):(this.bytesWritten+=e.data.length,Up.prototype.push.call(this,{data:e.data,meta:{currentFile:this.currentFile,percent:a?(t+100*(a-r-1))/a:100}}))},qp.prototype.openedSource=function(e){this.currentSourceOffset=this.bytesWritten,this.currentFile=e.file.name;var t=this.streamFiles&&!e.file.dir;if(t){var a=Kp(e,t,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:a.fileRecord,meta:{percent:0}})}else this.accumulate=!0},qp.prototype.closedSource=function(e){this.accumulate=!1;var t=this.streamFiles&&!e.file.dir,a=Kp(e,t,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(a.dirRecord),t)this.push({data:Fp(e),meta:{percent:100}});else for(this.push({data:a.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},qp.prototype.flush=function(){for(var e=this.bytesWritten,t=0;t<this.dirRecords.length;t++)this.push({data:this.dirRecords[t],meta:{percent:100}});var a=this.bytesWritten-e,r=function(e,t,a,r,i){var n=Dp.transformTo("string",i(r));return Vp.CENTRAL_DIRECTORY_END+"\0\0\0\0"+Mp(e,2)+Mp(e,2)+Mp(t,4)+Mp(a,4)+Mp(n.length,2)+n}(this.dirRecords.length,a,e,this.zipComment,this.encodeFileName);this.push({data:r,meta:{percent:100}})},qp.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},qp.prototype.registerPrevious=function(e){this._sources.push(e);var t=this;return e.on("data",(function(e){t.processChunk(e)})),e.on("end",(function(){t.closedSource(t.previous.streamInfo),t._sources.length?t.prepareNextSource():t.end()})),e.on("error",(function(e){t.error(e)})),this},qp.prototype.resume=function(){return!!Up.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},qp.prototype.error=function(e){var t=this._sources;if(!Up.prototype.error.call(this,e))return!1;for(var a=0;a<t.length;a++)try{t[a].error(e)}catch(e){}return!0},qp.prototype.lock=function(){Up.prototype.lock.call(this);for(var e=this._sources,t=0;t<e.length;t++)e[t].lock()};var Hp=ku,Gp=qp;yu.generateWorker=function(e,t,a){var r=new Gp(t.streamFiles,a,t.platform,t.encodeFileName),i=0;try{e.forEach((function(e,a){i++;var n=function(e,t){var a=e||t,r=Hp[a];if(!r)throw new Error(a+" is not a valid compression method !");return r}(a.options.compression,t.compression),o=a.options.compressionOptions||t.compressionOptions||{},s=a.dir,u=a.date;a._compressWorker(n,o).withStreamInfo("file",{name:e,dir:s,date:u,comment:a.comment||"",unixPermissions:a.unixPermissions,dosPermissions:a.dosPermissions}).pipe(r)})),r.entriesCount=i}catch(e){r.error(e)}return r};var Wp=js(),Qp=Es;function Yp(e,t){Qp.call(this,"Nodejs stream input adapter for "+e),this._upstreamEnded=!1,this._bindStream(t)}Wp.inherits(Yp,Qp),Yp.prototype._bindStream=function(e){var t=this;this._stream=e,e.pause(),e.on("data",(function(e){t.push({data:e,meta:{percent:0}})})).on("error",(function(e){t.isPaused?this.generatedError=e:t.error(e)})).on("end",(function(){t.isPaused?t._upstreamEnded=!0:t.end()}))},Yp.prototype.pause=function(){return!!Qp.prototype.pause.call(this)&&(this._stream.pause(),!0)},Yp.prototype.resume=function(){return!!Qp.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)};var Zp=Yp,Xp=uo,$p=js(),Jp=Es,eh=Ps,th=Vs,ah=ou,rh=gu,ih=yu,nh=ks,oh=Zp,sh=function(e,t,a){var r,i=$p.getTypeOf(t),n=$p.extend(a||{},th);n.date=n.date||new Date,null!==n.compression&&(n.compression=n.compression.toUpperCase()),"string"==typeof n.unixPermissions&&(n.unixPermissions=parseInt(n.unixPermissions,8)),n.unixPermissions&&16384&n.unixPermissions&&(n.dir=!0),n.dosPermissions&&16&n.dosPermissions&&(n.dir=!0),n.dir&&(e=ch(e)),n.createFolders&&(r=uh(e))&&lh.call(this,r,!0);var o="string"===i&&!1===n.binary&&!1===n.base64;a&&void 0!==a.binary||(n.binary=!o),(t instanceof ah&&0===t.uncompressedSize||n.dir||!t||0===t.length)&&(n.base64=!1,n.binary=!0,t="",n.compression="STORE",i="string");var s=null;s=t instanceof ah||t instanceof Jp?t:nh.isNode&&nh.isStream(t)?new oh(e,t):$p.prepareContent(e,t,n.binary,n.optimizedBinaryString,n.base64);var u=new rh(e,s,n);this.files[e]=u},uh=function(e){"/"===e.slice(-1)&&(e=e.substring(0,e.length-1));var t=e.lastIndexOf("/");return t>0?e.substring(0,t):""},ch=function(e){return"/"!==e.slice(-1)&&(e+="/"),e},lh=function(e,t){return t=void 0!==t?t:th.createFolders,e=ch(e),this.files[e]||sh.call(this,e,null,{dir:!0,createFolders:t}),this.files[e]};function ph(e){return"[object RegExp]"===Object.prototype.toString.call(e)}var hh={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(e){var t,a,r;for(t in this.files)r=this.files[t],(a=t.slice(this.root.length,t.length))&&t.slice(0,this.root.length)===this.root&&e(a,r)},filter:function(e){var t=[];return this.forEach((function(a,r){e(a,r)&&t.push(r)})),t},file:function(e,t,a){if(1===arguments.length){if(ph(e)){var r=e;return this.filter((function(e,t){return!t.dir&&r.test(e)}))}var i=this.files[this.root+e];return i&&!i.dir?i:null}return e=this.root+e,sh.call(this,e,t,a),this},folder:function(e){if(!e)return this;if(ph(e))return this.filter((function(t,a){return a.dir&&e.test(t)}));var t=this.root+e,a=lh.call(this,t),r=this.clone();return r.root=a.name,r},remove:function(e){e=this.root+e;var t=this.files[e];if(t||("/"!==e.slice(-1)&&(e+="/"),t=this.files[e]),t&&!t.dir)delete this.files[e];else for(var a=this.filter((function(t,a){return a.name.slice(0,e.length)===e})),r=0;r<a.length;r++)delete this.files[a[r].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(e){var t,a={};try{if((a=$p.extend(e||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:Xp.utf8encode})).type=a.type.toLowerCase(),a.compression=a.compression.toUpperCase(),"binarystring"===a.type&&(a.type="string"),!a.type)throw new Error("No output type specified.");$p.checkSupport(a.type),"darwin"!==a.platform&&"freebsd"!==a.platform&&"linux"!==a.platform&&"sunos"!==a.platform||(a.platform="UNIX"),"win32"===a.platform&&(a.platform="DOS");var r=a.comment||this.comment||"";t=ih.generateWorker(this,a,r)}catch(e){(t=new Jp("error")).error(e)}return new eh(t,a.type||"string",a.mimeType)},generateAsync:function(e,t){return this.generateInternalStream(e).accumulate(t)},generateNodeStream:function(e,t){return(e=e||{}).type||(e.type="nodebuffer"),this.generateInternalStream(e).toNodejsStream(t)}},dh=hh,mh=js();function fh(e){this.data=e,this.length=e.length,this.index=0,this.zero=0}fh.prototype={checkOffset:function(e){this.checkIndex(this.index+e)},checkIndex:function(e){if(this.length<this.zero+e||e<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+e+"). Corrupted zip ?")},setIndex:function(e){this.checkIndex(e),this.index=e},skip:function(e){this.setIndex(this.index+e)},byteAt:function(){},readInt:function(e){var t,a=0;for(this.checkOffset(e),t=this.index+e-1;t>=this.index;t--)a=(a<<8)+this.byteAt(t);return this.index+=e,a},readString:function(e){return mh.transformTo("string",this.readData(e))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var e=this.readInt(4);return new Date(Date.UTC(1980+(e>>25&127),(e>>21&15)-1,e>>16&31,e>>11&31,e>>5&63,(31&e)<<1))}};var gh=fh,yh=gh;function kh(e){yh.call(this,e);for(var t=0;t<this.data.length;t++)e[t]=255&e[t]}js().inherits(kh,yh),kh.prototype.byteAt=function(e){return this.data[this.zero+e]},kh.prototype.lastIndexOfSignature=function(e){for(var t=e.charCodeAt(0),a=e.charCodeAt(1),r=e.charCodeAt(2),i=e.charCodeAt(3),n=this.length-4;n>=0;--n)if(this.data[n]===t&&this.data[n+1]===a&&this.data[n+2]===r&&this.data[n+3]===i)return n-this.zero;return-1},kh.prototype.readAndCheckSignature=function(e){var t=e.charCodeAt(0),a=e.charCodeAt(1),r=e.charCodeAt(2),i=e.charCodeAt(3),n=this.readData(4);return t===n[0]&&a===n[1]&&r===n[2]&&i===n[3]},kh.prototype.readData=function(e){if(this.checkOffset(e),0===e)return[];var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t};var vh=kh,bh=gh;function wh(e){bh.call(this,e)}js().inherits(wh,bh),wh.prototype.byteAt=function(e){return this.data.charCodeAt(this.zero+e)},wh.prototype.lastIndexOfSignature=function(e){return this.data.lastIndexOf(e)-this.zero},wh.prototype.readAndCheckSignature=function(e){return e===this.readData(4)},wh.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t};var jh=wh,Ch=vh;function Eh(e){Ch.call(this,e)}js().inherits(Eh,Ch),Eh.prototype.readData=function(e){if(this.checkOffset(e),0===e)return new Uint8Array(0);var t=this.data.subarray(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t};var Sh=Eh,Th=Sh;function _h(e){Th.call(this,e)}js().inherits(_h,Th),_h.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t};var Ih=_h,Ah=js(),Bh=lo,Nh=vh,Rh=jh,zh=Ih,Lh=Sh,xh=function(e){var t=Ah.getTypeOf(e);return Ah.checkSupport(t),"string"!==t||Bh.uint8array?"nodebuffer"===t?new zh(e):Bh.uint8array?new Lh(Ah.transformTo("uint8array",e)):new Nh(Ah.transformTo("array",e)):new Rh(e)},Dh=xh,Uh=js(),Oh=ou,Ph=Ws,Vh=uo,Mh=ku,Kh=lo;function Fh(e,t){this.options=e,this.loadOptions=t}Fh.prototype={isEncrypted:function(){return 1==(1&this.bitFlag)},useUTF8:function(){return 2048==(2048&this.bitFlag)},readLocalPart:function(e){var t,a;if(e.skip(22),this.fileNameLength=e.readInt(2),a=e.readInt(2),this.fileName=e.readData(this.fileNameLength),e.skip(a),-1===this.compressedSize||-1===this.uncompressedSize)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if(null===(t=function(e){for(var t in Mh)if(Object.prototype.hasOwnProperty.call(Mh,t)&&Mh[t].magic===e)return Mh[t];return null}(this.compressionMethod)))throw new Error("Corrupted zip : compression "+Uh.pretty(this.compressionMethod)+" unknown (inner file : "+Uh.transformTo("string",this.fileName)+")");this.decompressed=new Oh(this.compressedSize,this.uncompressedSize,this.crc32,t,e.readData(this.compressedSize))},readCentralPart:function(e){this.versionMadeBy=e.readInt(2),e.skip(2),this.bitFlag=e.readInt(2),this.compressionMethod=e.readString(2),this.date=e.readDate(),this.crc32=e.readInt(4),this.compressedSize=e.readInt(4),this.uncompressedSize=e.readInt(4);var t=e.readInt(2);if(this.extraFieldsLength=e.readInt(2),this.fileCommentLength=e.readInt(2),this.diskNumberStart=e.readInt(2),this.internalFileAttributes=e.readInt(2),this.externalFileAttributes=e.readInt(4),this.localHeaderOffset=e.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");e.skip(t),this.readExtraFields(e),this.parseZIP64ExtraField(e),this.fileComment=e.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var e=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),0===e&&(this.dosPermissions=63&this.externalFileAttributes),3===e&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||"/"!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var e=Dh(this.extraFields[1].value);this.uncompressedSize===Uh.MAX_VALUE_32BITS&&(this.uncompressedSize=e.readInt(8)),this.compressedSize===Uh.MAX_VALUE_32BITS&&(this.compressedSize=e.readInt(8)),this.localHeaderOffset===Uh.MAX_VALUE_32BITS&&(this.localHeaderOffset=e.readInt(8)),this.diskNumberStart===Uh.MAX_VALUE_32BITS&&(this.diskNumberStart=e.readInt(4))}},readExtraFields:function(e){var t,a,r,i=e.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});e.index+4<i;)t=e.readInt(2),a=e.readInt(2),r=e.readData(a),this.extraFields[t]={id:t,length:a,value:r};e.setIndex(i)},handleUTF8:function(){var e=Kh.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=Vh.utf8decode(this.fileName),this.fileCommentStr=Vh.utf8decode(this.fileComment);else{var t=this.findExtraFieldUnicodePath();if(null!==t)this.fileNameStr=t;else{var a=Uh.transformTo(e,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(a)}var r=this.findExtraFieldUnicodeComment();if(null!==r)this.fileCommentStr=r;else{var i=Uh.transformTo(e,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(i)}}},findExtraFieldUnicodePath:function(){var e=this.extraFields[28789];if(e){var t=Dh(e.value);return 1!==t.readInt(1)||Ph(this.fileName)!==t.readInt(4)?null:Vh.utf8decode(t.readData(e.length-5))}return null},findExtraFieldUnicodeComment:function(){var e=this.extraFields[25461];if(e){var t=Dh(e.value);return 1!==t.readInt(1)||Ph(this.fileComment)!==t.readInt(4)?null:Vh.utf8decode(t.readData(e.length-5))}return null}};var qh=Fh,Hh=xh,Gh=js(),Wh=xp,Qh=qh,Yh=lo;function Zh(e){this.files=[],this.loadOptions=e}Zh.prototype={checkSignature:function(e){if(!this.reader.readAndCheckSignature(e)){this.reader.index-=4;var t=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+Gh.pretty(t)+", expected "+Gh.pretty(e)+")")}},isSignature:function(e,t){var a=this.reader.index;this.reader.setIndex(e);var r=this.reader.readString(4)===t;return this.reader.setIndex(a),r},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var e=this.reader.readData(this.zipCommentLength),t=Yh.uint8array?"uint8array":"array",a=Gh.transformTo(t,e);this.zipComment=this.loadOptions.decodeFileName(a)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var e,t,a,r=this.zip64EndOfCentralSize-44;0<r;)e=this.reader.readInt(2),t=this.reader.readInt(4),a=this.reader.readData(t),this.zip64ExtensibleData[e]={id:e,length:t,value:a}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),this.disksCount>1)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var e,t;for(e=0;e<this.files.length;e++)t=this.files[e],this.reader.setIndex(t.localHeaderOffset),this.checkSignature(Wh.LOCAL_FILE_HEADER),t.readLocalPart(this.reader),t.handleUTF8(),t.processAttributes()},readCentralDir:function(){var e;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(Wh.CENTRAL_FILE_HEADER);)(e=new Qh({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(e);if(this.centralDirRecords!==this.files.length&&0!==this.centralDirRecords&&0===this.files.length)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var e=this.reader.lastIndexOfSignature(Wh.CENTRAL_DIRECTORY_END);if(e<0)throw!this.isSignature(0,Wh.LOCAL_FILE_HEADER)?new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html"):new Error("Corrupted zip: can't find end of central directory");this.reader.setIndex(e);var t=e;if(this.checkSignature(Wh.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===Gh.MAX_VALUE_16BITS||this.diskWithCentralDirStart===Gh.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===Gh.MAX_VALUE_16BITS||this.centralDirRecords===Gh.MAX_VALUE_16BITS||this.centralDirSize===Gh.MAX_VALUE_32BITS||this.centralDirOffset===Gh.MAX_VALUE_32BITS){if(this.zip64=!0,(e=this.reader.lastIndexOfSignature(Wh.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(e),this.checkSignature(Wh.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,Wh.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(Wh.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(Wh.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var a=this.centralDirOffset+this.centralDirSize;this.zip64&&(a+=20,a+=12+this.zip64EndOfCentralSize);var r=t-a;if(r>0)this.isSignature(t,Wh.CENTRAL_FILE_HEADER)||(this.reader.zero=r);else if(r<0)throw new Error("Corrupted zip: missing "+Math.abs(r)+" bytes.")},prepareReader:function(e){this.reader=Hh(e)},load:function(e){this.prepareReader(e),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}};var Xh=Zh,$h=js(),Jh=ws,ed=uo,td=Xh,ad=Xs,rd=ks;function id(e){return new Jh.Promise((function(t,a){var r=e.decompressed.getContentWorker().pipe(new ad);r.on("error",(function(e){a(e)})).on("end",(function(){r.streamInfo.crc32!==e.decompressed.crc32?a(new Error("Corrupted zip : CRC32 mismatch")):t()})).resume()}))}function nd(){if(!(this instanceof nd))return new nd;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var e=new nd;for(var t in this)"function"!=typeof this[t]&&(e[t]=this[t]);return e}}nd.prototype=dh,nd.prototype.loadAsync=function(e,t){var a=this;return t=$h.extend(t||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:ed.utf8decode}),rd.isNode&&rd.isStream(e)?Jh.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):$h.prepareContent("the loaded zip file",e,!0,t.optimizedBinaryString,t.base64).then((function(e){var a=new td(t);return a.load(e),a})).then((function(e){var a=[Jh.Promise.resolve(e)],r=e.files;if(t.checkCRC32)for(var i=0;i<r.length;i++)a.push(id(r[i]));return Jh.Promise.all(a)})).then((function(e){for(var r=e.shift(),i=r.files,n=0;n<i.length;n++){var o=i[n],s=o.fileNameStr,u=$h.resolve(o.fileNameStr);a.file(u,o.decompressed,{binary:!0,optimizedBinaryString:!0,date:o.date,dir:o.dir,comment:o.fileCommentStr.length?o.fileCommentStr:null,unixPermissions:o.unixPermissions,dosPermissions:o.dosPermissions,createFolders:t.createFolders}),o.dir||(a.file(u).unsafeOriginalName=s)}return r.zipComment.length&&(a.comment=r.zipComment),a}))},nd.support=lo,nd.defaults=Vs,nd.version="3.10.1",nd.loadAsync=function(e,t){return(new nd).loadAsync(e,t)},nd.external=ws;var od=nd;exports.CertApplyPlugin=class extends e.AbstractTaskPlugin{domains;email;dnsProviderType;dnsProviderAccess;renewDays;forceUpdate;csrInfo;acme;logger;userContext;accessService;http;lastStatus;cert;async onInstance(){this.accessService=this.ctx.accessService,this.logger=this.ctx.logger,this.userContext=this.ctx.userContext,this.http=this.ctx.http,this.lastStatus=this.ctx.lastStatus,this.acme=new b({userContext:this.userContext,logger:this.logger})}async execute(){const e=await this.condition();if(null!=e)return await this.output(e);const t=await this.doCertApply();if(null==t)throw new Error("申请证书失败");await this.output(t),this.clearLastStatus()}async output(e){const a=e.toCertInfo();this.cert=a;const r=t(e.detail.validity.notBefore).format("YYYYMMDD_HHmmss");await this.zipCert(a,r)}async zipCert(e,t){const a=new od;a.file("cert.crt",e.crt),a.file("cert.key",e.key);const r=`cert_${this.domains[0].replace(".","_").replace("*","_")}_${t}.zip`,i=await a.generateAsync({type:"nodebuffer"});this.saveFile(r,i),this.logger.info(`已保存文件:${r}`)}async condition(){if(this.forceUpdate)return null;let e=!1;let a;JSON.stringify(this.lastStatus?.input?.domains)!==JSON.stringify(this.domains)&&(e=!0);try{a=await this.readLastCert()}catch(e){this.logger.warn("读取cert失败:",e)}if(null==a)return this.logger.info("还未申请过,准备申请新证书"),null;if(e)return this.logger.info("输入参数变更,申请新证书"),null;const r=this.isWillExpire(a.expires,this.renewDays);return r.isWillExpire?(this.logger.info("即将过期,开始更新证书"),null):(this.logger.info(`证书还未过期:过期时间${t(a.expires).format("YYYY-MM-DD HH:mm:ss")},剩余${r.leftDays}天`),a)}async doCertApply(){const t=this.email,a=this.domains,i=this.dnsProviderType,n=this.dnsProviderAccess,o=r.merge({country:"CN",state:"GuangDong",locality:"ShengZhen",organization:"CertD Org.",organizationUnit:"IT Department",emailAddress:t},this.csrInfo?JSON.parse(this.csrInfo):{});this.logger.info("开始申请证书,",t,a);const s=w.get(i),u=s.target,c=s.define,l=await this.accessService.getById(n),p=new u,h={access:l,logger:this.logger,http:this.http};e.Decorator.inject(c.autowire,p,h),p.setCtx(h),await p.onInstance();const d=await this.acme.order({email:t,domains:a,dnsProvider:p,csrInfo:o,isTest:!1}),m=this.formatCerts(d);return new io(m)}formatCert(e){return e=(e=(e=e.replace(/\r/g,"")).replace(/\n\n/g,"\n")).replace(/\n$/g,"")}formatCerts(e){return{crt:this.formatCert(e.crt),key:this.formatCert(e.key),csr:this.formatCert(e.csr)}}async readLastCert(){const e=this.lastStatus?.status?.output?.cert;if(null!=e)return new io(e)}isWillExpire(e,a=20){if(null==e)throw new Error("过期时间不能为空");const r=t(e).diff(t(),"day");return{isWillExpire:r<a,leftDays:r}}},f([e.TaskInput({title:"域名",component:{name:"a-select",vModel:"value",mode:"tags",open:!1},required:!0,col:{span:24},helper:"支持通配符域名,例如: *.foo.com、foo.com、*.test.handsfree.work\n支持多个域名、多个子域名、多个通配符域名打到一个证书上(域名必须是在同一个DNS提供商解析)\n多级子域名要分成多个域名输入(*.foo.com的证书不能用于xxx.yyy.foo.com、foo.com)\n输入一个回车之后,再输入下一个"})],exports.CertApplyPlugin.prototype,"domains",void 0),f([e.TaskInput({title:"邮箱",component:{name:"a-input",vModel:"value"},required:!0,helper:"请输入邮箱"})],exports.CertApplyPlugin.prototype,"email",void 0),f([e.TaskInput({title:"DNS提供商",component:{name:"pi-dns-provider-selector"},required:!0,helper:"请选择dns解析提供商"})],exports.CertApplyPlugin.prototype,"dnsProviderType",void 0),f([e.TaskInput({title:"DNS解析授权",component:{name:"pi-access-selector"},required:!0,helper:"请选择dns解析提供商授权",reference:[{src:"form.dnsProviderType",dest:"component.type",type:"computed"}]})],exports.CertApplyPlugin.prototype,"dnsProviderAccess",void 0),f([e.TaskInput({title:"更新天数",component:{name:"a-input-number",vModel:"value"},required:!0,helper:"到期前多少天后更新证书"})],exports.CertApplyPlugin.prototype,"renewDays",void 0),f([e.TaskInput({title:"强制更新",component:{name:"a-switch",vModel:"checked"},helper:"是否强制重新申请证书"})],exports.CertApplyPlugin.prototype,"forceUpdate",void 0),f([e.TaskInput({title:"CsrInfo"})],exports.CertApplyPlugin.prototype,"csrInfo",void 0),f([e.TaskOutput({title:"域名证书"})],exports.CertApplyPlugin.prototype,"cert",void 0),exports.CertApplyPlugin=f([e.IsTaskPlugin({name:"CertApply",title:"证书申请",desc:"免费通配符域名证书申请,支持多个域名打到同一个证书上",default:{input:{renewDays:20,forceUpdate:!1},strategy:{runStrategy:e.RunStrategy.AlwaysRun}}})],exports.CertApplyPlugin),new exports.CertApplyPlugin,exports.AbstractDnsProvider=class{ctx;setCtx(e){this.ctx=e}},exports.CertReader=io,exports.DNS_PROVIDER_CLASS_KEY=j,exports.IsDnsProvider=function(t){return a=>{a=e.Decorator.target(a);const i={},n=e.Decorator.getClassProperties(a);for(const t in n){const r=Reflect.getMetadata(e.AUTOWIRE_KEY,a,t);r&&(i[t]=r)}r.merge(t,{autowire:i}),Reflect.defineMetadata(j,t,a),a.define=t,w.register(t.name,{define:t,target:a})}},exports.dnsProviderRegistry=w;