@bentonow/bento-node-sdk 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,1010 +1,474 @@
1
- import fetch from 'isomorphic-fetch';
1
+ import fetch from 'cross-fetch';
2
2
 
3
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
3
+ function asyncGeneratorStep(n, t, e, r, o, a, c) {
4
4
  try {
5
- var info = gen[key](arg);
6
- var value = info.value;
7
- } catch (error) {
8
- reject(error);
9
- return;
10
- }
11
-
12
- if (info.done) {
13
- resolve(value);
14
- } else {
15
- Promise.resolve(value).then(_next, _throw);
5
+ var i = n[a](c),
6
+ u = i.value;
7
+ } catch (n) {
8
+ return void e(n);
16
9
  }
10
+ i.done ? t(u) : Promise.resolve(u).then(r, o);
17
11
  }
18
-
19
- function _asyncToGenerator(fn) {
12
+ function _asyncToGenerator(n) {
20
13
  return function () {
21
- var self = this,
22
- args = arguments;
23
- return new Promise(function (resolve, reject) {
24
- var gen = fn.apply(self, args);
25
-
26
- function _next(value) {
27
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
14
+ var t = this,
15
+ e = arguments;
16
+ return new Promise(function (r, o) {
17
+ var a = n.apply(t, e);
18
+ function _next(n) {
19
+ asyncGeneratorStep(a, r, o, _next, _throw, "next", n);
28
20
  }
29
-
30
- function _throw(err) {
31
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
21
+ function _throw(n) {
22
+ asyncGeneratorStep(a, r, o, _next, _throw, "throw", n);
32
23
  }
33
-
34
- _next(undefined);
24
+ _next(void 0);
35
25
  });
36
26
  };
37
27
  }
38
-
28
+ function _construct(t, e, r) {
29
+ if (_isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments);
30
+ var o = [null];
31
+ o.push.apply(o, e);
32
+ var p = new (t.bind.apply(t, o))();
33
+ return r && _setPrototypeOf(p, r.prototype), p;
34
+ }
39
35
  function _extends() {
40
- _extends = Object.assign || function (target) {
41
- for (var i = 1; i < arguments.length; i++) {
42
- var source = arguments[i];
43
-
44
- for (var key in source) {
45
- if (Object.prototype.hasOwnProperty.call(source, key)) {
46
- target[key] = source[key];
47
- }
48
- }
36
+ return _extends = Object.assign ? Object.assign.bind() : function (n) {
37
+ for (var e = 1; e < arguments.length; e++) {
38
+ var t = arguments[e];
39
+ for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
49
40
  }
50
-
51
- return target;
52
- };
53
-
54
- return _extends.apply(this, arguments);
41
+ return n;
42
+ }, _extends.apply(null, arguments);
55
43
  }
56
-
57
- function _inheritsLoose(subClass, superClass) {
58
- subClass.prototype = Object.create(superClass.prototype);
59
- subClass.prototype.constructor = subClass;
60
-
61
- _setPrototypeOf(subClass, superClass);
44
+ function _getPrototypeOf(t) {
45
+ return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) {
46
+ return t.__proto__ || Object.getPrototypeOf(t);
47
+ }, _getPrototypeOf(t);
62
48
  }
63
-
64
- function _getPrototypeOf(o) {
65
- _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
66
- return o.__proto__ || Object.getPrototypeOf(o);
67
- };
68
- return _getPrototypeOf(o);
69
- }
70
-
71
- function _setPrototypeOf(o, p) {
72
- _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
73
- o.__proto__ = p;
74
- return o;
75
- };
76
-
77
- return _setPrototypeOf(o, p);
49
+ function _inheritsLoose(t, o) {
50
+ t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o);
78
51
  }
79
-
80
- function _isNativeReflectConstruct() {
81
- if (typeof Reflect === "undefined" || !Reflect.construct) return false;
82
- if (Reflect.construct.sham) return false;
83
- if (typeof Proxy === "function") return true;
84
-
52
+ function _isNativeFunction(t) {
85
53
  try {
86
- Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
87
- return true;
88
- } catch (e) {
89
- return false;
90
- }
91
- }
92
-
93
- function _construct(Parent, args, Class) {
94
- if (_isNativeReflectConstruct()) {
95
- _construct = Reflect.construct;
96
- } else {
97
- _construct = function _construct(Parent, args, Class) {
98
- var a = [null];
99
- a.push.apply(a, args);
100
- var Constructor = Function.bind.apply(Parent, a);
101
- var instance = new Constructor();
102
- if (Class) _setPrototypeOf(instance, Class.prototype);
103
- return instance;
104
- };
54
+ return -1 !== Function.toString.call(t).indexOf("[native code]");
55
+ } catch (n) {
56
+ return "function" == typeof t;
105
57
  }
106
-
107
- return _construct.apply(null, arguments);
108
58
  }
109
-
110
- function _isNativeFunction(fn) {
111
- return Function.toString.call(fn).indexOf("[native code]") !== -1;
59
+ function _isNativeReflectConstruct() {
60
+ try {
61
+ var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
62
+ } catch (t) {}
63
+ return (_isNativeReflectConstruct = function () {
64
+ return !!t;
65
+ })();
112
66
  }
113
-
114
- function _wrapNativeSuper(Class) {
115
- var _cache = typeof Map === "function" ? new Map() : undefined;
116
-
117
- _wrapNativeSuper = function _wrapNativeSuper(Class) {
118
- if (Class === null || !_isNativeFunction(Class)) return Class;
119
-
120
- if (typeof Class !== "function") {
121
- throw new TypeError("Super expression must either be null or a function");
122
- }
123
-
124
- if (typeof _cache !== "undefined") {
125
- if (_cache.has(Class)) return _cache.get(Class);
126
-
127
- _cache.set(Class, Wrapper);
128
- }
129
-
130
- function Wrapper() {
131
- return _construct(Class, arguments, _getPrototypeOf(this).constructor);
132
- }
133
-
134
- Wrapper.prototype = Object.create(Class.prototype, {
135
- constructor: {
136
- value: Wrapper,
137
- enumerable: false,
138
- writable: true,
139
- configurable: true
140
- }
141
- });
142
- return _setPrototypeOf(Wrapper, Class);
67
+ function _regeneratorRuntime() {
68
+ _regeneratorRuntime = function () {
69
+ return e;
143
70
  };
144
-
145
- return _wrapNativeSuper(Class);
146
- }
147
-
148
- function createCommonjsModule(fn, module) {
149
- return module = { exports: {} }, fn(module, module.exports), module.exports;
150
- }
151
-
152
- var runtime_1 = createCommonjsModule(function (module) {
153
- /**
154
- * Copyright (c) 2014-present, Facebook, Inc.
155
- *
156
- * This source code is licensed under the MIT license found in the
157
- * LICENSE file in the root directory of this source tree.
158
- */
159
-
160
- var runtime = (function (exports) {
161
-
162
- var Op = Object.prototype;
163
- var hasOwn = Op.hasOwnProperty;
164
- var undefined$1; // More compressible than void 0.
165
- var $Symbol = typeof Symbol === "function" ? Symbol : {};
166
- var iteratorSymbol = $Symbol.iterator || "@@iterator";
167
- var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
168
- var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
169
-
170
- function define(obj, key, value) {
171
- Object.defineProperty(obj, key, {
172
- value: value,
173
- enumerable: true,
174
- configurable: true,
175
- writable: true
176
- });
177
- return obj[key];
71
+ var t,
72
+ e = {},
73
+ r = Object.prototype,
74
+ n = r.hasOwnProperty,
75
+ o = Object.defineProperty || function (t, e, r) {
76
+ t[e] = r.value;
77
+ },
78
+ i = "function" == typeof Symbol ? Symbol : {},
79
+ a = i.iterator || "@@iterator",
80
+ c = i.asyncIterator || "@@asyncIterator",
81
+ u = i.toStringTag || "@@toStringTag";
82
+ function define(t, e, r) {
83
+ return Object.defineProperty(t, e, {
84
+ value: r,
85
+ enumerable: !0,
86
+ configurable: !0,
87
+ writable: !0
88
+ }), t[e];
178
89
  }
179
90
  try {
180
- // IE 8 has a broken Object.defineProperty that only works on DOM objects.
181
91
  define({}, "");
182
- } catch (err) {
183
- define = function(obj, key, value) {
184
- return obj[key] = value;
92
+ } catch (t) {
93
+ define = function (t, e, r) {
94
+ return t[e] = r;
185
95
  };
186
96
  }
187
-
188
- function wrap(innerFn, outerFn, self, tryLocsList) {
189
- // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
190
- var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
191
- var generator = Object.create(protoGenerator.prototype);
192
- var context = new Context(tryLocsList || []);
193
-
194
- // The ._invoke method unifies the implementations of the .next,
195
- // .throw, and .return methods.
196
- generator._invoke = makeInvokeMethod(innerFn, self, context);
197
-
198
- return generator;
97
+ function wrap(t, e, r, n) {
98
+ var i = e && e.prototype instanceof Generator ? e : Generator,
99
+ a = Object.create(i.prototype),
100
+ c = new Context(n || []);
101
+ return o(a, "_invoke", {
102
+ value: makeInvokeMethod(t, r, c)
103
+ }), a;
199
104
  }
200
- exports.wrap = wrap;
201
-
202
- // Try/catch helper to minimize deoptimizations. Returns a completion
203
- // record like context.tryEntries[i].completion. This interface could
204
- // have been (and was previously) designed to take a closure to be
205
- // invoked without arguments, but in all the cases we care about we
206
- // already have an existing method we want to call, so there's no need
207
- // to create a new function object. We can even get away with assuming
208
- // the method takes exactly one argument, since that happens to be true
209
- // in every case, so we don't have to touch the arguments object. The
210
- // only additional allocation required is the completion record, which
211
- // has a stable shape and so hopefully should be cheap to allocate.
212
- function tryCatch(fn, obj, arg) {
105
+ function tryCatch(t, e, r) {
213
106
  try {
214
- return { type: "normal", arg: fn.call(obj, arg) };
215
- } catch (err) {
216
- return { type: "throw", arg: err };
107
+ return {
108
+ type: "normal",
109
+ arg: t.call(e, r)
110
+ };
111
+ } catch (t) {
112
+ return {
113
+ type: "throw",
114
+ arg: t
115
+ };
217
116
  }
218
117
  }
219
-
220
- var GenStateSuspendedStart = "suspendedStart";
221
- var GenStateSuspendedYield = "suspendedYield";
222
- var GenStateExecuting = "executing";
223
- var GenStateCompleted = "completed";
224
-
225
- // Returning this object from the innerFn has the same effect as
226
- // breaking out of the dispatch switch statement.
227
- var ContinueSentinel = {};
228
-
229
- // Dummy constructor functions that we use as the .constructor and
230
- // .constructor.prototype properties for functions that return Generator
231
- // objects. For full spec compliance, you may wish to configure your
232
- // minifier not to mangle the names of these two functions.
118
+ e.wrap = wrap;
119
+ var h = "suspendedStart",
120
+ l = "suspendedYield",
121
+ f = "executing",
122
+ s = "completed",
123
+ y = {};
233
124
  function Generator() {}
234
125
  function GeneratorFunction() {}
235
126
  function GeneratorFunctionPrototype() {}
236
-
237
- // This is a polyfill for %IteratorPrototype% for environments that
238
- // don't natively support it.
239
- var IteratorPrototype = {};
240
- define(IteratorPrototype, iteratorSymbol, function () {
127
+ var p = {};
128
+ define(p, a, function () {
241
129
  return this;
242
130
  });
243
-
244
- var getProto = Object.getPrototypeOf;
245
- var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
246
- if (NativeIteratorPrototype &&
247
- NativeIteratorPrototype !== Op &&
248
- hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
249
- // This environment has a native %IteratorPrototype%; use it instead
250
- // of the polyfill.
251
- IteratorPrototype = NativeIteratorPrototype;
252
- }
253
-
254
- var Gp = GeneratorFunctionPrototype.prototype =
255
- Generator.prototype = Object.create(IteratorPrototype);
256
- GeneratorFunction.prototype = GeneratorFunctionPrototype;
257
- define(Gp, "constructor", GeneratorFunctionPrototype);
258
- define(GeneratorFunctionPrototype, "constructor", GeneratorFunction);
259
- GeneratorFunction.displayName = define(
260
- GeneratorFunctionPrototype,
261
- toStringTagSymbol,
262
- "GeneratorFunction"
263
- );
264
-
265
- // Helper for defining the .next, .throw, and .return methods of the
266
- // Iterator interface in terms of a single ._invoke method.
267
- function defineIteratorMethods(prototype) {
268
- ["next", "throw", "return"].forEach(function(method) {
269
- define(prototype, method, function(arg) {
270
- return this._invoke(method, arg);
131
+ var d = Object.getPrototypeOf,
132
+ v = d && d(d(values([])));
133
+ v && v !== r && n.call(v, a) && (p = v);
134
+ var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);
135
+ function defineIteratorMethods(t) {
136
+ ["next", "throw", "return"].forEach(function (e) {
137
+ define(t, e, function (t) {
138
+ return this._invoke(e, t);
271
139
  });
272
140
  });
273
141
  }
274
-
275
- exports.isGeneratorFunction = function(genFun) {
276
- var ctor = typeof genFun === "function" && genFun.constructor;
277
- return ctor
278
- ? ctor === GeneratorFunction ||
279
- // For the native GeneratorFunction constructor, the best we can
280
- // do is to check its .name property.
281
- (ctor.displayName || ctor.name) === "GeneratorFunction"
282
- : false;
283
- };
284
-
285
- exports.mark = function(genFun) {
286
- if (Object.setPrototypeOf) {
287
- Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
288
- } else {
289
- genFun.__proto__ = GeneratorFunctionPrototype;
290
- define(genFun, toStringTagSymbol, "GeneratorFunction");
291
- }
292
- genFun.prototype = Object.create(Gp);
293
- return genFun;
294
- };
295
-
296
- // Within the body of any async function, `await x` is transformed to
297
- // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
298
- // `hasOwn.call(value, "__await")` to determine if the yielded value is
299
- // meant to be awaited.
300
- exports.awrap = function(arg) {
301
- return { __await: arg };
302
- };
303
-
304
- function AsyncIterator(generator, PromiseImpl) {
305
- function invoke(method, arg, resolve, reject) {
306
- var record = tryCatch(generator[method], generator, arg);
307
- if (record.type === "throw") {
308
- reject(record.arg);
309
- } else {
310
- var result = record.arg;
311
- var value = result.value;
312
- if (value &&
313
- typeof value === "object" &&
314
- hasOwn.call(value, "__await")) {
315
- return PromiseImpl.resolve(value.__await).then(function(value) {
316
- invoke("next", value, resolve, reject);
317
- }, function(err) {
318
- invoke("throw", err, resolve, reject);
319
- });
320
- }
321
-
322
- return PromiseImpl.resolve(value).then(function(unwrapped) {
323
- // When a yielded Promise is resolved, its final value becomes
324
- // the .value of the Promise<{value,done}> result for the
325
- // current iteration.
326
- result.value = unwrapped;
327
- resolve(result);
328
- }, function(error) {
329
- // If a rejected Promise was yielded, throw the rejection back
330
- // into the async generator function so it can be handled there.
331
- return invoke("throw", error, resolve, reject);
142
+ function AsyncIterator(t, e) {
143
+ function invoke(r, o, i, a) {
144
+ var c = tryCatch(t[r], t, o);
145
+ if ("throw" !== c.type) {
146
+ var u = c.arg,
147
+ h = u.value;
148
+ return h && "object" == typeof h && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) {
149
+ invoke("next", t, i, a);
150
+ }, function (t) {
151
+ invoke("throw", t, i, a);
152
+ }) : e.resolve(h).then(function (t) {
153
+ u.value = t, i(u);
154
+ }, function (t) {
155
+ return invoke("throw", t, i, a);
332
156
  });
333
157
  }
158
+ a(c.arg);
334
159
  }
335
-
336
- var previousPromise;
337
-
338
- function enqueue(method, arg) {
339
- function callInvokeWithMethodAndArg() {
340
- return new PromiseImpl(function(resolve, reject) {
341
- invoke(method, arg, resolve, reject);
342
- });
160
+ var r;
161
+ o(this, "_invoke", {
162
+ value: function (t, n) {
163
+ function callInvokeWithMethodAndArg() {
164
+ return new e(function (e, r) {
165
+ invoke(t, n, e, r);
166
+ });
167
+ }
168
+ return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
343
169
  }
344
-
345
- return previousPromise =
346
- // If enqueue has been called before, then we want to wait until
347
- // all previous Promises have been resolved before calling invoke,
348
- // so that results are always delivered in the correct order. If
349
- // enqueue has not been called before, then it is important to
350
- // call invoke immediately, without waiting on a callback to fire,
351
- // so that the async generator function has the opportunity to do
352
- // any necessary setup in a predictable way. This predictability
353
- // is why the Promise constructor synchronously invokes its
354
- // executor callback, and why async functions synchronously
355
- // execute code before the first await. Since we implement simple
356
- // async functions in terms of async generators, it is especially
357
- // important to get this right, even though it requires care.
358
- previousPromise ? previousPromise.then(
359
- callInvokeWithMethodAndArg,
360
- // Avoid propagating failures to Promises returned by later
361
- // invocations of the iterator.
362
- callInvokeWithMethodAndArg
363
- ) : callInvokeWithMethodAndArg();
364
- }
365
-
366
- // Define the unified helper method that is used to implement .next,
367
- // .throw, and .return (see defineIteratorMethods).
368
- this._invoke = enqueue;
170
+ });
369
171
  }
370
-
371
- defineIteratorMethods(AsyncIterator.prototype);
372
- define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
373
- return this;
374
- });
375
- exports.AsyncIterator = AsyncIterator;
376
-
377
- // Note that simple async functions are implemented on top of
378
- // AsyncIterator objects; they just return a Promise for the value of
379
- // the final result produced by the iterator.
380
- exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {
381
- if (PromiseImpl === void 0) PromiseImpl = Promise;
382
-
383
- var iter = new AsyncIterator(
384
- wrap(innerFn, outerFn, self, tryLocsList),
385
- PromiseImpl
386
- );
387
-
388
- return exports.isGeneratorFunction(outerFn)
389
- ? iter // If outerFn is a generator, return the full iterator.
390
- : iter.next().then(function(result) {
391
- return result.done ? result.value : iter.next();
392
- });
393
- };
394
-
395
- function makeInvokeMethod(innerFn, self, context) {
396
- var state = GenStateSuspendedStart;
397
-
398
- return function invoke(method, arg) {
399
- if (state === GenStateExecuting) {
400
- throw new Error("Generator is already running");
401
- }
402
-
403
- if (state === GenStateCompleted) {
404
- if (method === "throw") {
405
- throw arg;
406
- }
407
-
408
- // Be forgiving, per 25.3.3.3.3 of the spec:
409
- // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
410
- return doneResult();
172
+ function makeInvokeMethod(e, r, n) {
173
+ var o = h;
174
+ return function (i, a) {
175
+ if (o === f) throw Error("Generator is already running");
176
+ if (o === s) {
177
+ if ("throw" === i) throw a;
178
+ return {
179
+ value: t,
180
+ done: !0
181
+ };
411
182
  }
412
-
413
- context.method = method;
414
- context.arg = arg;
415
-
416
- while (true) {
417
- var delegate = context.delegate;
418
- if (delegate) {
419
- var delegateResult = maybeInvokeDelegate(delegate, context);
420
- if (delegateResult) {
421
- if (delegateResult === ContinueSentinel) continue;
422
- return delegateResult;
183
+ for (n.method = i, n.arg = a;;) {
184
+ var c = n.delegate;
185
+ if (c) {
186
+ var u = maybeInvokeDelegate(c, n);
187
+ if (u) {
188
+ if (u === y) continue;
189
+ return u;
423
190
  }
424
191
  }
425
-
426
- if (context.method === "next") {
427
- // Setting context._sent for legacy support of Babel's
428
- // function.sent implementation.
429
- context.sent = context._sent = context.arg;
430
-
431
- } else if (context.method === "throw") {
432
- if (state === GenStateSuspendedStart) {
433
- state = GenStateCompleted;
434
- throw context.arg;
435
- }
436
-
437
- context.dispatchException(context.arg);
438
-
439
- } else if (context.method === "return") {
440
- context.abrupt("return", context.arg);
441
- }
442
-
443
- state = GenStateExecuting;
444
-
445
- var record = tryCatch(innerFn, self, context);
446
- if (record.type === "normal") {
447
- // If an exception is thrown from innerFn, we leave state ===
448
- // GenStateExecuting and loop back for another invocation.
449
- state = context.done
450
- ? GenStateCompleted
451
- : GenStateSuspendedYield;
452
-
453
- if (record.arg === ContinueSentinel) {
454
- continue;
455
- }
456
-
192
+ if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
193
+ if (o === h) throw o = s, n.arg;
194
+ n.dispatchException(n.arg);
195
+ } else "return" === n.method && n.abrupt("return", n.arg);
196
+ o = f;
197
+ var p = tryCatch(e, r, n);
198
+ if ("normal" === p.type) {
199
+ if (o = n.done ? s : l, p.arg === y) continue;
457
200
  return {
458
- value: record.arg,
459
- done: context.done
201
+ value: p.arg,
202
+ done: n.done
460
203
  };
461
-
462
- } else if (record.type === "throw") {
463
- state = GenStateCompleted;
464
- // Dispatch the exception by looping back around to the
465
- // context.dispatchException(context.arg) call above.
466
- context.method = "throw";
467
- context.arg = record.arg;
468
204
  }
205
+ "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg);
469
206
  }
470
207
  };
471
208
  }
472
-
473
- // Call delegate.iterator[context.method](context.arg) and handle the
474
- // result, either by returning a { value, done } result from the
475
- // delegate iterator, or by modifying context.method and context.arg,
476
- // setting context.delegate to null, and returning the ContinueSentinel.
477
- function maybeInvokeDelegate(delegate, context) {
478
- var method = delegate.iterator[context.method];
479
- if (method === undefined$1) {
480
- // A .throw or .return when the delegate iterator has no .throw
481
- // method always terminates the yield* loop.
482
- context.delegate = null;
483
-
484
- if (context.method === "throw") {
485
- // Note: ["return"] must be used for ES3 parsing compatibility.
486
- if (delegate.iterator["return"]) {
487
- // If the delegate iterator has a return method, give it a
488
- // chance to clean up.
489
- context.method = "return";
490
- context.arg = undefined$1;
491
- maybeInvokeDelegate(delegate, context);
492
-
493
- if (context.method === "throw") {
494
- // If maybeInvokeDelegate(context) changed context.method from
495
- // "return" to "throw", let that override the TypeError below.
496
- return ContinueSentinel;
497
- }
498
- }
499
-
500
- context.method = "throw";
501
- context.arg = new TypeError(
502
- "The iterator does not provide a 'throw' method");
503
- }
504
-
505
- return ContinueSentinel;
506
- }
507
-
508
- var record = tryCatch(method, delegate.iterator, context.arg);
509
-
510
- if (record.type === "throw") {
511
- context.method = "throw";
512
- context.arg = record.arg;
513
- context.delegate = null;
514
- return ContinueSentinel;
515
- }
516
-
517
- var info = record.arg;
518
-
519
- if (! info) {
520
- context.method = "throw";
521
- context.arg = new TypeError("iterator result is not an object");
522
- context.delegate = null;
523
- return ContinueSentinel;
524
- }
525
-
526
- if (info.done) {
527
- // Assign the result of the finished delegate to the temporary
528
- // variable specified by delegate.resultName (see delegateYield).
529
- context[delegate.resultName] = info.value;
530
-
531
- // Resume execution at the desired location (see delegateYield).
532
- context.next = delegate.nextLoc;
533
-
534
- // If context.method was "throw" but the delegate handled the
535
- // exception, let the outer generator proceed normally. If
536
- // context.method was "next", forget context.arg since it has been
537
- // "consumed" by the delegate iterator. If context.method was
538
- // "return", allow the original .return call to continue in the
539
- // outer generator.
540
- if (context.method !== "return") {
541
- context.method = "next";
542
- context.arg = undefined$1;
543
- }
544
-
545
- } else {
546
- // Re-yield the result returned by the delegate method.
547
- return info;
548
- }
549
-
550
- // The delegate iterator is finished, so forget it and continue with
551
- // the outer generator.
552
- context.delegate = null;
553
- return ContinueSentinel;
209
+ function maybeInvokeDelegate(e, r) {
210
+ var n = r.method,
211
+ o = e.iterator[n];
212
+ if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y;
213
+ var i = tryCatch(o, e.iterator, r.arg);
214
+ if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y;
215
+ var a = i.arg;
216
+ return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y);
554
217
  }
555
-
556
- // Define Generator.prototype.{next,throw,return} in terms of the
557
- // unified ._invoke helper method.
558
- defineIteratorMethods(Gp);
559
-
560
- define(Gp, toStringTagSymbol, "Generator");
561
-
562
- // A Generator should always return itself as the iterator object when the
563
- // @@iterator function is called on it. Some browsers' implementations of the
564
- // iterator prototype chain incorrectly implement this, causing the Generator
565
- // object to not be returned from this call. This ensures that doesn't happen.
566
- // See https://github.com/facebook/regenerator/issues/274 for more details.
567
- define(Gp, iteratorSymbol, function() {
568
- return this;
569
- });
570
-
571
- define(Gp, "toString", function() {
572
- return "[object Generator]";
573
- });
574
-
575
- function pushTryEntry(locs) {
576
- var entry = { tryLoc: locs[0] };
577
-
578
- if (1 in locs) {
579
- entry.catchLoc = locs[1];
580
- }
581
-
582
- if (2 in locs) {
583
- entry.finallyLoc = locs[2];
584
- entry.afterLoc = locs[3];
585
- }
586
-
587
- this.tryEntries.push(entry);
218
+ function pushTryEntry(t) {
219
+ var e = {
220
+ tryLoc: t[0]
221
+ };
222
+ 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);
588
223
  }
589
-
590
- function resetTryEntry(entry) {
591
- var record = entry.completion || {};
592
- record.type = "normal";
593
- delete record.arg;
594
- entry.completion = record;
224
+ function resetTryEntry(t) {
225
+ var e = t.completion || {};
226
+ e.type = "normal", delete e.arg, t.completion = e;
595
227
  }
596
-
597
- function Context(tryLocsList) {
598
- // The root entry object (effectively a try statement without a catch
599
- // or a finally block) gives us a place to store values thrown from
600
- // locations where there is no enclosing try statement.
601
- this.tryEntries = [{ tryLoc: "root" }];
602
- tryLocsList.forEach(pushTryEntry, this);
603
- this.reset(true);
228
+ function Context(t) {
229
+ this.tryEntries = [{
230
+ tryLoc: "root"
231
+ }], t.forEach(pushTryEntry, this), this.reset(!0);
604
232
  }
605
-
606
- exports.keys = function(object) {
607
- var keys = [];
608
- for (var key in object) {
609
- keys.push(key);
610
- }
611
- keys.reverse();
612
-
613
- // Rather than returning an object with a next method, we keep
614
- // things simple and return the next function itself.
615
- return function next() {
616
- while (keys.length) {
617
- var key = keys.pop();
618
- if (key in object) {
619
- next.value = key;
620
- next.done = false;
621
- return next;
622
- }
623
- }
624
-
625
- // To avoid creating an additional object, we just hang the .value
626
- // and .done properties off the next function object itself. This
627
- // also ensures that the minifier will not anonymize the function.
628
- next.done = true;
629
- return next;
630
- };
631
- };
632
-
633
- function values(iterable) {
634
- if (iterable) {
635
- var iteratorMethod = iterable[iteratorSymbol];
636
- if (iteratorMethod) {
637
- return iteratorMethod.call(iterable);
638
- }
639
-
640
- if (typeof iterable.next === "function") {
641
- return iterable;
642
- }
643
-
644
- if (!isNaN(iterable.length)) {
645
- var i = -1, next = function next() {
646
- while (++i < iterable.length) {
647
- if (hasOwn.call(iterable, i)) {
648
- next.value = iterable[i];
649
- next.done = false;
650
- return next;
651
- }
652
- }
653
-
654
- next.value = undefined$1;
655
- next.done = true;
656
-
657
- return next;
658
- };
659
-
660
- return next.next = next;
233
+ function values(e) {
234
+ if (e || "" === e) {
235
+ var r = e[a];
236
+ if (r) return r.call(e);
237
+ if ("function" == typeof e.next) return e;
238
+ if (!isNaN(e.length)) {
239
+ var o = -1,
240
+ i = function next() {
241
+ for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next;
242
+ return next.value = t, next.done = !0, next;
243
+ };
244
+ return i.next = i;
661
245
  }
662
246
  }
663
-
664
- // Return an iterator with no values.
665
- return { next: doneResult };
247
+ throw new TypeError(typeof e + " is not iterable");
666
248
  }
667
- exports.values = values;
668
-
669
- function doneResult() {
670
- return { value: undefined$1, done: true };
671
- }
672
-
673
- Context.prototype = {
674
- constructor: Context,
675
-
676
- reset: function(skipTempReset) {
677
- this.prev = 0;
678
- this.next = 0;
679
- // Resetting context._sent for legacy support of Babel's
680
- // function.sent implementation.
681
- this.sent = this._sent = undefined$1;
682
- this.done = false;
683
- this.delegate = null;
684
-
685
- this.method = "next";
686
- this.arg = undefined$1;
687
-
688
- this.tryEntries.forEach(resetTryEntry);
689
-
690
- if (!skipTempReset) {
691
- for (var name in this) {
692
- // Not sure about the optimal order of these conditions:
693
- if (name.charAt(0) === "t" &&
694
- hasOwn.call(this, name) &&
695
- !isNaN(+name.slice(1))) {
696
- this[name] = undefined$1;
697
- }
698
- }
249
+ return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", {
250
+ value: GeneratorFunctionPrototype,
251
+ configurable: !0
252
+ }), o(GeneratorFunctionPrototype, "constructor", {
253
+ value: GeneratorFunction,
254
+ configurable: !0
255
+ }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) {
256
+ var e = "function" == typeof t && t.constructor;
257
+ return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name));
258
+ }, e.mark = function (t) {
259
+ return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t;
260
+ }, e.awrap = function (t) {
261
+ return {
262
+ __await: t
263
+ };
264
+ }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {
265
+ return this;
266
+ }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {
267
+ void 0 === i && (i = Promise);
268
+ var a = new AsyncIterator(wrap(t, r, n, o), i);
269
+ return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {
270
+ return t.done ? t.value : a.next();
271
+ });
272
+ }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () {
273
+ return this;
274
+ }), define(g, "toString", function () {
275
+ return "[object Generator]";
276
+ }), e.keys = function (t) {
277
+ var e = Object(t),
278
+ r = [];
279
+ for (var n in e) r.push(n);
280
+ return r.reverse(), function next() {
281
+ for (; r.length;) {
282
+ var t = r.pop();
283
+ if (t in e) return next.value = t, next.done = !1, next;
699
284
  }
285
+ return next.done = !0, next;
286
+ };
287
+ }, e.values = values, Context.prototype = {
288
+ constructor: Context,
289
+ reset: function (e) {
290
+ if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t);
700
291
  },
701
-
702
- stop: function() {
703
- this.done = true;
704
-
705
- var rootEntry = this.tryEntries[0];
706
- var rootRecord = rootEntry.completion;
707
- if (rootRecord.type === "throw") {
708
- throw rootRecord.arg;
709
- }
710
-
292
+ stop: function () {
293
+ this.done = !0;
294
+ var t = this.tryEntries[0].completion;
295
+ if ("throw" === t.type) throw t.arg;
711
296
  return this.rval;
712
297
  },
713
-
714
- dispatchException: function(exception) {
715
- if (this.done) {
716
- throw exception;
717
- }
718
-
719
- var context = this;
720
- function handle(loc, caught) {
721
- record.type = "throw";
722
- record.arg = exception;
723
- context.next = loc;
724
-
725
- if (caught) {
726
- // If the dispatched exception was caught by a catch block,
727
- // then let that catch block handle the exception normally.
728
- context.method = "next";
729
- context.arg = undefined$1;
730
- }
731
-
732
- return !! caught;
298
+ dispatchException: function (e) {
299
+ if (this.done) throw e;
300
+ var r = this;
301
+ function handle(n, o) {
302
+ return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o;
733
303
  }
734
-
735
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
736
- var entry = this.tryEntries[i];
737
- var record = entry.completion;
738
-
739
- if (entry.tryLoc === "root") {
740
- // Exception thrown outside of any try block that could handle
741
- // it, so set the completion value of the entire function to
742
- // throw the exception.
743
- return handle("end");
744
- }
745
-
746
- if (entry.tryLoc <= this.prev) {
747
- var hasCatch = hasOwn.call(entry, "catchLoc");
748
- var hasFinally = hasOwn.call(entry, "finallyLoc");
749
-
750
- if (hasCatch && hasFinally) {
751
- if (this.prev < entry.catchLoc) {
752
- return handle(entry.catchLoc, true);
753
- } else if (this.prev < entry.finallyLoc) {
754
- return handle(entry.finallyLoc);
755
- }
756
-
757
- } else if (hasCatch) {
758
- if (this.prev < entry.catchLoc) {
759
- return handle(entry.catchLoc, true);
760
- }
761
-
762
- } else if (hasFinally) {
763
- if (this.prev < entry.finallyLoc) {
764
- return handle(entry.finallyLoc);
765
- }
766
-
304
+ for (var o = this.tryEntries.length - 1; o >= 0; --o) {
305
+ var i = this.tryEntries[o],
306
+ a = i.completion;
307
+ if ("root" === i.tryLoc) return handle("end");
308
+ if (i.tryLoc <= this.prev) {
309
+ var c = n.call(i, "catchLoc"),
310
+ u = n.call(i, "finallyLoc");
311
+ if (c && u) {
312
+ if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
313
+ if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
314
+ } else if (c) {
315
+ if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
767
316
  } else {
768
- throw new Error("try statement without catch or finally");
317
+ if (!u) throw Error("try statement without catch or finally");
318
+ if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
769
319
  }
770
320
  }
771
321
  }
772
322
  },
773
-
774
- abrupt: function(type, arg) {
775
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
776
- var entry = this.tryEntries[i];
777
- if (entry.tryLoc <= this.prev &&
778
- hasOwn.call(entry, "finallyLoc") &&
779
- this.prev < entry.finallyLoc) {
780
- var finallyEntry = entry;
323
+ abrupt: function (t, e) {
324
+ for (var r = this.tryEntries.length - 1; r >= 0; --r) {
325
+ var o = this.tryEntries[r];
326
+ if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
327
+ var i = o;
781
328
  break;
782
329
  }
783
330
  }
784
-
785
- if (finallyEntry &&
786
- (type === "break" ||
787
- type === "continue") &&
788
- finallyEntry.tryLoc <= arg &&
789
- arg <= finallyEntry.finallyLoc) {
790
- // Ignore the finally entry if control is not jumping to a
791
- // location outside the try/catch block.
792
- finallyEntry = null;
793
- }
794
-
795
- var record = finallyEntry ? finallyEntry.completion : {};
796
- record.type = type;
797
- record.arg = arg;
798
-
799
- if (finallyEntry) {
800
- this.method = "next";
801
- this.next = finallyEntry.finallyLoc;
802
- return ContinueSentinel;
803
- }
804
-
805
- return this.complete(record);
331
+ i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);
332
+ var a = i ? i.completion : {};
333
+ return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a);
806
334
  },
807
-
808
- complete: function(record, afterLoc) {
809
- if (record.type === "throw") {
810
- throw record.arg;
811
- }
812
-
813
- if (record.type === "break" ||
814
- record.type === "continue") {
815
- this.next = record.arg;
816
- } else if (record.type === "return") {
817
- this.rval = this.arg = record.arg;
818
- this.method = "return";
819
- this.next = "end";
820
- } else if (record.type === "normal" && afterLoc) {
821
- this.next = afterLoc;
822
- }
823
-
824
- return ContinueSentinel;
335
+ complete: function (t, e) {
336
+ if ("throw" === t.type) throw t.arg;
337
+ return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y;
825
338
  },
826
-
827
- finish: function(finallyLoc) {
828
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
829
- var entry = this.tryEntries[i];
830
- if (entry.finallyLoc === finallyLoc) {
831
- this.complete(entry.completion, entry.afterLoc);
832
- resetTryEntry(entry);
833
- return ContinueSentinel;
834
- }
339
+ finish: function (t) {
340
+ for (var e = this.tryEntries.length - 1; e >= 0; --e) {
341
+ var r = this.tryEntries[e];
342
+ if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;
835
343
  }
836
344
  },
837
-
838
- "catch": function(tryLoc) {
839
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
840
- var entry = this.tryEntries[i];
841
- if (entry.tryLoc === tryLoc) {
842
- var record = entry.completion;
843
- if (record.type === "throw") {
844
- var thrown = record.arg;
845
- resetTryEntry(entry);
345
+ catch: function (t) {
346
+ for (var e = this.tryEntries.length - 1; e >= 0; --e) {
347
+ var r = this.tryEntries[e];
348
+ if (r.tryLoc === t) {
349
+ var n = r.completion;
350
+ if ("throw" === n.type) {
351
+ var o = n.arg;
352
+ resetTryEntry(r);
846
353
  }
847
- return thrown;
354
+ return o;
848
355
  }
849
356
  }
850
-
851
- // The context.catch method must only be called with a location
852
- // argument that corresponds to a known catch block.
853
- throw new Error("illegal catch attempt");
357
+ throw Error("illegal catch attempt");
854
358
  },
855
-
856
- delegateYield: function(iterable, resultName, nextLoc) {
857
- this.delegate = {
858
- iterator: values(iterable),
859
- resultName: resultName,
860
- nextLoc: nextLoc
861
- };
862
-
863
- if (this.method === "next") {
864
- // Deliberately forget the last sent value so that we don't
865
- // accidentally pass it on to the delegate.
866
- this.arg = undefined$1;
867
- }
868
-
869
- return ContinueSentinel;
359
+ delegateYield: function (e, r, n) {
360
+ return this.delegate = {
361
+ iterator: values(e),
362
+ resultName: r,
363
+ nextLoc: n
364
+ }, "next" === this.method && (this.arg = t), y;
870
365
  }
871
- };
872
-
873
- // Regardless of whether this script is executing as a CommonJS module
874
- // or not, return the runtime object so that we can declare the variable
875
- // regeneratorRuntime in the outer scope, which allows this module to be
876
- // injected easily by `bin/regenerator --include-runtime script.js`.
877
- return exports;
878
-
879
- }(
880
- // If this script is executing as a CommonJS module, use module.exports
881
- // as the regeneratorRuntime namespace. Otherwise create a new empty
882
- // object. Either way, the resulting object will be used to initialize
883
- // the regeneratorRuntime variable at the top of this file.
884
- module.exports
885
- ));
886
-
887
- try {
888
- regeneratorRuntime = runtime;
889
- } catch (accidentalStrictMode) {
890
- // This module should not be running in strict mode, so the above
891
- // assignment should always work unless something is misconfigured. Just
892
- // in case runtime.js accidentally runs in strict mode, in modern engines
893
- // we can explicitly access globalThis. In older engines we can escape
894
- // strict mode using a global Function call. This could conceivably fail
895
- // if a Content Security Policy forbids using Function, but in that case
896
- // the proper solution is to fix the accidental strict mode problem. If
897
- // you've misconfigured your bundler to force strict mode and applied a
898
- // CSP to forbid Function, and you're not willing to fix either of those
899
- // problems, please detail your unique predicament in a GitHub issue.
900
- if (typeof globalThis === "object") {
901
- globalThis.regeneratorRuntime = runtime;
902
- } else {
903
- Function("r", "regeneratorRuntime = r")(runtime);
904
- }
366
+ }, e;
367
+ }
368
+ function _setPrototypeOf(t, e) {
369
+ return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
370
+ return t.__proto__ = e, t;
371
+ }, _setPrototypeOf(t, e);
372
+ }
373
+ function _wrapNativeSuper(t) {
374
+ var r = "function" == typeof Map ? new Map() : void 0;
375
+ return _wrapNativeSuper = function (t) {
376
+ if (null === t || !_isNativeFunction(t)) return t;
377
+ if ("function" != typeof t) throw new TypeError("Super expression must either be null or a function");
378
+ if (void 0 !== r) {
379
+ if (r.has(t)) return r.get(t);
380
+ r.set(t, Wrapper);
381
+ }
382
+ function Wrapper() {
383
+ return _construct(t, arguments, _getPrototypeOf(this).constructor);
384
+ }
385
+ return Wrapper.prototype = Object.create(t.prototype, {
386
+ constructor: {
387
+ value: Wrapper,
388
+ enumerable: !1,
389
+ writable: !0,
390
+ configurable: !0
391
+ }
392
+ }), _setPrototypeOf(Wrapper, t);
393
+ }, _wrapNativeSuper(t);
905
394
  }
906
- });
907
395
 
908
396
  var TooFewSubscribersError = /*#__PURE__*/function (_Error) {
909
- _inheritsLoose(TooFewSubscribersError, _Error);
910
-
911
397
  function TooFewSubscribersError(message) {
912
398
  var _this;
913
-
914
399
  if (message === void 0) {
915
400
  message = 'Too few subscribers';
916
401
  }
917
-
918
402
  _this = _Error.call(this, message) || this;
919
403
  _this.name = 'TooFewSubscribersError';
920
404
  return _this;
921
405
  }
922
-
406
+ _inheritsLoose(TooFewSubscribersError, _Error);
923
407
  return TooFewSubscribersError;
924
408
  }( /*#__PURE__*/_wrapNativeSuper(Error));
925
409
  var TooManySubscribersError = /*#__PURE__*/function (_Error2) {
926
- _inheritsLoose(TooManySubscribersError, _Error2);
927
-
928
410
  function TooManySubscribersError(message) {
929
411
  var _this2;
930
-
931
412
  if (message === void 0) {
932
413
  message = 'Too many subscribers';
933
414
  }
934
-
935
415
  _this2 = _Error2.call(this, message) || this;
936
416
  _this2.name = 'TooManySubscribersError';
937
417
  return _this2;
938
418
  }
939
-
419
+ _inheritsLoose(TooManySubscribersError, _Error2);
940
420
  return TooManySubscribersError;
941
421
  }( /*#__PURE__*/_wrapNativeSuper(Error));
942
422
  var TooFewEventsError = /*#__PURE__*/function (_Error3) {
943
- _inheritsLoose(TooFewEventsError, _Error3);
944
-
945
423
  function TooFewEventsError(message) {
946
424
  var _this3;
947
-
948
425
  if (message === void 0) {
949
426
  message = 'Too few events';
950
427
  }
951
-
952
428
  _this3 = _Error3.call(this, message) || this;
953
429
  _this3.name = 'TooFewEventsError';
954
430
  return _this3;
955
431
  }
956
-
432
+ _inheritsLoose(TooFewEventsError, _Error3);
957
433
  return TooFewEventsError;
958
434
  }( /*#__PURE__*/_wrapNativeSuper(Error));
959
435
  var TooManyEventsError = /*#__PURE__*/function (_Error4) {
960
- _inheritsLoose(TooManyEventsError, _Error4);
961
-
962
436
  function TooManyEventsError(message) {
963
437
  var _this4;
964
-
965
438
  if (message === void 0) {
966
439
  message = 'Too many events';
967
440
  }
968
-
969
441
  _this4 = _Error4.call(this, message) || this;
970
442
  _this4.name = 'TooManyEventsError';
971
443
  return _this4;
972
444
  }
973
-
445
+ _inheritsLoose(TooManyEventsError, _Error4);
974
446
  return TooManyEventsError;
975
447
  }( /*#__PURE__*/_wrapNativeSuper(Error));
976
448
  var TooFewEmailsError = /*#__PURE__*/function (_Error5) {
977
- _inheritsLoose(TooFewEmailsError, _Error5);
978
-
979
449
  function TooFewEmailsError(message) {
980
450
  var _this5;
981
-
982
451
  if (message === void 0) {
983
452
  message = 'Too few emails';
984
453
  }
985
-
986
454
  _this5 = _Error5.call(this, message) || this;
987
455
  _this5.name = 'TooFewEmailsError';
988
456
  return _this5;
989
457
  }
990
-
458
+ _inheritsLoose(TooFewEmailsError, _Error5);
991
459
  return TooFewEmailsError;
992
460
  }( /*#__PURE__*/_wrapNativeSuper(Error));
993
461
  var TooManyEmailsError = /*#__PURE__*/function (_Error6) {
994
- _inheritsLoose(TooManyEmailsError, _Error6);
995
-
996
462
  function TooManyEmailsError(message) {
997
463
  var _this6;
998
-
999
464
  if (message === void 0) {
1000
465
  message = 'Too many emails';
1001
466
  }
1002
-
1003
467
  _this6 = _Error6.call(this, message) || this;
1004
468
  _this6.name = 'TooManyEmailsError';
1005
469
  return _this6;
1006
470
  }
1007
-
471
+ _inheritsLoose(TooManyEmailsError, _Error6);
1008
472
  return TooManyEmailsError;
1009
473
  }( /*#__PURE__*/_wrapNativeSuper(Error));
1010
474
 
@@ -1034,56 +498,43 @@ var BentoBatch = /*#__PURE__*/function () {
1034
498
  * @param parameters
1035
499
  * @returns Promise\<number\>
1036
500
  */
1037
-
1038
-
1039
501
  var _proto = BentoBatch.prototype;
1040
-
1041
502
  _proto.importSubscribers =
1042
503
  /*#__PURE__*/
1043
504
  function () {
1044
- var _importSubscribers = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(parameters) {
505
+ var _importSubscribers = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(parameters) {
1045
506
  var result;
1046
- return runtime_1.wrap(function _callee$(_context) {
1047
- while (1) {
1048
- switch (_context.prev = _context.next) {
1049
- case 0:
1050
- if (!(parameters.subscribers.length === 0)) {
1051
- _context.next = 2;
1052
- break;
1053
- }
1054
-
1055
- throw new TooFewSubscribersError("You must send between 1 and 1,000 subscribers.");
1056
-
1057
- case 2:
1058
- if (!(parameters.subscribers.length > this._maxBatchSize)) {
1059
- _context.next = 4;
1060
- break;
1061
- }
1062
-
1063
- throw new TooManySubscribersError("You must send between 1 and 1,000 subscribers.");
1064
-
1065
- case 4:
1066
- _context.next = 6;
1067
- return this._client.post(this._url + "/subscribers", {
1068
- subscribers: parameters.subscribers
1069
- });
1070
-
1071
- case 6:
1072
- result = _context.sent;
1073
- return _context.abrupt("return", result.results);
1074
-
1075
- case 8:
1076
- case "end":
1077
- return _context.stop();
1078
- }
507
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
508
+ while (1) switch (_context.prev = _context.next) {
509
+ case 0:
510
+ if (!(parameters.subscribers.length === 0)) {
511
+ _context.next = 2;
512
+ break;
513
+ }
514
+ throw new TooFewSubscribersError("You must send between 1 and 1,000 subscribers.");
515
+ case 2:
516
+ if (!(parameters.subscribers.length > this._maxBatchSize)) {
517
+ _context.next = 4;
518
+ break;
519
+ }
520
+ throw new TooManySubscribersError("You must send between 1 and 1,000 subscribers.");
521
+ case 4:
522
+ _context.next = 6;
523
+ return this._client.post(this._url + "/subscribers", {
524
+ subscribers: parameters.subscribers
525
+ });
526
+ case 6:
527
+ result = _context.sent;
528
+ return _context.abrupt("return", result.results);
529
+ case 8:
530
+ case "end":
531
+ return _context.stop();
1079
532
  }
1080
533
  }, _callee, this);
1081
534
  }));
1082
-
1083
535
  function importSubscribers(_x) {
1084
536
  return _importSubscribers.apply(this, arguments);
1085
537
  }
1086
-
1087
538
  return importSubscribers;
1088
539
  }()
1089
540
  /**
@@ -1098,53 +549,42 @@ var BentoBatch = /*#__PURE__*/function () {
1098
549
  * @returns Promise\<number\>
1099
550
  */
1100
551
  ;
1101
-
1102
552
  _proto.importEvents =
1103
553
  /*#__PURE__*/
1104
554
  function () {
1105
- var _importEvents = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2(parameters) {
555
+ var _importEvents = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(parameters) {
1106
556
  var result;
1107
- return runtime_1.wrap(function _callee2$(_context2) {
1108
- while (1) {
1109
- switch (_context2.prev = _context2.next) {
1110
- case 0:
1111
- if (!(parameters.events.length === 0)) {
1112
- _context2.next = 2;
1113
- break;
1114
- }
1115
-
1116
- throw new TooFewEventsError("You must send between 1 and 1,000 events.");
1117
-
1118
- case 2:
1119
- if (!(parameters.events.length > this._maxBatchSize)) {
1120
- _context2.next = 4;
1121
- break;
1122
- }
1123
-
1124
- throw new TooManyEventsError("You must send between 1 and 1,000 events.");
1125
-
1126
- case 4:
1127
- _context2.next = 6;
1128
- return this._client.post(this._url + "/events", {
1129
- events: parameters.events
1130
- });
1131
-
1132
- case 6:
1133
- result = _context2.sent;
1134
- return _context2.abrupt("return", result.results);
1135
-
1136
- case 8:
1137
- case "end":
1138
- return _context2.stop();
1139
- }
557
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
558
+ while (1) switch (_context2.prev = _context2.next) {
559
+ case 0:
560
+ if (!(parameters.events.length === 0)) {
561
+ _context2.next = 2;
562
+ break;
563
+ }
564
+ throw new TooFewEventsError("You must send between 1 and 1,000 events.");
565
+ case 2:
566
+ if (!(parameters.events.length > this._maxBatchSize)) {
567
+ _context2.next = 4;
568
+ break;
569
+ }
570
+ throw new TooManyEventsError("You must send between 1 and 1,000 events.");
571
+ case 4:
572
+ _context2.next = 6;
573
+ return this._client.post(this._url + "/events", {
574
+ events: parameters.events
575
+ });
576
+ case 6:
577
+ result = _context2.sent;
578
+ return _context2.abrupt("return", result.results);
579
+ case 8:
580
+ case "end":
581
+ return _context2.stop();
1140
582
  }
1141
583
  }, _callee2, this);
1142
584
  }));
1143
-
1144
585
  function importEvents(_x2) {
1145
586
  return _importEvents.apply(this, arguments);
1146
587
  }
1147
-
1148
588
  return importEvents;
1149
589
  }()
1150
590
  /**
@@ -1162,98 +602,77 @@ var BentoBatch = /*#__PURE__*/function () {
1162
602
  * @returns Promise\<number\>
1163
603
  */
1164
604
  ;
1165
-
1166
605
  _proto.sendTransactionalEmails =
1167
606
  /*#__PURE__*/
1168
607
  function () {
1169
- var _sendTransactionalEmails = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee3(parameters) {
608
+ var _sendTransactionalEmails = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(parameters) {
1170
609
  var result;
1171
- return runtime_1.wrap(function _callee3$(_context3) {
1172
- while (1) {
1173
- switch (_context3.prev = _context3.next) {
1174
- case 0:
1175
- if (!(parameters.emails.length === 0)) {
1176
- _context3.next = 2;
1177
- break;
1178
- }
1179
-
1180
- throw new TooFewEmailsError("You must send between 1 and 100 emails.");
1181
-
1182
- case 2:
1183
- if (!(parameters.emails.length > this._maxEmailBatchSize)) {
1184
- _context3.next = 4;
1185
- break;
1186
- }
1187
-
1188
- throw new TooManyEmailsError("You must send between 1 and 100 emails.");
1189
-
1190
- case 4:
1191
- _context3.next = 6;
1192
- return this._client.post(this._url + "/emails", {
1193
- emails: parameters.emails
1194
- });
1195
-
1196
- case 6:
1197
- result = _context3.sent;
1198
- return _context3.abrupt("return", result.results);
1199
-
1200
- case 8:
1201
- case "end":
1202
- return _context3.stop();
1203
- }
610
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
611
+ while (1) switch (_context3.prev = _context3.next) {
612
+ case 0:
613
+ if (!(parameters.emails.length === 0)) {
614
+ _context3.next = 2;
615
+ break;
616
+ }
617
+ throw new TooFewEmailsError("You must send between 1 and 100 emails.");
618
+ case 2:
619
+ if (!(parameters.emails.length > this._maxEmailBatchSize)) {
620
+ _context3.next = 4;
621
+ break;
622
+ }
623
+ throw new TooManyEmailsError("You must send between 1 and 100 emails.");
624
+ case 4:
625
+ _context3.next = 6;
626
+ return this._client.post(this._url + "/emails", {
627
+ emails: parameters.emails
628
+ });
629
+ case 6:
630
+ result = _context3.sent;
631
+ return _context3.abrupt("return", result.results);
632
+ case 8:
633
+ case "end":
634
+ return _context3.stop();
1204
635
  }
1205
636
  }, _callee3, this);
1206
637
  }));
1207
-
1208
638
  function sendTransactionalEmails(_x3) {
1209
639
  return _sendTransactionalEmails.apply(this, arguments);
1210
640
  }
1211
-
1212
641
  return sendTransactionalEmails;
1213
642
  }();
1214
-
1215
643
  return BentoBatch;
1216
644
  }();
1217
645
 
1218
646
  var NotAuthorizedError = /*#__PURE__*/function (_Error) {
1219
- _inheritsLoose(NotAuthorizedError, _Error);
1220
-
1221
647
  function NotAuthorizedError(message) {
1222
648
  var _this;
1223
-
1224
649
  if (message === void 0) {
1225
650
  message = 'Not authorized';
1226
651
  }
1227
-
1228
652
  _this = _Error.call(this, message) || this;
1229
653
  _this.name = 'NotAuthorizedError';
1230
654
  return _this;
1231
655
  }
1232
-
656
+ _inheritsLoose(NotAuthorizedError, _Error);
1233
657
  return NotAuthorizedError;
1234
658
  }( /*#__PURE__*/_wrapNativeSuper(Error));
1235
659
  var RateLimitedError = /*#__PURE__*/function (_Error2) {
1236
- _inheritsLoose(RateLimitedError, _Error2);
1237
-
1238
660
  function RateLimitedError(message) {
1239
661
  var _this2;
1240
-
1241
662
  if (message === void 0) {
1242
663
  message = 'You are being rate limited';
1243
664
  }
1244
-
1245
665
  _this2 = _Error2.call(this, message) || this;
1246
666
  _this2.name = 'RateLimitedError';
1247
667
  return _this2;
1248
668
  }
1249
-
669
+ _inheritsLoose(RateLimitedError, _Error2);
1250
670
  return RateLimitedError;
1251
671
  }( /*#__PURE__*/_wrapNativeSuper(Error));
1252
672
 
1253
673
  var BentoClient = /*#__PURE__*/function () {
1254
674
  function BentoClient(options) {
1255
675
  var _options$clientOption;
1256
-
1257
676
  this._headers = {};
1258
677
  this._baseUrl = 'https://app.bentonow.com/api/v1';
1259
678
  this._siteUuid = '';
@@ -1271,51 +690,38 @@ var BentoClient = /*#__PURE__*/function () {
1271
690
  * @param payload object
1272
691
  * @returns Promise\<T\>
1273
692
  * */
1274
-
1275
-
1276
693
  var _proto = BentoClient.prototype;
1277
-
1278
694
  _proto.get = function get(endpoint, payload) {
1279
695
  var _this = this;
1280
-
1281
696
  if (payload === void 0) {
1282
697
  payload = {};
1283
698
  }
1284
-
1285
699
  return new Promise(function (resolve, reject) {
1286
700
  var queryParameters = _this._getQueryParameters(payload);
1287
-
1288
701
  fetch("" + _this._baseUrl + endpoint + "?" + queryParameters, {
1289
702
  method: 'GET',
1290
703
  headers: _this._headers
1291
704
  }).then( /*#__PURE__*/function () {
1292
- var _ref = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(result) {
1293
- return runtime_1.wrap(function _callee$(_context) {
1294
- while (1) {
1295
- switch (_context.prev = _context.next) {
1296
- case 0:
1297
- if (!_this._isSuccessfulStatus(result.status)) {
1298
- _context.next = 2;
1299
- break;
1300
- }
1301
-
1302
- return _context.abrupt("return", result.json());
1303
-
1304
- case 2:
1305
- _context.next = 4;
1306
- return _this._getErrorForResponse(result);
1307
-
1308
- case 4:
1309
- throw _context.sent;
1310
-
1311
- case 5:
1312
- case "end":
1313
- return _context.stop();
1314
- }
705
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(result) {
706
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
707
+ while (1) switch (_context.prev = _context.next) {
708
+ case 0:
709
+ if (!_this._isSuccessfulStatus(result.status)) {
710
+ _context.next = 2;
711
+ break;
712
+ }
713
+ return _context.abrupt("return", result.json());
714
+ case 2:
715
+ _context.next = 4;
716
+ return _this._getErrorForResponse(result);
717
+ case 4:
718
+ throw _context.sent;
719
+ case 5:
720
+ case "end":
721
+ return _context.stop();
1315
722
  }
1316
723
  }, _callee);
1317
724
  }));
1318
-
1319
725
  return function (_x) {
1320
726
  return _ref.apply(this, arguments);
1321
727
  };
@@ -1333,19 +739,14 @@ var BentoClient = /*#__PURE__*/function () {
1333
739
  * @param endpoint string
1334
740
  * @param payload object
1335
741
  * @returns Promise\<T\>
1336
- * */
1337
- ;
1338
-
742
+ * */;
1339
743
  _proto.post = function post(endpoint, payload) {
1340
744
  var _this2 = this;
1341
-
1342
745
  if (payload === void 0) {
1343
746
  payload = {};
1344
747
  }
1345
-
1346
748
  return new Promise(function (resolve, reject) {
1347
749
  var body = _this2._getBody(payload);
1348
-
1349
750
  fetch("" + _this2._baseUrl + endpoint, {
1350
751
  method: 'POST',
1351
752
  headers: _extends({}, _this2._headers, {
@@ -1353,33 +754,26 @@ var BentoClient = /*#__PURE__*/function () {
1353
754
  }),
1354
755
  body: body
1355
756
  }).then( /*#__PURE__*/function () {
1356
- var _ref2 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2(result) {
1357
- return runtime_1.wrap(function _callee2$(_context2) {
1358
- while (1) {
1359
- switch (_context2.prev = _context2.next) {
1360
- case 0:
1361
- if (!_this2._isSuccessfulStatus(result.status)) {
1362
- _context2.next = 2;
1363
- break;
1364
- }
1365
-
1366
- return _context2.abrupt("return", result.json());
1367
-
1368
- case 2:
1369
- _context2.next = 4;
1370
- return _this2._getErrorForResponse(result);
1371
-
1372
- case 4:
1373
- throw _context2.sent;
1374
-
1375
- case 5:
1376
- case "end":
1377
- return _context2.stop();
1378
- }
757
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(result) {
758
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
759
+ while (1) switch (_context2.prev = _context2.next) {
760
+ case 0:
761
+ if (!_this2._isSuccessfulStatus(result.status)) {
762
+ _context2.next = 2;
763
+ break;
764
+ }
765
+ return _context2.abrupt("return", result.json());
766
+ case 2:
767
+ _context2.next = 4;
768
+ return _this2._getErrorForResponse(result);
769
+ case 4:
770
+ throw _context2.sent;
771
+ case 5:
772
+ case "end":
773
+ return _context2.stop();
1379
774
  }
1380
775
  }, _callee2);
1381
776
  }));
1382
-
1383
777
  return function (_x2) {
1384
778
  return _ref2.apply(this, arguments);
1385
779
  };
@@ -1396,9 +790,7 @@ var BentoClient = /*#__PURE__*/function () {
1396
790
  *
1397
791
  * @param authentication AuthenticationOptions
1398
792
  * @returns HeadersInit
1399
- */
1400
- ;
1401
-
793
+ */;
1402
794
  _proto._extractHeaders = function _extractHeaders(authentication) {
1403
795
  var authenticationKey = Buffer.from(authentication.publishableKey + ":" + authentication.secretKey).toString('base64');
1404
796
  return {
@@ -1411,9 +803,7 @@ var BentoClient = /*#__PURE__*/function () {
1411
803
  *
1412
804
  * @param payload object
1413
805
  * @returns string
1414
- */
1415
- ;
1416
-
806
+ */;
1417
807
  _proto._getBody = function _getBody(payload) {
1418
808
  return JSON.stringify(_extends({}, payload, {
1419
809
  site_uuid: this._siteUuid
@@ -1425,23 +815,18 @@ var BentoClient = /*#__PURE__*/function () {
1425
815
  *
1426
816
  * @param payload object
1427
817
  * @returns string
1428
- */
1429
- ;
1430
-
818
+ */;
1431
819
  _proto._getQueryParameters = function _getQueryParameters(payload) {
1432
820
  var body = _extends({}, payload, {
1433
821
  site_uuid: this._siteUuid
1434
822
  });
1435
-
1436
823
  var queryParameters = new URLSearchParams();
1437
-
1438
824
  for (var _i = 0, _Object$entries = Object.entries(body); _i < _Object$entries.length; _i++) {
1439
825
  var _Object$entries$_i = _Object$entries[_i],
1440
- key = _Object$entries$_i[0],
1441
- value = _Object$entries$_i[1];
826
+ key = _Object$entries$_i[0],
827
+ value = _Object$entries$_i[1];
1442
828
  queryParameters.append(key, value);
1443
829
  }
1444
-
1445
830
  return queryParameters.toString();
1446
831
  }
1447
832
  /**
@@ -1449,9 +834,7 @@ var BentoClient = /*#__PURE__*/function () {
1449
834
  *
1450
835
  * @param statusCode number
1451
836
  * @returns boolean
1452
- */
1453
- ;
1454
-
837
+ */;
1455
838
  _proto._isSuccessfulStatus = function _isSuccessfulStatus(statusCode) {
1456
839
  var validStatusCodes = [200, 201];
1457
840
  return validStatusCodes.includes(statusCode);
@@ -1461,84 +844,65 @@ var BentoClient = /*#__PURE__*/function () {
1461
844
  *
1462
845
  * @param response Response
1463
846
  * @returns Error
1464
- */
1465
- ;
1466
-
847
+ */;
1467
848
  _proto._getErrorForResponse =
1468
849
  /*#__PURE__*/
1469
850
  function () {
1470
- var _getErrorForResponse2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee3(response) {
851
+ var _getErrorForResponse2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(response) {
1471
852
  var contentType, responseMessage;
1472
- return runtime_1.wrap(function _callee3$(_context3) {
1473
- while (1) {
1474
- switch (_context3.prev = _context3.next) {
1475
- case 0:
1476
- if (this._logErrors) {
1477
- console.error(response);
1478
- }
1479
-
1480
- if (!(response.status === 401)) {
1481
- _context3.next = 3;
1482
- break;
1483
- }
1484
-
1485
- return _context3.abrupt("return", new NotAuthorizedError());
1486
-
1487
- case 3:
1488
- if (!(response.status === 429)) {
1489
- _context3.next = 5;
1490
- break;
1491
- }
1492
-
1493
- return _context3.abrupt("return", new RateLimitedError());
1494
-
1495
- case 5:
1496
- contentType = response.headers.get('Content-Type');
1497
- responseMessage = '';
1498
- _context3.t0 = contentType == null ? void 0 : contentType.toLocaleLowerCase();
1499
- _context3.next = _context3.t0 === 'text/plain' ? 10 : _context3.t0 === 'application/json' ? 14 : 20;
853
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
854
+ while (1) switch (_context3.prev = _context3.next) {
855
+ case 0:
856
+ if (this._logErrors) {
857
+ console.error(response);
858
+ }
859
+ if (!(response.status === 401)) {
860
+ _context3.next = 3;
1500
861
  break;
1501
-
1502
- case 10:
1503
- _context3.next = 12;
1504
- return response.text();
1505
-
1506
- case 12:
1507
- responseMessage = _context3.sent;
1508
- return _context3.abrupt("break", 22);
1509
-
1510
- case 14:
1511
- _context3.t1 = JSON;
1512
- _context3.next = 17;
1513
- return response.json();
1514
-
1515
- case 17:
1516
- _context3.t2 = _context3.sent;
1517
- responseMessage = _context3.t1.stringify.call(_context3.t1, _context3.t2);
1518
- return _context3.abrupt("break", 22);
1519
-
1520
- case 20:
1521
- responseMessage = 'Unknown response from the Bento API.';
1522
- return _context3.abrupt("break", 22);
1523
-
1524
- case 22:
1525
- return _context3.abrupt("return", new Error("[" + response.status + "] - " + responseMessage));
1526
-
1527
- case 23:
1528
- case "end":
1529
- return _context3.stop();
1530
- }
862
+ }
863
+ return _context3.abrupt("return", new NotAuthorizedError());
864
+ case 3:
865
+ if (!(response.status === 429)) {
866
+ _context3.next = 5;
867
+ break;
868
+ }
869
+ return _context3.abrupt("return", new RateLimitedError());
870
+ case 5:
871
+ contentType = response.headers.get('Content-Type');
872
+ responseMessage = '';
873
+ _context3.t0 = contentType == null ? void 0 : contentType.toLocaleLowerCase();
874
+ _context3.next = _context3.t0 === 'text/plain' ? 10 : _context3.t0 === 'application/json' ? 14 : 20;
875
+ break;
876
+ case 10:
877
+ _context3.next = 12;
878
+ return response.text();
879
+ case 12:
880
+ responseMessage = _context3.sent;
881
+ return _context3.abrupt("break", 22);
882
+ case 14:
883
+ _context3.t1 = JSON;
884
+ _context3.next = 17;
885
+ return response.json();
886
+ case 17:
887
+ _context3.t2 = _context3.sent;
888
+ responseMessage = _context3.t1.stringify.call(_context3.t1, _context3.t2);
889
+ return _context3.abrupt("break", 22);
890
+ case 20:
891
+ responseMessage = 'Unknown response from the Bento API.';
892
+ return _context3.abrupt("break", 22);
893
+ case 22:
894
+ return _context3.abrupt("return", new Error("[" + response.status + "] - " + responseMessage));
895
+ case 23:
896
+ case "end":
897
+ return _context3.stop();
1531
898
  }
1532
899
  }, _callee3, this);
1533
900
  }));
1534
-
1535
901
  function _getErrorForResponse(_x3) {
1536
902
  return _getErrorForResponse2.apply(this, arguments);
1537
903
  }
1538
-
1539
904
  return _getErrorForResponse;
1540
905
  }();
1541
-
1542
906
  return BentoClient;
1543
907
  }();
1544
908
 
@@ -1546,7 +910,6 @@ var BentoClient = /*#__PURE__*/function () {
1546
910
  * Command Enums
1547
911
  */
1548
912
  var CommandTypes;
1549
-
1550
913
  (function (CommandTypes) {
1551
914
  CommandTypes["ADD_FIELD"] = "add_field";
1552
915
  CommandTypes["ADD_TAG"] = "add_tag";
@@ -1576,53 +939,41 @@ var BentoCommands = /*#__PURE__*/function () {
1576
939
  * @param parameters \{ email: string, tagName: string \}
1577
940
  * @returns Promise\<Subscriber | null\>
1578
941
  */
1579
-
1580
-
1581
942
  var _proto = BentoCommands.prototype;
1582
-
1583
943
  _proto.addTag =
1584
944
  /*#__PURE__*/
1585
945
  function () {
1586
- var _addTag = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(parameters) {
946
+ var _addTag = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(parameters) {
1587
947
  var result;
1588
- return runtime_1.wrap(function _callee$(_context) {
1589
- while (1) {
1590
- switch (_context.prev = _context.next) {
1591
- case 0:
1592
- _context.next = 2;
1593
- return this._client.post(this._url, {
1594
- command: {
1595
- command: CommandTypes.ADD_TAG,
1596
- email: parameters.email,
1597
- query: parameters.tagName
1598
- }
1599
- });
1600
-
1601
- case 2:
1602
- result = _context.sent;
1603
-
1604
- if (!(Object.keys(result).length === 0 || !result.data)) {
1605
- _context.next = 5;
1606
- break;
948
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
949
+ while (1) switch (_context.prev = _context.next) {
950
+ case 0:
951
+ _context.next = 2;
952
+ return this._client.post(this._url, {
953
+ command: {
954
+ command: CommandTypes.ADD_TAG,
955
+ email: parameters.email,
956
+ query: parameters.tagName
1607
957
  }
1608
-
1609
- return _context.abrupt("return", null);
1610
-
1611
- case 5:
1612
- return _context.abrupt("return", result.data);
1613
-
1614
- case 6:
1615
- case "end":
1616
- return _context.stop();
1617
- }
958
+ });
959
+ case 2:
960
+ result = _context.sent;
961
+ if (!(Object.keys(result).length === 0 || !result.data)) {
962
+ _context.next = 5;
963
+ break;
964
+ }
965
+ return _context.abrupt("return", null);
966
+ case 5:
967
+ return _context.abrupt("return", result.data);
968
+ case 6:
969
+ case "end":
970
+ return _context.stop();
1618
971
  }
1619
972
  }, _callee, this);
1620
973
  }));
1621
-
1622
974
  function addTag(_x) {
1623
975
  return _addTag.apply(this, arguments);
1624
976
  }
1625
-
1626
977
  return addTag;
1627
978
  }()
1628
979
  /**
@@ -1632,50 +983,40 @@ var BentoCommands = /*#__PURE__*/function () {
1632
983
  * @returns Promise\<Subscriber | null\>
1633
984
  */
1634
985
  ;
1635
-
1636
986
  _proto.removeTag =
1637
987
  /*#__PURE__*/
1638
988
  function () {
1639
- var _removeTag = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2(parameters) {
989
+ var _removeTag = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(parameters) {
1640
990
  var result;
1641
- return runtime_1.wrap(function _callee2$(_context2) {
1642
- while (1) {
1643
- switch (_context2.prev = _context2.next) {
1644
- case 0:
1645
- _context2.next = 2;
1646
- return this._client.post(this._url, {
1647
- command: {
1648
- command: CommandTypes.REMOVE_TAG,
1649
- email: parameters.email,
1650
- query: parameters.tagName
1651
- }
1652
- });
1653
-
1654
- case 2:
1655
- result = _context2.sent;
1656
-
1657
- if (!(Object.keys(result).length === 0 || !result.data)) {
1658
- _context2.next = 5;
1659
- break;
991
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
992
+ while (1) switch (_context2.prev = _context2.next) {
993
+ case 0:
994
+ _context2.next = 2;
995
+ return this._client.post(this._url, {
996
+ command: {
997
+ command: CommandTypes.REMOVE_TAG,
998
+ email: parameters.email,
999
+ query: parameters.tagName
1660
1000
  }
1661
-
1662
- return _context2.abrupt("return", null);
1663
-
1664
- case 5:
1665
- return _context2.abrupt("return", result.data);
1666
-
1667
- case 6:
1668
- case "end":
1669
- return _context2.stop();
1670
- }
1001
+ });
1002
+ case 2:
1003
+ result = _context2.sent;
1004
+ if (!(Object.keys(result).length === 0 || !result.data)) {
1005
+ _context2.next = 5;
1006
+ break;
1007
+ }
1008
+ return _context2.abrupt("return", null);
1009
+ case 5:
1010
+ return _context2.abrupt("return", result.data);
1011
+ case 6:
1012
+ case "end":
1013
+ return _context2.stop();
1671
1014
  }
1672
1015
  }, _callee2, this);
1673
1016
  }));
1674
-
1675
1017
  function removeTag(_x2) {
1676
1018
  return _removeTag.apply(this, arguments);
1677
1019
  }
1678
-
1679
1020
  return removeTag;
1680
1021
  }()
1681
1022
  /**
@@ -1691,50 +1032,40 @@ var BentoCommands = /*#__PURE__*/function () {
1691
1032
  * @returns Promise\<Subscriber | null\>
1692
1033
  */
1693
1034
  ;
1694
-
1695
1035
  _proto.addField =
1696
1036
  /*#__PURE__*/
1697
1037
  function () {
1698
- var _addField = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee3(parameters) {
1038
+ var _addField = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(parameters) {
1699
1039
  var result;
1700
- return runtime_1.wrap(function _callee3$(_context3) {
1701
- while (1) {
1702
- switch (_context3.prev = _context3.next) {
1703
- case 0:
1704
- _context3.next = 2;
1705
- return this._client.post(this._url, {
1706
- command: {
1707
- command: CommandTypes.ADD_FIELD,
1708
- email: parameters.email,
1709
- query: parameters.field
1710
- }
1711
- });
1712
-
1713
- case 2:
1714
- result = _context3.sent;
1715
-
1716
- if (!(Object.keys(result).length === 0 || !result.data)) {
1717
- _context3.next = 5;
1718
- break;
1040
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
1041
+ while (1) switch (_context3.prev = _context3.next) {
1042
+ case 0:
1043
+ _context3.next = 2;
1044
+ return this._client.post(this._url, {
1045
+ command: {
1046
+ command: CommandTypes.ADD_FIELD,
1047
+ email: parameters.email,
1048
+ query: parameters.field
1719
1049
  }
1720
-
1721
- return _context3.abrupt("return", null);
1722
-
1723
- case 5:
1724
- return _context3.abrupt("return", result.data);
1725
-
1726
- case 6:
1727
- case "end":
1728
- return _context3.stop();
1729
- }
1050
+ });
1051
+ case 2:
1052
+ result = _context3.sent;
1053
+ if (!(Object.keys(result).length === 0 || !result.data)) {
1054
+ _context3.next = 5;
1055
+ break;
1056
+ }
1057
+ return _context3.abrupt("return", null);
1058
+ case 5:
1059
+ return _context3.abrupt("return", result.data);
1060
+ case 6:
1061
+ case "end":
1062
+ return _context3.stop();
1730
1063
  }
1731
1064
  }, _callee3, this);
1732
1065
  }));
1733
-
1734
1066
  function addField(_x3) {
1735
1067
  return _addField.apply(this, arguments);
1736
1068
  }
1737
-
1738
1069
  return addField;
1739
1070
  }()
1740
1071
  /**
@@ -1744,50 +1075,40 @@ var BentoCommands = /*#__PURE__*/function () {
1744
1075
  * @returns Promise\<Subscriber | null\>
1745
1076
  */
1746
1077
  ;
1747
-
1748
1078
  _proto.removeField =
1749
1079
  /*#__PURE__*/
1750
1080
  function () {
1751
- var _removeField = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee4(parameters) {
1081
+ var _removeField = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(parameters) {
1752
1082
  var result;
1753
- return runtime_1.wrap(function _callee4$(_context4) {
1754
- while (1) {
1755
- switch (_context4.prev = _context4.next) {
1756
- case 0:
1757
- _context4.next = 2;
1758
- return this._client.post(this._url, {
1759
- command: {
1760
- command: CommandTypes.REMOVE_FIELD,
1761
- email: parameters.email,
1762
- query: parameters.fieldName
1763
- }
1764
- });
1765
-
1766
- case 2:
1767
- result = _context4.sent;
1768
-
1769
- if (!(Object.keys(result).length === 0 || !result.data)) {
1770
- _context4.next = 5;
1771
- break;
1083
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
1084
+ while (1) switch (_context4.prev = _context4.next) {
1085
+ case 0:
1086
+ _context4.next = 2;
1087
+ return this._client.post(this._url, {
1088
+ command: {
1089
+ command: CommandTypes.REMOVE_FIELD,
1090
+ email: parameters.email,
1091
+ query: parameters.fieldName
1772
1092
  }
1773
-
1774
- return _context4.abrupt("return", null);
1775
-
1776
- case 5:
1777
- return _context4.abrupt("return", result.data);
1778
-
1779
- case 6:
1780
- case "end":
1781
- return _context4.stop();
1782
- }
1093
+ });
1094
+ case 2:
1095
+ result = _context4.sent;
1096
+ if (!(Object.keys(result).length === 0 || !result.data)) {
1097
+ _context4.next = 5;
1098
+ break;
1099
+ }
1100
+ return _context4.abrupt("return", null);
1101
+ case 5:
1102
+ return _context4.abrupt("return", result.data);
1103
+ case 6:
1104
+ case "end":
1105
+ return _context4.stop();
1783
1106
  }
1784
1107
  }, _callee4, this);
1785
1108
  }));
1786
-
1787
1109
  function removeField(_x4) {
1788
1110
  return _removeField.apply(this, arguments);
1789
1111
  }
1790
-
1791
1112
  return removeField;
1792
1113
  }()
1793
1114
  /**
@@ -1801,49 +1122,39 @@ var BentoCommands = /*#__PURE__*/function () {
1801
1122
  * @returns Promise\<Subscriber | null\>
1802
1123
  */
1803
1124
  ;
1804
-
1805
1125
  _proto.subscribe =
1806
1126
  /*#__PURE__*/
1807
1127
  function () {
1808
- var _subscribe = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee5(parameters) {
1128
+ var _subscribe = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(parameters) {
1809
1129
  var result;
1810
- return runtime_1.wrap(function _callee5$(_context5) {
1811
- while (1) {
1812
- switch (_context5.prev = _context5.next) {
1813
- case 0:
1814
- _context5.next = 2;
1815
- return this._client.post(this._url, {
1816
- command: {
1817
- command: CommandTypes.SUBSCRIBE,
1818
- email: parameters.email
1819
- }
1820
- });
1821
-
1822
- case 2:
1823
- result = _context5.sent;
1824
-
1825
- if (!(Object.keys(result).length === 0 || !result.data)) {
1826
- _context5.next = 5;
1827
- break;
1130
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
1131
+ while (1) switch (_context5.prev = _context5.next) {
1132
+ case 0:
1133
+ _context5.next = 2;
1134
+ return this._client.post(this._url, {
1135
+ command: {
1136
+ command: CommandTypes.SUBSCRIBE,
1137
+ email: parameters.email
1828
1138
  }
1829
-
1830
- return _context5.abrupt("return", null);
1831
-
1832
- case 5:
1833
- return _context5.abrupt("return", result.data);
1834
-
1835
- case 6:
1836
- case "end":
1837
- return _context5.stop();
1838
- }
1139
+ });
1140
+ case 2:
1141
+ result = _context5.sent;
1142
+ if (!(Object.keys(result).length === 0 || !result.data)) {
1143
+ _context5.next = 5;
1144
+ break;
1145
+ }
1146
+ return _context5.abrupt("return", null);
1147
+ case 5:
1148
+ return _context5.abrupt("return", result.data);
1149
+ case 6:
1150
+ case "end":
1151
+ return _context5.stop();
1839
1152
  }
1840
1153
  }, _callee5, this);
1841
1154
  }));
1842
-
1843
1155
  function subscribe(_x5) {
1844
1156
  return _subscribe.apply(this, arguments);
1845
1157
  }
1846
-
1847
1158
  return subscribe;
1848
1159
  }()
1849
1160
  /**
@@ -1858,49 +1169,39 @@ var BentoCommands = /*#__PURE__*/function () {
1858
1169
  * @returns Promise\<Subscriber | null\>
1859
1170
  */
1860
1171
  ;
1861
-
1862
1172
  _proto.unsubscribe =
1863
1173
  /*#__PURE__*/
1864
1174
  function () {
1865
- var _unsubscribe = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee6(parameters) {
1175
+ var _unsubscribe = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(parameters) {
1866
1176
  var result;
1867
- return runtime_1.wrap(function _callee6$(_context6) {
1868
- while (1) {
1869
- switch (_context6.prev = _context6.next) {
1870
- case 0:
1871
- _context6.next = 2;
1872
- return this._client.post(this._url, {
1873
- command: {
1874
- command: CommandTypes.UNSUBSCRIBE,
1875
- email: parameters.email
1876
- }
1877
- });
1878
-
1879
- case 2:
1880
- result = _context6.sent;
1881
-
1882
- if (!(Object.keys(result).length === 0 || !result.data)) {
1883
- _context6.next = 5;
1884
- break;
1177
+ return _regeneratorRuntime().wrap(function _callee6$(_context6) {
1178
+ while (1) switch (_context6.prev = _context6.next) {
1179
+ case 0:
1180
+ _context6.next = 2;
1181
+ return this._client.post(this._url, {
1182
+ command: {
1183
+ command: CommandTypes.UNSUBSCRIBE,
1184
+ email: parameters.email
1885
1185
  }
1886
-
1887
- return _context6.abrupt("return", null);
1888
-
1889
- case 5:
1890
- return _context6.abrupt("return", result.data);
1891
-
1892
- case 6:
1893
- case "end":
1894
- return _context6.stop();
1895
- }
1186
+ });
1187
+ case 2:
1188
+ result = _context6.sent;
1189
+ if (!(Object.keys(result).length === 0 || !result.data)) {
1190
+ _context6.next = 5;
1191
+ break;
1192
+ }
1193
+ return _context6.abrupt("return", null);
1194
+ case 5:
1195
+ return _context6.abrupt("return", result.data);
1196
+ case 6:
1197
+ case "end":
1198
+ return _context6.stop();
1896
1199
  }
1897
1200
  }, _callee6, this);
1898
1201
  }));
1899
-
1900
1202
  function unsubscribe(_x6) {
1901
1203
  return _unsubscribe.apply(this, arguments);
1902
1204
  }
1903
-
1904
1205
  return unsubscribe;
1905
1206
  }()
1906
1207
  /**
@@ -1910,53 +1211,42 @@ var BentoCommands = /*#__PURE__*/function () {
1910
1211
  * @returns Promise\<Subscriber | null\>
1911
1212
  */
1912
1213
  ;
1913
-
1914
1214
  _proto.changeEmail =
1915
1215
  /*#__PURE__*/
1916
1216
  function () {
1917
- var _changeEmail = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee7(parameters) {
1217
+ var _changeEmail = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(parameters) {
1918
1218
  var result;
1919
- return runtime_1.wrap(function _callee7$(_context7) {
1920
- while (1) {
1921
- switch (_context7.prev = _context7.next) {
1922
- case 0:
1923
- _context7.next = 2;
1924
- return this._client.post(this._url, {
1925
- command: {
1926
- command: CommandTypes.CHANGE_EMAIL,
1927
- email: parameters.oldEmail,
1928
- query: parameters.newEmail
1929
- }
1930
- });
1931
-
1932
- case 2:
1933
- result = _context7.sent;
1934
-
1935
- if (!(Object.keys(result).length === 0 || !result.data)) {
1936
- _context7.next = 5;
1937
- break;
1219
+ return _regeneratorRuntime().wrap(function _callee7$(_context7) {
1220
+ while (1) switch (_context7.prev = _context7.next) {
1221
+ case 0:
1222
+ _context7.next = 2;
1223
+ return this._client.post(this._url, {
1224
+ command: {
1225
+ command: CommandTypes.CHANGE_EMAIL,
1226
+ email: parameters.oldEmail,
1227
+ query: parameters.newEmail
1938
1228
  }
1939
-
1940
- return _context7.abrupt("return", null);
1941
-
1942
- case 5:
1943
- return _context7.abrupt("return", result.data);
1944
-
1945
- case 6:
1946
- case "end":
1947
- return _context7.stop();
1948
- }
1229
+ });
1230
+ case 2:
1231
+ result = _context7.sent;
1232
+ if (!(Object.keys(result).length === 0 || !result.data)) {
1233
+ _context7.next = 5;
1234
+ break;
1235
+ }
1236
+ return _context7.abrupt("return", null);
1237
+ case 5:
1238
+ return _context7.abrupt("return", result.data);
1239
+ case 6:
1240
+ case "end":
1241
+ return _context7.stop();
1949
1242
  }
1950
1243
  }, _callee7, this);
1951
1244
  }));
1952
-
1953
1245
  function changeEmail(_x7) {
1954
1246
  return _changeEmail.apply(this, arguments);
1955
1247
  }
1956
-
1957
1248
  return changeEmail;
1958
1249
  }();
1959
-
1960
1250
  return BentoCommands;
1961
1251
  }();
1962
1252
 
@@ -1979,43 +1269,34 @@ var BentoExperimental = /*#__PURE__*/function () {
1979
1269
  * @param parameters
1980
1270
  * @returns Promise\<boolean\>
1981
1271
  */
1982
-
1983
-
1984
1272
  var _proto = BentoExperimental.prototype;
1985
-
1986
1273
  _proto.validateEmail =
1987
1274
  /*#__PURE__*/
1988
1275
  function () {
1989
- var _validateEmail = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(parameters) {
1276
+ var _validateEmail = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(parameters) {
1990
1277
  var result;
1991
- return runtime_1.wrap(function _callee$(_context) {
1992
- while (1) {
1993
- switch (_context.prev = _context.next) {
1994
- case 0:
1995
- _context.next = 2;
1996
- return this._client.post(this._url + "/validation", {
1997
- email: parameters.email,
1998
- ip: parameters.ip,
1999
- name: parameters.name,
2000
- user_agent: parameters.userAgent
2001
- });
2002
-
2003
- case 2:
2004
- result = _context.sent;
2005
- return _context.abrupt("return", result.valid);
2006
-
2007
- case 4:
2008
- case "end":
2009
- return _context.stop();
2010
- }
1278
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
1279
+ while (1) switch (_context.prev = _context.next) {
1280
+ case 0:
1281
+ _context.next = 2;
1282
+ return this._client.post(this._url + "/validation", {
1283
+ email: parameters.email,
1284
+ ip: parameters.ip,
1285
+ name: parameters.name,
1286
+ user_agent: parameters.userAgent
1287
+ });
1288
+ case 2:
1289
+ result = _context.sent;
1290
+ return _context.abrupt("return", result.valid);
1291
+ case 4:
1292
+ case "end":
1293
+ return _context.stop();
2011
1294
  }
2012
1295
  }, _callee, this);
2013
1296
  }));
2014
-
2015
1297
  function validateEmail(_x) {
2016
1298
  return _validateEmail.apply(this, arguments);
2017
1299
  }
2018
-
2019
1300
  return validateEmail;
2020
1301
  }()
2021
1302
  /**
@@ -2032,35 +1313,28 @@ var BentoExperimental = /*#__PURE__*/function () {
2032
1313
  * @returns Promise\<GuessGenderResponse\>
2033
1314
  */
2034
1315
  ;
2035
-
2036
1316
  _proto.guessGender =
2037
1317
  /*#__PURE__*/
2038
1318
  function () {
2039
- var _guessGender = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2(parameters) {
1319
+ var _guessGender = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(parameters) {
2040
1320
  var result;
2041
- return runtime_1.wrap(function _callee2$(_context2) {
2042
- while (1) {
2043
- switch (_context2.prev = _context2.next) {
2044
- case 0:
2045
- _context2.next = 2;
2046
- return this._client.post(this._url + "/gender", parameters);
2047
-
2048
- case 2:
2049
- result = _context2.sent;
2050
- return _context2.abrupt("return", result);
2051
-
2052
- case 4:
2053
- case "end":
2054
- return _context2.stop();
2055
- }
1321
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
1322
+ while (1) switch (_context2.prev = _context2.next) {
1323
+ case 0:
1324
+ _context2.next = 2;
1325
+ return this._client.post(this._url + "/gender", parameters);
1326
+ case 2:
1327
+ result = _context2.sent;
1328
+ return _context2.abrupt("return", result);
1329
+ case 4:
1330
+ case "end":
1331
+ return _context2.stop();
2056
1332
  }
2057
1333
  }, _callee2, this);
2058
1334
  }));
2059
-
2060
1335
  function guessGender(_x2) {
2061
1336
  return _guessGender.apply(this, arguments);
2062
1337
  }
2063
-
2064
1338
  return guessGender;
2065
1339
  }()
2066
1340
  /**
@@ -2073,44 +1347,34 @@ var BentoExperimental = /*#__PURE__*/function () {
2073
1347
  * @returns Promise\<GeolocateResponse\>
2074
1348
  */
2075
1349
  ;
2076
-
2077
1350
  _proto.geolocate =
2078
1351
  /*#__PURE__*/
2079
1352
  function () {
2080
- var _geolocate = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee3(parameters) {
1353
+ var _geolocate = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(parameters) {
2081
1354
  var result;
2082
- return runtime_1.wrap(function _callee3$(_context3) {
2083
- while (1) {
2084
- switch (_context3.prev = _context3.next) {
2085
- case 0:
2086
- _context3.next = 2;
2087
- return this._client.get(this._url + "/geolocation", parameters);
2088
-
2089
- case 2:
2090
- result = _context3.sent;
2091
-
2092
- if (!(Object.keys(result).length === 0)) {
2093
- _context3.next = 5;
2094
- break;
2095
- }
2096
-
2097
- return _context3.abrupt("return", null);
2098
-
2099
- case 5:
2100
- return _context3.abrupt("return", result);
2101
-
2102
- case 6:
2103
- case "end":
2104
- return _context3.stop();
2105
- }
1355
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
1356
+ while (1) switch (_context3.prev = _context3.next) {
1357
+ case 0:
1358
+ _context3.next = 2;
1359
+ return this._client.get(this._url + "/geolocation", parameters);
1360
+ case 2:
1361
+ result = _context3.sent;
1362
+ if (!(Object.keys(result).length === 0)) {
1363
+ _context3.next = 5;
1364
+ break;
1365
+ }
1366
+ return _context3.abrupt("return", null);
1367
+ case 5:
1368
+ return _context3.abrupt("return", result);
1369
+ case 6:
1370
+ case "end":
1371
+ return _context3.stop();
2106
1372
  }
2107
1373
  }, _callee3, this);
2108
1374
  }));
2109
-
2110
1375
  function geolocate(_x3) {
2111
1376
  return _geolocate.apply(this, arguments);
2112
1377
  }
2113
-
2114
1378
  return geolocate;
2115
1379
  }()
2116
1380
  /**
@@ -2124,38 +1388,30 @@ var BentoExperimental = /*#__PURE__*/function () {
2124
1388
  * @returns Promise\<BlacklistResponse\>
2125
1389
  */
2126
1390
  ;
2127
-
2128
1391
  _proto.checkBlacklist =
2129
1392
  /*#__PURE__*/
2130
1393
  function () {
2131
- var _checkBlacklist = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee4(parameters) {
1394
+ var _checkBlacklist = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(parameters) {
2132
1395
  var result;
2133
- return runtime_1.wrap(function _callee4$(_context4) {
2134
- while (1) {
2135
- switch (_context4.prev = _context4.next) {
2136
- case 0:
2137
- _context4.next = 2;
2138
- return this._client.get(this._url + "/blacklist.json", parameters);
2139
-
2140
- case 2:
2141
- result = _context4.sent;
2142
- return _context4.abrupt("return", result);
2143
-
2144
- case 4:
2145
- case "end":
2146
- return _context4.stop();
2147
- }
1396
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
1397
+ while (1) switch (_context4.prev = _context4.next) {
1398
+ case 0:
1399
+ _context4.next = 2;
1400
+ return this._client.get(this._url + "/blacklist.json", parameters);
1401
+ case 2:
1402
+ result = _context4.sent;
1403
+ return _context4.abrupt("return", result);
1404
+ case 4:
1405
+ case "end":
1406
+ return _context4.stop();
2148
1407
  }
2149
1408
  }, _callee4, this);
2150
1409
  }));
2151
-
2152
1410
  function checkBlacklist(_x4) {
2153
1411
  return _checkBlacklist.apply(this, arguments);
2154
1412
  }
2155
-
2156
1413
  return checkBlacklist;
2157
1414
  }();
2158
-
2159
1415
  return BentoExperimental;
2160
1416
  }();
2161
1417
 
@@ -2170,47 +1426,35 @@ var BentoFields = /*#__PURE__*/function () {
2170
1426
  *
2171
1427
  * @returns Promise<Field[]>
2172
1428
  */
2173
-
2174
-
2175
1429
  var _proto = BentoFields.prototype;
2176
-
2177
1430
  _proto.getFields =
2178
1431
  /*#__PURE__*/
2179
1432
  function () {
2180
- var _getFields = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee() {
1433
+ var _getFields = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
2181
1434
  var result;
2182
- return runtime_1.wrap(function _callee$(_context) {
2183
- while (1) {
2184
- switch (_context.prev = _context.next) {
2185
- case 0:
2186
- _context.next = 2;
2187
- return this._client.get(this._url);
2188
-
2189
- case 2:
2190
- result = _context.sent;
2191
-
2192
- if (!(Object.keys(result).length === 0 || !result.data)) {
2193
- _context.next = 5;
2194
- break;
2195
- }
2196
-
2197
- return _context.abrupt("return", null);
2198
-
2199
- case 5:
2200
- return _context.abrupt("return", result.data);
2201
-
2202
- case 6:
2203
- case "end":
2204
- return _context.stop();
2205
- }
1435
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
1436
+ while (1) switch (_context.prev = _context.next) {
1437
+ case 0:
1438
+ _context.next = 2;
1439
+ return this._client.get(this._url);
1440
+ case 2:
1441
+ result = _context.sent;
1442
+ if (!(Object.keys(result).length === 0 || !result.data)) {
1443
+ _context.next = 5;
1444
+ break;
1445
+ }
1446
+ return _context.abrupt("return", null);
1447
+ case 5:
1448
+ return _context.abrupt("return", result.data);
1449
+ case 6:
1450
+ case "end":
1451
+ return _context.stop();
2206
1452
  }
2207
1453
  }, _callee, this);
2208
1454
  }));
2209
-
2210
1455
  function getFields() {
2211
1456
  return _getFields.apply(this, arguments);
2212
1457
  }
2213
-
2214
1458
  return getFields;
2215
1459
  }()
2216
1460
  /**
@@ -2229,49 +1473,38 @@ var BentoFields = /*#__PURE__*/function () {
2229
1473
  * @returns Promise<Field[]>
2230
1474
  */
2231
1475
  ;
2232
-
2233
1476
  _proto.createField =
2234
1477
  /*#__PURE__*/
2235
1478
  function () {
2236
- var _createField = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2(parameters) {
1479
+ var _createField = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(parameters) {
2237
1480
  var result;
2238
- return runtime_1.wrap(function _callee2$(_context2) {
2239
- while (1) {
2240
- switch (_context2.prev = _context2.next) {
2241
- case 0:
2242
- _context2.next = 2;
2243
- return this._client.post(this._url, {
2244
- field: parameters
2245
- });
2246
-
2247
- case 2:
2248
- result = _context2.sent;
2249
-
2250
- if (!(Object.keys(result).length === 0 || !result.data)) {
2251
- _context2.next = 5;
2252
- break;
2253
- }
2254
-
2255
- return _context2.abrupt("return", null);
2256
-
2257
- case 5:
2258
- return _context2.abrupt("return", result.data);
2259
-
2260
- case 6:
2261
- case "end":
2262
- return _context2.stop();
2263
- }
1481
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
1482
+ while (1) switch (_context2.prev = _context2.next) {
1483
+ case 0:
1484
+ _context2.next = 2;
1485
+ return this._client.post(this._url, {
1486
+ field: parameters
1487
+ });
1488
+ case 2:
1489
+ result = _context2.sent;
1490
+ if (!(Object.keys(result).length === 0 || !result.data)) {
1491
+ _context2.next = 5;
1492
+ break;
1493
+ }
1494
+ return _context2.abrupt("return", null);
1495
+ case 5:
1496
+ return _context2.abrupt("return", result.data);
1497
+ case 6:
1498
+ case "end":
1499
+ return _context2.stop();
2264
1500
  }
2265
1501
  }, _callee2, this);
2266
1502
  }));
2267
-
2268
1503
  function createField(_x) {
2269
1504
  return _createField.apply(this, arguments);
2270
1505
  }
2271
-
2272
1506
  return createField;
2273
1507
  }();
2274
-
2275
1508
  return BentoFields;
2276
1509
  }();
2277
1510
 
@@ -2287,52 +1520,39 @@ var BentoForms = /*#__PURE__*/function () {
2287
1520
  * @param formIdentifier string
2288
1521
  * @returns Promise\<FormResponse[] | null\>
2289
1522
  */
2290
-
2291
-
2292
1523
  var _proto = BentoForms.prototype;
2293
-
2294
1524
  _proto.getResponses =
2295
1525
  /*#__PURE__*/
2296
1526
  function () {
2297
- var _getResponses = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(formIdentifier) {
1527
+ var _getResponses = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(formIdentifier) {
2298
1528
  var result;
2299
- return runtime_1.wrap(function _callee$(_context) {
2300
- while (1) {
2301
- switch (_context.prev = _context.next) {
2302
- case 0:
2303
- _context.next = 2;
2304
- return this._client.get(this._url, {
2305
- id: formIdentifier
2306
- });
2307
-
2308
- case 2:
2309
- result = _context.sent;
2310
-
2311
- if (!(Object.keys(result).length === 0 || !result.data)) {
2312
- _context.next = 5;
2313
- break;
2314
- }
2315
-
2316
- return _context.abrupt("return", null);
2317
-
2318
- case 5:
2319
- return _context.abrupt("return", result.data);
2320
-
2321
- case 6:
2322
- case "end":
2323
- return _context.stop();
2324
- }
1529
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
1530
+ while (1) switch (_context.prev = _context.next) {
1531
+ case 0:
1532
+ _context.next = 2;
1533
+ return this._client.get(this._url, {
1534
+ id: formIdentifier
1535
+ });
1536
+ case 2:
1537
+ result = _context.sent;
1538
+ if (!(Object.keys(result).length === 0 || !result.data)) {
1539
+ _context.next = 5;
1540
+ break;
1541
+ }
1542
+ return _context.abrupt("return", null);
1543
+ case 5:
1544
+ return _context.abrupt("return", result.data);
1545
+ case 6:
1546
+ case "end":
1547
+ return _context.stop();
2325
1548
  }
2326
1549
  }, _callee, this);
2327
1550
  }));
2328
-
2329
1551
  function getResponses(_x) {
2330
1552
  return _getResponses.apply(this, arguments);
2331
1553
  }
2332
-
2333
1554
  return getResponses;
2334
1555
  }();
2335
-
2336
1556
  return BentoForms;
2337
1557
  }();
2338
1558
 
@@ -2347,47 +1567,35 @@ var BentoSubscribers = /*#__PURE__*/function () {
2347
1567
  *
2348
1568
  * @returns Promise\<Subscriber\<S\> | null\>
2349
1569
  */
2350
-
2351
-
2352
1570
  var _proto = BentoSubscribers.prototype;
2353
-
2354
1571
  _proto.getSubscribers =
2355
1572
  /*#__PURE__*/
2356
1573
  function () {
2357
- var _getSubscribers = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(parameters) {
1574
+ var _getSubscribers = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(parameters) {
2358
1575
  var result;
2359
- return runtime_1.wrap(function _callee$(_context) {
2360
- while (1) {
2361
- switch (_context.prev = _context.next) {
2362
- case 0:
2363
- _context.next = 2;
2364
- return this._client.get(this._url, parameters);
2365
-
2366
- case 2:
2367
- result = _context.sent;
2368
-
2369
- if (!(Object.keys(result).length === 0 || !result.data)) {
2370
- _context.next = 5;
2371
- break;
2372
- }
2373
-
2374
- return _context.abrupt("return", null);
2375
-
2376
- case 5:
2377
- return _context.abrupt("return", result.data);
2378
-
2379
- case 6:
2380
- case "end":
2381
- return _context.stop();
2382
- }
1576
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
1577
+ while (1) switch (_context.prev = _context.next) {
1578
+ case 0:
1579
+ _context.next = 2;
1580
+ return this._client.get(this._url, parameters);
1581
+ case 2:
1582
+ result = _context.sent;
1583
+ if (!(Object.keys(result).length === 0 || !result.data)) {
1584
+ _context.next = 5;
1585
+ break;
1586
+ }
1587
+ return _context.abrupt("return", null);
1588
+ case 5:
1589
+ return _context.abrupt("return", result.data);
1590
+ case 6:
1591
+ case "end":
1592
+ return _context.stop();
2383
1593
  }
2384
1594
  }, _callee, this);
2385
1595
  }));
2386
-
2387
1596
  function getSubscribers(_x) {
2388
1597
  return _getSubscribers.apply(this, arguments);
2389
1598
  }
2390
-
2391
1599
  return getSubscribers;
2392
1600
  }()
2393
1601
  /**
@@ -2397,49 +1605,38 @@ var BentoSubscribers = /*#__PURE__*/function () {
2397
1605
  * @returns Promise\<Subscriber\<S\> | null\>
2398
1606
  */
2399
1607
  ;
2400
-
2401
1608
  _proto.createSubscriber =
2402
1609
  /*#__PURE__*/
2403
1610
  function () {
2404
- var _createSubscriber = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2(parameters) {
1611
+ var _createSubscriber = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(parameters) {
2405
1612
  var result;
2406
- return runtime_1.wrap(function _callee2$(_context2) {
2407
- while (1) {
2408
- switch (_context2.prev = _context2.next) {
2409
- case 0:
2410
- _context2.next = 2;
2411
- return this._client.post(this._url, {
2412
- subscriber: parameters
2413
- });
2414
-
2415
- case 2:
2416
- result = _context2.sent;
2417
-
2418
- if (!(Object.keys(result).length === 0 || !result.data)) {
2419
- _context2.next = 5;
2420
- break;
2421
- }
2422
-
2423
- return _context2.abrupt("return", null);
2424
-
2425
- case 5:
2426
- return _context2.abrupt("return", result.data);
2427
-
2428
- case 6:
2429
- case "end":
2430
- return _context2.stop();
2431
- }
1613
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
1614
+ while (1) switch (_context2.prev = _context2.next) {
1615
+ case 0:
1616
+ _context2.next = 2;
1617
+ return this._client.post(this._url, {
1618
+ subscriber: parameters
1619
+ });
1620
+ case 2:
1621
+ result = _context2.sent;
1622
+ if (!(Object.keys(result).length === 0 || !result.data)) {
1623
+ _context2.next = 5;
1624
+ break;
1625
+ }
1626
+ return _context2.abrupt("return", null);
1627
+ case 5:
1628
+ return _context2.abrupt("return", result.data);
1629
+ case 6:
1630
+ case "end":
1631
+ return _context2.stop();
2432
1632
  }
2433
1633
  }, _callee2, this);
2434
1634
  }));
2435
-
2436
1635
  function createSubscriber(_x2) {
2437
1636
  return _createSubscriber.apply(this, arguments);
2438
1637
  }
2439
-
2440
1638
  return createSubscriber;
2441
1639
  }();
2442
-
2443
1640
  return BentoSubscribers;
2444
1641
  }();
2445
1642
 
@@ -2454,47 +1651,35 @@ var BentoTags = /*#__PURE__*/function () {
2454
1651
  *
2455
1652
  * @returns Promise\<Tag[] | null\>
2456
1653
  */
2457
-
2458
-
2459
1654
  var _proto = BentoTags.prototype;
2460
-
2461
1655
  _proto.getTags =
2462
1656
  /*#__PURE__*/
2463
1657
  function () {
2464
- var _getTags = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee() {
1658
+ var _getTags = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
2465
1659
  var result;
2466
- return runtime_1.wrap(function _callee$(_context) {
2467
- while (1) {
2468
- switch (_context.prev = _context.next) {
2469
- case 0:
2470
- _context.next = 2;
2471
- return this._client.get(this._url);
2472
-
2473
- case 2:
2474
- result = _context.sent;
2475
-
2476
- if (!(Object.keys(result).length === 0 || !result.data)) {
2477
- _context.next = 5;
2478
- break;
2479
- }
2480
-
2481
- return _context.abrupt("return", null);
2482
-
2483
- case 5:
2484
- return _context.abrupt("return", result.data);
2485
-
2486
- case 6:
2487
- case "end":
2488
- return _context.stop();
2489
- }
1660
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
1661
+ while (1) switch (_context.prev = _context.next) {
1662
+ case 0:
1663
+ _context.next = 2;
1664
+ return this._client.get(this._url);
1665
+ case 2:
1666
+ result = _context.sent;
1667
+ if (!(Object.keys(result).length === 0 || !result.data)) {
1668
+ _context.next = 5;
1669
+ break;
1670
+ }
1671
+ return _context.abrupt("return", null);
1672
+ case 5:
1673
+ return _context.abrupt("return", result.data);
1674
+ case 6:
1675
+ case "end":
1676
+ return _context.stop();
2490
1677
  }
2491
1678
  }, _callee, this);
2492
1679
  }));
2493
-
2494
1680
  function getTags() {
2495
1681
  return _getTags.apply(this, arguments);
2496
1682
  }
2497
-
2498
1683
  return getTags;
2499
1684
  }()
2500
1685
  /**
@@ -2504,54 +1689,42 @@ var BentoTags = /*#__PURE__*/function () {
2504
1689
  * @returns Promise\<Tag[] | null\>
2505
1690
  */
2506
1691
  ;
2507
-
2508
1692
  _proto.createTag =
2509
1693
  /*#__PURE__*/
2510
1694
  function () {
2511
- var _createTag = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2(parameters) {
1695
+ var _createTag = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(parameters) {
2512
1696
  var result;
2513
- return runtime_1.wrap(function _callee2$(_context2) {
2514
- while (1) {
2515
- switch (_context2.prev = _context2.next) {
2516
- case 0:
2517
- _context2.next = 2;
2518
- return this._client.post(this._url, {
2519
- tag: parameters
2520
- });
2521
-
2522
- case 2:
2523
- result = _context2.sent;
2524
-
2525
- if (!(Object.keys(result).length === 0 || !result.data)) {
2526
- _context2.next = 5;
2527
- break;
2528
- }
2529
-
2530
- return _context2.abrupt("return", null);
2531
-
2532
- case 5:
2533
- return _context2.abrupt("return", result.data);
2534
-
2535
- case 6:
2536
- case "end":
2537
- return _context2.stop();
2538
- }
1697
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
1698
+ while (1) switch (_context2.prev = _context2.next) {
1699
+ case 0:
1700
+ _context2.next = 2;
1701
+ return this._client.post(this._url, {
1702
+ tag: parameters
1703
+ });
1704
+ case 2:
1705
+ result = _context2.sent;
1706
+ if (!(Object.keys(result).length === 0 || !result.data)) {
1707
+ _context2.next = 5;
1708
+ break;
1709
+ }
1710
+ return _context2.abrupt("return", null);
1711
+ case 5:
1712
+ return _context2.abrupt("return", result.data);
1713
+ case 6:
1714
+ case "end":
1715
+ return _context2.stop();
2539
1716
  }
2540
1717
  }, _callee2, this);
2541
1718
  }));
2542
-
2543
1719
  function createTag(_x) {
2544
1720
  return _createTag.apply(this, arguments);
2545
1721
  }
2546
-
2547
1722
  return createTag;
2548
1723
  }();
2549
-
2550
1724
  return BentoTags;
2551
1725
  }();
2552
1726
 
2553
1727
  var BentoEvents;
2554
-
2555
1728
  (function (BentoEvents) {
2556
1729
  BentoEvents["PURCHASE"] = "$purchase";
2557
1730
  BentoEvents["SUBSCRIBE"] = "$subscribe";
@@ -2597,47 +1770,38 @@ var BentoAPIV1 = /*#__PURE__*/function () {
2597
1770
  * @param parameters TagSubscriberParameters
2598
1771
  * @returns Promise\<boolean\>
2599
1772
  */
2600
-
2601
-
2602
1773
  var _proto = BentoAPIV1.prototype;
2603
-
2604
1774
  _proto.tagSubscriber =
2605
1775
  /*#__PURE__*/
2606
1776
  function () {
2607
- var _tagSubscriber = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(parameters) {
1777
+ var _tagSubscriber = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(parameters) {
2608
1778
  var result;
2609
- return runtime_1.wrap(function _callee$(_context) {
2610
- while (1) {
2611
- switch (_context.prev = _context.next) {
2612
- case 0:
2613
- _context.next = 2;
2614
- return this.Batch.importEvents({
2615
- events: [{
2616
- date: parameters.date,
2617
- details: {
2618
- tag: parameters.tagName
2619
- },
2620
- email: parameters.email,
2621
- type: BentoEvents.TAG
2622
- }]
2623
- });
2624
-
2625
- case 2:
2626
- result = _context.sent;
2627
- return _context.abrupt("return", result === 1);
2628
-
2629
- case 4:
2630
- case "end":
2631
- return _context.stop();
2632
- }
1779
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
1780
+ while (1) switch (_context.prev = _context.next) {
1781
+ case 0:
1782
+ _context.next = 2;
1783
+ return this.Batch.importEvents({
1784
+ events: [{
1785
+ date: parameters.date,
1786
+ details: {
1787
+ tag: parameters.tagName
1788
+ },
1789
+ email: parameters.email,
1790
+ type: BentoEvents.TAG
1791
+ }]
1792
+ });
1793
+ case 2:
1794
+ result = _context.sent;
1795
+ return _context.abrupt("return", result === 1);
1796
+ case 4:
1797
+ case "end":
1798
+ return _context.stop();
2633
1799
  }
2634
1800
  }, _callee, this);
2635
1801
  }));
2636
-
2637
1802
  function tagSubscriber(_x) {
2638
1803
  return _tagSubscriber.apply(this, arguments);
2639
1804
  }
2640
-
2641
1805
  return tagSubscriber;
2642
1806
  }()
2643
1807
  /**
@@ -2661,42 +1825,35 @@ var BentoAPIV1 = /*#__PURE__*/function () {
2661
1825
  * @returns Promise\<boolean\>
2662
1826
  */
2663
1827
  ;
2664
-
2665
1828
  _proto.addSubscriber =
2666
1829
  /*#__PURE__*/
2667
1830
  function () {
2668
- var _addSubscriber = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2(parameters) {
1831
+ var _addSubscriber = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(parameters) {
2669
1832
  var result;
2670
- return runtime_1.wrap(function _callee2$(_context2) {
2671
- while (1) {
2672
- switch (_context2.prev = _context2.next) {
2673
- case 0:
2674
- _context2.next = 2;
2675
- return this.Batch.importEvents({
2676
- events: [{
2677
- date: parameters.date,
2678
- email: parameters.email,
2679
- type: BentoEvents.SUBSCRIBE,
2680
- fields: parameters.fields || {}
2681
- }]
2682
- });
2683
-
2684
- case 2:
2685
- result = _context2.sent;
2686
- return _context2.abrupt("return", result === 1);
2687
-
2688
- case 4:
2689
- case "end":
2690
- return _context2.stop();
2691
- }
1833
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
1834
+ while (1) switch (_context2.prev = _context2.next) {
1835
+ case 0:
1836
+ _context2.next = 2;
1837
+ return this.Batch.importEvents({
1838
+ events: [{
1839
+ date: parameters.date,
1840
+ email: parameters.email,
1841
+ type: BentoEvents.SUBSCRIBE,
1842
+ fields: parameters.fields || {}
1843
+ }]
1844
+ });
1845
+ case 2:
1846
+ result = _context2.sent;
1847
+ return _context2.abrupt("return", result === 1);
1848
+ case 4:
1849
+ case "end":
1850
+ return _context2.stop();
2692
1851
  }
2693
1852
  }, _callee2, this);
2694
1853
  }));
2695
-
2696
1854
  function addSubscriber(_x2) {
2697
1855
  return _addSubscriber.apply(this, arguments);
2698
1856
  }
2699
-
2700
1857
  return addSubscriber;
2701
1858
  }()
2702
1859
  /**
@@ -2719,41 +1876,34 @@ var BentoAPIV1 = /*#__PURE__*/function () {
2719
1876
  * @returns Promise\<boolean\>
2720
1877
  */
2721
1878
  ;
2722
-
2723
1879
  _proto.removeSubscriber =
2724
1880
  /*#__PURE__*/
2725
1881
  function () {
2726
- var _removeSubscriber = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee3(parameters) {
1882
+ var _removeSubscriber = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(parameters) {
2727
1883
  var result;
2728
- return runtime_1.wrap(function _callee3$(_context3) {
2729
- while (1) {
2730
- switch (_context3.prev = _context3.next) {
2731
- case 0:
2732
- _context3.next = 2;
2733
- return this.Batch.importEvents({
2734
- events: [{
2735
- date: parameters.date,
2736
- email: parameters.email,
2737
- type: BentoEvents.UNSUBSCRIBE
2738
- }]
2739
- });
2740
-
2741
- case 2:
2742
- result = _context3.sent;
2743
- return _context3.abrupt("return", result === 1);
2744
-
2745
- case 4:
2746
- case "end":
2747
- return _context3.stop();
2748
- }
1884
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
1885
+ while (1) switch (_context3.prev = _context3.next) {
1886
+ case 0:
1887
+ _context3.next = 2;
1888
+ return this.Batch.importEvents({
1889
+ events: [{
1890
+ date: parameters.date,
1891
+ email: parameters.email,
1892
+ type: BentoEvents.UNSUBSCRIBE
1893
+ }]
1894
+ });
1895
+ case 2:
1896
+ result = _context3.sent;
1897
+ return _context3.abrupt("return", result === 1);
1898
+ case 4:
1899
+ case "end":
1900
+ return _context3.stop();
2749
1901
  }
2750
1902
  }, _callee3, this);
2751
1903
  }));
2752
-
2753
1904
  function removeSubscriber(_x3) {
2754
1905
  return _removeSubscriber.apply(this, arguments);
2755
1906
  }
2756
-
2757
1907
  return removeSubscriber;
2758
1908
  }()
2759
1909
  /**
@@ -2776,42 +1926,35 @@ var BentoAPIV1 = /*#__PURE__*/function () {
2776
1926
  * @returns Promise\<boolean\>
2777
1927
  */
2778
1928
  ;
2779
-
2780
1929
  _proto.updateFields =
2781
1930
  /*#__PURE__*/
2782
1931
  function () {
2783
- var _updateFields = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee4(parameters) {
1932
+ var _updateFields = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(parameters) {
2784
1933
  var result;
2785
- return runtime_1.wrap(function _callee4$(_context4) {
2786
- while (1) {
2787
- switch (_context4.prev = _context4.next) {
2788
- case 0:
2789
- _context4.next = 2;
2790
- return this.Batch.importEvents({
2791
- events: [{
2792
- date: parameters.date,
2793
- email: parameters.email,
2794
- type: BentoEvents.UPDATE_FIELDS,
2795
- fields: parameters.fields
2796
- }]
2797
- });
2798
-
2799
- case 2:
2800
- result = _context4.sent;
2801
- return _context4.abrupt("return", result === 1);
2802
-
2803
- case 4:
2804
- case "end":
2805
- return _context4.stop();
2806
- }
1934
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
1935
+ while (1) switch (_context4.prev = _context4.next) {
1936
+ case 0:
1937
+ _context4.next = 2;
1938
+ return this.Batch.importEvents({
1939
+ events: [{
1940
+ date: parameters.date,
1941
+ email: parameters.email,
1942
+ type: BentoEvents.UPDATE_FIELDS,
1943
+ fields: parameters.fields
1944
+ }]
1945
+ });
1946
+ case 2:
1947
+ result = _context4.sent;
1948
+ return _context4.abrupt("return", result === 1);
1949
+ case 4:
1950
+ case "end":
1951
+ return _context4.stop();
2807
1952
  }
2808
1953
  }, _callee4, this);
2809
1954
  }));
2810
-
2811
1955
  function updateFields(_x4) {
2812
1956
  return _updateFields.apply(this, arguments);
2813
1957
  }
2814
-
2815
1958
  return updateFields;
2816
1959
  }()
2817
1960
  /**
@@ -2833,42 +1976,35 @@ var BentoAPIV1 = /*#__PURE__*/function () {
2833
1976
  * @returns Promise\<boolean\>
2834
1977
  */
2835
1978
  ;
2836
-
2837
1979
  _proto.trackPurchase =
2838
1980
  /*#__PURE__*/
2839
1981
  function () {
2840
- var _trackPurchase = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee5(parameters) {
1982
+ var _trackPurchase = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(parameters) {
2841
1983
  var result;
2842
- return runtime_1.wrap(function _callee5$(_context5) {
2843
- while (1) {
2844
- switch (_context5.prev = _context5.next) {
2845
- case 0:
2846
- _context5.next = 2;
2847
- return this.Batch.importEvents({
2848
- events: [{
2849
- date: parameters.date,
2850
- email: parameters.email,
2851
- type: BentoEvents.PURCHASE,
2852
- details: parameters.purchaseDetails
2853
- }]
2854
- });
2855
-
2856
- case 2:
2857
- result = _context5.sent;
2858
- return _context5.abrupt("return", result === 1);
2859
-
2860
- case 4:
2861
- case "end":
2862
- return _context5.stop();
2863
- }
1984
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
1985
+ while (1) switch (_context5.prev = _context5.next) {
1986
+ case 0:
1987
+ _context5.next = 2;
1988
+ return this.Batch.importEvents({
1989
+ events: [{
1990
+ date: parameters.date,
1991
+ email: parameters.email,
1992
+ type: BentoEvents.PURCHASE,
1993
+ details: parameters.purchaseDetails
1994
+ }]
1995
+ });
1996
+ case 2:
1997
+ result = _context5.sent;
1998
+ return _context5.abrupt("return", result === 1);
1999
+ case 4:
2000
+ case "end":
2001
+ return _context5.stop();
2864
2002
  }
2865
2003
  }, _callee5, this);
2866
2004
  }));
2867
-
2868
2005
  function trackPurchase(_x5) {
2869
2006
  return _trackPurchase.apply(this, arguments);
2870
2007
  }
2871
-
2872
2008
  return trackPurchase;
2873
2009
  }()
2874
2010
  /**
@@ -2889,40 +2025,32 @@ var BentoAPIV1 = /*#__PURE__*/function () {
2889
2025
  * @returns Promise\<boolean\>
2890
2026
  */
2891
2027
  ;
2892
-
2893
2028
  _proto.track =
2894
2029
  /*#__PURE__*/
2895
2030
  function () {
2896
- var _track = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee6(parameters) {
2031
+ var _track = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(parameters) {
2897
2032
  var result;
2898
- return runtime_1.wrap(function _callee6$(_context6) {
2899
- while (1) {
2900
- switch (_context6.prev = _context6.next) {
2901
- case 0:
2902
- _context6.next = 2;
2903
- return this.Batch.importEvents({
2904
- events: [parameters]
2905
- });
2906
-
2907
- case 2:
2908
- result = _context6.sent;
2909
- return _context6.abrupt("return", result === 1);
2910
-
2911
- case 4:
2912
- case "end":
2913
- return _context6.stop();
2914
- }
2033
+ return _regeneratorRuntime().wrap(function _callee6$(_context6) {
2034
+ while (1) switch (_context6.prev = _context6.next) {
2035
+ case 0:
2036
+ _context6.next = 2;
2037
+ return this.Batch.importEvents({
2038
+ events: [parameters]
2039
+ });
2040
+ case 2:
2041
+ result = _context6.sent;
2042
+ return _context6.abrupt("return", result === 1);
2043
+ case 4:
2044
+ case "end":
2045
+ return _context6.stop();
2915
2046
  }
2916
2047
  }, _callee6, this);
2917
2048
  }));
2918
-
2919
2049
  function track(_x6) {
2920
2050
  return _track.apply(this, arguments);
2921
2051
  }
2922
-
2923
2052
  return track;
2924
2053
  }();
2925
-
2926
2054
  return BentoAPIV1;
2927
2055
  }();
2928
2056