varsnap 1.8.1 → 1.8.2

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.
package/CHANGELOG.md CHANGED
@@ -1,6 +1,14 @@
1
1
  CHANGELOG
2
2
  =========
3
3
 
4
+ 1.8.2 (2022-01-29)
5
+ ------------------
6
+
7
+ - Remove dependency on `remove-query-string`
8
+ - Return branch from `setGitBranchEnv`
9
+ - Update dependencies
10
+
11
+
4
12
  1.8.1 (2022-01-15)
5
13
  ------------------
6
14
 
@@ -1,6 +1,4 @@
1
- /// <reference types="node" />
2
- import querystring = require('querystring');
3
- export declare const version = "1.8.1";
1
+ export declare const version = "1.8.2";
4
2
  export declare const clientName: string;
5
3
  export interface Config {
6
4
  varsnap: boolean;
@@ -11,7 +9,7 @@ export interface Config {
11
9
  logger?: Logger;
12
10
  }
13
11
  declare type ConfigKeys = keyof Config;
14
- declare type rawJSONObject = ConsumeSnapResponse | ProduceTrialResponse | TrialGroupRequest | TrialGroupResponse | querystring.ParsedUrlQueryInput;
12
+ declare type rawJSONObject = ConsumeSnapResponse | ProduceTrialResponse | TrialGroupRequest | TrialGroupResponse | Record<string, string>;
15
13
  export interface Logger {
16
14
  debug(s: string): void;
17
15
  log(s: string): void;
@@ -2,13 +2,12 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.runTests = exports.varsnap = exports.Consumer = exports.Producer = exports.Util = exports.clientName = exports.version = void 0;
4
4
  const axios_1 = require("axios");
5
- const querystring = require("querystring");
6
5
  const child_process_1 = require("child_process");
7
6
  const produceURL = 'https://www.varsnap.com/api/snap/produce/';
8
7
  const consumeURL = 'https://www.varsnap.com/api/snap/consume/';
9
8
  const produceTrialURL = 'https://www.varsnap.com/api/trial/produce/';
10
9
  const trialGroupURL = 'https://www.varsnap.com/api/trial_group/';
11
- exports.version = '1.8.1';
10
+ exports.version = '1.8.2';
12
11
  exports.clientName = 'javascript.' + exports.version;
13
12
  const defaultConfig = {
14
13
  varsnap: true,
@@ -63,13 +62,15 @@ class Util {
63
62
  return 'javascript.' + exports.version + '.' + signature;
64
63
  }
65
64
  static ajax(url, requestData) {
65
+ const requestParams = new URLSearchParams(requestData);
66
+ const data = requestParams.toString();
66
67
  const options = {
67
68
  method: 'POST',
68
69
  url: url,
69
70
  headers: {
70
71
  'Content-Type': 'application/x-www-form-urlencoded',
71
72
  },
72
- data: querystring.stringify(requestData),
73
+ data: data,
73
74
  responseType: 'json',
74
75
  };
75
76
  if (Util.isNode() && options.headers) {
@@ -77,6 +78,8 @@ class Util {
77
78
  }
78
79
  const ajaxPromise = (0, axios_1.default)(options).then((response) => {
79
80
  return response.data;
81
+ }).catch((error) => {
82
+ return error;
80
83
  });
81
84
  return ajaxPromise;
82
85
  }
@@ -298,7 +301,7 @@ class Consumer {
298
301
  'consumer_token': Util.getConfig(this.config, 'consumerToken'),
299
302
  'snap_id': snap.id,
300
303
  'test_outputs': Producer.serialize(localOutputs),
301
- 'matches': matches,
304
+ 'matches': matches.toString(),
302
305
  'snap_outputs_formatted': Producer.serialize_formatted(prodOutputs),
303
306
  'test_outputs_formatted': Producer.serialize_formatted(localOutputs),
304
307
  };
@@ -1 +1 @@
1
- export declare function setGitBranchEnv(): void;
1
+ export declare function setGitBranchEnv(): Promise<string>;
@@ -11,9 +11,10 @@ function setGitBranchEnv() {
11
11
  env: 'none',
12
12
  branch: '',
13
13
  };
14
- core_1.Util.getBranch(config)
14
+ return core_1.Util.getBranch(config)
15
15
  .then((branch) => {
16
16
  process.env.GIT_BRANCH = branch;
17
+ return branch;
17
18
  });
18
19
  }
19
20
  exports.setGitBranchEnv = setGitBranchEnv;
package/dist/varsnap.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Varsnap.js v1.8.1
2
+ * Varsnap.js v1.8.2
3
3
  */
4
4
  (function(exports) {
5
5
  !function(e) {
@@ -23,7 +23,7 @@
23
23
  "Content-Type": "application/x-www-form-urlencoded"
24
24
  };
25
25
  function o(e, t) {
26
- !f.isUndefined(e) && f.isUndefined(e["Content-Type"]) && (e["Content-Type"] = t);
26
+ !l.isUndefined(e) && l.isUndefined(e["Content-Type"]) && (e["Content-Type"] = t);
27
27
  }
28
28
  var i, a = {
29
29
  transitional: {
@@ -34,11 +34,11 @@
34
34
  adapter: (("undefined" != typeof XMLHttpRequest || void 0 !== t && "[object process]" === Object.prototype.toString.call(t)) && (i = n({})),
35
35
  i),
36
36
  transformRequest: [ function(e, t) {
37
- return g(t, "Accept"), g(t, "Content-Type"), f.isFormData(e) || f.isArrayBuffer(e) || f.isBuffer(e) || f.isStream(e) || f.isFile(e) || f.isBlob(e) ? e : f.isArrayBufferView(e) ? e.buffer : f.isURLSearchParams(e) ? (o(t, "application/x-www-form-urlencoded;charset=utf-8"),
38
- e.toString()) : f.isObject(e) || t && "application/json" === t["Content-Type"] ? (o(t, "application/json"),
37
+ return m(t, "Accept"), m(t, "Content-Type"), l.isFormData(e) || l.isArrayBuffer(e) || l.isBuffer(e) || l.isStream(e) || l.isFile(e) || l.isBlob(e) ? e : l.isArrayBufferView(e) ? e.buffer : l.isURLSearchParams(e) ? (o(t, "application/x-www-form-urlencoded;charset=utf-8"),
38
+ e.toString()) : l.isObject(e) || t && "application/json" === t["Content-Type"] ? (o(t, "application/json"),
39
39
  function(e, t, n) {
40
- if (f.isString(e)) try {
41
- return (0, JSON.parse)(e), f.trim(e);
40
+ if (l.isString(e)) try {
41
+ return (0, JSON.parse)(e), l.trim(e);
42
42
  } catch (r) {
43
43
  if ("SyntaxError" !== r.name) throw r;
44
44
  }
@@ -47,11 +47,11 @@
47
47
  } ],
48
48
  transformResponse: [ function(e) {
49
49
  var t = this.transitional || a.transitional, n = t && t.silentJSONParsing, r = t && t.forcedJSONParsing, o = !n && "json" === this.responseType;
50
- if (o || r && f.isString(e) && e.length) try {
50
+ if (o || r && l.isString(e) && e.length) try {
51
51
  return JSON.parse(e);
52
52
  } catch (i) {
53
53
  if (o) {
54
- if ("SyntaxError" === i.name) throw m(i, this, "E_JSON_PARSE");
54
+ if ("SyntaxError" === i.name) throw v(i, this, "E_JSON_PARSE");
55
55
  throw i;
56
56
  }
57
57
  }
@@ -71,13 +71,13 @@
71
71
  }
72
72
  }
73
73
  };
74
- f.forEach([ "delete", "get", "head" ], function(e) {
74
+ l.forEach([ "delete", "get", "head" ], function(e) {
75
75
  a.headers[e] = {};
76
- }), f.forEach([ "post", "put", "patch" ], function(e) {
77
- a.headers[e] = f.merge(r);
76
+ }), l.forEach([ "post", "put", "patch" ], function(e) {
77
+ a.headers[e] = l.merge(r);
78
78
  }), e.exports = a;
79
79
  }).call(this);
80
- }).call(this, x);
80
+ }).call(this, _);
81
81
  }), n = e(function(e, n) {
82
82
  "use strict";
83
83
  var r = t({});
@@ -87,16 +87,16 @@
87
87
  function u() {
88
88
  e.cancelToken && e.cancelToken.unsubscribe(o), e.signal && e.signal.removeEventListener("abort", o);
89
89
  }
90
- f.isFormData(i) && delete a["Content-Type"];
90
+ l.isFormData(i) && delete a["Content-Type"];
91
91
  var c = new XMLHttpRequest();
92
92
  if (e.auth) {
93
- var l = e.auth.username || "", d = e.auth.password ? unescape(encodeURIComponent(e.auth.password)) : "";
94
- a.Authorization = "Basic " + btoa(l + ":" + d);
93
+ var f = e.auth.username || "", p = e.auth.password ? unescape(encodeURIComponent(e.auth.password)) : "";
94
+ a.Authorization = "Basic " + btoa(f + ":" + p);
95
95
  }
96
- var h = w(e.baseURL, e.url);
96
+ var h = S(e.baseURL, e.url);
97
97
  function g() {
98
98
  if (c) {
99
- var r = "getAllResponseHeaders" in c ? T(c.getAllResponseHeaders()) : null, o = {
99
+ var r = "getAllResponseHeaders" in c ? k(c.getAllResponseHeaders()) : null, o = {
100
100
  data: s && "text" !== s && "json" !== s ? c.response : c.responseText,
101
101
  status: c.status,
102
102
  statusText: c.statusText,
@@ -104,31 +104,31 @@
104
104
  config: e,
105
105
  request: c
106
106
  };
107
- y(function(e) {
107
+ b(function(e) {
108
108
  t(e), u();
109
109
  }, function(e) {
110
110
  n(e), u();
111
111
  }, o), c = null;
112
112
  }
113
113
  }
114
- if (c.open(e.method.toUpperCase(), p(h, e.params, e.paramsSerializer), !0), c.timeout = e.timeout,
114
+ if (c.open(e.method.toUpperCase(), d(h, e.params, e.paramsSerializer), !0), c.timeout = e.timeout,
115
115
  "onloadend" in c ? c.onloadend = g : c.onreadystatechange = function() {
116
116
  c && 4 === c.readyState && (0 !== c.status || c.responseURL && 0 === c.responseURL.indexOf("file:")) && setTimeout(g);
117
117
  }, c.onabort = function() {
118
- c && (n(v("Request aborted", e, "ECONNABORTED", c)), c = null);
118
+ c && (n(y("Request aborted", e, "ECONNABORTED", c)), c = null);
119
119
  }, c.onerror = function() {
120
- n(v("Network Error", e, null, c)), c = null;
120
+ n(y("Network Error", e, null, c)), c = null;
121
121
  }, c.ontimeout = function() {
122
122
  var t = e.timeout ? "timeout of " + e.timeout + "ms exceeded" : "timeout exceeded", o = e.transitional || r.transitional;
123
- e.timeoutErrorMessage && (t = e.timeoutErrorMessage), n(v(t, e, o.clarifyTimeoutError ? "ETIMEDOUT" : "ECONNABORTED", c)),
123
+ e.timeoutErrorMessage && (t = e.timeoutErrorMessage), n(y(t, e, o.clarifyTimeoutError ? "ETIMEDOUT" : "ECONNABORTED", c)),
124
124
  c = null;
125
- }, f.isStandardBrowserEnv()) {
126
- var m = (e.withCredentials || k(h)) && e.xsrfCookieName ? b.read(e.xsrfCookieName) : void 0;
125
+ }, l.isStandardBrowserEnv()) {
126
+ var m = (e.withCredentials || E(h)) && e.xsrfCookieName ? w.read(e.xsrfCookieName) : void 0;
127
127
  m && (a[e.xsrfHeaderName] = m);
128
128
  }
129
- "setRequestHeader" in c && f.forEach(a, function(e, t) {
129
+ "setRequestHeader" in c && l.forEach(a, function(e, t) {
130
130
  void 0 === i && "content-type" === t.toLowerCase() ? delete a[t] : c.setRequestHeader(t, e);
131
- }), f.isUndefined(e.withCredentials) || (c.withCredentials = !!e.withCredentials),
131
+ }), l.isUndefined(e.withCredentials) || (c.withCredentials = !!e.withCredentials),
132
132
  s && "json" !== s && (c.responseType = e.responseType), "function" == typeof e.onDownloadProgress && c.addEventListener("progress", e.onDownloadProgress),
133
133
  "function" == typeof e.onUploadProgress && c.upload && c.upload.addEventListener("progress", e.onUploadProgress),
134
134
  (e.cancelToken || e.signal) && (o = function(e) {
@@ -144,35 +144,36 @@
144
144
  };
145
145
  }, o = Object.prototype.toString;
146
146
  function i(e) {
147
- return "[object Array]" === o.call(e);
147
+ return Array.isArray(e);
148
148
  }
149
149
  function a(e) {
150
150
  return void 0 === e;
151
151
  }
152
152
  function s(e) {
153
- return null !== e && "object" == typeof e;
153
+ return "[object ArrayBuffer]" === o.call(e);
154
154
  }
155
155
  function u(e) {
156
+ return null !== e && "object" == typeof e;
157
+ }
158
+ function c(e) {
156
159
  if ("[object Object]" !== o.call(e)) return !1;
157
160
  var t = Object.getPrototypeOf(e);
158
161
  return null === t || t === Object.prototype;
159
162
  }
160
- function c(e, t) {
163
+ function f(e, t) {
161
164
  if (null != e) if ("object" != typeof e && (e = [ e ]), i(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);
162
165
  }
163
- var f = {
166
+ var l = {
164
167
  isArray: i,
165
- isArrayBuffer: function(e) {
166
- return "[object ArrayBuffer]" === o.call(e);
167
- },
168
+ isArrayBuffer: s,
168
169
  isBuffer: function(e) {
169
170
  return null !== e && !a(e) && null !== e.constructor && !a(e.constructor) && "function" == typeof e.constructor.isBuffer && e.constructor.isBuffer(e);
170
171
  },
171
172
  isFormData: function(e) {
172
- return "undefined" != typeof FormData && e instanceof FormData;
173
+ return "[object FormData]" === o.call(e);
173
174
  },
174
175
  isArrayBufferView: function(e) {
175
- return "undefined" != typeof ArrayBuffer && ArrayBuffer.isView ? ArrayBuffer.isView(e) : e && e.buffer && e.buffer instanceof ArrayBuffer;
176
+ return "undefined" != typeof ArrayBuffer && ArrayBuffer.isView ? ArrayBuffer.isView(e) : e && e.buffer && s(e.buffer);
176
177
  },
177
178
  isString: function(e) {
178
179
  return "string" == typeof e;
@@ -180,8 +181,8 @@
180
181
  isNumber: function(e) {
181
182
  return "number" == typeof e;
182
183
  },
183
- isObject: s,
184
- isPlainObject: u,
184
+ isObject: u,
185
+ isPlainObject: c,
185
186
  isUndefined: a,
186
187
  isDate: function(e) {
187
188
  return "[object Date]" === o.call(e);
@@ -193,27 +194,27 @@
193
194
  return "[object Blob]" === o.call(e);
194
195
  },
195
196
  isStream: function(e) {
196
- return s(e) && function(e) {
197
+ return u(e) && function(e) {
197
198
  return "[object Function]" === o.call(e);
198
199
  }(e.pipe);
199
200
  },
200
201
  isURLSearchParams: function(e) {
201
- return "undefined" != typeof URLSearchParams && e instanceof URLSearchParams;
202
+ return "[object URLSearchParams]" === o.call(e);
202
203
  },
203
204
  isStandardBrowserEnv: function() {
204
205
  return ("undefined" == typeof navigator || "ReactNative" !== navigator.product && "NativeScript" !== navigator.product && "NS" !== navigator.product) && "undefined" != typeof window && "undefined" != typeof document;
205
206
  },
206
- forEach: c,
207
+ forEach: f,
207
208
  merge: function e() {
208
209
  var t = {};
209
210
  function n(n, r) {
210
- u(t[r]) && u(n) ? t[r] = e(t[r], n) : u(n) ? t[r] = e({}, n) : i(n) ? t[r] = n.slice() : t[r] = n;
211
+ c(t[r]) && c(n) ? t[r] = e(t[r], n) : c(n) ? t[r] = e({}, n) : i(n) ? t[r] = n.slice() : t[r] = n;
211
212
  }
212
- for (var r = 0, o = arguments.length; r < o; r++) c(arguments[r], n);
213
+ for (var r = 0, o = arguments.length; r < o; r++) f(arguments[r], n);
213
214
  return t;
214
215
  },
215
216
  extend: function(e, t, n) {
216
- return c(t, function(t, o) {
217
+ return f(t, function(t, o) {
217
218
  e[o] = n && "function" == typeof t ? r(t, n) : t;
218
219
  }), e;
219
220
  },
@@ -221,17 +222,17 @@
221
222
  return e.trim ? e.trim() : e.replace(/^\s+|\s+$/g, "");
222
223
  }
223
224
  };
224
- function l(e) {
225
+ function p(e) {
225
226
  return encodeURIComponent(e).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
226
227
  }
227
- var p = function(e, t, n) {
228
+ var d = function(e, t, n) {
228
229
  if (!t) return e;
229
230
  var r;
230
- if (n) r = n(t); else if (f.isURLSearchParams(t)) r = t.toString(); else {
231
+ if (n) r = n(t); else if (l.isURLSearchParams(t)) r = t.toString(); else {
231
232
  var o = [];
232
- f.forEach(t, function(e, t) {
233
- null != e && (f.isArray(e) ? t += "[]" : e = [ e ], f.forEach(e, function(e) {
234
- f.isDate(e) ? e = e.toISOString() : f.isObject(e) && (e = JSON.stringify(e)), o.push(l(t) + "=" + l(e));
233
+ l.forEach(t, function(e, t) {
234
+ null != e && (l.isArray(e) ? t += "[]" : e = [ e ], l.forEach(e, function(e) {
235
+ l.isDate(e) ? e = e.toISOString() : l.isObject(e) && (e = JSON.stringify(e)), o.push(p(t) + "=" + p(e));
235
236
  }));
236
237
  }), r = o.join("&");
237
238
  }
@@ -240,29 +241,29 @@
240
241
  -1 !== i && (e = e.slice(0, i)), e += (-1 === e.indexOf("?") ? "?" : "&") + r;
241
242
  }
242
243
  return e;
243
- }, d = {};
244
- function h() {
244
+ }, h = {};
245
+ function g() {
245
246
  this.handlers = [];
246
247
  }
247
- h.prototype.use = function(e, t, n) {
248
+ g.prototype.use = function(e, t, n) {
248
249
  return this.handlers.push({
249
250
  fulfilled: e,
250
251
  rejected: t,
251
252
  synchronous: !!n && n.synchronous,
252
253
  runWhen: n ? n.runWhen : null
253
254
  }), this.handlers.length - 1;
254
- }, h.prototype.eject = function(e) {
255
+ }, g.prototype.eject = function(e) {
255
256
  this.handlers[e] && (this.handlers[e] = null);
256
- }, h.prototype.forEach = function(e) {
257
- f.forEach(this.handlers, function(t) {
257
+ }, g.prototype.forEach = function(e) {
258
+ l.forEach(this.handlers, function(t) {
258
259
  null !== t && e(t);
259
260
  });
260
- }, d = h;
261
- var g = function(e, t) {
262
- f.forEach(e, function(n, r) {
261
+ }, h = g;
262
+ var m = function(e, t) {
263
+ l.forEach(e, function(n, r) {
263
264
  r !== t && r.toUpperCase() === t.toUpperCase() && (e[t] = n, delete e[r]);
264
265
  });
265
- }, m = function(e, t, n, r, o) {
266
+ }, v = function(e, t, n, r, o) {
266
267
  return e.config = t, n && (e.code = n), e.request = r, e.response = o, e.isAxiosError = !0,
267
268
  e.toJSON = function() {
268
269
  return {
@@ -279,17 +280,17 @@
279
280
  status: this.response && this.response.status ? this.response.status : null
280
281
  };
281
282
  }, e;
282
- }, v = function(e, t, n, r, o) {
283
+ }, y = function(e, t, n, r, o) {
283
284
  var i = new Error(e);
284
- return m(i, t, n, r, o);
285
- }, y = function(e, t, n) {
285
+ return v(i, t, n, r, o);
286
+ }, b = function(e, t, n) {
286
287
  var r = n.config.validateStatus;
287
- n.status && r && !r(n.status) ? t(v("Request failed with status code " + n.status, n.config, null, n.request, n)) : e(n);
288
- }, b = f.isStandardBrowserEnv() ? {
288
+ n.status && r && !r(n.status) ? t(y("Request failed with status code " + n.status, n.config, null, n.request, n)) : e(n);
289
+ }, w = l.isStandardBrowserEnv() ? {
289
290
  write: function(e, t, n, r, o, i) {
290
291
  var a = [];
291
- a.push(e + "=" + encodeURIComponent(t)), f.isNumber(n) && a.push("expires=" + new Date(n).toGMTString()),
292
- f.isString(r) && a.push("path=" + r), f.isString(o) && a.push("domain=" + o), !0 === i && a.push("secure"),
292
+ a.push(e + "=" + encodeURIComponent(t)), l.isNumber(n) && a.push("expires=" + new Date(n).toGMTString()),
293
+ l.isString(r) && a.push("path=" + r), l.isString(o) && a.push("domain=" + o), !0 === i && a.push("secure"),
293
294
  document.cookie = a.join("; ");
294
295
  },
295
296
  read: function(e) {
@@ -305,20 +306,20 @@
305
306
  return null;
306
307
  },
307
308
  remove: function() {}
308
- }, w = function(e, t) {
309
- return e && !/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(t) ? function(e, t) {
309
+ }, S = function(e, t) {
310
+ return e && !/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t) ? function(e, t) {
310
311
  return t ? e.replace(/\/+$/, "") + "/" + t.replace(/^\/+/, "") : e;
311
312
  }(e, t) : t;
312
- }, S = [ "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" ], T = function(e) {
313
+ }, T = [ "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" ], k = function(e) {
313
314
  var t, n, r, o = {};
314
- return e ? (f.forEach(e.split("\n"), function(e) {
315
- if (r = e.indexOf(":"), t = f.trim(e.substr(0, r)).toLowerCase(), n = f.trim(e.substr(r + 1)),
315
+ return e ? (l.forEach(e.split("\n"), function(e) {
316
+ if (r = e.indexOf(":"), t = l.trim(e.substr(0, r)).toLowerCase(), n = l.trim(e.substr(r + 1)),
316
317
  t) {
317
- if (o[t] && S.indexOf(t) >= 0) return;
318
+ if (o[t] && T.indexOf(t) >= 0) return;
318
319
  o[t] = "set-cookie" === t ? (o[t] ? o[t] : []).concat([ n ]) : o[t] ? o[t] + ", " + n : n;
319
320
  }
320
321
  }), o) : o;
321
- }, k = f.isStandardBrowserEnv() ? function() {
322
+ }, E = l.isStandardBrowserEnv() ? function() {
322
323
  var e, t = /(msie|trident)/i.test(navigator.userAgent), n = document.createElement("a");
323
324
  function r(e) {
324
325
  var r = e;
@@ -335,7 +336,7 @@
335
336
  };
336
337
  }
337
338
  return e = r(window.location.href), function(t) {
338
- var n = f.isString(t) ? r(t) : t;
339
+ var n = l.isString(t) ? r(t) : t;
339
340
  return n.protocol === e.protocol && n.host === e.host;
340
341
  };
341
342
  }() : function() {
@@ -347,125 +348,125 @@
347
348
  j.prototype.toString = function() {
348
349
  return "Cancel" + (this.message ? ": " + this.message : "");
349
350
  }, j.prototype.__CANCEL__ = !0, C = j;
350
- var E, O, x = {}, A = x = {};
351
- function _() {
351
+ var O, x, _ = {}, P = _ = {};
352
+ function A() {
352
353
  throw new Error("setTimeout has not been defined");
353
354
  }
354
- function P() {
355
+ function N() {
355
356
  throw new Error("clearTimeout has not been defined");
356
357
  }
357
- function N(e) {
358
- if (E === setTimeout) return setTimeout(e, 0);
359
- if ((E === _ || !E) && setTimeout) return E = setTimeout, setTimeout(e, 0);
358
+ function R(e) {
359
+ if (O === setTimeout) return setTimeout(e, 0);
360
+ if ((O === A || !O) && setTimeout) return O = setTimeout, setTimeout(e, 0);
360
361
  try {
361
- return E(e, 0);
362
+ return O(e, 0);
362
363
  } catch (t) {
363
364
  try {
364
- return E.call(null, e, 0);
365
+ return O.call(null, e, 0);
365
366
  } catch (t) {
366
- return E.call(this, e, 0);
367
+ return O.call(this, e, 0);
367
368
  }
368
369
  }
369
370
  }
370
371
  !function() {
371
372
  try {
372
- E = "function" == typeof setTimeout ? setTimeout : _;
373
+ O = "function" == typeof setTimeout ? setTimeout : A;
373
374
  } catch (e) {
374
- E = _;
375
+ O = A;
375
376
  }
376
377
  try {
377
- O = "function" == typeof clearTimeout ? clearTimeout : P;
378
+ x = "function" == typeof clearTimeout ? clearTimeout : N;
378
379
  } catch (e) {
379
- O = P;
380
+ x = N;
380
381
  }
381
382
  }();
382
- var R, U = [], L = !1, B = -1;
383
- function q() {
384
- L && R && (L = !1, R.length ? U = R.concat(U) : B = -1, U.length && z());
385
- }
383
+ var U, L = [], B = !1, q = -1;
386
384
  function z() {
387
- if (!L) {
388
- var e = N(q);
389
- L = !0;
390
- for (var t = U.length; t; ) {
391
- for (R = U, U = []; ++B < t; ) R && R[B].run();
392
- B = -1, t = U.length;
385
+ B && U && (B = !1, U.length ? L = U.concat(L) : q = -1, L.length && D());
386
+ }
387
+ function D() {
388
+ if (!B) {
389
+ var e = R(z);
390
+ B = !0;
391
+ for (var t = L.length; t; ) {
392
+ for (U = L, L = []; ++q < t; ) U && U[q].run();
393
+ q = -1, t = L.length;
393
394
  }
394
- R = null, L = !1, function(e) {
395
- if (O === clearTimeout) return clearTimeout(e);
396
- if ((O === P || !O) && clearTimeout) return O = clearTimeout, clearTimeout(e);
395
+ U = null, B = !1, function(e) {
396
+ if (x === clearTimeout) return clearTimeout(e);
397
+ if ((x === N || !x) && clearTimeout) return x = clearTimeout, clearTimeout(e);
397
398
  try {
398
- O(e);
399
+ x(e);
399
400
  } catch (t) {
400
401
  try {
401
- return O.call(null, e);
402
+ return x.call(null, e);
402
403
  } catch (t) {
403
- return O.call(this, e);
404
+ return x.call(this, e);
404
405
  }
405
406
  }
406
407
  }(e);
407
408
  }
408
409
  }
409
- function I(e, t) {
410
+ function J(e, t) {
410
411
  this.fun = e, this.array = t;
411
412
  }
412
- function D() {}
413
- A.nextTick = function(e) {
413
+ function F() {}
414
+ P.nextTick = function(e) {
414
415
  var t = new Array(arguments.length - 1);
415
416
  if (arguments.length > 1) for (var n = 1; n < arguments.length; n++) t[n - 1] = arguments[n];
416
- U.push(new I(e, t)), 1 !== U.length || L || N(z);
417
- }, I.prototype.run = function() {
417
+ L.push(new J(e, t)), 1 !== L.length || B || R(D);
418
+ }, J.prototype.run = function() {
418
419
  this.fun.apply(null, this.array);
419
- }, A.title = "browser", A.browser = !0, A.env = {}, A.argv = [], A.version = "",
420
- A.versions = {}, A.on = D, A.addListener = D, A.once = D, A.off = D, A.removeListener = D,
421
- A.removeAllListeners = D, A.emit = D, A.prependListener = D, A.prependOnceListener = D,
422
- A.listeners = function(e) {
420
+ }, P.title = "browser", P.browser = !0, P.env = {}, P.argv = [], P.version = "",
421
+ P.versions = {}, P.on = F, P.addListener = F, P.once = F, P.off = F, P.removeListener = F,
422
+ P.removeAllListeners = F, P.emit = F, P.prependListener = F, P.prependOnceListener = F,
423
+ P.listeners = function(e) {
423
424
  return [];
424
- }, A.binding = function(e) {
425
+ }, P.binding = function(e) {
425
426
  throw new Error("process.binding is not supported");
426
- }, A.cwd = function() {
427
+ }, P.cwd = function() {
427
428
  return "/";
428
- }, A.chdir = function(e) {
429
+ }, P.chdir = function(e) {
429
430
  throw new Error("process.chdir is not supported");
430
- }, A.umask = function() {
431
+ }, P.umask = function() {
431
432
  return 0;
432
433
  };
433
- var F = t({}), J = function(e, t, n) {
434
- var r = this || F;
435
- return f.forEach(n, function(n) {
434
+ var I = t({}), V = function(e, t, n) {
435
+ var r = this || I;
436
+ return l.forEach(n, function(n) {
436
437
  e = n.call(r, e, t);
437
438
  }), e;
438
- }, V = function(e) {
439
+ }, H = function(e) {
439
440
  return !(!e || !e.__CANCEL__);
440
- }, H = t({});
441
- function M(e) {
441
+ }, M = t({});
442
+ function $(e) {
442
443
  if (e.cancelToken && e.cancelToken.throwIfRequested(), e.signal && e.signal.aborted) throw new C("canceled");
443
444
  }
444
- var $, G = function(e) {
445
- return M(e), e.headers = e.headers || {}, e.data = J.call(e, e.data, e.headers, e.transformRequest),
446
- e.headers = f.merge(e.headers.common || {}, e.headers[e.method] || {}, e.headers),
447
- f.forEach([ "delete", "get", "head", "post", "put", "patch", "common" ], function(t) {
445
+ var G, X = function(e) {
446
+ return $(e), e.headers = e.headers || {}, e.data = V.call(e, e.data, e.headers, e.transformRequest),
447
+ e.headers = l.merge(e.headers.common || {}, e.headers[e.method] || {}, e.headers),
448
+ l.forEach([ "delete", "get", "head", "post", "put", "patch", "common" ], function(t) {
448
449
  delete e.headers[t];
449
- }), (e.adapter || H.adapter)(e).then(function(t) {
450
- return M(e), t.data = J.call(e, t.data, t.headers, e.transformResponse), t;
450
+ }), (e.adapter || M.adapter)(e).then(function(t) {
451
+ return $(e), t.data = V.call(e, t.data, t.headers, e.transformResponse), t;
451
452
  }, function(t) {
452
- return V(t) || (M(e), t && t.response && (t.response.data = J.call(e, t.response.data, t.response.headers, e.transformResponse))),
453
+ return H(t) || ($(e), t && t.response && (t.response.data = V.call(e, t.response.data, t.response.headers, e.transformResponse))),
453
454
  Promise.reject(t);
454
455
  });
455
- }, X = function(e, t) {
456
+ }, W = function(e, t) {
456
457
  t = t || {};
457
458
  var n = {};
458
459
  function r(e, t) {
459
- return f.isPlainObject(e) && f.isPlainObject(t) ? f.merge(e, t) : f.isPlainObject(t) ? f.merge({}, t) : f.isArray(t) ? t.slice() : t;
460
+ return l.isPlainObject(e) && l.isPlainObject(t) ? l.merge(e, t) : l.isPlainObject(t) ? l.merge({}, t) : l.isArray(t) ? t.slice() : t;
460
461
  }
461
462
  function o(n) {
462
- return f.isUndefined(t[n]) ? f.isUndefined(e[n]) ? void 0 : r(void 0, e[n]) : r(e[n], t[n]);
463
+ return l.isUndefined(t[n]) ? l.isUndefined(e[n]) ? void 0 : r(void 0, e[n]) : r(e[n], t[n]);
463
464
  }
464
465
  function i(e) {
465
- if (!f.isUndefined(t[e])) return r(void 0, t[e]);
466
+ if (!l.isUndefined(t[e])) return r(void 0, t[e]);
466
467
  }
467
468
  function a(n) {
468
- return f.isUndefined(t[n]) ? f.isUndefined(e[n]) ? void 0 : r(void 0, e[n]) : r(void 0, t[n]);
469
+ return l.isUndefined(t[n]) ? l.isUndefined(e[n]) ? void 0 : r(void 0, e[n]) : r(void 0, t[n]);
469
470
  }
470
471
  function s(n) {
471
472
  return n in t ? r(e[n], t[n]) : n in e ? r(void 0, e[n]) : void 0;
@@ -498,28 +499,28 @@
498
499
  responseEncoding: a,
499
500
  validateStatus: s
500
501
  };
501
- return f.forEach(Object.keys(e).concat(Object.keys(t)), function(e) {
502
+ return l.forEach(Object.keys(e).concat(Object.keys(t)), function(e) {
502
503
  var t = u[e] || o, r = t(e);
503
- f.isUndefined(r) && t !== s || (n[e] = r);
504
+ l.isUndefined(r) && t !== s || (n[e] = r);
504
505
  }), n;
505
- }, W = "0.24.0", K = W, Y = {};
506
+ }, K = "0.25.0", Y = K, Q = {};
506
507
  [ "object", "boolean", "number", "function", "string", "symbol" ].forEach(function(e, t) {
507
- Y[e] = function(n) {
508
+ Q[e] = function(n) {
508
509
  return typeof n === e || "a" + (t < 1 ? "n " : " ") + e;
509
510
  };
510
511
  });
511
- var Q = {};
512
- Y.transitional = function(e, t, n) {
512
+ var Z = {};
513
+ Q.transitional = function(e, t, n) {
513
514
  function r(e, t) {
514
- return "[Axios v" + K + "] Transitional option '" + e + "'" + t + (n ? ". " + n : "");
515
+ return "[Axios v" + Y + "] Transitional option '" + e + "'" + t + (n ? ". " + n : "");
515
516
  }
516
517
  return function(n, o, i) {
517
518
  if (!1 === e) throw new Error(r(o, " has been removed" + (t ? " in " + t : "")));
518
- return t && !Q[o] && (Q[o] = !0, console.warn(r(o, " has been deprecated since v" + t + " and will be removed in the near future"))),
519
+ return t && !Z[o] && (Z[o] = !0, console.warn(r(o, " has been deprecated since v" + t + " and will be removed in the near future"))),
519
520
  !e || e(n, o, i);
520
521
  };
521
522
  };
522
- var Z = {}, ee = ($ = {
523
+ var ee = {}, te = (G = {
523
524
  assertOptions: function(e, t, n) {
524
525
  if ("object" != typeof e) throw new TypeError("options must be an object");
525
526
  for (var r = Object.keys(e), o = r.length; o-- > 0; ) {
@@ -530,73 +531,74 @@
530
531
  } else if (!0 !== n) throw Error("Unknown option " + i);
531
532
  }
532
533
  },
533
- validators: Y
534
+ validators: Q
534
535
  }).validators;
535
- function te(e) {
536
+ function ne(e) {
536
537
  this.defaults = e, this.interceptors = {
537
- request: new d(),
538
- response: new d()
538
+ request: new h(),
539
+ response: new h()
539
540
  };
540
541
  }
541
- te.prototype.request = function(e) {
542
- "string" == typeof e ? (e = arguments[1] || {}).url = arguments[0] : e = e || {},
543
- (e = X(this.defaults, e)).method ? e.method = e.method.toLowerCase() : this.defaults.method ? e.method = this.defaults.method.toLowerCase() : e.method = "get";
544
- var t = e.transitional;
545
- void 0 !== t && $.assertOptions(t, {
546
- silentJSONParsing: ee.transitional(ee.boolean),
547
- forcedJSONParsing: ee.transitional(ee.boolean),
548
- clarifyTimeoutError: ee.transitional(ee.boolean)
542
+ ne.prototype.request = function(e, t) {
543
+ if ("string" == typeof e ? (t = t || {}).url = e : t = e || {}, !t.url) throw new Error("Provided config url is not valid");
544
+ (t = W(this.defaults, t)).method ? t.method = t.method.toLowerCase() : this.defaults.method ? t.method = this.defaults.method.toLowerCase() : t.method = "get";
545
+ var n = t.transitional;
546
+ void 0 !== n && G.assertOptions(n, {
547
+ silentJSONParsing: te.transitional(te.boolean),
548
+ forcedJSONParsing: te.transitional(te.boolean),
549
+ clarifyTimeoutError: te.transitional(te.boolean)
549
550
  }, !1);
550
- var n = [], r = !0;
551
- this.interceptors.request.forEach(function(t) {
552
- "function" == typeof t.runWhen && !1 === t.runWhen(e) || (r = r && t.synchronous,
553
- n.unshift(t.fulfilled, t.rejected));
551
+ var r = [], o = !0;
552
+ this.interceptors.request.forEach(function(e) {
553
+ "function" == typeof e.runWhen && !1 === e.runWhen(t) || (o = o && e.synchronous,
554
+ r.unshift(e.fulfilled, e.rejected));
554
555
  });
555
- var o, i = [];
556
+ var i, a = [];
556
557
  if (this.interceptors.response.forEach(function(e) {
557
- i.push(e.fulfilled, e.rejected);
558
- }), !r) {
559
- var a = [ G, void 0 ];
560
- for (Array.prototype.unshift.apply(a, n), a = a.concat(i), o = Promise.resolve(e); a.length; ) o = o.then(a.shift(), a.shift());
561
- return o;
558
+ a.push(e.fulfilled, e.rejected);
559
+ }), !o) {
560
+ var s = [ X, void 0 ];
561
+ for (Array.prototype.unshift.apply(s, r), s = s.concat(a), i = Promise.resolve(t); s.length; ) i = i.then(s.shift(), s.shift());
562
+ return i;
562
563
  }
563
- for (var s = e; n.length; ) {
564
- var u = n.shift(), c = n.shift();
564
+ for (var u = t; r.length; ) {
565
+ var c = r.shift(), f = r.shift();
565
566
  try {
566
- s = u(s);
567
- } catch (f) {
568
- c(f);
567
+ u = c(u);
568
+ } catch (l) {
569
+ f(l);
569
570
  break;
570
571
  }
571
572
  }
572
573
  try {
573
- o = G(s);
574
- } catch (f) {
575
- return Promise.reject(f);
574
+ i = X(u);
575
+ } catch (l) {
576
+ return Promise.reject(l);
576
577
  }
577
- for (;i.length; ) o = o.then(i.shift(), i.shift());
578
- return o;
579
- }, te.prototype.getUri = function(e) {
580
- return e = X(this.defaults, e), p(e.url, e.params, e.paramsSerializer).replace(/^\?/, "");
581
- }, f.forEach([ "delete", "get", "head", "options" ], function(e) {
582
- te.prototype[e] = function(t, n) {
583
- return this.request(X(n || {}, {
578
+ for (;a.length; ) i = i.then(a.shift(), a.shift());
579
+ return i;
580
+ }, ne.prototype.getUri = function(e) {
581
+ if (!e.url) throw new Error("Provided config url is not valid");
582
+ return e = W(this.defaults, e), d(e.url, e.params, e.paramsSerializer).replace(/^\?/, "");
583
+ }, l.forEach([ "delete", "get", "head", "options" ], function(e) {
584
+ ne.prototype[e] = function(t, n) {
585
+ return this.request(W(n || {}, {
584
586
  method: e,
585
587
  url: t,
586
588
  data: (n || {}).data
587
589
  }));
588
590
  };
589
- }), f.forEach([ "post", "put", "patch" ], function(e) {
590
- te.prototype[e] = function(t, n, r) {
591
- return this.request(X(r || {}, {
591
+ }), l.forEach([ "post", "put", "patch" ], function(e) {
592
+ ne.prototype[e] = function(t, n, r) {
593
+ return this.request(W(r || {}, {
592
594
  method: e,
593
595
  url: t,
594
596
  data: n
595
597
  }));
596
598
  };
597
- }), Z = te;
598
- var ne;
599
- function re(e) {
599
+ }), ee = ne;
600
+ var re;
601
+ function oe(e) {
600
602
  if ("function" != typeof e) throw new TypeError("executor must be a function.");
601
603
  var t;
602
604
  this.promise = new Promise(function(e) {
@@ -620,78 +622,41 @@
620
622
  n.reason || (n.reason = new C(e), t(n.reason));
621
623
  });
622
624
  }
623
- re.prototype.throwIfRequested = function() {
625
+ oe.prototype.throwIfRequested = function() {
624
626
  if (this.reason) throw this.reason;
625
- }, re.prototype.subscribe = function(e) {
627
+ }, oe.prototype.subscribe = function(e) {
626
628
  this.reason ? e(this.reason) : this._listeners ? this._listeners.push(e) : this._listeners = [ e ];
627
- }, re.prototype.unsubscribe = function(e) {
629
+ }, oe.prototype.unsubscribe = function(e) {
628
630
  if (this._listeners) {
629
631
  var t = this._listeners.indexOf(e);
630
632
  -1 !== t && this._listeners.splice(t, 1);
631
633
  }
632
- }, re.source = function() {
634
+ }, oe.source = function() {
633
635
  var e;
634
636
  return {
635
- token: new re(function(t) {
637
+ token: new oe(function(t) {
636
638
  e = t;
637
639
  }),
638
640
  cancel: e
639
641
  };
640
- }, ne = re;
641
- var oe = {}, ie = function e(t) {
642
- var n = new Z(t), o = r(Z.prototype.request, n);
643
- return f.extend(o, Z.prototype, n), f.extend(o, n), o.create = function(n) {
644
- return e(X(t, n));
642
+ }, re = oe;
643
+ var ie = {}, ae = function e(t) {
644
+ var n = new ee(t), o = r(ee.prototype.request, n);
645
+ return l.extend(o, ee.prototype, n), l.extend(o, n), o.create = function(n) {
646
+ return e(W(t, n));
645
647
  }, o;
646
648
  }(t({}));
647
- ie.Axios = Z, ie.Cancel = C, ie.CancelToken = ne, ie.isCancel = V, ie.VERSION = W,
648
- ie.all = function(e) {
649
+ ae.Axios = ee, ae.Cancel = C, ae.CancelToken = re, ae.isCancel = H, ae.VERSION = K,
650
+ ae.all = function(e) {
649
651
  return Promise.all(e);
650
- }, ie.spread = function(e) {
652
+ }, ae.spread = function(e) {
651
653
  return function(t) {
652
654
  return e.apply(null, t);
653
655
  };
654
- }, ie.isAxiosError = function(e) {
655
- return "object" == typeof e && !0 === e.isAxiosError;
656
- }, (oe = ie).default = ie;
657
- var ae = oe;
658
- Array.isArray;
659
- var se = function(e) {
660
- switch (typeof e) {
661
- case "string":
662
- return e;
663
-
664
- case "boolean":
665
- return e ? "true" : "false";
666
-
667
- case "number":
668
- return isFinite(e) ? e : "";
669
-
670
- default:
671
- return "";
672
- }
673
- }, ue = Array.isArray || function(e) {
674
- return "[object Array]" === Object.prototype.toString.call(e);
675
- };
676
- function ce(e, t) {
677
- if (e.map) return e.map(t);
678
- for (var n = [], r = 0; r < e.length; r++) n.push(t(e[r], r));
679
- return n;
680
- }
681
- var fe = Object.keys || function(e) {
682
- var t = [];
683
- for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && t.push(n);
684
- return t;
685
- }, le = {
686
- stringify: function(e, t, n, r) {
687
- return t = t || "&", n = n || "=", null === e && (e = void 0), "object" == typeof e ? ce(fe(e), function(r) {
688
- var o = encodeURIComponent(se(r)) + n;
689
- return ue(e[r]) ? ce(e[r], function(e) {
690
- return o + encodeURIComponent(se(e));
691
- }).join(t) : o + encodeURIComponent(se(e[r]));
692
- }).join(t) : r ? encodeURIComponent(se(r)) + n + encodeURIComponent(se(e)) : "";
693
- }
694
- }, pe = {}, de = {};
656
+ }, ae.isAxiosError = function(e) {
657
+ return l.isObject(e) && !0 === e.isAxiosError;
658
+ }, (ie = ae).default = ae;
659
+ var se = ie, ue = {}, ce = {};
695
660
  return function(e) {
696
661
  (function() {
697
662
  "use strict";
@@ -774,10 +739,10 @@
774
739
  writable: !1
775
740
  }), e;
776
741
  }
777
- Object.defineProperty(de, "__esModule", {
742
+ Object.defineProperty(ce, "__esModule", {
778
743
  value: !0
779
- }), de.varsnap = de.clientName = de.version = void 0;
780
- de.version = "1.8.1", de.clientName = "javascript." + de.version;
744
+ }), ce.varsnap = ce.clientName = ce.version = void 0;
745
+ ce.version = "1.8.2", ce.clientName = "javascript." + ce.version;
781
746
  var u = {
782
747
  varsnap: !0,
783
748
  env: "development",
@@ -808,7 +773,7 @@
808
773
  value: function(e, t) {
809
774
  var n = "";
810
775
  return n = "" !== t && void 0 !== t ? t : (n = (n = e.toString().split("{")[0]).replace(/^\s+|\s+$/g, "")).replace(/,\s+/g, ","),
811
- "javascript." + de.version + "." + n;
776
+ "javascript." + ce.version + "." + n;
812
777
  }
813
778
  }, {
814
779
  key: "ajax",
@@ -819,12 +784,14 @@
819
784
  headers: {
820
785
  "Content-Type": "application/x-www-form-urlencoded"
821
786
  },
822
- data: le.stringify(n),
787
+ data: new URLSearchParams(n).toString(),
823
788
  responseType: "json"
824
789
  };
825
790
  return t.isNode() && r.headers && (r.headers["User-Agent"] = "varsnap.js"), (0,
826
- ae.default)(r).then(function(e) {
791
+ se.default)(r).then(function(e) {
827
792
  return e.data;
793
+ }).catch(function(e) {
794
+ return e;
828
795
  });
829
796
  }
830
797
  }, {
@@ -880,7 +847,7 @@
880
847
  return n ? new Promise(function(e) {
881
848
  return e(n);
882
849
  }) : t.isNode() ? new Promise(function(e) {
883
- (0, pe.exec)("git rev-parse --abbrev-ref HEAD", function(t, n) {
850
+ (0, ue.exec)("git rev-parse --abbrev-ref HEAD", function(t, n) {
884
851
  return e(n.trim());
885
852
  });
886
853
  }) : new Promise(function(e) {
@@ -1007,7 +974,7 @@
1007
974
  consumer_token: l.getConfig(this.config, "consumerToken"),
1008
975
  snap_id: t.id,
1009
976
  test_outputs: p.serialize(r),
1010
- matches: o,
977
+ matches: o.toString(),
1011
978
  snap_outputs_formatted: p.serialize_formatted(n),
1012
979
  test_outputs_formatted: p.serialize_formatted(r)
1013
980
  };
@@ -1059,7 +1026,7 @@
1059
1026
  return {
1060
1027
  branch: t,
1061
1028
  consumer_token: l.getConfig(e, "consumerToken"),
1062
- client: de.clientName
1029
+ client: ce.clientName
1063
1030
  };
1064
1031
  }).then(function(e) {
1065
1032
  var t = e;
@@ -1094,7 +1061,7 @@
1094
1061
  });
1095
1062
  });
1096
1063
  }
1097
- de.varsnap = h, h._config = u, h.updateConfig = function(e) {
1064
+ ce.varsnap = h, h._config = u, h.updateConfig = function(e) {
1098
1065
  for (var t = h._config, n = 0, r = Object.keys(h._config); n < r.length; n++) {
1099
1066
  var o = r[n];
1100
1067
  Object.prototype.hasOwnProperty.call(e, o) && (t = l.setConfig(t, o, e[o]));
@@ -1102,8 +1069,8 @@
1102
1069
  h._config = t;
1103
1070
  }, h.reset = function() {
1104
1071
  l.resetConsumers(), l.resetProducers();
1105
- }, h.version = de.version, h.runTests = g;
1072
+ }, h.version = ce.version, h.runTests = g;
1106
1073
  }).call(this);
1107
- }.call(this, x), de.varsnap;
1074
+ }.call(this, _), ce.varsnap;
1108
1075
  });
1109
1076
  })(typeof Varsnap == "undefined" ? Varsnap = {} : Varsnap);
@@ -1,4 +1,4 @@
1
1
  /*
2
- * Varsnap.js v1.8.1
2
+ * Varsnap.js v1.8.2
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(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 u(t){var n;return function(e){return n||t(n={exports:{},parent:e},n.exports),n.exports}}function c(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 f=u(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)?l({}):e,transformRequest:[function(e,t){{if(j(t,"Accept"),j(t,"Content-Type"),h.isFormData(e)||h.isArrayBuffer(e)||h.isBuffer(e)||h.isStream(e)||h.isFile(e)||h.isBlob(e))return e;if(h.isArrayBufferView(e))return e.buffer;if(h.isURLSearchParams(e))return n(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString();if(h.isObject(e)||t&&"application/json"===t["Content-Type"]){if(n(t,"application/json"),h.isString(t=e))try{return(0,JSON.parse)(t),h.trim(t)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(t)}return 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 O(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,z)}),l=u(function(e,t){"use strict";var d=f({});e.exports=function(p){return new Promise(function(f,n){var e,r=p.data,o=p.headers,t=p.responseType;function i(){p.cancelToken&&p.cancelToken.unsubscribe(e),p.signal&&p.signal.removeEventListener("abort",e)}h.isFormData(r)&&delete o["Content-Type"];var a,s,u=new XMLHttpRequest,c=(p.auth&&(c=p.auth.username||"",a=p.auth.password?unescape(encodeURIComponent(p.auth.password)):"",o.Authorization="Basic "+btoa(c+":"+a)),A(p.baseURL,p.url));function l(){var e;u&&(e="getAllResponseHeaders"in u?R(u.getAllResponseHeaders()):null,e={data:t&&"text"!==t&&"json"!==t?u.response:u.responseText,status:u.status,statusText:u.statusText,headers:e,config:p,request:u},_(function(e){f(e),i()},function(e){n(e),i()},e),u=null)}u.open(p.method.toUpperCase(),S(c,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(x("Request aborted",p,"ECONNABORTED",u)),u=null)},u.onerror=function(){n(x("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(x(e,p,t.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",u)),u=null},h.isStandardBrowserEnv()&&(s=(p.withCredentials||U(c))&&p.xsrfCookieName?P.read(p.xsrfCookieName):void 0)&&(o[p.xsrfHeaderName]=s),"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),t&&"json"!==t&&(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 L("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 p(e){return Array.isArray(e)}function d(e){return void 0===e}function g(e){return"[object ArrayBuffer]"===t.call(e)}function m(e){return null!==e&&"object"==typeof e}function y(e){if("[object Object]"!==t.call(e))return!1;e=Object.getPrototypeOf(e);return null===e||e===Object.prototype}function b(e,t){if(null!=e)if(p(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:p,isArrayBuffer:g,isBuffer:function(e){return null!==e&&!d(e)&&null!==e.constructor&&!d(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){return"[object FormData]"===t.call(e)},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&g(e.buffer)},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:m,isPlainObject:y,isUndefined:d,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 m(e)&&(e=e.pipe,"[object Function]"===t.call(e))},isURLSearchParams:function(e){return"[object URLSearchParams]"===t.call(e)},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&"undefined"!=typeof window&&"undefined"!=typeof document},forEach:b,merge:function n(){var r={};function e(e,t){y(r[t])&&y(e)?r[t]=n(r[t],e):y(e)?r[t]=n({},e):p(e)?r[t]=e.slice():r[t]=e}for(var t=0,o=arguments.length;t<o;t++)b(arguments[t],e);return r},extend:function(n,e,r){return b(e,function(e,t){n[t]=r&&"function"==typeof e?c(e,r):e}),n},trim:function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}};function w(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var S=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(w(t)+"="+w(e))}))}),r.join("&"));return n&&(-1!==(t=e.indexOf("#"))&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+n),e},T={};function k(){this.handlers=[]}k.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},k.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},k.prototype.forEach=function(t){h.forEach(this.handlers,function(e){null!==e&&t(e)})};var E,C,n,T=k,j=function(n,r){h.forEach(n,function(e,t){t!==r&&t.toUpperCase()===r.toUpperCase()&&(n[r]=e,delete n[t])})},O=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},x=function(e,t,n,r,o){e=new Error(e);return O(e,t,n,r,o)},_=function(e,t,n){var r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(x("Request failed with status code "+n.status,n.config,null,n.request,n)):e(n)},P=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(){}},A=function(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?(e=e,(n=t)?e.replace(/\/+$/,"")+"/"+n.replace(/^\/+/,""):e):t;var n},N=["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"],R=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<=N.indexOf(t)||(r[t]="set-cookie"===t?(r[t]||[]).concat([n]):r[t]?r[t]+", "+n:n))}),r},U=h.isStandardBrowserEnv()?(C=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a"),E=B(window.location.href),function(e){e=h.isString(e)?B(e):e;return e.protocol===E.protocol&&e.host===E.host}):function(){return!0},L={};function B(e){return C&&(n.setAttribute("href",e),e=n.href),n.setAttribute("href",e),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}function q(e){this.message=e}q.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},q.prototype.__CANCEL__=!0;var r,o,L=q,z={},e=z={};function D(){throw new Error("setTimeout has not been defined")}function V(){throw new Error("clearTimeout has not been defined")}function J(t){if(r===setTimeout)return setTimeout(t,0);if((r===D||!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)}}}try{r="function"==typeof setTimeout?setTimeout:D}catch(e){r=D}try{o="function"==typeof clearTimeout?clearTimeout:V}catch(e){o=V}var F,i=[],I=!1,H=-1;function M(){I&&F&&(I=!1,F.length?i=F.concat(i):H=-1,i.length&&$())}function $(){if(!I){var e=J(M);I=!0;for(var t=i.length;t;){for(F=i,i=[];++H<t;)F&&F[H].run();H=-1,t=i.length}F=null,I=!1,function(t){if(o===clearTimeout)return clearTimeout(t);if((o===V||!o)&&clearTimeout)return o=clearTimeout,clearTimeout(t);try{o(t)}catch(e){try{return o.call(null,t)}catch(e){return o.call(this,t)}}}(e)}}function G(e,t){this.fun=e,this.array=t}function a(){}e.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];i.push(new G(e,t)),1!==i.length||I||J($)},G.prototype.run=function(){this.fun.apply(null,this.array)},e.title="browser",e.browser=!0,e.env={},e.argv=[],e.version="",e.versions={},e.on=a,e.addListener=a,e.once=a,e.off=a,e.removeListener=a,e.removeAllListeners=a,e.emit=a,e.prependListener=a,e.prependOnceListener=a,e.listeners=function(e){return[]},e.binding=function(e){throw new Error("process.binding is not supported")},e.cwd=function(){return"/"},e.chdir=function(e){throw new Error("process.chdir is not supported")},e.umask=function(){return 0};var X=f({}),W=function(t,n,e){var r=this||X;return h.forEach(e,function(e){t=e.call(r,t,n)}),t},K=function(e){return!(!e||!e.__CANCEL__)},Y=f({});function Q(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new L("canceled")}function Z(t){return Q(t),t.headers=t.headers||{},t.data=W.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||Y.adapter)(t).then(function(e){return Q(t),e.data=W.call(t,e.data,e.headers,t.transformResponse),e},function(e){return K(e)||(Q(t),e&&e.response&&(e.response.data=W.call(t,e.response.data,e.response.headers,t.transformResponse))),Promise.reject(e)})}function ee(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 te,e="0.25.0",ne={},re=(["object","boolean","number","function","string","symbol"].forEach(function(t,n){ne[t]=function(e){return typeof e===t||"a"+(n<1?"n ":" ")+t}}),{}),oe=(ne.transitional=function(r,o,n){function i(e,t){return"[Axios v0.25.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&&!re[t]&&(re[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)}},{}),ie=(te={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],a=void 0===s||a(s,i,e);if(!0!==a)throw new TypeError("option "+i+" must be "+a)}else if(!0!==n)throw Error("Unknown option "+i)}},validators:ne}).validators;function ae(e){this.defaults=e,this.interceptors={request:new T,response:new T}}function se(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");this.promise=new Promise(function(e){t=e});var t,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 L(e),t(r.reason))})}ae.prototype.request=function(e,t){if("string"==typeof e?(t=t||{}).url=e:t=e||{},!t.url)throw new Error("Provided config url is not valid");(t=ee(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,n=(void 0!==e&&te.assertOptions(e,{silentJSONParsing:ie.transitional(ie.boolean),forcedJSONParsing:ie.transitional(ie.boolean),clarifyTimeoutError:ie.transitional(ie.boolean)},!1),[]),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=[Z,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=Z(s)}catch(e){return Promise.reject(e)}for(;i.length;)o=o.then(i.shift(),i.shift());return o},ae.prototype.getUri=function(e){if(!e.url)throw new Error("Provided config url is not valid");return e=ee(this.defaults,e),S(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},h.forEach(["delete","get","head","options"],function(n){ae.prototype[n]=function(e,t){return this.request(ee(t||{},{method:n,url:e,data:(t||{}).data}))}}),h.forEach(["post","put","patch"],function(r){ae.prototype[r]=function(e,t,n){return this.request(ee(n||{},{method:r,url:e,data:t}))}}),oe=ae,se.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},se.prototype.subscribe=function(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]},se.prototype.unsubscribe=function(e){!this._listeners||-1!==(e=this._listeners.indexOf(e))&&this._listeners.splice(e,1)},se.source=function(){var t;return{token:new se(function(e){t=e}),cancel:t}};var ue=se,s=function t(n){var e=new oe(n),r=c(oe.prototype.request,e);return h.extend(r,oe.prototype,e),h.extend(r,e),r.create=function(e){return t(ee(n,e))},r}(f({})),ce=(s.Axios=oe,s.Cancel=L,s.CancelToken=ue,s.isCancel=K,s.VERSION=e,s.all=function(e){return Promise.all(e)},s.spread=function(t){return function(e){return t.apply(null,e)}},s.isAxiosError=function(e){return h.isObject(e)&&!0===e.isAxiosError},s.default=s),fe={},v={};return function(y){!function(){"use strict";function d(e,t){var n,r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=h(e))||t&&e&&"number"==typeof e.length)return r&&(e=r),n=0,{s:t=function(){},n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},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(){r=r.call(e)},n:function(){var e=r.next();return i=e.done,e},e:function(e){a=!0,o=e},f:function(){try{i||null==r.return||r.return()}finally{if(a)throw o}}}}function h(e,t){if(e){if("string"==typeof e)return c(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)?c(e,t):void 0}}function c(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 i(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&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}Object.defineProperty(v,"__esModule",{value:!0}),v.varsnap=v.clientName=v.version=void 0,v.version="1.8.2",v.clientName="javascript."+v.version;var u={varsnap:!0,env:"development",branch:"",producerToken:"",consumerToken:"",logger:console},a=[],g=[],f=(e(n,null,[{key:"getConfig",value:function(e,t){if(!e)return"";e=e[t];return e?e.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."+v.version+"."+n}},{key:"ajax",value:function(e,t){e={method:"POST",url:e,headers:{"Content-Type":"application/x-www-form-urlencoded"},data:new URLSearchParams(t).toString(),responseType:"json"};return n.isNode()&&e.headers&&(e.headers["User-Agent"]="varsnap.js"),(0,ce.default)(e).then(function(e){return e.data}).catch(function(e){return e})}},{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(){g=[]}},{key:"getProducers",value:function(){return a}},{key:"getConsumers",value:function(){return g}},{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=n.getConfig(e,"branch");return t?new Promise(function(e){return e(t)}):n.isNode()?new Promise(function(n){(0,fe.exec)("git rev-parse --abbrev-ref HEAD",function(e,t){return n(t.trim())})}):new Promise(function(e){return e("")})}}]),n),l=(e(o,[{key:"isEnabled",value:function(){return!!this.config.varsnap&&"production"===f.getConfig(this.config,"env")&&!!f.getConfig(this.config,"producerToken")}},{key:"produce",value:function(t,e){var n=this;return this.isEnabled()?(f.debug(this.config,"Sending call to Varsnap"),Promise.resolve(e).then(function(e){e={producer_token:f.getConfig(n.config,"producerToken"),signature:n.signature,inputs:o.serialize(t),prod_outputs:o.serialize(e)};return f.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 f.error(n.config,"Cannot produce to Varsnap; Signature at rate limit"),!0;404===e.response.status?f.error(n.config,"Cannot produce to Varsnap; check your producer token"):f.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)}}]),o),m=(e(p,[{key:"isEnabled",value:function(){return!!this.config.varsnap&&"development"===f.getConfig(this.config,"env")&&!!f.getConfig(this.config,"consumerToken")}},{key:"consume",value:function(s){var u=this;if(!this.isEnabled())return new Promise(function(e){return f.error(u.config,"Varsnap not enabled for testing"),e(!1)});var o={consumer_token:f.getConfig(this.config,"consumerToken"),signature:this.signature};return f.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 f.error(u.config,"Received error from Varsnap: "+t.status),e(!1)})];0===t.results.length&&f.log(u.config,"No snaps found for signature: "+o.signature);var n,a=[],r=d(t.results);try{for(r.s();!(n=r.n()).done;)!function(){var e,r=n.value,o=p.deserialize(r.inputs),i=p.deserialize(r.prod_outputs),t=void 0;try{t=u.targetFunc.apply(u,function(e){if(Array.isArray(e))return c(e)}(e=o)||function(){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}()||h(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=l.serialize(i)===l.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 f.error(u.config,"Cannot contact Varsnap: "+e),!1})}},{key:"reportCentral",value:function(e,t,n,r,o){var i=this,e={trial_group_id:e.trial_group_id,consumer_token:f.getConfig(this.config,"consumerToken"),snap_id:t.id,test_outputs:l.serialize(r),matches:o.toString(),snap_outputs_formatted:l.serialize_formatted(n),test_outputs_formatted:l.serialize_formatted(r)};return f.ajax("https://www.varsnap.com/api/trial/produce/",e).then(function(e){return!(!e||"ok"!==e.status)&&e.trial_url}).catch(function(e){return f.error(i.config,"Cannot upload test results to Varsnap: "+e),!1})}},{key:"reportLog",value:function(e,t,n,r,o,i){f.log(this.config,""),f.log(this.config,"Testing with Varsnap uuid: "+e),f.log(this.config,"Signature: "+this.signature),f.log(this.config,"Function input args: "+f.limitString(t)),f.log(this.config,"Production function outputs: "+f.limitString(n)),f.log(this.config,"Your function outputs: "+f.limitString(r)),f.log(this.config,"Matching outputs: "+o);e="Cannot upload trial";i&&(e=String(i)),f.log(this.config,"Trial URL: "+e)}},{key:"reportTrialGroup",value:function(e){f.log(this.config,"Trial Group: "+e.trial_group_url)}}],[{key:"deserialize",value:function(e){if(""!==e)return JSON.parse(e)}}]),p);function p(e,t,n){r(this,p),this.targetFunc=e,this.signature=t,this.config=n}function o(e,t,n){r(this,o),this.targetFunc=e,this.signature=t,this.config=n}function n(){r(this,n)}function s(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 e=f.getSignature(o,e=void 0===e?"":e),i=new l(o,e,s._config),n=new m(o,e,s._config);return t.producer=i,t.consumer=n,t.signature=e,a.push(i),g.push(n),t}(v.varsnap=s)._config=u,s.updateConfig=function(e){for(var t=s._config,n=0,r=Object.keys(s._config);n<r.length;n++){var o=r[n];Object.prototype.hasOwnProperty.call(e,o)&&(t=f.setConfig(t,o,e[o]))}s._config=t},s.reset=function(){f.resetConsumers(),f.resetProducers()},s.version=v.version,s.runTests=function(){var t,i=f.getConsumers();return 0===i.length?Promise.resolve(!0):(t=i[0].config,f.getBranch(t).then(function(e){return{branch:e,consumer_token:f.getConfig(t,"consumerToken"),client:v.clientName}}).then(function(e){return f.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 f.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=d(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,z),v.varsnap})}("undefined"==typeof Varsnap?Varsnap={}:Varsnap);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "varsnap",
3
- "version": "1.8.1",
3
+ "version": "1.8.2",
4
4
  "description": "Varsnap Client",
5
5
  "main": "dist/built/index.js",
6
6
  "types": "dist/built/index.d.ts",
@@ -55,7 +55,7 @@
55
55
  "mocha": "^9.1.3",
56
56
  "mochify": "^9.0.0",
57
57
  "nyc": "^15.1.0",
58
- "sinon": "^12.0.1",
58
+ "sinon": "^13.0.0",
59
59
  "source-map-support": "^0.5.19",
60
60
  "tinyify": "^3.0.0",
61
61
  "ts-mocha": "albertyw/ts-mocha",
@@ -65,7 +65,7 @@
65
65
  "uglify-js": "^3.12.3"
66
66
  },
67
67
  "dependencies": {
68
- "axios": "^0.24.0"
68
+ "axios": "^0.25.0"
69
69
  },
70
70
  "files": [
71
71
  "dist/varsnap.*",