@plasmicpkgs/commerce-shopify 0.0.6 → 0.0.7

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.
@@ -8,7 +8,7 @@ var React = require('react');
8
8
  var React__default = _interopDefault(React);
9
9
  var commerce = require('@plasmicpkgs/commerce');
10
10
  var Cookies = _interopDefault(require('js-cookie'));
11
- var debounce = _interopDefault(require('lodash.debounce'));
11
+ var debounce = _interopDefault(require('lodash/debounce'));
12
12
  var registerGlobalContext = _interopDefault(require('@plasmicapp/host/registerGlobalContext'));
13
13
 
14
14
  /*
@@ -92,201 +92,198 @@ function createCommonjsModule(fn, module) {
92
92
  return module = { exports: {} }, fn(module, module.exports), module.exports;
93
93
  }
94
94
 
95
- var runtime_1 = createCommonjsModule(function (module) {
96
- /**
97
- * Copyright (c) 2014-present, Facebook, Inc.
98
- *
99
- * This source code is licensed under the MIT license found in the
100
- * LICENSE file in the root directory of this source tree.
101
- */
102
-
103
- var runtime = (function (exports) {
104
-
105
- var Op = Object.prototype;
106
- var hasOwn = Op.hasOwnProperty;
107
- var undefined$1; // More compressible than void 0.
108
- var $Symbol = typeof Symbol === "function" ? Symbol : {};
109
- var iteratorSymbol = $Symbol.iterator || "@@iterator";
110
- var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
111
- var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
112
-
113
- function define(obj, key, value) {
114
- Object.defineProperty(obj, key, {
115
- value: value,
116
- enumerable: true,
117
- configurable: true,
118
- writable: true
119
- });
120
- return obj[key];
121
- }
122
- try {
123
- // IE 8 has a broken Object.defineProperty that only works on DOM objects.
124
- define({}, "");
125
- } catch (err) {
126
- define = function(obj, key, value) {
127
- return obj[key] = value;
128
- };
129
- }
130
-
131
- function wrap(innerFn, outerFn, self, tryLocsList) {
132
- // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
133
- var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
134
- var generator = Object.create(protoGenerator.prototype);
135
- var context = new Context(tryLocsList || []);
136
-
137
- // The ._invoke method unifies the implementations of the .next,
138
- // .throw, and .return methods.
139
- generator._invoke = makeInvokeMethod(innerFn, self, context);
95
+ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
96
+ /**
97
+ * Copyright (c) 2014-present, Facebook, Inc.
98
+ *
99
+ * This source code is licensed under the MIT license found in the
100
+ * LICENSE file in the root directory of this source tree.
101
+ */
102
+ var runtime = function (exports) {
103
+
104
+ var Op = Object.prototype;
105
+ var hasOwn = Op.hasOwnProperty;
106
+ var undefined$1; // More compressible than void 0.
107
+
108
+ var $Symbol = typeof Symbol === "function" ? Symbol : {};
109
+ var iteratorSymbol = $Symbol.iterator || "@@iterator";
110
+ var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
111
+ var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
112
+
113
+ function define(obj, key, value) {
114
+ Object.defineProperty(obj, key, {
115
+ value: value,
116
+ enumerable: true,
117
+ configurable: true,
118
+ writable: true
119
+ });
120
+ return obj[key];
121
+ }
140
122
 
141
- return generator;
142
- }
143
- exports.wrap = wrap;
144
-
145
- // Try/catch helper to minimize deoptimizations. Returns a completion
146
- // record like context.tryEntries[i].completion. This interface could
147
- // have been (and was previously) designed to take a closure to be
148
- // invoked without arguments, but in all the cases we care about we
149
- // already have an existing method we want to call, so there's no need
150
- // to create a new function object. We can even get away with assuming
151
- // the method takes exactly one argument, since that happens to be true
152
- // in every case, so we don't have to touch the arguments object. The
153
- // only additional allocation required is the completion record, which
154
- // has a stable shape and so hopefully should be cheap to allocate.
155
- function tryCatch(fn, obj, arg) {
156
123
  try {
157
- return { type: "normal", arg: fn.call(obj, arg) };
124
+ // IE 8 has a broken Object.defineProperty that only works on DOM objects.
125
+ define({}, "");
158
126
  } catch (err) {
159
- return { type: "throw", arg: err };
127
+ define = function define(obj, key, value) {
128
+ return obj[key] = value;
129
+ };
160
130
  }
161
- }
162
131
 
163
- var GenStateSuspendedStart = "suspendedStart";
164
- var GenStateSuspendedYield = "suspendedYield";
165
- var GenStateExecuting = "executing";
166
- var GenStateCompleted = "completed";
167
-
168
- // Returning this object from the innerFn has the same effect as
169
- // breaking out of the dispatch switch statement.
170
- var ContinueSentinel = {};
171
-
172
- // Dummy constructor functions that we use as the .constructor and
173
- // .constructor.prototype properties for functions that return Generator
174
- // objects. For full spec compliance, you may wish to configure your
175
- // minifier not to mangle the names of these two functions.
176
- function Generator() {}
177
- function GeneratorFunction() {}
178
- function GeneratorFunctionPrototype() {}
179
-
180
- // This is a polyfill for %IteratorPrototype% for environments that
181
- // don't natively support it.
182
- var IteratorPrototype = {};
183
- define(IteratorPrototype, iteratorSymbol, function () {
184
- return this;
185
- });
132
+ function wrap(innerFn, outerFn, self, tryLocsList) {
133
+ // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
134
+ var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
135
+ var generator = Object.create(protoGenerator.prototype);
136
+ var context = new Context(tryLocsList || []); // The ._invoke method unifies the implementations of the .next,
137
+ // .throw, and .return methods.
186
138
 
187
- var getProto = Object.getPrototypeOf;
188
- var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
189
- if (NativeIteratorPrototype &&
190
- NativeIteratorPrototype !== Op &&
191
- hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
192
- // This environment has a native %IteratorPrototype%; use it instead
193
- // of the polyfill.
194
- IteratorPrototype = NativeIteratorPrototype;
195
- }
139
+ generator._invoke = makeInvokeMethod(innerFn, self, context);
140
+ return generator;
141
+ }
196
142
 
197
- var Gp = GeneratorFunctionPrototype.prototype =
198
- Generator.prototype = Object.create(IteratorPrototype);
199
- GeneratorFunction.prototype = GeneratorFunctionPrototype;
200
- define(Gp, "constructor", GeneratorFunctionPrototype);
201
- define(GeneratorFunctionPrototype, "constructor", GeneratorFunction);
202
- GeneratorFunction.displayName = define(
203
- GeneratorFunctionPrototype,
204
- toStringTagSymbol,
205
- "GeneratorFunction"
206
- );
207
-
208
- // Helper for defining the .next, .throw, and .return methods of the
209
- // Iterator interface in terms of a single ._invoke method.
210
- function defineIteratorMethods(prototype) {
211
- ["next", "throw", "return"].forEach(function(method) {
212
- define(prototype, method, function(arg) {
213
- return this._invoke(method, arg);
214
- });
215
- });
216
- }
143
+ exports.wrap = wrap; // Try/catch helper to minimize deoptimizations. Returns a completion
144
+ // record like context.tryEntries[i].completion. This interface could
145
+ // have been (and was previously) designed to take a closure to be
146
+ // invoked without arguments, but in all the cases we care about we
147
+ // already have an existing method we want to call, so there's no need
148
+ // to create a new function object. We can even get away with assuming
149
+ // the method takes exactly one argument, since that happens to be true
150
+ // in every case, so we don't have to touch the arguments object. The
151
+ // only additional allocation required is the completion record, which
152
+ // has a stable shape and so hopefully should be cheap to allocate.
153
+
154
+ function tryCatch(fn, obj, arg) {
155
+ try {
156
+ return {
157
+ type: "normal",
158
+ arg: fn.call(obj, arg)
159
+ };
160
+ } catch (err) {
161
+ return {
162
+ type: "throw",
163
+ arg: err
164
+ };
165
+ }
166
+ }
167
+
168
+ var GenStateSuspendedStart = "suspendedStart";
169
+ var GenStateSuspendedYield = "suspendedYield";
170
+ var GenStateExecuting = "executing";
171
+ var GenStateCompleted = "completed"; // Returning this object from the innerFn has the same effect as
172
+ // breaking out of the dispatch switch statement.
173
+
174
+ var ContinueSentinel = {}; // Dummy constructor functions that we use as the .constructor and
175
+ // .constructor.prototype properties for functions that return Generator
176
+ // objects. For full spec compliance, you may wish to configure your
177
+ // minifier not to mangle the names of these two functions.
178
+
179
+ function Generator() {}
180
+
181
+ function GeneratorFunction() {}
182
+
183
+ function GeneratorFunctionPrototype() {} // This is a polyfill for %IteratorPrototype% for environments that
184
+ // don't natively support it.
217
185
 
218
- exports.isGeneratorFunction = function(genFun) {
219
- var ctor = typeof genFun === "function" && genFun.constructor;
220
- return ctor
221
- ? ctor === GeneratorFunction ||
222
- // For the native GeneratorFunction constructor, the best we can
223
- // do is to check its .name property.
224
- (ctor.displayName || ctor.name) === "GeneratorFunction"
225
- : false;
226
- };
227
186
 
228
- exports.mark = function(genFun) {
229
- if (Object.setPrototypeOf) {
230
- Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
231
- } else {
232
- genFun.__proto__ = GeneratorFunctionPrototype;
233
- define(genFun, toStringTagSymbol, "GeneratorFunction");
187
+ var IteratorPrototype = {};
188
+
189
+ IteratorPrototype[iteratorSymbol] = function () {
190
+ return this;
191
+ };
192
+
193
+ var getProto = Object.getPrototypeOf;
194
+ var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
195
+
196
+ if (NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
197
+ // This environment has a native %IteratorPrototype%; use it instead
198
+ // of the polyfill.
199
+ IteratorPrototype = NativeIteratorPrototype;
234
200
  }
235
- genFun.prototype = Object.create(Gp);
236
- return genFun;
237
- };
238
201
 
239
- // Within the body of any async function, `await x` is transformed to
240
- // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
241
- // `hasOwn.call(value, "__await")` to determine if the yielded value is
242
- // meant to be awaited.
243
- exports.awrap = function(arg) {
244
- return { __await: arg };
245
- };
202
+ var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
203
+ GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
204
+ GeneratorFunctionPrototype.constructor = GeneratorFunction;
205
+ GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"); // Helper for defining the .next, .throw, and .return methods of the
206
+ // Iterator interface in terms of a single ._invoke method.
246
207
 
247
- function AsyncIterator(generator, PromiseImpl) {
248
- function invoke(method, arg, resolve, reject) {
249
- var record = tryCatch(generator[method], generator, arg);
250
- if (record.type === "throw") {
251
- reject(record.arg);
208
+ function defineIteratorMethods(prototype) {
209
+ ["next", "throw", "return"].forEach(function (method) {
210
+ define(prototype, method, function (arg) {
211
+ return this._invoke(method, arg);
212
+ });
213
+ });
214
+ }
215
+
216
+ exports.isGeneratorFunction = function (genFun) {
217
+ var ctor = typeof genFun === "function" && genFun.constructor;
218
+ return ctor ? ctor === GeneratorFunction || // For the native GeneratorFunction constructor, the best we can
219
+ // do is to check its .name property.
220
+ (ctor.displayName || ctor.name) === "GeneratorFunction" : false;
221
+ };
222
+
223
+ exports.mark = function (genFun) {
224
+ if (Object.setPrototypeOf) {
225
+ Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
252
226
  } else {
253
- var result = record.arg;
254
- var value = result.value;
255
- if (value &&
256
- typeof value === "object" &&
257
- hasOwn.call(value, "__await")) {
258
- return PromiseImpl.resolve(value.__await).then(function(value) {
259
- invoke("next", value, resolve, reject);
260
- }, function(err) {
261
- invoke("throw", err, resolve, reject);
227
+ genFun.__proto__ = GeneratorFunctionPrototype;
228
+ define(genFun, toStringTagSymbol, "GeneratorFunction");
229
+ }
230
+
231
+ genFun.prototype = Object.create(Gp);
232
+ return genFun;
233
+ }; // Within the body of any async function, `await x` is transformed to
234
+ // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
235
+ // `hasOwn.call(value, "__await")` to determine if the yielded value is
236
+ // meant to be awaited.
237
+
238
+
239
+ exports.awrap = function (arg) {
240
+ return {
241
+ __await: arg
242
+ };
243
+ };
244
+
245
+ function AsyncIterator(generator, PromiseImpl) {
246
+ function invoke(method, arg, resolve, reject) {
247
+ var record = tryCatch(generator[method], generator, arg);
248
+
249
+ if (record.type === "throw") {
250
+ reject(record.arg);
251
+ } else {
252
+ var result = record.arg;
253
+ var value = result.value;
254
+
255
+ if (value && typeof value === "object" && hasOwn.call(value, "__await")) {
256
+ return PromiseImpl.resolve(value.__await).then(function (value) {
257
+ invoke("next", value, resolve, reject);
258
+ }, function (err) {
259
+ invoke("throw", err, resolve, reject);
260
+ });
261
+ }
262
+
263
+ return PromiseImpl.resolve(value).then(function (unwrapped) {
264
+ // When a yielded Promise is resolved, its final value becomes
265
+ // the .value of the Promise<{value,done}> result for the
266
+ // current iteration.
267
+ result.value = unwrapped;
268
+ resolve(result);
269
+ }, function (error) {
270
+ // If a rejected Promise was yielded, throw the rejection back
271
+ // into the async generator function so it can be handled there.
272
+ return invoke("throw", error, resolve, reject);
262
273
  });
263
274
  }
264
-
265
- return PromiseImpl.resolve(value).then(function(unwrapped) {
266
- // When a yielded Promise is resolved, its final value becomes
267
- // the .value of the Promise<{value,done}> result for the
268
- // current iteration.
269
- result.value = unwrapped;
270
- resolve(result);
271
- }, function(error) {
272
- // If a rejected Promise was yielded, throw the rejection back
273
- // into the async generator function so it can be handled there.
274
- return invoke("throw", error, resolve, reject);
275
- });
276
275
  }
277
- }
278
276
 
279
- var previousPromise;
277
+ var previousPromise;
280
278
 
281
- function enqueue(method, arg) {
282
- function callInvokeWithMethodAndArg() {
283
- return new PromiseImpl(function(resolve, reject) {
284
- invoke(method, arg, resolve, reject);
285
- });
286
- }
279
+ function enqueue(method, arg) {
280
+ function callInvokeWithMethodAndArg() {
281
+ return new PromiseImpl(function (resolve, reject) {
282
+ invoke(method, arg, resolve, reject);
283
+ });
284
+ }
287
285
 
288
- return previousPromise =
289
- // If enqueue has been called before, then we want to wait until
286
+ return previousPromise = // If enqueue has been called before, then we want to wait until
290
287
  // all previous Promises have been resolved before calling invoke,
291
288
  // so that results are always delivered in the correct order. If
292
289
  // enqueue has not been called before, then it is important to
@@ -298,554 +295,525 @@ var runtime = (function (exports) {
298
295
  // execute code before the first await. Since we implement simple
299
296
  // async functions in terms of async generators, it is especially
300
297
  // important to get this right, even though it requires care.
301
- previousPromise ? previousPromise.then(
302
- callInvokeWithMethodAndArg,
303
- // Avoid propagating failures to Promises returned by later
304
- // invocations of the iterator.
305
- callInvokeWithMethodAndArg
306
- ) : callInvokeWithMethodAndArg();
298
+ previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, // Avoid propagating failures to Promises returned by later
299
+ // invocations of the iterator.
300
+ callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
301
+ } // Define the unified helper method that is used to implement .next,
302
+ // .throw, and .return (see defineIteratorMethods).
303
+
304
+
305
+ this._invoke = enqueue;
307
306
  }
308
307
 
309
- // Define the unified helper method that is used to implement .next,
310
- // .throw, and .return (see defineIteratorMethods).
311
- this._invoke = enqueue;
312
- }
308
+ defineIteratorMethods(AsyncIterator.prototype);
313
309
 
314
- defineIteratorMethods(AsyncIterator.prototype);
315
- define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
316
- return this;
317
- });
318
- exports.AsyncIterator = AsyncIterator;
319
-
320
- // Note that simple async functions are implemented on top of
321
- // AsyncIterator objects; they just return a Promise for the value of
322
- // the final result produced by the iterator.
323
- exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {
324
- if (PromiseImpl === void 0) PromiseImpl = Promise;
325
-
326
- var iter = new AsyncIterator(
327
- wrap(innerFn, outerFn, self, tryLocsList),
328
- PromiseImpl
329
- );
330
-
331
- return exports.isGeneratorFunction(outerFn)
332
- ? iter // If outerFn is a generator, return the full iterator.
333
- : iter.next().then(function(result) {
334
- return result.done ? result.value : iter.next();
335
- });
336
- };
310
+ AsyncIterator.prototype[asyncIteratorSymbol] = function () {
311
+ return this;
312
+ };
337
313
 
338
- function makeInvokeMethod(innerFn, self, context) {
339
- var state = GenStateSuspendedStart;
314
+ exports.AsyncIterator = AsyncIterator; // Note that simple async functions are implemented on top of
315
+ // AsyncIterator objects; they just return a Promise for the value of
316
+ // the final result produced by the iterator.
340
317
 
341
- return function invoke(method, arg) {
342
- if (state === GenStateExecuting) {
343
- throw new Error("Generator is already running");
344
- }
318
+ exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
319
+ if (PromiseImpl === void 0) PromiseImpl = Promise;
320
+ var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
321
+ return exports.isGeneratorFunction(outerFn) ? iter // If outerFn is a generator, return the full iterator.
322
+ : iter.next().then(function (result) {
323
+ return result.done ? result.value : iter.next();
324
+ });
325
+ };
345
326
 
346
- if (state === GenStateCompleted) {
347
- if (method === "throw") {
348
- throw arg;
327
+ function makeInvokeMethod(innerFn, self, context) {
328
+ var state = GenStateSuspendedStart;
329
+ return function invoke(method, arg) {
330
+ if (state === GenStateExecuting) {
331
+ throw new Error("Generator is already running");
349
332
  }
350
333
 
351
- // Be forgiving, per 25.3.3.3.3 of the spec:
352
- // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
353
- return doneResult();
354
- }
334
+ if (state === GenStateCompleted) {
335
+ if (method === "throw") {
336
+ throw arg;
337
+ } // Be forgiving, per 25.3.3.3.3 of the spec:
338
+ // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
355
339
 
356
- context.method = method;
357
- context.arg = arg;
358
340
 
359
- while (true) {
360
- var delegate = context.delegate;
361
- if (delegate) {
362
- var delegateResult = maybeInvokeDelegate(delegate, context);
363
- if (delegateResult) {
364
- if (delegateResult === ContinueSentinel) continue;
365
- return delegateResult;
366
- }
341
+ return doneResult();
367
342
  }
368
343
 
369
- if (context.method === "next") {
370
- // Setting context._sent for legacy support of Babel's
371
- // function.sent implementation.
372
- context.sent = context._sent = context.arg;
344
+ context.method = method;
345
+ context.arg = arg;
346
+
347
+ while (true) {
348
+ var delegate = context.delegate;
349
+
350
+ if (delegate) {
351
+ var delegateResult = maybeInvokeDelegate(delegate, context);
373
352
 
374
- } else if (context.method === "throw") {
375
- if (state === GenStateSuspendedStart) {
376
- state = GenStateCompleted;
377
- throw context.arg;
353
+ if (delegateResult) {
354
+ if (delegateResult === ContinueSentinel) continue;
355
+ return delegateResult;
356
+ }
378
357
  }
379
358
 
380
- context.dispatchException(context.arg);
359
+ if (context.method === "next") {
360
+ // Setting context._sent for legacy support of Babel's
361
+ // function.sent implementation.
362
+ context.sent = context._sent = context.arg;
363
+ } else if (context.method === "throw") {
364
+ if (state === GenStateSuspendedStart) {
365
+ state = GenStateCompleted;
366
+ throw context.arg;
367
+ }
381
368
 
382
- } else if (context.method === "return") {
383
- context.abrupt("return", context.arg);
384
- }
369
+ context.dispatchException(context.arg);
370
+ } else if (context.method === "return") {
371
+ context.abrupt("return", context.arg);
372
+ }
385
373
 
386
- state = GenStateExecuting;
374
+ state = GenStateExecuting;
375
+ var record = tryCatch(innerFn, self, context);
387
376
 
388
- var record = tryCatch(innerFn, self, context);
389
- if (record.type === "normal") {
390
- // If an exception is thrown from innerFn, we leave state ===
391
- // GenStateExecuting and loop back for another invocation.
392
- state = context.done
393
- ? GenStateCompleted
394
- : GenStateSuspendedYield;
377
+ if (record.type === "normal") {
378
+ // If an exception is thrown from innerFn, we leave state ===
379
+ // GenStateExecuting and loop back for another invocation.
380
+ state = context.done ? GenStateCompleted : GenStateSuspendedYield;
395
381
 
396
- if (record.arg === ContinueSentinel) {
397
- continue;
398
- }
382
+ if (record.arg === ContinueSentinel) {
383
+ continue;
384
+ }
399
385
 
400
- return {
401
- value: record.arg,
402
- done: context.done
403
- };
386
+ return {
387
+ value: record.arg,
388
+ done: context.done
389
+ };
390
+ } else if (record.type === "throw") {
391
+ state = GenStateCompleted; // Dispatch the exception by looping back around to the
392
+ // context.dispatchException(context.arg) call above.
393
+
394
+ context.method = "throw";
395
+ context.arg = record.arg;
396
+ }
397
+ }
398
+ };
399
+ } // Call delegate.iterator[context.method](context.arg) and handle the
400
+ // result, either by returning a { value, done } result from the
401
+ // delegate iterator, or by modifying context.method and context.arg,
402
+ // setting context.delegate to null, and returning the ContinueSentinel.
403
+
404
+
405
+ function maybeInvokeDelegate(delegate, context) {
406
+ var method = delegate.iterator[context.method];
407
+
408
+ if (method === undefined$1) {
409
+ // A .throw or .return when the delegate iterator has no .throw
410
+ // method always terminates the yield* loop.
411
+ context.delegate = null;
412
+
413
+ if (context.method === "throw") {
414
+ // Note: ["return"] must be used for ES3 parsing compatibility.
415
+ if (delegate.iterator["return"]) {
416
+ // If the delegate iterator has a return method, give it a
417
+ // chance to clean up.
418
+ context.method = "return";
419
+ context.arg = undefined$1;
420
+ maybeInvokeDelegate(delegate, context);
421
+
422
+ if (context.method === "throw") {
423
+ // If maybeInvokeDelegate(context) changed context.method from
424
+ // "return" to "throw", let that override the TypeError below.
425
+ return ContinueSentinel;
426
+ }
427
+ }
404
428
 
405
- } else if (record.type === "throw") {
406
- state = GenStateCompleted;
407
- // Dispatch the exception by looping back around to the
408
- // context.dispatchException(context.arg) call above.
409
429
  context.method = "throw";
410
- context.arg = record.arg;
430
+ context.arg = new TypeError("The iterator does not provide a 'throw' method");
411
431
  }
432
+
433
+ return ContinueSentinel;
412
434
  }
413
- };
414
- }
415
435
 
416
- // Call delegate.iterator[context.method](context.arg) and handle the
417
- // result, either by returning a { value, done } result from the
418
- // delegate iterator, or by modifying context.method and context.arg,
419
- // setting context.delegate to null, and returning the ContinueSentinel.
420
- function maybeInvokeDelegate(delegate, context) {
421
- var method = delegate.iterator[context.method];
422
- if (method === undefined$1) {
423
- // A .throw or .return when the delegate iterator has no .throw
424
- // method always terminates the yield* loop.
425
- context.delegate = null;
436
+ var record = tryCatch(method, delegate.iterator, context.arg);
426
437
 
427
- if (context.method === "throw") {
428
- // Note: ["return"] must be used for ES3 parsing compatibility.
429
- if (delegate.iterator["return"]) {
430
- // If the delegate iterator has a return method, give it a
431
- // chance to clean up.
432
- context.method = "return";
433
- context.arg = undefined$1;
434
- maybeInvokeDelegate(delegate, context);
438
+ if (record.type === "throw") {
439
+ context.method = "throw";
440
+ context.arg = record.arg;
441
+ context.delegate = null;
442
+ return ContinueSentinel;
443
+ }
435
444
 
436
- if (context.method === "throw") {
437
- // If maybeInvokeDelegate(context) changed context.method from
438
- // "return" to "throw", let that override the TypeError below.
439
- return ContinueSentinel;
440
- }
441
- }
445
+ var info = record.arg;
442
446
 
447
+ if (!info) {
443
448
  context.method = "throw";
444
- context.arg = new TypeError(
445
- "The iterator does not provide a 'throw' method");
449
+ context.arg = new TypeError("iterator result is not an object");
450
+ context.delegate = null;
451
+ return ContinueSentinel;
446
452
  }
447
453
 
448
- return ContinueSentinel;
449
- }
454
+ if (info.done) {
455
+ // Assign the result of the finished delegate to the temporary
456
+ // variable specified by delegate.resultName (see delegateYield).
457
+ context[delegate.resultName] = info.value; // Resume execution at the desired location (see delegateYield).
450
458
 
451
- var record = tryCatch(method, delegate.iterator, context.arg);
459
+ context.next = delegate.nextLoc; // If context.method was "throw" but the delegate handled the
460
+ // exception, let the outer generator proceed normally. If
461
+ // context.method was "next", forget context.arg since it has been
462
+ // "consumed" by the delegate iterator. If context.method was
463
+ // "return", allow the original .return call to continue in the
464
+ // outer generator.
452
465
 
453
- if (record.type === "throw") {
454
- context.method = "throw";
455
- context.arg = record.arg;
456
- context.delegate = null;
457
- return ContinueSentinel;
458
- }
466
+ if (context.method !== "return") {
467
+ context.method = "next";
468
+ context.arg = undefined$1;
469
+ }
470
+ } else {
471
+ // Re-yield the result returned by the delegate method.
472
+ return info;
473
+ } // The delegate iterator is finished, so forget it and continue with
474
+ // the outer generator.
459
475
 
460
- var info = record.arg;
461
476
 
462
- if (! info) {
463
- context.method = "throw";
464
- context.arg = new TypeError("iterator result is not an object");
465
477
  context.delegate = null;
466
478
  return ContinueSentinel;
467
- }
479
+ } // Define Generator.prototype.{next,throw,return} in terms of the
480
+ // unified ._invoke helper method.
468
481
 
469
- if (info.done) {
470
- // Assign the result of the finished delegate to the temporary
471
- // variable specified by delegate.resultName (see delegateYield).
472
- context[delegate.resultName] = info.value;
473
-
474
- // Resume execution at the desired location (see delegateYield).
475
- context.next = delegate.nextLoc;
476
-
477
- // If context.method was "throw" but the delegate handled the
478
- // exception, let the outer generator proceed normally. If
479
- // context.method was "next", forget context.arg since it has been
480
- // "consumed" by the delegate iterator. If context.method was
481
- // "return", allow the original .return call to continue in the
482
- // outer generator.
483
- if (context.method !== "return") {
484
- context.method = "next";
485
- context.arg = undefined$1;
486
- }
487
482
 
488
- } else {
489
- // Re-yield the result returned by the delegate method.
490
- return info;
491
- }
483
+ defineIteratorMethods(Gp);
484
+ define(Gp, toStringTagSymbol, "Generator"); // A Generator should always return itself as the iterator object when the
485
+ // @@iterator function is called on it. Some browsers' implementations of the
486
+ // iterator prototype chain incorrectly implement this, causing the Generator
487
+ // object to not be returned from this call. This ensures that doesn't happen.
488
+ // See https://github.com/facebook/regenerator/issues/274 for more details.
492
489
 
493
- // The delegate iterator is finished, so forget it and continue with
494
- // the outer generator.
495
- context.delegate = null;
496
- return ContinueSentinel;
497
- }
498
-
499
- // Define Generator.prototype.{next,throw,return} in terms of the
500
- // unified ._invoke helper method.
501
- defineIteratorMethods(Gp);
490
+ Gp[iteratorSymbol] = function () {
491
+ return this;
492
+ };
502
493
 
503
- define(Gp, toStringTagSymbol, "Generator");
494
+ Gp.toString = function () {
495
+ return "[object Generator]";
496
+ };
504
497
 
505
- // A Generator should always return itself as the iterator object when the
506
- // @@iterator function is called on it. Some browsers' implementations of the
507
- // iterator prototype chain incorrectly implement this, causing the Generator
508
- // object to not be returned from this call. This ensures that doesn't happen.
509
- // See https://github.com/facebook/regenerator/issues/274 for more details.
510
- define(Gp, iteratorSymbol, function() {
511
- return this;
512
- });
498
+ function pushTryEntry(locs) {
499
+ var entry = {
500
+ tryLoc: locs[0]
501
+ };
513
502
 
514
- define(Gp, "toString", function() {
515
- return "[object Generator]";
516
- });
503
+ if (1 in locs) {
504
+ entry.catchLoc = locs[1];
505
+ }
517
506
 
518
- function pushTryEntry(locs) {
519
- var entry = { tryLoc: locs[0] };
507
+ if (2 in locs) {
508
+ entry.finallyLoc = locs[2];
509
+ entry.afterLoc = locs[3];
510
+ }
520
511
 
521
- if (1 in locs) {
522
- entry.catchLoc = locs[1];
512
+ this.tryEntries.push(entry);
523
513
  }
524
514
 
525
- if (2 in locs) {
526
- entry.finallyLoc = locs[2];
527
- entry.afterLoc = locs[3];
515
+ function resetTryEntry(entry) {
516
+ var record = entry.completion || {};
517
+ record.type = "normal";
518
+ delete record.arg;
519
+ entry.completion = record;
528
520
  }
529
521
 
530
- this.tryEntries.push(entry);
531
- }
532
-
533
- function resetTryEntry(entry) {
534
- var record = entry.completion || {};
535
- record.type = "normal";
536
- delete record.arg;
537
- entry.completion = record;
538
- }
539
-
540
- function Context(tryLocsList) {
541
- // The root entry object (effectively a try statement without a catch
542
- // or a finally block) gives us a place to store values thrown from
543
- // locations where there is no enclosing try statement.
544
- this.tryEntries = [{ tryLoc: "root" }];
545
- tryLocsList.forEach(pushTryEntry, this);
546
- this.reset(true);
547
- }
548
-
549
- exports.keys = function(object) {
550
- var keys = [];
551
- for (var key in object) {
552
- keys.push(key);
522
+ function Context(tryLocsList) {
523
+ // The root entry object (effectively a try statement without a catch
524
+ // or a finally block) gives us a place to store values thrown from
525
+ // locations where there is no enclosing try statement.
526
+ this.tryEntries = [{
527
+ tryLoc: "root"
528
+ }];
529
+ tryLocsList.forEach(pushTryEntry, this);
530
+ this.reset(true);
553
531
  }
554
- keys.reverse();
555
-
556
- // Rather than returning an object with a next method, we keep
557
- // things simple and return the next function itself.
558
- return function next() {
559
- while (keys.length) {
560
- var key = keys.pop();
561
- if (key in object) {
562
- next.value = key;
563
- next.done = false;
564
- return next;
565
- }
566
- }
567
532
 
568
- // To avoid creating an additional object, we just hang the .value
569
- // and .done properties off the next function object itself. This
570
- // also ensures that the minifier will not anonymize the function.
571
- next.done = true;
572
- return next;
573
- };
574
- };
533
+ exports.keys = function (object) {
534
+ var keys = [];
575
535
 
576
- function values(iterable) {
577
- if (iterable) {
578
- var iteratorMethod = iterable[iteratorSymbol];
579
- if (iteratorMethod) {
580
- return iteratorMethod.call(iterable);
536
+ for (var key in object) {
537
+ keys.push(key);
581
538
  }
582
539
 
583
- if (typeof iterable.next === "function") {
584
- return iterable;
585
- }
540
+ keys.reverse(); // Rather than returning an object with a next method, we keep
541
+ // things simple and return the next function itself.
586
542
 
587
- if (!isNaN(iterable.length)) {
588
- var i = -1, next = function next() {
589
- while (++i < iterable.length) {
590
- if (hasOwn.call(iterable, i)) {
591
- next.value = iterable[i];
592
- next.done = false;
593
- return next;
594
- }
595
- }
543
+ return function next() {
544
+ while (keys.length) {
545
+ var key = keys.pop();
596
546
 
597
- next.value = undefined$1;
598
- next.done = true;
547
+ if (key in object) {
548
+ next.value = key;
549
+ next.done = false;
550
+ return next;
551
+ }
552
+ } // To avoid creating an additional object, we just hang the .value
553
+ // and .done properties off the next function object itself. This
554
+ // also ensures that the minifier will not anonymize the function.
599
555
 
600
- return next;
601
- };
602
556
 
603
- return next.next = next;
604
- }
605
- }
557
+ next.done = true;
558
+ return next;
559
+ };
560
+ };
606
561
 
607
- // Return an iterator with no values.
608
- return { next: doneResult };
609
- }
610
- exports.values = values;
562
+ function values(iterable) {
563
+ if (iterable) {
564
+ var iteratorMethod = iterable[iteratorSymbol];
611
565
 
612
- function doneResult() {
613
- return { value: undefined$1, done: true };
614
- }
566
+ if (iteratorMethod) {
567
+ return iteratorMethod.call(iterable);
568
+ }
615
569
 
616
- Context.prototype = {
617
- constructor: Context,
618
-
619
- reset: function(skipTempReset) {
620
- this.prev = 0;
621
- this.next = 0;
622
- // Resetting context._sent for legacy support of Babel's
623
- // function.sent implementation.
624
- this.sent = this._sent = undefined$1;
625
- this.done = false;
626
- this.delegate = null;
627
-
628
- this.method = "next";
629
- this.arg = undefined$1;
630
-
631
- this.tryEntries.forEach(resetTryEntry);
632
-
633
- if (!skipTempReset) {
634
- for (var name in this) {
635
- // Not sure about the optimal order of these conditions:
636
- if (name.charAt(0) === "t" &&
637
- hasOwn.call(this, name) &&
638
- !isNaN(+name.slice(1))) {
639
- this[name] = undefined$1;
640
- }
570
+ if (typeof iterable.next === "function") {
571
+ return iterable;
641
572
  }
642
- }
643
- },
644
573
 
645
- stop: function() {
646
- this.done = true;
574
+ if (!isNaN(iterable.length)) {
575
+ var i = -1,
576
+ next = function next() {
577
+ while (++i < iterable.length) {
578
+ if (hasOwn.call(iterable, i)) {
579
+ next.value = iterable[i];
580
+ next.done = false;
581
+ return next;
582
+ }
583
+ }
647
584
 
648
- var rootEntry = this.tryEntries[0];
649
- var rootRecord = rootEntry.completion;
650
- if (rootRecord.type === "throw") {
651
- throw rootRecord.arg;
652
- }
585
+ next.value = undefined$1;
586
+ next.done = true;
587
+ return next;
588
+ };
653
589
 
654
- return this.rval;
655
- },
590
+ return next.next = next;
591
+ }
592
+ } // Return an iterator with no values.
656
593
 
657
- dispatchException: function(exception) {
658
- if (this.done) {
659
- throw exception;
660
- }
661
594
 
662
- var context = this;
663
- function handle(loc, caught) {
664
- record.type = "throw";
665
- record.arg = exception;
666
- context.next = loc;
595
+ return {
596
+ next: doneResult
597
+ };
598
+ }
667
599
 
668
- if (caught) {
669
- // If the dispatched exception was caught by a catch block,
670
- // then let that catch block handle the exception normally.
671
- context.method = "next";
672
- context.arg = undefined$1;
673
- }
600
+ exports.values = values;
674
601
 
675
- return !! caught;
676
- }
602
+ function doneResult() {
603
+ return {
604
+ value: undefined$1,
605
+ done: true
606
+ };
607
+ }
677
608
 
678
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
679
- var entry = this.tryEntries[i];
680
- var record = entry.completion;
609
+ Context.prototype = {
610
+ constructor: Context,
611
+ reset: function reset(skipTempReset) {
612
+ this.prev = 0;
613
+ this.next = 0; // Resetting context._sent for legacy support of Babel's
614
+ // function.sent implementation.
681
615
 
682
- if (entry.tryLoc === "root") {
683
- // Exception thrown outside of any try block that could handle
684
- // it, so set the completion value of the entire function to
685
- // throw the exception.
686
- return handle("end");
616
+ this.sent = this._sent = undefined$1;
617
+ this.done = false;
618
+ this.delegate = null;
619
+ this.method = "next";
620
+ this.arg = undefined$1;
621
+ this.tryEntries.forEach(resetTryEntry);
622
+
623
+ if (!skipTempReset) {
624
+ for (var name in this) {
625
+ // Not sure about the optimal order of these conditions:
626
+ if (name.charAt(0) === "t" && hasOwn.call(this, name) && !isNaN(+name.slice(1))) {
627
+ this[name] = undefined$1;
628
+ }
629
+ }
687
630
  }
631
+ },
632
+ stop: function stop() {
633
+ this.done = true;
634
+ var rootEntry = this.tryEntries[0];
635
+ var rootRecord = rootEntry.completion;
688
636
 
689
- if (entry.tryLoc <= this.prev) {
690
- var hasCatch = hasOwn.call(entry, "catchLoc");
691
- var hasFinally = hasOwn.call(entry, "finallyLoc");
637
+ if (rootRecord.type === "throw") {
638
+ throw rootRecord.arg;
639
+ }
692
640
 
693
- if (hasCatch && hasFinally) {
694
- if (this.prev < entry.catchLoc) {
695
- return handle(entry.catchLoc, true);
696
- } else if (this.prev < entry.finallyLoc) {
697
- return handle(entry.finallyLoc);
698
- }
641
+ return this.rval;
642
+ },
643
+ dispatchException: function dispatchException(exception) {
644
+ if (this.done) {
645
+ throw exception;
646
+ }
699
647
 
700
- } else if (hasCatch) {
701
- if (this.prev < entry.catchLoc) {
702
- return handle(entry.catchLoc, true);
703
- }
648
+ var context = this;
704
649
 
705
- } else if (hasFinally) {
706
- if (this.prev < entry.finallyLoc) {
707
- return handle(entry.finallyLoc);
708
- }
650
+ function handle(loc, caught) {
651
+ record.type = "throw";
652
+ record.arg = exception;
653
+ context.next = loc;
709
654
 
710
- } else {
711
- throw new Error("try statement without catch or finally");
655
+ if (caught) {
656
+ // If the dispatched exception was caught by a catch block,
657
+ // then let that catch block handle the exception normally.
658
+ context.method = "next";
659
+ context.arg = undefined$1;
712
660
  }
713
- }
714
- }
715
- },
716
661
 
717
- abrupt: function(type, arg) {
718
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
719
- var entry = this.tryEntries[i];
720
- if (entry.tryLoc <= this.prev &&
721
- hasOwn.call(entry, "finallyLoc") &&
722
- this.prev < entry.finallyLoc) {
723
- var finallyEntry = entry;
724
- break;
662
+ return !!caught;
725
663
  }
726
- }
727
664
 
728
- if (finallyEntry &&
729
- (type === "break" ||
730
- type === "continue") &&
731
- finallyEntry.tryLoc <= arg &&
732
- arg <= finallyEntry.finallyLoc) {
733
- // Ignore the finally entry if control is not jumping to a
734
- // location outside the try/catch block.
735
- finallyEntry = null;
736
- }
665
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
666
+ var entry = this.tryEntries[i];
667
+ var record = entry.completion;
737
668
 
738
- var record = finallyEntry ? finallyEntry.completion : {};
739
- record.type = type;
740
- record.arg = arg;
669
+ if (entry.tryLoc === "root") {
670
+ // Exception thrown outside of any try block that could handle
671
+ // it, so set the completion value of the entire function to
672
+ // throw the exception.
673
+ return handle("end");
674
+ }
741
675
 
742
- if (finallyEntry) {
743
- this.method = "next";
744
- this.next = finallyEntry.finallyLoc;
745
- return ContinueSentinel;
746
- }
676
+ if (entry.tryLoc <= this.prev) {
677
+ var hasCatch = hasOwn.call(entry, "catchLoc");
678
+ var hasFinally = hasOwn.call(entry, "finallyLoc");
747
679
 
748
- return this.complete(record);
749
- },
680
+ if (hasCatch && hasFinally) {
681
+ if (this.prev < entry.catchLoc) {
682
+ return handle(entry.catchLoc, true);
683
+ } else if (this.prev < entry.finallyLoc) {
684
+ return handle(entry.finallyLoc);
685
+ }
686
+ } else if (hasCatch) {
687
+ if (this.prev < entry.catchLoc) {
688
+ return handle(entry.catchLoc, true);
689
+ }
690
+ } else if (hasFinally) {
691
+ if (this.prev < entry.finallyLoc) {
692
+ return handle(entry.finallyLoc);
693
+ }
694
+ } else {
695
+ throw new Error("try statement without catch or finally");
696
+ }
697
+ }
698
+ }
699
+ },
700
+ abrupt: function abrupt(type, arg) {
701
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
702
+ var entry = this.tryEntries[i];
750
703
 
751
- complete: function(record, afterLoc) {
752
- if (record.type === "throw") {
753
- throw record.arg;
754
- }
704
+ if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
705
+ var finallyEntry = entry;
706
+ break;
707
+ }
708
+ }
755
709
 
756
- if (record.type === "break" ||
757
- record.type === "continue") {
758
- this.next = record.arg;
759
- } else if (record.type === "return") {
760
- this.rval = this.arg = record.arg;
761
- this.method = "return";
762
- this.next = "end";
763
- } else if (record.type === "normal" && afterLoc) {
764
- this.next = afterLoc;
765
- }
710
+ if (finallyEntry && (type === "break" || type === "continue") && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc) {
711
+ // Ignore the finally entry if control is not jumping to a
712
+ // location outside the try/catch block.
713
+ finallyEntry = null;
714
+ }
766
715
 
767
- return ContinueSentinel;
768
- },
716
+ var record = finallyEntry ? finallyEntry.completion : {};
717
+ record.type = type;
718
+ record.arg = arg;
769
719
 
770
- finish: function(finallyLoc) {
771
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
772
- var entry = this.tryEntries[i];
773
- if (entry.finallyLoc === finallyLoc) {
774
- this.complete(entry.completion, entry.afterLoc);
775
- resetTryEntry(entry);
720
+ if (finallyEntry) {
721
+ this.method = "next";
722
+ this.next = finallyEntry.finallyLoc;
776
723
  return ContinueSentinel;
777
724
  }
778
- }
779
- },
780
725
 
781
- "catch": function(tryLoc) {
782
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
783
- var entry = this.tryEntries[i];
784
- if (entry.tryLoc === tryLoc) {
785
- var record = entry.completion;
786
- if (record.type === "throw") {
787
- var thrown = record.arg;
726
+ return this.complete(record);
727
+ },
728
+ complete: function complete(record, afterLoc) {
729
+ if (record.type === "throw") {
730
+ throw record.arg;
731
+ }
732
+
733
+ if (record.type === "break" || record.type === "continue") {
734
+ this.next = record.arg;
735
+ } else if (record.type === "return") {
736
+ this.rval = this.arg = record.arg;
737
+ this.method = "return";
738
+ this.next = "end";
739
+ } else if (record.type === "normal" && afterLoc) {
740
+ this.next = afterLoc;
741
+ }
742
+
743
+ return ContinueSentinel;
744
+ },
745
+ finish: function finish(finallyLoc) {
746
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
747
+ var entry = this.tryEntries[i];
748
+
749
+ if (entry.finallyLoc === finallyLoc) {
750
+ this.complete(entry.completion, entry.afterLoc);
788
751
  resetTryEntry(entry);
752
+ return ContinueSentinel;
789
753
  }
790
- return thrown;
791
754
  }
792
- }
755
+ },
756
+ "catch": function _catch(tryLoc) {
757
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
758
+ var entry = this.tryEntries[i];
793
759
 
794
- // The context.catch method must only be called with a location
795
- // argument that corresponds to a known catch block.
796
- throw new Error("illegal catch attempt");
797
- },
760
+ if (entry.tryLoc === tryLoc) {
761
+ var record = entry.completion;
798
762
 
799
- delegateYield: function(iterable, resultName, nextLoc) {
800
- this.delegate = {
801
- iterator: values(iterable),
802
- resultName: resultName,
803
- nextLoc: nextLoc
804
- };
763
+ if (record.type === "throw") {
764
+ var thrown = record.arg;
765
+ resetTryEntry(entry);
766
+ }
805
767
 
806
- if (this.method === "next") {
807
- // Deliberately forget the last sent value so that we don't
808
- // accidentally pass it on to the delegate.
809
- this.arg = undefined$1;
810
- }
768
+ return thrown;
769
+ }
770
+ } // The context.catch method must only be called with a location
771
+ // argument that corresponds to a known catch block.
811
772
 
812
- return ContinueSentinel;
813
- }
814
- };
815
773
 
816
- // Regardless of whether this script is executing as a CommonJS module
817
- // or not, return the runtime object so that we can declare the variable
818
- // regeneratorRuntime in the outer scope, which allows this module to be
819
- // injected easily by `bin/regenerator --include-runtime script.js`.
820
- return exports;
774
+ throw new Error("illegal catch attempt");
775
+ },
776
+ delegateYield: function delegateYield(iterable, resultName, nextLoc) {
777
+ this.delegate = {
778
+ iterator: values(iterable),
779
+ resultName: resultName,
780
+ nextLoc: nextLoc
781
+ };
782
+
783
+ if (this.method === "next") {
784
+ // Deliberately forget the last sent value so that we don't
785
+ // accidentally pass it on to the delegate.
786
+ this.arg = undefined$1;
787
+ }
788
+
789
+ return ContinueSentinel;
790
+ }
791
+ }; // Regardless of whether this script is executing as a CommonJS module
792
+ // or not, return the runtime object so that we can declare the variable
793
+ // regeneratorRuntime in the outer scope, which allows this module to be
794
+ // injected easily by `bin/regenerator --include-runtime script.js`.
821
795
 
822
- }(
823
- // If this script is executing as a CommonJS module, use module.exports
796
+ return exports;
797
+ }( // If this script is executing as a CommonJS module, use module.exports
824
798
  // as the regeneratorRuntime namespace. Otherwise create a new empty
825
799
  // object. Either way, the resulting object will be used to initialize
826
800
  // the regeneratorRuntime variable at the top of this file.
827
- module.exports
828
- ));
829
-
830
- try {
831
- regeneratorRuntime = runtime;
832
- } catch (accidentalStrictMode) {
833
- // This module should not be running in strict mode, so the above
834
- // assignment should always work unless something is misconfigured. Just
835
- // in case runtime.js accidentally runs in strict mode, in modern engines
836
- // we can explicitly access globalThis. In older engines we can escape
837
- // strict mode using a global Function call. This could conceivably fail
838
- // if a Content Security Policy forbids using Function, but in that case
839
- // the proper solution is to fix the accidental strict mode problem. If
840
- // you've misconfigured your bundler to force strict mode and applied a
841
- // CSP to forbid Function, and you're not willing to fix either of those
842
- // problems, please detail your unique predicament in a GitHub issue.
843
- if (typeof globalThis === "object") {
844
- globalThis.regeneratorRuntime = runtime;
845
- } else {
801
+ module.exports );
802
+
803
+ try {
804
+ regeneratorRuntime = runtime;
805
+ } catch (accidentalStrictMode) {
806
+ // This module should not be running in strict mode, so the above
807
+ // assignment should always work unless something is misconfigured. Just
808
+ // in case runtime.js accidentally runs in strict mode, we can escape
809
+ // strict mode using a global Function call. This could conceivably fail
810
+ // if a Content Security Policy forbids using Function, but in that case
811
+ // the proper solution is to fix the accidental strict mode problem. If
812
+ // you've misconfigured your bundler to force strict mode and applied a
813
+ // CSP to forbid Function, and you're not willing to fix either of those
814
+ // problems, please detail your unique predicament in a GitHub issue.
846
815
  Function("r", "regeneratorRuntime = r")(runtime);
847
816
  }
848
- }
849
817
  });
850
818
 
851
819
  function getError(errors, status) {