varsnap 1.8.1 → 1.8.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
1
  /*
2
- * Varsnap.js v1.8.1
2
+ * Varsnap.js v1.8.4
3
3
  */
4
- !function(t){!function(e){"object"==typeof t&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).varsnap=e()}(function(){function e(t){var n;return function(e){return n||t(n={exports:{},parent:e},n.exports),n.exports}}function o(n,r){return function(){for(var e=new Array(arguments.length),t=0;t<e.length;t++)e[t]=arguments[t];return n.apply(r,e)}}var n=e(function(i,e){!function(o){!function(){"use strict";var t={"Content-Type":"application/x-www-form-urlencoded"};function n(e,t){!h.isUndefined(e)&&h.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var e,r={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:e="undefined"!=typeof XMLHttpRequest||void 0!==o&&"[object process]"===Object.prototype.toString.call(o)?a({}):e,transformRequest:[function(e,t){return v(t,"Accept"),v(t,"Content-Type"),h.isFormData(e)||h.isArrayBuffer(e)||h.isBuffer(e)||h.isStream(e)||h.isFile(e)||h.isBlob(e)?e:h.isArrayBufferView(e)?e.buffer:h.isURLSearchParams(e)?(n(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):h.isObject(e)||t&&"application/json"===t["Content-Type"]?(n(t,"application/json"),function(e){if(h.isString(e))try{return(0,JSON.parse)(e),h.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional||r.transitional,n=t&&t.silentJSONParsing,t=t&&t.forcedJSONParsing,n=!n&&"json"===this.responseType;if(n||t&&h.isString(e)&&e.length)try{return JSON.parse(e)}catch(e){if(n){if("SyntaxError"===e.name)throw b(e,this,"E_JSON_PARSE");throw e}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return 200<=e&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};h.forEach(["delete","get","head"],function(e){r.headers[e]={}}),h.forEach(["post","put","patch"],function(e){r.headers[e]=h.merge(t)}),i.exports=r}.call(this)}.call(this,N)}),a=e(function(e,t){"use strict";var d=n({});e.exports=function(p){return new Promise(function(t,n){var e,r=p.data,o=p.headers,i=p.responseType;function a(){p.cancelToken&&p.cancelToken.unsubscribe(e),p.signal&&p.signal.removeEventListener("abort",e)}h.isFormData(r)&&delete o["Content-Type"];var s,u=new XMLHttpRequest;p.auth&&(s=p.auth.username||"",f=p.auth.password?unescape(encodeURIComponent(p.auth.password)):"",o.Authorization="Basic "+btoa(s+":"+f));var c,f=k(p.baseURL,p.url);function l(){var e;u&&(e="getAllResponseHeaders"in u?j(u.getAllResponseHeaders()):null,e={data:i&&"text"!==i&&"json"!==i?u.response:u.responseText,status:u.status,statusText:u.statusText,headers:e,config:p,request:u},S(function(e){t(e),a()},function(e){n(e),a()},e),u=null)}u.open(p.method.toUpperCase(),g(f,p.params,p.paramsSerializer),!0),u.timeout=p.timeout,"onloadend"in u?u.onloadend=l:u.onreadystatechange=function(){u&&4===u.readyState&&(0!==u.status||u.responseURL&&0===u.responseURL.indexOf("file:"))&&setTimeout(l)},u.onabort=function(){u&&(n(w("Request aborted",p,"ECONNABORTED",u)),u=null)},u.onerror=function(){n(w("Network Error",p,null,u)),u=null},u.ontimeout=function(){var e=p.timeout?"timeout of "+p.timeout+"ms exceeded":"timeout exceeded",t=p.transitional||d.transitional;p.timeoutErrorMessage&&(e=p.timeoutErrorMessage),n(w(e,p,t.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",u)),u=null},h.isStandardBrowserEnv()&&(c=(p.withCredentials||E(f))&&p.xsrfCookieName?T.read(p.xsrfCookieName):void 0)&&(o[p.xsrfHeaderName]=c),"setRequestHeader"in u&&h.forEach(o,function(e,t){void 0===r&&"content-type"===t.toLowerCase()?delete o[t]:u.setRequestHeader(t,e)}),h.isUndefined(p.withCredentials)||(u.withCredentials=!!p.withCredentials),i&&"json"!==i&&(u.responseType=p.responseType),"function"==typeof p.onDownloadProgress&&u.addEventListener("progress",p.onDownloadProgress),"function"==typeof p.onUploadProgress&&u.upload&&u.upload.addEventListener("progress",p.onUploadProgress),(p.cancelToken||p.signal)&&(e=function(e){u&&(n(!e||e.type?new O("canceled"):e),u.abort(),u=null)},p.cancelToken&&p.cancelToken.subscribe(e),p.signal&&(p.signal.aborted?e():p.signal.addEventListener("abort",e))),r=r||null,u.send(r)})}}),t=Object.prototype.toString;function i(e){return"[object Array]"===t.call(e)}function r(e){return void 0===e}function s(e){return null!==e&&"object"==typeof e}function u(e){if("[object Object]"!==t.call(e))return!1;e=Object.getPrototypeOf(e);return null===e||e===Object.prototype}function c(e,t){if(null!=e)if(i(e="object"!=typeof e?[e]:e))for(var n=0,r=e.length;n<r;n++)t.call(null,e[n],n,e);else for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.call(null,e[o],o,e)}var h={isArray:i,isArrayBuffer:function(e){return"[object ArrayBuffer]"===t.call(e)},isBuffer:function(e){return null!==e&&!r(e)&&null!==e.constructor&&!r(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){return"undefined"!=typeof FormData&&e instanceof FormData},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:s,isPlainObject:u,isUndefined:r,isDate:function(e){return"[object Date]"===t.call(e)},isFile:function(e){return"[object File]"===t.call(e)},isBlob:function(e){return"[object Blob]"===t.call(e)},isStream:function(e){return s(e)&&(e=e.pipe,"[object Function]"===t.call(e))},isURLSearchParams:function(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&"undefined"!=typeof window&&"undefined"!=typeof document},forEach:c,merge:function n(){var r={};function e(e,t){u(r[t])&&u(e)?r[t]=n(r[t],e):u(e)?r[t]=n({},e):i(e)?r[t]=e.slice():r[t]=e}for(var t=0,o=arguments.length;t<o;t++)c(arguments[t],e);return r},extend:function(n,e,r){return c(e,function(e,t){n[t]=r&&"function"==typeof e?o(e,r):e}),n},trim:function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}};function f(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var g=function(e,t,n){if(!t)return e;var r,n=n?n(t):h.isURLSearchParams(t)?t.toString():(r=[],h.forEach(t,function(e,t){null!=e&&(h.isArray(e)?t+="[]":e=[e],h.forEach(e,function(e){h.isDate(e)?e=e.toISOString():h.isObject(e)&&(e=JSON.stringify(e)),r.push(f(t)+"="+f(e))}))}),r.join("&"));return n&&(-1!==(t=e.indexOf("#"))&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+n),e},l={};function p(){this.handlers=[]}p.prototype.use=function(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1},p.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},p.prototype.forEach=function(t){h.forEach(this.handlers,function(e){null!==e&&t(e)})};var d,m,y,l=p,v=function(n,r){h.forEach(n,function(e,t){t!==r&&t.toUpperCase()===r.toUpperCase()&&(n[r]=e,delete n[t])})},b=function(e,t,n,r,o){return e.config=t,n&&(e.code=n),e.request=r,e.response=o,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}},e},w=function(e,t,n,r,o){e=new Error(e);return b(e,t,n,r,o)},S=function(e,t,n){var r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(w("Request failed with status code "+n.status,n.config,null,n.request,n)):e(n)},T=h.isStandardBrowserEnv()?{write:function(e,t,n,r,o,i){var a=[];a.push(e+"="+encodeURIComponent(t)),h.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),h.isString(r)&&a.push("path="+r),h.isString(o)&&a.push("domain="+o),!0===i&&a.push("secure"),document.cookie=a.join("; ")},read:function(e){e=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}},k=function(e,t){return e&&!/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(t)?(n=e,(e=t)?n.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):n):t;var n},C=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"],j=function(e){var t,n,r={};return e&&h.forEach(e.split("\n"),function(e){n=e.indexOf(":"),t=h.trim(e.substr(0,n)).toLowerCase(),n=h.trim(e.substr(n+1)),t&&(r[t]&&0<=C.indexOf(t)||(r[t]="set-cookie"===t?(r[t]||[]).concat([n]):r[t]?r[t]+", "+n:n))}),r},E=h.isStandardBrowserEnv()?(m=/(msie|trident)/i.test(navigator.userAgent),y=document.createElement("a"),d=x(window.location.href),function(e){e=h.isString(e)?x(e):e;return e.protocol===d.protocol&&e.host===d.host}):function(){return!0},O={};function x(e){return m&&(y.setAttribute("href",e),e=y.href),y.setAttribute("href",e),{href:y.href,protocol:y.protocol?y.protocol.replace(/:$/,""):"",host:y.host,search:y.search?y.search.replace(/^\?/,""):"",hash:y.hash?y.hash.replace(/^#/,""):"",hostname:y.hostname,port:y.port,pathname:"/"===y.pathname.charAt(0)?y.pathname:"/"+y.pathname}}function A(e){this.message=e}A.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},A.prototype.__CANCEL__=!0;var _,P,O=A,N={},R=N={};function U(){throw new Error("setTimeout has not been defined")}function L(){throw new Error("clearTimeout has not been defined")}function B(t){if(_===setTimeout)return setTimeout(t,0);if((_===U||!_)&&setTimeout)return _=setTimeout,setTimeout(t,0);try{return _(t,0)}catch(e){try{return _.call(null,t,0)}catch(e){return _.call(this,t,0)}}}!function(){try{_="function"==typeof setTimeout?setTimeout:U}catch(e){_=U}try{P="function"==typeof clearTimeout?clearTimeout:L}catch(e){P=L}}();var q,z=[],I=!1,D=-1;function F(){I&&q&&(I=!1,q.length?z=q.concat(z):D=-1,z.length&&V())}function V(){if(!I){var e=B(F);I=!0;for(var t=z.length;t;){for(q=z,z=[];++D<t;)q&&q[D].run();D=-1,t=z.length}q=null,I=!1,function(t){if(P===clearTimeout)return clearTimeout(t);if((P===L||!P)&&clearTimeout)return P=clearTimeout,clearTimeout(t);try{P(t)}catch(e){try{return P.call(null,t)}catch(e){return P.call(this,t)}}}(e)}}function J(e,t){this.fun=e,this.array=t}function H(){}R.nextTick=function(e){var t=new Array(arguments.length-1);if(1<arguments.length)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];z.push(new J(e,t)),1!==z.length||I||B(V)},J.prototype.run=function(){this.fun.apply(null,this.array)},R.title="browser",R.browser=!0,R.env={},R.argv=[],R.version="",R.versions={},R.on=H,R.addListener=H,R.once=H,R.off=H,R.removeListener=H,R.removeAllListeners=H,R.emit=H,R.prependListener=H,R.prependOnceListener=H,R.listeners=function(e){return[]},R.binding=function(e){throw new Error("process.binding is not supported")},R.cwd=function(){return"/"},R.chdir=function(e){throw new Error("process.chdir is not supported")},R.umask=function(){return 0};var M=n({}),$=function(t,n,e){var r=this||M;return h.forEach(e,function(e){t=e.call(r,t,n)}),t},G=function(e){return!(!e||!e.__CANCEL__)},X=n({});function W(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new O("canceled")}function K(t){return W(t),t.headers=t.headers||{},t.data=$.call(t,t.data,t.headers,t.transformRequest),t.headers=h.merge(t.headers.common||{},t.headers[t.method]||{},t.headers),h.forEach(["delete","get","head","post","put","patch","common"],function(e){delete t.headers[e]}),(t.adapter||X.adapter)(t).then(function(e){return W(t),e.data=$.call(t,e.data,e.headers,t.transformResponse),e},function(e){return G(e)||(W(t),e&&e.response&&(e.response.data=$.call(t,e.response.data,e.response.headers,t.transformResponse))),Promise.reject(e)})}function Y(t,n){n=n||{};var r={};function o(e,t){return h.isPlainObject(e)&&h.isPlainObject(t)?h.merge(e,t):h.isPlainObject(t)?h.merge({},t):h.isArray(t)?t.slice():t}function i(e){return h.isUndefined(n[e])?h.isUndefined(t[e])?void 0:o(void 0,t[e]):o(t[e],n[e])}function e(e){if(!h.isUndefined(n[e]))return o(void 0,n[e])}function a(e){return h.isUndefined(n[e])?h.isUndefined(t[e])?void 0:o(void 0,t[e]):o(void 0,n[e])}function s(e){return e in n?o(t[e],n[e]):e in t?o(void 0,t[e]):void 0}var u={url:e,method:e,data:e,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:s};return h.forEach(Object.keys(t).concat(Object.keys(n)),function(e){var t=u[e]||i,n=t(e);h.isUndefined(n)&&t!==s||(r[e]=n)}),r}var Q,Z="0.24.0",ee={};["object","boolean","number","function","string","symbol"].forEach(function(t,n){ee[t]=function(e){return typeof e===t||"a"+(n<1?"n ":" ")+t}});var te={};ee.transitional=function(r,o,n){function i(e,t){return"[Axios v0.24.0] Transitional option '"+e+"'"+t+(n?". "+n:"")}return function(e,t,n){if(!1===r)throw new Error(i(t," has been removed"+(o?" in "+o:"")));return o&&!te[t]&&(te[t]=!0,console.warn(i(t," has been deprecated since v"+o+" and will be removed in the near future"))),!r||r(e,t,n)}};var ne={},re=(Q={assertOptions:function(e,t,n){if("object"!=typeof e)throw new TypeError("options must be an object");for(var r=Object.keys(e),o=r.length;0<o--;){var i=r[o],a=t[i];if(a){var s=e[i],s=void 0===s||a(s,i,e);if(!0!==s)throw new TypeError("option "+i+" must be "+s)}else if(!0!==n)throw Error("Unknown option "+i)}},validators:ee}).validators;function oe(e){this.defaults=e,this.interceptors={request:new l,response:new l}}function ie(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise(function(e){t=e});var r=this;this.promise.then(function(e){if(r._listeners){for(var t=r._listeners.length,n=0;n<t;n++)r._listeners[n](e);r._listeners=null}}),this.promise.then=function(e){var t,e=new Promise(function(e){r.subscribe(e),t=e}).then(e);return e.cancel=function(){r.unsubscribe(t)},e},e(function(e){r.reason||(r.reason=new O(e),t(r.reason))})}oe.prototype.request=function(t){"string"==typeof t?(t=arguments[1]||{}).url=arguments[0]:t=t||{},(t=Y(this.defaults,t)).method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var e=t.transitional;void 0!==e&&Q.assertOptions(e,{silentJSONParsing:re.transitional(re.boolean),forcedJSONParsing:re.transitional(re.boolean),clarifyTimeoutError:re.transitional(re.boolean)},!1);var n=[],r=!0;this.interceptors.request.forEach(function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(r=r&&e.synchronous,n.unshift(e.fulfilled,e.rejected))});var o,i=[];if(this.interceptors.response.forEach(function(e){i.push(e.fulfilled,e.rejected)}),!r){var a=[K,void 0];for(Array.prototype.unshift.apply(a,n),a=a.concat(i),o=Promise.resolve(t);a.length;)o=o.then(a.shift(),a.shift());return o}for(var s=t;n.length;){var u=n.shift(),c=n.shift();try{s=u(s)}catch(e){c(e);break}}try{o=K(s)}catch(e){return Promise.reject(e)}for(;i.length;)o=o.then(i.shift(),i.shift());return o},oe.prototype.getUri=function(e){return e=Y(this.defaults,e),g(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},h.forEach(["delete","get","head","options"],function(n){oe.prototype[n]=function(e,t){return this.request(Y(t||{},{method:n,url:e,data:(t||{}).data}))}}),h.forEach(["post","put","patch"],function(r){oe.prototype[r]=function(e,t,n){return this.request(Y(n||{},{method:r,url:e,data:t}))}}),ne=oe,ie.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},ie.prototype.subscribe=function(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]},ie.prototype.unsubscribe=function(e){!this._listeners||-1!==(e=this._listeners.indexOf(e))&&this._listeners.splice(e,1)},ie.source=function(){var t;return{token:new ie(function(e){t=e}),cancel:t}};var ae=ie,R=function t(n){var e=new ne(n),r=o(ne.prototype.request,e);return h.extend(r,ne.prototype,e),h.extend(r,e),r.create=function(e){return t(Y(n,e))},r}(n({}));R.Axios=ne,R.Cancel=O,R.CancelToken=ae,R.isCancel=G,R.VERSION=Z,R.all=function(e){return Promise.all(e)},R.spread=function(t){return function(e){return t.apply(null,e)}},R.isAxiosError=function(e){return"object"==typeof e&&!0===e.isAxiosError};var se=R.default=R;Array.isArray;function ue(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}}var ce=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function fe(e,t){if(e.map)return e.map(t);for(var n=[],r=0;r<e.length;r++)n.push(t(e[r],r));return n}var le=Object.keys||function(e){var t,n=[];for(t in e)Object.prototype.hasOwnProperty.call(e,t)&&n.push(t);return n},pe=function(n,r,o,e){return r=r||"&",o=o||"=","object"==typeof(n=null===n?void 0:n)?fe(le(n),function(e){var t=encodeURIComponent(ue(e))+o;return ce(n[e])?fe(n[e],function(e){return t+encodeURIComponent(ue(e))}).join(r):t+encodeURIComponent(ue(n[e]))}).join(r):e?encodeURIComponent(ue(e))+o+encodeURIComponent(ue(n)):""},de={},he={};return function(y){!function(){"use strict";function c(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=f(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,t=function(){};return{s:t,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:t}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return i=e.done,e},e:function(e){a=!0,o=e},f:function(){try{i||null==n.return||n.return()}finally{if(a)throw o}}}}function f(e,t){if(e){if("string"==typeof e)return l(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Map"===(n="Object"===n&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l(e,t):void 0}}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function e(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}Object.defineProperty(he,"__esModule",{value:!0}),he.varsnap=he.clientName=he.version=void 0,he.version="1.8.1",he.clientName="javascript."+he.version;var n={varsnap:!0,env:"development",branch:"",producerToken:"",consumerToken:"",logger:console},a=[],s=[],p=(e(g,null,[{key:"getConfig",value:function(e,t){if(!e)return"";t=e[t];return t?t.toString().toLowerCase():""}},{key:"setConfig",value:function(e,t,n){return"varsnap"===t&&(e[t]=n="string"==typeof n?"true"===n:n),"env"!==t&&"producerToken"!==t&&"consumerToken"!==t&&"branch"!==t||(e[t]=n),"logger"===t&&(e[t]=n),e}},{key:"getSignature",value:function(e,t){var n="",n=""!==t&&void 0!==t?t:(n=(n=e.toString().split("{")[0]).replace(/^\s+|\s+$/g,"")).replace(/,\s+/g,",");return"javascript."+he.version+"."+n}},{key:"ajax",value:function(e,t){t={method:"POST",url:e,headers:{"Content-Type":"application/x-www-form-urlencoded"},data:pe(t),responseType:"json"};return g.isNode()&&t.headers&&(t.headers["User-Agent"]="varsnap.js"),(0,se.default)(t).then(function(e){return e.data})}},{key:"debug",value:function(e,t){e.logger&&e.logger.debug(t)}},{key:"log",value:function(e,t){e.logger&&e.logger.log(t)}},{key:"error",value:function(e,t){e.logger&&e.logger.error(t)}},{key:"resetProducers",value:function(){a=[]}},{key:"resetConsumers",value:function(){s=[]}},{key:"getProducers",value:function(){return a}},{key:"getConsumers",value:function(){return s}},{key:"limitString",value:function(e){e=String(e);return e.length<=30?e:e.substring(0,30-"...".length)+"..."}},{key:"isNode",value:function(){return"object"===(void 0===y?"undefined":t(y))&&"undefined"==typeof window}},{key:"getBranch",value:function(e){var t=g.getConfig(e,"branch");return t?new Promise(function(e){return e(t)}):g.isNode()?new Promise(function(n){(0,de.exec)("git rev-parse --abbrev-ref HEAD",function(e,t){return n(t.trim())})}):new Promise(function(e){return e("")})}}]),g),d=(e(i,[{key:"isEnabled",value:function(){return!!this.config.varsnap&&"production"===p.getConfig(this.config,"env")&&!!p.getConfig(this.config,"producerToken")}},{key:"produce",value:function(t,e){var n=this;return this.isEnabled()?(p.debug(this.config,"Sending call to Varsnap"),Promise.resolve(e).then(function(e){e={producer_token:p.getConfig(n.config,"producerToken"),signature:n.signature,inputs:i.serialize(t),prod_outputs:i.serialize(e)};return p.ajax("https://www.varsnap.com/api/snap/produce/",e).then(function(){return!0}).catch(function(e){if(e.response){if(429===e.response.status)return p.error(n.config,"Cannot produce to Varsnap; Signature at rate limit"),!0;404===e.response.status?p.error(n.config,"Cannot produce to Varsnap; check your producer token"):p.error(n.config,e.response.statusText)}return!1})})):new Promise(function(e){return e(!1)})}}],[{key:"serialize",value:function(e){return JSON.stringify(e)}},{key:"serialize_formatted",value:function(e){return JSON.stringify(e,null,2)}}]),i),u=(e(h,[{key:"isEnabled",value:function(){return!!this.config.varsnap&&"development"===p.getConfig(this.config,"env")&&!!p.getConfig(this.config,"consumerToken")}},{key:"consume",value:function(s){var u=this;if(!this.isEnabled())return new Promise(function(e){return p.error(u.config,"Varsnap not enabled for testing"),e(!1)});var o={consumer_token:p.getConfig(this.config,"consumerToken"),signature:this.signature};return p.ajax("https://www.varsnap.com/api/snap/consume/",o).then(function(e){var t=e;if(!t||"ok"!==t.status)return[new Promise(function(e){return p.error(u.config,"Received error from Varsnap: "+t.status),e(!1)})];0===t.results.length&&p.log(u.config,"No snaps found for signature: "+o.signature);var n,a=[],r=c(t.results);try{for(r.s();!(n=r.n()).done;)!function(){var e,r=n.value,o=h.deserialize(r.inputs),i=h.deserialize(r.prod_outputs),t=void 0;try{t=u.targetFunc.apply(u,function(e){if(Array.isArray(e))return l(e)}(e=o)||function(){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}()||f(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())}catch(e){t=e}t=Promise.resolve(t).then(function(t){var n=d.serialize(i)===d.serialize(t);return u.reportCentral(s,r,i,t,n).then(function(e){u.reportLog(r.id,o,i,t,n,e)}),n});a.push(t)}()}catch(e){r.e(e)}finally{r.f()}return u.reportTrialGroup(s),a}).then(function(e){return Promise.all(e).then(function(e){return e.every(function(e){return e})})}).catch(function(e){return p.error(u.config,"Cannot contact Varsnap: "+e),!1})}},{key:"reportCentral",value:function(e,t,n,r,o){var i=this,r={trial_group_id:e.trial_group_id,consumer_token:p.getConfig(this.config,"consumerToken"),snap_id:t.id,test_outputs:d.serialize(r),matches:o,snap_outputs_formatted:d.serialize_formatted(n),test_outputs_formatted:d.serialize_formatted(r)};return p.ajax("https://www.varsnap.com/api/trial/produce/",r).then(function(e){return!(!e||"ok"!==e.status)&&e.trial_url}).catch(function(e){return p.error(i.config,"Cannot upload test results to Varsnap: "+e),!1})}},{key:"reportLog",value:function(e,t,n,r,o,i){p.log(this.config,""),p.log(this.config,"Testing with Varsnap uuid: "+e),p.log(this.config,"Signature: "+this.signature),p.log(this.config,"Function input args: "+p.limitString(t)),p.log(this.config,"Production function outputs: "+p.limitString(n)),p.log(this.config,"Your function outputs: "+p.limitString(r)),p.log(this.config,"Matching outputs: "+o);o="Cannot upload trial";i&&(o=String(i)),p.log(this.config,"Trial URL: "+o)}},{key:"reportTrialGroup",value:function(e){p.log(this.config,"Trial Group: "+e.trial_group_url)}}],[{key:"deserialize",value:function(e){if(""!==e)return JSON.parse(e)}}]),h);function h(e,t,n){r(this,h),this.targetFunc=e,this.signature=t,this.config=n}function i(e,t,n){r(this,i),this.targetFunc=e,this.signature=t,this.config=n}function g(){r(this,g)}function m(o,e){function t(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];try{e=o.apply(void 0,n)}catch(e){throw i.produce(n,e),e}return i.produce(n,e),e}var n=p.getSignature(o,e=void 0===e?"":e),i=new d(o,n,m._config),e=new u(o,n,m._config);return t.producer=i,t.consumer=e,t.signature=n,a.push(i),s.push(e),t}(he.varsnap=m)._config=n,m.updateConfig=function(e){for(var t=m._config,n=0,r=Object.keys(m._config);n<r.length;n++){var o=r[n];Object.prototype.hasOwnProperty.call(e,o)&&(t=p.setConfig(t,o,e[o]))}m._config=t},m.reset=function(){p.resetConsumers(),p.resetProducers()},m.version=he.version,m.runTests=function(){var t,i=p.getConsumers();return 0===i.length?Promise.resolve(!0):(t=i[0].config,p.getBranch(t).then(function(e){return{branch:e,consumer_token:p.getConfig(t,"consumerToken"),client:he.clientName}}).then(function(e){return p.ajax("https://www.varsnap.com/api/trial_group/",e)}).then(function(e){return e}).catch(function(e){e=e&&e.response&&e.response.data&&e.response.data.error?e.response.data.error:e.toString();return p.error(t,"Cannot generate a new Trial Group: "+e),{status:"not ok",project_id:"",trial_group_id:"",trial_group_url:""}}).then(function(e){var t,n=[],r=c(i);try{for(r.s();!(t=r.n()).done;){var o=t.value.consume(e);n.push(o)}}catch(e){r.e(e)}finally{r.f()}return Promise.all(n)}).then(function(e){return e.every(function(e){return e})}))}}.call(this)}.call(this,N),he.varsnap})}("undefined"==typeof Varsnap?Varsnap={}:Varsnap);
4
+ !function(e){!function(t){"object"==typeof e&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).varsnap=t()}(function(){function L(r,n){return function(){for(var t=new Array(arguments.length),e=0;e<t.length;e++)t[e]=arguments[e];return r.apply(n,t)}}I=function(t,R){!function(t){!function(){"use strict";function c(t){if(2147483647<t)throw new RangeError('The value "'+t+'" is invalid for option "size"');t=new Uint8Array(t);return t.__proto__=h.prototype,t}function h(t,e,r){if("number"!=typeof t)return n(t,e,r);if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return i(t)}function n(t,e,r){if("string"==typeof t){var n=t,o=e;if(h.isEncoding(o="string"==typeof o&&""!==o?o:"utf8"))return(n=(s=c(i=0|d(n,o))).write(n,o))!==i?s.slice(0,n):s;throw new TypeError("Unknown encoding: "+o)}if(ArrayBuffer.isView(t))return l(t);if(null==t)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(T(t,ArrayBuffer)||t&&T(t.buffer,ArrayBuffer)){var i=t,n=e,s=r;if(n<0||i.byteLength<n)throw new RangeError('"offset" is outside of buffer bounds');if(i.byteLength<n+(s||0))throw new RangeError('"length" is outside of buffer bounds');return(i=void 0===n&&void 0===s?new Uint8Array(i):void 0===s?new Uint8Array(i,n):new Uint8Array(i,n,s)).__proto__=h.prototype,i}if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');o=t.valueOf&&t.valueOf();if(null!=o&&o!==t)return h.from(o,e,r);var a,u,f=h.isBuffer(a=t)?(0!==(u=c(f=0|p(a.length))).length&&a.copy(u,0,0,f),u):void 0!==a.length?"number"!=typeof a.length||S(a.length)?c(0):l(a):"Buffer"===a.type&&Array.isArray(a.data)?l(a.data):void 0;if(f)return f;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return h.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function o(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function i(t){return o(t),c(t<0?0:0|p(t))}function l(t){for(var e=t.length<0?0:0|p(t.length),r=c(e),n=0;n<e;n+=1)r[n]=255&t[n];return r}function p(t){if(2147483647<=t)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+2147483647..toString(16)+" bytes");return 0|t}function d(t,e){if(h.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||T(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var r=t.length,n=2<arguments.length&&!0===arguments[2];if(!n&&0===r)return 0;for(var o=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return b(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return E(t).length;default:if(o)return n?-1:b(t).length;e=(""+e).toLowerCase(),o=!0}}function r(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function s(t,e,r,n,o){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):2147483647<r?r=2147483647:r<-2147483648&&(r=-2147483648),(r=(r=S(r=+r)?o?0:t.length-1:r)<0?t.length+r:r)>=t.length){if(o)return-1;r=t.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof e&&(e=h.from(e,n)),h.isBuffer(e))return 0===e.length?-1:a(t,e,r,n,o);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?(o?Uint8Array.prototype.indexOf:Uint8Array.prototype.lastIndexOf).call(t,e,r):a(t,[e],r,n,o);throw new TypeError("val must be string, number or Buffer")}function a(t,e,r,n,o){var i=1,s=t.length,a=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;s/=i=2,a/=2,r/=2}function u(t,e){return 1===i?t[e]:t.readUInt16BE(e*i)}if(o)for(var f=-1,c=r;c<s;c++)if(u(t,c)===u(e,-1===f?0:c-f)){if(c-(f=-1===f?c:f)+1===a)return f*i}else-1!==f&&(c-=c-f),f=-1;else for(c=r=s<r+a?s-a:r;0<=c;c--){for(var h=!0,l=0;l<a;l++)if(u(t,c+l)!==u(e,l)){h=!1;break}if(h)return c}return-1}function v(t,e,r,n){return A(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function _(t,e,r){r=Math.min(t.length,r);for(var n=[],o=e;o<r;){var i,s,a,u,f=t[o],c=null,h=239<f?4:223<f?3:191<f?2:1;if(o+h<=r)switch(h){case 1:f<128&&(c=f);break;case 2:128==(192&(i=t[o+1]))&&127<(u=(31&f)<<6|63&i)&&(c=u);break;case 3:i=t[o+1],s=t[o+2],128==(192&i)&&128==(192&s)&&2047<(u=(15&f)<<12|(63&i)<<6|63&s)&&(u<55296||57343<u)&&(c=u);break;case 4:i=t[o+1],s=t[o+2],a=t[o+3],128==(192&i)&&128==(192&s)&&128==(192&a)&&65535<(u=(15&f)<<18|(63&i)<<12|(63&s)<<6|63&a)&&u<1114112&&(c=u)}null===c?(c=65533,h=1):65535<c&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),o+=h}var l=n,p=l.length;if(p<=y)return String.fromCharCode.apply(String,l);for(var d="",g=0;g<p;)d+=String.fromCharCode.apply(String,l.slice(g,g+=y));return d}R.Buffer=h,R.INSPECT_MAX_BYTES=50,(h.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()}catch(t){return!1}}())||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(h.prototype,"parent",{enumerable:!0,get:function(){if(h.isBuffer(this))return this.buffer}}),Object.defineProperty(h.prototype,"offset",{enumerable:!0,get:function(){if(h.isBuffer(this))return this.byteOffset}}),"undefined"!=typeof Symbol&&null!=Symbol.species&&h[Symbol.species]===h&&Object.defineProperty(h,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),h.poolSize=8192,h.from=n,h.prototype.__proto__=Uint8Array.prototype,h.__proto__=Uint8Array,h.alloc=function(t,e,r){return e=e,r=r,o(t=t),!(t<=0)&&void 0!==e?"string"==typeof r?c(t).fill(e,r):c(t).fill(e):c(t)},h.allocUnsafe=i,h.allocUnsafeSlow=i,h.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==h.prototype},h.compare=function(t,e){if(T(t,Uint8Array)&&(t=h.from(t,t.offset,t.byteLength)),T(e,Uint8Array)&&(e=h.from(e,e.offset,e.byteLength)),!h.isBuffer(t)||!h.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;for(var r=t.length,n=e.length,o=0,i=Math.min(r,n);o<i;++o)if(t[o]!==e[o]){r=t[o],n=e[o];break}return r<n?-1:n<r?1:0},h.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},h.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return h.alloc(0);if(void 0===e)for(o=e=0;o<t.length;++o)e+=t[o].length;for(var r=h.allocUnsafe(e),n=0,o=0;o<t.length;++o){var i=t[o];if(T(i,Uint8Array)&&(i=h.from(i)),!h.isBuffer(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(r,n),n+=i.length}return r},h.byteLength=d,h.prototype._isBuffer=!0,h.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;e<t;e+=2)r(this,e,e+1);return this},h.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;e<t;e+=4)r(this,e,e+3),r(this,e+1,e+2);return this},h.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;e<t;e+=8)r(this,e,e+7),r(this,e+1,e+6),r(this,e+2,e+5),r(this,e+3,e+4);return this},h.prototype.toLocaleString=h.prototype.toString=function(){var t=this.length;return 0===t?"":0===arguments.length?_(this,0,t):function(t,e,r){var n,o=!1;if((e=void 0===e||e<0?0:e)>this.length)return"";if((r=void 0===r||r>this.length?this.length:r)<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t=t||"utf8";;)switch(t){case"hex":var i,s=this,a=e,u=r,f=s.length;(!u||u<0||f<u)&&(u=f);for(var c="",h=a=!a||a<0?0:a;h<u;++h)c+=(i=s[h])<16?"0"+i.toString(16):i.toString(16);return c;case"utf8":case"utf-8":return _(this,e,r);case"ascii":var l=this,f=e,p=r,d="";p=Math.min(l.length,p);for(var g=f;g<p;++g)d+=String.fromCharCode(127&l[g]);return d;case"latin1":case"binary":var y=this,a=e,m=r,v="";m=Math.min(y.length,m);for(var w=a;w<m;++w)v+=String.fromCharCode(y[w]);return v;case"base64":return b=this,n=r,0===(E=e)&&n===b.length?Q.fromByteArray(b):Q.fromByteArray(b.slice(E,n));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":for(var b=e,E=r,A=this.slice(b,E),T="",S=0;S<A.length;S+=2)T+=String.fromCharCode(A[S]+256*A[S+1]);return T;default:if(o)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),o=!0}}.apply(this,arguments)},h.prototype.equals=function(t){if(h.isBuffer(t))return this===t||0===h.compare(this,t);throw new TypeError("Argument must be a Buffer")},h.prototype.inspect=function(){var t="",e=R.INSPECT_MAX_BYTES,t=this.toString("hex",0,e).replace(/(.{2})/g,"$1 ").trim();return this.length>e&&(t+=" ... "),"<Buffer "+t+">"},h.prototype.compare=function(t,e,r,n,o){if(T(t,Uint8Array)&&(t=h.from(t,t.offset,t.byteLength)),!h.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),(e=void 0===e?0:e)<0||r>t.length||n<0||o>this.length)throw new RangeError("out of range index");if(o<=n&&r<=e)return 0;if(o<=n)return-1;if(r<=e)return 1;if(this===t)return 0;for(var i=(o>>>=0)-(n>>>=0),s=(r>>>=0)-(e>>>=0),a=Math.min(i,s),u=this.slice(n,o),f=t.slice(e,r),c=0;c<a;++c)if(u[c]!==f[c]){i=u[c],s=f[c];break}return i<s?-1:s<i?1:0},h.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},h.prototype.indexOf=function(t,e,r){return s(this,t,e,r,!0)},h.prototype.lastIndexOf=function(t,e,r){return s(this,t,e,r,!1)},h.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 new 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||o<r)&&(r=o),0<t.length&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n=n||"utf8";for(var i,s,a,u,f,c=!1;;)switch(n){case"hex":var h=this,l=t,p=e,d=r,g=(p=Number(p)||0,h.length-p);(!d||(d=Number(d))>g)&&(d=g),(g=l.length)/2<d&&(d=g/2);for(var y=0;y<d;++y){var m=parseInt(l.substr(2*y,2),16);if(S(m))return y;h[p+y]=m}return y;case"utf8":case"utf-8":return g=e,f=r,A(b(t,(u=this).length-g),u,g,f);case"ascii":return v(this,t,e,r);case"latin1":case"binary":return v(this,t,e,r);case"base64":return u=this,f=e,a=r,A(E(t),u,f,a);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return a=e,s=r,A(function(t,e){for(var r,n,o=[],i=0;i<t.length&&!((e-=2)<0);++i)n=(r=t.charCodeAt(i))>>8,o.push(r%256),o.push(n);return o}(t,(i=this).length-a),i,a,s);default:if(c)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),c=!0}},h.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var y=4096;function u(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(r<t+e)throw new RangeError("Trying to access beyond buffer length")}function f(t,e,r,n,o,i){if(!h.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(o<e||e<i)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function g(t,e,r,n){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function m(t,e,r,n,o){return e=+e,r>>>=0,o||g(t,0,r,4),O.write(t,e,r,n,23,4),r+4}function w(t,e,r,n,o){return e=+e,r>>>=0,o||g(t,0,r,8),O.write(t,e,r,n,52,8),r+8}h.prototype.slice=function(t,e){var r=this.length,r=((t=~~t)<0?(t+=r)<0&&(t=0):r<t&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):r<e&&(e=r),e<t&&(e=t),this.subarray(t,e));return r.__proto__=h.prototype,r},h.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||u(t,e,this.length);for(var n=this[t],o=1,i=0;++i<e&&(o*=256);)n+=this[t+i]*o;return n},h.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||u(t,e,this.length);for(var n=this[t+--e],o=1;0<e&&(o*=256);)n+=this[t+--e]*o;return n},h.prototype.readUInt8=function(t,e){return t>>>=0,e||u(t,1,this.length),this[t]},h.prototype.readUInt16LE=function(t,e){return t>>>=0,e||u(t,2,this.length),this[t]|this[t+1]<<8},h.prototype.readUInt16BE=function(t,e){return t>>>=0,e||u(t,2,this.length),this[t]<<8|this[t+1]},h.prototype.readUInt32LE=function(t,e){return t>>>=0,e||u(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},h.prototype.readUInt32BE=function(t,e){return t>>>=0,e||u(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},h.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||u(t,e,this.length);for(var n=this[t],o=1,i=0;++i<e&&(o*=256);)n+=this[t+i]*o;return n>=(o*=128)&&(n-=Math.pow(2,8*e)),n},h.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||u(t,e,this.length);for(var n=e,o=1,i=this[t+--n];0<n&&(o*=256);)i+=this[t+--n]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*e)),i},h.prototype.readInt8=function(t,e){return t>>>=0,e||u(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},h.prototype.readInt16LE=function(t,e){t>>>=0,e||u(t,2,this.length);e=this[t]|this[t+1]<<8;return 32768&e?4294901760|e:e},h.prototype.readInt16BE=function(t,e){t>>>=0,e||u(t,2,this.length);e=this[t+1]|this[t]<<8;return 32768&e?4294901760|e:e},h.prototype.readInt32LE=function(t,e){return t>>>=0,e||u(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},h.prototype.readInt32BE=function(t,e){return t>>>=0,e||u(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},h.prototype.readFloatLE=function(t,e){return t>>>=0,e||u(t,4,this.length),O.read(this,t,!0,23,4)},h.prototype.readFloatBE=function(t,e){return t>>>=0,e||u(t,4,this.length),O.read(this,t,!1,23,4)},h.prototype.readDoubleLE=function(t,e){return t>>>=0,e||u(t,8,this.length),O.read(this,t,!0,52,8)},h.prototype.readDoubleBE=function(t,e){return t>>>=0,e||u(t,8,this.length),O.read(this,t,!1,52,8)},h.prototype.writeUIntLE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||f(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},h.prototype.writeUIntBE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||f(this,t,e,r,Math.pow(2,8*r)-1,0);var o=r-1,i=1;for(this[e+o]=255&t;0<=--o&&(i*=256);)this[e+o]=t/i&255;return e+r},h.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||f(this,t,e,1,255,0),this[e]=255&t,e+1},h.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||f(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},h.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||f(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},h.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||f(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},h.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||f(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},h.prototype.writeIntLE=function(t,e,r,n){t=+t,e>>>=0,n||f(this,t,e,r,(n=Math.pow(2,8*r-1))-1,-n);var o=0,i=1,s=0;for(this[e]=255&t;++o<r&&(i*=256);)t<0&&0===s&&0!==this[e+o-1]&&(s=1),this[e+o]=(t/i>>0)-s&255;return e+r},h.prototype.writeIntBE=function(t,e,r,n){t=+t,e>>>=0,n||f(this,t,e,r,(n=Math.pow(2,8*r-1))-1,-n);var o=r-1,i=1,s=0;for(this[e+o]=255&t;0<=--o&&(i*=256);)t<0&&0===s&&0!==this[e+o+1]&&(s=1),this[e+o]=(t/i>>0)-s&255;return e+r},h.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||f(this,t,e,1,127,-128),this[e]=255&(t=t<0?255+t+1:t),e+1},h.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||f(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},h.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||f(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},h.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||f(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},h.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||f(this,t,e,4,2147483647,-2147483648),this[e]=(t=t<0?4294967295+t+1:t)>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},h.prototype.writeFloatLE=function(t,e,r){return m(this,t,e,!0,r)},h.prototype.writeFloatBE=function(t,e,r){return m(this,t,e,!1,r)},h.prototype.writeDoubleLE=function(t,e,r){return w(this,t,e,!0,r)},h.prototype.writeDoubleBE=function(t,e,r){return w(this,t,e,!1,r)},h.prototype.copy=function(t,e,r,n){if(!h.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r=r||0,n||0===n||(n=this.length),e>=t.length&&(e=t.length),(n=0<n&&n<r?r:n)===r)return 0;if(0===t.length||0===this.length)return 0;if((e=e||0)<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length);var o=(n=t.length-e<n-r?t.length-e+r:n)-r;if(this===t&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(e,r,n);else if(this===t&&r<e&&e<n)for(var i=o-1;0<=i;--i)t[i+e]=this[i+r];else Uint8Array.prototype.set.call(t,this.subarray(r,n),e);return o},h.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),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!h.isEncoding(n))throw new TypeError("Unknown encoding: "+n);var o;1===t.length&&(o=t.charCodeAt(0),("utf8"===n&&o<128||"latin1"===n)&&(t=o))}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");var i;if(!(r<=e))if(e>>>=0,r=void 0===r?this.length:r>>>0,"number"==typeof(t=t||0))for(i=e;i<r;++i)this[i]=t;else{var s=h.isBuffer(t)?t:h.from(t,n),a=s.length;if(0===a)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(i=0;i<r-e;++i)this[i+e]=s[i%a]}return this};var e=/[^+/0-9A-Za-z-_]/g;function b(t,e){var r;e=e||1/0;for(var n=t.length,o=null,i=[],s=0;s<n;++s){if(55295<(r=t.charCodeAt(s))&&r<57344){if(!o){if(56319<r){-1<(e-=3)&&i.push(239,191,189);continue}if(s+1===n){-1<(e-=3)&&i.push(239,191,189);continue}o=r;continue}if(r<56320){-1<(e-=3)&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&-1<(e-=3)&&i.push(239,191,189);if(o=null,r<128){if(--e<0)break;i.push(r)}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function E(t){return Q.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(e,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function A(t,e,r,n){for(var o=0;o<n&&!(o+r>=e.length||o>=t.length);++o)e[o+r]=t[o];return o}function T(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function S(t){return t!=t}}.call(this)}.call(this,D({}).Buffer)};var I,e,r,D=function(t){return e||I(e={exports:{},parent:t},e.exports),e.exports},n=Object.prototype.toString,M=(r=Object.create(null),function(t){t=n.call(t);return r[t]||(r[t]=t.slice(8,-1).toLowerCase())});function t(e){return e=e.toLowerCase(),function(t){return M(t)===e}}function i(t){return Array.isArray(t)}function o(t){return void 0===t}var F=t("ArrayBuffer");function z(t){return null!==t&&"object"==typeof t}function s(t){return"object"===M(t)&&(null===(t=Object.getPrototypeOf(t))||t===Object.prototype)}var a=t("Date"),u=t("File"),q=t("Blob"),V=t("FileList");function J(t){return"[object Function]"===n.call(t)}var f=t("URLSearchParams");function c(t,e){if(null!=t)if(i(t="object"!=typeof t?[t]:t))for(var r=0,n=t.length;r<n;r++)e.call(null,t[r],r,t);else for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.call(null,t[o],o,t)}h="undefined"!=typeof Uint8Array&&Object.getPrototypeOf(Uint8Array);var h,l={isArray:i,isArrayBuffer:F,isBuffer:function(t){return null!==t&&!o(t)&&null!==t.constructor&&!o(t.constructor)&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)},isFormData:function(t){return t&&("function"==typeof FormData&&t instanceof FormData||"[object FormData]"===n.call(t)||J(t.toString)&&"[object FormData]"===t.toString())},isArrayBufferView:function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&F(t.buffer)},isString:function(t){return"string"==typeof t},isNumber:function(t){return"number"==typeof t},isObject:z,isPlainObject:s,isUndefined:o,isDate:a,isFile:u,isBlob:q,isStream:function(t){return z(t)&&J(t.pipe)},isURLSearchParams:f,isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&"undefined"!=typeof window&&"undefined"!=typeof document},forEach:c,merge:function r(){var n={};function t(t,e){s(n[e])&&s(t)?n[e]=r(n[e],t):s(t)?n[e]=r({},t):i(t)?n[e]=t.slice():n[e]=t}for(var e=0,o=arguments.length;e<o;e++)c(arguments[e],t);return n},extend:function(r,t,n){return c(t,function(t,e){r[e]=n&&"function"==typeof t?L(t,n):t}),r},trim:function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")},inherits:function(t,e,r,n){t.prototype=Object.create(e.prototype,n),t.prototype.constructor=t,r&&Object.assign(t.prototype,r)},toFlatObject:function(t,e,r){var n,o,i,s={};e=e||{};do{for(o=(n=Object.getOwnPropertyNames(t)).length;0<o--;)s[i=n[o]]||(e[i]=t[i],s[i]=!0)}while((t=Object.getPrototypeOf(t))&&(!r||r(t,e))&&t!==Object.prototype);return e},endsWith:function(t,e,r){t=String(t),(void 0===r||r>t.length)&&(r=t.length),r-=e.length;t=t.indexOf(e,r);return-1!==t&&t===r},toArray:function(t){if(!t)return null;var e=t.length;if(o(e))return null;for(var r=new Array(e);0<e--;)r[e]=t[e];return r},isTypedArray:function(t){return h&&t instanceof h},isFileList:V};function W(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var H=function(t,e,r){var n;return!e||(r=r?r(e):l.isURLSearchParams(e)?e.toString():(n=[],l.forEach(e,function(t,e){null!=t&&(l.isArray(t)?e+="[]":t=[t],l.forEach(t,function(t){l.isDate(t)?t=t.toISOString():l.isObject(t)&&(t=JSON.stringify(t)),n.push(W(e)+"="+W(t))}))}),n.join("&")))&&(-1!==(e=t.indexOf("#"))&&(t=t.slice(0,e)),t+=(-1===t.indexOf("?")?"?":"&")+r),t},X={};function p(){this.handlers=[]}p.prototype.use=function(t,e,r){return this.handlers.push({fulfilled:t,rejected:e,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1},p.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)},p.prototype.forEach=function(e){l.forEach(this.handlers,function(t){null!==t&&e(t)})};function Y(r,n){l.forEach(r,function(t,e){e!==n&&e.toUpperCase()===n.toUpperCase()&&(r[n]=t,delete r[e])})}var X=p,d={};function g(t,e,r,n,o){Error.call(this),this.message=t,this.name="AxiosError",e&&(this.code=e),r&&(this.config=r),n&&(this.request=n),o&&(this.response=o)}l.inherits(g,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var $=g.prototype,G={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED"].forEach(function(t){G[t]={value:t}}),Object.defineProperties(g,G),Object.defineProperty($,"isAxiosError",{value:!0}),g.from=function(t,e,r,n,o,i){var s=Object.create($);return l.toFlatObject(t,s,function(t){return t!==Error.prototype}),g.call(s,t.message,e,r,n,o),s.name=t.name,i&&Object.assign(s,i),s};for(var d=g,K={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Q={toByteArray:function(t){for(var e,r=function(t){var e=t.length;if(0<e%4)throw new Error("Invalid string. Length must be a multiple of 4");t=t.indexOf("=");return[t=-1===t?e:t,t===e?0:4-t%4]}(t),n=r[0],r=r[1],o=new Z(3*(n+r)/4-r),i=0,s=0<r?n-4:n,a=0;a<s;a+=4)e=m[t.charCodeAt(a)]<<18|m[t.charCodeAt(a+1)]<<12|m[t.charCodeAt(a+2)]<<6|m[t.charCodeAt(a+3)],o[i++]=e>>16&255,o[i++]=e>>8&255,o[i++]=255&e;return 2===r&&(e=m[t.charCodeAt(a)]<<2|m[t.charCodeAt(a+1)]>>4,o[i++]=255&e),1===r&&(e=m[t.charCodeAt(a)]<<10|m[t.charCodeAt(a+1)]<<4|m[t.charCodeAt(a+2)]>>2,o[i++]=e>>8&255,o[i++]=255&e),o},fromByteArray:function(t){for(var e,r=t.length,n=r%3,o=[],i=0,s=r-n;i<s;i+=16383)o.push(function(t,e,r){for(var n,o=[],i=e;i<r;i+=3)n=(t[i]<<16&16711680)+(t[i+1]<<8&65280)+(255&t[i+2]),o.push(y[(n=n)>>18&63]+y[n>>12&63]+y[n>>6&63]+y[63&n]);return o.join("")}(t,i,s<i+16383?s:i+16383));return 1==n?(e=t[r-1],o.push(y[e>>2]+y[e<<4&63]+"==")):2==n&&(e=(t[r-2]<<8)+t[r-1],o.push(y[e>>10]+y[e>>4&63]+y[e<<2&63]+"=")),o.join("")}},y=[],m=[],Z="undefined"!=typeof Uint8Array?Uint8Array:Array,tt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",v=0,et=tt.length;v<et;++v)y[v]=tt[v],m[tt.charCodeAt(v)]=v;m["-".charCodeAt(0)]=62,m["_".charCodeAt(0)]=63;var rt,nt,w,O={read:function(t,e,r,n,o){var i,s,a=8*o-n-1,u=(1<<a)-1,f=u>>1,c=-7,h=r?o-1:0,l=r?-1:1,o=t[e+h];for(h+=l,i=o&(1<<-c)-1,o>>=-c,c+=a;0<c;i=256*i+t[e+h],h+=l,c-=8);for(s=i&(1<<-c)-1,i>>=-c,c+=n;0<c;s=256*s+t[e+h],h+=l,c-=8);if(0===i)i=1-f;else{if(i===u)return s?NaN:1/0*(o?-1:1);s+=Math.pow(2,n),i-=f}return(o?-1:1)*s*Math.pow(2,i-n)},write:function(t,e,r,n,o,i){var s,a,u=8*i-o-1,f=(1<<u)-1,c=f>>1,h=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,l=n?0:i-1,p=n?1:-1,i=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=f):(s=Math.floor(Math.log(e)/Math.LN2),e*(n=Math.pow(2,-s))<1&&(s--,n*=2),2<=(e+=1<=s+c?h/n:h*Math.pow(2,1-c))*n&&(s++,n/=2),f<=s+c?(a=0,s=f):1<=s+c?(a=(e*n-1)*Math.pow(2,o),s+=c):(a=e*Math.pow(2,c-1)*Math.pow(2,o),s=0));8<=o;t[r+l]=255&a,l+=p,a/=256,o-=8);for(s=s<<o|a,u+=o;0<u;t[r+l]=255&s,l+=p,s/=256,u-=8);t[r+l-p]|=128*i}},ot={},it=(!function(r){!function(){"use strict";ot=function(t,i){i=i||new FormData;var e=[];function s(t){return null===t?"":l.isDate(t)?t.toISOString():l.isArrayBuffer(t)||l.isTypedArray(t)?"function"==typeof Blob?new Blob([t]):r.from(t):t}return function n(t,o){if(l.isPlainObject(t)||l.isArray(t)){if(-1!==e.indexOf(t))throw Error("Circular reference detected in "+o);e.push(t),l.forEach(t,function(t,e){if(!l.isUndefined(t)){var r=o?o+"."+e:e;if(t&&!o&&"object"==typeof t)if(l.endsWith(e,"{}"))t=JSON.stringify(t);else if(l.endsWith(e,"[]")&&(e=l.toArray(t)))return void e.forEach(function(t){l.isUndefined(t)||i.append(r,s(t))});n(t,r)}}),e.pop()}else i.append(o,s(t))}(t),i}}.call(this)}.call(this,D({}).Buffer),l.isStandardBrowserEnv()?{write:function(t,e,r,n,o,i){var s=[];s.push(t+"="+encodeURIComponent(e)),l.isNumber(r)&&s.push("expires="+new Date(r).toGMTString()),l.isString(n)&&s.push("path="+n),l.isString(o)&&s.push("domain="+o),!0===i&&s.push("secure"),document.cookie=s.join("; ")},read:function(t){t=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}),st=function(t,e){return t&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)?(t=t,(r=e)?t.replace(/\/+$/,"")+"/"+r.replace(/^\/+/,""):t):e;var r},at=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"],ut=l.isStandardBrowserEnv()?(nt=/(msie|trident)/i.test(navigator.userAgent),w=document.createElement("a"),rt=ft(window.location.href),function(t){t=l.isString(t)?ft(t):t;return t.protocol===rt.protocol&&t.host===rt.host}):function(){return!0},b={};function ft(t){return nt&&(w.setAttribute("href",t),t=w.href),w.setAttribute("href",t),{href:w.href,protocol:w.protocol?w.protocol.replace(/:$/,""):"",host:w.host,search:w.search?w.search.replace(/^\?/,""):"",hash:w.hash?w.hash.replace(/^#/,""):"",hostname:w.hostname,port:w.port,pathname:"/"===w.pathname.charAt(0)?w.pathname:"/"+w.pathname}}function ct(t){d.call(this,null==t?"canceled":t,d.ERR_CANCELED),this.name="CanceledError"}l.inherits(ct,d,{__CANCEL__:!0});function ht(h){return new Promise(function(s,a){var t,r=h.data,n=h.headers,u=h.responseType;function f(){h.cancelToken&&h.cancelToken.unsubscribe(t),h.signal&&h.signal.removeEventListener("abort",t)}l.isFormData(r)&&l.isStandardBrowserEnv()&&delete n["Content-Type"];var c=new XMLHttpRequest,e=(h.auth&&(e=h.auth.username||"",i=h.auth.password?unescape(encodeURIComponent(h.auth.password)):"",n.Authorization="Basic "+btoa(e+":"+i)),st(h.baseURL,h.url));function o(){var t,e,r,n,o,i;c&&(r="getAllResponseHeaders"in c?(r=c.getAllResponseHeaders(),i={},r&&l.forEach(r.split("\n"),function(t){o=t.indexOf(":"),n=l.trim(t.substr(0,o)).toLowerCase(),o=l.trim(t.substr(o+1)),!n||i[n]&&0<=at.indexOf(n)||(i[n]="set-cookie"===n?(i[n]||[]).concat([o]):i[n]?i[n]+", "+o:o)}),i):null,t={data:u&&"text"!==u&&"json"!==u?c.response:c.responseText,status:c.status,statusText:c.statusText,headers:r,config:h,request:c},e=t.config.validateStatus,t.status&&e&&!e(t.status)?(e=new d("Request failed with status code "+t.status,[d.ERR_BAD_REQUEST,d.ERR_BAD_RESPONSE][Math.floor(t.status/100)-4],t.config,t.request,t),a(e)):s(t),f(),c=null)}c.open(h.method.toUpperCase(),H(e,h.params,h.paramsSerializer),!0),c.timeout=h.timeout,"onloadend"in c?c.onloadend=o:c.onreadystatechange=function(){c&&4===c.readyState&&(0!==c.status||c.responseURL&&0===c.responseURL.indexOf("file:"))&&setTimeout(o)},c.onabort=function(){c&&(a(new d("Request aborted",d.ECONNABORTED,h,c)),c=null)},c.onerror=function(){a(new d("Network Error",d.ERR_NETWORK,h,c,c)),c=null},c.ontimeout=function(){var t=h.timeout?"timeout of "+h.timeout+"ms exceeded":"timeout exceeded",e=h.transitional||K;h.timeoutErrorMessage&&(t=h.timeoutErrorMessage),a(new d(t,e.clarifyTimeoutError?d.ETIMEDOUT:d.ECONNABORTED,h,c)),c=null},l.isStandardBrowserEnv()&&(i=(h.withCredentials||ut(e))&&h.xsrfCookieName?it.read(h.xsrfCookieName):void 0)&&(n[h.xsrfHeaderName]=i),"setRequestHeader"in c&&l.forEach(n,function(t,e){void 0===r&&"content-type"===e.toLowerCase()?delete n[e]:c.setRequestHeader(e,t)}),l.isUndefined(h.withCredentials)||(c.withCredentials=!!h.withCredentials),u&&"json"!==u&&(c.responseType=h.responseType),"function"==typeof h.onDownloadProgress&&c.addEventListener("progress",h.onDownloadProgress),"function"==typeof h.onUploadProgress&&c.upload&&c.upload.addEventListener("progress",h.onUploadProgress),(h.cancelToken||h.signal)&&(t=function(t){c&&(a(!t||t.type?new b:t),c.abort(),c=null)},h.cancelToken&&h.cancelToken.subscribe(t),h.signal&&(h.signal.aborted?t():h.signal.addEventListener("abort",t)));var i,r=r||null,e=(i=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e))&&i[1]||"";e&&-1===["http","https","file"].indexOf(e)?a(new d("Unsupported protocol "+e+":",d.ERR_BAD_REQUEST,h)):c.send(r)})}var E,A,b=ct,u=a={};function lt(){throw new Error("setTimeout has not been defined")}function pt(){throw new Error("clearTimeout has not been defined")}function dt(e){if(E===setTimeout)return setTimeout(e,0);if((E===lt||!E)&&setTimeout)return(E=setTimeout)(e,0);try{return E(e,0)}catch(t){try{return E.call(null,e,0)}catch(t){return E.call(this,e,0)}}}try{E="function"==typeof setTimeout?setTimeout:lt}catch(t){E=lt}try{A="function"==typeof clearTimeout?clearTimeout:pt}catch(t){A=pt}var T,S=[],_=!1,R=-1;function gt(){_&&T&&(_=!1,T.length?S=T.concat(S):R=-1,S.length&&yt())}function yt(){if(!_){var t=dt(gt);_=!0;for(var e=S.length;e;){for(T=S,S=[];++R<e;)T&&T[R].run();R=-1,e=S.length}T=null,_=!1,function(e){if(A===clearTimeout)return clearTimeout(e);if((A===pt||!A)&&clearTimeout)return(A=clearTimeout)(e);try{A(e)}catch(t){try{return A.call(null,e)}catch(t){return A.call(this,e)}}}(t)}}function mt(t,e){this.fun=t,this.array=e}function C(){}u.nextTick=function(t){var e=new Array(arguments.length-1);if(1<arguments.length)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];S.push(new mt(t,e)),1!==S.length||_||dt(yt)},mt.prototype.run=function(){this.fun.apply(null,this.array)},u.title="browser",u.browser=!0,u.env={},u.argv=[],u.version="",u.versions={},u.on=C,u.addListener=C,u.once=C,u.off=C,u.removeListener=C,u.removeAllListeners=C,u.emit=C,u.prependListener=C,u.prependOnceListener=C,u.listeners=function(t){return[]},u.binding=function(t){throw new Error("process.binding is not supported")},u.cwd=function(){return"/"},u.chdir=function(t){throw new Error("process.chdir is not supported")},u.umask=function(){return 0};var B={},vt=(!function(r){!function(){"use strict";var e={"Content-Type":"application/x-www-form-urlencoded"};function s(t,e){!l.isUndefined(t)&&l.isUndefined(t["Content-Type"])&&(t["Content-Type"]=e)}var t,n={transitional:K,adapter:t="undefined"!=typeof XMLHttpRequest||void 0!==r&&"[object process]"===Object.prototype.toString.call(r)?ht:t,transformRequest:[function(t,e){if(Y(e,"Accept"),Y(e,"Content-Type"),!(l.isFormData(t)||l.isArrayBuffer(t)||l.isBuffer(t)||l.isStream(t)||l.isFile(t)||l.isBlob(t))){if(l.isArrayBufferView(t))return t.buffer;if(l.isURLSearchParams(t))return s(e,"application/x-www-form-urlencoded;charset=utf-8"),t.toString();var r,n=l.isObject(t),o=e&&e["Content-Type"];if((i=l.isFileList(t))||n&&"multipart/form-data"===o)return r=this.env&&this.env.FormData,ot(i?{"files[]":t}:t,r&&new r);if(n||"application/json"===o){s(e,"application/json");var i=t;if(l.isString(i))try{return(0,JSON.parse)(i),l.trim(i)}catch(t){if("SyntaxError"!==t.name)throw t}return(0,JSON.stringify)(i)}}return t}],transformResponse:[function(t){var e=this.transitional||n.transitional,r=e&&e.silentJSONParsing,e=e&&e.forcedJSONParsing,r=!r&&"json"===this.responseType;if(r||e&&l.isString(t)&&t.length)try{return JSON.parse(t)}catch(t){if(r){if("SyntaxError"===t.name)throw d.from(t,d.ERR_BAD_RESPONSE,this,null,this.response);throw t}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:null},validateStatus:function(t){return 200<=t&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};l.forEach(["delete","get","head"],function(t){n.headers[t]={}}),l.forEach(["post","put","patch"],function(t){n.headers[t]=l.merge(e)}),B=n}.call(this)}.call(this,a),function(e,r,t){var n=this||B;return l.forEach(t,function(t){e=t.call(n,e,r)}),e}),wt=function(t){return!(!t||!t.__CANCEL__)};function bt(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new b}function Et(e){return bt(e),e.headers=e.headers||{},e.data=vt.call(e,e.data,e.headers,e.transformRequest),e.headers=l.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),l.forEach(["delete","get","head","post","put","patch","common"],function(t){delete e.headers[t]}),(e.adapter||B.adapter)(e).then(function(t){return bt(e),t.data=vt.call(e,t.data,t.headers,e.transformResponse),t},function(t){return wt(t)||(bt(e),t&&t.response&&(t.response.data=vt.call(e,t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)})}function U(e,r){r=r||{};var n={};function o(t,e){return l.isPlainObject(t)&&l.isPlainObject(e)?l.merge(t,e):l.isPlainObject(e)?l.merge({},e):l.isArray(e)?e.slice():e}function i(t){return l.isUndefined(r[t])?l.isUndefined(e[t])?void 0:o(void 0,e[t]):o(e[t],r[t])}function t(t){if(!l.isUndefined(r[t]))return o(void 0,r[t])}function s(t){return l.isUndefined(r[t])?l.isUndefined(e[t])?void 0:o(void 0,e[t]):o(void 0,r[t])}function a(t){return t in r?o(e[t],r[t]):t in e?o(void 0,e[t]):void 0}var u={url:t,method:t,data:t,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a};return l.forEach(Object.keys(e).concat(Object.keys(r)),function(t){var e=u[t]||i,r=e(t);l.isUndefined(r)&&e!==a||(n[t]=r)}),n}var At,Tt={},St=(["object","boolean","number","function","string","symbol"].forEach(function(e,r){Tt[e]=function(t){return typeof t===e||"a"+(r<1?"n ":" ")+e}}),{}),k=(Tt.transitional=function(n,o,r){function i(t,e){return"[Axios v0.27.2] Transitional option '"+t+"'"+e+(r?". "+r:"")}return function(t,e,r){if(!1===n)throw new d(i(e," has been removed"+(o?" in "+o:"")),d.ERR_DEPRECATED);return o&&!St[e]&&(St[e]=!0,console.warn(i(e," has been deprecated since v"+o+" and will be removed in the near future"))),!n||n(t,e,r)}},{}),x=(At={assertOptions:function(t,e,r){if("object"!=typeof t)throw new d("options must be an object",d.ERR_BAD_OPTION_VALUE);for(var n=Object.keys(t),o=n.length;0<o--;){var i=n[o],s=e[i];if(s){var a=t[i],s=void 0===a||s(a,i,t);if(!0!==s)throw new d("option "+i+" must be "+s,d.ERR_BAD_OPTION_VALUE)}else if(!0!==r)throw new d("Unknown option "+i,d.ERR_BAD_OPTION)}},validators:Tt}).validators;function j(t){this.defaults=t,this.interceptors={request:new X,response:new X}}function N(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");this.promise=new Promise(function(t){e=t});var e,n=this;this.promise.then(function(t){if(n._listeners){for(var e=n._listeners.length,r=0;r<e;r++)n._listeners[r](t);n._listeners=null}}),this.promise.then=function(t){var e,t=new Promise(function(t){n.subscribe(t),e=t}).then(t);return t.cancel=function(){n.unsubscribe(e)},t},t(function(t){n.reason||(n.reason=new b(t),e(n.reason))})}j.prototype.request=function(t,e){"string"==typeof t?(e=e||{}).url=t:e=t||{},(e=U(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var t=e.transitional,r=(void 0!==t&&At.assertOptions(t,{silentJSONParsing:x.transitional(x.boolean),forcedJSONParsing:x.transitional(x.boolean),clarifyTimeoutError:x.transitional(x.boolean)},!1),[]),n=!0;this.interceptors.request.forEach(function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(n=n&&t.synchronous,r.unshift(t.fulfilled,t.rejected))});var o,i=[];if(this.interceptors.response.forEach(function(t){i.push(t.fulfilled,t.rejected)}),n){for(var s=e;r.length;){var a=r.shift(),u=r.shift();try{s=a(s)}catch(t){u(t);break}}try{o=Et(s)}catch(t){return Promise.reject(t)}for(;i.length;)o=o.then(i.shift(),i.shift())}else{var f=[Et,void 0];for(Array.prototype.unshift.apply(f,r),f=f.concat(i),o=Promise.resolve(e);f.length;)o=o.then(f.shift(),f.shift())}return o},j.prototype.getUri=function(t){t=U(this.defaults,t);var e=st(t.baseURL,t.url);return H(e,t.params,t.paramsSerializer)},l.forEach(["delete","get","head","options"],function(r){j.prototype[r]=function(t,e){return this.request(U(e||{},{method:r,url:t,data:(e||{}).data}))}}),l.forEach(["post","put","patch"],function(o){function t(n){return function(t,e,r){return this.request(U(r||{},{method:o,headers:n?{"Content-Type":"multipart/form-data"}:{},url:t,data:e}))}}j.prototype[o]=t(),j.prototype[o+"Form"]=t(!0)}),k=j,N.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},N.prototype.subscribe=function(t){this.reason?t(this.reason):this._listeners?this._listeners.push(t):this._listeners=[t]},N.prototype.unsubscribe=function(t){this._listeners&&-1!==(t=this._listeners.indexOf(t))&&this._listeners.splice(t,1)},N.source=function(){var e;return{token:new N(function(t){e=t}),cancel:e}};var q=N,f=function e(r){var t=new k(r),n=L(k.prototype.request,t);return l.extend(n,k.prototype,t),l.extend(n,t),n.create=function(t){return e(U(r,t))},n}(B),_t=(f.Axios=k,f.CanceledError=b,f.CancelToken=q,f.isCancel=wt,f.VERSION="0.27.2",f.toFormData=ot,f.AxiosError=d,f.Cancel=f.CanceledError,f.all=function(t){return Promise.all(t)},f.spread=function(e){return function(t){return e.apply(null,t)}},f.isAxiosError=function(t){return l.isObject(t)&&!0===t.isAxiosError},f.default=f),Rt={},P={};return function(m){!function(){"use strict";function f(t,e){var r,n,o,i,s="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(s)return o=!(n=!0),{s:function(){s=s.call(t)},n:function(){var t=s.next();return n=t.done,t},e:function(t){o=!0,r=t},f:function(){try{n||null==s.return||s.return()}finally{if(o)throw r}}};if(Array.isArray(t)||(s=c(t))||e&&t&&"number"==typeof t.length)return s&&(t=s),i=0,{s:e=function(){},n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:e};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function c(t,e){var r;if(t)return"string"==typeof t?h(t,e):"Map"===(r="Object"===(r=Object.prototype.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:r)||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?h(t,e):void 0}function h(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}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 n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){for(var r=0;r<e.length;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 t(t,e,r){e&&o(t.prototype,e),r&&o(t,r),Object.defineProperty(t,"prototype",{writable:!1})}Object.defineProperty(P,"__esModule",{value:!0}),P.varsnap=P.clientName=P.version=void 0,P.version="1.8.4",P.clientName="javascript."+P.version;var r={varsnap:!0,env:"development",branch:"",producerToken:"",consumerToken:"",logger:console},s=[],a=[],l=(t(g,null,[{key:"getConfig",value:function(t,e){return(t=t&&t[e])?t.toString().toLowerCase():""}},{key:"setConfig",value:function(t,e,r){return"varsnap"===e&&(t[e]=r="string"==typeof r?"true"===r:r),"env"!==e&&"producerToken"!==e&&"consumerToken"!==e&&"branch"!==e||(t[e]=r),"logger"===e&&(t[e]=r),t}},{key:"getSignature",value:function(t,e){var r="",r=""!==e&&void 0!==e?e:(r=(r=t.toString().split("{")[0]).replace(/^\s+|\s+$/g,"")).replace(/,\s+/g,",");return"javascript."+P.version+"."+r}},{key:"ajax",value:function(t,e){t={method:"POST",url:t,headers:{"Content-Type":"application/x-www-form-urlencoded"},data:new URLSearchParams(e).toString(),responseType:"json"};return g.isNode()&&t.headers&&(t.headers["User-Agent"]="varsnap.js"),(0,_t.default)(t).then(function(t){return t.data}).catch(function(t){return t})}},{key:"debug",value:function(t,e){t.logger&&t.logger.debug(e)}},{key:"log",value:function(t,e){t.logger&&t.logger.log(e)}},{key:"error",value:function(t,e){t.logger&&t.logger.error(e)}},{key:"resetProducers",value:function(){s=[]}},{key:"resetConsumers",value:function(){a=[]}},{key:"getProducers",value:function(){return s}},{key:"getConsumers",value:function(){return a}},{key:"limitString",value:function(t){t=String(t);return t.length<=30?t:t.substring(0,30-"...".length)+"..."}},{key:"isNode",value:function(){return"object"===(void 0===m?"undefined":e(m))&&"undefined"==typeof window}},{key:"getBranch",value:function(t){var e=g.getConfig(t,"branch");return e?new Promise(function(t){return t(e)}):g.isNode()?new Promise(function(r){(0,Rt.exec)("git rev-parse --abbrev-ref HEAD",function(t,e){return r(e.trim())})}):new Promise(function(t){return t("")})}}]),g),p=(t(i,[{key:"isEnabled",value:function(){return!!this.config.varsnap&&"production"===l.getConfig(this.config,"env")&&!!l.getConfig(this.config,"producerToken")}},{key:"produce",value:function(e,t){var r=this;return this.isEnabled()?(l.debug(this.config,"Sending call to Varsnap"),Promise.resolve(t).then(function(t){t={producer_token:l.getConfig(r.config,"producerToken"),signature:r.signature,inputs:i.serialize(e),prod_outputs:i.serialize(t)};return l.ajax("https://www.varsnap.com/api/snap/produce/",t).then(function(){return!0}).catch(function(t){if(t.response){if(429===t.response.status)return l.error(r.config,"Cannot produce to Varsnap; Signature at rate limit"),!0;404===t.response.status?l.error(r.config,"Cannot produce to Varsnap; check your producer token"):l.error(r.config,t.response.statusText)}return!1})})):new Promise(function(t){return t(!1)})}}],[{key:"serialize",value:function(t){return JSON.stringify(t)}},{key:"serialize_formatted",value:function(t){return JSON.stringify(t,null,2)}}]),i),u=(t(d,[{key:"isEnabled",value:function(){return!!this.config.varsnap&&"development"===l.getConfig(this.config,"env")&&!!l.getConfig(this.config,"consumerToken")}},{key:"consume",value:function(a){var o,u=this;return this.isEnabled()?(o={consumer_token:l.getConfig(this.config,"consumerToken"),signature:this.signature},l.ajax("https://www.varsnap.com/api/snap/consume/",o).then(function(t){var e=t;if(!e||"ok"!==e.status)return[new Promise(function(t){return l.error(u.config,"Received error from Varsnap: "+e.status),t(!1)})];0===e.results.length&&l.log(u.config,"No snaps found for signature: "+o.signature);var r,s=[],n=f(e.results);try{for(n.s();!(r=n.n()).done;)!function(){var t,n=r.value,o=d.deserialize(n.inputs),i=d.deserialize(n.prod_outputs),e=void 0;try{e=u.targetFunc.apply(u,function(t){if(Array.isArray(t))return h(t)}(t=o)||function(){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}()||c(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())}catch(t){e=t}e=Promise.resolve(e).then(function(e){var r=p.serialize(i)===p.serialize(e);return u.reportCentral(a,n,i,e,r).then(function(t){u.reportLog(n.id,o,i,e,r,t)}),r});s.push(e)}()}catch(t){n.e(t)}finally{n.f()}return s}).then(function(t){return Promise.all(t).then(function(t){return t.every(function(t){return t})})}).catch(function(t){return l.error(u.config,"Cannot contact Varsnap: "+t),!1})):new Promise(function(t){return l.error(u.config,"Varsnap not enabled for testing"),t(!1)})}},{key:"reportCentral",value:function(t,e,r,n,o){var i=this,t={trial_group_id:t.trial_group_id,consumer_token:l.getConfig(this.config,"consumerToken"),snap_id:e.id,test_outputs:p.serialize(n),matches:o.toString(),snap_outputs_formatted:p.serialize_formatted(r),test_outputs_formatted:p.serialize_formatted(n)};return l.ajax("https://www.varsnap.com/api/trial/produce/",t).then(function(t){return!(!t||"ok"!==t.status)&&t.trial_url}).catch(function(t){return l.error(i.config,"Cannot upload test results to Varsnap: "+t),!1})}},{key:"reportLog",value:function(t,e,r,n,o,i){o||(l.log(this.config,""),l.log(this.config,"Testing with Varsnap uuid: "+t),l.log(this.config,"Signature: "+this.signature),l.log(this.config,"Function input args: "+l.limitString(e)),l.log(this.config,"Production function outputs: "+l.limitString(r)),l.log(this.config,"Your function outputs: "+l.limitString(n)),l.log(this.config,"Matching outputs: "+o),t="Cannot upload trial",i&&(t=String(i)),l.log(this.config,"Trial URL: "+t))}},{key:"reportTrialGroup",value:function(t){l.log(this.config,"Trial Group: "+t.trial_group_url)}}],[{key:"deserialize",value:function(t){if(""!==t)return JSON.parse(t)}}]),d);function d(t,e,r){n(this,d),this.targetFunc=t,this.signature=e,this.config=r}function i(t,e,r){n(this,i),this.targetFunc=t,this.signature=e,this.config=r}function g(){n(this,g)}function y(o,t){function e(){for(var t,e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];try{t=o.apply(void 0,r)}catch(t){throw i.produce(r,t),t}return i.produce(r,t),t}var t=l.getSignature(o,t=void 0===t?"":t),i=new p(o,t,y._config),r=new u(o,t,y._config);return e.producer=i,e.consumer=r,e.signature=t,s.push(i),a.push(r),e}(P.varsnap=y)._config=r,y.updateConfig=function(t){for(var e=y._config,r=0,n=Object.keys(y._config);r<n.length;r++){var o=n[r];Object.prototype.hasOwnProperty.call(t,o)&&(e=l.setConfig(e,o,t[o]))}y._config=e},y.reset=function(){l.resetConsumers(),l.resetProducers()},y.version=P.version,y.runTests=function(){var e,i=l.getConsumers();return 0===i.length?Promise.resolve(!0):(e=i[0].config,l.getBranch(e).then(function(t){return{branch:t,consumer_token:l.getConfig(e,"consumerToken"),client:P.clientName}}).then(function(t){return l.ajax("https://www.varsnap.com/api/trial_group/",t)}).then(function(t){return t}).catch(function(t){t=t&&t.response&&t.response.data?t.response.data.error:t.toString();return l.error(e,"Cannot generate a new Trial Group: "+t),{status:"not ok",project_id:"",trial_group_id:"",trial_group_url:""}}).then(function(t){var e,r=[],n=f(i);try{for(n.s();!(e=n.n()).done;){var o=e.value.consume(t);r.push(o)}}catch(t){n.e(t)}finally{n.f()}return 0<i.length&&i[0].reportTrialGroup(t),Promise.all(r)}).then(function(t){return t.every(function(t){return t})}))}}.call(this)}.call(this,a),P.varsnap})}("undefined"==typeof Varsnap?Varsnap={}:Varsnap);
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "varsnap",
3
- "version": "1.8.1",
3
+ "version": "1.8.4",
4
4
  "description": "Varsnap Client",
5
5
  "main": "dist/built/index.js",
6
6
  "types": "dist/built/index.d.ts",
7
7
  "exports": {
8
8
  ".": {
9
9
  "require": "./dist/built/index.js",
10
- "default": "./dist/built/index.js",
11
- "types": "./dist/built/index.d.ts"
10
+ "types": "./dist/built/index.d.ts",
11
+ "default": "./dist/built/index.js"
12
12
  },
13
13
  "./gitbranchenv": "./dist/built/varsnap/gitbranchenv.js",
14
14
  "./gitbranchenv.js": "./dist/built/varsnap/gitbranchenv.js"
@@ -52,20 +52,20 @@
52
52
  "browserify": "^17.0.0",
53
53
  "chai": "^4.2.0",
54
54
  "eslint": "^8.4.1",
55
- "mocha": "^9.1.3",
55
+ "mocha": "^10.0.0",
56
56
  "mochify": "^9.0.0",
57
57
  "nyc": "^15.1.0",
58
- "sinon": "^12.0.1",
58
+ "sinon": "^14.0.0",
59
59
  "source-map-support": "^0.5.19",
60
60
  "tinyify": "^3.0.0",
61
- "ts-mocha": "albertyw/ts-mocha",
61
+ "ts-mocha": "^10.0.0",
62
62
  "ts-node": "^10.1.0",
63
63
  "tsify": "^5.0.2",
64
64
  "typescript": "^4.1.3",
65
65
  "uglify-js": "^3.12.3"
66
66
  },
67
67
  "dependencies": {
68
- "axios": "^0.24.0"
68
+ "axios": "^0.27.0"
69
69
  },
70
70
  "files": [
71
71
  "dist/varsnap.*",
package/CHANGELOG.md DELETED
@@ -1,371 +0,0 @@
1
- CHANGELOG
2
- =========
3
-
4
- 1.8.1 (2022-01-15)
5
- ------------------
6
-
7
- - Fix varsnap import config
8
- - Update dependencies
9
-
10
-
11
- 1.8.0 (2022-01-14)
12
- ------------------
13
-
14
- - Add `gitbranchenv` to make getting git branch names easier
15
- - Add documentation of git branch usage
16
- - Cleanup
17
- - Update depencencies
18
-
19
-
20
- 1.7.0 (2022-01-03)
21
- ------------------
22
-
23
- - Send git branch when generating trial groups
24
- - Update dependencies
25
- - Refactors
26
-
27
-
28
- 1.6.10 (2022-01-01)
29
- -------------------
30
-
31
- - Update dependencies
32
- - Simplify testing
33
-
34
-
35
- 1.6.9 (2021-09-11)
36
- ------------------
37
-
38
- - Update dependencies
39
-
40
-
41
- 1.6.8 (2021-07-25)
42
- ------------------
43
-
44
- - Remove "v" prefix from versions
45
- - Optimize dependency installation during CI
46
- - Update dependencies
47
-
48
-
49
- 1.6.7 (2021-05-22)
50
- ------------------
51
-
52
- - Update dependencies
53
- - Send client name when generating trial group
54
-
55
-
56
- 1.6.6 (2021-04-10)
57
- ------------------
58
-
59
- - Refactors
60
- - Update dependencies
61
-
62
-
63
- 1.6.5 (2021-03-18)
64
- ------------------
65
-
66
- - Show trial group url in test output
67
- - Fix error handling on failed snap produce calls
68
- - Better handle http 429 errors
69
- - Update dependencies
70
- - Use DroneCI
71
-
72
-
73
- 1.6.4 (2020-12-28)
74
- ------------------
75
-
76
- - Remove whitespace when recording function arguments so varsnap.js doesn't conflict with minifiers
77
- - Add minification configs to readme
78
-
79
-
80
- 1.6.3 (2020-12-13)
81
- ------------------
82
-
83
- - Send requests to varsnap with a custom user agent only when not in browser
84
-
85
-
86
- 1.6.2 (2020-12-12)
87
- ------------------
88
-
89
- - Fix bug with runTests when there are no consumers
90
- - Fix readme typo
91
- - Update dependencies
92
-
93
-
94
- 1.6.1 (2020-12-08)
95
- ------------------
96
-
97
- - Support trial groups
98
- - Update dependencies
99
-
100
-
101
- 1.6.0 (2020-11-26)
102
- ------------------
103
-
104
- - Support adding a function name/signature as a second argument to varsnap
105
- - Cache signature on varsnap wrapped method
106
-
107
-
108
- 1.5.6 (2020-11-23)
109
- ------------------
110
-
111
- - Update varsnap consume to compare serialized data so non-primitive data types are comparable
112
- - Update dependencies
113
- - Clean up integration tests
114
-
115
-
116
- 1.5.5 (2020-11-15)
117
- ------------------
118
-
119
- - Log a warning when no snaps are available to test against
120
- - Update dependencies
121
-
122
-
123
- 1.5.4 (2020-07-19)
124
- ------------------
125
-
126
- - Send formatted Trial outputs to Varsnap server
127
- - Add tests
128
- - Dependency updates
129
-
130
-
131
- 1.5.3 (2020-06-03)
132
- ------------------
133
-
134
- - Remove async/await
135
- - Fix config types in readme
136
- - Add more tests
137
- - Fix coverage calculation
138
-
139
-
140
- 1.5.2 (2020-05-12)
141
- ------------------
142
-
143
- - Make `runTests()` function not async and instead return a Promise
144
- - Removed the `varsnap.full.js` distributable
145
- - Switch from deprecated request node package to axios
146
- - Further compressed the distributable files
147
- - Update dependencies
148
-
149
-
150
- 1.5.1 (2020-05-09)
151
- ------------------
152
-
153
- - Fix bug when calculating trial results
154
- - Clean up logging
155
- - Prune npm package files
156
- - Update dependencies
157
-
158
-
159
- 1.5.0 (2020-04-26)
160
- ------------------
161
-
162
- - Add ability to resolve and snap promises
163
- - Clean up packaging
164
- - Dependency updates
165
-
166
-
167
- 1.4.0 (2020-04-18)
168
- ------------------
169
-
170
- - Add `varsnap.updateConfig` function to replace writing config directly
171
- - Remove `varsnap.config`
172
- - Refactors
173
- - NPM update
174
-
175
-
176
- 1.3.3 (2020-04-15)
177
- ------------------
178
-
179
- - Refactor typescript
180
-
181
-
182
- 1.3.2 (2020-04-11)
183
- ------------------
184
-
185
- - Removed all lint warnings
186
- - Cleanup and refactors
187
-
188
-
189
- 1.3.1 (2020-04-03)
190
- ------------------
191
-
192
- - Fix package exports
193
- - Dependency updates
194
-
195
-
196
- 1.3.0 (2020-04-01)
197
- ------------------
198
-
199
- - Remove mocha as a production dependency.
200
- Users of mocha for testing will have to copy a more verbose testing function.
201
- See the README for details.
202
- - Dependency updates
203
-
204
-
205
- 1.2.0 (2020-03-31)
206
- ------------------
207
-
208
- - Updated entire codebase to typescript; you can now import type definitions
209
-
210
-
211
- 1.1.4 (2020-03-23)
212
- ------------------
213
-
214
- - Fix a bug where varsnap tests would report the success/failure of the last case only.
215
- It will now report a success only if all cases pass.
216
- - Update deps
217
-
218
-
219
- 1.1.3 (2020-03-07)
220
- ------------------
221
-
222
- - Update deps
223
- - Use JS strict mode
224
-
225
-
226
- 1.1.2 (2020-02-09)
227
- ------------------
228
-
229
- - Fix string formatting again
230
- - Update dependencies
231
-
232
-
233
- 1.1.1 (2020-02-01)
234
- ------------------
235
-
236
- - Fix bug with formatting non-string variables
237
- - Update dependencies
238
-
239
-
240
- 1.1.0 (2019-12-23)
241
- ------------------
242
-
243
- - Limit the length of debug strings in test outputs
244
- - Update dependencies
245
-
246
-
247
- 1.0.3 (2019-11-17)
248
- ------------------
249
-
250
- - Reduce logging in production
251
- - Update VarSnap to Varsnap
252
-
253
-
254
- 1.0.2 (2019-10-29)
255
- ------------------
256
-
257
- - Fix generated distributables
258
- - Update dependencies
259
-
260
-
261
- 1.0.1 (2019-10-27)
262
- ------------------
263
-
264
- - Support comparing exceptions
265
- - Fix serialization of test outputs
266
- - Better handle logging for unconfigured client
267
- - Fix sequencing of test log outputs
268
-
269
-
270
- 1.0.0 (2019-10-21)
271
- ------------------
272
-
273
- - Update README
274
- - Refactor and break out test functionality
275
-
276
-
277
- 0.4.5 (2019-10-17)
278
- ------------------
279
-
280
- - Show trial url after running tests
281
- - Add dist-all script with all core functions
282
- - Add version header to minified script
283
-
284
-
285
- 0.4.4 (2019-10-14)
286
- ------------------
287
-
288
- - Test against all returned snaps
289
- - Add a script to browserify all varsnap functions
290
- - Include version in snap for browser distributable
291
-
292
-
293
- 0.4.3 (2019-10-12)
294
- ------------------
295
-
296
- - Fix "enable" check on Consumers
297
- - Refactors
298
-
299
-
300
- 0.4.2 (2019-10-06)
301
- ------------------
302
-
303
- - Report trials to varsnap server
304
- - Refactors
305
-
306
-
307
- 0.4.1 (2019-09-09)
308
- ------------------
309
-
310
- - Update dependencies
311
- - Increase mocha timeout
312
-
313
-
314
- 0.4.0 (2019-08-18)
315
- ------------------
316
-
317
- - Updated dependencies and added mocha as a production dependency
318
- - Added a mocha-based TestCase
319
- - Removed running tests automatically in development env
320
- - Various bugfixes
321
- - Better node.js support
322
-
323
-
324
- 0.3.2 (2019-07-20)
325
- ------------------
326
-
327
- - Updated dependencies
328
- - Updated Snap Consume logic to work with batch endpoint
329
- - Update release instructions
330
-
331
-
332
- 0.3.1 (2019-07-09)
333
- ------------------
334
-
335
- - Add configurable logging in client
336
- - Make sure varsnap doesn't fail when not configured
337
-
338
-
339
- 0.3.0 (2019-07-07)
340
- ------------------
341
-
342
- - Change configuration from environment/global variable to a property of the varsnap function
343
-
344
-
345
- 0.2.0 (2019-07-07)
346
- ------------------
347
-
348
- - Generate a distributable for browsers
349
- - Switch browser config variable from `varsnap` to `varsnapConfig`
350
- - Switch from requests to xhr package
351
- - Fix bug when reading non-string variables
352
-
353
-
354
- 0.1.1 (2019-06-27)
355
- ------------------
356
-
357
- - Switch to using a deep equal comparison
358
-
359
-
360
- 0.1.0 (2019-06-25)
361
- ------------------
362
-
363
- - Initial working release including Varsnap Producer and Consumer
364
- - Updated readme
365
- - Added example script
366
-
367
-
368
- 0.0.1 (2019-06-20)
369
- ------------------
370
-
371
- - Init an empty package