Comparing version 0.16.0 to 0.16.1
@@ -1,1 +0,1 @@ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e():"function"==typeof define&&define.amd?define(e):e()}(0,function(){"use strict";function t(e){return(t="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})(e)}function e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function n(t,e){for(var n=0;e.length>n;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function r(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&i(t,e)}function a(t){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function i(t,e){return(i=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function s(t,e){return!e||"object"!=typeof e&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}var c={get type(){return"None"},get present(){return!1},map:function(){return this},ifPresent:function(){},flatMap:function(){return this},getOrElse:function(t){return t instanceof Function?t():t},equals:function(t){return t===this},toString:function(){return"None"}},u=function(){function t(n){e(this,t),this.value=n}return r(t,[{key:"map",value:function(e){return new t(e(this.value))}},{key:"ifPresent",value:function(t){t(this.value)}},{key:"flatMap",value:function(t){return t(this.value)}},{key:"getOrElse",value:function(){return this.value}},{key:"equals",value:function(e){return e instanceof t&&e.value===this.value}},{key:"toString",value:function(){return"Some(".concat(this.value,")")}},{key:"type",get:function(){return"Some"}},{key:"present",get:function(){return!0}}]),t}();function h(t){return t instanceof u||c.equals(t)}var p,l={Some:u,None:c,isOptional:h,verifyIsOptional:function(t){if(null==t)throw Error("Error: data is not Optional - it's null");if(!h(t))throw Error("Error: data (".concat(t,") is not an Option!"));if(h(t.value))throw Error("Error: data (".concat(t.value,") is wrapped in Option twice"))},verifyIsNotOptional:function(t){if(h(t))throw Error("Error: data (".concat(t,") is an Option!"))},fromNullable:function(t){return null==t?c:new u(t)}};function d(){return"/tmp"}var f={EOL:"\n",tmpdir:d,tmpDir:d,networkInterfaces:function(){},getNetworkInterfaces:function(){},release:function(){return void 0!==global.navigator?global.navigator.appVersion:""},type:function(){return"Browser"},cpus:function(){return[]},totalmem:function(){return Number.MAX_VALUE},freemem:function(){return Number.MAX_VALUE},uptime:function(){return 0},loadavg:function(){return[]},hostname:function(){return void 0!==global.location?global.location.hostname:""},endianness:function(){if(void 0===p){var t=new ArrayBuffer(2),e=new Uint8Array(t),n=new Uint16Array(t);if(e[0]=1,e[1]=2,258===n[0])p="BE";else{if(513!==n[0])throw Error("unable to figure out endianess");p="LE"}}return p}};function m(t,e){for(var n in t)for(var r=t[n].length-1;r>=0;r--){var o=t[n][r];if(!o.internal&&o.family===e&&("IPv4"===e||0===o.scopeid))return o.address}return"IPv4"===e?"127.0.0.1":"::1"}function v(t,e){var n={};for(var r in t)r===e&&(n[r]=t[r]);return n}function y(t){var e=f.networkInterfaces();return t&&(e=v(e,t)),m(e,"IPv4")}y.ipv4=y,y.ipv6=function(t){var e=f.networkInterfaces();return t&&(e=v(e,t)),m(e,"IPv6")};var g=y,I=function(){function t(n){e(this,t),this.addr=n}return r(t,[{key:"ipv4",value:function(){var t=this.toInt();if(t&&0!==t)return this.addr}},{key:"toInt",value:function(){var t=this.addr.split(".");return t[0]<<24|t[1]<<16|t[2]<<8|t[3]}},{key:"toString",value:function(){return"InetAddress(".concat(this.addr,")")}}]),t}();I.getLocalAddress=function(){return"object"===("undefined"==typeof process?"undefined":t(process))&&"function"==typeof process.on?new I(g.ipv4()):new I("127.0.0.1")};var S=I,w=function(){function t(){e(this,t)}return r(t,[{key:"toString",value:function(){return"".concat(this.annotationType,"()")}}]),t}(),b=function(t){function n(){return e(this,n),s(this,a(n).apply(this,arguments))}return o(n,w),n}(),k=function(t){function n(){return e(this,n),s(this,a(n).apply(this,arguments))}return o(n,w),n}(),E=function(t){function n(){return e(this,n),s(this,a(n).apply(this,arguments))}return o(n,w),n}(),O=function(t){function n(){return e(this,n),s(this,a(n).apply(this,arguments))}return o(n,w),n}(),N=function(t){function n(){return e(this,n),s(this,a(n).apply(this,arguments))}return o(n,w),n}(),A=function(t){function n(){return e(this,n),s(this,a(n).apply(this,arguments))}return o(n,w),n}(),C=function(t){function n(){return e(this,n),s(this,a(n).apply(this,arguments))}return o(n,w),n}(),R=function(t){function n(){return e(this,n),s(this,a(n).apply(this,arguments))}return o(n,w),n}();function _(t){this.name=t}_.prototype.toString=function(){return'LocalOperationStart("'.concat(this.name,'")')};var x=function(t){function n(){return e(this,n),s(this,a(n).apply(this,arguments))}return o(n,w),n}();function T(t){this.message=t}function j(t){this.serviceName=t}function L(t){this.name=t}function P(t){var e=t.port;this.host=t.host,this.port=e}function q(t){var e=t.host,n=t.port;this.serviceName=t.serviceName,this.host=e||void 0,this.port=n||0}function B(t){var e=t.port;this.host=t.host||S.getLocalAddress(),this.port=e||0}function M(t){var e=t.host,n=t.port;this.serviceName=t.serviceName,this.host=e,this.port=n}function U(t,e){this.key=t,this.value=e}T.prototype.toString=function(){return'Message("'.concat(this.message,'")')},j.prototype.toString=function(){return'ServiceName("'.concat(this.serviceName,'")')},L.prototype.toString=function(){return'Rpc("'.concat(this.name,'")')},P.prototype.toString=function(){return'ClientAddr(host="'.concat(this.host,'", port=').concat(this.port,")")},q.prototype.toString=function(){return'ServerAddr(serviceName="'.concat(this.serviceName,'", host="').concat(this.host,'", port=').concat(this.port,")")},B.prototype.toString=function(){return'LocalAddr(host="'.concat(""+this.host,'", port=').concat(this.port,")")},M.prototype.toString=function(){return'MessageAddr(serviceName="'.concat(this.serviceName,'", host="').concat(this.host,'", port=').concat(this.port,")")},U.prototype.toString=function(){return"BinaryAnnotation(".concat(this.key,'="').concat(this.value,'")')};var F={ClientSend:b,ClientRecv:k,ServerSend:E,ServerRecv:O,ProducerStart:N,ProducerStop:A,ConsumerStart:C,ConsumerStop:R,MessageAddr:M,Message:T,ServiceName:j,Rpc:L,ClientAddr:P,ServerAddr:q,LocalAddr:B,BinaryAnnotation:U,LocalOperationStart:_,LocalOperationStop:x};Object.keys(F).forEach(function(t){F[t].prototype.annotationType=t});var D=F,K=l.Some,H=function(){function t(n){e(this,t),this.evaluator=n}return r(t,[{key:"shouldSample",value:function(t){var e=this,n=t.sampled.getOrElse(function(){return e.evaluator(t)});return new K(n)}},{key:"toString",value:function(){return"Sampler(".concat(""+this.evaluator,")")}}]),t}();function J(t){return!1}function V(t){return!0}J.toString=function(){return"never sample"},V.toString=function(){return"always sample"};var X={Sampler:H,CountingSampler:function(t){function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return e(this,n),s(this,a(n).call(this,function(t){if(t>0){if(1>t){var e=0,n=parseInt(1/t),r=function(t){var r=0==(e%=n);return e++,r};return r.toString=function(){return"countingSampler: sampleRate=".concat(t)},r}return V}return J}(1>t?t:1)))}return o(n,H),n}(),neverSample:J,alwaysSample:V},Z=function(){function t(n){var r=n.traceId,o=n.timestamp,a=n.annotation;e(this,t),this.traceId=r,this.timestamp=o,this.annotation=a}return r(t,[{key:"toString",value:function(){return"Record(traceId=".concat(""+this.traceId,", annotation=").concat(""+this.annotation,")")}}]),t}(),$=l.Some,z=l.None,G=l.verifyIsOptional,Q=l.verifyIsNotOptional,W=function(){function t(n){e(this,t);var r=n.traceId,o=void 0===r?z:r,a=n.parentId,i=void 0===a?z:a,s=n.spanId,c=n.sampled,u=void 0===c?z:c,h=n.flags,p=void 0===h?0:h;G(o),G(i),Q(s),G(u),this._traceId=o,this._parentId=i,this._spanId=s,this._sampled=u,this._flags=p}return r(t,[{key:"isDebug",value:function(){return 1==(1&this._flags)}},{key:"toString",value:function(){return"TraceId(spanId=".concat(""+this.spanId)+", parentId=".concat(""+this.parentId)+", traceId=".concat(""+this.traceId,")")}},{key:"spanId",get:function(){return this._spanId}},{key:"parentId",get:function(){return this._parentId.getOrElse(this.spanId)}},{key:"traceId",get:function(){return this._traceId.getOrElse(this.parentId)}},{key:"sampled",get:function(){return this.isDebug()?new $(!0):this._sampled}},{key:"flags",get:function(){return this._flags}}]),t}();var Y=function(){for(var t="",e=0;16>e;e++)t+="0123456789abcdef"[Math.floor(16*Math.random())];return t},tt="undefined"!=typeof process&&process.hrtime;var et={now:tt?function(t,e){if(t&&e){var n=process.hrtime(e);return t+Math.floor(1e6*n[0]+n[1]/1e3)}return 1e3*Date.now()}:function(){return 1e3*Date.now()},hrtime:tt?function(){return process.hrtime()}:function(){}};function nt(t){var e=t.ipv4,n=t.port;this.setServiceName(t.serviceName),this.setIpv4(e),this.setPort(n)}function rt(t,e){this.timestamp=t,this.value=""+e}function ot(t){var e=this;this.traceId=t.traceId,t._parentId.ifPresent(function(t){e.parentId=t}),this.id=t.spanId,this.name=void 0,this.kind=void 0,this.timestamp=void 0,this.duration=void 0,this.localEndpoint=void 0,this.remoteEndpoint=void 0,this.annotations=[],this.tags={},this.debug=t.isDebug(),this.shared=!1}nt.prototype.setServiceName=function(t){this.serviceName=t?t.toLocaleLowerCase():void 0},nt.prototype.setIpv4=function(t){this.ipv4=t},nt.prototype.setPort=function(t){this.port=t||void 0},nt.prototype.isEmpty=function(){return void 0===this.serviceName&&void 0===this.ipv4&&void 0===this.port},rt.prototype.toString=function(){return'Annotation(value="'.concat(this.value,'")')},ot.prototype.setName=function(t){this.name=t?t.toLocaleLowerCase():void 0},ot.prototype.setKind=function(t){this.kind=t},ot.prototype.setTimestamp=function(t){this.timestamp=t},ot.prototype.setDuration=function(t){void 0!==t&&(this.duration=Math.max(t,1))},ot.prototype.setLocalEndpoint=function(t){this.localEndpoint=t&&!t.isEmpty()?t:void 0},ot.prototype.setRemoteEndpoint=function(t){this.remoteEndpoint=t&&!t.isEmpty()?t:void 0},ot.prototype.addAnnotation=function(t,e){this.annotations.push(new rt(t,e))},ot.prototype.putTag=function(t,e){this.tags[t]=""+e},ot.prototype.setDebug=function(t){this.debug=t},ot.prototype.setShared=function(t){this.shared=t},ot.prototype.toString=function(){var t=this.annotations.map(function(t){return""+t}).join(", ");return"Span(id=".concat(this.traceId,", annotations=[").concat(t,"])")};var at={Endpoint:nt,Span:ot},it=function(t){return!!t&&("object"==typeof t||"function"==typeof t)&&"function"==typeof t.then};var st=l.None,ct=l.Some,ut=l.fromNullable,ht=X.Sampler,pt=X.alwaysSample,lt=et.now,dt=et.hrtime,ft=at.Endpoint;function mt(t){throw Error("Tracer: Missing required argument ".concat(t,"."))}var vt=function(){function t(n){var r=n.ctxImpl,o=void 0===r?mt("ctxImpl"):r,a=n.recorder,i=void 0===a?mt("recorder"):a,s=n.sampler,c=void 0===s?new ht(pt):s,u=n.traceId128Bit,h=void 0!==u&&u,p=n.supportsJoin,l=void 0===p||p,d=n.localServiceName,f=n.localEndpoint,m=n.log,v=void 0===m?console:m,y=n.defaultTags;e(this,t),this.log=v,this.recorder=i,this.sampler=c,this.traceId128Bit=h,this.supportsJoin=l,this._localEndpoint=f||new ft({serviceName:d||"unknown"}),this._ctxImpl=o,this._defaultTraceId=this.createRootId(),this._startTimestamp=lt(),this._startTick=dt(),y&&this.setTags(y)}return r(t,[{key:"scoped",value:function(t){return this._ctxImpl.scoped(t)}},{key:"letId",value:function(t,e){return this._ctxImpl.letContext(t,e)}},{key:"createRootId",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:st,e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=Y(),r=this.traceId128Bit?new ct(Y()+n):st,o=new W({traceId:r,parentId:st,spanId:n,sampled:t,flags:e?1:0});return t===st&&(o._sampled=this.sampler.shouldSample(o)),o}},{key:"createChildId",value:function(){var t=ut(this._ctxImpl.getContext()),e=new W({traceId:t.map(function(t){return t.traceId}),parentId:t.map(function(t){return t.spanId}),spanId:Y(),sampled:t.flatMap(function(t){return t.sampled}),flags:t.map(function(t){return t.flags}).getOrElse(0)});return!1===e.sampled.present&&(e._sampled=this.sampler.shouldSample(e)),e}},{key:"local",value:function(t,e){var n=this;if("function"!=typeof e)throw Error("you must pass a function");return this.scoped(function(){var r,o=n.createChildId();n.setId(o),n.recordServiceName(n._localEndpoint.serviceName),n.recordAnnotation(new D.LocalOperationStart(t));try{r=e()}catch(t){throw n.recordBinary("error",t.message?t.message:""+t),n.recordAnnotation(new D.LocalOperationStop),t}if(!it(r))return n.recordAnnotation(new D.LocalOperationStop),r;if(!o.sampled.getOrElse(!1))return r;var a=function(t){return n.recorder.record(new Z({traceId:o,timestamp:lt(n._startTimestamp,n._startTick),annotation:t}))};return r.then(function(t){return a(new D.LocalOperationStop),t}).catch(function(t){throw a(new D.BinaryAnnotation("error",t.message?t.message:""+t)),a(new D.LocalOperationStop),t})})}},{key:"setId",value:function(t){this._ctxImpl.setContext(t)}},{key:"recordAnnotation",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:lt(this._startTimestamp,this._startTick);this.id.sampled.ifPresent(function(r){r&&e.recorder.record(new Z({traceId:e.id,timestamp:n,annotation:t}))})}},{key:"recordMessage",value:function(t){this.recordAnnotation(new D.Message(t))}},{key:"recordServiceName",value:function(t){this.recordAnnotation(new D.ServiceName(t))}},{key:"recordRpc",value:function(t){this.recordAnnotation(new D.Rpc(t))}},{key:"recordClientAddr",value:function(t){this.recordAnnotation(new D.ClientAddr(t))}},{key:"recordServerAddr",value:function(t){this.recordAnnotation(new D.ServerAddr(t))}},{key:"recordLocalAddr",value:function(t){this.recordAnnotation(new D.LocalAddr(t))}},{key:"recordBinary",value:function(t,e){this.recordAnnotation(new D.BinaryAnnotation(t,e))}},{key:"writeIdToConsole",value:function(t){this.log.info("".concat(t,": ").concat(""+this.id))}},{key:"setTags",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};for(var e in t)t.hasOwnProperty(e)&&this.recordBinary(e,t[e])}},{key:"id",get:function(){return this._ctxImpl.getContext()||this._defaultTraceId}},{key:"localEndpoint",get:function(){return this._localEndpoint}}]),t}(),yt=function(){function t(){e(this,t),this.currentCtx=null}return r(t,[{key:"setContext",value:function(t){this.currentCtx=t}},{key:"getContext",value:function(){return this.currentCtx}},{key:"scoped",value:function(t){var e=this.currentCtx,n=t();return this.currentCtx=e,n}},{key:"letContext",value:function(t,e){var n=this;return this.scoped(function(){return n.setContext(t),e()})}}]),t}(),gt={TraceId:"X-B3-TraceId",SpanId:"X-B3-SpanId",ParentSpanId:"X-B3-ParentSpanId",Sampled:"X-B3-Sampled",Flags:"X-B3-Flags"},It=et.now,St=et.hrtime,wt=at.Span,bt=at.Endpoint;function kt(t){this.traceId=t,this.startTimestamp=It(),this.startTick=St(),this.delegate=new wt(t),this.localEndpoint=new bt({})}kt.prototype.finish=function(){this.endTimestamp||(this.endTimestamp=It(this.startTimestamp,this.startTick))};var Et=function(){function t(n){var r=this,o=n.logger,a=n.timeout,i=void 0===a?6e7:a;e(this,t),this.logger=o,this.timeout=i,this.partialSpans=new Map;var s=setInterval(function(){r.partialSpans.forEach(function(t,e){r._timedOut(t)&&r._writeSpan(e)})},1e3);s.unref&&s.unref()}return r(t,[{key:"_writeSpan",value:function(t){var e=this.partialSpans.get(t);if(void 0!==e){this.partialSpans.delete(t);var n=e.delegate;n.setLocalEndpoint(e.localEndpoint),e.endTimestamp&&(n.setTimestamp(e.startTimestamp),n.setDuration(e.endTimestamp-e.startTimestamp)),this.logger.logSpan(n)}}},{key:"_updateSpanMap",value:function(t,e){var n;e(n=this.partialSpans.has(t)?this.partialSpans.get(t):new kt(t)),n.endTimestamp?this._writeSpan(t):this.partialSpans.set(t,n)}},{key:"_timedOut",value:function(t){return t.startTimestamp+this.timeout<It()}},{key:"record",value:function(t){var e=t.traceId;this._updateSpanMap(e,function(n){switch(t.annotation.annotationType){case"ClientSend":n.delegate.setKind("CLIENT");break;case"ClientRecv":n.finish(),n.delegate.setKind("CLIENT");break;case"ServerSend":n.finish(),n.delegate.setKind("SERVER");break;case"ServerRecv":n.delegate.setShared(e.parentId!==e.spanId),n.delegate.setKind("CLIENT");break;case"ProducerStart":n.delegate.setKind("PRODUCER");break;case"ProducerStop":n.finish(),n.delegate.setKind("PRODUCER");break;case"ConsumerStart":n.delegate.setKind("CONSUMER");break;case"ConsumerStop":n.finish(),n.delegate.setKind("CONSUMER");break;case"MessageAddr":n.delegate.setRemoteEndpoint(new bt({serviceName:t.annotation.serviceName,ipv4:t.annotation.host&&t.annotation.host.ipv4(),port:t.annotation.port}));break;case"LocalOperationStart":n.delegate.setName(t.annotation.name);break;case"LocalOperationStop":n.finish();break;case"Message":n.delegate.addAnnotation(t.timestamp,t.annotation.message);break;case"Rpc":n.delegate.setName(t.annotation.name);break;case"ServiceName":n.localEndpoint.setServiceName(t.annotation.serviceName);break;case"BinaryAnnotation":n.delegate.putTag(t.annotation.key,t.annotation.value);break;case"LocalAddr":n.localEndpoint.setIpv4(t.annotation.host&&t.annotation.host.ipv4()),n.localEndpoint.setPort(t.annotation.port);break;case"ServerAddr":n.delegate.setKind("CLIENT"),n.delegate.setRemoteEndpoint(new bt({serviceName:t.annotation.serviceName,ipv4:t.annotation.host&&t.annotation.host.ipv4(),port:t.annotation.port}))}})}},{key:"toString",value:function(){return"BatchRecorder()"}}]),t}(),Ot=function(){function t(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:console.log;e(this,t),this.logger=n}return r(t,[{key:"record",value:function(t){var e=t.traceId;this.logger("Record at (spanId=".concat(e.spanId,", parentId=").concat(e.parentId,",")+" traceId=".concat(e.traceId,"): ").concat(""+t.annotation))}},{key:"toString",value:function(){return"consoleTracer"}}]),t}(),Nt=2147483647,At=36,Ct=1,Rt=26,_t=38,xt=700,Tt=72,jt=128,Lt="-",Pt=/[^\x20-\x7E]/,qt=/[\x2E\u3002\uFF0E\uFF61]/g,Bt={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Mt=At-Ct,Ut=Math.floor,Ft=String.fromCharCode;function Dt(t){throw new RangeError(Bt[t])}function Kt(t,e){return t+22+75*(26>t)-((0!=e)<<5)}function Ht(t,e,n){var r=0;for(t=n?Ut(t/xt):t>>1,t+=Ut(t/e);t>Mt*Rt>>1;r+=At)t=Ut(t/Mt);return Ut(r+(Mt+1)*t/(t+_t))}function Jt(t){return function(t,e){var n=t.split("@"),r="";n.length>1&&(r=n[0]+"@",t=n[1]);var o=function(t,e){for(var n=t.length,r=[];n--;)r[n]=e(t[n]);return r}((t=t.replace(qt,".")).split("."),e).join(".");return r+o}(t,function(t){return Pt.test(t)?"xn--"+function(t){var e,n,r,o,a,i,s,c,u,h,p,l,d,f,m,v=[];for(l=(t=function(t){for(var e,n,r=[],o=0,a=t.length;a>o;)55296>(e=t.charCodeAt(o++))||e>56319||o>=a?r.push(e):56320==(64512&(n=t.charCodeAt(o++)))?r.push(((1023&e)<<10)+(1023&n)+65536):(r.push(e),o--);return r}(t)).length,e=jt,n=0,a=Tt,i=0;l>i;++i)128>(p=t[i])&&v.push(Ft(p));for(r=o=v.length,o&&v.push(Lt);l>r;){for(s=Nt,i=0;l>i;++i)(p=t[i])>=e&&s>p&&(s=p);for(s-e>Ut((Nt-n)/(d=r+1))&&Dt("overflow"),n+=(s-e)*d,e=s,i=0;l>i;++i)if(e>(p=t[i])&&++n>Nt&&Dt("overflow"),p==e){for(c=n,u=At;(h=u>a?a+Rt>u?u-a:Rt:Ct)<=c;u+=At)v.push(Ft(Kt(h+(m=c-h)%(f=At-h),0))),c=Ut(m/f);v.push(Ft(Kt(c,0))),a=Ht(n,d,r==o),n=0,++r}++n,++e}return v.join("")}(t):t})}global,global;global;function Vt(t){return null===t}function Xt(t){return"string"==typeof t}function Zt(t){return"object"==typeof t&&null!==t}function $t(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var zt=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function Gt(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}}function Qt(t,e){if(t.map)return t.map(e);for(var n=[],r=0;t.length>r;r++)n.push(e(t[r],r));return n}var Wt=Object.keys||function(t){var e=[];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.push(n);return e};function Yt(t,e,n,r){n=n||"=";var o={};if("string"!=typeof t||0===t.length)return o;var a=/\+/g;t=t.split(e=e||"&");var i=1e3;r&&"number"==typeof r.maxKeys&&(i=r.maxKeys);var s=t.length;i>0&&s>i&&(s=i);for(var c=0;s>c;++c){var u,h,p,l,d=t[c].replace(a,"%20"),f=d.indexOf(n);0>f?(u=d,h=""):(u=d.substr(0,f),h=d.substr(f+1)),p=decodeURIComponent(u),l=decodeURIComponent(h),$t(o,p)?zt(o[p])?o[p].push(l):o[p]=[o[p],l]:o[p]=l}return o}var te={parse:me,resolve:function(t,e){return me(t,!1,!0).resolve(e)},resolveObject:function(t,e){return t?me(t,!1,!0).resolveObject(e):e},format:function(t){Xt(t)&&(t=ve({},t));return ye(t)},Url:ee};function ee(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var ne=/^([a-z0-9.+-]+:)/i,re=/:[0-9]*$/,oe=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,ae=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),ie=["'"].concat(ae),se=["%","/","?",";","#"].concat(ie),ce=["/","?","#"],ue=255,he=/^[+a-z0-9A-Z_-]{0,63}$/,pe=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,le={javascript:!0,"javascript:":!0},de={javascript:!0,"javascript:":!0},fe={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function me(t,e,n){if(t&&Zt(t)&&t instanceof ee)return t;var r=new ee;return r.parse(t,e,n),r}function ve(t,e,n,r){if(!Xt(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var o=e.indexOf("?"),a=-1!==o&&o<e.indexOf("#")?"?":"#",i=e.split(a);i[0]=i[0].replace(/\\/g,"/");var s=e=i.join(a);if(s=s.trim(),!r&&1===e.split("#").length){var c=oe.exec(s);if(c)return t.path=s,t.href=s,t.pathname=c[1],c[2]?(t.search=c[2],t.query=n?Yt(t.search.substr(1)):t.search.substr(1)):n&&(t.search="",t.query={}),t}var u,h,p,l=ne.exec(s);if(l){var d=(l=l[0]).toLowerCase();t.protocol=d,s=s.substr(l.length)}if(r||l||s.match(/^\/\/[^@\/]+@[^@\/]+/)){var f="//"===s.substr(0,2);!f||l&&de[l]||(s=s.substr(2),t.slashes=!0)}if(!de[l]&&(f||l&&!fe[l])){var m,v,y=-1;for(u=0;ce.length>u;u++)-1===(h=s.indexOf(ce[u]))||-1!==y&&h>=y||(y=h);for(-1!==(v=-1===y?s.lastIndexOf("@"):s.lastIndexOf("@",y))&&(m=s.slice(0,v),s=s.slice(v+1),t.auth=decodeURIComponent(m)),y=-1,u=0;se.length>u;u++)-1===(h=s.indexOf(se[u]))||-1!==y&&h>=y||(y=h);-1===y&&(y=s.length),t.host=s.slice(0,y),s=s.slice(y),ge(t),t.hostname=t.hostname||"";var g="["===t.hostname[0]&&"]"===t.hostname[t.hostname.length-1];if(!g){var I=t.hostname.split(/\./);for(u=0,p=I.length;p>u;u++){var S=I[u];if(S&&!S.match(he)){for(var w="",b=0,k=S.length;k>b;b++)S.charCodeAt(b)>127?w+="x":w+=S[b];if(!w.match(he)){var E=I.slice(0,u),O=I.slice(u+1),N=S.match(pe);N&&(E.push(N[1]),O.unshift(N[2])),O.length&&(s="/"+O.join(".")+s),t.hostname=E.join(".");break}}}}t.hostname=t.hostname.length>ue?"":t.hostname.toLowerCase(),g||(t.hostname=Jt(t.hostname)),t.host=(t.hostname||"")+(t.port?":"+t.port:""),t.href+=t.host,g&&(t.hostname=t.hostname.substr(1,t.hostname.length-2),"/"!==s[0]&&(s="/"+s))}if(!le[d])for(u=0,p=ie.length;p>u;u++){var A=ie[u];if(-1!==s.indexOf(A)){var C=encodeURIComponent(A);C===A&&(C=escape(A)),s=s.split(A).join(C)}}var R=s.indexOf("#");-1!==R&&(t.hash=s.substr(R),s=s.slice(0,R));var _=s.indexOf("?");(-1!==_?(t.search=s.substr(_),t.query=s.substr(_+1),n&&(t.query=Yt(t.query)),s=s.slice(0,_)):n&&(t.search="",t.query={}),s&&(t.pathname=s),fe[d]&&t.hostname&&!t.pathname&&(t.pathname="/"),t.pathname||t.search)&&(t.path=(t.pathname||"")+(t.search||""));return t.href=ye(t),t}function ye(t){var e=t.auth||"";e&&(e=(e=encodeURIComponent(e)).replace(/%3A/i,":"),e+="@");var n,r,o,a,i=t.protocol||"",s=t.pathname||"",c=t.hash||"",u=!1,h="";t.host?u=e+t.host:t.hostname&&(u=e+(-1===t.hostname.indexOf(":")?t.hostname:"["+this.hostname+"]"),t.port&&(u+=":"+t.port)),t.query&&Zt(t.query)&&Object.keys(t.query).length&&(r=r||"&",o=o||"=",null===(n=t.query)&&(n=void 0),h="object"==typeof n?Qt(Wt(n),function(t){var e=encodeURIComponent(Gt(t))+o;return zt(n[t])?Qt(n[t],function(t){return e+encodeURIComponent(Gt(t))}).join(r):e+encodeURIComponent(Gt(n[t]))}).join(r):a?encodeURIComponent(Gt(a))+o+encodeURIComponent(Gt(n)):"");var p=t.search||h&&"?"+h||"";return i&&":"!==i.substr(-1)&&(i+=":"),t.slashes||(!i||fe[i])&&!1!==u?(u="//"+(u||""),s&&"/"!==s.charAt(0)&&(s="/"+s)):u||(u=""),c&&"#"!==c.charAt(0)&&(c="#"+c),p&&"?"!==p.charAt(0)&&(p="?"+p),i+u+(s=s.replace(/[?#]/g,function(t){return encodeURIComponent(t)}))+(p=p.replace("#","%23"))+c}function ge(t){var e=t.host,n=re.exec(e);n&&(":"!==(n=n[0])&&(t.port=n.substr(1)),e=e.substr(0,e.length-n.length)),e&&(t.hostname=e)}ee.prototype.parse=function(t,e,n){return ve(this,t,e,n)},ee.prototype.format=function(){return ye(this)},ee.prototype.resolve=function(t){return this.resolveObject(me(t,!1,!0)).format()},ee.prototype.resolveObject=function(t){if(Xt(t)){var e=new ee;e.parse(t,!1,!0),t=e}for(var n,r=new ee,o=Object.keys(this),a=0;o.length>a;a++){var i=o[a];r[i]=this[i]}if(r.hash=t.hash,""===t.href)return r.href=r.format(),r;if(t.slashes&&!t.protocol){for(var s=Object.keys(t),c=0;s.length>c;c++){var u=s[c];"protocol"!==u&&(r[u]=t[u])}return fe[r.protocol]&&r.hostname&&!r.pathname&&(r.path=r.pathname="/"),r.href=r.format(),r}if(t.protocol&&t.protocol!==r.protocol){if(!fe[t.protocol]){for(var h=Object.keys(t),p=0;h.length>p;p++){var l=h[p];r[l]=t[l]}return r.href=r.format(),r}if(r.protocol=t.protocol,t.host||de[t.protocol])r.pathname=t.pathname;else{for(n=(t.pathname||"").split("/");n.length&&!(t.host=n.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),""!==n[0]&&n.unshift(""),2>n.length&&n.unshift(""),r.pathname=n.join("/")}if(r.search=t.search,r.query=t.query,r.host=t.host||"",r.auth=t.auth,r.hostname=t.hostname||t.host,r.port=t.port,r.pathname||r.search)r.path=(r.pathname||"")+(r.search||"");return r.slashes=r.slashes||t.slashes,r.href=r.format(),r}var d,f=r.pathname&&"/"===r.pathname.charAt(0),m=t.host||t.pathname&&"/"===t.pathname.charAt(0),v=m||f||r.host&&t.pathname,y=v,g=r.pathname&&r.pathname.split("/")||[],I=r.protocol&&!fe[r.protocol];if(n=t.pathname&&t.pathname.split("/")||[],I&&(r.hostname="",r.port=null,r.host&&(""===g[0]?g[0]=r.host:g.unshift(r.host)),r.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(""===n[0]?n[0]=t.host:n.unshift(t.host)),t.host=null),v=v&&(""===n[0]||""===g[0])),m)r.host=t.host||""===t.host?t.host:r.host,r.hostname=t.hostname||""===t.hostname?t.hostname:r.hostname,r.search=t.search,r.query=t.query,g=n;else if(n.length)g||(g=[]),g.pop(),g=g.concat(n),r.search=t.search,r.query=t.query;else if(null!=t.search)return I&&(r.hostname=r.host=g.shift(),(d=!(!r.host||0>=r.host.indexOf("@"))&&r.host.split("@"))&&(r.auth=d.shift(),r.host=r.hostname=d.shift())),r.search=t.search,r.query=t.query,Vt(r.pathname)&&Vt(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r;if(!g.length)return r.pathname=null,r.path=r.search?"/"+r.search:null,r.href=r.format(),r;for(var S=g.slice(-1)[0],w=(r.host||t.host||g.length>1)&&("."===S||".."===S)||""===S,b=0,k=g.length;k>=0;k--)"."===(S=g[k])?g.splice(k,1):".."===S?(g.splice(k,1),b++):b&&(g.splice(k,1),b--);if(!v&&!y)for(;b--;b)g.unshift("..");!v||""===g[0]||g[0]&&"/"===g[0].charAt(0)||g.unshift(""),w&&"/"!==g.join("/").substr(-1)&&g.push("");var E=""===g[0]||g[0]&&"/"===g[0].charAt(0);return I&&(r.hostname=r.host=E?"":g.length?g.shift():"",(d=!(!r.host||0>=r.host.indexOf("@"))&&r.host.split("@"))&&(r.auth=d.shift(),r.host=r.hostname=d.shift())),(v=v||r.host&&g.length)&&!E&&g.unshift(""),g.length?r.pathname=g.join("/"):(r.pathname=null,r.path=null),Vt(r.pathname)&&Vt(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},ee.prototype.parseHost=function(){return ge(this)};var Ie=function(t){var e=te.parse(t);return{host:e.hostname,path:e.pathname}},Se=l.Some,we=l.None;function be(t){return"1"===t||"true"===t}function ke(t){try{return new Se(parseInt(t))}catch(t){return we}}function Ee(t){throw Error("HttpServerInstrumentation: Missing required argument ".concat(t,"."))}var Oe=function(){function t(n){var r=n.tracer,o=void 0===r?Ee("tracer"):r,a=n.serviceName,i=void 0===a?o.localEndpoint.serviceName:a,s=n.host,c=n.port,u=void 0===c?Ee("port"):c;e(this,t),this.tracer=o,this.serviceName=i,this.host=s&&new S(s),this.port=u}return r(t,[{key:"_createIdFromHeaders",value:function(t){var e=this;if(function(t){return t(gt.TraceId)!==we&&t(gt.SpanId)!==we}(t)){var n=t(gt.SpanId).map(function(e){var n=t(gt.TraceId),r=t(gt.ParentSpanId),o=t(gt.Sampled),a=t(gt.Flags).flatMap(ke).getOrElse(0);return new W({traceId:n,parentId:r,spanId:e,sampled:o.map(be),flags:a})});return this.tracer.supportsJoin?n:n.map(function(t){return e.tracer.letId(t,function(){return e.tracer.createChildId()})})}if(t(gt.Flags)!==we||t(gt.Sampled)!==we){var r=t(gt.Sampled)===we?we:t(gt.Sampled).map(be),o=t(gt.Flags).flatMap(ke).getOrElse(0);return new Se(this.tracer.createRootId(r,1===o))}return new Se(this.tracer.createRootId())}},{key:"recordRequest",value:function(t,e,n){var r=this;this._createIdFromHeaders(n).ifPresent(function(t){return r.tracer.setId(t)});var o=this.tracer.id,a=Ie(e).path;return this.tracer.recordServiceName(this.serviceName),this.tracer.recordRpc(t.toUpperCase()),this.tracer.recordBinary("http.path",a),this.tracer.recordAnnotation(new D.ServerRecv),this.tracer.recordAnnotation(new D.LocalAddr({host:this.host,port:this.port})),o}},{key:"recordResponse",value:function(t,e,n){this.tracer.setId(t),this.tracer.recordBinary("http.status_code",""+e),n?this.tracer.recordBinary("error",""+n):(200>e||e>399)&&this.tracer.recordBinary("error",""+e),this.tracer.recordAnnotation(new D.ServerSend)}}]),t}();var Ne={addZipkinHeaders:function(t,e){var n=function(t,e){var n=t.headers||{};return n[gt.TraceId]=e.traceId,n[gt.SpanId]=e.spanId,e._parentId.ifPresent(function(t){n[gt.ParentSpanId]=t}),e.sampled.ifPresent(function(t){n[gt.Sampled]=t?"1":"0"}),e.isDebug()&&(n[gt.Flags]="1"),n}(t,e);return Object.assign({},t,{headers:n})}};var Ae=function(){function t(n){var r=n.tracer,o=void 0===r?function(t){throw Error("HttpClientInstrumentation: Missing required argument ".concat(t,"."))}("tracer"):r,a=n.serviceName,i=void 0===a?o.localEndpoint.serviceName:a,s=n.remoteServiceName;e(this,t),this.tracer=o,this.serviceName=i,this.remoteServiceName=s}return r(t,[{key:"recordRequest",value:function(t,e,n){this.tracer.setId(this.tracer.createChildId());var r=this.tracer.id,o=Ie(e).path;return this.tracer.recordServiceName(this.serviceName),this.tracer.recordRpc(n.toUpperCase()),this.tracer.recordBinary("http.path",o),this.tracer.recordAnnotation(new D.ClientSend),this.remoteServiceName&&this.tracer.recordAnnotation(new D.ServerAddr({serviceName:this.remoteServiceName})),Ne.addZipkinHeaders(t,r)}},{key:"recordResponse",value:function(t,e){this.tracer.setId(t),this.tracer.recordBinary("http.status_code",""+e),(200>e||e>399)&&this.tracer.recordBinary("error",""+e),this.tracer.recordAnnotation(new D.ClientRecv)}},{key:"recordError",value:function(t,e){this.tracer.setId(t),this.tracer.recordBinary("error",""+e),this.tracer.recordAnnotation(new D.ClientRecv)}}]),t}();function Ce(t){if(void 0!==t){var e={serviceName:t.serviceName||""};return t.ipv4&&(e.ipv4=t.ipv4),t.port&&(e.port=t.port),e}}module.exports={Tracer:vt,createNoopTracer:function(){var t=new yt;return new vt({recorder:{record:function(){}},ctxImpl:t})},randomTraceId:Y,TraceId:W,option:l,Annotation:D,InetAddress:S,HttpHeaders:gt,BatchRecorder:Et,ConsoleRecorder:Ot,ExplicitContext:yt,sampler:X,Request:Ne,Instrumentation:{HttpServer:Oe,HttpClient:Ae},model:at,jsonEncoder:{JSON_V1:{encode:function(t){return function(t){var e={traceId:t.traceId};t.parentId&&(e.parentId=t.parentId),e.id=t.id,e.name=t.name||"",t.shared||(e.timestamp=t.timestamp,e.duration=t.duration);var n,r,o,a=Ce(t.localEndpoint);switch(t.kind){case"CLIENT":n=t.timestamp?"cs":void 0,r="cr",o="sa";break;case"SERVER":n=t.timestamp?"sr":void 0,r="ss",o="ca";break;case"PRODUCER":n=t.timestamp?"ms":void 0,r="ws",o="ma";break;case"CONSUMER":t.timestamp&&t.duration?(n="wr",r="mr"):t.timestamp&&(n="mr"),o="ma"}(t.annotations.length>0||n)&&(e.annotations=t.annotations.map(function(t){return function(t,e){return{value:t.value,timestamp:t.timestamp,endpoint:e}}(t,a)})),n&&(e.annotations.push({value:n,timestamp:t.timestamp,endpoint:a}),t.duration&&e.annotations.push({value:r,timestamp:t.timestamp+t.duration,endpoint:a}));var i=Object.keys(t.tags);if((i.length>0||t.remoteEndpoint)&&(e.binaryAnnotations=i.map(function(e){return{key:e,value:t.tags[e],endpoint:a}})),t.remoteEndpoint){var s={key:o,value:!0,endpoint:Ce(t.remoteEndpoint)};e.binaryAnnotations.push(s)}return t.debug&&(e.debug=!0),JSON.stringify(e)}(t)}},JSON_V2:{encode:function(t){return function(t){var e={traceId:t.traceId};return t.parentId&&(e.parentId=t.parentId),e.id=t.id,t.name&&(e.name=t.name),t.kind&&(e.kind=t.kind),t.timestamp&&(e.timestamp=t.timestamp),t.duration&&(e.duration=t.duration),t.localEndpoint&&(e.localEndpoint=t.localEndpoint),t.remoteEndpoint&&(e.remoteEndpoint=t.remoteEndpoint),t.annotations.length>0&&(e.annotations=t.annotations),Object.keys(t.tags).length>0&&(e.tags=t.tags),t.debug&&(e.debug=!0),t.shared&&(e.shared=!0),JSON.stringify(e)}(t)}}},parseRequestUrl:Ie}}); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(t.Zipkin={})}(this,function(t){"use strict";function e(t){return(e="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 r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function n(t,e){for(var r=0;e.length>r;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function o(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&s(t,e)}function a(t){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function s(t,e){return(s=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function u(t,e){return!e||"object"!=typeof e&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}var c={get type(){return"None"},get present(){return!1},map:function(){return this},ifPresent:function(){},flatMap:function(){return this},getOrElse:function(t){return t instanceof Function?t():t},equals:function(t){return t===this},toString:function(){return"None"}},h=function(){function t(e){r(this,t),this.value=e}return o(t,[{key:"map",value:function(e){return new t(e(this.value))}},{key:"ifPresent",value:function(t){t(this.value)}},{key:"flatMap",value:function(t){return t(this.value)}},{key:"getOrElse",value:function(){return this.value}},{key:"equals",value:function(e){return e instanceof t&&e.value===this.value}},{key:"toString",value:function(){return"Some(".concat(this.value,")")}},{key:"type",get:function(){return"Some"}},{key:"present",get:function(){return!0}}]),t}();function f(t){return t instanceof h||c.equals(t)}var p={Some:h,None:c,isOptional:f,verifyIsOptional:function(t){if(null==t)throw Error("Error: data is not Optional - it's null");if(!f(t))throw Error("Error: data (".concat(t,") is not an Option!"));if(f(t.value))throw Error("Error: data (".concat(t.value,") is wrapped in Option twice"))},verifyIsNotOptional:function(t){if(f(t))throw Error("Error: data (".concat(t,") is an Option!"))},fromNullable:function(t){return null==t?c:new h(t)}},l="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};function d(){throw Error("setTimeout has not been defined")}function v(){throw Error("clearTimeout has not been defined")}var m=d,g=v;function y(t){if(m===setTimeout)return setTimeout(t,0);if((m===d||!m)&&setTimeout)return m=setTimeout,setTimeout(t,0);try{return m(t,0)}catch(e){try{return m.call(null,t,0)}catch(e){return m.call(this,t,0)}}}"function"==typeof l.setTimeout&&(m=setTimeout),"function"==typeof l.clearTimeout&&(g=clearTimeout);var w,I=[],E=!1,b=-1;function S(){E&&w&&(E=!1,w.length?I=w.concat(I):b=-1,I.length&&A())}function A(){if(!E){var t=y(S);E=!0;for(var e=I.length;e;){for(w=I,I=[];++b<e;)w&&w[b].run();b=-1,e=I.length}w=null,E=!1,function(t){if(g===clearTimeout)return clearTimeout(t);if((g===v||!g)&&clearTimeout)return g=clearTimeout,clearTimeout(t);try{g(t)}catch(e){try{return g.call(null,t)}catch(e){return g.call(this,t)}}}(t)}}function R(t,e){this.fun=t,this.array=e}R.prototype.run=function(){this.fun.apply(null,this.array)};function _(){}var T=_,k=_,O=_,C=_,P=_,N=_,U=_;var B=l.performance||{},x=B.now||B.mozNow||B.msNow||B.oNow||B.webkitNow||function(){return(new Date).getTime()};var L=new Date;var M,j={nextTick:function(t){var e=Array(arguments.length-1);if(arguments.length>1)for(var r=1;arguments.length>r;r++)e[r-1]=arguments[r];I.push(new R(t,e)),1!==I.length||E||y(A)},title:"browser",browser:!0,env:{},argv:[],version:"",versions:{},on:T,addListener:k,once:O,off:C,removeListener:P,removeAllListeners:N,emit:U,binding:function(t){throw Error("process.binding is not supported")},cwd:function(){return"/"},chdir:function(t){throw Error("process.chdir is not supported")},umask:function(){return 0},hrtime:function(t){var e=.001*x.call(B),r=Math.floor(e),n=Math.floor(e%1*1e9);return t&&(r-=t[0],0>(n-=t[1])&&(r--,n+=1e9)),[r,n]},platform:"browser",release:{},config:{},uptime:function(){return(new Date-L)/1e3}};function Y(){return"/tmp"}var D={EOL:"\n",tmpdir:Y,tmpDir:Y,networkInterfaces:function(){},getNetworkInterfaces:function(){},release:function(){return void 0!==l.navigator?l.navigator.appVersion:""},type:function(){return"Browser"},cpus:function(){return[]},totalmem:function(){return Number.MAX_VALUE},freemem:function(){return Number.MAX_VALUE},uptime:function(){return 0},loadavg:function(){return[]},hostname:function(){return void 0!==l.location?l.location.hostname:""},endianness:function(){if(void 0===M){var t=new ArrayBuffer(2),e=new Uint8Array(t),r=new Uint16Array(t);if(e[0]=1,e[1]=2,258===r[0])M="BE";else{if(513!==r[0])throw Error("unable to figure out endianess");M="LE"}}return M}};function q(t,e){for(var r in t)for(var n=t[r].length-1;n>=0;n--){var o=t[r][n];if(!o.internal&&o.family===e&&("IPv4"===e||0===o.scopeid))return o.address}return"IPv4"===e?"127.0.0.1":"::1"}function F(t,e){var r={};for(var n in t)n===e&&(r[n]=t[n]);return r}function z(t){var e=D.networkInterfaces();return t&&(e=F(e,t)),q(e,"IPv4")}z.ipv4=z,z.ipv6=function(t){var e=D.networkInterfaces();return t&&(e=F(e,t)),q(e,"IPv6")};var K=z,H=function(){function t(e){r(this,t),this.addr=e}return o(t,[{key:"ipv4",value:function(){var t=this.toInt();if(t&&0!==t)return this.addr}},{key:"toInt",value:function(){var t=this.addr.split(".");return t[0]<<24|t[1]<<16|t[2]<<8|t[3]}},{key:"toString",value:function(){return"InetAddress(".concat(this.addr,")")}}]),t}();H.getLocalAddress=function(){return"object"===(void 0===j?"undefined":e(j))&&"function"==typeof j.on?new H(K.ipv4()):new H("127.0.0.1")};var V=H,J=function(){function t(){r(this,t)}return o(t,[{key:"toString",value:function(){return"".concat(this.annotationType,"()")}}]),t}(),X=function(t){function e(){return r(this,e),u(this,a(e).apply(this,arguments))}return i(e,J),e}(),Z=function(t){function e(){return r(this,e),u(this,a(e).apply(this,arguments))}return i(e,J),e}(),$=function(t){function e(){return r(this,e),u(this,a(e).apply(this,arguments))}return i(e,J),e}(),G=function(t){function e(){return r(this,e),u(this,a(e).apply(this,arguments))}return i(e,J),e}(),Q=function(t){function e(){return r(this,e),u(this,a(e).apply(this,arguments))}return i(e,J),e}(),W=function(t){function e(){return r(this,e),u(this,a(e).apply(this,arguments))}return i(e,J),e}(),tt=function(t){function e(){return r(this,e),u(this,a(e).apply(this,arguments))}return i(e,J),e}(),et=function(t){function e(){return r(this,e),u(this,a(e).apply(this,arguments))}return i(e,J),e}();function rt(t){this.name=t}rt.prototype.toString=function(){return'LocalOperationStart("'.concat(this.name,'")')};var nt=function(t){function e(){return r(this,e),u(this,a(e).apply(this,arguments))}return i(e,J),e}();function ot(t){this.message=t}function it(t){this.serviceName=t}function at(t){this.name=t}function st(t){var e=t.port;this.host=t.host,this.port=e}function ut(t){var e=t.host,r=t.port;this.serviceName=t.serviceName,this.host=e||void 0,this.port=r||0}function ct(t){var e=t.port;this.host=t.host||V.getLocalAddress(),this.port=e||0}function ht(t){var e=t.host,r=t.port;this.serviceName=t.serviceName,this.host=e,this.port=r}function ft(t,e){this.key=t,this.value=e}ot.prototype.toString=function(){return'Message("'.concat(this.message,'")')},it.prototype.toString=function(){return'ServiceName("'.concat(this.serviceName,'")')},at.prototype.toString=function(){return'Rpc("'.concat(this.name,'")')},st.prototype.toString=function(){return'ClientAddr(host="'.concat(this.host,'", port=').concat(this.port,")")},ut.prototype.toString=function(){return'ServerAddr(serviceName="'.concat(this.serviceName,'", host="').concat(this.host,'", port=').concat(this.port,")")},ct.prototype.toString=function(){return'LocalAddr(host="'.concat(""+this.host,'", port=').concat(this.port,")")},ht.prototype.toString=function(){return'MessageAddr(serviceName="'.concat(this.serviceName,'", host="').concat(this.host,'", port=').concat(this.port,")")},ft.prototype.toString=function(){return"BinaryAnnotation(".concat(this.key,'="').concat(this.value,'")')};var pt={ClientSend:X,ClientRecv:Z,ServerSend:$,ServerRecv:G,ProducerStart:Q,ProducerStop:W,ConsumerStart:tt,ConsumerStop:et,MessageAddr:ht,Message:ot,ServiceName:it,Rpc:at,ClientAddr:st,ServerAddr:ut,LocalAddr:ct,BinaryAnnotation:ft,LocalOperationStart:rt,LocalOperationStop:nt};Object.keys(pt).forEach(function(t){pt[t].prototype.annotationType=t});var lt=pt,dt=p.Some,vt=function(){function t(e){r(this,t),this.evaluator=e}return o(t,[{key:"shouldSample",value:function(t){var e=this,r=t.sampled.getOrElse(function(){return e.evaluator(t)});return new dt(r)}},{key:"toString",value:function(){return"Sampler(".concat(""+this.evaluator,")")}}]),t}();function mt(t){return!1}function gt(t){return!0}mt.toString=function(){return"never sample"},gt.toString=function(){return"always sample"};var yt={Sampler:vt,CountingSampler:function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return r(this,e),u(this,a(e).call(this,function(t){if(t>0){if(1>t){var e=0,r=parseInt(1/t),n=function(t){var n=0==(e%=r);return e++,n};return n.toString=function(){return"countingSampler: sampleRate=".concat(t)},n}return gt}return mt}(1>t?t:1)))}return i(e,vt),e}(),neverSample:mt,alwaysSample:gt},wt=function(){function t(e){var n=e.traceId,o=e.timestamp,i=e.annotation;r(this,t),this.traceId=n,this.timestamp=o,this.annotation=i}return o(t,[{key:"toString",value:function(){return"Record(traceId=".concat(""+this.traceId,", annotation=").concat(""+this.annotation,")")}}]),t}(),It=p.Some,Et=p.None,bt=p.verifyIsOptional,St=p.verifyIsNotOptional,At=function(){function t(e){r(this,t);var n=e.traceId,o=void 0===n?Et:n,i=e.parentId,a=void 0===i?Et:i,s=e.spanId,u=e.sampled,c=void 0===u?Et:u,h=e.flags,f=void 0===h?0:h;bt(o),bt(a),St(s),bt(c),this._traceId=o,this._parentId=a,this._spanId=s,this._sampled=c,this._flags=f}return o(t,[{key:"isDebug",value:function(){return 1==(1&this._flags)}},{key:"toString",value:function(){return"TraceId(spanId=".concat(""+this.spanId)+", parentId=".concat(""+this.parentId)+", traceId=".concat(""+this.traceId,")")}},{key:"spanId",get:function(){return this._spanId}},{key:"parentId",get:function(){return this._parentId.getOrElse(this.spanId)}},{key:"traceId",get:function(){return this._traceId.getOrElse(this.parentId)}},{key:"sampled",get:function(){return this.isDebug()?new It(!0):this._sampled}},{key:"flags",get:function(){return this._flags}}]),t}();var Rt=function(){for(var t="",e=0;16>e;e++)t+="0123456789abcdef"[Math.floor(16*Math.random())];return t},_t=void 0!==j&&j.hrtime;var Tt={now:_t?function(t,e){if(t&&e){var r=j.hrtime(e);return t+Math.floor(1e6*r[0]+r[1]/1e3)}return 1e3*Date.now()}:function(){return 1e3*Date.now()},hrtime:_t?function(){return j.hrtime()}:function(){}};function kt(t){var e=t.ipv4,r=t.port;this.setServiceName(t.serviceName),this.setIpv4(e),this.setPort(r)}function Ot(t,e){this.timestamp=t,this.value=""+e}function Ct(t){var e=this;this.traceId=t.traceId,t._parentId.ifPresent(function(t){e.parentId=t}),this.id=t.spanId,this.name=void 0,this.kind=void 0,this.timestamp=void 0,this.duration=void 0,this.localEndpoint=void 0,this.remoteEndpoint=void 0,this.annotations=[],this.tags={},this.debug=t.isDebug(),this.shared=!1}kt.prototype.setServiceName=function(t){this.serviceName=t?t.toLocaleLowerCase():void 0},kt.prototype.setIpv4=function(t){this.ipv4=t},kt.prototype.setPort=function(t){this.port=t||void 0},kt.prototype.isEmpty=function(){return void 0===this.serviceName&&void 0===this.ipv4&&void 0===this.port},Ot.prototype.toString=function(){return'Annotation(value="'.concat(this.value,'")')},Ct.prototype.setName=function(t){this.name=t?t.toLocaleLowerCase():void 0},Ct.prototype.setKind=function(t){this.kind=t},Ct.prototype.setTimestamp=function(t){this.timestamp=t},Ct.prototype.setDuration=function(t){void 0!==t&&(this.duration=Math.max(t,1))},Ct.prototype.setLocalEndpoint=function(t){this.localEndpoint=t&&!t.isEmpty()?t:void 0},Ct.prototype.setRemoteEndpoint=function(t){this.remoteEndpoint=t&&!t.isEmpty()?t:void 0},Ct.prototype.addAnnotation=function(t,e){this.annotations.push(new Ot(t,e))},Ct.prototype.putTag=function(t,e){this.tags[t]=""+e},Ct.prototype.setDebug=function(t){this.debug=t},Ct.prototype.setShared=function(t){this.shared=t},Ct.prototype.toString=function(){var t=this.annotations.map(function(t){return""+t}).join(", ");return"Span(id=".concat(this.traceId,", annotations=[").concat(t,"])")};var Pt={Endpoint:kt,Span:Ct},Nt=function(t){return!!t&&("object"==typeof t||"function"==typeof t)&&"function"==typeof t.then};var Ut=p.None,Bt=p.Some,xt=p.fromNullable,Lt=yt.Sampler,Mt=yt.alwaysSample,jt=Tt.now,Yt=Tt.hrtime,Dt=Pt.Endpoint;function qt(t){throw Error("Tracer: Missing required argument ".concat(t,"."))}var Ft=function(){function t(e){var n=e.ctxImpl,o=void 0===n?qt("ctxImpl"):n,i=e.recorder,a=void 0===i?qt("recorder"):i,s=e.sampler,u=void 0===s?new Lt(Mt):s,c=e.traceId128Bit,h=void 0!==c&&c,f=e.supportsJoin,p=void 0===f||f,l=e.localServiceName,d=e.localEndpoint,v=e.log,m=void 0===v?console:v,g=e.defaultTags;r(this,t),this.log=m,this.recorder=a,this.sampler=u,this.traceId128Bit=h,this.supportsJoin=p,this._localEndpoint=d||new Dt({serviceName:l||"unknown"}),this._ctxImpl=o,this._defaultTraceId=this.createRootId(),this._startTimestamp=jt(),this._startTick=Yt(),g&&this.setTags(g)}return o(t,[{key:"scoped",value:function(t){return this._ctxImpl.scoped(t)}},{key:"letId",value:function(t,e){return this._ctxImpl.letContext(t,e)}},{key:"createRootId",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ut,e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=Rt(),n=this.traceId128Bit?new Bt(Rt()+r):Ut,o=new At({traceId:n,parentId:Ut,spanId:r,sampled:t,flags:e?1:0});return t===Ut&&(o._sampled=this.sampler.shouldSample(o)),o}},{key:"createChildId",value:function(){var t=xt(this._ctxImpl.getContext()),e=new At({traceId:t.map(function(t){return t.traceId}),parentId:t.map(function(t){return t.spanId}),spanId:Rt(),sampled:t.flatMap(function(t){return t.sampled}),flags:t.map(function(t){return t.flags}).getOrElse(0)});return!1===e.sampled.present&&(e._sampled=this.sampler.shouldSample(e)),e}},{key:"local",value:function(t,e){var r=this;if("function"!=typeof e)throw Error("you must pass a function");return this.scoped(function(){var n,o=r.createChildId();r.setId(o),r.recordServiceName(r._localEndpoint.serviceName),r.recordAnnotation(new lt.LocalOperationStart(t));try{n=e()}catch(t){throw r.recordBinary("error",t.message?t.message:""+t),r.recordAnnotation(new lt.LocalOperationStop),t}if(!Nt(n))return r.recordAnnotation(new lt.LocalOperationStop),n;if(!o.sampled.getOrElse(!1))return n;var i=function(t){return r.recorder.record(new wt({traceId:o,timestamp:jt(r._startTimestamp,r._startTick),annotation:t}))};return n.then(function(t){return i(new lt.LocalOperationStop),t}).catch(function(t){throw i(new lt.BinaryAnnotation("error",t.message?t.message:""+t)),i(new lt.LocalOperationStop),t})})}},{key:"setId",value:function(t){this._ctxImpl.setContext(t)}},{key:"recordAnnotation",value:function(t){var e=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:jt(this._startTimestamp,this._startTick);this.id.sampled.ifPresent(function(n){n&&e.recorder.record(new wt({traceId:e.id,timestamp:r,annotation:t}))})}},{key:"recordMessage",value:function(t){this.recordAnnotation(new lt.Message(t))}},{key:"recordServiceName",value:function(t){this.recordAnnotation(new lt.ServiceName(t))}},{key:"recordRpc",value:function(t){this.recordAnnotation(new lt.Rpc(t))}},{key:"recordClientAddr",value:function(t){this.recordAnnotation(new lt.ClientAddr(t))}},{key:"recordServerAddr",value:function(t){this.recordAnnotation(new lt.ServerAddr(t))}},{key:"recordLocalAddr",value:function(t){this.recordAnnotation(new lt.LocalAddr(t))}},{key:"recordBinary",value:function(t,e){this.recordAnnotation(new lt.BinaryAnnotation(t,e))}},{key:"writeIdToConsole",value:function(t){this.log.info("".concat(t,": ").concat(""+this.id))}},{key:"setTags",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};for(var e in t)t.hasOwnProperty(e)&&this.recordBinary(e,t[e])}},{key:"id",get:function(){return this._ctxImpl.getContext()||this._defaultTraceId}},{key:"localEndpoint",get:function(){return this._localEndpoint}}]),t}(),zt=function(){function t(){r(this,t),this.currentCtx=null}return o(t,[{key:"setContext",value:function(t){this.currentCtx=t}},{key:"getContext",value:function(){return this.currentCtx}},{key:"scoped",value:function(t){var e=this.currentCtx,r=t();return this.currentCtx=e,r}},{key:"letContext",value:function(t,e){var r=this;return this.scoped(function(){return r.setContext(t),e()})}}]),t}(),Kt={TraceId:"X-B3-TraceId",SpanId:"X-B3-SpanId",ParentSpanId:"X-B3-ParentSpanId",Sampled:"X-B3-Sampled",Flags:"X-B3-Flags"},Ht=Tt.now,Vt=Tt.hrtime,Jt=Pt.Span,Xt=Pt.Endpoint;function Zt(t){this.traceId=t,this.startTimestamp=Ht(),this.startTick=Vt(),this.delegate=new Jt(t),this.localEndpoint=new Xt({})}Zt.prototype.finish=function(){this.endTimestamp||(this.endTimestamp=Ht(this.startTimestamp,this.startTick))};var $t=function(){function t(e){var n=this,o=e.logger,i=e.timeout,a=void 0===i?6e7:i;r(this,t),this.logger=o,this.timeout=a,this.partialSpans=new Map;var s=setInterval(function(){n.partialSpans.forEach(function(t,e){n._timedOut(t)&&n._writeSpan(e)})},1e3);s.unref&&s.unref()}return o(t,[{key:"_writeSpan",value:function(t){var e=this.partialSpans.get(t);if(void 0!==e){this.partialSpans.delete(t);var r=e.delegate;r.setLocalEndpoint(e.localEndpoint),e.endTimestamp&&(r.setTimestamp(e.startTimestamp),r.setDuration(e.endTimestamp-e.startTimestamp)),this.logger.logSpan(r)}}},{key:"_updateSpanMap",value:function(t,e){var r;e(r=this.partialSpans.has(t)?this.partialSpans.get(t):new Zt(t)),r.endTimestamp?this._writeSpan(t):this.partialSpans.set(t,r)}},{key:"_timedOut",value:function(t){return t.startTimestamp+this.timeout<Ht()}},{key:"record",value:function(t){var e=t.traceId;this._updateSpanMap(e,function(r){switch(t.annotation.annotationType){case"ClientSend":r.delegate.setKind("CLIENT");break;case"ClientRecv":r.finish(),r.delegate.setKind("CLIENT");break;case"ServerSend":r.finish(),r.delegate.setKind("SERVER");break;case"ServerRecv":r.delegate.setShared(e.parentId!==e.spanId),r.delegate.setKind("CLIENT");break;case"ProducerStart":r.delegate.setKind("PRODUCER");break;case"ProducerStop":r.finish(),r.delegate.setKind("PRODUCER");break;case"ConsumerStart":r.delegate.setKind("CONSUMER");break;case"ConsumerStop":r.finish(),r.delegate.setKind("CONSUMER");break;case"MessageAddr":r.delegate.setRemoteEndpoint(new Xt({serviceName:t.annotation.serviceName,ipv4:t.annotation.host&&t.annotation.host.ipv4(),port:t.annotation.port}));break;case"LocalOperationStart":r.delegate.setName(t.annotation.name);break;case"LocalOperationStop":r.finish();break;case"Message":r.delegate.addAnnotation(t.timestamp,t.annotation.message);break;case"Rpc":r.delegate.setName(t.annotation.name);break;case"ServiceName":r.localEndpoint.setServiceName(t.annotation.serviceName);break;case"BinaryAnnotation":r.delegate.putTag(t.annotation.key,t.annotation.value);break;case"LocalAddr":r.localEndpoint.setIpv4(t.annotation.host&&t.annotation.host.ipv4()),r.localEndpoint.setPort(t.annotation.port);break;case"ServerAddr":r.delegate.setKind("CLIENT"),r.delegate.setRemoteEndpoint(new Xt({serviceName:t.annotation.serviceName,ipv4:t.annotation.host&&t.annotation.host.ipv4(),port:t.annotation.port}))}})}},{key:"toString",value:function(){return"BatchRecorder()"}}]),t}(),Gt=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:console.log;r(this,t),this.logger=e}return o(t,[{key:"record",value:function(t){var e=t.traceId;this.logger("Record at (spanId=".concat(e.spanId,", parentId=").concat(e.parentId,",")+" traceId=".concat(e.traceId,"): ").concat(""+t.annotation))}},{key:"toString",value:function(){return"consoleTracer"}}]),t}(),Qt=2147483647,Wt=36,te=1,ee=26,re=38,ne=700,oe=72,ie=128,ae="-",se=/[^\x20-\x7E]/,ue=/[\x2E\u3002\uFF0E\uFF61]/g,ce={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},he=Wt-te,fe=Math.floor,pe=String.fromCharCode;function le(t){throw new RangeError(ce[t])}function de(t,e){return t+22+75*(26>t)-((0!=e)<<5)}function ve(t,e,r){var n=0;for(t=r?fe(t/ne):t>>1,t+=fe(t/e);t>he*ee>>1;n+=Wt)t=fe(t/he);return fe(n+(he+1)*t/(t+re))}function me(t){return function(t,e){var r=t.split("@"),n="";r.length>1&&(n=r[0]+"@",t=r[1]);var o=function(t,e){for(var r=t.length,n=[];r--;)n[r]=e(t[r]);return n}((t=t.replace(ue,".")).split("."),e).join(".");return n+o}(t,function(t){return se.test(t)?"xn--"+function(t){var e,r,n,o,i,a,s,u,c,h,f,p,l,d,v,m=[];for(p=(t=function(t){for(var e,r,n=[],o=0,i=t.length;i>o;)55296>(e=t.charCodeAt(o++))||e>56319||o>=i?n.push(e):56320==(64512&(r=t.charCodeAt(o++)))?n.push(((1023&e)<<10)+(1023&r)+65536):(n.push(e),o--);return n}(t)).length,e=ie,r=0,i=oe,a=0;p>a;++a)128>(f=t[a])&&m.push(pe(f));for(n=o=m.length,o&&m.push(ae);p>n;){for(s=Qt,a=0;p>a;++a)(f=t[a])>=e&&s>f&&(s=f);for(s-e>fe((Qt-r)/(l=n+1))&&le("overflow"),r+=(s-e)*l,e=s,a=0;p>a;++a)if(e>(f=t[a])&&++r>Qt&&le("overflow"),f==e){for(u=r,c=Wt;(h=c>i?i+ee>c?c-i:ee:te)<=u;c+=Wt)m.push(pe(de(h+(v=u-h)%(d=Wt-h),0))),u=fe(v/d);m.push(pe(de(u,0))),i=ve(r,l,n==o),r=0,++n}++r,++e}return m.join("")}(t):t})}var ge=[],ye=[],we="undefined"!=typeof Uint8Array?Uint8Array:Array,Ie=!1;function Ee(){Ie=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=0;64>e;++e)ge[e]=t[e],ye[t.charCodeAt(e)]=e;ye[45]=62,ye[95]=63}function be(t,e,r){for(var n,o=[],i=e;r>i;i+=3)o.push(ge[(n=(t[i]<<16)+(t[i+1]<<8)+t[i+2])>>18&63]+ge[n>>12&63]+ge[n>>6&63]+ge[63&n]);return o.join("")}function Se(t){var e;Ie||Ee();for(var r=t.length,n=r%3,o="",i=[],a=0,s=r-n;s>a;a+=16383)i.push(be(t,a,a+16383>s?s:a+16383));return 1===n?(o+=ge[(e=t[r-1])>>2],o+=ge[e<<4&63],o+="=="):2===n&&(o+=ge[(e=(t[r-2]<<8)+t[r-1])>>10],o+=ge[e>>4&63],o+=ge[e<<2&63],o+="="),i.push(o),i.join("")}function Ae(t,e,r,n,o){var i,a,s=8*o-n-1,u=(1<<s)-1,c=u>>1,h=-7,f=r?o-1:0,p=r?-1:1,l=t[e+f];for(f+=p,i=l&(1<<-h)-1,l>>=-h,h+=s;h>0;i=256*i+t[e+f],f+=p,h-=8);for(a=i&(1<<-h)-1,i>>=-h,h+=n;h>0;a=256*a+t[e+f],f+=p,h-=8);if(0===i)i=1-c;else{if(i===u)return a?NaN:1/0*(l?-1:1);a+=Math.pow(2,n),i-=c}return(l?-1:1)*a*Math.pow(2,i-n)}function Re(t,e,r,n,o,i){var a,s,u,c=8*i-o-1,h=(1<<c)-1,f=h>>1,p=23===o?5.960464477539062e-8:0,l=n?0:i-1,d=n?1:-1,v=0>e||0===e&&0>1/e?1:0;for(isNaN(e=Math.abs(e))||e===1/0?(s=isNaN(e)?1:0,a=h):(1>e*(u=Math.pow(2,-(a=Math.floor(Math.log(e)/Math.LN2))))&&(a--,u*=2),2>(e+=1>a+f?p*Math.pow(2,1-f):p/u)*u||(a++,u/=2),h>a+f?1>a+f?(s=e*Math.pow(2,f-1)*Math.pow(2,o),a=0):(s=(e*u-1)*Math.pow(2,o),a+=f):(s=0,a=h));o>=8;t[r+l]=255&s,l+=d,s/=256,o-=8);for(a=a<<o|s,c+=o;c>0;t[r+l]=255&a,l+=d,a/=256,c-=8);t[r+l-d]|=128*v}var _e={}.toString,Te=Array.isArray||function(t){return"[object Array]"==_e.call(t)};function ke(){return Ce.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function Oe(t,e){if(ke()<e)throw new RangeError("Invalid typed array length");return Ce.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=Ce.prototype:(null===t&&(t=new Ce(e)),t.length=e),t}function Ce(t,e,r){if(!(Ce.TYPED_ARRAY_SUPPORT||this instanceof Ce))return new Ce(t,e,r);if("number"==typeof t){if("string"==typeof e)throw Error("If encoding is specified then the first argument must be a string");return Ue(this,t)}return Pe(this,t,e,r)}function Pe(t,e,r,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,r,n){if(0>r||r>e.byteLength)throw new RangeError("'offset' is out of bounds");if(r+(n||0)>e.byteLength)throw new RangeError("'length' is out of bounds");e=void 0===r&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,r):new Uint8Array(e,r,n);Ce.TYPED_ARRAY_SUPPORT?(t=e).__proto__=Ce.prototype:t=Be(t,e);return t}(t,e,r,n):"string"==typeof e?function(t,e,r){"string"==typeof r&&""!==r||(r="utf8");if(!Ce.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|Me(e,r),o=(t=Oe(t,n)).write(e,r);o!==n&&(t=t.slice(0,o));return t}(t,e,r):function(t,e){if(Le(e)){var r=0|xe(e.length);return 0===(t=Oe(t,r)).length?t:(e.copy(t,0,0,r),t)}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(n=e.length)!=n?Oe(t,0):Be(t,e);if("Buffer"===e.type&&Te(e.data))return Be(t,e.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function Ne(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(0>t)throw new RangeError('"size" argument must not be negative')}function Ue(t,e){if(Ne(e),t=Oe(t,0>e?0:0|xe(e)),!Ce.TYPED_ARRAY_SUPPORT)for(var r=0;e>r;++r)t[r]=0;return t}function Be(t,e){var r=0>e.length?0:0|xe(e.length);t=Oe(t,r);for(var n=0;r>n;n+=1)t[n]=255&e[n];return t}function xe(t){if(t>=ke())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+ke().toString(16)+" bytes");return 0|t}function Le(t){return!(null==t||!t._isBuffer)}function Me(t,e){if(Le(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 r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return cr(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return hr(t).length;default:if(n)return cr(t).length;e=(""+e).toLowerCase(),n=!0}}function je(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function Ye(t,e,r,n,o){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:-2147483648>r&&(r=-2147483648),isNaN(r=+r)&&(r=o?0:t.length-1),0>r&&(r=t.length+r),t.length>r){if(0>r){if(!o)return-1;r=0}}else{if(o)return-1;r=t.length-1}if("string"==typeof e&&(e=Ce.from(e,n)),Le(e))return 0===e.length?-1:De(t,e,r,n,o);if("number"==typeof e)return e&=255,Ce.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):De(t,[e],r,n,o);throw new TypeError("val must be string, number or Buffer")}function De(t,e,r,n,o){var i,a=1,s=t.length,u=e.length;if(void 0!==n&&("ucs2"===(n=(n+"").toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(2>t.length||2>e.length)return-1;a=2,s/=2,u/=2,r/=2}function c(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(o){var h=-1;for(i=r;s>i;i++)if(c(t,i)===c(e,-1===h?0:i-h)){if(-1===h&&(h=i),i-h+1===u)return h*a}else-1!==h&&(i-=i-h),h=-1}else for(r+u>s&&(r=s-u),i=r;i>=0;i--){for(var f=!0,p=0;u>p;p++)if(c(t,i+p)!==c(e,p)){f=!1;break}if(f)return i}return-1}function qe(t,e,r,n){var o=t.length-(r=+r||0);n?(n=+n)>o&&(n=o):n=o;var i=e.length;if(i%2!=0)throw new TypeError("Invalid hex string");n>i/2&&(n=i/2);for(var a=0;n>a;++a){var s=parseInt(e.substr(2*a,2),16);if(isNaN(s))return a;t[r+a]=s}return a}function Fe(t,e,r,n){return fr(cr(e,t.length-r),t,r,n)}function ze(t,e,r,n){return fr(function(t){for(var e=[],r=0;t.length>r;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function Ke(t,e,r,n){return ze(t,e,r,n)}function He(t,e,r,n){return fr(hr(e),t,r,n)}function Ve(t,e,r,n){return fr(function(t,e){for(var r,n,o=[],i=0;t.length>i&&0<=(e-=2);++i)r=t.charCodeAt(i),n=r>>8,o.push(r%256),o.push(n);return o}(e,t.length-r),t,r,n)}function Je(t,e,r){return Se(0===e&&r===t.length?t:t.slice(e,r))}function Xe(t,e,r){r=Math.min(t.length,r);for(var n=[],o=e;r>o;){var i,a,s,u,c=t[o],h=null,f=c>239?4:c>223?3:c>191?2:1;if(r>=o+f)switch(f){case 1:128>c&&(h=c);break;case 2:128==(192&(i=t[o+1]))&&(u=(31&c)<<6|63&i)>127&&(h=u);break;case 3:a=t[o+2],128==(192&(i=t[o+1]))&&128==(192&a)&&(u=(15&c)<<12|(63&i)<<6|63&a)>2047&&(55296>u||u>57343)&&(h=u);break;case 4:a=t[o+2],s=t[o+3],128==(192&(i=t[o+1]))&&128==(192&a)&&128==(192&s)&&(u=(15&c)<<18|(63&i)<<12|(63&a)<<6|63&s)>65535&&1114112>u&&(h=u)}null===h?(h=65533,f=1):h>65535&&(n.push((h-=65536)>>>10&1023|55296),h=56320|1023&h),n.push(h),o+=f}return function(t){var e=t.length;if(Ze>=e)return String.fromCharCode.apply(String,t);var r="",n=0;for(;e>n;)r+=String.fromCharCode.apply(String,t.slice(n,n+=Ze));return r}(n)}Ce.TYPED_ARRAY_SUPPORT=void 0===l.TYPED_ARRAY_SUPPORT||l.TYPED_ARRAY_SUPPORT,Ce.poolSize=8192,Ce._augment=function(t){return t.__proto__=Ce.prototype,t},Ce.from=function(t,e,r){return Pe(null,t,e,r)},Ce.TYPED_ARRAY_SUPPORT&&(Ce.prototype.__proto__=Uint8Array.prototype,Ce.__proto__=Uint8Array),Ce.alloc=function(t,e,r){return function(t,e,r,n){return Ne(e),e>0&&void 0!==r?"string"==typeof n?Oe(t,e).fill(r,n):Oe(t,e).fill(r):Oe(t,e)}(null,t,e,r)},Ce.allocUnsafe=function(t){return Ue(null,t)},Ce.allocUnsafeSlow=function(t){return Ue(null,t)},Ce.isBuffer=function(t){return null!=t&&(!!t._isBuffer||pr(t)||function(t){return"function"==typeof t.readFloatLE&&"function"==typeof t.slice&&pr(t.slice(0,0))}(t))},Ce.compare=function(t,e){if(!Le(t)||!Le(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,o=0,i=Math.min(r,n);i>o;++o)if(t[o]!==e[o]){r=t[o],n=e[o];break}return n>r?-1:r>n?1:0},Ce.isEncoding=function(t){switch((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}},Ce.concat=function(t,e){if(!Te(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return Ce.alloc(0);var r;if(void 0===e)for(e=0,r=0;t.length>r;++r)e+=t[r].length;var n=Ce.allocUnsafe(e),o=0;for(r=0;t.length>r;++r){var i=t[r];if(!Le(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(n,o),o+=i.length}return n},Ce.byteLength=Me,Ce.prototype._isBuffer=!0,Ce.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 e=0;t>e;e+=2)je(this,e,e+1);return this},Ce.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 e=0;t>e;e+=4)je(this,e,e+3),je(this,e+1,e+2);return this},Ce.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 e=0;t>e;e+=8)je(this,e,e+7),je(this,e+1,e+6),je(this,e+2,e+5),je(this,e+3,e+4);return this},Ce.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?Xe(this,0,t):function(t,e,r){var n=!1;if((void 0===e||0>e)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),0>=r)return"";if((e>>>=0)>=(r>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return Qe(this,e,r);case"utf8":case"utf-8":return Xe(this,e,r);case"ascii":return $e(this,e,r);case"latin1":case"binary":return Ge(this,e,r);case"base64":return Je(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return We(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}.apply(this,arguments)},Ce.prototype.equals=function(t){if(!Le(t))throw new TypeError("Argument must be a Buffer");return this===t||0===Ce.compare(this,t)},Ce.prototype.inspect=function(){var t="";return this.length>0&&(t=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(t+=" ... ")),"<Buffer "+t+">"},Ce.prototype.compare=function(t,e,r,n,o){if(!Le(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),0>e||r>t.length||0>n||o>this.length)throw new RangeError("out of range index");if(n>=o&&e>=r)return 0;if(n>=o)return-1;if(e>=r)return 1;if(this===t)return 0;for(var i=(o>>>=0)-(n>>>=0),a=(r>>>=0)-(e>>>=0),s=Math.min(i,a),u=this.slice(n,o),c=t.slice(e,r),h=0;s>h;++h)if(u[h]!==c[h]){i=u[h],a=c[h];break}return a>i?-1:i>a?1:0},Ce.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},Ce.prototype.indexOf=function(t,e,r){return Ye(this,t,e,r,!0)},Ce.prototype.lastIndexOf=function(t,e,r){return Ye(this,t,e,r,!1)},Ce.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var o=this.length-e;if((void 0===r||r>o)&&(r=o),t.length>0&&(0>r||0>e)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return qe(this,t,e,r);case"utf8":case"utf-8":return Fe(this,t,e,r);case"ascii":return ze(this,t,e,r);case"latin1":case"binary":return Ke(this,t,e,r);case"base64":return He(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ve(this,t,e,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},Ce.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var Ze=4096;function $e(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;r>o;++o)n+=String.fromCharCode(127&t[o]);return n}function Ge(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;r>o;++o)n+=String.fromCharCode(t[o]);return n}function Qe(t,e,r){var n=t.length;e&&e>=0||(e=0),(!r||0>r||r>n)&&(r=n);for(var o="",i=e;r>i;++i)o+=ur(t[i]);return o}function We(t,e,r){for(var n=t.slice(e,r),o="",i=0;n.length>i;i+=2)o+=String.fromCharCode(n[i]+256*n[i+1]);return o}function tr(t,e,r){if(t%1!=0||0>t)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function er(t,e,r,n,o,i){if(!Le(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||i>e)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function rr(t,e,r,n){0>e&&(e=65535+e+1);for(var o=0,i=Math.min(t.length-r,2);i>o;++o)t[r+o]=(e&255<<8*(n?o:1-o))>>>8*(n?o:1-o)}function nr(t,e,r,n){0>e&&(e=4294967295+e+1);for(var o=0,i=Math.min(t.length-r,4);i>o;++o)t[r+o]=e>>>8*(n?o:3-o)&255}function or(t,e,r,n,o,i){if(r+n>t.length)throw new RangeError("Index out of range");if(0>r)throw new RangeError("Index out of range")}function ir(t,e,r,n,o){return o||or(t,0,r,4),Re(t,e,r,n,23,4),r+4}function ar(t,e,r,n,o){return o||or(t,0,r,8),Re(t,e,r,n,52,8),r+8}Ce.prototype.slice=function(t,e){var r,n=this.length;if(0>(t=~~t)?0>(t+=n)&&(t=0):t>n&&(t=n),0>(e=void 0===e?n:~~e)?0>(e+=n)&&(e=0):e>n&&(e=n),t>e&&(e=t),Ce.TYPED_ARRAY_SUPPORT)(r=this.subarray(t,e)).__proto__=Ce.prototype;else{var o=e-t;r=new Ce(o,void 0);for(var i=0;o>i;++i)r[i]=this[i+t]}return r},Ce.prototype.readUIntLE=function(t,e,r){t|=0,e|=0,r||tr(t,e,this.length);for(var n=this[t],o=1,i=0;++i<e&&(o*=256);)n+=this[t+i]*o;return n},Ce.prototype.readUIntBE=function(t,e,r){t|=0,e|=0,r||tr(t,e,this.length);for(var n=this[t+--e],o=1;e>0&&(o*=256);)n+=this[t+--e]*o;return n},Ce.prototype.readUInt8=function(t,e){return e||tr(t,1,this.length),this[t]},Ce.prototype.readUInt16LE=function(t,e){return e||tr(t,2,this.length),this[t]|this[t+1]<<8},Ce.prototype.readUInt16BE=function(t,e){return e||tr(t,2,this.length),this[t]<<8|this[t+1]},Ce.prototype.readUInt32LE=function(t,e){return e||tr(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},Ce.prototype.readUInt32BE=function(t,e){return e||tr(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},Ce.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||tr(t,e,this.length);for(var n=this[t],o=1,i=0;++i<e&&(o*=256);)n+=this[t+i]*o;return(o*=128)>n||(n-=Math.pow(2,8*e)),n},Ce.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||tr(t,e,this.length);for(var n=e,o=1,i=this[t+--n];n>0&&(o*=256);)i+=this[t+--n]*o;return(o*=128)>i||(i-=Math.pow(2,8*e)),i},Ce.prototype.readInt8=function(t,e){return e||tr(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},Ce.prototype.readInt16LE=function(t,e){e||tr(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},Ce.prototype.readInt16BE=function(t,e){e||tr(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},Ce.prototype.readInt32LE=function(t,e){return e||tr(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},Ce.prototype.readInt32BE=function(t,e){return e||tr(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},Ce.prototype.readFloatLE=function(t,e){return e||tr(t,4,this.length),Ae(this,t,!0,23,4)},Ce.prototype.readFloatBE=function(t,e){return e||tr(t,4,this.length),Ae(this,t,!1,23,4)},Ce.prototype.readDoubleLE=function(t,e){return e||tr(t,8,this.length),Ae(this,t,!0,52,8)},Ce.prototype.readDoubleBE=function(t,e){return e||tr(t,8,this.length),Ae(this,t,!1,52,8)},Ce.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e|=0,r|=0,n)||er(this,t,e,r,Math.pow(2,8*r)-1,0);var o=1,i=0;for(this[e]=255&t;++i<r&&(o*=256);)this[e+i]=t/o&255;return e+r},Ce.prototype.writeUIntBE=function(t,e,r,n){(t=+t,e|=0,r|=0,n)||er(this,t,e,r,Math.pow(2,8*r)-1,0);var o=r-1,i=1;for(this[e+o]=255&t;--o>=0&&(i*=256);)this[e+o]=t/i&255;return e+r},Ce.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||er(this,t,e,1,255,0),Ce.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},Ce.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||er(this,t,e,2,65535,0),Ce.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):rr(this,t,e,!0),e+2},Ce.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||er(this,t,e,2,65535,0),Ce.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):rr(this,t,e,!1),e+2},Ce.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||er(this,t,e,4,4294967295,0),Ce.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):nr(this,t,e,!0),e+4},Ce.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||er(this,t,e,4,4294967295,0),Ce.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):nr(this,t,e,!1),e+4},Ce.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var o=Math.pow(2,8*r-1);er(this,t,e,r,o-1,-o)}var i=0,a=1,s=0;for(this[e]=255&t;++i<r&&(a*=256);)0>t&&0===s&&0!==this[e+i-1]&&(s=1),this[e+i]=(t/a>>0)-s&255;return e+r},Ce.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var o=Math.pow(2,8*r-1);er(this,t,e,r,o-1,-o)}var i=r-1,a=1,s=0;for(this[e+i]=255&t;--i>=0&&(a*=256);)0>t&&0===s&&0!==this[e+i+1]&&(s=1),this[e+i]=(t/a>>0)-s&255;return e+r},Ce.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||er(this,t,e,1,127,-128),Ce.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),0>t&&(t=255+t+1),this[e]=255&t,e+1},Ce.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||er(this,t,e,2,32767,-32768),Ce.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):rr(this,t,e,!0),e+2},Ce.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||er(this,t,e,2,32767,-32768),Ce.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):rr(this,t,e,!1),e+2},Ce.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||er(this,t,e,4,2147483647,-2147483648),Ce.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):nr(this,t,e,!0),e+4},Ce.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||er(this,t,e,4,2147483647,-2147483648),0>t&&(t=4294967295+t+1),Ce.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):nr(this,t,e,!1),e+4},Ce.prototype.writeFloatLE=function(t,e,r){return ir(this,t,e,!0,r)},Ce.prototype.writeFloatBE=function(t,e,r){return ir(this,t,e,!1,r)},Ce.prototype.writeDoubleLE=function(t,e,r){return ar(this,t,e,!0,r)},Ce.prototype.writeDoubleBE=function(t,e,r){return ar(this,t,e,!1,r)},Ce.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),t.length>e||(e=t.length),e||(e=0),n>0&&r>n&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(0>e)throw new RangeError("targetStart out of bounds");if(0>r||r>=this.length)throw new RangeError("sourceStart out of bounds");if(0>n)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),n-r>t.length-e&&(n=t.length-e+r);var o,i=n-r;if(this===t&&e>r&&n>e)for(o=i-1;o>=0;--o)t[o+e]=this[o+r];else if(1e3>i||!Ce.TYPED_ARRAY_SUPPORT)for(o=0;i>o;++o)t[o+e]=this[o+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+i),e);return i},Ce.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===t.length){var o=t.charCodeAt(0);256>o&&(t=o)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!Ce.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(0>e||e>this.length||r>this.length)throw new RangeError("Out of range index");if(e>=r)return this;var i;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;r>i;++i)this[i]=t;else{var a=Le(t)?t:cr(""+new Ce(t,n)),s=a.length;for(i=0;r-e>i;++i)this[i+e]=a[i%s]}return this};var sr=/[^+\/0-9A-Za-z-_]/g;function ur(t){return 16>t?"0"+t.toString(16):t.toString(16)}function cr(t,e){var r;e=e||1/0;for(var n=t.length,o=null,i=[],a=0;n>a;++a){if((r=t.charCodeAt(a))>55295&&57344>r){if(!o){if(r>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(a+1===n){(e-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(56320>r){(e-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,128>r){if(0>(e-=1))break;i.push(r)}else if(2048>r){if(0>(e-=2))break;i.push(r>>6|192,63&r|128)}else if(65536>r){if(0>(e-=3))break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(r>=1114112)throw Error("Invalid code point");if(0>(e-=4))break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function hr(t){return function(t){var e,r,n,o,i,a;Ie||Ee();var s=t.length;if(s%4>0)throw Error("Invalid string. Length must be a multiple of 4");a=new we(3*s/4-(i="="===t[s-2]?2:"="===t[s-1]?1:0)),n=i>0?s-4:s;var u=0;for(e=0,r=0;n>e;e+=4,r+=3)o=ye[t.charCodeAt(e)]<<18|ye[t.charCodeAt(e+1)]<<12|ye[t.charCodeAt(e+2)]<<6|ye[t.charCodeAt(e+3)],a[u++]=o>>16&255,a[u++]=o>>8&255,a[u++]=255&o;return 2===i?(o=ye[t.charCodeAt(e)]<<2|ye[t.charCodeAt(e+1)]>>4,a[u++]=255&o):1===i&&(o=ye[t.charCodeAt(e)]<<10|ye[t.charCodeAt(e+1)]<<4|ye[t.charCodeAt(e+2)]>>2,a[u++]=o>>8&255,a[u++]=255&o),a}(function(t){if(2>(t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(sr,"")).length)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function fr(t,e,r,n){for(var o=0;n>o&&(o+r<e.length&&o<t.length);++o)e[o+r]=t[o];return o}function pr(t){return!!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}function lr(t){return null===t}function dr(t){return"string"==typeof t}function vr(t){return"object"==typeof t&&null!==t}function mr(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var gr=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function yr(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}}function wr(t,e){if(t.map)return t.map(e);for(var r=[],n=0;t.length>n;n++)r.push(e(t[n],n));return r}var Ir=Object.keys||function(t){var e=[];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.push(r);return e};function Er(t,e,r,n){r=r||"=";var o={};if("string"!=typeof t||0===t.length)return o;var i=/\+/g;t=t.split(e=e||"&");var a=1e3;n&&"number"==typeof n.maxKeys&&(a=n.maxKeys);var s=t.length;a>0&&s>a&&(s=a);for(var u=0;s>u;++u){var c,h,f,p,l=t[u].replace(i,"%20"),d=l.indexOf(r);0>d?(c=l,h=""):(c=l.substr(0,d),h=l.substr(d+1)),f=decodeURIComponent(c),p=decodeURIComponent(h),mr(o,f)?gr(o[f])?o[f].push(p):o[f]=[o[f],p]:o[f]=p}return o}var br={parse:Mr,resolve:function(t,e){return Mr(t,!1,!0).resolve(e)},resolveObject:function(t,e){return t?Mr(t,!1,!0).resolveObject(e):e},format:function(t){dr(t)&&(t=jr({},t));return Yr(t)},Url:Sr};function Sr(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var Ar=/^([a-z0-9.+-]+:)/i,Rr=/:[0-9]*$/,_r=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,Tr=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),kr=["'"].concat(Tr),Or=["%","/","?",";","#"].concat(kr),Cr=["/","?","#"],Pr=255,Nr=/^[+a-z0-9A-Z_-]{0,63}$/,Ur=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Br={javascript:!0,"javascript:":!0},xr={javascript:!0,"javascript:":!0},Lr={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function Mr(t,e,r){if(t&&vr(t)&&t instanceof Sr)return t;var n=new Sr;return n.parse(t,e,r),n}function jr(t,e,r,n){if(!dr(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var o=e.indexOf("?"),i=-1!==o&&o<e.indexOf("#")?"?":"#",a=e.split(i);a[0]=a[0].replace(/\\/g,"/");var s=e=a.join(i);if(s=s.trim(),!n&&1===e.split("#").length){var u=_r.exec(s);if(u)return t.path=s,t.href=s,t.pathname=u[1],u[2]?(t.search=u[2],t.query=r?Er(t.search.substr(1)):t.search.substr(1)):r&&(t.search="",t.query={}),t}var c,h,f,p=Ar.exec(s);if(p){var l=(p=p[0]).toLowerCase();t.protocol=l,s=s.substr(p.length)}if(n||p||s.match(/^\/\/[^@\/]+@[^@\/]+/)){var d="//"===s.substr(0,2);!d||p&&xr[p]||(s=s.substr(2),t.slashes=!0)}if(!xr[p]&&(d||p&&!Lr[p])){var v,m,g=-1;for(c=0;Cr.length>c;c++)-1===(h=s.indexOf(Cr[c]))||-1!==g&&h>=g||(g=h);for(-1!==(m=-1===g?s.lastIndexOf("@"):s.lastIndexOf("@",g))&&(v=s.slice(0,m),s=s.slice(m+1),t.auth=decodeURIComponent(v)),g=-1,c=0;Or.length>c;c++)-1===(h=s.indexOf(Or[c]))||-1!==g&&h>=g||(g=h);-1===g&&(g=s.length),t.host=s.slice(0,g),s=s.slice(g),Dr(t),t.hostname=t.hostname||"";var y="["===t.hostname[0]&&"]"===t.hostname[t.hostname.length-1];if(!y){var w=t.hostname.split(/\./);for(c=0,f=w.length;f>c;c++){var I=w[c];if(I&&!I.match(Nr)){for(var E="",b=0,S=I.length;S>b;b++)I.charCodeAt(b)>127?E+="x":E+=I[b];if(!E.match(Nr)){var A=w.slice(0,c),R=w.slice(c+1),_=I.match(Ur);_&&(A.push(_[1]),R.unshift(_[2])),R.length&&(s="/"+R.join(".")+s),t.hostname=A.join(".");break}}}}t.hostname=t.hostname.length>Pr?"":t.hostname.toLowerCase(),y||(t.hostname=me(t.hostname)),t.host=(t.hostname||"")+(t.port?":"+t.port:""),t.href+=t.host,y&&(t.hostname=t.hostname.substr(1,t.hostname.length-2),"/"!==s[0]&&(s="/"+s))}if(!Br[l])for(c=0,f=kr.length;f>c;c++){var T=kr[c];if(-1!==s.indexOf(T)){var k=encodeURIComponent(T);k===T&&(k=escape(T)),s=s.split(T).join(k)}}var O=s.indexOf("#");-1!==O&&(t.hash=s.substr(O),s=s.slice(0,O));var C=s.indexOf("?");(-1!==C?(t.search=s.substr(C),t.query=s.substr(C+1),r&&(t.query=Er(t.query)),s=s.slice(0,C)):r&&(t.search="",t.query={}),s&&(t.pathname=s),Lr[l]&&t.hostname&&!t.pathname&&(t.pathname="/"),t.pathname||t.search)&&(t.path=(t.pathname||"")+(t.search||""));return t.href=Yr(t),t}function Yr(t){var e=t.auth||"";e&&(e=(e=encodeURIComponent(e)).replace(/%3A/i,":"),e+="@");var r,n,o,i,a=t.protocol||"",s=t.pathname||"",u=t.hash||"",c=!1,h="";t.host?c=e+t.host:t.hostname&&(c=e+(-1===t.hostname.indexOf(":")?t.hostname:"["+this.hostname+"]"),t.port&&(c+=":"+t.port)),t.query&&vr(t.query)&&Object.keys(t.query).length&&(n=n||"&",o=o||"=",null===(r=t.query)&&(r=void 0),h="object"==typeof r?wr(Ir(r),function(t){var e=encodeURIComponent(yr(t))+o;return gr(r[t])?wr(r[t],function(t){return e+encodeURIComponent(yr(t))}).join(n):e+encodeURIComponent(yr(r[t]))}).join(n):i?encodeURIComponent(yr(i))+o+encodeURIComponent(yr(r)):"");var f=t.search||h&&"?"+h||"";return a&&":"!==a.substr(-1)&&(a+=":"),t.slashes||(!a||Lr[a])&&!1!==c?(c="//"+(c||""),s&&"/"!==s.charAt(0)&&(s="/"+s)):c||(c=""),u&&"#"!==u.charAt(0)&&(u="#"+u),f&&"?"!==f.charAt(0)&&(f="?"+f),a+c+(s=s.replace(/[?#]/g,function(t){return encodeURIComponent(t)}))+(f=f.replace("#","%23"))+u}function Dr(t){var e=t.host,r=Rr.exec(e);r&&(":"!==(r=r[0])&&(t.port=r.substr(1)),e=e.substr(0,e.length-r.length)),e&&(t.hostname=e)}Sr.prototype.parse=function(t,e,r){return jr(this,t,e,r)},Sr.prototype.format=function(){return Yr(this)},Sr.prototype.resolve=function(t){return this.resolveObject(Mr(t,!1,!0)).format()},Sr.prototype.resolveObject=function(t){if(dr(t)){var e=new Sr;e.parse(t,!1,!0),t=e}for(var r,n=new Sr,o=Object.keys(this),i=0;o.length>i;i++){var a=o[i];n[a]=this[a]}if(n.hash=t.hash,""===t.href)return n.href=n.format(),n;if(t.slashes&&!t.protocol){for(var s=Object.keys(t),u=0;s.length>u;u++){var c=s[u];"protocol"!==c&&(n[c]=t[c])}return Lr[n.protocol]&&n.hostname&&!n.pathname&&(n.path=n.pathname="/"),n.href=n.format(),n}if(t.protocol&&t.protocol!==n.protocol){if(!Lr[t.protocol]){for(var h=Object.keys(t),f=0;h.length>f;f++){var p=h[f];n[p]=t[p]}return n.href=n.format(),n}if(n.protocol=t.protocol,t.host||xr[t.protocol])n.pathname=t.pathname;else{for(r=(t.pathname||"").split("/");r.length&&!(t.host=r.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),""!==r[0]&&r.unshift(""),2>r.length&&r.unshift(""),n.pathname=r.join("/")}if(n.search=t.search,n.query=t.query,n.host=t.host||"",n.auth=t.auth,n.hostname=t.hostname||t.host,n.port=t.port,n.pathname||n.search)n.path=(n.pathname||"")+(n.search||"");return n.slashes=n.slashes||t.slashes,n.href=n.format(),n}var l,d=n.pathname&&"/"===n.pathname.charAt(0),v=t.host||t.pathname&&"/"===t.pathname.charAt(0),m=v||d||n.host&&t.pathname,g=m,y=n.pathname&&n.pathname.split("/")||[],w=n.protocol&&!Lr[n.protocol];if(r=t.pathname&&t.pathname.split("/")||[],w&&(n.hostname="",n.port=null,n.host&&(""===y[0]?y[0]=n.host:y.unshift(n.host)),n.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(""===r[0]?r[0]=t.host:r.unshift(t.host)),t.host=null),m=m&&(""===r[0]||""===y[0])),v)n.host=t.host||""===t.host?t.host:n.host,n.hostname=t.hostname||""===t.hostname?t.hostname:n.hostname,n.search=t.search,n.query=t.query,y=r;else if(r.length)y||(y=[]),y.pop(),y=y.concat(r),n.search=t.search,n.query=t.query;else if(null!=t.search)return w&&(n.hostname=n.host=y.shift(),(l=!(!n.host||0>=n.host.indexOf("@"))&&n.host.split("@"))&&(n.auth=l.shift(),n.host=n.hostname=l.shift())),n.search=t.search,n.query=t.query,lr(n.pathname)&&lr(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n;if(!y.length)return n.pathname=null,n.path=n.search?"/"+n.search:null,n.href=n.format(),n;for(var I=y.slice(-1)[0],E=(n.host||t.host||y.length>1)&&("."===I||".."===I)||""===I,b=0,S=y.length;S>=0;S--)"."===(I=y[S])?y.splice(S,1):".."===I?(y.splice(S,1),b++):b&&(y.splice(S,1),b--);if(!m&&!g)for(;b--;b)y.unshift("..");!m||""===y[0]||y[0]&&"/"===y[0].charAt(0)||y.unshift(""),E&&"/"!==y.join("/").substr(-1)&&y.push("");var A=""===y[0]||y[0]&&"/"===y[0].charAt(0);return w&&(n.hostname=n.host=A?"":y.length?y.shift():"",(l=!(!n.host||0>=n.host.indexOf("@"))&&n.host.split("@"))&&(n.auth=l.shift(),n.host=n.hostname=l.shift())),(m=m||n.host&&y.length)&&!A&&y.unshift(""),y.length?n.pathname=y.join("/"):(n.pathname=null,n.path=null),lr(n.pathname)&&lr(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=t.auth||n.auth,n.slashes=n.slashes||t.slashes,n.href=n.format(),n},Sr.prototype.parseHost=function(){return Dr(this)};var qr=function(t){var e=br.parse(t);return{host:e.hostname,path:e.pathname}},Fr=p.Some,zr=p.None;function Kr(t){return"1"===t||"true"===t}function Hr(t){try{return new Fr(parseInt(t))}catch(t){return zr}}function Vr(t){throw Error("HttpServerInstrumentation: Missing required argument ".concat(t,"."))}var Jr={addZipkinHeaders:function(t,e){var r=function(t,e){var r=t.headers||{};return r[Kt.TraceId]=e.traceId,r[Kt.SpanId]=e.spanId,e._parentId.ifPresent(function(t){r[Kt.ParentSpanId]=t}),e.sampled.ifPresent(function(t){r[Kt.Sampled]=t?"1":"0"}),e.isDebug()&&(r[Kt.Flags]="1"),r}(t,e);return Object.assign({},t,{headers:r})}};var Xr={HttpServer:function(){function t(e){var n=e.tracer,o=void 0===n?Vr("tracer"):n,i=e.serviceName,a=void 0===i?o.localEndpoint.serviceName:i,s=e.host,u=e.port,c=void 0===u?Vr("port"):u;r(this,t),this.tracer=o,this.serviceName=a,this.host=s&&new V(s),this.port=c}return o(t,[{key:"_createIdFromHeaders",value:function(t){var e=this;if(function(t){return t(Kt.TraceId)!==zr&&t(Kt.SpanId)!==zr}(t)){var r=t(Kt.SpanId).map(function(e){var r=t(Kt.TraceId),n=t(Kt.ParentSpanId),o=t(Kt.Sampled),i=t(Kt.Flags).flatMap(Hr).getOrElse(0);return new At({traceId:r,parentId:n,spanId:e,sampled:o.map(Kr),flags:i})});return this.tracer.supportsJoin?r:r.map(function(t){return e.tracer.letId(t,function(){return e.tracer.createChildId()})})}if(t(Kt.Flags)!==zr||t(Kt.Sampled)!==zr){var n=t(Kt.Sampled)===zr?zr:t(Kt.Sampled).map(Kr),o=t(Kt.Flags).flatMap(Hr).getOrElse(0);return new Fr(this.tracer.createRootId(n,1===o))}return new Fr(this.tracer.createRootId())}},{key:"recordRequest",value:function(t,e,r){var n=this;this._createIdFromHeaders(r).ifPresent(function(t){return n.tracer.setId(t)});var o=this.tracer.id,i=qr(e).path;return this.tracer.recordServiceName(this.serviceName),this.tracer.recordRpc(t.toUpperCase()),this.tracer.recordBinary("http.path",i),this.tracer.recordAnnotation(new lt.ServerRecv),this.tracer.recordAnnotation(new lt.LocalAddr({host:this.host,port:this.port})),o}},{key:"recordResponse",value:function(t,e,r){this.tracer.setId(t),this.tracer.recordBinary("http.status_code",""+e),r?this.tracer.recordBinary("error",""+r):(200>e||e>399)&&this.tracer.recordBinary("error",""+e),this.tracer.recordAnnotation(new lt.ServerSend)}}]),t}(),HttpClient:function(){function t(e){var n=e.tracer,o=void 0===n?function(t){throw Error("HttpClientInstrumentation: Missing required argument ".concat(t,"."))}("tracer"):n,i=e.serviceName,a=void 0===i?o.localEndpoint.serviceName:i,s=e.remoteServiceName;r(this,t),this.tracer=o,this.serviceName=a,this.remoteServiceName=s}return o(t,[{key:"recordRequest",value:function(t,e,r){this.tracer.setId(this.tracer.createChildId());var n=this.tracer.id,o=qr(e).path;return this.tracer.recordServiceName(this.serviceName),this.tracer.recordRpc(r.toUpperCase()),this.tracer.recordBinary("http.path",o),this.tracer.recordAnnotation(new lt.ClientSend),this.remoteServiceName&&this.tracer.recordAnnotation(new lt.ServerAddr({serviceName:this.remoteServiceName})),Jr.addZipkinHeaders(t,n)}},{key:"recordResponse",value:function(t,e){this.tracer.setId(t),this.tracer.recordBinary("http.status_code",""+e),(200>e||e>399)&&this.tracer.recordBinary("error",""+e),this.tracer.recordAnnotation(new lt.ClientRecv)}},{key:"recordError",value:function(t,e){this.tracer.setId(t),this.tracer.recordBinary("error",""+e),this.tracer.recordAnnotation(new lt.ClientRecv)}}]),t}()};function Zr(t){if(void 0!==t){var e={serviceName:t.serviceName||""};return t.ipv4&&(e.ipv4=t.ipv4),t.port&&(e.port=t.port),e}}var $r={JSON_V1:{encode:function(t){return function(t){var e={traceId:t.traceId};t.parentId&&(e.parentId=t.parentId),e.id=t.id,e.name=t.name||"",t.shared||(e.timestamp=t.timestamp,e.duration=t.duration);var r,n,o,i=Zr(t.localEndpoint);switch(t.kind){case"CLIENT":r=t.timestamp?"cs":void 0,n="cr",o="sa";break;case"SERVER":r=t.timestamp?"sr":void 0,n="ss",o="ca";break;case"PRODUCER":r=t.timestamp?"ms":void 0,n="ws",o="ma";break;case"CONSUMER":t.timestamp&&t.duration?(r="wr",n="mr"):t.timestamp&&(r="mr"),o="ma"}(t.annotations.length>0||r)&&(e.annotations=t.annotations.map(function(t){return function(t,e){return{value:t.value,timestamp:t.timestamp,endpoint:e}}(t,i)})),r&&(e.annotations.push({value:r,timestamp:t.timestamp,endpoint:i}),t.duration&&e.annotations.push({value:n,timestamp:t.timestamp+t.duration,endpoint:i}));var a=Object.keys(t.tags);if((a.length>0||t.remoteEndpoint)&&(e.binaryAnnotations=a.map(function(e){return{key:e,value:t.tags[e],endpoint:i}})),t.remoteEndpoint){var s={key:o,value:!0,endpoint:Zr(t.remoteEndpoint)};e.binaryAnnotations.push(s)}return t.debug&&(e.debug=!0),JSON.stringify(e)}(t)}},JSON_V2:{encode:function(t){return function(t){var e={traceId:t.traceId};return t.parentId&&(e.parentId=t.parentId),e.id=t.id,t.name&&(e.name=t.name),t.kind&&(e.kind=t.kind),t.timestamp&&(e.timestamp=t.timestamp),t.duration&&(e.duration=t.duration),t.localEndpoint&&(e.localEndpoint=t.localEndpoint),t.remoteEndpoint&&(e.remoteEndpoint=t.remoteEndpoint),t.annotations.length>0&&(e.annotations=t.annotations),Object.keys(t.tags).length>0&&(e.tags=t.tags),t.debug&&(e.debug=!0),t.shared&&(e.shared=!0),JSON.stringify(e)}(t)}}};t.option=p,t.Annotation=lt,t.Tracer=Ft,t.createNoopTracer=function(){var t=new zt;return new Ft({recorder:{record:function(){}},ctxImpl:t})},t.randomTraceId=Rt,t.sampler=yt,t.TraceId=At,t.HttpHeaders=Kt,t.InetAddress=V,t.BatchRecorder=$t,t.ConsoleRecorder=Gt,t.ExplicitContext=zt,t.Instrumentation=Xr,t.Request=Jr,t.jsonEncoder=$r,t.model=Pt,t.parseRequestUrl=qr,Object.defineProperty(t,"__esModule",{value:!0})}); |
@@ -1968,20 +1968,2 @@ import os from 'os'; | ||
module.exports = { | ||
Tracer: tracer, | ||
createNoopTracer: noop, | ||
randomTraceId: randomTraceId_1, | ||
TraceId: TraceId_1, | ||
option: option, | ||
Annotation: annotation_1, | ||
InetAddress: InetAddress_1, | ||
HttpHeaders: httpHeaders, | ||
BatchRecorder: batchRecorder, | ||
ConsoleRecorder: consoleRecorder, | ||
ExplicitContext: explicitContext, | ||
sampler: sampler, | ||
Request: request, | ||
Instrumentation: instrumentation, | ||
model: model, | ||
jsonEncoder: jsonEncoder, | ||
parseRequestUrl: parseUrl | ||
}; | ||
export { option, annotation_1 as Annotation, tracer as Tracer, noop as createNoopTracer, randomTraceId_1 as randomTraceId, sampler, TraceId_1 as TraceId, httpHeaders as HttpHeaders, InetAddress_1 as InetAddress, batchRecorder as BatchRecorder, consoleRecorder as ConsoleRecorder, explicitContext as ExplicitContext, instrumentation as Instrumentation, request as Request, jsonEncoder, model, parseUrl as parseRequestUrl }; |
'use strict'; | ||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } | ||
@@ -1972,20 +1974,18 @@ | ||
module.exports = { | ||
Tracer: tracer, | ||
createNoopTracer: noop, | ||
randomTraceId: randomTraceId_1, | ||
TraceId: TraceId_1, | ||
option: option, | ||
Annotation: annotation_1, | ||
InetAddress: InetAddress_1, | ||
HttpHeaders: httpHeaders, | ||
BatchRecorder: batchRecorder, | ||
ConsoleRecorder: consoleRecorder, | ||
ExplicitContext: explicitContext, | ||
sampler: sampler, | ||
Request: request, | ||
Instrumentation: instrumentation, | ||
model: model, | ||
jsonEncoder: jsonEncoder, | ||
parseRequestUrl: parseUrl | ||
}; | ||
exports.option = option; | ||
exports.Annotation = annotation_1; | ||
exports.Tracer = tracer; | ||
exports.createNoopTracer = noop; | ||
exports.randomTraceId = randomTraceId_1; | ||
exports.sampler = sampler; | ||
exports.TraceId = TraceId_1; | ||
exports.HttpHeaders = httpHeaders; | ||
exports.InetAddress = InetAddress_1; | ||
exports.BatchRecorder = batchRecorder; | ||
exports.ConsoleRecorder = consoleRecorder; | ||
exports.ExplicitContext = explicitContext; | ||
exports.Instrumentation = instrumentation; | ||
exports.Request = request; | ||
exports.jsonEncoder = jsonEncoder; | ||
exports.model = model; | ||
exports.parseRequestUrl = parseUrl; |
{ | ||
"name": "zipkin", | ||
"version": "0.16.0", | ||
"version": "0.16.1", | ||
"description": "The core tracer for zipkin.js", | ||
@@ -39,3 +39,3 @@ "main": "lib/index.js", | ||
}, | ||
"gitHead": "9e0eee22a07156056656c2eeca8b4f94d5dbed34" | ||
"gitHead": "9be8a88f4f3c33030cb327088453db34b87f9a60" | ||
} |
@@ -6,2 +6,3 @@ import babel from 'rollup-plugin-babel'; | ||
import {terser} from 'rollup-plugin-terser'; | ||
import globals from 'rollup-plugin-node-globals'; | ||
import builtins from 'rollup-plugin-node-builtins'; | ||
@@ -49,2 +50,3 @@ | ||
}), | ||
globals(), | ||
builtins(), | ||
@@ -74,2 +76,3 @@ ]), | ||
}), | ||
globals(), | ||
builtins(), | ||
@@ -76,0 +79,0 @@ ]), |
@@ -1,43 +0,23 @@ | ||
import option from './option'; | ||
export { default as option } from './option'; | ||
import Annotation from './annotation'; | ||
import Tracer from './tracer'; | ||
import createNoopTracer from './tracer/noop'; | ||
import randomTraceId from './tracer/randomTraceId'; | ||
import sampler from './tracer/sampler'; | ||
import TraceId from './tracer/TraceId'; | ||
export { default as Annotation } from './annotation'; | ||
export { default as Tracer } from './tracer'; | ||
export { default as createNoopTracer } from './tracer/noop'; | ||
export { default as randomTraceId } from './tracer/randomTraceId'; | ||
export { default as sampler } from './tracer/sampler'; | ||
export { default as TraceId } from './tracer/TraceId'; | ||
import HttpHeaders from './httpHeaders'; | ||
import InetAddress from './InetAddress'; | ||
export { default as HttpHeaders } from './httpHeaders'; | ||
export { default as InetAddress } from './InetAddress'; | ||
import BatchRecorder from './batch-recorder'; | ||
import ConsoleRecorder from './console-recorder'; | ||
export { default as BatchRecorder } from './batch-recorder'; | ||
export { default as ConsoleRecorder } from './console-recorder'; | ||
import ExplicitContext from './explicit-context'; | ||
export { default as ExplicitContext } from './explicit-context'; | ||
import Instrumentation from './instrumentation'; | ||
import Request from './request'; | ||
export { default as Instrumentation } from './instrumentation'; | ||
export { default as Request } from './request'; | ||
import jsonEncoder from './jsonEncoder'; | ||
import model from './model'; | ||
import parseRequestUrl from './parseUrl'; | ||
module.exports = { | ||
Tracer, | ||
createNoopTracer, | ||
randomTraceId, | ||
TraceId, | ||
option, | ||
Annotation, | ||
InetAddress, | ||
HttpHeaders, | ||
BatchRecorder, | ||
ConsoleRecorder, | ||
ExplicitContext, | ||
sampler, | ||
Request, | ||
Instrumentation, | ||
model, | ||
jsonEncoder, | ||
parseRequestUrl | ||
}; | ||
export { default as jsonEncoder } from './jsonEncoder'; | ||
export { default as model } from './model'; | ||
export { default as parseRequestUrl } from './parseUrl'; |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2484075
21402