132 lines
82 KiB
JavaScript
Executable File
132 lines
82 KiB
JavaScript
Executable File
/**
|
||
* 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 n(r){if(t[r])return t[r].exports;var u=t[r]={i:r,l:!1,exports:{}};return e[r].call(u.exports,u,u.exports,n),u.l=!0,u.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var u in e)n.d(r,u,function(t){return e[t]}.bind(null,u));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=1513)}({0:function(e,t,n){"use strict";var r=n(15),u=n.n(r),i=n(10),o=n(7),a=n(19),s=n(18);function l(e,t,n,r,u,i,o){try{var a=e[i](o),s=a.value}catch(e){return void n(e)}a.done?t(s):Promise.resolve(s).then(r,u)}function c(e){return function(){var t=this,n=arguments;return new Promise(function(r,u){var i=e.apply(t,n);function o(e){l(i,r,u,o,a,"next",e)}function a(e){l(i,r,u,o,a,"throw",e)}o(void 0)})}}function f(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}
|
||
/**
|
||
* @author n1474335 [n1474335@gmail.com]
|
||
* @copyright Crown Copyright 2016
|
||
* @license Apache-2.0
|
||
*/
|
||
var h=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n,r;return t=e,n=null,r=[{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),n=e.charCodeAt(1);if(t>=55296&&t<56320&&n>=56320&&n<57344)return 1024*(t-55296)+n-56320+65536}return e.charCodeAt(0)}},{key:"padBytesRight",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=new Array(t);return r.fill(n),Array.prototype.map.call(e,function(e,t){r[t]=e}),r}},{key:"truncate",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"...";return e.length>t&&(e=e.slice(0,t-n.length)+n),e}},{key:"hex",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return(t="string"==typeof t?e.ord(t):t).toString(16).padStart(n,"0")}},{key:"bin",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8;return(t="string"==typeof t?e.ord(t):t).toString(2).padStart(n,"0")}},{key:"printable",value:function(t){var n=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,"."),n||(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,n){if("\\"===t)return"\\"+n;switch(n[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(n.substr(1),16));case"u":return"{"===n[1]?String.fromCodePoint(parseInt(n.slice(2,-1),16)):String.fromCharCode(parseInt(n.substr(1),16))}})}},{key:"escapeRegex",value:function(e){return e.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}},{key:"expandAlphRange",value:function(t){for(var n=[],r=0;r<t.length;r++)if(r<t.length-2&&"-"===t[r+1]&&"\\"!==t[r]){for(var u=e.ord(t[r]),i=e.ord(t[r+2]),o=u;o<=i;o++)n.push(e.chr(o));r+=2}else r<t.length-2&&"\\"===t[r]&&"-"===t[r+1]?(n.push("-"),r++):n.push(t[r]);return n}},{key:"convertToByteArray",value:function(t,n){switch(n.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(i.b)(t,null,"byteArray");case"utf8":return e.strToUtf8ByteArray(t);case"latin1":default:return e.strToByteArray(t)}}},{key:"convertToByteString",value:function(t,n){switch(n.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(i.b)(t,null,"byteArray"));case"utf8":return u.a.encode(t);case"latin1":default:return t}}},{key:"strToByteArray",value:function(t){for(var n,r=new Array(t.length),u=t.length;u--;)if(n=t.charCodeAt(u),r[u]=n,n>255)return e.strToUtf8ByteArray(t);return r}},{key:"strToUtf8ByteArray",value:function(t){var n=u.a.encode(t);return t.length!==n.length&&("function"==typeof importScripts?self.setOption("attemptHighlight",!1):"object"==typeof window&&(window.app.options.attemptHighlight=!1)),e.strToByteArray(n)}},{key:"strToCharcode",value:function(t){for(var n=[],r=0;r<t.length;r++){var u=t.charCodeAt(r);if(r<t.length-1&&u>=55296&&u<56320){var i=t[r+1].charCodeAt(0);i>=56320&&i<57344&&(u=e.ord(t[r]+t[++r]))}n.push(u)}return n}},{key:"byteArrayToUtf8",value:function(t){var n=e.byteArrayToChars(t);try{var r=u.a.decode(n);return n.length!==r.length&&("function"==typeof importScripts?self.setOption("attemptHighlight",!1):"object"==typeof window&&(window.app.options.attemptHighlight=!1)),r}catch(e){return n}}},{key:"byteArrayToChars",value:function(e){if(!e)return"";for(var t="",n=0;n<e.length;)t+=String.fromCharCode(e[n++]);return t}},{key:"arrayBufferToStr",value:function(t){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=Array.prototype.slice.call(new Uint8Array(t));return n?e.byteArrayToUtf8(r):e.byteArrayToChars(r)}},{key:"parseCSV",value:function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[","],u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:["\n","\r"],i=!1,o=!1,a="",s=[],l=[];e.length&&"\ufeff"===e[0]&&(e=e.substr(1));for(var c=0;c<e.length;c++)t=e[c],n=e[c+1]||"",i?(a+=t,i=!1):'"'!==t||o?'"'===t&&o?'"'===n?i=!0:o=!1:!o&&r.indexOf(t)>=0?(s.push(a),a=""):!o&&u.indexOf(t)>=0?(s.push(a),a="",l.push(s),s=[],u.indexOf(n)>=0&&n!==t&&c++):a+=t:o=!0;return s.length&&(s.push(a),l.push(s)),l}},{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={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`"};return e.replace(/[&<>"'\/`]/g,function(e){return t[e]})}},{key:"unescapeHtml",value:function(e){var t={"&":"&","<":"<",">":">",""":'"',"'":"'","/":"/","`":"`"};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],n="",r="",u="",i="",o="";return e.forEach(function(e){r=e.op.replace(/ /g,"_"),u=JSON.stringify(e.args).slice(1,-1).replace(/'/g,"\\'").replace(/"((?:[^"\\]|\\.)*)"/g,"'$1'").replace(/\\"/g,'"'),i=e.disabled?"/disabled":"",o=e.breakpoint?"/breakpoint":"",n+="".concat(r,"(").concat(u).concat(i).concat(o,")"),t&&(n+="\n")}),n}},{key:"parseRecipeConfig",value:function(e){if(0===(e=e.trim()).length)return[];if("["===e[0])return JSON.parse(e);var t,n;e=e.replace(/\n/g,"");for(var r=/([^(]+)\(((?:'[^'\\]*(?:\\.[^'\\]*)*'|[^)\/'])*)(\/[^)]+)?\)/g,u=[];t=r.exec(e);){n="["+(n=t[2].replace(/"/g,'\\"').replace(/(^|,|{|:)'/g,'$1"').replace(/([^\\]|[^\\]\\\\)'(,|:|}|$)/g,'$1"$2').replace(/\\'/g,"'"))+"]";var i={op:t[1].replace(/_/g," "),args:JSON.parse(n)};t[3]&&t[3].indexOf("disabled")>0&&(i.disabled=!0),t[3]&&t[3].indexOf("breakpoint")>0&&(i.breakpoint=!0),u.push(i)}return u}},{key:"displayFilesAsHTML",value:function(){var t=c(regeneratorRuntime.mark(function t(n){var r,u,o,a,s;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:r=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>")},u=function(t,n){if(n.startsWith("image")){var r="data:";return r+=n+";","<img style='max-width: 100%;' src='"+(r+="base64,"+Object(i.c)(t))+"'>"}return"<pre>".concat(e.escapeHtml(e.arrayBufferToStr(t.buffer)),"</pre>")},o=function(){var t=c(regeneratorRuntime.mark(function t(n,r){var i,o,a;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.readFile(n);case 2:return i=t.sent,o=new Blob([i],{type:"octet/stream"}),a="<div class='card' style='white-space: normal;'>\n <div class='card-header' id='heading".concat(r,"'>\n <h6 class='mb-0'>\n <a class='collapsed'\n data-toggle='collapse'\n href='#collapse").concat(r,"'\n aria-expanded='false'\n aria-controls='collapse").concat(r,"'\n title=\"Show/hide contents of '").concat(e.escapeHtml(n.name),"'\">\n ").concat(e.escapeHtml(n.name),"</a>\n <span class='float-right' style=\"margin-top: -3px\">\n ").concat(n.size.toLocaleString(),' bytes\n <a title="Download ').concat(e.escapeHtml(n.name),"\"\n href='").concat(URL.createObjectURL(o),"'\n download='").concat(e.escapeHtml(n.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(r,"' class='collapse' aria-labelledby='heading").concat(r,"' data-parent=\"#files\">\n <div class='card-body'>\n ").concat(u(i,n.type),"\n </div>\n </div>\n </div>"),t.abrupt("return",a);case 6:case"end":return t.stop()}},t,this)}));return function(e,n){return t.apply(this,arguments)}}(),a="<div style='padding: 5px; white-space: normal;'>\n ".concat(n.length,' file(s) found\n </div><div id="files" style="padding: 20px">'),s=0;case 5:if(!(s<n.length)){t.next=17;break}if(!n[s].name.endsWith("/")){t.next=10;break}a+=r(n[s]),t.next=14;break;case 10:return t.t0=a,t.next=13,o(n[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("&"),n={},r=0;r<t.length;r++){var u=t[r].split("=");2!==u.length?n[t[r]]=!0:n[u[0]]=decodeURIComponent(u[1].replace(/\+/g," "))}return n}},{key:"readFile",value:function(e){return new Promise(function(t,n){var r=new FileReader,u=new Uint8Array(e.size),i=0,o=function(){if(i>=e.size)t(u);else{var n=e.slice(i,i+10485760);r.readAsArrayBuffer(n)}};r.onload=function(e){u.set(new Uint8Array(r.result),i),i+=10485760,o()},r.onerror=function(e){n(r.error.message)},o()})}},{key:"mod",value:function(e,t){return(e%t+t)%t}},{key:"gcd",value:function(t,n){return n?e.gcd(n,t%n):t}},{key:"modInv",value:function(e,t){e%=t;for(var n=1;n<t;n++)if(e*n%26==1)return n}},{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]}}],n&&f(t.prototype,n),r&&f(t,r),e}();t.a=h,Array.prototype.unique=function(){for(var e={},t=[],n=0,r=this.length;n<r;n++)e.hasOwnProperty(this[n])||(t.push(this[n]),e[this[n]]=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,n){"use strict";var r=n(9),u=n(0),i=n(7);function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}
|
||
/**
|
||
* @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,n,r;return t=e,r=[{key:"prepare",value:function(e,t){var n;switch(t){case"binaryString":case"binaryShortString":case"editableOption":case"editableOptionShort":return u.a.parseEscapedChars(e);case"byteArray":return"string"==typeof e?(e=e.replace(/\s+/g,""),Object(i.c)(e)):e;case"number":if(n=parseFloat(e),isNaN(n))throw"Invalid ingredient value. Not a number: "+u.a.truncate(e.toString(),10);return n;default:return e}}}],(n=[{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,n),r&&o(t,r),e}();function s(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}
|
||
/**
|
||
* @author n1474335 [n1474335@gmail.com]
|
||
* @copyright Crown Copyright 2016
|
||
* @license Apache-2.0
|
||
*/
|
||
var l=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,n,u;return t=e,(n=[{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=r.a.typeEnum(e)},get:function(){return r.a.enumLookup(this._inputType)}},{key:"outputType",set:function(e){this._outputType=r.a.typeEnum(e),this._presentType<0&&(this._presentType=this._outputType)},get:function(){return r.a.enumLookup(this._outputType)}},{key:"presentType",set:function(e){this._presentType=r.a.typeEnum(e)},get:function(){return r.a.enumLookup(this._presentType)}},{key:"args",set:function(e){var t=this;e.forEach(function(e){var n=new a(e);t.addIngredient(n)})},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,n){t._ingList[n].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,n),u&&s(t,u),e}();t.a=l},10:function(e,t,n){"use strict";n.d(t,"c",function(){return u}),n.d(t,"b",function(){return i}),n.d(t,"a",function(){return o});var r=n(0);
|
||
/**
|
||
* Base64 functions.
|
||
*
|
||
* @author n1474335 [n1474335@gmail.com]
|
||
* @copyright Crown Copyright 2016
|
||
* @license Apache-2.0
|
||
*/function u(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"A-Za-z0-9+/=";if(!e)return"";"string"==typeof e&&(e=r.a.strToByteArray(e)),t=r.a.expandAlphRange(t).join("");for(var n,u,i,o,a,s,l,c="",f=0;f<e.length;)o=(n=e[f++])>>2,a=(3&n)<<4|(u=e[f++])>>4,s=(15&u)<<2|(i=e[f++])>>6,l=63&i,isNaN(u)?s=l=64:isNaN(i)&&(l=64),c+=t.charAt(o)+t.charAt(a)+t.charAt(s)+t.charAt(l);return c}function i(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"A-Za-z0-9+/=",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"string",u=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if(!e)return"string"===n?"":[];t=t||"A-Za-z0-9+/=",t=r.a.expandAlphRange(t).join("");var i,o,a,s,l,c,f=[],h=0;if(u){var p=new RegExp("[^"+t.replace(/[[\]\\\-^$]/g,"\\$&")+"]","g");e=e.replace(p,"")}for(;h<e.length;)i=t.indexOf(e.charAt(h++))<<2|(s=-1===(s=t.indexOf(e.charAt(h++)||"="))?64:s)>>4,o=(15&s)<<4|(l=-1===(l=t.indexOf(e.charAt(h++)||"="))?64:l)>>2,a=(3&l)<<6|(c=-1===(c=t.indexOf(e.charAt(h++)||"="))?64:c),f.push(i),64!==l&&f.push(o),64!==c&&f.push(a);return"string"===n?r.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,n){"use strict";function r(e){return(r="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 u(e){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function i(e,t){return(i=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,n,i,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,l=new Array(s),c=0;c<s;c++)l[c]=arguments[c];return i=this,(n=!(a=(e=u(t)).call.apply(e,[this].concat(l)))||"object"!==r(a)&&"function"!=typeof a?o(i):a).type="DishError",Error.captureStackTrace&&Error.captureStackTrace(o(o(n)),t),n}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&&i(e,t)}(t,a(Error)),t}();t.a=s},14:function(e,t,n){var r,u;!function(i,o){"use strict";void 0===(u="function"==typeof(r=function(){var e=function(){},t="undefined",n=["trace","debug","info","warn","error"];function r(e,t){var n=e[t];if("function"==typeof n.bind)return n.bind(e);try{return Function.prototype.bind.call(n,e)}catch(t){return function(){return Function.prototype.apply.apply(n,[e,arguments])}}}function u(t,r){for(var u=0;u<n.length;u++){var i=n[u];this[i]=u<t?e:this.methodFactory(i,t,r)}this.log=this.debug}function i(n,i,o){return function(n){"debug"===n&&(n="log");return typeof console!==t&&(void 0!==console[n]?r(console,n):void 0!==console.log?r(console,"log"):e)}(n)||function(e,n,r){return function(){typeof console!==t&&(u.call(this,n,r),this[e].apply(this,arguments))}}.apply(this,arguments)}function o(e,r,o){var a,s=this,l="loglevel";function c(){var e;if(typeof window!==t){try{e=window.localStorage[l]}catch(e){}if(typeof e===t)try{var n=window.document.cookie,r=n.indexOf(encodeURIComponent(l)+"=");-1!==r&&(e=/^([^;]+)/.exec(n.slice(r))[1])}catch(e){}return void 0===s.levels[e]&&(e=void 0),e}}e&&(l+=":"+e),s.name=e,s.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},s.methodFactory=o||i,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)return;try{return void(window.localStorage[l]=r)}catch(e){}try{window.document.cookie=encodeURIComponent(l)+"="+r+";"}catch(e){}}(r),u.call(s,r,e),typeof console===t&&r<s.levels.SILENT)return"No console available for logging"},s.setDefaultLevel=function(e){c()||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=c();null==f&&(f=null==r?"WARN":r),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 l=typeof window!==t?window.log:void 0;return a.noConflict=function(){return typeof window!==t&&window.log===a&&(window.log=l),a},a.getLoggers=function(){return s},a})?r.call(t,n,t,e):r)||(e.exports=u)}()},15:function(e,t,n){!function(e){var t,n,r,u=String.fromCharCode;function i(e){for(var t,n,r=[],u=0,i=e.length;u<i;)(t=e.charCodeAt(u++))>=55296&&t<=56319&&u<i?56320==(64512&(n=e.charCodeAt(u++)))?r.push(((1023&t)<<10)+(1023&n)+65536):(r.push(t),u--):r.push(t);return r}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 u(e>>t&63|128)}function s(e){if(0==(4294967168&e))return u(e);var t="";return 0==(4294965248&e)?t=u(e>>6&31|192):0==(4294901760&e)?(o(e),t=u(e>>12&15|224),t+=a(e,6)):0==(4292870144&e)&&(t=u(e>>18&7|240),t+=a(e,12),t+=a(e,6)),t+=u(63&e|128)}function l(){if(r>=n)throw Error("Invalid byte index");var e=255&t[r];if(r++,128==(192&e))return 63&e;throw Error("Invalid continuation byte")}function c(){var e,u;if(r>n)throw Error("Invalid byte index");if(r==n)return!1;if(e=255&t[r],r++,0==(128&e))return e;if(192==(224&e)){if((u=(31&e)<<6|l())>=128)return u;throw Error("Invalid continuation byte")}if(224==(240&e)){if((u=(15&e)<<12|l()<<6|l())>=2048)return o(u),u;throw Error("Invalid continuation byte")}if(240==(248&e)&&(u=(7&e)<<18|l()<<12|l()<<6|l())>=65536&&u<=1114111)return u;throw Error("Invalid UTF-8 detected")}e.version="3.0.0",e.encode=function(e){for(var t=i(e),n=t.length,r=-1,u="";++r<n;)u+=s(t[r]);return u},e.decode=function(e){t=i(e),n=t.length,r=0;for(var o,a=[];!1!==(o=c());)a.push(o);return function(e){for(var t,n=e.length,r=-1,i="";++r<n;)(t=e[r])>65535&&(i+=u((t-=65536)>>>10&1023|55296),t=56320|1023&t),i+=u(t);return i}(a)}}(t)},1513:function(e,t,n){"use strict";n.r(t);var r=n(1),u=n(0),i=n(524),o=n.n(i),a=n(3);function s(e){return(s="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 l(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],r=!0,u=!1,i=void 0;try{for(var o,a=e[Symbol.iterator]();!(r=(o=a.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){u=!0,i=e}finally{try{r||null==a.return||a.return()}finally{if(u)throw i}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function c(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function f(e,t){return!t||"object"!==s(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 h(e){return(h=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function p(e,t){return(p=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 d=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=f(this,h(t).call(this))).name="Diff",e.module="Diff",e.description="Compares two inputs (separated by the specified delimiter) and highlights the differences between them.",e.infoURL="https://wikipedia.org/wiki/File_comparison",e.inputType="string",e.outputType="html",e.args=[{name:"Sample delimiter",type:"binaryString",value:"\\n\\n"},{name:"Diff by",type:"option",value:["Character","Word","Line","Sentence","CSS","JSON"]},{name:"Show added",type:"boolean",value:!0},{name:"Show removed",type:"boolean",value:!0},{name:"Ignore whitespace",type:"boolean",value:!1,hint:"Relevant for word and line"}],e}var n,s,d;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&&p(e,t)}(t,r["a"]),n=t,(s=[{key:"run",value:function(e,t){var n,r=l(t,5),s=r[0],c=r[1],f=r[2],h=r[3],p=r[4],d=e.split(s),v="",g=o.a?o.a:i;if(!d||2!==d.length)throw new a.a("Incorrect number of samples, perhaps you need to modify the sample delimiter or add more samples?");switch(c){case"Character":n=g.diffChars(d[0],d[1]);break;case"Word":n=p?g.diffWords(d[0],d[1]):g.diffWordsWithSpace(d[0],d[1]);break;case"Line":n=p?g.diffTrimmedLines(d[0],d[1]):g.diffLines(d[0],d[1]);break;case"Sentence":n=g.diffSentences(d[0],d[1]);break;case"CSS":n=g.diffCss(d[0],d[1]);break;case"JSON":n=g.diffJson(d[0],d[1]);break;default:throw new a.a("Invalid 'Diff by' option.")}for(var y=0;y<n.length;y++)n[y].added?f&&(v+="<span class='hl5'>"+u.a.escapeHtml(n[y].value)+"</span>"):n[y].removed?h&&(v+="<span class='hl3'>"+u.a.escapeHtml(n[y].value)+"</span>"):v+=u.a.escapeHtml(n[y].value);return v}}])&&c(n.prototype,s),d&&c(n,d),t}(),v="undefined"==typeof self?{}:self.OpModules||{};v.Diff={Diff:d};t.default=v},18:function(e,t,n){"use strict";n.d(t,"b",function(){return u}),n.d(t,"a",function(){return i});var r=n(0);
|
||
/**
|
||
* Binary functions.
|
||
*
|
||
* @author n1474335 [n1474335@gmail.com]
|
||
* @copyright Crown Copyright 2018
|
||
* @license Apache-2.0
|
||
*/function u(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Space",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:8;if(!e)return"";t=r.a.charRep(t);for(var u="",i=0;i<e.length;i++)u+=e[i].toString(2).padStart(n,"0")+t;return t.length?u.slice(0,-t.length):u}function i(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Space",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:8,u=r.a.regexRep(t);e=e.replace(u,"");for(var i=[],o=0;o<e.length;o+=n)i.push(parseInt(e.substr(o,n),2));return i}},19:function(e,t,n){"use strict";n.d(t,"a",function(){return u});var r=n(0);
|
||
/**
|
||
* Decimal functions.
|
||
*
|
||
* @author n1474335 [n1474335@gmail.com]
|
||
* @copyright Crown Copyright 2018
|
||
* @license Apache-2.0
|
||
*/function u(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Auto";t=r.a.charRep(t);var n=[],u=e.split(t);""===u[u.length-1]&&(u=u.slice(0,u.length-1));for(var i=0;i<u.length;i++)n[i]=parseInt(u[i],10);return n}},3:function(e,t,n){"use strict";function r(e){return(r="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 u(e){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function i(e,t){return(i=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 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 s=function(e){function t(){var e,n,i,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,l=new Array(s),c=0;c<s;c++)l[c]=arguments[c];return i=this,(n=!(a=(e=u(t)).call.apply(e,[this].concat(l)))||"object"!==r(a)&&"function"!=typeof a?o(i):a).type="OperationError",Error.captureStackTrace&&Error.captureStackTrace(o(o(n)),t),n}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&&i(e,t)}(t,a(Error)),t}();t.a=s},4:function(e,t,n){var r;!function(u){"use strict";var i,o=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,a=Math.ceil,s=Math.floor,l="[BigNumber Error] ",c=l+"Number primitive has more than 15 significant digits: ",f=1e14,h=14,p=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 m(e){for(var t,n,r=1,u=e.length,i=e[0]+"";r<u;){for(t=e[r++]+"",n=h-t.length;n--;t="0"+t);i+=t}for(u=i.length;48===i.charCodeAt(--u););return i.slice(0,u+1||1)}function F(e,t){var n,r,u=e.c,i=t.c,o=e.s,a=t.s,s=e.e,l=t.e;if(!o||!a)return null;if(n=u&&!u[0],r=i&&!i[0],n||r)return n?r?0:-a:o;if(o!=a)return o;if(n=o<0,r=s==l,!u||!i)return r?0:!u^n?1:-1;if(!r)return s>l^n?1:-1;for(a=(s=u.length)<(l=i.length)?s:l,o=0;o<a;o++)if(u[o]!=i[o])return u[o]>i[o]^n?1:-1;return s==l?0:s>l^n?1:-1}function A(e,t,n,r){if(e<t||e>n||e!==(e<0?a(e):s(e)))throw Error(l+(r||"Argument")+("number"==typeof e?e<t||e>n?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function w(e){var t=e.c.length-1;return y(e.e/h)==t&&e.c[t]%2!=0}function b(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function E(e,t,n){var r,u;if(t<0){for(u=n+".";++t;u+=n);e=u+e}else if(++t>(r=e.length)){for(u=n,t-=r;--t;u+=n);e+=u}else t<r&&(e=e.slice(0,t)+"."+e.slice(t));return e}(i=function e(t){var n,r,u,i,C,B,S,D,_,k=H.prototype={constructor:H,toString:null,valueOf:null},x=new H(1),O=20,L=4,N=-7,R=21,T=-1e7,P=1e7,I=!1,M=1,U=0,j={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},z="0123456789abcdefghijklmnopqrstuvwxyz";function H(e,t){var n,i,a,l,f,d,v,g,y=this;if(!(y instanceof H))return new H(e,t);if(null==t){if(e instanceof H)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(l=0,f=e;f>=10;f/=10,l++);return y.e=l,void(y.c=[e])}g=String(e)}else{if(g=String(e),!o.test(g))return u(y,g,d);y.s=45==g.charCodeAt(0)?(g=g.slice(1),-1):1}(l=g.indexOf("."))>-1&&(g=g.replace(".","")),(f=g.search(/e/i))>0?(l<0&&(l=f),l+=+g.slice(f+1),g=g.substring(0,f)):l<0&&(l=g.length)}else{if(A(t,2,z.length,"Base"),g=String(e),10==t)return $(y=new H(e instanceof H?e:g),O+y.e+1,L);if(d="number"==typeof e){if(0*e!=0)return u(y,g,d,t);if(y.s=1/e<0?(g=g.slice(1),-1):1,H.DEBUG&&g.replace(/^0\.0*|\./,"").length>15)throw Error(c+e);d=!1}else y.s=45===g.charCodeAt(0)?(g=g.slice(1),-1):1;for(n=z.slice(0,t),l=f=0,v=g.length;f<v;f++)if(n.indexOf(i=g.charAt(f))<0){if("."==i){if(f>l){l=v;continue}}else if(!a&&(g==g.toUpperCase()&&(g=g.toLowerCase())||g==g.toLowerCase()&&(g=g.toUpperCase()))){a=!0,f=-1,l=0;continue}return u(y,String(e),d,t)}(l=(g=r(g,t,10,y.s)).indexOf("."))>-1?g=g.replace(".",""):l=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&&H.DEBUG&&v>15&&(e>p||e!==s(e)))throw Error(c+y.s*e);if((l=l-f-1)>P)y.c=y.e=null;else if(l<T)y.c=[y.e=0];else{if(y.e=l,y.c=[],f=(l+1)%h,l<0&&(f+=h),f<v){for(f&&y.c.push(+g.slice(0,f)),v-=h;f<v;)y.c.push(+g.slice(f,f+=h));g=g.slice(f),f=h-g.length}else f-=v;for(;f--;g+="0");y.c.push(+g)}}else y.c=[y.e=0]}function G(e,t,n,r){var u,i,o,a,s;if(null==n?n=L:A(n,0,8),!e.c)return e.toString();if(u=e.c[0],o=e.e,null==t)s=m(e.c),s=1==r||2==r&&(o<=N||o>=R)?b(s,o):E(s,o,"0");else if(i=(e=$(new H(e),t,n)).e,a=(s=m(e.c)).length,1==r||2==r&&(t<=i||i<=N)){for(;a<t;s+="0",a++);s=b(s,i)}else if(t-=o,s=E(s,i,"0"),i+1>a){if(--t>0)for(s+=".";t--;s+="0");}else if((t+=i-a)>0)for(i+1==a&&(s+=".");t--;s+="0");return e.s<0&&u?"-"+s:s}function W(e,t){for(var n,r=1,u=new H(e[0]);r<e.length;r++){if(!(n=new H(e[r])).s){u=n;break}t.call(u,n)&&(u=n)}return u}function J(e,t,n){for(var r=1,u=t.length;!t[--u];t.pop());for(u=t[0];u>=10;u/=10,r++);return(n=r+n*h-1)>P?e.c=e.e=null:n<T?e.c=[e.e=0]:(e.e=n,e.c=t),e}function $(e,t,n,r){var u,i,o,l,c,p,v,g=e.c,y=d;if(g){e:{for(u=1,l=g[0];l>=10;l/=10,u++);if((i=t-u)<0)i+=h,o=t,v=(c=g[p=0])/y[u-o-1]%10|0;else if((p=a((i+1)/h))>=g.length){if(!r)break e;for(;g.length<=p;g.push(0));c=v=0,u=1,o=(i%=h)-h+1}else{for(c=l=g[p],u=1;l>=10;l/=10,u++);v=(o=(i%=h)-h+u)<0?0:c/y[u-o-1]%10|0}if(r=r||t<0||null!=g[p+1]||(o<0?c:c%y[u-o-1]),r=n<4?(v||r)&&(0==n||n==(e.s<0?3:2)):v>5||5==v&&(4==n||r||6==n&&(i>0?o>0?c/y[u-o]:0:g[p-1])%10&1||n==(e.s<0?8:7)),t<1||!g[0])return g.length=0,r?(t-=e.e+1,g[0]=y[(h-t%h)%h],e.e=-t||0):g[0]=e.e=0,e;if(0==i?(g.length=p,l=1,p--):(g.length=p+1,l=y[h-i],g[p]=o>0?s(c/y[u-o]%y[o])*l:0),r)for(;;){if(0==p){for(i=1,o=g[0];o>=10;o/=10,i++);for(o=g[0]+=l,l=1;o>=10;o/=10,l++);i!=l&&(e.e++,g[0]==f&&(g[0]=1));break}if(g[p]+=l,g[p]!=f)break;g[p--]=0,l=1}for(i=g.length;0===g[--i];g.pop());}e.e>P?e.c=e.e=null:e.e<T&&(e.c=[e.e=0])}return e}function Z(e){var t,n=e.e;return null===n?e.toString():(t=m(e.c),t=n<=N||n>=R?b(t,n):E(t,n,"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,n;if(null!=e){if("object"!=typeof e)throw Error(l+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(A(n=e[t],0,g,t),O=n),e.hasOwnProperty(t="ROUNDING_MODE")&&(A(n=e[t],0,8,t),L=n),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((n=e[t])&&n.pop?(A(n[0],-g,0,t),A(n[1],0,g,t),N=n[0],R=n[1]):(A(n,-g,g,t),N=-(R=n<0?-n:n))),e.hasOwnProperty(t="RANGE"))if((n=e[t])&&n.pop)A(n[0],-g,-1,t),A(n[1],1,g,t),T=n[0],P=n[1];else{if(A(n,-g,g,t),!n)throw Error(l+t+" cannot be zero: "+n);T=-(P=n<0?-n:n)}if(e.hasOwnProperty(t="CRYPTO")){if((n=e[t])!==!!n)throw Error(l+t+" not true or false: "+n);if(n){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw I=!n,Error(l+"crypto unavailable");I=n}else I=n}if(e.hasOwnProperty(t="MODULO_MODE")&&(A(n=e[t],0,9,t),M=n),e.hasOwnProperty(t="POW_PRECISION")&&(A(n=e[t],0,g,t),U=n),e.hasOwnProperty(t="FORMAT")){if("object"!=typeof(n=e[t]))throw Error(l+t+" not an object: "+n);j=n}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(n=e[t])||/^.$|[+-.\s]|(.).*\1/.test(n))throw Error(l+t+" invalid: "+n);z=n}}return{DECIMAL_PLACES:O,ROUNDING_MODE:L,EXPONENTIAL_AT:[N,R],RANGE:[T,P],CRYPTO:I,MODULO_MODE:M,POW_PRECISION:U,FORMAT:j,ALPHABET:z}},H.isBigNumber=function(e){return e instanceof H||e&&!0===e._isBigNumber||!1},H.maximum=H.max=function(){return W(arguments,k.lt)},H.minimum=H.min=function(){return W(arguments,k.gt)},H.random=(i=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,n,r,u,o,c=0,f=[],p=new H(x);if(null==e?e=O:A(e,0,g),u=a(e/h),I)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(u*=2));c<u;)(o=131072*t[c]+(t[c+1]>>>11))>=9e15?(n=crypto.getRandomValues(new Uint32Array(2)),t[c]=n[0],t[c+1]=n[1]):(f.push(o%1e14),c+=2);c=u/2}else{if(!crypto.randomBytes)throw I=!1,Error(l+"crypto unavailable");for(t=crypto.randomBytes(u*=7);c<u;)(o=281474976710656*(31&t[c])+1099511627776*t[c+1]+4294967296*t[c+2]+16777216*t[c+3]+(t[c+4]<<16)+(t[c+5]<<8)+t[c+6])>=9e15?crypto.randomBytes(7).copy(t,c):(f.push(o%1e14),c+=7);c=u/7}if(!I)for(;c<u;)(o=i())<9e15&&(f[c++]=o%1e14);for(u=f[--c],e%=h,u&&e&&(o=d[h-e],f[c]=s(u/o)*o);0===f[c];f.pop(),c--);if(c<0)f=[r=0];else{for(r=-1;0===f[0];f.splice(0,1),r-=h);for(c=1,o=f[0];o>=10;o/=10,c++);c<h&&(r-=h-c)}return p.e=r,p.c=f,p}),H.sum=function(){for(var e=1,t=arguments,n=new H(t[0]);e<t.length;)n=n.plus(t[e++]);return n},r=function(){function e(e,t,n,r){for(var u,i,o=[0],a=0,s=e.length;a<s;){for(i=o.length;i--;o[i]*=t);for(o[0]+=r.indexOf(e.charAt(a++)),u=0;u<o.length;u++)o[u]>n-1&&(null==o[u+1]&&(o[u+1]=0),o[u+1]+=o[u]/n|0,o[u]%=n)}return o.reverse()}return function(t,r,u,i,o){var a,s,l,c,f,h,p,d,v=t.indexOf("."),g=O,y=L;for(v>=0&&(c=U,U=0,t=t.replace(".",""),h=(d=new H(r)).pow(t.length-v),U=c,d.c=e(E(m(h.c),h.e,"0"),10,u,"0123456789"),d.e=d.c.length),l=c=(p=e(t,r,u,o?(a=z,"0123456789"):(a="0123456789",z))).length;0==p[--c];p.pop());if(!p[0])return a.charAt(0);if(v<0?--l:(h.c=p,h.e=l,h.s=i,p=(h=n(h,d,g,y,u)).c,f=h.r,l=h.e),v=p[s=l+g+1],c=u/2,f=f||s<0||null!=p[s+1],f=y<4?(null!=v||f)&&(0==y||y==(h.s<0?3:2)):v>c||v==c&&(4==y||f||6==y&&1&p[s-1]||y==(h.s<0?8:7)),s<1||!p[0])t=f?E(a.charAt(1),-g,a.charAt(0)):a.charAt(0);else{if(p.length=s,f)for(--u;++p[--s]>u;)p[s]=0,s||(++l,p=[1].concat(p));for(c=p.length;!p[--c];);for(v=0,t="";v<=c;t+=a.charAt(p[v++]));t=E(t,l,a.charAt(0))}return t}}(),n=function(){function e(e,t,n){var r,u,i,o,a=0,s=e.length,l=t%v,c=t/v|0;for(e=e.slice();s--;)a=((u=l*(i=e[s]%v)+(r=c*i+(o=e[s]/v|0)*l)%v*v+a)/n|0)+(r/v|0)+c*o,e[s]=u%n;return a&&(e=[a].concat(e)),e}function t(e,t,n,r){var u,i;if(n!=r)i=n>r?1:-1;else for(u=i=0;u<n;u++)if(e[u]!=t[u]){i=e[u]>t[u]?1:-1;break}return i}function n(e,t,n,r){for(var u=0;n--;)e[n]-=u,u=e[n]<t[n]?1:0,e[n]=u*r+e[n]-t[n];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(r,u,i,o,a){var l,c,p,d,v,g,m,F,A,w,b,E,C,B,S,D,_,k=r.s==u.s?1:-1,x=r.c,O=u.c;if(!(x&&x[0]&&O&&O[0]))return new H(r.s&&u.s&&(x?!O||x[0]!=O[0]:O)?x&&0==x[0]||!O?0*k:k/0:NaN);for(A=(F=new H(k)).c=[],k=i+(c=r.e-u.e)+1,a||(a=f,c=y(r.e/h)-y(u.e/h),k=k/h|0),p=0;O[p]==(x[p]||0);p++);if(O[p]>(x[p]||0)&&c--,k<0)A.push(1),d=!0;else{for(B=x.length,D=O.length,p=0,k+=2,(v=s(a/(O[0]+1)))>1&&(O=e(O,v,a),x=e(x,v,a),D=O.length,B=x.length),C=D,b=(w=x.slice(0,D)).length;b<D;w[b++]=0);_=O.slice(),_=[0].concat(_),S=O[0],O[1]>=a/2&&S++;do{if(v=0,(l=t(O,w,D,b))<0){if(E=w[0],D!=b&&(E=E*a+(w[1]||0)),(v=s(E/S))>1)for(v>=a&&(v=a-1),m=(g=e(O,v,a)).length,b=w.length;1==t(g,w,m,b);)v--,n(g,D<m?_:O,m,a),m=g.length,l=1;else 0==v&&(l=v=1),m=(g=O.slice()).length;if(m<b&&(g=[0].concat(g)),n(w,g,b,a),b=w.length,-1==l)for(;t(O,w,D,b)<1;)v++,n(w,D<b?_:O,b,a),b=w.length}else 0===l&&(v++,w=[0]);A[p++]=v,w[0]?w[b++]=x[C]||0:(w=[x[C]],b=1)}while((C++<B||null!=w[0])&&k--);d=null!=w[0],A[0]||A.splice(0,1)}if(a==f){for(p=1,k=A[0];k>=10;k/=10,p++);$(F,i+(F.e=p+c*h-1)+1,o,d)}else F.e=c,F.r=+d;return F}}(),C=/^(-?)0([xbo])(?=\w[\w.]*$)/i,B=/^([^.]+)\.$/,S=/^\.([^.]+)$/,D=/^-?(Infinity|NaN)$/,_=/^\s*\+(?=[\w.])|^\s+|\s+$/g,u=function(e,t,n,r){var u,i=n?t:t.replace(_,"");if(D.test(i))e.s=isNaN(i)?null:i<0?-1:1,e.c=e.e=null;else{if(!n&&(i=i.replace(C,function(e,t,n){return u="x"==(n=n.toLowerCase())?16:"b"==n?2:8,r&&r!=u?e:t}),r&&(u=r,i=i.replace(B,"$1").replace(S,"0.$1")),t!=i))return new H(i,u);if(H.DEBUG)throw Error(l+"Not a"+(r?" base "+r:"")+" number: "+t);e.c=e.e=e.s=null}},k.absoluteValue=k.abs=function(){var e=new H(this);return e.s<0&&(e.s=1),e},k.comparedTo=function(e,t){return F(this,new H(e,t))},k.decimalPlaces=k.dp=function(e,t){var n,r,u,i=this;if(null!=e)return A(e,0,g),null==t?t=L:A(t,0,8),$(new H(i),e+i.e+1,t);if(!(n=i.c))return null;if(r=((u=n.length-1)-y(this.e/h))*h,u=n[u])for(;u%10==0;u/=10,r--);return r<0&&(r=0),r},k.dividedBy=k.div=function(e,t){return n(this,new H(e,t),O,L)},k.dividedToIntegerBy=k.idiv=function(e,t){return n(this,new H(e,t),0,1)},k.exponentiatedBy=k.pow=function(e,t){var n,r,u,i,o,c,f,p,d=this;if((e=new H(e)).c&&!e.isInteger())throw Error(l+"Exponent not an integer: "+Z(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 p=new H(Math.pow(+Z(d),o?2-w(e):+Z(e))),t?p.mod(t):p;if(c=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new H(NaN);(r=!c&&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 i=d.s<0&&w(e)?-0:0,d.e>-1&&(i=1/i),new H(c?1/i:i);U&&(i=a(U/h+2))}for(o?(n=new H(.5),c&&(e.s=1),f=w(e)):f=(u=Math.abs(+Z(e)))%2,p=new H(x);;){if(f){if(!(p=p.times(d)).c)break;i?p.c.length>i&&(p.c.length=i):r&&(p=p.mod(t))}if(u){if(0===(u=s(u/2)))break;f=u%2}else if($(e=e.times(n),e.e+1,1),e.e>14)f=w(e);else{if(0==(u=+Z(e)))break;f=u%2}d=d.times(d),i?d.c&&d.c.length>i&&(d.c.length=i):r&&(d=d.mod(t))}return r?p:(c&&(p=x.div(p)),t?p.mod(t):i?$(p,U,L,void 0):p)},k.integerValue=function(e){var t=new H(this);return null==e?e=L:A(e,0,8),$(t,t.e+1,e)},k.isEqualTo=k.eq=function(e,t){return 0===F(this,new H(e,t))},k.isFinite=function(){return!!this.c},k.isGreaterThan=k.gt=function(e,t){return F(this,new H(e,t))>0},k.isGreaterThanOrEqualTo=k.gte=function(e,t){return 1===(t=F(this,new H(e,t)))||0===t},k.isInteger=function(){return!!this.c&&y(this.e/h)>this.c.length-2},k.isLessThan=k.lt=function(e,t){return F(this,new H(e,t))<0},k.isLessThanOrEqualTo=k.lte=function(e,t){return-1===(t=F(this,new H(e,t)))||0===t},k.isNaN=function(){return!this.s},k.isNegative=function(){return this.s<0},k.isPositive=function(){return this.s>0},k.isZero=function(){return!!this.c&&0==this.c[0]},k.minus=function(e,t){var n,r,u,i,o=this,a=o.s;if(t=(e=new H(e,t)).s,!a||!t)return new H(NaN);if(a!=t)return e.s=-t,o.plus(e);var s=o.e/h,l=e.e/h,c=o.c,p=e.c;if(!s||!l){if(!c||!p)return c?(e.s=-t,e):new H(p?o:NaN);if(!c[0]||!p[0])return p[0]?(e.s=-t,e):new H(c[0]?o:3==L?-0:0)}if(s=y(s),l=y(l),c=c.slice(),a=s-l){for((i=a<0)?(a=-a,u=c):(l=s,u=p),u.reverse(),t=a;t--;u.push(0));u.reverse()}else for(r=(i=(a=c.length)<(t=p.length))?a:t,a=t=0;t<r;t++)if(c[t]!=p[t]){i=c[t]<p[t];break}if(i&&(u=c,c=p,p=u,e.s=-e.s),(t=(r=p.length)-(n=c.length))>0)for(;t--;c[n++]=0);for(t=f-1;r>a;){if(c[--r]<p[r]){for(n=r;n&&!c[--n];c[n]=t);--c[n],c[r]+=f}c[r]-=p[r]}for(;0==c[0];c.splice(0,1),--l);return c[0]?J(e,c,l):(e.s=3==L?-1:1,e.c=[e.e=0],e)},k.modulo=k.mod=function(e,t){var r,u,i=this;return e=new H(e,t),!i.c||!e.s||e.c&&!e.c[0]?new H(NaN):!e.c||i.c&&!i.c[0]?new H(i):(9==M?(u=e.s,e.s=1,r=n(i,e,0,3),e.s=u,r.s*=u):r=n(i,e,0,M),(e=i.minus(r.times(e))).c[0]||1!=M||(e.s=i.s),e)},k.multipliedBy=k.times=function(e,t){var n,r,u,i,o,a,s,l,c,p,d,g,m,F,A,w=this,b=w.c,E=(e=new H(e,t)).c;if(!(b&&E&&b[0]&&E[0]))return!w.s||!e.s||b&&!b[0]&&!E||E&&!E[0]&&!b?e.c=e.e=e.s=null:(e.s*=w.s,b&&E?(e.c=[0],e.e=0):e.c=e.e=null),e;for(r=y(w.e/h)+y(e.e/h),e.s*=w.s,(s=b.length)<(p=E.length)&&(m=b,b=E,E=m,u=s,s=p,p=u),u=s+p,m=[];u--;m.push(0));for(F=f,A=v,u=p;--u>=0;){for(n=0,d=E[u]%A,g=E[u]/A|0,i=u+(o=s);i>u;)n=((l=d*(l=b[--o]%A)+(a=g*l+(c=b[o]/A|0)*d)%A*A+m[i]+n)/F|0)+(a/A|0)+g*c,m[i--]=l%F;m[i]=n}return n?++r:m.splice(0,1),J(e,m,r)},k.negated=function(){var e=new H(this);return e.s=-e.s||null,e},k.plus=function(e,t){var n,r=this,u=r.s;if(t=(e=new H(e,t)).s,!u||!t)return new H(NaN);if(u!=t)return e.s=-t,r.minus(e);var i=r.e/h,o=e.e/h,a=r.c,s=e.c;if(!i||!o){if(!a||!s)return new H(u/0);if(!a[0]||!s[0])return s[0]?e:new H(a[0]?r:0*u)}if(i=y(i),o=y(o),a=a.slice(),u=i-o){for(u>0?(o=i,n=s):(u=-u,n=a),n.reverse();u--;n.push(0));n.reverse()}for((u=a.length)-(t=s.length)<0&&(n=s,s=a,a=n,t=u),u=0;t;)u=(a[--t]=a[t]+s[t]+u)/f|0,a[t]=f===a[t]?0:a[t]%f;return u&&(a=[u].concat(a),++o),J(e,a,o)},k.precision=k.sd=function(e,t){var n,r,u,i=this;if(null!=e&&e!==!!e)return A(e,1,g),null==t?t=L:A(t,0,8),$(new H(i),e,t);if(!(n=i.c))return null;if(r=(u=n.length-1)*h+1,u=n[u]){for(;u%10==0;u/=10,r--);for(u=n[0];u>=10;u/=10,r++);}return e&&i.e+1>r&&(r=i.e+1),r},k.shiftedBy=function(e){return A(e,-p,p),this.times("1e"+e)},k.squareRoot=k.sqrt=function(){var e,t,r,u,i,o=this,a=o.c,s=o.s,l=o.e,c=O+4,f=new H("0.5");if(1!==s||!a||!a[0])return new H(!s||s<0&&(!a||a[0])?NaN:a?o:1/0);if(0==(s=Math.sqrt(+Z(o)))||s==1/0?(((t=m(a)).length+l)%2==0&&(t+="0"),s=Math.sqrt(+t),l=y((l+1)/2)-(l<0||l%2),r=new H(t=s==1/0?"1e"+l:(t=s.toExponential()).slice(0,t.indexOf("e")+1)+l)):r=new H(s+""),r.c[0])for((s=(l=r.e)+c)<3&&(s=0);;)if(i=r,r=f.times(i.plus(n(o,i,c,1))),m(i.c).slice(0,s)===(t=m(r.c)).slice(0,s)){if(r.e<l&&--s,"9999"!=(t=t.slice(s-3,s+1))&&(u||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||($(r,r.e+O+2,1),e=!r.times(r).eq(o));break}if(!u&&($(i,i.e+O+2,0),i.times(i).eq(o))){r=i;break}c+=4,s+=4,u=1}return $(r,r.e+O+1,L,e)},k.toExponential=function(e,t){return null!=e&&(A(e,0,g),e++),G(this,e,t,1)},k.toFixed=function(e,t){return null!=e&&(A(e,0,g),e=e+this.e+1),G(this,e,t)},k.toFormat=function(e,t,n){var r,u=this;if(null==n)null!=e&&t&&"object"==typeof t?(n=t,t=null):e&&"object"==typeof e?(n=e,e=t=null):n=j;else if("object"!=typeof n)throw Error(l+"Argument not an object: "+n);if(r=u.toFixed(e,t),u.c){var i,o=r.split("."),a=+n.groupSize,s=+n.secondaryGroupSize,c=n.groupSeparator||"",f=o[0],h=o[1],p=u.s<0,d=p?f.slice(1):f,v=d.length;if(s&&(i=a,a=s,s=i,v-=i),a>0&&v>0){for(i=v%a||a,f=d.substr(0,i);i<v;i+=a)f+=c+d.substr(i,a);s>0&&(f+=c+d.slice(i)),p&&(f="-"+f)}r=h?f+(n.decimalSeparator||"")+((s=+n.fractionGroupSize)?h.replace(new RegExp("\\d{"+s+"}\\B","g"),"$&"+(n.fractionGroupSeparator||"")):h):f}return(n.prefix||"")+r+(n.suffix||"")},k.toFraction=function(e){var t,r,u,i,o,a,s,c,f,p,v,g,y=this,F=y.c;if(null!=e&&(!(s=new H(e)).isInteger()&&(s.c||1!==s.s)||s.lt(x)))throw Error(l+"Argument "+(s.isInteger()?"out of range: ":"not an integer: ")+Z(s));if(!F)return new H(y);for(t=new H(x),f=r=new H(x),u=c=new H(x),g=m(F),o=t.e=g.length-y.e-1,t.c[0]=d[(a=o%h)<0?h+a:a],e=!e||s.comparedTo(t)>0?o>0?t:f:s,a=P,P=1/0,s=new H(g),c.c[0]=0;p=n(s,t,0,1),1!=(i=r.plus(p.times(u))).comparedTo(e);)r=u,u=i,f=c.plus(p.times(i=f)),c=i,t=s.minus(p.times(i=t)),s=i;return i=n(e.minus(r),u,0,1),c=c.plus(i.times(f)),r=r.plus(i.times(u)),c.s=f.s=y.s,v=n(f,u,o*=2,L).minus(y).abs().comparedTo(n(c,r,o,L).minus(y).abs())<1?[f,u]:[c,r],P=a,v},k.toNumber=function(){return+Z(this)},k.toPrecision=function(e,t){return null!=e&&A(e,1,g),G(this,e,t,2)},k.toString=function(e){var t,n=this,u=n.s,i=n.e;return null===i?u?(t="Infinity",u<0&&(t="-"+t)):t="NaN":(null==e?t=i<=N||i>=R?b(m(n.c),i):E(m(n.c),i,"0"):10===e?t=E(m((n=$(new H(n),O+i+1,L)).c),n.e,"0"):(A(e,2,z.length,"Base"),t=r(E(m(n.c),i,"0"),10,e,u,!0)),u<0&&n.c[0]&&(t="-"+t)),t},k.valueOf=k.toJSON=function(){return Z(this)},k._isBigNumber=!0,"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator&&(k[Symbol.toStringTag]="BigNumber",k[Symbol.for("nodejs.util.inspect.custom")]=k.valueOf),null!=t&&H.set(t),H}()).default=i.BigNumber=i,void 0===(r=function(){return i}.call(t,n,t,e))||(e.exports=r)}()},524:function(e,t,n){
|
||
/*!
|
||
|
||
diff v3.5.0
|
||
|
||
Software License Agreement (BSD License)
|
||
|
||
Copyright (c) 2009-2015, Kevin Decker <kpdecker@gmail.com>
|
||
|
||
All rights reserved.
|
||
|
||
Redistribution and use of this software 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.
|
||
|
||
* Neither the name of Kevin Decker nor the names of its
|
||
contributors may be used to endorse or promote products
|
||
derived from this software without specific prior
|
||
written permission.
|
||
|
||
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 OWNER 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.
|
||
@license
|
||
*/
|
||
var r;r=function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var u=t[r]={exports:{},id:r,loaded:!1};return e[r].call(u.exports,u,u.exports,n),u.loaded=!0,u.exports}return n.m=e,n.c=t,n.p="",n(0)}([function(e,t,n){"use strict";t.__esModule=!0,t.canonicalize=t.convertChangesToXML=t.convertChangesToDMP=t.merge=t.parsePatch=t.applyPatches=t.applyPatch=t.createPatch=t.createTwoFilesPatch=t.structuredPatch=t.diffArrays=t.diffJson=t.diffCss=t.diffSentences=t.diffTrimmedLines=t.diffLines=t.diffWordsWithSpace=t.diffWords=t.diffChars=t.Diff=void 0;var r,u=n(1),i=(r=u)&&r.__esModule?r:{default:r},o=n(2),a=n(3),s=n(5),l=n(6),c=n(7),f=n(8),h=n(9),p=n(10),d=n(11),v=n(13),g=n(14),y=n(16),m=n(17);t.Diff=i.default,t.diffChars=o.diffChars,t.diffWords=a.diffWords,t.diffWordsWithSpace=a.diffWordsWithSpace,t.diffLines=s.diffLines,t.diffTrimmedLines=s.diffTrimmedLines,t.diffSentences=l.diffSentences,t.diffCss=c.diffCss,t.diffJson=f.diffJson,t.diffArrays=h.diffArrays,t.structuredPatch=g.structuredPatch,t.createTwoFilesPatch=g.createTwoFilesPatch,t.createPatch=g.createPatch,t.applyPatch=p.applyPatch,t.applyPatches=p.applyPatches,t.parsePatch=d.parsePatch,t.merge=v.merge,t.convertChangesToDMP=y.convertChangesToDMP,t.convertChangesToXML=m.convertChangesToXML,t.canonicalize=f.canonicalize},function(e,t){"use strict";function n(){}function r(e,t,n,r,u){for(var i=0,o=t.length,a=0,s=0;i<o;i++){var l=t[i];if(l.removed){if(l.value=e.join(r.slice(s,s+l.count)),s+=l.count,i&&t[i-1].added){var c=t[i-1];t[i-1]=t[i],t[i]=c}}else{if(!l.added&&u){var f=n.slice(a,a+l.count);f=f.map(function(e,t){var n=r[s+t];return n.length>e.length?n:e}),l.value=e.join(f)}else l.value=e.join(n.slice(a,a+l.count));a+=l.count,l.added||(s+=l.count)}}var h=t[o-1];return o>1&&"string"==typeof h.value&&(h.added||h.removed)&&e.equals("",h.value)&&(t[o-2].value+=h.value,t.pop()),t}t.__esModule=!0,t.default=n,n.prototype={diff:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},u=n.callback;"function"==typeof n&&(u=n,n={}),this.options=n;var i=this;function o(e){return u?(setTimeout(function(){u(void 0,e)},0),!0):e}e=this.castInput(e),t=this.castInput(t),e=this.removeEmpty(this.tokenize(e));var a=(t=this.removeEmpty(this.tokenize(t))).length,s=e.length,l=1,c=a+s,f=[{newPos:-1,components:[]}],h=this.extractCommon(f[0],t,e,0);if(f[0].newPos+1>=a&&h+1>=s)return o([{value:this.join(t),count:t.length}]);function p(){for(var n=-1*l;n<=l;n+=2){var u=void 0,c=f[n-1],h=f[n+1],p=(h?h.newPos:0)-n;c&&(f[n-1]=void 0);var d=c&&c.newPos+1<a,v=h&&0<=p&&p<s;if(d||v){if(!d||v&&c.newPos<h.newPos?(u={newPos:(g=h).newPos,components:g.components.slice(0)},i.pushComponent(u.components,void 0,!0)):((u=c).newPos++,i.pushComponent(u.components,!0,void 0)),p=i.extractCommon(u,t,e,n),u.newPos+1>=a&&p+1>=s)return o(r(i,u.components,t,e,i.useLongestToken));f[n]=u}else f[n]=void 0}var g;l++}if(u)!function e(){setTimeout(function(){if(l>c)return u();p()||e()},0)}();else for(;l<=c;){var d=p();if(d)return d}},pushComponent:function(e,t,n){var r=e[e.length-1];r&&r.added===t&&r.removed===n?e[e.length-1]={count:r.count+1,added:t,removed:n}:e.push({count:1,added:t,removed:n})},extractCommon:function(e,t,n,r){for(var u=t.length,i=n.length,o=e.newPos,a=o-r,s=0;o+1<u&&a+1<i&&this.equals(t[o+1],n[a+1]);)o++,a++,s++;return s&&e.components.push({count:s}),e.newPos=o,a},equals:function(e,t){return this.options.comparator?this.options.comparator(e,t):e===t||this.options.ignoreCase&&e.toLowerCase()===t.toLowerCase()},removeEmpty:function(e){for(var t=[],n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t},castInput:function(e){return e},tokenize:function(e){return e.split("")},join:function(e){return e.join("")}}},function(e,t,n){"use strict";t.__esModule=!0,t.characterDiff=void 0,t.diffChars=function(e,t,n){return o.diff(e,t,n)};var r,u=n(1),i=(r=u)&&r.__esModule?r:{default:r};var o=t.characterDiff=new i.default},function(e,t,n){"use strict";t.__esModule=!0,t.wordDiff=void 0,t.diffWords=function(e,t,n){return n=(0,o.generateOptions)(n,{ignoreWhitespace:!0}),l.diff(e,t,n)},t.diffWordsWithSpace=function(e,t,n){return l.diff(e,t,n)};var r,u=n(1),i=(r=u)&&r.__esModule?r:{default:r},o=n(4);var a=/^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/,s=/\S/,l=t.wordDiff=new i.default;l.equals=function(e,t){return this.options.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e===t||this.options.ignoreWhitespace&&!s.test(e)&&!s.test(t)},l.tokenize=function(e){for(var t=e.split(/(\s+|\b)/),n=0;n<t.length-1;n++)!t[n+1]&&t[n+2]&&a.test(t[n])&&a.test(t[n+2])&&(t[n]+=t[n+2],t.splice(n+1,2),n--);return t}},function(e,t){"use strict";t.__esModule=!0,t.generateOptions=function(e,t){if("function"==typeof e)t.callback=e;else if(e)for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}},function(e,t,n){"use strict";t.__esModule=!0,t.lineDiff=void 0,t.diffLines=function(e,t,n){return a.diff(e,t,n)},t.diffTrimmedLines=function(e,t,n){var r=(0,o.generateOptions)(n,{ignoreWhitespace:!0});return a.diff(e,t,r)};var r,u=n(1),i=(r=u)&&r.__esModule?r:{default:r},o=n(4);var a=t.lineDiff=new i.default;a.tokenize=function(e){var t=[],n=e.split(/(\n|\r\n)/);n[n.length-1]||n.pop();for(var r=0;r<n.length;r++){var u=n[r];r%2&&!this.options.newlineIsToken?t[t.length-1]+=u:(this.options.ignoreWhitespace&&(u=u.trim()),t.push(u))}return t}},function(e,t,n){"use strict";t.__esModule=!0,t.sentenceDiff=void 0,t.diffSentences=function(e,t,n){return o.diff(e,t,n)};var r,u=n(1),i=(r=u)&&r.__esModule?r:{default:r};var o=t.sentenceDiff=new i.default;o.tokenize=function(e){return e.split(/(\S.+?[.!?])(?=\s+|$)/)}},function(e,t,n){"use strict";t.__esModule=!0,t.cssDiff=void 0,t.diffCss=function(e,t,n){return o.diff(e,t,n)};var r,u=n(1),i=(r=u)&&r.__esModule?r:{default:r};var o=t.cssDiff=new i.default;o.tokenize=function(e){return e.split(/([{}:;,]|\s+)/)}},function(e,t,n){"use strict";t.__esModule=!0,t.jsonDiff=void 0;var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.diffJson=function(e,t,n){return l.diff(e,t,n)},t.canonicalize=c;var u,i=n(1),o=(u=i)&&u.__esModule?u:{default:u},a=n(5);var s=Object.prototype.toString,l=t.jsonDiff=new o.default;function c(e,t,n,u,i){t=t||[],n=n||[],u&&(e=u(i,e));var o=void 0;for(o=0;o<t.length;o+=1)if(t[o]===e)return n[o];var a=void 0;if("[object Array]"===s.call(e)){for(t.push(e),a=new Array(e.length),n.push(a),o=0;o<e.length;o+=1)a[o]=c(e[o],t,n,u,i);return t.pop(),n.pop(),a}if(e&&e.toJSON&&(e=e.toJSON()),"object"===(void 0===e?"undefined":r(e))&&null!==e){t.push(e),a={},n.push(a);var l=[],f=void 0;for(f in e)e.hasOwnProperty(f)&&l.push(f);for(l.sort(),o=0;o<l.length;o+=1)a[f=l[o]]=c(e[f],t,n,u,f);t.pop(),n.pop()}else a=e;return a}l.useLongestToken=!0,l.tokenize=a.lineDiff.tokenize,l.castInput=function(e){var t=this.options,n=t.undefinedReplacement,r=t.stringifyReplacer,u=void 0===r?function(e,t){return void 0===t?n:t}:r;return"string"==typeof e?e:JSON.stringify(c(e,null,null,u),u," ")},l.equals=function(e,t){return o.default.prototype.equals.call(l,e.replace(/,([\r\n])/g,"$1"),t.replace(/,([\r\n])/g,"$1"))}},function(e,t,n){"use strict";t.__esModule=!0,t.arrayDiff=void 0,t.diffArrays=function(e,t,n){return o.diff(e,t,n)};var r,u=n(1),i=(r=u)&&r.__esModule?r:{default:r};var o=t.arrayDiff=new i.default;o.tokenize=function(e){return e.slice()},o.join=o.removeEmpty=function(e){return e}},function(e,t,n){"use strict";t.__esModule=!0,t.applyPatch=a,t.applyPatches=function(e,t){"string"==typeof e&&(e=(0,u.parsePatch)(e));var n=0;!function r(){var u=e[n++];if(!u)return t.complete();t.loadFile(u,function(e,n){if(e)return t.complete(e);var i=a(n,u,t);t.patched(u,i,function(e){if(e)return t.complete(e);r()})})}()};var r,u=n(11),i=n(12),o=(r=i)&&r.__esModule?r:{default:r};function a(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if("string"==typeof t&&(t=(0,u.parsePatch)(t)),Array.isArray(t)){if(t.length>1)throw new Error("applyPatch only works with a single input.");t=t[0]}var r=e.split(/\r\n|[\n\v\f\r\x85]/),i=e.match(/\r\n|[\n\v\f\r\x85]/g)||[],a=t.hunks,s=n.compareLine||function(e,t,n,r){return t===r},l=0,c=n.fuzzFactor||0,f=0,h=0,p=void 0,d=void 0;function v(e,t){for(var n=0;n<e.lines.length;n++){var u=e.lines[n],i=u.length>0?u[0]:" ",o=u.length>0?u.substr(1):u;if(" "===i||"-"===i){if(!s(t+1,r[t],i,o)&&++l>c)return!1;t++}}return!0}for(var g=0;g<a.length;g++){for(var y=a[g],m=r.length-y.oldLines,F=0,A=h+y.oldStart-1,w=(0,o.default)(A,f,m);void 0!==F;F=w())if(v(y,A+F)){y.offset=h+=F;break}if(void 0===F)return!1;f=y.offset+y.oldStart+y.oldLines}for(var b=0,E=0;E<a.length;E++){var C=a[E],B=C.oldStart+C.offset+b-1;b+=C.newLines-C.oldLines,B<0&&(B=0);for(var S=0;S<C.lines.length;S++){var D=C.lines[S],_=D.length>0?D[0]:" ",k=D.length>0?D.substr(1):D,x=C.linedelimiters[S];if(" "===_)B++;else if("-"===_)r.splice(B,1),i.splice(B,1);else if("+"===_)r.splice(B,0,k),i.splice(B,0,x),B++;else if("\\"===_){var O=C.lines[S-1]?C.lines[S-1][0]:null;"+"===O?p=!0:"-"===O&&(d=!0)}}}if(p)for(;!r[r.length-1];)r.pop(),i.pop();else d&&(r.push(""),i.push("\n"));for(var L=0;L<r.length-1;L++)r[L]=r[L]+i[L];return r.join("")}},function(e,t){"use strict";t.__esModule=!0,t.parsePatch=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.split(/\r\n|[\n\v\f\r\x85]/),r=e.match(/\r\n|[\n\v\f\r\x85]/g)||[],u=[],i=0;function o(){var e={};for(u.push(e);i<n.length;){var r=n[i];if(/^(\-\-\-|\+\+\+|@@)\s/.test(r))break;var o=/^(?:Index:|diff(?: -r \w+)+)\s+(.+?)\s*$/.exec(r);o&&(e.index=o[1]),i++}for(a(e),a(e),e.hunks=[];i<n.length;){var l=n[i];if(/^(Index:|diff|\-\-\-|\+\+\+)\s/.test(l))break;if(/^@@/.test(l))e.hunks.push(s());else{if(l&&t.strict)throw new Error("Unknown line "+(i+1)+" "+JSON.stringify(l));i++}}}function a(e){var t=/^(---|\+\+\+)\s+(.*)$/.exec(n[i]);if(t){var r="---"===t[1]?"old":"new",u=t[2].split("\t",2),o=u[0].replace(/\\\\/g,"\\");/^".*"$/.test(o)&&(o=o.substr(1,o.length-2)),e[r+"FileName"]=o,e[r+"Header"]=(u[1]||"").trim(),i++}}function s(){for(var e=i,u=n[i++],o=u.split(/@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/),a={oldStart:+o[1],oldLines:+o[2]||1,newStart:+o[3],newLines:+o[4]||1,lines:[],linedelimiters:[]},s=0,l=0;i<n.length&&!(0===n[i].indexOf("--- ")&&i+2<n.length&&0===n[i+1].indexOf("+++ ")&&0===n[i+2].indexOf("@@"));i++){var c=0==n[i].length&&i!=n.length-1?" ":n[i][0];if("+"!==c&&"-"!==c&&" "!==c&&"\\"!==c)break;a.lines.push(n[i]),a.linedelimiters.push(r[i]||"\n"),"+"===c?s++:"-"===c?l++:" "===c&&(s++,l++)}if(s||1!==a.newLines||(a.newLines=0),l||1!==a.oldLines||(a.oldLines=0),t.strict){if(s!==a.newLines)throw new Error("Added line count did not match for hunk at line "+(e+1));if(l!==a.oldLines)throw new Error("Removed line count did not match for hunk at line "+(e+1))}return a}for(;i<n.length;)o();return u}},function(e,t){"use strict";t.__esModule=!0,t.default=function(e,t,n){var r=!0,u=!1,i=!1,o=1;return function a(){if(r&&!i){if(u?o++:r=!1,e+o<=n)return o;i=!0}if(!u)return i||(r=!0),t<=e-o?-o++:(u=!0,a())}}},function(e,t,n){"use strict";t.__esModule=!0,t.calcLineCount=a,t.merge=function(e,t,n){e=s(e,n),t=s(t,n);var r={};(e.index||t.index)&&(r.index=e.index||t.index);(e.newFileName||t.newFileName)&&(l(e)?l(t)?(r.oldFileName=c(r,e.oldFileName,t.oldFileName),r.newFileName=c(r,e.newFileName,t.newFileName),r.oldHeader=c(r,e.oldHeader,t.oldHeader),r.newHeader=c(r,e.newHeader,t.newHeader)):(r.oldFileName=e.oldFileName,r.newFileName=e.newFileName,r.oldHeader=e.oldHeader,r.newHeader=e.newHeader):(r.oldFileName=t.oldFileName||e.oldFileName,r.newFileName=t.newFileName||e.newFileName,r.oldHeader=t.oldHeader||e.oldHeader,r.newHeader=t.newHeader||e.newHeader));r.hunks=[];var u=0,i=0,o=0,a=0;for(;u<e.hunks.length||i<t.hunks.length;){var d=e.hunks[u]||{oldStart:1/0},v=t.hunks[i]||{oldStart:1/0};if(f(d,v))r.hunks.push(h(d,o)),u++,a+=d.newLines-d.oldLines;else if(f(v,d))r.hunks.push(h(v,a)),i++,o+=v.newLines-v.oldLines;else{var g={oldStart:Math.min(d.oldStart,v.oldStart),oldLines:0,newStart:Math.min(d.newStart+o,v.oldStart+a),newLines:0,lines:[]};p(g,d.oldStart,d.lines,v.oldStart,v.lines),i++,u++,r.hunks.push(g)}}return r};var r=n(14),u=n(11),i=n(15);function o(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}function a(e){var t=function e(t){var n=0;var r=0;t.forEach(function(t){if("string"!=typeof t){var u=e(t.mine),i=e(t.theirs);void 0!==n&&(u.oldLines===i.oldLines?n+=u.oldLines:n=void 0),void 0!==r&&(u.newLines===i.newLines?r+=u.newLines:r=void 0)}else void 0===r||"+"!==t[0]&&" "!==t[0]||r++,void 0===n||"-"!==t[0]&&" "!==t[0]||n++});return{oldLines:n,newLines:r}}(e.lines),n=t.oldLines,r=t.newLines;void 0!==n?e.oldLines=n:delete e.oldLines,void 0!==r?e.newLines=r:delete e.newLines}function s(e,t){if("string"==typeof e){if(/^@@/m.test(e)||/^Index:/m.test(e))return(0,u.parsePatch)(e)[0];if(!t)throw new Error("Must provide a base reference or pass in a patch");return(0,r.structuredPatch)(void 0,void 0,t,e)}return e}function l(e){return e.newFileName&&e.newFileName!==e.oldFileName}function c(e,t,n){return t===n?t:(e.conflict=!0,{mine:t,theirs:n})}function f(e,t){return e.oldStart<t.oldStart&&e.oldStart+e.oldLines<t.oldStart}function h(e,t){return{oldStart:e.oldStart,oldLines:e.oldLines,newStart:e.newStart+t,newLines:e.newLines,lines:e.lines}}function p(e,t,n,r,u){var i={offset:t,lines:n,index:0},s={offset:r,lines:u,index:0};for(y(e,i,s),y(e,s,i);i.index<i.lines.length&&s.index<s.lines.length;){var l=i.lines[i.index],c=s.lines[s.index];if("-"!==l[0]&&"+"!==l[0]||"-"!==c[0]&&"+"!==c[0])if("+"===l[0]&&" "===c[0]){var f;(f=e.lines).push.apply(f,o(F(i)))}else if("+"===c[0]&&" "===l[0]){var h;(h=e.lines).push.apply(h,o(F(s)))}else"-"===l[0]&&" "===c[0]?v(e,i,s):"-"===c[0]&&" "===l[0]?v(e,s,i,!0):l===c?(e.lines.push(l),i.index++,s.index++):g(e,F(i),F(s));else d(e,i,s)}m(e,i),m(e,s),a(e)}function d(e,t,n){var r=F(t),u=F(n);if(A(r)&&A(u)){var a,s;if((0,i.arrayStartsWith)(r,u)&&w(n,r,r.length-u.length))return void(a=e.lines).push.apply(a,o(r));if((0,i.arrayStartsWith)(u,r)&&w(t,u,u.length-r.length))return void(s=e.lines).push.apply(s,o(u))}else if((0,i.arrayEqual)(r,u)){var l;return void(l=e.lines).push.apply(l,o(r))}g(e,r,u)}function v(e,t,n,r){var u,i=F(t),a=function(e,t){var n=[],r=[],u=0,i=!1,o=!1;for(;u<t.length&&e.index<e.lines.length;){var a=e.lines[e.index],s=t[u];if("+"===s[0])break;if(i=i||" "!==a[0],r.push(s),u++,"+"===a[0])for(o=!0;"+"===a[0];)n.push(a),a=e.lines[++e.index];s.substr(1)===a.substr(1)?(n.push(a),e.index++):o=!0}"+"===(t[u]||"")[0]&&i&&(o=!0);if(o)return n;for(;u<t.length;)r.push(t[u++]);return{merged:r,changes:n}}(n,i);a.merged?(u=e.lines).push.apply(u,o(a.merged)):g(e,r?a:i,r?i:a)}function g(e,t,n){e.conflict=!0,e.lines.push({conflict:!0,mine:t,theirs:n})}function y(e,t,n){for(;t.offset<n.offset&&t.index<t.lines.length;){var r=t.lines[t.index++];e.lines.push(r),t.offset++}}function m(e,t){for(;t.index<t.lines.length;){var n=t.lines[t.index++];e.lines.push(n)}}function F(e){for(var t=[],n=e.lines[e.index][0];e.index<e.lines.length;){var r=e.lines[e.index];if("-"===n&&"+"===r[0]&&(n="+"),n!==r[0])break;t.push(r),e.index++}return t}function A(e){return e.reduce(function(e,t){return e&&"-"===t[0]},!0)}function w(e,t,n){for(var r=0;r<n;r++){var u=t[t.length-n+r].substr(1);if(e.lines[e.index+r]!==" "+u)return!1}return e.index+=n,!0}},function(e,t,n){"use strict";t.__esModule=!0,t.structuredPatch=i,t.createTwoFilesPatch=o,t.createPatch=function(e,t,n,r,u,i){return o(e,e,t,n,r,u,i)};var r=n(5);function u(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}function i(e,t,n,i,o,a,s){s||(s={}),void 0===s.context&&(s.context=4);var l=(0,r.diffLines)(n,i,s);function c(e){return e.map(function(e){return" "+e})}l.push({value:"",lines:[]});for(var f=[],h=0,p=0,d=[],v=1,g=1,y=function(e){var t=l[e],r=t.lines||t.value.replace(/\n$/,"").split("\n");if(t.lines=r,t.added||t.removed){var o;if(!h){var a=l[e-1];h=v,p=g,a&&(d=s.context>0?c(a.lines.slice(-s.context)):[],h-=d.length,p-=d.length)}(o=d).push.apply(o,u(r.map(function(e){return(t.added?"+":"-")+e}))),t.added?g+=r.length:v+=r.length}else{if(h)if(r.length<=2*s.context&&e<l.length-2){var y;(y=d).push.apply(y,u(c(r)))}else{var m,F=Math.min(r.length,s.context);(m=d).push.apply(m,u(c(r.slice(0,F))));var A={oldStart:h,oldLines:v-h+F,newStart:p,newLines:g-p+F,lines:d};if(e>=l.length-2&&r.length<=s.context){var w=/\n$/.test(n),b=/\n$/.test(i);0!=r.length||w?w&&b||d.push("\\ No newline at end of file"):d.splice(A.oldLines,0,"\\ No newline at end of file")}f.push(A),h=0,p=0,d=[]}v+=r.length,g+=r.length}},m=0;m<l.length;m++)y(m);return{oldFileName:e,newFileName:t,oldHeader:o,newHeader:a,hunks:f}}function o(e,t,n,r,u,o,a){var s=i(e,t,n,r,u,o,a),l=[];e==t&&l.push("Index: "+e),l.push("==================================================================="),l.push("--- "+s.oldFileName+(void 0===s.oldHeader?"":"\t"+s.oldHeader)),l.push("+++ "+s.newFileName+(void 0===s.newHeader?"":"\t"+s.newHeader));for(var c=0;c<s.hunks.length;c++){var f=s.hunks[c];l.push("@@ -"+f.oldStart+","+f.oldLines+" +"+f.newStart+","+f.newLines+" @@"),l.push.apply(l,f.lines)}return l.join("\n")+"\n"}},function(e,t){"use strict";function n(e,t){if(t.length>e.length)return!1;for(var n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}t.__esModule=!0,t.arrayEqual=function(e,t){if(e.length!==t.length)return!1;return n(e,t)},t.arrayStartsWith=n},function(e,t){"use strict";t.__esModule=!0,t.convertChangesToDMP=function(e){for(var t=[],n=void 0,r=void 0,u=0;u<e.length;u++)n=e[u],r=n.added?1:n.removed?-1:0,t.push([r,n.value]);return t}},function(e,t){"use strict";function n(e){var t=e;return t=(t=(t=(t=t.replace(/&/g,"&")).replace(/</g,"<")).replace(/>/g,">")).replace(/"/g,""")}t.__esModule=!0,t.convertChangesToXML=function(e){for(var t=[],r=0;r<e.length;r++){var u=e[r];u.added?t.push("<ins>"):u.removed&&t.push("<del>"),t.push(n(u.value)),u.added?t.push("</ins>"):u.removed&&t.push("</del>")}return t.join("")}}])},e.exports=r()},7:function(e,t,n){"use strict";n.d(t,"d",function(){return u}),n.d(t,"e",function(){return i}),n.d(t,"c",function(){return o}),n.d(t,"b",function(){return a}),n.d(t,"a",function(){return s});var r=n(0);
|
||
/**
|
||
* Hexadecimal functions.
|
||
*
|
||
* @author n1474335 [n1474335@gmail.com]
|
||
* @copyright Crown Copyright 2016
|
||
* @license Apache-2.0
|
||
*/function u(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:" ",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2;if(!e)return"";for(var r="",u=0;u<e.length;u++)r+=e[u].toString(16).padStart(n,"0")+t;return"0x"===t&&(r="0x"+r),"\\x"===t&&(r="\\x"+r),t.length?r.slice(0,-t.length):r}function i(e){if(!e)return"";for(var t=[],n=0;n<e.length;n++)t.push((e[n]>>>4).toString(16)),t.push((15&e[n]).toString(16));return t.join("")}function o(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Auto",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2;if("None"!==t){var u="Auto"===t?/[^a-f\d]/gi:r.a.regexRep(t);e=e.replace(u,"")}for(var i=[],o=0;o<e.length;o+=n)i.push(parseInt(e.substr(o,n),16));return i}var a=["Space","Comma","Semi-colon","Colon","Line feed","CRLF","0x","\\x","None"],s=["Auto"].concat(a)},9:function(e,t,n){"use strict";var r=n(0),u=n(12),i=n(4),o=n.n(i),a=n(14),s=n.n(a);function l(e,t,n,r,u,i,o){try{var a=e[i](o),s=a.value}catch(e){return void n(e)}a.done?t(s):Promise.resolve(s).then(r,u)}function c(e){return function(){var t=this,n=arguments;return new Promise(function(r,u){var i=e.apply(t,n);function o(e){l(i,r,u,o,a,"next",e)}function a(e){l(i,r,u,o,a,"throw",e)}o(void 0)})}}function f(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}
|
||
/**
|
||
* @author n1474335 [n1474335@gmail.com]
|
||
* @author Matt C [matt@artemisbot.uk]
|
||
* @copyright Crown Copyright 2016
|
||
* @license Apache-2.0
|
||
*/
|
||
var h=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,n,i;return t=e,n=[{key:"set",value:function(t,n){if("string"==typeof n&&(n=e.typeEnum(n)),s.a.debug("Dish type: "+e.enumLookup(n)),this.value=t,this.type=n,!this.valid()){var i=r.a.truncate(JSON.stringify(this.value),13);throw new u.a("Data is not a valid ".concat(e.enumLookup(n),": ").concat(i))}}},{key:"get",value:function(){var t=c(regeneratorRuntime.mark(function t(n){var r,u=arguments;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(r=u.length>1&&void 0!==u[1]&&u[1],"string"==typeof n&&(n=e.typeEnum(n)),this.type===n){t.next=5;break}return t.next=5,this._translate(n,r);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=c(regeneratorRuntime.mark(function t(n){var i,a,l=arguments;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:i=l.length>1&&void 0!==l[1]&&l[1],s.a.debug("Translating Dish from ".concat(e.enumLookup(this.type)," to ").concat(e.enumLookup(n))),a=i?r.a.byteArrayToChars:r.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?r.a.strToByteArray(this.value):[],t.abrupt("break",31);case 9:return this.value="number"==typeof this.value?r.a.strToByteArray(this.value.toString()):[],t.abrupt("break",31);case 11:return this.value=this.value?r.a.strToByteArray(r.a.unescapeHtml(r.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)?r.a.strToByteArray(this.value.toFixed()):[],t.abrupt("break",31);case 17:return this.value=this.value?r.a.strToByteArray(JSON.stringify(this.value,null,4)):[],t.abrupt("break",31);case 19:return t.next=21,r.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=c(regeneratorRuntime.mark(function e(t){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",r.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 u.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=n,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 u.a("Error translating from byteArray to ".concat(e.enumLookup(n),": ").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 u.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}}}],i=[{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 u.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 u.a("Invalid data type enum. No matching type.")}}}],n&&f(t.prototype,n),i&&f(t,i),e}();h.BYTE_ARRAY=0,h.STRING=1,h.NUMBER=2,h.HTML=3,h.ARRAY_BUFFER=4,h.BIG_NUMBER=5,h.JSON=6,h.FILE=7,h.LIST_FILE=8,t.a=h}}); |