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