/** * 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(t){var e={};function r(n){if(e[n])return e[n].exports;var a=e[n]={i:n,l:!1,exports:{}};return t[n].call(a.exports,a,a.exports,r),a.l=!0,a.exports}r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var a in t)r.d(n,a,function(e){return t[e]}.bind(null,a));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=1510)}({0:function(t,e,r){"use strict";var n=r(15),a=r.n(n),o=r(10),i=r(7),u=r(19),s=r(18);function c(t,e,r,n,a,o,i){try{var u=t[o](i),s=u.value}catch(t){return void r(t)}u.done?e(s):Promise.resolve(s).then(n,a)}function l(t){return function(){var e=this,r=arguments;return new Promise(function(n,a){var o=t.apply(e,r);function i(t){c(o,n,a,i,u,"next",t)}function u(t){c(o,n,a,i,u,"throw",t)}i(void 0)})}}function h(t,e){for(var r=0;r65535){t-=65536;var e=String.fromCharCode(t>>>10&1023|55296);return t=56320|1023&t,e+String.fromCharCode(t)}return String.fromCharCode(t)}},{key:"ord",value:function(t){if(2===t.length){var e=t.charCodeAt(0),r=t.charCodeAt(1);if(e>=55296&&e<56320&&r>=56320&&r<57344)return 1024*(e-55296)+r-56320+65536}return t.charCodeAt(0)}},{key:"padBytesRight",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=new Array(e);return n.fill(r),Array.prototype.map.call(t,function(t,e){n[e]=t}),n}},{key:"truncate",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"...";return t.length>e&&(t=t.slice(0,e-r.length)+r),t}},{key:"hex",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return(e="string"==typeof e?t.ord(e):e).toString(16).padStart(r,"0")}},{key:"bin",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8;return(e="string"==typeof e?t.ord(e):e).toString(2).padStart(r,"0")}},{key:"printable",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];"object"==typeof window&&window.app&&!window.app.options.treatAsUtf8&&(e=t.byteArrayToChars(t.strToByteArray(e)));return e=e.replace(/[\0-\x08\x0B-\x0C\x0E-\x1F\x7F-\x9F\xAD\u0378\u0379\u037F-\u0383\u038B\u038D\u03A2\u0528-\u0530\u0557\u0558\u0560\u0588\u058B-\u058E\u0590\u05C8-\u05CF\u05EB-\u05EF\u05F5-\u0605\u061C\u061D\u06DD\u070E\u070F\u074B\u074C\u07B2-\u07BF\u07FB-\u07FF\u082E\u082F\u083F\u085C\u085D\u085F-\u089F\u08A1\u08AD-\u08E3\u08FF\u0978\u0980\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09FC-\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A76-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF2-\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B55\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B78-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BFB-\u0C00\u0C04\u0C0D\u0C11\u0C29\u0C34\u0C3A-\u0C3C\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5A-\u0C5F\u0C64\u0C65\u0C70-\u0C77\u0C80\u0C81\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDD\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0D01\u0D04\u0D0D\u0D11\u0D3B\u0D3C\u0D45\u0D49\u0D4F-\u0D56\u0D58-\u0D5F\u0D64\u0D65\u0D76-\u0D78\u0D80\u0D81\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DF1\u0DF5-\u0E00\u0E3B-\u0E3E\u0E5C-\u0E80\u0E83\u0E85\u0E86\u0E89\u0E8B\u0E8C\u0E8E-\u0E93\u0E98\u0EA0\u0EA4\u0EA6\u0EA8\u0EA9\u0EAC\u0EBA\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F48\u0F6D-\u0F70\u0F98\u0FBD\u0FCD\u0FDB-\u0FFF\u10C6\u10C8-\u10CC\u10CE\u10CF\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u137D-\u137F\u139A-\u139F\u13F5-\u13FF\u169D-\u169F\u16F1-\u16FF\u170D\u1715-\u171F\u1737-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17DE\u17DF\u17EA-\u17EF\u17FA-\u17FF\u180F\u181A-\u181F\u1878-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191D-\u191F\u192C-\u192F\u193C-\u193F\u1941-\u1943\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DB-\u19DD\u1A1C\u1A1D\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1A9F\u1AAE-\u1AFF\u1B4C-\u1B4F\u1B7D-\u1B7F\u1BF4-\u1BFB\u1C38-\u1C3A\u1C4A-\u1C4C\u1C80-\u1CBF\u1CC8-\u1CCF\u1CF7-\u1CFF\u1DE7-\u1DFB\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FC5\u1FD4\u1FD5\u1FDC\u1FF0\u1FF1\u1FF5\u1FFF\u200B-\u200F\u202A-\u202E\u2060-\u206F\u2072\u2073\u208F\u209D-\u209F\u20BB-\u20CF\u20F1-\u20FF\u218A-\u218F\u23F4-\u23FF\u2427-\u243F\u244B-\u245F\u2700\u2B4D-\u2B4F\u2B5A-\u2BFF\u2C2F\u2C5F\u2CF4-\u2CF8\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D71-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E3C-\u2E7F\u2E9A\u2EF4-\u2EFF\u2FD6-\u2FEF\u2FFC-\u2FFF\u3040\u3097\u3098\u3100-\u3104\u312E-\u3130\u318F\u31BB-\u31BF\u31E4-\u31EF\u321F\u32FF\u4DB6-\u4DBF\u9FCD-\u9FFF\uA48D-\uA48F\uA4C7-\uA4CF\uA62C-\uA63F\uA698-\uA69E\uA6F8-\uA6FF\uA78F\uA794-\uA79F\uA7AB-\uA7F7\uA82C-\uA82F\uA83A-\uA83F\uA878-\uA87F\uA8C5-\uA8CD\uA8DA-\uA8DF\uA8FC-\uA8FF\uA954-\uA95E\uA97D-\uA97F\uA9CE\uA9DA-\uA9DD\uA9E0-\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A\uAA5B\uAA7C-\uAA7F\uAAC3-\uAADA\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F-\uABBF\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uD7FF\uE000-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBC2-\uFBD2\uFD40-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFE\uFDFF\uFE1A-\uFE1F\uFE27-\uFE2F\uFE53\uFE67\uFE6C-\uFE6F\uFE75\uFEFD-\uFF00\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFDF\uFFE7\uFFEF-\uFFFB\uFFFE\uFFFF]/g,"."),r||(e=e.replace(/[\x09-\x10\x0D\u2028\u2029]/g,".")),e}},{key:"parseEscapedChars",value:function(t){return t.replace(/(\\)?\\([bfnrtv0'"]|x[\da-fA-F]{2}|u[\da-fA-F]{4}|u\{[\da-fA-F]{1,6}\})/g,function(t,e,r){if("\\"===e)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(t){return t.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}},{key:"expandAlphRange",value:function(e){for(var r=[],n=0;n255)return t.strToUtf8ByteArray(e);return n}},{key:"strToUtf8ByteArray",value:function(e){var r=a.a.encode(e);return e.length!==r.length&&("function"==typeof importScripts?self.setOption("attemptHighlight",!1):"object"==typeof window&&(window.app.options.attemptHighlight=!1)),t.strToByteArray(r)}},{key:"strToCharcode",value:function(e){for(var r=[],n=0;n=55296&&a<56320){var o=e[n+1].charCodeAt(0);o>=56320&&o<57344&&(a=t.ord(e[n]+e[++n]))}r.push(a)}return r}},{key:"byteArrayToUtf8",value:function(e){var r=t.byteArrayToChars(e);try{var n=a.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(t){return r}}},{key:"byteArrayToChars",value:function(t){if(!t)return"";for(var e="",r=0;r1&&void 0!==arguments[1])||arguments[1],n=Array.prototype.slice.call(new Uint8Array(e));return r?t.byteArrayToUtf8(n):t.byteArrayToChars(n)}},{key:"parseCSV",value:function(t){var e,r,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[","],a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:["\n","\r"],o=!1,i=!1,u="",s=[],c=[];t.length&&"\ufeff"===t[0]&&(t=t.substr(1));for(var l=0;l=0?(s.push(u),u=""):!i&&a.indexOf(e)>=0?(s.push(u),u="",c.push(s),s=[],a.indexOf(r)>=0&&r!==e&&l++):u+=e:i=!0;return s.length&&(s.push(u),c.push(s)),c}},{key:"stripHtmlTags",value:function(t){return arguments.length>1&&void 0!==arguments[1]&&arguments[1]&&(t=t.replace(/<(script|style)[^>]*>.*<\/(script|style)>/gim,"")),t.replace(/<[^>]+>/g,"")}},{key:"escapeHtml",value:function(t){var e={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`"};return t.replace(/[&<>"'\/`]/g,function(t){return e[t]})}},{key:"unescapeHtml",value:function(t){var e={"&":"&","<":"<",">":">",""":'"',"'":"'","/":"/","`":"`"};return t.replace(/&#?x?[a-z0-9]{2,4};/gi,function(t){return e[t]||t})}},{key:"encodeURIFragment",value:function(t){var e={"%2D":"-","%2E":".","%5F":"_","%7E":"~","%21":"!","%24":"$","%27":"'","%28":"(","%29":")","%2A":"*","%2C":",","%3B":";","%3A":":","%40":"@","%2F":"/","%3F":"?"};return(t=encodeURIComponent(t)).replace(/%[0-9A-F]{2}/g,function(t){return e[t]||t})}},{key:"generatePrettyRecipe",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r="",n="",a="",o="",i="";return t.forEach(function(t){n=t.op.replace(/ /g,"_"),a=JSON.stringify(t.args).slice(1,-1).replace(/'/g,"\\'").replace(/"((?:[^"\\]|\\.)*)"/g,"'$1'").replace(/\\"/g,'"'),o=t.disabled?"/disabled":"",i=t.breakpoint?"/breakpoint":"",r+="".concat(n,"(").concat(a).concat(o).concat(i,")"),e&&(r+="\n")}),r}},{key:"parseRecipeConfig",value:function(t){if(0===(t=t.trim()).length)return[];if("["===t[0])return JSON.parse(t);var e,r;t=t.replace(/\n/g,"");for(var n=/([^(]+)\(((?:'[^'\\]*(?:\\.[^'\\]*)*'|[^)\/'])*)(\/[^)]+)?\)/g,a=[];e=n.exec(t);){r="["+(r=e[2].replace(/"/g,'\\"').replace(/(^|,|{|:)'/g,'$1"').replace(/([^\\]|[^\\]\\\\)'(,|:|}|$)/g,'$1"$2').replace(/\\'/g,"'"))+"]";var o={op:e[1].replace(/_/g," "),args:JSON.parse(r)};e[3]&&e[3].indexOf("disabled")>0&&(o.disabled=!0),e[3]&&e[3].indexOf("breakpoint")>0&&(o.breakpoint=!0),a.push(o)}return a}},{key:"displayFilesAsHTML",value:function(){var e=l(regeneratorRuntime.mark(function e(r){var n,a,i,u,s;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:n=function(e){return"
\n
\n
\n ".concat(t.escapeHtml(e.name),"\n
\n
\n
")},a=function(e,r){if(r.startsWith("image")){var n="data:";return n+=r+";",""}return"
".concat(t.escapeHtml(t.arrayBufferToStr(e.buffer)),"
")},i=function(){var e=l(regeneratorRuntime.mark(function e(r,n){var o,i,u;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.readFile(r);case 2:return o=e.sent,i=new Blob([o],{type:"octet/stream"}),u="
\n
\n
\n \n \n ").concat(r.size.toLocaleString(),' bytes\n \n save\n \n \n
\n
\n
\n
\n ").concat(a(o,r.type),"\n
\n
\n
"),e.abrupt("return",u);case 6:case"end":return e.stop()}},e,this)}));return function(t,r){return e.apply(this,arguments)}}(),u="
\n ".concat(r.length,' file(s) found\n
'),s=0;case 5:if(!(s=t.size)e(a);else{var r=t.slice(o,o+10485760);n.readAsArrayBuffer(r)}};n.onload=function(t){a.set(new Uint8Array(n.result),o),o+=10485760,i()},n.onerror=function(t){r(n.error.message)},i()})}},{key:"mod",value:function(t,e){return(t%e+e)%e}},{key:"gcd",value:function(e,r){return r?t.gcd(r,e%r):e}},{key:"modInv",value:function(t,e){t%=e;for(var r=1;r>=0,e=String(void 0!==e?e:" "),this.length>t?String(this):((t-=this.length)>e.length&&(e+=e.repeat(t/e.length)),e.slice(0,t)+String(this))}),String.prototype.padEnd||(String.prototype.padEnd=function(t,e){return t>>=0,e=String(void 0!==e?e:" "),this.length>t?String(this):((t-=this.length)>e.length&&(e+=e.repeat(t/e.length)),String(this)+e.slice(0,t))})},1:function(t,e,r){"use strict";var n=r(9),a=r(0),o=r(7);function i(t,e){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:"A-Za-z0-9+/=";if(!t)return"";"string"==typeof t&&(t=n.a.strToByteArray(t)),e=n.a.expandAlphRange(e).join("");for(var r,a,o,i,u,s,c,l="",h=0;h>2,u=(3&r)<<4|(a=t[h++])>>4,s=(15&a)<<2|(o=t[h++])>>6,c=63&o,isNaN(a)?s=c=64:isNaN(o)&&(c=64),l+=e.charAt(i)+e.charAt(u)+e.charAt(s)+e.charAt(c);return l}function o(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"A-Za-z0-9+/=",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"string",a=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if(!t)return"string"===r?"":[];e=e||"A-Za-z0-9+/=",e=n.a.expandAlphRange(e).join("");var o,i,u,s,c,l,h=[],f=0;if(a){var p=new RegExp("[^"+e.replace(/[[\]\\\-^$]/g,"\\$&")+"]","g");t=t.replace(p,"")}for(;f>4,i=(15&s)<<4|(c=-1===(c=e.indexOf(t.charAt(f++)||"="))?64:c)>>2,u=(3&c)<<6|(l=-1===(l=e.indexOf(t.charAt(f++)||"="))?64:l),h.push(o),64!==c&&h.push(i),64!==l&&h.push(u);return"string"===r?n.a.byteArrayToUtf8(h):h}var i=[{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"}]},105:function(t,e,r){"use strict";e.LatLonSpherical=r(1377),e.LatLonEllipsoidal=r(452);var n=r(1378);for(var a in n)e.LatLonEllipsoidal[a]=n[a];e.LatLonVectors=r(1379),e.Vector3d=r(586),e.Utm=r(719),e.Mgrs=r(1380),e.OsGridRef=r(1381),e.Dms=r(501)},12:function(t,e,r){"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function a(t){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function o(t,e){return(o=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function i(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function u(t){function e(){var e=Reflect.construct(t,Array.from(arguments));return Object.setPrototypeOf(e,Object.getPrototypeOf(this)),e}return e.prototype=Object.create(t.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t,e} /** * 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(t){function e(){var t,r,o,u;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);for(var s=arguments.length,c=new Array(s),l=0;l0?d:2*Math.PI-d),y=(Math.sin(s-i)>0?2*Math.PI-g:g)-l;if(0==Math.sin(v)&&0==Math.sin(y))return null;if(Math.sin(v)*Math.sin(y)<0)return null;var m=-Math.cos(v)*Math.cos(y)+Math.sin(v)*Math.sin(y)*Math.cos(p),b=Math.atan2(Math.sin(p)*Math.sin(v)*Math.sin(y),Math.cos(y)+Math.cos(v)*m),M=Math.asin(Math.sin(o)*Math.cos(b)+Math.cos(o)*Math.sin(b)*Math.cos(c)),w=i+Math.atan2(Math.sin(c)*Math.sin(b)*Math.cos(o),Math.cos(b)-Math.sin(o)*Math.sin(M));return new a(M.toDegrees(),(w.toDegrees()+540)%360-180)},a.prototype.crossTrackDistanceTo=function(t,e,r){if(!(t instanceof a))throw new TypeError("‘pathStart’ is not LatLon object");if(!(e instanceof a))throw new TypeError("‘pathEnd’ is not LatLon object");var n=void 0===r?6371e3:Number(r),o=t.distanceTo(this,n)/n,i=t.bearingTo(this).toRadians(),u=t.bearingTo(e).toRadians();return Math.asin(Math.sin(o)*Math.sin(i-u))*n},a.prototype.alongTrackDistanceTo=function(t,e,r){if(!(t instanceof a))throw new TypeError("‘pathStart’ is not LatLon object");if(!(e instanceof a))throw new TypeError("‘pathEnd’ is not LatLon object");var n=void 0===r?6371e3:r,o=t.distanceTo(this,n)/n,i=t.bearingTo(this).toRadians(),u=t.bearingTo(e).toRadians(),s=Math.asin(Math.sin(o)*Math.sin(i-u));return Math.acos(Math.cos(o)/Math.abs(Math.cos(s)))*Math.sign(Math.cos(u-i))*n},a.prototype.maxLatitude=function(t){var e=Number(t).toRadians(),r=this.lat.toRadians();return Math.acos(Math.abs(Math.sin(e)*Math.cos(r))).toDegrees()},a.crossingParallels=function(t,e,r){var n=Number(r).toRadians(),a=t.lat.toRadians(),o=t.lon.toRadians(),i=e.lat.toRadians(),u=e.lon.toRadians()-o,s=Math.sin(a)*Math.cos(i)*Math.cos(n)*Math.sin(u),c=Math.sin(a)*Math.cos(i)*Math.cos(n)*Math.cos(u)-Math.cos(a)*Math.sin(i)*Math.cos(n),l=Math.cos(a)*Math.cos(i)*Math.sin(n)*Math.sin(u);if(l*l>s*s+c*c)return null;var h=Math.atan2(-c,s),f=Math.acos(l/Math.sqrt(s*s+c*c)),p=o+h+f;return{lon1:((o+h-f).toDegrees()+540)%360-180,lon2:(p.toDegrees()+540)%360-180}},a.prototype.rhumbDistanceTo=function(t,e){if(!(t instanceof a))throw new TypeError("point is not LatLon object");var r=e=void 0===e?6371e3:Number(e),n=this.lat.toRadians(),o=t.lat.toRadians(),i=o-n,u=Math.abs(t.lon-this.lon).toRadians();u>Math.PI&&(u-=2*Math.PI);var s=Math.log(Math.tan(o/2+Math.PI/4)/Math.tan(n/2+Math.PI/4)),c=Math.abs(s)>1e-11?i/s:Math.cos(n);return Math.sqrt(i*i+c*c*u*u)*r},a.prototype.rhumbBearingTo=function(t){if(!(t instanceof a))throw new TypeError("point is not LatLon object");var e=this.lat.toRadians(),r=t.lat.toRadians(),n=(t.lon-this.lon).toRadians();n>Math.PI&&(n-=2*Math.PI),n<-Math.PI&&(n+=2*Math.PI);var o=Math.log(Math.tan(r/2+Math.PI/4)/Math.tan(e/2+Math.PI/4));return(Math.atan2(n,o).toDegrees()+360)%360},a.prototype.rhumbDestinationPoint=function(t,e,r){r=void 0===r?6371e3:r;var n=this.lat.toRadians(),o=this.lon.toRadians(),i=Number(e).toRadians(),u=t/r,s=u*Math.cos(i),c=n+s;Math.abs(c)>Math.PI/2&&(c=c>0?Math.PI-c:-Math.PI-c);var l=Math.log(Math.tan(c/2+Math.PI/4)/Math.tan(n/2+Math.PI/4)),h=Math.abs(l)>1e-11?s/l:Math.cos(n),f=o+u*Math.sin(i)/h;return new a(c.toDegrees(),(f.toDegrees()+540)%360-180)},a.prototype.rhumbMidpointTo=function(t){if(!(t instanceof a))throw new TypeError("point is not LatLon object");var e=this.lat.toRadians(),r=this.lon.toRadians(),n=t.lat.toRadians(),o=t.lon.toRadians();Math.abs(o-r)>Math.PI&&(r+=2*Math.PI);var i=(e+n)/2,u=Math.tan(Math.PI/4+e/2),s=Math.tan(Math.PI/4+n/2),c=Math.tan(Math.PI/4+i/2),l=((o-r)*Math.log(c)+r*Math.log(s)-o*Math.log(u))/Math.log(s/u);return isFinite(l)||(l=(r+o)/2),a(i.toDegrees(),(l.toDegrees()+540)%360-180)},a.areaOf=function(t,e){var r=void 0===e?6371e3:Number(e),n=t[0].equals(t[t.length-1]);n||t.push(t[0]);for(var a=t.length-1,o=0,i=0;i1e-12&&++D<100);if(D>=100)throw new Error("Formula failed to converge");var B=m*a-y*o*g,C=Math.atan2(m*o+y*a*g,(1-p)*Math.sqrt(M*M+B*B)),S=p/16*w*(4+p*(4-3*w)),R=(s+(Math.atan2(a*d,y*o-m*a*g)-(1-S)*p*M*(N+S*a*(r+S*o*(2*r*r-1))))+3*Math.PI)%(2*Math.PI)-Math.PI,x=Math.atan2(M,-B);return x=(x+2*Math.PI)%(2*Math.PI),{point:new n(C.toDegrees(),R.toDegrees(),this.datum),finalBearing:x.toDegrees(),iterations:D}},n.prototype.inverse=function(t){var e=t;-180==this.lon&&(this.lon=180);var r,n,a,o,i,u,s=this.lat.toRadians(),c=this.lon.toRadians(),l=e.lat.toRadians(),h=e.lon.toRadians(),f=this.datum.ellipsoid.a,p=this.datum.ellipsoid.b,d=this.datum.ellipsoid.f,g=h-c,v=(1-d)*Math.tan(s),y=1/Math.sqrt(1+v*v),m=v*y,b=(1-d)*Math.tan(l),M=1/Math.sqrt(1+b*b),w=b*M,A=0,F=0,E=0,N=0,D=0,B=g,C=0,S=Math.abs(g)>Math.PI;do{if(0==(a=M*(r=Math.sin(B))*(M*r)+(y*w-m*M*(n=Math.cos(B)))*(y*w-m*M*n)))break;if(F=m*w+y*M*n,u=B,B=g+(1-(i=d/16*(N=1-(o=y*M*r/(A=Math.sqrt(a)))*o)*(4+d*(4-3*N))))*d*o*((E=Math.atan2(A,F))+i*A*((D=0!=N?F-2*m*w/N:0)+i*F*(2*D*D-1))),(S?Math.abs(B)-Math.PI:Math.abs(B))>Math.PI)throw new Error("λ > π")}while(Math.abs(B-u)>1e-12&&++C<1e3);if(C>=1e3)throw new Error("Formula failed to converge");var R=N*(f*f-p*p)/(p*p),x=R/1024*(256+R*(R*(74-47*R)-128)),L=p*(1+R/16384*(4096+R*(R*(320-175*R)-768)))*(E-x*A*(D+x/4*(F*(2*D*D-1)-x/6*D*(4*A*A-3)*(4*D*D-3)))),T=Math.atan2(M*r,y*w-m*M*n),k=Math.atan2(y*r,-m*M+y*w*n);return T=(T+2*Math.PI)%(2*Math.PI),k=(k+2*Math.PI)%(2*Math.PI),{distance:L,initialBearing:0==L?NaN:T.toDegrees(),finalBearing:0==L?NaN:k.toDegrees(),iterations:C}},void 0===Number.prototype.toRadians&&(Number.prototype.toRadians=function(){return this*Math.PI/180}),void 0===Number.prototype.toDegrees&&(Number.prototype.toDegrees=function(){return 180*this/Math.PI}),t.exports&&(t.exports=n)},1379:function(t,e,r){"use strict";if(t.exports)var n=r(586);if(t.exports)var a=r(501);function o(t,e){if(!(this instanceof o))return new o(t,e);this.lat=Number(t),this.lon=Number(e)}o.prototype.toVector=function(){var t=this.lat.toRadians(),e=this.lon.toRadians(),r=Math.cos(t)*Math.cos(e),a=Math.cos(t)*Math.sin(e),o=Math.sin(t);return new n(r,a,o)},n.prototype.toLatLonS=function(){var t=Math.atan2(this.z,Math.sqrt(this.x*this.x+this.y*this.y)),e=Math.atan2(this.y,this.x);return new o(t.toDegrees(),e.toDegrees())},o.prototype.greatCircle=function(t){var e=this.lat.toRadians(),r=this.lon.toRadians(),a=Number(t).toRadians(),o=Math.sin(r)*Math.cos(a)-Math.sin(e)*Math.cos(r)*Math.sin(a),i=-Math.cos(r)*Math.cos(a)-Math.sin(e)*Math.sin(r)*Math.sin(a),u=Math.cos(e)*Math.sin(a);return new n(o,i,u)},n.prototype.greatCircle=function(t){var e=Number(t).toRadians(),r=new n(0,0,1).cross(this),a=this.cross(r),o=r.times(Math.cos(e)/r.length());return a.times(Math.sin(e)/a.length()).minus(o)},o.prototype.distanceTo=function(t,e){if(!(t instanceof o))throw new TypeError("point is not LatLon object");e=void 0===e?6371e3:Number(e);var r=this.toVector(),n=t.toVector();return r.angleTo(n)*e},o.prototype.bearingTo=function(t){if(!(t instanceof o))throw new TypeError("point is not LatLon object");var e=this.toVector(),r=t.toVector(),a=new n(0,0,1),i=e.cross(r),u=e.cross(a);return(i.angleTo(u,e).toDegrees()+360)%360},o.prototype.midpointTo=function(t){if(!(t instanceof o))throw new TypeError("point is not LatLon object");var e=this.toVector(),r=t.toVector();return e.plus(r).unit().toLatLonS()},o.prototype.intermediatePointTo=function(t,e){if(!(t instanceof o))throw new TypeError("point is not LatLon object");var r=this.toVector(),a=t.toVector(),i=r.cross(a).length(),u=r.dot(a),s=Math.atan2(i,u)*Number(e),c=Math.sin(s),l=Math.cos(s),h=r.cross(a).unit().cross(r),f=r.times(l).plus(h.times(c));return new n(f.x,f.y,f.z).toLatLonS()},o.prototype.intermediatePointOnChordTo=function(t,e){if(!(t instanceof o))throw new TypeError("point is not LatLon object");var r=this.toVector(),a=t.toVector(),i=r.plus(a.minus(r).times(Number(e)));return new n(i.x,i.y,i.z).toLatLonS()},o.prototype.destinationPoint=function(t,e,r){r=void 0===r?6371e3:Number(r);var a=this.toVector(),o=Number(t)/r,i=Number(e).toRadians(),u=new n(0,0,1).cross(a).unit(),s=a.cross(u),c=u.times(Math.sin(i)),l=s.times(Math.cos(i)).plus(c),h=a.times(Math.cos(o)),f=l.times(Math.sin(o));return h.plus(f).toLatLonS()},o.intersection=function(t,e,r,n){if(!(t instanceof o))throw new TypeError("path1start is not LatLon object");if(!(r instanceof o))throw new TypeError("path2start is not LatLon object");if(!(e instanceof o)&&isNaN(e))throw new TypeError("path1brngEnd is not LatLon object or bearing");if(!(n instanceof o)&&isNaN(n))throw new TypeError("path2brngEnd is not LatLon object or bearing");var a,i,u,s,c=t.toVector(),l=r.toVector();e instanceof o?(a=c.cross(e.toVector()),u="endpoint"):(a=t.greatCircle(Number(e)),u="bearing"),n instanceof o?(i=l.cross(n.toVector()),s="endpoint"):(i=r.greatCircle(Number(n)),s="bearing");var h=a.cross(i),f=i.cross(a),p=null;switch(u+"+"+s){case"bearing+bearing":switch(Math.sign(a.cross(c).dot(h))+Math.sign(i.cross(l).dot(h))){case 2:p=h;break;case-2:p=f;break;case 0:p=c.plus(l).dot(h)>0?f:h}break;case"bearing+endpoint":p=Math.sign(a.cross(c).dot(h))>0?h:f;break;case"endpoint+bearing":p=Math.sign(i.cross(l).dot(h))>0?h:f;break;case"endpoint+endpoint":p=c.plus(l).plus(e.toVector()).plus(n.toVector()).dot(h)>0?h:f}return p.toLatLonS()},o.prototype.crossTrackDistanceTo=function(t,e,r){if(!(t instanceof o))throw new TypeError("pathStart is not LatLon object");var n=void 0===r?6371e3:Number(r),a=this.toVector();return((e instanceof o?t.toVector().cross(e.toVector()):t.greatCircle(Number(e))).angleTo(a)-Math.PI/2)*n},o.prototype.alongTrackDistanceTo=function(t,e,r){if(!(t instanceof o))throw new TypeError("pathStart is not LatLon object");var n=void 0===r?6371e3:Number(r),a=this.toVector(),i=e instanceof o?t.toVector().cross(e.toVector()):t.greatCircle(Number(e)),u=i.cross(a).cross(i);return t.toVector().angleTo(u,i)*n},o.prototype.nearestPointOnSegment=function(t,e){var r=null;if(this.isBetween(t,e)){var n=this.toVector(),a=t.toVector(),o=e.toVector(),i=a.cross(o),u=n.cross(i);r=i.cross(u).toLatLonS()}else{r=this.distanceTo(t)=0&&l>=0,f=r.dot(n)>=0&&r.dot(a)>=0;return h&&f},o.prototype.enclosedBy=function(t){var e=t[0].equals(t[t.length-1]);e||t.push(t[0]);for(var r=t.length-1,n=this.toVector(),a=[],o=0;oMath.PI;return e||t.pop(),u},o.areaOf=function(t,e){var r=null==e?6371e3:Number(e),n=t[0].equals(t[t.length-1]);n||t.push(t[0]);for(var a=t.length-1,o=[],i=0;i0?1:-1}),t.exports&&(t.exports=o,t.exports.Vector3d=n)},1380:function(t,e,r){"use strict";if(t.exports)var n=r(719);if(t.exports)var a=r(452);function o(t,e,r,n,i,u,s){if(!(this instanceof o))return new o(t,e,r,n,i,u,s);if(void 0===s&&(s=a.datum.WGS84),!(1<=t&&t<=60))throw new Error("Invalid MGRS grid reference (zone ‘"+t+"’)");if(1!=e.length)throw new Error("Invalid MGRS grid reference (band ‘"+e+"’)");if(-1==o.latBands.indexOf(e))throw new Error("Invalid MGRS grid reference (band ‘"+e+"’)");if(1!=r.length)throw new Error("Invalid MGRS grid reference (e100k ‘"+r+"’)");if(1!=n.length)throw new Error("Invalid MGRS grid reference (n100k ‘"+n+"’)");this.zone=Number(t),this.band=e,this.e100k=r,this.n100k=n,this.easting=Number(i),this.northing=Number(u),this.datum=s}o.latBands="CDEFGHJKLMNPQRSTUVWXX",o.e100kLetters=["ABCDEFGH","JKLMNPQR","STUVWXYZ"],o.n100kLetters=["ABCDEFGHJKLMNPQRSTUV","FGHJKLMNPQRSTUVABCDE"],n.prototype.toMgrs=function(){if(isNaN(this.zone+this.easting+this.northing))throw new Error("Invalid UTM coordinate ‘"+this.toString()+"’");var t=this.zone,e=this.toLatLonE(),r=o.latBands.charAt(Math.floor(e.lat/8+10)),n=Math.floor(this.easting/1e5),a=o.e100kLetters[(t-1)%3].charAt(n-1),i=Math.floor(this.northing/1e5)%20,u=o.n100kLetters[(t-1)%2].charAt(i),s=this.easting%1e5,c=this.northing%1e5;return new o(t,r,a,u,s=Number(s.toFixed(6)),c=Number(c.toFixed(6)))},o.prototype.toUtm=function(){for(var t=this.zone,e=this.band,r=this.e100k,i=this.n100k,u=this.easting,s=this.northing,c=e>="N"?"N":"S",l=1e5*(o.e100kLetters[(t-1)%3].indexOf(r)+1),h=1e5*o.n100kLetters[(t-1)%2].indexOf(i),f=8*(o.latBands.indexOf(e)-10),p=1e5*Math.floor(new a(f,0).toUtm().northing/1e5),d=0;d+h+s=5?c:(c+"00000").slice(0,5),l=l.length>=5?l:(l+"00000").slice(0,5))},o.prototype.toString=function(t){if(t=void 0===t?10:Number(t),-1==[2,4,6,8,10].indexOf(t))throw new Error("Invalid precision ‘"+t+"’");var e=("00"+this.zone).slice(-2),r=this.band,n=this.e100k,a=this.n100k,o=Math.floor(this.easting/Math.pow(10,5-t/2)),i=Math.floor(this.northing/Math.pow(10,5-t/2));return e+r+" "+n+a+" "+("00000"+o).slice(-t/2)+" "+("00000"+i).slice(-t/2)},t.exports&&(t.exports=o)},1381:function(t,e,r){"use strict";if(t.exports)var n=r(452);function a(t,e){if(!(this instanceof a))return new a(t,e);this.easting=Number(t),this.northing=Number(e)}a.latLonToOsGrid=function(t){if(!(t instanceof n))throw new TypeError("point is not LatLon object");t.datum!=n.datum.OSGB36&&(t=t.convertDatum(n.datum.OSGB36));var e=t.lat.toRadians(),r=t.lon.toRadians(),o=6377563.396,i=6356256.909,u=.9996012717,s=49..toRadians(),c=(-2).toRadians(),l=1-i*i/(o*o),h=(o-i)/(o+i),f=h*h,p=h*h*h,d=Math.cos(e),g=Math.sin(e),v=o*u/Math.sqrt(1-l*g*g),y=o*u*(1-l)/Math.pow(1-l*g*g,1.5),m=v/y-1,b=i*u*((1+h+5/4*f+5/4*p)*(e-s)-(3*h+3*h*h+21/8*p)*Math.sin(e-s)*Math.cos(e+s)+(15/8*f+15/8*p)*Math.sin(2*(e-s))*Math.cos(2*(e+s))-35/24*p*Math.sin(3*(e-s))*Math.cos(3*(e+s))),M=d*d*d,w=M*d*d,A=Math.tan(e)*Math.tan(e),F=A*A,E=r-c,N=E*E,D=N*E,B=D*E,C=B*E,S=b+-1e5+v/2*g*d*N+v/24*g*M*(5-A+9*m)*B+v/720*g*w*(61-58*A+F)*(C*E),R=4e5+v*d*E+v/6*M*(v/y-A)*D+v/120*w*(5-18*A+F+14*m-58*A*m)*C;return S=Number(S.toFixed(3)),new a(R=Number(R.toFixed(3)),S)},a.osGridToLatLon=function(t,e){if(!(t instanceof a))throw new TypeError("gridref is not OsGridRef object");void 0===e&&(e=n.datum.WGS84);var r=t.easting,o=t.northing,i=6377563.396,u=6356256.909,s=.9996012717,c=49..toRadians(),l=(-2).toRadians(),h=1-u*u/(i*i),f=(i-u)/(i+u),p=f*f,d=f*f*f,g=c,v=0;do{v=u*s*((1+f+5/4*p+5/4*d)*((g=(o- -1e5-v)/(i*s)+g)-c)-(3*f+3*f*f+21/8*d)*Math.sin(g-c)*Math.cos(g+c)+(15/8*p+15/8*d)*Math.sin(2*(g-c))*Math.cos(2*(g+c))-35/24*d*Math.sin(3*(g-c))*Math.cos(3*(g+c)))}while(o- -1e5-v>=1e-5);var y=Math.cos(g),m=Math.sin(g),b=i*s/Math.sqrt(1-h*m*m),M=i*s*(1-h)/Math.pow(1-h*m*m,1.5),w=b/M-1,A=Math.tan(g),F=A*A,E=F*F,N=1/y,D=b*b*b,B=D*b*b,C=r-4e5,S=C*C,R=S*C,x=S*S,L=R*S,T=l+N/b*C-N/(6*D)*(b/M+2*F)*R+N/(120*B)*(5+28*F+24*E)*L-N/(5040*(B*b*b))*(61+662*F+1320*E+720*(E*F))*(L*S),k=new n((g=g-A/(2*M*b)*S+A/(24*M*D)*(5+3*F+w-9*F*w)*x-A/(720*M*B)*(61+90*F+45*E)*(x*S)).toDegrees(),T.toDegrees(),n.datum.OSGB36);return e!=n.datum.OSGB36&&(k=k.convertDatum(e)),k},a.parse=function(t){var e=(t=String(t).trim()).match(/^(\d+),\s*(\d+)$/);if(e)return new a(e[1],e[2]);if(!(e=t.match(/^[A-Z]{2}\s*[0-9]+\s*[0-9]+$/i)))throw new Error("Invalid grid reference");var r=t.toUpperCase().charCodeAt(0)-"A".charCodeAt(0),n=t.toUpperCase().charCodeAt(1)-"A".charCodeAt(0);r>7&&r--,n>7&&n--;var o=(r-2)%5*5+n%5,i=19-5*Math.floor(r/5)-Math.floor(n/5),u=t.slice(2).trim().split(/\s+/);if(1==u.length&&(u=[u[0].slice(0,u[0].length/2),u[0].slice(u[0].length/2)]),o<0||o>6||i<0||i>12)throw new Error("Invalid grid reference");if(2!=u.length)throw new Error("Invalid grid reference");if(u[0].length!=u[1].length)throw new Error("Invalid grid reference");return u[0]=(u[0]+"00000").slice(0,5),u[1]=(u[1]+"00000").slice(0,5),new a(o+u[0],i+u[1])},a.prototype.toString=function(t){if(t=void 0===t?10:Number(t),isNaN(t)||t%2!=0||t>16)throw new RangeError("Invalid precision ‘"+t+"’");var e=this.easting,r=this.northing;if(isNaN(e)||isNaN(r))throw new Error("Invalid grid reference");if(0==t){var n=Math.floor(e),a=e-n,o=Math.floor(r),i=r-o;return("000000"+n).slice(-6)+(a>0?a.toFixed(3).slice(1):"")+","+((o<1e6?("000000"+o).slice(-6):o)+(i>0?i.toFixed(3).slice(1):""))}var u=Math.floor(e/1e5),s=Math.floor(r/1e5);if(u<0||u>6||s<0||s>12)return"";var c=19-s-(19-s)%5+Math.floor((u+10)/5),l=5*(19-s)%25+u%5;c>7&&c++,l>7&&l++;var h=String.fromCharCode(c+"A".charCodeAt(0),l+"A".charCodeAt(0));return e=Math.floor(e%1e5/Math.pow(10,5-t/2)),r=Math.floor(r%1e5/Math.pow(10,5-t/2)),h+" "+(e=("00000000"+e).slice(-t/2))+" "+(r=("00000000"+r).slice(-t/2))},t.exports&&(t.exports=a)},14:function(t,e,r){var n,a;!function(o,i){"use strict";void 0===(a="function"==typeof(n=function(){var t=function(){},e="undefined",r=["trace","debug","info","warn","error"];function n(t,e){var r=t[e];if("function"==typeof r.bind)return r.bind(t);try{return Function.prototype.bind.call(r,t)}catch(e){return function(){return Function.prototype.apply.apply(r,[t,arguments])}}}function a(e,n){for(var a=0;a=0&&n<=s.levels.SILENT))throw"log.setLevel() called with invalid level: "+n;if(u=n,!1!==o&&function(t){var n=(r[t]||"silent").toUpperCase();if(typeof window===e)return;try{return void(window.localStorage[c]=n)}catch(t){}try{window.document.cookie=encodeURIComponent(c)+"="+n+";"}catch(t){}}(n),a.call(s,n,t),typeof console===e&&n=55296&&e<=56319&&a=55296&&t<=57343)throw Error("Lone surrogate U+"+t.toString(16).toUpperCase()+" is not a scalar value")}function u(t,e){return a(t>>e&63|128)}function s(t){if(0==(4294967168&t))return a(t);var e="";return 0==(4294965248&t)?e=a(t>>6&31|192):0==(4294901760&t)?(i(t),e=a(t>>12&15|224),e+=u(t,6)):0==(4292870144&t)&&(e=a(t>>18&7|240),e+=u(t,12),e+=u(t,6)),e+=a(63&t|128)}function c(){if(n>=r)throw Error("Invalid byte index");var t=255&e[n];if(n++,128==(192&t))return 63&t;throw Error("Invalid continuation byte")}function l(){var t,a;if(n>r)throw Error("Invalid byte index");if(n==r)return!1;if(t=255&e[n],n++,0==(128&t))return t;if(192==(224&t)){if((a=(31&t)<<6|c())>=128)return a;throw Error("Invalid continuation byte")}if(224==(240&t)){if((a=(15&t)<<12|c()<<6|c())>=2048)return i(a),a;throw Error("Invalid continuation byte")}if(240==(248&t)&&(a=(7&t)<<18|c()<<12|c()<<6|c())>=65536&&a<=1114111)return a;throw Error("Invalid UTF-8 detected")}t.version="3.0.0",t.encode=function(t){for(var e=o(t),r=e.length,n=-1,a="";++n65535&&(o+=a((e-=65536)>>>10&1023|55296),e=56320|1023&e),o+=a(e);return o}(u)}}(e)},1510:function(t,e,r){"use strict";r.r(e);var n=r(1),a=r(630),o=r.n(a),i=r(105),u=r.n(i),s=r(3);function c(t,e){return function(t){if(Array.isArray(t))return t} /** * Co-ordinate conversion resources. * * @author j433866 [j433866@gmail.com] * @copyright Crown Copyright 2019 * @license Apache-2.0 */(t)||function(t,e){var r=[],n=!0,a=!1,o=void 0;try{for(var i,u=t[Symbol.iterator]();!(n=(i=u.next()).done)&&(r.push(i.value),!e||r.length!==e);n=!0);}catch(t){a=!0,o=t}finally{try{n||null==u.return||u.return()}finally{if(a)throw o}}return r}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var l=["Degrees Minutes Seconds","Degrees Decimal Minutes","Decimal Degrees","Geohash","Military Grid Reference System","Ordnance Survey National Grid","Universal Transverse Mercator"],h=["Geohash","Military Grid Reference System","Ordnance Survey National Grid","Universal Transverse Mercator"];function f(t,e,r,n,a,i,l){var f,M,w,A,F,E,N,D,B,C,S,R=!1;if(l<0&&(l=0),"Auto"===r){if(null===(r=function(t){t=t.trim();var e=[",",";",":"],r=t.match(/[NnEeSsWw]/g);if(null!==r&&r.length>0&&r.length<3){var n=t.split(/[NnEeSsWw]/);if(n.length<=3&&n.length>0){if(""===n[0])return"Direction Preceding";if(""===n[n.length-1])return"Direction Following"}}for(var a=0;a0)return o}}return null}(t)))throw new s.a("Unable to detect the input delimiter automatically.")}else r.includes("Direction")||(r=b(r));if("Auto"===e&&null===(e=function(t,e){var r,n=new RegExp(/^[0-9]{2}\s?[C-HJ-NP-X]{1}\s?[A-HJ-NP-Z][A-HJ-NP-V]\s?[0-9\s]+/),a=new RegExp(/^[A-HJ-Z]{2}\s+[0-9\s]+$/),o=new RegExp(/^[0123456789BCDEFGHJKMNPQRSTUVWXYZ]+$/),i=new RegExp(/^[0-9]{2}\s?[C-HJ-NP-X]\s[0-9.]+\s?[0-9.]+$/),u=new RegExp(/[°'"]/g);if(t=t.trim(),null!==e&&e.includes("Direction")){var s=t.split(/[NnEeSsWw]/);s.length>1&&(r=""===s[0]?s[1]:s[0])}else if(null!==e&&""!==e)if(t.includes(e)){var c=t.split(e);c.length>1&&(r=""===c[0]?c[1]:c[0])}else r=t;if(!u.test(t)){var l=t.toUpperCase().replace(e,"");if(i.test(l))return"Universal Transverse Mercator";if(n.test(l))return"Military Grid Reference System";if(a.test(l))return"Ordnance Survey National Grid";if(o.test(l))return"Geohash"}if(void 0!==r){var h=p(r);switch(h.length){case 3:return"Degrees Minutes Seconds";case 2:return"Degrees Decimal Minutes";case 1:return"Decimal Degrees"}}return null}(t,r)))throw new s.a("Unable to detect the input format automatically.");if(a=b(a),h.includes(e))t=t.replace(r,""),R=!0;else{r.includes("Direction")?""===(f=t.split(/[NnEeSsWw]/g))[0]&&(f=f.slice(1)):f=t.split(r);for(var x=0;x1&&(R=!0)}switch(e){case"Geohash":E=o.a.decode(t.replace(/[^A-Za-z0-9]/g,"")),M=new u.a.LatLonEllipsoidal(E.latitude,E.longitude);break;case"Military Grid Reference System":M=u.a.Mgrs.parse(t.replace(/[^A-Za-z0-9]/g,"")).toUtm().toLatLonE();break;case"Ordnance Survey National Grid":N=u.a.OsGridRef.parse(t.replace(/[^A-Za-z0-9]/g,"")),M=u.a.OsGridRef.osGridToLatLon(N);break;case"Universal Transverse Mercator":/^[\d]{2}[A-Za-z]/.test(t)&&(t=t.slice(0,2)+" "+t.slice(2)),M=u.a.Utm.parse(t).toLatLonE();break;case"Degrees Minutes Seconds":if(R){if(D=p(f[0]),B=p(f[1]),!(D.length>=3&&B.length>=3))throw new s.a("Invalid co-ordinate format for Degrees Minutes Seconds");C=d(D[0],D[1],D[2],10),S=d(B[0],B[1],B[2],10),M=new u.a.LatLonEllipsoidal(C.degrees,S.degrees)}else{if(!((D=p(f[0])).length>=3))throw new s.a("Invalid co-ordinate format for Degrees Minutes Seconds");C=d(D[0],D[1],D[2]),M=new u.a.LatLonEllipsoidal(C.degrees,C.degrees)}break;case"Degrees Decimal Minutes":if(R){if(D=p(f[0]),B=p(f[1]),2!==D.length||2!==B.length)throw new s.a("Invalid co-ordinate format for Degrees Decimal Minutes.");C=g(D[0],D[1],10),S=g(B[0],B[1],10),M=new u.a.LatLonEllipsoidal(C.degrees,S.degrees)}else{if(2!==(D=p(t)).length)throw new s.a("Invalid co-ordinate format for Degrees Decimal Minutes.");C=g(D[0],D[1],10),M=new u.a.LatLonEllipsoidal(C.degrees,C.degrees)}break;case"Decimal Degrees":if(R){if(D=p(f[0]),B=p(f[1]),1!==D.length||1!==B.length)throw new s.a("Invalid co-ordinate format for Decimal Degrees.");M=new u.a.LatLonEllipsoidal(D[0],B[0])}else{if(1!==(D=p(f[0])).length)throw new s.a("Invalid co-ordinate format for Decimal Degrees.");M=new u.a.LatLonEllipsoidal(D[0],D[0])}break;default:throw new s.a("Unknown input format '".concat(e,"'"))}if(e.includes("Degrees")){var L=t.toUpperCase().match(/[NESW]/g);L&&L.length>=1&&(("S"===L[0]||"W"===L[0]&&M.lat>0)&&(M.lat=-M.lat),L.length>=2&&("S"===L[1]||"W"===L[1]&&M.lon>0)&&(M.lon=-M.lon))}var T=c(function(t,e){var r=t.toUpperCase(),n=new RegExp(/[NESW]/g),a=r.match(n);if(a&&a.length<=2&&a.length>=1)return 2===a.length?[a[0],a[1]]:[a[0],""];var o,i=r,u="",s="";if(e.includes("Direction")){var c=r.split(n);c.length>1&&(i=""===c[0]?c[1]:c[0],c.length>2&&""!==c[2]&&(o=c[2]))}else if(r.includes(e)){var l=r.split(e);l.length>=1&&(""!==l[0]&&(i=l[0]),l.length>=2&&""!==l[1]&&(o=l[1]))}i&&(i=parseFloat(i),u=i<0?"S":"N");o&&(o=parseFloat(o),s=o<0?"W":"E");return[u,s]}(M.lat+","+M.lon,","),2),k=T[0],O=T[1];switch(n){case"Decimal Degrees":C=v(M.lat,l),S=v(M.lon,l),w=C.string,A=S.string;break;case"Degrees Decimal Minutes":C=m(M.lat,l),S=m(M.lon,l),w=C.string,A=S.string;break;case"Degrees Minutes Seconds":C=y(M.lat,l),S=y(M.lon,l),w=C.string,A=S.string;break;case"Geohash":w=o.a.encode(M.lat,M.lon,l);break;case"Military Grid Reference System":l%2!=0&&(l+=1),l>10&&(l=10),w=M.toUtm().toMgrs().toString(l);break;case"Ordnance Survey National Grid":if(""===(N=u.a.OsGridRef.latLonToOsGrid(M)).toString())throw new s.a("Could not convert co-ordinates to OS National Grid. Are the co-ordinates in range?");l%2!=0&&(l+=1),l>10&&(l=10),w=N.toString(l);break;case"Universal Transverse Mercator":w=M.toUtm().toString(l)}if(void 0===w)throw new s.a("Error converting co-ordinates.");if(n.includes("Degrees")){"S"===k&&"None"!==i&&(w=w.replace("-","")),"W"===O&&"None"!==i&&(A=A.replace("-",""));var I="";"Before"===i&&(I+=k+" "),I+=w,"After"===i&&(I+=" "+k),I+=a,R&&("Before"===i&&(I+=O+" "),I+=A,"After"===i&&(I+=" "+O),I+=a),F=I}else F=w+a;return F}function p(t){var e=[];return t.split(/\s+/).forEach(function(t){(t=t.replace(/[^0-9.-]/g,"")).length>0&&e.push(parseFloat(t))}),e}function d(t,e,r,n){var a=Math.abs(t)+e/60+r/3600,o=w(a,n)+"°";return(M(t)||t<0)&&(a=-a,o="-"+o),{degrees:a,string:o}}function g(t,e,r){var n=Math.abs(t)+e/60,a=w(n,r)+"°";return(M(t)||t<0)&&(n=-n,a="-"+a),{degrees:n,string:a}}function v(t,e){return{degrees:t,string:w(t,e)+"°"}}function y(t,e){var r=Math.abs(t),n=Math.floor(r),a=Math.floor(60*(r-n)),o=w(3600*(r-n)-60*a,e),i=n+"° "+a+"' "+o+'"';return(M(t)||t<0)&&(n=-n,i="-"+i),{degrees:n,minutes:a,seconds:o,string:i}}function m(t,e){var r=Math.abs(t),n=Math.floor(r),a=w(60*(r-n),e),o=n+"° "+a+"'";return(t<0||M(t))&&(n=-n,o="-"+o),{degrees:n,minutes:a,string:o}}function b(t){return{Auto:"Auto",Space:" ","\\n":"\n",Comma:",","Semi-colon":";",Colon:":"}[t]}function M(t){return 0===t&&1/t<0}function w(t,e){return e=Math.pow(10,e),Math.round(t*e)/e}function A(t){return(A="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function F(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=[],n=!0,a=!1,o=void 0;try{for(var i,u=t[Symbol.iterator]();!(n=(i=u.next()).done)&&(r.push(i.value),!e||r.length!==e);n=!0);}catch(t){a=!0,o=t}finally{try{n||null==u.return||u.return()}finally{if(a)throw o}}return r}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function E(t,e){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:"Space",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:8;if(!t)return"";e=n.a.charRep(e);for(var a="",o=0;o1&&void 0!==arguments[1]?arguments[1]:"Space",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:8,a=n.a.regexRep(e);t=t.replace(a,"");for(var o=[],i=0;i1&&void 0!==arguments[1]?arguments[1]:"Auto";e=n.a.charRep(e);var r=[],a=t.split(e);""===a[a.length-1]&&(a=a.slice(0,a.length-1));for(var o=0;o0||t===e?e:e-1}function m(t){for(var e,r,n=1,a=t.length,o=t[0]+"";nc^r?1:-1;for(u=(s=a.length)<(c=o.length)?s:c,i=0;io[i]^r?1:-1;return s==c?0:s>c^r?1:-1}function M(t,e,r,n){if(tr||t!==(t<0?u(t):s(t)))throw Error(c+(n||"Argument")+("number"==typeof t?tr?" out of range: ":" not an integer: ":" not a primitive number: ")+String(t))}function w(t){var e=t.c.length-1;return y(t.e/f)==e&&t.c[e]%2!=0}function A(t,e){return(t.length>1?t.charAt(0)+"."+t.slice(1):t)+(e<0?"e":"e+")+e}function F(t,e,r){var n,a;if(e<0){for(a=r+".";++e;a+=r);t=a+t}else if(++e>(n=t.length)){for(a=r,e-=n;--e;a+=r);t+=a}else e=10;h/=10,c++);return y.e=c,void(y.c=[t])}v=String(t)}else{if(v=String(t),!i.test(v))return a(y,v,d);y.s=45==v.charCodeAt(0)?(v=v.slice(1),-1):1}(c=v.indexOf("."))>-1&&(v=v.replace(".","")),(h=v.search(/e/i))>0?(c<0&&(c=h),c+=+v.slice(h+1),v=v.substring(0,h)):c<0&&(c=v.length)}else{if(M(e,2,G.length,"Base"),v=String(t),10==e)return H(y=new z(t instanceof z?t:v),x+y.e+1,L);if(d="number"==typeof t){if(0*t!=0)return a(y,v,d,e);if(y.s=1/t<0?(v=v.slice(1),-1):1,z.DEBUG&&v.replace(/^0\.0*|\./,"").length>15)throw Error(l+t);d=!1}else y.s=45===v.charCodeAt(0)?(v=v.slice(1),-1):1;for(r=G.slice(0,e),c=h=0,g=v.length;hc){c=g;continue}}else if(!u&&(v==v.toUpperCase()&&(v=v.toLowerCase())||v==v.toLowerCase()&&(v=v.toUpperCase()))){u=!0,h=-1,c=0;continue}return a(y,String(t),d,e)}(c=(v=n(v,e,10,y.s)).indexOf("."))>-1?v=v.replace(".",""):c=v.length}for(h=0;48===v.charCodeAt(h);h++);for(g=v.length;48===v.charCodeAt(--g););if(v=v.slice(h,++g)){if(g-=h,d&&z.DEBUG&&g>15&&(t>p||t!==s(t)))throw Error(l+y.s*t);if((c=c-h-1)>I)y.c=y.e=null;else if(c=k)?A(s,i):F(s,i,"0");else if(o=(t=H(new z(t),e,r)).e,u=(s=m(t.c)).length,1==n||2==n&&(e<=o||o<=T)){for(;uu){if(--e>0)for(s+=".";e--;s+="0");}else if((e+=o-u)>0)for(o+1==u&&(s+=".");e--;s+="0");return t.s<0&&a?"-"+s:s}function q(t,e){for(var r,n=1,a=new z(t[0]);n=10;a/=10,n++);return(r=n+r*f-1)>I?t.c=t.e=null:r=10;c/=10,a++);if((o=e-a)<0)o+=f,i=e,g=(l=v[p=0])/y[a-i-1]%10|0;else if((p=u((o+1)/f))>=v.length){if(!n)break t;for(;v.length<=p;v.push(0));l=g=0,a=1,i=(o%=f)-f+1}else{for(l=c=v[p],a=1;c>=10;c/=10,a++);g=(i=(o%=f)-f+a)<0?0:l/y[a-i-1]%10|0}if(n=n||e<0||null!=v[p+1]||(i<0?l:l%y[a-i-1]),n=r<4?(g||n)&&(0==r||r==(t.s<0?3:2)):g>5||5==g&&(4==r||n||6==r&&(o>0?i>0?l/y[a-i]:0:v[p-1])%10&1||r==(t.s<0?8:7)),e<1||!v[0])return v.length=0,n?(e-=t.e+1,v[0]=y[(f-e%f)%f],t.e=-e||0):v[0]=t.e=0,t;if(0==o?(v.length=p,c=1,p--):(v.length=p+1,c=y[f-o],v[p]=i>0?s(l/y[a-i]%y[i])*c:0),n)for(;;){if(0==p){for(o=1,i=v[0];i>=10;i/=10,o++);for(i=v[0]+=c,c=1;i>=10;i/=10,c++);o!=c&&(t.e++,v[0]==h&&(v[0]=1));break}if(v[p]+=c,v[p]!=h)break;v[p--]=0,c=1}for(o=v.length;0===v[--o];v.pop());}t.e>I?t.c=t.e=null:t.e=k?A(e,r):F(e,r,"0"),t.s<0?"-"+e:e)}return z.clone=t,z.ROUND_UP=0,z.ROUND_DOWN=1,z.ROUND_CEIL=2,z.ROUND_FLOOR=3,z.ROUND_HALF_UP=4,z.ROUND_HALF_DOWN=5,z.ROUND_HALF_EVEN=6,z.ROUND_HALF_CEIL=7,z.ROUND_HALF_FLOOR=8,z.EUCLID=9,z.config=z.set=function(t){var e,r;if(null!=t){if("object"!=typeof t)throw Error(c+"Object expected: "+t);if(t.hasOwnProperty(e="DECIMAL_PLACES")&&(M(r=t[e],0,v,e),x=r),t.hasOwnProperty(e="ROUNDING_MODE")&&(M(r=t[e],0,8,e),L=r),t.hasOwnProperty(e="EXPONENTIAL_AT")&&((r=t[e])&&r.pop?(M(r[0],-v,0,e),M(r[1],0,v,e),T=r[0],k=r[1]):(M(r,-v,v,e),T=-(k=r<0?-r:r))),t.hasOwnProperty(e="RANGE"))if((r=t[e])&&r.pop)M(r[0],-v,-1,e),M(r[1],1,v,e),O=r[0],I=r[1];else{if(M(r,-v,v,e),!r)throw Error(c+e+" cannot be zero: "+r);O=-(I=r<0?-r:r)}if(t.hasOwnProperty(e="CRYPTO")){if((r=t[e])!==!!r)throw Error(c+e+" not true or false: "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw _=!r,Error(c+"crypto unavailable");_=r}else _=r}if(t.hasOwnProperty(e="MODULO_MODE")&&(M(r=t[e],0,9,e),P=r),t.hasOwnProperty(e="POW_PRECISION")&&(M(r=t[e],0,v,e),U=r),t.hasOwnProperty(e="FORMAT")){if("object"!=typeof(r=t[e]))throw Error(c+e+" not an object: "+r);j=r}if(t.hasOwnProperty(e="ALPHABET")){if("string"!=typeof(r=t[e])||/^.$|[+-.\s]|(.).*\1/.test(r))throw Error(c+e+" invalid: "+r);G=r}}return{DECIMAL_PLACES:x,ROUNDING_MODE:L,EXPONENTIAL_AT:[T,k],RANGE:[O,I],CRYPTO:_,MODULO_MODE:P,POW_PRECISION:U,FORMAT:j,ALPHABET:G}},z.isBigNumber=function(t){return t instanceof z||t&&!0===t._isBigNumber||!1},z.maximum=z.max=function(){return q(arguments,S.lt)},z.minimum=z.min=function(){return q(arguments,S.gt)},z.random=(o=9007199254740992*Math.random()&2097151?function(){return s(9007199254740992*Math.random())}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(t){var e,r,n,a,i,l=0,h=[],p=new z(R);if(null==t?t=x:M(t,0,v),a=u(t/f),_)if(crypto.getRandomValues){for(e=crypto.getRandomValues(new Uint32Array(a*=2));l>>11))>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),e[l]=r[0],e[l+1]=r[1]):(h.push(i%1e14),l+=2);l=a/2}else{if(!crypto.randomBytes)throw _=!1,Error(c+"crypto unavailable");for(e=crypto.randomBytes(a*=7);l=9e15?crypto.randomBytes(7).copy(e,l):(h.push(i%1e14),l+=7);l=a/7}if(!_)for(;l=10;i/=10,l++);lr-1&&(null==i[a+1]&&(i[a+1]=0),i[a+1]+=i[a]/r|0,i[a]%=r)}return i.reverse()}return function(e,n,a,o,i){var u,s,c,l,h,f,p,d,g=e.indexOf("."),v=x,y=L;for(g>=0&&(l=U,U=0,e=e.replace(".",""),f=(d=new z(n)).pow(e.length-g),U=l,d.c=t(F(m(f.c),f.e,"0"),10,a,"0123456789"),d.e=d.c.length),c=l=(p=t(e,n,a,i?(u=G,"0123456789"):(u="0123456789",G))).length;0==p[--l];p.pop());if(!p[0])return u.charAt(0);if(g<0?--c:(f.c=p,f.e=c,f.s=o,p=(f=r(f,d,v,y,a)).c,h=f.r,c=f.e),g=p[s=c+v+1],l=a/2,h=h||s<0||null!=p[s+1],h=y<4?(null!=g||h)&&(0==y||y==(f.s<0?3:2)):g>l||g==l&&(4==y||h||6==y&&1&p[s-1]||y==(f.s<0?8:7)),s<1||!p[0])e=h?F(u.charAt(1),-v,u.charAt(0)):u.charAt(0);else{if(p.length=s,h)for(--a;++p[--s]>a;)p[s]=0,s||(++c,p=[1].concat(p));for(l=p.length;!p[--l];);for(g=0,e="";g<=l;e+=u.charAt(p[g++]));e=F(e,c,u.charAt(0))}return e}}(),r=function(){function t(t,e,r){var n,a,o,i,u=0,s=t.length,c=e%g,l=e/g|0;for(t=t.slice();s--;)u=((a=c*(o=t[s]%g)+(n=l*o+(i=t[s]/g|0)*c)%g*g+u)/r|0)+(n/g|0)+l*i,t[s]=a%r;return u&&(t=[u].concat(t)),t}function e(t,e,r,n){var a,o;if(r!=n)o=r>n?1:-1;else for(a=o=0;ae[a]?1:-1;break}return o}function r(t,e,r,n){for(var a=0;r--;)t[r]-=a,a=t[r]1;t.splice(0,1));}return function(n,a,o,i,u){var c,l,p,d,g,v,m,b,M,w,A,F,E,N,D,B,C,S=n.s==a.s?1:-1,R=n.c,x=a.c;if(!(R&&R[0]&&x&&x[0]))return new z(n.s&&a.s&&(R?!x||R[0]!=x[0]:x)?R&&0==R[0]||!x?0*S:S/0:NaN);for(M=(b=new z(S)).c=[],S=o+(l=n.e-a.e)+1,u||(u=h,l=y(n.e/f)-y(a.e/f),S=S/f|0),p=0;x[p]==(R[p]||0);p++);if(x[p]>(R[p]||0)&&l--,S<0)M.push(1),d=!0;else{for(N=R.length,B=x.length,p=0,S+=2,(g=s(u/(x[0]+1)))>1&&(x=t(x,g,u),R=t(R,g,u),B=x.length,N=R.length),E=B,A=(w=R.slice(0,B)).length;A=u/2&&D++;do{if(g=0,(c=e(x,w,B,A))<0){if(F=w[0],B!=A&&(F=F*u+(w[1]||0)),(g=s(F/D))>1)for(g>=u&&(g=u-1),m=(v=t(x,g,u)).length,A=w.length;1==e(v,w,m,A);)g--,r(v,B=10;S/=10,p++);H(b,o+(b.e=p+l*f-1)+1,i,d)}else b.e=l,b.r=+d;return b}}(),E=/^(-?)0([xbo])(?=\w[\w.]*$)/i,N=/^([^.]+)\.$/,D=/^\.([^.]+)$/,B=/^-?(Infinity|NaN)$/,C=/^\s*\+(?=[\w.])|^\s+|\s+$/g,a=function(t,e,r,n){var a,o=r?e:e.replace(C,"");if(B.test(o))t.s=isNaN(o)?null:o<0?-1:1,t.c=t.e=null;else{if(!r&&(o=o.replace(E,function(t,e,r){return a="x"==(r=r.toLowerCase())?16:"b"==r?2:8,n&&n!=a?t:e}),n&&(a=n,o=o.replace(N,"$1").replace(D,"0.$1")),e!=o))return new z(o,a);if(z.DEBUG)throw Error(c+"Not a"+(n?" base "+n:"")+" number: "+e);t.c=t.e=t.s=null}},S.absoluteValue=S.abs=function(){var t=new z(this);return t.s<0&&(t.s=1),t},S.comparedTo=function(t,e){return b(this,new z(t,e))},S.decimalPlaces=S.dp=function(t,e){var r,n,a,o=this;if(null!=t)return M(t,0,v),null==e?e=L:M(e,0,8),H(new z(o),t+o.e+1,e);if(!(r=o.c))return null;if(n=((a=r.length-1)-y(this.e/f))*f,a=r[a])for(;a%10==0;a/=10,n--);return n<0&&(n=0),n},S.dividedBy=S.div=function(t,e){return r(this,new z(t,e),x,L)},S.dividedToIntegerBy=S.idiv=function(t,e){return r(this,new z(t,e),0,1)},S.exponentiatedBy=S.pow=function(t,e){var r,n,a,o,i,l,h,p,d=this;if((t=new z(t)).c&&!t.isInteger())throw Error(c+"Exponent not an integer: "+Z(t));if(null!=e&&(e=new z(e)),i=t.e>14,!d.c||!d.c[0]||1==d.c[0]&&!d.e&&1==d.c.length||!t.c||!t.c[0])return p=new z(Math.pow(+Z(d),i?2-w(t):+Z(t))),e?p.mod(e):p;if(l=t.s<0,e){if(e.c?!e.c[0]:!e.s)return new z(NaN);(n=!l&&d.isInteger()&&e.isInteger())&&(d=d.mod(e))}else{if(t.e>9&&(d.e>0||d.e<-1||(0==d.e?d.c[0]>1||i&&d.c[1]>=24e7:d.c[0]<8e13||i&&d.c[0]<=9999975e7)))return o=d.s<0&&w(t)?-0:0,d.e>-1&&(o=1/o),new z(l?1/o:o);U&&(o=u(U/f+2))}for(i?(r=new z(.5),l&&(t.s=1),h=w(t)):h=(a=Math.abs(+Z(t)))%2,p=new z(R);;){if(h){if(!(p=p.times(d)).c)break;o?p.c.length>o&&(p.c.length=o):n&&(p=p.mod(e))}if(a){if(0===(a=s(a/2)))break;h=a%2}else if(H(t=t.times(r),t.e+1,1),t.e>14)h=w(t);else{if(0==(a=+Z(t)))break;h=a%2}d=d.times(d),o?d.c&&d.c.length>o&&(d.c.length=o):n&&(d=d.mod(e))}return n?p:(l&&(p=R.div(p)),e?p.mod(e):o?H(p,U,L,void 0):p)},S.integerValue=function(t){var e=new z(this);return null==t?t=L:M(t,0,8),H(e,e.e+1,t)},S.isEqualTo=S.eq=function(t,e){return 0===b(this,new z(t,e))},S.isFinite=function(){return!!this.c},S.isGreaterThan=S.gt=function(t,e){return b(this,new z(t,e))>0},S.isGreaterThanOrEqualTo=S.gte=function(t,e){return 1===(e=b(this,new z(t,e)))||0===e},S.isInteger=function(){return!!this.c&&y(this.e/f)>this.c.length-2},S.isLessThan=S.lt=function(t,e){return b(this,new z(t,e))<0},S.isLessThanOrEqualTo=S.lte=function(t,e){return-1===(e=b(this,new z(t,e)))||0===e},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(t,e){var r,n,a,o,i=this,u=i.s;if(e=(t=new z(t,e)).s,!u||!e)return new z(NaN);if(u!=e)return t.s=-e,i.plus(t);var s=i.e/f,c=t.e/f,l=i.c,p=t.c;if(!s||!c){if(!l||!p)return l?(t.s=-e,t):new z(p?i:NaN);if(!l[0]||!p[0])return p[0]?(t.s=-e,t):new z(l[0]?i:3==L?-0:0)}if(s=y(s),c=y(c),l=l.slice(),u=s-c){for((o=u<0)?(u=-u,a=l):(c=s,a=p),a.reverse(),e=u;e--;a.push(0));a.reverse()}else for(n=(o=(u=l.length)<(e=p.length))?u:e,u=e=0;e0)for(;e--;l[r++]=0);for(e=h-1;n>u;){if(l[--n]=0;){for(r=0,d=F[a]%M,v=F[a]/M|0,o=a+(i=s);o>a;)r=((c=d*(c=A[--i]%M)+(u=v*c+(l=A[i]/M|0)*d)%M*M+m[o]+r)/b|0)+(u/M|0)+v*l,m[o--]=c%b;m[o]=r}return r?++n:m.splice(0,1),W(t,m,n)},S.negated=function(){var t=new z(this);return t.s=-t.s||null,t},S.plus=function(t,e){var r,n=this,a=n.s;if(e=(t=new z(t,e)).s,!a||!e)return new z(NaN);if(a!=e)return t.s=-e,n.minus(t);var o=n.e/f,i=t.e/f,u=n.c,s=t.c;if(!o||!i){if(!u||!s)return new z(a/0);if(!u[0]||!s[0])return s[0]?t:new z(u[0]?n:0*a)}if(o=y(o),i=y(i),u=u.slice(),a=o-i){for(a>0?(i=o,r=s):(a=-a,r=u),r.reverse();a--;r.push(0));r.reverse()}for((a=u.length)-(e=s.length)<0&&(r=s,s=u,u=r,e=a),a=0;e;)a=(u[--e]=u[e]+s[e]+a)/h|0,u[e]=h===u[e]?0:u[e]%h;return a&&(u=[a].concat(u),++i),W(t,u,i)},S.precision=S.sd=function(t,e){var r,n,a,o=this;if(null!=t&&t!==!!t)return M(t,1,v),null==e?e=L:M(e,0,8),H(new z(o),t,e);if(!(r=o.c))return null;if(n=(a=r.length-1)*f+1,a=r[a]){for(;a%10==0;a/=10,n--);for(a=r[0];a>=10;a/=10,n++);}return t&&o.e+1>n&&(n=o.e+1),n},S.shiftedBy=function(t){return M(t,-p,p),this.times("1e"+t)},S.squareRoot=S.sqrt=function(){var t,e,n,a,o,i=this,u=i.c,s=i.s,c=i.e,l=x+4,h=new z("0.5");if(1!==s||!u||!u[0])return new z(!s||s<0&&(!u||u[0])?NaN:u?i:1/0);if(0==(s=Math.sqrt(+Z(i)))||s==1/0?(((e=m(u)).length+c)%2==0&&(e+="0"),s=Math.sqrt(+e),c=y((c+1)/2)-(c<0||c%2),n=new z(e=s==1/0?"1e"+c:(e=s.toExponential()).slice(0,e.indexOf("e")+1)+c)):n=new z(s+""),n.c[0])for((s=(c=n.e)+l)<3&&(s=0);;)if(o=n,n=h.times(o.plus(r(i,o,l,1))),m(o.c).slice(0,s)===(e=m(n.c)).slice(0,s)){if(n.e0&&g>0){for(o=g%u||u,h=d.substr(0,o);o0&&(h+=l+d.slice(o)),p&&(h="-"+h)}n=f?h+(r.decimalSeparator||"")+((s=+r.fractionGroupSize)?f.replace(new RegExp("\\d{"+s+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):f):h}return(r.prefix||"")+n+(r.suffix||"")},S.toFraction=function(t){var e,n,a,o,i,u,s,l,h,p,g,v,y=this,b=y.c;if(null!=t&&(!(s=new z(t)).isInteger()&&(s.c||1!==s.s)||s.lt(R)))throw Error(c+"Argument "+(s.isInteger()?"out of range: ":"not an integer: ")+Z(s));if(!b)return new z(y);for(e=new z(R),h=n=new z(R),a=l=new z(R),v=m(b),i=e.e=v.length-y.e-1,e.c[0]=d[(u=i%f)<0?f+u:u],t=!t||s.comparedTo(e)>0?i>0?e:h:s,u=I,I=1/0,s=new z(v),l.c[0]=0;p=r(s,e,0,1),1!=(o=n.plus(p.times(a))).comparedTo(t);)n=a,a=o,h=l.plus(p.times(o=h)),l=o,e=s.minus(p.times(o=e)),s=o;return o=r(t.minus(n),a,0,1),l=l.plus(o.times(h)),n=n.plus(o.times(a)),l.s=h.s=y.s,g=r(h,a,i*=2,L).minus(y).abs().comparedTo(r(l,n,i,L).minus(y).abs())<1?[h,a]:[l,n],I=u,g},S.toNumber=function(){return+Z(this)},S.toPrecision=function(t,e){return null!=t&&M(t,1,v),V(this,t,e,2)},S.toString=function(t){var e,r=this,a=r.s,o=r.e;return null===o?a?(e="Infinity",a<0&&(e="-"+e)):e="NaN":(null==t?e=o<=T||o>=k?A(m(r.c),o):F(m(r.c),o,"0"):10===t?e=F(m((r=H(new z(r),x+o+1,L)).c),r.e,"0"):(M(t,2,G.length,"Base"),e=n(F(m(r.c),o,"0"),10,t,a,!0)),a<0&&r.c[0]&&(e="-"+e)),e},S.valueOf=S.toJSON=function(){return Z(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!=e&&z.set(e),z}()).default=o.BigNumber=o,void 0===(n=function(){return o}.call(e,r,e,t))||(t.exports=n)}()},452:function(t,e,r){"use strict";if(t.exports)var n=r(586);if(t.exports)var a=r(501);function o(t,e,r){if(!(this instanceof o))return new o(t,e,r);void 0===r&&(r=o.datum.WGS84),this.lat=Number(t),this.lon=Number(e),this.datum=r}o.ellipsoid={WGS84:{a:6378137,b:6356752.314245,f:1/298.257223563},Airy1830:{a:6377563.396,b:6356256.909,f:1/299.3249646},AiryModified:{a:6377340.189,b:6356034.448,f:1/299.3249646},Bessel1841:{a:6377397.155,b:6356078.962818,f:1/299.1528128},Clarke1866:{a:6378206.4,b:6356583.8,f:1/294.978698214},Clarke1880IGN:{a:6378249.2,b:6356515,f:1/293.466021294},GRS80:{a:6378137,b:6356752.31414,f:1/298.257222101},Intl1924:{a:6378388,b:6356911.946,f:1/297},WGS72:{a:6378135,b:6356750.5,f:1/298.26}},o.datum={ED50:{ellipsoid:o.ellipsoid.Intl1924,transform:[89.5,93.8,123.1,-1.2,0,0,.156]},Irl1975:{ellipsoid:o.ellipsoid.AiryModified,transform:[-482.53,130.596,-564.557,-8.15,-1.042,-.214,-.631]},NAD27:{ellipsoid:o.ellipsoid.Clarke1866,transform:[8,-160,-176,0,0,0,0]},NAD83:{ellipsoid:o.ellipsoid.GRS80,transform:[1.004,-1.91,-.515,-.0015,.0267,34e-5,.011]},NTF:{ellipsoid:o.ellipsoid.Clarke1880IGN,transform:[168,60,-320,0,0,0,0]},OSGB36:{ellipsoid:o.ellipsoid.Airy1830,transform:[-446.448,125.157,-542.06,20.4894,-.1502,-.247,-.8421]},Potsdam:{ellipsoid:o.ellipsoid.Bessel1841,transform:[-582,-105,-414,-8.3,1.04,.35,-3.08]},TokyoJapan:{ellipsoid:o.ellipsoid.Bessel1841,transform:[148,-507,-685,0,0,0,0]},WGS72:{ellipsoid:o.ellipsoid.WGS72,transform:[0,0,-4.5,-.22,0,0,.554]},WGS84:{ellipsoid:o.ellipsoid.WGS84,transform:[0,0,0,0,0,0,0]}},o.prototype.convertDatum=function(t){var e=this,r=null;if(e.datum==o.datum.WGS84&&(r=t.transform),t==o.datum.WGS84){r=[];for(var n=0;n<7;n++)r[n]=-e.datum.transform[n]}return null==r&&(e=this.convertDatum(o.datum.WGS84),r=t.transform),e.toCartesian().applyTransform(r).toLatLonE(t)},o.prototype.toCartesian=function(){var t=this.lat.toRadians(),e=this.lon.toRadians(),r=this.datum.ellipsoid.a,a=this.datum.ellipsoid.f,o=Math.sin(t),i=Math.cos(t),u=Math.sin(e),s=Math.cos(e),c=2*a-a*a,l=r/Math.sqrt(1-c*o*o);return new n((l+0)*i*s,(l+0)*i*u,(l*(1-c)+0)*o)},n.prototype.toLatLonE=function(t){var e=this.x,r=this.y,n=this.z,a=t.ellipsoid.a,i=t.ellipsoid.b,u=t.ellipsoid.f,s=2*u-u*u,c=s/(1-s),l=Math.sqrt(e*e+r*r),h=i*n/(a*l)*(1+c*i/Math.sqrt(l*l+n*n)),f=h/Math.sqrt(1+h*h),p=f/h,d=isNaN(p)?0:Math.atan2(n+c*i*f*f*f,l-s*a*p*p*p),g=Math.atan2(r,e),v=Math.sin(d);Math.cos(d),Math.sqrt(1-s*v*v);return new o(d.toDegrees(),g.toDegrees(),t)},n.prototype.applyTransform=function(t){var e=this.x,r=this.y,a=this.z,o=t[0],i=t[1],u=t[2],s=t[3]/1e6+1,c=(t[4]/3600).toRadians(),l=(t[5]/3600).toRadians(),h=(t[6]/3600).toRadians();return new n(o+e*s-r*h+a*l,i+e*h+r*s-a*c,u-e*l+r*c+a*s)},o.prototype.toString=function(t,e){return a.toLat(this.lat,t,e)+", "+a.toLon(this.lon,t,e)},void 0===Number.prototype.toRadians&&(Number.prototype.toRadians=function(){return this*Math.PI/180}),void 0===Number.prototype.toDegrees&&(Number.prototype.toDegrees=function(){return 180*this/Math.PI}),t.exports&&(t.exports=o,t.exports.Vector3d=n)},501:function(t,e,r){"use strict";var n={parseDMS:function(t){if("number"==typeof t&&isFinite(t))return Number(t);var e,r=String(t).trim().replace(/^-/,"").replace(/[NSEW]$/i,"").split(/[^0-9.,]+/);if(""==r[r.length-1]&&r.splice(r.length-1),""==r)return NaN;switch(r.length){case 3:e=r[0]/1+r[1]/60+r[2]/3600;break;case 2:e=r[0]/1+r[1]/60;break;case 1:e=r[0];break;default:return NaN}return/^-|[WS]$/i.test(t.trim())&&(e=-e),Number(e)},separator:"",toDMS:function(t,e,r){if(isNaN(t))return null;if(void 0===e&&(e="dms"),void 0===r)switch(e){case"d":case"deg":r=4;break;case"dm":case"deg+min":r=2;break;case"dms":case"deg+min+sec":r=0;break;default:e="dms",r=0}var a,o,i,u;switch(t=Math.abs(t),e){default:case"d":case"deg":(o=t.toFixed(r))<100&&(o="0"+o),o<10&&(o="0"+o),a=o+"°";break;case"dm":case"deg+min":o=Math.floor(t),60==(i=(60*t%60).toFixed(r))&&(i=0,o++),i<10&&(i="0"+i),a=(o=("000"+o).slice(-3))+"°"+n.separator+i+"′";break;case"dms":case"deg+min+sec":o=Math.floor(t),i=Math.floor(3600*t/60)%60,60==(u=(3600*t%60).toFixed(r))&&(u=(0).toFixed(r),i++),60==i&&(i=0,o++),o=("000"+o).slice(-3),i=("00"+i).slice(-2),u<10&&(u="0"+u),a=o+"°"+n.separator+i+"′"+n.separator+u+"″"}return a},toLat:function(t,e,r){var a=n.toDMS(t,e,r);return null===a?"–":a.slice(1)+n.separator+(t<0?"S":"N")},toLon:function(t,e,r){var a=n.toDMS(t,e,r);return null===a?"–":a+n.separator+(t<0?"W":"E")},toBrng:function(t,e,r){t=(Number(t)+360)%360;var a=n.toDMS(t,e,r);return null===a?"–":a.replace("360","0")},compassPoint:function(t,e){void 0===e&&(e=3),t=(t%360+360)%360;var r=4*Math.pow(2,e-1);return["N","NNE","NE","ENE","E","ESE","SE","SSE","S","SSW","SW","WSW","W","WNW","NW","NNW"][Math.round(t*r/360)%r*16/r]}};t.exports&&(t.exports=n)},586:function(t,e,r){"use strict";function n(t,e,r){if(!(this instanceof n))return new n(t,e,r);this.x=Number(t),this.y=Number(e),this.z=Number(r)}n.prototype.plus=function(t){if(!(t instanceof n))throw new TypeError("v is not Vector3d object");return new n(this.x+t.x,this.y+t.y,this.z+t.z)},n.prototype.minus=function(t){if(!(t instanceof n))throw new TypeError("v is not Vector3d object");return new n(this.x-t.x,this.y-t.y,this.z-t.z)},n.prototype.times=function(t){return t=Number(t),new n(this.x*t,this.y*t,this.z*t)},n.prototype.dividedBy=function(t){return t=Number(t),new n(this.x/t,this.y/t,this.z/t)},n.prototype.dot=function(t){if(!(t instanceof n))throw new TypeError("v is not Vector3d object");return this.x*t.x+this.y*t.y+this.z*t.z},n.prototype.cross=function(t){if(!(t instanceof n))throw new TypeError("v is not Vector3d object");return new n(this.y*t.z-this.z*t.y,this.z*t.x-this.x*t.z,this.x*t.y-this.y*t.x)},n.prototype.negate=function(){return new n(-this.x,-this.y,-this.z)},n.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},n.prototype.unit=function(){var t=this.length();return 1==t?this:0==t?this:new n(this.x/t,this.y/t,this.z/t)},n.prototype.angleTo=function(t,e){if(!(t instanceof n))throw new TypeError("v is not Vector3d object");if(!(e instanceof n||null==e))throw new TypeError("n is not Vector3d object");var r=null==e?1:Math.sign(this.cross(t).dot(e)),a=this.cross(t).length()*r,o=this.dot(t);return Math.atan2(a,o)},n.prototype.rotateAround=function(t,e){if(!(t instanceof n))throw new TypeError("axis is not Vector3d object");for(var r=this.unit(),a=[r.x,r.y,r.z],o=t.unit(),i=Math.sin(e),u=Math.cos(e),s=[[o.x*o.x*(1-u)+u,o.x*o.y*(1-u)-o.z*i,o.x*o.z*(1-u)+o.y*i],[o.y*o.x*(1-u)+o.z*i,o.y*o.y*(1-u)+u,o.y*o.z*(1-u)-o.x*i],[o.z*o.x*(1-u)-o.y*i,o.z*o.y*(1-u)+o.x*i,o.z*o.z*(1-u)+u]],c=[0,0,0],l=0;l<3;l++)for(var h=0;h<3;h++)c[l]+=s[l][h]*a[h];return new n(c[0],c[1],c[2])},n.prototype.toString=function(t){var e=void 0===t?3:Number(t);return"["+this.x.toFixed(e)+","+this.y.toFixed(e)+","+this.z.toFixed(e)+"]"},void 0===Math.sign&&(Math.sign=function(t){return 0===(t=+t)||isNaN(t)?t:t>0?1:-1}),t.exports&&(t.exports=n)},630:function(t,e){for(var r="0123456789bcdefghjkmnpqrstuvwxyz",n={},a=0;a(f=(b+M)/2)?(v=1+(v<<1),M=f):(v=0+(v<<1),b=f):t>(f=(y+m)/2)?(v=1+(v<<1),m=f):(v=0+(v<<1),y=f),g++,5===++d){var w=r[v];p.push(w),d=0,v=0}return p.join("")},h=function(t,e,r){r=r||52;for(var n,a=0,c=i,l=o,h=s,f=u,p=0;a(n=(h+f)/2)?(p+=1,f=n):h=n:t>(n=(c+l)/2)?(p+=1,l=n):c=n,a++;return p},f=function(t){for(var e,r=!0,a=i,c=o,l=s,h=u,f=0,p=0,d=t.length;p=0;v--){var y=f>>v&1;r?(e=(l+h)/2,1===y?h=e:l=e):(e=(a+c)/2,1===y?c=e:a=e),r=!r}}return[c,h,a,l]},p=function(t,e){for(var r=i,n=o,a=s,c=u,l=0,h=(e=e||52)/2,f=0;fs?u+t%s:ti?i:t1&&void 0!==arguments[1]?arguments[1]:" ",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2;if(!t)return"";for(var n="",a=0;a>>4).toString(16)),e.push((15&t[r]).toString(16));return e.join("")}function i(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Auto",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2;if("None"!==e){var a="Auto"===e?/[^a-f\d]/gi:n.a.regexRep(e);t=t.replace(a,"")}for(var o=[],i=0;i=3&&(t++,e+=6..toRadians()),32==t&&"X"==r&&this.lon<9&&(t--,e-=6..toRadians()),32==t&&"X"==r&&this.lon>=9&&(t++,e+=6..toRadians()),34==t&&"X"==r&&this.lon<21&&(t--,e-=6..toRadians()),34==t&&"X"==r&&this.lon>=21&&(t++,e+=6..toRadians()),36==t&&"X"==r&&this.lon<33&&(t--,e-=6..toRadians()),36==t&&"X"==r&&this.lon>=33&&(t++,e+=6..toRadians());for(var n=this.lat.toRadians(),o=this.lon.toRadians()-e,i=this.datum.ellipsoid.a,u=this.datum.ellipsoid.f,s=Math.sqrt(u*(2-u)),c=u/(2-u),l=c*c,h=c*l,f=c*h,p=c*f,d=c*p,g=Math.cos(o),v=Math.sin(o),y=Math.tan(o),m=Math.tan(n),b=Math.sinh(s*Math.atanh(s*m/Math.sqrt(1+m*m))),M=m*Math.sqrt(1+b*b)-b*Math.sqrt(1+m*m),w=Math.atan2(M,g),A=Math.asinh(v/Math.sqrt(M*M+g*g)),F=i/(1+c)*(1+.25*l+1/64*f+1/256*d),E=[null,.5*c-2/3*l+5/16*h+41/180*f-127/288*p+7891/37800*d,13/48*l-.6*h+557/1440*f+281/630*p-1983433/1935360*d,61/240*h-103/140*f+15061/26880*p+167603/181440*d,49561/161280*f-179/168*p+6601661/7257600*d,34729/80640*p-3418889/1995840*d,.6650675310896665*d],N=w,D=1;D<=6;D++)N+=E[D]*Math.sin(2*D*w)*Math.cosh(2*D*A);var B=A;for(D=1;D<=6;D++)B+=E[D]*Math.cos(2*D*w)*Math.sinh(2*D*A);var C=.9996*F*B,S=.9996*F*N,R=1;for(D=1;D<=6;D++)R+=2*D*E[D]*Math.cos(2*D*w)*Math.cosh(2*D*A);var x=0;for(D=1;D<=6;D++)x+=2*D*E[D]*Math.sin(2*D*w)*Math.sinh(2*D*A);var L=Math.atan(M/Math.sqrt(1+M*M)*y)+Math.atan2(x,R),T=Math.sin(n),k=.9996*(Math.sqrt(1-s*s*T*T)*Math.sqrt(1+m*m)/Math.sqrt(M*M+g*g))*(F/i*Math.sqrt(R*R+x*x));C+=5e5,S<0&&(S+=1e7),C=Number(C.toFixed(6)),S=Number(S.toFixed(6));var O=Number(L.toDegrees().toFixed(9)),I=Number(k.toFixed(12));return new a(t,this.lat>=0?"N":"S",C,S,this.datum,O,I)},a.prototype.toLatLonE=function(){var t=this.zone,e=this.hemisphere,r=this.easting,a=this.northing;if(isNaN(t)||isNaN(r)||isNaN(a))throw new Error("Invalid coordinate");var o=this.datum.ellipsoid.a,i=this.datum.ellipsoid.f;r-=5e5,a="S"==e?a-1e7:a;for(var u=Math.sqrt(i*(2-i)),s=i/(2-i),c=s*s,l=s*c,h=s*l,f=s*h,p=s*f,d=o/(1+s)*(1+.25*c+1/64*h+1/256*p),g=r/(.9996*d),v=a/(.9996*d),y=[null,.5*s-2/3*c+37/96*l-1/360*h-81/512*f+96199/604800*p,1/48*c+1/15*l-437/1440*h+46/105*f-1118711/3870720*p,17/480*l-37/840*h-209/4480*f+5569/90720*p,4397/161280*h-11/504*f-830251/7257600*p,4583/161280*f-108847/3991680*p,.03233083094085698*p],m=v,b=1;b<=6;b++)m-=y[b]*Math.sin(2*b*v)*Math.cosh(2*b*g);var M=g;for(b=1;b<=6;b++)M-=y[b]*Math.cos(2*b*v)*Math.sinh(2*b*g);var w=Math.sinh(M),A=Math.sin(m),F=Math.cos(m),E=A/Math.sqrt(w*w+F*F),N=E;do{var D=Math.sinh(u*Math.atanh(u*N/Math.sqrt(1+N*N))),B=N*Math.sqrt(1+D*D)-D*Math.sqrt(1+N*N),C=(E-B)/Math.sqrt(1+B*B)*(1+(1-u*u)*N*N)/((1-u*u)*Math.sqrt(1+N*N));N+=C}while(Math.abs(C)>1e-12);var S=N,R=Math.atan(S),x=Math.atan2(w,F),L=1;for(b=1;b<=6;b++)L-=2*b*y[b]*Math.cos(2*b*v)*Math.cosh(2*b*g);var T=0;for(b=1;b<=6;b++)T+=2*b*y[b]*Math.sin(2*b*v)*Math.sinh(2*b*g);var k=Math.atan(Math.tan(m)*Math.tanh(M))+Math.atan2(T,L),O=Math.sin(R),I=.9996*(Math.sqrt(1-u*u*O*O)*Math.sqrt(1+S*S)*Math.sqrt(w*w+F*F))*(d/o/Math.sqrt(L*L+T*T));x+=(6*(t-1)-180+3).toRadians();var _=Number(R.toDegrees().toFixed(11)),P=Number(x.toDegrees().toFixed(11)),U=Number(k.toDegrees().toFixed(9)),j=Number(I.toFixed(12)),G=new n(_,P,this.datum);return G.convergence=U,G.scale=j,G},a.parse=function(t,e){if(void 0===e&&(e=n.datum.WGS84),null==(t=t.trim().match(/\S+/g))||4!=t.length)throw new Error("Invalid UTM coordinate ‘"+t+"’");return new a(t[0],t[1],t[2],t[3],e)},a.prototype.toString=function(t){t=Number(t||0);var e=this.zone<10?"0"+this.zone:this.zone,r=this.hemisphere,n=this.easting,a=this.northing;return isNaN(e)||!r.match(/[NS]/)||isNaN(n)||isNaN(a)?"":e+" "+r+" "+n.toFixed(t)+" "+a.toFixed(t)},void 0===Math.sinh&&(Math.sinh=function(t){return(Math.exp(t)-Math.exp(-t))/2}),void 0===Math.cosh&&(Math.cosh=function(t){return(Math.exp(t)+Math.exp(-t))/2}),void 0===Math.tanh&&(Math.tanh=function(t){return(Math.exp(t)-Math.exp(-t))/(Math.exp(t)+Math.exp(-t))}),void 0===Math.asinh&&(Math.asinh=function(t){return Math.log(t+Math.sqrt(1+t*t))}),void 0===Math.atanh&&(Math.atanh=function(t){return Math.log((1+t)/(1-t))/2}),t.exports&&(t.exports=a)},9:function(t,e,r){"use strict";var n=r(0),a=r(12),o=r(4),i=r.n(o),u=r(14),s=r.n(u);function c(t,e,r,n,a,o,i){try{var u=t[o](i),s=u.value}catch(t){return void r(t)}u.done?e(s):Promise.resolve(s).then(n,a)}function l(t){return function(){var e=this,r=arguments;return new Promise(function(n,a){var o=t.apply(e,r);function i(t){c(o,n,a,i,u,"next",t)}function u(t){c(o,n,a,i,u,"throw",t)}i(void 0)})}}function h(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:null;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.value=[],this.type=t.BYTE_ARRAY,e&&e.hasOwnProperty("value")&&e.hasOwnProperty("type")&&this.set(e.value,e.type)}var e,r,o;return e=t,r=[{key:"set",value:function(e,r){if("string"==typeof r&&(r=t.typeEnum(r)),s.a.debug("Dish type: "+t.enumLookup(r)),this.value=e,this.type=r,!this.valid()){var o=n.a.truncate(JSON.stringify(this.value),13);throw new a.a("Data is not a valid ".concat(t.enumLookup(r),": ").concat(o))}}},{key:"get",value:function(){var e=l(regeneratorRuntime.mark(function e(r){var n,a=arguments;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=a.length>1&&void 0!==a[1]&&a[1],"string"==typeof r&&(r=t.typeEnum(r)),this.type===r){e.next=5;break}return e.next=5,this._translate(r,n);case 5:return e.abrupt("return",this.value);case 6:case"end":return e.stop()}},e,this)}));return function(t){return e.apply(this,arguments)}}()},{key:"_translate",value:function(){var e=l(regeneratorRuntime.mark(function e(r){var o,u,c=arguments;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:o=c.length>1&&void 0!==c[1]&&c[1],s.a.debug("Translating Dish from ".concat(t.enumLookup(this.type)," to ").concat(t.enumLookup(r))),u=o?n.a.byteArrayToChars:n.a.byteArrayToUtf8,e.prev=3,e.t0=this.type,e.next=e.t0===t.STRING?7:e.t0===t.NUMBER?9:e.t0===t.HTML?11:e.t0===t.ARRAY_BUFFER?13:e.t0===t.BIG_NUMBER?15:e.t0===t.JSON?17:e.t0===t.FILE?19:e.t0===t.LIST_FILE?24:30;break;case 7:return this.value=this.value?n.a.strToByteArray(this.value):[],e.abrupt("break",31);case 9:return this.value="number"==typeof this.value?n.a.strToByteArray(this.value.toString()):[],e.abrupt("break",31);case 11:return this.value=this.value?n.a.strToByteArray(n.a.unescapeHtml(n.a.stripHtmlTags(this.value,!0))):[],e.abrupt("break",31);case 13:return this.value=Array.prototype.slice.call(new Uint8Array(this.value)),e.abrupt("break",31);case 15:return this.value=i.a.isBigNumber(this.value)?n.a.strToByteArray(this.value.toFixed()):[],e.abrupt("break",31);case 17:return this.value=this.value?n.a.strToByteArray(JSON.stringify(this.value,null,4)):[],e.abrupt("break",31);case 19:return e.next=21,n.a.readFile(this.value);case 21:return this.value=e.sent,this.value=Array.prototype.slice.call(this.value),e.abrupt("break",31);case 24:return e.next=26,Promise.all(this.value.map(function(){var t=l(regeneratorRuntime.mark(function t(e){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",n.a.readFile(e));case 1:case"end":return t.stop()}},t,this)}));return function(e){return t.apply(this,arguments)}}()));case 26:return this.value=e.sent,this.value=this.value.map(function(t){return Array.prototype.slice.call(t)}),this.value=[].concat.apply([],this.value),e.abrupt("break",31);case 30:return e.abrupt("break",31);case 31:e.next=36;break;case 33:throw e.prev=33,e.t1=e.catch(3),new a.a("Error translating from ".concat(t.enumLookup(this.type)," to byteArray: ").concat(e.t1));case 36:this.type=t.BYTE_ARRAY,e.prev=37,e.t2=r,e.next=e.t2===t.STRING?41:e.t2===t.HTML?41:e.t2===t.NUMBER?44:e.t2===t.ARRAY_BUFFER?47:e.t2===t.BIG_NUMBER?50:e.t2===t.JSON?53:e.t2===t.FILE?56:e.t2===t.LIST_FILE?58:61;break;case 41:return this.value=this.value?u(this.value):"",this.type=t.STRING,e.abrupt("break",62);case 44:return this.value=this.value?parseFloat(u(this.value)):0,this.type=t.NUMBER,e.abrupt("break",62);case 47:return this.value=new Uint8Array(this.value).buffer,this.type=t.ARRAY_BUFFER,e.abrupt("break",62);case 50:try{this.value=new i.a(u(this.value))}catch(t){this.value=new i.a(NaN)}return this.type=t.BIG_NUMBER,e.abrupt("break",62);case 53:return this.value=JSON.parse(u(this.value)),this.type=t.JSON,e.abrupt("break",62);case 56:return this.value=new File(this.value,"unknown"),e.abrupt("break",62);case 58:return this.value=[new File(this.value,"unknown")],this.type=t.LIST_FILE,e.abrupt("break",62);case 61:return e.abrupt("break",62);case 62:e.next=67;break;case 64:throw e.prev=64,e.t3=e.catch(37),new a.a("Error translating from byteArray to ".concat(t.enumLookup(r),": ").concat(e.t3));case 67:case"end":return e.stop()}},e,this,[[3,33],[37,64]])}));return function(t){return e.apply(this,arguments)}}()},{key:"valid",value:function(){switch(this.type){case t.BYTE_ARRAY:if(!(this.value instanceof Array))return!1;for(var e=0;e255)return!1;return!0;case t.STRING:case t.HTML:return"string"==typeof this.value;case t.NUMBER:return"number"==typeof this.value;case t.ARRAY_BUFFER:return this.value instanceof ArrayBuffer;case t.BIG_NUMBER:return i.a.isBigNumber(this.value);case t.JSON:return!0;case t.FILE:return this.value instanceof File;case t.LIST_FILE:return this.value instanceof Array&&this.value.reduce(function(t,e){return t&&e instanceof File},!0);default:return!1}}},{key:"clone",value:function(){var e=new t;switch(this.type){case t.STRING:case t.HTML:case t.NUMBER:case t.BIG_NUMBER:e.set(this.value,this.type);break;case t.BYTE_ARRAY:case t.JSON:e.set(JSON.parse(JSON.stringify(this.value)),this.type);break;case t.ARRAY_BUFFER:e.set(this.value.slice(0),this.type);break;case t.FILE:e.set(new File([this.value],this.value.name,{type:this.value.type,lastModified:this.value.lastModified}),this.type);break;case t.LIST_FILE:e.set(this.value.map(function(t){return new File([t],t.name,{type:t.type,lastModified:t.lastModified})}),this.type);break;default:throw new a.a("Cannot clone Dish, unknown type")}return e}},{key:"size",get:function(){switch(this.type){case t.BYTE_ARRAY:case t.STRING:case t.HTML:return this.value.length;case t.NUMBER:case t.BIG_NUMBER:return this.value.toString().length;case t.ARRAY_BUFFER:return this.value.byteLength;case t.JSON:return JSON.stringify(this.value).length;case t.FILE:return this.value.size;case t.LIST_FILE:return this.value.reduce(function(t,e){return t+e.size},0);default:return-1}}}],o=[{key:"typeEnum",value:function(e){switch(e.toLowerCase()){case"bytearray":case"byte array":return t.BYTE_ARRAY;case"string":return t.STRING;case"number":return t.NUMBER;case"html":return t.HTML;case"arraybuffer":case"array buffer":return t.ARRAY_BUFFER;case"bignumber":case"big number":return t.BIG_NUMBER;case"json":return t.JSON;case"file":return t.FILE;case"list":return t.LIST_FILE;default:throw new a.a("Invalid data type string. No matching enum.")}}},{key:"enumLookup",value:function(e){switch(e){case t.BYTE_ARRAY:return"byteArray";case t.STRING:return"string";case t.NUMBER:return"number";case t.HTML:return"html";case t.ARRAY_BUFFER:return"ArrayBuffer";case t.BIG_NUMBER:return"BigNumber";case t.JSON:return"JSON";case t.FILE:return"File";case t.LIST_FILE:return"List";default:throw new a.a("Invalid data type enum. No matching type.")}}}],r&&h(e.prototype,r),o&&h(e,o),t}();f.BYTE_ARRAY=0,f.STRING=1,f.NUMBER=2,f.HTML=3,f.ARRAY_BUFFER=4,f.BIG_NUMBER=5,f.JSON=6,f.FILE=7,f.LIST_FILE=8,e.a=f}});