@freelog/tools-lib 0.1.91 → 0.1.94
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 +20 -20
- package/README.md +103 -103
- package/dist/service-API/activities.d.ts +12 -0
- package/dist/service-API/testQualifications.d.ts +11 -0
- package/dist/tools-lib.cjs.development.js +281 -675
- package/dist/tools-lib.cjs.development.js.map +1 -1
- package/dist/tools-lib.cjs.production.min.js +1 -1
- package/dist/tools-lib.cjs.production.min.js.map +1 -1
- package/dist/tools-lib.esm.js +281 -675
- package/dist/tools-lib.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +7 -7
- package/src/service-API/activities.ts +32 -0
- package/src/service-API/captcha.ts +30 -30
- package/src/service-API/collections.ts +81 -81
- package/src/service-API/contracts.ts +84 -84
- package/src/service-API/events.ts +18 -18
- package/src/service-API/nodes.ts +65 -65
- package/src/service-API/policies.ts +39 -39
- package/src/service-API/presentables.ts +282 -282
- package/src/service-API/storages.ts +345 -345
- package/src/service-API/testQualifications.ts +31 -0
- package/src/service-API/transactions.ts +109 -109
- package/src/service-API/user.ts +188 -188
- package/src/utils/axios.ts +142 -142
- package/src/utils/format.ts +89 -89
- package/src/utils/index.ts +18 -18
- package/src/utils/predefined.ts +37 -37
- package/src/utils/regexp.ts +52 -52
- package/src/utils/tools.ts +72 -72
package/dist/tools-lib.esm.js
CHANGED
|
@@ -6,832 +6,422 @@ import NProgress from 'nprogress';
|
|
|
6
6
|
import 'nprogress/nprogress.css';
|
|
7
7
|
import { lib, SHA1 } from 'crypto-js';
|
|
8
8
|
|
|
9
|
-
function
|
|
10
|
-
|
|
11
|
-
var info = gen[key](arg);
|
|
12
|
-
var value = info.value;
|
|
13
|
-
} catch (error) {
|
|
14
|
-
reject(error);
|
|
15
|
-
return;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
if (info.done) {
|
|
19
|
-
resolve(value);
|
|
20
|
-
} else {
|
|
21
|
-
Promise.resolve(value).then(_next, _throw);
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
function _asyncToGenerator(fn) {
|
|
26
|
-
return function () {
|
|
27
|
-
var self = this,
|
|
28
|
-
args = arguments;
|
|
29
|
-
return new Promise(function (resolve, reject) {
|
|
30
|
-
var gen = fn.apply(self, args);
|
|
31
|
-
|
|
32
|
-
function _next(value) {
|
|
33
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
function _throw(err) {
|
|
37
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
38
|
-
}
|
|
9
|
+
function _regeneratorRuntime() {
|
|
10
|
+
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
|
39
11
|
|
|
40
|
-
|
|
41
|
-
|
|
12
|
+
_regeneratorRuntime = function () {
|
|
13
|
+
return exports;
|
|
42
14
|
};
|
|
43
|
-
}
|
|
44
15
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
target[key] = source[key];
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
return target;
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
return _extends.apply(this, arguments);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
function _objectDestructuringEmpty(obj) {
|
|
64
|
-
if (obj == null) throw new TypeError("Cannot destructure undefined");
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
68
|
-
if (source == null) return {};
|
|
69
|
-
var target = {};
|
|
70
|
-
var sourceKeys = Object.keys(source);
|
|
71
|
-
var key, i;
|
|
72
|
-
|
|
73
|
-
for (i = 0; i < sourceKeys.length; i++) {
|
|
74
|
-
key = sourceKeys[i];
|
|
75
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
76
|
-
target[key] = source[key];
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
return target;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
function createCommonjsModule(fn, module) {
|
|
83
|
-
return module = { exports: {} }, fn(module, module.exports), module.exports;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
var runtime_1 = createCommonjsModule(function (module) {
|
|
87
|
-
/**
|
|
88
|
-
* Copyright (c) 2014-present, Facebook, Inc.
|
|
89
|
-
*
|
|
90
|
-
* This source code is licensed under the MIT license found in the
|
|
91
|
-
* LICENSE file in the root directory of this source tree.
|
|
92
|
-
*/
|
|
93
|
-
|
|
94
|
-
var runtime = (function (exports) {
|
|
95
|
-
|
|
96
|
-
var Op = Object.prototype;
|
|
97
|
-
var hasOwn = Op.hasOwnProperty;
|
|
98
|
-
var undefined$1; // More compressible than void 0.
|
|
99
|
-
var $Symbol = typeof Symbol === "function" ? Symbol : {};
|
|
100
|
-
var iteratorSymbol = $Symbol.iterator || "@@iterator";
|
|
101
|
-
var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
|
|
102
|
-
var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
|
|
16
|
+
var exports = {},
|
|
17
|
+
Op = Object.prototype,
|
|
18
|
+
hasOwn = Op.hasOwnProperty,
|
|
19
|
+
$Symbol = "function" == typeof Symbol ? Symbol : {},
|
|
20
|
+
iteratorSymbol = $Symbol.iterator || "@@iterator",
|
|
21
|
+
asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
|
|
22
|
+
toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
|
|
103
23
|
|
|
104
24
|
function define(obj, key, value) {
|
|
105
|
-
Object.defineProperty(obj, key, {
|
|
25
|
+
return Object.defineProperty(obj, key, {
|
|
106
26
|
value: value,
|
|
107
|
-
enumerable:
|
|
108
|
-
configurable:
|
|
109
|
-
writable:
|
|
110
|
-
});
|
|
111
|
-
return obj[key];
|
|
27
|
+
enumerable: !0,
|
|
28
|
+
configurable: !0,
|
|
29
|
+
writable: !0
|
|
30
|
+
}), obj[key];
|
|
112
31
|
}
|
|
32
|
+
|
|
113
33
|
try {
|
|
114
|
-
// IE 8 has a broken Object.defineProperty that only works on DOM objects.
|
|
115
34
|
define({}, "");
|
|
116
35
|
} catch (err) {
|
|
117
|
-
define = function(obj, key, value) {
|
|
36
|
+
define = function (obj, key, value) {
|
|
118
37
|
return obj[key] = value;
|
|
119
38
|
};
|
|
120
39
|
}
|
|
121
40
|
|
|
122
41
|
function wrap(innerFn, outerFn, self, tryLocsList) {
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
42
|
+
var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
|
|
43
|
+
generator = Object.create(protoGenerator.prototype),
|
|
44
|
+
context = new Context(tryLocsList || []);
|
|
45
|
+
return generator._invoke = function (innerFn, self, context) {
|
|
46
|
+
var state = "suspendedStart";
|
|
47
|
+
return function (method, arg) {
|
|
48
|
+
if ("executing" === state) throw new Error("Generator is already running");
|
|
49
|
+
|
|
50
|
+
if ("completed" === state) {
|
|
51
|
+
if ("throw" === method) throw arg;
|
|
52
|
+
return doneResult();
|
|
53
|
+
}
|
|
127
54
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
generator._invoke = makeInvokeMethod(innerFn, self, context);
|
|
55
|
+
for (context.method = method, context.arg = arg;;) {
|
|
56
|
+
var delegate = context.delegate;
|
|
131
57
|
|
|
132
|
-
|
|
58
|
+
if (delegate) {
|
|
59
|
+
var delegateResult = maybeInvokeDelegate(delegate, context);
|
|
60
|
+
|
|
61
|
+
if (delegateResult) {
|
|
62
|
+
if (delegateResult === ContinueSentinel) continue;
|
|
63
|
+
return delegateResult;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
|
|
68
|
+
if ("suspendedStart" === state) throw state = "completed", context.arg;
|
|
69
|
+
context.dispatchException(context.arg);
|
|
70
|
+
} else "return" === context.method && context.abrupt("return", context.arg);
|
|
71
|
+
state = "executing";
|
|
72
|
+
var record = tryCatch(innerFn, self, context);
|
|
73
|
+
|
|
74
|
+
if ("normal" === record.type) {
|
|
75
|
+
if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
|
|
76
|
+
return {
|
|
77
|
+
value: record.arg,
|
|
78
|
+
done: context.done
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
"throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
}(innerFn, self, context), generator;
|
|
133
86
|
}
|
|
134
|
-
exports.wrap = wrap;
|
|
135
87
|
|
|
136
|
-
// Try/catch helper to minimize deoptimizations. Returns a completion
|
|
137
|
-
// record like context.tryEntries[i].completion. This interface could
|
|
138
|
-
// have been (and was previously) designed to take a closure to be
|
|
139
|
-
// invoked without arguments, but in all the cases we care about we
|
|
140
|
-
// already have an existing method we want to call, so there's no need
|
|
141
|
-
// to create a new function object. We can even get away with assuming
|
|
142
|
-
// the method takes exactly one argument, since that happens to be true
|
|
143
|
-
// in every case, so we don't have to touch the arguments object. The
|
|
144
|
-
// only additional allocation required is the completion record, which
|
|
145
|
-
// has a stable shape and so hopefully should be cheap to allocate.
|
|
146
88
|
function tryCatch(fn, obj, arg) {
|
|
147
89
|
try {
|
|
148
|
-
return {
|
|
90
|
+
return {
|
|
91
|
+
type: "normal",
|
|
92
|
+
arg: fn.call(obj, arg)
|
|
93
|
+
};
|
|
149
94
|
} catch (err) {
|
|
150
|
-
return {
|
|
95
|
+
return {
|
|
96
|
+
type: "throw",
|
|
97
|
+
arg: err
|
|
98
|
+
};
|
|
151
99
|
}
|
|
152
100
|
}
|
|
153
101
|
|
|
154
|
-
|
|
155
|
-
var GenStateSuspendedYield = "suspendedYield";
|
|
156
|
-
var GenStateExecuting = "executing";
|
|
157
|
-
var GenStateCompleted = "completed";
|
|
158
|
-
|
|
159
|
-
// Returning this object from the innerFn has the same effect as
|
|
160
|
-
// breaking out of the dispatch switch statement.
|
|
102
|
+
exports.wrap = wrap;
|
|
161
103
|
var ContinueSentinel = {};
|
|
162
104
|
|
|
163
|
-
// Dummy constructor functions that we use as the .constructor and
|
|
164
|
-
// .constructor.prototype properties for functions that return Generator
|
|
165
|
-
// objects. For full spec compliance, you may wish to configure your
|
|
166
|
-
// minifier not to mangle the names of these two functions.
|
|
167
105
|
function Generator() {}
|
|
106
|
+
|
|
168
107
|
function GeneratorFunction() {}
|
|
108
|
+
|
|
169
109
|
function GeneratorFunctionPrototype() {}
|
|
170
110
|
|
|
171
|
-
// This is a polyfill for %IteratorPrototype% for environments that
|
|
172
|
-
// don't natively support it.
|
|
173
111
|
var IteratorPrototype = {};
|
|
174
|
-
IteratorPrototype
|
|
112
|
+
define(IteratorPrototype, iteratorSymbol, function () {
|
|
175
113
|
return this;
|
|
176
|
-
};
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
NativeIteratorPrototype !== Op &&
|
|
182
|
-
hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
|
|
183
|
-
// This environment has a native %IteratorPrototype%; use it instead
|
|
184
|
-
// of the polyfill.
|
|
185
|
-
IteratorPrototype = NativeIteratorPrototype;
|
|
186
|
-
}
|
|
114
|
+
});
|
|
115
|
+
var getProto = Object.getPrototypeOf,
|
|
116
|
+
NativeIteratorPrototype = getProto && getProto(getProto(values([])));
|
|
117
|
+
NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
|
|
118
|
+
var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
|
|
187
119
|
|
|
188
|
-
var Gp = GeneratorFunctionPrototype.prototype =
|
|
189
|
-
Generator.prototype = Object.create(IteratorPrototype);
|
|
190
|
-
GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
|
|
191
|
-
GeneratorFunctionPrototype.constructor = GeneratorFunction;
|
|
192
|
-
GeneratorFunction.displayName = define(
|
|
193
|
-
GeneratorFunctionPrototype,
|
|
194
|
-
toStringTagSymbol,
|
|
195
|
-
"GeneratorFunction"
|
|
196
|
-
);
|
|
197
|
-
|
|
198
|
-
// Helper for defining the .next, .throw, and .return methods of the
|
|
199
|
-
// Iterator interface in terms of a single ._invoke method.
|
|
200
120
|
function defineIteratorMethods(prototype) {
|
|
201
|
-
["next", "throw", "return"].forEach(function(method) {
|
|
202
|
-
define(prototype, method, function(arg) {
|
|
121
|
+
["next", "throw", "return"].forEach(function (method) {
|
|
122
|
+
define(prototype, method, function (arg) {
|
|
203
123
|
return this._invoke(method, arg);
|
|
204
124
|
});
|
|
205
125
|
});
|
|
206
126
|
}
|
|
207
127
|
|
|
208
|
-
exports.isGeneratorFunction = function(genFun) {
|
|
209
|
-
var ctor = typeof genFun === "function" && genFun.constructor;
|
|
210
|
-
return ctor
|
|
211
|
-
? ctor === GeneratorFunction ||
|
|
212
|
-
// For the native GeneratorFunction constructor, the best we can
|
|
213
|
-
// do is to check its .name property.
|
|
214
|
-
(ctor.displayName || ctor.name) === "GeneratorFunction"
|
|
215
|
-
: false;
|
|
216
|
-
};
|
|
217
|
-
|
|
218
|
-
exports.mark = function(genFun) {
|
|
219
|
-
if (Object.setPrototypeOf) {
|
|
220
|
-
Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
|
|
221
|
-
} else {
|
|
222
|
-
genFun.__proto__ = GeneratorFunctionPrototype;
|
|
223
|
-
define(genFun, toStringTagSymbol, "GeneratorFunction");
|
|
224
|
-
}
|
|
225
|
-
genFun.prototype = Object.create(Gp);
|
|
226
|
-
return genFun;
|
|
227
|
-
};
|
|
228
|
-
|
|
229
|
-
// Within the body of any async function, `await x` is transformed to
|
|
230
|
-
// `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
|
|
231
|
-
// `hasOwn.call(value, "__await")` to determine if the yielded value is
|
|
232
|
-
// meant to be awaited.
|
|
233
|
-
exports.awrap = function(arg) {
|
|
234
|
-
return { __await: arg };
|
|
235
|
-
};
|
|
236
|
-
|
|
237
128
|
function AsyncIterator(generator, PromiseImpl) {
|
|
238
129
|
function invoke(method, arg, resolve, reject) {
|
|
239
130
|
var record = tryCatch(generator[method], generator, arg);
|
|
240
|
-
if (record.type === "throw") {
|
|
241
|
-
reject(record.arg);
|
|
242
|
-
} else {
|
|
243
|
-
var result = record.arg;
|
|
244
|
-
var value = result.value;
|
|
245
|
-
if (value &&
|
|
246
|
-
typeof value === "object" &&
|
|
247
|
-
hasOwn.call(value, "__await")) {
|
|
248
|
-
return PromiseImpl.resolve(value.__await).then(function(value) {
|
|
249
|
-
invoke("next", value, resolve, reject);
|
|
250
|
-
}, function(err) {
|
|
251
|
-
invoke("throw", err, resolve, reject);
|
|
252
|
-
});
|
|
253
|
-
}
|
|
254
131
|
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
132
|
+
if ("throw" !== record.type) {
|
|
133
|
+
var result = record.arg,
|
|
134
|
+
value = result.value;
|
|
135
|
+
return value && "object" == typeof value && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
|
|
136
|
+
invoke("next", value, resolve, reject);
|
|
137
|
+
}, function (err) {
|
|
138
|
+
invoke("throw", err, resolve, reject);
|
|
139
|
+
}) : PromiseImpl.resolve(value).then(function (unwrapped) {
|
|
140
|
+
result.value = unwrapped, resolve(result);
|
|
141
|
+
}, function (error) {
|
|
264
142
|
return invoke("throw", error, resolve, reject);
|
|
265
143
|
});
|
|
266
144
|
}
|
|
145
|
+
|
|
146
|
+
reject(record.arg);
|
|
267
147
|
}
|
|
268
148
|
|
|
269
149
|
var previousPromise;
|
|
270
150
|
|
|
271
|
-
function
|
|
151
|
+
this._invoke = function (method, arg) {
|
|
272
152
|
function callInvokeWithMethodAndArg() {
|
|
273
|
-
return new PromiseImpl(function(resolve, reject) {
|
|
153
|
+
return new PromiseImpl(function (resolve, reject) {
|
|
274
154
|
invoke(method, arg, resolve, reject);
|
|
275
155
|
});
|
|
276
156
|
}
|
|
277
157
|
|
|
278
|
-
return previousPromise =
|
|
279
|
-
// If enqueue has been called before, then we want to wait until
|
|
280
|
-
// all previous Promises have been resolved before calling invoke,
|
|
281
|
-
// so that results are always delivered in the correct order. If
|
|
282
|
-
// enqueue has not been called before, then it is important to
|
|
283
|
-
// call invoke immediately, without waiting on a callback to fire,
|
|
284
|
-
// so that the async generator function has the opportunity to do
|
|
285
|
-
// any necessary setup in a predictable way. This predictability
|
|
286
|
-
// is why the Promise constructor synchronously invokes its
|
|
287
|
-
// executor callback, and why async functions synchronously
|
|
288
|
-
// execute code before the first await. Since we implement simple
|
|
289
|
-
// async functions in terms of async generators, it is especially
|
|
290
|
-
// important to get this right, even though it requires care.
|
|
291
|
-
previousPromise ? previousPromise.then(
|
|
292
|
-
callInvokeWithMethodAndArg,
|
|
293
|
-
// Avoid propagating failures to Promises returned by later
|
|
294
|
-
// invocations of the iterator.
|
|
295
|
-
callInvokeWithMethodAndArg
|
|
296
|
-
) : callInvokeWithMethodAndArg();
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
// Define the unified helper method that is used to implement .next,
|
|
300
|
-
// .throw, and .return (see defineIteratorMethods).
|
|
301
|
-
this._invoke = enqueue;
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
defineIteratorMethods(AsyncIterator.prototype);
|
|
305
|
-
AsyncIterator.prototype[asyncIteratorSymbol] = function () {
|
|
306
|
-
return this;
|
|
307
|
-
};
|
|
308
|
-
exports.AsyncIterator = AsyncIterator;
|
|
309
|
-
|
|
310
|
-
// Note that simple async functions are implemented on top of
|
|
311
|
-
// AsyncIterator objects; they just return a Promise for the value of
|
|
312
|
-
// the final result produced by the iterator.
|
|
313
|
-
exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {
|
|
314
|
-
if (PromiseImpl === void 0) PromiseImpl = Promise;
|
|
315
|
-
|
|
316
|
-
var iter = new AsyncIterator(
|
|
317
|
-
wrap(innerFn, outerFn, self, tryLocsList),
|
|
318
|
-
PromiseImpl
|
|
319
|
-
);
|
|
320
|
-
|
|
321
|
-
return exports.isGeneratorFunction(outerFn)
|
|
322
|
-
? iter // If outerFn is a generator, return the full iterator.
|
|
323
|
-
: iter.next().then(function(result) {
|
|
324
|
-
return result.done ? result.value : iter.next();
|
|
325
|
-
});
|
|
326
|
-
};
|
|
327
|
-
|
|
328
|
-
function makeInvokeMethod(innerFn, self, context) {
|
|
329
|
-
var state = GenStateSuspendedStart;
|
|
330
|
-
|
|
331
|
-
return function invoke(method, arg) {
|
|
332
|
-
if (state === GenStateExecuting) {
|
|
333
|
-
throw new Error("Generator is already running");
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
if (state === GenStateCompleted) {
|
|
337
|
-
if (method === "throw") {
|
|
338
|
-
throw arg;
|
|
339
|
-
}
|
|
340
|
-
|
|
341
|
-
// Be forgiving, per 25.3.3.3.3 of the spec:
|
|
342
|
-
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
|
|
343
|
-
return doneResult();
|
|
344
|
-
}
|
|
345
|
-
|
|
346
|
-
context.method = method;
|
|
347
|
-
context.arg = arg;
|
|
348
|
-
|
|
349
|
-
while (true) {
|
|
350
|
-
var delegate = context.delegate;
|
|
351
|
-
if (delegate) {
|
|
352
|
-
var delegateResult = maybeInvokeDelegate(delegate, context);
|
|
353
|
-
if (delegateResult) {
|
|
354
|
-
if (delegateResult === ContinueSentinel) continue;
|
|
355
|
-
return delegateResult;
|
|
356
|
-
}
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
if (context.method === "next") {
|
|
360
|
-
// Setting context._sent for legacy support of Babel's
|
|
361
|
-
// function.sent implementation.
|
|
362
|
-
context.sent = context._sent = context.arg;
|
|
363
|
-
|
|
364
|
-
} else if (context.method === "throw") {
|
|
365
|
-
if (state === GenStateSuspendedStart) {
|
|
366
|
-
state = GenStateCompleted;
|
|
367
|
-
throw context.arg;
|
|
368
|
-
}
|
|
369
|
-
|
|
370
|
-
context.dispatchException(context.arg);
|
|
371
|
-
|
|
372
|
-
} else if (context.method === "return") {
|
|
373
|
-
context.abrupt("return", context.arg);
|
|
374
|
-
}
|
|
375
|
-
|
|
376
|
-
state = GenStateExecuting;
|
|
377
|
-
|
|
378
|
-
var record = tryCatch(innerFn, self, context);
|
|
379
|
-
if (record.type === "normal") {
|
|
380
|
-
// If an exception is thrown from innerFn, we leave state ===
|
|
381
|
-
// GenStateExecuting and loop back for another invocation.
|
|
382
|
-
state = context.done
|
|
383
|
-
? GenStateCompleted
|
|
384
|
-
: GenStateSuspendedYield;
|
|
385
|
-
|
|
386
|
-
if (record.arg === ContinueSentinel) {
|
|
387
|
-
continue;
|
|
388
|
-
}
|
|
389
|
-
|
|
390
|
-
return {
|
|
391
|
-
value: record.arg,
|
|
392
|
-
done: context.done
|
|
393
|
-
};
|
|
394
|
-
|
|
395
|
-
} else if (record.type === "throw") {
|
|
396
|
-
state = GenStateCompleted;
|
|
397
|
-
// Dispatch the exception by looping back around to the
|
|
398
|
-
// context.dispatchException(context.arg) call above.
|
|
399
|
-
context.method = "throw";
|
|
400
|
-
context.arg = record.arg;
|
|
401
|
-
}
|
|
402
|
-
}
|
|
158
|
+
return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
|
|
403
159
|
};
|
|
404
160
|
}
|
|
405
161
|
|
|
406
|
-
// Call delegate.iterator[context.method](context.arg) and handle the
|
|
407
|
-
// result, either by returning a { value, done } result from the
|
|
408
|
-
// delegate iterator, or by modifying context.method and context.arg,
|
|
409
|
-
// setting context.delegate to null, and returning the ContinueSentinel.
|
|
410
162
|
function maybeInvokeDelegate(delegate, context) {
|
|
411
163
|
var method = delegate.iterator[context.method];
|
|
412
|
-
if (method === undefined$1) {
|
|
413
|
-
// A .throw or .return when the delegate iterator has no .throw
|
|
414
|
-
// method always terminates the yield* loop.
|
|
415
|
-
context.delegate = null;
|
|
416
|
-
|
|
417
|
-
if (context.method === "throw") {
|
|
418
|
-
// Note: ["return"] must be used for ES3 parsing compatibility.
|
|
419
|
-
if (delegate.iterator["return"]) {
|
|
420
|
-
// If the delegate iterator has a return method, give it a
|
|
421
|
-
// chance to clean up.
|
|
422
|
-
context.method = "return";
|
|
423
|
-
context.arg = undefined$1;
|
|
424
|
-
maybeInvokeDelegate(delegate, context);
|
|
425
|
-
|
|
426
|
-
if (context.method === "throw") {
|
|
427
|
-
// If maybeInvokeDelegate(context) changed context.method from
|
|
428
|
-
// "return" to "throw", let that override the TypeError below.
|
|
429
|
-
return ContinueSentinel;
|
|
430
|
-
}
|
|
431
|
-
}
|
|
432
164
|
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
165
|
+
if (undefined === method) {
|
|
166
|
+
if (context.delegate = null, "throw" === context.method) {
|
|
167
|
+
if (delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel;
|
|
168
|
+
context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method");
|
|
436
169
|
}
|
|
437
170
|
|
|
438
171
|
return ContinueSentinel;
|
|
439
172
|
}
|
|
440
173
|
|
|
441
174
|
var record = tryCatch(method, delegate.iterator, context.arg);
|
|
442
|
-
|
|
443
|
-
if (record.type === "throw") {
|
|
444
|
-
context.method = "throw";
|
|
445
|
-
context.arg = record.arg;
|
|
446
|
-
context.delegate = null;
|
|
447
|
-
return ContinueSentinel;
|
|
448
|
-
}
|
|
449
|
-
|
|
175
|
+
if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
|
|
450
176
|
var info = record.arg;
|
|
451
|
-
|
|
452
|
-
if (! info) {
|
|
453
|
-
context.method = "throw";
|
|
454
|
-
context.arg = new TypeError("iterator result is not an object");
|
|
455
|
-
context.delegate = null;
|
|
456
|
-
return ContinueSentinel;
|
|
457
|
-
}
|
|
458
|
-
|
|
459
|
-
if (info.done) {
|
|
460
|
-
// Assign the result of the finished delegate to the temporary
|
|
461
|
-
// variable specified by delegate.resultName (see delegateYield).
|
|
462
|
-
context[delegate.resultName] = info.value;
|
|
463
|
-
|
|
464
|
-
// Resume execution at the desired location (see delegateYield).
|
|
465
|
-
context.next = delegate.nextLoc;
|
|
466
|
-
|
|
467
|
-
// If context.method was "throw" but the delegate handled the
|
|
468
|
-
// exception, let the outer generator proceed normally. If
|
|
469
|
-
// context.method was "next", forget context.arg since it has been
|
|
470
|
-
// "consumed" by the delegate iterator. If context.method was
|
|
471
|
-
// "return", allow the original .return call to continue in the
|
|
472
|
-
// outer generator.
|
|
473
|
-
if (context.method !== "return") {
|
|
474
|
-
context.method = "next";
|
|
475
|
-
context.arg = undefined$1;
|
|
476
|
-
}
|
|
477
|
-
|
|
478
|
-
} else {
|
|
479
|
-
// Re-yield the result returned by the delegate method.
|
|
480
|
-
return info;
|
|
481
|
-
}
|
|
482
|
-
|
|
483
|
-
// The delegate iterator is finished, so forget it and continue with
|
|
484
|
-
// the outer generator.
|
|
485
|
-
context.delegate = null;
|
|
486
|
-
return ContinueSentinel;
|
|
177
|
+
return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
|
|
487
178
|
}
|
|
488
179
|
|
|
489
|
-
// Define Generator.prototype.{next,throw,return} in terms of the
|
|
490
|
-
// unified ._invoke helper method.
|
|
491
|
-
defineIteratorMethods(Gp);
|
|
492
|
-
|
|
493
|
-
define(Gp, toStringTagSymbol, "Generator");
|
|
494
|
-
|
|
495
|
-
// A Generator should always return itself as the iterator object when the
|
|
496
|
-
// @@iterator function is called on it. Some browsers' implementations of the
|
|
497
|
-
// iterator prototype chain incorrectly implement this, causing the Generator
|
|
498
|
-
// object to not be returned from this call. This ensures that doesn't happen.
|
|
499
|
-
// See https://github.com/facebook/regenerator/issues/274 for more details.
|
|
500
|
-
Gp[iteratorSymbol] = function() {
|
|
501
|
-
return this;
|
|
502
|
-
};
|
|
503
|
-
|
|
504
|
-
Gp.toString = function() {
|
|
505
|
-
return "[object Generator]";
|
|
506
|
-
};
|
|
507
|
-
|
|
508
180
|
function pushTryEntry(locs) {
|
|
509
|
-
var entry = {
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
}
|
|
514
|
-
|
|
515
|
-
if (2 in locs) {
|
|
516
|
-
entry.finallyLoc = locs[2];
|
|
517
|
-
entry.afterLoc = locs[3];
|
|
518
|
-
}
|
|
519
|
-
|
|
520
|
-
this.tryEntries.push(entry);
|
|
181
|
+
var entry = {
|
|
182
|
+
tryLoc: locs[0]
|
|
183
|
+
};
|
|
184
|
+
1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
|
|
521
185
|
}
|
|
522
186
|
|
|
523
187
|
function resetTryEntry(entry) {
|
|
524
188
|
var record = entry.completion || {};
|
|
525
|
-
record.type = "normal";
|
|
526
|
-
delete record.arg;
|
|
527
|
-
entry.completion = record;
|
|
189
|
+
record.type = "normal", delete record.arg, entry.completion = record;
|
|
528
190
|
}
|
|
529
191
|
|
|
530
192
|
function Context(tryLocsList) {
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
this.tryEntries = [{ tryLoc: "root" }];
|
|
535
|
-
tryLocsList.forEach(pushTryEntry, this);
|
|
536
|
-
this.reset(true);
|
|
193
|
+
this.tryEntries = [{
|
|
194
|
+
tryLoc: "root"
|
|
195
|
+
}], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
|
|
537
196
|
}
|
|
538
197
|
|
|
539
|
-
exports.keys = function(object) {
|
|
540
|
-
var keys = [];
|
|
541
|
-
for (var key in object) {
|
|
542
|
-
keys.push(key);
|
|
543
|
-
}
|
|
544
|
-
keys.reverse();
|
|
545
|
-
|
|
546
|
-
// Rather than returning an object with a next method, we keep
|
|
547
|
-
// things simple and return the next function itself.
|
|
548
|
-
return function next() {
|
|
549
|
-
while (keys.length) {
|
|
550
|
-
var key = keys.pop();
|
|
551
|
-
if (key in object) {
|
|
552
|
-
next.value = key;
|
|
553
|
-
next.done = false;
|
|
554
|
-
return next;
|
|
555
|
-
}
|
|
556
|
-
}
|
|
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.
|
|
561
|
-
next.done = true;
|
|
562
|
-
return next;
|
|
563
|
-
};
|
|
564
|
-
};
|
|
565
|
-
|
|
566
198
|
function values(iterable) {
|
|
567
199
|
if (iterable) {
|
|
568
200
|
var iteratorMethod = iterable[iteratorSymbol];
|
|
569
|
-
if (iteratorMethod)
|
|
570
|
-
|
|
571
|
-
}
|
|
572
|
-
|
|
573
|
-
if (typeof iterable.next === "function") {
|
|
574
|
-
return iterable;
|
|
575
|
-
}
|
|
201
|
+
if (iteratorMethod) return iteratorMethod.call(iterable);
|
|
202
|
+
if ("function" == typeof iterable.next) return iterable;
|
|
576
203
|
|
|
577
204
|
if (!isNaN(iterable.length)) {
|
|
578
|
-
var i = -1,
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
next.value = iterable[i];
|
|
582
|
-
next.done = false;
|
|
583
|
-
return next;
|
|
584
|
-
}
|
|
585
|
-
}
|
|
586
|
-
|
|
587
|
-
next.value = undefined$1;
|
|
588
|
-
next.done = true;
|
|
205
|
+
var i = -1,
|
|
206
|
+
next = function next() {
|
|
207
|
+
for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
|
|
589
208
|
|
|
590
|
-
return next;
|
|
209
|
+
return next.value = undefined, next.done = !0, next;
|
|
591
210
|
};
|
|
592
211
|
|
|
593
212
|
return next.next = next;
|
|
594
213
|
}
|
|
595
214
|
}
|
|
596
215
|
|
|
597
|
-
|
|
598
|
-
|
|
216
|
+
return {
|
|
217
|
+
next: doneResult
|
|
218
|
+
};
|
|
599
219
|
}
|
|
600
|
-
exports.values = values;
|
|
601
220
|
|
|
602
221
|
function doneResult() {
|
|
603
|
-
return {
|
|
222
|
+
return {
|
|
223
|
+
value: undefined,
|
|
224
|
+
done: !0
|
|
225
|
+
};
|
|
604
226
|
}
|
|
605
227
|
|
|
606
|
-
|
|
607
|
-
constructor
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
this[name] = undefined$1;
|
|
630
|
-
}
|
|
631
|
-
}
|
|
632
|
-
}
|
|
633
|
-
},
|
|
228
|
+
return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
|
|
229
|
+
var ctor = "function" == typeof genFun && genFun.constructor;
|
|
230
|
+
return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
|
|
231
|
+
}, exports.mark = function (genFun) {
|
|
232
|
+
return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
|
|
233
|
+
}, exports.awrap = function (arg) {
|
|
234
|
+
return {
|
|
235
|
+
__await: arg
|
|
236
|
+
};
|
|
237
|
+
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
|
|
238
|
+
return this;
|
|
239
|
+
}), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
|
|
240
|
+
void 0 === PromiseImpl && (PromiseImpl = Promise);
|
|
241
|
+
var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
|
|
242
|
+
return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
|
|
243
|
+
return result.done ? result.value : iter.next();
|
|
244
|
+
});
|
|
245
|
+
}, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
|
|
246
|
+
return this;
|
|
247
|
+
}), define(Gp, "toString", function () {
|
|
248
|
+
return "[object Generator]";
|
|
249
|
+
}), exports.keys = function (object) {
|
|
250
|
+
var keys = [];
|
|
634
251
|
|
|
635
|
-
|
|
636
|
-
this.done = true;
|
|
252
|
+
for (var key in object) keys.push(key);
|
|
637
253
|
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
254
|
+
return keys.reverse(), function next() {
|
|
255
|
+
for (; keys.length;) {
|
|
256
|
+
var key = keys.pop();
|
|
257
|
+
if (key in object) return next.value = key, next.done = !1, next;
|
|
642
258
|
}
|
|
643
259
|
|
|
260
|
+
return next.done = !0, next;
|
|
261
|
+
};
|
|
262
|
+
}, exports.values = values, Context.prototype = {
|
|
263
|
+
constructor: Context,
|
|
264
|
+
reset: function (skipTempReset) {
|
|
265
|
+
if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
|
|
266
|
+
},
|
|
267
|
+
stop: function () {
|
|
268
|
+
this.done = !0;
|
|
269
|
+
var rootRecord = this.tryEntries[0].completion;
|
|
270
|
+
if ("throw" === rootRecord.type) throw rootRecord.arg;
|
|
644
271
|
return this.rval;
|
|
645
272
|
},
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
if (this.done) {
|
|
649
|
-
throw exception;
|
|
650
|
-
}
|
|
651
|
-
|
|
273
|
+
dispatchException: function (exception) {
|
|
274
|
+
if (this.done) throw exception;
|
|
652
275
|
var context = this;
|
|
653
|
-
function handle(loc, caught) {
|
|
654
|
-
record.type = "throw";
|
|
655
|
-
record.arg = exception;
|
|
656
|
-
context.next = loc;
|
|
657
|
-
|
|
658
|
-
if (caught) {
|
|
659
|
-
// If the dispatched exception was caught by a catch block,
|
|
660
|
-
// then let that catch block handle the exception normally.
|
|
661
|
-
context.method = "next";
|
|
662
|
-
context.arg = undefined$1;
|
|
663
|
-
}
|
|
664
276
|
|
|
665
|
-
|
|
277
|
+
function handle(loc, caught) {
|
|
278
|
+
return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
|
|
666
279
|
}
|
|
667
280
|
|
|
668
281
|
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
669
|
-
var entry = this.tryEntries[i]
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
if (entry.tryLoc === "root") {
|
|
673
|
-
// Exception thrown outside of any try block that could handle
|
|
674
|
-
// it, so set the completion value of the entire function to
|
|
675
|
-
// throw the exception.
|
|
676
|
-
return handle("end");
|
|
677
|
-
}
|
|
282
|
+
var entry = this.tryEntries[i],
|
|
283
|
+
record = entry.completion;
|
|
284
|
+
if ("root" === entry.tryLoc) return handle("end");
|
|
678
285
|
|
|
679
286
|
if (entry.tryLoc <= this.prev) {
|
|
680
|
-
var hasCatch = hasOwn.call(entry, "catchLoc")
|
|
681
|
-
|
|
287
|
+
var hasCatch = hasOwn.call(entry, "catchLoc"),
|
|
288
|
+
hasFinally = hasOwn.call(entry, "finallyLoc");
|
|
682
289
|
|
|
683
290
|
if (hasCatch && hasFinally) {
|
|
684
|
-
if (this.prev < entry.catchLoc)
|
|
685
|
-
|
|
686
|
-
} else if (this.prev < entry.finallyLoc) {
|
|
687
|
-
return handle(entry.finallyLoc);
|
|
688
|
-
}
|
|
689
|
-
|
|
291
|
+
if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
|
|
292
|
+
if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
|
|
690
293
|
} else if (hasCatch) {
|
|
691
|
-
if (this.prev < entry.catchLoc)
|
|
692
|
-
return handle(entry.catchLoc, true);
|
|
693
|
-
}
|
|
694
|
-
|
|
695
|
-
} else if (hasFinally) {
|
|
696
|
-
if (this.prev < entry.finallyLoc) {
|
|
697
|
-
return handle(entry.finallyLoc);
|
|
698
|
-
}
|
|
699
|
-
|
|
294
|
+
if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
|
|
700
295
|
} else {
|
|
701
|
-
throw new Error("try statement without catch or finally");
|
|
296
|
+
if (!hasFinally) throw new Error("try statement without catch or finally");
|
|
297
|
+
if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
|
|
702
298
|
}
|
|
703
299
|
}
|
|
704
300
|
}
|
|
705
301
|
},
|
|
706
|
-
|
|
707
|
-
abrupt: function(type, arg) {
|
|
302
|
+
abrupt: function (type, arg) {
|
|
708
303
|
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
709
304
|
var entry = this.tryEntries[i];
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
this.prev < entry.finallyLoc) {
|
|
305
|
+
|
|
306
|
+
if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
|
|
713
307
|
var finallyEntry = entry;
|
|
714
308
|
break;
|
|
715
309
|
}
|
|
716
310
|
}
|
|
717
311
|
|
|
718
|
-
|
|
719
|
-
(type === "break" ||
|
|
720
|
-
type === "continue") &&
|
|
721
|
-
finallyEntry.tryLoc <= arg &&
|
|
722
|
-
arg <= finallyEntry.finallyLoc) {
|
|
723
|
-
// Ignore the finally entry if control is not jumping to a
|
|
724
|
-
// location outside the try/catch block.
|
|
725
|
-
finallyEntry = null;
|
|
726
|
-
}
|
|
727
|
-
|
|
312
|
+
finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
|
|
728
313
|
var record = finallyEntry ? finallyEntry.completion : {};
|
|
729
|
-
record.type = type;
|
|
730
|
-
record.arg = arg;
|
|
731
|
-
|
|
732
|
-
if (finallyEntry) {
|
|
733
|
-
this.method = "next";
|
|
734
|
-
this.next = finallyEntry.finallyLoc;
|
|
735
|
-
return ContinueSentinel;
|
|
736
|
-
}
|
|
737
|
-
|
|
738
|
-
return this.complete(record);
|
|
314
|
+
return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
|
|
739
315
|
},
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
throw record.arg;
|
|
744
|
-
}
|
|
745
|
-
|
|
746
|
-
if (record.type === "break" ||
|
|
747
|
-
record.type === "continue") {
|
|
748
|
-
this.next = record.arg;
|
|
749
|
-
} else if (record.type === "return") {
|
|
750
|
-
this.rval = this.arg = record.arg;
|
|
751
|
-
this.method = "return";
|
|
752
|
-
this.next = "end";
|
|
753
|
-
} else if (record.type === "normal" && afterLoc) {
|
|
754
|
-
this.next = afterLoc;
|
|
755
|
-
}
|
|
756
|
-
|
|
757
|
-
return ContinueSentinel;
|
|
316
|
+
complete: function (record, afterLoc) {
|
|
317
|
+
if ("throw" === record.type) throw record.arg;
|
|
318
|
+
return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;
|
|
758
319
|
},
|
|
759
|
-
|
|
760
|
-
finish: function(finallyLoc) {
|
|
320
|
+
finish: function (finallyLoc) {
|
|
761
321
|
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
762
322
|
var entry = this.tryEntries[i];
|
|
763
|
-
if (entry.finallyLoc === finallyLoc)
|
|
764
|
-
this.complete(entry.completion, entry.afterLoc);
|
|
765
|
-
resetTryEntry(entry);
|
|
766
|
-
return ContinueSentinel;
|
|
767
|
-
}
|
|
323
|
+
if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
|
|
768
324
|
}
|
|
769
325
|
},
|
|
770
|
-
|
|
771
|
-
"catch": function(tryLoc) {
|
|
326
|
+
catch: function (tryLoc) {
|
|
772
327
|
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
773
328
|
var entry = this.tryEntries[i];
|
|
329
|
+
|
|
774
330
|
if (entry.tryLoc === tryLoc) {
|
|
775
331
|
var record = entry.completion;
|
|
776
|
-
|
|
332
|
+
|
|
333
|
+
if ("throw" === record.type) {
|
|
777
334
|
var thrown = record.arg;
|
|
778
335
|
resetTryEntry(entry);
|
|
779
336
|
}
|
|
337
|
+
|
|
780
338
|
return thrown;
|
|
781
339
|
}
|
|
782
340
|
}
|
|
783
341
|
|
|
784
|
-
// The context.catch method must only be called with a location
|
|
785
|
-
// argument that corresponds to a known catch block.
|
|
786
342
|
throw new Error("illegal catch attempt");
|
|
787
343
|
},
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
this.delegate = {
|
|
344
|
+
delegateYield: function (iterable, resultName, nextLoc) {
|
|
345
|
+
return this.delegate = {
|
|
791
346
|
iterator: values(iterable),
|
|
792
347
|
resultName: resultName,
|
|
793
348
|
nextLoc: nextLoc
|
|
794
|
-
};
|
|
349
|
+
}, "next" === this.method && (this.arg = undefined), ContinueSentinel;
|
|
350
|
+
}
|
|
351
|
+
}, exports;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
355
|
+
try {
|
|
356
|
+
var info = gen[key](arg);
|
|
357
|
+
var value = info.value;
|
|
358
|
+
} catch (error) {
|
|
359
|
+
reject(error);
|
|
360
|
+
return;
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
if (info.done) {
|
|
364
|
+
resolve(value);
|
|
365
|
+
} else {
|
|
366
|
+
Promise.resolve(value).then(_next, _throw);
|
|
367
|
+
}
|
|
368
|
+
}
|
|
795
369
|
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
370
|
+
function _asyncToGenerator(fn) {
|
|
371
|
+
return function () {
|
|
372
|
+
var self = this,
|
|
373
|
+
args = arguments;
|
|
374
|
+
return new Promise(function (resolve, reject) {
|
|
375
|
+
var gen = fn.apply(self, args);
|
|
376
|
+
|
|
377
|
+
function _next(value) {
|
|
378
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
800
379
|
}
|
|
801
380
|
|
|
802
|
-
|
|
381
|
+
function _throw(err) {
|
|
382
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
_next(undefined);
|
|
386
|
+
});
|
|
387
|
+
};
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
function _extends() {
|
|
391
|
+
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
392
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
393
|
+
var source = arguments[i];
|
|
394
|
+
|
|
395
|
+
for (var key in source) {
|
|
396
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
397
|
+
target[key] = source[key];
|
|
398
|
+
}
|
|
399
|
+
}
|
|
803
400
|
}
|
|
401
|
+
|
|
402
|
+
return target;
|
|
804
403
|
};
|
|
404
|
+
return _extends.apply(this, arguments);
|
|
405
|
+
}
|
|
805
406
|
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
}
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
));
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
// This module should not be running in strict mode, so the above
|
|
824
|
-
// assignment should always work unless something is misconfigured. Just
|
|
825
|
-
// in case runtime.js accidentally runs in strict mode, we can escape
|
|
826
|
-
// strict mode using a global Function call. This could conceivably fail
|
|
827
|
-
// if a Content Security Policy forbids using Function, but in that case
|
|
828
|
-
// the proper solution is to fix the accidental strict mode problem. If
|
|
829
|
-
// you've misconfigured your bundler to force strict mode and applied a
|
|
830
|
-
// CSP to forbid Function, and you're not willing to fix either of those
|
|
831
|
-
// problems, please detail your unique predicament in a GitHub issue.
|
|
832
|
-
Function("r", "regeneratorRuntime = r")(runtime);
|
|
407
|
+
function _objectDestructuringEmpty(obj) {
|
|
408
|
+
if (obj == null) throw new TypeError("Cannot destructure undefined");
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
412
|
+
if (source == null) return {};
|
|
413
|
+
var target = {};
|
|
414
|
+
var sourceKeys = Object.keys(source);
|
|
415
|
+
var key, i;
|
|
416
|
+
|
|
417
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
418
|
+
key = sourceKeys[i];
|
|
419
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
420
|
+
target[key] = source[key];
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
return target;
|
|
833
424
|
}
|
|
834
|
-
});
|
|
835
425
|
|
|
836
426
|
var _require = /*#__PURE__*/require('@freelog/resource-policy-lang'),
|
|
837
427
|
compile = _require.compile;
|
|
@@ -890,9 +480,9 @@ function policyCodeTranslationToText(_x, _x2) {
|
|
|
890
480
|
}
|
|
891
481
|
|
|
892
482
|
function _policyCodeTranslationToText() {
|
|
893
|
-
_policyCodeTranslationToText = _asyncToGenerator( /*#__PURE__*/
|
|
483
|
+
_policyCodeTranslationToText = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(code, targetType) {
|
|
894
484
|
var result, contract, rrr;
|
|
895
|
-
return
|
|
485
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
896
486
|
while (1) {
|
|
897
487
|
switch (_context.prev = _context.next) {
|
|
898
488
|
case 0:
|
|
@@ -2591,11 +2181,27 @@ function find4Client(params) {
|
|
|
2591
2181
|
params: params
|
|
2592
2182
|
});
|
|
2593
2183
|
}
|
|
2184
|
+
function adsList(params) {
|
|
2185
|
+
return FUtil.Request({
|
|
2186
|
+
method: 'GET',
|
|
2187
|
+
url: "/v2/activities/ads/list4Client",
|
|
2188
|
+
params: params
|
|
2189
|
+
});
|
|
2190
|
+
}
|
|
2191
|
+
function adsDetails(params) {
|
|
2192
|
+
return FUtil.Request({
|
|
2193
|
+
method: 'GET',
|
|
2194
|
+
url: "/v2/activities/ads/find4Client",
|
|
2195
|
+
params: params
|
|
2196
|
+
});
|
|
2197
|
+
}
|
|
2594
2198
|
|
|
2595
2199
|
var Activity = {
|
|
2596
2200
|
__proto__: null,
|
|
2597
2201
|
list4Client: list4Client,
|
|
2598
|
-
find4Client: find4Client
|
|
2202
|
+
find4Client: find4Client,
|
|
2203
|
+
adsList: adsList,
|
|
2204
|
+
adsDetails: adsDetails
|
|
2599
2205
|
};
|
|
2600
2206
|
|
|
2601
2207
|
var FServiceAPI = {
|
|
@@ -2727,10 +2333,10 @@ function request(_x, _x2) {
|
|
|
2727
2333
|
// }
|
|
2728
2334
|
|
|
2729
2335
|
function _request() {
|
|
2730
|
-
_request = _asyncToGenerator( /*#__PURE__*/
|
|
2336
|
+
_request = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(config, _temp) {
|
|
2731
2337
|
var _ref, _ref$noRedirect, noRedirect, _ref$noErrorAlert, noErrorAlert, result;
|
|
2732
2338
|
|
|
2733
|
-
return
|
|
2339
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
2734
2340
|
while (1) {
|
|
2735
2341
|
switch (_context.prev = _context.next) {
|
|
2736
2342
|
case 0:
|