-
Notifications
You must be signed in to change notification settings - Fork 2
/
cettia-browser.min.js
30 lines (30 loc) · 64.9 KB
/
cettia-browser.min.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
var cettia=function(t){function r(n){if(e[n])return e[n].exports;var o=e[n]={exports:{},id:n,loaded:!1};return t[n].call(o.exports,o,o.exports,r),o.loaded=!0,o.exports}var e={};return r.m=t,r.c=e,r.p="",r(0)}([function(t,r,e){function n(t){return t&&t.__esModule?t:{default:t}}function o(t){var r,e,n,o,i,f,a=[],u=function(u,s){for(s=s||[],e=!t||[u,s],n=!0,f=o||0,o=0,i=a.length;f<i&&!r;f++)a[f].apply(u,s);n=!1},s={add:function(t){var f=a.length;a.push(t),n?i=a.length:!r&&e&&e!==!0&&(o=f,u(e[0],e[1]))},remove:function(t){var r;for(r=0;r<a.length;r++)(t===a[r]||t.guid&&t.guid===a[r].guid)&&(n&&r<=i&&(i--,r<=f&&f--),a.splice(r--,1))},fire:function(o,i){r||n||t&&e||u(o,i)},lock:function(){r=!0},locked:function(){return!!r},unlock:function(){r=e=n=o=i=f=void 0}};return s}function i(t,r){var e={reconnect:function(t){return 2*(t||250)},transports:[a,s,y]};if(r)for(var n in r)e[n]=r[n];r=e;var i={},f={};i.on=function(t,r){var e;if(e=f[t],!e){if(f.message.locked())return this;e=f[t]=o(),e.order=f.message.order}return e.add(r),this},i.off=function(t,r){var e=f[t];return e&&e.remove(r),this},i.once=function(t,r){function e(){i.off(t,e),r.apply(i,arguments)}return r.guid=r.guid||x++,e.guid=r.guid,i.on(t,e)},i.fire=function(t){var r=f[t];return r&&r.fire(i,U.call(arguments,1)),this};var u,c,h,l=0;i.open=function(){return u=null,clearTimeout(c),f.connecting.unlock(),f.open.unlock(),f.close.unlock(),f.waiting.unlock(),i.fire("connecting")},i.close=function(){return r.reconnect=!1,clearTimeout(c),"connecting"===v?i.fire("close"):"opened"===v&&u.close(),this};var p;if(r.name&&window.name){var d=JSON.parse(window.name);p=d[r.name]}var v;i.state=function(){return v};for(var n in{connecting:1,open:1,close:1,waiting:1})f[n]=o(!0),f[n].order=x++;f.message=o(!1),f.message.order=f.open.order,i.on("connecting",function(){v="connecting";for(var e=Array.isArray(t)?U.call(t):[t],n=0;n<e.length;n++){var o=e[n]=P.stringifyURI(P.makeAbsolute(e[n]),{"cettia-version":"1.0","cettia-id":p});/^https?:/.test(o)&&!P.parseURI(o).query["cettia-transport-name"]&&(e.splice(n,1,o.replace(/^http/,"ws"),P.stringifyURI(o,{"cettia-transport-name":"stream"}),P.stringifyURI(o,{"cettia-transport-name":"longpoll"})),n+=2)}!function t(){function n(){f.off("close",t).close()}var o=e.shift();if(!o)return void i.fire("error",new Error).fire("close");for(var f,a=0;a<r.transports.length&&!(f=r.transports[a](o,r));a++);return f?(i.once("close",n),void f.on("close",t).on("close",function(){i.off("close",n)}).on("text",function e(o){function a(t){var r,e=function(e){return function(n){r||(r=!0,i.send("reply",{id:t.id,data:n,exception:!e}))}},n=[t.type,t.data,t.reply?{resolve:e(!0),reject:e(!1)}:null];i.fire.apply(i,n)}f.off("text",e);var s=P.parseURI(o).query;p!==s["cettia-id"]&&(p=s["cettia-id"],i.fire("new")),r.heartbeat=+s["cettia-heartbeat"],r._heartbeat=+s["cettia-_heartbeat"]||5e3,u=f.off("close",t);var c;u.on("text",function(t){return c?void a(JSON.parse(t)):void(c=!0)}).on("binary",function(t){t=new Uint8Array(t),a(m.default.decode(t))}).on("error",function(t){i.fire("error",t)}).on("close",function(){i.fire("close")}),i.off("close",n).fire("open")}).open()):void t()}()}).on("new",function(){if(r.name){var t=window.name?JSON.parse(window.name):{};t[r.name]=p,window.name=JSON.stringify(t)}}).on("open",function(){v="opened";var t;!function e(){t=setTimeout(function(){i.send("heartbeat").once("heartbeat",function(){clearTimeout(t),e()}),t=setTimeout(function(){i.fire("error",new Error("heartbeat")),u.close()},r._heartbeat)},r.heartbeat-r._heartbeat)}(),i.once("close",function(){clearTimeout(t)}),f.connecting.lock(),c=h=null,l=0}).on("close",function(){v="closed",f.connecting.lock(),f.open.lock(),r.reconnect&&i.once("close",function(){h=r.reconnect.call(i,h,l),h!==!1&&(l++,c=setTimeout(function(){i.open()},h),i.fire("waiting",h,l))})}).on("waiting",function(){v="waiting"});var g={};return i.send=function(t,r,e,n){if("opened"!==v)return i.fire("cache",[t,r,e,n]),this;var o={id:x++,type:t,data:r,reply:!(!e&&!n)};o.reply&&(g[o.id]=[e,n]);var f=!1,a=window.ArrayBuffer;return a&&JSON.stringify(r,function(t,r){return f=f||a.isView(r),r}),f?u.send(m.default.encode(o)):u.send(JSON.stringify(o)),this},i.on("reply",function(t){g[t.id][+t.exception].call(i,t.data),delete g[t.id]}),i.open()}function f(t,r){var e=r&&r.timeout||3e3,n={};n.open=function(){function t(){clearTimeout(r)}n.connect();var r=setTimeout(function(){n.fire("error",new Error("timeout")).close()},e);return n.on("open",t).on("close",t),this};var i={open:o(!0),text:o(),binary:o(),error:o(),close:o(!0)};n.on=function(t,r){return i[t].add(r),this},n.off=function(t,r){return i[t].remove(r),this},n.fire=function(t){return i[t].fire(n,U.call(arguments,1)),this};var f=!1;return n.on("open",function(){f=!0}),n.on("close",function(){f=!1;for(var t in i)"close"!==t&&i[t].lock()}),n.send=function(t){return f?n.write(t):n.emit("error",new Error("notopened")),this},n}function a(t,r){var e=window.WebSocket;if(e&&/^wss?:/.test(t)){var n,o=f(t,r);return o.connect=function(){n=new e(t),n.binaryType="arraybuffer",n.onopen=function(){o.fire("open")},n.onmessage=function(t){"string"==typeof t.data?o.fire("text",t.data):o.fire("binary",t.data)},n.onerror=function(){o.fire("error",new Error).fire("close")},n.onclose=function(){o.fire("close")}},o.write=function(t){n.send(t)},o.close=function(){return n.close(),this},o}}function u(t,r){var e,n=r&&r.xdrURL,o=f(t,r);o.on("open",function(){e=P.stringifyURI(t,{"cettia-transport-id":o.id})}).on("close",function(){e=null});var i=!1,a=[],u=function(){a.length?c(a.shift()):i=!1},s=function(){e&&o.fire("error",new Error).close()},c=!P.crossOrigin(t)||P.corsable?function(t){var r=new T;return r.onreadystatechange=function(){4===r.readyState&&(200===r.status?u():s())},r.open("POST",e),r.withCredentials=!0,"string"==typeof t?(r.setRequestHeader("Content-Type","text/plain; charset=UTF-8"),r.send("data="+t)):(r.setRequestHeader("Content-Type","application/octet-stream"),r.send(t)),this}:window.XDomainRequest&&n?function(t){var r=new window.XDomainRequest;return r.onload=u,r.onerror=s,r.open("POST",n.call(o,e)),r.send("data="+t),this}:function(t){var r,n,o=B.createElement("form");return o.action=e,o.target="socket-"+x++,o.method="POST",o.enctype="text/plain",o.acceptCharset="UTF-8",o.style.display="none",o.innerHTML='<textarea name="data"></textarea><iframe name="'+o.target+'"></iframe>',n=o.firstChild,n.value=t,r=o.lastChild,P.on(r,"error",function(){s()}),P.on(r,"load",function(){B.body.removeChild(o),u()}),B.body.appendChild(o),o.submit(),this};o.write=function(t){i?a.push(t):(i=!0,c(t))};var h;return o.close=function(){if(o.abort(),!h){if(h=!0,!B)return this;var r=B.createElement("script");r.async=!1,r.src=P.stringifyURI(t,{"cettia-transport-id":o.id,"cettia-transport-when":"abort"}),r.onload=r.onerror=function(){r.parentNode&&r.parentNode.removeChild(r),o.fire("close")},B.head.appendChild(r)}return this},o}function s(t,r){if(/^https?:/.test(t)&&"stream"===P.parseURI(t).query["cettia-transport-name"])return h(t,r)||l(t,r)||p(t,r)||d(t,r)}function c(t,r){var e="",n=u(t,r);n.parse=function(t){if(t=t.replace(/^\s+/,"")){for(var r=(e+t).split("\n\n"),o=0;o<r.length-1;o++)n.onmessage(r[o].substring("data: ".length));e=r[r.length-1]}};var o;return n.onmessage=function(t){if(o){var r=t.substring(0,1);switch(t=t.substring(1),r){case"1":n.fire("text",t);break;case"2":for(var e=atob(t),i=new Uint8Array(t.length),f=0;f<e.length;f++)i[f]=e.charCodeAt(f);t=i.buffer,n.fire("binary",t)}}else{o=!0;var a=P.parseURI(t).query;n.id=a["cettia-transport-id"],n.fire("open")}},n}function h(t,r){var e=window.EventSource;if(e&&!(P.crossOrigin(t)&&P.browser.safari&&P.browser.vmajor<7)){var n,o=c(t,r);return o.connect=function(){n=new e(t+"&cettia-transport-version=1.0&cettia-transport-when=open&cettia-transport-sse=true",{withCredentials:!0}),n.onmessage=function(t){o.onmessage(t.data)},n.onerror=function(){n.close(),o.fire("close")}},o.abort=function(){n.close()},o}}function l(t,r){if(!(P.browser.msie&&P.browser.vmajor<10||P.crossOrigin(t)&&!P.corsable)){var e,n=c(t,r);return n.connect=function(){var r;e=new T,e.onreadystatechange=function(){3===e.readyState&&200===e.status?(n.parse(r?e.responseText.substring(r):e.responseText),r=e.responseText.length):4===e.readyState&&(200!==e.status&&n.fire("error",new Error),n.fire("close"))},e.open("GET",t+"&cettia-transport-version=1.0&cettia-transport-when=open"),e.withCredentials=!0,e.send()},n.abort=function(){e.abort()},n}}function p(t,r){var e=r&&r.xdrURL,n=window.XDomainRequest;if(e&&n){var o,i=c(t,r);return i.connect=function(){var r;o=new n,o.onprogress=function(){i.parse(r?o.responseText.substring(r):o.responseText),r=o.responseText.length},o.onerror=function(){i.fire("error",new Error).fire("close")},o.onload=function(){i.fire("close")},o.open("GET",e.call(i,t+"&cettia-transport-version=1.0&cettia-transport-when=open")),o.send()},i.abort=function(){o.abort()},i}}function d(t,r){var e=window.ActiveXObject;if(e&&!P.crossOrigin(t)){var n,o,i=c(t,r);return i.connect=function(){function r(t){var r;return function e(){r=setTimeout(function(){t()!==!1&&e()},1)}(),function(){clearTimeout(r)}}n=new e("htmlfile"),n.open(),n.close();var f=n.createElement("iframe");f.src=t+"&cettia-transport-version=1.0&cettia-transport-when=open",n.body.appendChild(f);var a=f.contentDocument||f.contentWindow.document;o=r(function(){function t(){var t=e.cloneNode(!0);t.appendChild(a.createTextNode("."));var r=t.innerText.replace(/\r\n/g,"\n");return r.substring(0,r.length-1)}if(a.firstChild){var e=a.body.lastChild;return e?(i.parse(t()),e.innerText="",o=r(function(){var r=t();if(r&&(e.innerText="",i.parse(r)),"complete"===a.readyState)return i.fire("close"),!1}),!1):(i.fire("error",new Error).fire("close"),!1)}})},i.abort=function(){o(),n.execCommand("Stop")},i}}function y(t,r){if(/^https?:/.test(t)&&"longpoll"===P.parseURI(t).query["cettia-transport-name"])return g(t,r)||w(t,r)||b(t,r)}function v(t,r){var e=u(t,r);return e.connect=function(){e.poll(t+"&cettia-transport-version=1.0&cettia-transport-when=open",function(r){var n=P.parseURI(r).query;e.id=n["cettia-transport-id"],function r(){e.poll(P.stringifyURI(t,{"cettia-transport-id":e.id,"cettia-transport-when":"poll"}),function(t){t?(r(),"string"==typeof t?e.fire("text",t):e.fire("binary",t)):e.fire("close")})}(),e.fire("open")})},e}function g(t,r){if(!P.crossOrigin(t)||P.corsable){var e,n=v(t,r);return n.poll=function(t,r){e=new T,e.onreadystatechange=function(){switch(e.readyState){case 2:"application/octet-stream"===e.getResponseHeader("content-type")&&(e.responseType="arraybuffer");break;case 4:200===e.status?r(e.response||e.responseText):n.fire("error",new Error).fire("close")}},e.open("GET",t),e.withCredentials=!0,e.send(null)},n.abort=function(){e.abort()},n}}function w(t,r){var e=r&&r.xdrURL,n=window.XDomainRequest;if(e&&n){var o,i=v(t,r);return i.poll=function(t,r){t=e.call(i,t),o=new n,o.onload=function(){r(o.responseText)},o.onerror=function(){i.fire("error",new Error).fire("close")},o.open("GET",t),o.send()},i.abort=function(){o.abort()},i}}function b(t,r){var e,n=v(t,r),o=_.pop()||"socket_"+x++;return n.on("close",function(){delete window[o],_.push(o)}),n.poll=function(t,r){window[o]=function(t){r(t)},e=B.createElement("script"),e.async=!0,e.src=P.stringifyURI(t,{"cettia-transport-jsonp":"true","cettia-transport-callback":o}),e.onload=e.onerror=function(t){e.parentNode&&e.parentNode.removeChild(e),"error"===t.type&&n.fire("error",new Error).fire("close")},B.head.appendChild(e)},n.abort=function(){e.parentNode&&e.parentNode.removeChild(e)},n}var E=e(1),m=n(E),A=e(36),x=(n(A),1),U=Array.prototype.slice,B=window.document,R=window.location,k=window.navigator,T=window.XMLHttpRequest,P={};P.makeAbsolute=function(t){if(!B)return t;var r=B.createElement("div");return r.innerHTML='<a href="'+t+'"/>',encodeURI(decodeURI(r.firstChild.href))},P.on=function(t,r,e){t.addEventListener?t.addEventListener(r,e,!1):t.attachEvent&&t.attachEvent("on"+r,e)},P.stringifyURI=function(t,r){var e,n=[];r=r||{},r._=x++;for(e in r)null!=r[e]&&n.push(encodeURIComponent(e)+"="+encodeURIComponent(r[e]));return t+(/\?/.test(t)?"&":"?")+n.join("&").replace(/%20/g,"+")},P.parseURI=function(t){var r={query:{}},e=/.*\?([^#]*)/.exec(t);if(e)for(var n=e[1].split("&"),o=0;o<n.length;o++){var i=n[o].split("=");r.query[decodeURIComponent(i[0])]=decodeURIComponent(i[1]||"")}return r},P.corsable="withCredentials"in new T,P.browser=function(){var t=(k.userAgent||"").toLowerCase(),r={},e=/(msie) ([\w.]+)/.exec(t)||/(trident)(?:.*? rv:([\w.]+)|)/.exec(t)||t.indexOf("android")<0&&/version\/(.+) (safari)/.exec(t)||[];return"safari"===e[2]&&(e[2]=e[1],e[1]="safari"),r[e[1]||""]=!0,r.version=e[2]||"0",r.vmajor=r.version.split(".")[0],r.trident&&(r.msie=!0),r}(),P.crossOrigin=function(t){if(!R)return!0;var r=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/.exec(t.toLowerCase());return!(!r||r[1]==R.protocol&&r[2]==R.hostname&&(r[3]||("http:"===r[1]?80:443))==(R.port||("http:"===R.protocol?80:443)))};var _=[],S=[];P.on(window,"unload",function(){for(var t,r=0;r<S.length;r++)t=S[r],"closed"!==t.state()&&t.close()}),P.on(window,"online",function(){for(var t,r=0;r<S.length;r++)t=S[r],"waiting"===t.state()&&t.open()}),P.on(window,"offline",function(){for(var t,r=0;r<S.length;r++)t=S[r],"opened"===t.state()&&t.fire("error",new Error).fire("close")});var I={open:function(t,r){var e=i(t,r);return S.push(e),e},transport:{createWebSocketTransport:a,createHttpStreamTransport:s,createHttpLongpollTransport:y},util:P};t.exports=I},function(t,r,e){r.encode=e(2).encode,r.decode=e(25).decode,r.Encoder=e(31).Encoder,r.Decoder=e(33).Decoder,r.createCodec=e(34).createCodec,r.codec=e(35).codec},function(t,r,e){function n(t,r){var e=new o(r);return e.write(t),e.read()}r.encode=n;var o=e(3).EncodeBuffer},function(t,r,e){function n(t){if(!(this instanceof n))return new n(t);if(t&&(this.options=t,t.codec)){var r=this.codec=t.codec;r.bufferish&&(this.bufferish=r.bufferish)}}r.EncodeBuffer=n;var o=e(4).preset,i=e(24).FlexEncoder;i.mixin(n.prototype),n.prototype.codec=o,n.prototype.write=function(t){this.codec.encode(this,t)}},function(t,r,e){function n(t){function r(t,r){var n=e[typeof r];if(!n)throw new Error('Unsupported type "'+typeof r+'": '+r);n(t,r)}var e=s.getWriteType(t);return r}function o(){var t=this.options;return this.encode=n(t),t&&t.preset&&u.setExtPackers(this),this}function i(t,r,e){function n(r){return e&&(r=e(r)),new a(r,t)}e=c.filter(e);var o=r.name;if(o&&"Object"!==o){var i=this.extPackers||(this.extPackers={});i[o]=n}else{var f=this.extEncoderList||(this.extEncoderList=[]);f.unshift([r,n])}}function f(t){var r=this.extPackers||(this.extPackers={}),e=t.constructor,n=e&&e.name&&r[e.name];if(n)return n;for(var o=this.extEncoderList||(this.extEncoderList=[]),i=o.length,f=0;f<i;f++){var a=o[f];if(e===a[0])return a[1]}}var a=e(5).ExtBuffer,u=e(17),s=e(18),c=e(23);c.install({addExtPacker:i,getExtPacker:f,init:o}),r.preset=o.call(c.preset)},function(t,r,e){function n(t,r){return this instanceof n?(this.buffer=o.from(t),void(this.type=r)):new n(t,r)}r.ExtBuffer=n;var o=e(6)},function(t,r,e){function n(t){return"string"==typeof t?a.call(this,t):u(this).from(t)}function o(t){return u(this).alloc(t)}function i(t,e){function n(t){e+=t.length}function i(t){u+=E.copy.call(t,a,u)}e||(e=0,Array.prototype.forEach.call(t,n));var f=this!==r&&this||t[0],a=o.call(f,e),u=0;return Array.prototype.forEach.call(t,i),a}function f(t){return t instanceof ArrayBuffer||m(t)}function a(t){var r=3*t.length,e=o.call(this,r),n=E.write.call(e,t);return r!==n&&(e=E.slice.call(e,0,n)),e}function u(t){return y(t)?w:v(t)?b:d(t)?g:l?w:p?b:g}function s(){return!1}function c(t,r){return t="[object "+t+"]",function(e){return null!=e&&{}.toString.call(r?e[r]:e)===t}}var h=r.global=e(7),l=r.hasBuffer=h&&!!h.isBuffer,p=r.hasArrayBuffer="undefined"!=typeof ArrayBuffer,d=r.isArray=e(11);r.isArrayBuffer=p?f:s;var y=r.isBuffer=l?h.isBuffer:s,v=r.isView=p?ArrayBuffer.isView||c("ArrayBuffer","buffer"):s;r.alloc=o,r.concat=i,r.from=n;var g=r.Array=e(12),w=r.Buffer=e(13),b=r.Uint8Array=e(14),E=r.prototype=e(15),m=c("ArrayBuffer")},function(t,r,e){(function(r){function e(t){return t&&t.isBuffer&&t}t.exports=e("undefined"!=typeof r&&r)||e(this.Buffer)||e("undefined"!=typeof window&&window.Buffer)||this.Buffer}).call(r,e(8).Buffer)},function(t,r,e){(function(t){/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <[email protected]> <http://feross.org>
* @license MIT
*/
"use strict";function n(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}function o(){return f.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function i(t,r){if(o()<r)throw new RangeError("Invalid typed array length");return f.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r),t.__proto__=f.prototype):(null===t&&(t=new f(r)),t.length=r),t}function f(t,r,e){if(!(f.TYPED_ARRAY_SUPPORT||this instanceof f))return new f(t,r,e);if("number"==typeof t){if("string"==typeof r)throw new Error("If encoding is specified then the first argument must be a string");return c(this,t)}return a(this,t,r,e)}function a(t,r,e,n){if("number"==typeof r)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&r instanceof ArrayBuffer?p(t,r,e,n):"string"==typeof r?h(t,r,e):d(t,r)}function u(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function s(t,r,e,n){return u(r),r<=0?i(t,r):void 0!==e?"string"==typeof n?i(t,r).fill(e,n):i(t,r).fill(e):i(t,r)}function c(t,r){if(u(r),t=i(t,r<0?0:0|y(r)),!f.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}function h(t,r,e){if("string"==typeof e&&""!==e||(e="utf8"),!f.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=0|g(r,e);t=i(t,n);var o=t.write(r,e);return o!==n&&(t=t.slice(0,o)),t}function l(t,r){var e=r.length<0?0:0|y(r.length);t=i(t,e);for(var n=0;n<e;n+=1)t[n]=255&r[n];return t}function p(t,r,e,n){if(r.byteLength,e<0||r.byteLength<e)throw new RangeError("'offset' is out of bounds");if(r.byteLength<e+(n||0))throw new RangeError("'length' is out of bounds");return r=void 0===e&&void 0===n?new Uint8Array(r):void 0===n?new Uint8Array(r,e):new Uint8Array(r,e,n),f.TYPED_ARRAY_SUPPORT?(t=r,t.__proto__=f.prototype):t=l(t,r),t}function d(t,r){if(f.isBuffer(r)){var e=0|y(r.length);return t=i(t,e),0===t.length?t:(r.copy(t,0,0,e),t)}if(r){if("undefined"!=typeof ArrayBuffer&&r.buffer instanceof ArrayBuffer||"length"in r)return"number"!=typeof r.length||Z(r.length)?i(t,0):l(t,r);if("Buffer"===r.type&&$(r.data))return l(t,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function y(t){if(t>=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|t}function v(t){return+t!=t&&(t=0),f.alloc(+t)}function g(t,r){if(f.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var e=t.length;if(0===e)return 0;for(var n=!1;;)switch(r){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return H(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*e;case"hex":return e>>>1;case"base64":return W(t).length;default:if(n)return H(t).length;r=(""+r).toLowerCase(),n=!0}}function w(t,r,e){var n=!1;if((void 0===r||r<0)&&(r=0),r>this.length)return"";if((void 0===e||e>this.length)&&(e=this.length),e<=0)return"";if(e>>>=0,r>>>=0,e<=r)return"";for(t||(t="utf8");;)switch(t){case"hex":return C(this,r,e);case"utf8":case"utf-8":return P(this,r,e);case"ascii":return S(this,r,e);case"latin1":case"binary":return I(this,r,e);case"base64":return T(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function b(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}function E(t,r,e,n,o){if(0===t.length)return-1;if("string"==typeof e?(n=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=o?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(o)return-1;e=t.length-1}else if(e<0){if(!o)return-1;e=0}if("string"==typeof r&&(r=f.from(r,n)),f.isBuffer(r))return 0===r.length?-1:m(t,r,e,n,o);if("number"==typeof r)return r&=255,f.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):m(t,[r],e,n,o);throw new TypeError("val must be string, number or Buffer")}function m(t,r,e,n,o){function i(t,r){return 1===f?t[r]:t.readUInt16BE(r*f)}var f=1,a=t.length,u=r.length;if(void 0!==n&&(n=String(n).toLowerCase(),"ucs2"===n||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||r.length<2)return-1;f=2,a/=2,u/=2,e/=2}var s;if(o){var c=-1;for(s=e;s<a;s++)if(i(t,s)===i(r,c===-1?0:s-c)){if(c===-1&&(c=s),s-c+1===u)return c*f}else c!==-1&&(s-=s-c),c=-1}else for(e+u>a&&(e=a-u),s=e;s>=0;s--){for(var h=!0,l=0;l<u;l++)if(i(t,s+l)!==i(r,l)){h=!1;break}if(h)return s}return-1}function A(t,r,e,n){e=Number(e)||0;var o=t.length-e;n?(n=Number(n),n>o&&(n=o)):n=o;var i=r.length;if(i%2!==0)throw new TypeError("Invalid hex string");n>i/2&&(n=i/2);for(var f=0;f<n;++f){var a=parseInt(r.substr(2*f,2),16);if(isNaN(a))return f;t[e+f]=a}return f}function x(t,r,e,n){return G(H(r,t.length-e),t,e,n)}function U(t,r,e,n){return G(J(r),t,e,n)}function B(t,r,e,n){return U(t,r,e,n)}function R(t,r,e,n){return G(W(r),t,e,n)}function k(t,r,e,n){return G(X(r,t.length-e),t,e,n)}function T(t,r,e){return 0===r&&e===t.length?K.fromByteArray(t):K.fromByteArray(t.slice(r,e))}function P(t,r,e){e=Math.min(t.length,e);for(var n=[],o=r;o<e;){var i=t[o],f=null,a=i>239?4:i>223?3:i>191?2:1;if(o+a<=e){var u,s,c,h;switch(a){case 1:i<128&&(f=i);break;case 2:u=t[o+1],128===(192&u)&&(h=(31&i)<<6|63&u,h>127&&(f=h));break;case 3:u=t[o+1],s=t[o+2],128===(192&u)&&128===(192&s)&&(h=(15&i)<<12|(63&u)<<6|63&s,h>2047&&(h<55296||h>57343)&&(f=h));break;case 4:u=t[o+1],s=t[o+2],c=t[o+3],128===(192&u)&&128===(192&s)&&128===(192&c)&&(h=(15&i)<<18|(63&u)<<12|(63&s)<<6|63&c,h>65535&&h<1114112&&(f=h))}}null===f?(f=65533,a=1):f>65535&&(f-=65536,n.push(f>>>10&1023|55296),f=56320|1023&f),n.push(f),o+=a}return _(n)}function _(t){var r=t.length;if(r<=tt)return String.fromCharCode.apply(String,t);for(var e="",n=0;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=tt));return e}function S(t,r,e){var n="";e=Math.min(t.length,e);for(var o=r;o<e;++o)n+=String.fromCharCode(127&t[o]);return n}function I(t,r,e){var n="";e=Math.min(t.length,e);for(var o=r;o<e;++o)n+=String.fromCharCode(t[o]);return n}function C(t,r,e){var n=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>n)&&(e=n);for(var o="",i=r;i<e;++i)o+=V(t[i]);return o}function O(t,r,e){for(var n=t.slice(r,e),o="",i=0;i<n.length;i+=2)o+=String.fromCharCode(n[i]+256*n[i+1]);return o}function L(t,r,e){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+r>e)throw new RangeError("Trying to access beyond buffer length")}function M(t,r,e,n,o,i){if(!f.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>o||r<i)throw new RangeError('"value" argument is out of bounds');if(e+n>t.length)throw new RangeError("Index out of range")}function Y(t,r,e,n){r<0&&(r=65535+r+1);for(var o=0,i=Math.min(t.length-e,2);o<i;++o)t[e+o]=(r&255<<8*(n?o:1-o))>>>8*(n?o:1-o)}function N(t,r,e,n){r<0&&(r=4294967295+r+1);for(var o=0,i=Math.min(t.length-e,4);o<i;++o)t[e+o]=r>>>8*(n?o:3-o)&255}function D(t,r,e,n,o,i){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function j(t,r,e,n,o){return o||D(t,r,e,4,3.4028234663852886e38,-3.4028234663852886e38),Q.write(t,r,e,n,23,4),e+4}function F(t,r,e,n,o){return o||D(t,r,e,8,1.7976931348623157e308,-1.7976931348623157e308),Q.write(t,r,e,n,52,8),e+8}function q(t){if(t=z(t).replace(rt,""),t.length<2)return"";for(;t.length%4!==0;)t+="=";return t}function z(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function V(t){return t<16?"0"+t.toString(16):t.toString(16)}function H(t,r){r=r||1/0;for(var e,n=t.length,o=null,i=[],f=0;f<n;++f){if(e=t.charCodeAt(f),e>55295&&e<57344){if(!o){if(e>56319){(r-=3)>-1&&i.push(239,191,189);continue}if(f+1===n){(r-=3)>-1&&i.push(239,191,189);continue}o=e;continue}if(e<56320){(r-=3)>-1&&i.push(239,191,189),o=e;continue}e=(o-55296<<10|e-56320)+65536}else o&&(r-=3)>-1&&i.push(239,191,189);if(o=null,e<128){if((r-=1)<0)break;i.push(e)}else if(e<2048){if((r-=2)<0)break;i.push(e>>6|192,63&e|128)}else if(e<65536){if((r-=3)<0)break;i.push(e>>12|224,e>>6&63|128,63&e|128)}else{if(!(e<1114112))throw new Error("Invalid code point");if((r-=4)<0)break;i.push(e>>18|240,e>>12&63|128,e>>6&63|128,63&e|128)}}return i}function J(t){for(var r=[],e=0;e<t.length;++e)r.push(255&t.charCodeAt(e));return r}function X(t,r){for(var e,n,o,i=[],f=0;f<t.length&&!((r-=2)<0);++f)e=t.charCodeAt(f),n=e>>8,o=e%256,i.push(o),i.push(n);return i}function W(t){return K.toByteArray(q(t))}function G(t,r,e,n){for(var o=0;o<n&&!(o+e>=r.length||o>=t.length);++o)r[o+e]=t[o];return o}function Z(t){return t!==t}var K=e(9),Q=e(10),$=e(11);r.Buffer=f,r.SlowBuffer=v,r.INSPECT_MAX_BYTES=50,f.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:n(),r.kMaxLength=o(),f.poolSize=8192,f._augment=function(t){return t.__proto__=f.prototype,t},f.from=function(t,r,e){return a(null,t,r,e)},f.TYPED_ARRAY_SUPPORT&&(f.prototype.__proto__=Uint8Array.prototype,f.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&f[Symbol.species]===f&&Object.defineProperty(f,Symbol.species,{value:null,configurable:!0})),f.alloc=function(t,r,e){return s(null,t,r,e)},f.allocUnsafe=function(t){return c(null,t)},f.allocUnsafeSlow=function(t){return c(null,t)},f.isBuffer=function(t){return!(null==t||!t._isBuffer)},f.compare=function(t,r){if(!f.isBuffer(t)||!f.isBuffer(r))throw new TypeError("Arguments must be Buffers");if(t===r)return 0;for(var e=t.length,n=r.length,o=0,i=Math.min(e,n);o<i;++o)if(t[o]!==r[o]){e=t[o],n=r[o];break}return e<n?-1:n<e?1:0},f.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},f.concat=function(t,r){if(!$(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return f.alloc(0);var e;if(void 0===r)for(r=0,e=0;e<t.length;++e)r+=t[e].length;var n=f.allocUnsafe(r),o=0;for(e=0;e<t.length;++e){var i=t[e];if(!f.isBuffer(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(n,o),o+=i.length}return n},f.byteLength=g,f.prototype._isBuffer=!0,f.prototype.swap16=function(){var t=this.length;if(t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var r=0;r<t;r+=2)b(this,r,r+1);return this},f.prototype.swap32=function(){var t=this.length;if(t%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var r=0;r<t;r+=4)b(this,r,r+3),b(this,r+1,r+2);return this},f.prototype.swap64=function(){var t=this.length;if(t%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var r=0;r<t;r+=8)b(this,r,r+7),b(this,r+1,r+6),b(this,r+2,r+5),b(this,r+3,r+4);return this},f.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?P(this,0,t):w.apply(this,arguments)},f.prototype.equals=function(t){if(!f.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===f.compare(this,t)},f.prototype.inspect=function(){var t="",e=r.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(t+=" ... ")),"<Buffer "+t+">"},f.prototype.compare=function(t,r,e,n,o){if(!f.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===r&&(r=0),void 0===e&&(e=t?t.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),r<0||e>t.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&r>=e)return 0;if(n>=o)return-1;if(r>=e)return 1;if(r>>>=0,e>>>=0,n>>>=0,o>>>=0,this===t)return 0;for(var i=o-n,a=e-r,u=Math.min(i,a),s=this.slice(n,o),c=t.slice(r,e),h=0;h<u;++h)if(s[h]!==c[h]){i=s[h],a=c[h];break}return i<a?-1:a<i?1:0},f.prototype.includes=function(t,r,e){return this.indexOf(t,r,e)!==-1},f.prototype.indexOf=function(t,r,e){return E(this,t,r,e,!0)},f.prototype.lastIndexOf=function(t,r,e){return E(this,t,r,e,!1)},f.prototype.write=function(t,r,e,n){if(void 0===r)n="utf8",e=this.length,r=0;else if(void 0===e&&"string"==typeof r)n=r,e=this.length,r=0;else{if(!isFinite(r))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");r|=0,isFinite(e)?(e|=0,void 0===n&&(n="utf8")):(n=e,e=void 0)}var o=this.length-r;if((void 0===e||e>o)&&(e=o),t.length>0&&(e<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return A(this,t,r,e);case"utf8":case"utf-8":return x(this,t,r,e);case"ascii":return U(this,t,r,e);case"latin1":case"binary":return B(this,t,r,e);case"base64":return R(this,t,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,t,r,e);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},f.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var tt=4096;f.prototype.slice=function(t,r){var e=this.length;t=~~t,r=void 0===r?e:~~r,t<0?(t+=e,t<0&&(t=0)):t>e&&(t=e),r<0?(r+=e,r<0&&(r=0)):r>e&&(r=e),r<t&&(r=t);var n;if(f.TYPED_ARRAY_SUPPORT)n=this.subarray(t,r),n.__proto__=f.prototype;else{var o=r-t;n=new f(o,void 0);for(var i=0;i<o;++i)n[i]=this[i+t]}return n},f.prototype.readUIntLE=function(t,r,e){t|=0,r|=0,e||L(t,r,this.length);for(var n=this[t],o=1,i=0;++i<r&&(o*=256);)n+=this[t+i]*o;return n},f.prototype.readUIntBE=function(t,r,e){t|=0,r|=0,e||L(t,r,this.length);for(var n=this[t+--r],o=1;r>0&&(o*=256);)n+=this[t+--r]*o;return n},f.prototype.readUInt8=function(t,r){return r||L(t,1,this.length),this[t]},f.prototype.readUInt16LE=function(t,r){return r||L(t,2,this.length),this[t]|this[t+1]<<8},f.prototype.readUInt16BE=function(t,r){return r||L(t,2,this.length),this[t]<<8|this[t+1]},f.prototype.readUInt32LE=function(t,r){return r||L(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},f.prototype.readUInt32BE=function(t,r){return r||L(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},f.prototype.readIntLE=function(t,r,e){t|=0,r|=0,e||L(t,r,this.length);for(var n=this[t],o=1,i=0;++i<r&&(o*=256);)n+=this[t+i]*o;return o*=128,n>=o&&(n-=Math.pow(2,8*r)),n},f.prototype.readIntBE=function(t,r,e){t|=0,r|=0,e||L(t,r,this.length);for(var n=r,o=1,i=this[t+--n];n>0&&(o*=256);)i+=this[t+--n]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*r)),i},f.prototype.readInt8=function(t,r){return r||L(t,1,this.length),128&this[t]?(255-this[t]+1)*-1:this[t]},f.prototype.readInt16LE=function(t,r){r||L(t,2,this.length);var e=this[t]|this[t+1]<<8;return 32768&e?4294901760|e:e},f.prototype.readInt16BE=function(t,r){r||L(t,2,this.length);var e=this[t+1]|this[t]<<8;return 32768&e?4294901760|e:e},f.prototype.readInt32LE=function(t,r){return r||L(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},f.prototype.readInt32BE=function(t,r){return r||L(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},f.prototype.readFloatLE=function(t,r){return r||L(t,4,this.length),Q.read(this,t,!0,23,4)},f.prototype.readFloatBE=function(t,r){return r||L(t,4,this.length),Q.read(this,t,!1,23,4)},f.prototype.readDoubleLE=function(t,r){return r||L(t,8,this.length),Q.read(this,t,!0,52,8)},f.prototype.readDoubleBE=function(t,r){return r||L(t,8,this.length),Q.read(this,t,!1,52,8)},f.prototype.writeUIntLE=function(t,r,e,n){if(t=+t,r|=0,e|=0,!n){var o=Math.pow(2,8*e)-1;M(this,t,r,e,o,0)}var i=1,f=0;for(this[r]=255&t;++f<e&&(i*=256);)this[r+f]=t/i&255;return r+e},f.prototype.writeUIntBE=function(t,r,e,n){if(t=+t,r|=0,e|=0,!n){var o=Math.pow(2,8*e)-1;M(this,t,r,e,o,0)}var i=e-1,f=1;for(this[r+i]=255&t;--i>=0&&(f*=256);)this[r+i]=t/f&255;return r+e},f.prototype.writeUInt8=function(t,r,e){return t=+t,r|=0,e||M(this,t,r,1,255,0),f.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[r]=255&t,r+1},f.prototype.writeUInt16LE=function(t,r,e){return t=+t,r|=0,e||M(this,t,r,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):Y(this,t,r,!0),r+2},f.prototype.writeUInt16BE=function(t,r,e){return t=+t,r|=0,e||M(this,t,r,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):Y(this,t,r,!1),r+2},f.prototype.writeUInt32LE=function(t,r,e){return t=+t,r|=0,e||M(this,t,r,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[r+3]=t>>>24,this[r+2]=t>>>16,this[r+1]=t>>>8,this[r]=255&t):N(this,t,r,!0),r+4},f.prototype.writeUInt32BE=function(t,r,e){return t=+t,r|=0,e||M(this,t,r,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):N(this,t,r,!1),r+4},f.prototype.writeIntLE=function(t,r,e,n){if(t=+t,r|=0,!n){var o=Math.pow(2,8*e-1);M(this,t,r,e,o-1,-o)}var i=0,f=1,a=0;for(this[r]=255&t;++i<e&&(f*=256);)t<0&&0===a&&0!==this[r+i-1]&&(a=1),this[r+i]=(t/f>>0)-a&255;return r+e},f.prototype.writeIntBE=function(t,r,e,n){if(t=+t,r|=0,!n){var o=Math.pow(2,8*e-1);M(this,t,r,e,o-1,-o)}var i=e-1,f=1,a=0;for(this[r+i]=255&t;--i>=0&&(f*=256);)t<0&&0===a&&0!==this[r+i+1]&&(a=1),this[r+i]=(t/f>>0)-a&255;return r+e},f.prototype.writeInt8=function(t,r,e){return t=+t,r|=0,e||M(this,t,r,1,127,-128),f.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[r]=255&t,r+1},f.prototype.writeInt16LE=function(t,r,e){return t=+t,r|=0,e||M(this,t,r,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):Y(this,t,r,!0),r+2},f.prototype.writeInt16BE=function(t,r,e){return t=+t,r|=0,e||M(this,t,r,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):Y(this,t,r,!1),r+2},f.prototype.writeInt32LE=function(t,r,e){return t=+t,r|=0,e||M(this,t,r,4,2147483647,-2147483648),f.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8,this[r+2]=t>>>16,this[r+3]=t>>>24):N(this,t,r,!0),r+4},f.prototype.writeInt32BE=function(t,r,e){return t=+t,r|=0,e||M(this,t,r,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),f.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):N(this,t,r,!1),r+4},f.prototype.writeFloatLE=function(t,r,e){return j(this,t,r,!0,e)},f.prototype.writeFloatBE=function(t,r,e){return j(this,t,r,!1,e)},f.prototype.writeDoubleLE=function(t,r,e){return F(this,t,r,!0,e)},f.prototype.writeDoubleBE=function(t,r,e){return F(this,t,r,!1,e)},f.prototype.copy=function(t,r,e,n){if(e||(e=0),n||0===n||(n=this.length),r>=t.length&&(r=t.length),r||(r=0),n>0&&n<e&&(n=e),n===e)return 0;if(0===t.length||0===this.length)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(e<0||e>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-r<n-e&&(n=t.length-r+e);var o,i=n-e;if(this===t&&e<r&&r<n)for(o=i-1;o>=0;--o)t[o+r]=this[o+e];else if(i<1e3||!f.TYPED_ARRAY_SUPPORT)for(o=0;o<i;++o)t[o+r]=this[o+e];else Uint8Array.prototype.set.call(t,this.subarray(e,e+i),r);return i},f.prototype.fill=function(t,r,e,n){if("string"==typeof t){if("string"==typeof r?(n=r,r=0,e=this.length):"string"==typeof e&&(n=e,e=this.length),1===t.length){var o=t.charCodeAt(0);o<256&&(t=o)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!f.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(r<0||this.length<r||this.length<e)throw new RangeError("Out of range index");if(e<=r)return this;r>>>=0,e=void 0===e?this.length:e>>>0,t||(t=0);var i;if("number"==typeof t)for(i=r;i<e;++i)this[i]=t;else{var a=f.isBuffer(t)?t:H(new f(t,n).toString()),u=a.length;for(i=0;i<e-r;++i)this[i+r]=a[i%u]}return this};var rt=/[^+\/0-9A-Za-z-_]/g}).call(r,function(){return this}())},function(t,r){"use strict";function e(t){var r=t.length;if(r%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var e=t.indexOf("=");e===-1&&(e=r);var n=e===r?0:4-e%4;return[e,n]}function n(t){var r=e(t),n=r[0],o=r[1];return 3*(n+o)/4-o}function o(t,r,e){return 3*(r+e)/4-e}function i(t){for(var r,n=e(t),i=n[0],f=n[1],a=new h(o(t,i,f)),u=0,s=f>0?i-4:i,l=0;l<s;l+=4)r=c[t.charCodeAt(l)]<<18|c[t.charCodeAt(l+1)]<<12|c[t.charCodeAt(l+2)]<<6|c[t.charCodeAt(l+3)],a[u++]=r>>16&255,a[u++]=r>>8&255,a[u++]=255&r;return 2===f&&(r=c[t.charCodeAt(l)]<<2|c[t.charCodeAt(l+1)]>>4,a[u++]=255&r),1===f&&(r=c[t.charCodeAt(l)]<<10|c[t.charCodeAt(l+1)]<<4|c[t.charCodeAt(l+2)]>>2,a[u++]=r>>8&255,a[u++]=255&r),a}function f(t){return s[t>>18&63]+s[t>>12&63]+s[t>>6&63]+s[63&t]}function a(t,r,e){for(var n,o=[],i=r;i<e;i+=3)n=(t[i]<<16&16711680)+(t[i+1]<<8&65280)+(255&t[i+2]),o.push(f(n));return o.join("")}function u(t){for(var r,e=t.length,n=e%3,o=[],i=16383,f=0,u=e-n;f<u;f+=i)o.push(a(t,f,f+i>u?u:f+i));return 1===n?(r=t[e-1],o.push(s[r>>2]+s[r<<4&63]+"==")):2===n&&(r=(t[e-2]<<8)+t[e-1],o.push(s[r>>10]+s[r>>4&63]+s[r<<2&63]+"=")),o.join("")}r.byteLength=n,r.toByteArray=i,r.fromByteArray=u;for(var s=[],c=[],h="undefined"!=typeof Uint8Array?Uint8Array:Array,l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",p=0,d=l.length;p<d;++p)s[p]=l[p],c[l.charCodeAt(p)]=p;c["-".charCodeAt(0)]=62,c["_".charCodeAt(0)]=63},function(t,r){r.read=function(t,r,e,n,o){var i,f,a=8*o-n-1,u=(1<<a)-1,s=u>>1,c=-7,h=e?o-1:0,l=e?-1:1,p=t[r+h];for(h+=l,i=p&(1<<-c)-1,p>>=-c,c+=a;c>0;i=256*i+t[r+h],h+=l,c-=8);for(f=i&(1<<-c)-1,i>>=-c,c+=n;c>0;f=256*f+t[r+h],h+=l,c-=8);if(0===i)i=1-s;else{if(i===u)return f?NaN:(p?-1:1)*(1/0);f+=Math.pow(2,n),i-=s}return(p?-1:1)*f*Math.pow(2,i-n)},r.write=function(t,r,e,n,o,i){var f,a,u,s=8*i-o-1,c=(1<<s)-1,h=c>>1,l=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:i-1,d=n?1:-1,y=r<0||0===r&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(a=isNaN(r)?1:0,f=c):(f=Math.floor(Math.log(r)/Math.LN2),r*(u=Math.pow(2,-f))<1&&(f--,u*=2),r+=f+h>=1?l/u:l*Math.pow(2,1-h),r*u>=2&&(f++,u/=2),f+h>=c?(a=0,f=c):f+h>=1?(a=(r*u-1)*Math.pow(2,o),f+=h):(a=r*Math.pow(2,h-1)*Math.pow(2,o),f=0));o>=8;t[e+p]=255&a,p+=d,a/=256,o-=8);for(f=f<<o|a,s+=o;s>0;t[e+p]=255&f,p+=d,f/=256,s-=8);t[e+p-d]|=128*y}},function(t,r){var e={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==e.call(t)}},function(t,r,e){function n(t){return new Array(t)}function o(t){if(!i.isBuffer(t)&&i.isView(t))t=i.Uint8Array.from(t);else if(i.isArrayBuffer(t))t=new Uint8Array(t);else{if("string"==typeof t)return i.from.call(r,t);if("number"==typeof t)throw new TypeError('"value" argument must not be a number')}return Array.prototype.slice.call(t)}var i=e(6),r=t.exports=n(0);r.alloc=n,r.concat=i.concat,r.from=o},function(t,r,e){function n(t){return new f(t)}function o(t){if(!i.isBuffer(t)&&i.isView(t))t=i.Uint8Array.from(t);else if(i.isArrayBuffer(t))t=new Uint8Array(t);else{if("string"==typeof t)return i.from.call(r,t);if("number"==typeof t)throw new TypeError('"value" argument must not be a number')}return f.from&&1!==f.from.length?f.from(t):new f(t)}var i=e(6),f=i.global,r=t.exports=i.hasBuffer?n(0):[];r.alloc=i.hasBuffer&&f.alloc||n,r.concat=i.concat,r.from=o},function(t,r,e){function n(t){return new Uint8Array(t)}function o(t){if(i.isView(t)){var e=t.byteOffset,n=t.byteLength;t=t.buffer,t.byteLength!==n&&(t.slice?t=t.slice(e,e+n):(t=new Uint8Array(t),t.byteLength!==n&&(t=Array.prototype.slice.call(t,e,e+n))))}else{if("string"==typeof t)return i.from.call(r,t);if("number"==typeof t)throw new TypeError('"value" argument must not be a number')}return new Uint8Array(t)}var i=e(6),r=t.exports=i.hasArrayBuffer?n(0):[];r.alloc=n,r.concat=i.concat,r.from=o},function(t,r,e){function n(t,r,e,n){var i=u.isBuffer(this),f=u.isBuffer(t);if(i&&f)return this.copy(t,r,e,n);if(h||i||f||!u.isView(this)||!u.isView(t))return a.copy.call(this,t,r,e,n);var s=e||null!=n?o.call(this,e,n):this;return t.set(s,r),s.length}function o(t,r){var e=this.slice||!h&&this.subarray;if(e)return e.call(this,t,r);var o=u.alloc.call(this,r-t);return n.call(this,o,0,t,r),o}function i(t,r,e){var n=!c&&u.isBuffer(this)?this.toString:a.toString;return n.apply(this,arguments)}function f(t){function r(){var r=this[t]||a[t];return r.apply(this,arguments)}return r}var a=e(16);r.copy=n,r.slice=o,r.toString=i,r.write=f("write");var u=e(6),s=u.global,c=u.hasBuffer&&"TYPED_ARRAY_SUPPORT"in s,h=c&&!s.TYPED_ARRAY_SUPPORT},function(t,r){function e(t,r){for(var e=this,n=r||(r|=0),o=t.length,i=0,f=0;f<o;)i=t.charCodeAt(f++),i<128?e[n++]=i:i<2048?(e[n++]=192|i>>>6,e[n++]=128|63&i):i<55296||i>57343?(e[n++]=224|i>>>12,e[n++]=128|i>>>6&63,e[n++]=128|63&i):(i=(i-55296<<10|t.charCodeAt(f++)-56320)+65536,e[n++]=240|i>>>18,e[n++]=128|i>>>12&63,e[n++]=128|i>>>6&63,e[n++]=128|63&i);return n-r}function n(t,r,e){var n=this,o=0|r;e||(e=n.length);for(var i="",f=0;o<e;)f=n[o++],f<128?i+=String.fromCharCode(f):(192===(224&f)?f=(31&f)<<6|63&n[o++]:224===(240&f)?f=(15&f)<<12|(63&n[o++])<<6|63&n[o++]:240===(248&f)&&(f=(7&f)<<18|(63&n[o++])<<12|(63&n[o++])<<6|63&n[o++]),f>=65536?(f-=65536,i+=String.fromCharCode((f>>>10)+55296,(1023&f)+56320)):i+=String.fromCharCode(f));return i}function o(t,r,e,n){var o;e||(e=0),n||0===n||(n=this.length),r||(r=0);var i=n-e;if(t===this&&e<r&&r<n)for(o=i-1;o>=0;o--)t[o+r]=this[o+e];else for(o=0;o<i;o++)t[o+r]=this[o+e];return i}r.copy=o,r.toString=n,r.write=e},function(t,r,e){function n(t){t.addExtPacker(14,Error,[a,o]),t.addExtPacker(1,EvalError,[a,o]),t.addExtPacker(2,RangeError,[a,o]),t.addExtPacker(3,ReferenceError,[a,o]),t.addExtPacker(4,SyntaxError,[a,o]),t.addExtPacker(5,TypeError,[a,o]),t.addExtPacker(6,URIError,[a,o]),t.addExtPacker(10,RegExp,[f,o]),t.addExtPacker(11,Boolean,[i,o]),t.addExtPacker(12,String,[i,o]),t.addExtPacker(13,Date,[Number,o]),t.addExtPacker(15,Number,[i,o]),"undefined"!=typeof Uint8Array&&(t.addExtPacker(17,Int8Array,h),t.addExtPacker(18,Uint8Array,h),t.addExtPacker(19,Int16Array,h),t.addExtPacker(20,Uint16Array,h),t.addExtPacker(21,Int32Array,h),t.addExtPacker(22,Uint32Array,h),t.addExtPacker(23,Float32Array,h),"undefined"!=typeof Float64Array&&t.addExtPacker(24,Float64Array,h),"undefined"!=typeof Uint8ClampedArray&&t.addExtPacker(25,Uint8ClampedArray,h),t.addExtPacker(26,ArrayBuffer,h),t.addExtPacker(29,DataView,h)),s.hasBuffer&&t.addExtPacker(27,c,s.from)}function o(t){return u||(u=e(2).encode),u(t)}function i(t){return t.valueOf()}function f(t){t=RegExp.prototype.toString.call(t).split("/"),t.shift();var r=[t.pop()];return r.unshift(t.join("/")),r}function a(t){var r={};for(var e in l)r[e]=t[e];return r}r.setExtPackers=n;var u,s=e(6),c=s.global,h=s.Uint8Array.from,l={name:1,message:1,stack:1,columnNumber:1,fileName:1,lineNumber:1}},function(t,r,e){function n(t){function r(t,r){var e=r?195:194;P[e](t,r)}function e(t,r){var e,n=0|r;return r!==n?(e=203,void P[e](t,r)):(e=-32<=n&&n<=127?255&n:0<=n?n<=255?204:n<=65535?205:206:-128<=n?208:-32768<=n?209:210,void P[e](t,n))}function n(t,r){var e=207;P[e](t,r.toArray())}function i(t,r){var e=211;P[e](t,r.toArray())}function v(t){return t<32?1:t<=255?2:t<=65535?3:5}function g(t){return t<32?1:t<=65535?3:5}function w(t){function r(r,e){var n=e.length,o=5+3*n;r.offset=r.reserve(o);var i=r.buffer,f=t(n),a=r.offset+f;n=s.write.call(i,e,a);var u=t(n);if(f!==u){var c=a+u-f,h=a+n;s.copy.call(i,i,c,a,h)}var l=1===u?160+n:u<=3?215+u:219;P[l](r,n),r.offset+=n}return r}function b(t,r){if(null===r)return m(t,r);if(I(r))return C(t,r);if(o(r))return A(t,r);if(f.isUint64BE(r))return n(t,r);if(a.isInt64BE(r))return i(t,r);var e=t.codec.getExtPacker(r);return e&&(r=e(r)),r instanceof l?B(t,r):void L(t,r)}function E(t,r){return I(r)?T(t,r):void b(t,r)}function m(t,r){var e=192;P[e](t,r)}function A(t,r){var e=r.length,n=e<16?144+e:e<=65535?220:221;P[n](t,e);for(var o=t.codec.encode,i=0;i<e;i++)o(t,r[i])}function x(t,r){var e=r.length,n=e<255?196:e<=65535?197:198;P[n](t,e),t.send(r)}function U(t,r){x(t,new Uint8Array(r))}function B(t,r){var e=r.buffer,n=e.length,o=y[n]||(n<255?199:n<=65535?200:201);P[o](t,n),h[r.type](t),t.send(e)}function R(t,r){var e=Object.keys(r),n=e.length,o=n<16?128+n:n<=65535?222:223;P[o](t,n);var i=t.codec.encode;e.forEach(function(e){i(t,e),i(t,r[e])})}function k(t,r){if(!(r instanceof Map))return R(t,r);var e=r.size,n=e<16?128+e:e<=65535?222:223;P[n](t,e);var o=t.codec.encode;r.forEach(function(r,e,n){o(t,e),o(t,r)})}function T(t,r){var e=r.length,n=e<32?160+e:e<=65535?218:219;P[n](t,e),t.send(r)}var P=c.getWriteToken(t),_=t&&t.useraw,S=p&&t&&t.binarraybuffer,I=S?u.isArrayBuffer:u.isBuffer,C=S?U:x,O=d&&t&&t.usemap,L=O?k:R,M={boolean:r,function:m,number:e,object:_?E:b,string:w(_?g:v),symbol:m,undefined:m};return M}var o=e(11),i=e(19),f=i.Uint64BE,a=i.Int64BE,u=e(6),s=e(15),c=e(20),h=e(22).uint8,l=e(5).ExtBuffer,p="undefined"!=typeof Uint8Array,d="undefined"!=typeof Map,y=[];y[1]=212,y[2]=213,y[4]=214,y[8]=215,y[16]=216,r.getWriteType=n},function(t,r,e){(function(t){var e,n,o,i;!function(r){function f(t,e,n){function o(t,r,e,n){return this instanceof o?f(this,t,r,e,n):new o(t,r,e,n)}function i(t){return!(!t||!t[j])}function f(t,r,e,n,o){if(m&&A&&(r instanceof A&&(r=new m(r)),n instanceof A&&(n=new m(n))),!(r||e||n||w))return void(t.buffer=l(x,0));if(!c(r,e)){var i=w||Array;o=e,n=r,e=0,r=new i(8)}t.buffer=r,t.offset=e|=0,b!==typeof n&&("string"==typeof n?g(r,e,n,o||10):c(n,o)?h(r,e,n,o):"number"==typeof o?(T(r,e+_,n),T(r,e+S,o)):n>0?M(r,e,n):n<0?Y(r,e,n):h(r,e,x,0))}function g(t,r,e,n){var o=0,i=e.length,f=0,a=0;"-"===e[0]&&o++;for(var u=o;o<i;){var s=parseInt(e[o++],n);if(!(s>=0))break;a=a*n+s,f=f*n+Math.floor(a/B),a%=B}u&&(f=~f,a?a=B-a:f++),T(t,r+_,f),T(t,r+S,a)}function U(){var t=this.buffer,r=this.offset,e=P(t,r+_),o=P(t,r+S);return n||(e|=0),e?e*B+o:o}function k(t){var r=this.buffer,e=this.offset,o=P(r,e+_),i=P(r,e+S),f="",a=!n&&2147483648&o;for(a&&(o=~o,i=B-i),t=t||10;;){var u=o%t*B+i;if(o=Math.floor(o/t),i=Math.floor(u/t),f=(u%t).toString(t)+f,!o&&!i)break}return a&&(f="-"+f),f}function T(t,r,e){t[r+L]=255&e,e>>=8,t[r+O]=255&e,e>>=8,t[r+C]=255&e,e>>=8,t[r+I]=255&e}function P(t,r){return t[r+I]*R+(t[r+C]<<16)+(t[r+O]<<8)+t[r+L]}var _=e?0:4,S=e?4:0,I=e?0:3,C=e?1:2,O=e?2:1,L=e?3:0,M=e?p:y,Y=e?d:v,N=o.prototype,D="is"+t,j="_"+D;return N.buffer=void 0,N.offset=0,N[j]=!0,N.toNumber=U,N.toString=k,N.toJSON=U,N.toArray=a,E&&(N.toBuffer=u),m&&(N.toArrayBuffer=s),o[D]=i,r[t]=o,o}function a(t){var r=this.buffer,e=this.offset;return w=null,t!==!1&&0===e&&8===r.length&&U(r)?r:l(r,e)}function u(r){var e=this.buffer,n=this.offset;if(w=E,r!==!1&&0===n&&8===e.length&&t.isBuffer(e))return e;var o=new E(8);return h(o,0,e,n),o}function s(t){var r=this.buffer,e=this.offset,n=r.buffer;if(w=m,t!==!1&&0===e&&n instanceof A&&8===n.byteLength)return n;var o=new m(8);return h(o,0,r,e),o.buffer}function c(t,r){var e=t&&t.length;return r|=0,e&&r+8<=e&&"string"!=typeof t[r]}function h(t,r,e,n){r|=0,n|=0;for(var o=0;o<8;o++)t[r++]=255&e[n++]}function l(t,r){return Array.prototype.slice.call(t,r,r+8)}function p(t,r,e){for(var n=r+8;n>r;)t[--n]=255&e,e/=256}function d(t,r,e){var n=r+8;for(e++;n>r;)t[--n]=255&-e^255,e/=256}function y(t,r,e){for(var n=r+8;r<n;)t[r++]=255&e,e/=256}function v(t,r,e){var n=r+8;for(e++;r<n;)t[r++]=255&-e^255,e/=256}function g(t){return!!t&&"[object Array]"==Object.prototype.toString.call(t)}var w,b="undefined",E=b!==typeof t&&t,m=b!==typeof Uint8Array&&Uint8Array,A=b!==typeof ArrayBuffer&&ArrayBuffer,x=[0,0,0,0,0,0,0,0],U=Array.isArray||g,B=4294967296,R=16777216;e=f("Uint64BE",!0,!0),n=f("Int64BE",!0,!1),o=f("Uint64LE",!1,!0),i=f("Int64LE",!1,!1)}("object"==typeof r&&"string"!=typeof r.nodeName?r:this||{})}).call(r,e(8).Buffer)},function(t,r,e){function n(t){return t&&t.uint8array?o():x||E.hasBuffer&&t&&t.safe?f():i()}function o(){var t=i();return t[202]=c(202,4,p),t[203]=c(203,8,d),t}function i(){var t=b.slice();return t[196]=a(196),t[197]=u(197),t[198]=s(198),t[199]=a(199),t[200]=u(200),t[201]=s(201),t[202]=c(202,4,U.writeFloatBE||p,!0),t[203]=c(203,8,U.writeDoubleBE||d,!0),
t[204]=a(204),t[205]=u(205),t[206]=s(206),t[207]=c(207,8,h),t[208]=a(208),t[209]=u(209),t[210]=s(210),t[211]=c(211,8,l),t[217]=a(217),t[218]=u(218),t[219]=s(219),t[220]=u(220),t[221]=s(221),t[222]=u(222),t[223]=s(223),t}function f(){var t=b.slice();return t[196]=c(196,1,m.prototype.writeUInt8),t[197]=c(197,2,m.prototype.writeUInt16BE),t[198]=c(198,4,m.prototype.writeUInt32BE),t[199]=c(199,1,m.prototype.writeUInt8),t[200]=c(200,2,m.prototype.writeUInt16BE),t[201]=c(201,4,m.prototype.writeUInt32BE),t[202]=c(202,4,m.prototype.writeFloatBE),t[203]=c(203,8,m.prototype.writeDoubleBE),t[204]=c(204,1,m.prototype.writeUInt8),t[205]=c(205,2,m.prototype.writeUInt16BE),t[206]=c(206,4,m.prototype.writeUInt32BE),t[207]=c(207,8,h),t[208]=c(208,1,m.prototype.writeInt8),t[209]=c(209,2,m.prototype.writeInt16BE),t[210]=c(210,4,m.prototype.writeInt32BE),t[211]=c(211,8,l),t[217]=c(217,1,m.prototype.writeUInt8),t[218]=c(218,2,m.prototype.writeUInt16BE),t[219]=c(219,4,m.prototype.writeUInt32BE),t[220]=c(220,2,m.prototype.writeUInt16BE),t[221]=c(221,4,m.prototype.writeUInt32BE),t[222]=c(222,2,m.prototype.writeUInt16BE),t[223]=c(223,4,m.prototype.writeUInt32BE),t}function a(t){return function(r,e){var n=r.reserve(2),o=r.buffer;o[n++]=t,o[n]=e}}function u(t){return function(r,e){var n=r.reserve(3),o=r.buffer;o[n++]=t,o[n++]=e>>>8,o[n]=e}}function s(t){return function(r,e){var n=r.reserve(5),o=r.buffer;o[n++]=t,o[n++]=e>>>24,o[n++]=e>>>16,o[n++]=e>>>8,o[n]=e}}function c(t,r,e,n){return function(o,i){var f=o.reserve(r+1);o.buffer[f++]=t,e.call(o.buffer,i,f,n)}}function h(t,r){new g(this,r,t)}function l(t,r){new w(this,r,t)}function p(t,r){y.write(this,t,r,!1,23,4)}function d(t,r){y.write(this,t,r,!1,52,8)}var y=e(21),v=e(19),g=v.Uint64BE,w=v.Int64BE,b=e(22).uint8,E=e(6),m=E.global,A=E.hasBuffer&&"TYPED_ARRAY_SUPPORT"in m,x=A&&!m.TYPED_ARRAY_SUPPORT,U=E.hasBuffer&&m.prototype||{};r.getWriteToken=n},function(t,r){r.read=function(t,r,e,n,o){var i,f,a=8*o-n-1,u=(1<<a)-1,s=u>>1,c=-7,h=e?o-1:0,l=e?-1:1,p=t[r+h];for(h+=l,i=p&(1<<-c)-1,p>>=-c,c+=a;c>0;i=256*i+t[r+h],h+=l,c-=8);for(f=i&(1<<-c)-1,i>>=-c,c+=n;c>0;f=256*f+t[r+h],h+=l,c-=8);if(0===i)i=1-s;else{if(i===u)return f?NaN:(p?-1:1)*(1/0);f+=Math.pow(2,n),i-=s}return(p?-1:1)*f*Math.pow(2,i-n)},r.write=function(t,r,e,n,o,i){var f,a,u,s=8*i-o-1,c=(1<<s)-1,h=c>>1,l=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:i-1,d=n?1:-1,y=r<0||0===r&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(a=isNaN(r)?1:0,f=c):(f=Math.floor(Math.log(r)/Math.LN2),r*(u=Math.pow(2,-f))<1&&(f--,u*=2),r+=f+h>=1?l/u:l*Math.pow(2,1-h),r*u>=2&&(f++,u/=2),f+h>=c?(a=0,f=c):f+h>=1?(a=(r*u-1)*Math.pow(2,o),f+=h):(a=r*Math.pow(2,h-1)*Math.pow(2,o),f=0));o>=8;t[e+p]=255&a,p+=d,a/=256,o-=8);for(f=f<<o|a,s+=o;s>0;t[e+p]=255&f,p+=d,f/=256,s-=8);t[e+p-d]|=128*y}},function(t,r){function e(t){return function(r){var e=r.reserve(1);r.buffer[e]=t}}for(var n=r.uint8=new Array(256),o=0;o<=255;o++)n[o]=e(o)},function(t,r,e){function n(t){return this instanceof n?(this.options=t,void this.init()):new n(t)}function o(t){for(var r in t)n.prototype[r]=i(n.prototype[r],t[r])}function i(t,r){function e(){return t.apply(this,arguments),r.apply(this,arguments)}return t&&r?e:t||r}function f(t){function r(t,r){return r(t)}return t=t.slice(),function(e){return t.reduce(r,e)}}function a(t){return s(t)?f(t):t}function u(t){return new n(t)}var s=e(11);r.createCodec=u,r.install=o,r.filter=a;var c=e(6);n.prototype.init=function(){var t=this.options;return t&&t.uint8array&&(this.bufferish=c.Uint8Array),this},r.preset=u({preset:!0})},function(t,r,e){function n(){if(!(this instanceof n))return new n}function o(){if(!(this instanceof o))return new o}function i(){function t(t){var r=this.offset?p.prototype.slice.call(this.buffer,this.offset):this.buffer;this.buffer=r?t?this.bufferish.concat([r,t]):r:t,this.offset=0}function r(){for(;this.offset<this.buffer.length;){var t,r=this.offset;try{t=this.fetch()}catch(t){if(t&&t.message!=v)throw t;this.offset=r;break}this.push(t)}}function e(t){var r=this.offset,e=r+t;if(e>this.buffer.length)throw new Error(v);return this.offset=e,r}return{bufferish:p,write:t,fetch:u,flush:r,push:c,pull:h,read:s,reserve:e,offset:0}}function f(){function t(){var t=this.start;if(t<this.offset){var r=this.start=this.offset;return p.prototype.slice.call(this.buffer,t,r)}}function r(){for(;this.start<this.offset;){var t=this.fetch();t&&this.push(t)}}function e(){var t=this.buffers||(this.buffers=[]),r=t.length>1?this.bufferish.concat(t):t[0];return t.length=0,r}function n(t){var r=0|t;if(this.buffer){var e=this.buffer.length,n=0|this.offset,o=n+r;if(o<e)return this.offset=o,n;this.flush(),t=Math.max(t,Math.min(2*e,this.maxBufferSize))}return t=Math.max(t,this.minBufferSize),this.buffer=this.bufferish.alloc(t),this.start=0,this.offset=r,0}function o(t){var r=t.length;if(r>this.minBufferSize)this.flush(),this.push(t);else{var e=this.reserve(r);p.prototype.copy.call(t,this.buffer,e)}}return{bufferish:p,write:a,fetch:t,flush:r,push:c,pull:e,read:s,reserve:n,send:o,maxBufferSize:y,minBufferSize:d,offset:0,start:0}}function a(){throw new Error("method not implemented: write()")}function u(){throw new Error("method not implemented: fetch()")}function s(){var t=this.buffers&&this.buffers.length;return t?(this.flush(),this.pull()):this.fetch()}function c(t){var r=this.buffers||(this.buffers=[]);r.push(t)}function h(){var t=this.buffers||(this.buffers=[]);return t.shift()}function l(t){function r(r){for(var e in t)r[e]=t[e];return r}return r}r.FlexDecoder=n,r.FlexEncoder=o;var p=e(6),d=2048,y=65536,v="BUFFER_SHORTAGE";n.mixin=l(i()),n.mixin(n.prototype),o.mixin=l(f()),o.mixin(o.prototype)},function(t,r,e){function n(t,r){var e=new o(r);return e.write(t),e.read()}r.decode=n;var o=e(26).DecodeBuffer},function(t,r,e){function n(t){if(!(this instanceof n))return new n(t);if(t&&(this.options=t,t.codec)){var r=this.codec=t.codec;r.bufferish&&(this.bufferish=r.bufferish)}}r.DecodeBuffer=n;var o=e(27).preset,i=e(24).FlexDecoder;i.mixin(n.prototype),n.prototype.codec=o,n.prototype.fetch=function(){return this.codec.decode(this)}},function(t,r,e){function n(t){function r(t){var r=s(t),n=e[r];if(!n)throw new Error("Invalid type: "+(r?"0x"+r.toString(16):r));return n(t)}var e=c.getReadToken(t);return r}function o(){var t=this.options;return this.decode=n(t),t&&t.preset&&u.setExtUnpackers(this),this}function i(t,r){var e=this.extUnpackers||(this.extUnpackers=[]);e[t]=h.filter(r)}function f(t){function r(r){return new a(r,t)}var e=this.extUnpackers||(this.extUnpackers=[]);return e[t]||r}var a=e(5).ExtBuffer,u=e(28),s=e(29).readUint8,c=e(30),h=e(23);h.install({addExtUnpacker:i,getExtUnpacker:f,init:o}),r.preset=o.call(h.preset)},function(t,r,e){function n(t){t.addExtUnpacker(14,[o,f(Error)]),t.addExtUnpacker(1,[o,f(EvalError)]),t.addExtUnpacker(2,[o,f(RangeError)]),t.addExtUnpacker(3,[o,f(ReferenceError)]),t.addExtUnpacker(4,[o,f(SyntaxError)]),t.addExtUnpacker(5,[o,f(TypeError)]),t.addExtUnpacker(6,[o,f(URIError)]),t.addExtUnpacker(10,[o,i]),t.addExtUnpacker(11,[o,a(Boolean)]),t.addExtUnpacker(12,[o,a(String)]),t.addExtUnpacker(13,[o,a(Date)]),t.addExtUnpacker(15,[o,a(Number)]),"undefined"!=typeof Uint8Array&&(t.addExtUnpacker(17,a(Int8Array)),t.addExtUnpacker(18,a(Uint8Array)),t.addExtUnpacker(19,[u,a(Int16Array)]),t.addExtUnpacker(20,[u,a(Uint16Array)]),t.addExtUnpacker(21,[u,a(Int32Array)]),t.addExtUnpacker(22,[u,a(Uint32Array)]),t.addExtUnpacker(23,[u,a(Float32Array)]),"undefined"!=typeof Float64Array&&t.addExtUnpacker(24,[u,a(Float64Array)]),"undefined"!=typeof Uint8ClampedArray&&t.addExtUnpacker(25,a(Uint8ClampedArray)),t.addExtUnpacker(26,u),t.addExtUnpacker(29,[u,a(DataView)])),c.hasBuffer&&t.addExtUnpacker(27,a(h))}function o(t){return s||(s=e(25).decode),s(t)}function i(t){return RegExp.apply(null,t)}function f(t){return function(r){var e=new t;for(var n in l)e[n]=r[n];return e}}function a(t){return function(r){return new t(r)}}function u(t){return new Uint8Array(t).buffer}r.setExtUnpackers=n;var s,c=e(6),h=c.global,l={name:1,message:1,stack:1,columnNumber:1,fileName:1,lineNumber:1}},function(t,r,e){function n(t){var r=T.hasArrayBuffer&&t&&t.binarraybuffer,e=t&&t.int64,n=_&&t&&t.usemap,U={map:n?i:o,array:f,str:a,bin:r?s:u,ext:c,uint8:h,uint16:p,uint32:y,uint64:g(8,e?E:w),int8:l,int16:d,int32:v,int64:g(8,e?m:b),float32:g(4,A),float64:g(8,x)};return U}function o(t,r){var e,n={},o=new Array(r),i=new Array(r),f=t.codec.decode;for(e=0;e<r;e++)o[e]=f(t),i[e]=f(t);for(e=0;e<r;e++)n[o[e]]=i[e];return n}function i(t,r){var e,n=new Map,o=new Array(r),i=new Array(r),f=t.codec.decode;for(e=0;e<r;e++)o[e]=f(t),i[e]=f(t);for(e=0;e<r;e++)n.set(o[e],i[e]);return n}function f(t,r){for(var e=new Array(r),n=t.codec.decode,o=0;o<r;o++)e[o]=n(t);return e}function a(t,r){var e=t.reserve(r),n=e+r;return P.toString.call(t.buffer,"utf-8",e,n)}function u(t,r){var e=t.reserve(r),n=e+r,o=P.slice.call(t.buffer,e,n);return T.from(o)}function s(t,r){var e=t.reserve(r),n=e+r,o=P.slice.call(t.buffer,e,n);return T.Uint8Array.from(o).buffer}function c(t,r){var e=t.reserve(r+1),n=t.buffer[e++],o=e+r,i=t.codec.getExtUnpacker(n);if(!i)throw new Error("Invalid ext type: "+(n?"0x"+n.toString(16):n));var f=P.slice.call(t.buffer,e,o);return i(f)}function h(t){var r=t.reserve(1);return t.buffer[r]}function l(t){var r=t.reserve(1),e=t.buffer[r];return 128&e?e-256:e}function p(t){var r=t.reserve(2),e=t.buffer;return e[r++]<<8|e[r]}function d(t){var r=t.reserve(2),e=t.buffer,n=e[r++]<<8|e[r];return 32768&n?n-65536:n}function y(t){var r=t.reserve(4),e=t.buffer;return 16777216*e[r++]+(e[r++]<<16)+(e[r++]<<8)+e[r]}function v(t){var r=t.reserve(4),e=t.buffer;return e[r++]<<24|e[r++]<<16|e[r++]<<8|e[r]}function g(t,r){return function(e){var n=e.reserve(t);return r.call(e.buffer,n,S)}}function w(t){return new R(this,t).toNumber()}function b(t){return new k(this,t).toNumber()}function E(t){return new R(this,t)}function m(t){return new k(this,t)}function A(t){return U.read(this,t,!1,23,4)}function x(t){return U.read(this,t,!1,52,8)}var U=e(21),B=e(19),R=B.Uint64BE,k=B.Int64BE;r.getReadFormat=n,r.readUint8=h;var T=e(6),P=e(15),_="undefined"!=typeof Map,S=!0},function(t,r,e){function n(t){var r=s.getReadFormat(t);return t&&t.useraw?i(r):o(r)}function o(t){var r,e=new Array(256);for(r=0;r<=127;r++)e[r]=f(r);for(r=128;r<=143;r++)e[r]=u(r-128,t.map);for(r=144;r<=159;r++)e[r]=u(r-144,t.array);for(r=160;r<=191;r++)e[r]=u(r-160,t.str);for(e[192]=f(null),e[193]=null,e[194]=f(!1),e[195]=f(!0),e[196]=a(t.uint8,t.bin),e[197]=a(t.uint16,t.bin),e[198]=a(t.uint32,t.bin),e[199]=a(t.uint8,t.ext),e[200]=a(t.uint16,t.ext),e[201]=a(t.uint32,t.ext),e[202]=t.float32,e[203]=t.float64,e[204]=t.uint8,e[205]=t.uint16,e[206]=t.uint32,e[207]=t.uint64,e[208]=t.int8,e[209]=t.int16,e[210]=t.int32,e[211]=t.int64,e[212]=u(1,t.ext),e[213]=u(2,t.ext),e[214]=u(4,t.ext),e[215]=u(8,t.ext),e[216]=u(16,t.ext),e[217]=a(t.uint8,t.str),e[218]=a(t.uint16,t.str),e[219]=a(t.uint32,t.str),e[220]=a(t.uint16,t.array),e[221]=a(t.uint32,t.array),e[222]=a(t.uint16,t.map),e[223]=a(t.uint32,t.map),r=224;r<=255;r++)e[r]=f(r-256);return e}function i(t){var r,e=o(t).slice();for(e[217]=e[196],e[218]=e[197],e[219]=e[198],r=160;r<=191;r++)e[r]=u(r-160,t.bin);return e}function f(t){return function(){return t}}function a(t,r){return function(e){var n=t(e);return r(e,n)}}function u(t,r){return function(e){return r(e,t)}}var s=e(29);r.getReadToken=n},function(t,r,e){function n(t){return this instanceof n?void i.call(this,t):new n(t)}r.Encoder=n;var o=e(32),i=e(3).EncodeBuffer;n.prototype=new i,o.mixin(n.prototype),n.prototype.encode=function(t){this.write(t),this.emit("data",this.read())},n.prototype.end=function(t){arguments.length&&this.encode(t),this.flush(),this.emit("end")}},function(t,r,e){/**
* event-lite.js - Light-weight EventEmitter (less than 1KB when gzipped)
*
* @copyright Yusuke Kawasaki
* @license MIT
* @constructor
* @see https://github.com/kawanet/event-lite
* @see http://kawanet.github.io/event-lite/EventLite.html
* @example
* var EventLite = require("event-lite");
*
* function MyClass() {...} // your class
*
* EventLite.mixin(MyClass.prototype); // import event methods
*
* var obj = new MyClass();
* obj.on("foo", function() {...}); // add event listener
* obj.once("bar", function() {...}); // add one-time event listener
* obj.emit("foo"); // dispatch event
* obj.emit("bar"); // dispatch another event
* obj.off("foo"); // remove event listener
*/
function n(){if(!(this instanceof n))return new n}!function(r){function e(t){for(var r in s)t[r]=s[r];return t}function n(t,r){return a(this,t).push(r),this}function o(t,r){function e(){i.call(n,t,e),r.apply(this,arguments)}var n=this;return e.originalListener=r,a(n,t).push(e),n}function i(t,r){function e(t){return t!==r&&t.originalListener!==r}var n,o=this;if(arguments.length){if(r){if(n=a(o,t,!0)){if(n=n.filter(e),!n.length)return i.call(o,t);o[u][t]=n}}else if(n=o[u],n&&(delete n[t],!Object.keys(n).length))return i.call(o)}else delete o[u];return o}function f(t,r){function e(t){t.call(i)}function n(t){t.call(i,r)}function o(t){t.apply(i,s)}var i=this,f=a(i,t,!0);if(!f)return!1;var u=arguments.length;if(1===u)f.forEach(e);else if(2===u)f.forEach(n);else{var s=Array.prototype.slice.call(arguments,1);f.forEach(o)}return!!f.length}function a(t,r,e){if(!e||t[u]){var n=t[u]||(t[u]={});return n[r]||(n[r]=[])}}t.exports=r;var u="listeners",s={on:n,once:o,off:i,emit:f};e(r.prototype),r.mixin=e}(n)},function(t,r,e){function n(t){return this instanceof n?void i.call(this,t):new n(t)}r.Decoder=n;var o=e(32),i=e(26).DecodeBuffer;n.prototype=new i,o.mixin(n.prototype),n.prototype.decode=function(t){arguments.length&&this.write(t),this.flush()},n.prototype.push=function(t){this.emit("data",t)},n.prototype.end=function(t){this.decode(t),this.emit("end")}},function(t,r,e){e(27),e(4),r.createCodec=e(23).createCodec},function(t,r,e){e(27),e(4),r.codec={preset:e(23).preset}},function(t,r){function e(t){this.value=t}function n(t,r,e){var n=[],i=[],f=!0;return function t(a){function u(){if("object"==typeof l.node&&null!==l.node){l.keys&&l.node_===l.node||(l.keys=p(l.node)),l.isLeaf=0==l.keys.length;for(var t=0;t<i.length;t++)if(i[t].node_===a){l.circular=i[t];break}}else l.isLeaf=!0,l.keys=null;l.notLeaf=!l.isLeaf,l.notRoot=!l.isRoot}var s=e?o(a):a,c={},h=!0,l={node:s,node_:a,path:[].concat(n),parent:i[i.length-1],parents:i,key:n.slice(-1)[0],isRoot:0===n.length,level:n.length,circular:null,update:function(t,r){l.isRoot||(l.parent.node[l.key]=t),l.node=t,r&&(h=!1)},delete:function(t){delete l.parent.node[l.key],t&&(h=!1)},remove:function(t){d(l.parent.node)?l.parent.node.splice(l.key,1):delete l.parent.node[l.key],t&&(h=!1)},keys:null,before:function(t){c.before=t},after:function(t){c.after=t},pre:function(t){c.pre=t},post:function(t){c.post=t},stop:function(){f=!1},block:function(){h=!1}};if(!f)return l;u();var g=r.call(l,l.node);return void 0!==g&&l.update&&l.update(g),c.before&&c.before.call(l,l.node),h?("object"!=typeof l.node||null===l.node||l.circular||(i.push(l),u(),y(l.keys,function(r,o){n.push(r),c.pre&&c.pre.call(l,l.node[r],r);var i=t(l.node[r]);e&&v.call(l.node,r)&&(l.node[r]=i.node),i.isLast=o==l.keys.length-1,i.isFirst=0==o,c.post&&c.post.call(l,i),n.pop()}),i.pop()),c.after&&c.after.call(l,l.node),l):l}(t).node}function o(t){if("object"==typeof t&&null!==t){var r;if(d(t))r=[];else if(f(t))r=new Date(t.getTime?t.getTime():t);else if(a(t))r=new RegExp(t);else if(u(t))r={message:t.message};else if(s(t))r=new Boolean(t);else if(c(t))r=new Number(t);else if(h(t))r=new String(t);else if(Object.create&&Object.getPrototypeOf)r=Object.create(Object.getPrototypeOf(t));else if(t.constructor===Object)r={};else{var e=t.constructor&&t.constructor.prototype||t.__proto__||{},n=function(){};n.prototype=e,r=new n}return y(p(t),function(e){r[e]=t[e]}),r}return t}function i(t){return Object.prototype.toString.call(t)}function f(t){return"[object Date]"===i(t)}function a(t){return"[object RegExp]"===i(t)}function u(t){return"[object Error]"===i(t)}function s(t){return"[object Boolean]"===i(t)}function c(t){return"[object Number]"===i(t)}function h(t){return"[object String]"===i(t)}var l=t.exports=function(t){return new e(t)};e.prototype.get=function(t){for(var r=this.value,e=0;e<t.length;e++){var n=t[e];if(!r||!v.call(r,n)){r=void 0;break}r=r[n]}return r},e.prototype.has=function(t){for(var r=this.value,e=0;e<t.length;e++){var n=t[e];if(!r||!v.call(r,n))return!1;r=r[n]}return!0},e.prototype.set=function(t,r){for(var e=this.value,n=0;n<t.length-1;n++){var o=t[n];v.call(e,o)||(e[o]={}),e=e[o]}return e[t[n]]=r,r},e.prototype.map=function(t){return n(this.value,t,!0)},e.prototype.forEach=function(t){return this.value=n(this.value,t,!1),this.value},e.prototype.reduce=function(t,r){var e=1===arguments.length,n=e?this.value:r;return this.forEach(function(r){this.isRoot&&e||(n=t.call(this,n,r))}),n},e.prototype.paths=function(){var t=[];return this.forEach(function(r){t.push(this.path)}),t},e.prototype.nodes=function(){var t=[];return this.forEach(function(r){t.push(this.node)}),t},e.prototype.clone=function(){var t=[],r=[];return function e(n){for(var i=0;i<t.length;i++)if(t[i]===n)return r[i];if("object"==typeof n&&null!==n){var f=o(n);return t.push(n),r.push(f),y(p(n),function(t){f[t]=e(n[t])}),t.pop(),r.pop(),f}return n}(this.value)};var p=Object.keys||function(t){var r=[];for(var e in t)r.push(e);return r},d=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},y=function(t,r){if(t.forEach)return t.forEach(r);for(var e=0;e<t.length;e++)r(t[e],e,t)};y(p(e.prototype),function(t){l[t]=function(r){var n=[].slice.call(arguments,1),o=new e(r);return o[t].apply(o,n)}});var v=Object.hasOwnProperty||function(t,r){return r in t}}]);