CyberChef/UserAgent.js

103 lines
74 KiB
JavaScript
Executable File
Raw Blame History

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

/**
* 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=1514)}({0:function(e,t,r){"use strict";var n=r(15),i=r.n(n),u=r(10),o=r(7),a=r(19),s=r(18);function c(e,t,r,n,i,u,o){try{var a=e[u](o),s=a.value}catch(e){return void r(e)}a.done?t(s):Promise.resolve(s).then(n,i)}function l(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var u=e.apply(t,r);function o(e){c(u,n,i,o,a,"next",e)}function a(e){c(u,n,i,o,a,"throw",e)}o(void 0)})}}function f(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)}}
/**
* @author n1474335 [n1474335@gmail.com]
* @copyright Crown Copyright 2016
* @license Apache-2.0
*/
var p=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,r,n;return t=e,r=null,n=[{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),Array.prototype.map.call(e,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(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return(t="string"==typeof t?e.ord(t):t).toString(16).padStart(r,"0")}},{key:"bin",value:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8;return(t="string"==typeof t?e.ord(t):t).toString(2).padStart(r,"0")}},{key:"printable",value:function(t){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];"object"==typeof window&&window.app&&!window.app.options.treatAsUtf8&&(t=e.byteArrayToChars(e.strToByteArray(t)));return t=t.replace(/[\0-\x08\x0B-\x0C\x0E-\x1F\x7F-\x9F\xAD\u0378\u0379\u037F-\u0383\u038B\u038D\u03A2\u0528-\u0530\u0557\u0558\u0560\u0588\u058B-\u058E\u0590\u05C8-\u05CF\u05EB-\u05EF\u05F5-\u0605\u061C\u061D\u06DD\u070E\u070F\u074B\u074C\u07B2-\u07BF\u07FB-\u07FF\u082E\u082F\u083F\u085C\u085D\u085F-\u089F\u08A1\u08AD-\u08E3\u08FF\u0978\u0980\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09FC-\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A76-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF2-\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B55\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B78-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BFB-\u0C00\u0C04\u0C0D\u0C11\u0C29\u0C34\u0C3A-\u0C3C\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5A-\u0C5F\u0C64\u0C65\u0C70-\u0C77\u0C80\u0C81\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDD\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0D01\u0D04\u0D0D\u0D11\u0D3B\u0D3C\u0D45\u0D49\u0D4F-\u0D56\u0D58-\u0D5F\u0D64\u0D65\u0D76-\u0D78\u0D80\u0D81\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DF1\u0DF5-\u0E00\u0E3B-\u0E3E\u0E5C-\u0E80\u0E83\u0E85\u0E86\u0E89\u0E8B\u0E8C\u0E8E-\u0E93\u0E98\u0EA0\u0EA4\u0EA6\u0EA8\u0EA9\u0EAC\u0EBA\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F48\u0F6D-\u0F70\u0F98\u0FBD\u0FCD\u0FDB-\u0FFF\u10C6\u10C8-\u10CC\u10CE\u10CF\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u137D-\u137F\u139A-\u139F\u13F5-\u13FF\u169D-\u169F\u16F1-\u16FF\u170D\u1715-\u171F\u1737-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17DE\u17DF\u17EA-\u17EF\u17FA-\u17FF\u180F\u181A-\u181F\u1878-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191D-\u191F\u192C-\u192F\u193C-\u193F\u1941-\u1943\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DB-\u19DD\u1A1C\u1A1D\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1A9F\u1AAE-\u1AFF\u1B4C-\u1B4F\u1B7D-\u1B7F\u1BF4-\u1BFB\u1C38-\u1C3A\u1C4A-\u1C4C\u1C80-\u1CBF\u1CC8-\u1CCF\u1CF7-\u1CFF\u1DE7-\u1DFB\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FC5\u1FD4\u1FD5\u1FDC\u1FF0\u1FF1\u1FF5\u1FFF\u200B-\u200F\u202A-\u202E\u2060-\u206F\u2072\u2073\u208F\u209D-\u209F\u20BB-\u20CF\u20F1-\u20FF\u218A-\u218F\u23F4-\u23FF\u2427-\u243F\u244B-\u245F\u2700\u2B4D-\u2B4F\u2B5A-\u2BFF\u2C2F\u2C5F\u2CF4-\u2CF8\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D71-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E3C-\u2E7F\u2E9A\u2EF4-\u2EFF\u2FD6-\u2FEF\u2FFC-\u2FFF\u3040\u3097\u3098\u3100-\u3104\u312E-\u3130\u318F\u31BB-\u31BF\u31E4-\u31EF\u321F\u32FF\u4DB6-\u4DBF\u9FCD-\u9FFF\uA48D-\uA48F\uA4C7-\uA4CF\uA62C-\uA63F\uA698-\uA69E\uA6F8-\uA6FF\uA78F\uA794-\uA79F\uA7AB-\uA7F7\uA82C-\uA82F\uA83A-\uA83F\uA878-\uA87F\uA8C5-\uA8CD\uA8DA-\uA8DF\uA8FC-\uA8FF\uA954-\uA95E\uA97D-\uA97F\uA9CE\uA9DA-\uA9DD\uA9E0-\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A\uAA5B\uAA7C-\uAA7F\uAAC3-\uAADA\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F-\uABBF\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uD7FF\uE000-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBC2-\uFBD2\uFD40-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFE\uFDFF\uFE1A-\uFE1F\uFE27-\uFE2F\uFE53\uFE67\uFE6C-\uFE6F\uFE75\uFEFD-\uFF00\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFDF\uFFE7\uFFEF-\uFFFB\uFFFE\uFFFF]/g,"."),r||(t=t.replace(/[\x09-\x10\x0D\u2028\u2029]/g,".")),t}},{key:"parseEscapedChars",value:function(e){return e.replace(/(\\)?\\([bfnrtv0'"]|x[\da-fA-F]{2}|u[\da-fA-F]{4}|u\{[\da-fA-F]{1,6}\})/g,function(e,t,r){if("\\"===t)return"\\"+r;switch(r[0]){case"0":return"\0";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(r.substr(1),16));case"u":return"{"===r[1]?String.fromCodePoint(parseInt(r.slice(2,-1),16)):String.fromCharCode(parseInt(r.substr(1),16))}})}},{key:"escapeRegex",value:function(e){return e.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}},{key:"expandAlphRange",value:function(t){for(var r=[],n=0;n<t.length;n++)if(n<t.length-2&&"-"===t[n+1]&&"\\"!==t[n]){for(var i=e.ord(t[n]),u=e.ord(t[n+2]),o=i;o<=u;o++)r.push(e.chr(o));n+=2}else n<t.length-2&&"\\"===t[n]&&"-"===t[n+1]?(r.push("-"),n++):r.push(t[n]);return r}},{key:"convertToByteArray",value:function(t,r){switch(r.toLowerCase()){case"binary":return Object(s.a)(t);case"hex":return Object(o.c)(t);case"decimal":return Object(a.a)(t);case"base64":return Object(u.b)(t,null,"byteArray");case"utf8":return e.strToUtf8ByteArray(t);case"latin1":default:return e.strToByteArray(t)}}},{key:"convertToByteString",value:function(t,r){switch(r.toLowerCase()){case"binary":return e.byteArrayToChars(Object(s.a)(t));case"hex":return e.byteArrayToChars(Object(o.c)(t));case"decimal":return e.byteArrayToChars(Object(a.a)(t));case"base64":return e.byteArrayToChars(Object(u.b)(t,null,"byteArray"));case"utf8":return i.a.encode(t);case"latin1":default:return t}}},{key:"strToByteArray",value:function(t){for(var r,n=new Array(t.length),i=t.length;i--;)if(r=t.charCodeAt(i),n[i]=r,r>255)return e.strToUtf8ByteArray(t);return n}},{key:"strToUtf8ByteArray",value:function(t){var r=i.a.encode(t);return t.length!==r.length&&("function"==typeof importScripts?self.setOption("attemptHighlight",!1):"object"==typeof window&&(window.app.options.attemptHighlight=!1)),e.strToByteArray(r)}},{key:"strToCharcode",value:function(t){for(var r=[],n=0;n<t.length;n++){var i=t.charCodeAt(n);if(n<t.length-1&&i>=55296&&i<56320){var u=t[n+1].charCodeAt(0);u>=56320&&u<57344&&(i=e.ord(t[n]+t[++n]))}r.push(i)}return r}},{key:"byteArrayToUtf8",value:function(t){var r=e.byteArrayToChars(t);try{var n=i.a.decode(r);return r.length!==n.length&&("function"==typeof importScripts?self.setOption("attemptHighlight",!1):"object"==typeof window&&(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(t){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=Array.prototype.slice.call(new Uint8Array(t));return r?e.byteArrayToUtf8(n):e.byteArrayToChars(n)}},{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"],u=!1,o=!1,a="",s=[],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]||"",u?(a+=t,u=!1):'"'!==t||o?'"'===t&&o?'"'===r?u=!0:o=!1:!o&&n.indexOf(t)>=0?(s.push(a),a=""):!o&&i.indexOf(t)>=0?(s.push(a),a="",c.push(s),s=[],i.indexOf(r)>=0&&r!==t&&l++):a+=t:o=!0;return s.length&&(s.push(a),c.push(s)),c}},{key:"stripHtmlTags",value:function(e){return arguments.length>1&&void 0!==arguments[1]&&arguments[1]&&(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="",u="",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,'"'),u=e.disabled?"/disabled":"",o=e.breakpoint?"/breakpoint":"",r+="".concat(n,"(").concat(i).concat(u).concat(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 u={op:t[1].replace(/_/g," "),args:JSON.parse(r)};t[3]&&t[3].indexOf("disabled")>0&&(u.disabled=!0),t[3]&&t[3].indexOf("breakpoint")>0&&(u.breakpoint=!0),i.push(u)}return i}},{key:"displayFilesAsHTML",value:function(){var t=l(regeneratorRuntime.mark(function t(r){var n,i,o,a,s;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:n=function(t){return"<div class='card' style='white-space: normal;'>\n <div class='card-header'>\n <h6 class=\"mb-0\">\n ".concat(e.escapeHtml(t.name),"\n </h6>\n </div>\n </div>")},i=function(t,r){if(r.startsWith("image")){var n="data:";return n+=r+";","<img style='max-width: 100%;' src='"+(n+="base64,"+Object(u.c)(t))+"'>"}return"<pre>".concat(e.escapeHtml(e.arrayBufferToStr(t.buffer)),"</pre>")},o=function(){var t=l(regeneratorRuntime.mark(function t(r,n){var u,o,a;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.readFile(r);case 2:return u=t.sent,o=new Blob([u],{type:"octet/stream"}),a="<div class='card' style='white-space: normal;'>\n <div class='card-header' id='heading".concat(n,"'>\n <h6 class='mb-0'>\n <a class='collapsed'\n data-toggle='collapse'\n href='#collapse").concat(n,"'\n aria-expanded='false'\n aria-controls='collapse").concat(n,"'\n title=\"Show/hide contents of '").concat(e.escapeHtml(r.name),"'\">\n ").concat(e.escapeHtml(r.name),"</a>\n <span class='float-right' style=\"margin-top: -3px\">\n ").concat(r.size.toLocaleString(),' bytes\n <a title="Download ').concat(e.escapeHtml(r.name),"\"\n href='").concat(URL.createObjectURL(o),"'\n download='").concat(e.escapeHtml(r.name),'\'>\n <i class="material-icons" style="vertical-align: bottom">save</i>\n </a>\n </span>\n </h6>\n </div>\n <div id=\'collapse').concat(n,"' class='collapse' aria-labelledby='heading").concat(n,"' data-parent=\"#files\">\n <div class='card-body'>\n ").concat(i(u,r.type),"\n </div>\n </div>\n </div>"),t.abrupt("return",a);case 6:case"end":return t.stop()}},t,this)}));return function(e,r){return t.apply(this,arguments)}}(),a="<div style='padding: 5px; white-space: normal;'>\n ".concat(r.length,' file(s) found\n </div><div id="files" style="padding: 20px">'),s=0;case 5:if(!(s<r.length)){t.next=17;break}if(!r[s].name.endsWith("/")){t.next=10;break}a+=n(r[s]),t.next=14;break;case 10:return t.t0=a,t.next=13,o(r[s],s);case 13:a=t.t0+=t.sent;case 14:s++,t.next=5;break;case 17:return t.abrupt("return",a+="</div>");case 18:case"end":return t.stop()}},t,this)}));return function(e){return t.apply(this,arguments)}}()},{key:"parseURIParams",value:function(e){if(""===e)return{};"?"!==e[0]&&"#"!==e[0]||(e=e.substr(1));for(var t=e.split("&"),r={},n=0;n<t.length;n++){var i=t[n].split("=");2!==i.length?r[t[n]]=!0:r[i[0]]=decodeURIComponent(i[1].replace(/\+/g," "))}return r}},{key:"readFile",value:function(e){return new Promise(function(t,r){var n=new FileReader,i=new Uint8Array(e.size),u=0,o=function(){if(u>=e.size)t(i);else{var r=e.slice(u,u+10485760);n.readAsArrayBuffer(r)}};n.onload=function(e){i.set(new Uint8Array(n.result),u),u+=10485760,o()},n.onerror=function(e){r(n.error.message)},o()})}},{key:"mod",value:function(e,t){return(e%t+t)%t}},{key:"gcd",value:function(t,r){return r?e.gcd(r,t%r):t}},{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:" ",Comma:",","Semi-colon":";",Colon:":","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,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]}}],r&&f(t.prototype,r),n&&f(t,n),e}();t.a=p,Array.prototype.unique=function(){for(var e={},t=[],r=0,n=this.length;r<n;r++)e.hasOwnProperty(this[r])||(t.push(this[r]),e[this[r]]=1);return t},Array.prototype.max=function(){return Math.max.apply(null,this)},Array.prototype.min=function(){return Math.min.apply(null,this)},Array.prototype.sum=function(){return this.reduce(function(e,t){return e+t},0)},Array.prototype.equals=function(e){if(!e)return!1;var t=this.length;if(t!==e.length)return!1;for(;t--;)if(this[t]!==e[t])return!1;return!0},String.prototype.count=function(e){return this.split(e).length-1},String.prototype.padStart||(String.prototype.padStart=function(e,t){return e>>=0,t=String(void 0!==t?t:" "),this.length>e?String(this):((e-=this.length)>t.length&&(t+=t.repeat(e/t.length)),t.slice(0,e)+String(this))}),String.prototype.padEnd||(String.prototype.padEnd=function(e,t){return e>>=0,t=String(void 0!==t?t:" "),this.length>e?String(this):((e-=this.length)>t.length&&(t+=t.repeat(e/t.length)),String(this)+t.slice(0,e))})},1:function(e,t,r){"use strict";var n=r(9),i=r(0),u=r(7);function o(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)}}
/**
* @author n1474335 [n1474335@gmail.com]
* @copyright Crown Copyright 2016
* @license Apache-2.0
*/
var a=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(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,t&&this._parseConfig(t)}var t,r,n;return t=e,n=[{key:"prepare",value:function(e,t){var r;switch(t){case"binaryString":case"binaryShortString":case"editableOption":case"editableOptionShort":return i.a.parseEscapedChars(e);case"byteArray":return"string"==typeof e?(e=e.replace(/\s+/g,""),Object(u.c)(e)):e;case"number":if(r=parseFloat(e),isNaN(r))throw"Invalid ingredient value. Not a number: "+i.a.truncate(e.toString(),10);return r;default:return e}}}],(r=[{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}},{key:"config",get:function(){return this._value}},{key:"value",set:function(t){this._value=e.prepare(t,this.type)},get:function(){return this._value}}])&&o(t.prototype,r),n&&o(t,n),e}();function s(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)}}
/**
* @author n1474335 [n1474335@gmail.com]
* @copyright Crown Copyright 2016
* @license Apache-2.0
*/
var c=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(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}var t,r,i;return t=e,(r=[{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=n.a.typeEnum(e)},get:function(){return n.a.enumLookup(this._inputType)}},{key:"outputType",set:function(e){this._outputType=n.a.typeEnum(e),this._presentType<0&&(this._presentType=this._outputType)},get:function(){return n.a.enumLookup(this._outputType)}},{key:"presentType",set:function(e){this._presentType=n.a.typeEnum(e)},get:function(){return n.a.enumLookup(this._presentType)}},{key:"args",set:function(e){var t=this;e.forEach(function(e){var r=new a(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),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}}])&&s(t.prototype,r),i&&s(t,i),e}();t.a=c},10:function(e,t,r){"use strict";r.d(t,"c",function(){return i}),r.d(t,"b",function(){return u}),r.d(t,"a",function(){return o});var n=r(0);
/**
* Base64 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]:"A-Za-z0-9+/=";if(!e)return"";"string"==typeof e&&(e=n.a.strToByteArray(e)),t=n.a.expandAlphRange(t).join("");for(var r,i,u,o,a,s,c,l="",f=0;f<e.length;)o=(r=e[f++])>>2,a=(3&r)<<4|(i=e[f++])>>4,s=(15&i)<<2|(u=e[f++])>>6,c=63&u,isNaN(i)?s=c=64:isNaN(u)&&(c=64),l+=t.charAt(o)+t.charAt(a)+t.charAt(s)+t.charAt(c);return l}function u(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",i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if(!e)return"string"===r?"":[];t=t||"A-Za-z0-9+/=",t=n.a.expandAlphRange(t).join("");var u,o,a,s,c,l,f=[],p=0;if(i){var h=new RegExp("[^"+t.replace(/[[\]\\\-^$]/g,"\\$&")+"]","g");e=e.replace(h,"")}for(;p<e.length;)u=t.indexOf(e.charAt(p++))<<2|(s=-1===(s=t.indexOf(e.charAt(p++)||"="))?64:s)>>4,o=(15&s)<<4|(c=-1===(c=t.indexOf(e.charAt(p++)||"="))?64:c)>>2,a=(3&c)<<6|(l=-1===(l=t.indexOf(e.charAt(p++)||"="))?64:l),f.push(u),64!==c&&f.push(o),64!==l&&f.push(a);return"string"===r?n.a.byteArrayToUtf8(f):f}var o=[{name:"Standard (RFC 4648): A-Za-z0-9+/=",value:"A-Za-z0-9+/="},{name:"URL safe (RFC 4648 §5): A-Za-z0-9-_",value:"A-Za-z0-9-_"},{name:"Filename safe: A-Za-z0-9+-=",value:"A-Za-z0-9+\\-="},{name:"itoa64: ./0-9A-Za-z=",value:"./0-9A-Za-z="},{name:"XML: A-Za-z0-9_.",value:"A-Za-z0-9_."},{name:"y64: A-Za-z0-9._-",value:"A-Za-z0-9._-"},{name:"z64: 0-9a-zA-Z+/=",value:"0-9a-zA-Z+/="},{name:"Radix-64 (RFC 4880): 0-9A-Za-z+/=",value:"0-9A-Za-z+/="},{name:"Uuencoding: [space]-_",value:" -_"},{name:"Xxencoding: +-0-9A-Za-z",value:"+\\-0-9A-Za-z"},{name:"BinHex: !-,-0-689@A-NP-VX-Z[`a-fh-mp-r",value:"!-,-0-689@A-NP-VX-Z[`a-fh-mp-r"},{name:"ROT13: N-ZA-Mn-za-m0-9+/=",value:"N-ZA-Mn-za-m0-9+/="},{name:"UNIX crypt: ./0-9A-Za-z",value:"./0-9A-Za-z"}]},12:function(e,t,r){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return(i=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function u(e,t){return(u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function o(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function a(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}
/**
* 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 s=function(e){function t(){var e,r,u,a;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var s=arguments.length,c=new Array(s),l=0;l<s;l++)c[l]=arguments[l];return u=this,(r=!(a=(e=i(t)).call.apply(e,[this].concat(c)))||"object"!==n(a)&&"function"!=typeof a?o(u):a).type="DishError",Error.captureStackTrace&&Error.captureStackTrace(o(o(r)),t),r}return 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&&u(e,t)}(t,a(Error)),t}();t.a=s},14:function(e,t,r){var n,i;!function(u,o){"use strict";void 0===(i="function"==typeof(n=function(){var e=function(){},t="undefined",r=["trace","debug","info","warn","error"];function n(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 i(t,n){for(var i=0;i<r.length;i++){var u=r[i];this[u]=i<t?e:this.methodFactory(u,t,n)}this.log=this.debug}function u(r,u,o){return function(r){"debug"===r&&(r="log");return typeof console!==t&&(void 0!==console[r]?n(console,r):void 0!==console.log?n(console,"log"):e)}(r)||function(e,r,n){return function(){typeof console!==t&&(i.call(this,r,n),this[e].apply(this,arguments))}}.apply(this,arguments)}function o(e,n,o){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=o||u,s.getLevel=function(){return a},s.setLevel=function(n,u){if("string"==typeof n&&void 0!==s.levels[n.toUpperCase()]&&(n=s.levels[n.toUpperCase()]),!("number"==typeof n&&n>=0&&n<=s.levels.SILENT))throw"log.setLevel() called with invalid level: "+n;if(a=n,!1!==u&&function(e){var n=(r[e]||"silent").toUpperCase();if(typeof window===t)return;try{return void(window.localStorage[c]=n)}catch(e){}try{window.document.cookie=encodeURIComponent(c)+"="+n+";"}catch(e){}}(n),i.call(s,n,e),typeof console===t&&n<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==n?"WARN":n),s.setLevel(f,!1)}var a=new o,s={};a.getLogger=function(e){if("string"!=typeof e||""===e)throw new TypeError("You must supply a name when creating a logger.");var t=s[e];return t||(t=s[e]=new o(e,a.getLevel(),a.methodFactory)),t};var c=typeof window!==t?window.log:void 0;return a.noConflict=function(){return typeof window!==t&&window.log===a&&(window.log=c),a},a.getLoggers=function(){return s},a})?n.call(t,r,t,e):n)||(e.exports=i)}()},15:function(e,t,r){!function(e){var t,r,n,i=String.fromCharCode;function u(e){for(var t,r,n=[],i=0,u=e.length;i<u;)(t=e.charCodeAt(i++))>=55296&&t<=56319&&i<u?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 a(e,t){return i(e>>t&63|128)}function s(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+=a(e,6)):0==(4292870144&e)&&(t=i(e>>18&7|240),t+=a(e,12),t+=a(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=u(e),r=t.length,n=-1,i="";++n<r;)i+=s(t[n]);return i},e.decode=function(e){t=u(e),r=t.length,n=0;for(var o,a=[];!1!==(o=l());)a.push(o);return function(e){for(var t,r=e.length,n=-1,u="";++n<r;)(t=e[n])>65535&&(u+=i((t-=65536)>>>10&1023|55296),t=56320|1023&t),u+=i(t);return u}(a)}}(t)},1514:function(e,t,r){"use strict";r.r(t);var n=r(1),i=r(793),u=r.n(i);function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(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)}}function s(e,t){return!t||"object"!==o(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function c(e){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function l(e,t){return(l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}
/**
* @author n1474335 [n1474335@gmail.com]
* @copyright Crown Copyright 2016
* @license Apache-2.0
*/var f=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=s(this,c(t).call(this))).name="Parse User Agent",e.module="UserAgent",e.description="Attempts to identify and categorise information contained in a user-agent string.",e.infoURL="https://wikipedia.org/wiki/User_agent",e.inputType="string",e.outputType="string",e.args=[],e}var r,i,o;return 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&&l(e,t)}(t,n["a"]),r=t,(i=[{key:"run",value:function(e,t){var r=u()(e);return"Browser\n Name: ".concat(r.browser.name||"unknown","\n Version: ").concat(r.browser.version||"unknown","\nDevice\n Model: ").concat(r.device.model||"unknown","\n Type: ").concat(r.device.type||"unknown","\n Vendor: ").concat(r.device.vendor||"unknown","\nEngine\n Name: ").concat(r.engine.name||"unknown","\n Version: ").concat(r.engine.version||"unknown","\nOS\n Name: ").concat(r.os.name||"unknown","\n Version: ").concat(r.os.version||"unknown","\nCPU\n Architecture: ").concat(r.cpu.architecture||"unknown")}}])&&a(r.prototype,i),o&&a(r,o),t}(),p="undefined"==typeof self?{}:self.OpModules||{};p.UserAgent={"Parse User Agent":f};t.default=p},18:function(e,t,r){"use strict";r.d(t,"b",function(){return i}),r.d(t,"a",function(){return u});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;if(!e)return"";t=n.a.charRep(t);for(var i="",u=0;u<e.length;u++)i+=e[u].toString(2).padStart(r,"0")+t;return t.length?i.slice(0,-t.length):i}function u(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.a.regexRep(t);e=e.replace(i,"");for(var u=[],o=0;o<e.length;o+=r)u.push(parseInt(e.substr(o,r),2));return u}},19: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.a.charRep(t);var r=[],i=e.split(t);""===i[i.length-1]&&(i=i.slice(0,i.length-1));for(var u=0;u<i.length;u++)r[u]=parseInt(i[u],10);return r}},4:function(e,t,r){var n;!function(i){"use strict";var u,o=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,a=Math.ceil,s=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],v=1e7,g=1e9;function y(e){var t=0|e;return e>0||e===t?t:t-1}function w(e){for(var t,r,n=1,i=e.length,u=e[0]+"";n<i;){for(t=e[n++]+"",r=p-t.length;r--;t="0"+t);u+=t}for(i=u.length;48===u.charCodeAt(--i););return u.slice(0,i+1||1)}function m(e,t){var r,n,i=e.c,u=t.c,o=e.s,a=t.s,s=e.e,c=t.e;if(!o||!a)return null;if(r=i&&!i[0],n=u&&!u[0],r||n)return r?n?0:-a:o;if(o!=a)return o;if(r=o<0,n=s==c,!i||!u)return n?0:!i^r?1:-1;if(!n)return s>c^r?1:-1;for(a=(s=i.length)<(c=u.length)?s:c,o=0;o<a;o++)if(i[o]!=u[o])return i[o]>u[o]^r?1:-1;return s==c?0:s>c^r?1:-1}function b(e,t,r,n){if(e<t||e>r||e!==(e<0?a(e):s(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 A(e){var t=e.c.length-1;return y(e.e/p)==t&&e.c[t]%2!=0}function F(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function E(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}(u=function e(t){var r,n,i,u,B,C,k,D,x,S=G.prototype={constructor:G,toString:null,valueOf:null},R=new G(1),T=20,N=4,O=-7,_=21,L=-1e7,I=1e7,U=!1,M=1,P=0,j={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},z="0123456789abcdefghijklmnopqrstuvwxyz";function G(e,t){var r,u,a,c,f,d,v,g,y=this;if(!(y instanceof G))return new G(e,t);if(null==t){if(e instanceof G)return y.s=e.s,y.e=e.e,void(y.c=(e=e.c)?e.slice():e);if((d="number"==typeof e)&&0*e==0){if(y.s=1/e<0?(e=-e,-1):1,e===~~e){for(c=0,f=e;f>=10;f/=10,c++);return y.e=c,void(y.c=[e])}g=String(e)}else{if(g=String(e),!o.test(g))return i(y,g,d);y.s=45==g.charCodeAt(0)?(g=g.slice(1),-1):1}(c=g.indexOf("."))>-1&&(g=g.replace(".","")),(f=g.search(/e/i))>0?(c<0&&(c=f),c+=+g.slice(f+1),g=g.substring(0,f)):c<0&&(c=g.length)}else{if(b(t,2,z.length,"Base"),g=String(e),10==t)return Y(y=new G(e instanceof G?e:g),T+y.e+1,N);if(d="number"==typeof e){if(0*e!=0)return i(y,g,d,t);if(y.s=1/e<0?(g=g.slice(1),-1):1,G.DEBUG&&g.replace(/^0\.0*|\./,"").length>15)throw Error(l+e);d=!1}else y.s=45===g.charCodeAt(0)?(g=g.slice(1),-1):1;for(r=z.slice(0,t),c=f=0,v=g.length;f<v;f++)if(r.indexOf(u=g.charAt(f))<0){if("."==u){if(f>c){c=v;continue}}else if(!a&&(g==g.toUpperCase()&&(g=g.toLowerCase())||g==g.toLowerCase()&&(g=g.toUpperCase()))){a=!0,f=-1,c=0;continue}return i(y,String(e),d,t)}(c=(g=n(g,t,10,y.s)).indexOf("."))>-1?g=g.replace(".",""):c=g.length}for(f=0;48===g.charCodeAt(f);f++);for(v=g.length;48===g.charCodeAt(--v););if(g=g.slice(f,++v)){if(v-=f,d&&G.DEBUG&&v>15&&(e>h||e!==s(e)))throw Error(l+y.s*e);if((c=c-f-1)>I)y.c=y.e=null;else if(c<L)y.c=[y.e=0];else{if(y.e=c,y.c=[],f=(c+1)%p,c<0&&(f+=p),f<v){for(f&&y.c.push(+g.slice(0,f)),v-=p;f<v;)y.c.push(+g.slice(f,f+=p));g=g.slice(f),f=p-g.length}else f-=v;for(;f--;g+="0");y.c.push(+g)}}else y.c=[y.e=0]}function V(e,t,r,n){var i,u,o,a,s;if(null==r?r=N:b(r,0,8),!e.c)return e.toString();if(i=e.c[0],o=e.e,null==t)s=w(e.c),s=1==n||2==n&&(o<=O||o>=_)?F(s,o):E(s,o,"0");else if(u=(e=Y(new G(e),t,r)).e,a=(s=w(e.c)).length,1==n||2==n&&(t<=u||u<=O)){for(;a<t;s+="0",a++);s=F(s,u)}else if(t-=o,s=E(s,u,"0"),u+1>a){if(--t>0)for(s+=".";t--;s+="0");}else if((t+=u-a)>0)for(u+1==a&&(s+=".");t--;s+="0");return e.s<0&&i?"-"+s:s}function H(e,t){for(var r,n=1,i=new G(e[0]);n<e.length;n++){if(!(r=new G(e[n])).s){i=r;break}t.call(i,r)&&(i=r)}return i}function Z(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)>I?e.c=e.e=null:r<L?e.c=[e.e=0]:(e.e=r,e.c=t),e}function Y(e,t,r,n){var i,u,o,c,l,h,v,g=e.c,y=d;if(g){e:{for(i=1,c=g[0];c>=10;c/=10,i++);if((u=t-i)<0)u+=p,o=t,v=(l=g[h=0])/y[i-o-1]%10|0;else if((h=a((u+1)/p))>=g.length){if(!n)break e;for(;g.length<=h;g.push(0));l=v=0,i=1,o=(u%=p)-p+1}else{for(l=c=g[h],i=1;c>=10;c/=10,i++);v=(o=(u%=p)-p+i)<0?0:l/y[i-o-1]%10|0}if(n=n||t<0||null!=g[h+1]||(o<0?l:l%y[i-o-1]),n=r<4?(v||n)&&(0==r||r==(e.s<0?3:2)):v>5||5==v&&(4==r||n||6==r&&(u>0?o>0?l/y[i-o]:0:g[h-1])%10&1||r==(e.s<0?8:7)),t<1||!g[0])return g.length=0,n?(t-=e.e+1,g[0]=y[(p-t%p)%p],e.e=-t||0):g[0]=e.e=0,e;if(0==u?(g.length=h,c=1,h--):(g.length=h+1,c=y[p-u],g[h]=o>0?s(l/y[i-o]%y[o])*c:0),n)for(;;){if(0==h){for(u=1,o=g[0];o>=10;o/=10,u++);for(o=g[0]+=c,c=1;o>=10;o/=10,c++);u!=c&&(e.e++,g[0]==f&&(g[0]=1));break}if(g[h]+=c,g[h]!=f)break;g[h--]=0,c=1}for(u=g.length;0===g[--u];g.pop());}e.e>I?e.c=e.e=null:e.e<L&&(e.c=[e.e=0])}return e}function q(e){var t,r=e.e;return null===r?e.toString():(t=w(e.c),t=r<=O||r>=_?F(t,r):E(t,r,"0"),e.s<0?"-"+t:t)}return G.clone=e,G.ROUND_UP=0,G.ROUND_DOWN=1,G.ROUND_CEIL=2,G.ROUND_FLOOR=3,G.ROUND_HALF_UP=4,G.ROUND_HALF_DOWN=5,G.ROUND_HALF_EVEN=6,G.ROUND_HALF_CEIL=7,G.ROUND_HALF_FLOOR=8,G.EUCLID=9,G.config=G.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")&&(b(r=e[t],0,g,t),T=r),e.hasOwnProperty(t="ROUNDING_MODE")&&(b(r=e[t],0,8,t),N=r),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((r=e[t])&&r.pop?(b(r[0],-g,0,t),b(r[1],0,g,t),O=r[0],_=r[1]):(b(r,-g,g,t),O=-(_=r<0?-r:r))),e.hasOwnProperty(t="RANGE"))if((r=e[t])&&r.pop)b(r[0],-g,-1,t),b(r[1],1,g,t),L=r[0],I=r[1];else{if(b(r,-g,g,t),!r)throw Error(c+t+" cannot be zero: "+r);L=-(I=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 U=!r,Error(c+"crypto unavailable");U=r}else U=r}if(e.hasOwnProperty(t="MODULO_MODE")&&(b(r=e[t],0,9,t),M=r),e.hasOwnProperty(t="POW_PRECISION")&&(b(r=e[t],0,g,t),P=r),e.hasOwnProperty(t="FORMAT")){if("object"!=typeof(r=e[t]))throw Error(c+t+" not an object: "+r);j=r}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(r=e[t])||/^.$|[+-.\s]|(.).*\1/.test(r))throw Error(c+t+" invalid: "+r);z=r}}return{DECIMAL_PLACES:T,ROUNDING_MODE:N,EXPONENTIAL_AT:[O,_],RANGE:[L,I],CRYPTO:U,MODULO_MODE:M,POW_PRECISION:P,FORMAT:j,ALPHABET:z}},G.isBigNumber=function(e){return e instanceof G||e&&!0===e._isBigNumber||!1},G.maximum=G.max=function(){return H(arguments,S.lt)},G.minimum=G.min=function(){return H(arguments,S.gt)},G.random=(u=9007199254740992*Math.random()&2097151?function(){return s(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 G(R);if(null==e?e=T:b(e,0,g),i=a(e/p),U)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 U=!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(!U)for(;l<i;)(o=u())<9e15&&(f[l++]=o%1e14);for(i=f[--l],e%=p,i&&e&&(o=d[p-e],f[l]=s(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}),G.sum=function(){for(var e=1,t=arguments,r=new G(t[0]);e<t.length;)r=r.plus(t[e++]);return r},n=function(){function e(e,t,r,n){for(var i,u,o=[0],a=0,s=e.length;a<s;){for(u=o.length;u--;o[u]*=t);for(o[0]+=n.indexOf(e.charAt(a++)),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,u,o){var a,s,c,l,f,p,h,d,v=t.indexOf("."),g=T,y=N;for(v>=0&&(l=P,P=0,t=t.replace(".",""),p=(d=new G(n)).pow(t.length-v),P=l,d.c=e(E(w(p.c),p.e,"0"),10,i,"0123456789"),d.e=d.c.length),c=l=(h=e(t,n,i,o?(a=z,"0123456789"):(a="0123456789",z))).length;0==h[--l];h.pop());if(!h[0])return a.charAt(0);if(v<0?--c:(p.c=h,p.e=c,p.s=u,h=(p=r(p,d,g,y,i)).c,f=p.r,c=p.e),v=h[s=c+g+1],l=i/2,f=f||s<0||null!=h[s+1],f=y<4?(null!=v||f)&&(0==y||y==(p.s<0?3:2)):v>l||v==l&&(4==y||f||6==y&&1&h[s-1]||y==(p.s<0?8:7)),s<1||!h[0])t=f?E(a.charAt(1),-g,a.charAt(0)):a.charAt(0);else{if(h.length=s,f)for(--i;++h[--s]>i;)h[s]=0,s||(++c,h=[1].concat(h));for(l=h.length;!h[--l];);for(v=0,t="";v<=l;t+=a.charAt(h[v++]));t=E(t,c,a.charAt(0))}return t}}(),r=function(){function e(e,t,r){var n,i,u,o,a=0,s=e.length,c=t%v,l=t/v|0;for(e=e.slice();s--;)a=((i=c*(u=e[s]%v)+(n=l*u+(o=e[s]/v|0)*c)%v*v+a)/r|0)+(n/v|0)+l*o,e[s]=i%r;return a&&(e=[a].concat(e)),e}function t(e,t,r,n){var i,u;if(r!=n)u=r>n?1:-1;else for(i=u=0;i<r;i++)if(e[i]!=t[i]){u=e[i]>t[i]?1:-1;break}return u}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,u,o,a){var c,l,h,d,v,g,w,m,b,A,F,E,B,C,k,D,x,S=n.s==i.s?1:-1,R=n.c,T=i.c;if(!(R&&R[0]&&T&&T[0]))return new G(n.s&&i.s&&(R?!T||R[0]!=T[0]:T)?R&&0==R[0]||!T?0*S:S/0:NaN);for(b=(m=new G(S)).c=[],S=u+(l=n.e-i.e)+1,a||(a=f,l=y(n.e/p)-y(i.e/p),S=S/p|0),h=0;T[h]==(R[h]||0);h++);if(T[h]>(R[h]||0)&&l--,S<0)b.push(1),d=!0;else{for(C=R.length,D=T.length,h=0,S+=2,(v=s(a/(T[0]+1)))>1&&(T=e(T,v,a),R=e(R,v,a),D=T.length,C=R.length),B=D,F=(A=R.slice(0,D)).length;F<D;A[F++]=0);x=T.slice(),x=[0].concat(x),k=T[0],T[1]>=a/2&&k++;do{if(v=0,(c=t(T,A,D,F))<0){if(E=A[0],D!=F&&(E=E*a+(A[1]||0)),(v=s(E/k))>1)for(v>=a&&(v=a-1),w=(g=e(T,v,a)).length,F=A.length;1==t(g,A,w,F);)v--,r(g,D<w?x:T,w,a),w=g.length,c=1;else 0==v&&(c=v=1),w=(g=T.slice()).length;if(w<F&&(g=[0].concat(g)),r(A,g,F,a),F=A.length,-1==c)for(;t(T,A,D,F)<1;)v++,r(A,D<F?x:T,F,a),F=A.length}else 0===c&&(v++,A=[0]);b[h++]=v,A[0]?A[F++]=R[B]||0:(A=[R[B]],F=1)}while((B++<C||null!=A[0])&&S--);d=null!=A[0],b[0]||b.splice(0,1)}if(a==f){for(h=1,S=b[0];S>=10;S/=10,h++);Y(m,u+(m.e=h+l*p-1)+1,o,d)}else m.e=l,m.r=+d;return m}}(),B=/^(-?)0([xbo])(?=\w[\w.]*$)/i,C=/^([^.]+)\.$/,k=/^\.([^.]+)$/,D=/^-?(Infinity|NaN)$/,x=/^\s*\+(?=[\w.])|^\s+|\s+$/g,i=function(e,t,r,n){var i,u=r?t:t.replace(x,"");if(D.test(u))e.s=isNaN(u)?null:u<0?-1:1,e.c=e.e=null;else{if(!r&&(u=u.replace(B,function(e,t,r){return i="x"==(r=r.toLowerCase())?16:"b"==r?2:8,n&&n!=i?e:t}),n&&(i=n,u=u.replace(C,"$1").replace(k,"0.$1")),t!=u))return new G(u,i);if(G.DEBUG)throw Error(c+"Not a"+(n?" base "+n:"")+" number: "+t);e.c=e.e=e.s=null}},S.absoluteValue=S.abs=function(){var e=new G(this);return e.s<0&&(e.s=1),e},S.comparedTo=function(e,t){return m(this,new G(e,t))},S.decimalPlaces=S.dp=function(e,t){var r,n,i,u=this;if(null!=e)return b(e,0,g),null==t?t=N:b(t,0,8),Y(new G(u),e+u.e+1,t);if(!(r=u.c))return null;if(n=((i=r.length-1)-y(this.e/p))*p,i=r[i])for(;i%10==0;i/=10,n--);return n<0&&(n=0),n},S.dividedBy=S.div=function(e,t){return r(this,new G(e,t),T,N)},S.dividedToIntegerBy=S.idiv=function(e,t){return r(this,new G(e,t),0,1)},S.exponentiatedBy=S.pow=function(e,t){var r,n,i,u,o,l,f,h,d=this;if((e=new G(e)).c&&!e.isInteger())throw Error(c+"Exponent not an integer: "+q(e));if(null!=t&&(t=new G(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 G(Math.pow(+q(d),o?2-A(e):+q(e))),t?h.mod(t):h;if(l=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new G(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 u=d.s<0&&A(e)?-0:0,d.e>-1&&(u=1/u),new G(l?1/u:u);P&&(u=a(P/p+2))}for(o?(r=new G(.5),l&&(e.s=1),f=A(e)):f=(i=Math.abs(+q(e)))%2,h=new G(R);;){if(f){if(!(h=h.times(d)).c)break;u?h.c.length>u&&(h.c.length=u):n&&(h=h.mod(t))}if(i){if(0===(i=s(i/2)))break;f=i%2}else if(Y(e=e.times(r),e.e+1,1),e.e>14)f=A(e);else{if(0==(i=+q(e)))break;f=i%2}d=d.times(d),u?d.c&&d.c.length>u&&(d.c.length=u):n&&(d=d.mod(t))}return n?h:(l&&(h=R.div(h)),t?h.mod(t):u?Y(h,P,N,void 0):h)},S.integerValue=function(e){var t=new G(this);return null==e?e=N:b(e,0,8),Y(t,t.e+1,e)},S.isEqualTo=S.eq=function(e,t){return 0===m(this,new G(e,t))},S.isFinite=function(){return!!this.c},S.isGreaterThan=S.gt=function(e,t){return m(this,new G(e,t))>0},S.isGreaterThanOrEqualTo=S.gte=function(e,t){return 1===(t=m(this,new G(e,t)))||0===t},S.isInteger=function(){return!!this.c&&y(this.e/p)>this.c.length-2},S.isLessThan=S.lt=function(e,t){return m(this,new G(e,t))<0},S.isLessThanOrEqualTo=S.lte=function(e,t){return-1===(t=m(this,new G(e,t)))||0===t},S.isNaN=function(){return!this.s},S.isNegative=function(){return this.s<0},S.isPositive=function(){return this.s>0},S.isZero=function(){return!!this.c&&0==this.c[0]},S.minus=function(e,t){var r,n,i,u,o=this,a=o.s;if(t=(e=new G(e,t)).s,!a||!t)return new G(NaN);if(a!=t)return e.s=-t,o.plus(e);var s=o.e/p,c=e.e/p,l=o.c,h=e.c;if(!s||!c){if(!l||!h)return l?(e.s=-t,e):new G(h?o:NaN);if(!l[0]||!h[0])return h[0]?(e.s=-t,e):new G(l[0]?o:3==N?-0:0)}if(s=y(s),c=y(c),l=l.slice(),a=s-c){for((u=a<0)?(a=-a,i=l):(c=s,i=h),i.reverse(),t=a;t--;i.push(0));i.reverse()}else for(n=(u=(a=l.length)<(t=h.length))?a:t,a=t=0;t<n;t++)if(l[t]!=h[t]){u=l[t]<h[t];break}if(u&&(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>a;){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]?Z(e,l,c):(e.s=3==N?-1:1,e.c=[e.e=0],e)},S.modulo=S.mod=function(e,t){var n,i,u=this;return e=new G(e,t),!u.c||!e.s||e.c&&!e.c[0]?new G(NaN):!e.c||u.c&&!u.c[0]?new G(u):(9==M?(i=e.s,e.s=1,n=r(u,e,0,3),e.s=i,n.s*=i):n=r(u,e,0,M),(e=u.minus(n.times(e))).c[0]||1!=M||(e.s=u.s),e)},S.multipliedBy=S.times=function(e,t){var r,n,i,u,o,a,s,c,l,h,d,g,w,m,b,A=this,F=A.c,E=(e=new G(e,t)).c;if(!(F&&E&&F[0]&&E[0]))return!A.s||!e.s||F&&!F[0]&&!E||E&&!E[0]&&!F?e.c=e.e=e.s=null:(e.s*=A.s,F&&E?(e.c=[0],e.e=0):e.c=e.e=null),e;for(n=y(A.e/p)+y(e.e/p),e.s*=A.s,(s=F.length)<(h=E.length)&&(w=F,F=E,E=w,i=s,s=h,h=i),i=s+h,w=[];i--;w.push(0));for(m=f,b=v,i=h;--i>=0;){for(r=0,d=E[i]%b,g=E[i]/b|0,u=i+(o=s);u>i;)r=((c=d*(c=F[--o]%b)+(a=g*c+(l=F[o]/b|0)*d)%b*b+w[u]+r)/m|0)+(a/b|0)+g*l,w[u--]=c%m;w[u]=r}return r?++n:w.splice(0,1),Z(e,w,n)},S.negated=function(){var e=new G(this);return e.s=-e.s||null,e},S.plus=function(e,t){var r,n=this,i=n.s;if(t=(e=new G(e,t)).s,!i||!t)return new G(NaN);if(i!=t)return e.s=-t,n.minus(e);var u=n.e/p,o=e.e/p,a=n.c,s=e.c;if(!u||!o){if(!a||!s)return new G(i/0);if(!a[0]||!s[0])return s[0]?e:new G(a[0]?n:0*i)}if(u=y(u),o=y(o),a=a.slice(),i=u-o){for(i>0?(o=u,r=s):(i=-i,r=a),r.reverse();i--;r.push(0));r.reverse()}for((i=a.length)-(t=s.length)<0&&(r=s,s=a,a=r,t=i),i=0;t;)i=(a[--t]=a[t]+s[t]+i)/f|0,a[t]=f===a[t]?0:a[t]%f;return i&&(a=[i].concat(a),++o),Z(e,a,o)},S.precision=S.sd=function(e,t){var r,n,i,u=this;if(null!=e&&e!==!!e)return b(e,1,g),null==t?t=N:b(t,0,8),Y(new G(u),e,t);if(!(r=u.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&&u.e+1>n&&(n=u.e+1),n},S.shiftedBy=function(e){return b(e,-h,h),this.times("1e"+e)},S.squareRoot=S.sqrt=function(){var e,t,n,i,u,o=this,a=o.c,s=o.s,c=o.e,l=T+4,f=new G("0.5");if(1!==s||!a||!a[0])return new G(!s||s<0&&(!a||a[0])?NaN:a?o:1/0);if(0==(s=Math.sqrt(+q(o)))||s==1/0?(((t=w(a)).length+c)%2==0&&(t+="0"),s=Math.sqrt(+t),c=y((c+1)/2)-(c<0||c%2),n=new G(t=s==1/0?"1e"+c:(t=s.toExponential()).slice(0,t.indexOf("e")+1)+c)):n=new G(s+""),n.c[0])for((s=(c=n.e)+l)<3&&(s=0);;)if(u=n,n=f.times(u.plus(r(o,u,l,1))),w(u.c).slice(0,s)===(t=w(n.c)).slice(0,s)){if(n.e<c&&--s,"9999"!=(t=t.slice(s-3,s+1))&&(i||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(Y(n,n.e+T+2,1),e=!n.times(n).eq(o));break}if(!i&&(Y(u,u.e+T+2,0),u.times(u).eq(o))){n=u;break}l+=4,s+=4,i=1}return Y(n,n.e+T+1,N,e)},S.toExponential=function(e,t){return null!=e&&(b(e,0,g),e++),V(this,e,t,1)},S.toFixed=function(e,t){return null!=e&&(b(e,0,g),e=e+this.e+1),V(this,e,t)},S.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=j;else if("object"!=typeof r)throw Error(c+"Argument not an object: "+r);if(n=i.toFixed(e,t),i.c){var u,o=n.split("."),a=+r.groupSize,s=+r.secondaryGroupSize,l=r.groupSeparator||"",f=o[0],p=o[1],h=i.s<0,d=h?f.slice(1):f,v=d.length;if(s&&(u=a,a=s,s=u,v-=u),a>0&&v>0){for(u=v%a||a,f=d.substr(0,u);u<v;u+=a)f+=l+d.substr(u,a);s>0&&(f+=l+d.slice(u)),h&&(f="-"+f)}n=p?f+(r.decimalSeparator||"")+((s=+r.fractionGroupSize)?p.replace(new RegExp("\\d{"+s+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):p):f}return(r.prefix||"")+n+(r.suffix||"")},S.toFraction=function(e){var t,n,i,u,o,a,s,l,f,h,v,g,y=this,m=y.c;if(null!=e&&(!(s=new G(e)).isInteger()&&(s.c||1!==s.s)||s.lt(R)))throw Error(c+"Argument "+(s.isInteger()?"out of range: ":"not an integer: ")+q(s));if(!m)return new G(y);for(t=new G(R),f=n=new G(R),i=l=new G(R),g=w(m),o=t.e=g.length-y.e-1,t.c[0]=d[(a=o%p)<0?p+a:a],e=!e||s.comparedTo(t)>0?o>0?t:f:s,a=I,I=1/0,s=new G(g),l.c[0]=0;h=r(s,t,0,1),1!=(u=n.plus(h.times(i))).comparedTo(e);)n=i,i=u,f=l.plus(h.times(u=f)),l=u,t=s.minus(h.times(u=t)),s=u;return u=r(e.minus(n),i,0,1),l=l.plus(u.times(f)),n=n.plus(u.times(i)),l.s=f.s=y.s,v=r(f,i,o*=2,N).minus(y).abs().comparedTo(r(l,n,o,N).minus(y).abs())<1?[f,i]:[l,n],I=a,v},S.toNumber=function(){return+q(this)},S.toPrecision=function(e,t){return null!=e&&b(e,1,g),V(this,e,t,2)},S.toString=function(e){var t,r=this,i=r.s,u=r.e;return null===u?i?(t="Infinity",i<0&&(t="-"+t)):t="NaN":(null==e?t=u<=O||u>=_?F(w(r.c),u):E(w(r.c),u,"0"):10===e?t=E(w((r=Y(new G(r),T+u+1,N)).c),r.e,"0"):(b(e,2,z.length,"Base"),t=n(E(w(r.c),u,"0"),10,e,i,!0)),i<0&&r.c[0]&&(t="-"+t)),t},S.valueOf=S.toJSON=function(){return q(this)},S._isBigNumber=!0,"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator&&(S[Symbol.toStringTag]="BigNumber",S[Symbol.for("nodejs.util.inspect.custom")]=S.valueOf),null!=t&&G.set(t),G}()).default=u.BigNumber=u,void 0===(n=function(){return u}.call(t,r,t,e))||(e.exports=n)}()},499:function(e,t){(function(t){e.exports=t}).call(this,{})},7:function(e,t,r){"use strict";r.d(t,"d",function(){return i}),r.d(t,"e",function(){return u}),r.d(t,"c",function(){return o}),r.d(t,"b",function(){return a}),r.d(t,"a",function(){return s});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;if(!e)return"";for(var n="",i=0;i<e.length;i++)n+=e[i].toString(16).padStart(r,"0")+t;return"0x"===t&&(n="0x"+n),"\\x"===t&&(n="\\x"+n),t.length?n.slice(0,-t.length):n}function u(e){if(!e)return"";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]/gi:n.a.regexRep(t);e=e.replace(i,"")}for(var u=[],o=0;o<e.length;o+=r)u.push(parseInt(e.substr(o,r),16));return u}var a=["Space","Comma","Semi-colon","Colon","Line feed","CRLF","0x","\\x","None"],s=["Auto"].concat(a)},793:function(e,t,r){var n;
/*!
* UAParser.js v0.7.19
* Lightweight JavaScript-based User-Agent string parser
* https://github.com/faisalman/ua-parser-js
*
* Copyright © 2012-2016 Faisal Salman <fyzlman@gmail.com>
* Dual licensed under GPLv2 or MIT
*/
/*!
* UAParser.js v0.7.19
* Lightweight JavaScript-based User-Agent string parser
* https://github.com/faisalman/ua-parser-js
*
* Copyright © 2012-2016 Faisal Salman <fyzlman@gmail.com>
* Dual licensed under GPLv2 or MIT
*/
!function(i,u){"use strict";var o="model",a="name",s="type",c="vendor",l="version",f="mobile",p="tablet",h={extend:function(e,t){var r={};for(var n in e)t[n]&&t[n].length%2==0?r[n]=t[n].concat(e[n]):r[n]=e[n];return r},has:function(e,t){return"string"==typeof e&&-1!==t.toLowerCase().indexOf(e.toLowerCase())},lowerize:function(e){return e.toLowerCase()},major:function(e){return"string"==typeof e?e.replace(/[^\d\.]/g,"").split(".")[0]:void 0},trim:function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},d={rgx:function(e,t){for(var r,n,i,u,o,a,s=0;s<t.length&&!o;){var c=t[s],l=t[s+1];for(r=n=0;r<c.length&&!o;)if(o=c[r++].exec(e))for(i=0;i<l.length;i++)a=o[++n],"object"==typeof(u=l[i])&&u.length>0?2==u.length?"function"==typeof u[1]?this[u[0]]=u[1].call(this,a):this[u[0]]=u[1]:3==u.length?"function"!=typeof u[1]||u[1].exec&&u[1].test?this[u[0]]=a?a.replace(u[1],u[2]):void 0:this[u[0]]=a?u[1].call(this,a,u[2]):void 0:4==u.length&&(this[u[0]]=a?u[3].call(this,a.replace(u[1],u[2])):void 0):this[u]=a||void 0;s+=2}},str:function(e,t){for(var r in t)if("object"==typeof t[r]&&t[r].length>0){for(var n=0;n<t[r].length;n++)if(h.has(t[r][n],e))return"?"===r?void 0:r}else if(h.has(t[r],e))return"?"===r?void 0:r;return e}},v={browser:{oldsafari:{version:{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}}},device:{amazon:{model:{"Fire Phone":["SD","KF"]}},sprint:{model:{"Evo Shift 4G":"7373KT"},vendor:{HTC:"APA",Sprint:"Sprint"}}},os:{windows:{version:{ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2000:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"}}}},g={browser:[[/(opera\smini)\/([\w\.-]+)/i,/(opera\s[mobiletab]+).+version\/([\w\.-]+)/i,/(opera).+version\/([\w\.]+)/i,/(opera)[\/\s]+([\w\.]+)/i],[a,l],[/(opios)[\/\s]+([\w\.]+)/i],[[a,"Opera Mini"],l],[/\s(opr)\/([\w\.]+)/i],[[a,"Opera"],l],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?([\w\.]*)/i,/(avant\s|iemobile|slim|baidu)(?:browser)?[\/\s]?([\w\.]*)/i,/(?:ms|\()(ie)\s([\w\.]+)/i,/(rekonq)\/([\w\.]*)/i,/(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark)\/([\w\.-]+)/i],[a,l],[/(trident).+rv[:\s]([\w\.]+).+like\sgecko/i],[[a,"IE"],l],[/(edge|edgios|edga)\/((\d+)?[\w\.]+)/i],[[a,"Edge"],l],[/(yabrowser)\/([\w\.]+)/i],[[a,"Yandex"],l],[/(puffin)\/([\w\.]+)/i],[[a,"Puffin"],l],[/(focus)\/([\w\.]+)/i],[[a,"Firefox Focus"],l],[/(opt)\/([\w\.]+)/i],[[a,"Opera Touch"],l],[/((?:[\s\/])uc?\s?browser|(?:juc.+)ucweb)[\/\s]?([\w\.]+)/i],[[a,"UCBrowser"],l],[/(comodo_dragon)\/([\w\.]+)/i],[[a,/_/g," "],l],[/(micromessenger)\/([\w\.]+)/i],[[a,"WeChat"],l],[/(brave)\/([\w\.]+)/i],[[a,"Brave"],l],[/(qqbrowserlite)\/([\w\.]+)/i],[a,l],[/(QQ)\/([\d\.]+)/i],[a,l],[/m?(qqbrowser)[\/\s]?([\w\.]+)/i],[a,l],[/(BIDUBrowser)[\/\s]?([\w\.]+)/i],[a,l],[/(2345Explorer)[\/\s]?([\w\.]+)/i],[a,l],[/(MetaSr)[\/\s]?([\w\.]+)/i],[a],[/(LBBROWSER)/i],[a],[/xiaomi\/miuibrowser\/([\w\.]+)/i],[l,[a,"MIUI Browser"]],[/;fbav\/([\w\.]+);/i],[l,[a,"Facebook"]],[/safari\s(line)\/([\w\.]+)/i,/android.+(line)\/([\w\.]+)\/iab/i],[a,l],[/headlesschrome(?:\/([\w\.]+)|\s)/i],[l,[a,"Chrome Headless"]],[/\swv\).+(chrome)\/([\w\.]+)/i],[[a,/(.+)/,"$1 WebView"],l],[/((?:oculus|samsung)browser)\/([\w\.]+)/i],[[a,/(.+(?:g|us))(.+)/,"$1 $2"],l],[/android.+version\/([\w\.]+)\s+(?:mobile\s?safari|safari)*/i],[l,[a,"Android Browser"]],[/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?([\w\.]+)/i],[a,l],[/(dolfin)\/([\w\.]+)/i],[[a,"Dolphin"],l],[/((?:android.+)crmo|crios)\/([\w\.]+)/i],[[a,"Chrome"],l],[/(coast)\/([\w\.]+)/i],[[a,"Opera Coast"],l],[/fxios\/([\w\.-]+)/i],[l,[a,"Firefox"]],[/version\/([\w\.]+).+?mobile\/\w+\s(safari)/i],[l,[a,"Mobile Safari"]],[/version\/([\w\.]+).+?(mobile\s?safari|safari)/i],[l,a],[/webkit.+?(gsa)\/([\w\.]+).+?(mobile\s?safari|safari)(\/[\w\.]+)/i],[[a,"GSA"],l],[/webkit.+?(mobile\s?safari|safari)(\/[\w\.]+)/i],[a,[l,d.str,v.browser.oldsafari.version]],[/(konqueror)\/([\w\.]+)/i,/(webkit|khtml)\/([\w\.]+)/i],[a,l],[/(navigator|netscape)\/([\w\.-]+)/i],[[a,"Netscape"],l],[/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?([\w\.\+]+)/i,/(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([\w\.-]+)$/i,/(mozilla)\/([\w\.]+).+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir)[\/\s]?([\w\.]+)/i,/(links)\s\(([\w\.]+)/i,/(gobrowser)\/?([\w\.]*)/i,/(ice\s?browser)\/v?([\w\._]+)/i,/(mosaic)[\/\s]([\w\.]+)/i],[a,l]],cpu:[[/(?:(amd|x(?:(?:86|64)[_-])?|wow|win)64)[;\)]/i],[["architecture","amd64"]],[/(ia32(?=;))/i],[["architecture",h.lowerize]],[/((?:i[346]|x)86)[;\)]/i],[["architecture","ia32"]],[/windows\s(ce|mobile);\sppc;/i],[["architecture","arm"]],[/((?:ppc|powerpc)(?:64)?)(?:\smac|;|\))/i],[["architecture",/ower/,"",h.lowerize]],[/(sun4\w)[;\)]/i],[["architecture","sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|arm(?:64|(?=v\d+[;l]))|(?=atmel\s)avr|(?:irix|mips|sparc)(?:64)?(?=;)|pa-risc)/i],[["architecture",h.lowerize]]],device:[[/\((ipad|playbook);[\w\s\);-]+(rim|apple)/i],[o,c,[s,p]],[/applecoremedia\/[\w\.]+ \((ipad)/],[o,[c,"Apple"],[s,p]],[/(apple\s{0,1}tv)/i],[[o,"Apple TV"],[c,"Apple"]],[/(archos)\s(gamepad2?)/i,/(hp).+(touchpad)/i,/(hp).+(tablet)/i,/(kindle)\/([\w\.]+)/i,/\s(nook)[\w\s]+build\/(\w+)/i,/(dell)\s(strea[kpr\s\d]*[\dko])/i],[c,o,[s,p]],[/(kf[A-z]+)\sbuild\/.+silk\//i],[o,[c,"Amazon"],[s,p]],[/(sd|kf)[0349hijorstuw]+\sbuild\/.+silk\//i],[[o,d.str,v.device.amazon.model],[c,"Amazon"],[s,f]],[/android.+aft([bms])\sbuild/i],[o,[c,"Amazon"],[s,"smarttv"]],[/\((ip[honed|\s\w*]+);.+(apple)/i],[o,c,[s,f]],[/\((ip[honed|\s\w*]+);/i],[o,[c,"Apple"],[s,f]],[/(blackberry)[\s-]?(\w+)/i,/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[\s_-]?([\w-]*)/i,/(hp)\s([\w\s]+\w)/i,/(asus)-?(\w+)/i],[c,o,[s,f]],[/\(bb10;\s(\w+)/i],[o,[c,"BlackBerry"],[s,f]],[/android.+(transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+|nexus 7|padfone)/i],[o,[c,"Asus"],[s,p]],[/(sony)\s(tablet\s[ps])\sbuild\//i,/(sony)?(?:sgp.+)\sbuild\//i],[[c,"Sony"],[o,"Xperia Tablet"],[s,p]],[/android.+\s([c-g]\d{4}|so[-l]\w+)\sbuild\//i],[o,[c,"Sony"],[s,f]],[/\s(ouya)\s/i,/(nintendo)\s([wids3u]+)/i],[c,o,[s,"console"]],[/android.+;\s(shield)\sbuild/i],[o,[c,"Nvidia"],[s,"console"]],[/(playstation\s[34portablevi]+)/i],[o,[c,"Sony"],[s,"console"]],[/(sprint\s(\w+))/i],[[c,d.str,v.device.sprint.vendor],[o,d.str,v.device.sprint.model],[s,f]],[/(lenovo)\s?(S(?:5000|6000)+(?:[-][\w+]))/i],[c,o,[s,p]],[/(htc)[;_\s-]+([\w\s]+(?=\))|\w+)*/i,/(zte)-(\w*)/i,/(alcatel|geeksphone|lenovo|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]*)/i],[c,[o,/_/g," "],[s,f]],[/(nexus\s9)/i],[o,[c,"HTC"],[s,p]],[/d\/huawei([\w\s-]+)[;\)]/i,/(nexus\s6p)/i],[o,[c,"Huawei"],[s,f]],[/(microsoft);\s(lumia[\s\w]+)/i],[c,o,[s,f]],[/[\s\(;](xbox(?:\sone)?)[\s\);]/i],[o,[c,"Microsoft"],[s,"console"]],[/(kin\.[onetw]{3})/i],[[o,/\./g," "],[c,"Microsoft"],[s,f]],[/\s(milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?:?(\s4g)?)[\w\s]+build\//i,/mot[\s-]?(\w*)/i,/(XT\d{3,4}) build\//i,/(nexus\s6)/i],[o,[c,"Motorola"],[s,f]],[/android.+\s(mz60\d|xoom[\s2]{0,2})\sbuild\//i],[o,[c,"Motorola"],[s,p]],[/hbbtv\/\d+\.\d+\.\d+\s+\([\w\s]*;\s*(\w[^;]*);([^;]*)/i],[[c,h.trim],[o,h.trim],[s,"smarttv"]],[/hbbtv.+maple;(\d+)/i],[[o,/^/,"SmartTV"],[c,"Samsung"],[s,"smarttv"]],[/\(dtv[\);].+(aquos)/i],[o,[c,"Sharp"],[s,"smarttv"]],[/android.+((sch-i[89]0\d|shw-m380s|gt-p\d{4}|gt-n\d+|sgh-t8[56]9|nexus 10))/i,/((SM-T\w+))/i],[[c,"Samsung"],o,[s,p]],[/smart-tv.+(samsung)/i],[c,[s,"smarttv"],o],[/((s[cgp]h-\w+|gt-\w+|galaxy\snexus|sm-\w[\w\d]+))/i,/(sam[sung]*)[\s-]*(\w+-?[\w-]*)/i,/sec-((sgh\w+))/i],[[c,"Samsung"],o,[s,f]],[/sie-(\w*)/i],[o,[c,"Siemens"],[s,f]],[/(maemo|nokia).*(n900|lumia\s\d+)/i,/(nokia)[\s_-]?([\w-]*)/i],[[c,"Nokia"],o,[s,f]],[/android\s3\.[\s\w;-]{10}(a\d{3})/i],[o,[c,"Acer"],[s,p]],[/android.+([vl]k\-?\d{3})\s+build/i],[o,[c,"LG"],[s,p]],[/android\s3\.[\s\w;-]{10}(lg?)-([06cv9]{3,4})/i],[[c,"LG"],o,[s,p]],[/(lg) netcast\.tv/i],[c,o,[s,"smarttv"]],[/(nexus\s[45])/i,/lg[e;\s\/-]+(\w*)/i,/android.+lg(\-?[\d\w]+)\s+build/i],[o,[c,"LG"],[s,f]],[/android.+(ideatab[a-z0-9\-\s]+)/i],[o,[c,"Lenovo"],[s,p]],[/linux;.+((jolla));/i],[c,o,[s,f]],[/((pebble))app\/[\d\.]+\s/i],[c,o,[s,"wearable"]],[/android.+;\s(oppo)\s?([\w\s]+)\sbuild/i],[c,o,[s,f]],[/crkey/i],[[o,"Chromecast"],[c,"Google"]],[/android.+;\s(glass)\s\d/i],[o,[c,"Google"],[s,"wearable"]],[/android.+;\s(pixel c)[\s)]/i],[o,[c,"Google"],[s,p]],[/android.+;\s(pixel( [23])?( xl)?)\s/i],[o,[c,"Google"],[s,f]],[/android.+;\s(\w+)\s+build\/hm\1/i,/android.+(hm[\s\-_]*note?[\s_]*(?:\d\w)?)\s+build/i,/android.+(mi[\s\-_]*(?:one|one[\s_]plus|note lte)?[\s_]*(?:\d?\w?)[\s_]*(?:plus)?)\s+build/i,/android.+(redmi[\s\-_]*(?:note)?(?:[\s_]*[\w\s]+))\s+build/i],[[o,/_/g," "],[c,"Xiaomi"],[s,f]],[/android.+(mi[\s\-_]*(?:pad)(?:[\s_]*[\w\s]+))\s+build/i],[[o,/_/g," "],[c,"Xiaomi"],[s,p]],[/android.+;\s(m[1-5]\snote)\sbuild/i],[o,[c,"Meizu"],[s,p]],[/(mz)-([\w-]{2,})/i],[[c,"Meizu"],o,[s,f]],[/android.+a000(1)\s+build/i,/android.+oneplus\s(a\d{4})\s+build/i],[o,[c,"OnePlus"],[s,f]],[/android.+[;\/]\s*(RCT[\d\w]+)\s+build/i],[o,[c,"RCA"],[s,p]],[/android.+[;\/\s]+(Venue[\d\s]{2,7})\s+build/i],[o,[c,"Dell"],[s,p]],[/android.+[;\/]\s*(Q[T|M][\d\w]+)\s+build/i],[o,[c,"Verizon"],[s,p]],[/android.+[;\/]\s+(Barnes[&\s]+Noble\s+|BN[RT])(V?.*)\s+build/i],[[c,"Barnes & Noble"],o,[s,p]],[/android.+[;\/]\s+(TM\d{3}.*\b)\s+build/i],[o,[c,"NuVision"],[s,p]],[/android.+;\s(k88)\sbuild/i],[o,[c,"ZTE"],[s,p]],[/android.+[;\/]\s*(gen\d{3})\s+build.*49h/i],[o,[c,"Swiss"],[s,f]],[/android.+[;\/]\s*(zur\d{3})\s+build/i],[o,[c,"Swiss"],[s,p]],[/android.+[;\/]\s*((Zeki)?TB.*\b)\s+build/i],[o,[c,"Zeki"],[s,p]],[/(android).+[;\/]\s+([YR]\d{2})\s+build/i,/android.+[;\/]\s+(Dragon[\-\s]+Touch\s+|DT)(\w{5})\sbuild/i],[[c,"Dragon Touch"],o,[s,p]],[/android.+[;\/]\s*(NS-?\w{0,9})\sbuild/i],[o,[c,"Insignia"],[s,p]],[/android.+[;\/]\s*((NX|Next)-?\w{0,9})\s+build/i],[o,[c,"NextBook"],[s,p]],[/android.+[;\/]\s*(Xtreme\_)?(V(1[045]|2[015]|30|40|60|7[05]|90))\s+build/i],[[c,"Voice"],o,[s,f]],[/android.+[;\/]\s*(LVTEL\-)?(V1[12])\s+build/i],[[c,"LvTel"],o,[s,f]],[/android.+;\s(PH-1)\s/i],[o,[c,"Essential"],[s,f]],[/android.+[;\/]\s*(V(100MD|700NA|7011|917G).*\b)\s+build/i],[o,[c,"Envizen"],[s,p]],[/android.+[;\/]\s*(Le[\s\-]+Pan)[\s\-]+(\w{1,9})\s+build/i],[c,o,[s,p]],[/android.+[;\/]\s*(Trio[\s\-]*.*)\s+build/i],[o,[c,"MachSpeed"],[s,p]],[/android.+[;\/]\s*(Trinity)[\-\s]*(T\d{3})\s+build/i],[c,o,[s,p]],[/android.+[;\/]\s*TU_(1491)\s+build/i],[o,[c,"Rotor"],[s,p]],[/android.+(KS(.+))\s+build/i],[o,[c,"Amazon"],[s,p]],[/android.+(Gigaset)[\s\-]+(Q\w{1,9})\s+build/i],[c,o,[s,p]],[/\s(tablet|tab)[;\/]/i,/\s(mobile)(?:[;\/]|\ssafari)/i],[[s,h.lowerize],c,o],[/(android[\w\.\s\-]{0,9});.+build/i],[o,[c,"Generic"]]],engine:[[/windows.+\sedge\/([\w\.]+)/i],[l,[a,"EdgeHTML"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m)\/([\w\.]+)/i,/(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i,/(icab)[\/\s]([23]\.[\d\.]+)/i],[a,l],[/rv\:([\w\.]{1,9}).+(gecko)/i],[l,a]],os:[[/microsoft\s(windows)\s(vista|xp)/i],[a,l],[/(windows)\snt\s6\.2;\s(arm)/i,/(windows\sphone(?:\sos)*)[\s\/]?([\d\.\s\w]*)/i,/(windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i],[a,[l,d.str,v.os.windows.version]],[/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i],[[a,"Windows"],[l,d.str,v.os.windows.version]],[/\((bb)(10);/i],[[a,"BlackBerry"],l],[/(blackberry)\w*\/?([\w\.]*)/i,/(tizen)[\/\s]([\w\.]+)/i,/(android|webos|palm\sos|qnx|bada|rim\stablet\sos|meego|contiki)[\/\s-]?([\w\.]*)/i,/linux;.+(sailfish);/i],[a,l],[/(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]*)/i],[[a,"Symbian"],l],[/\((series40);/i],[a],[/mozilla.+\(mobile;.+gecko.+firefox/i],[[a,"Firefox OS"],l],[/(nintendo|playstation)\s([wids34portablevu]+)/i,/(mint)[\/\s\(]?(\w*)/i,/(mageia|vectorlinux)[;\s]/i,/(joli|[kxln]?ubuntu|debian|suse|opensuse|gentoo|(?=\s)arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk|linpus)[\/\s-]?(?!chrom)([\w\.-]*)/i,/(hurd|linux)\s?([\w\.]*)/i,/(gnu)\s?([\w\.]*)/i],[a,l],[/(cros)\s[\w]+\s([\w\.]+\w)/i],[[a,"Chromium OS"],l],[/(sunos)\s?([\w\.\d]*)/i],[[a,"Solaris"],l],[/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]*)/i],[a,l],[/(haiku)\s(\w+)/i],[a,l],[/cfnetwork\/.+darwin/i,/ip[honead]{2,4}(?:.*os\s([\w]+)\slike\smac|;\sopera)/i],[[l,/_/g,"."],[a,"iOS"]],[/(mac\sos\sx)\s?([\w\s\.]*)/i,/(macintosh|mac(?=_powerpc)\s)/i],[[a,"Mac OS"],[l,/_/g,"."]],[/((?:open)?solaris)[\/\s-]?([\w\.]*)/i,/(aix)\s((\d)(?=\.|\)|\s)[\w\.])*/i,/(plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos|openvms|fuchsia)/i,/(unix)\s?([\w\.]*)/i],[a,l]]},y=function(e,t){if("object"==typeof e&&(t=e,e=void 0),!(this instanceof y))return new y(e,t).getResult();var r=e||(i&&i.navigator&&i.navigator.userAgent?i.navigator.userAgent:""),n=t?h.extend(g,t):g;return this.getBrowser=function(){var e={name:void 0,version:void 0};return d.rgx.call(e,r,n.browser),e.major=h.major(e.version),e},this.getCPU=function(){var e={architecture:void 0};return d.rgx.call(e,r,n.cpu),e},this.getDevice=function(){var e={vendor:void 0,model:void 0,type:void 0};return d.rgx.call(e,r,n.device),e},this.getEngine=function(){var e={name:void 0,version:void 0};return d.rgx.call(e,r,n.engine),e},this.getOS=function(){var e={name:void 0,version:void 0};return d.rgx.call(e,r,n.os),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return r},this.setUA=function(e){return r=e,this},this};y.VERSION="0.7.19",y.BROWSER={NAME:a,MAJOR:"major",VERSION:l},y.CPU={ARCHITECTURE:"architecture"},y.DEVICE={MODEL:o,VENDOR:c,TYPE:s,CONSOLE:"console",MOBILE:f,SMARTTV:"smarttv",TABLET:p,WEARABLE:"wearable",EMBEDDED:"embedded"},y.ENGINE={NAME:a,VERSION:l},y.OS={NAME:a,VERSION:l},void 0!==t?(void 0!==e&&e.exports&&(t=e.exports=y),t.UAParser=y):r(499)?void 0===(n=function(){return y}.call(t,r,t,e))||(e.exports=n):i&&(i.UAParser=y);var w=i&&(i.jQuery||i.Zepto);if(void 0!==w&&!w.ua){var m=new y;w.ua=m.getResult(),w.ua.get=function(){return m.getUA()},w.ua.set=function(e){m.setUA(e);var t=m.getResult();for(var r in t)w.ua[r]=t[r]}}}("object"==typeof window?window:this)},9:function(e,t,r){"use strict";var n=r(0),i=r(12),u=r(4),o=r.n(u),a=r(14),s=r.n(a);function c(e,t,r,n,i,u,o){try{var a=e[u](o),s=a.value}catch(e){return void r(e)}a.done?t(s):Promise.resolve(s).then(n,i)}function l(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var u=e.apply(t,r);function o(e){c(u,n,i,o,a,"next",e)}function a(e){c(u,n,i,o,a,"throw",e)}o(void 0)})}}function f(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)}}
/**
* @author n1474335 [n1474335@gmail.com]
* @author Matt C [matt@artemisbot.uk]
* @copyright Crown Copyright 2016
* @license Apache-2.0
*/
var p=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.value=[],this.type=e.BYTE_ARRAY,t&&t.hasOwnProperty("value")&&t.hasOwnProperty("type")&&this.set(t.value,t.type)}var t,r,u;return t=e,r=[{key:"set",value:function(t,r){if("string"==typeof r&&(r=e.typeEnum(r)),s.a.debug("Dish type: "+e.enumLookup(r)),this.value=t,this.type=r,!this.valid()){var u=n.a.truncate(JSON.stringify(this.value),13);throw new i.a("Data is not a valid ".concat(e.enumLookup(r),": ").concat(u))}}},{key:"get",value:function(){var t=l(regeneratorRuntime.mark(function t(r){var n,i=arguments;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(n=i.length>1&&void 0!==i[1]&&i[1],"string"==typeof r&&(r=e.typeEnum(r)),this.type===r){t.next=5;break}return t.next=5,this._translate(r,n);case 5:return t.abrupt("return",this.value);case 6:case"end":return t.stop()}},t,this)}));return function(e){return t.apply(this,arguments)}}()},{key:"_translate",value:function(){var t=l(regeneratorRuntime.mark(function t(r){var u,a,c=arguments;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:u=c.length>1&&void 0!==c[1]&&c[1],s.a.debug("Translating Dish from ".concat(e.enumLookup(this.type)," to ").concat(e.enumLookup(r))),a=u?n.a.byteArrayToChars:n.a.byteArrayToUtf8,t.prev=3,t.t0=this.type,t.next=t.t0===e.STRING?7:t.t0===e.NUMBER?9:t.t0===e.HTML?11:t.t0===e.ARRAY_BUFFER?13:t.t0===e.BIG_NUMBER?15:t.t0===e.JSON?17:t.t0===e.FILE?19:t.t0===e.LIST_FILE?24:30;break;case 7:return this.value=this.value?n.a.strToByteArray(this.value):[],t.abrupt("break",31);case 9:return this.value="number"==typeof this.value?n.a.strToByteArray(this.value.toString()):[],t.abrupt("break",31);case 11:return this.value=this.value?n.a.strToByteArray(n.a.unescapeHtml(n.a.stripHtmlTags(this.value,!0))):[],t.abrupt("break",31);case 13:return this.value=Array.prototype.slice.call(new Uint8Array(this.value)),t.abrupt("break",31);case 15:return this.value=o.a.isBigNumber(this.value)?n.a.strToByteArray(this.value.toFixed()):[],t.abrupt("break",31);case 17:return this.value=this.value?n.a.strToByteArray(JSON.stringify(this.value,null,4)):[],t.abrupt("break",31);case 19:return t.next=21,n.a.readFile(this.value);case 21:return this.value=t.sent,this.value=Array.prototype.slice.call(this.value),t.abrupt("break",31);case 24:return t.next=26,Promise.all(this.value.map(function(){var e=l(regeneratorRuntime.mark(function e(t){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",n.a.readFile(t));case 1:case"end":return e.stop()}},e,this)}));return function(t){return e.apply(this,arguments)}}()));case 26:return this.value=t.sent,this.value=this.value.map(function(e){return Array.prototype.slice.call(e)}),this.value=[].concat.apply([],this.value),t.abrupt("break",31);case 30:return t.abrupt("break",31);case 31:t.next=36;break;case 33:throw t.prev=33,t.t1=t.catch(3),new i.a("Error translating from ".concat(e.enumLookup(this.type)," to byteArray: ").concat(t.t1));case 36:this.type=e.BYTE_ARRAY,t.prev=37,t.t2=r,t.next=t.t2===e.STRING?41:t.t2===e.HTML?41:t.t2===e.NUMBER?44:t.t2===e.ARRAY_BUFFER?47:t.t2===e.BIG_NUMBER?50:t.t2===e.JSON?53:t.t2===e.FILE?56:t.t2===e.LIST_FILE?58:61;break;case 41:return this.value=this.value?a(this.value):"",this.type=e.STRING,t.abrupt("break",62);case 44:return this.value=this.value?parseFloat(a(this.value)):0,this.type=e.NUMBER,t.abrupt("break",62);case 47:return this.value=new Uint8Array(this.value).buffer,this.type=e.ARRAY_BUFFER,t.abrupt("break",62);case 50:try{this.value=new o.a(a(this.value))}catch(e){this.value=new o.a(NaN)}return this.type=e.BIG_NUMBER,t.abrupt("break",62);case 53:return this.value=JSON.parse(a(this.value)),this.type=e.JSON,t.abrupt("break",62);case 56:return this.value=new File(this.value,"unknown"),t.abrupt("break",62);case 58:return this.value=[new File(this.value,"unknown")],this.type=e.LIST_FILE,t.abrupt("break",62);case 61:return t.abrupt("break",62);case 62:t.next=67;break;case 64:throw t.prev=64,t.t3=t.catch(37),new i.a("Error translating from byteArray to ".concat(e.enumLookup(r),": ").concat(t.t3));case 67:case"end":return t.stop()}},t,this,[[3,33],[37,64]])}));return function(e){return t.apply(this,arguments)}}()},{key:"valid",value:function(){switch(this.type){case e.BYTE_ARRAY:if(!(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:return o.a.isBigNumber(this.value);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 i.a("Cannot clone Dish, unknown type")}return t}},{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}}}],u=[{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":return e.JSON;case"file":return e.FILE;case"list<file>":return e.LIST_FILE;default:throw new i.a("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 i.a("Invalid data type enum. No matching type.")}}}],r&&f(t.prototype,r),u&&f(t,u),e}();p.BYTE_ARRAY=0,p.STRING=1,p.NUMBER=2,p.HTML=3,p.ARRAY_BUFFER=4,p.BIG_NUMBER=5,p.JSON=6,p.FILE=7,p.LIST_FILE=8,t.a=p}});