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