Skip to content

Instantly share code, notes, and snippets.

@martin308
Created May 6, 2020 17:50
Show Gist options
  • Save martin308/2ef8019bfd973e4c27b6d30e5b568866 to your computer and use it in GitHub Desktop.
Save martin308/2ef8019bfd973e4c27b6d30e5b568866 to your computer and use it in GitHub Desktop.
!function(t){function e(e){for(var r,s,i=e[0],o=e[1],a=0,u=[];a<i.length;a++)s=i[a],Object.prototype.hasOwnProperty.call(n,s)&&n[s]&&u.push(n[s][0]),n[s]=0;for(r in o)Object.prototype.hasOwnProperty.call(o,r)&&(t[r]=o[r]);for(h&&h(e);u.length;)u.shift()()}var r={},n={0:0};function s(e){if(r[e])return r[e].exports;var n=r[e]={i:e,l:!1,exports:{}};return t[e].call(n.exports,n,n.exports,s),n.l=!0,n.exports}s.m=t,s.c=r,s.d=function(t,e,r){s.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},s.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},s.t=function(t,e){if(1&e&&(t=s(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(s.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)s.d(r,n,function(e){return t[e]}.bind(null,n));return r},s.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return s.d(e,"a",e),e},s.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},s.p="",s.oe=function(t){throw console.error(t),t};var i=window.webpackJsonp=window.webpackJsonp||[],o=i.push.bind(i);i.push=e,i=i.slice();for(var a=0;a<i.length;a++)e(i[a]);var h=o;s(s.s=20)}([function(t,e,r){(function(t){function r(t,e){for(var r=0,n=t.length-1;n>=0;n--){var s=t[n];"."===s?t.splice(n,1):".."===s?(t.splice(n,1),r++):r&&(t.splice(n,1),r--)}if(e)for(;r--;r)t.unshift("..");return t}function n(t,e){if(t.filter)return t.filter(e);for(var r=[],n=0;n<t.length;n++)e(t[n],n,t)&&r.push(t[n]);return r}e.resolve=function(){for(var e="",s=!1,i=arguments.length-1;i>=-1&&!s;i--){var o=i>=0?arguments[i]:t.cwd();if("string"!=typeof o)throw new TypeError("Arguments to path.resolve must be strings");o&&(e=o+"/"+e,s="/"===o.charAt(0))}return(s?"/":"")+(e=r(n(e.split("/"),(function(t){return!!t})),!s).join("/"))||"."},e.normalize=function(t){var i=e.isAbsolute(t),o="/"===s(t,-1);return(t=r(n(t.split("/"),(function(t){return!!t})),!i).join("/"))||i||(t="."),t&&o&&(t+="/"),(i?"/":"")+t},e.isAbsolute=function(t){return"/"===t.charAt(0)},e.join=function(){var t=Array.prototype.slice.call(arguments,0);return e.normalize(n(t,(function(t,e){if("string"!=typeof t)throw new TypeError("Arguments to path.join must be strings");return t})).join("/"))},e.relative=function(t,r){function n(t){for(var e=0;e<t.length&&""===t[e];e++);for(var r=t.length-1;r>=0&&""===t[r];r--);return e>r?[]:t.slice(e,r-e+1)}t=e.resolve(t).substr(1),r=e.resolve(r).substr(1);for(var s=n(t.split("/")),i=n(r.split("/")),o=Math.min(s.length,i.length),a=o,h=0;h<o;h++)if(s[h]!==i[h]){a=h;break}var u=[];for(h=a;h<s.length;h++)u.push("..");return(u=u.concat(i.slice(a))).join("/")},e.sep="/",e.delimiter=":",e.dirname=function(t){if("string"!=typeof t&&(t+=""),0===t.length)return".";for(var e=t.charCodeAt(0),r=47===e,n=-1,s=!0,i=t.length-1;i>=1;--i)if(47===(e=t.charCodeAt(i))){if(!s){n=i;break}}else s=!1;return-1===n?r?"/":".":r&&1===n?"/":t.slice(0,n)},e.basename=function(t,e){var r=function(t){"string"!=typeof t&&(t+="");var e,r=0,n=-1,s=!0;for(e=t.length-1;e>=0;--e)if(47===t.charCodeAt(e)){if(!s){r=e+1;break}}else-1===n&&(s=!1,n=e+1);return-1===n?"":t.slice(r,n)}(t);return e&&r.substr(-1*e.length)===e&&(r=r.substr(0,r.length-e.length)),r},e.extname=function(t){"string"!=typeof t&&(t+="");for(var e=-1,r=0,n=-1,s=!0,i=0,o=t.length-1;o>=0;--o){var a=t.charCodeAt(o);if(47!==a)-1===n&&(s=!1,n=o+1),46===a?-1===e?e=o:1!==i&&(i=1):-1!==e&&(i=-1);else if(!s){r=o+1;break}}return-1===e||-1===n||0===i||1===i&&e===n-1&&e===r+1?"":t.slice(e,n)};var s="b"==="ab".substr(-1)?function(t,e,r){return t.substr(e,r)}:function(t,e,r){return e<0&&(e=t.length+e),t.substr(e,r)}}).call(this,r(3))},function(t,e,r){"use strict";var n=r(13),s=r(15);function i(){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}e.parse=_,e.resolve=function(t,e){return _(t,!1,!0).resolve(e)},e.resolveObject=function(t,e){return t?_(t,!1,!0).resolveObject(e):e},e.format=function(t){s.isString(t)&&(t=_(t));return t instanceof i?t.format():i.prototype.format.call(t)},e.Url=i;var o=/^([a-z0-9.+-]+:)/i,a=/:[0-9]*$/,h=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,u=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),l=["'"].concat(u),c=["%","/","?",";","#"].concat(l),p=["/","?","#"],f=/^[+a-z0-9A-Z_-]{0,63}$/,d=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,m={javascript:!0,"javascript:":!0},y={javascript:!0,"javascript:":!0},v={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},b=r(16);function _(t,e,r){if(t&&s.isObject(t)&&t instanceof i)return t;var n=new i;return n.parse(t,e,r),n}i.prototype.parse=function(t,e,r){if(!s.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var i=t.indexOf("?"),a=-1!==i&&i<t.indexOf("#")?"?":"#",u=t.split(a);u[0]=u[0].replace(/\\/g,"/");var _=t=u.join(a);if(_=_.trim(),!r&&1===t.split("#").length){var g=h.exec(_);if(g)return this.path=_,this.href=_,this.pathname=g[1],g[2]?(this.search=g[2],this.query=e?b.parse(this.search.substr(1)):this.search.substr(1)):e&&(this.search="",this.query={}),this}var w=o.exec(_);if(w){var T=(w=w[0]).toLowerCase();this.protocol=T,_=_.substr(w.length)}if(r||w||_.match(/^\/\/[^@\/]+@[^@\/]+/)){var x="//"===_.substr(0,2);!x||w&&y[w]||(_=_.substr(2),this.slashes=!0)}if(!y[w]&&(x||w&&!v[w])){for(var O,E,j=-1,C=0;C<p.length;C++){-1!==(k=_.indexOf(p[C]))&&(-1===j||k<j)&&(j=k)}-1!==(E=-1===j?_.lastIndexOf("@"):_.lastIndexOf("@",j))&&(O=_.slice(0,E),_=_.slice(E+1),this.auth=decodeURIComponent(O)),j=-1;for(C=0;C<c.length;C++){var k;-1!==(k=_.indexOf(c[C]))&&(-1===j||k<j)&&(j=k)}-1===j&&(j=_.length),this.host=_.slice(0,j),_=_.slice(j),this.parseHost(),this.hostname=this.hostname||"";var A="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!A)for(var R=this.hostname.split(/\./),P=(C=0,R.length);C<P;C++){var L=R[C];if(L&&!L.match(f)){for(var S="",q=0,H=L.length;q<H;q++)L.charCodeAt(q)>127?S+="x":S+=L[q];if(!S.match(f)){var D=R.slice(0,C),I=R.slice(C+1),F=L.match(d);F&&(D.push(F[1]),I.unshift(F[2])),I.length&&(_="/"+I.join(".")+_),this.hostname=D.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),A||(this.hostname=n.toASCII(this.hostname));var N=this.port?":"+this.port:"",z=this.hostname||"";this.host=z+N,this.href+=this.host,A&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==_[0]&&(_="/"+_))}if(!m[T])for(C=0,P=l.length;C<P;C++){var U=l[C];if(-1!==_.indexOf(U)){var M=encodeURIComponent(U);M===U&&(M=escape(U)),_=_.split(U).join(M)}}var K=_.indexOf("#");-1!==K&&(this.hash=_.substr(K),_=_.slice(0,K));var B=_.indexOf("?");if(-1!==B?(this.search=_.substr(B),this.query=_.substr(B+1),e&&(this.query=b.parse(this.query)),_=_.slice(0,B)):e&&(this.search="",this.query={}),_&&(this.pathname=_),v[T]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){N=this.pathname||"";var Q=this.search||"";this.path=N+Q}return this.href=this.format(),this},i.prototype.format=function(){var t=this.auth||"";t&&(t=(t=encodeURIComponent(t)).replace(/%3A/i,":"),t+="@");var e=this.protocol||"",r=this.pathname||"",n=this.hash||"",i=!1,o="";this.host?i=t+this.host:this.hostname&&(i=t+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(i+=":"+this.port)),this.query&&s.isObject(this.query)&&Object.keys(this.query).length&&(o=b.stringify(this.query));var a=this.search||o&&"?"+o||"";return e&&":"!==e.substr(-1)&&(e+=":"),this.slashes||(!e||v[e])&&!1!==i?(i="//"+(i||""),r&&"/"!==r.charAt(0)&&(r="/"+r)):i||(i=""),n&&"#"!==n.charAt(0)&&(n="#"+n),a&&"?"!==a.charAt(0)&&(a="?"+a),e+i+(r=r.replace(/[?#]/g,(function(t){return encodeURIComponent(t)})))+(a=a.replace("#","%23"))+n},i.prototype.resolve=function(t){return this.resolveObject(_(t,!1,!0)).format()},i.prototype.resolveObject=function(t){if(s.isString(t)){var e=new i;e.parse(t,!1,!0),t=e}for(var r=new i,n=Object.keys(this),o=0;o<n.length;o++){var a=n[o];r[a]=this[a]}if(r.hash=t.hash,""===t.href)return r.href=r.format(),r;if(t.slashes&&!t.protocol){for(var h=Object.keys(t),u=0;u<h.length;u++){var l=h[u];"protocol"!==l&&(r[l]=t[l])}return v[r.protocol]&&r.hostname&&!r.pathname&&(r.path=r.pathname="/"),r.href=r.format(),r}if(t.protocol&&t.protocol!==r.protocol){if(!v[t.protocol]){for(var c=Object.keys(t),p=0;p<c.length;p++){var f=c[p];r[f]=t[f]}return r.href=r.format(),r}if(r.protocol=t.protocol,t.host||y[t.protocol])r.pathname=t.pathname;else{for(var d=(t.pathname||"").split("/");d.length&&!(t.host=d.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),""!==d[0]&&d.unshift(""),d.length<2&&d.unshift(""),r.pathname=d.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){var m=r.pathname||"",b=r.search||"";r.path=m+b}return r.slashes=r.slashes||t.slashes,r.href=r.format(),r}var _=r.pathname&&"/"===r.pathname.charAt(0),g=t.host||t.pathname&&"/"===t.pathname.charAt(0),w=g||_||r.host&&t.pathname,T=w,x=r.pathname&&r.pathname.split("/")||[],O=(d=t.pathname&&t.pathname.split("/")||[],r.protocol&&!v[r.protocol]);if(O&&(r.hostname="",r.port=null,r.host&&(""===x[0]?x[0]=r.host:x.unshift(r.host)),r.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(""===d[0]?d[0]=t.host:d.unshift(t.host)),t.host=null),w=w&&(""===d[0]||""===x[0])),g)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,x=d;else if(d.length)x||(x=[]),x.pop(),x=x.concat(d),r.search=t.search,r.query=t.query;else if(!s.isNullOrUndefined(t.search)){if(O)r.hostname=r.host=x.shift(),(A=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=A.shift(),r.host=r.hostname=A.shift());return r.search=t.search,r.query=t.query,s.isNull(r.pathname)&&s.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!x.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var E=x.slice(-1)[0],j=(r.host||t.host||x.length>1)&&("."===E||".."===E)||""===E,C=0,k=x.length;k>=0;k--)"."===(E=x[k])?x.splice(k,1):".."===E?(x.splice(k,1),C++):C&&(x.splice(k,1),C--);if(!w&&!T)for(;C--;C)x.unshift("..");!w||""===x[0]||x[0]&&"/"===x[0].charAt(0)||x.unshift(""),j&&"/"!==x.join("/").substr(-1)&&x.push("");var A,R=""===x[0]||x[0]&&"/"===x[0].charAt(0);O&&(r.hostname=r.host=R?"":x.length?x.shift():"",(A=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=A.shift(),r.host=r.hostname=A.shift()));return(w=w||r.host&&x.length)&&!R&&x.unshift(""),x.length?r.pathname=x.join("/"):(r.pathname=null,r.path=null),s.isNull(r.pathname)&&s.isNull(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},i.prototype.parseHost=function(){var t=this.host,e=a.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)}},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e){var r,n,s=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function a(t){if(r===setTimeout)return setTimeout(t,0);if((r===i||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:i}catch(t){r=i}try{n="function"==typeof clearTimeout?clearTimeout:o}catch(t){n=o}}();var h,u=[],l=!1,c=-1;function p(){l&&h&&(l=!1,h.length?u=h.concat(u):c=-1,u.length&&f())}function f(){if(!l){var t=a(p);l=!0;for(var e=u.length;e;){for(h=u,u=[];++c<e;)h&&h[c].run();c=-1,e=u.length}h=null,l=!1,function(t){if(n===clearTimeout)return clearTimeout(t);if((n===o||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(t);try{n(t)}catch(e){try{return n.call(null,t)}catch(e){return n.call(this,t)}}}(t)}}function d(t,e){this.fun=t,this.array=e}function m(){}s.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];u.push(new d(t,e)),1!==u.length||l||a(f)},d.prototype.run=function(){this.fun.apply(null,this.array)},s.title="browser",s.browser=!0,s.env={},s.argv=[],s.version="",s.versions={},s.on=m,s.addListener=m,s.once=m,s.off=m,s.removeListener=m,s.removeAllListeners=m,s.emit=m,s.prependListener=m,s.prependOnceListener=m,s.listeners=function(t){return[]},s.binding=function(t){throw new Error("process.binding is not supported")},s.cwd=function(){return"/"},s.chdir=function(t){throw new Error("process.chdir is not supported")},s.umask=function(){return 0}},function(t,e,r){"use strict";t.exports=function(t){return null!==t&&"object"==typeof t}},function(t,e,r){var n;"undefined"!=typeof window?n=window:"undefined"!=typeof self?n=self:(console.warn("Using browser-only version of superagent in non-browser environment"),n=this);var s=r(8),i=r(9),o=r(4),a=r(10),h=r(12);function u(){}var l=e=t.exports=function(t,r){return"function"==typeof r?new e.Request("GET",t).end(r):1==arguments.length?new e.Request("GET",t):new e.Request(t,r)};e.Request=v,l.getXHR=function(){if(!(!n.XMLHttpRequest||n.location&&"file:"==n.location.protocol&&n.ActiveXObject))return new XMLHttpRequest;try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(t){}try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(t){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(t){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(t){}throw Error("Browser-only version of superagent could not find XHR")};var c="".trim?function(t){return t.trim()}:function(t){return t.replace(/(^\s*|\s*$)/g,"")};function p(t){if(!o(t))return t;var e=[];for(var r in t)f(e,r,t[r]);return e.join("&")}function f(t,e,r){if(null!=r)if(Array.isArray(r))r.forEach((function(r){f(t,e,r)}));else if(o(r))for(var n in r)f(t,e+"["+n+"]",r[n]);else t.push(encodeURIComponent(e)+"="+encodeURIComponent(r));else null===r&&t.push(encodeURIComponent(e))}function d(t){for(var e,r,n={},s=t.split("&"),i=0,o=s.length;i<o;++i)-1==(r=(e=s[i]).indexOf("="))?n[decodeURIComponent(e)]="":n[decodeURIComponent(e.slice(0,r))]=decodeURIComponent(e.slice(r+1));return n}function m(t){return/[\/+]json($|[^-\w])/.test(t)}function y(t){this.req=t,this.xhr=this.req.xhr,this.text="HEAD"!=this.req.method&&(""===this.xhr.responseType||"text"===this.xhr.responseType)||void 0===this.xhr.responseType?this.xhr.responseText:null,this.statusText=this.req.xhr.statusText;var e=this.xhr.status;1223===e&&(e=204),this._setStatusProperties(e),this.header=this.headers=function(t){for(var e,r,n,s,i=t.split(/\r?\n/),o={},a=0,h=i.length;a<h;++a)-1!==(e=(r=i[a]).indexOf(":"))&&(n=r.slice(0,e).toLowerCase(),s=c(r.slice(e+1)),o[n]=s);return o}(this.xhr.getAllResponseHeaders()),this.header["content-type"]=this.xhr.getResponseHeader("content-type"),this._setHeaderProperties(this.header),null===this.text&&t._responseType?this.body=this.xhr.response:this.body="HEAD"!=this.req.method?this._parseBody(this.text?this.text:this.xhr.response):null}function v(t,e){var r=this;this._query=this._query||[],this.method=t,this.url=e,this.header={},this._header={},this.on("end",(function(){var t,e=null,n=null;try{n=new y(r)}catch(t){return(e=new Error("Parser is unable to parse the response")).parse=!0,e.original=t,r.xhr?(e.rawResponse=void 0===r.xhr.responseType?r.xhr.responseText:r.xhr.response,e.status=r.xhr.status?r.xhr.status:null,e.statusCode=e.status):(e.rawResponse=null,e.status=null),r.callback(e)}r.emit("response",n);try{r._isResponseOK(n)||(t=new Error(n.statusText||"Unsuccessful HTTP response"))}catch(e){t=e}t?(t.original=e,t.response=n,t.status=n.status,r.callback(t,n)):r.callback(null,n)}))}function b(t,e,r){var n=l("DELETE",t);return"function"==typeof e&&(r=e,e=null),e&&n.send(e),r&&n.end(r),n}l.serializeObject=p,l.parseString=d,l.types={html:"text/html",json:"application/json",xml:"text/xml",urlencoded:"application/x-www-form-urlencoded",form:"application/x-www-form-urlencoded","form-data":"application/x-www-form-urlencoded"},l.serialize={"application/x-www-form-urlencoded":p,"application/json":JSON.stringify},l.parse={"application/x-www-form-urlencoded":d,"application/json":JSON.parse},a(y.prototype),y.prototype._parseBody=function(t){var e=l.parse[this.type];return this.req._parser?this.req._parser(this,t):(!e&&m(this.type)&&(e=l.parse["application/json"]),e&&t&&(t.length||t instanceof Object)?e(t):null)},y.prototype.toError=function(){var t=this.req,e=t.method,r=t.url,n="cannot "+e+" "+r+" ("+this.status+")",s=new Error(n);return s.status=this.status,s.method=e,s.url=r,s},l.Response=y,s(v.prototype),i(v.prototype),v.prototype.type=function(t){return this.set("Content-Type",l.types[t]||t),this},v.prototype.accept=function(t){return this.set("Accept",l.types[t]||t),this},v.prototype.auth=function(t,e,r){1===arguments.length&&(e=""),"object"==typeof e&&null!==e&&(r=e,e=""),r||(r={type:"function"==typeof btoa?"basic":"auto"});var n=function(t){if("function"==typeof btoa)return btoa(t);throw new Error("Cannot use basic auth, btoa is not a function")};return this._auth(t,e,r,n)},v.prototype.query=function(t){return"string"!=typeof t&&(t=p(t)),t&&this._query.push(t),this},v.prototype.attach=function(t,e,r){if(e){if(this._data)throw Error("superagent can't mix .send() and .attach()");this._getFormData().append(t,e,r||e.name)}return this},v.prototype._getFormData=function(){return this._formData||(this._formData=new n.FormData),this._formData},v.prototype.callback=function(t,e){if(this._shouldRetry(t,e))return this._retry();var r=this._callback;this.clearTimeout(),t&&(this._maxRetries&&(t.retries=this._retries-1),this.emit("error",t)),r(t,e)},v.prototype.crossDomainError=function(){var t=new Error("Request has been terminated\nPossible causes: the network is offline, Origin is not allowed by Access-Control-Allow-Origin, the page is being unloaded, etc.");t.crossDomain=!0,t.status=this.status,t.method=this.method,t.url=this.url,this.callback(t)},v.prototype.buffer=v.prototype.ca=v.prototype.agent=function(){return console.warn("This is not supported in browser version of superagent"),this},v.prototype.pipe=v.prototype.write=function(){throw Error("Streaming is not supported in browser version of superagent")},v.prototype._isHost=function(t){return t&&"object"==typeof t&&!Array.isArray(t)&&"[object Object]"!==Object.prototype.toString.call(t)},v.prototype.end=function(t){return this._endCalled&&console.warn("Warning: .end() was called twice. This is not supported in superagent"),this._endCalled=!0,this._callback=t||u,this._finalizeQueryString(),this._end()},v.prototype._end=function(){var t=this,e=this.xhr=l.getXHR(),r=this._formData||this._data;this._setTimeouts(),e.onreadystatechange=function(){var r=e.readyState;if(r>=2&&t._responseTimeoutTimer&&clearTimeout(t._responseTimeoutTimer),4==r){var n;try{n=e.status}catch(t){n=0}if(!n){if(t.timedout||t._aborted)return;return t.crossDomainError()}t.emit("end")}};var n=function(e,r){r.total>0&&(r.percent=r.loaded/r.total*100),r.direction=e,t.emit("progress",r)};if(this.hasListeners("progress"))try{e.onprogress=n.bind(null,"download"),e.upload&&(e.upload.onprogress=n.bind(null,"upload"))}catch(t){}try{this.username&&this.password?e.open(this.method,this.url,!0,this.username,this.password):e.open(this.method,this.url,!0)}catch(t){return this.callback(t)}if(this._withCredentials&&(e.withCredentials=!0),!this._formData&&"GET"!=this.method&&"HEAD"!=this.method&&"string"!=typeof r&&!this._isHost(r)){var s=this._header["content-type"],i=this._serializer||l.serialize[s?s.split(";")[0]:""];!i&&m(s)&&(i=l.serialize["application/json"]),i&&(r=i(r))}for(var o in this.header)null!=this.header[o]&&this.header.hasOwnProperty(o)&&e.setRequestHeader(o,this.header[o]);return this._responseType&&(e.responseType=this._responseType),this.emit("request",this),e.send(void 0!==r?r:null),this},l.agent=function(){return new h},["GET","POST","OPTIONS","PATCH","PUT","DELETE"].forEach((function(t){h.prototype[t.toLowerCase()]=function(e,r){var n=new l.Request(t,e);return this._setDefaults(n),r&&n.end(r),n}})),h.prototype.del=h.prototype.delete,l.get=function(t,e,r){var n=l("GET",t);return"function"==typeof e&&(r=e,e=null),e&&n.query(e),r&&n.end(r),n},l.head=function(t,e,r){var n=l("HEAD",t);return"function"==typeof e&&(r=e,e=null),e&&n.query(e),r&&n.end(r),n},l.options=function(t,e,r){var n=l("OPTIONS",t);return"function"==typeof e&&(r=e,e=null),e&&n.send(e),r&&n.end(r),n},l.del=b,l.delete=b,l.patch=function(t,e,r){var n=l("PATCH",t);return"function"==typeof e&&(r=e,e=null),e&&n.send(e),r&&n.end(r),n},l.post=function(t,e,r){var n=l("POST",t);return"function"==typeof e&&(r=e,e=null),e&&n.send(e),r&&n.end(r),n},l.put=function(t,e,r){var n=l("PUT",t);return"function"==typeof e&&(r=e,e=null),e&&n.send(e),r&&n.end(r),n}},function(t,e,r){"use strict";var n,s="object"==typeof Reflect?Reflect:null,i=s&&"function"==typeof s.apply?s.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};n=s&&"function"==typeof s.ownKeys?s.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var o=Number.isNaN||function(t){return t!=t};function a(){a.init.call(this)}t.exports=a,a.EventEmitter=a,a.prototype._events=void 0,a.prototype._eventsCount=0,a.prototype._maxListeners=void 0;var h=10;function u(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function l(t){return void 0===t._maxListeners?a.defaultMaxListeners:t._maxListeners}function c(t,e,r,n){var s,i,o,a;if(u(r),void 0===(i=t._events)?(i=t._events=Object.create(null),t._eventsCount=0):(void 0!==i.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),i=t._events),o=i[e]),void 0===o)o=i[e]=r,++t._eventsCount;else if("function"==typeof o?o=i[e]=n?[r,o]:[o,r]:n?o.unshift(r):o.push(r),(s=l(t))>0&&o.length>s&&!o.warned){o.warned=!0;var h=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");h.name="MaxListenersExceededWarning",h.emitter=t,h.type=e,h.count=o.length,a=h,console&&console.warn&&console.warn(a)}return t}function p(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function f(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},s=p.bind(n);return s.listener=r,n.wrapFn=s,s}function d(t,e,r){var n=t._events;if(void 0===n)return[];var s=n[e];return void 0===s?[]:"function"==typeof s?r?[s.listener||s]:[s]:r?function(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}(s):y(s,s.length)}function m(t){var e=this._events;if(void 0!==e){var r=e[t];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function y(t,e){for(var r=new Array(e),n=0;n<e;++n)r[n]=t[n];return r}Object.defineProperty(a,"defaultMaxListeners",{enumerable:!0,get:function(){return h},set:function(t){if("number"!=typeof t||t<0||o(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");h=t}}),a.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},a.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||o(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},a.prototype.getMaxListeners=function(){return l(this)},a.prototype.emit=function(t){for(var e=[],r=1;r<arguments.length;r++)e.push(arguments[r]);var n="error"===t,s=this._events;if(void 0!==s)n=n&&void 0===s.error;else if(!n)return!1;if(n){var o;if(e.length>0&&(o=e[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var h=s[t];if(void 0===h)return!1;if("function"==typeof h)i(h,this,e);else{var u=h.length,l=y(h,u);for(r=0;r<u;++r)i(l[r],this,e)}return!0},a.prototype.addListener=function(t,e){return c(this,t,e,!1)},a.prototype.on=a.prototype.addListener,a.prototype.prependListener=function(t,e){return c(this,t,e,!0)},a.prototype.once=function(t,e){return u(e),this.on(t,f(this,t,e)),this},a.prototype.prependOnceListener=function(t,e){return u(e),this.prependListener(t,f(this,t,e)),this},a.prototype.removeListener=function(t,e){var r,n,s,i,o;if(u(e),void 0===(n=this._events))return this;if(void 0===(r=n[t]))return this;if(r===e||r.listener===e)0==--this._eventsCount?this._events=Object.create(null):(delete n[t],n.removeListener&&this.emit("removeListener",t,r.listener||e));else if("function"!=typeof r){for(s=-1,i=r.length-1;i>=0;i--)if(r[i]===e||r[i].listener===e){o=r[i].listener,s=i;break}if(s<0)return this;0===s?r.shift():function(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}(r,s),1===r.length&&(n[t]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",t,o||e)}return this},a.prototype.off=a.prototype.removeListener,a.prototype.removeAllListeners=function(t){var e,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[t]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[t]),this;if(0===arguments.length){var s,i=Object.keys(r);for(n=0;n<i.length;++n)"removeListener"!==(s=i[n])&&this.removeAllListeners(s);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(e=r[t]))this.removeListener(t,e);else if(void 0!==e)for(n=e.length-1;n>=0;n--)this.removeListener(t,e[n]);return this},a.prototype.listeners=function(t){return d(this,t,!0)},a.prototype.rawListeners=function(t){return d(this,t,!1)},a.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):m.call(t,e)},a.prototype.listenerCount=m,a.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},function(t,e,r){"use strict";r.r(e),function(t,n){var s=r(5),i=r.n(s),o=r(1),a=r.n(o),h=r(0),u=r.n(h),l=r(6),c=Object.prototype.hasOwnProperty,p=Object.prototype.toString,f=Object.defineProperty,d=Object.getOwnPropertyDescriptor,m=function(t){return"function"==typeof Array.isArray?Array.isArray(t):"[object Array]"===p.call(t)},y=function(t){if(!t||"[object Object]"!==p.call(t))return!1;var e,r=c.call(t,"constructor"),n=t.constructor&&t.constructor.prototype&&c.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!r&&!n)return!1;for(e in t);return void 0===e||c.call(t,e)},v=function(t,e){f&&"__proto__"===e.name?f(t,e.name,{enumerable:!0,configurable:!0,value:e.newValue,writable:!0}):t[e.name]=e.newValue},b=function(t,e){if("__proto__"===e){if(!c.call(t,e))return;if(d)return d(t,e).value}return t[e]},_=function t(){var e,r,n,s,i,o,a=arguments[0],h=1,u=arguments.length,l=!1;for("boolean"==typeof a&&(l=a,a=arguments[1]||{},h=2),(null==a||"object"!=typeof a&&"function"!=typeof a)&&(a={});h<u;++h)if(null!=(e=arguments[h]))for(r in e)n=b(a,r),a!==(s=b(e,r))&&(l&&s&&(y(s)||(i=m(s)))?(i?(i=!1,o=n&&m(n)?n:[]):o=n&&y(n)?n:{},v(a,{name:r,newValue:t(l,o,s)})):void 0!==s&&v(a,{name:r,newValue:s}));return a};const g="undefined"!=typeof window?window:void 0!==t?t:void 0,w=function(){};class T{constructor(t){this.batches=((t,e,r,n)=>{let s=Object.create(null);return t.forEach(t=>{let i=e(t);s[i]?n(s[i],t):s[i]=r(t)}),s})(t,t=>`${t.apiHost}_${t.writeKey}_${t.dataset}`,t=>({apiHost:t.apiHost,writeKey:t.writeKey,dataset:t.dataset,events:[t]}),(t,e)=>t.events.push(e))}encodeBatchEvents(t){let e=!0,r=0;return{encoded:"["+t.reduce((t,n)=>{try{let s=n.toJSON();r++;let i=t+(e?"":",")+s;return e=!1,i}catch(e){return n.encodeError=e,t}},"")+"]",numEncoded:r}}}class x{constructor({timestamp:t,apiHost:e,postData:r,writeKey:n,dataset:s,sampleRate:i,metadata:o}){this.timestamp=t,this.apiHost=e,this.postData=r,this.writeKey=n,this.dataset=s,this.sampleRate=i,this.metadata=o}toJSON(){let t=[];return this.timestamp&&t.push('"time":'+JSON.stringify(this.timestamp)),this.sampleRate&&t.push('"samplerate":'+JSON.stringify(this.sampleRate)),this.postData&&t.push('"data":'+this.postData),`{${t.join(",")}}`}}class O{constructor(t){this.constructorArg=t,this.events=[]}sendEvent(t){this.events.push(t)}sendPresampledEvent(t){this.events.push(t)}reset(){this.constructorArg=null,this.events=[]}}class E{sendEvent(t){console.log(JSON.stringify(t))}sendPresampledEvent(t){console.log(JSON.stringify(t))}}class j{sendEvent(t){}sendPresampledEvent(t){}}class C{constructor(t){this._responseCallback=w,this._batchSizeTrigger=50,this._batchTimeTrigger=100,this._maxConcurrentBatches=10,this._pendingWorkCapacity=1e4,this._sendTimeoutId=-1,this._eventQueue=[],this._batchCount=0,"function"==typeof t.responseCallback&&(this._responseCallback=t.responseCallback),"number"==typeof t.batchSizeTrigger&&(this._batchSizeTrigger=Math.max(t.batchSizeTrigger,1)),"number"==typeof t.batchTimeTrigger&&(this._batchTimeTrigger=t.batchTimeTrigger),"number"==typeof t.maxConcurrentBatches&&(this._maxConcurrentBatches=t.maxConcurrentBatches),"number"==typeof t.pendingWorkCapacity&&(this._pendingWorkCapacity=t.pendingWorkCapacity),this._userAgentAddition=t.userAgentAddition||"",this._proxy=t.proxy;const e=void 0!==n;this._UserAgentHeader=e?"User-Agent":"X-Honeycomb-UserAgent",this._randomFn=Math.random}_droppedCallback(t,e){this._responseCallback([{metadata:t.metadata,error:new Error(e)}])}sendEvent(t){this._shouldSendEvent(t)?this.sendPresampledEvent(t):this._droppedCallback(t,"event dropped due to sampling")}sendPresampledEvent(t){this._eventQueue.length>=this._pendingWorkCapacity?this._droppedCallback(t,"queue overflow"):(this._eventQueue.push(t),this._eventQueue.length>=this._batchSizeTrigger?this._sendBatch():this._ensureSendTimeout())}flush(){return 0===this._eventQueue.length&&0===this._batchCount?Promise.resolve():new Promise(t=>{this.flushCallback=()=>{this.flushCallback=null,t()}})}_sendBatch(){if(10===this._batchCount)return;this._clearSendTimeout(),this._batchCount++;let t=new T(this._eventQueue.splice(0,this._batchSizeTrigger));const e=()=>{this._batchCount--;let t=this._eventQueue.length;t>0?t>=this._batchSizeTrigger?this._sendBatch():this._ensureSendTimeout():0===this._batchCount&&this.flushCallback&&this.flushCallback()};let n=Object.keys(t.batches).map(e=>t.batches[e]);var s,o;(s=n,o=e=>{let n=function(){var t,e,r=Array.prototype.slice.call(arguments),n={};return r.length?1===r.length?r[0]:(e=r.map((function(e){var r="function"==typeof e?e():String(e||"");if(!r)return"";var s=a.a.parse(r,!0);return!t&&s&&(t=s),_(n,s.query),s.pathname})).filter((function(t){return!!t})),delete t.search,t.query=n,t.pathname=u.a.join.apply(u.a,e).replace(new RegExp("\\"+u.a.sep,"g"),"/"),a.a.format(t)):""}(e.apiHost,"/1/batch",e.dataset),s=i.a.post(n);const o=Promise.resolve(this._proxy?Promise.resolve().then(r.t.bind(null,19,7)).then(({default:t})=>({req:t(s,this._proxy)})):{req:s});let{encoded:h,numEncoded:l}=t.encodeBatchEvents(e.events);return o.then(({req:t})=>new Promise(r=>{if(0===l)return this._responseCallback(e.events.map(t=>({metadata:t.metadata,error:t.encodeError}))),void r();let n="libhoney-js/2.0.2",s=this._userAgentAddition.trim();s&&(n="libhoney-js/2.0.2 "+s);let i=Date.now();t.set("X-Honeycomb-Team",e.writeKey).set(this._UserAgentHeader,n).type("json").send(h).end((t,n)=>{let s=Date.now();if(t)this._responseCallback(e.events.map(e=>({status_code:e.encodeError?void 0:t.status,duration:s-i,metadata:e.metadata,error:e.encodeError||t})));else{let t=JSON.parse(n.text),r=0;this._responseCallback(e.events.map(e=>{if(e.encodeError)return{duration:s-i,metadata:e.metadata,error:e.encodeError};{let n=t[r++];return{status_code:n.status,duration:s-i,metadata:e.metadata,error:n.err}}}))}r()})}))},s.reduce((t,e)=>t.then(()=>o(e)),Promise.resolve())).then(e).catch(e)}_shouldSendEvent(t){let{sampleRate:e}=t;return e<=1||this._randomFn()<1/e}_ensureSendTimeout(){-1===this._sendTimeoutId&&(this._sendTimeoutId=g.setTimeout(()=>this._sendBatch(),this._batchTimeTrigger))}_clearSendTimeout(){-1!==this._sendTimeoutId&&(g.clearTimeout(this._sendTimeoutId),this._sendTimeoutId=-1)}}function k(t,e){t&&(t instanceof Map?t.forEach(e):Object.getOwnPropertyNames(t).forEach(r=>e(t[r],r)))}class A{constructor(t,e,r){this.data=Object.create(null),this.metadata=null,this.apiHost="",this.writeKey="",this.dataset="",this.sampleRate=1,this.timestamp=null,k(e,(t,e)=>this.addField(e,t)),k(r,(t,e)=>this.addField(e,t())),this._libhoney=t}add(t){return k(t,(t,e)=>this.addField(e,t)),this}addField(t,e){return void 0===e?(this.data[t]=null,this):(this.data[t]=e,this)}addMetadata(t){return this.metadata=t,this}send(){this._libhoney.sendEvent(this)}sendPresampled(){this._libhoney.sendPresampledEvent(this)}}class R{constructor(t,e,r){this._libhoney=t,this._fields=Object.create(null),this._dynFields=Object.create(null),this.apiHost="",this.writeKey="",this.dataset="",this.sampleRate=1,k(e,(t,e)=>this.addField(e,t)),k(r,(t,e)=>this.addDynamicField(e,t))}add(t){return k(t,(t,e)=>this.addField(e,t)),this}addField(t,e){return void 0===e?(this._fields[t]=null,this):(this._fields[t]=e,this)}addDynamicField(t,e){this._dynFields[t]=e}sendNow(t){let e=this.newEvent();e.add(t),e.send()}newEvent(){let t=new A(this._libhoney,this._fields,this._dynFields);return t.apiHost=this.apiHost,t.writeKey=this.writeKey,t.dataset=this.dataset,t.sampleRate=this.sampleRate,t}newBuilder(t,e){let r=new R(this._libhoney,this._fields,this._dynFields);return k(t,(t,e)=>r.addField(e,t)),k(e,(t,e)=>r.addDynamicField(e,t)),r.apiHost=this.apiHost,r.writeKey=this.writeKey,r.dataset=this.dataset,r.sampleRate=this.sampleRate,r}}const P=Object.freeze({apiHost:"https://api.honeycomb.io/",proxy:void 0,sampleRate:1,transmission:"base",batchSizeTrigger:50,batchTimeTrigger:100,maxConcurrentBatches:10,pendingWorkCapacity:1e4,maxResponseQueueSize:1e3,disabled:!1,userAgentAddition:""});class L extends l.EventEmitter{constructor(t){super(),this._options=Object.assign({responseCallback:this._responseCallback.bind(this)},P,t),this._transmission=S(this._options.transmission,this._options),this._usable=null!==this._transmission,this._builder=new R(this),this._builder.apiHost=this._options.apiHost,this._builder.writeKey=this._options.writeKey,this._builder.dataset=this._options.dataset,this._builder.sampleRate=this._options.sampleRate,this._responseQueue=[]}_responseCallback(t){this._responseQueue.length<this._options.maxResponseQueueSize&&(this._responseQueue=this._responseQueue.concat(t)),this.emit("response",this._responseQueue)}get transmission(){return this._transmission}set apiHost(t){this._builder.apiHost=t}get apiHost(){return this._builder.apiHost}set writeKey(t){this._builder.writeKey=t}get writeKey(){return this._builder.writeKey}set dataset(t){this._builder.dataset=t}get dataset(){return this._builder.dataset}set sampleRate(t){this._builder.sampleRate=t}get sampleRate(){return this._builder.sampleRate}sendEvent(t){let e=this.validateEvent(t);e&&this._transmission.sendEvent(e)}sendPresampledEvent(t){let e=this.validateEvent(t);e&&this._transmission.sendPresampledEvent(e)}validateEvent(t){if(!this._usable)return null;let e,r=t.timestamp||Date.now();if("string"!=typeof r&&"number"!=typeof r||(r=new Date(r)),"object"!=typeof t.data||null===t.data)return console.error(".data must be an object"),null;try{e=JSON.stringify(t.data)}catch(t){return console.error("error converting event data to JSON: "+t),null}let n=t.apiHost;if("string"!=typeof n||""===n)return console.error(".apiHost must be a non-empty string"),null;let s=t.writeKey;if("string"!=typeof s||""===s)return console.error(".writeKey must be a non-empty string"),null;let i=t.dataset;if("string"!=typeof i||""===i)return console.error(".dataset must be a non-empty string"),null;let o=t.sampleRate;if("number"!=typeof o)return console.error(".sampleRate must be a number"),null;let a=t.metadata;return new x({timestamp:r,apiHost:n,postData:e,writeKey:s,dataset:i,sampleRate:o,metadata:a})}add(t){return this._builder.add(t),this}addField(t,e){return this._builder.addField(t,e),this}addDynamicField(t,e){return this._builder.addDynamicField(t,e),this}sendNow(t){return this._builder.sendNow(t)}newEvent(){return this._builder.newEvent()}newBuilder(t,e){return this._builder.newBuilder(t,e)}flush(){const t=this._transmission;return this._transmission=S(this._options.transmission,this._options),t.flush()}}function S(t,e){if(e.disabled)return null;if("string"==typeof t){return new((t=>{switch(t){case"base":return C;case"mock":return O;case"null":return j;case"worker":return console.warn("worker implementation not ready yet. using base implementation"),C;case"writer":return E;default:throw new Error(`unknown transmission implementation "${t}".`)}})(t))(e)}if("function"!=typeof t)throw new Error(".transmission must be one of 'base'/'worker'/'mock'/'writer'/'null' or a constructor.");try{return new t(e)}catch(r){if(t===C)throw new Error("unable to initialize base transmission implementation.",r);console.warn("failed to initialize transmission, falling back to base implementation.");try{return new C(e)}catch(t){throw new Error("unable to initialize base transmission implementation.",t)}}}e.default=L}.call(this,r(2),r(3))},function(t,e,r){function n(t){if(t)return function(t){for(var e in n.prototype)t[e]=n.prototype[e];return t}(t)}t.exports=n,n.prototype.on=n.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this},n.prototype.once=function(t,e){function r(){this.off(t,r),e.apply(this,arguments)}return r.fn=e,this.on(t,r),this},n.prototype.off=n.prototype.removeListener=n.prototype.removeAllListeners=n.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var r,n=this._callbacks["$"+t];if(!n)return this;if(1==arguments.length)return delete this._callbacks["$"+t],this;for(var s=0;s<n.length;s++)if((r=n[s])===e||r.fn===e){n.splice(s,1);break}return 0===n.length&&delete this._callbacks["$"+t],this},n.prototype.emit=function(t){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),r=this._callbacks["$"+t],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(r){n=0;for(var s=(r=r.slice(0)).length;n<s;++n)r[n].apply(this,e)}return this},n.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]},n.prototype.hasListeners=function(t){return!!this.listeners(t).length}},function(t,e,r){"use strict";var n=r(4);function s(t){if(t)return function(t){for(var e in s.prototype)t[e]=s.prototype[e];return t}(t)}t.exports=s,s.prototype.clearTimeout=function(){return clearTimeout(this._timer),clearTimeout(this._responseTimeoutTimer),delete this._timer,delete this._responseTimeoutTimer,this},s.prototype.parse=function(t){return this._parser=t,this},s.prototype.responseType=function(t){return this._responseType=t,this},s.prototype.serialize=function(t){return this._serializer=t,this},s.prototype.timeout=function(t){if(!t||"object"!=typeof t)return this._timeout=t,this._responseTimeout=0,this;for(var e in t)switch(e){case"deadline":this._timeout=t.deadline;break;case"response":this._responseTimeout=t.response;break;default:console.warn("Unknown timeout option",e)}return this},s.prototype.retry=function(t,e){return 0!==arguments.length&&!0!==t||(t=1),t<=0&&(t=0),this._maxRetries=t,this._retries=0,this._retryCallback=e,this};var i=["ECONNRESET","ETIMEDOUT","EADDRINFO","ESOCKETTIMEDOUT"];s.prototype._shouldRetry=function(t,e){if(!this._maxRetries||this._retries++>=this._maxRetries)return!1;if(this._retryCallback)try{var r=this._retryCallback(t,e);if(!0===r)return!0;if(!1===r)return!1}catch(t){console.error(t)}if(e&&e.status&&e.status>=500&&501!=e.status)return!0;if(t){if(t.code&&~i.indexOf(t.code))return!0;if(t.timeout&&"ECONNABORTED"==t.code)return!0;if(t.crossDomain)return!0}return!1},s.prototype._retry=function(){return this.clearTimeout(),this.req&&(this.req=null,this.req=this.request()),this._aborted=!1,this.timedout=!1,this._end()},s.prototype.then=function(t,e){if(!this._fullfilledPromise){var r=this;this._endCalled&&console.warn("Warning: superagent request was sent twice, because both .end() and .then() were called. Never call .end() if you use promises"),this._fullfilledPromise=new Promise((function(t,e){r.end((function(r,n){r?e(r):t(n)}))}))}return this._fullfilledPromise.then(t,e)},s.prototype.catch=function(t){return this.then(void 0,t)},s.prototype.use=function(t){return t(this),this},s.prototype.ok=function(t){if("function"!=typeof t)throw Error("Callback required");return this._okCallback=t,this},s.prototype._isResponseOK=function(t){return!!t&&(this._okCallback?this._okCallback(t):t.status>=200&&t.status<300)},s.prototype.get=function(t){return this._header[t.toLowerCase()]},s.prototype.getHeader=s.prototype.get,s.prototype.set=function(t,e){if(n(t)){for(var r in t)this.set(r,t[r]);return this}return this._header[t.toLowerCase()]=e,this.header[t]=e,this},s.prototype.unset=function(t){return delete this._header[t.toLowerCase()],delete this.header[t],this},s.prototype.field=function(t,e){if(null==t)throw new Error(".field(name, val) name can not be empty");if(this._data&&console.error(".field() can't be used if .send() is used. Please use only .send() or only .field() & .attach()"),n(t)){for(var r in t)this.field(r,t[r]);return this}if(Array.isArray(e)){for(var s in e)this.field(t,e[s]);return this}if(null==e)throw new Error(".field(name, val) val can not be empty");return"boolean"==typeof e&&(e=""+e),this._getFormData().append(t,e),this},s.prototype.abort=function(){return this._aborted||(this._aborted=!0,this.xhr&&this.xhr.abort(),this.req&&this.req.abort(),this.clearTimeout(),this.emit("abort")),this},s.prototype._auth=function(t,e,r,n){switch(r.type){case"basic":this.set("Authorization","Basic "+n(t+":"+e));break;case"auto":this.username=t,this.password=e;break;case"bearer":this.set("Authorization","Bearer "+t)}return this},s.prototype.withCredentials=function(t){return null==t&&(t=!0),this._withCredentials=t,this},s.prototype.redirects=function(t){return this._maxRedirects=t,this},s.prototype.maxResponseSize=function(t){if("number"!=typeof t)throw TypeError("Invalid argument");return this._maxResponseSize=t,this},s.prototype.toJSON=function(){return{method:this.method,url:this.url,data:this._data,headers:this._header}},s.prototype.send=function(t){var e=n(t),r=this._header["content-type"];if(this._formData&&console.error(".send() can't be used if .attach() or .field() is used. Please use only .send() or only .field() & .attach()"),e&&!this._data)Array.isArray(t)?this._data=[]:this._isHost(t)||(this._data={});else if(t&&this._data&&this._isHost(this._data))throw Error("Can't merge these send calls");if(e&&n(this._data))for(var s in t)this._data[s]=t[s];else"string"==typeof t?(r||this.type("form"),r=this._header["content-type"],this._data="application/x-www-form-urlencoded"==r?this._data?this._data+"&"+t:t:(this._data||"")+t):this._data=t;return!e||this._isHost(t)||r||this.type("json"),this},s.prototype.sortQuery=function(t){return this._sort=void 0===t||t,this},s.prototype._finalizeQueryString=function(){var t=this._query.join("&");if(t&&(this.url+=(this.url.indexOf("?")>=0?"&":"?")+t),this._query.length=0,this._sort){var e=this.url.indexOf("?");if(e>=0){var r=this.url.substring(e+1).split("&");"function"==typeof this._sort?r.sort(this._sort):r.sort(),this.url=this.url.substring(0,e)+"?"+r.join("&")}}},s.prototype._appendQueryString=function(){console.trace("Unsupported")},s.prototype._timeoutError=function(t,e,r){if(!this._aborted){var n=new Error(t+e+"ms exceeded");n.timeout=e,n.code="ECONNABORTED",n.errno=r,this.timedout=!0,this.abort(),this.callback(n)}},s.prototype._setTimeouts=function(){var t=this;this._timeout&&!this._timer&&(this._timer=setTimeout((function(){t._timeoutError("Timeout of ",t._timeout,"ETIME")}),this._timeout)),this._responseTimeout&&!this._responseTimeoutTimer&&(this._responseTimeoutTimer=setTimeout((function(){t._timeoutError("Response timeout of ",t._responseTimeout,"ETIMEDOUT")}),this._responseTimeout))}},function(t,e,r){"use strict";var n=r(11);function s(t){if(t)return function(t){for(var e in s.prototype)t[e]=s.prototype[e];return t}(t)}t.exports=s,s.prototype.get=function(t){return this.header[t.toLowerCase()]},s.prototype._setHeaderProperties=function(t){var e=t["content-type"]||"";this.type=n.type(e);var r=n.params(e);for(var s in r)this[s]=r[s];this.links={};try{t.link&&(this.links=n.parseLinks(t.link))}catch(t){}},s.prototype._setStatusProperties=function(t){var e=t/100|0;this.status=this.statusCode=t,this.statusType=e,this.info=1==e,this.ok=2==e,this.redirect=3==e,this.clientError=4==e,this.serverError=5==e,this.error=(4==e||5==e)&&this.toError(),this.created=201==t,this.accepted=202==t,this.noContent=204==t,this.badRequest=400==t,this.unauthorized=401==t,this.notAcceptable=406==t,this.forbidden=403==t,this.notFound=404==t,this.unprocessableEntity=422==t}},function(t,e,r){"use strict";e.type=function(t){return t.split(/ *; */).shift()},e.params=function(t){return t.split(/ *; */).reduce((function(t,e){var r=e.split(/ *= */),n=r.shift(),s=r.shift();return n&&s&&(t[n]=s),t}),{})},e.parseLinks=function(t){return t.split(/ *, */).reduce((function(t,e){var r=e.split(/ *; */),n=r[0].slice(1,-1);return t[r[1].split(/ *= */)[1].slice(1,-1)]=n,t}),{})},e.cleanHeader=function(t,e){return delete t["content-type"],delete t["content-length"],delete t["transfer-encoding"],delete t.host,e&&(delete t.authorization,delete t.cookie),t}},function(t,e){function r(){this._defaults=[]}["use","on","once","set","query","type","accept","auth","withCredentials","sortQuery","retry","ok","redirects","timeout","buffer","serialize","parse","ca","key","pfx","cert"].forEach((function(t){r.prototype[t]=function(){return this._defaults.push({fn:t,arguments:arguments}),this}})),r.prototype._setDefaults=function(t){this._defaults.forEach((function(e){t[e.fn].apply(t,e.arguments)}))},t.exports=r},function(t,e,r){(function(t,n){var s;/*! https://mths.be/punycode v1.4.1 by @mathias */!function(i){e&&e.nodeType,t&&t.nodeType;var o="object"==typeof n&&n;o.global!==o&&o.window!==o&&o.self;var a,h=2147483647,u=/^xn--/,l=/[^\x20-\x7E]/,c=/[\x2E\u3002\uFF0E\uFF61]/g,p={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},f=Math.floor,d=String.fromCharCode;function m(t){throw new RangeError(p[t])}function y(t,e){for(var r=t.length,n=[];r--;)n[r]=e(t[r]);return n}function v(t,e){var r=t.split("@"),n="";return r.length>1&&(n=r[0]+"@",t=r[1]),n+y((t=t.replace(c,".")).split("."),e).join(".")}function b(t){for(var e,r,n=[],s=0,i=t.length;s<i;)(e=t.charCodeAt(s++))>=55296&&e<=56319&&s<i?56320==(64512&(r=t.charCodeAt(s++)))?n.push(((1023&e)<<10)+(1023&r)+65536):(n.push(e),s--):n.push(e);return n}function _(t){return y(t,(function(t){var e="";return t>65535&&(e+=d((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=d(t)})).join("")}function g(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function w(t,e,r){var n=0;for(t=r?f(t/700):t>>1,t+=f(t/e);t>455;n+=36)t=f(t/35);return f(n+36*t/(t+38))}function T(t){var e,r,n,s,i,o,a,u,l,c,p,d=[],y=t.length,v=0,b=128,g=72;for((r=t.lastIndexOf("-"))<0&&(r=0),n=0;n<r;++n)t.charCodeAt(n)>=128&&m("not-basic"),d.push(t.charCodeAt(n));for(s=r>0?r+1:0;s<y;){for(i=v,o=1,a=36;s>=y&&m("invalid-input"),((u=(p=t.charCodeAt(s++))-48<10?p-22:p-65<26?p-65:p-97<26?p-97:36)>=36||u>f((h-v)/o))&&m("overflow"),v+=u*o,!(u<(l=a<=g?1:a>=g+26?26:a-g));a+=36)o>f(h/(c=36-l))&&m("overflow"),o*=c;g=w(v-i,e=d.length+1,0==i),f(v/e)>h-b&&m("overflow"),b+=f(v/e),v%=e,d.splice(v++,0,b)}return _(d)}function x(t){var e,r,n,s,i,o,a,u,l,c,p,y,v,_,T,x=[];for(y=(t=b(t)).length,e=128,r=0,i=72,o=0;o<y;++o)(p=t[o])<128&&x.push(d(p));for(n=s=x.length,s&&x.push("-");n<y;){for(a=h,o=0;o<y;++o)(p=t[o])>=e&&p<a&&(a=p);for(a-e>f((h-r)/(v=n+1))&&m("overflow"),r+=(a-e)*v,e=a,o=0;o<y;++o)if((p=t[o])<e&&++r>h&&m("overflow"),p==e){for(u=r,l=36;!(u<(c=l<=i?1:l>=i+26?26:l-i));l+=36)T=u-c,_=36-c,x.push(d(g(c+T%_,0))),u=f(T/_);x.push(d(g(u,0))),i=w(r,v,n==s),r=0,++n}++r,++e}return x.join("")}a={version:"1.4.1",ucs2:{decode:b,encode:_},decode:T,encode:x,toASCII:function(t){return v(t,(function(t){return l.test(t)?"xn--"+x(t):t}))},toUnicode:function(t){return v(t,(function(t){return u.test(t)?T(t.slice(4).toLowerCase()):t}))}},void 0===(s=function(){return a}.call(e,r,e,t))||(t.exports=s)}()}).call(this,r(14)(t),r(2))},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,r){"use strict";t.exports={isString:function(t){return"string"==typeof t},isObject:function(t){return"object"==typeof t&&null!==t},isNull:function(t){return null===t},isNullOrUndefined:function(t){return null==t}}},function(t,e,r){"use strict";e.decode=e.parse=r(17),e.encode=e.stringify=r(18)},function(t,e,r){"use strict";function n(t,e){return Object.prototype.hasOwnProperty.call(t,e)}t.exports=function(t,e,r,i){e=e||"&",r=r||"=";var o={};if("string"!=typeof t||0===t.length)return o;var a=/\+/g;t=t.split(e);var h=1e3;i&&"number"==typeof i.maxKeys&&(h=i.maxKeys);var u=t.length;h>0&&u>h&&(u=h);for(var l=0;l<u;++l){var c,p,f,d,m=t[l].replace(a,"%20"),y=m.indexOf(r);y>=0?(c=m.substr(0,y),p=m.substr(y+1)):(c=m,p=""),f=decodeURIComponent(c),d=decodeURIComponent(p),n(o,f)?s(o[f])?o[f].push(d):o[f]=[o[f],d]:o[f]=d}return o};var s=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)}},function(t,e,r){"use strict";var n=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}};t.exports=function(t,e,r,a){return e=e||"&",r=r||"=",null===t&&(t=void 0),"object"==typeof t?i(o(t),(function(o){var a=encodeURIComponent(n(o))+r;return s(t[o])?i(t[o],(function(t){return a+encodeURIComponent(n(t))})).join(e):a+encodeURIComponent(n(t[o]))})).join(e):a?encodeURIComponent(n(a))+r+encodeURIComponent(n(t)):""};var s=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function i(t,e){if(t.map)return t.map(e);for(var r=[],n=0;n<t.length;n++)r.push(e(t[n],n));return r}var o=Object.keys||function(t){var e=[];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.push(r);return e}},function(t,e){t.exports=superagent-proxy},function(t,e,r){"use strict";r.r(e);let n=new(r(7))({writeKey:"9479532a56b0cfcf59339ee76d8e14b8",dataset:"honeycomb-js-example",responseCallback:t=>{t.forEach(t=>{console.log(t)})}});!function(){const t=n.newEvent();t.addField("latencyMs",240),t.metadata={id:"recognize-me-later"},t.send()}()}]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment