/**
 * CyberChef - The Cyber Swiss Army Knife
 *
 * @copyright Crown Copyright 2016
 * @license Apache-2.0
 *
 *   Copyright 2016 Crown Copyright
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */!function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=1400)}({0:function(e,t,r){"use strict";(function(e,n){r.d(t,"c",(function(){return v})),r.d(t,"d",(function(){return C})),r.d(t,"e",(function(){return E})),r.d(t,"a",(function(){return S}));var i=r(6),a=r.n(i),o=r(1),s=r.n(o),u=r(2),c=r.n(u),l=r(23),f=r.n(l),p=r(15),h=r(16),d=r(28),g=r(27),y=function(){function t(){s()(this,t)}return c()(t,null,[{key:"chr",value:function(e){if(e>65535){e-=65536;var t=String.fromCharCode(e>>>10&1023|55296);return e=56320|1023&e,t+String.fromCharCode(e)}return String.fromCharCode(e)}},{key:"ord",value:function(e){if(2===e.length){var t=e.charCodeAt(0),r=e.charCodeAt(1);if(t>=55296&&t<56320&&r>=56320&&r<57344)return 1024*(t-55296)+r-56320+65536}return e.charCodeAt(0)}},{key:"padBytesRight",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=new Array(t);return n.fill(r),[...e].forEach((function(e,t){n[t]=e})),n}},{key:"truncate",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"...";return e.length>t&&(e=e.slice(0,t-r.length)+r),e}},{key:"hex",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return(e="string"==typeof e?t.ord(e):e).toString(16).padStart(r,"0")}},{key:"bin",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8;return(e="string"==typeof e?t.ord(e):e).toString(2).padStart(r,"0")}},{key:"printable",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];m()&&window.app&&!window.app.options.treatAsUtf8&&(e=t.byteArrayToChars(t.strToByteArray(e)));var n=/[\0-\x08\x0B-\x0C\x0E-\x1F\x7F-\x9F\xAD\u0378\u0379\u037F-\u0383\u038B\u038D\u03A2\u0528-\u0530\u0557\u0558\u0560\u0588\u058B-\u058E\u0590\u05C8-\u05CF\u05EB-\u05EF\u05F5-\u0605\u061C\u061D\u06DD\u070E\u070F\u074B\u074C\u07B2-\u07BF\u07FB-\u07FF\u082E\u082F\u083F\u085C\u085D\u085F-\u089F\u08A1\u08AD-\u08E3\u08FF\u0978\u0980\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09FC-\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A76-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF2-\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B55\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B78-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BFB-\u0C00\u0C04\u0C0D\u0C11\u0C29\u0C34\u0C3A-\u0C3C\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5A-\u0C5F\u0C64\u0C65\u0C70-\u0C77\u0C80\u0C81\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDD\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0D01\u0D04\u0D0D\u0D11\u0D3B\u0D3C\u0D45\u0D49\u0D4F-\u0D56\u0D58-\u0D5F\u0D64\u0D65\u0D76-\u0D78\u0D80\u0D81\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DF1\u0DF5-\u0E00\u0E3B-\u0E3E\u0E5C-\u0E80\u0E83\u0E85\u0E86\u0E89\u0E8B\u0E8C\u0E8E-\u0E93\u0E98\u0EA0\u0EA4\u0EA6\u0EA8\u0EA9\u0EAC\u0EBA\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F48\u0F6D-\u0F70\u0F98\u0FBD\u0FCD\u0FDB-\u0FFF\u10C6\u10C8-\u10CC\u10CE\u10CF\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u137D-\u137F\u139A-\u139F\u13F5-\u13FF\u169D-\u169F\u16F1-\u16FF\u170D\u1715-\u171F\u1737-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17DE\u17DF\u17EA-\u17EF\u17FA-\u17FF\u180F\u181A-\u181F\u1878-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191D-\u191F\u192C-\u192F\u193C-\u193F\u1941-\u1943\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DB-\u19DD\u1A1C\u1A1D\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1A9F\u1AAE-\u1AFF\u1B4C-\u1B4F\u1B7D-\u1B7F\u1BF4-\u1BFB\u1C38-\u1C3A\u1C4A-\u1C4C\u1C80-\u1CBF\u1CC8-\u1CCF\u1CF7-\u1CFF\u1DE7-\u1DFB\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FC5\u1FD4\u1FD5\u1FDC\u1FF0\u1FF1\u1FF5\u1FFF\u200B-\u200F\u202A-\u202E\u2060-\u206F\u2072\u2073\u208F\u209D-\u209F\u20BB-\u20CF\u20F1-\u20FF\u218A-\u218F\u23F4-\u23FF\u2427-\u243F\u244B-\u245F\u2700\u2B4D-\u2B4F\u2B5A-\u2BFF\u2C2F\u2C5F\u2CF4-\u2CF8\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D71-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E3C-\u2E7F\u2E9A\u2EF4-\u2EFF\u2FD6-\u2FEF\u2FFC-\u2FFF\u3040\u3097\u3098\u3100-\u3104\u312E-\u3130\u318F\u31BB-\u31BF\u31E4-\u31EF\u321F\u32FF\u4DB6-\u4DBF\u9FCD-\u9FFF\uA48D-\uA48F\uA4C7-\uA4CF\uA62C-\uA63F\uA698-\uA69E\uA6F8-\uA6FF\uA78F\uA794-\uA79F\uA7AB-\uA7F7\uA82C-\uA82F\uA83A-\uA83F\uA878-\uA87F\uA8C5-\uA8CD\uA8DA-\uA8DF\uA8FC-\uA8FF\uA954-\uA95E\uA97D-\uA97F\uA9CE\uA9DA-\uA9DD\uA9E0-\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A\uAA5B\uAA7C-\uAA7F\uAAC3-\uAADA\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F-\uABBF\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uD7FF\uE000-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBC2-\uFBD2\uFD40-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFE\uFDFF\uFE1A-\uFE1F\uFE27-\uFE2F\uFE53\uFE67\uFE6C-\uFE6F\uFE75\uFEFD-\uFF00\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFDF\uFFE7\uFFEF-\uFFFB\uFFFE\uFFFF]/g,i=/[\x09-\x10\x0D\u2028\u2029]/g;return e=e.replace(n,"."),r||(e=e.replace(i,".")),e}},{key:"parseEscapedChars",value:function(e){return e.replace(/\\([bfnrtv'"]|[0-3][0-7]{2}|[0-7]{1,2}|x[\da-fA-F]{2}|u[\da-fA-F]{4}|u\{[\da-fA-F]{1,6}\}|\\)/g,(function(e,t){switch(t[0]){case"\\":return"\\";case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":return String.fromCharCode(parseInt(t,8));case"b":return"\b";case"t":return"\t";case"n":return"\n";case"v":return"\v";case"f":return"\f";case"r":return"\r";case'"':return'"';case"'":return"'";case"x":return String.fromCharCode(parseInt(t.substr(1),16));case"u":return"{"===t[1]?String.fromCodePoint(parseInt(t.slice(2,-1),16)):String.fromCharCode(parseInt(t.substr(1),16))}}))}},{key:"escapeRegex",value:function(e){return e.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")}},{key:"expandAlphRange",value:function(e){for(var r=[],n=0;n<e.length;n++)if(n<e.length-2&&"-"===e[n+1]&&"\\"!==e[n]){for(var i=t.ord(e[n]),a=t.ord(e[n+2]),o=i;o<=a;o++)r.push(t.chr(o));n+=2}else n<e.length-2&&"\\"===e[n]&&"-"===e[n+1]?(r.push("-"),n++):r.push(e[n]);return r}},{key:"convertToByteArray",value:function(e,r){switch(r.toLowerCase()){case"binary":return Object(g.a)(e);case"hex":return Object(h.a)(e);case"decimal":return Object(d.a)(e);case"base64":return Object(p.a)(e,null,"byteArray");case"utf8":return t.strToUtf8ByteArray(e);case"latin1":default:return t.strToByteArray(e)}}},{key:"convertToByteString",value:function(e,r){switch(r.toLowerCase()){case"binary":return t.byteArrayToChars(Object(g.a)(e));case"hex":return t.byteArrayToChars(Object(h.a)(e));case"decimal":return t.byteArrayToChars(Object(d.a)(e));case"base64":return t.byteArrayToChars(Object(p.a)(e,null,"byteArray"));case"utf8":return f.a.encode(e);case"latin1":default:return e}}},{key:"strToArrayBuffer",value:function(e){for(var r,n=new Uint8Array(e.length),i=e.length;i--;)if(r=e.charCodeAt(i),n[i]=r,r>255)return t.strToUtf8ArrayBuffer(e);return n.buffer}},{key:"strToUtf8ArrayBuffer",value:function(e){var r=f.a.encode(e);return e.length!==r.length&&(C()?self.setOption("attemptHighlight",!1):m()&&(window.app.options.attemptHighlight=!1)),t.strToArrayBuffer(r)}},{key:"strToByteArray",value:function(e){for(var r,n=new Array(e.length),i=e.length;i--;)if(r=e.charCodeAt(i),n[i]=r,r>255)return t.strToUtf8ByteArray(e);return n}},{key:"strToUtf8ByteArray",value:function(e){var r=f.a.encode(e);return e.length!==r.length&&(C()?self.setOption("attemptHighlight",!1):m()&&(window.app.options.attemptHighlight=!1)),t.strToByteArray(r)}},{key:"strToCharcode",value:function(e){for(var r=[],n=0;n<e.length;n++){var i=e.charCodeAt(n);if(n<e.length-1&&i>=55296&&i<56320){var a=e[n+1].charCodeAt(0);a>=56320&&a<57344&&(i=t.ord(e[n]+e[++n]))}r.push(i)}return r}},{key:"byteArrayToUtf8",value:function(e){var r=t.byteArrayToChars(e);try{var n=f.a.decode(r);return r.length!==n.length&&(C()?self.setOption("attemptHighlight",!1):m()&&(window.app.options.attemptHighlight=!1)),n}catch(e){return r}}},{key:"byteArrayToChars",value:function(e){if(!e)return"";for(var t="",r=0;r<e.length;)t+=String.fromCharCode(e[r++]);return t}},{key:"arrayBufferToStr",value:function(e){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=new Uint8Array(e);return r?t.byteArrayToUtf8(n):t.byteArrayToChars(n)}},{key:"calculateShannonEntropy",value:function(e){e instanceof ArrayBuffer&&(e=new Uint8Array(e));var t,r=[],n=new Array(256).fill(0);for(t=0;t<e.length;t++)n[e[t]]++;for(t=0;t<n.length;t++)n[t]>0&&r.push(n[t]/e.length);var i,a=0;for(t=0;t<r.length;t++)a+=(i=r[t])*Math.log(i)/Math.log(2);return-a}},{key:"parseCSV",value:function(e){var t,r,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[","],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:["\n","\r"],a=!1,o=!1,s="",u=[],c=[];e.length&&"\ufeff"===e[0]&&(e=e.substr(1));for(var l=0;l<e.length;l++)t=e[l],r=e[l+1]||"",a?(s+=t,a=!1):'"'!==t||o?'"'===t&&o?'"'===r?a=!0:o=!1:!o&&n.indexOf(t)>=0?(u.push(s),s=""):!o&&i.indexOf(t)>=0?(u.push(s),s="",c.push(u),u=[],i.indexOf(r)>=0&&r!==t&&l++):s+=t:o=!0;return u.length&&(u.push(s),c.push(u)),c}},{key:"stripHtmlTags",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return t&&(e=e.replace(/<(script|style)[^>]*>.*<\/(script|style)>/gim,"")),e.replace(/<[^>]+>/g,"")}},{key:"escapeHtml",value:function(e){var t={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","/":"&#x2F;","`":"&#x60;"};return e.replace(/[&<>"'/`]/g,(function(e){return t[e]}))}},{key:"unescapeHtml",value:function(e){var t={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#x27;":"'","&#x2F;":"/","&#x60;":"`"};return e.replace(/&#?x?[a-z0-9]{2,4};/gi,(function(e){return t[e]||e}))}},{key:"encodeURIFragment",value:function(e){var t={"%2D":"-","%2E":".","%5F":"_","%7E":"~","%21":"!","%24":"$","%27":"'","%28":"(","%29":")","%2A":"*","%2C":",","%3B":";","%3A":":","%40":"@","%2F":"/","%3F":"?"};return(e=encodeURIComponent(e)).replace(/%[0-9A-F]{2}/g,(function(e){return t[e]||e}))}},{key:"generatePrettyRecipe",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r="",n="",i="",a="",o="";return e.forEach((function(e){n=e.op.replace(/ /g,"_"),i=JSON.stringify(e.args).slice(1,-1).replace(/'/g,"\\'").replace(/"((?:[^"\\]|\\.)*)"/g,"'$1'").replace(/\\"/g,'"'),a=e.disabled?"/disabled":"",o=e.breakpoint?"/breakpoint":"",r+=`${n}(${i}${a}${o})`,t&&(r+="\n")})),r}},{key:"parseRecipeConfig",value:function(e){if(0===(e=e.trim()).length)return[];if("["===e[0])return JSON.parse(e);var t,r;e=e.replace(/\n/g,"");for(var n=/([^(]+)\(((?:'[^'\\]*(?:\\.[^'\\]*)*'|[^)/'])*)(\/[^)]+)?\)/g,i=[];t=n.exec(e);){r="["+(r=t[2].replace(/"/g,'\\"').replace(/(^|,|{|:)'/g,'$1"').replace(/([^\\]|(?:\\\\)+)'(,|:|}|$)/g,'$1"$2').replace(/\\'/g,"'"))+"]";var a={op:t[1].replace(/_/g," "),args:JSON.parse(r)};t[3]&&t[3].indexOf("disabled")>0&&(a.disabled=!0),t[3]&&t[3].indexOf("breakpoint")>0&&(a.breakpoint=!0),i.push(a)}return i}},{key:"displayFilesAsHTML",value:function(e){var r,n,i,o,s;return a.a.async((function(u){for(;;)switch(u.prev=u.next){case 0:r=function(e){return`<div class='card' style='white-space: normal;'>\n                    <div class='card-header'>\n                        <h6 class="mb-0">\n                            ${t.escapeHtml(e.name)}\n                        </h6>\n                    </div>\n                </div>`},n=function(e,r){if(r.startsWith("image")){var n="data:";return n+=r+";","<img style='max-width: 100%;' src='"+(n+="base64,"+Object(p.b)(e))+"'>"}return`<pre>${t.escapeHtml(t.arrayBufferToStr(e.buffer))}</pre>`},i=function(e,r){var i,o,s,u;return a.a.async((function(c){for(;;)switch(c.prev=c.next){case 0:return c.next=2,a.a.awrap(t.readFile(e));case 2:return i=c.sent,o=new Blob([i],{type:e.type||"octet/stream"}),s=URL.createObjectURL(o),u=`<div class='card' style='white-space: normal;'>\n                    <div class='card-header' id='heading${r}'>\n                        <h6 class='mb-0'>\n                            <a class='collapsed'\n                                data-toggle='collapse'\n                                href='#collapse${r}'\n                                aria-expanded='false'\n                                aria-controls='collapse${r}'\n                                title="Show/hide contents of '${t.escapeHtml(e.name)}'">\n                                ${t.escapeHtml(e.name)}</a>\n                            <span class='float-right' style="margin-top: -3px">\n                                ${e.size.toLocaleString()} bytes\n                                <a title="Download ${t.escapeHtml(e.name)}"\n                                    href="${s}"\n                                    download="${t.escapeHtml(e.name)}"\n                                    data-toggle="tooltip">\n                                    <i class="material-icons" style="vertical-align: bottom">save</i>\n                                </a>\n                                <a title="Move to input"\n                                    href="#"\n                                    blob-url="${s}"\n                                    file-name="${t.escapeHtml(e.name)}"\n                                    class="extract-file"\n                                    data-toggle="tooltip">\n                                    <i class="material-icons" style="vertical-align: bottom">open_in_browser</i>\n                                </a>\n                            </span>\n                        </h6>\n                    </div>\n                    <div id='collapse${r}' class='collapse' aria-labelledby='heading${r}' data-parent="#files">\n                        <div class='card-body'>\n                            ${n(i,e.type)}\n                        </div>\n                    </div>\n                </div>`,c.abrupt("return",u);case 7:case"end":return c.stop()}}))},o=`<div style='padding: 5px; white-space: normal;'>\n                ${e.length} file(s) found\n            </div><div id="files" style="padding: 20px">`,s=0;case 5:if(!(s<e.length)){u.next=17;break}if(!e[s].name.endsWith("/")){u.next=10;break}o+=r(e[s]),u.next=14;break;case 10:return u.t0=o,u.next=13,a.a.awrap(i(e[s],s));case 13:o=u.t0+=u.sent;case 14:s++,u.next=5;break;case 17:return u.abrupt("return",o+="</div>");case 18:case"end":return u.stop()}}))}},{key:"parseURIParams",value:function(e){if(""===e)return{};"?"!==e[0]&&"#"!==e[0]||(e=e.substr(1));for(var t=e.split("&"),r={},n=0;n<t.length;n++){var i=t[n].split("=");2!==i.length?r[t[n]]=!0:r[i[0]]=decodeURIComponent(i[1].replace(/\+/g," "))}return r}},{key:"readFile",value:function(t){return v()?e.from(t).buffer:new Promise((function(e,r){var n=new FileReader,i=new Uint8Array(t.size),a=0,o=function(){if(a>=t.size)e(i);else{var r=t.slice(a,a+10485760);n.readAsArrayBuffer(r)}};n.onload=function(e){i.set(new Uint8Array(n.result),a),a+=10485760,o()},n.onerror=function(e){r(n.error.message)},o()}))}},{key:"readFileSync",value:function(e){if(!v())throw new TypeError("Browser environment cannot support readFileSync");return Uint8Array.from(e.data).buffer}},{key:"mod",value:function(e,t){return(e%t+t)%t}},{key:"gcd",value:function(e,r){return r?t.gcd(r,e%r):e}},{key:"modInv",value:function(e,t){e%=t;for(var r=1;r<t;r++)if(e*r%26==1)return r}},{key:"charRep",value:function(e){return{Space:" ",Percent:"%",Comma:",","Semi-colon":";",Colon:":",Tab:"\t","Line feed":"\n",CRLF:"\r\n","Forward slash":"/",Backslash:"\\","0x":"0x","\\x":"\\x","Nothing (separate chars)":"",None:""}[e]}},{key:"regexRep",value:function(e){return{Space:/\s+/g,Percent:/%/g,Comma:/,/g,"Semi-colon":/;/g,Colon:/:/g,"Line feed":/\n/g,CRLF:/\r\n/g,"Forward slash":/\//g,Backslash:/\\/g,"0x":/0x/g,"\\x":/\\x/g,None:/\s+/g}[e]}}]),t}();function v(){return void 0!==n&&null!=n.versions&&null!=n.versions.node}function m(){return"object"==typeof window}function C(){return"function"==typeof importScripts}function E(e){C()?self.sendStatusMessage(e):m()?app.alert(e,1e4):v()&&console.debug(e)}t.b=y,Array.prototype.unique=function(){for(var e={},t=[],r=0,n=this.length;r<n;r++)Object.prototype.hasOwnProperty.call(e,this[r])||(t.push(this[r]),e[this[r]]=1);return t},Array.prototype.max=function(){return Math.max.apply(null,this)},Array.prototype.min=function(){return Math.min.apply(null,this)},Array.prototype.sum=function(){return this.reduce((function(e,t){return e+t}),0)},Array.prototype.equals=function(e){if(!e)return!1;var t=this.length;if(t!==e.length)return!1;for(;t--;)if(this[t]!==e[t])return!1;return!0},String.prototype.count=function(e){return this.split(e).length-1};var b={};function S(e,t,r,n,i){return function(){clearTimeout(b[r]),b[r]=setTimeout((function(){e.apply(n,i)}),t)}}String.prototype.padStart||(String.prototype.padStart=function(e,t){return e>>=0,t=String(void 0!==t?t:" "),this.length>e?String(this):((e-=this.length)>t.length&&(t+=t.repeat(e/t.length)),t.slice(0,e)+String(this))}),String.prototype.padEnd||(String.prototype.padEnd=function(e,t){return e>>=0,t=String(void 0!==t?t:" "),this.length>e?String(this):((e-=this.length)>t.length&&(t+=t.repeat(e/t.length)),String(this)+t.slice(0,e))})}).call(this,r(11).Buffer,r(25))},1:function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},11:function(e,t,r){"use strict";(function(e){
/*!
 * The buffer module from node.js, for the browser.
 *
 * @author   Feross Aboukhadijeh <http://feross.org>
 * @license  MIT
 */
var n=r(40),i=r(41),a=r(42);function o(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(o()<t)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=u.prototype:(null===e&&(e=new u(t)),e.length=t),e}function u(e,t,r){if(!(u.TYPED_ARRAY_SUPPORT||this instanceof u))return new u(e,t,r);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return f(this,e)}return c(this,e,t,r)}function c(e,t,r,n){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,r,n){if(t.byteLength,r<0||t.byteLength<r)throw new RangeError("'offset' is out of bounds");if(t.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");t=void 0===r&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,r):new Uint8Array(t,r,n);u.TYPED_ARRAY_SUPPORT?(e=t).__proto__=u.prototype:e=p(e,t);return e}(e,t,r,n):"string"==typeof t?function(e,t,r){"string"==typeof r&&""!==r||(r="utf8");if(!u.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|d(t,r),i=(e=s(e,n)).write(t,r);i!==n&&(e=e.slice(0,i));return e}(e,t,r):function(e,t){if(u.isBuffer(t)){var r=0|h(t.length);return 0===(e=s(e,r)).length?e:(t.copy(e,0,0,r),e)}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(n=t.length)!=n?s(e,0):p(e,t);if("Buffer"===t.type&&a(t.data))return p(e,t.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function l(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function f(e,t){if(l(t),e=s(e,t<0?0:0|h(t)),!u.TYPED_ARRAY_SUPPORT)for(var r=0;r<t;++r)e[r]=0;return e}function p(e,t){var r=t.length<0?0:0|h(t.length);e=s(e,r);for(var n=0;n<r;n+=1)e[n]=255&t[n];return e}function h(e){if(e>=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|e}function d(e,t){if(u.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return K(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return H(e).length;default:if(n)return K(e).length;t=(""+t).toLowerCase(),n=!0}}function g(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return R(this,t,r);case"utf8":case"utf-8":return w(this,t,r);case"ascii":return k(this,t,r);case"latin1":case"binary":return _(this,t,r);case"base64":return T(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function y(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function v(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=u.from(t,n)),u.isBuffer(t))return 0===t.length?-1:m(e,t,r,n,i);if("number"==typeof t)return t&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):m(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function m(e,t,r,n,i){var a,o=1,s=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;o=2,s/=2,u/=2,r/=2}function c(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(i){var l=-1;for(a=r;a<s;a++)if(c(e,a)===c(t,-1===l?0:a-l)){if(-1===l&&(l=a),a-l+1===u)return l*o}else-1!==l&&(a-=a-l),l=-1}else for(r+u>s&&(r=s-u),a=r;a>=0;a--){for(var f=!0,p=0;p<u;p++)if(c(e,a+p)!==c(t,p)){f=!1;break}if(f)return a}return-1}function C(e,t,r,n){r=Number(r)||0;var i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;var a=t.length;if(a%2!=0)throw new TypeError("Invalid hex string");n>a/2&&(n=a/2);for(var o=0;o<n;++o){var s=parseInt(t.substr(2*o,2),16);if(isNaN(s))return o;e[r+o]=s}return o}function E(e,t,r,n){return j(K(t,e.length-r),e,r,n)}function b(e,t,r,n){return j(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function S(e,t,r,n){return b(e,t,r,n)}function B(e,t,r,n){return j(H(t),e,r,n)}function A(e,t,r,n){return j(function(e,t){for(var r,n,i,a=[],o=0;o<e.length&&!((t-=2)<0);++o)r=e.charCodeAt(o),n=r>>8,i=r%256,a.push(i),a.push(n);return a}(t,e.length-r),e,r,n)}function T(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function w(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i<r;){var a,o,s,u,c=e[i],l=null,f=c>239?4:c>223?3:c>191?2:1;if(i+f<=r)switch(f){case 1:c<128&&(l=c);break;case 2:128==(192&(a=e[i+1]))&&(u=(31&c)<<6|63&a)>127&&(l=u);break;case 3:a=e[i+1],o=e[i+2],128==(192&a)&&128==(192&o)&&(u=(15&c)<<12|(63&a)<<6|63&o)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:a=e[i+1],o=e[i+2],s=e[i+3],128==(192&a)&&128==(192&o)&&128==(192&s)&&(u=(15&c)<<18|(63&a)<<12|(63&o)<<6|63&s)>65535&&u<1114112&&(l=u)}null===l?(l=65533,f=1):l>65535&&(l-=65536,n.push(l>>>10&1023|55296),l=56320|1023&l),n.push(l),i+=f}return function(e){var t=e.length;if(t<=I)return String.fromCharCode.apply(String,e);var r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=I));return r}(n)}t.Buffer=u,t.SlowBuffer=function(e){+e!=e&&(e=0);return u.alloc(+e)},t.INSPECT_MAX_BYTES=50,u.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),t.kMaxLength=o(),u.poolSize=8192,u._augment=function(e){return e.__proto__=u.prototype,e},u.from=function(e,t,r){return c(null,e,t,r)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0})),u.alloc=function(e,t,r){return function(e,t,r,n){return l(t),t<=0?s(e,t):void 0!==r?"string"==typeof n?s(e,t).fill(r,n):s(e,t).fill(r):s(e,t)}(null,e,t,r)},u.allocUnsafe=function(e){return f(null,e)},u.allocUnsafeSlow=function(e){return f(null,e)},u.isBuffer=function(e){return!(null==e||!e._isBuffer)},u.compare=function(e,t){if(!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var r=e.length,n=t.length,i=0,a=Math.min(r,n);i<a;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},u.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(e,t){if(!a(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return u.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var n=u.allocUnsafe(t),i=0;for(r=0;r<e.length;++r){var o=e[r];if(!u.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,i),i+=o.length}return n},u.byteLength=d,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)y(this,t,t+1);return this},u.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)y(this,t,t+3),y(this,t+1,t+2);return this},u.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)y(this,t,t+7),y(this,t+1,t+6),y(this,t+2,t+5),y(this,t+3,t+4);return this},u.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?w(this,0,e):g.apply(this,arguments)},u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){var e="",r=t.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(e+=" ... ")),"<Buffer "+e+">"},u.prototype.compare=function(e,t,r,n,i){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;for(var a=(i>>>=0)-(n>>>=0),o=(r>>>=0)-(t>>>=0),s=Math.min(a,o),c=this.slice(n,i),l=e.slice(t,r),f=0;f<s;++f)if(c[f]!==l[f]){a=c[f],o=l[f];break}return a<o?-1:o<a?1:0},u.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},u.prototype.indexOf=function(e,t,r){return v(this,e,t,r,!0)},u.prototype.lastIndexOf=function(e,t,r){return v(this,e,t,r,!1)},u.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var a=!1;;)switch(n){case"hex":return C(this,e,t,r);case"utf8":case"utf-8":return E(this,e,t,r);case"ascii":return b(this,e,t,r);case"latin1":case"binary":return S(this,e,t,r);case"base64":return B(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,e,t,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var I=4096;function k(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function _(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function R(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var i="",a=t;a<r;++a)i+=M(e[a]);return i}function x(e,t,r){for(var n=e.slice(t,r),i="",a=0;a<n.length;a+=2)i+=String.fromCharCode(n[a]+256*n[a+1]);return i}function N(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function L(e,t,r,n,i,a){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<a)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function D(e,t,r,n){t<0&&(t=65535+t+1);for(var i=0,a=Math.min(e.length-r,2);i<a;++i)e[r+i]=(t&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function U(e,t,r,n){t<0&&(t=4294967295+t+1);for(var i=0,a=Math.min(e.length-r,4);i<a;++i)e[r+i]=t>>>8*(n?i:3-i)&255}function F(e,t,r,n,i,a){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function P(e,t,r,n,a){return a||F(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function O(e,t,r,n,a){return a||F(e,0,r,8),i.write(e,t,r,n,52,8),r+8}u.prototype.slice=function(e,t){var r,n=this.length;if((e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e),u.TYPED_ARRAY_SUPPORT)(r=this.subarray(e,t)).__proto__=u.prototype;else{var i=t-e;r=new u(i,void 0);for(var a=0;a<i;++a)r[a]=this[a+e]}return r},u.prototype.readUIntLE=function(e,t,r){e|=0,t|=0,r||N(e,t,this.length);for(var n=this[e],i=1,a=0;++a<t&&(i*=256);)n+=this[e+a]*i;return n},u.prototype.readUIntBE=function(e,t,r){e|=0,t|=0,r||N(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},u.prototype.readUInt8=function(e,t){return t||N(e,1,this.length),this[e]},u.prototype.readUInt16LE=function(e,t){return t||N(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUInt16BE=function(e,t){return t||N(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUInt32LE=function(e,t){return t||N(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUInt32BE=function(e,t){return t||N(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||N(e,t,this.length);for(var n=this[e],i=1,a=0;++a<t&&(i*=256);)n+=this[e+a]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*t)),n},u.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||N(e,t,this.length);for(var n=t,i=1,a=this[e+--n];n>0&&(i*=256);)a+=this[e+--n]*i;return a>=(i*=128)&&(a-=Math.pow(2,8*t)),a},u.prototype.readInt8=function(e,t){return t||N(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){t||N(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(e,t){t||N(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(e,t){return t||N(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return t||N(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,t){return t||N(e,4,this.length),i.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return t||N(e,4,this.length),i.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return t||N(e,8,this.length),i.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return t||N(e,8,this.length),i.read(this,e,!1,52,8)},u.prototype.writeUIntLE=function(e,t,r,n){(e=+e,t|=0,r|=0,n)||L(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,a=0;for(this[t]=255&e;++a<r&&(i*=256);)this[t+a]=e/i&255;return t+r},u.prototype.writeUIntBE=function(e,t,r,n){(e=+e,t|=0,r|=0,n)||L(this,e,t,r,Math.pow(2,8*r)-1,0);var i=r-1,a=1;for(this[t+i]=255&e;--i>=0&&(a*=256);)this[t+i]=e/a&255;return t+r},u.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||L(this,e,t,1,255,0),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},u.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||L(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):D(this,e,t,!0),t+2},u.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||L(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):D(this,e,t,!1),t+2},u.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||L(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):U(this,e,t,!0),t+4},u.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||L(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):U(this,e,t,!1),t+4},u.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);L(this,e,t,r,i-1,-i)}var a=0,o=1,s=0;for(this[t]=255&e;++a<r&&(o*=256);)e<0&&0===s&&0!==this[t+a-1]&&(s=1),this[t+a]=(e/o>>0)-s&255;return t+r},u.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);L(this,e,t,r,i-1,-i)}var a=r-1,o=1,s=0;for(this[t+a]=255&e;--a>=0&&(o*=256);)e<0&&0===s&&0!==this[t+a+1]&&(s=1),this[t+a]=(e/o>>0)-s&255;return t+r},u.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||L(this,e,t,1,127,-128),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||L(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):D(this,e,t,!0),t+2},u.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||L(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):D(this,e,t,!1),t+2},u.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||L(this,e,t,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):U(this,e,t,!0),t+4},u.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||L(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):U(this,e,t,!1),t+4},u.prototype.writeFloatLE=function(e,t,r){return P(this,e,t,!0,r)},u.prototype.writeFloatBE=function(e,t,r){return P(this,e,t,!1,r)},u.prototype.writeDoubleLE=function(e,t,r){return O(this,e,t,!0,r)},u.prototype.writeDoubleBE=function(e,t,r){return O(this,e,t,!1,r)},u.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var i,a=n-r;if(this===e&&r<t&&t<n)for(i=a-1;i>=0;--i)e[i+t]=this[i+r];else if(a<1e3||!u.TYPED_ARRAY_SUPPORT)for(i=0;i<a;++i)e[i+t]=this[i+r];else Uint8Array.prototype.set.call(e,this.subarray(r,r+a),t);return a},u.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===e.length){var i=e.charCodeAt(0);i<256&&(e=i)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!u.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;var a;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(a=t;a<r;++a)this[a]=e;else{var o=u.isBuffer(e)?e:K(new u(e,n).toString()),s=o.length;for(a=0;a<r-t;++a)this[a+t]=o[a%s]}return this};var V=/[^+\/0-9A-Za-z-_]/g;function M(e){return e<16?"0"+e.toString(16):e.toString(16)}function K(e,t){var r;t=t||1/0;for(var n=e.length,i=null,a=[],o=0;o<n;++o){if((r=e.charCodeAt(o))>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(o+1===n){(t-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&a.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function H(e){return n.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(V,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function j(e,t,r,n){for(var i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}}).call(this,r(26))},12:function(e,t,r){var n=r(44),i=r(45),a=r(46);e.exports=function(e,t){return n(e)||i(e,t)||a()}},13:function(e,t,r){"use strict";var n=r(6),i=r.n(n),a=r(1),o=r.n(a),s=r(2),u=r.n(s),c=r(0),l=r(4),f=r.n(l),p=r(3),h=r.n(p),d=r(22),g=r.n(d),y=r(5),v=r.n(y);
/**
 * Custom error type for handling Dish type errors.
 * i.e. where the Dish cannot be successfully translated between types
 *
 * @author n1474335 [n1474335@gmail.com]
 * @copyright Crown Copyright 2018
 * @license Apache-2.0
 */
var m=function(e){function t(){var e;o()(this,t);for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return(e=f()(this,h()(t).call(this,...n))).type="DishError",Error.captureStackTrace&&Error.captureStackTrace(g()(e),t),e}return v()(t,e),t}(function(e){function t(){var t=Reflect.construct(e,Array.from(arguments));return Object.setPrototypeOf(t,Object.getPrototypeOf(this)),t}return t.prototype=Object.create(e.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e,t}(Error)),C=r(14),E=r.n(C),b=r(18),S=r(24),B=r.n(S),A=function(){function e(){o()(this,e)}return u()(e,null,[{key:"checkForValue",value:function(e){if(void 0===e)throw new Error("only use translation methods with .bind")}},{key:"toArrayBuffer",value:function(){throw new Error("toArrayBuffer has not been implemented")}},{key:"fromArrayBuffer",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];throw new Error("fromArrayBuffer has not been implemented")}}]),e}(),T=function(e){function t(){return o()(this,t),f()(this,h()(t).apply(this,arguments))}return v()(t,e),u()(t,null,[{key:"toArrayBuffer",value:function(){t.checkForValue(this.value),this.value=new Uint8Array(this.value).buffer}},{key:"fromArrayBuffer",value:function(){t.checkForValue(this.value),this.value=Array.prototype.slice.call(new Uint8Array(this.value))}}]),t}(A),w=function(e){function t(){return o()(this,t),f()(this,h()(t).apply(this,arguments))}return v()(t,e),u()(t,null,[{key:"toArrayBuffer",value:function(){t.checkForValue(this.value),this.value=E.a.isBigNumber(this.value)?c.b.strToArrayBuffer(this.value.toFixed()):new ArrayBuffer}},{key:"fromArrayBuffer",value:function(e){t.checkForValue(this.value);try{this.value=new E.a(c.b.arrayBufferToStr(this.value,!e))}catch(e){this.value=new E.a(NaN)}}}]),t}(A),I=function(e){function t(){return o()(this,t),f()(this,h()(t).apply(this,arguments))}return v()(t,e),u()(t,null,[{key:"toArrayBuffer",value:function(){var e=this;if(t.checkForValue(this.value),!Object(c.c)())return new Promise((function(t,r){c.b.readFile(e.value).then((function(t){return e.value=t.buffer})).then(t).catch(r)}));this.value=c.b.readFileSync(this.value)}},{key:"fromArrayBuffer",value:function(){t.checkForValue(this.value),this.value=new File(this.value,"unknown")}}]),t}(A),k=function(e){function t(){return o()(this,t),f()(this,h()(t).apply(this,arguments))}return v()(t,e),u()(t,null,[{key:"toArrayBuffer",value:function(){t.checkForValue(this.value),this.value=this.value?c.b.strToArrayBuffer(this.value):new ArrayBuffer}},{key:"fromArrayBuffer",value:function(e){t.checkForValue(this.value),this.value=this.value?c.b.arrayBufferToStr(this.value,!e):""}}]),t}(A),_=function(e){function t(){return o()(this,t),f()(this,h()(t).apply(this,arguments))}return v()(t,e),u()(t,null,[{key:"toArrayBuffer",value:function(){t.checkForValue(this.value),this.value=this.value?c.b.strToArrayBuffer(c.b.unescapeHtml(c.b.stripHtmlTags(this.value,!0))):new ArrayBuffer}}]),t}(k),R=function(e){function t(){return o()(this,t),f()(this,h()(t).apply(this,arguments))}return v()(t,e),u()(t,null,[{key:"toArrayBuffer",value:function(){t.checkForValue(this.value),this.value=this.value?c.b.strToArrayBuffer(JSON.stringify(this.value,null,4)):new ArrayBuffer}},{key:"fromArrayBuffer",value:function(e){t.checkForValue(this.value),this.value=JSON.parse(c.b.arrayBufferToStr(this.value,!e))}}]),t}(A),x=function(e){function t(){return o()(this,t),f()(this,h()(t).apply(this,arguments))}return v()(t,e),u()(t,null,[{key:"toArrayBuffer",value:function(){return i.a.async((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.checkForValue(this.value),!Object(c.c)()){e.next=5;break}this.value=this.value.map((function(e){return Uint8Array.from(e.data)})),e.next=8;break;case 5:return e.next=7,i.a.awrap(t.concatenateTypedArraysWithTypedElements(...this.value));case 7:this.value=e.sent;case 8:case"end":return e.stop()}}),null,this)}},{key:"fromArrayBuffer",value:function(){t.checkForValue(this.value),this.value=[new File(this.value,"unknown")]}},{key:"concatenateTypedArraysWithTypedElements",value:function(){var e,t,r,n,a,o,s,u,l,f,p,h,d,g=arguments;return i.a.async((function(y){for(;;)switch(y.prev=y.next){case 0:for(e=0,t=g.length,r=new Array(t),n=0;n<t;n++)r[n]=g[n];for(a=0,o=r;a<o.length;a++)s=o[a],e+=s.size;u=new Uint8Array(e),l=0,f=0,p=r;case 6:if(!(f<p.length)){y.next=16;break}return h=p[f],y.next=10,i.a.awrap(c.b.readFile(h));case 10:d=y.sent,u.set(d,l),l+=d.length;case 13:f++,y.next=6;break;case 16:return y.abrupt("return",u);case 17:case"end":return y.stop()}}))}},{key:"concatenateTypedArrays",value:function(){for(var e=0,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];for(var i=0,a=r;i<a.length;i++){var o=a[i];e+=o.length}for(var s=new Uint8Array(e),u=0,c=0,l=r;c<l.length;c++){var f=l[c];s.set(f,u),u+=f.length}return s}}]),t}(A),N=function(e){function t(){return o()(this,t),f()(this,h()(t).apply(this,arguments))}return v()(t,e),u()(t,null,[{key:"toArrayBuffer",value:function(){t.checkForValue(this.value),this.value="number"==typeof this.value?c.b.strToArrayBuffer(this.value.toString()):new ArrayBuffer}},{key:"fromArrayBuffer",value:function(e){t.checkForValue(this.value),this.value=this.value?parseFloat(c.b.arrayBufferToStr(this.value,!e)):0}}]),t}(A),L=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(o()(this,e),this.value=new ArrayBuffer(0),this.type=e.ARRAY_BUFFER,t&&Object.prototype.hasOwnProperty.call(t,"value")&&Object.prototype.hasOwnProperty.call(t,"type"))this.set(t.value,t.type);else if(t&&null!==r)this.set(t,r);else if(t){var n=e.typeEnum(t.constructor.name);this.set(t,n)}}return u()(e,[{key:"get",value:function(t){var r=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return"string"==typeof t&&(t=e.typeEnum(t)),this.type!==t?Object(c.c)()?(this._translate(t,n),this.value):new Promise((function(e,i){r._translate(t,n).then((function(){e(r.value)})).catch(i)})):this.value}},{key:"set",value:function(t,r){if("string"==typeof r&&(r=e.typeEnum(r)),B.a.debug("Dish type: "+e.enumLookup(r)),this.value=t,this.type=r,!this.valid()){var n=c.b.truncate(JSON.stringify(this.value),25);throw new m(`Data is not a valid ${e.enumLookup(r)}: ${n}`)}}},{key:"presentAs",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=this.clone();return r.get(e,t)}},{key:"detectDishType",value:function(){var e=new Uint8Array(this.value.slice(0,2048)),t=Object(b.a)(e);return t.length&&t[0].mime&&"text/plain"!==!t[0].mime?t[0].mime:null}},{key:"getTitle",value:function(t){var r,n;return i.a.async((function(a){for(;;)switch(a.prev=a.next){case 0:r="",a.t0=this.type,a.next=a.t0===e.FILE?4:a.t0===e.LIST_FILE?6:a.t0===e.JSON?8:a.t0===e.NUMBER?10:a.t0===e.BIG_NUMBER?10:a.t0===e.ARRAY_BUFFER?12:a.t0===e.BYTE_ARRAY?12:15;break;case 4:return r=this.value.name,a.abrupt("break",26);case 6:return r=`${this.value.length} file(s)`,a.abrupt("break",26);case 8:return r="application/json",a.abrupt("break",26);case 10:return r=this.value.toString(),a.abrupt("break",26);case 12:if(null===(r=this.detectDishType())){a.next=15;break}return a.abrupt("break",26);case 15:return a.prev=15,(n=this.clone()).value=n.value.slice(0,256),a.next=20,i.a.awrap(n.get(e.STRING));case 20:r=a.sent,a.next=26;break;case 23:a.prev=23,a.t1=a.catch(15),B.a.error(`${e.enumLookup(this.type)} cannot be sliced. ${a.t1}`);case 26:return a.abrupt("return",r.slice(0,t));case 27:case"end":return a.stop()}}),null,this,[[15,23]])}},{key:"valid",value:function(){switch(this.type){case e.BYTE_ARRAY:if(!(this.value instanceof Uint8Array||this.value instanceof Array))return!1;for(var t=0;t<this.value.length;t++)if("number"!=typeof this.value[t]||this.value[t]<0||this.value[t]>255)return!1;return!0;case e.STRING:case e.HTML:return"string"==typeof this.value;case e.NUMBER:return"number"==typeof this.value;case e.ARRAY_BUFFER:return this.value instanceof ArrayBuffer;case e.BIG_NUMBER:if(E.a.isBigNumber(this.value))return!0;if(Object.keys(this.value).sort().equals(["c","e","s"])){var r=new E.a;return r.c=this.value.c,r.e=this.value.e,r.s=this.value.s,this.value=r,!0}return!1;case e.JSON:return!0;case e.FILE:return this.value instanceof File;case e.LIST_FILE:return this.value instanceof Array&&this.value.reduce((function(e,t){return e&&t instanceof File}),!0);default:return!1}}},{key:"clone",value:function(){var t=new e;switch(this.type){case e.STRING:case e.HTML:case e.NUMBER:case e.BIG_NUMBER:t.set(this.value,this.type);break;case e.BYTE_ARRAY:case e.JSON:t.set(JSON.parse(JSON.stringify(this.value)),this.type);break;case e.ARRAY_BUFFER:t.set(this.value.slice(0),this.type);break;case e.FILE:t.set(new File([this.value],this.value.name,{type:this.value.type,lastModified:this.value.lastModified}),this.type);break;case e.LIST_FILE:t.set(this.value.map((function(e){return new File([e],e.name,{type:e.type,lastModified:e.lastModified})})),this.type);break;default:throw new m("Cannot clone Dish, unknown type")}return t}},{key:"_translate",value:function(t){var r=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(B.a.debug(`Translating Dish from ${e.enumLookup(this.type)} to ${e.enumLookup(t)}`),!Object(c.c)())return new Promise((function(n,i){r._toArrayBuffer().then((function(){return r.type=e.ARRAY_BUFFER})).then((function(){r._fromArrayBuffer(t),n()})).catch(i)}));this._toArrayBuffer(),this.type=e.ARRAY_BUFFER,this._fromArrayBuffer(t,n)}},{key:"_toArrayBuffer",value:function(){var t=this,r={browser:{[e.STRING]:function(){return Promise.resolve(k.toArrayBuffer.bind(t)())},[e.NUMBER]:function(){return Promise.resolve(N.toArrayBuffer.bind(t)())},[e.HTML]:function(){return Promise.resolve(_.toArrayBuffer.bind(t)())},[e.ARRAY_BUFFER]:function(){return Promise.resolve()},[e.BIG_NUMBER]:function(){return Promise.resolve(w.toArrayBuffer.bind(t)())},[e.JSON]:function(){return Promise.resolve(R.toArrayBuffer.bind(t)())},[e.FILE]:function(){return I.toArrayBuffer.bind(t)()},[e.LIST_FILE]:function(){return Promise.resolve(x.toArrayBuffer.bind(t)())},[e.BYTE_ARRAY]:function(){return Promise.resolve(T.toArrayBuffer.bind(t)())}},node:{[e.STRING]:function(){return k.toArrayBuffer.bind(t)()},[e.NUMBER]:function(){return N.toArrayBuffer.bind(t)()},[e.HTML]:function(){return _.toArrayBuffer.bind(t)()},[e.ARRAY_BUFFER]:function(){},[e.BIG_NUMBER]:function(){return w.toArrayBuffer.bind(t)()},[e.JSON]:function(){return R.toArrayBuffer.bind(t)()},[e.FILE]:function(){return I.toArrayBuffer.bind(t)()},[e.LIST_FILE]:function(){return x.toArrayBuffer.bind(t)()},[e.BYTE_ARRAY]:function(){return T.toArrayBuffer.bind(t)()}}};try{return r[Object(c.c)()?"node":"browser"][this.type]()}catch(t){throw new m(`Error translating from ${e.enumLookup(this.type)} to ArrayBuffer: ${t}`)}}},{key:"_fromArrayBuffer",value:function(t,r){var n=this,i={[e.STRING]:function(){return k.fromArrayBuffer.bind(n)(r)},[e.NUMBER]:function(){return N.fromArrayBuffer.bind(n)(r)},[e.HTML]:function(){return _.fromArrayBuffer.bind(n)(r)},[e.ARRAY_BUFFER]:function(){},[e.BIG_NUMBER]:function(){return w.fromArrayBuffer.bind(n)(r)},[e.JSON]:function(){return R.fromArrayBuffer.bind(n)(r)},[e.FILE]:function(){return I.fromArrayBuffer.bind(n)()},[e.LIST_FILE]:function(){return x.fromArrayBuffer.bind(n)()},[e.BYTE_ARRAY]:function(){return T.fromArrayBuffer.bind(n)()}};try{i[t](),this.type=t}catch(r){throw new m(`Error translating from ArrayBuffer to ${e.enumLookup(t)}: ${r}`)}}},{key:"size",get:function(){switch(this.type){case e.BYTE_ARRAY:case e.STRING:case e.HTML:return this.value.length;case e.NUMBER:case e.BIG_NUMBER:return this.value.toString().length;case e.ARRAY_BUFFER:return this.value.byteLength;case e.JSON:return JSON.stringify(this.value).length;case e.FILE:return this.value.size;case e.LIST_FILE:return this.value.reduce((function(e,t){return e+t.size}),0);default:return-1}}}],[{key:"typeEnum",value:function(t){switch(t.toLowerCase()){case"bytearray":case"byte array":return e.BYTE_ARRAY;case"string":return e.STRING;case"number":return e.NUMBER;case"html":return e.HTML;case"arraybuffer":case"array buffer":return e.ARRAY_BUFFER;case"bignumber":case"big number":return e.BIG_NUMBER;case"json":case"object":return e.JSON;case"file":return e.FILE;case"list<file>":return e.LIST_FILE;default:throw new m("Invalid data type string. No matching enum.")}}},{key:"enumLookup",value:function(t){switch(t){case e.BYTE_ARRAY:return"byteArray";case e.STRING:return"string";case e.NUMBER:return"number";case e.HTML:return"html";case e.ARRAY_BUFFER:return"ArrayBuffer";case e.BIG_NUMBER:return"BigNumber";case e.JSON:return"JSON";case e.FILE:return"File";case e.LIST_FILE:return"List<File>";default:throw new m("Invalid data type enum. No matching type.")}}}]),e}();L.BYTE_ARRAY=0,L.STRING=1,L.NUMBER=2,L.HTML=3,L.ARRAY_BUFFER=4,L.BIG_NUMBER=5,L.JSON=6,L.FILE=7,L.LIST_FILE=8;t.a=L},14:function(e,t,r){var n;!function(i){"use strict";var a,o=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,s=Math.ceil,u=Math.floor,c="[BigNumber Error] ",l=c+"Number primitive has more than 15 significant digits: ",f=1e14,p=14,h=9007199254740991,d=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],g=1e7,y=1e9;function v(e){var t=0|e;return e>0||e===t?t:t-1}function m(e){for(var t,r,n=1,i=e.length,a=e[0]+"";n<i;){for(t=e[n++]+"",r=p-t.length;r--;t="0"+t);a+=t}for(i=a.length;48===a.charCodeAt(--i););return a.slice(0,i+1||1)}function C(e,t){var r,n,i=e.c,a=t.c,o=e.s,s=t.s,u=e.e,c=t.e;if(!o||!s)return null;if(r=i&&!i[0],n=a&&!a[0],r||n)return r?n?0:-s:o;if(o!=s)return o;if(r=o<0,n=u==c,!i||!a)return n?0:!i^r?1:-1;if(!n)return u>c^r?1:-1;for(s=(u=i.length)<(c=a.length)?u:c,o=0;o<s;o++)if(i[o]!=a[o])return i[o]>a[o]^r?1:-1;return u==c?0:u>c^r?1:-1}function E(e,t,r,n){if(e<t||e>r||e!==u(e))throw Error(c+(n||"Argument")+("number"==typeof e?e<t||e>r?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function b(e){var t=e.c.length-1;return v(e.e/p)==t&&e.c[t]%2!=0}function S(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function B(e,t,r){var n,i;if(t<0){for(i=r+".";++t;i+=r);e=i+e}else if(++t>(n=e.length)){for(i=r,t-=n;--t;i+=r);e+=i}else t<n&&(e=e.slice(0,t)+"."+e.slice(t));return e}(a=function e(t){var r,n,i,a,A,T,w,I,k,_=H.prototype={constructor:H,toString:null,valueOf:null},R=new H(1),x=20,N=4,L=-7,D=21,U=-1e7,F=1e7,P=!1,O=1,V=0,M={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},K="0123456789abcdefghijklmnopqrstuvwxyz";function H(e,t){var r,a,s,c,f,d,g,y,v=this;if(!(v instanceof H))return new H(e,t);if(null==t){if(e&&!0===e._isBigNumber)return v.s=e.s,void(!e.c||e.e>F?v.c=v.e=null:e.e<U?v.c=[v.e=0]:(v.e=e.e,v.c=e.c.slice()));if((d="number"==typeof e)&&0*e==0){if(v.s=1/e<0?(e=-e,-1):1,e===~~e){for(c=0,f=e;f>=10;f/=10,c++);return void(c>F?v.c=v.e=null:(v.e=c,v.c=[e]))}y=String(e)}else{if(!o.test(y=String(e)))return i(v,y,d);v.s=45==y.charCodeAt(0)?(y=y.slice(1),-1):1}(c=y.indexOf("."))>-1&&(y=y.replace(".","")),(f=y.search(/e/i))>0?(c<0&&(c=f),c+=+y.slice(f+1),y=y.substring(0,f)):c<0&&(c=y.length)}else{if(E(t,2,K.length,"Base"),10==t)return q(v=new H(e),x+v.e+1,N);if(y=String(e),d="number"==typeof e){if(0*e!=0)return i(v,y,d,t);if(v.s=1/e<0?(y=y.slice(1),-1):1,H.DEBUG&&y.replace(/^0\.0*|\./,"").length>15)throw Error(l+e)}else v.s=45===y.charCodeAt(0)?(y=y.slice(1),-1):1;for(r=K.slice(0,t),c=f=0,g=y.length;f<g;f++)if(r.indexOf(a=y.charAt(f))<0){if("."==a){if(f>c){c=g;continue}}else if(!s&&(y==y.toUpperCase()&&(y=y.toLowerCase())||y==y.toLowerCase()&&(y=y.toUpperCase()))){s=!0,f=-1,c=0;continue}return i(v,String(e),d,t)}d=!1,(c=(y=n(y,t,10,v.s)).indexOf("."))>-1?y=y.replace(".",""):c=y.length}for(f=0;48===y.charCodeAt(f);f++);for(g=y.length;48===y.charCodeAt(--g););if(y=y.slice(f,++g)){if(g-=f,d&&H.DEBUG&&g>15&&(e>h||e!==u(e)))throw Error(l+v.s*e);if((c=c-f-1)>F)v.c=v.e=null;else if(c<U)v.c=[v.e=0];else{if(v.e=c,v.c=[],f=(c+1)%p,c<0&&(f+=p),f<g){for(f&&v.c.push(+y.slice(0,f)),g-=p;f<g;)v.c.push(+y.slice(f,f+=p));f=p-(y=y.slice(f)).length}else f-=g;for(;f--;y+="0");v.c.push(+y)}}else v.c=[v.e=0]}function j(e,t,r,n){var i,a,o,s,u;if(null==r?r=N:E(r,0,8),!e.c)return e.toString();if(i=e.c[0],o=e.e,null==t)u=m(e.c),u=1==n||2==n&&(o<=L||o>=D)?S(u,o):B(u,o,"0");else if(a=(e=q(new H(e),t,r)).e,s=(u=m(e.c)).length,1==n||2==n&&(t<=a||a<=L)){for(;s<t;u+="0",s++);u=S(u,a)}else if(t-=o,u=B(u,a,"0"),a+1>s){if(--t>0)for(u+=".";t--;u+="0");}else if((t+=a-s)>0)for(a+1==s&&(u+=".");t--;u+="0");return e.s<0&&i?"-"+u:u}function z(e,t){for(var r,n=1,i=new H(e[0]);n<e.length;n++){if(!(r=new H(e[n])).s){i=r;break}t.call(i,r)&&(i=r)}return i}function G(e,t,r){for(var n=1,i=t.length;!t[--i];t.pop());for(i=t[0];i>=10;i/=10,n++);return(r=n+r*p-1)>F?e.c=e.e=null:r<U?e.c=[e.e=0]:(e.e=r,e.c=t),e}function q(e,t,r,n){var i,a,o,c,l,h,g,y=e.c,v=d;if(y){e:{for(i=1,c=y[0];c>=10;c/=10,i++);if((a=t-i)<0)a+=p,o=t,g=(l=y[h=0])/v[i-o-1]%10|0;else if((h=s((a+1)/p))>=y.length){if(!n)break e;for(;y.length<=h;y.push(0));l=g=0,i=1,o=(a%=p)-p+1}else{for(l=c=y[h],i=1;c>=10;c/=10,i++);g=(o=(a%=p)-p+i)<0?0:l/v[i-o-1]%10|0}if(n=n||t<0||null!=y[h+1]||(o<0?l:l%v[i-o-1]),n=r<4?(g||n)&&(0==r||r==(e.s<0?3:2)):g>5||5==g&&(4==r||n||6==r&&(a>0?o>0?l/v[i-o]:0:y[h-1])%10&1||r==(e.s<0?8:7)),t<1||!y[0])return y.length=0,n?(t-=e.e+1,y[0]=v[(p-t%p)%p],e.e=-t||0):y[0]=e.e=0,e;if(0==a?(y.length=h,c=1,h--):(y.length=h+1,c=v[p-a],y[h]=o>0?u(l/v[i-o]%v[o])*c:0),n)for(;;){if(0==h){for(a=1,o=y[0];o>=10;o/=10,a++);for(o=y[0]+=c,c=1;o>=10;o/=10,c++);a!=c&&(e.e++,y[0]==f&&(y[0]=1));break}if(y[h]+=c,y[h]!=f)break;y[h--]=0,c=1}for(a=y.length;0===y[--a];y.pop());}e.e>F?e.c=e.e=null:e.e<U&&(e.c=[e.e=0])}return e}function Y(e){var t,r=e.e;return null===r?e.toString():(t=m(e.c),t=r<=L||r>=D?S(t,r):B(t,r,"0"),e.s<0?"-"+t:t)}return H.clone=e,H.ROUND_UP=0,H.ROUND_DOWN=1,H.ROUND_CEIL=2,H.ROUND_FLOOR=3,H.ROUND_HALF_UP=4,H.ROUND_HALF_DOWN=5,H.ROUND_HALF_EVEN=6,H.ROUND_HALF_CEIL=7,H.ROUND_HALF_FLOOR=8,H.EUCLID=9,H.config=H.set=function(e){var t,r;if(null!=e){if("object"!=typeof e)throw Error(c+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(E(r=e[t],0,y,t),x=r),e.hasOwnProperty(t="ROUNDING_MODE")&&(E(r=e[t],0,8,t),N=r),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((r=e[t])&&r.pop?(E(r[0],-y,0,t),E(r[1],0,y,t),L=r[0],D=r[1]):(E(r,-y,y,t),L=-(D=r<0?-r:r))),e.hasOwnProperty(t="RANGE"))if((r=e[t])&&r.pop)E(r[0],-y,-1,t),E(r[1],1,y,t),U=r[0],F=r[1];else{if(E(r,-y,y,t),!r)throw Error(c+t+" cannot be zero: "+r);U=-(F=r<0?-r:r)}if(e.hasOwnProperty(t="CRYPTO")){if((r=e[t])!==!!r)throw Error(c+t+" not true or false: "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw P=!r,Error(c+"crypto unavailable");P=r}else P=r}if(e.hasOwnProperty(t="MODULO_MODE")&&(E(r=e[t],0,9,t),O=r),e.hasOwnProperty(t="POW_PRECISION")&&(E(r=e[t],0,y,t),V=r),e.hasOwnProperty(t="FORMAT")){if("object"!=typeof(r=e[t]))throw Error(c+t+" not an object: "+r);M=r}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(r=e[t])||/^.$|[+-.\s]|(.).*\1/.test(r))throw Error(c+t+" invalid: "+r);K=r}}return{DECIMAL_PLACES:x,ROUNDING_MODE:N,EXPONENTIAL_AT:[L,D],RANGE:[U,F],CRYPTO:P,MODULO_MODE:O,POW_PRECISION:V,FORMAT:M,ALPHABET:K}},H.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!H.DEBUG)return!0;var t,r,n=e.c,i=e.e,a=e.s;e:if("[object Array]"=={}.toString.call(n)){if((1===a||-1===a)&&i>=-y&&i<=y&&i===u(i)){if(0===n[0]){if(0===i&&1===n.length)return!0;break e}if((t=(i+1)%p)<1&&(t+=p),String(n[0]).length==t){for(t=0;t<n.length;t++)if((r=n[t])<0||r>=f||r!==u(r))break e;if(0!==r)return!0}}}else if(null===n&&null===i&&(null===a||1===a||-1===a))return!0;throw Error(c+"Invalid BigNumber: "+e)},H.maximum=H.max=function(){return z(arguments,_.lt)},H.minimum=H.min=function(){return z(arguments,_.gt)},H.random=(a=9007199254740992*Math.random()&2097151?function(){return u(9007199254740992*Math.random())}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,r,n,i,o,l=0,f=[],h=new H(R);if(null==e?e=x:E(e,0,y),i=s(e/p),P)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(i*=2));l<i;)(o=131072*t[l]+(t[l+1]>>>11))>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),t[l]=r[0],t[l+1]=r[1]):(f.push(o%1e14),l+=2);l=i/2}else{if(!crypto.randomBytes)throw P=!1,Error(c+"crypto unavailable");for(t=crypto.randomBytes(i*=7);l<i;)(o=281474976710656*(31&t[l])+1099511627776*t[l+1]+4294967296*t[l+2]+16777216*t[l+3]+(t[l+4]<<16)+(t[l+5]<<8)+t[l+6])>=9e15?crypto.randomBytes(7).copy(t,l):(f.push(o%1e14),l+=7);l=i/7}if(!P)for(;l<i;)(o=a())<9e15&&(f[l++]=o%1e14);for(i=f[--l],e%=p,i&&e&&(o=d[p-e],f[l]=u(i/o)*o);0===f[l];f.pop(),l--);if(l<0)f=[n=0];else{for(n=-1;0===f[0];f.splice(0,1),n-=p);for(l=1,o=f[0];o>=10;o/=10,l++);l<p&&(n-=p-l)}return h.e=n,h.c=f,h}),H.sum=function(){for(var e=1,t=arguments,r=new H(t[0]);e<t.length;)r=r.plus(t[e++]);return r},n=function(){function e(e,t,r,n){for(var i,a,o=[0],s=0,u=e.length;s<u;){for(a=o.length;a--;o[a]*=t);for(o[0]+=n.indexOf(e.charAt(s++)),i=0;i<o.length;i++)o[i]>r-1&&(null==o[i+1]&&(o[i+1]=0),o[i+1]+=o[i]/r|0,o[i]%=r)}return o.reverse()}return function(t,n,i,a,o){var s,u,c,l,f,p,h,d,g=t.indexOf("."),y=x,v=N;for(g>=0&&(l=V,V=0,t=t.replace(".",""),p=(d=new H(n)).pow(t.length-g),V=l,d.c=e(B(m(p.c),p.e,"0"),10,i,"0123456789"),d.e=d.c.length),c=l=(h=e(t,n,i,o?(s=K,"0123456789"):(s="0123456789",K))).length;0==h[--l];h.pop());if(!h[0])return s.charAt(0);if(g<0?--c:(p.c=h,p.e=c,p.s=a,h=(p=r(p,d,y,v,i)).c,f=p.r,c=p.e),g=h[u=c+y+1],l=i/2,f=f||u<0||null!=h[u+1],f=v<4?(null!=g||f)&&(0==v||v==(p.s<0?3:2)):g>l||g==l&&(4==v||f||6==v&&1&h[u-1]||v==(p.s<0?8:7)),u<1||!h[0])t=f?B(s.charAt(1),-y,s.charAt(0)):s.charAt(0);else{if(h.length=u,f)for(--i;++h[--u]>i;)h[u]=0,u||(++c,h=[1].concat(h));for(l=h.length;!h[--l];);for(g=0,t="";g<=l;t+=s.charAt(h[g++]));t=B(t,c,s.charAt(0))}return t}}(),r=function(){function e(e,t,r){var n,i,a,o,s=0,u=e.length,c=t%g,l=t/g|0;for(e=e.slice();u--;)s=((i=c*(a=e[u]%g)+(n=l*a+(o=e[u]/g|0)*c)%g*g+s)/r|0)+(n/g|0)+l*o,e[u]=i%r;return s&&(e=[s].concat(e)),e}function t(e,t,r,n){var i,a;if(r!=n)a=r>n?1:-1;else for(i=a=0;i<r;i++)if(e[i]!=t[i]){a=e[i]>t[i]?1:-1;break}return a}function r(e,t,r,n){for(var i=0;r--;)e[r]-=i,i=e[r]<t[r]?1:0,e[r]=i*n+e[r]-t[r];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(n,i,a,o,s){var c,l,h,d,g,y,m,C,E,b,S,B,A,T,w,I,k,_=n.s==i.s?1:-1,R=n.c,x=i.c;if(!(R&&R[0]&&x&&x[0]))return new H(n.s&&i.s&&(R?!x||R[0]!=x[0]:x)?R&&0==R[0]||!x?0*_:_/0:NaN);for(E=(C=new H(_)).c=[],_=a+(l=n.e-i.e)+1,s||(s=f,l=v(n.e/p)-v(i.e/p),_=_/p|0),h=0;x[h]==(R[h]||0);h++);if(x[h]>(R[h]||0)&&l--,_<0)E.push(1),d=!0;else{for(T=R.length,I=x.length,h=0,_+=2,(g=u(s/(x[0]+1)))>1&&(x=e(x,g,s),R=e(R,g,s),I=x.length,T=R.length),A=I,S=(b=R.slice(0,I)).length;S<I;b[S++]=0);k=x.slice(),k=[0].concat(k),w=x[0],x[1]>=s/2&&w++;do{if(g=0,(c=t(x,b,I,S))<0){if(B=b[0],I!=S&&(B=B*s+(b[1]||0)),(g=u(B/w))>1)for(g>=s&&(g=s-1),m=(y=e(x,g,s)).length,S=b.length;1==t(y,b,m,S);)g--,r(y,I<m?k:x,m,s),m=y.length,c=1;else 0==g&&(c=g=1),m=(y=x.slice()).length;if(m<S&&(y=[0].concat(y)),r(b,y,S,s),S=b.length,-1==c)for(;t(x,b,I,S)<1;)g++,r(b,I<S?k:x,S,s),S=b.length}else 0===c&&(g++,b=[0]);E[h++]=g,b[0]?b[S++]=R[A]||0:(b=[R[A]],S=1)}while((A++<T||null!=b[0])&&_--);d=null!=b[0],E[0]||E.splice(0,1)}if(s==f){for(h=1,_=E[0];_>=10;_/=10,h++);q(C,a+(C.e=h+l*p-1)+1,o,d)}else C.e=l,C.r=+d;return C}}(),A=/^(-?)0([xbo])(?=\w[\w.]*$)/i,T=/^([^.]+)\.$/,w=/^\.([^.]+)$/,I=/^-?(Infinity|NaN)$/,k=/^\s*\+(?=[\w.])|^\s+|\s+$/g,i=function(e,t,r,n){var i,a=r?t:t.replace(k,"");if(I.test(a))e.s=isNaN(a)?null:a<0?-1:1;else{if(!r&&(a=a.replace(A,(function(e,t,r){return i="x"==(r=r.toLowerCase())?16:"b"==r?2:8,n&&n!=i?e:t})),n&&(i=n,a=a.replace(T,"$1").replace(w,"0.$1")),t!=a))return new H(a,i);if(H.DEBUG)throw Error(c+"Not a"+(n?" base "+n:"")+" number: "+t);e.s=null}e.c=e.e=null},_.absoluteValue=_.abs=function(){var e=new H(this);return e.s<0&&(e.s=1),e},_.comparedTo=function(e,t){return C(this,new H(e,t))},_.decimalPlaces=_.dp=function(e,t){var r,n,i,a=this;if(null!=e)return E(e,0,y),null==t?t=N:E(t,0,8),q(new H(a),e+a.e+1,t);if(!(r=a.c))return null;if(n=((i=r.length-1)-v(this.e/p))*p,i=r[i])for(;i%10==0;i/=10,n--);return n<0&&(n=0),n},_.dividedBy=_.div=function(e,t){return r(this,new H(e,t),x,N)},_.dividedToIntegerBy=_.idiv=function(e,t){return r(this,new H(e,t),0,1)},_.exponentiatedBy=_.pow=function(e,t){var r,n,i,a,o,l,f,h,d=this;if((e=new H(e)).c&&!e.isInteger())throw Error(c+"Exponent not an integer: "+Y(e));if(null!=t&&(t=new H(t)),o=e.e>14,!d.c||!d.c[0]||1==d.c[0]&&!d.e&&1==d.c.length||!e.c||!e.c[0])return h=new H(Math.pow(+Y(d),o?2-b(e):+Y(e))),t?h.mod(t):h;if(l=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new H(NaN);(n=!l&&d.isInteger()&&t.isInteger())&&(d=d.mod(t))}else{if(e.e>9&&(d.e>0||d.e<-1||(0==d.e?d.c[0]>1||o&&d.c[1]>=24e7:d.c[0]<8e13||o&&d.c[0]<=9999975e7)))return a=d.s<0&&b(e)?-0:0,d.e>-1&&(a=1/a),new H(l?1/a:a);V&&(a=s(V/p+2))}for(o?(r=new H(.5),l&&(e.s=1),f=b(e)):f=(i=Math.abs(+Y(e)))%2,h=new H(R);;){if(f){if(!(h=h.times(d)).c)break;a?h.c.length>a&&(h.c.length=a):n&&(h=h.mod(t))}if(i){if(0===(i=u(i/2)))break;f=i%2}else if(q(e=e.times(r),e.e+1,1),e.e>14)f=b(e);else{if(0===(i=+Y(e)))break;f=i%2}d=d.times(d),a?d.c&&d.c.length>a&&(d.c.length=a):n&&(d=d.mod(t))}return n?h:(l&&(h=R.div(h)),t?h.mod(t):a?q(h,V,N,void 0):h)},_.integerValue=function(e){var t=new H(this);return null==e?e=N:E(e,0,8),q(t,t.e+1,e)},_.isEqualTo=_.eq=function(e,t){return 0===C(this,new H(e,t))},_.isFinite=function(){return!!this.c},_.isGreaterThan=_.gt=function(e,t){return C(this,new H(e,t))>0},_.isGreaterThanOrEqualTo=_.gte=function(e,t){return 1===(t=C(this,new H(e,t)))||0===t},_.isInteger=function(){return!!this.c&&v(this.e/p)>this.c.length-2},_.isLessThan=_.lt=function(e,t){return C(this,new H(e,t))<0},_.isLessThanOrEqualTo=_.lte=function(e,t){return-1===(t=C(this,new H(e,t)))||0===t},_.isNaN=function(){return!this.s},_.isNegative=function(){return this.s<0},_.isPositive=function(){return this.s>0},_.isZero=function(){return!!this.c&&0==this.c[0]},_.minus=function(e,t){var r,n,i,a,o=this,s=o.s;if(t=(e=new H(e,t)).s,!s||!t)return new H(NaN);if(s!=t)return e.s=-t,o.plus(e);var u=o.e/p,c=e.e/p,l=o.c,h=e.c;if(!u||!c){if(!l||!h)return l?(e.s=-t,e):new H(h?o:NaN);if(!l[0]||!h[0])return h[0]?(e.s=-t,e):new H(l[0]?o:3==N?-0:0)}if(u=v(u),c=v(c),l=l.slice(),s=u-c){for((a=s<0)?(s=-s,i=l):(c=u,i=h),i.reverse(),t=s;t--;i.push(0));i.reverse()}else for(n=(a=(s=l.length)<(t=h.length))?s:t,s=t=0;t<n;t++)if(l[t]!=h[t]){a=l[t]<h[t];break}if(a&&(i=l,l=h,h=i,e.s=-e.s),(t=(n=h.length)-(r=l.length))>0)for(;t--;l[r++]=0);for(t=f-1;n>s;){if(l[--n]<h[n]){for(r=n;r&&!l[--r];l[r]=t);--l[r],l[n]+=f}l[n]-=h[n]}for(;0==l[0];l.splice(0,1),--c);return l[0]?G(e,l,c):(e.s=3==N?-1:1,e.c=[e.e=0],e)},_.modulo=_.mod=function(e,t){var n,i,a=this;return e=new H(e,t),!a.c||!e.s||e.c&&!e.c[0]?new H(NaN):!e.c||a.c&&!a.c[0]?new H(a):(9==O?(i=e.s,e.s=1,n=r(a,e,0,3),e.s=i,n.s*=i):n=r(a,e,0,O),(e=a.minus(n.times(e))).c[0]||1!=O||(e.s=a.s),e)},_.multipliedBy=_.times=function(e,t){var r,n,i,a,o,s,u,c,l,h,d,y,m,C,E,b=this,S=b.c,B=(e=new H(e,t)).c;if(!(S&&B&&S[0]&&B[0]))return!b.s||!e.s||S&&!S[0]&&!B||B&&!B[0]&&!S?e.c=e.e=e.s=null:(e.s*=b.s,S&&B?(e.c=[0],e.e=0):e.c=e.e=null),e;for(n=v(b.e/p)+v(e.e/p),e.s*=b.s,(u=S.length)<(h=B.length)&&(m=S,S=B,B=m,i=u,u=h,h=i),i=u+h,m=[];i--;m.push(0));for(C=f,E=g,i=h;--i>=0;){for(r=0,d=B[i]%E,y=B[i]/E|0,a=i+(o=u);a>i;)r=((c=d*(c=S[--o]%E)+(s=y*c+(l=S[o]/E|0)*d)%E*E+m[a]+r)/C|0)+(s/E|0)+y*l,m[a--]=c%C;m[a]=r}return r?++n:m.splice(0,1),G(e,m,n)},_.negated=function(){var e=new H(this);return e.s=-e.s||null,e},_.plus=function(e,t){var r,n=this,i=n.s;if(t=(e=new H(e,t)).s,!i||!t)return new H(NaN);if(i!=t)return e.s=-t,n.minus(e);var a=n.e/p,o=e.e/p,s=n.c,u=e.c;if(!a||!o){if(!s||!u)return new H(i/0);if(!s[0]||!u[0])return u[0]?e:new H(s[0]?n:0*i)}if(a=v(a),o=v(o),s=s.slice(),i=a-o){for(i>0?(o=a,r=u):(i=-i,r=s),r.reverse();i--;r.push(0));r.reverse()}for((i=s.length)-(t=u.length)<0&&(r=u,u=s,s=r,t=i),i=0;t;)i=(s[--t]=s[t]+u[t]+i)/f|0,s[t]=f===s[t]?0:s[t]%f;return i&&(s=[i].concat(s),++o),G(e,s,o)},_.precision=_.sd=function(e,t){var r,n,i,a=this;if(null!=e&&e!==!!e)return E(e,1,y),null==t?t=N:E(t,0,8),q(new H(a),e,t);if(!(r=a.c))return null;if(n=(i=r.length-1)*p+1,i=r[i]){for(;i%10==0;i/=10,n--);for(i=r[0];i>=10;i/=10,n++);}return e&&a.e+1>n&&(n=a.e+1),n},_.shiftedBy=function(e){return E(e,-h,h),this.times("1e"+e)},_.squareRoot=_.sqrt=function(){var e,t,n,i,a,o=this,s=o.c,u=o.s,c=o.e,l=x+4,f=new H("0.5");if(1!==u||!s||!s[0])return new H(!u||u<0&&(!s||s[0])?NaN:s?o:1/0);if(0==(u=Math.sqrt(+Y(o)))||u==1/0?(((t=m(s)).length+c)%2==0&&(t+="0"),u=Math.sqrt(+t),c=v((c+1)/2)-(c<0||c%2),n=new H(t=u==1/0?"1e"+c:(t=u.toExponential()).slice(0,t.indexOf("e")+1)+c)):n=new H(u+""),n.c[0])for((u=(c=n.e)+l)<3&&(u=0);;)if(a=n,n=f.times(a.plus(r(o,a,l,1))),m(a.c).slice(0,u)===(t=m(n.c)).slice(0,u)){if(n.e<c&&--u,"9999"!=(t=t.slice(u-3,u+1))&&(i||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(q(n,n.e+x+2,1),e=!n.times(n).eq(o));break}if(!i&&(q(a,a.e+x+2,0),a.times(a).eq(o))){n=a;break}l+=4,u+=4,i=1}return q(n,n.e+x+1,N,e)},_.toExponential=function(e,t){return null!=e&&(E(e,0,y),e++),j(this,e,t,1)},_.toFixed=function(e,t){return null!=e&&(E(e,0,y),e=e+this.e+1),j(this,e,t)},_.toFormat=function(e,t,r){var n,i=this;if(null==r)null!=e&&t&&"object"==typeof t?(r=t,t=null):e&&"object"==typeof e?(r=e,e=t=null):r=M;else if("object"!=typeof r)throw Error(c+"Argument not an object: "+r);if(n=i.toFixed(e,t),i.c){var a,o=n.split("."),s=+r.groupSize,u=+r.secondaryGroupSize,l=r.groupSeparator||"",f=o[0],p=o[1],h=i.s<0,d=h?f.slice(1):f,g=d.length;if(u&&(a=s,s=u,u=a,g-=a),s>0&&g>0){for(a=g%s||s,f=d.substr(0,a);a<g;a+=s)f+=l+d.substr(a,s);u>0&&(f+=l+d.slice(a)),h&&(f="-"+f)}n=p?f+(r.decimalSeparator||"")+((u=+r.fractionGroupSize)?p.replace(new RegExp("\\d{"+u+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):p):f}return(r.prefix||"")+n+(r.suffix||"")},_.toFraction=function(e){var t,n,i,a,o,s,u,l,f,h,g,y,v=this,C=v.c;if(null!=e&&(!(u=new H(e)).isInteger()&&(u.c||1!==u.s)||u.lt(R)))throw Error(c+"Argument "+(u.isInteger()?"out of range: ":"not an integer: ")+Y(u));if(!C)return new H(v);for(t=new H(R),f=n=new H(R),i=l=new H(R),y=m(C),o=t.e=y.length-v.e-1,t.c[0]=d[(s=o%p)<0?p+s:s],e=!e||u.comparedTo(t)>0?o>0?t:f:u,s=F,F=1/0,u=new H(y),l.c[0]=0;h=r(u,t,0,1),1!=(a=n.plus(h.times(i))).comparedTo(e);)n=i,i=a,f=l.plus(h.times(a=f)),l=a,t=u.minus(h.times(a=t)),u=a;return a=r(e.minus(n),i,0,1),l=l.plus(a.times(f)),n=n.plus(a.times(i)),l.s=f.s=v.s,g=r(f,i,o*=2,N).minus(v).abs().comparedTo(r(l,n,o,N).minus(v).abs())<1?[f,i]:[l,n],F=s,g},_.toNumber=function(){return+Y(this)},_.toPrecision=function(e,t){return null!=e&&E(e,1,y),j(this,e,t,2)},_.toString=function(e){var t,r=this,i=r.s,a=r.e;return null===a?i?(t="Infinity",i<0&&(t="-"+t)):t="NaN":(null==e?t=a<=L||a>=D?S(m(r.c),a):B(m(r.c),a,"0"):10===e?t=B(m((r=q(new H(r),x+a+1,N)).c),r.e,"0"):(E(e,2,K.length,"Base"),t=n(B(m(r.c),a,"0"),10,e,i,!0)),i<0&&r.c[0]&&(t="-"+t)),t},_.valueOf=_.toJSON=function(){return Y(this)},_._isBigNumber=!0,null!=t&&H.set(t),H}()).default=a.BigNumber=a,void 0===(n=function(){return a}.call(t,r,t,e))||(e.exports=n)}()},1400:function(e,t,r){"use strict";r.r(t);var n=r(1),i=r.n(n),a=r(2),o=r.n(a),s=r(4),u=r.n(s),c=r(3),l=r.n(c),f=r(5),p=r.n(f),h=r(9),d=r(0),g=r(97),y=r(8),v=function(e){function t(){var e;return i()(this,t),(e=u()(this,l()(t).call(this))).name="A1Z26 Cipher Decode",e.module="Ciphers",e.description="Converts alphabet order numbers into their corresponding  alphabet character.<br><br>e.g. <code>1</code> becomes <code>a</code> and <code>2</code> becomes <code>b</code>.",e.infoURL="",e.inputType="string",e.outputType="string",e.args=[{name:"Delimiter",type:"option",value:g.a}],e}return p()(t,e),o()(t,[{key:"run",value:function(e,t){var r=d.b.charRep(t[0]||"Space");if(0===e.length)return[];for(var n=e.split(r),i="",a=0;a<n.length;a++){if(n[a]<1||n[a]>26)throw new y.a("Error: all numbers must be between 1 and 26.");i+=d.b.chr(parseInt(n[a],10)+96)}return i}}]),t}(h.a),m=function(e){function t(){var e;return i()(this,t),(e=u()(this,l()(t).call(this))).name="A1Z26 Cipher Encode",e.module="Ciphers",e.description="Converts alphabet characters into their corresponding alphabet order number.<br><br>e.g. <code>a</code> becomes <code>1</code> and <code>b</code> becomes <code>2</code>.<br><br>Non-alphabet characters are dropped.",e.infoURL="",e.inputType="string",e.outputType="string",e.args=[{name:"Delimiter",type:"option",value:g.a}],e}return p()(t,e),o()(t,[{key:"run",value:function(e,t){for(var r=d.b.charRep(t[0]||"Space"),n="",i=e.toLowerCase(),a=d.b.strToCharcode(i),o=0;o<a.length;o++){var s=a[o]-96;s>0&&s<=26&&(n+=s.toString(10)+r)}return n.slice(0,-r.length)}}]),t}(h.a),C=r(37),E=r.n(C),b=function(e){function t(){var e;return i()(this,t),(e=u()(this,l()(t).call(this))).name="AES Decrypt",e.module="Ciphers",e.description="Advanced Encryption Standard (AES) is a U.S. Federal Information Processing Standard (FIPS). It was selected after a 5-year process where 15 competing designs were evaluated.<br><br><b>Key:</b> The following algorithms will be used based on the size of the key:<ul><li>16 bytes = AES-128</li><li>24 bytes = AES-192</li><li>32 bytes = AES-256</li></ul><br><br><b>IV:</b> The Initialization Vector should be 16 bytes long. If not entered, it will default to 16 null bytes.<br><br><b>Padding:</b> In CBC and ECB mode, PKCS#7 padding will be used.<br><br><b>GCM Tag:</b> This field is ignored unless 'GCM' mode is used.",e.infoURL="https://wikipedia.org/wiki/Advanced_Encryption_Standard",e.inputType="string",e.outputType="string",e.args=[{name:"Key",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]},{name:"IV",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]},{name:"Mode",type:"option",value:["CBC","CFB","OFB","CTR","GCM","ECB"]},{name:"Input",type:"option",value:["Hex","Raw"]},{name:"Output",type:"option",value:["Raw","Hex"]},{name:"GCM Tag",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]}],e}return p()(t,e),o()(t,[{key:"run",value:function(e,t){var r=d.b.convertToByteString(t[0].string,t[0].option),n=d.b.convertToByteString(t[1].string,t[1].option),i=t[2],a=t[3],o=t[4],s=d.b.convertToByteString(t[5].string,t[5].option);if([16,24,32].indexOf(r.length)<0)throw new y.a(`Invalid key length: ${r.length} bytes\n\nThe following algorithms will be used based on the size of the key:\n  16 bytes = AES-128\n  24 bytes = AES-192\n  32 bytes = AES-256`);e=d.b.convertToByteString(e,a);var u=E.a.cipher.createDecipher("AES-"+i,r);if(u.start({iv:0===n.length?"":n,tag:s}),u.update(E.a.util.createBuffer(e)),u.finish())return"Hex"===o?u.output.toHex():u.output.getBytes();throw new y.a("Unable to decrypt input with these parameters.")}}]),t}(h.a),S=function(e){function t(){var e;return i()(this,t),(e=u()(this,l()(t).call(this))).name="AES Encrypt",e.module="Ciphers",e.description="Advanced Encryption Standard (AES) is a U.S. Federal Information Processing Standard (FIPS). It was selected after a 5-year process where 15 competing designs were evaluated.<br><br><b>Key:</b> The following algorithms will be used based on the size of the key:<ul><li>16 bytes = AES-128</li><li>24 bytes = AES-192</li><li>32 bytes = AES-256</li></ul>You can generate a password-based key using one of the KDF operations.<br><br><b>IV:</b> The Initialization Vector should be 16 bytes long. If not entered, it will default to 16 null bytes.<br><br><b>Padding:</b> In CBC and ECB mode, PKCS#7 padding will be used.",e.infoURL="https://wikipedia.org/wiki/Advanced_Encryption_Standard",e.inputType="string",e.outputType="string",e.args=[{name:"Key",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]},{name:"IV",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]},{name:"Mode",type:"option",value:["CBC","CFB","OFB","CTR","GCM","ECB"]},{name:"Input",type:"option",value:["Raw","Hex"]},{name:"Output",type:"option",value:["Hex","Raw"]}],e}return p()(t,e),o()(t,[{key:"run",value:function(e,t){var r=d.b.convertToByteString(t[0].string,t[0].option),n=d.b.convertToByteString(t[1].string,t[1].option),i=t[2],a=t[3],o=t[4];if([16,24,32].indexOf(r.length)<0)throw new y.a(`Invalid key length: ${r.length} bytes\n\nThe following algorithms will be used based on the size of the key:\n  16 bytes = AES-128\n  24 bytes = AES-192\n  32 bytes = AES-256`);e=d.b.convertToByteString(e,a);var s=E.a.cipher.createCipher("AES-"+i,r);return s.start({iv:n}),s.update(E.a.util.createBuffer(e)),s.finish(),"Hex"===o?"GCM"===i?s.output.toHex()+"\n\nTag: "+s.mode.tag.toHex():s.output.toHex():"GCM"===i?s.output.getBytes()+"\n\nTag: "+s.mode.tag.getBytes():s.output.getBytes()}}]),t}(h.a),B=r(12),A=r.n(B),T=function(e){function t(){var e;return i()(this,t),(e=u()(this,l()(t).call(this))).name="Affine Cipher Decode",e.module="Ciphers",e.description="The Affine cipher is a type of monoalphabetic substitution cipher. To decrypt, each letter in an alphabet is mapped to its numeric equivalent, decrypted by a mathematical function, and converted back to a letter.",e.infoURL="https://wikipedia.org/wiki/Affine_cipher",e.inputType="string",e.outputType="string",e.args=[{name:"a",type:"number",value:1},{name:"b",type:"number",value:0}],e}return p()(t,e),o()(t,[{key:"run",value:function(e,t){var r="abcdefghijklmnopqrstuvwxyz",n=A()(t,2),i=n[0],a=n[1],o=d.b.modInv(i,26),s="";if(!/^\+?(0|[1-9]\d*)$/.test(i)||!/^\+?(0|[1-9]\d*)$/.test(a))throw new y.a("The values of a and b can only be integers.");if(1!==d.b.gcd(i,26))throw new y.a("The value of `a` must be coprime to 26.");for(var u=0;u<e.length;u++)r.indexOf(e[u])>=0?s+=r[d.b.mod((r.indexOf(e[u])-a)*o,26)]:r.indexOf(e[u].toLowerCase())>=0?s+=r[d.b.mod((r.indexOf(e[u].toLowerCase())-a)*o,26)].toUpperCase():s+=e[u];return s}},{key:"highlight",value:function(e,t){return e}},{key:"highlightReverse",value:function(e,t){return e}}]),t}(h.a),w=r(71),I=r.n(w);
/**
 * Cipher functions.
 *
 * @author Matt C [matt@artemisbot.uk]
 * @author n1474335 [n1474335@gmail.com]
 *
 * @copyright Crown Copyright 2018
 * @license Apache-2.0
 *
 */
function k(e,t){var r="abcdefghijklmnopqrstuvwxyz",n=t[0],i=t[1],a="";if(!/^\+?(0|[1-9]\d*)$/.test(n)||!/^\+?(0|[1-9]\d*)$/.test(i))throw new y.a("The values of a and b can only be integers.");for(var o=0;o<e.length;o++)r.indexOf(e[o])>=0?a+=r[(n*r.indexOf(e[o])+i)%26]:r.indexOf(e[o].toLowerCase())>=0?a+=r[(n*r.indexOf(e[o].toLowerCase())+i)%26].toUpperCase():a+=e[o];return a}function _(e){for(var t=`${e}ABCDEFGHIKLMNOPQRSTUVWXYZ`.split("").unique(),r=[],n=0;n<5;n++)r[n]=t.slice(5*n,5*n+5);return r}var R={Hex:I.a.enc.Hex,Base64:I.a.enc.Base64,UTF8:I.a.enc.Utf8,UTF16:I.a.enc.Utf16,UTF16LE:I.a.enc.Utf16LE,UTF16BE:I.a.enc.Utf16BE,Latin1:I.a.enc.Latin1},x=function(e){function t(){var e;return i()(this,t),(e=u()(this,l()(t).call(this))).name="Affine Cipher Encode",e.module="Ciphers",e.description="The Affine cipher is a type of monoalphabetic substitution cipher, wherein each letter in an alphabet is mapped to its numeric equivalent, encrypted using simple mathematical function, <code>(ax + b) % 26</code>, and converted back to a letter.",e.infoURL="https://wikipedia.org/wiki/Affine_cipher",e.inputType="string",e.outputType="string",e.args=[{name:"a",type:"number",value:1},{name:"b",type:"number",value:0}],e}return p()(t,e),o()(t,[{key:"run",value:function(e,t){return k(e,t)}},{key:"highlight",value:function(e,t){return e}},{key:"highlightReverse",value:function(e,t){return e}}]),t}(h.a),N=function(e){function t(){var e;return i()(this,t),(e=u()(this,l()(t).call(this))).name="Atbash Cipher",e.module="Ciphers",e.description="Atbash is a mono-alphabetic substitution cipher originally used to encode the Hebrew alphabet. It has been modified here for use with the Latin alphabet.",e.infoURL="https://wikipedia.org/wiki/Atbash",e.inputType="string",e.outputType="string",e.args=[],e}return p()(t,e),o()(t,[{key:"run",value:function(e,t){return k(e,[25,25])}},{key:"highlight",value:function(e,t){return e}},{key:"highlightReverse",value:function(e,t){return e}}]),t}(h.a),L=function(e){function t(){var e;return i()(this,t),(e=u()(this,l()(t).call(this))).name="Bifid Cipher Decode",e.module="Ciphers",e.description="The Bifid cipher is a cipher which uses a Polybius square in conjunction with transposition, which can be fairly difficult to decipher without knowing the alphabet keyword.",e.infoURL="https://wikipedia.org/wiki/Bifid_cipher",e.inputType="string",e.outputType="string",e.args=[{name:"Keyword",type:"string",value:""}],e}return p()(t,e),o()(t,[{key:"run",value:function(e,t){var r=t[0].toUpperCase().replace("J","I"),n=r.split("").unique(),i="ABCDEFGHIKLMNOPQRSTUVWXYZ",a=[],o="",s=0,u="";if(!/^[A-Z]+$/.test(r)&&n.length>0)throw new y.a("The key must consist only of letters in the English alphabet");var c=_(r);return e.replace("J","I").split("").forEach((function(e){var t,r=i.split("").indexOf(e.toLocaleUpperCase())>=0;if(r){for(var n=0;n<5;n++)(t=c[n].indexOf(e.toLocaleUpperCase()))>=0&&(u+=`${n}${t}`);i.split("").indexOf(e)>=0?a.push(!0):r&&a.push(!1)}else a.push(e)})),a.forEach((function(e){if("boolean"==typeof e){var t=[u[s],u[s+u.length/2]];o+=e?c[t[0]][t[1]]:c[t[0]][t[1]].toLocaleLowerCase(),s++}else o+=e})),o}},{key:"highlight",value:function(e,t){return e}},{key:"highlightReverse",value:function(e,t){return e}}]),t}(h.a),D=function(e){function t(){var e;return i()(this,t),(e=u()(this,l()(t).call(this))).name="Bifid Cipher Encode",e.module="Ciphers",e.description="The Bifid cipher is a cipher which uses a Polybius square in conjunction with transposition, which can be fairly difficult to decipher without knowing the alphabet keyword.",e.infoURL="https://wikipedia.org/wiki/Bifid_cipher",e.inputType="string",e.outputType="string",e.args=[{name:"Keyword",type:"string",value:""}],e}return p()(t,e),o()(t,[{key:"run",value:function(e,t){var r=t[0].toUpperCase().replace("J","I"),n=r.split("").unique(),i="ABCDEFGHIKLMNOPQRSTUVWXYZ",a=[],o=[],s=[],u="",c=0;if(!/^[A-Z]+$/.test(r)&&n.length>0)throw new y.a("The key must consist only of letters in the English alphabet");var l=_(r);e.replace("J","I").split("").forEach((function(e){var t,r=i.split("").indexOf(e.toLocaleUpperCase())>=0;if(r){for(var n=0;n<5;n++)(t=l[n].indexOf(e.toLocaleUpperCase()))>=0&&(a.push(t),o.push(n));i.split("").indexOf(e)>=0?s.push(!0):r&&s.push(!1)}else s.push(e)}));var f=`${o.join("")}${a.join("")}`;return s.forEach((function(e){if("boolean"==typeof e){var t=f.substr(2*c,2).split("");u+=e?l[t[0]][t[1]]:l[t[0]][t[1]].toLocaleLowerCase(),c++}else u+=e})),u}},{key:"highlight",value:function(e,t){return e}},{key:"highlightReverse",value:function(e,t){return e}}]),t}(h.a),U={},F={isString:function(e){return"string"==typeof e||e instanceof String}},P={map:function(e,t,r,n){var i=0,a=e&&e.length||0,o=new(n||Array)(a);if(a&&"string"==typeof e&&(e=e.split("")),r)for(;i<a;++i)o[i]=t.call(r,e[i],i,e);else for(;i<a;++i)o[i]=t(e[i],i,e);return o}},O={p:[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731],s0:[3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946],s1:[1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055],s2:[3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504],s3:[976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462]},V=function(e,t){return(e>>16^t>>16)<<16|65535&(65535&e^65535&t)},M=function(e,t){var r=t.s3[255&e];e>>=8;var n=t.s2[255&e];e>>=8;var i=t.s1[255&e];e>>=8;var a=t.s0[255&e],o=(a>>16)+(i>>16)+((65535&a)+(65535&i)>>16)<<16|(65535&a)+(65535&i)&65535;return((o=(o>>16^n>>16)<<16|65535&(65535&o^65535&n))>>16)+(r>>16)+((65535&o)+(65535&r)>>16)<<16|(65535&o)+(65535&r)&65535},K=function(e,t){var r=e.left,n=e.right;r=V(r,t.p[0]),n=V(n,V(M(r,t),t.p[1])),r=V(r,V(M(n,t),t.p[2])),n=V(n,V(M(r,t),t.p[3])),r=V(r,V(M(n,t),t.p[4])),n=V(n,V(M(r,t),t.p[5])),r=V(r,V(M(n,t),t.p[6])),n=V(n,V(M(r,t),t.p[7])),r=V(r,V(M(n,t),t.p[8])),n=V(n,V(M(r,t),t.p[9])),r=V(r,V(M(n,t),t.p[10])),n=V(n,V(M(r,t),t.p[11])),r=V(r,V(M(n,t),t.p[12])),n=V(n,V(M(r,t),t.p[13])),r=V(r,V(M(n,t),t.p[14])),n=V(n,V(M(r,t),t.p[15])),r=V(r,V(M(n,t),t.p[16])),e.right=r,e.left=V(n,t.p[17])},H=function(e,t,r){var n={};n.left=e[0],n.right=e[1],function(e,t){var r=e.left,n=e.right;r=V(r,t.p[17]),n=V(n,V(M(r,t),t.p[16])),r=V(r,V(M(n,t),t.p[15])),n=V(n,V(M(r,t),t.p[14])),r=V(r,V(M(n,t),t.p[13])),n=V(n,V(M(r,t),t.p[12])),r=V(r,V(M(n,t),t.p[11])),n=V(n,V(M(r,t),t.p[10])),r=V(r,V(M(n,t),t.p[9])),n=V(n,V(M(r,t),t.p[8])),r=V(r,V(M(n,t),t.p[7])),n=V(n,V(M(r,t),t.p[6])),r=V(r,V(M(n,t),t.p[5])),n=V(n,V(M(r,t),t.p[4])),r=V(r,V(M(n,t),t.p[3])),n=V(n,V(M(r,t),t.p[2])),r=V(r,V(M(n,t),t.p[1])),e.right=r,e.left=V(n,t.p[0])}(n,r),t[0]=n.left,t[1]=n.right};
/**
 * @author Matt C [matt@artemisbot.uk]
 * @copyright Crown Copyright 2018
 * @license Apache-2.0
 */U.Blowfish=new function(){this.createCipher=function(e,t){return new E.a.cipher.BlockCipher({algorithm:new j.Algorithm(e,t),key:e,decrypt:!1})},this.createDecipher=function(e,t){return new E.a.cipher.BlockCipher({algorithm:new j.Algorithm(e,t),key:e,decrypt:!0})}},U.Blowfish.Algorithm=function(e,t){this.initialize({key:e});var r=this.box,n={blockSize:8,cipher:{encrypt:function(e,t){!function(e,t,r){var n={};n.left=e[0],n.right=e[1],K(n,r),t[0]=n.left,t[1]=n.right}(e,t,r)},decrypt:function(e,t){H(e,t,r)}}};switch(t.toLowerCase()){case"ecb":this.mode=new E.a.cipher.modes.ecb(n);break;case"cbc":this.mode=new E.a.cipher.modes.cbc(n);break;case"cfb":this.mode=new E.a.cipher.modes.cfb(n);break;case"ofb":this.mode=new E.a.cipher.modes.ofb(n);break;case"ctr":this.mode=new E.a.cipher.modes.ctr(n);break;default:this.mode=new E.a.cipher.modes.ecb(n)}},U.Blowfish.Algorithm.prototype.initialize=function(e){var t=Math.pow(2,8),r=e.key;F.isString(r)&&(r=P.map(r.split(""),(function(e){return 255&e.charCodeAt(0)})));for(var n=0,i=0,a={left:0,right:0},o={p:P.map(O.p.slice(0),(function(e){for(var a=r.length,o=0;o<4;o++)i=i*t|r[n++%a];return(e>>16^i>>16)<<16|65535&(65535&e^65535&i)})),s0:O.s0.slice(0),s1:O.s1.slice(0),s2:O.s2.slice(0),s3:O.s3.slice(0)},s=0,u=o.p.length;s<u;)K(a,o),o.p[s++]=a.left,o.p[s++]=a.right;for(var c=0;c<4;c++)for(var l=0,f=o["s"+c].length;l<f;)K(a,o),o["s"+c][l++]=a.left,o["s"+c][l++]=a.right;this.box=o};var j=U.Blowfish,z=function(e){function t(){var e;return i()(this,t),(e=u()(this,l()(t).call(this))).name="Blowfish Decrypt",e.module="Ciphers",e.description="Blowfish is a symmetric-key block cipher designed in 1993 by Bruce Schneier and included in a large number of cipher suites and encryption products. AES now receives more attention.<br><br><b>IV:</b> The Initialization Vector should be 8 bytes long. If not entered, it will default to 8 null bytes.",e.infoURL="https://wikipedia.org/wiki/Blowfish_(cipher)",e.inputType="string",e.outputType="string",e.args=[{name:"Key",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]},{name:"IV",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]},{name:"Mode",type:"option",value:["CBC","CFB","OFB","CTR","ECB"]},{name:"Input",type:"option",value:["Hex","Raw"]},{name:"Output",type:"option",value:["Raw","Hex"]}],e}return p()(t,e),o()(t,[{key:"run",value:function(e,t){var r=d.b.convertToByteString(t[0].string,t[0].option),n=d.b.convertToByteString(t[1].string,t[1].option),i=t[2],a=t[3],o=t[4];if(8!==r.length)throw new y.a(`Invalid key length: ${r.length} bytes\n\nBlowfish uses a key length of 8 bytes (64 bits).`);e=d.b.convertToByteString(e,a);var s=j.createDecipher(r,i);if(s.start({iv:n}),s.update(E.a.util.createBuffer(e)),s.finish())return"Hex"===o?s.output.toHex():s.output.getBytes();throw new y.a("Unable to decrypt input with these parameters.")}}]),t}(h.a),G=function(e){function t(){var e;return i()(this,t),(e=u()(this,l()(t).call(this))).name="Blowfish Encrypt",e.module="Ciphers",e.description="Blowfish is a symmetric-key block cipher designed in 1993 by Bruce Schneier and included in a large number of cipher suites and encryption products. AES now receives more attention.<br><br><b>IV:</b> The Initialization Vector should be 8 bytes long. If not entered, it will default to 8 null bytes.",e.infoURL="https://wikipedia.org/wiki/Blowfish_(cipher)",e.inputType="string",e.outputType="string",e.args=[{name:"Key",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]},{name:"IV",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]},{name:"Mode",type:"option",value:["CBC","CFB","OFB","CTR","ECB"]},{name:"Input",type:"option",value:["Raw","Hex"]},{name:"Output",type:"option",value:["Hex","Raw"]}],e}return p()(t,e),o()(t,[{key:"run",value:function(e,t){var r=d.b.convertToByteString(t[0].string,t[0].option),n=d.b.convertToByteString(t[1].string,t[1].option),i=t[2],a=t[3],o=t[4];if(8!==r.length)throw new y.a(`Invalid key length: ${r.length} bytes\n\nBlowfish uses a key length of 8 bytes (64 bits).`);e=d.b.convertToByteString(e,a);var s=j.createCipher(r,i);return s.start({iv:n}),s.update(E.a.util.createBuffer(e)),s.finish(),"Hex"===o?s.output.toHex():s.output.getBytes()}}]),t}(h.a),q=function(e){function t(){var e;return i()(this,t),(e=u()(this,l()(t).call(this))).name="DES Decrypt",e.module="Ciphers",e.description="DES is a previously dominant algorithm for encryption, and was published as an official U.S. Federal Information Processing Standard (FIPS). It is now considered to be insecure due to its small key size.<br><br><b>Key:</b> DES uses a key length of 8 bytes (64 bits).<br>Triple DES uses a key length of 24 bytes (192 bits).<br><br><b>IV:</b> The Initialization Vector should be 8 bytes long. If not entered, it will default to 8 null bytes.<br><br><b>Padding:</b> In CBC and ECB mode, PKCS#7 padding will be used.",e.infoURL="https://wikipedia.org/wiki/Data_Encryption_Standard",e.inputType="string",e.outputType="string",e.args=[{name:"Key",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]},{name:"IV",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]},{name:"Mode",type:"option",value:["CBC","CFB","OFB","CTR","ECB"]},{name:"Input",type:"option",value:["Hex","Raw"]},{name:"Output",type:"option",value:["Raw","Hex"]}],e}return p()(t,e),o()(t,[{key:"run",value:function(e,t){var r=d.b.convertToByteString(t[0].string,t[0].option),n=d.b.convertToByteArray(t[1].string,t[1].option),i=A()(t,5),a=i[2],o=i[3],s=i[4];if(8!==r.length)throw new y.a(`Invalid key length: ${r.length} bytes\n\nDES uses a key length of 8 bytes (64 bits).\nTriple DES uses a key length of 24 bytes (192 bits).`);if(8!==n.length&&"ECB"!==a)throw new y.a(`Invalid IV length: ${n.length} bytes\n\nDES uses an IV length of 8 bytes (64 bits).\nMake sure you have specified the type correctly (e.g. Hex vs UTF8).`);e=d.b.convertToByteString(e,o);var u=E.a.cipher.createDecipher("DES-"+a,r);if(u.start({iv:n}),u.update(E.a.util.createBuffer(e)),u.finish())return"Hex"===s?u.output.toHex():u.output.getBytes();throw new y.a("Unable to decrypt input with these parameters.")}}]),t}(h.a),Y=function(e){function t(){var e;return i()(this,t),(e=u()(this,l()(t).call(this))).name="DES Encrypt",e.module="Ciphers",e.description="DES is a previously dominant algorithm for encryption, and was published as an official U.S. Federal Information Processing Standard (FIPS). It is now considered to be insecure due to its small key size.<br><br><b>Key:</b> DES uses a key length of 8 bytes (64 bits).<br>Triple DES uses a key length of 24 bytes (192 bits).<br><br>You can generate a password-based key using one of the KDF operations.<br><br><b>IV:</b> The Initialization Vector should be 8 bytes long. If not entered, it will default to 8 null bytes.<br><br><b>Padding:</b> In CBC and ECB mode, PKCS#7 padding will be used.",e.infoURL="https://wikipedia.org/wiki/Data_Encryption_Standard",e.inputType="string",e.outputType="string",e.args=[{name:"Key",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]},{name:"IV",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]},{name:"Mode",type:"option",value:["CBC","CFB","OFB","CTR","ECB"]},{name:"Input",type:"option",value:["Raw","Hex"]},{name:"Output",type:"option",value:["Hex","Raw"]}],e}return p()(t,e),o()(t,[{key:"run",value:function(e,t){var r=d.b.convertToByteString(t[0].string,t[0].option),n=d.b.convertToByteArray(t[1].string,t[1].option),i=A()(t,5),a=i[2],o=i[3],s=i[4];if(8!==r.length)throw new y.a(`Invalid key length: ${r.length} bytes\n\nDES uses a key length of 8 bytes (64 bits).\nTriple DES uses a key length of 24 bytes (192 bits).`);if(8!==n.length&&"ECB"!==a)throw new y.a(`Invalid IV length: ${n.length} bytes\n\nDES uses an IV length of 8 bytes (64 bits).\nMake sure you have specified the type correctly (e.g. Hex vs UTF8).`);e=d.b.convertToByteString(e,o);var u=E.a.cipher.createCipher("DES-"+a,r);return u.start({iv:n}),u.update(E.a.util.createBuffer(e)),u.finish(),"Hex"===s?u.output.toHex():u.output.getBytes()}}]),t}(h.a),Q=function(e){function t(){var e;return i()(this,t),(e=u()(this,l()(t).call(this))).name="Derive EVP key",e.module="Ciphers",e.description="This operation performs a password-based key derivation function (PBKDF) used extensively in OpenSSL. In many applications of cryptography, user security is ultimately dependent on a password, and because a password usually can't be used directly as a cryptographic key, some processing is required.<br><br>A salt provides a large set of keys for any given password, and an iteration count increases the cost of producing keys from a password, thereby also increasing the difficulty of attack.<br><br>If you leave the salt argument empty, a random salt will be generated.",e.infoURL="https://wikipedia.org/wiki/Key_derivation_function",e.inputType="string",e.outputType="string",e.args=[{name:"Passphrase",type:"toggleString",value:"",toggleValues:["UTF8","Latin1","Hex","Base64"]},{name:"Key size",type:"number",value:128},{name:"Iterations",type:"number",value:1},{name:"Hashing function",type:"option",value:["SHA1","SHA256","SHA384","SHA512","MD5"]},{name:"Salt",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]}],e}return p()(t,e),o()(t,[{key:"run",value:function(e,t){var r=d.b.convertToByteString(t[0].string,t[0].option),n=t[1]/32,i=t[2],a=t[3],o=d.b.convertToByteString(t[4].string,t[4].option);return I.a.EvpKDF(r,o,{keySize:n,hasher:I.a.algo[a],iterations:i}).toString(I.a.enc.Hex)}}]),t}(h.a);
/**
 * @author n1474335 [n1474335@gmail.com]
 * @copyright Crown Copyright 2016
 * @license Apache-2.0
 */I.a.kdf.OpenSSL.execute=function(e,t,r,n){null==n&&(n=I.a.lib.WordArray.random(8));var i=I.a.algo.EvpKDF.create({keySize:t+r}).compute(e,n),a=I.a.lib.WordArray.create(i.words.slice(t),4*r);return i.sigBytes=4*t,I.a.lib.CipherParams.create({key:i,iv:a,salt:n})},I.a.enc.Hex.parse=function(e){for(var t=(e=e.replace(/\s/g,"")).length,r=[],n=0;n<t;n+=2)r[n>>>3]|=parseInt(e.substr(n,2),16)<<24-n%8*4;return new I.a.lib.WordArray.init(r,t/2)};
/**
 * @author n1474335 [n1474335@gmail.com]
 * @copyright Crown Copyright 2016
 * @license Apache-2.0
 */
var W=function(e){function t(){var e;return i()(this,t),(e=u()(this,l()(t).call(this))).name="Derive PBKDF2 key",e.module="Ciphers",e.description="PBKDF2 is a password-based key derivation function. It is part of RSA Laboratories' Public-Key Cryptography Standards (PKCS) series, specifically PKCS #5 v2.0, also published as Internet Engineering Task Force's RFC 2898.<br><br>In many applications of cryptography, user security is ultimately dependent on a password, and because a password usually can't be used directly as a cryptographic key, some processing is required.<br><br>A salt provides a large set of keys for any given password, and an iteration count increases the cost of producing keys from a password, thereby also increasing the difficulty of attack.<br><br>If you leave the salt argument empty, a random salt will be generated.",e.infoURL="https://wikipedia.org/wiki/PBKDF2",e.inputType="string",e.outputType="string",e.args=[{name:"Passphrase",type:"toggleString",value:"",toggleValues:["UTF8","Latin1","Hex","Base64"]},{name:"Key size",type:"number",value:128},{name:"Iterations",type:"number",value:1},{name:"Hashing function",type:"option",value:["SHA1","SHA256","SHA384","SHA512","MD5"]},{name:"Salt",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]}],e}return p()(t,e),o()(t,[{key:"run",value:function(e,t){var r=d.b.convertToByteString(t[0].string,t[0].option),n=t[1],i=t[2],a=t[3],o=d.b.convertToByteString(t[4].string,t[4].option)||E.a.random.getBytesSync(n),s=E.a.pkcs5.pbkdf2(r,o,i,n/8,a.toLowerCase());return E.a.util.bytesToHex(s)}}]),t}(h.a),X=r(14),$=r.n(X),Z=function(e){function t(){var e;return i()(this,t),(e=u()(this,l()(t).call(this))).name="Pseudo-Random Number Generator",e.module="Ciphers",e.description="A cryptographically-secure pseudo-random number generator (PRNG).<br><br>This operation uses the browser's built-in <code>crypto.getRandomValues()</code> method if available. If this cannot be found, it falls back to a Fortuna-based PRNG algorithm.",e.infoURL="https://wikipedia.org/wiki/Pseudorandom_number_generator",e.inputType="string",e.outputType="string",e.args=[{name:"Number of bytes",type:"number",value:32},{name:"Output as",type:"option",value:["Hex","Integer","Byte array","Raw"]}],e}return p()(t,e),o()(t,[{key:"run",value:function(e,t){var r,n=A()(t,2),i=n[0],a=n[1];Object(d.d)()&&self.crypto?(r=self.crypto.getRandomValues(new Uint8Array(i)),r=d.b.arrayBufferToStr(r.buffer)):r=E.a.random.getBytesSync(i);var o,s=new $.a(0);switch(a){case"Hex":return E.a.util.bytesToHex(r);case"Integer":for(o=r.length-1;o>=0;o--)s=s.times(256).plus(r.charCodeAt(o));return s.toFixed();case"Byte array":return JSON.stringify(d.b.strToCharcode(r));case"Raw":default:return r}}}]),t}(h.a),J=function(e){function t(){var e;return i()(this,t),(e=u()(this,l()(t).call(this))).name="RC2 Decrypt",e.module="Ciphers",e.description="RC2 (also known as ARC2) is a symmetric-key block cipher designed by Ron Rivest in 1987. 'RC' stands for 'Rivest Cipher'.<br><br><b>Key:</b> RC2 uses a variable size key.<br><br><b>IV:</b> To run the cipher in CBC mode, the Initialization Vector should be 8 bytes long. If the IV is left blank, the cipher will run in ECB mode.<br><br><b>Padding:</b> In both CBC and ECB mode, PKCS#7 padding will be used.",e.infoURL="https://wikipedia.org/wiki/RC2",e.inputType="string",e.outputType="string",e.args=[{name:"Key",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]},{name:"IV",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]},{name:"Input",type:"option",value:["Hex","Raw"]},{name:"Output",type:"option",value:["Raw","Hex"]}],e}return p()(t,e),o()(t,[{key:"run",value:function(e,t){var r=d.b.convertToByteString(t[0].string,t[0].option),n=d.b.convertToByteString(t[1].string,t[1].option),i=A()(t,4),a=i[2],o=i[3],s=E.a.rc2.createDecryptionCipher(r);return e=d.b.convertToByteString(e,a),s.start(n||null),s.update(E.a.util.createBuffer(e)),s.finish(),"Hex"===o?s.output.toHex():s.output.getBytes()}}]),t}(h.a),ee=function(e){function t(){var e;return i()(this,t),(e=u()(this,l()(t).call(this))).name="RC2 Encrypt",e.module="Ciphers",e.description="RC2 (also known as ARC2) is a symmetric-key block cipher designed by Ron Rivest in 1987. 'RC' stands for 'Rivest Cipher'.<br><br><b>Key:</b> RC2 uses a variable size key.<br><br>You can generate a password-based key using one of the KDF operations.<br><br><b>IV:</b> To run the cipher in CBC mode, the Initialization Vector should be 8 bytes long. If the IV is left blank, the cipher will run in ECB mode.<br><br><b>Padding:</b> In both CBC and ECB mode, PKCS#7 padding will be used.",e.infoURL="https://wikipedia.org/wiki/RC2",e.inputType="string",e.outputType="string",e.args=[{name:"Key",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]},{name:"IV",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]},{name:"Input",type:"option",value:["Raw","Hex"]},{name:"Output",type:"option",value:["Hex","Raw"]}],e}return p()(t,e),o()(t,[{key:"run",value:function(e,t){var r=d.b.convertToByteString(t[0].string,t[0].option),n=d.b.convertToByteString(t[1].string,t[1].option),i=A()(t,4),a=i[2],o=i[3],s=E.a.rc2.createEncryptionCipher(r);return e=d.b.convertToByteString(e,a),s.start(n||null),s.update(E.a.util.createBuffer(e)),s.finish(),"Hex"===o?s.output.toHex():s.output.getBytes()}}]),t}(h.a),te=function(e){function t(){var e;return i()(this,t),(e=u()(this,l()(t).call(this))).name="RC4",e.module="Ciphers",e.description="RC4 (also known as ARC4) is a widely-used stream cipher designed by Ron Rivest. It is used in popular protocols such as SSL and WEP. Although remarkable for its simplicity and speed, the algorithm's history doesn't inspire confidence in its security.",e.infoURL="https://wikipedia.org/wiki/RC4",e.inputType="string",e.outputType="string",e.args=[{name:"Passphrase",type:"toggleString",value:"",toggleValues:["UTF8","UTF16","UTF16LE","UTF16BE","Latin1","Hex","Base64"]},{name:"Input format",type:"option",value:["Latin1","UTF8","UTF16","UTF16LE","UTF16BE","Hex","Base64"]},{name:"Output format",type:"option",value:["Latin1","UTF8","UTF16","UTF16LE","UTF16BE","Hex","Base64"]}],e}return p()(t,e),o()(t,[{key:"run",value:function(e,t){var r=R[t[1]].parse(e),n=R[t[0].option].parse(t[0].string);return I.a.RC4.encrypt(r,n).ciphertext.toString(R[t[2]])}},{key:"highlight",value:function(e,t){return e}},{key:"highlightReverse",value:function(e,t){return e}}]),t}(h.a),re=function(e){function t(){var e;return i()(this,t),(e=u()(this,l()(t).call(this))).name="RC4 Drop",e.module="Ciphers",e.description="It was discovered that the first few bytes of the RC4 keystream are strongly non-random and leak information about the key. We can defend against this attack by discarding the initial portion of the keystream. This modified algorithm is traditionally called RC4-drop.",e.infoURL="https://wikipedia.org/wiki/RC4#Fluhrer,_Mantin_and_Shamir_attack",e.inputType="string",e.outputType="string",e.args=[{name:"Passphrase",type:"toggleString",value:"",toggleValues:["UTF8","UTF16","UTF16LE","UTF16BE","Latin1","Hex","Base64"]},{name:"Input format",type:"option",value:["Latin1","UTF8","UTF16","UTF16LE","UTF16BE","Hex","Base64"]},{name:"Output format",type:"option",value:["Latin1","UTF8","UTF16","UTF16LE","UTF16BE","Hex","Base64"]},{name:"Number of bytes to drop",type:"number",value:768}],e}return p()(t,e),o()(t,[{key:"run",value:function(e,t){var r=R[t[1]].parse(e),n=R[t[0].option].parse(t[0].string),i=t[3];return I.a.RC4Drop.encrypt(r,n,{drop:i}).ciphertext.toString(R[t[2]])}},{key:"highlight",value:function(e,t){return e}},{key:"highlightReverse",value:function(e,t){return e}}]),t}(h.a),ne=function(e){function t(){var e;return i()(this,t),(e=u()(this,l()(t).call(this))).name="Rail Fence Cipher Decode",e.module="Ciphers",e.description="Decodes Strings that were created using the Rail fence Cipher provided a key and an offset",e.infoURL="https://wikipedia.org/wiki/Rail_fence_cipher",e.inputType="string",e.outputType="string",e.args=[{name:"Key",type:"number",value:2},{name:"Offset",type:"number",value:0}],e}return p()(t,e),o()(t,[{key:"run",value:function(e,t){var r=A()(t,2),n=r[0],i=r[1],a=e;if(n<2)throw new y.a("Key has to be bigger than 2");if(n>a.length)throw new y.a("Key should be smaller than the cipher's length");if(i<0)throw new y.a("Offset has to be a positive integer");var o=2*(n-1),s=a.length%n;0!==s&&(a+=" ".repeat(n-s));var u,c,l=new Array(a.length),f=0;for(c=0;c<n;c++)for(u=0;u<a.length;u++)(c+u+i)%o!=0&&(c-u-i)%o!=0||(l[u]=a[f++]);return l.join("").trim()}}]),t}(h.a),ie=function(e){function t(){var e;return i()(this,t),(e=u()(this,l()(t).call(this))).name="Rail Fence Cipher Encode",e.module="Ciphers",e.description="Encodes Strings using the Rail fence Cipher provided a key and an offset",e.infoURL="https://wikipedia.org/wiki/Rail_fence_cipher",e.inputType="string",e.outputType="string",e.args=[{name:"Key",type:"number",value:2},{name:"Offset",type:"number",value:0}],e}return p()(t,e),o()(t,[{key:"run",value:function(e,t){var r=A()(t,2),n=r[0],i=r[1],a=e;if(n<2)throw new y.a("Key has to be bigger than 2");if(n>a.length)throw new y.a("Key should be smaller than the plain text's length");if(i<0)throw new y.a("Offset has to be a positive integer");for(var o=2*(n-1),s=new Array(n).fill(""),u=0;u<a.length;u++){s[n-1-Math.abs(o/2-(u+i)%o)]+=a[u]}return s.join("").trim()}}]),t}(h.a),ae=function(e){function t(){var e;return i()(this,t),(e=u()(this,l()(t).call(this))).name="Triple DES Decrypt",e.module="Ciphers",e.description="Triple DES applies DES three times to each block to increase key size.<br><br><b>Key:</b> Triple DES uses a key length of 24 bytes (192 bits).<br>DES uses a key length of 8 bytes (64 bits).<br><br><b>IV:</b> The Initialization Vector should be 8 bytes long. If not entered, it will default to 8 null bytes.<br><br><b>Padding:</b> In CBC and ECB mode, PKCS#7 padding will be used.",e.infoURL="https://wikipedia.org/wiki/Triple_DES",e.inputType="string",e.outputType="string",e.args=[{name:"Key",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]},{name:"IV",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]},{name:"Mode",type:"option",value:["CBC","CFB","OFB","CTR","ECB"]},{name:"Input",type:"option",value:["Hex","Raw"]},{name:"Output",type:"option",value:["Raw","Hex"]}],e}return p()(t,e),o()(t,[{key:"run",value:function(e,t){var r=d.b.convertToByteString(t[0].string,t[0].option),n=d.b.convertToByteArray(t[1].string,t[1].option),i=t[2],a=t[3],o=t[4];if(24!==r.length)throw new y.a(`Invalid key length: ${r.length} bytes\n\nTriple DES uses a key length of 24 bytes (192 bits).\nDES uses a key length of 8 bytes (64 bits).`);if(8!==n.length&&"ECB"!==i)throw new y.a(`Invalid IV length: ${n.length} bytes\n\nTriple DES uses an IV length of 8 bytes (64 bits).\nMake sure you have specified the type correctly (e.g. Hex vs UTF8).`);e=d.b.convertToByteString(e,a);var s=E.a.cipher.createDecipher("3DES-"+i,r);if(s.start({iv:n}),s.update(E.a.util.createBuffer(e)),s.finish())return"Hex"===o?s.output.toHex():s.output.getBytes();throw new y.a("Unable to decrypt input with these parameters.")}}]),t}(h.a),oe=function(e){function t(){var e;return i()(this,t),(e=u()(this,l()(t).call(this))).name="Triple DES Encrypt",e.module="Ciphers",e.description="Triple DES applies DES three times to each block to increase key size.<br><br><b>Key:</b> Triple DES uses a key length of 24 bytes (192 bits).<br>DES uses a key length of 8 bytes (64 bits).<br><br>You can generate a password-based key using one of the KDF operations.<br><br><b>IV:</b> The Initialization Vector should be 8 bytes long. If not entered, it will default to 8 null bytes.<br><br><b>Padding:</b> In CBC and ECB mode, PKCS#7 padding will be used.",e.infoURL="https://wikipedia.org/wiki/Triple_DES",e.inputType="string",e.outputType="string",e.args=[{name:"Key",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]},{name:"IV",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]},{name:"Mode",type:"option",value:["CBC","CFB","OFB","CTR","ECB"]},{name:"Input",type:"option",value:["Raw","Hex"]},{name:"Output",type:"option",value:["Hex","Raw"]}],e}return p()(t,e),o()(t,[{key:"run",value:function(e,t){var r=d.b.convertToByteString(t[0].string,t[0].option),n=d.b.convertToByteArray(t[1].string,t[1].option),i=t[2],a=t[3],o=t[4];if(24!==r.length)throw new y.a(`Invalid key length: ${r.length} bytes\n\nTriple DES uses a key length of 24 bytes (192 bits).\nDES uses a key length of 8 bytes (64 bits).`);if(8!==n.length&&"ECB"!==i)throw new y.a(`Invalid IV length: ${n.length} bytes\n\nTriple DES uses an IV length of 8 bytes (64 bits).\nMake sure you have specified the type correctly (e.g. Hex vs UTF8).`);e=d.b.convertToByteString(e,a);var s=E.a.cipher.createCipher("3DES-"+i,r);return s.start({iv:n}),s.update(E.a.util.createBuffer(e)),s.finish(),"Hex"===o?s.output.toHex():s.output.getBytes()}}]),t}(h.a),se=function(e){function t(){var e;return i()(this,t),(e=u()(this,l()(t).call(this))).name="Vigenère Decode",e.module="Ciphers",e.description="The Vigenere cipher is a method of encrypting alphabetic text by using a series of different Caesar ciphers based on the letters of a keyword. It is a simple form of polyalphabetic substitution.",e.infoURL="https://wikipedia.org/wiki/Vigenère_cipher",e.inputType="string",e.outputType="string",e.args=[{name:"Key",type:"string",value:""}],e}return p()(t,e),o()(t,[{key:"run",value:function(e,t){var r,n,i,a="abcdefghijklmnopqrstuvwxyz",o=t[0].toLowerCase(),s="",u=0;if(!o)throw new y.a("No key entered");if(!/^[a-zA-Z]+$/.test(o))throw new y.a("The key must consist only of letters");for(var c=0;c<e.length;c++)a.indexOf(e[c])>=0?(i=o[(c-u)%o.length],r=a.indexOf(i),n=a.indexOf(e[c]),s+=a[(n-r+a.length)%26]):a.indexOf(e[c].toLowerCase())>=0?(i=o[(c-u)%o.length].toLowerCase(),r=a.indexOf(i),n=a.indexOf(e[c].toLowerCase()),s+=a[(n+a.length-r)%26].toUpperCase()):(s+=e[c],u++);return s}},{key:"highlight",value:function(e,t){return e}},{key:"highlightReverse",value:function(e,t){return e}}]),t}(h.a),ue=function(e){function t(){var e;return i()(this,t),(e=u()(this,l()(t).call(this))).name="Vigenère Encode",e.module="Ciphers",e.description="The Vigenere cipher is a method of encrypting alphabetic text by using a series of different Caesar ciphers based on the letters of a keyword. It is a simple form of polyalphabetic substitution.",e.infoURL="https://wikipedia.org/wiki/Vigenère_cipher",e.inputType="string",e.outputType="string",e.args=[{name:"Key",type:"string",value:""}],e}return p()(t,e),o()(t,[{key:"run",value:function(e,t){var r,n,i,a="abcdefghijklmnopqrstuvwxyz",o=t[0].toLowerCase(),s="",u=0;if(!o)throw new y.a("No key entered");if(!/^[a-zA-Z]+$/.test(o))throw new y.a("The key must consist only of letters");for(var c=0;c<e.length;c++)a.indexOf(e[c])>=0?(i=o[(c-u)%o.length],r=a.indexOf(i),n=a.indexOf(e[c]),s+=a[(r+n)%26]):a.indexOf(e[c].toLowerCase())>=0?(i=o[(c-u)%o.length].toLowerCase(),r=a.indexOf(i),n=a.indexOf(e[c].toLowerCase()),s+=a[(r+n)%26].toUpperCase()):(s+=e[c],u++);return s}},{key:"highlight",value:function(e,t){return e}},{key:"highlightReverse",value:function(e,t){return e}}]),t}(h.a),ce="undefined"==typeof self?{}:self.OpModules||{};ce.Ciphers={"A1Z26 Cipher Decode":v,"A1Z26 Cipher Encode":m,"AES Decrypt":b,"AES Encrypt":S,"Affine Cipher Decode":T,"Affine Cipher Encode":x,"Atbash Cipher":N,"Bifid Cipher Decode":L,"Bifid Cipher Encode":D,"Blowfish Decrypt":z,"Blowfish Encrypt":G,"DES Decrypt":q,"DES Encrypt":Y,"Derive EVP key":Q,"Derive PBKDF2 key":W,"Pseudo-Random Number Generator":Z,"RC2 Decrypt":J,"RC2 Encrypt":ee,RC4:te,"RC4 Drop":re,"Rail Fence Cipher Decode":ne,"Rail Fence Cipher Encode":ie,"Triple DES Decrypt":ae,"Triple DES Encrypt":oe,"Vigenère Decode":se,"Vigenère Encode":ue};t.default=ce},15:function(e,t,r){"use strict";r.d(t,"b",(function(){return a})),r.d(t,"a",(function(){return o}));var n=r(0),i=r(8);
/**
 * Base64 functions.
 *
 * @author n1474335 [n1474335@gmail.com]
 * @copyright Crown Copyright 2016
 * @license Apache-2.0
 */
function a(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"A-Za-z0-9+/=";if(!e)return"";if(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),"string"==typeof e&&(e=n.b.strToByteArray(e)),64!==(t=n.b.expandAlphRange(t).join("")).length&&65!==t.length)throw new i.a(`Invalid Base64 alphabet length (${t.length}): ${t}`);for(var r,a,o,s,u,c,l,f="",p=0;p<e.length;)s=(r=e[p++])>>2,u=(3&r)<<4|(a=e[p++])>>4,c=(15&a)<<2|(o=e[p++])>>6,l=63&o,isNaN(a)?c=l=64:isNaN(o)&&(l=64),f+=t.charAt(s)+t.charAt(u)+t.charAt(c)+t.charAt(l);return f}function o(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"A-Za-z0-9+/=",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"string",a=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if(!e)return"string"===r?"":[];if(t=t||"A-Za-z0-9+/=",64!==(t=n.b.expandAlphRange(t).join("")).length&&65!==t.length)throw new i.a(`Invalid Base64 alphabet length (${t.length}): ${t}`);var o,s,u,c,l,f,p=[],h=0;if(a){var d=new RegExp("[^"+t.replace(/[[\]\\\-^$]/g,"\\$&")+"]","g");e=e.replace(d,"")}for(;h<e.length;)o=t.indexOf(e.charAt(h++))<<2|(c=-1===(c=t.indexOf(e.charAt(h++)||"="))?64:c)>>4,s=(15&c)<<4|(l=-1===(l=t.indexOf(e.charAt(h++)||"="))?64:l)>>2,u=(3&l)<<6|(f=-1===(f=t.indexOf(e.charAt(h++)||"="))?64:f),p.push(o),64!==l&&p.push(s),64!==f&&p.push(u);return"string"===r?n.b.byteArrayToUtf8(p):p}},16:function(e,t,r){"use strict";r.d(t,"b",(function(){return i})),r.d(t,"c",(function(){return a})),r.d(t,"a",(function(){return o}));var n=r(0);
/**
 * Hexadecimal functions.
 *
 * @author n1474335 [n1474335@gmail.com]
 * @copyright Crown Copyright 2016
 * @license Apache-2.0
 */function i(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:" ",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;if(!e)return"";e instanceof ArrayBuffer&&(e=new Uint8Array(e));for(var a="",o="0x"===t||"\\x"===t,s=0;s<e.length;s++){var u=e[s].toString(16).padStart(r,"0");a+=o?t+u:u+t,n&&(a+=n),s!==e.length-1&&(s+1)%i==0&&(a+="\n")}var c=n.length+(o?0:t.length);return c?a.slice(0,-c):a}function a(e){if(!e)return"";e instanceof ArrayBuffer&&(e=new Uint8Array(e));for(var t=[],r=0;r<e.length;r++)t.push((e[r]>>>4).toString(16)),t.push((15&e[r]).toString(16));return t.join("")}function o(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Auto",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2;if("None"!==t){var i="Auto"===t?/[^a-f\d]|(0x)/gi:n.b.regexRep(t);e=e.replace(i,"")}for(var a=[],o=0;o<e.length;o+=r)a.push(parseInt(e.substr(o,r),16));return a}["Auto"].concat(["Space","Percent","Comma","Semi-colon","Colon","Line feed","CRLF","0x","0x with comma","\\x","None"])},18:function(e,t,r){"use strict";var n=r(12),i=r.n(n),a=r(7),o={Images:[{name:"Joint Photographic Experts Group image",extension:"jpg,jpeg,jpe,thm,mpo",mime:"image/jpeg",description:"",signature:{0:255,1:216,2:255,3:[192,196,219,221,224,225,226,227,228,229,231,232,234,235,236,237,238,254]},extractor:function(e,t){var r=new a.a(e.slice(t));for(;r.hasMore();){var n=r.getBytes(2);if(255!==n[0])throw new Error(`Invalid marker while parsing JPEG at pos ${r.position}: ${n}`);var i=0;switch(n[1]){case 216:case 1:break;case 217:return r.carve();case 192:case 193:case 194:case 195:case 196:case 197:case 198:case 199:case 200:case 201:case 202:case 203:case 204:case 205:case 206:case 207:case 219:case 222:case 224:case 225:case 226:case 227:case 228:case 229:case 230:case 231:case 232:case 233:case 234:case 235:case 236:case 237:case 238:case 239:case 254:i=r.readInt(2,"be"),r.position+=i-2;break;case 223:r.position++;break;case 220:case 221:r.position+=2;break;case 218:i=r.readInt(2,"be"),r.position+=i-2,r.continueUntil(255);break;case 0:case 208:case 209:case 210:case 211:case 212:case 213:case 214:case 215:default:r.continueUntil(255)}}throw new Error("Unable to parse JPEG successfully")}},{name:"Graphics Interchange Format image",extension:"gif",mime:"image/gif",description:"",signature:{0:71,1:73,2:70,3:56,4:[55,57],5:97},extractor:function(e,t){var r=new a.a(e.slice(t));r.continueUntil([33,255]),r.continueUntil([33,249]),r.moveForwardsBy(2);for(;r.hasMore();){for(r.moveForwardsBy(r.readInt(1)+1),r.moveForwardsBy(11);r.getBytes(2)!==[33,249]&&(r.moveBackwardsBy(2),r.moveForwardsBy(r.readInt(1)),r.readInt(1));)r.moveBackwardsBy(1);if(59===r.readInt(1))break;r.moveForwardsBy(1)}return r.carve()}},{name:"Portable Network Graphics image",extension:"png",mime:"image/png",description:"",signature:{0:137,1:80,2:78,3:71,4:13,5:10,6:26,7:10},extractor:function(e,t){var r=new a.a(e.slice(t));r.moveForwardsBy(8);var n=0,i="";for(;"IEND"!==i;)n=r.readInt(4,"be"),i=r.readString(4),r.moveForwardsBy(n+4);return r.carve()}},{name:"WEBP Image",extension:"webp",mime:"image/webp",description:"",signature:{8:87,9:69,10:66,11:80},extractor:null},{name:"Camera Image File Format",extension:"crw",mime:"image/x-canon-crw",description:"",signature:{6:72,7:69,8:65,9:80,10:67,11:67,12:68,13:82},extractor:null},{name:"Canon CR2 raw image",extension:"cr2",mime:"image/x-canon-cr2",description:"",signature:[{0:73,1:73,2:42,3:0,8:67,9:82},{0:77,1:77,2:0,3:42,8:67,9:82}],extractor:null},{name:"Tagged Image File Format image",extension:"tif",mime:"image/tiff",description:"",signature:[{0:73,1:73,2:42,3:0},{0:77,1:77,2:0,3:42}],extractor:null},{name:"Bitmap image",extension:"bmp",mime:"image/bmp",description:"",signature:{0:66,1:77,7:0,9:0,14:[12,40,56,64,108,124],15:0,16:0,17:0},extractor:function(e,t){var r=new a.a(e.slice(t));r.moveForwardsBy(2);var n=r.readInt(4,"le");return r.moveForwardsBy(n-6),r.carve()}},{name:"JPEG Extended Range image",extension:"jxr",mime:"image/vnd.ms-photo",description:"",signature:{0:73,1:73,2:188},extractor:null},{name:"Photoshop image",extension:"psd",mime:"image/vnd.adobe.photoshop",description:"",signature:{0:56,1:66,2:80,3:83,4:0,5:1,6:0,7:0,8:0,9:0,10:0,11:0},extractor:null},{name:"Photoshop Large Document",extension:"psb",mime:"application/x-photoshop",description:"",signature:{0:56,1:66,2:80,3:83,4:0,5:2,6:0,7:0,8:0,9:0,10:0,11:0,12:0},extractor:null},{name:"Paint Shop Pro image",extension:"psp",mime:"image/psp",description:"",signature:[{0:80,1:97,2:105,3:110,4:116,5:32,6:83,7:104,8:111,9:112,10:32,11:80,12:114,13:111,14:32,15:73,16:109},{0:126,1:66,2:75,3:0}],extractor:null},{name:"The GIMP image",extension:"xcf",mime:"image/x-xcf",description:"",signature:{0:103,1:105,2:109,3:112,4:32,5:120,6:99,7:102,8:32,9:[102,118],10:[105,48],11:[108,48],12:[101,49,50,51]},extractor:null},{name:"Icon image",extension:"ico",mime:"image/x-icon",description:"",signature:{0:0,1:0,2:1,3:0,4:[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21],5:0,6:[16,32,48,64,128],7:[16,32,48,64,128],9:0,10:[0,1]},extractor:function(e,t){var r=new a.a(e.slice(t));r.moveTo(4);var n=r.readInt(2,"le");r.moveForwardsBy(8+16*(n-1));var i=r.readInt(4,"le"),o=r.readInt(4,"le");return r.moveTo(o+i),r.carve()}},{name:"Radiance High Dynamic Range image",extension:"hdr",mime:"image/vnd.radiance",description:"",signature:{0:35,1:63,2:82,3:65,4:68,5:73,6:65,7:78,8:67,9:69,10:10},extractor:null},{name:"Sony ARW image",extension:"arw",mime:"image/x-raw",description:"",signature:{0:5,1:0,2:0,3:0,4:65,5:87,6:49,7:46},extractor:null},{name:"Fujifilm Raw Image",extension:"raf",mime:"image/x-raw",description:"",signature:{0:70,1:85,2:74,3:73,4:70,5:73,6:76,7:77,8:67,9:67,10:68,11:45,12:82,13:65,14:87},extractor:null},{name:"Minolta RAW image",extension:"mrw",mime:"image/x-raw",description:"",signature:{0:0,1:77,2:82,3:77},extractor:null},{name:"Adobe Bridge Thumbnail Cache",extension:"bct",mime:"application/octet-stream",description:"",signature:{0:108,1:110,2:98,3:116,4:2,5:0,6:0,7:0},extractor:null},{name:"Microsoft Document Imaging",extension:"mdi",mime:"image/vnd.ms-modi",description:"",signature:{0:69,1:80,2:42,3:0},extractor:null},{name:"Joint Photographic Experts Group image (under Base64)",extension:"B64",mime:"application/octet-stream",description:"",signature:{0:47,1:57,2:106,3:47,4:52},extractor:null},{name:"Portable Network Graphics image (under Base64)",extension:"B64",mime:"application/octet-stream",description:"",signature:{0:105,1:86,2:66,3:79,4:82,5:119,6:48},extractor:null},{name:"AutoCAD Drawing",extension:"dwg,123d",mime:"application/acad",description:"",signature:{0:65,1:67,2:49,3:48,4:[48,49],5:[48,49,50,51,52,53],6:0},extractor:null},{name:"AutoCAD Drawing",extension:"dwg,dwt",mime:"application/acad",description:"",signature:[{0:65,1:67,2:49,3:48,4:49,5:56,6:0},{0:65,1:67,2:49,3:48,4:50,5:52,6:0},{0:65,1:67,2:49,3:48,4:50,5:55,6:0}],extractor:null}],Video:[{name:"Matroska Multimedia Container",extension:"mkv",mime:"video/x-matroska",description:"",signature:{31:109,32:97,33:116,34:114,35:111,36:115,37:107,38:97},extractor:null},{name:"WEBM video",extension:"webm",mime:"video/webm",description:"",signature:{0:26,1:69,2:223,3:163},extractor:null},{name:"Flash MP4 video",extension:"f4v",mime:"video/mp4",description:"",signature:{4:102,5:116,6:121,7:112,8:[102,70],9:52,10:[118,86],11:32},extractor:null},{name:"MPEG-4 video",extension:"mp4",mime:"video/mp4",description:"",signature:[{0:0,1:0,2:0,3:[24,32],4:102,5:116,6:121,7:112},{0:51,1:103,2:112,3:53},{0:0,1:0,2:0,3:28,4:102,5:116,6:121,7:112,8:109,9:112,10:52,11:50,16:109,17:112,18:52,19:49,20:109,21:112,22:52,23:50,24:105,25:115,26:111,27:109}],extractor:null},{name:"M4V video",extension:"m4v",mime:"video/x-m4v",description:"",signature:{0:0,1:0,2:0,3:28,4:102,5:116,6:121,7:112,8:77,9:52,10:86},extractor:null},{name:"Quicktime video",extension:"mov",mime:"video/quicktime",description:"",signature:{0:0,1:0,2:0,3:20,4:102,5:116,6:121,7:112},extractor:null},{name:"Audio Video Interleave",extension:"avi",mime:"video/x-msvideo",description:"",signature:{0:82,1:73,2:70,3:70,8:65,9:86,10:73},extractor:null},{name:"Windows Media Video",extension:"wmv",mime:"video/x-ms-wmv",description:"",signature:{0:48,1:38,2:178,3:117,4:142,5:102,6:207,7:17,8:166,9:217},extractor:null},{name:"MPEG video",extension:"mpg",mime:"video/mpeg",description:"",signature:{0:0,1:0,2:1,3:186},extractor:null},{name:"Flash Video",extension:"flv",mime:"video/x-flv",description:"",signature:{0:70,1:76,2:86,3:1},extractor:function(e,t){var r=new a.a(e.slice(t));r.moveForwardsBy(5);var n=r.readInt(4,"be");r.moveForwardsBy(n-9);var i=-11;for(;r.hasMore();){var o=r.readInt(4,"be"),s=r.readInt(1);if([8,9,18].indexOf(s)<0){r.moveBackwardsBy(1);break}if(o!==i+11){r.moveBackwardsBy(i+11+5);break}i=r.readInt(3,"be"),r.moveForwardsBy(7+i)}return r.carve()}},{name:"OGG Video",extension:"ogv,ogm,opus,ogx",mime:"video/ogg",description:"",signature:[{0:79,1:103,2:103,3:83,4:0,5:2,28:1,29:118,30:105,31:100,32:101,33:111},{0:79,1:103,2:103,3:83,4:0,5:2,28:128,29:116,30:104,31:101,32:111,33:114,34:97},{0:79,1:103,2:103,3:83,4:0,5:2,28:102,29:105,30:115,31:104,32:101,33:97,34:100}],extractor:null}],Audio:[{name:"Waveform Audio",extension:"wav",mime:"audio/x-wav",description:"",signature:{0:82,1:73,2:70,3:70,8:87,9:65,10:86,11:69},extractor:function(e,t){var r=new a.a(e.slice(t));return r.moveTo(4),r.moveTo(r.readInt(4,"le")),r.carve()}},{name:"OGG audio",extension:"ogg",mime:"audio/ogg",description:"",signature:{0:79,1:103,2:103,3:83},extractor:null},{name:"Musical Instrument Digital Interface audio",extension:"midi",mime:"audio/midi",description:"",signature:{0:77,1:84,2:104,3:100},extractor:null},{name:"MPEG-3 audio",extension:"mp3",mime:"audio/mpeg",description:"",signature:[{0:73,1:68,2:51},{0:255,1:251}],extractor:null},{name:"MPEG-4 Part 14 audio",extension:"m4a",mime:"audio/m4a",description:"",signature:[{4:102,5:116,6:121,7:112,8:77,9:52,10:65},{0:77,1:52,2:65,3:32}],extractor:null},{name:"Free Lossless Audio Codec",extension:"flac",mime:"audio/x-flac",description:"",signature:{0:102,1:76,2:97,3:67},extractor:null},{name:"Adaptive Multi-Rate audio codec",extension:"amr",mime:"audio/amr",description:"",signature:{0:35,1:33,2:65,3:77,4:82,5:10},extractor:null},{name:"Audacity",extension:"au",mime:"audio/x-au",description:"",signature:{0:100,1:110,2:115,3:46,24:65,25:117,26:100,27:97,28:99,29:105,30:116,31:121,32:66,33:108,34:111,35:99,36:107,37:70,38:105,39:108,40:101},extractor:null},{name:"Audacity Block",extension:"auf",mime:"application/octet-stream",description:"",signature:{0:65,1:117,2:100,3:97,4:99,5:105,6:116,7:121,8:66,9:108,10:111,11:99,12:107,13:70,14:105,15:108,16:101},extractor:null},{name:"Audio Interchange File",extension:"aif",mime:"audio/x-aiff",description:"",signature:{0:70,1:79,2:82,3:77,8:65,9:73,10:70,11:70},extractor:null},{name:"Audio Interchange File (compressed)",extension:"aifc",mime:"audio/x-aifc",description:"",signature:{0:70,1:79,2:82,3:77,8:65,9:73,10:70,11:67},extractor:null}],Documents:[{name:"Portable Document Format",extension:"pdf",mime:"application/pdf",description:"",signature:{0:37,1:80,2:68,3:70},extractor:function(e,t){var r=new a.a(e.slice(t));return r.continueUntil([37,37,69,79,70]),r.moveForwardsBy(5),r.consumeIf(13),r.consumeIf(10),r.carve()}},{name:"Portable Document Format (under Base64)",extension:"B64",mime:"application/octet-stream",description:"",signature:{0:65,1:74,2:86,3:66,4:69,5:82,6:105},extractor:null},{name:"Adobe PostScript",extension:"ps,eps,ai,pfa",mime:"application/postscript",description:"",signature:{0:37,1:33,2:80,3:83,4:45,5:65,6:100,7:111,8:98,9:101},extractor:null},{name:"PostScript",extension:"ps",mime:"application/postscript",description:"",signature:{0:37,1:33},extractor:null},{name:"Encapsulated PostScript",extension:"eps,ai",mime:"application/eps",description:"",signature:{0:197,1:208,2:211,3:198},extractor:null},{name:"Rich Text Format",extension:"rtf",mime:"application/rtf",description:"",signature:{0:123,1:92,2:114,3:116},extractor:function(e,t){var r=new a.a(e.slice(t)),n=0;if(123!==r.readInt(1))throw new Error("Not a valid RTF file");n++;for(;n>0&&r.hasMore();)switch(r.readInt(1)){case 123:n++;break;case 125:n--;break;case 92:r.consumeIf(92),r.position++}return r.carve()}},{name:"Microsoft Office document/OLE2",extension:"ole2,doc,xls,dot,ppt,xla,ppa,pps,pot,msi,sdw,db,vsd,msg",mime:"application/msword,application/vnd.ms-excel,application/vnd.ms-powerpoint",description:"Microsoft Office documents",signature:{0:208,1:207,2:17,3:224,4:161,5:177,6:26,7:225},extractor:null},{name:"Microsoft Office document/OLE2 (under Base64)",extension:"B64",mime:"application/octet-stream",description:"",signature:{0:48,1:77,2:56,3:82,4:52,5:75,6:71,7:120},extractor:null},{name:"Microsoft Office 2007+ document",extension:"docx,xlsx,pptx",mime:"application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.openxmlformats-officedocument.presentationml.presentation",description:"",signature:{38:95,39:84,40:121,41:112,42:101,43:115,44:93,45:46,46:120,47:109,48:108},extractor:s},{name:"Microsoft Access database",extension:"mdb,mda,mde,mdt,fdb,psa",mime:"application/msaccess",description:"",signature:{0:0,1:1,2:0,3:0,4:83,5:116,6:97,7:110,8:100,9:97,10:114,11:100,12:32,13:74,14:101,15:116},extractor:null},{name:"Microsoft Access 2007+ database",extension:"accdb,accde,accda,accdu",mime:"application/msaccess",description:"",signature:{0:0,1:1,2:0,3:0,4:83,5:116,6:97,7:110,8:100,9:97,10:114,11:100,12:32,13:65,14:67,15:69,16:32},extractor:null},{name:"Microsoft OneNote document",extension:"one",mime:"application/onenote",description:"",signature:{0:228,1:82,2:92,3:123,4:140,5:216,6:167,7:77,8:174,9:177,10:83,11:120,12:208,13:41,14:150,15:211},extractor:null},{name:"Outlook Express database",extension:"dbx",mime:"application/octet-stream",description:"",signature:{0:207,1:173,2:18,3:254,4:[48,197,198,199],11:17},extractor:null},{name:"Personal Storage Table (Outlook)",extension:"pst,ost,fdb,pab",mime:"application/octet-stream",description:"",signature:{0:33,1:66,2:68,3:78},extractor:null},{name:"Microsoft Exchange Database",extension:"edb",mime:"application/octet-stream",description:"",signature:{4:239,5:205,6:171,7:137,8:[32,35],9:6,10:0,11:0,12:[0,1],13:0,14:0,15:0},extractor:null},{name:"WordPerfect document",extension:"wpd,wp,wp5,wp6,wpp,bk!,wcm",mime:"application/wordperfect",description:"",signature:{0:255,1:87,2:80,3:67,7:[0,1,2],8:1,9:10},extractor:null},{name:"EPUB e-book",extension:"epub",mime:"application/epub+zip",description:"",signature:{0:80,1:75,2:3,3:4,30:109,31:105,32:109,33:101,34:116,35:121,36:112,37:101,38:97,39:112,40:112,41:108,42:105,43:99,44:97,45:116,46:105,47:111,48:110,49:47,50:101,51:112,52:117,53:98,54:43,55:122,56:105,57:112},extractor:s}],Applications:[{name:"Windows Portable Executable",extension:"exe,dll,drv,vxd,sys,ocx,vbx,com,fon,scr",mime:"application/vnd.microsoft.portable-executable",description:"",signature:{0:77,1:90,3:[0,1,2],5:[0,1,2]},extractor:function(e,t){var r=new a.a(e.slice(t));r.moveTo(60);var n=r.readInt(4,"le");r.moveTo(n),r.moveForwardsBy(6);var i=r.readInt(2,"le");r.moveForwardsBy(16);var o=523===r.readInt(2,"le")?112:96;r.moveForwardsBy(o-2),r.moveForwardsBy(32);var s=r.readInt(4,"le"),u=r.readInt(4,"le");if(s>0)return r.moveTo(s+u),r.carve();r.moveForwardsBy(88),r.moveForwardsBy(40*(i-1)),r.moveForwardsBy(16);var c=r.readInt(4,"le"),l=r.readInt(4,"le");return r.moveTo(l+c),r.carve()}},{name:"Executable and Linkable Format",extension:"elf,bin,axf,o,prx,so",mime:"application/x-executable",description:"Executable and Linkable Format file. No standard file extension.",signature:{0:127,1:69,2:76,3:70},extractor:function(e,t){var r=new a.a(e.slice(t));r.moveForwardsBy(4);var n=1===r.readInt(1),i=1===r.readInt(1)?"le":"be";r.moveForwardsBy(n?26:34);var o=n?r.readInt(4,i):r.readInt(8,i);r.moveForwardsBy(10);var s=r.readInt(2,i),u=r.readInt(2,i);return r.moveTo(o),r.moveForwardsBy(s*u),r.carve()}},{name:"MacOS Mach-O object",extension:"dylib",mime:"application/octet-stream",description:"",signature:[{0:202,1:254,2:186,3:190,4:0,5:0,6:0,7:[1,2,3]},{0:206,1:250,2:237,3:254,4:7,5:0,6:0,7:0,8:[1,2,3]}],extractor:u},{name:"MacOS Mach-O 64-bit object",extension:"dylib",mime:"application/octet-stream",description:"",signature:{0:207,1:250,2:237,3:254},extractor:u},{name:"Adobe Flash",extension:"swf",mime:"application/x-shockwave-flash",description:"",signature:{0:[67,70],1:87,2:83},extractor:null},{name:"Java Class",extension:"class",mime:"application/java-vm",description:"",signature:{0:202,1:254,2:186,3:190},extractor:null},{name:"Dalvik Executable",extension:"dex",mime:"application/octet-stream",description:"Dalvik Executable as used by Android",signature:{0:100,1:101,2:120,3:10,4:48,5:51,6:53,7:0},extractor:null},{name:"Google Chrome Extension",extension:"crx",mime:"application/crx",description:"Google Chrome extension or packaged app",signature:{0:67,1:114,2:50,3:52},extractor:null}],Archives:[{name:"PKZIP archive",extension:"zip",mime:"application/zip",description:"",signature:{0:80,1:75,2:[3,5,7],3:[4,6,8]},extractor:s},{name:"PKZIP archive (under Base64)",extension:"B64",mime:"application/octet-stream",description:"",signature:{0:85,1:69,2:115,3:68,4:66,5:66},extractor:null},{name:"TAR archive",extension:"tar",mime:"application/x-tar",description:"",signature:{257:117,258:115,259:116,260:97,261:114},extractor:function(e,t){var r=new a.a(e.slice(t));for(;r.hasMore();){if(r.moveForwardsBy(257),r.getBytes(5).join("")!==[117,115,116,97,114].join("")){r.moveBackwardsBy(262);break}r.moveBackwardsBy(138);var n=0;r.getBytes(11).forEach((function(e,t){n+=(e-48).toString()})),n=512*Math.ceil(parseInt(n,8)/512),r.moveForwardsBy(n+377)}return r.consumeWhile(0),r.carve()}},{name:"Roshal Archive",extension:"rar",mime:"application/x-rar-compressed",description:"",signature:{0:82,1:97,2:114,3:33,4:26,5:7,6:[0,1]},extractor:null},{name:"Gzip",extension:"gz",mime:"application/gzip",description:"",signature:{0:31,1:139,2:8},extractor:function(e,t){var r=new a.a(e.slice(t));r.moveForwardsBy(3);var n=r.readInt(1);if(r.moveForwardsBy(4),r.readInt(1),r.moveForwardsBy(1),4&n){var i=r.readInt(2,"le");r.moveForwardsby(i)}8&n&&(r.continueUntil(0),r.moveForwardsBy(1));16&n&&(r.continueUntil(0),r.moveForwardsBy(1));2&n&&r.moveForwardsBy(2);return d(r),r.moveForwardsBy(8),r.carve()}},{name:"Bzip2",extension:"bz2",mime:"application/x-bzip2",description:"",signature:{0:66,1:90,2:104},extractor:function(e,t){for(var r=new a.a(e.slice(t)),n=[[119,36,83,133,9],[238,72,167,10,18],[220,145,78,20,36],[185,34,156,40,72],[114,69,56,80,144],[187,146,41,194,132],[93,201,20,225,66],[46,228,138,112,161],[23,114,69,56,80]],i=0;i<n.length&&(r.continueUntil(n[i]),r.getBytes(5).join("")!==n[i].join(""));i++)r.moveTo(0);return r.moveForwardsBy(4),r.carve()}},{name:"7zip",extension:"7z",mime:"application/x-7z-compressed",description:"",signature:{0:55,1:122,2:188,3:175,4:39,5:28},extractor:null},{name:"Zlib Deflate",extension:"zlib",mime:"application/x-deflate",description:"",signature:{0:120,1:[1,156,218,94]},extractor:function(e,t){var r=new a.a(e.slice(t));r.moveForwardsBy(1),32&r.readInt(1)&&r.moveForwardsBy(4);return d(r),r.moveForwardsBy(4),r.carve()}},{name:"xz compression",extension:"xz",mime:"application/x-xz",description:"",signature:{0:253,1:55,2:122,3:88,4:90,5:0},extractor:function(e,t){var r=new a.a(e.slice(t));return r.continueUntil([0,0,0,0,4,89,90]),r.moveForwardsBy(7),r.carve()}},{name:"Tarball",extension:"tar.z",mime:"application/x-gtar",description:"",signature:{0:31,1:[157,160]},extractor:null},{name:"ISO disk image",extension:"iso",mime:"application/octet-stream",description:"ISO 9660 CD/DVD image file",signature:[{32769:67,32770:68,32771:48,32772:48,32773:49},{34817:67,34818:68,34819:48,34820:48,34821:49},{36865:67,36866:68,36867:48,36868:48,36869:49}],extractor:null},{name:"Virtual Machine Disk",extension:"vmdk",mime:"application/vmdk,application/x-virtualbox-vmdk",description:"",signature:{0:75,1:68,2:77,3:86,5:0,6:0,7:0},extractor:null},{name:"Virtual Hard Drive",extension:"vhd",mime:"application/x-vhd",description:"",signature:{0:99,1:111,2:110,3:101,4:99,5:116,6:105,7:120},extractor:null},{name:"Macintosh disk image",extension:"dmf,dmg",mime:"application/octet-stream",description:"",signature:{0:120,1:1,2:115,3:13,4:98,5:98,6:96,7:96},extractor:null},{name:"ARJ Archive",extension:"arj",mime:"application/x-arj-compressed",description:"",signature:{0:96,1:234,8:[0,16,20],9:0,10:2},extractor:null},{name:"WinAce Archive",extension:"ace",mime:"application/x-ace-compressed",description:"",signature:{7:42,8:42,9:65,10:67,11:69,12:42,13:42},extractor:null},{name:"Macintosh BinHex Encoded File",extension:"hqx",mime:"application/mac-binhex",description:"",signature:{11:109,12:117,13:115,14:116,15:32,16:98,17:101,18:32,19:99,20:111,21:110,22:118,23:101,24:114,25:116,26:101,27:100,28:32,29:119,30:105,31:116,32:104,33:32,34:66,35:105,36:110,37:72,38:101,39:120},extractor:null},{name:"ALZip Archive",extension:"alz",mime:"application/octet-stream",description:"",signature:{0:65,1:76,2:90,3:1,4:10,5:0,6:0,7:0},extractor:null},{name:"KGB Compressed Archive",extension:"kgb",mime:"application/x-kgb-compressed",description:"",signature:{0:75,1:71,2:66,3:95,4:97,5:114,6:99,7:104,8:32,9:45},extractor:null},{name:"Microsoft Cabinet",extension:"cab",mime:"vnd.ms-cab-compressed",description:"",signature:{0:77,1:83,2:67,3:70,4:0,5:0,6:0,7:0},extractor:null},{name:"Jar Archive",extension:"jar",mime:"application/java-archive",description:"",signature:{0:95,1:39,2:168,3:137},extractor:null},{name:"lzop compressed",extension:"lzop,lzo",mime:"application/x-lzop",description:"",signature:{0:137,1:76,2:90,3:79,4:0,5:13,6:10,7:26},extractor:null},{name:"Linux deb",extension:"deb",mime:"application/vnd.debian.binary-package",description:"",signature:{0:33,1:60,2:97,3:114,4:99,5:104,6:62},extractor:null},{name:"Apple Disk Image",extension:"dmg",mime:"application/x-apple-diskimage",description:"",signature:{0:120,1:1,2:115,3:13,4:98,5:98,6:96},extractor:null}],Miscellaneous:[{name:"UTF-8 text",extension:"txt",mime:"text/plain",description:"UTF-8 encoded Unicode byte order mark, commonly but not exclusively seen in text files.",signature:{0:239,1:187,2:191},extractor:null},{name:"UTF-32 LE text",extension:"utf32le",mime:"charset/utf32le",description:"Little-endian UTF-32 encoded Unicode byte order mark.",signature:{0:255,1:254,2:0,3:0},extractor:null},{name:"UTF-16 LE text",extension:"utf16le",mime:"charset/utf16le",description:"Little-endian UTF-16 encoded Unicode byte order mark.",signature:{0:255,1:254},extractor:null},{name:"Web Open Font Format",extension:"woff",mime:"application/font-woff",description:"",signature:{0:119,1:79,2:70,3:70,4:0,5:1,6:0,7:0},extractor:null},{name:"Web Open Font Format 2",extension:"woff2",mime:"application/font-woff",description:"",signature:{0:119,1:79,2:70,3:50,4:0,5:1,6:0,7:0},extractor:null},{name:"Embedded OpenType font",extension:"eot",mime:"application/octet-stream",description:"",signature:[{8:2,9:0,10:1,34:76,35:80},{8:1,9:0,10:0,34:76,35:80},{8:2,9:0,10:2,34:76,35:80}],extractor:null},{name:"TrueType Font",extension:"ttf",mime:"application/font-sfnt",description:"",signature:{0:0,1:1,2:0,3:0,4:0},extractor:null},{name:"OpenType Font",extension:"otf",mime:"application/font-sfnt",description:"",signature:{0:79,1:84,2:84,3:79,4:0},extractor:null},{name:"SQLite",extension:"sqlite",mime:"application/x-sqlite3",description:"",signature:{0:83,1:81,2:76,3:105},extractor:function(e,t){var r=new a.a(e.slice(t));r.moveTo(16);var n=r.readInt(2);r.moveTo(28);var i=r.readInt(4);return r.moveTo(n*i),r.carve()}},{name:"BitTorrent link",extension:"torrent",mime:"application/x-bittorrent",description:"",signature:[{0:100,1:56,2:58,3:97,4:110,5:110,6:111,7:117,8:110,9:99,10:101,11:35,12:35,13:58},{0:100,1:52,2:58,3:105,4:110,5:102,6:111,7:100,8:[52,53,54],9:58}],extractor:null},{name:"Cryptocurrency wallet",extension:"wallet",mime:"application/octet-stream",description:"",signature:{0:0,1:0,2:0,3:0,4:1,5:0,6:0,7:0,8:0,9:0,10:0,11:0,12:98,13:49,14:5,15:0},extractor:null},{name:"Registry fragment",extension:"hbin",mime:"application/octet-stream",description:"",signature:{0:104,1:98,2:105,3:110,4:0},extractor:null},{name:"Registry script",extension:"rgs",mime:"application/octet-stream",description:"",signature:{0:72,1:75,2:67,3:82,4:13,5:10,6:92,7:123},extractor:null},{name:"WinNT Registry Hive",extension:"registry",mime:"application/octet-stream",description:"",signature:{0:114,1:101,2:103,3:102},extractor:null},{name:"Windows Event Log",extension:"evt",mime:"application/octet-stream",description:"",signature:{0:48,1:0,2:0,3:0,4:76,5:102,6:76,7:101},extractor:function(e,t){var r=new a.a(e.slice(t));r.moveTo(20);var n=r.readInt(4,"le");r.moveTo(n);var i=r.readInt(4,"le");return r.moveForwardsBy(i-4),r.carve()}},{name:"Windows Event Log",extension:"evtx",mime:"application/octet-stream",description:"",signature:{0:69,1:108,2:102,3:70,4:105,5:108,6:101},extractor:function(e,t){var r=new a.a(e.slice(t));r.moveTo(40);var n=r.readInt(4,"le")-44;r.moveForwardsBy(n);for(;r.hasMore()&&r.getBytes(7).join("")===[69,108,102,67,104,110,107].join("");)r.moveForwardsBy(65529);return r.consumeWhile(0),r.carve()}},{name:"Windows Pagedump",extension:"dmp",mime:"application/octet-stream",description:"",signature:{0:80,1:65,2:71,3:69,4:68,5:85,6:[77,54],7:[80,52]},extractor:null},{name:"Windows Prefetch",extension:"pf",mime:"application/x-pf",description:"",signature:{0:[17,23,26],1:0,2:0,3:0,4:83,5:67,6:67,7:65},extractor:null},{name:"Windows Prefetch (Win 10)",extension:"pf",mime:"application/x-pf",description:"",signature:{0:77,1:65,2:77,3:4,7:0},extractor:null},{name:"PList (XML)",extension:"plist",mime:"application/xml",description:"",signature:{39:60,40:33,41:68,42:79,43:67,44:84,45:89,46:80,47:69,48:32,49:112,50:108,51:105,52:115,53:116},extractor:function(e,t){var r=new a.a(e.slice(t)),n=0;r.continueUntil([60,112,108,105,115,116]),r.moveForwardsBy(6),n++;for(;n>0&&r.hasMore();)60===r.readInt(1)&&(r.getBytes(5).join("")===[112,108,105,115,116].join("")?n++:r.moveBackwardsBy(5),r.getBytes(7).join("")===[47,112,108,105,115,116,62].join("")?n--:r.moveBackwardsBy(7));return r.consumeIf(10),r.carve()}},{name:"PList (binary)",extension:"bplist,plist,ipmeta,abcdp,mdbackup,mdinfo,strings,nib,ichat,qtz,webbookmark,webhistory",mime:"application/x-plist",description:"",signature:{0:98,1:112,2:108,3:105,4:115,5:116,6:48,7:48},extractor:null},{name:"MacOS X Keychain",extension:"keychain",mime:"application/octet-stream",description:"",signature:{0:107,1:121,2:99,3:104,4:0,5:1},extractor:null},{name:"TCP Packet",extension:"tcp",mime:"application/tcp",description:"",signature:{12:8,13:0,14:69,15:0,21:0,22:function(e){return e>=1&&e<=128},23:6},extractor:null},{name:"UDP Packet",extension:"udp",mime:"application/udp",description:"",signature:{12:8,13:0,14:69,15:0,16:[0,1,2,3,4,5],22:function(e){return e>=1&&e<=128},23:17},extractor:null},{name:"Compiled HTML",extension:"chm,chw,chi",mime:"application/vnd.ms-htmlhelp",description:"",signature:{0:73,1:84,2:83,3:70,4:3,5:0,6:0,7:0},extractor:null},{name:"Windows Password",extension:"pwl",mime:"application/octet-stream",description:"",signature:{0:227,1:130,2:133,3:150},extractor:null},{name:"Bitlocker recovery key",extension:"bitlocker",mime:"application/octet-stream",description:"",signature:{0:255,1:254,2:66,3:0,4:105,5:0,6:116,7:0,8:76,9:0,10:111,11:0,12:99,13:0,14:107,15:0,16:101,17:0,18:114,19:0,20:32,21:0},extractor:null},{name:"Certificate",extension:"cer,cat,p7b,p7c,p7m,p7s,swz,rsa,crl,crt,der",mime:"application/pkix-cert",description:"",signature:{0:48,1:130,4:[6,10,48]},extractor:null},{name:"Certificate",extension:"cat,swz,p7m",mime:"application/vnd.ms-pki.seccat",description:"",signature:{0:48,1:131,2:function(e){return 0!==e},5:6,6:9},extractor:null},{name:"PGP pubring",extension:"pkr,gpg",mime:"application/pgp-keys",description:"",signature:{0:153,1:1,2:[13,162],3:4},extractor:null},{name:"PGP secring",extension:"skr",mime:"application/pgp-keys",description:"",signature:[{0:149,1:1,2:207,3:4},{0:149,1:3,2:198,3:4}],extractor:null},{name:"PGP Safe",extension:"pgd",mime:"application/pgp-keys",description:"",signature:{0:80,1:71,2:80,3:100,4:77,5:65,6:73,7:78,8:96,9:1,10:0},extractor:null},{name:"Task Scheduler",extension:"job",mime:"application/octet-stream",description:"",signature:{0:[0,1,2,3],1:[5,6],2:1,3:0,20:70,21:0},extractor:null},{name:"Windows Shortcut",extension:"lnk",mime:"application/x-ms-shortcut",description:"",signature:{0:76,1:0,2:0,3:0,4:1,5:20,6:2,7:0,8:0,9:0,10:0,11:0,12:192,13:0,14:0,15:0,16:0,17:0,18:0,19:70},extractor:null},{name:"Bash",extension:"bash",mime:"application/bash",description:"",signature:{0:35,1:33,2:47,3:98,4:105,5:110,6:47,7:98,8:97,9:115,10:104},extractor:null},{name:"Shell",extension:"sh",mime:"application/sh",description:"",signature:{0:35,1:33,2:47,3:98,4:105,5:110,6:47,7:115,8:104},extractor:null},{name:"Python",extension:"py,pyc,pyd,pyo,pyw,pyz",mime:"application/python",description:"",signature:{0:35,1:33,2:47,3:117,4:115,5:114,6:47,7:98,8:105,9:110,10:47,11:112,12:121,13:116,14:104,15:111,16:110,17:[50,51,10,13]},extractor:null},{name:"Ruby",extension:"rb",mime:"application/ruby",description:"",signature:{0:35,1:33,2:47,3:117,4:115,5:114,6:47,7:98,8:105,9:110,10:47,11:114,12:117,13:98,14:121},extractor:null},{name:"perl",extension:"pl,pm,t,pod",mime:"application/perl",description:"",signature:{0:35,1:33,2:47,3:117,4:115,5:114,6:47,7:98,8:105,9:110,10:47,11:112,12:101,13:114,14:108},extractor:null},{name:"php",extension:"php,phtml,php3,php4,php5,php7,phps,php-s,pht,phar",mime:"application/php",description:"",signature:{0:60,1:63,2:112,3:104,4:112},extractor:null},{name:"Smile",extension:"sml",mime:"\tapplication/x-jackson-smile",description:"",signature:{0:58,1:41,2:10},extractor:null},{name:"Lua Bytecode",extension:"luac",mime:"application/x-lua",description:"",signature:{0:27,1:76,2:117,3:97},extractor:null},{name:"WebAssembly binary",extension:"wasm",mime:"application/octet-stream",description:"",signature:{0:0,1:97,2:115,3:109},extractor:null}]};function s(e,t){var r=new a.a(e.slice(t));r.continueUntil([80,75,5,6]),r.moveForwardsBy(20);var n=r.readInt(2,"le");return r.moveForwardsBy(n),r.carve()}function u(e,t){var r="207250237254",n="254237250207",i="206250237254";var o=new a.a(e.slice(t)),s=o.getBytes(4).join("");return o.moveTo(function(e,t,r){var n=28;t&&(n+=4),e.moveTo(16);var i=e.readInt(4,r);return function(e,t,r,n){for(var i=0,a=0;a<n;a++){e.moveTo(t);var o=e.readInt(4,r);25===o?(e.moveTo(t+48),i+=e.readInt(8,r),e.moveTo(t+4),t+=e.readInt(4,r)):1===o&&(e.moveTo(t+36),i+=e.readInt(4,r),e.moveTo(t+4),t+=e.readInt(4,r))}return i}(e,n,r,i)}(o,function(e){return e===r||e===n}(s),function(e){return e===i||e===r}(s)?"le":"be")),o.carve()}for(var c=new Array(288),l=0;l<c.length;l++)c[l]=l<=143?8:l<=255?9:l<=279?7:8;var f=m(c),p=m(new Array(30).fill(5)),h=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];function d(e){for(var t=0;!t;){t=e.readBits(1);var r=e.readBits(2);if(0===r){e.moveForwardsBy(1);var n=e.readInt(2,"le");e.moveForwardsBy(2+n)}else if(1===r)v(e,f,p);else{if(2!==r)throw new Error(`Invalid block type while parsing DEFLATE stream at pos ${e.position}`);for(var i=e.readBits(5)+257,a=e.readBits(5)+1,o=e.readBits(4)+4,s=new Uint8Array(h.length),u=0;u<o;u++)s[h[u]]=e.readBits(3);for(var c=m(s),l=new Uint8Array(i+a),d=void 0,g=void 0,y=void 0,E=0;E<i+a;)switch(d=C(e,c)){case 16:for(g=3+e.readBits(2);g--;)l[E++]=y;break;case 17:for(g=3+e.readBits(3);g--;)l[E++]=0;y=0;break;case 18:for(g=11+e.readBits(7);g--;)l[E++]=0;y=0;break;default:l[E++]=d,y=d}v(e,m(l.subarray(0,i)),m(l.subarray(i)))}}e.bitPos>0&&e.moveForwardsBy(1)}var g=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0],y=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13];function v(e,t,r){for(var n,i=0;(n=C(e,t))&&256!==n;){if(++i>1e4)throw new Error("Caught in probable infinite loop while parsing Huffman Block");n<256||(e.readBits(g[n-257]),n=C(e,r),e.readBits(y[n]))}}function m(e){for(var t=Math.max.apply(Math,e),r=Math.min.apply(Math,e),n=1<<t,i=new Uint32Array(n),a=1,o=0,s=2;a<=t;){for(var u=0;u<e.length;u++)if(e[u]===a){var c=void 0,l=void 0,f=void 0;for(c=0,l=o,f=0;f<a;f++)c=c<<1|1&l,l>>=1;for(var p=a<<16|u,h=c;h<n;h+=s)i[h]=p;o++}a++,o<<=1,s<<=1}return[i,t,r]}function C(e,t){var r=i()(t,2),n=r[0],a=r[1],o=n[e.readBits(a)&(1<<a)-1],s=o>>>16;if(s>a)throw new Error(`Invalid Huffman Code length while parsing DEFLATE block at pos ${e.position}: ${s}`);return e.moveBackwardsByBits(a-s),65535&o}r(0);
/**
 * File type functions
 *
 * @author n1474335 [n1474335@gmail.com]
 * @copyright Crown Copyright 2018
 * @license Apache-2.0
 *
 */
function E(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(e.length){for(var n=0;n<e.length;n++)if(b(e[n],t,r))return!0;return!1}return b(e,t,r)}function b(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;for(var n in e){var i=parseInt(n,10)+r;switch(typeof e[n]){case"number":if(t[i]!==e[n])return!1;break;case"object":if(e[n].indexOf(t[i])<0)return!1;break;case"function":if(!e[n](t[i]))return!1;break;default:throw new Error(`Unrecognised signature type at offset ${n}`)}}return!0}function S(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object.keys(o);if(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),!(e&&e.length>1))return[];var r=[],n={};for(var i in o)t.includes(i)&&(n[i]=o[i]);for(var a in n){n[a].forEach((function(t){E(t.signature,e)&&r.push(t)}))}return r}function B(e){return function(e,t){var r=S(t);if(!r||!r.length)return!1;if("string"==typeof e)return r.reduce((function(t,r){var n=!!r.mime.startsWith(e)&&r.mime;return t||n}),!1);if(e instanceof RegExp)return r.reduce((function(t,r){var n=!!e.test(r.mime)&&r.mime;return t||n}),!1);throw new Error("Invalid type input.")}("image",e)}r.d(t,"a",(function(){return S})),r.d(t,"b",(function(){return B}))},2:function(e,t){function r(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}e.exports=function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}},216:function(e,t,r){var n,i,a,o,s,u,c,l;e.exports=(l=r(52),r(439),r(440),i=(n=l).lib,a=i.Base,o=i.WordArray,s=n.algo,u=s.MD5,c=s.EvpKDF=a.extend({cfg:a.extend({keySize:4,hasher:u,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var r=this.cfg,n=r.hasher.create(),i=o.create(),a=i.words,s=r.keySize,u=r.iterations;a.length<s;){c&&n.update(c);var c=n.update(e).finalize(t);n.reset();for(var l=1;l<u;l++)c=n.finalize(c),n.reset();i.concat(c)}return i.sigBytes=4*s,i}}),n.EvpKDF=function(e,t,r){return c.create(r).compute(e,t)},l.EvpKDF)},22:function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}},23:function(e,t,r){!function(e){var t,r,n,i=String.fromCharCode;function a(e){for(var t,r,n=[],i=0,a=e.length;i<a;)(t=e.charCodeAt(i++))>=55296&&t<=56319&&i<a?56320==(64512&(r=e.charCodeAt(i++)))?n.push(((1023&t)<<10)+(1023&r)+65536):(n.push(t),i--):n.push(t);return n}function o(e){if(e>=55296&&e<=57343)throw Error("Lone surrogate U+"+e.toString(16).toUpperCase()+" is not a scalar value")}function s(e,t){return i(e>>t&63|128)}function u(e){if(0==(4294967168&e))return i(e);var t="";return 0==(4294965248&e)?t=i(e>>6&31|192):0==(4294901760&e)?(o(e),t=i(e>>12&15|224),t+=s(e,6)):0==(4292870144&e)&&(t=i(e>>18&7|240),t+=s(e,12),t+=s(e,6)),t+=i(63&e|128)}function c(){if(n>=r)throw Error("Invalid byte index");var e=255&t[n];if(n++,128==(192&e))return 63&e;throw Error("Invalid continuation byte")}function l(){var e,i;if(n>r)throw Error("Invalid byte index");if(n==r)return!1;if(e=255&t[n],n++,0==(128&e))return e;if(192==(224&e)){if((i=(31&e)<<6|c())>=128)return i;throw Error("Invalid continuation byte")}if(224==(240&e)){if((i=(15&e)<<12|c()<<6|c())>=2048)return o(i),i;throw Error("Invalid continuation byte")}if(240==(248&e)&&(i=(7&e)<<18|c()<<12|c()<<6|c())>=65536&&i<=1114111)return i;throw Error("Invalid UTF-8 detected")}e.version="3.0.0",e.encode=function(e){for(var t=a(e),r=t.length,n=-1,i="";++n<r;)i+=u(t[n]);return i},e.decode=function(e){t=a(e),r=t.length,n=0;for(var o,s=[];!1!==(o=l());)s.push(o);return function(e){for(var t,r=e.length,n=-1,a="";++n<r;)(t=e[n])>65535&&(a+=i((t-=65536)>>>10&1023|55296),t=56320|1023&t),a+=i(t);return a}(s)}}(t)},234:function(e,t,r){(function(e){var n=void 0!==e&&e||"undefined"!=typeof self&&self||window,i=Function.prototype.apply;function a(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new a(i.call(setTimeout,n,arguments),clearTimeout)},t.setInterval=function(){return new a(i.call(setInterval,n,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},a.prototype.unref=a.prototype.ref=function(){},a.prototype.close=function(){this._clearFn.call(n,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},r(271),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,r(26))},235:function(e,t,r){var n,i,a;e.exports=(a=r(52),i=(n=a).lib.WordArray,n.enc.Base64={stringify:function(e){var t=e.words,r=e.sigBytes,n=this._map;e.clamp();for(var i=[],a=0;a<r;a+=3)for(var o=(t[a>>>2]>>>24-a%4*8&255)<<16|(t[a+1>>>2]>>>24-(a+1)%4*8&255)<<8|t[a+2>>>2]>>>24-(a+2)%4*8&255,s=0;s<4&&a+.75*s<r;s++)i.push(n.charAt(o>>>6*(3-s)&63));var u=n.charAt(64);if(u)for(;i.length%4;)i.push(u);return i.join("")},parse:function(e){var t=e.length,r=this._map,n=this._reverseMap;if(!n){n=this._reverseMap=[];for(var a=0;a<r.length;a++)n[r.charCodeAt(a)]=a}var o=r.charAt(64);if(o){var s=e.indexOf(o);-1!==s&&(t=s)}return function(e,t,r){for(var n=[],a=0,o=0;o<t;o++)if(o%4){var s=r[e.charCodeAt(o-1)]<<o%4*2,u=r[e.charCodeAt(o)]>>>6-o%4*2;n[a>>>2]|=(s|u)<<24-a%4*8,a++}return i.create(n,a)}(e,t,n)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},a.enc.Base64)},236:function(e,t,r){var n;e.exports=(n=r(52),function(e){var t=n,r=t.lib,i=r.WordArray,a=r.Hasher,o=t.algo,s=[];!function(){for(var t=0;t<64;t++)s[t]=4294967296*e.abs(e.sin(t+1))|0}();var u=o.MD5=a.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var r=0;r<16;r++){var n=t+r,i=e[n];e[n]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8)}var a=this._hash.words,o=e[t+0],u=e[t+1],h=e[t+2],d=e[t+3],g=e[t+4],y=e[t+5],v=e[t+6],m=e[t+7],C=e[t+8],E=e[t+9],b=e[t+10],S=e[t+11],B=e[t+12],A=e[t+13],T=e[t+14],w=e[t+15],I=a[0],k=a[1],_=a[2],R=a[3];I=c(I,k,_,R,o,7,s[0]),R=c(R,I,k,_,u,12,s[1]),_=c(_,R,I,k,h,17,s[2]),k=c(k,_,R,I,d,22,s[3]),I=c(I,k,_,R,g,7,s[4]),R=c(R,I,k,_,y,12,s[5]),_=c(_,R,I,k,v,17,s[6]),k=c(k,_,R,I,m,22,s[7]),I=c(I,k,_,R,C,7,s[8]),R=c(R,I,k,_,E,12,s[9]),_=c(_,R,I,k,b,17,s[10]),k=c(k,_,R,I,S,22,s[11]),I=c(I,k,_,R,B,7,s[12]),R=c(R,I,k,_,A,12,s[13]),_=c(_,R,I,k,T,17,s[14]),I=l(I,k=c(k,_,R,I,w,22,s[15]),_,R,u,5,s[16]),R=l(R,I,k,_,v,9,s[17]),_=l(_,R,I,k,S,14,s[18]),k=l(k,_,R,I,o,20,s[19]),I=l(I,k,_,R,y,5,s[20]),R=l(R,I,k,_,b,9,s[21]),_=l(_,R,I,k,w,14,s[22]),k=l(k,_,R,I,g,20,s[23]),I=l(I,k,_,R,E,5,s[24]),R=l(R,I,k,_,T,9,s[25]),_=l(_,R,I,k,d,14,s[26]),k=l(k,_,R,I,C,20,s[27]),I=l(I,k,_,R,A,5,s[28]),R=l(R,I,k,_,h,9,s[29]),_=l(_,R,I,k,m,14,s[30]),I=f(I,k=l(k,_,R,I,B,20,s[31]),_,R,y,4,s[32]),R=f(R,I,k,_,C,11,s[33]),_=f(_,R,I,k,S,16,s[34]),k=f(k,_,R,I,T,23,s[35]),I=f(I,k,_,R,u,4,s[36]),R=f(R,I,k,_,g,11,s[37]),_=f(_,R,I,k,m,16,s[38]),k=f(k,_,R,I,b,23,s[39]),I=f(I,k,_,R,A,4,s[40]),R=f(R,I,k,_,o,11,s[41]),_=f(_,R,I,k,d,16,s[42]),k=f(k,_,R,I,v,23,s[43]),I=f(I,k,_,R,E,4,s[44]),R=f(R,I,k,_,B,11,s[45]),_=f(_,R,I,k,w,16,s[46]),I=p(I,k=f(k,_,R,I,h,23,s[47]),_,R,o,6,s[48]),R=p(R,I,k,_,m,10,s[49]),_=p(_,R,I,k,T,15,s[50]),k=p(k,_,R,I,y,21,s[51]),I=p(I,k,_,R,B,6,s[52]),R=p(R,I,k,_,d,10,s[53]),_=p(_,R,I,k,b,15,s[54]),k=p(k,_,R,I,u,21,s[55]),I=p(I,k,_,R,C,6,s[56]),R=p(R,I,k,_,w,10,s[57]),_=p(_,R,I,k,v,15,s[58]),k=p(k,_,R,I,A,21,s[59]),I=p(I,k,_,R,g,6,s[60]),R=p(R,I,k,_,S,10,s[61]),_=p(_,R,I,k,h,15,s[62]),k=p(k,_,R,I,E,21,s[63]),a[0]=a[0]+I|0,a[1]=a[1]+k|0,a[2]=a[2]+_|0,a[3]=a[3]+R|0},_doFinalize:function(){var t=this._data,r=t.words,n=8*this._nDataBytes,i=8*t.sigBytes;r[i>>>5]|=128<<24-i%32;var a=e.floor(n/4294967296),o=n;r[15+(i+64>>>9<<4)]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),r[14+(i+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),t.sigBytes=4*(r.length+1),this._process();for(var s=this._hash,u=s.words,c=0;c<4;c++){var l=u[c];u[c]=16711935&(l<<8|l>>>24)|4278255360&(l<<24|l>>>8)}return s},clone:function(){var e=a.clone.call(this);return e._hash=this._hash.clone(),e}});function c(e,t,r,n,i,a,o){var s=e+(t&r|~t&n)+i+o;return(s<<a|s>>>32-a)+t}function l(e,t,r,n,i,a,o){var s=e+(t&n|r&~n)+i+o;return(s<<a|s>>>32-a)+t}function f(e,t,r,n,i,a,o){var s=e+(t^r^n)+i+o;return(s<<a|s>>>32-a)+t}function p(e,t,r,n,i,a,o){var s=e+(r^(t|~n))+i+o;return(s<<a|s>>>32-a)+t}t.MD5=a._createHelper(u),t.HmacMD5=a._createHmacHelper(u)}(Math),n.MD5)},24:function(e,t,r){var n,i;!function(a,o){"use strict";void 0===(i="function"==typeof(n=function(){var e=function(){},t="undefined",r=typeof window!==t&&/Trident\/|MSIE /.test(window.navigator.userAgent),n=["trace","debug","info","warn","error"];function i(e,t){var r=e[t];if("function"==typeof r.bind)return r.bind(e);try{return Function.prototype.bind.call(r,e)}catch(t){return function(){return Function.prototype.apply.apply(r,[e,arguments])}}}function a(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function o(t,r){for(var i=0;i<n.length;i++){var a=n[i];this[a]=i<t?e:this.methodFactory(a,t,r)}this.log=this.debug}function s(e,r,n){return function(){typeof console!==t&&(o.call(this,r,n),this[e].apply(this,arguments))}}function u(n,o,u){return function(n){return"debug"===n&&(n="log"),typeof console!==t&&("trace"===n&&r?a:void 0!==console[n]?i(console,n):void 0!==console.log?i(console,"log"):e)}(n)||s.apply(this,arguments)}function c(e,r,i){var a,s=this,c="loglevel";function l(){var e;if(typeof window!==t){try{e=window.localStorage[c]}catch(e){}if(typeof e===t)try{var r=window.document.cookie,n=r.indexOf(encodeURIComponent(c)+"=");-1!==n&&(e=/^([^;]+)/.exec(r.slice(n))[1])}catch(e){}return void 0===s.levels[e]&&(e=void 0),e}}e&&(c+=":"+e),s.name=e,s.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},s.methodFactory=i||u,s.getLevel=function(){return a},s.setLevel=function(r,i){if("string"==typeof r&&void 0!==s.levels[r.toUpperCase()]&&(r=s.levels[r.toUpperCase()]),!("number"==typeof r&&r>=0&&r<=s.levels.SILENT))throw"log.setLevel() called with invalid level: "+r;if(a=r,!1!==i&&function(e){var r=(n[e]||"silent").toUpperCase();if(typeof window!==t){try{return void(window.localStorage[c]=r)}catch(e){}try{window.document.cookie=encodeURIComponent(c)+"="+r+";"}catch(e){}}}(r),o.call(s,r,e),typeof console===t&&r<s.levels.SILENT)return"No console available for logging"},s.setDefaultLevel=function(e){l()||s.setLevel(e,!1)},s.enableAll=function(e){s.setLevel(s.levels.TRACE,e)},s.disableAll=function(e){s.setLevel(s.levels.SILENT,e)};var f=l();null==f&&(f=null==r?"WARN":r),s.setLevel(f,!1)}var l=new c,f={};l.getLogger=function(e){if("string"!=typeof e||""===e)throw new TypeError("You must supply a name when creating a logger.");var t=f[e];return t||(t=f[e]=new c(e,l.getLevel(),l.methodFactory)),t};var p=typeof window!==t?window.log:void 0;return l.noConflict=function(){return typeof window!==t&&window.log===l&&(window.log=p),l},l.getLoggers=function(){return f},l})?n.call(t,r,t,e):n)||(e.exports=i)}()},25:function(e,t){var r,n,i=e.exports={};function a(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(e){if(r===setTimeout)return setTimeout(e,0);if((r===a||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:a}catch(e){r=a}try{n="function"==typeof clearTimeout?clearTimeout:o}catch(e){n=o}}();var u,c=[],l=!1,f=-1;function p(){l&&u&&(l=!1,u.length?c=u.concat(c):f=-1,c.length&&h())}function h(){if(!l){var e=s(p);l=!0;for(var t=c.length;t;){for(u=c,c=[];++f<t;)u&&u[f].run();f=-1,t=c.length}u=null,l=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===o||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function d(e,t){this.fun=e,this.array=t}function g(){}i.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];c.push(new d(e,t)),1!==c.length||l||s(h)},d.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=g,i.addListener=g,i.once=g,i.off=g,i.removeListener=g,i.removeAllListeners=g,i.emit=g,i.prependListener=g,i.prependOnceListener=g,i.listeners=function(e){return[]},i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},26:function(e,t){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(e){"object"==typeof window&&(r=window)}e.exports=r},27:function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(0);
/**
 * Binary functions.
 *
 * @author n1474335 [n1474335@gmail.com]
 * @copyright Crown Copyright 2018
 * @license Apache-2.0
 */function i(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Space",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:8,i=n.b.regexRep(t);e=e.replace(i,"");for(var a=[],o=0;o<e.length;o+=r)a.push(parseInt(e.substr(o,r),2));return a}},271:function(e,t,r){(function(e,t){!function(e,r){"use strict";if(!e.setImmediate){var n,i,a,o,s,u=1,c={},l=!1,f=e.document,p=Object.getPrototypeOf&&Object.getPrototypeOf(e);p=p&&p.setTimeout?p:e,"[object process]"==={}.toString.call(e.process)?n=function(e){t.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?((a=new MessageChannel).port1.onmessage=function(e){d(e.data)},n=function(e){a.port2.postMessage(e)}):f&&"onreadystatechange"in f.createElement("script")?(i=f.documentElement,n=function(e){var t=f.createElement("script");t.onreadystatechange=function(){d(e),t.onreadystatechange=null,i.removeChild(t),t=null},i.appendChild(t)}):n=function(e){setTimeout(d,0,e)}:(o="setImmediate$"+Math.random()+"$",s=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(o)&&d(+t.data.slice(o.length))},e.addEventListener?e.addEventListener("message",s,!1):e.attachEvent("onmessage",s),n=function(t){e.postMessage(o+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 c[u]=i,n(u),u++},p.clearImmediate=h}function h(e){delete c[e]}function d(e){if(l)setTimeout(d,0,e);else{var t=c[e];if(t){l=!0;try{!function(e){var t=e.callback,n=e.args;switch(n.length){case 0:t();break;case 1:t(n[0]);break;case 2:t(n[0],n[1]);break;case 3:t(n[0],n[1],n[2]);break;default:t.apply(r,n)}}(t)}finally{h(e),l=!1}}}}}("undefined"==typeof self?void 0===e?this:e:self)}).call(this,r(26),r(25))},28:function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(0);
/**
 * Decimal functions.
 *
 * @author n1474335 [n1474335@gmail.com]
 * @copyright Crown Copyright 2018
 * @license Apache-2.0
 */function i(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Auto";t=n.b.charRep(t);var r=[],i=e.split(t);""===i[i.length-1]&&(i=i.slice(0,i.length-1));for(var a=0;a<i.length;a++)r[a]=parseInt(i[a],10);return r}},3:function(e,t){function r(t){return e.exports=r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},r(t)}e.exports=r},37:function(e,t,r){(function(t,r,n){"undefined"!=typeof self&&self,e.exports=function(e){function t(n){if(r[n])return r[n].exports;var i=r[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var r={};return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=34)}([function(e,t){e.exports={options:{usePureJavaScript:!1}}},function(e,i,a){(function(i){function o(e){if(8!==e&&16!==e&&24!==e&&32!==e)throw new Error("Only 8, 16, 24, or 32 bits supported: "+e)}function s(e){if(this.data="",this.read=0,"string"==typeof e)this.data=e;else if(l.isArrayBuffer(e)||l.isArrayBufferView(e))if(void 0!==t&&e instanceof t)this.data=e.toString("binary");else{var r=new Uint8Array(e);try{this.data=String.fromCharCode.apply(null,r)}catch(e){for(var n=0;n<r.length;++n)this.putByte(r[n])}}else(e instanceof s||"object"==typeof e&&"string"==typeof e.data&&"number"==typeof e.read)&&(this.data=e.data,this.read=e.read);this._constructedStringLength=0}var u=a(0),c=a(37),l=e.exports=u.util=u.util||{};!function(){if(void 0!==r&&r.nextTick,"function"==typeof n)return l.setImmediate=function(){return n.apply(void 0,arguments)},void(l.nextTick=function(e){return n(e)});if(l.setImmediate=function(e){setTimeout(e,0)},"undefined"!=typeof window&&"function"==typeof window.postMessage){var e="forge.setImmediate",t=[];l.setImmediate=function(r){t.push(r),1===t.length&&window.postMessage(e,"*")},window.addEventListener("message",(function(r){if(r.source===window&&r.data===e){r.stopPropagation();var n=t.slice();t.length=0,n.forEach((function(e){e()}))}}),!0)}if("undefined"!=typeof MutationObserver){var i=Date.now(),a=!0,o=document.createElement("div");t=[],new MutationObserver((function(){var e=t.slice();t.length=0,e.forEach((function(e){e()}))})).observe(o,{attributes:!0});var s=l.setImmediate;l.setImmediate=function(e){Date.now()-i>15?(i=Date.now(),s(e)):(t.push(e),1===t.length&&o.setAttribute("a",a=!a))}}l.nextTick=l.setImmediate}(),l.isNodejs=void 0!==r&&r.versions&&r.versions.node,l.globalScope=l.isNodejs?i:"undefined"==typeof self?window:self,l.isArray=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},l.isArrayBuffer=function(e){return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer},l.isArrayBufferView=function(e){return e&&l.isArrayBuffer(e.buffer)&&void 0!==e.byteLength},l.ByteBuffer=s,l.ByteStringBuffer=s,l.ByteStringBuffer.prototype._optimizeConstructedString=function(e){this._constructedStringLength+=e,this._constructedStringLength>4096&&(this.data.substr(0,1),this._constructedStringLength=0)},l.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read},l.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0},l.ByteStringBuffer.prototype.putByte=function(e){return this.putBytes(String.fromCharCode(e))},l.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},l.ByteStringBuffer.prototype.putBytes=function(e){return this.data+=e,this._optimizeConstructedString(e.length),this},l.ByteStringBuffer.prototype.putString=function(e){return this.putBytes(l.encodeUtf8(e))},l.ByteStringBuffer.prototype.putInt16=function(e){return this.putBytes(String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},l.ByteStringBuffer.prototype.putInt24=function(e){return this.putBytes(String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},l.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))},l.ByteStringBuffer.prototype.putInt16Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255))},l.ByteStringBuffer.prototype.putInt24Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255))},l.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))},l.ByteStringBuffer.prototype.putInt=function(e,t){o(t);var r="";do{t-=8,r+=String.fromCharCode(e>>t&255)}while(t>0);return this.putBytes(r)},l.ByteStringBuffer.prototype.putSignedInt=function(e,t){return e<0&&(e+=2<<t-1),this.putInt(e,t)},l.ByteStringBuffer.prototype.putBuffer=function(e){return this.putBytes(e.getBytes())},l.ByteStringBuffer.prototype.getByte=function(){return this.data.charCodeAt(this.read++)},l.ByteStringBuffer.prototype.getInt16=function(){var e=this.data.charCodeAt(this.read)<<8^this.data.charCodeAt(this.read+1);return this.read+=2,e},l.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},l.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},l.ByteStringBuffer.prototype.getInt16Le=function(){var e=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8;return this.read+=2,e},l.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},l.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},l.ByteStringBuffer.prototype.getInt=function(e){o(e);var t=0;do{t=(t<<8)+this.data.charCodeAt(this.read++),e-=8}while(e>0);return t},l.ByteStringBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),r=2<<e-2;return t>=r&&(t-=r<<1),t},l.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},l.ByteStringBuffer.prototype.bytes=function(e){return void 0===e?this.data.slice(this.read):this.data.slice(this.read,this.read+e)},l.ByteStringBuffer.prototype.at=function(e){return this.data.charCodeAt(this.read+e)},l.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},l.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)},l.ByteStringBuffer.prototype.copy=function(){var e=l.createBuffer(this.data);return e.read=this.read,e},l.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this},l.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this},l.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},l.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},l.ByteStringBuffer.prototype.toString=function(){return l.decodeUtf8(this.bytes())},l.DataBuffer=function(e,t){t=t||{},this.read=t.readOffset||0,this.growSize=t.growSize||1024;var r=l.isArrayBuffer(e),n=l.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)},l.DataBuffer.prototype.length=function(){return this.write-this.read},l.DataBuffer.prototype.isEmpty=function(){return this.length()<=0},l.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},l.DataBuffer.prototype.putByte=function(e){return this.accommodate(1),this.data.setUint8(this.write++,e),this},l.DataBuffer.prototype.fillWithByte=function(e,t){this.accommodate(t);for(var r=0;r<t;++r)this.data.setUint8(e);return this},l.DataBuffer.prototype.putBytes=function(e,t){if(l.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(l.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 l.DataBuffer||"object"==typeof e&&"number"==typeof e.read&&"number"==typeof e.write&&l.isArrayBufferView(e.data))return n=new Uint8Array(e.data.byteLength,e.read,e.length()),this.accommodate(n.byteLength),new Uint8Array(e.data.byteLength,this.write).set(n),this.write+=n.byteLength,this;if(e instanceof l.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+=l.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+=l.binary.base64.decode(e,i,this.write),this;if("utf8"===t&&(e=l.encodeUtf8(e),t="binary"),"binary"===t||"raw"===t)return this.accommodate(e.length),i=new Uint8Array(this.data.buffer,this.write),this.write+=l.binary.raw.decode(i),this;if("utf16"===t)return this.accommodate(2*e.length),i=new Uint16Array(this.data.buffer,this.write),this.write+=l.text.utf16.encode(i),this;throw new Error("Invalid encoding: "+t)}throw Error("Invalid parameter: "+e)},l.DataBuffer.prototype.putBuffer=function(e){return this.putBytes(e),e.clear(),this},l.DataBuffer.prototype.putString=function(e){return this.putBytes(e,"utf16")},l.DataBuffer.prototype.putInt16=function(e){return this.accommodate(2),this.data.setInt16(this.write,e),this.write+=2,this},l.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},l.DataBuffer.prototype.putInt32=function(e){return this.accommodate(4),this.data.setInt32(this.write,e),this.write+=4,this},l.DataBuffer.prototype.putInt16Le=function(e){return this.accommodate(2),this.data.setInt16(this.write,e,!0),this.write+=2,this},l.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},l.DataBuffer.prototype.putInt32Le=function(e){return this.accommodate(4),this.data.setInt32(this.write,e,!0),this.write+=4,this},l.DataBuffer.prototype.putInt=function(e,t){o(t),this.accommodate(t/8);do{t-=8,this.data.setInt8(this.write++,e>>t&255)}while(t>0);return this},l.DataBuffer.prototype.putSignedInt=function(e,t){return o(t),this.accommodate(t/8),e<0&&(e+=2<<t-1),this.putInt(e,t)},l.DataBuffer.prototype.getByte=function(){return this.data.getInt8(this.read++)},l.DataBuffer.prototype.getInt16=function(){var e=this.data.getInt16(this.read);return this.read+=2,e},l.DataBuffer.prototype.getInt24=function(){var e=this.data.getInt16(this.read)<<8^this.data.getInt8(this.read+2);return this.read+=3,e},l.DataBuffer.prototype.getInt32=function(){var e=this.data.getInt32(this.read);return this.read+=4,e},l.DataBuffer.prototype.getInt16Le=function(){var e=this.data.getInt16(this.read,!0);return this.read+=2,e},l.DataBuffer.prototype.getInt24Le=function(){var e=this.data.getInt8(this.read)^this.data.getInt16(this.read+1,!0)<<8;return this.read+=3,e},l.DataBuffer.prototype.getInt32Le=function(){var e=this.data.getInt32(this.read,!0);return this.read+=4,e},l.DataBuffer.prototype.getInt=function(e){o(e);var t=0;do{t=(t<<8)+this.data.getInt8(this.read++),e-=8}while(e>0);return t},l.DataBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),r=2<<e-2;return t>=r&&(t-=r<<1),t},l.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},l.DataBuffer.prototype.bytes=function(e){return void 0===e?this.data.slice(this.read):this.data.slice(this.read,this.read+e)},l.DataBuffer.prototype.at=function(e){return this.data.getUint8(this.read+e)},l.DataBuffer.prototype.setAt=function(e,t){return this.data.setUint8(e,t),this},l.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)},l.DataBuffer.prototype.copy=function(){return new l.DataBuffer(this)},l.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},l.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this},l.DataBuffer.prototype.truncate=function(e){return this.write=Math.max(0,this.length()-e),this.read=Math.min(this.read,this.write),this},l.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},l.DataBuffer.prototype.toString=function(e){var t=new Uint8Array(this.data,this.read,this.length());if("binary"===(e=e||"utf8")||"raw"===e)return l.binary.raw.encode(t);if("hex"===e)return l.binary.hex.encode(t);if("base64"===e)return l.binary.base64.encode(t);if("utf8"===e)return l.text.utf8.decode(t);if("utf16"===e)return l.text.utf16.decode(t);throw new Error("Invalid encoding: "+e)},l.createBuffer=function(e,t){return t=t||"raw",void 0!==e&&"utf8"===t&&(e=l.encodeUtf8(e)),new l.ByteBuffer(e)},l.fillString=function(e,t){for(var r="";t>0;)1&t&&(r+=e),(t>>>=1)>0&&(e+=e);return r},l.xorBytes=function(e,t,r){for(var n="",i="",a="",o=0,s=0;r>0;--r,++o)i=e.charCodeAt(o)^t.charCodeAt(o),s>=10&&(n+=a,a="",s=0),a+=String.fromCharCode(i),++s;return n+a},l.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},l.bytesToHex=function(e){return l.createBuffer(e).toHex()},l.int32ToBytes=function(e){return String.fromCharCode(e>>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e)};var f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",p=[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],h="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";l.encode64=function(e,t){for(var r,n,i,a="",o="",s=0;s<e.length;)r=e.charCodeAt(s++),n=e.charCodeAt(s++),i=e.charCodeAt(s++),a+=f.charAt(r>>2),a+=f.charAt((3&r)<<4|n>>4),isNaN(n)?a+="==":(a+=f.charAt((15&n)<<2|i>>6),a+=isNaN(i)?"=":f.charAt(63&i)),t&&a.length>t&&(o+=a.substr(0,t)+"\r\n",a=a.substr(t));return o+a},l.decode64=function(e){e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var t,r,n,i,a="",o=0;o<e.length;)t=p[e.charCodeAt(o++)-43],r=p[e.charCodeAt(o++)-43],n=p[e.charCodeAt(o++)-43],i=p[e.charCodeAt(o++)-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},l.encodeUtf8=function(e){return unescape(encodeURIComponent(e))},l.decodeUtf8=function(e){return decodeURIComponent(escape(e))},l.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:c.encode,decode:c.decode}},l.binary.raw.encode=function(e){return String.fromCharCode.apply(null,e)},l.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},l.binary.hex.encode=l.bytesToHex,l.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},l.binary.base64.encode=function(e,t){for(var r,n,i,a="",o="",s=0;s<e.byteLength;)r=e[s++],n=e[s++],i=e[s++],a+=f.charAt(r>>2),a+=f.charAt((3&r)<<4|n>>4),isNaN(n)?a+="==":(a+=f.charAt((15&n)<<2|i>>6),a+=isNaN(i)?"=":f.charAt(63&i)),t&&a.length>t&&(o+=a.substr(0,t)+"\r\n",a=a.substr(t));return o+a},l.binary.base64.decode=function(e,t,r){var n=t;n||(n=new Uint8Array(3*Math.ceil(e.length/4))),e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var i,a,o,s,u=0,c=r=r||0;u<e.length;)i=p[e.charCodeAt(u++)-43],a=p[e.charCodeAt(u++)-43],o=p[e.charCodeAt(u++)-43],s=p[e.charCodeAt(u++)-43],n[c++]=i<<2|a>>4,64!==o&&(n[c++]=(15&a)<<4|o>>2,64!==s&&(n[c++]=(3&o)<<6|s));return t?c-r:n.subarray(0,c)},l.binary.base58.encode=function(e,t){return l.binary.baseN.encode(e,h,t)},l.binary.base58.decode=function(e,t){return l.binary.baseN.decode(e,h,t)},l.text={utf8:{},utf16:{}},l.text.utf8.encode=function(e,t,r){e=l.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},l.text.utf8.decode=function(e){return l.decodeUtf8(String.fromCharCode.apply(null,e))},l.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,o=r,s=0;s<e.length;++s)i[o++]=e.charCodeAt(s),a+=2;return t?a-r:n},l.text.utf16.decode=function(e){return String.fromCharCode.apply(null,new Uint16Array(e.buffer))},l.deflate=function(e,t,r){if(t=l.decode64(e.deflate(l.encode64(t)).rval),r){var n=2;32&t.charCodeAt(1)&&(n=6),t=t.substring(n,t.length-4)}return t},l.inflate=function(e,t,r){var n=e.inflate(l.encode64(t)).rval;return null===n?null:l.decode64(n)};var d=function(e,t,r){if(!e)throw new Error("WebStorage not available.");var n;if(null===r?n=e.removeItem(t):(r=l.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}},g=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(l.decode64(r))),r},y=function(e,t,r,n){var i=g(e,t);null===i&&(i={}),i[r]=n,d(e,t,i)},v=function(e,t,r){var n=g(e,t);return null!==n&&(n=r in n?n[r]:null),n},m=function(e,t,r){var n=g(e,t);if(null!==n&&r in n){delete n[r];var i=!0;for(var a in n){i=!1;break}i&&(n=null),d(e,t,n)}},C=function(e,t){d(e,t,null)},E=function(e,t,r){var n=null;void 0===r&&(r=["web","flash"]);var i,a=!1,o=null;for(var s in r){i=r[s];try{if("flash"===i||"both"===i){if(null===t[0])throw new Error("Flash local storage not available.");n=e.apply(this,t),a="flash"===i}"web"!==i&&"both"!==i||(t[0]=localStorage,n=e.apply(this,t),a=!0)}catch(e){o=e}if(a)break}if(!a)throw o;return n};l.setItem=function(e,t,r,n,i){E(y,arguments,i)},l.getItem=function(e,t,r,n){return E(v,arguments,n)},l.removeItem=function(e,t,r,n){E(m,arguments,n)},l.clearItems=function(e,t,r){E(C,arguments,r)},l.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?n.fullHost+=":"+n.port: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 b=null;l.getQueryVariables=function(e){var t,r=function(e){for(var t={},r=e.split("&"),n=0;n<r.length;n++){var i,a,o=r[n].indexOf("=");o>0?(i=r[n].substring(0,o),a=r[n].substring(o+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===b&&(b="undefined"!=typeof window&&window.location&&window.location.search?r(window.location.search.substring(1)):{}),t=b):t=r(e),t},l.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?{}:l.getQueryVariables(r)}},l.makeRequest=function(e){var t=l.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},l.makeLink=function(e,t,r){e=null.isArray(e)?e.join("/"):e;var n=null.param(t||{});return r=r||"",e+(n.length>0?"?"+n:"")+(r.length>0?"#"+r:"")},l.setPath=function(e,t,r){if("object"==typeof e&&null!==e)for(var n=0,i=t.length;n<i;){var a=t[n++];if(n==i)e[a]=r;else{var o=a in e;(!o||o&&"object"!=typeof e[a]||o&&null===e[a])&&(e[a]={}),e=e[a]}}},l.getPath=function(e,t,r){for(var n=0,i=t.length,a=!0;a&&n<i&&"object"==typeof e&&null!==e;){var o=t[n++];(a=o in e)&&(e=e[o])}return a?e:r},l.deletePath=function(e,t){if("object"==typeof e&&null!==e)for(var r=0,n=t.length;r<n;){var i=t[r++];if(r==n)delete e[i];else{if(!(i in e)||"object"!=typeof e[i]||null===e[i])break;e=e[i]}}},l.isEmpty=function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0},l.format=function(e){for(var t,r,n=/%./g,i=0,a=[],o=0;t=n.exec(e);){(r=e.substring(o,n.lastIndex-2)).length>0&&a.push(r),o=n.lastIndex;var s=t[0][1];switch(s){case"s":case"o":i<arguments.length?a.push(arguments[1+i++]):a.push("<?>");break;case"%":a.push("%");break;default:a.push("<%"+s+"?>")}}return a.push(e.substring(o)),a.join("")},l.formatNumber=function(e,t,r,n){var i=e,a=isNaN(t=Math.abs(t))?2:t,o=void 0===r?",":r,s=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)+s:"")+c.substr(l).replace(/(\d{3})(?=\d)/g,"$1"+s)+(a?o+Math.abs(i-c).toFixed(a).slice(2):"")},l.formatSize=function(e){return e>=1073741824?l.formatNumber(e/1073741824,2,".","")+" GiB":e>=1048576?l.formatNumber(e/1048576,2,".","")+" MiB":e>=1024?l.formatNumber(e/1024,0)+" KiB":l.formatNumber(e,0)+" bytes"},l.bytesFromIP=function(e){return-1!==e.indexOf(".")?l.bytesFromIPv4(e):-1!==e.indexOf(":")?l.bytesFromIPv6(e):null},l.bytesFromIPv4=function(e){if(4!==(e=e.split(".")).length)return null;for(var t=l.createBuffer(),r=0;r<e.length;++r){var n=parseInt(e[r],10);if(isNaN(n))return null;t.putByte(n)}return t.getBytes()},l.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=l.createBuffer(),i=0;i<8;++i)if(e[i]&&0!==e[i].length){var a=l.hexToBytes(e[i]);a.length<2&&n.putByte(0),n.putBytes(a)}else n.fillWithByte(0,r),r=0;return n.getBytes()},l.bytesToIP=function(e){return 4===e.length?l.bytesToIPv4(e):16===e.length?l.bytesToIPv6(e):null},l.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(".")},l.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=l.bytesToHex(e[i]+e[i+1]);"0"===a[0]&&"0"!==a;)a=a.substr(1);if("0"===a){var o=r[r.length-1],s=t.length;o&&s===o.end+1?(o.end=s,o.end-o.start>r[n].end-r[n].start&&(n=r.length-1)):r.push({start:s,end:s})}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(":")},l.estimateCores=function(e,t){if("function"==typeof e&&(t=e,e={}),e=e||{},"cores"in l&&!e.update)return t(null,l.cores);if("undefined"!=typeof navigator&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return l.cores=navigator.hardwareConcurrency,t(null,l.cores);if("undefined"==typeof Worker)return l.cores=1,t(null,l.cores);if("undefined"==typeof Blob)return l.cores=2,t(null,l.cores);var r=URL.createObjectURL(new Blob(["(",function(){self.addEventListener("message",(function(e){for(var t=Date.now(),r=t+4;Date.now()<r;);self.postMessage({st:t,et:r})}))}.toString(),")()"],{type:"application/javascript"}));!function e(n,i,a){if(0===i){var o=Math.floor(n.reduce((function(e,t){return e+t}),0)/n.length);return l.cores=Math.max(1,o),URL.revokeObjectURL(r),t(null,l.cores)}!function(e,t){for(var n=[],i=[],a=0;a<e;++a){var o=new Worker(r);o.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(o)}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]=[],o=0;o<e;++o)if(n!==o){var s=t[o];(i.st>s.st&&i.st<s.et||s.st>i.st&&s.st<i.et)&&a.push(o)}return r.reduce((function(e,t){return Math.max(e,t.length)}),0)}(a,r)),e(n,i-1,a)}))}([],5,16)}}).call(i,a(36))},function(e,t,r){var n=r(0);r(5),r(23),r(24),r(1),n.random&&n.random.getBytes?e.exports=n.random:function(t){function r(){var e=n.prng.create(i);return e.getBytes=function(t,r){return e.generate(t,r)},e.getBytesSync=function(t){return e.generate(t)},e}var i={},a=new Array(4),o=n.util.createBuffer();i.formatKey=function(e){var t=n.util.createBuffer(e);return(e=new Array(4))[0]=t.getInt32(),e[1]=t.getInt32(),e[2]=t.getInt32(),e[3]=t.getInt32(),n.aes._expandKey(e,!1)},i.formatSeed=function(e){var t=n.util.createBuffer(e);return(e=new Array(4))[0]=t.getInt32(),e[1]=t.getInt32(),e[2]=t.getInt32(),e[3]=t.getInt32(),e},i.cipher=function(e,t){return n.aes._updateBlock(e,t,a,!1),o.putInt32(a[0]),o.putInt32(a[1]),o.putInt32(a[2]),o.putInt32(a[3]),o.getBytes()},i.increment=function(e){return++e[3],e},i.md=n.md.sha256;var s=r(),u=null,c=n.util.globalScope,l=c.crypto||c.msCrypto;if(l&&l.getRandomValues&&(u=function(e){return l.getRandomValues(e)}),n.options.usePureJavaScript||!n.util.isNodejs&&!u){if("undefined"==typeof window||window.document,s.collectInt(+new Date,32),"undefined"!=typeof navigator){var f="";for(var p in navigator)try{"string"==typeof navigator[p]&&(f+=navigator[p])}catch(e){}s.collect(f),f=null}t&&(t().mousemove((function(e){s.collectInt(e.clientX,16),s.collectInt(e.clientY,16)})),t().keypress((function(e){s.collectInt(e.charCode,8)})))}if(n.random)for(var p in s)n.random[p]=s[p];else n.random=s;n.random.createInstance=r,e.exports=n.random}(null)},function(e,t,r){function n(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}}var i=r(0);r(1),r(6);var a=e.exports=i.asn1=i.asn1||{};a.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192},a.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},a.create=function(e,t,r,n,o){if(i.util.isArray(n)){for(var s=[],u=0;u<n.length;++u)void 0!==n[u]&&s.push(n[u]);n=s}var c={tagClass:e,type:t,constructed:r,composed:r||i.util.isArray(n),value:n};return o&&"bitStringContents"in o&&(c.bitStringContents=o.bitStringContents,c.original=a.copy(c)),c},a.copy=function(e,t){var r;if(i.util.isArray(e)){r=[];for(var n=0;n<e.length;++n)r.push(a.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:a.copy(e.value,t)},t&&!t.excludeBitStringContents&&(r.bitStringContents=e.bitStringContents),r)},a.equals=function(e,t,r){if(i.util.isArray(e)){if(!i.util.isArray(t))return!1;if(e.length!==t.length)return!1;for(var n=0;n<e.length;++n)if(!a.equals(e[n],t[n]))return!1;return!0}if(typeof e!=typeof t)return!1;if("string"==typeof e)return e===t;var o=e.tagClass===t.tagClass&&e.type===t.type&&e.constructed===t.constructed&&e.composed===t.composed&&a.equals(e.value,t.value);return r&&r.includeBitStringContents&&(o=o&&e.bitStringContents===t.bitStringContents),o},a.getBerValueLength=function(e){var t=e.getByte();if(128!==t)return 128&t?e.getInt((127&t)<<3):t};var o=function(e,t){var r=e.getByte();if(t--,128!==r){var i;if(128&r){var a=127&r;n(e,t,a),i=e.getInt(a<<3)}else i=r;if(i<0)throw new Error("Negative length: "+i);return i}};a.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=i.util.createBuffer(e)),function e(t,r,i,s){var u;n(t,r,2);var c=t.getByte();r--;var l=192&c,f=31&c;u=t.length();var p=o(t,r);if(r-=u-t.length(),void 0!==p&&p>r){if(s.strict){var h=new Error("Too few bytes to read ASN.1 value.");throw h.available=t.length(),h.remaining=r,h.requested=p,h}p=r}var d,g,y=32==(32&c);if(y)if(d=[],void 0===p)for(;;){if(n(t,r,2),t.bytes(2)===String.fromCharCode(0,0)){t.getBytes(2),r-=2;break}u=t.length(),d.push(e(t,r,i+1,s)),r-=u-t.length()}else for(;p>0;)u=t.length(),d.push(e(t,p,i+1,s)),r-=u-t.length(),p-=u-t.length();if(void 0===d&&l===a.Class.UNIVERSAL&&f===a.Type.BITSTRING&&(g=t.bytes(p)),void 0===d&&s.decodeBitStrings&&l===a.Class.UNIVERSAL&&f===a.Type.BITSTRING&&p>1){var v=t.read,m=r,C=0;if(f===a.Type.BITSTRING&&(n(t,r,1),C=t.getByte(),r--),0===C)try{u=t.length();var E=e(t,r,i+1,{verbose:s.verbose,strict:!0,decodeBitStrings:!0}),b=u-t.length();r-=b,f==a.Type.BITSTRING&&b++;var S=E.tagClass;b!==p||S!==a.Class.UNIVERSAL&&S!==a.Class.CONTEXT_SPECIFIC||(d=[E])}catch(t){}void 0===d&&(t.read=v,r=m)}if(void 0===d){if(void 0===p){if(s.strict)throw new Error("Non-constructed ASN.1 object of indefinite length.");p=r}if(f===a.Type.BMPSTRING)for(d="";p>0;p-=2)n(t,r,2),d+=String.fromCharCode(t.getInt16()),r-=2;else d=t.getBytes(p)}var B=void 0===g?null:{bitStringContents:g};return a.create(l,f,y,d,B)}(e,e.length(),0,t)},a.toDer=function(e){var t=i.util.createBuffer(),r=e.tagClass|e.type,n=i.util.createBuffer(),o=!1;if("bitStringContents"in e&&(o=!0,e.original&&(o=a.equals(e,e.original))),o)n.putBytes(e.bitStringContents);else if(e.composed){e.constructed?r|=32:n.putByte(0);for(var s=0;s<e.value.length;++s)void 0!==e.value[s]&&n.putBuffer(a.toDer(e.value[s]))}else if(e.type===a.Type.BMPSTRING)for(s=0;s<e.value.length;++s)n.putInt16(e.value.charCodeAt(s));else e.type===a.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 u=n.length(),c="";do{c+=String.fromCharCode(255&u),u>>>=8}while(u>0);for(t.putByte(128|c.length),s=c.length-1;s>=0;--s)t.putByte(c.charCodeAt(s))}return t.putBuffer(n),t},a.oidToDer=function(e){var t=e.split("."),r=i.util.createBuffer();r.putByte(40*parseInt(t[0],10)+parseInt(t[1],10));for(var n,a,o,s,u=2;u<t.length;++u){n=!0,a=[],o=parseInt(t[u],10);do{s=127&o,o>>>=7,n||(s|=128),a.push(s),n=!1}while(o>0);for(var c=a.length-1;c>=0;--c)r.putByte(a[c])}return r},a.derToOid=function(e){var t;"string"==typeof e&&(e=i.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},a.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),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(r,n,i),t.setUTCHours(a,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},a.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),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 f=e.length-5,p=e.charAt(f);return"+"!==p&&"-"!==p||(c=60*parseInt(e.substr(f+1,2),10)+parseInt(e.substr(f+4,2),10),c*=6e4,"+"===p&&(c*=-1),l=!0),"."===e.charAt(14)&&(u=1e3*parseFloat(e.substr(14),10)),l?(t.setUTCFullYear(r,n,i),t.setUTCHours(a,o,s,u),t.setTime(+t+c)):(t.setFullYear(r,n,i),t.setHours(a,o,s,u)),t},a.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"},a.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"},a.integerToDer=function(e){var t=i.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},a.derToInteger=function(e){"string"==typeof e&&(e=i.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)},a.validate=function(e,t,r,n){var o=!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(o=!0,t.value&&i.util.isArray(t.value))for(var s=0,u=0;o&&u<t.value.length;++u)o=t.value[u].optional||!1,e.value[s]&&((o=a.validate(e.value[s],t.value[u],r,n))?++s:t.value[u].optional&&(o=!0)),!o&&n&&n.push("["+t.name+'] Tag class "'+t.tagClass+'", type "'+t.type+'" expected value length "'+t.value.length+'", got "'+e.value.length+'"');if(o&&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 o};var s=/[^\\u0000-\\u00ff]/;a.prettyPrint=function(e,t,r){var n="";r=r||2,(t=t||0)>0&&(n+="\n");for(var o="",u=0;u<t*r;++u)o+=" ";switch(n+=o+"Tag: ",e.tagClass){case a.Class.UNIVERSAL:n+="Universal:";break;case a.Class.APPLICATION:n+="Application:";break;case a.Class.CONTEXT_SPECIFIC:n+="Context-Specific:";break;case a.Class.PRIVATE:n+="Private:"}if(e.tagClass===a.Class.UNIVERSAL)switch(n+=e.type,e.type){case a.Type.NONE:n+=" (None)";break;case a.Type.BOOLEAN:n+=" (Boolean)";break;case a.Type.INTEGER:n+=" (Integer)";break;case a.Type.BITSTRING:n+=" (Bit string)";break;case a.Type.OCTETSTRING:n+=" (Octet string)";break;case a.Type.NULL:n+=" (Null)";break;case a.Type.OID:n+=" (Object Identifier)";break;case a.Type.ODESC:n+=" (Object Descriptor)";break;case a.Type.EXTERNAL:n+=" (External or Instance of)";break;case a.Type.REAL:n+=" (Real)";break;case a.Type.ENUMERATED:n+=" (Enumerated)";break;case a.Type.EMBEDDED:n+=" (Embedded PDV)";break;case a.Type.UTF8:n+=" (UTF8)";break;case a.Type.ROID:n+=" (Relative Object Identifier)";break;case a.Type.SEQUENCE:n+=" (Sequence)";break;case a.Type.SET:n+=" (Set)";break;case a.Type.PRINTABLESTRING:n+=" (Printable String)";break;case a.Type.IA5String:n+=" (IA5String (ASCII))";break;case a.Type.UTCTIME:n+=" (UTC time)";break;case a.Type.GENERALIZEDTIME:n+=" (Generalized time)";break;case a.Type.BMPSTRING:n+=" (BMP String)"}else n+=e.type;if(n+="\n",n+=o+"Constructed: "+e.constructed+"\n",e.composed){var c=0,l="";for(u=0;u<e.value.length;++u)void 0!==e.value[u]&&(c+=1,l+=a.prettyPrint(e.value[u],t+1,r),u+1<e.value.length&&(l+=","));n+=o+"Sub values: "+c+l}else{if(n+=o+"Value: ",e.type===a.Type.OID){var f=a.derToOid(e.value);n+=f,i.pki&&i.pki.oids&&f in i.pki.oids&&(n+=" ("+i.pki.oids[f]+") ")}if(e.type===a.Type.INTEGER)try{n+=a.derToInteger(e.value)}catch(t){n+="0x"+i.util.bytesToHex(e.value)}else if(e.type===a.Type.BITSTRING){if(e.value.length>1?n+="0x"+i.util.bytesToHex(e.value.slice(1)):n+="(none)",e.value.length>0){var p=e.value.charCodeAt(0);1==p?n+=" (1 unused bit shown)":p>1&&(n+=" ("+p+" unused bits shown)")}}else e.type===a.Type.OCTETSTRING?(s.test(e.value)||(n+="("+e.value+") "),n+="0x"+i.util.bytesToHex(e.value)):e.type===a.Type.UTF8?n+=i.util.decodeUtf8(e.value):e.type===a.Type.PRINTABLESTRING||e.type===a.Type.IA5String?n+=e.value:s.test(e.value)?n+="0x"+i.util.bytesToHex(e.value):0===e.value.length?n+="[null]":n+=e.value}return n}},function(e,t,r){var n=r(0);e.exports=n.md=n.md||{},n.md.algorithms=n.md.algorithms||{}},function(e,t,r){function n(e,t){u.cipher.registerAlgorithm(e,(function(){return new u.aes.Algorithm(e,t)}))}function i(){d=!0,f=[0,1,2,4,8,16,32,64,128,27,54];for(var e=new Array(256),t=0;t<128;++t)e[t]=t<<1,e[t+128]=t+128<<1^283;for(c=new Array(256),l=new Array(256),p=new Array(4),h=new Array(4),t=0;t<4;++t)p[t]=new Array(256),h[t]=new Array(256);var r,n,i,a,o,s,u,g=0,y=0;for(t=0;t<256;++t){a=(a=y^y<<1^y<<2^y<<3^y<<4)>>8^255&a^99,c[g]=a,l[a]=g,s=(o=e[a])<<24^a<<16^a<<8^a^o,u=((r=e[g])^(n=e[r])^(i=e[n]))<<24^(g^i)<<16^(g^n^i)<<8^g^r^i;for(var v=0;v<4;++v)p[v][g]=s,h[v][a]=u,s=s<<24|s>>>8,u=u<<24|u>>>8;0===g?g=y=1:(g=r^e[e[e[r^i]]],y^=e[e[y]])}}function a(e,t){for(var r,n=e.slice(0),i=1,a=n.length,o=g*(a+6+1),s=a;s<o;++s)r=n[s-1],s%a==0?(r=c[r>>>16&255]<<24^c[r>>>8&255]<<16^c[255&r]<<8^c[r>>>24]^f[i]<<24,i++):a>6&&s%a==4&&(r=c[r>>>24]<<24^c[r>>>16&255]<<16^c[r>>>8&255]<<8^c[255&r]),n[s]=n[s-a]^r;if(t){for(var u,l=h[0],p=h[1],d=h[2],y=h[3],v=n.slice(0),m=(s=0,(o=n.length)-g);s<o;s+=g,m-=g)if(0===s||s===o-g)v[s]=n[m],v[s+1]=n[m+3],v[s+2]=n[m+2],v[s+3]=n[m+1];else for(var C=0;C<g;++C)u=n[m+C],v[s+(3&-C)]=l[c[u>>>24]]^p[c[u>>>16&255]]^d[c[u>>>8&255]]^y[c[255&u]];n=v}return n}function o(e,t,r,n){var i,a,o,s,u,f,d,g,y,v,m,C,E=e.length/4-1;n?(i=h[0],a=h[1],o=h[2],s=h[3],u=l):(i=p[0],a=p[1],o=p[2],s=p[3],u=c),f=t[0]^e[0],d=t[n?3:1]^e[1],g=t[2]^e[2],y=t[n?1:3]^e[3];for(var b=3,S=1;S<E;++S)v=i[f>>>24]^a[d>>>16&255]^o[g>>>8&255]^s[255&y]^e[++b],m=i[d>>>24]^a[g>>>16&255]^o[y>>>8&255]^s[255&f]^e[++b],C=i[g>>>24]^a[y>>>16&255]^o[f>>>8&255]^s[255&d]^e[++b],y=i[y>>>24]^a[f>>>16&255]^o[d>>>8&255]^s[255&g]^e[++b],f=v,d=m,g=C;r[0]=u[f>>>24]<<24^u[d>>>16&255]<<16^u[g>>>8&255]<<8^u[255&y]^e[++b],r[n?3:1]=u[d>>>24]<<24^u[g>>>16&255]<<16^u[y>>>8&255]<<8^u[255&f]^e[++b],r[2]=u[g>>>24]<<24^u[y>>>16&255]<<16^u[f>>>8&255]<<8^u[255&d]^e[++b],r[n?1:3]=u[y>>>24]<<24^u[f>>>16&255]<<16^u[d>>>8&255]<<8^u[255&g]^e[++b]}function s(e){var t,r="AES-"+((e=e||{}).mode||"CBC").toUpperCase(),n=(t=e.decrypt?u.cipher.createDecipher(r,e.key):u.cipher.createCipher(r,e.key)).start;return t.start=function(e,r){var i=null;r instanceof u.util.ByteBuffer&&(i=r,r={}),(r=r||{}).output=i,r.iv=e,n.call(t,r)},t}var u=r(0);r(13),r(19),r(1),e.exports=u.aes=u.aes||{},u.aes.startEncrypting=function(e,t,r,n){var i=s({key:e,output:r,decrypt:!1,mode:n});return i.start(t),i},u.aes.createEncryptionCipher=function(e,t){return s({key:e,output:null,decrypt:!1,mode:t})},u.aes.startDecrypting=function(e,t,r,n){var i=s({key:e,output:r,decrypt:!0,mode:n});return i.start(t),i},u.aes.createDecryptionCipher=function(e,t){return s({key:e,output:null,decrypt:!0,mode:t})},u.aes.Algorithm=function(e,t){d||i();var r=this;r.name=e,r.mode=new t({blockSize:16,cipher:{encrypt:function(e,t){return o(r._w,e,t,!1)},decrypt:function(e,t){return o(r._w,e,t,!0)}}}),r._init=!1},u.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(u.util.isArray(r)&&(16===r.length||24===r.length||32===r.length)){t=r,r=u.util.createBuffer();for(var n=0;n<t.length;++n)r.putByte(t[n])}}else r=u.util.createBuffer(r);if(!u.util.isArray(r)){t=r,r=[];var i=t.length();if(16===i||24===i||32===i)for(i>>>=2,n=0;n<i;++n)r.push(t.getInt32())}if(!u.util.isArray(r)||4!==r.length&&6!==r.length&&8!==r.length)throw new Error("Invalid key parameter.");var o=this.mode.name,s=-1!==["CFB","OFB","CTR","GCM"].indexOf(o);this._w=a(r,e.decrypt&&!s),this._init=!0}},u.aes._expandKey=function(e,t){return d||i(),a(e,t)},u.aes._updateBlock=o,n("AES-ECB",u.cipher.modes.ecb),n("AES-CBC",u.cipher.modes.cbc),n("AES-CFB",u.cipher.modes.cfb),n("AES-OFB",u.cipher.modes.ofb),n("AES-CTR",u.cipher.modes.ctr),n("AES-GCM",u.cipher.modes.gcm);var c,l,f,p,h,d=!1,g=4},function(e,t,r){function n(e,t){o[e]=t,o[t]=e}function i(e,t){o[e]=t}var a=r(0);a.pki=a.pki||{};var o=e.exports=a.pki.oids=a.oids=a.oids||{};n("1.2.840.113549.1.1.1","rsaEncryption"),n("1.2.840.113549.1.1.4","md5WithRSAEncryption"),n("1.2.840.113549.1.1.5","sha1WithRSAEncryption"),n("1.2.840.113549.1.1.7","RSAES-OAEP"),n("1.2.840.113549.1.1.8","mgf1"),n("1.2.840.113549.1.1.9","pSpecified"),n("1.2.840.113549.1.1.10","RSASSA-PSS"),n("1.2.840.113549.1.1.11","sha256WithRSAEncryption"),n("1.2.840.113549.1.1.12","sha384WithRSAEncryption"),n("1.2.840.113549.1.1.13","sha512WithRSAEncryption"),n("1.3.101.112","EdDSA25519"),n("1.2.840.10040.4.3","dsa-with-sha1"),n("1.3.14.3.2.7","desCBC"),n("1.3.14.3.2.26","sha1"),n("2.16.840.1.101.3.4.2.1","sha256"),n("2.16.840.1.101.3.4.2.2","sha384"),n("2.16.840.1.101.3.4.2.3","sha512"),n("1.2.840.113549.2.5","md5"),n("1.2.840.113549.1.7.1","data"),n("1.2.840.113549.1.7.2","signedData"),n("1.2.840.113549.1.7.3","envelopedData"),n("1.2.840.113549.1.7.4","signedAndEnvelopedData"),n("1.2.840.113549.1.7.5","digestedData"),n("1.2.840.113549.1.7.6","encryptedData"),n("1.2.840.113549.1.9.1","emailAddress"),n("1.2.840.113549.1.9.2","unstructuredName"),n("1.2.840.113549.1.9.3","contentType"),n("1.2.840.113549.1.9.4","messageDigest"),n("1.2.840.113549.1.9.5","signingTime"),n("1.2.840.113549.1.9.6","counterSignature"),n("1.2.840.113549.1.9.7","challengePassword"),n("1.2.840.113549.1.9.8","unstructuredAddress"),n("1.2.840.113549.1.9.14","extensionRequest"),n("1.2.840.113549.1.9.20","friendlyName"),n("1.2.840.113549.1.9.21","localKeyId"),n("1.2.840.113549.1.9.22.1","x509Certificate"),n("1.2.840.113549.1.12.10.1.1","keyBag"),n("1.2.840.113549.1.12.10.1.2","pkcs8ShroudedKeyBag"),n("1.2.840.113549.1.12.10.1.3","certBag"),n("1.2.840.113549.1.12.10.1.4","crlBag"),n("1.2.840.113549.1.12.10.1.5","secretBag"),n("1.2.840.113549.1.12.10.1.6","safeContentsBag"),n("1.2.840.113549.1.5.13","pkcs5PBES2"),n("1.2.840.113549.1.5.12","pkcs5PBKDF2"),n("1.2.840.113549.1.12.1.1","pbeWithSHAAnd128BitRC4"),n("1.2.840.113549.1.12.1.2","pbeWithSHAAnd40BitRC4"),n("1.2.840.113549.1.12.1.3","pbeWithSHAAnd3-KeyTripleDES-CBC"),n("1.2.840.113549.1.12.1.4","pbeWithSHAAnd2-KeyTripleDES-CBC"),n("1.2.840.113549.1.12.1.5","pbeWithSHAAnd128BitRC2-CBC"),n("1.2.840.113549.1.12.1.6","pbewithSHAAnd40BitRC2-CBC"),n("1.2.840.113549.2.7","hmacWithSHA1"),n("1.2.840.113549.2.8","hmacWithSHA224"),n("1.2.840.113549.2.9","hmacWithSHA256"),n("1.2.840.113549.2.10","hmacWithSHA384"),n("1.2.840.113549.2.11","hmacWithSHA512"),n("1.2.840.113549.3.7","des-EDE3-CBC"),n("2.16.840.1.101.3.4.1.2","aes128-CBC"),n("2.16.840.1.101.3.4.1.22","aes192-CBC"),n("2.16.840.1.101.3.4.1.42","aes256-CBC"),n("2.5.4.3","commonName"),n("2.5.4.5","serialName"),n("2.5.4.6","countryName"),n("2.5.4.7","localityName"),n("2.5.4.8","stateOrProvinceName"),n("2.5.4.9","streetAddress"),n("2.5.4.10","organizationName"),n("2.5.4.11","organizationalUnitName"),n("2.5.4.13","description"),n("2.5.4.15","businessCategory"),n("2.5.4.17","postalCode"),n("1.3.6.1.4.1.311.60.2.1.2","jurisdictionOfIncorporationStateOrProvinceName"),n("1.3.6.1.4.1.311.60.2.1.3","jurisdictionOfIncorporationCountryName"),n("2.16.840.1.113730.1.1","nsCertType"),n("2.16.840.1.113730.1.13","nsComment"),i("2.5.29.1","authorityKeyIdentifier"),i("2.5.29.2","keyAttributes"),i("2.5.29.3","certificatePolicies"),i("2.5.29.4","keyUsageRestriction"),i("2.5.29.5","policyMapping"),i("2.5.29.6","subtreesConstraint"),i("2.5.29.7","subjectAltName"),i("2.5.29.8","issuerAltName"),i("2.5.29.9","subjectDirectoryAttributes"),i("2.5.29.10","basicConstraints"),i("2.5.29.11","nameConstraints"),i("2.5.29.12","policyConstraints"),i("2.5.29.13","basicConstraints"),n("2.5.29.14","subjectKeyIdentifier"),n("2.5.29.15","keyUsage"),i("2.5.29.16","privateKeyUsagePeriod"),n("2.5.29.17","subjectAltName"),n("2.5.29.18","issuerAltName"),n("2.5.29.19","basicConstraints"),i("2.5.29.20","cRLNumber"),i("2.5.29.21","cRLReason"),i("2.5.29.22","expirationDate"),i("2.5.29.23","instructionCode"),i("2.5.29.24","invalidityDate"),i("2.5.29.25","cRLDistributionPoints"),i("2.5.29.26","issuingDistributionPoint"),i("2.5.29.27","deltaCRLIndicator"),i("2.5.29.28","issuingDistributionPoint"),i("2.5.29.29","certificateIssuer"),i("2.5.29.30","nameConstraints"),n("2.5.29.31","cRLDistributionPoints"),n("2.5.29.32","certificatePolicies"),i("2.5.29.33","policyMappings"),i("2.5.29.34","policyConstraints"),n("2.5.29.35","authorityKeyIdentifier"),i("2.5.29.36","policyConstraints"),n("2.5.29.37","extKeyUsage"),i("2.5.29.46","freshestCRL"),i("2.5.29.54","inhibitAnyPolicy"),n("1.3.6.1.4.1.11129.2.4.2","timestampList"),n("1.3.6.1.5.5.7.1.1","authorityInfoAccess"),n("1.3.6.1.5.5.7.3.1","serverAuth"),n("1.3.6.1.5.5.7.3.2","clientAuth"),n("1.3.6.1.5.5.7.3.3","codeSigning"),n("1.3.6.1.5.5.7.3.4","emailProtection"),n("1.3.6.1.5.5.7.3.8","timeStamping")},function(e,t,r){function n(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,o=-1;for(i=0;i<t.length;++i,++a)if(a>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),a=i-o-1,o=-1,++i}else" "!==t[i]&&"\t"!==t[i]&&","!==t[i]||(o=i);return t}function i(e){return e.replace(/^\s+/,"")}var a=r(0);r(1);var o=e.exports=a.pem=a.pem||{};o.encode=function(e,t){t=t||{};var r,i="-----BEGIN "+e.type+"-----\r\n";if(e.procType&&(i+=n(r={name:"Proc-Type",values:[String(e.procType.version),e.procType.type]})),e.contentDomain&&(i+=n(r={name:"Content-Domain",values:[e.contentDomain]})),e.dekInfo&&(r={name:"DEK-Info",values:[e.dekInfo.algorithm]},e.dekInfo.parameters&&r.values.push(e.dekInfo.parameters),i+=n(r)),e.headers)for(var o=0;o<e.headers.length;++o)i+=n(e.headers[o]);return e.procType&&(i+="\r\n"),(i+=a.util.encode64(e.body,t.maxline||64)+"\r\n")+"-----END "+e.type+"-----\r\n"},o.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,o=/([\x21-\x7e]+):\s*([\x21-\x7e\s^:]+)/,s=/\r?\n/;t=n.exec(e);){var u={type:t[1],procType:null,contentDomain:null,dekInfo:null,headers:[],body:a.util.decode64(t[3])};if(r.push(u),t[2]){for(var c=t[2].split(s),l=0;t&&l<c.length;){for(var f=c[l].replace(/\s+$/,""),p=l+1;p<c.length;++p){var h=c[p];if(!/\s/.test(h[0]))break;f+=h,l=p}if(t=f.match(o)){for(var d={name:t[1],values:[]},g=t[2].split(","),y=0;y<g.length;++y)d.values.push(i(g[y]));if(u.procType)if(u.contentDomain||"Content-Domain"!==d.name)if(u.dekInfo||"DEK-Info"!==d.name)u.headers.push(d);else{if(0===d.values.length)throw new Error('Invalid PEM formatted message. The "DEK-Info" header must have at least one subfield.');u.dekInfo={algorithm:g[0],parameters:g[1]||null}}else u.contentDomain=g[0]||"";else{if("Proc-Type"!==d.name)throw new Error('Invalid PEM formatted message. The first encapsulated header must be "Proc-Type".');if(2!==d.values.length)throw new Error('Invalid PEM formatted message. The "Proc-Type" header must have two subfields.');u.procType={version:g[0],type:g[1]}}}++l}if("ENCRYPTED"===u.procType&&!u.dekInfo)throw new Error('Invalid PEM formatted message. The "DEK-Info" header must be present if "Proc-Type" is "ENCRYPTED".')}}if(0===r.length)throw new Error("Invalid PEM formatted message.");return r}},function(e,t,r){var n=r(0);r(4),r(1),(e.exports=n.hmac=n.hmac||{}).create=function(){var e=null,t=null,r=null,i=null,a={start:function(a,o){if(null!==a)if("string"==typeof a){if(!((a=a.toLowerCase())in n.md.algorithms))throw new Error('Unknown hash algorithm "'+a+'"');t=n.md.algorithms[a].create()}else t=a;if(null===o)o=e;else{if("string"==typeof o)o=n.util.createBuffer(o);else if(n.util.isArray(o)){var s=o;o=n.util.createBuffer();for(var u=0;u<s.length;++u)o.putByte(s[u])}var c=o.length();for(c>t.blockLength&&(t.start(),t.update(o.bytes()),o=t.digest()),r=n.util.createBuffer(),i=n.util.createBuffer(),c=o.length(),u=0;u<c;++u)s=o.at(u),r.putByte(54^s),i.putByte(92^s);if(c<t.blockLength)for(s=t.blockLength-c,u=0;u<s;++u)r.putByte(54),i.putByte(92);e=o,r=r.bytes(),i=i.bytes()}t.start(),t.update(r)},update:function(e){t.update(e)},getMac:function(){var e=t.digest().bytes();return t.start(),t.update(i),t.update(e),t.digest()}};return a.digest=a.getMac,a}},function(e,t,r){function n(e,t,r){for(var n,i,a,o,s,u,c,l=r.length();l>=64;){for(i=e.h0,a=e.h1,o=e.h2,s=e.h3,u=e.h4,c=0;c<16;++c)n=r.getInt32(),t[c]=n,n=(i<<5|i>>>27)+(s^a&(o^s))+u+1518500249+n,u=s,s=o,o=(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)+(s^a&(o^s))+u+1518500249+n,u=s,s=o,o=(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^o^s)+u+1859775393+n,u=s,s=o,o=(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^o^s)+u+1859775393+n,u=s,s=o,o=(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&o|s&(a^o))+u+2400959708+n,u=s,s=o,o=(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^o^s)+u+3395469782+n,u=s,s=o,o=(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+o|0,e.h3=e.h3+s|0,e.h4=e.h4+u|0,l-=64}}var i=r(0);r(4),r(1);var a=e.exports=i.sha1=i.sha1||{};i.md.sha1=i.md.algorithms.sha1=a,a.create=function(){s||(o=String.fromCharCode(128),o+=i.util.fillString(String.fromCharCode(0),64),s=!0);var e=null,t=i.util.createBuffer(),r=new Array(80),a={algorithm:"sha1",blockLength:64,digestLength:20,messageLength:0,fullMessageLength:null,messageLengthSize:8,start:function(){a.messageLength=0,a.fullMessageLength=a.messageLength64=[];for(var r=a.messageLengthSize/4,n=0;n<r;++n)a.fullMessageLength.push(0);return t=i.util.createBuffer(),e={h0:1732584193,h1:4023233417,h2:2562383102,h3:271733878,h4:3285377520},a}};return a.start(),a.update=function(o,s){"utf8"===s&&(o=i.util.encodeUtf8(o));var u=o.length;a.messageLength+=u,u=[u/4294967296>>>0,u>>>0];for(var c=a.fullMessageLength.length-1;c>=0;--c)a.fullMessageLength[c]+=u[1],u[1]=u[0]+(a.fullMessageLength[c]/4294967296>>>0),a.fullMessageLength[c]=a.fullMessageLength[c]>>>0,u[0]=u[1]/4294967296>>>0;return t.putBytes(o),n(e,r,t),(t.read>2048||0===t.length())&&t.compact(),a},a.digest=function(){var s=i.util.createBuffer();s.putBytes(t.bytes());var u=a.fullMessageLength[a.fullMessageLength.length-1]+a.messageLengthSize&a.blockLength-1;s.putBytes(o.substr(0,a.blockLength-u));for(var c,l=8*a.fullMessageLength[0],f=0;f<a.fullMessageLength.length-1;++f)l+=(c=8*a.fullMessageLength[f+1])/4294967296>>>0,s.putInt32(l>>>0),l=c>>>0;s.putInt32(l);var p={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4};n(p,r,s);var h=i.util.createBuffer();return h.putInt32(p.h0),h.putInt32(p.h1),h.putInt32(p.h2),h.putInt32(p.h3),h.putInt32(p.h4),h},a};var o=null,s=!1},function(e,t,r){function n(e,t){o.cipher.registerAlgorithm(e,(function(){return new o.des.Algorithm(e,t)}))}function i(e,t,r,n){var i,a=32===e.length?3:9;i=3===a?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,g=t[0],y=t[1];g^=(o=252645135&(g>>>4^y))<<4,g^=(o=65535&(g>>>16^(y^=o)))<<16,g^=o=858993459&((y^=o)>>>2^g),g^=o=16711935&((y^=o<<2)>>>8^g),g=(g^=(o=1431655765&(g>>>1^(y^=o<<8)))<<1)<<1|g>>>31,y=(y^=o)<<1|y>>>31;for(var v=0;v<a;v+=3){for(var m=i[v+1],C=i[v+2],E=i[v];E!=m;E+=C){var b=y^e[E],S=(y>>>4|y<<28)^e[E+1];o=g,g=y,y=o^(u[b>>>24&63]|l[b>>>16&63]|p[b>>>8&63]|d[63&b]|s[S>>>24&63]|c[S>>>16&63]|f[S>>>8&63]|h[63&S])}o=g,g=y,y=o}y=y>>>1|y<<31,y^=o=1431655765&((g=g>>>1|g<<31)>>>1^y),y^=(o=16711935&(y>>>8^(g^=o<<1)))<<8,y^=(o=858993459&(y>>>2^(g^=o)))<<2,y^=o=65535&((g^=o)>>>16^y),y^=o=252645135&((g^=o<<16)>>>4^y),g^=o<<4,r[0]=g,r[1]=y}function a(e){var t,r="DES-"+((e=e||{}).mode||"CBC").toUpperCase(),n=(t=e.decrypt?o.cipher.createDecipher(r,e.key):o.cipher.createCipher(r,e.key)).start;return t.start=function(e,r){var i=null;r instanceof o.util.ByteBuffer&&(i=r,r={}),(r=r||{}).output=i,r.iv=e,n.call(t,r)},t}var o=r(0);r(13),r(19),r(1),e.exports=o.des=o.des||{},o.des.startEncrypting=function(e,t,r,n){var i=a({key:e,output:r,decrypt:!1,mode:n||(null===t?"ECB":"CBC")});return i.start(t),i},o.des.createEncryptionCipher=function(e,t){return a({key:e,output:null,decrypt:!1,mode:t})},o.des.startDecrypting=function(e,t,r,n){var i=a({key:e,output:r,decrypt:!0,mode:n||(null===t?"ECB":"CBC")});return i.start(t),i},o.des.createDecryptionCipher=function(e,t){return a({key:e,output:null,decrypt:!0,mode:t})},o.des.Algorithm=function(e,t){var r=this;r.name=e,r.mode=new t({blockSize:8,cipher:{encrypt:function(e,t){return i(r._keys,e,t,!1)},decrypt:function(e,t){return i(r._keys,e,t,!0)}}}),r._init=!1},o.des.Algorithm.prototype.initialize=function(e){if(!this._init){var t=o.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],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],f=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],p=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],h=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],d=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],g=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],y=e.length()>8?3:1,v=[],m=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],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 B=0;B<m.length;++B){m[B]?(b=b<<2|b>>>26,S=S<<2|S>>>26):(b=b<<1|b>>>27,S=S<<1|S>>>27);var A=r[(b&=-15)>>>28]|n[b>>>24&15]|i[b>>>20&15]|a[b>>>16&15]|o[b>>>12&15]|s[b>>>8&15]|u[b>>>4&15],T=c[(S&=-15)>>>28]|l[S>>>24&15]|f[S>>>20&15]|p[S>>>16&15]|h[S>>>12&15]|d[S>>>8&15]|g[S>>>4&15];t=65535&(T>>>16^A),v[C++]=A^t,v[C++]=T^t<<16}}return v}(t),this._init=!0}},n("DES-ECB",o.cipher.modes.ecb),n("DES-CBC",o.cipher.modes.cbc),n("DES-CFB",o.cipher.modes.cfb),n("DES-OFB",o.cipher.modes.ofb),n("DES-CTR",o.cipher.modes.ctr),n("3DES-ECB",o.cipher.modes.ecb),n("3DES-CBC",o.cipher.modes.cbc),n("3DES-CFB",o.cipher.modes.cfb),n("3DES-OFB",o.cipher.modes.ofb),n("3DES-CTR",o.cipher.modes.ctr);var s=[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],u=[-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],c=[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],l=[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],f=[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],p=[536870928,541065216,16384,541081616,541065216,16,541081616,4194304,536887296,4210704,4194304,536870928,4194320,536887296,536870912,16400,0,4194320,536887312,16384,4210688,536887312,16,541065232,541065232,0,4210704,541081600,16400,4210688,541081600,536870912,536887296,16,541065232,4210688,541081616,4194304,16400,536870928,4194304,536887296,536870912,16400,536870928,541081616,4210688,541065216,4210704,541081600,0,541065232,16,16384,541065216,4210704,16384,4194320,536887312,0,541081600,536870912,4194320,536887312],h=[2097152,69206018,67110914,0,2048,67110914,2099202,69208064,69208066,2097152,0,67108866,2,67108864,69206018,2050,67110912,2099202,2097154,67110912,67108866,69206016,69208064,2097154,69206016,2048,2050,69208066,2099200,2,67108864,2099200,67108864,2099200,2097152,67110914,67110914,69206018,69206018,2,2097154,67108864,67110912,2097152,69208064,2050,2099202,69208064,2050,67108866,69208066,69206016,2099200,0,2,69208066,0,2099202,69206016,2048,67108866,67110912,2048,2097154],d=[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(e,t,r){function n(e,t,r){var n=p.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 o,s=i-3-e.length;if(0===r||1===r){o=0===r?0:255;for(var u=0;u<s;++u)n.putByte(o)}else for(;s>0;){var c=0,l=p.random.getBytes(s);for(u=0;u<s;++u)0===(o=l.charCodeAt(u))?++c:n.putByte(o);s=c}return n.putByte(0),n.putBytes(e),n}function i(e,t,r,n){var i=Math.ceil(t.n.bitLength()/8),a=p.util.createBuffer(e),o=a.getByte(),s=a.getByte();if(0!==o||r&&0!==s&&1!==s||!r&&2!=s||r&&0===s&&void 0===n)throw new Error("Encryption block is invalid.");var u=0;if(0===s){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===s)for(u=0;a.length()>1;){if(255!==a.getByte()){--a.read;break}++u}else if(2===s)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 a(e,t,r){function n(){i(e.pBits,(function(t,n){return t?r(t):(e.p=n,null!==e.q?a(t,e.q):void i(e.qBits,a))}))}function i(e,t){p.prime.generateProbablePrime(e,o,t)}function a(t,o){if(t)return r(t);if(e.q=o,e.p.compareTo(e.q)<0){var s=e.p;e.p=e.q,e.q=s}if(0!==e.p.subtract(h.ONE).gcd(e.e).compareTo(h.ONE))return e.p=null,void n();if(0!==e.q.subtract(h.ONE).gcd(e.e).compareTo(h.ONE))return e.q=null,void i(e.qBits,a);if(e.p1=e.p.subtract(h.ONE),e.q1=e.q.subtract(h.ONE),e.phi=e.p1.multiply(e.q1),0!==e.phi.gcd(e.e).compareTo(h.ONE))return e.p=e.q=null,void n();if(e.n=e.p.multiply(e.q),e.n.bitLength()!==e.bits)return e.q=null,void i(e.qBits,a);var u=e.e.modInverse(e.phi);e.keys={privateKey:v.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:v.rsa.setPublicKey(e.n,e.e)},r(null,e.keys)}"function"==typeof t&&(r=t,t={});var o={algorithm:{name:(t=t||{}).algorithm||"PRIMEINC",options:{workers:t.workers||2,workLoad:t.workLoad||100,workerScript:t.workerScript}}};"prng"in t&&(o.prng=t.prng),n()}function o(e){var t=e.toString(16);t[0]>="8"&&(t="00"+t);var r=p.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 s(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 u(e){return p.util.isNodejs&&"function"==typeof d[e]}function c(e){return void 0!==y.globalScope&&"object"==typeof y.globalScope.crypto&&"object"==typeof y.globalScope.crypto.subtle&&"function"==typeof y.globalScope.crypto.subtle[e]}function l(e){return void 0!==y.globalScope&&"object"==typeof y.globalScope.msCrypto&&"object"==typeof y.globalScope.msCrypto.subtle&&"function"==typeof y.globalScope.msCrypto.subtle[e]}function f(e){for(var t=p.util.hexToBytes(e.toString(16)),r=new Uint8Array(t.length),n=0;n<t.length;++n)r[n]=t.charCodeAt(n);return r}var p=r(0);if(r(3),r(12),r(6),r(26),r(27),r(2),r(1),void 0===h)var h=p.jsbn.BigInteger;var d=p.util.isNodejs?r(16):null,g=p.asn1,y=p.util;p.pki=p.pki||{},e.exports=p.pki.rsa=p.rsa=p.rsa||{};var v=p.pki,m=[6,4,2,4,2,4,6,2],C={name:"PrivateKeyInfo",tagClass:g.Class.UNIVERSAL,type:g.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:g.Class.UNIVERSAL,type:g.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:g.Class.UNIVERSAL,type:g.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:g.Class.UNIVERSAL,type:g.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:g.Class.UNIVERSAL,type:g.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},E={name:"RSAPrivateKey",tagClass:g.Class.UNIVERSAL,type:g.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:g.Class.UNIVERSAL,type:g.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",tagClass:g.Class.UNIVERSAL,type:g.Type.INTEGER,constructed:!1,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",tagClass:g.Class.UNIVERSAL,type:g.Type.INTEGER,constructed:!1,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",tagClass:g.Class.UNIVERSAL,type:g.Type.INTEGER,constructed:!1,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",tagClass:g.Class.UNIVERSAL,type:g.Type.INTEGER,constructed:!1,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",tagClass:g.Class.UNIVERSAL,type:g.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:g.Class.UNIVERSAL,type:g.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:g.Class.UNIVERSAL,type:g.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:g.Class.UNIVERSAL,type:g.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},b={name:"RSAPublicKey",tagClass:g.Class.UNIVERSAL,type:g.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:g.Class.UNIVERSAL,type:g.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:g.Class.UNIVERSAL,type:g.Type.INTEGER,constructed:!1,capture:"publicKeyExponent"}]},S=p.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:g.Class.UNIVERSAL,type:g.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:g.Class.UNIVERSAL,type:g.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:g.Class.UNIVERSAL,type:g.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:g.Class.UNIVERSAL,type:g.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:g.Class.UNIVERSAL,type:g.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},B=function(e){var t;if(!(e.algorithm in v.oids)){var r=new Error("Unknown message digest algorithm.");throw r.algorithm=e.algorithm,r}t=v.oids[e.algorithm];var n=g.oidToDer(t).getBytes(),i=g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[]),a=g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[]);a.value.push(g.create(g.Class.UNIVERSAL,g.Type.OID,!1,n)),a.value.push(g.create(g.Class.UNIVERSAL,g.Type.NULL,!1,""));var o=g.create(g.Class.UNIVERSAL,g.Type.OCTETSTRING,!1,e.digest().getBytes());return i.value.push(a),i.value.push(o),g.toDer(i).getBytes()},A=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(h.ONE))),t.dQ||(t.dQ=t.d.mod(t.q.subtract(h.ONE))),t.qInv||(t.qInv=t.q.modInverse(t.p));do{n=new h(p.util.bytesToHex(p.random.getBytes(t.n.bitLength()/8)),16)}while(n.compareTo(t.n)>=0||!n.gcd(t.n).equals(h.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 o=i.subtract(a).multiply(t.qInv).mod(t.p).multiply(t.q).add(a);return o.multiply(n.modInverse(t.n)).mod(t.n)};v.rsa.encrypt=function(e,t,r){var i,a=r,o=Math.ceil(t.n.bitLength()/8);!1!==r&&!0!==r?(a=2===r,i=n(e,t,r)):(i=p.util.createBuffer()).putBytes(e);for(var s=new h(i.toHex(),16),u=A(s,t,a).toString(16),c=p.util.createBuffer(),l=o-Math.ceil(u.length/2);l>0;)c.putByte(0),--l;return c.putBytes(p.util.hexToBytes(u)),c.getBytes()},v.rsa.decrypt=function(e,t,r,n){var a=Math.ceil(t.n.bitLength()/8);if(e.length!==a){var o=new Error("Encrypted message length is invalid.");throw o.length=e.length,o.expected=a,o}var s=new h(p.util.createBuffer(e).toHex(),16);if(s.compareTo(t.n)>=0)throw new Error("Encrypted message is invalid.");for(var u=A(s,t,r).toString(16),c=p.util.createBuffer(),l=a-Math.ceil(u.length/2);l>0;)c.putByte(0),--l;return c.putBytes(p.util.hexToBytes(u)),!1!==n?i(c.getBytes(),t,r):c.getBytes()},v.rsa.createKeyPairGenerationState=function(e,t,r){"string"==typeof e&&(e=parseInt(e,10)),e=e||2048;var n,i=(r=r||{}).prng||p.random,a={nextBytes:function(e){for(var t=i.getBytesSync(e.length),r=0;r<e.length;++r)e[r]=t.charCodeAt(r)}},o=r.algorithm||"PRIMEINC";if("PRIMEINC"!==o)throw new Error("Invalid key generation algorithm: "+o);return(n={algorithm:o,state:0,bits:e,rng:a,eInt:t||65537,e:new h(null),p:null,q:null,qBits:e>>1,pBits:e-(e>>1),pqState:0,num:null,keys:null}).e.fromInt(n.eInt),n},v.rsa.stepKeyPairGenerationState=function(e,t){"algorithm"in e||(e.algorithm="PRIMEINC");var r=new h(null);r.fromInt(30);for(var n,i=0,a=function(e,t){return e|t},o=+new Date,u=0;null===e.keys&&(t<=0||u<t);){if(0===e.state){var c=null===e.p?e.pBits:e.qBits,l=c-1;0===e.pqState?(e.num=new h(c,e.rng),e.num.testBit(l)||e.num.bitwiseTo(h.ONE.shiftLeft(l),a,e.num),e.num.dAddOffset(31-e.num.mod(r).byteValue(),0),i=0,++e.pqState):1===e.pqState?e.num.bitLength()>c?e.pqState=0:e.num.isProbablePrime(s(e.num.bitLength()))?++e.pqState:e.num.dAddOffset(m[i++%8],0):2===e.pqState?e.pqState=0===e.num.subtract(h.ONE).gcd(e.e).compareTo(h.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(h.ONE),e.q1=e.q.subtract(h.ONE),e.phi=e.p1.multiply(e.q1),++e.state;else if(3===e.state)0===e.phi.gcd(e.e).compareTo(h.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 f=e.e.modInverse(e.phi);e.keys={privateKey:v.rsa.setPrivateKey(e.n,e.e,f,e.p,e.q,f.mod(e.p1),f.mod(e.q1),e.q.modInverse(e.p)),publicKey:v.rsa.setPublicKey(e.n,e.e)}}u+=(n=+new Date)-o,o=n}return null!==e.keys},v.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),!p.options.usePureJavaScript&&!r.prng&&e>=256&&e<=16384&&(65537===t||3===t))if(n){if(u("generateKeyPair"))return d.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:v.privateKeyFromPem(r),publicKey:v.publicKeyFromPem(t)})}));if(c("generateKey")&&c("exportKey"))return y.globalScope.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:e,publicExponent:f(t),hash:{name:"SHA-256"}},!0,["sign","verify"]).then((function(e){return y.globalScope.crypto.subtle.exportKey("pkcs8",e.privateKey)})).then(void 0,(function(e){n(e)})).then((function(e){if(e){var t=v.privateKeyFromAsn1(g.fromDer(p.util.createBuffer(e)));n(null,{privateKey:t,publicKey:v.setRsaPublicKey(t.n,t.e)})}}));if(l("generateKey")&&l("exportKey")){var i=y.globalScope.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:e,publicExponent:f(t),hash:{name:"SHA-256"}},!0,["sign","verify"]);return i.oncomplete=function(e){var t=e.target.result,r=y.globalScope.msCrypto.subtle.exportKey("pkcs8",t.privateKey);r.oncomplete=function(e){var t=e.target.result,r=v.privateKeyFromAsn1(g.fromDer(p.util.createBuffer(t)));n(null,{privateKey:r,publicKey:v.setRsaPublicKey(r.n,r.e)})},r.onerror=function(e){n(e)}},void(i.onerror=function(e){n(e)})}}else if(u("generateKeyPairSync")){var o=d.generateKeyPairSync("rsa",{modulusLength:e,publicExponent:t,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});return{privateKey:v.privateKeyFromPem(o.privateKey),publicKey:v.publicKeyFromPem(o.publicKey)}}var s=v.rsa.createKeyPairGenerationState(e,t,r);if(!n)return v.rsa.stepKeyPairGenerationState(s,0),s.keys;a(s,r,n)},v.setRsaPublicKey=v.rsa.setPublicKey=function(e,t){var r={n:e,e:t,encrypt:function(e,t,i){if("string"==typeof t?t=t.toUpperCase():void 0===t&&(t="RSAES-PKCS1-V1_5"),"RSAES-PKCS1-V1_5"===t)t={encode:function(e,t,r){return n(e,t,2).getBytes()}};else if("RSA-OAEP"===t||"RSAES-OAEP"===t)t={encode:function(e,t){return p.pkcs1.encode_rsa_oaep(t,e,i)}};else if(-1!==["RAW","NONE","NULL",null].indexOf(t))t={encode:function(e){return e}};else if("string"==typeof t)throw new Error('Unsupported encryption scheme: "'+t+'".');var a=t.encode(e,r,!0);return v.rsa.encrypt(a,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=i(t,r,!0),e===g.fromDer(t).value[1].value}}:"NONE"!==n&&"NULL"!==n&&null!==n||(n={verify:function(e,t){return e===(t=i(t,r,!0))}});var a=v.rsa.decrypt(t,r,!0,!1);return n.verify(e,a,r.n.bitLength())}};return r},v.setRsaPrivateKey=v.rsa.setPrivateKey=function(e,t,r,n,a,o,s,u){var c={n:e,e:t,d:r,p:n,q:a,dP:o,dQ:s,qInv:u,decrypt:function(e,t,r){"string"==typeof t?t=t.toUpperCase():void 0===t&&(t="RSAES-PKCS1-V1_5");var n=v.rsa.decrypt(e,c,!1,!1);if("RSAES-PKCS1-V1_5"===t)t={decode:i};else if("RSA-OAEP"===t||"RSAES-OAEP"===t)t={decode:function(e,t){return p.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,c,!1)},sign:function(e,t){var r=!1;"string"==typeof t&&(t=t.toUpperCase()),void 0===t||"RSASSA-PKCS1-V1_5"===t?(t={encode:B},r=1):"NONE"!==t&&"NULL"!==t&&null!==t||(t={encode:function(){return e}},r=1);var n=t.encode(e,c.n.bitLength());return v.rsa.encrypt(n,c,r)}};return c},v.wrapRsaPrivateKey=function(e){return g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[g.create(g.Class.UNIVERSAL,g.Type.INTEGER,!1,g.integerToDer(0).getBytes()),g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[g.create(g.Class.UNIVERSAL,g.Type.OID,!1,g.oidToDer(v.oids.rsaEncryption).getBytes()),g.create(g.Class.UNIVERSAL,g.Type.NULL,!1,"")]),g.create(g.Class.UNIVERSAL,g.Type.OCTETSTRING,!1,g.toDer(e).getBytes())])},v.privateKeyFromAsn1=function(e){var t,r,n,i,a,o,s,u,c={},l=[];if(g.validate(e,C,c,l)&&(e=g.fromDer(p.util.createBuffer(c.privateKey))),c={},l=[],!g.validate(e,E,c,l)){var f=new Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey.");throw f.errors=l,f}return t=p.util.createBuffer(c.privateKeyModulus).toHex(),r=p.util.createBuffer(c.privateKeyPublicExponent).toHex(),n=p.util.createBuffer(c.privateKeyPrivateExponent).toHex(),i=p.util.createBuffer(c.privateKeyPrime1).toHex(),a=p.util.createBuffer(c.privateKeyPrime2).toHex(),o=p.util.createBuffer(c.privateKeyExponent1).toHex(),s=p.util.createBuffer(c.privateKeyExponent2).toHex(),u=p.util.createBuffer(c.privateKeyCoefficient).toHex(),v.setRsaPrivateKey(new h(t,16),new h(r,16),new h(n,16),new h(i,16),new h(a,16),new h(o,16),new h(s,16),new h(u,16))},v.privateKeyToAsn1=v.privateKeyToRSAPrivateKey=function(e){return g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[g.create(g.Class.UNIVERSAL,g.Type.INTEGER,!1,g.integerToDer(0).getBytes()),g.create(g.Class.UNIVERSAL,g.Type.INTEGER,!1,o(e.n)),g.create(g.Class.UNIVERSAL,g.Type.INTEGER,!1,o(e.e)),g.create(g.Class.UNIVERSAL,g.Type.INTEGER,!1,o(e.d)),g.create(g.Class.UNIVERSAL,g.Type.INTEGER,!1,o(e.p)),g.create(g.Class.UNIVERSAL,g.Type.INTEGER,!1,o(e.q)),g.create(g.Class.UNIVERSAL,g.Type.INTEGER,!1,o(e.dP)),g.create(g.Class.UNIVERSAL,g.Type.INTEGER,!1,o(e.dQ)),g.create(g.Class.UNIVERSAL,g.Type.INTEGER,!1,o(e.qInv))])},v.publicKeyFromAsn1=function(e){var t={},r=[];if(g.validate(e,S,t,r)){var n,i=g.derToOid(t.publicKeyOid);if(i!==v.oids.rsaEncryption)throw(n=new Error("Cannot read public key. Unknown OID.")).oid=i,n;e=t.rsaPublicKey}if(r=[],!g.validate(e,b,t,r))throw(n=new Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey.")).errors=r,n;var a=p.util.createBuffer(t.publicKeyModulus).toHex(),o=p.util.createBuffer(t.publicKeyExponent).toHex();return v.setRsaPublicKey(new h(a,16),new h(o,16))},v.publicKeyToAsn1=v.publicKeyToSubjectPublicKeyInfo=function(e){return g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[g.create(g.Class.UNIVERSAL,g.Type.OID,!1,g.oidToDer(v.oids.rsaEncryption).getBytes()),g.create(g.Class.UNIVERSAL,g.Type.NULL,!1,"")]),g.create(g.Class.UNIVERSAL,g.Type.BITSTRING,!1,[v.publicKeyToRSAPublicKey(e)])])},v.publicKeyToRSAPublicKey=function(e){return g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[g.create(g.Class.UNIVERSAL,g.Type.INTEGER,!1,o(e.n)),g.create(g.Class.UNIVERSAL,g.Type.INTEGER,!1,o(e.e))])}},function(e,t,r){function n(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 i(){return new n(null)}function a(e,t,r,n,i,a){for(var o=16383&t,s=t>>14;--a>=0;){var u=16383&this.data[e],c=this.data[e++]>>14,l=s*u+c*o;i=((u=o*u+((16383&l)<<14)+r.data[n]+i)>>28)+(l>>14)+s*c,r.data[n++]=268435455&u}return i}function o(e){return T.charAt(e)}function s(e,t){var r=w[e.charCodeAt(t)];return null==r?-1:r}function u(e){var t=i();return t.fromInt(e),t}function c(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 l(e){this.m=e}function f(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 p(e,t){return e&t}function h(e,t){return e|t}function d(e,t){return e^t}function g(e,t){return e&~t}function y(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 v(e){for(var t=0;0!=e;)e&=e-1,++t;return t}function m(){}function C(e){return e}function E(e){this.r2=i(),this.q3=i(),n.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}var b,S=r(0);e.exports=S.jsbn=S.jsbn||{},S.jsbn.BigInteger=n,"undefined"==typeof navigator?(n.prototype.am=a,b=28):"Microsoft Internet Explorer"==navigator.appName?(n.prototype.am=function(e,t,r,n,i,a){for(var o=32767&t,s=t>>15;--a>=0;){var u=32767&this.data[e],c=this.data[e++]>>15,l=s*u+c*o;i=((u=o*u+((32767&l)<<15)+r.data[n]+(1073741823&i))>>>30)+(l>>>15)+s*c+(i>>>30),r.data[n++]=1073741823&u}return i},b=30):"Netscape"!=navigator.appName?(n.prototype.am=function(e,t,r,n,i,a){for(;--a>=0;){var o=t*this.data[e++]+r.data[n]+i;i=Math.floor(o/67108864),r.data[n++]=67108863&o}return i},b=26):(n.prototype.am=a,b=28),n.prototype.DB=b,n.prototype.DM=(1<<b)-1,n.prototype.DV=1<<b,n.prototype.FV=Math.pow(2,52),n.prototype.F1=52-b,n.prototype.F2=2*b-52;var B,A,T="0123456789abcdefghijklmnopqrstuvwxyz",w=new Array;for(B="0".charCodeAt(0),A=0;A<=9;++A)w[B++]=A;for(B="a".charCodeAt(0),A=10;A<36;++A)w[B++]=A;for(B="A".charCodeAt(0),A=10;A<36;++A)w[B++]=A;l.prototype.convert=function(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e},l.prototype.revert=function(e){return e},l.prototype.reduce=function(e){e.divRemTo(this.m,null,e)},l.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},l.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},f.prototype.convert=function(e){var t=i();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(n.ZERO)>0&&this.m.subTo(t,t),t},f.prototype.revert=function(e){var t=i();return e.copyTo(t),this.reduce(t),t},f.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)},f.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},f.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},n.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},n.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},n.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 i=e.length,a=!1,o=0;--i>=0;){var u=8==r?255&e[i]:s(e,i);u<0?"-"==e.charAt(i)&&(a=!0):(a=!1,0==o?this.data[this.t++]=u:o+r>this.DB?(this.data[this.t-1]|=(u&(1<<this.DB-o)-1)<<o,this.data[this.t++]=u>>this.DB-o):this.data[this.t-1]|=u<<o,(o+=r)>=this.DB&&(o-=this.DB))}8==r&&0!=(128&e[0])&&(this.s=-1,o>0&&(this.data[this.t-1]|=(1<<this.DB-o)-1<<o)),this.clamp(),a&&n.ZERO.subTo(this,this)},n.prototype.clamp=function(){for(var e=this.s&this.DM;this.t>0&&this.data[this.t-1]==e;)--this.t},n.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},n.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},n.prototype.lShiftTo=function(e,t){var r,n=e%this.DB,i=this.DB-n,a=(1<<i)-1,o=Math.floor(e/this.DB),s=this.s<<n&this.DM;for(r=this.t-1;r>=0;--r)t.data[r+o+1]=this.data[r]>>i|s,s=(this.data[r]&a)<<n;for(r=o-1;r>=0;--r)t.data[r]=0;t.data[o]=s,t.t=this.t+o+1,t.s=this.s,t.clamp()},n.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 o=r+1;o<this.t;++o)t.data[o-r-1]|=(this.data[o]&a)<<i,t.data[o-r]=this.data[o]>>n;n>0&&(t.data[this.t-r-1]|=(this.s&a)<<i),t.t=this.t-r,t.clamp()}},n.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()},n.prototype.multiplyTo=function(e,t){var r=this.abs(),i=e.abs(),a=r.t;for(t.t=a+i.t;--a>=0;)t.data[a]=0;for(a=0;a<i.t;++a)t.data[a+r.t]=r.am(0,i.data[a],t,a,0,r.t);t.s=0,t.clamp(),this.s!=e.s&&n.ZERO.subTo(t,t)},n.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()},n.prototype.divRemTo=function(e,t,r){var a=e.abs();if(!(a.t<=0)){var o=this.abs();if(o.t<a.t)return null!=t&&t.fromInt(0),void(null!=r&&this.copyTo(r));null==r&&(r=i());var s=i(),u=this.s,l=e.s,f=this.DB-c(a.data[a.t-1]);f>0?(a.lShiftTo(f,s),o.lShiftTo(f,r)):(a.copyTo(s),o.copyTo(r));var p=s.t,h=s.data[p-1];if(0!=h){var d=h*(1<<this.F1)+(p>1?s.data[p-2]>>this.F2:0),g=this.FV/d,y=(1<<this.F1)/d,v=1<<this.F2,m=r.t,C=m-p,E=null==t?i():t;for(s.dlShiftTo(C,E),r.compareTo(E)>=0&&(r.data[r.t++]=1,r.subTo(E,r)),n.ONE.dlShiftTo(p,E),E.subTo(s,s);s.t<p;)s.data[s.t++]=0;for(;--C>=0;){var b=r.data[--m]==h?this.DM:Math.floor(r.data[m]*g+(r.data[m-1]+v)*y);if((r.data[m]+=s.am(0,b,r,C,0,p))<b)for(s.dlShiftTo(C,E),r.subTo(E,r);r.data[m]<--b;)r.subTo(E,r)}null!=t&&(r.drShiftTo(p,t),u!=l&&n.ZERO.subTo(t,t)),r.t=p,r.clamp(),f>0&&r.rShiftTo(f,r),u<0&&n.ZERO.subTo(r,r)}}},n.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},n.prototype.isEven=function(){return 0==(this.t>0?1&this.data[0]:this.s)},n.prototype.exp=function(e,t){if(e>4294967295||e<1)return n.ONE;var r=i(),a=i(),o=t.convert(this),s=c(e)-1;for(o.copyTo(r);--s>=0;)if(t.sqrTo(r,a),(e&1<<s)>0)t.mulTo(a,o,r);else{var u=r;r=a,a=u}return t.revert(r)},n.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,u=this.DB-s*this.DB%t;if(s-- >0)for(u<this.DB&&(r=this.data[s]>>u)>0&&(i=!0,a=o(r));s>=0;)u<t?(r=(this.data[s]&(1<<u)-1)<<t-u,r|=this.data[--s]>>(u+=this.DB-t)):(r=this.data[s]>>(u-=t)&n,u<=0&&(u+=this.DB,--s)),r>0&&(i=!0),i&&(a+=o(r));return i?a:"0"},n.prototype.negate=function(){var e=i();return n.ZERO.subTo(this,e),e},n.prototype.abs=function(){return this.s<0?this.negate():this},n.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},n.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+c(this.data[this.t-1]^this.s&this.DM)},n.prototype.mod=function(e){var t=i();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(n.ZERO)>0&&e.subTo(t,t),t},n.prototype.modPowInt=function(e,t){var r;return r=e<256||t.isEven()?new l(t):new f(t),this.exp(e,r)},n.ZERO=u(0),n.ONE=u(1),m.prototype.convert=C,m.prototype.revert=C,m.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r)},m.prototype.sqrTo=function(e,t){e.squareTo(t)},E.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=i();return e.copyTo(t),this.reduce(t),t},E.prototype.revert=function(e){return e},E.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)},E.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},E.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)};var I=[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],k=(1<<26)/I[I.length-1];n.prototype.chunkSize=function(e){return Math.floor(Math.LN2*this.DB/Math.log(e))},n.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=u(r),a=i(),o=i(),s="";for(this.divRemTo(n,a,o);a.signum()>0;)s=(r+o.intValue()).toString(e).substr(1)+s,a.divRemTo(n,a,o);return o.intValue().toString(e)+s},n.prototype.fromRadix=function(e,t){this.fromInt(0),null==t&&(t=10);for(var r=this.chunkSize(t),i=Math.pow(t,r),a=!1,o=0,u=0,c=0;c<e.length;++c){var l=s(e,c);l<0?"-"==e.charAt(c)&&0==this.signum()&&(a=!0):(u=t*u+l,++o>=r&&(this.dMultiply(i),this.dAddOffset(u,0),o=0,u=0))}o>0&&(this.dMultiply(Math.pow(t,o)),this.dAddOffset(u,0)),a&&n.ZERO.subTo(this,this)},n.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(n.ONE.shiftLeft(e-1),h,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(n.ONE.shiftLeft(e-1),this);else{var i=new Array,a=7&e;i.length=1+(e>>3),t.nextBytes(i),a>0?i[0]&=(1<<a)-1:i[0]=0,this.fromString(i,256)}},n.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()},n.prototype.changeBit=function(e,t){var r=n.ONE.shiftLeft(e);return this.bitwiseTo(r,t,r),r},n.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()},n.prototype.dMultiply=function(e){this.data[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()},n.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]}},n.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()},n.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)},n.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},n.prototype.millerRabin=function(e){var t=this.subtract(n.ONE),r=t.getLowestSetBit();if(r<=0)return!1;for(var i,a=t.shiftRight(r),o={nextBytes:function(e){for(var t=0;t<e.length;++t)e[t]=Math.floor(256*Math.random())}},s=0;s<e;++s){do{i=new n(this.bitLength(),o)}while(i.compareTo(n.ONE)<=0||i.compareTo(t)>=0);var u=i.modPow(a,this);if(0!=u.compareTo(n.ONE)&&0!=u.compareTo(t)){for(var c=1;c++<r&&0!=u.compareTo(t);)if(0==(u=u.modPowInt(2,this)).compareTo(n.ONE))return!1;if(0!=u.compareTo(t))return!1}}return!0},n.prototype.clone=function(){var e=i();return this.copyTo(e),e},n.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]},n.prototype.byteValue=function(){return 0==this.t?this.s:this.data[0]<<24>>24},n.prototype.shortValue=function(){return 0==this.t?this.s:this.data[0]<<16>>16},n.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this.data[0]<=0?0:1},n.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},n.prototype.equals=function(e){return 0==this.compareTo(e)},n.prototype.min=function(e){return this.compareTo(e)<0?this:e},n.prototype.max=function(e){return this.compareTo(e)>0?this:e},n.prototype.and=function(e){var t=i();return this.bitwiseTo(e,p,t),t},n.prototype.or=function(e){var t=i();return this.bitwiseTo(e,h,t),t},n.prototype.xor=function(e){var t=i();return this.bitwiseTo(e,d,t),t},n.prototype.andNot=function(e){var t=i();return this.bitwiseTo(e,g,t),t},n.prototype.not=function(){for(var e=i(),t=0;t<this.t;++t)e.data[t]=this.DM&~this.data[t];return e.t=this.t,e.s=~this.s,e},n.prototype.shiftLeft=function(e){var t=i();return e<0?this.rShiftTo(-e,t):this.lShiftTo(e,t),t},n.prototype.shiftRight=function(e){var t=i();return e<0?this.lShiftTo(-e,t):this.rShiftTo(e,t),t},n.prototype.getLowestSetBit=function(){for(var e=0;e<this.t;++e)if(0!=this.data[e])return e*this.DB+y(this.data[e]);return this.s<0?this.t*this.DB:-1},n.prototype.bitCount=function(){for(var e=0,t=this.s&this.DM,r=0;r<this.t;++r)e+=v(this.data[r]^t);return e},n.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)},n.prototype.setBit=function(e){return this.changeBit(e,h)},n.prototype.clearBit=function(e){return this.changeBit(e,g)},n.prototype.flipBit=function(e){return this.changeBit(e,d)},n.prototype.add=function(e){var t=i();return this.addTo(e,t),t},n.prototype.subtract=function(e){var t=i();return this.subTo(e,t),t},n.prototype.multiply=function(e){var t=i();return this.multiplyTo(e,t),t},n.prototype.divide=function(e){var t=i();return this.divRemTo(e,t,null),t},n.prototype.remainder=function(e){var t=i();return this.divRemTo(e,null,t),t},n.prototype.divideAndRemainder=function(e){var t=i(),r=i();return this.divRemTo(e,t,r),new Array(t,r)},n.prototype.modPow=function(e,t){var r,n,a=e.bitLength(),o=u(1);if(a<=0)return o;r=a<18?1:a<48?3:a<144?4:a<768?5:6,n=a<8?new l(t):t.isEven()?new E(t):new f(t);var s=new Array,p=3,h=r-1,d=(1<<r)-1;if(s[1]=n.convert(this),r>1){var g=i();for(n.sqrTo(s[1],g);p<=d;)s[p]=i(),n.mulTo(g,s[p-2],s[p]),p+=2}var y,v,m=e.t-1,C=!0,b=i();for(a=c(e.data[m])-1;m>=0;){for(a>=h?y=e.data[m]>>a-h&d:(y=(e.data[m]&(1<<a+1)-1)<<h-a,m>0&&(y|=e.data[m-1]>>this.DB+a-h)),p=r;0==(1&y);)y>>=1,--p;if((a-=p)<0&&(a+=this.DB,--m),C)s[y].copyTo(o),C=!1;else{for(;p>1;)n.sqrTo(o,b),n.sqrTo(b,o),p-=2;p>0?n.sqrTo(o,b):(v=o,o=b,b=v),n.mulTo(b,s[y],o)}for(;m>=0&&0==(e.data[m]&1<<a);)n.sqrTo(o,b),v=o,o=b,b=v,--a<0&&(a=this.DB-1,--m)}return n.revert(o)},n.prototype.modInverse=function(e){var t=e.isEven();if(this.isEven()&&t||0==e.signum())return n.ZERO;for(var r=e.clone(),i=this.clone(),a=u(1),o=u(0),s=u(0),c=u(1);0!=r.signum();){for(;r.isEven();)r.rShiftTo(1,r),t?(a.isEven()&&o.isEven()||(a.addTo(this,a),o.subTo(e,o)),a.rShiftTo(1,a)):o.isEven()||o.subTo(e,o),o.rShiftTo(1,o);for(;i.isEven();)i.rShiftTo(1,i),t?(s.isEven()&&c.isEven()||(s.addTo(this,s),c.subTo(e,c)),s.rShiftTo(1,s)):c.isEven()||c.subTo(e,c),c.rShiftTo(1,c);r.compareTo(i)>=0?(r.subTo(i,r),t&&a.subTo(s,a),o.subTo(c,o)):(i.subTo(r,i),t&&s.subTo(a,s),c.subTo(o,c))}return 0!=i.compareTo(n.ONE)?n.ZERO:c.compareTo(e)>=0?c.subtract(e):c.signum()<0?(c.addTo(e,c),c.signum()<0?c.add(e):c):c},n.prototype.pow=function(e){return this.exp(e,new m)},n.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},n.prototype.isProbablePrime=function(e){var t,r=this.abs();if(1==r.t&&r.data[0]<=I[I.length-1]){for(t=0;t<I.length;++t)if(r.data[0]==I[t])return!0;return!1}if(r.isEven())return!1;for(t=1;t<I.length;){for(var n=I[t],i=t+1;i<I.length&&n<k;)n*=I[i++];for(n=r.modInt(n);t<i;)if(n%I[t++]==0)return!1}return r.millerRabin(e)}},function(e,t,r){var n=r(0);r(1),e.exports=n.cipher=n.cipher||{},n.cipher.algorithms=n.cipher.algorithms||{},n.cipher.createCipher=function(e,t){var r=e;if("string"==typeof r&&(r=n.cipher.getAlgorithm(r))&&(r=r()),!r)throw new Error("Unsupported algorithm: "+e);return new n.cipher.BlockCipher({algorithm:r,key:t,decrypt:!1})},n.cipher.createDecipher=function(e,t){var r=e;if("string"==typeof r&&(r=n.cipher.getAlgorithm(r))&&(r=r()),!r)throw new Error("Unsupported algorithm: "+e);return new n.cipher.BlockCipher({algorithm:r,key:t,decrypt:!0})},n.cipher.registerAlgorithm=function(e,t){e=e.toUpperCase(),n.cipher.algorithms[e]=t},n.cipher.getAlgorithm=function(e){return(e=e.toUpperCase())in n.cipher.algorithms?n.cipher.algorithms[e]:null};var i=n.cipher.BlockCipher=function(e){this.algorithm=e.algorithm,this.mode=this.algorithm.mode,this.blockSize=this.mode.blockSize,this._finish=!1,this._input=null,this.output=null,this._op=e.decrypt?this.mode.decrypt:this.mode.encrypt,this._decrypt=e.decrypt,this.algorithm.initialize(e)};i.prototype.start=function(e){e=e||{};var t={};for(var r in e)t[r]=e[r];t.decrypt=this._decrypt,this._finish=!1,this._input=n.util.createBuffer(),this.output=e.output||n.util.createBuffer(),this.mode.start(t)},i.prototype.update=function(e){for(e&&this._input.putBuffer(e);!this._op.call(this.mode,this._input,this.output,this._finish)&&!this._finish;);this._input.compact()},i.prototype.finish=function(e){!e||"ECB"!==this.mode.name&&"CBC"!==this.mode.name||(this.mode.pad=function(t){return e(this.blockSize,t,!1)},this.mode.unpad=function(t){return e(this.blockSize,t,!0)});var t={};return t.decrypt=this._decrypt,t.overflow=this._input.length()%this.blockSize,!(!this._decrypt&&this.mode.pad&&!this.mode.pad(this._input,t)||(this._finish=!0,this.update(),this._decrypt&&this.mode.unpad&&!this.mode.unpad(this.output,t)||this.mode.afterFinish&&!this.mode.afterFinish(this.output,t)))}},function(e,t,r){function n(e,t,r){for(var n,i,a,o,l,f,p,h=r.length();h>=64;){for(i=e.h0,a=e.h1,o=e.h2,l=e.h3,p=0;p<16;++p)t[p]=r.getInt32Le(),n=i+(l^a&(o^l))+c[p]+t[p],i=l,l=o,o=a,a+=n<<(f=u[p])|n>>>32-f;for(;p<32;++p)n=i+(o^l&(a^o))+c[p]+t[s[p]],i=l,l=o,o=a,a+=n<<(f=u[p])|n>>>32-f;for(;p<48;++p)n=i+(a^o^l)+c[p]+t[s[p]],i=l,l=o,o=a,a+=n<<(f=u[p])|n>>>32-f;for(;p<64;++p)n=i+(o^(a|~l))+c[p]+t[s[p]],i=l,l=o,o=a,a+=n<<(f=u[p])|n>>>32-f;e.h0=e.h0+i|0,e.h1=e.h1+a|0,e.h2=e.h2+o|0,e.h3=e.h3+l|0,h-=64}}var i=r(0);r(4),r(1);var a=e.exports=i.md5=i.md5||{};i.md.md5=i.md.algorithms.md5=a,a.create=function(){l||function(){o=String.fromCharCode(128),o+=i.util.fillString(String.fromCharCode(0),64),s=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,1,6,11,0,5,10,15,4,9,14,3,8,13,2,7,12,5,8,11,14,1,4,7,10,13,0,3,6,9,12,15,2,0,7,14,5,12,3,10,1,8,15,6,13,4,11,2,9],u=[7,12,17,22,7,12,17,22,7,12,17,22,7,12,17,22,5,9,14,20,5,9,14,20,5,9,14,20,5,9,14,20,4,11,16,23,4,11,16,23,4,11,16,23,4,11,16,23,6,10,15,21,6,10,15,21,6,10,15,21,6,10,15,21],c=new Array(64);for(var e=0;e<64;++e)c[e]=Math.floor(4294967296*Math.abs(Math.sin(e+1)));l=!0}();var e=null,t=i.util.createBuffer(),r=new Array(16),a={algorithm:"md5",blockLength:64,digestLength:16,messageLength:0,fullMessageLength:null,messageLengthSize:8,start:function(){a.messageLength=0,a.fullMessageLength=a.messageLength64=[];for(var r=a.messageLengthSize/4,n=0;n<r;++n)a.fullMessageLength.push(0);return t=i.util.createBuffer(),e={h0:1732584193,h1:4023233417,h2:2562383102,h3:271733878},a}};return a.start(),a.update=function(o,s){"utf8"===s&&(o=i.util.encodeUtf8(o));var u=o.length;a.messageLength+=u,u=[u/4294967296>>>0,u>>>0];for(var c=a.fullMessageLength.length-1;c>=0;--c)a.fullMessageLength[c]+=u[1],u[1]=u[0]+(a.fullMessageLength[c]/4294967296>>>0),a.fullMessageLength[c]=a.fullMessageLength[c]>>>0,u[0]=u[1]/4294967296>>>0;return t.putBytes(o),n(e,r,t),(t.read>2048||0===t.length())&&t.compact(),a},a.digest=function(){var s=i.util.createBuffer();s.putBytes(t.bytes());var u=a.fullMessageLength[a.fullMessageLength.length-1]+a.messageLengthSize&a.blockLength-1;s.putBytes(o.substr(0,a.blockLength-u));for(var c,l=0,f=a.fullMessageLength.length-1;f>=0;--f)l=(c=8*a.fullMessageLength[f]+l)/4294967296>>>0,s.putInt32Le(c>>>0);var p={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3};n(p,r,s);var h=i.util.createBuffer();return h.putInt32Le(p.h0),h.putInt32Le(p.h1),h.putInt32Le(p.h2),h.putInt32Le(p.h3),h},a};var o=null,s=null,u=null,c=null,l=!1},function(e,r,n){var i=n(0);n(8),n(4),n(1);var a,o=i.pkcs5=i.pkcs5||{};i.util.isNodejs&&!i.options.usePureJavaScript&&(a=n(16)),e.exports=i.pbkdf2=o.pbkdf2=function(e,r,n,o,s,u){function c(){if(E>h)return u(null,C);g.start(null,null),g.update(r),g.update(i.util.int32ToBytes(E)),y=m=g.digest().getBytes(),b=2,l()}function l(){if(b<=n)return g.start(null,null),g.update(m),v=g.digest().getBytes(),y=i.util.xorBytes(y,v,f),m=v,++b,i.util.setImmediate(l);C+=E<h?y:y.substr(0,d),++E,c()}if("function"==typeof s&&(u=s,s=null),i.util.isNodejs&&!i.options.usePureJavaScript&&a.pbkdf2&&(null===s||"object"!=typeof s)&&(a.pbkdf2Sync.length>4||!s||"sha1"===s))return"string"!=typeof s&&(s="sha1"),e=t.from(e,"binary"),r=t.from(r,"binary"),u?4===a.pbkdf2Sync.length?a.pbkdf2(e,r,n,o,(function(e,t){if(e)return u(e);u(null,t.toString("binary"))})):a.pbkdf2(e,r,n,o,s,(function(e,t){if(e)return u(e);u(null,t.toString("binary"))})):4===a.pbkdf2Sync.length?a.pbkdf2Sync(e,r,n,o).toString("binary"):a.pbkdf2Sync(e,r,n,o,s).toString("binary");if(null!=s||(s="sha1"),"string"==typeof s){if(!(s in i.md.algorithms))throw new Error("Unknown hash algorithm: "+s);s=i.md[s].create()}var f=s.digestLength;if(o>4294967295*f){var p=new Error("Derived key is too long.");if(u)return u(p);throw p}var h=Math.ceil(o/f),d=o-(h-1)*f,g=i.hmac.create();g.start(s,e);var y,v,m,C="";if(!u){for(var E=1;E<=h;++E){g.start(null,null),g.update(r),g.update(i.util.int32ToBytes(E)),y=m=g.digest().getBytes();for(var b=2;b<=n;++b)g.start(null,null),g.update(m),v=g.digest().getBytes(),y=i.util.xorBytes(y,v,f),m=v;C+=E<h?y:y.substr(0,d)}return C}E=1,c()}},function(e,t){},function(e,t,r){function n(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?n=r:t.name&&t.name===r.name?n=r:t.shortName&&t.shortName===r.shortName&&(n=r);return n}function i(e){for(var t,r,n=f.create(f.Class.UNIVERSAL,f.Type.SEQUENCE,!0,[]),i=e.attributes,a=0;a<i.length;++a){var o=(t=i[a]).value,s=f.Type.PRINTABLESTRING;"valueTagClass"in t&&(s=t.valueTagClass)===f.Type.UTF8&&(o=l.util.encodeUtf8(o)),r=f.create(f.Class.UNIVERSAL,f.Type.SET,!0,[f.create(f.Class.UNIVERSAL,f.Type.SEQUENCE,!0,[f.create(f.Class.UNIVERSAL,f.Type.OID,!1,f.oidToDer(t.type).getBytes()),f.create(f.Class.UNIVERSAL,s,!1,o)])]),n.value.push(r)}return n}function a(e){for(var t,r=0;r<e.length;++r){if(void 0===(t=e[r]).name&&(t.type&&t.type in p.oids?t.name=p.oids[t.type]:t.shortName&&t.shortName in d&&(t.name=p.oids[d[t.shortName]])),void 0===t.type){if(!(t.name&&t.name in p.oids))throw(i=new Error("Attribute type not specified.")).attribute=t,i;t.type=p.oids[t.name]}if(void 0===t.shortName&&t.name&&t.name in d&&(t.shortName=d[t.name]),t.type===h.extensionRequest&&(t.valueConstructed=!0,t.valueTagClass=f.Type.SEQUENCE,!t.value&&t.extensions)){t.value=[];for(var n=0;n<t.extensions.length;++n)t.value.push(p.certificateExtensionToAsn1(o(t.extensions[n])))}var i;if(void 0===t.value)throw(i=new Error("Attribute value not specified.")).attribute=t,i}}function o(e,t){if(t=t||{},void 0===e.name&&e.id&&e.id in p.oids&&(e.name=p.oids[e.id]),void 0===e.id){if(!(e.name&&e.name in p.oids))throw(b=new Error("Extension ID not specified.")).extension=e,b;e.id=p.oids[e.name]}if(void 0!==e.value)return e;if("keyUsage"===e.name){var r=0,n=0,a=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&&(a|=128,r=7);var o=String.fromCharCode(r);0!==a?o+=String.fromCharCode(n)+String.fromCharCode(a):0!==n&&(o+=String.fromCharCode(n)),e.value=f.create(f.Class.UNIVERSAL,f.Type.BITSTRING,!1,o)}else if("basicConstraints"===e.name)e.value=f.create(f.Class.UNIVERSAL,f.Type.SEQUENCE,!0,[]),e.cA&&e.value.value.push(f.create(f.Class.UNIVERSAL,f.Type.BOOLEAN,!1,String.fromCharCode(255))),"pathLenConstraint"in e&&e.value.value.push(f.create(f.Class.UNIVERSAL,f.Type.INTEGER,!1,f.integerToDer(e.pathLenConstraint).getBytes()));else if("extKeyUsage"===e.name){e.value=f.create(f.Class.UNIVERSAL,f.Type.SEQUENCE,!0,[]);var s=e.value.value;for(var u in e)!0===e[u]&&(u in h?s.push(f.create(f.Class.UNIVERSAL,f.Type.OID,!1,f.oidToDer(h[u]).getBytes())):-1!==u.indexOf(".")&&s.push(f.create(f.Class.UNIVERSAL,f.Type.OID,!1,f.oidToDer(u).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),o=String.fromCharCode(r),0!==n&&(o+=String.fromCharCode(n)),e.value=f.create(f.Class.UNIVERSAL,f.Type.BITSTRING,!1,o);else if("subjectAltName"===e.name||"issuerAltName"===e.name){e.value=f.create(f.Class.UNIVERSAL,f.Type.SEQUENCE,!0,[]);for(var c=0;c<e.altNames.length;++c){if(o=(m=e.altNames[c]).value,7===m.type&&m.ip){if(null===(o=l.util.bytesFromIP(m.ip)))throw(b=new Error('Extension "ip" value is not a valid IPv4 or IPv6 address.')).extension=e,b}else 8===m.type&&(o=m.oid?f.oidToDer(f.oidToDer(m.oid)):f.oidToDer(o));e.value.value.push(f.create(f.Class.CONTEXT_SPECIFIC,m.type,!1,o))}}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=f.create(f.Class.UNIVERSAL,f.Type.IA5STRING,!1,e.comment)}else if("subjectKeyIdentifier"===e.name&&t.cert){var d=t.cert.generateSubjectKeyIdentifier();e.subjectKeyIdentifier=d.toHex(),e.value=f.create(f.Class.UNIVERSAL,f.Type.OCTETSTRING,!1,d.getBytes())}else if("authorityKeyIdentifier"===e.name&&t.cert){if(e.value=f.create(f.Class.UNIVERSAL,f.Type.SEQUENCE,!0,[]),s=e.value.value,e.keyIdentifier){var g=!0===e.keyIdentifier?t.cert.generateSubjectKeyIdentifier().getBytes():e.keyIdentifier;s.push(f.create(f.Class.CONTEXT_SPECIFIC,0,!1,g))}if(e.authorityCertIssuer){var y=[f.create(f.Class.CONTEXT_SPECIFIC,4,!0,[i(!0===e.authorityCertIssuer?t.cert.issuer:e.authorityCertIssuer)])];s.push(f.create(f.Class.CONTEXT_SPECIFIC,1,!0,y))}if(e.serialNumber){var v=l.util.hexToBytes(!0===e.serialNumber?t.cert.serialNumber:e.serialNumber);s.push(f.create(f.Class.CONTEXT_SPECIFIC,2,!1,v))}}else if("cRLDistributionPoints"===e.name){e.value=f.create(f.Class.UNIVERSAL,f.Type.SEQUENCE,!0,[]),s=e.value.value;var m,C=f.create(f.Class.UNIVERSAL,f.Type.SEQUENCE,!0,[]),E=f.create(f.Class.CONTEXT_SPECIFIC,0,!0,[]);for(c=0;c<e.altNames.length;++c){if(o=(m=e.altNames[c]).value,7===m.type&&m.ip){if(null===(o=l.util.bytesFromIP(m.ip)))throw(b=new Error('Extension "ip" value is not a valid IPv4 or IPv6 address.')).extension=e,b}else 8===m.type&&(o=m.oid?f.oidToDer(f.oidToDer(m.oid)):f.oidToDer(o));E.value.push(f.create(f.Class.CONTEXT_SPECIFIC,m.type,!1,o))}C.value.push(f.create(f.Class.CONTEXT_SPECIFIC,0,!0,[E])),s.push(C)}var b;if(void 0===e.value)throw(b=new Error("Extension value not specified.")).extension=e,b;return e}function s(e,t){switch(e){case h["RSASSA-PSS"]:var r=[];return void 0!==t.hash.algorithmOid&&r.push(f.create(f.Class.CONTEXT_SPECIFIC,0,!0,[f.create(f.Class.UNIVERSAL,f.Type.SEQUENCE,!0,[f.create(f.Class.UNIVERSAL,f.Type.OID,!1,f.oidToDer(t.hash.algorithmOid).getBytes()),f.create(f.Class.UNIVERSAL,f.Type.NULL,!1,"")])])),void 0!==t.mgf.algorithmOid&&r.push(f.create(f.Class.CONTEXT_SPECIFIC,1,!0,[f.create(f.Class.UNIVERSAL,f.Type.SEQUENCE,!0,[f.create(f.Class.UNIVERSAL,f.Type.OID,!1,f.oidToDer(t.mgf.algorithmOid).getBytes()),f.create(f.Class.UNIVERSAL,f.Type.SEQUENCE,!0,[f.create(f.Class.UNIVERSAL,f.Type.OID,!1,f.oidToDer(t.mgf.hash.algorithmOid).getBytes()),f.create(f.Class.UNIVERSAL,f.Type.NULL,!1,"")])])])),void 0!==t.saltLength&&r.push(f.create(f.Class.CONTEXT_SPECIFIC,2,!0,[f.create(f.Class.UNIVERSAL,f.Type.INTEGER,!1,f.integerToDer(t.saltLength).getBytes())])),f.create(f.Class.UNIVERSAL,f.Type.SEQUENCE,!0,r);default:return f.create(f.Class.UNIVERSAL,f.Type.NULL,!1,"")}}function u(e){var t=f.create(f.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,o=f.Type.UTF8;"valueTagClass"in i&&(o=i.valueTagClass),o===f.Type.UTF8&&(a=l.util.encodeUtf8(a));var s=!1;"valueConstructed"in i&&(s=i.valueConstructed);var u=f.create(f.Class.UNIVERSAL,f.Type.SEQUENCE,!0,[f.create(f.Class.UNIVERSAL,f.Type.OID,!1,f.oidToDer(i.type).getBytes()),f.create(f.Class.UNIVERSAL,f.Type.SET,!0,[f.create(f.Class.UNIVERSAL,o,s,a)])]);t.value.push(u)}return t}function c(e){return e>=b&&e<S?f.create(f.Class.UNIVERSAL,f.Type.UTCTIME,!1,f.dateToUtcTime(e)):f.create(f.Class.UNIVERSAL,f.Type.GENERALIZEDTIME,!1,f.dateToGeneralizedTime(e))}var l=r(0);r(5),r(3),r(10),r(4),r(39),r(6),r(7),r(18),r(11),r(1);var f=l.asn1,p=e.exports=l.pki=l.pki||{},h=p.oids,d={};d.CN=h.commonName,d.commonName="CN",d.C=h.countryName,d.countryName="C",d.L=h.localityName,d.localityName="L",d.ST=h.stateOrProvinceName,d.stateOrProvinceName="ST",d.O=h.organizationName,d.organizationName="O",d.OU=h.organizationalUnitName,d.organizationalUnitName="OU",d.E=h.emailAddress,d.emailAddress="E";var g=l.pki.rsa.publicKeyValidator,y={name:"Certificate",tagClass:f.Class.UNIVERSAL,type:f.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate",tagClass:f.Class.UNIVERSAL,type:f.Type.SEQUENCE,constructed:!0,captureAsn1:"tbsCertificate",value:[{name:"Certificate.TBSCertificate.version",tagClass:f.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.version.integer",tagClass:f.Class.UNIVERSAL,type:f.Type.INTEGER,constructed:!1,capture:"certVersion"}]},{name:"Certificate.TBSCertificate.serialNumber",tagClass:f.Class.UNIVERSAL,type:f.Type.INTEGER,constructed:!1,capture:"certSerialNumber"},{name:"Certificate.TBSCertificate.signature",tagClass:f.Class.UNIVERSAL,type:f.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.signature.algorithm",tagClass:f.Class.UNIVERSAL,type:f.Type.OID,constructed:!1,capture:"certinfoSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:f.Class.UNIVERSAL,optional:!0,captureAsn1:"certinfoSignatureParams"}]},{name:"Certificate.TBSCertificate.issuer",tagClass:f.Class.UNIVERSAL,type:f.Type.SEQUENCE,constructed:!0,captureAsn1:"certIssuer"},{name:"Certificate.TBSCertificate.validity",tagClass:f.Class.UNIVERSAL,type:f.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.validity.notBefore (utc)",tagClass:f.Class.UNIVERSAL,type:f.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity1UTCTime"},{name:"Certificate.TBSCertificate.validity.notBefore (generalized)",tagClass:f.Class.UNIVERSAL,type:f.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity2GeneralizedTime"},{name:"Certificate.TBSCertificate.validity.notAfter (utc)",tagClass:f.Class.UNIVERSAL,type:f.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity3UTCTime"},{name:"Certificate.TBSCertificate.validity.notAfter (generalized)",tagClass:f.Class.UNIVERSAL,type:f.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity4GeneralizedTime"}]},{name:"Certificate.TBSCertificate.subject",tagClass:f.Class.UNIVERSAL,type:f.Type.SEQUENCE,constructed:!0,captureAsn1:"certSubject"},g,{name:"Certificate.TBSCertificate.issuerUniqueID",tagClass:f.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.issuerUniqueID.id",tagClass:f.Class.UNIVERSAL,type:f.Type.BITSTRING,constructed:!1,captureBitStringValue:"certIssuerUniqueId"}]},{name:"Certificate.TBSCertificate.subjectUniqueID",tagClass:f.Class.CONTEXT_SPECIFIC,type:2,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.subjectUniqueID.id",tagClass:f.Class.UNIVERSAL,type:f.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSubjectUniqueId"}]},{name:"Certificate.TBSCertificate.extensions",tagClass:f.Class.CONTEXT_SPECIFIC,type:3,constructed:!0,captureAsn1:"certExtensions",optional:!0}]},{name:"Certificate.signatureAlgorithm",tagClass:f.Class.UNIVERSAL,type:f.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.signatureAlgorithm.algorithm",tagClass:f.Class.UNIVERSAL,type:f.Type.OID,constructed:!1,capture:"certSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:f.Class.UNIVERSAL,optional:!0,captureAsn1:"certSignatureParams"}]},{name:"Certificate.signatureValue",tagClass:f.Class.UNIVERSAL,type:f.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSignature"}]},v={name:"rsapss",tagClass:f.Class.UNIVERSAL,type:f.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.hashAlgorithm",tagClass:f.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier",tagClass:f.Class.UNIVERSAL,type:f.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier.algorithm",tagClass:f.Class.UNIVERSAL,type:f.Type.OID,constructed:!1,capture:"hashOid"}]}]},{name:"rsapss.maskGenAlgorithm",tagClass:f.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier",tagClass:f.Class.UNIVERSAL,type:f.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.algorithm",tagClass:f.Class.UNIVERSAL,type:f.Type.OID,constructed:!1,capture:"maskGenOid"},{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params",tagClass:f.Class.UNIVERSAL,type:f.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params.algorithm",tagClass:f.Class.UNIVERSAL,type:f.Type.OID,constructed:!1,capture:"maskGenHashOid"}]}]}]},{name:"rsapss.saltLength",tagClass:f.Class.CONTEXT_SPECIFIC,type:2,optional:!0,value:[{name:"rsapss.saltLength.saltLength",tagClass:f.Class.UNIVERSAL,type:f.Class.INTEGER,constructed:!1,capture:"saltLength"}]},{name:"rsapss.trailerField",tagClass:f.Class.CONTEXT_SPECIFIC,type:3,optional:!0,value:[{name:"rsapss.trailer.trailer",tagClass:f.Class.UNIVERSAL,type:f.Class.INTEGER,constructed:!1,capture:"trailer"}]}]},m={name:"CertificationRequestInfo",tagClass:f.Class.UNIVERSAL,type:f.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfo",value:[{name:"CertificationRequestInfo.integer",tagClass:f.Class.UNIVERSAL,type:f.Type.INTEGER,constructed:!1,capture:"certificationRequestInfoVersion"},{name:"CertificationRequestInfo.subject",tagClass:f.Class.UNIVERSAL,type:f.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfoSubject"},g,{name:"CertificationRequestInfo.attributes",tagClass:f.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"certificationRequestInfoAttributes",value:[{name:"CertificationRequestInfo.attributes",tagClass:f.Class.UNIVERSAL,type:f.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequestInfo.attributes.type",tagClass:f.Class.UNIVERSAL,type:f.Type.OID,constructed:!1},{name:"CertificationRequestInfo.attributes.value",tagClass:f.Class.UNIVERSAL,type:f.Type.SET,constructed:!0}]}]}]},C={name:"CertificationRequest",tagClass:f.Class.UNIVERSAL,type:f.Type.SEQUENCE,constructed:!0,captureAsn1:"csr",value:[m,{name:"CertificationRequest.signatureAlgorithm",tagClass:f.Class.UNIVERSAL,type:f.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequest.signatureAlgorithm.algorithm",tagClass:f.Class.UNIVERSAL,type:f.Type.OID,constructed:!1,capture:"csrSignatureOid"},{name:"CertificationRequest.signatureAlgorithm.parameters",tagClass:f.Class.UNIVERSAL,optional:!0,captureAsn1:"csrSignatureParams"}]},{name:"CertificationRequest.signature",tagClass:f.Class.UNIVERSAL,type:f.Type.BITSTRING,constructed:!1,captureBitStringValue:"csrSignature"}]};p.RDNAttributesAsArray=function(e,t){for(var r,n,i,a=[],o=0;o<e.value.length;++o){r=e.value[o];for(var s=0;s<r.value.length;++s)i={},n=r.value[s],i.type=f.derToOid(n.value[0].value),i.value=n.value[1].value,i.valueTagClass=n.value[1].type,i.type in h&&(i.name=h[i.type],i.name in d&&(i.shortName=d[i.name])),t&&(t.update(i.type),t.update(i.value)),a.push(i)}return a},p.CRIAttributesAsArray=function(e){for(var t=[],r=0;r<e.length;++r)for(var n=e[r],i=f.derToOid(n.value[0].value),a=n.value[1].value,o=0;o<a.length;++o){var s={};if(s.type=i,s.value=a[o].value,s.valueTagClass=a[o].type,s.type in h&&(s.name=h[s.type],s.name in d&&(s.shortName=d[s.name])),s.type===h.extensionRequest){s.extensions=[];for(var u=0;u<s.value.length;++u)s.extensions.push(p.certificateExtensionFromAsn1(s.value[u]))}t.push(s)}return t};var E=function(e,t,r){var n={};if(e!==h["RSASSA-PSS"])return n;r&&(n={hash:{algorithmOid:h.sha1},mgf:{algorithmOid:h.mgf1,hash:{algorithmOid:h.sha1}},saltLength:20});var i={},a=[];if(!f.validate(t,v,i,a)){var o=new Error("Cannot read RSASSA-PSS parameter block.");throw o.errors=a,o}return void 0!==i.hashOid&&(n.hash=n.hash||{},n.hash.algorithmOid=f.derToOid(i.hashOid)),void 0!==i.maskGenOid&&(n.mgf=n.mgf||{},n.mgf.algorithmOid=f.derToOid(i.maskGenOid),n.mgf.hash=n.mgf.hash||{},n.mgf.hash.algorithmOid=f.derToOid(i.maskGenHashOid)),void 0!==i.saltLength&&(n.saltLength=i.saltLength.charCodeAt(0)),n};p.certificateFromPem=function(e,t,r){var n=l.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=f.fromDer(n.body,r);return p.certificateFromAsn1(a,t)},p.certificateToPem=function(e,t){var r={type:"CERTIFICATE",body:f.toDer(p.certificateToAsn1(e)).getBytes()};return l.pem.encode(r,{maxline:t})},p.publicKeyFromPem=function(e){var t=l.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=f.fromDer(t.body);return p.publicKeyFromAsn1(n)},p.publicKeyToPem=function(e,t){var r={type:"PUBLIC KEY",body:f.toDer(p.publicKeyToAsn1(e)).getBytes()};return l.pem.encode(r,{maxline:t})},p.publicKeyToRSAPublicKeyPem=function(e,t){var r={type:"RSA PUBLIC KEY",body:f.toDer(p.publicKeyToRSAPublicKey(e)).getBytes()};return l.pem.encode(r,{maxline:t})},p.getPublicKeyFingerprint=function(e,t){var r,n=(t=t||{}).md||l.md.sha1.create();switch(t.type||"RSAPublicKey"){case"RSAPublicKey":r=f.toDer(p.publicKeyToRSAPublicKey(e)).getBytes();break;case"SubjectPublicKeyInfo":r=f.toDer(p.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},p.certificationRequestFromPem=function(e,t,r){var n=l.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=f.fromDer(n.body,r);return p.certificationRequestFromAsn1(a,t)},p.certificationRequestToPem=function(e,t){var r={type:"CERTIFICATE REQUEST",body:f.toDer(p.certificationRequestToAsn1(e)).getBytes()};return l.pem.encode(r,{maxline:t})},p.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 n(e.issuer,t)},e.issuer.addField=function(t){a([t]),e.issuer.attributes.push(t)},e.issuer.attributes=[],e.issuer.hash=null,e.subject={},e.subject.getField=function(t){return n(e.subject,t)},e.subject.addField=function(t){a([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){a(t),e.subject.attributes=t,delete e.subject.uniqueId,r&&(e.subject.uniqueId=r),e.subject.hash=null},e.setIssuer=function(t,r){a(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)o(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?n=r:t.name&&r.name===t.name&&(n=r);return n},e.sign=function(t,r){e.md=r||l.md.sha1.create();var n=h[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=p.getTBSCertificate(e);var a=f.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(g=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,g.actualIssuer=i.attributes,g}var a=t.md;if(null===a){if(t.signatureOid in h)switch(h[t.signatureOid]){case"sha1WithRSAEncryption":a=l.md.sha1.create();break;case"md5WithRSAEncryption":a=l.md.md5.create();break;case"sha256WithRSAEncryption":a=l.md.sha256.create();break;case"sha384WithRSAEncryption":a=l.md.sha384.create();break;case"sha512WithRSAEncryption":a=l.md.sha512.create();break;case"RSASSA-PSS":a=l.md.sha256.create()}if(null===a)throw(g=new Error("Could not compute certificate digest. Unknown signature OID.")).signatureOid=t.signatureOid,g;var o=t.tbsCertificate||p.getTBSCertificate(t),s=f.toDer(o);a.update(s.getBytes())}if(null!==a){var u;switch(t.signatureOid){case h.sha1WithRSAEncryption:u=void 0;break;case h["RSASSA-PSS"]:var c,d,g;if(void 0===(c=h[t.signatureParameters.mgf.hash.algorithmOid])||void 0===l.md[c])throw(g=new Error("Unsupported MGF hash function.")).oid=t.signatureParameters.mgf.hash.algorithmOid,g.name=c,g;if(void 0===(d=h[t.signatureParameters.mgf.algorithmOid])||void 0===l.mgf[d])throw(g=new Error("Unsupported MGF function.")).oid=t.signatureParameters.mgf.algorithmOid,g.name=d,g;if(d=l.mgf[d].create(l.md[c].create()),void 0===(c=h[t.signatureParameters.hash.algorithmOid])||void 0===l.md[c])throw{message:"Unsupported RSASSA-PSS hash function.",oid:t.signatureParameters.hash.algorithmOid,name:c};u=l.pss.create(l.md[c].create(),d,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){r=!0;for(var a,o,s=0;r&&s<n.attributes.length;++s)a=n.attributes[s],o=i.attributes[s],a.type===o.type&&a.value===o.value||(r=!1)}return r},e.issued=function(t){return t.isIssuer(e)},e.generateSubjectKeyIdentifier=function(){return p.getPublicKeyFingerprint(e.publicKey,{type:"RSAPublicKey"})},e.verifySubjectKeyIdentifier=function(){for(var t=h.subjectKeyIdentifier,r=0;r<e.extensions.length;++r){var n=e.extensions[r];if(n.id===t){var i=e.generateSubjectKeyIdentifier().getBytes();return l.util.hexToBytes(n.subjectKeyIdentifier)===i}}return!1},e},p.certificateFromAsn1=function(e,t){var r={},i=[];if(!f.validate(e,y,r,i))throw(c=new Error("Cannot read X.509 certificate. ASN.1 object is not an X509v3 Certificate.")).errors=i,c;if(f.derToOid(r.publicKeyOid)!==p.oids.rsaEncryption)throw new Error("Cannot read public key. OID is not RSA.");var o=p.createCertificate();o.version=r.certVersion?r.certVersion.charCodeAt(0):0;var s=l.util.createBuffer(r.certSerialNumber);o.serialNumber=s.toHex(),o.signatureOid=l.asn1.derToOid(r.certSignatureOid),o.signatureParameters=E(o.signatureOid,r.certSignatureParams,!0),o.siginfo.algorithmOid=l.asn1.derToOid(r.certinfoSignatureOid),o.siginfo.parameters=E(o.siginfo.algorithmOid,r.certinfoSignatureParams,!1),o.signature=r.certSignature;var u=[];if(void 0!==r.certValidity1UTCTime&&u.push(f.utcTimeToDate(r.certValidity1UTCTime)),void 0!==r.certValidity2GeneralizedTime&&u.push(f.generalizedTimeToDate(r.certValidity2GeneralizedTime)),void 0!==r.certValidity3UTCTime&&u.push(f.utcTimeToDate(r.certValidity3UTCTime)),void 0!==r.certValidity4GeneralizedTime&&u.push(f.generalizedTimeToDate(r.certValidity4GeneralizedTime)),u.length>2)throw new Error("Cannot read notBefore/notAfter validity times; more than two times were provided in the certificate.");if(u.length<2)throw new Error("Cannot read notBefore/notAfter validity times; they were not provided as either UTCTime or GeneralizedTime.");if(o.validity.notBefore=u[0],o.validity.notAfter=u[1],o.tbsCertificate=r.tbsCertificate,t){var c;if(o.md=null,o.signatureOid in h)switch(h[o.signatureOid]){case"sha1WithRSAEncryption":o.md=l.md.sha1.create();break;case"md5WithRSAEncryption":o.md=l.md.md5.create();break;case"sha256WithRSAEncryption":o.md=l.md.sha256.create();break;case"sha384WithRSAEncryption":o.md=l.md.sha384.create();break;case"sha512WithRSAEncryption":o.md=l.md.sha512.create();break;case"RSASSA-PSS":o.md=l.md.sha256.create()}if(null===o.md)throw(c=new Error("Could not compute certificate digest. Unknown signature OID.")).signatureOid=o.signatureOid,c;var d=f.toDer(o.tbsCertificate);o.md.update(d.getBytes())}var g=l.md.sha1.create();o.issuer.getField=function(e){return n(o.issuer,e)},o.issuer.addField=function(e){a([e]),o.issuer.attributes.push(e)},o.issuer.attributes=p.RDNAttributesAsArray(r.certIssuer,g),r.certIssuerUniqueId&&(o.issuer.uniqueId=r.certIssuerUniqueId),o.issuer.hash=g.digest().toHex();var v=l.md.sha1.create();return o.subject.getField=function(e){return n(o.subject,e)},o.subject.addField=function(e){a([e]),o.subject.attributes.push(e)},o.subject.attributes=p.RDNAttributesAsArray(r.certSubject,v),r.certSubjectUniqueId&&(o.subject.uniqueId=r.certSubjectUniqueId),o.subject.hash=v.digest().toHex(),r.certExtensions?o.extensions=p.certificateExtensionsFromAsn1(r.certExtensions):o.extensions=[],o.publicKey=p.publicKeyFromAsn1(r.subjectPublicKeyInfo),o},p.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(p.certificateExtensionFromAsn1(n.value[i]));return t},p.certificateExtensionFromAsn1=function(e){var t={};if(t.id=f.derToOid(e.value[0].value),t.critical=!1,e.value[1].type===f.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 h)if(t.name=h[t.id],"keyUsage"===t.name){var r=0,n=0;(a=f.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=f.fromDer(t.value)).value.length>0&&a.value[0].type===f.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===f.Type.INTEGER?i=a.value[0].value:a.value.length>1&&(i=a.value[1].value),null!==i&&(t.pathLenConstraint=f.derToInteger(i))}else if("extKeyUsage"===t.name)for(var a=f.fromDer(t.value),o=0;o<a.value.length;++o){var s=f.derToOid(a.value[o].value);s in h?t[h[s]]=!0:t[s]=!0}else if("nsCertType"===t.name)r=0,(a=f.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){t.altNames=[],a=f.fromDer(t.value);for(var u,c=0;c<a.value.length;++c){var p={type:(u=a.value[c]).type,value:u.value};switch(t.altNames.push(p),u.type){case 1:case 2:case 6:break;case 7:p.ip=l.util.bytesToIP(u.value);break;case 8:p.oid=f.derToOid(u.value)}}}else"subjectKeyIdentifier"===t.name&&(a=f.fromDer(t.value),t.subjectKeyIdentifier=l.util.bytesToHex(a.value));return t},p.certificationRequestFromAsn1=function(e,t){var r={},i=[];if(!f.validate(e,C,r,i))throw(s=new Error("Cannot read PKCS#10 certificate request. ASN.1 object is not a PKCS#10 CertificationRequest.")).errors=i,s;if(f.derToOid(r.publicKeyOid)!==p.oids.rsaEncryption)throw new Error("Cannot read public key. OID is not RSA.");var o=p.createCertificationRequest();if(o.version=r.csrVersion?r.csrVersion.charCodeAt(0):0,o.signatureOid=l.asn1.derToOid(r.csrSignatureOid),o.signatureParameters=E(o.signatureOid,r.csrSignatureParams,!0),o.siginfo.algorithmOid=l.asn1.derToOid(r.csrSignatureOid),o.siginfo.parameters=E(o.siginfo.algorithmOid,r.csrSignatureParams,!1),o.signature=r.csrSignature,o.certificationRequestInfo=r.certificationRequestInfo,t){var s;if(o.md=null,o.signatureOid in h)switch(h[o.signatureOid]){case"sha1WithRSAEncryption":o.md=l.md.sha1.create();break;case"md5WithRSAEncryption":o.md=l.md.md5.create();break;case"sha256WithRSAEncryption":o.md=l.md.sha256.create();break;case"sha384WithRSAEncryption":o.md=l.md.sha384.create();break;case"sha512WithRSAEncryption":o.md=l.md.sha512.create();break;case"RSASSA-PSS":o.md=l.md.sha256.create()}if(null===o.md)throw(s=new Error("Could not compute certification request digest. Unknown signature OID.")).signatureOid=o.signatureOid,s;var u=f.toDer(o.certificationRequestInfo);o.md.update(u.getBytes())}var c=l.md.sha1.create();return o.subject.getField=function(e){return n(o.subject,e)},o.subject.addField=function(e){a([e]),o.subject.attributes.push(e)},o.subject.attributes=p.RDNAttributesAsArray(r.certificationRequestInfoSubject,c),o.subject.hash=c.digest().toHex(),o.publicKey=p.publicKeyFromAsn1(r.subjectPublicKeyInfo),o.getAttribute=function(e){return n(o,e)},o.addAttribute=function(e){a([e]),o.attributes.push(e)},o.attributes=p.CRIAttributesAsArray(r.certificationRequestInfoAttributes||[]),o},p.createCertificationRequest=function(){var e={version:0,signatureOid:null,signature:null,siginfo:{}};return e.siginfo.algorithmOid=null,e.subject={},e.subject.getField=function(t){return n(e.subject,t)},e.subject.addField=function(t){a([t]),e.subject.attributes.push(t)},e.subject.attributes=[],e.subject.hash=null,e.publicKey=null,e.attributes=[],e.getAttribute=function(t){return n(e,t)},e.addAttribute=function(t){a([t]),e.attributes.push(t)},e.md=null,e.setSubject=function(t){a(t),e.subject.attributes=t,e.subject.hash=null},e.setAttributes=function(t){a(t),e.attributes=t},e.sign=function(t,r){e.md=r||l.md.sha1.create();var n=h[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=p.getCertificationRequestInfo(e);var a=f.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 h)switch(h[e.signatureOid]){case"sha1WithRSAEncryption":r=l.md.sha1.create();break;case"md5WithRSAEncryption":r=l.md.md5.create();break;case"sha256WithRSAEncryption":r=l.md.sha256.create();break;case"sha384WithRSAEncryption":r=l.md.sha384.create();break;case"sha512WithRSAEncryption":r=l.md.sha512.create();break;case"RSASSA-PSS":r=l.md.sha256.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||p.getCertificationRequestInfo(e),i=f.toDer(n);r.update(i.getBytes())}if(null!==r){var a;switch(e.signatureOid){case h.sha1WithRSAEncryption:break;case h["RSASSA-PSS"]:var o,s,u;if(void 0===(o=h[e.signatureParameters.mgf.hash.algorithmOid])||void 0===l.md[o])throw(u=new Error("Unsupported MGF hash function.")).oid=e.signatureParameters.mgf.hash.algorithmOid,u.name=o,u;if(void 0===(s=h[e.signatureParameters.mgf.algorithmOid])||void 0===l.mgf[s])throw(u=new Error("Unsupported MGF function.")).oid=e.signatureParameters.mgf.algorithmOid,u.name=s,u;if(s=l.mgf[s].create(l.md[o].create()),void 0===(o=h[e.signatureParameters.hash.algorithmOid])||void 0===l.md[o])throw(u=new Error("Unsupported RSASSA-PSS hash function.")).oid=e.signatureParameters.hash.algorithmOid,u.name=o,u;a=l.pss.create(l.md[o].create(),s,e.signatureParameters.saltLength)}t=e.publicKey.verify(r.digest().getBytes(),e.signature,a)}return t},e};var b=new Date("1950-01-01T00:00:00Z"),S=new Date("2050-01-01T00:00:00Z");p.getTBSCertificate=function(e){var t=c(e.validity.notBefore),r=c(e.validity.notAfter),n=f.create(f.Class.UNIVERSAL,f.Type.SEQUENCE,!0,[f.create(f.Class.CONTEXT_SPECIFIC,0,!0,[f.create(f.Class.UNIVERSAL,f.Type.INTEGER,!1,f.integerToDer(e.version).getBytes())]),f.create(f.Class.UNIVERSAL,f.Type.INTEGER,!1,l.util.hexToBytes(e.serialNumber)),f.create(f.Class.UNIVERSAL,f.Type.SEQUENCE,!0,[f.create(f.Class.UNIVERSAL,f.Type.OID,!1,f.oidToDer(e.siginfo.algorithmOid).getBytes()),s(e.siginfo.algorithmOid,e.siginfo.parameters)]),i(e.issuer),f.create(f.Class.UNIVERSAL,f.Type.SEQUENCE,!0,[t,r]),i(e.subject),p.publicKeyToAsn1(e.publicKey)]);return e.issuer.uniqueId&&n.value.push(f.create(f.Class.CONTEXT_SPECIFIC,1,!0,[f.create(f.Class.UNIVERSAL,f.Type.BITSTRING,!1,String.fromCharCode(0)+e.issuer.uniqueId)])),e.subject.uniqueId&&n.value.push(f.create(f.Class.CONTEXT_SPECIFIC,2,!0,[f.create(f.Class.UNIVERSAL,f.Type.BITSTRING,!1,String.fromCharCode(0)+e.subject.uniqueId)])),e.extensions.length>0&&n.value.push(p.certificateExtensionsToAsn1(e.extensions)),n},p.getCertificationRequestInfo=function(e){return f.create(f.Class.UNIVERSAL,f.Type.SEQUENCE,!0,[f.create(f.Class.UNIVERSAL,f.Type.INTEGER,!1,f.integerToDer(e.version).getBytes()),i(e.subject),p.publicKeyToAsn1(e.publicKey),u(e)])},p.distinguishedNameToAsn1=function(e){return i(e)},p.certificateToAsn1=function(e){var t=e.tbsCertificate||p.getTBSCertificate(e);return f.create(f.Class.UNIVERSAL,f.Type.SEQUENCE,!0,[t,f.create(f.Class.UNIVERSAL,f.Type.SEQUENCE,!0,[f.create(f.Class.UNIVERSAL,f.Type.OID,!1,f.oidToDer(e.signatureOid).getBytes()),s(e.signatureOid,e.signatureParameters)]),f.create(f.Class.UNIVERSAL,f.Type.BITSTRING,!1,String.fromCharCode(0)+e.signature)])},p.certificateExtensionsToAsn1=function(e){var t=f.create(f.Class.CONTEXT_SPECIFIC,3,!0,[]),r=f.create(f.Class.UNIVERSAL,f.Type.SEQUENCE,!0,[]);t.value.push(r);for(var n=0;n<e.length;++n)r.value.push(p.certificateExtensionToAsn1(e[n]));return t},p.certificateExtensionToAsn1=function(e){var t=f.create(f.Class.UNIVERSAL,f.Type.SEQUENCE,!0,[]);t.value.push(f.create(f.Class.UNIVERSAL,f.Type.OID,!1,f.oidToDer(e.id).getBytes())),e.critical&&t.value.push(f.create(f.Class.UNIVERSAL,f.Type.BOOLEAN,!1,String.fromCharCode(255)));var r=e.value;return"string"!=typeof e.value&&(r=f.toDer(r).getBytes()),t.value.push(f.create(f.Class.UNIVERSAL,f.Type.OCTETSTRING,!1,r)),t},p.certificationRequestToAsn1=function(e){var t=e.certificationRequestInfo||p.getCertificationRequestInfo(e);return f.create(f.Class.UNIVERSAL,f.Type.SEQUENCE,!0,[t,f.create(f.Class.UNIVERSAL,f.Type.SEQUENCE,!0,[f.create(f.Class.UNIVERSAL,f.Type.OID,!1,f.oidToDer(e.signatureOid).getBytes()),s(e.signatureOid,e.signatureParameters)]),f.create(f.Class.UNIVERSAL,f.Type.BITSTRING,!1,String.fromCharCode(0)+e.signature)])},p.createCaStore=function(e){function t(e){return r(e),n.certs[e.hash]||null}function r(e){if(!e.hash){var t=l.md.sha1.create();e.attributes=p.RDNAttributesAsArray(i(e),t),e.hash=t.digest().toHex()}}var n={certs:{},getIssuer:function(e){return t(e.issuer)},addCertificate:function(e){if("string"==typeof e&&(e=l.pki.certificateFromPem(e)),r(e.subject),!n.hasCertificate(e))if(e.subject.hash in n.certs){var t=n.certs[e.subject.hash];l.util.isArray(t)||(t=[t]),t.push(e),n.certs[e.subject.hash]=t}else n.certs[e.subject.hash]=e},hasCertificate:function(e){"string"==typeof e&&(e=l.pki.certificateFromPem(e));var r=t(e.subject);if(!r)return!1;l.util.isArray(r)||(r=[r]);for(var n=f.toDer(p.certificateToAsn1(e)).getBytes(),i=0;i<r.length;++i)if(n===f.toDer(p.certificateToAsn1(r[i])).getBytes())return!0;return!1},listAllCertificates:function(){var e=[];for(var t in n.certs)if(n.certs.hasOwnProperty(t)){var r=n.certs[t];if(l.util.isArray(r))for(var i=0;i<r.length;++i)e.push(r[i]);else e.push(r)}return e},removeCertificate:function(e){var i;if("string"==typeof e&&(e=l.pki.certificateFromPem(e)),r(e.subject),!n.hasCertificate(e))return null;var a=t(e.subject);if(!l.util.isArray(a))return i=n.certs[e.subject.hash],delete n.certs[e.subject.hash],i;for(var o=f.toDer(p.certificateToAsn1(e)).getBytes(),s=0;s<a.length;++s)o===f.toDer(p.certificateToAsn1(a[s])).getBytes()&&(i=a[s],a.splice(s,1));return 0===a.length&&delete n.certs[e.subject.hash],i}};if(e)for(var a=0;a<e.length;++a){var o=e[a];n.addCertificate(o)}return n},p.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"},p.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,o=null,s=0;do{var u=t.shift(),c=null,f=!1;if(i&&(i<u.validity.notBefore||i>u.validity.notAfter)&&(o={message:"Certificate is not valid yet or has expired.",error:p.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)&&(f=!0,c=u),c){var h=c;l.util.isArray(h)||(h=[h]);for(var d=!1;!d&&h.length>0;){c=h.shift();try{d=c.verify(u)}catch(e){}}d||(o={message:"Certificate signature is invalid.",error:p.certificateError.bad_certificate})}null!==o||c&&!f||e.hasCertificate(u)||(o={message:"Certificate is not trusted.",error:p.certificateError.unknown_ca})}if(null===o&&c&&!u.isIssuer(c)&&(o={message:"Certificate issuer is invalid.",error:p.certificateError.bad_certificate}),null===o)for(var g={keyUsage:!0,basicConstraints:!0},y=0;null===o&&y<u.extensions.length;++y){var v=u.extensions[y];!v.critical||v.name in g||(o={message:"Certificate has an unsupported critical extension.",error:p.certificateError.unsupported_certificate})}if(null===o&&(!a||0===t.length&&(!c||f))){var m=u.getExtension("basicConstraints"),C=u.getExtension("keyUsage");null!==C&&(C.keyCertSign&&null!==m||(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:p.certificateError.bad_certificate})),null!==o||null===m||m.cA||(o={message:"Certificate basicConstraints indicates the certificate is not a CA.",error:p.certificateError.bad_certificate}),null===o&&null!==C&&"pathLenConstraint"in m&&s-1>m.pathLenConstraint&&(o={message:"Certificate basicConstraints pathLenConstraint violated.",error:p.certificateError.bad_certificate})}var E=null===o||o.error,b=r.verify?r.verify(E,s,n):E;if(!0!==b)throw!0===E&&(o={message:"The application rejected the certificate.",error:p.certificateError.bad_certificate}),(b||0===b)&&("object"!=typeof b||l.util.isArray(b)?"string"==typeof b&&(o.error=b):(b.message&&(o.message=b.message),b.error&&(o.error=b.error))),o;o=null,a=!1,++s}while(t.length>0);return!0}},function(e,t,r){var n=r(0);r(2),r(1),(e.exports=n.pss=n.pss||{}).create=function(e){3===arguments.length&&(e={md:arguments[0],mgf:arguments[1],saltLength:arguments[2]});var t,r=e.md,i=e.mgf,a=r.digestLength,o=e.salt||null;if("string"==typeof o&&(o=n.util.createBuffer(o)),"saltLength"in e)t=e.saltLength;else{if(null===o)throw new Error("Salt length not specified or specific salt not given.");t=o.length()}if(null!==o&&o.length()!==t)throw new Error("Given salt length does not match length of given salt.");var s=e.prng||n.random,u={encode:function(e,u){var c,l,f=u-1,p=Math.ceil(f/8),h=e.digest().getBytes();if(p<a+t+2)throw new Error("Message is too long to encrypt.");l=null===o?s.getBytesSync(t):o.bytes();var d=new n.util.ByteBuffer;d.fillWithByte(0,8),d.putBytes(h),d.putBytes(l),r.start(),r.update(d.getBytes());var g=r.digest().getBytes(),y=new n.util.ByteBuffer;y.fillWithByte(0,p-t-a-2),y.putByte(1),y.putBytes(l);var v=y.getBytes(),m=p-a-1,C=i.generate(g,m),E="";for(c=0;c<m;c++)E+=String.fromCharCode(v.charCodeAt(c)^C.charCodeAt(c));var b=65280>>8*p-f&255;return(E=String.fromCharCode(E.charCodeAt(0)&~b)+E.substr(1))+g+String.fromCharCode(188)},verify:function(e,o,s){var u,c=s-1,l=Math.ceil(c/8);if(o=o.substr(-l),l<a+t+2)throw new Error("Inconsistent parameters to PSS signature verification.");if(188!==o.charCodeAt(l-1))throw new Error("Encoded message does not end in 0xBC.");var f=l-a-1,p=o.substr(0,f),h=o.substr(f,a),d=65280>>8*l-c&255;if(0!=(p.charCodeAt(0)&d))throw new Error("Bits beyond keysize not zero as expected.");var g=i.generate(h,f),y="";for(u=0;u<f;u++)y+=String.fromCharCode(p.charCodeAt(u)^g.charCodeAt(u));y=String.fromCharCode(y.charCodeAt(0)&~d)+y.substr(1);var v=l-a-t-2;for(u=0;u<v;u++)if(0!==y.charCodeAt(u))throw new Error("Leftmost octets not zero as expected");if(1!==y.charCodeAt(v))throw new Error("Inconsistent PSS signature, 0x01 marker not found");var m=y.substr(-t),C=new n.util.ByteBuffer;return C.fillWithByte(0,8),C.putBytes(e),C.putBytes(m),r.start(),r.update(C.getBytes()),h===r.digest().getBytes()}};return u}},function(e,t,r){function n(e,t){if("string"==typeof e&&(e=o.util.createBuffer(e)),o.util.isArray(e)&&e.length>4){var r=e;e=o.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(!o.util.isArray(e)){var i=[],a=t/4;for(n=0;n<a;++n)i.push(e.getInt32());e=i}return e}function i(e){e[e.length-1]=e[e.length-1]+1&4294967295}function a(e){return[e/4294967296|0,4294967295&e]}var o=r(0);r(1),o.cipher=o.cipher||{};var s=e.exports=o.cipher.modes=o.cipher.modes||{};s.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)},s.ecb.prototype.start=function(e){},s.ecb.prototype.encrypt=function(e,t,r){if(e.length()<this.blockSize&&!(r&&e.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=e.getInt32();for(this.cipher.encrypt(this._inBlock,this._outBlock),n=0;n<this._ints;++n)t.putInt32(this._outBlock[n])},s.ecb.prototype.decrypt=function(e,t,r){if(e.length()<this.blockSize&&!(r&&e.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=e.getInt32();for(this.cipher.decrypt(this._inBlock,this._outBlock),n=0;n<this._ints;++n)t.putInt32(this._outBlock[n])},s.ecb.prototype.pad=function(e,t){var r=e.length()===this.blockSize?this.blockSize:this.blockSize-e.length();return e.fillWithByte(r,r),!0},s.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))},s.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)},s.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=n(e.iv,this.blockSize),this._prev=this._iv.slice(0)}},s.cbc.prototype.encrypt=function(e,t,r){if(e.length()<this.blockSize&&!(r&&e.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=this._prev[n]^e.getInt32();for(this.cipher.encrypt(this._inBlock,this._outBlock),n=0;n<this._ints;++n)t.putInt32(this._outBlock[n]);this._prev=this._outBlock},s.cbc.prototype.decrypt=function(e,t,r){if(e.length()<this.blockSize&&!(r&&e.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=e.getInt32();for(this.cipher.decrypt(this._inBlock,this._outBlock),n=0;n<this._ints;++n)t.putInt32(this._prev[n]^this._outBlock[n]);this._prev=this._inBlock.slice(0)},s.cbc.prototype.pad=function(e,t){var r=e.length()===this.blockSize?this.blockSize:this.blockSize-e.length();return e.fillWithByte(r,r),!0},s.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))},s.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=o.util.createBuffer(),this._partialBytes=0},s.cfb.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=n(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},s.cfb.prototype.encrypt=function(e,t,r){var n=e.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var i=0;i<this._ints;++i)this._inBlock[i]=e.getInt32()^this._outBlock[i],t.putInt32(this._inBlock[i]);else{var a=(this.blockSize-n)%this.blockSize;for(a>0&&(a=this.blockSize-a),this._partialOutput.clear(),i=0;i<this._ints;++i)this._partialBlock[i]=e.getInt32()^this._outBlock[i],this._partialOutput.putInt32(this._partialBlock[i]);if(a>0)e.read-=this.blockSize;else for(i=0;i<this._ints;++i)this._inBlock[i]=this._partialBlock[i];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}},s.cfb.prototype.decrypt=function(e,t,r){var n=e.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var i=0;i<this._ints;++i)this._inBlock[i]=e.getInt32(),t.putInt32(this._inBlock[i]^this._outBlock[i]);else{var a=(this.blockSize-n)%this.blockSize;for(a>0&&(a=this.blockSize-a),this._partialOutput.clear(),i=0;i<this._ints;++i)this._partialBlock[i]=e.getInt32(),this._partialOutput.putInt32(this._partialBlock[i]^this._outBlock[i]);if(a>0)e.read-=this.blockSize;else for(i=0;i<this._ints;++i)this._inBlock[i]=this._partialBlock[i];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}},s.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=o.util.createBuffer(),this._partialBytes=0},s.ofb.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=n(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},s.ofb.prototype.encrypt=function(e,t,r){var n=e.length();if(0===e.length())return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var i=0;i<this._ints;++i)t.putInt32(e.getInt32()^this._outBlock[i]),this._inBlock[i]=this._outBlock[i];else{var a=(this.blockSize-n)%this.blockSize;for(a>0&&(a=this.blockSize-a),this._partialOutput.clear(),i=0;i<this._ints;++i)this._partialOutput.putInt32(e.getInt32()^this._outBlock[i]);if(a>0)e.read-=this.blockSize;else for(i=0;i<this._ints;++i)this._inBlock[i]=this._outBlock[i];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}},s.ofb.prototype.decrypt=s.ofb.prototype.encrypt,s.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=o.util.createBuffer(),this._partialBytes=0},s.ctr.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=n(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},s.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 a=0;a<this._ints;++a)t.putInt32(e.getInt32()^this._outBlock[a]);else{var o=(this.blockSize-n)%this.blockSize;for(o>0&&(o=this.blockSize-o),this._partialOutput.clear(),a=0;a<this._ints;++a)this._partialOutput.putInt32(e.getInt32()^this._outBlock[a]);if(o>0&&(e.read-=this.blockSize),this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),o>0&&!r)return t.putBytes(this._partialOutput.getBytes(o-this._partialBytes)),this._partialBytes=o,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}i(this._inBlock)},s.ctr.prototype.decrypt=s.ctr.prototype.encrypt,s.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=o.util.createBuffer(),this._partialBytes=0,this._R=3774873600},s.gcm.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");var t,r=o.util.createBuffer(e.iv);if(this._cipherLength=0,t="additionalData"in e?o.util.createBuffer(e.additionalData):o.util.createBuffer(),this._tagLength="tagLength"in e?e.tagLength:128,this._tag=null,e.decrypt&&(this._tag=o.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(a(8*n)))}this._inBlock=this._j0.slice(0),i(this._inBlock),this._partialBytes=0,t=o.util.createBuffer(t),this._aDataLength=a(8*t.length());var s=t.length()%this.blockSize;for(s&&t.fillWithByte(0,this.blockSize-s),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()])},s.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 a=0;a<this._ints;++a)t.putInt32(this._outBlock[a]^=e.getInt32());this._cipherLength+=this.blockSize}else{var o=(this.blockSize-n)%this.blockSize;for(o>0&&(o=this.blockSize-o),this._partialOutput.clear(),a=0;a<this._ints;++a)this._partialOutput.putInt32(e.getInt32()^this._outBlock[a]);if(o<=0||r){if(r){var s=n%this.blockSize;this._cipherLength+=s,this._partialOutput.truncate(this.blockSize-s)}else this._cipherLength+=this.blockSize;for(a=0;a<this._ints;++a)this._outBlock[a]=this._partialOutput.getInt32();this._partialOutput.read-=this.blockSize}if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),o>0&&!r)return e.read-=this.blockSize,t.putBytes(this._partialOutput.getBytes(o-this._partialBytes)),this._partialBytes=o,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}this._s=this.ghash(this._hashSubkey,this._s,this._outBlock),i(this._inBlock)},s.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),i(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 a=0;a<this._ints;++a)t.putInt32(this._outBlock[a]^this._hashBlock[a]);n<this.blockSize?this._cipherLength+=n%this.blockSize:this._cipherLength+=this.blockSize},s.gcm.prototype.afterFinish=function(e,t){var r=!0;t.decrypt&&t.overflow&&e.truncate(this.blockSize-t.overflow),this.tag=o.util.createBuffer();var n=this._aDataLength.concat(a(8*this._cipherLength));this._s=this.ghash(this._hashSubkey,this._s,n);var i=[];this.cipher.encrypt(this._j0,i);for(var s=0;s<this._ints;++s)this.tag.putInt32(this._s[s]^i[s]);return this.tag.truncate(this.tag.length()%(this._tagLength/8)),t.decrypt&&this.tag.bytes()!==this._tag&&(r=!1),r},s.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},s.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)},s.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},s.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)},s.gcm.prototype.generateHashTable=function(e,t){for(var r=8/t,n=4*r,i=16*r,a=new Array(i),o=0;o<i;++o){var s=[0,0,0,0],u=(n-1-o%n)*t;s[o/n|0]=1<<t-1<<u,a[o]=this.generateSubHashTable(this.multiply(s,e),t)}return a},s.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 o=1;o<a;++o){var s=i[a],u=i[o];i[a+o]=[s[0]^u[0],s[1]^u[1],s[2]^u[2],s[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}},function(e,t,r){var n=r(0);r(3),r(8),r(14),r(7),r(21),r(2),r(9),r(1);var i=function(e,t,r,i){var a=n.util.createBuffer(),o=e.length>>1,s=o+(1&e.length),u=e.substr(0,s),c=e.substr(o,s),l=n.util.createBuffer(),f=n.hmac.create();r=t+r;var p=Math.ceil(i/16),h=Math.ceil(i/20);f.start("MD5",u);var d=n.util.createBuffer();l.putBytes(r);for(var g=0;g<p;++g)f.start(null,null),f.update(l.getBytes()),l.putBuffer(f.digest()),f.start(null,null),f.update(l.bytes()+r),d.putBuffer(f.digest());f.start("SHA1",c);var y=n.util.createBuffer();for(l.clear(),l.putBytes(r),g=0;g<h;++g)f.start(null,null),f.update(l.getBytes()),l.putBuffer(f.digest()),f.start(null,null),f.update(l.bytes()+r),y.putBuffer(f.digest());return a.putBytes(n.util.xorBytes(d.getBytes(),y.getBytes(),i)),a},a=function(e,t,r){var i=!1;try{var a=e.deflate(t.fragment.getBytes());t.fragment=n.util.createBuffer(a),t.length=a.length,i=!0}catch(e){}return i},o=function(e,t,r){var i=!1;try{var a=e.inflate(t.fragment.getBytes());t.fragment=n.util.createBuffer(a),t.length=a.length,i=!0}catch(e){}return i},s=function(e,t){var r=0;switch(t){case 1:r=e.getByte();break;case 2:r=e.getInt16();break;case 3:r=e.getInt24();break;case 4:r=e.getInt32()}return n.util.createBuffer(e.getBytes(r))},u=function(e,t,r){e.putInt(r.length(),t<<3),e.putBuffer(r)},c={Versions:{TLS_1_0:{major:3,minor:1},TLS_1_1:{major:3,minor:2},TLS_1_2:{major:3,minor:3}}};c.SupportedVersions=[c.Versions.TLS_1_1,c.Versions.TLS_1_0],c.Version=c.SupportedVersions[0],c.MaxFragment=15360,c.ConnectionEnd={server:0,client:1},c.PRFAlgorithm={tls_prf_sha256:0},c.BulkCipherAlgorithm={none:null,rc4:0,des3:1,aes:2},c.CipherType={stream:0,block:1,aead:2},c.MACAlgorithm={none:null,hmac_md5:0,hmac_sha1:1,hmac_sha256:2,hmac_sha384:3,hmac_sha512:4},c.CompressionMethod={none:0,deflate:1},c.ContentType={change_cipher_spec:20,alert:21,handshake:22,application_data:23,heartbeat:24},c.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},c.Alert={},c.Alert.Level={warning:1,fatal:2},c.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},c.HeartbeatMessageType={heartbeat_request:1,heartbeat_response:2},c.CipherSuites={},c.getCipherSuite=function(e){var t=null;for(var r in c.CipherSuites){var n=c.CipherSuites[r];if(n.id[0]===e.charCodeAt(0)&&n.id[1]===e.charCodeAt(1)){t=n;break}}return t},c.handleUnexpected=function(e,t){!e.open&&e.entity===c.ConnectionEnd.client||e.error(e,{message:"Unexpected message. Received TLS record out of order.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.unexpected_message}})},c.handleHelloRequest=function(e,t,r){!e.handshaking&&e.handshakes>0&&(c.queue(e,c.createAlert(e,{level:c.Alert.Level.warning,description:c.Alert.Description.no_renegotiation})),c.flush(e)),e.process()},c.parseHelloMessage=function(e,t,r){var i=null,a=e.entity===c.ConnectionEnd.client;if(r<38)e.error(e,{message:a?"Invalid ServerHello message. Message too short.":"Invalid ClientHello message. Message too short.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.illegal_parameter}});else{var o=t.fragment,u=o.length();if(i={version:{major:o.getByte(),minor:o.getByte()},random:n.util.createBuffer(o.getBytes(32)),session_id:s(o,1),extensions:[]},a?(i.cipher_suite=o.getBytes(2),i.compression_method=o.getByte()):(i.cipher_suites=s(o,2),i.compression_methods=s(o,1)),(u=r-(u-o.length()))>0){for(var l=s(o,2);l.length()>0;)i.extensions.push({type:[l.getByte(),l.getByte()],data:s(l,2)});if(!a)for(var f=0;f<i.extensions.length;++f){var p=i.extensions[f];if(0===p.type[0]&&0===p.type[1])for(var h=s(p.data,2);h.length()>0&&0===h.getByte();)e.session.extensions.server_name.serverNameList.push(s(h,2).getBytes())}}if(e.session.version&&(i.version.major!==e.session.version.major||i.version.minor!==e.session.version.minor))return e.error(e,{message:"TLS version change is disallowed during renegotiation.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.protocol_version}});if(a)e.session.cipherSuite=c.getCipherSuite(i.cipher_suite);else for(var d=n.util.createBuffer(i.cipher_suites.bytes());d.length()>0&&(e.session.cipherSuite=c.getCipherSuite(d.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:c.Alert.Level.fatal,description:c.Alert.Description.handshake_failure},cipherSuite:n.util.bytesToHex(i.cipher_suite)});e.session.compressionMethod=a?i.compression_method:c.CompressionMethod.none}return i},c.createSecurityParameters=function(e,t){var r=e.entity===c.ConnectionEnd.client,n=t.random.bytes(),i=r?e.session.sp.client_random:n,a=r?n:c.createRandom().getBytes();e.session.sp={entity:e.entity,prf_algorithm:c.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}},c.handleServerHello=function(e,t,r){var n=c.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:c.Alert.Level.fatal,description:c.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=d,e.session.resuming=!0,e.session.sp.server_random=n.random.bytes()):(e.expect=l,e.session.resuming=!1,c.createSecurityParameters(e,n)),e.session.id=i,e.process()}},c.handleClientHello=function(e,t,r){var i=c.parseHelloMessage(e,t,r);if(!e.fail){var a=i.session_id.bytes(),o=null;if(e.sessionCache&&(null===(o=e.sessionCache.getSession(a))?a="":(o.version.major!==i.version.major||o.version.minor>i.version.minor)&&(o=null,a="")),0===a.length&&(a=n.random.getBytes(32)),e.session.id=a,e.session.clientHelloVersion=i.version,e.session.sp={},o)e.version=e.session.version=o.version,e.session.sp=o.sp;else{for(var s,u=1;u<c.SupportedVersions.length&&!((s=c.SupportedVersions[u]).minor<=i.version.minor);++u);e.version={major:s.major,minor:s.minor},e.session.version=e.version}null!==o?(e.expect=b,e.session.resuming=!0,e.session.sp.client_random=i.random.bytes()):(e.expect=!1!==e.verifyClient?m:C,e.session.resuming=!1,c.createSecurityParameters(e,i)),e.open=!0,c.queue(e,c.createRecord(e,{type:c.ContentType.handshake,data:c.createServerHello(e)})),e.session.resuming?(c.queue(e,c.createRecord(e,{type:c.ContentType.change_cipher_spec,data:c.createChangeCipherSpec()})),e.state.pending=c.createConnectionState(e),e.state.current.write=e.state.pending.write,c.queue(e,c.createRecord(e,{type:c.ContentType.handshake,data:c.createFinished(e)}))):(c.queue(e,c.createRecord(e,{type:c.ContentType.handshake,data:c.createCertificate(e)})),e.fail||(c.queue(e,c.createRecord(e,{type:c.ContentType.handshake,data:c.createServerKeyExchange(e)})),!1!==e.verifyClient&&c.queue(e,c.createRecord(e,{type:c.ContentType.handshake,data:c.createCertificateRequest(e)})),c.queue(e,c.createRecord(e,{type:c.ContentType.handshake,data:c.createServerHelloDone(e)})))),c.flush(e),e.process()}},c.handleCertificate=function(e,t,r){if(r<3)return e.error(e,{message:"Invalid Certificate message. Message too short.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.illegal_parameter}});var i,a,o=t.fragment,u={certificate_list:s(o,3)},l=[];try{for(;u.certificate_list.length()>0;)i=s(u.certificate_list,3),a=n.asn1.fromDer(i),i=n.pki.certificateFromAsn1(a,!0),l.push(i)}catch(t){return e.error(e,{message:"Could not parse certificate list.",cause:t,send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.bad_certificate}})}var p=e.entity===c.ConnectionEnd.client;!p&&!0!==e.verifyClient||0!==l.length?0===l.length?e.expect=p?f:C:(p?e.session.serverCertificate=l[0]:e.session.clientCertificate=l[0],c.verifyCertificateChain(e,l)&&(e.expect=p?f:C)):e.error(e,{message:p?"No server certificate provided.":"No client certificate provided.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.illegal_parameter}}),e.process()},c.handleServerKeyExchange=function(e,t,r){if(r>0)return e.error(e,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.unsupported_certificate}});e.expect=p,e.process()},c.handleClientKeyExchange=function(e,t,r){if(r<48)return e.error(e,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.unsupported_certificate}});var i=t.fragment,a={enc_pre_master_secret:s(i,2).getBytes()},o=null;if(e.getPrivateKey)try{o=e.getPrivateKey(e,e.session.serverCertificate),o=n.pki.privateKeyFromPem(o)}catch(t){e.error(e,{message:"Could not get private key.",cause:t,send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.internal_error}})}if(null===o)return e.error(e,{message:"No private key set.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.internal_error}});try{var u=e.session.sp;u.pre_master_secret=o.decrypt(a.enc_pre_master_secret);var l=e.session.clientHelloVersion;if(l.major!==u.pre_master_secret.charCodeAt(0)||l.minor!==u.pre_master_secret.charCodeAt(1))throw new Error("TLS version rollback attack detected.")}catch(e){u.pre_master_secret=n.random.getBytes(48)}e.expect=b,null!==e.session.clientCertificate&&(e.expect=E),e.process()},c.handleCertificateRequest=function(e,t,r){if(r<3)return e.error(e,{message:"Invalid CertificateRequest. Message too short.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.illegal_parameter}});var n=t.fragment,i={certificate_types:s(n,1),certificate_authorities:s(n,2)};e.session.certificateRequest=i,e.expect=h,e.process()},c.handleCertificateVerify=function(e,t,r){if(r<2)return e.error(e,{message:"Invalid CertificateVerify. Message too short.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.illegal_parameter}});var i=t.fragment;i.read-=4;var a=i.bytes();i.read+=4;var o={signature:s(i,2).getBytes()},u=n.util.createBuffer();u.putBuffer(e.session.md5.digest()),u.putBuffer(e.session.sha1.digest()),u=u.getBytes();try{if(!e.session.clientCertificate.publicKey.verify(u,o.signature,"NONE"))throw new Error("CertificateVerify signature does not match.");e.session.md5.update(a),e.session.sha1.update(a)}catch(t){return e.error(e,{message:"Bad signature in CertificateVerify.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.handshake_failure}})}e.expect=b,e.process()},c.handleServerHelloDone=function(e,t,r){if(r>0)return e.error(e,{message:"Invalid ServerHelloDone message. Invalid length.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.record_overflow}});if(null===e.serverCertificate){var i={message:"No server certificate provided. Not enough security.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.insufficient_security}},a=e.verify(e,i.alert.description,0,[]);if(!0!==a)return(a||0===a)&&("object"!=typeof a||n.util.isArray(a)?"number"==typeof a&&(i.alert.description=a):(a.message&&(i.message=a.message),a.alert&&(i.alert.description=a.alert))),e.error(e,i)}null!==e.session.certificateRequest&&(t=c.createRecord(e,{type:c.ContentType.handshake,data:c.createCertificate(e)}),c.queue(e,t)),t=c.createRecord(e,{type:c.ContentType.handshake,data:c.createClientKeyExchange(e)}),c.queue(e,t),e.expect=v;var o=function(e,t){null!==e.session.certificateRequest&&null!==e.session.clientCertificate&&c.queue(e,c.createRecord(e,{type:c.ContentType.handshake,data:c.createCertificateVerify(e,t)})),c.queue(e,c.createRecord(e,{type:c.ContentType.change_cipher_spec,data:c.createChangeCipherSpec()})),e.state.pending=c.createConnectionState(e),e.state.current.write=e.state.pending.write,c.queue(e,c.createRecord(e,{type:c.ContentType.handshake,data:c.createFinished(e)})),e.expect=d,c.flush(e),e.process()};if(null===e.session.certificateRequest||null===e.session.clientCertificate)return o(e,null);c.getClientSignature(e,o)},c.handleChangeCipherSpec=function(e,t){if(1!==t.fragment.getByte())return e.error(e,{message:"Invalid ChangeCipherSpec message received.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.illegal_parameter}});var r=e.entity===c.ConnectionEnd.client;(e.session.resuming&&r||!e.session.resuming&&!r)&&(e.state.pending=c.createConnectionState(e)),e.state.current.read=e.state.pending.read,(!e.session.resuming&&r||e.session.resuming&&!r)&&(e.state.pending=null),e.expect=r?g:S,e.process()},c.handleFinished=function(e,t,r){var a=t.fragment;a.read-=4;var o=a.bytes();a.read+=4;var s=t.fragment.getBytes();(a=n.util.createBuffer()).putBuffer(e.session.md5.digest()),a.putBuffer(e.session.sha1.digest());var u=e.entity===c.ConnectionEnd.client,l=u?"server finished":"client finished",f=e.session.sp;if((a=i(f.master_secret,l,a.getBytes(),12)).getBytes()!==s)return e.error(e,{message:"Invalid verify_data in Finished message.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.decrypt_error}});e.session.md5.update(o),e.session.sha1.update(o),(e.session.resuming&&u||!e.session.resuming&&!u)&&(c.queue(e,c.createRecord(e,{type:c.ContentType.change_cipher_spec,data:c.createChangeCipherSpec()})),e.state.current.write=e.state.pending.write,e.state.pending=null,c.queue(e,c.createRecord(e,{type:c.ContentType.handshake,data:c.createFinished(e)}))),e.expect=u?y:B,e.handshaking=!1,++e.handshakes,e.peerCertificate=u?e.session.serverCertificate:e.session.clientCertificate,c.flush(e),e.isConnected=!0,e.connected(e),e.process()},c.handleAlert=function(e,t){var r,n=t.fragment,i={level:n.getByte(),description:n.getByte()};switch(i.description){case c.Alert.Description.close_notify:r="Connection closed.";break;case c.Alert.Description.unexpected_message:r="Unexpected message.";break;case c.Alert.Description.bad_record_mac:r="Bad record MAC.";break;case c.Alert.Description.decryption_failed:r="Decryption failed.";break;case c.Alert.Description.record_overflow:r="Record overflow.";break;case c.Alert.Description.decompression_failure:r="Decompression failed.";break;case c.Alert.Description.handshake_failure:r="Handshake failure.";break;case c.Alert.Description.bad_certificate:r="Bad certificate.";break;case c.Alert.Description.unsupported_certificate:r="Unsupported certificate.";break;case c.Alert.Description.certificate_revoked:r="Certificate revoked.";break;case c.Alert.Description.certificate_expired:r="Certificate expired.";break;case c.Alert.Description.certificate_unknown:r="Certificate unknown.";break;case c.Alert.Description.illegal_parameter:r="Illegal parameter.";break;case c.Alert.Description.unknown_ca:r="Unknown certificate authority.";break;case c.Alert.Description.access_denied:r="Access denied.";break;case c.Alert.Description.decode_error:r="Decode error.";break;case c.Alert.Description.decrypt_error:r="Decrypt error.";break;case c.Alert.Description.export_restriction:r="Export restriction.";break;case c.Alert.Description.protocol_version:r="Unsupported protocol version.";break;case c.Alert.Description.insufficient_security:r="Insufficient security.";break;case c.Alert.Description.internal_error:r="Internal error.";break;case c.Alert.Description.user_canceled:r="User canceled.";break;case c.Alert.Description.no_renegotiation:r="Renegotiation not supported.";break;default:r="Unknown error."}if(i.description===c.Alert.Description.close_notify)return e.close();e.error(e,{message:r,send:!1,origin:e.entity===c.ConnectionEnd.client?"server":"client",alert:i}),e.process()},c.handleHandshake=function(e,t){var r=t.fragment,i=r.getByte(),a=r.getInt24();if(a>r.length())return e.fragmented=t,t.fragment=n.util.createBuffer(),r.read-=4,e.process();e.fragmented=null,r.read-=4;var o=r.bytes(a+4);r.read+=4,i in O[e.entity][e.expect]?(e.entity!==c.ConnectionEnd.server||e.open||e.fail||(e.handshaking=!0,e.session={version:null,extensions:{server_name:{serverNameList:[]}},cipherSuite:null,compressionMethod:null,serverCertificate:null,clientCertificate:null,md5:n.md.md5.create(),sha1:n.md.sha1.create()}),i!==c.HandshakeType.hello_request&&i!==c.HandshakeType.certificate_verify&&i!==c.HandshakeType.finished&&(e.session.md5.update(o),e.session.sha1.update(o)),O[e.entity][e.expect][i](e,t,a)):c.handleUnexpected(e,t)},c.handleApplicationData=function(e,t){e.data.putBuffer(t.fragment),e.dataReady(e),e.process()},c.handleHeartbeat=function(e,t){var r=t.fragment,i=r.getByte(),a=r.getInt16(),o=r.getBytes(a);if(i===c.HeartbeatMessageType.heartbeat_request){if(e.handshaking||a>o.length)return e.process();c.queue(e,c.createRecord(e,{type:c.ContentType.heartbeat,data:c.createHeartbeat(c.HeartbeatMessageType.heartbeat_response,o)})),c.flush(e)}else if(i===c.HeartbeatMessageType.heartbeat_response){if(o!==e.expectedHeartbeatPayload)return e.process();e.heartbeatReceived&&e.heartbeatReceived(e,n.util.createBuffer(o))}e.process()};var l=1,f=2,p=3,h=4,d=5,g=6,y=7,v=8,m=1,C=2,E=3,b=4,S=5,B=6,A=c.handleUnexpected,T=c.handleChangeCipherSpec,w=c.handleAlert,I=c.handleHandshake,k=c.handleApplicationData,_=c.handleHeartbeat,R=[];R[c.ConnectionEnd.client]=[[A,w,I,A,_],[A,w,I,A,_],[A,w,I,A,_],[A,w,I,A,_],[A,w,I,A,_],[T,w,A,A,_],[A,w,I,A,_],[A,w,I,k,_],[A,w,I,A,_]],R[c.ConnectionEnd.server]=[[A,w,I,A,_],[A,w,I,A,_],[A,w,I,A,_],[A,w,I,A,_],[T,w,A,A,_],[A,w,I,A,_],[A,w,I,k,_],[A,w,I,A,_]];var x=c.handleHelloRequest,N=c.handleServerHello,L=c.handleCertificate,D=c.handleServerKeyExchange,U=c.handleCertificateRequest,F=c.handleServerHelloDone,P=c.handleFinished,O=[];O[c.ConnectionEnd.client]=[[A,A,N,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A],[x,A,A,A,A,A,A,A,A,A,A,L,D,U,F,A,A,A,A,A,A],[x,A,A,A,A,A,A,A,A,A,A,A,D,U,F,A,A,A,A,A,A],[x,A,A,A,A,A,A,A,A,A,A,A,A,U,F,A,A,A,A,A,A],[x,A,A,A,A,A,A,A,A,A,A,A,A,A,F,A,A,A,A,A,A],[x,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A],[x,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,P],[x,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A],[x,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A]];var V=c.handleClientHello,M=c.handleClientKeyExchange,K=c.handleCertificateVerify;O[c.ConnectionEnd.server]=[[A,V,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A],[A,A,A,A,A,A,A,A,A,A,A,L,A,A,A,A,A,A,A,A,A],[A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,M,A,A,A,A],[A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,K,A,A,A,A,A],[A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A],[A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,P],[A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A],[A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A]],c.generateKeys=function(e,t){var r=i,n=t.client_random+t.server_random;e.session.resuming||(t.master_secret=r(t.pre_master_secret,"master secret",n,48).bytes(),t.pre_master_secret=null),n=t.server_random+t.client_random;var a=2*t.mac_key_length+2*t.enc_key_length,o=e.version.major===c.Versions.TLS_1_0.major&&e.version.minor===c.Versions.TLS_1_0.minor;o&&(a+=2*t.fixed_iv_length);var s=r(t.master_secret,"key expansion",n,a),u={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 o&&(u.client_write_IV=s.getBytes(t.fixed_iv_length),u.server_write_IV=s.getBytes(t.fixed_iv_length)),u},c.createConnectionState=function(e){var t=e.entity===c.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:c.Alert.Level.fatal,description:c.Alert.Description.decompression_failure}}):e.error(e,{message:"Could not decrypt record or bad MAC.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.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:c.Alert.Level.fatal,description:c.Alert.Description.internal_error}}):e.error(e,{message:"Could not compress record.",send:!1,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.internal_error}}),!e.fail},e.session){var i=e.session.sp;switch(e.session.cipherSuite.initSecurityParameters(i),i.keys=c.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 c.CompressionMethod.none:break;case c.CompressionMethod.deflate:n.read.compressFunction=o,n.write.compressFunction=a;break;default:throw new Error("Unsupported compression algorithm.")}}return n},c.createRandom=function(){var e=new Date,t=+e+6e4*e.getTimezoneOffset(),r=n.util.createBuffer();return r.putInt32(t),r.putBytes(n.random.getBytes(28)),r},c.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},c.createAlert=function(e,t){var r=n.util.createBuffer();return r.putByte(t.level),r.putByte(t.description),c.createRecord(e,{type:c.ContentType.alert,data:r})},c.createClientHello=function(e){e.session.clientHelloVersion={major:e.version.major,minor:e.version.minor};for(var t=n.util.createBuffer(),r=0;r<e.cipherSuites.length;++r){var i=e.cipherSuites[r];t.putByte(i.id[0]),t.putByte(i.id[1])}var a=t.length(),o=n.util.createBuffer();o.putByte(c.CompressionMethod.none);var s=o.length(),l=n.util.createBuffer();if(e.virtualHost){var f=n.util.createBuffer();f.putByte(0),f.putByte(0);var p=n.util.createBuffer();p.putByte(0),u(p,2,n.util.createBuffer(e.virtualHost));var h=n.util.createBuffer();u(h,2,p),u(f,2,h),l.putBuffer(f)}var d=l.length();d>0&&(d+=2);var g=e.session.id,y=g.length+1+2+4+28+2+a+1+s+d,v=n.util.createBuffer();return v.putByte(c.HandshakeType.client_hello),v.putInt24(y),v.putByte(e.version.major),v.putByte(e.version.minor),v.putBytes(e.session.sp.client_random),u(v,1,n.util.createBuffer(g)),u(v,2,t),u(v,1,o),d>0&&u(v,2,l),v},c.createServerHello=function(e){var t=e.session.id,r=t.length+1+2+4+28+2+1,i=n.util.createBuffer();return i.putByte(c.HandshakeType.server_hello),i.putInt24(r),i.putByte(e.version.major),i.putByte(e.version.minor),i.putBytes(e.session.sp.server_random),u(i,1,n.util.createBuffer(t)),i.putByte(e.session.cipherSuite.id[0]),i.putByte(e.session.cipherSuite.id[1]),i.putByte(e.session.compressionMethod),i},c.createCertificate=function(e){var t,r=e.entity===c.ConnectionEnd.client,i=null;e.getCertificate&&(t=r?e.session.certificateRequest:e.session.extensions.server_name.serverNameList,i=e.getCertificate(e,t));var a=n.util.createBuffer();if(null!==i)try{n.util.isArray(i)||(i=[i]);for(var o=null,s=0;s<i.length;++s){var l=n.pem.decode(i[s])[0];if("CERTIFICATE"!==l.type&&"X509 CERTIFICATE"!==l.type&&"TRUSTED CERTIFICATE"!==l.type){var f=new Error('Could not convert certificate from PEM; PEM header type is not "CERTIFICATE", "X509 CERTIFICATE", or "TRUSTED CERTIFICATE".');throw f.headerType=l.type,f}if(l.procType&&"ENCRYPTED"===l.procType.type)throw new Error("Could not convert certificate from PEM; PEM is encrypted.");var p=n.util.createBuffer(l.body);null===o&&(o=n.asn1.fromDer(p.bytes(),!1));var h=n.util.createBuffer();u(h,3,p),a.putBuffer(h)}i=n.pki.certificateFromAsn1(o),r?e.session.clientCertificate=i:e.session.serverCertificate=i}catch(r){return e.error(e,{message:"Could not send certificate list.",cause:r,send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.bad_certificate}})}var d=3+a.length(),g=n.util.createBuffer();return g.putByte(c.HandshakeType.certificate),g.putInt24(d),u(g,3,a),g},c.createClientKeyExchange=function(e){var t=n.util.createBuffer();t.putByte(e.session.clientHelloVersion.major),t.putByte(e.session.clientHelloVersion.minor),t.putBytes(n.random.getBytes(46));var r=e.session.sp;r.pre_master_secret=t.getBytes();var i=(t=e.session.serverCertificate.publicKey.encrypt(r.pre_master_secret)).length+2,a=n.util.createBuffer();return a.putByte(c.HandshakeType.client_key_exchange),a.putInt24(i),a.putInt16(t.length),a.putBytes(t),a},c.createServerKeyExchange=function(e){return n.util.createBuffer()},c.getClientSignature=function(e,t){var r=n.util.createBuffer();r.putBuffer(e.session.md5.digest()),r.putBuffer(e.session.sha1.digest()),r=r.getBytes(),e.getSignature=e.getSignature||function(e,t,r){var i=null;if(e.getPrivateKey)try{i=e.getPrivateKey(e,e.session.clientCertificate),i=n.pki.privateKeyFromPem(i)}catch(t){e.error(e,{message:"Could not get private key.",cause:t,send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.internal_error}})}null===i?e.error(e,{message:"No private key set.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.internal_error}}):t=i.sign(t,null),r(e,t)},e.getSignature(e,r,t)},c.createCertificateVerify=function(e,t){var r=t.length+2,i=n.util.createBuffer();return i.putByte(c.HandshakeType.certificate_verify),i.putInt24(r),i.putInt16(t.length),i.putBytes(t),i},c.createCertificateRequest=function(e){var t=n.util.createBuffer();t.putByte(1);var r=n.util.createBuffer();for(var i in e.caStore.certs){var a=e.caStore.certs[i],o=n.pki.distinguishedNameToAsn1(a.subject),s=n.asn1.toDer(o);r.putInt16(s.length()),r.putBuffer(s)}var l=1+t.length()+2+r.length(),f=n.util.createBuffer();return f.putByte(c.HandshakeType.certificate_request),f.putInt24(l),u(f,1,t),u(f,2,r),f},c.createServerHelloDone=function(e){var t=n.util.createBuffer();return t.putByte(c.HandshakeType.server_hello_done),t.putInt24(0),t},c.createChangeCipherSpec=function(){var e=n.util.createBuffer();return e.putByte(1),e},c.createFinished=function(e){var t=n.util.createBuffer();t.putBuffer(e.session.md5.digest()),t.putBuffer(e.session.sha1.digest());var r=e.entity===c.ConnectionEnd.client,a=e.session.sp,o=r?"client finished":"server finished";t=i(a.master_secret,o,t.getBytes(),12);var s=n.util.createBuffer();return s.putByte(c.HandshakeType.finished),s.putInt24(t.length()),s.putBuffer(t),s},c.createHeartbeat=function(e,t,r){void 0===r&&(r=t.length);var i=n.util.createBuffer();i.putByte(e),i.putInt16(r),i.putBytes(t);var a=i.length(),o=Math.max(16,a-r-3);return i.putBytes(n.random.getBytes(o)),i},c.queue=function(e,t){if(t&&(0!==t.fragment.length()||t.type!==c.ContentType.handshake&&t.type!==c.ContentType.alert&&t.type!==c.ContentType.change_cipher_spec)){if(t.type===c.ContentType.handshake){var r=t.fragment.bytes();e.session.md5.update(r),e.session.sha1.update(r),r=null}var i;if(t.fragment.length()<=c.MaxFragment)i=[t];else{i=[];for(var a=t.fragment.bytes();a.length>c.MaxFragment;)i.push(c.createRecord(e,{type:t.type,data:n.util.createBuffer(a.slice(0,c.MaxFragment))})),a=a.slice(c.MaxFragment);a.length>0&&i.push(c.createRecord(e,{type:t.type,data:n.util.createBuffer(a)}))}for(var o=0;o<i.length&&!e.fail;++o){var s=i[o];e.state.current.write.update(e,s)&&e.records.push(s)}}},c.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 H=function(e){switch(e){case!0:return!0;case n.pki.certificateError.bad_certificate:return c.Alert.Description.bad_certificate;case n.pki.certificateError.unsupported_certificate:return c.Alert.Description.unsupported_certificate;case n.pki.certificateError.certificate_revoked:return c.Alert.Description.certificate_revoked;case n.pki.certificateError.certificate_expired:return c.Alert.Description.certificate_expired;case n.pki.certificateError.certificate_unknown:return c.Alert.Description.certificate_unknown;case n.pki.certificateError.unknown_ca:return c.Alert.Description.unknown_ca;default:return c.Alert.Description.bad_certificate}};for(var j in c.verifyCertificateChain=function(e,t){try{var r={};for(var i in e.verifyOptions)r[i]=e.verifyOptions[i];r.verify=function(t,r,i){var a=(H(t),e.verify(e,t,r,i));if(!0!==a){if("object"==typeof a&&!n.util.isArray(a)){var o=new Error("The application rejected the certificate.");throw o.send=!0,o.alert={level:c.Alert.Level.fatal,description:c.Alert.Description.bad_certificate},a.message&&(o.message=a.message),a.alert&&(o.alert.description=a.alert),o}a!==t&&(a=function(e){switch(e){case!0:return!0;case c.Alert.Description.bad_certificate:return n.pki.certificateError.bad_certificate;case c.Alert.Description.unsupported_certificate:return n.pki.certificateError.unsupported_certificate;case c.Alert.Description.certificate_revoked:return n.pki.certificateError.certificate_revoked;case c.Alert.Description.certificate_expired:return n.pki.certificateError.certificate_expired;case c.Alert.Description.certificate_unknown:return n.pki.certificateError.certificate_unknown;case c.Alert.Description.unknown_ca:return n.pki.certificateError.unknown_ca;default:return n.pki.certificateError.bad_certificate}}(a))}return a},n.pki.verifyCertificateChain(e.caStore,t,r)}catch(t){var a=t;("object"!=typeof a||n.util.isArray(a))&&(a={send:!0,alert:{level:c.Alert.Level.fatal,description:H(t)}}),"send"in a||(a.send=!0),"alert"in a||(a.alert={level:c.Alert.Level.fatal,description:H(a.error)}),e.error(e,a)}return!e.fail},c.createSessionCache=function(e,t){var r=null;if(e&&e.getSession&&e.setSession&&e.order)r=e;else{for(var i in(r={}).cache=e||{},r.capacity=Math.max(t||100,1),r.order=[],e)r.order.length<=t?r.order.push(i):delete e[i];r.getSession=function(e){var t=null,i=null;if(e?i=n.util.bytesToHex(e):r.order.length>0&&(i=r.order[0]),null!==i&&i in r.cache)for(var a in t=r.cache[i],delete r.cache[i],r.order)if(r.order[a]===i){r.order.splice(a,1);break}return t},r.setSession=function(e,t){if(r.order.length===r.capacity){var i=r.order.shift();delete r.cache[i]}i=n.util.bytesToHex(e),r.order.push(i),r.cache[i]=t}}return r},c.createConnection=function(e){var t;t=e.caStore?n.util.isArray(e.caStore)?n.pki.createCaStore(e.caStore):e.caStore:n.pki.createCaStore();var r=e.cipherSuites||null;if(null===r)for(var i in r=[],c.CipherSuites)r.push(c.CipherSuites[i]);var a=e.server?c.ConnectionEnd.server:c.ConnectionEnd.client,o=e.sessionCache?c.createSessionCache(e.sessionCache):null,s={version:{major:c.Version.major,minor:c.Version.minor},entity:a,sessionId:e.sessionId,caStore:t,sessionCache:o,cipherSuites:r,connected:e.connected,virtualHost:e.virtualHost||null,verifyClient:e.verifyClient||!1,verify:e.verify||function(e,t,r,n){return t},verifyOptions:e.verifyOptions||{},getCertificate:e.getCertificate||null,getPrivateKey:e.getPrivateKey||null,getSignature:e.getSignature||null,input:n.util.createBuffer(),tlsData:n.util.createBuffer(),data:n.util.createBuffer(),tlsDataReady:e.tlsDataReady,dataReady:e.dataReady,heartbeatReceived:e.heartbeatReceived,closed:e.closed,error:function(t,r){r.origin=r.origin||(t.entity===c.ConnectionEnd.client?"client":"server"),r.send&&(c.queue(t,c.createAlert(t,r.alert)),c.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:c.Version.major,minor:c.Version.minor},s.record=null,s.session=null,s.peerCertificate=null,s.state={pending:null,current:null},s.expect=(s.entity,c.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=c.createConnectionState(s)}};return s.reset(),s.handshake=function(e){if(s.entity!==c.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:n.md.md5.create(),sha1:n.md.sha1.create()},t&&(s.version=t.version,s.session.sp=t.sp),s.session.sp.client_random=c.createRandom().getBytes(),s.open=!0,c.queue(s,c.createRecord(s,{type:c.ContentType.handshake,data:c.createClientHello(s)})),c.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,i=r.length();if(i<5)t=5-i;else{e.record={type:r.getByte(),version:{major:r.getByte(),minor:r.getByte()},length:r.getInt16(),fragment:n.util.createBuffer(),ready:!1};var a=e.record.version.major===e.version.major;a&&e.session&&e.session.version&&(a=e.record.version.minor===e.version.minor),a||e.error(e,{message:"Incompatible TLS version.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.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:c.Alert.Level.fatal,description:c.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-c.ContentType.change_cipher_spec,n=R[e.entity][e.expect];r in n?n[r](e,t):c.handleUnexpected(e,t)}(s,s.record)),t},s.prepare=function(e){return c.queue(s,c.createRecord(s,{type:c.ContentType.application_data,data:n.util.createBuffer(e)})),c.flush(s)},s.prepareHeartbeatRequest=function(e,t){return e instanceof n.util.ByteBuffer&&(e=e.bytes()),void 0===t&&(t=e.length),s.expectedHeartbeatPayload=e,c.queue(s,c.createRecord(s,{type:c.ContentType.heartbeat,data:c.createHeartbeat(c.HeartbeatMessageType.heartbeat_request,e,t)})),c.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,c.queue(s,c.createAlert(s,{level:c.Alert.Level.warning,description:c.Alert.Description.close_notify})),c.flush(s)),s.closed(s)),s.reset(e)},s},e.exports=n.tls=n.tls||{},c)"function"!=typeof c[j]&&(n.tls[j]=c[j]);n.tls.prf_tls1=i,n.tls.hmac_sha1=function(e,t,r){var i=n.hmac.create();i.start("SHA1",e);var a=n.util.createBuffer();return a.putInt32(t[0]),a.putInt32(t[1]),a.putByte(r.type),a.putByte(r.version.major),a.putByte(r.version.minor),a.putInt16(r.length),a.putBytes(r.fragment.bytes()),i.update(a.getBytes()),i.digest().getBytes()},n.tls.createSessionCache=c.createSessionCache,n.tls.createConnection=c.createConnection},function(e,t,r){var n=r(0);r(3),r(6),r(22),r(7),r(15),r(28),r(18),r(11),r(1),r(17);var i=n.asn1,a=e.exports=n.pki=n.pki||{};a.pemToDer=function(e){var t=n.pem.decode(e)[0];if(t.procType&&"ENCRYPTED"===t.procType.type)throw new Error("Could not convert PEM to DER; PEM is encrypted.");return n.util.createBuffer(t.body)},a.privateKeyFromPem=function(e){var t=n.pem.decode(e)[0];if("PRIVATE KEY"!==t.type&&"RSA PRIVATE KEY"!==t.type){var r=new Error('Could not convert private key from PEM; PEM header type is not "PRIVATE KEY" or "RSA PRIVATE KEY".');throw r.headerType=t.type,r}if(t.procType&&"ENCRYPTED"===t.procType.type)throw new Error("Could not convert private key from PEM; PEM is encrypted.");var o=i.fromDer(t.body);return a.privateKeyFromAsn1(o)},a.privateKeyToPem=function(e,t){var r={type:"RSA PRIVATE KEY",body:i.toDer(a.privateKeyToAsn1(e)).getBytes()};return n.pem.encode(r,{maxline:t})},a.privateKeyInfoToPem=function(e,t){var r={type:"PRIVATE KEY",body:i.toDer(e).getBytes()};return n.pem.encode(r,{maxline:t})}},function(e,t,r){function n(e,t){return e.start().update(t).digest().getBytes()}function i(e){var t;if(e){if(!(t=c.oids[u.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 a(t)}function a(e){var t=o.md;switch(e){case"hmacWithSHA224":t=o.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()}var o=r(0);if(r(5),r(3),r(10),r(4),r(6),r(15),r(7),r(2),r(25),r(11),r(1),void 0===s)var s=o.jsbn.BigInteger;var u=o.asn1,c=o.pki=o.pki||{};e.exports=c.pbe=o.pbe=o.pbe||{};var l=c.oids,f={name:"EncryptedPrivateKeyInfo",tagClass:u.Class.UNIVERSAL,type:u.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedPrivateKeyInfo.encryptionAlgorithm",tagClass:u.Class.UNIVERSAL,type:u.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:u.Class.UNIVERSAL,type:u.Type.OID,constructed:!1,capture:"encryptionOid"},{name:"AlgorithmIdentifier.parameters",tagClass:u.Class.UNIVERSAL,type:u.Type.SEQUENCE,constructed:!0,captureAsn1:"encryptionParams"}]},{name:"EncryptedPrivateKeyInfo.encryptedData",tagClass:u.Class.UNIVERSAL,type:u.Type.OCTETSTRING,constructed:!1,capture:"encryptedData"}]},p={name:"PBES2Algorithms",tagClass:u.Class.UNIVERSAL,type:u.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc",tagClass:u.Class.UNIVERSAL,type:u.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc.oid",tagClass:u.Class.UNIVERSAL,type:u.Type.OID,constructed:!1,capture:"kdfOid"},{name:"PBES2Algorithms.params",tagClass:u.Class.UNIVERSAL,type:u.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.params.salt",tagClass:u.Class.UNIVERSAL,type:u.Type.OCTETSTRING,constructed:!1,capture:"kdfSalt"},{name:"PBES2Algorithms.params.iterationCount",tagClass:u.Class.UNIVERSAL,type:u.Type.INTEGER,constructed:!1,capture:"kdfIterationCount"},{name:"PBES2Algorithms.params.keyLength",tagClass:u.Class.UNIVERSAL,type:u.Type.INTEGER,constructed:!1,optional:!0,capture:"keyLength"},{name:"PBES2Algorithms.params.prf",tagClass:u.Class.UNIVERSAL,type:u.Type.SEQUENCE,constructed:!0,optional:!0,value:[{name:"PBES2Algorithms.params.prf.algorithm",tagClass:u.Class.UNIVERSAL,type:u.Type.OID,constructed:!1,capture:"prfOid"}]}]}]},{name:"PBES2Algorithms.encryptionScheme",tagClass:u.Class.UNIVERSAL,type:u.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.encryptionScheme.oid",tagClass:u.Class.UNIVERSAL,type:u.Type.OID,constructed:!1,capture:"encOid"},{name:"PBES2Algorithms.encryptionScheme.iv",tagClass:u.Class.UNIVERSAL,type:u.Type.OCTETSTRING,constructed:!1,capture:"encIv"}]}]},h={name:"pkcs-12PbeParams",tagClass:u.Class.UNIVERSAL,type:u.Type.SEQUENCE,constructed:!0,value:[{name:"pkcs-12PbeParams.salt",tagClass:u.Class.UNIVERSAL,type:u.Type.OCTETSTRING,constructed:!1,capture:"salt"},{name:"pkcs-12PbeParams.iterations",tagClass:u.Class.UNIVERSAL,type:u.Type.INTEGER,constructed:!1,capture:"iterations"}]};c.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,s,f=o.random.getBytesSync(r.saltSize),p=r.count,h=u.integerToDer(p);if(0===r.algorithm.indexOf("aes")||"des"===r.algorithm){var d,g,y;switch(r.algorithm){case"aes128":n=16,d=16,g=l["aes128-CBC"],y=o.aes.createEncryptionCipher;break;case"aes192":n=24,d=16,g=l["aes192-CBC"],y=o.aes.createEncryptionCipher;break;case"aes256":n=32,d=16,g=l["aes256-CBC"],y=o.aes.createEncryptionCipher;break;case"des":n=8,d=8,g=l.desCBC,y=o.des.createEncryptionCipher;break;default:throw(S=new Error("Cannot encrypt private key. Unknown encryption algorithm.")).algorithm=r.algorithm,S}var v="hmacWith"+r.prfAlgorithm.toUpperCase(),m=a(v),C=o.pkcs5.pbkdf2(t,f,p,n,m),E=o.random.getBytesSync(d);(B=y(C)).start(E),B.update(u.toDer(e)),B.finish(),s=B.output.getBytes();var b=function(e,t,r,n){var i=u.create(u.Class.UNIVERSAL,u.Type.SEQUENCE,!0,[u.create(u.Class.UNIVERSAL,u.Type.OCTETSTRING,!1,e),u.create(u.Class.UNIVERSAL,u.Type.INTEGER,!1,t.getBytes())]);return"hmacWithSHA1"!==n&&i.value.push(u.create(u.Class.UNIVERSAL,u.Type.INTEGER,!1,o.util.hexToBytes(r.toString(16))),u.create(u.Class.UNIVERSAL,u.Type.SEQUENCE,!0,[u.create(u.Class.UNIVERSAL,u.Type.OID,!1,u.oidToDer(c.oids[n]).getBytes()),u.create(u.Class.UNIVERSAL,u.Type.NULL,!1,"")])),i}(f,h,n,v);i=u.create(u.Class.UNIVERSAL,u.Type.SEQUENCE,!0,[u.create(u.Class.UNIVERSAL,u.Type.OID,!1,u.oidToDer(l.pkcs5PBES2).getBytes()),u.create(u.Class.UNIVERSAL,u.Type.SEQUENCE,!0,[u.create(u.Class.UNIVERSAL,u.Type.SEQUENCE,!0,[u.create(u.Class.UNIVERSAL,u.Type.OID,!1,u.oidToDer(l.pkcs5PBKDF2).getBytes()),b]),u.create(u.Class.UNIVERSAL,u.Type.SEQUENCE,!0,[u.create(u.Class.UNIVERSAL,u.Type.OID,!1,u.oidToDer(g).getBytes()),u.create(u.Class.UNIVERSAL,u.Type.OCTETSTRING,!1,E)])])])}else{var S;if("3des"!==r.algorithm)throw(S=new Error("Cannot encrypt private key. Unknown encryption algorithm.")).algorithm=r.algorithm,S;n=24;var B,A=new o.util.ByteBuffer(f);C=c.pbe.generatePkcs12Key(t,A,1,p,n),E=c.pbe.generatePkcs12Key(t,A,2,p,n),(B=o.des.createEncryptionCipher(C)).start(E),B.update(u.toDer(e)),B.finish(),s=B.output.getBytes(),i=u.create(u.Class.UNIVERSAL,u.Type.SEQUENCE,!0,[u.create(u.Class.UNIVERSAL,u.Type.OID,!1,u.oidToDer(l["pbeWithSHAAnd3-KeyTripleDES-CBC"]).getBytes()),u.create(u.Class.UNIVERSAL,u.Type.SEQUENCE,!0,[u.create(u.Class.UNIVERSAL,u.Type.OCTETSTRING,!1,f),u.create(u.Class.UNIVERSAL,u.Type.INTEGER,!1,h.getBytes())])])}return u.create(u.Class.UNIVERSAL,u.Type.SEQUENCE,!0,[i,u.create(u.Class.UNIVERSAL,u.Type.OCTETSTRING,!1,s)])},c.decryptPrivateKeyInfo=function(e,t){var r=null,n={},i=[];if(!u.validate(e,f,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=u.derToOid(n.encryptionOid),l=c.pbe.getCipher(s,n.encryptionParams,t),p=o.util.createBuffer(n.encryptedData);return l.update(p),l.finish()&&(r=u.fromDer(l.output)),r},c.encryptedPrivateKeyToPem=function(e,t){var r={type:"ENCRYPTED PRIVATE KEY",body:u.toDer(e).getBytes()};return o.pem.encode(r,{maxline:t})},c.encryptedPrivateKeyFromPem=function(e){var t=o.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 u.fromDer(t.body)},c.encryptRsaPrivateKey=function(e,t,r){if(!(r=r||{}).legacy){var n=c.wrapRsaPrivateKey(c.privateKeyToAsn1(e));return n=c.encryptPrivateKeyInfo(n,t,r),c.encryptedPrivateKeyToPem(n)}var i,a,s,l;switch(r.algorithm){case"aes128":i="AES-128-CBC",s=16,a=o.random.getBytesSync(16),l=o.aes.createEncryptionCipher;break;case"aes192":i="AES-192-CBC",s=24,a=o.random.getBytesSync(16),l=o.aes.createEncryptionCipher;break;case"aes256":i="AES-256-CBC",s=32,a=o.random.getBytesSync(16),l=o.aes.createEncryptionCipher;break;case"3des":i="DES-EDE3-CBC",s=24,a=o.random.getBytesSync(8),l=o.des.createEncryptionCipher;break;case"des":i="DES-CBC",s=8,a=o.random.getBytesSync(8),l=o.des.createEncryptionCipher;break;default:var f=new Error('Could not encrypt RSA private key; unsupported encryption algorithm "'+r.algorithm+'".');throw f.algorithm=r.algorithm,f}var p=l(o.pbe.opensslDeriveBytes(t,a.substr(0,8),s));p.start(a),p.update(u.toDer(c.privateKeyToAsn1(e))),p.finish();var h={type:"RSA PRIVATE KEY",procType:{version:"4",type:"ENCRYPTED"},dekInfo:{algorithm:i,parameters:o.util.bytesToHex(a).toUpperCase()},body:p.output.getBytes()};return o.pem.encode(h)},c.decryptRsaPrivateKey=function(e,t){var r=null,n=o.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=o.des.createDecryptionCipher;break;case"DES-EDE3-CBC":i=24,a=o.des.createDecryptionCipher;break;case"AES-128-CBC":i=16,a=o.aes.createDecryptionCipher;break;case"AES-192-CBC":i=24,a=o.aes.createDecryptionCipher;break;case"AES-256-CBC":i=32,a=o.aes.createDecryptionCipher;break;case"RC2-40-CBC":i=5,a=function(e){return o.rc2.createDecryptionCipher(e,40)};break;case"RC2-64-CBC":i=8,a=function(e){return o.rc2.createDecryptionCipher(e,64)};break;case"RC2-128-CBC":i=16,a=function(e){return o.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 l=o.util.hexToBytes(n.dekInfo.parameters),f=a(o.pbe.opensslDeriveBytes(t,l.substr(0,8),i));if(f.start(l),f.update(o.util.createBuffer(n.body)),!f.finish())return r;r=f.output.getBytes()}else r=n.body;return null!==(r="ENCRYPTED PRIVATE KEY"===n.type?c.decryptPrivateKeyInfo(u.fromDer(r),t):u.fromDer(r))&&(r=c.privateKeyFromAsn1(r)),r},c.pbe.generatePkcs12Key=function(e,t,r,n,i,a){var s,u;if(null==a){if(!("sha1"in o.md))throw new Error('"sha1" hash algorithm unavailable.');a=o.md.sha1.create()}var c=a.digestLength,l=a.blockLength,f=new o.util.ByteBuffer,p=new o.util.ByteBuffer;if(null!=e){for(u=0;u<e.length;u++)p.putInt16(e.charCodeAt(u));p.putInt16(0)}var h=p.length(),d=t.length(),g=new o.util.ByteBuffer;g.fillWithByte(r,l);var y=l*Math.ceil(d/l),v=new o.util.ByteBuffer;for(u=0;u<y;u++)v.putByte(t.at(u%d));var m=l*Math.ceil(h/l),C=new o.util.ByteBuffer;for(u=0;u<m;u++)C.putByte(p.at(u%h));var E=v;E.putBuffer(C);for(var b=Math.ceil(i/c),S=1;S<=b;S++){var B=new o.util.ByteBuffer;B.putBytes(g.bytes()),B.putBytes(E.bytes());for(var A=0;A<n;A++)a.start(),a.update(B.getBytes()),B=a.digest();var T=new o.util.ByteBuffer;for(u=0;u<l;u++)T.putByte(B.at(u%c));var w=Math.ceil(d/l)+Math.ceil(h/l),I=new o.util.ByteBuffer;for(s=0;s<w;s++){var k=new o.util.ByteBuffer(E.getBytes(l)),_=511;for(u=T.length()-1;u>=0;u--)_>>=8,_+=T.at(u)+k.at(u),k.setAt(u,255&_);I.putBuffer(k)}E=I,f.putBuffer(B)}return f.truncate(f.length()-i),f},c.pbe.getCipher=function(e,t,r){switch(e){case c.oids.pkcs5PBES2:return c.pbe.getCipherForPBES2(e,t,r);case c.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case c.oids["pbewithSHAAnd40BitRC2-CBC"]:return c.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}},c.pbe.getCipherForPBES2=function(e,t,r){var n,a={},s=[];if(!u.validate(t,p,a,s))throw(n=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.")).errors=s,n;if((e=u.derToOid(a.kdfOid))!==c.oids.pkcs5PBKDF2)throw(n=new Error("Cannot read encrypted private key. Unsupported key derivation function OID.")).oid=e,n.supportedOids=["pkcs5PBKDF2"],n;if((e=u.derToOid(a.encOid))!==c.oids["aes128-CBC"]&&e!==c.oids["aes192-CBC"]&&e!==c.oids["aes256-CBC"]&&e!==c.oids["des-EDE3-CBC"]&&e!==c.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 l,f,h=a.kdfSalt,d=o.util.createBuffer(a.kdfIterationCount);switch(d=d.getInt(d.length()<<3),c.oids[e]){case"aes128-CBC":l=16,f=o.aes.createDecryptionCipher;break;case"aes192-CBC":l=24,f=o.aes.createDecryptionCipher;break;case"aes256-CBC":l=32,f=o.aes.createDecryptionCipher;break;case"des-EDE3-CBC":l=24,f=o.des.createDecryptionCipher;break;case"desCBC":l=8,f=o.des.createDecryptionCipher}var g=i(a.prfOid),y=o.pkcs5.pbkdf2(r,h,d,l,g),v=a.encIv,m=f(y);return m.start(v),m},c.pbe.getCipherForPKCS12PBE=function(e,t,r){var n={},a=[];if(!u.validate(t,h,n,a))throw(g=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.")).errors=a,g;var s,l,f,p=o.util.createBuffer(n.salt),d=o.util.createBuffer(n.iterations);switch(d=d.getInt(d.length()<<3),e){case c.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:s=24,l=8,f=o.des.startDecrypting;break;case c.oids["pbewithSHAAnd40BitRC2-CBC"]:s=5,l=8,f=function(e,t){var r=o.rc2.createDecryptionCipher(e,40);return r.start(t,null),r};break;default:var g;throw(g=new Error("Cannot read PKCS #12 PBE data block. Unsupported OID.")).oid=e,g}var y=i(n.prfOid),v=c.pbe.generatePkcs12Key(r,p,1,d,s,y);return y.start(),f(v,c.pbe.generatePkcs12Key(r,p,2,d,l,y))},c.pbe.opensslDeriveBytes=function(e,t,r,i){if(null==i){if(!("md5"in o.md))throw new Error('"md5" hash algorithm unavailable.');i=o.md.md5.create()}null===t&&(t="");for(var a=[n(i,e+t)],s=16,u=1;s<r;++u,s+=16)a.push(n(i,a[u-1]+e+t));return a.join("").substr(0,r)}},function(e,t,r){function n(e,t,r){for(var n,i,a,o,s,c,l,f,p,h,d,g,y,v=r.length();v>=64;){for(s=0;s<16;++s)t[s]=r.getInt32();for(;s<64;++s)n=((n=t[s-2])>>>17|n<<15)^(n>>>19|n<<13)^n>>>10,i=((i=t[s-15])>>>7|i<<25)^(i>>>18|i<<14)^i>>>3,t[s]=n+t[s-7]+i+t[s-16]|0;for(c=e.h0,l=e.h1,f=e.h2,p=e.h3,h=e.h4,d=e.h5,g=e.h6,y=e.h7,s=0;s<64;++s)a=(c>>>2|c<<30)^(c>>>13|c<<19)^(c>>>22|c<<10),o=c&l|f&(c^l),n=y+((h>>>6|h<<26)^(h>>>11|h<<21)^(h>>>25|h<<7))+(g^h&(d^g))+u[s]+t[s],y=g,g=d,d=h,h=p+n>>>0,p=f,f=l,l=c,c=n+(i=a+o)>>>0;e.h0=e.h0+c|0,e.h1=e.h1+l|0,e.h2=e.h2+f|0,e.h3=e.h3+p|0,e.h4=e.h4+h|0,e.h5=e.h5+d|0,e.h6=e.h6+g|0,e.h7=e.h7+y|0,v-=64}}var i=r(0);r(4),r(1);var a=e.exports=i.sha256=i.sha256||{};i.md.sha256=i.md.algorithms.sha256=a,a.create=function(){s||(o=String.fromCharCode(128),o+=i.util.fillString(String.fromCharCode(0),64),u=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],s=!0);var e=null,t=i.util.createBuffer(),r=new Array(64),a={algorithm:"sha256",blockLength:64,digestLength:32,messageLength:0,fullMessageLength:null,messageLengthSize:8,start:function(){a.messageLength=0,a.fullMessageLength=a.messageLength64=[];for(var r=a.messageLengthSize/4,n=0;n<r;++n)a.fullMessageLength.push(0);return t=i.util.createBuffer(),e={h0:1779033703,h1:3144134277,h2:1013904242,h3:2773480762,h4:1359893119,h5:2600822924,h6:528734635,h7:1541459225},a}};return a.start(),a.update=function(o,s){"utf8"===s&&(o=i.util.encodeUtf8(o));var u=o.length;a.messageLength+=u,u=[u/4294967296>>>0,u>>>0];for(var c=a.fullMessageLength.length-1;c>=0;--c)a.fullMessageLength[c]+=u[1],u[1]=u[0]+(a.fullMessageLength[c]/4294967296>>>0),a.fullMessageLength[c]=a.fullMessageLength[c]>>>0,u[0]=u[1]/4294967296>>>0;return t.putBytes(o),n(e,r,t),(t.read>2048||0===t.length())&&t.compact(),a},a.digest=function(){var s=i.util.createBuffer();s.putBytes(t.bytes());var u=a.fullMessageLength[a.fullMessageLength.length-1]+a.messageLengthSize&a.blockLength-1;s.putBytes(o.substr(0,a.blockLength-u));for(var c,l=8*a.fullMessageLength[0],f=0;f<a.fullMessageLength.length-1;++f)l+=(c=8*a.fullMessageLength[f+1])/4294967296>>>0,s.putInt32(l>>>0),l=c>>>0;s.putInt32(l);var p={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4,h5:e.h5,h6:e.h6,h7:e.h7};n(p,r,s);var h=i.util.createBuffer();return h.putInt32(p.h0),h.putInt32(p.h1),h.putInt32(p.h2),h.putInt32(p.h3),h.putInt32(p.h4),h.putInt32(p.h5),h.putInt32(p.h6),h.putInt32(p.h7),h},a};var o=null,s=!1,u=null},function(e,t,n){var i=n(0);n(1);var a=null;!i.util.isNodejs||i.options.usePureJavaScript||r.versions["node-webkit"]||(a=n(16)),(e.exports=i.prng=i.prng||{}).create=function(e){function t(e){if(s.pools[0].messageLength>=32)return n(),e();var t=32-s.pools[0].messageLength<<5;s.seedFile(t,(function(t,r){if(t)return e(t);s.collect(r),n(),e()}))}function r(){if(s.pools[0].messageLength>=32)return n();var e=32-s.pools[0].messageLength<<5;s.collect(s.seedFileSync(e)),n()}function n(){s.reseeds=4294967295===s.reseeds?0:s.reseeds+1;var e=s.plugin.md.create();e.update(s.keyBytes);for(var t=1,r=0;r<32;++r)s.reseeds%t==0&&(e.update(s.pools[r].digest().getBytes()),s.pools[r].start()),t<<=1;s.keyBytes=e.digest().getBytes(),e.start(),e.update(s.keyBytes);var n=e.digest().getBytes();s.key=s.plugin.formatKey(s.keyBytes),s.seed=s.plugin.formatSeed(n),s.generated=0}function o(e){var t=null,r=i.util.globalScope,n=r.crypto||r.msCrypto;n&&n.getRandomValues&&(t=function(e){return n.getRandomValues(e)});var a=i.util.createBuffer();if(t)for(;a.length()<e;){var o=Math.max(1,Math.min(e-a.length(),65536)/4),s=new Uint32Array(Math.floor(o));try{t(s);for(var u=0;u<s.length;++u)a.putInt32(s[u])}catch(e){if(!("undefined"!=typeof QuotaExceededError&&e instanceof QuotaExceededError))throw e}}if(a.length()<e)for(var c,l,f,p=Math.floor(65536*Math.random());a.length()<e;)for(l=16807*(65535&p),l+=(32767&(c=16807*(p>>16)))<<16,p=4294967295&(l=(2147483647&(l+=c>>15))+(l>>31)),u=0;u<3;++u)f=p>>>(u<<3),f^=Math.floor(256*Math.random()),a.putByte(String.fromCharCode(255&f));return a.getBytes(e)}for(var s={plugin:e,key:null,seed:null,time:null,reseeds:0,generated:0,keyBytes:""},u=e.md,c=new Array(32),l=0;l<32;++l)c[l]=u.create();return s.pools=c,s.pool=0,s.generate=function(e,r){if(!r)return s.generateSync(e);var n=s.plugin.cipher,a=s.plugin.increment,o=s.plugin.formatKey,u=s.plugin.formatSeed,c=i.util.createBuffer();s.key=null,function l(f){if(f)return r(f);if(c.length()>=e)return r(null,c.getBytes(e));if(s.generated>1048575&&(s.key=null),null===s.key)return i.util.nextTick((function(){t(l)}));var p=n(s.key,s.seed);s.generated+=p.length,c.putBytes(p),s.key=o(n(s.key,a(s.seed))),s.seed=u(n(s.key,s.seed)),i.util.setImmediate(l)}()},s.generateSync=function(e){var t=s.plugin.cipher,n=s.plugin.increment,a=s.plugin.formatKey,o=s.plugin.formatSeed;s.key=null;for(var u=i.util.createBuffer();u.length()<e;){s.generated>1048575&&(s.key=null),null===s.key&&r();var c=t(s.key,s.seed);s.generated+=c.length,u.putBytes(c),s.key=a(t(s.key,n(s.seed))),s.seed=o(t(s.key,s.seed))}return u.getBytes(e)},a?(s.seedFile=function(e,t){a.randomBytes(e,(function(e,r){if(e)return t(e);t(null,r.toString())}))},s.seedFileSync=function(e){return a.randomBytes(e).toString()}):(s.seedFile=function(e,t){try{t(null,o(e))}catch(e){t(e)}},s.seedFileSync=o),s.collect=function(e){for(var t=e.length,r=0;r<t;++r)s.pools[s.pool].update(e.substr(r,1)),s.pool=31===s.pool?0:s.pool+1},s.collectInt=function(e,t){for(var r="",n=0;n<t;n+=8)r+=String.fromCharCode(e>>n&255);s.collect(r)},s.registerWorker=function(e){e===self?s.seedFile=function(e,t){self.addEventListener("message",(function e(r){var n=r.data;n.forge&&n.forge.prng&&(self.removeEventListener("message",e),t(n.forge.prng.err,n.forge.prng.bytes))})),self.postMessage({forge:{prng:{needed:e}}})}:e.addEventListener("message",(function(t){var r=t.data;r.forge&&r.forge.prng&&s.seedFile(r.forge.prng.needed,(function(t,r){e.postMessage({forge:{prng:{err:t,bytes:r}}})}))}))},s}},function(e,t,r){var n=r(0);r(1);var i=[217,120,249,196,25,221,181,237,40,233,253,121,74,160,216,157,198,126,55,131,43,118,83,142,98,76,100,136,68,139,251,162,23,154,89,245,135,179,79,19,97,69,109,141,9,129,125,50,189,143,64,235,134,183,123,11,240,149,33,34,92,107,78,130,84,214,101,147,206,96,178,28,115,86,192,20,167,140,241,220,18,117,202,31,59,190,228,209,66,61,212,48,163,60,182,38,111,191,14,218,70,105,7,87,39,242,29,155,188,148,67,3,248,17,199,246,144,239,62,231,6,195,213,47,200,102,30,215,8,232,234,222,128,82,238,247,132,170,114,172,53,77,106,42,150,26,210,113,90,21,73,116,75,159,208,94,4,24,164,236,194,224,65,110,15,81,203,204,36,145,175,80,161,244,112,57,153,124,58,133,35,184,180,122,252,2,54,91,37,85,151,49,45,93,250,152,227,138,146,174,5,223,41,16,103,108,186,201,211,0,230,207,225,158,168,44,99,22,1,63,88,226,137,169,13,56,52,27,171,51,255,176,187,72,12,95,185,177,205,46,197,243,219,71,229,165,156,119,10,166,32,104,254,127,193,173],a=[1,2,3,5],o=function(e,t){return e<<t&65535|(65535&e)>>16-t},s=function(e,t){return(65535&e)>>t|e<<16-t&65535};e.exports=n.rc2=n.rc2||{},n.rc2.expandKey=function(e,t){"string"==typeof e&&(e=n.util.createBuffer(e)),t=t||128;var r,a=e,o=e.length(),s=t,u=Math.ceil(s/8),c=255>>(7&s);for(r=o;r<128;r++)a.putByte(i[a.at(r-1)+a.at(r-o)&255]);for(a.setAt(128-u,i[a.at(128-u)&c]),r=127-u;r>=0;r--)a.setAt(r,i[a.at(r+1)^a.at(r+u)]);return a};var u=function(e,t,r){var i,u,c,l,f=!1,p=null,h=null,d=null,g=[];for(e=n.rc2.expandKey(e,t),c=0;c<64;c++)g.push(e.getInt16Le());r?(i=function(e){for(c=0;c<4;c++)e[c]+=g[l]+(e[(c+3)%4]&e[(c+2)%4])+(~e[(c+3)%4]&e[(c+1)%4]),e[c]=o(e[c],a[c]),l++},u=function(e){for(c=0;c<4;c++)e[c]+=g[63&e[(c+3)%4]]}):(i=function(e){for(c=3;c>=0;c--)e[c]=s(e[c],a[c]),e[c]-=g[l]+(e[(c+3)%4]&e[(c+2)%4])+(~e[(c+3)%4]&e[(c+1)%4]),l--},u=function(e){for(c=3;c>=0;c--)e[c]-=g[63&e[(c+3)%4]]});var y=function(e){var t=[];for(c=0;c<4;c++){var n=p.getInt16Le();null!==d&&(r?n^=d.getInt16Le():d.putInt16Le(n)),t.push(65535&n)}l=r?0:63;for(var i=0;i<e.length;i++)for(var a=0;a<e[i][0];a++)e[i][1](t);for(c=0;c<4;c++)null!==d&&(r?d.putInt16Le(t[c]):t[c]^=d.getInt16Le()),h.putInt16Le(t[c])},v=null;return v={start:function(e,t){e&&"string"==typeof e&&(e=n.util.createBuffer(e)),f=!1,p=n.util.createBuffer(),h=t||new n.util.createBuffer,d=e,v.output=h},update:function(e){for(f||p.putBuffer(e);p.length()>=8;)y([[5,i],[1,u],[6,i],[1,u],[5,i]])},finish:function(e){var t=!0;if(r)if(e)t=e(8,p,!r);else{var n=8===p.length()?8:8-p.length();p.fillWithByte(n,n)}if(t&&(f=!0,v.update()),!r&&(t=0===p.length()))if(e)t=e(8,h,!r);else{var i=h.length(),a=h.at(i-1);a>i?t=!1:h.truncate(a)}return t}}};n.rc2.startEncrypting=function(e,t,r){var i=n.rc2.createEncryptionCipher(e,128);return i.start(t,r),i},n.rc2.createEncryptionCipher=function(e,t){return u(e,t,!0)},n.rc2.startDecrypting=function(e,t,r){var i=n.rc2.createDecryptionCipher(e,128);return i.start(t,r),i},n.rc2.createDecryptionCipher=function(e,t){return u(e,t,!1)}},function(e,t,r){function n(e,t,r){r||(r=i.md.sha1.create());for(var n="",a=Math.ceil(t/r.digestLength),o=0;o<a;++o){var s=String.fromCharCode(o>>24&255,o>>16&255,o>>8&255,255&o);r.start(),r.update(e+s),n+=r.digest().getBytes()}return n.substring(0,t)}var i=r(0);r(1),r(2),r(9);var a=e.exports=i.pkcs1=i.pkcs1||{};a.encode_rsa_oaep=function(e,t,r){var a,o,s,u;"string"==typeof r?(a=r,o=arguments[3]||void 0,s=arguments[4]||void 0):r&&(a=r.label||void 0,o=r.seed||void 0,s=r.md||void 0,r.mgf1&&r.mgf1.md&&(u=r.mgf1.md)),s?s.start():s=i.md.sha1.create(),u||(u=s);var c=Math.ceil(e.n.bitLength()/8),l=c-2*s.digestLength-2;if(t.length>l)throw(g=new Error("RSAES-OAEP input message length is too long.")).length=t.length,g.maxLength=l,g;a||(a=""),s.update(a,"raw");for(var f=s.digest(),p="",h=l-t.length,d=0;d<h;d++)p+="\0";var g,y=f.getBytes()+p+""+t;if(o){if(o.length!==s.digestLength)throw(g=new Error("Invalid RSAES-OAEP seed. The seed length must match the digest length.")).seedLength=o.length,g.digestLength=s.digestLength,g}else o=i.random.getBytes(s.digestLength);var v=n(o,c-s.digestLength-1,u),m=i.util.xorBytes(y,v,y.length),C=n(m,s.digestLength,u);return"\0"+i.util.xorBytes(o,C,o.length)+m},a.decode_rsa_oaep=function(e,t,r){var a,o,s;"string"==typeof r?(a=r,o=arguments[3]||void 0):r&&(a=r.label||void 0,o=r.md||void 0,r.mgf1&&r.mgf1.md&&(s=r.mgf1.md));var u=Math.ceil(e.n.bitLength()/8);if(t.length!==u)throw(m=new Error("RSAES-OAEP encoded message length is invalid.")).length=t.length,m.expectedLength=u,m;if(void 0===o?o=i.md.sha1.create():o.start(),s||(s=o),u<2*o.digestLength+2)throw new Error("RSAES-OAEP key is too short for the hash function.");a||(a=""),o.update(a,"raw");for(var c=o.digest().getBytes(),l=t.charAt(0),f=t.substring(1,o.digestLength+1),p=t.substring(1+o.digestLength),h=n(p,o.digestLength,s),d=i.util.xorBytes(f,h,f.length),g=n(d,u-o.digestLength-1,s),y=i.util.xorBytes(p,g,p.length),v=y.substring(0,o.digestLength),m="\0"!==l,C=0;C<o.digestLength;++C)m|=c.charAt(C)!==v.charAt(C);for(var E=1,b=o.digestLength,S=o.digestLength;S<y.length;S++){var B=y.charCodeAt(S),A=1&B^1;m|=B&(E?65534:0),b+=E&=A}if(m||1!==y.charCodeAt(b))throw new Error("Invalid RSAES-OAEP padding.");return y.substring(b+1)}},function(e,t,r){var n=r(0);r(1),r(12),r(2),function(){function t(e,t,n,i){return"workers"in n?a(e,t,n,i):r(e,t,n,i)}function r(e,t,r,n){var a=o(e,t),s=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}(a.bitLength());"millerRabinTests"in r&&(s=r.millerRabinTests);var u=10;"maxBlockTime"in r&&(u=r.maxBlockTime),i(a,e,t,0,s,u,n)}function i(e,t,r,a,s,u,l){var f=+new Date;do{if(e.bitLength()>t&&(e=o(t,r)),e.isProbablePrime(s))return l(null,e);e.dAddOffset(c[a++%8],0)}while(u<0||+new Date-f<u);n.util.setImmediate((function(){i(e,t,r,a,s,u,l)}))}function a(e,t,i,a){function s(){function r(r){if(!s){var i=r.data;if(i.found){for(var l=0;l<n.length;++l)n[l].terminate();return s=!0,a(null,new u(i.prime,16))}c.bitLength()>e&&(c=o(e,t));var h=c.toString(16);r.target.postMessage({hex:h,workLoad:f}),c.dAddOffset(p,0)}}l=Math.max(1,l);for(var n=[],i=0;i<l;++i)n[i]=new Worker(h);for(i=0;i<l;++i)n[i].addEventListener("message",r);var s=!1}if("undefined"==typeof Worker)return r(e,t,i,a);var c=o(e,t),l=i.workers,f=i.workLoad||100,p=30*f/8,h=i.workerScript||"forge/prime.worker.js";if(-1===l)return n.util.estimateCores((function(e,t){e&&(t=2),l=t-1,s()}));s()}function o(e,t){var r=new u(e,t),n=e-1;return r.testBit(n)||r.bitwiseTo(u.ONE.shiftLeft(n),f,r),r.dAddOffset(31-r.mod(l).byteValue(),0),r}if(n.prime)e.exports=n.prime;else{var s=e.exports=n.prime=n.prime||{},u=n.jsbn.BigInteger,c=[6,4,2,4,2,4,6,2],l=new u(null);l.fromInt(30);var f=function(e,t){return e|t};s.generateProbablePrime=function(e,r,i){"function"==typeof r&&(i=r,r={});var a=(r=r||{}).algorithm||"PRIMEINC";"string"==typeof a&&(a={name:a}),a.options=a.options||{};var o=r.prng||n.random,s={nextBytes:function(e){for(var t=o.getBytesSync(e.length),r=0;r<e.length;++r)e[r]=t.charCodeAt(r)}};if("PRIMEINC"===a.name)return t(e,s,a.options,i);throw new Error("Invalid prime generation algorithm: "+a.name)}}}()},function(e,t,r){function n(e,t,r,n){for(var i=[],a=0;a<e.length;a++)for(var o=0;o<e[a].safeBags.length;o++){var s=e[a].safeBags[o];void 0!==n&&s.type!==n||(null!==t?void 0!==s.attributes[t]&&s.attributes[t].indexOf(r)>=0&&i.push(s):i.push(s))}return i}function i(e){if(e.composed||e.constructed){for(var t=c.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 a(e,t,r,n){if((t=l.fromDer(t,r)).tagClass!==l.Class.UNIVERSAL||t.type!==l.Type.SEQUENCE||!0!==t.constructed)throw new Error("PKCS#12 AuthenticatedSafe expected to be a SEQUENCE OF ContentInfo");for(var a=0;a<t.value.length;a++){var u=t.value[a],c={},p=[];if(!l.validate(u,h,c,p))throw(v=new Error("Cannot read ContentInfo.")).errors=p,v;var d={encrypted:!1},g=null,y=c.content.value[0];switch(l.derToOid(c.contentType)){case f.oids.data:if(y.tagClass!==l.Class.UNIVERSAL||y.type!==l.Type.OCTETSTRING)throw new Error("PKCS#12 SafeContents Data is not an OCTET STRING.");g=i(y).value;break;case f.oids.encryptedData:g=o(y,n),d.encrypted=!0;break;default:var v;throw(v=new Error("Unsupported PKCS#12 contentType.")).contentType=l.derToOid(c.contentType),v}d.safeBags=s(g,r,n),e.safeContents.push(d)}}function o(e,t){var r={},n=[];if(!l.validate(e,c.pkcs7.asn1.encryptedDataValidator,r,n))throw(a=new Error("Cannot read EncryptedContentInfo.")).errors=n,a;var a,o=l.derToOid(r.contentType);if(o!==f.oids.data)throw(a=new Error("PKCS#12 EncryptedContentInfo ContentType is not Data.")).oid=o,a;o=l.derToOid(r.encAlgorithm);var s=f.pbe.getCipher(o,r.encParameter,t),u=i(r.encryptedContentAsn1),p=c.util.createBuffer(u.value);if(s.update(p),!s.finish())throw new Error("Failed to decrypt PKCS#12 SafeContents.");return s.output.getBytes()}function s(e,t,r){if(!t&&0===e.length)return[];if((e=l.fromDer(e,t)).tagClass!==l.Class.UNIVERSAL||e.type!==l.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],o={},s=[];if(!l.validate(a,g,o,s))throw(y=new Error("Cannot read SafeBag.")).errors=s,y;var c={type:l.derToOid(o.bagId),attributes:u(o.bagAttributes)};n.push(c);var p,h,d=o.bagValue.value[0];switch(c.type){case f.oids.pkcs8ShroudedKeyBag:if(null===(d=f.decryptPrivateKeyInfo(d,r)))throw new Error("Unable to decrypt PKCS#8 ShroudedKeyBag, wrong password?");case f.oids.keyBag:try{c.key=f.privateKeyFromAsn1(d)}catch(e){c.key=null,c.asn1=d}continue;case f.oids.certBag:p=v,h=function(){if(l.derToOid(o.certId)!==f.oids.x509Certificate){var e=new Error("Unsupported certificate type, only X.509 supported.");throw e.oid=l.derToOid(o.certId),e}var r=l.fromDer(o.cert,t);try{c.cert=f.certificateFromAsn1(r,!0)}catch(e){c.cert=null,c.asn1=r}};break;default:var y;throw(y=new Error("Unsupported PKCS#12 SafeBag type.")).oid=c.type,y}if(void 0!==p&&!l.validate(d,p,o,s))throw(y=new Error("Cannot read PKCS#12 "+p.name)).errors=s,y;h()}return n}function u(e){var t={};if(void 0!==e)for(var r=0;r<e.length;++r){var n={},i=[];if(!l.validate(e[r],y,n,i)){var a=new Error("Cannot read PKCS#12 BagAttribute.");throw a.errors=i,a}var o=l.derToOid(n.oid);if(void 0!==f.oids[o]){t[f.oids[o]]=[];for(var s=0;s<n.values.length;++s)t[f.oids[o]].push(n.values[s].value)}}return t}var c=r(0);r(3),r(8),r(6),r(29),r(22),r(2),r(11),r(9),r(1),r(17);var l=c.asn1,f=c.pki,p=e.exports=c.pkcs12=c.pkcs12||{},h={name:"ContentInfo",tagClass:l.Class.UNIVERSAL,type:l.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.contentType",tagClass:l.Class.UNIVERSAL,type:l.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:l.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"content"}]},d={name:"PFX",tagClass:l.Class.UNIVERSAL,type:l.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.version",tagClass:l.Class.UNIVERSAL,type:l.Type.INTEGER,constructed:!1,capture:"version"},h,{name:"PFX.macData",tagClass:l.Class.UNIVERSAL,type:l.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"mac",value:[{name:"PFX.macData.mac",tagClass:l.Class.UNIVERSAL,type:l.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm",tagClass:l.Class.UNIVERSAL,type:l.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm.algorithm",tagClass:l.Class.UNIVERSAL,type:l.Type.OID,constructed:!1,capture:"macAlgorithm"},{name:"PFX.macData.mac.digestAlgorithm.parameters",tagClass:l.Class.UNIVERSAL,captureAsn1:"macAlgorithmParameters"}]},{name:"PFX.macData.mac.digest",tagClass:l.Class.UNIVERSAL,type:l.Type.OCTETSTRING,constructed:!1,capture:"macDigest"}]},{name:"PFX.macData.macSalt",tagClass:l.Class.UNIVERSAL,type:l.Type.OCTETSTRING,constructed:!1,capture:"macSalt"},{name:"PFX.macData.iterations",tagClass:l.Class.UNIVERSAL,type:l.Type.INTEGER,constructed:!1,optional:!0,capture:"macIterations"}]}]},g={name:"SafeBag",tagClass:l.Class.UNIVERSAL,type:l.Type.SEQUENCE,constructed:!0,value:[{name:"SafeBag.bagId",tagClass:l.Class.UNIVERSAL,type:l.Type.OID,constructed:!1,capture:"bagId"},{name:"SafeBag.bagValue",tagClass:l.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"bagValue"},{name:"SafeBag.bagAttributes",tagClass:l.Class.UNIVERSAL,type:l.Type.SET,constructed:!0,optional:!0,capture:"bagAttributes"}]},y={name:"Attribute",tagClass:l.Class.UNIVERSAL,type:l.Type.SEQUENCE,constructed:!0,value:[{name:"Attribute.attrId",tagClass:l.Class.UNIVERSAL,type:l.Type.OID,constructed:!1,capture:"oid"},{name:"Attribute.attrValues",tagClass:l.Class.UNIVERSAL,type:l.Type.SET,constructed:!0,capture:"values"}]},v={name:"CertBag",tagClass:l.Class.UNIVERSAL,type:l.Type.SEQUENCE,constructed:!0,value:[{name:"CertBag.certId",tagClass:l.Class.UNIVERSAL,type:l.Type.OID,constructed:!1,capture:"certId"},{name:"CertBag.certValue",tagClass:l.Class.CONTEXT_SPECIFIC,constructed:!0,value:[{name:"CertBag.certValue[0]",tagClass:l.Class.UNIVERSAL,type:l.Class.OCTETSTRING,constructed:!1,capture:"cert"}]}]};p.pkcs12FromAsn1=function(e,t,r){"string"==typeof t?(r=t,t=!0):void 0===t&&(t=!0);var o={};if(!l.validate(e,d,o,[]))throw(s=new Error("Cannot read PKCS#12 PFX. ASN.1 object is not an PKCS#12 PFX.")).errors=s,s;var s,u={version:o.version.charCodeAt(0),safeContents:[],getBags:function(e){var t,r={};return"localKeyId"in e?t=e.localKeyId:"localKeyIdHex"in e&&(t=c.util.hexToBytes(e.localKeyIdHex)),void 0===t&&!("friendlyName"in e)&&"bagType"in e&&(r[e.bagType]=n(u.safeContents,null,null,e.bagType)),void 0!==t&&(r.localKeyId=n(u.safeContents,"localKeyId",t,e.bagType)),"friendlyName"in e&&(r.friendlyName=n(u.safeContents,"friendlyName",e.friendlyName,e.bagType)),r},getBagsByFriendlyName:function(e,t){return n(u.safeContents,"friendlyName",e,t)},getBagsByLocalKeyId:function(e,t){return n(u.safeContents,"localKeyId",e,t)}};if(3!==o.version.charCodeAt(0))throw(s=new Error("PKCS#12 PFX of version other than 3 not supported.")).version=o.version.charCodeAt(0),s;if(l.derToOid(o.contentType)!==f.oids.data)throw(s=new Error("Only PKCS#12 PFX in password integrity mode supported.")).oid=l.derToOid(o.contentType),s;var h=o.content.value[0];if(h.tagClass!==l.Class.UNIVERSAL||h.type!==l.Type.OCTETSTRING)throw new Error("PKCS#12 authSafe content data is not an OCTET STRING.");if(h=i(h),o.mac){var g=null,y=0,v=l.derToOid(o.macAlgorithm);switch(v){case f.oids.sha1:g=c.md.sha1.create(),y=20;break;case f.oids.sha256:g=c.md.sha256.create(),y=32;break;case f.oids.sha384:g=c.md.sha384.create(),y=48;break;case f.oids.sha512:g=c.md.sha512.create(),y=64;break;case f.oids.md5:g=c.md.md5.create(),y=16}if(null===g)throw new Error("PKCS#12 uses unsupported MAC algorithm: "+v);var m=new c.util.ByteBuffer(o.macSalt),C="macIterations"in o?parseInt(c.util.bytesToHex(o.macIterations),16):1,E=p.generateKey(r,m,3,C,y,g),b=c.hmac.create();if(b.start(g,E),b.update(h.value),b.getMac().getBytes()!==o.macDigest)throw new Error("PKCS#12 MAC could not be verified. Invalid password?")}return a(u,h.value,t,r),u},p.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=c.util.hexToBytes(a);else if(n.generateLocalKeyId)if(t){var o=c.util.isArray(t)?t[0]:t;"string"==typeof o&&(o=f.certificateFromPem(o)),(I=c.md.sha1.create()).update(l.toDer(f.certificateToAsn1(o)).getBytes()),a=I.digest().getBytes()}else a=c.random.getBytes(20);var s=[];null!==a&&s.push(l.create(l.Class.UNIVERSAL,l.Type.SEQUENCE,!0,[l.create(l.Class.UNIVERSAL,l.Type.OID,!1,l.oidToDer(f.oids.localKeyId).getBytes()),l.create(l.Class.UNIVERSAL,l.Type.SET,!0,[l.create(l.Class.UNIVERSAL,l.Type.OCTETSTRING,!1,a)])])),"friendlyName"in n&&s.push(l.create(l.Class.UNIVERSAL,l.Type.SEQUENCE,!0,[l.create(l.Class.UNIVERSAL,l.Type.OID,!1,l.oidToDer(f.oids.friendlyName).getBytes()),l.create(l.Class.UNIVERSAL,l.Type.SET,!0,[l.create(l.Class.UNIVERSAL,l.Type.BMPSTRING,!1,n.friendlyName)])])),s.length>0&&(i=l.create(l.Class.UNIVERSAL,l.Type.SET,!0,s));var u=[],h=[];null!==t&&(h=c.util.isArray(t)?t:[t]);for(var d=[],g=0;g<h.length;++g){"string"==typeof(t=h[g])&&(t=f.certificateFromPem(t));var y=0===g?i:void 0,v=f.certificateToAsn1(t),m=l.create(l.Class.UNIVERSAL,l.Type.SEQUENCE,!0,[l.create(l.Class.UNIVERSAL,l.Type.OID,!1,l.oidToDer(f.oids.certBag).getBytes()),l.create(l.Class.CONTEXT_SPECIFIC,0,!0,[l.create(l.Class.UNIVERSAL,l.Type.SEQUENCE,!0,[l.create(l.Class.UNIVERSAL,l.Type.OID,!1,l.oidToDer(f.oids.x509Certificate).getBytes()),l.create(l.Class.CONTEXT_SPECIFIC,0,!0,[l.create(l.Class.UNIVERSAL,l.Type.OCTETSTRING,!1,l.toDer(v).getBytes())])])]),y]);d.push(m)}if(d.length>0){var C=l.create(l.Class.UNIVERSAL,l.Type.SEQUENCE,!0,d),E=l.create(l.Class.UNIVERSAL,l.Type.SEQUENCE,!0,[l.create(l.Class.UNIVERSAL,l.Type.OID,!1,l.oidToDer(f.oids.data).getBytes()),l.create(l.Class.CONTEXT_SPECIFIC,0,!0,[l.create(l.Class.UNIVERSAL,l.Type.OCTETSTRING,!1,l.toDer(C).getBytes())])]);u.push(E)}var b=null;if(null!==e){var S=f.wrapRsaPrivateKey(f.privateKeyToAsn1(e));b=null===r?l.create(l.Class.UNIVERSAL,l.Type.SEQUENCE,!0,[l.create(l.Class.UNIVERSAL,l.Type.OID,!1,l.oidToDer(f.oids.keyBag).getBytes()),l.create(l.Class.CONTEXT_SPECIFIC,0,!0,[S]),i]):l.create(l.Class.UNIVERSAL,l.Type.SEQUENCE,!0,[l.create(l.Class.UNIVERSAL,l.Type.OID,!1,l.oidToDer(f.oids.pkcs8ShroudedKeyBag).getBytes()),l.create(l.Class.CONTEXT_SPECIFIC,0,!0,[f.encryptPrivateKeyInfo(S,r,n)]),i]);var B=l.create(l.Class.UNIVERSAL,l.Type.SEQUENCE,!0,[b]),A=l.create(l.Class.UNIVERSAL,l.Type.SEQUENCE,!0,[l.create(l.Class.UNIVERSAL,l.Type.OID,!1,l.oidToDer(f.oids.data).getBytes()),l.create(l.Class.CONTEXT_SPECIFIC,0,!0,[l.create(l.Class.UNIVERSAL,l.Type.OCTETSTRING,!1,l.toDer(B).getBytes())])]);u.push(A)}var T,w=l.create(l.Class.UNIVERSAL,l.Type.SEQUENCE,!0,u);if(n.useMac){var I=c.md.sha1.create(),k=new c.util.ByteBuffer(c.random.getBytes(n.saltSize)),_=n.count,R=(e=p.generateKey(r,k,3,_,20),c.hmac.create());R.start(I,e),R.update(l.toDer(w).getBytes());var x=R.getMac();T=l.create(l.Class.UNIVERSAL,l.Type.SEQUENCE,!0,[l.create(l.Class.UNIVERSAL,l.Type.SEQUENCE,!0,[l.create(l.Class.UNIVERSAL,l.Type.SEQUENCE,!0,[l.create(l.Class.UNIVERSAL,l.Type.OID,!1,l.oidToDer(f.oids.sha1).getBytes()),l.create(l.Class.UNIVERSAL,l.Type.NULL,!1,"")]),l.create(l.Class.UNIVERSAL,l.Type.OCTETSTRING,!1,x.getBytes())]),l.create(l.Class.UNIVERSAL,l.Type.OCTETSTRING,!1,k.getBytes()),l.create(l.Class.UNIVERSAL,l.Type.INTEGER,!1,l.integerToDer(_).getBytes())])}return l.create(l.Class.UNIVERSAL,l.Type.SEQUENCE,!0,[l.create(l.Class.UNIVERSAL,l.Type.INTEGER,!1,l.integerToDer(3).getBytes()),l.create(l.Class.UNIVERSAL,l.Type.SEQUENCE,!0,[l.create(l.Class.UNIVERSAL,l.Type.OID,!1,l.oidToDer(f.oids.data).getBytes()),l.create(l.Class.CONTEXT_SPECIFIC,0,!0,[l.create(l.Class.UNIVERSAL,l.Type.OCTETSTRING,!1,l.toDer(w).getBytes())])]),T])},p.generateKey=c.pbe.generatePkcs12Key},function(e,t,r){var n=r(0);r(3),r(1);var i=n.asn1,a=e.exports=n.pkcs7asn1=n.pkcs7asn1||{};n.pkcs7=n.pkcs7||{},n.pkcs7.asn1=a;var o={name:"ContentInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.ContentType",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,captureAsn1:"content"}]};a.contentInfoValidator=o;var s={name:"EncryptedContentInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentType",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"contentType"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentEncryptionAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm.parameter",tagClass:i.Class.UNIVERSAL,captureAsn1:"encParameter"}]},{name:"EncryptedContentInfo.encryptedContent",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,capture:"encryptedContent",captureAsn1:"encryptedContentAsn1"}]};a.envelopedDataValidator={name:"EnvelopedData",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"EnvelopedData.Version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"version"},{name:"EnvelopedData.RecipientInfos",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,constructed:!0,captureAsn1:"recipientInfos"}].concat(s)},a.encryptedDataValidator={name:"EncryptedData",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedData.Version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"version"}].concat(s)};var u={name:"SignerInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1},{name:"SignerInfo.issuerAndSerialNumber",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.issuerAndSerialNumber.issuer",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"SignerInfo.issuerAndSerialNumber.serialNumber",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"SignerInfo.digestAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.digestAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"digestAlgorithm"},{name:"SignerInfo.digestAlgorithm.parameter",tagClass:i.Class.UNIVERSAL,constructed:!1,captureAsn1:"digestParameter",optional:!0}]},{name:"SignerInfo.authenticatedAttributes",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"authenticatedAttributes"},{name:"SignerInfo.digestEncryptionAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,capture:"signatureAlgorithm"},{name:"SignerInfo.encryptedDigest",tagClass:i.Class.UNIVERSAL,type:i.Type.OCTETSTRING,constructed:!1,capture:"signature"},{name:"SignerInfo.unauthenticatedAttributes",tagClass:i.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,capture:"unauthenticatedAttributes"}]};a.signedDataValidator={name:"SignedData",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"SignedData.Version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"version"},{name:"SignedData.DigestAlgorithms",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,constructed:!0,captureAsn1:"digestAlgorithms"},o,{name:"SignedData.Certificates",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,optional:!0,captureAsn1:"certificates"},{name:"SignedData.CertificateRevocationLists",tagClass:i.Class.CONTEXT_SPECIFIC,type:1,optional:!0,captureAsn1:"crls"},{name:"SignedData.SignerInfos",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,capture:"signerInfos",optional:!0,value:[u]}]},a.recipientInfoValidator={name:"RecipientInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"version"},{name:"RecipientInfo.issuerAndSerial",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.issuerAndSerial.issuer",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"RecipientInfo.issuerAndSerial.serialNumber",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"RecipientInfo.keyEncryptionAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.keyEncryptionAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"RecipientInfo.keyEncryptionAlgorithm.parameter",tagClass:i.Class.UNIVERSAL,constructed:!1,captureAsn1:"encParameter"}]},{name:"RecipientInfo.encryptedKey",tagClass:i.Class.UNIVERSAL,type:i.Type.OCTETSTRING,constructed:!1,capture:"encKey"}]}},function(e,t,r){var n=r(0);r(1),n.mgf=n.mgf||{},(e.exports=n.mgf.mgf1=n.mgf1=n.mgf1||{}).create=function(e){return{generate:function(t,r){for(var i=new n.util.ByteBuffer,a=Math.ceil(r/e.digestLength),o=0;o<a;o++){var s=new n.util.ByteBuffer;s.putInt32(o),e.start(),e.update(t+s.getBytes()),i.putBuffer(e.digest())}return i.truncate(i.length()-r),i.getBytes()}}}},function(e,t,r){var n=r(0);e.exports=n.debug=n.debug||{},n.debug.storage={},n.debug.get=function(e,t){var r;return void 0===e?r=n.debug.storage:e in n.debug.storage&&(r=void 0===t?n.debug.storage[e]:n.debug.storage[e][t]),r},n.debug.set=function(e,t,r){e in n.debug.storage||(n.debug.storage[e]={}),n.debug.storage[e][t]=r},n.debug.clear=function(e,t){void 0===e?n.debug.storage={}:e in n.debug.storage&&(void 0===t?delete n.debug.storage[e]:delete n.debug.storage[e][t])}},function(e,t,r){function n(){u=String.fromCharCode(128),u+=a.util.fillString(String.fromCharCode(0),128),l=[[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]],(f={})["SHA-512"]=[[1779033703,4089235720],[3144134277,2227873595],[1013904242,4271175723],[2773480762,1595750129],[1359893119,2917565137],[2600822924,725511199],[528734635,4215389547],[1541459225,327033209]],f["SHA-384"]=[[3418070365,3238371032],[1654270250,914150663],[2438529370,812702999],[355462360,4144912697],[1731405415,4290775857],[2394180231,1750603025],[3675008525,1694076839],[1203062813,3204075428]],f["SHA-512/256"]=[[573645204,4230739756],[2673172387,3360449730],[596883563,1867755857],[2520282905,1497426621],[2519219938,2827943907],[3193839141,1401305490],[721525244,746961066],[246885852,2177182882]],f["SHA-512/224"]=[[2352822216,424955298],[1944164710,2312950998],[502970286,855612546],[1738396948,1479516111],[258812777,2077511080],[2011393907,79989058],[1067287976,1780299464],[286451373,2446758561]],c=!0}function i(e,t,r){for(var n,i,a,o,s,u,c,f,p,h,d,g,y,v,m,C,E,b,S,B,A,T,w,I,k,_,R,x,N,L,D,U,F,P=r.length();P>=128;){for(R=0;R<16;++R)t[R][0]=r.getInt32()>>>0,t[R][1]=r.getInt32()>>>0;for(;R<80;++R)n=(((x=(L=t[R-2])[0])>>>19|(N=L[1])<<13)^(N>>>29|x<<3)^x>>>6)>>>0,i=((x<<13|N>>>19)^(N<<3|x>>>29)^(x<<26|N>>>6))>>>0,a=(((x=(U=t[R-15])[0])>>>1|(N=U[1])<<31)^(x>>>8|N<<24)^x>>>7)>>>0,o=((x<<31|N>>>1)^(x<<24|N>>>8)^(x<<25|N>>>7))>>>0,D=t[R-7],F=t[R-16],N=i+D[1]+o+F[1],t[R][0]=n+D[0]+a+F[0]+(N/4294967296>>>0)>>>0,t[R][1]=N>>>0;for(d=e[0][0],g=e[0][1],y=e[1][0],v=e[1][1],m=e[2][0],C=e[2][1],E=e[3][0],b=e[3][1],S=e[4][0],B=e[4][1],A=e[5][0],T=e[5][1],w=e[6][0],I=e[6][1],k=e[7][0],_=e[7][1],R=0;R<80;++R)c=((S>>>14|B<<18)^(S>>>18|B<<14)^(B>>>9|S<<23))>>>0,f=(w^S&(A^w))>>>0,s=((d>>>28|g<<4)^(g>>>2|d<<30)^(g>>>7|d<<25))>>>0,u=((d<<4|g>>>28)^(g<<30|d>>>2)^(g<<25|d>>>7))>>>0,p=(d&y|m&(d^y))>>>0,h=(g&v|C&(g^v))>>>0,N=_+(((S<<18|B>>>14)^(S<<14|B>>>18)^(B<<23|S>>>9))>>>0)+((I^B&(T^I))>>>0)+l[R][1]+t[R][1],n=k+c+f+l[R][0]+t[R][0]+(N/4294967296>>>0)>>>0,i=N>>>0,a=s+p+((N=u+h)/4294967296>>>0)>>>0,o=N>>>0,k=w,_=I,w=A,I=T,A=S,T=B,S=E+n+((N=b+i)/4294967296>>>0)>>>0,B=N>>>0,E=m,b=C,m=y,C=v,y=d,v=g,d=n+a+((N=i+o)/4294967296>>>0)>>>0,g=N>>>0;N=e[0][1]+g,e[0][0]=e[0][0]+d+(N/4294967296>>>0)>>>0,e[0][1]=N>>>0,N=e[1][1]+v,e[1][0]=e[1][0]+y+(N/4294967296>>>0)>>>0,e[1][1]=N>>>0,N=e[2][1]+C,e[2][0]=e[2][0]+m+(N/4294967296>>>0)>>>0,e[2][1]=N>>>0,N=e[3][1]+b,e[3][0]=e[3][0]+E+(N/4294967296>>>0)>>>0,e[3][1]=N>>>0,N=e[4][1]+B,e[4][0]=e[4][0]+S+(N/4294967296>>>0)>>>0,e[4][1]=N>>>0,N=e[5][1]+T,e[5][0]=e[5][0]+A+(N/4294967296>>>0)>>>0,e[5][1]=N>>>0,N=e[6][1]+I,e[6][0]=e[6][0]+w+(N/4294967296>>>0)>>>0,e[6][1]=N>>>0,N=e[7][1]+_,e[7][0]=e[7][0]+k+(N/4294967296>>>0)>>>0,e[7][1]=N>>>0,P-=128}}var a=r(0);r(4),r(1);var o=e.exports=a.sha512=a.sha512||{};a.md.sha512=a.md.algorithms.sha512=o;var s=a.sha384=a.sha512.sha384=a.sha512.sha384||{};s.create=function(){return o.create("SHA-384")},a.md.sha384=a.md.algorithms.sha384=s,a.sha512.sha256=a.sha512.sha256||{create:function(){return o.create("SHA-512/256")}},a.md["sha512/256"]=a.md.algorithms["sha512/256"]=a.sha512.sha256,a.sha512.sha224=a.sha512.sha224||{create:function(){return o.create("SHA-512/224")}},a.md["sha512/224"]=a.md.algorithms["sha512/224"]=a.sha512.sha224,o.create=function(e){if(c||n(),void 0===e&&(e="SHA-512"),!(e in f))throw new Error("Invalid SHA-512 algorithm: "+e);for(var t=f[e],r=null,o=a.util.createBuffer(),s=new Array(80),l=0;l<80;++l)s[l]=new Array(2);var p=64;switch(e){case"SHA-384":p=48;break;case"SHA-512/256":p=32;break;case"SHA-512/224":p=28}var h={algorithm:e.replace("-","").toLowerCase(),blockLength:128,digestLength:p,messageLength:0,fullMessageLength:null,messageLengthSize:16,start:function(){h.messageLength=0,h.fullMessageLength=h.messageLength128=[];for(var e=h.messageLengthSize/4,n=0;n<e;++n)h.fullMessageLength.push(0);for(o=a.util.createBuffer(),r=new Array(t.length),n=0;n<t.length;++n)r[n]=t[n].slice(0);return h}};return h.start(),h.update=function(e,t){"utf8"===t&&(e=a.util.encodeUtf8(e));var n=e.length;h.messageLength+=n,n=[n/4294967296>>>0,n>>>0];for(var u=h.fullMessageLength.length-1;u>=0;--u)h.fullMessageLength[u]+=n[1],n[1]=n[0]+(h.fullMessageLength[u]/4294967296>>>0),h.fullMessageLength[u]=h.fullMessageLength[u]>>>0,n[0]=n[1]/4294967296>>>0;return o.putBytes(e),i(r,s,o),(o.read>2048||0===o.length())&&o.compact(),h},h.digest=function(){var t=a.util.createBuffer();t.putBytes(o.bytes());var n=h.fullMessageLength[h.fullMessageLength.length-1]+h.messageLengthSize&h.blockLength-1;t.putBytes(u.substr(0,h.blockLength-n));for(var c,l=8*h.fullMessageLength[0],f=0;f<h.fullMessageLength.length-1;++f)l+=(c=8*h.fullMessageLength[f+1])/4294967296>>>0,t.putInt32(l>>>0),l=c>>>0;t.putInt32(l);var p=new Array(r.length);for(f=0;f<r.length;++f)p[f]=r[f].slice(0);i(p,s,t);var d,g=a.util.createBuffer();for(d="SHA-512"===e?p.length:"SHA-384"===e?p.length-2:p.length-4,f=0;f<d;++f)g.putInt32(p[f][0]),f===d-1&&"SHA-512/224"===e||g.putInt32(p[f][1]);return g},h};var u=null,c=!1,l=null,f=null},function(e,t,r){var n=r(0);r(1),e.exports=n.log=n.log||{},n.log.levels=["none","error","warning","info","debug","verbose","max"];var i={},a=[],o=null;n.log.LEVEL_LOCKED=2,n.log.NO_LEVEL_CHECK=4,n.log.INTERPOLATE=8;for(var s=0;s<n.log.levels.length;++s){var u=n.log.levels[s];i[u]={index:s,name:u.toUpperCase()}}n.log.logMessage=function(e){for(var t=i[e.level].index,r=0;r<a.length;++r){var o=a[r];o.flags&n.log.NO_LEVEL_CHECK?o.f(e):t<=i[o.level].index&&o.f(o,e)}},n.log.prepareStandard=function(e){"standard"in e||(e.standard=i[e.level].name+" ["+e.category+"] "+e.message)},n.log.prepareFull=function(e){if(!("full"in e)){var t=[e.message];t=t.concat([]||!1),e.full=n.util.format.apply(this,t)}},n.log.prepareStandardFull=function(e){"standardFull"in e||(n.log.prepareStandard(e),e.standardFull=e.standard)};var c=["error","warning","info","debug","verbose"];for(s=0;s<c.length;++s)!function(e){n.log[e]=function(t,r){var i=Array.prototype.slice.call(arguments).slice(2),a={timestamp:new Date,level:e,category:t,message:r,arguments:i};n.log.logMessage(a)}}(c[s]);if(n.log.makeLogger=function(e){var t={flags:0,f:e};return n.log.setLevel(t,"none"),t},n.log.setLevel=function(e,t){var r=!1;if(e&&!(e.flags&n.log.LEVEL_LOCKED))for(var i=0;i<n.log.levels.length;++i)if(t==n.log.levels[i]){e.level=t,r=!0;break}return r},n.log.lock=function(e,t){void 0===t||t?e.flags|=n.log.LEVEL_LOCKED:e.flags&=~n.log.LEVEL_LOCKED},n.log.addLogger=function(e){a.push(e)},"undefined"!=typeof console&&"log"in console){var l;if(console.error&&console.warn&&console.info&&console.debug){var f={error:console.error,warning:console.warn,info:console.info,debug:console.debug,verbose:console.debug},p=function(e,t){n.log.prepareStandard(t);var r=f[t.level],i=[t.standard];i=i.concat(t.arguments.slice()),r.apply(console,i)};l=n.log.makeLogger(p)}else p=function(e,t){n.log.prepareStandardFull(t),console.log(t.standardFull)},l=n.log.makeLogger(p);n.log.setLevel(l,"debug"),n.log.addLogger(l),o=l}else console={log:function(){}};if(null!==o){var h=n.util.getQueryVariables();"console.level"in h&&n.log.setLevel(o,h["console.level"].slice(-1)[0]),"console.lock"in h&&"true"==h["console.lock"].slice(-1)[0]&&n.log.lock(o)}n.log.consoleLogger=o},function(e,t,r){e.exports=r(35)},function(e,t,r){e.exports=r(0),r(5),r(38),r(3),r(13),r(31),r(10),r(40),r(8),r(42),r(33),r(43),r(30),r(15),r(7),r(26),r(28),r(44),r(21),r(27),r(24),r(18),r(2),r(25),r(45),r(46),r(20),r(1)},function(e,t){var r;r=function(){return this}();try{r=r||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(r=window)}e.exports=r},function(e,r){var n={};e.exports=n;var i={};n.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,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%a,c=c/a|0;for(;c>0;)s.push(c%a),c=c/a|0}for(i=0;0===e[i]&&i<e.length-1;++i)n+=o;for(i=s.length-1;i>=0;--i)n+=t[s[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 o=0,s=e.at(r);o<a.length;++o)s+=a[o]<<8,a[o]=s%n,s=s/n|0;for(;s>0;)a.push(s%n),s=s/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},n.decode=function(e,r){if("string"!=typeof e)throw new TypeError('"input" must be a string.');if("string"!=typeof r)throw new TypeError('"alphabet" must be a string.');var n=i[r];if(!n){n=i[r]=[];for(var a=0;a<r.length;++a)n[r.charCodeAt(a)]=a}e=e.replace(/\s/g,"");var o=r.length,s=r.charAt(0),u=[0];for(a=0;a<e.length;a++){var c=n[e.charCodeAt(a)];if(void 0===c)return;for(var l=0,f=c;l<u.length;++l)f+=u[l]*o,u[l]=255&f,f>>=8;for(;f>0;)u.push(255&f),f>>=8}for(var p=0;e[p]===s&&p<e.length-1;++p)u.push(0);return void 0!==t?t.from(u.reverse()):new Uint8Array(u.reverse())}},function(e,t,r){function n(e,t,r){var n=t.entity===u.tls.ConnectionEnd.client;e.read.cipherState={init:!1,cipher:u.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:u.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=s,e.write.cipherFunction=i,e.read.macLength=e.write.macLength=r.mac_length,e.read.macFunction=e.write.macFunction=c.hmac_sha1}function i(e,t){var r,n=!1,i=t.macFunction(t.macKey,t.sequenceNumber,e);e.fragment.putBytes(i),t.updateSequenceNumber(),r=e.version.minor===c.Versions.TLS_1_0.minor?t.cipherState.init?null:t.cipherState.iv:u.random.getBytesSync(16),t.cipherState.init=!0;var o=t.cipherState.cipher;return o.start({iv:r}),e.version.minor>=c.Versions.TLS_1_1.minor&&o.output.putBytes(r),o.update(e.fragment),o.finish(a)&&(e.fragment=o.output,e.length=e.fragment.length(),n=!0),n}function a(e,t,r){if(!r){var n=e-t.length()%e;t.fillWithByte(n-1,n)}return!0}function o(e,t,r){var n=!0;if(r){for(var i=t.length(),a=t.last(),o=i-1-a;o<i-1;++o)n=n&&t.at(o)==a;n&&t.truncate(a+1)}return n}function s(e,t){var r,n=!1;r=e.version.minor===c.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(o);var a=t.macLength,s=u.random.getBytesSync(a),l=i.output.length();l>=a?(e.fragment=i.output.getBytes(l-a),s=i.output.getBytes(a)):e.fragment=i.output.getBytes(),e.fragment=u.util.createBuffer(e.fragment),e.length=e.fragment.length();var f=t.macFunction(t.macKey,t.sequenceNumber,e);return t.updateSequenceNumber(),function(e,t,r){var n=u.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,f)&&n}var u=r(0);r(5),r(20);var c=e.exports=u.tls;c.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=c.BulkCipherAlgorithm.aes,e.cipher_type=c.CipherType.block,e.enc_key_length=16,e.block_length=16,e.fixed_iv_length=16,e.record_iv_length=16,e.mac_algorithm=c.MACAlgorithm.hmac_sha1,e.mac_length=20,e.mac_key_length=20},initConnectionState:n},c.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=c.BulkCipherAlgorithm.aes,e.cipher_type=c.CipherType.block,e.enc_key_length=32,e.block_length=16,e.fixed_iv_length=16,e.record_iv_length=16,e.mac_algorithm=c.MACAlgorithm.hmac_sha1,e.mac_length=20,e.mac_key_length=20},initConnectionState:n}},function(e,t,r){var n=r(0);r(30),e.exports=n.mgf=n.mgf||{},n.mgf.mgf1=n.mgf1},function(e,r,n){function i(e){var r=e.message;if(r instanceof Uint8Array||r instanceof D)return r;var n=e.encoding;if(void 0===r){if(!e.md)throw new TypeError('"options.message" or "options.md" not specified.');r=e.md.digest().getBytes(),n="binary"}if("string"==typeof r&&!n)throw new TypeError('"options.encoding" must be "binary" or "utf8".');if("string"==typeof r){if(void 0!==t)return t.from(r,n);r=new L(r,n)}else if(!(r instanceof L))throw new TypeError('"options.message" must be a node.js Buffer, a Uint8Array, a forge ByteBuffer, or a string with "options.encoding" specifying its encoding.');for(var i=new D(r.length()),a=0;a<i.length;++a)i[a]=r.at(a);return i}function a(e,r){var n=k.md.sha512.create(),i=new L(e);n.update(i.getBytes(r),"binary");var a=n.digest().getBytes();if(void 0!==t)return t.from(a,"binary");for(var o=new D(U.constants.HASH_BYTE_LENGTH),s=0;s<64;++s)o[s]=a.charCodeAt(s);return o}function o(e,t){var r,n=[B(),B(),B(),B()],i=a(t,32);for(i[0]&=248,i[31]&=127,i[31]|=64,C(n,i),h(e,n),r=0;r<32;++r)t[r+32]=e[r];return 0}function s(e,t,r,n){var i,o,s=new Float64Array(64),u=[B(),B(),B(),B()],f=a(n,32);f[0]&=248,f[31]&=127,f[31]|=64;var p=r+64;for(i=0;i<r;++i)e[64+i]=t[i];for(i=0;i<32;++i)e[32+i]=f[32+i];var d=a(e.subarray(32),r+32);for(l(d),C(u,d),h(e,u),i=32;i<64;++i)e[i]=n[i];var g=a(e,r+64);for(l(g),i=32;i<64;++i)s[i]=0;for(i=0;i<32;++i)s[i]=d[i];for(i=0;i<32;++i)for(o=0;o<32;o++)s[i+o]+=g[i]*f[o];return c(e.subarray(32),s),p}function u(e,t,r,n){var i,o=new D(32),s=[B(),B(),B(),B()],u=[B(),B(),B(),B()];if(r<64)return-1;if(function(e,t){var r=B(),n=B(),i=B(),a=B(),o=B(),s=B(),u=B();return E(e[2],P),function(e,t){var r;for(r=0;r<16;++r)e[r]=t[2*r]+(t[2*r+1]<<8);e[15]&=32767}(e[1],t),w(i,e[1]),I(a,i,O),T(i,i,e[2]),A(a,e[2],a),w(o,a),w(s,o),I(u,s,o),I(r,u,i),I(r,r,a),function(e,t){var r,n=B();for(r=0;r<16;++r)n[r]=t[r];for(r=250;r>=0;--r)w(n,n),1!==r&&I(n,n,t);for(r=0;r<16;++r)e[r]=n[r]}(r,r),I(r,r,i),I(r,r,a),I(r,r,a),I(e[0],r,a),w(n,e[0]),I(n,n,a),g(n,i)&&I(e[0],e[0],j),w(n,e[0]),I(n,n,a),g(n,i)?-1:(v(e[0])===t[31]>>7&&T(e[0],F,e[0]),I(e[3],e[0],e[1]),0)}(u,n))return-1;for(i=0;i<r;++i)e[i]=t[i];for(i=0;i<32;++i)e[i+32]=n[i];var c=a(e,r);if(l(c),m(s,u,c),C(u,t.subarray(32)),f(s,u),h(o,s),r-=64,y(t,0,o,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}function c(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]*H[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)*H[i],r=t[i]>>8,t[i]&=255;for(i=0;i<32;++i)t[i]-=r*H[i];for(n=0;n<32;++n)t[n+1]+=t[n]>>8,e[n]=255&t[n]}function l(e){for(var t=new Float64Array(64),r=0;r<64;++r)t[r]=e[r],e[r]=0;c(e,t)}function f(e,t){var r=B(),n=B(),i=B(),a=B(),o=B(),s=B(),u=B(),c=B(),l=B();T(r,e[1],e[0]),T(l,t[1],t[0]),I(r,r,l),A(n,e[0],e[1]),A(l,t[0],t[1]),I(n,n,l),I(i,e[3],t[3]),I(i,i,V),I(a,e[2],t[2]),A(a,a,a),T(o,n,r),T(s,a,i),A(u,a,i),A(c,n,r),I(e[0],o,s),I(e[1],c,u),I(e[2],u,s),I(e[3],o,c)}function p(e,t,r){for(var n=0;n<4;++n)S(e[n],t[n],r)}function h(e,t){var r=B(),n=B(),i=B();(function(e,t){var r,n=B();for(r=0;r<16;++r)n[r]=t[r];for(r=253;r>=0;--r)w(n,n),2!==r&&4!==r&&I(n,n,t);for(r=0;r<16;++r)e[r]=n[r]})(i,t[2]),I(r,t[0],i),I(n,t[1],i),d(e,n),e[31]^=v(r)<<7}function d(e,t){var r,n,i,a=B(),o=B();for(r=0;r<16;++r)o[r]=t[r];for(b(o),b(o),b(o),n=0;n<2;++n){for(a[0]=o[0]-65517,r=1;r<15;++r)a[r]=o[r]-65535-(a[r-1]>>16&1),a[r-1]&=65535;a[15]=o[15]-32767-(a[14]>>16&1),i=a[15]>>16&1,a[14]&=65535,S(o,a,1-i)}for(r=0;r<16;r++)e[2*r]=255&o[r],e[2*r+1]=o[r]>>8}function g(e,t){var r=new D(32),n=new D(32);return d(r,e),d(n,t),y(r,0,n,0)}function y(e,t,r,n){return function(e,t,r,n,i){var a,o=0;for(a=0;a<i;++a)o|=e[t+a]^r[n+a];return(1&o-1>>>8)-1}(e,t,r,n,32)}function v(e){var t=new D(32);return d(t,e),1&t[0]}function m(e,t,r){var n,i;for(E(e[0],F),E(e[1],P),E(e[2],P),E(e[3],F),i=255;i>=0;--i)p(e,t,n=r[i/8|0]>>(7&i)&1),f(t,e),f(e,e),p(e,t,n)}function C(e,t){var r=[B(),B(),B(),B()];E(r[0],M),E(r[1],K),E(r[2],P),I(r[3],M,K),m(e,r,t)}function E(e,t){var r;for(r=0;r<16;r++)e[r]=0|t[r]}function b(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 S(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 B(e){var t,r=new Float64Array(16);if(e)for(t=0;t<e.length;++t)r[t]=e[t];return r}function A(e,t,r){for(var n=0;n<16;++n)e[n]=t[n]+r[n]}function T(e,t,r){for(var n=0;n<16;++n)e[n]=t[n]-r[n]}function w(e,t){I(e,t,t)}function I(e,t,r){var n,i,a=0,o=0,s=0,u=0,c=0,l=0,f=0,p=0,h=0,d=0,g=0,y=0,v=0,m=0,C=0,E=0,b=0,S=0,B=0,A=0,T=0,w=0,I=0,k=0,_=0,R=0,x=0,N=0,L=0,D=0,U=0,F=r[0],P=r[1],O=r[2],V=r[3],M=r[4],K=r[5],H=r[6],j=r[7],z=r[8],G=r[9],q=r[10],Y=r[11],Q=r[12],W=r[13],X=r[14],$=r[15];a+=(n=t[0])*F,o+=n*P,s+=n*O,u+=n*V,c+=n*M,l+=n*K,f+=n*H,p+=n*j,h+=n*z,d+=n*G,g+=n*q,y+=n*Y,v+=n*Q,m+=n*W,C+=n*X,E+=n*$,o+=(n=t[1])*F,s+=n*P,u+=n*O,c+=n*V,l+=n*M,f+=n*K,p+=n*H,h+=n*j,d+=n*z,g+=n*G,y+=n*q,v+=n*Y,m+=n*Q,C+=n*W,E+=n*X,b+=n*$,s+=(n=t[2])*F,u+=n*P,c+=n*O,l+=n*V,f+=n*M,p+=n*K,h+=n*H,d+=n*j,g+=n*z,y+=n*G,v+=n*q,m+=n*Y,C+=n*Q,E+=n*W,b+=n*X,S+=n*$,u+=(n=t[3])*F,c+=n*P,l+=n*O,f+=n*V,p+=n*M,h+=n*K,d+=n*H,g+=n*j,y+=n*z,v+=n*G,m+=n*q,C+=n*Y,E+=n*Q,b+=n*W,S+=n*X,B+=n*$,c+=(n=t[4])*F,l+=n*P,f+=n*O,p+=n*V,h+=n*M,d+=n*K,g+=n*H,y+=n*j,v+=n*z,m+=n*G,C+=n*q,E+=n*Y,b+=n*Q,S+=n*W,B+=n*X,A+=n*$,l+=(n=t[5])*F,f+=n*P,p+=n*O,h+=n*V,d+=n*M,g+=n*K,y+=n*H,v+=n*j,m+=n*z,C+=n*G,E+=n*q,b+=n*Y,S+=n*Q,B+=n*W,A+=n*X,T+=n*$,f+=(n=t[6])*F,p+=n*P,h+=n*O,d+=n*V,g+=n*M,y+=n*K,v+=n*H,m+=n*j,C+=n*z,E+=n*G,b+=n*q,S+=n*Y,B+=n*Q,A+=n*W,T+=n*X,w+=n*$,p+=(n=t[7])*F,h+=n*P,d+=n*O,g+=n*V,y+=n*M,v+=n*K,m+=n*H,C+=n*j,E+=n*z,b+=n*G,S+=n*q,B+=n*Y,A+=n*Q,T+=n*W,w+=n*X,I+=n*$,h+=(n=t[8])*F,d+=n*P,g+=n*O,y+=n*V,v+=n*M,m+=n*K,C+=n*H,E+=n*j,b+=n*z,S+=n*G,B+=n*q,A+=n*Y,T+=n*Q,w+=n*W,I+=n*X,k+=n*$,d+=(n=t[9])*F,g+=n*P,y+=n*O,v+=n*V,m+=n*M,C+=n*K,E+=n*H,b+=n*j,S+=n*z,B+=n*G,A+=n*q,T+=n*Y,w+=n*Q,I+=n*W,k+=n*X,_+=n*$,g+=(n=t[10])*F,y+=n*P,v+=n*O,m+=n*V,C+=n*M,E+=n*K,b+=n*H,S+=n*j,B+=n*z,A+=n*G,T+=n*q,w+=n*Y,I+=n*Q,k+=n*W,_+=n*X,R+=n*$,y+=(n=t[11])*F,v+=n*P,m+=n*O,C+=n*V,E+=n*M,b+=n*K,S+=n*H,B+=n*j,A+=n*z,T+=n*G,w+=n*q,I+=n*Y,k+=n*Q,_+=n*W,R+=n*X,x+=n*$,v+=(n=t[12])*F,m+=n*P,C+=n*O,E+=n*V,b+=n*M,S+=n*K,B+=n*H,A+=n*j,T+=n*z,w+=n*G,I+=n*q,k+=n*Y,_+=n*Q,R+=n*W,x+=n*X,N+=n*$,m+=(n=t[13])*F,C+=n*P,E+=n*O,b+=n*V,S+=n*M,B+=n*K,A+=n*H,T+=n*j,w+=n*z,I+=n*G,k+=n*q,_+=n*Y,R+=n*Q,x+=n*W,N+=n*X,L+=n*$,C+=(n=t[14])*F,E+=n*P,b+=n*O,S+=n*V,B+=n*M,A+=n*K,T+=n*H,w+=n*j,I+=n*z,k+=n*G,_+=n*q,R+=n*Y,x+=n*Q,N+=n*W,L+=n*X,D+=n*$,E+=(n=t[15])*F,o+=38*(S+=n*O),s+=38*(B+=n*V),u+=38*(A+=n*M),c+=38*(T+=n*K),l+=38*(w+=n*H),f+=38*(I+=n*j),p+=38*(k+=n*z),h+=38*(_+=n*G),d+=38*(R+=n*q),g+=38*(x+=n*Y),y+=38*(N+=n*Q),v+=38*(L+=n*W),m+=38*(D+=n*X),C+=38*(U+=n*$),a=(n=(a+=38*(b+=n*P))+(i=1)+65535)-65536*(i=Math.floor(n/65536)),o=(n=o+i+65535)-65536*(i=Math.floor(n/65536)),s=(n=s+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)),f=(n=f+i+65535)-65536*(i=Math.floor(n/65536)),p=(n=p+i+65535)-65536*(i=Math.floor(n/65536)),h=(n=h+i+65535)-65536*(i=Math.floor(n/65536)),d=(n=d+i+65535)-65536*(i=Math.floor(n/65536)),g=(n=g+i+65535)-65536*(i=Math.floor(n/65536)),y=(n=y+i+65535)-65536*(i=Math.floor(n/65536)),v=(n=v+i+65535)-65536*(i=Math.floor(n/65536)),m=(n=m+i+65535)-65536*(i=Math.floor(n/65536)),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)),o=(n=o+i+65535)-65536*(i=Math.floor(n/65536)),s=(n=s+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)),f=(n=f+i+65535)-65536*(i=Math.floor(n/65536)),p=(n=p+i+65535)-65536*(i=Math.floor(n/65536)),h=(n=h+i+65535)-65536*(i=Math.floor(n/65536)),d=(n=d+i+65535)-65536*(i=Math.floor(n/65536)),g=(n=g+i+65535)-65536*(i=Math.floor(n/65536)),y=(n=y+i+65535)-65536*(i=Math.floor(n/65536)),v=(n=v+i+65535)-65536*(i=Math.floor(n/65536)),m=(n=m+i+65535)-65536*(i=Math.floor(n/65536)),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]=o,e[2]=s,e[3]=u,e[4]=c,e[5]=l,e[6]=f,e[7]=p,e[8]=h,e[9]=d,e[10]=g,e[11]=y,e[12]=v,e[13]=m,e[14]=C,e[15]=E}var k=n(0);n(12),n(2),n(32),n(1);var _=n(41),R=_.publicKeyValidator,x=_.privateKeyValidator;if(void 0===N)var N=k.jsbn.BigInteger;var L=k.util.ByteBuffer,D=void 0===t?Uint8Array:t;k.pki=k.pki||{},e.exports=k.pki.ed25519=k.ed25519=k.ed25519||{};var U=k.ed25519;U.constants={},U.constants.PUBLIC_KEY_BYTE_LENGTH=32,U.constants.PRIVATE_KEY_BYTE_LENGTH=64,U.constants.SEED_BYTE_LENGTH=32,U.constants.SIGN_BYTE_LENGTH=64,U.constants.HASH_BYTE_LENGTH=64,U.generateKeyPair=function(e){var t=(e=e||{}).seed;if(void 0===t)t=k.random.getBytesSync(U.constants.SEED_BYTE_LENGTH);else if("string"==typeof t){if(t.length!==U.constants.SEED_BYTE_LENGTH)throw new TypeError('"seed" must be '+U.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=i({message:t,encoding:"binary"});for(var r=new D(U.constants.PUBLIC_KEY_BYTE_LENGTH),n=new D(U.constants.PRIVATE_KEY_BYTE_LENGTH),a=0;a<32;++a)n[a]=t[a];return o(r,n),{publicKey:r,privateKey:n}},U.privateKeyFromAsn1=function(e){var t={},r=[];if(!k.asn1.validate(e,x,t,r)){var n=new Error("Invalid Key.");throw n.errors=r,n}var a=k.asn1.derToOid(t.privateKeyOid),o=k.oids.EdDSA25519;if(a!==o)throw new Error('Invalid OID "'+a+'"; OID must be "'+o+'".');var s=t.privateKey;return{privateKeyBytes:i({message:k.asn1.fromDer(s).value,encoding:"binary"})}},U.publicKeyFromAsn1=function(e){var t={},r=[];if(!k.asn1.validate(e,R,t,r)){var n=new Error("Invalid Key.");throw n.errors=r,n}var a=k.asn1.derToOid(t.publicKeyOid),o=k.oids.EdDSA25519;if(a!==o)throw new Error('Invalid OID "'+a+'"; OID must be "'+o+'".');var s=t.ed25519PublicKey;if(s.length!==U.constants.PUBLIC_KEY_BYTE_LENGTH)throw new Error("Key length is invalid.");return i({message:s,encoding:"binary"})},U.publicKeyFromPrivateKey=function(e){var t=i({message:(e=e||{}).privateKey,encoding:"binary"});if(t.length!==U.constants.PRIVATE_KEY_BYTE_LENGTH)throw new TypeError('"options.privateKey" must have a byte length of '+U.constants.PRIVATE_KEY_BYTE_LENGTH);for(var r=new D(U.constants.PUBLIC_KEY_BYTE_LENGTH),n=0;n<r.length;++n)r[n]=t[32+n];return r},U.sign=function(e){var t=i(e=e||{}),r=i({message:e.privateKey,encoding:"binary"});if(r.length===U.constants.SEED_BYTE_LENGTH)r=U.generateKeyPair({seed:r}).privateKey;else if(r.length!==U.constants.PRIVATE_KEY_BYTE_LENGTH)throw new TypeError('"options.privateKey" must have a byte length of '+U.constants.SEED_BYTE_LENGTH+" or "+U.constants.PRIVATE_KEY_BYTE_LENGTH);var n=new D(U.constants.SIGN_BYTE_LENGTH+t.length);s(n,t,t.length,r);for(var a=new D(U.constants.SIGN_BYTE_LENGTH),o=0;o<a.length;++o)a[o]=n[o];return a},U.verify=function(e){var t=i(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=i({message:e.signature,encoding:"binary"});if(r.length!==U.constants.SIGN_BYTE_LENGTH)throw new TypeError('"options.signature" must have a byte length of '+U.constants.SIGN_BYTE_LENGTH);var n=i({message:e.publicKey,encoding:"binary"});if(n.length!==U.constants.PUBLIC_KEY_BYTE_LENGTH)throw new TypeError('"options.publicKey" must have a byte length of '+U.constants.PUBLIC_KEY_BYTE_LENGTH);var a,o=new D(U.constants.SIGN_BYTE_LENGTH+t.length),s=new D(U.constants.SIGN_BYTE_LENGTH+t.length);for(a=0;a<U.constants.SIGN_BYTE_LENGTH;++a)o[a]=r[a];for(a=0;a<t.length;++a)o[a+U.constants.SIGN_BYTE_LENGTH]=t[a];return u(s,o,o.length,n)>=0};var F=B(),P=B([1]),O=B([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),V=B([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),M=B([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),K=B([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),H=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]),j=B([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139])},function(e,t,r){var n=r(0);r(3);var i=n.asn1;t.privateKeyValidator={name:"PrivateKeyInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},t.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{tagClass:i.Class.UNIVERSAL,type:i.Type.BITSTRING,constructed:!1,composed:!0,captureBitStringValue:"ed25519PublicKey"}]}},function(e,t,r){function n(e,t,r,n){e.generate=function(e,a){for(var o=new i.util.ByteBuffer,s=Math.ceil(a/n)+r,u=new i.util.ByteBuffer,c=r;c<s;++c){u.putInt32(c),t.start(),t.update(e+u.getBytes());var l=t.digest();o.putBytes(l.getBytes(n))}return o.truncate(o.length()-a),o.getBytes()}}var i=r(0);r(1),r(2),r(12),e.exports=i.kem=i.kem||{};var a=i.jsbn.BigInteger;i.kem.rsa={},i.kem.rsa.create=function(e,t){var r=(t=t||{}).prng||i.random,n={encrypt:function(t,n){var o,s=Math.ceil(t.n.bitLength()/8);do{o=new a(i.util.bytesToHex(r.getBytesSync(s)),16).mod(t.n)}while(o.compareTo(a.ONE)<=0);var u=s-(o=i.util.hexToBytes(o.toString(16))).length;return u>0&&(o=i.util.fillString(String.fromCharCode(0),u)+o),{encapsulation:t.encrypt(o,"NONE"),key:e.generate(o,n)}},decrypt:function(t,r,n){var i=t.decrypt(r,"NONE");return e.generate(i,n)}};return n},i.kem.kdf1=function(e,t){n(this,e,0,t||e.digestLength)},i.kem.kdf2=function(e,t){n(this,e,1,t||e.digestLength)}},function(e,t,r){e.exports=r(4),r(14),r(9),r(23),r(32)},function(e,t,r){function n(e){var t={},r=[];if(!h.validate(e,d.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:p.pki.RDNAttributesAsArray(t.issuer),serialNumber:p.util.createBuffer(t.serial).toHex(),encryptedContent:{algorithm:h.derToOid(t.encAlgorithm),parameter:t.encParameter.value,content:t.encKey}}}function i(e){return h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[h.create(h.Class.UNIVERSAL,h.Type.INTEGER,!1,h.integerToDer(e.version).getBytes()),h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[p.pki.distinguishedNameToAsn1({attributes:e.issuer}),h.create(h.Class.UNIVERSAL,h.Type.INTEGER,!1,p.util.hexToBytes(e.serialNumber))]),h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[h.create(h.Class.UNIVERSAL,h.Type.OID,!1,h.oidToDer(e.encryptedContent.algorithm).getBytes()),h.create(h.Class.UNIVERSAL,h.Type.NULL,!1,"")]),h.create(h.Class.UNIVERSAL,h.Type.OCTETSTRING,!1,e.encryptedContent.content)])}function a(e){for(var t=[],r=0;r<e.length;++r)t.push(i(e[r]));return t}function o(e){var t=h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[h.create(h.Class.UNIVERSAL,h.Type.INTEGER,!1,h.integerToDer(e.version).getBytes()),h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[p.pki.distinguishedNameToAsn1({attributes:e.issuer}),h.create(h.Class.UNIVERSAL,h.Type.INTEGER,!1,p.util.hexToBytes(e.serialNumber))]),h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[h.create(h.Class.UNIVERSAL,h.Type.OID,!1,h.oidToDer(e.digestAlgorithm).getBytes()),h.create(h.Class.UNIVERSAL,h.Type.NULL,!1,"")])]);if(e.authenticatedAttributesAsn1&&t.value.push(e.authenticatedAttributesAsn1),t.value.push(h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[h.create(h.Class.UNIVERSAL,h.Type.OID,!1,h.oidToDer(e.signatureAlgorithm).getBytes()),h.create(h.Class.UNIVERSAL,h.Type.NULL,!1,"")])),t.value.push(h.create(h.Class.UNIVERSAL,h.Type.OCTETSTRING,!1,e.signature)),e.unauthenticatedAttributes.length>0){for(var r=h.create(h.Class.CONTEXT_SPECIFIC,1,!0,[]),n=0;n<e.unauthenticatedAttributes.length;++n){var i=e.unauthenticatedAttributes[n];r.values.push(u(i))}t.value.push(r)}return t}function s(e){for(var t=[],r=0;r<e.length;++r)t.push(o(e[r]));return t}function u(e){var t;if(e.type===p.pki.oids.contentType)t=h.create(h.Class.UNIVERSAL,h.Type.OID,!1,h.oidToDer(e.value).getBytes());else if(e.type===p.pki.oids.messageDigest)t=h.create(h.Class.UNIVERSAL,h.Type.OCTETSTRING,!1,e.value.bytes());else if(e.type===p.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?h.utcTimeToDate(i):h.generalizedTimeToDate(i):new Date(a)}t=i>=r&&i<n?h.create(h.Class.UNIVERSAL,h.Type.UTCTIME,!1,h.dateToUtcTime(i)):h.create(h.Class.UNIVERSAL,h.Type.GENERALIZEDTIME,!1,h.dateToGeneralizedTime(i))}return h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[h.create(h.Class.UNIVERSAL,h.Type.OID,!1,h.oidToDer(e.type).getBytes()),h.create(h.Class.UNIVERSAL,h.Type.SET,!0,[t])])}function c(e){return[h.create(h.Class.UNIVERSAL,h.Type.OID,!1,h.oidToDer(p.pki.oids.data).getBytes()),h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[h.create(h.Class.UNIVERSAL,h.Type.OID,!1,h.oidToDer(e.algorithm).getBytes()),h.create(h.Class.UNIVERSAL,h.Type.OCTETSTRING,!1,e.parameter.getBytes())]),h.create(h.Class.CONTEXT_SPECIFIC,0,!0,[h.create(h.Class.UNIVERSAL,h.Type.OCTETSTRING,!1,e.content.getBytes())])]}function l(e,t,r){var n={};if(!h.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(h.derToOid(n.contentType)!==p.pki.oids.data)throw new Error("Unsupported PKCS#7 message. Only wrapped ContentType Data supported.");if(n.encryptedContent){var a="";if(p.util.isArray(n.encryptedContent))for(var o=0;o<n.encryptedContent.length;++o){if(n.encryptedContent[o].type!==h.Type.OCTETSTRING)throw new Error("Malformed PKCS#7 message, expecting encrypted content constructed of only OCTET STRING objects.");a+=n.encryptedContent[o].value}else a=n.encryptedContent;e.encryptedContent={algorithm:h.derToOid(n.encAlgorithm),parameter:p.util.createBuffer(n.encParameter.value),content:p.util.createBuffer(a)}}if(n.content){if(a="",p.util.isArray(n.content))for(o=0;o<n.content.length;++o){if(n.content[o].type!==h.Type.OCTETSTRING)throw new Error("Malformed PKCS#7 message, expecting content constructed of only OCTET STRING objects.");a+=n.content[o].value}else a=n.content;e.content=p.util.createBuffer(a)}return e.version=n.version.charCodeAt(0),e.rawCapture=n,n}function f(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 p.pki.oids["aes128-CBC"]:case p.pki.oids["aes192-CBC"]:case p.pki.oids["aes256-CBC"]:t=p.aes.createDecryptionCipher(e.encryptedContent.key);break;case p.pki.oids.desCBC:case p.pki.oids["des-EDE3-CBC"]:t=p.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}}var p=r(0);r(5),r(3),r(10),r(6),r(7),r(29),r(2),r(1),r(17);var h=p.asn1,d=e.exports=p.pkcs7=p.pkcs7||{};d.messageFromPem=function(e){var t=p.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=h.fromDer(t.body);return d.messageFromAsn1(n)},d.messageToPem=function(e,t){var r={type:"PKCS7",body:h.toDer(e.toAsn1()).getBytes()};return p.pem.encode(r,{maxline:t})},d.messageFromAsn1=function(e){var t={},r=[];if(!h.validate(e,d.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=h.derToOid(t.contentType);switch(a){case p.pki.oids.envelopedData:i=d.createEnvelopedData();break;case p.pki.oids.encryptedData:i=d.createEncryptedData();break;case p.pki.oids.signedData:i=d.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},d.createSignedData=function(){var e=null;return e={type:p.pki.oids.signedData,version:1,certificates:[],crls:[],signers:[],digestAlgorithmIdentifiers:[],contentInfo:null,signerInfos:[],fromAsn1:function(t){if(l(e,t,d.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(p.pki.certificateFromAsn1(r[n]))},toAsn1:function(){e.contentInfo||e.sign();for(var t=[],r=0;r<e.certificates.length;++r)t.push(p.pki.certificateToAsn1(e.certificates[r]));var n=[],i=h.create(h.Class.CONTEXT_SPECIFIC,0,!0,[h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[h.create(h.Class.UNIVERSAL,h.Type.INTEGER,!1,h.integerToDer(e.version).getBytes()),h.create(h.Class.UNIVERSAL,h.Type.SET,!0,e.digestAlgorithmIdentifiers),e.contentInfo])]);return t.length>0&&i.value[0].value.push(h.create(h.Class.CONTEXT_SPECIFIC,0,!0,t)),n.length>0&&i.value[0].value.push(h.create(h.Class.CONTEXT_SPECIFIC,1,!0,n)),i.value[0].value.push(h.create(h.Class.UNIVERSAL,h.Type.SET,!0,e.signerInfos)),h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[h.create(h.Class.UNIVERSAL,h.Type.OID,!1,h.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=p.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=p.pki.privateKeyFromPem(a));var o=t.digestAlgorithm||p.pki.oids.sha1;switch(o){case p.pki.oids.sha1:case p.pki.oids.sha256:case p.pki.oids.sha384:case p.pki.oids.sha512:case p.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 f=s[l];if(u||f.type!==p.pki.oids.contentType){if(c||f.type!==p.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:o,signatureAlgorithm:p.pki.oids.rsaEncryption,signature:null,authenticatedAttributes:s,unauthenticatedAttributes:[]})},sign:function(t){var r;t=t||{},("object"!=typeof e.content||null===e.contentInfo)&&(e.contentInfo=h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[h.create(h.Class.UNIVERSAL,h.Type.OID,!1,h.oidToDer(p.pki.oids.data).getBytes())]),"content"in e)&&(e.content instanceof p.util.ByteBuffer?r=e.content.bytes():"string"==typeof e.content&&(r=p.util.encodeUtf8(e.content)),t.detached?e.detachedContent=h.create(h.Class.UNIVERSAL,h.Type.OCTETSTRING,!1,r):e.contentInfo.value.push(h.create(h.Class.CONTEXT_SPECIFIC,0,!0,[h.create(h.Class.UNIVERSAL,h.Type.OCTETSTRING,!1,r)]))),0!==e.signers.length&&function(t){var r;if(!(r=e.detachedContent?e.detachedContent:(r=e.contentInfo.value[1]).value[0]))throw new Error("Could not sign PKCS#7 message; there is no content to sign.");var n=h.derToOid(e.contentInfo.value[0].value),i=h.toDer(r);for(var a in i.getByte(),h.getBerValueLength(i),i=i.getBytes(),t)t[a].start().update(i);for(var o=new Date,c=0;c<e.signers.length;++c){var l=e.signers[c];if(0===l.authenticatedAttributes.length){if(n!==p.pki.oids.data)throw new Error("Invalid signer; authenticatedAttributes must be present when the ContentInfo content type is not PKCS#7 Data.")}else{l.authenticatedAttributesAsn1=h.create(h.Class.CONTEXT_SPECIFIC,0,!0,[]);for(var f=h.create(h.Class.UNIVERSAL,h.Type.SET,!0,[]),d=0;d<l.authenticatedAttributes.length;++d){var g=l.authenticatedAttributes[d];g.type===p.pki.oids.messageDigest?g.value=t[l.digestAlgorithm].digest():g.type===p.pki.oids.signingTime&&(g.value||(g.value=o)),f.value.push(u(g)),l.authenticatedAttributesAsn1.value.push(u(g))}i=h.toDer(f).getBytes(),l.md.start().update(i)}l.signature=l.key.sign(l.md,"RSASSA-PKCS1-V1_5")}e.signerInfos=s(e.signers)}(function(){for(var t={},r=0;r<e.signers.length;++r){var n=e.signers[r];(i=n.digestAlgorithm)in t||(t[i]=p.md[p.pki.oids[i]].create()),0===n.authenticatedAttributes.length?n.md=t[i]:n.md=p.md[p.pki.oids[i]].create()}for(var i in e.digestAlgorithmIdentifiers=[],t)e.digestAlgorithmIdentifiers.push(h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[h.create(h.Class.UNIVERSAL,h.Type.OID,!1,h.oidToDer(i).getBytes()),h.create(h.Class.UNIVERSAL,h.Type.NULL,!1,"")]));return t}())},verify:function(){throw new Error("PKCS#7 signature verification not yet implemented.")},addCertificate:function(t){"string"==typeof t&&(t=p.pki.certificateFromPem(t)),e.certificates.push(t)},addCertificateRevokationList:function(e){throw new Error("PKCS#7 CRL support not yet implemented.")}}},d.createEncryptedData=function(){var e=null;return e={type:p.pki.oids.encryptedData,version:0,encryptedContent:{algorithm:p.pki.oids["aes256-CBC"]},fromAsn1:function(t){l(e,t,d.asn1.encryptedDataValidator)},decrypt:function(t){void 0!==t&&(e.encryptedContent.key=t),f(e)}}},d.createEnvelopedData=function(){var e=null;return e={type:p.pki.oids.envelopedData,version:0,recipients:[],encryptedContent:{algorithm:p.pki.oids["aes256-CBC"]},fromAsn1:function(t){var r=l(e,t,d.asn1.envelopedDataValidator);e.recipients=function(e){for(var t=[],r=0;r<e.length;++r)t.push(n(e[r]));return t}(r.recipientInfos.value)},toAsn1:function(){return h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[h.create(h.Class.UNIVERSAL,h.Type.OID,!1,h.oidToDer(e.type).getBytes()),h.create(h.Class.CONTEXT_SPECIFIC,0,!0,[h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[h.create(h.Class.UNIVERSAL,h.Type.INTEGER,!1,h.integerToDer(e.version).getBytes()),h.create(h.Class.UNIVERSAL,h.Type.SET,!0,a(e.recipients)),h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,c(e.encryptedContent))])])])},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 o=!0,s=0;s<r.length;++s)if(a[s].type!==r[s].type||a[s].value!==r[s].value){o=!1;break}if(o)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 p.pki.oids.rsaEncryption:case p.pki.oids.desCBC:var n=r.decrypt(t.encryptedContent.content);e.encryptedContent.key=p.util.createBuffer(n);break;default:throw new Error("Unsupported asymmetric cipher, OID "+t.encryptedContent.algorithm)}f(e)},addRecipient:function(t){e.recipients.push({version:0,issuer:t.issuer.attributes,serialNumber:t.serialNumber,encryptedContent:{algorithm:p.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 p.pki.oids["aes128-CBC"]:n=16,i=16,a=p.aes.createEncryptionCipher;break;case p.pki.oids["aes192-CBC"]:n=24,i=16,a=p.aes.createEncryptionCipher;break;case p.pki.oids["aes256-CBC"]:n=32,i=16,a=p.aes.createEncryptionCipher;break;case p.pki.oids["des-EDE3-CBC"]:n=24,i=8,a=p.des.createEncryptionCipher;break;default:throw new Error("Unsupported symmetric cipher, OID "+r)}if(void 0===t)t=p.util.createBuffer(p.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=p.util.createBuffer(p.random.getBytes(i));var o=a(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)switch(u.encryptedContent.algorithm){case p.pki.oids.rsaEncryption:u.encryptedContent.content=u.encryptedContent.key.encrypt(e.encryptedContent.key.data);break;default:throw new Error("Unsupported asymmetric cipher, OID "+u.encryptedContent.algorithm)}}}}}},function(e,t,r){function n(e,t){var r=t.toString(16);r[0]>="8"&&(r="00"+r);var n=o.util.hexToBytes(r);e.putInt32(n.length),e.putBytes(n)}function i(e,t){e.putInt32(t.length),e.putString(t)}function a(){for(var e=o.md.sha1.create(),t=arguments.length,r=0;r<t;++r)e.update(arguments[r]);return e.digest()}var o=r(0);r(5),r(8),r(14),r(9),r(1);var s=e.exports=o.ssh=o.ssh||{};s.privateKeyToPutty=function(e,t,r){var s=""===(t=t||"")?"none":"aes256-cbc",u="PuTTY-User-Key-File-2: ssh-rsa\r\n";u+="Encryption: "+s+"\r\n",u+="Comment: "+(r=r||"")+"\r\n";var c=o.util.createBuffer();i(c,"ssh-rsa"),n(c,e.e),n(c,e.n);var l=o.util.encode64(c.bytes(),64),f=Math.floor(l.length/66)+1;u+="Public-Lines: "+f+"\r\n",u+=l;var p,h=o.util.createBuffer();if(n(h,e.d),n(h,e.p),n(h,e.q),n(h,e.qInv),t){var d=h.length()+16-1;d-=d%16;var g=a(h.bytes());g.truncate(g.length()-d+h.length()),h.putBuffer(g);var y=o.util.createBuffer();y.putBuffer(a("\0\0\0\0",t)),y.putBuffer(a("\0\0\0",t));var v=o.aes.createEncryptionCipher(y.truncate(8),"CBC");v.start(o.util.createBuffer().fillWithByte(0,16)),v.update(h.copy()),v.finish();var m=v.output;m.truncate(16),p=o.util.encode64(m.bytes(),64)}else p=o.util.encode64(h.bytes(),64);u+="\r\nPrivate-Lines: "+(f=Math.floor(p.length/66)+1)+"\r\n",u+=p;var C=a("putty-private-key-file-mac-key",t),E=o.util.createBuffer();i(E,"ssh-rsa"),i(E,s),i(E,r),E.putInt32(c.length()),E.putBuffer(c),E.putInt32(h.length()),E.putBuffer(h);var b=o.hmac.create();return b.start("sha1",C),b.update(E.bytes()),u+"\r\nPrivate-MAC: "+b.digest().toHex()+"\r\n"},s.publicKeyToOpenSSH=function(e,t){t=t||"";var r=o.util.createBuffer();return i(r,"ssh-rsa"),n(r,e.e),n(r,e.n),"ssh-rsa "+o.util.encode64(r.bytes())+" "+t},s.privateKeyToOpenSSH=function(e,t){return t?o.pki.encryptRsaPrivateKey(e,t,{legacy:!0,algorithm:"aes128"}):o.pki.privateKeyToPem(e)},s.getPublicKeyFingerprint=function(e,t){var r=(t=t||{}).md||o.md.md5.create(),a=o.util.createBuffer();i(a,"ssh-rsa"),n(a,e.e),n(a,e.n),r.start(),r.update(a.getBytes());var s=r.digest();if("hex"===t.encoding){var u=s.toHex();return t.delimiter?u.match(/.{2}/g).join(t.delimiter):u}if("binary"===t.encoding)return s.getBytes();if(t.encoding)throw new Error('Unknown encoding "'+t.encoding+'".');return s}},function(e,t,r){var n=r(0);r(31),r(33),r(1);var i="forge.task",a={},o=0;n.debug.set(i,"tasks",a);var s={};n.debug.set(i,"queues",s);var u="ready",c="running",l="blocked",f="sleeping",p="done",h="error",d="stop",g="start",y={ready:{}};y[u][d]=u,y[u][g]=c,y[u].cancel=p,y[u].fail=h,y[c]={},y[c][d]=u,y[c][g]=c,y[c].block=l,y[c].unblock=c,y[c].sleep=f,y[c].wakeup=c,y[c].cancel=p,y[c].fail=h,y[l]={},y[l][d]=l,y[l][g]=l,y[l].block=l,y[l].unblock=l,y[l].sleep=l,y[l].wakeup=l,y[l].cancel=p,y[l].fail=h,y[f]={},y[f][d]=f,y[f][g]=f,y[f].block=f,y[f].unblock=f,y[f].sleep=f,y[f].wakeup=f,y[f].cancel=p,y[f].fail=h,y[p]={},y[p][d]=p,y[p][g]=p,y[p].block=p,y[p].unblock=p,y[p].sleep=p,y[p].wakeup=p,y[p].cancel=p,y[p].fail=h,y[h]={},y[h][d]=h,y[h][g]=h,y[h].block=h,y[h].unblock=h,y[h].sleep=h,y[h].wakeup=h,y[h].cancel=h,y[h].fail=h;var v=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=u,this.blocks=0,this.timeoutId=null,this.swapTime=null,this.userData=null,this.id=o++,a[this.id]=this};v.prototype.debug=function(e){e=e||"",n.log.debug(i,e,"[%s][%s] task:",this.id,this.name,this,"subtasks:",this.subtasks.length,"queue:",s)},v.prototype.next=function(e,t){"function"==typeof e&&(t=e,e=this.name);var r=new v({run:t,name:e,parent:this});return r.state=c,r.type=this.type,r.successCallback=this.successCallback||null,r.failureCallback=this.failureCallback||null,this.subtasks.push(r),this},v.prototype.parallel=function(e,t){return n.util.isArray(e)&&(t=e,e=this.name),this.next(e,(function(r){var i=r;i.block(t.length);for(var a=0;a<t.length;a++)!function(e,r){n.task.start({type:e,run:function(e){t[r](e)},success:function(e){i.unblock()},failure:function(e){i.unblock()}})}(e+"__parallel-"+r.id+"-"+a,a)}))},v.prototype.stop=function(){this.state=y[this.state][d]},v.prototype.start=function(){this.error=!1,this.state=y[this.state][g],this.state===c&&(this.start=new Date,this.run(this),m(this,0))},v.prototype.block=function(e){e=void 0===e?1:e,this.blocks+=e,this.blocks>0&&(this.state=y[this.state].block)},v.prototype.unblock=function(e){return e=void 0===e?1:e,this.blocks-=e,0===this.blocks&&this.state!==p&&(this.state=c,m(this,0)),this.blocks},v.prototype.sleep=function(e){e=void 0===e?0:e,this.state=y[this.state].sleep;var t=this;this.timeoutId=setTimeout((function(){t.timeoutId=null,t.state=c,m(t,0)}),e)},v.prototype.wait=function(e){e.wait(this)},v.prototype.wakeup=function(){this.state===f&&(cancelTimeout(this.timeoutId),this.timeoutId=null,this.state=c,m(this,0))},v.prototype.cancel=function(){this.state=y[this.state].cancel,this.permitsNeeded=0,null!==this.timeoutId&&(cancelTimeout(this.timeoutId),this.timeoutId=null),this.subtasks=[]},v.prototype.fail=function(e){if(this.error=!0,C(this,!0),e)e.error=this.error,e.swapTime=this.swapTime,e.userData=this.userData,m(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;C(t,!0)}this.failureCallback&&this.failureCallback(this)}};var m=function(e,t){var r=t>30||+new Date-e.swapTime>20,n=function(t){if(t++,e.state===c)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||m(n,t)}else C(e),e.error||null!==e.parent&&(e.parent.error=e.error,e.parent.swapTime=e.swapTime,e.parent.userData=e.userData,m(e.parent,t))};r?setTimeout(n,0):n(t)},C=function(e,t){e.state=p,delete a[e.id],null===e.parent&&(e.type in s?0===s[e.type].length?n.log.error(i,"[%s][%s] task queue empty [%s]",e.id,e.name,e.type):s[e.type][0]!==e?n.log.error(i,"[%s][%s] task not first in queue [%s]",e.id,e.name,e.type):(s[e.type].shift(),0===s[e.type].length?delete s[e.type]:s[e.type][0].start()):n.log.error(i,"[%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)))};e.exports=n.task=n.task||{},n.task.start=function(e){var t=new v({run:e.run,name:e.name||"?"});t.type=e.type,t.successCallback=e.success||null,t.failureCallback=e.failure||null,t.type in s?s[e.type].push(t):(s[t.type]=[t],function(e){e.error=!1,e.state=y[e.state][g],setTimeout((function(){e.state===c&&(e.swapTime=+new Date,e.run(e),m(e,0))}),0)}(t))},n.task.cancel=function(e){e in s&&(s[e]=[s[e][0]])},n.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}}])}).call(this,r(11).Buffer,r(25),r(234).setImmediate)},375:function(e,t,r){var n,i,a,o,s,u;e.exports=(u=r(52),i=(n=u).lib,a=i.Base,o=i.WordArray,(s=n.x64={}).Word=a.extend({init:function(e,t){this.high=e,this.low=t}}),s.WordArray=a.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:8*e.length},toX32:function(){for(var e=this.words,t=e.length,r=[],n=0;n<t;n++){var i=e[n];r.push(i.high),r.push(i.low)}return o.create(r,this.sigBytes)},clone:function(){for(var e=a.clone.call(this),t=e.words=this.words.slice(0),r=t.length,n=0;n<r;n++)t[n]=t[n].clone();return e}}),u)},38:function(e,t){function r(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?e.exports=r=function(e){return typeof e}:e.exports=r=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(t)}e.exports=r},39:function(e,t){function r(t,n){return e.exports=r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},r(t,n)}e.exports=r},4:function(e,t,r){var n=r(38),i=r(22);e.exports=function(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?i(e):t}},40:function(e,t,r){"use strict";t.byteLength=function(e){var t=c(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){for(var t,r=c(e),n=r[0],o=r[1],s=new a(function(e,t,r){return 3*(t+r)/4-r}(0,n,o)),u=0,l=o>0?n-4:n,f=0;f<l;f+=4)t=i[e.charCodeAt(f)]<<18|i[e.charCodeAt(f+1)]<<12|i[e.charCodeAt(f+2)]<<6|i[e.charCodeAt(f+3)],s[u++]=t>>16&255,s[u++]=t>>8&255,s[u++]=255&t;2===o&&(t=i[e.charCodeAt(f)]<<2|i[e.charCodeAt(f+1)]>>4,s[u++]=255&t);1===o&&(t=i[e.charCodeAt(f)]<<10|i[e.charCodeAt(f+1)]<<4|i[e.charCodeAt(f+2)]>>2,s[u++]=t>>8&255,s[u++]=255&t);return s},t.fromByteArray=function(e){for(var t,r=e.length,i=r%3,a=[],o=0,s=r-i;o<s;o+=16383)a.push(l(e,o,o+16383>s?s:o+16383));1===i?(t=e[r-1],a.push(n[t>>2]+n[t<<4&63]+"==")):2===i&&(t=(e[r-2]<<8)+e[r-1],a.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"="));return a.join("")};for(var n=[],i=[],a="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,u=o.length;s<u;++s)n[s]=o[s],i[o.charCodeAt(s)]=s;function c(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function l(e,t,r){for(var i,a,o=[],s=t;s<r;s+=3)i=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),o.push(n[(a=i)>>18&63]+n[a>>12&63]+n[a>>6&63]+n[63&a]);return o.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},41:function(e,t){t.read=function(e,t,r,n,i){var a,o,s=8*i-n-1,u=(1<<s)-1,c=u>>1,l=-7,f=r?i-1:0,p=r?-1:1,h=e[t+f];for(f+=p,a=h&(1<<-l)-1,h>>=-l,l+=s;l>0;a=256*a+e[t+f],f+=p,l-=8);for(o=a&(1<<-l)-1,a>>=-l,l+=n;l>0;o=256*o+e[t+f],f+=p,l-=8);if(0===a)a=1-c;else{if(a===u)return o?NaN:1/0*(h?-1:1);o+=Math.pow(2,n),a-=c}return(h?-1:1)*o*Math.pow(2,a-n)},t.write=function(e,t,r,n,i,a){var o,s,u,c=8*a-i-1,l=(1<<c)-1,f=l>>1,p=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:a-1,d=n?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=l):(o=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-o))<1&&(o--,u*=2),(t+=o+f>=1?p/u:p*Math.pow(2,1-f))*u>=2&&(o++,u/=2),o+f>=l?(s=0,o=l):o+f>=1?(s=(t*u-1)*Math.pow(2,i),o+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,i),o=0));i>=8;e[r+h]=255&s,h+=d,s/=256,i-=8);for(o=o<<i|s,c+=i;c>0;e[r+h]=255&o,h+=d,o/=256,c-=8);e[r+h-d]|=128*g}},42:function(e,t){var r={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==r.call(e)}},43:function(e,t,r){var n=function(e){"use strict";var t,r=Object.prototype,n=r.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",o=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function u(e,t,r,n){var i=t&&t.prototype instanceof g?t:g,a=Object.create(i.prototype),o=new I(n||[]);return a._invoke=function(e,t,r){var n=l;return function(i,a){if(n===p)throw new Error("Generator is already running");if(n===h){if("throw"===i)throw a;return _()}for(r.method=i,r.arg=a;;){var o=r.delegate;if(o){var s=A(o,r);if(s){if(s===d)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===l)throw n=h,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=p;var u=c(e,t,r);if("normal"===u.type){if(n=r.done?h:f,u.arg===d)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n=h,r.method="throw",r.arg=u.arg)}}}(e,r,o),a}function c(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var l="suspendedStart",f="suspendedYield",p="executing",h="completed",d={};function g(){}function y(){}function v(){}var m={};m[a]=function(){return this};var C=Object.getPrototypeOf,E=C&&C(C(k([])));E&&E!==r&&n.call(E,a)&&(m=E);var b=v.prototype=g.prototype=Object.create(m);function S(e){["next","throw","return"].forEach((function(t){e[t]=function(e){return this._invoke(t,e)}}))}function B(e){var t;this._invoke=function(r,i){function a(){return new Promise((function(t,a){!function t(r,i,a,o){var s=c(e[r],e,i);if("throw"!==s.type){var u=s.arg,l=u.value;return l&&"object"==typeof l&&n.call(l,"__await")?Promise.resolve(l.__await).then((function(e){t("next",e,a,o)}),(function(e){t("throw",e,a,o)})):Promise.resolve(l).then((function(e){u.value=e,a(u)}),(function(e){return t("throw",e,a,o)}))}o(s.arg)}(r,i,t,a)}))}return t=t?t.then(a,a):a()}}function A(e,r){var n=e.iterator[r.method];if(n===t){if(r.delegate=null,"throw"===r.method){if(e.iterator.return&&(r.method="return",r.arg=t,A(e,r),"throw"===r.method))return d;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return d}var i=c(n,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,d;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,d):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,d)}function T(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function w(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(T,this),this.reset(!0)}function k(e){if(e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function r(){for(;++i<e.length;)if(n.call(e,i))return r.value=e[i],r.done=!1,r;return r.value=t,r.done=!0,r};return o.next=o}}return{next:_}}function _(){return{value:t,done:!0}}return y.prototype=b.constructor=v,v.constructor=y,v[s]=y.displayName="GeneratorFunction",e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===y||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,v):(e.__proto__=v,s in e||(e[s]="GeneratorFunction")),e.prototype=Object.create(b),e},e.awrap=function(e){return{__await:e}},S(B.prototype),B.prototype[o]=function(){return this},e.AsyncIterator=B,e.async=function(t,r,n,i){var a=new B(u(t,r,n,i));return e.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},S(b),b[s]="Generator",b[a]=function(){return this},b.toString=function(){return"[object Generator]"},e.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},e.values=k,I.prototype={constructor:I,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(w),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function i(n,i){return s.type="throw",s.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var u=n.call(o,"catchLoc"),c=n.call(o,"finallyLoc");if(u&&c){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(u){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=e,o.arg=t,a?(this.method="next",this.next=a.finallyLoc,d):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),w(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;w(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:k(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),d}},e}(e.exports);try{regeneratorRuntime=n}catch(e){Function("r","regeneratorRuntime = r")(n)}},439:function(e,t,r){var n,i,a,o,s,u,c,l;e.exports=(l=r(52),i=(n=l).lib,a=i.WordArray,o=i.Hasher,s=n.algo,u=[],c=s.SHA1=o.extend({_doReset:function(){this._hash=new a.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],i=r[1],a=r[2],o=r[3],s=r[4],c=0;c<80;c++){if(c<16)u[c]=0|e[t+c];else{var l=u[c-3]^u[c-8]^u[c-14]^u[c-16];u[c]=l<<1|l>>>31}var f=(n<<5|n>>>27)+s+u[c];f+=c<20?1518500249+(i&a|~i&o):c<40?1859775393+(i^a^o):c<60?(i&a|i&o|a&o)-1894007588:(i^a^o)-899497514,s=o,o=a,a=i<<30|i>>>2,i=n,n=f}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+a|0,r[3]=r[3]+o|0,r[4]=r[4]+s|0},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[14+(n+64>>>9<<4)]=Math.floor(r/4294967296),t[15+(n+64>>>9<<4)]=r,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}}),n.SHA1=o._createHelper(c),n.HmacSHA1=o._createHmacHelper(c),l.SHA1)},44:function(e,t){e.exports=function(e){if(Array.isArray(e))return e}},440:function(e,t,r){var n,i,a,o;e.exports=(n=r(52),a=(i=n).lib.Base,o=i.enc.Utf8,void(i.algo.HMAC=a.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=o.parse(t));var r=e.blockSize,n=4*r;t.sigBytes>n&&(t=e.finalize(t)),t.clamp();for(var i=this._oKey=t.clone(),a=this._iKey=t.clone(),s=i.words,u=a.words,c=0;c<r;c++)s[c]^=1549556828,u[c]^=909522486;i.sigBytes=a.sigBytes=n,this.reset()},reset:function(){var e=this._hasher;e.reset(),e.update(this._iKey)},update:function(e){return this._hasher.update(e),this},finalize:function(e){var t=this._hasher,r=t.finalize(e);return t.reset(),t.finalize(this._oKey.clone().concat(r))}})))},45:function(e,t){e.exports=function(e,t){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)){var r=[],n=!0,i=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(n=(o=s.next()).done)&&(r.push(o.value),!t||r.length!==t);n=!0);}catch(e){i=!0,a=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw a}}return r}}},46:function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}},5:function(e,t,r){var n=r(39);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&n(e,t)}},52:function(e,t,r){var n;e.exports=(n=n||function(e,t){var r=Object.create||function(){function e(){}return function(t){var r;return e.prototype=t,r=new e,e.prototype=null,r}}(),n={},i=n.lib={},a=i.Base={extend:function(e){var t=r(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},o=i.WordArray=a.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||u).stringify(this)},concat:function(e){var t=this.words,r=e.words,n=this.sigBytes,i=e.sigBytes;if(this.clamp(),n%4)for(var a=0;a<i;a++){var o=r[a>>>2]>>>24-a%4*8&255;t[n+a>>>2]|=o<<24-(n+a)%4*8}else for(a=0;a<i;a+=4)t[n+a>>>2]=r[a>>>2];return this.sigBytes+=i,this},clamp:function(){var t=this.words,r=this.sigBytes;t[r>>>2]&=4294967295<<32-r%4*8,t.length=e.ceil(r/4)},clone:function(){var e=a.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var r,n=[],i=function(t){t=t;var r=987654321,n=4294967295;return function(){var i=((r=36969*(65535&r)+(r>>16)&n)<<16)+(t=18e3*(65535&t)+(t>>16)&n)&n;return i/=4294967296,(i+=.5)*(e.random()>.5?1:-1)}},a=0;a<t;a+=4){var s=i(4294967296*(r||e.random()));r=987654071*s(),n.push(4294967296*s()|0)}return new o.init(n,t)}}),s=n.enc={},u=s.Hex={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i<r;i++){var a=t[i>>>2]>>>24-i%4*8&255;n.push((a>>>4).toString(16)),n.push((15&a).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n<t;n+=2)r[n>>>3]|=parseInt(e.substr(n,2),16)<<24-n%8*4;return new o.init(r,t/2)}},c=s.Latin1={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i<r;i++){var a=t[i>>>2]>>>24-i%4*8&255;n.push(String.fromCharCode(a))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n<t;n++)r[n>>>2]|=(255&e.charCodeAt(n))<<24-n%4*8;return new o.init(r,t)}},l=s.Utf8={stringify:function(e){try{return decodeURIComponent(escape(c.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return c.parse(unescape(encodeURIComponent(e)))}},f=i.BufferedBlockAlgorithm=a.extend({reset:function(){this._data=new o.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=l.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var r=this._data,n=r.words,i=r.sigBytes,a=this.blockSize,s=i/(4*a),u=(s=t?e.ceil(s):e.max((0|s)-this._minBufferSize,0))*a,c=e.min(4*u,i);if(u){for(var l=0;l<u;l+=a)this._doProcessBlock(n,l);var f=n.splice(0,u);r.sigBytes-=c}return new o.init(f,c)},clone:function(){var e=a.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0}),p=(i.Hasher=f.extend({cfg:a.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){f.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,r){return new e.init(r).finalize(t)}},_createHmacHelper:function(e){return function(t,r){return new p.HMAC.init(e,r).finalize(t)}}}),n.algo={});return n}(Math),n)},6:function(e,t,r){e.exports=r(43)},663:function(e,t,r){var n;e.exports=(n=r(52),function(e){var t=n,r=t.lib,i=r.WordArray,a=r.Hasher,o=t.algo,s=[],u=[];!function(){function t(t){for(var r=e.sqrt(t),n=2;n<=r;n++)if(!(t%n))return!1;return!0}function r(e){return 4294967296*(e-(0|e))|0}for(var n=2,i=0;i<64;)t(n)&&(i<8&&(s[i]=r(e.pow(n,.5))),u[i]=r(e.pow(n,1/3)),i++),n++}();var c=[],l=o.SHA256=a.extend({_doReset:function(){this._hash=new i.init(s.slice(0))},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],i=r[1],a=r[2],o=r[3],s=r[4],l=r[5],f=r[6],p=r[7],h=0;h<64;h++){if(h<16)c[h]=0|e[t+h];else{var d=c[h-15],g=(d<<25|d>>>7)^(d<<14|d>>>18)^d>>>3,y=c[h-2],v=(y<<15|y>>>17)^(y<<13|y>>>19)^y>>>10;c[h]=g+c[h-7]+v+c[h-16]}var m=n&i^n&a^i&a,C=(n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22),E=p+((s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25))+(s&l^~s&f)+u[h]+c[h];p=f,f=l,l=s,s=o+E|0,o=a,a=i,i=n,n=E+(C+m)|0}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+a|0,r[3]=r[3]+o|0,r[4]=r[4]+s|0,r[5]=r[5]+l|0,r[6]=r[6]+f|0,r[7]=r[7]+p|0},_doFinalize:function(){var t=this._data,r=t.words,n=8*this._nDataBytes,i=8*t.sigBytes;return r[i>>>5]|=128<<24-i%32,r[14+(i+64>>>9<<4)]=e.floor(n/4294967296),r[15+(i+64>>>9<<4)]=n,t.sigBytes=4*r.length,this._process(),this._hash},clone:function(){var e=a.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA256=a._createHelper(l),t.HmacSHA256=a._createHmacHelper(l)}(Math),n.SHA256)},664:function(e,t,r){var n;e.exports=(n=r(52),r(375),function(){var e=n,t=e.lib.Hasher,r=e.x64,i=r.Word,a=r.WordArray,o=e.algo;function s(){return i.create.apply(i,arguments)}var u=[s(1116352408,3609767458),s(1899447441,602891725),s(3049323471,3964484399),s(3921009573,2173295548),s(961987163,4081628472),s(1508970993,3053834265),s(2453635748,2937671579),s(2870763221,3664609560),s(3624381080,2734883394),s(310598401,1164996542),s(607225278,1323610764),s(1426881987,3590304994),s(1925078388,4068182383),s(2162078206,991336113),s(2614888103,633803317),s(3248222580,3479774868),s(3835390401,2666613458),s(4022224774,944711139),s(264347078,2341262773),s(604807628,2007800933),s(770255983,1495990901),s(1249150122,1856431235),s(1555081692,3175218132),s(1996064986,2198950837),s(2554220882,3999719339),s(2821834349,766784016),s(2952996808,2566594879),s(3210313671,3203337956),s(3336571891,1034457026),s(3584528711,2466948901),s(113926993,3758326383),s(338241895,168717936),s(666307205,1188179964),s(773529912,1546045734),s(1294757372,1522805485),s(1396182291,2643833823),s(1695183700,2343527390),s(1986661051,1014477480),s(2177026350,1206759142),s(2456956037,344077627),s(2730485921,1290863460),s(2820302411,3158454273),s(3259730800,3505952657),s(3345764771,106217008),s(3516065817,3606008344),s(3600352804,1432725776),s(4094571909,1467031594),s(275423344,851169720),s(430227734,3100823752),s(506948616,1363258195),s(659060556,3750685593),s(883997877,3785050280),s(958139571,3318307427),s(1322822218,3812723403),s(1537002063,2003034995),s(1747873779,3602036899),s(1955562222,1575990012),s(2024104815,1125592928),s(2227730452,2716904306),s(2361852424,442776044),s(2428436474,593698344),s(2756734187,3733110249),s(3204031479,2999351573),s(3329325298,3815920427),s(3391569614,3928383900),s(3515267271,566280711),s(3940187606,3454069534),s(4118630271,4000239992),s(116418474,1914138554),s(174292421,2731055270),s(289380356,3203993006),s(460393269,320620315),s(685471733,587496836),s(852142971,1086792851),s(1017036298,365543100),s(1126000580,2618297676),s(1288033470,3409855158),s(1501505948,4234509866),s(1607167915,987167468),s(1816402316,1246189591)],c=[];!function(){for(var e=0;e<80;e++)c[e]=s()}();var l=o.SHA512=t.extend({_doReset:function(){this._hash=new a.init([new i.init(1779033703,4089235720),new i.init(3144134277,2227873595),new i.init(1013904242,4271175723),new i.init(2773480762,1595750129),new i.init(1359893119,2917565137),new i.init(2600822924,725511199),new i.init(528734635,4215389547),new i.init(1541459225,327033209)])},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],i=r[1],a=r[2],o=r[3],s=r[4],l=r[5],f=r[6],p=r[7],h=n.high,d=n.low,g=i.high,y=i.low,v=a.high,m=a.low,C=o.high,E=o.low,b=s.high,S=s.low,B=l.high,A=l.low,T=f.high,w=f.low,I=p.high,k=p.low,_=h,R=d,x=g,N=y,L=v,D=m,U=C,F=E,P=b,O=S,V=B,M=A,K=T,H=w,j=I,z=k,G=0;G<80;G++){var q=c[G];if(G<16)var Y=q.high=0|e[t+2*G],Q=q.low=0|e[t+2*G+1];else{var W=c[G-15],X=W.high,$=W.low,Z=(X>>>1|$<<31)^(X>>>8|$<<24)^X>>>7,J=($>>>1|X<<31)^($>>>8|X<<24)^($>>>7|X<<25),ee=c[G-2],te=ee.high,re=ee.low,ne=(te>>>19|re<<13)^(te<<3|re>>>29)^te>>>6,ie=(re>>>19|te<<13)^(re<<3|te>>>29)^(re>>>6|te<<26),ae=c[G-7],oe=ae.high,se=ae.low,ue=c[G-16],ce=ue.high,le=ue.low;Y=(Y=(Y=Z+oe+((Q=J+se)>>>0<J>>>0?1:0))+ne+((Q+=ie)>>>0<ie>>>0?1:0))+ce+((Q+=le)>>>0<le>>>0?1:0),q.high=Y,q.low=Q}var fe,pe=P&V^~P&K,he=O&M^~O&H,de=_&x^_&L^x&L,ge=R&N^R&D^N&D,ye=(_>>>28|R<<4)^(_<<30|R>>>2)^(_<<25|R>>>7),ve=(R>>>28|_<<4)^(R<<30|_>>>2)^(R<<25|_>>>7),me=(P>>>14|O<<18)^(P>>>18|O<<14)^(P<<23|O>>>9),Ce=(O>>>14|P<<18)^(O>>>18|P<<14)^(O<<23|P>>>9),Ee=u[G],be=Ee.high,Se=Ee.low,Be=j+me+((fe=z+Ce)>>>0<z>>>0?1:0),Ae=ve+ge;j=K,z=H,K=V,H=M,V=P,M=O,P=U+(Be=(Be=(Be=Be+pe+((fe+=he)>>>0<he>>>0?1:0))+be+((fe+=Se)>>>0<Se>>>0?1:0))+Y+((fe+=Q)>>>0<Q>>>0?1:0))+((O=F+fe|0)>>>0<F>>>0?1:0)|0,U=L,F=D,L=x,D=N,x=_,N=R,_=Be+(ye+de+(Ae>>>0<ve>>>0?1:0))+((R=fe+Ae|0)>>>0<fe>>>0?1:0)|0}d=n.low=d+R,n.high=h+_+(d>>>0<R>>>0?1:0),y=i.low=y+N,i.high=g+x+(y>>>0<N>>>0?1:0),m=a.low=m+D,a.high=v+L+(m>>>0<D>>>0?1:0),E=o.low=E+F,o.high=C+U+(E>>>0<F>>>0?1:0),S=s.low=S+O,s.high=b+P+(S>>>0<O>>>0?1:0),A=l.low=A+M,l.high=B+V+(A>>>0<M>>>0?1:0),w=f.low=w+H,f.high=T+K+(w>>>0<H>>>0?1:0),k=p.low=k+z,p.high=I+j+(k>>>0<z>>>0?1:0)},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[30+(n+128>>>10<<5)]=Math.floor(r/4294967296),t[31+(n+128>>>10<<5)]=r,e.sigBytes=4*t.length,this._process(),this._hash.toX32()},clone:function(){var e=t.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:32});e.SHA512=t._createHelper(l),e.HmacSHA512=t._createHmacHelper(l)}(),n.SHA512)},7:function(e,t,r){"use strict";r.d(t,"a",(function(){return s}));var n=r(1),i=r.n(n),a=r(2),o=r.n(a),s=function(){function e(t){i()(this,e),this.bytes=t,this.length=this.bytes.length,this.position=0,this.bitPos=0}return o()(e,[{key:"getBytes",value:function(e){if(!(this.position>this.length)){var t=this.position+e,r=this.bytes.slice(this.position,t);return this.position=t,this.bitPos=0,r}}},{key:"readString",value:function(e){if(!(this.position>this.length)){for(var t="",r=this.position;r<this.position+e;r++){var n=this.bytes[r];if(0===n)break;t+=String.fromCharCode(n)}return this.position+=e,this.bitPos=0,t}}},{key:"readInt",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"be";if(!(this.position>this.length)){var r=0;if("be"===t)for(var n=this.position;n<this.position+e;n++)r<<=8,r|=this.bytes[n];else for(var i=this.position+e-1;i>=this.position;i--)r<<=8,r|=this.bytes[i];return this.position+=e,this.bitPos=0,r}}},{key:"readBits",value:function(e){if(!(this.position>this.length)){var t=0,r=0;for(t=(this.bytes[this.position++]&256-(1<<this.bitPos))>>>this.bitPos,r=8-this.bitPos,this.bitPos=0;r<e;)t|=this.bytes[this.position++]<<r,r+=8;if(r>e){var n=r-e;t&=(1<<e)-1,r-=n,this.position--,this.bitPos=8-n}return t}}},{key:"continueUntil",value:function(e){if(!(this.position>this.length))if(this.bitPos=0,"number"!=typeof e){var t=e.length,r=e[t-1];this.position=t;for(var n=function(e,t){var r=new Array;return e.forEach((function(e,n){r[e]=t-n})),r}(e,t),i=!0;this.position<this.length;){for(;this.position<this.length&&this.bytes[this.position++]!==r;);i=!0;for(var a=t-1;a>=0;a--)if(this.bytes[this.position-t+a]!==e[a]){i=!1,this.position+=n[e[a]];break}if(i){this.position-=t;break}}}else for(;++this.position<this.length&&this.bytes[this.position]!==e;);}},{key:"consumeWhile",value:function(e){for(;this.position<this.length&&this.bytes[this.position]===e;)this.position++;this.bitPos=0}},{key:"consumeIf",value:function(e){this.bytes[this.position]===e&&(this.position++,this.bitPos=0)}},{key:"moveForwardsBy",value:function(e){var t=this.position+e;if(t<0||t>this.length)throw new Error("Cannot move to position "+t+" in stream. Out of bounds.");this.position=t,this.bitPos=0}},{key:"moveBackwardsBy",value:function(e){var t=this.position-e;if(t<0||t>this.length)throw new Error("Cannot move to position "+t+" in stream. Out of bounds.");this.position=t,this.bitPos=0}},{key:"moveBackwardsByBits",value:function(e){if(e<=this.bitPos)this.bitPos-=e;else for(this.bitPos>0&&(e-=this.bitPos,this.bitPos=0);e>0;)this.moveBackwardsBy(1),this.bitPos=8,this.moveBackwardsByBits(e),e-=8}},{key:"moveTo",value:function(e){if(e<0||e>this.length)throw new Error("Cannot move to position "+e+" in stream. Out of bounds.");this.position=e,this.bitPos=0}},{key:"hasMore",value:function(){return this.position<this.length}},{key:"carve",value:function(){return this.bitPos>0&&this.position++,this.bytes.slice(0,this.position)}}]),e}()},71:function(e,t,r){var n;e.exports=(n=r(52),r(375),r(855),r(856),r(235),r(236),r(439),r(663),r(857),r(664),r(858),r(859),r(860),r(440),r(861),r(216),r(84),r(862),r(863),r(864),r(865),r(866),r(867),r(868),r(869),r(870),r(871),r(872),r(873),r(874),r(875),r(876),r(877),n)},8:function(e,t,r){"use strict";var n=r(1),i=r.n(n),a=r(4),o=r.n(a),s=r(3),u=r.n(s),c=r(22),l=r.n(c),f=r(5),p=r.n(f);
/**
 * Custom error type for handling operation input errors.
 * i.e. where the operation can handle the error and print a message to the screen.
 *
 * @author d98762625 [d98762625@gmail.com]
 * @copyright Crown Copyright 2018
 * @license Apache-2.0
 */
var h=function(e){function t(){var e;i()(this,t);for(var r=arguments.length,n=new Array(r),a=0;a<r;a++)n[a]=arguments[a];return(e=o()(this,u()(t).call(this,...n))).type="OperationError",Error.captureStackTrace&&Error.captureStackTrace(l()(e),t),e}return p()(t,e),t}(function(e){function t(){var t=Reflect.construct(e,Array.from(arguments));return Object.setPrototypeOf(t,Object.getPrototypeOf(this)),t}return t.prototype=Object.create(e.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e,t}(Error));t.a=h},84:function(e,t,r){var n;e.exports=(n=r(52),r(216),void(n.lib.Cipher||function(e){var t=n,r=t.lib,i=r.Base,a=r.WordArray,o=r.BufferedBlockAlgorithm,s=t.enc,u=(s.Utf8,s.Base64),c=t.algo.EvpKDF,l=r.Cipher=o.extend({cfg:i.extend(),createEncryptor:function(e,t){return this.create(this._ENC_XFORM_MODE,e,t)},createDecryptor:function(e,t){return this.create(this._DEC_XFORM_MODE,e,t)},init:function(e,t,r){this.cfg=this.cfg.extend(r),this._xformMode=e,this._key=t,this.reset()},reset:function(){o.reset.call(this),this._doReset()},process:function(e){return this._append(e),this._process()},finalize:function(e){return e&&this._append(e),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function e(e){return"string"==typeof e?C:v}return function(t){return{encrypt:function(r,n,i){return e(n).encrypt(t,r,n,i)},decrypt:function(r,n,i){return e(n).decrypt(t,r,n,i)}}}}()}),f=(r.StreamCipher=l.extend({_doFinalize:function(){return this._process(!0)},blockSize:1}),t.mode={}),p=r.BlockCipherMode=i.extend({createEncryptor:function(e,t){return this.Encryptor.create(e,t)},createDecryptor:function(e,t){return this.Decryptor.create(e,t)},init:function(e,t){this._cipher=e,this._iv=t}}),h=f.CBC=function(){var t=p.extend();function r(t,r,n){var i=this._iv;if(i){var a=i;this._iv=e}else a=this._prevBlock;for(var o=0;o<n;o++)t[r+o]^=a[o]}return t.Encryptor=t.extend({processBlock:function(e,t){var n=this._cipher,i=n.blockSize;r.call(this,e,t,i),n.encryptBlock(e,t),this._prevBlock=e.slice(t,t+i)}}),t.Decryptor=t.extend({processBlock:function(e,t){var n=this._cipher,i=n.blockSize,a=e.slice(t,t+i);n.decryptBlock(e,t),r.call(this,e,t,i),this._prevBlock=a}}),t}(),d=(t.pad={}).Pkcs7={pad:function(e,t){for(var r=4*t,n=r-e.sigBytes%r,i=n<<24|n<<16|n<<8|n,o=[],s=0;s<n;s+=4)o.push(i);var u=a.create(o,n);e.concat(u)},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},g=(r.BlockCipher=l.extend({cfg:l.cfg.extend({mode:h,padding:d}),reset:function(){l.reset.call(this);var e=this.cfg,t=e.iv,r=e.mode;if(this._xformMode==this._ENC_XFORM_MODE)var n=r.createEncryptor;else n=r.createDecryptor,this._minBufferSize=1;this._mode&&this._mode.__creator==n?this._mode.init(this,t&&t.words):(this._mode=n.call(r,this,t&&t.words),this._mode.__creator=n)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){e.pad(this._data,this.blockSize);var t=this._process(!0)}else t=this._process(!0),e.unpad(t);return t},blockSize:4}),r.CipherParams=i.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}})),y=(t.format={}).OpenSSL={stringify:function(e){var t=e.ciphertext,r=e.salt;if(r)var n=a.create([1398893684,1701076831]).concat(r).concat(t);else n=t;return n.toString(u)},parse:function(e){var t=u.parse(e),r=t.words;if(1398893684==r[0]&&1701076831==r[1]){var n=a.create(r.slice(2,4));r.splice(0,4),t.sigBytes-=16}return g.create({ciphertext:t,salt:n})}},v=r.SerializableCipher=i.extend({cfg:i.extend({format:y}),encrypt:function(e,t,r,n){n=this.cfg.extend(n);var i=e.createEncryptor(r,n),a=i.finalize(t),o=i.cfg;return g.create({ciphertext:a,key:r,iv:o.iv,algorithm:e,mode:o.mode,padding:o.padding,blockSize:e.blockSize,formatter:n.format})},decrypt:function(e,t,r,n){return n=this.cfg.extend(n),t=this._parse(t,n.format),e.createDecryptor(r,n).finalize(t.ciphertext)},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}}),m=(t.kdf={}).OpenSSL={execute:function(e,t,r,n){n||(n=a.random(8));var i=c.create({keySize:t+r}).compute(e,n),o=a.create(i.words.slice(t),4*r);return i.sigBytes=4*t,g.create({key:i,iv:o,salt:n})}},C=r.PasswordBasedCipher=v.extend({cfg:v.cfg.extend({kdf:m}),encrypt:function(e,t,r,n){var i=(n=this.cfg.extend(n)).kdf.execute(r,e.keySize,e.ivSize);n.iv=i.iv;var a=v.encrypt.call(this,e,t,i.key,n);return a.mixIn(i),a},decrypt:function(e,t,r,n){n=this.cfg.extend(n),t=this._parse(t,n.format);var i=n.kdf.execute(r,e.keySize,e.ivSize,t.salt);return n.iv=i.iv,v.decrypt.call(this,e,t,i.key,n)}})}()))},855:function(e,t,r){var n;e.exports=(n=r(52),function(){if("function"==typeof ArrayBuffer){var e=n.lib.WordArray,t=e.init;(e.init=function(e){if(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),(e instanceof Int8Array||"undefined"!=typeof Uint8ClampedArray&&e instanceof Uint8ClampedArray||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array)&&(e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength)),e instanceof Uint8Array){for(var r=e.byteLength,n=[],i=0;i<r;i++)n[i>>>2]|=e[i]<<24-i%4*8;t.call(this,n,r)}else t.apply(this,arguments)}).prototype=e}}(),n.lib.WordArray)},856:function(e,t,r){var n;e.exports=(n=r(52),function(){var e=n,t=e.lib.WordArray,r=e.enc;function i(e){return e<<8&4278255360|e>>>8&16711935}r.Utf16=r.Utf16BE={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i<r;i+=2){var a=t[i>>>2]>>>16-i%4*8&65535;n.push(String.fromCharCode(a))}return n.join("")},parse:function(e){for(var r=e.length,n=[],i=0;i<r;i++)n[i>>>1]|=e.charCodeAt(i)<<16-i%2*16;return t.create(n,2*r)}},r.Utf16LE={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],a=0;a<r;a+=2){var o=i(t[a>>>2]>>>16-a%4*8&65535);n.push(String.fromCharCode(o))}return n.join("")},parse:function(e){for(var r=e.length,n=[],a=0;a<r;a++)n[a>>>1]|=i(e.charCodeAt(a)<<16-a%2*16);return t.create(n,2*r)}}}(),n.enc.Utf16)},857:function(e,t,r){var n,i,a,o,s,u;e.exports=(u=r(52),r(663),i=(n=u).lib.WordArray,a=n.algo,o=a.SHA256,s=a.SHA224=o.extend({_doReset:function(){this._hash=new i.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var e=o._doFinalize.call(this);return e.sigBytes-=4,e}}),n.SHA224=o._createHelper(s),n.HmacSHA224=o._createHmacHelper(s),u.SHA224)},858:function(e,t,r){var n,i,a,o,s,u,c,l;e.exports=(l=r(52),r(375),r(664),i=(n=l).x64,a=i.Word,o=i.WordArray,s=n.algo,u=s.SHA512,c=s.SHA384=u.extend({_doReset:function(){this._hash=new o.init([new a.init(3418070365,3238371032),new a.init(1654270250,914150663),new a.init(2438529370,812702999),new a.init(355462360,4144912697),new a.init(1731405415,4290775857),new a.init(2394180231,1750603025),new a.init(3675008525,1694076839),new a.init(1203062813,3204075428)])},_doFinalize:function(){var e=u._doFinalize.call(this);return e.sigBytes-=16,e}}),n.SHA384=u._createHelper(c),n.HmacSHA384=u._createHmacHelper(c),l.SHA384)},859:function(e,t,r){var n;e.exports=(n=r(52),r(375),function(e){var t=n,r=t.lib,i=r.WordArray,a=r.Hasher,o=t.x64.Word,s=t.algo,u=[],c=[],l=[];!function(){for(var e=1,t=0,r=0;r<24;r++){u[e+5*t]=(r+1)*(r+2)/2%64;var n=(2*e+3*t)%5;e=t%5,t=n}for(e=0;e<5;e++)for(t=0;t<5;t++)c[e+5*t]=t+(2*e+3*t)%5*5;for(var i=1,a=0;a<24;a++){for(var s=0,f=0,p=0;p<7;p++){if(1&i){var h=(1<<p)-1;h<32?f^=1<<h:s^=1<<h-32}128&i?i=i<<1^113:i<<=1}l[a]=o.create(s,f)}}();var f=[];!function(){for(var e=0;e<25;e++)f[e]=o.create()}();var p=s.SHA3=a.extend({cfg:a.cfg.extend({outputLength:512}),_doReset:function(){for(var e=this._state=[],t=0;t<25;t++)e[t]=new o.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(e,t){for(var r=this._state,n=this.blockSize/2,i=0;i<n;i++){var a=e[t+2*i],o=e[t+2*i+1];a=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),o=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),(k=r[i]).high^=o,k.low^=a}for(var s=0;s<24;s++){for(var p=0;p<5;p++){for(var h=0,d=0,g=0;g<5;g++)h^=(k=r[p+5*g]).high,d^=k.low;var y=f[p];y.high=h,y.low=d}for(p=0;p<5;p++){var v=f[(p+4)%5],m=f[(p+1)%5],C=m.high,E=m.low;for(h=v.high^(C<<1|E>>>31),d=v.low^(E<<1|C>>>31),g=0;g<5;g++)(k=r[p+5*g]).high^=h,k.low^=d}for(var b=1;b<25;b++){var S=(k=r[b]).high,B=k.low,A=u[b];A<32?(h=S<<A|B>>>32-A,d=B<<A|S>>>32-A):(h=B<<A-32|S>>>64-A,d=S<<A-32|B>>>64-A);var T=f[c[b]];T.high=h,T.low=d}var w=f[0],I=r[0];for(w.high=I.high,w.low=I.low,p=0;p<5;p++)for(g=0;g<5;g++){var k=r[b=p+5*g],_=f[b],R=f[(p+1)%5+5*g],x=f[(p+2)%5+5*g];k.high=_.high^~R.high&x.high,k.low=_.low^~R.low&x.low}k=r[0];var N=l[s];k.high^=N.high,k.low^=N.low}},_doFinalize:function(){var t=this._data,r=t.words,n=(this._nDataBytes,8*t.sigBytes),a=32*this.blockSize;r[n>>>5]|=1<<24-n%32,r[(e.ceil((n+1)/a)*a>>>5)-1]|=128,t.sigBytes=4*r.length,this._process();for(var o=this._state,s=this.cfg.outputLength/8,u=s/8,c=[],l=0;l<u;l++){var f=o[l],p=f.high,h=f.low;p=16711935&(p<<8|p>>>24)|4278255360&(p<<24|p>>>8),h=16711935&(h<<8|h>>>24)|4278255360&(h<<24|h>>>8),c.push(h),c.push(p)}return new i.init(c,s)},clone:function(){for(var e=a.clone.call(this),t=e._state=this._state.slice(0),r=0;r<25;r++)t[r]=t[r].clone();return e}});t.SHA3=a._createHelper(p),t.HmacSHA3=a._createHmacHelper(p)}(Math),n.SHA3)},860:function(e,t,r){var n;e.exports=(n=r(52),
/** @preserve
	(c) 2012 by Cédric Mesnil. All rights reserved.

	Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

	    - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
	    - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

	THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
	*/
function(e){var t=n,r=t.lib,i=r.WordArray,a=r.Hasher,o=t.algo,s=i.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),u=i.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),c=i.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),l=i.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),f=i.create([0,1518500249,1859775393,2400959708,2840853838]),p=i.create([1352829926,1548603684,1836072691,2053994217,0]),h=o.RIPEMD160=a.extend({_doReset:function(){this._hash=i.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var r=0;r<16;r++){var n=t+r,i=e[n];e[n]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8)}var a,o,h,E,b,S,B,A,T,w,I,k=this._hash.words,_=f.words,R=p.words,x=s.words,N=u.words,L=c.words,D=l.words;for(S=a=k[0],B=o=k[1],A=h=k[2],T=E=k[3],w=b=k[4],r=0;r<80;r+=1)I=a+e[t+x[r]]|0,I+=r<16?d(o,h,E)+_[0]:r<32?g(o,h,E)+_[1]:r<48?y(o,h,E)+_[2]:r<64?v(o,h,E)+_[3]:m(o,h,E)+_[4],I=(I=C(I|=0,L[r]))+b|0,a=b,b=E,E=C(h,10),h=o,o=I,I=S+e[t+N[r]]|0,I+=r<16?m(B,A,T)+R[0]:r<32?v(B,A,T)+R[1]:r<48?y(B,A,T)+R[2]:r<64?g(B,A,T)+R[3]:d(B,A,T)+R[4],I=(I=C(I|=0,D[r]))+w|0,S=w,w=T,T=C(A,10),A=B,B=I;I=k[1]+h+T|0,k[1]=k[2]+E+w|0,k[2]=k[3]+b+S|0,k[3]=k[4]+a+B|0,k[4]=k[0]+o+A|0,k[0]=I},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;t[n>>>5]|=128<<24-n%32,t[14+(n+64>>>9<<4)]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),e.sigBytes=4*(t.length+1),this._process();for(var i=this._hash,a=i.words,o=0;o<5;o++){var s=a[o];a[o]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8)}return i},clone:function(){var e=a.clone.call(this);return e._hash=this._hash.clone(),e}});function d(e,t,r){return e^t^r}function g(e,t,r){return e&t|~e&r}function y(e,t,r){return(e|~t)^r}function v(e,t,r){return e&r|t&~r}function m(e,t,r){return e^(t|~r)}function C(e,t){return e<<t|e>>>32-t}t.RIPEMD160=a._createHelper(h),t.HmacRIPEMD160=a._createHmacHelper(h)}(Math),n.RIPEMD160)},861:function(e,t,r){var n,i,a,o,s,u,c,l,f;e.exports=(f=r(52),r(439),r(440),i=(n=f).lib,a=i.Base,o=i.WordArray,s=n.algo,u=s.SHA1,c=s.HMAC,l=s.PBKDF2=a.extend({cfg:a.extend({keySize:4,hasher:u,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var r=this.cfg,n=c.create(r.hasher,e),i=o.create(),a=o.create([1]),s=i.words,u=a.words,l=r.keySize,f=r.iterations;s.length<l;){var p=n.update(t).finalize(a);n.reset();for(var h=p.words,d=h.length,g=p,y=1;y<f;y++){g=n.finalize(g),n.reset();for(var v=g.words,m=0;m<d;m++)h[m]^=v[m]}i.concat(p),u[0]++}return i.sigBytes=4*l,i}}),n.PBKDF2=function(e,t,r){return l.create(r).compute(e,t)},f.PBKDF2)},862:function(e,t,r){var n;e.exports=(n=r(52),r(84),n.mode.CFB=function(){var e=n.lib.BlockCipherMode.extend();function t(e,t,r,n){var i=this._iv;if(i){var a=i.slice(0);this._iv=void 0}else a=this._prevBlock;n.encryptBlock(a,0);for(var o=0;o<r;o++)e[t+o]^=a[o]}return e.Encryptor=e.extend({processBlock:function(e,r){var n=this._cipher,i=n.blockSize;t.call(this,e,r,i,n),this._prevBlock=e.slice(r,r+i)}}),e.Decryptor=e.extend({processBlock:function(e,r){var n=this._cipher,i=n.blockSize,a=e.slice(r,r+i);t.call(this,e,r,i,n),this._prevBlock=a}}),e}(),n.mode.CFB)},863:function(e,t,r){var n,i,a;e.exports=(a=r(52),r(84),a.mode.CTR=(n=a.lib.BlockCipherMode.extend(),i=n.Encryptor=n.extend({processBlock:function(e,t){var r=this._cipher,n=r.blockSize,i=this._iv,a=this._counter;i&&(a=this._counter=i.slice(0),this._iv=void 0);var o=a.slice(0);r.encryptBlock(o,0),a[n-1]=a[n-1]+1|0;for(var s=0;s<n;s++)e[t+s]^=o[s]}}),n.Decryptor=i,n),a.mode.CTR)},864:function(e,t,r){var n;e.exports=(n=r(52),r(84),
/** @preserve
	 * Counter block mode compatible with  Dr Brian Gladman fileenc.c
	 * derived from CryptoJS.mode.CTR
	 * Jan Hruby jhruby.web@gmail.com
	 */
n.mode.CTRGladman=function(){var e=n.lib.BlockCipherMode.extend();function t(e){if(255==(e>>24&255)){var t=e>>16&255,r=e>>8&255,n=255&e;255===t?(t=0,255===r?(r=0,255===n?n=0:++n):++r):++t,e=0,e+=t<<16,e+=r<<8,e+=n}else e+=1<<24;return e}var r=e.Encryptor=e.extend({processBlock:function(e,r){var n=this._cipher,i=n.blockSize,a=this._iv,o=this._counter;a&&(o=this._counter=a.slice(0),this._iv=void 0),function(e){0===(e[0]=t(e[0]))&&(e[1]=t(e[1]))}(o);var s=o.slice(0);n.encryptBlock(s,0);for(var u=0;u<i;u++)e[r+u]^=s[u]}});return e.Decryptor=r,e}(),n.mode.CTRGladman)},865:function(e,t,r){var n,i,a;e.exports=(a=r(52),r(84),a.mode.OFB=(n=a.lib.BlockCipherMode.extend(),i=n.Encryptor=n.extend({processBlock:function(e,t){var r=this._cipher,n=r.blockSize,i=this._iv,a=this._keystream;i&&(a=this._keystream=i.slice(0),this._iv=void 0),r.encryptBlock(a,0);for(var o=0;o<n;o++)e[t+o]^=a[o]}}),n.Decryptor=i,n),a.mode.OFB)},866:function(e,t,r){var n,i;e.exports=(i=r(52),r(84),i.mode.ECB=((n=i.lib.BlockCipherMode.extend()).Encryptor=n.extend({processBlock:function(e,t){this._cipher.encryptBlock(e,t)}}),n.Decryptor=n.extend({processBlock:function(e,t){this._cipher.decryptBlock(e,t)}}),n),i.mode.ECB)},867:function(e,t,r){var n;e.exports=(n=r(52),r(84),n.pad.AnsiX923={pad:function(e,t){var r=e.sigBytes,n=4*t,i=n-r%n,a=r+i-1;e.clamp(),e.words[a>>>2]|=i<<24-a%4*8,e.sigBytes+=i},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},n.pad.Ansix923)},868:function(e,t,r){var n;e.exports=(n=r(52),r(84),n.pad.Iso10126={pad:function(e,t){var r=4*t,i=r-e.sigBytes%r;e.concat(n.lib.WordArray.random(i-1)).concat(n.lib.WordArray.create([i<<24],1))},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},n.pad.Iso10126)},869:function(e,t,r){var n;e.exports=(n=r(52),r(84),n.pad.Iso97971={pad:function(e,t){e.concat(n.lib.WordArray.create([2147483648],1)),n.pad.ZeroPadding.pad(e,t)},unpad:function(e){n.pad.ZeroPadding.unpad(e),e.sigBytes--}},n.pad.Iso97971)},870:function(e,t,r){var n;e.exports=(n=r(52),r(84),n.pad.ZeroPadding={pad:function(e,t){var r=4*t;e.clamp(),e.sigBytes+=r-(e.sigBytes%r||r)},unpad:function(e){for(var t=e.words,r=e.sigBytes-1;!(t[r>>>2]>>>24-r%4*8&255);)r--;e.sigBytes=r+1}},n.pad.ZeroPadding)},871:function(e,t,r){var n;e.exports=(n=r(52),r(84),n.pad.NoPadding={pad:function(){},unpad:function(){}},n.pad.NoPadding)},872:function(e,t,r){var n,i,a,o;e.exports=(o=r(52),r(84),i=(n=o).lib.CipherParams,a=n.enc.Hex,n.format.Hex={stringify:function(e){return e.ciphertext.toString(a)},parse:function(e){var t=a.parse(e);return i.create({ciphertext:t})}},o.format.Hex)},873:function(e,t,r){var n;e.exports=(n=r(52),r(235),r(236),r(216),r(84),function(){var e=n,t=e.lib.BlockCipher,r=e.algo,i=[],a=[],o=[],s=[],u=[],c=[],l=[],f=[],p=[],h=[];!function(){for(var e=[],t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;var r=0,n=0;for(t=0;t<256;t++){var d=n^n<<1^n<<2^n<<3^n<<4;d=d>>>8^255&d^99,i[r]=d,a[d]=r;var g=e[r],y=e[g],v=e[y],m=257*e[d]^16843008*d;o[r]=m<<24|m>>>8,s[r]=m<<16|m>>>16,u[r]=m<<8|m>>>24,c[r]=m,m=16843009*v^65537*y^257*g^16843008*r,l[d]=m<<24|m>>>8,f[d]=m<<16|m>>>16,p[d]=m<<8|m>>>24,h[d]=m,r?(r=g^e[e[e[v^g]]],n^=e[e[n]]):r=n=1}}();var d=[0,1,2,4,8,16,32,64,128,27,54],g=r.AES=t.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var e=this._keyPriorReset=this._key,t=e.words,r=e.sigBytes/4,n=4*((this._nRounds=r+6)+1),a=this._keySchedule=[],o=0;o<n;o++)if(o<r)a[o]=t[o];else{var s=a[o-1];o%r?r>6&&o%r==4&&(s=i[s>>>24]<<24|i[s>>>16&255]<<16|i[s>>>8&255]<<8|i[255&s]):(s=i[(s=s<<8|s>>>24)>>>24]<<24|i[s>>>16&255]<<16|i[s>>>8&255]<<8|i[255&s],s^=d[o/r|0]<<24),a[o]=a[o-r]^s}for(var u=this._invKeySchedule=[],c=0;c<n;c++)o=n-c,s=c%4?a[o]:a[o-4],u[c]=c<4||o<=4?s:l[i[s>>>24]]^f[i[s>>>16&255]]^p[i[s>>>8&255]]^h[i[255&s]]}},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,o,s,u,c,i)},decryptBlock:function(e,t){var r=e[t+1];e[t+1]=e[t+3],e[t+3]=r,this._doCryptBlock(e,t,this._invKeySchedule,l,f,p,h,a),r=e[t+1],e[t+1]=e[t+3],e[t+3]=r},_doCryptBlock:function(e,t,r,n,i,a,o,s){for(var u=this._nRounds,c=e[t]^r[0],l=e[t+1]^r[1],f=e[t+2]^r[2],p=e[t+3]^r[3],h=4,d=1;d<u;d++){var g=n[c>>>24]^i[l>>>16&255]^a[f>>>8&255]^o[255&p]^r[h++],y=n[l>>>24]^i[f>>>16&255]^a[p>>>8&255]^o[255&c]^r[h++],v=n[f>>>24]^i[p>>>16&255]^a[c>>>8&255]^o[255&l]^r[h++],m=n[p>>>24]^i[c>>>16&255]^a[l>>>8&255]^o[255&f]^r[h++];c=g,l=y,f=v,p=m}g=(s[c>>>24]<<24|s[l>>>16&255]<<16|s[f>>>8&255]<<8|s[255&p])^r[h++],y=(s[l>>>24]<<24|s[f>>>16&255]<<16|s[p>>>8&255]<<8|s[255&c])^r[h++],v=(s[f>>>24]<<24|s[p>>>16&255]<<16|s[c>>>8&255]<<8|s[255&l])^r[h++],m=(s[p>>>24]<<24|s[c>>>16&255]<<16|s[l>>>8&255]<<8|s[255&f])^r[h++],e[t]=g,e[t+1]=y,e[t+2]=v,e[t+3]=m},keySize:8});e.AES=t._createHelper(g)}(),n.AES)},874:function(e,t,r){var n;e.exports=(n=r(52),r(235),r(236),r(216),r(84),function(){var e=n,t=e.lib,r=t.WordArray,i=t.BlockCipher,a=e.algo,o=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],s=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],u=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],c=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],l=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],f=a.DES=i.extend({_doReset:function(){for(var e=this._key.words,t=[],r=0;r<56;r++){var n=o[r]-1;t[r]=e[n>>>5]>>>31-n%32&1}for(var i=this._subKeys=[],a=0;a<16;a++){var c=i[a]=[],l=u[a];for(r=0;r<24;r++)c[r/6|0]|=t[(s[r]-1+l)%28]<<31-r%6,c[4+(r/6|0)]|=t[28+(s[r+24]-1+l)%28]<<31-r%6;for(c[0]=c[0]<<1|c[0]>>>31,r=1;r<7;r++)c[r]=c[r]>>>4*(r-1)+3;c[7]=c[7]<<5|c[7]>>>27}var f=this._invSubKeys=[];for(r=0;r<16;r++)f[r]=i[15-r]},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._subKeys)},decryptBlock:function(e,t){this._doCryptBlock(e,t,this._invSubKeys)},_doCryptBlock:function(e,t,r){this._lBlock=e[t],this._rBlock=e[t+1],p.call(this,4,252645135),p.call(this,16,65535),h.call(this,2,858993459),h.call(this,8,16711935),p.call(this,1,1431655765);for(var n=0;n<16;n++){for(var i=r[n],a=this._lBlock,o=this._rBlock,s=0,u=0;u<8;u++)s|=c[u][((o^i[u])&l[u])>>>0];this._lBlock=o,this._rBlock=a^s}var f=this._lBlock;this._lBlock=this._rBlock,this._rBlock=f,p.call(this,1,1431655765),h.call(this,8,16711935),h.call(this,2,858993459),p.call(this,16,65535),p.call(this,4,252645135),e[t]=this._lBlock,e[t+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});function p(e,t){var r=(this._lBlock>>>e^this._rBlock)&t;this._rBlock^=r,this._lBlock^=r<<e}function h(e,t){var r=(this._rBlock>>>e^this._lBlock)&t;this._lBlock^=r,this._rBlock^=r<<e}e.DES=i._createHelper(f);var d=a.TripleDES=i.extend({_doReset:function(){var e=this._key.words;this._des1=f.createEncryptor(r.create(e.slice(0,2))),this._des2=f.createEncryptor(r.create(e.slice(2,4))),this._des3=f.createEncryptor(r.create(e.slice(4,6)))},encryptBlock:function(e,t){this._des1.encryptBlock(e,t),this._des2.decryptBlock(e,t),this._des3.encryptBlock(e,t)},decryptBlock:function(e,t){this._des3.decryptBlock(e,t),this._des2.encryptBlock(e,t),this._des1.decryptBlock(e,t)},keySize:6,ivSize:2,blockSize:2});e.TripleDES=i._createHelper(d)}(),n.TripleDES)},875:function(e,t,r){var n;e.exports=(n=r(52),r(235),r(236),r(216),r(84),function(){var e=n,t=e.lib.StreamCipher,r=e.algo,i=r.RC4=t.extend({_doReset:function(){for(var e=this._key,t=e.words,r=e.sigBytes,n=this._S=[],i=0;i<256;i++)n[i]=i;i=0;for(var a=0;i<256;i++){var o=i%r,s=t[o>>>2]>>>24-o%4*8&255;a=(a+n[i]+s)%256;var u=n[i];n[i]=n[a],n[a]=u}this._i=this._j=0},_doProcessBlock:function(e,t){e[t]^=a.call(this)},keySize:8,ivSize:0});function a(){for(var e=this._S,t=this._i,r=this._j,n=0,i=0;i<4;i++){r=(r+e[t=(t+1)%256])%256;var a=e[t];e[t]=e[r],e[r]=a,n|=e[(e[t]+e[r])%256]<<24-8*i}return this._i=t,this._j=r,n}e.RC4=t._createHelper(i);var o=r.RC4Drop=i.extend({cfg:i.cfg.extend({drop:192}),_doReset:function(){i._doReset.call(this);for(var e=this.cfg.drop;e>0;e--)a.call(this)}});e.RC4Drop=t._createHelper(o)}(),n.RC4)},876:function(e,t,r){var n;e.exports=(n=r(52),r(235),r(236),r(216),r(84),function(){var e=n,t=e.lib.StreamCipher,r=e.algo,i=[],a=[],o=[],s=r.Rabbit=t.extend({_doReset:function(){for(var e=this._key.words,t=this.cfg.iv,r=0;r<4;r++)e[r]=16711935&(e[r]<<8|e[r]>>>24)|4278255360&(e[r]<<24|e[r]>>>8);var n=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],i=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];for(this._b=0,r=0;r<4;r++)u.call(this);for(r=0;r<8;r++)i[r]^=n[r+4&7];if(t){var a=t.words,o=a[0],s=a[1],c=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),l=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),f=c>>>16|4294901760&l,p=l<<16|65535&c;for(i[0]^=c,i[1]^=f,i[2]^=l,i[3]^=p,i[4]^=c,i[5]^=f,i[6]^=l,i[7]^=p,r=0;r<4;r++)u.call(this)}},_doProcessBlock:function(e,t){var r=this._X;u.call(this),i[0]=r[0]^r[5]>>>16^r[3]<<16,i[1]=r[2]^r[7]>>>16^r[5]<<16,i[2]=r[4]^r[1]>>>16^r[7]<<16,i[3]=r[6]^r[3]>>>16^r[1]<<16;for(var n=0;n<4;n++)i[n]=16711935&(i[n]<<8|i[n]>>>24)|4278255360&(i[n]<<24|i[n]>>>8),e[t+n]^=i[n]},blockSize:4,ivSize:2});function u(){for(var e=this._X,t=this._C,r=0;r<8;r++)a[r]=t[r];for(t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0<a[0]>>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0<a[1]>>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0<a[2]>>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0<a[3]>>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0<a[4]>>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0<a[5]>>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0<a[6]>>>0?1:0)|0,this._b=t[7]>>>0<a[7]>>>0?1:0,r=0;r<8;r++){var n=e[r]+t[r],i=65535&n,s=n>>>16,u=((i*i>>>17)+i*s>>>15)+s*s,c=((4294901760&n)*n|0)+((65535&n)*n|0);o[r]=u^c}e[0]=o[0]+(o[7]<<16|o[7]>>>16)+(o[6]<<16|o[6]>>>16)|0,e[1]=o[1]+(o[0]<<8|o[0]>>>24)+o[7]|0,e[2]=o[2]+(o[1]<<16|o[1]>>>16)+(o[0]<<16|o[0]>>>16)|0,e[3]=o[3]+(o[2]<<8|o[2]>>>24)+o[1]|0,e[4]=o[4]+(o[3]<<16|o[3]>>>16)+(o[2]<<16|o[2]>>>16)|0,e[5]=o[5]+(o[4]<<8|o[4]>>>24)+o[3]|0,e[6]=o[6]+(o[5]<<16|o[5]>>>16)+(o[4]<<16|o[4]>>>16)|0,e[7]=o[7]+(o[6]<<8|o[6]>>>24)+o[5]|0}e.Rabbit=t._createHelper(s)}(),n.Rabbit)},877:function(e,t,r){var n;e.exports=(n=r(52),r(235),r(236),r(216),r(84),function(){var e=n,t=e.lib.StreamCipher,r=e.algo,i=[],a=[],o=[],s=r.RabbitLegacy=t.extend({_doReset:function(){var e=this._key.words,t=this.cfg.iv,r=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],n=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];this._b=0;for(var i=0;i<4;i++)u.call(this);for(i=0;i<8;i++)n[i]^=r[i+4&7];if(t){var a=t.words,o=a[0],s=a[1],c=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),l=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),f=c>>>16|4294901760&l,p=l<<16|65535&c;for(n[0]^=c,n[1]^=f,n[2]^=l,n[3]^=p,n[4]^=c,n[5]^=f,n[6]^=l,n[7]^=p,i=0;i<4;i++)u.call(this)}},_doProcessBlock:function(e,t){var r=this._X;u.call(this),i[0]=r[0]^r[5]>>>16^r[3]<<16,i[1]=r[2]^r[7]>>>16^r[5]<<16,i[2]=r[4]^r[1]>>>16^r[7]<<16,i[3]=r[6]^r[3]>>>16^r[1]<<16;for(var n=0;n<4;n++)i[n]=16711935&(i[n]<<8|i[n]>>>24)|4278255360&(i[n]<<24|i[n]>>>8),e[t+n]^=i[n]},blockSize:4,ivSize:2});function u(){for(var e=this._X,t=this._C,r=0;r<8;r++)a[r]=t[r];for(t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0<a[0]>>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0<a[1]>>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0<a[2]>>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0<a[3]>>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0<a[4]>>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0<a[5]>>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0<a[6]>>>0?1:0)|0,this._b=t[7]>>>0<a[7]>>>0?1:0,r=0;r<8;r++){var n=e[r]+t[r],i=65535&n,s=n>>>16,u=((i*i>>>17)+i*s>>>15)+s*s,c=((4294901760&n)*n|0)+((65535&n)*n|0);o[r]=u^c}e[0]=o[0]+(o[7]<<16|o[7]>>>16)+(o[6]<<16|o[6]>>>16)|0,e[1]=o[1]+(o[0]<<8|o[0]>>>24)+o[7]|0,e[2]=o[2]+(o[1]<<16|o[1]>>>16)+(o[0]<<16|o[0]>>>16)|0,e[3]=o[3]+(o[2]<<8|o[2]>>>24)+o[1]|0,e[4]=o[4]+(o[3]<<16|o[3]>>>16)+(o[2]<<16|o[2]>>>16)|0,e[5]=o[5]+(o[4]<<8|o[4]>>>24)+o[3]|0,e[6]=o[6]+(o[5]<<16|o[5]>>>16)+(o[4]<<16|o[4]>>>16)|0,e[7]=o[7]+(o[6]<<8|o[6]>>>24)+o[5]|0}e.RabbitLegacy=t._createHelper(s)}(),n.RabbitLegacy)},9:function(e,t,r){"use strict";var n=r(1),i=r.n(n),a=r(2),o=r.n(a),s=r(13),u=r(0),c=r(16),l=function(){function e(t){i()(this,e),this.name="",this.type="",this._value=null,this.disabled=!1,this.hint="",this.rows=0,this.toggleValues=[],this.target=null,this.defaultIndex=0,this.min=null,this.max=null,this.step=1,t&&this._parseConfig(t)}return o()(e,[{key:"_parseConfig",value:function(e){this.name=e.name,this.type=e.type,this.defaultValue=e.value,this.disabled=!!e.disabled,this.hint=e.hint||!1,this.rows=e.rows||!1,this.toggleValues=e.toggleValues,this.target=void 0!==e.target?e.target:null,this.defaultIndex=void 0!==e.defaultIndex?e.defaultIndex:0,this.min=e.min,this.max=e.max,this.step=e.step}},{key:"config",get:function(){return this._value}},{key:"value",set:function(t){this._value=e.prepare(t,this.type)},get:function(){return this._value}}],[{key:"prepare",value:function(e,t){var r;switch(t){case"binaryString":case"binaryShortString":case"editableOption":case"editableOptionShort":return u.b.parseEscapedChars(e);case"byteArray":return"string"==typeof e?(e=e.replace(/\s+/g,""),Object(c.a)(e)):e;case"number":if(null===e)return e;if(r=parseFloat(e),isNaN(r))throw"Invalid ingredient value. Not a number: "+u.b.truncate(e.toString(),10);return r;default:return e}}}]),e}(),f=function(){function e(){i()(this,e),this._inputType=-1,this._outputType=-1,this._presentType=-1,this._breakpoint=!1,this._disabled=!1,this._flowControl=!1,this._manualBake=!1,this._ingList=[],this.name="",this.module="",this.description="",this.infoURL=null}return o()(e,[{key:"run",value:function(e,t){return e}},{key:"highlight",value:function(e,t){return!1}},{key:"highlightReverse",value:function(e,t){return!1}},{key:"present",value:function(e,t){return e}},{key:"addIngredient",value:function(e){this._ingList.push(e)}},{key:"inputType",set:function(e){this._inputType=s.a.typeEnum(e)},get:function(){return s.a.enumLookup(this._inputType)}},{key:"outputType",set:function(e){this._outputType=s.a.typeEnum(e),this._presentType<0&&(this._presentType=this._outputType)},get:function(){return s.a.enumLookup(this._outputType)}},{key:"presentType",set:function(e){this._presentType=s.a.typeEnum(e)},get:function(){return s.a.enumLookup(this._presentType)}},{key:"args",set:function(e){var t=this;e.forEach((function(e){var r=new l(e);t.addIngredient(r)}))},get:function(){return this._ingList.map((function(e){var t={name:e.name,type:e.type,value:e.defaultValue};return e.toggleValues&&(t.toggleValues=e.toggleValues),e.hint&&(t.hint=e.hint),e.rows&&(t.rows=e.rows),e.disabled&&(t.disabled=e.disabled),e.target&&(t.target=e.target),e.defaultIndex&&(t.defaultIndex=e.defaultIndex),"number"==typeof e.min&&(t.min=e.min),"number"==typeof e.max&&(t.max=e.max),e.step&&(t.step=e.step),t}))}},{key:"config",get:function(){return{op:this.name,args:this._ingList.map((function(e){return e.config}))}}},{key:"ingValues",set:function(e){var t=this;e.forEach((function(e,r){t._ingList[r].value=e}))},get:function(){return this._ingList.map((function(e){return e.value}))}},{key:"breakpoint",set:function(e){this._breakpoint=!!e},get:function(){return this._breakpoint}},{key:"disabled",set:function(e){this._disabled=!!e},get:function(){return this._disabled}},{key:"flowControl",get:function(){return this._flowControl},set:function(e){this._flowControl=!!e}},{key:"manualBake",get:function(){return this._manualBake},set:function(e){this._manualBake=!!e}}]),e}();t.a=f},97:function(e,t,r){"use strict";r.d(t,"a",(function(){return n})),r.d(t,"c",(function(){return i})),r.d(t,"b",(function(){return a})),r.d(t,"d",(function(){return o}));
/**
 * Various delimiters
 *
 * @author n1474335 [n1474335@gmail.com]
 * @copyright Crown Copyright 2018
 * @license Apache-2.0
 */
var n=["Space","Comma","Semi-colon","Colon","Line feed","CRLF"],i=["Line feed","CRLF","Space","Comma","Semi-colon","Colon","Nothing (separate chars)"],a=["Line feed","CRLF","Space","Comma"],o=[{name:"Comma",value:","},{name:"Space",value:" "},{name:"CRLF",value:"\\r\\n"},{name:"Line Feed",value:"\n"}]}});