@plasmicpkgs/commerce-local 0.0.1 → 0.0.6

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