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