1 | (function webpackUniversalModuleDefinition(root, factory) {
|
2 | if(typeof exports === 'object' && typeof module === 'object')
|
3 | module.exports = factory();
|
4 | else if(typeof define === 'function' && define.amd)
|
5 | define([], factory);
|
6 | else if(typeof exports === 'object')
|
7 | exports["AV"] = factory();
|
8 | else
|
9 | root["AV"] = factory();
|
10 | })(typeof self !== 'undefined' ? self : this, function() {
|
11 | return (function(modules) {
|
12 |
|
13 | var installedModules = {};
|
14 |
|
15 |
|
16 | function __webpack_require__(moduleId) {
|
17 |
|
18 |
|
19 | if(installedModules[moduleId]) {
|
20 | return installedModules[moduleId].exports;
|
21 | }
|
22 |
|
23 | var module = installedModules[moduleId] = {
|
24 | i: moduleId,
|
25 | l: false,
|
26 | exports: {}
|
27 | };
|
28 |
|
29 |
|
30 | modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
31 |
|
32 |
|
33 | module.l = true;
|
34 |
|
35 |
|
36 | return module.exports;
|
37 | }
|
38 |
|
39 |
|
40 |
|
41 | __webpack_require__.m = modules;
|
42 |
|
43 |
|
44 | __webpack_require__.c = installedModules;
|
45 |
|
46 |
|
47 | __webpack_require__.d = function(exports, name, getter) {
|
48 | if(!__webpack_require__.o(exports, name)) {
|
49 | Object.defineProperty(exports, name, {
|
50 | configurable: false,
|
51 | enumerable: true,
|
52 | get: getter
|
53 | /******/ });
|
54 | /******/ }
|
55 | /******/ };
|
56 | /******/
|
57 | /******/ // getDefaultExport function for compatibility with non-harmony modules
|
58 | /******/ __webpack_require__.n = function(module) {
|
59 | var getter = module && module.__esModule ?
|
60 | function getDefault() { return module['default']; } :
|
61 | function getModuleExports() { return module; };
|
62 | __webpack_require__.d(getter, 'a', getter);
|
63 | return getter;
|
64 | };
|
65 |
|
66 |
|
67 | __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
68 |
|
69 |
|
70 | __webpack_require__.p = "";
|
71 |
|
72 |
|
73 | return __webpack_require__(__webpack_require__.s = 279);
|
74 | })
|
75 |
|
76 | ([
|
77 |
|
78 | (function(module, exports, __webpack_require__) {
|
79 |
|
80 | "use strict";
|
81 |
|
82 | var global = __webpack_require__(7);
|
83 | var apply = __webpack_require__(75);
|
84 | var uncurryThis = __webpack_require__(4);
|
85 | var isCallable = __webpack_require__(8);
|
86 | var getOwnPropertyDescriptor = __webpack_require__(62).f;
|
87 | var isForced = __webpack_require__(160);
|
88 | var path = __webpack_require__(5);
|
89 | var bind = __webpack_require__(48);
|
90 | var createNonEnumerableProperty = __webpack_require__(37);
|
91 | var hasOwn = __webpack_require__(13);
|
92 |
|
93 | var wrapConstructor = function (NativeConstructor) {
|
94 | var Wrapper = function (a, b, c) {
|
95 | if (this instanceof Wrapper) {
|
96 | switch (arguments.length) {
|
97 | case 0: return new NativeConstructor();
|
98 | case 1: return new NativeConstructor(a);
|
99 | case 2: return new NativeConstructor(a, b);
|
100 | } return new NativeConstructor(a, b, c);
|
101 | } return apply(NativeConstructor, this, arguments);
|
102 | };
|
103 | Wrapper.prototype = NativeConstructor.prototype;
|
104 | return Wrapper;
|
105 | };
|
106 |
|
107 |
|
108 |
|
109 |
|
110 |
|
111 |
|
112 |
|
113 |
|
114 |
|
115 |
|
116 |
|
117 |
|
118 |
|
119 |
|
120 |
|
121 |
|
122 | module.exports = function (options, source) {
|
123 | var TARGET = options.target;
|
124 | var GLOBAL = options.global;
|
125 | var STATIC = options.stat;
|
126 | var PROTO = options.proto;
|
127 |
|
128 | var nativeSource = GLOBAL ? global : STATIC ? global[TARGET] : (global[TARGET] || {}).prototype;
|
129 |
|
130 | var target = GLOBAL ? path : path[TARGET] || createNonEnumerableProperty(path, TARGET, {})[TARGET];
|
131 | var targetPrototype = target.prototype;
|
132 |
|
133 | var FORCED, USE_NATIVE, VIRTUAL_PROTOTYPE;
|
134 | var key, sourceProperty, targetProperty, nativeProperty, resultProperty, descriptor;
|
135 |
|
136 | for (key in source) {
|
137 | FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
|
138 |
|
139 | USE_NATIVE = !FORCED && nativeSource && hasOwn(nativeSource, key);
|
140 |
|
141 | targetProperty = target[key];
|
142 |
|
143 | if (USE_NATIVE) if (options.dontCallGetSet) {
|
144 | descriptor = getOwnPropertyDescriptor(nativeSource, key);
|
145 | nativeProperty = descriptor && descriptor.value;
|
146 | } else nativeProperty = nativeSource[key];
|
147 |
|
148 |
|
149 | sourceProperty = (USE_NATIVE && nativeProperty) ? nativeProperty : source[key];
|
150 |
|
151 | if (USE_NATIVE && typeof targetProperty == typeof sourceProperty) continue;
|
152 |
|
153 |
|
154 | if (options.bind && USE_NATIVE) resultProperty = bind(sourceProperty, global);
|
155 |
|
156 | else if (options.wrap && USE_NATIVE) resultProperty = wrapConstructor(sourceProperty);
|
157 |
|
158 | else if (PROTO && isCallable(sourceProperty)) resultProperty = uncurryThis(sourceProperty);
|
159 |
|
160 | else resultProperty = sourceProperty;
|
161 |
|
162 |
|
163 | if (options.sham || (sourceProperty && sourceProperty.sham) || (targetProperty && targetProperty.sham)) {
|
164 | createNonEnumerableProperty(resultProperty, 'sham', true);
|
165 | }
|
166 |
|
167 | createNonEnumerableProperty(target, key, resultProperty);
|
168 |
|
169 | if (PROTO) {
|
170 | VIRTUAL_PROTOTYPE = TARGET + 'Prototype';
|
171 | if (!hasOwn(path, VIRTUAL_PROTOTYPE)) {
|
172 | createNonEnumerableProperty(path, VIRTUAL_PROTOTYPE, {});
|
173 | }
|
174 |
|
175 | createNonEnumerableProperty(path[VIRTUAL_PROTOTYPE], key, sourceProperty);
|
176 |
|
177 | if (options.real && targetPrototype && !targetPrototype[key]) {
|
178 | createNonEnumerableProperty(targetPrototype, key, sourceProperty);
|
179 | }
|
180 | }
|
181 | }
|
182 | };
|
183 |
|
184 |
|
185 | }),
|
186 |
|
187 | (function(module, exports) {
|
188 |
|
189 | function _interopRequireDefault(obj) {
|
190 | return obj && obj.__esModule ? obj : {
|
191 | "default": obj
|
192 | };
|
193 | }
|
194 |
|
195 | module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
196 |
|
197 | }),
|
198 |
|
199 | (function(module, exports) {
|
200 |
|
201 | module.exports = function (exec) {
|
202 | try {
|
203 | return !!exec();
|
204 | } catch (error) {
|
205 | return true;
|
206 | }
|
207 | };
|
208 |
|
209 |
|
210 | }),
|
211 |
|
212 | (function(module, __webpack_exports__, __webpack_require__) {
|
213 |
|
214 | "use strict";
|
215 | Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
|
216 | var __WEBPACK_IMPORTED_MODULE_0__index_default_js__ = __webpack_require__(320);
|
217 | __webpack_require__.d(__webpack_exports__, "default", function() { return __WEBPACK_IMPORTED_MODULE_0__index_default_js__["a"]; });
|
218 | var __WEBPACK_IMPORTED_MODULE_1__index_js__ = __webpack_require__(133);
|
219 | __webpack_require__.d(__webpack_exports__, "VERSION", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["VERSION"]; });
|
220 | __webpack_require__.d(__webpack_exports__, "restArguments", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["restArguments"]; });
|
221 | __webpack_require__.d(__webpack_exports__, "isObject", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isObject"]; });
|
222 | __webpack_require__.d(__webpack_exports__, "isNull", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isNull"]; });
|
223 | __webpack_require__.d(__webpack_exports__, "isUndefined", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isUndefined"]; });
|
224 | __webpack_require__.d(__webpack_exports__, "isBoolean", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isBoolean"]; });
|
225 | __webpack_require__.d(__webpack_exports__, "isElement", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isElement"]; });
|
226 | __webpack_require__.d(__webpack_exports__, "isString", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isString"]; });
|
227 | __webpack_require__.d(__webpack_exports__, "isNumber", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isNumber"]; });
|
228 | __webpack_require__.d(__webpack_exports__, "isDate", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isDate"]; });
|
229 | __webpack_require__.d(__webpack_exports__, "isRegExp", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isRegExp"]; });
|
230 | __webpack_require__.d(__webpack_exports__, "isError", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isError"]; });
|
231 | __webpack_require__.d(__webpack_exports__, "isSymbol", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isSymbol"]; });
|
232 | __webpack_require__.d(__webpack_exports__, "isArrayBuffer", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isArrayBuffer"]; });
|
233 | __webpack_require__.d(__webpack_exports__, "isDataView", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isDataView"]; });
|
234 | __webpack_require__.d(__webpack_exports__, "isArray", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isArray"]; });
|
235 | __webpack_require__.d(__webpack_exports__, "isFunction", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isFunction"]; });
|
236 | __webpack_require__.d(__webpack_exports__, "isArguments", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isArguments"]; });
|
237 | __webpack_require__.d(__webpack_exports__, "isFinite", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isFinite"]; });
|
238 | __webpack_require__.d(__webpack_exports__, "isNaN", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isNaN"]; });
|
239 | __webpack_require__.d(__webpack_exports__, "isTypedArray", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isTypedArray"]; });
|
240 | __webpack_require__.d(__webpack_exports__, "isEmpty", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isEmpty"]; });
|
241 | __webpack_require__.d(__webpack_exports__, "isMatch", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isMatch"]; });
|
242 | __webpack_require__.d(__webpack_exports__, "isEqual", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isEqual"]; });
|
243 | __webpack_require__.d(__webpack_exports__, "isMap", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isMap"]; });
|
244 | __webpack_require__.d(__webpack_exports__, "isWeakMap", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isWeakMap"]; });
|
245 | __webpack_require__.d(__webpack_exports__, "isSet", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isSet"]; });
|
246 | __webpack_require__.d(__webpack_exports__, "isWeakSet", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isWeakSet"]; });
|
247 | __webpack_require__.d(__webpack_exports__, "keys", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["keys"]; });
|
248 | __webpack_require__.d(__webpack_exports__, "allKeys", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["allKeys"]; });
|
249 | __webpack_require__.d(__webpack_exports__, "values", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["values"]; });
|
250 | __webpack_require__.d(__webpack_exports__, "pairs", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["pairs"]; });
|
251 | __webpack_require__.d(__webpack_exports__, "invert", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["invert"]; });
|
252 | __webpack_require__.d(__webpack_exports__, "functions", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["functions"]; });
|
253 | __webpack_require__.d(__webpack_exports__, "methods", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["methods"]; });
|
254 | __webpack_require__.d(__webpack_exports__, "extend", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["extend"]; });
|
255 | __webpack_require__.d(__webpack_exports__, "extendOwn", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["extendOwn"]; });
|
256 | __webpack_require__.d(__webpack_exports__, "assign", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["assign"]; });
|
257 | __webpack_require__.d(__webpack_exports__, "defaults", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["defaults"]; });
|
258 | __webpack_require__.d(__webpack_exports__, "create", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["create"]; });
|
259 | __webpack_require__.d(__webpack_exports__, "clone", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["clone"]; });
|
260 | __webpack_require__.d(__webpack_exports__, "tap", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["tap"]; });
|
261 | __webpack_require__.d(__webpack_exports__, "get", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["get"]; });
|
262 | __webpack_require__.d(__webpack_exports__, "has", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["has"]; });
|
263 | __webpack_require__.d(__webpack_exports__, "mapObject", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["mapObject"]; });
|
264 | __webpack_require__.d(__webpack_exports__, "identity", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["identity"]; });
|
265 | __webpack_require__.d(__webpack_exports__, "constant", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["constant"]; });
|
266 | __webpack_require__.d(__webpack_exports__, "noop", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["noop"]; });
|
267 | __webpack_require__.d(__webpack_exports__, "toPath", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["toPath"]; });
|
268 | __webpack_require__.d(__webpack_exports__, "property", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["property"]; });
|
269 | __webpack_require__.d(__webpack_exports__, "propertyOf", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["propertyOf"]; });
|
270 | __webpack_require__.d(__webpack_exports__, "matcher", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["matcher"]; });
|
271 | __webpack_require__.d(__webpack_exports__, "matches", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["matches"]; });
|
272 | __webpack_require__.d(__webpack_exports__, "times", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["times"]; });
|
273 | __webpack_require__.d(__webpack_exports__, "random", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["random"]; });
|
274 | __webpack_require__.d(__webpack_exports__, "now", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["now"]; });
|
275 | __webpack_require__.d(__webpack_exports__, "escape", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["escape"]; });
|
276 | __webpack_require__.d(__webpack_exports__, "unescape", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["unescape"]; });
|
277 | __webpack_require__.d(__webpack_exports__, "templateSettings", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["templateSettings"]; });
|
278 | __webpack_require__.d(__webpack_exports__, "template", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["template"]; });
|
279 | __webpack_require__.d(__webpack_exports__, "result", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["result"]; });
|
280 | __webpack_require__.d(__webpack_exports__, "uniqueId", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["uniqueId"]; });
|
281 | __webpack_require__.d(__webpack_exports__, "chain", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["chain"]; });
|
282 | __webpack_require__.d(__webpack_exports__, "iteratee", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["iteratee"]; });
|
283 | __webpack_require__.d(__webpack_exports__, "partial", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["partial"]; });
|
284 | __webpack_require__.d(__webpack_exports__, "bind", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["bind"]; });
|
285 | __webpack_require__.d(__webpack_exports__, "bindAll", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["bindAll"]; });
|
286 | __webpack_require__.d(__webpack_exports__, "memoize", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["memoize"]; });
|
287 | __webpack_require__.d(__webpack_exports__, "delay", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["delay"]; });
|
288 | __webpack_require__.d(__webpack_exports__, "defer", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["defer"]; });
|
289 | __webpack_require__.d(__webpack_exports__, "throttle", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["throttle"]; });
|
290 | __webpack_require__.d(__webpack_exports__, "debounce", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["debounce"]; });
|
291 | __webpack_require__.d(__webpack_exports__, "wrap", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["wrap"]; });
|
292 | __webpack_require__.d(__webpack_exports__, "negate", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["negate"]; });
|
293 | __webpack_require__.d(__webpack_exports__, "compose", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["compose"]; });
|
294 | __webpack_require__.d(__webpack_exports__, "after", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["after"]; });
|
295 | __webpack_require__.d(__webpack_exports__, "before", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["before"]; });
|
296 | __webpack_require__.d(__webpack_exports__, "once", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["once"]; });
|
297 | __webpack_require__.d(__webpack_exports__, "findKey", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["findKey"]; });
|
298 | __webpack_require__.d(__webpack_exports__, "findIndex", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["findIndex"]; });
|
299 | __webpack_require__.d(__webpack_exports__, "findLastIndex", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["findLastIndex"]; });
|
300 | __webpack_require__.d(__webpack_exports__, "sortedIndex", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["sortedIndex"]; });
|
301 | __webpack_require__.d(__webpack_exports__, "indexOf", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["indexOf"]; });
|
302 | __webpack_require__.d(__webpack_exports__, "lastIndexOf", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["lastIndexOf"]; });
|
303 | __webpack_require__.d(__webpack_exports__, "find", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["find"]; });
|
304 | __webpack_require__.d(__webpack_exports__, "detect", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["detect"]; });
|
305 | __webpack_require__.d(__webpack_exports__, "findWhere", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["findWhere"]; });
|
306 | __webpack_require__.d(__webpack_exports__, "each", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["each"]; });
|
307 | __webpack_require__.d(__webpack_exports__, "forEach", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["forEach"]; });
|
308 | __webpack_require__.d(__webpack_exports__, "map", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["map"]; });
|
309 | __webpack_require__.d(__webpack_exports__, "collect", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["collect"]; });
|
310 | __webpack_require__.d(__webpack_exports__, "reduce", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["reduce"]; });
|
311 | __webpack_require__.d(__webpack_exports__, "foldl", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["foldl"]; });
|
312 | __webpack_require__.d(__webpack_exports__, "inject", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["inject"]; });
|
313 | __webpack_require__.d(__webpack_exports__, "reduceRight", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["reduceRight"]; });
|
314 | __webpack_require__.d(__webpack_exports__, "foldr", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["foldr"]; });
|
315 | __webpack_require__.d(__webpack_exports__, "filter", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["filter"]; });
|
316 | __webpack_require__.d(__webpack_exports__, "select", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["select"]; });
|
317 | __webpack_require__.d(__webpack_exports__, "reject", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["reject"]; });
|
318 | __webpack_require__.d(__webpack_exports__, "every", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["every"]; });
|
319 | __webpack_require__.d(__webpack_exports__, "all", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["all"]; });
|
320 | __webpack_require__.d(__webpack_exports__, "some", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["some"]; });
|
321 | __webpack_require__.d(__webpack_exports__, "any", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["any"]; });
|
322 | __webpack_require__.d(__webpack_exports__, "contains", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["contains"]; });
|
323 | __webpack_require__.d(__webpack_exports__, "includes", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["includes"]; });
|
324 | __webpack_require__.d(__webpack_exports__, "include", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["include"]; });
|
325 | __webpack_require__.d(__webpack_exports__, "invoke", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["invoke"]; });
|
326 | __webpack_require__.d(__webpack_exports__, "pluck", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["pluck"]; });
|
327 | __webpack_require__.d(__webpack_exports__, "where", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["where"]; });
|
328 | __webpack_require__.d(__webpack_exports__, "max", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["max"]; });
|
329 | __webpack_require__.d(__webpack_exports__, "min", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["min"]; });
|
330 | __webpack_require__.d(__webpack_exports__, "shuffle", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["shuffle"]; });
|
331 | __webpack_require__.d(__webpack_exports__, "sample", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["sample"]; });
|
332 | __webpack_require__.d(__webpack_exports__, "sortBy", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["sortBy"]; });
|
333 | __webpack_require__.d(__webpack_exports__, "groupBy", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["groupBy"]; });
|
334 | __webpack_require__.d(__webpack_exports__, "indexBy", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["indexBy"]; });
|
335 | __webpack_require__.d(__webpack_exports__, "countBy", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["countBy"]; });
|
336 | __webpack_require__.d(__webpack_exports__, "partition", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["partition"]; });
|
337 | __webpack_require__.d(__webpack_exports__, "toArray", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["toArray"]; });
|
338 | __webpack_require__.d(__webpack_exports__, "size", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["size"]; });
|
339 | __webpack_require__.d(__webpack_exports__, "pick", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["pick"]; });
|
340 | __webpack_require__.d(__webpack_exports__, "omit", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["omit"]; });
|
341 | __webpack_require__.d(__webpack_exports__, "first", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["first"]; });
|
342 | __webpack_require__.d(__webpack_exports__, "head", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["head"]; });
|
343 | __webpack_require__.d(__webpack_exports__, "take", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["take"]; });
|
344 | __webpack_require__.d(__webpack_exports__, "initial", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["initial"]; });
|
345 | __webpack_require__.d(__webpack_exports__, "last", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["last"]; });
|
346 | __webpack_require__.d(__webpack_exports__, "rest", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["rest"]; });
|
347 | __webpack_require__.d(__webpack_exports__, "tail", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["tail"]; });
|
348 | __webpack_require__.d(__webpack_exports__, "drop", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["drop"]; });
|
349 | __webpack_require__.d(__webpack_exports__, "compact", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["compact"]; });
|
350 | __webpack_require__.d(__webpack_exports__, "flatten", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["flatten"]; });
|
351 | __webpack_require__.d(__webpack_exports__, "without", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["without"]; });
|
352 | __webpack_require__.d(__webpack_exports__, "uniq", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["uniq"]; });
|
353 | __webpack_require__.d(__webpack_exports__, "unique", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["unique"]; });
|
354 | __webpack_require__.d(__webpack_exports__, "union", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["union"]; });
|
355 | __webpack_require__.d(__webpack_exports__, "intersection", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["intersection"]; });
|
356 | __webpack_require__.d(__webpack_exports__, "difference", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["difference"]; });
|
357 | __webpack_require__.d(__webpack_exports__, "unzip", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["unzip"]; });
|
358 | __webpack_require__.d(__webpack_exports__, "transpose", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["transpose"]; });
|
359 | __webpack_require__.d(__webpack_exports__, "zip", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["zip"]; });
|
360 | __webpack_require__.d(__webpack_exports__, "object", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["object"]; });
|
361 | __webpack_require__.d(__webpack_exports__, "range", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["range"]; });
|
362 | __webpack_require__.d(__webpack_exports__, "chunk", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["chunk"]; });
|
363 | __webpack_require__.d(__webpack_exports__, "mixin", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["mixin"]; });
|
364 |
|
365 |
|
366 |
|
367 |
|
368 |
|
369 |
|
370 |
|
371 |
|
372 |
|
373 |
|
374 |
|
375 |
|
376 |
|
377 |
|
378 |
|
379 |
|
380 |
|
381 |
|
382 |
|
383 |
|
384 | }),
|
385 |
|
386 | (function(module, exports, __webpack_require__) {
|
387 |
|
388 | var NATIVE_BIND = __webpack_require__(76);
|
389 |
|
390 | var FunctionPrototype = Function.prototype;
|
391 | var bind = FunctionPrototype.bind;
|
392 | var call = FunctionPrototype.call;
|
393 | var uncurryThis = NATIVE_BIND && bind.bind(call, call);
|
394 |
|
395 | module.exports = NATIVE_BIND ? function (fn) {
|
396 | return fn && uncurryThis(fn);
|
397 | } : function (fn) {
|
398 | return fn && function () {
|
399 | return call.apply(fn, arguments);
|
400 | };
|
401 | };
|
402 |
|
403 |
|
404 | }),
|
405 |
|
406 | (function(module, exports) {
|
407 |
|
408 | module.exports = {};
|
409 |
|
410 |
|
411 | }),
|
412 |
|
413 | (function(module, __webpack_exports__, __webpack_require__) {
|
414 |
|
415 | "use strict";
|
416 | (function(global) { __webpack_require__.d(__webpack_exports__, "e", function() { return VERSION; });
|
417 | __webpack_require__.d(__webpack_exports__, "p", function() { return root; });
|
418 | __webpack_require__.d(__webpack_exports__, "a", function() { return ArrayProto; });
|
419 | __webpack_require__.d(__webpack_exports__, "c", function() { return ObjProto; });
|
420 | __webpack_require__.d(__webpack_exports__, "d", function() { return SymbolProto; });
|
421 | __webpack_require__.d(__webpack_exports__, "o", function() { return push; });
|
422 | __webpack_require__.d(__webpack_exports__, "q", function() { return slice; });
|
423 | __webpack_require__.d(__webpack_exports__, "t", function() { return toString; });
|
424 | __webpack_require__.d(__webpack_exports__, "i", function() { return hasOwnProperty; });
|
425 | __webpack_require__.d(__webpack_exports__, "r", function() { return supportsArrayBuffer; });
|
426 | __webpack_require__.d(__webpack_exports__, "s", function() { return supportsDataView; });
|
427 | __webpack_require__.d(__webpack_exports__, "k", function() { return nativeIsArray; });
|
428 | __webpack_require__.d(__webpack_exports__, "m", function() { return nativeKeys; });
|
429 | __webpack_require__.d(__webpack_exports__, "j", function() { return nativeCreate; });
|
430 | __webpack_require__.d(__webpack_exports__, "l", function() { return nativeIsView; });
|
431 | __webpack_require__.d(__webpack_exports__, "g", function() { return _isNaN; });
|
432 | __webpack_require__.d(__webpack_exports__, "f", function() { return _isFinite; });
|
433 | __webpack_require__.d(__webpack_exports__, "h", function() { return hasEnumBug; });
|
434 | __webpack_require__.d(__webpack_exports__, "n", function() { return nonEnumerableProps; });
|
435 | __webpack_require__.d(__webpack_exports__, "b", function() { return MAX_ARRAY_INDEX; });
|
436 |
|
437 | var VERSION = '1.12.1';
|
438 |
|
439 |
|
440 |
|
441 |
|
442 | var root = typeof self == 'object' && self.self === self && self ||
|
443 | typeof global == 'object' && global.global === global && global ||
|
444 | Function('return this')() ||
|
445 | {};
|
446 |
|
447 |
|
448 | var ArrayProto = Array.prototype, ObjProto = Object.prototype;
|
449 | var SymbolProto = typeof Symbol !== 'undefined' ? Symbol.prototype : null;
|
450 |
|
451 |
|
452 | var push = ArrayProto.push,
|
453 | slice = ArrayProto.slice,
|
454 | toString = ObjProto.toString,
|
455 | hasOwnProperty = ObjProto.hasOwnProperty;
|
456 |
|
457 |
|
458 | var supportsArrayBuffer = typeof ArrayBuffer !== 'undefined',
|
459 | supportsDataView = typeof DataView !== 'undefined';
|
460 |
|
461 |
|
462 |
|
463 | var nativeIsArray = Array.isArray,
|
464 | nativeKeys = Object.keys,
|
465 | nativeCreate = Object.create,
|
466 | nativeIsView = supportsArrayBuffer && ArrayBuffer.isView;
|
467 |
|
468 |
|
469 | var _isNaN = isNaN,
|
470 | _isFinite = isFinite;
|
471 |
|
472 |
|
473 | var hasEnumBug = !{toString: null}.propertyIsEnumerable('toString');
|
474 | var nonEnumerableProps = ['valueOf', 'isPrototypeOf', 'toString',
|
475 | 'propertyIsEnumerable', 'hasOwnProperty', 'toLocaleString'];
|
476 |
|
477 |
|
478 | var MAX_ARRAY_INDEX = Math.pow(2, 53) - 1;
|
479 |
|
480 | }.call(__webpack_exports__, __webpack_require__(74)))
|
481 |
|
482 | }),
|
483 |
|
484 | (function(module, exports, __webpack_require__) {
|
485 |
|
486 | (function(global) {var check = function (it) {
|
487 | return it && it.Math == Math && it;
|
488 | };
|
489 |
|
490 |
|
491 | module.exports =
|
492 |
|
493 | check(typeof globalThis == 'object' && globalThis) ||
|
494 | check(typeof window == 'object' && window) ||
|
495 |
|
496 | check(typeof self == 'object' && self) ||
|
497 | check(typeof global == 'object' && global) ||
|
498 |
|
499 | (function () { return this; })() || Function('return this')();
|
500 |
|
501 | }.call(exports, __webpack_require__(74)))
|
502 |
|
503 | }),
|
504 |
|
505 | (function(module, exports) {
|
506 |
|
507 |
|
508 |
|
509 | module.exports = function (argument) {
|
510 | return typeof argument == 'function';
|
511 | };
|
512 |
|
513 |
|
514 | }),
|
515 |
|
516 | (function(module, exports, __webpack_require__) {
|
517 |
|
518 | var global = __webpack_require__(7);
|
519 | var shared = __webpack_require__(79);
|
520 | var hasOwn = __webpack_require__(13);
|
521 | var uid = __webpack_require__(99);
|
522 | var NATIVE_SYMBOL = __webpack_require__(64);
|
523 | var USE_SYMBOL_AS_UID = __webpack_require__(158);
|
524 |
|
525 | var WellKnownSymbolsStore = shared('wks');
|
526 | var Symbol = global.Symbol;
|
527 | var symbolFor = Symbol && Symbol['for'];
|
528 | var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol : Symbol && Symbol.withoutSetter || uid;
|
529 |
|
530 | module.exports = function (name) {
|
531 | if (!hasOwn(WellKnownSymbolsStore, name) || !(NATIVE_SYMBOL || typeof WellKnownSymbolsStore[name] == 'string')) {
|
532 | var description = 'Symbol.' + name;
|
533 | if (NATIVE_SYMBOL && hasOwn(Symbol, name)) {
|
534 | WellKnownSymbolsStore[name] = Symbol[name];
|
535 | } else if (USE_SYMBOL_AS_UID && symbolFor) {
|
536 | WellKnownSymbolsStore[name] = symbolFor(description);
|
537 | } else {
|
538 | WellKnownSymbolsStore[name] = createWellKnownSymbol(description);
|
539 | }
|
540 | } return WellKnownSymbolsStore[name];
|
541 | };
|
542 |
|
543 |
|
544 | }),
|
545 |
|
546 | (function(module, exports, __webpack_require__) {
|
547 |
|
548 | var path = __webpack_require__(5);
|
549 | var hasOwn = __webpack_require__(13);
|
550 | var wrappedWellKnownSymbolModule = __webpack_require__(149);
|
551 | var defineProperty = __webpack_require__(23).f;
|
552 |
|
553 | module.exports = function (NAME) {
|
554 | var Symbol = path.Symbol || (path.Symbol = {});
|
555 | if (!hasOwn(Symbol, NAME)) defineProperty(Symbol, NAME, {
|
556 | value: wrappedWellKnownSymbolModule.f(NAME)
|
557 | });
|
558 | };
|
559 |
|
560 |
|
561 | }),
|
562 |
|
563 | (function(module, exports, __webpack_require__) {
|
564 |
|
565 | var isCallable = __webpack_require__(8);
|
566 |
|
567 | module.exports = function (it) {
|
568 | return typeof it == 'object' ? it !== null : isCallable(it);
|
569 | };
|
570 |
|
571 |
|
572 | }),
|
573 |
|
574 | (function(module, exports, __webpack_require__) {
|
575 |
|
576 | module.exports = __webpack_require__(283);
|
577 |
|
578 | }),
|
579 |
|
580 | (function(module, exports, __webpack_require__) {
|
581 |
|
582 | var uncurryThis = __webpack_require__(4);
|
583 | var toObject = __webpack_require__(34);
|
584 |
|
585 | var hasOwnProperty = uncurryThis({}.hasOwnProperty);
|
586 |
|
587 |
|
588 |
|
589 |
|
590 | module.exports = Object.hasOwn || function hasOwn(it, key) {
|
591 | return hasOwnProperty(toObject(it), key);
|
592 | };
|
593 |
|
594 |
|
595 | }),
|
596 |
|
597 | (function(module, exports, __webpack_require__) {
|
598 |
|
599 | var fails = __webpack_require__(2);
|
600 |
|
601 |
|
602 | module.exports = !fails(function () {
|
603 |
|
604 | return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
|
605 | });
|
606 |
|
607 |
|
608 | }),
|
609 |
|
610 | (function(module, exports, __webpack_require__) {
|
611 |
|
612 | var NATIVE_BIND = __webpack_require__(76);
|
613 |
|
614 | var call = Function.prototype.call;
|
615 |
|
616 | module.exports = NATIVE_BIND ? call.bind(call) : function () {
|
617 | return call.apply(call, arguments);
|
618 | };
|
619 |
|
620 |
|
621 | }),
|
622 |
|
623 | (function(module, __webpack_exports__, __webpack_require__) {
|
624 |
|
625 | "use strict";
|
626 | __webpack_exports__["a"] = keys;
|
627 | var __WEBPACK_IMPORTED_MODULE_0__isObject_js__ = __webpack_require__(56);
|
628 | var __WEBPACK_IMPORTED_MODULE_1__setup_js__ = __webpack_require__(6);
|
629 | var __WEBPACK_IMPORTED_MODULE_2__has_js__ = __webpack_require__(45);
|
630 | var __WEBPACK_IMPORTED_MODULE_3__collectNonEnumProps_js__ = __webpack_require__(191);
|
631 |
|
632 |
|
633 |
|
634 |
|
635 |
|
636 |
|
637 |
|
638 | function keys(obj) {
|
639 | if (!Object(__WEBPACK_IMPORTED_MODULE_0__isObject_js__["a" ])(obj)) return [];
|
640 | if (__WEBPACK_IMPORTED_MODULE_1__setup_js__["m" ]) return Object(__WEBPACK_IMPORTED_MODULE_1__setup_js__["m" ])(obj);
|
641 | var keys = [];
|
642 | for (var key in obj) if (Object(__WEBPACK_IMPORTED_MODULE_2__has_js__["a" ])(obj, key)) keys.push(key);
|
643 |
|
644 | if (__WEBPACK_IMPORTED_MODULE_1__setup_js__["h" ]) Object(__WEBPACK_IMPORTED_MODULE_3__collectNonEnumProps_js__["a" ])(obj, keys);
|
645 | return keys;
|
646 | }
|
647 |
|
648 |
|
649 | }),
|
650 |
|
651 | (function(module, __webpack_exports__, __webpack_require__) {
|
652 |
|
653 | "use strict";
|
654 | __webpack_exports__["a"] = tagTester;
|
655 | var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(6);
|
656 |
|
657 |
|
658 |
|
659 | function tagTester(name) {
|
660 | var tag = '[object ' + name + ']';
|
661 | return function(obj) {
|
662 | return __WEBPACK_IMPORTED_MODULE_0__setup_js__["t" ].call(obj) === tag;
|
663 | };
|
664 | }
|
665 |
|
666 |
|
667 | }),
|
668 |
|
669 | (function(module, exports, __webpack_require__) {
|
670 |
|
671 | var path = __webpack_require__(5);
|
672 | var global = __webpack_require__(7);
|
673 | var isCallable = __webpack_require__(8);
|
674 |
|
675 | var aFunction = function (variable) {
|
676 | return isCallable(variable) ? variable : undefined;
|
677 | };
|
678 |
|
679 | module.exports = function (namespace, method) {
|
680 | return arguments.length < 2 ? aFunction(path[namespace]) || aFunction(global[namespace])
|
681 | : path[namespace] && path[namespace][method] || global[namespace] && global[namespace][method];
|
682 | };
|
683 |
|
684 |
|
685 | }),
|
686 |
|
687 | (function(module, exports, __webpack_require__) {
|
688 |
|
689 | var uncurryThis = __webpack_require__(4);
|
690 |
|
691 | module.exports = uncurryThis({}.isPrototypeOf);
|
692 |
|
693 |
|
694 | }),
|
695 |
|
696 | (function(module, exports, __webpack_require__) {
|
697 |
|
698 | var isObject = __webpack_require__(11);
|
699 |
|
700 | var $String = String;
|
701 | var $TypeError = TypeError;
|
702 |
|
703 |
|
704 | module.exports = function (argument) {
|
705 | if (isObject(argument)) return argument;
|
706 | throw $TypeError($String(argument) + ' is not an object');
|
707 | };
|
708 |
|
709 |
|
710 | }),
|
711 |
|
712 | (function(module, __webpack_exports__, __webpack_require__) {
|
713 |
|
714 | "use strict";
|
715 | __webpack_exports__["a"] = cb;
|
716 | var __WEBPACK_IMPORTED_MODULE_0__underscore_js__ = __webpack_require__(25);
|
717 | var __WEBPACK_IMPORTED_MODULE_1__baseIteratee_js__ = __webpack_require__(201);
|
718 | var __WEBPACK_IMPORTED_MODULE_2__iteratee_js__ = __webpack_require__(202);
|
719 |
|
720 |
|
721 |
|
722 |
|
723 |
|
724 |
|
725 | function cb(value, context, argCount) {
|
726 | if (__WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" ].iteratee !== __WEBPACK_IMPORTED_MODULE_2__iteratee_js__["a" ]) return __WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" ].iteratee(value, context);
|
727 | return Object(__WEBPACK_IMPORTED_MODULE_1__baseIteratee_js__["a" ])(value, context, argCount);
|
728 | }
|
729 |
|
730 |
|
731 | }),
|
732 |
|
733 | (function(module, exports, __webpack_require__) {
|
734 |
|
735 | module.exports = __webpack_require__(392);
|
736 |
|
737 | }),
|
738 |
|
739 | (function(module, exports, __webpack_require__) {
|
740 |
|
741 | var DESCRIPTORS = __webpack_require__(14);
|
742 | var IE8_DOM_DEFINE = __webpack_require__(159);
|
743 | var V8_PROTOTYPE_DEFINE_BUG = __webpack_require__(161);
|
744 | var anObject = __webpack_require__(20);
|
745 | var toPropertyKey = __webpack_require__(96);
|
746 |
|
747 | var $TypeError = TypeError;
|
748 |
|
749 | var $defineProperty = Object.defineProperty;
|
750 |
|
751 | var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
752 | var ENUMERABLE = 'enumerable';
|
753 | var CONFIGURABLE = 'configurable';
|
754 | var WRITABLE = 'writable';
|
755 |
|
756 |
|
757 |
|
758 | exports.f = DESCRIPTORS ? V8_PROTOTYPE_DEFINE_BUG ? function defineProperty(O, P, Attributes) {
|
759 | anObject(O);
|
760 | P = toPropertyKey(P);
|
761 | anObject(Attributes);
|
762 | if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
|
763 | var current = $getOwnPropertyDescriptor(O, P);
|
764 | if (current && current[WRITABLE]) {
|
765 | O[P] = Attributes.value;
|
766 | Attributes = {
|
767 | configurable: CONFIGURABLE in Attributes ? Attributes[CONFIGURABLE] : current[CONFIGURABLE],
|
768 | enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
|
769 | writable: false
|
770 | };
|
771 | }
|
772 | } return $defineProperty(O, P, Attributes);
|
773 | } : $defineProperty : function defineProperty(O, P, Attributes) {
|
774 | anObject(O);
|
775 | P = toPropertyKey(P);
|
776 | anObject(Attributes);
|
777 | if (IE8_DOM_DEFINE) try {
|
778 | return $defineProperty(O, P, Attributes);
|
779 | } catch (error) { }
|
780 | if ('get' in Attributes || 'set' in Attributes) throw $TypeError('Accessors not supported');
|
781 | if ('value' in Attributes) O[P] = Attributes.value;
|
782 | return O;
|
783 | };
|
784 |
|
785 |
|
786 | }),
|
787 |
|
788 | (function(module, __webpack_exports__, __webpack_require__) {
|
789 |
|
790 | "use strict";
|
791 | __webpack_exports__["a"] = restArguments;
|
792 |
|
793 |
|
794 |
|
795 |
|
796 |
|
797 | function restArguments(func, startIndex) {
|
798 | startIndex = startIndex == null ? func.length - 1 : +startIndex;
|
799 | return function() {
|
800 | var length = Math.max(arguments.length - startIndex, 0),
|
801 | rest = Array(length),
|
802 | index = 0;
|
803 | for (; index < length; index++) {
|
804 | rest[index] = arguments[index + startIndex];
|
805 | }
|
806 | switch (startIndex) {
|
807 | case 0: return func.call(this, rest);
|
808 | case 1: return func.call(this, arguments[0], rest);
|
809 | case 2: return func.call(this, arguments[0], arguments[1], rest);
|
810 | }
|
811 | var args = Array(startIndex + 1);
|
812 | for (index = 0; index < startIndex; index++) {
|
813 | args[index] = arguments[index];
|
814 | }
|
815 | args[startIndex] = rest;
|
816 | return func.apply(this, args);
|
817 | };
|
818 | }
|
819 |
|
820 |
|
821 | }),
|
822 |
|
823 | (function(module, __webpack_exports__, __webpack_require__) {
|
824 |
|
825 | "use strict";
|
826 | __webpack_exports__["a"] = _;
|
827 | var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(6);
|
828 |
|
829 |
|
830 |
|
831 |
|
832 |
|
833 | function _(obj) {
|
834 | if (obj instanceof _) return obj;
|
835 | if (!(this instanceof _)) return new _(obj);
|
836 | this._wrapped = obj;
|
837 | }
|
838 |
|
839 | _.VERSION = __WEBPACK_IMPORTED_MODULE_0__setup_js__["e" ];
|
840 |
|
841 |
|
842 | _.prototype.value = function() {
|
843 | return this._wrapped;
|
844 | };
|
845 |
|
846 |
|
847 |
|
848 | _.prototype.valueOf = _.prototype.toJSON = _.prototype.value;
|
849 |
|
850 | _.prototype.toString = function() {
|
851 | return String(this._wrapped);
|
852 | };
|
853 |
|
854 |
|
855 | }),
|
856 |
|
857 | (function(module, __webpack_exports__, __webpack_require__) {
|
858 |
|
859 | "use strict";
|
860 | var __WEBPACK_IMPORTED_MODULE_0__createSizePropertyCheck_js__ = __webpack_require__(189);
|
861 | var __WEBPACK_IMPORTED_MODULE_1__getLength_js__ = __webpack_require__(29);
|
862 |
|
863 |
|
864 |
|
865 |
|
866 |
|
867 |
|
868 |
|
869 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createSizePropertyCheck_js__["a" ])(__WEBPACK_IMPORTED_MODULE_1__getLength_js__["a" ]));
|
870 |
|
871 |
|
872 | }),
|
873 |
|
874 | (function(module, exports, __webpack_require__) {
|
875 |
|
876 | "use strict";
|
877 |
|
878 |
|
879 | var _interopRequireDefault = __webpack_require__(1);
|
880 |
|
881 | var _concat = _interopRequireDefault(__webpack_require__(22));
|
882 |
|
883 | var _promise = _interopRequireDefault(__webpack_require__(12));
|
884 |
|
885 | var _ = __webpack_require__(3);
|
886 |
|
887 | var md5 = __webpack_require__(528);
|
888 |
|
889 | var _require = __webpack_require__(3),
|
890 | extend = _require.extend;
|
891 |
|
892 | var AV = __webpack_require__(69);
|
893 |
|
894 | var AVError = __webpack_require__(46);
|
895 |
|
896 | var _require2 = __webpack_require__(30),
|
897 | getSessionToken = _require2.getSessionToken;
|
898 |
|
899 | var ajax = __webpack_require__(116);
|
900 |
|
901 |
|
902 | var sign = function sign(key, isMasterKey) {
|
903 | var _context2;
|
904 |
|
905 | var now = new Date().getTime();
|
906 | var signature = md5(now + key);
|
907 |
|
908 | if (isMasterKey) {
|
909 | var _context;
|
910 |
|
911 | return (0, _concat.default)(_context = "".concat(signature, ",")).call(_context, now, ",master");
|
912 | }
|
913 |
|
914 | return (0, _concat.default)(_context2 = "".concat(signature, ",")).call(_context2, now);
|
915 | };
|
916 |
|
917 | var setAppKey = function setAppKey(headers, signKey) {
|
918 | if (signKey) {
|
919 | headers['X-LC-Sign'] = sign(AV.applicationKey);
|
920 | } else {
|
921 | headers['X-LC-Key'] = AV.applicationKey;
|
922 | }
|
923 | };
|
924 |
|
925 | var setHeaders = function setHeaders() {
|
926 | var authOptions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
927 | var signKey = arguments.length > 1 ? arguments[1] : undefined;
|
928 | var headers = {
|
929 | 'X-LC-Id': AV.applicationId,
|
930 | 'Content-Type': 'application/json;charset=UTF-8'
|
931 | };
|
932 | var useMasterKey = false;
|
933 |
|
934 | if (typeof authOptions.useMasterKey === 'boolean') {
|
935 | useMasterKey = authOptions.useMasterKey;
|
936 | } else if (typeof AV._config.useMasterKey === 'boolean') {
|
937 | useMasterKey = AV._config.useMasterKey;
|
938 | }
|
939 |
|
940 | if (useMasterKey) {
|
941 | if (AV.masterKey) {
|
942 | if (signKey) {
|
943 | headers['X-LC-Sign'] = sign(AV.masterKey, true);
|
944 | } else {
|
945 | headers['X-LC-Key'] = "".concat(AV.masterKey, ",master");
|
946 | }
|
947 | } else {
|
948 | console.warn('masterKey is not set, fall back to use appKey');
|
949 | setAppKey(headers, signKey);
|
950 | }
|
951 | } else {
|
952 | setAppKey(headers, signKey);
|
953 | }
|
954 |
|
955 | if (AV.hookKey) {
|
956 | headers['X-LC-Hook-Key'] = AV.hookKey;
|
957 | }
|
958 |
|
959 | if (AV._config.production !== null) {
|
960 | headers['X-LC-Prod'] = String(AV._config.production);
|
961 | }
|
962 |
|
963 | headers[ false ? 'User-Agent' : 'X-LC-UA'] = AV._sharedConfig.userAgent;
|
964 | return _promise.default.resolve().then(function () {
|
965 |
|
966 | var sessionToken = getSessionToken(authOptions);
|
967 |
|
968 | if (sessionToken) {
|
969 | headers['X-LC-Session'] = sessionToken;
|
970 | } else if (!AV._config.disableCurrentUser) {
|
971 | return AV.User.currentAsync().then(function (currentUser) {
|
972 | if (currentUser && currentUser._sessionToken) {
|
973 | headers['X-LC-Session'] = currentUser._sessionToken;
|
974 | }
|
975 |
|
976 | return headers;
|
977 | });
|
978 | }
|
979 |
|
980 | return headers;
|
981 | });
|
982 | };
|
983 |
|
984 | var createApiUrl = function createApiUrl(_ref) {
|
985 | var _ref$service = _ref.service,
|
986 | service = _ref$service === void 0 ? 'api' : _ref$service,
|
987 | _ref$version = _ref.version,
|
988 | version = _ref$version === void 0 ? '1.1' : _ref$version,
|
989 | path = _ref.path;
|
990 | var apiURL = AV._config.serverURLs[service];
|
991 | if (!apiURL) throw new Error("undefined server URL for ".concat(service));
|
992 |
|
993 | if (apiURL.charAt(apiURL.length - 1) !== '/') {
|
994 | apiURL += '/';
|
995 | }
|
996 |
|
997 | apiURL += version;
|
998 |
|
999 | if (path) {
|
1000 | apiURL += path;
|
1001 | }
|
1002 |
|
1003 | return apiURL;
|
1004 | };
|
1005 |
|
1006 |
|
1007 |
|
1008 |
|
1009 |
|
1010 |
|
1011 |
|
1012 |
|
1013 |
|
1014 |
|
1015 |
|
1016 |
|
1017 |
|
1018 |
|
1019 |
|
1020 | var request = function request(_ref2) {
|
1021 | var service = _ref2.service,
|
1022 | version = _ref2.version,
|
1023 | method = _ref2.method,
|
1024 | path = _ref2.path,
|
1025 | query = _ref2.query,
|
1026 | data = _ref2.data,
|
1027 | authOptions = _ref2.authOptions,
|
1028 | _ref2$signKey = _ref2.signKey,
|
1029 | signKey = _ref2$signKey === void 0 ? true : _ref2$signKey;
|
1030 |
|
1031 | if (!(AV.applicationId && (AV.applicationKey || AV.masterKey))) {
|
1032 | throw new Error('Not initialized');
|
1033 | }
|
1034 |
|
1035 | if (AV._appRouter) {
|
1036 | AV._appRouter.refresh();
|
1037 | }
|
1038 |
|
1039 | var timeout = AV._config.requestTimeout;
|
1040 | var url = createApiUrl({
|
1041 | service: service,
|
1042 | path: path,
|
1043 | version: version
|
1044 | });
|
1045 | return setHeaders(authOptions, signKey).then(function (headers) {
|
1046 | return ajax({
|
1047 | method: method,
|
1048 | url: url,
|
1049 | query: query,
|
1050 | data: data,
|
1051 | headers: headers,
|
1052 | timeout: timeout
|
1053 | }).catch(function (error) {
|
1054 | var errorJSON = {
|
1055 | code: error.code || -1,
|
1056 | error: error.message || error.responseText
|
1057 | };
|
1058 |
|
1059 | if (error.response && error.response.code) {
|
1060 | errorJSON = error.response;
|
1061 | } else if (error.responseText) {
|
1062 | try {
|
1063 | errorJSON = JSON.parse(error.responseText);
|
1064 | } catch (e) {
|
1065 | }
|
1066 | }
|
1067 |
|
1068 | errorJSON.rawMessage = errorJSON.rawMessage || errorJSON.error;
|
1069 |
|
1070 | if (!AV._sharedConfig.keepErrorRawMessage) {
|
1071 | var _context3, _context4;
|
1072 |
|
1073 | errorJSON.error += (0, _concat.default)(_context3 = (0, _concat.default)(_context4 = " [".concat(error.statusCode || 'N/A', " ")).call(_context4, method, " ")).call(_context3, url, "]");
|
1074 | }
|
1075 |
|
1076 |
|
1077 |
|
1078 | var err = new AVError(errorJSON.code, errorJSON.error);
|
1079 | delete errorJSON.error;
|
1080 | throw _.extend(err, errorJSON);
|
1081 | });
|
1082 | });
|
1083 | };
|
1084 |
|
1085 |
|
1086 | var _request = function _request(route, className, objectId, method, data, authOptions, query) {
|
1087 | var path = '';
|
1088 | if (route) path += "/".concat(route);
|
1089 | if (className) path += "/".concat(className);
|
1090 | if (objectId) path += "/".concat(objectId);
|
1091 |
|
1092 | if (data && data._fetchWhenSave) throw new Error('_fetchWhenSave should be in the query');
|
1093 | if (data && data._where) throw new Error('_where should be in the query');
|
1094 |
|
1095 | if (method && method.toLowerCase() === 'get') {
|
1096 | query = extend({}, query, data);
|
1097 | data = null;
|
1098 | }
|
1099 |
|
1100 | return request({
|
1101 | method: method,
|
1102 | path: path,
|
1103 | query: query,
|
1104 | data: data,
|
1105 | authOptions: authOptions
|
1106 | });
|
1107 | };
|
1108 |
|
1109 | AV.request = request;
|
1110 | module.exports = {
|
1111 | _request: _request,
|
1112 | request: request
|
1113 | };
|
1114 |
|
1115 | }),
|
1116 |
|
1117 | (function(module, __webpack_exports__, __webpack_require__) {
|
1118 |
|
1119 | "use strict";
|
1120 | var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(17);
|
1121 | var __WEBPACK_IMPORTED_MODULE_1__setup_js__ = __webpack_require__(6);
|
1122 |
|
1123 |
|
1124 |
|
1125 | var isFunction = Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" ])('Function');
|
1126 |
|
1127 |
|
1128 |
|
1129 | var nodelist = __WEBPACK_IMPORTED_MODULE_1__setup_js__["p" ].document && __WEBPACK_IMPORTED_MODULE_1__setup_js__["p" ].document.childNodes;
|
1130 | if (typeof /./ != 'function' && typeof Int8Array != 'object' && typeof nodelist != 'function') {
|
1131 | isFunction = function(obj) {
|
1132 | return typeof obj == 'function' || false;
|
1133 | };
|
1134 | }
|
1135 |
|
1136 | __webpack_exports__["a"] = (isFunction);
|
1137 |
|
1138 |
|
1139 | }),
|
1140 |
|
1141 | (function(module, __webpack_exports__, __webpack_require__) {
|
1142 |
|
1143 | "use strict";
|
1144 | var __WEBPACK_IMPORTED_MODULE_0__shallowProperty_js__ = __webpack_require__(190);
|
1145 |
|
1146 |
|
1147 |
|
1148 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__shallowProperty_js__["a" ])('length'));
|
1149 |
|
1150 |
|
1151 | }),
|
1152 |
|
1153 | (function(module, exports, __webpack_require__) {
|
1154 |
|
1155 | "use strict";
|
1156 |
|
1157 |
|
1158 | var _interopRequireDefault = __webpack_require__(1);
|
1159 |
|
1160 | var _keys = _interopRequireDefault(__webpack_require__(59));
|
1161 |
|
1162 | var _getPrototypeOf = _interopRequireDefault(__webpack_require__(148));
|
1163 |
|
1164 | var _promise = _interopRequireDefault(__webpack_require__(12));
|
1165 |
|
1166 | var _ = __webpack_require__(3);
|
1167 |
|
1168 |
|
1169 | var isNullOrUndefined = function isNullOrUndefined(x) {
|
1170 | return _.isNull(x) || _.isUndefined(x);
|
1171 | };
|
1172 |
|
1173 | var ensureArray = function ensureArray(target) {
|
1174 | if (_.isArray(target)) {
|
1175 | return target;
|
1176 | }
|
1177 |
|
1178 | if (target === undefined || target === null) {
|
1179 | return [];
|
1180 | }
|
1181 |
|
1182 | return [target];
|
1183 | };
|
1184 |
|
1185 | var transformFetchOptions = function transformFetchOptions() {
|
1186 | var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
1187 | keys = (0, _keys.default)(_ref),
|
1188 | include = _ref.include,
|
1189 | includeACL = _ref.includeACL;
|
1190 |
|
1191 | var fetchOptions = {};
|
1192 |
|
1193 | if (keys) {
|
1194 | fetchOptions.keys = ensureArray(keys).join(',');
|
1195 | }
|
1196 |
|
1197 | if (include) {
|
1198 | fetchOptions.include = ensureArray(include).join(',');
|
1199 | }
|
1200 |
|
1201 | if (includeACL) {
|
1202 | fetchOptions.returnACL = includeACL;
|
1203 | }
|
1204 |
|
1205 | return fetchOptions;
|
1206 | };
|
1207 |
|
1208 | var getSessionToken = function getSessionToken(authOptions) {
|
1209 | if (authOptions.sessionToken) {
|
1210 | return authOptions.sessionToken;
|
1211 | }
|
1212 |
|
1213 | if (authOptions.user && typeof authOptions.user.getSessionToken === 'function') {
|
1214 | return authOptions.user.getSessionToken();
|
1215 | }
|
1216 | };
|
1217 |
|
1218 | var tap = function tap(interceptor) {
|
1219 | return function (value) {
|
1220 | return interceptor(value), value;
|
1221 | };
|
1222 | };
|
1223 |
|
1224 |
|
1225 | var EmptyConstructor = function EmptyConstructor() {};
|
1226 |
|
1227 |
|
1228 |
|
1229 |
|
1230 | var inherits = function inherits(parent, protoProps, staticProps) {
|
1231 | var child;
|
1232 |
|
1233 |
|
1234 |
|
1235 | if (protoProps && protoProps.hasOwnProperty('constructor')) {
|
1236 | child = protoProps.constructor;
|
1237 | } else {
|
1238 |
|
1239 | child = function child() {
|
1240 | parent.apply(this, arguments);
|
1241 | };
|
1242 | }
|
1243 |
|
1244 |
|
1245 | _.extend(child, parent);
|
1246 |
|
1247 |
|
1248 |
|
1249 | EmptyConstructor.prototype = parent.prototype;
|
1250 | child.prototype = new EmptyConstructor();
|
1251 |
|
1252 |
|
1253 | if (protoProps) {
|
1254 | _.extend(child.prototype, protoProps);
|
1255 | }
|
1256 |
|
1257 |
|
1258 | if (staticProps) {
|
1259 | _.extend(child, staticProps);
|
1260 | }
|
1261 |
|
1262 |
|
1263 | child.prototype.constructor = child;
|
1264 |
|
1265 |
|
1266 | child.__super__ = parent.prototype;
|
1267 | return child;
|
1268 | };
|
1269 |
|
1270 |
|
1271 |
|
1272 | var parseDate = typeof wx === 'undefined' ? function (iso8601) {
|
1273 | return new Date(iso8601);
|
1274 | } : function (iso8601) {
|
1275 | return new Date(Date.parse(iso8601));
|
1276 | };
|
1277 |
|
1278 | var setValue = function setValue(target, key, value) {
|
1279 |
|
1280 | var segs = key.split('.');
|
1281 | var lastSeg = segs.pop();
|
1282 | var currentTarget = target;
|
1283 | segs.forEach(function (seg) {
|
1284 | if (currentTarget[seg] === undefined) currentTarget[seg] = {};
|
1285 | currentTarget = currentTarget[seg];
|
1286 | });
|
1287 | currentTarget[lastSeg] = value;
|
1288 | return target;
|
1289 | };
|
1290 |
|
1291 | var findValue = function findValue(target, key) {
|
1292 | var segs = key.split('.');
|
1293 | var firstSeg = segs[0];
|
1294 | var lastSeg = segs.pop();
|
1295 | var currentTarget = target;
|
1296 |
|
1297 | for (var i = 0; i < segs.length; i++) {
|
1298 | currentTarget = currentTarget[segs[i]];
|
1299 |
|
1300 | if (currentTarget === undefined) {
|
1301 | return [undefined, undefined, lastSeg];
|
1302 | }
|
1303 | }
|
1304 |
|
1305 | var value = currentTarget[lastSeg];
|
1306 | return [value, currentTarget, lastSeg, firstSeg];
|
1307 | };
|
1308 |
|
1309 | var isPlainObject = function isPlainObject(obj) {
|
1310 | return _.isObject(obj) && (0, _getPrototypeOf.default)(obj) === Object.prototype;
|
1311 | };
|
1312 |
|
1313 | var continueWhile = function continueWhile(predicate, asyncFunction) {
|
1314 | if (predicate()) {
|
1315 | return asyncFunction().then(function () {
|
1316 | return continueWhile(predicate, asyncFunction);
|
1317 | });
|
1318 | }
|
1319 |
|
1320 | return _promise.default.resolve();
|
1321 | };
|
1322 |
|
1323 | module.exports = {
|
1324 | isNullOrUndefined: isNullOrUndefined,
|
1325 | ensureArray: ensureArray,
|
1326 | transformFetchOptions: transformFetchOptions,
|
1327 | getSessionToken: getSessionToken,
|
1328 | tap: tap,
|
1329 | inherits: inherits,
|
1330 | parseDate: parseDate,
|
1331 | setValue: setValue,
|
1332 | findValue: findValue,
|
1333 | isPlainObject: isPlainObject,
|
1334 | continueWhile: continueWhile
|
1335 | };
|
1336 |
|
1337 | }),
|
1338 |
|
1339 | (function(module, exports, __webpack_require__) {
|
1340 |
|
1341 | var isCallable = __webpack_require__(8);
|
1342 | var tryToString = __webpack_require__(78);
|
1343 |
|
1344 | var $TypeError = TypeError;
|
1345 |
|
1346 |
|
1347 | module.exports = function (argument) {
|
1348 | if (isCallable(argument)) return argument;
|
1349 | throw $TypeError(tryToString(argument) + ' is not a function');
|
1350 | };
|
1351 |
|
1352 |
|
1353 | }),
|
1354 |
|
1355 | (function(module, exports, __webpack_require__) {
|
1356 |
|
1357 |
|
1358 | var IndexedObject = __webpack_require__(95);
|
1359 | var requireObjectCoercible = __webpack_require__(122);
|
1360 |
|
1361 | module.exports = function (it) {
|
1362 | return IndexedObject(requireObjectCoercible(it));
|
1363 | };
|
1364 |
|
1365 |
|
1366 | }),
|
1367 |
|
1368 | (function(module, exports) {
|
1369 |
|
1370 | module.exports = true;
|
1371 |
|
1372 |
|
1373 | }),
|
1374 |
|
1375 | (function(module, exports, __webpack_require__) {
|
1376 |
|
1377 | var requireObjectCoercible = __webpack_require__(122);
|
1378 |
|
1379 | var $Object = Object;
|
1380 |
|
1381 |
|
1382 |
|
1383 | module.exports = function (argument) {
|
1384 | return $Object(requireObjectCoercible(argument));
|
1385 | };
|
1386 |
|
1387 |
|
1388 | }),
|
1389 |
|
1390 | (function(module, exports, __webpack_require__) {
|
1391 |
|
1392 | module.exports = __webpack_require__(397);
|
1393 |
|
1394 | }),
|
1395 |
|
1396 | (function(module, exports, __webpack_require__) {
|
1397 |
|
1398 | module.exports = __webpack_require__(404);
|
1399 |
|
1400 | }),
|
1401 |
|
1402 | (function(module, exports, __webpack_require__) {
|
1403 |
|
1404 | var DESCRIPTORS = __webpack_require__(14);
|
1405 | var definePropertyModule = __webpack_require__(23);
|
1406 | var createPropertyDescriptor = __webpack_require__(47);
|
1407 |
|
1408 | module.exports = DESCRIPTORS ? function (object, key, value) {
|
1409 | return definePropertyModule.f(object, key, createPropertyDescriptor(1, value));
|
1410 | } : function (object, key, value) {
|
1411 | object[key] = value;
|
1412 | return object;
|
1413 | };
|
1414 |
|
1415 |
|
1416 | }),
|
1417 |
|
1418 | (function(module, exports, __webpack_require__) {
|
1419 |
|
1420 | "use strict";
|
1421 |
|
1422 | var toIndexedObject = __webpack_require__(32);
|
1423 | var addToUnscopables = __webpack_require__(170);
|
1424 | var Iterators = __webpack_require__(50);
|
1425 | var InternalStateModule = __webpack_require__(43);
|
1426 | var defineProperty = __webpack_require__(23).f;
|
1427 | var defineIterator = __webpack_require__(132);
|
1428 | var IS_PURE = __webpack_require__(33);
|
1429 | var DESCRIPTORS = __webpack_require__(14);
|
1430 |
|
1431 | var ARRAY_ITERATOR = 'Array Iterator';
|
1432 | var setInternalState = InternalStateModule.set;
|
1433 | var getInternalState = InternalStateModule.getterFor(ARRAY_ITERATOR);
|
1434 |
|
1435 |
|
1436 |
|
1437 |
|
1438 |
|
1439 |
|
1440 |
|
1441 |
|
1442 |
|
1443 |
|
1444 |
|
1445 | module.exports = defineIterator(Array, 'Array', function (iterated, kind) {
|
1446 | setInternalState(this, {
|
1447 | type: ARRAY_ITERATOR,
|
1448 | target: toIndexedObject(iterated),
|
1449 | index: 0,
|
1450 | kind: kind
|
1451 | });
|
1452 |
|
1453 |
|
1454 | }, function () {
|
1455 | var state = getInternalState(this);
|
1456 | var target = state.target;
|
1457 | var kind = state.kind;
|
1458 | var index = state.index++;
|
1459 | if (!target || index >= target.length) {
|
1460 | state.target = undefined;
|
1461 | return { value: undefined, done: true };
|
1462 | }
|
1463 | if (kind == 'keys') return { value: index, done: false };
|
1464 | if (kind == 'values') return { value: target[index], done: false };
|
1465 | return { value: [index, target[index]], done: false };
|
1466 | }, 'values');
|
1467 |
|
1468 |
|
1469 |
|
1470 |
|
1471 | var values = Iterators.Arguments = Iterators.Array;
|
1472 |
|
1473 |
|
1474 | addToUnscopables('keys');
|
1475 | addToUnscopables('values');
|
1476 | addToUnscopables('entries');
|
1477 |
|
1478 |
|
1479 | if (!IS_PURE && DESCRIPTORS && values.name !== 'values') try {
|
1480 | defineProperty(values, 'name', { value: 'values' });
|
1481 | } catch (error) { }
|
1482 |
|
1483 |
|
1484 | }),
|
1485 |
|
1486 | (function(module, exports, __webpack_require__) {
|
1487 |
|
1488 | __webpack_require__(38);
|
1489 | var DOMIterables = __webpack_require__(319);
|
1490 | var global = __webpack_require__(7);
|
1491 | var classof = __webpack_require__(51);
|
1492 | var createNonEnumerableProperty = __webpack_require__(37);
|
1493 | var Iterators = __webpack_require__(50);
|
1494 | var wellKnownSymbol = __webpack_require__(9);
|
1495 |
|
1496 | var TO_STRING_TAG = wellKnownSymbol('toStringTag');
|
1497 |
|
1498 | for (var COLLECTION_NAME in DOMIterables) {
|
1499 | var Collection = global[COLLECTION_NAME];
|
1500 | var CollectionPrototype = Collection && Collection.prototype;
|
1501 | if (CollectionPrototype && classof(CollectionPrototype) !== TO_STRING_TAG) {
|
1502 | createNonEnumerableProperty(CollectionPrototype, TO_STRING_TAG, COLLECTION_NAME);
|
1503 | }
|
1504 | Iterators[COLLECTION_NAME] = Iterators.Array;
|
1505 | }
|
1506 |
|
1507 |
|
1508 | }),
|
1509 |
|
1510 | (function(module, exports, __webpack_require__) {
|
1511 |
|
1512 | var path = __webpack_require__(5);
|
1513 |
|
1514 | module.exports = function (CONSTRUCTOR) {
|
1515 | return path[CONSTRUCTOR + 'Prototype'];
|
1516 | };
|
1517 |
|
1518 |
|
1519 | }),
|
1520 |
|
1521 | (function(module, exports, __webpack_require__) {
|
1522 |
|
1523 | var toLength = __webpack_require__(293);
|
1524 |
|
1525 |
|
1526 |
|
1527 | module.exports = function (obj) {
|
1528 | return toLength(obj.length);
|
1529 | };
|
1530 |
|
1531 |
|
1532 | }),
|
1533 |
|
1534 | (function(module, exports, __webpack_require__) {
|
1535 |
|
1536 | var bind = __webpack_require__(48);
|
1537 | var call = __webpack_require__(15);
|
1538 | var anObject = __webpack_require__(20);
|
1539 | var tryToString = __webpack_require__(78);
|
1540 | var isArrayIteratorMethod = __webpack_require__(167);
|
1541 | var lengthOfArrayLike = __webpack_require__(41);
|
1542 | var isPrototypeOf = __webpack_require__(19);
|
1543 | var getIterator = __webpack_require__(168);
|
1544 | var getIteratorMethod = __webpack_require__(106);
|
1545 | var iteratorClose = __webpack_require__(169);
|
1546 |
|
1547 | var $TypeError = TypeError;
|
1548 |
|
1549 | var Result = function (stopped, result) {
|
1550 | this.stopped = stopped;
|
1551 | this.result = result;
|
1552 | };
|
1553 |
|
1554 | var ResultPrototype = Result.prototype;
|
1555 |
|
1556 | module.exports = function (iterable, unboundFunction, options) {
|
1557 | var that = options && options.that;
|
1558 | var AS_ENTRIES = !!(options && options.AS_ENTRIES);
|
1559 | var IS_ITERATOR = !!(options && options.IS_ITERATOR);
|
1560 | var INTERRUPTED = !!(options && options.INTERRUPTED);
|
1561 | var fn = bind(unboundFunction, that);
|
1562 | var iterator, iterFn, index, length, result, next, step;
|
1563 |
|
1564 | var stop = function (condition) {
|
1565 | if (iterator) iteratorClose(iterator, 'normal', condition);
|
1566 | return new Result(true, condition);
|
1567 | };
|
1568 |
|
1569 | var callFn = function (value) {
|
1570 | if (AS_ENTRIES) {
|
1571 | anObject(value);
|
1572 | return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);
|
1573 | } return INTERRUPTED ? fn(value, stop) : fn(value);
|
1574 | };
|
1575 |
|
1576 | if (IS_ITERATOR) {
|
1577 | iterator = iterable;
|
1578 | } else {
|
1579 | iterFn = getIteratorMethod(iterable);
|
1580 | if (!iterFn) throw $TypeError(tryToString(iterable) + ' is not iterable');
|
1581 |
|
1582 | if (isArrayIteratorMethod(iterFn)) {
|
1583 | for (index = 0, length = lengthOfArrayLike(iterable); length > index; index++) {
|
1584 | result = callFn(iterable[index]);
|
1585 | if (result && isPrototypeOf(ResultPrototype, result)) return result;
|
1586 | } return new Result(false);
|
1587 | }
|
1588 | iterator = getIterator(iterable, iterFn);
|
1589 | }
|
1590 |
|
1591 | next = iterator.next;
|
1592 | while (!(step = call(next, iterator)).done) {
|
1593 | try {
|
1594 | result = callFn(step.value);
|
1595 | } catch (error) {
|
1596 | iteratorClose(iterator, 'throw', error);
|
1597 | }
|
1598 | if (typeof result == 'object' && result && isPrototypeOf(ResultPrototype, result)) return result;
|
1599 | } return new Result(false);
|
1600 | };
|
1601 |
|
1602 |
|
1603 | }),
|
1604 |
|
1605 | (function(module, exports, __webpack_require__) {
|
1606 |
|
1607 | var NATIVE_WEAK_MAP = __webpack_require__(171);
|
1608 | var global = __webpack_require__(7);
|
1609 | var uncurryThis = __webpack_require__(4);
|
1610 | var isObject = __webpack_require__(11);
|
1611 | var createNonEnumerableProperty = __webpack_require__(37);
|
1612 | var hasOwn = __webpack_require__(13);
|
1613 | var shared = __webpack_require__(124);
|
1614 | var sharedKey = __webpack_require__(101);
|
1615 | var hiddenKeys = __webpack_require__(80);
|
1616 |
|
1617 | var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
|
1618 | var TypeError = global.TypeError;
|
1619 | var WeakMap = global.WeakMap;
|
1620 | var set, get, has;
|
1621 |
|
1622 | var enforce = function (it) {
|
1623 | return has(it) ? get(it) : set(it, {});
|
1624 | };
|
1625 |
|
1626 | var getterFor = function (TYPE) {
|
1627 | return function (it) {
|
1628 | var state;
|
1629 | if (!isObject(it) || (state = get(it)).type !== TYPE) {
|
1630 | throw TypeError('Incompatible receiver, ' + TYPE + ' required');
|
1631 | } return state;
|
1632 | };
|
1633 | };
|
1634 |
|
1635 | if (NATIVE_WEAK_MAP || shared.state) {
|
1636 | var store = shared.state || (shared.state = new WeakMap());
|
1637 | var wmget = uncurryThis(store.get);
|
1638 | var wmhas = uncurryThis(store.has);
|
1639 | var wmset = uncurryThis(store.set);
|
1640 | set = function (it, metadata) {
|
1641 | if (wmhas(store, it)) throw new TypeError(OBJECT_ALREADY_INITIALIZED);
|
1642 | metadata.facade = it;
|
1643 | wmset(store, it, metadata);
|
1644 | return metadata;
|
1645 | };
|
1646 | get = function (it) {
|
1647 | return wmget(store, it) || {};
|
1648 | };
|
1649 | has = function (it) {
|
1650 | return wmhas(store, it);
|
1651 | };
|
1652 | } else {
|
1653 | var STATE = sharedKey('state');
|
1654 | hiddenKeys[STATE] = true;
|
1655 | set = function (it, metadata) {
|
1656 | if (hasOwn(it, STATE)) throw new TypeError(OBJECT_ALREADY_INITIALIZED);
|
1657 | metadata.facade = it;
|
1658 | createNonEnumerableProperty(it, STATE, metadata);
|
1659 | return metadata;
|
1660 | };
|
1661 | get = function (it) {
|
1662 | return hasOwn(it, STATE) ? it[STATE] : {};
|
1663 | };
|
1664 | has = function (it) {
|
1665 | return hasOwn(it, STATE);
|
1666 | };
|
1667 | }
|
1668 |
|
1669 | module.exports = {
|
1670 | set: set,
|
1671 | get: get,
|
1672 | has: has,
|
1673 | enforce: enforce,
|
1674 | getterFor: getterFor
|
1675 | };
|
1676 |
|
1677 |
|
1678 | /***/ }),
|
1679 | /* 44 */
|
1680 | /***/ (function(module, exports, __webpack_require__) {
|
1681 |
|
1682 | var createNonEnumerableProperty = __webpack_require__(37);
|
1683 |
|
1684 | module.exports = function (target, key, value, options) {
|
1685 | if (options && options.enumerable) target[key] = value;
|
1686 | else createNonEnumerableProperty(target, key, value);
|
1687 | return target;
|
1688 | };
|
1689 |
|
1690 |
|
1691 | }),
|
1692 |
|
1693 | (function(module, __webpack_exports__, __webpack_require__) {
|
1694 |
|
1695 | "use strict";
|
1696 | __webpack_exports__["a"] = has;
|
1697 | var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(6);
|
1698 |
|
1699 |
|
1700 |
|
1701 | function has(obj, key) {
|
1702 | return obj != null && __WEBPACK_IMPORTED_MODULE_0__setup_js__["i" ].call(obj, key);
|
1703 | }
|
1704 |
|
1705 |
|
1706 | }),
|
1707 |
|
1708 | (function(module, exports, __webpack_require__) {
|
1709 |
|
1710 | "use strict";
|
1711 |
|
1712 |
|
1713 | var _interopRequireDefault = __webpack_require__(1);
|
1714 |
|
1715 | var _setPrototypeOf = _interopRequireDefault(__webpack_require__(239));
|
1716 |
|
1717 | var _getPrototypeOf = _interopRequireDefault(__webpack_require__(148));
|
1718 |
|
1719 | var _ = __webpack_require__(3);
|
1720 |
|
1721 |
|
1722 |
|
1723 |
|
1724 |
|
1725 | function AVError(code, message) {
|
1726 | if (this instanceof AVError ? this.constructor : void 0) {
|
1727 | var error = new Error(message);
|
1728 | (0, _setPrototypeOf.default)(error, (0, _getPrototypeOf.default)(this));
|
1729 | error.code = code;
|
1730 | return error;
|
1731 | }
|
1732 |
|
1733 | return new AVError(code, message);
|
1734 | }
|
1735 |
|
1736 | AVError.prototype = Object.create(Error.prototype, {
|
1737 | constructor: {
|
1738 | value: Error,
|
1739 | enumerable: false,
|
1740 | writable: true,
|
1741 | configurable: true
|
1742 | }
|
1743 | });
|
1744 | (0, _setPrototypeOf.default)(AVError, Error);
|
1745 |
|
1746 | _.extend(AVError,
|
1747 |
|
1748 | {
|
1749 | |
1750 |
|
1751 |
|
1752 |
|
1753 | OTHER_CAUSE: -1,
|
1754 |
|
1755 | |
1756 |
|
1757 |
|
1758 |
|
1759 |
|
1760 | INTERNAL_SERVER_ERROR: 1,
|
1761 |
|
1762 | |
1763 |
|
1764 |
|
1765 |
|
1766 | CONNECTION_FAILED: 100,
|
1767 |
|
1768 | |
1769 |
|
1770 |
|
1771 |
|
1772 | OBJECT_NOT_FOUND: 101,
|
1773 |
|
1774 | |
1775 |
|
1776 |
|
1777 |
|
1778 |
|
1779 | INVALID_QUERY: 102,
|
1780 |
|
1781 | |
1782 |
|
1783 |
|
1784 |
|
1785 |
|
1786 |
|
1787 | INVALID_CLASS_NAME: 103,
|
1788 |
|
1789 | |
1790 |
|
1791 |
|
1792 |
|
1793 | MISSING_OBJECT_ID: 104,
|
1794 |
|
1795 | |
1796 |
|
1797 |
|
1798 |
|
1799 |
|
1800 | INVALID_KEY_NAME: 105,
|
1801 |
|
1802 | |
1803 |
|
1804 |
|
1805 |
|
1806 |
|
1807 | INVALID_POINTER: 106,
|
1808 |
|
1809 | |
1810 |
|
1811 |
|
1812 |
|
1813 |
|
1814 |
|
1815 | INVALID_JSON: 107,
|
1816 |
|
1817 | |
1818 |
|
1819 |
|
1820 |
|
1821 |
|
1822 | COMMAND_UNAVAILABLE: 108,
|
1823 |
|
1824 | |
1825 |
|
1826 |
|
1827 |
|
1828 | NOT_INITIALIZED: 109,
|
1829 |
|
1830 | |
1831 |
|
1832 |
|
1833 |
|
1834 | INCORRECT_TYPE: 111,
|
1835 |
|
1836 | |
1837 |
|
1838 |
|
1839 |
|
1840 |
|
1841 |
|
1842 | INVALID_CHANNEL_NAME: 112,
|
1843 |
|
1844 | |
1845 |
|
1846 |
|
1847 |
|
1848 | PUSH_MISCONFIGURED: 115,
|
1849 |
|
1850 | |
1851 |
|
1852 |
|
1853 |
|
1854 | OBJECT_TOO_LARGE: 116,
|
1855 |
|
1856 | |
1857 |
|
1858 |
|
1859 |
|
1860 | OPERATION_FORBIDDEN: 119,
|
1861 |
|
1862 | |
1863 |
|
1864 |
|
1865 |
|
1866 | CACHE_MISS: 120,
|
1867 |
|
1868 | |
1869 |
|
1870 |
|
1871 |
|
1872 |
|
1873 | INVALID_NESTED_KEY: 121,
|
1874 |
|
1875 | |
1876 |
|
1877 |
|
1878 |
|
1879 |
|
1880 |
|
1881 | INVALID_FILE_NAME: 122,
|
1882 |
|
1883 | |
1884 |
|
1885 |
|
1886 |
|
1887 | INVALID_ACL: 123,
|
1888 |
|
1889 | |
1890 |
|
1891 |
|
1892 |
|
1893 |
|
1894 | TIMEOUT: 124,
|
1895 |
|
1896 | |
1897 |
|
1898 |
|
1899 |
|
1900 | INVALID_EMAIL_ADDRESS: 125,
|
1901 |
|
1902 | |
1903 |
|
1904 |
|
1905 |
|
1906 | MISSING_CONTENT_TYPE: 126,
|
1907 |
|
1908 | |
1909 |
|
1910 |
|
1911 |
|
1912 | MISSING_CONTENT_LENGTH: 127,
|
1913 |
|
1914 | |
1915 |
|
1916 |
|
1917 |
|
1918 | INVALID_CONTENT_LENGTH: 128,
|
1919 |
|
1920 | |
1921 |
|
1922 |
|
1923 |
|
1924 | FILE_TOO_LARGE: 129,
|
1925 |
|
1926 | |
1927 |
|
1928 |
|
1929 |
|
1930 | FILE_SAVE_ERROR: 130,
|
1931 |
|
1932 | |
1933 |
|
1934 |
|
1935 |
|
1936 | FILE_DELETE_ERROR: 153,
|
1937 |
|
1938 | |
1939 |
|
1940 |
|
1941 |
|
1942 |
|
1943 | DUPLICATE_VALUE: 137,
|
1944 |
|
1945 | |
1946 |
|
1947 |
|
1948 |
|
1949 | INVALID_ROLE_NAME: 139,
|
1950 |
|
1951 | |
1952 |
|
1953 |
|
1954 |
|
1955 |
|
1956 | EXCEEDED_QUOTA: 140,
|
1957 |
|
1958 | |
1959 |
|
1960 |
|
1961 |
|
1962 | SCRIPT_FAILED: 141,
|
1963 |
|
1964 | |
1965 |
|
1966 |
|
1967 |
|
1968 | VALIDATION_ERROR: 142,
|
1969 |
|
1970 | |
1971 |
|
1972 |
|
1973 |
|
1974 | INVALID_IMAGE_DATA: 150,
|
1975 |
|
1976 | |
1977 |
|
1978 |
|
1979 |
|
1980 | UNSAVED_FILE_ERROR: 151,
|
1981 |
|
1982 | |
1983 |
|
1984 |
|
1985 |
|
1986 | INVALID_PUSH_TIME_ERROR: 152,
|
1987 |
|
1988 | |
1989 |
|
1990 |
|
1991 |
|
1992 | USERNAME_MISSING: 200,
|
1993 |
|
1994 | |
1995 |
|
1996 |
|
1997 |
|
1998 | PASSWORD_MISSING: 201,
|
1999 |
|
2000 | |
2001 |
|
2002 |
|
2003 |
|
2004 | USERNAME_TAKEN: 202,
|
2005 |
|
2006 | |
2007 |
|
2008 |
|
2009 |
|
2010 | EMAIL_TAKEN: 203,
|
2011 |
|
2012 | |
2013 |
|
2014 |
|
2015 |
|
2016 | EMAIL_MISSING: 204,
|
2017 |
|
2018 | |
2019 |
|
2020 |
|
2021 |
|
2022 | EMAIL_NOT_FOUND: 205,
|
2023 |
|
2024 | |
2025 |
|
2026 |
|
2027 |
|
2028 |
|
2029 | SESSION_MISSING: 206,
|
2030 |
|
2031 | |
2032 |
|
2033 |
|
2034 |
|
2035 | MUST_CREATE_USER_THROUGH_SIGNUP: 207,
|
2036 |
|
2037 | |
2038 |
|
2039 |
|
2040 |
|
2041 |
|
2042 | ACCOUNT_ALREADY_LINKED: 208,
|
2043 |
|
2044 | |
2045 |
|
2046 |
|
2047 |
|
2048 |
|
2049 | LINKED_ID_MISSING: 250,
|
2050 |
|
2051 | |
2052 |
|
2053 |
|
2054 |
|
2055 |
|
2056 | INVALID_LINKED_SESSION: 251,
|
2057 |
|
2058 | |
2059 |
|
2060 |
|
2061 |
|
2062 |
|
2063 | UNSUPPORTED_SERVICE: 252,
|
2064 |
|
2065 | |
2066 |
|
2067 |
|
2068 |
|
2069 |
|
2070 |
|
2071 |
|
2072 | X_DOMAIN_REQUEST: 602
|
2073 | });
|
2074 |
|
2075 | module.exports = AVError;
|
2076 |
|
2077 | }),
|
2078 |
|
2079 | (function(module, exports) {
|
2080 |
|
2081 | module.exports = function (bitmap, value) {
|
2082 | return {
|
2083 | enumerable: !(bitmap & 1),
|
2084 | configurable: !(bitmap & 2),
|
2085 | writable: !(bitmap & 4),
|
2086 | value: value
|
2087 | };
|
2088 | };
|
2089 |
|
2090 |
|
2091 | }),
|
2092 |
|
2093 | (function(module, exports, __webpack_require__) {
|
2094 |
|
2095 | var uncurryThis = __webpack_require__(4);
|
2096 | var aCallable = __webpack_require__(31);
|
2097 | var NATIVE_BIND = __webpack_require__(76);
|
2098 |
|
2099 | var bind = uncurryThis(uncurryThis.bind);
|
2100 |
|
2101 |
|
2102 | module.exports = function (fn, that) {
|
2103 | aCallable(fn);
|
2104 | return that === undefined ? fn : NATIVE_BIND ? bind(fn, that) : function (/* ...args */) {
|
2105 | return fn.apply(that, arguments);
|
2106 | };
|
2107 | };
|
2108 |
|
2109 |
|
2110 | }),
|
2111 |
|
2112 | (function(module, exports, __webpack_require__) {
|
2113 |
|
2114 |
|
2115 | var anObject = __webpack_require__(20);
|
2116 | var definePropertiesModule = __webpack_require__(129);
|
2117 | var enumBugKeys = __webpack_require__(128);
|
2118 | var hiddenKeys = __webpack_require__(80);
|
2119 | var html = __webpack_require__(166);
|
2120 | var documentCreateElement = __webpack_require__(125);
|
2121 | var sharedKey = __webpack_require__(101);
|
2122 |
|
2123 | var GT = '>';
|
2124 | var LT = '<';
|
2125 | var PROTOTYPE = 'prototype';
|
2126 | var SCRIPT = 'script';
|
2127 | var IE_PROTO = sharedKey('IE_PROTO');
|
2128 |
|
2129 | var EmptyConstructor = function () { };
|
2130 |
|
2131 | var scriptTag = function (content) {
|
2132 | return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
|
2133 | };
|
2134 |
|
2135 |
|
2136 | var NullProtoObjectViaActiveX = function (activeXDocument) {
|
2137 | activeXDocument.write(scriptTag(''));
|
2138 | activeXDocument.close();
|
2139 | var temp = activeXDocument.parentWindow.Object;
|
2140 | activeXDocument = null;
|
2141 | return temp;
|
2142 | };
|
2143 |
|
2144 |
|
2145 | var NullProtoObjectViaIFrame = function () {
|
2146 |
|
2147 | var iframe = documentCreateElement('iframe');
|
2148 | var JS = 'java' + SCRIPT + ':';
|
2149 | var iframeDocument;
|
2150 | iframe.style.display = 'none';
|
2151 | html.appendChild(iframe);
|
2152 |
|
2153 | iframe.src = String(JS);
|
2154 | iframeDocument = iframe.contentWindow.document;
|
2155 | iframeDocument.open();
|
2156 | iframeDocument.write(scriptTag('document.F=Object'));
|
2157 | iframeDocument.close();
|
2158 | return iframeDocument.F;
|
2159 | };
|
2160 |
|
2161 |
|
2162 |
|
2163 |
|
2164 |
|
2165 |
|
2166 | var activeXDocument;
|
2167 | var NullProtoObject = function () {
|
2168 | try {
|
2169 | activeXDocument = new ActiveXObject('htmlfile');
|
2170 | } catch (error) { }
|
2171 | NullProtoObject = typeof document != 'undefined'
|
2172 | ? document.domain && activeXDocument
|
2173 | ? NullProtoObjectViaActiveX(activeXDocument)
|
2174 | : NullProtoObjectViaIFrame()
|
2175 | : NullProtoObjectViaActiveX(activeXDocument);
|
2176 | var length = enumBugKeys.length;
|
2177 | while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
|
2178 | return NullProtoObject();
|
2179 | };
|
2180 |
|
2181 | hiddenKeys[IE_PROTO] = true;
|
2182 |
|
2183 |
|
2184 |
|
2185 |
|
2186 | module.exports = Object.create || function create(O, Properties) {
|
2187 | var result;
|
2188 | if (O !== null) {
|
2189 | EmptyConstructor[PROTOTYPE] = anObject(O);
|
2190 | result = new EmptyConstructor();
|
2191 | EmptyConstructor[PROTOTYPE] = null;
|
2192 |
|
2193 | result[IE_PROTO] = O;
|
2194 | } else result = NullProtoObject();
|
2195 | return Properties === undefined ? result : definePropertiesModule.f(result, Properties);
|
2196 | };
|
2197 |
|
2198 |
|
2199 | }),
|
2200 |
|
2201 | (function(module, exports) {
|
2202 |
|
2203 | module.exports = {};
|
2204 |
|
2205 |
|
2206 | }),
|
2207 |
|
2208 | (function(module, exports, __webpack_require__) {
|
2209 |
|
2210 | var TO_STRING_TAG_SUPPORT = __webpack_require__(130);
|
2211 | var isCallable = __webpack_require__(8);
|
2212 | var classofRaw = __webpack_require__(63);
|
2213 | var wellKnownSymbol = __webpack_require__(9);
|
2214 |
|
2215 | var TO_STRING_TAG = wellKnownSymbol('toStringTag');
|
2216 | var $Object = Object;
|
2217 |
|
2218 |
|
2219 | var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
|
2220 |
|
2221 |
|
2222 | var tryGet = function (it, key) {
|
2223 | try {
|
2224 | return it[key];
|
2225 | } catch (error) { }
|
2226 | };
|
2227 |
|
2228 |
|
2229 | module.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {
|
2230 | var O, tag, result;
|
2231 | return it === undefined ? 'Undefined' : it === null ? 'Null'
|
2232 |
|
2233 | : typeof (tag = tryGet(O = $Object(it), TO_STRING_TAG)) == 'string' ? tag
|
2234 |
|
2235 | : CORRECT_ARGUMENTS ? classofRaw(O)
|
2236 |
|
2237 | : (result = classofRaw(O)) == 'Object' && isCallable(O.callee) ? 'Arguments' : result;
|
2238 | };
|
2239 |
|
2240 |
|
2241 | }),
|
2242 |
|
2243 | (function(module, exports, __webpack_require__) {
|
2244 |
|
2245 | var TO_STRING_TAG_SUPPORT = __webpack_require__(130);
|
2246 | var defineProperty = __webpack_require__(23).f;
|
2247 | var createNonEnumerableProperty = __webpack_require__(37);
|
2248 | var hasOwn = __webpack_require__(13);
|
2249 | var toString = __webpack_require__(300);
|
2250 | var wellKnownSymbol = __webpack_require__(9);
|
2251 |
|
2252 | var TO_STRING_TAG = wellKnownSymbol('toStringTag');
|
2253 |
|
2254 | module.exports = function (it, TAG, STATIC, SET_METHOD) {
|
2255 | if (it) {
|
2256 | var target = STATIC ? it : it.prototype;
|
2257 | if (!hasOwn(target, TO_STRING_TAG)) {
|
2258 | defineProperty(target, TO_STRING_TAG, { configurable: true, value: TAG });
|
2259 | }
|
2260 | if (SET_METHOD && !TO_STRING_TAG_SUPPORT) {
|
2261 | createNonEnumerableProperty(target, 'toString', toString);
|
2262 | }
|
2263 | }
|
2264 | };
|
2265 |
|
2266 |
|
2267 | }),
|
2268 |
|
2269 | (function(module, exports) {
|
2270 |
|
2271 |
|
2272 |
|
2273 |
|
2274 | }),
|
2275 |
|
2276 | (function(module, exports, __webpack_require__) {
|
2277 |
|
2278 | "use strict";
|
2279 |
|
2280 | var aCallable = __webpack_require__(31);
|
2281 |
|
2282 | var PromiseCapability = function (C) {
|
2283 | var resolve, reject;
|
2284 | this.promise = new C(function ($$resolve, $$reject) {
|
2285 | if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor');
|
2286 | resolve = $$resolve;
|
2287 | reject = $$reject;
|
2288 | });
|
2289 | this.resolve = aCallable(resolve);
|
2290 | this.reject = aCallable(reject);
|
2291 | };
|
2292 |
|
2293 |
|
2294 |
|
2295 | module.exports.f = function (C) {
|
2296 | return new PromiseCapability(C);
|
2297 | };
|
2298 |
|
2299 |
|
2300 | }),
|
2301 |
|
2302 | (function(module, exports, __webpack_require__) {
|
2303 |
|
2304 | "use strict";
|
2305 |
|
2306 | var charAt = __webpack_require__(318).charAt;
|
2307 | var toString = __webpack_require__(81);
|
2308 | var InternalStateModule = __webpack_require__(43);
|
2309 | var defineIterator = __webpack_require__(132);
|
2310 |
|
2311 | var STRING_ITERATOR = 'String Iterator';
|
2312 | var setInternalState = InternalStateModule.set;
|
2313 | var getInternalState = InternalStateModule.getterFor(STRING_ITERATOR);
|
2314 |
|
2315 |
|
2316 |
|
2317 | defineIterator(String, 'String', function (iterated) {
|
2318 | setInternalState(this, {
|
2319 | type: STRING_ITERATOR,
|
2320 | string: toString(iterated),
|
2321 | index: 0
|
2322 | });
|
2323 |
|
2324 |
|
2325 | }, function next() {
|
2326 | var state = getInternalState(this);
|
2327 | var string = state.string;
|
2328 | var index = state.index;
|
2329 | var point;
|
2330 | if (index >= string.length) return { value: undefined, done: true };
|
2331 | point = charAt(string, index);
|
2332 | state.index += point.length;
|
2333 | return { value: point, done: false };
|
2334 | });
|
2335 |
|
2336 |
|
2337 | }),
|
2338 |
|
2339 | (function(module, __webpack_exports__, __webpack_require__) {
|
2340 |
|
2341 | "use strict";
|
2342 | __webpack_exports__["a"] = isObject;
|
2343 |
|
2344 | function isObject(obj) {
|
2345 | var type = typeof obj;
|
2346 | return type === 'function' || type === 'object' && !!obj;
|
2347 | }
|
2348 |
|
2349 |
|
2350 | }),
|
2351 |
|
2352 | (function(module, __webpack_exports__, __webpack_require__) {
|
2353 |
|
2354 | "use strict";
|
2355 | var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(6);
|
2356 | var __WEBPACK_IMPORTED_MODULE_1__tagTester_js__ = __webpack_require__(17);
|
2357 |
|
2358 |
|
2359 |
|
2360 |
|
2361 |
|
2362 | __webpack_exports__["a"] = (__WEBPACK_IMPORTED_MODULE_0__setup_js__["k" ] || Object(__WEBPACK_IMPORTED_MODULE_1__tagTester_js__["a" ])('Array'));
|
2363 |
|
2364 |
|
2365 | }),
|
2366 |
|
2367 | (function(module, __webpack_exports__, __webpack_require__) {
|
2368 |
|
2369 | "use strict";
|
2370 | __webpack_exports__["a"] = each;
|
2371 | var __WEBPACK_IMPORTED_MODULE_0__optimizeCb_js__ = __webpack_require__(87);
|
2372 | var __WEBPACK_IMPORTED_MODULE_1__isArrayLike_js__ = __webpack_require__(26);
|
2373 | var __WEBPACK_IMPORTED_MODULE_2__keys_js__ = __webpack_require__(16);
|
2374 |
|
2375 |
|
2376 |
|
2377 |
|
2378 |
|
2379 |
|
2380 |
|
2381 |
|
2382 | function each(obj, iteratee, context) {
|
2383 | iteratee = Object(__WEBPACK_IMPORTED_MODULE_0__optimizeCb_js__["a" ])(iteratee, context);
|
2384 | var i, length;
|
2385 | if (Object(__WEBPACK_IMPORTED_MODULE_1__isArrayLike_js__["a" ])(obj)) {
|
2386 | for (i = 0, length = obj.length; i < length; i++) {
|
2387 | iteratee(obj[i], i, obj);
|
2388 | }
|
2389 | } else {
|
2390 | var _keys = Object(__WEBPACK_IMPORTED_MODULE_2__keys_js__["a" ])(obj);
|
2391 | for (i = 0, length = _keys.length; i < length; i++) {
|
2392 | iteratee(obj[_keys[i]], _keys[i], obj);
|
2393 | }
|
2394 | }
|
2395 | return obj;
|
2396 | }
|
2397 |
|
2398 |
|
2399 | }),
|
2400 |
|
2401 | (function(module, exports, __webpack_require__) {
|
2402 |
|
2403 | module.exports = __webpack_require__(410);
|
2404 |
|
2405 | }),
|
2406 |
|
2407 | (function(module, exports, __webpack_require__) {
|
2408 |
|
2409 | "use strict";
|
2410 |
|
2411 |
|
2412 | function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
2413 |
|
2414 |
|
2415 |
|
2416 |
|
2417 |
|
2418 |
|
2419 | exports.log = log;
|
2420 | exports.formatArgs = formatArgs;
|
2421 | exports.save = save;
|
2422 | exports.load = load;
|
2423 | exports.useColors = useColors;
|
2424 | exports.storage = localstorage();
|
2425 |
|
2426 |
|
2427 |
|
2428 |
|
2429 | exports.colors = ['#0000CC', '#0000FF', '#0033CC', '#0033FF', '#0066CC', '#0066FF', '#0099CC', '#0099FF', '#00CC00', '#00CC33', '#00CC66', '#00CC99', '#00CCCC', '#00CCFF', '#3300CC', '#3300FF', '#3333CC', '#3333FF', '#3366CC', '#3366FF', '#3399CC', '#3399FF', '#33CC00', '#33CC33', '#33CC66', '#33CC99', '#33CCCC', '#33CCFF', '#6600CC', '#6600FF', '#6633CC', '#6633FF', '#66CC00', '#66CC33', '#9900CC', '#9900FF', '#9933CC', '#9933FF', '#99CC00', '#99CC33', '#CC0000', '#CC0033', '#CC0066', '#CC0099', '#CC00CC', '#CC00FF', '#CC3300', '#CC3333', '#CC3366', '#CC3399', '#CC33CC', '#CC33FF', '#CC6600', '#CC6633', '#CC9900', '#CC9933', '#CCCC00', '#CCCC33', '#FF0000', '#FF0033', '#FF0066', '#FF0099', '#FF00CC', '#FF00FF', '#FF3300', '#FF3333', '#FF3366', '#FF3399', '#FF33CC', '#FF33FF', '#FF6600', '#FF6633', '#FF9900', '#FF9933', '#FFCC00', '#FFCC33'];
|
2430 |
|
2431 |
|
2432 |
|
2433 |
|
2434 |
|
2435 |
|
2436 |
|
2437 |
|
2438 |
|
2439 | function useColors() {
|
2440 |
|
2441 |
|
2442 |
|
2443 | if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {
|
2444 | return true;
|
2445 | }
|
2446 |
|
2447 |
|
2448 | if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
|
2449 | return false;
|
2450 | }
|
2451 |
|
2452 |
|
2453 |
|
2454 | return typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance ||
|
2455 | typeof window !== 'undefined' && window.console && (window.console.firebug || window.console.exception && window.console.table) ||
|
2456 |
|
2457 | typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 ||
|
2458 | typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
|
2459 | }
|
2460 |
|
2461 |
|
2462 |
|
2463 |
|
2464 |
|
2465 |
|
2466 |
|
2467 | function formatArgs(args) {
|
2468 | args[0] = (this.useColors ? '%c' : '') + this.namespace + (this.useColors ? ' %c' : ' ') + args[0] + (this.useColors ? '%c ' : ' ') + '+' + module.exports.humanize(this.diff);
|
2469 |
|
2470 | if (!this.useColors) {
|
2471 | return;
|
2472 | }
|
2473 |
|
2474 | var c = 'color: ' + this.color;
|
2475 | args.splice(1, 0, c, 'color: inherit');
|
2476 |
|
2477 |
|
2478 |
|
2479 | var index = 0;
|
2480 | var lastC = 0;
|
2481 | args[0].replace(/%[a-zA-Z%]/g, function (match) {
|
2482 | if (match === '%%') {
|
2483 | return;
|
2484 | }
|
2485 |
|
2486 | index++;
|
2487 |
|
2488 | if (match === '%c') {
|
2489 |
|
2490 |
|
2491 | lastC = index;
|
2492 | }
|
2493 | });
|
2494 | args.splice(lastC, 0, c);
|
2495 | }
|
2496 |
|
2497 |
|
2498 |
|
2499 |
|
2500 |
|
2501 |
|
2502 |
|
2503 |
|
2504 | function log() {
|
2505 | var _console;
|
2506 |
|
2507 |
|
2508 |
|
2509 | return (typeof console === "undefined" ? "undefined" : _typeof(console)) === 'object' && console.log && (_console = console).log.apply(_console, arguments);
|
2510 | }
|
2511 |
|
2512 |
|
2513 |
|
2514 |
|
2515 |
|
2516 |
|
2517 |
|
2518 |
|
2519 | function save(namespaces) {
|
2520 | try {
|
2521 | if (namespaces) {
|
2522 | exports.storage.setItem('debug', namespaces);
|
2523 | } else {
|
2524 | exports.storage.removeItem('debug');
|
2525 | }
|
2526 | } catch (error) {
|
2527 |
|
2528 | }
|
2529 | }
|
2530 |
|
2531 |
|
2532 |
|
2533 |
|
2534 |
|
2535 |
|
2536 |
|
2537 |
|
2538 | function load() {
|
2539 | var r;
|
2540 |
|
2541 | try {
|
2542 | r = exports.storage.getItem('debug');
|
2543 | } catch (error) {}
|
2544 |
|
2545 |
|
2546 |
|
2547 |
|
2548 | if (!r && typeof process !== 'undefined' && 'env' in process) {
|
2549 | r = process.env.DEBUG;
|
2550 | }
|
2551 |
|
2552 | return r;
|
2553 | }
|
2554 |
|
2555 |
|
2556 |
|
2557 |
|
2558 |
|
2559 |
|
2560 |
|
2561 |
|
2562 |
|
2563 |
|
2564 |
|
2565 |
|
2566 | function localstorage() {
|
2567 | try {
|
2568 |
|
2569 |
|
2570 | return localStorage;
|
2571 | } catch (error) {
|
2572 |
|
2573 | }
|
2574 | }
|
2575 |
|
2576 | module.exports = __webpack_require__(415)(exports);
|
2577 | var formatters = module.exports.formatters;
|
2578 |
|
2579 |
|
2580 |
|
2581 |
|
2582 | formatters.j = function (v) {
|
2583 | try {
|
2584 | return JSON.stringify(v);
|
2585 | } catch (error) {
|
2586 | return '[UnexpectedJSONParseError]: ' + error.message;
|
2587 | }
|
2588 | };
|
2589 |
|
2590 |
|
2591 |
|
2592 | }),
|
2593 |
|
2594 | (function(module, exports, __webpack_require__) {
|
2595 |
|
2596 | module.exports = __webpack_require__(241);
|
2597 |
|
2598 | }),
|
2599 |
|
2600 | (function(module, exports, __webpack_require__) {
|
2601 |
|
2602 | var DESCRIPTORS = __webpack_require__(14);
|
2603 | var call = __webpack_require__(15);
|
2604 | var propertyIsEnumerableModule = __webpack_require__(121);
|
2605 | var createPropertyDescriptor = __webpack_require__(47);
|
2606 | var toIndexedObject = __webpack_require__(32);
|
2607 | var toPropertyKey = __webpack_require__(96);
|
2608 | var hasOwn = __webpack_require__(13);
|
2609 | var IE8_DOM_DEFINE = __webpack_require__(159);
|
2610 |
|
2611 |
|
2612 | var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
2613 |
|
2614 |
|
2615 |
|
2616 | exports.f = DESCRIPTORS ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
|
2617 | O = toIndexedObject(O);
|
2618 | P = toPropertyKey(P);
|
2619 | if (IE8_DOM_DEFINE) try {
|
2620 | return $getOwnPropertyDescriptor(O, P);
|
2621 | } catch (error) { }
|
2622 | if (hasOwn(O, P)) return createPropertyDescriptor(!call(propertyIsEnumerableModule.f, O, P), O[P]);
|
2623 | };
|
2624 |
|
2625 |
|
2626 | }),
|
2627 |
|
2628 | (function(module, exports, __webpack_require__) {
|
2629 |
|
2630 | var uncurryThis = __webpack_require__(4);
|
2631 |
|
2632 | var toString = uncurryThis({}.toString);
|
2633 | var stringSlice = uncurryThis(''.slice);
|
2634 |
|
2635 | module.exports = function (it) {
|
2636 | return stringSlice(toString(it), 8, -1);
|
2637 | };
|
2638 |
|
2639 |
|
2640 | }),
|
2641 |
|
2642 | (function(module, exports, __webpack_require__) {
|
2643 |
|
2644 |
|
2645 | var V8_VERSION = __webpack_require__(77);
|
2646 | var fails = __webpack_require__(2);
|
2647 |
|
2648 |
|
2649 | module.exports = !!Object.getOwnPropertySymbols && !fails(function () {
|
2650 | var symbol = Symbol();
|
2651 |
|
2652 |
|
2653 | return !String(symbol) || !(Object(symbol) instanceof Symbol) ||
|
2654 |
|
2655 | !Symbol.sham && V8_VERSION && V8_VERSION < 41;
|
2656 | });
|
2657 |
|
2658 |
|
2659 | }),
|
2660 |
|
2661 | (function(module, exports, __webpack_require__) {
|
2662 |
|
2663 | var global = __webpack_require__(7);
|
2664 |
|
2665 | module.exports = global.Promise;
|
2666 |
|
2667 |
|
2668 | }),
|
2669 |
|
2670 | (function(module, __webpack_exports__, __webpack_require__) {
|
2671 |
|
2672 | "use strict";
|
2673 | __webpack_exports__["a"] = values;
|
2674 | var __WEBPACK_IMPORTED_MODULE_0__keys_js__ = __webpack_require__(16);
|
2675 |
|
2676 |
|
2677 |
|
2678 | function values(obj) {
|
2679 | var _keys = Object(__WEBPACK_IMPORTED_MODULE_0__keys_js__["a" ])(obj);
|
2680 | var length = _keys.length;
|
2681 | var values = Array(length);
|
2682 | for (var i = 0; i < length; i++) {
|
2683 | values[i] = obj[_keys[i]];
|
2684 | }
|
2685 | return values;
|
2686 | }
|
2687 |
|
2688 |
|
2689 | }),
|
2690 |
|
2691 | (function(module, __webpack_exports__, __webpack_require__) {
|
2692 |
|
2693 | "use strict";
|
2694 | __webpack_exports__["a"] = flatten;
|
2695 | var __WEBPACK_IMPORTED_MODULE_0__getLength_js__ = __webpack_require__(29);
|
2696 | var __WEBPACK_IMPORTED_MODULE_1__isArrayLike_js__ = __webpack_require__(26);
|
2697 | var __WEBPACK_IMPORTED_MODULE_2__isArray_js__ = __webpack_require__(57);
|
2698 | var __WEBPACK_IMPORTED_MODULE_3__isArguments_js__ = __webpack_require__(136);
|
2699 |
|
2700 |
|
2701 |
|
2702 |
|
2703 |
|
2704 |
|
2705 | function flatten(input, depth, strict, output) {
|
2706 | output = output || [];
|
2707 | if (!depth && depth !== 0) {
|
2708 | depth = Infinity;
|
2709 | } else if (depth <= 0) {
|
2710 | return output.concat(input);
|
2711 | }
|
2712 | var idx = output.length;
|
2713 | for (var i = 0, length = Object(__WEBPACK_IMPORTED_MODULE_0__getLength_js__["a" ])(input); i < length; i++) {
|
2714 | var value = input[i];
|
2715 | if (Object(__WEBPACK_IMPORTED_MODULE_1__isArrayLike_js__["a" ])(value) && (Object(__WEBPACK_IMPORTED_MODULE_2__isArray_js__["a" ])(value) || Object(__WEBPACK_IMPORTED_MODULE_3__isArguments_js__["a" ])(value))) {
|
2716 |
|
2717 | if (depth > 1) {
|
2718 | flatten(value, depth - 1, strict, output);
|
2719 | idx = output.length;
|
2720 | } else {
|
2721 | var j = 0, len = value.length;
|
2722 | while (j < len) output[idx++] = value[j++];
|
2723 | }
|
2724 | } else if (!strict) {
|
2725 | output[idx++] = value;
|
2726 | }
|
2727 | }
|
2728 | return output;
|
2729 | }
|
2730 |
|
2731 |
|
2732 | }),
|
2733 |
|
2734 | (function(module, __webpack_exports__, __webpack_require__) {
|
2735 |
|
2736 | "use strict";
|
2737 | __webpack_exports__["a"] = map;
|
2738 | var __WEBPACK_IMPORTED_MODULE_0__cb_js__ = __webpack_require__(21);
|
2739 | var __WEBPACK_IMPORTED_MODULE_1__isArrayLike_js__ = __webpack_require__(26);
|
2740 | var __WEBPACK_IMPORTED_MODULE_2__keys_js__ = __webpack_require__(16);
|
2741 |
|
2742 |
|
2743 |
|
2744 |
|
2745 |
|
2746 | function map(obj, iteratee, context) {
|
2747 | iteratee = Object(__WEBPACK_IMPORTED_MODULE_0__cb_js__["a" ])(iteratee, context);
|
2748 | var _keys = !Object(__WEBPACK_IMPORTED_MODULE_1__isArrayLike_js__["a" ])(obj) && Object(__WEBPACK_IMPORTED_MODULE_2__keys_js__["a" ])(obj),
|
2749 | length = (_keys || obj).length,
|
2750 | results = Array(length);
|
2751 | for (var index = 0; index < length; index++) {
|
2752 | var currentKey = _keys ? _keys[index] : index;
|
2753 | results[index] = iteratee(obj[currentKey], currentKey, obj);
|
2754 | }
|
2755 | return results;
|
2756 | }
|
2757 |
|
2758 |
|
2759 | }),
|
2760 |
|
2761 | (function(module, exports, __webpack_require__) {
|
2762 |
|
2763 | "use strict";
|
2764 | (function(global) {
|
2765 |
|
2766 | var _interopRequireDefault = __webpack_require__(1);
|
2767 |
|
2768 | var _promise = _interopRequireDefault(__webpack_require__(12));
|
2769 |
|
2770 | var _concat = _interopRequireDefault(__webpack_require__(22));
|
2771 |
|
2772 | var _map = _interopRequireDefault(__webpack_require__(35));
|
2773 |
|
2774 | var _keys = _interopRequireDefault(__webpack_require__(115));
|
2775 |
|
2776 | var _stringify = _interopRequireDefault(__webpack_require__(36));
|
2777 |
|
2778 | var _indexOf = _interopRequireDefault(__webpack_require__(71));
|
2779 |
|
2780 | var _keys2 = _interopRequireDefault(__webpack_require__(59));
|
2781 |
|
2782 | var _ = __webpack_require__(3);
|
2783 |
|
2784 | var uuid = __webpack_require__(233);
|
2785 |
|
2786 | var debug = __webpack_require__(60);
|
2787 |
|
2788 | var _require = __webpack_require__(30),
|
2789 | inherits = _require.inherits,
|
2790 | parseDate = _require.parseDate;
|
2791 |
|
2792 | var version = __webpack_require__(235);
|
2793 |
|
2794 | var _require2 = __webpack_require__(72),
|
2795 | setAdapters = _require2.setAdapters,
|
2796 | adapterManager = _require2.adapterManager;
|
2797 |
|
2798 | var AV = global.AV || {};
|
2799 |
|
2800 | AV._config = {
|
2801 | serverURLs: {},
|
2802 | useMasterKey: false,
|
2803 | production: null,
|
2804 | realtime: null,
|
2805 | requestTimeout: null
|
2806 | };
|
2807 | var initialUserAgent = "LeanCloud-JS-SDK/".concat(version);
|
2808 |
|
2809 | AV._sharedConfig = {
|
2810 | userAgent: initialUserAgent,
|
2811 | liveQueryRealtime: null
|
2812 | };
|
2813 | adapterManager.on('platformInfo', function (platformInfo) {
|
2814 | var ua = initialUserAgent;
|
2815 |
|
2816 | if (platformInfo) {
|
2817 | if (platformInfo.userAgent) {
|
2818 | ua = platformInfo.userAgent;
|
2819 | } else {
|
2820 | var comments = platformInfo.name;
|
2821 |
|
2822 | if (platformInfo.version) {
|
2823 | comments += "/".concat(platformInfo.version);
|
2824 | }
|
2825 |
|
2826 | if (platformInfo.extra) {
|
2827 | comments += "; ".concat(platformInfo.extra);
|
2828 | }
|
2829 |
|
2830 | ua += " (".concat(comments, ")");
|
2831 | }
|
2832 | }
|
2833 |
|
2834 | AV._sharedConfig.userAgent = ua;
|
2835 | });
|
2836 |
|
2837 |
|
2838 |
|
2839 |
|
2840 |
|
2841 |
|
2842 |
|
2843 |
|
2844 |
|
2845 |
|
2846 |
|
2847 |
|
2848 |
|
2849 | AV._getAVPath = function (path) {
|
2850 | if (!AV.applicationId) {
|
2851 | throw new Error('You need to call AV.initialize before using AV.');
|
2852 | }
|
2853 |
|
2854 | if (!path) {
|
2855 | path = '';
|
2856 | }
|
2857 |
|
2858 | if (!_.isString(path)) {
|
2859 | throw new Error("Tried to get a localStorage path that wasn't a String.");
|
2860 | }
|
2861 |
|
2862 | if (path[0] === '/') {
|
2863 | path = path.substring(1);
|
2864 | }
|
2865 |
|
2866 | return 'AV/' + AV.applicationId + '/' + path;
|
2867 | };
|
2868 |
|
2869 |
|
2870 |
|
2871 |
|
2872 |
|
2873 |
|
2874 |
|
2875 | AV._installationId = null;
|
2876 |
|
2877 | AV._getInstallationId = function () {
|
2878 |
|
2879 | if (AV._installationId) {
|
2880 | return _promise.default.resolve(AV._installationId);
|
2881 | }
|
2882 |
|
2883 |
|
2884 | var path = AV._getAVPath('installationId');
|
2885 |
|
2886 | return AV.localStorage.getItemAsync(path).then(function (_installationId) {
|
2887 | AV._installationId = _installationId;
|
2888 |
|
2889 | if (!AV._installationId) {
|
2890 |
|
2891 | AV._installationId = _installationId = uuid();
|
2892 | return AV.localStorage.setItemAsync(path, _installationId).then(function () {
|
2893 | return _installationId;
|
2894 | });
|
2895 | }
|
2896 |
|
2897 | return _installationId;
|
2898 | });
|
2899 | };
|
2900 |
|
2901 | AV._subscriptionId = null;
|
2902 |
|
2903 | AV._refreshSubscriptionId = function () {
|
2904 | var path = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : AV._getAVPath('subscriptionId');
|
2905 | var subscriptionId = AV._subscriptionId = uuid();
|
2906 | return AV.localStorage.setItemAsync(path, subscriptionId).then(function () {
|
2907 | return subscriptionId;
|
2908 | });
|
2909 | };
|
2910 |
|
2911 | AV._getSubscriptionId = function () {
|
2912 |
|
2913 | if (AV._subscriptionId) {
|
2914 | return _promise.default.resolve(AV._subscriptionId);
|
2915 | }
|
2916 |
|
2917 |
|
2918 | var path = AV._getAVPath('subscriptionId');
|
2919 |
|
2920 | return AV.localStorage.getItemAsync(path).then(function (_subscriptionId) {
|
2921 | AV._subscriptionId = _subscriptionId;
|
2922 |
|
2923 | if (!AV._subscriptionId) {
|
2924 |
|
2925 | _subscriptionId = AV._refreshSubscriptionId(path);
|
2926 | }
|
2927 |
|
2928 | return _subscriptionId;
|
2929 | });
|
2930 | };
|
2931 |
|
2932 | AV._parseDate = parseDate;
|
2933 |
|
2934 | AV._extend = function (protoProps, classProps) {
|
2935 | var child = inherits(this, protoProps, classProps);
|
2936 | child.extend = this.extend;
|
2937 | return child;
|
2938 | };
|
2939 |
|
2940 |
|
2941 |
|
2942 |
|
2943 |
|
2944 |
|
2945 |
|
2946 |
|
2947 |
|
2948 |
|
2949 |
|
2950 |
|
2951 | AV._encode = function (value, seenObjects, disallowObjects) {
|
2952 | var full = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
|
2953 |
|
2954 | if (value instanceof AV.Object) {
|
2955 | if (disallowObjects) {
|
2956 | throw new Error('AV.Objects not allowed here');
|
2957 | }
|
2958 |
|
2959 | if (!seenObjects || _.include(seenObjects, value) || !value._hasData) {
|
2960 | return value._toPointer();
|
2961 | }
|
2962 |
|
2963 | return value._toFullJSON((0, _concat.default)(seenObjects).call(seenObjects, value), full);
|
2964 | }
|
2965 |
|
2966 | if (value instanceof AV.ACL) {
|
2967 | return value.toJSON();
|
2968 | }
|
2969 |
|
2970 | if (_.isDate(value)) {
|
2971 | return full ? {
|
2972 | __type: 'Date',
|
2973 | iso: value.toJSON()
|
2974 | } : value.toJSON();
|
2975 | }
|
2976 |
|
2977 | if (value instanceof AV.GeoPoint) {
|
2978 | return value.toJSON();
|
2979 | }
|
2980 |
|
2981 | if (_.isArray(value)) {
|
2982 | return (0, _map.default)(_).call(_, value, function (x) {
|
2983 | return AV._encode(x, seenObjects, disallowObjects, full);
|
2984 | });
|
2985 | }
|
2986 |
|
2987 | if (_.isRegExp(value)) {
|
2988 | return value.source;
|
2989 | }
|
2990 |
|
2991 | if (value instanceof AV.Relation) {
|
2992 | return value.toJSON();
|
2993 | }
|
2994 |
|
2995 | if (value instanceof AV.Op) {
|
2996 | return value.toJSON();
|
2997 | }
|
2998 |
|
2999 | if (value instanceof AV.File) {
|
3000 | if (!value.url() && !value.id) {
|
3001 | throw new Error('Tried to save an object containing an unsaved file.');
|
3002 | }
|
3003 |
|
3004 | return value._toFullJSON(seenObjects, full);
|
3005 | }
|
3006 |
|
3007 | if (_.isObject(value)) {
|
3008 | return _.mapObject(value, function (v, k) {
|
3009 | return AV._encode(v, seenObjects, disallowObjects, full);
|
3010 | });
|
3011 | }
|
3012 |
|
3013 | return value;
|
3014 | };
|
3015 |
|
3016 |
|
3017 |
|
3018 |
|
3019 |
|
3020 |
|
3021 | AV._decode = function (value, key) {
|
3022 | if (!_.isObject(value) || _.isDate(value)) {
|
3023 | return value;
|
3024 | }
|
3025 |
|
3026 | if (_.isArray(value)) {
|
3027 | return (0, _map.default)(_).call(_, value, function (v) {
|
3028 | return AV._decode(v);
|
3029 | });
|
3030 | }
|
3031 |
|
3032 | if (value instanceof AV.Object) {
|
3033 | return value;
|
3034 | }
|
3035 |
|
3036 | if (value instanceof AV.File) {
|
3037 | return value;
|
3038 | }
|
3039 |
|
3040 | if (value instanceof AV.Op) {
|
3041 | return value;
|
3042 | }
|
3043 |
|
3044 | if (value instanceof AV.GeoPoint) {
|
3045 | return value;
|
3046 | }
|
3047 |
|
3048 | if (value instanceof AV.ACL) {
|
3049 | return value;
|
3050 | }
|
3051 |
|
3052 | if (key === 'ACL') {
|
3053 | return new AV.ACL(value);
|
3054 | }
|
3055 |
|
3056 | if (value.__op) {
|
3057 | return AV.Op._decode(value);
|
3058 | }
|
3059 |
|
3060 | var className;
|
3061 |
|
3062 | if (value.__type === 'Pointer') {
|
3063 | className = value.className;
|
3064 |
|
3065 | var pointer = AV.Object._create(className);
|
3066 |
|
3067 | if ((0, _keys.default)(value).length > 3) {
|
3068 | var v = _.clone(value);
|
3069 |
|
3070 | delete v.__type;
|
3071 | delete v.className;
|
3072 |
|
3073 | pointer._finishFetch(v, true);
|
3074 | } else {
|
3075 | pointer._finishFetch({
|
3076 | objectId: value.objectId
|
3077 | }, false);
|
3078 | }
|
3079 |
|
3080 | return pointer;
|
3081 | }
|
3082 |
|
3083 | if (value.__type === 'Object') {
|
3084 |
|
3085 | className = value.className;
|
3086 |
|
3087 | var _v = _.clone(value);
|
3088 |
|
3089 | delete _v.__type;
|
3090 | delete _v.className;
|
3091 |
|
3092 | var object = AV.Object._create(className);
|
3093 |
|
3094 | object._finishFetch(_v, true);
|
3095 |
|
3096 | return object;
|
3097 | }
|
3098 |
|
3099 | if (value.__type === 'Date') {
|
3100 | return AV._parseDate(value.iso);
|
3101 | }
|
3102 |
|
3103 | if (value.__type === 'GeoPoint') {
|
3104 | return new AV.GeoPoint({
|
3105 | latitude: value.latitude,
|
3106 | longitude: value.longitude
|
3107 | });
|
3108 | }
|
3109 |
|
3110 | if (value.__type === 'Relation') {
|
3111 | if (!key) throw new Error('key missing decoding a Relation');
|
3112 | var relation = new AV.Relation(null, key);
|
3113 | relation.targetClassName = value.className;
|
3114 | return relation;
|
3115 | }
|
3116 |
|
3117 | if (value.__type === 'File') {
|
3118 | var file = new AV.File(value.name);
|
3119 |
|
3120 | var _v2 = _.clone(value);
|
3121 |
|
3122 | delete _v2.__type;
|
3123 |
|
3124 | file._finishFetch(_v2);
|
3125 |
|
3126 | return file;
|
3127 | }
|
3128 |
|
3129 | return _.mapObject(value, AV._decode);
|
3130 | };
|
3131 |
|
3132 |
|
3133 |
|
3134 |
|
3135 |
|
3136 |
|
3137 |
|
3138 |
|
3139 |
|
3140 | AV.parseJSON = AV._decode;
|
3141 |
|
3142 |
|
3143 |
|
3144 |
|
3145 |
|
3146 |
|
3147 |
|
3148 |
|
3149 | AV.parse = function (text) {
|
3150 | return AV.parseJSON(JSON.parse(text));
|
3151 | };
|
3152 |
|
3153 |
|
3154 |
|
3155 |
|
3156 |
|
3157 |
|
3158 |
|
3159 |
|
3160 | AV.stringify = function (target) {
|
3161 | return (0, _stringify.default)(AV._encode(target, [], false, true));
|
3162 | };
|
3163 |
|
3164 | AV._encodeObjectOrArray = function (value) {
|
3165 | var encodeAVObject = function encodeAVObject(object) {
|
3166 | if (object && object._toFullJSON) {
|
3167 | object = object._toFullJSON([]);
|
3168 | }
|
3169 |
|
3170 | return _.mapObject(object, function (value) {
|
3171 | return AV._encode(value, []);
|
3172 | });
|
3173 | };
|
3174 |
|
3175 | if (_.isArray(value)) {
|
3176 | return (0, _map.default)(value).call(value, function (object) {
|
3177 | return encodeAVObject(object);
|
3178 | });
|
3179 | } else {
|
3180 | return encodeAVObject(value);
|
3181 | }
|
3182 | };
|
3183 |
|
3184 | AV._arrayEach = _.each;
|
3185 |
|
3186 |
|
3187 |
|
3188 |
|
3189 |
|
3190 |
|
3191 |
|
3192 |
|
3193 |
|
3194 |
|
3195 | AV._traverse = function (object, func, seen) {
|
3196 | if (object instanceof AV.Object) {
|
3197 | seen = seen || [];
|
3198 |
|
3199 | if ((0, _indexOf.default)(_).call(_, seen, object) >= 0) {
|
3200 |
|
3201 | return;
|
3202 | }
|
3203 |
|
3204 | seen.push(object);
|
3205 |
|
3206 | AV._traverse(object.attributes, func, seen);
|
3207 |
|
3208 | return func(object);
|
3209 | }
|
3210 |
|
3211 | if (object instanceof AV.Relation || object instanceof AV.File) {
|
3212 |
|
3213 |
|
3214 | return func(object);
|
3215 | }
|
3216 |
|
3217 | if (_.isArray(object)) {
|
3218 | _.each(object, function (child, index) {
|
3219 | var newChild = AV._traverse(child, func, seen);
|
3220 |
|
3221 | if (newChild) {
|
3222 | object[index] = newChild;
|
3223 | }
|
3224 | });
|
3225 |
|
3226 | return func(object);
|
3227 | }
|
3228 |
|
3229 | if (_.isObject(object)) {
|
3230 | AV._each(object, function (child, key) {
|
3231 | var newChild = AV._traverse(child, func, seen);
|
3232 |
|
3233 | if (newChild) {
|
3234 | object[key] = newChild;
|
3235 | }
|
3236 | });
|
3237 |
|
3238 | return func(object);
|
3239 | }
|
3240 |
|
3241 | return func(object);
|
3242 | };
|
3243 |
|
3244 |
|
3245 |
|
3246 |
|
3247 |
|
3248 |
|
3249 |
|
3250 |
|
3251 | AV._objectEach = AV._each = function (obj, callback) {
|
3252 | if (_.isObject(obj)) {
|
3253 | _.each((0, _keys2.default)(_).call(_, obj), function (key) {
|
3254 | callback(obj[key], key);
|
3255 | });
|
3256 | } else {
|
3257 | _.each(obj, callback);
|
3258 | }
|
3259 | };
|
3260 |
|
3261 |
|
3262 |
|
3263 |
|
3264 |
|
3265 |
|
3266 | AV.debug = {
|
3267 | |
3268 |
|
3269 |
|
3270 | enable: function enable() {
|
3271 | var namespaces = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'leancloud*';
|
3272 | return debug.enable(namespaces);
|
3273 | },
|
3274 |
|
3275 | |
3276 |
|
3277 |
|
3278 | disable: debug.disable
|
3279 | };
|
3280 |
|
3281 |
|
3282 |
|
3283 |
|
3284 |
|
3285 |
|
3286 |
|
3287 | AV.setAdapters = setAdapters;
|
3288 | module.exports = AV;
|
3289 | }.call(exports, __webpack_require__(74)))
|
3290 |
|
3291 | }),
|
3292 |
|
3293 | (function(module, exports, __webpack_require__) {
|
3294 |
|
3295 | var bind = __webpack_require__(48);
|
3296 | var uncurryThis = __webpack_require__(4);
|
3297 | var IndexedObject = __webpack_require__(95);
|
3298 | var toObject = __webpack_require__(34);
|
3299 | var lengthOfArrayLike = __webpack_require__(41);
|
3300 | var arraySpeciesCreate = __webpack_require__(230);
|
3301 |
|
3302 | var push = uncurryThis([].push);
|
3303 |
|
3304 |
|
3305 | var createMethod = function (TYPE) {
|
3306 | var IS_MAP = TYPE == 1;
|
3307 | var IS_FILTER = TYPE == 2;
|
3308 | var IS_SOME = TYPE == 3;
|
3309 | var IS_EVERY = TYPE == 4;
|
3310 | var IS_FIND_INDEX = TYPE == 6;
|
3311 | var IS_FILTER_REJECT = TYPE == 7;
|
3312 | var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
|
3313 | return function ($this, callbackfn, that, specificCreate) {
|
3314 | var O = toObject($this);
|
3315 | var self = IndexedObject(O);
|
3316 | var boundFunction = bind(callbackfn, that);
|
3317 | var length = lengthOfArrayLike(self);
|
3318 | var index = 0;
|
3319 | var create = specificCreate || arraySpeciesCreate;
|
3320 | var target = IS_MAP ? create($this, length) : IS_FILTER || IS_FILTER_REJECT ? create($this, 0) : undefined;
|
3321 | var value, result;
|
3322 | for (;length > index; index++) if (NO_HOLES || index in self) {
|
3323 | value = self[index];
|
3324 | result = boundFunction(value, index, O);
|
3325 | if (TYPE) {
|
3326 | if (IS_MAP) target[index] = result;
|
3327 | else if (result) switch (TYPE) {
|
3328 | case 3: return true;
|
3329 | case 5: return value;
|
3330 | case 6: return index;
|
3331 | case 2: push(target, value);
|
3332 | } else switch (TYPE) {
|
3333 | case 4: return false;
|
3334 | case 7: push(target, value);
|
3335 | }
|
3336 | }
|
3337 | }
|
3338 | return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
|
3339 | };
|
3340 | };
|
3341 |
|
3342 | module.exports = {
|
3343 |
|
3344 |
|
3345 | forEach: createMethod(0),
|
3346 |
|
3347 |
|
3348 | map: createMethod(1),
|
3349 |
|
3350 |
|
3351 | filter: createMethod(2),
|
3352 |
|
3353 |
|
3354 | some: createMethod(3),
|
3355 |
|
3356 |
|
3357 | every: createMethod(4),
|
3358 |
|
3359 |
|
3360 | find: createMethod(5),
|
3361 |
|
3362 |
|
3363 | findIndex: createMethod(6),
|
3364 |
|
3365 |
|
3366 | filterReject: createMethod(7)
|
3367 | };
|
3368 |
|
3369 |
|
3370 | }),
|
3371 |
|
3372 | (function(module, exports, __webpack_require__) {
|
3373 |
|
3374 | module.exports = __webpack_require__(406);
|
3375 |
|
3376 | }),
|
3377 |
|
3378 | (function(module, exports, __webpack_require__) {
|
3379 |
|
3380 | "use strict";
|
3381 |
|
3382 |
|
3383 | var _interopRequireDefault = __webpack_require__(1);
|
3384 |
|
3385 | var _keys = _interopRequireDefault(__webpack_require__(59));
|
3386 |
|
3387 | var _ = __webpack_require__(3);
|
3388 |
|
3389 | var EventEmitter = __webpack_require__(236);
|
3390 |
|
3391 | var _require = __webpack_require__(30),
|
3392 | inherits = _require.inherits;
|
3393 |
|
3394 | var AdapterManager = inherits(EventEmitter, {
|
3395 | constructor: function constructor() {
|
3396 | EventEmitter.apply(this);
|
3397 | this._adapters = {};
|
3398 | },
|
3399 | getAdapter: function getAdapter(name) {
|
3400 | var adapter = this._adapters[name];
|
3401 |
|
3402 | if (adapter === undefined) {
|
3403 | throw new Error("".concat(name, " adapter is not configured"));
|
3404 | }
|
3405 |
|
3406 | return adapter;
|
3407 | },
|
3408 | setAdapters: function setAdapters(newAdapters) {
|
3409 | var _this = this;
|
3410 |
|
3411 | _.extend(this._adapters, newAdapters);
|
3412 |
|
3413 | (0, _keys.default)(_).call(_, newAdapters).forEach(function (name) {
|
3414 | return _this.emit(name, newAdapters[name]);
|
3415 | });
|
3416 | }
|
3417 | });
|
3418 | var adapterManager = new AdapterManager();
|
3419 | module.exports = {
|
3420 | getAdapter: adapterManager.getAdapter.bind(adapterManager),
|
3421 | setAdapters: adapterManager.setAdapters.bind(adapterManager),
|
3422 | adapterManager: adapterManager
|
3423 | };
|
3424 |
|
3425 | }),
|
3426 |
|
3427 | (function(module, exports, __webpack_require__) {
|
3428 |
|
3429 | var _Symbol = __webpack_require__(243);
|
3430 |
|
3431 | var _Symbol$iterator = __webpack_require__(461);
|
3432 |
|
3433 | function _typeof(obj) {
|
3434 | "@babel/helpers - typeof";
|
3435 |
|
3436 | return (module.exports = _typeof = "function" == typeof _Symbol && "symbol" == typeof _Symbol$iterator ? function (obj) {
|
3437 | return typeof obj;
|
3438 | } : function (obj) {
|
3439 | return obj && "function" == typeof _Symbol && obj.constructor === _Symbol && obj !== _Symbol.prototype ? "symbol" : typeof obj;
|
3440 | }, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(obj);
|
3441 | }
|
3442 |
|
3443 | module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
3444 |
|
3445 | }),
|
3446 |
|
3447 | (function(module, exports) {
|
3448 |
|
3449 | var g;
|
3450 |
|
3451 |
|
3452 | g = (function() {
|
3453 | return this;
|
3454 | })();
|
3455 |
|
3456 | try {
|
3457 |
|
3458 | g = g || Function("return this")() || (1,eval)("this");
|
3459 | } catch(e) {
|
3460 |
|
3461 | if(typeof window === "object")
|
3462 | g = window;
|
3463 | }
|
3464 |
|
3465 |
|
3466 |
|
3467 |
|
3468 |
|
3469 | module.exports = g;
|
3470 |
|
3471 |
|
3472 | }),
|
3473 |
|
3474 | (function(module, exports, __webpack_require__) {
|
3475 |
|
3476 | var NATIVE_BIND = __webpack_require__(76);
|
3477 |
|
3478 | var FunctionPrototype = Function.prototype;
|
3479 | var apply = FunctionPrototype.apply;
|
3480 | var call = FunctionPrototype.call;
|
3481 |
|
3482 |
|
3483 | module.exports = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND ? call.bind(apply) : function () {
|
3484 | return call.apply(apply, arguments);
|
3485 | });
|
3486 |
|
3487 |
|
3488 | }),
|
3489 |
|
3490 | (function(module, exports, __webpack_require__) {
|
3491 |
|
3492 | var fails = __webpack_require__(2);
|
3493 |
|
3494 | module.exports = !fails(function () {
|
3495 |
|
3496 | var test = (function () { }).bind();
|
3497 |
|
3498 | return typeof test != 'function' || test.hasOwnProperty('prototype');
|
3499 | });
|
3500 |
|
3501 |
|
3502 | }),
|
3503 |
|
3504 | (function(module, exports, __webpack_require__) {
|
3505 |
|
3506 | var global = __webpack_require__(7);
|
3507 | var userAgent = __webpack_require__(98);
|
3508 |
|
3509 | var process = global.process;
|
3510 | var Deno = global.Deno;
|
3511 | var versions = process && process.versions || Deno && Deno.version;
|
3512 | var v8 = versions && versions.v8;
|
3513 | var match, version;
|
3514 |
|
3515 | if (v8) {
|
3516 | match = v8.split('.');
|
3517 |
|
3518 |
|
3519 | version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
|
3520 | }
|
3521 |
|
3522 |
|
3523 |
|
3524 | if (!version && userAgent) {
|
3525 | match = userAgent.match(/Edge\/(\d+)/);
|
3526 | if (!match || match[1] >= 74) {
|
3527 | match = userAgent.match(/Chrome\/(\d+)/);
|
3528 | if (match) version = +match[1];
|
3529 | }
|
3530 | }
|
3531 |
|
3532 | module.exports = version;
|
3533 |
|
3534 |
|
3535 | }),
|
3536 |
|
3537 | (function(module, exports) {
|
3538 |
|
3539 | var $String = String;
|
3540 |
|
3541 | module.exports = function (argument) {
|
3542 | try {
|
3543 | return $String(argument);
|
3544 | } catch (error) {
|
3545 | return 'Object';
|
3546 | }
|
3547 | };
|
3548 |
|
3549 |
|
3550 | }),
|
3551 |
|
3552 | (function(module, exports, __webpack_require__) {
|
3553 |
|
3554 | var IS_PURE = __webpack_require__(33);
|
3555 | var store = __webpack_require__(124);
|
3556 |
|
3557 | (module.exports = function (key, value) {
|
3558 | return store[key] || (store[key] = value !== undefined ? value : {});
|
3559 | })('versions', []).push({
|
3560 | version: '3.23.3',
|
3561 | mode: IS_PURE ? 'pure' : 'global',
|
3562 | copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
|
3563 | license: 'https://github.com/zloirock/core-js/blob/v3.23.3/LICENSE',
|
3564 | source: 'https://github.com/zloirock/core-js'
|
3565 | });
|
3566 |
|
3567 |
|
3568 | }),
|
3569 |
|
3570 | (function(module, exports) {
|
3571 |
|
3572 | module.exports = {};
|
3573 |
|
3574 |
|
3575 | }),
|
3576 |
|
3577 | (function(module, exports, __webpack_require__) {
|
3578 |
|
3579 | var classof = __webpack_require__(51);
|
3580 |
|
3581 | var $String = String;
|
3582 |
|
3583 | module.exports = function (argument) {
|
3584 | if (classof(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string');
|
3585 | return $String(argument);
|
3586 | };
|
3587 |
|
3588 |
|
3589 | }),
|
3590 |
|
3591 | (function(module, exports) {
|
3592 |
|
3593 | module.exports = function (exec) {
|
3594 | try {
|
3595 | return { error: false, value: exec() };
|
3596 | } catch (error) {
|
3597 | return { error: true, value: error };
|
3598 | }
|
3599 | };
|
3600 |
|
3601 |
|
3602 | }),
|
3603 |
|
3604 | (function(module, exports, __webpack_require__) {
|
3605 |
|
3606 | var global = __webpack_require__(7);
|
3607 | var NativePromiseConstructor = __webpack_require__(65);
|
3608 | var isCallable = __webpack_require__(8);
|
3609 | var isForced = __webpack_require__(160);
|
3610 | var inspectSource = __webpack_require__(131);
|
3611 | var wellKnownSymbol = __webpack_require__(9);
|
3612 | var IS_BROWSER = __webpack_require__(309);
|
3613 | var IS_PURE = __webpack_require__(33);
|
3614 | var V8_VERSION = __webpack_require__(77);
|
3615 |
|
3616 | var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;
|
3617 | var SPECIES = wellKnownSymbol('species');
|
3618 | var SUBCLASSING = false;
|
3619 | var NATIVE_PROMISE_REJECTION_EVENT = isCallable(global.PromiseRejectionEvent);
|
3620 |
|
3621 | var FORCED_PROMISE_CONSTRUCTOR = isForced('Promise', function () {
|
3622 | var PROMISE_CONSTRUCTOR_SOURCE = inspectSource(NativePromiseConstructor);
|
3623 | var GLOBAL_CORE_JS_PROMISE = PROMISE_CONSTRUCTOR_SOURCE !== String(NativePromiseConstructor);
|
3624 |
|
3625 |
|
3626 |
|
3627 | if (!GLOBAL_CORE_JS_PROMISE && V8_VERSION === 66) return true;
|
3628 |
|
3629 | if (IS_PURE && !(NativePromisePrototype['catch'] && NativePromisePrototype['finally'])) return true;
|
3630 |
|
3631 |
|
3632 |
|
3633 | if (V8_VERSION >= 51 && /native code/.test(PROMISE_CONSTRUCTOR_SOURCE)) return false;
|
3634 |
|
3635 | var promise = new NativePromiseConstructor(function (resolve) { resolve(1); });
|
3636 | var FakePromise = function (exec) {
|
3637 | exec(function () { }, function () { });
|
3638 | };
|
3639 | var constructor = promise.constructor = {};
|
3640 | constructor[SPECIES] = FakePromise;
|
3641 | SUBCLASSING = promise.then(function () { }) instanceof FakePromise;
|
3642 | if (!SUBCLASSING) return true;
|
3643 |
|
3644 | return !GLOBAL_CORE_JS_PROMISE && IS_BROWSER && !NATIVE_PROMISE_REJECTION_EVENT;
|
3645 | });
|
3646 |
|
3647 | module.exports = {
|
3648 | CONSTRUCTOR: FORCED_PROMISE_CONSTRUCTOR,
|
3649 | REJECTION_EVENT: NATIVE_PROMISE_REJECTION_EVENT,
|
3650 | SUBCLASSING: SUBCLASSING
|
3651 | };
|
3652 |
|
3653 |
|
3654 | }),
|
3655 |
|
3656 | (function(module, __webpack_exports__, __webpack_require__) {
|
3657 |
|
3658 | "use strict";
|
3659 | __webpack_require__.d(__webpack_exports__, "a", function() { return hasStringTagBug; });
|
3660 | __webpack_require__.d(__webpack_exports__, "b", function() { return isIE11; });
|
3661 | var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(6);
|
3662 | var __WEBPACK_IMPORTED_MODULE_1__hasObjectTag_js__ = __webpack_require__(326);
|
3663 |
|
3664 |
|
3665 |
|
3666 |
|
3667 |
|
3668 |
|
3669 | var hasStringTagBug = (
|
3670 | __WEBPACK_IMPORTED_MODULE_0__setup_js__["s" ] && Object(__WEBPACK_IMPORTED_MODULE_1__hasObjectTag_js__["a" ])(new DataView(new ArrayBuffer(8)))
|
3671 | ),
|
3672 | isIE11 = (typeof Map !== 'undefined' && Object(__WEBPACK_IMPORTED_MODULE_1__hasObjectTag_js__["a" ])(new Map));
|
3673 |
|
3674 |
|
3675 | }),
|
3676 |
|
3677 | (function(module, __webpack_exports__, __webpack_require__) {
|
3678 |
|
3679 | "use strict";
|
3680 | __webpack_exports__["a"] = allKeys;
|
3681 | var __WEBPACK_IMPORTED_MODULE_0__isObject_js__ = __webpack_require__(56);
|
3682 | var __WEBPACK_IMPORTED_MODULE_1__setup_js__ = __webpack_require__(6);
|
3683 | var __WEBPACK_IMPORTED_MODULE_2__collectNonEnumProps_js__ = __webpack_require__(191);
|
3684 |
|
3685 |
|
3686 |
|
3687 |
|
3688 |
|
3689 | function allKeys(obj) {
|
3690 | if (!Object(__WEBPACK_IMPORTED_MODULE_0__isObject_js__["a" ])(obj)) return [];
|
3691 | var keys = [];
|
3692 | for (var key in obj) keys.push(key);
|
3693 |
|
3694 | if (__WEBPACK_IMPORTED_MODULE_1__setup_js__["h" ]) Object(__WEBPACK_IMPORTED_MODULE_2__collectNonEnumProps_js__["a" ])(obj, keys);
|
3695 | return keys;
|
3696 | }
|
3697 |
|
3698 |
|
3699 | }),
|
3700 |
|
3701 | (function(module, __webpack_exports__, __webpack_require__) {
|
3702 |
|
3703 | "use strict";
|
3704 | __webpack_exports__["a"] = toPath;
|
3705 | var __WEBPACK_IMPORTED_MODULE_0__underscore_js__ = __webpack_require__(25);
|
3706 | var __WEBPACK_IMPORTED_MODULE_1__toPath_js__ = __webpack_require__(200);
|
3707 |
|
3708 |
|
3709 |
|
3710 |
|
3711 |
|
3712 | function toPath(path) {
|
3713 | return __WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" ].toPath(path);
|
3714 | }
|
3715 |
|
3716 |
|
3717 | }),
|
3718 |
|
3719 | (function(module, __webpack_exports__, __webpack_require__) {
|
3720 |
|
3721 | "use strict";
|
3722 | __webpack_exports__["a"] = optimizeCb;
|
3723 |
|
3724 |
|
3725 |
|
3726 | function optimizeCb(func, context, argCount) {
|
3727 | if (context === void 0) return func;
|
3728 | switch (argCount == null ? 3 : argCount) {
|
3729 | case 1: return function(value) {
|
3730 | return func.call(context, value);
|
3731 | };
|
3732 |
|
3733 | case 3: return function(value, index, collection) {
|
3734 | return func.call(context, value, index, collection);
|
3735 | };
|
3736 | case 4: return function(accumulator, value, index, collection) {
|
3737 | return func.call(context, accumulator, value, index, collection);
|
3738 | };
|
3739 | }
|
3740 | return function() {
|
3741 | return func.apply(context, arguments);
|
3742 | };
|
3743 | }
|
3744 |
|
3745 |
|
3746 | }),
|
3747 |
|
3748 | (function(module, __webpack_exports__, __webpack_require__) {
|
3749 |
|
3750 | "use strict";
|
3751 | __webpack_exports__["a"] = filter;
|
3752 | var __WEBPACK_IMPORTED_MODULE_0__cb_js__ = __webpack_require__(21);
|
3753 | var __WEBPACK_IMPORTED_MODULE_1__each_js__ = __webpack_require__(58);
|
3754 |
|
3755 |
|
3756 |
|
3757 |
|
3758 | function filter(obj, predicate, context) {
|
3759 | var results = [];
|
3760 | predicate = Object(__WEBPACK_IMPORTED_MODULE_0__cb_js__["a" ])(predicate, context);
|
3761 | Object(__WEBPACK_IMPORTED_MODULE_1__each_js__["a" ])(obj, function(value, index, list) {
|
3762 | if (predicate(value, index, list)) results.push(value);
|
3763 | });
|
3764 | return results;
|
3765 | }
|
3766 |
|
3767 |
|
3768 | }),
|
3769 |
|
3770 | (function(module, __webpack_exports__, __webpack_require__) {
|
3771 |
|
3772 | "use strict";
|
3773 | __webpack_exports__["a"] = contains;
|
3774 | var __WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__ = __webpack_require__(26);
|
3775 | var __WEBPACK_IMPORTED_MODULE_1__values_js__ = __webpack_require__(66);
|
3776 | var __WEBPACK_IMPORTED_MODULE_2__indexOf_js__ = __webpack_require__(216);
|
3777 |
|
3778 |
|
3779 |
|
3780 |
|
3781 |
|
3782 | function contains(obj, item, fromIndex, guard) {
|
3783 | if (!Object(__WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__["a" ])(obj)) obj = Object(__WEBPACK_IMPORTED_MODULE_1__values_js__["a" ])(obj);
|
3784 | if (typeof fromIndex != 'number' || guard) fromIndex = 0;
|
3785 | return Object(__WEBPACK_IMPORTED_MODULE_2__indexOf_js__["a" ])(obj, item, fromIndex) >= 0;
|
3786 | }
|
3787 |
|
3788 |
|
3789 | }),
|
3790 |
|
3791 | (function(module, exports, __webpack_require__) {
|
3792 |
|
3793 | var classof = __webpack_require__(63);
|
3794 |
|
3795 |
|
3796 |
|
3797 |
|
3798 | module.exports = Array.isArray || function isArray(argument) {
|
3799 | return classof(argument) == 'Array';
|
3800 | };
|
3801 |
|
3802 |
|
3803 | }),
|
3804 |
|
3805 | (function(module, exports, __webpack_require__) {
|
3806 |
|
3807 | "use strict";
|
3808 |
|
3809 | var toPropertyKey = __webpack_require__(96);
|
3810 | var definePropertyModule = __webpack_require__(23);
|
3811 | var createPropertyDescriptor = __webpack_require__(47);
|
3812 |
|
3813 | module.exports = function (object, key, value) {
|
3814 | var propertyKey = toPropertyKey(key);
|
3815 | if (propertyKey in object) definePropertyModule.f(object, propertyKey, createPropertyDescriptor(0, value));
|
3816 | else object[propertyKey] = value;
|
3817 | };
|
3818 |
|
3819 |
|
3820 | }),
|
3821 |
|
3822 | (function(module, exports, __webpack_require__) {
|
3823 |
|
3824 | module.exports = __webpack_require__(242);
|
3825 |
|
3826 | }),
|
3827 |
|
3828 | (function(module, exports, __webpack_require__) {
|
3829 |
|
3830 | module.exports = __webpack_require__(474);
|
3831 |
|
3832 | }),
|
3833 |
|
3834 | (function(module, exports, __webpack_require__) {
|
3835 |
|
3836 | var $ = __webpack_require__(0);
|
3837 | var uncurryThis = __webpack_require__(4);
|
3838 | var hiddenKeys = __webpack_require__(80);
|
3839 | var isObject = __webpack_require__(11);
|
3840 | var hasOwn = __webpack_require__(13);
|
3841 | var defineProperty = __webpack_require__(23).f;
|
3842 | var getOwnPropertyNamesModule = __webpack_require__(103);
|
3843 | var getOwnPropertyNamesExternalModule = __webpack_require__(246);
|
3844 | var isExtensible = __webpack_require__(262);
|
3845 | var uid = __webpack_require__(99);
|
3846 | var FREEZING = __webpack_require__(263);
|
3847 |
|
3848 | var REQUIRED = false;
|
3849 | var METADATA = uid('meta');
|
3850 | var id = 0;
|
3851 |
|
3852 | var setMetadata = function (it) {
|
3853 | defineProperty(it, METADATA, { value: {
|
3854 | objectID: 'O' + id++,
|
3855 | weakData: {}
|
3856 | } });
|
3857 | };
|
3858 |
|
3859 | var fastKey = function (it, create) {
|
3860 |
|
3861 | if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;
|
3862 | if (!hasOwn(it, METADATA)) {
|
3863 |
|
3864 | if (!isExtensible(it)) return 'F';
|
3865 |
|
3866 | if (!create) return 'E';
|
3867 |
|
3868 | setMetadata(it);
|
3869 |
|
3870 | } return it[METADATA].objectID;
|
3871 | };
|
3872 |
|
3873 | var getWeakData = function (it, create) {
|
3874 | if (!hasOwn(it, METADATA)) {
|
3875 |
|
3876 | if (!isExtensible(it)) return true;
|
3877 |
|
3878 | if (!create) return false;
|
3879 |
|
3880 | setMetadata(it);
|
3881 |
|
3882 | } return it[METADATA].weakData;
|
3883 | };
|
3884 |
|
3885 |
|
3886 | var onFreeze = function (it) {
|
3887 | if (FREEZING && REQUIRED && isExtensible(it) && !hasOwn(it, METADATA)) setMetadata(it);
|
3888 | return it;
|
3889 | };
|
3890 |
|
3891 | var enable = function () {
|
3892 | meta.enable = function () { };
|
3893 | REQUIRED = true;
|
3894 | var getOwnPropertyNames = getOwnPropertyNamesModule.f;
|
3895 | var splice = uncurryThis([].splice);
|
3896 | var test = {};
|
3897 | test[METADATA] = 1;
|
3898 |
|
3899 |
|
3900 | if (getOwnPropertyNames(test).length) {
|
3901 | getOwnPropertyNamesModule.f = function (it) {
|
3902 | var result = getOwnPropertyNames(it);
|
3903 | for (var i = 0, length = result.length; i < length; i++) {
|
3904 | if (result[i] === METADATA) {
|
3905 | splice(result, i, 1);
|
3906 | break;
|
3907 | }
|
3908 | } return result;
|
3909 | };
|
3910 |
|
3911 | $({ target: 'Object', stat: true, forced: true }, {
|
3912 | getOwnPropertyNames: getOwnPropertyNamesExternalModule.f
|
3913 | });
|
3914 | }
|
3915 | };
|
3916 |
|
3917 | var meta = module.exports = {
|
3918 | enable: enable,
|
3919 | fastKey: fastKey,
|
3920 | getWeakData: getWeakData,
|
3921 | onFreeze: onFreeze
|
3922 | };
|
3923 |
|
3924 | hiddenKeys[METADATA] = true;
|
3925 |
|
3926 |
|
3927 | }),
|
3928 |
|
3929 | (function(module, exports, __webpack_require__) {
|
3930 |
|
3931 | var uncurryThis = __webpack_require__(4);
|
3932 | var fails = __webpack_require__(2);
|
3933 | var classof = __webpack_require__(63);
|
3934 |
|
3935 | var $Object = Object;
|
3936 | var split = uncurryThis(''.split);
|
3937 |
|
3938 |
|
3939 | module.exports = fails(function () {
|
3940 |
|
3941 |
|
3942 | return !$Object('z').propertyIsEnumerable(0);
|
3943 | }) ? function (it) {
|
3944 | return classof(it) == 'String' ? split(it, '') : $Object(it);
|
3945 | } : $Object;
|
3946 |
|
3947 |
|
3948 | }),
|
3949 |
|
3950 | (function(module, exports, __webpack_require__) {
|
3951 |
|
3952 | var toPrimitive = __webpack_require__(287);
|
3953 | var isSymbol = __webpack_require__(97);
|
3954 |
|
3955 |
|
3956 |
|
3957 | module.exports = function (argument) {
|
3958 | var key = toPrimitive(argument, 'string');
|
3959 | return isSymbol(key) ? key : key + '';
|
3960 | };
|
3961 |
|
3962 |
|
3963 | }),
|
3964 |
|
3965 | (function(module, exports, __webpack_require__) {
|
3966 |
|
3967 | var getBuiltIn = __webpack_require__(18);
|
3968 | var isCallable = __webpack_require__(8);
|
3969 | var isPrototypeOf = __webpack_require__(19);
|
3970 | var USE_SYMBOL_AS_UID = __webpack_require__(158);
|
3971 |
|
3972 | var $Object = Object;
|
3973 |
|
3974 | module.exports = USE_SYMBOL_AS_UID ? function (it) {
|
3975 | return typeof it == 'symbol';
|
3976 | } : function (it) {
|
3977 | var $Symbol = getBuiltIn('Symbol');
|
3978 | return isCallable($Symbol) && isPrototypeOf($Symbol.prototype, $Object(it));
|
3979 | };
|
3980 |
|
3981 |
|
3982 | }),
|
3983 |
|
3984 | (function(module, exports, __webpack_require__) {
|
3985 |
|
3986 | var getBuiltIn = __webpack_require__(18);
|
3987 |
|
3988 | module.exports = getBuiltIn('navigator', 'userAgent') || '';
|
3989 |
|
3990 |
|
3991 | }),
|
3992 |
|
3993 | (function(module, exports, __webpack_require__) {
|
3994 |
|
3995 | var uncurryThis = __webpack_require__(4);
|
3996 |
|
3997 | var id = 0;
|
3998 | var postfix = Math.random();
|
3999 | var toString = uncurryThis(1.0.toString);
|
4000 |
|
4001 | module.exports = function (key) {
|
4002 | return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36);
|
4003 | };
|
4004 |
|
4005 |
|
4006 | }),
|
4007 |
|
4008 | (function(module, exports, __webpack_require__) {
|
4009 |
|
4010 | var hasOwn = __webpack_require__(13);
|
4011 | var isCallable = __webpack_require__(8);
|
4012 | var toObject = __webpack_require__(34);
|
4013 | var sharedKey = __webpack_require__(101);
|
4014 | var CORRECT_PROTOTYPE_GETTER = __webpack_require__(162);
|
4015 |
|
4016 | var IE_PROTO = sharedKey('IE_PROTO');
|
4017 | var $Object = Object;
|
4018 | var ObjectPrototype = $Object.prototype;
|
4019 |
|
4020 |
|
4021 |
|
4022 |
|
4023 | module.exports = CORRECT_PROTOTYPE_GETTER ? $Object.getPrototypeOf : function (O) {
|
4024 | var object = toObject(O);
|
4025 | if (hasOwn(object, IE_PROTO)) return object[IE_PROTO];
|
4026 | var constructor = object.constructor;
|
4027 | if (isCallable(constructor) && object instanceof constructor) {
|
4028 | return constructor.prototype;
|
4029 | } return object instanceof $Object ? ObjectPrototype : null;
|
4030 | };
|
4031 |
|
4032 |
|
4033 | /***/ }),
|
4034 | /* 101 */
|
4035 | /***/ (function(module, exports, __webpack_require__) {
|
4036 |
|
4037 | var shared = __webpack_require__(79);
|
4038 | var uid = __webpack_require__(99);
|
4039 |
|
4040 | var keys = shared('keys');
|
4041 |
|
4042 | module.exports = function (key) {
|
4043 | return keys[key] || (keys[key] = uid(key));
|
4044 | };
|
4045 |
|
4046 |
|
4047 | }),
|
4048 |
|
4049 | (function(module, exports, __webpack_require__) {
|
4050 |
|
4051 |
|
4052 | var uncurryThis = __webpack_require__(4);
|
4053 | var anObject = __webpack_require__(20);
|
4054 | var aPossiblePrototype = __webpack_require__(290);
|
4055 |
|
4056 |
|
4057 |
|
4058 |
|
4059 |
|
4060 | module.exports = Object.setPrototypeOf || ('__proto__' in {} ? function () {
|
4061 | var CORRECT_SETTER = false;
|
4062 | var test = {};
|
4063 | var setter;
|
4064 | try {
|
4065 |
|
4066 | setter = uncurryThis(Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set);
|
4067 | setter(test, []);
|
4068 | CORRECT_SETTER = test instanceof Array;
|
4069 | } catch (error) { }
|
4070 | return function setPrototypeOf(O, proto) {
|
4071 | anObject(O);
|
4072 | aPossiblePrototype(proto);
|
4073 | if (CORRECT_SETTER) setter(O, proto);
|
4074 | else O.__proto__ = proto;
|
4075 | return O;
|
4076 | };
|
4077 | }() : undefined);
|
4078 |
|
4079 |
|
4080 | }),
|
4081 |
|
4082 | (function(module, exports, __webpack_require__) {
|
4083 |
|
4084 | var internalObjectKeys = __webpack_require__(164);
|
4085 | var enumBugKeys = __webpack_require__(128);
|
4086 |
|
4087 | var hiddenKeys = enumBugKeys.concat('length', 'prototype');
|
4088 |
|
4089 |
|
4090 |
|
4091 |
|
4092 | exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
|
4093 | return internalObjectKeys(O, hiddenKeys);
|
4094 | };
|
4095 |
|
4096 |
|
4097 | }),
|
4098 |
|
4099 | (function(module, exports) {
|
4100 |
|
4101 |
|
4102 | exports.f = Object.getOwnPropertySymbols;
|
4103 |
|
4104 |
|
4105 | }),
|
4106 |
|
4107 | (function(module, exports, __webpack_require__) {
|
4108 |
|
4109 | var internalObjectKeys = __webpack_require__(164);
|
4110 | var enumBugKeys = __webpack_require__(128);
|
4111 |
|
4112 |
|
4113 |
|
4114 |
|
4115 | module.exports = Object.keys || function keys(O) {
|
4116 | return internalObjectKeys(O, enumBugKeys);
|
4117 | };
|
4118 |
|
4119 |
|
4120 | }),
|
4121 |
|
4122 | (function(module, exports, __webpack_require__) {
|
4123 |
|
4124 | var classof = __webpack_require__(51);
|
4125 | var getMethod = __webpack_require__(123);
|
4126 | var Iterators = __webpack_require__(50);
|
4127 | var wellKnownSymbol = __webpack_require__(9);
|
4128 |
|
4129 | var ITERATOR = wellKnownSymbol('iterator');
|
4130 |
|
4131 | module.exports = function (it) {
|
4132 | if (it != undefined) return getMethod(it, ITERATOR)
|
4133 | || getMethod(it, '@@iterator')
|
4134 | || Iterators[classof(it)];
|
4135 | };
|
4136 |
|
4137 |
|
4138 | }),
|
4139 |
|
4140 | (function(module, exports, __webpack_require__) {
|
4141 |
|
4142 | var classof = __webpack_require__(63);
|
4143 | var global = __webpack_require__(7);
|
4144 |
|
4145 | module.exports = classof(global.process) == 'process';
|
4146 |
|
4147 |
|
4148 | }),
|
4149 |
|
4150 | (function(module, exports, __webpack_require__) {
|
4151 |
|
4152 | var isPrototypeOf = __webpack_require__(19);
|
4153 |
|
4154 | var $TypeError = TypeError;
|
4155 |
|
4156 | module.exports = function (it, Prototype) {
|
4157 | if (isPrototypeOf(Prototype, it)) return it;
|
4158 | throw $TypeError('Incorrect invocation');
|
4159 | };
|
4160 |
|
4161 |
|
4162 | }),
|
4163 |
|
4164 | (function(module, exports, __webpack_require__) {
|
4165 |
|
4166 | var uncurryThis = __webpack_require__(4);
|
4167 | var fails = __webpack_require__(2);
|
4168 | var isCallable = __webpack_require__(8);
|
4169 | var classof = __webpack_require__(51);
|
4170 | var getBuiltIn = __webpack_require__(18);
|
4171 | var inspectSource = __webpack_require__(131);
|
4172 |
|
4173 | var noop = function () { };
|
4174 | var empty = [];
|
4175 | var construct = getBuiltIn('Reflect', 'construct');
|
4176 | var constructorRegExp = /^\s*(?:class|function)\b/;
|
4177 | var exec = uncurryThis(constructorRegExp.exec);
|
4178 | var INCORRECT_TO_STRING = !constructorRegExp.exec(noop);
|
4179 |
|
4180 | var isConstructorModern = function isConstructor(argument) {
|
4181 | if (!isCallable(argument)) return false;
|
4182 | try {
|
4183 | construct(noop, empty, argument);
|
4184 | return true;
|
4185 | } catch (error) {
|
4186 | return false;
|
4187 | }
|
4188 | };
|
4189 |
|
4190 | var isConstructorLegacy = function isConstructor(argument) {
|
4191 | if (!isCallable(argument)) return false;
|
4192 | switch (classof(argument)) {
|
4193 | case 'AsyncFunction':
|
4194 | case 'GeneratorFunction':
|
4195 | case 'AsyncGeneratorFunction': return false;
|
4196 | }
|
4197 | try {
|
4198 |
|
4199 |
|
4200 |
|
4201 | return INCORRECT_TO_STRING || !!exec(constructorRegExp, inspectSource(argument));
|
4202 | } catch (error) {
|
4203 | return true;
|
4204 | }
|
4205 | };
|
4206 |
|
4207 | isConstructorLegacy.sham = true;
|
4208 |
|
4209 |
|
4210 |
|
4211 | module.exports = !construct || fails(function () {
|
4212 | var called;
|
4213 | return isConstructorModern(isConstructorModern.call)
|
4214 | || !isConstructorModern(Object)
|
4215 | || !isConstructorModern(function () { called = true; })
|
4216 | || called;
|
4217 | }) ? isConstructorLegacy : isConstructorModern;
|
4218 |
|
4219 |
|
4220 | }),
|
4221 |
|
4222 | (function(module, exports, __webpack_require__) {
|
4223 |
|
4224 | var uncurryThis = __webpack_require__(4);
|
4225 |
|
4226 | module.exports = uncurryThis([].slice);
|
4227 |
|
4228 |
|
4229 | }),
|
4230 |
|
4231 | (function(module, __webpack_exports__, __webpack_require__) {
|
4232 |
|
4233 | "use strict";
|
4234 | __webpack_exports__["a"] = matcher;
|
4235 | var __WEBPACK_IMPORTED_MODULE_0__extendOwn_js__ = __webpack_require__(140);
|
4236 | var __WEBPACK_IMPORTED_MODULE_1__isMatch_js__ = __webpack_require__(192);
|
4237 |
|
4238 |
|
4239 |
|
4240 |
|
4241 |
|
4242 | function matcher(attrs) {
|
4243 | attrs = Object(__WEBPACK_IMPORTED_MODULE_0__extendOwn_js__["a" ])({}, attrs);
|
4244 | return function(obj) {
|
4245 | return Object(__WEBPACK_IMPORTED_MODULE_1__isMatch_js__["a" ])(obj, attrs);
|
4246 | };
|
4247 | }
|
4248 |
|
4249 |
|
4250 | }),
|
4251 |
|
4252 | (function(module, __webpack_exports__, __webpack_require__) {
|
4253 |
|
4254 | "use strict";
|
4255 | var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(24);
|
4256 | var __WEBPACK_IMPORTED_MODULE_1__executeBound_js__ = __webpack_require__(208);
|
4257 | var __WEBPACK_IMPORTED_MODULE_2__underscore_js__ = __webpack_require__(25);
|
4258 |
|
4259 |
|
4260 |
|
4261 |
|
4262 |
|
4263 |
|
4264 |
|
4265 |
|
4266 | var partial = Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" ])(function(func, boundArgs) {
|
4267 | var placeholder = partial.placeholder;
|
4268 | var bound = function() {
|
4269 | var position = 0, length = boundArgs.length;
|
4270 | var args = Array(length);
|
4271 | for (var i = 0; i < length; i++) {
|
4272 | args[i] = boundArgs[i] === placeholder ? arguments[position++] : boundArgs[i];
|
4273 | }
|
4274 | while (position < arguments.length) args.push(arguments[position++]);
|
4275 | return Object(__WEBPACK_IMPORTED_MODULE_1__executeBound_js__["a" ])(func, bound, this, this, args);
|
4276 | };
|
4277 | return bound;
|
4278 | });
|
4279 |
|
4280 | partial.placeholder = __WEBPACK_IMPORTED_MODULE_2__underscore_js__["a" ];
|
4281 | __webpack_exports__["a"] = (partial);
|
4282 |
|
4283 |
|
4284 | }),
|
4285 |
|
4286 | (function(module, __webpack_exports__, __webpack_require__) {
|
4287 |
|
4288 | "use strict";
|
4289 | __webpack_exports__["a"] = group;
|
4290 | var __WEBPACK_IMPORTED_MODULE_0__cb_js__ = __webpack_require__(21);
|
4291 | var __WEBPACK_IMPORTED_MODULE_1__each_js__ = __webpack_require__(58);
|
4292 |
|
4293 |
|
4294 |
|
4295 |
|
4296 | function group(behavior, partition) {
|
4297 | return function(obj, iteratee, context) {
|
4298 | var result = partition ? [[], []] : {};
|
4299 | iteratee = Object(__WEBPACK_IMPORTED_MODULE_0__cb_js__["a" ])(iteratee, context);
|
4300 | Object(__WEBPACK_IMPORTED_MODULE_1__each_js__["a" ])(obj, function(value, index) {
|
4301 | var key = iteratee(value, index, obj);
|
4302 | behavior(result, value, key);
|
4303 | });
|
4304 | return result;
|
4305 | };
|
4306 | }
|
4307 |
|
4308 |
|
4309 | }),
|
4310 |
|
4311 | (function(module, exports, __webpack_require__) {
|
4312 |
|
4313 | var fails = __webpack_require__(2);
|
4314 | var wellKnownSymbol = __webpack_require__(9);
|
4315 | var V8_VERSION = __webpack_require__(77);
|
4316 |
|
4317 | var SPECIES = wellKnownSymbol('species');
|
4318 |
|
4319 | module.exports = function (METHOD_NAME) {
|
4320 |
|
4321 |
|
4322 |
|
4323 | return V8_VERSION >= 51 || !fails(function () {
|
4324 | var array = [];
|
4325 | var constructor = array.constructor = {};
|
4326 | constructor[SPECIES] = function () {
|
4327 | return { foo: 1 };
|
4328 | };
|
4329 | return array[METHOD_NAME](Boolean).foo !== 1;
|
4330 | });
|
4331 | };
|
4332 |
|
4333 |
|
4334 | }),
|
4335 |
|
4336 | (function(module, exports, __webpack_require__) {
|
4337 |
|
4338 | module.exports = __webpack_require__(401);
|
4339 |
|
4340 | }),
|
4341 |
|
4342 | (function(module, exports, __webpack_require__) {
|
4343 |
|
4344 | "use strict";
|
4345 |
|
4346 |
|
4347 | var _interopRequireDefault = __webpack_require__(1);
|
4348 |
|
4349 | var _typeof2 = _interopRequireDefault(__webpack_require__(73));
|
4350 |
|
4351 | var _filter = _interopRequireDefault(__webpack_require__(251));
|
4352 |
|
4353 | var _map = _interopRequireDefault(__webpack_require__(35));
|
4354 |
|
4355 | var _keys = _interopRequireDefault(__webpack_require__(115));
|
4356 |
|
4357 | var _stringify = _interopRequireDefault(__webpack_require__(36));
|
4358 |
|
4359 | var _concat = _interopRequireDefault(__webpack_require__(22));
|
4360 |
|
4361 | var _ = __webpack_require__(3);
|
4362 |
|
4363 | var _require = __webpack_require__(252),
|
4364 | timeout = _require.timeout;
|
4365 |
|
4366 | var debug = __webpack_require__(60);
|
4367 |
|
4368 | var debugRequest = debug('leancloud:request');
|
4369 | var debugRequestError = debug('leancloud:request:error');
|
4370 |
|
4371 | var _require2 = __webpack_require__(72),
|
4372 | getAdapter = _require2.getAdapter;
|
4373 |
|
4374 | var requestsCount = 0;
|
4375 |
|
4376 | var ajax = function ajax(_ref) {
|
4377 | var method = _ref.method,
|
4378 | url = _ref.url,
|
4379 | query = _ref.query,
|
4380 | data = _ref.data,
|
4381 | _ref$headers = _ref.headers,
|
4382 | headers = _ref$headers === void 0 ? {} : _ref$headers,
|
4383 | time = _ref.timeout,
|
4384 | onprogress = _ref.onprogress;
|
4385 |
|
4386 | if (query) {
|
4387 | var _context, _context2, _context4;
|
4388 |
|
4389 | var queryString = (0, _filter.default)(_context = (0, _map.default)(_context2 = (0, _keys.default)(query)).call(_context2, function (key) {
|
4390 | var _context3;
|
4391 |
|
4392 | var value = query[key];
|
4393 | if (value === undefined) return undefined;
|
4394 | var v = (0, _typeof2.default)(value) === 'object' ? (0, _stringify.default)(value) : value;
|
4395 | return (0, _concat.default)(_context3 = "".concat(encodeURIComponent(key), "=")).call(_context3, encodeURIComponent(v));
|
4396 | })).call(_context, function (qs) {
|
4397 | return qs;
|
4398 | }).join('&');
|
4399 | url = (0, _concat.default)(_context4 = "".concat(url, "?")).call(_context4, queryString);
|
4400 | }
|
4401 |
|
4402 | var count = requestsCount++;
|
4403 | debugRequest('request(%d) %s %s %o %o %o', count, method, url, query, data, headers);
|
4404 | var request = getAdapter('request');
|
4405 | var promise = request(url, {
|
4406 | method: method,
|
4407 | headers: headers,
|
4408 | data: data,
|
4409 | onprogress: onprogress
|
4410 | }).then(function (response) {
|
4411 | debugRequest('response(%d) %d %O %o', count, response.status, response.data || response.text, response.header);
|
4412 |
|
4413 | if (response.ok === false) {
|
4414 | var error = new Error();
|
4415 | error.response = response;
|
4416 | throw error;
|
4417 | }
|
4418 |
|
4419 | return response.data;
|
4420 | }).catch(function (error) {
|
4421 | if (error.response) {
|
4422 | if (!debug.enabled('leancloud:request')) {
|
4423 | debugRequestError('request(%d) %s %s %o %o %o', count, method, url, query, data, headers);
|
4424 | }
|
4425 |
|
4426 | debugRequestError('response(%d) %d %O %o', count, error.response.status, error.response.data || error.response.text, error.response.header);
|
4427 | error.statusCode = error.response.status;
|
4428 | error.responseText = error.response.text;
|
4429 | error.response = error.response.data;
|
4430 | }
|
4431 |
|
4432 | throw error;
|
4433 | });
|
4434 | return time ? timeout(promise, time) : promise;
|
4435 | };
|
4436 |
|
4437 | module.exports = ajax;
|
4438 |
|
4439 | }),
|
4440 |
|
4441 | (function(module, exports) {
|
4442 |
|
4443 |
|
4444 |
|
4445 | }),
|
4446 |
|
4447 | (function(module, exports) {
|
4448 |
|
4449 | function _typeof(o) {
|
4450 | "@babel/helpers - typeof";
|
4451 |
|
4452 | return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
4453 | return typeof o;
|
4454 | } : function (o) {
|
4455 | return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
4456 | }, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(o);
|
4457 | }
|
4458 | module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
4459 |
|
4460 | }),
|
4461 |
|
4462 | (function(module, exports, __webpack_require__) {
|
4463 |
|
4464 | var Symbol = __webpack_require__(272),
|
4465 | getRawTag = __webpack_require__(644),
|
4466 | objectToString = __webpack_require__(645);
|
4467 |
|
4468 |
|
4469 | var nullTag = '[object Null]',
|
4470 | undefinedTag = '[object Undefined]';
|
4471 |
|
4472 |
|
4473 | var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
|
4474 |
|
4475 |
|
4476 |
|
4477 |
|
4478 |
|
4479 |
|
4480 |
|
4481 |
|
4482 | function baseGetTag(value) {
|
4483 | if (value == null) {
|
4484 | return value === undefined ? undefinedTag : nullTag;
|
4485 | }
|
4486 | return (symToStringTag && symToStringTag in Object(value))
|
4487 | ? getRawTag(value)
|
4488 | : objectToString(value);
|
4489 | }
|
4490 |
|
4491 | module.exports = baseGetTag;
|
4492 |
|
4493 |
|
4494 | }),
|
4495 |
|
4496 | (function(module, exports) {
|
4497 |
|
4498 |
|
4499 |
|
4500 |
|
4501 |
|
4502 |
|
4503 |
|
4504 |
|
4505 |
|
4506 |
|
4507 |
|
4508 |
|
4509 |
|
4510 |
|
4511 |
|
4512 |
|
4513 |
|
4514 |
|
4515 |
|
4516 |
|
4517 |
|
4518 |
|
4519 |
|
4520 |
|
4521 |
|
4522 | function isObjectLike(value) {
|
4523 | return value != null && typeof value == 'object';
|
4524 | }
|
4525 |
|
4526 | module.exports = isObjectLike;
|
4527 |
|
4528 |
|
4529 | }),
|
4530 |
|
4531 | (function(module, exports, __webpack_require__) {
|
4532 |
|
4533 | "use strict";
|
4534 |
|
4535 | var $propertyIsEnumerable = {}.propertyIsEnumerable;
|
4536 |
|
4537 | var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
4538 |
|
4539 |
|
4540 | var NASHORN_BUG = getOwnPropertyDescriptor && !$propertyIsEnumerable.call({ 1: 2 }, 1);
|
4541 |
|
4542 |
|
4543 |
|
4544 | exports.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
|
4545 | var descriptor = getOwnPropertyDescriptor(this, V);
|
4546 | return !!descriptor && descriptor.enumerable;
|
4547 | } : $propertyIsEnumerable;
|
4548 |
|
4549 |
|
4550 | }),
|
4551 |
|
4552 | (function(module, exports) {
|
4553 |
|
4554 | var $TypeError = TypeError;
|
4555 |
|
4556 |
|
4557 |
|
4558 | module.exports = function (it) {
|
4559 | if (it == undefined) throw $TypeError("Can't call method on " + it);
|
4560 | return it;
|
4561 | };
|
4562 |
|
4563 |
|
4564 | }),
|
4565 |
|
4566 | (function(module, exports, __webpack_require__) {
|
4567 |
|
4568 | var aCallable = __webpack_require__(31);
|
4569 |
|
4570 |
|
4571 |
|
4572 | module.exports = function (V, P) {
|
4573 | var func = V[P];
|
4574 | return func == null ? undefined : aCallable(func);
|
4575 | };
|
4576 |
|
4577 |
|
4578 | }),
|
4579 |
|
4580 | (function(module, exports, __webpack_require__) {
|
4581 |
|
4582 | var global = __webpack_require__(7);
|
4583 | var defineGlobalProperty = __webpack_require__(289);
|
4584 |
|
4585 | var SHARED = '__core-js_shared__';
|
4586 | var store = global[SHARED] || defineGlobalProperty(SHARED, {});
|
4587 |
|
4588 | module.exports = store;
|
4589 |
|
4590 |
|
4591 | }),
|
4592 |
|
4593 | (function(module, exports, __webpack_require__) {
|
4594 |
|
4595 | var global = __webpack_require__(7);
|
4596 | var isObject = __webpack_require__(11);
|
4597 |
|
4598 | var document = global.document;
|
4599 |
|
4600 | var EXISTS = isObject(document) && isObject(document.createElement);
|
4601 |
|
4602 | module.exports = function (it) {
|
4603 | return EXISTS ? document.createElement(it) : {};
|
4604 | };
|
4605 |
|
4606 |
|
4607 | }),
|
4608 |
|
4609 | (function(module, exports, __webpack_require__) {
|
4610 |
|
4611 | var toIntegerOrInfinity = __webpack_require__(127);
|
4612 |
|
4613 | var max = Math.max;
|
4614 | var min = Math.min;
|
4615 |
|
4616 |
|
4617 |
|
4618 |
|
4619 | module.exports = function (index, length) {
|
4620 | var integer = toIntegerOrInfinity(index);
|
4621 | return integer < 0 ? max(integer + length, 0) : min(integer, length);
|
4622 | };
|
4623 |
|
4624 |
|
4625 | }),
|
4626 |
|
4627 | (function(module, exports, __webpack_require__) {
|
4628 |
|
4629 | var trunc = __webpack_require__(292);
|
4630 |
|
4631 |
|
4632 |
|
4633 | module.exports = function (argument) {
|
4634 | var number = +argument;
|
4635 |
|
4636 | return number !== number || number === 0 ? 0 : trunc(number);
|
4637 | };
|
4638 |
|
4639 |
|
4640 | }),
|
4641 |
|
4642 | (function(module, exports) {
|
4643 |
|
4644 |
|
4645 | module.exports = [
|
4646 | 'constructor',
|
4647 | 'hasOwnProperty',
|
4648 | 'isPrototypeOf',
|
4649 | 'propertyIsEnumerable',
|
4650 | 'toLocaleString',
|
4651 | 'toString',
|
4652 | 'valueOf'
|
4653 | ];
|
4654 |
|
4655 |
|
4656 | }),
|
4657 |
|
4658 | (function(module, exports, __webpack_require__) {
|
4659 |
|
4660 | var DESCRIPTORS = __webpack_require__(14);
|
4661 | var V8_PROTOTYPE_DEFINE_BUG = __webpack_require__(161);
|
4662 | var definePropertyModule = __webpack_require__(23);
|
4663 | var anObject = __webpack_require__(20);
|
4664 | var toIndexedObject = __webpack_require__(32);
|
4665 | var objectKeys = __webpack_require__(105);
|
4666 |
|
4667 |
|
4668 |
|
4669 |
|
4670 | exports.f = DESCRIPTORS && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {
|
4671 | anObject(O);
|
4672 | var props = toIndexedObject(Properties);
|
4673 | var keys = objectKeys(Properties);
|
4674 | var length = keys.length;
|
4675 | var index = 0;
|
4676 | var key;
|
4677 | while (length > index) definePropertyModule.f(O, key = keys[index++], props[key]);
|
4678 | return O;
|
4679 | };
|
4680 |
|
4681 |
|
4682 | }),
|
4683 |
|
4684 | (function(module, exports, __webpack_require__) {
|
4685 |
|
4686 | var wellKnownSymbol = __webpack_require__(9);
|
4687 |
|
4688 | var TO_STRING_TAG = wellKnownSymbol('toStringTag');
|
4689 | var test = {};
|
4690 |
|
4691 | test[TO_STRING_TAG] = 'z';
|
4692 |
|
4693 | module.exports = String(test) === '[object z]';
|
4694 |
|
4695 |
|
4696 | }),
|
4697 |
|
4698 | (function(module, exports, __webpack_require__) {
|
4699 |
|
4700 | var uncurryThis = __webpack_require__(4);
|
4701 | var isCallable = __webpack_require__(8);
|
4702 | var store = __webpack_require__(124);
|
4703 |
|
4704 | var functionToString = uncurryThis(Function.toString);
|
4705 |
|
4706 |
|
4707 | if (!isCallable(store.inspectSource)) {
|
4708 | store.inspectSource = function (it) {
|
4709 | return functionToString(it);
|
4710 | };
|
4711 | }
|
4712 |
|
4713 | module.exports = store.inspectSource;
|
4714 |
|
4715 |
|
4716 | }),
|
4717 |
|
4718 | (function(module, exports, __webpack_require__) {
|
4719 |
|
4720 | "use strict";
|
4721 |
|
4722 | var $ = __webpack_require__(0);
|
4723 | var call = __webpack_require__(15);
|
4724 | var IS_PURE = __webpack_require__(33);
|
4725 | var FunctionName = __webpack_require__(298);
|
4726 | var isCallable = __webpack_require__(8);
|
4727 | var createIteratorConstructor = __webpack_require__(299);
|
4728 | var getPrototypeOf = __webpack_require__(100);
|
4729 | var setPrototypeOf = __webpack_require__(102);
|
4730 | var setToStringTag = __webpack_require__(52);
|
4731 | var createNonEnumerableProperty = __webpack_require__(37);
|
4732 | var defineBuiltIn = __webpack_require__(44);
|
4733 | var wellKnownSymbol = __webpack_require__(9);
|
4734 | var Iterators = __webpack_require__(50);
|
4735 | var IteratorsCore = __webpack_require__(172);
|
4736 |
|
4737 | var PROPER_FUNCTION_NAME = FunctionName.PROPER;
|
4738 | var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE;
|
4739 | var IteratorPrototype = IteratorsCore.IteratorPrototype;
|
4740 | var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;
|
4741 | var ITERATOR = wellKnownSymbol('iterator');
|
4742 | var KEYS = 'keys';
|
4743 | var VALUES = 'values';
|
4744 | var ENTRIES = 'entries';
|
4745 |
|
4746 | var returnThis = function () { return this; };
|
4747 |
|
4748 | module.exports = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
|
4749 | createIteratorConstructor(IteratorConstructor, NAME, next);
|
4750 |
|
4751 | var getIterationMethod = function (KIND) {
|
4752 | if (KIND === DEFAULT && defaultIterator) return defaultIterator;
|
4753 | if (!BUGGY_SAFARI_ITERATORS && KIND in IterablePrototype) return IterablePrototype[KIND];
|
4754 | switch (KIND) {
|
4755 | case KEYS: return function keys() { return new IteratorConstructor(this, KIND); };
|
4756 | case VALUES: return function values() { return new IteratorConstructor(this, KIND); };
|
4757 | case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); };
|
4758 | } return function () { return new IteratorConstructor(this); };
|
4759 | };
|
4760 |
|
4761 | var TO_STRING_TAG = NAME + ' Iterator';
|
4762 | var INCORRECT_VALUES_NAME = false;
|
4763 | var IterablePrototype = Iterable.prototype;
|
4764 | var nativeIterator = IterablePrototype[ITERATOR]
|
4765 | || IterablePrototype['@@iterator']
|
4766 | || DEFAULT && IterablePrototype[DEFAULT];
|
4767 | var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);
|
4768 | var anyNativeIterator = NAME == 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;
|
4769 | var CurrentIteratorPrototype, methods, KEY;
|
4770 |
|
4771 |
|
4772 | if (anyNativeIterator) {
|
4773 | CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable()));
|
4774 | if (CurrentIteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {
|
4775 | if (!IS_PURE && getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {
|
4776 | if (setPrototypeOf) {
|
4777 | setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype);
|
4778 | } else if (!isCallable(CurrentIteratorPrototype[ITERATOR])) {
|
4779 | defineBuiltIn(CurrentIteratorPrototype, ITERATOR, returnThis);
|
4780 | }
|
4781 | }
|
4782 |
|
4783 | setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true, true);
|
4784 | if (IS_PURE) Iterators[TO_STRING_TAG] = returnThis;
|
4785 | }
|
4786 | }
|
4787 |
|
4788 |
|
4789 | if (PROPER_FUNCTION_NAME && DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) {
|
4790 | if (!IS_PURE && CONFIGURABLE_FUNCTION_NAME) {
|
4791 | createNonEnumerableProperty(IterablePrototype, 'name', VALUES);
|
4792 | } else {
|
4793 | INCORRECT_VALUES_NAME = true;
|
4794 | defaultIterator = function values() { return call(nativeIterator, this); };
|
4795 | }
|
4796 | }
|
4797 |
|
4798 |
|
4799 | if (DEFAULT) {
|
4800 | methods = {
|
4801 | values: getIterationMethod(VALUES),
|
4802 | keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),
|
4803 | entries: getIterationMethod(ENTRIES)
|
4804 | };
|
4805 | if (FORCED) for (KEY in methods) {
|
4806 | if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
|
4807 | defineBuiltIn(IterablePrototype, KEY, methods[KEY]);
|
4808 | }
|
4809 | } else $({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
|
4810 | }
|
4811 |
|
4812 |
|
4813 | if ((!IS_PURE || FORCED) && IterablePrototype[ITERATOR] !== defaultIterator) {
|
4814 | defineBuiltIn(IterablePrototype, ITERATOR, defaultIterator, { name: DEFAULT });
|
4815 | }
|
4816 | Iterators[NAME] = defaultIterator;
|
4817 |
|
4818 | return methods;
|
4819 | };
|
4820 |
|
4821 |
|
4822 | }),
|
4823 |
|
4824 | (function(module, __webpack_exports__, __webpack_require__) {
|
4825 |
|
4826 | "use strict";
|
4827 | Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
|
4828 | var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(6);
|
4829 | __webpack_require__.d(__webpack_exports__, "VERSION", function() { return __WEBPACK_IMPORTED_MODULE_0__setup_js__["e"]; });
|
4830 | var __WEBPACK_IMPORTED_MODULE_1__restArguments_js__ = __webpack_require__(24);
|
4831 | __webpack_require__.d(__webpack_exports__, "restArguments", function() { return __WEBPACK_IMPORTED_MODULE_1__restArguments_js__["a"]; });
|
4832 | var __WEBPACK_IMPORTED_MODULE_2__isObject_js__ = __webpack_require__(56);
|
4833 | __webpack_require__.d(__webpack_exports__, "isObject", function() { return __WEBPACK_IMPORTED_MODULE_2__isObject_js__["a"]; });
|
4834 | var __WEBPACK_IMPORTED_MODULE_3__isNull_js__ = __webpack_require__(321);
|
4835 | __webpack_require__.d(__webpack_exports__, "isNull", function() { return __WEBPACK_IMPORTED_MODULE_3__isNull_js__["a"]; });
|
4836 | var __WEBPACK_IMPORTED_MODULE_4__isUndefined_js__ = __webpack_require__(181);
|
4837 | __webpack_require__.d(__webpack_exports__, "isUndefined", function() { return __WEBPACK_IMPORTED_MODULE_4__isUndefined_js__["a"]; });
|
4838 | var __WEBPACK_IMPORTED_MODULE_5__isBoolean_js__ = __webpack_require__(182);
|
4839 | __webpack_require__.d(__webpack_exports__, "isBoolean", function() { return __WEBPACK_IMPORTED_MODULE_5__isBoolean_js__["a"]; });
|
4840 | var __WEBPACK_IMPORTED_MODULE_6__isElement_js__ = __webpack_require__(322);
|
4841 | __webpack_require__.d(__webpack_exports__, "isElement", function() { return __WEBPACK_IMPORTED_MODULE_6__isElement_js__["a"]; });
|
4842 | var __WEBPACK_IMPORTED_MODULE_7__isString_js__ = __webpack_require__(134);
|
4843 | __webpack_require__.d(__webpack_exports__, "isString", function() { return __WEBPACK_IMPORTED_MODULE_7__isString_js__["a"]; });
|
4844 | var __WEBPACK_IMPORTED_MODULE_8__isNumber_js__ = __webpack_require__(183);
|
4845 | __webpack_require__.d(__webpack_exports__, "isNumber", function() { return __WEBPACK_IMPORTED_MODULE_8__isNumber_js__["a"]; });
|
4846 | var __WEBPACK_IMPORTED_MODULE_9__isDate_js__ = __webpack_require__(323);
|
4847 | __webpack_require__.d(__webpack_exports__, "isDate", function() { return __WEBPACK_IMPORTED_MODULE_9__isDate_js__["a"]; });
|
4848 | var __WEBPACK_IMPORTED_MODULE_10__isRegExp_js__ = __webpack_require__(324);
|
4849 | __webpack_require__.d(__webpack_exports__, "isRegExp", function() { return __WEBPACK_IMPORTED_MODULE_10__isRegExp_js__["a"]; });
|
4850 | var __WEBPACK_IMPORTED_MODULE_11__isError_js__ = __webpack_require__(325);
|
4851 | __webpack_require__.d(__webpack_exports__, "isError", function() { return __WEBPACK_IMPORTED_MODULE_11__isError_js__["a"]; });
|
4852 | var __WEBPACK_IMPORTED_MODULE_12__isSymbol_js__ = __webpack_require__(184);
|
4853 | __webpack_require__.d(__webpack_exports__, "isSymbol", function() { return __WEBPACK_IMPORTED_MODULE_12__isSymbol_js__["a"]; });
|
4854 | var __WEBPACK_IMPORTED_MODULE_13__isArrayBuffer_js__ = __webpack_require__(185);
|
4855 | __webpack_require__.d(__webpack_exports__, "isArrayBuffer", function() { return __WEBPACK_IMPORTED_MODULE_13__isArrayBuffer_js__["a"]; });
|
4856 | var __WEBPACK_IMPORTED_MODULE_14__isDataView_js__ = __webpack_require__(135);
|
4857 | __webpack_require__.d(__webpack_exports__, "isDataView", function() { return __WEBPACK_IMPORTED_MODULE_14__isDataView_js__["a"]; });
|
4858 | var __WEBPACK_IMPORTED_MODULE_15__isArray_js__ = __webpack_require__(57);
|
4859 | __webpack_require__.d(__webpack_exports__, "isArray", function() { return __WEBPACK_IMPORTED_MODULE_15__isArray_js__["a"]; });
|
4860 | var __WEBPACK_IMPORTED_MODULE_16__isFunction_js__ = __webpack_require__(28);
|
4861 | __webpack_require__.d(__webpack_exports__, "isFunction", function() { return __WEBPACK_IMPORTED_MODULE_16__isFunction_js__["a"]; });
|
4862 | var __WEBPACK_IMPORTED_MODULE_17__isArguments_js__ = __webpack_require__(136);
|
4863 | __webpack_require__.d(__webpack_exports__, "isArguments", function() { return __WEBPACK_IMPORTED_MODULE_17__isArguments_js__["a"]; });
|
4864 | var __WEBPACK_IMPORTED_MODULE_18__isFinite_js__ = __webpack_require__(327);
|
4865 | __webpack_require__.d(__webpack_exports__, "isFinite", function() { return __WEBPACK_IMPORTED_MODULE_18__isFinite_js__["a"]; });
|
4866 | var __WEBPACK_IMPORTED_MODULE_19__isNaN_js__ = __webpack_require__(186);
|
4867 | __webpack_require__.d(__webpack_exports__, "isNaN", function() { return __WEBPACK_IMPORTED_MODULE_19__isNaN_js__["a"]; });
|
4868 | var __WEBPACK_IMPORTED_MODULE_20__isTypedArray_js__ = __webpack_require__(187);
|
4869 | __webpack_require__.d(__webpack_exports__, "isTypedArray", function() { return __WEBPACK_IMPORTED_MODULE_20__isTypedArray_js__["a"]; });
|
4870 | var __WEBPACK_IMPORTED_MODULE_21__isEmpty_js__ = __webpack_require__(329);
|
4871 | __webpack_require__.d(__webpack_exports__, "isEmpty", function() { return __WEBPACK_IMPORTED_MODULE_21__isEmpty_js__["a"]; });
|
4872 | var __WEBPACK_IMPORTED_MODULE_22__isMatch_js__ = __webpack_require__(192);
|
4873 | __webpack_require__.d(__webpack_exports__, "isMatch", function() { return __WEBPACK_IMPORTED_MODULE_22__isMatch_js__["a"]; });
|
4874 | var __WEBPACK_IMPORTED_MODULE_23__isEqual_js__ = __webpack_require__(330);
|
4875 | __webpack_require__.d(__webpack_exports__, "isEqual", function() { return __WEBPACK_IMPORTED_MODULE_23__isEqual_js__["a"]; });
|
4876 | var __WEBPACK_IMPORTED_MODULE_24__isMap_js__ = __webpack_require__(332);
|
4877 | __webpack_require__.d(__webpack_exports__, "isMap", function() { return __WEBPACK_IMPORTED_MODULE_24__isMap_js__["a"]; });
|
4878 | var __WEBPACK_IMPORTED_MODULE_25__isWeakMap_js__ = __webpack_require__(333);
|
4879 | __webpack_require__.d(__webpack_exports__, "isWeakMap", function() { return __WEBPACK_IMPORTED_MODULE_25__isWeakMap_js__["a"]; });
|
4880 | var __WEBPACK_IMPORTED_MODULE_26__isSet_js__ = __webpack_require__(334);
|
4881 | __webpack_require__.d(__webpack_exports__, "isSet", function() { return __WEBPACK_IMPORTED_MODULE_26__isSet_js__["a"]; });
|
4882 | var __WEBPACK_IMPORTED_MODULE_27__isWeakSet_js__ = __webpack_require__(335);
|
4883 | __webpack_require__.d(__webpack_exports__, "isWeakSet", function() { return __WEBPACK_IMPORTED_MODULE_27__isWeakSet_js__["a"]; });
|
4884 | var __WEBPACK_IMPORTED_MODULE_28__keys_js__ = __webpack_require__(16);
|
4885 | __webpack_require__.d(__webpack_exports__, "keys", function() { return __WEBPACK_IMPORTED_MODULE_28__keys_js__["a"]; });
|
4886 | var __WEBPACK_IMPORTED_MODULE_29__allKeys_js__ = __webpack_require__(85);
|
4887 | __webpack_require__.d(__webpack_exports__, "allKeys", function() { return __WEBPACK_IMPORTED_MODULE_29__allKeys_js__["a"]; });
|
4888 | var __WEBPACK_IMPORTED_MODULE_30__values_js__ = __webpack_require__(66);
|
4889 | __webpack_require__.d(__webpack_exports__, "values", function() { return __WEBPACK_IMPORTED_MODULE_30__values_js__["a"]; });
|
4890 | var __WEBPACK_IMPORTED_MODULE_31__pairs_js__ = __webpack_require__(336);
|
4891 | __webpack_require__.d(__webpack_exports__, "pairs", function() { return __WEBPACK_IMPORTED_MODULE_31__pairs_js__["a"]; });
|
4892 | var __WEBPACK_IMPORTED_MODULE_32__invert_js__ = __webpack_require__(193);
|
4893 | __webpack_require__.d(__webpack_exports__, "invert", function() { return __WEBPACK_IMPORTED_MODULE_32__invert_js__["a"]; });
|
4894 | var __WEBPACK_IMPORTED_MODULE_33__functions_js__ = __webpack_require__(194);
|
4895 | __webpack_require__.d(__webpack_exports__, "functions", function() { return __WEBPACK_IMPORTED_MODULE_33__functions_js__["a"]; });
|
4896 | __webpack_require__.d(__webpack_exports__, "methods", function() { return __WEBPACK_IMPORTED_MODULE_33__functions_js__["a"]; });
|
4897 | var __WEBPACK_IMPORTED_MODULE_34__extend_js__ = __webpack_require__(195);
|
4898 | __webpack_require__.d(__webpack_exports__, "extend", function() { return __WEBPACK_IMPORTED_MODULE_34__extend_js__["a"]; });
|
4899 | var __WEBPACK_IMPORTED_MODULE_35__extendOwn_js__ = __webpack_require__(140);
|
4900 | __webpack_require__.d(__webpack_exports__, "extendOwn", function() { return __WEBPACK_IMPORTED_MODULE_35__extendOwn_js__["a"]; });
|
4901 | __webpack_require__.d(__webpack_exports__, "assign", function() { return __WEBPACK_IMPORTED_MODULE_35__extendOwn_js__["a"]; });
|
4902 | var __WEBPACK_IMPORTED_MODULE_36__defaults_js__ = __webpack_require__(196);
|
4903 | __webpack_require__.d(__webpack_exports__, "defaults", function() { return __WEBPACK_IMPORTED_MODULE_36__defaults_js__["a"]; });
|
4904 | var __WEBPACK_IMPORTED_MODULE_37__create_js__ = __webpack_require__(337);
|
4905 | __webpack_require__.d(__webpack_exports__, "create", function() { return __WEBPACK_IMPORTED_MODULE_37__create_js__["a"]; });
|
4906 | var __WEBPACK_IMPORTED_MODULE_38__clone_js__ = __webpack_require__(198);
|
4907 | __webpack_require__.d(__webpack_exports__, "clone", function() { return __WEBPACK_IMPORTED_MODULE_38__clone_js__["a"]; });
|
4908 | var __WEBPACK_IMPORTED_MODULE_39__tap_js__ = __webpack_require__(338);
|
4909 | __webpack_require__.d(__webpack_exports__, "tap", function() { return __WEBPACK_IMPORTED_MODULE_39__tap_js__["a"]; });
|
4910 | var __WEBPACK_IMPORTED_MODULE_40__get_js__ = __webpack_require__(199);
|
4911 | __webpack_require__.d(__webpack_exports__, "get", function() { return __WEBPACK_IMPORTED_MODULE_40__get_js__["a"]; });
|
4912 | var __WEBPACK_IMPORTED_MODULE_41__has_js__ = __webpack_require__(339);
|
4913 | __webpack_require__.d(__webpack_exports__, "has", function() { return __WEBPACK_IMPORTED_MODULE_41__has_js__["a"]; });
|
4914 | var __WEBPACK_IMPORTED_MODULE_42__mapObject_js__ = __webpack_require__(340);
|
4915 | __webpack_require__.d(__webpack_exports__, "mapObject", function() { return __WEBPACK_IMPORTED_MODULE_42__mapObject_js__["a"]; });
|
4916 | var __WEBPACK_IMPORTED_MODULE_43__identity_js__ = __webpack_require__(142);
|
4917 | __webpack_require__.d(__webpack_exports__, "identity", function() { return __WEBPACK_IMPORTED_MODULE_43__identity_js__["a"]; });
|
4918 | var __WEBPACK_IMPORTED_MODULE_44__constant_js__ = __webpack_require__(188);
|
4919 | __webpack_require__.d(__webpack_exports__, "constant", function() { return __WEBPACK_IMPORTED_MODULE_44__constant_js__["a"]; });
|
4920 | var __WEBPACK_IMPORTED_MODULE_45__noop_js__ = __webpack_require__(203);
|
4921 | __webpack_require__.d(__webpack_exports__, "noop", function() { return __WEBPACK_IMPORTED_MODULE_45__noop_js__["a"]; });
|
4922 | var __WEBPACK_IMPORTED_MODULE_46__toPath_js__ = __webpack_require__(200);
|
4923 | __webpack_require__.d(__webpack_exports__, "toPath", function() { return __WEBPACK_IMPORTED_MODULE_46__toPath_js__["a"]; });
|
4924 | var __WEBPACK_IMPORTED_MODULE_47__property_js__ = __webpack_require__(143);
|
4925 | __webpack_require__.d(__webpack_exports__, "property", function() { return __WEBPACK_IMPORTED_MODULE_47__property_js__["a"]; });
|
4926 | var __WEBPACK_IMPORTED_MODULE_48__propertyOf_js__ = __webpack_require__(341);
|
4927 | __webpack_require__.d(__webpack_exports__, "propertyOf", function() { return __WEBPACK_IMPORTED_MODULE_48__propertyOf_js__["a"]; });
|
4928 | var __WEBPACK_IMPORTED_MODULE_49__matcher_js__ = __webpack_require__(111);
|
4929 | __webpack_require__.d(__webpack_exports__, "matcher", function() { return __WEBPACK_IMPORTED_MODULE_49__matcher_js__["a"]; });
|
4930 | __webpack_require__.d(__webpack_exports__, "matches", function() { return __WEBPACK_IMPORTED_MODULE_49__matcher_js__["a"]; });
|
4931 | var __WEBPACK_IMPORTED_MODULE_50__times_js__ = __webpack_require__(342);
|
4932 | __webpack_require__.d(__webpack_exports__, "times", function() { return __WEBPACK_IMPORTED_MODULE_50__times_js__["a"]; });
|
4933 | var __WEBPACK_IMPORTED_MODULE_51__random_js__ = __webpack_require__(204);
|
4934 | __webpack_require__.d(__webpack_exports__, "random", function() { return __WEBPACK_IMPORTED_MODULE_51__random_js__["a"]; });
|
4935 | var __WEBPACK_IMPORTED_MODULE_52__now_js__ = __webpack_require__(144);
|
4936 | __webpack_require__.d(__webpack_exports__, "now", function() { return __WEBPACK_IMPORTED_MODULE_52__now_js__["a"]; });
|
4937 | var __WEBPACK_IMPORTED_MODULE_53__escape_js__ = __webpack_require__(343);
|
4938 | __webpack_require__.d(__webpack_exports__, "escape", function() { return __WEBPACK_IMPORTED_MODULE_53__escape_js__["a"]; });
|
4939 | var __WEBPACK_IMPORTED_MODULE_54__unescape_js__ = __webpack_require__(344);
|
4940 | __webpack_require__.d(__webpack_exports__, "unescape", function() { return __WEBPACK_IMPORTED_MODULE_54__unescape_js__["a"]; });
|
4941 | var __WEBPACK_IMPORTED_MODULE_55__templateSettings_js__ = __webpack_require__(207);
|
4942 | __webpack_require__.d(__webpack_exports__, "templateSettings", function() { return __WEBPACK_IMPORTED_MODULE_55__templateSettings_js__["a"]; });
|
4943 | var __WEBPACK_IMPORTED_MODULE_56__template_js__ = __webpack_require__(346);
|
4944 | __webpack_require__.d(__webpack_exports__, "template", function() { return __WEBPACK_IMPORTED_MODULE_56__template_js__["a"]; });
|
4945 | var __WEBPACK_IMPORTED_MODULE_57__result_js__ = __webpack_require__(347);
|
4946 | __webpack_require__.d(__webpack_exports__, "result", function() { return __WEBPACK_IMPORTED_MODULE_57__result_js__["a"]; });
|
4947 | var __WEBPACK_IMPORTED_MODULE_58__uniqueId_js__ = __webpack_require__(348);
|
4948 | __webpack_require__.d(__webpack_exports__, "uniqueId", function() { return __WEBPACK_IMPORTED_MODULE_58__uniqueId_js__["a"]; });
|
4949 | var __WEBPACK_IMPORTED_MODULE_59__chain_js__ = __webpack_require__(349);
|
4950 | __webpack_require__.d(__webpack_exports__, "chain", function() { return __WEBPACK_IMPORTED_MODULE_59__chain_js__["a"]; });
|
4951 | var __WEBPACK_IMPORTED_MODULE_60__iteratee_js__ = __webpack_require__(202);
|
4952 | __webpack_require__.d(__webpack_exports__, "iteratee", function() { return __WEBPACK_IMPORTED_MODULE_60__iteratee_js__["a"]; });
|
4953 | var __WEBPACK_IMPORTED_MODULE_61__partial_js__ = __webpack_require__(112);
|
4954 | __webpack_require__.d(__webpack_exports__, "partial", function() { return __WEBPACK_IMPORTED_MODULE_61__partial_js__["a"]; });
|
4955 | var __WEBPACK_IMPORTED_MODULE_62__bind_js__ = __webpack_require__(209);
|
4956 | __webpack_require__.d(__webpack_exports__, "bind", function() { return __WEBPACK_IMPORTED_MODULE_62__bind_js__["a"]; });
|
4957 | var __WEBPACK_IMPORTED_MODULE_63__bindAll_js__ = __webpack_require__(350);
|
4958 | __webpack_require__.d(__webpack_exports__, "bindAll", function() { return __WEBPACK_IMPORTED_MODULE_63__bindAll_js__["a"]; });
|
4959 | var __WEBPACK_IMPORTED_MODULE_64__memoize_js__ = __webpack_require__(351);
|
4960 | __webpack_require__.d(__webpack_exports__, "memoize", function() { return __WEBPACK_IMPORTED_MODULE_64__memoize_js__["a"]; });
|
4961 | var __WEBPACK_IMPORTED_MODULE_65__delay_js__ = __webpack_require__(210);
|
4962 | __webpack_require__.d(__webpack_exports__, "delay", function() { return __WEBPACK_IMPORTED_MODULE_65__delay_js__["a"]; });
|
4963 | var __WEBPACK_IMPORTED_MODULE_66__defer_js__ = __webpack_require__(352);
|
4964 | __webpack_require__.d(__webpack_exports__, "defer", function() { return __WEBPACK_IMPORTED_MODULE_66__defer_js__["a"]; });
|
4965 | var __WEBPACK_IMPORTED_MODULE_67__throttle_js__ = __webpack_require__(353);
|
4966 | __webpack_require__.d(__webpack_exports__, "throttle", function() { return __WEBPACK_IMPORTED_MODULE_67__throttle_js__["a"]; });
|
4967 | var __WEBPACK_IMPORTED_MODULE_68__debounce_js__ = __webpack_require__(354);
|
4968 | __webpack_require__.d(__webpack_exports__, "debounce", function() { return __WEBPACK_IMPORTED_MODULE_68__debounce_js__["a"]; });
|
4969 | var __WEBPACK_IMPORTED_MODULE_69__wrap_js__ = __webpack_require__(355);
|
4970 | __webpack_require__.d(__webpack_exports__, "wrap", function() { return __WEBPACK_IMPORTED_MODULE_69__wrap_js__["a"]; });
|
4971 | var __WEBPACK_IMPORTED_MODULE_70__negate_js__ = __webpack_require__(145);
|
4972 | __webpack_require__.d(__webpack_exports__, "negate", function() { return __WEBPACK_IMPORTED_MODULE_70__negate_js__["a"]; });
|
4973 | var __WEBPACK_IMPORTED_MODULE_71__compose_js__ = __webpack_require__(356);
|
4974 | __webpack_require__.d(__webpack_exports__, "compose", function() { return __WEBPACK_IMPORTED_MODULE_71__compose_js__["a"]; });
|
4975 | var __WEBPACK_IMPORTED_MODULE_72__after_js__ = __webpack_require__(357);
|
4976 | __webpack_require__.d(__webpack_exports__, "after", function() { return __WEBPACK_IMPORTED_MODULE_72__after_js__["a"]; });
|
4977 | var __WEBPACK_IMPORTED_MODULE_73__before_js__ = __webpack_require__(211);
|
4978 | __webpack_require__.d(__webpack_exports__, "before", function() { return __WEBPACK_IMPORTED_MODULE_73__before_js__["a"]; });
|
4979 | var __WEBPACK_IMPORTED_MODULE_74__once_js__ = __webpack_require__(358);
|
4980 | __webpack_require__.d(__webpack_exports__, "once", function() { return __WEBPACK_IMPORTED_MODULE_74__once_js__["a"]; });
|
4981 | var __WEBPACK_IMPORTED_MODULE_75__findKey_js__ = __webpack_require__(212);
|
4982 | __webpack_require__.d(__webpack_exports__, "findKey", function() { return __WEBPACK_IMPORTED_MODULE_75__findKey_js__["a"]; });
|
4983 | var __WEBPACK_IMPORTED_MODULE_76__findIndex_js__ = __webpack_require__(146);
|
4984 | __webpack_require__.d(__webpack_exports__, "findIndex", function() { return __WEBPACK_IMPORTED_MODULE_76__findIndex_js__["a"]; });
|
4985 | var __WEBPACK_IMPORTED_MODULE_77__findLastIndex_js__ = __webpack_require__(214);
|
4986 | __webpack_require__.d(__webpack_exports__, "findLastIndex", function() { return __WEBPACK_IMPORTED_MODULE_77__findLastIndex_js__["a"]; });
|
4987 | var __WEBPACK_IMPORTED_MODULE_78__sortedIndex_js__ = __webpack_require__(215);
|
4988 | __webpack_require__.d(__webpack_exports__, "sortedIndex", function() { return __WEBPACK_IMPORTED_MODULE_78__sortedIndex_js__["a"]; });
|
4989 | var __WEBPACK_IMPORTED_MODULE_79__indexOf_js__ = __webpack_require__(216);
|
4990 | __webpack_require__.d(__webpack_exports__, "indexOf", function() { return __WEBPACK_IMPORTED_MODULE_79__indexOf_js__["a"]; });
|
4991 | var __WEBPACK_IMPORTED_MODULE_80__lastIndexOf_js__ = __webpack_require__(359);
|
4992 | __webpack_require__.d(__webpack_exports__, "lastIndexOf", function() { return __WEBPACK_IMPORTED_MODULE_80__lastIndexOf_js__["a"]; });
|
4993 | var __WEBPACK_IMPORTED_MODULE_81__find_js__ = __webpack_require__(218);
|
4994 | __webpack_require__.d(__webpack_exports__, "find", function() { return __WEBPACK_IMPORTED_MODULE_81__find_js__["a"]; });
|
4995 | __webpack_require__.d(__webpack_exports__, "detect", function() { return __WEBPACK_IMPORTED_MODULE_81__find_js__["a"]; });
|
4996 | var __WEBPACK_IMPORTED_MODULE_82__findWhere_js__ = __webpack_require__(360);
|
4997 | __webpack_require__.d(__webpack_exports__, "findWhere", function() { return __WEBPACK_IMPORTED_MODULE_82__findWhere_js__["a"]; });
|
4998 | var __WEBPACK_IMPORTED_MODULE_83__each_js__ = __webpack_require__(58);
|
4999 | __webpack_require__.d(__webpack_exports__, "each", function() { return __WEBPACK_IMPORTED_MODULE_83__each_js__["a"]; });
|
5000 | __webpack_require__.d(__webpack_exports__, "forEach", function() { return __WEBPACK_IMPORTED_MODULE_83__each_js__["a"]; });
|
5001 | var __WEBPACK_IMPORTED_MODULE_84__map_js__ = __webpack_require__(68);
|
5002 | __webpack_require__.d(__webpack_exports__, "map", function() { return __WEBPACK_IMPORTED_MODULE_84__map_js__["a"]; });
|
5003 | __webpack_require__.d(__webpack_exports__, "collect", function() { return __WEBPACK_IMPORTED_MODULE_84__map_js__["a"]; });
|
5004 | var __WEBPACK_IMPORTED_MODULE_85__reduce_js__ = __webpack_require__(361);
|
5005 | __webpack_require__.d(__webpack_exports__, "reduce", function() { return __WEBPACK_IMPORTED_MODULE_85__reduce_js__["a"]; });
|
5006 | __webpack_require__.d(__webpack_exports__, "foldl", function() { return __WEBPACK_IMPORTED_MODULE_85__reduce_js__["a"]; });
|
5007 | __webpack_require__.d(__webpack_exports__, "inject", function() { return __WEBPACK_IMPORTED_MODULE_85__reduce_js__["a"]; });
|
5008 | var __WEBPACK_IMPORTED_MODULE_86__reduceRight_js__ = __webpack_require__(362);
|
5009 | __webpack_require__.d(__webpack_exports__, "reduceRight", function() { return __WEBPACK_IMPORTED_MODULE_86__reduceRight_js__["a"]; });
|
5010 | __webpack_require__.d(__webpack_exports__, "foldr", function() { return __WEBPACK_IMPORTED_MODULE_86__reduceRight_js__["a"]; });
|
5011 | var __WEBPACK_IMPORTED_MODULE_87__filter_js__ = __webpack_require__(88);
|
5012 | __webpack_require__.d(__webpack_exports__, "filter", function() { return __WEBPACK_IMPORTED_MODULE_87__filter_js__["a"]; });
|
5013 | __webpack_require__.d(__webpack_exports__, "select", function() { return __WEBPACK_IMPORTED_MODULE_87__filter_js__["a"]; });
|
5014 | var __WEBPACK_IMPORTED_MODULE_88__reject_js__ = __webpack_require__(363);
|
5015 | __webpack_require__.d(__webpack_exports__, "reject", function() { return __WEBPACK_IMPORTED_MODULE_88__reject_js__["a"]; });
|
5016 | var __WEBPACK_IMPORTED_MODULE_89__every_js__ = __webpack_require__(364);
|
5017 | __webpack_require__.d(__webpack_exports__, "every", function() { return __WEBPACK_IMPORTED_MODULE_89__every_js__["a"]; });
|
5018 | __webpack_require__.d(__webpack_exports__, "all", function() { return __WEBPACK_IMPORTED_MODULE_89__every_js__["a"]; });
|
5019 | var __WEBPACK_IMPORTED_MODULE_90__some_js__ = __webpack_require__(365);
|
5020 | __webpack_require__.d(__webpack_exports__, "some", function() { return __WEBPACK_IMPORTED_MODULE_90__some_js__["a"]; });
|
5021 | __webpack_require__.d(__webpack_exports__, "any", function() { return __WEBPACK_IMPORTED_MODULE_90__some_js__["a"]; });
|
5022 | var __WEBPACK_IMPORTED_MODULE_91__contains_js__ = __webpack_require__(89);
|
5023 | __webpack_require__.d(__webpack_exports__, "contains", function() { return __WEBPACK_IMPORTED_MODULE_91__contains_js__["a"]; });
|
5024 | __webpack_require__.d(__webpack_exports__, "includes", function() { return __WEBPACK_IMPORTED_MODULE_91__contains_js__["a"]; });
|
5025 | __webpack_require__.d(__webpack_exports__, "include", function() { return __WEBPACK_IMPORTED_MODULE_91__contains_js__["a"]; });
|
5026 | var __WEBPACK_IMPORTED_MODULE_92__invoke_js__ = __webpack_require__(366);
|
5027 | __webpack_require__.d(__webpack_exports__, "invoke", function() { return __WEBPACK_IMPORTED_MODULE_92__invoke_js__["a"]; });
|
5028 | var __WEBPACK_IMPORTED_MODULE_93__pluck_js__ = __webpack_require__(147);
|
5029 | __webpack_require__.d(__webpack_exports__, "pluck", function() { return __WEBPACK_IMPORTED_MODULE_93__pluck_js__["a"]; });
|
5030 | var __WEBPACK_IMPORTED_MODULE_94__where_js__ = __webpack_require__(367);
|
5031 | __webpack_require__.d(__webpack_exports__, "where", function() { return __WEBPACK_IMPORTED_MODULE_94__where_js__["a"]; });
|
5032 | var __WEBPACK_IMPORTED_MODULE_95__max_js__ = __webpack_require__(220);
|
5033 | __webpack_require__.d(__webpack_exports__, "max", function() { return __WEBPACK_IMPORTED_MODULE_95__max_js__["a"]; });
|
5034 | var __WEBPACK_IMPORTED_MODULE_96__min_js__ = __webpack_require__(368);
|
5035 | __webpack_require__.d(__webpack_exports__, "min", function() { return __WEBPACK_IMPORTED_MODULE_96__min_js__["a"]; });
|
5036 | var __WEBPACK_IMPORTED_MODULE_97__shuffle_js__ = __webpack_require__(369);
|
5037 | __webpack_require__.d(__webpack_exports__, "shuffle", function() { return __WEBPACK_IMPORTED_MODULE_97__shuffle_js__["a"]; });
|
5038 | var __WEBPACK_IMPORTED_MODULE_98__sample_js__ = __webpack_require__(221);
|
5039 | __webpack_require__.d(__webpack_exports__, "sample", function() { return __WEBPACK_IMPORTED_MODULE_98__sample_js__["a"]; });
|
5040 | var __WEBPACK_IMPORTED_MODULE_99__sortBy_js__ = __webpack_require__(370);
|
5041 | __webpack_require__.d(__webpack_exports__, "sortBy", function() { return __WEBPACK_IMPORTED_MODULE_99__sortBy_js__["a"]; });
|
5042 | var __WEBPACK_IMPORTED_MODULE_100__groupBy_js__ = __webpack_require__(371);
|
5043 | __webpack_require__.d(__webpack_exports__, "groupBy", function() { return __WEBPACK_IMPORTED_MODULE_100__groupBy_js__["a"]; });
|
5044 | var __WEBPACK_IMPORTED_MODULE_101__indexBy_js__ = __webpack_require__(372);
|
5045 | __webpack_require__.d(__webpack_exports__, "indexBy", function() { return __WEBPACK_IMPORTED_MODULE_101__indexBy_js__["a"]; });
|
5046 | var __WEBPACK_IMPORTED_MODULE_102__countBy_js__ = __webpack_require__(373);
|
5047 | __webpack_require__.d(__webpack_exports__, "countBy", function() { return __WEBPACK_IMPORTED_MODULE_102__countBy_js__["a"]; });
|
5048 | var __WEBPACK_IMPORTED_MODULE_103__partition_js__ = __webpack_require__(374);
|
5049 | __webpack_require__.d(__webpack_exports__, "partition", function() { return __WEBPACK_IMPORTED_MODULE_103__partition_js__["a"]; });
|
5050 | var __WEBPACK_IMPORTED_MODULE_104__toArray_js__ = __webpack_require__(375);
|
5051 | __webpack_require__.d(__webpack_exports__, "toArray", function() { return __WEBPACK_IMPORTED_MODULE_104__toArray_js__["a"]; });
|
5052 | var __WEBPACK_IMPORTED_MODULE_105__size_js__ = __webpack_require__(376);
|
5053 | __webpack_require__.d(__webpack_exports__, "size", function() { return __WEBPACK_IMPORTED_MODULE_105__size_js__["a"]; });
|
5054 | var __WEBPACK_IMPORTED_MODULE_106__pick_js__ = __webpack_require__(222);
|
5055 | __webpack_require__.d(__webpack_exports__, "pick", function() { return __WEBPACK_IMPORTED_MODULE_106__pick_js__["a"]; });
|
5056 | var __WEBPACK_IMPORTED_MODULE_107__omit_js__ = __webpack_require__(378);
|
5057 | __webpack_require__.d(__webpack_exports__, "omit", function() { return __WEBPACK_IMPORTED_MODULE_107__omit_js__["a"]; });
|
5058 | var __WEBPACK_IMPORTED_MODULE_108__first_js__ = __webpack_require__(379);
|
5059 | __webpack_require__.d(__webpack_exports__, "first", function() { return __WEBPACK_IMPORTED_MODULE_108__first_js__["a"]; });
|
5060 | __webpack_require__.d(__webpack_exports__, "head", function() { return __WEBPACK_IMPORTED_MODULE_108__first_js__["a"]; });
|
5061 | __webpack_require__.d(__webpack_exports__, "take", function() { return __WEBPACK_IMPORTED_MODULE_108__first_js__["a"]; });
|
5062 | var __WEBPACK_IMPORTED_MODULE_109__initial_js__ = __webpack_require__(223);
|
5063 | __webpack_require__.d(__webpack_exports__, "initial", function() { return __WEBPACK_IMPORTED_MODULE_109__initial_js__["a"]; });
|
5064 | var __WEBPACK_IMPORTED_MODULE_110__last_js__ = __webpack_require__(380);
|
5065 | __webpack_require__.d(__webpack_exports__, "last", function() { return __WEBPACK_IMPORTED_MODULE_110__last_js__["a"]; });
|
5066 | var __WEBPACK_IMPORTED_MODULE_111__rest_js__ = __webpack_require__(224);
|
5067 | __webpack_require__.d(__webpack_exports__, "rest", function() { return __WEBPACK_IMPORTED_MODULE_111__rest_js__["a"]; });
|
5068 | __webpack_require__.d(__webpack_exports__, "tail", function() { return __WEBPACK_IMPORTED_MODULE_111__rest_js__["a"]; });
|
5069 | __webpack_require__.d(__webpack_exports__, "drop", function() { return __WEBPACK_IMPORTED_MODULE_111__rest_js__["a"]; });
|
5070 | var __WEBPACK_IMPORTED_MODULE_112__compact_js__ = __webpack_require__(381);
|
5071 | __webpack_require__.d(__webpack_exports__, "compact", function() { return __WEBPACK_IMPORTED_MODULE_112__compact_js__["a"]; });
|
5072 | var __WEBPACK_IMPORTED_MODULE_113__flatten_js__ = __webpack_require__(382);
|
5073 | __webpack_require__.d(__webpack_exports__, "flatten", function() { return __WEBPACK_IMPORTED_MODULE_113__flatten_js__["a"]; });
|
5074 | var __WEBPACK_IMPORTED_MODULE_114__without_js__ = __webpack_require__(383);
|
5075 | __webpack_require__.d(__webpack_exports__, "without", function() { return __WEBPACK_IMPORTED_MODULE_114__without_js__["a"]; });
|
5076 | var __WEBPACK_IMPORTED_MODULE_115__uniq_js__ = __webpack_require__(226);
|
5077 | __webpack_require__.d(__webpack_exports__, "uniq", function() { return __WEBPACK_IMPORTED_MODULE_115__uniq_js__["a"]; });
|
5078 | __webpack_require__.d(__webpack_exports__, "unique", function() { return __WEBPACK_IMPORTED_MODULE_115__uniq_js__["a"]; });
|
5079 | var __WEBPACK_IMPORTED_MODULE_116__union_js__ = __webpack_require__(384);
|
5080 | __webpack_require__.d(__webpack_exports__, "union", function() { return __WEBPACK_IMPORTED_MODULE_116__union_js__["a"]; });
|
5081 | var __WEBPACK_IMPORTED_MODULE_117__intersection_js__ = __webpack_require__(385);
|
5082 | __webpack_require__.d(__webpack_exports__, "intersection", function() { return __WEBPACK_IMPORTED_MODULE_117__intersection_js__["a"]; });
|
5083 | var __WEBPACK_IMPORTED_MODULE_118__difference_js__ = __webpack_require__(225);
|
5084 | __webpack_require__.d(__webpack_exports__, "difference", function() { return __WEBPACK_IMPORTED_MODULE_118__difference_js__["a"]; });
|
5085 | var __WEBPACK_IMPORTED_MODULE_119__unzip_js__ = __webpack_require__(227);
|
5086 | __webpack_require__.d(__webpack_exports__, "unzip", function() { return __WEBPACK_IMPORTED_MODULE_119__unzip_js__["a"]; });
|
5087 | __webpack_require__.d(__webpack_exports__, "transpose", function() { return __WEBPACK_IMPORTED_MODULE_119__unzip_js__["a"]; });
|
5088 | var __WEBPACK_IMPORTED_MODULE_120__zip_js__ = __webpack_require__(386);
|
5089 | __webpack_require__.d(__webpack_exports__, "zip", function() { return __WEBPACK_IMPORTED_MODULE_120__zip_js__["a"]; });
|
5090 | var __WEBPACK_IMPORTED_MODULE_121__object_js__ = __webpack_require__(387);
|
5091 | __webpack_require__.d(__webpack_exports__, "object", function() { return __WEBPACK_IMPORTED_MODULE_121__object_js__["a"]; });
|
5092 | var __WEBPACK_IMPORTED_MODULE_122__range_js__ = __webpack_require__(388);
|
5093 | __webpack_require__.d(__webpack_exports__, "range", function() { return __WEBPACK_IMPORTED_MODULE_122__range_js__["a"]; });
|
5094 | var __WEBPACK_IMPORTED_MODULE_123__chunk_js__ = __webpack_require__(389);
|
5095 | __webpack_require__.d(__webpack_exports__, "chunk", function() { return __WEBPACK_IMPORTED_MODULE_123__chunk_js__["a"]; });
|
5096 | var __WEBPACK_IMPORTED_MODULE_124__mixin_js__ = __webpack_require__(390);
|
5097 | __webpack_require__.d(__webpack_exports__, "mixin", function() { return __WEBPACK_IMPORTED_MODULE_124__mixin_js__["a"]; });
|
5098 | var __WEBPACK_IMPORTED_MODULE_125__underscore_array_methods_js__ = __webpack_require__(391);
|
5099 | __webpack_require__.d(__webpack_exports__, "default", function() { return __WEBPACK_IMPORTED_MODULE_125__underscore_array_methods_js__["a"]; });
|
5100 |
|
5101 |
|
5102 |
|
5103 |
|
5104 |
|
5105 |
|
5106 |
|
5107 |
|
5108 |
|
5109 |
|
5110 |
|
5111 |
|
5112 |
|
5113 |
|
5114 |
|
5115 |
|
5116 |
|
5117 |
|
5118 |
|
5119 |
|
5120 |
|
5121 |
|
5122 |
|
5123 |
|
5124 |
|
5125 |
|
5126 |
|
5127 |
|
5128 |
|
5129 |
|
5130 |
|
5131 |
|
5132 |
|
5133 |
|
5134 |
|
5135 |
|
5136 |
|
5137 |
|
5138 |
|
5139 |
|
5140 |
|
5141 |
|
5142 |
|
5143 |
|
5144 |
|
5145 |
|
5146 |
|
5147 |
|
5148 |
|
5149 |
|
5150 |
|
5151 |
|
5152 |
|
5153 |
|
5154 |
|
5155 |
|
5156 |
|
5157 |
|
5158 |
|
5159 |
|
5160 |
|
5161 |
|
5162 |
|
5163 |
|
5164 |
|
5165 |
|
5166 |
|
5167 |
|
5168 |
|
5169 |
|
5170 |
|
5171 |
|
5172 |
|
5173 |
|
5174 |
|
5175 |
|
5176 |
|
5177 |
|
5178 |
|
5179 |
|
5180 |
|
5181 |
|
5182 |
|
5183 |
|
5184 |
|
5185 |
|
5186 |
|
5187 |
|
5188 |
|
5189 |
|
5190 |
|
5191 |
|
5192 |
|
5193 |
|
5194 |
|
5195 |
|
5196 |
|
5197 |
|
5198 |
|
5199 |
|
5200 |
|
5201 |
|
5202 |
|
5203 |
|
5204 |
|
5205 |
|
5206 |
|
5207 |
|
5208 |
|
5209 |
|
5210 |
|
5211 |
|
5212 |
|
5213 |
|
5214 |
|
5215 |
|
5216 |
|
5217 |
|
5218 |
|
5219 |
|
5220 |
|
5221 |
|
5222 |
|
5223 |
|
5224 |
|
5225 |
|
5226 |
|
5227 |
|
5228 |
|
5229 |
|
5230 |
|
5231 |
|
5232 |
|
5233 |
|
5234 |
|
5235 |
|
5236 |
|
5237 |
|
5238 |
|
5239 |
|
5240 |
|
5241 |
|
5242 |
|
5243 |
|
5244 |
|
5245 |
|
5246 |
|
5247 |
|
5248 |
|
5249 |
|
5250 |
|
5251 |
|
5252 |
|
5253 |
|
5254 |
|
5255 |
|
5256 |
|
5257 |
|
5258 |
|
5259 |
|
5260 |
|
5261 |
|
5262 |
|
5263 |
|
5264 |
|
5265 |
|
5266 |
|
5267 |
|
5268 |
|
5269 |
|
5270 |
|
5271 |
|
5272 |
|
5273 |
|
5274 |
|
5275 |
|
5276 |
|
5277 |
|
5278 |
|
5279 |
|
5280 |
|
5281 |
|
5282 | }),
|
5283 |
|
5284 | (function(module, __webpack_exports__, __webpack_require__) {
|
5285 |
|
5286 | "use strict";
|
5287 | var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(17);
|
5288 |
|
5289 |
|
5290 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" ])('String'));
|
5291 |
|
5292 |
|
5293 | }),
|
5294 |
|
5295 | (function(module, __webpack_exports__, __webpack_require__) {
|
5296 |
|
5297 | "use strict";
|
5298 | var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(17);
|
5299 | var __WEBPACK_IMPORTED_MODULE_1__isFunction_js__ = __webpack_require__(28);
|
5300 | var __WEBPACK_IMPORTED_MODULE_2__isArrayBuffer_js__ = __webpack_require__(185);
|
5301 | var __WEBPACK_IMPORTED_MODULE_3__stringTagBug_js__ = __webpack_require__(84);
|
5302 |
|
5303 |
|
5304 |
|
5305 |
|
5306 |
|
5307 | var isDataView = Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" ])('DataView');
|
5308 |
|
5309 |
|
5310 |
|
5311 | function ie10IsDataView(obj) {
|
5312 | return obj != null && Object(__WEBPACK_IMPORTED_MODULE_1__isFunction_js__["a" ])(obj.getInt8) && Object(__WEBPACK_IMPORTED_MODULE_2__isArrayBuffer_js__["a" ])(obj.buffer);
|
5313 | }
|
5314 |
|
5315 | __webpack_exports__["a"] = (__WEBPACK_IMPORTED_MODULE_3__stringTagBug_js__["a" ] ? ie10IsDataView : isDataView);
|
5316 |
|
5317 |
|
5318 | }),
|
5319 |
|
5320 | (function(module, __webpack_exports__, __webpack_require__) {
|
5321 |
|
5322 | "use strict";
|
5323 | var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(17);
|
5324 | var __WEBPACK_IMPORTED_MODULE_1__has_js__ = __webpack_require__(45);
|
5325 |
|
5326 |
|
5327 |
|
5328 | var isArguments = Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" ])('Arguments');
|
5329 |
|
5330 |
|
5331 |
|
5332 | (function() {
|
5333 | if (!isArguments(arguments)) {
|
5334 | isArguments = function(obj) {
|
5335 | return Object(__WEBPACK_IMPORTED_MODULE_1__has_js__["a" ])(obj, 'callee');
|
5336 | };
|
5337 | }
|
5338 | }());
|
5339 |
|
5340 | __webpack_exports__["a"] = (isArguments);
|
5341 |
|
5342 |
|
5343 | }),
|
5344 |
|
5345 | (function(module, __webpack_exports__, __webpack_require__) {
|
5346 |
|
5347 | "use strict";
|
5348 | var __WEBPACK_IMPORTED_MODULE_0__shallowProperty_js__ = __webpack_require__(190);
|
5349 |
|
5350 |
|
5351 |
|
5352 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__shallowProperty_js__["a" ])('byteLength'));
|
5353 |
|
5354 |
|
5355 | }),
|
5356 |
|
5357 | (function(module, __webpack_exports__, __webpack_require__) {
|
5358 |
|
5359 | "use strict";
|
5360 | __webpack_exports__["a"] = ie11fingerprint;
|
5361 | __webpack_require__.d(__webpack_exports__, "b", function() { return mapMethods; });
|
5362 | __webpack_require__.d(__webpack_exports__, "d", function() { return weakMapMethods; });
|
5363 | __webpack_require__.d(__webpack_exports__, "c", function() { return setMethods; });
|
5364 | var __WEBPACK_IMPORTED_MODULE_0__getLength_js__ = __webpack_require__(29);
|
5365 | var __WEBPACK_IMPORTED_MODULE_1__isFunction_js__ = __webpack_require__(28);
|
5366 | var __WEBPACK_IMPORTED_MODULE_2__allKeys_js__ = __webpack_require__(85);
|
5367 |
|
5368 |
|
5369 |
|
5370 |
|
5371 |
|
5372 |
|
5373 |
|
5374 |
|
5375 | function ie11fingerprint(methods) {
|
5376 | var length = Object(__WEBPACK_IMPORTED_MODULE_0__getLength_js__["a" ])(methods);
|
5377 | return function(obj) {
|
5378 | if (obj == null) return false;
|
5379 |
|
5380 | var keys = Object(__WEBPACK_IMPORTED_MODULE_2__allKeys_js__["a" ])(obj);
|
5381 | if (Object(__WEBPACK_IMPORTED_MODULE_0__getLength_js__["a" ])(keys)) return false;
|
5382 | for (var i = 0; i < length; i++) {
|
5383 | if (!Object(__WEBPACK_IMPORTED_MODULE_1__isFunction_js__["a" ])(obj[methods[i]])) return false;
|
5384 | }
|
5385 |
|
5386 |
|
5387 |
|
5388 | return methods !== weakMapMethods || !Object(__WEBPACK_IMPORTED_MODULE_1__isFunction_js__["a" ])(obj[forEachName]);
|
5389 | };
|
5390 | }
|
5391 |
|
5392 |
|
5393 |
|
5394 | var forEachName = 'forEach',
|
5395 | hasName = 'has',
|
5396 | commonInit = ['clear', 'delete'],
|
5397 | mapTail = ['get', hasName, 'set'];
|
5398 |
|
5399 |
|
5400 |
|
5401 | var mapMethods = commonInit.concat(forEachName, mapTail),
|
5402 | weakMapMethods = commonInit.concat(mapTail),
|
5403 | setMethods = ['add'].concat(commonInit, forEachName, hasName);
|
5404 |
|
5405 |
|
5406 | }),
|
5407 |
|
5408 | (function(module, __webpack_exports__, __webpack_require__) {
|
5409 |
|
5410 | "use strict";
|
5411 | __webpack_exports__["a"] = createAssigner;
|
5412 |
|
5413 | function createAssigner(keysFunc, defaults) {
|
5414 | return function(obj) {
|
5415 | var length = arguments.length;
|
5416 | if (defaults) obj = Object(obj);
|
5417 | if (length < 2 || obj == null) return obj;
|
5418 | for (var index = 1; index < length; index++) {
|
5419 | var source = arguments[index],
|
5420 | keys = keysFunc(source),
|
5421 | l = keys.length;
|
5422 | for (var i = 0; i < l; i++) {
|
5423 | var key = keys[i];
|
5424 | if (!defaults || obj[key] === void 0) obj[key] = source[key];
|
5425 | }
|
5426 | }
|
5427 | return obj;
|
5428 | };
|
5429 | }
|
5430 |
|
5431 |
|
5432 | }),
|
5433 |
|
5434 | (function(module, __webpack_exports__, __webpack_require__) {
|
5435 |
|
5436 | "use strict";
|
5437 | var __WEBPACK_IMPORTED_MODULE_0__createAssigner_js__ = __webpack_require__(139);
|
5438 | var __WEBPACK_IMPORTED_MODULE_1__keys_js__ = __webpack_require__(16);
|
5439 |
|
5440 |
|
5441 |
|
5442 |
|
5443 |
|
5444 |
|
5445 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createAssigner_js__["a" ])(__WEBPACK_IMPORTED_MODULE_1__keys_js__["a" ]));
|
5446 |
|
5447 |
|
5448 | }),
|
5449 |
|
5450 | (function(module, __webpack_exports__, __webpack_require__) {
|
5451 |
|
5452 | "use strict";
|
5453 | __webpack_exports__["a"] = deepGet;
|
5454 |
|
5455 | function deepGet(obj, path) {
|
5456 | var length = path.length;
|
5457 | for (var i = 0; i < length; i++) {
|
5458 | if (obj == null) return void 0;
|
5459 | obj = obj[path[i]];
|
5460 | }
|
5461 | return length ? obj : void 0;
|
5462 | }
|
5463 |
|
5464 |
|
5465 | }),
|
5466 |
|
5467 | (function(module, __webpack_exports__, __webpack_require__) {
|
5468 |
|
5469 | "use strict";
|
5470 | __webpack_exports__["a"] = identity;
|
5471 |
|
5472 | function identity(value) {
|
5473 | return value;
|
5474 | }
|
5475 |
|
5476 |
|
5477 | }),
|
5478 |
|
5479 | (function(module, __webpack_exports__, __webpack_require__) {
|
5480 |
|
5481 | "use strict";
|
5482 | __webpack_exports__["a"] = property;
|
5483 | var __WEBPACK_IMPORTED_MODULE_0__deepGet_js__ = __webpack_require__(141);
|
5484 | var __WEBPACK_IMPORTED_MODULE_1__toPath_js__ = __webpack_require__(86);
|
5485 |
|
5486 |
|
5487 |
|
5488 |
|
5489 |
|
5490 | function property(path) {
|
5491 | path = Object(__WEBPACK_IMPORTED_MODULE_1__toPath_js__["a" ])(path);
|
5492 | return function(obj) {
|
5493 | return Object(__WEBPACK_IMPORTED_MODULE_0__deepGet_js__["a" ])(obj, path);
|
5494 | };
|
5495 | }
|
5496 |
|
5497 |
|
5498 | }),
|
5499 |
|
5500 | (function(module, __webpack_exports__, __webpack_require__) {
|
5501 |
|
5502 | "use strict";
|
5503 |
|
5504 | __webpack_exports__["a"] = (Date.now || function() {
|
5505 | return new Date().getTime();
|
5506 | });
|
5507 |
|
5508 |
|
5509 | }),
|
5510 |
|
5511 | (function(module, __webpack_exports__, __webpack_require__) {
|
5512 |
|
5513 | "use strict";
|
5514 | __webpack_exports__["a"] = negate;
|
5515 |
|
5516 | function negate(predicate) {
|
5517 | return function() {
|
5518 | return !predicate.apply(this, arguments);
|
5519 | };
|
5520 | }
|
5521 |
|
5522 |
|
5523 | }),
|
5524 |
|
5525 | (function(module, __webpack_exports__, __webpack_require__) {
|
5526 |
|
5527 | "use strict";
|
5528 | var __WEBPACK_IMPORTED_MODULE_0__createPredicateIndexFinder_js__ = __webpack_require__(213);
|
5529 |
|
5530 |
|
5531 |
|
5532 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createPredicateIndexFinder_js__["a" ])(1));
|
5533 |
|
5534 |
|
5535 | }),
|
5536 |
|
5537 | (function(module, __webpack_exports__, __webpack_require__) {
|
5538 |
|
5539 | "use strict";
|
5540 | __webpack_exports__["a"] = pluck;
|
5541 | var __WEBPACK_IMPORTED_MODULE_0__map_js__ = __webpack_require__(68);
|
5542 | var __WEBPACK_IMPORTED_MODULE_1__property_js__ = __webpack_require__(143);
|
5543 |
|
5544 |
|
5545 |
|
5546 |
|
5547 | function pluck(obj, key) {
|
5548 | return Object(__WEBPACK_IMPORTED_MODULE_0__map_js__["a" ])(obj, Object(__WEBPACK_IMPORTED_MODULE_1__property_js__["a" ])(key));
|
5549 | }
|
5550 |
|
5551 |
|
5552 | }),
|
5553 |
|
5554 | (function(module, exports, __webpack_require__) {
|
5555 |
|
5556 | module.exports = __webpack_require__(234);
|
5557 |
|
5558 | }),
|
5559 |
|
5560 | (function(module, exports, __webpack_require__) {
|
5561 |
|
5562 | var wellKnownSymbol = __webpack_require__(9);
|
5563 |
|
5564 | exports.f = wellKnownSymbol;
|
5565 |
|
5566 |
|
5567 | }),
|
5568 |
|
5569 | (function(module, exports, __webpack_require__) {
|
5570 |
|
5571 | module.exports = __webpack_require__(244);
|
5572 |
|
5573 | }),
|
5574 |
|
5575 | (function(module, exports, __webpack_require__) {
|
5576 |
|
5577 | module.exports = __webpack_require__(503);
|
5578 |
|
5579 | }),
|
5580 |
|
5581 | (function(module, exports, __webpack_require__) {
|
5582 |
|
5583 | module.exports = __webpack_require__(554);
|
5584 |
|
5585 | }),
|
5586 |
|
5587 | (function(module, exports, __webpack_require__) {
|
5588 |
|
5589 | module.exports = __webpack_require__(572);
|
5590 |
|
5591 | }),
|
5592 |
|
5593 | (function(module, exports, __webpack_require__) {
|
5594 |
|
5595 | module.exports = __webpack_require__(576);
|
5596 |
|
5597 | }),
|
5598 |
|
5599 | (function(module, exports, __webpack_require__) {
|
5600 |
|
5601 | var defineBuiltIn = __webpack_require__(44);
|
5602 |
|
5603 | module.exports = function (target, src, options) {
|
5604 | for (var key in src) {
|
5605 | if (options && options.unsafe && target[key]) target[key] = src[key];
|
5606 | else defineBuiltIn(target, key, src[key], options);
|
5607 | } return target;
|
5608 | };
|
5609 |
|
5610 |
|
5611 | }),
|
5612 |
|
5613 | (function(module, exports, __webpack_require__) {
|
5614 |
|
5615 | "use strict";
|
5616 |
|
5617 | var $ = __webpack_require__(0);
|
5618 | var global = __webpack_require__(7);
|
5619 | var InternalMetadataModule = __webpack_require__(94);
|
5620 | var fails = __webpack_require__(2);
|
5621 | var createNonEnumerableProperty = __webpack_require__(37);
|
5622 | var iterate = __webpack_require__(42);
|
5623 | var anInstance = __webpack_require__(108);
|
5624 | var isCallable = __webpack_require__(8);
|
5625 | var isObject = __webpack_require__(11);
|
5626 | var setToStringTag = __webpack_require__(52);
|
5627 | var defineProperty = __webpack_require__(23).f;
|
5628 | var forEach = __webpack_require__(70).forEach;
|
5629 | var DESCRIPTORS = __webpack_require__(14);
|
5630 | var InternalStateModule = __webpack_require__(43);
|
5631 |
|
5632 | var setInternalState = InternalStateModule.set;
|
5633 | var internalStateGetterFor = InternalStateModule.getterFor;
|
5634 |
|
5635 | module.exports = function (CONSTRUCTOR_NAME, wrapper, common) {
|
5636 | var IS_MAP = CONSTRUCTOR_NAME.indexOf('Map') !== -1;
|
5637 | var IS_WEAK = CONSTRUCTOR_NAME.indexOf('Weak') !== -1;
|
5638 | var ADDER = IS_MAP ? 'set' : 'add';
|
5639 | var NativeConstructor = global[CONSTRUCTOR_NAME];
|
5640 | var NativePrototype = NativeConstructor && NativeConstructor.prototype;
|
5641 | var exported = {};
|
5642 | var Constructor;
|
5643 |
|
5644 | if (!DESCRIPTORS || !isCallable(NativeConstructor)
|
5645 | || !(IS_WEAK || NativePrototype.forEach && !fails(function () { new NativeConstructor().entries().next(); }))
|
5646 | ) {
|
5647 |
|
5648 | Constructor = common.getConstructor(wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER);
|
5649 | InternalMetadataModule.enable();
|
5650 | } else {
|
5651 | Constructor = wrapper(function (target, iterable) {
|
5652 | setInternalState(anInstance(target, Prototype), {
|
5653 | type: CONSTRUCTOR_NAME,
|
5654 | collection: new NativeConstructor()
|
5655 | });
|
5656 | if (iterable != undefined) iterate(iterable, target[ADDER], { that: target, AS_ENTRIES: IS_MAP });
|
5657 | });
|
5658 |
|
5659 | var Prototype = Constructor.prototype;
|
5660 |
|
5661 | var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME);
|
5662 |
|
5663 | forEach(['add', 'clear', 'delete', 'forEach', 'get', 'has', 'set', 'keys', 'values', 'entries'], function (KEY) {
|
5664 | var IS_ADDER = KEY == 'add' || KEY == 'set';
|
5665 | if (KEY in NativePrototype && !(IS_WEAK && KEY == 'clear')) {
|
5666 | createNonEnumerableProperty(Prototype, KEY, function (a, b) {
|
5667 | var collection = getInternalState(this).collection;
|
5668 | if (!IS_ADDER && IS_WEAK && !isObject(a)) return KEY == 'get' ? undefined : false;
|
5669 | var result = collection[KEY](a === 0 ? 0 : a, b);
|
5670 | return IS_ADDER ? this : result;
|
5671 | });
|
5672 | }
|
5673 | });
|
5674 |
|
5675 | IS_WEAK || defineProperty(Prototype, 'size', {
|
5676 | configurable: true,
|
5677 | get: function () {
|
5678 | return getInternalState(this).collection.size;
|
5679 | }
|
5680 | });
|
5681 | }
|
5682 |
|
5683 | setToStringTag(Constructor, CONSTRUCTOR_NAME, false, true);
|
5684 |
|
5685 | exported[CONSTRUCTOR_NAME] = Constructor;
|
5686 | $({ global: true, forced: true }, exported);
|
5687 |
|
5688 | if (!IS_WEAK) common.setStrong(Constructor, CONSTRUCTOR_NAME, IS_MAP);
|
5689 |
|
5690 | return Constructor;
|
5691 | };
|
5692 |
|
5693 |
|
5694 | }),
|
5695 |
|
5696 | (function(module, exports, __webpack_require__) {
|
5697 |
|
5698 | "use strict";
|
5699 |
|
5700 |
|
5701 | module.exports = __webpack_require__(591);
|
5702 |
|
5703 | }),
|
5704 |
|
5705 | (function(module, exports, __webpack_require__) {
|
5706 |
|
5707 |
|
5708 | var NATIVE_SYMBOL = __webpack_require__(64);
|
5709 |
|
5710 | module.exports = NATIVE_SYMBOL
|
5711 | && !Symbol.sham
|
5712 | && typeof Symbol.iterator == 'symbol';
|
5713 |
|
5714 |
|
5715 | }),
|
5716 |
|
5717 | (function(module, exports, __webpack_require__) {
|
5718 |
|
5719 | var DESCRIPTORS = __webpack_require__(14);
|
5720 | var fails = __webpack_require__(2);
|
5721 | var createElement = __webpack_require__(125);
|
5722 |
|
5723 |
|
5724 | module.exports = !DESCRIPTORS && !fails(function () {
|
5725 |
|
5726 | return Object.defineProperty(createElement('div'), 'a', {
|
5727 | get: function () { return 7; }
|
5728 | }).a != 7;
|
5729 | });
|
5730 |
|
5731 |
|
5732 | }),
|
5733 |
|
5734 | (function(module, exports, __webpack_require__) {
|
5735 |
|
5736 | var fails = __webpack_require__(2);
|
5737 | var isCallable = __webpack_require__(8);
|
5738 |
|
5739 | var replacement = /#|\.prototype\./;
|
5740 |
|
5741 | var isForced = function (feature, detection) {
|
5742 | var value = data[normalize(feature)];
|
5743 | return value == POLYFILL ? true
|
5744 | : value == NATIVE ? false
|
5745 | : isCallable(detection) ? fails(detection)
|
5746 | : !!detection;
|
5747 | };
|
5748 |
|
5749 | var normalize = isForced.normalize = function (string) {
|
5750 | return String(string).replace(replacement, '.').toLowerCase();
|
5751 | };
|
5752 |
|
5753 | var data = isForced.data = {};
|
5754 | var NATIVE = isForced.NATIVE = 'N';
|
5755 | var POLYFILL = isForced.POLYFILL = 'P';
|
5756 |
|
5757 | module.exports = isForced;
|
5758 |
|
5759 |
|
5760 | }),
|
5761 |
|
5762 | (function(module, exports, __webpack_require__) {
|
5763 |
|
5764 | var DESCRIPTORS = __webpack_require__(14);
|
5765 | var fails = __webpack_require__(2);
|
5766 |
|
5767 |
|
5768 |
|
5769 | module.exports = DESCRIPTORS && fails(function () {
|
5770 |
|
5771 | return Object.defineProperty(function () { }, 'prototype', {
|
5772 | value: 42,
|
5773 | writable: false
|
5774 | }).prototype != 42;
|
5775 | });
|
5776 |
|
5777 |
|
5778 | }),
|
5779 |
|
5780 | (function(module, exports, __webpack_require__) {
|
5781 |
|
5782 | var fails = __webpack_require__(2);
|
5783 |
|
5784 | module.exports = !fails(function () {
|
5785 | function F() { }
|
5786 | F.prototype.constructor = null;
|
5787 |
|
5788 | return Object.getPrototypeOf(new F()) !== F.prototype;
|
5789 | });
|
5790 |
|
5791 |
|
5792 | }),
|
5793 |
|
5794 | (function(module, exports, __webpack_require__) {
|
5795 |
|
5796 | var getBuiltIn = __webpack_require__(18);
|
5797 | var uncurryThis = __webpack_require__(4);
|
5798 | var getOwnPropertyNamesModule = __webpack_require__(103);
|
5799 | var getOwnPropertySymbolsModule = __webpack_require__(104);
|
5800 | var anObject = __webpack_require__(20);
|
5801 |
|
5802 | var concat = uncurryThis([].concat);
|
5803 |
|
5804 |
|
5805 | module.exports = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
|
5806 | var keys = getOwnPropertyNamesModule.f(anObject(it));
|
5807 | var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
|
5808 | return getOwnPropertySymbols ? concat(keys, getOwnPropertySymbols(it)) : keys;
|
5809 | };
|
5810 |
|
5811 |
|
5812 | }),
|
5813 |
|
5814 | (function(module, exports, __webpack_require__) {
|
5815 |
|
5816 | var uncurryThis = __webpack_require__(4);
|
5817 | var hasOwn = __webpack_require__(13);
|
5818 | var toIndexedObject = __webpack_require__(32);
|
5819 | var indexOf = __webpack_require__(165).indexOf;
|
5820 | var hiddenKeys = __webpack_require__(80);
|
5821 |
|
5822 | var push = uncurryThis([].push);
|
5823 |
|
5824 | module.exports = function (object, names) {
|
5825 | var O = toIndexedObject(object);
|
5826 | var i = 0;
|
5827 | var result = [];
|
5828 | var key;
|
5829 | for (key in O) !hasOwn(hiddenKeys, key) && hasOwn(O, key) && push(result, key);
|
5830 |
|
5831 | while (names.length > i) if (hasOwn(O, key = names[i++])) {
|
5832 | ~indexOf(result, key) || push(result, key);
|
5833 | }
|
5834 | return result;
|
5835 | };
|
5836 |
|
5837 |
|
5838 | }),
|
5839 |
|
5840 | (function(module, exports, __webpack_require__) {
|
5841 |
|
5842 | var toIndexedObject = __webpack_require__(32);
|
5843 | var toAbsoluteIndex = __webpack_require__(126);
|
5844 | var lengthOfArrayLike = __webpack_require__(41);
|
5845 |
|
5846 |
|
5847 | var createMethod = function (IS_INCLUDES) {
|
5848 | return function ($this, el, fromIndex) {
|
5849 | var O = toIndexedObject($this);
|
5850 | var length = lengthOfArrayLike(O);
|
5851 | var index = toAbsoluteIndex(fromIndex, length);
|
5852 | var value;
|
5853 |
|
5854 |
|
5855 | if (IS_INCLUDES && el != el) while (length > index) {
|
5856 | value = O[index++];
|
5857 |
|
5858 | if (value != value) return true;
|
5859 |
|
5860 | } else for (;length > index; index++) {
|
5861 | if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
|
5862 | } return !IS_INCLUDES && -1;
|
5863 | };
|
5864 | };
|
5865 |
|
5866 | module.exports = {
|
5867 |
|
5868 |
|
5869 | includes: createMethod(true),
|
5870 |
|
5871 |
|
5872 | indexOf: createMethod(false)
|
5873 | };
|
5874 |
|
5875 |
|
5876 | }),
|
5877 |
|
5878 | (function(module, exports, __webpack_require__) {
|
5879 |
|
5880 | var getBuiltIn = __webpack_require__(18);
|
5881 |
|
5882 | module.exports = getBuiltIn('document', 'documentElement');
|
5883 |
|
5884 |
|
5885 | }),
|
5886 |
|
5887 | (function(module, exports, __webpack_require__) {
|
5888 |
|
5889 | var wellKnownSymbol = __webpack_require__(9);
|
5890 | var Iterators = __webpack_require__(50);
|
5891 |
|
5892 | var ITERATOR = wellKnownSymbol('iterator');
|
5893 | var ArrayPrototype = Array.prototype;
|
5894 |
|
5895 |
|
5896 | module.exports = function (it) {
|
5897 | return it !== undefined && (Iterators.Array === it || ArrayPrototype[ITERATOR] === it);
|
5898 | };
|
5899 |
|
5900 |
|
5901 | }),
|
5902 |
|
5903 | (function(module, exports, __webpack_require__) {
|
5904 |
|
5905 | var call = __webpack_require__(15);
|
5906 | var aCallable = __webpack_require__(31);
|
5907 | var anObject = __webpack_require__(20);
|
5908 | var tryToString = __webpack_require__(78);
|
5909 | var getIteratorMethod = __webpack_require__(106);
|
5910 |
|
5911 | var $TypeError = TypeError;
|
5912 |
|
5913 | module.exports = function (argument, usingIterator) {
|
5914 | var iteratorMethod = arguments.length < 2 ? getIteratorMethod(argument) : usingIterator;
|
5915 | if (aCallable(iteratorMethod)) return anObject(call(iteratorMethod, argument));
|
5916 | throw $TypeError(tryToString(argument) + ' is not iterable');
|
5917 | };
|
5918 |
|
5919 |
|
5920 | }),
|
5921 |
|
5922 | (function(module, exports, __webpack_require__) {
|
5923 |
|
5924 | var call = __webpack_require__(15);
|
5925 | var anObject = __webpack_require__(20);
|
5926 | var getMethod = __webpack_require__(123);
|
5927 |
|
5928 | module.exports = function (iterator, kind, value) {
|
5929 | var innerResult, innerError;
|
5930 | anObject(iterator);
|
5931 | try {
|
5932 | innerResult = getMethod(iterator, 'return');
|
5933 | if (!innerResult) {
|
5934 | if (kind === 'throw') throw value;
|
5935 | return value;
|
5936 | }
|
5937 | innerResult = call(innerResult, iterator);
|
5938 | } catch (error) {
|
5939 | innerError = true;
|
5940 | innerResult = error;
|
5941 | }
|
5942 | if (kind === 'throw') throw value;
|
5943 | if (innerError) throw innerResult;
|
5944 | anObject(innerResult);
|
5945 | return value;
|
5946 | };
|
5947 |
|
5948 |
|
5949 | }),
|
5950 |
|
5951 | (function(module, exports) {
|
5952 |
|
5953 | module.exports = function () { };
|
5954 |
|
5955 |
|
5956 | }),
|
5957 |
|
5958 | (function(module, exports, __webpack_require__) {
|
5959 |
|
5960 | var global = __webpack_require__(7);
|
5961 | var isCallable = __webpack_require__(8);
|
5962 | var inspectSource = __webpack_require__(131);
|
5963 |
|
5964 | var WeakMap = global.WeakMap;
|
5965 |
|
5966 | module.exports = isCallable(WeakMap) && /native code/.test(inspectSource(WeakMap));
|
5967 |
|
5968 |
|
5969 | }),
|
5970 |
|
5971 | (function(module, exports, __webpack_require__) {
|
5972 |
|
5973 | "use strict";
|
5974 |
|
5975 | var fails = __webpack_require__(2);
|
5976 | var isCallable = __webpack_require__(8);
|
5977 | var create = __webpack_require__(49);
|
5978 | var getPrototypeOf = __webpack_require__(100);
|
5979 | var defineBuiltIn = __webpack_require__(44);
|
5980 | var wellKnownSymbol = __webpack_require__(9);
|
5981 | var IS_PURE = __webpack_require__(33);
|
5982 |
|
5983 | var ITERATOR = wellKnownSymbol('iterator');
|
5984 | var BUGGY_SAFARI_ITERATORS = false;
|
5985 |
|
5986 |
|
5987 |
|
5988 | var IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator;
|
5989 |
|
5990 |
|
5991 | if ([].keys) {
|
5992 | arrayIterator = [].keys();
|
5993 |
|
5994 | if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS = true;
|
5995 | else {
|
5996 | PrototypeOfArrayIteratorPrototype = getPrototypeOf(getPrototypeOf(arrayIterator));
|
5997 | if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype = PrototypeOfArrayIteratorPrototype;
|
5998 | }
|
5999 | }
|
6000 |
|
6001 | var NEW_ITERATOR_PROTOTYPE = IteratorPrototype == undefined || fails(function () {
|
6002 | var test = {};
|
6003 |
|
6004 | return IteratorPrototype[ITERATOR].call(test) !== test;
|
6005 | });
|
6006 |
|
6007 | if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype = {};
|
6008 | else if (IS_PURE) IteratorPrototype = create(IteratorPrototype);
|
6009 |
|
6010 |
|
6011 |
|
6012 | if (!isCallable(IteratorPrototype[ITERATOR])) {
|
6013 | defineBuiltIn(IteratorPrototype, ITERATOR, function () {
|
6014 | return this;
|
6015 | });
|
6016 | }
|
6017 |
|
6018 | module.exports = {
|
6019 | IteratorPrototype: IteratorPrototype,
|
6020 | BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS
|
6021 | };
|
6022 |
|
6023 |
|
6024 | }),
|
6025 |
|
6026 | (function(module, exports, __webpack_require__) {
|
6027 |
|
6028 | "use strict";
|
6029 |
|
6030 | var getBuiltIn = __webpack_require__(18);
|
6031 | var definePropertyModule = __webpack_require__(23);
|
6032 | var wellKnownSymbol = __webpack_require__(9);
|
6033 | var DESCRIPTORS = __webpack_require__(14);
|
6034 |
|
6035 | var SPECIES = wellKnownSymbol('species');
|
6036 |
|
6037 | module.exports = function (CONSTRUCTOR_NAME) {
|
6038 | var Constructor = getBuiltIn(CONSTRUCTOR_NAME);
|
6039 | var defineProperty = definePropertyModule.f;
|
6040 |
|
6041 | if (DESCRIPTORS && Constructor && !Constructor[SPECIES]) {
|
6042 | defineProperty(Constructor, SPECIES, {
|
6043 | configurable: true,
|
6044 | get: function () { return this; }
|
6045 | });
|
6046 | }
|
6047 | };
|
6048 |
|
6049 |
|
6050 | }),
|
6051 |
|
6052 | (function(module, exports, __webpack_require__) {
|
6053 |
|
6054 | var anObject = __webpack_require__(20);
|
6055 | var aConstructor = __webpack_require__(175);
|
6056 | var wellKnownSymbol = __webpack_require__(9);
|
6057 |
|
6058 | var SPECIES = wellKnownSymbol('species');
|
6059 |
|
6060 |
|
6061 |
|
6062 | module.exports = function (O, defaultConstructor) {
|
6063 | var C = anObject(O).constructor;
|
6064 | var S;
|
6065 | return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? defaultConstructor : aConstructor(S);
|
6066 | };
|
6067 |
|
6068 |
|
6069 | }),
|
6070 |
|
6071 | (function(module, exports, __webpack_require__) {
|
6072 |
|
6073 | var isConstructor = __webpack_require__(109);
|
6074 | var tryToString = __webpack_require__(78);
|
6075 |
|
6076 | var $TypeError = TypeError;
|
6077 |
|
6078 |
|
6079 | module.exports = function (argument) {
|
6080 | if (isConstructor(argument)) return argument;
|
6081 | throw $TypeError(tryToString(argument) + ' is not a constructor');
|
6082 | };
|
6083 |
|
6084 |
|
6085 | }),
|
6086 |
|
6087 | (function(module, exports, __webpack_require__) {
|
6088 |
|
6089 | var global = __webpack_require__(7);
|
6090 | var apply = __webpack_require__(75);
|
6091 | var bind = __webpack_require__(48);
|
6092 | var isCallable = __webpack_require__(8);
|
6093 | var hasOwn = __webpack_require__(13);
|
6094 | var fails = __webpack_require__(2);
|
6095 | var html = __webpack_require__(166);
|
6096 | var arraySlice = __webpack_require__(110);
|
6097 | var createElement = __webpack_require__(125);
|
6098 | var validateArgumentsLength = __webpack_require__(303);
|
6099 | var IS_IOS = __webpack_require__(177);
|
6100 | var IS_NODE = __webpack_require__(107);
|
6101 |
|
6102 | var set = global.setImmediate;
|
6103 | var clear = global.clearImmediate;
|
6104 | var process = global.process;
|
6105 | var Dispatch = global.Dispatch;
|
6106 | var Function = global.Function;
|
6107 | var MessageChannel = global.MessageChannel;
|
6108 | var String = global.String;
|
6109 | var counter = 0;
|
6110 | var queue = {};
|
6111 | var ONREADYSTATECHANGE = 'onreadystatechange';
|
6112 | var location, defer, channel, port;
|
6113 |
|
6114 | try {
|
6115 |
|
6116 | location = global.location;
|
6117 | } catch (error) { }
|
6118 |
|
6119 | var run = function (id) {
|
6120 | if (hasOwn(queue, id)) {
|
6121 | var fn = queue[id];
|
6122 | delete queue[id];
|
6123 | fn();
|
6124 | }
|
6125 | };
|
6126 |
|
6127 | var runner = function (id) {
|
6128 | return function () {
|
6129 | run(id);
|
6130 | };
|
6131 | };
|
6132 |
|
6133 | var listener = function (event) {
|
6134 | run(event.data);
|
6135 | };
|
6136 |
|
6137 | var post = function (id) {
|
6138 |
|
6139 | global.postMessage(String(id), location.protocol + '//' + location.host);
|
6140 | };
|
6141 |
|
6142 |
|
6143 | if (!set || !clear) {
|
6144 | set = function setImmediate(handler) {
|
6145 | validateArgumentsLength(arguments.length, 1);
|
6146 | var fn = isCallable(handler) ? handler : Function(handler);
|
6147 | var args = arraySlice(arguments, 1);
|
6148 | queue[++counter] = function () {
|
6149 | apply(fn, undefined, args);
|
6150 | };
|
6151 | defer(counter);
|
6152 | return counter;
|
6153 | };
|
6154 | clear = function clearImmediate(id) {
|
6155 | delete queue[id];
|
6156 | };
|
6157 |
|
6158 | if (IS_NODE) {
|
6159 | defer = function (id) {
|
6160 | process.nextTick(runner(id));
|
6161 | };
|
6162 |
|
6163 | } else if (Dispatch && Dispatch.now) {
|
6164 | defer = function (id) {
|
6165 | Dispatch.now(runner(id));
|
6166 | };
|
6167 |
|
6168 |
|
6169 | } else if (MessageChannel && !IS_IOS) {
|
6170 | channel = new MessageChannel();
|
6171 | port = channel.port2;
|
6172 | channel.port1.onmessage = listener;
|
6173 | defer = bind(port.postMessage, port);
|
6174 |
|
6175 |
|
6176 | } else if (
|
6177 | global.addEventListener &&
|
6178 | isCallable(global.postMessage) &&
|
6179 | !global.importScripts &&
|
6180 | location && location.protocol !== 'file:' &&
|
6181 | !fails(post)
|
6182 | ) {
|
6183 | defer = post;
|
6184 | global.addEventListener('message', listener, false);
|
6185 |
|
6186 | } else if (ONREADYSTATECHANGE in createElement('script')) {
|
6187 | defer = function (id) {
|
6188 | html.appendChild(createElement('script'))[ONREADYSTATECHANGE] = function () {
|
6189 | html.removeChild(this);
|
6190 | run(id);
|
6191 | };
|
6192 | };
|
6193 |
|
6194 | } else {
|
6195 | defer = function (id) {
|
6196 | setTimeout(runner(id), 0);
|
6197 | };
|
6198 | }
|
6199 | }
|
6200 |
|
6201 | module.exports = {
|
6202 | set: set,
|
6203 | clear: clear
|
6204 | };
|
6205 |
|
6206 |
|
6207 | /***/ }),
|
6208 | /* 177 */
|
6209 | /***/ (function(module, exports, __webpack_require__) {
|
6210 |
|
6211 | var userAgent = __webpack_require__(98);
|
6212 |
|
6213 | module.exports = /(?:ipad|iphone|ipod).*applewebkit/i.test(userAgent);
|
6214 |
|
6215 |
|
6216 | }),
|
6217 |
|
6218 | (function(module, exports, __webpack_require__) {
|
6219 |
|
6220 | var NativePromiseConstructor = __webpack_require__(65);
|
6221 | var checkCorrectnessOfIteration = __webpack_require__(179);
|
6222 | var FORCED_PROMISE_CONSTRUCTOR = __webpack_require__(83).CONSTRUCTOR;
|
6223 |
|
6224 | module.exports = FORCED_PROMISE_CONSTRUCTOR || !checkCorrectnessOfIteration(function (iterable) {
|
6225 | NativePromiseConstructor.all(iterable).then(undefined, function () { });
|
6226 | });
|
6227 |
|
6228 |
|
6229 | }),
|
6230 |
|
6231 | (function(module, exports, __webpack_require__) {
|
6232 |
|
6233 | var wellKnownSymbol = __webpack_require__(9);
|
6234 |
|
6235 | var ITERATOR = wellKnownSymbol('iterator');
|
6236 | var SAFE_CLOSING = false;
|
6237 |
|
6238 | try {
|
6239 | var called = 0;
|
6240 | var iteratorWithReturn = {
|
6241 | next: function () {
|
6242 | return { done: !!called++ };
|
6243 | },
|
6244 | 'return': function () {
|
6245 | SAFE_CLOSING = true;
|
6246 | }
|
6247 | };
|
6248 | iteratorWithReturn[ITERATOR] = function () {
|
6249 | return this;
|
6250 | };
|
6251 |
|
6252 | Array.from(iteratorWithReturn, function () { throw 2; });
|
6253 | } catch (error) { }
|
6254 |
|
6255 | module.exports = function (exec, SKIP_CLOSING) {
|
6256 | if (!SKIP_CLOSING && !SAFE_CLOSING) return false;
|
6257 | var ITERATION_SUPPORT = false;
|
6258 | try {
|
6259 | var object = {};
|
6260 | object[ITERATOR] = function () {
|
6261 | return {
|
6262 | next: function () {
|
6263 | return { done: ITERATION_SUPPORT = true };
|
6264 | }
|
6265 | };
|
6266 | };
|
6267 | exec(object);
|
6268 | } catch (error) { }
|
6269 | return ITERATION_SUPPORT;
|
6270 | };
|
6271 |
|
6272 |
|
6273 | }),
|
6274 |
|
6275 | (function(module, exports, __webpack_require__) {
|
6276 |
|
6277 | var anObject = __webpack_require__(20);
|
6278 | var isObject = __webpack_require__(11);
|
6279 | var newPromiseCapability = __webpack_require__(54);
|
6280 |
|
6281 | module.exports = function (C, x) {
|
6282 | anObject(C);
|
6283 | if (isObject(x) && x.constructor === C) return x;
|
6284 | var promiseCapability = newPromiseCapability.f(C);
|
6285 | var resolve = promiseCapability.resolve;
|
6286 | resolve(x);
|
6287 | return promiseCapability.promise;
|
6288 | };
|
6289 |
|
6290 |
|
6291 | }),
|
6292 |
|
6293 | (function(module, __webpack_exports__, __webpack_require__) {
|
6294 |
|
6295 | "use strict";
|
6296 | __webpack_exports__["a"] = isUndefined;
|
6297 |
|
6298 | function isUndefined(obj) {
|
6299 | return obj === void 0;
|
6300 | }
|
6301 |
|
6302 |
|
6303 | }),
|
6304 |
|
6305 | (function(module, __webpack_exports__, __webpack_require__) {
|
6306 |
|
6307 | "use strict";
|
6308 | __webpack_exports__["a"] = isBoolean;
|
6309 | var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(6);
|
6310 |
|
6311 |
|
6312 |
|
6313 | function isBoolean(obj) {
|
6314 | return obj === true || obj === false || __WEBPACK_IMPORTED_MODULE_0__setup_js__["t" ].call(obj) === '[object Boolean]';
|
6315 | }
|
6316 |
|
6317 |
|
6318 | }),
|
6319 |
|
6320 | (function(module, __webpack_exports__, __webpack_require__) {
|
6321 |
|
6322 | "use strict";
|
6323 | var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(17);
|
6324 |
|
6325 |
|
6326 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" ])('Number'));
|
6327 |
|
6328 |
|
6329 | }),
|
6330 |
|
6331 | (function(module, __webpack_exports__, __webpack_require__) {
|
6332 |
|
6333 | "use strict";
|
6334 | var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(17);
|
6335 |
|
6336 |
|
6337 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" ])('Symbol'));
|
6338 |
|
6339 |
|
6340 | }),
|
6341 |
|
6342 | (function(module, __webpack_exports__, __webpack_require__) {
|
6343 |
|
6344 | "use strict";
|
6345 | var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(17);
|
6346 |
|
6347 |
|
6348 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" ])('ArrayBuffer'));
|
6349 |
|
6350 |
|
6351 | }),
|
6352 |
|
6353 | (function(module, __webpack_exports__, __webpack_require__) {
|
6354 |
|
6355 | "use strict";
|
6356 | __webpack_exports__["a"] = isNaN;
|
6357 | var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(6);
|
6358 | var __WEBPACK_IMPORTED_MODULE_1__isNumber_js__ = __webpack_require__(183);
|
6359 |
|
6360 |
|
6361 |
|
6362 |
|
6363 | function isNaN(obj) {
|
6364 | return Object(__WEBPACK_IMPORTED_MODULE_1__isNumber_js__["a" ])(obj) && Object(__WEBPACK_IMPORTED_MODULE_0__setup_js__["g" ])(obj);
|
6365 | }
|
6366 |
|
6367 |
|
6368 | }),
|
6369 |
|
6370 | (function(module, __webpack_exports__, __webpack_require__) {
|
6371 |
|
6372 | "use strict";
|
6373 | var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(6);
|
6374 | var __WEBPACK_IMPORTED_MODULE_1__isDataView_js__ = __webpack_require__(135);
|
6375 | var __WEBPACK_IMPORTED_MODULE_2__constant_js__ = __webpack_require__(188);
|
6376 | var __WEBPACK_IMPORTED_MODULE_3__isBufferLike_js__ = __webpack_require__(328);
|
6377 |
|
6378 |
|
6379 |
|
6380 |
|
6381 |
|
6382 |
|
6383 | var typedArrayPattern = /\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;
|
6384 | function isTypedArray(obj) {
|
6385 |
|
6386 |
|
6387 | return __WEBPACK_IMPORTED_MODULE_0__setup_js__["l" ] ? (Object(__WEBPACK_IMPORTED_MODULE_0__setup_js__["l" ])(obj) && !Object(__WEBPACK_IMPORTED_MODULE_1__isDataView_js__["a" ])(obj)) :
|
6388 | Object(__WEBPACK_IMPORTED_MODULE_3__isBufferLike_js__["a" ])(obj) && typedArrayPattern.test(__WEBPACK_IMPORTED_MODULE_0__setup_js__["t" ].call(obj));
|
6389 | }
|
6390 |
|
6391 | __webpack_exports__["a"] = (__WEBPACK_IMPORTED_MODULE_0__setup_js__["r" ] ? isTypedArray : Object(__WEBPACK_IMPORTED_MODULE_2__constant_js__["a" ])(false));
|
6392 |
|
6393 |
|
6394 | }),
|
6395 |
|
6396 | (function(module, __webpack_exports__, __webpack_require__) {
|
6397 |
|
6398 | "use strict";
|
6399 | __webpack_exports__["a"] = constant;
|
6400 |
|
6401 | function constant(value) {
|
6402 | return function() {
|
6403 | return value;
|
6404 | };
|
6405 | }
|
6406 |
|
6407 |
|
6408 | }),
|
6409 |
|
6410 | (function(module, __webpack_exports__, __webpack_require__) {
|
6411 |
|
6412 | "use strict";
|
6413 | __webpack_exports__["a"] = createSizePropertyCheck;
|
6414 | var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(6);
|
6415 |
|
6416 |
|
6417 |
|
6418 | function createSizePropertyCheck(getSizeProperty) {
|
6419 | return function(collection) {
|
6420 | var sizeProperty = getSizeProperty(collection);
|
6421 | return typeof sizeProperty == 'number' && sizeProperty >= 0 && sizeProperty <= __WEBPACK_IMPORTED_MODULE_0__setup_js__["b" ];
|
6422 | }
|
6423 | }
|
6424 |
|
6425 |
|
6426 | }),
|
6427 |
|
6428 | (function(module, __webpack_exports__, __webpack_require__) {
|
6429 |
|
6430 | "use strict";
|
6431 | __webpack_exports__["a"] = shallowProperty;
|
6432 |
|
6433 | function shallowProperty(key) {
|
6434 | return function(obj) {
|
6435 | return obj == null ? void 0 : obj[key];
|
6436 | };
|
6437 | }
|
6438 |
|
6439 |
|
6440 | }),
|
6441 |
|
6442 | (function(module, __webpack_exports__, __webpack_require__) {
|
6443 |
|
6444 | "use strict";
|
6445 | __webpack_exports__["a"] = collectNonEnumProps;
|
6446 | var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(6);
|
6447 | var __WEBPACK_IMPORTED_MODULE_1__isFunction_js__ = __webpack_require__(28);
|
6448 | var __WEBPACK_IMPORTED_MODULE_2__has_js__ = __webpack_require__(45);
|
6449 |
|
6450 |
|
6451 |
|
6452 |
|
6453 |
|
6454 |
|
6455 |
|
6456 |
|
6457 | function emulatedSet(keys) {
|
6458 | var hash = {};
|
6459 | for (var l = keys.length, i = 0; i < l; ++i) hash[keys[i]] = true;
|
6460 | return {
|
6461 | contains: function(key) { return hash[key]; },
|
6462 | push: function(key) {
|
6463 | hash[key] = true;
|
6464 | return keys.push(key);
|
6465 | }
|
6466 | };
|
6467 | }
|
6468 |
|
6469 |
|
6470 |
|
6471 |
|
6472 | function collectNonEnumProps(obj, keys) {
|
6473 | keys = emulatedSet(keys);
|
6474 | var nonEnumIdx = __WEBPACK_IMPORTED_MODULE_0__setup_js__["n" ].length;
|
6475 | var constructor = obj.constructor;
|
6476 | var proto = Object(__WEBPACK_IMPORTED_MODULE_1__isFunction_js__["a" /* default */])(constructor) && constructor.prototype || __WEBPACK_IMPORTED_MODULE_0__setup_js__["c" /* ObjProto */];
|
6477 |
|
6478 | // Constructor is a special case.
|
6479 | var prop = 'constructor';
|
6480 | if (Object(__WEBPACK_IMPORTED_MODULE_2__has_js__["a" /* default */])(obj, prop) && !keys.contains(prop)) keys.push(prop);
|
6481 |
|
6482 | while (nonEnumIdx--) {
|
6483 | prop = __WEBPACK_IMPORTED_MODULE_0__setup_js__["n" ][nonEnumIdx];
|
6484 | if (prop in obj && obj[prop] !== proto[prop] && !keys.contains(prop)) {
|
6485 | keys.push(prop);
|
6486 | }
|
6487 | }
|
6488 | }
|
6489 |
|
6490 |
|
6491 | }),
|
6492 |
|
6493 | (function(module, __webpack_exports__, __webpack_require__) {
|
6494 |
|
6495 | "use strict";
|
6496 | __webpack_exports__["a"] = isMatch;
|
6497 | var __WEBPACK_IMPORTED_MODULE_0__keys_js__ = __webpack_require__(16);
|
6498 |
|
6499 |
|
6500 |
|
6501 | function isMatch(object, attrs) {
|
6502 | var _keys = Object(__WEBPACK_IMPORTED_MODULE_0__keys_js__["a" ])(attrs), length = _keys.length;
|
6503 | if (object == null) return !length;
|
6504 | var obj = Object(object);
|
6505 | for (var i = 0; i < length; i++) {
|
6506 | var key = _keys[i];
|
6507 | if (attrs[key] !== obj[key] || !(key in obj)) return false;
|
6508 | }
|
6509 | return true;
|
6510 | }
|
6511 |
|
6512 |
|
6513 | }),
|
6514 |
|
6515 | (function(module, __webpack_exports__, __webpack_require__) {
|
6516 |
|
6517 | "use strict";
|
6518 | __webpack_exports__["a"] = invert;
|
6519 | var __WEBPACK_IMPORTED_MODULE_0__keys_js__ = __webpack_require__(16);
|
6520 |
|
6521 |
|
6522 |
|
6523 | function invert(obj) {
|
6524 | var result = {};
|
6525 | var _keys = Object(__WEBPACK_IMPORTED_MODULE_0__keys_js__["a" ])(obj);
|
6526 | for (var i = 0, length = _keys.length; i < length; i++) {
|
6527 | result[obj[_keys[i]]] = _keys[i];
|
6528 | }
|
6529 | return result;
|
6530 | }
|
6531 |
|
6532 |
|
6533 | }),
|
6534 |
|
6535 | (function(module, __webpack_exports__, __webpack_require__) {
|
6536 |
|
6537 | "use strict";
|
6538 | __webpack_exports__["a"] = functions;
|
6539 | var __WEBPACK_IMPORTED_MODULE_0__isFunction_js__ = __webpack_require__(28);
|
6540 |
|
6541 |
|
6542 |
|
6543 | function functions(obj) {
|
6544 | var names = [];
|
6545 | for (var key in obj) {
|
6546 | if (Object(__WEBPACK_IMPORTED_MODULE_0__isFunction_js__["a" ])(obj[key])) names.push(key);
|
6547 | }
|
6548 | return names.sort();
|
6549 | }
|
6550 |
|
6551 |
|
6552 | }),
|
6553 |
|
6554 | (function(module, __webpack_exports__, __webpack_require__) {
|
6555 |
|
6556 | "use strict";
|
6557 | var __WEBPACK_IMPORTED_MODULE_0__createAssigner_js__ = __webpack_require__(139);
|
6558 | var __WEBPACK_IMPORTED_MODULE_1__allKeys_js__ = __webpack_require__(85);
|
6559 |
|
6560 |
|
6561 |
|
6562 |
|
6563 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createAssigner_js__["a" ])(__WEBPACK_IMPORTED_MODULE_1__allKeys_js__["a" ]));
|
6564 |
|
6565 |
|
6566 | }),
|
6567 |
|
6568 | (function(module, __webpack_exports__, __webpack_require__) {
|
6569 |
|
6570 | "use strict";
|
6571 | var __WEBPACK_IMPORTED_MODULE_0__createAssigner_js__ = __webpack_require__(139);
|
6572 | var __WEBPACK_IMPORTED_MODULE_1__allKeys_js__ = __webpack_require__(85);
|
6573 |
|
6574 |
|
6575 |
|
6576 |
|
6577 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createAssigner_js__["a" ])(__WEBPACK_IMPORTED_MODULE_1__allKeys_js__["a" ], true));
|
6578 |
|
6579 |
|
6580 | }),
|
6581 |
|
6582 | (function(module, __webpack_exports__, __webpack_require__) {
|
6583 |
|
6584 | "use strict";
|
6585 | __webpack_exports__["a"] = baseCreate;
|
6586 | var __WEBPACK_IMPORTED_MODULE_0__isObject_js__ = __webpack_require__(56);
|
6587 | var __WEBPACK_IMPORTED_MODULE_1__setup_js__ = __webpack_require__(6);
|
6588 |
|
6589 |
|
6590 |
|
6591 |
|
6592 | function ctor() {
|
6593 | return function(){};
|
6594 | }
|
6595 |
|
6596 |
|
6597 | function baseCreate(prototype) {
|
6598 | if (!Object(__WEBPACK_IMPORTED_MODULE_0__isObject_js__["a" ])(prototype)) return {};
|
6599 | if (__WEBPACK_IMPORTED_MODULE_1__setup_js__["j" ]) return Object(__WEBPACK_IMPORTED_MODULE_1__setup_js__["j" ])(prototype);
|
6600 | var Ctor = ctor();
|
6601 | Ctor.prototype = prototype;
|
6602 | var result = new Ctor;
|
6603 | Ctor.prototype = null;
|
6604 | return result;
|
6605 | }
|
6606 |
|
6607 |
|
6608 | }),
|
6609 |
|
6610 | (function(module, __webpack_exports__, __webpack_require__) {
|
6611 |
|
6612 | "use strict";
|
6613 | __webpack_exports__["a"] = clone;
|
6614 | var __WEBPACK_IMPORTED_MODULE_0__isObject_js__ = __webpack_require__(56);
|
6615 | var __WEBPACK_IMPORTED_MODULE_1__isArray_js__ = __webpack_require__(57);
|
6616 | var __WEBPACK_IMPORTED_MODULE_2__extend_js__ = __webpack_require__(195);
|
6617 |
|
6618 |
|
6619 |
|
6620 |
|
6621 |
|
6622 | function clone(obj) {
|
6623 | if (!Object(__WEBPACK_IMPORTED_MODULE_0__isObject_js__["a" ])(obj)) return obj;
|
6624 | return Object(__WEBPACK_IMPORTED_MODULE_1__isArray_js__["a" ])(obj) ? obj.slice() : Object(__WEBPACK_IMPORTED_MODULE_2__extend_js__["a" ])({}, obj);
|
6625 | }
|
6626 |
|
6627 |
|
6628 | }),
|
6629 |
|
6630 | (function(module, __webpack_exports__, __webpack_require__) {
|
6631 |
|
6632 | "use strict";
|
6633 | __webpack_exports__["a"] = get;
|
6634 | /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__toPath_js__ = __webpack_require__(86);
|
6635 | /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__deepGet_js__ = __webpack_require__(141);
|
6636 | /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__isUndefined_js__ = __webpack_require__(181);
|
6637 |
|
6638 |
|
6639 |
|
6640 |
|
6641 | // Get the value of the (deep) property on `path` from `object`.
|
6642 | // If any property in `path` does not exist or if the value is
|
6643 | // `undefined`, return `defaultValue` instead.
|
6644 | // The `path` is normalized through `_.toPath`.
|
6645 | function get(object, path, defaultValue) {
|
6646 | var value = Object(__WEBPACK_IMPORTED_MODULE_1__deepGet_js__["a" ])(object, Object(__WEBPACK_IMPORTED_MODULE_0__toPath_js__["a" ])(path));
|
6647 | return Object(__WEBPACK_IMPORTED_MODULE_2__isUndefined_js__["a" ])(value) ? defaultValue : value;
|
6648 | }
|
6649 |
|
6650 |
|
6651 | }),
|
6652 |
|
6653 | (function(module, __webpack_exports__, __webpack_require__) {
|
6654 |
|
6655 | "use strict";
|
6656 | __webpack_exports__["a"] = toPath;
|
6657 | var __WEBPACK_IMPORTED_MODULE_0__underscore_js__ = __webpack_require__(25);
|
6658 | var __WEBPACK_IMPORTED_MODULE_1__isArray_js__ = __webpack_require__(57);
|
6659 |
|
6660 |
|
6661 |
|
6662 |
|
6663 |
|
6664 | function toPath(path) {
|
6665 | return Object(__WEBPACK_IMPORTED_MODULE_1__isArray_js__["a" ])(path) ? path : [path];
|
6666 | }
|
6667 | __WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" ].toPath = toPath;
|
6668 |
|
6669 |
|
6670 | }),
|
6671 |
|
6672 | (function(module, __webpack_exports__, __webpack_require__) {
|
6673 |
|
6674 | "use strict";
|
6675 | __webpack_exports__["a"] = baseIteratee;
|
6676 | var __WEBPACK_IMPORTED_MODULE_0__identity_js__ = __webpack_require__(142);
|
6677 | var __WEBPACK_IMPORTED_MODULE_1__isFunction_js__ = __webpack_require__(28);
|
6678 | var __WEBPACK_IMPORTED_MODULE_2__isObject_js__ = __webpack_require__(56);
|
6679 | var __WEBPACK_IMPORTED_MODULE_3__isArray_js__ = __webpack_require__(57);
|
6680 | var __WEBPACK_IMPORTED_MODULE_4__matcher_js__ = __webpack_require__(111);
|
6681 | var __WEBPACK_IMPORTED_MODULE_5__property_js__ = __webpack_require__(143);
|
6682 | var __WEBPACK_IMPORTED_MODULE_6__optimizeCb_js__ = __webpack_require__(87);
|
6683 |
|
6684 |
|
6685 |
|
6686 |
|
6687 |
|
6688 |
|
6689 |
|
6690 |
|
6691 |
|
6692 |
|
6693 |
|
6694 | function baseIteratee(value, context, argCount) {
|
6695 | if (value == null) return __WEBPACK_IMPORTED_MODULE_0__identity_js__["a" ];
|
6696 | if (Object(__WEBPACK_IMPORTED_MODULE_1__isFunction_js__["a" ])(value)) return Object(__WEBPACK_IMPORTED_MODULE_6__optimizeCb_js__["a" ])(value, context, argCount);
|
6697 | if (Object(__WEBPACK_IMPORTED_MODULE_2__isObject_js__["a" ])(value) && !Object(__WEBPACK_IMPORTED_MODULE_3__isArray_js__["a" ])(value)) return Object(__WEBPACK_IMPORTED_MODULE_4__matcher_js__["a" ])(value);
|
6698 | return Object(__WEBPACK_IMPORTED_MODULE_5__property_js__["a" ])(value);
|
6699 | }
|
6700 |
|
6701 |
|
6702 | }),
|
6703 |
|
6704 | (function(module, __webpack_exports__, __webpack_require__) {
|
6705 |
|
6706 | "use strict";
|
6707 | __webpack_exports__["a"] = iteratee;
|
6708 | var __WEBPACK_IMPORTED_MODULE_0__underscore_js__ = __webpack_require__(25);
|
6709 | var __WEBPACK_IMPORTED_MODULE_1__baseIteratee_js__ = __webpack_require__(201);
|
6710 |
|
6711 |
|
6712 |
|
6713 |
|
6714 |
|
6715 |
|
6716 | function iteratee(value, context) {
|
6717 | return Object(__WEBPACK_IMPORTED_MODULE_1__baseIteratee_js__["a" ])(value, context, Infinity);
|
6718 | }
|
6719 | __WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" ].iteratee = iteratee;
|
6720 |
|
6721 |
|
6722 | }),
|
6723 |
|
6724 | (function(module, __webpack_exports__, __webpack_require__) {
|
6725 |
|
6726 | "use strict";
|
6727 | __webpack_exports__["a"] = noop;
|
6728 |
|
6729 | function noop(){}
|
6730 |
|
6731 |
|
6732 | }),
|
6733 |
|
6734 | (function(module, __webpack_exports__, __webpack_require__) {
|
6735 |
|
6736 | "use strict";
|
6737 | __webpack_exports__["a"] = random;
|
6738 |
|
6739 | function random(min, max) {
|
6740 | if (max == null) {
|
6741 | max = min;
|
6742 | min = 0;
|
6743 | }
|
6744 | return min + Math.floor(Math.random() * (max - min + 1));
|
6745 | }
|
6746 |
|
6747 |
|
6748 | }),
|
6749 |
|
6750 | (function(module, __webpack_exports__, __webpack_require__) {
|
6751 |
|
6752 | "use strict";
|
6753 | __webpack_exports__["a"] = createEscaper;
|
6754 | var __WEBPACK_IMPORTED_MODULE_0__keys_js__ = __webpack_require__(16);
|
6755 |
|
6756 |
|
6757 |
|
6758 |
|
6759 | function createEscaper(map) {
|
6760 | var escaper = function(match) {
|
6761 | return map[match];
|
6762 | };
|
6763 |
|
6764 | var source = '(?:' + Object(__WEBPACK_IMPORTED_MODULE_0__keys_js__["a" ])(map).join('|') + ')';
|
6765 | var testRegexp = RegExp(source);
|
6766 | var replaceRegexp = RegExp(source, 'g');
|
6767 | return function(string) {
|
6768 | string = string == null ? '' : '' + string;
|
6769 | return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string;
|
6770 | };
|
6771 | }
|
6772 |
|
6773 |
|
6774 | }),
|
6775 |
|
6776 | (function(module, __webpack_exports__, __webpack_require__) {
|
6777 |
|
6778 | "use strict";
|
6779 |
|
6780 | __webpack_exports__["a"] = ({
|
6781 | '&': '&',
|
6782 | '<': '<',
|
6783 | '>': '>',
|
6784 | '"': '"',
|
6785 | "'": ''',
|
6786 | '`': '`'
|
6787 | });
|
6788 |
|
6789 |
|
6790 | }),
|
6791 |
|
6792 | (function(module, __webpack_exports__, __webpack_require__) {
|
6793 |
|
6794 | "use strict";
|
6795 | var __WEBPACK_IMPORTED_MODULE_0__underscore_js__ = __webpack_require__(25);
|
6796 |
|
6797 |
|
6798 |
|
6799 |
|
6800 | __webpack_exports__["a"] = (__WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" ].templateSettings = {
|
6801 | evaluate: /<%([\s\S]+?)%>/g,
|
6802 | interpolate: /<%=([\s\S]+?)%>/g,
|
6803 | escape: /<%-([\s\S]+?)%>/g
|
6804 | });
|
6805 |
|
6806 |
|
6807 | }),
|
6808 |
|
6809 | (function(module, __webpack_exports__, __webpack_require__) {
|
6810 |
|
6811 | "use strict";
|
6812 | __webpack_exports__["a"] = executeBound;
|
6813 | var __WEBPACK_IMPORTED_MODULE_0__baseCreate_js__ = __webpack_require__(197);
|
6814 | var __WEBPACK_IMPORTED_MODULE_1__isObject_js__ = __webpack_require__(56);
|
6815 |
|
6816 |
|
6817 |
|
6818 |
|
6819 |
|
6820 |
|
6821 | function executeBound(sourceFunc, boundFunc, context, callingContext, args) {
|
6822 | if (!(callingContext instanceof boundFunc)) return sourceFunc.apply(context, args);
|
6823 | var self = Object(__WEBPACK_IMPORTED_MODULE_0__baseCreate_js__["a" ])(sourceFunc.prototype);
|
6824 | var result = sourceFunc.apply(self, args);
|
6825 | if (Object(__WEBPACK_IMPORTED_MODULE_1__isObject_js__["a" ])(result)) return result;
|
6826 | return self;
|
6827 | }
|
6828 |
|
6829 |
|
6830 | }),
|
6831 |
|
6832 | (function(module, __webpack_exports__, __webpack_require__) {
|
6833 |
|
6834 | "use strict";
|
6835 | var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(24);
|
6836 | var __WEBPACK_IMPORTED_MODULE_1__isFunction_js__ = __webpack_require__(28);
|
6837 | var __WEBPACK_IMPORTED_MODULE_2__executeBound_js__ = __webpack_require__(208);
|
6838 |
|
6839 |
|
6840 |
|
6841 |
|
6842 |
|
6843 |
|
6844 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" ])(function(func, context, args) {
|
6845 | if (!Object(__WEBPACK_IMPORTED_MODULE_1__isFunction_js__["a" ])(func)) throw new TypeError('Bind must be called on a function');
|
6846 | var bound = Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" ])(function(callArgs) {
|
6847 | return Object(__WEBPACK_IMPORTED_MODULE_2__executeBound_js__["a" ])(func, bound, context, this, args.concat(callArgs));
|
6848 | });
|
6849 | return bound;
|
6850 | }));
|
6851 |
|
6852 |
|
6853 | }),
|
6854 |
|
6855 | (function(module, __webpack_exports__, __webpack_require__) {
|
6856 |
|
6857 | "use strict";
|
6858 | var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(24);
|
6859 |
|
6860 |
|
6861 |
|
6862 |
|
6863 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" ])(function(func, wait, args) {
|
6864 | return setTimeout(function() {
|
6865 | return func.apply(null, args);
|
6866 | }, wait);
|
6867 | }));
|
6868 |
|
6869 |
|
6870 | }),
|
6871 |
|
6872 | (function(module, __webpack_exports__, __webpack_require__) {
|
6873 |
|
6874 | "use strict";
|
6875 | __webpack_exports__["a"] = before;
|
6876 |
|
6877 |
|
6878 | function before(times, func) {
|
6879 | var memo;
|
6880 | return function() {
|
6881 | if (--times > 0) {
|
6882 | memo = func.apply(this, arguments);
|
6883 | }
|
6884 | if (times <= 1) func = null;
|
6885 | return memo;
|
6886 | };
|
6887 | }
|
6888 |
|
6889 |
|
6890 | }),
|
6891 |
|
6892 | (function(module, __webpack_exports__, __webpack_require__) {
|
6893 |
|
6894 | "use strict";
|
6895 | __webpack_exports__["a"] = findKey;
|
6896 | var __WEBPACK_IMPORTED_MODULE_0__cb_js__ = __webpack_require__(21);
|
6897 | var __WEBPACK_IMPORTED_MODULE_1__keys_js__ = __webpack_require__(16);
|
6898 |
|
6899 |
|
6900 |
|
6901 |
|
6902 | function findKey(obj, predicate, context) {
|
6903 | predicate = Object(__WEBPACK_IMPORTED_MODULE_0__cb_js__["a" ])(predicate, context);
|
6904 | var _keys = Object(__WEBPACK_IMPORTED_MODULE_1__keys_js__["a" ])(obj), key;
|
6905 | for (var i = 0, length = _keys.length; i < length; i++) {
|
6906 | key = _keys[i];
|
6907 | if (predicate(obj[key], key, obj)) return key;
|
6908 | }
|
6909 | }
|
6910 |
|
6911 |
|
6912 | }),
|
6913 |
|
6914 | (function(module, __webpack_exports__, __webpack_require__) {
|
6915 |
|
6916 | "use strict";
|
6917 | __webpack_exports__["a"] = createPredicateIndexFinder;
|
6918 | var __WEBPACK_IMPORTED_MODULE_0__cb_js__ = __webpack_require__(21);
|
6919 | var __WEBPACK_IMPORTED_MODULE_1__getLength_js__ = __webpack_require__(29);
|
6920 |
|
6921 |
|
6922 |
|
6923 |
|
6924 | function createPredicateIndexFinder(dir) {
|
6925 | return function(array, predicate, context) {
|
6926 | predicate = Object(__WEBPACK_IMPORTED_MODULE_0__cb_js__["a" ])(predicate, context);
|
6927 | var length = Object(__WEBPACK_IMPORTED_MODULE_1__getLength_js__["a" ])(array);
|
6928 | var index = dir > 0 ? 0 : length - 1;
|
6929 | for (; index >= 0 && index < length; index += dir) {
|
6930 | if (predicate(array[index], index, array)) return index;
|
6931 | }
|
6932 | return -1;
|
6933 | };
|
6934 | }
|
6935 |
|
6936 |
|
6937 | }),
|
6938 |
|
6939 | (function(module, __webpack_exports__, __webpack_require__) {
|
6940 |
|
6941 | "use strict";
|
6942 | var __WEBPACK_IMPORTED_MODULE_0__createPredicateIndexFinder_js__ = __webpack_require__(213);
|
6943 |
|
6944 |
|
6945 |
|
6946 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createPredicateIndexFinder_js__["a" ])(-1));
|
6947 |
|
6948 |
|
6949 | }),
|
6950 |
|
6951 | (function(module, __webpack_exports__, __webpack_require__) {
|
6952 |
|
6953 | "use strict";
|
6954 | __webpack_exports__["a"] = sortedIndex;
|
6955 | var __WEBPACK_IMPORTED_MODULE_0__cb_js__ = __webpack_require__(21);
|
6956 | var __WEBPACK_IMPORTED_MODULE_1__getLength_js__ = __webpack_require__(29);
|
6957 |
|
6958 |
|
6959 |
|
6960 |
|
6961 |
|
6962 | function sortedIndex(array, obj, iteratee, context) {
|
6963 | iteratee = Object(__WEBPACK_IMPORTED_MODULE_0__cb_js__["a" ])(iteratee, context, 1);
|
6964 | var value = iteratee(obj);
|
6965 | var low = 0, high = Object(__WEBPACK_IMPORTED_MODULE_1__getLength_js__["a" ])(array);
|
6966 | while (low < high) {
|
6967 | var mid = Math.floor((low + high) / 2);
|
6968 | if (iteratee(array[mid]) < value) low = mid + 1; else high = mid;
|
6969 | }
|
6970 | return low;
|
6971 | }
|
6972 |
|
6973 |
|
6974 | }),
|
6975 |
|
6976 | (function(module, __webpack_exports__, __webpack_require__) {
|
6977 |
|
6978 | "use strict";
|
6979 | var __WEBPACK_IMPORTED_MODULE_0__sortedIndex_js__ = __webpack_require__(215);
|
6980 | var __WEBPACK_IMPORTED_MODULE_1__findIndex_js__ = __webpack_require__(146);
|
6981 | var __WEBPACK_IMPORTED_MODULE_2__createIndexFinder_js__ = __webpack_require__(217);
|
6982 |
|
6983 |
|
6984 |
|
6985 |
|
6986 |
|
6987 |
|
6988 |
|
6989 |
|
6990 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_2__createIndexFinder_js__["a" ])(1, __WEBPACK_IMPORTED_MODULE_1__findIndex_js__["a" ], __WEBPACK_IMPORTED_MODULE_0__sortedIndex_js__["a" ]));
|
6991 |
|
6992 |
|
6993 | }),
|
6994 |
|
6995 | (function(module, __webpack_exports__, __webpack_require__) {
|
6996 |
|
6997 | "use strict";
|
6998 | __webpack_exports__["a"] = createIndexFinder;
|
6999 | var __WEBPACK_IMPORTED_MODULE_0__getLength_js__ = __webpack_require__(29);
|
7000 | var __WEBPACK_IMPORTED_MODULE_1__setup_js__ = __webpack_require__(6);
|
7001 | var __WEBPACK_IMPORTED_MODULE_2__isNaN_js__ = __webpack_require__(186);
|
7002 |
|
7003 |
|
7004 |
|
7005 |
|
7006 |
|
7007 | function createIndexFinder(dir, predicateFind, sortedIndex) {
|
7008 | return function(array, item, idx) {
|
7009 | var i = 0, length = Object(__WEBPACK_IMPORTED_MODULE_0__getLength_js__["a" ])(array);
|
7010 | if (typeof idx == 'number') {
|
7011 | if (dir > 0) {
|
7012 | i = idx >= 0 ? idx : Math.max(idx + length, i);
|
7013 | } else {
|
7014 | length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;
|
7015 | }
|
7016 | } else if (sortedIndex && idx && length) {
|
7017 | idx = sortedIndex(array, item);
|
7018 | return array[idx] === item ? idx : -1;
|
7019 | }
|
7020 | if (item !== item) {
|
7021 | idx = predicateFind(__WEBPACK_IMPORTED_MODULE_1__setup_js__["q" ].call(array, i, length), __WEBPACK_IMPORTED_MODULE_2__isNaN_js__["a" ]);
|
7022 | return idx >= 0 ? idx + i : -1;
|
7023 | }
|
7024 | for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {
|
7025 | if (array[idx] === item) return idx;
|
7026 | }
|
7027 | return -1;
|
7028 | };
|
7029 | }
|
7030 |
|
7031 |
|
7032 | }),
|
7033 |
|
7034 | (function(module, __webpack_exports__, __webpack_require__) {
|
7035 |
|
7036 | "use strict";
|
7037 | __webpack_exports__["a"] = find;
|
7038 | var __WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__ = __webpack_require__(26);
|
7039 | var __WEBPACK_IMPORTED_MODULE_1__findIndex_js__ = __webpack_require__(146);
|
7040 | var __WEBPACK_IMPORTED_MODULE_2__findKey_js__ = __webpack_require__(212);
|
7041 |
|
7042 |
|
7043 |
|
7044 |
|
7045 |
|
7046 | function find(obj, predicate, context) {
|
7047 | var keyFinder = Object(__WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__["a" ])(obj) ? __WEBPACK_IMPORTED_MODULE_1__findIndex_js__["a" ] : __WEBPACK_IMPORTED_MODULE_2__findKey_js__["a" ];
|
7048 | var key = keyFinder(obj, predicate, context);
|
7049 | if (key !== void 0 && key !== -1) return obj[key];
|
7050 | }
|
7051 |
|
7052 |
|
7053 | }),
|
7054 |
|
7055 | (function(module, __webpack_exports__, __webpack_require__) {
|
7056 |
|
7057 | "use strict";
|
7058 | __webpack_exports__["a"] = createReduce;
|
7059 | var __WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__ = __webpack_require__(26);
|
7060 | var __WEBPACK_IMPORTED_MODULE_1__keys_js__ = __webpack_require__(16);
|
7061 | var __WEBPACK_IMPORTED_MODULE_2__optimizeCb_js__ = __webpack_require__(87);
|
7062 |
|
7063 |
|
7064 |
|
7065 |
|
7066 |
|
7067 | function createReduce(dir) {
|
7068 |
|
7069 |
|
7070 | var reducer = function(obj, iteratee, memo, initial) {
|
7071 | var _keys = !Object(__WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__["a" ])(obj) && Object(__WEBPACK_IMPORTED_MODULE_1__keys_js__["a" ])(obj),
|
7072 | length = (_keys || obj).length,
|
7073 | index = dir > 0 ? 0 : length - 1;
|
7074 | if (!initial) {
|
7075 | memo = obj[_keys ? _keys[index] : index];
|
7076 | index += dir;
|
7077 | }
|
7078 | for (; index >= 0 && index < length; index += dir) {
|
7079 | var currentKey = _keys ? _keys[index] : index;
|
7080 | memo = iteratee(memo, obj[currentKey], currentKey, obj);
|
7081 | }
|
7082 | return memo;
|
7083 | };
|
7084 |
|
7085 | return function(obj, iteratee, memo, context) {
|
7086 | var initial = arguments.length >= 3;
|
7087 | return reducer(obj, Object(__WEBPACK_IMPORTED_MODULE_2__optimizeCb_js__["a" ])(iteratee, context, 4), memo, initial);
|
7088 | };
|
7089 | }
|
7090 |
|
7091 |
|
7092 | }),
|
7093 |
|
7094 | (function(module, __webpack_exports__, __webpack_require__) {
|
7095 |
|
7096 | "use strict";
|
7097 | __webpack_exports__["a"] = max;
|
7098 | var __WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__ = __webpack_require__(26);
|
7099 | var __WEBPACK_IMPORTED_MODULE_1__values_js__ = __webpack_require__(66);
|
7100 | var __WEBPACK_IMPORTED_MODULE_2__cb_js__ = __webpack_require__(21);
|
7101 | var __WEBPACK_IMPORTED_MODULE_3__each_js__ = __webpack_require__(58);
|
7102 |
|
7103 |
|
7104 |
|
7105 |
|
7106 |
|
7107 |
|
7108 | function max(obj, iteratee, context) {
|
7109 | var result = -Infinity, lastComputed = -Infinity,
|
7110 | value, computed;
|
7111 | if (iteratee == null || typeof iteratee == 'number' && typeof obj[0] != 'object' && obj != null) {
|
7112 | obj = Object(__WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__["a" ])(obj) ? obj : Object(__WEBPACK_IMPORTED_MODULE_1__values_js__["a" ])(obj);
|
7113 | for (var i = 0, length = obj.length; i < length; i++) {
|
7114 | value = obj[i];
|
7115 | if (value != null && value > result) {
|
7116 | result = value;
|
7117 | }
|
7118 | }
|
7119 | } else {
|
7120 | iteratee = Object(__WEBPACK_IMPORTED_MODULE_2__cb_js__["a" ])(iteratee, context);
|
7121 | Object(__WEBPACK_IMPORTED_MODULE_3__each_js__["a" ])(obj, function(v, index, list) {
|
7122 | computed = iteratee(v, index, list);
|
7123 | if (computed > lastComputed || computed === -Infinity && result === -Infinity) {
|
7124 | result = v;
|
7125 | lastComputed = computed;
|
7126 | }
|
7127 | });
|
7128 | }
|
7129 | return result;
|
7130 | }
|
7131 |
|
7132 |
|
7133 | }),
|
7134 |
|
7135 | (function(module, __webpack_exports__, __webpack_require__) {
|
7136 |
|
7137 | "use strict";
|
7138 | __webpack_exports__["a"] = sample;
|
7139 | var __WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__ = __webpack_require__(26);
|
7140 | var __WEBPACK_IMPORTED_MODULE_1__clone_js__ = __webpack_require__(198);
|
7141 | var __WEBPACK_IMPORTED_MODULE_2__values_js__ = __webpack_require__(66);
|
7142 | var __WEBPACK_IMPORTED_MODULE_3__getLength_js__ = __webpack_require__(29);
|
7143 | var __WEBPACK_IMPORTED_MODULE_4__random_js__ = __webpack_require__(204);
|
7144 |
|
7145 |
|
7146 |
|
7147 |
|
7148 |
|
7149 |
|
7150 |
|
7151 |
|
7152 |
|
7153 |
|
7154 | function sample(obj, n, guard) {
|
7155 | if (n == null || guard) {
|
7156 | if (!Object(__WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__["a" ])(obj)) obj = Object(__WEBPACK_IMPORTED_MODULE_2__values_js__["a" ])(obj);
|
7157 | return obj[Object(__WEBPACK_IMPORTED_MODULE_4__random_js__["a" ])(obj.length - 1)];
|
7158 | }
|
7159 | var sample = Object(__WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__["a" ])(obj) ? Object(__WEBPACK_IMPORTED_MODULE_1__clone_js__["a" ])(obj) : Object(__WEBPACK_IMPORTED_MODULE_2__values_js__["a" ])(obj);
|
7160 | var length = Object(__WEBPACK_IMPORTED_MODULE_3__getLength_js__["a" ])(sample);
|
7161 | n = Math.max(Math.min(n, length), 0);
|
7162 | var last = length - 1;
|
7163 | for (var index = 0; index < n; index++) {
|
7164 | var rand = Object(__WEBPACK_IMPORTED_MODULE_4__random_js__["a" ])(index, last);
|
7165 | var temp = sample[index];
|
7166 | sample[index] = sample[rand];
|
7167 | sample[rand] = temp;
|
7168 | }
|
7169 | return sample.slice(0, n);
|
7170 | }
|
7171 |
|
7172 |
|
7173 | }),
|
7174 |
|
7175 | (function(module, __webpack_exports__, __webpack_require__) {
|
7176 |
|
7177 | "use strict";
|
7178 | var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(24);
|
7179 | var __WEBPACK_IMPORTED_MODULE_1__isFunction_js__ = __webpack_require__(28);
|
7180 | var __WEBPACK_IMPORTED_MODULE_2__optimizeCb_js__ = __webpack_require__(87);
|
7181 | var __WEBPACK_IMPORTED_MODULE_3__allKeys_js__ = __webpack_require__(85);
|
7182 | var __WEBPACK_IMPORTED_MODULE_4__keyInObj_js__ = __webpack_require__(377);
|
7183 | var __WEBPACK_IMPORTED_MODULE_5__flatten_js__ = __webpack_require__(67);
|
7184 |
|
7185 |
|
7186 |
|
7187 |
|
7188 |
|
7189 |
|
7190 |
|
7191 |
|
7192 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" ])(function(obj, keys) {
|
7193 | var result = {}, iteratee = keys[0];
|
7194 | if (obj == null) return result;
|
7195 | if (Object(__WEBPACK_IMPORTED_MODULE_1__isFunction_js__["a" ])(iteratee)) {
|
7196 | if (keys.length > 1) iteratee = Object(__WEBPACK_IMPORTED_MODULE_2__optimizeCb_js__["a" ])(iteratee, keys[1]);
|
7197 | keys = Object(__WEBPACK_IMPORTED_MODULE_3__allKeys_js__["a" ])(obj);
|
7198 | } else {
|
7199 | iteratee = __WEBPACK_IMPORTED_MODULE_4__keyInObj_js__["a" ];
|
7200 | keys = Object(__WEBPACK_IMPORTED_MODULE_5__flatten_js__["a" ])(keys, false, false);
|
7201 | obj = Object(obj);
|
7202 | }
|
7203 | for (var i = 0, length = keys.length; i < length; i++) {
|
7204 | var key = keys[i];
|
7205 | var value = obj[key];
|
7206 | if (iteratee(value, key, obj)) result[key] = value;
|
7207 | }
|
7208 | return result;
|
7209 | }));
|
7210 |
|
7211 |
|
7212 | }),
|
7213 |
|
7214 | (function(module, __webpack_exports__, __webpack_require__) {
|
7215 |
|
7216 | "use strict";
|
7217 | __webpack_exports__["a"] = initial;
|
7218 | var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(6);
|
7219 |
|
7220 |
|
7221 |
|
7222 |
|
7223 |
|
7224 | function initial(array, n, guard) {
|
7225 | return __WEBPACK_IMPORTED_MODULE_0__setup_js__["q" ].call(array, 0, Math.max(0, array.length - (n == null || guard ? 1 : n)));
|
7226 | }
|
7227 |
|
7228 |
|
7229 | }),
|
7230 |
|
7231 | (function(module, __webpack_exports__, __webpack_require__) {
|
7232 |
|
7233 | "use strict";
|
7234 | __webpack_exports__["a"] = rest;
|
7235 | var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(6);
|
7236 |
|
7237 |
|
7238 |
|
7239 |
|
7240 |
|
7241 | function rest(array, n, guard) {
|
7242 | return __WEBPACK_IMPORTED_MODULE_0__setup_js__["q" ].call(array, n == null || guard ? 1 : n);
|
7243 | }
|
7244 |
|
7245 |
|
7246 | }),
|
7247 |
|
7248 | (function(module, __webpack_exports__, __webpack_require__) {
|
7249 |
|
7250 | "use strict";
|
7251 | var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(24);
|
7252 | var __WEBPACK_IMPORTED_MODULE_1__flatten_js__ = __webpack_require__(67);
|
7253 | var __WEBPACK_IMPORTED_MODULE_2__filter_js__ = __webpack_require__(88);
|
7254 | var __WEBPACK_IMPORTED_MODULE_3__contains_js__ = __webpack_require__(89);
|
7255 |
|
7256 |
|
7257 |
|
7258 |
|
7259 |
|
7260 |
|
7261 |
|
7262 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" ])(function(array, rest) {
|
7263 | rest = Object(__WEBPACK_IMPORTED_MODULE_1__flatten_js__["a" ])(rest, true, true);
|
7264 | return Object(__WEBPACK_IMPORTED_MODULE_2__filter_js__["a" ])(array, function(value){
|
7265 | return !Object(__WEBPACK_IMPORTED_MODULE_3__contains_js__["a" ])(rest, value);
|
7266 | });
|
7267 | }));
|
7268 |
|
7269 |
|
7270 | }),
|
7271 |
|
7272 | (function(module, __webpack_exports__, __webpack_require__) {
|
7273 |
|
7274 | "use strict";
|
7275 | __webpack_exports__["a"] = uniq;
|
7276 | var __WEBPACK_IMPORTED_MODULE_0__isBoolean_js__ = __webpack_require__(182);
|
7277 | var __WEBPACK_IMPORTED_MODULE_1__cb_js__ = __webpack_require__(21);
|
7278 | var __WEBPACK_IMPORTED_MODULE_2__getLength_js__ = __webpack_require__(29);
|
7279 | var __WEBPACK_IMPORTED_MODULE_3__contains_js__ = __webpack_require__(89);
|
7280 |
|
7281 |
|
7282 |
|
7283 |
|
7284 |
|
7285 |
|
7286 |
|
7287 |
|
7288 |
|
7289 |
|
7290 | function uniq(array, isSorted, iteratee, context) {
|
7291 | if (!Object(__WEBPACK_IMPORTED_MODULE_0__isBoolean_js__["a" ])(isSorted)) {
|
7292 | context = iteratee;
|
7293 | iteratee = isSorted;
|
7294 | isSorted = false;
|
7295 | }
|
7296 | if (iteratee != null) iteratee = Object(__WEBPACK_IMPORTED_MODULE_1__cb_js__["a" ])(iteratee, context);
|
7297 | var result = [];
|
7298 | var seen = [];
|
7299 | for (var i = 0, length = Object(__WEBPACK_IMPORTED_MODULE_2__getLength_js__["a" ])(array); i < length; i++) {
|
7300 | var value = array[i],
|
7301 | computed = iteratee ? iteratee(value, i, array) : value;
|
7302 | if (isSorted && !iteratee) {
|
7303 | if (!i || seen !== computed) result.push(value);
|
7304 | seen = computed;
|
7305 | } else if (iteratee) {
|
7306 | if (!Object(__WEBPACK_IMPORTED_MODULE_3__contains_js__["a" ])(seen, computed)) {
|
7307 | seen.push(computed);
|
7308 | result.push(value);
|
7309 | }
|
7310 | } else if (!Object(__WEBPACK_IMPORTED_MODULE_3__contains_js__["a" ])(result, value)) {
|
7311 | result.push(value);
|
7312 | }
|
7313 | }
|
7314 | return result;
|
7315 | }
|
7316 |
|
7317 |
|
7318 | }),
|
7319 |
|
7320 | (function(module, __webpack_exports__, __webpack_require__) {
|
7321 |
|
7322 | "use strict";
|
7323 | __webpack_exports__["a"] = unzip;
|
7324 | var __WEBPACK_IMPORTED_MODULE_0__max_js__ = __webpack_require__(220);
|
7325 | var __WEBPACK_IMPORTED_MODULE_1__getLength_js__ = __webpack_require__(29);
|
7326 | var __WEBPACK_IMPORTED_MODULE_2__pluck_js__ = __webpack_require__(147);
|
7327 |
|
7328 |
|
7329 |
|
7330 |
|
7331 |
|
7332 |
|
7333 | function unzip(array) {
|
7334 | var length = array && Object(__WEBPACK_IMPORTED_MODULE_0__max_js__["a" ])(array, __WEBPACK_IMPORTED_MODULE_1__getLength_js__["a" ]).length || 0;
|
7335 | var result = Array(length);
|
7336 |
|
7337 | for (var index = 0; index < length; index++) {
|
7338 | result[index] = Object(__WEBPACK_IMPORTED_MODULE_2__pluck_js__["a" ])(array, index);
|
7339 | }
|
7340 | return result;
|
7341 | }
|
7342 |
|
7343 |
|
7344 | }),
|
7345 |
|
7346 | (function(module, __webpack_exports__, __webpack_require__) {
|
7347 |
|
7348 | "use strict";
|
7349 | __webpack_exports__["a"] = chainResult;
|
7350 | var __WEBPACK_IMPORTED_MODULE_0__underscore_js__ = __webpack_require__(25);
|
7351 |
|
7352 |
|
7353 |
|
7354 | function chainResult(instance, obj) {
|
7355 | return instance._chain ? Object(__WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" ])(obj).chain() : obj;
|
7356 | }
|
7357 |
|
7358 |
|
7359 | }),
|
7360 |
|
7361 | (function(module, exports, __webpack_require__) {
|
7362 |
|
7363 | "use strict";
|
7364 |
|
7365 | var $ = __webpack_require__(0);
|
7366 | var fails = __webpack_require__(2);
|
7367 | var isArray = __webpack_require__(90);
|
7368 | var isObject = __webpack_require__(11);
|
7369 | var toObject = __webpack_require__(34);
|
7370 | var lengthOfArrayLike = __webpack_require__(41);
|
7371 | var doesNotExceedSafeInteger = __webpack_require__(395);
|
7372 | var createProperty = __webpack_require__(91);
|
7373 | var arraySpeciesCreate = __webpack_require__(230);
|
7374 | var arrayMethodHasSpeciesSupport = __webpack_require__(114);
|
7375 | var wellKnownSymbol = __webpack_require__(9);
|
7376 | var V8_VERSION = __webpack_require__(77);
|
7377 |
|
7378 | var IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable');
|
7379 |
|
7380 |
|
7381 |
|
7382 |
|
7383 | var IS_CONCAT_SPREADABLE_SUPPORT = V8_VERSION >= 51 || !fails(function () {
|
7384 | var array = [];
|
7385 | array[IS_CONCAT_SPREADABLE] = false;
|
7386 | return array.concat()[0] !== array;
|
7387 | });
|
7388 |
|
7389 | var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('concat');
|
7390 |
|
7391 | var isConcatSpreadable = function (O) {
|
7392 | if (!isObject(O)) return false;
|
7393 | var spreadable = O[IS_CONCAT_SPREADABLE];
|
7394 | return spreadable !== undefined ? !!spreadable : isArray(O);
|
7395 | };
|
7396 |
|
7397 | var FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT;
|
7398 |
|
7399 |
|
7400 |
|
7401 |
|
7402 | $({ target: 'Array', proto: true, arity: 1, forced: FORCED }, {
|
7403 |
|
7404 | concat: function concat(arg) {
|
7405 | var O = toObject(this);
|
7406 | var A = arraySpeciesCreate(O, 0);
|
7407 | var n = 0;
|
7408 | var i, k, length, len, E;
|
7409 | for (i = -1, length = arguments.length; i < length; i++) {
|
7410 | E = i === -1 ? O : arguments[i];
|
7411 | if (isConcatSpreadable(E)) {
|
7412 | len = lengthOfArrayLike(E);
|
7413 | doesNotExceedSafeInteger(n + len);
|
7414 | for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]);
|
7415 | } else {
|
7416 | doesNotExceedSafeInteger(n + 1);
|
7417 | createProperty(A, n++, E);
|
7418 | }
|
7419 | }
|
7420 | A.length = n;
|
7421 | return A;
|
7422 | }
|
7423 | });
|
7424 |
|
7425 |
|
7426 | }),
|
7427 |
|
7428 | (function(module, exports, __webpack_require__) {
|
7429 |
|
7430 | var arraySpeciesConstructor = __webpack_require__(396);
|
7431 |
|
7432 |
|
7433 |
|
7434 | module.exports = function (originalArray, length) {
|
7435 | return new (arraySpeciesConstructor(originalArray))(length === 0 ? 0 : length);
|
7436 | };
|
7437 |
|
7438 |
|
7439 | }),
|
7440 |
|
7441 | (function(module, exports, __webpack_require__) {
|
7442 |
|
7443 | var $ = __webpack_require__(0);
|
7444 | var getBuiltIn = __webpack_require__(18);
|
7445 | var apply = __webpack_require__(75);
|
7446 | var call = __webpack_require__(15);
|
7447 | var uncurryThis = __webpack_require__(4);
|
7448 | var fails = __webpack_require__(2);
|
7449 | var isArray = __webpack_require__(90);
|
7450 | var isCallable = __webpack_require__(8);
|
7451 | var isObject = __webpack_require__(11);
|
7452 | var isSymbol = __webpack_require__(97);
|
7453 | var arraySlice = __webpack_require__(110);
|
7454 | var NATIVE_SYMBOL = __webpack_require__(64);
|
7455 |
|
7456 | var $stringify = getBuiltIn('JSON', 'stringify');
|
7457 | var exec = uncurryThis(/./.exec);
|
7458 | var charAt = uncurryThis(''.charAt);
|
7459 | var charCodeAt = uncurryThis(''.charCodeAt);
|
7460 | var replace = uncurryThis(''.replace);
|
7461 | var numberToString = uncurryThis(1.0.toString);
|
7462 |
|
7463 | var tester = /[\uD800-\uDFFF]/g;
|
7464 | var low = /^[\uD800-\uDBFF]$/;
|
7465 | var hi = /^[\uDC00-\uDFFF]$/;
|
7466 |
|
7467 | var WRONG_SYMBOLS_CONVERSION = !NATIVE_SYMBOL || fails(function () {
|
7468 | var symbol = getBuiltIn('Symbol')();
|
7469 |
|
7470 | return $stringify([symbol]) != '[null]'
|
7471 |
|
7472 | || $stringify({ a: symbol }) != '{}'
|
7473 |
|
7474 | || $stringify(Object(symbol)) != '{}';
|
7475 | });
|
7476 |
|
7477 |
|
7478 | var ILL_FORMED_UNICODE = fails(function () {
|
7479 | return $stringify('\uDF06\uD834') !== '"\\udf06\\ud834"'
|
7480 | || $stringify('\uDEAD') !== '"\\udead"';
|
7481 | });
|
7482 |
|
7483 | var stringifyWithSymbolsFix = function (it, replacer) {
|
7484 | var args = arraySlice(arguments);
|
7485 | var $replacer = replacer;
|
7486 | if (!isObject(replacer) && it === undefined || isSymbol(it)) return;
|
7487 | if (!isArray(replacer)) replacer = function (key, value) {
|
7488 | if (isCallable($replacer)) value = call($replacer, this, key, value);
|
7489 | if (!isSymbol(value)) return value;
|
7490 | };
|
7491 | args[1] = replacer;
|
7492 | return apply($stringify, null, args);
|
7493 | };
|
7494 |
|
7495 | var fixIllFormed = function (match, offset, string) {
|
7496 | var prev = charAt(string, offset - 1);
|
7497 | var next = charAt(string, offset + 1);
|
7498 | if ((exec(low, match) && !exec(hi, next)) || (exec(hi, match) && !exec(low, prev))) {
|
7499 | return '\\u' + numberToString(charCodeAt(match, 0), 16);
|
7500 | } return match;
|
7501 | };
|
7502 |
|
7503 | if ($stringify) {
|
7504 |
|
7505 |
|
7506 | $({ target: 'JSON', stat: true, arity: 3, forced: WRONG_SYMBOLS_CONVERSION || ILL_FORMED_UNICODE }, {
|
7507 |
|
7508 | stringify: function stringify(it, replacer, space) {
|
7509 | var args = arraySlice(arguments);
|
7510 | var result = apply(WRONG_SYMBOLS_CONVERSION ? stringifyWithSymbolsFix : $stringify, null, args);
|
7511 | return ILL_FORMED_UNICODE && typeof result == 'string' ? replace(result, tester, fixIllFormed) : result;
|
7512 | }
|
7513 | });
|
7514 | }
|
7515 |
|
7516 |
|
7517 | }),
|
7518 |
|
7519 | (function(module, exports, __webpack_require__) {
|
7520 |
|
7521 | "use strict";
|
7522 |
|
7523 | var fails = __webpack_require__(2);
|
7524 |
|
7525 | module.exports = function (METHOD_NAME, argument) {
|
7526 | var method = [][METHOD_NAME];
|
7527 | return !!method && fails(function () {
|
7528 |
|
7529 | method.call(null, argument || function () { return 1; }, 1);
|
7530 | });
|
7531 | };
|
7532 |
|
7533 |
|
7534 | }),
|
7535 |
|
7536 | (function(module, exports, __webpack_require__) {
|
7537 |
|
7538 | var rng = __webpack_require__(413);
|
7539 | var bytesToUuid = __webpack_require__(414);
|
7540 |
|
7541 | function v4(options, buf, offset) {
|
7542 | var i = buf && offset || 0;
|
7543 |
|
7544 | if (typeof(options) == 'string') {
|
7545 | buf = options === 'binary' ? new Array(16) : null;
|
7546 | options = null;
|
7547 | }
|
7548 | options = options || {};
|
7549 |
|
7550 | var rnds = options.random || (options.rng || rng)();
|
7551 |
|
7552 |
|
7553 | rnds[6] = (rnds[6] & 0x0f) | 0x40;
|
7554 | rnds[8] = (rnds[8] & 0x3f) | 0x80;
|
7555 |
|
7556 |
|
7557 | if (buf) {
|
7558 | for (var ii = 0; ii < 16; ++ii) {
|
7559 | buf[i + ii] = rnds[ii];
|
7560 | }
|
7561 | }
|
7562 |
|
7563 | return buf || bytesToUuid(rnds);
|
7564 | }
|
7565 |
|
7566 | module.exports = v4;
|
7567 |
|
7568 |
|
7569 | }),
|
7570 |
|
7571 | (function(module, exports, __webpack_require__) {
|
7572 |
|
7573 | var parent = __webpack_require__(417);
|
7574 |
|
7575 | module.exports = parent;
|
7576 |
|
7577 |
|
7578 | }),
|
7579 |
|
7580 | (function(module, exports, __webpack_require__) {
|
7581 |
|
7582 | "use strict";
|
7583 |
|
7584 |
|
7585 | module.exports = '4.15.2';
|
7586 |
|
7587 | }),
|
7588 |
|
7589 | (function(module, exports, __webpack_require__) {
|
7590 |
|
7591 | "use strict";
|
7592 |
|
7593 |
|
7594 | var has = Object.prototype.hasOwnProperty
|
7595 | , prefix = '~';
|
7596 |
|
7597 |
|
7598 |
|
7599 |
|
7600 |
|
7601 |
|
7602 |
|
7603 |
|
7604 | function Events() {}
|
7605 |
|
7606 |
|
7607 |
|
7608 |
|
7609 |
|
7610 |
|
7611 |
|
7612 |
|
7613 | if (Object.create) {
|
7614 | Events.prototype = Object.create(null);
|
7615 |
|
7616 |
|
7617 |
|
7618 |
|
7619 |
|
7620 | if (!new Events().__proto__) prefix = false;
|
7621 | }
|
7622 |
|
7623 |
|
7624 |
|
7625 |
|
7626 |
|
7627 |
|
7628 |
|
7629 |
|
7630 |
|
7631 |
|
7632 | function EE(fn, context, once) {
|
7633 | this.fn = fn;
|
7634 | this.context = context;
|
7635 | this.once = once || false;
|
7636 | }
|
7637 |
|
7638 |
|
7639 |
|
7640 |
|
7641 |
|
7642 |
|
7643 |
|
7644 |
|
7645 | function EventEmitter() {
|
7646 | this._events = new Events();
|
7647 | this._eventsCount = 0;
|
7648 | }
|
7649 |
|
7650 |
|
7651 |
|
7652 |
|
7653 |
|
7654 |
|
7655 |
|
7656 |
|
7657 | EventEmitter.prototype.eventNames = function eventNames() {
|
7658 | var names = []
|
7659 | , events
|
7660 | , name;
|
7661 |
|
7662 | if (this._eventsCount === 0) return names;
|
7663 |
|
7664 | for (name in (events = this._events)) {
|
7665 | if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);
|
7666 | }
|
7667 |
|
7668 | if (Object.getOwnPropertySymbols) {
|
7669 | return names.concat(Object.getOwnPropertySymbols(events));
|
7670 | }
|
7671 |
|
7672 | return names;
|
7673 | };
|
7674 |
|
7675 |
|
7676 |
|
7677 |
|
7678 |
|
7679 |
|
7680 |
|
7681 |
|
7682 |
|
7683 | EventEmitter.prototype.listeners = function listeners(event, exists) {
|
7684 | var evt = prefix ? prefix + event : event
|
7685 | , available = this._events[evt];
|
7686 |
|
7687 | if (exists) return !!available;
|
7688 | if (!available) return [];
|
7689 | if (available.fn) return [available.fn];
|
7690 |
|
7691 | for (var i = 0, l = available.length, ee = new Array(l); i < l; i++) {
|
7692 | ee[i] = available[i].fn;
|
7693 | }
|
7694 |
|
7695 | return ee;
|
7696 | };
|
7697 |
|
7698 |
|
7699 |
|
7700 |
|
7701 |
|
7702 |
|
7703 |
|
7704 |
|
7705 | EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {
|
7706 | var evt = prefix ? prefix + event : event;
|
7707 |
|
7708 | if (!this._events[evt]) return false;
|
7709 |
|
7710 | var listeners = this._events[evt]
|
7711 | , len = arguments.length
|
7712 | , args
|
7713 | , i;
|
7714 |
|
7715 | if (listeners.fn) {
|
7716 | if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);
|
7717 |
|
7718 | switch (len) {
|
7719 | case 1: return listeners.fn.call(listeners.context), true;
|
7720 | case 2: return listeners.fn.call(listeners.context, a1), true;
|
7721 | case 3: return listeners.fn.call(listeners.context, a1, a2), true;
|
7722 | case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;
|
7723 | case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;
|
7724 | case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;
|
7725 | }
|
7726 |
|
7727 | for (i = 1, args = new Array(len -1); i < len; i++) {
|
7728 | args[i - 1] = arguments[i];
|
7729 | }
|
7730 |
|
7731 | listeners.fn.apply(listeners.context, args);
|
7732 | } else {
|
7733 | var length = listeners.length
|
7734 | , j;
|
7735 |
|
7736 | for (i = 0; i < length; i++) {
|
7737 | if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);
|
7738 |
|
7739 | switch (len) {
|
7740 | case 1: listeners[i].fn.call(listeners[i].context); break;
|
7741 | case 2: listeners[i].fn.call(listeners[i].context, a1); break;
|
7742 | case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;
|
7743 | case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break;
|
7744 | default:
|
7745 | if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {
|
7746 | args[j - 1] = arguments[j];
|
7747 | }
|
7748 |
|
7749 | listeners[i].fn.apply(listeners[i].context, args);
|
7750 | }
|
7751 | }
|
7752 | }
|
7753 |
|
7754 | return true;
|
7755 | };
|
7756 |
|
7757 |
|
7758 |
|
7759 |
|
7760 |
|
7761 |
|
7762 |
|
7763 |
|
7764 |
|
7765 |
|
7766 | EventEmitter.prototype.on = function on(event, fn, context) {
|
7767 | var listener = new EE(fn, context || this)
|
7768 | , evt = prefix ? prefix + event : event;
|
7769 |
|
7770 | if (!this._events[evt]) this._events[evt] = listener, this._eventsCount++;
|
7771 | else if (!this._events[evt].fn) this._events[evt].push(listener);
|
7772 | else this._events[evt] = [this._events[evt], listener];
|
7773 |
|
7774 | return this;
|
7775 | };
|
7776 |
|
7777 |
|
7778 |
|
7779 |
|
7780 |
|
7781 |
|
7782 |
|
7783 |
|
7784 |
|
7785 |
|
7786 | EventEmitter.prototype.once = function once(event, fn, context) {
|
7787 | var listener = new EE(fn, context || this, true)
|
7788 | , evt = prefix ? prefix + event : event;
|
7789 |
|
7790 | if (!this._events[evt]) this._events[evt] = listener, this._eventsCount++;
|
7791 | else if (!this._events[evt].fn) this._events[evt].push(listener);
|
7792 | else this._events[evt] = [this._events[evt], listener];
|
7793 |
|
7794 | return this;
|
7795 | };
|
7796 |
|
7797 |
|
7798 |
|
7799 |
|
7800 |
|
7801 |
|
7802 |
|
7803 |
|
7804 |
|
7805 |
|
7806 |
|
7807 | EventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {
|
7808 | var evt = prefix ? prefix + event : event;
|
7809 |
|
7810 | if (!this._events[evt]) return this;
|
7811 | if (!fn) {
|
7812 | if (--this._eventsCount === 0) this._events = new Events();
|
7813 | else delete this._events[evt];
|
7814 | return this;
|
7815 | }
|
7816 |
|
7817 | var listeners = this._events[evt];
|
7818 |
|
7819 | if (listeners.fn) {
|
7820 | if (
|
7821 | listeners.fn === fn
|
7822 | && (!once || listeners.once)
|
7823 | && (!context || listeners.context === context)
|
7824 | ) {
|
7825 | if (--this._eventsCount === 0) this._events = new Events();
|
7826 | else delete this._events[evt];
|
7827 | }
|
7828 | } else {
|
7829 | for (var i = 0, events = [], length = listeners.length; i < length; i++) {
|
7830 | if (
|
7831 | listeners[i].fn !== fn
|
7832 | || (once && !listeners[i].once)
|
7833 | || (context && listeners[i].context !== context)
|
7834 | ) {
|
7835 | events.push(listeners[i]);
|
7836 | }
|
7837 | }
|
7838 |
|
7839 |
|
7840 |
|
7841 |
|
7842 | if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;
|
7843 | else if (--this._eventsCount === 0) this._events = new Events();
|
7844 | else delete this._events[evt];
|
7845 | }
|
7846 |
|
7847 | return this;
|
7848 | };
|
7849 |
|
7850 |
|
7851 |
|
7852 |
|
7853 |
|
7854 |
|
7855 |
|
7856 |
|
7857 | EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {
|
7858 | var evt;
|
7859 |
|
7860 | if (event) {
|
7861 | evt = prefix ? prefix + event : event;
|
7862 | if (this._events[evt]) {
|
7863 | if (--this._eventsCount === 0) this._events = new Events();
|
7864 | else delete this._events[evt];
|
7865 | }
|
7866 | } else {
|
7867 | this._events = new Events();
|
7868 | this._eventsCount = 0;
|
7869 | }
|
7870 |
|
7871 | return this;
|
7872 | };
|
7873 |
|
7874 |
|
7875 |
|
7876 |
|
7877 | EventEmitter.prototype.off = EventEmitter.prototype.removeListener;
|
7878 | EventEmitter.prototype.addListener = EventEmitter.prototype.on;
|
7879 |
|
7880 |
|
7881 |
|
7882 |
|
7883 | EventEmitter.prototype.setMaxListeners = function setMaxListeners() {
|
7884 | return this;
|
7885 | };
|
7886 |
|
7887 |
|
7888 |
|
7889 |
|
7890 | EventEmitter.prefixed = prefix;
|
7891 |
|
7892 |
|
7893 |
|
7894 |
|
7895 | EventEmitter.EventEmitter = EventEmitter;
|
7896 |
|
7897 |
|
7898 |
|
7899 |
|
7900 | if (true) {
|
7901 | module.exports = EventEmitter;
|
7902 | }
|
7903 |
|
7904 |
|
7905 | }),
|
7906 |
|
7907 | (function(module, exports, __webpack_require__) {
|
7908 |
|
7909 | "use strict";
|
7910 |
|
7911 |
|
7912 | var _interopRequireDefault = __webpack_require__(1);
|
7913 |
|
7914 | var _promise = _interopRequireDefault(__webpack_require__(12));
|
7915 |
|
7916 | var _require = __webpack_require__(72),
|
7917 | getAdapter = _require.getAdapter;
|
7918 |
|
7919 | var syncApiNames = ['getItem', 'setItem', 'removeItem', 'clear'];
|
7920 | var localStorage = {
|
7921 | get async() {
|
7922 | return getAdapter('storage').async;
|
7923 | }
|
7924 |
|
7925 | };
|
7926 |
|
7927 | syncApiNames.forEach(function (apiName) {
|
7928 | localStorage[apiName + 'Async'] = function () {
|
7929 | var storage = getAdapter('storage');
|
7930 | return _promise.default.resolve(storage[apiName].apply(storage, arguments));
|
7931 | };
|
7932 |
|
7933 | localStorage[apiName] = function () {
|
7934 | var storage = getAdapter('storage');
|
7935 |
|
7936 | if (!storage.async) {
|
7937 | return storage[apiName].apply(storage, arguments);
|
7938 | }
|
7939 |
|
7940 | var error = new Error('Synchronous API [' + apiName + '] is not available in this runtime.');
|
7941 | error.code = 'SYNC_API_NOT_AVAILABLE';
|
7942 | throw error;
|
7943 | };
|
7944 | });
|
7945 | module.exports = localStorage;
|
7946 |
|
7947 | }),
|
7948 |
|
7949 | (function(module, exports, __webpack_require__) {
|
7950 |
|
7951 | "use strict";
|
7952 |
|
7953 |
|
7954 | var _interopRequireDefault = __webpack_require__(1);
|
7955 |
|
7956 | var _concat = _interopRequireDefault(__webpack_require__(22));
|
7957 |
|
7958 | var _stringify = _interopRequireDefault(__webpack_require__(36));
|
7959 |
|
7960 | var storage = __webpack_require__(237);
|
7961 |
|
7962 | var AV = __webpack_require__(69);
|
7963 |
|
7964 | var removeAsync = exports.removeAsync = storage.removeItemAsync.bind(storage);
|
7965 |
|
7966 | var getCacheData = function getCacheData(cacheData, key) {
|
7967 | try {
|
7968 | cacheData = JSON.parse(cacheData);
|
7969 | } catch (e) {
|
7970 | return null;
|
7971 | }
|
7972 |
|
7973 | if (cacheData) {
|
7974 | var expired = cacheData.expiredAt && cacheData.expiredAt < Date.now();
|
7975 |
|
7976 | if (!expired) {
|
7977 | return cacheData.value;
|
7978 | }
|
7979 |
|
7980 | return removeAsync(key).then(function () {
|
7981 | return null;
|
7982 | });
|
7983 | }
|
7984 |
|
7985 | return null;
|
7986 | };
|
7987 |
|
7988 | exports.getAsync = function (key) {
|
7989 | var _context;
|
7990 |
|
7991 | key = (0, _concat.default)(_context = "AV/".concat(AV.applicationId, "/")).call(_context, key);
|
7992 | return storage.getItemAsync(key).then(function (cache) {
|
7993 | return getCacheData(cache, key);
|
7994 | });
|
7995 | };
|
7996 |
|
7997 | exports.setAsync = function (key, value, ttl) {
|
7998 | var _context2;
|
7999 |
|
8000 | var cache = {
|
8001 | value: value
|
8002 | };
|
8003 |
|
8004 | if (typeof ttl === 'number') {
|
8005 | cache.expiredAt = Date.now() + ttl;
|
8006 | }
|
8007 |
|
8008 | return storage.setItemAsync((0, _concat.default)(_context2 = "AV/".concat(AV.applicationId, "/")).call(_context2, key), (0, _stringify.default)(cache));
|
8009 | };
|
8010 |
|
8011 | }),
|
8012 |
|
8013 | (function(module, exports, __webpack_require__) {
|
8014 |
|
8015 | module.exports = __webpack_require__(240);
|
8016 |
|
8017 | }),
|
8018 |
|
8019 | (function(module, exports, __webpack_require__) {
|
8020 |
|
8021 | var parent = __webpack_require__(419);
|
8022 |
|
8023 | module.exports = parent;
|
8024 |
|
8025 |
|
8026 | }),
|
8027 |
|
8028 | (function(module, exports, __webpack_require__) {
|
8029 |
|
8030 | var parent = __webpack_require__(422);
|
8031 |
|
8032 | module.exports = parent;
|
8033 |
|
8034 |
|
8035 | }),
|
8036 |
|
8037 | (function(module, exports, __webpack_require__) {
|
8038 |
|
8039 | var parent = __webpack_require__(425);
|
8040 |
|
8041 | module.exports = parent;
|
8042 |
|
8043 |
|
8044 | }),
|
8045 |
|
8046 | (function(module, exports, __webpack_require__) {
|
8047 |
|
8048 | module.exports = __webpack_require__(428);
|
8049 |
|
8050 | }),
|
8051 |
|
8052 | (function(module, exports, __webpack_require__) {
|
8053 |
|
8054 | var parent = __webpack_require__(431);
|
8055 | __webpack_require__(39);
|
8056 |
|
8057 | module.exports = parent;
|
8058 |
|
8059 |
|
8060 | }),
|
8061 |
|
8062 | (function(module, exports, __webpack_require__) {
|
8063 |
|
8064 |
|
8065 | __webpack_require__(432);
|
8066 | __webpack_require__(434);
|
8067 | __webpack_require__(435);
|
8068 | __webpack_require__(231);
|
8069 | __webpack_require__(436);
|
8070 |
|
8071 |
|
8072 | }),
|
8073 |
|
8074 | (function(module, exports, __webpack_require__) {
|
8075 |
|
8076 |
|
8077 | var classof = __webpack_require__(63);
|
8078 | var toIndexedObject = __webpack_require__(32);
|
8079 | var $getOwnPropertyNames = __webpack_require__(103).f;
|
8080 | var arraySlice = __webpack_require__(433);
|
8081 |
|
8082 | var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames
|
8083 | ? Object.getOwnPropertyNames(window) : [];
|
8084 |
|
8085 | var getWindowNames = function (it) {
|
8086 | try {
|
8087 | return $getOwnPropertyNames(it);
|
8088 | } catch (error) {
|
8089 | return arraySlice(windowNames);
|
8090 | }
|
8091 | };
|
8092 |
|
8093 |
|
8094 | module.exports.f = function getOwnPropertyNames(it) {
|
8095 | return windowNames && classof(it) == 'Window'
|
8096 | ? getWindowNames(it)
|
8097 | : $getOwnPropertyNames(toIndexedObject(it));
|
8098 | };
|
8099 |
|
8100 |
|
8101 | }),
|
8102 |
|
8103 | (function(module, exports, __webpack_require__) {
|
8104 |
|
8105 | var call = __webpack_require__(15);
|
8106 | var getBuiltIn = __webpack_require__(18);
|
8107 | var wellKnownSymbol = __webpack_require__(9);
|
8108 | var defineBuiltIn = __webpack_require__(44);
|
8109 |
|
8110 | module.exports = function () {
|
8111 | var Symbol = getBuiltIn('Symbol');
|
8112 | var SymbolPrototype = Symbol && Symbol.prototype;
|
8113 | var valueOf = SymbolPrototype && SymbolPrototype.valueOf;
|
8114 | var TO_PRIMITIVE = wellKnownSymbol('toPrimitive');
|
8115 |
|
8116 | if (SymbolPrototype && !SymbolPrototype[TO_PRIMITIVE]) {
|
8117 |
|
8118 |
|
8119 |
|
8120 | defineBuiltIn(SymbolPrototype, TO_PRIMITIVE, function (hint) {
|
8121 | return call(valueOf, this);
|
8122 | }, { arity: 1 });
|
8123 | }
|
8124 | };
|
8125 |
|
8126 |
|
8127 | }),
|
8128 |
|
8129 | (function(module, exports, __webpack_require__) {
|
8130 |
|
8131 | var NATIVE_SYMBOL = __webpack_require__(64);
|
8132 |
|
8133 |
|
8134 | module.exports = NATIVE_SYMBOL && !!Symbol['for'] && !!Symbol.keyFor;
|
8135 |
|
8136 |
|
8137 | }),
|
8138 |
|
8139 | (function(module, exports, __webpack_require__) {
|
8140 |
|
8141 | var defineWellKnownSymbol = __webpack_require__(10);
|
8142 |
|
8143 |
|
8144 |
|
8145 | defineWellKnownSymbol('iterator');
|
8146 |
|
8147 |
|
8148 | }),
|
8149 |
|
8150 | (function(module, exports, __webpack_require__) {
|
8151 |
|
8152 | var parent = __webpack_require__(465);
|
8153 | __webpack_require__(39);
|
8154 |
|
8155 | module.exports = parent;
|
8156 |
|
8157 |
|
8158 | }),
|
8159 |
|
8160 | (function(module, exports, __webpack_require__) {
|
8161 |
|
8162 | module.exports = __webpack_require__(466);
|
8163 |
|
8164 | }),
|
8165 |
|
8166 | (function(module, exports, __webpack_require__) {
|
8167 |
|
8168 | "use strict";
|
8169 |
|
8170 |
|
8171 |
|
8172 |
|
8173 |
|
8174 |
|
8175 |
|
8176 | var TimeoutError;
|
8177 |
|
8178 |
|
8179 |
|
8180 |
|
8181 |
|
8182 |
|
8183 |
|
8184 |
|
8185 |
|
8186 |
|
8187 | var timeout = module.exports.timeout = function(promise, timeoutMillis) {
|
8188 | var error = new TimeoutError(),
|
8189 | timeout;
|
8190 |
|
8191 | return Promise.race([
|
8192 | promise,
|
8193 | new Promise(function(resolve, reject) {
|
8194 | timeout = setTimeout(function() {
|
8195 | reject(error);
|
8196 | }, timeoutMillis);
|
8197 | }),
|
8198 | ]).then(function(v) {
|
8199 | clearTimeout(timeout);
|
8200 | return v;
|
8201 | }, function(err) {
|
8202 | clearTimeout(timeout);
|
8203 | throw err;
|
8204 | });
|
8205 | };
|
8206 |
|
8207 |
|
8208 |
|
8209 |
|
8210 | TimeoutError = module.exports.TimeoutError = function() {
|
8211 | Error.call(this)
|
8212 | this.stack = Error().stack
|
8213 | this.message = 'Timeout';
|
8214 | };
|
8215 |
|
8216 | TimeoutError.prototype = Object.create(Error.prototype);
|
8217 | TimeoutError.prototype.name = "TimeoutError";
|
8218 |
|
8219 |
|
8220 | }),
|
8221 |
|
8222 | (function(module, exports, __webpack_require__) {
|
8223 |
|
8224 | module.exports = __webpack_require__(254);
|
8225 |
|
8226 | }),
|
8227 |
|
8228 | (function(module, exports, __webpack_require__) {
|
8229 |
|
8230 | var parent = __webpack_require__(482);
|
8231 |
|
8232 | module.exports = parent;
|
8233 |
|
8234 |
|
8235 | }),
|
8236 |
|
8237 | (function(module, exports, __webpack_require__) {
|
8238 |
|
8239 | module.exports = __webpack_require__(486);
|
8240 |
|
8241 | }),
|
8242 |
|
8243 | (function(module, exports, __webpack_require__) {
|
8244 |
|
8245 | "use strict";
|
8246 |
|
8247 | var uncurryThis = __webpack_require__(4);
|
8248 | var aCallable = __webpack_require__(31);
|
8249 | var isObject = __webpack_require__(11);
|
8250 | var hasOwn = __webpack_require__(13);
|
8251 | var arraySlice = __webpack_require__(110);
|
8252 | var NATIVE_BIND = __webpack_require__(76);
|
8253 |
|
8254 | var $Function = Function;
|
8255 | var concat = uncurryThis([].concat);
|
8256 | var join = uncurryThis([].join);
|
8257 | var factories = {};
|
8258 |
|
8259 | var construct = function (C, argsLength, args) {
|
8260 | if (!hasOwn(factories, argsLength)) {
|
8261 | for (var list = [], i = 0; i < argsLength; i++) list[i] = 'a[' + i + ']';
|
8262 | factories[argsLength] = $Function('C,a', 'return new C(' + join(list, ',') + ')');
|
8263 | } return factories[argsLength](C, args);
|
8264 | };
|
8265 |
|
8266 |
|
8267 |
|
8268 | module.exports = NATIVE_BIND ? $Function.bind : function bind(that /* , ...args */) {
|
8269 | var F = aCallable(this);
|
8270 | var Prototype = F.prototype;
|
8271 | var partArgs = arraySlice(arguments, 1);
|
8272 | var boundFunction = function bound(/* args... */) {
|
8273 | var args = concat(partArgs, arraySlice(arguments));
|
8274 | return this instanceof boundFunction ? construct(F, args.length, args) : F.apply(that, args);
|
8275 | };
|
8276 | if (isObject(Prototype)) boundFunction.prototype = Prototype;
|
8277 | return boundFunction;
|
8278 | };
|
8279 |
|
8280 |
|
8281 | }),
|
8282 |
|
8283 | (function(module, exports, __webpack_require__) {
|
8284 |
|
8285 | module.exports = __webpack_require__(507);
|
8286 |
|
8287 | }),
|
8288 |
|
8289 | (function(module, exports, __webpack_require__) {
|
8290 |
|
8291 | module.exports = __webpack_require__(510);
|
8292 |
|
8293 | }),
|
8294 |
|
8295 | (function(module, exports) {
|
8296 |
|
8297 | var charenc = {
|
8298 |
|
8299 | utf8: {
|
8300 |
|
8301 | stringToBytes: function(str) {
|
8302 | return charenc.bin.stringToBytes(unescape(encodeURIComponent(str)));
|
8303 | },
|
8304 |
|
8305 |
|
8306 | bytesToString: function(bytes) {
|
8307 | return decodeURIComponent(escape(charenc.bin.bytesToString(bytes)));
|
8308 | }
|
8309 | },
|
8310 |
|
8311 |
|
8312 | bin: {
|
8313 |
|
8314 | stringToBytes: function(str) {
|
8315 | for (var bytes = [], i = 0; i < str.length; i++)
|
8316 | bytes.push(str.charCodeAt(i) & 0xFF);
|
8317 | return bytes;
|
8318 | },
|
8319 |
|
8320 |
|
8321 | bytesToString: function(bytes) {
|
8322 | for (var str = [], i = 0; i < bytes.length; i++)
|
8323 | str.push(String.fromCharCode(bytes[i]));
|
8324 | return str.join('');
|
8325 | }
|
8326 | }
|
8327 | };
|
8328 |
|
8329 | module.exports = charenc;
|
8330 |
|
8331 |
|
8332 | }),
|
8333 |
|
8334 | (function(module, exports, __webpack_require__) {
|
8335 |
|
8336 | "use strict";
|
8337 |
|
8338 |
|
8339 | var adapters = __webpack_require__(571);
|
8340 |
|
8341 | module.exports = function (AV) {
|
8342 | AV.setAdapters(adapters);
|
8343 | return AV;
|
8344 | };
|
8345 |
|
8346 | }),
|
8347 |
|
8348 | (function(module, exports, __webpack_require__) {
|
8349 |
|
8350 | module.exports = __webpack_require__(579);
|
8351 |
|
8352 | }),
|
8353 |
|
8354 | (function(module, exports, __webpack_require__) {
|
8355 |
|
8356 | var fails = __webpack_require__(2);
|
8357 | var isObject = __webpack_require__(11);
|
8358 | var classof = __webpack_require__(63);
|
8359 | var ARRAY_BUFFER_NON_EXTENSIBLE = __webpack_require__(583);
|
8360 |
|
8361 |
|
8362 | var $isExtensible = Object.isExtensible;
|
8363 | var FAILS_ON_PRIMITIVES = fails(function () { $isExtensible(1); });
|
8364 |
|
8365 |
|
8366 |
|
8367 | module.exports = (FAILS_ON_PRIMITIVES || ARRAY_BUFFER_NON_EXTENSIBLE) ? function isExtensible(it) {
|
8368 | if (!isObject(it)) return false;
|
8369 | if (ARRAY_BUFFER_NON_EXTENSIBLE && classof(it) == 'ArrayBuffer') return false;
|
8370 | return $isExtensible ? $isExtensible(it) : true;
|
8371 | } : $isExtensible;
|
8372 |
|
8373 |
|
8374 | }),
|
8375 |
|
8376 | (function(module, exports, __webpack_require__) {
|
8377 |
|
8378 | var fails = __webpack_require__(2);
|
8379 |
|
8380 | module.exports = !fails(function () {
|
8381 |
|
8382 | return Object.isExtensible(Object.preventExtensions({}));
|
8383 | });
|
8384 |
|
8385 |
|
8386 | }),
|
8387 |
|
8388 | (function(module, exports, __webpack_require__) {
|
8389 |
|
8390 | "use strict";
|
8391 |
|
8392 | var defineProperty = __webpack_require__(23).f;
|
8393 | var create = __webpack_require__(49);
|
8394 | var defineBuiltIns = __webpack_require__(155);
|
8395 | var bind = __webpack_require__(48);
|
8396 | var anInstance = __webpack_require__(108);
|
8397 | var iterate = __webpack_require__(42);
|
8398 | var defineIterator = __webpack_require__(132);
|
8399 | var setSpecies = __webpack_require__(173);
|
8400 | var DESCRIPTORS = __webpack_require__(14);
|
8401 | var fastKey = __webpack_require__(94).fastKey;
|
8402 | var InternalStateModule = __webpack_require__(43);
|
8403 |
|
8404 | var setInternalState = InternalStateModule.set;
|
8405 | var internalStateGetterFor = InternalStateModule.getterFor;
|
8406 |
|
8407 | module.exports = {
|
8408 | getConstructor: function (wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER) {
|
8409 | var Constructor = wrapper(function (that, iterable) {
|
8410 | anInstance(that, Prototype);
|
8411 | setInternalState(that, {
|
8412 | type: CONSTRUCTOR_NAME,
|
8413 | index: create(null),
|
8414 | first: undefined,
|
8415 | last: undefined,
|
8416 | size: 0
|
8417 | });
|
8418 | if (!DESCRIPTORS) that.size = 0;
|
8419 | if (iterable != undefined) iterate(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP });
|
8420 | });
|
8421 |
|
8422 | var Prototype = Constructor.prototype;
|
8423 |
|
8424 | var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME);
|
8425 |
|
8426 | var define = function (that, key, value) {
|
8427 | var state = getInternalState(that);
|
8428 | var entry = getEntry(that, key);
|
8429 | var previous, index;
|
8430 |
|
8431 | if (entry) {
|
8432 | entry.value = value;
|
8433 |
|
8434 | } else {
|
8435 | state.last = entry = {
|
8436 | index: index = fastKey(key, true),
|
8437 | key: key,
|
8438 | value: value,
|
8439 | previous: previous = state.last,
|
8440 | next: undefined,
|
8441 | removed: false
|
8442 | };
|
8443 | if (!state.first) state.first = entry;
|
8444 | if (previous) previous.next = entry;
|
8445 | if (DESCRIPTORS) state.size++;
|
8446 | else that.size++;
|
8447 |
|
8448 | if (index !== 'F') state.index[index] = entry;
|
8449 | } return that;
|
8450 | };
|
8451 |
|
8452 | var getEntry = function (that, key) {
|
8453 | var state = getInternalState(that);
|
8454 |
|
8455 | var index = fastKey(key);
|
8456 | var entry;
|
8457 | if (index !== 'F') return state.index[index];
|
8458 |
|
8459 | for (entry = state.first; entry; entry = entry.next) {
|
8460 | if (entry.key == key) return entry;
|
8461 | }
|
8462 | };
|
8463 |
|
8464 | defineBuiltIns(Prototype, {
|
8465 |
|
8466 |
|
8467 |
|
8468 | clear: function clear() {
|
8469 | var that = this;
|
8470 | var state = getInternalState(that);
|
8471 | var data = state.index;
|
8472 | var entry = state.first;
|
8473 | while (entry) {
|
8474 | entry.removed = true;
|
8475 | if (entry.previous) entry.previous = entry.previous.next = undefined;
|
8476 | delete data[entry.index];
|
8477 | entry = entry.next;
|
8478 | }
|
8479 | state.first = state.last = undefined;
|
8480 | if (DESCRIPTORS) state.size = 0;
|
8481 | else that.size = 0;
|
8482 | },
|
8483 |
|
8484 |
|
8485 |
|
8486 | 'delete': function (key) {
|
8487 | var that = this;
|
8488 | var state = getInternalState(that);
|
8489 | var entry = getEntry(that, key);
|
8490 | if (entry) {
|
8491 | var next = entry.next;
|
8492 | var prev = entry.previous;
|
8493 | delete state.index[entry.index];
|
8494 | entry.removed = true;
|
8495 | if (prev) prev.next = next;
|
8496 | if (next) next.previous = prev;
|
8497 | if (state.first == entry) state.first = next;
|
8498 | if (state.last == entry) state.last = prev;
|
8499 | if (DESCRIPTORS) state.size--;
|
8500 | else that.size--;
|
8501 | } return !!entry;
|
8502 | },
|
8503 |
|
8504 |
|
8505 |
|
8506 | forEach: function forEach(callbackfn /* , that = undefined */) {
|
8507 | var state = getInternalState(this);
|
8508 | var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
8509 | var entry;
|
8510 | while (entry = entry ? entry.next : state.first) {
|
8511 | boundFunction(entry.value, entry.key, this);
|
8512 |
|
8513 | while (entry && entry.removed) entry = entry.previous;
|
8514 | }
|
8515 | },
|
8516 |
|
8517 |
|
8518 |
|
8519 | has: function has(key) {
|
8520 | return !!getEntry(this, key);
|
8521 | }
|
8522 | });
|
8523 |
|
8524 | defineBuiltIns(Prototype, IS_MAP ? {
|
8525 |
|
8526 |
|
8527 | get: function get(key) {
|
8528 | var entry = getEntry(this, key);
|
8529 | return entry && entry.value;
|
8530 | },
|
8531 |
|
8532 |
|
8533 | set: function set(key, value) {
|
8534 | return define(this, key === 0 ? 0 : key, value);
|
8535 | }
|
8536 | } : {
|
8537 |
|
8538 |
|
8539 | add: function add(value) {
|
8540 | return define(this, value = value === 0 ? 0 : value, value);
|
8541 | }
|
8542 | });
|
8543 | if (DESCRIPTORS) defineProperty(Prototype, 'size', {
|
8544 | get: function () {
|
8545 | return getInternalState(this).size;
|
8546 | }
|
8547 | });
|
8548 | return Constructor;
|
8549 | },
|
8550 | setStrong: function (Constructor, CONSTRUCTOR_NAME, IS_MAP) {
|
8551 | var ITERATOR_NAME = CONSTRUCTOR_NAME + ' Iterator';
|
8552 | var getInternalCollectionState = internalStateGetterFor(CONSTRUCTOR_NAME);
|
8553 | var getInternalIteratorState = internalStateGetterFor(ITERATOR_NAME);
|
8554 |
|
8555 |
|
8556 |
|
8557 |
|
8558 |
|
8559 |
|
8560 |
|
8561 |
|
8562 |
|
8563 | defineIterator(Constructor, CONSTRUCTOR_NAME, function (iterated, kind) {
|
8564 | setInternalState(this, {
|
8565 | type: ITERATOR_NAME,
|
8566 | target: iterated,
|
8567 | state: getInternalCollectionState(iterated),
|
8568 | kind: kind,
|
8569 | last: undefined
|
8570 | });
|
8571 | }, function () {
|
8572 | var state = getInternalIteratorState(this);
|
8573 | var kind = state.kind;
|
8574 | var entry = state.last;
|
8575 |
|
8576 | while (entry && entry.removed) entry = entry.previous;
|
8577 |
|
8578 | if (!state.target || !(state.last = entry = entry ? entry.next : state.state.first)) {
|
8579 |
|
8580 | state.target = undefined;
|
8581 | return { value: undefined, done: true };
|
8582 | }
|
8583 |
|
8584 | if (kind == 'keys') return { value: entry.key, done: false };
|
8585 | if (kind == 'values') return { value: entry.value, done: false };
|
8586 | return { value: [entry.key, entry.value], done: false };
|
8587 | }, IS_MAP ? 'entries' : 'values', !IS_MAP, true);
|
8588 |
|
8589 |
|
8590 |
|
8591 |
|
8592 | setSpecies(CONSTRUCTOR_NAME);
|
8593 | }
|
8594 | };
|
8595 |
|
8596 |
|
8597 | }),
|
8598 |
|
8599 | (function(module, exports, __webpack_require__) {
|
8600 |
|
8601 | module.exports = __webpack_require__(610);
|
8602 |
|
8603 | }),
|
8604 |
|
8605 | (function(module, exports) {
|
8606 |
|
8607 | function _arrayLikeToArray(arr, len) {
|
8608 | if (len == null || len > arr.length) len = arr.length;
|
8609 | for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
8610 | return arr2;
|
8611 | }
|
8612 | module.exports = _arrayLikeToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
8613 |
|
8614 | }),
|
8615 |
|
8616 | (function(module, exports) {
|
8617 |
|
8618 | function _iterableToArray(iter) {
|
8619 | if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
8620 | }
|
8621 | module.exports = _iterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
8622 |
|
8623 | }),
|
8624 |
|
8625 | (function(module, exports, __webpack_require__) {
|
8626 |
|
8627 | var arrayLikeToArray = __webpack_require__(266);
|
8628 | function _unsupportedIterableToArray(o, minLen) {
|
8629 | if (!o) return;
|
8630 | if (typeof o === "string") return arrayLikeToArray(o, minLen);
|
8631 | var n = Object.prototype.toString.call(o).slice(8, -1);
|
8632 | if (n === "Object" && o.constructor) n = o.constructor.name;
|
8633 | if (n === "Map" || n === "Set") return Array.from(o);
|
8634 | if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);
|
8635 | }
|
8636 | module.exports = _unsupportedIterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
8637 |
|
8638 | }),
|
8639 |
|
8640 | (function(module, exports, __webpack_require__) {
|
8641 |
|
8642 | var _typeof = __webpack_require__(118)["default"];
|
8643 | var toPrimitive = __webpack_require__(624);
|
8644 | function _toPropertyKey(arg) {
|
8645 | var key = toPrimitive(arg, "string");
|
8646 | return _typeof(key) === "symbol" ? key : String(key);
|
8647 | }
|
8648 | module.exports = _toPropertyKey, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
8649 |
|
8650 | }),
|
8651 |
|
8652 | (function(module, exports, __webpack_require__) {
|
8653 |
|
8654 | var baseRandom = __webpack_require__(635);
|
8655 |
|
8656 |
|
8657 |
|
8658 |
|
8659 |
|
8660 |
|
8661 |
|
8662 |
|
8663 |
|
8664 | function shuffleSelf(array, size) {
|
8665 | var index = -1,
|
8666 | length = array.length,
|
8667 | lastIndex = length - 1;
|
8668 |
|
8669 | size = size === undefined ? length : size;
|
8670 | while (++index < size) {
|
8671 | var rand = baseRandom(index, lastIndex),
|
8672 | value = array[rand];
|
8673 |
|
8674 | array[rand] = array[index];
|
8675 | array[index] = value;
|
8676 | }
|
8677 | array.length = size;
|
8678 | return array;
|
8679 | }
|
8680 |
|
8681 | module.exports = shuffleSelf;
|
8682 |
|
8683 |
|
8684 | }),
|
8685 |
|
8686 | (function(module, exports, __webpack_require__) {
|
8687 |
|
8688 | var baseValues = __webpack_require__(637),
|
8689 | keys = __webpack_require__(639);
|
8690 |
|
8691 |
|
8692 |
|
8693 |
|
8694 |
|
8695 |
|
8696 |
|
8697 |
|
8698 |
|
8699 |
|
8700 |
|
8701 |
|
8702 |
|
8703 |
|
8704 |
|
8705 |
|
8706 |
|
8707 |
|
8708 |
|
8709 |
|
8710 |
|
8711 |
|
8712 |
|
8713 |
|
8714 |
|
8715 |
|
8716 |
|
8717 | function values(object) {
|
8718 | return object == null ? [] : baseValues(object, keys(object));
|
8719 | }
|
8720 |
|
8721 | module.exports = values;
|
8722 |
|
8723 |
|
8724 | }),
|
8725 |
|
8726 | (function(module, exports, __webpack_require__) {
|
8727 |
|
8728 | var root = __webpack_require__(273);
|
8729 |
|
8730 |
|
8731 | var Symbol = root.Symbol;
|
8732 |
|
8733 | module.exports = Symbol;
|
8734 |
|
8735 |
|
8736 | }),
|
8737 |
|
8738 | (function(module, exports, __webpack_require__) {
|
8739 |
|
8740 | var freeGlobal = __webpack_require__(274);
|
8741 |
|
8742 |
|
8743 | var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
|
8744 |
|
8745 |
|
8746 | var root = freeGlobal || freeSelf || Function('return this')();
|
8747 |
|
8748 | module.exports = root;
|
8749 |
|
8750 |
|
8751 | }),
|
8752 |
|
8753 | (function(module, exports, __webpack_require__) {
|
8754 |
|
8755 | (function(global) {
|
8756 | var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
|
8757 |
|
8758 | module.exports = freeGlobal;
|
8759 |
|
8760 | }.call(exports, __webpack_require__(74)))
|
8761 |
|
8762 | }),
|
8763 |
|
8764 | (function(module, exports) {
|
8765 |
|
8766 |
|
8767 |
|
8768 |
|
8769 |
|
8770 |
|
8771 |
|
8772 |
|
8773 |
|
8774 |
|
8775 |
|
8776 |
|
8777 |
|
8778 |
|
8779 |
|
8780 |
|
8781 |
|
8782 |
|
8783 |
|
8784 |
|
8785 |
|
8786 |
|
8787 |
|
8788 |
|
8789 | var isArray = Array.isArray;
|
8790 |
|
8791 | module.exports = isArray;
|
8792 |
|
8793 |
|
8794 | }),
|
8795 |
|
8796 | (function(module, exports) {
|
8797 |
|
8798 | module.exports = function(module) {
|
8799 | if(!module.webpackPolyfill) {
|
8800 | module.deprecate = function() {};
|
8801 | module.paths = [];
|
8802 |
|
8803 | if(!module.children) module.children = [];
|
8804 | Object.defineProperty(module, "loaded", {
|
8805 | enumerable: true,
|
8806 | get: function() {
|
8807 | return module.l;
|
8808 | }
|
8809 | });
|
8810 | Object.defineProperty(module, "id", {
|
8811 | enumerable: true,
|
8812 | get: function() {
|
8813 | return module.i;
|
8814 | }
|
8815 | });
|
8816 | module.webpackPolyfill = 1;
|
8817 | }
|
8818 | return module;
|
8819 | };
|
8820 |
|
8821 |
|
8822 | }),
|
8823 |
|
8824 | (function(module, exports) {
|
8825 |
|
8826 |
|
8827 | var MAX_SAFE_INTEGER = 9007199254740991;
|
8828 |
|
8829 |
|
8830 |
|
8831 |
|
8832 |
|
8833 |
|
8834 |
|
8835 |
|
8836 |
|
8837 |
|
8838 |
|
8839 |
|
8840 |
|
8841 |
|
8842 |
|
8843 |
|
8844 |
|
8845 |
|
8846 |
|
8847 |
|
8848 |
|
8849 |
|
8850 |
|
8851 |
|
8852 |
|
8853 |
|
8854 |
|
8855 | function isLength(value) {
|
8856 | return typeof value == 'number' &&
|
8857 | value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
|
8858 | }
|
8859 |
|
8860 | module.exports = isLength;
|
8861 |
|
8862 |
|
8863 | }),
|
8864 |
|
8865 | (function(module, exports) {
|
8866 |
|
8867 |
|
8868 |
|
8869 |
|
8870 |
|
8871 |
|
8872 |
|
8873 |
|
8874 |
|
8875 | function overArg(func, transform) {
|
8876 | return function(arg) {
|
8877 | return func(transform(arg));
|
8878 | };
|
8879 | }
|
8880 |
|
8881 | module.exports = overArg;
|
8882 |
|
8883 |
|
8884 | }),
|
8885 |
|
8886 | (function(module, exports, __webpack_require__) {
|
8887 |
|
8888 | "use strict";
|
8889 |
|
8890 |
|
8891 | var AV = __webpack_require__(280);
|
8892 |
|
8893 | var useLiveQuery = __webpack_require__(590);
|
8894 |
|
8895 | var useAdatpers = __webpack_require__(260);
|
8896 |
|
8897 | module.exports = useAdatpers(useLiveQuery(AV));
|
8898 |
|
8899 | }),
|
8900 |
|
8901 | (function(module, exports, __webpack_require__) {
|
8902 |
|
8903 | "use strict";
|
8904 |
|
8905 |
|
8906 | var AV = __webpack_require__(281);
|
8907 |
|
8908 | var useAdatpers = __webpack_require__(260);
|
8909 |
|
8910 | module.exports = useAdatpers(AV);
|
8911 |
|
8912 | }),
|
8913 |
|
8914 | (function(module, exports, __webpack_require__) {
|
8915 |
|
8916 | "use strict";
|
8917 |
|
8918 |
|
8919 | module.exports = __webpack_require__(282);
|
8920 |
|
8921 | }),
|
8922 |
|
8923 | (function(module, exports, __webpack_require__) {
|
8924 |
|
8925 | "use strict";
|
8926 |
|
8927 |
|
8928 | var _interopRequireDefault = __webpack_require__(1);
|
8929 |
|
8930 | var _promise = _interopRequireDefault(__webpack_require__(12));
|
8931 |
|
8932 |
|
8933 |
|
8934 |
|
8935 |
|
8936 |
|
8937 |
|
8938 |
|
8939 | var _ = __webpack_require__(3);
|
8940 |
|
8941 | var AV = __webpack_require__(69);
|
8942 |
|
8943 | AV._ = _;
|
8944 | AV.version = __webpack_require__(235);
|
8945 | AV.Promise = _promise.default;
|
8946 | AV.localStorage = __webpack_require__(237);
|
8947 | AV.Cache = __webpack_require__(238);
|
8948 | AV.Error = __webpack_require__(46);
|
8949 |
|
8950 | __webpack_require__(421);
|
8951 |
|
8952 | __webpack_require__(470)(AV);
|
8953 |
|
8954 | __webpack_require__(471)(AV);
|
8955 |
|
8956 | __webpack_require__(472)(AV);
|
8957 |
|
8958 | __webpack_require__(473)(AV);
|
8959 |
|
8960 | __webpack_require__(478)(AV);
|
8961 |
|
8962 | __webpack_require__(479)(AV);
|
8963 |
|
8964 | __webpack_require__(532)(AV);
|
8965 |
|
8966 | __webpack_require__(557)(AV);
|
8967 |
|
8968 | __webpack_require__(558)(AV);
|
8969 |
|
8970 | __webpack_require__(560)(AV);
|
8971 |
|
8972 | __webpack_require__(561)(AV);
|
8973 |
|
8974 | __webpack_require__(562)(AV);
|
8975 |
|
8976 | __webpack_require__(563)(AV);
|
8977 |
|
8978 | __webpack_require__(564)(AV);
|
8979 |
|
8980 | __webpack_require__(565)(AV);
|
8981 |
|
8982 | __webpack_require__(566)(AV);
|
8983 |
|
8984 | __webpack_require__(567)(AV);
|
8985 |
|
8986 | __webpack_require__(568)(AV);
|
8987 |
|
8988 | AV.Conversation = __webpack_require__(569);
|
8989 |
|
8990 | __webpack_require__(570);
|
8991 |
|
8992 | module.exports = AV;
|
8993 |
|
8994 |
|
8995 |
|
8996 |
|
8997 |
|
8998 |
|
8999 |
|
9000 |
|
9001 |
|
9002 |
|
9003 |
|
9004 |
|
9005 |
|
9006 |
|
9007 |
|
9008 |
|
9009 |
|
9010 | }),
|
9011 |
|
9012 | (function(module, exports, __webpack_require__) {
|
9013 |
|
9014 | var parent = __webpack_require__(284);
|
9015 | __webpack_require__(39);
|
9016 |
|
9017 | module.exports = parent;
|
9018 |
|
9019 |
|
9020 | }),
|
9021 |
|
9022 | (function(module, exports, __webpack_require__) {
|
9023 |
|
9024 | __webpack_require__(285);
|
9025 | __webpack_require__(38);
|
9026 | __webpack_require__(53);
|
9027 | __webpack_require__(301);
|
9028 | __webpack_require__(315);
|
9029 | __webpack_require__(316);
|
9030 | __webpack_require__(317);
|
9031 | __webpack_require__(55);
|
9032 | var path = __webpack_require__(5);
|
9033 |
|
9034 | module.exports = path.Promise;
|
9035 |
|
9036 |
|
9037 | }),
|
9038 |
|
9039 | (function(module, exports, __webpack_require__) {
|
9040 |
|
9041 |
|
9042 | __webpack_require__(286);
|
9043 |
|
9044 |
|
9045 | }),
|
9046 |
|
9047 | (function(module, exports, __webpack_require__) {
|
9048 |
|
9049 | "use strict";
|
9050 |
|
9051 | var $ = __webpack_require__(0);
|
9052 | var isPrototypeOf = __webpack_require__(19);
|
9053 | var getPrototypeOf = __webpack_require__(100);
|
9054 | var setPrototypeOf = __webpack_require__(102);
|
9055 | var copyConstructorProperties = __webpack_require__(291);
|
9056 | var create = __webpack_require__(49);
|
9057 | var createNonEnumerableProperty = __webpack_require__(37);
|
9058 | var createPropertyDescriptor = __webpack_require__(47);
|
9059 | var clearErrorStack = __webpack_require__(294);
|
9060 | var installErrorCause = __webpack_require__(295);
|
9061 | var iterate = __webpack_require__(42);
|
9062 | var normalizeStringArgument = __webpack_require__(296);
|
9063 | var wellKnownSymbol = __webpack_require__(9);
|
9064 | var ERROR_STACK_INSTALLABLE = __webpack_require__(297);
|
9065 |
|
9066 | var TO_STRING_TAG = wellKnownSymbol('toStringTag');
|
9067 | var $Error = Error;
|
9068 | var push = [].push;
|
9069 |
|
9070 | var $AggregateError = function AggregateError(errors, message /* , options */) {
|
9071 | var options = arguments.length > 2 ? arguments[2] : undefined;
|
9072 | var isInstance = isPrototypeOf(AggregateErrorPrototype, this);
|
9073 | var that;
|
9074 | if (setPrototypeOf) {
|
9075 | that = setPrototypeOf(new $Error(), isInstance ? getPrototypeOf(this) : AggregateErrorPrototype);
|
9076 | } else {
|
9077 | that = isInstance ? this : create(AggregateErrorPrototype);
|
9078 | createNonEnumerableProperty(that, TO_STRING_TAG, 'Error');
|
9079 | }
|
9080 | if (message !== undefined) createNonEnumerableProperty(that, 'message', normalizeStringArgument(message));
|
9081 | if (ERROR_STACK_INSTALLABLE) createNonEnumerableProperty(that, 'stack', clearErrorStack(that.stack, 1));
|
9082 | installErrorCause(that, options);
|
9083 | var errorsArray = [];
|
9084 | iterate(errors, push, { that: errorsArray });
|
9085 | createNonEnumerableProperty(that, 'errors', errorsArray);
|
9086 | return that;
|
9087 | };
|
9088 |
|
9089 | if (setPrototypeOf) setPrototypeOf($AggregateError, $Error);
|
9090 | else copyConstructorProperties($AggregateError, $Error, { name: true });
|
9091 |
|
9092 | var AggregateErrorPrototype = $AggregateError.prototype = create($Error.prototype, {
|
9093 | constructor: createPropertyDescriptor(1, $AggregateError),
|
9094 | message: createPropertyDescriptor(1, ''),
|
9095 | name: createPropertyDescriptor(1, 'AggregateError')
|
9096 | });
|
9097 |
|
9098 | // `AggregateError` constructor
|
9099 | // https://tc39.es/ecma262/#sec-aggregate-error-constructor
|
9100 | $({ global: true, constructor: true, arity: 2 }, {
|
9101 | AggregateError: $AggregateError
|
9102 | });
|
9103 |
|
9104 |
|
9105 | }),
|
9106 |
|
9107 | (function(module, exports, __webpack_require__) {
|
9108 |
|
9109 | var call = __webpack_require__(15);
|
9110 | var isObject = __webpack_require__(11);
|
9111 | var isSymbol = __webpack_require__(97);
|
9112 | var getMethod = __webpack_require__(123);
|
9113 | var ordinaryToPrimitive = __webpack_require__(288);
|
9114 | var wellKnownSymbol = __webpack_require__(9);
|
9115 |
|
9116 | var $TypeError = TypeError;
|
9117 | var TO_PRIMITIVE = wellKnownSymbol('toPrimitive');
|
9118 |
|
9119 |
|
9120 |
|
9121 | module.exports = function (input, pref) {
|
9122 | if (!isObject(input) || isSymbol(input)) return input;
|
9123 | var exoticToPrim = getMethod(input, TO_PRIMITIVE);
|
9124 | var result;
|
9125 | if (exoticToPrim) {
|
9126 | if (pref === undefined) pref = 'default';
|
9127 | result = call(exoticToPrim, input, pref);
|
9128 | if (!isObject(result) || isSymbol(result)) return result;
|
9129 | throw $TypeError("Can't convert object to primitive value");
|
9130 | }
|
9131 | if (pref === undefined) pref = 'number';
|
9132 | return ordinaryToPrimitive(input, pref);
|
9133 | };
|
9134 |
|
9135 |
|
9136 | }),
|
9137 |
|
9138 | (function(module, exports, __webpack_require__) {
|
9139 |
|
9140 | var call = __webpack_require__(15);
|
9141 | var isCallable = __webpack_require__(8);
|
9142 | var isObject = __webpack_require__(11);
|
9143 |
|
9144 | var $TypeError = TypeError;
|
9145 |
|
9146 |
|
9147 |
|
9148 | module.exports = function (input, pref) {
|
9149 | var fn, val;
|
9150 | if (pref === 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val;
|
9151 | if (isCallable(fn = input.valueOf) && !isObject(val = call(fn, input))) return val;
|
9152 | if (pref !== 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val;
|
9153 | throw $TypeError("Can't convert object to primitive value");
|
9154 | };
|
9155 |
|
9156 |
|
9157 | }),
|
9158 |
|
9159 | (function(module, exports, __webpack_require__) {
|
9160 |
|
9161 | var global = __webpack_require__(7);
|
9162 |
|
9163 |
|
9164 | var defineProperty = Object.defineProperty;
|
9165 |
|
9166 | module.exports = function (key, value) {
|
9167 | try {
|
9168 | defineProperty(global, key, { value: value, configurable: true, writable: true });
|
9169 | } catch (error) {
|
9170 | global[key] = value;
|
9171 | } return value;
|
9172 | };
|
9173 |
|
9174 |
|
9175 | }),
|
9176 |
|
9177 | (function(module, exports, __webpack_require__) {
|
9178 |
|
9179 | var isCallable = __webpack_require__(8);
|
9180 |
|
9181 | var $String = String;
|
9182 | var $TypeError = TypeError;
|
9183 |
|
9184 | module.exports = function (argument) {
|
9185 | if (typeof argument == 'object' || isCallable(argument)) return argument;
|
9186 | throw $TypeError("Can't set " + $String(argument) + ' as a prototype');
|
9187 | };
|
9188 |
|
9189 |
|
9190 | }),
|
9191 |
|
9192 | (function(module, exports, __webpack_require__) {
|
9193 |
|
9194 | var hasOwn = __webpack_require__(13);
|
9195 | var ownKeys = __webpack_require__(163);
|
9196 | var getOwnPropertyDescriptorModule = __webpack_require__(62);
|
9197 | var definePropertyModule = __webpack_require__(23);
|
9198 |
|
9199 | module.exports = function (target, source, exceptions) {
|
9200 | var keys = ownKeys(source);
|
9201 | var defineProperty = definePropertyModule.f;
|
9202 | var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
|
9203 | for (var i = 0; i < keys.length; i++) {
|
9204 | var key = keys[i];
|
9205 | if (!hasOwn(target, key) && !(exceptions && hasOwn(exceptions, key))) {
|
9206 | defineProperty(target, key, getOwnPropertyDescriptor(source, key));
|
9207 | }
|
9208 | }
|
9209 | };
|
9210 |
|
9211 |
|
9212 | }),
|
9213 |
|
9214 | (function(module, exports) {
|
9215 |
|
9216 | var ceil = Math.ceil;
|
9217 | var floor = Math.floor;
|
9218 |
|
9219 |
|
9220 |
|
9221 |
|
9222 | module.exports = Math.trunc || function trunc(x) {
|
9223 | var n = +x;
|
9224 | return (n > 0 ? floor : ceil)(n);
|
9225 | };
|
9226 |
|
9227 |
|
9228 | }),
|
9229 |
|
9230 | (function(module, exports, __webpack_require__) {
|
9231 |
|
9232 | var toIntegerOrInfinity = __webpack_require__(127);
|
9233 |
|
9234 | var min = Math.min;
|
9235 |
|
9236 |
|
9237 |
|
9238 | module.exports = function (argument) {
|
9239 | return argument > 0 ? min(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0;
|
9240 | };
|
9241 |
|
9242 |
|
9243 | }),
|
9244 |
|
9245 | (function(module, exports, __webpack_require__) {
|
9246 |
|
9247 | var uncurryThis = __webpack_require__(4);
|
9248 |
|
9249 | var $Error = Error;
|
9250 | var replace = uncurryThis(''.replace);
|
9251 |
|
9252 | var TEST = (function (arg) { return String($Error(arg).stack); })('zxcasd');
|
9253 | var V8_OR_CHAKRA_STACK_ENTRY = /\n\s*at [^:]*:[^\n]*/;
|
9254 | var IS_V8_OR_CHAKRA_STACK = V8_OR_CHAKRA_STACK_ENTRY.test(TEST);
|
9255 |
|
9256 | module.exports = function (stack, dropEntries) {
|
9257 | if (IS_V8_OR_CHAKRA_STACK && typeof stack == 'string' && !$Error.prepareStackTrace) {
|
9258 | while (dropEntries--) stack = replace(stack, V8_OR_CHAKRA_STACK_ENTRY, '');
|
9259 | } return stack;
|
9260 | };
|
9261 |
|
9262 |
|
9263 | }),
|
9264 |
|
9265 | (function(module, exports, __webpack_require__) {
|
9266 |
|
9267 | var isObject = __webpack_require__(11);
|
9268 | var createNonEnumerableProperty = __webpack_require__(37);
|
9269 |
|
9270 |
|
9271 |
|
9272 | module.exports = function (O, options) {
|
9273 | if (isObject(options) && 'cause' in options) {
|
9274 | createNonEnumerableProperty(O, 'cause', options.cause);
|
9275 | }
|
9276 | };
|
9277 |
|
9278 |
|
9279 | }),
|
9280 |
|
9281 | (function(module, exports, __webpack_require__) {
|
9282 |
|
9283 | var toString = __webpack_require__(81);
|
9284 |
|
9285 | module.exports = function (argument, $default) {
|
9286 | return argument === undefined ? arguments.length < 2 ? '' : $default : toString(argument);
|
9287 | };
|
9288 |
|
9289 |
|
9290 | }),
|
9291 |
|
9292 | (function(module, exports, __webpack_require__) {
|
9293 |
|
9294 | var fails = __webpack_require__(2);
|
9295 | var createPropertyDescriptor = __webpack_require__(47);
|
9296 |
|
9297 | module.exports = !fails(function () {
|
9298 | var error = Error('a');
|
9299 | if (!('stack' in error)) return true;
|
9300 |
|
9301 | Object.defineProperty(error, 'stack', createPropertyDescriptor(1, 7));
|
9302 | return error.stack !== 7;
|
9303 | });
|
9304 |
|
9305 |
|
9306 | }),
|
9307 |
|
9308 | (function(module, exports, __webpack_require__) {
|
9309 |
|
9310 | var DESCRIPTORS = __webpack_require__(14);
|
9311 | var hasOwn = __webpack_require__(13);
|
9312 |
|
9313 | var FunctionPrototype = Function.prototype;
|
9314 |
|
9315 | var getDescriptor = DESCRIPTORS && Object.getOwnPropertyDescriptor;
|
9316 |
|
9317 | var EXISTS = hasOwn(FunctionPrototype, 'name');
|
9318 |
|
9319 | var PROPER = EXISTS && (function something() { }).name === 'something';
|
9320 | var CONFIGURABLE = EXISTS && (!DESCRIPTORS || (DESCRIPTORS && getDescriptor(FunctionPrototype, 'name').configurable));
|
9321 |
|
9322 | module.exports = {
|
9323 | EXISTS: EXISTS,
|
9324 | PROPER: PROPER,
|
9325 | CONFIGURABLE: CONFIGURABLE
|
9326 | };
|
9327 |
|
9328 |
|
9329 | }),
|
9330 |
|
9331 | (function(module, exports, __webpack_require__) {
|
9332 |
|
9333 | "use strict";
|
9334 |
|
9335 | var IteratorPrototype = __webpack_require__(172).IteratorPrototype;
|
9336 | var create = __webpack_require__(49);
|
9337 | var createPropertyDescriptor = __webpack_require__(47);
|
9338 | var setToStringTag = __webpack_require__(52);
|
9339 | var Iterators = __webpack_require__(50);
|
9340 |
|
9341 | var returnThis = function () { return this; };
|
9342 |
|
9343 | module.exports = function (IteratorConstructor, NAME, next, ENUMERABLE_NEXT) {
|
9344 | var TO_STRING_TAG = NAME + ' Iterator';
|
9345 | IteratorConstructor.prototype = create(IteratorPrototype, { next: createPropertyDescriptor(+!ENUMERABLE_NEXT, next) });
|
9346 | setToStringTag(IteratorConstructor, TO_STRING_TAG, false, true);
|
9347 | Iterators[TO_STRING_TAG] = returnThis;
|
9348 | return IteratorConstructor;
|
9349 | };
|
9350 |
|
9351 |
|
9352 | }),
|
9353 |
|
9354 | (function(module, exports, __webpack_require__) {
|
9355 |
|
9356 | "use strict";
|
9357 |
|
9358 | var TO_STRING_TAG_SUPPORT = __webpack_require__(130);
|
9359 | var classof = __webpack_require__(51);
|
9360 |
|
9361 |
|
9362 |
|
9363 | module.exports = TO_STRING_TAG_SUPPORT ? {}.toString : function toString() {
|
9364 | return '[object ' + classof(this) + ']';
|
9365 | };
|
9366 |
|
9367 |
|
9368 | }),
|
9369 |
|
9370 | (function(module, exports, __webpack_require__) {
|
9371 |
|
9372 |
|
9373 | __webpack_require__(302);
|
9374 | __webpack_require__(310);
|
9375 | __webpack_require__(311);
|
9376 | __webpack_require__(312);
|
9377 | __webpack_require__(313);
|
9378 | __webpack_require__(314);
|
9379 |
|
9380 |
|
9381 | }),
|
9382 |
|
9383 | (function(module, exports, __webpack_require__) {
|
9384 |
|
9385 | "use strict";
|
9386 |
|
9387 | var $ = __webpack_require__(0);
|
9388 | var IS_PURE = __webpack_require__(33);
|
9389 | var IS_NODE = __webpack_require__(107);
|
9390 | var global = __webpack_require__(7);
|
9391 | var call = __webpack_require__(15);
|
9392 | var defineBuiltIn = __webpack_require__(44);
|
9393 | var setPrototypeOf = __webpack_require__(102);
|
9394 | var setToStringTag = __webpack_require__(52);
|
9395 | var setSpecies = __webpack_require__(173);
|
9396 | var aCallable = __webpack_require__(31);
|
9397 | var isCallable = __webpack_require__(8);
|
9398 | var isObject = __webpack_require__(11);
|
9399 | var anInstance = __webpack_require__(108);
|
9400 | var speciesConstructor = __webpack_require__(174);
|
9401 | var task = __webpack_require__(176).set;
|
9402 | var microtask = __webpack_require__(304);
|
9403 | var hostReportErrors = __webpack_require__(307);
|
9404 | var perform = __webpack_require__(82);
|
9405 | var Queue = __webpack_require__(308);
|
9406 | var InternalStateModule = __webpack_require__(43);
|
9407 | var NativePromiseConstructor = __webpack_require__(65);
|
9408 | var PromiseConstructorDetection = __webpack_require__(83);
|
9409 | var newPromiseCapabilityModule = __webpack_require__(54);
|
9410 |
|
9411 | var PROMISE = 'Promise';
|
9412 | var FORCED_PROMISE_CONSTRUCTOR = PromiseConstructorDetection.CONSTRUCTOR;
|
9413 | var NATIVE_PROMISE_REJECTION_EVENT = PromiseConstructorDetection.REJECTION_EVENT;
|
9414 | var NATIVE_PROMISE_SUBCLASSING = PromiseConstructorDetection.SUBCLASSING;
|
9415 | var getInternalPromiseState = InternalStateModule.getterFor(PROMISE);
|
9416 | var setInternalState = InternalStateModule.set;
|
9417 | var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;
|
9418 | var PromiseConstructor = NativePromiseConstructor;
|
9419 | var PromisePrototype = NativePromisePrototype;
|
9420 | var TypeError = global.TypeError;
|
9421 | var document = global.document;
|
9422 | var process = global.process;
|
9423 | var newPromiseCapability = newPromiseCapabilityModule.f;
|
9424 | var newGenericPromiseCapability = newPromiseCapability;
|
9425 |
|
9426 | var DISPATCH_EVENT = !!(document && document.createEvent && global.dispatchEvent);
|
9427 | var UNHANDLED_REJECTION = 'unhandledrejection';
|
9428 | var REJECTION_HANDLED = 'rejectionhandled';
|
9429 | var PENDING = 0;
|
9430 | var FULFILLED = 1;
|
9431 | var REJECTED = 2;
|
9432 | var HANDLED = 1;
|
9433 | var UNHANDLED = 2;
|
9434 |
|
9435 | var Internal, OwnPromiseCapability, PromiseWrapper, nativeThen;
|
9436 |
|
9437 |
|
9438 | var isThenable = function (it) {
|
9439 | var then;
|
9440 | return isObject(it) && isCallable(then = it.then) ? then : false;
|
9441 | };
|
9442 |
|
9443 | var callReaction = function (reaction, state) {
|
9444 | var value = state.value;
|
9445 | var ok = state.state == FULFILLED;
|
9446 | var handler = ok ? reaction.ok : reaction.fail;
|
9447 | var resolve = reaction.resolve;
|
9448 | var reject = reaction.reject;
|
9449 | var domain = reaction.domain;
|
9450 | var result, then, exited;
|
9451 | try {
|
9452 | if (handler) {
|
9453 | if (!ok) {
|
9454 | if (state.rejection === UNHANDLED) onHandleUnhandled(state);
|
9455 | state.rejection = HANDLED;
|
9456 | }
|
9457 | if (handler === true) result = value;
|
9458 | else {
|
9459 | if (domain) domain.enter();
|
9460 | result = handler(value);
|
9461 | if (domain) {
|
9462 | domain.exit();
|
9463 | exited = true;
|
9464 | }
|
9465 | }
|
9466 | if (result === reaction.promise) {
|
9467 | reject(TypeError('Promise-chain cycle'));
|
9468 | } else if (then = isThenable(result)) {
|
9469 | call(then, result, resolve, reject);
|
9470 | } else resolve(result);
|
9471 | } else reject(value);
|
9472 | } catch (error) {
|
9473 | if (domain && !exited) domain.exit();
|
9474 | reject(error);
|
9475 | }
|
9476 | };
|
9477 |
|
9478 | var notify = function (state, isReject) {
|
9479 | if (state.notified) return;
|
9480 | state.notified = true;
|
9481 | microtask(function () {
|
9482 | var reactions = state.reactions;
|
9483 | var reaction;
|
9484 | while (reaction = reactions.get()) {
|
9485 | callReaction(reaction, state);
|
9486 | }
|
9487 | state.notified = false;
|
9488 | if (isReject && !state.rejection) onUnhandled(state);
|
9489 | });
|
9490 | };
|
9491 |
|
9492 | var dispatchEvent = function (name, promise, reason) {
|
9493 | var event, handler;
|
9494 | if (DISPATCH_EVENT) {
|
9495 | event = document.createEvent('Event');
|
9496 | event.promise = promise;
|
9497 | event.reason = reason;
|
9498 | event.initEvent(name, false, true);
|
9499 | global.dispatchEvent(event);
|
9500 | } else event = { promise: promise, reason: reason };
|
9501 | if (!NATIVE_PROMISE_REJECTION_EVENT && (handler = global['on' + name])) handler(event);
|
9502 | else if (name === UNHANDLED_REJECTION) hostReportErrors('Unhandled promise rejection', reason);
|
9503 | };
|
9504 |
|
9505 | var onUnhandled = function (state) {
|
9506 | call(task, global, function () {
|
9507 | var promise = state.facade;
|
9508 | var value = state.value;
|
9509 | var IS_UNHANDLED = isUnhandled(state);
|
9510 | var result;
|
9511 | if (IS_UNHANDLED) {
|
9512 | result = perform(function () {
|
9513 | if (IS_NODE) {
|
9514 | process.emit('unhandledRejection', value, promise);
|
9515 | } else dispatchEvent(UNHANDLED_REJECTION, promise, value);
|
9516 | });
|
9517 |
|
9518 | state.rejection = IS_NODE || isUnhandled(state) ? UNHANDLED : HANDLED;
|
9519 | if (result.error) throw result.value;
|
9520 | }
|
9521 | });
|
9522 | };
|
9523 |
|
9524 | var isUnhandled = function (state) {
|
9525 | return state.rejection !== HANDLED && !state.parent;
|
9526 | };
|
9527 |
|
9528 | var onHandleUnhandled = function (state) {
|
9529 | call(task, global, function () {
|
9530 | var promise = state.facade;
|
9531 | if (IS_NODE) {
|
9532 | process.emit('rejectionHandled', promise);
|
9533 | } else dispatchEvent(REJECTION_HANDLED, promise, state.value);
|
9534 | });
|
9535 | };
|
9536 |
|
9537 | var bind = function (fn, state, unwrap) {
|
9538 | return function (value) {
|
9539 | fn(state, value, unwrap);
|
9540 | };
|
9541 | };
|
9542 |
|
9543 | var internalReject = function (state, value, unwrap) {
|
9544 | if (state.done) return;
|
9545 | state.done = true;
|
9546 | if (unwrap) state = unwrap;
|
9547 | state.value = value;
|
9548 | state.state = REJECTED;
|
9549 | notify(state, true);
|
9550 | };
|
9551 |
|
9552 | var internalResolve = function (state, value, unwrap) {
|
9553 | if (state.done) return;
|
9554 | state.done = true;
|
9555 | if (unwrap) state = unwrap;
|
9556 | try {
|
9557 | if (state.facade === value) throw TypeError("Promise can't be resolved itself");
|
9558 | var then = isThenable(value);
|
9559 | if (then) {
|
9560 | microtask(function () {
|
9561 | var wrapper = { done: false };
|
9562 | try {
|
9563 | call(then, value,
|
9564 | bind(internalResolve, wrapper, state),
|
9565 | bind(internalReject, wrapper, state)
|
9566 | );
|
9567 | } catch (error) {
|
9568 | internalReject(wrapper, error, state);
|
9569 | }
|
9570 | });
|
9571 | } else {
|
9572 | state.value = value;
|
9573 | state.state = FULFILLED;
|
9574 | notify(state, false);
|
9575 | }
|
9576 | } catch (error) {
|
9577 | internalReject({ done: false }, error, state);
|
9578 | }
|
9579 | };
|
9580 |
|
9581 |
|
9582 | if (FORCED_PROMISE_CONSTRUCTOR) {
|
9583 |
|
9584 | PromiseConstructor = function Promise(executor) {
|
9585 | anInstance(this, PromisePrototype);
|
9586 | aCallable(executor);
|
9587 | call(Internal, this);
|
9588 | var state = getInternalPromiseState(this);
|
9589 | try {
|
9590 | executor(bind(internalResolve, state), bind(internalReject, state));
|
9591 | } catch (error) {
|
9592 | internalReject(state, error);
|
9593 | }
|
9594 | };
|
9595 |
|
9596 | PromisePrototype = PromiseConstructor.prototype;
|
9597 |
|
9598 |
|
9599 | Internal = function Promise(executor) {
|
9600 | setInternalState(this, {
|
9601 | type: PROMISE,
|
9602 | done: false,
|
9603 | notified: false,
|
9604 | parent: false,
|
9605 | reactions: new Queue(),
|
9606 | rejection: false,
|
9607 | state: PENDING,
|
9608 | value: undefined
|
9609 | });
|
9610 | };
|
9611 |
|
9612 |
|
9613 |
|
9614 | Internal.prototype = defineBuiltIn(PromisePrototype, 'then', function then(onFulfilled, onRejected) {
|
9615 | var state = getInternalPromiseState(this);
|
9616 | var reaction = newPromiseCapability(speciesConstructor(this, PromiseConstructor));
|
9617 | state.parent = true;
|
9618 | reaction.ok = isCallable(onFulfilled) ? onFulfilled : true;
|
9619 | reaction.fail = isCallable(onRejected) && onRejected;
|
9620 | reaction.domain = IS_NODE ? process.domain : undefined;
|
9621 | if (state.state == PENDING) state.reactions.add(reaction);
|
9622 | else microtask(function () {
|
9623 | callReaction(reaction, state);
|
9624 | });
|
9625 | return reaction.promise;
|
9626 | });
|
9627 |
|
9628 | OwnPromiseCapability = function () {
|
9629 | var promise = new Internal();
|
9630 | var state = getInternalPromiseState(promise);
|
9631 | this.promise = promise;
|
9632 | this.resolve = bind(internalResolve, state);
|
9633 | this.reject = bind(internalReject, state);
|
9634 | };
|
9635 |
|
9636 | newPromiseCapabilityModule.f = newPromiseCapability = function (C) {
|
9637 | return C === PromiseConstructor || C === PromiseWrapper
|
9638 | ? new OwnPromiseCapability(C)
|
9639 | : newGenericPromiseCapability(C);
|
9640 | };
|
9641 |
|
9642 | if (!IS_PURE && isCallable(NativePromiseConstructor) && NativePromisePrototype !== Object.prototype) {
|
9643 | nativeThen = NativePromisePrototype.then;
|
9644 |
|
9645 | if (!NATIVE_PROMISE_SUBCLASSING) {
|
9646 |
|
9647 | defineBuiltIn(NativePromisePrototype, 'then', function then(onFulfilled, onRejected) {
|
9648 | var that = this;
|
9649 | return new PromiseConstructor(function (resolve, reject) {
|
9650 | call(nativeThen, that, resolve, reject);
|
9651 | }).then(onFulfilled, onRejected);
|
9652 |
|
9653 | }, { unsafe: true });
|
9654 | }
|
9655 |
|
9656 |
|
9657 | try {
|
9658 | delete NativePromisePrototype.constructor;
|
9659 | } catch (error) { }
|
9660 |
|
9661 |
|
9662 | if (setPrototypeOf) {
|
9663 | setPrototypeOf(NativePromisePrototype, PromisePrototype);
|
9664 | }
|
9665 | }
|
9666 | }
|
9667 |
|
9668 | $({ global: true, constructor: true, wrap: true, forced: FORCED_PROMISE_CONSTRUCTOR }, {
|
9669 | Promise: PromiseConstructor
|
9670 | });
|
9671 |
|
9672 | setToStringTag(PromiseConstructor, PROMISE, false, true);
|
9673 | setSpecies(PROMISE);
|
9674 |
|
9675 |
|
9676 | }),
|
9677 |
|
9678 | (function(module, exports) {
|
9679 |
|
9680 | var $TypeError = TypeError;
|
9681 |
|
9682 | module.exports = function (passed, required) {
|
9683 | if (passed < required) throw $TypeError('Not enough arguments');
|
9684 | return passed;
|
9685 | };
|
9686 |
|
9687 |
|
9688 | }),
|
9689 |
|
9690 | (function(module, exports, __webpack_require__) {
|
9691 |
|
9692 | var global = __webpack_require__(7);
|
9693 | var bind = __webpack_require__(48);
|
9694 | var getOwnPropertyDescriptor = __webpack_require__(62).f;
|
9695 | var macrotask = __webpack_require__(176).set;
|
9696 | var IS_IOS = __webpack_require__(177);
|
9697 | var IS_IOS_PEBBLE = __webpack_require__(305);
|
9698 | var IS_WEBOS_WEBKIT = __webpack_require__(306);
|
9699 | var IS_NODE = __webpack_require__(107);
|
9700 |
|
9701 | var MutationObserver = global.MutationObserver || global.WebKitMutationObserver;
|
9702 | var document = global.document;
|
9703 | var process = global.process;
|
9704 | var Promise = global.Promise;
|
9705 |
|
9706 | var queueMicrotaskDescriptor = getOwnPropertyDescriptor(global, 'queueMicrotask');
|
9707 | var queueMicrotask = queueMicrotaskDescriptor && queueMicrotaskDescriptor.value;
|
9708 |
|
9709 | var flush, head, last, notify, toggle, node, promise, then;
|
9710 |
|
9711 |
|
9712 | if (!queueMicrotask) {
|
9713 | flush = function () {
|
9714 | var parent, fn;
|
9715 | if (IS_NODE && (parent = process.domain)) parent.exit();
|
9716 | while (head) {
|
9717 | fn = head.fn;
|
9718 | head = head.next;
|
9719 | try {
|
9720 | fn();
|
9721 | } catch (error) {
|
9722 | if (head) notify();
|
9723 | else last = undefined;
|
9724 | throw error;
|
9725 | }
|
9726 | } last = undefined;
|
9727 | if (parent) parent.enter();
|
9728 | };
|
9729 |
|
9730 |
|
9731 |
|
9732 | if (!IS_IOS && !IS_NODE && !IS_WEBOS_WEBKIT && MutationObserver && document) {
|
9733 | toggle = true;
|
9734 | node = document.createTextNode('');
|
9735 | new MutationObserver(flush).observe(node, { characterData: true });
|
9736 | notify = function () {
|
9737 | node.data = toggle = !toggle;
|
9738 | };
|
9739 |
|
9740 | } else if (!IS_IOS_PEBBLE && Promise && Promise.resolve) {
|
9741 |
|
9742 | promise = Promise.resolve(undefined);
|
9743 |
|
9744 | promise.constructor = Promise;
|
9745 | then = bind(promise.then, promise);
|
9746 | notify = function () {
|
9747 | then(flush);
|
9748 | };
|
9749 |
|
9750 | } else if (IS_NODE) {
|
9751 | notify = function () {
|
9752 | process.nextTick(flush);
|
9753 | };
|
9754 |
|
9755 |
|
9756 |
|
9757 |
|
9758 |
|
9759 |
|
9760 | } else {
|
9761 |
|
9762 | macrotask = bind(macrotask, global);
|
9763 | notify = function () {
|
9764 | macrotask(flush);
|
9765 | };
|
9766 | }
|
9767 | }
|
9768 |
|
9769 | module.exports = queueMicrotask || function (fn) {
|
9770 | var task = { fn: fn, next: undefined };
|
9771 | if (last) last.next = task;
|
9772 | if (!head) {
|
9773 | head = task;
|
9774 | notify();
|
9775 | } last = task;
|
9776 | };
|
9777 |
|
9778 |
|
9779 | }),
|
9780 |
|
9781 | (function(module, exports, __webpack_require__) {
|
9782 |
|
9783 | var userAgent = __webpack_require__(98);
|
9784 | var global = __webpack_require__(7);
|
9785 |
|
9786 | module.exports = /ipad|iphone|ipod/i.test(userAgent) && global.Pebble !== undefined;
|
9787 |
|
9788 |
|
9789 | }),
|
9790 |
|
9791 | (function(module, exports, __webpack_require__) {
|
9792 |
|
9793 | var userAgent = __webpack_require__(98);
|
9794 |
|
9795 | module.exports = /web0s(?!.*chrome)/i.test(userAgent);
|
9796 |
|
9797 |
|
9798 | }),
|
9799 |
|
9800 | (function(module, exports, __webpack_require__) {
|
9801 |
|
9802 | var global = __webpack_require__(7);
|
9803 |
|
9804 | module.exports = function (a, b) {
|
9805 | var console = global.console;
|
9806 | if (console && console.error) {
|
9807 | arguments.length == 1 ? console.error(a) : console.error(a, b);
|
9808 | }
|
9809 | };
|
9810 |
|
9811 |
|
9812 | }),
|
9813 |
|
9814 | (function(module, exports) {
|
9815 |
|
9816 | var Queue = function () {
|
9817 | this.head = null;
|
9818 | this.tail = null;
|
9819 | };
|
9820 |
|
9821 | Queue.prototype = {
|
9822 | add: function (item) {
|
9823 | var entry = { item: item, next: null };
|
9824 | if (this.head) this.tail.next = entry;
|
9825 | else this.head = entry;
|
9826 | this.tail = entry;
|
9827 | },
|
9828 | get: function () {
|
9829 | var entry = this.head;
|
9830 | if (entry) {
|
9831 | this.head = entry.next;
|
9832 | if (this.tail === entry) this.tail = null;
|
9833 | return entry.item;
|
9834 | }
|
9835 | }
|
9836 | };
|
9837 |
|
9838 | module.exports = Queue;
|
9839 |
|
9840 |
|
9841 | }),
|
9842 |
|
9843 | (function(module, exports) {
|
9844 |
|
9845 | module.exports = typeof window == 'object' && typeof Deno != 'object';
|
9846 |
|
9847 |
|
9848 | }),
|
9849 |
|
9850 | (function(module, exports, __webpack_require__) {
|
9851 |
|
9852 | "use strict";
|
9853 |
|
9854 | var $ = __webpack_require__(0);
|
9855 | var call = __webpack_require__(15);
|
9856 | var aCallable = __webpack_require__(31);
|
9857 | var newPromiseCapabilityModule = __webpack_require__(54);
|
9858 | var perform = __webpack_require__(82);
|
9859 | var iterate = __webpack_require__(42);
|
9860 | var PROMISE_STATICS_INCORRECT_ITERATION = __webpack_require__(178);
|
9861 |
|
9862 |
|
9863 |
|
9864 | $({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION }, {
|
9865 | all: function all(iterable) {
|
9866 | var C = this;
|
9867 | var capability = newPromiseCapabilityModule.f(C);
|
9868 | var resolve = capability.resolve;
|
9869 | var reject = capability.reject;
|
9870 | var result = perform(function () {
|
9871 | var $promiseResolve = aCallable(C.resolve);
|
9872 | var values = [];
|
9873 | var counter = 0;
|
9874 | var remaining = 1;
|
9875 | iterate(iterable, function (promise) {
|
9876 | var index = counter++;
|
9877 | var alreadyCalled = false;
|
9878 | remaining++;
|
9879 | call($promiseResolve, C, promise).then(function (value) {
|
9880 | if (alreadyCalled) return;
|
9881 | alreadyCalled = true;
|
9882 | values[index] = value;
|
9883 | --remaining || resolve(values);
|
9884 | }, reject);
|
9885 | });
|
9886 | --remaining || resolve(values);
|
9887 | });
|
9888 | if (result.error) reject(result.value);
|
9889 | return capability.promise;
|
9890 | }
|
9891 | });
|
9892 |
|
9893 |
|
9894 | }),
|
9895 |
|
9896 | (function(module, exports, __webpack_require__) {
|
9897 |
|
9898 | "use strict";
|
9899 |
|
9900 | var $ = __webpack_require__(0);
|
9901 | var IS_PURE = __webpack_require__(33);
|
9902 | var FORCED_PROMISE_CONSTRUCTOR = __webpack_require__(83).CONSTRUCTOR;
|
9903 | var NativePromiseConstructor = __webpack_require__(65);
|
9904 | var getBuiltIn = __webpack_require__(18);
|
9905 | var isCallable = __webpack_require__(8);
|
9906 | var defineBuiltIn = __webpack_require__(44);
|
9907 |
|
9908 | var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;
|
9909 |
|
9910 |
|
9911 |
|
9912 | $({ target: 'Promise', proto: true, forced: FORCED_PROMISE_CONSTRUCTOR, real: true }, {
|
9913 | 'catch': function (onRejected) {
|
9914 | return this.then(undefined, onRejected);
|
9915 | }
|
9916 | });
|
9917 |
|
9918 |
|
9919 | if (!IS_PURE && isCallable(NativePromiseConstructor)) {
|
9920 | var method = getBuiltIn('Promise').prototype['catch'];
|
9921 | if (NativePromisePrototype['catch'] !== method) {
|
9922 | defineBuiltIn(NativePromisePrototype, 'catch', method, { unsafe: true });
|
9923 | }
|
9924 | }
|
9925 |
|
9926 |
|
9927 | }),
|
9928 |
|
9929 | (function(module, exports, __webpack_require__) {
|
9930 |
|
9931 | "use strict";
|
9932 |
|
9933 | var $ = __webpack_require__(0);
|
9934 | var call = __webpack_require__(15);
|
9935 | var aCallable = __webpack_require__(31);
|
9936 | var newPromiseCapabilityModule = __webpack_require__(54);
|
9937 | var perform = __webpack_require__(82);
|
9938 | var iterate = __webpack_require__(42);
|
9939 | var PROMISE_STATICS_INCORRECT_ITERATION = __webpack_require__(178);
|
9940 |
|
9941 |
|
9942 |
|
9943 | $({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION }, {
|
9944 | race: function race(iterable) {
|
9945 | var C = this;
|
9946 | var capability = newPromiseCapabilityModule.f(C);
|
9947 | var reject = capability.reject;
|
9948 | var result = perform(function () {
|
9949 | var $promiseResolve = aCallable(C.resolve);
|
9950 | iterate(iterable, function (promise) {
|
9951 | call($promiseResolve, C, promise).then(capability.resolve, reject);
|
9952 | });
|
9953 | });
|
9954 | if (result.error) reject(result.value);
|
9955 | return capability.promise;
|
9956 | }
|
9957 | });
|
9958 |
|
9959 |
|
9960 | }),
|
9961 |
|
9962 | (function(module, exports, __webpack_require__) {
|
9963 |
|
9964 | "use strict";
|
9965 |
|
9966 | var $ = __webpack_require__(0);
|
9967 | var call = __webpack_require__(15);
|
9968 | var newPromiseCapabilityModule = __webpack_require__(54);
|
9969 | var FORCED_PROMISE_CONSTRUCTOR = __webpack_require__(83).CONSTRUCTOR;
|
9970 |
|
9971 |
|
9972 |
|
9973 | $({ target: 'Promise', stat: true, forced: FORCED_PROMISE_CONSTRUCTOR }, {
|
9974 | reject: function reject(r) {
|
9975 | var capability = newPromiseCapabilityModule.f(this);
|
9976 | call(capability.reject, undefined, r);
|
9977 | return capability.promise;
|
9978 | }
|
9979 | });
|
9980 |
|
9981 |
|
9982 | }),
|
9983 |
|
9984 | (function(module, exports, __webpack_require__) {
|
9985 |
|
9986 | "use strict";
|
9987 |
|
9988 | var $ = __webpack_require__(0);
|
9989 | var getBuiltIn = __webpack_require__(18);
|
9990 | var IS_PURE = __webpack_require__(33);
|
9991 | var NativePromiseConstructor = __webpack_require__(65);
|
9992 | var FORCED_PROMISE_CONSTRUCTOR = __webpack_require__(83).CONSTRUCTOR;
|
9993 | var promiseResolve = __webpack_require__(180);
|
9994 |
|
9995 | var PromiseConstructorWrapper = getBuiltIn('Promise');
|
9996 | var CHECK_WRAPPER = IS_PURE && !FORCED_PROMISE_CONSTRUCTOR;
|
9997 |
|
9998 |
|
9999 |
|
10000 | $({ target: 'Promise', stat: true, forced: IS_PURE || FORCED_PROMISE_CONSTRUCTOR }, {
|
10001 | resolve: function resolve(x) {
|
10002 | return promiseResolve(CHECK_WRAPPER && this === PromiseConstructorWrapper ? NativePromiseConstructor : this, x);
|
10003 | }
|
10004 | });
|
10005 |
|
10006 |
|
10007 | }),
|
10008 |
|
10009 | (function(module, exports, __webpack_require__) {
|
10010 |
|
10011 | "use strict";
|
10012 |
|
10013 | var $ = __webpack_require__(0);
|
10014 | var call = __webpack_require__(15);
|
10015 | var aCallable = __webpack_require__(31);
|
10016 | var newPromiseCapabilityModule = __webpack_require__(54);
|
10017 | var perform = __webpack_require__(82);
|
10018 | var iterate = __webpack_require__(42);
|
10019 |
|
10020 |
|
10021 |
|
10022 | $({ target: 'Promise', stat: true }, {
|
10023 | allSettled: function allSettled(iterable) {
|
10024 | var C = this;
|
10025 | var capability = newPromiseCapabilityModule.f(C);
|
10026 | var resolve = capability.resolve;
|
10027 | var reject = capability.reject;
|
10028 | var result = perform(function () {
|
10029 | var promiseResolve = aCallable(C.resolve);
|
10030 | var values = [];
|
10031 | var counter = 0;
|
10032 | var remaining = 1;
|
10033 | iterate(iterable, function (promise) {
|
10034 | var index = counter++;
|
10035 | var alreadyCalled = false;
|
10036 | remaining++;
|
10037 | call(promiseResolve, C, promise).then(function (value) {
|
10038 | if (alreadyCalled) return;
|
10039 | alreadyCalled = true;
|
10040 | values[index] = { status: 'fulfilled', value: value };
|
10041 | --remaining || resolve(values);
|
10042 | }, function (error) {
|
10043 | if (alreadyCalled) return;
|
10044 | alreadyCalled = true;
|
10045 | values[index] = { status: 'rejected', reason: error };
|
10046 | --remaining || resolve(values);
|
10047 | });
|
10048 | });
|
10049 | --remaining || resolve(values);
|
10050 | });
|
10051 | if (result.error) reject(result.value);
|
10052 | return capability.promise;
|
10053 | }
|
10054 | });
|
10055 |
|
10056 |
|
10057 | }),
|
10058 |
|
10059 | (function(module, exports, __webpack_require__) {
|
10060 |
|
10061 | "use strict";
|
10062 |
|
10063 | var $ = __webpack_require__(0);
|
10064 | var call = __webpack_require__(15);
|
10065 | var aCallable = __webpack_require__(31);
|
10066 | var getBuiltIn = __webpack_require__(18);
|
10067 | var newPromiseCapabilityModule = __webpack_require__(54);
|
10068 | var perform = __webpack_require__(82);
|
10069 | var iterate = __webpack_require__(42);
|
10070 |
|
10071 | var PROMISE_ANY_ERROR = 'No one promise resolved';
|
10072 |
|
10073 |
|
10074 |
|
10075 | $({ target: 'Promise', stat: true }, {
|
10076 | any: function any(iterable) {
|
10077 | var C = this;
|
10078 | var AggregateError = getBuiltIn('AggregateError');
|
10079 | var capability = newPromiseCapabilityModule.f(C);
|
10080 | var resolve = capability.resolve;
|
10081 | var reject = capability.reject;
|
10082 | var result = perform(function () {
|
10083 | var promiseResolve = aCallable(C.resolve);
|
10084 | var errors = [];
|
10085 | var counter = 0;
|
10086 | var remaining = 1;
|
10087 | var alreadyResolved = false;
|
10088 | iterate(iterable, function (promise) {
|
10089 | var index = counter++;
|
10090 | var alreadyRejected = false;
|
10091 | remaining++;
|
10092 | call(promiseResolve, C, promise).then(function (value) {
|
10093 | if (alreadyRejected || alreadyResolved) return;
|
10094 | alreadyResolved = true;
|
10095 | resolve(value);
|
10096 | }, function (error) {
|
10097 | if (alreadyRejected || alreadyResolved) return;
|
10098 | alreadyRejected = true;
|
10099 | errors[index] = error;
|
10100 | --remaining || reject(new AggregateError(errors, PROMISE_ANY_ERROR));
|
10101 | });
|
10102 | });
|
10103 | --remaining || reject(new AggregateError(errors, PROMISE_ANY_ERROR));
|
10104 | });
|
10105 | if (result.error) reject(result.value);
|
10106 | return capability.promise;
|
10107 | }
|
10108 | });
|
10109 |
|
10110 |
|
10111 | }),
|
10112 |
|
10113 | (function(module, exports, __webpack_require__) {
|
10114 |
|
10115 | "use strict";
|
10116 |
|
10117 | var $ = __webpack_require__(0);
|
10118 | var IS_PURE = __webpack_require__(33);
|
10119 | var NativePromiseConstructor = __webpack_require__(65);
|
10120 | var fails = __webpack_require__(2);
|
10121 | var getBuiltIn = __webpack_require__(18);
|
10122 | var isCallable = __webpack_require__(8);
|
10123 | var speciesConstructor = __webpack_require__(174);
|
10124 | var promiseResolve = __webpack_require__(180);
|
10125 | var defineBuiltIn = __webpack_require__(44);
|
10126 |
|
10127 | var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;
|
10128 |
|
10129 |
|
10130 | var NON_GENERIC = !!NativePromiseConstructor && fails(function () {
|
10131 |
|
10132 | NativePromisePrototype['finally'].call({ then: function () { } }, function () { });
|
10133 | });
|
10134 |
|
10135 |
|
10136 |
|
10137 | $({ target: 'Promise', proto: true, real: true, forced: NON_GENERIC }, {
|
10138 | 'finally': function (onFinally) {
|
10139 | var C = speciesConstructor(this, getBuiltIn('Promise'));
|
10140 | var isFunction = isCallable(onFinally);
|
10141 | return this.then(
|
10142 | isFunction ? function (x) {
|
10143 | return promiseResolve(C, onFinally()).then(function () { return x; });
|
10144 | } : onFinally,
|
10145 | isFunction ? function (e) {
|
10146 | return promiseResolve(C, onFinally()).then(function () { throw e; });
|
10147 | } : onFinally
|
10148 | );
|
10149 | }
|
10150 | });
|
10151 |
|
10152 |
|
10153 | if (!IS_PURE && isCallable(NativePromiseConstructor)) {
|
10154 | var method = getBuiltIn('Promise').prototype['finally'];
|
10155 | if (NativePromisePrototype['finally'] !== method) {
|
10156 | defineBuiltIn(NativePromisePrototype, 'finally', method, { unsafe: true });
|
10157 | }
|
10158 | }
|
10159 |
|
10160 |
|
10161 | }),
|
10162 |
|
10163 | (function(module, exports, __webpack_require__) {
|
10164 |
|
10165 | var uncurryThis = __webpack_require__(4);
|
10166 | var toIntegerOrInfinity = __webpack_require__(127);
|
10167 | var toString = __webpack_require__(81);
|
10168 | var requireObjectCoercible = __webpack_require__(122);
|
10169 |
|
10170 | var charAt = uncurryThis(''.charAt);
|
10171 | var charCodeAt = uncurryThis(''.charCodeAt);
|
10172 | var stringSlice = uncurryThis(''.slice);
|
10173 |
|
10174 | var createMethod = function (CONVERT_TO_STRING) {
|
10175 | return function ($this, pos) {
|
10176 | var S = toString(requireObjectCoercible($this));
|
10177 | var position = toIntegerOrInfinity(pos);
|
10178 | var size = S.length;
|
10179 | var first, second;
|
10180 | if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
|
10181 | first = charCodeAt(S, position);
|
10182 | return first < 0xD800 || first > 0xDBFF || position + 1 === size
|
10183 | || (second = charCodeAt(S, position + 1)) < 0xDC00 || second > 0xDFFF
|
10184 | ? CONVERT_TO_STRING
|
10185 | ? charAt(S, position)
|
10186 | : first
|
10187 | : CONVERT_TO_STRING
|
10188 | ? stringSlice(S, position, position + 2)
|
10189 | : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
|
10190 | };
|
10191 | };
|
10192 |
|
10193 | module.exports = {
|
10194 |
|
10195 |
|
10196 | codeAt: createMethod(false),
|
10197 |
|
10198 |
|
10199 | charAt: createMethod(true)
|
10200 | };
|
10201 |
|
10202 |
|
10203 | }),
|
10204 |
|
10205 | (function(module, exports) {
|
10206 |
|
10207 |
|
10208 |
|
10209 | module.exports = {
|
10210 | CSSRuleList: 0,
|
10211 | CSSStyleDeclaration: 0,
|
10212 | CSSValueList: 0,
|
10213 | ClientRectList: 0,
|
10214 | DOMRectList: 0,
|
10215 | DOMStringList: 0,
|
10216 | DOMTokenList: 1,
|
10217 | DataTransferItemList: 0,
|
10218 | FileList: 0,
|
10219 | HTMLAllCollection: 0,
|
10220 | HTMLCollection: 0,
|
10221 | HTMLFormElement: 0,
|
10222 | HTMLSelectElement: 0,
|
10223 | MediaList: 0,
|
10224 | MimeTypeArray: 0,
|
10225 | NamedNodeMap: 0,
|
10226 | NodeList: 1,
|
10227 | PaintRequestList: 0,
|
10228 | Plugin: 0,
|
10229 | PluginArray: 0,
|
10230 | SVGLengthList: 0,
|
10231 | SVGNumberList: 0,
|
10232 | SVGPathSegList: 0,
|
10233 | SVGPointList: 0,
|
10234 | SVGStringList: 0,
|
10235 | SVGTransformList: 0,
|
10236 | SourceBufferList: 0,
|
10237 | StyleSheetList: 0,
|
10238 | TextTrackCueList: 0,
|
10239 | TextTrackList: 0,
|
10240 | TouchList: 0
|
10241 | };
|
10242 |
|
10243 |
|
10244 | }),
|
10245 |
|
10246 | (function(module, __webpack_exports__, __webpack_require__) {
|
10247 |
|
10248 | "use strict";
|
10249 | var __WEBPACK_IMPORTED_MODULE_0__index_js__ = __webpack_require__(133);
|
10250 |
|
10251 |
|
10252 |
|
10253 |
|
10254 |
|
10255 |
|
10256 |
|
10257 |
|
10258 |
|
10259 |
|
10260 |
|
10261 |
|
10262 |
|
10263 |
|
10264 |
|
10265 |
|
10266 |
|
10267 |
|
10268 |
|
10269 |
|
10270 |
|
10271 |
|
10272 | var _ = Object(__WEBPACK_IMPORTED_MODULE_0__index_js__["mixin"])(__WEBPACK_IMPORTED_MODULE_0__index_js__);
|
10273 |
|
10274 | _._ = _;
|
10275 |
|
10276 | __webpack_exports__["a"] = (_);
|
10277 |
|
10278 |
|
10279 | }),
|
10280 |
|
10281 | (function(module, __webpack_exports__, __webpack_require__) {
|
10282 |
|
10283 | "use strict";
|
10284 | __webpack_exports__["a"] = isNull;
|
10285 |
|
10286 | function isNull(obj) {
|
10287 | return obj === null;
|
10288 | }
|
10289 |
|
10290 |
|
10291 | }),
|
10292 |
|
10293 | (function(module, __webpack_exports__, __webpack_require__) {
|
10294 |
|
10295 | "use strict";
|
10296 | __webpack_exports__["a"] = isElement;
|
10297 |
|
10298 | function isElement(obj) {
|
10299 | return !!(obj && obj.nodeType === 1);
|
10300 | }
|
10301 |
|
10302 |
|
10303 | }),
|
10304 |
|
10305 | (function(module, __webpack_exports__, __webpack_require__) {
|
10306 |
|
10307 | "use strict";
|
10308 | var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(17);
|
10309 |
|
10310 |
|
10311 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" ])('Date'));
|
10312 |
|
10313 |
|
10314 | }),
|
10315 |
|
10316 | (function(module, __webpack_exports__, __webpack_require__) {
|
10317 |
|
10318 | "use strict";
|
10319 | var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(17);
|
10320 |
|
10321 |
|
10322 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" ])('RegExp'));
|
10323 |
|
10324 |
|
10325 | }),
|
10326 |
|
10327 | (function(module, __webpack_exports__, __webpack_require__) {
|
10328 |
|
10329 | "use strict";
|
10330 | var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(17);
|
10331 |
|
10332 |
|
10333 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" ])('Error'));
|
10334 |
|
10335 |
|
10336 | }),
|
10337 |
|
10338 | (function(module, __webpack_exports__, __webpack_require__) {
|
10339 |
|
10340 | "use strict";
|
10341 | var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(17);
|
10342 |
|
10343 |
|
10344 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" ])('Object'));
|
10345 |
|
10346 |
|
10347 | }),
|
10348 |
|
10349 | (function(module, __webpack_exports__, __webpack_require__) {
|
10350 |
|
10351 | "use strict";
|
10352 | __webpack_exports__["a"] = isFinite;
|
10353 | var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(6);
|
10354 | var __WEBPACK_IMPORTED_MODULE_1__isSymbol_js__ = __webpack_require__(184);
|
10355 |
|
10356 |
|
10357 |
|
10358 |
|
10359 | function isFinite(obj) {
|
10360 | return !Object(__WEBPACK_IMPORTED_MODULE_1__isSymbol_js__["a" ])(obj) && Object(__WEBPACK_IMPORTED_MODULE_0__setup_js__["f" ])(obj) && !isNaN(parseFloat(obj));
|
10361 | }
|
10362 |
|
10363 |
|
10364 | }),
|
10365 |
|
10366 | (function(module, __webpack_exports__, __webpack_require__) {
|
10367 |
|
10368 | "use strict";
|
10369 | var __WEBPACK_IMPORTED_MODULE_0__createSizePropertyCheck_js__ = __webpack_require__(189);
|
10370 | var __WEBPACK_IMPORTED_MODULE_1__getByteLength_js__ = __webpack_require__(137);
|
10371 |
|
10372 |
|
10373 |
|
10374 |
|
10375 |
|
10376 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createSizePropertyCheck_js__["a" ])(__WEBPACK_IMPORTED_MODULE_1__getByteLength_js__["a" ]));
|
10377 |
|
10378 |
|
10379 | }),
|
10380 |
|
10381 | (function(module, __webpack_exports__, __webpack_require__) {
|
10382 |
|
10383 | "use strict";
|
10384 | __webpack_exports__["a"] = isEmpty;
|
10385 | var __WEBPACK_IMPORTED_MODULE_0__getLength_js__ = __webpack_require__(29);
|
10386 | var __WEBPACK_IMPORTED_MODULE_1__isArray_js__ = __webpack_require__(57);
|
10387 | var __WEBPACK_IMPORTED_MODULE_2__isString_js__ = __webpack_require__(134);
|
10388 | var __WEBPACK_IMPORTED_MODULE_3__isArguments_js__ = __webpack_require__(136);
|
10389 | var __WEBPACK_IMPORTED_MODULE_4__keys_js__ = __webpack_require__(16);
|
10390 |
|
10391 |
|
10392 |
|
10393 |
|
10394 |
|
10395 |
|
10396 |
|
10397 |
|
10398 | function isEmpty(obj) {
|
10399 | if (obj == null) return true;
|
10400 |
|
10401 |
|
10402 | var length = Object(__WEBPACK_IMPORTED_MODULE_0__getLength_js__["a" ])(obj);
|
10403 | if (typeof length == 'number' && (
|
10404 | Object(__WEBPACK_IMPORTED_MODULE_1__isArray_js__["a" ])(obj) || Object(__WEBPACK_IMPORTED_MODULE_2__isString_js__["a" ])(obj) || Object(__WEBPACK_IMPORTED_MODULE_3__isArguments_js__["a" ])(obj)
|
10405 | )) return length === 0;
|
10406 | return Object(__WEBPACK_IMPORTED_MODULE_0__getLength_js__["a" ])(Object(__WEBPACK_IMPORTED_MODULE_4__keys_js__["a" ])(obj)) === 0;
|
10407 | }
|
10408 |
|
10409 |
|
10410 | }),
|
10411 |
|
10412 | (function(module, __webpack_exports__, __webpack_require__) {
|
10413 |
|
10414 | "use strict";
|
10415 | __webpack_exports__["a"] = isEqual;
|
10416 | var __WEBPACK_IMPORTED_MODULE_0__underscore_js__ = __webpack_require__(25);
|
10417 | var __WEBPACK_IMPORTED_MODULE_1__setup_js__ = __webpack_require__(6);
|
10418 | var __WEBPACK_IMPORTED_MODULE_2__getByteLength_js__ = __webpack_require__(137);
|
10419 | var __WEBPACK_IMPORTED_MODULE_3__isTypedArray_js__ = __webpack_require__(187);
|
10420 | var __WEBPACK_IMPORTED_MODULE_4__isFunction_js__ = __webpack_require__(28);
|
10421 | var __WEBPACK_IMPORTED_MODULE_5__stringTagBug_js__ = __webpack_require__(84);
|
10422 | var __WEBPACK_IMPORTED_MODULE_6__isDataView_js__ = __webpack_require__(135);
|
10423 | var __WEBPACK_IMPORTED_MODULE_7__keys_js__ = __webpack_require__(16);
|
10424 | var __WEBPACK_IMPORTED_MODULE_8__has_js__ = __webpack_require__(45);
|
10425 | var __WEBPACK_IMPORTED_MODULE_9__toBufferView_js__ = __webpack_require__(331);
|
10426 |
|
10427 |
|
10428 |
|
10429 |
|
10430 |
|
10431 |
|
10432 |
|
10433 |
|
10434 |
|
10435 |
|
10436 |
|
10437 |
|
10438 | var tagDataView = '[object DataView]';
|
10439 |
|
10440 |
|
10441 | function eq(a, b, aStack, bStack) {
|
10442 |
|
10443 |
|
10444 | if (a === b) return a !== 0 || 1 / a === 1 / b;
|
10445 |
|
10446 | if (a == null || b == null) return false;
|
10447 |
|
10448 | if (a !== a) return b !== b;
|
10449 |
|
10450 | var type = typeof a;
|
10451 | if (type !== 'function' && type !== 'object' && typeof b != 'object') return false;
|
10452 | return deepEq(a, b, aStack, bStack);
|
10453 | }
|
10454 |
|
10455 |
|
10456 | function deepEq(a, b, aStack, bStack) {
|
10457 |
|
10458 | if (a instanceof __WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" ]) a = a._wrapped;
|
10459 | if (b instanceof __WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" ]) b = b._wrapped;
|
10460 |
|
10461 | var className = __WEBPACK_IMPORTED_MODULE_1__setup_js__["t" ].call(a);
|
10462 | if (className !== __WEBPACK_IMPORTED_MODULE_1__setup_js__["t" ].call(b)) return false;
|
10463 |
|
10464 | if (__WEBPACK_IMPORTED_MODULE_5__stringTagBug_js__["a" ] && className == '[object Object]' && Object(__WEBPACK_IMPORTED_MODULE_6__isDataView_js__["a" ])(a)) {
|
10465 | if (!Object(__WEBPACK_IMPORTED_MODULE_6__isDataView_js__["a" ])(b)) return false;
|
10466 | className = tagDataView;
|
10467 | }
|
10468 | switch (className) {
|
10469 |
|
10470 | case '[object RegExp]':
|
10471 |
|
10472 | case '[object String]':
|
10473 |
|
10474 |
|
10475 | return '' + a === '' + b;
|
10476 | case '[object Number]':
|
10477 |
|
10478 |
|
10479 | if (+a !== +a) return +b !== +b;
|
10480 |
|
10481 | return +a === 0 ? 1 / +a === 1 / b : +a === +b;
|
10482 | case '[object Date]':
|
10483 | case '[object Boolean]':
|
10484 |
|
10485 |
|
10486 |
|
10487 | return +a === +b;
|
10488 | case '[object Symbol]':
|
10489 | return __WEBPACK_IMPORTED_MODULE_1__setup_js__["d" ].valueOf.call(a) === __WEBPACK_IMPORTED_MODULE_1__setup_js__["d" ].valueOf.call(b);
|
10490 | case '[object ArrayBuffer]':
|
10491 | case tagDataView:
|
10492 |
|
10493 | return deepEq(Object(__WEBPACK_IMPORTED_MODULE_9__toBufferView_js__["a" ])(a), Object(__WEBPACK_IMPORTED_MODULE_9__toBufferView_js__["a" ])(b), aStack, bStack);
|
10494 | }
|
10495 |
|
10496 | var areArrays = className === '[object Array]';
|
10497 | if (!areArrays && Object(__WEBPACK_IMPORTED_MODULE_3__isTypedArray_js__["a" ])(a)) {
|
10498 | var byteLength = Object(__WEBPACK_IMPORTED_MODULE_2__getByteLength_js__["a" ])(a);
|
10499 | if (byteLength !== Object(__WEBPACK_IMPORTED_MODULE_2__getByteLength_js__["a" ])(b)) return false;
|
10500 | if (a.buffer === b.buffer && a.byteOffset === b.byteOffset) return true;
|
10501 | areArrays = true;
|
10502 | }
|
10503 | if (!areArrays) {
|
10504 | if (typeof a != 'object' || typeof b != 'object') return false;
|
10505 |
|
10506 |
|
10507 |
|
10508 | var aCtor = a.constructor, bCtor = b.constructor;
|
10509 | if (aCtor !== bCtor && !(Object(__WEBPACK_IMPORTED_MODULE_4__isFunction_js__["a" ])(aCtor) && aCtor instanceof aCtor &&
|
10510 | Object(__WEBPACK_IMPORTED_MODULE_4__isFunction_js__["a" ])(bCtor) && bCtor instanceof bCtor)
|
10511 | && ('constructor' in a && 'constructor' in b)) {
|
10512 | return false;
|
10513 | }
|
10514 | }
|
10515 |
|
10516 |
|
10517 |
|
10518 |
|
10519 |
|
10520 | aStack = aStack || [];
|
10521 | bStack = bStack || [];
|
10522 | var length = aStack.length;
|
10523 | while (length--) {
|
10524 |
|
10525 |
|
10526 | if (aStack[length] === a) return bStack[length] === b;
|
10527 | }
|
10528 |
|
10529 |
|
10530 | aStack.push(a);
|
10531 | bStack.push(b);
|
10532 |
|
10533 |
|
10534 | if (areArrays) {
|
10535 |
|
10536 | length = a.length;
|
10537 | if (length !== b.length) return false;
|
10538 |
|
10539 | while (length--) {
|
10540 | if (!eq(a[length], b[length], aStack, bStack)) return false;
|
10541 | }
|
10542 | } else {
|
10543 |
|
10544 | var _keys = Object(__WEBPACK_IMPORTED_MODULE_7__keys_js__["a" ])(a), key;
|
10545 | length = _keys.length;
|
10546 |
|
10547 | if (Object(__WEBPACK_IMPORTED_MODULE_7__keys_js__["a" ])(b).length !== length) return false;
|
10548 | while (length--) {
|
10549 |
|
10550 | key = _keys[length];
|
10551 | if (!(Object(__WEBPACK_IMPORTED_MODULE_8__has_js__["a" ])(b, key) && eq(a[key], b[key], aStack, bStack))) return false;
|
10552 | }
|
10553 | }
|
10554 |
|
10555 | aStack.pop();
|
10556 | bStack.pop();
|
10557 | return true;
|
10558 | }
|
10559 |
|
10560 |
|
10561 | function isEqual(a, b) {
|
10562 | return eq(a, b);
|
10563 | }
|
10564 |
|
10565 |
|
10566 | }),
|
10567 |
|
10568 | (function(module, __webpack_exports__, __webpack_require__) {
|
10569 |
|
10570 | "use strict";
|
10571 | __webpack_exports__["a"] = toBufferView;
|
10572 | var __WEBPACK_IMPORTED_MODULE_0__getByteLength_js__ = __webpack_require__(137);
|
10573 |
|
10574 |
|
10575 |
|
10576 |
|
10577 | function toBufferView(bufferSource) {
|
10578 | return new Uint8Array(
|
10579 | bufferSource.buffer || bufferSource,
|
10580 | bufferSource.byteOffset || 0,
|
10581 | Object(__WEBPACK_IMPORTED_MODULE_0__getByteLength_js__["a" ])(bufferSource)
|
10582 | );
|
10583 | }
|
10584 |
|
10585 |
|
10586 | }),
|
10587 |
|
10588 | (function(module, __webpack_exports__, __webpack_require__) {
|
10589 |
|
10590 | "use strict";
|
10591 | var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(17);
|
10592 | var __WEBPACK_IMPORTED_MODULE_1__stringTagBug_js__ = __webpack_require__(84);
|
10593 | var __WEBPACK_IMPORTED_MODULE_2__methodFingerprint_js__ = __webpack_require__(138);
|
10594 |
|
10595 |
|
10596 |
|
10597 |
|
10598 | __webpack_exports__["a"] = (__WEBPACK_IMPORTED_MODULE_1__stringTagBug_js__["b" ] ? Object(__WEBPACK_IMPORTED_MODULE_2__methodFingerprint_js__["a" ])(__WEBPACK_IMPORTED_MODULE_2__methodFingerprint_js__["b" ]) : Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" ])('Map'));
|
10599 |
|
10600 |
|
10601 | }),
|
10602 |
|
10603 | (function(module, __webpack_exports__, __webpack_require__) {
|
10604 |
|
10605 | "use strict";
|
10606 | var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(17);
|
10607 | var __WEBPACK_IMPORTED_MODULE_1__stringTagBug_js__ = __webpack_require__(84);
|
10608 | var __WEBPACK_IMPORTED_MODULE_2__methodFingerprint_js__ = __webpack_require__(138);
|
10609 |
|
10610 |
|
10611 |
|
10612 |
|
10613 | __webpack_exports__["a"] = (__WEBPACK_IMPORTED_MODULE_1__stringTagBug_js__["b" ] ? Object(__WEBPACK_IMPORTED_MODULE_2__methodFingerprint_js__["a" ])(__WEBPACK_IMPORTED_MODULE_2__methodFingerprint_js__["d" ]) : Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" ])('WeakMap'));
|
10614 |
|
10615 |
|
10616 | }),
|
10617 |
|
10618 | (function(module, __webpack_exports__, __webpack_require__) {
|
10619 |
|
10620 | "use strict";
|
10621 | var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(17);
|
10622 | var __WEBPACK_IMPORTED_MODULE_1__stringTagBug_js__ = __webpack_require__(84);
|
10623 | var __WEBPACK_IMPORTED_MODULE_2__methodFingerprint_js__ = __webpack_require__(138);
|
10624 |
|
10625 |
|
10626 |
|
10627 |
|
10628 | __webpack_exports__["a"] = (__WEBPACK_IMPORTED_MODULE_1__stringTagBug_js__["b" ] ? Object(__WEBPACK_IMPORTED_MODULE_2__methodFingerprint_js__["a" ])(__WEBPACK_IMPORTED_MODULE_2__methodFingerprint_js__["c" ]) : Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" ])('Set'));
|
10629 |
|
10630 |
|
10631 | }),
|
10632 |
|
10633 | (function(module, __webpack_exports__, __webpack_require__) {
|
10634 |
|
10635 | "use strict";
|
10636 | var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(17);
|
10637 |
|
10638 |
|
10639 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" ])('WeakSet'));
|
10640 |
|
10641 |
|
10642 | }),
|
10643 |
|
10644 | (function(module, __webpack_exports__, __webpack_require__) {
|
10645 |
|
10646 | "use strict";
|
10647 | __webpack_exports__["a"] = pairs;
|
10648 | var __WEBPACK_IMPORTED_MODULE_0__keys_js__ = __webpack_require__(16);
|
10649 |
|
10650 |
|
10651 |
|
10652 |
|
10653 | function pairs(obj) {
|
10654 | var _keys = Object(__WEBPACK_IMPORTED_MODULE_0__keys_js__["a" ])(obj);
|
10655 | var length = _keys.length;
|
10656 | var pairs = Array(length);
|
10657 | for (var i = 0; i < length; i++) {
|
10658 | pairs[i] = [_keys[i], obj[_keys[i]]];
|
10659 | }
|
10660 | return pairs;
|
10661 | }
|
10662 |
|
10663 |
|
10664 | }),
|
10665 |
|
10666 | (function(module, __webpack_exports__, __webpack_require__) {
|
10667 |
|
10668 | "use strict";
|
10669 | __webpack_exports__["a"] = create;
|
10670 | var __WEBPACK_IMPORTED_MODULE_0__baseCreate_js__ = __webpack_require__(197);
|
10671 | var __WEBPACK_IMPORTED_MODULE_1__extendOwn_js__ = __webpack_require__(140);
|
10672 |
|
10673 |
|
10674 |
|
10675 |
|
10676 |
|
10677 |
|
10678 | function create(prototype, props) {
|
10679 | var result = Object(__WEBPACK_IMPORTED_MODULE_0__baseCreate_js__["a" ])(prototype);
|
10680 | if (props) Object(__WEBPACK_IMPORTED_MODULE_1__extendOwn_js__["a" ])(result, props);
|
10681 | return result;
|
10682 | }
|
10683 |
|
10684 |
|
10685 | }),
|
10686 |
|
10687 | (function(module, __webpack_exports__, __webpack_require__) {
|
10688 |
|
10689 | "use strict";
|
10690 | __webpack_exports__["a"] = tap;
|
10691 |
|
10692 |
|
10693 |
|
10694 | function tap(obj, interceptor) {
|
10695 | interceptor(obj);
|
10696 | return obj;
|
10697 | }
|
10698 |
|
10699 |
|
10700 | }),
|
10701 |
|
10702 | (function(module, __webpack_exports__, __webpack_require__) {
|
10703 |
|
10704 | "use strict";
|
10705 | __webpack_exports__["a"] = has;
|
10706 | var __WEBPACK_IMPORTED_MODULE_0__has_js__ = __webpack_require__(45);
|
10707 | var __WEBPACK_IMPORTED_MODULE_1__toPath_js__ = __webpack_require__(86);
|
10708 |
|
10709 |
|
10710 |
|
10711 |
|
10712 |
|
10713 |
|
10714 | function has(obj, path) {
|
10715 | path = Object(__WEBPACK_IMPORTED_MODULE_1__toPath_js__["a" ])(path);
|
10716 | var length = path.length;
|
10717 | for (var i = 0; i < length; i++) {
|
10718 | var key = path[i];
|
10719 | if (!Object(__WEBPACK_IMPORTED_MODULE_0__has_js__["a" ])(obj, key)) return false;
|
10720 | obj = obj[key];
|
10721 | }
|
10722 | return !!length;
|
10723 | }
|
10724 |
|
10725 |
|
10726 | }),
|
10727 |
|
10728 | (function(module, __webpack_exports__, __webpack_require__) {
|
10729 |
|
10730 | "use strict";
|
10731 | __webpack_exports__["a"] = mapObject;
|
10732 | var __WEBPACK_IMPORTED_MODULE_0__cb_js__ = __webpack_require__(21);
|
10733 | var __WEBPACK_IMPORTED_MODULE_1__keys_js__ = __webpack_require__(16);
|
10734 |
|
10735 |
|
10736 |
|
10737 |
|
10738 |
|
10739 | function mapObject(obj, iteratee, context) {
|
10740 | iteratee = Object(__WEBPACK_IMPORTED_MODULE_0__cb_js__["a" ])(iteratee, context);
|
10741 | var _keys = Object(__WEBPACK_IMPORTED_MODULE_1__keys_js__["a" ])(obj),
|
10742 | length = _keys.length,
|
10743 | results = {};
|
10744 | for (var index = 0; index < length; index++) {
|
10745 | var currentKey = _keys[index];
|
10746 | results[currentKey] = iteratee(obj[currentKey], currentKey, obj);
|
10747 | }
|
10748 | return results;
|
10749 | }
|
10750 |
|
10751 |
|
10752 | }),
|
10753 |
|
10754 | (function(module, __webpack_exports__, __webpack_require__) {
|
10755 |
|
10756 | "use strict";
|
10757 | __webpack_exports__["a"] = propertyOf;
|
10758 | var __WEBPACK_IMPORTED_MODULE_0__noop_js__ = __webpack_require__(203);
|
10759 | var __WEBPACK_IMPORTED_MODULE_1__get_js__ = __webpack_require__(199);
|
10760 |
|
10761 |
|
10762 |
|
10763 |
|
10764 | function propertyOf(obj) {
|
10765 | if (obj == null) return __WEBPACK_IMPORTED_MODULE_0__noop_js__["a" ];
|
10766 | return function(path) {
|
10767 | return Object(__WEBPACK_IMPORTED_MODULE_1__get_js__["a" ])(obj, path);
|
10768 | };
|
10769 | }
|
10770 |
|
10771 |
|
10772 | }),
|
10773 |
|
10774 | (function(module, __webpack_exports__, __webpack_require__) {
|
10775 |
|
10776 | "use strict";
|
10777 | __webpack_exports__["a"] = times;
|
10778 | var __WEBPACK_IMPORTED_MODULE_0__optimizeCb_js__ = __webpack_require__(87);
|
10779 |
|
10780 |
|
10781 |
|
10782 | function times(n, iteratee, context) {
|
10783 | var accum = Array(Math.max(0, n));
|
10784 | iteratee = Object(__WEBPACK_IMPORTED_MODULE_0__optimizeCb_js__["a" ])(iteratee, context, 1);
|
10785 | for (var i = 0; i < n; i++) accum[i] = iteratee(i);
|
10786 | return accum;
|
10787 | }
|
10788 |
|
10789 |
|
10790 | }),
|
10791 |
|
10792 | (function(module, __webpack_exports__, __webpack_require__) {
|
10793 |
|
10794 | "use strict";
|
10795 | var __WEBPACK_IMPORTED_MODULE_0__createEscaper_js__ = __webpack_require__(205);
|
10796 | var __WEBPACK_IMPORTED_MODULE_1__escapeMap_js__ = __webpack_require__(206);
|
10797 |
|
10798 |
|
10799 |
|
10800 |
|
10801 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createEscaper_js__["a" ])(__WEBPACK_IMPORTED_MODULE_1__escapeMap_js__["a" ]));
|
10802 |
|
10803 |
|
10804 | }),
|
10805 |
|
10806 | (function(module, __webpack_exports__, __webpack_require__) {
|
10807 |
|
10808 | "use strict";
|
10809 | var __WEBPACK_IMPORTED_MODULE_0__createEscaper_js__ = __webpack_require__(205);
|
10810 | var __WEBPACK_IMPORTED_MODULE_1__unescapeMap_js__ = __webpack_require__(345);
|
10811 |
|
10812 |
|
10813 |
|
10814 |
|
10815 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createEscaper_js__["a" ])(__WEBPACK_IMPORTED_MODULE_1__unescapeMap_js__["a" ]));
|
10816 |
|
10817 |
|
10818 | }),
|
10819 |
|
10820 | (function(module, __webpack_exports__, __webpack_require__) {
|
10821 |
|
10822 | "use strict";
|
10823 | var __WEBPACK_IMPORTED_MODULE_0__invert_js__ = __webpack_require__(193);
|
10824 | var __WEBPACK_IMPORTED_MODULE_1__escapeMap_js__ = __webpack_require__(206);
|
10825 |
|
10826 |
|
10827 |
|
10828 |
|
10829 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__invert_js__["a" ])(__WEBPACK_IMPORTED_MODULE_1__escapeMap_js__["a" ]));
|
10830 |
|
10831 |
|
10832 | }),
|
10833 |
|
10834 | (function(module, __webpack_exports__, __webpack_require__) {
|
10835 |
|
10836 | "use strict";
|
10837 | __webpack_exports__["a"] = template;
|
10838 | var __WEBPACK_IMPORTED_MODULE_0__defaults_js__ = __webpack_require__(196);
|
10839 | var __WEBPACK_IMPORTED_MODULE_1__underscore_js__ = __webpack_require__(25);
|
10840 | var __WEBPACK_IMPORTED_MODULE_2__templateSettings_js__ = __webpack_require__(207);
|
10841 |
|
10842 |
|
10843 |
|
10844 |
|
10845 |
|
10846 |
|
10847 |
|
10848 | var noMatch = /(.)^/;
|
10849 |
|
10850 |
|
10851 |
|
10852 | var escapes = {
|
10853 | "'": "'",
|
10854 | '\\': '\\',
|
10855 | '\r': 'r',
|
10856 | '\n': 'n',
|
10857 | '\u2028': 'u2028',
|
10858 | '\u2029': 'u2029'
|
10859 | };
|
10860 |
|
10861 | var escapeRegExp = /\\|'|\r|\n|\u2028|\u2029/g;
|
10862 |
|
10863 | function escapeChar(match) {
|
10864 | return '\\' + escapes[match];
|
10865 | }
|
10866 |
|
10867 | var bareIdentifier = /^\s*(\w|\$)+\s*$/;
|
10868 |
|
10869 |
|
10870 |
|
10871 |
|
10872 |
|
10873 | function template(text, settings, oldSettings) {
|
10874 | if (!settings && oldSettings) settings = oldSettings;
|
10875 | settings = Object(__WEBPACK_IMPORTED_MODULE_0__defaults_js__["a" ])({}, settings, __WEBPACK_IMPORTED_MODULE_1__underscore_js__["a" ].templateSettings);
|
10876 |
|
10877 |
|
10878 | var matcher = RegExp([
|
10879 | (settings.escape || noMatch).source,
|
10880 | (settings.interpolate || noMatch).source,
|
10881 | (settings.evaluate || noMatch).source
|
10882 | ].join('|') + '|$', 'g');
|
10883 |
|
10884 |
|
10885 | var index = 0;
|
10886 | var source = "__p+='";
|
10887 | text.replace(matcher, function(match, escape, interpolate, evaluate, offset) {
|
10888 | source += text.slice(index, offset).replace(escapeRegExp, escapeChar);
|
10889 | index = offset + match.length;
|
10890 |
|
10891 | if (escape) {
|
10892 | source += "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'";
|
10893 | } else if (interpolate) {
|
10894 | source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'";
|
10895 | } else if (evaluate) {
|
10896 | source += "';\n" + evaluate + "\n__p+='";
|
10897 | }
|
10898 |
|
10899 |
|
10900 | return match;
|
10901 | });
|
10902 | source += "';\n";
|
10903 |
|
10904 | var argument = settings.variable;
|
10905 | if (argument) {
|
10906 | if (!bareIdentifier.test(argument)) throw new Error(argument);
|
10907 | } else {
|
10908 |
|
10909 | source = 'with(obj||{}){\n' + source + '}\n';
|
10910 | argument = 'obj';
|
10911 | }
|
10912 |
|
10913 | source = "var __t,__p='',__j=Array.prototype.join," +
|
10914 | "print=function(){__p+=__j.call(arguments,'');};\n" +
|
10915 | source + 'return __p;\n';
|
10916 |
|
10917 | var render;
|
10918 | try {
|
10919 | render = new Function(argument, '_', source);
|
10920 | } catch (e) {
|
10921 | e.source = source;
|
10922 | throw e;
|
10923 | }
|
10924 |
|
10925 | var template = function(data) {
|
10926 | return render.call(this, data, __WEBPACK_IMPORTED_MODULE_1__underscore_js__["a" ]);
|
10927 | };
|
10928 |
|
10929 |
|
10930 | template.source = 'function(' + argument + '){\n' + source + '}';
|
10931 |
|
10932 | return template;
|
10933 | }
|
10934 |
|
10935 |
|
10936 | }),
|
10937 |
|
10938 | (function(module, __webpack_exports__, __webpack_require__) {
|
10939 |
|
10940 | "use strict";
|
10941 | __webpack_exports__["a"] = result;
|
10942 | var __WEBPACK_IMPORTED_MODULE_0__isFunction_js__ = __webpack_require__(28);
|
10943 | var __WEBPACK_IMPORTED_MODULE_1__toPath_js__ = __webpack_require__(86);
|
10944 |
|
10945 |
|
10946 |
|
10947 |
|
10948 |
|
10949 |
|
10950 | function result(obj, path, fallback) {
|
10951 | path = Object(__WEBPACK_IMPORTED_MODULE_1__toPath_js__["a" ])(path);
|
10952 | var length = path.length;
|
10953 | if (!length) {
|
10954 | return Object(__WEBPACK_IMPORTED_MODULE_0__isFunction_js__["a" ])(fallback) ? fallback.call(obj) : fallback;
|
10955 | }
|
10956 | for (var i = 0; i < length; i++) {
|
10957 | var prop = obj == null ? void 0 : obj[path[i]];
|
10958 | if (prop === void 0) {
|
10959 | prop = fallback;
|
10960 | i = length;
|
10961 | }
|
10962 | obj = Object(__WEBPACK_IMPORTED_MODULE_0__isFunction_js__["a" ])(prop) ? prop.call(obj) : prop;
|
10963 | }
|
10964 | return obj;
|
10965 | }
|
10966 |
|
10967 |
|
10968 | }),
|
10969 |
|
10970 | (function(module, __webpack_exports__, __webpack_require__) {
|
10971 |
|
10972 | "use strict";
|
10973 | __webpack_exports__["a"] = uniqueId;
|
10974 |
|
10975 |
|
10976 | var idCounter = 0;
|
10977 | function uniqueId(prefix) {
|
10978 | var id = ++idCounter + '';
|
10979 | return prefix ? prefix + id : id;
|
10980 | }
|
10981 |
|
10982 |
|
10983 | }),
|
10984 |
|
10985 | (function(module, __webpack_exports__, __webpack_require__) {
|
10986 |
|
10987 | "use strict";
|
10988 | __webpack_exports__["a"] = chain;
|
10989 | var __WEBPACK_IMPORTED_MODULE_0__underscore_js__ = __webpack_require__(25);
|
10990 |
|
10991 |
|
10992 |
|
10993 | function chain(obj) {
|
10994 | var instance = Object(__WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" ])(obj);
|
10995 | instance._chain = true;
|
10996 | return instance;
|
10997 | }
|
10998 |
|
10999 |
|
11000 | }),
|
11001 |
|
11002 | (function(module, __webpack_exports__, __webpack_require__) {
|
11003 |
|
11004 | "use strict";
|
11005 | var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(24);
|
11006 | var __WEBPACK_IMPORTED_MODULE_1__flatten_js__ = __webpack_require__(67);
|
11007 | var __WEBPACK_IMPORTED_MODULE_2__bind_js__ = __webpack_require__(209);
|
11008 |
|
11009 |
|
11010 |
|
11011 |
|
11012 |
|
11013 |
|
11014 |
|
11015 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" ])(function(obj, keys) {
|
11016 | keys = Object(__WEBPACK_IMPORTED_MODULE_1__flatten_js__["a" ])(keys, false, false);
|
11017 | var index = keys.length;
|
11018 | if (index < 1) throw new Error('bindAll must be passed function names');
|
11019 | while (index--) {
|
11020 | var key = keys[index];
|
11021 | obj[key] = Object(__WEBPACK_IMPORTED_MODULE_2__bind_js__["a" ])(obj[key], obj);
|
11022 | }
|
11023 | return obj;
|
11024 | }));
|
11025 |
|
11026 |
|
11027 | }),
|
11028 |
|
11029 | (function(module, __webpack_exports__, __webpack_require__) {
|
11030 |
|
11031 | "use strict";
|
11032 | __webpack_exports__["a"] = memoize;
|
11033 | var __WEBPACK_IMPORTED_MODULE_0__has_js__ = __webpack_require__(45);
|
11034 |
|
11035 |
|
11036 |
|
11037 | function memoize(func, hasher) {
|
11038 | var memoize = function(key) {
|
11039 | var cache = memoize.cache;
|
11040 | var address = '' + (hasher ? hasher.apply(this, arguments) : key);
|
11041 | if (!Object(__WEBPACK_IMPORTED_MODULE_0__has_js__["a" ])(cache, address)) cache[address] = func.apply(this, arguments);
|
11042 | return cache[address];
|
11043 | };
|
11044 | memoize.cache = {};
|
11045 | return memoize;
|
11046 | }
|
11047 |
|
11048 |
|
11049 | }),
|
11050 |
|
11051 | (function(module, __webpack_exports__, __webpack_require__) {
|
11052 |
|
11053 | "use strict";
|
11054 | var __WEBPACK_IMPORTED_MODULE_0__partial_js__ = __webpack_require__(112);
|
11055 | var __WEBPACK_IMPORTED_MODULE_1__delay_js__ = __webpack_require__(210);
|
11056 | var __WEBPACK_IMPORTED_MODULE_2__underscore_js__ = __webpack_require__(25);
|
11057 |
|
11058 |
|
11059 |
|
11060 |
|
11061 |
|
11062 |
|
11063 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__partial_js__["a" ])(__WEBPACK_IMPORTED_MODULE_1__delay_js__["a" ], __WEBPACK_IMPORTED_MODULE_2__underscore_js__["a" ], 1));
|
11064 |
|
11065 |
|
11066 | }),
|
11067 |
|
11068 | (function(module, __webpack_exports__, __webpack_require__) {
|
11069 |
|
11070 | "use strict";
|
11071 | __webpack_exports__["a"] = throttle;
|
11072 | var __WEBPACK_IMPORTED_MODULE_0__now_js__ = __webpack_require__(144);
|
11073 |
|
11074 |
|
11075 |
|
11076 |
|
11077 |
|
11078 |
|
11079 |
|
11080 | function throttle(func, wait, options) {
|
11081 | var timeout, context, args, result;
|
11082 | var previous = 0;
|
11083 | if (!options) options = {};
|
11084 |
|
11085 | var later = function() {
|
11086 | previous = options.leading === false ? 0 : Object(__WEBPACK_IMPORTED_MODULE_0__now_js__["a" ])();
|
11087 | timeout = null;
|
11088 | result = func.apply(context, args);
|
11089 | if (!timeout) context = args = null;
|
11090 | };
|
11091 |
|
11092 | var throttled = function() {
|
11093 | var _now = Object(__WEBPACK_IMPORTED_MODULE_0__now_js__["a" ])();
|
11094 | if (!previous && options.leading === false) previous = _now;
|
11095 | var remaining = wait - (_now - previous);
|
11096 | context = this;
|
11097 | args = arguments;
|
11098 | if (remaining <= 0 || remaining > wait) {
|
11099 | if (timeout) {
|
11100 | clearTimeout(timeout);
|
11101 | timeout = null;
|
11102 | }
|
11103 | previous = _now;
|
11104 | result = func.apply(context, args);
|
11105 | if (!timeout) context = args = null;
|
11106 | } else if (!timeout && options.trailing !== false) {
|
11107 | timeout = setTimeout(later, remaining);
|
11108 | }
|
11109 | return result;
|
11110 | };
|
11111 |
|
11112 | throttled.cancel = function() {
|
11113 | clearTimeout(timeout);
|
11114 | previous = 0;
|
11115 | timeout = context = args = null;
|
11116 | };
|
11117 |
|
11118 | return throttled;
|
11119 | }
|
11120 |
|
11121 |
|
11122 | }),
|
11123 |
|
11124 | (function(module, __webpack_exports__, __webpack_require__) {
|
11125 |
|
11126 | "use strict";
|
11127 | __webpack_exports__["a"] = debounce;
|
11128 | var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(24);
|
11129 | var __WEBPACK_IMPORTED_MODULE_1__now_js__ = __webpack_require__(144);
|
11130 |
|
11131 |
|
11132 |
|
11133 |
|
11134 |
|
11135 |
|
11136 |
|
11137 | function debounce(func, wait, immediate) {
|
11138 | var timeout, previous, args, result, context;
|
11139 |
|
11140 | var later = function() {
|
11141 | var passed = Object(__WEBPACK_IMPORTED_MODULE_1__now_js__["a" ])() - previous;
|
11142 | if (wait > passed) {
|
11143 | timeout = setTimeout(later, wait - passed);
|
11144 | } else {
|
11145 | timeout = null;
|
11146 | if (!immediate) result = func.apply(context, args);
|
11147 |
|
11148 | if (!timeout) args = context = null;
|
11149 | }
|
11150 | };
|
11151 |
|
11152 | var debounced = Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" ])(function(_args) {
|
11153 | context = this;
|
11154 | args = _args;
|
11155 | previous = Object(__WEBPACK_IMPORTED_MODULE_1__now_js__["a" ])();
|
11156 | if (!timeout) {
|
11157 | timeout = setTimeout(later, wait);
|
11158 | if (immediate) result = func.apply(context, args);
|
11159 | }
|
11160 | return result;
|
11161 | });
|
11162 |
|
11163 | debounced.cancel = function() {
|
11164 | clearTimeout(timeout);
|
11165 | timeout = args = context = null;
|
11166 | };
|
11167 |
|
11168 | return debounced;
|
11169 | }
|
11170 |
|
11171 |
|
11172 | }),
|
11173 |
|
11174 | (function(module, __webpack_exports__, __webpack_require__) {
|
11175 |
|
11176 | "use strict";
|
11177 | __webpack_exports__["a"] = wrap;
|
11178 | var __WEBPACK_IMPORTED_MODULE_0__partial_js__ = __webpack_require__(112);
|
11179 |
|
11180 |
|
11181 |
|
11182 |
|
11183 |
|
11184 | function wrap(func, wrapper) {
|
11185 | return Object(__WEBPACK_IMPORTED_MODULE_0__partial_js__["a" ])(wrapper, func);
|
11186 | }
|
11187 |
|
11188 |
|
11189 | }),
|
11190 |
|
11191 | (function(module, __webpack_exports__, __webpack_require__) {
|
11192 |
|
11193 | "use strict";
|
11194 | __webpack_exports__["a"] = compose;
|
11195 |
|
11196 |
|
11197 | function compose() {
|
11198 | var args = arguments;
|
11199 | var start = args.length - 1;
|
11200 | return function() {
|
11201 | var i = start;
|
11202 | var result = args[start].apply(this, arguments);
|
11203 | while (i--) result = args[i].call(this, result);
|
11204 | return result;
|
11205 | };
|
11206 | }
|
11207 |
|
11208 |
|
11209 | }),
|
11210 |
|
11211 | (function(module, __webpack_exports__, __webpack_require__) {
|
11212 |
|
11213 | "use strict";
|
11214 | __webpack_exports__["a"] = after;
|
11215 |
|
11216 | function after(times, func) {
|
11217 | return function() {
|
11218 | if (--times < 1) {
|
11219 | return func.apply(this, arguments);
|
11220 | }
|
11221 | };
|
11222 | }
|
11223 |
|
11224 |
|
11225 | }),
|
11226 |
|
11227 | (function(module, __webpack_exports__, __webpack_require__) {
|
11228 |
|
11229 | "use strict";
|
11230 | var __WEBPACK_IMPORTED_MODULE_0__partial_js__ = __webpack_require__(112);
|
11231 | var __WEBPACK_IMPORTED_MODULE_1__before_js__ = __webpack_require__(211);
|
11232 |
|
11233 |
|
11234 |
|
11235 |
|
11236 |
|
11237 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__partial_js__["a" ])(__WEBPACK_IMPORTED_MODULE_1__before_js__["a" ], 2));
|
11238 |
|
11239 |
|
11240 | }),
|
11241 |
|
11242 | (function(module, __webpack_exports__, __webpack_require__) {
|
11243 |
|
11244 | "use strict";
|
11245 | var __WEBPACK_IMPORTED_MODULE_0__findLastIndex_js__ = __webpack_require__(214);
|
11246 | var __WEBPACK_IMPORTED_MODULE_1__createIndexFinder_js__ = __webpack_require__(217);
|
11247 |
|
11248 |
|
11249 |
|
11250 |
|
11251 |
|
11252 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_1__createIndexFinder_js__["a" ])(-1, __WEBPACK_IMPORTED_MODULE_0__findLastIndex_js__["a" ]));
|
11253 |
|
11254 |
|
11255 | }),
|
11256 |
|
11257 | (function(module, __webpack_exports__, __webpack_require__) {
|
11258 |
|
11259 | "use strict";
|
11260 | __webpack_exports__["a"] = findWhere;
|
11261 | var __WEBPACK_IMPORTED_MODULE_0__find_js__ = __webpack_require__(218);
|
11262 | var __WEBPACK_IMPORTED_MODULE_1__matcher_js__ = __webpack_require__(111);
|
11263 |
|
11264 |
|
11265 |
|
11266 |
|
11267 |
|
11268 | function findWhere(obj, attrs) {
|
11269 | return Object(__WEBPACK_IMPORTED_MODULE_0__find_js__["a" ])(obj, Object(__WEBPACK_IMPORTED_MODULE_1__matcher_js__["a" ])(attrs));
|
11270 | }
|
11271 |
|
11272 |
|
11273 | }),
|
11274 |
|
11275 | (function(module, __webpack_exports__, __webpack_require__) {
|
11276 |
|
11277 | "use strict";
|
11278 | var __WEBPACK_IMPORTED_MODULE_0__createReduce_js__ = __webpack_require__(219);
|
11279 |
|
11280 |
|
11281 |
|
11282 |
|
11283 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createReduce_js__["a" ])(1));
|
11284 |
|
11285 |
|
11286 | }),
|
11287 |
|
11288 | (function(module, __webpack_exports__, __webpack_require__) {
|
11289 |
|
11290 | "use strict";
|
11291 | var __WEBPACK_IMPORTED_MODULE_0__createReduce_js__ = __webpack_require__(219);
|
11292 |
|
11293 |
|
11294 |
|
11295 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createReduce_js__["a" ])(-1));
|
11296 |
|
11297 |
|
11298 | }),
|
11299 |
|
11300 | (function(module, __webpack_exports__, __webpack_require__) {
|
11301 |
|
11302 | "use strict";
|
11303 | __webpack_exports__["a"] = reject;
|
11304 | var __WEBPACK_IMPORTED_MODULE_0__filter_js__ = __webpack_require__(88);
|
11305 | var __WEBPACK_IMPORTED_MODULE_1__negate_js__ = __webpack_require__(145);
|
11306 | var __WEBPACK_IMPORTED_MODULE_2__cb_js__ = __webpack_require__(21);
|
11307 |
|
11308 |
|
11309 |
|
11310 |
|
11311 |
|
11312 | function reject(obj, predicate, context) {
|
11313 | return Object(__WEBPACK_IMPORTED_MODULE_0__filter_js__["a" ])(obj, Object(__WEBPACK_IMPORTED_MODULE_1__negate_js__["a" ])(Object(__WEBPACK_IMPORTED_MODULE_2__cb_js__["a" ])(predicate)), context);
|
11314 | }
|
11315 |
|
11316 |
|
11317 | }),
|
11318 |
|
11319 | (function(module, __webpack_exports__, __webpack_require__) {
|
11320 |
|
11321 | "use strict";
|
11322 | __webpack_exports__["a"] = every;
|
11323 | var __WEBPACK_IMPORTED_MODULE_0__cb_js__ = __webpack_require__(21);
|
11324 | var __WEBPACK_IMPORTED_MODULE_1__isArrayLike_js__ = __webpack_require__(26);
|
11325 | var __WEBPACK_IMPORTED_MODULE_2__keys_js__ = __webpack_require__(16);
|
11326 |
|
11327 |
|
11328 |
|
11329 |
|
11330 |
|
11331 | function every(obj, predicate, context) {
|
11332 | predicate = Object(__WEBPACK_IMPORTED_MODULE_0__cb_js__["a" ])(predicate, context);
|
11333 | var _keys = !Object(__WEBPACK_IMPORTED_MODULE_1__isArrayLike_js__["a" ])(obj) && Object(__WEBPACK_IMPORTED_MODULE_2__keys_js__["a" ])(obj),
|
11334 | length = (_keys || obj).length;
|
11335 | for (var index = 0; index < length; index++) {
|
11336 | var currentKey = _keys ? _keys[index] : index;
|
11337 | if (!predicate(obj[currentKey], currentKey, obj)) return false;
|
11338 | }
|
11339 | return true;
|
11340 | }
|
11341 |
|
11342 |
|
11343 | }),
|
11344 |
|
11345 | (function(module, __webpack_exports__, __webpack_require__) {
|
11346 |
|
11347 | "use strict";
|
11348 | __webpack_exports__["a"] = some;
|
11349 | var __WEBPACK_IMPORTED_MODULE_0__cb_js__ = __webpack_require__(21);
|
11350 | var __WEBPACK_IMPORTED_MODULE_1__isArrayLike_js__ = __webpack_require__(26);
|
11351 | var __WEBPACK_IMPORTED_MODULE_2__keys_js__ = __webpack_require__(16);
|
11352 |
|
11353 |
|
11354 |
|
11355 |
|
11356 |
|
11357 | function some(obj, predicate, context) {
|
11358 | predicate = Object(__WEBPACK_IMPORTED_MODULE_0__cb_js__["a" ])(predicate, context);
|
11359 | var _keys = !Object(__WEBPACK_IMPORTED_MODULE_1__isArrayLike_js__["a" ])(obj) && Object(__WEBPACK_IMPORTED_MODULE_2__keys_js__["a" ])(obj),
|
11360 | length = (_keys || obj).length;
|
11361 | for (var index = 0; index < length; index++) {
|
11362 | var currentKey = _keys ? _keys[index] : index;
|
11363 | if (predicate(obj[currentKey], currentKey, obj)) return true;
|
11364 | }
|
11365 | return false;
|
11366 | }
|
11367 |
|
11368 |
|
11369 | }),
|
11370 |
|
11371 | (function(module, __webpack_exports__, __webpack_require__) {
|
11372 |
|
11373 | "use strict";
|
11374 | var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(24);
|
11375 | var __WEBPACK_IMPORTED_MODULE_1__isFunction_js__ = __webpack_require__(28);
|
11376 | var __WEBPACK_IMPORTED_MODULE_2__map_js__ = __webpack_require__(68);
|
11377 | var __WEBPACK_IMPORTED_MODULE_3__deepGet_js__ = __webpack_require__(141);
|
11378 | var __WEBPACK_IMPORTED_MODULE_4__toPath_js__ = __webpack_require__(86);
|
11379 |
|
11380 |
|
11381 |
|
11382 |
|
11383 |
|
11384 |
|
11385 |
|
11386 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" ])(function(obj, path, args) {
|
11387 | var contextPath, func;
|
11388 | if (Object(__WEBPACK_IMPORTED_MODULE_1__isFunction_js__["a" ])(path)) {
|
11389 | func = path;
|
11390 | } else {
|
11391 | path = Object(__WEBPACK_IMPORTED_MODULE_4__toPath_js__["a" ])(path);
|
11392 | contextPath = path.slice(0, -1);
|
11393 | path = path[path.length - 1];
|
11394 | }
|
11395 | return Object(__WEBPACK_IMPORTED_MODULE_2__map_js__["a" ])(obj, function(context) {
|
11396 | var method = func;
|
11397 | if (!method) {
|
11398 | if (contextPath && contextPath.length) {
|
11399 | context = Object(__WEBPACK_IMPORTED_MODULE_3__deepGet_js__["a" ])(context, contextPath);
|
11400 | }
|
11401 | if (context == null) return void 0;
|
11402 | method = context[path];
|
11403 | }
|
11404 | return method == null ? method : method.apply(context, args);
|
11405 | });
|
11406 | }));
|
11407 |
|
11408 |
|
11409 | }),
|
11410 |
|
11411 | (function(module, __webpack_exports__, __webpack_require__) {
|
11412 |
|
11413 | "use strict";
|
11414 | __webpack_exports__["a"] = where;
|
11415 | var __WEBPACK_IMPORTED_MODULE_0__filter_js__ = __webpack_require__(88);
|
11416 | var __WEBPACK_IMPORTED_MODULE_1__matcher_js__ = __webpack_require__(111);
|
11417 |
|
11418 |
|
11419 |
|
11420 |
|
11421 |
|
11422 | function where(obj, attrs) {
|
11423 | return Object(__WEBPACK_IMPORTED_MODULE_0__filter_js__["a" ])(obj, Object(__WEBPACK_IMPORTED_MODULE_1__matcher_js__["a" ])(attrs));
|
11424 | }
|
11425 |
|
11426 |
|
11427 | }),
|
11428 |
|
11429 | (function(module, __webpack_exports__, __webpack_require__) {
|
11430 |
|
11431 | "use strict";
|
11432 | __webpack_exports__["a"] = min;
|
11433 | var __WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__ = __webpack_require__(26);
|
11434 | var __WEBPACK_IMPORTED_MODULE_1__values_js__ = __webpack_require__(66);
|
11435 | var __WEBPACK_IMPORTED_MODULE_2__cb_js__ = __webpack_require__(21);
|
11436 | var __WEBPACK_IMPORTED_MODULE_3__each_js__ = __webpack_require__(58);
|
11437 |
|
11438 |
|
11439 |
|
11440 |
|
11441 |
|
11442 |
|
11443 | function min(obj, iteratee, context) {
|
11444 | var result = Infinity, lastComputed = Infinity,
|
11445 | value, computed;
|
11446 | if (iteratee == null || typeof iteratee == 'number' && typeof obj[0] != 'object' && obj != null) {
|
11447 | obj = Object(__WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__["a" ])(obj) ? obj : Object(__WEBPACK_IMPORTED_MODULE_1__values_js__["a" ])(obj);
|
11448 | for (var i = 0, length = obj.length; i < length; i++) {
|
11449 | value = obj[i];
|
11450 | if (value != null && value < result) {
|
11451 | result = value;
|
11452 | }
|
11453 | }
|
11454 | } else {
|
11455 | iteratee = Object(__WEBPACK_IMPORTED_MODULE_2__cb_js__["a" ])(iteratee, context);
|
11456 | Object(__WEBPACK_IMPORTED_MODULE_3__each_js__["a" ])(obj, function(v, index, list) {
|
11457 | computed = iteratee(v, index, list);
|
11458 | if (computed < lastComputed || computed === Infinity && result === Infinity) {
|
11459 | result = v;
|
11460 | lastComputed = computed;
|
11461 | }
|
11462 | });
|
11463 | }
|
11464 | return result;
|
11465 | }
|
11466 |
|
11467 |
|
11468 | }),
|
11469 |
|
11470 | (function(module, __webpack_exports__, __webpack_require__) {
|
11471 |
|
11472 | "use strict";
|
11473 | __webpack_exports__["a"] = shuffle;
|
11474 | var __WEBPACK_IMPORTED_MODULE_0__sample_js__ = __webpack_require__(221);
|
11475 |
|
11476 |
|
11477 |
|
11478 | function shuffle(obj) {
|
11479 | return Object(__WEBPACK_IMPORTED_MODULE_0__sample_js__["a" ])(obj, Infinity);
|
11480 | }
|
11481 |
|
11482 |
|
11483 | }),
|
11484 |
|
11485 | (function(module, __webpack_exports__, __webpack_require__) {
|
11486 |
|
11487 | "use strict";
|
11488 | __webpack_exports__["a"] = sortBy;
|
11489 | var __WEBPACK_IMPORTED_MODULE_0__cb_js__ = __webpack_require__(21);
|
11490 | var __WEBPACK_IMPORTED_MODULE_1__pluck_js__ = __webpack_require__(147);
|
11491 | var __WEBPACK_IMPORTED_MODULE_2__map_js__ = __webpack_require__(68);
|
11492 |
|
11493 |
|
11494 |
|
11495 |
|
11496 |
|
11497 | function sortBy(obj, iteratee, context) {
|
11498 | var index = 0;
|
11499 | iteratee = Object(__WEBPACK_IMPORTED_MODULE_0__cb_js__["a" ])(iteratee, context);
|
11500 | return Object(__WEBPACK_IMPORTED_MODULE_1__pluck_js__["a" ])(Object(__WEBPACK_IMPORTED_MODULE_2__map_js__["a" ])(obj, function(value, key, list) {
|
11501 | return {
|
11502 | value: value,
|
11503 | index: index++,
|
11504 | criteria: iteratee(value, key, list)
|
11505 | };
|
11506 | }).sort(function(left, right) {
|
11507 | var a = left.criteria;
|
11508 | var b = right.criteria;
|
11509 | if (a !== b) {
|
11510 | if (a > b || a === void 0) return 1;
|
11511 | if (a < b || b === void 0) return -1;
|
11512 | }
|
11513 | return left.index - right.index;
|
11514 | }), 'value');
|
11515 | }
|
11516 |
|
11517 |
|
11518 | }),
|
11519 |
|
11520 | (function(module, __webpack_exports__, __webpack_require__) {
|
11521 |
|
11522 | "use strict";
|
11523 | var __WEBPACK_IMPORTED_MODULE_0__group_js__ = __webpack_require__(113);
|
11524 | var __WEBPACK_IMPORTED_MODULE_1__has_js__ = __webpack_require__(45);
|
11525 |
|
11526 |
|
11527 |
|
11528 |
|
11529 |
|
11530 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__group_js__["a" ])(function(result, value, key) {
|
11531 | if (Object(__WEBPACK_IMPORTED_MODULE_1__has_js__["a" ])(result, key)) result[key].push(value); else result[key] = [value];
|
11532 | }));
|
11533 |
|
11534 |
|
11535 | }),
|
11536 |
|
11537 | (function(module, __webpack_exports__, __webpack_require__) {
|
11538 |
|
11539 | "use strict";
|
11540 | var __WEBPACK_IMPORTED_MODULE_0__group_js__ = __webpack_require__(113);
|
11541 |
|
11542 |
|
11543 |
|
11544 |
|
11545 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__group_js__["a" ])(function(result, value, key) {
|
11546 | result[key] = value;
|
11547 | }));
|
11548 |
|
11549 |
|
11550 | }),
|
11551 |
|
11552 | (function(module, __webpack_exports__, __webpack_require__) {
|
11553 |
|
11554 | "use strict";
|
11555 | var __WEBPACK_IMPORTED_MODULE_0__group_js__ = __webpack_require__(113);
|
11556 | var __WEBPACK_IMPORTED_MODULE_1__has_js__ = __webpack_require__(45);
|
11557 |
|
11558 |
|
11559 |
|
11560 |
|
11561 |
|
11562 |
|
11563 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__group_js__["a" ])(function(result, value, key) {
|
11564 | if (Object(__WEBPACK_IMPORTED_MODULE_1__has_js__["a" ])(result, key)) result[key]++; else result[key] = 1;
|
11565 | }));
|
11566 |
|
11567 |
|
11568 | }),
|
11569 |
|
11570 | (function(module, __webpack_exports__, __webpack_require__) {
|
11571 |
|
11572 | "use strict";
|
11573 | var __WEBPACK_IMPORTED_MODULE_0__group_js__ = __webpack_require__(113);
|
11574 |
|
11575 |
|
11576 |
|
11577 |
|
11578 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__group_js__["a" ])(function(result, value, pass) {
|
11579 | result[pass ? 0 : 1].push(value);
|
11580 | }, true));
|
11581 |
|
11582 |
|
11583 | }),
|
11584 |
|
11585 | (function(module, __webpack_exports__, __webpack_require__) {
|
11586 |
|
11587 | "use strict";
|
11588 | __webpack_exports__["a"] = toArray;
|
11589 | var __WEBPACK_IMPORTED_MODULE_0__isArray_js__ = __webpack_require__(57);
|
11590 | var __WEBPACK_IMPORTED_MODULE_1__setup_js__ = __webpack_require__(6);
|
11591 | var __WEBPACK_IMPORTED_MODULE_2__isString_js__ = __webpack_require__(134);
|
11592 | var __WEBPACK_IMPORTED_MODULE_3__isArrayLike_js__ = __webpack_require__(26);
|
11593 | var __WEBPACK_IMPORTED_MODULE_4__map_js__ = __webpack_require__(68);
|
11594 | var __WEBPACK_IMPORTED_MODULE_5__identity_js__ = __webpack_require__(142);
|
11595 | var __WEBPACK_IMPORTED_MODULE_6__values_js__ = __webpack_require__(66);
|
11596 |
|
11597 |
|
11598 |
|
11599 |
|
11600 |
|
11601 |
|
11602 |
|
11603 |
|
11604 |
|
11605 | var reStrSymbol = /[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;
|
11606 | function toArray(obj) {
|
11607 | if (!obj) return [];
|
11608 | if (Object(__WEBPACK_IMPORTED_MODULE_0__isArray_js__["a" ])(obj)) return __WEBPACK_IMPORTED_MODULE_1__setup_js__["q" ].call(obj);
|
11609 | if (Object(__WEBPACK_IMPORTED_MODULE_2__isString_js__["a" ])(obj)) {
|
11610 |
|
11611 | return obj.match(reStrSymbol);
|
11612 | }
|
11613 | if (Object(__WEBPACK_IMPORTED_MODULE_3__isArrayLike_js__["a" ])(obj)) return Object(__WEBPACK_IMPORTED_MODULE_4__map_js__["a" ])(obj, __WEBPACK_IMPORTED_MODULE_5__identity_js__["a" ]);
|
11614 | return Object(__WEBPACK_IMPORTED_MODULE_6__values_js__["a" ])(obj);
|
11615 | }
|
11616 |
|
11617 |
|
11618 | }),
|
11619 |
|
11620 | (function(module, __webpack_exports__, __webpack_require__) {
|
11621 |
|
11622 | "use strict";
|
11623 | __webpack_exports__["a"] = size;
|
11624 | var __WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__ = __webpack_require__(26);
|
11625 | var __WEBPACK_IMPORTED_MODULE_1__keys_js__ = __webpack_require__(16);
|
11626 |
|
11627 |
|
11628 |
|
11629 |
|
11630 | function size(obj) {
|
11631 | if (obj == null) return 0;
|
11632 | return Object(__WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__["a" ])(obj) ? obj.length : Object(__WEBPACK_IMPORTED_MODULE_1__keys_js__["a" ])(obj).length;
|
11633 | }
|
11634 |
|
11635 |
|
11636 | }),
|
11637 |
|
11638 | (function(module, __webpack_exports__, __webpack_require__) {
|
11639 |
|
11640 | "use strict";
|
11641 | __webpack_exports__["a"] = keyInObj;
|
11642 |
|
11643 |
|
11644 | function keyInObj(value, key, obj) {
|
11645 | return key in obj;
|
11646 | }
|
11647 |
|
11648 |
|
11649 | }),
|
11650 |
|
11651 | (function(module, __webpack_exports__, __webpack_require__) {
|
11652 |
|
11653 | "use strict";
|
11654 | var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(24);
|
11655 | var __WEBPACK_IMPORTED_MODULE_1__isFunction_js__ = __webpack_require__(28);
|
11656 | var __WEBPACK_IMPORTED_MODULE_2__negate_js__ = __webpack_require__(145);
|
11657 | var __WEBPACK_IMPORTED_MODULE_3__map_js__ = __webpack_require__(68);
|
11658 | var __WEBPACK_IMPORTED_MODULE_4__flatten_js__ = __webpack_require__(67);
|
11659 | var __WEBPACK_IMPORTED_MODULE_5__contains_js__ = __webpack_require__(89);
|
11660 | var __WEBPACK_IMPORTED_MODULE_6__pick_js__ = __webpack_require__(222);
|
11661 |
|
11662 |
|
11663 |
|
11664 |
|
11665 |
|
11666 |
|
11667 |
|
11668 |
|
11669 |
|
11670 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" ])(function(obj, keys) {
|
11671 | var iteratee = keys[0], context;
|
11672 | if (Object(__WEBPACK_IMPORTED_MODULE_1__isFunction_js__["a" ])(iteratee)) {
|
11673 | iteratee = Object(__WEBPACK_IMPORTED_MODULE_2__negate_js__["a" ])(iteratee);
|
11674 | if (keys.length > 1) context = keys[1];
|
11675 | } else {
|
11676 | keys = Object(__WEBPACK_IMPORTED_MODULE_3__map_js__["a" ])(Object(__WEBPACK_IMPORTED_MODULE_4__flatten_js__["a" ])(keys, false, false), String);
|
11677 | iteratee = function(value, key) {
|
11678 | return !Object(__WEBPACK_IMPORTED_MODULE_5__contains_js__["a" ])(keys, key);
|
11679 | };
|
11680 | }
|
11681 | return Object(__WEBPACK_IMPORTED_MODULE_6__pick_js__["a" ])(obj, iteratee, context);
|
11682 | }));
|
11683 |
|
11684 |
|
11685 | }),
|
11686 |
|
11687 | (function(module, __webpack_exports__, __webpack_require__) {
|
11688 |
|
11689 | "use strict";
|
11690 | __webpack_exports__["a"] = first;
|
11691 | var __WEBPACK_IMPORTED_MODULE_0__initial_js__ = __webpack_require__(223);
|
11692 |
|
11693 |
|
11694 |
|
11695 |
|
11696 | function first(array, n, guard) {
|
11697 | if (array == null || array.length < 1) return n == null || guard ? void 0 : [];
|
11698 | if (n == null || guard) return array[0];
|
11699 | return Object(__WEBPACK_IMPORTED_MODULE_0__initial_js__["a" ])(array, array.length - n);
|
11700 | }
|
11701 |
|
11702 |
|
11703 | }),
|
11704 |
|
11705 | (function(module, __webpack_exports__, __webpack_require__) {
|
11706 |
|
11707 | "use strict";
|
11708 | __webpack_exports__["a"] = last;
|
11709 | var __WEBPACK_IMPORTED_MODULE_0__rest_js__ = __webpack_require__(224);
|
11710 |
|
11711 |
|
11712 |
|
11713 |
|
11714 | function last(array, n, guard) {
|
11715 | if (array == null || array.length < 1) return n == null || guard ? void 0 : [];
|
11716 | if (n == null || guard) return array[array.length - 1];
|
11717 | return Object(__WEBPACK_IMPORTED_MODULE_0__rest_js__["a" ])(array, Math.max(0, array.length - n));
|
11718 | }
|
11719 |
|
11720 |
|
11721 | }),
|
11722 |
|
11723 | (function(module, __webpack_exports__, __webpack_require__) {
|
11724 |
|
11725 | "use strict";
|
11726 | __webpack_exports__["a"] = compact;
|
11727 | var __WEBPACK_IMPORTED_MODULE_0__filter_js__ = __webpack_require__(88);
|
11728 |
|
11729 |
|
11730 |
|
11731 | function compact(array) {
|
11732 | return Object(__WEBPACK_IMPORTED_MODULE_0__filter_js__["a" ])(array, Boolean);
|
11733 | }
|
11734 |
|
11735 |
|
11736 | }),
|
11737 |
|
11738 | (function(module, __webpack_exports__, __webpack_require__) {
|
11739 |
|
11740 | "use strict";
|
11741 | __webpack_exports__["a"] = flatten;
|
11742 | var __WEBPACK_IMPORTED_MODULE_0__flatten_js__ = __webpack_require__(67);
|
11743 |
|
11744 |
|
11745 |
|
11746 |
|
11747 | function flatten(array, depth) {
|
11748 | return Object(__WEBPACK_IMPORTED_MODULE_0__flatten_js__["a" ])(array, depth, false);
|
11749 | }
|
11750 |
|
11751 |
|
11752 | }),
|
11753 |
|
11754 | (function(module, __webpack_exports__, __webpack_require__) {
|
11755 |
|
11756 | "use strict";
|
11757 | var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(24);
|
11758 | var __WEBPACK_IMPORTED_MODULE_1__difference_js__ = __webpack_require__(225);
|
11759 |
|
11760 |
|
11761 |
|
11762 |
|
11763 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" ])(function(array, otherArrays) {
|
11764 | return Object(__WEBPACK_IMPORTED_MODULE_1__difference_js__["a" ])(array, otherArrays);
|
11765 | }));
|
11766 |
|
11767 |
|
11768 | }),
|
11769 |
|
11770 | (function(module, __webpack_exports__, __webpack_require__) {
|
11771 |
|
11772 | "use strict";
|
11773 | var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(24);
|
11774 | var __WEBPACK_IMPORTED_MODULE_1__uniq_js__ = __webpack_require__(226);
|
11775 | var __WEBPACK_IMPORTED_MODULE_2__flatten_js__ = __webpack_require__(67);
|
11776 |
|
11777 |
|
11778 |
|
11779 |
|
11780 |
|
11781 |
|
11782 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" ])(function(arrays) {
|
11783 | return Object(__WEBPACK_IMPORTED_MODULE_1__uniq_js__["a" ])(Object(__WEBPACK_IMPORTED_MODULE_2__flatten_js__["a" ])(arrays, true, true));
|
11784 | }));
|
11785 |
|
11786 |
|
11787 | }),
|
11788 |
|
11789 | (function(module, __webpack_exports__, __webpack_require__) {
|
11790 |
|
11791 | "use strict";
|
11792 | __webpack_exports__["a"] = intersection;
|
11793 | var __WEBPACK_IMPORTED_MODULE_0__getLength_js__ = __webpack_require__(29);
|
11794 | var __WEBPACK_IMPORTED_MODULE_1__contains_js__ = __webpack_require__(89);
|
11795 |
|
11796 |
|
11797 |
|
11798 |
|
11799 |
|
11800 | function intersection(array) {
|
11801 | var result = [];
|
11802 | var argsLength = arguments.length;
|
11803 | for (var i = 0, length = Object(__WEBPACK_IMPORTED_MODULE_0__getLength_js__["a" ])(array); i < length; i++) {
|
11804 | var item = array[i];
|
11805 | if (Object(__WEBPACK_IMPORTED_MODULE_1__contains_js__["a" ])(result, item)) continue;
|
11806 | var j;
|
11807 | for (j = 1; j < argsLength; j++) {
|
11808 | if (!Object(__WEBPACK_IMPORTED_MODULE_1__contains_js__["a" ])(arguments[j], item)) break;
|
11809 | }
|
11810 | if (j === argsLength) result.push(item);
|
11811 | }
|
11812 | return result;
|
11813 | }
|
11814 |
|
11815 |
|
11816 | }),
|
11817 |
|
11818 | (function(module, __webpack_exports__, __webpack_require__) {
|
11819 |
|
11820 | "use strict";
|
11821 | var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(24);
|
11822 | var __WEBPACK_IMPORTED_MODULE_1__unzip_js__ = __webpack_require__(227);
|
11823 |
|
11824 |
|
11825 |
|
11826 |
|
11827 |
|
11828 | __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" ])(__WEBPACK_IMPORTED_MODULE_1__unzip_js__["a" ]));
|
11829 |
|
11830 |
|
11831 | }),
|
11832 |
|
11833 | (function(module, __webpack_exports__, __webpack_require__) {
|
11834 |
|
11835 | "use strict";
|
11836 | __webpack_exports__["a"] = object;
|
11837 | var __WEBPACK_IMPORTED_MODULE_0__getLength_js__ = __webpack_require__(29);
|
11838 |
|
11839 |
|
11840 |
|
11841 |
|
11842 |
|
11843 | function object(list, values) {
|
11844 | var result = {};
|
11845 | for (var i = 0, length = Object(__WEBPACK_IMPORTED_MODULE_0__getLength_js__["a" ])(list); i < length; i++) {
|
11846 | if (values) {
|
11847 | result[list[i]] = values[i];
|
11848 | } else {
|
11849 | result[list[i][0]] = list[i][1];
|
11850 | }
|
11851 | }
|
11852 | return result;
|
11853 | }
|
11854 |
|
11855 |
|
11856 | }),
|
11857 |
|
11858 | (function(module, __webpack_exports__, __webpack_require__) {
|
11859 |
|
11860 | "use strict";
|
11861 | __webpack_exports__["a"] = range;
|
11862 |
|
11863 |
|
11864 |
|
11865 | function range(start, stop, step) {
|
11866 | if (stop == null) {
|
11867 | stop = start || 0;
|
11868 | start = 0;
|
11869 | }
|
11870 | if (!step) {
|
11871 | step = stop < start ? -1 : 1;
|
11872 | }
|
11873 |
|
11874 | var length = Math.max(Math.ceil((stop - start) / step), 0);
|
11875 | var range = Array(length);
|
11876 |
|
11877 | for (var idx = 0; idx < length; idx++, start += step) {
|
11878 | range[idx] = start;
|
11879 | }
|
11880 |
|
11881 | return range;
|
11882 | }
|
11883 |
|
11884 |
|
11885 | }),
|
11886 |
|
11887 | (function(module, __webpack_exports__, __webpack_require__) {
|
11888 |
|
11889 | "use strict";
|
11890 | __webpack_exports__["a"] = chunk;
|
11891 | var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(6);
|
11892 |
|
11893 |
|
11894 |
|
11895 |
|
11896 | function chunk(array, count) {
|
11897 | if (count == null || count < 1) return [];
|
11898 | var result = [];
|
11899 | var i = 0, length = array.length;
|
11900 | while (i < length) {
|
11901 | result.push(__WEBPACK_IMPORTED_MODULE_0__setup_js__["q" ].call(array, i, i += count));
|
11902 | }
|
11903 | return result;
|
11904 | }
|
11905 |
|
11906 |
|
11907 | }),
|
11908 |
|
11909 | (function(module, __webpack_exports__, __webpack_require__) {
|
11910 |
|
11911 | "use strict";
|
11912 | __webpack_exports__["a"] = mixin;
|
11913 | var __WEBPACK_IMPORTED_MODULE_0__underscore_js__ = __webpack_require__(25);
|
11914 | var __WEBPACK_IMPORTED_MODULE_1__each_js__ = __webpack_require__(58);
|
11915 | var __WEBPACK_IMPORTED_MODULE_2__functions_js__ = __webpack_require__(194);
|
11916 | var __WEBPACK_IMPORTED_MODULE_3__setup_js__ = __webpack_require__(6);
|
11917 | var __WEBPACK_IMPORTED_MODULE_4__chainResult_js__ = __webpack_require__(228);
|
11918 |
|
11919 |
|
11920 |
|
11921 |
|
11922 |
|
11923 |
|
11924 |
|
11925 | function mixin(obj) {
|
11926 | Object(__WEBPACK_IMPORTED_MODULE_1__each_js__["a" ])(Object(__WEBPACK_IMPORTED_MODULE_2__functions_js__["a" ])(obj), function(name) {
|
11927 | var func = __WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" ][name] = obj[name];
|
11928 | __WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" ].prototype[name] = function() {
|
11929 | var args = [this._wrapped];
|
11930 | __WEBPACK_IMPORTED_MODULE_3__setup_js__["o" ].apply(args, arguments);
|
11931 | return Object(__WEBPACK_IMPORTED_MODULE_4__chainResult_js__["a" ])(this, func.apply(__WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" ], args));
|
11932 | };
|
11933 | });
|
11934 | return __WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" ];
|
11935 | }
|
11936 |
|
11937 |
|
11938 | }),
|
11939 |
|
11940 | (function(module, __webpack_exports__, __webpack_require__) {
|
11941 |
|
11942 | "use strict";
|
11943 | var __WEBPACK_IMPORTED_MODULE_0__underscore_js__ = __webpack_require__(25);
|
11944 | var __WEBPACK_IMPORTED_MODULE_1__each_js__ = __webpack_require__(58);
|
11945 | var __WEBPACK_IMPORTED_MODULE_2__setup_js__ = __webpack_require__(6);
|
11946 | var __WEBPACK_IMPORTED_MODULE_3__chainResult_js__ = __webpack_require__(228);
|
11947 |
|
11948 |
|
11949 |
|
11950 |
|
11951 |
|
11952 |
|
11953 | Object(__WEBPACK_IMPORTED_MODULE_1__each_js__["a" ])(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) {
|
11954 | var method = __WEBPACK_IMPORTED_MODULE_2__setup_js__["a" ][name];
|
11955 | __WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" ].prototype[name] = function() {
|
11956 | var obj = this._wrapped;
|
11957 | if (obj != null) {
|
11958 | method.apply(obj, arguments);
|
11959 | if ((name === 'shift' || name === 'splice') && obj.length === 0) {
|
11960 | delete obj[0];
|
11961 | }
|
11962 | }
|
11963 | return Object(__WEBPACK_IMPORTED_MODULE_3__chainResult_js__["a" ])(this, obj);
|
11964 | };
|
11965 | });
|
11966 |
|
11967 |
|
11968 | Object(__WEBPACK_IMPORTED_MODULE_1__each_js__["a" ])(['concat', 'join', 'slice'], function(name) {
|
11969 | var method = __WEBPACK_IMPORTED_MODULE_2__setup_js__["a" ][name];
|
11970 | __WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" ].prototype[name] = function() {
|
11971 | var obj = this._wrapped;
|
11972 | if (obj != null) obj = method.apply(obj, arguments);
|
11973 | return Object(__WEBPACK_IMPORTED_MODULE_3__chainResult_js__["a" ])(this, obj);
|
11974 | };
|
11975 | });
|
11976 |
|
11977 | __webpack_exports__["a"] = (__WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" ]);
|
11978 |
|
11979 |
|
11980 | }),
|
11981 |
|
11982 | (function(module, exports, __webpack_require__) {
|
11983 |
|
11984 | var parent = __webpack_require__(393);
|
11985 |
|
11986 | module.exports = parent;
|
11987 |
|
11988 |
|
11989 | }),
|
11990 |
|
11991 | (function(module, exports, __webpack_require__) {
|
11992 |
|
11993 | var isPrototypeOf = __webpack_require__(19);
|
11994 | var method = __webpack_require__(394);
|
11995 |
|
11996 | var ArrayPrototype = Array.prototype;
|
11997 |
|
11998 | module.exports = function (it) {
|
11999 | var own = it.concat;
|
12000 | return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.concat) ? method : own;
|
12001 | };
|
12002 |
|
12003 |
|
12004 | }),
|
12005 |
|
12006 | (function(module, exports, __webpack_require__) {
|
12007 |
|
12008 | __webpack_require__(229);
|
12009 | var entryVirtual = __webpack_require__(40);
|
12010 |
|
12011 | module.exports = entryVirtual('Array').concat;
|
12012 |
|
12013 |
|
12014 | }),
|
12015 |
|
12016 | (function(module, exports) {
|
12017 |
|
12018 | var $TypeError = TypeError;
|
12019 | var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF;
|
12020 |
|
12021 | module.exports = function (it) {
|
12022 | if (it > MAX_SAFE_INTEGER) throw $TypeError('Maximum allowed index exceeded');
|
12023 | return it;
|
12024 | };
|
12025 |
|
12026 |
|
12027 | }),
|
12028 |
|
12029 | (function(module, exports, __webpack_require__) {
|
12030 |
|
12031 | var isArray = __webpack_require__(90);
|
12032 | var isConstructor = __webpack_require__(109);
|
12033 | var isObject = __webpack_require__(11);
|
12034 | var wellKnownSymbol = __webpack_require__(9);
|
12035 |
|
12036 | var SPECIES = wellKnownSymbol('species');
|
12037 | var $Array = Array;
|
12038 |
|
12039 |
|
12040 |
|
12041 | module.exports = function (originalArray) {
|
12042 | var C;
|
12043 | if (isArray(originalArray)) {
|
12044 | C = originalArray.constructor;
|
12045 |
|
12046 | if (isConstructor(C) && (C === $Array || isArray(C.prototype))) C = undefined;
|
12047 | else if (isObject(C)) {
|
12048 | C = C[SPECIES];
|
12049 | if (C === null) C = undefined;
|
12050 | }
|
12051 | } return C === undefined ? $Array : C;
|
12052 | };
|
12053 |
|
12054 |
|
12055 | }),
|
12056 |
|
12057 | (function(module, exports, __webpack_require__) {
|
12058 |
|
12059 | var parent = __webpack_require__(398);
|
12060 |
|
12061 | module.exports = parent;
|
12062 |
|
12063 |
|
12064 | }),
|
12065 |
|
12066 | (function(module, exports, __webpack_require__) {
|
12067 |
|
12068 | var isPrototypeOf = __webpack_require__(19);
|
12069 | var method = __webpack_require__(399);
|
12070 |
|
12071 | var ArrayPrototype = Array.prototype;
|
12072 |
|
12073 | module.exports = function (it) {
|
12074 | var own = it.map;
|
12075 | return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.map) ? method : own;
|
12076 | };
|
12077 |
|
12078 |
|
12079 | }),
|
12080 |
|
12081 | (function(module, exports, __webpack_require__) {
|
12082 |
|
12083 | __webpack_require__(400);
|
12084 | var entryVirtual = __webpack_require__(40);
|
12085 |
|
12086 | module.exports = entryVirtual('Array').map;
|
12087 |
|
12088 |
|
12089 | }),
|
12090 |
|
12091 | (function(module, exports, __webpack_require__) {
|
12092 |
|
12093 | "use strict";
|
12094 |
|
12095 | var $ = __webpack_require__(0);
|
12096 | var $map = __webpack_require__(70).map;
|
12097 | var arrayMethodHasSpeciesSupport = __webpack_require__(114);
|
12098 |
|
12099 | var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('map');
|
12100 |
|
12101 |
|
12102 |
|
12103 |
|
12104 | $({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
|
12105 | map: function map(callbackfn /* , thisArg */) {
|
12106 | return $map(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
12107 | }
|
12108 | });
|
12109 |
|
12110 |
|
12111 | }),
|
12112 |
|
12113 | (function(module, exports, __webpack_require__) {
|
12114 |
|
12115 | var parent = __webpack_require__(402);
|
12116 |
|
12117 | module.exports = parent;
|
12118 |
|
12119 |
|
12120 | }),
|
12121 |
|
12122 | (function(module, exports, __webpack_require__) {
|
12123 |
|
12124 | __webpack_require__(403);
|
12125 | var path = __webpack_require__(5);
|
12126 |
|
12127 | module.exports = path.Object.keys;
|
12128 |
|
12129 |
|
12130 | }),
|
12131 |
|
12132 | (function(module, exports, __webpack_require__) {
|
12133 |
|
12134 | var $ = __webpack_require__(0);
|
12135 | var toObject = __webpack_require__(34);
|
12136 | var nativeKeys = __webpack_require__(105);
|
12137 | var fails = __webpack_require__(2);
|
12138 |
|
12139 | var FAILS_ON_PRIMITIVES = fails(function () { nativeKeys(1); });
|
12140 |
|
12141 |
|
12142 |
|
12143 | $({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES }, {
|
12144 | keys: function keys(it) {
|
12145 | return nativeKeys(toObject(it));
|
12146 | }
|
12147 | });
|
12148 |
|
12149 |
|
12150 | }),
|
12151 |
|
12152 | (function(module, exports, __webpack_require__) {
|
12153 |
|
12154 | var parent = __webpack_require__(405);
|
12155 |
|
12156 | module.exports = parent;
|
12157 |
|
12158 |
|
12159 | }),
|
12160 |
|
12161 | (function(module, exports, __webpack_require__) {
|
12162 |
|
12163 | __webpack_require__(231);
|
12164 | var path = __webpack_require__(5);
|
12165 | var apply = __webpack_require__(75);
|
12166 |
|
12167 |
|
12168 | if (!path.JSON) path.JSON = { stringify: JSON.stringify };
|
12169 |
|
12170 |
|
12171 | module.exports = function stringify(it, replacer, space) {
|
12172 | return apply(path.JSON.stringify, null, arguments);
|
12173 | };
|
12174 |
|
12175 |
|
12176 | }),
|
12177 |
|
12178 | (function(module, exports, __webpack_require__) {
|
12179 |
|
12180 | var parent = __webpack_require__(407);
|
12181 |
|
12182 | module.exports = parent;
|
12183 |
|
12184 |
|
12185 | }),
|
12186 |
|
12187 | (function(module, exports, __webpack_require__) {
|
12188 |
|
12189 | var isPrototypeOf = __webpack_require__(19);
|
12190 | var method = __webpack_require__(408);
|
12191 |
|
12192 | var ArrayPrototype = Array.prototype;
|
12193 |
|
12194 | module.exports = function (it) {
|
12195 | var own = it.indexOf;
|
12196 | return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.indexOf) ? method : own;
|
12197 | };
|
12198 |
|
12199 |
|
12200 | }),
|
12201 |
|
12202 | (function(module, exports, __webpack_require__) {
|
12203 |
|
12204 | __webpack_require__(409);
|
12205 | var entryVirtual = __webpack_require__(40);
|
12206 |
|
12207 | module.exports = entryVirtual('Array').indexOf;
|
12208 |
|
12209 |
|
12210 | }),
|
12211 |
|
12212 | (function(module, exports, __webpack_require__) {
|
12213 |
|
12214 | "use strict";
|
12215 |
|
12216 |
|
12217 | var $ = __webpack_require__(0);
|
12218 | var uncurryThis = __webpack_require__(4);
|
12219 | var $IndexOf = __webpack_require__(165).indexOf;
|
12220 | var arrayMethodIsStrict = __webpack_require__(232);
|
12221 |
|
12222 | var un$IndexOf = uncurryThis([].indexOf);
|
12223 |
|
12224 | var NEGATIVE_ZERO = !!un$IndexOf && 1 / un$IndexOf([1], 1, -0) < 0;
|
12225 | var STRICT_METHOD = arrayMethodIsStrict('indexOf');
|
12226 |
|
12227 |
|
12228 |
|
12229 | $({ target: 'Array', proto: true, forced: NEGATIVE_ZERO || !STRICT_METHOD }, {
|
12230 | indexOf: function indexOf(searchElement /* , fromIndex = 0 */) {
|
12231 | var fromIndex = arguments.length > 1 ? arguments[1] : undefined;
|
12232 | return NEGATIVE_ZERO
|
12233 |
|
12234 | ? un$IndexOf(this, searchElement, fromIndex) || 0
|
12235 | : $IndexOf(this, searchElement, fromIndex);
|
12236 | }
|
12237 | });
|
12238 |
|
12239 |
|
12240 | }),
|
12241 |
|
12242 | (function(module, exports, __webpack_require__) {
|
12243 |
|
12244 | __webpack_require__(39);
|
12245 | var classof = __webpack_require__(51);
|
12246 | var hasOwn = __webpack_require__(13);
|
12247 | var isPrototypeOf = __webpack_require__(19);
|
12248 | var method = __webpack_require__(411);
|
12249 |
|
12250 | var ArrayPrototype = Array.prototype;
|
12251 |
|
12252 | var DOMIterables = {
|
12253 | DOMTokenList: true,
|
12254 | NodeList: true
|
12255 | };
|
12256 |
|
12257 | module.exports = function (it) {
|
12258 | var own = it.keys;
|
12259 | return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.keys)
|
12260 | || hasOwn(DOMIterables, classof(it)) ? method : own;
|
12261 | };
|
12262 |
|
12263 |
|
12264 | }),
|
12265 |
|
12266 | (function(module, exports, __webpack_require__) {
|
12267 |
|
12268 | var parent = __webpack_require__(412);
|
12269 |
|
12270 | module.exports = parent;
|
12271 |
|
12272 |
|
12273 | }),
|
12274 |
|
12275 | (function(module, exports, __webpack_require__) {
|
12276 |
|
12277 | __webpack_require__(38);
|
12278 | __webpack_require__(53);
|
12279 | var entryVirtual = __webpack_require__(40);
|
12280 |
|
12281 | module.exports = entryVirtual('Array').keys;
|
12282 |
|
12283 |
|
12284 | }),
|
12285 |
|
12286 | (function(module, exports) {
|
12287 |
|
12288 |
|
12289 |
|
12290 |
|
12291 |
|
12292 |
|
12293 |
|
12294 |
|
12295 | var getRandomValues = (typeof(crypto) != 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto)) ||
|
12296 | (typeof(msCrypto) != 'undefined' && typeof window.msCrypto.getRandomValues == 'function' && msCrypto.getRandomValues.bind(msCrypto));
|
12297 |
|
12298 | if (getRandomValues) {
|
12299 |
|
12300 | var rnds8 = new Uint8Array(16);
|
12301 |
|
12302 | module.exports = function whatwgRNG() {
|
12303 | getRandomValues(rnds8);
|
12304 | return rnds8;
|
12305 | };
|
12306 | } else {
|
12307 |
|
12308 |
|
12309 |
|
12310 |
|
12311 | var rnds = new Array(16);
|
12312 |
|
12313 | module.exports = function mathRNG() {
|
12314 | for (var i = 0, r; i < 16; i++) {
|
12315 | if ((i & 0x03) === 0) r = Math.random() * 0x100000000;
|
12316 | rnds[i] = r >>> ((i & 0x03) << 3) & 0xff;
|
12317 | }
|
12318 |
|
12319 | return rnds;
|
12320 | };
|
12321 | }
|
12322 |
|
12323 |
|
12324 | }),
|
12325 |
|
12326 | (function(module, exports) {
|
12327 |
|
12328 |
|
12329 |
|
12330 |
|
12331 |
|
12332 | var byteToHex = [];
|
12333 | for (var i = 0; i < 256; ++i) {
|
12334 | byteToHex[i] = (i + 0x100).toString(16).substr(1);
|
12335 | }
|
12336 |
|
12337 | function bytesToUuid(buf, offset) {
|
12338 | var i = offset || 0;
|
12339 | var bth = byteToHex;
|
12340 |
|
12341 | return ([bth[buf[i++]], bth[buf[i++]],
|
12342 | bth[buf[i++]], bth[buf[i++]], '-',
|
12343 | bth[buf[i++]], bth[buf[i++]], '-',
|
12344 | bth[buf[i++]], bth[buf[i++]], '-',
|
12345 | bth[buf[i++]], bth[buf[i++]], '-',
|
12346 | bth[buf[i++]], bth[buf[i++]],
|
12347 | bth[buf[i++]], bth[buf[i++]],
|
12348 | bth[buf[i++]], bth[buf[i++]]]).join('');
|
12349 | }
|
12350 |
|
12351 | module.exports = bytesToUuid;
|
12352 |
|
12353 |
|
12354 | }),
|
12355 |
|
12356 | (function(module, exports, __webpack_require__) {
|
12357 |
|
12358 | "use strict";
|
12359 |
|
12360 |
|
12361 |
|
12362 |
|
12363 |
|
12364 |
|
12365 | function setup(env) {
|
12366 | createDebug.debug = createDebug;
|
12367 | createDebug.default = createDebug;
|
12368 | createDebug.coerce = coerce;
|
12369 | createDebug.disable = disable;
|
12370 | createDebug.enable = enable;
|
12371 | createDebug.enabled = enabled;
|
12372 | createDebug.humanize = __webpack_require__(416);
|
12373 | Object.keys(env).forEach(function (key) {
|
12374 | createDebug[key] = env[key];
|
12375 | });
|
12376 | |
12377 |
|
12378 |
|
12379 |
|
12380 | createDebug.instances = [];
|
12381 | |
12382 |
|
12383 |
|
12384 |
|
12385 | createDebug.names = [];
|
12386 | createDebug.skips = [];
|
12387 | |
12388 |
|
12389 |
|
12390 |
|
12391 |
|
12392 |
|
12393 | createDebug.formatters = {};
|
12394 | |
12395 |
|
12396 |
|
12397 |
|
12398 |
|
12399 |
|
12400 |
|
12401 | function selectColor(namespace) {
|
12402 | var hash = 0;
|
12403 |
|
12404 | for (var i = 0; i < namespace.length; i++) {
|
12405 | hash = (hash << 5) - hash + namespace.charCodeAt(i);
|
12406 | hash |= 0;
|
12407 | }
|
12408 |
|
12409 | return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
|
12410 | }
|
12411 |
|
12412 | createDebug.selectColor = selectColor;
|
12413 | |
12414 |
|
12415 |
|
12416 |
|
12417 |
|
12418 |
|
12419 |
|
12420 |
|
12421 | function createDebug(namespace) {
|
12422 | var prevTime;
|
12423 |
|
12424 | function debug() {
|
12425 |
|
12426 | if (!debug.enabled) {
|
12427 | return;
|
12428 | }
|
12429 |
|
12430 | for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
12431 | args[_key] = arguments[_key];
|
12432 | }
|
12433 |
|
12434 | var self = debug;
|
12435 |
|
12436 | var curr = Number(new Date());
|
12437 | var ms = curr - (prevTime || curr);
|
12438 | self.diff = ms;
|
12439 | self.prev = prevTime;
|
12440 | self.curr = curr;
|
12441 | prevTime = curr;
|
12442 | args[0] = createDebug.coerce(args[0]);
|
12443 |
|
12444 | if (typeof args[0] !== 'string') {
|
12445 |
|
12446 | args.unshift('%O');
|
12447 | }
|
12448 |
|
12449 |
|
12450 | var index = 0;
|
12451 | args[0] = args[0].replace(/%([a-zA-Z%])/g, function (match, format) {
|
12452 |
|
12453 | if (match === '%%') {
|
12454 | return match;
|
12455 | }
|
12456 |
|
12457 | index++;
|
12458 | var formatter = createDebug.formatters[format];
|
12459 |
|
12460 | if (typeof formatter === 'function') {
|
12461 | var val = args[index];
|
12462 | match = formatter.call(self, val);
|
12463 |
|
12464 | args.splice(index, 1);
|
12465 | index--;
|
12466 | }
|
12467 |
|
12468 | return match;
|
12469 | });
|
12470 |
|
12471 | createDebug.formatArgs.call(self, args);
|
12472 | var logFn = self.log || createDebug.log;
|
12473 | logFn.apply(self, args);
|
12474 | }
|
12475 |
|
12476 | debug.namespace = namespace;
|
12477 | debug.enabled = createDebug.enabled(namespace);
|
12478 | debug.useColors = createDebug.useColors();
|
12479 | debug.color = selectColor(namespace);
|
12480 | debug.destroy = destroy;
|
12481 | debug.extend = extend;
|
12482 |
|
12483 |
|
12484 |
|
12485 | if (typeof createDebug.init === 'function') {
|
12486 | createDebug.init(debug);
|
12487 | }
|
12488 |
|
12489 | createDebug.instances.push(debug);
|
12490 | return debug;
|
12491 | }
|
12492 |
|
12493 | function destroy() {
|
12494 | var index = createDebug.instances.indexOf(this);
|
12495 |
|
12496 | if (index !== -1) {
|
12497 | createDebug.instances.splice(index, 1);
|
12498 | return true;
|
12499 | }
|
12500 |
|
12501 | return false;
|
12502 | }
|
12503 |
|
12504 | function extend(namespace, delimiter) {
|
12505 | return createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);
|
12506 | }
|
12507 | |
12508 |
|
12509 |
|
12510 |
|
12511 |
|
12512 |
|
12513 |
|
12514 |
|
12515 |
|
12516 | function enable(namespaces) {
|
12517 | createDebug.save(namespaces);
|
12518 | createDebug.names = [];
|
12519 | createDebug.skips = [];
|
12520 | var i;
|
12521 | var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
|
12522 | var len = split.length;
|
12523 |
|
12524 | for (i = 0; i < len; i++) {
|
12525 | if (!split[i]) {
|
12526 |
|
12527 | continue;
|
12528 | }
|
12529 |
|
12530 | namespaces = split[i].replace(/\*/g, '.*?');
|
12531 |
|
12532 | if (namespaces[0] === '-') {
|
12533 | createDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));
|
12534 | } else {
|
12535 | createDebug.names.push(new RegExp('^' + namespaces + '$'));
|
12536 | }
|
12537 | }
|
12538 |
|
12539 | for (i = 0; i < createDebug.instances.length; i++) {
|
12540 | var instance = createDebug.instances[i];
|
12541 | instance.enabled = createDebug.enabled(instance.namespace);
|
12542 | }
|
12543 | }
|
12544 | |
12545 |
|
12546 |
|
12547 |
|
12548 |
|
12549 |
|
12550 |
|
12551 | function disable() {
|
12552 | createDebug.enable('');
|
12553 | }
|
12554 | |
12555 |
|
12556 |
|
12557 |
|
12558 |
|
12559 |
|
12560 |
|
12561 |
|
12562 |
|
12563 | function enabled(name) {
|
12564 | if (name[name.length - 1] === '*') {
|
12565 | return true;
|
12566 | }
|
12567 |
|
12568 | var i;
|
12569 | var len;
|
12570 |
|
12571 | for (i = 0, len = createDebug.skips.length; i < len; i++) {
|
12572 | if (createDebug.skips[i].test(name)) {
|
12573 | return false;
|
12574 | }
|
12575 | }
|
12576 |
|
12577 | for (i = 0, len = createDebug.names.length; i < len; i++) {
|
12578 | if (createDebug.names[i].test(name)) {
|
12579 | return true;
|
12580 | }
|
12581 | }
|
12582 |
|
12583 | return false;
|
12584 | }
|
12585 | |
12586 |
|
12587 |
|
12588 |
|
12589 |
|
12590 |
|
12591 |
|
12592 |
|
12593 |
|
12594 | function coerce(val) {
|
12595 | if (val instanceof Error) {
|
12596 | return val.stack || val.message;
|
12597 | }
|
12598 |
|
12599 | return val;
|
12600 | }
|
12601 |
|
12602 | createDebug.enable(createDebug.load());
|
12603 | return createDebug;
|
12604 | }
|
12605 |
|
12606 | module.exports = setup;
|
12607 |
|
12608 |
|
12609 |
|
12610 | }),
|
12611 |
|
12612 | (function(module, exports) {
|
12613 |
|
12614 |
|
12615 |
|
12616 |
|
12617 |
|
12618 | var s = 1000;
|
12619 | var m = s * 60;
|
12620 | var h = m * 60;
|
12621 | var d = h * 24;
|
12622 | var w = d * 7;
|
12623 | var y = d * 365.25;
|
12624 |
|
12625 |
|
12626 |
|
12627 |
|
12628 |
|
12629 |
|
12630 |
|
12631 |
|
12632 |
|
12633 |
|
12634 |
|
12635 |
|
12636 |
|
12637 |
|
12638 |
|
12639 | module.exports = function(val, options) {
|
12640 | options = options || {};
|
12641 | var type = typeof val;
|
12642 | if (type === 'string' && val.length > 0) {
|
12643 | return parse(val);
|
12644 | } else if (type === 'number' && isFinite(val)) {
|
12645 | return options.long ? fmtLong(val) : fmtShort(val);
|
12646 | }
|
12647 | throw new Error(
|
12648 | 'val is not a non-empty string or a valid number. val=' +
|
12649 | JSON.stringify(val)
|
12650 | );
|
12651 | };
|
12652 |
|
12653 |
|
12654 |
|
12655 |
|
12656 |
|
12657 |
|
12658 |
|
12659 |
|
12660 |
|
12661 | function parse(str) {
|
12662 | str = String(str);
|
12663 | if (str.length > 100) {
|
12664 | return;
|
12665 | }
|
12666 | var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
|
12667 | str
|
12668 | );
|
12669 | if (!match) {
|
12670 | return;
|
12671 | }
|
12672 | var n = parseFloat(match[1]);
|
12673 | var type = (match[2] || 'ms').toLowerCase();
|
12674 | switch (type) {
|
12675 | case 'years':
|
12676 | case 'year':
|
12677 | case 'yrs':
|
12678 | case 'yr':
|
12679 | case 'y':
|
12680 | return n * y;
|
12681 | case 'weeks':
|
12682 | case 'week':
|
12683 | case 'w':
|
12684 | return n * w;
|
12685 | case 'days':
|
12686 | case 'day':
|
12687 | case 'd':
|
12688 | return n * d;
|
12689 | case 'hours':
|
12690 | case 'hour':
|
12691 | case 'hrs':
|
12692 | case 'hr':
|
12693 | case 'h':
|
12694 | return n * h;
|
12695 | case 'minutes':
|
12696 | case 'minute':
|
12697 | case 'mins':
|
12698 | case 'min':
|
12699 | case 'm':
|
12700 | return n * m;
|
12701 | case 'seconds':
|
12702 | case 'second':
|
12703 | case 'secs':
|
12704 | case 'sec':
|
12705 | case 's':
|
12706 | return n * s;
|
12707 | case 'milliseconds':
|
12708 | case 'millisecond':
|
12709 | case 'msecs':
|
12710 | case 'msec':
|
12711 | case 'ms':
|
12712 | return n;
|
12713 | default:
|
12714 | return undefined;
|
12715 | }
|
12716 | }
|
12717 |
|
12718 |
|
12719 |
|
12720 |
|
12721 |
|
12722 |
|
12723 |
|
12724 |
|
12725 |
|
12726 | function fmtShort(ms) {
|
12727 | var msAbs = Math.abs(ms);
|
12728 | if (msAbs >= d) {
|
12729 | return Math.round(ms / d) + 'd';
|
12730 | }
|
12731 | if (msAbs >= h) {
|
12732 | return Math.round(ms / h) + 'h';
|
12733 | }
|
12734 | if (msAbs >= m) {
|
12735 | return Math.round(ms / m) + 'm';
|
12736 | }
|
12737 | if (msAbs >= s) {
|
12738 | return Math.round(ms / s) + 's';
|
12739 | }
|
12740 | return ms + 'ms';
|
12741 | }
|
12742 |
|
12743 |
|
12744 |
|
12745 |
|
12746 |
|
12747 |
|
12748 |
|
12749 |
|
12750 |
|
12751 | function fmtLong(ms) {
|
12752 | var msAbs = Math.abs(ms);
|
12753 | if (msAbs >= d) {
|
12754 | return plural(ms, msAbs, d, 'day');
|
12755 | }
|
12756 | if (msAbs >= h) {
|
12757 | return plural(ms, msAbs, h, 'hour');
|
12758 | }
|
12759 | if (msAbs >= m) {
|
12760 | return plural(ms, msAbs, m, 'minute');
|
12761 | }
|
12762 | if (msAbs >= s) {
|
12763 | return plural(ms, msAbs, s, 'second');
|
12764 | }
|
12765 | return ms + ' ms';
|
12766 | }
|
12767 |
|
12768 |
|
12769 |
|
12770 |
|
12771 |
|
12772 | function plural(ms, msAbs, n, name) {
|
12773 | var isPlural = msAbs >= n * 1.5;
|
12774 | return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');
|
12775 | }
|
12776 |
|
12777 |
|
12778 | }),
|
12779 |
|
12780 | (function(module, exports, __webpack_require__) {
|
12781 |
|
12782 | __webpack_require__(418);
|
12783 | var path = __webpack_require__(5);
|
12784 |
|
12785 | module.exports = path.Object.getPrototypeOf;
|
12786 |
|
12787 |
|
12788 | }),
|
12789 |
|
12790 | (function(module, exports, __webpack_require__) {
|
12791 |
|
12792 | var $ = __webpack_require__(0);
|
12793 | var fails = __webpack_require__(2);
|
12794 | var toObject = __webpack_require__(34);
|
12795 | var nativeGetPrototypeOf = __webpack_require__(100);
|
12796 | var CORRECT_PROTOTYPE_GETTER = __webpack_require__(162);
|
12797 |
|
12798 | var FAILS_ON_PRIMITIVES = fails(function () { nativeGetPrototypeOf(1); });
|
12799 |
|
12800 |
|
12801 |
|
12802 | $({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES, sham: !CORRECT_PROTOTYPE_GETTER }, {
|
12803 | getPrototypeOf: function getPrototypeOf(it) {
|
12804 | return nativeGetPrototypeOf(toObject(it));
|
12805 | }
|
12806 | });
|
12807 |
|
12808 |
|
12809 |
|
12810 | }),
|
12811 |
|
12812 | (function(module, exports, __webpack_require__) {
|
12813 |
|
12814 | __webpack_require__(420);
|
12815 | var path = __webpack_require__(5);
|
12816 |
|
12817 | module.exports = path.Object.setPrototypeOf;
|
12818 |
|
12819 |
|
12820 | }),
|
12821 |
|
12822 | (function(module, exports, __webpack_require__) {
|
12823 |
|
12824 | var $ = __webpack_require__(0);
|
12825 | var setPrototypeOf = __webpack_require__(102);
|
12826 |
|
12827 |
|
12828 |
|
12829 | $({ target: 'Object', stat: true }, {
|
12830 | setPrototypeOf: setPrototypeOf
|
12831 | });
|
12832 |
|
12833 |
|
12834 | }),
|
12835 |
|
12836 | (function(module, exports, __webpack_require__) {
|
12837 |
|
12838 | "use strict";
|
12839 |
|
12840 |
|
12841 | var _interopRequireDefault = __webpack_require__(1);
|
12842 |
|
12843 | var _slice = _interopRequireDefault(__webpack_require__(61));
|
12844 |
|
12845 | var _concat = _interopRequireDefault(__webpack_require__(22));
|
12846 |
|
12847 | var _defineProperty = _interopRequireDefault(__webpack_require__(92));
|
12848 |
|
12849 | var AV = __webpack_require__(69);
|
12850 |
|
12851 | var AppRouter = __webpack_require__(427);
|
12852 |
|
12853 | var _require = __webpack_require__(30),
|
12854 | isNullOrUndefined = _require.isNullOrUndefined;
|
12855 |
|
12856 | var _require2 = __webpack_require__(3),
|
12857 | extend = _require2.extend,
|
12858 | isObject = _require2.isObject,
|
12859 | isEmpty = _require2.isEmpty;
|
12860 |
|
12861 | var isCNApp = function isCNApp(appId) {
|
12862 | return (0, _slice.default)(appId).call(appId, -9) !== '-MdYXbMMI';
|
12863 | };
|
12864 |
|
12865 | var fillServerURLs = function fillServerURLs(url) {
|
12866 | return {
|
12867 | push: url,
|
12868 | stats: url,
|
12869 | engine: url,
|
12870 | api: url,
|
12871 | rtm: url
|
12872 | };
|
12873 | };
|
12874 |
|
12875 | function getDefaultServerURLs(appId) {
|
12876 | var _context, _context2, _context3, _context4, _context5;
|
12877 |
|
12878 | if (isCNApp(appId)) {
|
12879 | return {};
|
12880 | }
|
12881 |
|
12882 | var id = (0, _slice.default)(appId).call(appId, 0, 8).toLowerCase();
|
12883 | var domain = 'lncldglobal.com';
|
12884 | return {
|
12885 | push: (0, _concat.default)(_context = "https://".concat(id, ".push.")).call(_context, domain),
|
12886 | stats: (0, _concat.default)(_context2 = "https://".concat(id, ".stats.")).call(_context2, domain),
|
12887 | engine: (0, _concat.default)(_context3 = "https://".concat(id, ".engine.")).call(_context3, domain),
|
12888 | api: (0, _concat.default)(_context4 = "https://".concat(id, ".api.")).call(_context4, domain),
|
12889 | rtm: (0, _concat.default)(_context5 = "https://".concat(id, ".rtm.")).call(_context5, domain)
|
12890 | };
|
12891 | }
|
12892 |
|
12893 | var _disableAppRouter = false;
|
12894 | var _initialized = false;
|
12895 |
|
12896 |
|
12897 |
|
12898 |
|
12899 |
|
12900 |
|
12901 |
|
12902 |
|
12903 |
|
12904 |
|
12905 |
|
12906 |
|
12907 |
|
12908 |
|
12909 |
|
12910 |
|
12911 |
|
12912 |
|
12913 |
|
12914 |
|
12915 |
|
12916 |
|
12917 |
|
12918 | AV.init = function init(options) {
|
12919 | if (!isObject(options)) {
|
12920 | return AV.init({
|
12921 | appId: options,
|
12922 | appKey: arguments.length <= 1 ? undefined : arguments[1],
|
12923 | masterKey: arguments.length <= 2 ? undefined : arguments[2]
|
12924 | });
|
12925 | }
|
12926 |
|
12927 | var appId = options.appId,
|
12928 | appKey = options.appKey,
|
12929 | masterKey = options.masterKey,
|
12930 | hookKey = options.hookKey,
|
12931 | serverURL = options.serverURL,
|
12932 | _options$serverURLs = options.serverURLs,
|
12933 | serverURLs = _options$serverURLs === void 0 ? serverURL : _options$serverURLs,
|
12934 | disableCurrentUser = options.disableCurrentUser,
|
12935 | production = options.production,
|
12936 | realtime = options.realtime;
|
12937 | if (_initialized) console.warn('Initializing LeanCloud Storage SDK which has already been initialized. Reinitializing the SDK might cause problems like unexpected cross-app data writing and invalid relations.');
|
12938 | if (!appId) throw new TypeError('appId must be a string');
|
12939 | if (!appKey) throw new TypeError('appKey must be a string');
|
12940 | if ("Weapp" !== 'NODE_JS' && masterKey) console.warn('MasterKey is not supposed to be used at client side.');
|
12941 |
|
12942 | if (isCNApp(appId)) {
|
12943 | if (!serverURLs && isEmpty(AV._config.serverURLs)) {
|
12944 | throw new TypeError("serverURL option is required for apps from CN region");
|
12945 | }
|
12946 | }
|
12947 |
|
12948 | if (appId !== AV._config.applicationId) {
|
12949 |
|
12950 | AV._config.masterKey = masterKey;
|
12951 | AV._config.hookKey = hookKey;
|
12952 | } else {
|
12953 | if (masterKey) AV._config.masterKey = masterKey;
|
12954 | if (hookKey) AV._config.hookKey = hookKey;
|
12955 | }
|
12956 |
|
12957 | AV._config.applicationId = appId;
|
12958 | AV._config.applicationKey = appKey;
|
12959 |
|
12960 | if (!isNullOrUndefined(production)) {
|
12961 | AV.setProduction(production);
|
12962 | }
|
12963 |
|
12964 | if (typeof disableCurrentUser !== 'undefined') AV._config.disableCurrentUser = disableCurrentUser;
|
12965 | var disableAppRouter = _disableAppRouter || typeof serverURLs !== 'undefined';
|
12966 |
|
12967 | if (!disableAppRouter) {
|
12968 | AV._appRouter = new AppRouter(AV);
|
12969 | }
|
12970 |
|
12971 | AV._setServerURLs(extend({}, getDefaultServerURLs(appId), AV._config.serverURLs, typeof serverURLs === 'string' ? fillServerURLs(serverURLs) : serverURLs), disableAppRouter);
|
12972 |
|
12973 | if (realtime) {
|
12974 | AV._config.realtime = realtime;
|
12975 | } else if (AV._sharedConfig.liveQueryRealtime) {
|
12976 | var _AV$_config$serverURL = AV._config.serverURLs,
|
12977 | api = _AV$_config$serverURL.api,
|
12978 | rtm = _AV$_config$serverURL.rtm;
|
12979 | AV._config.realtime = new AV._sharedConfig.liveQueryRealtime({
|
12980 | appId: appId,
|
12981 | appKey: appKey,
|
12982 | server: {
|
12983 | api: api,
|
12984 | RTMRouter: rtm
|
12985 | }
|
12986 | });
|
12987 | }
|
12988 |
|
12989 | _initialized = true;
|
12990 | };
|
12991 |
|
12992 |
|
12993 | if (false) {
|
12994 | AV.Cloud = AV.Cloud || {};
|
12995 | |
12996 |
|
12997 |
|
12998 |
|
12999 |
|
13000 |
|
13001 |
|
13002 |
|
13003 | AV.Cloud.useMasterKey = function () {
|
13004 | AV._config.useMasterKey = true;
|
13005 | };
|
13006 | }
|
13007 |
|
13008 |
|
13009 |
|
13010 |
|
13011 |
|
13012 |
|
13013 |
|
13014 |
|
13015 | AV.setProduction = function (production) {
|
13016 | if (!isNullOrUndefined(production)) {
|
13017 | AV._config.production = production ? 1 : 0;
|
13018 | } else {
|
13019 |
|
13020 | AV._config.production = null;
|
13021 | }
|
13022 | };
|
13023 |
|
13024 | AV._setServerURLs = function (urls) {
|
13025 | var disableAppRouter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
13026 |
|
13027 | if (typeof urls !== 'string') {
|
13028 | extend(AV._config.serverURLs, urls);
|
13029 | } else {
|
13030 | AV._config.serverURLs = fillServerURLs(urls);
|
13031 | }
|
13032 |
|
13033 | if (disableAppRouter) {
|
13034 | if (AV._appRouter) {
|
13035 | AV._appRouter.disable();
|
13036 | } else {
|
13037 | _disableAppRouter = true;
|
13038 | }
|
13039 | }
|
13040 | };
|
13041 |
|
13042 |
|
13043 |
|
13044 |
|
13045 |
|
13046 |
|
13047 |
|
13048 |
|
13049 |
|
13050 | AV.setServerURL = function (urls) {
|
13051 | return AV._setServerURLs(urls);
|
13052 | };
|
13053 |
|
13054 | AV.setServerURLs = AV.setServerURL;
|
13055 |
|
13056 | AV.keepErrorRawMessage = function (value) {
|
13057 | AV._sharedConfig.keepErrorRawMessage = value;
|
13058 | };
|
13059 |
|
13060 |
|
13061 |
|
13062 |
|
13063 |
|
13064 |
|
13065 |
|
13066 |
|
13067 |
|
13068 | AV.setRequestTimeout = function (ms) {
|
13069 | AV._config.requestTimeout = ms;
|
13070 | };
|
13071 |
|
13072 |
|
13073 | AV.initialize = AV.init;
|
13074 |
|
13075 | var defineConfig = function defineConfig(property) {
|
13076 | return (0, _defineProperty.default)(AV, property, {
|
13077 | get: function get() {
|
13078 | return AV._config[property];
|
13079 | },
|
13080 | set: function set(value) {
|
13081 | AV._config[property] = value;
|
13082 | }
|
13083 | });
|
13084 | };
|
13085 |
|
13086 | ['applicationId', 'applicationKey', 'masterKey', 'hookKey'].forEach(defineConfig);
|
13087 |
|
13088 | }),
|
13089 |
|
13090 | (function(module, exports, __webpack_require__) {
|
13091 |
|
13092 | var isPrototypeOf = __webpack_require__(19);
|
13093 | var method = __webpack_require__(423);
|
13094 |
|
13095 | var ArrayPrototype = Array.prototype;
|
13096 |
|
13097 | module.exports = function (it) {
|
13098 | var own = it.slice;
|
13099 | return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.slice) ? method : own;
|
13100 | };
|
13101 |
|
13102 |
|
13103 | }),
|
13104 |
|
13105 | (function(module, exports, __webpack_require__) {
|
13106 |
|
13107 | __webpack_require__(424);
|
13108 | var entryVirtual = __webpack_require__(40);
|
13109 |
|
13110 | module.exports = entryVirtual('Array').slice;
|
13111 |
|
13112 |
|
13113 | }),
|
13114 |
|
13115 | (function(module, exports, __webpack_require__) {
|
13116 |
|
13117 | "use strict";
|
13118 |
|
13119 | var $ = __webpack_require__(0);
|
13120 | var isArray = __webpack_require__(90);
|
13121 | var isConstructor = __webpack_require__(109);
|
13122 | var isObject = __webpack_require__(11);
|
13123 | var toAbsoluteIndex = __webpack_require__(126);
|
13124 | var lengthOfArrayLike = __webpack_require__(41);
|
13125 | var toIndexedObject = __webpack_require__(32);
|
13126 | var createProperty = __webpack_require__(91);
|
13127 | var wellKnownSymbol = __webpack_require__(9);
|
13128 | var arrayMethodHasSpeciesSupport = __webpack_require__(114);
|
13129 | var un$Slice = __webpack_require__(110);
|
13130 |
|
13131 | var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('slice');
|
13132 |
|
13133 | var SPECIES = wellKnownSymbol('species');
|
13134 | var $Array = Array;
|
13135 | var max = Math.max;
|
13136 |
|
13137 |
|
13138 |
|
13139 |
|
13140 | $({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
|
13141 | slice: function slice(start, end) {
|
13142 | var O = toIndexedObject(this);
|
13143 | var length = lengthOfArrayLike(O);
|
13144 | var k = toAbsoluteIndex(start, length);
|
13145 | var fin = toAbsoluteIndex(end === undefined ? length : end, length);
|
13146 |
|
13147 | var Constructor, result, n;
|
13148 | if (isArray(O)) {
|
13149 | Constructor = O.constructor;
|
13150 |
|
13151 | if (isConstructor(Constructor) && (Constructor === $Array || isArray(Constructor.prototype))) {
|
13152 | Constructor = undefined;
|
13153 | } else if (isObject(Constructor)) {
|
13154 | Constructor = Constructor[SPECIES];
|
13155 | if (Constructor === null) Constructor = undefined;
|
13156 | }
|
13157 | if (Constructor === $Array || Constructor === undefined) {
|
13158 | return un$Slice(O, k, fin);
|
13159 | }
|
13160 | }
|
13161 | result = new (Constructor === undefined ? $Array : Constructor)(max(fin - k, 0));
|
13162 | for (n = 0; k < fin; k++, n++) if (k in O) createProperty(result, n, O[k]);
|
13163 | result.length = n;
|
13164 | return result;
|
13165 | }
|
13166 | });
|
13167 |
|
13168 |
|
13169 | }),
|
13170 |
|
13171 | (function(module, exports, __webpack_require__) {
|
13172 |
|
13173 | __webpack_require__(426);
|
13174 | var path = __webpack_require__(5);
|
13175 |
|
13176 | var Object = path.Object;
|
13177 |
|
13178 | var defineProperty = module.exports = function defineProperty(it, key, desc) {
|
13179 | return Object.defineProperty(it, key, desc);
|
13180 | };
|
13181 |
|
13182 | if (Object.defineProperty.sham) defineProperty.sham = true;
|
13183 |
|
13184 |
|
13185 | }),
|
13186 |
|
13187 | (function(module, exports, __webpack_require__) {
|
13188 |
|
13189 | var $ = __webpack_require__(0);
|
13190 | var DESCRIPTORS = __webpack_require__(14);
|
13191 | var defineProperty = __webpack_require__(23).f;
|
13192 |
|
13193 |
|
13194 |
|
13195 |
|
13196 | $({ target: 'Object', stat: true, forced: Object.defineProperty !== defineProperty, sham: !DESCRIPTORS }, {
|
13197 | defineProperty: defineProperty
|
13198 | });
|
13199 |
|
13200 |
|
13201 | }),
|
13202 |
|
13203 | (function(module, exports, __webpack_require__) {
|
13204 |
|
13205 | "use strict";
|
13206 |
|
13207 |
|
13208 | var ajax = __webpack_require__(116);
|
13209 |
|
13210 | var Cache = __webpack_require__(238);
|
13211 |
|
13212 | function AppRouter(AV) {
|
13213 | var _this = this;
|
13214 |
|
13215 | this.AV = AV;
|
13216 | this.lockedUntil = 0;
|
13217 | Cache.getAsync('serverURLs').then(function (data) {
|
13218 | if (_this.disabled) return;
|
13219 | if (!data) return _this.lock(0);
|
13220 | var serverURLs = data.serverURLs,
|
13221 | lockedUntil = data.lockedUntil;
|
13222 |
|
13223 | _this.AV._setServerURLs(serverURLs, false);
|
13224 |
|
13225 | _this.lockedUntil = lockedUntil;
|
13226 | }).catch(function () {
|
13227 | return _this.lock(0);
|
13228 | });
|
13229 | }
|
13230 |
|
13231 | AppRouter.prototype.disable = function disable() {
|
13232 | this.disabled = true;
|
13233 | };
|
13234 |
|
13235 | AppRouter.prototype.lock = function lock(ttl) {
|
13236 | this.lockedUntil = Date.now() + ttl;
|
13237 | };
|
13238 |
|
13239 | AppRouter.prototype.refresh = function refresh() {
|
13240 | var _this2 = this;
|
13241 |
|
13242 | if (this.disabled) return;
|
13243 | if (Date.now() < this.lockedUntil) return;
|
13244 | this.lock(10);
|
13245 | var url = 'https://app-router.com/2/route';
|
13246 | return ajax({
|
13247 | method: 'get',
|
13248 | url: url,
|
13249 | query: {
|
13250 | appId: this.AV.applicationId
|
13251 | }
|
13252 | }).then(function (servers) {
|
13253 | if (_this2.disabled) return;
|
13254 | var ttl = servers.ttl;
|
13255 | if (!ttl) throw new Error('missing ttl');
|
13256 | ttl = ttl * 1000;
|
13257 | var protocal = 'https://';
|
13258 | var serverURLs = {
|
13259 | push: protocal + servers.push_server,
|
13260 | stats: protocal + servers.stats_server,
|
13261 | engine: protocal + servers.engine_server,
|
13262 | api: protocal + servers.api_server
|
13263 | };
|
13264 |
|
13265 | _this2.AV._setServerURLs(serverURLs, false);
|
13266 |
|
13267 | _this2.lock(ttl);
|
13268 |
|
13269 | return Cache.setAsync('serverURLs', {
|
13270 | serverURLs: serverURLs,
|
13271 | lockedUntil: _this2.lockedUntil
|
13272 | }, ttl);
|
13273 | }).catch(function (error) {
|
13274 |
|
13275 | console.warn("refresh server URLs failed: ".concat(error.message));
|
13276 |
|
13277 | _this2.lock(600);
|
13278 | });
|
13279 | };
|
13280 |
|
13281 | module.exports = AppRouter;
|
13282 |
|
13283 | }),
|
13284 |
|
13285 | (function(module, exports, __webpack_require__) {
|
13286 |
|
13287 | module.exports = __webpack_require__(429);
|
13288 |
|
13289 |
|
13290 | }),
|
13291 |
|
13292 | (function(module, exports, __webpack_require__) {
|
13293 |
|
13294 | var parent = __webpack_require__(430);
|
13295 | __webpack_require__(453);
|
13296 | __webpack_require__(454);
|
13297 | __webpack_require__(455);
|
13298 | __webpack_require__(456);
|
13299 | __webpack_require__(457);
|
13300 |
|
13301 | __webpack_require__(458);
|
13302 | __webpack_require__(459);
|
13303 | __webpack_require__(460);
|
13304 |
|
13305 | module.exports = parent;
|
13306 |
|
13307 |
|
13308 | }),
|
13309 |
|
13310 | (function(module, exports, __webpack_require__) {
|
13311 |
|
13312 | var parent = __webpack_require__(244);
|
13313 |
|
13314 | module.exports = parent;
|
13315 |
|
13316 |
|
13317 | }),
|
13318 |
|
13319 | (function(module, exports, __webpack_require__) {
|
13320 |
|
13321 | __webpack_require__(229);
|
13322 | __webpack_require__(53);
|
13323 | __webpack_require__(245);
|
13324 | __webpack_require__(437);
|
13325 | __webpack_require__(438);
|
13326 | __webpack_require__(439);
|
13327 | __webpack_require__(440);
|
13328 | __webpack_require__(249);
|
13329 | __webpack_require__(441);
|
13330 | __webpack_require__(442);
|
13331 | __webpack_require__(443);
|
13332 | __webpack_require__(444);
|
13333 | __webpack_require__(445);
|
13334 | __webpack_require__(446);
|
13335 | __webpack_require__(447);
|
13336 | __webpack_require__(448);
|
13337 | __webpack_require__(449);
|
13338 | __webpack_require__(450);
|
13339 | __webpack_require__(451);
|
13340 | __webpack_require__(452);
|
13341 | var path = __webpack_require__(5);
|
13342 |
|
13343 | module.exports = path.Symbol;
|
13344 |
|
13345 |
|
13346 | }),
|
13347 |
|
13348 | (function(module, exports, __webpack_require__) {
|
13349 |
|
13350 | "use strict";
|
13351 |
|
13352 | var $ = __webpack_require__(0);
|
13353 | var global = __webpack_require__(7);
|
13354 | var call = __webpack_require__(15);
|
13355 | var uncurryThis = __webpack_require__(4);
|
13356 | var IS_PURE = __webpack_require__(33);
|
13357 | var DESCRIPTORS = __webpack_require__(14);
|
13358 | var NATIVE_SYMBOL = __webpack_require__(64);
|
13359 | var fails = __webpack_require__(2);
|
13360 | var hasOwn = __webpack_require__(13);
|
13361 | var isPrototypeOf = __webpack_require__(19);
|
13362 | var anObject = __webpack_require__(20);
|
13363 | var toIndexedObject = __webpack_require__(32);
|
13364 | var toPropertyKey = __webpack_require__(96);
|
13365 | var $toString = __webpack_require__(81);
|
13366 | var createPropertyDescriptor = __webpack_require__(47);
|
13367 | var nativeObjectCreate = __webpack_require__(49);
|
13368 | var objectKeys = __webpack_require__(105);
|
13369 | var getOwnPropertyNamesModule = __webpack_require__(103);
|
13370 | var getOwnPropertyNamesExternal = __webpack_require__(246);
|
13371 | var getOwnPropertySymbolsModule = __webpack_require__(104);
|
13372 | var getOwnPropertyDescriptorModule = __webpack_require__(62);
|
13373 | var definePropertyModule = __webpack_require__(23);
|
13374 | var definePropertiesModule = __webpack_require__(129);
|
13375 | var propertyIsEnumerableModule = __webpack_require__(121);
|
13376 | var defineBuiltIn = __webpack_require__(44);
|
13377 | var shared = __webpack_require__(79);
|
13378 | var sharedKey = __webpack_require__(101);
|
13379 | var hiddenKeys = __webpack_require__(80);
|
13380 | var uid = __webpack_require__(99);
|
13381 | var wellKnownSymbol = __webpack_require__(9);
|
13382 | var wrappedWellKnownSymbolModule = __webpack_require__(149);
|
13383 | var defineWellKnownSymbol = __webpack_require__(10);
|
13384 | var defineSymbolToPrimitive = __webpack_require__(247);
|
13385 | var setToStringTag = __webpack_require__(52);
|
13386 | var InternalStateModule = __webpack_require__(43);
|
13387 | var $forEach = __webpack_require__(70).forEach;
|
13388 |
|
13389 | var HIDDEN = sharedKey('hidden');
|
13390 | var SYMBOL = 'Symbol';
|
13391 | var PROTOTYPE = 'prototype';
|
13392 |
|
13393 | var setInternalState = InternalStateModule.set;
|
13394 | var getInternalState = InternalStateModule.getterFor(SYMBOL);
|
13395 |
|
13396 | var ObjectPrototype = Object[PROTOTYPE];
|
13397 | var $Symbol = global.Symbol;
|
13398 | var SymbolPrototype = $Symbol && $Symbol[PROTOTYPE];
|
13399 | var TypeError = global.TypeError;
|
13400 | var QObject = global.QObject;
|
13401 | var nativeGetOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
|
13402 | var nativeDefineProperty = definePropertyModule.f;
|
13403 | var nativeGetOwnPropertyNames = getOwnPropertyNamesExternal.f;
|
13404 | var nativePropertyIsEnumerable = propertyIsEnumerableModule.f;
|
13405 | var push = uncurryThis([].push);
|
13406 |
|
13407 | var AllSymbols = shared('symbols');
|
13408 | var ObjectPrototypeSymbols = shared('op-symbols');
|
13409 | var WellKnownSymbolsStore = shared('wks');
|
13410 |
|
13411 |
|
13412 | var USE_SETTER = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;
|
13413 |
|
13414 |
|
13415 | var setSymbolDescriptor = DESCRIPTORS && fails(function () {
|
13416 | return nativeObjectCreate(nativeDefineProperty({}, 'a', {
|
13417 | get: function () { return nativeDefineProperty(this, 'a', { value: 7 }).a; }
|
13418 | })).a != 7;
|
13419 | }) ? function (O, P, Attributes) {
|
13420 | var ObjectPrototypeDescriptor = nativeGetOwnPropertyDescriptor(ObjectPrototype, P);
|
13421 | if (ObjectPrototypeDescriptor) delete ObjectPrototype[P];
|
13422 | nativeDefineProperty(O, P, Attributes);
|
13423 | if (ObjectPrototypeDescriptor && O !== ObjectPrototype) {
|
13424 | nativeDefineProperty(ObjectPrototype, P, ObjectPrototypeDescriptor);
|
13425 | }
|
13426 | } : nativeDefineProperty;
|
13427 |
|
13428 | var wrap = function (tag, description) {
|
13429 | var symbol = AllSymbols[tag] = nativeObjectCreate(SymbolPrototype);
|
13430 | setInternalState(symbol, {
|
13431 | type: SYMBOL,
|
13432 | tag: tag,
|
13433 | description: description
|
13434 | });
|
13435 | if (!DESCRIPTORS) symbol.description = description;
|
13436 | return symbol;
|
13437 | };
|
13438 |
|
13439 | var $defineProperty = function defineProperty(O, P, Attributes) {
|
13440 | if (O === ObjectPrototype) $defineProperty(ObjectPrototypeSymbols, P, Attributes);
|
13441 | anObject(O);
|
13442 | var key = toPropertyKey(P);
|
13443 | anObject(Attributes);
|
13444 | if (hasOwn(AllSymbols, key)) {
|
13445 | if (!Attributes.enumerable) {
|
13446 | if (!hasOwn(O, HIDDEN)) nativeDefineProperty(O, HIDDEN, createPropertyDescriptor(1, {}));
|
13447 | O[HIDDEN][key] = true;
|
13448 | } else {
|
13449 | if (hasOwn(O, HIDDEN) && O[HIDDEN][key]) O[HIDDEN][key] = false;
|
13450 | Attributes = nativeObjectCreate(Attributes, { enumerable: createPropertyDescriptor(0, false) });
|
13451 | } return setSymbolDescriptor(O, key, Attributes);
|
13452 | } return nativeDefineProperty(O, key, Attributes);
|
13453 | };
|
13454 |
|
13455 | var $defineProperties = function defineProperties(O, Properties) {
|
13456 | anObject(O);
|
13457 | var properties = toIndexedObject(Properties);
|
13458 | var keys = objectKeys(properties).concat($getOwnPropertySymbols(properties));
|
13459 | $forEach(keys, function (key) {
|
13460 | if (!DESCRIPTORS || call($propertyIsEnumerable, properties, key)) $defineProperty(O, key, properties[key]);
|
13461 | });
|
13462 | return O;
|
13463 | };
|
13464 |
|
13465 | var $create = function create(O, Properties) {
|
13466 | return Properties === undefined ? nativeObjectCreate(O) : $defineProperties(nativeObjectCreate(O), Properties);
|
13467 | };
|
13468 |
|
13469 | var $propertyIsEnumerable = function propertyIsEnumerable(V) {
|
13470 | var P = toPropertyKey(V);
|
13471 | var enumerable = call(nativePropertyIsEnumerable, this, P);
|
13472 | if (this === ObjectPrototype && hasOwn(AllSymbols, P) && !hasOwn(ObjectPrototypeSymbols, P)) return false;
|
13473 | return enumerable || !hasOwn(this, P) || !hasOwn(AllSymbols, P) || hasOwn(this, HIDDEN) && this[HIDDEN][P]
|
13474 | ? enumerable : true;
|
13475 | };
|
13476 |
|
13477 | var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(O, P) {
|
13478 | var it = toIndexedObject(O);
|
13479 | var key = toPropertyKey(P);
|
13480 | if (it === ObjectPrototype && hasOwn(AllSymbols, key) && !hasOwn(ObjectPrototypeSymbols, key)) return;
|
13481 | var descriptor = nativeGetOwnPropertyDescriptor(it, key);
|
13482 | if (descriptor && hasOwn(AllSymbols, key) && !(hasOwn(it, HIDDEN) && it[HIDDEN][key])) {
|
13483 | descriptor.enumerable = true;
|
13484 | }
|
13485 | return descriptor;
|
13486 | };
|
13487 |
|
13488 | var $getOwnPropertyNames = function getOwnPropertyNames(O) {
|
13489 | var names = nativeGetOwnPropertyNames(toIndexedObject(O));
|
13490 | var result = [];
|
13491 | $forEach(names, function (key) {
|
13492 | if (!hasOwn(AllSymbols, key) && !hasOwn(hiddenKeys, key)) push(result, key);
|
13493 | });
|
13494 | return result;
|
13495 | };
|
13496 |
|
13497 | var $getOwnPropertySymbols = function (O) {
|
13498 | var IS_OBJECT_PROTOTYPE = O === ObjectPrototype;
|
13499 | var names = nativeGetOwnPropertyNames(IS_OBJECT_PROTOTYPE ? ObjectPrototypeSymbols : toIndexedObject(O));
|
13500 | var result = [];
|
13501 | $forEach(names, function (key) {
|
13502 | if (hasOwn(AllSymbols, key) && (!IS_OBJECT_PROTOTYPE || hasOwn(ObjectPrototype, key))) {
|
13503 | push(result, AllSymbols[key]);
|
13504 | }
|
13505 | });
|
13506 | return result;
|
13507 | };
|
13508 |
|
13509 |
|
13510 |
|
13511 | if (!NATIVE_SYMBOL) {
|
13512 | $Symbol = function Symbol() {
|
13513 | if (isPrototypeOf(SymbolPrototype, this)) throw TypeError('Symbol is not a constructor');
|
13514 | var description = !arguments.length || arguments[0] === undefined ? undefined : $toString(arguments[0]);
|
13515 | var tag = uid(description);
|
13516 | var setter = function (value) {
|
13517 | if (this === ObjectPrototype) call(setter, ObjectPrototypeSymbols, value);
|
13518 | if (hasOwn(this, HIDDEN) && hasOwn(this[HIDDEN], tag)) this[HIDDEN][tag] = false;
|
13519 | setSymbolDescriptor(this, tag, createPropertyDescriptor(1, value));
|
13520 | };
|
13521 | if (DESCRIPTORS && USE_SETTER) setSymbolDescriptor(ObjectPrototype, tag, { configurable: true, set: setter });
|
13522 | return wrap(tag, description);
|
13523 | };
|
13524 |
|
13525 | SymbolPrototype = $Symbol[PROTOTYPE];
|
13526 |
|
13527 | defineBuiltIn(SymbolPrototype, 'toString', function toString() {
|
13528 | return getInternalState(this).tag;
|
13529 | });
|
13530 |
|
13531 | defineBuiltIn($Symbol, 'withoutSetter', function (description) {
|
13532 | return wrap(uid(description), description);
|
13533 | });
|
13534 |
|
13535 | propertyIsEnumerableModule.f = $propertyIsEnumerable;
|
13536 | definePropertyModule.f = $defineProperty;
|
13537 | definePropertiesModule.f = $defineProperties;
|
13538 | getOwnPropertyDescriptorModule.f = $getOwnPropertyDescriptor;
|
13539 | getOwnPropertyNamesModule.f = getOwnPropertyNamesExternal.f = $getOwnPropertyNames;
|
13540 | getOwnPropertySymbolsModule.f = $getOwnPropertySymbols;
|
13541 |
|
13542 | wrappedWellKnownSymbolModule.f = function (name) {
|
13543 | return wrap(wellKnownSymbol(name), name);
|
13544 | };
|
13545 |
|
13546 | if (DESCRIPTORS) {
|
13547 |
|
13548 | nativeDefineProperty(SymbolPrototype, 'description', {
|
13549 | configurable: true,
|
13550 | get: function description() {
|
13551 | return getInternalState(this).description;
|
13552 | }
|
13553 | });
|
13554 | if (!IS_PURE) {
|
13555 | defineBuiltIn(ObjectPrototype, 'propertyIsEnumerable', $propertyIsEnumerable, { unsafe: true });
|
13556 | }
|
13557 | }
|
13558 | }
|
13559 |
|
13560 | $({ global: true, constructor: true, wrap: true, forced: !NATIVE_SYMBOL, sham: !NATIVE_SYMBOL }, {
|
13561 | Symbol: $Symbol
|
13562 | });
|
13563 |
|
13564 | $forEach(objectKeys(WellKnownSymbolsStore), function (name) {
|
13565 | defineWellKnownSymbol(name);
|
13566 | });
|
13567 |
|
13568 | $({ target: SYMBOL, stat: true, forced: !NATIVE_SYMBOL }, {
|
13569 | useSetter: function () { USE_SETTER = true; },
|
13570 | useSimple: function () { USE_SETTER = false; }
|
13571 | });
|
13572 |
|
13573 | $({ target: 'Object', stat: true, forced: !NATIVE_SYMBOL, sham: !DESCRIPTORS }, {
|
13574 |
|
13575 |
|
13576 | create: $create,
|
13577 |
|
13578 |
|
13579 | defineProperty: $defineProperty,
|
13580 |
|
13581 |
|
13582 | defineProperties: $defineProperties,
|
13583 |
|
13584 |
|
13585 | getOwnPropertyDescriptor: $getOwnPropertyDescriptor
|
13586 | });
|
13587 |
|
13588 | $({ target: 'Object', stat: true, forced: !NATIVE_SYMBOL }, {
|
13589 |
|
13590 |
|
13591 | getOwnPropertyNames: $getOwnPropertyNames
|
13592 | });
|
13593 |
|
13594 |
|
13595 |
|
13596 | defineSymbolToPrimitive();
|
13597 |
|
13598 |
|
13599 |
|
13600 | setToStringTag($Symbol, SYMBOL);
|
13601 |
|
13602 | hiddenKeys[HIDDEN] = true;
|
13603 |
|
13604 |
|
13605 | }),
|
13606 |
|
13607 | (function(module, exports, __webpack_require__) {
|
13608 |
|
13609 | var toAbsoluteIndex = __webpack_require__(126);
|
13610 | var lengthOfArrayLike = __webpack_require__(41);
|
13611 | var createProperty = __webpack_require__(91);
|
13612 |
|
13613 | var $Array = Array;
|
13614 | var max = Math.max;
|
13615 |
|
13616 | module.exports = function (O, start, end) {
|
13617 | var length = lengthOfArrayLike(O);
|
13618 | var k = toAbsoluteIndex(start, length);
|
13619 | var fin = toAbsoluteIndex(end === undefined ? length : end, length);
|
13620 | var result = $Array(max(fin - k, 0));
|
13621 | for (var n = 0; k < fin; k++, n++) createProperty(result, n, O[k]);
|
13622 | result.length = n;
|
13623 | return result;
|
13624 | };
|
13625 |
|
13626 |
|
13627 | }),
|
13628 |
|
13629 | (function(module, exports, __webpack_require__) {
|
13630 |
|
13631 | var $ = __webpack_require__(0);
|
13632 | var getBuiltIn = __webpack_require__(18);
|
13633 | var hasOwn = __webpack_require__(13);
|
13634 | var toString = __webpack_require__(81);
|
13635 | var shared = __webpack_require__(79);
|
13636 | var NATIVE_SYMBOL_REGISTRY = __webpack_require__(248);
|
13637 |
|
13638 | var StringToSymbolRegistry = shared('string-to-symbol-registry');
|
13639 | var SymbolToStringRegistry = shared('symbol-to-string-registry');
|
13640 |
|
13641 |
|
13642 |
|
13643 | $({ target: 'Symbol', stat: true, forced: !NATIVE_SYMBOL_REGISTRY }, {
|
13644 | 'for': function (key) {
|
13645 | var string = toString(key);
|
13646 | if (hasOwn(StringToSymbolRegistry, string)) return StringToSymbolRegistry[string];
|
13647 | var symbol = getBuiltIn('Symbol')(string);
|
13648 | StringToSymbolRegistry[string] = symbol;
|
13649 | SymbolToStringRegistry[symbol] = string;
|
13650 | return symbol;
|
13651 | }
|
13652 | });
|
13653 |
|
13654 |
|
13655 | }),
|
13656 |
|
13657 | (function(module, exports, __webpack_require__) {
|
13658 |
|
13659 | var $ = __webpack_require__(0);
|
13660 | var hasOwn = __webpack_require__(13);
|
13661 | var isSymbol = __webpack_require__(97);
|
13662 | var tryToString = __webpack_require__(78);
|
13663 | var shared = __webpack_require__(79);
|
13664 | var NATIVE_SYMBOL_REGISTRY = __webpack_require__(248);
|
13665 |
|
13666 | var SymbolToStringRegistry = shared('symbol-to-string-registry');
|
13667 |
|
13668 |
|
13669 |
|
13670 | $({ target: 'Symbol', stat: true, forced: !NATIVE_SYMBOL_REGISTRY }, {
|
13671 | keyFor: function keyFor(sym) {
|
13672 | if (!isSymbol(sym)) throw TypeError(tryToString(sym) + ' is not a symbol');
|
13673 | if (hasOwn(SymbolToStringRegistry, sym)) return SymbolToStringRegistry[sym];
|
13674 | }
|
13675 | });
|
13676 |
|
13677 |
|
13678 | }),
|
13679 |
|
13680 | (function(module, exports, __webpack_require__) {
|
13681 |
|
13682 | var $ = __webpack_require__(0);
|
13683 | var NATIVE_SYMBOL = __webpack_require__(64);
|
13684 | var fails = __webpack_require__(2);
|
13685 | var getOwnPropertySymbolsModule = __webpack_require__(104);
|
13686 | var toObject = __webpack_require__(34);
|
13687 |
|
13688 |
|
13689 |
|
13690 | var FORCED = !NATIVE_SYMBOL || fails(function () { getOwnPropertySymbolsModule.f(1); });
|
13691 |
|
13692 |
|
13693 |
|
13694 | $({ target: 'Object', stat: true, forced: FORCED }, {
|
13695 | getOwnPropertySymbols: function getOwnPropertySymbols(it) {
|
13696 | var $getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
|
13697 | return $getOwnPropertySymbols ? $getOwnPropertySymbols(toObject(it)) : [];
|
13698 | }
|
13699 | });
|
13700 |
|
13701 |
|
13702 | }),
|
13703 |
|
13704 | (function(module, exports, __webpack_require__) {
|
13705 |
|
13706 | var defineWellKnownSymbol = __webpack_require__(10);
|
13707 |
|
13708 |
|
13709 |
|
13710 | defineWellKnownSymbol('asyncIterator');
|
13711 |
|
13712 |
|
13713 | }),
|
13714 |
|
13715 | (function(module, exports) {
|
13716 |
|
13717 |
|
13718 |
|
13719 |
|
13720 | }),
|
13721 |
|
13722 | (function(module, exports, __webpack_require__) {
|
13723 |
|
13724 | var defineWellKnownSymbol = __webpack_require__(10);
|
13725 |
|
13726 |
|
13727 |
|
13728 | defineWellKnownSymbol('hasInstance');
|
13729 |
|
13730 |
|
13731 | }),
|
13732 |
|
13733 | (function(module, exports, __webpack_require__) {
|
13734 |
|
13735 | var defineWellKnownSymbol = __webpack_require__(10);
|
13736 |
|
13737 |
|
13738 |
|
13739 | defineWellKnownSymbol('isConcatSpreadable');
|
13740 |
|
13741 |
|
13742 | }),
|
13743 |
|
13744 | (function(module, exports, __webpack_require__) {
|
13745 |
|
13746 | var defineWellKnownSymbol = __webpack_require__(10);
|
13747 |
|
13748 |
|
13749 |
|
13750 | defineWellKnownSymbol('match');
|
13751 |
|
13752 |
|
13753 | }),
|
13754 |
|
13755 | (function(module, exports, __webpack_require__) {
|
13756 |
|
13757 | var defineWellKnownSymbol = __webpack_require__(10);
|
13758 |
|
13759 |
|
13760 |
|
13761 | defineWellKnownSymbol('matchAll');
|
13762 |
|
13763 |
|
13764 | }),
|
13765 |
|
13766 | (function(module, exports, __webpack_require__) {
|
13767 |
|
13768 | var defineWellKnownSymbol = __webpack_require__(10);
|
13769 |
|
13770 |
|
13771 |
|
13772 | defineWellKnownSymbol('replace');
|
13773 |
|
13774 |
|
13775 | }),
|
13776 |
|
13777 | (function(module, exports, __webpack_require__) {
|
13778 |
|
13779 | var defineWellKnownSymbol = __webpack_require__(10);
|
13780 |
|
13781 |
|
13782 |
|
13783 | defineWellKnownSymbol('search');
|
13784 |
|
13785 |
|
13786 | }),
|
13787 |
|
13788 | (function(module, exports, __webpack_require__) {
|
13789 |
|
13790 | var defineWellKnownSymbol = __webpack_require__(10);
|
13791 |
|
13792 |
|
13793 |
|
13794 | defineWellKnownSymbol('species');
|
13795 |
|
13796 |
|
13797 | }),
|
13798 |
|
13799 | (function(module, exports, __webpack_require__) {
|
13800 |
|
13801 | var defineWellKnownSymbol = __webpack_require__(10);
|
13802 |
|
13803 |
|
13804 |
|
13805 | defineWellKnownSymbol('split');
|
13806 |
|
13807 |
|
13808 | }),
|
13809 |
|
13810 | (function(module, exports, __webpack_require__) {
|
13811 |
|
13812 | var defineWellKnownSymbol = __webpack_require__(10);
|
13813 | var defineSymbolToPrimitive = __webpack_require__(247);
|
13814 |
|
13815 |
|
13816 |
|
13817 | defineWellKnownSymbol('toPrimitive');
|
13818 |
|
13819 |
|
13820 |
|
13821 | defineSymbolToPrimitive();
|
13822 |
|
13823 |
|
13824 | }),
|
13825 |
|
13826 | (function(module, exports, __webpack_require__) {
|
13827 |
|
13828 | var getBuiltIn = __webpack_require__(18);
|
13829 | var defineWellKnownSymbol = __webpack_require__(10);
|
13830 | var setToStringTag = __webpack_require__(52);
|
13831 |
|
13832 |
|
13833 |
|
13834 | defineWellKnownSymbol('toStringTag');
|
13835 |
|
13836 |
|
13837 |
|
13838 | setToStringTag(getBuiltIn('Symbol'), 'Symbol');
|
13839 |
|
13840 |
|
13841 | }),
|
13842 |
|
13843 | (function(module, exports, __webpack_require__) {
|
13844 |
|
13845 | var defineWellKnownSymbol = __webpack_require__(10);
|
13846 |
|
13847 |
|
13848 |
|
13849 | defineWellKnownSymbol('unscopables');
|
13850 |
|
13851 |
|
13852 | }),
|
13853 |
|
13854 | (function(module, exports, __webpack_require__) {
|
13855 |
|
13856 | var global = __webpack_require__(7);
|
13857 | var setToStringTag = __webpack_require__(52);
|
13858 |
|
13859 |
|
13860 |
|
13861 | setToStringTag(global.JSON, 'JSON', true);
|
13862 |
|
13863 |
|
13864 | }),
|
13865 |
|
13866 | (function(module, exports) {
|
13867 |
|
13868 |
|
13869 |
|
13870 |
|
13871 | }),
|
13872 |
|
13873 | (function(module, exports) {
|
13874 |
|
13875 |
|
13876 |
|
13877 |
|
13878 | }),
|
13879 |
|
13880 | (function(module, exports, __webpack_require__) {
|
13881 |
|
13882 | var defineWellKnownSymbol = __webpack_require__(10);
|
13883 |
|
13884 |
|
13885 |
|
13886 | defineWellKnownSymbol('asyncDispose');
|
13887 |
|
13888 |
|
13889 | }),
|
13890 |
|
13891 | (function(module, exports, __webpack_require__) {
|
13892 |
|
13893 | var defineWellKnownSymbol = __webpack_require__(10);
|
13894 |
|
13895 |
|
13896 |
|
13897 | defineWellKnownSymbol('dispose');
|
13898 |
|
13899 |
|
13900 | }),
|
13901 |
|
13902 | (function(module, exports, __webpack_require__) {
|
13903 |
|
13904 | var defineWellKnownSymbol = __webpack_require__(10);
|
13905 |
|
13906 |
|
13907 |
|
13908 | defineWellKnownSymbol('matcher');
|
13909 |
|
13910 |
|
13911 | }),
|
13912 |
|
13913 | (function(module, exports, __webpack_require__) {
|
13914 |
|
13915 | var defineWellKnownSymbol = __webpack_require__(10);
|
13916 |
|
13917 |
|
13918 |
|
13919 | defineWellKnownSymbol('metadataKey');
|
13920 |
|
13921 |
|
13922 | }),
|
13923 |
|
13924 | (function(module, exports, __webpack_require__) {
|
13925 |
|
13926 | var defineWellKnownSymbol = __webpack_require__(10);
|
13927 |
|
13928 |
|
13929 |
|
13930 | defineWellKnownSymbol('observable');
|
13931 |
|
13932 |
|
13933 | }),
|
13934 |
|
13935 | (function(module, exports, __webpack_require__) {
|
13936 |
|
13937 |
|
13938 | var defineWellKnownSymbol = __webpack_require__(10);
|
13939 |
|
13940 |
|
13941 |
|
13942 | defineWellKnownSymbol('metadata');
|
13943 |
|
13944 |
|
13945 | }),
|
13946 |
|
13947 | (function(module, exports, __webpack_require__) {
|
13948 |
|
13949 |
|
13950 | var defineWellKnownSymbol = __webpack_require__(10);
|
13951 |
|
13952 |
|
13953 |
|
13954 | defineWellKnownSymbol('patternMatch');
|
13955 |
|
13956 |
|
13957 | }),
|
13958 |
|
13959 | (function(module, exports, __webpack_require__) {
|
13960 |
|
13961 |
|
13962 | var defineWellKnownSymbol = __webpack_require__(10);
|
13963 |
|
13964 | defineWellKnownSymbol('replaceAll');
|
13965 |
|
13966 |
|
13967 | }),
|
13968 |
|
13969 | (function(module, exports, __webpack_require__) {
|
13970 |
|
13971 | module.exports = __webpack_require__(462);
|
13972 |
|
13973 | }),
|
13974 |
|
13975 | (function(module, exports, __webpack_require__) {
|
13976 |
|
13977 | module.exports = __webpack_require__(463);
|
13978 |
|
13979 |
|
13980 | }),
|
13981 |
|
13982 | (function(module, exports, __webpack_require__) {
|
13983 |
|
13984 | var parent = __webpack_require__(464);
|
13985 |
|
13986 | module.exports = parent;
|
13987 |
|
13988 |
|
13989 | }),
|
13990 |
|
13991 | (function(module, exports, __webpack_require__) {
|
13992 |
|
13993 | var parent = __webpack_require__(250);
|
13994 |
|
13995 | module.exports = parent;
|
13996 |
|
13997 |
|
13998 | }),
|
13999 |
|
14000 | (function(module, exports, __webpack_require__) {
|
14001 |
|
14002 | __webpack_require__(38);
|
14003 | __webpack_require__(53);
|
14004 | __webpack_require__(55);
|
14005 | __webpack_require__(249);
|
14006 | var WrappedWellKnownSymbolModule = __webpack_require__(149);
|
14007 |
|
14008 | module.exports = WrappedWellKnownSymbolModule.f('iterator');
|
14009 |
|
14010 |
|
14011 | }),
|
14012 |
|
14013 | (function(module, exports, __webpack_require__) {
|
14014 |
|
14015 | var parent = __webpack_require__(467);
|
14016 |
|
14017 | module.exports = parent;
|
14018 |
|
14019 |
|
14020 | }),
|
14021 |
|
14022 | (function(module, exports, __webpack_require__) {
|
14023 |
|
14024 | var isPrototypeOf = __webpack_require__(19);
|
14025 | var method = __webpack_require__(468);
|
14026 |
|
14027 | var ArrayPrototype = Array.prototype;
|
14028 |
|
14029 | module.exports = function (it) {
|
14030 | var own = it.filter;
|
14031 | return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.filter) ? method : own;
|
14032 | };
|
14033 |
|
14034 |
|
14035 | }),
|
14036 |
|
14037 | (function(module, exports, __webpack_require__) {
|
14038 |
|
14039 | __webpack_require__(469);
|
14040 | var entryVirtual = __webpack_require__(40);
|
14041 |
|
14042 | module.exports = entryVirtual('Array').filter;
|
14043 |
|
14044 |
|
14045 | }),
|
14046 |
|
14047 | (function(module, exports, __webpack_require__) {
|
14048 |
|
14049 | "use strict";
|
14050 |
|
14051 | var $ = __webpack_require__(0);
|
14052 | var $filter = __webpack_require__(70).filter;
|
14053 | var arrayMethodHasSpeciesSupport = __webpack_require__(114);
|
14054 |
|
14055 | var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('filter');
|
14056 |
|
14057 |
|
14058 |
|
14059 |
|
14060 | $({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
|
14061 | filter: function filter(callbackfn /* , thisArg */) {
|
14062 | return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
14063 | }
|
14064 | });
|
14065 |
|
14066 |
|
14067 | }),
|
14068 |
|
14069 | (function(module, exports, __webpack_require__) {
|
14070 |
|
14071 | "use strict";
|
14072 |
|
14073 |
|
14074 | var _interopRequireDefault = __webpack_require__(1);
|
14075 |
|
14076 | var _slice = _interopRequireDefault(__webpack_require__(61));
|
14077 |
|
14078 | var _keys = _interopRequireDefault(__webpack_require__(59));
|
14079 |
|
14080 | var _concat = _interopRequireDefault(__webpack_require__(22));
|
14081 |
|
14082 | var _ = __webpack_require__(3);
|
14083 |
|
14084 | module.exports = function (AV) {
|
14085 | var eventSplitter = /\s+/;
|
14086 | var slice = (0, _slice.default)(Array.prototype);
|
14087 | |
14088 |
|
14089 |
|
14090 |
|
14091 |
|
14092 |
|
14093 |
|
14094 |
|
14095 |
|
14096 |
|
14097 |
|
14098 |
|
14099 |
|
14100 |
|
14101 |
|
14102 |
|
14103 |
|
14104 |
|
14105 |
|
14106 |
|
14107 |
|
14108 | AV.Events = {
|
14109 | |
14110 |
|
14111 |
|
14112 |
|
14113 | on: function on(events, callback, context) {
|
14114 | var calls, event, node, tail, list;
|
14115 |
|
14116 | if (!callback) {
|
14117 | return this;
|
14118 | }
|
14119 |
|
14120 | events = events.split(eventSplitter);
|
14121 | calls = this._callbacks || (this._callbacks = {});
|
14122 |
|
14123 |
|
14124 |
|
14125 | event = events.shift();
|
14126 |
|
14127 | while (event) {
|
14128 | list = calls[event];
|
14129 | node = list ? list.tail : {};
|
14130 | node.next = tail = {};
|
14131 | node.context = context;
|
14132 | node.callback = callback;
|
14133 | calls[event] = {
|
14134 | tail: tail,
|
14135 | next: list ? list.next : node
|
14136 | };
|
14137 | event = events.shift();
|
14138 | }
|
14139 |
|
14140 | return this;
|
14141 | },
|
14142 |
|
14143 | |
14144 |
|
14145 |
|
14146 |
|
14147 |
|
14148 | off: function off(events, callback, context) {
|
14149 | var event, calls, node, tail, cb, ctx;
|
14150 |
|
14151 | if (!(calls = this._callbacks)) {
|
14152 | return;
|
14153 | }
|
14154 |
|
14155 | if (!(events || callback || context)) {
|
14156 | delete this._callbacks;
|
14157 | return this;
|
14158 | }
|
14159 |
|
14160 |
|
14161 |
|
14162 | events = events ? events.split(eventSplitter) : (0, _keys.default)(_).call(_, calls);
|
14163 | event = events.shift();
|
14164 |
|
14165 | while (event) {
|
14166 | node = calls[event];
|
14167 | delete calls[event];
|
14168 |
|
14169 | if (!node || !(callback || context)) {
|
14170 | continue;
|
14171 | }
|
14172 |
|
14173 |
|
14174 | tail = node.tail;
|
14175 | node = node.next;
|
14176 |
|
14177 | while (node !== tail) {
|
14178 | cb = node.callback;
|
14179 | ctx = node.context;
|
14180 |
|
14181 | if (callback && cb !== callback || context && ctx !== context) {
|
14182 | this.on(event, cb, ctx);
|
14183 | }
|
14184 |
|
14185 | node = node.next;
|
14186 | }
|
14187 |
|
14188 | event = events.shift();
|
14189 | }
|
14190 |
|
14191 | return this;
|
14192 | },
|
14193 |
|
14194 | |
14195 |
|
14196 |
|
14197 |
|
14198 |
|
14199 |
|
14200 | trigger: function trigger(events) {
|
14201 | var event, node, calls, tail, args, all, rest;
|
14202 |
|
14203 | if (!(calls = this._callbacks)) {
|
14204 | return this;
|
14205 | }
|
14206 |
|
14207 | all = calls.all;
|
14208 | events = events.split(eventSplitter);
|
14209 | rest = slice.call(arguments, 1);
|
14210 |
|
14211 |
|
14212 | event = events.shift();
|
14213 |
|
14214 | while (event) {
|
14215 | node = calls[event];
|
14216 |
|
14217 | if (node) {
|
14218 | tail = node.tail;
|
14219 |
|
14220 | while ((node = node.next) !== tail) {
|
14221 | node.callback.apply(node.context || this, rest);
|
14222 | }
|
14223 | }
|
14224 |
|
14225 | node = all;
|
14226 |
|
14227 | if (node) {
|
14228 | var _context;
|
14229 |
|
14230 | tail = node.tail;
|
14231 | args = (0, _concat.default)(_context = [event]).call(_context, rest);
|
14232 |
|
14233 | while ((node = node.next) !== tail) {
|
14234 | node.callback.apply(node.context || this, args);
|
14235 | }
|
14236 | }
|
14237 |
|
14238 | event = events.shift();
|
14239 | }
|
14240 |
|
14241 | return this;
|
14242 | }
|
14243 | };
|
14244 | |
14245 |
|
14246 |
|
14247 |
|
14248 | AV.Events.bind = AV.Events.on;
|
14249 | |
14250 |
|
14251 |
|
14252 |
|
14253 | AV.Events.unbind = AV.Events.off;
|
14254 | };
|
14255 |
|
14256 | }),
|
14257 |
|
14258 | (function(module, exports, __webpack_require__) {
|
14259 |
|
14260 | "use strict";
|
14261 |
|
14262 |
|
14263 | var _interopRequireDefault = __webpack_require__(1);
|
14264 |
|
14265 | var _promise = _interopRequireDefault(__webpack_require__(12));
|
14266 |
|
14267 | var _ = __webpack_require__(3);
|
14268 |
|
14269 |
|
14270 |
|
14271 | module.exports = function (AV) {
|
14272 | |
14273 |
|
14274 |
|
14275 |
|
14276 |
|
14277 |
|
14278 |
|
14279 |
|
14280 |
|
14281 |
|
14282 |
|
14283 |
|
14284 |
|
14285 |
|
14286 |
|
14287 |
|
14288 |
|
14289 |
|
14290 |
|
14291 |
|
14292 |
|
14293 |
|
14294 | AV.GeoPoint = function (arg1, arg2) {
|
14295 | if (_.isArray(arg1)) {
|
14296 | AV.GeoPoint._validate(arg1[0], arg1[1]);
|
14297 |
|
14298 | this.latitude = arg1[0];
|
14299 | this.longitude = arg1[1];
|
14300 | } else if (_.isObject(arg1)) {
|
14301 | AV.GeoPoint._validate(arg1.latitude, arg1.longitude);
|
14302 |
|
14303 | this.latitude = arg1.latitude;
|
14304 | this.longitude = arg1.longitude;
|
14305 | } else if (_.isNumber(arg1) && _.isNumber(arg2)) {
|
14306 | AV.GeoPoint._validate(arg1, arg2);
|
14307 |
|
14308 | this.latitude = arg1;
|
14309 | this.longitude = arg2;
|
14310 | } else {
|
14311 | this.latitude = 0;
|
14312 | this.longitude = 0;
|
14313 | }
|
14314 |
|
14315 |
|
14316 |
|
14317 | var self = this;
|
14318 |
|
14319 | if (this.__defineGetter__ && this.__defineSetter__) {
|
14320 |
|
14321 |
|
14322 | this._latitude = this.latitude;
|
14323 | this._longitude = this.longitude;
|
14324 |
|
14325 | this.__defineGetter__('latitude', function () {
|
14326 | return self._latitude;
|
14327 | });
|
14328 |
|
14329 | this.__defineGetter__('longitude', function () {
|
14330 | return self._longitude;
|
14331 | });
|
14332 |
|
14333 | this.__defineSetter__('latitude', function (val) {
|
14334 | AV.GeoPoint._validate(val, self.longitude);
|
14335 |
|
14336 | self._latitude = val;
|
14337 | });
|
14338 |
|
14339 | this.__defineSetter__('longitude', function (val) {
|
14340 | AV.GeoPoint._validate(self.latitude, val);
|
14341 |
|
14342 | self._longitude = val;
|
14343 | });
|
14344 | }
|
14345 | };
|
14346 | |
14347 |
|
14348 |
|
14349 |
|
14350 |
|
14351 |
|
14352 |
|
14353 |
|
14354 | |
14355 |
|
14356 |
|
14357 |
|
14358 |
|
14359 |
|
14360 | AV.GeoPoint._validate = function (latitude, longitude) {
|
14361 | if (latitude < -90.0) {
|
14362 | throw new Error('AV.GeoPoint latitude ' + latitude + ' < -90.0.');
|
14363 | }
|
14364 |
|
14365 | if (latitude > 90.0) {
|
14366 | throw new Error('AV.GeoPoint latitude ' + latitude + ' > 90.0.');
|
14367 | }
|
14368 |
|
14369 | if (longitude < -180.0) {
|
14370 | throw new Error('AV.GeoPoint longitude ' + longitude + ' < -180.0.');
|
14371 | }
|
14372 |
|
14373 | if (longitude > 180.0) {
|
14374 | throw new Error('AV.GeoPoint longitude ' + longitude + ' > 180.0.');
|
14375 | }
|
14376 | };
|
14377 | |
14378 |
|
14379 |
|
14380 |
|
14381 |
|
14382 |
|
14383 | AV.GeoPoint.current = function () {
|
14384 | return new _promise.default(function (resolve, reject) {
|
14385 | navigator.geolocation.getCurrentPosition(function (location) {
|
14386 | resolve(new AV.GeoPoint({
|
14387 | latitude: location.coords.latitude,
|
14388 | longitude: location.coords.longitude
|
14389 | }));
|
14390 | }, reject);
|
14391 | });
|
14392 | };
|
14393 |
|
14394 | _.extend(AV.GeoPoint.prototype,
|
14395 |
|
14396 | {
|
14397 | |
14398 |
|
14399 |
|
14400 |
|
14401 | toJSON: function toJSON() {
|
14402 | AV.GeoPoint._validate(this.latitude, this.longitude);
|
14403 |
|
14404 | return {
|
14405 | __type: 'GeoPoint',
|
14406 | latitude: this.latitude,
|
14407 | longitude: this.longitude
|
14408 | };
|
14409 | },
|
14410 |
|
14411 | |
14412 |
|
14413 |
|
14414 |
|
14415 |
|
14416 | radiansTo: function radiansTo(point) {
|
14417 | var d2r = Math.PI / 180.0;
|
14418 | var lat1rad = this.latitude * d2r;
|
14419 | var long1rad = this.longitude * d2r;
|
14420 | var lat2rad = point.latitude * d2r;
|
14421 | var long2rad = point.longitude * d2r;
|
14422 | var deltaLat = lat1rad - lat2rad;
|
14423 | var deltaLong = long1rad - long2rad;
|
14424 | var sinDeltaLatDiv2 = Math.sin(deltaLat / 2);
|
14425 | var sinDeltaLongDiv2 = Math.sin(deltaLong / 2);
|
14426 |
|
14427 | var a = sinDeltaLatDiv2 * sinDeltaLatDiv2 + Math.cos(lat1rad) * Math.cos(lat2rad) * sinDeltaLongDiv2 * sinDeltaLongDiv2;
|
14428 | a = Math.min(1.0, a);
|
14429 | return 2 * Math.asin(Math.sqrt(a));
|
14430 | },
|
14431 |
|
14432 | |
14433 |
|
14434 |
|
14435 |
|
14436 |
|
14437 | kilometersTo: function kilometersTo(point) {
|
14438 | return this.radiansTo(point) * 6371.0;
|
14439 | },
|
14440 |
|
14441 | |
14442 |
|
14443 |
|
14444 |
|
14445 |
|
14446 | milesTo: function milesTo(point) {
|
14447 | return this.radiansTo(point) * 3958.8;
|
14448 | }
|
14449 | });
|
14450 | };
|
14451 |
|
14452 | }),
|
14453 |
|
14454 | (function(module, exports, __webpack_require__) {
|
14455 |
|
14456 | "use strict";
|
14457 |
|
14458 |
|
14459 | var _ = __webpack_require__(3);
|
14460 |
|
14461 | module.exports = function (AV) {
|
14462 | var PUBLIC_KEY = '*';
|
14463 | |
14464 |
|
14465 |
|
14466 |
|
14467 |
|
14468 |
|
14469 |
|
14470 |
|
14471 |
|
14472 |
|
14473 |
|
14474 |
|
14475 |
|
14476 |
|
14477 |
|
14478 | AV.ACL = function (arg1) {
|
14479 | var self = this;
|
14480 | self.permissionsById = {};
|
14481 |
|
14482 | if (_.isObject(arg1)) {
|
14483 | if (arg1 instanceof AV.User) {
|
14484 | self.setReadAccess(arg1, true);
|
14485 | self.setWriteAccess(arg1, true);
|
14486 | } else {
|
14487 | if (_.isFunction(arg1)) {
|
14488 | throw new Error('AV.ACL() called with a function. Did you forget ()?');
|
14489 | }
|
14490 |
|
14491 | AV._objectEach(arg1, function (accessList, userId) {
|
14492 | if (!_.isString(userId)) {
|
14493 | throw new Error('Tried to create an ACL with an invalid userId.');
|
14494 | }
|
14495 |
|
14496 | self.permissionsById[userId] = {};
|
14497 |
|
14498 | AV._objectEach(accessList, function (allowed, permission) {
|
14499 | if (permission !== 'read' && permission !== 'write') {
|
14500 | throw new Error('Tried to create an ACL with an invalid permission type.');
|
14501 | }
|
14502 |
|
14503 | if (!_.isBoolean(allowed)) {
|
14504 | throw new Error('Tried to create an ACL with an invalid permission value.');
|
14505 | }
|
14506 |
|
14507 | self.permissionsById[userId][permission] = allowed;
|
14508 | });
|
14509 | });
|
14510 | }
|
14511 | }
|
14512 | };
|
14513 | |
14514 |
|
14515 |
|
14516 |
|
14517 |
|
14518 |
|
14519 | AV.ACL.prototype.toJSON = function () {
|
14520 | return _.clone(this.permissionsById);
|
14521 | };
|
14522 |
|
14523 | AV.ACL.prototype._setAccess = function (accessType, userId, allowed) {
|
14524 | if (userId instanceof AV.User) {
|
14525 | userId = userId.id;
|
14526 | } else if (userId instanceof AV.Role) {
|
14527 | userId = 'role:' + userId.getName();
|
14528 | }
|
14529 |
|
14530 | if (!_.isString(userId)) {
|
14531 | throw new Error('userId must be a string.');
|
14532 | }
|
14533 |
|
14534 | if (!_.isBoolean(allowed)) {
|
14535 | throw new Error('allowed must be either true or false.');
|
14536 | }
|
14537 |
|
14538 | var permissions = this.permissionsById[userId];
|
14539 |
|
14540 | if (!permissions) {
|
14541 | if (!allowed) {
|
14542 |
|
14543 | return;
|
14544 | } else {
|
14545 | permissions = {};
|
14546 | this.permissionsById[userId] = permissions;
|
14547 | }
|
14548 | }
|
14549 |
|
14550 | if (allowed) {
|
14551 | this.permissionsById[userId][accessType] = true;
|
14552 | } else {
|
14553 | delete permissions[accessType];
|
14554 |
|
14555 | if (_.isEmpty(permissions)) {
|
14556 | delete this.permissionsById[userId];
|
14557 | }
|
14558 | }
|
14559 | };
|
14560 |
|
14561 | AV.ACL.prototype._getAccess = function (accessType, userId) {
|
14562 | if (userId instanceof AV.User) {
|
14563 | userId = userId.id;
|
14564 | } else if (userId instanceof AV.Role) {
|
14565 | userId = 'role:' + userId.getName();
|
14566 | }
|
14567 |
|
14568 | var permissions = this.permissionsById[userId];
|
14569 |
|
14570 | if (!permissions) {
|
14571 | return false;
|
14572 | }
|
14573 |
|
14574 | return permissions[accessType] ? true : false;
|
14575 | };
|
14576 | |
14577 |
|
14578 |
|
14579 |
|
14580 |
|
14581 |
|
14582 |
|
14583 | AV.ACL.prototype.setReadAccess = function (userId, allowed) {
|
14584 | this._setAccess('read', userId, allowed);
|
14585 | };
|
14586 | |
14587 |
|
14588 |
|
14589 |
|
14590 |
|
14591 |
|
14592 |
|
14593 |
|
14594 |
|
14595 |
|
14596 | AV.ACL.prototype.getReadAccess = function (userId) {
|
14597 | return this._getAccess('read', userId);
|
14598 | };
|
14599 | |
14600 |
|
14601 |
|
14602 |
|
14603 |
|
14604 |
|
14605 |
|
14606 | AV.ACL.prototype.setWriteAccess = function (userId, allowed) {
|
14607 | this._setAccess('write', userId, allowed);
|
14608 | };
|
14609 | |
14610 |
|
14611 |
|
14612 |
|
14613 |
|
14614 |
|
14615 |
|
14616 |
|
14617 |
|
14618 |
|
14619 | AV.ACL.prototype.getWriteAccess = function (userId) {
|
14620 | return this._getAccess('write', userId);
|
14621 | };
|
14622 | |
14623 |
|
14624 |
|
14625 |
|
14626 |
|
14627 |
|
14628 | AV.ACL.prototype.setPublicReadAccess = function (allowed) {
|
14629 | this.setReadAccess(PUBLIC_KEY, allowed);
|
14630 | };
|
14631 | |
14632 |
|
14633 |
|
14634 |
|
14635 |
|
14636 |
|
14637 | AV.ACL.prototype.getPublicReadAccess = function () {
|
14638 | return this.getReadAccess(PUBLIC_KEY);
|
14639 | };
|
14640 | |
14641 |
|
14642 |
|
14643 |
|
14644 |
|
14645 |
|
14646 | AV.ACL.prototype.setPublicWriteAccess = function (allowed) {
|
14647 | this.setWriteAccess(PUBLIC_KEY, allowed);
|
14648 | };
|
14649 | |
14650 |
|
14651 |
|
14652 |
|
14653 |
|
14654 |
|
14655 | AV.ACL.prototype.getPublicWriteAccess = function () {
|
14656 | return this.getWriteAccess(PUBLIC_KEY);
|
14657 | };
|
14658 | |
14659 |
|
14660 |
|
14661 |
|
14662 |
|
14663 |
|
14664 |
|
14665 |
|
14666 |
|
14667 |
|
14668 |
|
14669 | AV.ACL.prototype.getRoleReadAccess = function (role) {
|
14670 | if (role instanceof AV.Role) {
|
14671 |
|
14672 | role = role.getName();
|
14673 | }
|
14674 |
|
14675 | if (_.isString(role)) {
|
14676 | return this.getReadAccess('role:' + role);
|
14677 | }
|
14678 |
|
14679 | throw new Error('role must be a AV.Role or a String');
|
14680 | };
|
14681 | |
14682 |
|
14683 |
|
14684 |
|
14685 |
|
14686 |
|
14687 |
|
14688 |
|
14689 |
|
14690 |
|
14691 |
|
14692 | AV.ACL.prototype.getRoleWriteAccess = function (role) {
|
14693 | if (role instanceof AV.Role) {
|
14694 |
|
14695 | role = role.getName();
|
14696 | }
|
14697 |
|
14698 | if (_.isString(role)) {
|
14699 | return this.getWriteAccess('role:' + role);
|
14700 | }
|
14701 |
|
14702 | throw new Error('role must be a AV.Role or a String');
|
14703 | };
|
14704 | |
14705 |
|
14706 |
|
14707 |
|
14708 |
|
14709 |
|
14710 |
|
14711 |
|
14712 |
|
14713 |
|
14714 | AV.ACL.prototype.setRoleReadAccess = function (role, allowed) {
|
14715 | if (role instanceof AV.Role) {
|
14716 |
|
14717 | role = role.getName();
|
14718 | }
|
14719 |
|
14720 | if (_.isString(role)) {
|
14721 | this.setReadAccess('role:' + role, allowed);
|
14722 | return;
|
14723 | }
|
14724 |
|
14725 | throw new Error('role must be a AV.Role or a String');
|
14726 | };
|
14727 | |
14728 |
|
14729 |
|
14730 |
|
14731 |
|
14732 |
|
14733 |
|
14734 |
|
14735 |
|
14736 |
|
14737 | AV.ACL.prototype.setRoleWriteAccess = function (role, allowed) {
|
14738 | if (role instanceof AV.Role) {
|
14739 |
|
14740 | role = role.getName();
|
14741 | }
|
14742 |
|
14743 | if (_.isString(role)) {
|
14744 | this.setWriteAccess('role:' + role, allowed);
|
14745 | return;
|
14746 | }
|
14747 |
|
14748 | throw new Error('role must be a AV.Role or a String');
|
14749 | };
|
14750 | };
|
14751 |
|
14752 | }),
|
14753 |
|
14754 | (function(module, exports, __webpack_require__) {
|
14755 |
|
14756 | "use strict";
|
14757 |
|
14758 |
|
14759 | var _interopRequireDefault = __webpack_require__(1);
|
14760 |
|
14761 | var _concat = _interopRequireDefault(__webpack_require__(22));
|
14762 |
|
14763 | var _find = _interopRequireDefault(__webpack_require__(93));
|
14764 |
|
14765 | var _indexOf = _interopRequireDefault(__webpack_require__(71));
|
14766 |
|
14767 | var _map = _interopRequireDefault(__webpack_require__(35));
|
14768 |
|
14769 | var _ = __webpack_require__(3);
|
14770 |
|
14771 | module.exports = function (AV) {
|
14772 | |
14773 |
|
14774 |
|
14775 |
|
14776 |
|
14777 |
|
14778 |
|
14779 |
|
14780 |
|
14781 |
|
14782 |
|
14783 |
|
14784 |
|
14785 | AV.Op = function () {
|
14786 | this._initialize.apply(this, arguments);
|
14787 | };
|
14788 |
|
14789 | _.extend(AV.Op.prototype,
|
14790 |
|
14791 | {
|
14792 | _initialize: function _initialize() {}
|
14793 | });
|
14794 |
|
14795 | _.extend(AV.Op, {
|
14796 | |
14797 |
|
14798 |
|
14799 |
|
14800 | _extend: AV._extend,
|
14801 |
|
14802 | _opDecoderMap: {},
|
14803 |
|
14804 | |
14805 |
|
14806 |
|
14807 |
|
14808 |
|
14809 | _registerDecoder: function _registerDecoder(opName, decoder) {
|
14810 | AV.Op._opDecoderMap[opName] = decoder;
|
14811 | },
|
14812 |
|
14813 | |
14814 |
|
14815 |
|
14816 |
|
14817 | _decode: function _decode(json) {
|
14818 | var decoder = AV.Op._opDecoderMap[json.__op];
|
14819 |
|
14820 | if (decoder) {
|
14821 | return decoder(json);
|
14822 | } else {
|
14823 | return undefined;
|
14824 | }
|
14825 | }
|
14826 | });
|
14827 | |
14828 |
|
14829 |
|
14830 |
|
14831 |
|
14832 | AV.Op._registerDecoder('Batch', function (json) {
|
14833 | var op = null;
|
14834 |
|
14835 | AV._arrayEach(json.ops, function (nextOp) {
|
14836 | nextOp = AV.Op._decode(nextOp);
|
14837 | op = nextOp._mergeWithPrevious(op);
|
14838 | });
|
14839 |
|
14840 | return op;
|
14841 | });
|
14842 | |
14843 |
|
14844 |
|
14845 |
|
14846 |
|
14847 |
|
14848 |
|
14849 |
|
14850 |
|
14851 | AV.Op.Set = AV.Op._extend(
|
14852 |
|
14853 | {
|
14854 | _initialize: function _initialize(value) {
|
14855 | this._value = value;
|
14856 | },
|
14857 |
|
14858 | |
14859 |
|
14860 |
|
14861 | value: function value() {
|
14862 | return this._value;
|
14863 | },
|
14864 |
|
14865 | |
14866 |
|
14867 |
|
14868 |
|
14869 | toJSON: function toJSON() {
|
14870 | return AV._encode(this.value());
|
14871 | },
|
14872 | _mergeWithPrevious: function _mergeWithPrevious(previous) {
|
14873 | return this;
|
14874 | },
|
14875 | _estimate: function _estimate(oldValue) {
|
14876 | return this.value();
|
14877 | }
|
14878 | });
|
14879 | |
14880 |
|
14881 |
|
14882 |
|
14883 |
|
14884 |
|
14885 | AV.Op._UNSET = {};
|
14886 | |
14887 |
|
14888 |
|
14889 |
|
14890 |
|
14891 |
|
14892 |
|
14893 | AV.Op.Unset = AV.Op._extend(
|
14894 |
|
14895 | {
|
14896 | |
14897 |
|
14898 |
|
14899 |
|
14900 | toJSON: function toJSON() {
|
14901 | return {
|
14902 | __op: 'Delete'
|
14903 | };
|
14904 | },
|
14905 | _mergeWithPrevious: function _mergeWithPrevious(previous) {
|
14906 | return this;
|
14907 | },
|
14908 | _estimate: function _estimate(oldValue) {
|
14909 | return AV.Op._UNSET;
|
14910 | }
|
14911 | });
|
14912 |
|
14913 | AV.Op._registerDecoder('Delete', function (json) {
|
14914 | return new AV.Op.Unset();
|
14915 | });
|
14916 | |
14917 |
|
14918 |
|
14919 |
|
14920 |
|
14921 |
|
14922 |
|
14923 |
|
14924 | AV.Op.Increment = AV.Op._extend(
|
14925 |
|
14926 | {
|
14927 | _initialize: function _initialize(amount) {
|
14928 | this._amount = amount;
|
14929 | },
|
14930 |
|
14931 | |
14932 |
|
14933 |
|
14934 |
|
14935 | amount: function amount() {
|
14936 | return this._amount;
|
14937 | },
|
14938 |
|
14939 | |
14940 |
|
14941 |
|
14942 |
|
14943 | toJSON: function toJSON() {
|
14944 | return {
|
14945 | __op: 'Increment',
|
14946 | amount: this._amount
|
14947 | };
|
14948 | },
|
14949 | _mergeWithPrevious: function _mergeWithPrevious(previous) {
|
14950 | if (!previous) {
|
14951 | return this;
|
14952 | } else if (previous instanceof AV.Op.Unset) {
|
14953 | return new AV.Op.Set(this.amount());
|
14954 | } else if (previous instanceof AV.Op.Set) {
|
14955 | return new AV.Op.Set(previous.value() + this.amount());
|
14956 | } else if (previous instanceof AV.Op.Increment) {
|
14957 | return new AV.Op.Increment(this.amount() + previous.amount());
|
14958 | } else {
|
14959 | throw new Error('Op is invalid after previous op.');
|
14960 | }
|
14961 | },
|
14962 | _estimate: function _estimate(oldValue) {
|
14963 | if (!oldValue) {
|
14964 | return this.amount();
|
14965 | }
|
14966 |
|
14967 | return oldValue + this.amount();
|
14968 | }
|
14969 | });
|
14970 |
|
14971 | AV.Op._registerDecoder('Increment', function (json) {
|
14972 | return new AV.Op.Increment(json.amount);
|
14973 | });
|
14974 | |
14975 |
|
14976 |
|
14977 |
|
14978 |
|
14979 |
|
14980 |
|
14981 |
|
14982 | AV.Op.BitAnd = AV.Op._extend(
|
14983 |
|
14984 | {
|
14985 | _initialize: function _initialize(value) {
|
14986 | this._value = value;
|
14987 | },
|
14988 | value: function value() {
|
14989 | return this._value;
|
14990 | },
|
14991 |
|
14992 | |
14993 |
|
14994 |
|
14995 |
|
14996 | toJSON: function toJSON() {
|
14997 | return {
|
14998 | __op: 'BitAnd',
|
14999 | value: this.value()
|
15000 | };
|
15001 | },
|
15002 | _mergeWithPrevious: function _mergeWithPrevious(previous) {
|
15003 | if (!previous) {
|
15004 | return this;
|
15005 | } else if (previous instanceof AV.Op.Unset) {
|
15006 | return new AV.Op.Set(0);
|
15007 | } else if (previous instanceof AV.Op.Set) {
|
15008 | return new AV.Op.Set(previous.value() & this.value());
|
15009 | } else {
|
15010 | throw new Error('Op is invalid after previous op.');
|
15011 | }
|
15012 | },
|
15013 | _estimate: function _estimate(oldValue) {
|
15014 | return oldValue & this.value();
|
15015 | }
|
15016 | });
|
15017 |
|
15018 | AV.Op._registerDecoder('BitAnd', function (json) {
|
15019 | return new AV.Op.BitAnd(json.value);
|
15020 | });
|
15021 | |
15022 |
|
15023 |
|
15024 |
|
15025 |
|
15026 |
|
15027 |
|
15028 |
|
15029 | AV.Op.BitOr = AV.Op._extend(
|
15030 |
|
15031 | {
|
15032 | _initialize: function _initialize(value) {
|
15033 | this._value = value;
|
15034 | },
|
15035 | value: function value() {
|
15036 | return this._value;
|
15037 | },
|
15038 |
|
15039 | |
15040 |
|
15041 |
|
15042 |
|
15043 | toJSON: function toJSON() {
|
15044 | return {
|
15045 | __op: 'BitOr',
|
15046 | value: this.value()
|
15047 | };
|
15048 | },
|
15049 | _mergeWithPrevious: function _mergeWithPrevious(previous) {
|
15050 | if (!previous) {
|
15051 | return this;
|
15052 | } else if (previous instanceof AV.Op.Unset) {
|
15053 | return new AV.Op.Set(this.value());
|
15054 | } else if (previous instanceof AV.Op.Set) {
|
15055 | return new AV.Op.Set(previous.value() | this.value());
|
15056 | } else {
|
15057 | throw new Error('Op is invalid after previous op.');
|
15058 | }
|
15059 | },
|
15060 | _estimate: function _estimate(oldValue) {
|
15061 | return oldValue | this.value();
|
15062 | }
|
15063 | });
|
15064 |
|
15065 | AV.Op._registerDecoder('BitOr', function (json) {
|
15066 | return new AV.Op.BitOr(json.value);
|
15067 | });
|
15068 | |
15069 |
|
15070 |
|
15071 |
|
15072 |
|
15073 |
|
15074 |
|
15075 |
|
15076 | AV.Op.BitXor = AV.Op._extend(
|
15077 |
|
15078 | {
|
15079 | _initialize: function _initialize(value) {
|
15080 | this._value = value;
|
15081 | },
|
15082 | value: function value() {
|
15083 | return this._value;
|
15084 | },
|
15085 |
|
15086 | |
15087 |
|
15088 |
|
15089 |
|
15090 | toJSON: function toJSON() {
|
15091 | return {
|
15092 | __op: 'BitXor',
|
15093 | value: this.value()
|
15094 | };
|
15095 | },
|
15096 | _mergeWithPrevious: function _mergeWithPrevious(previous) {
|
15097 | if (!previous) {
|
15098 | return this;
|
15099 | } else if (previous instanceof AV.Op.Unset) {
|
15100 | return new AV.Op.Set(this.value());
|
15101 | } else if (previous instanceof AV.Op.Set) {
|
15102 | return new AV.Op.Set(previous.value() ^ this.value());
|
15103 | } else {
|
15104 | throw new Error('Op is invalid after previous op.');
|
15105 | }
|
15106 | },
|
15107 | _estimate: function _estimate(oldValue) {
|
15108 | return oldValue ^ this.value();
|
15109 | }
|
15110 | });
|
15111 |
|
15112 | AV.Op._registerDecoder('BitXor', function (json) {
|
15113 | return new AV.Op.BitXor(json.value);
|
15114 | });
|
15115 | |
15116 |
|
15117 |
|
15118 |
|
15119 |
|
15120 |
|
15121 |
|
15122 |
|
15123 | AV.Op.Add = AV.Op._extend(
|
15124 |
|
15125 | {
|
15126 | _initialize: function _initialize(objects) {
|
15127 | this._objects = objects;
|
15128 | },
|
15129 |
|
15130 | |
15131 |
|
15132 |
|
15133 |
|
15134 | objects: function objects() {
|
15135 | return this._objects;
|
15136 | },
|
15137 |
|
15138 | |
15139 |
|
15140 |
|
15141 |
|
15142 | toJSON: function toJSON() {
|
15143 | return {
|
15144 | __op: 'Add',
|
15145 | objects: AV._encode(this.objects())
|
15146 | };
|
15147 | },
|
15148 | _mergeWithPrevious: function _mergeWithPrevious(previous) {
|
15149 | if (!previous) {
|
15150 | return this;
|
15151 | } else if (previous instanceof AV.Op.Unset) {
|
15152 | return new AV.Op.Set(this.objects());
|
15153 | } else if (previous instanceof AV.Op.Set) {
|
15154 | return new AV.Op.Set(this._estimate(previous.value()));
|
15155 | } else if (previous instanceof AV.Op.Add) {
|
15156 | var _context;
|
15157 |
|
15158 | return new AV.Op.Add((0, _concat.default)(_context = previous.objects()).call(_context, this.objects()));
|
15159 | } else {
|
15160 | throw new Error('Op is invalid after previous op.');
|
15161 | }
|
15162 | },
|
15163 | _estimate: function _estimate(oldValue) {
|
15164 | if (!oldValue) {
|
15165 | return _.clone(this.objects());
|
15166 | } else {
|
15167 | return (0, _concat.default)(oldValue).call(oldValue, this.objects());
|
15168 | }
|
15169 | }
|
15170 | });
|
15171 |
|
15172 | AV.Op._registerDecoder('Add', function (json) {
|
15173 | return new AV.Op.Add(AV._decode(json.objects));
|
15174 | });
|
15175 | |
15176 |
|
15177 |
|
15178 |
|
15179 |
|
15180 |
|
15181 |
|
15182 |
|
15183 |
|
15184 | AV.Op.AddUnique = AV.Op._extend(
|
15185 |
|
15186 | {
|
15187 | _initialize: function _initialize(objects) {
|
15188 | this._objects = _.uniq(objects);
|
15189 | },
|
15190 |
|
15191 | |
15192 |
|
15193 |
|
15194 |
|
15195 | objects: function objects() {
|
15196 | return this._objects;
|
15197 | },
|
15198 |
|
15199 | |
15200 |
|
15201 |
|
15202 |
|
15203 | toJSON: function toJSON() {
|
15204 | return {
|
15205 | __op: 'AddUnique',
|
15206 | objects: AV._encode(this.objects())
|
15207 | };
|
15208 | },
|
15209 | _mergeWithPrevious: function _mergeWithPrevious(previous) {
|
15210 | if (!previous) {
|
15211 | return this;
|
15212 | } else if (previous instanceof AV.Op.Unset) {
|
15213 | return new AV.Op.Set(this.objects());
|
15214 | } else if (previous instanceof AV.Op.Set) {
|
15215 | return new AV.Op.Set(this._estimate(previous.value()));
|
15216 | } else if (previous instanceof AV.Op.AddUnique) {
|
15217 | return new AV.Op.AddUnique(this._estimate(previous.objects()));
|
15218 | } else {
|
15219 | throw new Error('Op is invalid after previous op.');
|
15220 | }
|
15221 | },
|
15222 | _estimate: function _estimate(oldValue) {
|
15223 | if (!oldValue) {
|
15224 | return _.clone(this.objects());
|
15225 | } else {
|
15226 |
|
15227 |
|
15228 |
|
15229 | var newValue = _.clone(oldValue);
|
15230 |
|
15231 | AV._arrayEach(this.objects(), function (obj) {
|
15232 | if (obj instanceof AV.Object && obj.id) {
|
15233 | var matchingObj = (0, _find.default)(_).call(_, newValue, function (anObj) {
|
15234 | return anObj instanceof AV.Object && anObj.id === obj.id;
|
15235 | });
|
15236 |
|
15237 | if (!matchingObj) {
|
15238 | newValue.push(obj);
|
15239 | } else {
|
15240 | var index = (0, _indexOf.default)(_).call(_, newValue, matchingObj);
|
15241 | newValue[index] = obj;
|
15242 | }
|
15243 | } else if (!_.contains(newValue, obj)) {
|
15244 | newValue.push(obj);
|
15245 | }
|
15246 | });
|
15247 |
|
15248 | return newValue;
|
15249 | }
|
15250 | }
|
15251 | });
|
15252 |
|
15253 | AV.Op._registerDecoder('AddUnique', function (json) {
|
15254 | return new AV.Op.AddUnique(AV._decode(json.objects));
|
15255 | });
|
15256 | |
15257 |
|
15258 |
|
15259 |
|
15260 |
|
15261 |
|
15262 |
|
15263 |
|
15264 | AV.Op.Remove = AV.Op._extend(
|
15265 |
|
15266 | {
|
15267 | _initialize: function _initialize(objects) {
|
15268 | this._objects = _.uniq(objects);
|
15269 | },
|
15270 |
|
15271 | |
15272 |
|
15273 |
|
15274 |
|
15275 | objects: function objects() {
|
15276 | return this._objects;
|
15277 | },
|
15278 |
|
15279 | |
15280 |
|
15281 |
|
15282 |
|
15283 | toJSON: function toJSON() {
|
15284 | return {
|
15285 | __op: 'Remove',
|
15286 | objects: AV._encode(this.objects())
|
15287 | };
|
15288 | },
|
15289 | _mergeWithPrevious: function _mergeWithPrevious(previous) {
|
15290 | if (!previous) {
|
15291 | return this;
|
15292 | } else if (previous instanceof AV.Op.Unset) {
|
15293 | return previous;
|
15294 | } else if (previous instanceof AV.Op.Set) {
|
15295 | return new AV.Op.Set(this._estimate(previous.value()));
|
15296 | } else if (previous instanceof AV.Op.Remove) {
|
15297 | return new AV.Op.Remove(_.union(previous.objects(), this.objects()));
|
15298 | } else {
|
15299 | throw new Error('Op is invalid after previous op.');
|
15300 | }
|
15301 | },
|
15302 | _estimate: function _estimate(oldValue) {
|
15303 | if (!oldValue) {
|
15304 | return [];
|
15305 | } else {
|
15306 | var newValue = _.difference(oldValue, this.objects());
|
15307 |
|
15308 |
|
15309 | AV._arrayEach(this.objects(), function (obj) {
|
15310 | if (obj instanceof AV.Object && obj.id) {
|
15311 | newValue = _.reject(newValue, function (other) {
|
15312 | return other instanceof AV.Object && other.id === obj.id;
|
15313 | });
|
15314 | }
|
15315 | });
|
15316 |
|
15317 | return newValue;
|
15318 | }
|
15319 | }
|
15320 | });
|
15321 |
|
15322 | AV.Op._registerDecoder('Remove', function (json) {
|
15323 | return new AV.Op.Remove(AV._decode(json.objects));
|
15324 | });
|
15325 | |
15326 |
|
15327 |
|
15328 |
|
15329 |
|
15330 |
|
15331 |
|
15332 |
|
15333 |
|
15334 | AV.Op.Relation = AV.Op._extend(
|
15335 |
|
15336 | {
|
15337 | _initialize: function _initialize(adds, removes) {
|
15338 | this._targetClassName = null;
|
15339 | var self = this;
|
15340 |
|
15341 | var pointerToId = function pointerToId(object) {
|
15342 | if (object instanceof AV.Object) {
|
15343 | if (!object.id) {
|
15344 | throw new Error("You can't add an unsaved AV.Object to a relation.");
|
15345 | }
|
15346 |
|
15347 | if (!self._targetClassName) {
|
15348 | self._targetClassName = object.className;
|
15349 | }
|
15350 |
|
15351 | if (self._targetClassName !== object.className) {
|
15352 | throw new Error('Tried to create a AV.Relation with 2 different types: ' + self._targetClassName + ' and ' + object.className + '.');
|
15353 | }
|
15354 |
|
15355 | return object.id;
|
15356 | }
|
15357 |
|
15358 | return object;
|
15359 | };
|
15360 |
|
15361 | this.relationsToAdd = _.uniq((0, _map.default)(_).call(_, adds, pointerToId));
|
15362 | this.relationsToRemove = _.uniq((0, _map.default)(_).call(_, removes, pointerToId));
|
15363 | },
|
15364 |
|
15365 | |
15366 |
|
15367 |
|
15368 |
|
15369 |
|
15370 | added: function added() {
|
15371 | var self = this;
|
15372 | return (0, _map.default)(_).call(_, this.relationsToAdd, function (objectId) {
|
15373 | var object = AV.Object._create(self._targetClassName);
|
15374 |
|
15375 | object.id = objectId;
|
15376 | return object;
|
15377 | });
|
15378 | },
|
15379 |
|
15380 | |
15381 |
|
15382 |
|
15383 |
|
15384 |
|
15385 | removed: function removed() {
|
15386 | var self = this;
|
15387 | return (0, _map.default)(_).call(_, this.relationsToRemove, function (objectId) {
|
15388 | var object = AV.Object._create(self._targetClassName);
|
15389 |
|
15390 | object.id = objectId;
|
15391 | return object;
|
15392 | });
|
15393 | },
|
15394 |
|
15395 | |
15396 |
|
15397 |
|
15398 |
|
15399 | toJSON: function toJSON() {
|
15400 | var adds = null;
|
15401 | var removes = null;
|
15402 | var self = this;
|
15403 |
|
15404 | var idToPointer = function idToPointer(id) {
|
15405 | return {
|
15406 | __type: 'Pointer',
|
15407 | className: self._targetClassName,
|
15408 | objectId: id
|
15409 | };
|
15410 | };
|
15411 |
|
15412 | var pointers = null;
|
15413 |
|
15414 | if (this.relationsToAdd.length > 0) {
|
15415 | pointers = (0, _map.default)(_).call(_, this.relationsToAdd, idToPointer);
|
15416 | adds = {
|
15417 | __op: 'AddRelation',
|
15418 | objects: pointers
|
15419 | };
|
15420 | }
|
15421 |
|
15422 | if (this.relationsToRemove.length > 0) {
|
15423 | pointers = (0, _map.default)(_).call(_, this.relationsToRemove, idToPointer);
|
15424 | removes = {
|
15425 | __op: 'RemoveRelation',
|
15426 | objects: pointers
|
15427 | };
|
15428 | }
|
15429 |
|
15430 | if (adds && removes) {
|
15431 | return {
|
15432 | __op: 'Batch',
|
15433 | ops: [adds, removes]
|
15434 | };
|
15435 | }
|
15436 |
|
15437 | return adds || removes || {};
|
15438 | },
|
15439 | _mergeWithPrevious: function _mergeWithPrevious(previous) {
|
15440 | if (!previous) {
|
15441 | return this;
|
15442 | } else if (previous instanceof AV.Op.Unset) {
|
15443 | throw new Error("You can't modify a relation after deleting it.");
|
15444 | } else if (previous instanceof AV.Op.Relation) {
|
15445 | if (previous._targetClassName && previous._targetClassName !== this._targetClassName) {
|
15446 | throw new Error('Related object must be of class ' + previous._targetClassName + ', but ' + this._targetClassName + ' was passed in.');
|
15447 | }
|
15448 |
|
15449 | var newAdd = _.union(_.difference(previous.relationsToAdd, this.relationsToRemove), this.relationsToAdd);
|
15450 |
|
15451 | var newRemove = _.union(_.difference(previous.relationsToRemove, this.relationsToAdd), this.relationsToRemove);
|
15452 |
|
15453 | var newRelation = new AV.Op.Relation(newAdd, newRemove);
|
15454 | newRelation._targetClassName = this._targetClassName;
|
15455 | return newRelation;
|
15456 | } else {
|
15457 | throw new Error('Op is invalid after previous op.');
|
15458 | }
|
15459 | },
|
15460 | _estimate: function _estimate(oldValue, object, key) {
|
15461 | if (!oldValue) {
|
15462 | var relation = new AV.Relation(object, key);
|
15463 | relation.targetClassName = this._targetClassName;
|
15464 | } else if (oldValue instanceof AV.Relation) {
|
15465 | if (this._targetClassName) {
|
15466 | if (oldValue.targetClassName) {
|
15467 | if (oldValue.targetClassName !== this._targetClassName) {
|
15468 | throw new Error('Related object must be a ' + oldValue.targetClassName + ', but a ' + this._targetClassName + ' was passed in.');
|
15469 | }
|
15470 | } else {
|
15471 | oldValue.targetClassName = this._targetClassName;
|
15472 | }
|
15473 | }
|
15474 |
|
15475 | return oldValue;
|
15476 | } else {
|
15477 | throw new Error('Op is invalid after previous op.');
|
15478 | }
|
15479 | }
|
15480 | });
|
15481 |
|
15482 | AV.Op._registerDecoder('AddRelation', function (json) {
|
15483 | return new AV.Op.Relation(AV._decode(json.objects), []);
|
15484 | });
|
15485 |
|
15486 | AV.Op._registerDecoder('RemoveRelation', function (json) {
|
15487 | return new AV.Op.Relation([], AV._decode(json.objects));
|
15488 | });
|
15489 | };
|
15490 |
|
15491 | }),
|
15492 |
|
15493 | (function(module, exports, __webpack_require__) {
|
15494 |
|
15495 | var parent = __webpack_require__(475);
|
15496 |
|
15497 | module.exports = parent;
|
15498 |
|
15499 |
|
15500 | }),
|
15501 |
|
15502 | (function(module, exports, __webpack_require__) {
|
15503 |
|
15504 | var isPrototypeOf = __webpack_require__(19);
|
15505 | var method = __webpack_require__(476);
|
15506 |
|
15507 | var ArrayPrototype = Array.prototype;
|
15508 |
|
15509 | module.exports = function (it) {
|
15510 | var own = it.find;
|
15511 | return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.find) ? method : own;
|
15512 | };
|
15513 |
|
15514 |
|
15515 | }),
|
15516 |
|
15517 | (function(module, exports, __webpack_require__) {
|
15518 |
|
15519 | __webpack_require__(477);
|
15520 | var entryVirtual = __webpack_require__(40);
|
15521 |
|
15522 | module.exports = entryVirtual('Array').find;
|
15523 |
|
15524 |
|
15525 | }),
|
15526 |
|
15527 | (function(module, exports, __webpack_require__) {
|
15528 |
|
15529 | "use strict";
|
15530 |
|
15531 | var $ = __webpack_require__(0);
|
15532 | var $find = __webpack_require__(70).find;
|
15533 | var addToUnscopables = __webpack_require__(170);
|
15534 |
|
15535 | var FIND = 'find';
|
15536 | var SKIPS_HOLES = true;
|
15537 |
|
15538 |
|
15539 | if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES = false; });
|
15540 |
|
15541 |
|
15542 |
|
15543 | $({ target: 'Array', proto: true, forced: SKIPS_HOLES }, {
|
15544 | find: function find(callbackfn /* , that = undefined */) {
|
15545 | return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
15546 | }
|
15547 | });
|
15548 |
|
15549 |
|
15550 | addToUnscopables(FIND);
|
15551 |
|
15552 |
|
15553 | }),
|
15554 |
|
15555 | (function(module, exports, __webpack_require__) {
|
15556 |
|
15557 | "use strict";
|
15558 |
|
15559 |
|
15560 | var _ = __webpack_require__(3);
|
15561 |
|
15562 | module.exports = function (AV) {
|
15563 | |
15564 |
|
15565 |
|
15566 |
|
15567 |
|
15568 |
|
15569 |
|
15570 |
|
15571 |
|
15572 |
|
15573 |
|
15574 |
|
15575 |
|
15576 |
|
15577 |
|
15578 | AV.Relation = function (parent, key) {
|
15579 | if (!_.isString(key)) {
|
15580 | throw new TypeError('key must be a string');
|
15581 | }
|
15582 |
|
15583 | this.parent = parent;
|
15584 | this.key = key;
|
15585 | this.targetClassName = null;
|
15586 | };
|
15587 | |
15588 |
|
15589 |
|
15590 |
|
15591 |
|
15592 |
|
15593 |
|
15594 |
|
15595 |
|
15596 | AV.Relation.reverseQuery = function (parentClass, relationKey, child) {
|
15597 | var query = new AV.Query(parentClass);
|
15598 | query.equalTo(relationKey, child._toPointer());
|
15599 | return query;
|
15600 | };
|
15601 |
|
15602 | _.extend(AV.Relation.prototype,
|
15603 |
|
15604 | {
|
15605 | |
15606 |
|
15607 |
|
15608 |
|
15609 | _ensureParentAndKey: function _ensureParentAndKey(parent, key) {
|
15610 | this.parent = this.parent || parent;
|
15611 | this.key = this.key || key;
|
15612 |
|
15613 | if (this.parent !== parent) {
|
15614 | throw new Error('Internal Error. Relation retrieved from two different Objects.');
|
15615 | }
|
15616 |
|
15617 | if (this.key !== key) {
|
15618 | throw new Error('Internal Error. Relation retrieved from two different keys.');
|
15619 | }
|
15620 | },
|
15621 |
|
15622 | |
15623 |
|
15624 |
|
15625 |
|
15626 | add: function add(objects) {
|
15627 | if (!_.isArray(objects)) {
|
15628 | objects = [objects];
|
15629 | }
|
15630 |
|
15631 | var change = new AV.Op.Relation(objects, []);
|
15632 | this.parent.set(this.key, change);
|
15633 | this.targetClassName = change._targetClassName;
|
15634 | },
|
15635 |
|
15636 | |
15637 |
|
15638 |
|
15639 |
|
15640 | remove: function remove(objects) {
|
15641 | if (!_.isArray(objects)) {
|
15642 | objects = [objects];
|
15643 | }
|
15644 |
|
15645 | var change = new AV.Op.Relation([], objects);
|
15646 | this.parent.set(this.key, change);
|
15647 | this.targetClassName = change._targetClassName;
|
15648 | },
|
15649 |
|
15650 | |
15651 |
|
15652 |
|
15653 |
|
15654 | toJSON: function toJSON() {
|
15655 | return {
|
15656 | __type: 'Relation',
|
15657 | className: this.targetClassName
|
15658 | };
|
15659 | },
|
15660 |
|
15661 | |
15662 |
|
15663 |
|
15664 |
|
15665 |
|
15666 | query: function query() {
|
15667 | var targetClass;
|
15668 | var query;
|
15669 |
|
15670 | if (!this.targetClassName) {
|
15671 | targetClass = AV.Object._getSubclass(this.parent.className);
|
15672 | query = new AV.Query(targetClass);
|
15673 | query._defaultParams.redirectClassNameForKey = this.key;
|
15674 | } else {
|
15675 | targetClass = AV.Object._getSubclass(this.targetClassName);
|
15676 | query = new AV.Query(targetClass);
|
15677 | }
|
15678 |
|
15679 | query._addCondition('$relatedTo', 'object', this.parent._toPointer());
|
15680 |
|
15681 | query._addCondition('$relatedTo', 'key', this.key);
|
15682 |
|
15683 | return query;
|
15684 | }
|
15685 | });
|
15686 | };
|
15687 |
|
15688 | }),
|
15689 |
|
15690 | (function(module, exports, __webpack_require__) {
|
15691 |
|
15692 | "use strict";
|
15693 |
|
15694 |
|
15695 | var _interopRequireDefault = __webpack_require__(1);
|
15696 |
|
15697 | var _promise = _interopRequireDefault(__webpack_require__(12));
|
15698 |
|
15699 | var _ = __webpack_require__(3);
|
15700 |
|
15701 | var cos = __webpack_require__(480);
|
15702 |
|
15703 | var qiniu = __webpack_require__(481);
|
15704 |
|
15705 | var s3 = __webpack_require__(527);
|
15706 |
|
15707 | var AVError = __webpack_require__(46);
|
15708 |
|
15709 | var _require = __webpack_require__(27),
|
15710 | request = _require.request,
|
15711 | AVRequest = _require._request;
|
15712 |
|
15713 | var _require2 = __webpack_require__(30),
|
15714 | tap = _require2.tap,
|
15715 | transformFetchOptions = _require2.transformFetchOptions;
|
15716 |
|
15717 | var debug = __webpack_require__(60)('leancloud:file');
|
15718 |
|
15719 | var parseBase64 = __webpack_require__(531);
|
15720 |
|
15721 | module.exports = function (AV) {
|
15722 |
|
15723 |
|
15724 | var extname = function extname(path) {
|
15725 | if (!_.isString(path)) return '';
|
15726 | return path.match(/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/)[4];
|
15727 | };
|
15728 |
|
15729 | var b64Digit = function b64Digit(number) {
|
15730 | if (number < 26) {
|
15731 | return String.fromCharCode(65 + number);
|
15732 | }
|
15733 |
|
15734 | if (number < 52) {
|
15735 | return String.fromCharCode(97 + (number - 26));
|
15736 | }
|
15737 |
|
15738 | if (number < 62) {
|
15739 | return String.fromCharCode(48 + (number - 52));
|
15740 | }
|
15741 |
|
15742 | if (number === 62) {
|
15743 | return '+';
|
15744 | }
|
15745 |
|
15746 | if (number === 63) {
|
15747 | return '/';
|
15748 | }
|
15749 |
|
15750 | throw new Error('Tried to encode large digit ' + number + ' in base64.');
|
15751 | };
|
15752 |
|
15753 | var encodeBase64 = function encodeBase64(array) {
|
15754 | var chunks = [];
|
15755 | chunks.length = Math.ceil(array.length / 3);
|
15756 |
|
15757 | _.times(chunks.length, function (i) {
|
15758 | var b1 = array[i * 3];
|
15759 | var b2 = array[i * 3 + 1] || 0;
|
15760 | var b3 = array[i * 3 + 2] || 0;
|
15761 | var has2 = i * 3 + 1 < array.length;
|
15762 | var has3 = i * 3 + 2 < array.length;
|
15763 | chunks[i] = [b64Digit(b1 >> 2 & 0x3f), b64Digit(b1 << 4 & 0x30 | b2 >> 4 & 0x0f), has2 ? b64Digit(b2 << 2 & 0x3c | b3 >> 6 & 0x03) : '=', has3 ? b64Digit(b3 & 0x3f) : '='].join('');
|
15764 | });
|
15765 |
|
15766 | return chunks.join('');
|
15767 | };
|
15768 | |
15769 |
|
15770 |
|
15771 |
|
15772 |
|
15773 |
|
15774 |
|
15775 |
|
15776 |
|
15777 |
|
15778 |
|
15779 |
|
15780 |
|
15781 |
|
15782 |
|
15783 |
|
15784 |
|
15785 |
|
15786 |
|
15787 |
|
15788 |
|
15789 |
|
15790 |
|
15791 |
|
15792 |
|
15793 |
|
15794 |
|
15795 |
|
15796 |
|
15797 |
|
15798 |
|
15799 |
|
15800 |
|
15801 |
|
15802 | AV.File = function (name, data, mimeType) {
|
15803 | this.attributes = {
|
15804 | name: name,
|
15805 | url: '',
|
15806 | metaData: {},
|
15807 |
|
15808 | base64: ''
|
15809 | };
|
15810 |
|
15811 | if (_.isString(data)) {
|
15812 | throw new TypeError('Creating an AV.File from a String is not yet supported.');
|
15813 | }
|
15814 |
|
15815 | if (_.isArray(data)) {
|
15816 | this.attributes.metaData.size = data.length;
|
15817 | data = {
|
15818 | base64: encodeBase64(data)
|
15819 | };
|
15820 | }
|
15821 |
|
15822 | this._extName = '';
|
15823 | this._data = data;
|
15824 | this._uploadHeaders = {};
|
15825 |
|
15826 | if (data && data.blob && typeof data.blob.uri === 'string') {
|
15827 | this._extName = extname(data.blob.uri);
|
15828 | }
|
15829 |
|
15830 | if (typeof Blob !== 'undefined' && data instanceof Blob) {
|
15831 | if (data.size) {
|
15832 | this.attributes.metaData.size = data.size;
|
15833 | }
|
15834 |
|
15835 | if (data.name) {
|
15836 | this._extName = extname(data.name);
|
15837 | }
|
15838 | }
|
15839 |
|
15840 | var owner;
|
15841 |
|
15842 | if (data && data.owner) {
|
15843 | owner = data.owner;
|
15844 | } else if (!AV._config.disableCurrentUser) {
|
15845 | try {
|
15846 | owner = AV.User.current();
|
15847 | } catch (error) {
|
15848 | if ('SYNC_API_NOT_AVAILABLE' !== error.code) {
|
15849 | throw error;
|
15850 | }
|
15851 | }
|
15852 | }
|
15853 |
|
15854 | this.attributes.metaData.owner = owner ? owner.id : 'unknown';
|
15855 | this.set('mime_type', mimeType);
|
15856 | };
|
15857 | |
15858 |
|
15859 |
|
15860 |
|
15861 |
|
15862 |
|
15863 |
|
15864 |
|
15865 |
|
15866 |
|
15867 |
|
15868 |
|
15869 | AV.File.withURL = function (name, url, metaData, type) {
|
15870 | if (!name || !url) {
|
15871 | throw new Error('Please provide file name and url');
|
15872 | }
|
15873 |
|
15874 | var file = new AV.File(name, null, type);
|
15875 |
|
15876 | if (metaData) {
|
15877 | for (var prop in metaData) {
|
15878 | if (!file.attributes.metaData[prop]) file.attributes.metaData[prop] = metaData[prop];
|
15879 | }
|
15880 | }
|
15881 |
|
15882 | file.attributes.url = url;
|
15883 |
|
15884 | file.attributes.metaData.__source = 'external';
|
15885 | file.attributes.metaData.size = 0;
|
15886 | return file;
|
15887 | };
|
15888 | |
15889 |
|
15890 |
|
15891 |
|
15892 |
|
15893 |
|
15894 |
|
15895 | AV.File.createWithoutData = function (objectId) {
|
15896 | if (!objectId) {
|
15897 | throw new TypeError('The objectId must be provided');
|
15898 | }
|
15899 |
|
15900 | var file = new AV.File();
|
15901 | file.id = objectId;
|
15902 | return file;
|
15903 | };
|
15904 | |
15905 |
|
15906 |
|
15907 |
|
15908 |
|
15909 |
|
15910 |
|
15911 |
|
15912 | AV.File.censor = function (objectId) {
|
15913 | if (!AV._config.masterKey) {
|
15914 | throw new Error('Cannot censor a file without masterKey');
|
15915 | }
|
15916 |
|
15917 | return request({
|
15918 | method: 'POST',
|
15919 | path: "/files/".concat(objectId, "/censor"),
|
15920 | authOptions: {
|
15921 | useMasterKey: true
|
15922 | }
|
15923 | }).then(function (res) {
|
15924 | return res.censorResult;
|
15925 | });
|
15926 | };
|
15927 |
|
15928 | _.extend(AV.File.prototype,
|
15929 |
|
15930 | {
|
15931 | className: '_File',
|
15932 | _toFullJSON: function _toFullJSON(seenObjects) {
|
15933 | var _this = this;
|
15934 |
|
15935 | var full = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
15936 |
|
15937 | var json = _.clone(this.attributes);
|
15938 |
|
15939 | AV._objectEach(json, function (val, key) {
|
15940 | json[key] = AV._encode(val, seenObjects, undefined, full);
|
15941 | });
|
15942 |
|
15943 | AV._objectEach(this._operations, function (val, key) {
|
15944 | json[key] = val;
|
15945 | });
|
15946 |
|
15947 | if (_.has(this, 'id')) {
|
15948 | json.objectId = this.id;
|
15949 | }
|
15950 |
|
15951 | ['createdAt', 'updatedAt'].forEach(function (key) {
|
15952 | if (_.has(_this, key)) {
|
15953 | var val = _this[key];
|
15954 | json[key] = _.isDate(val) ? val.toJSON() : val;
|
15955 | }
|
15956 | });
|
15957 |
|
15958 | if (full) {
|
15959 | json.__type = 'File';
|
15960 | }
|
15961 |
|
15962 | return json;
|
15963 | },
|
15964 |
|
15965 | |
15966 |
|
15967 |
|
15968 |
|
15969 |
|
15970 |
|
15971 | toFullJSON: function toFullJSON() {
|
15972 | var seenObjects = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
15973 | return this._toFullJSON(seenObjects);
|
15974 | },
|
15975 |
|
15976 | |
15977 |
|
15978 |
|
15979 |
|
15980 | toJSON: function toJSON(key, holder) {
|
15981 | var seenObjects = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [this];
|
15982 | return this._toFullJSON(seenObjects, false);
|
15983 | },
|
15984 |
|
15985 | |
15986 |
|
15987 |
|
15988 |
|
15989 | _toPointer: function _toPointer() {
|
15990 | return {
|
15991 | __type: 'Pointer',
|
15992 | className: this.className,
|
15993 | objectId: this.id
|
15994 | };
|
15995 | },
|
15996 |
|
15997 | |
15998 |
|
15999 |
|
16000 |
|
16001 | getACL: function getACL() {
|
16002 | return this._acl;
|
16003 | },
|
16004 |
|
16005 | |
16006 |
|
16007 |
|
16008 |
|
16009 | setACL: function setACL(acl) {
|
16010 | if (!(acl instanceof AV.ACL)) {
|
16011 | return new AVError(AVError.OTHER_CAUSE, 'ACL must be a AV.ACL.');
|
16012 | }
|
16013 |
|
16014 | this._acl = acl;
|
16015 | return this;
|
16016 | },
|
16017 |
|
16018 | |
16019 |
|
16020 |
|
16021 |
|
16022 |
|
16023 | name: function name() {
|
16024 | return this.get('name');
|
16025 | },
|
16026 |
|
16027 | |
16028 |
|
16029 |
|
16030 |
|
16031 |
|
16032 | url: function url() {
|
16033 | return this.get('url');
|
16034 | },
|
16035 |
|
16036 | |
16037 |
|
16038 |
|
16039 |
|
16040 |
|
16041 | get: function get(attrName) {
|
16042 | switch (attrName) {
|
16043 | case 'objectId':
|
16044 | return this.id;
|
16045 |
|
16046 | case 'url':
|
16047 | case 'name':
|
16048 | case 'mime_type':
|
16049 | case 'metaData':
|
16050 | case 'createdAt':
|
16051 | case 'updatedAt':
|
16052 | return this.attributes[attrName];
|
16053 |
|
16054 | default:
|
16055 | return this.attributes.metaData[attrName];
|
16056 | }
|
16057 | },
|
16058 |
|
16059 | |
16060 |
|
16061 |
|
16062 |
|
16063 |
|
16064 |
|
16065 |
|
16066 | set: function set() {
|
16067 | var _this2 = this;
|
16068 |
|
16069 | var set = function set(attrName, value) {
|
16070 | switch (attrName) {
|
16071 | case 'name':
|
16072 | case 'url':
|
16073 | case 'mime_type':
|
16074 | case 'base64':
|
16075 | case 'metaData':
|
16076 | _this2.attributes[attrName] = value;
|
16077 | break;
|
16078 |
|
16079 | default:
|
16080 |
|
16081 | _this2.attributes.metaData[attrName] = value;
|
16082 | break;
|
16083 | }
|
16084 | };
|
16085 |
|
16086 | for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
16087 | args[_key] = arguments[_key];
|
16088 | }
|
16089 |
|
16090 | switch (args.length) {
|
16091 | case 1:
|
16092 |
|
16093 | for (var k in args[0]) {
|
16094 | set(k, args[0][k]);
|
16095 | }
|
16096 |
|
16097 | break;
|
16098 |
|
16099 | case 2:
|
16100 | set(args[0], args[1]);
|
16101 | break;
|
16102 | }
|
16103 |
|
16104 | return this;
|
16105 | },
|
16106 |
|
16107 | /**
|
16108 | * Set a header for the upload request.
|
16109 | * For more infomation, go to https://url.leanapp.cn/avfile-upload-headers
|
16110 | *
|
16111 | * @param {String} key header key
|
16112 | * @param {String} value header value
|
16113 | * @return {AV.File} this
|
16114 | */
|
16115 | setUploadHeader: function setUploadHeader(key, value) {
|
16116 | this._uploadHeaders[key] = value;
|
16117 | return this;
|
16118 | },
|
16119 |
|
16120 | |
16121 |
|
16122 |
|
16123 |
|
16124 |
|
16125 |
|
16126 |
|
16127 |
|
16128 |
|
16129 |
|
16130 |
|
16131 |
|
16132 | metaData: function metaData(attr, value) {
|
16133 | if (attr && value) {
|
16134 | this.attributes.metaData[attr] = value;
|
16135 | return this;
|
16136 | } else if (attr && !value) {
|
16137 | return this.attributes.metaData[attr];
|
16138 | } else {
|
16139 | return this.attributes.metaData;
|
16140 | }
|
16141 | },
|
16142 |
|
16143 | |
16144 |
|
16145 |
|
16146 |
|
16147 |
|
16148 |
|
16149 |
|
16150 |
|
16151 |
|
16152 | thumbnailURL: function thumbnailURL(width, height) {
|
16153 | var quality = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 100;
|
16154 | var scaleToFit = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
|
16155 | var fmt = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 'png';
|
16156 | var url = this.attributes.url;
|
16157 |
|
16158 | if (!url) {
|
16159 | throw new Error('Invalid url.');
|
16160 | }
|
16161 |
|
16162 | if (!width || !height || width <= 0 || height <= 0) {
|
16163 | throw new Error('Invalid width or height value.');
|
16164 | }
|
16165 |
|
16166 | if (quality <= 0 || quality > 100) {
|
16167 | throw new Error('Invalid quality value.');
|
16168 | }
|
16169 |
|
16170 | var mode = scaleToFit ? 2 : 1;
|
16171 | return url + '?imageView/' + mode + '/w/' + width + '/h/' + height + '/q/' + quality + '/format/' + fmt;
|
16172 | },
|
16173 |
|
16174 | |
16175 |
|
16176 |
|
16177 |
|
16178 | size: function size() {
|
16179 | return this.metaData().size;
|
16180 | },
|
16181 |
|
16182 | |
16183 |
|
16184 |
|
16185 |
|
16186 | ownerId: function ownerId() {
|
16187 | return this.metaData().owner;
|
16188 | },
|
16189 |
|
16190 | |
16191 |
|
16192 |
|
16193 |
|
16194 |
|
16195 |
|
16196 | destroy: function destroy(options) {
|
16197 | if (!this.id) {
|
16198 | return _promise.default.reject(new Error('The file id does not eixst.'));
|
16199 | }
|
16200 |
|
16201 | var request = AVRequest('files', null, this.id, 'DELETE', null, options);
|
16202 | return request;
|
16203 | },
|
16204 |
|
16205 | |
16206 |
|
16207 |
|
16208 |
|
16209 |
|
16210 |
|
16211 | _fileToken: function _fileToken(type, authOptions) {
|
16212 | var name = this.attributes.name;
|
16213 | var extName = extname(name);
|
16214 |
|
16215 | if (!extName && this._extName) {
|
16216 | name += this._extName;
|
16217 | extName = this._extName;
|
16218 | }
|
16219 |
|
16220 | var data = {
|
16221 | name: name,
|
16222 | keep_file_name: authOptions.keepFileName,
|
16223 | key: authOptions.key,
|
16224 | ACL: this._acl,
|
16225 | mime_type: type,
|
16226 | metaData: this.attributes.metaData
|
16227 | };
|
16228 | return AVRequest('fileTokens', null, null, 'POST', data, authOptions);
|
16229 | },
|
16230 |
|
16231 | |
16232 |
|
16233 |
|
16234 |
|
16235 |
|
16236 | |
16237 |
|
16238 |
|
16239 |
|
16240 |
|
16241 |
|
16242 |
|
16243 |
|
16244 | save: function save() {
|
16245 | var _this3 = this;
|
16246 |
|
16247 | var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
16248 |
|
16249 | if (this.id) {
|
16250 | throw new Error('File is already saved.');
|
16251 | }
|
16252 |
|
16253 | if (!this._previousSave) {
|
16254 | if (this._data) {
|
16255 | var mimeType = this.get('mime_type');
|
16256 | this._previousSave = this._fileToken(mimeType, options).then(function (uploadInfo) {
|
16257 | if (uploadInfo.mime_type) {
|
16258 | mimeType = uploadInfo.mime_type;
|
16259 |
|
16260 | _this3.set('mime_type', mimeType);
|
16261 | }
|
16262 |
|
16263 | _this3._token = uploadInfo.token;
|
16264 | return _promise.default.resolve().then(function () {
|
16265 | var data = _this3._data;
|
16266 |
|
16267 | if (data && data.base64) {
|
16268 | return parseBase64(data.base64, mimeType);
|
16269 | }
|
16270 |
|
16271 | if (data && data.blob) {
|
16272 | if (!data.blob.type && mimeType) {
|
16273 | data.blob.type = mimeType;
|
16274 | }
|
16275 |
|
16276 | if (!data.blob.name) {
|
16277 | data.blob.name = _this3.get('name');
|
16278 | }
|
16279 |
|
16280 | return data.blob;
|
16281 | }
|
16282 |
|
16283 | if (typeof Blob !== 'undefined' && data instanceof Blob) {
|
16284 | return data;
|
16285 | }
|
16286 |
|
16287 | throw new TypeError('malformed file data');
|
16288 | }).then(function (data) {
|
16289 | var _options = _.extend({}, options);
|
16290 |
|
16291 |
|
16292 | if (options.onprogress) {
|
16293 | _options.onprogress = function (event) {
|
16294 | if (event.direction === 'download') return;
|
16295 | return options.onprogress(event);
|
16296 | };
|
16297 | }
|
16298 |
|
16299 | switch (uploadInfo.provider) {
|
16300 | case 's3':
|
16301 | return s3(uploadInfo, data, _this3, _options);
|
16302 |
|
16303 | case 'qcloud':
|
16304 | return cos(uploadInfo, data, _this3, _options);
|
16305 |
|
16306 | case 'qiniu':
|
16307 | default:
|
16308 | return qiniu(uploadInfo, data, _this3, _options);
|
16309 | }
|
16310 | }).then(tap(function () {
|
16311 | return _this3._callback(true);
|
16312 | }), function (error) {
|
16313 | _this3._callback(false);
|
16314 |
|
16315 | throw error;
|
16316 | });
|
16317 | });
|
16318 | } else if (this.attributes.url && this.attributes.metaData.__source === 'external') {
|
16319 |
|
16320 | var data = {
|
16321 | name: this.attributes.name,
|
16322 | ACL: this._acl,
|
16323 | metaData: this.attributes.metaData,
|
16324 | mime_type: this.mimeType,
|
16325 | url: this.attributes.url
|
16326 | };
|
16327 | this._previousSave = AVRequest('files', null, null, 'post', data, options).then(function (response) {
|
16328 | _this3.id = response.objectId;
|
16329 | return _this3;
|
16330 | });
|
16331 | }
|
16332 | }
|
16333 |
|
16334 | return this._previousSave;
|
16335 | },
|
16336 | _callback: function _callback(success) {
|
16337 | AVRequest('fileCallback', null, null, 'post', {
|
16338 | token: this._token,
|
16339 | result: success
|
16340 | }).catch(debug);
|
16341 | delete this._token;
|
16342 | delete this._data;
|
16343 | },
|
16344 |
|
16345 | |
16346 |
|
16347 |
|
16348 |
|
16349 |
|
16350 |
|
16351 |
|
16352 |
|
16353 |
|
16354 | fetch: function fetch(fetchOptions, options) {
|
16355 | if (!this.id) {
|
16356 | throw new Error('Cannot fetch unsaved file');
|
16357 | }
|
16358 |
|
16359 | var request = AVRequest('files', null, this.id, 'GET', transformFetchOptions(fetchOptions), options);
|
16360 | return request.then(this._finishFetch.bind(this));
|
16361 | },
|
16362 | _finishFetch: function _finishFetch(response) {
|
16363 | var value = AV.Object.prototype.parse(response);
|
16364 | value.attributes = {
|
16365 | name: value.name,
|
16366 | url: value.url,
|
16367 | mime_type: value.mime_type,
|
16368 | bucket: value.bucket
|
16369 | };
|
16370 | value.attributes.metaData = value.metaData || {};
|
16371 | value.id = value.objectId;
|
16372 |
|
16373 | delete value.objectId;
|
16374 | delete value.metaData;
|
16375 | delete value.url;
|
16376 | delete value.name;
|
16377 | delete value.mime_type;
|
16378 | delete value.bucket;
|
16379 |
|
16380 | _.extend(this, value);
|
16381 |
|
16382 | return this;
|
16383 | },
|
16384 |
|
16385 | |
16386 |
|
16387 |
|
16388 |
|
16389 |
|
16390 | censor: function censor() {
|
16391 | if (!this.id) {
|
16392 | throw new Error('Cannot censor an unsaved file');
|
16393 | }
|
16394 |
|
16395 | return AV.File.censor(this.id);
|
16396 | }
|
16397 | });
|
16398 | };
|
16399 |
|
16400 | }),
|
16401 |
|
16402 | (function(module, exports, __webpack_require__) {
|
16403 |
|
16404 | "use strict";
|
16405 |
|
16406 |
|
16407 | var _require = __webpack_require__(72),
|
16408 | getAdapter = _require.getAdapter;
|
16409 |
|
16410 | var debug = __webpack_require__(60)('cos');
|
16411 |
|
16412 | module.exports = function (uploadInfo, data, file) {
|
16413 | var saveOptions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
16414 | var url = uploadInfo.upload_url + '?sign=' + encodeURIComponent(uploadInfo.token);
|
16415 | var fileFormData = {
|
16416 | field: 'fileContent',
|
16417 | data: data,
|
16418 | name: file.attributes.name
|
16419 | };
|
16420 | var options = {
|
16421 | headers: file._uploadHeaders,
|
16422 | data: {
|
16423 | op: 'upload'
|
16424 | },
|
16425 | onprogress: saveOptions.onprogress
|
16426 | };
|
16427 | debug('url: %s, file: %o, options: %o', url, fileFormData, options);
|
16428 | var upload = getAdapter('upload');
|
16429 | return upload(url, fileFormData, options).then(function (response) {
|
16430 | debug(response.status, response.data);
|
16431 |
|
16432 | if (response.ok === false) {
|
16433 | var error = new Error(response.status);
|
16434 | error.response = response;
|
16435 | throw error;
|
16436 | }
|
16437 |
|
16438 | file.attributes.url = uploadInfo.url;
|
16439 | file._bucket = uploadInfo.bucket;
|
16440 | file.id = uploadInfo.objectId;
|
16441 | return file;
|
16442 | }, function (error) {
|
16443 | var response = error.response;
|
16444 |
|
16445 | if (response) {
|
16446 | debug(response.status, response.data);
|
16447 | error.statusCode = response.status;
|
16448 | error.response = response.data;
|
16449 | }
|
16450 |
|
16451 | throw error;
|
16452 | });
|
16453 | };
|
16454 |
|
16455 | }),
|
16456 |
|
16457 | (function(module, exports, __webpack_require__) {
|
16458 |
|
16459 | "use strict";
|
16460 |
|
16461 |
|
16462 | var _sliceInstanceProperty2 = __webpack_require__(61);
|
16463 |
|
16464 | var _Array$from = __webpack_require__(253);
|
16465 |
|
16466 | var _Symbol = __webpack_require__(150);
|
16467 |
|
16468 | var _getIteratorMethod = __webpack_require__(255);
|
16469 |
|
16470 | var _Reflect$construct = __webpack_require__(491);
|
16471 |
|
16472 | var _interopRequireDefault = __webpack_require__(1);
|
16473 |
|
16474 | var _inherits2 = _interopRequireDefault(__webpack_require__(495));
|
16475 |
|
16476 | var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(517));
|
16477 |
|
16478 | var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(519));
|
16479 |
|
16480 | var _classCallCheck2 = _interopRequireDefault(__webpack_require__(524));
|
16481 |
|
16482 | var _createClass2 = _interopRequireDefault(__webpack_require__(525));
|
16483 |
|
16484 | var _stringify = _interopRequireDefault(__webpack_require__(36));
|
16485 |
|
16486 | var _concat = _interopRequireDefault(__webpack_require__(22));
|
16487 |
|
16488 | var _promise = _interopRequireDefault(__webpack_require__(12));
|
16489 |
|
16490 | var _slice = _interopRequireDefault(__webpack_require__(61));
|
16491 |
|
16492 | function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
16493 |
|
16494 | function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !_Reflect$construct) return false; if (_Reflect$construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
16495 |
|
16496 | function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof _Symbol !== "undefined" && _getIteratorMethod(o) || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
16497 |
|
16498 | function _unsupportedIterableToArray(o, minLen) { var _context8; if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = _sliceInstanceProperty2(_context8 = Object.prototype.toString.call(o)).call(_context8, 8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return _Array$from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
16499 |
|
16500 | function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
16501 |
|
16502 | var _require = __webpack_require__(72),
|
16503 | getAdapter = _require.getAdapter;
|
16504 |
|
16505 | var debug = __webpack_require__(60)('leancloud:qiniu');
|
16506 |
|
16507 | var ajax = __webpack_require__(116);
|
16508 |
|
16509 | var btoa = __webpack_require__(526);
|
16510 |
|
16511 | var SHARD_THRESHOLD = 1024 * 1024 * 64;
|
16512 | var CHUNK_SIZE = 1024 * 1024 * 16;
|
16513 |
|
16514 | function upload(uploadInfo, data, file) {
|
16515 | var saveOptions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
16516 |
|
16517 | var uptoken = uploadInfo.token;
|
16518 | var url = uploadInfo.upload_url || 'https://upload.qiniup.com';
|
16519 | var fileFormData = {
|
16520 | field: 'file',
|
16521 | data: data,
|
16522 | name: file.attributes.name
|
16523 | };
|
16524 | var options = {
|
16525 | headers: file._uploadHeaders,
|
16526 | data: {
|
16527 | name: file.attributes.name,
|
16528 | key: uploadInfo.key,
|
16529 | token: uptoken
|
16530 | },
|
16531 | onprogress: saveOptions.onprogress
|
16532 | };
|
16533 | debug('url: %s, file: %o, options: %o', url, fileFormData, options);
|
16534 | var upload = getAdapter('upload');
|
16535 | return upload(url, fileFormData, options).then(function (response) {
|
16536 | debug(response.status, response.data);
|
16537 |
|
16538 | if (response.ok === false) {
|
16539 | var message = response.status;
|
16540 |
|
16541 | if (response.data) {
|
16542 | if (response.data.error) {
|
16543 | message = response.data.error;
|
16544 | } else {
|
16545 | message = (0, _stringify.default)(response.data);
|
16546 | }
|
16547 | }
|
16548 |
|
16549 | var error = new Error(message);
|
16550 | error.response = response;
|
16551 | throw error;
|
16552 | }
|
16553 |
|
16554 | file.attributes.url = uploadInfo.url;
|
16555 | file._bucket = uploadInfo.bucket;
|
16556 | file.id = uploadInfo.objectId;
|
16557 | return file;
|
16558 | }, function (error) {
|
16559 | var response = error.response;
|
16560 |
|
16561 | if (response) {
|
16562 | debug(response.status, response.data);
|
16563 | error.statusCode = response.status;
|
16564 | error.response = response.data;
|
16565 | }
|
16566 |
|
16567 | throw error;
|
16568 | });
|
16569 | }
|
16570 |
|
16571 | function urlSafeBase64(string) {
|
16572 | var base64 = btoa(unescape(encodeURIComponent(string)));
|
16573 | var result = '';
|
16574 |
|
16575 | var _iterator = _createForOfIteratorHelper(base64),
|
16576 | _step;
|
16577 |
|
16578 | try {
|
16579 | for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
16580 | var ch = _step.value;
|
16581 |
|
16582 | switch (ch) {
|
16583 | case '+':
|
16584 | result += '-';
|
16585 | break;
|
16586 |
|
16587 | case '/':
|
16588 | result += '_';
|
16589 | break;
|
16590 |
|
16591 | default:
|
16592 | result += ch;
|
16593 | }
|
16594 | }
|
16595 | } catch (err) {
|
16596 | _iterator.e(err);
|
16597 | } finally {
|
16598 | _iterator.f();
|
16599 | }
|
16600 |
|
16601 | return result;
|
16602 | }
|
16603 |
|
16604 | var ShardUploader = function () {
|
16605 | function ShardUploader(uploadInfo, data, file, saveOptions) {
|
16606 | var _context,
|
16607 | _context2,
|
16608 | _this = this;
|
16609 |
|
16610 | (0, _classCallCheck2.default)(this, ShardUploader);
|
16611 | this.uploadInfo = uploadInfo;
|
16612 | this.data = data;
|
16613 | this.file = file;
|
16614 | this.size = undefined;
|
16615 | this.offset = 0;
|
16616 | this.uploadedChunks = 0;
|
16617 | var key = urlSafeBase64(uploadInfo.key);
|
16618 | var uploadURL = uploadInfo.upload_url || 'https://upload.qiniup.com';
|
16619 | this.baseURL = (0, _concat.default)(_context = (0, _concat.default)(_context2 = "".concat(uploadURL, "/buckets/")).call(_context2, uploadInfo.bucket, "/objects/")).call(_context, key, "/uploads");
|
16620 | this.upToken = 'UpToken ' + uploadInfo.token;
|
16621 | this.uploaded = 0;
|
16622 |
|
16623 | if (saveOptions && saveOptions.onprogress) {
|
16624 | this.onProgress = function (_ref) {
|
16625 | var loaded = _ref.loaded;
|
16626 | loaded += _this.uploadedChunks * CHUNK_SIZE;
|
16627 |
|
16628 | if (loaded <= _this.uploaded) {
|
16629 | return;
|
16630 | }
|
16631 |
|
16632 | if (_this.size) {
|
16633 | saveOptions.onprogress({
|
16634 | loaded: loaded,
|
16635 | total: _this.size,
|
16636 | percent: loaded / _this.size * 100
|
16637 | });
|
16638 | } else {
|
16639 | saveOptions.onprogress({
|
16640 | loaded: loaded
|
16641 | });
|
16642 | }
|
16643 |
|
16644 | _this.uploaded = loaded;
|
16645 | };
|
16646 | }
|
16647 | }
|
16648 | |
16649 |
|
16650 |
|
16651 |
|
16652 |
|
16653 | (0, _createClass2.default)(ShardUploader, [{
|
16654 | key: "getUploadId",
|
16655 | value: function getUploadId() {
|
16656 | return ajax({
|
16657 | method: 'POST',
|
16658 | url: this.baseURL,
|
16659 | headers: {
|
16660 | Authorization: this.upToken
|
16661 | }
|
16662 | }).then(function (res) {
|
16663 | return res.uploadId;
|
16664 | });
|
16665 | }
|
16666 | }, {
|
16667 | key: "getChunk",
|
16668 | value: function getChunk() {
|
16669 | throw new Error('Not implemented');
|
16670 | }
|
16671 | |
16672 |
|
16673 |
|
16674 |
|
16675 |
|
16676 |
|
16677 |
|
16678 | }, {
|
16679 | key: "uploadPart",
|
16680 | value: function uploadPart(uploadId, partNumber, data) {
|
16681 | var _context3, _context4;
|
16682 |
|
16683 | return ajax({
|
16684 | method: 'PUT',
|
16685 | url: (0, _concat.default)(_context3 = (0, _concat.default)(_context4 = "".concat(this.baseURL, "/")).call(_context4, uploadId, "/")).call(_context3, partNumber),
|
16686 | headers: {
|
16687 | Authorization: this.upToken
|
16688 | },
|
16689 | data: data,
|
16690 | onprogress: this.onProgress
|
16691 | }).then(function (_ref2) {
|
16692 | var etag = _ref2.etag;
|
16693 | return {
|
16694 | partNumber: partNumber,
|
16695 | etag: etag
|
16696 | };
|
16697 | });
|
16698 | }
|
16699 | }, {
|
16700 | key: "stopUpload",
|
16701 | value: function stopUpload(uploadId) {
|
16702 | var _context5;
|
16703 |
|
16704 | return ajax({
|
16705 | method: 'DELETE',
|
16706 | url: (0, _concat.default)(_context5 = "".concat(this.baseURL, "/")).call(_context5, uploadId),
|
16707 | headers: {
|
16708 | Authorization: this.upToken
|
16709 | }
|
16710 | });
|
16711 | }
|
16712 | }, {
|
16713 | key: "upload",
|
16714 | value: function upload() {
|
16715 | var _this2 = this;
|
16716 |
|
16717 | var parts = [];
|
16718 | return this.getUploadId().then(function (uploadId) {
|
16719 | var uploadPart = function uploadPart() {
|
16720 | return _promise.default.resolve(_this2.getChunk()).then(function (chunk) {
|
16721 | if (!chunk) {
|
16722 | return;
|
16723 | }
|
16724 |
|
16725 | var partNumber = parts.length + 1;
|
16726 | return _this2.uploadPart(uploadId, partNumber, chunk).then(function (part) {
|
16727 | parts.push(part);
|
16728 | _this2.uploadedChunks++;
|
16729 | return uploadPart();
|
16730 | });
|
16731 | }).catch(function (error) {
|
16732 | return _this2.stopUpload(uploadId).then(function () {
|
16733 | return _promise.default.reject(error);
|
16734 | });
|
16735 | });
|
16736 | };
|
16737 |
|
16738 | return uploadPart().then(function () {
|
16739 | var _context6;
|
16740 |
|
16741 | return ajax({
|
16742 | method: 'POST',
|
16743 | url: (0, _concat.default)(_context6 = "".concat(_this2.baseURL, "/")).call(_context6, uploadId),
|
16744 | headers: {
|
16745 | Authorization: _this2.upToken
|
16746 | },
|
16747 | data: {
|
16748 | parts: parts,
|
16749 | fname: _this2.file.attributes.name,
|
16750 | mimeType: _this2.file.attributes.mime_type
|
16751 | }
|
16752 | });
|
16753 | });
|
16754 | }).then(function () {
|
16755 | _this2.file.attributes.url = _this2.uploadInfo.url;
|
16756 | _this2.file._bucket = _this2.uploadInfo.bucket;
|
16757 | _this2.file.id = _this2.uploadInfo.objectId;
|
16758 | return _this2.file;
|
16759 | });
|
16760 | }
|
16761 | }]);
|
16762 | return ShardUploader;
|
16763 | }();
|
16764 |
|
16765 | var BlobUploader = function (_ShardUploader) {
|
16766 | (0, _inherits2.default)(BlobUploader, _ShardUploader);
|
16767 |
|
16768 | var _super = _createSuper(BlobUploader);
|
16769 |
|
16770 | function BlobUploader(uploadInfo, data, file, saveOptions) {
|
16771 | var _this3;
|
16772 |
|
16773 | (0, _classCallCheck2.default)(this, BlobUploader);
|
16774 | _this3 = _super.call(this, uploadInfo, data, file, saveOptions);
|
16775 | _this3.size = data.size;
|
16776 | return _this3;
|
16777 | }
|
16778 | |
16779 |
|
16780 |
|
16781 |
|
16782 |
|
16783 | (0, _createClass2.default)(BlobUploader, [{
|
16784 | key: "getChunk",
|
16785 | value: function getChunk() {
|
16786 | var _context7;
|
16787 |
|
16788 | if (this.offset >= this.size) {
|
16789 | return null;
|
16790 | }
|
16791 |
|
16792 | var chunk = (0, _slice.default)(_context7 = this.data).call(_context7, this.offset, this.offset + CHUNK_SIZE);
|
16793 | this.offset += chunk.size;
|
16794 | return chunk;
|
16795 | }
|
16796 | }]);
|
16797 | return BlobUploader;
|
16798 | }(ShardUploader);
|
16799 |
|
16800 | function isBlob(data) {
|
16801 | return typeof Blob !== 'undefined' && data instanceof Blob;
|
16802 | }
|
16803 |
|
16804 | module.exports = function (uploadInfo, data, file) {
|
16805 | var saveOptions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
16806 |
|
16807 | if (isBlob(data) && data.size >= SHARD_THRESHOLD) {
|
16808 | return new BlobUploader(uploadInfo, data, file, saveOptions).upload();
|
16809 | }
|
16810 |
|
16811 | return upload(uploadInfo, data, file, saveOptions);
|
16812 | };
|
16813 |
|
16814 | }),
|
16815 |
|
16816 | (function(module, exports, __webpack_require__) {
|
16817 |
|
16818 | __webpack_require__(55);
|
16819 | __webpack_require__(483);
|
16820 | var path = __webpack_require__(5);
|
16821 |
|
16822 | module.exports = path.Array.from;
|
16823 |
|
16824 |
|
16825 | }),
|
16826 |
|
16827 | (function(module, exports, __webpack_require__) {
|
16828 |
|
16829 | var $ = __webpack_require__(0);
|
16830 | var from = __webpack_require__(484);
|
16831 | var checkCorrectnessOfIteration = __webpack_require__(179);
|
16832 |
|
16833 | var INCORRECT_ITERATION = !checkCorrectnessOfIteration(function (iterable) {
|
16834 |
|
16835 | Array.from(iterable);
|
16836 | });
|
16837 |
|
16838 |
|
16839 |
|
16840 | $({ target: 'Array', stat: true, forced: INCORRECT_ITERATION }, {
|
16841 | from: from
|
16842 | });
|
16843 |
|
16844 |
|
16845 | }),
|
16846 |
|
16847 | (function(module, exports, __webpack_require__) {
|
16848 |
|
16849 | "use strict";
|
16850 |
|
16851 | var bind = __webpack_require__(48);
|
16852 | var call = __webpack_require__(15);
|
16853 | var toObject = __webpack_require__(34);
|
16854 | var callWithSafeIterationClosing = __webpack_require__(485);
|
16855 | var isArrayIteratorMethod = __webpack_require__(167);
|
16856 | var isConstructor = __webpack_require__(109);
|
16857 | var lengthOfArrayLike = __webpack_require__(41);
|
16858 | var createProperty = __webpack_require__(91);
|
16859 | var getIterator = __webpack_require__(168);
|
16860 | var getIteratorMethod = __webpack_require__(106);
|
16861 |
|
16862 | var $Array = Array;
|
16863 |
|
16864 |
|
16865 |
|
16866 | module.exports = function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) {
|
16867 | var O = toObject(arrayLike);
|
16868 | var IS_CONSTRUCTOR = isConstructor(this);
|
16869 | var argumentsLength = arguments.length;
|
16870 | var mapfn = argumentsLength > 1 ? arguments[1] : undefined;
|
16871 | var mapping = mapfn !== undefined;
|
16872 | if (mapping) mapfn = bind(mapfn, argumentsLength > 2 ? arguments[2] : undefined);
|
16873 | var iteratorMethod = getIteratorMethod(O);
|
16874 | var index = 0;
|
16875 | var length, result, step, iterator, next, value;
|
16876 |
|
16877 | if (iteratorMethod && !(this === $Array && isArrayIteratorMethod(iteratorMethod))) {
|
16878 | iterator = getIterator(O, iteratorMethod);
|
16879 | next = iterator.next;
|
16880 | result = IS_CONSTRUCTOR ? new this() : [];
|
16881 | for (;!(step = call(next, iterator)).done; index++) {
|
16882 | value = mapping ? callWithSafeIterationClosing(iterator, mapfn, [step.value, index], true) : step.value;
|
16883 | createProperty(result, index, value);
|
16884 | }
|
16885 | } else {
|
16886 | length = lengthOfArrayLike(O);
|
16887 | result = IS_CONSTRUCTOR ? new this(length) : $Array(length);
|
16888 | for (;length > index; index++) {
|
16889 | value = mapping ? mapfn(O[index], index) : O[index];
|
16890 | createProperty(result, index, value);
|
16891 | }
|
16892 | }
|
16893 | result.length = index;
|
16894 | return result;
|
16895 | };
|
16896 |
|
16897 |
|
16898 | }),
|
16899 |
|
16900 | (function(module, exports, __webpack_require__) {
|
16901 |
|
16902 | var anObject = __webpack_require__(20);
|
16903 | var iteratorClose = __webpack_require__(169);
|
16904 |
|
16905 |
|
16906 | module.exports = function (iterator, fn, value, ENTRIES) {
|
16907 | try {
|
16908 | return ENTRIES ? fn(anObject(value)[0], value[1]) : fn(value);
|
16909 | } catch (error) {
|
16910 | iteratorClose(iterator, 'throw', error);
|
16911 | }
|
16912 | };
|
16913 |
|
16914 |
|
16915 | }),
|
16916 |
|
16917 | (function(module, exports, __webpack_require__) {
|
16918 |
|
16919 | module.exports = __webpack_require__(487);
|
16920 |
|
16921 |
|
16922 | }),
|
16923 |
|
16924 | (function(module, exports, __webpack_require__) {
|
16925 |
|
16926 | var parent = __webpack_require__(488);
|
16927 |
|
16928 | module.exports = parent;
|
16929 |
|
16930 |
|
16931 | }),
|
16932 |
|
16933 | (function(module, exports, __webpack_require__) {
|
16934 |
|
16935 | var parent = __webpack_require__(489);
|
16936 |
|
16937 | module.exports = parent;
|
16938 |
|
16939 |
|
16940 | }),
|
16941 |
|
16942 | (function(module, exports, __webpack_require__) {
|
16943 |
|
16944 | var parent = __webpack_require__(490);
|
16945 | __webpack_require__(39);
|
16946 |
|
16947 | module.exports = parent;
|
16948 |
|
16949 |
|
16950 | }),
|
16951 |
|
16952 | (function(module, exports, __webpack_require__) {
|
16953 |
|
16954 | __webpack_require__(38);
|
16955 | __webpack_require__(55);
|
16956 | var getIteratorMethod = __webpack_require__(106);
|
16957 |
|
16958 | module.exports = getIteratorMethod;
|
16959 |
|
16960 |
|
16961 | }),
|
16962 |
|
16963 | (function(module, exports, __webpack_require__) {
|
16964 |
|
16965 | module.exports = __webpack_require__(492);
|
16966 |
|
16967 | }),
|
16968 |
|
16969 | (function(module, exports, __webpack_require__) {
|
16970 |
|
16971 | var parent = __webpack_require__(493);
|
16972 |
|
16973 | module.exports = parent;
|
16974 |
|
16975 |
|
16976 | }),
|
16977 |
|
16978 | (function(module, exports, __webpack_require__) {
|
16979 |
|
16980 | __webpack_require__(494);
|
16981 | var path = __webpack_require__(5);
|
16982 |
|
16983 | module.exports = path.Reflect.construct;
|
16984 |
|
16985 |
|
16986 | }),
|
16987 |
|
16988 | (function(module, exports, __webpack_require__) {
|
16989 |
|
16990 | var $ = __webpack_require__(0);
|
16991 | var getBuiltIn = __webpack_require__(18);
|
16992 | var apply = __webpack_require__(75);
|
16993 | var bind = __webpack_require__(256);
|
16994 | var aConstructor = __webpack_require__(175);
|
16995 | var anObject = __webpack_require__(20);
|
16996 | var isObject = __webpack_require__(11);
|
16997 | var create = __webpack_require__(49);
|
16998 | var fails = __webpack_require__(2);
|
16999 |
|
17000 | var nativeConstruct = getBuiltIn('Reflect', 'construct');
|
17001 | var ObjectPrototype = Object.prototype;
|
17002 | var push = [].push;
|
17003 |
|
17004 |
|
17005 |
|
17006 |
|
17007 |
|
17008 | var NEW_TARGET_BUG = fails(function () {
|
17009 | function F() { }
|
17010 | return !(nativeConstruct(function () { }, [], F) instanceof F);
|
17011 | });
|
17012 |
|
17013 | var ARGS_BUG = !fails(function () {
|
17014 | nativeConstruct(function () { });
|
17015 | });
|
17016 |
|
17017 | var FORCED = NEW_TARGET_BUG || ARGS_BUG;
|
17018 |
|
17019 | $({ target: 'Reflect', stat: true, forced: FORCED, sham: FORCED }, {
|
17020 | construct: function construct(Target, args /* , newTarget */) {
|
17021 | aConstructor(Target);
|
17022 | anObject(args);
|
17023 | var newTarget = arguments.length < 3 ? Target : aConstructor(arguments[2]);
|
17024 | if (ARGS_BUG && !NEW_TARGET_BUG) return nativeConstruct(Target, args, newTarget);
|
17025 | if (Target == newTarget) {
|
17026 |
|
17027 | switch (args.length) {
|
17028 | case 0: return new Target();
|
17029 | case 1: return new Target(args[0]);
|
17030 | case 2: return new Target(args[0], args[1]);
|
17031 | case 3: return new Target(args[0], args[1], args[2]);
|
17032 | case 4: return new Target(args[0], args[1], args[2], args[3]);
|
17033 | }
|
17034 |
|
17035 | var $args = [null];
|
17036 | apply(push, $args, args);
|
17037 | return new (apply(bind, Target, $args))();
|
17038 | }
|
17039 |
|
17040 | var proto = newTarget.prototype;
|
17041 | var instance = create(isObject(proto) ? proto : ObjectPrototype);
|
17042 | var result = apply(Target, instance, args);
|
17043 | return isObject(result) ? result : instance;
|
17044 | }
|
17045 | });
|
17046 |
|
17047 |
|
17048 | }),
|
17049 |
|
17050 | (function(module, exports, __webpack_require__) {
|
17051 |
|
17052 | var _Object$create = __webpack_require__(496);
|
17053 |
|
17054 | var _Object$defineProperty = __webpack_require__(151);
|
17055 |
|
17056 | var setPrototypeOf = __webpack_require__(506);
|
17057 |
|
17058 | function _inherits(subClass, superClass) {
|
17059 | if (typeof superClass !== "function" && superClass !== null) {
|
17060 | throw new TypeError("Super expression must either be null or a function");
|
17061 | }
|
17062 |
|
17063 | subClass.prototype = _Object$create(superClass && superClass.prototype, {
|
17064 | constructor: {
|
17065 | value: subClass,
|
17066 | writable: true,
|
17067 | configurable: true
|
17068 | }
|
17069 | });
|
17070 |
|
17071 | _Object$defineProperty(subClass, "prototype", {
|
17072 | writable: false
|
17073 | });
|
17074 |
|
17075 | if (superClass) setPrototypeOf(subClass, superClass);
|
17076 | }
|
17077 |
|
17078 | module.exports = _inherits, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
17079 |
|
17080 | }),
|
17081 |
|
17082 | (function(module, exports, __webpack_require__) {
|
17083 |
|
17084 | module.exports = __webpack_require__(497);
|
17085 |
|
17086 | }),
|
17087 |
|
17088 | (function(module, exports, __webpack_require__) {
|
17089 |
|
17090 | module.exports = __webpack_require__(498);
|
17091 |
|
17092 |
|
17093 | }),
|
17094 |
|
17095 | (function(module, exports, __webpack_require__) {
|
17096 |
|
17097 | var parent = __webpack_require__(499);
|
17098 |
|
17099 | module.exports = parent;
|
17100 |
|
17101 |
|
17102 | }),
|
17103 |
|
17104 | (function(module, exports, __webpack_require__) {
|
17105 |
|
17106 | var parent = __webpack_require__(500);
|
17107 |
|
17108 | module.exports = parent;
|
17109 |
|
17110 |
|
17111 | }),
|
17112 |
|
17113 | (function(module, exports, __webpack_require__) {
|
17114 |
|
17115 | var parent = __webpack_require__(501);
|
17116 |
|
17117 | module.exports = parent;
|
17118 |
|
17119 |
|
17120 | }),
|
17121 |
|
17122 | (function(module, exports, __webpack_require__) {
|
17123 |
|
17124 | __webpack_require__(502);
|
17125 | var path = __webpack_require__(5);
|
17126 |
|
17127 | var Object = path.Object;
|
17128 |
|
17129 | module.exports = function create(P, D) {
|
17130 | return Object.create(P, D);
|
17131 | };
|
17132 |
|
17133 |
|
17134 | }),
|
17135 |
|
17136 | (function(module, exports, __webpack_require__) {
|
17137 |
|
17138 |
|
17139 | var $ = __webpack_require__(0);
|
17140 | var DESCRIPTORS = __webpack_require__(14);
|
17141 | var create = __webpack_require__(49);
|
17142 |
|
17143 |
|
17144 |
|
17145 | $({ target: 'Object', stat: true, sham: !DESCRIPTORS }, {
|
17146 | create: create
|
17147 | });
|
17148 |
|
17149 |
|
17150 | }),
|
17151 |
|
17152 | (function(module, exports, __webpack_require__) {
|
17153 |
|
17154 | module.exports = __webpack_require__(504);
|
17155 |
|
17156 |
|
17157 | }),
|
17158 |
|
17159 | (function(module, exports, __webpack_require__) {
|
17160 |
|
17161 | var parent = __webpack_require__(505);
|
17162 |
|
17163 | module.exports = parent;
|
17164 |
|
17165 |
|
17166 | }),
|
17167 |
|
17168 | (function(module, exports, __webpack_require__) {
|
17169 |
|
17170 | var parent = __webpack_require__(242);
|
17171 |
|
17172 | module.exports = parent;
|
17173 |
|
17174 |
|
17175 | }),
|
17176 |
|
17177 | (function(module, exports, __webpack_require__) {
|
17178 |
|
17179 | var _Object$setPrototypeOf = __webpack_require__(257);
|
17180 |
|
17181 | var _bindInstanceProperty = __webpack_require__(258);
|
17182 |
|
17183 | function _setPrototypeOf(o, p) {
|
17184 | var _context;
|
17185 |
|
17186 | module.exports = _setPrototypeOf = _Object$setPrototypeOf ? _bindInstanceProperty(_context = _Object$setPrototypeOf).call(_context) : function _setPrototypeOf(o, p) {
|
17187 | o.__proto__ = p;
|
17188 | return o;
|
17189 | }, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
17190 | return _setPrototypeOf(o, p);
|
17191 | }
|
17192 |
|
17193 | module.exports = _setPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
17194 |
|
17195 | }),
|
17196 |
|
17197 | (function(module, exports, __webpack_require__) {
|
17198 |
|
17199 | module.exports = __webpack_require__(508);
|
17200 |
|
17201 |
|
17202 | }),
|
17203 |
|
17204 | (function(module, exports, __webpack_require__) {
|
17205 |
|
17206 | var parent = __webpack_require__(509);
|
17207 |
|
17208 | module.exports = parent;
|
17209 |
|
17210 |
|
17211 | }),
|
17212 |
|
17213 | (function(module, exports, __webpack_require__) {
|
17214 |
|
17215 | var parent = __webpack_require__(240);
|
17216 |
|
17217 | module.exports = parent;
|
17218 |
|
17219 |
|
17220 | }),
|
17221 |
|
17222 | (function(module, exports, __webpack_require__) {
|
17223 |
|
17224 | module.exports = __webpack_require__(511);
|
17225 |
|
17226 |
|
17227 | }),
|
17228 |
|
17229 | (function(module, exports, __webpack_require__) {
|
17230 |
|
17231 | var parent = __webpack_require__(512);
|
17232 |
|
17233 | module.exports = parent;
|
17234 |
|
17235 |
|
17236 | }),
|
17237 |
|
17238 | (function(module, exports, __webpack_require__) {
|
17239 |
|
17240 | var parent = __webpack_require__(513);
|
17241 |
|
17242 | module.exports = parent;
|
17243 |
|
17244 |
|
17245 | }),
|
17246 |
|
17247 | (function(module, exports, __webpack_require__) {
|
17248 |
|
17249 | var parent = __webpack_require__(514);
|
17250 |
|
17251 | module.exports = parent;
|
17252 |
|
17253 |
|
17254 | }),
|
17255 |
|
17256 | (function(module, exports, __webpack_require__) {
|
17257 |
|
17258 | var isPrototypeOf = __webpack_require__(19);
|
17259 | var method = __webpack_require__(515);
|
17260 |
|
17261 | var FunctionPrototype = Function.prototype;
|
17262 |
|
17263 | module.exports = function (it) {
|
17264 | var own = it.bind;
|
17265 | return it === FunctionPrototype || (isPrototypeOf(FunctionPrototype, it) && own === FunctionPrototype.bind) ? method : own;
|
17266 | };
|
17267 |
|
17268 |
|
17269 | }),
|
17270 |
|
17271 | (function(module, exports, __webpack_require__) {
|
17272 |
|
17273 | __webpack_require__(516);
|
17274 | var entryVirtual = __webpack_require__(40);
|
17275 |
|
17276 | module.exports = entryVirtual('Function').bind;
|
17277 |
|
17278 |
|
17279 | }),
|
17280 |
|
17281 | (function(module, exports, __webpack_require__) {
|
17282 |
|
17283 |
|
17284 | var $ = __webpack_require__(0);
|
17285 | var bind = __webpack_require__(256);
|
17286 |
|
17287 |
|
17288 |
|
17289 | $({ target: 'Function', proto: true, forced: Function.bind !== bind }, {
|
17290 | bind: bind
|
17291 | });
|
17292 |
|
17293 |
|
17294 | }),
|
17295 |
|
17296 | (function(module, exports, __webpack_require__) {
|
17297 |
|
17298 | var _typeof = __webpack_require__(73)["default"];
|
17299 |
|
17300 | var assertThisInitialized = __webpack_require__(518);
|
17301 |
|
17302 | function _possibleConstructorReturn(self, call) {
|
17303 | if (call && (_typeof(call) === "object" || typeof call === "function")) {
|
17304 | return call;
|
17305 | } else if (call !== void 0) {
|
17306 | throw new TypeError("Derived constructors may only return object or undefined");
|
17307 | }
|
17308 |
|
17309 | return assertThisInitialized(self);
|
17310 | }
|
17311 |
|
17312 | module.exports = _possibleConstructorReturn, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
17313 |
|
17314 | }),
|
17315 |
|
17316 | (function(module, exports) {
|
17317 |
|
17318 | function _assertThisInitialized(self) {
|
17319 | if (self === void 0) {
|
17320 | throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
17321 | }
|
17322 |
|
17323 | return self;
|
17324 | }
|
17325 |
|
17326 | module.exports = _assertThisInitialized, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
17327 |
|
17328 | }),
|
17329 |
|
17330 | (function(module, exports, __webpack_require__) {
|
17331 |
|
17332 | var _Object$setPrototypeOf = __webpack_require__(257);
|
17333 |
|
17334 | var _bindInstanceProperty = __webpack_require__(258);
|
17335 |
|
17336 | var _Object$getPrototypeOf = __webpack_require__(520);
|
17337 |
|
17338 | function _getPrototypeOf(o) {
|
17339 | var _context;
|
17340 |
|
17341 | module.exports = _getPrototypeOf = _Object$setPrototypeOf ? _bindInstanceProperty(_context = _Object$getPrototypeOf).call(_context) : function _getPrototypeOf(o) {
|
17342 | return o.__proto__ || _Object$getPrototypeOf(o);
|
17343 | }, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
17344 | return _getPrototypeOf(o);
|
17345 | }
|
17346 |
|
17347 | module.exports = _getPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
17348 |
|
17349 | }),
|
17350 |
|
17351 | (function(module, exports, __webpack_require__) {
|
17352 |
|
17353 | module.exports = __webpack_require__(521);
|
17354 |
|
17355 | }),
|
17356 |
|
17357 | (function(module, exports, __webpack_require__) {
|
17358 |
|
17359 | module.exports = __webpack_require__(522);
|
17360 |
|
17361 |
|
17362 | }),
|
17363 |
|
17364 | (function(module, exports, __webpack_require__) {
|
17365 |
|
17366 | var parent = __webpack_require__(523);
|
17367 |
|
17368 | module.exports = parent;
|
17369 |
|
17370 |
|
17371 | }),
|
17372 |
|
17373 | (function(module, exports, __webpack_require__) {
|
17374 |
|
17375 | var parent = __webpack_require__(234);
|
17376 |
|
17377 | module.exports = parent;
|
17378 |
|
17379 |
|
17380 | }),
|
17381 |
|
17382 | (function(module, exports) {
|
17383 |
|
17384 | function _classCallCheck(instance, Constructor) {
|
17385 | if (!(instance instanceof Constructor)) {
|
17386 | throw new TypeError("Cannot call a class as a function");
|
17387 | }
|
17388 | }
|
17389 |
|
17390 | module.exports = _classCallCheck, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
17391 |
|
17392 | }),
|
17393 |
|
17394 | (function(module, exports, __webpack_require__) {
|
17395 |
|
17396 | var _Object$defineProperty = __webpack_require__(151);
|
17397 |
|
17398 | function _defineProperties(target, props) {
|
17399 | for (var i = 0; i < props.length; i++) {
|
17400 | var descriptor = props[i];
|
17401 | descriptor.enumerable = descriptor.enumerable || false;
|
17402 | descriptor.configurable = true;
|
17403 | if ("value" in descriptor) descriptor.writable = true;
|
17404 |
|
17405 | _Object$defineProperty(target, descriptor.key, descriptor);
|
17406 | }
|
17407 | }
|
17408 |
|
17409 | function _createClass(Constructor, protoProps, staticProps) {
|
17410 | if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
17411 | if (staticProps) _defineProperties(Constructor, staticProps);
|
17412 |
|
17413 | _Object$defineProperty(Constructor, "prototype", {
|
17414 | writable: false
|
17415 | });
|
17416 |
|
17417 | return Constructor;
|
17418 | }
|
17419 |
|
17420 | module.exports = _createClass, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
17421 |
|
17422 | }),
|
17423 |
|
17424 | (function(module, exports, __webpack_require__) {
|
17425 |
|
17426 | "use strict";
|
17427 |
|
17428 |
|
17429 | var _interopRequireDefault = __webpack_require__(1);
|
17430 |
|
17431 | var _slice = _interopRequireDefault(__webpack_require__(61));
|
17432 |
|
17433 |
|
17434 | var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
|
17435 |
|
17436 | module.exports = function (string) {
|
17437 | var result = '';
|
17438 |
|
17439 | for (var i = 0; i < string.length;) {
|
17440 | var a = string.charCodeAt(i++);
|
17441 | var b = string.charCodeAt(i++);
|
17442 | var c = string.charCodeAt(i++);
|
17443 |
|
17444 | if (a > 255 || b > 255 || c > 255) {
|
17445 | throw new TypeError('Failed to encode base64: The string to be encoded contains characters outside of the Latin1 range.');
|
17446 | }
|
17447 |
|
17448 | var bitmap = a << 16 | b << 8 | c;
|
17449 | result += b64.charAt(bitmap >> 18 & 63) + b64.charAt(bitmap >> 12 & 63) + b64.charAt(bitmap >> 6 & 63) + b64.charAt(bitmap & 63);
|
17450 | }
|
17451 |
|
17452 |
|
17453 | var rest = string.length % 3;
|
17454 |
|
17455 | return rest ? (0, _slice.default)(result).call(result, 0, rest - 3) + '==='.substring(rest) : result;
|
17456 | };
|
17457 |
|
17458 | }),
|
17459 |
|
17460 | (function(module, exports, __webpack_require__) {
|
17461 |
|
17462 | "use strict";
|
17463 |
|
17464 |
|
17465 | var _ = __webpack_require__(3);
|
17466 |
|
17467 | var ajax = __webpack_require__(116);
|
17468 |
|
17469 | module.exports = function upload(uploadInfo, data, file) {
|
17470 | var saveOptions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
17471 | return ajax({
|
17472 | url: uploadInfo.upload_url,
|
17473 | method: 'PUT',
|
17474 | data: data,
|
17475 | headers: _.extend({
|
17476 | 'Content-Type': file.get('mime_type'),
|
17477 | 'Cache-Control': 'public, max-age=31536000'
|
17478 | }, file._uploadHeaders),
|
17479 | onprogress: saveOptions.onprogress
|
17480 | }).then(function () {
|
17481 | file.attributes.url = uploadInfo.url;
|
17482 | file._bucket = uploadInfo.bucket;
|
17483 | file.id = uploadInfo.objectId;
|
17484 | return file;
|
17485 | });
|
17486 | };
|
17487 |
|
17488 | }),
|
17489 |
|
17490 | (function(module, exports, __webpack_require__) {
|
17491 |
|
17492 | (function(){
|
17493 | var crypt = __webpack_require__(529),
|
17494 | utf8 = __webpack_require__(259).utf8,
|
17495 | isBuffer = __webpack_require__(530),
|
17496 | bin = __webpack_require__(259).bin,
|
17497 |
|
17498 |
|
17499 | md5 = function (message, options) {
|
17500 |
|
17501 | if (message.constructor == String)
|
17502 | if (options && options.encoding === 'binary')
|
17503 | message = bin.stringToBytes(message);
|
17504 | else
|
17505 | message = utf8.stringToBytes(message);
|
17506 | else if (isBuffer(message))
|
17507 | message = Array.prototype.slice.call(message, 0);
|
17508 | else if (!Array.isArray(message))
|
17509 | message = message.toString();
|
17510 |
|
17511 |
|
17512 | var m = crypt.bytesToWords(message),
|
17513 | l = message.length * 8,
|
17514 | a = 1732584193,
|
17515 | b = -271733879,
|
17516 | c = -1732584194,
|
17517 | d = 271733878;
|
17518 |
|
17519 |
|
17520 | for (var i = 0; i < m.length; i++) {
|
17521 | m[i] = ((m[i] << 8) | (m[i] >>> 24)) & 0x00FF00FF |
|
17522 | ((m[i] << 24) | (m[i] >>> 8)) & 0xFF00FF00;
|
17523 | }
|
17524 |
|
17525 |
|
17526 | m[l >>> 5] |= 0x80 << (l % 32);
|
17527 | m[(((l + 64) >>> 9) << 4) + 14] = l;
|
17528 |
|
17529 |
|
17530 | var FF = md5._ff,
|
17531 | GG = md5._gg,
|
17532 | HH = md5._hh,
|
17533 | II = md5._ii;
|
17534 |
|
17535 | for (var i = 0; i < m.length; i += 16) {
|
17536 |
|
17537 | var aa = a,
|
17538 | bb = b,
|
17539 | cc = c,
|
17540 | dd = d;
|
17541 |
|
17542 | a = FF(a, b, c, d, m[i+ 0], 7, -680876936);
|
17543 | d = FF(d, a, b, c, m[i+ 1], 12, -389564586);
|
17544 | c = FF(c, d, a, b, m[i+ 2], 17, 606105819);
|
17545 | b = FF(b, c, d, a, m[i+ 3], 22, -1044525330);
|
17546 | a = FF(a, b, c, d, m[i+ 4], 7, -176418897);
|
17547 | d = FF(d, a, b, c, m[i+ 5], 12, 1200080426);
|
17548 | c = FF(c, d, a, b, m[i+ 6], 17, -1473231341);
|
17549 | b = FF(b, c, d, a, m[i+ 7], 22, -45705983);
|
17550 | a = FF(a, b, c, d, m[i+ 8], 7, 1770035416);
|
17551 | d = FF(d, a, b, c, m[i+ 9], 12, -1958414417);
|
17552 | c = FF(c, d, a, b, m[i+10], 17, -42063);
|
17553 | b = FF(b, c, d, a, m[i+11], 22, -1990404162);
|
17554 | a = FF(a, b, c, d, m[i+12], 7, 1804603682);
|
17555 | d = FF(d, a, b, c, m[i+13], 12, -40341101);
|
17556 | c = FF(c, d, a, b, m[i+14], 17, -1502002290);
|
17557 | b = FF(b, c, d, a, m[i+15], 22, 1236535329);
|
17558 |
|
17559 | a = GG(a, b, c, d, m[i+ 1], 5, -165796510);
|
17560 | d = GG(d, a, b, c, m[i+ 6], 9, -1069501632);
|
17561 | c = GG(c, d, a, b, m[i+11], 14, 643717713);
|
17562 | b = GG(b, c, d, a, m[i+ 0], 20, -373897302);
|
17563 | a = GG(a, b, c, d, m[i+ 5], 5, -701558691);
|
17564 | d = GG(d, a, b, c, m[i+10], 9, 38016083);
|
17565 | c = GG(c, d, a, b, m[i+15], 14, -660478335);
|
17566 | b = GG(b, c, d, a, m[i+ 4], 20, -405537848);
|
17567 | a = GG(a, b, c, d, m[i+ 9], 5, 568446438);
|
17568 | d = GG(d, a, b, c, m[i+14], 9, -1019803690);
|
17569 | c = GG(c, d, a, b, m[i+ 3], 14, -187363961);
|
17570 | b = GG(b, c, d, a, m[i+ 8], 20, 1163531501);
|
17571 | a = GG(a, b, c, d, m[i+13], 5, -1444681467);
|
17572 | d = GG(d, a, b, c, m[i+ 2], 9, -51403784);
|
17573 | c = GG(c, d, a, b, m[i+ 7], 14, 1735328473);
|
17574 | b = GG(b, c, d, a, m[i+12], 20, -1926607734);
|
17575 |
|
17576 | a = HH(a, b, c, d, m[i+ 5], 4, -378558);
|
17577 | d = HH(d, a, b, c, m[i+ 8], 11, -2022574463);
|
17578 | c = HH(c, d, a, b, m[i+11], 16, 1839030562);
|
17579 | b = HH(b, c, d, a, m[i+14], 23, -35309556);
|
17580 | a = HH(a, b, c, d, m[i+ 1], 4, -1530992060);
|
17581 | d = HH(d, a, b, c, m[i+ 4], 11, 1272893353);
|
17582 | c = HH(c, d, a, b, m[i+ 7], 16, -155497632);
|
17583 | b = HH(b, c, d, a, m[i+10], 23, -1094730640);
|
17584 | a = HH(a, b, c, d, m[i+13], 4, 681279174);
|
17585 | d = HH(d, a, b, c, m[i+ 0], 11, -358537222);
|
17586 | c = HH(c, d, a, b, m[i+ 3], 16, -722521979);
|
17587 | b = HH(b, c, d, a, m[i+ 6], 23, 76029189);
|
17588 | a = HH(a, b, c, d, m[i+ 9], 4, -640364487);
|
17589 | d = HH(d, a, b, c, m[i+12], 11, -421815835);
|
17590 | c = HH(c, d, a, b, m[i+15], 16, 530742520);
|
17591 | b = HH(b, c, d, a, m[i+ 2], 23, -995338651);
|
17592 |
|
17593 | a = II(a, b, c, d, m[i+ 0], 6, -198630844);
|
17594 | d = II(d, a, b, c, m[i+ 7], 10, 1126891415);
|
17595 | c = II(c, d, a, b, m[i+14], 15, -1416354905);
|
17596 | b = II(b, c, d, a, m[i+ 5], 21, -57434055);
|
17597 | a = II(a, b, c, d, m[i+12], 6, 1700485571);
|
17598 | d = II(d, a, b, c, m[i+ 3], 10, -1894986606);
|
17599 | c = II(c, d, a, b, m[i+10], 15, -1051523);
|
17600 | b = II(b, c, d, a, m[i+ 1], 21, -2054922799);
|
17601 | a = II(a, b, c, d, m[i+ 8], 6, 1873313359);
|
17602 | d = II(d, a, b, c, m[i+15], 10, -30611744);
|
17603 | c = II(c, d, a, b, m[i+ 6], 15, -1560198380);
|
17604 | b = II(b, c, d, a, m[i+13], 21, 1309151649);
|
17605 | a = II(a, b, c, d, m[i+ 4], 6, -145523070);
|
17606 | d = II(d, a, b, c, m[i+11], 10, -1120210379);
|
17607 | c = II(c, d, a, b, m[i+ 2], 15, 718787259);
|
17608 | b = II(b, c, d, a, m[i+ 9], 21, -343485551);
|
17609 |
|
17610 | a = (a + aa) >>> 0;
|
17611 | b = (b + bb) >>> 0;
|
17612 | c = (c + cc) >>> 0;
|
17613 | d = (d + dd) >>> 0;
|
17614 | }
|
17615 |
|
17616 | return crypt.endian([a, b, c, d]);
|
17617 | };
|
17618 |
|
17619 |
|
17620 | md5._ff = function (a, b, c, d, x, s, t) {
|
17621 | var n = a + (b & c | ~b & d) + (x >>> 0) + t;
|
17622 | return ((n << s) | (n >>> (32 - s))) + b;
|
17623 | };
|
17624 | md5._gg = function (a, b, c, d, x, s, t) {
|
17625 | var n = a + (b & d | c & ~d) + (x >>> 0) + t;
|
17626 | return ((n << s) | (n >>> (32 - s))) + b;
|
17627 | };
|
17628 | md5._hh = function (a, b, c, d, x, s, t) {
|
17629 | var n = a + (b ^ c ^ d) + (x >>> 0) + t;
|
17630 | return ((n << s) | (n >>> (32 - s))) + b;
|
17631 | };
|
17632 | md5._ii = function (a, b, c, d, x, s, t) {
|
17633 | var n = a + (c ^ (b | ~d)) + (x >>> 0) + t;
|
17634 | return ((n << s) | (n >>> (32 - s))) + b;
|
17635 | };
|
17636 |
|
17637 |
|
17638 | md5._blocksize = 16;
|
17639 | md5._digestsize = 16;
|
17640 |
|
17641 | module.exports = function (message, options) {
|
17642 | if (message === undefined || message === null)
|
17643 | throw new Error('Illegal argument ' + message);
|
17644 |
|
17645 | var digestbytes = crypt.wordsToBytes(md5(message, options));
|
17646 | return options && options.asBytes ? digestbytes :
|
17647 | options && options.asString ? bin.bytesToString(digestbytes) :
|
17648 | crypt.bytesToHex(digestbytes);
|
17649 | };
|
17650 |
|
17651 | })();
|
17652 |
|
17653 |
|
17654 | }),
|
17655 |
|
17656 | (function(module, exports) {
|
17657 |
|
17658 | (function() {
|
17659 | var base64map
|
17660 | = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/',
|
17661 |
|
17662 | crypt = {
|
17663 |
|
17664 | rotl: function(n, b) {
|
17665 | return (n << b) | (n >>> (32 - b));
|
17666 | },
|
17667 |
|
17668 |
|
17669 | rotr: function(n, b) {
|
17670 | return (n << (32 - b)) | (n >>> b);
|
17671 | },
|
17672 |
|
17673 |
|
17674 | endian: function(n) {
|
17675 |
|
17676 | if (n.constructor == Number) {
|
17677 | return crypt.rotl(n, 8) & 0x00FF00FF | crypt.rotl(n, 24) & 0xFF00FF00;
|
17678 | }
|
17679 |
|
17680 |
|
17681 | for (var i = 0; i < n.length; i++)
|
17682 | n[i] = crypt.endian(n[i]);
|
17683 | return n;
|
17684 | },
|
17685 |
|
17686 |
|
17687 | randomBytes: function(n) {
|
17688 | for (var bytes = []; n > 0; n--)
|
17689 | bytes.push(Math.floor(Math.random() * 256));
|
17690 | return bytes;
|
17691 | },
|
17692 |
|
17693 |
|
17694 | bytesToWords: function(bytes) {
|
17695 | for (var words = [], i = 0, b = 0; i < bytes.length; i++, b += 8)
|
17696 | words[b >>> 5] |= bytes[i] << (24 - b % 32);
|
17697 | return words;
|
17698 | },
|
17699 |
|
17700 |
|
17701 | wordsToBytes: function(words) {
|
17702 | for (var bytes = [], b = 0; b < words.length * 32; b += 8)
|
17703 | bytes.push((words[b >>> 5] >>> (24 - b % 32)) & 0xFF);
|
17704 | return bytes;
|
17705 | },
|
17706 |
|
17707 |
|
17708 | bytesToHex: function(bytes) {
|
17709 | for (var hex = [], i = 0; i < bytes.length; i++) {
|
17710 | hex.push((bytes[i] >>> 4).toString(16));
|
17711 | hex.push((bytes[i] & 0xF).toString(16));
|
17712 | }
|
17713 | return hex.join('');
|
17714 | },
|
17715 |
|
17716 |
|
17717 | hexToBytes: function(hex) {
|
17718 | for (var bytes = [], c = 0; c < hex.length; c += 2)
|
17719 | bytes.push(parseInt(hex.substr(c, 2), 16));
|
17720 | return bytes;
|
17721 | },
|
17722 |
|
17723 |
|
17724 | bytesToBase64: function(bytes) {
|
17725 | for (var base64 = [], i = 0; i < bytes.length; i += 3) {
|
17726 | var triplet = (bytes[i] << 16) | (bytes[i + 1] << 8) | bytes[i + 2];
|
17727 | for (var j = 0; j < 4; j++)
|
17728 | if (i * 8 + j * 6 <= bytes.length * 8)
|
17729 | base64.push(base64map.charAt((triplet >>> 6 * (3 - j)) & 0x3F));
|
17730 | else
|
17731 | base64.push('=');
|
17732 | }
|
17733 | return base64.join('');
|
17734 | },
|
17735 |
|
17736 |
|
17737 | base64ToBytes: function(base64) {
|
17738 |
|
17739 | base64 = base64.replace(/[^A-Z0-9+\/]/ig, '');
|
17740 |
|
17741 | for (var bytes = [], i = 0, imod4 = 0; i < base64.length;
|
17742 | imod4 = ++i % 4) {
|
17743 | if (imod4 == 0) continue;
|
17744 | bytes.push(((base64map.indexOf(base64.charAt(i - 1))
|
17745 | & (Math.pow(2, -2 * imod4 + 8) - 1)) << (imod4 * 2))
|
17746 | | (base64map.indexOf(base64.charAt(i)) >>> (6 - imod4 * 2)));
|
17747 | }
|
17748 | return bytes;
|
17749 | }
|
17750 | };
|
17751 |
|
17752 | module.exports = crypt;
|
17753 | })();
|
17754 |
|
17755 |
|
17756 | }),
|
17757 |
|
17758 | (function(module, exports) {
|
17759 |
|
17760 |
|
17761 |
|
17762 |
|
17763 |
|
17764 |
|
17765 |
|
17766 |
|
17767 |
|
17768 |
|
17769 | module.exports = function (obj) {
|
17770 | return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer)
|
17771 | }
|
17772 |
|
17773 | function isBuffer (obj) {
|
17774 | return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)
|
17775 | }
|
17776 |
|
17777 |
|
17778 | function isSlowBuffer (obj) {
|
17779 | return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0))
|
17780 | }
|
17781 |
|
17782 |
|
17783 | }),
|
17784 |
|
17785 | (function(module, exports, __webpack_require__) {
|
17786 |
|
17787 | "use strict";
|
17788 |
|
17789 |
|
17790 | var _interopRequireDefault = __webpack_require__(1);
|
17791 |
|
17792 | var _indexOf = _interopRequireDefault(__webpack_require__(71));
|
17793 |
|
17794 | var dataURItoBlob = function dataURItoBlob(dataURI, type) {
|
17795 | var _context;
|
17796 |
|
17797 | var byteString;
|
17798 |
|
17799 | if ((0, _indexOf.default)(dataURI).call(dataURI, 'base64') < 0) {
|
17800 | byteString = atob(dataURI);
|
17801 | } else if ((0, _indexOf.default)(_context = dataURI.split(',')[0]).call(_context, 'base64') >= 0) {
|
17802 | type = type || dataURI.split(',')[0].split(':')[1].split(';')[0];
|
17803 | byteString = atob(dataURI.split(',')[1]);
|
17804 | } else {
|
17805 | byteString = unescape(dataURI.split(',')[1]);
|
17806 | }
|
17807 |
|
17808 | var ia = new Uint8Array(byteString.length);
|
17809 |
|
17810 | for (var i = 0; i < byteString.length; i++) {
|
17811 | ia[i] = byteString.charCodeAt(i);
|
17812 | }
|
17813 |
|
17814 | return new Blob([ia], {
|
17815 | type: type
|
17816 | });
|
17817 | };
|
17818 |
|
17819 | module.exports = dataURItoBlob;
|
17820 |
|
17821 | }),
|
17822 |
|
17823 | (function(module, exports, __webpack_require__) {
|
17824 |
|
17825 | "use strict";
|
17826 |
|
17827 |
|
17828 | var _interopRequireDefault = __webpack_require__(1);
|
17829 |
|
17830 | var _slicedToArray2 = _interopRequireDefault(__webpack_require__(533));
|
17831 |
|
17832 | var _map = _interopRequireDefault(__webpack_require__(35));
|
17833 |
|
17834 | var _indexOf = _interopRequireDefault(__webpack_require__(71));
|
17835 |
|
17836 | var _find = _interopRequireDefault(__webpack_require__(93));
|
17837 |
|
17838 | var _promise = _interopRequireDefault(__webpack_require__(12));
|
17839 |
|
17840 | var _concat = _interopRequireDefault(__webpack_require__(22));
|
17841 |
|
17842 | var _keys2 = _interopRequireDefault(__webpack_require__(59));
|
17843 |
|
17844 | var _stringify = _interopRequireDefault(__webpack_require__(36));
|
17845 |
|
17846 | var _defineProperty = _interopRequireDefault(__webpack_require__(92));
|
17847 |
|
17848 | var _getOwnPropertyDescriptor = _interopRequireDefault(__webpack_require__(152));
|
17849 |
|
17850 | var _ = __webpack_require__(3);
|
17851 |
|
17852 | var AVError = __webpack_require__(46);
|
17853 |
|
17854 | var _require = __webpack_require__(27),
|
17855 | _request = _require._request;
|
17856 |
|
17857 | var _require2 = __webpack_require__(30),
|
17858 | isNullOrUndefined = _require2.isNullOrUndefined,
|
17859 | ensureArray = _require2.ensureArray,
|
17860 | transformFetchOptions = _require2.transformFetchOptions,
|
17861 | setValue = _require2.setValue,
|
17862 | findValue = _require2.findValue,
|
17863 | isPlainObject = _require2.isPlainObject,
|
17864 | continueWhile = _require2.continueWhile;
|
17865 |
|
17866 | var recursiveToPointer = function recursiveToPointer(value) {
|
17867 | if (_.isArray(value)) return (0, _map.default)(value).call(value, recursiveToPointer);
|
17868 | if (isPlainObject(value)) return _.mapObject(value, recursiveToPointer);
|
17869 | if (_.isObject(value) && value._toPointer) return value._toPointer();
|
17870 | return value;
|
17871 | };
|
17872 |
|
17873 | var RESERVED_KEYS = ['objectId', 'createdAt', 'updatedAt'];
|
17874 |
|
17875 | var checkReservedKey = function checkReservedKey(key) {
|
17876 | if ((0, _indexOf.default)(RESERVED_KEYS).call(RESERVED_KEYS, key) !== -1) {
|
17877 | throw new Error("key[".concat(key, "] is reserved"));
|
17878 | }
|
17879 | };
|
17880 |
|
17881 | var handleBatchResults = function handleBatchResults(results) {
|
17882 | var firstError = (0, _find.default)(_).call(_, results, function (result) {
|
17883 | return result instanceof Error;
|
17884 | });
|
17885 |
|
17886 | if (!firstError) {
|
17887 | return results;
|
17888 | }
|
17889 |
|
17890 | var error = new AVError(firstError.code, firstError.message);
|
17891 | error.results = results;
|
17892 | throw error;
|
17893 | };
|
17894 |
|
17895 |
|
17896 |
|
17897 | function getValue(object, prop) {
|
17898 | if (!(object && object[prop])) {
|
17899 | return null;
|
17900 | }
|
17901 |
|
17902 | return _.isFunction(object[prop]) ? object[prop]() : object[prop];
|
17903 | }
|
17904 |
|
17905 |
|
17906 |
|
17907 | module.exports = function (AV) {
|
17908 | |
17909 |
|
17910 |
|
17911 |
|
17912 |
|
17913 |
|
17914 |
|
17915 |
|
17916 |
|
17917 |
|
17918 |
|
17919 |
|
17920 |
|
17921 |
|
17922 |
|
17923 |
|
17924 |
|
17925 |
|
17926 |
|
17927 |
|
17928 |
|
17929 |
|
17930 |
|
17931 |
|
17932 |
|
17933 |
|
17934 |
|
17935 | AV.Object = function (attributes, options) {
|
17936 |
|
17937 | if (_.isString(attributes)) {
|
17938 | return AV.Object._create.apply(this, arguments);
|
17939 | }
|
17940 |
|
17941 | attributes = attributes || {};
|
17942 |
|
17943 | if (options && options.parse) {
|
17944 | attributes = this.parse(attributes);
|
17945 | attributes = this._mergeMagicFields(attributes);
|
17946 | }
|
17947 |
|
17948 | var defaults = getValue(this, 'defaults');
|
17949 |
|
17950 | if (defaults) {
|
17951 | attributes = _.extend({}, defaults, attributes);
|
17952 | }
|
17953 |
|
17954 | if (options && options.collection) {
|
17955 | this.collection = options.collection;
|
17956 | }
|
17957 |
|
17958 | this._serverData = {};
|
17959 |
|
17960 | this._opSetQueue = [{}];
|
17961 |
|
17962 | this._flags = {};
|
17963 | this.attributes = {};
|
17964 |
|
17965 | this._hashedJSON = {};
|
17966 |
|
17967 | this._escapedAttributes = {};
|
17968 | this.cid = _.uniqueId('c');
|
17969 | this.changed = {};
|
17970 | this._silent = {};
|
17971 | this._pending = {};
|
17972 | this.set(attributes, {
|
17973 | silent: true
|
17974 | });
|
17975 | this.changed = {};
|
17976 | this._silent = {};
|
17977 | this._pending = {};
|
17978 | this._hasData = true;
|
17979 | this._previousAttributes = _.clone(this.attributes);
|
17980 | this.initialize.apply(this, arguments);
|
17981 | };
|
17982 | |
17983 |
|
17984 |
|
17985 |
|
17986 |
|
17987 | |
17988 |
|
17989 |
|
17990 |
|
17991 |
|
17992 |
|
17993 |
|
17994 |
|
17995 |
|
17996 |
|
17997 |
|
17998 |
|
17999 |
|
18000 |
|
18001 |
|
18002 | AV.Object.saveAll = function (list, options) {
|
18003 | return AV.Object._deepSaveAsync(list, null, options);
|
18004 | };
|
18005 | |
18006 |
|
18007 |
|
18008 |
|
18009 |
|
18010 |
|
18011 |
|
18012 |
|
18013 |
|
18014 | AV.Object.fetchAll = function (objects, options) {
|
18015 | return _promise.default.resolve().then(function () {
|
18016 | return _request('batch', null, null, 'POST', {
|
18017 | requests: (0, _map.default)(_).call(_, objects, function (object) {
|
18018 | var _context;
|
18019 |
|
18020 | if (!object.className) throw new Error('object must have className to fetch');
|
18021 | if (!object.id) throw new Error('object must have id to fetch');
|
18022 | if (object.dirty()) throw new Error('object is modified but not saved');
|
18023 | return {
|
18024 | method: 'GET',
|
18025 | path: (0, _concat.default)(_context = "/1.1/classes/".concat(object.className, "/")).call(_context, object.id)
|
18026 | };
|
18027 | })
|
18028 | }, options);
|
18029 | }).then(function (response) {
|
18030 | var results = (0, _map.default)(_).call(_, objects, function (object, i) {
|
18031 | if (response[i].success) {
|
18032 | var fetchedAttrs = object.parse(response[i].success);
|
18033 |
|
18034 | object._cleanupUnsetKeys(fetchedAttrs);
|
18035 |
|
18036 | object._finishFetch(fetchedAttrs);
|
18037 |
|
18038 | return object;
|
18039 | }
|
18040 |
|
18041 | if (response[i].success === null) {
|
18042 | return new AVError(AVError.OBJECT_NOT_FOUND, 'Object not found.');
|
18043 | }
|
18044 |
|
18045 | return new AVError(response[i].error.code, response[i].error.error);
|
18046 | });
|
18047 | return handleBatchResults(results);
|
18048 | });
|
18049 | };
|
18050 |
|
18051 |
|
18052 | _.extend(AV.Object.prototype, AV.Events,
|
18053 |
|
18054 | {
|
18055 | _fetchWhenSave: false,
|
18056 |
|
18057 | |
18058 |
|
18059 |
|
18060 |
|
18061 | initialize: function initialize() {},
|
18062 |
|
18063 | |
18064 |
|
18065 |
|
18066 |
|
18067 |
|
18068 |
|
18069 |
|
18070 |
|
18071 | fetchWhenSave: function fetchWhenSave(enable) {
|
18072 | console.warn('AV.Object#fetchWhenSave is deprecated, use AV.Object#save with options.fetchWhenSave instead.');
|
18073 |
|
18074 | if (!_.isBoolean(enable)) {
|
18075 | throw new Error('Expect boolean value for fetchWhenSave');
|
18076 | }
|
18077 |
|
18078 | this._fetchWhenSave = enable;
|
18079 | },
|
18080 |
|
18081 | |
18082 |
|
18083 |
|
18084 |
|
18085 | getObjectId: function getObjectId() {
|
18086 | return this.id;
|
18087 | },
|
18088 |
|
18089 | |
18090 |
|
18091 |
|
18092 |
|
18093 | getCreatedAt: function getCreatedAt() {
|
18094 | return this.createdAt;
|
18095 | },
|
18096 |
|
18097 | |
18098 |
|
18099 |
|
18100 |
|
18101 | getUpdatedAt: function getUpdatedAt() {
|
18102 | return this.updatedAt;
|
18103 | },
|
18104 |
|
18105 | |
18106 |
|
18107 |
|
18108 |
|
18109 | toJSON: function toJSON(key, holder) {
|
18110 | var seenObjects = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
18111 | return this._toFullJSON(seenObjects, false);
|
18112 | },
|
18113 |
|
18114 | |
18115 |
|
18116 |
|
18117 |
|
18118 |
|
18119 |
|
18120 | toFullJSON: function toFullJSON() {
|
18121 | var seenObjects = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
18122 | return this._toFullJSON(seenObjects);
|
18123 | },
|
18124 | _toFullJSON: function _toFullJSON(seenObjects) {
|
18125 | var _this = this;
|
18126 |
|
18127 | var full = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
18128 |
|
18129 | var json = _.clone(this.attributes);
|
18130 |
|
18131 | if (_.isArray(seenObjects)) {
|
18132 | var newSeenObjects = (0, _concat.default)(seenObjects).call(seenObjects, this);
|
18133 | }
|
18134 |
|
18135 | AV._objectEach(json, function (val, key) {
|
18136 | json[key] = AV._encode(val, newSeenObjects, undefined, full);
|
18137 | });
|
18138 |
|
18139 | AV._objectEach(this._operations, function (val, key) {
|
18140 | json[key] = val;
|
18141 | });
|
18142 |
|
18143 | if (_.has(this, 'id')) {
|
18144 | json.objectId = this.id;
|
18145 | }
|
18146 |
|
18147 | ['createdAt', 'updatedAt'].forEach(function (key) {
|
18148 | if (_.has(_this, key)) {
|
18149 | var val = _this[key];
|
18150 | json[key] = _.isDate(val) ? val.toJSON() : val;
|
18151 | }
|
18152 | });
|
18153 |
|
18154 | if (full) {
|
18155 | json.__type = 'Object';
|
18156 | if (_.isArray(seenObjects) && seenObjects.length) json.__type = 'Pointer';
|
18157 | json.className = this.className;
|
18158 | }
|
18159 |
|
18160 | return json;
|
18161 | },
|
18162 |
|
18163 | |
18164 |
|
18165 |
|
18166 |
|
18167 |
|
18168 | _refreshCache: function _refreshCache() {
|
18169 | var self = this;
|
18170 |
|
18171 | if (self._refreshingCache) {
|
18172 | return;
|
18173 | }
|
18174 |
|
18175 | self._refreshingCache = true;
|
18176 |
|
18177 | AV._objectEach(this.attributes, function (value, key) {
|
18178 | if (value instanceof AV.Object) {
|
18179 | value._refreshCache();
|
18180 | } else if (_.isObject(value)) {
|
18181 | if (self._resetCacheForKey(key)) {
|
18182 | self.set(key, new AV.Op.Set(value), {
|
18183 | silent: true
|
18184 | });
|
18185 | }
|
18186 | }
|
18187 | });
|
18188 |
|
18189 | delete self._refreshingCache;
|
18190 | },
|
18191 |
|
18192 | |
18193 |
|
18194 |
|
18195 |
|
18196 |
|
18197 |
|
18198 |
|
18199 | dirty: function dirty(attr) {
|
18200 | this._refreshCache();
|
18201 |
|
18202 | var currentChanges = _.last(this._opSetQueue);
|
18203 |
|
18204 | if (attr) {
|
18205 | return currentChanges[attr] ? true : false;
|
18206 | }
|
18207 |
|
18208 | if (!this.id) {
|
18209 | return true;
|
18210 | }
|
18211 |
|
18212 | if ((0, _keys2.default)(_).call(_, currentChanges).length > 0) {
|
18213 | return true;
|
18214 | }
|
18215 |
|
18216 | return false;
|
18217 | },
|
18218 |
|
18219 | |
18220 |
|
18221 |
|
18222 |
|
18223 | dirtyKeys: function dirtyKeys() {
|
18224 | this._refreshCache();
|
18225 |
|
18226 | var currentChanges = _.last(this._opSetQueue);
|
18227 |
|
18228 | return (0, _keys2.default)(_).call(_, currentChanges);
|
18229 | },
|
18230 |
|
18231 | |
18232 |
|
18233 |
|
18234 |
|
18235 | _toPointer: function _toPointer() {
|
18236 |
|
18237 |
|
18238 |
|
18239 | return {
|
18240 | __type: 'Pointer',
|
18241 | className: this.className,
|
18242 | objectId: this.id
|
18243 | };
|
18244 | },
|
18245 |
|
18246 | |
18247 |
|
18248 |
|
18249 |
|
18250 | get: function get(attr) {
|
18251 | switch (attr) {
|
18252 | case 'objectId':
|
18253 | return this.id;
|
18254 |
|
18255 | case 'createdAt':
|
18256 | case 'updatedAt':
|
18257 | return this[attr];
|
18258 |
|
18259 | default:
|
18260 | return this.attributes[attr];
|
18261 | }
|
18262 | },
|
18263 |
|
18264 | |
18265 |
|
18266 |
|
18267 |
|
18268 |
|
18269 | relation: function relation(attr) {
|
18270 | var value = this.get(attr);
|
18271 |
|
18272 | if (value) {
|
18273 | if (!(value instanceof AV.Relation)) {
|
18274 | throw new Error('Called relation() on non-relation field ' + attr);
|
18275 | }
|
18276 |
|
18277 | value._ensureParentAndKey(this, attr);
|
18278 |
|
18279 | return value;
|
18280 | } else {
|
18281 | return new AV.Relation(this, attr);
|
18282 | }
|
18283 | },
|
18284 |
|
18285 | |
18286 |
|
18287 |
|
18288 | escape: function escape(attr) {
|
18289 | var html = this._escapedAttributes[attr];
|
18290 |
|
18291 | if (html) {
|
18292 | return html;
|
18293 | }
|
18294 |
|
18295 | var val = this.attributes[attr];
|
18296 | var escaped;
|
18297 |
|
18298 | if (isNullOrUndefined(val)) {
|
18299 | escaped = '';
|
18300 | } else {
|
18301 | escaped = _.escape(val.toString());
|
18302 | }
|
18303 |
|
18304 | this._escapedAttributes[attr] = escaped;
|
18305 | return escaped;
|
18306 | },
|
18307 |
|
18308 | |
18309 |
|
18310 |
|
18311 |
|
18312 |
|
18313 |
|
18314 | has: function has(attr) {
|
18315 | return !isNullOrUndefined(this.attributes[attr]);
|
18316 | },
|
18317 |
|
18318 | |
18319 |
|
18320 |
|
18321 |
|
18322 |
|
18323 |
|
18324 | _mergeMagicFields: function _mergeMagicFields(attrs) {
|
18325 |
|
18326 | var model = this;
|
18327 | var specialFields = ['objectId', 'createdAt', 'updatedAt'];
|
18328 |
|
18329 | AV._arrayEach(specialFields, function (attr) {
|
18330 | if (attrs[attr]) {
|
18331 | if (attr === 'objectId') {
|
18332 | model.id = attrs[attr];
|
18333 | } else if ((attr === 'createdAt' || attr === 'updatedAt') && !_.isDate(attrs[attr])) {
|
18334 | model[attr] = AV._parseDate(attrs[attr]);
|
18335 | } else {
|
18336 | model[attr] = attrs[attr];
|
18337 | }
|
18338 |
|
18339 | delete attrs[attr];
|
18340 | }
|
18341 | });
|
18342 |
|
18343 | return attrs;
|
18344 | },
|
18345 |
|
18346 | |
18347 |
|
18348 |
|
18349 |
|
18350 | _startSave: function _startSave() {
|
18351 | this._opSetQueue.push({});
|
18352 | },
|
18353 |
|
18354 | |
18355 |
|
18356 |
|
18357 |
|
18358 |
|
18359 |
|
18360 |
|
18361 |
|
18362 |
|
18363 |
|
18364 |
|
18365 |
|
18366 |
|
18367 | _cancelSave: function _cancelSave() {
|
18368 | var failedChanges = _.first(this._opSetQueue);
|
18369 |
|
18370 | this._opSetQueue = _.rest(this._opSetQueue);
|
18371 |
|
18372 | var nextChanges = _.first(this._opSetQueue);
|
18373 |
|
18374 | AV._objectEach(failedChanges, function (op, key) {
|
18375 | var op1 = failedChanges[key];
|
18376 | var op2 = nextChanges[key];
|
18377 |
|
18378 | if (op1 && op2) {
|
18379 | nextChanges[key] = op2._mergeWithPrevious(op1);
|
18380 | } else if (op1) {
|
18381 | nextChanges[key] = op1;
|
18382 | }
|
18383 | });
|
18384 |
|
18385 | this._saving = this._saving - 1;
|
18386 | },
|
18387 |
|
18388 | |
18389 |
|
18390 |
|
18391 |
|
18392 |
|
18393 |
|
18394 | _finishSave: function _finishSave(serverData) {
|
18395 | var _context2;
|
18396 |
|
18397 |
|
18398 |
|
18399 |
|
18400 |
|
18401 | var fetchedObjects = {};
|
18402 |
|
18403 | AV._traverse(this.attributes, function (object) {
|
18404 | if (object instanceof AV.Object && object.id && object._hasData) {
|
18405 | fetchedObjects[object.id] = object;
|
18406 | }
|
18407 | });
|
18408 |
|
18409 | var savedChanges = _.first(this._opSetQueue);
|
18410 |
|
18411 | this._opSetQueue = _.rest(this._opSetQueue);
|
18412 |
|
18413 | this._applyOpSet(savedChanges, this._serverData);
|
18414 |
|
18415 | this._mergeMagicFields(serverData);
|
18416 |
|
18417 | var self = this;
|
18418 |
|
18419 | AV._objectEach(serverData, function (value, key) {
|
18420 | self._serverData[key] = AV._decode(value, key);
|
18421 |
|
18422 |
|
18423 | var fetched = AV._traverse(self._serverData[key], function (object) {
|
18424 | if (object instanceof AV.Object && fetchedObjects[object.id]) {
|
18425 | return fetchedObjects[object.id];
|
18426 | }
|
18427 | });
|
18428 |
|
18429 | if (fetched) {
|
18430 | self._serverData[key] = fetched;
|
18431 | }
|
18432 | });
|
18433 |
|
18434 | this._rebuildAllEstimatedData();
|
18435 |
|
18436 | var opSetQueue = (0, _map.default)(_context2 = this._opSetQueue).call(_context2, _.clone);
|
18437 |
|
18438 | this._refreshCache();
|
18439 |
|
18440 | this._opSetQueue = opSetQueue;
|
18441 | this._saving = this._saving - 1;
|
18442 | },
|
18443 |
|
18444 | |
18445 |
|
18446 |
|
18447 |
|
18448 |
|
18449 | _finishFetch: function _finishFetch(serverData, hasData) {
|
18450 |
|
18451 | this._opSetQueue = [{}];
|
18452 |
|
18453 | this._mergeMagicFields(serverData);
|
18454 |
|
18455 | var self = this;
|
18456 |
|
18457 | AV._objectEach(serverData, function (value, key) {
|
18458 | self._serverData[key] = AV._decode(value, key);
|
18459 | });
|
18460 |
|
18461 |
|
18462 | this._rebuildAllEstimatedData();
|
18463 |
|
18464 |
|
18465 | this._refreshCache();
|
18466 |
|
18467 | this._opSetQueue = [{}];
|
18468 | this._hasData = hasData;
|
18469 | },
|
18470 |
|
18471 | |
18472 |
|
18473 |
|
18474 |
|
18475 | _applyOpSet: function _applyOpSet(opSet, target) {
|
18476 | var self = this;
|
18477 |
|
18478 | AV._objectEach(opSet, function (change, key) {
|
18479 | var _findValue = findValue(target, key),
|
18480 | _findValue2 = (0, _slicedToArray2.default)(_findValue, 3),
|
18481 | value = _findValue2[0],
|
18482 | actualTarget = _findValue2[1],
|
18483 | actualKey = _findValue2[2];
|
18484 |
|
18485 | setValue(target, key, change._estimate(value, self, key));
|
18486 |
|
18487 | if (actualTarget && actualTarget[actualKey] === AV.Op._UNSET) {
|
18488 | delete actualTarget[actualKey];
|
18489 | }
|
18490 | });
|
18491 | },
|
18492 |
|
18493 | |
18494 |
|
18495 |
|
18496 |
|
18497 |
|
18498 | _resetCacheForKey: function _resetCacheForKey(key) {
|
18499 | var value = this.attributes[key];
|
18500 |
|
18501 | if (_.isObject(value) && !(value instanceof AV.Object) && !(value instanceof AV.File)) {
|
18502 | var json = (0, _stringify.default)(recursiveToPointer(value));
|
18503 |
|
18504 | if (this._hashedJSON[key] !== json) {
|
18505 | var wasSet = !!this._hashedJSON[key];
|
18506 | this._hashedJSON[key] = json;
|
18507 | return wasSet;
|
18508 | }
|
18509 | }
|
18510 |
|
18511 | return false;
|
18512 | },
|
18513 |
|
18514 | |
18515 |
|
18516 |
|
18517 |
|
18518 |
|
18519 |
|
18520 | _rebuildEstimatedDataForKey: function _rebuildEstimatedDataForKey(key) {
|
18521 | var self = this;
|
18522 | delete this.attributes[key];
|
18523 |
|
18524 | if (this._serverData[key]) {
|
18525 | this.attributes[key] = this._serverData[key];
|
18526 | }
|
18527 |
|
18528 | AV._arrayEach(this._opSetQueue, function (opSet) {
|
18529 | var op = opSet[key];
|
18530 |
|
18531 | if (op) {
|
18532 | var _findValue3 = findValue(self.attributes, key),
|
18533 | _findValue4 = (0, _slicedToArray2.default)(_findValue3, 4),
|
18534 | value = _findValue4[0],
|
18535 | actualTarget = _findValue4[1],
|
18536 | actualKey = _findValue4[2],
|
18537 | firstKey = _findValue4[3];
|
18538 |
|
18539 | setValue(self.attributes, key, op._estimate(value, self, key));
|
18540 |
|
18541 | if (actualTarget && actualTarget[actualKey] === AV.Op._UNSET) {
|
18542 | delete actualTarget[actualKey];
|
18543 | }
|
18544 |
|
18545 | self._resetCacheForKey(firstKey);
|
18546 | }
|
18547 | });
|
18548 | },
|
18549 |
|
18550 | |
18551 |
|
18552 |
|
18553 |
|
18554 |
|
18555 |
|
18556 | _rebuildAllEstimatedData: function _rebuildAllEstimatedData() {
|
18557 | var self = this;
|
18558 |
|
18559 | var previousAttributes = _.clone(this.attributes);
|
18560 |
|
18561 | this.attributes = _.clone(this._serverData);
|
18562 |
|
18563 | AV._arrayEach(this._opSetQueue, function (opSet) {
|
18564 | self._applyOpSet(opSet, self.attributes);
|
18565 |
|
18566 | AV._objectEach(opSet, function (op, key) {
|
18567 | self._resetCacheForKey(key);
|
18568 | });
|
18569 | });
|
18570 |
|
18571 |
|
18572 | AV._objectEach(previousAttributes, function (oldValue, key) {
|
18573 | if (self.attributes[key] !== oldValue) {
|
18574 | self.trigger('change:' + key, self, self.attributes[key], {});
|
18575 | }
|
18576 | });
|
18577 |
|
18578 | AV._objectEach(this.attributes, function (newValue, key) {
|
18579 | if (!_.has(previousAttributes, key)) {
|
18580 | self.trigger('change:' + key, self, newValue, {});
|
18581 | }
|
18582 | });
|
18583 | },
|
18584 |
|
18585 | |
18586 |
|
18587 |
|
18588 |
|
18589 |
|
18590 |
|
18591 |
|
18592 |
|
18593 |
|
18594 |
|
18595 |
|
18596 |
|
18597 |
|
18598 |
|
18599 |
|
18600 |
|
18601 |
|
18602 |
|
18603 |
|
18604 |
|
18605 |
|
18606 |
|
18607 |
|
18608 |
|
18609 | set: function set(key, value, options) {
|
18610 | var attrs;
|
18611 |
|
18612 | if (_.isObject(key) || isNullOrUndefined(key)) {
|
18613 | attrs = _.mapObject(key, function (v, k) {
|
18614 | checkReservedKey(k);
|
18615 | return AV._decode(v, k);
|
18616 | });
|
18617 | options = value;
|
18618 | } else {
|
18619 | attrs = {};
|
18620 | checkReservedKey(key);
|
18621 | attrs[key] = AV._decode(value, key);
|
18622 | }
|
18623 |
|
18624 |
|
18625 | options = options || {};
|
18626 |
|
18627 | if (!attrs) {
|
18628 | return this;
|
18629 | }
|
18630 |
|
18631 | if (attrs instanceof AV.Object) {
|
18632 | attrs = attrs.attributes;
|
18633 | }
|
18634 |
|
18635 |
|
18636 | if (options.unset) {
|
18637 | AV._objectEach(attrs, function (unused_value, key) {
|
18638 | attrs[key] = new AV.Op.Unset();
|
18639 | });
|
18640 | }
|
18641 |
|
18642 |
|
18643 | var dataToValidate = _.clone(attrs);
|
18644 |
|
18645 | var self = this;
|
18646 |
|
18647 | AV._objectEach(dataToValidate, function (value, key) {
|
18648 | if (value instanceof AV.Op) {
|
18649 | dataToValidate[key] = value._estimate(self.attributes[key], self, key);
|
18650 |
|
18651 | if (dataToValidate[key] === AV.Op._UNSET) {
|
18652 | delete dataToValidate[key];
|
18653 | }
|
18654 | }
|
18655 | });
|
18656 |
|
18657 |
|
18658 | this._validate(attrs, options);
|
18659 |
|
18660 | options.changes = {};
|
18661 | var escaped = this._escapedAttributes;
|
18662 |
|
18663 | AV._arrayEach((0, _keys2.default)(_).call(_, attrs), function (attr) {
|
18664 | var val = attrs[attr];
|
18665 |
|
18666 |
|
18667 |
|
18668 | if (val instanceof AV.Relation) {
|
18669 | val.parent = self;
|
18670 | }
|
18671 |
|
18672 | if (!(val instanceof AV.Op)) {
|
18673 | val = new AV.Op.Set(val);
|
18674 | }
|
18675 |
|
18676 |
|
18677 | var isRealChange = true;
|
18678 |
|
18679 | if (val instanceof AV.Op.Set && _.isEqual(self.attributes[attr], val.value)) {
|
18680 | isRealChange = false;
|
18681 | }
|
18682 |
|
18683 | if (isRealChange) {
|
18684 | delete escaped[attr];
|
18685 |
|
18686 | if (options.silent) {
|
18687 | self._silent[attr] = true;
|
18688 | } else {
|
18689 | options.changes[attr] = true;
|
18690 | }
|
18691 | }
|
18692 |
|
18693 | var currentChanges = _.last(self._opSetQueue);
|
18694 |
|
18695 | currentChanges[attr] = val._mergeWithPrevious(currentChanges[attr]);
|
18696 |
|
18697 | self._rebuildEstimatedDataForKey(attr);
|
18698 |
|
18699 | if (isRealChange) {
|
18700 | self.changed[attr] = self.attributes[attr];
|
18701 |
|
18702 | if (!options.silent) {
|
18703 | self._pending[attr] = true;
|
18704 | }
|
18705 | } else {
|
18706 | delete self.changed[attr];
|
18707 | delete self._pending[attr];
|
18708 | }
|
18709 | });
|
18710 |
|
18711 | if (!options.silent) {
|
18712 | this.change(options);
|
18713 | }
|
18714 |
|
18715 | return this;
|
18716 | },
|
18717 |
|
18718 | |
18719 |
|
18720 |
|
18721 |
|
18722 |
|
18723 |
|
18724 | unset: function unset(attr, options) {
|
18725 | options = options || {};
|
18726 | options.unset = true;
|
18727 | return this.set(attr, null, options);
|
18728 | },
|
18729 |
|
18730 | |
18731 |
|
18732 |
|
18733 |
|
18734 |
|
18735 |
|
18736 |
|
18737 | increment: function increment(attr, amount) {
|
18738 | if (_.isUndefined(amount) || _.isNull(amount)) {
|
18739 | amount = 1;
|
18740 | }
|
18741 |
|
18742 | return this.set(attr, new AV.Op.Increment(amount));
|
18743 | },
|
18744 |
|
18745 | |
18746 |
|
18747 |
|
18748 |
|
18749 |
|
18750 |
|
18751 | add: function add(attr, item) {
|
18752 | return this.set(attr, new AV.Op.Add(ensureArray(item)));
|
18753 | },
|
18754 |
|
18755 | |
18756 |
|
18757 |
|
18758 |
|
18759 |
|
18760 |
|
18761 |
|
18762 |
|
18763 | addUnique: function addUnique(attr, item) {
|
18764 | return this.set(attr, new AV.Op.AddUnique(ensureArray(item)));
|
18765 | },
|
18766 |
|
18767 | |
18768 |
|
18769 |
|
18770 |
|
18771 |
|
18772 |
|
18773 |
|
18774 | remove: function remove(attr, item) {
|
18775 | return this.set(attr, new AV.Op.Remove(ensureArray(item)));
|
18776 | },
|
18777 |
|
18778 | |
18779 |
|
18780 |
|
18781 |
|
18782 |
|
18783 |
|
18784 |
|
18785 | bitAnd: function bitAnd(attr, value) {
|
18786 | return this.set(attr, new AV.Op.BitAnd(value));
|
18787 | },
|
18788 |
|
18789 | |
18790 |
|
18791 |
|
18792 |
|
18793 |
|
18794 |
|
18795 |
|
18796 | bitOr: function bitOr(attr, value) {
|
18797 | return this.set(attr, new AV.Op.BitOr(value));
|
18798 | },
|
18799 |
|
18800 | |
18801 |
|
18802 |
|
18803 |
|
18804 |
|
18805 |
|
18806 |
|
18807 | bitXor: function bitXor(attr, value) {
|
18808 | return this.set(attr, new AV.Op.BitXor(value));
|
18809 | },
|
18810 |
|
18811 | |
18812 |
|
18813 |
|
18814 |
|
18815 |
|
18816 |
|
18817 |
|
18818 |
|
18819 |
|
18820 | op: function op(attr) {
|
18821 | return _.last(this._opSetQueue)[attr];
|
18822 | },
|
18823 |
|
18824 | |
18825 |
|
18826 |
|
18827 |
|
18828 | clear: function clear(options) {
|
18829 | options = options || {};
|
18830 | options.unset = true;
|
18831 |
|
18832 | var keysToClear = _.extend(this.attributes, this._operations);
|
18833 |
|
18834 | return this.set(keysToClear, options);
|
18835 | },
|
18836 |
|
18837 | |
18838 |
|
18839 |
|
18840 |
|
18841 | revert: function revert(keys) {
|
18842 | var lastOp = _.last(this._opSetQueue);
|
18843 |
|
18844 | var _keys = ensureArray(keys || (0, _keys2.default)(_).call(_, lastOp));
|
18845 |
|
18846 | _keys.forEach(function (key) {
|
18847 | delete lastOp[key];
|
18848 | });
|
18849 |
|
18850 | this._rebuildAllEstimatedData();
|
18851 |
|
18852 | return this;
|
18853 | },
|
18854 |
|
18855 | |
18856 |
|
18857 |
|
18858 |
|
18859 |
|
18860 | _getSaveJSON: function _getSaveJSON() {
|
18861 | var json = _.clone(_.first(this._opSetQueue));
|
18862 |
|
18863 | AV._objectEach(json, function (op, key) {
|
18864 | json[key] = op.toJSON();
|
18865 | });
|
18866 |
|
18867 | return json;
|
18868 | },
|
18869 |
|
18870 | |
18871 |
|
18872 |
|
18873 |
|
18874 | _canBeSerialized: function _canBeSerialized() {
|
18875 | return AV.Object._canBeSerializedAsValue(this.attributes);
|
18876 | },
|
18877 |
|
18878 | |
18879 |
|
18880 |
|
18881 |
|
18882 |
|
18883 |
|
18884 |
|
18885 |
|
18886 |
|
18887 |
|
18888 | fetch: function fetch() {
|
18889 | var fetchOptions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
18890 | var options = arguments.length > 1 ? arguments[1] : undefined;
|
18891 |
|
18892 | if (!this.id) {
|
18893 | throw new Error('Cannot fetch unsaved object');
|
18894 | }
|
18895 |
|
18896 | var self = this;
|
18897 |
|
18898 | var request = _request('classes', this.className, this.id, 'GET', transformFetchOptions(fetchOptions), options);
|
18899 |
|
18900 | return request.then(function (response) {
|
18901 | var fetchedAttrs = self.parse(response);
|
18902 |
|
18903 | self._cleanupUnsetKeys(fetchedAttrs, (0, _keys2.default)(fetchOptions) ? ensureArray((0, _keys2.default)(fetchOptions)).join(',').split(',') : undefined);
|
18904 |
|
18905 | self._finishFetch(fetchedAttrs, true);
|
18906 |
|
18907 | return self;
|
18908 | });
|
18909 | },
|
18910 | _cleanupUnsetKeys: function _cleanupUnsetKeys(fetchedAttrs) {
|
18911 | var _this2 = this;
|
18912 |
|
18913 | var fetchedKeys = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : (0, _keys2.default)(_).call(_, this._serverData);
|
18914 |
|
18915 | _.forEach(fetchedKeys, function (key) {
|
18916 | if (fetchedAttrs[key] === undefined) delete _this2._serverData[key];
|
18917 | });
|
18918 | },
|
18919 |
|
18920 | |
18921 |
|
18922 |
|
18923 |
|
18924 |
|
18925 |
|
18926 |
|
18927 |
|
18928 |
|
18929 |
|
18930 |
|
18931 |
|
18932 |
|
18933 |
|
18934 |
|
18935 |
|
18936 |
|
18937 |
|
18938 |
|
18939 |
|
18940 |
|
18941 |
|
18942 |
|
18943 |
|
18944 |
|
18945 |
|
18946 |
|
18947 |
|
18948 |
|
18949 | save: function save(arg1, arg2, arg3) {
|
18950 | var attrs, current, options;
|
18951 |
|
18952 | if (_.isObject(arg1) || isNullOrUndefined(arg1)) {
|
18953 | attrs = arg1;
|
18954 | options = arg2;
|
18955 | } else {
|
18956 | attrs = {};
|
18957 | attrs[arg1] = arg2;
|
18958 | options = arg3;
|
18959 | }
|
18960 |
|
18961 | options = _.clone(options) || {};
|
18962 |
|
18963 | if (options.wait) {
|
18964 | current = _.clone(this.attributes);
|
18965 | }
|
18966 |
|
18967 | var setOptions = _.clone(options) || {};
|
18968 |
|
18969 | if (setOptions.wait) {
|
18970 | setOptions.silent = true;
|
18971 | }
|
18972 |
|
18973 | if (attrs) {
|
18974 | this.set(attrs, setOptions);
|
18975 | }
|
18976 |
|
18977 | var model = this;
|
18978 | var unsavedChildren = [];
|
18979 | var unsavedFiles = [];
|
18980 |
|
18981 | AV.Object._findUnsavedChildren(model, unsavedChildren, unsavedFiles);
|
18982 |
|
18983 | if (unsavedChildren.length + unsavedFiles.length > 1) {
|
18984 | return AV.Object._deepSaveAsync(this, model, options);
|
18985 | }
|
18986 |
|
18987 | this._startSave();
|
18988 |
|
18989 | this._saving = (this._saving || 0) + 1;
|
18990 | this._allPreviousSaves = this._allPreviousSaves || _promise.default.resolve();
|
18991 | this._allPreviousSaves = this._allPreviousSaves.catch(function (e) {}).then(function () {
|
18992 | var method = model.id ? 'PUT' : 'POST';
|
18993 |
|
18994 | var json = model._getSaveJSON();
|
18995 |
|
18996 | var query = {};
|
18997 |
|
18998 | if (model._fetchWhenSave || options.fetchWhenSave) {
|
18999 | query['new'] = 'true';
|
19000 | }
|
19001 |
|
19002 |
|
19003 | if (options._failOnNotExist) {
|
19004 | query.failOnNotExist = 'true';
|
19005 | }
|
19006 |
|
19007 | if (options.query) {
|
19008 | var queryParams;
|
19009 |
|
19010 | if (typeof options.query._getParams === 'function') {
|
19011 | queryParams = options.query._getParams();
|
19012 |
|
19013 | if (queryParams) {
|
19014 | query.where = queryParams.where;
|
19015 | }
|
19016 | }
|
19017 |
|
19018 | if (!query.where) {
|
19019 | var error = new Error('options.query is not an AV.Query');
|
19020 | throw error;
|
19021 | }
|
19022 | }
|
19023 |
|
19024 | _.extend(json, model._flags);
|
19025 |
|
19026 | var route = 'classes';
|
19027 | var className = model.className;
|
19028 |
|
19029 | if (model.className === '_User' && !model.id) {
|
19030 |
|
19031 | route = 'users';
|
19032 | className = null;
|
19033 | }
|
19034 |
|
19035 |
|
19036 | var makeRequest = options._makeRequest || _request;
|
19037 | var requestPromise = makeRequest(route, className, model.id, method, json, options, query);
|
19038 | requestPromise = requestPromise.then(function (resp) {
|
19039 | var serverAttrs = model.parse(resp);
|
19040 |
|
19041 | if (options.wait) {
|
19042 | serverAttrs = _.extend(attrs || {}, serverAttrs);
|
19043 | }
|
19044 |
|
19045 | model._finishSave(serverAttrs);
|
19046 |
|
19047 | if (options.wait) {
|
19048 | model.set(current, setOptions);
|
19049 | }
|
19050 |
|
19051 | return model;
|
19052 | }, function (error) {
|
19053 | model._cancelSave();
|
19054 |
|
19055 | throw error;
|
19056 | });
|
19057 | return requestPromise;
|
19058 | });
|
19059 | return this._allPreviousSaves;
|
19060 | },
|
19061 |
|
19062 | |
19063 |
|
19064 |
|
19065 |
|
19066 |
|
19067 |
|
19068 |
|
19069 |
|
19070 |
|
19071 |
|
19072 | destroy: function destroy(options) {
|
19073 | options = options || {};
|
19074 | var model = this;
|
19075 |
|
19076 | var triggerDestroy = function triggerDestroy() {
|
19077 | model.trigger('destroy', model, model.collection, options);
|
19078 | };
|
19079 |
|
19080 | if (!this.id) {
|
19081 | return triggerDestroy();
|
19082 | }
|
19083 |
|
19084 | if (!options.wait) {
|
19085 | triggerDestroy();
|
19086 | }
|
19087 |
|
19088 | var request = _request('classes', this.className, this.id, 'DELETE', this._flags, options);
|
19089 |
|
19090 | return request.then(function () {
|
19091 | if (options.wait) {
|
19092 | triggerDestroy();
|
19093 | }
|
19094 |
|
19095 | return model;
|
19096 | });
|
19097 | },
|
19098 |
|
19099 | |
19100 |
|
19101 |
|
19102 |
|
19103 | parse: function parse(resp) {
|
19104 | var output = _.clone(resp);
|
19105 |
|
19106 | ['createdAt', 'updatedAt'].forEach(function (key) {
|
19107 | if (output[key]) {
|
19108 | output[key] = AV._parseDate(output[key]);
|
19109 | }
|
19110 | });
|
19111 |
|
19112 | if (output.createdAt && !output.updatedAt) {
|
19113 | output.updatedAt = output.createdAt;
|
19114 | }
|
19115 |
|
19116 | return output;
|
19117 | },
|
19118 |
|
19119 | |
19120 |
|
19121 |
|
19122 |
|
19123 | clone: function clone() {
|
19124 | return new this.constructor(this.attributes);
|
19125 | },
|
19126 |
|
19127 | |
19128 |
|
19129 |
|
19130 |
|
19131 | isNew: function isNew() {
|
19132 | return !this.id;
|
19133 | },
|
19134 |
|
19135 | |
19136 |
|
19137 |
|
19138 |
|
19139 |
|
19140 | change: function change(options) {
|
19141 | options = options || {};
|
19142 | var changing = this._changing;
|
19143 | this._changing = true;
|
19144 |
|
19145 | var self = this;
|
19146 |
|
19147 | AV._objectEach(this._silent, function (attr) {
|
19148 | self._pending[attr] = true;
|
19149 | });
|
19150 |
|
19151 |
|
19152 | var changes = _.extend({}, options.changes, this._silent);
|
19153 |
|
19154 | this._silent = {};
|
19155 |
|
19156 | AV._objectEach(changes, function (unused_value, attr) {
|
19157 | self.trigger('change:' + attr, self, self.get(attr), options);
|
19158 | });
|
19159 |
|
19160 | if (changing) {
|
19161 | return this;
|
19162 | }
|
19163 |
|
19164 |
|
19165 | var deleteChanged = function deleteChanged(value, attr) {
|
19166 | if (!self._pending[attr] && !self._silent[attr]) {
|
19167 | delete self.changed[attr];
|
19168 | }
|
19169 | };
|
19170 |
|
19171 |
|
19172 | while (!_.isEmpty(this._pending)) {
|
19173 | this._pending = {};
|
19174 | this.trigger('change', this, options);
|
19175 |
|
19176 | AV._objectEach(this.changed, deleteChanged);
|
19177 |
|
19178 | self._previousAttributes = _.clone(this.attributes);
|
19179 | }
|
19180 |
|
19181 | this._changing = false;
|
19182 | return this;
|
19183 | },
|
19184 |
|
19185 | |
19186 |
|
19187 |
|
19188 |
|
19189 |
|
19190 | previous: function previous(attr) {
|
19191 | if (!arguments.length || !this._previousAttributes) {
|
19192 | return null;
|
19193 | }
|
19194 |
|
19195 | return this._previousAttributes[attr];
|
19196 | },
|
19197 |
|
19198 | |
19199 |
|
19200 |
|
19201 |
|
19202 |
|
19203 | previousAttributes: function previousAttributes() {
|
19204 | return _.clone(this._previousAttributes);
|
19205 | },
|
19206 |
|
19207 | |
19208 |
|
19209 |
|
19210 |
|
19211 |
|
19212 | isValid: function isValid() {
|
19213 | try {
|
19214 | this.validate(this.attributes);
|
19215 | } catch (error) {
|
19216 | return false;
|
19217 | }
|
19218 |
|
19219 | return true;
|
19220 | },
|
19221 |
|
19222 | |
19223 |
|
19224 |
|
19225 |
|
19226 |
|
19227 |
|
19228 |
|
19229 |
|
19230 |
|
19231 |
|
19232 | validate: function validate(attrs) {
|
19233 | if (_.has(attrs, 'ACL') && !(attrs.ACL instanceof AV.ACL)) {
|
19234 | throw new AVError(AVError.OTHER_CAUSE, 'ACL must be a AV.ACL.');
|
19235 | }
|
19236 | },
|
19237 |
|
19238 | |
19239 |
|
19240 |
|
19241 |
|
19242 |
|
19243 |
|
19244 | _validate: function _validate(attrs, options) {
|
19245 | if (options.silent || !this.validate) {
|
19246 | return;
|
19247 | }
|
19248 |
|
19249 | attrs = _.extend({}, this.attributes, attrs);
|
19250 | this.validate(attrs);
|
19251 | },
|
19252 |
|
19253 | |
19254 |
|
19255 |
|
19256 |
|
19257 |
|
19258 | getACL: function getACL() {
|
19259 | return this.get('ACL');
|
19260 | },
|
19261 |
|
19262 | |
19263 |
|
19264 |
|
19265 |
|
19266 |
|
19267 |
|
19268 |
|
19269 |
|
19270 | setACL: function setACL(acl, options) {
|
19271 | return this.set('ACL', acl, options);
|
19272 | },
|
19273 | disableBeforeHook: function disableBeforeHook() {
|
19274 | this.ignoreHook('beforeSave');
|
19275 | this.ignoreHook('beforeUpdate');
|
19276 | this.ignoreHook('beforeDelete');
|
19277 | },
|
19278 | disableAfterHook: function disableAfterHook() {
|
19279 | this.ignoreHook('afterSave');
|
19280 | this.ignoreHook('afterUpdate');
|
19281 | this.ignoreHook('afterDelete');
|
19282 | },
|
19283 | ignoreHook: function ignoreHook(hookName) {
|
19284 | if (!_.contains(['beforeSave', 'afterSave', 'beforeUpdate', 'afterUpdate', 'beforeDelete', 'afterDelete'], hookName)) {
|
19285 | throw new Error('Unsupported hookName: ' + hookName);
|
19286 | }
|
19287 |
|
19288 | if (!AV.hookKey) {
|
19289 | throw new Error('ignoreHook required hookKey');
|
19290 | }
|
19291 |
|
19292 | if (!this._flags.__ignore_hooks) {
|
19293 | this._flags.__ignore_hooks = [];
|
19294 | }
|
19295 |
|
19296 | this._flags.__ignore_hooks.push(hookName);
|
19297 | }
|
19298 | });
|
19299 | |
19300 |
|
19301 |
|
19302 |
|
19303 |
|
19304 |
|
19305 |
|
19306 |
|
19307 |
|
19308 | AV.Object.createWithoutData = function (klass, id, hasData) {
|
19309 | var _klass;
|
19310 |
|
19311 | if (_.isString(klass)) {
|
19312 | _klass = AV.Object._getSubclass(klass);
|
19313 | } else if (klass.prototype && klass.prototype instanceof AV.Object) {
|
19314 | _klass = klass;
|
19315 | } else {
|
19316 | throw new Error('class must be a string or a subclass of AV.Object.');
|
19317 | }
|
19318 |
|
19319 | if (!id) {
|
19320 | throw new TypeError('The objectId must be provided');
|
19321 | }
|
19322 |
|
19323 | var object = new _klass();
|
19324 | object.id = id;
|
19325 | object._hasData = hasData;
|
19326 | return object;
|
19327 | };
|
19328 | |
19329 |
|
19330 |
|
19331 |
|
19332 |
|
19333 |
|
19334 |
|
19335 |
|
19336 |
|
19337 | AV.Object.destroyAll = function (objects) {
|
19338 | var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
19339 |
|
19340 | if (!objects || objects.length === 0) {
|
19341 | return _promise.default.resolve();
|
19342 | }
|
19343 |
|
19344 | var objectsByClassNameAndFlags = _.groupBy(objects, function (object) {
|
19345 | return (0, _stringify.default)({
|
19346 | className: object.className,
|
19347 | flags: object._flags
|
19348 | });
|
19349 | });
|
19350 |
|
19351 | var body = {
|
19352 | requests: (0, _map.default)(_).call(_, objectsByClassNameAndFlags, function (objects) {
|
19353 | var _context3;
|
19354 |
|
19355 | var ids = (0, _map.default)(_).call(_, objects, 'id').join(',');
|
19356 | return {
|
19357 | method: 'DELETE',
|
19358 | path: (0, _concat.default)(_context3 = "/1.1/classes/".concat(objects[0].className, "/")).call(_context3, ids),
|
19359 | body: objects[0]._flags
|
19360 | };
|
19361 | })
|
19362 | };
|
19363 | return _request('batch', null, null, 'POST', body, options).then(function (response) {
|
19364 | var firstError = (0, _find.default)(_).call(_, response, function (result) {
|
19365 | return !result.success;
|
19366 | });
|
19367 | if (firstError) throw new AVError(firstError.error.code, firstError.error.error);
|
19368 | return undefined;
|
19369 | });
|
19370 | };
|
19371 | |
19372 |
|
19373 |
|
19374 |
|
19375 |
|
19376 |
|
19377 |
|
19378 | AV.Object._getSubclass = function (className) {
|
19379 | if (!_.isString(className)) {
|
19380 | throw new Error('AV.Object._getSubclass requires a string argument.');
|
19381 | }
|
19382 |
|
19383 | var ObjectClass = AV.Object._classMap[className];
|
19384 |
|
19385 | if (!ObjectClass) {
|
19386 | ObjectClass = AV.Object.extend(className);
|
19387 | AV.Object._classMap[className] = ObjectClass;
|
19388 | }
|
19389 |
|
19390 | return ObjectClass;
|
19391 | };
|
19392 | |
19393 |
|
19394 |
|
19395 |
|
19396 |
|
19397 |
|
19398 | AV.Object._create = function (className, attributes, options) {
|
19399 | var ObjectClass = AV.Object._getSubclass(className);
|
19400 |
|
19401 | return new ObjectClass(attributes, options);
|
19402 | };
|
19403 |
|
19404 |
|
19405 |
|
19406 | AV.Object._classMap = {};
|
19407 | AV.Object._extend = AV._extend;
|
19408 | |
19409 |
|
19410 |
|
19411 |
|
19412 |
|
19413 |
|
19414 |
|
19415 |
|
19416 |
|
19417 |
|
19418 |
|
19419 |
|
19420 |
|
19421 |
|
19422 |
|
19423 | AV.Object['new'] = function (attributes, options) {
|
19424 | return new AV.Object(attributes, options);
|
19425 | };
|
19426 | |
19427 |
|
19428 |
|
19429 |
|
19430 |
|
19431 |
|
19432 |
|
19433 |
|
19434 |
|
19435 |
|
19436 |
|
19437 |
|
19438 |
|
19439 |
|
19440 |
|
19441 |
|
19442 |
|
19443 |
|
19444 |
|
19445 |
|
19446 |
|
19447 |
|
19448 |
|
19449 |
|
19450 | AV.Object.extend = function (className, protoProps, classProps) {
|
19451 |
|
19452 | if (!_.isString(className)) {
|
19453 | if (className && _.has(className, 'className')) {
|
19454 | return AV.Object.extend(className.className, className, protoProps);
|
19455 | } else {
|
19456 | throw new Error("AV.Object.extend's first argument should be the className.");
|
19457 | }
|
19458 | }
|
19459 |
|
19460 |
|
19461 | if (className === 'User') {
|
19462 | className = '_User';
|
19463 | }
|
19464 |
|
19465 | var NewClassObject = null;
|
19466 |
|
19467 | if (_.has(AV.Object._classMap, className)) {
|
19468 | var OldClassObject = AV.Object._classMap[className];
|
19469 |
|
19470 |
|
19471 |
|
19472 | if (protoProps || classProps) {
|
19473 | NewClassObject = OldClassObject._extend(protoProps, classProps);
|
19474 | } else {
|
19475 | return OldClassObject;
|
19476 | }
|
19477 | } else {
|
19478 | protoProps = protoProps || {};
|
19479 | protoProps._className = className;
|
19480 | NewClassObject = this._extend(protoProps, classProps);
|
19481 | }
|
19482 |
|
19483 |
|
19484 | NewClassObject.extend = function (arg0) {
|
19485 | var _context4;
|
19486 |
|
19487 | if (_.isString(arg0) || arg0 && _.has(arg0, 'className')) {
|
19488 | return AV.Object.extend.apply(NewClassObject, arguments);
|
19489 | }
|
19490 |
|
19491 | var newArguments = (0, _concat.default)(_context4 = [className]).call(_context4, _.toArray(arguments));
|
19492 | return AV.Object.extend.apply(NewClassObject, newArguments);
|
19493 | };
|
19494 |
|
19495 |
|
19496 | (0, _defineProperty.default)(NewClassObject, 'query', (0, _getOwnPropertyDescriptor.default)(AV.Object, 'query'));
|
19497 |
|
19498 | NewClassObject['new'] = function (attributes, options) {
|
19499 | return new NewClassObject(attributes, options);
|
19500 | };
|
19501 |
|
19502 | AV.Object._classMap[className] = NewClassObject;
|
19503 | return NewClassObject;
|
19504 | };
|
19505 |
|
19506 |
|
19507 | (0, _defineProperty.default)(AV.Object.prototype, 'className', {
|
19508 | get: function get() {
|
19509 | var className = this._className || this.constructor._LCClassName || this.constructor.name;
|
19510 |
|
19511 | if (className === 'User') {
|
19512 | return '_User';
|
19513 | }
|
19514 |
|
19515 | return className;
|
19516 | }
|
19517 | });
|
19518 | |
19519 |
|
19520 |
|
19521 |
|
19522 |
|
19523 |
|
19524 |
|
19525 |
|
19526 |
|
19527 |
|
19528 |
|
19529 | AV.Object.register = function (klass, name) {
|
19530 | if (!(klass.prototype instanceof AV.Object)) {
|
19531 | throw new Error('registered class is not a subclass of AV.Object');
|
19532 | }
|
19533 |
|
19534 | var className = name || klass.name;
|
19535 |
|
19536 | if (!className.length) {
|
19537 | throw new Error('registered class must be named');
|
19538 | }
|
19539 |
|
19540 | if (name) {
|
19541 | klass._LCClassName = name;
|
19542 | }
|
19543 |
|
19544 | AV.Object._classMap[className] = klass;
|
19545 | };
|
19546 | |
19547 |
|
19548 |
|
19549 |
|
19550 |
|
19551 |
|
19552 |
|
19553 |
|
19554 |
|
19555 |
|
19556 |
|
19557 |
|
19558 |
|
19559 | (0, _defineProperty.default)(AV.Object, 'query', {
|
19560 | get: function get() {
|
19561 | return new AV.Query(this.prototype.className);
|
19562 | }
|
19563 | });
|
19564 |
|
19565 | AV.Object._findUnsavedChildren = function (objects, children, files) {
|
19566 | AV._traverse(objects, function (object) {
|
19567 | if (object instanceof AV.Object) {
|
19568 | if (object.dirty()) {
|
19569 | children.push(object);
|
19570 | }
|
19571 |
|
19572 | return;
|
19573 | }
|
19574 |
|
19575 | if (object instanceof AV.File) {
|
19576 | if (!object.id) {
|
19577 | files.push(object);
|
19578 | }
|
19579 |
|
19580 | return;
|
19581 | }
|
19582 | });
|
19583 | };
|
19584 |
|
19585 | AV.Object._canBeSerializedAsValue = function (object) {
|
19586 | var canBeSerializedAsValue = true;
|
19587 |
|
19588 | if (object instanceof AV.Object || object instanceof AV.File) {
|
19589 | canBeSerializedAsValue = !!object.id;
|
19590 | } else if (_.isArray(object)) {
|
19591 | AV._arrayEach(object, function (child) {
|
19592 | if (!AV.Object._canBeSerializedAsValue(child)) {
|
19593 | canBeSerializedAsValue = false;
|
19594 | }
|
19595 | });
|
19596 | } else if (_.isObject(object)) {
|
19597 | AV._objectEach(object, function (child) {
|
19598 | if (!AV.Object._canBeSerializedAsValue(child)) {
|
19599 | canBeSerializedAsValue = false;
|
19600 | }
|
19601 | });
|
19602 | }
|
19603 |
|
19604 | return canBeSerializedAsValue;
|
19605 | };
|
19606 |
|
19607 | AV.Object._deepSaveAsync = function (object, model, options) {
|
19608 | var unsavedChildren = [];
|
19609 | var unsavedFiles = [];
|
19610 |
|
19611 | AV.Object._findUnsavedChildren(object, unsavedChildren, unsavedFiles);
|
19612 |
|
19613 | unsavedFiles = _.uniq(unsavedFiles);
|
19614 |
|
19615 | var promise = _promise.default.resolve();
|
19616 |
|
19617 | _.each(unsavedFiles, function (file) {
|
19618 | promise = promise.then(function () {
|
19619 | return file.save();
|
19620 | });
|
19621 | });
|
19622 |
|
19623 | var objects = _.uniq(unsavedChildren);
|
19624 |
|
19625 | var remaining = _.uniq(objects);
|
19626 |
|
19627 | return promise.then(function () {
|
19628 | return continueWhile(function () {
|
19629 | return remaining.length > 0;
|
19630 | }, function () {
|
19631 |
|
19632 | var batch = [];
|
19633 | var newRemaining = [];
|
19634 |
|
19635 | AV._arrayEach(remaining, function (object) {
|
19636 | if (object._canBeSerialized()) {
|
19637 | batch.push(object);
|
19638 | } else {
|
19639 | newRemaining.push(object);
|
19640 | }
|
19641 | });
|
19642 |
|
19643 | remaining = newRemaining;
|
19644 |
|
19645 | if (batch.length === 0) {
|
19646 | return _promise.default.reject(new AVError(AVError.OTHER_CAUSE, 'Tried to save a batch with a cycle.'));
|
19647 | }
|
19648 |
|
19649 |
|
19650 | var readyToStart = _promise.default.resolve((0, _map.default)(_).call(_, batch, function (object) {
|
19651 | return object._allPreviousSaves || _promise.default.resolve();
|
19652 | }));
|
19653 |
|
19654 |
|
19655 | var bathSavePromise = readyToStart.then(function () {
|
19656 | return _request('batch', null, null, 'POST', {
|
19657 | requests: (0, _map.default)(_).call(_, batch, function (object) {
|
19658 | var method = object.id ? 'PUT' : 'POST';
|
19659 |
|
19660 | var json = object._getSaveJSON();
|
19661 |
|
19662 | _.extend(json, object._flags);
|
19663 |
|
19664 | var route = 'classes';
|
19665 | var className = object.className;
|
19666 | var path = "/".concat(route, "/").concat(className);
|
19667 |
|
19668 | if (object.className === '_User' && !object.id) {
|
19669 |
|
19670 | path = '/users';
|
19671 | }
|
19672 |
|
19673 | var path = "/1.1".concat(path);
|
19674 |
|
19675 | if (object.id) {
|
19676 | path = path + '/' + object.id;
|
19677 | }
|
19678 |
|
19679 | object._startSave();
|
19680 |
|
19681 | return {
|
19682 | method: method,
|
19683 | path: path,
|
19684 | body: json,
|
19685 | params: options && options.fetchWhenSave ? {
|
19686 | fetchWhenSave: true
|
19687 | } : undefined
|
19688 | };
|
19689 | })
|
19690 | }, options).then(function (response) {
|
19691 | var results = (0, _map.default)(_).call(_, batch, function (object, i) {
|
19692 | if (response[i].success) {
|
19693 | object._finishSave(object.parse(response[i].success));
|
19694 |
|
19695 | return object;
|
19696 | }
|
19697 |
|
19698 | object._cancelSave();
|
19699 |
|
19700 | return new AVError(response[i].error.code, response[i].error.error);
|
19701 | });
|
19702 | return handleBatchResults(results);
|
19703 | });
|
19704 | });
|
19705 |
|
19706 | AV._arrayEach(batch, function (object) {
|
19707 | object._allPreviousSaves = bathSavePromise;
|
19708 | });
|
19709 |
|
19710 | return bathSavePromise;
|
19711 | });
|
19712 | }).then(function () {
|
19713 | return object;
|
19714 | });
|
19715 | };
|
19716 | };
|
19717 |
|
19718 | }),
|
19719 |
|
19720 | (function(module, exports, __webpack_require__) {
|
19721 |
|
19722 | var arrayWithHoles = __webpack_require__(534);
|
19723 |
|
19724 | var iterableToArrayLimit = __webpack_require__(542);
|
19725 |
|
19726 | var unsupportedIterableToArray = __webpack_require__(543);
|
19727 |
|
19728 | var nonIterableRest = __webpack_require__(553);
|
19729 |
|
19730 | function _slicedToArray(arr, i) {
|
19731 | return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();
|
19732 | }
|
19733 |
|
19734 | module.exports = _slicedToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
19735 |
|
19736 | }),
|
19737 |
|
19738 | (function(module, exports, __webpack_require__) {
|
19739 |
|
19740 | var _Array$isArray = __webpack_require__(535);
|
19741 |
|
19742 | function _arrayWithHoles(arr) {
|
19743 | if (_Array$isArray(arr)) return arr;
|
19744 | }
|
19745 |
|
19746 | module.exports = _arrayWithHoles, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
19747 |
|
19748 | }),
|
19749 |
|
19750 | (function(module, exports, __webpack_require__) {
|
19751 |
|
19752 | module.exports = __webpack_require__(536);
|
19753 |
|
19754 | }),
|
19755 |
|
19756 | (function(module, exports, __webpack_require__) {
|
19757 |
|
19758 | module.exports = __webpack_require__(537);
|
19759 |
|
19760 |
|
19761 | }),
|
19762 |
|
19763 | (function(module, exports, __webpack_require__) {
|
19764 |
|
19765 | var parent = __webpack_require__(538);
|
19766 |
|
19767 | module.exports = parent;
|
19768 |
|
19769 |
|
19770 | }),
|
19771 |
|
19772 | (function(module, exports, __webpack_require__) {
|
19773 |
|
19774 | var parent = __webpack_require__(539);
|
19775 |
|
19776 | module.exports = parent;
|
19777 |
|
19778 |
|
19779 | }),
|
19780 |
|
19781 | (function(module, exports, __webpack_require__) {
|
19782 |
|
19783 | var parent = __webpack_require__(540);
|
19784 |
|
19785 | module.exports = parent;
|
19786 |
|
19787 |
|
19788 | }),
|
19789 |
|
19790 | (function(module, exports, __webpack_require__) {
|
19791 |
|
19792 | __webpack_require__(541);
|
19793 | var path = __webpack_require__(5);
|
19794 |
|
19795 | module.exports = path.Array.isArray;
|
19796 |
|
19797 |
|
19798 | }),
|
19799 |
|
19800 | (function(module, exports, __webpack_require__) {
|
19801 |
|
19802 | var $ = __webpack_require__(0);
|
19803 | var isArray = __webpack_require__(90);
|
19804 |
|
19805 |
|
19806 |
|
19807 | $({ target: 'Array', stat: true }, {
|
19808 | isArray: isArray
|
19809 | });
|
19810 |
|
19811 |
|
19812 | }),
|
19813 |
|
19814 | (function(module, exports, __webpack_require__) {
|
19815 |
|
19816 | var _Symbol = __webpack_require__(243);
|
19817 |
|
19818 | var _getIteratorMethod = __webpack_require__(255);
|
19819 |
|
19820 | function _iterableToArrayLimit(arr, i) {
|
19821 | var _i = arr == null ? null : typeof _Symbol !== "undefined" && _getIteratorMethod(arr) || arr["@@iterator"];
|
19822 |
|
19823 | if (_i == null) return;
|
19824 | var _arr = [];
|
19825 | var _n = true;
|
19826 | var _d = false;
|
19827 |
|
19828 | var _s, _e;
|
19829 |
|
19830 | try {
|
19831 | for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
|
19832 | _arr.push(_s.value);
|
19833 |
|
19834 | if (i && _arr.length === i) break;
|
19835 | }
|
19836 | } catch (err) {
|
19837 | _d = true;
|
19838 | _e = err;
|
19839 | } finally {
|
19840 | try {
|
19841 | if (!_n && _i["return"] != null) _i["return"]();
|
19842 | } finally {
|
19843 | if (_d) throw _e;
|
19844 | }
|
19845 | }
|
19846 |
|
19847 | return _arr;
|
19848 | }
|
19849 |
|
19850 | module.exports = _iterableToArrayLimit, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
19851 |
|
19852 | }),
|
19853 |
|
19854 | (function(module, exports, __webpack_require__) {
|
19855 |
|
19856 | var _sliceInstanceProperty = __webpack_require__(544);
|
19857 |
|
19858 | var _Array$from = __webpack_require__(548);
|
19859 |
|
19860 | var arrayLikeToArray = __webpack_require__(552);
|
19861 |
|
19862 | function _unsupportedIterableToArray(o, minLen) {
|
19863 | var _context;
|
19864 |
|
19865 | if (!o) return;
|
19866 | if (typeof o === "string") return arrayLikeToArray(o, minLen);
|
19867 |
|
19868 | var n = _sliceInstanceProperty(_context = Object.prototype.toString.call(o)).call(_context, 8, -1);
|
19869 |
|
19870 | if (n === "Object" && o.constructor) n = o.constructor.name;
|
19871 | if (n === "Map" || n === "Set") return _Array$from(o);
|
19872 | if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);
|
19873 | }
|
19874 |
|
19875 | module.exports = _unsupportedIterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
19876 |
|
19877 | }),
|
19878 |
|
19879 | (function(module, exports, __webpack_require__) {
|
19880 |
|
19881 | module.exports = __webpack_require__(545);
|
19882 |
|
19883 | }),
|
19884 |
|
19885 | (function(module, exports, __webpack_require__) {
|
19886 |
|
19887 | module.exports = __webpack_require__(546);
|
19888 |
|
19889 |
|
19890 | }),
|
19891 |
|
19892 | (function(module, exports, __webpack_require__) {
|
19893 |
|
19894 | var parent = __webpack_require__(547);
|
19895 |
|
19896 | module.exports = parent;
|
19897 |
|
19898 |
|
19899 | }),
|
19900 |
|
19901 | (function(module, exports, __webpack_require__) {
|
19902 |
|
19903 | var parent = __webpack_require__(241);
|
19904 |
|
19905 | module.exports = parent;
|
19906 |
|
19907 |
|
19908 | }),
|
19909 |
|
19910 | (function(module, exports, __webpack_require__) {
|
19911 |
|
19912 | module.exports = __webpack_require__(549);
|
19913 |
|
19914 | }),
|
19915 |
|
19916 | (function(module, exports, __webpack_require__) {
|
19917 |
|
19918 | module.exports = __webpack_require__(550);
|
19919 |
|
19920 |
|
19921 | }),
|
19922 |
|
19923 | (function(module, exports, __webpack_require__) {
|
19924 |
|
19925 | var parent = __webpack_require__(551);
|
19926 |
|
19927 | module.exports = parent;
|
19928 |
|
19929 |
|
19930 | }),
|
19931 |
|
19932 | (function(module, exports, __webpack_require__) {
|
19933 |
|
19934 | var parent = __webpack_require__(254);
|
19935 |
|
19936 | module.exports = parent;
|
19937 |
|
19938 |
|
19939 | }),
|
19940 |
|
19941 | (function(module, exports) {
|
19942 |
|
19943 | function _arrayLikeToArray(arr, len) {
|
19944 | if (len == null || len > arr.length) len = arr.length;
|
19945 |
|
19946 | for (var i = 0, arr2 = new Array(len); i < len; i++) {
|
19947 | arr2[i] = arr[i];
|
19948 | }
|
19949 |
|
19950 | return arr2;
|
19951 | }
|
19952 |
|
19953 | module.exports = _arrayLikeToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
19954 |
|
19955 | }),
|
19956 |
|
19957 | (function(module, exports) {
|
19958 |
|
19959 | function _nonIterableRest() {
|
19960 | throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
19961 | }
|
19962 |
|
19963 | module.exports = _nonIterableRest, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
19964 |
|
19965 | }),
|
19966 |
|
19967 | (function(module, exports, __webpack_require__) {
|
19968 |
|
19969 | var parent = __webpack_require__(555);
|
19970 |
|
19971 | module.exports = parent;
|
19972 |
|
19973 |
|
19974 | }),
|
19975 |
|
19976 | (function(module, exports, __webpack_require__) {
|
19977 |
|
19978 | __webpack_require__(556);
|
19979 | var path = __webpack_require__(5);
|
19980 |
|
19981 | var Object = path.Object;
|
19982 |
|
19983 | var getOwnPropertyDescriptor = module.exports = function getOwnPropertyDescriptor(it, key) {
|
19984 | return Object.getOwnPropertyDescriptor(it, key);
|
19985 | };
|
19986 |
|
19987 | if (Object.getOwnPropertyDescriptor.sham) getOwnPropertyDescriptor.sham = true;
|
19988 |
|
19989 |
|
19990 | }),
|
19991 |
|
19992 | (function(module, exports, __webpack_require__) {
|
19993 |
|
19994 | var $ = __webpack_require__(0);
|
19995 | var fails = __webpack_require__(2);
|
19996 | var toIndexedObject = __webpack_require__(32);
|
19997 | var nativeGetOwnPropertyDescriptor = __webpack_require__(62).f;
|
19998 | var DESCRIPTORS = __webpack_require__(14);
|
19999 |
|
20000 | var FAILS_ON_PRIMITIVES = fails(function () { nativeGetOwnPropertyDescriptor(1); });
|
20001 | var FORCED = !DESCRIPTORS || FAILS_ON_PRIMITIVES;
|
20002 |
|
20003 |
|
20004 |
|
20005 | $({ target: 'Object', stat: true, forced: FORCED, sham: !DESCRIPTORS }, {
|
20006 | getOwnPropertyDescriptor: function getOwnPropertyDescriptor(it, key) {
|
20007 | return nativeGetOwnPropertyDescriptor(toIndexedObject(it), key);
|
20008 | }
|
20009 | });
|
20010 |
|
20011 |
|
20012 | }),
|
20013 |
|
20014 | (function(module, exports, __webpack_require__) {
|
20015 |
|
20016 | "use strict";
|
20017 |
|
20018 |
|
20019 | var _ = __webpack_require__(3);
|
20020 |
|
20021 | var AVError = __webpack_require__(46);
|
20022 |
|
20023 | module.exports = function (AV) {
|
20024 | AV.Role = AV.Object.extend('_Role',
|
20025 |
|
20026 | {
|
20027 |
|
20028 |
|
20029 | |
20030 |
|
20031 |
|
20032 |
|
20033 |
|
20034 |
|
20035 |
|
20036 |
|
20037 |
|
20038 |
|
20039 |
|
20040 |
|
20041 |
|
20042 |
|
20043 |
|
20044 | constructor: function constructor(name, acl) {
|
20045 | if (_.isString(name)) {
|
20046 | AV.Object.prototype.constructor.call(this, null, null);
|
20047 | this.setName(name);
|
20048 | } else {
|
20049 | AV.Object.prototype.constructor.call(this, name, acl);
|
20050 | }
|
20051 |
|
20052 | if (acl) {
|
20053 | if (!(acl instanceof AV.ACL)) {
|
20054 | throw new TypeError('acl must be an instance of AV.ACL');
|
20055 | } else {
|
20056 | this.setACL(acl);
|
20057 | }
|
20058 | }
|
20059 | },
|
20060 |
|
20061 | |
20062 |
|
20063 |
|
20064 |
|
20065 |
|
20066 | getName: function getName() {
|
20067 | return this.get('name');
|
20068 | },
|
20069 |
|
20070 | |
20071 |
|
20072 |
|
20073 |
|
20074 |
|
20075 |
|
20076 |
|
20077 |
|
20078 |
|
20079 |
|
20080 |
|
20081 |
|
20082 |
|
20083 |
|
20084 | setName: function setName(name, options) {
|
20085 | return this.set('name', name, options);
|
20086 | },
|
20087 |
|
20088 | |
20089 |
|
20090 |
|
20091 |
|
20092 |
|
20093 |
|
20094 |
|
20095 |
|
20096 |
|
20097 |
|
20098 |
|
20099 | getUsers: function getUsers() {
|
20100 | return this.relation('users');
|
20101 | },
|
20102 |
|
20103 | |
20104 |
|
20105 |
|
20106 |
|
20107 |
|
20108 |
|
20109 |
|
20110 |
|
20111 |
|
20112 |
|
20113 |
|
20114 | getRoles: function getRoles() {
|
20115 | return this.relation('roles');
|
20116 | },
|
20117 |
|
20118 | |
20119 |
|
20120 |
|
20121 | validate: function validate(attrs, options) {
|
20122 | if ('name' in attrs && attrs.name !== this.getName()) {
|
20123 | var newName = attrs.name;
|
20124 |
|
20125 | if (this.id && this.id !== attrs.objectId) {
|
20126 |
|
20127 |
|
20128 |
|
20129 | return new AVError(AVError.OTHER_CAUSE, "A role's name can only be set before it has been saved.");
|
20130 | }
|
20131 |
|
20132 | if (!_.isString(newName)) {
|
20133 | return new AVError(AVError.OTHER_CAUSE, "A role's name must be a String.");
|
20134 | }
|
20135 |
|
20136 | if (!/^[0-9a-zA-Z\-_ ]+$/.test(newName)) {
|
20137 | return new AVError(AVError.OTHER_CAUSE, "A role's name can only contain alphanumeric characters, _," + ' -, and spaces.');
|
20138 | }
|
20139 | }
|
20140 |
|
20141 | if (AV.Object.prototype.validate) {
|
20142 | return AV.Object.prototype.validate.call(this, attrs, options);
|
20143 | }
|
20144 |
|
20145 | return false;
|
20146 | }
|
20147 | });
|
20148 | };
|
20149 |
|
20150 | }),
|
20151 |
|
20152 | (function(module, exports, __webpack_require__) {
|
20153 |
|
20154 | "use strict";
|
20155 |
|
20156 |
|
20157 | var _interopRequireDefault = __webpack_require__(1);
|
20158 |
|
20159 | var _defineProperty2 = _interopRequireDefault(__webpack_require__(559));
|
20160 |
|
20161 | var _promise = _interopRequireDefault(__webpack_require__(12));
|
20162 |
|
20163 | var _map = _interopRequireDefault(__webpack_require__(35));
|
20164 |
|
20165 | var _find = _interopRequireDefault(__webpack_require__(93));
|
20166 |
|
20167 | var _stringify = _interopRequireDefault(__webpack_require__(36));
|
20168 |
|
20169 | var _ = __webpack_require__(3);
|
20170 |
|
20171 | var uuid = __webpack_require__(233);
|
20172 |
|
20173 | var AVError = __webpack_require__(46);
|
20174 |
|
20175 | var _require = __webpack_require__(27),
|
20176 | AVRequest = _require._request,
|
20177 | request = _require.request;
|
20178 |
|
20179 | var _require2 = __webpack_require__(72),
|
20180 | getAdapter = _require2.getAdapter;
|
20181 |
|
20182 | var PLATFORM_ANONYMOUS = 'anonymous';
|
20183 | var PLATFORM_QQAPP = 'lc_qqapp';
|
20184 |
|
20185 | var mergeUnionDataIntoAuthData = function mergeUnionDataIntoAuthData() {
|
20186 | var defaultUnionIdPlatform = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'weixin';
|
20187 | return function (authData, unionId) {
|
20188 | var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
|
20189 | _ref$unionIdPlatform = _ref.unionIdPlatform,
|
20190 | unionIdPlatform = _ref$unionIdPlatform === void 0 ? defaultUnionIdPlatform : _ref$unionIdPlatform,
|
20191 | _ref$asMainAccount = _ref.asMainAccount,
|
20192 | asMainAccount = _ref$asMainAccount === void 0 ? false : _ref$asMainAccount;
|
20193 |
|
20194 | if (typeof unionId !== 'string') throw new AVError(AVError.OTHER_CAUSE, 'unionId is not a string');
|
20195 | if (typeof unionIdPlatform !== 'string') throw new AVError(AVError.OTHER_CAUSE, 'unionIdPlatform is not a string');
|
20196 | return _.extend({}, authData, {
|
20197 | platform: unionIdPlatform,
|
20198 | unionid: unionId,
|
20199 | main_account: Boolean(asMainAccount)
|
20200 | });
|
20201 | };
|
20202 | };
|
20203 |
|
20204 | module.exports = function (AV) {
|
20205 | |
20206 |
|
20207 |
|
20208 |
|
20209 |
|
20210 |
|
20211 |
|
20212 |
|
20213 |
|
20214 | AV.User = AV.Object.extend('_User',
|
20215 |
|
20216 | {
|
20217 |
|
20218 | _isCurrentUser: false,
|
20219 |
|
20220 |
|
20221 | |
20222 |
|
20223 |
|
20224 |
|
20225 | _mergeMagicFields: function _mergeMagicFields(attrs) {
|
20226 | if (attrs.sessionToken) {
|
20227 | this._sessionToken = attrs.sessionToken;
|
20228 | delete attrs.sessionToken;
|
20229 | }
|
20230 |
|
20231 | return AV.User.__super__._mergeMagicFields.call(this, attrs);
|
20232 | },
|
20233 |
|
20234 | |
20235 |
|
20236 |
|
20237 |
|
20238 |
|
20239 | _cleanupAuthData: function _cleanupAuthData() {
|
20240 | if (!this.isCurrent()) {
|
20241 | return;
|
20242 | }
|
20243 |
|
20244 | var authData = this.get('authData');
|
20245 |
|
20246 | if (!authData) {
|
20247 | return;
|
20248 | }
|
20249 |
|
20250 | AV._objectEach(this.get('authData'), function (value, key) {
|
20251 | if (!authData[key]) {
|
20252 | delete authData[key];
|
20253 | }
|
20254 | });
|
20255 | },
|
20256 |
|
20257 | |
20258 |
|
20259 |
|
20260 |
|
20261 | _synchronizeAllAuthData: function _synchronizeAllAuthData() {
|
20262 | var authData = this.get('authData');
|
20263 |
|
20264 | if (!authData) {
|
20265 | return;
|
20266 | }
|
20267 |
|
20268 | var self = this;
|
20269 |
|
20270 | AV._objectEach(this.get('authData'), function (value, key) {
|
20271 | self._synchronizeAuthData(key);
|
20272 | });
|
20273 | },
|
20274 |
|
20275 | |
20276 |
|
20277 |
|
20278 |
|
20279 |
|
20280 | _synchronizeAuthData: function _synchronizeAuthData(provider) {
|
20281 | if (!this.isCurrent()) {
|
20282 | return;
|
20283 | }
|
20284 |
|
20285 | var authType;
|
20286 |
|
20287 | if (_.isString(provider)) {
|
20288 | authType = provider;
|
20289 | provider = AV.User._authProviders[authType];
|
20290 | } else {
|
20291 | authType = provider.getAuthType();
|
20292 | }
|
20293 |
|
20294 | var authData = this.get('authData');
|
20295 |
|
20296 | if (!authData || !provider) {
|
20297 | return;
|
20298 | }
|
20299 |
|
20300 | var success = provider.restoreAuthentication(authData[authType]);
|
20301 |
|
20302 | if (!success) {
|
20303 | this.dissociateAuthData(provider);
|
20304 | }
|
20305 | },
|
20306 | _handleSaveResult: function _handleSaveResult(makeCurrent) {
|
20307 |
|
20308 | if (makeCurrent && !AV._config.disableCurrentUser) {
|
20309 | this._isCurrentUser = true;
|
20310 | }
|
20311 |
|
20312 | this._cleanupAuthData();
|
20313 |
|
20314 | this._synchronizeAllAuthData();
|
20315 |
|
20316 |
|
20317 | delete this._serverData.password;
|
20318 |
|
20319 | this._rebuildEstimatedDataForKey('password');
|
20320 |
|
20321 | this._refreshCache();
|
20322 |
|
20323 | if ((makeCurrent || this.isCurrent()) && !AV._config.disableCurrentUser) {
|
20324 |
|
20325 |
|
20326 |
|
20327 | return _promise.default.resolve(AV.User._saveCurrentUser(this));
|
20328 | } else {
|
20329 | return _promise.default.resolve();
|
20330 | }
|
20331 | },
|
20332 |
|
20333 | |
20334 |
|
20335 |
|
20336 |
|
20337 |
|
20338 | _linkWith: function _linkWith(provider, data) {
|
20339 | var _this = this;
|
20340 |
|
20341 | var _ref2 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
|
20342 | _ref2$failOnNotExist = _ref2.failOnNotExist,
|
20343 | failOnNotExist = _ref2$failOnNotExist === void 0 ? false : _ref2$failOnNotExist,
|
20344 | useMasterKey = _ref2.useMasterKey,
|
20345 | sessionToken = _ref2.sessionToken,
|
20346 | user = _ref2.user;
|
20347 |
|
20348 | var authType;
|
20349 |
|
20350 | if (_.isString(provider)) {
|
20351 | authType = provider;
|
20352 | provider = AV.User._authProviders[provider];
|
20353 | } else {
|
20354 | authType = provider.getAuthType();
|
20355 | }
|
20356 |
|
20357 | if (data) {
|
20358 | return this.save({
|
20359 | authData: (0, _defineProperty2.default)({}, authType, data)
|
20360 | }, {
|
20361 | useMasterKey: useMasterKey,
|
20362 | sessionToken: sessionToken,
|
20363 | user: user,
|
20364 | fetchWhenSave: !!this.get('authData'),
|
20365 | _failOnNotExist: failOnNotExist
|
20366 | }).then(function (model) {
|
20367 | return model._handleSaveResult(true).then(function () {
|
20368 | return model;
|
20369 | });
|
20370 | });
|
20371 | } else {
|
20372 | return provider.authenticate().then(function (result) {
|
20373 | return _this._linkWith(provider, result);
|
20374 | });
|
20375 | }
|
20376 | },
|
20377 |
|
20378 | |
20379 |
|
20380 |
|
20381 |
|
20382 |
|
20383 |
|
20384 |
|
20385 |
|
20386 |
|
20387 |
|
20388 |
|
20389 |
|
20390 |
|
20391 |
|
20392 |
|
20393 |
|
20394 | associateWithAuthData: function associateWithAuthData(authData, platform) {
|
20395 | return this._linkWith(platform, authData);
|
20396 | },
|
20397 |
|
20398 | |
20399 |
|
20400 |
|
20401 |
|
20402 |
|
20403 |
|
20404 |
|
20405 |
|
20406 |
|
20407 |
|
20408 |
|
20409 |
|
20410 |
|
20411 |
|
20412 |
|
20413 |
|
20414 |
|
20415 |
|
20416 |
|
20417 |
|
20418 |
|
20419 |
|
20420 |
|
20421 | associateWithAuthDataAndUnionId: function associateWithAuthDataAndUnionId(authData, platform, unionId, unionOptions) {
|
20422 | return this._linkWith(platform, mergeUnionDataIntoAuthData()(authData, unionId, unionOptions));
|
20423 | },
|
20424 |
|
20425 | |
20426 |
|
20427 |
|
20428 |
|
20429 |
|
20430 |
|
20431 |
|
20432 |
|
20433 | associateWithMiniApp: function associateWithMiniApp(authInfo, option) {
|
20434 | var _this2 = this;
|
20435 |
|
20436 | if (authInfo === undefined) {
|
20437 | var getAuthInfo = getAdapter('getAuthInfo');
|
20438 | return getAuthInfo().then(function (authInfo) {
|
20439 | return _this2._linkWith(authInfo.provider, authInfo.authData, option);
|
20440 | });
|
20441 | }
|
20442 |
|
20443 | return this._linkWith(authInfo.provider, authInfo.authData, option);
|
20444 | },
|
20445 |
|
20446 | |
20447 |
|
20448 |
|
20449 |
|
20450 |
|
20451 |
|
20452 |
|
20453 |
|
20454 |
|
20455 |
|
20456 |
|
20457 |
|
20458 | associateWithQQApp: function associateWithQQApp() {
|
20459 | var _this3 = this;
|
20460 |
|
20461 | var _ref3 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
20462 | _ref3$preferUnionId = _ref3.preferUnionId,
|
20463 | preferUnionId = _ref3$preferUnionId === void 0 ? false : _ref3$preferUnionId,
|
20464 | _ref3$unionIdPlatform = _ref3.unionIdPlatform,
|
20465 | unionIdPlatform = _ref3$unionIdPlatform === void 0 ? 'qq' : _ref3$unionIdPlatform,
|
20466 | _ref3$asMainAccount = _ref3.asMainAccount,
|
20467 | asMainAccount = _ref3$asMainAccount === void 0 ? true : _ref3$asMainAccount;
|
20468 |
|
20469 | var getAuthInfo = getAdapter('getAuthInfo');
|
20470 | return getAuthInfo({
|
20471 | preferUnionId: preferUnionId,
|
20472 | asMainAccount: asMainAccount,
|
20473 | platform: unionIdPlatform
|
20474 | }).then(function (authInfo) {
|
20475 | authInfo.provider = PLATFORM_QQAPP;
|
20476 | return _this3.associateWithMiniApp(authInfo);
|
20477 | });
|
20478 | },
|
20479 |
|
20480 | |
20481 |
|
20482 |
|
20483 |
|
20484 |
|
20485 |
|
20486 |
|
20487 |
|
20488 |
|
20489 |
|
20490 |
|
20491 |
|
20492 | associateWithWeapp: function associateWithWeapp() {
|
20493 | var _this4 = this;
|
20494 |
|
20495 | var _ref4 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
20496 | _ref4$preferUnionId = _ref4.preferUnionId,
|
20497 | preferUnionId = _ref4$preferUnionId === void 0 ? false : _ref4$preferUnionId,
|
20498 | _ref4$unionIdPlatform = _ref4.unionIdPlatform,
|
20499 | unionIdPlatform = _ref4$unionIdPlatform === void 0 ? 'weixin' : _ref4$unionIdPlatform,
|
20500 | _ref4$asMainAccount = _ref4.asMainAccount,
|
20501 | asMainAccount = _ref4$asMainAccount === void 0 ? true : _ref4$asMainAccount;
|
20502 |
|
20503 | var getAuthInfo = getAdapter('getAuthInfo');
|
20504 | return getAuthInfo({
|
20505 | preferUnionId: preferUnionId,
|
20506 | asMainAccount: asMainAccount,
|
20507 | platform: unionIdPlatform
|
20508 | }).then(function (authInfo) {
|
20509 | return _this4.associateWithMiniApp(authInfo);
|
20510 | });
|
20511 | },
|
20512 |
|
20513 | |
20514 |
|
20515 |
|
20516 |
|
20517 | linkWithWeapp: function linkWithWeapp(options) {
|
20518 | console.warn('DEPRECATED: User#linkWithWeapp 已废弃,请使用 User#associateWithWeapp 代替');
|
20519 | return this.associateWithWeapp(options);
|
20520 | },
|
20521 |
|
20522 | |
20523 |
|
20524 |
|
20525 |
|
20526 |
|
20527 |
|
20528 |
|
20529 |
|
20530 |
|
20531 |
|
20532 |
|
20533 |
|
20534 | associateWithQQAppWithUnionId: function associateWithQQAppWithUnionId(unionId) {
|
20535 | var _this5 = this;
|
20536 |
|
20537 | var _ref5 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
20538 | _ref5$unionIdPlatform = _ref5.unionIdPlatform,
|
20539 | unionIdPlatform = _ref5$unionIdPlatform === void 0 ? 'qq' : _ref5$unionIdPlatform,
|
20540 | _ref5$asMainAccount = _ref5.asMainAccount,
|
20541 | asMainAccount = _ref5$asMainAccount === void 0 ? false : _ref5$asMainAccount;
|
20542 |
|
20543 | var getAuthInfo = getAdapter('getAuthInfo');
|
20544 | return getAuthInfo({
|
20545 | platform: unionIdPlatform
|
20546 | }).then(function (authInfo) {
|
20547 | authInfo = AV.User.mergeUnionId(authInfo, unionId, {
|
20548 | asMainAccount: asMainAccount
|
20549 | });
|
20550 | authInfo.provider = PLATFORM_QQAPP;
|
20551 | return _this5.associateWithMiniApp(authInfo);
|
20552 | });
|
20553 | },
|
20554 |
|
20555 | |
20556 |
|
20557 |
|
20558 |
|
20559 |
|
20560 |
|
20561 |
|
20562 |
|
20563 |
|
20564 |
|
20565 |
|
20566 |
|
20567 | associateWithWeappWithUnionId: function associateWithWeappWithUnionId(unionId) {
|
20568 | var _this6 = this;
|
20569 |
|
20570 | var _ref6 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
20571 | _ref6$unionIdPlatform = _ref6.unionIdPlatform,
|
20572 | unionIdPlatform = _ref6$unionIdPlatform === void 0 ? 'weixin' : _ref6$unionIdPlatform,
|
20573 | _ref6$asMainAccount = _ref6.asMainAccount,
|
20574 | asMainAccount = _ref6$asMainAccount === void 0 ? false : _ref6$asMainAccount;
|
20575 |
|
20576 | var getAuthInfo = getAdapter('getAuthInfo');
|
20577 | return getAuthInfo({
|
20578 | platform: unionIdPlatform
|
20579 | }).then(function (authInfo) {
|
20580 | authInfo = AV.User.mergeUnionId(authInfo, unionId, {
|
20581 | asMainAccount: asMainAccount
|
20582 | });
|
20583 | return _this6.associateWithMiniApp(authInfo);
|
20584 | });
|
20585 | },
|
20586 |
|
20587 | |
20588 |
|
20589 |
|
20590 |
|
20591 |
|
20592 |
|
20593 | dissociateAuthData: function dissociateAuthData(provider) {
|
20594 | this.unset("authData.".concat(provider));
|
20595 | return this.save().then(function (model) {
|
20596 | return model._handleSaveResult(true).then(function () {
|
20597 | return model;
|
20598 | });
|
20599 | });
|
20600 | },
|
20601 |
|
20602 | |
20603 |
|
20604 |
|
20605 |
|
20606 | _unlinkFrom: function _unlinkFrom(provider) {
|
20607 | console.warn('DEPRECATED: User#_unlinkFrom 已废弃,请使用 User#dissociateAuthData 代替');
|
20608 | return this.dissociateAuthData(provider);
|
20609 | },
|
20610 |
|
20611 | |
20612 |
|
20613 |
|
20614 |
|
20615 | _isLinked: function _isLinked(provider) {
|
20616 | var authType;
|
20617 |
|
20618 | if (_.isString(provider)) {
|
20619 | authType = provider;
|
20620 | } else {
|
20621 | authType = provider.getAuthType();
|
20622 | }
|
20623 |
|
20624 | var authData = this.get('authData') || {};
|
20625 | return !!authData[authType];
|
20626 | },
|
20627 |
|
20628 | |
20629 |
|
20630 |
|
20631 |
|
20632 |
|
20633 | isAnonymous: function isAnonymous() {
|
20634 | return this._isLinked(PLATFORM_ANONYMOUS);
|
20635 | },
|
20636 | logOut: function logOut() {
|
20637 | this._logOutWithAll();
|
20638 |
|
20639 | this._isCurrentUser = false;
|
20640 | },
|
20641 |
|
20642 | |
20643 |
|
20644 |
|
20645 |
|
20646 | _logOutWithAll: function _logOutWithAll() {
|
20647 | var authData = this.get('authData');
|
20648 |
|
20649 | if (!authData) {
|
20650 | return;
|
20651 | }
|
20652 |
|
20653 | var self = this;
|
20654 |
|
20655 | AV._objectEach(this.get('authData'), function (value, key) {
|
20656 | self._logOutWith(key);
|
20657 | });
|
20658 | },
|
20659 |
|
20660 | |
20661 |
|
20662 |
|
20663 |
|
20664 |
|
20665 | _logOutWith: function _logOutWith(provider) {
|
20666 | if (!this.isCurrent()) {
|
20667 | return;
|
20668 | }
|
20669 |
|
20670 | if (_.isString(provider)) {
|
20671 | provider = AV.User._authProviders[provider];
|
20672 | }
|
20673 |
|
20674 | if (provider && provider.deauthenticate) {
|
20675 | provider.deauthenticate();
|
20676 | }
|
20677 | },
|
20678 |
|
20679 | |
20680 |
|
20681 |
|
20682 |
|
20683 |
|
20684 |
|
20685 |
|
20686 |
|
20687 |
|
20688 |
|
20689 |
|
20690 |
|
20691 |
|
20692 |
|
20693 | signUp: function signUp(attrs, options) {
|
20694 | var error;
|
20695 | var username = attrs && attrs.username || this.get('username');
|
20696 |
|
20697 | if (!username || username === '') {
|
20698 | error = new AVError(AVError.OTHER_CAUSE, 'Cannot sign up user with an empty name.');
|
20699 | throw error;
|
20700 | }
|
20701 |
|
20702 | var password = attrs && attrs.password || this.get('password');
|
20703 |
|
20704 | if (!password || password === '') {
|
20705 | error = new AVError(AVError.OTHER_CAUSE, 'Cannot sign up user with an empty password.');
|
20706 | throw error;
|
20707 | }
|
20708 |
|
20709 | return this.save(attrs, options).then(function (model) {
|
20710 | if (model.isAnonymous()) {
|
20711 | model.unset("authData.".concat(PLATFORM_ANONYMOUS));
|
20712 | model._opSetQueue = [{}];
|
20713 | }
|
20714 |
|
20715 | return model._handleSaveResult(true).then(function () {
|
20716 | return model;
|
20717 | });
|
20718 | });
|
20719 | },
|
20720 |
|
20721 | |
20722 |
|
20723 |
|
20724 |
|
20725 |
|
20726 |
|
20727 |
|
20728 |
|
20729 |
|
20730 |
|
20731 |
|
20732 |
|
20733 |
|
20734 |
|
20735 |
|
20736 |
|
20737 | signUpOrlogInWithMobilePhone: function signUpOrlogInWithMobilePhone(attrs) {
|
20738 | var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
20739 | var error;
|
20740 | var mobilePhoneNumber = attrs && attrs.mobilePhoneNumber || this.get('mobilePhoneNumber');
|
20741 |
|
20742 | if (!mobilePhoneNumber || mobilePhoneNumber === '') {
|
20743 | error = new AVError(AVError.OTHER_CAUSE, 'Cannot sign up or login user by mobilePhoneNumber ' + 'with an empty mobilePhoneNumber.');
|
20744 | throw error;
|
20745 | }
|
20746 |
|
20747 | var smsCode = attrs && attrs.smsCode || this.get('smsCode');
|
20748 |
|
20749 | if (!smsCode || smsCode === '') {
|
20750 | error = new AVError(AVError.OTHER_CAUSE, 'Cannot sign up or login user by mobilePhoneNumber ' + 'with an empty smsCode.');
|
20751 | throw error;
|
20752 | }
|
20753 |
|
20754 | options._makeRequest = function (route, className, id, method, json) {
|
20755 | return AVRequest('usersByMobilePhone', null, null, 'POST', json);
|
20756 | };
|
20757 |
|
20758 | return this.save(attrs, options).then(function (model) {
|
20759 | delete model.attributes.smsCode;
|
20760 | delete model._serverData.smsCode;
|
20761 | return model._handleSaveResult(true).then(function () {
|
20762 | return model;
|
20763 | });
|
20764 | });
|
20765 | },
|
20766 |
|
20767 | |
20768 |
|
20769 |
|
20770 |
|
20771 | loginWithAuthData: function loginWithAuthData(authData, platform, options) {
|
20772 | return this._linkWith(platform, authData, options);
|
20773 | },
|
20774 |
|
20775 | |
20776 |
|
20777 |
|
20778 |
|
20779 | loginWithAuthDataAndUnionId: function loginWithAuthDataAndUnionId(authData, platform, unionId, unionLoginOptions) {
|
20780 | return this.loginWithAuthData(mergeUnionDataIntoAuthData()(authData, unionId, unionLoginOptions), platform, unionLoginOptions);
|
20781 | },
|
20782 |
|
20783 | |
20784 |
|
20785 |
|
20786 |
|
20787 |
|
20788 |
|
20789 |
|
20790 |
|
20791 |
|
20792 |
|
20793 |
|
20794 | loginWithWeapp: function loginWithWeapp() {
|
20795 | var _this7 = this;
|
20796 |
|
20797 | var _ref7 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
20798 | _ref7$preferUnionId = _ref7.preferUnionId,
|
20799 | preferUnionId = _ref7$preferUnionId === void 0 ? false : _ref7$preferUnionId,
|
20800 | _ref7$unionIdPlatform = _ref7.unionIdPlatform,
|
20801 | unionIdPlatform = _ref7$unionIdPlatform === void 0 ? 'weixin' : _ref7$unionIdPlatform,
|
20802 | _ref7$asMainAccount = _ref7.asMainAccount,
|
20803 | asMainAccount = _ref7$asMainAccount === void 0 ? true : _ref7$asMainAccount,
|
20804 | _ref7$failOnNotExist = _ref7.failOnNotExist,
|
20805 | failOnNotExist = _ref7$failOnNotExist === void 0 ? false : _ref7$failOnNotExist,
|
20806 | useMasterKey = _ref7.useMasterKey,
|
20807 | sessionToken = _ref7.sessionToken,
|
20808 | user = _ref7.user;
|
20809 |
|
20810 | var getAuthInfo = getAdapter('getAuthInfo');
|
20811 | return getAuthInfo({
|
20812 | preferUnionId: preferUnionId,
|
20813 | asMainAccount: asMainAccount,
|
20814 | platform: unionIdPlatform
|
20815 | }).then(function (authInfo) {
|
20816 | return _this7.loginWithMiniApp(authInfo, {
|
20817 | failOnNotExist: failOnNotExist,
|
20818 | useMasterKey: useMasterKey,
|
20819 | sessionToken: sessionToken,
|
20820 | user: user
|
20821 | });
|
20822 | });
|
20823 | },
|
20824 |
|
20825 | |
20826 |
|
20827 |
|
20828 |
|
20829 |
|
20830 | loginWithWeappWithUnionId: function loginWithWeappWithUnionId(unionId) {
|
20831 | var _this8 = this;
|
20832 |
|
20833 | var _ref8 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
20834 | _ref8$unionIdPlatform = _ref8.unionIdPlatform,
|
20835 | unionIdPlatform = _ref8$unionIdPlatform === void 0 ? 'weixin' : _ref8$unionIdPlatform,
|
20836 | _ref8$asMainAccount = _ref8.asMainAccount,
|
20837 | asMainAccount = _ref8$asMainAccount === void 0 ? false : _ref8$asMainAccount,
|
20838 | _ref8$failOnNotExist = _ref8.failOnNotExist,
|
20839 | failOnNotExist = _ref8$failOnNotExist === void 0 ? false : _ref8$failOnNotExist,
|
20840 | useMasterKey = _ref8.useMasterKey,
|
20841 | sessionToken = _ref8.sessionToken,
|
20842 | user = _ref8.user;
|
20843 |
|
20844 | var getAuthInfo = getAdapter('getAuthInfo');
|
20845 | return getAuthInfo({
|
20846 | platform: unionIdPlatform
|
20847 | }).then(function (authInfo) {
|
20848 | authInfo = AV.User.mergeUnionId(authInfo, unionId, {
|
20849 | asMainAccount: asMainAccount
|
20850 | });
|
20851 | return _this8.loginWithMiniApp(authInfo, {
|
20852 | failOnNotExist: failOnNotExist,
|
20853 | useMasterKey: useMasterKey,
|
20854 | sessionToken: sessionToken,
|
20855 | user: user
|
20856 | });
|
20857 | });
|
20858 | },
|
20859 |
|
20860 | |
20861 |
|
20862 |
|
20863 |
|
20864 |
|
20865 |
|
20866 |
|
20867 |
|
20868 |
|
20869 |
|
20870 | loginWithQQApp: function loginWithQQApp() {
|
20871 | var _this9 = this;
|
20872 |
|
20873 | var _ref9 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
20874 | _ref9$preferUnionId = _ref9.preferUnionId,
|
20875 | preferUnionId = _ref9$preferUnionId === void 0 ? false : _ref9$preferUnionId,
|
20876 | _ref9$unionIdPlatform = _ref9.unionIdPlatform,
|
20877 | unionIdPlatform = _ref9$unionIdPlatform === void 0 ? 'qq' : _ref9$unionIdPlatform,
|
20878 | _ref9$asMainAccount = _ref9.asMainAccount,
|
20879 | asMainAccount = _ref9$asMainAccount === void 0 ? true : _ref9$asMainAccount,
|
20880 | _ref9$failOnNotExist = _ref9.failOnNotExist,
|
20881 | failOnNotExist = _ref9$failOnNotExist === void 0 ? false : _ref9$failOnNotExist,
|
20882 | useMasterKey = _ref9.useMasterKey,
|
20883 | sessionToken = _ref9.sessionToken,
|
20884 | user = _ref9.user;
|
20885 |
|
20886 | var getAuthInfo = getAdapter('getAuthInfo');
|
20887 | return getAuthInfo({
|
20888 | preferUnionId: preferUnionId,
|
20889 | asMainAccount: asMainAccount,
|
20890 | platform: unionIdPlatform
|
20891 | }).then(function (authInfo) {
|
20892 | authInfo.provider = PLATFORM_QQAPP;
|
20893 | return _this9.loginWithMiniApp(authInfo, {
|
20894 | failOnNotExist: failOnNotExist,
|
20895 | useMasterKey: useMasterKey,
|
20896 | sessionToken: sessionToken,
|
20897 | user: user
|
20898 | });
|
20899 | });
|
20900 | },
|
20901 |
|
20902 | |
20903 |
|
20904 |
|
20905 |
|
20906 |
|
20907 | loginWithQQAppWithUnionId: function loginWithQQAppWithUnionId(unionId) {
|
20908 | var _this10 = this;
|
20909 |
|
20910 | var _ref10 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
20911 | _ref10$unionIdPlatfor = _ref10.unionIdPlatform,
|
20912 | unionIdPlatform = _ref10$unionIdPlatfor === void 0 ? 'qq' : _ref10$unionIdPlatfor,
|
20913 | _ref10$asMainAccount = _ref10.asMainAccount,
|
20914 | asMainAccount = _ref10$asMainAccount === void 0 ? false : _ref10$asMainAccount,
|
20915 | _ref10$failOnNotExist = _ref10.failOnNotExist,
|
20916 | failOnNotExist = _ref10$failOnNotExist === void 0 ? false : _ref10$failOnNotExist,
|
20917 | useMasterKey = _ref10.useMasterKey,
|
20918 | sessionToken = _ref10.sessionToken,
|
20919 | user = _ref10.user;
|
20920 |
|
20921 | var getAuthInfo = getAdapter('getAuthInfo');
|
20922 | return getAuthInfo({
|
20923 | platform: unionIdPlatform
|
20924 | }).then(function (authInfo) {
|
20925 | authInfo = AV.User.mergeUnionId(authInfo, unionId, {
|
20926 | asMainAccount: asMainAccount
|
20927 | });
|
20928 | authInfo.provider = PLATFORM_QQAPP;
|
20929 | return _this10.loginWithMiniApp(authInfo, {
|
20930 | failOnNotExist: failOnNotExist,
|
20931 | useMasterKey: useMasterKey,
|
20932 | sessionToken: sessionToken,
|
20933 | user: user
|
20934 | });
|
20935 | });
|
20936 | },
|
20937 |
|
20938 | |
20939 |
|
20940 |
|
20941 |
|
20942 | loginWithMiniApp: function loginWithMiniApp(authInfo, option) {
|
20943 | var _this11 = this;
|
20944 |
|
20945 | if (authInfo === undefined) {
|
20946 | var getAuthInfo = getAdapter('getAuthInfo');
|
20947 | return getAuthInfo().then(function (authInfo) {
|
20948 | return _this11.loginWithAuthData(authInfo.authData, authInfo.provider, option);
|
20949 | });
|
20950 | }
|
20951 |
|
20952 | return this.loginWithAuthData(authInfo.authData, authInfo.provider, option);
|
20953 | },
|
20954 |
|
20955 | |
20956 |
|
20957 |
|
20958 |
|
20959 |
|
20960 |
|
20961 |
|
20962 |
|
20963 |
|
20964 |
|
20965 |
|
20966 | logIn: function logIn() {
|
20967 | var model = this;
|
20968 | var request = AVRequest('login', null, null, 'POST', this.toJSON());
|
20969 | return request.then(function (resp) {
|
20970 | var serverAttrs = model.parse(resp);
|
20971 |
|
20972 | model._finishFetch(serverAttrs);
|
20973 |
|
20974 | return model._handleSaveResult(true).then(function () {
|
20975 | if (!serverAttrs.smsCode) delete model.attributes['smsCode'];
|
20976 | return model;
|
20977 | });
|
20978 | });
|
20979 | },
|
20980 |
|
20981 | |
20982 |
|
20983 |
|
20984 | save: function save(arg1, arg2, arg3) {
|
20985 | var attrs, options;
|
20986 |
|
20987 | if (_.isObject(arg1) || _.isNull(arg1) || _.isUndefined(arg1)) {
|
20988 | attrs = arg1;
|
20989 | options = arg2;
|
20990 | } else {
|
20991 | attrs = {};
|
20992 | attrs[arg1] = arg2;
|
20993 | options = arg3;
|
20994 | }
|
20995 |
|
20996 | options = options || {};
|
20997 | return AV.Object.prototype.save.call(this, attrs, options).then(function (model) {
|
20998 | return model._handleSaveResult(false).then(function () {
|
20999 | return model;
|
21000 | });
|
21001 | });
|
21002 | },
|
21003 |
|
21004 | |
21005 |
|
21006 |
|
21007 |
|
21008 |
|
21009 |
|
21010 |
|
21011 |
|
21012 |
|
21013 | follow: function follow(options, authOptions) {
|
21014 | if (!this.id) {
|
21015 | throw new Error('Please signin.');
|
21016 | }
|
21017 |
|
21018 | var user;
|
21019 | var attributes;
|
21020 |
|
21021 | if (options.user) {
|
21022 | user = options.user;
|
21023 | attributes = options.attributes;
|
21024 | } else {
|
21025 | user = options;
|
21026 | }
|
21027 |
|
21028 | var userObjectId = _.isString(user) ? user : user.id;
|
21029 |
|
21030 | if (!userObjectId) {
|
21031 | throw new Error('Invalid target user.');
|
21032 | }
|
21033 |
|
21034 | var route = 'users/' + this.id + '/friendship/' + userObjectId;
|
21035 | var request = AVRequest(route, null, null, 'POST', AV._encode(attributes), authOptions);
|
21036 | return request;
|
21037 | },
|
21038 |
|
21039 | |
21040 |
|
21041 |
|
21042 |
|
21043 |
|
21044 |
|
21045 |
|
21046 | unfollow: function unfollow(options, authOptions) {
|
21047 | if (!this.id) {
|
21048 | throw new Error('Please signin.');
|
21049 | }
|
21050 |
|
21051 | var user;
|
21052 |
|
21053 | if (options.user) {
|
21054 | user = options.user;
|
21055 | } else {
|
21056 | user = options;
|
21057 | }
|
21058 |
|
21059 | var userObjectId = _.isString(user) ? user : user.id;
|
21060 |
|
21061 | if (!userObjectId) {
|
21062 | throw new Error('Invalid target user.');
|
21063 | }
|
21064 |
|
21065 | var route = 'users/' + this.id + '/friendship/' + userObjectId;
|
21066 | var request = AVRequest(route, null, null, 'DELETE', null, authOptions);
|
21067 | return request;
|
21068 | },
|
21069 |
|
21070 | |
21071 |
|
21072 |
|
21073 |
|
21074 |
|
21075 |
|
21076 |
|
21077 |
|
21078 | getFollowersAndFollowees: function getFollowersAndFollowees(options, authOptions) {
|
21079 | if (!this.id) {
|
21080 | throw new Error('Please signin.');
|
21081 | }
|
21082 |
|
21083 | return request({
|
21084 | method: 'GET',
|
21085 | path: "/users/".concat(this.id, "/followersAndFollowees"),
|
21086 | query: {
|
21087 | skip: options && options.skip,
|
21088 | limit: options && options.limit,
|
21089 | include: 'follower,followee',
|
21090 | keys: 'follower,followee'
|
21091 | },
|
21092 | authOptions: authOptions
|
21093 | }).then(function (_ref11) {
|
21094 | var followers = _ref11.followers,
|
21095 | followees = _ref11.followees;
|
21096 | return {
|
21097 | followers: (0, _map.default)(followers).call(followers, function (_ref12) {
|
21098 | var follower = _ref12.follower;
|
21099 | return AV._decode(follower);
|
21100 | }),
|
21101 | followees: (0, _map.default)(followees).call(followees, function (_ref13) {
|
21102 | var followee = _ref13.followee;
|
21103 | return AV._decode(followee);
|
21104 | })
|
21105 | };
|
21106 | });
|
21107 | },
|
21108 |
|
21109 | |
21110 |
|
21111 |
|
21112 |
|
21113 |
|
21114 | followerQuery: function followerQuery() {
|
21115 | return AV.User.followerQuery(this.id);
|
21116 | },
|
21117 |
|
21118 | |
21119 |
|
21120 |
|
21121 |
|
21122 |
|
21123 | followeeQuery: function followeeQuery() {
|
21124 | return AV.User.followeeQuery(this.id);
|
21125 | },
|
21126 |
|
21127 | |
21128 |
|
21129 |
|
21130 | fetch: function fetch(fetchOptions, options) {
|
21131 | return AV.Object.prototype.fetch.call(this, fetchOptions, options).then(function (model) {
|
21132 | return model._handleSaveResult(false).then(function () {
|
21133 | return model;
|
21134 | });
|
21135 | });
|
21136 | },
|
21137 |
|
21138 | |
21139 |
|
21140 |
|
21141 |
|
21142 |
|
21143 |
|
21144 | updatePassword: function updatePassword(oldPassword, newPassword, options) {
|
21145 | var _this12 = this;
|
21146 |
|
21147 | var route = 'users/' + this.id + '/updatePassword';
|
21148 | var params = {
|
21149 | old_password: oldPassword,
|
21150 | new_password: newPassword
|
21151 | };
|
21152 | var request = AVRequest(route, null, null, 'PUT', params, options);
|
21153 | return request.then(function (resp) {
|
21154 | _this12._finishFetch(_this12.parse(resp));
|
21155 |
|
21156 | return _this12._handleSaveResult(true).then(function () {
|
21157 | return resp;
|
21158 | });
|
21159 | });
|
21160 | },
|
21161 |
|
21162 | |
21163 |
|
21164 |
|
21165 |
|
21166 | isCurrent: function isCurrent() {
|
21167 | return this._isCurrentUser;
|
21168 | },
|
21169 |
|
21170 | |
21171 |
|
21172 |
|
21173 |
|
21174 |
|
21175 | getUsername: function getUsername() {
|
21176 | return this.get('username');
|
21177 | },
|
21178 |
|
21179 | |
21180 |
|
21181 |
|
21182 |
|
21183 |
|
21184 | getMobilePhoneNumber: function getMobilePhoneNumber() {
|
21185 | return this.get('mobilePhoneNumber');
|
21186 | },
|
21187 |
|
21188 | |
21189 |
|
21190 |
|
21191 |
|
21192 |
|
21193 |
|
21194 | setMobilePhoneNumber: function setMobilePhoneNumber(phone, options) {
|
21195 | return this.set('mobilePhoneNumber', phone, options);
|
21196 | },
|
21197 |
|
21198 | |
21199 |
|
21200 |
|
21201 |
|
21202 |
|
21203 |
|
21204 | setUsername: function setUsername(username, options) {
|
21205 | return this.set('username', username, options);
|
21206 | },
|
21207 |
|
21208 | |
21209 |
|
21210 |
|
21211 |
|
21212 |
|
21213 |
|
21214 | setPassword: function setPassword(password, options) {
|
21215 | return this.set('password', password, options);
|
21216 | },
|
21217 |
|
21218 | |
21219 |
|
21220 |
|
21221 |
|
21222 |
|
21223 | getEmail: function getEmail() {
|
21224 | return this.get('email');
|
21225 | },
|
21226 |
|
21227 | |
21228 |
|
21229 |
|
21230 |
|
21231 |
|
21232 |
|
21233 |
|
21234 | setEmail: function setEmail(email, options) {
|
21235 | return this.set('email', email, options);
|
21236 | },
|
21237 |
|
21238 | |
21239 |
|
21240 |
|
21241 |
|
21242 |
|
21243 |
|
21244 | authenticated: function authenticated() {
|
21245 | console.warn('DEPRECATED: 如果要判断当前用户的登录状态是否有效,请使用 currentUser.isAuthenticated().then(),如果要判断该用户是否是当前登录用户,请使用 user.id === currentUser.id。');
|
21246 | return !!this._sessionToken && !AV._config.disableCurrentUser && AV.User.current() && AV.User.current().id === this.id;
|
21247 | },
|
21248 |
|
21249 | |
21250 |
|
21251 |
|
21252 |
|
21253 |
|
21254 |
|
21255 | isAuthenticated: function isAuthenticated() {
|
21256 | var _this13 = this;
|
21257 |
|
21258 | return _promise.default.resolve().then(function () {
|
21259 | return !!_this13._sessionToken && AV.User._fetchUserBySessionToken(_this13._sessionToken).then(function () {
|
21260 | return true;
|
21261 | }, function (error) {
|
21262 | if (error.code === 211) {
|
21263 | return false;
|
21264 | }
|
21265 |
|
21266 | throw error;
|
21267 | });
|
21268 | });
|
21269 | },
|
21270 |
|
21271 | |
21272 |
|
21273 |
|
21274 |
|
21275 | getSessionToken: function getSessionToken() {
|
21276 | return this._sessionToken;
|
21277 | },
|
21278 |
|
21279 | |
21280 |
|
21281 |
|
21282 |
|
21283 |
|
21284 |
|
21285 | refreshSessionToken: function refreshSessionToken(options) {
|
21286 | var _this14 = this;
|
21287 |
|
21288 | return AVRequest("users/".concat(this.id, "/refreshSessionToken"), null, null, 'PUT', null, options).then(function (response) {
|
21289 | _this14._finishFetch(response);
|
21290 |
|
21291 | return _this14._handleSaveResult(true).then(function () {
|
21292 | return _this14;
|
21293 | });
|
21294 | });
|
21295 | },
|
21296 |
|
21297 | |
21298 |
|
21299 |
|
21300 |
|
21301 |
|
21302 |
|
21303 | getRoles: function getRoles(options) {
|
21304 | var _context;
|
21305 |
|
21306 | return (0, _find.default)(_context = AV.Relation.reverseQuery('_Role', 'users', this)).call(_context, options);
|
21307 | }
|
21308 | },
|
21309 |
|
21310 | {
|
21311 |
|
21312 |
|
21313 | _currentUser: null,
|
21314 |
|
21315 |
|
21316 |
|
21317 | _currentUserMatchesDisk: false,
|
21318 |
|
21319 | _CURRENT_USER_KEY: 'currentUser',
|
21320 |
|
21321 | _authProviders: {},
|
21322 |
|
21323 |
|
21324 | |
21325 |
|
21326 |
|
21327 |
|
21328 |
|
21329 |
|
21330 |
|
21331 |
|
21332 |
|
21333 |
|
21334 |
|
21335 |
|
21336 |
|
21337 |
|
21338 | signUp: function signUp(username, password, attrs, options) {
|
21339 | attrs = attrs || {};
|
21340 | attrs.username = username;
|
21341 | attrs.password = password;
|
21342 |
|
21343 | var user = AV.Object._create('_User');
|
21344 |
|
21345 | return user.signUp(attrs, options);
|
21346 | },
|
21347 |
|
21348 | |
21349 |
|
21350 |
|
21351 |
|
21352 |
|
21353 |
|
21354 |
|
21355 |
|
21356 |
|
21357 |
|
21358 |
|
21359 | logIn: function logIn(username, password) {
|
21360 | var user = AV.Object._create('_User');
|
21361 |
|
21362 | user._finishFetch({
|
21363 | username: username,
|
21364 | password: password
|
21365 | });
|
21366 |
|
21367 | return user.logIn();
|
21368 | },
|
21369 |
|
21370 | |
21371 |
|
21372 |
|
21373 |
|
21374 |
|
21375 |
|
21376 |
|
21377 |
|
21378 |
|
21379 | become: function become(sessionToken) {
|
21380 | return this._fetchUserBySessionToken(sessionToken).then(function (user) {
|
21381 | return user._handleSaveResult(true).then(function () {
|
21382 | return user;
|
21383 | });
|
21384 | });
|
21385 | },
|
21386 | _fetchUserBySessionToken: function _fetchUserBySessionToken(sessionToken) {
|
21387 | if (sessionToken === undefined) {
|
21388 | return _promise.default.reject(new Error('The sessionToken cannot be undefined'));
|
21389 | }
|
21390 |
|
21391 | var user = AV.Object._create('_User');
|
21392 |
|
21393 | return request({
|
21394 | method: 'GET',
|
21395 | path: '/users/me',
|
21396 | authOptions: {
|
21397 | sessionToken: sessionToken
|
21398 | }
|
21399 | }).then(function (resp) {
|
21400 | var serverAttrs = user.parse(resp);
|
21401 |
|
21402 | user._finishFetch(serverAttrs);
|
21403 |
|
21404 | return user;
|
21405 | });
|
21406 | },
|
21407 |
|
21408 | |
21409 |
|
21410 |
|
21411 |
|
21412 |
|
21413 |
|
21414 |
|
21415 |
|
21416 |
|
21417 |
|
21418 |
|
21419 |
|
21420 | logInWithMobilePhoneSmsCode: function logInWithMobilePhoneSmsCode(mobilePhone, smsCode) {
|
21421 | var user = AV.Object._create('_User');
|
21422 |
|
21423 | user._finishFetch({
|
21424 | mobilePhoneNumber: mobilePhone,
|
21425 | smsCode: smsCode
|
21426 | });
|
21427 |
|
21428 | return user.logIn();
|
21429 | },
|
21430 |
|
21431 | |
21432 |
|
21433 |
|
21434 |
|
21435 |
|
21436 |
|
21437 |
|
21438 |
|
21439 |
|
21440 |
|
21441 |
|
21442 |
|
21443 |
|
21444 |
|
21445 | signUpOrlogInWithMobilePhone: function signUpOrlogInWithMobilePhone(mobilePhoneNumber, smsCode, attrs, options) {
|
21446 | attrs = attrs || {};
|
21447 | attrs.mobilePhoneNumber = mobilePhoneNumber;
|
21448 | attrs.smsCode = smsCode;
|
21449 |
|
21450 | var user = AV.Object._create('_User');
|
21451 |
|
21452 | return user.signUpOrlogInWithMobilePhone(attrs, options);
|
21453 | },
|
21454 |
|
21455 | |
21456 |
|
21457 |
|
21458 |
|
21459 |
|
21460 |
|
21461 |
|
21462 |
|
21463 |
|
21464 |
|
21465 |
|
21466 | logInWithMobilePhone: function logInWithMobilePhone(mobilePhone, password) {
|
21467 | var user = AV.Object._create('_User');
|
21468 |
|
21469 | user._finishFetch({
|
21470 | mobilePhoneNumber: mobilePhone,
|
21471 | password: password
|
21472 | });
|
21473 |
|
21474 | return user.logIn();
|
21475 | },
|
21476 |
|
21477 | |
21478 |
|
21479 |
|
21480 |
|
21481 |
|
21482 |
|
21483 |
|
21484 |
|
21485 |
|
21486 | loginWithEmail: function loginWithEmail(email, password) {
|
21487 | var user = AV.Object._create('_User');
|
21488 |
|
21489 | user._finishFetch({
|
21490 | email: email,
|
21491 | password: password
|
21492 | });
|
21493 |
|
21494 | return user.logIn();
|
21495 | },
|
21496 |
|
21497 | |
21498 |
|
21499 |
|
21500 |
|
21501 |
|
21502 |
|
21503 |
|
21504 |
|
21505 |
|
21506 |
|
21507 |
|
21508 |
|
21509 |
|
21510 |
|
21511 |
|
21512 |
|
21513 |
|
21514 |
|
21515 |
|
21516 |
|
21517 |
|
21518 |
|
21519 |
|
21520 | loginWithAuthData: function loginWithAuthData(authData, platform, options) {
|
21521 | return AV.User._logInWith(platform, authData, options);
|
21522 | },
|
21523 |
|
21524 | |
21525 |
|
21526 |
|
21527 | signUpOrlogInWithAuthData: function signUpOrlogInWithAuthData() {
|
21528 | console.warn('DEPRECATED: User.signUpOrlogInWithAuthData 已废弃,请使用 User#loginWithAuthData 代替');
|
21529 | return this.loginWithAuthData.apply(this, arguments);
|
21530 | },
|
21531 |
|
21532 | |
21533 |
|
21534 |
|
21535 |
|
21536 |
|
21537 |
|
21538 |
|
21539 |
|
21540 |
|
21541 |
|
21542 |
|
21543 |
|
21544 |
|
21545 |
|
21546 |
|
21547 |
|
21548 |
|
21549 |
|
21550 |
|
21551 |
|
21552 |
|
21553 |
|
21554 |
|
21555 |
|
21556 | loginWithAuthDataAndUnionId: function loginWithAuthDataAndUnionId(authData, platform, unionId, unionLoginOptions) {
|
21557 | return this.loginWithAuthData(mergeUnionDataIntoAuthData()(authData, unionId, unionLoginOptions), platform, unionLoginOptions);
|
21558 | },
|
21559 |
|
21560 | |
21561 |
|
21562 |
|
21563 |
|
21564 | signUpOrlogInWithAuthDataAndUnionId: function signUpOrlogInWithAuthDataAndUnionId() {
|
21565 | console.warn('DEPRECATED: User.signUpOrlogInWithAuthDataAndUnionId 已废弃,请使用 User#loginWithAuthDataAndUnionId 代替');
|
21566 | return this.loginWithAuthDataAndUnionId.apply(this, arguments);
|
21567 | },
|
21568 |
|
21569 | |
21570 |
|
21571 |
|
21572 |
|
21573 |
|
21574 |
|
21575 |
|
21576 |
|
21577 | mergeUnionId: function mergeUnionId(authInfo, unionId) {
|
21578 | var _ref14 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
|
21579 | _ref14$asMainAccount = _ref14.asMainAccount,
|
21580 | asMainAccount = _ref14$asMainAccount === void 0 ? false : _ref14$asMainAccount;
|
21581 |
|
21582 | authInfo = JSON.parse((0, _stringify.default)(authInfo));
|
21583 | var _authInfo = authInfo,
|
21584 | authData = _authInfo.authData,
|
21585 | platform = _authInfo.platform;
|
21586 | authData.platform = platform;
|
21587 | authData.main_account = asMainAccount;
|
21588 | authData.unionid = unionId;
|
21589 | return authInfo;
|
21590 | },
|
21591 |
|
21592 | |
21593 |
|
21594 |
|
21595 |
|
21596 |
|
21597 |
|
21598 |
|
21599 |
|
21600 |
|
21601 |
|
21602 |
|
21603 |
|
21604 |
|
21605 | loginWithWeapp: function loginWithWeapp() {
|
21606 | var _this15 = this;
|
21607 |
|
21608 | var _ref15 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
21609 | _ref15$preferUnionId = _ref15.preferUnionId,
|
21610 | preferUnionId = _ref15$preferUnionId === void 0 ? false : _ref15$preferUnionId,
|
21611 | _ref15$unionIdPlatfor = _ref15.unionIdPlatform,
|
21612 | unionIdPlatform = _ref15$unionIdPlatfor === void 0 ? 'weixin' : _ref15$unionIdPlatfor,
|
21613 | _ref15$asMainAccount = _ref15.asMainAccount,
|
21614 | asMainAccount = _ref15$asMainAccount === void 0 ? true : _ref15$asMainAccount,
|
21615 | _ref15$failOnNotExist = _ref15.failOnNotExist,
|
21616 | failOnNotExist = _ref15$failOnNotExist === void 0 ? false : _ref15$failOnNotExist,
|
21617 | useMasterKey = _ref15.useMasterKey,
|
21618 | sessionToken = _ref15.sessionToken,
|
21619 | user = _ref15.user;
|
21620 |
|
21621 | var getAuthInfo = getAdapter('getAuthInfo');
|
21622 | return getAuthInfo({
|
21623 | preferUnionId: preferUnionId,
|
21624 | asMainAccount: asMainAccount,
|
21625 | platform: unionIdPlatform
|
21626 | }).then(function (authInfo) {
|
21627 | return _this15.loginWithMiniApp(authInfo, {
|
21628 | failOnNotExist: failOnNotExist,
|
21629 | useMasterKey: useMasterKey,
|
21630 | sessionToken: sessionToken,
|
21631 | user: user
|
21632 | });
|
21633 | });
|
21634 | },
|
21635 |
|
21636 | |
21637 |
|
21638 |
|
21639 |
|
21640 |
|
21641 |
|
21642 |
|
21643 |
|
21644 |
|
21645 |
|
21646 |
|
21647 | loginWithWeappWithUnionId: function loginWithWeappWithUnionId(unionId) {
|
21648 | var _this16 = this;
|
21649 |
|
21650 | var _ref16 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
21651 | _ref16$unionIdPlatfor = _ref16.unionIdPlatform,
|
21652 | unionIdPlatform = _ref16$unionIdPlatfor === void 0 ? 'weixin' : _ref16$unionIdPlatfor,
|
21653 | _ref16$asMainAccount = _ref16.asMainAccount,
|
21654 | asMainAccount = _ref16$asMainAccount === void 0 ? false : _ref16$asMainAccount,
|
21655 | _ref16$failOnNotExist = _ref16.failOnNotExist,
|
21656 | failOnNotExist = _ref16$failOnNotExist === void 0 ? false : _ref16$failOnNotExist,
|
21657 | useMasterKey = _ref16.useMasterKey,
|
21658 | sessionToken = _ref16.sessionToken,
|
21659 | user = _ref16.user;
|
21660 |
|
21661 | var getAuthInfo = getAdapter('getAuthInfo');
|
21662 | return getAuthInfo({
|
21663 | platform: unionIdPlatform
|
21664 | }).then(function (authInfo) {
|
21665 | authInfo = AV.User.mergeUnionId(authInfo, unionId, {
|
21666 | asMainAccount: asMainAccount
|
21667 | });
|
21668 | return _this16.loginWithMiniApp(authInfo, {
|
21669 | failOnNotExist: failOnNotExist,
|
21670 | useMasterKey: useMasterKey,
|
21671 | sessionToken: sessionToken,
|
21672 | user: user
|
21673 | });
|
21674 | });
|
21675 | },
|
21676 |
|
21677 | |
21678 |
|
21679 |
|
21680 |
|
21681 |
|
21682 |
|
21683 |
|
21684 |
|
21685 |
|
21686 |
|
21687 |
|
21688 |
|
21689 |
|
21690 | loginWithQQApp: function loginWithQQApp() {
|
21691 | var _this17 = this;
|
21692 |
|
21693 | var _ref17 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
21694 | _ref17$preferUnionId = _ref17.preferUnionId,
|
21695 | preferUnionId = _ref17$preferUnionId === void 0 ? false : _ref17$preferUnionId,
|
21696 | _ref17$unionIdPlatfor = _ref17.unionIdPlatform,
|
21697 | unionIdPlatform = _ref17$unionIdPlatfor === void 0 ? 'qq' : _ref17$unionIdPlatfor,
|
21698 | _ref17$asMainAccount = _ref17.asMainAccount,
|
21699 | asMainAccount = _ref17$asMainAccount === void 0 ? true : _ref17$asMainAccount,
|
21700 | _ref17$failOnNotExist = _ref17.failOnNotExist,
|
21701 | failOnNotExist = _ref17$failOnNotExist === void 0 ? false : _ref17$failOnNotExist,
|
21702 | useMasterKey = _ref17.useMasterKey,
|
21703 | sessionToken = _ref17.sessionToken,
|
21704 | user = _ref17.user;
|
21705 |
|
21706 | var getAuthInfo = getAdapter('getAuthInfo');
|
21707 | return getAuthInfo({
|
21708 | preferUnionId: preferUnionId,
|
21709 | asMainAccount: asMainAccount,
|
21710 | platform: unionIdPlatform
|
21711 | }).then(function (authInfo) {
|
21712 | authInfo.provider = PLATFORM_QQAPP;
|
21713 | return _this17.loginWithMiniApp(authInfo, {
|
21714 | failOnNotExist: failOnNotExist,
|
21715 | useMasterKey: useMasterKey,
|
21716 | sessionToken: sessionToken,
|
21717 | user: user
|
21718 | });
|
21719 | });
|
21720 | },
|
21721 |
|
21722 | |
21723 |
|
21724 |
|
21725 |
|
21726 |
|
21727 |
|
21728 |
|
21729 |
|
21730 |
|
21731 |
|
21732 |
|
21733 |
|
21734 | loginWithQQAppWithUnionId: function loginWithQQAppWithUnionId(unionId) {
|
21735 | var _this18 = this;
|
21736 |
|
21737 | var _ref18 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
21738 | _ref18$unionIdPlatfor = _ref18.unionIdPlatform,
|
21739 | unionIdPlatform = _ref18$unionIdPlatfor === void 0 ? 'qq' : _ref18$unionIdPlatfor,
|
21740 | _ref18$asMainAccount = _ref18.asMainAccount,
|
21741 | asMainAccount = _ref18$asMainAccount === void 0 ? false : _ref18$asMainAccount,
|
21742 | _ref18$failOnNotExist = _ref18.failOnNotExist,
|
21743 | failOnNotExist = _ref18$failOnNotExist === void 0 ? false : _ref18$failOnNotExist,
|
21744 | useMasterKey = _ref18.useMasterKey,
|
21745 | sessionToken = _ref18.sessionToken,
|
21746 | user = _ref18.user;
|
21747 |
|
21748 | var getAuthInfo = getAdapter('getAuthInfo');
|
21749 | return getAuthInfo({
|
21750 | platform: unionIdPlatform
|
21751 | }).then(function (authInfo) {
|
21752 | authInfo = AV.User.mergeUnionId(authInfo, unionId, {
|
21753 | asMainAccount: asMainAccount
|
21754 | });
|
21755 | authInfo.provider = PLATFORM_QQAPP;
|
21756 | return _this18.loginWithMiniApp(authInfo, {
|
21757 | failOnNotExist: failOnNotExist,
|
21758 | useMasterKey: useMasterKey,
|
21759 | sessionToken: sessionToken,
|
21760 | user: user
|
21761 | });
|
21762 | });
|
21763 | },
|
21764 |
|
21765 | |
21766 |
|
21767 |
|
21768 |
|
21769 |
|
21770 |
|
21771 | loginWithMiniApp: function loginWithMiniApp(authInfo, option) {
|
21772 | var _this19 = this;
|
21773 |
|
21774 | if (authInfo === undefined) {
|
21775 | var getAuthInfo = getAdapter('getAuthInfo');
|
21776 | return getAuthInfo().then(function (authInfo) {
|
21777 | return _this19.loginWithAuthData(authInfo.authData, authInfo.provider, option);
|
21778 | });
|
21779 | }
|
21780 |
|
21781 | return this.loginWithAuthData(authInfo.authData, authInfo.provider, option);
|
21782 | },
|
21783 |
|
21784 | |
21785 |
|
21786 |
|
21787 | _genId: function _genId() {
|
21788 | return uuid();
|
21789 | },
|
21790 |
|
21791 | |
21792 |
|
21793 |
|
21794 |
|
21795 |
|
21796 |
|
21797 | loginAnonymously: function loginAnonymously() {
|
21798 | return this.loginWithAuthData({
|
21799 | id: AV.User._genId()
|
21800 | }, 'anonymous');
|
21801 | },
|
21802 | associateWithAuthData: function associateWithAuthData(userObj, platform, authData) {
|
21803 | console.warn('DEPRECATED: User.associateWithAuthData 已废弃,请使用 User#associateWithAuthData 代替');
|
21804 | return userObj._linkWith(platform, authData);
|
21805 | },
|
21806 |
|
21807 | |
21808 |
|
21809 |
|
21810 |
|
21811 |
|
21812 |
|
21813 | logOut: function logOut() {
|
21814 | if (AV._config.disableCurrentUser) {
|
21815 | console.warn('AV.User.current() was disabled in multi-user environment, call logOut() from user object instead https://leancloud.cn/docs/leanengine-node-sdk-upgrade-1.html');
|
21816 | return _promise.default.resolve(null);
|
21817 | }
|
21818 |
|
21819 | if (AV.User._currentUser !== null) {
|
21820 | AV.User._currentUser._logOutWithAll();
|
21821 |
|
21822 | AV.User._currentUser._isCurrentUser = false;
|
21823 | }
|
21824 |
|
21825 | AV.User._currentUserMatchesDisk = true;
|
21826 | AV.User._currentUser = null;
|
21827 | return AV.localStorage.removeItemAsync(AV._getAVPath(AV.User._CURRENT_USER_KEY)).then(function () {
|
21828 | return AV._refreshSubscriptionId();
|
21829 | });
|
21830 | },
|
21831 |
|
21832 | |
21833 |
|
21834 |
|
21835 |
|
21836 |
|
21837 |
|
21838 | followerQuery: function followerQuery(userObjectId) {
|
21839 | if (!userObjectId || !_.isString(userObjectId)) {
|
21840 | throw new Error('Invalid user object id.');
|
21841 | }
|
21842 |
|
21843 | var query = new AV.FriendShipQuery('_Follower');
|
21844 | query._friendshipTag = 'follower';
|
21845 | query.equalTo('user', AV.Object.createWithoutData('_User', userObjectId));
|
21846 | return query;
|
21847 | },
|
21848 |
|
21849 | |
21850 |
|
21851 |
|
21852 |
|
21853 |
|
21854 |
|
21855 | followeeQuery: function followeeQuery(userObjectId) {
|
21856 | if (!userObjectId || !_.isString(userObjectId)) {
|
21857 | throw new Error('Invalid user object id.');
|
21858 | }
|
21859 |
|
21860 | var query = new AV.FriendShipQuery('_Followee');
|
21861 | query._friendshipTag = 'followee';
|
21862 | query.equalTo('user', AV.Object.createWithoutData('_User', userObjectId));
|
21863 | return query;
|
21864 | },
|
21865 |
|
21866 | |
21867 |
|
21868 |
|
21869 |
|
21870 |
|
21871 |
|
21872 |
|
21873 |
|
21874 |
|
21875 | requestPasswordReset: function requestPasswordReset(email) {
|
21876 | var json = {
|
21877 | email: email
|
21878 | };
|
21879 | var request = AVRequest('requestPasswordReset', null, null, 'POST', json);
|
21880 | return request;
|
21881 | },
|
21882 |
|
21883 | |
21884 |
|
21885 |
|
21886 |
|
21887 |
|
21888 |
|
21889 |
|
21890 |
|
21891 |
|
21892 | requestEmailVerify: function requestEmailVerify(email) {
|
21893 | var json = {
|
21894 | email: email
|
21895 | };
|
21896 | var request = AVRequest('requestEmailVerify', null, null, 'POST', json);
|
21897 | return request;
|
21898 | },
|
21899 |
|
21900 | |
21901 |
|
21902 |
|
21903 |
|
21904 |
|
21905 |
|
21906 |
|
21907 |
|
21908 |
|
21909 |
|
21910 | requestMobilePhoneVerify: function requestMobilePhoneVerify(mobilePhoneNumber) {
|
21911 | var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
21912 | var data = {
|
21913 | mobilePhoneNumber: mobilePhoneNumber
|
21914 | };
|
21915 |
|
21916 | if (options.validateToken) {
|
21917 | data.validate_token = options.validateToken;
|
21918 | }
|
21919 |
|
21920 | var request = AVRequest('requestMobilePhoneVerify', null, null, 'POST', data, options);
|
21921 | return request;
|
21922 | },
|
21923 |
|
21924 | |
21925 |
|
21926 |
|
21927 |
|
21928 |
|
21929 |
|
21930 |
|
21931 |
|
21932 |
|
21933 |
|
21934 | requestPasswordResetBySmsCode: function requestPasswordResetBySmsCode(mobilePhoneNumber) {
|
21935 | var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
21936 | var data = {
|
21937 | mobilePhoneNumber: mobilePhoneNumber
|
21938 | };
|
21939 |
|
21940 | if (options.validateToken) {
|
21941 | data.validate_token = options.validateToken;
|
21942 | }
|
21943 |
|
21944 | var request = AVRequest('requestPasswordResetBySmsCode', null, null, 'POST', data, options);
|
21945 | return request;
|
21946 | },
|
21947 |
|
21948 | |
21949 |
|
21950 |
|
21951 |
|
21952 |
|
21953 |
|
21954 |
|
21955 |
|
21956 |
|
21957 |
|
21958 | requestChangePhoneNumber: function requestChangePhoneNumber(mobilePhoneNumber, ttl, options) {
|
21959 | var data = {
|
21960 | mobilePhoneNumber: mobilePhoneNumber
|
21961 | };
|
21962 |
|
21963 | if (ttl) {
|
21964 | data.ttl = options.ttl;
|
21965 | }
|
21966 |
|
21967 | if (options && options.validateToken) {
|
21968 | data.validate_token = options.validateToken;
|
21969 | }
|
21970 |
|
21971 | return AVRequest('requestChangePhoneNumber', null, null, 'POST', data, options);
|
21972 | },
|
21973 |
|
21974 | |
21975 |
|
21976 |
|
21977 |
|
21978 |
|
21979 |
|
21980 |
|
21981 |
|
21982 | changePhoneNumber: function changePhoneNumber(mobilePhoneNumber, code) {
|
21983 | var data = {
|
21984 | mobilePhoneNumber: mobilePhoneNumber,
|
21985 | code: code
|
21986 | };
|
21987 | return AVRequest('changePhoneNumber', null, null, 'POST', data);
|
21988 | },
|
21989 |
|
21990 | |
21991 |
|
21992 |
|
21993 |
|
21994 |
|
21995 |
|
21996 |
|
21997 |
|
21998 | resetPasswordBySmsCode: function resetPasswordBySmsCode(code, password) {
|
21999 | var json = {
|
22000 | password: password
|
22001 | };
|
22002 | var request = AVRequest('resetPasswordBySmsCode', null, code, 'PUT', json);
|
22003 | return request;
|
22004 | },
|
22005 |
|
22006 | |
22007 |
|
22008 |
|
22009 |
|
22010 |
|
22011 |
|
22012 |
|
22013 | verifyMobilePhone: function verifyMobilePhone(code) {
|
22014 | var request = AVRequest('verifyMobilePhone', null, code, 'POST', null);
|
22015 | return request;
|
22016 | },
|
22017 |
|
22018 | |
22019 |
|
22020 |
|
22021 |
|
22022 |
|
22023 |
|
22024 |
|
22025 |
|
22026 |
|
22027 |
|
22028 | requestLoginSmsCode: function requestLoginSmsCode(mobilePhoneNumber) {
|
22029 | var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
22030 | var data = {
|
22031 | mobilePhoneNumber: mobilePhoneNumber
|
22032 | };
|
22033 |
|
22034 | if (options.validateToken) {
|
22035 | data.validate_token = options.validateToken;
|
22036 | }
|
22037 |
|
22038 | var request = AVRequest('requestLoginSmsCode', null, null, 'POST', data, options);
|
22039 | return request;
|
22040 | },
|
22041 |
|
22042 | |
22043 |
|
22044 |
|
22045 |
|
22046 |
|
22047 | currentAsync: function currentAsync() {
|
22048 | if (AV._config.disableCurrentUser) {
|
22049 | console.warn('AV.User.currentAsync() was disabled in multi-user environment, access user from request instead https://leancloud.cn/docs/leanengine-node-sdk-upgrade-1.html');
|
22050 | return _promise.default.resolve(null);
|
22051 | }
|
22052 |
|
22053 | if (AV.User._currentUser) {
|
22054 | return _promise.default.resolve(AV.User._currentUser);
|
22055 | }
|
22056 |
|
22057 | if (AV.User._currentUserMatchesDisk) {
|
22058 | return _promise.default.resolve(AV.User._currentUser);
|
22059 | }
|
22060 |
|
22061 | return AV.localStorage.getItemAsync(AV._getAVPath(AV.User._CURRENT_USER_KEY)).then(function (userData) {
|
22062 | if (!userData) {
|
22063 | return null;
|
22064 | }
|
22065 |
|
22066 |
|
22067 | AV.User._currentUserMatchesDisk = true;
|
22068 | AV.User._currentUser = AV.Object._create('_User');
|
22069 | AV.User._currentUser._isCurrentUser = true;
|
22070 | var json = JSON.parse(userData);
|
22071 | AV.User._currentUser.id = json._id;
|
22072 | delete json._id;
|
22073 | AV.User._currentUser._sessionToken = json._sessionToken;
|
22074 | delete json._sessionToken;
|
22075 |
|
22076 | AV.User._currentUser._finishFetch(json);
|
22077 |
|
22078 |
|
22079 | AV.User._currentUser._synchronizeAllAuthData();
|
22080 |
|
22081 | AV.User._currentUser._refreshCache();
|
22082 |
|
22083 | AV.User._currentUser._opSetQueue = [{}];
|
22084 | return AV.User._currentUser;
|
22085 | });
|
22086 | },
|
22087 |
|
22088 | |
22089 |
|
22090 |
|
22091 |
|
22092 |
|
22093 | current: function current() {
|
22094 | if (AV._config.disableCurrentUser) {
|
22095 | console.warn('AV.User.current() was disabled in multi-user environment, access user from request instead https://leancloud.cn/docs/leanengine-node-sdk-upgrade-1.html');
|
22096 | return null;
|
22097 | }
|
22098 |
|
22099 | if (AV.localStorage.async) {
|
22100 | var error = new Error('Synchronous API User.current() is not available in this runtime. Use User.currentAsync() instead.');
|
22101 | error.code = 'SYNC_API_NOT_AVAILABLE';
|
22102 | throw error;
|
22103 | }
|
22104 |
|
22105 | if (AV.User._currentUser) {
|
22106 | return AV.User._currentUser;
|
22107 | }
|
22108 |
|
22109 | if (AV.User._currentUserMatchesDisk) {
|
22110 | return AV.User._currentUser;
|
22111 | }
|
22112 |
|
22113 |
|
22114 | AV.User._currentUserMatchesDisk = true;
|
22115 | var userData = AV.localStorage.getItem(AV._getAVPath(AV.User._CURRENT_USER_KEY));
|
22116 |
|
22117 | if (!userData) {
|
22118 | return null;
|
22119 | }
|
22120 |
|
22121 | AV.User._currentUser = AV.Object._create('_User');
|
22122 | AV.User._currentUser._isCurrentUser = true;
|
22123 | var json = JSON.parse(userData);
|
22124 | AV.User._currentUser.id = json._id;
|
22125 | delete json._id;
|
22126 | AV.User._currentUser._sessionToken = json._sessionToken;
|
22127 | delete json._sessionToken;
|
22128 |
|
22129 | AV.User._currentUser._finishFetch(json);
|
22130 |
|
22131 |
|
22132 | AV.User._currentUser._synchronizeAllAuthData();
|
22133 |
|
22134 | AV.User._currentUser._refreshCache();
|
22135 |
|
22136 | AV.User._currentUser._opSetQueue = [{}];
|
22137 | return AV.User._currentUser;
|
22138 | },
|
22139 |
|
22140 | |
22141 |
|
22142 |
|
22143 |
|
22144 | _saveCurrentUser: function _saveCurrentUser(user) {
|
22145 | var promise;
|
22146 |
|
22147 | if (AV.User._currentUser !== user) {
|
22148 | promise = AV.User.logOut();
|
22149 | } else {
|
22150 | promise = _promise.default.resolve();
|
22151 | }
|
22152 |
|
22153 | return promise.then(function () {
|
22154 | user._isCurrentUser = true;
|
22155 | AV.User._currentUser = user;
|
22156 |
|
22157 | var json = user._toFullJSON();
|
22158 |
|
22159 | json._id = user.id;
|
22160 | json._sessionToken = user._sessionToken;
|
22161 | return AV.localStorage.setItemAsync(AV._getAVPath(AV.User._CURRENT_USER_KEY), (0, _stringify.default)(json)).then(function () {
|
22162 | AV.User._currentUserMatchesDisk = true;
|
22163 | return AV._refreshSubscriptionId();
|
22164 | });
|
22165 | });
|
22166 | },
|
22167 | _registerAuthenticationProvider: function _registerAuthenticationProvider(provider) {
|
22168 | AV.User._authProviders[provider.getAuthType()] = provider;
|
22169 |
|
22170 | if (!AV._config.disableCurrentUser && AV.User.current()) {
|
22171 | AV.User.current()._synchronizeAuthData(provider.getAuthType());
|
22172 | }
|
22173 | },
|
22174 | _logInWith: function _logInWith(provider, authData, options) {
|
22175 | var user = AV.Object._create('_User');
|
22176 |
|
22177 | return user._linkWith(provider, authData, options);
|
22178 | }
|
22179 | });
|
22180 | };
|
22181 |
|
22182 | }),
|
22183 |
|
22184 | (function(module, exports, __webpack_require__) {
|
22185 |
|
22186 | var _Object$defineProperty = __webpack_require__(151);
|
22187 |
|
22188 | function _defineProperty(obj, key, value) {
|
22189 | if (key in obj) {
|
22190 | _Object$defineProperty(obj, key, {
|
22191 | value: value,
|
22192 | enumerable: true,
|
22193 | configurable: true,
|
22194 | writable: true
|
22195 | });
|
22196 | } else {
|
22197 | obj[key] = value;
|
22198 | }
|
22199 |
|
22200 | return obj;
|
22201 | }
|
22202 |
|
22203 | module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
22204 |
|
22205 | }),
|
22206 |
|
22207 | (function(module, exports, __webpack_require__) {
|
22208 |
|
22209 | "use strict";
|
22210 |
|
22211 |
|
22212 | var _interopRequireDefault = __webpack_require__(1);
|
22213 |
|
22214 | var _map = _interopRequireDefault(__webpack_require__(35));
|
22215 |
|
22216 | var _promise = _interopRequireDefault(__webpack_require__(12));
|
22217 |
|
22218 | var _keys = _interopRequireDefault(__webpack_require__(59));
|
22219 |
|
22220 | var _stringify = _interopRequireDefault(__webpack_require__(36));
|
22221 |
|
22222 | var _find = _interopRequireDefault(__webpack_require__(93));
|
22223 |
|
22224 | var _concat = _interopRequireDefault(__webpack_require__(22));
|
22225 |
|
22226 | var _ = __webpack_require__(3);
|
22227 |
|
22228 | var debug = __webpack_require__(60)('leancloud:query');
|
22229 |
|
22230 | var AVError = __webpack_require__(46);
|
22231 |
|
22232 | var _require = __webpack_require__(27),
|
22233 | _request = _require._request,
|
22234 | request = _require.request;
|
22235 |
|
22236 | var _require2 = __webpack_require__(30),
|
22237 | ensureArray = _require2.ensureArray,
|
22238 | transformFetchOptions = _require2.transformFetchOptions,
|
22239 | continueWhile = _require2.continueWhile;
|
22240 |
|
22241 | var requires = function requires(value, message) {
|
22242 | if (value === undefined) {
|
22243 | throw new Error(message);
|
22244 | }
|
22245 | };
|
22246 |
|
22247 |
|
22248 | module.exports = function (AV) {
|
22249 | |
22250 |
|
22251 |
|
22252 |
|
22253 |
|
22254 |
|
22255 |
|
22256 |
|
22257 |
|
22258 |
|
22259 |
|
22260 |
|
22261 |
|
22262 |
|
22263 |
|
22264 |
|
22265 |
|
22266 |
|
22267 |
|
22268 |
|
22269 |
|
22270 |
|
22271 |
|
22272 |
|
22273 |
|
22274 |
|
22275 |
|
22276 |
|
22277 |
|
22278 |
|
22279 |
|
22280 |
|
22281 |
|
22282 |
|
22283 |
|
22284 |
|
22285 |
|
22286 |
|
22287 |
|
22288 |
|
22289 |
|
22290 |
|
22291 |
|
22292 | AV.Query = function (objectClass) {
|
22293 | if (_.isString(objectClass)) {
|
22294 | objectClass = AV.Object._getSubclass(objectClass);
|
22295 | }
|
22296 |
|
22297 | this.objectClass = objectClass;
|
22298 | this.className = objectClass.prototype.className;
|
22299 | this._where = {};
|
22300 | this._include = [];
|
22301 | this._select = [];
|
22302 | this._limit = -1;
|
22303 |
|
22304 | this._skip = 0;
|
22305 | this._defaultParams = {};
|
22306 | };
|
22307 | |
22308 |
|
22309 |
|
22310 |
|
22311 |
|
22312 |
|
22313 |
|
22314 |
|
22315 |
|
22316 |
|
22317 |
|
22318 |
|
22319 | AV.Query.or = function () {
|
22320 | var queries = _.toArray(arguments);
|
22321 |
|
22322 | var className = null;
|
22323 |
|
22324 | AV._arrayEach(queries, function (q) {
|
22325 | if (_.isNull(className)) {
|
22326 | className = q.className;
|
22327 | }
|
22328 |
|
22329 | if (className !== q.className) {
|
22330 | throw new Error('All queries must be for the same class');
|
22331 | }
|
22332 | });
|
22333 |
|
22334 | var query = new AV.Query(className);
|
22335 |
|
22336 | query._orQuery(queries);
|
22337 |
|
22338 | return query;
|
22339 | };
|
22340 | |
22341 |
|
22342 |
|
22343 |
|
22344 |
|
22345 |
|
22346 |
|
22347 |
|
22348 |
|
22349 |
|
22350 |
|
22351 |
|
22352 | AV.Query.and = function () {
|
22353 | var queries = _.toArray(arguments);
|
22354 |
|
22355 | var className = null;
|
22356 |
|
22357 | AV._arrayEach(queries, function (q) {
|
22358 | if (_.isNull(className)) {
|
22359 | className = q.className;
|
22360 | }
|
22361 |
|
22362 | if (className !== q.className) {
|
22363 | throw new Error('All queries must be for the same class');
|
22364 | }
|
22365 | });
|
22366 |
|
22367 | var query = new AV.Query(className);
|
22368 |
|
22369 | query._andQuery(queries);
|
22370 |
|
22371 | return query;
|
22372 | };
|
22373 | |
22374 |
|
22375 |
|
22376 |
|
22377 |
|
22378 |
|
22379 |
|
22380 |
|
22381 |
|
22382 |
|
22383 |
|
22384 |
|
22385 | AV.Query.doCloudQuery = function (cql, pvalues, options) {
|
22386 | var params = {
|
22387 | cql: cql
|
22388 | };
|
22389 |
|
22390 | if (_.isArray(pvalues)) {
|
22391 | params.pvalues = pvalues;
|
22392 | } else {
|
22393 | options = pvalues;
|
22394 | }
|
22395 |
|
22396 | var request = _request('cloudQuery', null, null, 'GET', params, options);
|
22397 |
|
22398 | return request.then(function (response) {
|
22399 |
|
22400 | var query = new AV.Query(response.className);
|
22401 | var results = (0, _map.default)(_).call(_, response.results, function (json) {
|
22402 | var obj = query._newObject(response);
|
22403 |
|
22404 | if (obj._finishFetch) {
|
22405 | obj._finishFetch(query._processResult(json), true);
|
22406 | }
|
22407 |
|
22408 | return obj;
|
22409 | });
|
22410 | return {
|
22411 | results: results,
|
22412 | count: response.count,
|
22413 | className: response.className
|
22414 | };
|
22415 | });
|
22416 | };
|
22417 | |
22418 |
|
22419 |
|
22420 |
|
22421 |
|
22422 |
|
22423 |
|
22424 |
|
22425 |
|
22426 | AV.Query.fromJSON = function (_ref) {
|
22427 | var className = _ref.className,
|
22428 | where = _ref.where,
|
22429 | include = _ref.include,
|
22430 | select = _ref.select,
|
22431 | includeACL = _ref.includeACL,
|
22432 | limit = _ref.limit,
|
22433 | skip = _ref.skip,
|
22434 | order = _ref.order;
|
22435 |
|
22436 | if (typeof className !== 'string') {
|
22437 | throw new TypeError('Invalid Query JSON, className must be a String.');
|
22438 | }
|
22439 |
|
22440 | var query = new AV.Query(className);
|
22441 |
|
22442 | _.extend(query, {
|
22443 | _where: where,
|
22444 | _include: include,
|
22445 | _select: select,
|
22446 | _includeACL: includeACL,
|
22447 | _limit: limit,
|
22448 | _skip: skip,
|
22449 | _order: order
|
22450 | });
|
22451 |
|
22452 | return query;
|
22453 | };
|
22454 |
|
22455 | AV.Query._extend = AV._extend;
|
22456 |
|
22457 | _.extend(AV.Query.prototype,
|
22458 |
|
22459 | {
|
22460 |
|
22461 | _processResult: function _processResult(obj) {
|
22462 | return obj;
|
22463 | },
|
22464 |
|
22465 | |
22466 |
|
22467 |
|
22468 |
|
22469 |
|
22470 |
|
22471 |
|
22472 |
|
22473 | get: function get(objectId, options) {
|
22474 | if (!_.isString(objectId)) {
|
22475 | throw new Error('objectId must be a string');
|
22476 | }
|
22477 |
|
22478 | if (objectId === '') {
|
22479 | return _promise.default.reject(new AVError(AVError.OBJECT_NOT_FOUND, 'Object not found.'));
|
22480 | }
|
22481 |
|
22482 | var obj = this._newObject();
|
22483 |
|
22484 | obj.id = objectId;
|
22485 |
|
22486 | var queryJSON = this._getParams();
|
22487 |
|
22488 | var fetchOptions = {};
|
22489 | if ((0, _keys.default)(queryJSON)) fetchOptions.keys = (0, _keys.default)(queryJSON);
|
22490 | if (queryJSON.include) fetchOptions.include = queryJSON.include;
|
22491 | if (queryJSON.includeACL) fetchOptions.includeACL = queryJSON.includeACL;
|
22492 | return _request('classes', this.className, objectId, 'GET', transformFetchOptions(fetchOptions), options).then(function (response) {
|
22493 | if (_.isEmpty(response)) throw new AVError(AVError.OBJECT_NOT_FOUND, 'Object not found.');
|
22494 |
|
22495 | obj._finishFetch(obj.parse(response), true);
|
22496 |
|
22497 | return obj;
|
22498 | });
|
22499 | },
|
22500 |
|
22501 | |
22502 |
|
22503 |
|
22504 |
|
22505 | toJSON: function toJSON() {
|
22506 | var className = this.className,
|
22507 | where = this._where,
|
22508 | include = this._include,
|
22509 | select = this._select,
|
22510 | includeACL = this._includeACL,
|
22511 | limit = this._limit,
|
22512 | skip = this._skip,
|
22513 | order = this._order;
|
22514 | return {
|
22515 | className: className,
|
22516 | where: where,
|
22517 | include: include,
|
22518 | select: select,
|
22519 | includeACL: includeACL,
|
22520 | limit: limit,
|
22521 | skip: skip,
|
22522 | order: order
|
22523 | };
|
22524 | },
|
22525 | _getParams: function _getParams() {
|
22526 | var params = _.extend({}, this._defaultParams, {
|
22527 | where: this._where
|
22528 | });
|
22529 |
|
22530 | if (this._include.length > 0) {
|
22531 | params.include = this._include.join(',');
|
22532 | }
|
22533 |
|
22534 | if (this._select.length > 0) {
|
22535 | params.keys = this._select.join(',');
|
22536 | }
|
22537 |
|
22538 | if (this._includeACL !== undefined) {
|
22539 | params.returnACL = this._includeACL;
|
22540 | }
|
22541 |
|
22542 | if (this._limit >= 0) {
|
22543 | params.limit = this._limit;
|
22544 | }
|
22545 |
|
22546 | if (this._skip > 0) {
|
22547 | params.skip = this._skip;
|
22548 | }
|
22549 |
|
22550 | if (this._order !== undefined) {
|
22551 | params.order = this._order;
|
22552 | }
|
22553 |
|
22554 | return params;
|
22555 | },
|
22556 | _newObject: function _newObject(response) {
|
22557 | var obj;
|
22558 |
|
22559 | if (response && response.className) {
|
22560 | obj = new AV.Object(response.className);
|
22561 | } else {
|
22562 | obj = new this.objectClass();
|
22563 | }
|
22564 |
|
22565 | return obj;
|
22566 | },
|
22567 | _createRequest: function _createRequest() {
|
22568 | var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this._getParams();
|
22569 | var options = arguments.length > 1 ? arguments[1] : undefined;
|
22570 | var path = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "/classes/".concat(this.className);
|
22571 |
|
22572 | if (encodeURIComponent((0, _stringify.default)(params)).length > 2000) {
|
22573 | var body = {
|
22574 | requests: [{
|
22575 | method: 'GET',
|
22576 | path: "/1.1".concat(path),
|
22577 | params: params
|
22578 | }]
|
22579 | };
|
22580 | return request({
|
22581 | path: '/batch',
|
22582 | method: 'POST',
|
22583 | data: body,
|
22584 | authOptions: options
|
22585 | }).then(function (response) {
|
22586 | var result = response[0];
|
22587 |
|
22588 | if (result.success) {
|
22589 | return result.success;
|
22590 | }
|
22591 |
|
22592 | var error = new AVError(result.error.code, result.error.error || 'Unknown batch error');
|
22593 | throw error;
|
22594 | });
|
22595 | }
|
22596 |
|
22597 | return request({
|
22598 | method: 'GET',
|
22599 | path: path,
|
22600 | query: params,
|
22601 | authOptions: options
|
22602 | });
|
22603 | },
|
22604 | _parseResponse: function _parseResponse(response) {
|
22605 | var _this = this;
|
22606 |
|
22607 | return (0, _map.default)(_).call(_, response.results, function (json) {
|
22608 | var obj = _this._newObject(response);
|
22609 |
|
22610 | if (obj._finishFetch) {
|
22611 | obj._finishFetch(_this._processResult(json), true);
|
22612 | }
|
22613 |
|
22614 | return obj;
|
22615 | });
|
22616 | },
|
22617 |
|
22618 | |
22619 |
|
22620 |
|
22621 |
|
22622 |
|
22623 |
|
22624 |
|
22625 | find: function find(options) {
|
22626 | var request = this._createRequest(undefined, options);
|
22627 |
|
22628 | return request.then(this._parseResponse.bind(this));
|
22629 | },
|
22630 |
|
22631 | |
22632 |
|
22633 |
|
22634 |
|
22635 |
|
22636 |
|
22637 |
|
22638 | findAndCount: function findAndCount(options) {
|
22639 | var _this2 = this;
|
22640 |
|
22641 | var params = this._getParams();
|
22642 |
|
22643 | params.count = 1;
|
22644 |
|
22645 | var request = this._createRequest(params, options);
|
22646 |
|
22647 | return request.then(function (response) {
|
22648 | return [_this2._parseResponse(response), response.count];
|
22649 | });
|
22650 | },
|
22651 |
|
22652 | |
22653 |
|
22654 |
|
22655 |
|
22656 |
|
22657 |
|
22658 |
|
22659 |
|
22660 |
|
22661 |
|
22662 |
|
22663 |
|
22664 |
|
22665 |
|
22666 |
|
22667 |
|
22668 |
|
22669 |
|
22670 | scan: function scan() {
|
22671 | var _this3 = this;
|
22672 |
|
22673 | var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
22674 | orderedBy = _ref2.orderedBy,
|
22675 | batchSize = _ref2.batchSize;
|
22676 |
|
22677 | var authOptions = arguments.length > 1 ? arguments[1] : undefined;
|
22678 |
|
22679 | var condition = this._getParams();
|
22680 |
|
22681 | debug('scan %O', condition);
|
22682 |
|
22683 | if (condition.order) {
|
22684 | console.warn('The order of the query is ignored for Query#scan. Checkout the orderedBy option of Query#scan.');
|
22685 | delete condition.order;
|
22686 | }
|
22687 |
|
22688 | if (condition.skip) {
|
22689 | console.warn('The skip option of the query is ignored for Query#scan.');
|
22690 | delete condition.skip;
|
22691 | }
|
22692 |
|
22693 | if (condition.limit) {
|
22694 | console.warn('The limit option of the query is ignored for Query#scan.');
|
22695 | delete condition.limit;
|
22696 | }
|
22697 |
|
22698 | if (orderedBy) condition.scan_key = orderedBy;
|
22699 | if (batchSize) condition.limit = batchSize;
|
22700 | var cursor;
|
22701 | var remainResults = [];
|
22702 | return {
|
22703 | next: function next() {
|
22704 | if (remainResults.length) {
|
22705 | return _promise.default.resolve({
|
22706 | done: false,
|
22707 | value: remainResults.shift()
|
22708 | });
|
22709 | }
|
22710 |
|
22711 | if (cursor === null) {
|
22712 | return _promise.default.resolve({
|
22713 | done: true
|
22714 | });
|
22715 | }
|
22716 |
|
22717 | return _request('scan/classes', _this3.className, null, 'GET', cursor ? _.extend({}, condition, {
|
22718 | cursor: cursor
|
22719 | }) : condition, authOptions).then(function (response) {
|
22720 | cursor = response.cursor;
|
22721 |
|
22722 | if (response.results.length) {
|
22723 | var results = _this3._parseResponse(response);
|
22724 |
|
22725 | results.forEach(function (result) {
|
22726 | return remainResults.push(result);
|
22727 | });
|
22728 | }
|
22729 |
|
22730 | if (cursor === null && remainResults.length === 0) {
|
22731 | return {
|
22732 | done: true
|
22733 | };
|
22734 | }
|
22735 |
|
22736 | return {
|
22737 | done: false,
|
22738 | value: remainResults.shift()
|
22739 | };
|
22740 | });
|
22741 | }
|
22742 | };
|
22743 | },
|
22744 |
|
22745 | |
22746 |
|
22747 |
|
22748 |
|
22749 |
|
22750 |
|
22751 | destroyAll: function destroyAll(options) {
|
22752 | var self = this;
|
22753 | return (0, _find.default)(self).call(self, options).then(function (objects) {
|
22754 | return AV.Object.destroyAll(objects, options);
|
22755 | });
|
22756 | },
|
22757 |
|
22758 | |
22759 |
|
22760 |
|
22761 |
|
22762 |
|
22763 |
|
22764 |
|
22765 | count: function count(options) {
|
22766 | var params = this._getParams();
|
22767 |
|
22768 | params.limit = 0;
|
22769 | params.count = 1;
|
22770 |
|
22771 | var request = this._createRequest(params, options);
|
22772 |
|
22773 | return request.then(function (response) {
|
22774 | return response.count;
|
22775 | });
|
22776 | },
|
22777 |
|
22778 | |
22779 |
|
22780 |
|
22781 |
|
22782 |
|
22783 |
|
22784 |
|
22785 | first: function first(options) {
|
22786 | var self = this;
|
22787 |
|
22788 | var params = this._getParams();
|
22789 |
|
22790 | params.limit = 1;
|
22791 |
|
22792 | var request = this._createRequest(params, options);
|
22793 |
|
22794 | return request.then(function (response) {
|
22795 | return (0, _map.default)(_).call(_, response.results, function (json) {
|
22796 | var obj = self._newObject();
|
22797 |
|
22798 | if (obj._finishFetch) {
|
22799 | obj._finishFetch(self._processResult(json), true);
|
22800 | }
|
22801 |
|
22802 | return obj;
|
22803 | })[0];
|
22804 | });
|
22805 | },
|
22806 |
|
22807 | |
22808 |
|
22809 |
|
22810 |
|
22811 |
|
22812 |
|
22813 |
|
22814 | skip: function skip(n) {
|
22815 | requires(n, 'undefined is not a valid skip value');
|
22816 | this._skip = n;
|
22817 | return this;
|
22818 | },
|
22819 |
|
22820 | |
22821 |
|
22822 |
|
22823 |
|
22824 |
|
22825 |
|
22826 | limit: function limit(n) {
|
22827 | requires(n, 'undefined is not a valid limit value');
|
22828 | this._limit = n;
|
22829 | return this;
|
22830 | },
|
22831 |
|
22832 | |
22833 |
|
22834 |
|
22835 |
|
22836 |
|
22837 |
|
22838 |
|
22839 | equalTo: function equalTo(key, value) {
|
22840 | requires(key, 'undefined is not a valid key');
|
22841 | requires(value, 'undefined is not a valid value');
|
22842 | this._where[key] = AV._encode(value);
|
22843 | return this;
|
22844 | },
|
22845 |
|
22846 | |
22847 |
|
22848 |
|
22849 |
|
22850 | _addCondition: function _addCondition(key, condition, value) {
|
22851 | requires(key, 'undefined is not a valid condition key');
|
22852 | requires(condition, 'undefined is not a valid condition');
|
22853 | requires(value, 'undefined is not a valid condition value');
|
22854 |
|
22855 | if (!this._where[key]) {
|
22856 | this._where[key] = {};
|
22857 | }
|
22858 |
|
22859 | this._where[key][condition] = AV._encode(value);
|
22860 | return this;
|
22861 | },
|
22862 |
|
22863 | |
22864 |
|
22865 |
|
22866 |
|
22867 |
|
22868 |
|
22869 |
|
22870 | sizeEqualTo: function sizeEqualTo(key, value) {
|
22871 | this._addCondition(key, '$size', value);
|
22872 |
|
22873 | return this;
|
22874 | },
|
22875 |
|
22876 | |
22877 |
|
22878 |
|
22879 |
|
22880 |
|
22881 |
|
22882 |
|
22883 | notEqualTo: function notEqualTo(key, value) {
|
22884 | this._addCondition(key, '$ne', value);
|
22885 |
|
22886 | return this;
|
22887 | },
|
22888 |
|
22889 | |
22890 |
|
22891 |
|
22892 |
|
22893 |
|
22894 |
|
22895 |
|
22896 | lessThan: function lessThan(key, value) {
|
22897 | this._addCondition(key, '$lt', value);
|
22898 |
|
22899 | return this;
|
22900 | },
|
22901 |
|
22902 | |
22903 |
|
22904 |
|
22905 |
|
22906 |
|
22907 |
|
22908 |
|
22909 | greaterThan: function greaterThan(key, value) {
|
22910 | this._addCondition(key, '$gt', value);
|
22911 |
|
22912 | return this;
|
22913 | },
|
22914 |
|
22915 | |
22916 |
|
22917 |
|
22918 |
|
22919 |
|
22920 |
|
22921 |
|
22922 | lessThanOrEqualTo: function lessThanOrEqualTo(key, value) {
|
22923 | this._addCondition(key, '$lte', value);
|
22924 |
|
22925 | return this;
|
22926 | },
|
22927 |
|
22928 | |
22929 |
|
22930 |
|
22931 |
|
22932 |
|
22933 |
|
22934 |
|
22935 | greaterThanOrEqualTo: function greaterThanOrEqualTo(key, value) {
|
22936 | this._addCondition(key, '$gte', value);
|
22937 |
|
22938 | return this;
|
22939 | },
|
22940 |
|
22941 | |
22942 |
|
22943 |
|
22944 |
|
22945 |
|
22946 |
|
22947 |
|
22948 | containedIn: function containedIn(key, values) {
|
22949 | this._addCondition(key, '$in', values);
|
22950 |
|
22951 | return this;
|
22952 | },
|
22953 |
|
22954 | |
22955 |
|
22956 |
|
22957 |
|
22958 |
|
22959 |
|
22960 |
|
22961 | notContainedIn: function notContainedIn(key, values) {
|
22962 | this._addCondition(key, '$nin', values);
|
22963 |
|
22964 | return this;
|
22965 | },
|
22966 |
|
22967 | |
22968 |
|
22969 |
|
22970 |
|
22971 |
|
22972 |
|
22973 |
|
22974 | containsAll: function containsAll(key, values) {
|
22975 | this._addCondition(key, '$all', values);
|
22976 |
|
22977 | return this;
|
22978 | },
|
22979 |
|
22980 | |
22981 |
|
22982 |
|
22983 |
|
22984 |
|
22985 | exists: function exists(key) {
|
22986 | this._addCondition(key, '$exists', true);
|
22987 |
|
22988 | return this;
|
22989 | },
|
22990 |
|
22991 | |
22992 |
|
22993 |
|
22994 |
|
22995 |
|
22996 | doesNotExist: function doesNotExist(key) {
|
22997 | this._addCondition(key, '$exists', false);
|
22998 |
|
22999 | return this;
|
23000 | },
|
23001 |
|
23002 | |
23003 |
|
23004 |
|
23005 |
|
23006 |
|
23007 |
|
23008 |
|
23009 |
|
23010 | matches: function matches(key, regex, modifiers) {
|
23011 | this._addCondition(key, '$regex', regex);
|
23012 |
|
23013 | if (!modifiers) {
|
23014 | modifiers = '';
|
23015 | }
|
23016 |
|
23017 |
|
23018 |
|
23019 |
|
23020 | if (regex.ignoreCase) {
|
23021 | modifiers += 'i';
|
23022 | }
|
23023 |
|
23024 | if (regex.multiline) {
|
23025 | modifiers += 'm';
|
23026 | }
|
23027 |
|
23028 | if (modifiers && modifiers.length) {
|
23029 | this._addCondition(key, '$options', modifiers);
|
23030 | }
|
23031 |
|
23032 | return this;
|
23033 | },
|
23034 |
|
23035 | |
23036 |
|
23037 |
|
23038 |
|
23039 |
|
23040 |
|
23041 |
|
23042 |
|
23043 | matchesQuery: function matchesQuery(key, query) {
|
23044 | var queryJSON = query._getParams();
|
23045 |
|
23046 | queryJSON.className = query.className;
|
23047 |
|
23048 | this._addCondition(key, '$inQuery', queryJSON);
|
23049 |
|
23050 | return this;
|
23051 | },
|
23052 |
|
23053 | |
23054 |
|
23055 |
|
23056 |
|
23057 |
|
23058 |
|
23059 |
|
23060 |
|
23061 | doesNotMatchQuery: function doesNotMatchQuery(key, query) {
|
23062 | var queryJSON = query._getParams();
|
23063 |
|
23064 | queryJSON.className = query.className;
|
23065 |
|
23066 | this._addCondition(key, '$notInQuery', queryJSON);
|
23067 |
|
23068 | return this;
|
23069 | },
|
23070 |
|
23071 | |
23072 |
|
23073 |
|
23074 |
|
23075 |
|
23076 |
|
23077 |
|
23078 |
|
23079 |
|
23080 |
|
23081 | matchesKeyInQuery: function matchesKeyInQuery(key, queryKey, query) {
|
23082 | var queryJSON = query._getParams();
|
23083 |
|
23084 | queryJSON.className = query.className;
|
23085 |
|
23086 | this._addCondition(key, '$select', {
|
23087 | key: queryKey,
|
23088 | query: queryJSON
|
23089 | });
|
23090 |
|
23091 | return this;
|
23092 | },
|
23093 |
|
23094 | |
23095 |
|
23096 |
|
23097 |
|
23098 |
|
23099 |
|
23100 |
|
23101 |
|
23102 |
|
23103 |
|
23104 | doesNotMatchKeyInQuery: function doesNotMatchKeyInQuery(key, queryKey, query) {
|
23105 | var queryJSON = query._getParams();
|
23106 |
|
23107 | queryJSON.className = query.className;
|
23108 |
|
23109 | this._addCondition(key, '$dontSelect', {
|
23110 | key: queryKey,
|
23111 | query: queryJSON
|
23112 | });
|
23113 |
|
23114 | return this;
|
23115 | },
|
23116 |
|
23117 | |
23118 |
|
23119 |
|
23120 |
|
23121 |
|
23122 |
|
23123 | _orQuery: function _orQuery(queries) {
|
23124 | var queryJSON = (0, _map.default)(_).call(_, queries, function (q) {
|
23125 | return q._getParams().where;
|
23126 | });
|
23127 | this._where.$or = queryJSON;
|
23128 | return this;
|
23129 | },
|
23130 |
|
23131 | |
23132 |
|
23133 |
|
23134 |
|
23135 |
|
23136 |
|
23137 | _andQuery: function _andQuery(queries) {
|
23138 | var queryJSON = (0, _map.default)(_).call(_, queries, function (q) {
|
23139 | return q._getParams().where;
|
23140 | });
|
23141 | this._where.$and = queryJSON;
|
23142 | return this;
|
23143 | },
|
23144 |
|
23145 | |
23146 |
|
23147 |
|
23148 |
|
23149 |
|
23150 |
|
23151 | _quote: function _quote(s) {
|
23152 | return '\\Q' + s.replace('\\E', '\\E\\\\E\\Q') + '\\E';
|
23153 | },
|
23154 |
|
23155 | |
23156 |
|
23157 |
|
23158 |
|
23159 |
|
23160 |
|
23161 |
|
23162 | contains: function contains(key, value) {
|
23163 | this._addCondition(key, '$regex', this._quote(value));
|
23164 |
|
23165 | return this;
|
23166 | },
|
23167 |
|
23168 | |
23169 |
|
23170 |
|
23171 |
|
23172 |
|
23173 |
|
23174 |
|
23175 |
|
23176 | startsWith: function startsWith(key, value) {
|
23177 | this._addCondition(key, '$regex', '^' + this._quote(value));
|
23178 |
|
23179 | return this;
|
23180 | },
|
23181 |
|
23182 | |
23183 |
|
23184 |
|
23185 |
|
23186 |
|
23187 |
|
23188 |
|
23189 | endsWith: function endsWith(key, value) {
|
23190 | this._addCondition(key, '$regex', this._quote(value) + '$');
|
23191 |
|
23192 | return this;
|
23193 | },
|
23194 |
|
23195 | |
23196 |
|
23197 |
|
23198 |
|
23199 |
|
23200 |
|
23201 | ascending: function ascending(key) {
|
23202 | requires(key, 'undefined is not a valid key');
|
23203 | this._order = key;
|
23204 | return this;
|
23205 | },
|
23206 |
|
23207 | |
23208 |
|
23209 |
|
23210 |
|
23211 |
|
23212 |
|
23213 |
|
23214 | addAscending: function addAscending(key) {
|
23215 | requires(key, 'undefined is not a valid key');
|
23216 | if (this._order) this._order += ',' + key;else this._order = key;
|
23217 | return this;
|
23218 | },
|
23219 |
|
23220 | |
23221 |
|
23222 |
|
23223 |
|
23224 |
|
23225 |
|
23226 | descending: function descending(key) {
|
23227 | requires(key, 'undefined is not a valid key');
|
23228 | this._order = '-' + key;
|
23229 | return this;
|
23230 | },
|
23231 |
|
23232 | |
23233 |
|
23234 |
|
23235 |
|
23236 |
|
23237 |
|
23238 |
|
23239 | addDescending: function addDescending(key) {
|
23240 | requires(key, 'undefined is not a valid key');
|
23241 | if (this._order) this._order += ',-' + key;else this._order = '-' + key;
|
23242 | return this;
|
23243 | },
|
23244 |
|
23245 | |
23246 |
|
23247 |
|
23248 |
|
23249 |
|
23250 |
|
23251 |
|
23252 | near: function near(key, point) {
|
23253 | if (!(point instanceof AV.GeoPoint)) {
|
23254 |
|
23255 | point = new AV.GeoPoint(point);
|
23256 | }
|
23257 |
|
23258 | this._addCondition(key, '$nearSphere', point);
|
23259 |
|
23260 | return this;
|
23261 | },
|
23262 |
|
23263 | |
23264 |
|
23265 |
|
23266 |
|
23267 |
|
23268 |
|
23269 |
|
23270 |
|
23271 | withinRadians: function withinRadians(key, point, distance) {
|
23272 | this.near(key, point);
|
23273 |
|
23274 | this._addCondition(key, '$maxDistance', distance);
|
23275 |
|
23276 | return this;
|
23277 | },
|
23278 |
|
23279 | |
23280 |
|
23281 |
|
23282 |
|
23283 |
|
23284 |
|
23285 |
|
23286 |
|
23287 |
|
23288 |
|
23289 | withinMiles: function withinMiles(key, point, distance) {
|
23290 | return this.withinRadians(key, point, distance / 3958.8);
|
23291 | },
|
23292 |
|
23293 | |
23294 |
|
23295 |
|
23296 |
|
23297 |
|
23298 |
|
23299 |
|
23300 |
|
23301 |
|
23302 |
|
23303 | withinKilometers: function withinKilometers(key, point, distance) {
|
23304 | return this.withinRadians(key, point, distance / 6371.0);
|
23305 | },
|
23306 |
|
23307 | |
23308 |
|
23309 |
|
23310 |
|
23311 |
|
23312 |
|
23313 |
|
23314 |
|
23315 |
|
23316 |
|
23317 |
|
23318 | withinGeoBox: function withinGeoBox(key, southwest, northeast) {
|
23319 | if (!(southwest instanceof AV.GeoPoint)) {
|
23320 | southwest = new AV.GeoPoint(southwest);
|
23321 | }
|
23322 |
|
23323 | if (!(northeast instanceof AV.GeoPoint)) {
|
23324 | northeast = new AV.GeoPoint(northeast);
|
23325 | }
|
23326 |
|
23327 | this._addCondition(key, '$within', {
|
23328 | $box: [southwest, northeast]
|
23329 | });
|
23330 |
|
23331 | return this;
|
23332 | },
|
23333 |
|
23334 | |
23335 |
|
23336 |
|
23337 |
|
23338 |
|
23339 |
|
23340 | include: function include(keys) {
|
23341 | var _this4 = this;
|
23342 |
|
23343 | requires(keys, 'undefined is not a valid key');
|
23344 |
|
23345 | _.forEach(arguments, function (keys) {
|
23346 | var _context;
|
23347 |
|
23348 | _this4._include = (0, _concat.default)(_context = _this4._include).call(_context, ensureArray(keys));
|
23349 | });
|
23350 |
|
23351 | return this;
|
23352 | },
|
23353 |
|
23354 | |
23355 |
|
23356 |
|
23357 |
|
23358 |
|
23359 | includeACL: function includeACL() {
|
23360 | var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
23361 | this._includeACL = value;
|
23362 | return this;
|
23363 | },
|
23364 |
|
23365 | |
23366 |
|
23367 |
|
23368 |
|
23369 |
|
23370 |
|
23371 |
|
23372 | select: function select(keys) {
|
23373 | var _this5 = this;
|
23374 |
|
23375 | requires(keys, 'undefined is not a valid key');
|
23376 |
|
23377 | _.forEach(arguments, function (keys) {
|
23378 | var _context2;
|
23379 |
|
23380 | _this5._select = (0, _concat.default)(_context2 = _this5._select).call(_context2, ensureArray(keys));
|
23381 | });
|
23382 |
|
23383 | return this;
|
23384 | },
|
23385 |
|
23386 | |
23387 |
|
23388 |
|
23389 |
|
23390 |
|
23391 |
|
23392 |
|
23393 |
|
23394 |
|
23395 |
|
23396 |
|
23397 |
|
23398 | each: function each(callback) {
|
23399 | var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
23400 |
|
23401 | if (this._order || this._skip || this._limit >= 0) {
|
23402 | var error = new Error('Cannot iterate on a query with sort, skip, or limit.');
|
23403 | return _promise.default.reject(error);
|
23404 | }
|
23405 |
|
23406 | var query = new AV.Query(this.objectClass);
|
23407 |
|
23408 |
|
23409 | query._limit = options.batchSize || 100;
|
23410 | query._where = _.clone(this._where);
|
23411 | query._include = _.clone(this._include);
|
23412 | query.ascending('objectId');
|
23413 | var finished = false;
|
23414 | return continueWhile(function () {
|
23415 | return !finished;
|
23416 | }, function () {
|
23417 | return (0, _find.default)(query).call(query, options).then(function (results) {
|
23418 | var callbacksDone = _promise.default.resolve();
|
23419 |
|
23420 | _.each(results, function (result) {
|
23421 | callbacksDone = callbacksDone.then(function () {
|
23422 | return callback(result);
|
23423 | });
|
23424 | });
|
23425 |
|
23426 | return callbacksDone.then(function () {
|
23427 | if (results.length >= query._limit) {
|
23428 | query.greaterThan('objectId', results[results.length - 1].id);
|
23429 | } else {
|
23430 | finished = true;
|
23431 | }
|
23432 | });
|
23433 | });
|
23434 | });
|
23435 | },
|
23436 |
|
23437 | |
23438 |
|
23439 |
|
23440 |
|
23441 |
|
23442 |
|
23443 |
|
23444 |
|
23445 | subscribe: function subscribe(options) {
|
23446 | return AV.LiveQuery.init(this, options);
|
23447 | }
|
23448 | });
|
23449 |
|
23450 | AV.FriendShipQuery = AV.Query._extend({
|
23451 | _newObject: function _newObject() {
|
23452 | var UserClass = AV.Object._getSubclass('_User');
|
23453 |
|
23454 | return new UserClass();
|
23455 | },
|
23456 | _processResult: function _processResult(json) {
|
23457 | if (json && json[this._friendshipTag]) {
|
23458 | var user = json[this._friendshipTag];
|
23459 |
|
23460 | if (user.__type === 'Pointer' && user.className === '_User') {
|
23461 | delete user.__type;
|
23462 | delete user.className;
|
23463 | }
|
23464 |
|
23465 | return user;
|
23466 | } else {
|
23467 | return null;
|
23468 | }
|
23469 | }
|
23470 | });
|
23471 | };
|
23472 |
|
23473 | }),
|
23474 |
|
23475 | (function(module, exports, __webpack_require__) {
|
23476 |
|
23477 | "use strict";
|
23478 |
|
23479 |
|
23480 | var _interopRequireDefault = __webpack_require__(1);
|
23481 |
|
23482 | var _promise = _interopRequireDefault(__webpack_require__(12));
|
23483 |
|
23484 | var _keys = _interopRequireDefault(__webpack_require__(59));
|
23485 |
|
23486 | var _ = __webpack_require__(3);
|
23487 |
|
23488 | var EventEmitter = __webpack_require__(236);
|
23489 |
|
23490 | var _require = __webpack_require__(30),
|
23491 | inherits = _require.inherits;
|
23492 |
|
23493 | var _require2 = __webpack_require__(27),
|
23494 | request = _require2.request;
|
23495 |
|
23496 | var subscribe = function subscribe(queryJSON, subscriptionId) {
|
23497 | return request({
|
23498 | method: 'POST',
|
23499 | path: '/LiveQuery/subscribe',
|
23500 | data: {
|
23501 | query: queryJSON,
|
23502 | id: subscriptionId
|
23503 | }
|
23504 | });
|
23505 | };
|
23506 |
|
23507 | module.exports = function (AV) {
|
23508 | var requireRealtime = function requireRealtime() {
|
23509 | if (!AV._config.realtime) {
|
23510 | throw new Error('LiveQuery not supported. Please use the LiveQuery bundle. https://url.leanapp.cn/enable-live-query');
|
23511 | }
|
23512 | };
|
23513 | |
23514 |
|
23515 |
|
23516 |
|
23517 |
|
23518 |
|
23519 |
|
23520 | AV.LiveQuery = inherits(EventEmitter,
|
23521 |
|
23522 | {
|
23523 | constructor: function constructor(id, client, queryJSON, subscriptionId) {
|
23524 | var _this = this;
|
23525 |
|
23526 | EventEmitter.apply(this);
|
23527 | this.id = id;
|
23528 | this._client = client;
|
23529 |
|
23530 | this._client.register(this);
|
23531 |
|
23532 | this._queryJSON = queryJSON;
|
23533 | this._subscriptionId = subscriptionId;
|
23534 | this._onMessage = this._dispatch.bind(this);
|
23535 |
|
23536 | this._onReconnect = function () {
|
23537 | subscribe(_this._queryJSON, _this._subscriptionId).catch(function (error) {
|
23538 | return console.error("LiveQuery resubscribe error: ".concat(error.message));
|
23539 | });
|
23540 | };
|
23541 |
|
23542 | client.on('message', this._onMessage);
|
23543 | client.on('reconnect', this._onReconnect);
|
23544 | },
|
23545 | _dispatch: function _dispatch(message) {
|
23546 | var _this2 = this;
|
23547 |
|
23548 | message.forEach(function (_ref) {
|
23549 | var op = _ref.op,
|
23550 | object = _ref.object,
|
23551 | queryId = _ref.query_id,
|
23552 | updatedKeys = _ref.updatedKeys;
|
23553 | if (queryId !== _this2.id) return;
|
23554 | var target = AV.parseJSON(_.extend({
|
23555 | __type: object.className === '_File' ? 'File' : 'Object'
|
23556 | }, object));
|
23557 |
|
23558 | if (updatedKeys) {
|
23559 | |
23560 |
|
23561 |
|
23562 |
|
23563 |
|
23564 |
|
23565 |
|
23566 | |
23567 |
|
23568 |
|
23569 |
|
23570 |
|
23571 |
|
23572 |
|
23573 | |
23574 |
|
23575 |
|
23576 |
|
23577 |
|
23578 |
|
23579 | _this2.emit(op, target, updatedKeys);
|
23580 | } else {
|
23581 | |
23582 |
|
23583 |
|
23584 |
|
23585 |
|
23586 |
|
23587 | |
23588 |
|
23589 |
|
23590 |
|
23591 |
|
23592 | _this2.emit(op, target);
|
23593 | }
|
23594 | });
|
23595 | },
|
23596 |
|
23597 | |
23598 |
|
23599 |
|
23600 |
|
23601 |
|
23602 | unsubscribe: function unsubscribe() {
|
23603 | var client = this._client;
|
23604 | client.off('message', this._onMessage);
|
23605 | client.off('reconnect', this._onReconnect);
|
23606 | client.deregister(this);
|
23607 | return request({
|
23608 | method: 'POST',
|
23609 | path: '/LiveQuery/unsubscribe',
|
23610 | data: {
|
23611 | id: client.id,
|
23612 | query_id: this.id
|
23613 | }
|
23614 | });
|
23615 | }
|
23616 | },
|
23617 |
|
23618 | {
|
23619 | init: function init(query) {
|
23620 | var _ref2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
23621 | _ref2$subscriptionId = _ref2.subscriptionId,
|
23622 | userDefinedSubscriptionId = _ref2$subscriptionId === void 0 ? AV._getSubscriptionId() : _ref2$subscriptionId;
|
23623 |
|
23624 | requireRealtime();
|
23625 | if (!(query instanceof AV.Query)) throw new TypeError('LiveQuery must be inited with a Query');
|
23626 | return _promise.default.resolve(userDefinedSubscriptionId).then(function (subscriptionId) {
|
23627 | return AV._config.realtime.createLiveQueryClient(subscriptionId).then(function (liveQueryClient) {
|
23628 | var _query$_getParams = query._getParams(),
|
23629 | where = _query$_getParams.where,
|
23630 | keys = (0, _keys.default)(_query$_getParams),
|
23631 | returnACL = _query$_getParams.returnACL;
|
23632 |
|
23633 | var queryJSON = {
|
23634 | where: where,
|
23635 | keys: keys,
|
23636 | returnACL: returnACL,
|
23637 | className: query.className
|
23638 | };
|
23639 | var promise = subscribe(queryJSON, subscriptionId).then(function (_ref3) {
|
23640 | var queryId = _ref3.query_id;
|
23641 | return new AV.LiveQuery(queryId, liveQueryClient, queryJSON, subscriptionId);
|
23642 | }).finally(function () {
|
23643 | liveQueryClient.deregister(promise);
|
23644 | });
|
23645 | liveQueryClient.register(promise);
|
23646 | return promise;
|
23647 | });
|
23648 | });
|
23649 | },
|
23650 |
|
23651 | |
23652 |
|
23653 |
|
23654 |
|
23655 |
|
23656 | pause: function pause() {
|
23657 | requireRealtime();
|
23658 | return AV._config.realtime.pause();
|
23659 | },
|
23660 |
|
23661 | |
23662 |
|
23663 |
|
23664 |
|
23665 |
|
23666 | resume: function resume() {
|
23667 | requireRealtime();
|
23668 | return AV._config.realtime.resume();
|
23669 | }
|
23670 | });
|
23671 | };
|
23672 |
|
23673 | }),
|
23674 |
|
23675 | (function(module, exports, __webpack_require__) {
|
23676 |
|
23677 | "use strict";
|
23678 |
|
23679 |
|
23680 | var _ = __webpack_require__(3);
|
23681 |
|
23682 | var _require = __webpack_require__(30),
|
23683 | tap = _require.tap;
|
23684 |
|
23685 | module.exports = function (AV) {
|
23686 | |
23687 |
|
23688 |
|
23689 |
|
23690 |
|
23691 |
|
23692 |
|
23693 |
|
23694 |
|
23695 |
|
23696 |
|
23697 |
|
23698 |
|
23699 |
|
23700 | AV.Captcha = function Captcha(options, authOptions) {
|
23701 | this._options = options;
|
23702 | this._authOptions = authOptions;
|
23703 | |
23704 |
|
23705 |
|
23706 |
|
23707 |
|
23708 | this.url = undefined;
|
23709 | |
23710 |
|
23711 |
|
23712 |
|
23713 |
|
23714 | this.captchaToken = undefined;
|
23715 | |
23716 |
|
23717 |
|
23718 |
|
23719 |
|
23720 | this.validateToken = undefined;
|
23721 | };
|
23722 | |
23723 |
|
23724 |
|
23725 |
|
23726 |
|
23727 |
|
23728 | AV.Captcha.prototype.refresh = function refresh() {
|
23729 | var _this = this;
|
23730 |
|
23731 | return AV.Cloud._requestCaptcha(this._options, this._authOptions).then(function (_ref) {
|
23732 | var captchaToken = _ref.captchaToken,
|
23733 | url = _ref.url;
|
23734 |
|
23735 | _.extend(_this, {
|
23736 | captchaToken: captchaToken,
|
23737 | url: url
|
23738 | });
|
23739 |
|
23740 | return url;
|
23741 | });
|
23742 | };
|
23743 | |
23744 |
|
23745 |
|
23746 |
|
23747 |
|
23748 |
|
23749 |
|
23750 | AV.Captcha.prototype.verify = function verify(code) {
|
23751 | var _this2 = this;
|
23752 |
|
23753 | return AV.Cloud.verifyCaptcha(code, this.captchaToken).then(tap(function (validateToken) {
|
23754 | return _this2.validateToken = validateToken;
|
23755 | }));
|
23756 | };
|
23757 |
|
23758 | if (false) {
|
23759 | |
23760 |
|
23761 |
|
23762 |
|
23763 |
|
23764 |
|
23765 |
|
23766 |
|
23767 |
|
23768 |
|
23769 | AV.Captcha.prototype.bind = function bind(_ref2, _ref3) {
|
23770 | var _this3 = this;
|
23771 |
|
23772 | var textInput = _ref2.textInput,
|
23773 | image = _ref2.image,
|
23774 | verifyButton = _ref2.verifyButton;
|
23775 | var success = _ref3.success,
|
23776 | error = _ref3.error;
|
23777 |
|
23778 | if (typeof textInput === 'string') {
|
23779 | textInput = document.getElementById(textInput);
|
23780 | if (!textInput) throw new Error("textInput with id ".concat(textInput, " not found"));
|
23781 | }
|
23782 |
|
23783 | if (typeof image === 'string') {
|
23784 | image = document.getElementById(image);
|
23785 | if (!image) throw new Error("image with id ".concat(image, " not found"));
|
23786 | }
|
23787 |
|
23788 | if (typeof verifyButton === 'string') {
|
23789 | verifyButton = document.getElementById(verifyButton);
|
23790 | if (!verifyButton) throw new Error("verifyButton with id ".concat(verifyButton, " not found"));
|
23791 | }
|
23792 |
|
23793 | this.__refresh = function () {
|
23794 | return _this3.refresh().then(function (url) {
|
23795 | image.src = url;
|
23796 |
|
23797 | if (textInput) {
|
23798 | textInput.value = '';
|
23799 | textInput.focus();
|
23800 | }
|
23801 | }).catch(function (err) {
|
23802 | return console.warn("refresh captcha fail: ".concat(err.message));
|
23803 | });
|
23804 | };
|
23805 |
|
23806 | if (image) {
|
23807 | this.__image = image;
|
23808 | image.src = this.url;
|
23809 | image.addEventListener('click', this.__refresh);
|
23810 | }
|
23811 |
|
23812 | this.__verify = function () {
|
23813 | var code = textInput.value;
|
23814 |
|
23815 | _this3.verify(code).catch(function (err) {
|
23816 | _this3.__refresh();
|
23817 |
|
23818 | throw err;
|
23819 | }).then(success, error).catch(function (err) {
|
23820 | return console.warn("verify captcha fail: ".concat(err.message));
|
23821 | });
|
23822 | };
|
23823 |
|
23824 | if (textInput && verifyButton) {
|
23825 | this.__verifyButton = verifyButton;
|
23826 | verifyButton.addEventListener('click', this.__verify);
|
23827 | }
|
23828 | };
|
23829 | |
23830 |
|
23831 |
|
23832 |
|
23833 |
|
23834 | AV.Captcha.prototype.unbind = function unbind() {
|
23835 | if (this.__image) this.__image.removeEventListener('click', this.__refresh);
|
23836 | if (this.__verifyButton) this.__verifyButton.removeEventListener('click', this.__verify);
|
23837 | };
|
23838 | }
|
23839 | |
23840 |
|
23841 |
|
23842 |
|
23843 |
|
23844 |
|
23845 |
|
23846 |
|
23847 |
|
23848 |
|
23849 |
|
23850 | AV.Captcha.request = function (options, authOptions) {
|
23851 | var captcha = new AV.Captcha(options, authOptions);
|
23852 | return captcha.refresh().then(function () {
|
23853 | return captcha;
|
23854 | });
|
23855 | };
|
23856 | };
|
23857 |
|
23858 | }),
|
23859 |
|
23860 | (function(module, exports, __webpack_require__) {
|
23861 |
|
23862 | "use strict";
|
23863 |
|
23864 |
|
23865 | var _interopRequireDefault = __webpack_require__(1);
|
23866 |
|
23867 | var _promise = _interopRequireDefault(__webpack_require__(12));
|
23868 |
|
23869 | var _ = __webpack_require__(3);
|
23870 |
|
23871 | var _require = __webpack_require__(27),
|
23872 | _request = _require._request,
|
23873 | request = _require.request;
|
23874 |
|
23875 | module.exports = function (AV) {
|
23876 | |
23877 |
|
23878 |
|
23879 |
|
23880 |
|
23881 |
|
23882 |
|
23883 |
|
23884 |
|
23885 | AV.Cloud = AV.Cloud || {};
|
23886 |
|
23887 | _.extend(AV.Cloud,
|
23888 |
|
23889 | {
|
23890 | |
23891 |
|
23892 |
|
23893 |
|
23894 |
|
23895 |
|
23896 |
|
23897 |
|
23898 | run: function run(name, data, options) {
|
23899 | return request({
|
23900 | service: 'engine',
|
23901 | method: 'POST',
|
23902 | path: "/functions/".concat(name),
|
23903 | data: AV._encode(data, null, true),
|
23904 | authOptions: options
|
23905 | }).then(function (resp) {
|
23906 | return AV._decode(resp).result;
|
23907 | });
|
23908 | },
|
23909 |
|
23910 | |
23911 |
|
23912 |
|
23913 |
|
23914 |
|
23915 |
|
23916 |
|
23917 |
|
23918 | rpc: function rpc(name, data, options) {
|
23919 | if (_.isArray(data)) {
|
23920 | return _promise.default.reject(new Error("Can't pass Array as the param of rpc function in JavaScript SDK."));
|
23921 | }
|
23922 |
|
23923 | return request({
|
23924 | service: 'engine',
|
23925 | method: 'POST',
|
23926 | path: "/call/".concat(name),
|
23927 | data: AV._encodeObjectOrArray(data),
|
23928 | authOptions: options
|
23929 | }).then(function (resp) {
|
23930 | return AV._decode(resp).result;
|
23931 | });
|
23932 | },
|
23933 |
|
23934 | |
23935 |
|
23936 |
|
23937 |
|
23938 |
|
23939 |
|
23940 | getServerDate: function getServerDate() {
|
23941 | return _request('date', null, null, 'GET').then(function (resp) {
|
23942 | return AV._decode(resp);
|
23943 | });
|
23944 | },
|
23945 |
|
23946 | |
23947 |
|
23948 |
|
23949 |
|
23950 |
|
23951 |
|
23952 |
|
23953 |
|
23954 |
|
23955 |
|
23956 |
|
23957 | requestSmsCode: function requestSmsCode(data) {
|
23958 | var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
23959 |
|
23960 | if (_.isString(data)) {
|
23961 | data = {
|
23962 | mobilePhoneNumber: data
|
23963 | };
|
23964 | }
|
23965 |
|
23966 | if (!data.mobilePhoneNumber) {
|
23967 | throw new Error('Missing mobilePhoneNumber.');
|
23968 | }
|
23969 |
|
23970 | if (options.validateToken) {
|
23971 | data = _.extend({}, data, {
|
23972 | validate_token: options.validateToken
|
23973 | });
|
23974 | }
|
23975 |
|
23976 | return _request('requestSmsCode', null, null, 'POST', data, options);
|
23977 | },
|
23978 |
|
23979 | |
23980 |
|
23981 |
|
23982 |
|
23983 |
|
23984 |
|
23985 |
|
23986 | verifySmsCode: function verifySmsCode(code, phone) {
|
23987 | if (!code) throw new Error('Missing sms code.');
|
23988 | var params = {};
|
23989 |
|
23990 | if (_.isString(phone)) {
|
23991 | params['mobilePhoneNumber'] = phone;
|
23992 | }
|
23993 |
|
23994 | return _request('verifySmsCode', code, null, 'POST', params);
|
23995 | },
|
23996 | _requestCaptcha: function _requestCaptcha(options, authOptions) {
|
23997 | return _request('requestCaptcha', null, null, 'GET', options, authOptions).then(function (_ref) {
|
23998 | var url = _ref.captcha_url,
|
23999 | captchaToken = _ref.captcha_token;
|
24000 | return {
|
24001 | captchaToken: captchaToken,
|
24002 | url: url
|
24003 | };
|
24004 | });
|
24005 | },
|
24006 |
|
24007 | |
24008 |
|
24009 |
|
24010 | requestCaptcha: AV.Captcha.request,
|
24011 |
|
24012 | |
24013 |
|
24014 |
|
24015 |
|
24016 |
|
24017 |
|
24018 |
|
24019 | verifyCaptcha: function verifyCaptcha(code, captchaToken) {
|
24020 | return _request('verifyCaptcha', null, null, 'POST', {
|
24021 | captcha_code: code,
|
24022 | captcha_token: captchaToken
|
24023 | }).then(function (_ref2) {
|
24024 | var validateToken = _ref2.validate_token;
|
24025 | return validateToken;
|
24026 | });
|
24027 | }
|
24028 | });
|
24029 | };
|
24030 |
|
24031 | }),
|
24032 |
|
24033 | (function(module, exports, __webpack_require__) {
|
24034 |
|
24035 | "use strict";
|
24036 |
|
24037 |
|
24038 | var request = __webpack_require__(27).request;
|
24039 |
|
24040 | module.exports = function (AV) {
|
24041 | AV.Installation = AV.Object.extend('_Installation');
|
24042 | |
24043 |
|
24044 |
|
24045 |
|
24046 | AV.Push = AV.Push || {};
|
24047 | |
24048 |
|
24049 |
|
24050 |
|
24051 |
|
24052 |
|
24053 |
|
24054 |
|
24055 |
|
24056 |
|
24057 |
|
24058 |
|
24059 |
|
24060 |
|
24061 |
|
24062 |
|
24063 |
|
24064 |
|
24065 |
|
24066 | AV.Push.send = function (data, options) {
|
24067 | if (data.where) {
|
24068 | data.where = data.where._getParams().where;
|
24069 | }
|
24070 |
|
24071 | if (data.where && data.cql) {
|
24072 | throw new Error("Both where and cql can't be set");
|
24073 | }
|
24074 |
|
24075 | if (data.push_time) {
|
24076 | data.push_time = data.push_time.toJSON();
|
24077 | }
|
24078 |
|
24079 | if (data.expiration_time) {
|
24080 | data.expiration_time = data.expiration_time.toJSON();
|
24081 | }
|
24082 |
|
24083 | if (data.expiration_time && data.expiration_interval) {
|
24084 | throw new Error("Both expiration_time and expiration_interval can't be set");
|
24085 | }
|
24086 |
|
24087 | return request({
|
24088 | service: 'push',
|
24089 | method: 'POST',
|
24090 | path: '/push',
|
24091 | data: data,
|
24092 | authOptions: options
|
24093 | });
|
24094 | };
|
24095 | };
|
24096 |
|
24097 | }),
|
24098 |
|
24099 | (function(module, exports, __webpack_require__) {
|
24100 |
|
24101 | "use strict";
|
24102 |
|
24103 |
|
24104 | var _interopRequireDefault = __webpack_require__(1);
|
24105 |
|
24106 | var _promise = _interopRequireDefault(__webpack_require__(12));
|
24107 |
|
24108 | var _typeof2 = _interopRequireDefault(__webpack_require__(73));
|
24109 |
|
24110 | var _ = __webpack_require__(3);
|
24111 |
|
24112 | var AVRequest = __webpack_require__(27)._request;
|
24113 |
|
24114 | var _require = __webpack_require__(30),
|
24115 | getSessionToken = _require.getSessionToken;
|
24116 |
|
24117 | module.exports = function (AV) {
|
24118 | var getUser = function getUser() {
|
24119 | var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
24120 | var sessionToken = getSessionToken(options);
|
24121 |
|
24122 | if (sessionToken) {
|
24123 | return AV.User._fetchUserBySessionToken(getSessionToken(options));
|
24124 | }
|
24125 |
|
24126 | return AV.User.currentAsync();
|
24127 | };
|
24128 |
|
24129 | var getUserPointer = function getUserPointer(options) {
|
24130 | return getUser(options).then(function (currUser) {
|
24131 | return AV.Object.createWithoutData('_User', currUser.id)._toPointer();
|
24132 | });
|
24133 | };
|
24134 | |
24135 |
|
24136 |
|
24137 |
|
24138 |
|
24139 |
|
24140 | AV.Status = function (imageUrl, message) {
|
24141 | this.data = {};
|
24142 | this.inboxType = 'default';
|
24143 | this.query = null;
|
24144 |
|
24145 | if (imageUrl && (0, _typeof2.default)(imageUrl) === 'object') {
|
24146 | this.data = imageUrl;
|
24147 | } else {
|
24148 | if (imageUrl) {
|
24149 | this.data.image = imageUrl;
|
24150 | }
|
24151 |
|
24152 | if (message) {
|
24153 | this.data.message = message;
|
24154 | }
|
24155 | }
|
24156 |
|
24157 | return this;
|
24158 | };
|
24159 |
|
24160 | _.extend(AV.Status.prototype,
|
24161 |
|
24162 | {
|
24163 | |
24164 |
|
24165 |
|
24166 |
|
24167 | get: function get(attr) {
|
24168 | return this.data[attr];
|
24169 | },
|
24170 |
|
24171 | |
24172 |
|
24173 |
|
24174 |
|
24175 |
|
24176 | set: function set(key, value) {
|
24177 | this.data[key] = value;
|
24178 | return this;
|
24179 | },
|
24180 |
|
24181 | |
24182 |
|
24183 |
|
24184 |
|
24185 |
|
24186 |
|
24187 | destroy: function destroy(options) {
|
24188 | if (!this.id) return _promise.default.reject(new Error('The status id is not exists.'));
|
24189 | var request = AVRequest('statuses', null, this.id, 'DELETE', options);
|
24190 | return request;
|
24191 | },
|
24192 |
|
24193 | |
24194 |
|
24195 |
|
24196 |
|
24197 | toObject: function toObject() {
|
24198 | if (!this.id) return null;
|
24199 | return AV.Object.createWithoutData('_Status', this.id);
|
24200 | },
|
24201 | _getDataJSON: function _getDataJSON() {
|
24202 | var json = _.clone(this.data);
|
24203 |
|
24204 | return AV._encode(json);
|
24205 | },
|
24206 |
|
24207 | |
24208 |
|
24209 |
|
24210 |
|
24211 |
|
24212 |
|
24213 |
|
24214 |
|
24215 |
|
24216 |
|
24217 |
|
24218 |
|
24219 |
|
24220 |
|
24221 |
|
24222 |
|
24223 |
|
24224 |
|
24225 | send: function send() {
|
24226 | var _this = this;
|
24227 |
|
24228 | var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
24229 |
|
24230 | if (!getSessionToken(options) && !AV.User.current()) {
|
24231 | throw new Error('Please signin an user.');
|
24232 | }
|
24233 |
|
24234 | if (!this.query) {
|
24235 | return AV.Status.sendStatusToFollowers(this, options);
|
24236 | }
|
24237 |
|
24238 | return getUserPointer(options).then(function (currUser) {
|
24239 | var query = _this.query._getParams();
|
24240 |
|
24241 | query.className = _this.query.className;
|
24242 | var data = {};
|
24243 | data.query = query;
|
24244 | _this.data = _this.data || {};
|
24245 | _this.data.source = _this.data.source || currUser;
|
24246 | data.data = _this._getDataJSON();
|
24247 | data.inboxType = _this.inboxType || 'default';
|
24248 | return AVRequest('statuses', null, null, 'POST', data, options);
|
24249 | }).then(function (response) {
|
24250 | _this.id = response.objectId;
|
24251 | _this.createdAt = AV._parseDate(response.createdAt);
|
24252 | return _this;
|
24253 | });
|
24254 | },
|
24255 | _finishFetch: function _finishFetch(serverData) {
|
24256 | this.id = serverData.objectId;
|
24257 | this.createdAt = AV._parseDate(serverData.createdAt);
|
24258 | this.updatedAt = AV._parseDate(serverData.updatedAt);
|
24259 | this.messageId = serverData.messageId;
|
24260 | delete serverData.messageId;
|
24261 | delete serverData.objectId;
|
24262 | delete serverData.createdAt;
|
24263 | delete serverData.updatedAt;
|
24264 | this.data = AV._decode(serverData);
|
24265 | }
|
24266 | });
|
24267 | |
24268 |
|
24269 |
|
24270 |
|
24271 |
|
24272 |
|
24273 |
|
24274 |
|
24275 |
|
24276 |
|
24277 |
|
24278 |
|
24279 |
|
24280 |
|
24281 |
|
24282 |
|
24283 |
|
24284 |
|
24285 | AV.Status.sendStatusToFollowers = function (status) {
|
24286 | var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
24287 |
|
24288 | if (!getSessionToken(options) && !AV.User.current()) {
|
24289 | throw new Error('Please signin an user.');
|
24290 | }
|
24291 |
|
24292 | return getUserPointer(options).then(function (currUser) {
|
24293 | var query = {};
|
24294 | query.className = '_Follower';
|
24295 | query.keys = 'follower';
|
24296 | query.where = {
|
24297 | user: currUser
|
24298 | };
|
24299 | var data = {};
|
24300 | data.query = query;
|
24301 | status.data = status.data || {};
|
24302 | status.data.source = status.data.source || currUser;
|
24303 | data.data = status._getDataJSON();
|
24304 | data.inboxType = status.inboxType || 'default';
|
24305 | var request = AVRequest('statuses', null, null, 'POST', data, options);
|
24306 | return request.then(function (response) {
|
24307 | status.id = response.objectId;
|
24308 | status.createdAt = AV._parseDate(response.createdAt);
|
24309 | return status;
|
24310 | });
|
24311 | });
|
24312 | };
|
24313 | |
24314 |
|
24315 |
|
24316 |
|
24317 |
|
24318 |
|
24319 |
|
24320 |
|
24321 |
|
24322 |
|
24323 |
|
24324 |
|
24325 |
|
24326 |
|
24327 |
|
24328 |
|
24329 |
|
24330 |
|
24331 |
|
24332 |
|
24333 | AV.Status.sendPrivateStatus = function (status, target) {
|
24334 | var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
24335 |
|
24336 | if (!getSessionToken(options) && !AV.User.current()) {
|
24337 | throw new Error('Please signin an user.');
|
24338 | }
|
24339 |
|
24340 | if (!target) {
|
24341 | throw new Error('Invalid target user.');
|
24342 | }
|
24343 |
|
24344 | var userObjectId = _.isString(target) ? target : target.id;
|
24345 |
|
24346 | if (!userObjectId) {
|
24347 | throw new Error('Invalid target user.');
|
24348 | }
|
24349 |
|
24350 | return getUserPointer(options).then(function (currUser) {
|
24351 | var query = {};
|
24352 | query.className = '_User';
|
24353 | query.where = {
|
24354 | objectId: userObjectId
|
24355 | };
|
24356 | var data = {};
|
24357 | data.query = query;
|
24358 | status.data = status.data || {};
|
24359 | status.data.source = status.data.source || currUser;
|
24360 | data.data = status._getDataJSON();
|
24361 | data.inboxType = 'private';
|
24362 | status.inboxType = 'private';
|
24363 | var request = AVRequest('statuses', null, null, 'POST', data, options);
|
24364 | return request.then(function (response) {
|
24365 | status.id = response.objectId;
|
24366 | status.createdAt = AV._parseDate(response.createdAt);
|
24367 | return status;
|
24368 | });
|
24369 | });
|
24370 | };
|
24371 | |
24372 |
|
24373 |
|
24374 |
|
24375 |
|
24376 |
|
24377 |
|
24378 |
|
24379 |
|
24380 |
|
24381 |
|
24382 |
|
24383 |
|
24384 |
|
24385 |
|
24386 |
|
24387 | AV.Status.countUnreadStatuses = function (owner) {
|
24388 | var inboxType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'default';
|
24389 | var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
24390 | if (!_.isString(inboxType)) options = inboxType;
|
24391 |
|
24392 | if (!getSessionToken(options) && owner == null && !AV.User.current()) {
|
24393 | throw new Error('Please signin an user or pass the owner objectId.');
|
24394 | }
|
24395 |
|
24396 | return _promise.default.resolve(owner || getUser(options)).then(function (owner) {
|
24397 | var params = {};
|
24398 | params.inboxType = AV._encode(inboxType);
|
24399 | params.owner = AV._encode(owner);
|
24400 | return AVRequest('subscribe/statuses/count', null, null, 'GET', params, options);
|
24401 | });
|
24402 | };
|
24403 | |
24404 |
|
24405 |
|
24406 |
|
24407 |
|
24408 |
|
24409 |
|
24410 |
|
24411 |
|
24412 |
|
24413 |
|
24414 |
|
24415 |
|
24416 |
|
24417 |
|
24418 |
|
24419 | AV.Status.resetUnreadCount = function (owner) {
|
24420 | var inboxType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'default';
|
24421 | var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
24422 | if (!_.isString(inboxType)) options = inboxType;
|
24423 |
|
24424 | if (!getSessionToken(options) && owner == null && !AV.User.current()) {
|
24425 | throw new Error('Please signin an user or pass the owner objectId.');
|
24426 | }
|
24427 |
|
24428 | return _promise.default.resolve(owner || getUser(options)).then(function (owner) {
|
24429 | var params = {};
|
24430 | params.inboxType = AV._encode(inboxType);
|
24431 | params.owner = AV._encode(owner);
|
24432 | return AVRequest('subscribe/statuses/resetUnreadCount', null, null, 'POST', params, options);
|
24433 | });
|
24434 | };
|
24435 | |
24436 |
|
24437 |
|
24438 |
|
24439 |
|
24440 |
|
24441 |
|
24442 |
|
24443 |
|
24444 |
|
24445 |
|
24446 |
|
24447 |
|
24448 |
|
24449 | AV.Status.statusQuery = function (source) {
|
24450 | var query = new AV.Query('_Status');
|
24451 |
|
24452 | if (source) {
|
24453 | query.equalTo('source', source);
|
24454 | }
|
24455 |
|
24456 | return query;
|
24457 | };
|
24458 | |
24459 |
|
24460 |
|
24461 |
|
24462 |
|
24463 |
|
24464 | AV.InboxQuery = AV.Query._extend(
|
24465 |
|
24466 | {
|
24467 | _objectClass: AV.Status,
|
24468 | _sinceId: 0,
|
24469 | _maxId: 0,
|
24470 | _inboxType: 'default',
|
24471 | _owner: null,
|
24472 | _newObject: function _newObject() {
|
24473 | return new AV.Status();
|
24474 | },
|
24475 | _createRequest: function _createRequest(params, options) {
|
24476 | return AV.InboxQuery.__super__._createRequest.call(this, params, options, '/subscribe/statuses');
|
24477 | },
|
24478 |
|
24479 | |
24480 |
|
24481 |
|
24482 |
|
24483 |
|
24484 |
|
24485 |
|
24486 | sinceId: function sinceId(id) {
|
24487 | this._sinceId = id;
|
24488 | return this;
|
24489 | },
|
24490 |
|
24491 | |
24492 |
|
24493 |
|
24494 |
|
24495 |
|
24496 |
|
24497 |
|
24498 | maxId: function maxId(id) {
|
24499 | this._maxId = id;
|
24500 | return this;
|
24501 | },
|
24502 |
|
24503 | |
24504 |
|
24505 |
|
24506 |
|
24507 |
|
24508 | owner: function owner(_owner) {
|
24509 | this._owner = _owner;
|
24510 | return this;
|
24511 | },
|
24512 |
|
24513 | |
24514 |
|
24515 |
|
24516 |
|
24517 |
|
24518 | inboxType: function inboxType(type) {
|
24519 | this._inboxType = type;
|
24520 | return this;
|
24521 | },
|
24522 | _getParams: function _getParams() {
|
24523 | var params = AV.InboxQuery.__super__._getParams.call(this);
|
24524 |
|
24525 | params.owner = AV._encode(this._owner);
|
24526 | params.inboxType = AV._encode(this._inboxType);
|
24527 | params.sinceId = AV._encode(this._sinceId);
|
24528 | params.maxId = AV._encode(this._maxId);
|
24529 | return params;
|
24530 | }
|
24531 | });
|
24532 | |
24533 |
|
24534 |
|
24535 |
|
24536 |
|
24537 |
|
24538 |
|
24539 |
|
24540 |
|
24541 |
|
24542 |
|
24543 |
|
24544 |
|
24545 |
|
24546 |
|
24547 |
|
24548 |
|
24549 | AV.Status.inboxQuery = function (owner, inboxType) {
|
24550 | var query = new AV.InboxQuery(AV.Status);
|
24551 |
|
24552 | if (owner) {
|
24553 | query._owner = owner;
|
24554 | }
|
24555 |
|
24556 | if (inboxType) {
|
24557 | query._inboxType = inboxType;
|
24558 | }
|
24559 |
|
24560 | return query;
|
24561 | };
|
24562 | };
|
24563 |
|
24564 | }),
|
24565 |
|
24566 | (function(module, exports, __webpack_require__) {
|
24567 |
|
24568 | "use strict";
|
24569 |
|
24570 |
|
24571 | var _interopRequireDefault = __webpack_require__(1);
|
24572 |
|
24573 | var _stringify = _interopRequireDefault(__webpack_require__(36));
|
24574 |
|
24575 | var _map = _interopRequireDefault(__webpack_require__(35));
|
24576 |
|
24577 | var _ = __webpack_require__(3);
|
24578 |
|
24579 | var AVRequest = __webpack_require__(27)._request;
|
24580 |
|
24581 | module.exports = function (AV) {
|
24582 | |
24583 |
|
24584 |
|
24585 |
|
24586 |
|
24587 |
|
24588 |
|
24589 |
|
24590 |
|
24591 |
|
24592 |
|
24593 | AV.SearchSortBuilder = function () {
|
24594 | this._sortFields = [];
|
24595 | };
|
24596 |
|
24597 | _.extend(AV.SearchSortBuilder.prototype,
|
24598 |
|
24599 | {
|
24600 | _addField: function _addField(key, order, mode, missing) {
|
24601 | var field = {};
|
24602 | field[key] = {
|
24603 | order: order || 'asc',
|
24604 | mode: mode || 'avg',
|
24605 | missing: '_' + (missing || 'last')
|
24606 | };
|
24607 |
|
24608 | this._sortFields.push(field);
|
24609 |
|
24610 | return this;
|
24611 | },
|
24612 |
|
24613 | |
24614 |
|
24615 |
|
24616 |
|
24617 |
|
24618 |
|
24619 |
|
24620 |
|
24621 |
|
24622 |
|
24623 | ascending: function ascending(key, mode, missing) {
|
24624 | return this._addField(key, 'asc', mode, missing);
|
24625 | },
|
24626 |
|
24627 | |
24628 |
|
24629 |
|
24630 |
|
24631 |
|
24632 |
|
24633 |
|
24634 |
|
24635 |
|
24636 |
|
24637 | descending: function descending(key, mode, missing) {
|
24638 | return this._addField(key, 'desc', mode, missing);
|
24639 | },
|
24640 |
|
24641 | |
24642 |
|
24643 |
|
24644 |
|
24645 |
|
24646 |
|
24647 |
|
24648 |
|
24649 | whereNear: function whereNear(key, point, options) {
|
24650 | options = options || {};
|
24651 | var field = {};
|
24652 | var geo = {
|
24653 | lat: point.latitude,
|
24654 | lon: point.longitude
|
24655 | };
|
24656 | var m = {
|
24657 | order: options.order || 'asc',
|
24658 | mode: options.mode || 'avg',
|
24659 | unit: options.unit || 'km'
|
24660 | };
|
24661 | m[key] = geo;
|
24662 | field['_geo_distance'] = m;
|
24663 |
|
24664 | this._sortFields.push(field);
|
24665 |
|
24666 | return this;
|
24667 | },
|
24668 |
|
24669 | |
24670 |
|
24671 |
|
24672 |
|
24673 | build: function build() {
|
24674 | return (0, _stringify.default)(AV._encode(this._sortFields));
|
24675 | }
|
24676 | });
|
24677 | |
24678 |
|
24679 |
|
24680 |
|
24681 |
|
24682 |
|
24683 |
|
24684 |
|
24685 |
|
24686 |
|
24687 |
|
24688 |
|
24689 |
|
24690 |
|
24691 |
|
24692 |
|
24693 |
|
24694 | AV.SearchQuery = AV.Query._extend(
|
24695 |
|
24696 | {
|
24697 | _sid: null,
|
24698 | _hits: 0,
|
24699 | _queryString: null,
|
24700 | _highlights: null,
|
24701 | _sortBuilder: null,
|
24702 | _clazz: null,
|
24703 | constructor: function constructor(className) {
|
24704 | if (className) {
|
24705 | this._clazz = className;
|
24706 | } else {
|
24707 | className = '__INVALID_CLASS';
|
24708 | }
|
24709 |
|
24710 | AV.Query.call(this, className);
|
24711 | },
|
24712 | _createRequest: function _createRequest(params, options) {
|
24713 | return AVRequest('search/select', null, null, 'GET', params || this._getParams(), options);
|
24714 | },
|
24715 |
|
24716 | |
24717 |
|
24718 |
|
24719 |
|
24720 |
|
24721 | sid: function sid(_sid) {
|
24722 | this._sid = _sid;
|
24723 | return this;
|
24724 | },
|
24725 |
|
24726 | |
24727 |
|
24728 |
|
24729 |
|
24730 |
|
24731 | queryString: function queryString(q) {
|
24732 | this._queryString = q;
|
24733 | return this;
|
24734 | },
|
24735 |
|
24736 | |
24737 |
|
24738 |
|
24739 |
|
24740 |
|
24741 |
|
24742 |
|
24743 |
|
24744 |
|
24745 |
|
24746 | highlights: function highlights(_highlights) {
|
24747 | var objects;
|
24748 |
|
24749 | if (_highlights && _.isString(_highlights)) {
|
24750 | objects = _.toArray(arguments);
|
24751 | } else {
|
24752 | objects = _highlights;
|
24753 | }
|
24754 |
|
24755 | this._highlights = objects;
|
24756 | return this;
|
24757 | },
|
24758 |
|
24759 | |
24760 |
|
24761 |
|
24762 |
|
24763 |
|
24764 |
|
24765 |
|
24766 | sortBy: function sortBy(builder) {
|
24767 | this._sortBuilder = builder;
|
24768 | return this;
|
24769 | },
|
24770 |
|
24771 | |
24772 |
|
24773 |
|
24774 |
|
24775 | hits: function hits() {
|
24776 | if (!this._hits) {
|
24777 | this._hits = 0;
|
24778 | }
|
24779 |
|
24780 | return this._hits;
|
24781 | },
|
24782 | _processResult: function _processResult(json) {
|
24783 | delete json['className'];
|
24784 | delete json['_app_url'];
|
24785 | delete json['_deeplink'];
|
24786 | return json;
|
24787 | },
|
24788 |
|
24789 | |
24790 |
|
24791 |
|
24792 |
|
24793 |
|
24794 |
|
24795 | hasMore: function hasMore() {
|
24796 | return !this._hitEnd;
|
24797 | },
|
24798 |
|
24799 | |
24800 |
|
24801 |
|
24802 |
|
24803 | reset: function reset() {
|
24804 | this._hitEnd = false;
|
24805 | this._sid = null;
|
24806 | this._hits = 0;
|
24807 | },
|
24808 |
|
24809 | |
24810 |
|
24811 |
|
24812 |
|
24813 |
|
24814 |
|
24815 |
|
24816 |
|
24817 |
|
24818 |
|
24819 | find: function find(options) {
|
24820 | var self = this;
|
24821 |
|
24822 | var request = this._createRequest(undefined, options);
|
24823 |
|
24824 | return request.then(function (response) {
|
24825 |
|
24826 | if (response.sid) {
|
24827 | self._oldSid = self._sid;
|
24828 | self._sid = response.sid;
|
24829 | } else {
|
24830 | self._sid = null;
|
24831 | self._hitEnd = true;
|
24832 | }
|
24833 |
|
24834 | self._hits = response.hits || 0;
|
24835 | return (0, _map.default)(_).call(_, response.results, function (json) {
|
24836 | if (json.className) {
|
24837 | response.className = json.className;
|
24838 | }
|
24839 |
|
24840 | var obj = self._newObject(response);
|
24841 |
|
24842 | obj.appURL = json['_app_url'];
|
24843 |
|
24844 | obj._finishFetch(self._processResult(json), true);
|
24845 |
|
24846 | return obj;
|
24847 | });
|
24848 | });
|
24849 | },
|
24850 | _getParams: function _getParams() {
|
24851 | var params = AV.SearchQuery.__super__._getParams.call(this);
|
24852 |
|
24853 | delete params.where;
|
24854 |
|
24855 | if (this._clazz) {
|
24856 | params.clazz = this.className;
|
24857 | }
|
24858 |
|
24859 | if (this._sid) {
|
24860 | params.sid = this._sid;
|
24861 | }
|
24862 |
|
24863 | if (!this._queryString) {
|
24864 | throw new Error('Please set query string.');
|
24865 | } else {
|
24866 | params.q = this._queryString;
|
24867 | }
|
24868 |
|
24869 | if (this._highlights) {
|
24870 | params.highlights = this._highlights.join(',');
|
24871 | }
|
24872 |
|
24873 | if (this._sortBuilder && params.order) {
|
24874 | throw new Error('sort and order can not be set at same time.');
|
24875 | }
|
24876 |
|
24877 | if (this._sortBuilder) {
|
24878 | params.sort = this._sortBuilder.build();
|
24879 | }
|
24880 |
|
24881 | return params;
|
24882 | }
|
24883 | });
|
24884 | };
|
24885 |
|
24886 |
|
24887 |
|
24888 |
|
24889 |
|
24890 |
|
24891 |
|
24892 |
|
24893 |
|
24894 |
|
24895 |
|
24896 |
|
24897 |
|
24898 |
|
24899 |
|
24900 |
|
24901 |
|
24902 |
|
24903 |
|
24904 |
|
24905 |
|
24906 |
|
24907 |
|
24908 |
|
24909 |
|
24910 |
|
24911 |
|
24912 |
|
24913 |
|
24914 |
|
24915 |
|
24916 |
|
24917 |
|
24918 |
|
24919 |
|
24920 |
|
24921 |
|
24922 |
|
24923 |
|
24924 |
|
24925 |
|
24926 |
|
24927 |
|
24928 |
|
24929 |
|
24930 |
|
24931 |
|
24932 |
|
24933 |
|
24934 |
|
24935 |
|
24936 |
|
24937 |
|
24938 |
|
24939 |
|
24940 |
|
24941 |
|
24942 |
|
24943 |
|
24944 | }),
|
24945 |
|
24946 | (function(module, exports, __webpack_require__) {
|
24947 |
|
24948 | "use strict";
|
24949 |
|
24950 |
|
24951 | var _interopRequireDefault = __webpack_require__(1);
|
24952 |
|
24953 | var _promise = _interopRequireDefault(__webpack_require__(12));
|
24954 |
|
24955 | var _ = __webpack_require__(3);
|
24956 |
|
24957 | var AVError = __webpack_require__(46);
|
24958 |
|
24959 | var _require = __webpack_require__(27),
|
24960 | request = _require.request;
|
24961 |
|
24962 | module.exports = function (AV) {
|
24963 | |
24964 |
|
24965 |
|
24966 |
|
24967 |
|
24968 |
|
24969 |
|
24970 |
|
24971 | AV.Insight = AV.Insight || {};
|
24972 |
|
24973 | _.extend(AV.Insight,
|
24974 |
|
24975 | {
|
24976 | |
24977 |
|
24978 |
|
24979 |
|
24980 |
|
24981 |
|
24982 |
|
24983 |
|
24984 |
|
24985 |
|
24986 |
|
24987 |
|
24988 |
|
24989 |
|
24990 |
|
24991 |
|
24992 | startJob: function startJob(jobConfig, options) {
|
24993 | if (!jobConfig || !jobConfig.sql) {
|
24994 | throw new Error('Please provide the sql to run the job.');
|
24995 | }
|
24996 |
|
24997 | var data = {
|
24998 | jobConfig: jobConfig,
|
24999 | appId: AV.applicationId
|
25000 | };
|
25001 | return request({
|
25002 | path: '/bigquery/jobs',
|
25003 | method: 'POST',
|
25004 | data: AV._encode(data, null, true),
|
25005 | authOptions: options,
|
25006 | signKey: false
|
25007 | }).then(function (resp) {
|
25008 | return AV._decode(resp).id;
|
25009 | });
|
25010 | },
|
25011 |
|
25012 | |
25013 |
|
25014 |
|
25015 |
|
25016 |
|
25017 |
|
25018 |
|
25019 |
|
25020 |
|
25021 |
|
25022 | on: function on(event, cb) {}
|
25023 | });
|
25024 | |
25025 |
|
25026 |
|
25027 |
|
25028 |
|
25029 |
|
25030 |
|
25031 |
|
25032 | AV.Insight.JobQuery = function (id, className) {
|
25033 | if (!id) {
|
25034 | throw new Error('Please provide the job id.');
|
25035 | }
|
25036 |
|
25037 | this.id = id;
|
25038 | this.className = className;
|
25039 | this._skip = 0;
|
25040 | this._limit = 100;
|
25041 | };
|
25042 |
|
25043 | _.extend(AV.Insight.JobQuery.prototype,
|
25044 |
|
25045 | {
|
25046 | |
25047 |
|
25048 |
|
25049 |
|
25050 |
|
25051 |
|
25052 |
|
25053 | skip: function skip(n) {
|
25054 | this._skip = n;
|
25055 | return this;
|
25056 | },
|
25057 |
|
25058 | |
25059 |
|
25060 |
|
25061 |
|
25062 |
|
25063 |
|
25064 | limit: function limit(n) {
|
25065 | this._limit = n;
|
25066 | return this;
|
25067 | },
|
25068 |
|
25069 | |
25070 |
|
25071 |
|
25072 |
|
25073 |
|
25074 |
|
25075 |
|
25076 |
|
25077 |
|
25078 |
|
25079 | find: function find(options) {
|
25080 | var params = {
|
25081 | skip: this._skip,
|
25082 | limit: this._limit
|
25083 | };
|
25084 | return request({
|
25085 | path: "/bigquery/jobs/".concat(this.id),
|
25086 | method: 'GET',
|
25087 | query: params,
|
25088 | authOptions: options,
|
25089 | signKey: false
|
25090 | }).then(function (response) {
|
25091 | if (response.error) {
|
25092 | return _promise.default.reject(new AVError(response.code, response.error));
|
25093 | }
|
25094 |
|
25095 | return _promise.default.resolve(response);
|
25096 | });
|
25097 | }
|
25098 | });
|
25099 | };
|
25100 |
|
25101 | }),
|
25102 |
|
25103 | (function(module, exports, __webpack_require__) {
|
25104 |
|
25105 | "use strict";
|
25106 |
|
25107 |
|
25108 | var _interopRequireDefault = __webpack_require__(1);
|
25109 |
|
25110 | var _promise = _interopRequireDefault(__webpack_require__(12));
|
25111 |
|
25112 | var _ = __webpack_require__(3);
|
25113 |
|
25114 | var _require = __webpack_require__(27),
|
25115 | LCRequest = _require.request;
|
25116 |
|
25117 | var _require2 = __webpack_require__(30),
|
25118 | getSessionToken = _require2.getSessionToken;
|
25119 |
|
25120 | module.exports = function (AV) {
|
25121 | var getUserWithSessionToken = function getUserWithSessionToken(authOptions) {
|
25122 | if (authOptions.user) {
|
25123 | if (!authOptions.user._sessionToken) {
|
25124 | throw new Error('authOptions.user is not signed in.');
|
25125 | }
|
25126 |
|
25127 | return _promise.default.resolve(authOptions.user);
|
25128 | }
|
25129 |
|
25130 | if (authOptions.sessionToken) {
|
25131 | return AV.User._fetchUserBySessionToken(authOptions.sessionToken);
|
25132 | }
|
25133 |
|
25134 | return AV.User.currentAsync();
|
25135 | };
|
25136 |
|
25137 | var getSessionTokenAsync = function getSessionTokenAsync(authOptions) {
|
25138 | var sessionToken = getSessionToken(authOptions);
|
25139 |
|
25140 | if (sessionToken) {
|
25141 | return _promise.default.resolve(sessionToken);
|
25142 | }
|
25143 |
|
25144 | return AV.User.currentAsync().then(function (user) {
|
25145 | if (user) {
|
25146 | return user.getSessionToken();
|
25147 | }
|
25148 | });
|
25149 | };
|
25150 | |
25151 |
|
25152 |
|
25153 |
|
25154 |
|
25155 |
|
25156 | AV.Friendship = {
|
25157 | |
25158 |
|
25159 |
|
25160 |
|
25161 |
|
25162 |
|
25163 |
|
25164 |
|
25165 |
|
25166 | request: function request(options) {
|
25167 | var authOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
25168 | var friend;
|
25169 | var attributes;
|
25170 |
|
25171 | if (options.friend) {
|
25172 | friend = options.friend;
|
25173 | attributes = options.attributes;
|
25174 | } else {
|
25175 | friend = options;
|
25176 | }
|
25177 |
|
25178 | var friendObj = _.isString(friend) ? AV.Object.createWithoutData('_User', friend) : friend;
|
25179 | return getUserWithSessionToken(authOptions).then(function (userObj) {
|
25180 | if (!userObj) {
|
25181 | throw new Error('Please signin an user.');
|
25182 | }
|
25183 |
|
25184 | return LCRequest({
|
25185 | method: 'POST',
|
25186 | path: '/users/friendshipRequests',
|
25187 | data: {
|
25188 | user: userObj._toPointer(),
|
25189 | friend: friendObj._toPointer(),
|
25190 | friendship: attributes
|
25191 | },
|
25192 | authOptions: authOptions
|
25193 | });
|
25194 | });
|
25195 | },
|
25196 |
|
25197 | |
25198 |
|
25199 |
|
25200 |
|
25201 |
|
25202 |
|
25203 |
|
25204 |
|
25205 |
|
25206 | acceptRequest: function acceptRequest(options) {
|
25207 | var authOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
25208 | var request;
|
25209 | var attributes;
|
25210 |
|
25211 | if (options.request) {
|
25212 | request = options.request;
|
25213 | attributes = options.attributes;
|
25214 | } else {
|
25215 | request = options;
|
25216 | }
|
25217 |
|
25218 | var requestId = _.isString(request) ? request : request.id;
|
25219 | return getSessionTokenAsync(authOptions).then(function (sessionToken) {
|
25220 | if (!sessionToken) {
|
25221 | throw new Error('Please signin an user.');
|
25222 | }
|
25223 |
|
25224 | return LCRequest({
|
25225 | method: 'PUT',
|
25226 | path: '/users/friendshipRequests/' + requestId + '/accept',
|
25227 | data: {
|
25228 | friendship: AV._encode(attributes)
|
25229 | },
|
25230 | authOptions: authOptions
|
25231 | });
|
25232 | });
|
25233 | },
|
25234 |
|
25235 | |
25236 |
|
25237 |
|
25238 |
|
25239 |
|
25240 |
|
25241 | declineRequest: function declineRequest(request) {
|
25242 | var authOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
25243 | var requestId = _.isString(request) ? request : request.id;
|
25244 | return getSessionTokenAsync(authOptions).then(function (sessionToken) {
|
25245 | if (!sessionToken) {
|
25246 | throw new Error('Please signin an user.');
|
25247 | }
|
25248 |
|
25249 | return LCRequest({
|
25250 | method: 'PUT',
|
25251 | path: '/users/friendshipRequests/' + requestId + '/decline',
|
25252 | authOptions: authOptions
|
25253 | });
|
25254 | });
|
25255 | }
|
25256 | };
|
25257 | };
|
25258 |
|
25259 | }),
|
25260 |
|
25261 | (function(module, exports, __webpack_require__) {
|
25262 |
|
25263 | "use strict";
|
25264 |
|
25265 |
|
25266 | var _interopRequireDefault = __webpack_require__(1);
|
25267 |
|
25268 | var _stringify = _interopRequireDefault(__webpack_require__(36));
|
25269 |
|
25270 | var _ = __webpack_require__(3);
|
25271 |
|
25272 | var _require = __webpack_require__(27),
|
25273 | _request = _require._request;
|
25274 |
|
25275 | var AV = __webpack_require__(69);
|
25276 |
|
25277 | var serializeMessage = function serializeMessage(message) {
|
25278 | if (typeof message === 'string') {
|
25279 | return message;
|
25280 | }
|
25281 |
|
25282 | if (typeof message.getPayload === 'function') {
|
25283 | return (0, _stringify.default)(message.getPayload());
|
25284 | }
|
25285 |
|
25286 | return (0, _stringify.default)(message);
|
25287 | };
|
25288 |
|
25289 |
|
25290 |
|
25291 |
|
25292 |
|
25293 |
|
25294 |
|
25295 |
|
25296 |
|
25297 |
|
25298 |
|
25299 |
|
25300 |
|
25301 |
|
25302 |
|
25303 | module.exports = AV.Object.extend('_Conversation',
|
25304 |
|
25305 | {
|
25306 | constructor: function constructor(name) {
|
25307 | var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
25308 | AV.Object.prototype.constructor.call(this, null, null);
|
25309 | this.set('name', name);
|
25310 |
|
25311 | if (options.isSystem !== undefined) {
|
25312 | this.set('sys', options.isSystem ? true : false);
|
25313 | }
|
25314 |
|
25315 | if (options.isTransient !== undefined) {
|
25316 | this.set('tr', options.isTransient ? true : false);
|
25317 | }
|
25318 | },
|
25319 |
|
25320 | |
25321 |
|
25322 |
|
25323 |
|
25324 |
|
25325 | getCreator: function getCreator() {
|
25326 | return this.get('c');
|
25327 | },
|
25328 |
|
25329 | |
25330 |
|
25331 |
|
25332 |
|
25333 |
|
25334 | getLastMessageAt: function getLastMessageAt() {
|
25335 | return this.get('lm');
|
25336 | },
|
25337 |
|
25338 | |
25339 |
|
25340 |
|
25341 |
|
25342 |
|
25343 | getMembers: function getMembers() {
|
25344 | return this.get('m');
|
25345 | },
|
25346 |
|
25347 | |
25348 |
|
25349 |
|
25350 |
|
25351 |
|
25352 | addMember: function addMember(member) {
|
25353 | return this.add('m', member);
|
25354 | },
|
25355 |
|
25356 | |
25357 |
|
25358 |
|
25359 |
|
25360 |
|
25361 | getMutedMembers: function getMutedMembers() {
|
25362 | return this.get('mu');
|
25363 | },
|
25364 |
|
25365 | |
25366 |
|
25367 |
|
25368 |
|
25369 |
|
25370 | getName: function getName() {
|
25371 | return this.get('name');
|
25372 | },
|
25373 |
|
25374 | |
25375 |
|
25376 |
|
25377 |
|
25378 |
|
25379 | isTransient: function isTransient() {
|
25380 | return this.get('tr');
|
25381 | },
|
25382 |
|
25383 | |
25384 |
|
25385 |
|
25386 |
|
25387 |
|
25388 | isSystem: function isSystem() {
|
25389 | return this.get('sys');
|
25390 | },
|
25391 |
|
25392 | |
25393 |
|
25394 |
|
25395 |
|
25396 |
|
25397 |
|
25398 |
|
25399 |
|
25400 |
|
25401 |
|
25402 |
|
25403 |
|
25404 |
|
25405 |
|
25406 | send: function send(fromClient, message) {
|
25407 | var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
25408 | var authOptions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
25409 | var data = {
|
25410 | from_peer: fromClient,
|
25411 | conv_id: this.id,
|
25412 | transient: false,
|
25413 | message: serializeMessage(message)
|
25414 | };
|
25415 |
|
25416 | if (options.toClients !== undefined) {
|
25417 | data.to_peers = options.toClients;
|
25418 | }
|
25419 |
|
25420 | if (options.transient !== undefined) {
|
25421 | data.transient = options.transient ? true : false;
|
25422 | }
|
25423 |
|
25424 | if (options.pushData !== undefined) {
|
25425 | data.push_data = options.pushData;
|
25426 | }
|
25427 |
|
25428 | return _request('rtm', 'messages', null, 'POST', data, authOptions);
|
25429 | },
|
25430 |
|
25431 | |
25432 |
|
25433 |
|
25434 |
|
25435 |
|
25436 |
|
25437 |
|
25438 |
|
25439 |
|
25440 |
|
25441 |
|
25442 |
|
25443 |
|
25444 | broadcast: function broadcast(fromClient, message) {
|
25445 | var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
25446 | var authOptions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
25447 | var data = {
|
25448 | from_peer: fromClient,
|
25449 | conv_id: this.id,
|
25450 | message: serializeMessage(message)
|
25451 | };
|
25452 |
|
25453 | if (options.pushData !== undefined) {
|
25454 | data.push = options.pushData;
|
25455 | }
|
25456 |
|
25457 | if (options.validTill !== undefined) {
|
25458 | var ts = options.validTill;
|
25459 |
|
25460 | if (_.isDate(ts)) {
|
25461 | ts = ts.getTime();
|
25462 | }
|
25463 |
|
25464 | options.valid_till = ts;
|
25465 | }
|
25466 |
|
25467 | return _request('rtm', 'broadcast', null, 'POST', data, authOptions);
|
25468 | }
|
25469 | });
|
25470 |
|
25471 | }),
|
25472 |
|
25473 | (function(module, exports, __webpack_require__) {
|
25474 |
|
25475 | "use strict";
|
25476 |
|
25477 |
|
25478 | var _interopRequireDefault = __webpack_require__(1);
|
25479 |
|
25480 | var _promise = _interopRequireDefault(__webpack_require__(12));
|
25481 |
|
25482 | var _map = _interopRequireDefault(__webpack_require__(35));
|
25483 |
|
25484 | var _concat = _interopRequireDefault(__webpack_require__(22));
|
25485 |
|
25486 | var _ = __webpack_require__(3);
|
25487 |
|
25488 | var _require = __webpack_require__(27),
|
25489 | request = _require.request;
|
25490 |
|
25491 | var _require2 = __webpack_require__(30),
|
25492 | ensureArray = _require2.ensureArray,
|
25493 | parseDate = _require2.parseDate;
|
25494 |
|
25495 | var AV = __webpack_require__(69);
|
25496 |
|
25497 |
|
25498 |
|
25499 |
|
25500 |
|
25501 |
|
25502 | AV.LeaderboardVersionChangeInterval = {
|
25503 | NEVER: 'never',
|
25504 | DAY: 'day',
|
25505 | WEEK: 'week',
|
25506 | MONTH: 'month'
|
25507 | };
|
25508 |
|
25509 |
|
25510 |
|
25511 |
|
25512 |
|
25513 | AV.LeaderboardOrder = {
|
25514 | ASCENDING: 'ascending',
|
25515 | DESCENDING: 'descending'
|
25516 | };
|
25517 |
|
25518 |
|
25519 |
|
25520 |
|
25521 |
|
25522 | AV.LeaderboardUpdateStrategy = {
|
25523 |
|
25524 | BETTER: 'better',
|
25525 |
|
25526 |
|
25527 | LAST: 'last',
|
25528 |
|
25529 |
|
25530 | SUM: 'sum'
|
25531 | };
|
25532 |
|
25533 |
|
25534 |
|
25535 |
|
25536 |
|
25537 |
|
25538 |
|
25539 |
|
25540 |
|
25541 |
|
25542 |
|
25543 |
|
25544 |
|
25545 |
|
25546 |
|
25547 |
|
25548 |
|
25549 |
|
25550 |
|
25551 |
|
25552 |
|
25553 |
|
25554 | function Statistic(_ref) {
|
25555 | var name = _ref.name,
|
25556 | value = _ref.value,
|
25557 | version = _ref.version;
|
25558 |
|
25559 | |
25560 |
|
25561 |
|
25562 | this.name = name;
|
25563 | |
25564 |
|
25565 |
|
25566 |
|
25567 | this.value = value;
|
25568 | |
25569 |
|
25570 |
|
25571 |
|
25572 | this.version = version;
|
25573 | }
|
25574 |
|
25575 | var parseStatisticData = function parseStatisticData(statisticData) {
|
25576 | var _AV$_decode = AV._decode(statisticData),
|
25577 | name = _AV$_decode.statisticName,
|
25578 | value = _AV$_decode.statisticValue,
|
25579 | version = _AV$_decode.version;
|
25580 |
|
25581 | return new Statistic({
|
25582 | name: name,
|
25583 | value: value,
|
25584 | version: version
|
25585 | });
|
25586 | };
|
25587 |
|
25588 |
|
25589 |
|
25590 |
|
25591 |
|
25592 | AV.Leaderboard = function Leaderboard(statisticName) {
|
25593 | |
25594 |
|
25595 |
|
25596 | this.statisticName = statisticName;
|
25597 | |
25598 |
|
25599 |
|
25600 |
|
25601 | this.order = undefined;
|
25602 | |
25603 |
|
25604 |
|
25605 |
|
25606 | this.updateStrategy = undefined;
|
25607 | |
25608 |
|
25609 |
|
25610 |
|
25611 | this.versionChangeInterval = undefined;
|
25612 | |
25613 |
|
25614 |
|
25615 |
|
25616 | this.version = undefined;
|
25617 | |
25618 |
|
25619 |
|
25620 |
|
25621 | this.nextResetAt = undefined;
|
25622 | |
25623 |
|
25624 |
|
25625 |
|
25626 | this.createdAt = undefined;
|
25627 | };
|
25628 |
|
25629 | var Leaderboard = AV.Leaderboard;
|
25630 |
|
25631 |
|
25632 |
|
25633 |
|
25634 |
|
25635 |
|
25636 | AV.Leaderboard.createWithoutData = function (statisticName) {
|
25637 | return new Leaderboard(statisticName);
|
25638 | };
|
25639 |
|
25640 |
|
25641 |
|
25642 |
|
25643 |
|
25644 |
|
25645 |
|
25646 |
|
25647 |
|
25648 |
|
25649 |
|
25650 |
|
25651 | AV.Leaderboard.createLeaderboard = function (_ref2, authOptions) {
|
25652 | var statisticName = _ref2.statisticName,
|
25653 | order = _ref2.order,
|
25654 | versionChangeInterval = _ref2.versionChangeInterval,
|
25655 | updateStrategy = _ref2.updateStrategy;
|
25656 | return request({
|
25657 | method: 'POST',
|
25658 | path: '/leaderboard/leaderboards',
|
25659 | data: {
|
25660 | statisticName: statisticName,
|
25661 | order: order,
|
25662 | versionChangeInterval: versionChangeInterval,
|
25663 | updateStrategy: updateStrategy
|
25664 | },
|
25665 | authOptions: authOptions
|
25666 | }).then(function (data) {
|
25667 | var leaderboard = new Leaderboard(statisticName);
|
25668 | return leaderboard._finishFetch(data);
|
25669 | });
|
25670 | };
|
25671 |
|
25672 |
|
25673 |
|
25674 |
|
25675 |
|
25676 |
|
25677 |
|
25678 |
|
25679 | AV.Leaderboard.getLeaderboard = function (statisticName, authOptions) {
|
25680 | return Leaderboard.createWithoutData(statisticName).fetch(authOptions);
|
25681 | };
|
25682 |
|
25683 |
|
25684 |
|
25685 |
|
25686 |
|
25687 |
|
25688 |
|
25689 |
|
25690 |
|
25691 |
|
25692 | AV.Leaderboard.getStatistics = function (user) {
|
25693 | var _ref3 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
25694 | statisticNames = _ref3.statisticNames;
|
25695 |
|
25696 | var authOptions = arguments.length > 2 ? arguments[2] : undefined;
|
25697 | return _promise.default.resolve().then(function () {
|
25698 | if (!(user && user.id)) throw new Error('user must be an AV.User');
|
25699 | return request({
|
25700 | method: 'GET',
|
25701 | path: "/leaderboard/users/".concat(user.id, "/statistics"),
|
25702 | query: {
|
25703 | statistics: statisticNames ? ensureArray(statisticNames).join(',') : undefined
|
25704 | },
|
25705 | authOptions: authOptions
|
25706 | }).then(function (_ref4) {
|
25707 | var results = _ref4.results;
|
25708 | return (0, _map.default)(results).call(results, parseStatisticData);
|
25709 | });
|
25710 | });
|
25711 | };
|
25712 |
|
25713 |
|
25714 |
|
25715 |
|
25716 |
|
25717 |
|
25718 |
|
25719 |
|
25720 |
|
25721 |
|
25722 | AV.Leaderboard.updateStatistics = function (user, statistics) {
|
25723 | var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
25724 | return _promise.default.resolve().then(function () {
|
25725 | if (!(user && user.id)) throw new Error('user must be an AV.User');
|
25726 | var data = (0, _map.default)(_).call(_, statistics, function (value, key) {
|
25727 | return {
|
25728 | statisticName: key,
|
25729 | statisticValue: value
|
25730 | };
|
25731 | });
|
25732 | var overwrite = options.overwrite;
|
25733 | return request({
|
25734 | method: 'POST',
|
25735 | path: "/leaderboard/users/".concat(user.id, "/statistics"),
|
25736 | query: {
|
25737 | overwrite: overwrite ? 1 : undefined
|
25738 | },
|
25739 | data: data,
|
25740 | authOptions: options
|
25741 | }).then(function (_ref5) {
|
25742 | var results = _ref5.results;
|
25743 | return (0, _map.default)(results).call(results, parseStatisticData);
|
25744 | });
|
25745 | });
|
25746 | };
|
25747 |
|
25748 |
|
25749 |
|
25750 |
|
25751 |
|
25752 |
|
25753 |
|
25754 |
|
25755 |
|
25756 | AV.Leaderboard.deleteStatistics = function (user, statisticNames, authOptions) {
|
25757 | return _promise.default.resolve().then(function () {
|
25758 | if (!(user && user.id)) throw new Error('user must be an AV.User');
|
25759 | return request({
|
25760 | method: 'DELETE',
|
25761 | path: "/leaderboard/users/".concat(user.id, "/statistics"),
|
25762 | query: {
|
25763 | statistics: ensureArray(statisticNames).join(',')
|
25764 | },
|
25765 | authOptions: authOptions
|
25766 | }).then(function () {
|
25767 | return undefined;
|
25768 | });
|
25769 | });
|
25770 | };
|
25771 |
|
25772 | _.extend(Leaderboard.prototype,
|
25773 |
|
25774 | {
|
25775 | _finishFetch: function _finishFetch(data) {
|
25776 | var _this = this;
|
25777 |
|
25778 | _.forEach(data, function (value, key) {
|
25779 | if (key === 'updatedAt' || key === 'objectId') return;
|
25780 |
|
25781 | if (key === 'expiredAt') {
|
25782 | key = 'nextResetAt';
|
25783 | }
|
25784 |
|
25785 | if (key === 'createdAt') {
|
25786 | value = parseDate(value);
|
25787 | }
|
25788 |
|
25789 | if (value && value.__type === 'Date') {
|
25790 | value = parseDate(value.iso);
|
25791 | }
|
25792 |
|
25793 | _this[key] = value;
|
25794 | });
|
25795 |
|
25796 | return this;
|
25797 | },
|
25798 |
|
25799 | |
25800 |
|
25801 |
|
25802 |
|
25803 |
|
25804 | fetch: function fetch(authOptions) {
|
25805 | var _this2 = this;
|
25806 |
|
25807 | return request({
|
25808 | method: 'GET',
|
25809 | path: "/leaderboard/leaderboards/".concat(this.statisticName),
|
25810 | authOptions: authOptions
|
25811 | }).then(function (data) {
|
25812 | return _this2._finishFetch(data);
|
25813 | });
|
25814 | },
|
25815 |
|
25816 | |
25817 |
|
25818 |
|
25819 |
|
25820 |
|
25821 |
|
25822 |
|
25823 | count: function count() {
|
25824 | var _ref6 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
25825 | version = _ref6.version;
|
25826 |
|
25827 | var authOptions = arguments.length > 1 ? arguments[1] : undefined;
|
25828 | return request({
|
25829 | method: 'GET',
|
25830 | path: "/leaderboard/leaderboards/".concat(this.statisticName, "/ranks"),
|
25831 | query: {
|
25832 | count: 1,
|
25833 | limit: 0,
|
25834 | version: version
|
25835 | },
|
25836 | authOptions: authOptions
|
25837 | }).then(function (_ref7) {
|
25838 | var count = _ref7.count;
|
25839 | return count;
|
25840 | });
|
25841 | },
|
25842 | _getResults: function _getResults(_ref8, authOptions, userId) {
|
25843 | var _context;
|
25844 |
|
25845 | var skip = _ref8.skip,
|
25846 | limit = _ref8.limit,
|
25847 | selectUserKeys = _ref8.selectUserKeys,
|
25848 | includeUserKeys = _ref8.includeUserKeys,
|
25849 | includeStatistics = _ref8.includeStatistics,
|
25850 | version = _ref8.version;
|
25851 | return request({
|
25852 | method: 'GET',
|
25853 | path: (0, _concat.default)(_context = "/leaderboard/leaderboards/".concat(this.statisticName, "/ranks")).call(_context, userId ? "/".concat(userId) : ''),
|
25854 | query: {
|
25855 | skip: skip,
|
25856 | limit: limit,
|
25857 | selectUserKeys: _.union(ensureArray(selectUserKeys), ensureArray(includeUserKeys)).join(',') || undefined,
|
25858 | includeUser: includeUserKeys ? ensureArray(includeUserKeys).join(',') : undefined,
|
25859 | includeStatistics: includeStatistics ? ensureArray(includeStatistics).join(',') : undefined,
|
25860 | version: version
|
25861 | },
|
25862 | authOptions: authOptions
|
25863 | }).then(function (_ref9) {
|
25864 | var rankings = _ref9.results;
|
25865 | return (0, _map.default)(rankings).call(rankings, function (rankingData) {
|
25866 | var _AV$_decode2 = AV._decode(rankingData),
|
25867 | user = _AV$_decode2.user,
|
25868 | value = _AV$_decode2.statisticValue,
|
25869 | rank = _AV$_decode2.rank,
|
25870 | _AV$_decode2$statisti = _AV$_decode2.statistics,
|
25871 | statistics = _AV$_decode2$statisti === void 0 ? [] : _AV$_decode2$statisti;
|
25872 |
|
25873 | return {
|
25874 | user: user,
|
25875 | value: value,
|
25876 | rank: rank,
|
25877 | includedStatistics: (0, _map.default)(statistics).call(statistics, parseStatisticData)
|
25878 | };
|
25879 | });
|
25880 | });
|
25881 | },
|
25882 |
|
25883 | |
25884 |
|
25885 |
|
25886 |
|
25887 |
|
25888 |
|
25889 |
|
25890 |
|
25891 |
|
25892 |
|
25893 |
|
25894 |
|
25895 | getResults: function getResults() {
|
25896 | var _ref10 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
25897 | skip = _ref10.skip,
|
25898 | limit = _ref10.limit,
|
25899 | selectUserKeys = _ref10.selectUserKeys,
|
25900 | includeUserKeys = _ref10.includeUserKeys,
|
25901 | includeStatistics = _ref10.includeStatistics,
|
25902 | version = _ref10.version;
|
25903 |
|
25904 | var authOptions = arguments.length > 1 ? arguments[1] : undefined;
|
25905 | return this._getResults({
|
25906 | skip: skip,
|
25907 | limit: limit,
|
25908 | selectUserKeys: selectUserKeys,
|
25909 | includeUserKeys: includeUserKeys,
|
25910 | includeStatistics: includeStatistics,
|
25911 | version: version
|
25912 | }, authOptions);
|
25913 | },
|
25914 |
|
25915 | |
25916 |
|
25917 |
|
25918 |
|
25919 |
|
25920 |
|
25921 |
|
25922 |
|
25923 |
|
25924 |
|
25925 |
|
25926 |
|
25927 | getResultsAroundUser: function getResultsAroundUser(user) {
|
25928 | var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
25929 | var authOptions = arguments.length > 2 ? arguments[2] : undefined;
|
25930 |
|
25931 |
|
25932 | if (user && typeof user.id !== 'string') {
|
25933 | return this.getResultsAroundUser(undefined, user, options);
|
25934 | }
|
25935 |
|
25936 | var limit = options.limit,
|
25937 | selectUserKeys = options.selectUserKeys,
|
25938 | includeUserKeys = options.includeUserKeys,
|
25939 | includeStatistics = options.includeStatistics,
|
25940 | version = options.version;
|
25941 | return this._getResults({
|
25942 | limit: limit,
|
25943 | selectUserKeys: selectUserKeys,
|
25944 | includeUserKeys: includeUserKeys,
|
25945 | includeStatistics: includeStatistics,
|
25946 | version: version
|
25947 | }, authOptions, user ? user.id : 'self');
|
25948 | },
|
25949 | _update: function _update(data, authOptions) {
|
25950 | var _this3 = this;
|
25951 |
|
25952 | return request({
|
25953 | method: 'PUT',
|
25954 | path: "/leaderboard/leaderboards/".concat(this.statisticName),
|
25955 | data: data,
|
25956 | authOptions: authOptions
|
25957 | }).then(function (result) {
|
25958 | return _this3._finishFetch(result);
|
25959 | });
|
25960 | },
|
25961 |
|
25962 | |
25963 |
|
25964 |
|
25965 |
|
25966 |
|
25967 |
|
25968 | updateVersionChangeInterval: function updateVersionChangeInterval(versionChangeInterval, authOptions) {
|
25969 | return this._update({
|
25970 | versionChangeInterval: versionChangeInterval
|
25971 | }, authOptions);
|
25972 | },
|
25973 |
|
25974 | |
25975 |
|
25976 |
|
25977 |
|
25978 |
|
25979 |
|
25980 | updateUpdateStrategy: function updateUpdateStrategy(updateStrategy, authOptions) {
|
25981 | return this._update({
|
25982 | updateStrategy: updateStrategy
|
25983 | }, authOptions);
|
25984 | },
|
25985 |
|
25986 | |
25987 |
|
25988 |
|
25989 |
|
25990 |
|
25991 | reset: function reset(authOptions) {
|
25992 | var _this4 = this;
|
25993 |
|
25994 | return request({
|
25995 | method: 'PUT',
|
25996 | path: "/leaderboard/leaderboards/".concat(this.statisticName, "/incrementVersion"),
|
25997 | authOptions: authOptions
|
25998 | }).then(function (data) {
|
25999 | return _this4._finishFetch(data);
|
26000 | });
|
26001 | },
|
26002 |
|
26003 | |
26004 |
|
26005 |
|
26006 |
|
26007 |
|
26008 | destroy: function destroy(authOptions) {
|
26009 | return AV.request({
|
26010 | method: 'DELETE',
|
26011 | path: "/leaderboard/leaderboards/".concat(this.statisticName),
|
26012 | authOptions: authOptions
|
26013 | }).then(function () {
|
26014 | return undefined;
|
26015 | });
|
26016 | },
|
26017 |
|
26018 | |
26019 |
|
26020 |
|
26021 |
|
26022 |
|
26023 |
|
26024 |
|
26025 |
|
26026 | getArchives: function getArchives() {
|
26027 | var _this5 = this;
|
26028 |
|
26029 | var _ref11 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
26030 | skip = _ref11.skip,
|
26031 | limit = _ref11.limit;
|
26032 |
|
26033 | var authOptions = arguments.length > 1 ? arguments[1] : undefined;
|
26034 | return request({
|
26035 | method: 'GET',
|
26036 | path: "/leaderboard/leaderboards/".concat(this.statisticName, "/archives"),
|
26037 | query: {
|
26038 | skip: skip,
|
26039 | limit: limit
|
26040 | },
|
26041 | authOptions: authOptions
|
26042 | }).then(function (_ref12) {
|
26043 | var results = _ref12.results;
|
26044 | return (0, _map.default)(results).call(results, function (_ref13) {
|
26045 | var version = _ref13.version,
|
26046 | status = _ref13.status,
|
26047 | url = _ref13.url,
|
26048 | activatedAt = _ref13.activatedAt,
|
26049 | deactivatedAt = _ref13.deactivatedAt;
|
26050 | return {
|
26051 | statisticName: _this5.statisticName,
|
26052 | version: version,
|
26053 | status: status,
|
26054 | url: url,
|
26055 | activatedAt: parseDate(activatedAt.iso),
|
26056 | deactivatedAt: parseDate(deactivatedAt.iso)
|
26057 | };
|
26058 | });
|
26059 | });
|
26060 | }
|
26061 | });
|
26062 |
|
26063 | }),
|
26064 |
|
26065 | (function(module, exports, __webpack_require__) {
|
26066 |
|
26067 | "use strict";
|
26068 |
|
26069 |
|
26070 | var _interopRequireDefault = __webpack_require__(1);
|
26071 |
|
26072 | var _typeof2 = _interopRequireDefault(__webpack_require__(73));
|
26073 |
|
26074 | var _defineProperty = _interopRequireDefault(__webpack_require__(92));
|
26075 |
|
26076 | var _setPrototypeOf = _interopRequireDefault(__webpack_require__(239));
|
26077 |
|
26078 | var _assign2 = _interopRequireDefault(__webpack_require__(153));
|
26079 |
|
26080 | var _indexOf = _interopRequireDefault(__webpack_require__(71));
|
26081 |
|
26082 | var _getOwnPropertySymbols = _interopRequireDefault(__webpack_require__(154));
|
26083 |
|
26084 | var _promise = _interopRequireDefault(__webpack_require__(12));
|
26085 |
|
26086 | var _symbol = _interopRequireDefault(__webpack_require__(150));
|
26087 |
|
26088 | var _iterator = _interopRequireDefault(__webpack_require__(578));
|
26089 |
|
26090 | var _weakMap = _interopRequireDefault(__webpack_require__(261));
|
26091 |
|
26092 | var _keys = _interopRequireDefault(__webpack_require__(115));
|
26093 |
|
26094 | var _getOwnPropertyDescriptor = _interopRequireDefault(__webpack_require__(152));
|
26095 |
|
26096 | var _getPrototypeOf = _interopRequireDefault(__webpack_require__(148));
|
26097 |
|
26098 | var _map = _interopRequireDefault(__webpack_require__(585));
|
26099 |
|
26100 | (0, _defineProperty.default)(exports, '__esModule', {
|
26101 | value: true
|
26102 | });
|
26103 |
|
26104 |
|
26105 |
|
26106 |
|
26107 |
|
26108 |
|
26109 |
|
26110 |
|
26111 |
|
26112 |
|
26113 |
|
26114 |
|
26115 |
|
26116 |
|
26117 |
|
26118 |
|
26119 |
|
26120 | var _extendStatics$ = function extendStatics$1(d, b) {
|
26121 | _extendStatics$ = _setPrototypeOf.default || {
|
26122 | __proto__: []
|
26123 | } instanceof Array && function (d, b) {
|
26124 | d.__proto__ = b;
|
26125 | } || function (d, b) {
|
26126 | for (var p in b) {
|
26127 | if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
|
26128 | }
|
26129 | };
|
26130 |
|
26131 | return _extendStatics$(d, b);
|
26132 | };
|
26133 |
|
26134 | function __extends$1(d, b) {
|
26135 | if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
26136 |
|
26137 | _extendStatics$(d, b);
|
26138 |
|
26139 | function __() {
|
26140 | this.constructor = d;
|
26141 | }
|
26142 |
|
26143 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
26144 | }
|
26145 |
|
26146 | var _assign = function __assign() {
|
26147 | _assign = _assign2.default || function __assign(t) {
|
26148 | for (var s, i = 1, n = arguments.length; i < n; i++) {
|
26149 | s = arguments[i];
|
26150 |
|
26151 | for (var p in s) {
|
26152 | if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
26153 | }
|
26154 | }
|
26155 |
|
26156 | return t;
|
26157 | };
|
26158 |
|
26159 | return _assign.apply(this, arguments);
|
26160 | };
|
26161 |
|
26162 | function __rest(s, e) {
|
26163 | var t = {};
|
26164 |
|
26165 | for (var p in s) {
|
26166 | if (Object.prototype.hasOwnProperty.call(s, p) && (0, _indexOf.default)(e).call(e, p) < 0) t[p] = s[p];
|
26167 | }
|
26168 |
|
26169 | if (s != null && typeof _getOwnPropertySymbols.default === "function") for (var i = 0, p = (0, _getOwnPropertySymbols.default)(s); i < p.length; i++) {
|
26170 | if ((0, _indexOf.default)(e).call(e, p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
26171 | }
|
26172 | return t;
|
26173 | }
|
26174 |
|
26175 | function __awaiter(thisArg, _arguments, P, generator) {
|
26176 | function adopt(value) {
|
26177 | return value instanceof P ? value : new P(function (resolve) {
|
26178 | resolve(value);
|
26179 | });
|
26180 | }
|
26181 |
|
26182 | return new (P || (P = _promise.default))(function (resolve, reject) {
|
26183 | function fulfilled(value) {
|
26184 | try {
|
26185 | step(generator.next(value));
|
26186 | } catch (e) {
|
26187 | reject(e);
|
26188 | }
|
26189 | }
|
26190 |
|
26191 | function rejected(value) {
|
26192 | try {
|
26193 | step(generator["throw"](value));
|
26194 | } catch (e) {
|
26195 | reject(e);
|
26196 | }
|
26197 | }
|
26198 |
|
26199 | function step(result) {
|
26200 | result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
26201 | }
|
26202 |
|
26203 | step((generator = generator.apply(thisArg, _arguments || [])).next());
|
26204 | });
|
26205 | }
|
26206 |
|
26207 | function __generator(thisArg, body) {
|
26208 | var _ = {
|
26209 | label: 0,
|
26210 | sent: function sent() {
|
26211 | if (t[0] & 1) throw t[1];
|
26212 | return t[1];
|
26213 | },
|
26214 | trys: [],
|
26215 | ops: []
|
26216 | },
|
26217 | f,
|
26218 | y,
|
26219 | t,
|
26220 | g;
|
26221 | return g = {
|
26222 | next: verb(0),
|
26223 | "throw": verb(1),
|
26224 | "return": verb(2)
|
26225 | }, typeof _symbol.default === "function" && (g[_iterator.default] = function () {
|
26226 | return this;
|
26227 | }), g;
|
26228 |
|
26229 | function verb(n) {
|
26230 | return function (v) {
|
26231 | return step([n, v]);
|
26232 | };
|
26233 | }
|
26234 |
|
26235 | function step(op) {
|
26236 | if (f) throw new TypeError("Generator is already executing.");
|
26237 |
|
26238 | while (_) {
|
26239 | try {
|
26240 | if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
26241 | if (y = 0, t) op = [op[0] & 2, t.value];
|
26242 |
|
26243 | switch (op[0]) {
|
26244 | case 0:
|
26245 | case 1:
|
26246 | t = op;
|
26247 | break;
|
26248 |
|
26249 | case 4:
|
26250 | _.label++;
|
26251 | return {
|
26252 | value: op[1],
|
26253 | done: false
|
26254 | };
|
26255 |
|
26256 | case 5:
|
26257 | _.label++;
|
26258 | y = op[1];
|
26259 | op = [0];
|
26260 | continue;
|
26261 |
|
26262 | case 7:
|
26263 | op = _.ops.pop();
|
26264 |
|
26265 | _.trys.pop();
|
26266 |
|
26267 | continue;
|
26268 |
|
26269 | default:
|
26270 | if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
26271 | _ = 0;
|
26272 | continue;
|
26273 | }
|
26274 |
|
26275 | if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
26276 | _.label = op[1];
|
26277 | break;
|
26278 | }
|
26279 |
|
26280 | if (op[0] === 6 && _.label < t[1]) {
|
26281 | _.label = t[1];
|
26282 | t = op;
|
26283 | break;
|
26284 | }
|
26285 |
|
26286 | if (t && _.label < t[2]) {
|
26287 | _.label = t[2];
|
26288 |
|
26289 | _.ops.push(op);
|
26290 |
|
26291 | break;
|
26292 | }
|
26293 |
|
26294 | if (t[2]) _.ops.pop();
|
26295 |
|
26296 | _.trys.pop();
|
26297 |
|
26298 | continue;
|
26299 | }
|
26300 |
|
26301 | op = body.call(thisArg, _);
|
26302 | } catch (e) {
|
26303 | op = [6, e];
|
26304 | y = 0;
|
26305 | } finally {
|
26306 | f = t = 0;
|
26307 | }
|
26308 | }
|
26309 |
|
26310 | if (op[0] & 5) throw op[1];
|
26311 | return {
|
26312 | value: op[0] ? op[1] : void 0,
|
26313 | done: true
|
26314 | };
|
26315 | }
|
26316 | }
|
26317 |
|
26318 | var PROVIDER = "lc_weapp";
|
26319 | var PLATFORM = "weixin";
|
26320 |
|
26321 | function getLoginCode() {
|
26322 | return new _promise.default(function (resolve, reject) {
|
26323 | wx.login({
|
26324 | success: function success(res) {
|
26325 | return res.code ? resolve(res.code) : reject(new Error(res.errMsg));
|
26326 | },
|
26327 | fail: function fail(_a) {
|
26328 | var errMsg = _a.errMsg;
|
26329 | return reject(new Error(errMsg));
|
26330 | }
|
26331 | });
|
26332 | });
|
26333 | }
|
26334 |
|
26335 | var getAuthInfo = function getAuthInfo(_a) {
|
26336 | var _b = _a === void 0 ? {} : _a,
|
26337 | _c = _b.platform,
|
26338 | platform = _c === void 0 ? PLATFORM : _c,
|
26339 | _d = _b.preferUnionId,
|
26340 | preferUnionId = _d === void 0 ? false : _d,
|
26341 | _e = _b.asMainAccount,
|
26342 | asMainAccount = _e === void 0 ? false : _e;
|
26343 |
|
26344 | return __awaiter(this, void 0, void 0, function () {
|
26345 | var code, authData;
|
26346 | return __generator(this, function (_f) {
|
26347 | switch (_f.label) {
|
26348 | case 0:
|
26349 | return [4
|
26350 |
|
26351 | , getLoginCode()];
|
26352 |
|
26353 | case 1:
|
26354 | code = _f.sent();
|
26355 | authData = {
|
26356 | code: code
|
26357 | };
|
26358 |
|
26359 | if (preferUnionId) {
|
26360 | authData.platform = platform;
|
26361 | authData.main_account = asMainAccount;
|
26362 | }
|
26363 |
|
26364 | return [2
|
26365 |
|
26366 | , {
|
26367 | authData: authData,
|
26368 | platform: platform,
|
26369 | provider: PROVIDER
|
26370 | }];
|
26371 | }
|
26372 | });
|
26373 | });
|
26374 | };
|
26375 |
|
26376 | var storage = {
|
26377 | getItem: function getItem(key) {
|
26378 | return wx.getStorageSync(key);
|
26379 | },
|
26380 | setItem: function setItem(key, value) {
|
26381 | return wx.setStorageSync(key, value);
|
26382 | },
|
26383 | removeItem: function removeItem(key) {
|
26384 | return wx.removeStorageSync(key);
|
26385 | },
|
26386 | clear: function clear() {
|
26387 | return wx.clearStorageSync();
|
26388 | }
|
26389 | };
|
26390 |
|
26391 |
|
26392 |
|
26393 |
|
26394 |
|
26395 |
|
26396 |
|
26397 |
|
26398 |
|
26399 |
|
26400 |
|
26401 |
|
26402 |
|
26403 |
|
26404 |
|
26405 |
|
26406 |
|
26407 | var _extendStatics = function extendStatics(d, b) {
|
26408 | _extendStatics = _setPrototypeOf.default || {
|
26409 | __proto__: []
|
26410 | } instanceof Array && function (d, b) {
|
26411 | d.__proto__ = b;
|
26412 | } || function (d, b) {
|
26413 | for (var p in b) {
|
26414 | if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
|
26415 | }
|
26416 | };
|
26417 |
|
26418 | return _extendStatics(d, b);
|
26419 | };
|
26420 |
|
26421 | function __extends(d, b) {
|
26422 | if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
26423 |
|
26424 | _extendStatics(d, b);
|
26425 |
|
26426 | function __() {
|
26427 | this.constructor = d;
|
26428 | }
|
26429 |
|
26430 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
26431 | }
|
26432 |
|
26433 | var AbortError =
|
26434 |
|
26435 | function (_super) {
|
26436 | __extends(AbortError, _super);
|
26437 |
|
26438 | function AbortError() {
|
26439 | var _this = _super !== null && _super.apply(this, arguments) || this;
|
26440 |
|
26441 | _this.name = "AbortError";
|
26442 | return _this;
|
26443 | }
|
26444 |
|
26445 | return AbortError;
|
26446 | }(Error);
|
26447 |
|
26448 | var request = function request(url, options) {
|
26449 | if (options === void 0) {
|
26450 | options = {};
|
26451 | }
|
26452 |
|
26453 | var method = options.method,
|
26454 | data = options.data,
|
26455 | headers = options.headers,
|
26456 | signal = options.signal;
|
26457 |
|
26458 | if (signal === null || signal === void 0 ? void 0 : signal.aborted) {
|
26459 | return _promise.default.reject(new AbortError("Request aborted"));
|
26460 | }
|
26461 |
|
26462 | return new _promise.default(function (resolve, reject) {
|
26463 | var task = wx.request({
|
26464 | url: url,
|
26465 | method: method,
|
26466 | data: data,
|
26467 | header: headers,
|
26468 | complete: function complete(res) {
|
26469 | signal === null || signal === void 0 ? void 0 : signal.removeEventListener("abort", abortListener);
|
26470 |
|
26471 | if (!res.statusCode) {
|
26472 | reject(new Error(res.errMsg));
|
26473 | return;
|
26474 | }
|
26475 |
|
26476 | resolve({
|
26477 | ok: !(res.statusCode >= 400),
|
26478 | status: res.statusCode,
|
26479 | headers: res.header,
|
26480 | data: res.data
|
26481 | });
|
26482 | }
|
26483 | });
|
26484 |
|
26485 | var abortListener = function abortListener() {
|
26486 | reject(new AbortError("Request aborted"));
|
26487 | task.abort();
|
26488 | };
|
26489 |
|
26490 | signal === null || signal === void 0 ? void 0 : signal.addEventListener("abort", abortListener);
|
26491 | });
|
26492 | };
|
26493 |
|
26494 | var upload = function upload(url, file, options) {
|
26495 | if (options === void 0) {
|
26496 | options = {};
|
26497 | }
|
26498 |
|
26499 | var headers = options.headers,
|
26500 | data = options.data,
|
26501 | onprogress = options.onprogress,
|
26502 | signal = options.signal;
|
26503 |
|
26504 | if (signal === null || signal === void 0 ? void 0 : signal.aborted) {
|
26505 | return _promise.default.reject(new AbortError("Request aborted"));
|
26506 | }
|
26507 |
|
26508 | if (!(file && file.data && file.data.uri)) {
|
26509 | return _promise.default.reject(new TypeError("File data must be an object like { uri: localPath }."));
|
26510 | }
|
26511 |
|
26512 | return new _promise.default(function (resolve, reject) {
|
26513 | var task = wx.uploadFile({
|
26514 | url: url,
|
26515 | header: headers,
|
26516 | filePath: file.data.uri,
|
26517 | name: file.field,
|
26518 | formData: data,
|
26519 | success: function success(response) {
|
26520 | var status = response.statusCode,
|
26521 | data = response.data,
|
26522 | rest = __rest(response, ["statusCode", "data"]);
|
26523 |
|
26524 | resolve(_assign(_assign({}, rest), {
|
26525 | data: typeof data === "string" ? JSON.parse(data) : data,
|
26526 | status: status,
|
26527 | ok: !(status >= 400)
|
26528 | }));
|
26529 | },
|
26530 | fail: function fail(response) {
|
26531 | reject(new Error(response.errMsg));
|
26532 | },
|
26533 | complete: function complete() {
|
26534 | signal === null || signal === void 0 ? void 0 : signal.removeEventListener("abort", abortListener);
|
26535 | }
|
26536 | });
|
26537 |
|
26538 | var abortListener = function abortListener() {
|
26539 | reject(new AbortError("Request aborted"));
|
26540 | task.abort();
|
26541 | };
|
26542 |
|
26543 | signal === null || signal === void 0 ? void 0 : signal.addEventListener("abort", abortListener);
|
26544 |
|
26545 | if (onprogress) {
|
26546 | task.onProgressUpdate(function (event) {
|
26547 | return onprogress({
|
26548 | loaded: event.totalBytesSent,
|
26549 | total: event.totalBytesExpectedToSend,
|
26550 | percent: event.progress
|
26551 | });
|
26552 | });
|
26553 | }
|
26554 | });
|
26555 | };
|
26556 |
|
26557 |
|
26558 |
|
26559 |
|
26560 |
|
26561 |
|
26562 |
|
26563 |
|
26564 |
|
26565 |
|
26566 |
|
26567 |
|
26568 |
|
26569 |
|
26570 |
|
26571 |
|
26572 |
|
26573 |
|
26574 |
|
26575 |
|
26576 |
|
26577 |
|
26578 |
|
26579 |
|
26580 |
|
26581 |
|
26582 |
|
26583 | var privateData = new _weakMap.default();
|
26584 |
|
26585 |
|
26586 |
|
26587 |
|
26588 |
|
26589 |
|
26590 | var wrappers = new _weakMap.default();
|
26591 |
|
26592 |
|
26593 |
|
26594 |
|
26595 |
|
26596 |
|
26597 |
|
26598 | function pd(event) {
|
26599 | var retv = privateData.get(event);
|
26600 | return retv;
|
26601 | }
|
26602 |
|
26603 |
|
26604 |
|
26605 |
|
26606 |
|
26607 |
|
26608 | function setCancelFlag(data) {
|
26609 | if (data.passiveListener != null) {
|
26610 | if (typeof console !== "undefined" && typeof console.error === "function") {
|
26611 | console.error("Unable to preventDefault inside passive event listener invocation.", data.passiveListener);
|
26612 | }
|
26613 |
|
26614 | return;
|
26615 | }
|
26616 |
|
26617 | if (!data.event.cancelable) {
|
26618 | return;
|
26619 | }
|
26620 |
|
26621 | data.canceled = true;
|
26622 |
|
26623 | if (typeof data.event.preventDefault === "function") {
|
26624 | data.event.preventDefault();
|
26625 | }
|
26626 | }
|
26627 |
|
26628 |
|
26629 |
|
26630 |
|
26631 |
|
26632 |
|
26633 |
|
26634 |
|
26635 |
|
26636 |
|
26637 |
|
26638 |
|
26639 |
|
26640 | function Event(eventTarget, event) {
|
26641 | privateData.set(this, {
|
26642 | eventTarget: eventTarget,
|
26643 | event: event,
|
26644 | eventPhase: 2,
|
26645 | currentTarget: eventTarget,
|
26646 | canceled: false,
|
26647 | stopped: false,
|
26648 | immediateStopped: false,
|
26649 | passiveListener: null,
|
26650 | timeStamp: event.timeStamp || Date.now()
|
26651 | });
|
26652 |
|
26653 | (0, _defineProperty.default)(this, "isTrusted", {
|
26654 | value: false,
|
26655 | enumerable: true
|
26656 | });
|
26657 |
|
26658 | var keys = (0, _keys.default)(event);
|
26659 |
|
26660 | for (var i = 0; i < keys.length; ++i) {
|
26661 | var key = keys[i];
|
26662 |
|
26663 | if (!(key in this)) {
|
26664 | (0, _defineProperty.default)(this, key, defineRedirectDescriptor(key));
|
26665 | }
|
26666 | }
|
26667 | }
|
26668 |
|
26669 |
|
26670 | Event.prototype = {
|
26671 | |
26672 |
|
26673 |
|
26674 |
|
26675 | get type() {
|
26676 | return pd(this).event.type;
|
26677 | },
|
26678 |
|
26679 | |
26680 |
|
26681 |
|
26682 |
|
26683 | get target() {
|
26684 | return pd(this).eventTarget;
|
26685 | },
|
26686 |
|
26687 | |
26688 |
|
26689 |
|
26690 |
|
26691 | get currentTarget() {
|
26692 | return pd(this).currentTarget;
|
26693 | },
|
26694 |
|
26695 | |
26696 |
|
26697 |
|
26698 | composedPath: function composedPath() {
|
26699 | var currentTarget = pd(this).currentTarget;
|
26700 |
|
26701 | if (currentTarget == null) {
|
26702 | return [];
|
26703 | }
|
26704 |
|
26705 | return [currentTarget];
|
26706 | },
|
26707 |
|
26708 | |
26709 |
|
26710 |
|
26711 |
|
26712 | get NONE() {
|
26713 | return 0;
|
26714 | },
|
26715 |
|
26716 | |
26717 |
|
26718 |
|
26719 |
|
26720 | get CAPTURING_PHASE() {
|
26721 | return 1;
|
26722 | },
|
26723 |
|
26724 | |
26725 |
|
26726 |
|
26727 |
|
26728 | get AT_TARGET() {
|
26729 | return 2;
|
26730 | },
|
26731 |
|
26732 | |
26733 |
|
26734 |
|
26735 |
|
26736 | get BUBBLING_PHASE() {
|
26737 | return 3;
|
26738 | },
|
26739 |
|
26740 | |
26741 |
|
26742 |
|
26743 |
|
26744 | get eventPhase() {
|
26745 | return pd(this).eventPhase;
|
26746 | },
|
26747 |
|
26748 | |
26749 |
|
26750 |
|
26751 |
|
26752 | stopPropagation: function stopPropagation() {
|
26753 | var data = pd(this);
|
26754 | data.stopped = true;
|
26755 |
|
26756 | if (typeof data.event.stopPropagation === "function") {
|
26757 | data.event.stopPropagation();
|
26758 | }
|
26759 | },
|
26760 |
|
26761 | |
26762 |
|
26763 |
|
26764 |
|
26765 | stopImmediatePropagation: function stopImmediatePropagation() {
|
26766 | var data = pd(this);
|
26767 | data.stopped = true;
|
26768 | data.immediateStopped = true;
|
26769 |
|
26770 | if (typeof data.event.stopImmediatePropagation === "function") {
|
26771 | data.event.stopImmediatePropagation();
|
26772 | }
|
26773 | },
|
26774 |
|
26775 | |
26776 |
|
26777 |
|
26778 |
|
26779 | get bubbles() {
|
26780 | return Boolean(pd(this).event.bubbles);
|
26781 | },
|
26782 |
|
26783 | |
26784 |
|
26785 |
|
26786 |
|
26787 | get cancelable() {
|
26788 | return Boolean(pd(this).event.cancelable);
|
26789 | },
|
26790 |
|
26791 | |
26792 |
|
26793 |
|
26794 |
|
26795 | preventDefault: function preventDefault() {
|
26796 | setCancelFlag(pd(this));
|
26797 | },
|
26798 |
|
26799 | |
26800 |
|
26801 |
|
26802 |
|
26803 | get defaultPrevented() {
|
26804 | return pd(this).canceled;
|
26805 | },
|
26806 |
|
26807 | |
26808 |
|
26809 |
|
26810 |
|
26811 | get composed() {
|
26812 | return Boolean(pd(this).event.composed);
|
26813 | },
|
26814 |
|
26815 | |
26816 |
|
26817 |
|
26818 |
|
26819 | get timeStamp() {
|
26820 | return pd(this).timeStamp;
|
26821 | },
|
26822 |
|
26823 | |
26824 |
|
26825 |
|
26826 |
|
26827 |
|
26828 | get srcElement() {
|
26829 | return pd(this).eventTarget;
|
26830 | },
|
26831 |
|
26832 | |
26833 |
|
26834 |
|
26835 |
|
26836 |
|
26837 | get cancelBubble() {
|
26838 | return pd(this).stopped;
|
26839 | },
|
26840 |
|
26841 | set cancelBubble(value) {
|
26842 | if (!value) {
|
26843 | return;
|
26844 | }
|
26845 |
|
26846 | var data = pd(this);
|
26847 | data.stopped = true;
|
26848 |
|
26849 | if (typeof data.event.cancelBubble === "boolean") {
|
26850 | data.event.cancelBubble = true;
|
26851 | }
|
26852 | },
|
26853 |
|
26854 | |
26855 |
|
26856 |
|
26857 |
|
26858 |
|
26859 | get returnValue() {
|
26860 | return !pd(this).canceled;
|
26861 | },
|
26862 |
|
26863 | set returnValue(value) {
|
26864 | if (!value) {
|
26865 | setCancelFlag(pd(this));
|
26866 | }
|
26867 | },
|
26868 |
|
26869 | |
26870 |
|
26871 |
|
26872 |
|
26873 |
|
26874 |
|
26875 |
|
26876 | initEvent: function initEvent() {
|
26877 | }
|
26878 | };
|
26879 |
|
26880 | (0, _defineProperty.default)(Event.prototype, "constructor", {
|
26881 | value: Event,
|
26882 | configurable: true,
|
26883 | writable: true
|
26884 | });
|
26885 |
|
26886 | if (typeof window !== "undefined" && typeof window.Event !== "undefined") {
|
26887 | (0, _setPrototypeOf.default)(Event.prototype, window.Event.prototype);
|
26888 |
|
26889 | wrappers.set(window.Event.prototype, Event);
|
26890 | }
|
26891 |
|
26892 |
|
26893 |
|
26894 |
|
26895 |
|
26896 |
|
26897 |
|
26898 |
|
26899 | function defineRedirectDescriptor(key) {
|
26900 | return {
|
26901 | get: function get() {
|
26902 | return pd(this).event[key];
|
26903 | },
|
26904 | set: function set(value) {
|
26905 | pd(this).event[key] = value;
|
26906 | },
|
26907 | configurable: true,
|
26908 | enumerable: true
|
26909 | };
|
26910 | }
|
26911 |
|
26912 |
|
26913 |
|
26914 |
|
26915 |
|
26916 |
|
26917 |
|
26918 |
|
26919 | function defineCallDescriptor(key) {
|
26920 | return {
|
26921 | value: function value() {
|
26922 | var event = pd(this).event;
|
26923 | return event[key].apply(event, arguments);
|
26924 | },
|
26925 | configurable: true,
|
26926 | enumerable: true
|
26927 | };
|
26928 | }
|
26929 |
|
26930 |
|
26931 |
|
26932 |
|
26933 |
|
26934 |
|
26935 |
|
26936 |
|
26937 |
|
26938 | function defineWrapper(BaseEvent, proto) {
|
26939 | var keys = (0, _keys.default)(proto);
|
26940 |
|
26941 | if (keys.length === 0) {
|
26942 | return BaseEvent;
|
26943 | }
|
26944 |
|
26945 |
|
26946 |
|
26947 | function CustomEvent(eventTarget, event) {
|
26948 | BaseEvent.call(this, eventTarget, event);
|
26949 | }
|
26950 |
|
26951 | CustomEvent.prototype = Object.create(BaseEvent.prototype, {
|
26952 | constructor: {
|
26953 | value: CustomEvent,
|
26954 | configurable: true,
|
26955 | writable: true
|
26956 | }
|
26957 | });
|
26958 |
|
26959 | for (var i = 0; i < keys.length; ++i) {
|
26960 | var key = keys[i];
|
26961 |
|
26962 | if (!(key in BaseEvent.prototype)) {
|
26963 | var descriptor = (0, _getOwnPropertyDescriptor.default)(proto, key);
|
26964 | var isFunc = typeof descriptor.value === "function";
|
26965 | (0, _defineProperty.default)(CustomEvent.prototype, key, isFunc ? defineCallDescriptor(key) : defineRedirectDescriptor(key));
|
26966 | }
|
26967 | }
|
26968 |
|
26969 | return CustomEvent;
|
26970 | }
|
26971 |
|
26972 |
|
26973 |
|
26974 |
|
26975 |
|
26976 |
|
26977 |
|
26978 |
|
26979 | function getWrapper(proto) {
|
26980 | if (proto == null || proto === Object.prototype) {
|
26981 | return Event;
|
26982 | }
|
26983 |
|
26984 | var wrapper = wrappers.get(proto);
|
26985 |
|
26986 | if (wrapper == null) {
|
26987 | wrapper = defineWrapper(getWrapper((0, _getPrototypeOf.default)(proto)), proto);
|
26988 | wrappers.set(proto, wrapper);
|
26989 | }
|
26990 |
|
26991 | return wrapper;
|
26992 | }
|
26993 |
|
26994 |
|
26995 |
|
26996 |
|
26997 |
|
26998 |
|
26999 |
|
27000 |
|
27001 |
|
27002 | function wrapEvent(eventTarget, event) {
|
27003 | var Wrapper = getWrapper((0, _getPrototypeOf.default)(event));
|
27004 | return new Wrapper(eventTarget, event);
|
27005 | }
|
27006 |
|
27007 |
|
27008 |
|
27009 |
|
27010 |
|
27011 |
|
27012 |
|
27013 |
|
27014 | function isStopped(event) {
|
27015 | return pd(event).immediateStopped;
|
27016 | }
|
27017 |
|
27018 |
|
27019 |
|
27020 |
|
27021 |
|
27022 |
|
27023 |
|
27024 |
|
27025 |
|
27026 | function setEventPhase(event, eventPhase) {
|
27027 | pd(event).eventPhase = eventPhase;
|
27028 | }
|
27029 |
|
27030 |
|
27031 |
|
27032 |
|
27033 |
|
27034 |
|
27035 |
|
27036 |
|
27037 |
|
27038 | function setCurrentTarget(event, currentTarget) {
|
27039 | pd(event).currentTarget = currentTarget;
|
27040 | }
|
27041 |
|
27042 |
|
27043 |
|
27044 |
|
27045 |
|
27046 |
|
27047 |
|
27048 |
|
27049 |
|
27050 | function setPassiveListener(event, passiveListener) {
|
27051 | pd(event).passiveListener = passiveListener;
|
27052 | }
|
27053 |
|
27054 |
|
27055 |
|
27056 |
|
27057 |
|
27058 |
|
27059 |
|
27060 |
|
27061 |
|
27062 |
|
27063 |
|
27064 |
|
27065 |
|
27066 |
|
27067 |
|
27068 |
|
27069 | var listenersMap = new _weakMap.default();
|
27070 |
|
27071 | var CAPTURE = 1;
|
27072 | var BUBBLE = 2;
|
27073 | var ATTRIBUTE = 3;
|
27074 |
|
27075 |
|
27076 |
|
27077 |
|
27078 |
|
27079 |
|
27080 | function isObject(x) {
|
27081 | return x !== null && (0, _typeof2.default)(x) === "object";
|
27082 | }
|
27083 |
|
27084 |
|
27085 |
|
27086 |
|
27087 |
|
27088 |
|
27089 |
|
27090 |
|
27091 | function getListeners(eventTarget) {
|
27092 | var listeners = listenersMap.get(eventTarget);
|
27093 |
|
27094 | if (listeners == null) {
|
27095 | throw new TypeError("'this' is expected an EventTarget object, but got another value.");
|
27096 | }
|
27097 |
|
27098 | return listeners;
|
27099 | }
|
27100 |
|
27101 |
|
27102 |
|
27103 |
|
27104 |
|
27105 |
|
27106 |
|
27107 |
|
27108 | function defineEventAttributeDescriptor(eventName) {
|
27109 | return {
|
27110 | get: function get() {
|
27111 | var listeners = getListeners(this);
|
27112 | var node = listeners.get(eventName);
|
27113 |
|
27114 | while (node != null) {
|
27115 | if (node.listenerType === ATTRIBUTE) {
|
27116 | return node.listener;
|
27117 | }
|
27118 |
|
27119 | node = node.next;
|
27120 | }
|
27121 |
|
27122 | return null;
|
27123 | },
|
27124 | set: function set(listener) {
|
27125 | if (typeof listener !== "function" && !isObject(listener)) {
|
27126 | listener = null;
|
27127 | }
|
27128 |
|
27129 | var listeners = getListeners(this);
|
27130 |
|
27131 | var prev = null;
|
27132 | var node = listeners.get(eventName);
|
27133 |
|
27134 | while (node != null) {
|
27135 | if (node.listenerType === ATTRIBUTE) {
|
27136 |
|
27137 | if (prev !== null) {
|
27138 | prev.next = node.next;
|
27139 | } else if (node.next !== null) {
|
27140 | listeners.set(eventName, node.next);
|
27141 | } else {
|
27142 | listeners.delete(eventName);
|
27143 | }
|
27144 | } else {
|
27145 | prev = node;
|
27146 | }
|
27147 |
|
27148 | node = node.next;
|
27149 | }
|
27150 |
|
27151 |
|
27152 | if (listener !== null) {
|
27153 | var newNode = {
|
27154 | listener: listener,
|
27155 | listenerType: ATTRIBUTE,
|
27156 | passive: false,
|
27157 | once: false,
|
27158 | next: null
|
27159 | };
|
27160 |
|
27161 | if (prev === null) {
|
27162 | listeners.set(eventName, newNode);
|
27163 | } else {
|
27164 | prev.next = newNode;
|
27165 | }
|
27166 | }
|
27167 | },
|
27168 | configurable: true,
|
27169 | enumerable: true
|
27170 | };
|
27171 | }
|
27172 |
|
27173 |
|
27174 |
|
27175 |
|
27176 |
|
27177 |
|
27178 |
|
27179 |
|
27180 | function defineEventAttribute(eventTargetPrototype, eventName) {
|
27181 | (0, _defineProperty.default)(eventTargetPrototype, "on".concat(eventName), defineEventAttributeDescriptor(eventName));
|
27182 | }
|
27183 |
|
27184 |
|
27185 |
|
27186 |
|
27187 |
|
27188 |
|
27189 |
|
27190 |
|
27191 | function defineCustomEventTarget(eventNames) {
|
27192 |
|
27193 | function CustomEventTarget() {
|
27194 | EventTarget.call(this);
|
27195 | }
|
27196 |
|
27197 | CustomEventTarget.prototype = Object.create(EventTarget.prototype, {
|
27198 | constructor: {
|
27199 | value: CustomEventTarget,
|
27200 | configurable: true,
|
27201 | writable: true
|
27202 | }
|
27203 | });
|
27204 |
|
27205 | for (var i = 0; i < eventNames.length; ++i) {
|
27206 | defineEventAttribute(CustomEventTarget.prototype, eventNames[i]);
|
27207 | }
|
27208 |
|
27209 | return CustomEventTarget;
|
27210 | }
|
27211 |
|
27212 |
|
27213 |
|
27214 |
|
27215 |
|
27216 |
|
27217 |
|
27218 |
|
27219 |
|
27220 |
|
27221 |
|
27222 |
|
27223 |
|
27224 |
|
27225 |
|
27226 | function EventTarget() {
|
27227 |
|
27228 | if (this instanceof EventTarget) {
|
27229 | listenersMap.set(this, new _map.default());
|
27230 | return;
|
27231 | }
|
27232 |
|
27233 | if (arguments.length === 1 && Array.isArray(arguments[0])) {
|
27234 | return defineCustomEventTarget(arguments[0]);
|
27235 | }
|
27236 |
|
27237 | if (arguments.length > 0) {
|
27238 | var types = new Array(arguments.length);
|
27239 |
|
27240 | for (var i = 0; i < arguments.length; ++i) {
|
27241 | types[i] = arguments[i];
|
27242 | }
|
27243 |
|
27244 | return defineCustomEventTarget(types);
|
27245 | }
|
27246 |
|
27247 | throw new TypeError("Cannot call a class as a function");
|
27248 |
|
27249 | }
|
27250 |
|
27251 |
|
27252 | EventTarget.prototype = {
|
27253 | |
27254 |
|
27255 |
|
27256 |
|
27257 |
|
27258 |
|
27259 |
|
27260 | addEventListener: function addEventListener(eventName, listener, options) {
|
27261 | if (listener == null) {
|
27262 | return;
|
27263 | }
|
27264 |
|
27265 | if (typeof listener !== "function" && !isObject(listener)) {
|
27266 | throw new TypeError("'listener' should be a function or an object.");
|
27267 | }
|
27268 |
|
27269 | var listeners = getListeners(this);
|
27270 | var optionsIsObj = isObject(options);
|
27271 | var capture = optionsIsObj ? Boolean(options.capture) : Boolean(options);
|
27272 | var listenerType = capture ? CAPTURE : BUBBLE;
|
27273 | var newNode = {
|
27274 | listener: listener,
|
27275 | listenerType: listenerType,
|
27276 | passive: optionsIsObj && Boolean(options.passive),
|
27277 | once: optionsIsObj && Boolean(options.once),
|
27278 | next: null
|
27279 | };
|
27280 |
|
27281 | var node = listeners.get(eventName);
|
27282 |
|
27283 | if (node === undefined) {
|
27284 | listeners.set(eventName, newNode);
|
27285 | return;
|
27286 | }
|
27287 |
|
27288 |
|
27289 | var prev = null;
|
27290 |
|
27291 | while (node != null) {
|
27292 | if (node.listener === listener && node.listenerType === listenerType) {
|
27293 |
|
27294 | return;
|
27295 | }
|
27296 |
|
27297 | prev = node;
|
27298 | node = node.next;
|
27299 | }
|
27300 |
|
27301 |
|
27302 | prev.next = newNode;
|
27303 | },
|
27304 |
|
27305 | |
27306 |
|
27307 |
|
27308 |
|
27309 |
|
27310 |
|
27311 |
|
27312 | removeEventListener: function removeEventListener(eventName, listener, options) {
|
27313 | if (listener == null) {
|
27314 | return;
|
27315 | }
|
27316 |
|
27317 | var listeners = getListeners(this);
|
27318 | var capture = isObject(options) ? Boolean(options.capture) : Boolean(options);
|
27319 | var listenerType = capture ? CAPTURE : BUBBLE;
|
27320 | var prev = null;
|
27321 | var node = listeners.get(eventName);
|
27322 |
|
27323 | while (node != null) {
|
27324 | if (node.listener === listener && node.listenerType === listenerType) {
|
27325 | if (prev !== null) {
|
27326 | prev.next = node.next;
|
27327 | } else if (node.next !== null) {
|
27328 | listeners.set(eventName, node.next);
|
27329 | } else {
|
27330 | listeners.delete(eventName);
|
27331 | }
|
27332 |
|
27333 | return;
|
27334 | }
|
27335 |
|
27336 | prev = node;
|
27337 | node = node.next;
|
27338 | }
|
27339 | },
|
27340 |
|
27341 | |
27342 |
|
27343 |
|
27344 |
|
27345 |
|
27346 | dispatchEvent: function dispatchEvent(event) {
|
27347 | if (event == null || typeof event.type !== "string") {
|
27348 | throw new TypeError('"event.type" should be a string.');
|
27349 | }
|
27350 |
|
27351 |
|
27352 | var listeners = getListeners(this);
|
27353 | var eventName = event.type;
|
27354 | var node = listeners.get(eventName);
|
27355 |
|
27356 | if (node == null) {
|
27357 | return true;
|
27358 | }
|
27359 |
|
27360 |
|
27361 | var wrappedEvent = wrapEvent(this, event);
|
27362 |
|
27363 |
|
27364 | var prev = null;
|
27365 |
|
27366 | while (node != null) {
|
27367 |
|
27368 | if (node.once) {
|
27369 | if (prev !== null) {
|
27370 | prev.next = node.next;
|
27371 | } else if (node.next !== null) {
|
27372 | listeners.set(eventName, node.next);
|
27373 | } else {
|
27374 | listeners.delete(eventName);
|
27375 | }
|
27376 | } else {
|
27377 | prev = node;
|
27378 | }
|
27379 |
|
27380 |
|
27381 | setPassiveListener(wrappedEvent, node.passive ? node.listener : null);
|
27382 |
|
27383 | if (typeof node.listener === "function") {
|
27384 | try {
|
27385 | node.listener.call(this, wrappedEvent);
|
27386 | } catch (err) {
|
27387 | if (typeof console !== "undefined" && typeof console.error === "function") {
|
27388 | console.error(err);
|
27389 | }
|
27390 | }
|
27391 | } else if (node.listenerType !== ATTRIBUTE && typeof node.listener.handleEvent === "function") {
|
27392 | node.listener.handleEvent(wrappedEvent);
|
27393 | }
|
27394 |
|
27395 |
|
27396 | if (isStopped(wrappedEvent)) {
|
27397 | break;
|
27398 | }
|
27399 |
|
27400 | node = node.next;
|
27401 | }
|
27402 |
|
27403 | setPassiveListener(wrappedEvent, null);
|
27404 | setEventPhase(wrappedEvent, 0);
|
27405 | setCurrentTarget(wrappedEvent, null);
|
27406 | return !wrappedEvent.defaultPrevented;
|
27407 | }
|
27408 | };
|
27409 |
|
27410 | (0, _defineProperty.default)(EventTarget.prototype, "constructor", {
|
27411 | value: EventTarget,
|
27412 | configurable: true,
|
27413 | writable: true
|
27414 | });
|
27415 |
|
27416 | if (typeof window !== "undefined" && typeof window.EventTarget !== "undefined") {
|
27417 | (0, _setPrototypeOf.default)(EventTarget.prototype, window.EventTarget.prototype);
|
27418 | }
|
27419 |
|
27420 | var WS =
|
27421 |
|
27422 | function (_super) {
|
27423 | __extends$1(WS, _super);
|
27424 |
|
27425 | function WS(url, protocol) {
|
27426 | var _this = _super.call(this) || this;
|
27427 |
|
27428 | _this._readyState = WS.CLOSED;
|
27429 |
|
27430 | if (!url) {
|
27431 | throw new TypeError("Failed to construct 'WebSocket': url required");
|
27432 | }
|
27433 |
|
27434 | _this._url = url;
|
27435 | _this._protocol = protocol;
|
27436 | return _this;
|
27437 | }
|
27438 |
|
27439 | (0, _defineProperty.default)(WS.prototype, "url", {
|
27440 | get: function get() {
|
27441 | return this._url;
|
27442 | },
|
27443 | enumerable: false,
|
27444 | configurable: true
|
27445 | });
|
27446 | (0, _defineProperty.default)(WS.prototype, "protocol", {
|
27447 | get: function get() {
|
27448 | return this._protocol;
|
27449 | },
|
27450 | enumerable: false,
|
27451 | configurable: true
|
27452 | });
|
27453 | (0, _defineProperty.default)(WS.prototype, "readyState", {
|
27454 | get: function get() {
|
27455 | return this._readyState;
|
27456 | },
|
27457 | enumerable: false,
|
27458 | configurable: true
|
27459 | });
|
27460 | WS.CONNECTING = 0;
|
27461 | WS.OPEN = 1;
|
27462 | WS.CLOSING = 2;
|
27463 | WS.CLOSED = 3;
|
27464 | return WS;
|
27465 | }(EventTarget("open", "error", "message", "close"));
|
27466 |
|
27467 | var WechatWS =
|
27468 |
|
27469 | function (_super) {
|
27470 | __extends$1(WechatWS, _super);
|
27471 |
|
27472 | function WechatWS(url, protocol) {
|
27473 | var _this = _super.call(this, url, protocol) || this;
|
27474 |
|
27475 | if (protocol && !(wx.canIUse && wx.canIUse("connectSocket.object.protocols"))) {
|
27476 | throw new Error("subprotocol not supported in weapp");
|
27477 | }
|
27478 |
|
27479 | _this._readyState = WS.CONNECTING;
|
27480 |
|
27481 | var errorHandler = function errorHandler(event) {
|
27482 | _this._readyState = WS.CLOSED;
|
27483 |
|
27484 | _this.dispatchEvent({
|
27485 | type: "error",
|
27486 | message: event.errMsg
|
27487 | });
|
27488 | };
|
27489 |
|
27490 | var socketTask = wx.connectSocket({
|
27491 | url: url,
|
27492 | protocols: _this._protocol === undefined || Array.isArray(_this._protocol) ? _this._protocol : [_this._protocol],
|
27493 | fail: function fail(error) {
|
27494 | return setTimeout(function () {
|
27495 | return errorHandler(error);
|
27496 | }, 0);
|
27497 | }
|
27498 | });
|
27499 | _this._socketTask = socketTask;
|
27500 | socketTask.onOpen(function () {
|
27501 | _this._readyState = WS.OPEN;
|
27502 |
|
27503 | _this.dispatchEvent({
|
27504 | type: "open"
|
27505 | });
|
27506 | });
|
27507 | socketTask.onError(errorHandler);
|
27508 | socketTask.onMessage(function (event) {
|
27509 | var data = event.data;
|
27510 |
|
27511 | _this.dispatchEvent({
|
27512 | data: data,
|
27513 | type: "message"
|
27514 | });
|
27515 | });
|
27516 | socketTask.onClose(function (event) {
|
27517 | _this._readyState = WS.CLOSED;
|
27518 | var code = event.code,
|
27519 | reason = event.reason;
|
27520 |
|
27521 | _this.dispatchEvent({
|
27522 | code: code,
|
27523 | reason: reason,
|
27524 | type: "close"
|
27525 | });
|
27526 | });
|
27527 | return _this;
|
27528 | }
|
27529 |
|
27530 | WechatWS.prototype.close = function () {
|
27531 | if (this.readyState === WS.CLOSED) return;
|
27532 |
|
27533 | if (this.readyState === WS.CONNECTING) {
|
27534 | console.warn("close WebSocket which is connecting might not work");
|
27535 | }
|
27536 |
|
27537 | this._socketTask.close({});
|
27538 | };
|
27539 |
|
27540 | WechatWS.prototype.send = function (data) {
|
27541 | if (this.readyState !== WS.OPEN) {
|
27542 | throw new Error("INVALID_STATE_ERR");
|
27543 | }
|
27544 |
|
27545 | if (!(typeof data === "string" || data instanceof ArrayBuffer)) {
|
27546 | throw new TypeError("only String/ArrayBuffer supported");
|
27547 | }
|
27548 |
|
27549 | this._socketTask.send({
|
27550 | data: data
|
27551 | });
|
27552 | };
|
27553 |
|
27554 | return WechatWS;
|
27555 | }(WS);
|
27556 |
|
27557 | var WebSocket = WechatWS;
|
27558 | var platformInfo = {
|
27559 | name: "Weapp"
|
27560 | };
|
27561 | exports.WebSocket = WebSocket;
|
27562 | exports.getAuthInfo = getAuthInfo;
|
27563 | exports.platformInfo = platformInfo;
|
27564 | exports.request = request;
|
27565 | exports.storage = storage;
|
27566 | exports.upload = upload;
|
27567 |
|
27568 | }),
|
27569 |
|
27570 | (function(module, exports, __webpack_require__) {
|
27571 |
|
27572 | var parent = __webpack_require__(573);
|
27573 |
|
27574 | module.exports = parent;
|
27575 |
|
27576 |
|
27577 | }),
|
27578 |
|
27579 | (function(module, exports, __webpack_require__) {
|
27580 |
|
27581 | __webpack_require__(574);
|
27582 | var path = __webpack_require__(5);
|
27583 |
|
27584 | module.exports = path.Object.assign;
|
27585 |
|
27586 |
|
27587 | }),
|
27588 |
|
27589 | (function(module, exports, __webpack_require__) {
|
27590 |
|
27591 | var $ = __webpack_require__(0);
|
27592 | var assign = __webpack_require__(575);
|
27593 |
|
27594 |
|
27595 |
|
27596 |
|
27597 | $({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== assign }, {
|
27598 | assign: assign
|
27599 | });
|
27600 |
|
27601 |
|
27602 | }),
|
27603 |
|
27604 | (function(module, exports, __webpack_require__) {
|
27605 |
|
27606 | "use strict";
|
27607 |
|
27608 | var DESCRIPTORS = __webpack_require__(14);
|
27609 | var uncurryThis = __webpack_require__(4);
|
27610 | var call = __webpack_require__(15);
|
27611 | var fails = __webpack_require__(2);
|
27612 | var objectKeys = __webpack_require__(105);
|
27613 | var getOwnPropertySymbolsModule = __webpack_require__(104);
|
27614 | var propertyIsEnumerableModule = __webpack_require__(121);
|
27615 | var toObject = __webpack_require__(34);
|
27616 | var IndexedObject = __webpack_require__(95);
|
27617 |
|
27618 |
|
27619 | var $assign = Object.assign;
|
27620 |
|
27621 | var defineProperty = Object.defineProperty;
|
27622 | var concat = uncurryThis([].concat);
|
27623 |
|
27624 |
|
27625 |
|
27626 | module.exports = !$assign || fails(function () {
|
27627 |
|
27628 | if (DESCRIPTORS && $assign({ b: 1 }, $assign(defineProperty({}, 'a', {
|
27629 | enumerable: true,
|
27630 | get: function () {
|
27631 | defineProperty(this, 'b', {
|
27632 | value: 3,
|
27633 | enumerable: false
|
27634 | });
|
27635 | }
|
27636 | }), { b: 2 })).b !== 1) return true;
|
27637 |
|
27638 | var A = {};
|
27639 | var B = {};
|
27640 |
|
27641 | var symbol = Symbol();
|
27642 | var alphabet = 'abcdefghijklmnopqrst';
|
27643 | A[symbol] = 7;
|
27644 | alphabet.split('').forEach(function (chr) { B[chr] = chr; });
|
27645 | return $assign({}, A)[symbol] != 7 || objectKeys($assign({}, B)).join('') != alphabet;
|
27646 | }) ? function assign(target, source) {
|
27647 | var T = toObject(target);
|
27648 | var argumentsLength = arguments.length;
|
27649 | var index = 1;
|
27650 | var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
|
27651 | var propertyIsEnumerable = propertyIsEnumerableModule.f;
|
27652 | while (argumentsLength > index) {
|
27653 | var S = IndexedObject(arguments[index++]);
|
27654 | var keys = getOwnPropertySymbols ? concat(objectKeys(S), getOwnPropertySymbols(S)) : objectKeys(S);
|
27655 | var length = keys.length;
|
27656 | var j = 0;
|
27657 | var key;
|
27658 | while (length > j) {
|
27659 | key = keys[j++];
|
27660 | if (!DESCRIPTORS || call(propertyIsEnumerable, S, key)) T[key] = S[key];
|
27661 | }
|
27662 | } return T;
|
27663 | } : $assign;
|
27664 |
|
27665 |
|
27666 | }),
|
27667 |
|
27668 | (function(module, exports, __webpack_require__) {
|
27669 |
|
27670 | var parent = __webpack_require__(577);
|
27671 |
|
27672 | module.exports = parent;
|
27673 |
|
27674 |
|
27675 | }),
|
27676 |
|
27677 | (function(module, exports, __webpack_require__) {
|
27678 |
|
27679 | __webpack_require__(245);
|
27680 | var path = __webpack_require__(5);
|
27681 |
|
27682 | module.exports = path.Object.getOwnPropertySymbols;
|
27683 |
|
27684 |
|
27685 | }),
|
27686 |
|
27687 | (function(module, exports, __webpack_require__) {
|
27688 |
|
27689 | module.exports = __webpack_require__(250);
|
27690 |
|
27691 | }),
|
27692 |
|
27693 | (function(module, exports, __webpack_require__) {
|
27694 |
|
27695 | var parent = __webpack_require__(580);
|
27696 | __webpack_require__(39);
|
27697 |
|
27698 | module.exports = parent;
|
27699 |
|
27700 |
|
27701 | }),
|
27702 |
|
27703 | (function(module, exports, __webpack_require__) {
|
27704 |
|
27705 | __webpack_require__(38);
|
27706 | __webpack_require__(53);
|
27707 | __webpack_require__(581);
|
27708 | var path = __webpack_require__(5);
|
27709 |
|
27710 | module.exports = path.WeakMap;
|
27711 |
|
27712 |
|
27713 | }),
|
27714 |
|
27715 | (function(module, exports, __webpack_require__) {
|
27716 |
|
27717 |
|
27718 | __webpack_require__(582);
|
27719 |
|
27720 |
|
27721 | }),
|
27722 |
|
27723 | (function(module, exports, __webpack_require__) {
|
27724 |
|
27725 | "use strict";
|
27726 |
|
27727 | var global = __webpack_require__(7);
|
27728 | var uncurryThis = __webpack_require__(4);
|
27729 | var defineBuiltIns = __webpack_require__(155);
|
27730 | var InternalMetadataModule = __webpack_require__(94);
|
27731 | var collection = __webpack_require__(156);
|
27732 | var collectionWeak = __webpack_require__(584);
|
27733 | var isObject = __webpack_require__(11);
|
27734 | var isExtensible = __webpack_require__(262);
|
27735 | var enforceInternalState = __webpack_require__(43).enforce;
|
27736 | var NATIVE_WEAK_MAP = __webpack_require__(171);
|
27737 |
|
27738 | var IS_IE11 = !global.ActiveXObject && 'ActiveXObject' in global;
|
27739 | var InternalWeakMap;
|
27740 |
|
27741 | var wrapper = function (init) {
|
27742 | return function WeakMap() {
|
27743 | return init(this, arguments.length ? arguments[0] : undefined);
|
27744 | };
|
27745 | };
|
27746 |
|
27747 |
|
27748 |
|
27749 | var $WeakMap = collection('WeakMap', wrapper, collectionWeak);
|
27750 |
|
27751 |
|
27752 |
|
27753 |
|
27754 | if (NATIVE_WEAK_MAP && IS_IE11) {
|
27755 | InternalWeakMap = collectionWeak.getConstructor(wrapper, 'WeakMap', true);
|
27756 | InternalMetadataModule.enable();
|
27757 | var WeakMapPrototype = $WeakMap.prototype;
|
27758 | var nativeDelete = uncurryThis(WeakMapPrototype['delete']);
|
27759 | var nativeHas = uncurryThis(WeakMapPrototype.has);
|
27760 | var nativeGet = uncurryThis(WeakMapPrototype.get);
|
27761 | var nativeSet = uncurryThis(WeakMapPrototype.set);
|
27762 | defineBuiltIns(WeakMapPrototype, {
|
27763 | 'delete': function (key) {
|
27764 | if (isObject(key) && !isExtensible(key)) {
|
27765 | var state = enforceInternalState(this);
|
27766 | if (!state.frozen) state.frozen = new InternalWeakMap();
|
27767 | return nativeDelete(this, key) || state.frozen['delete'](key);
|
27768 | } return nativeDelete(this, key);
|
27769 | },
|
27770 | has: function has(key) {
|
27771 | if (isObject(key) && !isExtensible(key)) {
|
27772 | var state = enforceInternalState(this);
|
27773 | if (!state.frozen) state.frozen = new InternalWeakMap();
|
27774 | return nativeHas(this, key) || state.frozen.has(key);
|
27775 | } return nativeHas(this, key);
|
27776 | },
|
27777 | get: function get(key) {
|
27778 | if (isObject(key) && !isExtensible(key)) {
|
27779 | var state = enforceInternalState(this);
|
27780 | if (!state.frozen) state.frozen = new InternalWeakMap();
|
27781 | return nativeHas(this, key) ? nativeGet(this, key) : state.frozen.get(key);
|
27782 | } return nativeGet(this, key);
|
27783 | },
|
27784 | set: function set(key, value) {
|
27785 | if (isObject(key) && !isExtensible(key)) {
|
27786 | var state = enforceInternalState(this);
|
27787 | if (!state.frozen) state.frozen = new InternalWeakMap();
|
27788 | nativeHas(this, key) ? nativeSet(this, key, value) : state.frozen.set(key, value);
|
27789 | } else nativeSet(this, key, value);
|
27790 | return this;
|
27791 | }
|
27792 | });
|
27793 | }
|
27794 |
|
27795 |
|
27796 | }),
|
27797 |
|
27798 | (function(module, exports, __webpack_require__) {
|
27799 |
|
27800 |
|
27801 | var fails = __webpack_require__(2);
|
27802 |
|
27803 | module.exports = fails(function () {
|
27804 | if (typeof ArrayBuffer == 'function') {
|
27805 | var buffer = new ArrayBuffer(8);
|
27806 |
|
27807 | if (Object.isExtensible(buffer)) Object.defineProperty(buffer, 'a', { value: 8 });
|
27808 | }
|
27809 | });
|
27810 |
|
27811 |
|
27812 | }),
|
27813 |
|
27814 | (function(module, exports, __webpack_require__) {
|
27815 |
|
27816 | "use strict";
|
27817 |
|
27818 | var uncurryThis = __webpack_require__(4);
|
27819 | var defineBuiltIns = __webpack_require__(155);
|
27820 | var getWeakData = __webpack_require__(94).getWeakData;
|
27821 | var anObject = __webpack_require__(20);
|
27822 | var isObject = __webpack_require__(11);
|
27823 | var anInstance = __webpack_require__(108);
|
27824 | var iterate = __webpack_require__(42);
|
27825 | var ArrayIterationModule = __webpack_require__(70);
|
27826 | var hasOwn = __webpack_require__(13);
|
27827 | var InternalStateModule = __webpack_require__(43);
|
27828 |
|
27829 | var setInternalState = InternalStateModule.set;
|
27830 | var internalStateGetterFor = InternalStateModule.getterFor;
|
27831 | var find = ArrayIterationModule.find;
|
27832 | var findIndex = ArrayIterationModule.findIndex;
|
27833 | var splice = uncurryThis([].splice);
|
27834 | var id = 0;
|
27835 |
|
27836 |
|
27837 | var uncaughtFrozenStore = function (store) {
|
27838 | return store.frozen || (store.frozen = new UncaughtFrozenStore());
|
27839 | };
|
27840 |
|
27841 | var UncaughtFrozenStore = function () {
|
27842 | this.entries = [];
|
27843 | };
|
27844 |
|
27845 | var findUncaughtFrozen = function (store, key) {
|
27846 | return find(store.entries, function (it) {
|
27847 | return it[0] === key;
|
27848 | });
|
27849 | };
|
27850 |
|
27851 | UncaughtFrozenStore.prototype = {
|
27852 | get: function (key) {
|
27853 | var entry = findUncaughtFrozen(this, key);
|
27854 | if (entry) return entry[1];
|
27855 | },
|
27856 | has: function (key) {
|
27857 | return !!findUncaughtFrozen(this, key);
|
27858 | },
|
27859 | set: function (key, value) {
|
27860 | var entry = findUncaughtFrozen(this, key);
|
27861 | if (entry) entry[1] = value;
|
27862 | else this.entries.push([key, value]);
|
27863 | },
|
27864 | 'delete': function (key) {
|
27865 | var index = findIndex(this.entries, function (it) {
|
27866 | return it[0] === key;
|
27867 | });
|
27868 | if (~index) splice(this.entries, index, 1);
|
27869 | return !!~index;
|
27870 | }
|
27871 | };
|
27872 |
|
27873 | module.exports = {
|
27874 | getConstructor: function (wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER) {
|
27875 | var Constructor = wrapper(function (that, iterable) {
|
27876 | anInstance(that, Prototype);
|
27877 | setInternalState(that, {
|
27878 | type: CONSTRUCTOR_NAME,
|
27879 | id: id++,
|
27880 | frozen: undefined
|
27881 | });
|
27882 | if (iterable != undefined) iterate(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP });
|
27883 | });
|
27884 |
|
27885 | var Prototype = Constructor.prototype;
|
27886 |
|
27887 | var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME);
|
27888 |
|
27889 | var define = function (that, key, value) {
|
27890 | var state = getInternalState(that);
|
27891 | var data = getWeakData(anObject(key), true);
|
27892 | if (data === true) uncaughtFrozenStore(state).set(key, value);
|
27893 | else data[state.id] = value;
|
27894 | return that;
|
27895 | };
|
27896 |
|
27897 | defineBuiltIns(Prototype, {
|
27898 |
|
27899 |
|
27900 |
|
27901 | 'delete': function (key) {
|
27902 | var state = getInternalState(this);
|
27903 | if (!isObject(key)) return false;
|
27904 | var data = getWeakData(key);
|
27905 | if (data === true) return uncaughtFrozenStore(state)['delete'](key);
|
27906 | return data && hasOwn(data, state.id) && delete data[state.id];
|
27907 | },
|
27908 |
|
27909 |
|
27910 |
|
27911 | has: function has(key) {
|
27912 | var state = getInternalState(this);
|
27913 | if (!isObject(key)) return false;
|
27914 | var data = getWeakData(key);
|
27915 | if (data === true) return uncaughtFrozenStore(state).has(key);
|
27916 | return data && hasOwn(data, state.id);
|
27917 | }
|
27918 | });
|
27919 |
|
27920 | defineBuiltIns(Prototype, IS_MAP ? {
|
27921 |
|
27922 |
|
27923 | get: function get(key) {
|
27924 | var state = getInternalState(this);
|
27925 | if (isObject(key)) {
|
27926 | var data = getWeakData(key);
|
27927 | if (data === true) return uncaughtFrozenStore(state).get(key);
|
27928 | return data ? data[state.id] : undefined;
|
27929 | }
|
27930 | },
|
27931 |
|
27932 |
|
27933 | set: function set(key, value) {
|
27934 | return define(this, key, value);
|
27935 | }
|
27936 | } : {
|
27937 |
|
27938 |
|
27939 | add: function add(value) {
|
27940 | return define(this, value, true);
|
27941 | }
|
27942 | });
|
27943 |
|
27944 | return Constructor;
|
27945 | }
|
27946 | };
|
27947 |
|
27948 |
|
27949 | }),
|
27950 |
|
27951 | (function(module, exports, __webpack_require__) {
|
27952 |
|
27953 | module.exports = __webpack_require__(586);
|
27954 |
|
27955 | }),
|
27956 |
|
27957 | (function(module, exports, __webpack_require__) {
|
27958 |
|
27959 | var parent = __webpack_require__(587);
|
27960 | __webpack_require__(39);
|
27961 |
|
27962 | module.exports = parent;
|
27963 |
|
27964 |
|
27965 | }),
|
27966 |
|
27967 | (function(module, exports, __webpack_require__) {
|
27968 |
|
27969 | __webpack_require__(38);
|
27970 | __webpack_require__(588);
|
27971 | __webpack_require__(53);
|
27972 | __webpack_require__(55);
|
27973 | var path = __webpack_require__(5);
|
27974 |
|
27975 | module.exports = path.Map;
|
27976 |
|
27977 |
|
27978 | }),
|
27979 |
|
27980 | (function(module, exports, __webpack_require__) {
|
27981 |
|
27982 |
|
27983 | __webpack_require__(589);
|
27984 |
|
27985 |
|
27986 | }),
|
27987 |
|
27988 | (function(module, exports, __webpack_require__) {
|
27989 |
|
27990 | "use strict";
|
27991 |
|
27992 | var collection = __webpack_require__(156);
|
27993 | var collectionStrong = __webpack_require__(264);
|
27994 |
|
27995 |
|
27996 |
|
27997 | collection('Map', function (init) {
|
27998 | return function Map() { return init(this, arguments.length ? arguments[0] : undefined); };
|
27999 | }, collectionStrong);
|
28000 |
|
28001 |
|
28002 | }),
|
28003 |
|
28004 | (function(module, exports, __webpack_require__) {
|
28005 |
|
28006 | "use strict";
|
28007 |
|
28008 |
|
28009 | var _require = __webpack_require__(157),
|
28010 | Realtime = _require.Realtime,
|
28011 | setRTMAdapters = _require.setAdapters;
|
28012 |
|
28013 | var _require2 = __webpack_require__(667),
|
28014 | LiveQueryPlugin = _require2.LiveQueryPlugin;
|
28015 |
|
28016 | Realtime.__preRegisteredPlugins = [LiveQueryPlugin];
|
28017 |
|
28018 | module.exports = function (AV) {
|
28019 | AV._sharedConfig.liveQueryRealtime = Realtime;
|
28020 | var setAdapters = AV.setAdapters;
|
28021 |
|
28022 | AV.setAdapters = function (adapters) {
|
28023 | setAdapters(adapters);
|
28024 | setRTMAdapters(adapters);
|
28025 | };
|
28026 |
|
28027 | return AV;
|
28028 | };
|
28029 |
|
28030 | }),
|
28031 |
|
28032 | (function(module, exports, __webpack_require__) {
|
28033 |
|
28034 | "use strict";
|
28035 | (function(global) {
|
28036 |
|
28037 | var _interopRequireDefault = __webpack_require__(1);
|
28038 |
|
28039 | var _typeof3 = _interopRequireDefault(__webpack_require__(73));
|
28040 |
|
28041 | var _defineProperty2 = _interopRequireDefault(__webpack_require__(92));
|
28042 |
|
28043 | var _freeze = _interopRequireDefault(__webpack_require__(592));
|
28044 |
|
28045 | var _assign = _interopRequireDefault(__webpack_require__(153));
|
28046 |
|
28047 | var _symbol = _interopRequireDefault(__webpack_require__(150));
|
28048 |
|
28049 | var _concat = _interopRequireDefault(__webpack_require__(22));
|
28050 |
|
28051 | var _keys = _interopRequireDefault(__webpack_require__(115));
|
28052 |
|
28053 | var _getOwnPropertySymbols = _interopRequireDefault(__webpack_require__(154));
|
28054 |
|
28055 | var _filter = _interopRequireDefault(__webpack_require__(251));
|
28056 |
|
28057 | var _getOwnPropertyDescriptor = _interopRequireDefault(__webpack_require__(152));
|
28058 |
|
28059 | var _getOwnPropertyDescriptors = _interopRequireDefault(__webpack_require__(596));
|
28060 |
|
28061 | var _defineProperties = _interopRequireDefault(__webpack_require__(600));
|
28062 |
|
28063 | var _promise = _interopRequireDefault(__webpack_require__(12));
|
28064 |
|
28065 | var _slice = _interopRequireDefault(__webpack_require__(61));
|
28066 |
|
28067 | var _indexOf = _interopRequireDefault(__webpack_require__(71));
|
28068 |
|
28069 | var _weakMap = _interopRequireDefault(__webpack_require__(261));
|
28070 |
|
28071 | var _stringify = _interopRequireDefault(__webpack_require__(36));
|
28072 |
|
28073 | var _map = _interopRequireDefault(__webpack_require__(35));
|
28074 |
|
28075 | var _reduce = _interopRequireDefault(__webpack_require__(604));
|
28076 |
|
28077 | var _find = _interopRequireDefault(__webpack_require__(93));
|
28078 |
|
28079 | var _set = _interopRequireDefault(__webpack_require__(265));
|
28080 |
|
28081 | var _context6, _context15;
|
28082 |
|
28083 | (0, _defineProperty2.default)(exports, '__esModule', {
|
28084 | value: true
|
28085 | });
|
28086 |
|
28087 | function _interopDefault(ex) {
|
28088 | return ex && (0, _typeof3.default)(ex) === 'object' && 'default' in ex ? ex['default'] : ex;
|
28089 | }
|
28090 |
|
28091 | var protobufLight = _interopDefault(__webpack_require__(614));
|
28092 |
|
28093 | var EventEmitter = _interopDefault(__webpack_require__(618));
|
28094 |
|
28095 | var _asyncToGenerator = _interopDefault(__webpack_require__(619));
|
28096 |
|
28097 | var _toConsumableArray = _interopDefault(__webpack_require__(620));
|
28098 |
|
28099 | var _defineProperty = _interopDefault(__webpack_require__(623));
|
28100 |
|
28101 | var _objectWithoutProperties = _interopDefault(__webpack_require__(625));
|
28102 |
|
28103 | var _assertThisInitialized = _interopDefault(__webpack_require__(627));
|
28104 |
|
28105 | var _inheritsLoose = _interopDefault(__webpack_require__(628));
|
28106 |
|
28107 | var _regeneratorRuntime = _interopDefault(__webpack_require__(630));
|
28108 |
|
28109 | var d = _interopDefault(__webpack_require__(60));
|
28110 |
|
28111 | var shuffle = _interopDefault(__webpack_require__(632));
|
28112 |
|
28113 | var values = _interopDefault(__webpack_require__(271));
|
28114 |
|
28115 | var _toArray = _interopDefault(__webpack_require__(659));
|
28116 |
|
28117 | var _createClass = _interopDefault(__webpack_require__(662));
|
28118 |
|
28119 | var _applyDecoratedDescriptor = _interopDefault(__webpack_require__(663));
|
28120 |
|
28121 | var StateMachine = _interopDefault(__webpack_require__(664));
|
28122 |
|
28123 | var _typeof = _interopDefault(__webpack_require__(118));
|
28124 |
|
28125 | var isPlainObject = _interopDefault(__webpack_require__(665));
|
28126 |
|
28127 | var promiseTimeout = __webpack_require__(252);
|
28128 |
|
28129 | var messageCompiled = protobufLight.newBuilder({})['import']({
|
28130 | "package": 'push_server.messages2',
|
28131 | syntax: 'proto2',
|
28132 | options: {
|
28133 | objc_class_prefix: 'AVIM'
|
28134 | },
|
28135 | messages: [{
|
28136 | name: 'JsonObjectMessage',
|
28137 | syntax: 'proto2',
|
28138 | fields: [{
|
28139 | rule: 'required',
|
28140 | type: 'string',
|
28141 | name: 'data',
|
28142 | id: 1
|
28143 | }]
|
28144 | }, {
|
28145 | name: 'UnreadTuple',
|
28146 | syntax: 'proto2',
|
28147 | fields: [{
|
28148 | rule: 'required',
|
28149 | type: 'string',
|
28150 | name: 'cid',
|
28151 | id: 1
|
28152 | }, {
|
28153 | rule: 'required',
|
28154 | type: 'int32',
|
28155 | name: 'unread',
|
28156 | id: 2
|
28157 | }, {
|
28158 | rule: 'optional',
|
28159 | type: 'string',
|
28160 | name: 'mid',
|
28161 | id: 3
|
28162 | }, {
|
28163 | rule: 'optional',
|
28164 | type: 'int64',
|
28165 | name: 'timestamp',
|
28166 | id: 4
|
28167 | }, {
|
28168 | rule: 'optional',
|
28169 | type: 'string',
|
28170 | name: 'from',
|
28171 | id: 5
|
28172 | }, {
|
28173 | rule: 'optional',
|
28174 | type: 'string',
|
28175 | name: 'data',
|
28176 | id: 6
|
28177 | }, {
|
28178 | rule: 'optional',
|
28179 | type: 'int64',
|
28180 | name: 'patchTimestamp',
|
28181 | id: 7
|
28182 | }, {
|
28183 | rule: 'optional',
|
28184 | type: 'bool',
|
28185 | name: 'mentioned',
|
28186 | id: 8
|
28187 | }, {
|
28188 | rule: 'optional',
|
28189 | type: 'bytes',
|
28190 | name: 'binaryMsg',
|
28191 | id: 9
|
28192 | }, {
|
28193 | rule: 'optional',
|
28194 | type: 'int32',
|
28195 | name: 'convType',
|
28196 | id: 10
|
28197 | }]
|
28198 | }, {
|
28199 | name: 'LogItem',
|
28200 | syntax: 'proto2',
|
28201 | fields: [{
|
28202 | rule: 'optional',
|
28203 | type: 'string',
|
28204 | name: 'from',
|
28205 | id: 1
|
28206 | }, {
|
28207 | rule: 'optional',
|
28208 | type: 'string',
|
28209 | name: 'data',
|
28210 | id: 2
|
28211 | }, {
|
28212 | rule: 'optional',
|
28213 | type: 'int64',
|
28214 | name: 'timestamp',
|
28215 | id: 3
|
28216 | }, {
|
28217 | rule: 'optional',
|
28218 | type: 'string',
|
28219 | name: 'msgId',
|
28220 | id: 4
|
28221 | }, {
|
28222 | rule: 'optional',
|
28223 | type: 'int64',
|
28224 | name: 'ackAt',
|
28225 | id: 5
|
28226 | }, {
|
28227 | rule: 'optional',
|
28228 | type: 'int64',
|
28229 | name: 'readAt',
|
28230 | id: 6
|
28231 | }, {
|
28232 | rule: 'optional',
|
28233 | type: 'int64',
|
28234 | name: 'patchTimestamp',
|
28235 | id: 7
|
28236 | }, {
|
28237 | rule: 'optional',
|
28238 | type: 'bool',
|
28239 | name: 'mentionAll',
|
28240 | id: 8
|
28241 | }, {
|
28242 | rule: 'repeated',
|
28243 | type: 'string',
|
28244 | name: 'mentionPids',
|
28245 | id: 9
|
28246 | }, {
|
28247 | rule: 'optional',
|
28248 | type: 'bool',
|
28249 | name: 'bin',
|
28250 | id: 10
|
28251 | }, {
|
28252 | rule: 'optional',
|
28253 | type: 'int32',
|
28254 | name: 'convType',
|
28255 | id: 11
|
28256 | }]
|
28257 | }, {
|
28258 | name: 'ConvMemberInfo',
|
28259 | syntax: 'proto2',
|
28260 | fields: [{
|
28261 | rule: 'optional',
|
28262 | type: 'string',
|
28263 | name: 'pid',
|
28264 | id: 1
|
28265 | }, {
|
28266 | rule: 'optional',
|
28267 | type: 'string',
|
28268 | name: 'role',
|
28269 | id: 2
|
28270 | }, {
|
28271 | rule: 'optional',
|
28272 | type: 'string',
|
28273 | name: 'infoId',
|
28274 | id: 3
|
28275 | }]
|
28276 | }, {
|
28277 | name: 'DataCommand',
|
28278 | syntax: 'proto2',
|
28279 | fields: [{
|
28280 | rule: 'repeated',
|
28281 | type: 'string',
|
28282 | name: 'ids',
|
28283 | id: 1
|
28284 | }, {
|
28285 | rule: 'repeated',
|
28286 | type: 'JsonObjectMessage',
|
28287 | name: 'msg',
|
28288 | id: 2
|
28289 | }, {
|
28290 | rule: 'optional',
|
28291 | type: 'bool',
|
28292 | name: 'offline',
|
28293 | id: 3
|
28294 | }]
|
28295 | }, {
|
28296 | name: 'SessionCommand',
|
28297 | syntax: 'proto2',
|
28298 | fields: [{
|
28299 | rule: 'optional',
|
28300 | type: 'int64',
|
28301 | name: 't',
|
28302 | id: 1
|
28303 | }, {
|
28304 | rule: 'optional',
|
28305 | type: 'string',
|
28306 | name: 'n',
|
28307 | id: 2
|
28308 | }, {
|
28309 | rule: 'optional',
|
28310 | type: 'string',
|
28311 | name: 's',
|
28312 | id: 3
|
28313 | }, {
|
28314 | rule: 'optional',
|
28315 | type: 'string',
|
28316 | name: 'ua',
|
28317 | id: 4
|
28318 | }, {
|
28319 | rule: 'optional',
|
28320 | type: 'bool',
|
28321 | name: 'r',
|
28322 | id: 5
|
28323 | }, {
|
28324 | rule: 'optional',
|
28325 | type: 'string',
|
28326 | name: 'tag',
|
28327 | id: 6
|
28328 | }, {
|
28329 | rule: 'optional',
|
28330 | type: 'string',
|
28331 | name: 'deviceId',
|
28332 | id: 7
|
28333 | }, {
|
28334 | rule: 'repeated',
|
28335 | type: 'string',
|
28336 | name: 'sessionPeerIds',
|
28337 | id: 8
|
28338 | }, {
|
28339 | rule: 'repeated',
|
28340 | type: 'string',
|
28341 | name: 'onlineSessionPeerIds',
|
28342 | id: 9
|
28343 | }, {
|
28344 | rule: 'optional',
|
28345 | type: 'string',
|
28346 | name: 'st',
|
28347 | id: 10
|
28348 | }, {
|
28349 | rule: 'optional',
|
28350 | type: 'int32',
|
28351 | name: 'stTtl',
|
28352 | id: 11
|
28353 | }, {
|
28354 | rule: 'optional',
|
28355 | type: 'int32',
|
28356 | name: 'code',
|
28357 | id: 12
|
28358 | }, {
|
28359 | rule: 'optional',
|
28360 | type: 'string',
|
28361 | name: 'reason',
|
28362 | id: 13
|
28363 | }, {
|
28364 | rule: 'optional',
|
28365 | type: 'string',
|
28366 | name: 'deviceToken',
|
28367 | id: 14
|
28368 | }, {
|
28369 | rule: 'optional',
|
28370 | type: 'bool',
|
28371 | name: 'sp',
|
28372 | id: 15
|
28373 | }, {
|
28374 | rule: 'optional',
|
28375 | type: 'string',
|
28376 | name: 'detail',
|
28377 | id: 16
|
28378 | }, {
|
28379 | rule: 'optional',
|
28380 | type: 'int64',
|
28381 | name: 'lastUnreadNotifTime',
|
28382 | id: 17
|
28383 | }, {
|
28384 | rule: 'optional',
|
28385 | type: 'int64',
|
28386 | name: 'lastPatchTime',
|
28387 | id: 18
|
28388 | }, {
|
28389 | rule: 'optional',
|
28390 | type: 'int64',
|
28391 | name: 'configBitmap',
|
28392 | id: 19
|
28393 | }]
|
28394 | }, {
|
28395 | name: 'ErrorCommand',
|
28396 | syntax: 'proto2',
|
28397 | fields: [{
|
28398 | rule: 'required',
|
28399 | type: 'int32',
|
28400 | name: 'code',
|
28401 | id: 1
|
28402 | }, {
|
28403 | rule: 'required',
|
28404 | type: 'string',
|
28405 | name: 'reason',
|
28406 | id: 2
|
28407 | }, {
|
28408 | rule: 'optional',
|
28409 | type: 'int32',
|
28410 | name: 'appCode',
|
28411 | id: 3
|
28412 | }, {
|
28413 | rule: 'optional',
|
28414 | type: 'string',
|
28415 | name: 'detail',
|
28416 | id: 4
|
28417 | }, {
|
28418 | rule: 'repeated',
|
28419 | type: 'string',
|
28420 | name: 'pids',
|
28421 | id: 5
|
28422 | }, {
|
28423 | rule: 'optional',
|
28424 | type: 'string',
|
28425 | name: 'appMsg',
|
28426 | id: 6
|
28427 | }]
|
28428 | }, {
|
28429 | name: 'DirectCommand',
|
28430 | syntax: 'proto2',
|
28431 | fields: [{
|
28432 | rule: 'optional',
|
28433 | type: 'string',
|
28434 | name: 'msg',
|
28435 | id: 1
|
28436 | }, {
|
28437 | rule: 'optional',
|
28438 | type: 'string',
|
28439 | name: 'uid',
|
28440 | id: 2
|
28441 | }, {
|
28442 | rule: 'optional',
|
28443 | type: 'string',
|
28444 | name: 'fromPeerId',
|
28445 | id: 3
|
28446 | }, {
|
28447 | rule: 'optional',
|
28448 | type: 'int64',
|
28449 | name: 'timestamp',
|
28450 | id: 4
|
28451 | }, {
|
28452 | rule: 'optional',
|
28453 | type: 'bool',
|
28454 | name: 'offline',
|
28455 | id: 5
|
28456 | }, {
|
28457 | rule: 'optional',
|
28458 | type: 'bool',
|
28459 | name: 'hasMore',
|
28460 | id: 6
|
28461 | }, {
|
28462 | rule: 'repeated',
|
28463 | type: 'string',
|
28464 | name: 'toPeerIds',
|
28465 | id: 7
|
28466 | }, {
|
28467 | rule: 'optional',
|
28468 | type: 'bool',
|
28469 | name: 'r',
|
28470 | id: 10
|
28471 | }, {
|
28472 | rule: 'optional',
|
28473 | type: 'string',
|
28474 | name: 'cid',
|
28475 | id: 11
|
28476 | }, {
|
28477 | rule: 'optional',
|
28478 | type: 'string',
|
28479 | name: 'id',
|
28480 | id: 12
|
28481 | }, {
|
28482 | rule: 'optional',
|
28483 | type: 'bool',
|
28484 | name: 'transient',
|
28485 | id: 13
|
28486 | }, {
|
28487 | rule: 'optional',
|
28488 | type: 'string',
|
28489 | name: 'dt',
|
28490 | id: 14
|
28491 | }, {
|
28492 | rule: 'optional',
|
28493 | type: 'string',
|
28494 | name: 'roomId',
|
28495 | id: 15
|
28496 | }, {
|
28497 | rule: 'optional',
|
28498 | type: 'string',
|
28499 | name: 'pushData',
|
28500 | id: 16
|
28501 | }, {
|
28502 | rule: 'optional',
|
28503 | type: 'bool',
|
28504 | name: 'will',
|
28505 | id: 17
|
28506 | }, {
|
28507 | rule: 'optional',
|
28508 | type: 'int64',
|
28509 | name: 'patchTimestamp',
|
28510 | id: 18
|
28511 | }, {
|
28512 | rule: 'optional',
|
28513 | type: 'bytes',
|
28514 | name: 'binaryMsg',
|
28515 | id: 19
|
28516 | }, {
|
28517 | rule: 'repeated',
|
28518 | type: 'string',
|
28519 | name: 'mentionPids',
|
28520 | id: 20
|
28521 | }, {
|
28522 | rule: 'optional',
|
28523 | type: 'bool',
|
28524 | name: 'mentionAll',
|
28525 | id: 21
|
28526 | }, {
|
28527 | rule: 'optional',
|
28528 | type: 'int32',
|
28529 | name: 'convType',
|
28530 | id: 22
|
28531 | }]
|
28532 | }, {
|
28533 | name: 'AckCommand',
|
28534 | syntax: 'proto2',
|
28535 | fields: [{
|
28536 | rule: 'optional',
|
28537 | type: 'int32',
|
28538 | name: 'code',
|
28539 | id: 1
|
28540 | }, {
|
28541 | rule: 'optional',
|
28542 | type: 'string',
|
28543 | name: 'reason',
|
28544 | id: 2
|
28545 | }, {
|
28546 | rule: 'optional',
|
28547 | type: 'string',
|
28548 | name: 'mid',
|
28549 | id: 3
|
28550 | }, {
|
28551 | rule: 'optional',
|
28552 | type: 'string',
|
28553 | name: 'cid',
|
28554 | id: 4
|
28555 | }, {
|
28556 | rule: 'optional',
|
28557 | type: 'int64',
|
28558 | name: 't',
|
28559 | id: 5
|
28560 | }, {
|
28561 | rule: 'optional',
|
28562 | type: 'string',
|
28563 | name: 'uid',
|
28564 | id: 6
|
28565 | }, {
|
28566 | rule: 'optional',
|
28567 | type: 'int64',
|
28568 | name: 'fromts',
|
28569 | id: 7
|
28570 | }, {
|
28571 | rule: 'optional',
|
28572 | type: 'int64',
|
28573 | name: 'tots',
|
28574 | id: 8
|
28575 | }, {
|
28576 | rule: 'optional',
|
28577 | type: 'string',
|
28578 | name: 'type',
|
28579 | id: 9
|
28580 | }, {
|
28581 | rule: 'repeated',
|
28582 | type: 'string',
|
28583 | name: 'ids',
|
28584 | id: 10
|
28585 | }, {
|
28586 | rule: 'optional',
|
28587 | type: 'int32',
|
28588 | name: 'appCode',
|
28589 | id: 11
|
28590 | }, {
|
28591 | rule: 'optional',
|
28592 | type: 'string',
|
28593 | name: 'appMsg',
|
28594 | id: 12
|
28595 | }]
|
28596 | }, {
|
28597 | name: 'UnreadCommand',
|
28598 | syntax: 'proto2',
|
28599 | fields: [{
|
28600 | rule: 'repeated',
|
28601 | type: 'UnreadTuple',
|
28602 | name: 'convs',
|
28603 | id: 1
|
28604 | }, {
|
28605 | rule: 'optional',
|
28606 | type: 'int64',
|
28607 | name: 'notifTime',
|
28608 | id: 2
|
28609 | }]
|
28610 | }, {
|
28611 | name: 'ConvCommand',
|
28612 | syntax: 'proto2',
|
28613 | fields: [{
|
28614 | rule: 'repeated',
|
28615 | type: 'string',
|
28616 | name: 'm',
|
28617 | id: 1
|
28618 | }, {
|
28619 | rule: 'optional',
|
28620 | type: 'bool',
|
28621 | name: 'transient',
|
28622 | id: 2
|
28623 | }, {
|
28624 | rule: 'optional',
|
28625 | type: 'bool',
|
28626 | name: 'unique',
|
28627 | id: 3
|
28628 | }, {
|
28629 | rule: 'optional',
|
28630 | type: 'string',
|
28631 | name: 'cid',
|
28632 | id: 4
|
28633 | }, {
|
28634 | rule: 'optional',
|
28635 | type: 'string',
|
28636 | name: 'cdate',
|
28637 | id: 5
|
28638 | }, {
|
28639 | rule: 'optional',
|
28640 | type: 'string',
|
28641 | name: 'initBy',
|
28642 | id: 6
|
28643 | }, {
|
28644 | rule: 'optional',
|
28645 | type: 'string',
|
28646 | name: 'sort',
|
28647 | id: 7
|
28648 | }, {
|
28649 | rule: 'optional',
|
28650 | type: 'int32',
|
28651 | name: 'limit',
|
28652 | id: 8
|
28653 | }, {
|
28654 | rule: 'optional',
|
28655 | type: 'int32',
|
28656 | name: 'skip',
|
28657 | id: 9
|
28658 | }, {
|
28659 | rule: 'optional',
|
28660 | type: 'int32',
|
28661 | name: 'flag',
|
28662 | id: 10
|
28663 | }, {
|
28664 | rule: 'optional',
|
28665 | type: 'int32',
|
28666 | name: 'count',
|
28667 | id: 11
|
28668 | }, {
|
28669 | rule: 'optional',
|
28670 | type: 'string',
|
28671 | name: 'udate',
|
28672 | id: 12
|
28673 | }, {
|
28674 | rule: 'optional',
|
28675 | type: 'int64',
|
28676 | name: 't',
|
28677 | id: 13
|
28678 | }, {
|
28679 | rule: 'optional',
|
28680 | type: 'string',
|
28681 | name: 'n',
|
28682 | id: 14
|
28683 | }, {
|
28684 | rule: 'optional',
|
28685 | type: 'string',
|
28686 | name: 's',
|
28687 | id: 15
|
28688 | }, {
|
28689 | rule: 'optional',
|
28690 | type: 'bool',
|
28691 | name: 'statusSub',
|
28692 | id: 16
|
28693 | }, {
|
28694 | rule: 'optional',
|
28695 | type: 'bool',
|
28696 | name: 'statusPub',
|
28697 | id: 17
|
28698 | }, {
|
28699 | rule: 'optional',
|
28700 | type: 'int32',
|
28701 | name: 'statusTTL',
|
28702 | id: 18
|
28703 | }, {
|
28704 | rule: 'optional',
|
28705 | type: 'string',
|
28706 | name: 'uniqueId',
|
28707 | id: 19
|
28708 | }, {
|
28709 | rule: 'optional',
|
28710 | type: 'string',
|
28711 | name: 'targetClientId',
|
28712 | id: 20
|
28713 | }, {
|
28714 | rule: 'optional',
|
28715 | type: 'int64',
|
28716 | name: 'maxReadTimestamp',
|
28717 | id: 21
|
28718 | }, {
|
28719 | rule: 'optional',
|
28720 | type: 'int64',
|
28721 | name: 'maxAckTimestamp',
|
28722 | id: 22
|
28723 | }, {
|
28724 | rule: 'optional',
|
28725 | type: 'bool',
|
28726 | name: 'queryAllMembers',
|
28727 | id: 23
|
28728 | }, {
|
28729 | rule: 'repeated',
|
28730 | type: 'MaxReadTuple',
|
28731 | name: 'maxReadTuples',
|
28732 | id: 24
|
28733 | }, {
|
28734 | rule: 'repeated',
|
28735 | type: 'string',
|
28736 | name: 'cids',
|
28737 | id: 25
|
28738 | }, {
|
28739 | rule: 'optional',
|
28740 | type: 'ConvMemberInfo',
|
28741 | name: 'info',
|
28742 | id: 26
|
28743 | }, {
|
28744 | rule: 'optional',
|
28745 | type: 'bool',
|
28746 | name: 'tempConv',
|
28747 | id: 27
|
28748 | }, {
|
28749 | rule: 'optional',
|
28750 | type: 'int32',
|
28751 | name: 'tempConvTTL',
|
28752 | id: 28
|
28753 | }, {
|
28754 | rule: 'repeated',
|
28755 | type: 'string',
|
28756 | name: 'tempConvIds',
|
28757 | id: 29
|
28758 | }, {
|
28759 | rule: 'repeated',
|
28760 | type: 'string',
|
28761 | name: 'allowedPids',
|
28762 | id: 30
|
28763 | }, {
|
28764 | rule: 'repeated',
|
28765 | type: 'ErrorCommand',
|
28766 | name: 'failedPids',
|
28767 | id: 31
|
28768 | }, {
|
28769 | rule: 'optional',
|
28770 | type: 'string',
|
28771 | name: 'next',
|
28772 | id: 40
|
28773 | }, {
|
28774 | rule: 'optional',
|
28775 | type: 'JsonObjectMessage',
|
28776 | name: 'results',
|
28777 | id: 100
|
28778 | }, {
|
28779 | rule: 'optional',
|
28780 | type: 'JsonObjectMessage',
|
28781 | name: 'where',
|
28782 | id: 101
|
28783 | }, {
|
28784 | rule: 'optional',
|
28785 | type: 'JsonObjectMessage',
|
28786 | name: 'attr',
|
28787 | id: 103
|
28788 | }, {
|
28789 | rule: 'optional',
|
28790 | type: 'JsonObjectMessage',
|
28791 | name: 'attrModified',
|
28792 | id: 104
|
28793 | }]
|
28794 | }, {
|
28795 | name: 'RoomCommand',
|
28796 | syntax: 'proto2',
|
28797 | fields: [{
|
28798 | rule: 'optional',
|
28799 | type: 'string',
|
28800 | name: 'roomId',
|
28801 | id: 1
|
28802 | }, {
|
28803 | rule: 'optional',
|
28804 | type: 'string',
|
28805 | name: 's',
|
28806 | id: 2
|
28807 | }, {
|
28808 | rule: 'optional',
|
28809 | type: 'int64',
|
28810 | name: 't',
|
28811 | id: 3
|
28812 | }, {
|
28813 | rule: 'optional',
|
28814 | type: 'string',
|
28815 | name: 'n',
|
28816 | id: 4
|
28817 | }, {
|
28818 | rule: 'optional',
|
28819 | type: 'bool',
|
28820 | name: 'transient',
|
28821 | id: 5
|
28822 | }, {
|
28823 | rule: 'repeated',
|
28824 | type: 'string',
|
28825 | name: 'roomPeerIds',
|
28826 | id: 6
|
28827 | }, {
|
28828 | rule: 'optional',
|
28829 | type: 'string',
|
28830 | name: 'byPeerId',
|
28831 | id: 7
|
28832 | }]
|
28833 | }, {
|
28834 | name: 'LogsCommand',
|
28835 | syntax: 'proto2',
|
28836 | fields: [{
|
28837 | rule: 'optional',
|
28838 | type: 'string',
|
28839 | name: 'cid',
|
28840 | id: 1
|
28841 | }, {
|
28842 | rule: 'optional',
|
28843 | type: 'int32',
|
28844 | name: 'l',
|
28845 | id: 2
|
28846 | }, {
|
28847 | rule: 'optional',
|
28848 | type: 'int32',
|
28849 | name: 'limit',
|
28850 | id: 3
|
28851 | }, {
|
28852 | rule: 'optional',
|
28853 | type: 'int64',
|
28854 | name: 't',
|
28855 | id: 4
|
28856 | }, {
|
28857 | rule: 'optional',
|
28858 | type: 'int64',
|
28859 | name: 'tt',
|
28860 | id: 5
|
28861 | }, {
|
28862 | rule: 'optional',
|
28863 | type: 'string',
|
28864 | name: 'tmid',
|
28865 | id: 6
|
28866 | }, {
|
28867 | rule: 'optional',
|
28868 | type: 'string',
|
28869 | name: 'mid',
|
28870 | id: 7
|
28871 | }, {
|
28872 | rule: 'optional',
|
28873 | type: 'string',
|
28874 | name: 'checksum',
|
28875 | id: 8
|
28876 | }, {
|
28877 | rule: 'optional',
|
28878 | type: 'bool',
|
28879 | name: 'stored',
|
28880 | id: 9
|
28881 | }, {
|
28882 | rule: 'optional',
|
28883 | type: 'QueryDirection',
|
28884 | name: 'direction',
|
28885 | id: 10,
|
28886 | options: {
|
28887 | "default": 'OLD'
|
28888 | }
|
28889 | }, {
|
28890 | rule: 'optional',
|
28891 | type: 'bool',
|
28892 | name: 'tIncluded',
|
28893 | id: 11
|
28894 | }, {
|
28895 | rule: 'optional',
|
28896 | type: 'bool',
|
28897 | name: 'ttIncluded',
|
28898 | id: 12
|
28899 | }, {
|
28900 | rule: 'optional',
|
28901 | type: 'int32',
|
28902 | name: 'lctype',
|
28903 | id: 13
|
28904 | }, {
|
28905 | rule: 'repeated',
|
28906 | type: 'LogItem',
|
28907 | name: 'logs',
|
28908 | id: 105
|
28909 | }],
|
28910 | enums: [{
|
28911 | name: 'QueryDirection',
|
28912 | syntax: 'proto2',
|
28913 | values: [{
|
28914 | name: 'OLD',
|
28915 | id: 1
|
28916 | }, {
|
28917 | name: 'NEW',
|
28918 | id: 2
|
28919 | }]
|
28920 | }]
|
28921 | }, {
|
28922 | name: 'RcpCommand',
|
28923 | syntax: 'proto2',
|
28924 | fields: [{
|
28925 | rule: 'optional',
|
28926 | type: 'string',
|
28927 | name: 'id',
|
28928 | id: 1
|
28929 | }, {
|
28930 | rule: 'optional',
|
28931 | type: 'string',
|
28932 | name: 'cid',
|
28933 | id: 2
|
28934 | }, {
|
28935 | rule: 'optional',
|
28936 | type: 'int64',
|
28937 | name: 't',
|
28938 | id: 3
|
28939 | }, {
|
28940 | rule: 'optional',
|
28941 | type: 'bool',
|
28942 | name: 'read',
|
28943 | id: 4
|
28944 | }, {
|
28945 | rule: 'optional',
|
28946 | type: 'string',
|
28947 | name: 'from',
|
28948 | id: 5
|
28949 | }]
|
28950 | }, {
|
28951 | name: 'ReadTuple',
|
28952 | syntax: 'proto2',
|
28953 | fields: [{
|
28954 | rule: 'required',
|
28955 | type: 'string',
|
28956 | name: 'cid',
|
28957 | id: 1
|
28958 | }, {
|
28959 | rule: 'optional',
|
28960 | type: 'int64',
|
28961 | name: 'timestamp',
|
28962 | id: 2
|
28963 | }, {
|
28964 | rule: 'optional',
|
28965 | type: 'string',
|
28966 | name: 'mid',
|
28967 | id: 3
|
28968 | }]
|
28969 | }, {
|
28970 | name: 'MaxReadTuple',
|
28971 | syntax: 'proto2',
|
28972 | fields: [{
|
28973 | rule: 'optional',
|
28974 | type: 'string',
|
28975 | name: 'pid',
|
28976 | id: 1
|
28977 | }, {
|
28978 | rule: 'optional',
|
28979 | type: 'int64',
|
28980 | name: 'maxAckTimestamp',
|
28981 | id: 2
|
28982 | }, {
|
28983 | rule: 'optional',
|
28984 | type: 'int64',
|
28985 | name: 'maxReadTimestamp',
|
28986 | id: 3
|
28987 | }]
|
28988 | }, {
|
28989 | name: 'ReadCommand',
|
28990 | syntax: 'proto2',
|
28991 | fields: [{
|
28992 | rule: 'optional',
|
28993 | type: 'string',
|
28994 | name: 'cid',
|
28995 | id: 1
|
28996 | }, {
|
28997 | rule: 'repeated',
|
28998 | type: 'string',
|
28999 | name: 'cids',
|
29000 | id: 2
|
29001 | }, {
|
29002 | rule: 'repeated',
|
29003 | type: 'ReadTuple',
|
29004 | name: 'convs',
|
29005 | id: 3
|
29006 | }]
|
29007 | }, {
|
29008 | name: 'PresenceCommand',
|
29009 | syntax: 'proto2',
|
29010 | fields: [{
|
29011 | rule: 'optional',
|
29012 | type: 'StatusType',
|
29013 | name: 'status',
|
29014 | id: 1
|
29015 | }, {
|
29016 | rule: 'repeated',
|
29017 | type: 'string',
|
29018 | name: 'sessionPeerIds',
|
29019 | id: 2
|
29020 | }, {
|
29021 | rule: 'optional',
|
29022 | type: 'string',
|
29023 | name: 'cid',
|
29024 | id: 3
|
29025 | }]
|
29026 | }, {
|
29027 | name: 'ReportCommand',
|
29028 | syntax: 'proto2',
|
29029 | fields: [{
|
29030 | rule: 'optional',
|
29031 | type: 'bool',
|
29032 | name: 'initiative',
|
29033 | id: 1
|
29034 | }, {
|
29035 | rule: 'optional',
|
29036 | type: 'string',
|
29037 | name: 'type',
|
29038 | id: 2
|
29039 | }, {
|
29040 | rule: 'optional',
|
29041 | type: 'string',
|
29042 | name: 'data',
|
29043 | id: 3
|
29044 | }]
|
29045 | }, {
|
29046 | name: 'PatchItem',
|
29047 | syntax: 'proto2',
|
29048 | fields: [{
|
29049 | rule: 'optional',
|
29050 | type: 'string',
|
29051 | name: 'cid',
|
29052 | id: 1
|
29053 | }, {
|
29054 | rule: 'optional',
|
29055 | type: 'string',
|
29056 | name: 'mid',
|
29057 | id: 2
|
29058 | }, {
|
29059 | rule: 'optional',
|
29060 | type: 'int64',
|
29061 | name: 'timestamp',
|
29062 | id: 3
|
29063 | }, {
|
29064 | rule: 'optional',
|
29065 | type: 'bool',
|
29066 | name: 'recall',
|
29067 | id: 4
|
29068 | }, {
|
29069 | rule: 'optional',
|
29070 | type: 'string',
|
29071 | name: 'data',
|
29072 | id: 5
|
29073 | }, {
|
29074 | rule: 'optional',
|
29075 | type: 'int64',
|
29076 | name: 'patchTimestamp',
|
29077 | id: 6
|
29078 | }, {
|
29079 | rule: 'optional',
|
29080 | type: 'string',
|
29081 | name: 'from',
|
29082 | id: 7
|
29083 | }, {
|
29084 | rule: 'optional',
|
29085 | type: 'bytes',
|
29086 | name: 'binaryMsg',
|
29087 | id: 8
|
29088 | }, {
|
29089 | rule: 'optional',
|
29090 | type: 'bool',
|
29091 | name: 'mentionAll',
|
29092 | id: 9
|
29093 | }, {
|
29094 | rule: 'repeated',
|
29095 | type: 'string',
|
29096 | name: 'mentionPids',
|
29097 | id: 10
|
29098 | }, {
|
29099 | rule: 'optional',
|
29100 | type: 'int64',
|
29101 | name: 'patchCode',
|
29102 | id: 11
|
29103 | }, {
|
29104 | rule: 'optional',
|
29105 | type: 'string',
|
29106 | name: 'patchReason',
|
29107 | id: 12
|
29108 | }]
|
29109 | }, {
|
29110 | name: 'PatchCommand',
|
29111 | syntax: 'proto2',
|
29112 | fields: [{
|
29113 | rule: 'repeated',
|
29114 | type: 'PatchItem',
|
29115 | name: 'patches',
|
29116 | id: 1
|
29117 | }, {
|
29118 | rule: 'optional',
|
29119 | type: 'int64',
|
29120 | name: 'lastPatchTime',
|
29121 | id: 2
|
29122 | }]
|
29123 | }, {
|
29124 | name: 'PubsubCommand',
|
29125 | syntax: 'proto2',
|
29126 | fields: [{
|
29127 | rule: 'optional',
|
29128 | type: 'string',
|
29129 | name: 'cid',
|
29130 | id: 1
|
29131 | }, {
|
29132 | rule: 'repeated',
|
29133 | type: 'string',
|
29134 | name: 'cids',
|
29135 | id: 2
|
29136 | }, {
|
29137 | rule: 'optional',
|
29138 | type: 'string',
|
29139 | name: 'topic',
|
29140 | id: 3
|
29141 | }, {
|
29142 | rule: 'optional',
|
29143 | type: 'string',
|
29144 | name: 'subtopic',
|
29145 | id: 4
|
29146 | }, {
|
29147 | rule: 'repeated',
|
29148 | type: 'string',
|
29149 | name: 'topics',
|
29150 | id: 5
|
29151 | }, {
|
29152 | rule: 'repeated',
|
29153 | type: 'string',
|
29154 | name: 'subtopics',
|
29155 | id: 6
|
29156 | }, {
|
29157 | rule: 'optional',
|
29158 | type: 'JsonObjectMessage',
|
29159 | name: 'results',
|
29160 | id: 7
|
29161 | }]
|
29162 | }, {
|
29163 | name: 'BlacklistCommand',
|
29164 | syntax: 'proto2',
|
29165 | fields: [{
|
29166 | rule: 'optional',
|
29167 | type: 'string',
|
29168 | name: 'srcCid',
|
29169 | id: 1
|
29170 | }, {
|
29171 | rule: 'repeated',
|
29172 | type: 'string',
|
29173 | name: 'toPids',
|
29174 | id: 2
|
29175 | }, {
|
29176 | rule: 'optional',
|
29177 | type: 'string',
|
29178 | name: 'srcPid',
|
29179 | id: 3
|
29180 | }, {
|
29181 | rule: 'repeated',
|
29182 | type: 'string',
|
29183 | name: 'toCids',
|
29184 | id: 4
|
29185 | }, {
|
29186 | rule: 'optional',
|
29187 | type: 'int32',
|
29188 | name: 'limit',
|
29189 | id: 5
|
29190 | }, {
|
29191 | rule: 'optional',
|
29192 | type: 'string',
|
29193 | name: 'next',
|
29194 | id: 6
|
29195 | }, {
|
29196 | rule: 'repeated',
|
29197 | type: 'string',
|
29198 | name: 'blockedPids',
|
29199 | id: 8
|
29200 | }, {
|
29201 | rule: 'repeated',
|
29202 | type: 'string',
|
29203 | name: 'blockedCids',
|
29204 | id: 9
|
29205 | }, {
|
29206 | rule: 'repeated',
|
29207 | type: 'string',
|
29208 | name: 'allowedPids',
|
29209 | id: 10
|
29210 | }, {
|
29211 | rule: 'repeated',
|
29212 | type: 'ErrorCommand',
|
29213 | name: 'failedPids',
|
29214 | id: 11
|
29215 | }, {
|
29216 | rule: 'optional',
|
29217 | type: 'int64',
|
29218 | name: 't',
|
29219 | id: 12
|
29220 | }, {
|
29221 | rule: 'optional',
|
29222 | type: 'string',
|
29223 | name: 'n',
|
29224 | id: 13
|
29225 | }, {
|
29226 | rule: 'optional',
|
29227 | type: 'string',
|
29228 | name: 's',
|
29229 | id: 14
|
29230 | }]
|
29231 | }, {
|
29232 | name: 'GenericCommand',
|
29233 | syntax: 'proto2',
|
29234 | fields: [{
|
29235 | rule: 'optional',
|
29236 | type: 'CommandType',
|
29237 | name: 'cmd',
|
29238 | id: 1
|
29239 | }, {
|
29240 | rule: 'optional',
|
29241 | type: 'OpType',
|
29242 | name: 'op',
|
29243 | id: 2
|
29244 | }, {
|
29245 | rule: 'optional',
|
29246 | type: 'string',
|
29247 | name: 'appId',
|
29248 | id: 3
|
29249 | }, {
|
29250 | rule: 'optional',
|
29251 | type: 'string',
|
29252 | name: 'peerId',
|
29253 | id: 4
|
29254 | }, {
|
29255 | rule: 'optional',
|
29256 | type: 'int32',
|
29257 | name: 'i',
|
29258 | id: 5
|
29259 | }, {
|
29260 | rule: 'optional',
|
29261 | type: 'string',
|
29262 | name: 'installationId',
|
29263 | id: 6
|
29264 | }, {
|
29265 | rule: 'optional',
|
29266 | type: 'int32',
|
29267 | name: 'priority',
|
29268 | id: 7
|
29269 | }, {
|
29270 | rule: 'optional',
|
29271 | type: 'int32',
|
29272 | name: 'service',
|
29273 | id: 8
|
29274 | }, {
|
29275 | rule: 'optional',
|
29276 | type: 'int64',
|
29277 | name: 'serverTs',
|
29278 | id: 9
|
29279 | }, {
|
29280 | rule: 'optional',
|
29281 | type: 'int64',
|
29282 | name: 'clientTs',
|
29283 | id: 10
|
29284 | }, {
|
29285 | rule: 'optional',
|
29286 | type: 'int32',
|
29287 | name: 'notificationType',
|
29288 | id: 11
|
29289 | }, {
|
29290 | rule: 'optional',
|
29291 | type: 'DataCommand',
|
29292 | name: 'dataMessage',
|
29293 | id: 101
|
29294 | }, {
|
29295 | rule: 'optional',
|
29296 | type: 'SessionCommand',
|
29297 | name: 'sessionMessage',
|
29298 | id: 102
|
29299 | }, {
|
29300 | rule: 'optional',
|
29301 | type: 'ErrorCommand',
|
29302 | name: 'errorMessage',
|
29303 | id: 103
|
29304 | }, {
|
29305 | rule: 'optional',
|
29306 | type: 'DirectCommand',
|
29307 | name: 'directMessage',
|
29308 | id: 104
|
29309 | }, {
|
29310 | rule: 'optional',
|
29311 | type: 'AckCommand',
|
29312 | name: 'ackMessage',
|
29313 | id: 105
|
29314 | }, {
|
29315 | rule: 'optional',
|
29316 | type: 'UnreadCommand',
|
29317 | name: 'unreadMessage',
|
29318 | id: 106
|
29319 | }, {
|
29320 | rule: 'optional',
|
29321 | type: 'ReadCommand',
|
29322 | name: 'readMessage',
|
29323 | id: 107
|
29324 | }, {
|
29325 | rule: 'optional',
|
29326 | type: 'RcpCommand',
|
29327 | name: 'rcpMessage',
|
29328 | id: 108
|
29329 | }, {
|
29330 | rule: 'optional',
|
29331 | type: 'LogsCommand',
|
29332 | name: 'logsMessage',
|
29333 | id: 109
|
29334 | }, {
|
29335 | rule: 'optional',
|
29336 | type: 'ConvCommand',
|
29337 | name: 'convMessage',
|
29338 | id: 110
|
29339 | }, {
|
29340 | rule: 'optional',
|
29341 | type: 'RoomCommand',
|
29342 | name: 'roomMessage',
|
29343 | id: 111
|
29344 | }, {
|
29345 | rule: 'optional',
|
29346 | type: 'PresenceCommand',
|
29347 | name: 'presenceMessage',
|
29348 | id: 112
|
29349 | }, {
|
29350 | rule: 'optional',
|
29351 | type: 'ReportCommand',
|
29352 | name: 'reportMessage',
|
29353 | id: 113
|
29354 | }, {
|
29355 | rule: 'optional',
|
29356 | type: 'PatchCommand',
|
29357 | name: 'patchMessage',
|
29358 | id: 114
|
29359 | }, {
|
29360 | rule: 'optional',
|
29361 | type: 'PubsubCommand',
|
29362 | name: 'pubsubMessage',
|
29363 | id: 115
|
29364 | }, {
|
29365 | rule: 'optional',
|
29366 | type: 'BlacklistCommand',
|
29367 | name: 'blacklistMessage',
|
29368 | id: 116
|
29369 | }]
|
29370 | }],
|
29371 | enums: [{
|
29372 | name: 'CommandType',
|
29373 | syntax: 'proto2',
|
29374 | values: [{
|
29375 | name: 'session',
|
29376 | id: 0
|
29377 | }, {
|
29378 | name: 'conv',
|
29379 | id: 1
|
29380 | }, {
|
29381 | name: 'direct',
|
29382 | id: 2
|
29383 | }, {
|
29384 | name: 'ack',
|
29385 | id: 3
|
29386 | }, {
|
29387 | name: 'rcp',
|
29388 | id: 4
|
29389 | }, {
|
29390 | name: 'unread',
|
29391 | id: 5
|
29392 | }, {
|
29393 | name: 'logs',
|
29394 | id: 6
|
29395 | }, {
|
29396 | name: 'error',
|
29397 | id: 7
|
29398 | }, {
|
29399 | name: 'login',
|
29400 | id: 8
|
29401 | }, {
|
29402 | name: 'data',
|
29403 | id: 9
|
29404 | }, {
|
29405 | name: 'room',
|
29406 | id: 10
|
29407 | }, {
|
29408 | name: 'read',
|
29409 | id: 11
|
29410 | }, {
|
29411 | name: 'presence',
|
29412 | id: 12
|
29413 | }, {
|
29414 | name: 'report',
|
29415 | id: 13
|
29416 | }, {
|
29417 | name: 'echo',
|
29418 | id: 14
|
29419 | }, {
|
29420 | name: 'loggedin',
|
29421 | id: 15
|
29422 | }, {
|
29423 | name: 'logout',
|
29424 | id: 16
|
29425 | }, {
|
29426 | name: 'loggedout',
|
29427 | id: 17
|
29428 | }, {
|
29429 | name: 'patch',
|
29430 | id: 18
|
29431 | }, {
|
29432 | name: 'pubsub',
|
29433 | id: 19
|
29434 | }, {
|
29435 | name: 'blacklist',
|
29436 | id: 20
|
29437 | }, {
|
29438 | name: 'goaway',
|
29439 | id: 21
|
29440 | }]
|
29441 | }, {
|
29442 | name: 'OpType',
|
29443 | syntax: 'proto2',
|
29444 | values: [{
|
29445 | name: 'open',
|
29446 | id: 1
|
29447 | }, {
|
29448 | name: 'add',
|
29449 | id: 2
|
29450 | }, {
|
29451 | name: 'remove',
|
29452 | id: 3
|
29453 | }, {
|
29454 | name: 'close',
|
29455 | id: 4
|
29456 | }, {
|
29457 | name: 'opened',
|
29458 | id: 5
|
29459 | }, {
|
29460 | name: 'closed',
|
29461 | id: 6
|
29462 | }, {
|
29463 | name: 'query',
|
29464 | id: 7
|
29465 | }, {
|
29466 | name: 'query_result',
|
29467 | id: 8
|
29468 | }, {
|
29469 | name: 'conflict',
|
29470 | id: 9
|
29471 | }, {
|
29472 | name: 'added',
|
29473 | id: 10
|
29474 | }, {
|
29475 | name: 'removed',
|
29476 | id: 11
|
29477 | }, {
|
29478 | name: 'refresh',
|
29479 | id: 12
|
29480 | }, {
|
29481 | name: 'refreshed',
|
29482 | id: 13
|
29483 | }, {
|
29484 | name: 'start',
|
29485 | id: 30
|
29486 | }, {
|
29487 | name: 'started',
|
29488 | id: 31
|
29489 | }, {
|
29490 | name: 'joined',
|
29491 | id: 32
|
29492 | }, {
|
29493 | name: 'members_joined',
|
29494 | id: 33
|
29495 | }, {
|
29496 | name: 'left',
|
29497 | id: 39
|
29498 | }, {
|
29499 | name: 'members_left',
|
29500 | id: 40
|
29501 | }, {
|
29502 | name: 'results',
|
29503 | id: 42
|
29504 | }, {
|
29505 | name: 'count',
|
29506 | id: 43
|
29507 | }, {
|
29508 | name: 'result',
|
29509 | id: 44
|
29510 | }, {
|
29511 | name: 'update',
|
29512 | id: 45
|
29513 | }, {
|
29514 | name: 'updated',
|
29515 | id: 46
|
29516 | }, {
|
29517 | name: 'mute',
|
29518 | id: 47
|
29519 | }, {
|
29520 | name: 'unmute',
|
29521 | id: 48
|
29522 | }, {
|
29523 | name: 'status',
|
29524 | id: 49
|
29525 | }, {
|
29526 | name: 'members',
|
29527 | id: 50
|
29528 | }, {
|
29529 | name: 'max_read',
|
29530 | id: 51
|
29531 | }, {
|
29532 | name: 'is_member',
|
29533 | id: 52
|
29534 | }, {
|
29535 | name: 'member_info_update',
|
29536 | id: 53
|
29537 | }, {
|
29538 | name: 'member_info_updated',
|
29539 | id: 54
|
29540 | }, {
|
29541 | name: 'member_info_changed',
|
29542 | id: 55
|
29543 | }, {
|
29544 | name: 'join',
|
29545 | id: 80
|
29546 | }, {
|
29547 | name: 'invite',
|
29548 | id: 81
|
29549 | }, {
|
29550 | name: 'leave',
|
29551 | id: 82
|
29552 | }, {
|
29553 | name: 'kick',
|
29554 | id: 83
|
29555 | }, {
|
29556 | name: 'reject',
|
29557 | id: 84
|
29558 | }, {
|
29559 | name: 'invited',
|
29560 | id: 85
|
29561 | }, {
|
29562 | name: 'kicked',
|
29563 | id: 86
|
29564 | }, {
|
29565 | name: 'upload',
|
29566 | id: 100
|
29567 | }, {
|
29568 | name: 'uploaded',
|
29569 | id: 101
|
29570 | }, {
|
29571 | name: 'subscribe',
|
29572 | id: 120
|
29573 | }, {
|
29574 | name: 'subscribed',
|
29575 | id: 121
|
29576 | }, {
|
29577 | name: 'unsubscribe',
|
29578 | id: 122
|
29579 | }, {
|
29580 | name: 'unsubscribed',
|
29581 | id: 123
|
29582 | }, {
|
29583 | name: 'is_subscribed',
|
29584 | id: 124
|
29585 | }, {
|
29586 | name: 'modify',
|
29587 | id: 150
|
29588 | }, {
|
29589 | name: 'modified',
|
29590 | id: 151
|
29591 | }, {
|
29592 | name: 'block',
|
29593 | id: 170
|
29594 | }, {
|
29595 | name: 'unblock',
|
29596 | id: 171
|
29597 | }, {
|
29598 | name: 'blocked',
|
29599 | id: 172
|
29600 | }, {
|
29601 | name: 'unblocked',
|
29602 | id: 173
|
29603 | }, {
|
29604 | name: 'members_blocked',
|
29605 | id: 174
|
29606 | }, {
|
29607 | name: 'members_unblocked',
|
29608 | id: 175
|
29609 | }, {
|
29610 | name: 'check_block',
|
29611 | id: 176
|
29612 | }, {
|
29613 | name: 'check_result',
|
29614 | id: 177
|
29615 | }, {
|
29616 | name: 'add_shutup',
|
29617 | id: 180
|
29618 | }, {
|
29619 | name: 'remove_shutup',
|
29620 | id: 181
|
29621 | }, {
|
29622 | name: 'query_shutup',
|
29623 | id: 182
|
29624 | }, {
|
29625 | name: 'shutup_added',
|
29626 | id: 183
|
29627 | }, {
|
29628 | name: 'shutup_removed',
|
29629 | id: 184
|
29630 | }, {
|
29631 | name: 'shutup_result',
|
29632 | id: 185
|
29633 | }, {
|
29634 | name: 'shutuped',
|
29635 | id: 186
|
29636 | }, {
|
29637 | name: 'unshutuped',
|
29638 | id: 187
|
29639 | }, {
|
29640 | name: 'members_shutuped',
|
29641 | id: 188
|
29642 | }, {
|
29643 | name: 'members_unshutuped',
|
29644 | id: 189
|
29645 | }, {
|
29646 | name: 'check_shutup',
|
29647 | id: 190
|
29648 | }]
|
29649 | }, {
|
29650 | name: 'StatusType',
|
29651 | syntax: 'proto2',
|
29652 | values: [{
|
29653 | name: 'on',
|
29654 | id: 1
|
29655 | }, {
|
29656 | name: 'off',
|
29657 | id: 2
|
29658 | }]
|
29659 | }],
|
29660 | isNamespace: true
|
29661 | }).build();
|
29662 | var _messages$push_server = messageCompiled.push_server.messages2,
|
29663 | JsonObjectMessage = _messages$push_server.JsonObjectMessage,
|
29664 | UnreadTuple = _messages$push_server.UnreadTuple,
|
29665 | LogItem = _messages$push_server.LogItem,
|
29666 | DataCommand = _messages$push_server.DataCommand,
|
29667 | SessionCommand = _messages$push_server.SessionCommand,
|
29668 | ErrorCommand = _messages$push_server.ErrorCommand,
|
29669 | DirectCommand = _messages$push_server.DirectCommand,
|
29670 | AckCommand = _messages$push_server.AckCommand,
|
29671 | UnreadCommand = _messages$push_server.UnreadCommand,
|
29672 | ConvCommand = _messages$push_server.ConvCommand,
|
29673 | RoomCommand = _messages$push_server.RoomCommand,
|
29674 | LogsCommand = _messages$push_server.LogsCommand,
|
29675 | RcpCommand = _messages$push_server.RcpCommand,
|
29676 | ReadTuple = _messages$push_server.ReadTuple,
|
29677 | MaxReadTuple = _messages$push_server.MaxReadTuple,
|
29678 | ReadCommand = _messages$push_server.ReadCommand,
|
29679 | PresenceCommand = _messages$push_server.PresenceCommand,
|
29680 | ReportCommand = _messages$push_server.ReportCommand,
|
29681 | GenericCommand = _messages$push_server.GenericCommand,
|
29682 | BlacklistCommand = _messages$push_server.BlacklistCommand,
|
29683 | PatchCommand = _messages$push_server.PatchCommand,
|
29684 | PatchItem = _messages$push_server.PatchItem,
|
29685 | ConvMemberInfo = _messages$push_server.ConvMemberInfo,
|
29686 | CommandType = _messages$push_server.CommandType,
|
29687 | OpType = _messages$push_server.OpType,
|
29688 | StatusType = _messages$push_server.StatusType;
|
29689 | var message = (0, _freeze.default)({
|
29690 | __proto__: null,
|
29691 | JsonObjectMessage: JsonObjectMessage,
|
29692 | UnreadTuple: UnreadTuple,
|
29693 | LogItem: LogItem,
|
29694 | DataCommand: DataCommand,
|
29695 | SessionCommand: SessionCommand,
|
29696 | ErrorCommand: ErrorCommand,
|
29697 | DirectCommand: DirectCommand,
|
29698 | AckCommand: AckCommand,
|
29699 | UnreadCommand: UnreadCommand,
|
29700 | ConvCommand: ConvCommand,
|
29701 | RoomCommand: RoomCommand,
|
29702 | LogsCommand: LogsCommand,
|
29703 | RcpCommand: RcpCommand,
|
29704 | ReadTuple: ReadTuple,
|
29705 | MaxReadTuple: MaxReadTuple,
|
29706 | ReadCommand: ReadCommand,
|
29707 | PresenceCommand: PresenceCommand,
|
29708 | ReportCommand: ReportCommand,
|
29709 | GenericCommand: GenericCommand,
|
29710 | BlacklistCommand: BlacklistCommand,
|
29711 | PatchCommand: PatchCommand,
|
29712 | PatchItem: PatchItem,
|
29713 | ConvMemberInfo: ConvMemberInfo,
|
29714 | CommandType: CommandType,
|
29715 | OpType: OpType,
|
29716 | StatusType: StatusType
|
29717 | });
|
29718 | var adapters = {};
|
29719 |
|
29720 | var getAdapter = function getAdapter(name) {
|
29721 | var adapter = adapters[name];
|
29722 |
|
29723 | if (adapter === undefined) {
|
29724 | throw new Error("".concat(name, " adapter is not configured"));
|
29725 | }
|
29726 |
|
29727 | return adapter;
|
29728 | };
|
29729 |
|
29730 |
|
29731 |
|
29732 |
|
29733 |
|
29734 |
|
29735 |
|
29736 |
|
29737 | var setAdapters = function setAdapters(newAdapters) {
|
29738 | (0, _assign.default)(adapters, newAdapters);
|
29739 | };
|
29740 |
|
29741 |
|
29742 |
|
29743 | var global$1 = typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : {};
|
29744 | var EXPIRED = (0, _symbol.default)('expired');
|
29745 | var debug = d('LC:Expirable');
|
29746 |
|
29747 | var Expirable = function () {
|
29748 | function Expirable(value, ttl) {
|
29749 | this.originalValue = value;
|
29750 |
|
29751 | if (typeof ttl === 'number') {
|
29752 | this.expiredAt = Date.now() + ttl;
|
29753 | }
|
29754 | }
|
29755 |
|
29756 | _createClass(Expirable, [{
|
29757 | key: "value",
|
29758 | get: function get() {
|
29759 | var expired = this.expiredAt && this.expiredAt <= Date.now();
|
29760 | if (expired) debug("expired: ".concat(this.originalValue));
|
29761 | return expired ? EXPIRED : this.originalValue;
|
29762 | }
|
29763 | }]);
|
29764 |
|
29765 | return Expirable;
|
29766 | }();
|
29767 |
|
29768 | Expirable.EXPIRED = EXPIRED;
|
29769 | var debug$1 = d('LC:Cache');
|
29770 |
|
29771 | var Cache = function () {
|
29772 | function Cache() {
|
29773 | var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'anonymous';
|
29774 | this.name = name;
|
29775 | this._map = {};
|
29776 | }
|
29777 |
|
29778 | var _proto = Cache.prototype;
|
29779 |
|
29780 | _proto.get = function get(key) {
|
29781 | var _context5;
|
29782 |
|
29783 | var cache = this._map[key];
|
29784 |
|
29785 | if (cache) {
|
29786 | var value = cache.value;
|
29787 |
|
29788 | if (value !== Expirable.EXPIRED) {
|
29789 | debug$1('[%s] hit: %s', this.name, key);
|
29790 | return value;
|
29791 | }
|
29792 |
|
29793 | delete this._map[key];
|
29794 | }
|
29795 |
|
29796 | debug$1((0, _concat.default)(_context5 = "[".concat(this.name, "] missed: ")).call(_context5, key));
|
29797 | return null;
|
29798 | };
|
29799 |
|
29800 | _proto.set = function set(key, value, ttl) {
|
29801 | debug$1('[%s] set: %s %d', this.name, key, ttl);
|
29802 | this._map[key] = new Expirable(value, ttl);
|
29803 | };
|
29804 |
|
29805 | return Cache;
|
29806 | }();
|
29807 |
|
29808 | function ownKeys(object, enumerableOnly) {
|
29809 | var keys = (0, _keys.default)(object);
|
29810 |
|
29811 | if (_getOwnPropertySymbols.default) {
|
29812 | var symbols = (0, _getOwnPropertySymbols.default)(object);
|
29813 | enumerableOnly && (symbols = (0, _filter.default)(symbols).call(symbols, function (sym) {
|
29814 | return (0, _getOwnPropertyDescriptor.default)(object, sym).enumerable;
|
29815 | })), keys.push.apply(keys, symbols);
|
29816 | }
|
29817 |
|
29818 | return keys;
|
29819 | }
|
29820 |
|
29821 | function _objectSpread(target) {
|
29822 | for (var i = 1; i < arguments.length; i++) {
|
29823 | var source = null != arguments[i] ? arguments[i] : {};
|
29824 | i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
|
29825 | _defineProperty(target, key, source[key]);
|
29826 | }) : _getOwnPropertyDescriptors.default ? (0, _defineProperties.default)(target, (0, _getOwnPropertyDescriptors.default)(source)) : ownKeys(Object(source)).forEach(function (key) {
|
29827 | (0, _defineProperty2.default)(target, key, (0, _getOwnPropertyDescriptor.default)(source, key));
|
29828 | });
|
29829 | }
|
29830 |
|
29831 | return target;
|
29832 | }
|
29833 |
|
29834 |
|
29835 |
|
29836 |
|
29837 |
|
29838 |
|
29839 |
|
29840 |
|
29841 |
|
29842 |
|
29843 | var debug$2 = {
|
29844 | enable: function enable() {
|
29845 | var namespaces = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'LC*';
|
29846 | return d.enable(namespaces);
|
29847 | },
|
29848 | disable: d.disable
|
29849 | };
|
29850 |
|
29851 | var tryAll = function tryAll(promiseConstructors) {
|
29852 | var promise = new _promise.default(promiseConstructors[0]);
|
29853 |
|
29854 | if (promiseConstructors.length === 1) {
|
29855 | return promise;
|
29856 | }
|
29857 |
|
29858 | return promise["catch"](function () {
|
29859 | return tryAll((0, _slice.default)(promiseConstructors).call(promiseConstructors, 1));
|
29860 | });
|
29861 | };
|
29862 |
|
29863 |
|
29864 | var tap = function tap(interceptor) {
|
29865 | return function (value) {
|
29866 | return interceptor(value), value;
|
29867 | };
|
29868 | };
|
29869 |
|
29870 | var isIE10 = global$1.navigator && global$1.navigator.userAgent && (0, _indexOf.default)(_context6 = global$1.navigator.userAgent).call(_context6, 'MSIE 10.') !== -1;
|
29871 | var map = new _weakMap.default();
|
29872 |
|
29873 | var internal = function internal(object) {
|
29874 | if (!map.has(object)) {
|
29875 | map.set(object, {});
|
29876 | }
|
29877 |
|
29878 | return map.get(object);
|
29879 | };
|
29880 |
|
29881 | var compact = function compact(obj, filter) {
|
29882 | if (!isPlainObject(obj)) return obj;
|
29883 |
|
29884 | var object = _objectSpread({}, obj);
|
29885 |
|
29886 | (0, _keys.default)(object).forEach(function (prop) {
|
29887 | var value = object[prop];
|
29888 |
|
29889 | if (value === filter) {
|
29890 | delete object[prop];
|
29891 | } else {
|
29892 | object[prop] = compact(value, filter);
|
29893 | }
|
29894 | });
|
29895 | return object;
|
29896 | };
|
29897 |
|
29898 |
|
29899 | var removeNull = function removeNull(obj) {
|
29900 | return compact(obj, null);
|
29901 | };
|
29902 |
|
29903 | var trim = function trim(message) {
|
29904 | return removeNull(JSON.parse((0, _stringify.default)(message)));
|
29905 | };
|
29906 |
|
29907 | var ensureArray = function ensureArray(target) {
|
29908 | if (Array.isArray(target)) {
|
29909 | return target;
|
29910 | }
|
29911 |
|
29912 | if (target === undefined || target === null) {
|
29913 | return [];
|
29914 | }
|
29915 |
|
29916 | return [target];
|
29917 | };
|
29918 |
|
29919 | var isWeapp =
|
29920 | (typeof wx === "undefined" ? "undefined" : _typeof(wx)) === 'object' && typeof wx.connectSocket === 'function';
|
29921 |
|
29922 | var isCNApp = function isCNApp(appId) {
|
29923 | return (0, _slice.default)(appId).call(appId, -9) !== '-MdYXbMMI';
|
29924 | };
|
29925 |
|
29926 | var equalBuffer = function equalBuffer(buffer1, buffer2) {
|
29927 | if (!buffer1 || !buffer2) return false;
|
29928 | if (buffer1.byteLength !== buffer2.byteLength) return false;
|
29929 | var a = new Uint8Array(buffer1);
|
29930 | var b = new Uint8Array(buffer2);
|
29931 | return !a.some(function (value, index) {
|
29932 | return value !== b[index];
|
29933 | });
|
29934 | };
|
29935 |
|
29936 | var _class;
|
29937 |
|
29938 | function ownKeys$1(object, enumerableOnly) {
|
29939 | var keys = (0, _keys.default)(object);
|
29940 |
|
29941 | if (_getOwnPropertySymbols.default) {
|
29942 | var symbols = (0, _getOwnPropertySymbols.default)(object);
|
29943 | enumerableOnly && (symbols = (0, _filter.default)(symbols).call(symbols, function (sym) {
|
29944 | return (0, _getOwnPropertyDescriptor.default)(object, sym).enumerable;
|
29945 | })), keys.push.apply(keys, symbols);
|
29946 | }
|
29947 |
|
29948 | return keys;
|
29949 | }
|
29950 |
|
29951 | function _objectSpread$1(target) {
|
29952 | for (var i = 1; i < arguments.length; i++) {
|
29953 | var source = null != arguments[i] ? arguments[i] : {};
|
29954 | i % 2 ? ownKeys$1(Object(source), !0).forEach(function (key) {
|
29955 | _defineProperty(target, key, source[key]);
|
29956 | }) : _getOwnPropertyDescriptors.default ? (0, _defineProperties.default)(target, (0, _getOwnPropertyDescriptors.default)(source)) : ownKeys$1(Object(source)).forEach(function (key) {
|
29957 | (0, _defineProperty2.default)(target, key, (0, _getOwnPropertyDescriptor.default)(source, key));
|
29958 | });
|
29959 | }
|
29960 |
|
29961 | return target;
|
29962 | }
|
29963 |
|
29964 | var debug$3 = d('LC:WebSocketPlus');
|
29965 | var OPEN = 'open';
|
29966 | var DISCONNECT = 'disconnect';
|
29967 | var RECONNECT = 'reconnect';
|
29968 | var RETRY = 'retry';
|
29969 | var SCHEDULE = 'schedule';
|
29970 | var OFFLINE = 'offline';
|
29971 | var ONLINE = 'online';
|
29972 | var ERROR = 'error';
|
29973 | var MESSAGE = 'message';
|
29974 | var HEARTBEAT_TIME = 180000;
|
29975 | var TIMEOUT_TIME = 380000;
|
29976 |
|
29977 | var DEFAULT_RETRY_STRATEGY = function DEFAULT_RETRY_STRATEGY(attempt) {
|
29978 | return Math.min(1000 * Math.pow(2, attempt), 300000);
|
29979 | };
|
29980 |
|
29981 | var requireConnected = function requireConnected(target, name, descriptor) {
|
29982 | return _objectSpread$1(_objectSpread$1({}, descriptor), {}, {
|
29983 | value: function requireConnectedWrapper() {
|
29984 | var _context7;
|
29985 |
|
29986 | var _descriptor$value;
|
29987 |
|
29988 | this.checkConnectionAvailability(name);
|
29989 |
|
29990 | for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
29991 | args[_key] = arguments[_key];
|
29992 | }
|
29993 |
|
29994 | return (_descriptor$value = descriptor.value).call.apply(_descriptor$value, (0, _concat.default)(_context7 = [this]).call(_context7, args));
|
29995 | }
|
29996 | });
|
29997 | };
|
29998 |
|
29999 | var WebSocketPlus = (_class = function (_EventEmitter) {
|
30000 | _inheritsLoose(WebSocketPlus, _EventEmitter);
|
30001 |
|
30002 | function WebSocketPlus(getUrls, protocol) {
|
30003 | var _this;
|
30004 |
|
30005 | _this = _EventEmitter.call(this) || this;
|
30006 |
|
30007 | _this.init();
|
30008 |
|
30009 | _this._protocol = protocol;
|
30010 |
|
30011 | _promise.default.resolve(typeof getUrls === 'function' ? getUrls() : getUrls).then(ensureArray).then(function (urls) {
|
30012 | _this._urls = urls;
|
30013 | return _this._open();
|
30014 | }).then(function () {
|
30015 | _this.__postponeTimeoutTimer = _this._postponeTimeoutTimer.bind(_assertThisInitialized(_this));
|
30016 |
|
30017 | if (global$1.addEventListener) {
|
30018 | _this.__pause = function () {
|
30019 | if (_this.can('pause')) _this.pause();
|
30020 | };
|
30021 |
|
30022 | _this.__resume = function () {
|
30023 | if (_this.can('resume')) _this.resume();
|
30024 | };
|
30025 |
|
30026 | global$1.addEventListener('offline', _this.__pause);
|
30027 | global$1.addEventListener('online', _this.__resume);
|
30028 | }
|
30029 |
|
30030 | _this.open();
|
30031 | })["catch"](_this["throw"].bind(_assertThisInitialized(_this)));
|
30032 |
|
30033 | return _this;
|
30034 | }
|
30035 |
|
30036 | var _proto = WebSocketPlus.prototype;
|
30037 |
|
30038 | _proto._open = function _open() {
|
30039 | var _this2 = this;
|
30040 |
|
30041 | return this._createWs(this._urls, this._protocol).then(function (ws) {
|
30042 | var _context8;
|
30043 |
|
30044 | var _this2$_urls = _toArray(_this2._urls),
|
30045 | first = _this2$_urls[0],
|
30046 | reset = (0, _slice.default)(_this2$_urls).call(_this2$_urls, 1);
|
30047 |
|
30048 | _this2._urls = (0, _concat.default)(_context8 = []).call(_context8, _toConsumableArray(reset), [first]);
|
30049 | return ws;
|
30050 | });
|
30051 | };
|
30052 |
|
30053 | _proto._createWs = function _createWs(urls, protocol) {
|
30054 | var _this3 = this;
|
30055 |
|
30056 | return tryAll((0, _map.default)(urls).call(urls, function (url) {
|
30057 | return function (resolve, reject) {
|
30058 | var _context9;
|
30059 |
|
30060 | debug$3((0, _concat.default)(_context9 = "connect [".concat(url, "] ")).call(_context9, protocol));
|
30061 | var WebSocket = getAdapter('WebSocket');
|
30062 | var ws = protocol ? new WebSocket(url, protocol) : new WebSocket(url);
|
30063 | ws.binaryType = _this3.binaryType || 'arraybuffer';
|
30064 |
|
30065 | ws.onopen = function () {
|
30066 | return resolve(ws);
|
30067 | };
|
30068 |
|
30069 | ws.onclose = function (error) {
|
30070 | if (error instanceof Error) {
|
30071 | return reject(error);
|
30072 | }
|
30073 |
|
30074 |
|
30075 | return reject(new Error("Failed to connect [".concat(url, "]")));
|
30076 | };
|
30077 |
|
30078 | ws.onerror = ws.onclose;
|
30079 | };
|
30080 | })).then(function (ws) {
|
30081 | _this3._ws = ws;
|
30082 | _this3._ws.onclose = _this3._handleClose.bind(_this3);
|
30083 | _this3._ws.onmessage = _this3._handleMessage.bind(_this3);
|
30084 | return ws;
|
30085 | });
|
30086 | };
|
30087 |
|
30088 | _proto._destroyWs = function _destroyWs() {
|
30089 | var ws = this._ws;
|
30090 | if (!ws) return;
|
30091 | ws.onopen = null;
|
30092 | ws.onclose = null;
|
30093 | ws.onerror = null;
|
30094 | ws.onmessage = null;
|
30095 | this._ws = null;
|
30096 | ws.close();
|
30097 | }
|
30098 | ;
|
30099 |
|
30100 | _proto.onbeforeevent = function onbeforeevent(event, from, to) {
|
30101 | var _context10, _context11;
|
30102 |
|
30103 | for (var _len2 = arguments.length, payload = new Array(_len2 > 3 ? _len2 - 3 : 0), _key2 = 3; _key2 < _len2; _key2++) {
|
30104 | payload[_key2 - 3] = arguments[_key2];
|
30105 | }
|
30106 |
|
30107 | debug$3((0, _concat.default)(_context10 = (0, _concat.default)(_context11 = "".concat(event, ": ")).call(_context11, from, " -> ")).call(_context10, to, " %o"), payload);
|
30108 | };
|
30109 |
|
30110 | _proto.onopen = function onopen() {
|
30111 | this.emit(OPEN);
|
30112 | };
|
30113 |
|
30114 | _proto.onconnected = function onconnected() {
|
30115 | this._startConnectionKeeper();
|
30116 | };
|
30117 |
|
30118 | _proto.onleaveconnected = function onleaveconnected(event, from, to) {
|
30119 | this._stopConnectionKeeper();
|
30120 |
|
30121 | this._destroyWs();
|
30122 |
|
30123 | if (to === 'offline' || to === 'disconnected') {
|
30124 | this.emit(DISCONNECT);
|
30125 | }
|
30126 | };
|
30127 |
|
30128 | _proto.onpause = function onpause() {
|
30129 | this.emit(OFFLINE);
|
30130 | };
|
30131 |
|
30132 | _proto.onbeforeresume = function onbeforeresume() {
|
30133 | this.emit(ONLINE);
|
30134 | };
|
30135 |
|
30136 | _proto.onreconnect = function onreconnect() {
|
30137 | this.emit(RECONNECT);
|
30138 | };
|
30139 |
|
30140 | _proto.ondisconnected = function ondisconnected(event, from, to) {
|
30141 | var _context12;
|
30142 |
|
30143 | var _this4 = this;
|
30144 |
|
30145 | var attempt = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
30146 | var delay = from === OFFLINE ? 0 : DEFAULT_RETRY_STRATEGY.call(null, attempt);
|
30147 | debug$3((0, _concat.default)(_context12 = "schedule attempt=".concat(attempt, " delay=")).call(_context12, delay));
|
30148 | this.emit(SCHEDULE, attempt, delay);
|
30149 |
|
30150 | if (this.__scheduledRetry) {
|
30151 | clearTimeout(this.__scheduledRetry);
|
30152 | }
|
30153 |
|
30154 | this.__scheduledRetry = setTimeout(function () {
|
30155 | if (_this4.is('disconnected')) {
|
30156 | _this4.retry(attempt);
|
30157 | }
|
30158 | }, delay);
|
30159 | };
|
30160 |
|
30161 | _proto.onretry = function onretry(event, from, to) {
|
30162 | var _this5 = this;
|
30163 |
|
30164 | var attempt = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
30165 | this.emit(RETRY, attempt);
|
30166 |
|
30167 | this._open().then(function () {
|
30168 | return _this5.can('reconnect') && _this5.reconnect();
|
30169 | }, function () {
|
30170 | return _this5.can('fail') && _this5.fail(attempt + 1);
|
30171 | });
|
30172 | };
|
30173 |
|
30174 | _proto.onerror = function onerror(event, from, to, error) {
|
30175 | this.emit(ERROR, error);
|
30176 | };
|
30177 |
|
30178 | _proto.onclose = function onclose() {
|
30179 | if (global$1.removeEventListener) {
|
30180 | if (this.__pause) global$1.removeEventListener('offline', this.__pause);
|
30181 | if (this.__resume) global$1.removeEventListener('online', this.__resume);
|
30182 | }
|
30183 | };
|
30184 |
|
30185 | _proto.checkConnectionAvailability = function checkConnectionAvailability() {
|
30186 | var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'API';
|
30187 |
|
30188 | if (!this.is('connected')) {
|
30189 | var _context13;
|
30190 |
|
30191 | var currentState = this.current;
|
30192 | console.warn((0, _concat.default)(_context13 = "".concat(name, " should not be called when the connection is ")).call(_context13, currentState));
|
30193 |
|
30194 | if (this.is('disconnected') || this.is('reconnecting')) {
|
30195 | console.warn('disconnect and reconnect event should be handled to avoid such calls.');
|
30196 | }
|
30197 |
|
30198 | throw new Error('Connection unavailable');
|
30199 | }
|
30200 | }
|
30201 | ;
|
30202 |
|
30203 | _proto.
|
30204 | _ping = function _ping() {
|
30205 | debug$3('ping');
|
30206 |
|
30207 | try {
|
30208 | this.ping();
|
30209 | } catch (error) {
|
30210 | console.warn("websocket ping error: ".concat(error.message));
|
30211 | }
|
30212 | };
|
30213 |
|
30214 | _proto.ping = function ping() {
|
30215 | if (this._ws.ping) {
|
30216 | this._ws.ping();
|
30217 | } else {
|
30218 | console.warn("The WebSocket implement does not support sending ping frame.\n Override ping method to use application defined ping/pong mechanism.");
|
30219 | }
|
30220 | };
|
30221 |
|
30222 | _proto._postponeTimeoutTimer = function _postponeTimeoutTimer() {
|
30223 | var _this6 = this;
|
30224 |
|
30225 | debug$3('_postponeTimeoutTimer');
|
30226 |
|
30227 | this._clearTimeoutTimers();
|
30228 |
|
30229 | this._timeoutTimer = setTimeout(function () {
|
30230 | debug$3('timeout');
|
30231 |
|
30232 | _this6.disconnect();
|
30233 | }, TIMEOUT_TIME);
|
30234 | };
|
30235 |
|
30236 | _proto._clearTimeoutTimers = function _clearTimeoutTimers() {
|
30237 | if (this._timeoutTimer) {
|
30238 | clearTimeout(this._timeoutTimer);
|
30239 | }
|
30240 | };
|
30241 |
|
30242 | _proto._startConnectionKeeper = function _startConnectionKeeper() {
|
30243 | debug$3('start connection keeper');
|
30244 | this._heartbeatTimer = setInterval(this._ping.bind(this), HEARTBEAT_TIME);
|
30245 | var addListener = this._ws.addListener || this._ws.addEventListener;
|
30246 |
|
30247 | if (!addListener) {
|
30248 | debug$3('connection keeper disabled due to the lack of #addEventListener.');
|
30249 | return;
|
30250 | }
|
30251 |
|
30252 | addListener.call(this._ws, 'message', this.__postponeTimeoutTimer);
|
30253 | addListener.call(this._ws, 'pong', this.__postponeTimeoutTimer);
|
30254 |
|
30255 | this._postponeTimeoutTimer();
|
30256 | };
|
30257 |
|
30258 | _proto._stopConnectionKeeper = function _stopConnectionKeeper() {
|
30259 | debug$3('stop connection keeper');
|
30260 |
|
30261 | var removeListener = this._ws.removeListener || this._ws.removeEventListener;
|
30262 |
|
30263 | if (removeListener) {
|
30264 | removeListener.call(this._ws, 'message', this.__postponeTimeoutTimer);
|
30265 | removeListener.call(this._ws, 'pong', this.__postponeTimeoutTimer);
|
30266 |
|
30267 | this._clearTimeoutTimers();
|
30268 | }
|
30269 |
|
30270 | if (this._heartbeatTimer) {
|
30271 | clearInterval(this._heartbeatTimer);
|
30272 | }
|
30273 | };
|
30274 |
|
30275 | _proto._handleClose = function _handleClose(event) {
|
30276 | var _context14;
|
30277 |
|
30278 | debug$3((0, _concat.default)(_context14 = "ws closed [".concat(event.code, "] ")).call(_context14, event.reason));
|
30279 |
|
30280 | if (this.isFinished()) return;
|
30281 | this.handleClose(event);
|
30282 | };
|
30283 |
|
30284 | _proto.handleClose = function handleClose() {
|
30285 |
|
30286 | this.disconnect();
|
30287 | }
|
30288 | ;
|
30289 |
|
30290 | _proto.
|
30291 | send = function send(data) {
|
30292 | debug$3('send', data);
|
30293 |
|
30294 | this._ws.send(data);
|
30295 | };
|
30296 |
|
30297 | _proto._handleMessage = function _handleMessage(event) {
|
30298 | debug$3('message', event.data);
|
30299 | this.handleMessage(event.data);
|
30300 | };
|
30301 |
|
30302 | _proto.handleMessage = function handleMessage(message) {
|
30303 | this.emit(MESSAGE, message);
|
30304 | };
|
30305 |
|
30306 | _createClass(WebSocketPlus, [{
|
30307 | key: "urls",
|
30308 | get: function get() {
|
30309 | return this._urls;
|
30310 | },
|
30311 | set: function set(urls) {
|
30312 | this._urls = ensureArray(urls);
|
30313 | }
|
30314 | }]);
|
30315 |
|
30316 | return WebSocketPlus;
|
30317 | }(EventEmitter), (_applyDecoratedDescriptor(_class.prototype, "_ping", [requireConnected], (0, _getOwnPropertyDescriptor.default)(_class.prototype, "_ping"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, "send", [requireConnected], (0, _getOwnPropertyDescriptor.default)(_class.prototype, "send"), _class.prototype)), _class);
|
30318 | StateMachine.create({
|
30319 | target: WebSocketPlus.prototype,
|
30320 | initial: {
|
30321 | state: 'initialized',
|
30322 | event: 'init',
|
30323 | defer: true
|
30324 | },
|
30325 | terminal: 'closed',
|
30326 | events: [{
|
30327 | name: 'open',
|
30328 | from: 'initialized',
|
30329 | to: 'connected'
|
30330 | }, {
|
30331 | name: 'disconnect',
|
30332 | from: 'connected',
|
30333 | to: 'disconnected'
|
30334 | }, {
|
30335 | name: 'retry',
|
30336 | from: 'disconnected',
|
30337 | to: 'reconnecting'
|
30338 | }, {
|
30339 | name: 'fail',
|
30340 | from: 'reconnecting',
|
30341 | to: 'disconnected'
|
30342 | }, {
|
30343 | name: 'reconnect',
|
30344 | from: 'reconnecting',
|
30345 | to: 'connected'
|
30346 | }, {
|
30347 | name: 'pause',
|
30348 | from: ['connected', 'disconnected', 'reconnecting'],
|
30349 | to: 'offline'
|
30350 | }, {}, {
|
30351 | name: 'resume',
|
30352 | from: 'offline',
|
30353 | to: 'disconnected'
|
30354 | }, {
|
30355 | name: 'close',
|
30356 | from: ['connected', 'disconnected', 'reconnecting', 'offline'],
|
30357 | to: 'closed'
|
30358 | }, {
|
30359 | name: 'throw',
|
30360 | from: '*',
|
30361 | to: 'error'
|
30362 | }]
|
30363 | });
|
30364 | var error = (0, _freeze.default)({
|
30365 | 1000: {
|
30366 | name: 'CLOSE_NORMAL'
|
30367 | },
|
30368 | 1006: {
|
30369 | name: 'CLOSE_ABNORMAL'
|
30370 | },
|
30371 | 4100: {
|
30372 | name: 'APP_NOT_AVAILABLE',
|
30373 | message: 'App not exists or realtime message service is disabled.'
|
30374 | },
|
30375 | 4102: {
|
30376 | name: 'SIGNATURE_FAILED',
|
30377 | message: 'Login signature mismatch.'
|
30378 | },
|
30379 | 4103: {
|
30380 | name: 'INVALID_LOGIN',
|
30381 | message: 'Malformed clientId.'
|
30382 | },
|
30383 | 4105: {
|
30384 | name: 'SESSION_REQUIRED',
|
30385 | message: 'Message sent before session opened.'
|
30386 | },
|
30387 | 4107: {
|
30388 | name: 'READ_TIMEOUT'
|
30389 | },
|
30390 | 4108: {
|
30391 | name: 'LOGIN_TIMEOUT'
|
30392 | },
|
30393 | 4109: {
|
30394 | name: 'FRAME_TOO_LONG'
|
30395 | },
|
30396 | 4110: {
|
30397 | name: 'INVALID_ORIGIN',
|
30398 | message: 'Access denied by domain whitelist.'
|
30399 | },
|
30400 | 4111: {
|
30401 | name: 'SESSION_CONFLICT'
|
30402 | },
|
30403 | 4112: {
|
30404 | name: 'SESSION_TOKEN_EXPIRED'
|
30405 | },
|
30406 | 4113: {
|
30407 | name: 'APP_QUOTA_EXCEEDED',
|
30408 | message: 'The daily active users limit exceeded.'
|
30409 | },
|
30410 | 4116: {
|
30411 | name: 'MESSAGE_SENT_QUOTA_EXCEEDED',
|
30412 | message: 'Command sent too fast.'
|
30413 | },
|
30414 | 4200: {
|
30415 | name: 'INTERNAL_ERROR',
|
30416 | message: 'Internal error, please contact LeanCloud for support.'
|
30417 | },
|
30418 | 4301: {
|
30419 | name: 'CONVERSATION_API_FAILED',
|
30420 | message: 'Upstream Conversatoin API failed, see error.detail for details.'
|
30421 | },
|
30422 | 4302: {
|
30423 | name: 'CONVERSATION_SIGNATURE_FAILED',
|
30424 | message: 'Conversation action signature mismatch.'
|
30425 | },
|
30426 | 4303: {
|
30427 | name: 'CONVERSATION_NOT_FOUND'
|
30428 | },
|
30429 | 4304: {
|
30430 | name: 'CONVERSATION_FULL'
|
30431 | },
|
30432 | 4305: {
|
30433 | name: 'CONVERSATION_REJECTED_BY_APP',
|
30434 | message: 'Conversation action rejected by hook.'
|
30435 | },
|
30436 | 4306: {
|
30437 | name: 'CONVERSATION_UPDATE_FAILED'
|
30438 | },
|
30439 | 4307: {
|
30440 | name: 'CONVERSATION_READ_ONLY'
|
30441 | },
|
30442 | 4308: {
|
30443 | name: 'CONVERSATION_NOT_ALLOWED'
|
30444 | },
|
30445 | 4309: {
|
30446 | name: 'CONVERSATION_UPDATE_REJECTED',
|
30447 | message: 'Conversation update rejected because the client is not a member.'
|
30448 | },
|
30449 | 4310: {
|
30450 | name: 'CONVERSATION_QUERY_FAILED',
|
30451 | message: 'Conversation query failed because it is too expansive.'
|
30452 | },
|
30453 | 4311: {
|
30454 | name: 'CONVERSATION_LOG_FAILED'
|
30455 | },
|
30456 | 4312: {
|
30457 | name: 'CONVERSATION_LOG_REJECTED',
|
30458 | message: 'Message query rejected because the client is not a member of the conversation.'
|
30459 | },
|
30460 | 4313: {
|
30461 | name: 'SYSTEM_CONVERSATION_REQUIRED'
|
30462 | },
|
30463 | 4314: {
|
30464 | name: 'NORMAL_CONVERSATION_REQUIRED'
|
30465 | },
|
30466 | 4315: {
|
30467 | name: 'CONVERSATION_BLACKLISTED',
|
30468 | message: 'Blacklisted in the conversation.'
|
30469 | },
|
30470 | 4316: {
|
30471 | name: 'TRANSIENT_CONVERSATION_REQUIRED'
|
30472 | },
|
30473 | 4317: {
|
30474 | name: 'CONVERSATION_MEMBERSHIP_REQUIRED'
|
30475 | },
|
30476 | 4318: {
|
30477 | name: 'CONVERSATION_API_QUOTA_EXCEEDED',
|
30478 | message: 'LeanCloud API quota exceeded. You may upgrade your plan.'
|
30479 | },
|
30480 | 4323: {
|
30481 | name: 'TEMPORARY_CONVERSATION_EXPIRED',
|
30482 | message: 'Temporary conversation expired or does not exist.'
|
30483 | },
|
30484 | 4401: {
|
30485 | name: 'INVALID_MESSAGING_TARGET',
|
30486 | message: 'Conversation does not exist or client is not a member.'
|
30487 | },
|
30488 | 4402: {
|
30489 | name: 'MESSAGE_REJECTED_BY_APP',
|
30490 | message: 'Message rejected by hook.'
|
30491 | },
|
30492 | 4403: {
|
30493 | name: 'MESSAGE_OWNERSHIP_REQUIRED'
|
30494 | },
|
30495 | 4404: {
|
30496 | name: 'MESSAGE_NOT_FOUND'
|
30497 | },
|
30498 | 4405: {
|
30499 | name: 'MESSAGE_UPDATE_REJECTED_BY_APP',
|
30500 | message: 'Message update rejected by hook.'
|
30501 | },
|
30502 | 4406: {
|
30503 | name: 'MESSAGE_EDIT_DISABLED'
|
30504 | },
|
30505 | 4407: {
|
30506 | name: 'MESSAGE_RECALL_DISABLED'
|
30507 | },
|
30508 | 5130: {
|
30509 | name: 'OWNER_PROMOTION_NOT_ALLOWED',
|
30510 | message: "Updating a member's role to owner is not allowed."
|
30511 | }
|
30512 | });
|
30513 | var ErrorCode = (0, _freeze.default)((0, _reduce.default)(_context15 = (0, _keys.default)(error)).call(_context15, function (result, code) {
|
30514 | return (0, _assign.default)(result, _defineProperty({}, error[code].name, Number(code)));
|
30515 | }, {}));
|
30516 |
|
30517 | var createError = function createError(_ref) {
|
30518 | var code = _ref.code,
|
30519 | reason = _ref.reason,
|
30520 | appCode = _ref.appCode,
|
30521 | detail = _ref.detail,
|
30522 | errorMessage = _ref.error;
|
30523 | var message = reason || detail || errorMessage;
|
30524 | var name = reason;
|
30525 |
|
30526 | if (!message && error[code]) {
|
30527 | name = error[code].name;
|
30528 | message = error[code].message || name;
|
30529 | }
|
30530 |
|
30531 | if (!message) {
|
30532 | message = "Unknow Error: ".concat(code);
|
30533 | }
|
30534 |
|
30535 | var err = new Error(message);
|
30536 | return (0, _assign.default)(err, {
|
30537 | code: code,
|
30538 | appCode: appCode,
|
30539 | detail: detail,
|
30540 | name: name
|
30541 | });
|
30542 | };
|
30543 |
|
30544 | var debug$4 = d('LC:Connection');
|
30545 | var COMMAND_TIMEOUT = 20000;
|
30546 | var EXPIRE = (0, _symbol.default)('expire');
|
30547 |
|
30548 | var isIdempotentCommand = function isIdempotentCommand(command) {
|
30549 | return !(command.cmd === CommandType.direct || command.cmd === CommandType.session && command.op === OpType.open || command.cmd === CommandType.conv && (command.op === OpType.start || command.op === OpType.update || command.op === OpType.members));
|
30550 | };
|
30551 |
|
30552 | var Connection = function (_WebSocketPlus) {
|
30553 | _inheritsLoose(Connection, _WebSocketPlus);
|
30554 |
|
30555 | function Connection(getUrl, _ref) {
|
30556 | var _context16;
|
30557 |
|
30558 | var _this;
|
30559 |
|
30560 | var format = _ref.format,
|
30561 | version = _ref.version;
|
30562 | debug$4('initializing Connection');
|
30563 | var protocolString = (0, _concat.default)(_context16 = "lc.".concat(format, ".")).call(_context16, version);
|
30564 | _this = _WebSocketPlus.call(this, getUrl, protocolString) || this;
|
30565 | _this._protocolFormat = format;
|
30566 | _this._commands = {};
|
30567 | _this._serialId = 0;
|
30568 | return _this;
|
30569 | }
|
30570 |
|
30571 | var _proto = Connection.prototype;
|
30572 |
|
30573 | _proto.send = function () {
|
30574 | var _send = _asyncToGenerator( _regeneratorRuntime.mark(function _callee(command) {
|
30575 | var _this2 = this;
|
30576 |
|
30577 | var waitingForRespond,
|
30578 | buffer,
|
30579 | serialId,
|
30580 | duplicatedCommand,
|
30581 | message,
|
30582 | promise,
|
30583 | _args = arguments;
|
30584 | return _regeneratorRuntime.wrap(function _callee$(_context) {
|
30585 | var _context17, _context18;
|
30586 |
|
30587 | while (1) {
|
30588 | switch (_context.prev = _context.next) {
|
30589 | case 0:
|
30590 | waitingForRespond = _args.length > 1 && _args[1] !== undefined ? _args[1] : true;
|
30591 |
|
30592 | if (!waitingForRespond) {
|
30593 | _context.next = 11;
|
30594 | break;
|
30595 | }
|
30596 |
|
30597 | if (!isIdempotentCommand(command)) {
|
30598 | _context.next = 8;
|
30599 | break;
|
30600 | }
|
30601 |
|
30602 | buffer = command.toArrayBuffer();
|
30603 | duplicatedCommand = (0, _find.default)(_context17 = values(this._commands)).call(_context17, function (_ref2) {
|
30604 | var targetBuffer = _ref2.buffer,
|
30605 | targetCommand = _ref2.command;
|
30606 | return targetCommand.cmd === command.cmd && targetCommand.op === command.op && equalBuffer(targetBuffer, buffer);
|
30607 | });
|
30608 |
|
30609 | if (!duplicatedCommand) {
|
30610 | _context.next = 8;
|
30611 | break;
|
30612 | }
|
30613 |
|
30614 | console.warn((0, _concat.default)(_context18 = "Duplicated command [cmd:".concat(command.cmd, " op:")).call(_context18, command.op, "] is throttled."));
|
30615 | return _context.abrupt("return", duplicatedCommand.promise);
|
30616 |
|
30617 | case 8:
|
30618 | this._serialId += 1;
|
30619 | serialId = this._serialId;
|
30620 | command.i = serialId;
|
30621 |
|
30622 |
|
30623 | case 11:
|
30624 | if (debug$4.enabled) debug$4('↑ %O sent', trim(command));
|
30625 |
|
30626 | if (this._protocolFormat === 'proto2base64') {
|
30627 | message = command.toBase64();
|
30628 | } else if (command.toArrayBuffer) {
|
30629 | message = command.toArrayBuffer();
|
30630 | }
|
30631 |
|
30632 | if (message) {
|
30633 | _context.next = 15;
|
30634 | break;
|
30635 | }
|
30636 |
|
30637 | throw new TypeError("".concat(command, " is not a GenericCommand"));
|
30638 |
|
30639 | case 15:
|
30640 | _WebSocketPlus.prototype.send.call(this, message);
|
30641 |
|
30642 | if (waitingForRespond) {
|
30643 | _context.next = 18;
|
30644 | break;
|
30645 | }
|
30646 |
|
30647 | return _context.abrupt("return", undefined);
|
30648 |
|
30649 | case 18:
|
30650 | promise = new _promise.default(function (resolve, reject) {
|
30651 | _this2._commands[serialId] = {
|
30652 | command: command,
|
30653 | buffer: buffer,
|
30654 | resolve: resolve,
|
30655 | reject: reject,
|
30656 | timeout: setTimeout(function () {
|
30657 | if (_this2._commands[serialId]) {
|
30658 | var _context19;
|
30659 |
|
30660 | if (debug$4.enabled) debug$4('✗ %O timeout', trim(command));
|
30661 | reject(createError({
|
30662 | error: (0, _concat.default)(_context19 = "Command Timeout [cmd:".concat(command.cmd, " op:")).call(_context19, command.op, "]"),
|
30663 | name: 'COMMAND_TIMEOUT'
|
30664 | }));
|
30665 | delete _this2._commands[serialId];
|
30666 | }
|
30667 | }, COMMAND_TIMEOUT)
|
30668 | };
|
30669 | });
|
30670 | this._commands[serialId].promise = promise;
|
30671 | return _context.abrupt("return", promise);
|
30672 |
|
30673 | case 21:
|
30674 | case "end":
|
30675 | return _context.stop();
|
30676 | }
|
30677 | }
|
30678 | }, _callee, this);
|
30679 | }));
|
30680 |
|
30681 | function send(_x) {
|
30682 | return _send.apply(this, arguments);
|
30683 | }
|
30684 |
|
30685 | return send;
|
30686 | }();
|
30687 |
|
30688 | _proto.handleMessage = function handleMessage(msg) {
|
30689 | var message;
|
30690 |
|
30691 | try {
|
30692 | message = GenericCommand.decode(msg);
|
30693 | if (debug$4.enabled) debug$4('↓ %O received', trim(message));
|
30694 | } catch (e) {
|
30695 | console.warn('Decode message failed:', e.message, msg);
|
30696 | return;
|
30697 | }
|
30698 |
|
30699 | var serialId = message.i;
|
30700 |
|
30701 | if (serialId) {
|
30702 | if (this._commands[serialId]) {
|
30703 | clearTimeout(this._commands[serialId].timeout);
|
30704 |
|
30705 | if (message.cmd === CommandType.error) {
|
30706 | this._commands[serialId].reject(createError(message.errorMessage));
|
30707 | } else {
|
30708 | this._commands[serialId].resolve(message);
|
30709 | }
|
30710 |
|
30711 | delete this._commands[serialId];
|
30712 | } else {
|
30713 | console.warn("Unexpected command received with serialId [".concat(serialId, "],\n which have timed out or never been requested."));
|
30714 | }
|
30715 | } else {
|
30716 | switch (message.cmd) {
|
30717 | case CommandType.error:
|
30718 | {
|
30719 | this.emit(ERROR, createError(message.errorMessage));
|
30720 | return;
|
30721 | }
|
30722 |
|
30723 | case CommandType.goaway:
|
30724 | {
|
30725 | this.emit(EXPIRE);
|
30726 | return;
|
30727 | }
|
30728 |
|
30729 | default:
|
30730 | {
|
30731 | this.emit(MESSAGE, message);
|
30732 | }
|
30733 | }
|
30734 | }
|
30735 | };
|
30736 |
|
30737 | _proto.ping = function ping() {
|
30738 | return this.send(new GenericCommand({
|
30739 | cmd: CommandType.echo
|
30740 | }))["catch"](function (error) {
|
30741 | return debug$4('ping failed:', error);
|
30742 | });
|
30743 | };
|
30744 |
|
30745 | return Connection;
|
30746 | }(WebSocketPlus);
|
30747 |
|
30748 | var debug$5 = d('LC:request');
|
30749 |
|
30750 | var request = function request(_ref) {
|
30751 | var _ref$method = _ref.method,
|
30752 | method = _ref$method === void 0 ? 'GET' : _ref$method,
|
30753 | _url = _ref.url,
|
30754 | query = _ref.query,
|
30755 | headers = _ref.headers,
|
30756 | data = _ref.data,
|
30757 | time = _ref.timeout;
|
30758 | var url = _url;
|
30759 |
|
30760 | if (query) {
|
30761 | var _context20, _context21, _context23;
|
30762 |
|
30763 | var queryString = (0, _filter.default)(_context20 = (0, _map.default)(_context21 = (0, _keys.default)(query)).call(_context21, function (key) {
|
30764 | var _context22;
|
30765 |
|
30766 | var value = query[key];
|
30767 | if (value === undefined) return undefined;
|
30768 | var v = isPlainObject(value) ? (0, _stringify.default)(value) : value;
|
30769 | return (0, _concat.default)(_context22 = "".concat(encodeURIComponent(key), "=")).call(_context22, encodeURIComponent(v));
|
30770 | })).call(_context20, function (qs) {
|
30771 | return qs;
|
30772 | }).join('&');
|
30773 | url = (0, _concat.default)(_context23 = "".concat(url, "?")).call(_context23, queryString);
|
30774 | }
|
30775 |
|
30776 | debug$5('Req: %O %O %O', method, url, {
|
30777 | headers: headers,
|
30778 | data: data
|
30779 | });
|
30780 | var request = getAdapter('request');
|
30781 | var promise = request(url, {
|
30782 | method: method,
|
30783 | headers: headers,
|
30784 | data: data
|
30785 | }).then(function (response) {
|
30786 | if (response.ok === false) {
|
30787 | var error = createError(response.data);
|
30788 | error.response = response;
|
30789 | throw error;
|
30790 | }
|
30791 |
|
30792 | debug$5('Res: %O %O %O', url, response.status, response.data);
|
30793 | return response.data;
|
30794 | })["catch"](function (error) {
|
30795 | if (error.response) {
|
30796 | debug$5('Error: %O %O %O', url, error.response.status, error.response.data);
|
30797 | }
|
30798 |
|
30799 | throw error;
|
30800 | });
|
30801 | return time ? promiseTimeout.timeout(promise, time) : promise;
|
30802 | };
|
30803 |
|
30804 | var applyDecorators = function applyDecorators(decorators, target) {
|
30805 | if (decorators) {
|
30806 | decorators.forEach(function (decorator) {
|
30807 | try {
|
30808 | decorator(target);
|
30809 | } catch (error) {
|
30810 | if (decorator._pluginName) {
|
30811 | error.message += "[".concat(decorator._pluginName, "]");
|
30812 | }
|
30813 |
|
30814 | throw error;
|
30815 | }
|
30816 | });
|
30817 | }
|
30818 | };
|
30819 |
|
30820 | var applyDispatcher = function applyDispatcher(dispatchers, payload) {
|
30821 | var _context24;
|
30822 |
|
30823 | return (0, _reduce.default)(_context24 = ensureArray(dispatchers)).call(_context24, function (resultPromise, dispatcher) {
|
30824 | return resultPromise.then(function (shouldDispatch) {
|
30825 | return shouldDispatch === false ? false : dispatcher.apply(void 0, _toConsumableArray(payload));
|
30826 | })["catch"](function (error) {
|
30827 | if (dispatcher._pluginName) {
|
30828 |
|
30829 | error.message += "[".concat(dispatcher._pluginName, "]");
|
30830 | }
|
30831 |
|
30832 | throw error;
|
30833 | });
|
30834 | }, _promise.default.resolve(true));
|
30835 | };
|
30836 |
|
30837 | var version = "5.0.0-rc.8";
|
30838 | var _excluded = ["plugins"];
|
30839 |
|
30840 | function ownKeys$2(object, enumerableOnly) {
|
30841 | var keys = (0, _keys.default)(object);
|
30842 |
|
30843 | if (_getOwnPropertySymbols.default) {
|
30844 | var symbols = (0, _getOwnPropertySymbols.default)(object);
|
30845 | enumerableOnly && (symbols = (0, _filter.default)(symbols).call(symbols, function (sym) {
|
30846 | return (0, _getOwnPropertyDescriptor.default)(object, sym).enumerable;
|
30847 | })), keys.push.apply(keys, symbols);
|
30848 | }
|
30849 |
|
30850 | return keys;
|
30851 | }
|
30852 |
|
30853 | function _objectSpread$2(target) {
|
30854 | for (var i = 1; i < arguments.length; i++) {
|
30855 | var source = null != arguments[i] ? arguments[i] : {};
|
30856 | i % 2 ? ownKeys$2(Object(source), !0).forEach(function (key) {
|
30857 | _defineProperty(target, key, source[key]);
|
30858 | }) : _getOwnPropertyDescriptors.default ? (0, _defineProperties.default)(target, (0, _getOwnPropertyDescriptors.default)(source)) : ownKeys$2(Object(source)).forEach(function (key) {
|
30859 | (0, _defineProperty2.default)(target, key, (0, _getOwnPropertyDescriptor.default)(source, key));
|
30860 | });
|
30861 | }
|
30862 |
|
30863 | return target;
|
30864 | }
|
30865 |
|
30866 | var debug$6 = d('LC:Realtime');
|
30867 | var routerCache = new Cache('push-router');
|
30868 | var initializedApp = {};
|
30869 |
|
30870 | var Realtime = function (_EventEmitter) {
|
30871 | _inheritsLoose(Realtime, _EventEmitter);
|
30872 | |
30873 |
|
30874 |
|
30875 |
|
30876 |
|
30877 |
|
30878 |
|
30879 |
|
30880 |
|
30881 |
|
30882 |
|
30883 |
|
30884 |
|
30885 |
|
30886 | function Realtime(_ref) {
|
30887 | var _context25;
|
30888 |
|
30889 | var _this2;
|
30890 |
|
30891 | var plugins = _ref.plugins,
|
30892 | options = _objectWithoutProperties(_ref, _excluded);
|
30893 |
|
30894 | debug$6('initializing Realtime %s %O', version, options);
|
30895 | _this2 = _EventEmitter.call(this) || this;
|
30896 | var appId = options.appId;
|
30897 |
|
30898 | if (typeof appId !== 'string') {
|
30899 | throw new TypeError("appId [".concat(appId, "] is not a string"));
|
30900 | }
|
30901 |
|
30902 | if (initializedApp[appId]) {
|
30903 | throw new Error("App [".concat(appId, "] is already initialized."));
|
30904 | }
|
30905 |
|
30906 | initializedApp[appId] = true;
|
30907 |
|
30908 | if (typeof options.appKey !== 'string') {
|
30909 | throw new TypeError("appKey [".concat(options.appKey, "] is not a string"));
|
30910 | }
|
30911 |
|
30912 | if (isCNApp(appId)) {
|
30913 | if (!options.server) {
|
30914 | throw new TypeError("server option is required for apps from CN region");
|
30915 | }
|
30916 | }
|
30917 |
|
30918 | _this2._options = _objectSpread$2({
|
30919 | appId: undefined,
|
30920 | appKey: undefined,
|
30921 | noBinary: false,
|
30922 | ssl: true,
|
30923 | RTMServerName: typeof process !== 'undefined' ? process.env.RTM_SERVER_NAME : undefined
|
30924 | }, options);
|
30925 | _this2._cache = new Cache('endpoints');
|
30926 |
|
30927 | var _this = internal(_assertThisInitialized(_this2));
|
30928 |
|
30929 | _this.clients = new _set.default();
|
30930 | _this.pendingClients = new _set.default();
|
30931 | var mergedPlugins = (0, _concat.default)(_context25 = []).call(_context25, _toConsumableArray(ensureArray(Realtime.__preRegisteredPlugins)), _toConsumableArray(ensureArray(plugins)));
|
30932 | debug$6('Using plugins %o', (0, _map.default)(mergedPlugins).call(mergedPlugins, function (plugin) {
|
30933 | return plugin.name;
|
30934 | }));
|
30935 | _this2._plugins = (0, _reduce.default)(mergedPlugins).call(mergedPlugins, function (result, plugin) {
|
30936 | (0, _keys.default)(plugin).forEach(function (hook) {
|
30937 | if ({}.hasOwnProperty.call(plugin, hook) && hook !== 'name') {
|
30938 | var _context26;
|
30939 |
|
30940 | if (plugin.name) {
|
30941 | ensureArray(plugin[hook]).forEach(function (value) {
|
30942 |
|
30943 | value._pluginName = plugin.name;
|
30944 | });
|
30945 | }
|
30946 |
|
30947 |
|
30948 | result[hook] = (0, _concat.default)(_context26 = ensureArray(result[hook])).call(_context26, plugin[hook]);
|
30949 | }
|
30950 | });
|
30951 | return result;
|
30952 | }, {});
|
30953 |
|
30954 | applyDecorators(_this2._plugins.onRealtimeCreate, _assertThisInitialized(_this2));
|
30955 | return _this2;
|
30956 | }
|
30957 |
|
30958 | var _proto = Realtime.prototype;
|
30959 |
|
30960 | _proto._request = function () {
|
30961 | var _request2 = _asyncToGenerator( _regeneratorRuntime.mark(function _callee(_ref2) {
|
30962 | var method, _url, _ref2$version, version, path, query, headers, data, url, _this$_options, appId, server, _yield$this$construct, api;
|
30963 |
|
30964 | return _regeneratorRuntime.wrap(function _callee$(_context) {
|
30965 | var _context27, _context28;
|
30966 |
|
30967 | while (1) {
|
30968 | switch (_context.prev = _context.next) {
|
30969 | case 0:
|
30970 | method = _ref2.method, _url = _ref2.url, _ref2$version = _ref2.version, version = _ref2$version === void 0 ? '1.1' : _ref2$version, path = _ref2.path, query = _ref2.query, headers = _ref2.headers, data = _ref2.data;
|
30971 | url = _url;
|
30972 |
|
30973 | if (url) {
|
30974 | _context.next = 9;
|
30975 | break;
|
30976 | }
|
30977 |
|
30978 | _this$_options = this._options, appId = _this$_options.appId, server = _this$_options.server;
|
30979 | _context.next = 6;
|
30980 | return this.constructor._getServerUrls({
|
30981 | appId: appId,
|
30982 | server: server
|
30983 | });
|
30984 |
|
30985 | case 6:
|
30986 | _yield$this$construct = _context.sent;
|
30987 | api = _yield$this$construct.api;
|
30988 | url = (0, _concat.default)(_context27 = (0, _concat.default)(_context28 = "".concat(api, "/")).call(_context28, version)).call(_context27, path);
|
30989 |
|
30990 | case 9:
|
30991 | return _context.abrupt("return", request({
|
30992 | url: url,
|
30993 | method: method,
|
30994 | query: query,
|
30995 | headers: _objectSpread$2({
|
30996 | 'X-LC-Id': this._options.appId,
|
30997 | 'X-LC-Key': this._options.appKey
|
30998 | }, headers),
|
30999 | data: data
|
31000 | }));
|
31001 |
|
31002 | case 10:
|
31003 | case "end":
|
31004 | return _context.stop();
|
31005 | }
|
31006 | }
|
31007 | }, _callee, this);
|
31008 | }));
|
31009 |
|
31010 | function _request(_x) {
|
31011 | return _request2.apply(this, arguments);
|
31012 | }
|
31013 |
|
31014 | return _request;
|
31015 | }();
|
31016 |
|
31017 | _proto._open = function _open() {
|
31018 | var _this3 = this;
|
31019 |
|
31020 | if (this._openPromise) return this._openPromise;
|
31021 | var format = 'protobuf2';
|
31022 |
|
31023 | if (this._options.noBinary) {
|
31024 |
|
31025 | format = 'proto2base64';
|
31026 | }
|
31027 |
|
31028 | var version = 3;
|
31029 | var protocol = {
|
31030 | format: format,
|
31031 | version: version
|
31032 | };
|
31033 | this._openPromise = new _promise.default(function (resolve, reject) {
|
31034 | debug$6('No connection established, create a new one.');
|
31035 | var connection = new Connection(function () {
|
31036 | return _this3._getRTMServers(_this3._options);
|
31037 | }, protocol);
|
31038 | connection.on(OPEN, function () {
|
31039 | return resolve(connection);
|
31040 | }).on(ERROR, function (error) {
|
31041 | delete _this3._openPromise;
|
31042 | reject(error);
|
31043 | }).on(EXPIRE, _asyncToGenerator( _regeneratorRuntime.mark(function _callee2() {
|
31044 | return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
31045 | while (1) {
|
31046 | switch (_context2.prev = _context2.next) {
|
31047 | case 0:
|
31048 | debug$6('Connection expired. Refresh endpoints.');
|
31049 |
|
31050 | _this3._cache.set('endpoints', null, 0);
|
31051 |
|
31052 | _context2.next = 4;
|
31053 | return _this3._getRTMServers(_this3._options);
|
31054 |
|
31055 | case 4:
|
31056 | connection.urls = _context2.sent;
|
31057 | connection.disconnect();
|
31058 |
|
31059 | case 6:
|
31060 | case "end":
|
31061 | return _context2.stop();
|
31062 | }
|
31063 | }
|
31064 | }, _callee2);
|
31065 | }))).on(MESSAGE, _this3._dispatchCommand.bind(_this3));
|
31066 | |
31067 |
|
31068 |
|
31069 |
|
31070 |
|
31071 |
|
31072 |
|
31073 | |
31074 |
|
31075 |
|
31076 |
|
31077 |
|
31078 |
|
31079 |
|
31080 | |
31081 |
|
31082 |
|
31083 |
|
31084 |
|
31085 |
|
31086 | |
31087 |
|
31088 |
|
31089 |
|
31090 |
|
31091 |
|
31092 | |
31093 |
|
31094 |
|
31095 |
|
31096 |
|
31097 |
|
31098 |
|
31099 | |
31100 |
|
31101 |
|
31102 |
|
31103 |
|
31104 |
|
31105 |
|
31106 |
|
31107 | |
31108 |
|
31109 |
|
31110 |
|
31111 |
|
31112 |
|
31113 |
|
31114 | |
31115 |
|
31116 |
|
31117 |
|
31118 |
|
31119 |
|
31120 |
|
31121 | |
31122 |
|
31123 |
|
31124 |
|
31125 |
|
31126 |
|
31127 |
|
31128 | |
31129 |
|
31130 |
|
31131 |
|
31132 |
|
31133 |
|
31134 |
|
31135 | |
31136 |
|
31137 |
|
31138 |
|
31139 |
|
31140 |
|
31141 |
|
31142 |
|
31143 | [DISCONNECT, RECONNECT, RETRY, SCHEDULE, OFFLINE, ONLINE].forEach(function (event) {
|
31144 | return connection.on(event, function () {
|
31145 | var _context29;
|
31146 |
|
31147 | for (var _len = arguments.length, payload = new Array(_len), _key = 0; _key < _len; _key++) {
|
31148 | payload[_key] = arguments[_key];
|
31149 | }
|
31150 |
|
31151 | debug$6("".concat(event, " event emitted. %o"), payload);
|
31152 |
|
31153 | _this3.emit.apply(_this3, (0, _concat.default)(_context29 = [event]).call(_context29, payload));
|
31154 |
|
31155 | if (event !== RECONNECT) {
|
31156 | internal(_this3).clients.forEach(function (client) {
|
31157 | var _context30;
|
31158 |
|
31159 | client.emit.apply(client, (0, _concat.default)(_context30 = [event]).call(_context30, payload));
|
31160 | });
|
31161 | }
|
31162 | });
|
31163 | });
|
31164 |
|
31165 | connection.handleClose = function handleClose(event) {
|
31166 | var isFatal = [ErrorCode.APP_NOT_AVAILABLE, ErrorCode.INVALID_LOGIN, ErrorCode.INVALID_ORIGIN].some(function (errorCode) {
|
31167 | return errorCode === event.code;
|
31168 | });
|
31169 |
|
31170 | if (isFatal) {
|
31171 |
|
31172 | this["throw"](createError(event));
|
31173 | } else {
|
31174 |
|
31175 | this.disconnect();
|
31176 | }
|
31177 | };
|
31178 |
|
31179 | internal(_this3).connection = connection;
|
31180 | });
|
31181 | return this._openPromise;
|
31182 | };
|
31183 |
|
31184 | _proto._getRTMServers = function () {
|
31185 | var _getRTMServers2 = _asyncToGenerator( _regeneratorRuntime.mark(function _callee3(options) {
|
31186 | var info, cachedEndPoints, _info, server, secondary, ttl;
|
31187 |
|
31188 | return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
31189 | while (1) {
|
31190 | switch (_context3.prev = _context3.next) {
|
31191 | case 0:
|
31192 | if (!options.RTMServers) {
|
31193 | _context3.next = 2;
|
31194 | break;
|
31195 | }
|
31196 |
|
31197 | return _context3.abrupt("return", shuffle(ensureArray(options.RTMServers)));
|
31198 |
|
31199 | case 2:
|
31200 | cachedEndPoints = this._cache.get('endpoints');
|
31201 |
|
31202 | if (!cachedEndPoints) {
|
31203 | _context3.next = 7;
|
31204 | break;
|
31205 | }
|
31206 |
|
31207 | info = cachedEndPoints;
|
31208 | _context3.next = 14;
|
31209 | break;
|
31210 |
|
31211 | case 7:
|
31212 | _context3.next = 9;
|
31213 | return this.constructor._fetchRTMServers(options);
|
31214 |
|
31215 | case 9:
|
31216 | info = _context3.sent;
|
31217 | _info = info, server = _info.server, secondary = _info.secondary, ttl = _info.ttl;
|
31218 |
|
31219 | if (!(typeof server !== 'string' && typeof secondary !== 'string' && typeof ttl !== 'number')) {
|
31220 | _context3.next = 13;
|
31221 | break;
|
31222 | }
|
31223 |
|
31224 | throw new Error("malformed RTM route response: ".concat((0, _stringify.default)(info)));
|
31225 |
|
31226 | case 13:
|
31227 | this._cache.set('endpoints', info, info.ttl * 1000);
|
31228 |
|
31229 | case 14:
|
31230 | debug$6('endpoint info: %O', info);
|
31231 | return _context3.abrupt("return", [info.server, info.secondary]);
|
31232 |
|
31233 | case 16:
|
31234 | case "end":
|
31235 | return _context3.stop();
|
31236 | }
|
31237 | }
|
31238 | }, _callee3, this);
|
31239 | }));
|
31240 |
|
31241 | function _getRTMServers(_x2) {
|
31242 | return _getRTMServers2.apply(this, arguments);
|
31243 | }
|
31244 |
|
31245 | return _getRTMServers;
|
31246 | }();
|
31247 |
|
31248 | Realtime._getServerUrls = function () {
|
31249 | var _getServerUrls2 = _asyncToGenerator( _regeneratorRuntime.mark(function _callee4(_ref4) {
|
31250 | var appId, server, cachedRouter, defaultProtocol;
|
31251 | return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
31252 | while (1) {
|
31253 | switch (_context4.prev = _context4.next) {
|
31254 | case 0:
|
31255 | appId = _ref4.appId, server = _ref4.server;
|
31256 | debug$6('fetch server urls');
|
31257 |
|
31258 | if (!server) {
|
31259 | _context4.next = 6;
|
31260 | break;
|
31261 | }
|
31262 |
|
31263 | if (!(typeof server !== 'string')) {
|
31264 | _context4.next = 5;
|
31265 | break;
|
31266 | }
|
31267 |
|
31268 | return _context4.abrupt("return", server);
|
31269 |
|
31270 | case 5:
|
31271 | return _context4.abrupt("return", {
|
31272 | RTMRouter: server,
|
31273 | api: server
|
31274 | });
|
31275 |
|
31276 | case 6:
|
31277 | cachedRouter = routerCache.get(appId);
|
31278 |
|
31279 | if (!cachedRouter) {
|
31280 | _context4.next = 9;
|
31281 | break;
|
31282 | }
|
31283 |
|
31284 | return _context4.abrupt("return", cachedRouter);
|
31285 |
|
31286 | case 9:
|
31287 | defaultProtocol = 'https://';
|
31288 | return _context4.abrupt("return", request({
|
31289 | url: 'https://app-router.com/2/route',
|
31290 | query: {
|
31291 | appId: appId
|
31292 | },
|
31293 | timeout: 20000
|
31294 | }).then(tap(debug$6)).then(function (_ref5) {
|
31295 | var _context31, _context32;
|
31296 |
|
31297 | var RTMRouterServer = _ref5.rtm_router_server,
|
31298 | APIServer = _ref5.api_server,
|
31299 | _ref5$ttl = _ref5.ttl,
|
31300 | ttl = _ref5$ttl === void 0 ? 3600 : _ref5$ttl;
|
31301 |
|
31302 | if (!RTMRouterServer) {
|
31303 | throw new Error('rtm router not exists');
|
31304 | }
|
31305 |
|
31306 | var serverUrls = {
|
31307 | RTMRouter: (0, _concat.default)(_context31 = "".concat(defaultProtocol)).call(_context31, RTMRouterServer),
|
31308 | api: (0, _concat.default)(_context32 = "".concat(defaultProtocol)).call(_context32, APIServer)
|
31309 | };
|
31310 | routerCache.set(appId, serverUrls, ttl * 1000);
|
31311 | return serverUrls;
|
31312 | })["catch"](function () {
|
31313 | var _context33, _context34, _context35, _context36;
|
31314 |
|
31315 | var id = (0, _slice.default)(appId).call(appId, 0, 8).toLowerCase();
|
31316 | var domain = 'lncldglobal.com';
|
31317 | return {
|
31318 | RTMRouter: (0, _concat.default)(_context33 = (0, _concat.default)(_context34 = "".concat(defaultProtocol)).call(_context34, id, ".rtm.")).call(_context33, domain),
|
31319 | api: (0, _concat.default)(_context35 = (0, _concat.default)(_context36 = "".concat(defaultProtocol)).call(_context36, id, ".api.")).call(_context35, domain)
|
31320 | };
|
31321 | }));
|
31322 |
|
31323 | case 11:
|
31324 | case "end":
|
31325 | return _context4.stop();
|
31326 | }
|
31327 | }
|
31328 | }, _callee4);
|
31329 | }));
|
31330 |
|
31331 | function _getServerUrls(_x3) {
|
31332 | return _getServerUrls2.apply(this, arguments);
|
31333 | }
|
31334 |
|
31335 | return _getServerUrls;
|
31336 | }();
|
31337 |
|
31338 | Realtime._fetchRTMServers = function _fetchRTMServers(_ref6) {
|
31339 | var appId = _ref6.appId,
|
31340 | ssl = _ref6.ssl,
|
31341 | server = _ref6.server,
|
31342 | RTMServerName = _ref6.RTMServerName;
|
31343 | debug$6('fetch endpoint info');
|
31344 | return this._getServerUrls({
|
31345 | appId: appId,
|
31346 | server: server
|
31347 | }).then(tap(debug$6)).then(function (_ref7) {
|
31348 | var RTMRouter = _ref7.RTMRouter;
|
31349 | return request({
|
31350 | url: "".concat(RTMRouter, "/v1/route"),
|
31351 | query: {
|
31352 | appId: appId,
|
31353 | secure: ssl,
|
31354 | features: isWeapp ? 'wechat' : undefined,
|
31355 | server: RTMServerName,
|
31356 | _t: Date.now()
|
31357 | },
|
31358 | timeout: 20000
|
31359 | }).then(tap(debug$6));
|
31360 | });
|
31361 | };
|
31362 |
|
31363 | _proto._close = function _close() {
|
31364 | if (this._openPromise) {
|
31365 | this._openPromise.then(function (connection) {
|
31366 | return connection.close();
|
31367 | });
|
31368 | }
|
31369 |
|
31370 | delete this._openPromise;
|
31371 | }
|
31372 | |
31373 |
|
31374 |
|
31375 |
|
31376 |
|
31377 | ;
|
31378 |
|
31379 | _proto.retry = function retry() {
|
31380 | var _internal = internal(this),
|
31381 | connection = _internal.connection;
|
31382 |
|
31383 | if (!connection) {
|
31384 | throw new Error('no connection established');
|
31385 | }
|
31386 |
|
31387 | if (connection.cannot('retry')) {
|
31388 | throw new Error("retrying not allowed when not disconnected. the connection is now ".concat(connection.current));
|
31389 | }
|
31390 |
|
31391 | return connection.retry();
|
31392 | }
|
31393 | |
31394 |
|
31395 |
|
31396 |
|
31397 |
|
31398 |
|
31399 |
|
31400 |
|
31401 | ;
|
31402 |
|
31403 | _proto.pause = function pause() {
|
31404 |
|
31405 |
|
31406 | var _internal2 = internal(this),
|
31407 | connection = _internal2.connection;
|
31408 |
|
31409 | if (!connection) return;
|
31410 | if (connection.can('pause')) connection.pause();
|
31411 | }
|
31412 | |
31413 |
|
31414 |
|
31415 |
|
31416 |
|
31417 |
|
31418 |
|
31419 | ;
|
31420 |
|
31421 | _proto.resume = function resume() {
|
31422 |
|
31423 | var _internal3 = internal(this),
|
31424 | connection = _internal3.connection;
|
31425 |
|
31426 | if (!connection) return;
|
31427 | if (connection.can('resume')) connection.resume();
|
31428 | };
|
31429 |
|
31430 | _proto._registerPending = function _registerPending(value) {
|
31431 | internal(this).pendingClients.add(value);
|
31432 | };
|
31433 |
|
31434 | _proto._deregisterPending = function _deregisterPending(client) {
|
31435 | internal(this).pendingClients["delete"](client);
|
31436 | };
|
31437 |
|
31438 | _proto._register = function _register(client) {
|
31439 | internal(this).clients.add(client);
|
31440 | };
|
31441 |
|
31442 | _proto._deregister = function _deregister(client) {
|
31443 | var _this = internal(this);
|
31444 |
|
31445 | _this.clients["delete"](client);
|
31446 |
|
31447 | if (_this.clients.size + _this.pendingClients.size === 0) {
|
31448 | this._close();
|
31449 | }
|
31450 | };
|
31451 |
|
31452 | _proto._dispatchCommand = function _dispatchCommand(command) {
|
31453 | return applyDispatcher(this._plugins.beforeCommandDispatch, [command, this]).then(function (shouldDispatch) {
|
31454 |
|
31455 | if (shouldDispatch) return debug$6('[WARN] Unexpected message received: %O', trim(command));
|
31456 | return false;
|
31457 | });
|
31458 | };
|
31459 |
|
31460 | return Realtime;
|
31461 | }(EventEmitter);
|
31462 |
|
31463 |
|
31464 | var polyfilledPromise = _promise.default;
|
31465 | exports.EventEmitter = EventEmitter;
|
31466 | exports.Promise = polyfilledPromise;
|
31467 | exports.Protocals = message;
|
31468 | exports.Protocols = message;
|
31469 | exports.Realtime = Realtime;
|
31470 | exports.debug = debug$2;
|
31471 | exports.getAdapter = getAdapter;
|
31472 | exports.setAdapters = setAdapters;
|
31473 | }.call(exports, __webpack_require__(74)))
|
31474 |
|
31475 | }),
|
31476 |
|
31477 | (function(module, exports, __webpack_require__) {
|
31478 |
|
31479 | module.exports = __webpack_require__(593);
|
31480 |
|
31481 | }),
|
31482 |
|
31483 | (function(module, exports, __webpack_require__) {
|
31484 |
|
31485 | var parent = __webpack_require__(594);
|
31486 |
|
31487 | module.exports = parent;
|
31488 |
|
31489 |
|
31490 | }),
|
31491 |
|
31492 | (function(module, exports, __webpack_require__) {
|
31493 |
|
31494 | __webpack_require__(595);
|
31495 | var path = __webpack_require__(5);
|
31496 |
|
31497 | module.exports = path.Object.freeze;
|
31498 |
|
31499 |
|
31500 | }),
|
31501 |
|
31502 | (function(module, exports, __webpack_require__) {
|
31503 |
|
31504 | var $ = __webpack_require__(0);
|
31505 | var FREEZING = __webpack_require__(263);
|
31506 | var fails = __webpack_require__(2);
|
31507 | var isObject = __webpack_require__(11);
|
31508 | var onFreeze = __webpack_require__(94).onFreeze;
|
31509 |
|
31510 |
|
31511 | var $freeze = Object.freeze;
|
31512 | var FAILS_ON_PRIMITIVES = fails(function () { $freeze(1); });
|
31513 |
|
31514 |
|
31515 |
|
31516 | $({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES, sham: !FREEZING }, {
|
31517 | freeze: function freeze(it) {
|
31518 | return $freeze && isObject(it) ? $freeze(onFreeze(it)) : it;
|
31519 | }
|
31520 | });
|
31521 |
|
31522 |
|
31523 | }),
|
31524 |
|
31525 | (function(module, exports, __webpack_require__) {
|
31526 |
|
31527 | module.exports = __webpack_require__(597);
|
31528 |
|
31529 | }),
|
31530 |
|
31531 | (function(module, exports, __webpack_require__) {
|
31532 |
|
31533 | var parent = __webpack_require__(598);
|
31534 |
|
31535 | module.exports = parent;
|
31536 |
|
31537 |
|
31538 | }),
|
31539 |
|
31540 | (function(module, exports, __webpack_require__) {
|
31541 |
|
31542 | __webpack_require__(599);
|
31543 | var path = __webpack_require__(5);
|
31544 |
|
31545 | module.exports = path.Object.getOwnPropertyDescriptors;
|
31546 |
|
31547 |
|
31548 | }),
|
31549 |
|
31550 | (function(module, exports, __webpack_require__) {
|
31551 |
|
31552 | var $ = __webpack_require__(0);
|
31553 | var DESCRIPTORS = __webpack_require__(14);
|
31554 | var ownKeys = __webpack_require__(163);
|
31555 | var toIndexedObject = __webpack_require__(32);
|
31556 | var getOwnPropertyDescriptorModule = __webpack_require__(62);
|
31557 | var createProperty = __webpack_require__(91);
|
31558 |
|
31559 |
|
31560 |
|
31561 | $({ target: 'Object', stat: true, sham: !DESCRIPTORS }, {
|
31562 | getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object) {
|
31563 | var O = toIndexedObject(object);
|
31564 | var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
|
31565 | var keys = ownKeys(O);
|
31566 | var result = {};
|
31567 | var index = 0;
|
31568 | var key, descriptor;
|
31569 | while (keys.length > index) {
|
31570 | descriptor = getOwnPropertyDescriptor(O, key = keys[index++]);
|
31571 | if (descriptor !== undefined) createProperty(result, key, descriptor);
|
31572 | }
|
31573 | return result;
|
31574 | }
|
31575 | });
|
31576 |
|
31577 |
|
31578 | }),
|
31579 |
|
31580 | (function(module, exports, __webpack_require__) {
|
31581 |
|
31582 | module.exports = __webpack_require__(601);
|
31583 |
|
31584 | }),
|
31585 |
|
31586 | (function(module, exports, __webpack_require__) {
|
31587 |
|
31588 | var parent = __webpack_require__(602);
|
31589 |
|
31590 | module.exports = parent;
|
31591 |
|
31592 |
|
31593 | }),
|
31594 |
|
31595 | (function(module, exports, __webpack_require__) {
|
31596 |
|
31597 | __webpack_require__(603);
|
31598 | var path = __webpack_require__(5);
|
31599 |
|
31600 | var Object = path.Object;
|
31601 |
|
31602 | var defineProperties = module.exports = function defineProperties(T, D) {
|
31603 | return Object.defineProperties(T, D);
|
31604 | };
|
31605 |
|
31606 | if (Object.defineProperties.sham) defineProperties.sham = true;
|
31607 |
|
31608 |
|
31609 | }),
|
31610 |
|
31611 | (function(module, exports, __webpack_require__) {
|
31612 |
|
31613 | var $ = __webpack_require__(0);
|
31614 | var DESCRIPTORS = __webpack_require__(14);
|
31615 | var defineProperties = __webpack_require__(129).f;
|
31616 |
|
31617 |
|
31618 |
|
31619 |
|
31620 | $({ target: 'Object', stat: true, forced: Object.defineProperties !== defineProperties, sham: !DESCRIPTORS }, {
|
31621 | defineProperties: defineProperties
|
31622 | });
|
31623 |
|
31624 |
|
31625 | }),
|
31626 |
|
31627 | (function(module, exports, __webpack_require__) {
|
31628 |
|
31629 | module.exports = __webpack_require__(605);
|
31630 |
|
31631 | }),
|
31632 |
|
31633 | (function(module, exports, __webpack_require__) {
|
31634 |
|
31635 | var parent = __webpack_require__(606);
|
31636 |
|
31637 | module.exports = parent;
|
31638 |
|
31639 |
|
31640 | }),
|
31641 |
|
31642 | (function(module, exports, __webpack_require__) {
|
31643 |
|
31644 | var isPrototypeOf = __webpack_require__(19);
|
31645 | var method = __webpack_require__(607);
|
31646 |
|
31647 | var ArrayPrototype = Array.prototype;
|
31648 |
|
31649 | module.exports = function (it) {
|
31650 | var own = it.reduce;
|
31651 | return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.reduce) ? method : own;
|
31652 | };
|
31653 |
|
31654 |
|
31655 | }),
|
31656 |
|
31657 | (function(module, exports, __webpack_require__) {
|
31658 |
|
31659 | __webpack_require__(608);
|
31660 | var entryVirtual = __webpack_require__(40);
|
31661 |
|
31662 | module.exports = entryVirtual('Array').reduce;
|
31663 |
|
31664 |
|
31665 | }),
|
31666 |
|
31667 | (function(module, exports, __webpack_require__) {
|
31668 |
|
31669 | "use strict";
|
31670 |
|
31671 | var $ = __webpack_require__(0);
|
31672 | var $reduce = __webpack_require__(609).left;
|
31673 | var arrayMethodIsStrict = __webpack_require__(232);
|
31674 | var CHROME_VERSION = __webpack_require__(77);
|
31675 | var IS_NODE = __webpack_require__(107);
|
31676 |
|
31677 | var STRICT_METHOD = arrayMethodIsStrict('reduce');
|
31678 |
|
31679 |
|
31680 | var CHROME_BUG = !IS_NODE && CHROME_VERSION > 79 && CHROME_VERSION < 83;
|
31681 |
|
31682 |
|
31683 |
|
31684 | $({ target: 'Array', proto: true, forced: !STRICT_METHOD || CHROME_BUG }, {
|
31685 | reduce: function reduce(callbackfn /* , initialValue */) {
|
31686 | var length = arguments.length;
|
31687 | return $reduce(this, callbackfn, length, length > 1 ? arguments[1] : undefined);
|
31688 | }
|
31689 | });
|
31690 |
|
31691 |
|
31692 | }),
|
31693 |
|
31694 | (function(module, exports, __webpack_require__) {
|
31695 |
|
31696 | var aCallable = __webpack_require__(31);
|
31697 | var toObject = __webpack_require__(34);
|
31698 | var IndexedObject = __webpack_require__(95);
|
31699 | var lengthOfArrayLike = __webpack_require__(41);
|
31700 |
|
31701 | var $TypeError = TypeError;
|
31702 |
|
31703 |
|
31704 | var createMethod = function (IS_RIGHT) {
|
31705 | return function (that, callbackfn, argumentsLength, memo) {
|
31706 | aCallable(callbackfn);
|
31707 | var O = toObject(that);
|
31708 | var self = IndexedObject(O);
|
31709 | var length = lengthOfArrayLike(O);
|
31710 | var index = IS_RIGHT ? length - 1 : 0;
|
31711 | var i = IS_RIGHT ? -1 : 1;
|
31712 | if (argumentsLength < 2) while (true) {
|
31713 | if (index in self) {
|
31714 | memo = self[index];
|
31715 | index += i;
|
31716 | break;
|
31717 | }
|
31718 | index += i;
|
31719 | if (IS_RIGHT ? index < 0 : length <= index) {
|
31720 | throw $TypeError('Reduce of empty array with no initial value');
|
31721 | }
|
31722 | }
|
31723 | for (;IS_RIGHT ? index >= 0 : length > index; index += i) if (index in self) {
|
31724 | memo = callbackfn(memo, self[index], index, O);
|
31725 | }
|
31726 | return memo;
|
31727 | };
|
31728 | };
|
31729 |
|
31730 | module.exports = {
|
31731 |
|
31732 |
|
31733 | left: createMethod(false),
|
31734 |
|
31735 |
|
31736 | right: createMethod(true)
|
31737 | };
|
31738 |
|
31739 |
|
31740 | }),
|
31741 |
|
31742 | (function(module, exports, __webpack_require__) {
|
31743 |
|
31744 | var parent = __webpack_require__(611);
|
31745 | __webpack_require__(39);
|
31746 |
|
31747 | module.exports = parent;
|
31748 |
|
31749 |
|
31750 | }),
|
31751 |
|
31752 | (function(module, exports, __webpack_require__) {
|
31753 |
|
31754 | __webpack_require__(38);
|
31755 | __webpack_require__(53);
|
31756 | __webpack_require__(612);
|
31757 | __webpack_require__(55);
|
31758 | var path = __webpack_require__(5);
|
31759 |
|
31760 | module.exports = path.Set;
|
31761 |
|
31762 |
|
31763 | }),
|
31764 |
|
31765 | (function(module, exports, __webpack_require__) {
|
31766 |
|
31767 |
|
31768 | __webpack_require__(613);
|
31769 |
|
31770 |
|
31771 | }),
|
31772 |
|
31773 | (function(module, exports, __webpack_require__) {
|
31774 |
|
31775 | "use strict";
|
31776 |
|
31777 | var collection = __webpack_require__(156);
|
31778 | var collectionStrong = __webpack_require__(264);
|
31779 |
|
31780 |
|
31781 |
|
31782 | collection('Set', function (init) {
|
31783 | return function Set() { return init(this, arguments.length ? arguments[0] : undefined); };
|
31784 | }, collectionStrong);
|
31785 |
|
31786 |
|
31787 | }),
|
31788 |
|
31789 | (function(module, exports, __webpack_require__) {
|
31790 |
|
31791 | var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; |
31792 |
|
31793 |
|
31794 |
|
31795 |
|
31796 |
|
31797 |
|
31798 |
|
31799 |
|
31800 |
|
31801 |
|
31802 |
|
31803 |
|
31804 |
|
31805 |
|
31806 |
|
31807 |
|
31808 |
|
31809 |
|
31810 |
|
31811 |
|
31812 | (function(global, factory) {
|
31813 |
|
31814 | if (true)
|
31815 | !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(615)], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
|
31816 | __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
|
31817 | (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
|
31818 | __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
|
31819 | else if (typeof require === "function" && typeof module === "object" && module && module["exports"])
|
31820 | module["exports"] = factory(require("bytebuffer"), true);
|
31821 | else
|
31822 | (global["dcodeIO"] = global["dcodeIO"] || {})["ProtoBuf"] = factory(global["dcodeIO"]["ByteBuffer"]);
|
31823 |
|
31824 | })(this, function(ByteBuffer, isCommonJS) {
|
31825 | "use strict";
|
31826 |
|
31827 | |
31828 |
|
31829 |
|
31830 |
|
31831 |
|
31832 |
|
31833 | var ProtoBuf = {};
|
31834 |
|
31835 | |
31836 |
|
31837 |
|
31838 |
|
31839 | ProtoBuf.ByteBuffer = ByteBuffer;
|
31840 |
|
31841 | |
31842 |
|
31843 |
|
31844 |
|
31845 | ProtoBuf.Long = ByteBuffer.Long || null;
|
31846 |
|
31847 | |
31848 |
|
31849 |
|
31850 |
|
31851 |
|
31852 |
|
31853 | ProtoBuf.VERSION = "5.0.3";
|
31854 |
|
31855 | |
31856 |
|
31857 |
|
31858 |
|
31859 |
|
31860 |
|
31861 | ProtoBuf.WIRE_TYPES = {};
|
31862 |
|
31863 | |
31864 |
|
31865 |
|
31866 |
|
31867 |
|
31868 | ProtoBuf.WIRE_TYPES.VARINT = 0;
|
31869 |
|
31870 | |
31871 |
|
31872 |
|
31873 |
|
31874 |
|
31875 |
|
31876 | ProtoBuf.WIRE_TYPES.BITS64 = 1;
|
31877 |
|
31878 | |
31879 |
|
31880 |
|
31881 |
|
31882 |
|
31883 |
|
31884 | ProtoBuf.WIRE_TYPES.LDELIM = 2;
|
31885 |
|
31886 | |
31887 |
|
31888 |
|
31889 |
|
31890 |
|
31891 |
|
31892 | ProtoBuf.WIRE_TYPES.STARTGROUP = 3;
|
31893 |
|
31894 | |
31895 |
|
31896 |
|
31897 |
|
31898 |
|
31899 |
|
31900 | ProtoBuf.WIRE_TYPES.ENDGROUP = 4;
|
31901 |
|
31902 | |
31903 |
|
31904 |
|
31905 |
|
31906 |
|
31907 |
|
31908 | ProtoBuf.WIRE_TYPES.BITS32 = 5;
|
31909 |
|
31910 | |
31911 |
|
31912 |
|
31913 |
|
31914 |
|
31915 |
|
31916 | ProtoBuf.PACKABLE_WIRE_TYPES = [
|
31917 | ProtoBuf.WIRE_TYPES.VARINT,
|
31918 | ProtoBuf.WIRE_TYPES.BITS64,
|
31919 | ProtoBuf.WIRE_TYPES.BITS32
|
31920 | ];
|
31921 |
|
31922 | |
31923 |
|
31924 |
|
31925 |
|
31926 |
|
31927 |
|
31928 |
|
31929 | ProtoBuf.TYPES = {
|
31930 |
|
31931 | "int32": {
|
31932 | name: "int32",
|
31933 | wireType: ProtoBuf.WIRE_TYPES.VARINT,
|
31934 | defaultValue: 0
|
31935 | },
|
31936 | "uint32": {
|
31937 | name: "uint32",
|
31938 | wireType: ProtoBuf.WIRE_TYPES.VARINT,
|
31939 | defaultValue: 0
|
31940 | },
|
31941 | "sint32": {
|
31942 | name: "sint32",
|
31943 | wireType: ProtoBuf.WIRE_TYPES.VARINT,
|
31944 | defaultValue: 0
|
31945 | },
|
31946 | "int64": {
|
31947 | name: "int64",
|
31948 | wireType: ProtoBuf.WIRE_TYPES.VARINT,
|
31949 | defaultValue: ProtoBuf.Long ? ProtoBuf.Long.ZERO : undefined
|
31950 | },
|
31951 | "uint64": {
|
31952 | name: "uint64",
|
31953 | wireType: ProtoBuf.WIRE_TYPES.VARINT,
|
31954 | defaultValue: ProtoBuf.Long ? ProtoBuf.Long.UZERO : undefined
|
31955 | },
|
31956 | "sint64": {
|
31957 | name: "sint64",
|
31958 | wireType: ProtoBuf.WIRE_TYPES.VARINT,
|
31959 | defaultValue: ProtoBuf.Long ? ProtoBuf.Long.ZERO : undefined
|
31960 | },
|
31961 | "bool": {
|
31962 | name: "bool",
|
31963 | wireType: ProtoBuf.WIRE_TYPES.VARINT,
|
31964 | defaultValue: false
|
31965 | },
|
31966 | "double": {
|
31967 | name: "double",
|
31968 | wireType: ProtoBuf.WIRE_TYPES.BITS64,
|
31969 | defaultValue: 0
|
31970 | },
|
31971 | "string": {
|
31972 | name: "string",
|
31973 | wireType: ProtoBuf.WIRE_TYPES.LDELIM,
|
31974 | defaultValue: ""
|
31975 | },
|
31976 | "bytes": {
|
31977 | name: "bytes",
|
31978 | wireType: ProtoBuf.WIRE_TYPES.LDELIM,
|
31979 | defaultValue: null
|
31980 | },
|
31981 | "fixed32": {
|
31982 | name: "fixed32",
|
31983 | wireType: ProtoBuf.WIRE_TYPES.BITS32,
|
31984 | defaultValue: 0
|
31985 | },
|
31986 | "sfixed32": {
|
31987 | name: "sfixed32",
|
31988 | wireType: ProtoBuf.WIRE_TYPES.BITS32,
|
31989 | defaultValue: 0
|
31990 | },
|
31991 | "fixed64": {
|
31992 | name: "fixed64",
|
31993 | wireType: ProtoBuf.WIRE_TYPES.BITS64,
|
31994 | defaultValue: ProtoBuf.Long ? ProtoBuf.Long.UZERO : undefined
|
31995 | },
|
31996 | "sfixed64": {
|
31997 | name: "sfixed64",
|
31998 | wireType: ProtoBuf.WIRE_TYPES.BITS64,
|
31999 | defaultValue: ProtoBuf.Long ? ProtoBuf.Long.ZERO : undefined
|
32000 | },
|
32001 | "float": {
|
32002 | name: "float",
|
32003 | wireType: ProtoBuf.WIRE_TYPES.BITS32,
|
32004 | defaultValue: 0
|
32005 | },
|
32006 | "enum": {
|
32007 | name: "enum",
|
32008 | wireType: ProtoBuf.WIRE_TYPES.VARINT,
|
32009 | defaultValue: 0
|
32010 | },
|
32011 | "message": {
|
32012 | name: "message",
|
32013 | wireType: ProtoBuf.WIRE_TYPES.LDELIM,
|
32014 | defaultValue: null
|
32015 | },
|
32016 | "group": {
|
32017 | name: "group",
|
32018 | wireType: ProtoBuf.WIRE_TYPES.STARTGROUP,
|
32019 | defaultValue: null
|
32020 | }
|
32021 | };
|
32022 |
|
32023 | |
32024 |
|
32025 |
|
32026 |
|
32027 |
|
32028 |
|
32029 | ProtoBuf.MAP_KEY_TYPES = [
|
32030 | ProtoBuf.TYPES["int32"],
|
32031 | ProtoBuf.TYPES["sint32"],
|
32032 | ProtoBuf.TYPES["sfixed32"],
|
32033 | ProtoBuf.TYPES["uint32"],
|
32034 | ProtoBuf.TYPES["fixed32"],
|
32035 | ProtoBuf.TYPES["int64"],
|
32036 | ProtoBuf.TYPES["sint64"],
|
32037 | ProtoBuf.TYPES["sfixed64"],
|
32038 | ProtoBuf.TYPES["uint64"],
|
32039 | ProtoBuf.TYPES["fixed64"],
|
32040 | ProtoBuf.TYPES["bool"],
|
32041 | ProtoBuf.TYPES["string"],
|
32042 | ProtoBuf.TYPES["bytes"]
|
32043 | ];
|
32044 |
|
32045 | |
32046 |
|
32047 |
|
32048 |
|
32049 |
|
32050 |
|
32051 | ProtoBuf.ID_MIN = 1;
|
32052 |
|
32053 | |
32054 |
|
32055 |
|
32056 |
|
32057 |
|
32058 |
|
32059 | ProtoBuf.ID_MAX = 0x1FFFFFFF;
|
32060 |
|
32061 | |
32062 |
|
32063 |
|
32064 |
|
32065 |
|
32066 |
|
32067 | ProtoBuf.convertFieldsToCamelCase = false;
|
32068 |
|
32069 | |
32070 |
|
32071 |
|
32072 |
|
32073 |
|
32074 |
|
32075 | ProtoBuf.populateAccessors = true;
|
32076 |
|
32077 | |
32078 |
|
32079 |
|
32080 |
|
32081 |
|
32082 |
|
32083 | ProtoBuf.populateDefaults = true;
|
32084 |
|
32085 | |
32086 |
|
32087 |
|
32088 |
|
32089 | ProtoBuf.Util = (function() {
|
32090 | "use strict";
|
32091 |
|
32092 | |
32093 |
|
32094 |
|
32095 |
|
32096 |
|
32097 | var Util = {};
|
32098 |
|
32099 | |
32100 |
|
32101 |
|
32102 |
|
32103 |
|
32104 |
|
32105 | Util.IS_NODE = !!(
|
32106 | typeof process === 'object' && process+'' === '[object process]' && !process['browser']
|
32107 | );
|
32108 |
|
32109 | |
32110 |
|
32111 |
|
32112 |
|
32113 |
|
32114 |
|
32115 | Util.XHR = function() {
|
32116 |
|
32117 | var XMLHttpFactories = [
|
32118 | function () {return new XMLHttpRequest()},
|
32119 | function () {return new ActiveXObject("Msxml2.XMLHTTP")},
|
32120 | function () {return new ActiveXObject("Msxml3.XMLHTTP")},
|
32121 | function () {return new ActiveXObject("Microsoft.XMLHTTP")}
|
32122 | ];
|
32123 |
|
32124 | var xhr = null;
|
32125 | for (var i=0;i<XMLHttpFactories.length;i++) {
|
32126 | try { xhr = XMLHttpFactories[i](); }
|
32127 | catch (e) { continue; }
|
32128 | break;
|
32129 | }
|
32130 | if (!xhr)
|
32131 | throw Error("XMLHttpRequest is not supported");
|
32132 | return xhr;
|
32133 | };
|
32134 |
|
32135 | |
32136 |
|
32137 |
|
32138 |
|
32139 |
|
32140 |
|
32141 |
|
32142 |
|
32143 | Util.fetch = function(path, callback) {
|
32144 | if (callback && typeof callback != 'function')
|
32145 | callback = null;
|
32146 | if (Util.IS_NODE) {
|
32147 | var fs = __webpack_require__(617);
|
32148 | if (callback) {
|
32149 | fs.readFile(path, function(err, data) {
|
32150 | if (err)
|
32151 | callback(null);
|
32152 | else
|
32153 | callback(""+data);
|
32154 | });
|
32155 | } else
|
32156 | try {
|
32157 | return fs.readFileSync(path);
|
32158 | } catch (e) {
|
32159 | return null;
|
32160 | }
|
32161 | } else {
|
32162 | var xhr = Util.XHR();
|
32163 | xhr.open('GET', path, callback ? true : false);
|
32164 |
|
32165 | xhr.setRequestHeader('Accept', 'text/plain');
|
32166 | if (typeof xhr.overrideMimeType === 'function') xhr.overrideMimeType('text/plain');
|
32167 | if (callback) {
|
32168 | xhr.onreadystatechange = function() {
|
32169 | if (xhr.readyState != 4) return;
|
32170 | if ( xhr.status == 200 || (xhr.status == 0 && typeof xhr.responseText === 'string'))
|
32171 | callback(xhr.responseText);
|
32172 | else
|
32173 | callback(null);
|
32174 | };
|
32175 | if (xhr.readyState == 4)
|
32176 | return;
|
32177 | xhr.send(null);
|
32178 | } else {
|
32179 | xhr.send(null);
|
32180 | if ( xhr.status == 200 || (xhr.status == 0 && typeof xhr.responseText === 'string'))
|
32181 | return xhr.responseText;
|
32182 | return null;
|
32183 | }
|
32184 | }
|
32185 | };
|
32186 |
|
32187 | |
32188 |
|
32189 |
|
32190 |
|
32191 |
|
32192 |
|
32193 | Util.toCamelCase = function(str) {
|
32194 | return str.replace(/_([a-zA-Z])/g, function ($0, $1) {
|
32195 | return $1.toUpperCase();
|
32196 | });
|
32197 | };
|
32198 |
|
32199 | return Util;
|
32200 | })();
|
32201 |
|
32202 | |
32203 |
|
32204 |
|
32205 |
|
32206 |
|
32207 | ProtoBuf.Lang = {
|
32208 |
|
32209 |
|
32210 | DELIM: /[\s\{\}=;:\[\],'"\(\)<>]/g,
|
32211 |
|
32212 |
|
32213 | RULE: /^(?:required|optional|repeated|map)$/,
|
32214 |
|
32215 |
|
32216 | TYPE: /^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,
|
32217 |
|
32218 |
|
32219 | NAME: /^[a-zA-Z_][a-zA-Z_0-9]*$/,
|
32220 |
|
32221 |
|
32222 | TYPEDEF: /^[a-zA-Z][a-zA-Z_0-9]*$/,
|
32223 |
|
32224 |
|
32225 | TYPEREF: /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/,
|
32226 |
|
32227 |
|
32228 | FQTYPEREF: /^(?:\.[a-zA-Z_][a-zA-Z_0-9]*)+$/,
|
32229 |
|
32230 |
|
32231 | NUMBER: /^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,
|
32232 |
|
32233 |
|
32234 | NUMBER_DEC: /^(?:[1-9][0-9]*|0)$/,
|
32235 |
|
32236 |
|
32237 | NUMBER_HEX: /^0[xX][0-9a-fA-F]+$/,
|
32238 |
|
32239 |
|
32240 | NUMBER_OCT: /^0[0-7]+$/,
|
32241 |
|
32242 |
|
32243 | NUMBER_FLT: /^([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/,
|
32244 |
|
32245 |
|
32246 | BOOL: /^(?:true|false)$/i,
|
32247 |
|
32248 |
|
32249 | ID: /^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
|
32250 |
|
32251 |
|
32252 | NEGID: /^\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
|
32253 |
|
32254 |
|
32255 | WHITESPACE: /\s/,
|
32256 |
|
32257 |
|
32258 | STRING: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,
|
32259 |
|
32260 |
|
32261 | STRING_DQ: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,
|
32262 |
|
32263 |
|
32264 | STRING_SQ: /(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g
|
32265 | };
|
32266 |
|
32267 |
|
32268 | |
32269 |
|
32270 |
|
32271 |
|
32272 | ProtoBuf.Reflect = (function(ProtoBuf) {
|
32273 | "use strict";
|
32274 |
|
32275 | |
32276 |
|
32277 |
|
32278 |
|
32279 |
|
32280 | var Reflect = {};
|
32281 |
|
32282 | |
32283 |
|
32284 |
|
32285 |
|
32286 |
|
32287 |
|
32288 |
|
32289 |
|
32290 |
|
32291 | var T = function(builder, parent, name) {
|
32292 |
|
32293 | |
32294 |
|
32295 |
|
32296 |
|
32297 |
|
32298 | this.builder = builder;
|
32299 |
|
32300 | |
32301 |
|
32302 |
|
32303 |
|
32304 |
|
32305 | this.parent = parent;
|
32306 |
|
32307 | |
32308 |
|
32309 |
|
32310 |
|
32311 |
|
32312 | this.name = name;
|
32313 |
|
32314 | |
32315 |
|
32316 |
|
32317 |
|
32318 |
|
32319 | this.className;
|
32320 | };
|
32321 |
|
32322 | |
32323 |
|
32324 |
|
32325 |
|
32326 | var TPrototype = T.prototype;
|
32327 |
|
32328 | |
32329 |
|
32330 |
|
32331 |
|
32332 |
|
32333 | TPrototype.fqn = function() {
|
32334 | var name = this.name,
|
32335 | ptr = this;
|
32336 | do {
|
32337 | ptr = ptr.parent;
|
32338 | if (ptr == null)
|
32339 | break;
|
32340 | name = ptr.name+"."+name;
|
32341 | } while (true);
|
32342 | return name;
|
32343 | };
|
32344 |
|
32345 | |
32346 |
|
32347 |
|
32348 |
|
32349 |
|
32350 |
|
32351 | TPrototype.toString = function(includeClass) {
|
32352 | return (includeClass ? this.className + " " : "") + this.fqn();
|
32353 | };
|
32354 |
|
32355 | |
32356 |
|
32357 |
|
32358 |
|
32359 |
|
32360 | TPrototype.build = function() {
|
32361 | throw Error(this.toString(true)+" cannot be built directly");
|
32362 | };
|
32363 |
|
32364 | |
32365 |
|
32366 |
|
32367 |
|
32368 | Reflect.T = T;
|
32369 |
|
32370 | |
32371 |
|
32372 |
|
32373 |
|
32374 |
|
32375 |
|
32376 |
|
32377 |
|
32378 |
|
32379 |
|
32380 |
|
32381 | var Namespace = function(builder, parent, name, options, syntax) {
|
32382 | T.call(this, builder, parent, name);
|
32383 |
|
32384 | |
32385 |
|
32386 |
|
32387 | this.className = "Namespace";
|
32388 |
|
32389 | |
32390 |
|
32391 |
|
32392 |
|
32393 | this.children = [];
|
32394 |
|
32395 | |
32396 |
|
32397 |
|
32398 |
|
32399 | this.options = options || {};
|
32400 |
|
32401 | |
32402 |
|
32403 |
|
32404 |
|
32405 | this.syntax = syntax || "proto2";
|
32406 | };
|
32407 |
|
32408 | |
32409 |
|
32410 |
|
32411 |
|
32412 | var NamespacePrototype = Namespace.prototype = Object.create(T.prototype);
|
32413 |
|
32414 | |
32415 |
|
32416 |
|
32417 |
|
32418 |
|
32419 |
|
32420 | NamespacePrototype.getChildren = function(type) {
|
32421 | type = type || null;
|
32422 | if (type == null)
|
32423 | return this.children.slice();
|
32424 | var children = [];
|
32425 | for (var i=0, k=this.children.length; i<k; ++i)
|
32426 | if (this.children[i] instanceof type)
|
32427 | children.push(this.children[i]);
|
32428 | return children;
|
32429 | };
|
32430 |
|
32431 | |
32432 |
|
32433 |
|
32434 |
|
32435 |
|
32436 |
|
32437 | NamespacePrototype.addChild = function(child) {
|
32438 | var other;
|
32439 | if (other = this.getChild(child.name)) {
|
32440 |
|
32441 | if (other instanceof Message.Field && other.name !== other.originalName && this.getChild(other.originalName) === null)
|
32442 | other.name = other.originalName;
|
32443 | else if (child instanceof Message.Field && child.name !== child.originalName && this.getChild(child.originalName) === null)
|
32444 | child.name = child.originalName;
|
32445 | else
|
32446 | throw Error("Duplicate name in namespace "+this.toString(true)+": "+child.name);
|
32447 | }
|
32448 | this.children.push(child);
|
32449 | };
|
32450 |
|
32451 | |
32452 |
|
32453 |
|
32454 |
|
32455 |
|
32456 |
|
32457 | NamespacePrototype.getChild = function(nameOrId) {
|
32458 | var key = typeof nameOrId === 'number' ? 'id' : 'name';
|
32459 | for (var i=0, k=this.children.length; i<k; ++i)
|
32460 | if (this.children[i][key] === nameOrId)
|
32461 | return this.children[i];
|
32462 | return null;
|
32463 | };
|
32464 |
|
32465 | |
32466 |
|
32467 |
|
32468 |
|
32469 |
|
32470 |
|
32471 |
|
32472 | NamespacePrototype.resolve = function(qn, excludeNonNamespace) {
|
32473 | var part = typeof qn === 'string' ? qn.split(".") : qn,
|
32474 | ptr = this,
|
32475 | i = 0;
|
32476 | if (part[i] === "") {
|
32477 | while (ptr.parent !== null)
|
32478 | ptr = ptr.parent;
|
32479 | i++;
|
32480 | }
|
32481 | var child;
|
32482 | do {
|
32483 | do {
|
32484 | if (!(ptr instanceof Reflect.Namespace)) {
|
32485 | ptr = null;
|
32486 | break;
|
32487 | }
|
32488 | child = ptr.getChild(part[i]);
|
32489 | if (!child || !(child instanceof Reflect.T) || (excludeNonNamespace && !(child instanceof Reflect.Namespace))) {
|
32490 | ptr = null;
|
32491 | break;
|
32492 | }
|
32493 | ptr = child; i++;
|
32494 | } while (i < part.length);
|
32495 | if (ptr != null)
|
32496 | break;
|
32497 |
|
32498 | if (this.parent !== null)
|
32499 | return this.parent.resolve(qn, excludeNonNamespace);
|
32500 | } while (ptr != null);
|
32501 | return ptr;
|
32502 | };
|
32503 |
|
32504 | |
32505 |
|
32506 |
|
32507 |
|
32508 |
|
32509 |
|
32510 | NamespacePrototype.qn = function(t) {
|
32511 | var part = [], ptr = t;
|
32512 | do {
|
32513 | part.unshift(ptr.name);
|
32514 | ptr = ptr.parent;
|
32515 | } while (ptr !== null);
|
32516 | for (var len=1; len <= part.length; len++) {
|
32517 | var qn = part.slice(part.length-len);
|
32518 | if (t === this.resolve(qn, t instanceof Reflect.Namespace))
|
32519 | return qn.join(".");
|
32520 | }
|
32521 | return t.fqn();
|
32522 | };
|
32523 |
|
32524 | |
32525 |
|
32526 |
|
32527 |
|
32528 |
|
32529 | NamespacePrototype.build = function() {
|
32530 |
|
32531 | var ns = {};
|
32532 | var children = this.children;
|
32533 | for (var i=0, k=children.length, child; i<k; ++i) {
|
32534 | child = children[i];
|
32535 | if (child instanceof Namespace)
|
32536 | ns[child.name] = child.build();
|
32537 | }
|
32538 | if (Object.defineProperty)
|
32539 | Object.defineProperty(ns, "$options", { "value": this.buildOpt() });
|
32540 | return ns;
|
32541 | };
|
32542 |
|
32543 | |
32544 |
|
32545 |
|
32546 |
|
32547 | NamespacePrototype.buildOpt = function() {
|
32548 | var opt = {},
|
32549 | keys = Object.keys(this.options);
|
32550 | for (var i=0, k=keys.length; i<k; ++i) {
|
32551 | var key = keys[i],
|
32552 | val = this.options[keys[i]];
|
32553 |
|
32554 |
|
32555 |
|
32556 |
|
32557 | opt[key] = val;
|
32558 |
|
32559 | }
|
32560 | return opt;
|
32561 | };
|
32562 |
|
32563 | |
32564 |
|
32565 |
|
32566 |
|
32567 |
|
32568 | NamespacePrototype.getOption = function(name) {
|
32569 | if (typeof name === 'undefined')
|
32570 | return this.options;
|
32571 | return typeof this.options[name] !== 'undefined' ? this.options[name] : null;
|
32572 | };
|
32573 |
|
32574 | |
32575 |
|
32576 |
|
32577 |
|
32578 | Reflect.Namespace = Namespace;
|
32579 |
|
32580 | |
32581 |
|
32582 |
|
32583 |
|
32584 |
|
32585 |
|
32586 |
|
32587 |
|
32588 |
|
32589 |
|
32590 |
|
32591 |
|
32592 |
|
32593 |
|
32594 |
|
32595 |
|
32596 |
|
32597 |
|
32598 |
|
32599 |
|
32600 |
|
32601 | var Element = function(type, resolvedType, isMapKey, syntax, name) {
|
32602 |
|
32603 | |
32604 |
|
32605 |
|
32606 |
|
32607 | this.type = type;
|
32608 |
|
32609 | |
32610 |
|
32611 |
|
32612 |
|
32613 | this.resolvedType = resolvedType;
|
32614 |
|
32615 | |
32616 |
|
32617 |
|
32618 |
|
32619 | this.isMapKey = isMapKey;
|
32620 |
|
32621 | |
32622 |
|
32623 |
|
32624 |
|
32625 | this.syntax = syntax;
|
32626 |
|
32627 | |
32628 |
|
32629 |
|
32630 |
|
32631 | this.name = name;
|
32632 |
|
32633 | if (isMapKey && ProtoBuf.MAP_KEY_TYPES.indexOf(type) < 0)
|
32634 | throw Error("Invalid map key type: " + type.name);
|
32635 | };
|
32636 |
|
32637 | var ElementPrototype = Element.prototype;
|
32638 |
|
32639 | |
32640 |
|
32641 |
|
32642 |
|
32643 |
|
32644 |
|
32645 | function mkDefault(type) {
|
32646 | if (typeof type === 'string')
|
32647 | type = ProtoBuf.TYPES[type];
|
32648 | if (typeof type.defaultValue === 'undefined')
|
32649 | throw Error("default value for type "+type.name+" is not supported");
|
32650 | if (type == ProtoBuf.TYPES["bytes"])
|
32651 | return new ByteBuffer(0);
|
32652 | return type.defaultValue;
|
32653 | }
|
32654 |
|
32655 | |
32656 |
|
32657 |
|
32658 |
|
32659 |
|
32660 |
|
32661 | Element.defaultFieldValue = mkDefault;
|
32662 |
|
32663 | |
32664 |
|
32665 |
|
32666 |
|
32667 |
|
32668 |
|
32669 |
|
32670 |
|
32671 |
|
32672 | function mkLong(value, unsigned) {
|
32673 | if (value && typeof value.low === 'number' && typeof value.high === 'number' && typeof value.unsigned === 'boolean'
|
32674 | && value.low === value.low && value.high === value.high)
|
32675 | return new ProtoBuf.Long(value.low, value.high, typeof unsigned === 'undefined' ? value.unsigned : unsigned);
|
32676 | if (typeof value === 'string')
|
32677 | return ProtoBuf.Long.fromString(value, unsigned || false, 10);
|
32678 | if (typeof value === 'number')
|
32679 | return ProtoBuf.Long.fromNumber(value, unsigned || false);
|
32680 | throw Error("not convertible to Long");
|
32681 | }
|
32682 |
|
32683 | ElementPrototype.toString = function() {
|
32684 | return (this.name || '') + (this.isMapKey ? 'map' : 'value') + ' element';
|
32685 | }
|
32686 |
|
32687 | |
32688 |
|
32689 |
|
32690 |
|
32691 |
|
32692 |
|
32693 |
|
32694 |
|
32695 | ElementPrototype.verifyValue = function(value) {
|
32696 | var self = this;
|
32697 | function fail(val, msg) {
|
32698 | throw Error("Illegal value for "+self.toString(true)+" of type "+self.type.name+": "+val+" ("+msg+")");
|
32699 | }
|
32700 | switch (this.type) {
|
32701 |
|
32702 | case ProtoBuf.TYPES["int32"]:
|
32703 | case ProtoBuf.TYPES["sint32"]:
|
32704 | case ProtoBuf.TYPES["sfixed32"]:
|
32705 |
|
32706 | if (typeof value !== 'number' || (value === value && value % 1 !== 0))
|
32707 | fail(typeof value, "not an integer");
|
32708 | return value > 4294967295 ? value | 0 : value;
|
32709 |
|
32710 |
|
32711 | case ProtoBuf.TYPES["uint32"]:
|
32712 | case ProtoBuf.TYPES["fixed32"]:
|
32713 | if (typeof value !== 'number' || (value === value && value % 1 !== 0))
|
32714 | fail(typeof value, "not an integer");
|
32715 | return value < 0 ? value >>> 0 : value;
|
32716 |
|
32717 |
|
32718 | case ProtoBuf.TYPES["int64"]:
|
32719 | case ProtoBuf.TYPES["sint64"]:
|
32720 | case ProtoBuf.TYPES["sfixed64"]: {
|
32721 | if (ProtoBuf.Long)
|
32722 | try {
|
32723 | return mkLong(value, false);
|
32724 | } catch (e) {
|
32725 | fail(typeof value, e.message);
|
32726 | }
|
32727 | else
|
32728 | fail(typeof value, "requires Long.js");
|
32729 | }
|
32730 |
|
32731 |
|
32732 | case ProtoBuf.TYPES["uint64"]:
|
32733 | case ProtoBuf.TYPES["fixed64"]: {
|
32734 | if (ProtoBuf.Long)
|
32735 | try {
|
32736 | return mkLong(value, true);
|
32737 | } catch (e) {
|
32738 | fail(typeof value, e.message);
|
32739 | }
|
32740 | else
|
32741 | fail(typeof value, "requires Long.js");
|
32742 | }
|
32743 |
|
32744 |
|
32745 | case ProtoBuf.TYPES["bool"]:
|
32746 | if (typeof value !== 'boolean')
|
32747 | fail(typeof value, "not a boolean");
|
32748 | return value;
|
32749 |
|
32750 |
|
32751 | case ProtoBuf.TYPES["float"]:
|
32752 | case ProtoBuf.TYPES["double"]:
|
32753 | if (typeof value !== 'number')
|
32754 | fail(typeof value, "not a number");
|
32755 | return value;
|
32756 |
|
32757 |
|
32758 | case ProtoBuf.TYPES["string"]:
|
32759 | if (typeof value !== 'string' && !(value && value instanceof String))
|
32760 | fail(typeof value, "not a string");
|
32761 | return ""+value;
|
32762 |
|
32763 |
|
32764 | case ProtoBuf.TYPES["bytes"]:
|
32765 | if (ByteBuffer.isByteBuffer(value))
|
32766 | return value;
|
32767 | return ByteBuffer.wrap(value, "base64");
|
32768 |
|
32769 |
|
32770 | case ProtoBuf.TYPES["enum"]: {
|
32771 | var values = this.resolvedType.getChildren(ProtoBuf.Reflect.Enum.Value);
|
32772 | for (i=0; i<values.length; i++)
|
32773 | if (values[i].name == value)
|
32774 | return values[i].id;
|
32775 | else if (values[i].id == value)
|
32776 | return values[i].id;
|
32777 |
|
32778 | if (this.syntax === 'proto3') {
|
32779 |
|
32780 | if (typeof value !== 'number' || (value === value && value % 1 !== 0))
|
32781 | fail(typeof value, "not an integer");
|
32782 | if (value > 4294967295 || value < 0)
|
32783 | fail(typeof value, "not in range for uint32")
|
32784 | return value;
|
32785 | } else {
|
32786 |
|
32787 | fail(value, "not a valid enum value");
|
32788 | }
|
32789 | }
|
32790 |
|
32791 | case ProtoBuf.TYPES["group"]:
|
32792 | case ProtoBuf.TYPES["message"]: {
|
32793 | if (!value || typeof value !== 'object')
|
32794 | fail(typeof value, "object expected");
|
32795 | if (value instanceof this.resolvedType.clazz)
|
32796 | return value;
|
32797 | if (value instanceof ProtoBuf.Builder.Message) {
|
32798 |
|
32799 | var obj = {};
|
32800 | for (var i in value)
|
32801 | if (value.hasOwnProperty(i))
|
32802 | obj[i] = value[i];
|
32803 | value = obj;
|
32804 | }
|
32805 |
|
32806 | return new (this.resolvedType.clazz)(value);
|
32807 | }
|
32808 | }
|
32809 |
|
32810 |
|
32811 | throw Error("[INTERNAL] Illegal value for "+this.toString(true)+": "+value+" (undefined type "+this.type+")");
|
32812 | };
|
32813 |
|
32814 | |
32815 |
|
32816 |
|
32817 |
|
32818 |
|
32819 |
|
32820 |
|
32821 |
|
32822 | ElementPrototype.calculateLength = function(id, value) {
|
32823 | if (value === null) return 0;
|
32824 |
|
32825 | var n;
|
32826 | switch (this.type) {
|
32827 | case ProtoBuf.TYPES["int32"]:
|
32828 | return value < 0 ? ByteBuffer.calculateVarint64(value) : ByteBuffer.calculateVarint32(value);
|
32829 | case ProtoBuf.TYPES["uint32"]:
|
32830 | return ByteBuffer.calculateVarint32(value);
|
32831 | case ProtoBuf.TYPES["sint32"]:
|
32832 | return ByteBuffer.calculateVarint32(ByteBuffer.zigZagEncode32(value));
|
32833 | case ProtoBuf.TYPES["fixed32"]:
|
32834 | case ProtoBuf.TYPES["sfixed32"]:
|
32835 | case ProtoBuf.TYPES["float"]:
|
32836 | return 4;
|
32837 | case ProtoBuf.TYPES["int64"]:
|
32838 | case ProtoBuf.TYPES["uint64"]:
|
32839 | return ByteBuffer.calculateVarint64(value);
|
32840 | case ProtoBuf.TYPES["sint64"]:
|
32841 | return ByteBuffer.calculateVarint64(ByteBuffer.zigZagEncode64(value));
|
32842 | case ProtoBuf.TYPES["fixed64"]:
|
32843 | case ProtoBuf.TYPES["sfixed64"]:
|
32844 | return 8;
|
32845 | case ProtoBuf.TYPES["bool"]:
|
32846 | return 1;
|
32847 | case ProtoBuf.TYPES["enum"]:
|
32848 | return ByteBuffer.calculateVarint32(value);
|
32849 | case ProtoBuf.TYPES["double"]:
|
32850 | return 8;
|
32851 | case ProtoBuf.TYPES["string"]:
|
32852 | n = ByteBuffer.calculateUTF8Bytes(value);
|
32853 | return ByteBuffer.calculateVarint32(n) + n;
|
32854 | case ProtoBuf.TYPES["bytes"]:
|
32855 | if (value.remaining() < 0)
|
32856 | throw Error("Illegal value for "+this.toString(true)+": "+value.remaining()+" bytes remaining");
|
32857 | return ByteBuffer.calculateVarint32(value.remaining()) + value.remaining();
|
32858 | case ProtoBuf.TYPES["message"]:
|
32859 | n = this.resolvedType.calculate(value);
|
32860 | return ByteBuffer.calculateVarint32(n) + n;
|
32861 | case ProtoBuf.TYPES["group"]:
|
32862 | n = this.resolvedType.calculate(value);
|
32863 | return n + ByteBuffer.calculateVarint32((id << 3) | ProtoBuf.WIRE_TYPES.ENDGROUP);
|
32864 | }
|
32865 |
|
32866 | throw Error("[INTERNAL] Illegal value to encode in "+this.toString(true)+": "+value+" (unknown type)");
|
32867 | };
|
32868 |
|
32869 | |
32870 |
|
32871 |
|
32872 |
|
32873 |
|
32874 |
|
32875 |
|
32876 |
|
32877 |
|
32878 | ElementPrototype.encodeValue = function(id, value, buffer) {
|
32879 | if (value === null) return buffer;
|
32880 |
|
32881 |
|
32882 | switch (this.type) {
|
32883 |
|
32884 | case ProtoBuf.TYPES["int32"]:
|
32885 |
|
32886 |
|
32887 | if (value < 0)
|
32888 | buffer.writeVarint64(value);
|
32889 | else
|
32890 | buffer.writeVarint32(value);
|
32891 | break;
|
32892 |
|
32893 |
|
32894 | case ProtoBuf.TYPES["uint32"]:
|
32895 | buffer.writeVarint32(value);
|
32896 | break;
|
32897 |
|
32898 |
|
32899 | case ProtoBuf.TYPES["sint32"]:
|
32900 | buffer.writeVarint32ZigZag(value);
|
32901 | break;
|
32902 |
|
32903 |
|
32904 | case ProtoBuf.TYPES["fixed32"]:
|
32905 | buffer.writeUint32(value);
|
32906 | break;
|
32907 |
|
32908 |
|
32909 | case ProtoBuf.TYPES["sfixed32"]:
|
32910 | buffer.writeInt32(value);
|
32911 | break;
|
32912 |
|
32913 |
|
32914 | case ProtoBuf.TYPES["int64"]:
|
32915 | case ProtoBuf.TYPES["uint64"]:
|
32916 | buffer.writeVarint64(value);
|
32917 | break;
|
32918 |
|
32919 |
|
32920 | case ProtoBuf.TYPES["sint64"]:
|
32921 | buffer.writeVarint64ZigZag(value);
|
32922 | break;
|
32923 |
|
32924 |
|
32925 | case ProtoBuf.TYPES["fixed64"]:
|
32926 | buffer.writeUint64(value);
|
32927 | break;
|
32928 |
|
32929 |
|
32930 | case ProtoBuf.TYPES["sfixed64"]:
|
32931 | buffer.writeInt64(value);
|
32932 | break;
|
32933 |
|
32934 |
|
32935 | case ProtoBuf.TYPES["bool"]:
|
32936 | if (typeof value === 'string')
|
32937 | buffer.writeVarint32(value.toLowerCase() === 'false' ? 0 : !!value);
|
32938 | else
|
32939 | buffer.writeVarint32(value ? 1 : 0);
|
32940 | break;
|
32941 |
|
32942 |
|
32943 | case ProtoBuf.TYPES["enum"]:
|
32944 | buffer.writeVarint32(value);
|
32945 | break;
|
32946 |
|
32947 |
|
32948 | case ProtoBuf.TYPES["float"]:
|
32949 | buffer.writeFloat32(value);
|
32950 | break;
|
32951 |
|
32952 |
|
32953 | case ProtoBuf.TYPES["double"]:
|
32954 | buffer.writeFloat64(value);
|
32955 | break;
|
32956 |
|
32957 |
|
32958 | case ProtoBuf.TYPES["string"]:
|
32959 | buffer.writeVString(value);
|
32960 | break;
|
32961 |
|
32962 |
|
32963 | case ProtoBuf.TYPES["bytes"]:
|
32964 | if (value.remaining() < 0)
|
32965 | throw Error("Illegal value for "+this.toString(true)+": "+value.remaining()+" bytes remaining");
|
32966 | var prevOffset = value.offset;
|
32967 | buffer.writeVarint32(value.remaining());
|
32968 | buffer.append(value);
|
32969 | value.offset = prevOffset;
|
32970 | break;
|
32971 |
|
32972 |
|
32973 | case ProtoBuf.TYPES["message"]:
|
32974 | var bb = new ByteBuffer().LE();
|
32975 | this.resolvedType.encode(value, bb);
|
32976 | buffer.writeVarint32(bb.offset);
|
32977 | buffer.append(bb.flip());
|
32978 | break;
|
32979 |
|
32980 |
|
32981 | case ProtoBuf.TYPES["group"]:
|
32982 | this.resolvedType.encode(value, buffer);
|
32983 | buffer.writeVarint32((id << 3) | ProtoBuf.WIRE_TYPES.ENDGROUP);
|
32984 | break;
|
32985 |
|
32986 | default:
|
32987 |
|
32988 | throw Error("[INTERNAL] Illegal value to encode in "+this.toString(true)+": "+value+" (unknown type)");
|
32989 | }
|
32990 | return buffer;
|
32991 | };
|
32992 |
|
32993 | |
32994 |
|
32995 |
|
32996 |
|
32997 |
|
32998 |
|
32999 |
|
33000 |
|
33001 |
|
33002 | ElementPrototype.decode = function(buffer, wireType, id) {
|
33003 | if (wireType != this.type.wireType)
|
33004 | throw Error("Unexpected wire type for element");
|
33005 |
|
33006 | var value, nBytes;
|
33007 | switch (this.type) {
|
33008 |
|
33009 | case ProtoBuf.TYPES["int32"]:
|
33010 | return buffer.readVarint32() | 0;
|
33011 |
|
33012 |
|
33013 | case ProtoBuf.TYPES["uint32"]:
|
33014 | return buffer.readVarint32() >>> 0;
|
33015 |
|
33016 |
|
33017 | case ProtoBuf.TYPES["sint32"]:
|
33018 | return buffer.readVarint32ZigZag() | 0;
|
33019 |
|
33020 |
|
33021 | case ProtoBuf.TYPES["fixed32"]:
|
33022 | return buffer.readUint32() >>> 0;
|
33023 |
|
33024 | case ProtoBuf.TYPES["sfixed32"]:
|
33025 | return buffer.readInt32() | 0;
|
33026 |
|
33027 |
|
33028 | case ProtoBuf.TYPES["int64"]:
|
33029 | return buffer.readVarint64();
|
33030 |
|
33031 |
|
33032 | case ProtoBuf.TYPES["uint64"]:
|
33033 | return buffer.readVarint64().toUnsigned();
|
33034 |
|
33035 |
|
33036 | case ProtoBuf.TYPES["sint64"]:
|
33037 | return buffer.readVarint64ZigZag();
|
33038 |
|
33039 |
|
33040 | case ProtoBuf.TYPES["fixed64"]:
|
33041 | return buffer.readUint64();
|
33042 |
|
33043 |
|
33044 | case ProtoBuf.TYPES["sfixed64"]:
|
33045 | return buffer.readInt64();
|
33046 |
|
33047 |
|
33048 | case ProtoBuf.TYPES["bool"]:
|
33049 | return !!buffer.readVarint32();
|
33050 |
|
33051 |
|
33052 | case ProtoBuf.TYPES["enum"]:
|
33053 |
|
33054 | return buffer.readVarint32();
|
33055 |
|
33056 |
|
33057 | case ProtoBuf.TYPES["float"]:
|
33058 | return buffer.readFloat();
|
33059 |
|
33060 |
|
33061 | case ProtoBuf.TYPES["double"]:
|
33062 | return buffer.readDouble();
|
33063 |
|
33064 |
|
33065 | case ProtoBuf.TYPES["string"]:
|
33066 | return buffer.readVString();
|
33067 |
|
33068 |
|
33069 | case ProtoBuf.TYPES["bytes"]: {
|
33070 | nBytes = buffer.readVarint32();
|
33071 | if (buffer.remaining() < nBytes)
|
33072 | throw Error("Illegal number of bytes for "+this.toString(true)+": "+nBytes+" required but got only "+buffer.remaining());
|
33073 | value = buffer.clone();
|
33074 | value.limit = value.offset+nBytes;
|
33075 | buffer.offset += nBytes;
|
33076 | return value;
|
33077 | }
|
33078 |
|
33079 |
|
33080 | case ProtoBuf.TYPES["message"]: {
|
33081 | nBytes = buffer.readVarint32();
|
33082 | return this.resolvedType.decode(buffer, nBytes);
|
33083 | }
|
33084 |
|
33085 |
|
33086 | case ProtoBuf.TYPES["group"]:
|
33087 | return this.resolvedType.decode(buffer, -1, id);
|
33088 | }
|
33089 |
|
33090 |
|
33091 | throw Error("[INTERNAL] Illegal decode type");
|
33092 | };
|
33093 |
|
33094 | |
33095 |
|
33096 |
|
33097 |
|
33098 |
|
33099 |
|
33100 |
|
33101 |
|
33102 | ElementPrototype.valueFromString = function(str) {
|
33103 | if (!this.isMapKey) {
|
33104 | throw Error("valueFromString() called on non-map-key element");
|
33105 | }
|
33106 |
|
33107 | switch (this.type) {
|
33108 | case ProtoBuf.TYPES["int32"]:
|
33109 | case ProtoBuf.TYPES["sint32"]:
|
33110 | case ProtoBuf.TYPES["sfixed32"]:
|
33111 | case ProtoBuf.TYPES["uint32"]:
|
33112 | case ProtoBuf.TYPES["fixed32"]:
|
33113 | return this.verifyValue(parseInt(str));
|
33114 |
|
33115 | case ProtoBuf.TYPES["int64"]:
|
33116 | case ProtoBuf.TYPES["sint64"]:
|
33117 | case ProtoBuf.TYPES["sfixed64"]:
|
33118 | case ProtoBuf.TYPES["uint64"]:
|
33119 | case ProtoBuf.TYPES["fixed64"]:
|
33120 |
|
33121 | return this.verifyValue(str);
|
33122 |
|
33123 | case ProtoBuf.TYPES["bool"]:
|
33124 | return str === "true";
|
33125 |
|
33126 | case ProtoBuf.TYPES["string"]:
|
33127 | return this.verifyValue(str);
|
33128 |
|
33129 | case ProtoBuf.TYPES["bytes"]:
|
33130 | return ByteBuffer.fromBinary(str);
|
33131 | }
|
33132 | };
|
33133 |
|
33134 | |
33135 |
|
33136 |
|
33137 |
|
33138 |
|
33139 |
|
33140 |
|
33141 |
|
33142 |
|
33143 |
|
33144 |
|
33145 |
|
33146 |
|
33147 |
|
33148 |
|
33149 | ElementPrototype.valueToString = function(value) {
|
33150 | if (!this.isMapKey) {
|
33151 | throw Error("valueToString() called on non-map-key element");
|
33152 | }
|
33153 |
|
33154 | if (this.type === ProtoBuf.TYPES["bytes"]) {
|
33155 | return value.toString("binary");
|
33156 | } else {
|
33157 | return value.toString();
|
33158 | }
|
33159 | };
|
33160 |
|
33161 | |
33162 |
|
33163 |
|
33164 |
|
33165 | Reflect.Element = Element;
|
33166 |
|
33167 | |
33168 |
|
33169 |
|
33170 |
|
33171 |
|
33172 |
|
33173 |
|
33174 |
|
33175 |
|
33176 |
|
33177 |
|
33178 |
|
33179 | var Message = function(builder, parent, name, options, isGroup, syntax) {
|
33180 | Namespace.call(this, builder, parent, name, options, syntax);
|
33181 |
|
33182 | |
33183 |
|
33184 |
|
33185 | this.className = "Message";
|
33186 |
|
33187 | |
33188 |
|
33189 |
|
33190 |
|
33191 |
|
33192 | this.extensions = undefined;
|
33193 |
|
33194 | |
33195 |
|
33196 |
|
33197 |
|
33198 |
|
33199 | this.clazz = null;
|
33200 |
|
33201 | |
33202 |
|
33203 |
|
33204 |
|
33205 |
|
33206 | this.isGroup = !!isGroup;
|
33207 |
|
33208 |
|
33209 |
|
33210 | |
33211 |
|
33212 |
|
33213 |
|
33214 |
|
33215 | this._fields = null;
|
33216 |
|
33217 | |
33218 |
|
33219 |
|
33220 |
|
33221 |
|
33222 | this._fieldsById = null;
|
33223 |
|
33224 | |
33225 |
|
33226 |
|
33227 |
|
33228 |
|
33229 | this._fieldsByName = null;
|
33230 | };
|
33231 |
|
33232 | |
33233 |
|
33234 |
|
33235 |
|
33236 | var MessagePrototype = Message.prototype = Object.create(Namespace.prototype);
|
33237 |
|
33238 | |
33239 |
|
33240 |
|
33241 |
|
33242 |
|
33243 |
|
33244 |
|
33245 |
|
33246 | MessagePrototype.build = function(rebuild) {
|
33247 | if (this.clazz && !rebuild)
|
33248 | return this.clazz;
|
33249 |
|
33250 |
|
33251 | var clazz = (function(ProtoBuf, T) {
|
33252 |
|
33253 | var fields = T.getChildren(ProtoBuf.Reflect.Message.Field),
|
33254 | oneofs = T.getChildren(ProtoBuf.Reflect.Message.OneOf);
|
33255 |
|
33256 | |
33257 |
|
33258 |
|
33259 |
|
33260 |
|
33261 |
|
33262 |
|
33263 |
|
33264 |
|
33265 | var Message = function(values, var_args) {
|
33266 | ProtoBuf.Builder.Message.call(this);
|
33267 |
|
33268 |
|
33269 | for (var i=0, k=oneofs.length; i<k; ++i)
|
33270 | this[oneofs[i].name] = null;
|
33271 |
|
33272 | for (i=0, k=fields.length; i<k; ++i) {
|
33273 | var field = fields[i];
|
33274 | this[field.name] =
|
33275 | field.repeated ? [] :
|
33276 | (field.map ? new ProtoBuf.Map(field) : null);
|
33277 | if ((field.required || T.syntax === 'proto3') &&
|
33278 | field.defaultValue !== null)
|
33279 | this[field.name] = field.defaultValue;
|
33280 | }
|
33281 |
|
33282 | if (arguments.length > 0) {
|
33283 | var value;
|
33284 |
|
33285 | if (arguments.length === 1 && values !== null && typeof values === 'object' &&
|
33286 | (typeof values.encode !== 'function' || values instanceof Message) &&
|
33287 | !Array.isArray(values) &&
|
33288 | !(values instanceof ProtoBuf.Map) &&
|
33289 | !ByteBuffer.isByteBuffer(values) &&
|
33290 | !(values instanceof ArrayBuffer) &&
|
33291 | !(ProtoBuf.Long && values instanceof ProtoBuf.Long)) {
|
33292 | this.$set(values);
|
33293 | } else // Set field values from arguments, in declaration order
|
33294 | for (i=0, k=arguments.length; i<k; ++i)
|
33295 | if (typeof (value = arguments[i]) !== 'undefined')
|
33296 | this.$set(fields[i].name, value); // May throw
|
33297 | }
|
33298 | };
|
33299 |
|
33300 | /**
|
33301 | * @alias ProtoBuf.Builder.Message.prototype
|
33302 | * @inner
|
33303 | */
|
33304 | var MessagePrototype = Message.prototype = Object.create(ProtoBuf.Builder.Message.prototype);
|
33305 |
|
33306 | /**
|
33307 | * Adds a value to a repeated field.
|
33308 | * @name ProtoBuf.Builder.Message#add
|
33309 | * @function
|
33310 | * @param {string} key Field name
|
33311 | * @param {*} value Value to add
|
33312 | * @param {boolean=} noAssert Whether to assert the value or not (asserts by default)
|
33313 | * @returns {!ProtoBuf.Builder.Message} this
|
33314 | * @throws {Error} If the value cannot be added
|
33315 | * @expose
|
33316 | */
|
33317 | MessagePrototype.add = function(key, value, noAssert) {
|
33318 | var field = T._fieldsByName[key];
|
33319 | if (!noAssert) {
|
33320 | if (!field)
|
33321 | throw Error(this+"#"+key+" is undefined");
|
33322 | if (!(field instanceof ProtoBuf.Reflect.Message.Field))
|
33323 | throw Error(this+"#"+key+" is not a field: "+field.toString(true));
|
33324 | if (!field.repeated)
|
33325 | throw Error(this+"#"+key+" is not a repeated field");
|
33326 | value = field.verifyValue(value, true);
|
33327 | }
|
33328 | if (this[key] === null)
|
33329 | this[key] = [];
|
33330 | this[key].push(value);
|
33331 | return this;
|
33332 | };
|
33333 |
|
33334 | |
33335 |
|
33336 |
|
33337 |
|
33338 |
|
33339 |
|
33340 |
|
33341 |
|
33342 |
|
33343 |
|
33344 |
|
33345 | MessagePrototype.$add = MessagePrototype.add;
|
33346 |
|
33347 | |
33348 |
|
33349 |
|
33350 |
|
33351 |
|
33352 |
|
33353 |
|
33354 |
|
33355 |
|
33356 |
|
33357 |
|
33358 | MessagePrototype.set = function(keyOrObj, value, noAssert) {
|
33359 | if (keyOrObj && typeof keyOrObj === 'object') {
|
33360 | noAssert = value;
|
33361 | for (var ikey in keyOrObj) {
|
33362 |
|
33363 | if (keyOrObj.hasOwnProperty(ikey) && typeof (value = keyOrObj[ikey]) !== 'undefined' && T._oneofsByName[ikey] === undefined)
|
33364 | this.$set(ikey, value, noAssert);
|
33365 | }
|
33366 | return this;
|
33367 | }
|
33368 | var field = T._fieldsByName[keyOrObj];
|
33369 | if (!noAssert) {
|
33370 | if (!field)
|
33371 | throw Error(this+"#"+keyOrObj+" is not a field: undefined");
|
33372 | if (!(field instanceof ProtoBuf.Reflect.Message.Field))
|
33373 | throw Error(this+"#"+keyOrObj+" is not a field: "+field.toString(true));
|
33374 | this[field.name] = (value = field.verifyValue(value));
|
33375 | } else
|
33376 | this[keyOrObj] = value;
|
33377 | if (field && field.oneof) {
|
33378 | var currentField = this[field.oneof.name];
|
33379 | if (value !== null) {
|
33380 | if (currentField !== null && currentField !== field.name)
|
33381 | this[currentField] = null;
|
33382 | this[field.oneof.name] = field.name;
|
33383 | } else if (currentField === keyOrObj)
|
33384 | this[field.oneof.name] = null;
|
33385 | }
|
33386 | return this;
|
33387 | };
|
33388 |
|
33389 | |
33390 |
|
33391 |
|
33392 |
|
33393 |
|
33394 |
|
33395 |
|
33396 |
|
33397 |
|
33398 |
|
33399 | MessagePrototype.$set = MessagePrototype.set;
|
33400 |
|
33401 | /**
|
33402 | * Gets a field's value.
|
33403 | * @name ProtoBuf.Builder.Message#get
|
33404 | * @function
|
33405 | * @param {string} key Key
|
33406 | * @param {boolean=} noAssert Whether to not assert for an actual field, defaults to `false`
|
33407 | * @return {*} Value
|
33408 | * @throws {Error} If there is no such field
|
33409 | * @expose
|
33410 | */
|
33411 | MessagePrototype.get = function(key, noAssert) {
|
33412 | if (noAssert)
|
33413 | return this[key];
|
33414 | var field = T._fieldsByName[key];
|
33415 | if (!field || !(field instanceof ProtoBuf.Reflect.Message.Field))
|
33416 | throw Error(this+"#"+key+" is not a field: undefined");
|
33417 | if (!(field instanceof ProtoBuf.Reflect.Message.Field))
|
33418 | throw Error(this+"#"+key+" is not a field: "+field.toString(true));
|
33419 | return this[field.name];
|
33420 | };
|
33421 |
|
33422 | |
33423 |
|
33424 |
|
33425 |
|
33426 |
|
33427 |
|
33428 |
|
33429 |
|
33430 |
|
33431 | MessagePrototype.$get = MessagePrototype.get;
|
33432 |
|
33433 | // Getters and setters
|
33434 |
|
33435 | for (var i=0; i<fields.length; i++) {
|
33436 | var field = fields[i];
|
33437 |
|
33438 | if (field instanceof ProtoBuf.Reflect.Message.ExtensionField)
|
33439 | continue;
|
33440 |
|
33441 | if (T.builder.options['populateAccessors'])
|
33442 | (function(field) {
|
33443 |
|
33444 | var Name = field.originalName.replace(/(_[a-zA-Z])/g, function(match) {
|
33445 | return match.toUpperCase().replace('_','');
|
33446 | });
|
33447 | Name = Name.substring(0,1).toUpperCase() + Name.substring(1);
|
33448 |
|
33449 |
|
33450 | var name = field.originalName.replace(/([A-Z])/g, function(match) {
|
33451 | return "_"+match;
|
33452 | });
|
33453 |
|
33454 | |
33455 |
|
33456 |
|
33457 |
|
33458 |
|
33459 |
|
33460 |
|
33461 |
|
33462 | var setter = function(value, noAssert) {
|
33463 | this[field.name] = noAssert ? value : field.verifyValue(value);
|
33464 | return this;
|
33465 | };
|
33466 |
|
33467 | |
33468 |
|
33469 |
|
33470 |
|
33471 |
|
33472 |
|
33473 | var getter = function() {
|
33474 | return this[field.name];
|
33475 | };
|
33476 |
|
33477 | if (T.getChild("set"+Name) === null)
|
33478 | |
33479 |
|
33480 |
|
33481 |
|
33482 |
|
33483 |
|
33484 |
|
33485 |
|
33486 |
|
33487 |
|
33488 |
|
33489 | MessagePrototype["set"+Name] = setter;
|
33490 |
|
33491 | if (T.getChild("set_"+name) === null)
|
33492 | |
33493 |
|
33494 |
|
33495 |
|
33496 |
|
33497 |
|
33498 |
|
33499 |
|
33500 |
|
33501 |
|
33502 |
|
33503 | MessagePrototype["set_"+name] = setter;
|
33504 |
|
33505 | if (T.getChild("get"+Name) === null)
|
33506 | |
33507 |
|
33508 |
|
33509 |
|
33510 |
|
33511 |
|
33512 |
|
33513 |
|
33514 | MessagePrototype["get"+Name] = getter;
|
33515 |
|
33516 | if (T.getChild("get_"+name) === null)
|
33517 | |
33518 |
|
33519 |
|
33520 |
|
33521 |
|
33522 |
|
33523 |
|
33524 |
|
33525 | MessagePrototype["get_"+name] = getter;
|
33526 |
|
33527 | })(field);
|
33528 | }
|
33529 |
|
33530 |
|
33531 |
|
33532 | |
33533 |
|
33534 |
|
33535 |
|
33536 |
|
33537 |
|
33538 |
|
33539 |
|
33540 |
|
33541 |
|
33542 |
|
33543 |
|
33544 |
|
33545 |
|
33546 | MessagePrototype.encode = function(buffer, noVerify) {
|
33547 | if (typeof buffer === 'boolean')
|
33548 | noVerify = buffer,
|
33549 | buffer = undefined;
|
33550 | var isNew = false;
|
33551 | if (!buffer)
|
33552 | buffer = new ByteBuffer(),
|
33553 | isNew = true;
|
33554 | var le = buffer.littleEndian;
|
33555 | try {
|
33556 | T.encode(this, buffer.LE(), noVerify);
|
33557 | return (isNew ? buffer.flip() : buffer).LE(le);
|
33558 | } catch (e) {
|
33559 | buffer.LE(le);
|
33560 | throw(e);
|
33561 | }
|
33562 | };
|
33563 |
|
33564 | |
33565 |
|
33566 |
|
33567 |
|
33568 |
|
33569 |
|
33570 |
|
33571 |
|
33572 | Message.encode = function(data, buffer, noVerify) {
|
33573 | return new Message(data).encode(buffer, noVerify);
|
33574 | };
|
33575 |
|
33576 | |
33577 |
|
33578 |
|
33579 |
|
33580 |
|
33581 |
|
33582 |
|
33583 |
|
33584 | MessagePrototype.calculate = function() {
|
33585 | return T.calculate(this);
|
33586 | };
|
33587 |
|
33588 | |
33589 |
|
33590 |
|
33591 |
|
33592 |
|
33593 |
|
33594 |
|
33595 |
|
33596 |
|
33597 |
|
33598 |
|
33599 | MessagePrototype.encodeDelimited = function(buffer, noVerify) {
|
33600 | var isNew = false;
|
33601 | if (!buffer)
|
33602 | buffer = new ByteBuffer(),
|
33603 | isNew = true;
|
33604 | var enc = new ByteBuffer().LE();
|
33605 | T.encode(this, enc, noVerify).flip();
|
33606 | buffer.writeVarint32(enc.remaining());
|
33607 | buffer.append(enc);
|
33608 | return isNew ? buffer.flip() : buffer;
|
33609 | };
|
33610 |
|
33611 | |
33612 |
|
33613 |
|
33614 |
|
33615 |
|
33616 |
|
33617 |
|
33618 |
|
33619 |
|
33620 | MessagePrototype.encodeAB = function() {
|
33621 | try {
|
33622 | return this.encode().toArrayBuffer();
|
33623 | } catch (e) {
|
33624 | if (e["encoded"]) e["encoded"] = e["encoded"].toArrayBuffer();
|
33625 | throw(e);
|
33626 | }
|
33627 | };
|
33628 |
|
33629 | |
33630 |
|
33631 |
|
33632 |
|
33633 |
|
33634 |
|
33635 |
|
33636 |
|
33637 |
|
33638 | MessagePrototype.toArrayBuffer = MessagePrototype.encodeAB;
|
33639 |
|
33640 | |
33641 |
|
33642 |
|
33643 |
|
33644 |
|
33645 |
|
33646 |
|
33647 |
|
33648 |
|
33649 | MessagePrototype.encodeNB = function() {
|
33650 | try {
|
33651 | return this.encode().toBuffer();
|
33652 | } catch (e) {
|
33653 | if (e["encoded"]) e["encoded"] = e["encoded"].toBuffer();
|
33654 | throw(e);
|
33655 | }
|
33656 | };
|
33657 |
|
33658 | |
33659 |
|
33660 |
|
33661 |
|
33662 |
|
33663 |
|
33664 |
|
33665 |
|
33666 |
|
33667 | MessagePrototype.toBuffer = MessagePrototype.encodeNB;
|
33668 |
|
33669 | |
33670 |
|
33671 |
|
33672 |
|
33673 |
|
33674 |
|
33675 |
|
33676 |
|
33677 |
|
33678 | MessagePrototype.encode64 = function() {
|
33679 | try {
|
33680 | return this.encode().toBase64();
|
33681 | } catch (e) {
|
33682 | if (e["encoded"]) e["encoded"] = e["encoded"].toBase64();
|
33683 | throw(e);
|
33684 | }
|
33685 | };
|
33686 |
|
33687 | |
33688 |
|
33689 |
|
33690 |
|
33691 |
|
33692 |
|
33693 |
|
33694 |
|
33695 |
|
33696 | MessagePrototype.toBase64 = MessagePrototype.encode64;
|
33697 |
|
33698 | |
33699 |
|
33700 |
|
33701 |
|
33702 |
|
33703 |
|
33704 |
|
33705 |
|
33706 |
|
33707 | MessagePrototype.encodeHex = function() {
|
33708 | try {
|
33709 | return this.encode().toHex();
|
33710 | } catch (e) {
|
33711 | if (e["encoded"]) e["encoded"] = e["encoded"].toHex();
|
33712 | throw(e);
|
33713 | }
|
33714 | };
|
33715 |
|
33716 | |
33717 |
|
33718 |
|
33719 |
|
33720 |
|
33721 |
|
33722 |
|
33723 |
|
33724 |
|
33725 | MessagePrototype.toHex = MessagePrototype.encodeHex;
|
33726 |
|
33727 | |
33728 |
|
33729 |
|
33730 |
|
33731 |
|
33732 |
|
33733 |
|
33734 |
|
33735 |
|
33736 | function cloneRaw(obj, binaryAsBase64, longsAsStrings, resolvedType) {
|
33737 | if (obj === null || typeof obj !== 'object') {
|
33738 |
|
33739 | if (resolvedType && resolvedType instanceof ProtoBuf.Reflect.Enum) {
|
33740 | var name = ProtoBuf.Reflect.Enum.getName(resolvedType.object, obj);
|
33741 | if (name !== null)
|
33742 | return name;
|
33743 | }
|
33744 |
|
33745 | return obj;
|
33746 | }
|
33747 |
|
33748 | if (ByteBuffer.isByteBuffer(obj))
|
33749 | return binaryAsBase64 ? obj.toBase64() : obj.toBuffer();
|
33750 |
|
33751 | if (ProtoBuf.Long.isLong(obj))
|
33752 | return longsAsStrings ? obj.toString() : ProtoBuf.Long.fromValue(obj);
|
33753 | var clone;
|
33754 |
|
33755 | if (Array.isArray(obj)) {
|
33756 | clone = [];
|
33757 | obj.forEach(function(v, k) {
|
33758 | clone[k] = cloneRaw(v, binaryAsBase64, longsAsStrings, resolvedType);
|
33759 | });
|
33760 | return clone;
|
33761 | }
|
33762 | clone = {};
|
33763 |
|
33764 | if (obj instanceof ProtoBuf.Map) {
|
33765 | var it = obj.entries();
|
33766 | for (var e = it.next(); !e.done; e = it.next())
|
33767 | clone[obj.keyElem.valueToString(e.value[0])] = cloneRaw(e.value[1], binaryAsBase64, longsAsStrings, obj.valueElem.resolvedType);
|
33768 | return clone;
|
33769 | }
|
33770 |
|
33771 | var type = obj.$type,
|
33772 | field = undefined;
|
33773 | for (var i in obj)
|
33774 | if (obj.hasOwnProperty(i)) {
|
33775 | if (type && (field = type.getChild(i)))
|
33776 | clone[i] = cloneRaw(obj[i], binaryAsBase64, longsAsStrings, field.resolvedType);
|
33777 | else
|
33778 | clone[i] = cloneRaw(obj[i], binaryAsBase64, longsAsStrings);
|
33779 | }
|
33780 | return clone;
|
33781 | }
|
33782 |
|
33783 | |
33784 |
|
33785 |
|
33786 |
|
33787 |
|
33788 |
|
33789 |
|
33790 | MessagePrototype.toRaw = function(binaryAsBase64, longsAsStrings) {
|
33791 | return cloneRaw(this, !!binaryAsBase64, !!longsAsStrings, this.$type);
|
33792 | };
|
33793 |
|
33794 | |
33795 |
|
33796 |
|
33797 |
|
33798 |
|
33799 | MessagePrototype.encodeJSON = function() {
|
33800 | return JSON.stringify(
|
33801 | cloneRaw(this,
|
33802 | true,
|
33803 | true,
|
33804 | this.$type
|
33805 | )
|
33806 | );
|
33807 | };
|
33808 |
|
33809 | |
33810 |
|
33811 |
|
33812 |
|
33813 |
|
33814 |
|
33815 |
|
33816 |
|
33817 |
|
33818 |
|
33819 |
|
33820 |
|
33821 |
|
33822 |
|
33823 | Message.decode = function(buffer, length, enc) {
|
33824 | if (typeof length === 'string')
|
33825 | enc = length,
|
33826 | length = -1;
|
33827 | if (typeof buffer === 'string')
|
33828 | buffer = ByteBuffer.wrap(buffer, enc ? enc : "base64");
|
33829 | else if (!ByteBuffer.isByteBuffer(buffer))
|
33830 | buffer = ByteBuffer.wrap(buffer);
|
33831 | var le = buffer.littleEndian;
|
33832 | try {
|
33833 | var msg = T.decode(buffer.LE(), length);
|
33834 | buffer.LE(le);
|
33835 | return msg;
|
33836 | } catch (e) {
|
33837 | buffer.LE(le);
|
33838 | throw(e);
|
33839 | }
|
33840 | };
|
33841 |
|
33842 | |
33843 |
|
33844 |
|
33845 |
|
33846 |
|
33847 |
|
33848 |
|
33849 |
|
33850 |
|
33851 |
|
33852 |
|
33853 | Message.decodeDelimited = function(buffer, enc) {
|
33854 | if (typeof buffer === 'string')
|
33855 | buffer = ByteBuffer.wrap(buffer, enc ? enc : "base64");
|
33856 | else if (!ByteBuffer.isByteBuffer(buffer))
|
33857 | buffer = ByteBuffer.wrap(buffer);
|
33858 | if (buffer.remaining() < 1)
|
33859 | return null;
|
33860 | var off = buffer.offset,
|
33861 | len = buffer.readVarint32();
|
33862 | if (buffer.remaining() < len) {
|
33863 | buffer.offset = off;
|
33864 | return null;
|
33865 | }
|
33866 | try {
|
33867 | var msg = T.decode(buffer.slice(buffer.offset, buffer.offset + len).LE());
|
33868 | buffer.offset += len;
|
33869 | return msg;
|
33870 | } catch (err) {
|
33871 | buffer.offset += len;
|
33872 | throw err;
|
33873 | }
|
33874 | };
|
33875 |
|
33876 | |
33877 |
|
33878 |
|
33879 |
|
33880 |
|
33881 |
|
33882 |
|
33883 |
|
33884 |
|
33885 |
|
33886 | Message.decode64 = function(str) {
|
33887 | return Message.decode(str, "base64");
|
33888 | };
|
33889 |
|
33890 | |
33891 |
|
33892 |
|
33893 |
|
33894 |
|
33895 |
|
33896 |
|
33897 |
|
33898 |
|
33899 |
|
33900 | Message.decodeHex = function(str) {
|
33901 | return Message.decode(str, "hex");
|
33902 | };
|
33903 |
|
33904 | |
33905 |
|
33906 |
|
33907 |
|
33908 |
|
33909 |
|
33910 |
|
33911 |
|
33912 |
|
33913 |
|
33914 | Message.decodeJSON = function(str) {
|
33915 | return new Message(JSON.parse(str));
|
33916 | };
|
33917 |
|
33918 |
|
33919 |
|
33920 | |
33921 |
|
33922 |
|
33923 |
|
33924 |
|
33925 |
|
33926 |
|
33927 | MessagePrototype.toString = function() {
|
33928 | return T.toString();
|
33929 | };
|
33930 |
|
33931 |
|
33932 |
|
33933 | |
33934 |
|
33935 |
|
33936 |
|
33937 |
|
33938 |
|
33939 | var $optionsS;
|
33940 |
|
33941 | |
33942 |
|
33943 |
|
33944 |
|
33945 |
|
33946 |
|
33947 | var $options;
|
33948 |
|
33949 | |
33950 |
|
33951 |
|
33952 |
|
33953 |
|
33954 |
|
33955 | var $typeS;
|
33956 |
|
33957 | |
33958 |
|
33959 |
|
33960 |
|
33961 |
|
33962 |
|
33963 | var $type;
|
33964 |
|
33965 | if (Object.defineProperty)
|
33966 | Object.defineProperty(Message, '$options', { "value": T.buildOpt() }),
|
33967 | Object.defineProperty(MessagePrototype, "$options", { "value": Message["$options"] }),
|
33968 | Object.defineProperty(Message, "$type", { "value": T }),
|
33969 | Object.defineProperty(MessagePrototype, "$type", { "value": T });
|
33970 |
|
33971 | return Message;
|
33972 |
|
33973 | })(ProtoBuf, this);
|
33974 |
|
33975 |
|
33976 | this._fields = [];
|
33977 | this._fieldsById = {};
|
33978 | this._fieldsByName = {};
|
33979 | this._oneofsByName = {};
|
33980 | for (var i=0, k=this.children.length, child; i<k; i++) {
|
33981 | child = this.children[i];
|
33982 | if (child instanceof Enum || child instanceof Message || child instanceof Service) {
|
33983 | if (clazz.hasOwnProperty(child.name))
|
33984 | throw Error("Illegal reflect child of "+this.toString(true)+": "+child.toString(true)+" cannot override static property '"+child.name+"'");
|
33985 | clazz[child.name] = child.build();
|
33986 | } else if (child instanceof Message.Field)
|
33987 | child.build(),
|
33988 | this._fields.push(child),
|
33989 | this._fieldsById[child.id] = child,
|
33990 | this._fieldsByName[child.name] = child;
|
33991 | else if (child instanceof Message.OneOf) {
|
33992 | this._oneofsByName[child.name] = child;
|
33993 | }
|
33994 | else if (!(child instanceof Message.OneOf) && !(child instanceof Extension))
|
33995 | throw Error("Illegal reflect child of "+this.toString(true)+": "+this.children[i].toString(true));
|
33996 | }
|
33997 |
|
33998 | return this.clazz = clazz;
|
33999 | };
|
34000 |
|
34001 | |
34002 |
|
34003 |
|
34004 |
|
34005 |
|
34006 |
|
34007 |
|
34008 |
|
34009 |
|
34010 | MessagePrototype.encode = function(message, buffer, noVerify) {
|
34011 | var fieldMissing = null,
|
34012 | field;
|
34013 | for (var i=0, k=this._fields.length, val; i<k; ++i) {
|
34014 | field = this._fields[i];
|
34015 | val = message[field.name];
|
34016 | if (field.required && val === null) {
|
34017 | if (fieldMissing === null)
|
34018 | fieldMissing = field;
|
34019 | } else
|
34020 | field.encode(noVerify ? val : field.verifyValue(val), buffer, message);
|
34021 | }
|
34022 | if (fieldMissing !== null) {
|
34023 | var err = Error("Missing at least one required field for "+this.toString(true)+": "+fieldMissing);
|
34024 | err["encoded"] = buffer;
|
34025 | throw(err);
|
34026 | }
|
34027 | return buffer;
|
34028 | };
|
34029 |
|
34030 | |
34031 |
|
34032 |
|
34033 |
|
34034 |
|
34035 |
|
34036 |
|
34037 | MessagePrototype.calculate = function(message) {
|
34038 | for (var n=0, i=0, k=this._fields.length, field, val; i<k; ++i) {
|
34039 | field = this._fields[i];
|
34040 | val = message[field.name];
|
34041 | if (field.required && val === null)
|
34042 | throw Error("Missing at least one required field for "+this.toString(true)+": "+field);
|
34043 | else
|
34044 | n += field.calculate(val, message);
|
34045 | }
|
34046 | return n;
|
34047 | };
|
34048 |
|
34049 | |
34050 |
|
34051 |
|
34052 |
|
34053 |
|
34054 |
|
34055 |
|
34056 |
|
34057 | function skipTillGroupEnd(expectedId, buf) {
|
34058 | var tag = buf.readVarint32(),
|
34059 | wireType = tag & 0x07,
|
34060 | id = tag >>> 3;
|
34061 | switch (wireType) {
|
34062 | case ProtoBuf.WIRE_TYPES.VARINT:
|
34063 | do tag = buf.readUint8();
|
34064 | while ((tag & 0x80) === 0x80);
|
34065 | break;
|
34066 | case ProtoBuf.WIRE_TYPES.BITS64:
|
34067 | buf.offset += 8;
|
34068 | break;
|
34069 | case ProtoBuf.WIRE_TYPES.LDELIM:
|
34070 | tag = buf.readVarint32();
|
34071 | buf.offset += tag;
|
34072 | break;
|
34073 | case ProtoBuf.WIRE_TYPES.STARTGROUP:
|
34074 | skipTillGroupEnd(id, buf);
|
34075 | break;
|
34076 | case ProtoBuf.WIRE_TYPES.ENDGROUP:
|
34077 | if (id === expectedId)
|
34078 | return false;
|
34079 | else
|
34080 | throw Error("Illegal GROUPEND after unknown group: "+id+" ("+expectedId+" expected)");
|
34081 | case ProtoBuf.WIRE_TYPES.BITS32:
|
34082 | buf.offset += 4;
|
34083 | break;
|
34084 | default:
|
34085 | throw Error("Illegal wire type in unknown group "+expectedId+": "+wireType);
|
34086 | }
|
34087 | return true;
|
34088 | }
|
34089 |
|
34090 | |
34091 |
|
34092 |
|
34093 |
|
34094 |
|
34095 |
|
34096 |
|
34097 |
|
34098 |
|
34099 | MessagePrototype.decode = function(buffer, length, expectedGroupEndId) {
|
34100 | if (typeof length !== 'number')
|
34101 | length = -1;
|
34102 | var start = buffer.offset,
|
34103 | msg = new (this.clazz)(),
|
34104 | tag, wireType, id, field;
|
34105 | while (buffer.offset < start+length || (length === -1 && buffer.remaining() > 0)) {
|
34106 | tag = buffer.readVarint32();
|
34107 | wireType = tag & 0x07;
|
34108 | id = tag >>> 3;
|
34109 | if (wireType === ProtoBuf.WIRE_TYPES.ENDGROUP) {
|
34110 | if (id !== expectedGroupEndId)
|
34111 | throw Error("Illegal group end indicator for "+this.toString(true)+": "+id+" ("+(expectedGroupEndId ? expectedGroupEndId+" expected" : "not a group")+")");
|
34112 | break;
|
34113 | }
|
34114 | if (!(field = this._fieldsById[id])) {
|
34115 |
|
34116 | switch (wireType) {
|
34117 | case ProtoBuf.WIRE_TYPES.VARINT:
|
34118 | buffer.readVarint32();
|
34119 | break;
|
34120 | case ProtoBuf.WIRE_TYPES.BITS32:
|
34121 | buffer.offset += 4;
|
34122 | break;
|
34123 | case ProtoBuf.WIRE_TYPES.BITS64:
|
34124 | buffer.offset += 8;
|
34125 | break;
|
34126 | case ProtoBuf.WIRE_TYPES.LDELIM:
|
34127 | var len = buffer.readVarint32();
|
34128 | buffer.offset += len;
|
34129 | break;
|
34130 | case ProtoBuf.WIRE_TYPES.STARTGROUP:
|
34131 | while (skipTillGroupEnd(id, buffer)) {}
|
34132 | break;
|
34133 | default:
|
34134 | throw Error("Illegal wire type for unknown field "+id+" in "+this.toString(true)+"#decode: "+wireType);
|
34135 | }
|
34136 | continue;
|
34137 | }
|
34138 | if (field.repeated && !field.options["packed"]) {
|
34139 | msg[field.name].push(field.decode(wireType, buffer));
|
34140 | } else if (field.map) {
|
34141 | var keyval = field.decode(wireType, buffer);
|
34142 | msg[field.name].set(keyval[0], keyval[1]);
|
34143 | } else {
|
34144 | msg[field.name] = field.decode(wireType, buffer);
|
34145 | if (field.oneof) {
|
34146 | var currentField = msg[field.oneof.name];
|
34147 | if (currentField !== null && currentField !== field.name)
|
34148 | msg[currentField] = null;
|
34149 | msg[field.oneof.name] = field.name;
|
34150 | }
|
34151 | }
|
34152 | }
|
34153 |
|
34154 |
|
34155 | for (var i=0, k=this._fields.length; i<k; ++i) {
|
34156 | field = this._fields[i];
|
34157 | if (msg[field.name] === null) {
|
34158 | if (this.syntax === "proto3") {
|
34159 | msg[field.name] = field.defaultValue;
|
34160 | } else if (field.required) {
|
34161 | var err = Error("Missing at least one required field for " + this.toString(true) + ": " + field.name);
|
34162 | err["decoded"] = msg;
|
34163 | throw(err);
|
34164 | } else if (ProtoBuf.populateDefaults && field.defaultValue !== null)
|
34165 | msg[field.name] = field.defaultValue;
|
34166 | }
|
34167 | }
|
34168 | return msg;
|
34169 | };
|
34170 |
|
34171 | |
34172 |
|
34173 |
|
34174 |
|
34175 | Reflect.Message = Message;
|
34176 |
|
34177 | |
34178 |
|
34179 |
|
34180 |
|
34181 |
|
34182 |
|
34183 |
|
34184 |
|
34185 |
|
34186 |
|
34187 |
|
34188 |
|
34189 |
|
34190 |
|
34191 |
|
34192 |
|
34193 | var Field = function(builder, message, rule, keytype, type, name, id, options, oneof, syntax) {
|
34194 | T.call(this, builder, message, name);
|
34195 |
|
34196 | |
34197 |
|
34198 |
|
34199 | this.className = "Message.Field";
|
34200 |
|
34201 | |
34202 |
|
34203 |
|
34204 |
|
34205 |
|
34206 | this.required = rule === "required";
|
34207 |
|
34208 | |
34209 |
|
34210 |
|
34211 |
|
34212 |
|
34213 | this.repeated = rule === "repeated";
|
34214 |
|
34215 | |
34216 |
|
34217 |
|
34218 |
|
34219 |
|
34220 | this.map = rule === "map";
|
34221 |
|
34222 | |
34223 |
|
34224 |
|
34225 |
|
34226 |
|
34227 |
|
34228 | this.keyType = keytype || null;
|
34229 |
|
34230 | |
34231 |
|
34232 |
|
34233 |
|
34234 |
|
34235 |
|
34236 | this.type = type;
|
34237 |
|
34238 | |
34239 |
|
34240 |
|
34241 |
|
34242 |
|
34243 | this.resolvedType = null;
|
34244 |
|
34245 | |
34246 |
|
34247 |
|
34248 |
|
34249 |
|
34250 | this.id = id;
|
34251 |
|
34252 | |
34253 |
|
34254 |
|
34255 |
|
34256 |
|
34257 |
|
34258 | this.options = options || {};
|
34259 |
|
34260 | |
34261 |
|
34262 |
|
34263 |
|
34264 |
|
34265 | this.defaultValue = null;
|
34266 |
|
34267 | |
34268 |
|
34269 |
|
34270 |
|
34271 |
|
34272 | this.oneof = oneof || null;
|
34273 |
|
34274 | |
34275 |
|
34276 |
|
34277 |
|
34278 |
|
34279 | this.syntax = syntax || 'proto2';
|
34280 |
|
34281 | |
34282 |
|
34283 |
|
34284 |
|
34285 |
|
34286 | this.originalName = this.name;
|
34287 |
|
34288 | |
34289 |
|
34290 |
|
34291 |
|
34292 |
|
34293 | this.element = null;
|
34294 |
|
34295 | |
34296 |
|
34297 |
|
34298 |
|
34299 |
|
34300 |
|
34301 | this.keyElement = null;
|
34302 |
|
34303 |
|
34304 | if (this.builder.options['convertFieldsToCamelCase'] && !(this instanceof Message.ExtensionField))
|
34305 | this.name = ProtoBuf.Util.toCamelCase(this.name);
|
34306 | };
|
34307 |
|
34308 | |
34309 |
|
34310 |
|
34311 |
|
34312 | var FieldPrototype = Field.prototype = Object.create(T.prototype);
|
34313 |
|
34314 | |
34315 |
|
34316 |
|
34317 |
|
34318 |
|
34319 | FieldPrototype.build = function() {
|
34320 | this.element = new Element(this.type, this.resolvedType, false, this.syntax, this.name);
|
34321 | if (this.map)
|
34322 | this.keyElement = new Element(this.keyType, undefined, true, this.syntax, this.name);
|
34323 |
|
34324 |
|
34325 |
|
34326 | if (this.syntax === 'proto3' && !this.repeated && !this.map)
|
34327 | this.defaultValue = Element.defaultFieldValue(this.type);
|
34328 |
|
34329 |
|
34330 | else if (typeof this.options['default'] !== 'undefined')
|
34331 | this.defaultValue = this.verifyValue(this.options['default']);
|
34332 | };
|
34333 |
|
34334 | |
34335 |
|
34336 |
|
34337 |
|
34338 |
|
34339 |
|
34340 |
|
34341 |
|
34342 | FieldPrototype.verifyValue = function(value, skipRepeated) {
|
34343 | skipRepeated = skipRepeated || false;
|
34344 | var self = this;
|
34345 | function fail(val, msg) {
|
34346 | throw Error("Illegal value for "+self.toString(true)+" of type "+self.type.name+": "+val+" ("+msg+")");
|
34347 | }
|
34348 | if (value === null) {
|
34349 | if (this.required)
|
34350 | fail(typeof value, "required");
|
34351 | if (this.syntax === 'proto3' && this.type !== ProtoBuf.TYPES["message"])
|
34352 | fail(typeof value, "proto3 field without field presence cannot be null");
|
34353 | return null;
|
34354 | }
|
34355 | var i;
|
34356 | if (this.repeated && !skipRepeated) {
|
34357 | if (!Array.isArray(value))
|
34358 | value = [value];
|
34359 | var res = [];
|
34360 | for (i=0; i<value.length; i++)
|
34361 | res.push(this.element.verifyValue(value[i]));
|
34362 | return res;
|
34363 | }
|
34364 | if (this.map && !skipRepeated) {
|
34365 | if (!(value instanceof ProtoBuf.Map)) {
|
34366 |
|
34367 | if (!(value instanceof Object)) {
|
34368 | fail(typeof value,
|
34369 | "expected ProtoBuf.Map or raw object for map field");
|
34370 | }
|
34371 | return new ProtoBuf.Map(this, value);
|
34372 | } else {
|
34373 | return value;
|
34374 | }
|
34375 | }
|
34376 |
|
34377 | if (!this.repeated && Array.isArray(value))
|
34378 | fail(typeof value, "no array expected");
|
34379 |
|
34380 | return this.element.verifyValue(value);
|
34381 | };
|
34382 |
|
34383 | |
34384 |
|
34385 |
|
34386 |
|
34387 |
|
34388 |
|
34389 |
|
34390 | FieldPrototype.hasWirePresence = function(value, message) {
|
34391 | if (this.syntax !== 'proto3')
|
34392 | return (value !== null);
|
34393 | if (this.oneof && message[this.oneof.name] === this.name)
|
34394 | return true;
|
34395 | switch (this.type) {
|
34396 | case ProtoBuf.TYPES["int32"]:
|
34397 | case ProtoBuf.TYPES["sint32"]:
|
34398 | case ProtoBuf.TYPES["sfixed32"]:
|
34399 | case ProtoBuf.TYPES["uint32"]:
|
34400 | case ProtoBuf.TYPES["fixed32"]:
|
34401 | return value !== 0;
|
34402 |
|
34403 | case ProtoBuf.TYPES["int64"]:
|
34404 | case ProtoBuf.TYPES["sint64"]:
|
34405 | case ProtoBuf.TYPES["sfixed64"]:
|
34406 | case ProtoBuf.TYPES["uint64"]:
|
34407 | case ProtoBuf.TYPES["fixed64"]:
|
34408 | return value.low !== 0 || value.high !== 0;
|
34409 |
|
34410 | case ProtoBuf.TYPES["bool"]:
|
34411 | return value;
|
34412 |
|
34413 | case ProtoBuf.TYPES["float"]:
|
34414 | case ProtoBuf.TYPES["double"]:
|
34415 | return value !== 0.0;
|
34416 |
|
34417 | case ProtoBuf.TYPES["string"]:
|
34418 | return value.length > 0;
|
34419 |
|
34420 | case ProtoBuf.TYPES["bytes"]:
|
34421 | return value.remaining() > 0;
|
34422 |
|
34423 | case ProtoBuf.TYPES["enum"]:
|
34424 | return value !== 0;
|
34425 |
|
34426 | case ProtoBuf.TYPES["message"]:
|
34427 | return value !== null;
|
34428 | default:
|
34429 | return true;
|
34430 | }
|
34431 | };
|
34432 |
|
34433 | |
34434 |
|
34435 |
|
34436 |
|
34437 |
|
34438 |
|
34439 |
|
34440 |
|
34441 |
|
34442 | FieldPrototype.encode = function(value, buffer, message) {
|
34443 | if (this.type === null || typeof this.type !== 'object')
|
34444 | throw Error("[INTERNAL] Unresolved type in "+this.toString(true)+": "+this.type);
|
34445 | if (value === null || (this.repeated && value.length == 0))
|
34446 | return buffer;
|
34447 | try {
|
34448 | if (this.repeated) {
|
34449 | var i;
|
34450 |
|
34451 |
|
34452 | if (this.options["packed"] && ProtoBuf.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0) {
|
34453 |
|
34454 |
|
34455 |
|
34456 | buffer.writeVarint32((this.id << 3) | ProtoBuf.WIRE_TYPES.LDELIM);
|
34457 | buffer.ensureCapacity(buffer.offset += 1);
|
34458 | var start = buffer.offset;
|
34459 | for (i=0; i<value.length; i++)
|
34460 | this.element.encodeValue(this.id, value[i], buffer);
|
34461 | var len = buffer.offset-start,
|
34462 | varintLen = ByteBuffer.calculateVarint32(len);
|
34463 | if (varintLen > 1) {
|
34464 | var contents = buffer.slice(start, buffer.offset);
|
34465 | start += varintLen-1;
|
34466 | buffer.offset = start;
|
34467 | buffer.append(contents);
|
34468 | }
|
34469 | buffer.writeVarint32(len, start-varintLen);
|
34470 | } else {
|
34471 |
|
34472 |
|
34473 | for (i=0; i<value.length; i++)
|
34474 | buffer.writeVarint32((this.id << 3) | this.type.wireType),
|
34475 | this.element.encodeValue(this.id, value[i], buffer);
|
34476 | }
|
34477 | } else if (this.map) {
|
34478 |
|
34479 | value.forEach(function(val, key, m) {
|
34480 |
|
34481 | var length =
|
34482 | ByteBuffer.calculateVarint32((1 << 3) | this.keyType.wireType) +
|
34483 | this.keyElement.calculateLength(1, key) +
|
34484 | ByteBuffer.calculateVarint32((2 << 3) | this.type.wireType) +
|
34485 | this.element.calculateLength(2, val);
|
34486 |
|
34487 |
|
34488 | buffer.writeVarint32((this.id << 3) | ProtoBuf.WIRE_TYPES.LDELIM);
|
34489 | buffer.writeVarint32(length);
|
34490 |
|
34491 |
|
34492 | buffer.writeVarint32((1 << 3) | this.keyType.wireType);
|
34493 | this.keyElement.encodeValue(1, key, buffer);
|
34494 | buffer.writeVarint32((2 << 3) | this.type.wireType);
|
34495 | this.element.encodeValue(2, val, buffer);
|
34496 | }, this);
|
34497 | } else {
|
34498 | if (this.hasWirePresence(value, message)) {
|
34499 | buffer.writeVarint32((this.id << 3) | this.type.wireType);
|
34500 | this.element.encodeValue(this.id, value, buffer);
|
34501 | }
|
34502 | }
|
34503 | } catch (e) {
|
34504 | throw Error("Illegal value for "+this.toString(true)+": "+value+" ("+e+")");
|
34505 | }
|
34506 | return buffer;
|
34507 | };
|
34508 |
|
34509 | |
34510 |
|
34511 |
|
34512 |
|
34513 |
|
34514 |
|
34515 |
|
34516 | FieldPrototype.calculate = function(value, message) {
|
34517 | value = this.verifyValue(value);
|
34518 | if (this.type === null || typeof this.type !== 'object')
|
34519 | throw Error("[INTERNAL] Unresolved type in "+this.toString(true)+": "+this.type);
|
34520 | if (value === null || (this.repeated && value.length == 0))
|
34521 | return 0;
|
34522 | var n = 0;
|
34523 | try {
|
34524 | if (this.repeated) {
|
34525 | var i, ni;
|
34526 | if (this.options["packed"] && ProtoBuf.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0) {
|
34527 | n += ByteBuffer.calculateVarint32((this.id << 3) | ProtoBuf.WIRE_TYPES.LDELIM);
|
34528 | ni = 0;
|
34529 | for (i=0; i<value.length; i++)
|
34530 | ni += this.element.calculateLength(this.id, value[i]);
|
34531 | n += ByteBuffer.calculateVarint32(ni);
|
34532 | n += ni;
|
34533 | } else {
|
34534 | for (i=0; i<value.length; i++)
|
34535 | n += ByteBuffer.calculateVarint32((this.id << 3) | this.type.wireType),
|
34536 | n += this.element.calculateLength(this.id, value[i]);
|
34537 | }
|
34538 | } else if (this.map) {
|
34539 |
|
34540 | value.forEach(function(val, key, m) {
|
34541 |
|
34542 | var length =
|
34543 | ByteBuffer.calculateVarint32((1 << 3) | this.keyType.wireType) +
|
34544 | this.keyElement.calculateLength(1, key) +
|
34545 | ByteBuffer.calculateVarint32((2 << 3) | this.type.wireType) +
|
34546 | this.element.calculateLength(2, val);
|
34547 |
|
34548 | n += ByteBuffer.calculateVarint32((this.id << 3) | ProtoBuf.WIRE_TYPES.LDELIM);
|
34549 | n += ByteBuffer.calculateVarint32(length);
|
34550 | n += length;
|
34551 | }, this);
|
34552 | } else {
|
34553 | if (this.hasWirePresence(value, message)) {
|
34554 | n += ByteBuffer.calculateVarint32((this.id << 3) | this.type.wireType);
|
34555 | n += this.element.calculateLength(this.id, value);
|
34556 | }
|
34557 | }
|
34558 | } catch (e) {
|
34559 | throw Error("Illegal value for "+this.toString(true)+": "+value+" ("+e+")");
|
34560 | }
|
34561 | return n;
|
34562 | };
|
34563 |
|
34564 | |
34565 |
|
34566 |
|
34567 |
|
34568 |
|
34569 |
|
34570 |
|
34571 |
|
34572 |
|
34573 |
|
34574 | FieldPrototype.decode = function(wireType, buffer, skipRepeated) {
|
34575 | var value, nBytes;
|
34576 |
|
34577 |
|
34578 |
|
34579 | var wireTypeOK =
|
34580 | (!this.map && wireType == this.type.wireType) ||
|
34581 | (!skipRepeated && this.repeated && this.options["packed"] &&
|
34582 | wireType == ProtoBuf.WIRE_TYPES.LDELIM) ||
|
34583 | (this.map && wireType == ProtoBuf.WIRE_TYPES.LDELIM);
|
34584 | if (!wireTypeOK)
|
34585 | throw Error("Illegal wire type for field "+this.toString(true)+": "+wireType+" ("+this.type.wireType+" expected)");
|
34586 |
|
34587 |
|
34588 | if (wireType == ProtoBuf.WIRE_TYPES.LDELIM && this.repeated && this.options["packed"] && ProtoBuf.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0) {
|
34589 | if (!skipRepeated) {
|
34590 | nBytes = buffer.readVarint32();
|
34591 | nBytes = buffer.offset + nBytes;
|
34592 | var values = [];
|
34593 | while (buffer.offset < nBytes)
|
34594 | values.push(this.decode(this.type.wireType, buffer, true));
|
34595 | return values;
|
34596 | }
|
34597 |
|
34598 | }
|
34599 |
|
34600 |
|
34601 | if (this.map) {
|
34602 |
|
34603 | var key = Element.defaultFieldValue(this.keyType);
|
34604 | value = Element.defaultFieldValue(this.type);
|
34605 |
|
34606 |
|
34607 | nBytes = buffer.readVarint32();
|
34608 | if (buffer.remaining() < nBytes)
|
34609 | throw Error("Illegal number of bytes for "+this.toString(true)+": "+nBytes+" required but got only "+buffer.remaining());
|
34610 |
|
34611 |
|
34612 | var msgbuf = buffer.clone();
|
34613 | msgbuf.limit = msgbuf.offset + nBytes;
|
34614 | buffer.offset += nBytes;
|
34615 |
|
34616 | while (msgbuf.remaining() > 0) {
|
34617 | var tag = msgbuf.readVarint32();
|
34618 | wireType = tag & 0x07;
|
34619 | var id = tag >>> 3;
|
34620 | if (id === 1) {
|
34621 | key = this.keyElement.decode(msgbuf, wireType, id);
|
34622 | } else if (id === 2) {
|
34623 | value = this.element.decode(msgbuf, wireType, id);
|
34624 | } else {
|
34625 | throw Error("Unexpected tag in map field key/value submessage");
|
34626 | }
|
34627 | }
|
34628 |
|
34629 | return [key, value];
|
34630 | }
|
34631 |
|
34632 |
|
34633 | return this.element.decode(buffer, wireType, this.id);
|
34634 | };
|
34635 |
|
34636 | |
34637 |
|
34638 |
|
34639 |
|
34640 | Reflect.Message.Field = Field;
|
34641 |
|
34642 | |
34643 |
|
34644 |
|
34645 |
|
34646 |
|
34647 |
|
34648 |
|
34649 |
|
34650 |
|
34651 |
|
34652 |
|
34653 |
|
34654 |
|
34655 | var ExtensionField = function(builder, message, rule, type, name, id, options) {
|
34656 | Field.call(this, builder, message, rule, null, type, name, id, options);
|
34657 |
|
34658 | |
34659 |
|
34660 |
|
34661 |
|
34662 |
|
34663 | this.extension;
|
34664 | };
|
34665 |
|
34666 |
|
34667 | ExtensionField.prototype = Object.create(Field.prototype);
|
34668 |
|
34669 | |
34670 |
|
34671 |
|
34672 |
|
34673 | Reflect.Message.ExtensionField = ExtensionField;
|
34674 |
|
34675 | |
34676 |
|
34677 |
|
34678 |
|
34679 |
|
34680 |
|
34681 |
|
34682 |
|
34683 |
|
34684 | var OneOf = function(builder, message, name) {
|
34685 | T.call(this, builder, message, name);
|
34686 |
|
34687 | |
34688 |
|
34689 |
|
34690 |
|
34691 |
|
34692 | this.fields = [];
|
34693 | };
|
34694 |
|
34695 | |
34696 |
|
34697 |
|
34698 |
|
34699 | Reflect.Message.OneOf = OneOf;
|
34700 |
|
34701 | |
34702 |
|
34703 |
|
34704 |
|
34705 |
|
34706 |
|
34707 |
|
34708 |
|
34709 |
|
34710 |
|
34711 |
|
34712 | var Enum = function(builder, parent, name, options, syntax) {
|
34713 | Namespace.call(this, builder, parent, name, options, syntax);
|
34714 |
|
34715 | |
34716 |
|
34717 |
|
34718 | this.className = "Enum";
|
34719 |
|
34720 | |
34721 |
|
34722 |
|
34723 |
|
34724 |
|
34725 | this.object = null;
|
34726 | };
|
34727 |
|
34728 | |
34729 |
|
34730 |
|
34731 |
|
34732 |
|
34733 |
|
34734 |
|
34735 | Enum.getName = function(enm, value) {
|
34736 | var keys = Object.keys(enm);
|
34737 | for (var i=0, key; i<keys.length; ++i)
|
34738 | if (enm[key = keys[i]] === value)
|
34739 | return key;
|
34740 | return null;
|
34741 | };
|
34742 |
|
34743 | |
34744 |
|
34745 |
|
34746 |
|
34747 | var EnumPrototype = Enum.prototype = Object.create(Namespace.prototype);
|
34748 |
|
34749 | |
34750 |
|
34751 |
|
34752 |
|
34753 |
|
34754 |
|
34755 | EnumPrototype.build = function(rebuild) {
|
34756 | if (this.object && !rebuild)
|
34757 | return this.object;
|
34758 | var enm = new ProtoBuf.Builder.Enum(),
|
34759 | values = this.getChildren(Enum.Value);
|
34760 | for (var i=0, k=values.length; i<k; ++i)
|
34761 | enm[values[i]['name']] = values[i]['id'];
|
34762 | if (Object.defineProperty)
|
34763 | Object.defineProperty(enm, '$options', {
|
34764 | "value": this.buildOpt(),
|
34765 | "enumerable": false
|
34766 | });
|
34767 | return this.object = enm;
|
34768 | };
|
34769 |
|
34770 | |
34771 |
|
34772 |
|
34773 |
|
34774 | Reflect.Enum = Enum;
|
34775 |
|
34776 | |
34777 |
|
34778 |
|
34779 |
|
34780 |
|
34781 |
|
34782 |
|
34783 |
|
34784 |
|
34785 |
|
34786 | var Value = function(builder, enm, name, id) {
|
34787 | T.call(this, builder, enm, name);
|
34788 |
|
34789 | |
34790 |
|
34791 |
|
34792 | this.className = "Enum.Value";
|
34793 |
|
34794 | |
34795 |
|
34796 |
|
34797 |
|
34798 |
|
34799 | this.id = id;
|
34800 | };
|
34801 |
|
34802 |
|
34803 | Value.prototype = Object.create(T.prototype);
|
34804 |
|
34805 | |
34806 |
|
34807 |
|
34808 |
|
34809 | Reflect.Enum.Value = Value;
|
34810 |
|
34811 | |
34812 |
|
34813 |
|
34814 |
|
34815 |
|
34816 |
|
34817 |
|
34818 |
|
34819 |
|
34820 | var Extension = function(builder, parent, name, field) {
|
34821 | T.call(this, builder, parent, name);
|
34822 |
|
34823 | |
34824 |
|
34825 |
|
34826 |
|
34827 |
|
34828 | this.field = field;
|
34829 | };
|
34830 |
|
34831 |
|
34832 | Extension.prototype = Object.create(T.prototype);
|
34833 |
|
34834 | |
34835 |
|
34836 |
|
34837 |
|
34838 | Reflect.Extension = Extension;
|
34839 |
|
34840 | |
34841 |
|
34842 |
|
34843 |
|
34844 |
|
34845 |
|
34846 |
|
34847 |
|
34848 |
|
34849 |
|
34850 | var Service = function(builder, root, name, options) {
|
34851 | Namespace.call(this, builder, root, name, options);
|
34852 |
|
34853 | |
34854 |
|
34855 |
|
34856 | this.className = "Service";
|
34857 |
|
34858 | |
34859 |
|
34860 |
|
34861 |
|
34862 | this.clazz = null;
|
34863 | };
|
34864 |
|
34865 | |
34866 |
|
34867 |
|
34868 |
|
34869 | var ServicePrototype = Service.prototype = Object.create(Namespace.prototype);
|
34870 |
|
34871 | |
34872 |
|
34873 |
|
34874 |
|
34875 |
|
34876 |
|
34877 |
|
34878 |
|
34879 | ServicePrototype.build = function(rebuild) {
|
34880 | if (this.clazz && !rebuild)
|
34881 | return this.clazz;
|
34882 |
|
34883 |
|
34884 | return this.clazz = (function(ProtoBuf, T) {
|
34885 |
|
34886 | |
34887 |
|
34888 |
|
34889 |
|
34890 |
|
34891 |
|
34892 |
|
34893 |
|
34894 | var Service = function(rpcImpl) {
|
34895 | ProtoBuf.Builder.Service.call(this);
|
34896 |
|
34897 | |
34898 |
|
34899 |
|
34900 |
|
34901 |
|
34902 |
|
34903 | this.rpcImpl = rpcImpl || function(name, msg, callback) {
|
34904 |
|
34905 |
|
34906 |
|
34907 | setTimeout(callback.bind(this, Error("Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services")), 0);
|
34908 | };
|
34909 | };
|
34910 |
|
34911 | |
34912 |
|
34913 |
|
34914 |
|
34915 | var ServicePrototype = Service.prototype = Object.create(ProtoBuf.Builder.Service.prototype);
|
34916 |
|
34917 | |
34918 |
|
34919 |
|
34920 |
|
34921 |
|
34922 |
|
34923 |
|
34924 |
|
34925 |
|
34926 |
|
34927 |
|
34928 | |
34929 |
|
34930 |
|
34931 |
|
34932 |
|
34933 |
|
34934 |
|
34935 |
|
34936 |
|
34937 |
|
34938 | var rpc = T.getChildren(ProtoBuf.Reflect.Service.RPCMethod);
|
34939 | for (var i=0; i<rpc.length; i++) {
|
34940 | (function(method) {
|
34941 |
|
34942 |
|
34943 | ServicePrototype[method.name] = function(req, callback) {
|
34944 | try {
|
34945 | try {
|
34946 |
|
34947 | req = method.resolvedRequestType.clazz.decode(ByteBuffer.wrap(req));
|
34948 | } catch (err) {
|
34949 | if (!(err instanceof TypeError))
|
34950 | throw err;
|
34951 | }
|
34952 | if (req === null || typeof req !== 'object')
|
34953 | throw Error("Illegal arguments");
|
34954 | if (!(req instanceof method.resolvedRequestType.clazz))
|
34955 | req = new method.resolvedRequestType.clazz(req);
|
34956 | this.rpcImpl(method.fqn(), req, function(err, res) {
|
34957 | if (err) {
|
34958 | callback(err);
|
34959 | return;
|
34960 | }
|
34961 |
|
34962 | if (res === null)
|
34963 | res = ''
|
34964 | try { res = method.resolvedResponseType.clazz.decode(res); } catch (notABuffer) {}
|
34965 | if (!res || !(res instanceof method.resolvedResponseType.clazz)) {
|
34966 | callback(Error("Illegal response type received in service method "+ T.name+"#"+method.name));
|
34967 | return;
|
34968 | }
|
34969 | callback(null, res);
|
34970 | });
|
34971 | } catch (err) {
|
34972 | setTimeout(callback.bind(this, err), 0);
|
34973 | }
|
34974 | };
|
34975 |
|
34976 |
|
34977 | Service[method.name] = function(rpcImpl, req, callback) {
|
34978 | new Service(rpcImpl)[method.name](req, callback);
|
34979 | };
|
34980 |
|
34981 | if (Object.defineProperty)
|
34982 | Object.defineProperty(Service[method.name], "$options", { "value": method.buildOpt() }),
|
34983 | Object.defineProperty(ServicePrototype[method.name], "$options", { "value": Service[method.name]["$options"] });
|
34984 | })(rpc[i]);
|
34985 | }
|
34986 |
|
34987 |
|
34988 |
|
34989 | |
34990 |
|
34991 |
|
34992 |
|
34993 |
|
34994 |
|
34995 | var $optionsS;
|
34996 |
|
34997 | |
34998 |
|
34999 |
|
35000 |
|
35001 |
|
35002 |
|
35003 | var $options;
|
35004 |
|
35005 | |
35006 |
|
35007 |
|
35008 |
|
35009 |
|
35010 |
|
35011 | var $typeS;
|
35012 |
|
35013 | |
35014 |
|
35015 |
|
35016 |
|
35017 |
|
35018 |
|
35019 | var $type;
|
35020 |
|
35021 | if (Object.defineProperty)
|
35022 | Object.defineProperty(Service, "$options", { "value": T.buildOpt() }),
|
35023 | Object.defineProperty(ServicePrototype, "$options", { "value": Service["$options"] }),
|
35024 | Object.defineProperty(Service, "$type", { "value": T }),
|
35025 | Object.defineProperty(ServicePrototype, "$type", { "value": T });
|
35026 |
|
35027 | return Service;
|
35028 |
|
35029 | })(ProtoBuf, this);
|
35030 | };
|
35031 |
|
35032 | |
35033 |
|
35034 |
|
35035 |
|
35036 | Reflect.Service = Service;
|
35037 |
|
35038 | |
35039 |
|
35040 |
|
35041 |
|
35042 |
|
35043 |
|
35044 |
|
35045 |
|
35046 |
|
35047 |
|
35048 | var Method = function(builder, svc, name, options) {
|
35049 | T.call(this, builder, svc, name);
|
35050 |
|
35051 | |
35052 |
|
35053 |
|
35054 | this.className = "Service.Method";
|
35055 |
|
35056 | |
35057 |
|
35058 |
|
35059 |
|
35060 |
|
35061 | this.options = options || {};
|
35062 | };
|
35063 |
|
35064 | |
35065 |
|
35066 |
|
35067 |
|
35068 | var MethodPrototype = Method.prototype = Object.create(T.prototype);
|
35069 |
|
35070 | |
35071 |
|
35072 |
|
35073 |
|
35074 |
|
35075 |
|
35076 | MethodPrototype.buildOpt = NamespacePrototype.buildOpt;
|
35077 |
|
35078 | |
35079 |
|
35080 |
|
35081 |
|
35082 | Reflect.Service.Method = Method;
|
35083 |
|
35084 | |
35085 |
|
35086 |
|
35087 |
|
35088 |
|
35089 |
|
35090 |
|
35091 |
|
35092 |
|
35093 |
|
35094 |
|
35095 |
|
35096 |
|
35097 |
|
35098 | var RPCMethod = function(builder, svc, name, request, response, request_stream, response_stream, options) {
|
35099 | Method.call(this, builder, svc, name, options);
|
35100 |
|
35101 | |
35102 |
|
35103 |
|
35104 | this.className = "Service.RPCMethod";
|
35105 |
|
35106 | |
35107 |
|
35108 |
|
35109 |
|
35110 |
|
35111 | this.requestName = request;
|
35112 |
|
35113 | |
35114 |
|
35115 |
|
35116 |
|
35117 |
|
35118 | this.responseName = response;
|
35119 |
|
35120 | |
35121 |
|
35122 |
|
35123 |
|
35124 |
|
35125 | this.requestStream = request_stream;
|
35126 |
|
35127 | |
35128 |
|
35129 |
|
35130 |
|
35131 |
|
35132 | this.responseStream = response_stream;
|
35133 |
|
35134 | |
35135 |
|
35136 |
|
35137 |
|
35138 |
|
35139 | this.resolvedRequestType = null;
|
35140 |
|
35141 | |
35142 |
|
35143 |
|
35144 |
|
35145 |
|
35146 | this.resolvedResponseType = null;
|
35147 | };
|
35148 |
|
35149 |
|
35150 | RPCMethod.prototype = Object.create(Method.prototype);
|
35151 |
|
35152 | |
35153 |
|
35154 |
|
35155 |
|
35156 | Reflect.Service.RPCMethod = RPCMethod;
|
35157 |
|
35158 | return Reflect;
|
35159 |
|
35160 | })(ProtoBuf);
|
35161 |
|
35162 | |
35163 |
|
35164 |
|
35165 |
|
35166 | ProtoBuf.Builder = (function(ProtoBuf, Lang, Reflect) {
|
35167 | "use strict";
|
35168 |
|
35169 | |
35170 |
|
35171 |
|
35172 |
|
35173 |
|
35174 |
|
35175 |
|
35176 | var Builder = function(options) {
|
35177 |
|
35178 | |
35179 |
|
35180 |
|
35181 |
|
35182 |
|
35183 | this.ns = new Reflect.Namespace(this, null, "");
|
35184 |
|
35185 | |
35186 |
|
35187 |
|
35188 |
|
35189 |
|
35190 | this.ptr = this.ns;
|
35191 |
|
35192 | |
35193 |
|
35194 |
|
35195 |
|
35196 |
|
35197 | this.resolved = false;
|
35198 |
|
35199 | |
35200 |
|
35201 |
|
35202 |
|
35203 |
|
35204 | this.result = null;
|
35205 |
|
35206 | |
35207 |
|
35208 |
|
35209 |
|
35210 |
|
35211 | this.files = {};
|
35212 |
|
35213 | |
35214 |
|
35215 |
|
35216 |
|
35217 |
|
35218 | this.importRoot = null;
|
35219 |
|
35220 | |
35221 |
|
35222 |
|
35223 |
|
35224 |
|
35225 | this.options = options || {};
|
35226 | };
|
35227 |
|
35228 | |
35229 |
|
35230 |
|
35231 |
|
35232 | var BuilderPrototype = Builder.prototype;
|
35233 |
|
35234 |
|
35235 |
|
35236 | |
35237 |
|
35238 |
|
35239 |
|
35240 |
|
35241 |
|
35242 | Builder.isMessage = function(def) {
|
35243 |
|
35244 | if (typeof def["name"] !== 'string')
|
35245 | return false;
|
35246 |
|
35247 | if (typeof def["values"] !== 'undefined' || typeof def["rpc"] !== 'undefined')
|
35248 | return false;
|
35249 | return true;
|
35250 | };
|
35251 |
|
35252 | |
35253 |
|
35254 |
|
35255 |
|
35256 |
|
35257 |
|
35258 | Builder.isMessageField = function(def) {
|
35259 |
|
35260 | if (typeof def["rule"] !== 'string' || typeof def["name"] !== 'string' || typeof def["type"] !== 'string' || typeof def["id"] === 'undefined')
|
35261 | return false;
|
35262 | return true;
|
35263 | };
|
35264 |
|
35265 | |
35266 |
|
35267 |
|
35268 |
|
35269 |
|
35270 |
|
35271 | Builder.isEnum = function(def) {
|
35272 |
|
35273 | if (typeof def["name"] !== 'string')
|
35274 | return false;
|
35275 |
|
35276 | if (typeof def["values"] === 'undefined' || !Array.isArray(def["values"]) || def["values"].length === 0)
|
35277 | return false;
|
35278 | return true;
|
35279 | };
|
35280 |
|
35281 | |
35282 |
|
35283 |
|
35284 |
|
35285 |
|
35286 |
|
35287 | Builder.isService = function(def) {
|
35288 |
|
35289 | if (typeof def["name"] !== 'string' || typeof def["rpc"] !== 'object' || !def["rpc"])
|
35290 | return false;
|
35291 | return true;
|
35292 | };
|
35293 |
|
35294 | |
35295 |
|
35296 |
|
35297 |
|
35298 |
|
35299 |
|
35300 | Builder.isExtend = function(def) {
|
35301 |
|
35302 | if (typeof def["ref"] !== 'string')
|
35303 | return false;
|
35304 | return true;
|
35305 | };
|
35306 |
|
35307 |
|
35308 |
|
35309 | |
35310 |
|
35311 |
|
35312 |
|
35313 |
|
35314 | BuilderPrototype.reset = function() {
|
35315 | this.ptr = this.ns;
|
35316 | return this;
|
35317 | };
|
35318 |
|
35319 | |
35320 |
|
35321 |
|
35322 |
|
35323 |
|
35324 |
|
35325 | BuilderPrototype.define = function(namespace) {
|
35326 | if (typeof namespace !== 'string' || !Lang.TYPEREF.test(namespace))
|
35327 | throw Error("illegal namespace: "+namespace);
|
35328 | namespace.split(".").forEach(function(part) {
|
35329 | var ns = this.ptr.getChild(part);
|
35330 | if (ns === null)
|
35331 | this.ptr.addChild(ns = new Reflect.Namespace(this, this.ptr, part));
|
35332 | this.ptr = ns;
|
35333 | }, this);
|
35334 | return this;
|
35335 | };
|
35336 |
|
35337 | |
35338 |
|
35339 |
|
35340 |
|
35341 |
|
35342 |
|
35343 |
|
35344 | BuilderPrototype.create = function(defs) {
|
35345 | if (!defs)
|
35346 | return this;
|
35347 | if (!Array.isArray(defs))
|
35348 | defs = [defs];
|
35349 | else {
|
35350 | if (defs.length === 0)
|
35351 | return this;
|
35352 | defs = defs.slice();
|
35353 | }
|
35354 |
|
35355 |
|
35356 | var stack = [defs];
|
35357 | while (stack.length > 0) {
|
35358 | defs = stack.pop();
|
35359 |
|
35360 | if (!Array.isArray(defs))
|
35361 | throw Error("not a valid namespace: "+JSON.stringify(defs));
|
35362 |
|
35363 | while (defs.length > 0) {
|
35364 | var def = defs.shift();
|
35365 |
|
35366 | if (Builder.isMessage(def)) {
|
35367 | var obj = new Reflect.Message(this, this.ptr, def["name"], def["options"], def["isGroup"], def["syntax"]);
|
35368 |
|
35369 |
|
35370 | var oneofs = {};
|
35371 | if (def["oneofs"])
|
35372 | Object.keys(def["oneofs"]).forEach(function(name) {
|
35373 | obj.addChild(oneofs[name] = new Reflect.Message.OneOf(this, obj, name));
|
35374 | }, this);
|
35375 |
|
35376 |
|
35377 | if (def["fields"])
|
35378 | def["fields"].forEach(function(fld) {
|
35379 | if (obj.getChild(fld["id"]|0) !== null)
|
35380 | throw Error("duplicate or invalid field id in "+obj.name+": "+fld['id']);
|
35381 | if (fld["options"] && typeof fld["options"] !== 'object')
|
35382 | throw Error("illegal field options in "+obj.name+"#"+fld["name"]);
|
35383 | var oneof = null;
|
35384 | if (typeof fld["oneof"] === 'string' && !(oneof = oneofs[fld["oneof"]]))
|
35385 | throw Error("illegal oneof in "+obj.name+"#"+fld["name"]+": "+fld["oneof"]);
|
35386 | fld = new Reflect.Message.Field(this, obj, fld["rule"], fld["keytype"], fld["type"], fld["name"], fld["id"], fld["options"], oneof, def["syntax"]);
|
35387 | if (oneof)
|
35388 | oneof.fields.push(fld);
|
35389 | obj.addChild(fld);
|
35390 | }, this);
|
35391 |
|
35392 |
|
35393 | var subObj = [];
|
35394 | if (def["enums"])
|
35395 | def["enums"].forEach(function(enm) {
|
35396 | subObj.push(enm);
|
35397 | });
|
35398 | if (def["messages"])
|
35399 | def["messages"].forEach(function(msg) {
|
35400 | subObj.push(msg);
|
35401 | });
|
35402 | if (def["services"])
|
35403 | def["services"].forEach(function(svc) {
|
35404 | subObj.push(svc);
|
35405 | });
|
35406 |
|
35407 |
|
35408 | if (def["extensions"]) {
|
35409 | if (typeof def["extensions"][0] === 'number')
|
35410 | obj.extensions = [ def["extensions"] ];
|
35411 | else
|
35412 | obj.extensions = def["extensions"];
|
35413 | }
|
35414 |
|
35415 |
|
35416 | this.ptr.addChild(obj);
|
35417 | if (subObj.length > 0) {
|
35418 | stack.push(defs);
|
35419 | defs = subObj;
|
35420 | subObj = null;
|
35421 | this.ptr = obj;
|
35422 | obj = null;
|
35423 | continue;
|
35424 | }
|
35425 | subObj = null;
|
35426 |
|
35427 | } else if (Builder.isEnum(def)) {
|
35428 |
|
35429 | obj = new Reflect.Enum(this, this.ptr, def["name"], def["options"], def["syntax"]);
|
35430 | def["values"].forEach(function(val) {
|
35431 | obj.addChild(new Reflect.Enum.Value(this, obj, val["name"], val["id"]));
|
35432 | }, this);
|
35433 | this.ptr.addChild(obj);
|
35434 |
|
35435 | } else if (Builder.isService(def)) {
|
35436 |
|
35437 | obj = new Reflect.Service(this, this.ptr, def["name"], def["options"]);
|
35438 | Object.keys(def["rpc"]).forEach(function(name) {
|
35439 | var mtd = def["rpc"][name];
|
35440 | obj.addChild(new Reflect.Service.RPCMethod(this, obj, name, mtd["request"], mtd["response"], !!mtd["request_stream"], !!mtd["response_stream"], mtd["options"]));
|
35441 | }, this);
|
35442 | this.ptr.addChild(obj);
|
35443 |
|
35444 | } else if (Builder.isExtend(def)) {
|
35445 |
|
35446 | obj = this.ptr.resolve(def["ref"], true);
|
35447 | if (obj) {
|
35448 | def["fields"].forEach(function(fld) {
|
35449 | if (obj.getChild(fld['id']|0) !== null)
|
35450 | throw Error("duplicate extended field id in "+obj.name+": "+fld['id']);
|
35451 |
|
35452 | if (obj.extensions) {
|
35453 | var valid = false;
|
35454 | obj.extensions.forEach(function(range) {
|
35455 | if (fld["id"] >= range[0] && fld["id"] <= range[1])
|
35456 | valid = true;
|
35457 | });
|
35458 | if (!valid)
|
35459 | throw Error("illegal extended field id in "+obj.name+": "+fld['id']+" (not within valid ranges)");
|
35460 | }
|
35461 |
|
35462 | var name = fld["name"];
|
35463 | if (this.options['convertFieldsToCamelCase'])
|
35464 | name = ProtoBuf.Util.toCamelCase(name);
|
35465 |
|
35466 | var field = new Reflect.Message.ExtensionField(this, obj, fld["rule"], fld["type"], this.ptr.fqn()+'.'+name, fld["id"], fld["options"]);
|
35467 |
|
35468 |
|
35469 |
|
35470 | var ext = new Reflect.Extension(this, this.ptr, fld["name"], field);
|
35471 | field.extension = ext;
|
35472 | this.ptr.addChild(ext);
|
35473 | obj.addChild(field);
|
35474 | }, this);
|
35475 |
|
35476 | } else if (!/\.?google\.protobuf\./.test(def["ref"]))
|
35477 | throw Error("extended message "+def["ref"]+" is not defined");
|
35478 |
|
35479 | } else
|
35480 | throw Error("not a valid definition: "+JSON.stringify(def));
|
35481 |
|
35482 | def = null;
|
35483 | obj = null;
|
35484 | }
|
35485 |
|
35486 | defs = null;
|
35487 | this.ptr = this.ptr.parent;
|
35488 | }
|
35489 | this.resolved = false;
|
35490 | this.result = null;
|
35491 | return this;
|
35492 | };
|
35493 |
|
35494 | |
35495 |
|
35496 |
|
35497 |
|
35498 |
|
35499 | function propagateSyntax(parent) {
|
35500 | if (parent['messages']) {
|
35501 | parent['messages'].forEach(function(child) {
|
35502 | child["syntax"] = parent["syntax"];
|
35503 | propagateSyntax(child);
|
35504 | });
|
35505 | }
|
35506 | if (parent['enums']) {
|
35507 | parent['enums'].forEach(function(child) {
|
35508 | child["syntax"] = parent["syntax"];
|
35509 | });
|
35510 | }
|
35511 | }
|
35512 |
|
35513 | |
35514 |
|
35515 |
|
35516 |
|
35517 |
|
35518 |
|
35519 |
|
35520 |
|
35521 | BuilderPrototype["import"] = function(json, filename) {
|
35522 | var delim = '/';
|
35523 |
|
35524 |
|
35525 |
|
35526 | if (typeof filename === 'string') {
|
35527 |
|
35528 | if (ProtoBuf.Util.IS_NODE)
|
35529 | filename = __webpack_require__(117)['resolve'](filename);
|
35530 | if (this.files[filename] === true)
|
35531 | return this.reset();
|
35532 | this.files[filename] = true;
|
35533 |
|
35534 | } else if (typeof filename === 'object') {
|
35535 |
|
35536 | var root = filename.root;
|
35537 | if (ProtoBuf.Util.IS_NODE)
|
35538 | root = __webpack_require__(117)['resolve'](root);
|
35539 | if (root.indexOf("\\") >= 0 || filename.file.indexOf("\\") >= 0)
|
35540 | delim = '\\';
|
35541 | var fname;
|
35542 | if (ProtoBuf.Util.IS_NODE)
|
35543 | fname = __webpack_require__(117)['join'](root, filename.file);
|
35544 | else
|
35545 | fname = root + delim + filename.file;
|
35546 | if (this.files[fname] === true)
|
35547 | return this.reset();
|
35548 | this.files[fname] = true;
|
35549 | }
|
35550 |
|
35551 |
|
35552 |
|
35553 | if (json['imports'] && json['imports'].length > 0) {
|
35554 | var importRoot,
|
35555 | resetRoot = false;
|
35556 |
|
35557 | if (typeof filename === 'object') {
|
35558 |
|
35559 | this.importRoot = filename["root"]; resetRoot = true;
|
35560 | importRoot = this.importRoot;
|
35561 | filename = filename["file"];
|
35562 | if (importRoot.indexOf("\\") >= 0 || filename.indexOf("\\") >= 0)
|
35563 | delim = '\\';
|
35564 |
|
35565 | } else if (typeof filename === 'string') {
|
35566 |
|
35567 | if (this.importRoot)
|
35568 | importRoot = this.importRoot;
|
35569 | else {
|
35570 | if (filename.indexOf("/") >= 0) {
|
35571 | importRoot = filename.replace(/\/[^\/]*$/, "");
|
35572 | if ( importRoot === "")
|
35573 | importRoot = "/";
|
35574 | } else if (filename.indexOf("\\") >= 0) {
|
35575 | importRoot = filename.replace(/\\[^\\]*$/, "");
|
35576 | delim = '\\';
|
35577 | } else
|
35578 | importRoot = ".";
|
35579 | }
|
35580 |
|
35581 | } else
|
35582 | importRoot = null;
|
35583 |
|
35584 | for (var i=0; i<json['imports'].length; i++) {
|
35585 | if (typeof json['imports'][i] === 'string') {
|
35586 | if (!importRoot)
|
35587 | throw Error("cannot determine import root");
|
35588 | var importFilename = json['imports'][i];
|
35589 | if (importFilename === "google/protobuf/descriptor.proto")
|
35590 | continue;
|
35591 | if (ProtoBuf.Util.IS_NODE)
|
35592 | importFilename = __webpack_require__(117)['join'](importRoot, importFilename);
|
35593 | else
|
35594 | importFilename = importRoot + delim + importFilename;
|
35595 | if (this.files[importFilename] === true)
|
35596 | continue;
|
35597 | if (/\.proto$/i.test(importFilename) && !ProtoBuf.DotProto)
|
35598 | importFilename = importFilename.replace(/\.proto$/, ".json");
|
35599 | var contents = ProtoBuf.Util.fetch(importFilename);
|
35600 | if (contents === null)
|
35601 | throw Error("failed to import '"+importFilename+"' in '"+filename+"': file not found");
|
35602 | if (/\.json$/i.test(importFilename))
|
35603 | this["import"](JSON.parse(contents+""), importFilename);
|
35604 | else
|
35605 | this["import"](ProtoBuf.DotProto.Parser.parse(contents), importFilename);
|
35606 | } else
|
35607 | if (!filename)
|
35608 | this["import"](json['imports'][i]);
|
35609 | else if (/\.(\w+)$/.test(filename))
|
35610 | this["import"](json['imports'][i], filename.replace(/^(.+)\.(\w+)$/, function($0, $1, $2) { return $1+"_import"+i+"."+$2; }));
|
35611 | else
|
35612 | this["import"](json['imports'][i], filename+"_import"+i);
|
35613 | }
|
35614 | if (resetRoot)
|
35615 | this.importRoot = null;
|
35616 | }
|
35617 |
|
35618 |
|
35619 |
|
35620 | if (json['package'])
|
35621 | this.define(json['package']);
|
35622 | if (json['syntax'])
|
35623 | propagateSyntax(json);
|
35624 | var base = this.ptr;
|
35625 | if (json['options'])
|
35626 | Object.keys(json['options']).forEach(function(key) {
|
35627 | base.options[key] = json['options'][key];
|
35628 | });
|
35629 | if (json['messages'])
|
35630 | this.create(json['messages']),
|
35631 | this.ptr = base;
|
35632 | if (json['enums'])
|
35633 | this.create(json['enums']),
|
35634 | this.ptr = base;
|
35635 | if (json['services'])
|
35636 | this.create(json['services']),
|
35637 | this.ptr = base;
|
35638 | if (json['extends'])
|
35639 | this.create(json['extends']);
|
35640 |
|
35641 | return this.reset();
|
35642 | };
|
35643 |
|
35644 | |
35645 |
|
35646 |
|
35647 |
|
35648 |
|
35649 |
|
35650 | BuilderPrototype.resolveAll = function() {
|
35651 |
|
35652 | var res;
|
35653 | if (this.ptr == null || typeof this.ptr.type === 'object')
|
35654 | return this;
|
35655 |
|
35656 | if (this.ptr instanceof Reflect.Namespace) {
|
35657 |
|
35658 | this.ptr.children.forEach(function(child) {
|
35659 | this.ptr = child;
|
35660 | this.resolveAll();
|
35661 | }, this);
|
35662 |
|
35663 | } else if (this.ptr instanceof Reflect.Message.Field) {
|
35664 |
|
35665 | if (!Lang.TYPE.test(this.ptr.type)) {
|
35666 | if (!Lang.TYPEREF.test(this.ptr.type))
|
35667 | throw Error("illegal type reference in "+this.ptr.toString(true)+": "+this.ptr.type);
|
35668 | res = (this.ptr instanceof Reflect.Message.ExtensionField ? this.ptr.extension.parent : this.ptr.parent).resolve(this.ptr.type, true);
|
35669 | if (!res)
|
35670 | throw Error("unresolvable type reference in "+this.ptr.toString(true)+": "+this.ptr.type);
|
35671 | this.ptr.resolvedType = res;
|
35672 | if (res instanceof Reflect.Enum) {
|
35673 | this.ptr.type = ProtoBuf.TYPES["enum"];
|
35674 | if (this.ptr.syntax === 'proto3' && res.syntax !== 'proto3')
|
35675 | throw Error("proto3 message cannot reference proto2 enum");
|
35676 | }
|
35677 | else if (res instanceof Reflect.Message)
|
35678 | this.ptr.type = res.isGroup ? ProtoBuf.TYPES["group"] : ProtoBuf.TYPES["message"];
|
35679 | else
|
35680 | throw Error("illegal type reference in "+this.ptr.toString(true)+": "+this.ptr.type);
|
35681 | } else
|
35682 | this.ptr.type = ProtoBuf.TYPES[this.ptr.type];
|
35683 |
|
35684 |
|
35685 |
|
35686 | if (this.ptr.map) {
|
35687 | if (!Lang.TYPE.test(this.ptr.keyType))
|
35688 | throw Error("illegal key type for map field in "+this.ptr.toString(true)+": "+this.ptr.keyType);
|
35689 | this.ptr.keyType = ProtoBuf.TYPES[this.ptr.keyType];
|
35690 | }
|
35691 |
|
35692 |
|
35693 |
|
35694 | if (
|
35695 | this.ptr.syntax === 'proto3' &&
|
35696 | this.ptr.repeated && this.ptr.options.packed === undefined &&
|
35697 | ProtoBuf.PACKABLE_WIRE_TYPES.indexOf(this.ptr.type.wireType) !== -1
|
35698 | ) {
|
35699 | this.ptr.options.packed = true;
|
35700 | }
|
35701 |
|
35702 | } else if (this.ptr instanceof ProtoBuf.Reflect.Service.Method) {
|
35703 |
|
35704 | if (this.ptr instanceof ProtoBuf.Reflect.Service.RPCMethod) {
|
35705 | res = this.ptr.parent.resolve(this.ptr.requestName, true);
|
35706 | if (!res || !(res instanceof ProtoBuf.Reflect.Message))
|
35707 | throw Error("Illegal type reference in "+this.ptr.toString(true)+": "+this.ptr.requestName);
|
35708 | this.ptr.resolvedRequestType = res;
|
35709 | res = this.ptr.parent.resolve(this.ptr.responseName, true);
|
35710 | if (!res || !(res instanceof ProtoBuf.Reflect.Message))
|
35711 | throw Error("Illegal type reference in "+this.ptr.toString(true)+": "+this.ptr.responseName);
|
35712 | this.ptr.resolvedResponseType = res;
|
35713 | } else
|
35714 | throw Error("illegal service type in "+this.ptr.toString(true));
|
35715 |
|
35716 | } else if (
|
35717 | !(this.ptr instanceof ProtoBuf.Reflect.Message.OneOf) &&
|
35718 | !(this.ptr instanceof ProtoBuf.Reflect.Extension) &&
|
35719 | !(this.ptr instanceof ProtoBuf.Reflect.Enum.Value)
|
35720 | )
|
35721 | throw Error("illegal object in namespace: "+typeof(this.ptr)+": "+this.ptr);
|
35722 |
|
35723 | return this.reset();
|
35724 | };
|
35725 |
|
35726 | |
35727 |
|
35728 |
|
35729 |
|
35730 |
|
35731 |
|
35732 |
|
35733 |
|
35734 | BuilderPrototype.build = function(path) {
|
35735 | this.reset();
|
35736 | if (!this.resolved)
|
35737 | this.resolveAll(),
|
35738 | this.resolved = true,
|
35739 | this.result = null;
|
35740 | if (this.result === null)
|
35741 | this.result = this.ns.build();
|
35742 | if (!path)
|
35743 | return this.result;
|
35744 | var part = typeof path === 'string' ? path.split(".") : path,
|
35745 | ptr = this.result;
|
35746 | for (var i=0; i<part.length; i++)
|
35747 | if (ptr[part[i]])
|
35748 | ptr = ptr[part[i]];
|
35749 | else {
|
35750 | ptr = null;
|
35751 | break;
|
35752 | }
|
35753 | return ptr;
|
35754 | };
|
35755 |
|
35756 | |
35757 |
|
35758 |
|
35759 |
|
35760 |
|
35761 |
|
35762 | BuilderPrototype.lookup = function(path, excludeNonNamespace) {
|
35763 | return path ? this.ns.resolve(path, excludeNonNamespace) : this.ns;
|
35764 | };
|
35765 |
|
35766 | |
35767 |
|
35768 |
|
35769 |
|
35770 |
|
35771 | BuilderPrototype.toString = function() {
|
35772 | return "Builder";
|
35773 | };
|
35774 |
|
35775 |
|
35776 |
|
35777 |
|
35778 | |
35779 |
|
35780 |
|
35781 | Builder.Message = function() {};
|
35782 |
|
35783 | |
35784 |
|
35785 |
|
35786 | Builder.Enum = function() {};
|
35787 |
|
35788 | |
35789 |
|
35790 |
|
35791 | Builder.Service = function() {};
|
35792 |
|
35793 | return Builder;
|
35794 |
|
35795 | })(ProtoBuf, ProtoBuf.Lang, ProtoBuf.Reflect);
|
35796 |
|
35797 | |
35798 |
|
35799 |
|
35800 |
|
35801 | ProtoBuf.Map = (function(ProtoBuf, Reflect) {
|
35802 | "use strict";
|
35803 |
|
35804 | |
35805 |
|
35806 |
|
35807 |
|
35808 |
|
35809 |
|
35810 |
|
35811 |
|
35812 |
|
35813 |
|
35814 |
|
35815 | var Map = function(field, contents) {
|
35816 | if (!field.map)
|
35817 | throw Error("field is not a map");
|
35818 |
|
35819 | |
35820 |
|
35821 |
|
35822 |
|
35823 | this.field = field;
|
35824 |
|
35825 | |
35826 |
|
35827 |
|
35828 |
|
35829 | this.keyElem = new Reflect.Element(field.keyType, null, true, field.syntax);
|
35830 |
|
35831 | |
35832 |
|
35833 |
|
35834 |
|
35835 | this.valueElem = new Reflect.Element(field.type, field.resolvedType, false, field.syntax);
|
35836 |
|
35837 | |
35838 |
|
35839 |
|
35840 |
|
35841 |
|
35842 |
|
35843 |
|
35844 |
|
35845 |
|
35846 |
|
35847 |
|
35848 |
|
35849 |
|
35850 |
|
35851 | this.map = {};
|
35852 |
|
35853 | |
35854 |
|
35855 |
|
35856 | Object.defineProperty(this, "size", {
|
35857 | get: function() { return Object.keys(this.map).length; }
|
35858 | });
|
35859 |
|
35860 |
|
35861 | if (contents) {
|
35862 | var keys = Object.keys(contents);
|
35863 | for (var i = 0; i < keys.length; i++) {
|
35864 | var key = this.keyElem.valueFromString(keys[i]);
|
35865 | var val = this.valueElem.verifyValue(contents[keys[i]]);
|
35866 | this.map[this.keyElem.valueToString(key)] =
|
35867 | { key: key, value: val };
|
35868 | }
|
35869 | }
|
35870 | };
|
35871 |
|
35872 | var MapPrototype = Map.prototype;
|
35873 |
|
35874 | |
35875 |
|
35876 |
|
35877 |
|
35878 |
|
35879 |
|
35880 | function arrayIterator(arr) {
|
35881 | var idx = 0;
|
35882 | return {
|
35883 | next: function() {
|
35884 | if (idx < arr.length)
|
35885 | return { done: false, value: arr[idx++] };
|
35886 | return { done: true };
|
35887 | }
|
35888 | }
|
35889 | }
|
35890 |
|
35891 | |
35892 |
|
35893 |
|
35894 | MapPrototype.clear = function() {
|
35895 | this.map = {};
|
35896 | };
|
35897 |
|
35898 | |
35899 |
|
35900 |
|
35901 |
|
35902 | MapPrototype["delete"] = function(key) {
|
35903 | var keyValue = this.keyElem.valueToString(this.keyElem.verifyValue(key));
|
35904 | var hadKey = keyValue in this.map;
|
35905 | delete this.map[keyValue];
|
35906 | return hadKey;
|
35907 | };
|
35908 |
|
35909 | |
35910 |
|
35911 |
|
35912 |
|
35913 | MapPrototype.entries = function() {
|
35914 | var entries = [];
|
35915 | var strKeys = Object.keys(this.map);
|
35916 | for (var i = 0, entry; i < strKeys.length; i++)
|
35917 | entries.push([(entry=this.map[strKeys[i]]).key, entry.value]);
|
35918 | return arrayIterator(entries);
|
35919 | };
|
35920 |
|
35921 | |
35922 |
|
35923 |
|
35924 |
|
35925 | MapPrototype.keys = function() {
|
35926 | var keys = [];
|
35927 | var strKeys = Object.keys(this.map);
|
35928 | for (var i = 0; i < strKeys.length; i++)
|
35929 | keys.push(this.map[strKeys[i]].key);
|
35930 | return arrayIterator(keys);
|
35931 | };
|
35932 |
|
35933 | |
35934 |
|
35935 |
|
35936 |
|
35937 | MapPrototype.values = function() {
|
35938 | var values = [];
|
35939 | var strKeys = Object.keys(this.map);
|
35940 | for (var i = 0; i < strKeys.length; i++)
|
35941 | values.push(this.map[strKeys[i]].value);
|
35942 | return arrayIterator(values);
|
35943 | };
|
35944 |
|
35945 | |
35946 |
|
35947 |
|
35948 |
|
35949 |
|
35950 | MapPrototype.forEach = function(cb, thisArg) {
|
35951 | var strKeys = Object.keys(this.map);
|
35952 | for (var i = 0, entry; i < strKeys.length; i++)
|
35953 | cb.call(thisArg, (entry=this.map[strKeys[i]]).value, entry.key, this);
|
35954 | };
|
35955 |
|
35956 | |
35957 |
|
35958 |
|
35959 |
|
35960 |
|
35961 |
|
35962 | MapPrototype.set = function(key, value) {
|
35963 | var keyValue = this.keyElem.verifyValue(key);
|
35964 | var valValue = this.valueElem.verifyValue(value);
|
35965 | this.map[this.keyElem.valueToString(keyValue)] =
|
35966 | { key: keyValue, value: valValue };
|
35967 | return this;
|
35968 | };
|
35969 |
|
35970 | |
35971 |
|
35972 |
|
35973 |
|
35974 |
|
35975 | MapPrototype.get = function(key) {
|
35976 | var keyValue = this.keyElem.valueToString(this.keyElem.verifyValue(key));
|
35977 | if (!(keyValue in this.map))
|
35978 | return undefined;
|
35979 | return this.map[keyValue].value;
|
35980 | };
|
35981 |
|
35982 | |
35983 |
|
35984 |
|
35985 |
|
35986 |
|
35987 | MapPrototype.has = function(key) {
|
35988 | var keyValue = this.keyElem.valueToString(this.keyElem.verifyValue(key));
|
35989 | return (keyValue in this.map);
|
35990 | };
|
35991 |
|
35992 | return Map;
|
35993 | })(ProtoBuf, ProtoBuf.Reflect);
|
35994 |
|
35995 |
|
35996 | |
35997 |
|
35998 |
|
35999 |
|
36000 |
|
36001 |
|
36002 | ProtoBuf.newBuilder = function(options) {
|
36003 | options = options || {};
|
36004 | if (typeof options['convertFieldsToCamelCase'] === 'undefined')
|
36005 | options['convertFieldsToCamelCase'] = ProtoBuf.convertFieldsToCamelCase;
|
36006 | if (typeof options['populateAccessors'] === 'undefined')
|
36007 | options['populateAccessors'] = ProtoBuf.populateAccessors;
|
36008 | return new ProtoBuf.Builder(options);
|
36009 | };
|
36010 |
|
36011 | |
36012 |
|
36013 |
|
36014 |
|
36015 |
|
36016 |
|
36017 |
|
36018 |
|
36019 |
|
36020 | ProtoBuf.loadJson = function(json, builder, filename) {
|
36021 | if (typeof builder === 'string' || (builder && typeof builder["file"] === 'string' && typeof builder["root"] === 'string'))
|
36022 | filename = builder,
|
36023 | builder = null;
|
36024 | if (!builder || typeof builder !== 'object')
|
36025 | builder = ProtoBuf.newBuilder();
|
36026 | if (typeof json === 'string')
|
36027 | json = JSON.parse(json);
|
36028 | builder["import"](json, filename);
|
36029 | builder.resolveAll();
|
36030 | return builder;
|
36031 | };
|
36032 |
|
36033 | |
36034 |
|
36035 |
|
36036 |
|
36037 |
|
36038 |
|
36039 |
|
36040 |
|
36041 |
|
36042 |
|
36043 |
|
36044 |
|
36045 | ProtoBuf.loadJsonFile = function(filename, callback, builder) {
|
36046 | if (callback && typeof callback === 'object')
|
36047 | builder = callback,
|
36048 | callback = null;
|
36049 | else if (!callback || typeof callback !== 'function')
|
36050 | callback = null;
|
36051 | if (callback)
|
36052 | return ProtoBuf.Util.fetch(typeof filename === 'string' ? filename : filename["root"]+"/"+filename["file"], function(contents) {
|
36053 | if (contents === null) {
|
36054 | callback(Error("Failed to fetch file"));
|
36055 | return;
|
36056 | }
|
36057 | try {
|
36058 | callback(null, ProtoBuf.loadJson(JSON.parse(contents), builder, filename));
|
36059 | } catch (e) {
|
36060 | callback(e);
|
36061 | }
|
36062 | });
|
36063 | var contents = ProtoBuf.Util.fetch(typeof filename === 'object' ? filename["root"]+"/"+filename["file"] : filename);
|
36064 | return contents === null ? null : ProtoBuf.loadJson(JSON.parse(contents), builder, filename);
|
36065 | };
|
36066 |
|
36067 | return ProtoBuf;
|
36068 | });
|
36069 |
|
36070 |
|
36071 | }),
|
36072 |
|
36073 | (function(module, exports, __webpack_require__) {
|
36074 |
|
36075 | var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; |
36076 |
|
36077 |
|
36078 |
|
36079 |
|
36080 |
|
36081 |
|
36082 |
|
36083 |
|
36084 |
|
36085 |
|
36086 |
|
36087 |
|
36088 |
|
36089 |
|
36090 |
|
36091 |
|
36092 |
|
36093 |
|
36094 |
|
36095 |
|
36096 |
|
36097 | (function(global, factory) {
|
36098 |
|
36099 | if (true)
|
36100 | !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(616)], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
|
36101 | __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
|
36102 | (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
|
36103 | __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
|
36104 | else if (typeof require === 'function' && typeof module === "object" && module && module["exports"])
|
36105 | module['exports'] = (function() {
|
36106 | var Long; try { Long = require("long"); } catch (e) {}
|
36107 | return factory(Long);
|
36108 | })();
|
36109 | else
|
36110 | (global["dcodeIO"] = global["dcodeIO"] || {})["ByteBuffer"] = factory(global["dcodeIO"]["Long"]);
|
36111 |
|
36112 | })(this, function(Long) {
|
36113 | "use strict";
|
36114 |
|
36115 | |
36116 |
|
36117 |
|
36118 |
|
36119 |
|
36120 |
|
36121 |
|
36122 |
|
36123 |
|
36124 |
|
36125 |
|
36126 |
|
36127 | var ByteBuffer = function(capacity, littleEndian, noAssert) {
|
36128 | if (typeof capacity === 'undefined')
|
36129 | capacity = ByteBuffer.DEFAULT_CAPACITY;
|
36130 | if (typeof littleEndian === 'undefined')
|
36131 | littleEndian = ByteBuffer.DEFAULT_ENDIAN;
|
36132 | if (typeof noAssert === 'undefined')
|
36133 | noAssert = ByteBuffer.DEFAULT_NOASSERT;
|
36134 | if (!noAssert) {
|
36135 | capacity = capacity | 0;
|
36136 | if (capacity < 0)
|
36137 | throw RangeError("Illegal capacity");
|
36138 | littleEndian = !!littleEndian;
|
36139 | noAssert = !!noAssert;
|
36140 | }
|
36141 |
|
36142 | |
36143 |
|
36144 |
|
36145 |
|
36146 |
|
36147 | this.buffer = capacity === 0 ? EMPTY_BUFFER : new ArrayBuffer(capacity);
|
36148 |
|
36149 | |
36150 |
|
36151 |
|
36152 |
|
36153 |
|
36154 | this.view = capacity === 0 ? null : new Uint8Array(this.buffer);
|
36155 |
|
36156 | |
36157 |
|
36158 |
|
36159 |
|
36160 |
|
36161 |
|
36162 |
|
36163 | this.offset = 0;
|
36164 |
|
36165 | |
36166 |
|
36167 |
|
36168 |
|
36169 |
|
36170 |
|
36171 |
|
36172 | this.markedOffset = -1;
|
36173 |
|
36174 | |
36175 |
|
36176 |
|
36177 |
|
36178 |
|
36179 |
|
36180 |
|
36181 | this.limit = capacity;
|
36182 |
|
36183 | |
36184 |
|
36185 |
|
36186 |
|
36187 |
|
36188 | this.littleEndian = littleEndian;
|
36189 |
|
36190 | |
36191 |
|
36192 |
|
36193 |
|
36194 |
|
36195 | this.noAssert = noAssert;
|
36196 | };
|
36197 |
|
36198 | |
36199 |
|
36200 |
|
36201 |
|
36202 |
|
36203 |
|
36204 | ByteBuffer.VERSION = "5.0.1";
|
36205 |
|
36206 | |
36207 |
|
36208 |
|
36209 |
|
36210 |
|
36211 |
|
36212 | ByteBuffer.LITTLE_ENDIAN = true;
|
36213 |
|
36214 | |
36215 |
|
36216 |
|
36217 |
|
36218 |
|
36219 |
|
36220 | ByteBuffer.BIG_ENDIAN = false;
|
36221 |
|
36222 | |
36223 |
|
36224 |
|
36225 |
|
36226 |
|
36227 | ByteBuffer.DEFAULT_CAPACITY = 16;
|
36228 |
|
36229 | |
36230 |
|
36231 |
|
36232 |
|
36233 |
|
36234 | ByteBuffer.DEFAULT_ENDIAN = ByteBuffer.BIG_ENDIAN;
|
36235 |
|
36236 | |
36237 |
|
36238 |
|
36239 |
|
36240 |
|
36241 | ByteBuffer.DEFAULT_NOASSERT = false;
|
36242 |
|
36243 | |
36244 |
|
36245 |
|
36246 |
|
36247 |
|
36248 |
|
36249 |
|
36250 |
|
36251 | ByteBuffer.Long = Long || null;
|
36252 |
|
36253 | |
36254 |
|
36255 |
|
36256 |
|
36257 | var ByteBufferPrototype = ByteBuffer.prototype;
|
36258 |
|
36259 | |
36260 |
|
36261 |
|
36262 |
|
36263 |
|
36264 |
|
36265 |
|
36266 | ByteBufferPrototype.__isByteBuffer__;
|
36267 |
|
36268 | Object.defineProperty(ByteBufferPrototype, "__isByteBuffer__", {
|
36269 | value: true,
|
36270 | enumerable: false,
|
36271 | configurable: false
|
36272 | });
|
36273 |
|
36274 |
|
36275 |
|
36276 | |
36277 |
|
36278 |
|
36279 |
|
36280 | var EMPTY_BUFFER = new ArrayBuffer(0);
|
36281 |
|
36282 | |
36283 |
|
36284 |
|
36285 |
|
36286 |
|
36287 | var stringFromCharCode = String.fromCharCode;
|
36288 |
|
36289 | |
36290 |
|
36291 |
|
36292 |
|
36293 |
|
36294 |
|
36295 |
|
36296 |
|
36297 | function stringSource(s) {
|
36298 | var i=0; return function() {
|
36299 | return i < s.length ? s.charCodeAt(i++) : null;
|
36300 | };
|
36301 | }
|
36302 |
|
36303 | |
36304 |
|
36305 |
|
36306 |
|
36307 |
|
36308 |
|
36309 | function stringDestination() {
|
36310 | var cs = [], ps = []; return function() {
|
36311 | if (arguments.length === 0)
|
36312 | return ps.join('')+stringFromCharCode.apply(String, cs);
|
36313 | if (cs.length + arguments.length > 1024)
|
36314 | ps.push(stringFromCharCode.apply(String, cs)),
|
36315 | cs.length = 0;
|
36316 | Array.prototype.push.apply(cs, arguments);
|
36317 | };
|
36318 | }
|
36319 |
|
36320 | |
36321 |
|
36322 |
|
36323 |
|
36324 |
|
36325 | ByteBuffer.accessor = function() {
|
36326 | return Uint8Array;
|
36327 | };
|
36328 | |
36329 |
|
36330 |
|
36331 |
|
36332 |
|
36333 |
|
36334 |
|
36335 |
|
36336 |
|
36337 |
|
36338 | ByteBuffer.allocate = function(capacity, littleEndian, noAssert) {
|
36339 | return new ByteBuffer(capacity, littleEndian, noAssert);
|
36340 | };
|
36341 |
|
36342 | |
36343 |
|
36344 |
|
36345 |
|
36346 |
|
36347 |
|
36348 |
|
36349 |
|
36350 |
|
36351 |
|
36352 |
|
36353 |
|
36354 | ByteBuffer.concat = function(buffers, encoding, littleEndian, noAssert) {
|
36355 | if (typeof encoding === 'boolean' || typeof encoding !== 'string') {
|
36356 | noAssert = littleEndian;
|
36357 | littleEndian = encoding;
|
36358 | encoding = undefined;
|
36359 | }
|
36360 | var capacity = 0;
|
36361 | for (var i=0, k=buffers.length, length; i<k; ++i) {
|
36362 | if (!ByteBuffer.isByteBuffer(buffers[i]))
|
36363 | buffers[i] = ByteBuffer.wrap(buffers[i], encoding);
|
36364 | length = buffers[i].limit - buffers[i].offset;
|
36365 | if (length > 0) capacity += length;
|
36366 | }
|
36367 | if (capacity === 0)
|
36368 | return new ByteBuffer(0, littleEndian, noAssert);
|
36369 | var bb = new ByteBuffer(capacity, littleEndian, noAssert),
|
36370 | bi;
|
36371 | i=0; while (i<k) {
|
36372 | bi = buffers[i++];
|
36373 | length = bi.limit - bi.offset;
|
36374 | if (length <= 0) continue;
|
36375 | bb.view.set(bi.view.subarray(bi.offset, bi.limit), bb.offset);
|
36376 | bb.offset += length;
|
36377 | }
|
36378 | bb.limit = bb.offset;
|
36379 | bb.offset = 0;
|
36380 | return bb;
|
36381 | };
|
36382 |
|
36383 | |
36384 |
|
36385 |
|
36386 |
|
36387 |
|
36388 |
|
36389 | ByteBuffer.isByteBuffer = function(bb) {
|
36390 | return (bb && bb["__isByteBuffer__"]) === true;
|
36391 | };
|
36392 | |
36393 |
|
36394 |
|
36395 |
|
36396 |
|
36397 | ByteBuffer.type = function() {
|
36398 | return ArrayBuffer;
|
36399 | };
|
36400 | |
36401 |
|
36402 |
|
36403 |
|
36404 |
|
36405 |
|
36406 |
|
36407 |
|
36408 |
|
36409 |
|
36410 |
|
36411 |
|
36412 |
|
36413 | ByteBuffer.wrap = function(buffer, encoding, littleEndian, noAssert) {
|
36414 | if (typeof encoding !== 'string') {
|
36415 | noAssert = littleEndian;
|
36416 | littleEndian = encoding;
|
36417 | encoding = undefined;
|
36418 | }
|
36419 | if (typeof buffer === 'string') {
|
36420 | if (typeof encoding === 'undefined')
|
36421 | encoding = "utf8";
|
36422 | switch (encoding) {
|
36423 | case "base64":
|
36424 | return ByteBuffer.fromBase64(buffer, littleEndian);
|
36425 | case "hex":
|
36426 | return ByteBuffer.fromHex(buffer, littleEndian);
|
36427 | case "binary":
|
36428 | return ByteBuffer.fromBinary(buffer, littleEndian);
|
36429 | case "utf8":
|
36430 | return ByteBuffer.fromUTF8(buffer, littleEndian);
|
36431 | case "debug":
|
36432 | return ByteBuffer.fromDebug(buffer, littleEndian);
|
36433 | default:
|
36434 | throw Error("Unsupported encoding: "+encoding);
|
36435 | }
|
36436 | }
|
36437 | if (buffer === null || typeof buffer !== 'object')
|
36438 | throw TypeError("Illegal buffer");
|
36439 | var bb;
|
36440 | if (ByteBuffer.isByteBuffer(buffer)) {
|
36441 | bb = ByteBufferPrototype.clone.call(buffer);
|
36442 | bb.markedOffset = -1;
|
36443 | return bb;
|
36444 | }
|
36445 | if (buffer instanceof Uint8Array) {
|
36446 | bb = new ByteBuffer(0, littleEndian, noAssert);
|
36447 | if (buffer.length > 0) {
|
36448 | bb.buffer = buffer.buffer;
|
36449 | bb.offset = buffer.byteOffset;
|
36450 | bb.limit = buffer.byteOffset + buffer.byteLength;
|
36451 | bb.view = new Uint8Array(buffer.buffer);
|
36452 | }
|
36453 | } else if (buffer instanceof ArrayBuffer) {
|
36454 | bb = new ByteBuffer(0, littleEndian, noAssert);
|
36455 | if (buffer.byteLength > 0) {
|
36456 | bb.buffer = buffer;
|
36457 | bb.offset = 0;
|
36458 | bb.limit = buffer.byteLength;
|
36459 | bb.view = buffer.byteLength > 0 ? new Uint8Array(buffer) : null;
|
36460 | }
|
36461 | } else if (Object.prototype.toString.call(buffer) === "[object Array]") {
|
36462 | bb = new ByteBuffer(buffer.length, littleEndian, noAssert);
|
36463 | bb.limit = buffer.length;
|
36464 | for (var i=0; i<buffer.length; ++i)
|
36465 | bb.view[i] = buffer[i];
|
36466 | } else
|
36467 | throw TypeError("Illegal buffer");
|
36468 | return bb;
|
36469 | };
|
36470 |
|
36471 | |
36472 |
|
36473 |
|
36474 |
|
36475 |
|
36476 |
|
36477 |
|
36478 | ByteBufferPrototype.writeBitSet = function(value, offset) {
|
36479 | var relative = typeof offset === 'undefined';
|
36480 | if (relative) offset = this.offset;
|
36481 | if (!this.noAssert) {
|
36482 | if (!(value instanceof Array))
|
36483 | throw TypeError("Illegal BitSet: Not an array");
|
36484 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
36485 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
36486 | offset >>>= 0;
|
36487 | if (offset < 0 || offset + 0 > this.buffer.byteLength)
|
36488 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength);
|
36489 | }
|
36490 |
|
36491 | var start = offset,
|
36492 | bits = value.length,
|
36493 | bytes = (bits >> 3),
|
36494 | bit = 0,
|
36495 | k;
|
36496 |
|
36497 | offset += this.writeVarint32(bits,offset);
|
36498 |
|
36499 | while(bytes--) {
|
36500 | k = (!!value[bit++] & 1) |
|
36501 | ((!!value[bit++] & 1) << 1) |
|
36502 | ((!!value[bit++] & 1) << 2) |
|
36503 | ((!!value[bit++] & 1) << 3) |
|
36504 | ((!!value[bit++] & 1) << 4) |
|
36505 | ((!!value[bit++] & 1) << 5) |
|
36506 | ((!!value[bit++] & 1) << 6) |
|
36507 | ((!!value[bit++] & 1) << 7);
|
36508 | this.writeByte(k,offset++);
|
36509 | }
|
36510 |
|
36511 | if(bit < bits) {
|
36512 | var m = 0; k = 0;
|
36513 | while(bit < bits) k = k | ((!!value[bit++] & 1) << (m++));
|
36514 | this.writeByte(k,offset++);
|
36515 | }
|
36516 |
|
36517 | if (relative) {
|
36518 | this.offset = offset;
|
36519 | return this;
|
36520 | }
|
36521 | return offset - start;
|
36522 | }
|
36523 |
|
36524 | |
36525 |
|
36526 |
|
36527 |
|
36528 |
|
36529 |
|
36530 | ByteBufferPrototype.readBitSet = function(offset) {
|
36531 | var relative = typeof offset === 'undefined';
|
36532 | if (relative) offset = this.offset;
|
36533 |
|
36534 | var ret = this.readVarint32(offset),
|
36535 | bits = ret.value,
|
36536 | bytes = (bits >> 3),
|
36537 | bit = 0,
|
36538 | value = [],
|
36539 | k;
|
36540 |
|
36541 | offset += ret.length;
|
36542 |
|
36543 | while(bytes--) {
|
36544 | k = this.readByte(offset++);
|
36545 | value[bit++] = !!(k & 0x01);
|
36546 | value[bit++] = !!(k & 0x02);
|
36547 | value[bit++] = !!(k & 0x04);
|
36548 | value[bit++] = !!(k & 0x08);
|
36549 | value[bit++] = !!(k & 0x10);
|
36550 | value[bit++] = !!(k & 0x20);
|
36551 | value[bit++] = !!(k & 0x40);
|
36552 | value[bit++] = !!(k & 0x80);
|
36553 | }
|
36554 |
|
36555 | if(bit < bits) {
|
36556 | var m = 0;
|
36557 | k = this.readByte(offset++);
|
36558 | while(bit < bits) value[bit++] = !!((k >> (m++)) & 1);
|
36559 | }
|
36560 |
|
36561 | if (relative) {
|
36562 | this.offset = offset;
|
36563 | }
|
36564 | return value;
|
36565 | }
|
36566 | |
36567 |
|
36568 |
|
36569 |
|
36570 |
|
36571 |
|
36572 |
|
36573 | ByteBufferPrototype.readBytes = function(length, offset) {
|
36574 | var relative = typeof offset === 'undefined';
|
36575 | if (relative) offset = this.offset;
|
36576 | if (!this.noAssert) {
|
36577 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
36578 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
36579 | offset >>>= 0;
|
36580 | if (offset < 0 || offset + length > this.buffer.byteLength)
|
36581 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+length+") <= "+this.buffer.byteLength);
|
36582 | }
|
36583 | var slice = this.slice(offset, offset + length);
|
36584 | if (relative) this.offset += length;
|
36585 | return slice;
|
36586 | };
|
36587 |
|
36588 | |
36589 |
|
36590 |
|
36591 |
|
36592 |
|
36593 |
|
36594 |
|
36595 |
|
36596 |
|
36597 |
|
36598 |
|
36599 | ByteBufferPrototype.writeBytes = ByteBufferPrototype.append;
|
36600 |
|
36601 |
|
36602 |
|
36603 | |
36604 |
|
36605 |
|
36606 |
|
36607 |
|
36608 |
|
36609 |
|
36610 | ByteBufferPrototype.writeInt8 = function(value, offset) {
|
36611 | var relative = typeof offset === 'undefined';
|
36612 | if (relative) offset = this.offset;
|
36613 | if (!this.noAssert) {
|
36614 | if (typeof value !== 'number' || value % 1 !== 0)
|
36615 | throw TypeError("Illegal value: "+value+" (not an integer)");
|
36616 | value |= 0;
|
36617 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
36618 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
36619 | offset >>>= 0;
|
36620 | if (offset < 0 || offset + 0 > this.buffer.byteLength)
|
36621 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength);
|
36622 | }
|
36623 | offset += 1;
|
36624 | var capacity0 = this.buffer.byteLength;
|
36625 | if (offset > capacity0)
|
36626 | this.resize((capacity0 *= 2) > offset ? capacity0 : offset);
|
36627 | offset -= 1;
|
36628 | this.view[offset] = value;
|
36629 | if (relative) this.offset += 1;
|
36630 | return this;
|
36631 | };
|
36632 |
|
36633 | |
36634 |
|
36635 |
|
36636 |
|
36637 |
|
36638 |
|
36639 |
|
36640 |
|
36641 | ByteBufferPrototype.writeByte = ByteBufferPrototype.writeInt8;
|
36642 |
|
36643 | |
36644 |
|
36645 |
|
36646 |
|
36647 |
|
36648 |
|
36649 | ByteBufferPrototype.readInt8 = function(offset) {
|
36650 | var relative = typeof offset === 'undefined';
|
36651 | if (relative) offset = this.offset;
|
36652 | if (!this.noAssert) {
|
36653 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
36654 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
36655 | offset >>>= 0;
|
36656 | if (offset < 0 || offset + 1 > this.buffer.byteLength)
|
36657 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+1+") <= "+this.buffer.byteLength);
|
36658 | }
|
36659 | var value = this.view[offset];
|
36660 | if ((value & 0x80) === 0x80) value = -(0xFF - value + 1);
|
36661 | if (relative) this.offset += 1;
|
36662 | return value;
|
36663 | };
|
36664 |
|
36665 | |
36666 |
|
36667 |
|
36668 |
|
36669 |
|
36670 |
|
36671 |
|
36672 | ByteBufferPrototype.readByte = ByteBufferPrototype.readInt8;
|
36673 |
|
36674 | |
36675 |
|
36676 |
|
36677 |
|
36678 |
|
36679 |
|
36680 |
|
36681 | ByteBufferPrototype.writeUint8 = function(value, offset) {
|
36682 | var relative = typeof offset === 'undefined';
|
36683 | if (relative) offset = this.offset;
|
36684 | if (!this.noAssert) {
|
36685 | if (typeof value !== 'number' || value % 1 !== 0)
|
36686 | throw TypeError("Illegal value: "+value+" (not an integer)");
|
36687 | value >>>= 0;
|
36688 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
36689 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
36690 | offset >>>= 0;
|
36691 | if (offset < 0 || offset + 0 > this.buffer.byteLength)
|
36692 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength);
|
36693 | }
|
36694 | offset += 1;
|
36695 | var capacity1 = this.buffer.byteLength;
|
36696 | if (offset > capacity1)
|
36697 | this.resize((capacity1 *= 2) > offset ? capacity1 : offset);
|
36698 | offset -= 1;
|
36699 | this.view[offset] = value;
|
36700 | if (relative) this.offset += 1;
|
36701 | return this;
|
36702 | };
|
36703 |
|
36704 | |
36705 |
|
36706 |
|
36707 |
|
36708 |
|
36709 |
|
36710 |
|
36711 |
|
36712 | ByteBufferPrototype.writeUInt8 = ByteBufferPrototype.writeUint8;
|
36713 |
|
36714 | |
36715 |
|
36716 |
|
36717 |
|
36718 |
|
36719 |
|
36720 | ByteBufferPrototype.readUint8 = function(offset) {
|
36721 | var relative = typeof offset === 'undefined';
|
36722 | if (relative) offset = this.offset;
|
36723 | if (!this.noAssert) {
|
36724 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
36725 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
36726 | offset >>>= 0;
|
36727 | if (offset < 0 || offset + 1 > this.buffer.byteLength)
|
36728 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+1+") <= "+this.buffer.byteLength);
|
36729 | }
|
36730 | var value = this.view[offset];
|
36731 | if (relative) this.offset += 1;
|
36732 | return value;
|
36733 | };
|
36734 |
|
36735 | |
36736 |
|
36737 |
|
36738 |
|
36739 |
|
36740 |
|
36741 |
|
36742 | ByteBufferPrototype.readUInt8 = ByteBufferPrototype.readUint8;
|
36743 |
|
36744 |
|
36745 |
|
36746 | |
36747 |
|
36748 |
|
36749 |
|
36750 |
|
36751 |
|
36752 |
|
36753 |
|
36754 | ByteBufferPrototype.writeInt16 = function(value, offset) {
|
36755 | var relative = typeof offset === 'undefined';
|
36756 | if (relative) offset = this.offset;
|
36757 | if (!this.noAssert) {
|
36758 | if (typeof value !== 'number' || value % 1 !== 0)
|
36759 | throw TypeError("Illegal value: "+value+" (not an integer)");
|
36760 | value |= 0;
|
36761 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
36762 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
36763 | offset >>>= 0;
|
36764 | if (offset < 0 || offset + 0 > this.buffer.byteLength)
|
36765 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength);
|
36766 | }
|
36767 | offset += 2;
|
36768 | var capacity2 = this.buffer.byteLength;
|
36769 | if (offset > capacity2)
|
36770 | this.resize((capacity2 *= 2) > offset ? capacity2 : offset);
|
36771 | offset -= 2;
|
36772 | if (this.littleEndian) {
|
36773 | this.view[offset+1] = (value & 0xFF00) >>> 8;
|
36774 | this.view[offset ] = value & 0x00FF;
|
36775 | } else {
|
36776 | this.view[offset] = (value & 0xFF00) >>> 8;
|
36777 | this.view[offset+1] = value & 0x00FF;
|
36778 | }
|
36779 | if (relative) this.offset += 2;
|
36780 | return this;
|
36781 | };
|
36782 |
|
36783 | |
36784 |
|
36785 |
|
36786 |
|
36787 |
|
36788 |
|
36789 |
|
36790 |
|
36791 |
|
36792 | ByteBufferPrototype.writeShort = ByteBufferPrototype.writeInt16;
|
36793 |
|
36794 | |
36795 |
|
36796 |
|
36797 |
|
36798 |
|
36799 |
|
36800 |
|
36801 |
|
36802 | ByteBufferPrototype.readInt16 = function(offset) {
|
36803 | var relative = typeof offset === 'undefined';
|
36804 | if (relative) offset = this.offset;
|
36805 | if (!this.noAssert) {
|
36806 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
36807 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
36808 | offset >>>= 0;
|
36809 | if (offset < 0 || offset + 2 > this.buffer.byteLength)
|
36810 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+2+") <= "+this.buffer.byteLength);
|
36811 | }
|
36812 | var value = 0;
|
36813 | if (this.littleEndian) {
|
36814 | value = this.view[offset ];
|
36815 | value |= this.view[offset+1] << 8;
|
36816 | } else {
|
36817 | value = this.view[offset ] << 8;
|
36818 | value |= this.view[offset+1];
|
36819 | }
|
36820 | if ((value & 0x8000) === 0x8000) value = -(0xFFFF - value + 1);
|
36821 | if (relative) this.offset += 2;
|
36822 | return value;
|
36823 | };
|
36824 |
|
36825 | |
36826 |
|
36827 |
|
36828 |
|
36829 |
|
36830 |
|
36831 |
|
36832 |
|
36833 |
|
36834 | ByteBufferPrototype.readShort = ByteBufferPrototype.readInt16;
|
36835 |
|
36836 | |
36837 |
|
36838 |
|
36839 |
|
36840 |
|
36841 |
|
36842 |
|
36843 |
|
36844 | ByteBufferPrototype.writeUint16 = function(value, offset) {
|
36845 | var relative = typeof offset === 'undefined';
|
36846 | if (relative) offset = this.offset;
|
36847 | if (!this.noAssert) {
|
36848 | if (typeof value !== 'number' || value % 1 !== 0)
|
36849 | throw TypeError("Illegal value: "+value+" (not an integer)");
|
36850 | value >>>= 0;
|
36851 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
36852 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
36853 | offset >>>= 0;
|
36854 | if (offset < 0 || offset + 0 > this.buffer.byteLength)
|
36855 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength);
|
36856 | }
|
36857 | offset += 2;
|
36858 | var capacity3 = this.buffer.byteLength;
|
36859 | if (offset > capacity3)
|
36860 | this.resize((capacity3 *= 2) > offset ? capacity3 : offset);
|
36861 | offset -= 2;
|
36862 | if (this.littleEndian) {
|
36863 | this.view[offset+1] = (value & 0xFF00) >>> 8;
|
36864 | this.view[offset ] = value & 0x00FF;
|
36865 | } else {
|
36866 | this.view[offset] = (value & 0xFF00) >>> 8;
|
36867 | this.view[offset+1] = value & 0x00FF;
|
36868 | }
|
36869 | if (relative) this.offset += 2;
|
36870 | return this;
|
36871 | };
|
36872 |
|
36873 | |
36874 |
|
36875 |
|
36876 |
|
36877 |
|
36878 |
|
36879 |
|
36880 |
|
36881 |
|
36882 | ByteBufferPrototype.writeUInt16 = ByteBufferPrototype.writeUint16;
|
36883 |
|
36884 | |
36885 |
|
36886 |
|
36887 |
|
36888 |
|
36889 |
|
36890 |
|
36891 |
|
36892 | ByteBufferPrototype.readUint16 = function(offset) {
|
36893 | var relative = typeof offset === 'undefined';
|
36894 | if (relative) offset = this.offset;
|
36895 | if (!this.noAssert) {
|
36896 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
36897 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
36898 | offset >>>= 0;
|
36899 | if (offset < 0 || offset + 2 > this.buffer.byteLength)
|
36900 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+2+") <= "+this.buffer.byteLength);
|
36901 | }
|
36902 | var value = 0;
|
36903 | if (this.littleEndian) {
|
36904 | value = this.view[offset ];
|
36905 | value |= this.view[offset+1] << 8;
|
36906 | } else {
|
36907 | value = this.view[offset ] << 8;
|
36908 | value |= this.view[offset+1];
|
36909 | }
|
36910 | if (relative) this.offset += 2;
|
36911 | return value;
|
36912 | };
|
36913 |
|
36914 | |
36915 |
|
36916 |
|
36917 |
|
36918 |
|
36919 |
|
36920 |
|
36921 |
|
36922 |
|
36923 | ByteBufferPrototype.readUInt16 = ByteBufferPrototype.readUint16;
|
36924 |
|
36925 |
|
36926 |
|
36927 | |
36928 |
|
36929 |
|
36930 |
|
36931 |
|
36932 |
|
36933 | ByteBufferPrototype.writeInt32 = function(value, offset) {
|
36934 | var relative = typeof offset === 'undefined';
|
36935 | if (relative) offset = this.offset;
|
36936 | if (!this.noAssert) {
|
36937 | if (typeof value !== 'number' || value % 1 !== 0)
|
36938 | throw TypeError("Illegal value: "+value+" (not an integer)");
|
36939 | value |= 0;
|
36940 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
36941 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
36942 | offset >>>= 0;
|
36943 | if (offset < 0 || offset + 0 > this.buffer.byteLength)
|
36944 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength);
|
36945 | }
|
36946 | offset += 4;
|
36947 | var capacity4 = this.buffer.byteLength;
|
36948 | if (offset > capacity4)
|
36949 | this.resize((capacity4 *= 2) > offset ? capacity4 : offset);
|
36950 | offset -= 4;
|
36951 | if (this.littleEndian) {
|
36952 | this.view[offset+3] = (value >>> 24) & 0xFF;
|
36953 | this.view[offset+2] = (value >>> 16) & 0xFF;
|
36954 | this.view[offset+1] = (value >>> 8) & 0xFF;
|
36955 | this.view[offset ] = value & 0xFF;
|
36956 | } else {
|
36957 | this.view[offset ] = (value >>> 24) & 0xFF;
|
36958 | this.view[offset+1] = (value >>> 16) & 0xFF;
|
36959 | this.view[offset+2] = (value >>> 8) & 0xFF;
|
36960 | this.view[offset+3] = value & 0xFF;
|
36961 | }
|
36962 | if (relative) this.offset += 4;
|
36963 | return this;
|
36964 | };
|
36965 |
|
36966 | |
36967 |
|
36968 |
|
36969 |
|
36970 |
|
36971 |
|
36972 | ByteBufferPrototype.writeInt = ByteBufferPrototype.writeInt32;
|
36973 |
|
36974 | |
36975 |
|
36976 |
|
36977 |
|
36978 |
|
36979 |
|
36980 | ByteBufferPrototype.readInt32 = function(offset) {
|
36981 | var relative = typeof offset === 'undefined';
|
36982 | if (relative) offset = this.offset;
|
36983 | if (!this.noAssert) {
|
36984 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
36985 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
36986 | offset >>>= 0;
|
36987 | if (offset < 0 || offset + 4 > this.buffer.byteLength)
|
36988 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+4+") <= "+this.buffer.byteLength);
|
36989 | }
|
36990 | var value = 0;
|
36991 | if (this.littleEndian) {
|
36992 | value = this.view[offset+2] << 16;
|
36993 | value |= this.view[offset+1] << 8;
|
36994 | value |= this.view[offset ];
|
36995 | value += this.view[offset+3] << 24 >>> 0;
|
36996 | } else {
|
36997 | value = this.view[offset+1] << 16;
|
36998 | value |= this.view[offset+2] << 8;
|
36999 | value |= this.view[offset+3];
|
37000 | value += this.view[offset ] << 24 >>> 0;
|
37001 | }
|
37002 | value |= 0;
|
37003 | if (relative) this.offset += 4;
|
37004 | return value;
|
37005 | };
|
37006 |
|
37007 | |
37008 |
|
37009 |
|
37010 |
|
37011 |
|
37012 |
|
37013 | ByteBufferPrototype.readInt = ByteBufferPrototype.readInt32;
|
37014 |
|
37015 | |
37016 |
|
37017 |
|
37018 |
|
37019 |
|
37020 |
|
37021 | ByteBufferPrototype.writeUint32 = function(value, offset) {
|
37022 | var relative = typeof offset === 'undefined';
|
37023 | if (relative) offset = this.offset;
|
37024 | if (!this.noAssert) {
|
37025 | if (typeof value !== 'number' || value % 1 !== 0)
|
37026 | throw TypeError("Illegal value: "+value+" (not an integer)");
|
37027 | value >>>= 0;
|
37028 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
37029 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
37030 | offset >>>= 0;
|
37031 | if (offset < 0 || offset + 0 > this.buffer.byteLength)
|
37032 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength);
|
37033 | }
|
37034 | offset += 4;
|
37035 | var capacity5 = this.buffer.byteLength;
|
37036 | if (offset > capacity5)
|
37037 | this.resize((capacity5 *= 2) > offset ? capacity5 : offset);
|
37038 | offset -= 4;
|
37039 | if (this.littleEndian) {
|
37040 | this.view[offset+3] = (value >>> 24) & 0xFF;
|
37041 | this.view[offset+2] = (value >>> 16) & 0xFF;
|
37042 | this.view[offset+1] = (value >>> 8) & 0xFF;
|
37043 | this.view[offset ] = value & 0xFF;
|
37044 | } else {
|
37045 | this.view[offset ] = (value >>> 24) & 0xFF;
|
37046 | this.view[offset+1] = (value >>> 16) & 0xFF;
|
37047 | this.view[offset+2] = (value >>> 8) & 0xFF;
|
37048 | this.view[offset+3] = value & 0xFF;
|
37049 | }
|
37050 | if (relative) this.offset += 4;
|
37051 | return this;
|
37052 | };
|
37053 |
|
37054 | |
37055 |
|
37056 |
|
37057 |
|
37058 |
|
37059 |
|
37060 |
|
37061 | ByteBufferPrototype.writeUInt32 = ByteBufferPrototype.writeUint32;
|
37062 |
|
37063 | |
37064 |
|
37065 |
|
37066 |
|
37067 |
|
37068 |
|
37069 | ByteBufferPrototype.readUint32 = function(offset) {
|
37070 | var relative = typeof offset === 'undefined';
|
37071 | if (relative) offset = this.offset;
|
37072 | if (!this.noAssert) {
|
37073 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
37074 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
37075 | offset >>>= 0;
|
37076 | if (offset < 0 || offset + 4 > this.buffer.byteLength)
|
37077 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+4+") <= "+this.buffer.byteLength);
|
37078 | }
|
37079 | var value = 0;
|
37080 | if (this.littleEndian) {
|
37081 | value = this.view[offset+2] << 16;
|
37082 | value |= this.view[offset+1] << 8;
|
37083 | value |= this.view[offset ];
|
37084 | value += this.view[offset+3] << 24 >>> 0;
|
37085 | } else {
|
37086 | value = this.view[offset+1] << 16;
|
37087 | value |= this.view[offset+2] << 8;
|
37088 | value |= this.view[offset+3];
|
37089 | value += this.view[offset ] << 24 >>> 0;
|
37090 | }
|
37091 | if (relative) this.offset += 4;
|
37092 | return value;
|
37093 | };
|
37094 |
|
37095 | |
37096 |
|
37097 |
|
37098 |
|
37099 |
|
37100 |
|
37101 |
|
37102 | ByteBufferPrototype.readUInt32 = ByteBufferPrototype.readUint32;
|
37103 |
|
37104 |
|
37105 |
|
37106 | if (Long) {
|
37107 |
|
37108 | |
37109 |
|
37110 |
|
37111 |
|
37112 |
|
37113 |
|
37114 |
|
37115 | ByteBufferPrototype.writeInt64 = function(value, offset) {
|
37116 | var relative = typeof offset === 'undefined';
|
37117 | if (relative) offset = this.offset;
|
37118 | if (!this.noAssert) {
|
37119 | if (typeof value === 'number')
|
37120 | value = Long.fromNumber(value);
|
37121 | else if (typeof value === 'string')
|
37122 | value = Long.fromString(value);
|
37123 | else if (!(value && value instanceof Long))
|
37124 | throw TypeError("Illegal value: "+value+" (not an integer or Long)");
|
37125 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
37126 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
37127 | offset >>>= 0;
|
37128 | if (offset < 0 || offset + 0 > this.buffer.byteLength)
|
37129 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength);
|
37130 | }
|
37131 | if (typeof value === 'number')
|
37132 | value = Long.fromNumber(value);
|
37133 | else if (typeof value === 'string')
|
37134 | value = Long.fromString(value);
|
37135 | offset += 8;
|
37136 | var capacity6 = this.buffer.byteLength;
|
37137 | if (offset > capacity6)
|
37138 | this.resize((capacity6 *= 2) > offset ? capacity6 : offset);
|
37139 | offset -= 8;
|
37140 | var lo = value.low,
|
37141 | hi = value.high;
|
37142 | if (this.littleEndian) {
|
37143 | this.view[offset+3] = (lo >>> 24) & 0xFF;
|
37144 | this.view[offset+2] = (lo >>> 16) & 0xFF;
|
37145 | this.view[offset+1] = (lo >>> 8) & 0xFF;
|
37146 | this.view[offset ] = lo & 0xFF;
|
37147 | offset += 4;
|
37148 | this.view[offset+3] = (hi >>> 24) & 0xFF;
|
37149 | this.view[offset+2] = (hi >>> 16) & 0xFF;
|
37150 | this.view[offset+1] = (hi >>> 8) & 0xFF;
|
37151 | this.view[offset ] = hi & 0xFF;
|
37152 | } else {
|
37153 | this.view[offset ] = (hi >>> 24) & 0xFF;
|
37154 | this.view[offset+1] = (hi >>> 16) & 0xFF;
|
37155 | this.view[offset+2] = (hi >>> 8) & 0xFF;
|
37156 | this.view[offset+3] = hi & 0xFF;
|
37157 | offset += 4;
|
37158 | this.view[offset ] = (lo >>> 24) & 0xFF;
|
37159 | this.view[offset+1] = (lo >>> 16) & 0xFF;
|
37160 | this.view[offset+2] = (lo >>> 8) & 0xFF;
|
37161 | this.view[offset+3] = lo & 0xFF;
|
37162 | }
|
37163 | if (relative) this.offset += 8;
|
37164 | return this;
|
37165 | };
|
37166 |
|
37167 | |
37168 |
|
37169 |
|
37170 |
|
37171 |
|
37172 |
|
37173 |
|
37174 | ByteBufferPrototype.writeLong = ByteBufferPrototype.writeInt64;
|
37175 |
|
37176 | |
37177 |
|
37178 |
|
37179 |
|
37180 |
|
37181 |
|
37182 | ByteBufferPrototype.readInt64 = function(offset) {
|
37183 | var relative = typeof offset === 'undefined';
|
37184 | if (relative) offset = this.offset;
|
37185 | if (!this.noAssert) {
|
37186 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
37187 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
37188 | offset >>>= 0;
|
37189 | if (offset < 0 || offset + 8 > this.buffer.byteLength)
|
37190 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+8+") <= "+this.buffer.byteLength);
|
37191 | }
|
37192 | var lo = 0,
|
37193 | hi = 0;
|
37194 | if (this.littleEndian) {
|
37195 | lo = this.view[offset+2] << 16;
|
37196 | lo |= this.view[offset+1] << 8;
|
37197 | lo |= this.view[offset ];
|
37198 | lo += this.view[offset+3] << 24 >>> 0;
|
37199 | offset += 4;
|
37200 | hi = this.view[offset+2] << 16;
|
37201 | hi |= this.view[offset+1] << 8;
|
37202 | hi |= this.view[offset ];
|
37203 | hi += this.view[offset+3] << 24 >>> 0;
|
37204 | } else {
|
37205 | hi = this.view[offset+1] << 16;
|
37206 | hi |= this.view[offset+2] << 8;
|
37207 | hi |= this.view[offset+3];
|
37208 | hi += this.view[offset ] << 24 >>> 0;
|
37209 | offset += 4;
|
37210 | lo = this.view[offset+1] << 16;
|
37211 | lo |= this.view[offset+2] << 8;
|
37212 | lo |= this.view[offset+3];
|
37213 | lo += this.view[offset ] << 24 >>> 0;
|
37214 | }
|
37215 | var value = new Long(lo, hi, false);
|
37216 | if (relative) this.offset += 8;
|
37217 | return value;
|
37218 | };
|
37219 |
|
37220 | |
37221 |
|
37222 |
|
37223 |
|
37224 |
|
37225 |
|
37226 | ByteBufferPrototype.readLong = ByteBufferPrototype.readInt64;
|
37227 |
|
37228 | |
37229 |
|
37230 |
|
37231 |
|
37232 |
|
37233 |
|
37234 |
|
37235 | ByteBufferPrototype.writeUint64 = function(value, offset) {
|
37236 | var relative = typeof offset === 'undefined';
|
37237 | if (relative) offset = this.offset;
|
37238 | if (!this.noAssert) {
|
37239 | if (typeof value === 'number')
|
37240 | value = Long.fromNumber(value);
|
37241 | else if (typeof value === 'string')
|
37242 | value = Long.fromString(value);
|
37243 | else if (!(value && value instanceof Long))
|
37244 | throw TypeError("Illegal value: "+value+" (not an integer or Long)");
|
37245 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
37246 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
37247 | offset >>>= 0;
|
37248 | if (offset < 0 || offset + 0 > this.buffer.byteLength)
|
37249 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength);
|
37250 | }
|
37251 | if (typeof value === 'number')
|
37252 | value = Long.fromNumber(value);
|
37253 | else if (typeof value === 'string')
|
37254 | value = Long.fromString(value);
|
37255 | offset += 8;
|
37256 | var capacity7 = this.buffer.byteLength;
|
37257 | if (offset > capacity7)
|
37258 | this.resize((capacity7 *= 2) > offset ? capacity7 : offset);
|
37259 | offset -= 8;
|
37260 | var lo = value.low,
|
37261 | hi = value.high;
|
37262 | if (this.littleEndian) {
|
37263 | this.view[offset+3] = (lo >>> 24) & 0xFF;
|
37264 | this.view[offset+2] = (lo >>> 16) & 0xFF;
|
37265 | this.view[offset+1] = (lo >>> 8) & 0xFF;
|
37266 | this.view[offset ] = lo & 0xFF;
|
37267 | offset += 4;
|
37268 | this.view[offset+3] = (hi >>> 24) & 0xFF;
|
37269 | this.view[offset+2] = (hi >>> 16) & 0xFF;
|
37270 | this.view[offset+1] = (hi >>> 8) & 0xFF;
|
37271 | this.view[offset ] = hi & 0xFF;
|
37272 | } else {
|
37273 | this.view[offset ] = (hi >>> 24) & 0xFF;
|
37274 | this.view[offset+1] = (hi >>> 16) & 0xFF;
|
37275 | this.view[offset+2] = (hi >>> 8) & 0xFF;
|
37276 | this.view[offset+3] = hi & 0xFF;
|
37277 | offset += 4;
|
37278 | this.view[offset ] = (lo >>> 24) & 0xFF;
|
37279 | this.view[offset+1] = (lo >>> 16) & 0xFF;
|
37280 | this.view[offset+2] = (lo >>> 8) & 0xFF;
|
37281 | this.view[offset+3] = lo & 0xFF;
|
37282 | }
|
37283 | if (relative) this.offset += 8;
|
37284 | return this;
|
37285 | };
|
37286 |
|
37287 | |
37288 |
|
37289 |
|
37290 |
|
37291 |
|
37292 |
|
37293 |
|
37294 |
|
37295 | ByteBufferPrototype.writeUInt64 = ByteBufferPrototype.writeUint64;
|
37296 |
|
37297 | |
37298 |
|
37299 |
|
37300 |
|
37301 |
|
37302 |
|
37303 | ByteBufferPrototype.readUint64 = function(offset) {
|
37304 | var relative = typeof offset === 'undefined';
|
37305 | if (relative) offset = this.offset;
|
37306 | if (!this.noAssert) {
|
37307 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
37308 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
37309 | offset >>>= 0;
|
37310 | if (offset < 0 || offset + 8 > this.buffer.byteLength)
|
37311 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+8+") <= "+this.buffer.byteLength);
|
37312 | }
|
37313 | var lo = 0,
|
37314 | hi = 0;
|
37315 | if (this.littleEndian) {
|
37316 | lo = this.view[offset+2] << 16;
|
37317 | lo |= this.view[offset+1] << 8;
|
37318 | lo |= this.view[offset ];
|
37319 | lo += this.view[offset+3] << 24 >>> 0;
|
37320 | offset += 4;
|
37321 | hi = this.view[offset+2] << 16;
|
37322 | hi |= this.view[offset+1] << 8;
|
37323 | hi |= this.view[offset ];
|
37324 | hi += this.view[offset+3] << 24 >>> 0;
|
37325 | } else {
|
37326 | hi = this.view[offset+1] << 16;
|
37327 | hi |= this.view[offset+2] << 8;
|
37328 | hi |= this.view[offset+3];
|
37329 | hi += this.view[offset ] << 24 >>> 0;
|
37330 | offset += 4;
|
37331 | lo = this.view[offset+1] << 16;
|
37332 | lo |= this.view[offset+2] << 8;
|
37333 | lo |= this.view[offset+3];
|
37334 | lo += this.view[offset ] << 24 >>> 0;
|
37335 | }
|
37336 | var value = new Long(lo, hi, true);
|
37337 | if (relative) this.offset += 8;
|
37338 | return value;
|
37339 | };
|
37340 |
|
37341 | |
37342 |
|
37343 |
|
37344 |
|
37345 |
|
37346 |
|
37347 |
|
37348 | ByteBufferPrototype.readUInt64 = ByteBufferPrototype.readUint64;
|
37349 |
|
37350 | }
|
37351 |
|
37352 |
|
37353 |
|
37354 |
|
37355 | |
37356 |
|
37357 |
|
37358 |
|
37359 |
|
37360 |
|
37361 |
|
37362 |
|
37363 |
|
37364 |
|
37365 |
|
37366 |
|
37367 |
|
37368 |
|
37369 |
|
37370 |
|
37371 |
|
37372 |
|
37373 |
|
37374 |
|
37375 |
|
37376 |
|
37377 |
|
37378 |
|
37379 |
|
37380 |
|
37381 | |
37382 |
|
37383 |
|
37384 |
|
37385 |
|
37386 |
|
37387 |
|
37388 |
|
37389 |
|
37390 |
|
37391 | function ieee754_read(buffer, offset, isLE, mLen, nBytes) {
|
37392 | var e, m,
|
37393 | eLen = nBytes * 8 - mLen - 1,
|
37394 | eMax = (1 << eLen) - 1,
|
37395 | eBias = eMax >> 1,
|
37396 | nBits = -7,
|
37397 | i = isLE ? (nBytes - 1) : 0,
|
37398 | d = isLE ? -1 : 1,
|
37399 | s = buffer[offset + i];
|
37400 |
|
37401 | i += d;
|
37402 |
|
37403 | e = s & ((1 << (-nBits)) - 1);
|
37404 | s >>= (-nBits);
|
37405 | nBits += eLen;
|
37406 | for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {}
|
37407 |
|
37408 | m = e & ((1 << (-nBits)) - 1);
|
37409 | e >>= (-nBits);
|
37410 | nBits += mLen;
|
37411 | for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {}
|
37412 |
|
37413 | if (e === 0) {
|
37414 | e = 1 - eBias;
|
37415 | } else if (e === eMax) {
|
37416 | return m ? NaN : ((s ? -1 : 1) * Infinity);
|
37417 | } else {
|
37418 | m = m + Math.pow(2, mLen);
|
37419 | e = e - eBias;
|
37420 | }
|
37421 | return (s ? -1 : 1) * m * Math.pow(2, e - mLen);
|
37422 | }
|
37423 |
|
37424 | |
37425 |
|
37426 |
|
37427 |
|
37428 |
|
37429 |
|
37430 |
|
37431 |
|
37432 |
|
37433 |
|
37434 | function ieee754_write(buffer, value, offset, isLE, mLen, nBytes) {
|
37435 | var e, m, c,
|
37436 | eLen = nBytes * 8 - mLen - 1,
|
37437 | eMax = (1 << eLen) - 1,
|
37438 | eBias = eMax >> 1,
|
37439 | rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0),
|
37440 | i = isLE ? 0 : (nBytes - 1),
|
37441 | d = isLE ? 1 : -1,
|
37442 | s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0;
|
37443 |
|
37444 | value = Math.abs(value);
|
37445 |
|
37446 | if (isNaN(value) || value === Infinity) {
|
37447 | m = isNaN(value) ? 1 : 0;
|
37448 | e = eMax;
|
37449 | } else {
|
37450 | e = Math.floor(Math.log(value) / Math.LN2);
|
37451 | if (value * (c = Math.pow(2, -e)) < 1) {
|
37452 | e--;
|
37453 | c *= 2;
|
37454 | }
|
37455 | if (e + eBias >= 1) {
|
37456 | value += rt / c;
|
37457 | } else {
|
37458 | value += rt * Math.pow(2, 1 - eBias);
|
37459 | }
|
37460 | if (value * c >= 2) {
|
37461 | e++;
|
37462 | c /= 2;
|
37463 | }
|
37464 |
|
37465 | if (e + eBias >= eMax) {
|
37466 | m = 0;
|
37467 | e = eMax;
|
37468 | } else if (e + eBias >= 1) {
|
37469 | m = (value * c - 1) * Math.pow(2, mLen);
|
37470 | e = e + eBias;
|
37471 | } else {
|
37472 | m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen);
|
37473 | e = 0;
|
37474 | }
|
37475 | }
|
37476 |
|
37477 | for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}
|
37478 |
|
37479 | e = (e << mLen) | m;
|
37480 | eLen += mLen;
|
37481 | for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}
|
37482 |
|
37483 | buffer[offset + i - d] |= s * 128;
|
37484 | }
|
37485 |
|
37486 | |
37487 |
|
37488 |
|
37489 |
|
37490 |
|
37491 |
|
37492 |
|
37493 | ByteBufferPrototype.writeFloat32 = function(value, offset) {
|
37494 | var relative = typeof offset === 'undefined';
|
37495 | if (relative) offset = this.offset;
|
37496 | if (!this.noAssert) {
|
37497 | if (typeof value !== 'number')
|
37498 | throw TypeError("Illegal value: "+value+" (not a number)");
|
37499 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
37500 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
37501 | offset >>>= 0;
|
37502 | if (offset < 0 || offset + 0 > this.buffer.byteLength)
|
37503 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength);
|
37504 | }
|
37505 | offset += 4;
|
37506 | var capacity8 = this.buffer.byteLength;
|
37507 | if (offset > capacity8)
|
37508 | this.resize((capacity8 *= 2) > offset ? capacity8 : offset);
|
37509 | offset -= 4;
|
37510 | ieee754_write(this.view, value, offset, this.littleEndian, 23, 4);
|
37511 | if (relative) this.offset += 4;
|
37512 | return this;
|
37513 | };
|
37514 |
|
37515 | |
37516 |
|
37517 |
|
37518 |
|
37519 |
|
37520 |
|
37521 |
|
37522 |
|
37523 | ByteBufferPrototype.writeFloat = ByteBufferPrototype.writeFloat32;
|
37524 |
|
37525 | |
37526 |
|
37527 |
|
37528 |
|
37529 |
|
37530 |
|
37531 | ByteBufferPrototype.readFloat32 = function(offset) {
|
37532 | var relative = typeof offset === 'undefined';
|
37533 | if (relative) offset = this.offset;
|
37534 | if (!this.noAssert) {
|
37535 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
37536 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
37537 | offset >>>= 0;
|
37538 | if (offset < 0 || offset + 4 > this.buffer.byteLength)
|
37539 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+4+") <= "+this.buffer.byteLength);
|
37540 | }
|
37541 | var value = ieee754_read(this.view, offset, this.littleEndian, 23, 4);
|
37542 | if (relative) this.offset += 4;
|
37543 | return value;
|
37544 | };
|
37545 |
|
37546 | |
37547 |
|
37548 |
|
37549 |
|
37550 |
|
37551 |
|
37552 |
|
37553 | ByteBufferPrototype.readFloat = ByteBufferPrototype.readFloat32;
|
37554 |
|
37555 |
|
37556 |
|
37557 | |
37558 |
|
37559 |
|
37560 |
|
37561 |
|
37562 |
|
37563 |
|
37564 | ByteBufferPrototype.writeFloat64 = function(value, offset) {
|
37565 | var relative = typeof offset === 'undefined';
|
37566 | if (relative) offset = this.offset;
|
37567 | if (!this.noAssert) {
|
37568 | if (typeof value !== 'number')
|
37569 | throw TypeError("Illegal value: "+value+" (not a number)");
|
37570 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
37571 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
37572 | offset >>>= 0;
|
37573 | if (offset < 0 || offset + 0 > this.buffer.byteLength)
|
37574 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength);
|
37575 | }
|
37576 | offset += 8;
|
37577 | var capacity9 = this.buffer.byteLength;
|
37578 | if (offset > capacity9)
|
37579 | this.resize((capacity9 *= 2) > offset ? capacity9 : offset);
|
37580 | offset -= 8;
|
37581 | ieee754_write(this.view, value, offset, this.littleEndian, 52, 8);
|
37582 | if (relative) this.offset += 8;
|
37583 | return this;
|
37584 | };
|
37585 |
|
37586 | |
37587 |
|
37588 |
|
37589 |
|
37590 |
|
37591 |
|
37592 |
|
37593 |
|
37594 | ByteBufferPrototype.writeDouble = ByteBufferPrototype.writeFloat64;
|
37595 |
|
37596 | |
37597 |
|
37598 |
|
37599 |
|
37600 |
|
37601 |
|
37602 | ByteBufferPrototype.readFloat64 = function(offset) {
|
37603 | var relative = typeof offset === 'undefined';
|
37604 | if (relative) offset = this.offset;
|
37605 | if (!this.noAssert) {
|
37606 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
37607 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
37608 | offset >>>= 0;
|
37609 | if (offset < 0 || offset + 8 > this.buffer.byteLength)
|
37610 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+8+") <= "+this.buffer.byteLength);
|
37611 | }
|
37612 | var value = ieee754_read(this.view, offset, this.littleEndian, 52, 8);
|
37613 | if (relative) this.offset += 8;
|
37614 | return value;
|
37615 | };
|
37616 |
|
37617 | |
37618 |
|
37619 |
|
37620 |
|
37621 |
|
37622 |
|
37623 |
|
37624 | ByteBufferPrototype.readDouble = ByteBufferPrototype.readFloat64;
|
37625 |
|
37626 |
|
37627 |
|
37628 |
|
37629 | |
37630 |
|
37631 |
|
37632 |
|
37633 |
|
37634 |
|
37635 | ByteBuffer.MAX_VARINT32_BYTES = 5;
|
37636 |
|
37637 | |
37638 |
|
37639 |
|
37640 |
|
37641 |
|
37642 |
|
37643 | ByteBuffer.calculateVarint32 = function(value) {
|
37644 |
|
37645 | value = value >>> 0;
|
37646 | if (value < 1 << 7 ) return 1;
|
37647 | else if (value < 1 << 14) return 2;
|
37648 | else if (value < 1 << 21) return 3;
|
37649 | else if (value < 1 << 28) return 4;
|
37650 | else return 5;
|
37651 | };
|
37652 |
|
37653 | |
37654 |
|
37655 |
|
37656 |
|
37657 |
|
37658 |
|
37659 | ByteBuffer.zigZagEncode32 = function(n) {
|
37660 | return (((n |= 0) << 1) ^ (n >> 31)) >>> 0;
|
37661 | };
|
37662 |
|
37663 | |
37664 |
|
37665 |
|
37666 |
|
37667 |
|
37668 |
|
37669 | ByteBuffer.zigZagDecode32 = function(n) {
|
37670 | return ((n >>> 1) ^ -(n & 1)) | 0;
|
37671 | };
|
37672 |
|
37673 | |
37674 |
|
37675 |
|
37676 |
|
37677 |
|
37678 |
|
37679 |
|
37680 |
|
37681 | ByteBufferPrototype.writeVarint32 = function(value, offset) {
|
37682 | var relative = typeof offset === 'undefined';
|
37683 | if (relative) offset = this.offset;
|
37684 | if (!this.noAssert) {
|
37685 | if (typeof value !== 'number' || value % 1 !== 0)
|
37686 | throw TypeError("Illegal value: "+value+" (not an integer)");
|
37687 | value |= 0;
|
37688 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
37689 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
37690 | offset >>>= 0;
|
37691 | if (offset < 0 || offset + 0 > this.buffer.byteLength)
|
37692 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength);
|
37693 | }
|
37694 | var size = ByteBuffer.calculateVarint32(value),
|
37695 | b;
|
37696 | offset += size;
|
37697 | var capacity10 = this.buffer.byteLength;
|
37698 | if (offset > capacity10)
|
37699 | this.resize((capacity10 *= 2) > offset ? capacity10 : offset);
|
37700 | offset -= size;
|
37701 | value >>>= 0;
|
37702 | while (value >= 0x80) {
|
37703 | b = (value & 0x7f) | 0x80;
|
37704 | this.view[offset++] = b;
|
37705 | value >>>= 7;
|
37706 | }
|
37707 | this.view[offset++] = value;
|
37708 | if (relative) {
|
37709 | this.offset = offset;
|
37710 | return this;
|
37711 | }
|
37712 | return size;
|
37713 | };
|
37714 |
|
37715 | |
37716 |
|
37717 |
|
37718 |
|
37719 |
|
37720 |
|
37721 |
|
37722 |
|
37723 | ByteBufferPrototype.writeVarint32ZigZag = function(value, offset) {
|
37724 | return this.writeVarint32(ByteBuffer.zigZagEncode32(value), offset);
|
37725 | };
|
37726 |
|
37727 | |
37728 |
|
37729 |
|
37730 |
|
37731 |
|
37732 |
|
37733 |
|
37734 |
|
37735 |
|
37736 |
|
37737 | ByteBufferPrototype.readVarint32 = function(offset) {
|
37738 | var relative = typeof offset === 'undefined';
|
37739 | if (relative) offset = this.offset;
|
37740 | if (!this.noAssert) {
|
37741 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
37742 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
37743 | offset >>>= 0;
|
37744 | if (offset < 0 || offset + 1 > this.buffer.byteLength)
|
37745 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+1+") <= "+this.buffer.byteLength);
|
37746 | }
|
37747 | var c = 0,
|
37748 | value = 0 >>> 0,
|
37749 | b;
|
37750 | do {
|
37751 | if (!this.noAssert && offset > this.limit) {
|
37752 | var err = Error("Truncated");
|
37753 | err['truncated'] = true;
|
37754 | throw err;
|
37755 | }
|
37756 | b = this.view[offset++];
|
37757 | if (c < 5)
|
37758 | value |= (b & 0x7f) << (7*c);
|
37759 | ++c;
|
37760 | } while ((b & 0x80) !== 0);
|
37761 | value |= 0;
|
37762 | if (relative) {
|
37763 | this.offset = offset;
|
37764 | return value;
|
37765 | }
|
37766 | return {
|
37767 | "value": value,
|
37768 | "length": c
|
37769 | };
|
37770 | };
|
37771 |
|
37772 | |
37773 |
|
37774 |
|
37775 |
|
37776 |
|
37777 |
|
37778 |
|
37779 |
|
37780 |
|
37781 | ByteBufferPrototype.readVarint32ZigZag = function(offset) {
|
37782 | var val = this.readVarint32(offset);
|
37783 | if (typeof val === 'object')
|
37784 | val["value"] = ByteBuffer.zigZagDecode32(val["value"]);
|
37785 | else
|
37786 | val = ByteBuffer.zigZagDecode32(val);
|
37787 | return val;
|
37788 | };
|
37789 |
|
37790 |
|
37791 |
|
37792 | if (Long) {
|
37793 |
|
37794 | |
37795 |
|
37796 |
|
37797 |
|
37798 |
|
37799 |
|
37800 | ByteBuffer.MAX_VARINT64_BYTES = 10;
|
37801 |
|
37802 | |
37803 |
|
37804 |
|
37805 |
|
37806 |
|
37807 |
|
37808 | ByteBuffer.calculateVarint64 = function(value) {
|
37809 | if (typeof value === 'number')
|
37810 | value = Long.fromNumber(value);
|
37811 | else if (typeof value === 'string')
|
37812 | value = Long.fromString(value);
|
37813 |
|
37814 | var part0 = value.toInt() >>> 0,
|
37815 | part1 = value.shiftRightUnsigned(28).toInt() >>> 0,
|
37816 | part2 = value.shiftRightUnsigned(56).toInt() >>> 0;
|
37817 | if (part2 == 0) {
|
37818 | if (part1 == 0) {
|
37819 | if (part0 < 1 << 14)
|
37820 | return part0 < 1 << 7 ? 1 : 2;
|
37821 | else
|
37822 | return part0 < 1 << 21 ? 3 : 4;
|
37823 | } else {
|
37824 | if (part1 < 1 << 14)
|
37825 | return part1 < 1 << 7 ? 5 : 6;
|
37826 | else
|
37827 | return part1 < 1 << 21 ? 7 : 8;
|
37828 | }
|
37829 | } else
|
37830 | return part2 < 1 << 7 ? 9 : 10;
|
37831 | };
|
37832 |
|
37833 | |
37834 |
|
37835 |
|
37836 |
|
37837 |
|
37838 |
|
37839 | ByteBuffer.zigZagEncode64 = function(value) {
|
37840 | if (typeof value === 'number')
|
37841 | value = Long.fromNumber(value, false);
|
37842 | else if (typeof value === 'string')
|
37843 | value = Long.fromString(value, false);
|
37844 | else if (value.unsigned !== false) value = value.toSigned();
|
37845 |
|
37846 | return value.shiftLeft(1).xor(value.shiftRight(63)).toUnsigned();
|
37847 | };
|
37848 |
|
37849 | |
37850 |
|
37851 |
|
37852 |
|
37853 |
|
37854 |
|
37855 | ByteBuffer.zigZagDecode64 = function(value) {
|
37856 | if (typeof value === 'number')
|
37857 | value = Long.fromNumber(value, false);
|
37858 | else if (typeof value === 'string')
|
37859 | value = Long.fromString(value, false);
|
37860 | else if (value.unsigned !== false) value = value.toSigned();
|
37861 |
|
37862 | return value.shiftRightUnsigned(1).xor(value.and(Long.ONE).toSigned().negate()).toSigned();
|
37863 | };
|
37864 |
|
37865 | |
37866 |
|
37867 |
|
37868 |
|
37869 |
|
37870 |
|
37871 |
|
37872 |
|
37873 | ByteBufferPrototype.writeVarint64 = function(value, offset) {
|
37874 | var relative = typeof offset === 'undefined';
|
37875 | if (relative) offset = this.offset;
|
37876 | if (!this.noAssert) {
|
37877 | if (typeof value === 'number')
|
37878 | value = Long.fromNumber(value);
|
37879 | else if (typeof value === 'string')
|
37880 | value = Long.fromString(value);
|
37881 | else if (!(value && value instanceof Long))
|
37882 | throw TypeError("Illegal value: "+value+" (not an integer or Long)");
|
37883 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
37884 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
37885 | offset >>>= 0;
|
37886 | if (offset < 0 || offset + 0 > this.buffer.byteLength)
|
37887 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength);
|
37888 | }
|
37889 | if (typeof value === 'number')
|
37890 | value = Long.fromNumber(value, false);
|
37891 | else if (typeof value === 'string')
|
37892 | value = Long.fromString(value, false);
|
37893 | else if (value.unsigned !== false) value = value.toSigned();
|
37894 | var size = ByteBuffer.calculateVarint64(value),
|
37895 | part0 = value.toInt() >>> 0,
|
37896 | part1 = value.shiftRightUnsigned(28).toInt() >>> 0,
|
37897 | part2 = value.shiftRightUnsigned(56).toInt() >>> 0;
|
37898 | offset += size;
|
37899 | var capacity11 = this.buffer.byteLength;
|
37900 | if (offset > capacity11)
|
37901 | this.resize((capacity11 *= 2) > offset ? capacity11 : offset);
|
37902 | offset -= size;
|
37903 | switch (size) {
|
37904 | case 10: this.view[offset+9] = (part2 >>> 7) & 0x01;
|
37905 | case 9 : this.view[offset+8] = size !== 9 ? (part2 ) | 0x80 : (part2 ) & 0x7F;
|
37906 | case 8 : this.view[offset+7] = size !== 8 ? (part1 >>> 21) | 0x80 : (part1 >>> 21) & 0x7F;
|
37907 | case 7 : this.view[offset+6] = size !== 7 ? (part1 >>> 14) | 0x80 : (part1 >>> 14) & 0x7F;
|
37908 | case 6 : this.view[offset+5] = size !== 6 ? (part1 >>> 7) | 0x80 : (part1 >>> 7) & 0x7F;
|
37909 | case 5 : this.view[offset+4] = size !== 5 ? (part1 ) | 0x80 : (part1 ) & 0x7F;
|
37910 | case 4 : this.view[offset+3] = size !== 4 ? (part0 >>> 21) | 0x80 : (part0 >>> 21) & 0x7F;
|
37911 | case 3 : this.view[offset+2] = size !== 3 ? (part0 >>> 14) | 0x80 : (part0 >>> 14) & 0x7F;
|
37912 | case 2 : this.view[offset+1] = size !== 2 ? (part0 >>> 7) | 0x80 : (part0 >>> 7) & 0x7F;
|
37913 | case 1 : this.view[offset ] = size !== 1 ? (part0 ) | 0x80 : (part0 ) & 0x7F;
|
37914 | }
|
37915 | if (relative) {
|
37916 | this.offset += size;
|
37917 | return this;
|
37918 | } else {
|
37919 | return size;
|
37920 | }
|
37921 | };
|
37922 |
|
37923 | |
37924 |
|
37925 |
|
37926 |
|
37927 |
|
37928 |
|
37929 |
|
37930 |
|
37931 | ByteBufferPrototype.writeVarint64ZigZag = function(value, offset) {
|
37932 | return this.writeVarint64(ByteBuffer.zigZagEncode64(value), offset);
|
37933 | };
|
37934 |
|
37935 | |
37936 |
|
37937 |
|
37938 |
|
37939 |
|
37940 |
|
37941 |
|
37942 |
|
37943 |
|
37944 | ByteBufferPrototype.readVarint64 = function(offset) {
|
37945 | var relative = typeof offset === 'undefined';
|
37946 | if (relative) offset = this.offset;
|
37947 | if (!this.noAssert) {
|
37948 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
37949 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
37950 | offset >>>= 0;
|
37951 | if (offset < 0 || offset + 1 > this.buffer.byteLength)
|
37952 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+1+") <= "+this.buffer.byteLength);
|
37953 | }
|
37954 |
|
37955 | var start = offset,
|
37956 | part0 = 0,
|
37957 | part1 = 0,
|
37958 | part2 = 0,
|
37959 | b = 0;
|
37960 | b = this.view[offset++]; part0 = (b & 0x7F) ; if ( b & 0x80 ) {
|
37961 | b = this.view[offset++]; part0 |= (b & 0x7F) << 7; if ((b & 0x80) || (this.noAssert && typeof b === 'undefined')) {
|
37962 | b = this.view[offset++]; part0 |= (b & 0x7F) << 14; if ((b & 0x80) || (this.noAssert && typeof b === 'undefined')) {
|
37963 | b = this.view[offset++]; part0 |= (b & 0x7F) << 21; if ((b & 0x80) || (this.noAssert && typeof b === 'undefined')) {
|
37964 | b = this.view[offset++]; part1 = (b & 0x7F) ; if ((b & 0x80) || (this.noAssert && typeof b === 'undefined')) {
|
37965 | b = this.view[offset++]; part1 |= (b & 0x7F) << 7; if ((b & 0x80) || (this.noAssert && typeof b === 'undefined')) {
|
37966 | b = this.view[offset++]; part1 |= (b & 0x7F) << 14; if ((b & 0x80) || (this.noAssert && typeof b === 'undefined')) {
|
37967 | b = this.view[offset++]; part1 |= (b & 0x7F) << 21; if ((b & 0x80) || (this.noAssert && typeof b === 'undefined')) {
|
37968 | b = this.view[offset++]; part2 = (b & 0x7F) ; if ((b & 0x80) || (this.noAssert && typeof b === 'undefined')) {
|
37969 | b = this.view[offset++]; part2 |= (b & 0x7F) << 7; if ((b & 0x80) || (this.noAssert && typeof b === 'undefined')) {
|
37970 | throw Error("Buffer overrun"); }}}}}}}}}}
|
37971 | var value = Long.fromBits(part0 | (part1 << 28), (part1 >>> 4) | (part2) << 24, false);
|
37972 | if (relative) {
|
37973 | this.offset = offset;
|
37974 | return value;
|
37975 | } else {
|
37976 | return {
|
37977 | 'value': value,
|
37978 | 'length': offset-start
|
37979 | };
|
37980 | }
|
37981 | };
|
37982 |
|
37983 | |
37984 |
|
37985 |
|
37986 |
|
37987 |
|
37988 |
|
37989 |
|
37990 |
|
37991 |
|
37992 | ByteBufferPrototype.readVarint64ZigZag = function(offset) {
|
37993 | var val = this.readVarint64(offset);
|
37994 | if (val && val['value'] instanceof Long)
|
37995 | val["value"] = ByteBuffer.zigZagDecode64(val["value"]);
|
37996 | else
|
37997 | val = ByteBuffer.zigZagDecode64(val);
|
37998 | return val;
|
37999 | };
|
38000 |
|
38001 | }
|
38002 |
|
38003 |
|
38004 |
|
38005 |
|
38006 | |
38007 |
|
38008 |
|
38009 |
|
38010 |
|
38011 |
|
38012 |
|
38013 |
|
38014 |
|
38015 | ByteBufferPrototype.writeCString = function(str, offset) {
|
38016 | var relative = typeof offset === 'undefined';
|
38017 | if (relative) offset = this.offset;
|
38018 | var i,
|
38019 | k = str.length;
|
38020 | if (!this.noAssert) {
|
38021 | if (typeof str !== 'string')
|
38022 | throw TypeError("Illegal str: Not a string");
|
38023 | for (i=0; i<k; ++i) {
|
38024 | if (str.charCodeAt(i) === 0)
|
38025 | throw RangeError("Illegal str: Contains NULL-characters");
|
38026 | }
|
38027 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
38028 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
38029 | offset >>>= 0;
|
38030 | if (offset < 0 || offset + 0 > this.buffer.byteLength)
|
38031 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength);
|
38032 | }
|
38033 |
|
38034 | k = utfx.calculateUTF16asUTF8(stringSource(str))[1];
|
38035 | offset += k+1;
|
38036 | var capacity12 = this.buffer.byteLength;
|
38037 | if (offset > capacity12)
|
38038 | this.resize((capacity12 *= 2) > offset ? capacity12 : offset);
|
38039 | offset -= k+1;
|
38040 | utfx.encodeUTF16toUTF8(stringSource(str), function(b) {
|
38041 | this.view[offset++] = b;
|
38042 | }.bind(this));
|
38043 | this.view[offset++] = 0;
|
38044 | if (relative) {
|
38045 | this.offset = offset;
|
38046 | return this;
|
38047 | }
|
38048 | return k;
|
38049 | };
|
38050 |
|
38051 | |
38052 |
|
38053 |
|
38054 |
|
38055 |
|
38056 |
|
38057 |
|
38058 |
|
38059 |
|
38060 | ByteBufferPrototype.readCString = function(offset) {
|
38061 | var relative = typeof offset === 'undefined';
|
38062 | if (relative) offset = this.offset;
|
38063 | if (!this.noAssert) {
|
38064 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
38065 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
38066 | offset >>>= 0;
|
38067 | if (offset < 0 || offset + 1 > this.buffer.byteLength)
|
38068 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+1+") <= "+this.buffer.byteLength);
|
38069 | }
|
38070 | var start = offset,
|
38071 | temp;
|
38072 |
|
38073 | var sd, b = -1;
|
38074 | utfx.decodeUTF8toUTF16(function() {
|
38075 | if (b === 0) return null;
|
38076 | if (offset >= this.limit)
|
38077 | throw RangeError("Illegal range: Truncated data, "+offset+" < "+this.limit);
|
38078 | b = this.view[offset++];
|
38079 | return b === 0 ? null : b;
|
38080 | }.bind(this), sd = stringDestination(), true);
|
38081 | if (relative) {
|
38082 | this.offset = offset;
|
38083 | return sd();
|
38084 | } else {
|
38085 | return {
|
38086 | "string": sd(),
|
38087 | "length": offset - start
|
38088 | };
|
38089 | }
|
38090 | };
|
38091 |
|
38092 |
|
38093 |
|
38094 | |
38095 |
|
38096 |
|
38097 |
|
38098 |
|
38099 |
|
38100 |
|
38101 |
|
38102 |
|
38103 | ByteBufferPrototype.writeIString = function(str, offset) {
|
38104 | var relative = typeof offset === 'undefined';
|
38105 | if (relative) offset = this.offset;
|
38106 | if (!this.noAssert) {
|
38107 | if (typeof str !== 'string')
|
38108 | throw TypeError("Illegal str: Not a string");
|
38109 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
38110 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
38111 | offset >>>= 0;
|
38112 | if (offset < 0 || offset + 0 > this.buffer.byteLength)
|
38113 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength);
|
38114 | }
|
38115 | var start = offset,
|
38116 | k;
|
38117 | k = utfx.calculateUTF16asUTF8(stringSource(str), this.noAssert)[1];
|
38118 | offset += 4+k;
|
38119 | var capacity13 = this.buffer.byteLength;
|
38120 | if (offset > capacity13)
|
38121 | this.resize((capacity13 *= 2) > offset ? capacity13 : offset);
|
38122 | offset -= 4+k;
|
38123 | if (this.littleEndian) {
|
38124 | this.view[offset+3] = (k >>> 24) & 0xFF;
|
38125 | this.view[offset+2] = (k >>> 16) & 0xFF;
|
38126 | this.view[offset+1] = (k >>> 8) & 0xFF;
|
38127 | this.view[offset ] = k & 0xFF;
|
38128 | } else {
|
38129 | this.view[offset ] = (k >>> 24) & 0xFF;
|
38130 | this.view[offset+1] = (k >>> 16) & 0xFF;
|
38131 | this.view[offset+2] = (k >>> 8) & 0xFF;
|
38132 | this.view[offset+3] = k & 0xFF;
|
38133 | }
|
38134 | offset += 4;
|
38135 | utfx.encodeUTF16toUTF8(stringSource(str), function(b) {
|
38136 | this.view[offset++] = b;
|
38137 | }.bind(this));
|
38138 | if (offset !== start + 4 + k)
|
38139 | throw RangeError("Illegal range: Truncated data, "+offset+" == "+(offset+4+k));
|
38140 | if (relative) {
|
38141 | this.offset = offset;
|
38142 | return this;
|
38143 | }
|
38144 | return offset - start;
|
38145 | };
|
38146 |
|
38147 | |
38148 |
|
38149 |
|
38150 |
|
38151 |
|
38152 |
|
38153 |
|
38154 |
|
38155 |
|
38156 | ByteBufferPrototype.readIString = function(offset) {
|
38157 | var relative = typeof offset === 'undefined';
|
38158 | if (relative) offset = this.offset;
|
38159 | if (!this.noAssert) {
|
38160 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
38161 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
38162 | offset >>>= 0;
|
38163 | if (offset < 0 || offset + 4 > this.buffer.byteLength)
|
38164 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+4+") <= "+this.buffer.byteLength);
|
38165 | }
|
38166 | var start = offset;
|
38167 | var len = this.readUint32(offset);
|
38168 | var str = this.readUTF8String(len, ByteBuffer.METRICS_BYTES, offset += 4);
|
38169 | offset += str['length'];
|
38170 | if (relative) {
|
38171 | this.offset = offset;
|
38172 | return str['string'];
|
38173 | } else {
|
38174 | return {
|
38175 | 'string': str['string'],
|
38176 | 'length': offset - start
|
38177 | };
|
38178 | }
|
38179 | };
|
38180 |
|
38181 |
|
38182 |
|
38183 | |
38184 |
|
38185 |
|
38186 |
|
38187 |
|
38188 |
|
38189 | ByteBuffer.METRICS_CHARS = 'c';
|
38190 |
|
38191 | |
38192 |
|
38193 |
|
38194 |
|
38195 |
|
38196 |
|
38197 | ByteBuffer.METRICS_BYTES = 'b';
|
38198 |
|
38199 | |
38200 |
|
38201 |
|
38202 |
|
38203 |
|
38204 |
|
38205 |
|
38206 | ByteBufferPrototype.writeUTF8String = function(str, offset) {
|
38207 | var relative = typeof offset === 'undefined';
|
38208 | if (relative) offset = this.offset;
|
38209 | if (!this.noAssert) {
|
38210 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
38211 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
38212 | offset >>>= 0;
|
38213 | if (offset < 0 || offset + 0 > this.buffer.byteLength)
|
38214 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength);
|
38215 | }
|
38216 | var k;
|
38217 | var start = offset;
|
38218 | k = utfx.calculateUTF16asUTF8(stringSource(str))[1];
|
38219 | offset += k;
|
38220 | var capacity14 = this.buffer.byteLength;
|
38221 | if (offset > capacity14)
|
38222 | this.resize((capacity14 *= 2) > offset ? capacity14 : offset);
|
38223 | offset -= k;
|
38224 | utfx.encodeUTF16toUTF8(stringSource(str), function(b) {
|
38225 | this.view[offset++] = b;
|
38226 | }.bind(this));
|
38227 | if (relative) {
|
38228 | this.offset = offset;
|
38229 | return this;
|
38230 | }
|
38231 | return offset - start;
|
38232 | };
|
38233 |
|
38234 | |
38235 |
|
38236 |
|
38237 |
|
38238 |
|
38239 |
|
38240 |
|
38241 |
|
38242 | ByteBufferPrototype.writeString = ByteBufferPrototype.writeUTF8String;
|
38243 |
|
38244 | |
38245 |
|
38246 |
|
38247 |
|
38248 |
|
38249 |
|
38250 |
|
38251 | ByteBuffer.calculateUTF8Chars = function(str) {
|
38252 | return utfx.calculateUTF16asUTF8(stringSource(str))[0];
|
38253 | };
|
38254 |
|
38255 | |
38256 |
|
38257 |
|
38258 |
|
38259 |
|
38260 |
|
38261 | ByteBuffer.calculateUTF8Bytes = function(str) {
|
38262 | return utfx.calculateUTF16asUTF8(stringSource(str))[1];
|
38263 | };
|
38264 |
|
38265 | |
38266 |
|
38267 |
|
38268 |
|
38269 |
|
38270 |
|
38271 |
|
38272 | ByteBuffer.calculateString = ByteBuffer.calculateUTF8Bytes;
|
38273 |
|
38274 | |
38275 |
|
38276 |
|
38277 |
|
38278 |
|
38279 |
|
38280 |
|
38281 |
|
38282 |
|
38283 |
|
38284 |
|
38285 | ByteBufferPrototype.readUTF8String = function(length, metrics, offset) {
|
38286 | if (typeof metrics === 'number') {
|
38287 | offset = metrics;
|
38288 | metrics = undefined;
|
38289 | }
|
38290 | var relative = typeof offset === 'undefined';
|
38291 | if (relative) offset = this.offset;
|
38292 | if (typeof metrics === 'undefined') metrics = ByteBuffer.METRICS_CHARS;
|
38293 | if (!this.noAssert) {
|
38294 | if (typeof length !== 'number' || length % 1 !== 0)
|
38295 | throw TypeError("Illegal length: "+length+" (not an integer)");
|
38296 | length |= 0;
|
38297 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
38298 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
38299 | offset >>>= 0;
|
38300 | if (offset < 0 || offset + 0 > this.buffer.byteLength)
|
38301 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength);
|
38302 | }
|
38303 | var i = 0,
|
38304 | start = offset,
|
38305 | sd;
|
38306 | if (metrics === ByteBuffer.METRICS_CHARS) {
|
38307 | sd = stringDestination();
|
38308 | utfx.decodeUTF8(function() {
|
38309 | return i < length && offset < this.limit ? this.view[offset++] : null;
|
38310 | }.bind(this), function(cp) {
|
38311 | ++i; utfx.UTF8toUTF16(cp, sd);
|
38312 | });
|
38313 | if (i !== length)
|
38314 | throw RangeError("Illegal range: Truncated data, "+i+" == "+length);
|
38315 | if (relative) {
|
38316 | this.offset = offset;
|
38317 | return sd();
|
38318 | } else {
|
38319 | return {
|
38320 | "string": sd(),
|
38321 | "length": offset - start
|
38322 | };
|
38323 | }
|
38324 | } else if (metrics === ByteBuffer.METRICS_BYTES) {
|
38325 | if (!this.noAssert) {
|
38326 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
38327 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
38328 | offset >>>= 0;
|
38329 | if (offset < 0 || offset + length > this.buffer.byteLength)
|
38330 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+length+") <= "+this.buffer.byteLength);
|
38331 | }
|
38332 | var k = offset + length;
|
38333 | utfx.decodeUTF8toUTF16(function() {
|
38334 | return offset < k ? this.view[offset++] : null;
|
38335 | }.bind(this), sd = stringDestination(), this.noAssert);
|
38336 | if (offset !== k)
|
38337 | throw RangeError("Illegal range: Truncated data, "+offset+" == "+k);
|
38338 | if (relative) {
|
38339 | this.offset = offset;
|
38340 | return sd();
|
38341 | } else {
|
38342 | return {
|
38343 | 'string': sd(),
|
38344 | 'length': offset - start
|
38345 | };
|
38346 | }
|
38347 | } else
|
38348 | throw TypeError("Unsupported metrics: "+metrics);
|
38349 | };
|
38350 |
|
38351 | |
38352 |
|
38353 |
|
38354 |
|
38355 |
|
38356 |
|
38357 |
|
38358 |
|
38359 |
|
38360 |
|
38361 |
|
38362 |
|
38363 | ByteBufferPrototype.readString = ByteBufferPrototype.readUTF8String;
|
38364 |
|
38365 |
|
38366 |
|
38367 | |
38368 |
|
38369 |
|
38370 |
|
38371 |
|
38372 |
|
38373 |
|
38374 |
|
38375 |
|
38376 | ByteBufferPrototype.writeVString = function(str, offset) {
|
38377 | var relative = typeof offset === 'undefined';
|
38378 | if (relative) offset = this.offset;
|
38379 | if (!this.noAssert) {
|
38380 | if (typeof str !== 'string')
|
38381 | throw TypeError("Illegal str: Not a string");
|
38382 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
38383 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
38384 | offset >>>= 0;
|
38385 | if (offset < 0 || offset + 0 > this.buffer.byteLength)
|
38386 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength);
|
38387 | }
|
38388 | var start = offset,
|
38389 | k, l;
|
38390 | k = utfx.calculateUTF16asUTF8(stringSource(str), this.noAssert)[1];
|
38391 | l = ByteBuffer.calculateVarint32(k);
|
38392 | offset += l+k;
|
38393 | var capacity15 = this.buffer.byteLength;
|
38394 | if (offset > capacity15)
|
38395 | this.resize((capacity15 *= 2) > offset ? capacity15 : offset);
|
38396 | offset -= l+k;
|
38397 | offset += this.writeVarint32(k, offset);
|
38398 | utfx.encodeUTF16toUTF8(stringSource(str), function(b) {
|
38399 | this.view[offset++] = b;
|
38400 | }.bind(this));
|
38401 | if (offset !== start+k+l)
|
38402 | throw RangeError("Illegal range: Truncated data, "+offset+" == "+(offset+k+l));
|
38403 | if (relative) {
|
38404 | this.offset = offset;
|
38405 | return this;
|
38406 | }
|
38407 | return offset - start;
|
38408 | };
|
38409 |
|
38410 | |
38411 |
|
38412 |
|
38413 |
|
38414 |
|
38415 |
|
38416 |
|
38417 |
|
38418 |
|
38419 | ByteBufferPrototype.readVString = function(offset) {
|
38420 | var relative = typeof offset === 'undefined';
|
38421 | if (relative) offset = this.offset;
|
38422 | if (!this.noAssert) {
|
38423 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
38424 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
38425 | offset >>>= 0;
|
38426 | if (offset < 0 || offset + 1 > this.buffer.byteLength)
|
38427 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+1+") <= "+this.buffer.byteLength);
|
38428 | }
|
38429 | var start = offset;
|
38430 | var len = this.readVarint32(offset);
|
38431 | var str = this.readUTF8String(len['value'], ByteBuffer.METRICS_BYTES, offset += len['length']);
|
38432 | offset += str['length'];
|
38433 | if (relative) {
|
38434 | this.offset = offset;
|
38435 | return str['string'];
|
38436 | } else {
|
38437 | return {
|
38438 | 'string': str['string'],
|
38439 | 'length': offset - start
|
38440 | };
|
38441 | }
|
38442 | };
|
38443 |
|
38444 |
|
38445 | |
38446 |
|
38447 |
|
38448 |
|
38449 |
|
38450 |
|
38451 |
|
38452 |
|
38453 |
|
38454 |
|
38455 |
|
38456 |
|
38457 |
|
38458 | ByteBufferPrototype.append = function(source, encoding, offset) {
|
38459 | if (typeof encoding === 'number' || typeof encoding !== 'string') {
|
38460 | offset = encoding;
|
38461 | encoding = undefined;
|
38462 | }
|
38463 | var relative = typeof offset === 'undefined';
|
38464 | if (relative) offset = this.offset;
|
38465 | if (!this.noAssert) {
|
38466 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
38467 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
38468 | offset >>>= 0;
|
38469 | if (offset < 0 || offset + 0 > this.buffer.byteLength)
|
38470 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength);
|
38471 | }
|
38472 | if (!(source instanceof ByteBuffer))
|
38473 | source = ByteBuffer.wrap(source, encoding);
|
38474 | var length = source.limit - source.offset;
|
38475 | if (length <= 0) return this;
|
38476 | offset += length;
|
38477 | var capacity16 = this.buffer.byteLength;
|
38478 | if (offset > capacity16)
|
38479 | this.resize((capacity16 *= 2) > offset ? capacity16 : offset);
|
38480 | offset -= length;
|
38481 | this.view.set(source.view.subarray(source.offset, source.limit), offset);
|
38482 | source.offset += length;
|
38483 | if (relative) this.offset += length;
|
38484 | return this;
|
38485 | };
|
38486 |
|
38487 | |
38488 |
|
38489 |
|
38490 |
|
38491 |
|
38492 |
|
38493 |
|
38494 |
|
38495 |
|
38496 |
|
38497 | ByteBufferPrototype.appendTo = function(target, offset) {
|
38498 | target.append(this, offset);
|
38499 | return this;
|
38500 | };
|
38501 |
|
38502 | |
38503 |
|
38504 |
|
38505 |
|
38506 |
|
38507 |
|
38508 |
|
38509 | ByteBufferPrototype.assert = function(assert) {
|
38510 | this.noAssert = !assert;
|
38511 | return this;
|
38512 | };
|
38513 |
|
38514 | |
38515 |
|
38516 |
|
38517 |
|
38518 |
|
38519 | ByteBufferPrototype.capacity = function() {
|
38520 | return this.buffer.byteLength;
|
38521 | };
|
38522 | |
38523 |
|
38524 |
|
38525 |
|
38526 |
|
38527 |
|
38528 | ByteBufferPrototype.clear = function() {
|
38529 | this.offset = 0;
|
38530 | this.limit = this.buffer.byteLength;
|
38531 | this.markedOffset = -1;
|
38532 | return this;
|
38533 | };
|
38534 |
|
38535 | |
38536 |
|
38537 |
|
38538 |
|
38539 |
|
38540 |
|
38541 |
|
38542 | ByteBufferPrototype.clone = function(copy) {
|
38543 | var bb = new ByteBuffer(0, this.littleEndian, this.noAssert);
|
38544 | if (copy) {
|
38545 | bb.buffer = new ArrayBuffer(this.buffer.byteLength);
|
38546 | bb.view = new Uint8Array(bb.buffer);
|
38547 | } else {
|
38548 | bb.buffer = this.buffer;
|
38549 | bb.view = this.view;
|
38550 | }
|
38551 | bb.offset = this.offset;
|
38552 | bb.markedOffset = this.markedOffset;
|
38553 | bb.limit = this.limit;
|
38554 | return bb;
|
38555 | };
|
38556 |
|
38557 | |
38558 |
|
38559 |
|
38560 |
|
38561 |
|
38562 |
|
38563 |
|
38564 |
|
38565 |
|
38566 | ByteBufferPrototype.compact = function(begin, end) {
|
38567 | if (typeof begin === 'undefined') begin = this.offset;
|
38568 | if (typeof end === 'undefined') end = this.limit;
|
38569 | if (!this.noAssert) {
|
38570 | if (typeof begin !== 'number' || begin % 1 !== 0)
|
38571 | throw TypeError("Illegal begin: Not an integer");
|
38572 | begin >>>= 0;
|
38573 | if (typeof end !== 'number' || end % 1 !== 0)
|
38574 | throw TypeError("Illegal end: Not an integer");
|
38575 | end >>>= 0;
|
38576 | if (begin < 0 || begin > end || end > this.buffer.byteLength)
|
38577 | throw RangeError("Illegal range: 0 <= "+begin+" <= "+end+" <= "+this.buffer.byteLength);
|
38578 | }
|
38579 | if (begin === 0 && end === this.buffer.byteLength)
|
38580 | return this;
|
38581 | var len = end - begin;
|
38582 | if (len === 0) {
|
38583 | this.buffer = EMPTY_BUFFER;
|
38584 | this.view = null;
|
38585 | if (this.markedOffset >= 0) this.markedOffset -= begin;
|
38586 | this.offset = 0;
|
38587 | this.limit = 0;
|
38588 | return this;
|
38589 | }
|
38590 | var buffer = new ArrayBuffer(len);
|
38591 | var view = new Uint8Array(buffer);
|
38592 | view.set(this.view.subarray(begin, end));
|
38593 | this.buffer = buffer;
|
38594 | this.view = view;
|
38595 | if (this.markedOffset >= 0) this.markedOffset -= begin;
|
38596 | this.offset = 0;
|
38597 | this.limit = len;
|
38598 | return this;
|
38599 | };
|
38600 |
|
38601 | |
38602 |
|
38603 |
|
38604 |
|
38605 |
|
38606 |
|
38607 |
|
38608 |
|
38609 | ByteBufferPrototype.copy = function(begin, end) {
|
38610 | if (typeof begin === 'undefined') begin = this.offset;
|
38611 | if (typeof end === 'undefined') end = this.limit;
|
38612 | if (!this.noAssert) {
|
38613 | if (typeof begin !== 'number' || begin % 1 !== 0)
|
38614 | throw TypeError("Illegal begin: Not an integer");
|
38615 | begin >>>= 0;
|
38616 | if (typeof end !== 'number' || end % 1 !== 0)
|
38617 | throw TypeError("Illegal end: Not an integer");
|
38618 | end >>>= 0;
|
38619 | if (begin < 0 || begin > end || end > this.buffer.byteLength)
|
38620 | throw RangeError("Illegal range: 0 <= "+begin+" <= "+end+" <= "+this.buffer.byteLength);
|
38621 | }
|
38622 | if (begin === end)
|
38623 | return new ByteBuffer(0, this.littleEndian, this.noAssert);
|
38624 | var capacity = end - begin,
|
38625 | bb = new ByteBuffer(capacity, this.littleEndian, this.noAssert);
|
38626 | bb.offset = 0;
|
38627 | bb.limit = capacity;
|
38628 | if (bb.markedOffset >= 0) bb.markedOffset -= begin;
|
38629 | this.copyTo(bb, 0, begin, end);
|
38630 | return bb;
|
38631 | };
|
38632 |
|
38633 | |
38634 |
|
38635 |
|
38636 |
|
38637 |
|
38638 |
|
38639 |
|
38640 |
|
38641 |
|
38642 |
|
38643 |
|
38644 |
|
38645 | ByteBufferPrototype.copyTo = function(target, targetOffset, sourceOffset, sourceLimit) {
|
38646 | var relative,
|
38647 | targetRelative;
|
38648 | if (!this.noAssert) {
|
38649 | if (!ByteBuffer.isByteBuffer(target))
|
38650 | throw TypeError("Illegal target: Not a ByteBuffer");
|
38651 | }
|
38652 | targetOffset = (targetRelative = typeof targetOffset === 'undefined') ? target.offset : targetOffset | 0;
|
38653 | sourceOffset = (relative = typeof sourceOffset === 'undefined') ? this.offset : sourceOffset | 0;
|
38654 | sourceLimit = typeof sourceLimit === 'undefined' ? this.limit : sourceLimit | 0;
|
38655 |
|
38656 | if (targetOffset < 0 || targetOffset > target.buffer.byteLength)
|
38657 | throw RangeError("Illegal target range: 0 <= "+targetOffset+" <= "+target.buffer.byteLength);
|
38658 | if (sourceOffset < 0 || sourceLimit > this.buffer.byteLength)
|
38659 | throw RangeError("Illegal source range: 0 <= "+sourceOffset+" <= "+this.buffer.byteLength);
|
38660 |
|
38661 | var len = sourceLimit - sourceOffset;
|
38662 | if (len === 0)
|
38663 | return target;
|
38664 |
|
38665 | target.ensureCapacity(targetOffset + len);
|
38666 |
|
38667 | target.view.set(this.view.subarray(sourceOffset, sourceLimit), targetOffset);
|
38668 |
|
38669 | if (relative) this.offset += len;
|
38670 | if (targetRelative) target.offset += len;
|
38671 |
|
38672 | return this;
|
38673 | };
|
38674 |
|
38675 | |
38676 |
|
38677 |
|
38678 |
|
38679 |
|
38680 |
|
38681 |
|
38682 |
|
38683 | ByteBufferPrototype.ensureCapacity = function(capacity) {
|
38684 | var current = this.buffer.byteLength;
|
38685 | if (current < capacity)
|
38686 | return this.resize((current *= 2) > capacity ? current : capacity);
|
38687 | return this;
|
38688 | };
|
38689 |
|
38690 | |
38691 |
|
38692 |
|
38693 |
|
38694 |
|
38695 |
|
38696 |
|
38697 |
|
38698 |
|
38699 |
|
38700 |
|
38701 | ByteBufferPrototype.fill = function(value, begin, end) {
|
38702 | var relative = typeof begin === 'undefined';
|
38703 | if (relative) begin = this.offset;
|
38704 | if (typeof value === 'string' && value.length > 0)
|
38705 | value = value.charCodeAt(0);
|
38706 | if (typeof begin === 'undefined') begin = this.offset;
|
38707 | if (typeof end === 'undefined') end = this.limit;
|
38708 | if (!this.noAssert) {
|
38709 | if (typeof value !== 'number' || value % 1 !== 0)
|
38710 | throw TypeError("Illegal value: "+value+" (not an integer)");
|
38711 | value |= 0;
|
38712 | if (typeof begin !== 'number' || begin % 1 !== 0)
|
38713 | throw TypeError("Illegal begin: Not an integer");
|
38714 | begin >>>= 0;
|
38715 | if (typeof end !== 'number' || end % 1 !== 0)
|
38716 | throw TypeError("Illegal end: Not an integer");
|
38717 | end >>>= 0;
|
38718 | if (begin < 0 || begin > end || end > this.buffer.byteLength)
|
38719 | throw RangeError("Illegal range: 0 <= "+begin+" <= "+end+" <= "+this.buffer.byteLength);
|
38720 | }
|
38721 | if (begin >= end)
|
38722 | return this;
|
38723 | while (begin < end) this.view[begin++] = value;
|
38724 | if (relative) this.offset = begin;
|
38725 | return this;
|
38726 | };
|
38727 |
|
38728 | |
38729 |
|
38730 |
|
38731 |
|
38732 |
|
38733 |
|
38734 | ByteBufferPrototype.flip = function() {
|
38735 | this.limit = this.offset;
|
38736 | this.offset = 0;
|
38737 | return this;
|
38738 | };
|
38739 | |
38740 |
|
38741 |
|
38742 |
|
38743 |
|
38744 |
|
38745 |
|
38746 |
|
38747 |
|
38748 | ByteBufferPrototype.mark = function(offset) {
|
38749 | offset = typeof offset === 'undefined' ? this.offset : offset;
|
38750 | if (!this.noAssert) {
|
38751 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
38752 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
38753 | offset >>>= 0;
|
38754 | if (offset < 0 || offset + 0 > this.buffer.byteLength)
|
38755 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength);
|
38756 | }
|
38757 | this.markedOffset = offset;
|
38758 | return this;
|
38759 | };
|
38760 | |
38761 |
|
38762 |
|
38763 |
|
38764 |
|
38765 |
|
38766 | ByteBufferPrototype.order = function(littleEndian) {
|
38767 | if (!this.noAssert) {
|
38768 | if (typeof littleEndian !== 'boolean')
|
38769 | throw TypeError("Illegal littleEndian: Not a boolean");
|
38770 | }
|
38771 | this.littleEndian = !!littleEndian;
|
38772 | return this;
|
38773 | };
|
38774 |
|
38775 | |
38776 |
|
38777 |
|
38778 |
|
38779 |
|
38780 |
|
38781 | ByteBufferPrototype.LE = function(littleEndian) {
|
38782 | this.littleEndian = typeof littleEndian !== 'undefined' ? !!littleEndian : true;
|
38783 | return this;
|
38784 | };
|
38785 |
|
38786 | |
38787 |
|
38788 |
|
38789 |
|
38790 |
|
38791 |
|
38792 | ByteBufferPrototype.BE = function(bigEndian) {
|
38793 | this.littleEndian = typeof bigEndian !== 'undefined' ? !bigEndian : false;
|
38794 | return this;
|
38795 | };
|
38796 | |
38797 |
|
38798 |
|
38799 |
|
38800 |
|
38801 |
|
38802 |
|
38803 |
|
38804 |
|
38805 |
|
38806 |
|
38807 |
|
38808 |
|
38809 |
|
38810 | ByteBufferPrototype.prepend = function(source, encoding, offset) {
|
38811 | if (typeof encoding === 'number' || typeof encoding !== 'string') {
|
38812 | offset = encoding;
|
38813 | encoding = undefined;
|
38814 | }
|
38815 | var relative = typeof offset === 'undefined';
|
38816 | if (relative) offset = this.offset;
|
38817 | if (!this.noAssert) {
|
38818 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
38819 | throw TypeError("Illegal offset: "+offset+" (not an integer)");
|
38820 | offset >>>= 0;
|
38821 | if (offset < 0 || offset + 0 > this.buffer.byteLength)
|
38822 | throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength);
|
38823 | }
|
38824 | if (!(source instanceof ByteBuffer))
|
38825 | source = ByteBuffer.wrap(source, encoding);
|
38826 | var len = source.limit - source.offset;
|
38827 | if (len <= 0) return this;
|
38828 | var diff = len - offset;
|
38829 | if (diff > 0) {
|
38830 | var buffer = new ArrayBuffer(this.buffer.byteLength + diff);
|
38831 | var view = new Uint8Array(buffer);
|
38832 | view.set(this.view.subarray(offset, this.buffer.byteLength), len);
|
38833 | this.buffer = buffer;
|
38834 | this.view = view;
|
38835 | this.offset += diff;
|
38836 | if (this.markedOffset >= 0) this.markedOffset += diff;
|
38837 | this.limit += diff;
|
38838 | offset += diff;
|
38839 | } else {
|
38840 | var arrayView = new Uint8Array(this.buffer);
|
38841 | }
|
38842 | this.view.set(source.view.subarray(source.offset, source.limit), offset - len);
|
38843 |
|
38844 | source.offset = source.limit;
|
38845 | if (relative)
|
38846 | this.offset -= len;
|
38847 | return this;
|
38848 | };
|
38849 |
|
38850 | |
38851 |
|
38852 |
|
38853 |
|
38854 |
|
38855 |
|
38856 |
|
38857 |
|
38858 |
|
38859 |
|
38860 |
|
38861 | ByteBufferPrototype.prependTo = function(target, offset) {
|
38862 | target.prepend(this, offset);
|
38863 | return this;
|
38864 | };
|
38865 | |
38866 |
|
38867 |
|
38868 |
|
38869 |
|
38870 | ByteBufferPrototype.printDebug = function(out) {
|
38871 | if (typeof out !== 'function') out = console.log.bind(console);
|
38872 | out(
|
38873 | this.toString()+"\n"+
|
38874 | "-------------------------------------------------------------------\n"+
|
38875 | this.toDebug( true)
|
38876 | );
|
38877 | };
|
38878 |
|
38879 | |
38880 |
|
38881 |
|
38882 |
|
38883 |
|
38884 |
|
38885 | ByteBufferPrototype.remaining = function() {
|
38886 | return this.limit - this.offset;
|
38887 | };
|
38888 | |
38889 |
|
38890 |
|
38891 |
|
38892 |
|
38893 |
|
38894 |
|
38895 |
|
38896 | ByteBufferPrototype.reset = function() {
|
38897 | if (this.markedOffset >= 0) {
|
38898 | this.offset = this.markedOffset;
|
38899 | this.markedOffset = -1;
|
38900 | } else {
|
38901 | this.offset = 0;
|
38902 | }
|
38903 | return this;
|
38904 | };
|
38905 | |
38906 |
|
38907 |
|
38908 |
|
38909 |
|
38910 |
|
38911 |
|
38912 |
|
38913 |
|
38914 | ByteBufferPrototype.resize = function(capacity) {
|
38915 | if (!this.noAssert) {
|
38916 | if (typeof capacity !== 'number' || capacity % 1 !== 0)
|
38917 | throw TypeError("Illegal capacity: "+capacity+" (not an integer)");
|
38918 | capacity |= 0;
|
38919 | if (capacity < 0)
|
38920 | throw RangeError("Illegal capacity: 0 <= "+capacity);
|
38921 | }
|
38922 | if (this.buffer.byteLength < capacity) {
|
38923 | var buffer = new ArrayBuffer(capacity);
|
38924 | var view = new Uint8Array(buffer);
|
38925 | view.set(this.view);
|
38926 | this.buffer = buffer;
|
38927 | this.view = view;
|
38928 | }
|
38929 | return this;
|
38930 | };
|
38931 | |
38932 |
|
38933 |
|
38934 |
|
38935 |
|
38936 |
|
38937 |
|
38938 | ByteBufferPrototype.reverse = function(begin, end) {
|
38939 | if (typeof begin === 'undefined') begin = this.offset;
|
38940 | if (typeof end === 'undefined') end = this.limit;
|
38941 | if (!this.noAssert) {
|
38942 | if (typeof begin !== 'number' || begin % 1 !== 0)
|
38943 | throw TypeError("Illegal begin: Not an integer");
|
38944 | begin >>>= 0;
|
38945 | if (typeof end !== 'number' || end % 1 !== 0)
|
38946 | throw TypeError("Illegal end: Not an integer");
|
38947 | end >>>= 0;
|
38948 | if (begin < 0 || begin > end || end > this.buffer.byteLength)
|
38949 | throw RangeError("Illegal range: 0 <= "+begin+" <= "+end+" <= "+this.buffer.byteLength);
|
38950 | }
|
38951 | if (begin === end)
|
38952 | return this;
|
38953 | Array.prototype.reverse.call(this.view.subarray(begin, end));
|
38954 | return this;
|
38955 | };
|
38956 | |
38957 |
|
38958 |
|
38959 |
|
38960 |
|
38961 |
|
38962 | ByteBufferPrototype.skip = function(length) {
|
38963 | if (!this.noAssert) {
|
38964 | if (typeof length !== 'number' || length % 1 !== 0)
|
38965 | throw TypeError("Illegal length: "+length+" (not an integer)");
|
38966 | length |= 0;
|
38967 | }
|
38968 | var offset = this.offset + length;
|
38969 | if (!this.noAssert) {
|
38970 | if (offset < 0 || offset > this.buffer.byteLength)
|
38971 | throw RangeError("Illegal length: 0 <= "+this.offset+" + "+length+" <= "+this.buffer.byteLength);
|
38972 | }
|
38973 | this.offset = offset;
|
38974 | return this;
|
38975 | };
|
38976 |
|
38977 | |
38978 |
|
38979 |
|
38980 |
|
38981 |
|
38982 |
|
38983 |
|
38984 | ByteBufferPrototype.slice = function(begin, end) {
|
38985 | if (typeof begin === 'undefined') begin = this.offset;
|
38986 | if (typeof end === 'undefined') end = this.limit;
|
38987 | if (!this.noAssert) {
|
38988 | if (typeof begin !== 'number' || begin % 1 !== 0)
|
38989 | throw TypeError("Illegal begin: Not an integer");
|
38990 | begin >>>= 0;
|
38991 | if (typeof end !== 'number' || end % 1 !== 0)
|
38992 | throw TypeError("Illegal end: Not an integer");
|
38993 | end >>>= 0;
|
38994 | if (begin < 0 || begin > end || end > this.buffer.byteLength)
|
38995 | throw RangeError("Illegal range: 0 <= "+begin+" <= "+end+" <= "+this.buffer.byteLength);
|
38996 | }
|
38997 | var bb = this.clone();
|
38998 | bb.offset = begin;
|
38999 | bb.limit = end;
|
39000 | return bb;
|
39001 | };
|
39002 | |
39003 |
|
39004 |
|
39005 |
|
39006 |
|
39007 |
|
39008 |
|
39009 |
|
39010 | ByteBufferPrototype.toBuffer = function(forceCopy) {
|
39011 | var offset = this.offset,
|
39012 | limit = this.limit;
|
39013 | if (!this.noAssert) {
|
39014 | if (typeof offset !== 'number' || offset % 1 !== 0)
|
39015 | throw TypeError("Illegal offset: Not an integer");
|
39016 | offset >>>= 0;
|
39017 | if (typeof limit !== 'number' || limit % 1 !== 0)
|
39018 | throw TypeError("Illegal limit: Not an integer");
|
39019 | limit >>>= 0;
|
39020 | if (offset < 0 || offset > limit || limit > this.buffer.byteLength)
|
39021 | throw RangeError("Illegal range: 0 <= "+offset+" <= "+limit+" <= "+this.buffer.byteLength);
|
39022 | }
|
39023 |
|
39024 |
|
39025 | if (!forceCopy && offset === 0 && limit === this.buffer.byteLength)
|
39026 | return this.buffer;
|
39027 | if (offset === limit)
|
39028 | return EMPTY_BUFFER;
|
39029 | var buffer = new ArrayBuffer(limit - offset);
|
39030 | new Uint8Array(buffer).set(new Uint8Array(this.buffer).subarray(offset, limit), 0);
|
39031 | return buffer;
|
39032 | };
|
39033 |
|
39034 | |
39035 |
|
39036 |
|
39037 |
|
39038 |
|
39039 |
|
39040 |
|
39041 |
|
39042 |
|
39043 | ByteBufferPrototype.toArrayBuffer = ByteBufferPrototype.toBuffer;
|
39044 |
|
39045 | |
39046 |
|
39047 |
|
39048 |
|
39049 |
|
39050 |
|
39051 |
|
39052 |
|
39053 |
|
39054 |
|
39055 |
|
39056 | ByteBufferPrototype.toString = function(encoding, begin, end) {
|
39057 | if (typeof encoding === 'undefined')
|
39058 | return "ByteBufferAB(offset="+this.offset+",markedOffset="+this.markedOffset+",limit="+this.limit+",capacity="+this.capacity()+")";
|
39059 | if (typeof encoding === 'number')
|
39060 | encoding = "utf8",
|
39061 | begin = encoding,
|
39062 | end = begin;
|
39063 | switch (encoding) {
|
39064 | case "utf8":
|
39065 | return this.toUTF8(begin, end);
|
39066 | case "base64":
|
39067 | return this.toBase64(begin, end);
|
39068 | case "hex":
|
39069 | return this.toHex(begin, end);
|
39070 | case "binary":
|
39071 | return this.toBinary(begin, end);
|
39072 | case "debug":
|
39073 | return this.toDebug();
|
39074 | case "columns":
|
39075 | return this.toColumns();
|
39076 | default:
|
39077 | throw Error("Unsupported encoding: "+encoding);
|
39078 | }
|
39079 | };
|
39080 |
|
39081 |
|
39082 |
|
39083 | |
39084 |
|
39085 |
|
39086 |
|
39087 |
|
39088 | var lxiv = function() {
|
39089 | "use strict";
|
39090 |
|
39091 | |
39092 |
|
39093 |
|
39094 |
|
39095 |
|
39096 | var lxiv = {};
|
39097 |
|
39098 | |
39099 |
|
39100 |
|
39101 |
|
39102 |
|
39103 | var aout = [
|
39104 | 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
|
39105 | 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 97, 98, 99, 100, 101, 102,
|
39106 | 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118,
|
39107 | 119, 120, 121, 122, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 43, 47
|
39108 | ];
|
39109 |
|
39110 | |
39111 |
|
39112 |
|
39113 |
|
39114 |
|
39115 | var ain = [];
|
39116 | for (var i=0, k=aout.length; i<k; ++i)
|
39117 | ain[aout[i]] = i;
|
39118 |
|
39119 | |
39120 |
|
39121 |
|
39122 |
|
39123 |
|
39124 |
|
39125 |
|
39126 | lxiv.encode = function(src, dst) {
|
39127 | var b, t;
|
39128 | while ((b = src()) !== null) {
|
39129 | dst(aout[(b>>2)&0x3f]);
|
39130 | t = (b&0x3)<<4;
|
39131 | if ((b = src()) !== null) {
|
39132 | t |= (b>>4)&0xf;
|
39133 | dst(aout[(t|((b>>4)&0xf))&0x3f]);
|
39134 | t = (b&0xf)<<2;
|
39135 | if ((b = src()) !== null)
|
39136 | dst(aout[(t|((b>>6)&0x3))&0x3f]),
|
39137 | dst(aout[b&0x3f]);
|
39138 | else
|
39139 | dst(aout[t&0x3f]),
|
39140 | dst(61);
|
39141 | } else
|
39142 | dst(aout[t&0x3f]),
|
39143 | dst(61),
|
39144 | dst(61);
|
39145 | }
|
39146 | };
|
39147 |
|
39148 | |
39149 |
|
39150 |
|
39151 |
|
39152 |
|
39153 |
|
39154 |
|
39155 | lxiv.decode = function(src, dst) {
|
39156 | var c, t1, t2;
|
39157 | function fail(c) {
|
39158 | throw Error("Illegal character code: "+c);
|
39159 | }
|
39160 | while ((c = src()) !== null) {
|
39161 | t1 = ain[c];
|
39162 | if (typeof t1 === 'undefined') fail(c);
|
39163 | if ((c = src()) !== null) {
|
39164 | t2 = ain[c];
|
39165 | if (typeof t2 === 'undefined') fail(c);
|
39166 | dst((t1<<2)>>>0|(t2&0x30)>>4);
|
39167 | if ((c = src()) !== null) {
|
39168 | t1 = ain[c];
|
39169 | if (typeof t1 === 'undefined')
|
39170 | if (c === 61) break; else fail(c);
|
39171 | dst(((t2&0xf)<<4)>>>0|(t1&0x3c)>>2);
|
39172 | if ((c = src()) !== null) {
|
39173 | t2 = ain[c];
|
39174 | if (typeof t2 === 'undefined')
|
39175 | if (c === 61) break; else fail(c);
|
39176 | dst(((t1&0x3)<<6)>>>0|t2);
|
39177 | }
|
39178 | }
|
39179 | }
|
39180 | }
|
39181 | };
|
39182 |
|
39183 | |
39184 |
|
39185 |
|
39186 |
|
39187 |
|
39188 | lxiv.test = function(str) {
|
39189 | return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(str);
|
39190 | };
|
39191 |
|
39192 | return lxiv;
|
39193 | }();
|
39194 |
|
39195 |
|
39196 |
|
39197 | |
39198 |
|
39199 |
|
39200 |
|
39201 |
|
39202 |
|
39203 |
|
39204 |
|
39205 | ByteBufferPrototype.toBase64 = function(begin, end) {
|
39206 | if (typeof begin === 'undefined')
|
39207 | begin = this.offset;
|
39208 | if (typeof end === 'undefined')
|
39209 | end = this.limit;
|
39210 | begin = begin | 0; end = end | 0;
|
39211 | if (begin < 0 || end > this.capacity || begin > end)
|
39212 | throw RangeError("begin, end");
|
39213 | var sd; lxiv.encode(function() {
|
39214 | return begin < end ? this.view[begin++] : null;
|
39215 | }.bind(this), sd = stringDestination());
|
39216 | return sd();
|
39217 | };
|
39218 |
|
39219 | |
39220 |
|
39221 |
|
39222 |
|
39223 |
|
39224 |
|
39225 |
|
39226 |
|
39227 | ByteBuffer.fromBase64 = function(str, littleEndian) {
|
39228 | if (typeof str !== 'string')
|
39229 | throw TypeError("str");
|
39230 | var bb = new ByteBuffer(str.length/4*3, littleEndian),
|
39231 | i = 0;
|
39232 | lxiv.decode(stringSource(str), function(b) {
|
39233 | bb.view[i++] = b;
|
39234 | });
|
39235 | bb.limit = i;
|
39236 | return bb;
|
39237 | };
|
39238 |
|
39239 | |
39240 |
|
39241 |
|
39242 |
|
39243 |
|
39244 |
|
39245 |
|
39246 | ByteBuffer.btoa = function(str) {
|
39247 | return ByteBuffer.fromBinary(str).toBase64();
|
39248 | };
|
39249 |
|
39250 | |
39251 |
|
39252 |
|
39253 |
|
39254 |
|
39255 |
|
39256 |
|
39257 | ByteBuffer.atob = function(b64) {
|
39258 | return ByteBuffer.fromBase64(b64).toBinary();
|
39259 | };
|
39260 |
|
39261 |
|
39262 |
|
39263 | |
39264 |
|
39265 |
|
39266 |
|
39267 |
|
39268 |
|
39269 |
|
39270 |
|
39271 | ByteBufferPrototype.toBinary = function(begin, end) {
|
39272 | if (typeof begin === 'undefined')
|
39273 | begin = this.offset;
|
39274 | if (typeof end === 'undefined')
|
39275 | end = this.limit;
|
39276 | begin |= 0; end |= 0;
|
39277 | if (begin < 0 || end > this.capacity() || begin > end)
|
39278 | throw RangeError("begin, end");
|
39279 | if (begin === end)
|
39280 | return "";
|
39281 | var chars = [],
|
39282 | parts = [];
|
39283 | while (begin < end) {
|
39284 | chars.push(this.view[begin++]);
|
39285 | if (chars.length >= 1024)
|
39286 | parts.push(String.fromCharCode.apply(String, chars)),
|
39287 | chars = [];
|
39288 | }
|
39289 | return parts.join('') + String.fromCharCode.apply(String, chars);
|
39290 | };
|
39291 |
|
39292 | |
39293 |
|
39294 |
|
39295 |
|
39296 |
|
39297 |
|
39298 |
|
39299 |
|
39300 | ByteBuffer.fromBinary = function(str, littleEndian) {
|
39301 | if (typeof str !== 'string')
|
39302 | throw TypeError("str");
|
39303 | var i = 0,
|
39304 | k = str.length,
|
39305 | charCode,
|
39306 | bb = new ByteBuffer(k, littleEndian);
|
39307 | while (i<k) {
|
39308 | charCode = str.charCodeAt(i);
|
39309 | if (charCode > 0xff)
|
39310 | throw RangeError("illegal char code: "+charCode);
|
39311 | bb.view[i++] = charCode;
|
39312 | }
|
39313 | bb.limit = k;
|
39314 | return bb;
|
39315 | };
|
39316 |
|
39317 |
|
39318 |
|
39319 | |
39320 |
|
39321 |
|
39322 |
|
39323 |
|
39324 |
|
39325 |
|
39326 |
|
39327 |
|
39328 |
|
39329 |
|
39330 |
|
39331 |
|
39332 |
|
39333 |
|
39334 |
|
39335 |
|
39336 | ByteBufferPrototype.toDebug = function(columns) {
|
39337 | var i = -1,
|
39338 | k = this.buffer.byteLength,
|
39339 | b,
|
39340 | hex = "",
|
39341 | asc = "",
|
39342 | out = "";
|
39343 | while (i<k) {
|
39344 | if (i !== -1) {
|
39345 | b = this.view[i];
|
39346 | if (b < 0x10) hex += "0"+b.toString(16).toUpperCase();
|
39347 | else hex += b.toString(16).toUpperCase();
|
39348 | if (columns)
|
39349 | asc += b > 32 && b < 127 ? String.fromCharCode(b) : '.';
|
39350 | }
|
39351 | ++i;
|
39352 | if (columns) {
|
39353 | if (i > 0 && i % 16 === 0 && i !== k) {
|
39354 | while (hex.length < 3*16+3) hex += " ";
|
39355 | out += hex+asc+"\n";
|
39356 | hex = asc = "";
|
39357 | }
|
39358 | }
|
39359 | if (i === this.offset && i === this.limit)
|
39360 | hex += i === this.markedOffset ? "!" : "|";
|
39361 | else if (i === this.offset)
|
39362 | hex += i === this.markedOffset ? "[" : "<";
|
39363 | else if (i === this.limit)
|
39364 | hex += i === this.markedOffset ? "]" : ">";
|
39365 | else
|
39366 | hex += i === this.markedOffset ? "'" : (columns || (i !== 0 && i !== k) ? " " : "");
|
39367 | }
|
39368 | if (columns && hex !== " ") {
|
39369 | while (hex.length < 3*16+3)
|
39370 | hex += " ";
|
39371 | out += hex + asc + "\n";
|
39372 | }
|
39373 | return columns ? out : hex;
|
39374 | };
|
39375 |
|
39376 | |
39377 |
|
39378 |
|
39379 |
|
39380 |
|
39381 |
|
39382 |
|
39383 |
|
39384 |
|
39385 |
|
39386 |
|
39387 | ByteBuffer.fromDebug = function(str, littleEndian, noAssert) {
|
39388 | var k = str.length,
|
39389 | bb = new ByteBuffer(((k+1)/3)|0, littleEndian, noAssert);
|
39390 | var i = 0, j = 0, ch, b,
|
39391 | rs = false,
|
39392 | ho = false, hm = false, hl = false,
|
39393 | fail = false;
|
39394 | while (i<k) {
|
39395 | switch (ch = str.charAt(i++)) {
|
39396 | case '!':
|
39397 | if (!noAssert) {
|
39398 | if (ho || hm || hl) {
|
39399 | fail = true;
|
39400 | break;
|
39401 | }
|
39402 | ho = hm = hl = true;
|
39403 | }
|
39404 | bb.offset = bb.markedOffset = bb.limit = j;
|
39405 | rs = false;
|
39406 | break;
|
39407 | case '|':
|
39408 | if (!noAssert) {
|
39409 | if (ho || hl) {
|
39410 | fail = true;
|
39411 | break;
|
39412 | }
|
39413 | ho = hl = true;
|
39414 | }
|
39415 | bb.offset = bb.limit = j;
|
39416 | rs = false;
|
39417 | break;
|
39418 | case '[':
|
39419 | if (!noAssert) {
|
39420 | if (ho || hm) {
|
39421 | fail = true;
|
39422 | break;
|
39423 | }
|
39424 | ho = hm = true;
|
39425 | }
|
39426 | bb.offset = bb.markedOffset = j;
|
39427 | rs = false;
|
39428 | break;
|
39429 | case '<':
|
39430 | if (!noAssert) {
|
39431 | if (ho) {
|
39432 | fail = true;
|
39433 | break;
|
39434 | }
|
39435 | ho = true;
|
39436 | }
|
39437 | bb.offset = j;
|
39438 | rs = false;
|
39439 | break;
|
39440 | case ']':
|
39441 | if (!noAssert) {
|
39442 | if (hl || hm) {
|
39443 | fail = true;
|
39444 | break;
|
39445 | }
|
39446 | hl = hm = true;
|
39447 | }
|
39448 | bb.limit = bb.markedOffset = j;
|
39449 | rs = false;
|
39450 | break;
|
39451 | case '>':
|
39452 | if (!noAssert) {
|
39453 | if (hl) {
|
39454 | fail = true;
|
39455 | break;
|
39456 | }
|
39457 | hl = true;
|
39458 | }
|
39459 | bb.limit = j;
|
39460 | rs = false;
|
39461 | break;
|
39462 | case "'":
|
39463 | if (!noAssert) {
|
39464 | if (hm) {
|
39465 | fail = true;
|
39466 | break;
|
39467 | }
|
39468 | hm = true;
|
39469 | }
|
39470 | bb.markedOffset = j;
|
39471 | rs = false;
|
39472 | break;
|
39473 | case ' ':
|
39474 | rs = false;
|
39475 | break;
|
39476 | default:
|
39477 | if (!noAssert) {
|
39478 | if (rs) {
|
39479 | fail = true;
|
39480 | break;
|
39481 | }
|
39482 | }
|
39483 | b = parseInt(ch+str.charAt(i++), 16);
|
39484 | if (!noAssert) {
|
39485 | if (isNaN(b) || b < 0 || b > 255)
|
39486 | throw TypeError("Illegal str: Not a debug encoded string");
|
39487 | }
|
39488 | bb.view[j++] = b;
|
39489 | rs = true;
|
39490 | }
|
39491 | if (fail)
|
39492 | throw TypeError("Illegal str: Invalid symbol at "+i);
|
39493 | }
|
39494 | if (!noAssert) {
|
39495 | if (!ho || !hl)
|
39496 | throw TypeError("Illegal str: Missing offset or limit");
|
39497 | if (j<bb.buffer.byteLength)
|
39498 | throw TypeError("Illegal str: Not a debug encoded string (is it hex?) "+j+" < "+k);
|
39499 | }
|
39500 | return bb;
|
39501 | };
|
39502 |
|
39503 |
|
39504 |
|
39505 | |
39506 |
|
39507 |
|
39508 |
|
39509 |
|
39510 |
|
39511 |
|
39512 | ByteBufferPrototype.toHex = function(begin, end) {
|
39513 | begin = typeof begin === 'undefined' ? this.offset : begin;
|
39514 | end = typeof end === 'undefined' ? this.limit : end;
|
39515 | if (!this.noAssert) {
|
39516 | if (typeof begin !== 'number' || begin % 1 !== 0)
|
39517 | throw TypeError("Illegal begin: Not an integer");
|
39518 | begin >>>= 0;
|
39519 | if (typeof end !== 'number' || end % 1 !== 0)
|
39520 | throw TypeError("Illegal end: Not an integer");
|
39521 | end >>>= 0;
|
39522 | if (begin < 0 || begin > end || end > this.buffer.byteLength)
|
39523 | throw RangeError("Illegal range: 0 <= "+begin+" <= "+end+" <= "+this.buffer.byteLength);
|
39524 | }
|
39525 | var out = new Array(end - begin),
|
39526 | b;
|
39527 | while (begin < end) {
|
39528 | b = this.view[begin++];
|
39529 | if (b < 0x10)
|
39530 | out.push("0", b.toString(16));
|
39531 | else out.push(b.toString(16));
|
39532 | }
|
39533 | return out.join('');
|
39534 | };
|
39535 |
|
39536 | |
39537 |
|
39538 |
|
39539 |
|
39540 |
|
39541 |
|
39542 |
|
39543 |
|
39544 |
|
39545 |
|
39546 | ByteBuffer.fromHex = function(str, littleEndian, noAssert) {
|
39547 | if (!noAssert) {
|
39548 | if (typeof str !== 'string')
|
39549 | throw TypeError("Illegal str: Not a string");
|
39550 | if (str.length % 2 !== 0)
|
39551 | throw TypeError("Illegal str: Length not a multiple of 2");
|
39552 | }
|
39553 | var k = str.length,
|
39554 | bb = new ByteBuffer((k / 2) | 0, littleEndian),
|
39555 | b;
|
39556 | for (var i=0, j=0; i<k; i+=2) {
|
39557 | b = parseInt(str.substring(i, i+2), 16);
|
39558 | if (!noAssert)
|
39559 | if (!isFinite(b) || b < 0 || b > 255)
|
39560 | throw TypeError("Illegal str: Contains non-hex characters");
|
39561 | bb.view[j++] = b;
|
39562 | }
|
39563 | bb.limit = j;
|
39564 | return bb;
|
39565 | };
|
39566 |
|
39567 |
|
39568 |
|
39569 | |
39570 |
|
39571 |
|
39572 |
|
39573 |
|
39574 | var utfx = function() {
|
39575 | "use strict";
|
39576 |
|
39577 | |
39578 |
|
39579 |
|
39580 |
|
39581 |
|
39582 | var utfx = {};
|
39583 |
|
39584 | |
39585 |
|
39586 |
|
39587 |
|
39588 |
|
39589 | utfx.MAX_CODEPOINT = 0x10FFFF;
|
39590 |
|
39591 | |
39592 |
|
39593 |
|
39594 |
|
39595 |
|
39596 |
|
39597 | utfx.encodeUTF8 = function(src, dst) {
|
39598 | var cp = null;
|
39599 | if (typeof src === 'number')
|
39600 | cp = src,
|
39601 | src = function() { return null; };
|
39602 | while (cp !== null || (cp = src()) !== null) {
|
39603 | if (cp < 0x80)
|
39604 | dst(cp&0x7F);
|
39605 | else if (cp < 0x800)
|
39606 | dst(((cp>>6)&0x1F)|0xC0),
|
39607 | dst((cp&0x3F)|0x80);
|
39608 | else if (cp < 0x10000)
|
39609 | dst(((cp>>12)&0x0F)|0xE0),
|
39610 | dst(((cp>>6)&0x3F)|0x80),
|
39611 | dst((cp&0x3F)|0x80);
|
39612 | else
|
39613 | dst(((cp>>18)&0x07)|0xF0),
|
39614 | dst(((cp>>12)&0x3F)|0x80),
|
39615 | dst(((cp>>6)&0x3F)|0x80),
|
39616 | dst((cp&0x3F)|0x80);
|
39617 | cp = null;
|
39618 | }
|
39619 | };
|
39620 |
|
39621 | |
39622 |
|
39623 |
|
39624 |
|
39625 |
|
39626 |
|
39627 |
|
39628 |
|
39629 |
|
39630 | utfx.decodeUTF8 = function(src, dst) {
|
39631 | var a, b, c, d, fail = function(b) {
|
39632 | b = b.slice(0, b.indexOf(null));
|
39633 | var err = Error(b.toString());
|
39634 | err.name = "TruncatedError";
|
39635 | err['bytes'] = b;
|
39636 | throw err;
|
39637 | };
|
39638 | while ((a = src()) !== null) {
|
39639 | if ((a&0x80) === 0)
|
39640 | dst(a);
|
39641 | else if ((a&0xE0) === 0xC0)
|
39642 | ((b = src()) === null) && fail([a, b]),
|
39643 | dst(((a&0x1F)<<6) | (b&0x3F));
|
39644 | else if ((a&0xF0) === 0xE0)
|
39645 | ((b=src()) === null || (c=src()) === null) && fail([a, b, c]),
|
39646 | dst(((a&0x0F)<<12) | ((b&0x3F)<<6) | (c&0x3F));
|
39647 | else if ((a&0xF8) === 0xF0)
|
39648 | ((b=src()) === null || (c=src()) === null || (d=src()) === null) && fail([a, b, c ,d]),
|
39649 | dst(((a&0x07)<<18) | ((b&0x3F)<<12) | ((c&0x3F)<<6) | (d&0x3F));
|
39650 | else throw RangeError("Illegal starting byte: "+a);
|
39651 | }
|
39652 | };
|
39653 |
|
39654 | |
39655 |
|
39656 |
|
39657 |
|
39658 |
|
39659 |
|
39660 |
|
39661 | utfx.UTF16toUTF8 = function(src, dst) {
|
39662 | var c1, c2 = null;
|
39663 | while (true) {
|
39664 | if ((c1 = c2 !== null ? c2 : src()) === null)
|
39665 | break;
|
39666 | if (c1 >= 0xD800 && c1 <= 0xDFFF) {
|
39667 | if ((c2 = src()) !== null) {
|
39668 | if (c2 >= 0xDC00 && c2 <= 0xDFFF) {
|
39669 | dst((c1-0xD800)*0x400+c2-0xDC00+0x10000);
|
39670 | c2 = null; continue;
|
39671 | }
|
39672 | }
|
39673 | }
|
39674 | dst(c1);
|
39675 | }
|
39676 | if (c2 !== null) dst(c2);
|
39677 | };
|
39678 |
|
39679 | |
39680 |
|
39681 |
|
39682 |
|
39683 |
|
39684 |
|
39685 |
|
39686 | utfx.UTF8toUTF16 = function(src, dst) {
|
39687 | var cp = null;
|
39688 | if (typeof src === 'number')
|
39689 | cp = src, src = function() { return null; };
|
39690 | while (cp !== null || (cp = src()) !== null) {
|
39691 | if (cp <= 0xFFFF)
|
39692 | dst(cp);
|
39693 | else
|
39694 | cp -= 0x10000,
|
39695 | dst((cp>>10)+0xD800),
|
39696 | dst((cp%0x400)+0xDC00);
|
39697 | cp = null;
|
39698 | }
|
39699 | };
|
39700 |
|
39701 | |
39702 |
|
39703 |
|
39704 |
|
39705 |
|
39706 |
|
39707 | utfx.encodeUTF16toUTF8 = function(src, dst) {
|
39708 | utfx.UTF16toUTF8(src, function(cp) {
|
39709 | utfx.encodeUTF8(cp, dst);
|
39710 | });
|
39711 | };
|
39712 |
|
39713 | |
39714 |
|
39715 |
|
39716 |
|
39717 |
|
39718 |
|
39719 |
|
39720 |
|
39721 | utfx.decodeUTF8toUTF16 = function(src, dst) {
|
39722 | utfx.decodeUTF8(src, function(cp) {
|
39723 | utfx.UTF8toUTF16(cp, dst);
|
39724 | });
|
39725 | };
|
39726 |
|
39727 | |
39728 |
|
39729 |
|
39730 |
|
39731 |
|
39732 | utfx.calculateCodePoint = function(cp) {
|
39733 | return (cp < 0x80) ? 1 : (cp < 0x800) ? 2 : (cp < 0x10000) ? 3 : 4;
|
39734 | };
|
39735 |
|
39736 | |
39737 |
|
39738 |
|
39739 |
|
39740 |
|
39741 |
|
39742 | utfx.calculateUTF8 = function(src) {
|
39743 | var cp, l=0;
|
39744 | while ((cp = src()) !== null)
|
39745 | l += (cp < 0x80) ? 1 : (cp < 0x800) ? 2 : (cp < 0x10000) ? 3 : 4;
|
39746 | return l;
|
39747 | };
|
39748 |
|
39749 | |
39750 |
|
39751 |
|
39752 |
|
39753 |
|
39754 |
|
39755 | utfx.calculateUTF16asUTF8 = function(src) {
|
39756 | var n=0, l=0;
|
39757 | utfx.UTF16toUTF8(src, function(cp) {
|
39758 | ++n; l += (cp < 0x80) ? 1 : (cp < 0x800) ? 2 : (cp < 0x10000) ? 3 : 4;
|
39759 | });
|
39760 | return [n,l];
|
39761 | };
|
39762 |
|
39763 | return utfx;
|
39764 | }();
|
39765 |
|
39766 |
|
39767 |
|
39768 | |
39769 |
|
39770 |
|
39771 |
|
39772 |
|
39773 |
|
39774 |
|
39775 | ByteBufferPrototype.toUTF8 = function(begin, end) {
|
39776 | if (typeof begin === 'undefined') begin = this.offset;
|
39777 | if (typeof end === 'undefined') end = this.limit;
|
39778 | if (!this.noAssert) {
|
39779 | if (typeof begin !== 'number' || begin % 1 !== 0)
|
39780 | throw TypeError("Illegal begin: Not an integer");
|
39781 | begin >>>= 0;
|
39782 | if (typeof end !== 'number' || end % 1 !== 0)
|
39783 | throw TypeError("Illegal end: Not an integer");
|
39784 | end >>>= 0;
|
39785 | if (begin < 0 || begin > end || end > this.buffer.byteLength)
|
39786 | throw RangeError("Illegal range: 0 <= "+begin+" <= "+end+" <= "+this.buffer.byteLength);
|
39787 | }
|
39788 | var sd; try {
|
39789 | utfx.decodeUTF8toUTF16(function() {
|
39790 | return begin < end ? this.view[begin++] : null;
|
39791 | }.bind(this), sd = stringDestination());
|
39792 | } catch (e) {
|
39793 | if (begin !== end)
|
39794 | throw RangeError("Illegal range: Truncated data, "+begin+" != "+end);
|
39795 | }
|
39796 | return sd();
|
39797 | };
|
39798 |
|
39799 | |
39800 |
|
39801 |
|
39802 |
|
39803 |
|
39804 |
|
39805 |
|
39806 |
|
39807 |
|
39808 |
|
39809 | ByteBuffer.fromUTF8 = function(str, littleEndian, noAssert) {
|
39810 | if (!noAssert)
|
39811 | if (typeof str !== 'string')
|
39812 | throw TypeError("Illegal str: Not a string");
|
39813 | var bb = new ByteBuffer(utfx.calculateUTF16asUTF8(stringSource(str), true)[1], littleEndian, noAssert),
|
39814 | i = 0;
|
39815 | utfx.encodeUTF16toUTF8(stringSource(str), function(b) {
|
39816 | bb.view[i++] = b;
|
39817 | });
|
39818 | bb.limit = i;
|
39819 | return bb;
|
39820 | };
|
39821 |
|
39822 | return ByteBuffer;
|
39823 | });
|
39824 |
|
39825 |
|
39826 | }),
|
39827 |
|
39828 | (function(module, exports, __webpack_require__) {
|
39829 |
|
39830 | var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; |
39831 |
|
39832 |
|
39833 |
|
39834 |
|
39835 |
|
39836 |
|
39837 |
|
39838 |
|
39839 |
|
39840 |
|
39841 |
|
39842 |
|
39843 |
|
39844 |
|
39845 |
|
39846 |
|
39847 |
|
39848 |
|
39849 |
|
39850 |
|
39851 |
|
39852 | (function(global, factory) {
|
39853 |
|
39854 | if (true)
|
39855 | !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
|
39856 | __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
|
39857 | (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
|
39858 | __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
|
39859 | else if (typeof require === 'function' && typeof module === "object" && module && module["exports"])
|
39860 | module["exports"] = factory();
|
39861 | else
|
39862 | (global["dcodeIO"] = global["dcodeIO"] || {})["Long"] = factory();
|
39863 |
|
39864 | })(this, function() {
|
39865 | "use strict";
|
39866 |
|
39867 | |
39868 |
|
39869 |
|
39870 |
|
39871 |
|
39872 |
|
39873 |
|
39874 |
|
39875 |
|
39876 |
|
39877 | function Long(low, high, unsigned) {
|
39878 |
|
39879 | |
39880 |
|
39881 |
|
39882 |
|
39883 | this.low = low | 0;
|
39884 |
|
39885 | |
39886 |
|
39887 |
|
39888 |
|
39889 | this.high = high | 0;
|
39890 |
|
39891 | |
39892 |
|
39893 |
|
39894 |
|
39895 | this.unsigned = !!unsigned;
|
39896 | }
|
39897 |
|
39898 |
|
39899 |
|
39900 |
|
39901 |
|
39902 |
|
39903 |
|
39904 |
|
39905 |
|
39906 |
|
39907 |
|
39908 |
|
39909 |
|
39910 |
|
39911 |
|
39912 |
|
39913 |
|
39914 |
|
39915 | |
39916 |
|
39917 |
|
39918 |
|
39919 |
|
39920 |
|
39921 | Long.prototype.__isLong__;
|
39922 |
|
39923 | Object.defineProperty(Long.prototype, "__isLong__", {
|
39924 | value: true,
|
39925 | enumerable: false,
|
39926 | configurable: false
|
39927 | });
|
39928 |
|
39929 | |
39930 |
|
39931 |
|
39932 |
|
39933 |
|
39934 |
|
39935 | function isLong(obj) {
|
39936 | return (obj && obj["__isLong__"]) === true;
|
39937 | }
|
39938 |
|
39939 | |
39940 |
|
39941 |
|
39942 |
|
39943 |
|
39944 |
|
39945 | Long.isLong = isLong;
|
39946 |
|
39947 | |
39948 |
|
39949 |
|
39950 |
|
39951 |
|
39952 | var INT_CACHE = {};
|
39953 |
|
39954 | |
39955 |
|
39956 |
|
39957 |
|
39958 |
|
39959 | var UINT_CACHE = {};
|
39960 |
|
39961 | |
39962 |
|
39963 |
|
39964 |
|
39965 |
|
39966 |
|
39967 | function fromInt(value, unsigned) {
|
39968 | var obj, cachedObj, cache;
|
39969 | if (unsigned) {
|
39970 | value >>>= 0;
|
39971 | if (cache = (0 <= value && value < 256)) {
|
39972 | cachedObj = UINT_CACHE[value];
|
39973 | if (cachedObj)
|
39974 | return cachedObj;
|
39975 | }
|
39976 | obj = fromBits(value, (value | 0) < 0 ? -1 : 0, true);
|
39977 | if (cache)
|
39978 | UINT_CACHE[value] = obj;
|
39979 | return obj;
|
39980 | } else {
|
39981 | value |= 0;
|
39982 | if (cache = (-128 <= value && value < 128)) {
|
39983 | cachedObj = INT_CACHE[value];
|
39984 | if (cachedObj)
|
39985 | return cachedObj;
|
39986 | }
|
39987 | obj = fromBits(value, value < 0 ? -1 : 0, false);
|
39988 | if (cache)
|
39989 | INT_CACHE[value] = obj;
|
39990 | return obj;
|
39991 | }
|
39992 | }
|
39993 |
|
39994 | |
39995 |
|
39996 |
|
39997 |
|
39998 |
|
39999 |
|
40000 |
|
40001 | Long.fromInt = fromInt;
|
40002 |
|
40003 | |
40004 |
|
40005 |
|
40006 |
|
40007 |
|
40008 |
|
40009 | function fromNumber(value, unsigned) {
|
40010 | if (isNaN(value) || !isFinite(value))
|
40011 | return unsigned ? UZERO : ZERO;
|
40012 | if (unsigned) {
|
40013 | if (value < 0)
|
40014 | return UZERO;
|
40015 | if (value >= TWO_PWR_64_DBL)
|
40016 | return MAX_UNSIGNED_VALUE;
|
40017 | } else {
|
40018 | if (value <= -TWO_PWR_63_DBL)
|
40019 | return MIN_VALUE;
|
40020 | if (value + 1 >= TWO_PWR_63_DBL)
|
40021 | return MAX_VALUE;
|
40022 | }
|
40023 | if (value < 0)
|
40024 | return fromNumber(-value, unsigned).neg();
|
40025 | return fromBits((value % TWO_PWR_32_DBL) | 0, (value / TWO_PWR_32_DBL) | 0, unsigned);
|
40026 | }
|
40027 |
|
40028 | |
40029 |
|
40030 |
|
40031 |
|
40032 |
|
40033 |
|
40034 |
|
40035 | Long.fromNumber = fromNumber;
|
40036 |
|
40037 | |
40038 |
|
40039 |
|
40040 |
|
40041 |
|
40042 |
|
40043 |
|
40044 | function fromBits(lowBits, highBits, unsigned) {
|
40045 | return new Long(lowBits, highBits, unsigned);
|
40046 | }
|
40047 |
|
40048 | |
40049 |
|
40050 |
|
40051 |
|
40052 |
|
40053 |
|
40054 |
|
40055 |
|
40056 |
|
40057 | Long.fromBits = fromBits;
|
40058 |
|
40059 | |
40060 |
|
40061 |
|
40062 |
|
40063 |
|
40064 |
|
40065 |
|
40066 | var pow_dbl = Math.pow;
|
40067 |
|
40068 | |
40069 |
|
40070 |
|
40071 |
|
40072 |
|
40073 |
|
40074 |
|
40075 | function fromString(str, unsigned, radix) {
|
40076 | if (str.length === 0)
|
40077 | throw Error('empty string');
|
40078 | if (str === "NaN" || str === "Infinity" || str === "+Infinity" || str === "-Infinity")
|
40079 | return ZERO;
|
40080 | if (typeof unsigned === 'number') {
|
40081 |
|
40082 | radix = unsigned,
|
40083 | unsigned = false;
|
40084 | } else {
|
40085 | unsigned = !! unsigned;
|
40086 | }
|
40087 | radix = radix || 10;
|
40088 | if (radix < 2 || 36 < radix)
|
40089 | throw RangeError('radix');
|
40090 |
|
40091 | var p;
|
40092 | if ((p = str.indexOf('-')) > 0)
|
40093 | throw Error('interior hyphen');
|
40094 | else if (p === 0) {
|
40095 | return fromString(str.substring(1), unsigned, radix).neg();
|
40096 | }
|
40097 |
|
40098 |
|
40099 |
|
40100 | var radixToPower = fromNumber(pow_dbl(radix, 8));
|
40101 |
|
40102 | var result = ZERO;
|
40103 | for (var i = 0; i < str.length; i += 8) {
|
40104 | var size = Math.min(8, str.length - i),
|
40105 | value = parseInt(str.substring(i, i + size), radix);
|
40106 | if (size < 8) {
|
40107 | var power = fromNumber(pow_dbl(radix, size));
|
40108 | result = result.mul(power).add(fromNumber(value));
|
40109 | } else {
|
40110 | result = result.mul(radixToPower);
|
40111 | result = result.add(fromNumber(value));
|
40112 | }
|
40113 | }
|
40114 | result.unsigned = unsigned;
|
40115 | return result;
|
40116 | }
|
40117 |
|
40118 | |
40119 |
|
40120 |
|
40121 |
|
40122 |
|
40123 |
|
40124 |
|
40125 |
|
40126 | Long.fromString = fromString;
|
40127 |
|
40128 | |
40129 |
|
40130 |
|
40131 |
|
40132 |
|
40133 |
|
40134 | function fromValue(val) {
|
40135 | if (val instanceof Long)
|
40136 | return val;
|
40137 | if (typeof val === 'number')
|
40138 | return fromNumber(val);
|
40139 | if (typeof val === 'string')
|
40140 | return fromString(val);
|
40141 |
|
40142 | return fromBits(val.low, val.high, val.unsigned);
|
40143 | }
|
40144 |
|
40145 | |
40146 |
|
40147 |
|
40148 |
|
40149 |
|
40150 |
|
40151 | Long.fromValue = fromValue;
|
40152 |
|
40153 |
|
40154 |
|
40155 |
|
40156 | |
40157 |
|
40158 |
|
40159 |
|
40160 |
|
40161 | var TWO_PWR_16_DBL = 1 << 16;
|
40162 |
|
40163 | |
40164 |
|
40165 |
|
40166 |
|
40167 |
|
40168 | var TWO_PWR_24_DBL = 1 << 24;
|
40169 |
|
40170 | |
40171 |
|
40172 |
|
40173 |
|
40174 |
|
40175 | var TWO_PWR_32_DBL = TWO_PWR_16_DBL * TWO_PWR_16_DBL;
|
40176 |
|
40177 | |
40178 |
|
40179 |
|
40180 |
|
40181 |
|
40182 | var TWO_PWR_64_DBL = TWO_PWR_32_DBL * TWO_PWR_32_DBL;
|
40183 |
|
40184 | |
40185 |
|
40186 |
|
40187 |
|
40188 |
|
40189 | var TWO_PWR_63_DBL = TWO_PWR_64_DBL / 2;
|
40190 |
|
40191 | |
40192 |
|
40193 |
|
40194 |
|
40195 |
|
40196 | var TWO_PWR_24 = fromInt(TWO_PWR_24_DBL);
|
40197 |
|
40198 | |
40199 |
|
40200 |
|
40201 |
|
40202 | var ZERO = fromInt(0);
|
40203 |
|
40204 | |
40205 |
|
40206 |
|
40207 |
|
40208 | Long.ZERO = ZERO;
|
40209 |
|
40210 | |
40211 |
|
40212 |
|
40213 |
|
40214 | var UZERO = fromInt(0, true);
|
40215 |
|
40216 | |
40217 |
|
40218 |
|
40219 |
|
40220 | Long.UZERO = UZERO;
|
40221 |
|
40222 | |
40223 |
|
40224 |
|
40225 |
|
40226 | var ONE = fromInt(1);
|
40227 |
|
40228 | |
40229 |
|
40230 |
|
40231 |
|
40232 | Long.ONE = ONE;
|
40233 |
|
40234 | |
40235 |
|
40236 |
|
40237 |
|
40238 | var UONE = fromInt(1, true);
|
40239 |
|
40240 | |
40241 |
|
40242 |
|
40243 |
|
40244 | Long.UONE = UONE;
|
40245 |
|
40246 | |
40247 |
|
40248 |
|
40249 |
|
40250 | var NEG_ONE = fromInt(-1);
|
40251 |
|
40252 | |
40253 |
|
40254 |
|
40255 |
|
40256 | Long.NEG_ONE = NEG_ONE;
|
40257 |
|
40258 | |
40259 |
|
40260 |
|
40261 |
|
40262 | var MAX_VALUE = fromBits(0xFFFFFFFF|0, 0x7FFFFFFF|0, false);
|
40263 |
|
40264 | |
40265 |
|
40266 |
|
40267 |
|
40268 | Long.MAX_VALUE = MAX_VALUE;
|
40269 |
|
40270 | |
40271 |
|
40272 |
|
40273 |
|
40274 | var MAX_UNSIGNED_VALUE = fromBits(0xFFFFFFFF|0, 0xFFFFFFFF|0, true);
|
40275 |
|
40276 | |
40277 |
|
40278 |
|
40279 |
|
40280 | Long.MAX_UNSIGNED_VALUE = MAX_UNSIGNED_VALUE;
|
40281 |
|
40282 | |
40283 |
|
40284 |
|
40285 |
|
40286 | var MIN_VALUE = fromBits(0, 0x80000000|0, false);
|
40287 |
|
40288 | |
40289 |
|
40290 |
|
40291 |
|
40292 | Long.MIN_VALUE = MIN_VALUE;
|
40293 |
|
40294 | |
40295 |
|
40296 |
|
40297 |
|
40298 | var LongPrototype = Long.prototype;
|
40299 |
|
40300 | |
40301 |
|
40302 |
|
40303 |
|
40304 | LongPrototype.toInt = function toInt() {
|
40305 | return this.unsigned ? this.low >>> 0 : this.low;
|
40306 | };
|
40307 |
|
40308 | |
40309 |
|
40310 |
|
40311 |
|
40312 | LongPrototype.toNumber = function toNumber() {
|
40313 | if (this.unsigned)
|
40314 | return ((this.high >>> 0) * TWO_PWR_32_DBL) + (this.low >>> 0);
|
40315 | return this.high * TWO_PWR_32_DBL + (this.low >>> 0);
|
40316 | };
|
40317 |
|
40318 | |
40319 |
|
40320 |
|
40321 |
|
40322 |
|
40323 |
|
40324 |
|
40325 | LongPrototype.toString = function toString(radix) {
|
40326 | radix = radix || 10;
|
40327 | if (radix < 2 || 36 < radix)
|
40328 | throw RangeError('radix');
|
40329 | if (this.isZero())
|
40330 | return '0';
|
40331 | if (this.isNegative()) {
|
40332 | if (this.eq(MIN_VALUE)) {
|
40333 |
|
40334 |
|
40335 | var radixLong = fromNumber(radix),
|
40336 | div = this.div(radixLong),
|
40337 | rem1 = div.mul(radixLong).sub(this);
|
40338 | return div.toString(radix) + rem1.toInt().toString(radix);
|
40339 | } else
|
40340 | return '-' + this.neg().toString(radix);
|
40341 | }
|
40342 |
|
40343 |
|
40344 |
|
40345 | var radixToPower = fromNumber(pow_dbl(radix, 6), this.unsigned),
|
40346 | rem = this;
|
40347 | var result = '';
|
40348 | while (true) {
|
40349 | var remDiv = rem.div(radixToPower),
|
40350 | intval = rem.sub(remDiv.mul(radixToPower)).toInt() >>> 0,
|
40351 | digits = intval.toString(radix);
|
40352 | rem = remDiv;
|
40353 | if (rem.isZero())
|
40354 | return digits + result;
|
40355 | else {
|
40356 | while (digits.length < 6)
|
40357 | digits = '0' + digits;
|
40358 | result = '' + digits + result;
|
40359 | }
|
40360 | }
|
40361 | };
|
40362 |
|
40363 | |
40364 |
|
40365 |
|
40366 |
|
40367 | LongPrototype.getHighBits = function getHighBits() {
|
40368 | return this.high;
|
40369 | };
|
40370 |
|
40371 | |
40372 |
|
40373 |
|
40374 |
|
40375 | LongPrototype.getHighBitsUnsigned = function getHighBitsUnsigned() {
|
40376 | return this.high >>> 0;
|
40377 | };
|
40378 |
|
40379 | |
40380 |
|
40381 |
|
40382 |
|
40383 | LongPrototype.getLowBits = function getLowBits() {
|
40384 | return this.low;
|
40385 | };
|
40386 |
|
40387 | |
40388 |
|
40389 |
|
40390 |
|
40391 | LongPrototype.getLowBitsUnsigned = function getLowBitsUnsigned() {
|
40392 | return this.low >>> 0;
|
40393 | };
|
40394 |
|
40395 | |
40396 |
|
40397 |
|
40398 |
|
40399 | LongPrototype.getNumBitsAbs = function getNumBitsAbs() {
|
40400 | if (this.isNegative())
|
40401 | return this.eq(MIN_VALUE) ? 64 : this.neg().getNumBitsAbs();
|
40402 | var val = this.high != 0 ? this.high : this.low;
|
40403 | for (var bit = 31; bit > 0; bit--)
|
40404 | if ((val & (1 << bit)) != 0)
|
40405 | break;
|
40406 | return this.high != 0 ? bit + 33 : bit + 1;
|
40407 | };
|
40408 |
|
40409 | |
40410 |
|
40411 |
|
40412 |
|
40413 | LongPrototype.isZero = function isZero() {
|
40414 | return this.high === 0 && this.low === 0;
|
40415 | };
|
40416 |
|
40417 | |
40418 |
|
40419 |
|
40420 |
|
40421 | LongPrototype.isNegative = function isNegative() {
|
40422 | return !this.unsigned && this.high < 0;
|
40423 | };
|
40424 |
|
40425 | |
40426 |
|
40427 |
|
40428 |
|
40429 | LongPrototype.isPositive = function isPositive() {
|
40430 | return this.unsigned || this.high >= 0;
|
40431 | };
|
40432 |
|
40433 | |
40434 |
|
40435 |
|
40436 |
|
40437 | LongPrototype.isOdd = function isOdd() {
|
40438 | return (this.low & 1) === 1;
|
40439 | };
|
40440 |
|
40441 | |
40442 |
|
40443 |
|
40444 |
|
40445 | LongPrototype.isEven = function isEven() {
|
40446 | return (this.low & 1) === 0;
|
40447 | };
|
40448 |
|
40449 | |
40450 |
|
40451 |
|
40452 |
|
40453 |
|
40454 | LongPrototype.equals = function equals(other) {
|
40455 | if (!isLong(other))
|
40456 | other = fromValue(other);
|
40457 | if (this.unsigned !== other.unsigned && (this.high >>> 31) === 1 && (other.high >>> 31) === 1)
|
40458 | return false;
|
40459 | return this.high === other.high && this.low === other.low;
|
40460 | };
|
40461 |
|
40462 | |
40463 |
|
40464 |
|
40465 |
|
40466 |
|
40467 |
|
40468 | LongPrototype.eq = LongPrototype.equals;
|
40469 |
|
40470 | |
40471 |
|
40472 |
|
40473 |
|
40474 |
|
40475 | LongPrototype.notEquals = function notEquals(other) {
|
40476 | return !this.eq( other);
|
40477 | };
|
40478 |
|
40479 | |
40480 |
|
40481 |
|
40482 |
|
40483 |
|
40484 |
|
40485 | LongPrototype.neq = LongPrototype.notEquals;
|
40486 |
|
40487 | |
40488 |
|
40489 |
|
40490 |
|
40491 |
|
40492 | LongPrototype.lessThan = function lessThan(other) {
|
40493 | return this.comp( other) < 0;
|
40494 | };
|
40495 |
|
40496 | |
40497 |
|
40498 |
|
40499 |
|
40500 |
|
40501 |
|
40502 | LongPrototype.lt = LongPrototype.lessThan;
|
40503 |
|
40504 | |
40505 |
|
40506 |
|
40507 |
|
40508 |
|
40509 | LongPrototype.lessThanOrEqual = function lessThanOrEqual(other) {
|
40510 | return this.comp( other) <= 0;
|
40511 | };
|
40512 |
|
40513 | |
40514 |
|
40515 |
|
40516 |
|
40517 |
|
40518 |
|
40519 | LongPrototype.lte = LongPrototype.lessThanOrEqual;
|
40520 |
|
40521 | |
40522 |
|
40523 |
|
40524 |
|
40525 |
|
40526 | LongPrototype.greaterThan = function greaterThan(other) {
|
40527 | return this.comp( other) > 0;
|
40528 | };
|
40529 |
|
40530 | |
40531 |
|
40532 |
|
40533 |
|
40534 |
|
40535 |
|
40536 | LongPrototype.gt = LongPrototype.greaterThan;
|
40537 |
|
40538 | |
40539 |
|
40540 |
|
40541 |
|
40542 |
|
40543 | LongPrototype.greaterThanOrEqual = function greaterThanOrEqual(other) {
|
40544 | return this.comp( other) >= 0;
|
40545 | };
|
40546 |
|
40547 | |
40548 |
|
40549 |
|
40550 |
|
40551 |
|
40552 |
|
40553 | LongPrototype.gte = LongPrototype.greaterThanOrEqual;
|
40554 |
|
40555 | |
40556 |
|
40557 |
|
40558 |
|
40559 |
|
40560 |
|
40561 | LongPrototype.compare = function compare(other) {
|
40562 | if (!isLong(other))
|
40563 | other = fromValue(other);
|
40564 | if (this.eq(other))
|
40565 | return 0;
|
40566 | var thisNeg = this.isNegative(),
|
40567 | otherNeg = other.isNegative();
|
40568 | if (thisNeg && !otherNeg)
|
40569 | return -1;
|
40570 | if (!thisNeg && otherNeg)
|
40571 | return 1;
|
40572 |
|
40573 | if (!this.unsigned)
|
40574 | return this.sub(other).isNegative() ? -1 : 1;
|
40575 |
|
40576 | return (other.high >>> 0) > (this.high >>> 0) || (other.high === this.high && (other.low >>> 0) > (this.low >>> 0)) ? -1 : 1;
|
40577 | };
|
40578 |
|
40579 | |
40580 |
|
40581 |
|
40582 |
|
40583 |
|
40584 |
|
40585 |
|
40586 | LongPrototype.comp = LongPrototype.compare;
|
40587 |
|
40588 | |
40589 |
|
40590 |
|
40591 |
|
40592 | LongPrototype.negate = function negate() {
|
40593 | if (!this.unsigned && this.eq(MIN_VALUE))
|
40594 | return MIN_VALUE;
|
40595 | return this.not().add(ONE);
|
40596 | };
|
40597 |
|
40598 | |
40599 |
|
40600 |
|
40601 |
|
40602 |
|
40603 | LongPrototype.neg = LongPrototype.negate;
|
40604 |
|
40605 | |
40606 |
|
40607 |
|
40608 |
|
40609 |
|
40610 | LongPrototype.add = function add(addend) {
|
40611 | if (!isLong(addend))
|
40612 | addend = fromValue(addend);
|
40613 |
|
40614 |
|
40615 |
|
40616 | var a48 = this.high >>> 16;
|
40617 | var a32 = this.high & 0xFFFF;
|
40618 | var a16 = this.low >>> 16;
|
40619 | var a00 = this.low & 0xFFFF;
|
40620 |
|
40621 | var b48 = addend.high >>> 16;
|
40622 | var b32 = addend.high & 0xFFFF;
|
40623 | var b16 = addend.low >>> 16;
|
40624 | var b00 = addend.low & 0xFFFF;
|
40625 |
|
40626 | var c48 = 0, c32 = 0, c16 = 0, c00 = 0;
|
40627 | c00 += a00 + b00;
|
40628 | c16 += c00 >>> 16;
|
40629 | c00 &= 0xFFFF;
|
40630 | c16 += a16 + b16;
|
40631 | c32 += c16 >>> 16;
|
40632 | c16 &= 0xFFFF;
|
40633 | c32 += a32 + b32;
|
40634 | c48 += c32 >>> 16;
|
40635 | c32 &= 0xFFFF;
|
40636 | c48 += a48 + b48;
|
40637 | c48 &= 0xFFFF;
|
40638 | return fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned);
|
40639 | };
|
40640 |
|
40641 | |
40642 |
|
40643 |
|
40644 |
|
40645 |
|
40646 | LongPrototype.subtract = function subtract(subtrahend) {
|
40647 | if (!isLong(subtrahend))
|
40648 | subtrahend = fromValue(subtrahend);
|
40649 | return this.add(subtrahend.neg());
|
40650 | };
|
40651 |
|
40652 | |
40653 |
|
40654 |
|
40655 |
|
40656 |
|
40657 |
|
40658 | LongPrototype.sub = LongPrototype.subtract;
|
40659 |
|
40660 | |
40661 |
|
40662 |
|
40663 |
|
40664 |
|
40665 | LongPrototype.multiply = function multiply(multiplier) {
|
40666 | if (this.isZero())
|
40667 | return ZERO;
|
40668 | if (!isLong(multiplier))
|
40669 | multiplier = fromValue(multiplier);
|
40670 | if (multiplier.isZero())
|
40671 | return ZERO;
|
40672 | if (this.eq(MIN_VALUE))
|
40673 | return multiplier.isOdd() ? MIN_VALUE : ZERO;
|
40674 | if (multiplier.eq(MIN_VALUE))
|
40675 | return this.isOdd() ? MIN_VALUE : ZERO;
|
40676 |
|
40677 | if (this.isNegative()) {
|
40678 | if (multiplier.isNegative())
|
40679 | return this.neg().mul(multiplier.neg());
|
40680 | else
|
40681 | return this.neg().mul(multiplier).neg();
|
40682 | } else if (multiplier.isNegative())
|
40683 | return this.mul(multiplier.neg()).neg();
|
40684 |
|
40685 |
|
40686 | if (this.lt(TWO_PWR_24) && multiplier.lt(TWO_PWR_24))
|
40687 | return fromNumber(this.toNumber() * multiplier.toNumber(), this.unsigned);
|
40688 |
|
40689 |
|
40690 |
|
40691 |
|
40692 | var a48 = this.high >>> 16;
|
40693 | var a32 = this.high & 0xFFFF;
|
40694 | var a16 = this.low >>> 16;
|
40695 | var a00 = this.low & 0xFFFF;
|
40696 |
|
40697 | var b48 = multiplier.high >>> 16;
|
40698 | var b32 = multiplier.high & 0xFFFF;
|
40699 | var b16 = multiplier.low >>> 16;
|
40700 | var b00 = multiplier.low & 0xFFFF;
|
40701 |
|
40702 | var c48 = 0, c32 = 0, c16 = 0, c00 = 0;
|
40703 | c00 += a00 * b00;
|
40704 | c16 += c00 >>> 16;
|
40705 | c00 &= 0xFFFF;
|
40706 | c16 += a16 * b00;
|
40707 | c32 += c16 >>> 16;
|
40708 | c16 &= 0xFFFF;
|
40709 | c16 += a00 * b16;
|
40710 | c32 += c16 >>> 16;
|
40711 | c16 &= 0xFFFF;
|
40712 | c32 += a32 * b00;
|
40713 | c48 += c32 >>> 16;
|
40714 | c32 &= 0xFFFF;
|
40715 | c32 += a16 * b16;
|
40716 | c48 += c32 >>> 16;
|
40717 | c32 &= 0xFFFF;
|
40718 | c32 += a00 * b32;
|
40719 | c48 += c32 >>> 16;
|
40720 | c32 &= 0xFFFF;
|
40721 | c48 += a48 * b00 + a32 * b16 + a16 * b32 + a00 * b48;
|
40722 | c48 &= 0xFFFF;
|
40723 | return fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned);
|
40724 | };
|
40725 |
|
40726 | |
40727 |
|
40728 |
|
40729 |
|
40730 |
|
40731 |
|
40732 | LongPrototype.mul = LongPrototype.multiply;
|
40733 |
|
40734 | |
40735 |
|
40736 |
|
40737 |
|
40738 |
|
40739 |
|
40740 | LongPrototype.divide = function divide(divisor) {
|
40741 | if (!isLong(divisor))
|
40742 | divisor = fromValue(divisor);
|
40743 | if (divisor.isZero())
|
40744 | throw Error('division by zero');
|
40745 | if (this.isZero())
|
40746 | return this.unsigned ? UZERO : ZERO;
|
40747 | var approx, rem, res;
|
40748 | if (!this.unsigned) {
|
40749 |
|
40750 |
|
40751 | if (this.eq(MIN_VALUE)) {
|
40752 | if (divisor.eq(ONE) || divisor.eq(NEG_ONE))
|
40753 | return MIN_VALUE;
|
40754 | else if (divisor.eq(MIN_VALUE))
|
40755 | return ONE;
|
40756 | else {
|
40757 |
|
40758 | var halfThis = this.shr(1);
|
40759 | approx = halfThis.div(divisor).shl(1);
|
40760 | if (approx.eq(ZERO)) {
|
40761 | return divisor.isNegative() ? ONE : NEG_ONE;
|
40762 | } else {
|
40763 | rem = this.sub(divisor.mul(approx));
|
40764 | res = approx.add(rem.div(divisor));
|
40765 | return res;
|
40766 | }
|
40767 | }
|
40768 | } else if (divisor.eq(MIN_VALUE))
|
40769 | return this.unsigned ? UZERO : ZERO;
|
40770 | if (this.isNegative()) {
|
40771 | if (divisor.isNegative())
|
40772 | return this.neg().div(divisor.neg());
|
40773 | return this.neg().div(divisor).neg();
|
40774 | } else if (divisor.isNegative())
|
40775 | return this.div(divisor.neg()).neg();
|
40776 | res = ZERO;
|
40777 | } else {
|
40778 |
|
40779 |
|
40780 | if (!divisor.unsigned)
|
40781 | divisor = divisor.toUnsigned();
|
40782 | if (divisor.gt(this))
|
40783 | return UZERO;
|
40784 | if (divisor.gt(this.shru(1)))
|
40785 | return UONE;
|
40786 | res = UZERO;
|
40787 | }
|
40788 |
|
40789 |
|
40790 |
|
40791 |
|
40792 |
|
40793 |
|
40794 | rem = this;
|
40795 | while (rem.gte(divisor)) {
|
40796 |
|
40797 |
|
40798 | approx = Math.max(1, Math.floor(rem.toNumber() / divisor.toNumber()));
|
40799 |
|
40800 |
|
40801 |
|
40802 | var log2 = Math.ceil(Math.log(approx) / Math.LN2),
|
40803 | delta = (log2 <= 48) ? 1 : pow_dbl(2, log2 - 48),
|
40804 |
|
40805 |
|
40806 |
|
40807 | approxRes = fromNumber(approx),
|
40808 | approxRem = approxRes.mul(divisor);
|
40809 | while (approxRem.isNegative() || approxRem.gt(rem)) {
|
40810 | approx -= delta;
|
40811 | approxRes = fromNumber(approx, this.unsigned);
|
40812 | approxRem = approxRes.mul(divisor);
|
40813 | }
|
40814 |
|
40815 |
|
40816 |
|
40817 | if (approxRes.isZero())
|
40818 | approxRes = ONE;
|
40819 |
|
40820 | res = res.add(approxRes);
|
40821 | rem = rem.sub(approxRem);
|
40822 | }
|
40823 | return res;
|
40824 | };
|
40825 |
|
40826 | |
40827 |
|
40828 |
|
40829 |
|
40830 |
|
40831 |
|
40832 | LongPrototype.div = LongPrototype.divide;
|
40833 |
|
40834 | |
40835 |
|
40836 |
|
40837 |
|
40838 |
|
40839 | LongPrototype.modulo = function modulo(divisor) {
|
40840 | if (!isLong(divisor))
|
40841 | divisor = fromValue(divisor);
|
40842 | return this.sub(this.div(divisor).mul(divisor));
|
40843 | };
|
40844 |
|
40845 | |
40846 |
|
40847 |
|
40848 |
|
40849 |
|
40850 |
|
40851 | LongPrototype.mod = LongPrototype.modulo;
|
40852 |
|
40853 | |
40854 |
|
40855 |
|
40856 |
|
40857 | LongPrototype.not = function not() {
|
40858 | return fromBits(~this.low, ~this.high, this.unsigned);
|
40859 | };
|
40860 |
|
40861 | |
40862 |
|
40863 |
|
40864 |
|
40865 |
|
40866 | LongPrototype.and = function and(other) {
|
40867 | if (!isLong(other))
|
40868 | other = fromValue(other);
|
40869 | return fromBits(this.low & other.low, this.high & other.high, this.unsigned);
|
40870 | };
|
40871 |
|
40872 | |
40873 |
|
40874 |
|
40875 |
|
40876 |
|
40877 | LongPrototype.or = function or(other) {
|
40878 | if (!isLong(other))
|
40879 | other = fromValue(other);
|
40880 | return fromBits(this.low | other.low, this.high | other.high, this.unsigned);
|
40881 | };
|
40882 |
|
40883 | |
40884 |
|
40885 |
|
40886 |
|
40887 |
|
40888 | LongPrototype.xor = function xor(other) {
|
40889 | if (!isLong(other))
|
40890 | other = fromValue(other);
|
40891 | return fromBits(this.low ^ other.low, this.high ^ other.high, this.unsigned);
|
40892 | };
|
40893 |
|
40894 | |
40895 |
|
40896 |
|
40897 |
|
40898 |
|
40899 | LongPrototype.shiftLeft = function shiftLeft(numBits) {
|
40900 | if (isLong(numBits))
|
40901 | numBits = numBits.toInt();
|
40902 | if ((numBits &= 63) === 0)
|
40903 | return this;
|
40904 | else if (numBits < 32)
|
40905 | return fromBits(this.low << numBits, (this.high << numBits) | (this.low >>> (32 - numBits)), this.unsigned);
|
40906 | else
|
40907 | return fromBits(0, this.low << (numBits - 32), this.unsigned);
|
40908 | };
|
40909 |
|
40910 | |
40911 |
|
40912 |
|
40913 |
|
40914 |
|
40915 |
|
40916 | LongPrototype.shl = LongPrototype.shiftLeft;
|
40917 |
|
40918 | |
40919 |
|
40920 |
|
40921 |
|
40922 |
|
40923 | LongPrototype.shiftRight = function shiftRight(numBits) {
|
40924 | if (isLong(numBits))
|
40925 | numBits = numBits.toInt();
|
40926 | if ((numBits &= 63) === 0)
|
40927 | return this;
|
40928 | else if (numBits < 32)
|
40929 | return fromBits((this.low >>> numBits) | (this.high << (32 - numBits)), this.high >> numBits, this.unsigned);
|
40930 | else
|
40931 | return fromBits(this.high >> (numBits - 32), this.high >= 0 ? 0 : -1, this.unsigned);
|
40932 | };
|
40933 |
|
40934 | |
40935 |
|
40936 |
|
40937 |
|
40938 |
|
40939 |
|
40940 | LongPrototype.shr = LongPrototype.shiftRight;
|
40941 |
|
40942 | |
40943 |
|
40944 |
|
40945 |
|
40946 |
|
40947 | LongPrototype.shiftRightUnsigned = function shiftRightUnsigned(numBits) {
|
40948 | if (isLong(numBits))
|
40949 | numBits = numBits.toInt();
|
40950 | numBits &= 63;
|
40951 | if (numBits === 0)
|
40952 | return this;
|
40953 | else {
|
40954 | var high = this.high;
|
40955 | if (numBits < 32) {
|
40956 | var low = this.low;
|
40957 | return fromBits((low >>> numBits) | (high << (32 - numBits)), high >>> numBits, this.unsigned);
|
40958 | } else if (numBits === 32)
|
40959 | return fromBits(high, 0, this.unsigned);
|
40960 | else
|
40961 | return fromBits(high >>> (numBits - 32), 0, this.unsigned);
|
40962 | }
|
40963 | };
|
40964 |
|
40965 | |
40966 |
|
40967 |
|
40968 |
|
40969 |
|
40970 |
|
40971 | LongPrototype.shru = LongPrototype.shiftRightUnsigned;
|
40972 |
|
40973 | |
40974 |
|
40975 |
|
40976 |
|
40977 | LongPrototype.toSigned = function toSigned() {
|
40978 | if (!this.unsigned)
|
40979 | return this;
|
40980 | return fromBits(this.low, this.high, false);
|
40981 | };
|
40982 |
|
40983 | |
40984 |
|
40985 |
|
40986 |
|
40987 | LongPrototype.toUnsigned = function toUnsigned() {
|
40988 | if (this.unsigned)
|
40989 | return this;
|
40990 | return fromBits(this.low, this.high, true);
|
40991 | };
|
40992 |
|
40993 | |
40994 |
|
40995 |
|
40996 |
|
40997 |
|
40998 | LongPrototype.toBytes = function(le) {
|
40999 | return le ? this.toBytesLE() : this.toBytesBE();
|
41000 | }
|
41001 |
|
41002 | |
41003 |
|
41004 |
|
41005 |
|
41006 | LongPrototype.toBytesLE = function() {
|
41007 | var hi = this.high,
|
41008 | lo = this.low;
|
41009 | return [
|
41010 | lo & 0xff,
|
41011 | (lo >>> 8) & 0xff,
|
41012 | (lo >>> 16) & 0xff,
|
41013 | (lo >>> 24) & 0xff,
|
41014 | hi & 0xff,
|
41015 | (hi >>> 8) & 0xff,
|
41016 | (hi >>> 16) & 0xff,
|
41017 | (hi >>> 24) & 0xff
|
41018 | ];
|
41019 | }
|
41020 |
|
41021 | |
41022 |
|
41023 |
|
41024 |
|
41025 | LongPrototype.toBytesBE = function() {
|
41026 | var hi = this.high,
|
41027 | lo = this.low;
|
41028 | return [
|
41029 | (hi >>> 24) & 0xff,
|
41030 | (hi >>> 16) & 0xff,
|
41031 | (hi >>> 8) & 0xff,
|
41032 | hi & 0xff,
|
41033 | (lo >>> 24) & 0xff,
|
41034 | (lo >>> 16) & 0xff,
|
41035 | (lo >>> 8) & 0xff,
|
41036 | lo & 0xff
|
41037 | ];
|
41038 | }
|
41039 |
|
41040 | return Long;
|
41041 | });
|
41042 |
|
41043 |
|
41044 | }),
|
41045 |
|
41046 | (function(module, exports) {
|
41047 |
|
41048 |
|
41049 |
|
41050 | }),
|
41051 |
|
41052 | (function(module, exports, __webpack_require__) {
|
41053 |
|
41054 | "use strict";
|
41055 |
|
41056 |
|
41057 | var _interopRequireDefault = __webpack_require__(1);
|
41058 |
|
41059 | var _slice = _interopRequireDefault(__webpack_require__(61));
|
41060 |
|
41061 | var _getOwnPropertySymbols = _interopRequireDefault(__webpack_require__(154));
|
41062 |
|
41063 | var _concat = _interopRequireDefault(__webpack_require__(22));
|
41064 |
|
41065 | var has = Object.prototype.hasOwnProperty,
|
41066 | prefix = '~';
|
41067 |
|
41068 |
|
41069 |
|
41070 |
|
41071 |
|
41072 |
|
41073 |
|
41074 |
|
41075 | function Events() {}
|
41076 |
|
41077 |
|
41078 |
|
41079 |
|
41080 |
|
41081 |
|
41082 |
|
41083 |
|
41084 | if (Object.create) {
|
41085 | Events.prototype = Object.create(null);
|
41086 |
|
41087 |
|
41088 |
|
41089 |
|
41090 | if (!new Events().__proto__) prefix = false;
|
41091 | }
|
41092 |
|
41093 |
|
41094 |
|
41095 |
|
41096 |
|
41097 |
|
41098 |
|
41099 |
|
41100 |
|
41101 |
|
41102 |
|
41103 | function EE(fn, context, once) {
|
41104 | this.fn = fn;
|
41105 | this.context = context;
|
41106 | this.once = once || false;
|
41107 | }
|
41108 |
|
41109 |
|
41110 |
|
41111 |
|
41112 |
|
41113 |
|
41114 |
|
41115 |
|
41116 |
|
41117 |
|
41118 |
|
41119 |
|
41120 |
|
41121 | function addListener(emitter, event, fn, context, once) {
|
41122 | if (typeof fn !== 'function') {
|
41123 | throw new TypeError('The listener must be a function');
|
41124 | }
|
41125 |
|
41126 | var listener = new EE(fn, context || emitter, once),
|
41127 | evt = prefix ? prefix + event : event;
|
41128 | if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++;else if (!emitter._events[evt].fn) emitter._events[evt].push(listener);else emitter._events[evt] = [emitter._events[evt], listener];
|
41129 | return emitter;
|
41130 | }
|
41131 |
|
41132 |
|
41133 |
|
41134 |
|
41135 |
|
41136 |
|
41137 |
|
41138 |
|
41139 |
|
41140 | function clearEvent(emitter, evt) {
|
41141 | if (--emitter._eventsCount === 0) emitter._events = new Events();else delete emitter._events[evt];
|
41142 | }
|
41143 |
|
41144 |
|
41145 |
|
41146 |
|
41147 |
|
41148 |
|
41149 |
|
41150 |
|
41151 |
|
41152 | function EventEmitter() {
|
41153 | this._events = new Events();
|
41154 | this._eventsCount = 0;
|
41155 | }
|
41156 |
|
41157 |
|
41158 |
|
41159 |
|
41160 |
|
41161 |
|
41162 |
|
41163 |
|
41164 |
|
41165 | EventEmitter.prototype.eventNames = function eventNames() {
|
41166 | var names = [],
|
41167 | events,
|
41168 | name;
|
41169 | if (this._eventsCount === 0) return names;
|
41170 |
|
41171 | for (name in events = this._events) {
|
41172 | if (has.call(events, name)) names.push(prefix ? (0, _slice.default)(name).call(name, 1) : name);
|
41173 | }
|
41174 |
|
41175 | if (_getOwnPropertySymbols.default) {
|
41176 | return (0, _concat.default)(names).call(names, (0, _getOwnPropertySymbols.default)(events));
|
41177 | }
|
41178 |
|
41179 | return names;
|
41180 | };
|
41181 |
|
41182 |
|
41183 |
|
41184 |
|
41185 |
|
41186 |
|
41187 |
|
41188 |
|
41189 |
|
41190 | EventEmitter.prototype.listeners = function listeners(event) {
|
41191 | var evt = prefix ? prefix + event : event,
|
41192 | handlers = this._events[evt];
|
41193 | if (!handlers) return [];
|
41194 | if (handlers.fn) return [handlers.fn];
|
41195 |
|
41196 | for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) {
|
41197 | ee[i] = handlers[i].fn;
|
41198 | }
|
41199 |
|
41200 | return ee;
|
41201 | };
|
41202 |
|
41203 |
|
41204 |
|
41205 |
|
41206 |
|
41207 |
|
41208 |
|
41209 |
|
41210 |
|
41211 | EventEmitter.prototype.listenerCount = function listenerCount(event) {
|
41212 | var evt = prefix ? prefix + event : event,
|
41213 | listeners = this._events[evt];
|
41214 | if (!listeners) return 0;
|
41215 | if (listeners.fn) return 1;
|
41216 | return listeners.length;
|
41217 | };
|
41218 |
|
41219 |
|
41220 |
|
41221 |
|
41222 |
|
41223 |
|
41224 |
|
41225 |
|
41226 |
|
41227 | EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {
|
41228 | var evt = prefix ? prefix + event : event;
|
41229 | if (!this._events[evt]) return false;
|
41230 | var listeners = this._events[evt],
|
41231 | len = arguments.length,
|
41232 | args,
|
41233 | i;
|
41234 |
|
41235 | if (listeners.fn) {
|
41236 | if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);
|
41237 |
|
41238 | switch (len) {
|
41239 | case 1:
|
41240 | return listeners.fn.call(listeners.context), true;
|
41241 |
|
41242 | case 2:
|
41243 | return listeners.fn.call(listeners.context, a1), true;
|
41244 |
|
41245 | case 3:
|
41246 | return listeners.fn.call(listeners.context, a1, a2), true;
|
41247 |
|
41248 | case 4:
|
41249 | return listeners.fn.call(listeners.context, a1, a2, a3), true;
|
41250 |
|
41251 | case 5:
|
41252 | return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;
|
41253 |
|
41254 | case 6:
|
41255 | return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;
|
41256 | }
|
41257 |
|
41258 | for (i = 1, args = new Array(len - 1); i < len; i++) {
|
41259 | args[i - 1] = arguments[i];
|
41260 | }
|
41261 |
|
41262 | listeners.fn.apply(listeners.context, args);
|
41263 | } else {
|
41264 | var length = listeners.length,
|
41265 | j;
|
41266 |
|
41267 | for (i = 0; i < length; i++) {
|
41268 | if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);
|
41269 |
|
41270 | switch (len) {
|
41271 | case 1:
|
41272 | listeners[i].fn.call(listeners[i].context);
|
41273 | break;
|
41274 |
|
41275 | case 2:
|
41276 | listeners[i].fn.call(listeners[i].context, a1);
|
41277 | break;
|
41278 |
|
41279 | case 3:
|
41280 | listeners[i].fn.call(listeners[i].context, a1, a2);
|
41281 | break;
|
41282 |
|
41283 | case 4:
|
41284 | listeners[i].fn.call(listeners[i].context, a1, a2, a3);
|
41285 | break;
|
41286 |
|
41287 | default:
|
41288 | if (!args) for (j = 1, args = new Array(len - 1); j < len; j++) {
|
41289 | args[j - 1] = arguments[j];
|
41290 | }
|
41291 | listeners[i].fn.apply(listeners[i].context, args);
|
41292 | }
|
41293 | }
|
41294 | }
|
41295 |
|
41296 | return true;
|
41297 | };
|
41298 |
|
41299 |
|
41300 |
|
41301 |
|
41302 |
|
41303 |
|
41304 |
|
41305 |
|
41306 |
|
41307 |
|
41308 |
|
41309 | EventEmitter.prototype.on = function on(event, fn, context) {
|
41310 | return addListener(this, event, fn, context, false);
|
41311 | };
|
41312 |
|
41313 |
|
41314 |
|
41315 |
|
41316 |
|
41317 |
|
41318 |
|
41319 |
|
41320 |
|
41321 |
|
41322 |
|
41323 | EventEmitter.prototype.once = function once(event, fn, context) {
|
41324 | return addListener(this, event, fn, context, true);
|
41325 | };
|
41326 |
|
41327 |
|
41328 |
|
41329 |
|
41330 |
|
41331 |
|
41332 |
|
41333 |
|
41334 |
|
41335 |
|
41336 |
|
41337 |
|
41338 | EventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {
|
41339 | var evt = prefix ? prefix + event : event;
|
41340 | if (!this._events[evt]) return this;
|
41341 |
|
41342 | if (!fn) {
|
41343 | clearEvent(this, evt);
|
41344 | return this;
|
41345 | }
|
41346 |
|
41347 | var listeners = this._events[evt];
|
41348 |
|
41349 | if (listeners.fn) {
|
41350 | if (listeners.fn === fn && (!once || listeners.once) && (!context || listeners.context === context)) {
|
41351 | clearEvent(this, evt);
|
41352 | }
|
41353 | } else {
|
41354 | for (var i = 0, events = [], length = listeners.length; i < length; i++) {
|
41355 | if (listeners[i].fn !== fn || once && !listeners[i].once || context && listeners[i].context !== context) {
|
41356 | events.push(listeners[i]);
|
41357 | }
|
41358 | }
|
41359 |
|
41360 |
|
41361 |
|
41362 |
|
41363 | if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;else clearEvent(this, evt);
|
41364 | }
|
41365 |
|
41366 | return this;
|
41367 | };
|
41368 |
|
41369 |
|
41370 |
|
41371 |
|
41372 |
|
41373 |
|
41374 |
|
41375 |
|
41376 |
|
41377 | EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {
|
41378 | var evt;
|
41379 |
|
41380 | if (event) {
|
41381 | evt = prefix ? prefix + event : event;
|
41382 | if (this._events[evt]) clearEvent(this, evt);
|
41383 | } else {
|
41384 | this._events = new Events();
|
41385 | this._eventsCount = 0;
|
41386 | }
|
41387 |
|
41388 | return this;
|
41389 | };
|
41390 |
|
41391 |
|
41392 |
|
41393 |
|
41394 | EventEmitter.prototype.off = EventEmitter.prototype.removeListener;
|
41395 | EventEmitter.prototype.addListener = EventEmitter.prototype.on;
|
41396 |
|
41397 |
|
41398 |
|
41399 | EventEmitter.prefixed = prefix;
|
41400 |
|
41401 |
|
41402 |
|
41403 | EventEmitter.EventEmitter = EventEmitter;
|
41404 |
|
41405 |
|
41406 |
|
41407 | if (true) {
|
41408 | module.exports = EventEmitter;
|
41409 | }
|
41410 |
|
41411 | }),
|
41412 |
|
41413 | (function(module, exports) {
|
41414 |
|
41415 | function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
41416 | try {
|
41417 | var info = gen[key](arg);
|
41418 | var value = info.value;
|
41419 | } catch (error) {
|
41420 | reject(error);
|
41421 | return;
|
41422 | }
|
41423 | if (info.done) {
|
41424 | resolve(value);
|
41425 | } else {
|
41426 | Promise.resolve(value).then(_next, _throw);
|
41427 | }
|
41428 | }
|
41429 | function _asyncToGenerator(fn) {
|
41430 | return function () {
|
41431 | var self = this,
|
41432 | args = arguments;
|
41433 | return new Promise(function (resolve, reject) {
|
41434 | var gen = fn.apply(self, args);
|
41435 | function _next(value) {
|
41436 | asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
41437 | }
|
41438 | function _throw(err) {
|
41439 | asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
41440 | }
|
41441 | _next(undefined);
|
41442 | });
|
41443 | };
|
41444 | }
|
41445 | module.exports = _asyncToGenerator, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
41446 |
|
41447 | }),
|
41448 |
|
41449 | (function(module, exports, __webpack_require__) {
|
41450 |
|
41451 | var arrayWithoutHoles = __webpack_require__(621);
|
41452 | var iterableToArray = __webpack_require__(267);
|
41453 | var unsupportedIterableToArray = __webpack_require__(268);
|
41454 | var nonIterableSpread = __webpack_require__(622);
|
41455 | function _toConsumableArray(arr) {
|
41456 | return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread();
|
41457 | }
|
41458 | module.exports = _toConsumableArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
41459 |
|
41460 | }),
|
41461 |
|
41462 | (function(module, exports, __webpack_require__) {
|
41463 |
|
41464 | var arrayLikeToArray = __webpack_require__(266);
|
41465 | function _arrayWithoutHoles(arr) {
|
41466 | if (Array.isArray(arr)) return arrayLikeToArray(arr);
|
41467 | }
|
41468 | module.exports = _arrayWithoutHoles, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
41469 |
|
41470 | }),
|
41471 |
|
41472 | (function(module, exports) {
|
41473 |
|
41474 | function _nonIterableSpread() {
|
41475 | throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
41476 | }
|
41477 | module.exports = _nonIterableSpread, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
41478 |
|
41479 | }),
|
41480 |
|
41481 | (function(module, exports, __webpack_require__) {
|
41482 |
|
41483 | var toPropertyKey = __webpack_require__(269);
|
41484 | function _defineProperty(obj, key, value) {
|
41485 | key = toPropertyKey(key);
|
41486 | if (key in obj) {
|
41487 | Object.defineProperty(obj, key, {
|
41488 | value: value,
|
41489 | enumerable: true,
|
41490 | configurable: true,
|
41491 | writable: true
|
41492 | });
|
41493 | } else {
|
41494 | obj[key] = value;
|
41495 | }
|
41496 | return obj;
|
41497 | }
|
41498 | module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
41499 |
|
41500 | }),
|
41501 |
|
41502 | (function(module, exports, __webpack_require__) {
|
41503 |
|
41504 | var _typeof = __webpack_require__(118)["default"];
|
41505 | function _toPrimitive(input, hint) {
|
41506 | if (_typeof(input) !== "object" || input === null) return input;
|
41507 | var prim = input[Symbol.toPrimitive];
|
41508 | if (prim !== undefined) {
|
41509 | var res = prim.call(input, hint || "default");
|
41510 | if (_typeof(res) !== "object") return res;
|
41511 | throw new TypeError("@@toPrimitive must return a primitive value.");
|
41512 | }
|
41513 | return (hint === "string" ? String : Number)(input);
|
41514 | }
|
41515 | module.exports = _toPrimitive, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
41516 |
|
41517 | }),
|
41518 |
|
41519 | (function(module, exports, __webpack_require__) {
|
41520 |
|
41521 | var objectWithoutPropertiesLoose = __webpack_require__(626);
|
41522 | function _objectWithoutProperties(source, excluded) {
|
41523 | if (source == null) return {};
|
41524 | var target = objectWithoutPropertiesLoose(source, excluded);
|
41525 | var key, i;
|
41526 | if (Object.getOwnPropertySymbols) {
|
41527 | var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
41528 | for (i = 0; i < sourceSymbolKeys.length; i++) {
|
41529 | key = sourceSymbolKeys[i];
|
41530 | if (excluded.indexOf(key) >= 0) continue;
|
41531 | if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
41532 | target[key] = source[key];
|
41533 | }
|
41534 | }
|
41535 | return target;
|
41536 | }
|
41537 | module.exports = _objectWithoutProperties, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
41538 |
|
41539 | }),
|
41540 |
|
41541 | (function(module, exports) {
|
41542 |
|
41543 | function _objectWithoutPropertiesLoose(source, excluded) {
|
41544 | if (source == null) return {};
|
41545 | var target = {};
|
41546 | var sourceKeys = Object.keys(source);
|
41547 | var key, i;
|
41548 | for (i = 0; i < sourceKeys.length; i++) {
|
41549 | key = sourceKeys[i];
|
41550 | if (excluded.indexOf(key) >= 0) continue;
|
41551 | target[key] = source[key];
|
41552 | }
|
41553 | return target;
|
41554 | }
|
41555 | module.exports = _objectWithoutPropertiesLoose, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
41556 |
|
41557 | }),
|
41558 |
|
41559 | (function(module, exports) {
|
41560 |
|
41561 | function _assertThisInitialized(self) {
|
41562 | if (self === void 0) {
|
41563 | throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
41564 | }
|
41565 | return self;
|
41566 | }
|
41567 | module.exports = _assertThisInitialized, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
41568 |
|
41569 | }),
|
41570 |
|
41571 | (function(module, exports, __webpack_require__) {
|
41572 |
|
41573 | var setPrototypeOf = __webpack_require__(629);
|
41574 | function _inheritsLoose(subClass, superClass) {
|
41575 | subClass.prototype = Object.create(superClass.prototype);
|
41576 | subClass.prototype.constructor = subClass;
|
41577 | setPrototypeOf(subClass, superClass);
|
41578 | }
|
41579 | module.exports = _inheritsLoose, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
41580 |
|
41581 | }),
|
41582 |
|
41583 | (function(module, exports) {
|
41584 |
|
41585 | function _setPrototypeOf(o, p) {
|
41586 | module.exports = _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
|
41587 | o.__proto__ = p;
|
41588 | return o;
|
41589 | }, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
41590 | return _setPrototypeOf(o, p);
|
41591 | }
|
41592 | module.exports = _setPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
41593 |
|
41594 | }),
|
41595 |
|
41596 | (function(module, exports, __webpack_require__) {
|
41597 |
|
41598 |
|
41599 |
|
41600 | var runtime = __webpack_require__(631)();
|
41601 | module.exports = runtime;
|
41602 |
|
41603 |
|
41604 | try {
|
41605 | regeneratorRuntime = runtime;
|
41606 | } catch (accidentalStrictMode) {
|
41607 | if (typeof globalThis === "object") {
|
41608 | globalThis.regeneratorRuntime = runtime;
|
41609 | } else {
|
41610 | Function("r", "regeneratorRuntime = r")(runtime);
|
41611 | }
|
41612 | }
|
41613 |
|
41614 |
|
41615 | }),
|
41616 |
|
41617 | (function(module, exports, __webpack_require__) {
|
41618 |
|
41619 | var _typeof = __webpack_require__(118)["default"];
|
41620 | function _regeneratorRuntime() {
|
41621 | "use strict";
|
41622 | module.exports = _regeneratorRuntime = function _regeneratorRuntime() {
|
41623 | return e;
|
41624 | }, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
41625 | var t,
|
41626 | e = {},
|
41627 | r = Object.prototype,
|
41628 | n = r.hasOwnProperty,
|
41629 | o = Object.defineProperty || function (t, e, r) {
|
41630 | t[e] = r.value;
|
41631 | },
|
41632 | i = "function" == typeof Symbol ? Symbol : {},
|
41633 | a = i.iterator || "@@iterator",
|
41634 | c = i.asyncIterator || "@@asyncIterator",
|
41635 | u = i.toStringTag || "@@toStringTag";
|
41636 | function define(t, e, r) {
|
41637 | return Object.defineProperty(t, e, {
|
41638 | value: r,
|
41639 | enumerable: !0,
|
41640 | configurable: !0,
|
41641 | writable: !0
|
41642 | }), t[e];
|
41643 | }
|
41644 | try {
|
41645 | define({}, "");
|
41646 | } catch (t) {
|
41647 | define = function define(t, e, r) {
|
41648 | return t[e] = r;
|
41649 | };
|
41650 | }
|
41651 | function wrap(t, e, r, n) {
|
41652 | var i = e && e.prototype instanceof Generator ? e : Generator,
|
41653 | a = Object.create(i.prototype),
|
41654 | c = new Context(n || []);
|
41655 | return o(a, "_invoke", {
|
41656 | value: makeInvokeMethod(t, r, c)
|
41657 | }), a;
|
41658 | }
|
41659 | function tryCatch(t, e, r) {
|
41660 | try {
|
41661 | return {
|
41662 | type: "normal",
|
41663 | arg: t.call(e, r)
|
41664 | };
|
41665 | } catch (t) {
|
41666 | return {
|
41667 | type: "throw",
|
41668 | arg: t
|
41669 | };
|
41670 | }
|
41671 | }
|
41672 | e.wrap = wrap;
|
41673 | var h = "suspendedStart",
|
41674 | l = "suspendedYield",
|
41675 | f = "executing",
|
41676 | s = "completed",
|
41677 | y = {};
|
41678 | function Generator() {}
|
41679 | function GeneratorFunction() {}
|
41680 | function GeneratorFunctionPrototype() {}
|
41681 | var p = {};
|
41682 | define(p, a, function () {
|
41683 | return this;
|
41684 | });
|
41685 | var d = Object.getPrototypeOf,
|
41686 | v = d && d(d(values([])));
|
41687 | v && v !== r && n.call(v, a) && (p = v);
|
41688 | var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);
|
41689 | function defineIteratorMethods(t) {
|
41690 | ["next", "throw", "return"].forEach(function (e) {
|
41691 | define(t, e, function (t) {
|
41692 | return this._invoke(e, t);
|
41693 | });
|
41694 | });
|
41695 | }
|
41696 | function AsyncIterator(t, e) {
|
41697 | function invoke(r, o, i, a) {
|
41698 | var c = tryCatch(t[r], t, o);
|
41699 | if ("throw" !== c.type) {
|
41700 | var u = c.arg,
|
41701 | h = u.value;
|
41702 | return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) {
|
41703 | invoke("next", t, i, a);
|
41704 | }, function (t) {
|
41705 | invoke("throw", t, i, a);
|
41706 | }) : e.resolve(h).then(function (t) {
|
41707 | u.value = t, i(u);
|
41708 | }, function (t) {
|
41709 | return invoke("throw", t, i, a);
|
41710 | });
|
41711 | }
|
41712 | a(c.arg);
|
41713 | }
|
41714 | var r;
|
41715 | o(this, "_invoke", {
|
41716 | value: function value(t, n) {
|
41717 | function callInvokeWithMethodAndArg() {
|
41718 | return new e(function (e, r) {
|
41719 | invoke(t, n, e, r);
|
41720 | });
|
41721 | }
|
41722 | return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
|
41723 | }
|
41724 | });
|
41725 | }
|
41726 | function makeInvokeMethod(e, r, n) {
|
41727 | var o = h;
|
41728 | return function (i, a) {
|
41729 | if (o === f) throw new Error("Generator is already running");
|
41730 | if (o === s) {
|
41731 | if ("throw" === i) throw a;
|
41732 | return {
|
41733 | value: t,
|
41734 | done: !0
|
41735 | };
|
41736 | }
|
41737 | for (n.method = i, n.arg = a;;) {
|
41738 | var c = n.delegate;
|
41739 | if (c) {
|
41740 | var u = maybeInvokeDelegate(c, n);
|
41741 | if (u) {
|
41742 | if (u === y) continue;
|
41743 | return u;
|
41744 | }
|
41745 | }
|
41746 | if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
|
41747 | if (o === h) throw o = s, n.arg;
|
41748 | n.dispatchException(n.arg);
|
41749 | } else "return" === n.method && n.abrupt("return", n.arg);
|
41750 | o = f;
|
41751 | var p = tryCatch(e, r, n);
|
41752 | if ("normal" === p.type) {
|
41753 | if (o = n.done ? s : l, p.arg === y) continue;
|
41754 | return {
|
41755 | value: p.arg,
|
41756 | done: n.done
|
41757 | };
|
41758 | }
|
41759 | "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg);
|
41760 | }
|
41761 | };
|
41762 | }
|
41763 | function maybeInvokeDelegate(e, r) {
|
41764 | var n = r.method,
|
41765 | o = e.iterator[n];
|
41766 | if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y;
|
41767 | var i = tryCatch(o, e.iterator, r.arg);
|
41768 | if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y;
|
41769 | var a = i.arg;
|
41770 | return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y);
|
41771 | }
|
41772 | function pushTryEntry(t) {
|
41773 | var e = {
|
41774 | tryLoc: t[0]
|
41775 | };
|
41776 | 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);
|
41777 | }
|
41778 | function resetTryEntry(t) {
|
41779 | var e = t.completion || {};
|
41780 | e.type = "normal", delete e.arg, t.completion = e;
|
41781 | }
|
41782 | function Context(t) {
|
41783 | this.tryEntries = [{
|
41784 | tryLoc: "root"
|
41785 | }], t.forEach(pushTryEntry, this), this.reset(!0);
|
41786 | }
|
41787 | function values(e) {
|
41788 | if (e || "" === e) {
|
41789 | var r = e[a];
|
41790 | if (r) return r.call(e);
|
41791 | if ("function" == typeof e.next) return e;
|
41792 | if (!isNaN(e.length)) {
|
41793 | var o = -1,
|
41794 | i = function next() {
|
41795 | for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next;
|
41796 | return next.value = t, next.done = !0, next;
|
41797 | };
|
41798 | return i.next = i;
|
41799 | }
|
41800 | }
|
41801 | throw new TypeError(_typeof(e) + " is not iterable");
|
41802 | }
|
41803 | return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", {
|
41804 | value: GeneratorFunctionPrototype,
|
41805 | configurable: !0
|
41806 | }), o(GeneratorFunctionPrototype, "constructor", {
|
41807 | value: GeneratorFunction,
|
41808 | configurable: !0
|
41809 | }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) {
|
41810 | var e = "function" == typeof t && t.constructor;
|
41811 | return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name));
|
41812 | }, e.mark = function (t) {
|
41813 | return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t;
|
41814 | }, e.awrap = function (t) {
|
41815 | return {
|
41816 | __await: t
|
41817 | };
|
41818 | }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {
|
41819 | return this;
|
41820 | }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {
|
41821 | void 0 === i && (i = Promise);
|
41822 | var a = new AsyncIterator(wrap(t, r, n, o), i);
|
41823 | return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {
|
41824 | return t.done ? t.value : a.next();
|
41825 | });
|
41826 | }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () {
|
41827 | return this;
|
41828 | }), define(g, "toString", function () {
|
41829 | return "[object Generator]";
|
41830 | }), e.keys = function (t) {
|
41831 | var e = Object(t),
|
41832 | r = [];
|
41833 | for (var n in e) r.push(n);
|
41834 | return r.reverse(), function next() {
|
41835 | for (; r.length;) {
|
41836 | var t = r.pop();
|
41837 | if (t in e) return next.value = t, next.done = !1, next;
|
41838 | }
|
41839 | return next.done = !0, next;
|
41840 | };
|
41841 | }, e.values = values, Context.prototype = {
|
41842 | constructor: Context,
|
41843 | reset: function reset(e) {
|
41844 | if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t);
|
41845 | },
|
41846 | stop: function stop() {
|
41847 | this.done = !0;
|
41848 | var t = this.tryEntries[0].completion;
|
41849 | if ("throw" === t.type) throw t.arg;
|
41850 | return this.rval;
|
41851 | },
|
41852 | dispatchException: function dispatchException(e) {
|
41853 | if (this.done) throw e;
|
41854 | var r = this;
|
41855 | function handle(n, o) {
|
41856 | return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o;
|
41857 | }
|
41858 | for (var o = this.tryEntries.length - 1; o >= 0; --o) {
|
41859 | var i = this.tryEntries[o],
|
41860 | a = i.completion;
|
41861 | if ("root" === i.tryLoc) return handle("end");
|
41862 | if (i.tryLoc <= this.prev) {
|
41863 | var c = n.call(i, "catchLoc"),
|
41864 | u = n.call(i, "finallyLoc");
|
41865 | if (c && u) {
|
41866 | if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
|
41867 | if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
|
41868 | } else if (c) {
|
41869 | if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
|
41870 | } else {
|
41871 | if (!u) throw new Error("try statement without catch or finally");
|
41872 | if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
|
41873 | }
|
41874 | }
|
41875 | }
|
41876 | },
|
41877 | abrupt: function abrupt(t, e) {
|
41878 | for (var r = this.tryEntries.length - 1; r >= 0; --r) {
|
41879 | var o = this.tryEntries[r];
|
41880 | if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
|
41881 | var i = o;
|
41882 | break;
|
41883 | }
|
41884 | }
|
41885 | i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);
|
41886 | var a = i ? i.completion : {};
|
41887 | return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a);
|
41888 | },
|
41889 | complete: function complete(t, e) {
|
41890 | if ("throw" === t.type) throw t.arg;
|
41891 | return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y;
|
41892 | },
|
41893 | finish: function finish(t) {
|
41894 | for (var e = this.tryEntries.length - 1; e >= 0; --e) {
|
41895 | var r = this.tryEntries[e];
|
41896 | if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;
|
41897 | }
|
41898 | },
|
41899 | "catch": function _catch(t) {
|
41900 | for (var e = this.tryEntries.length - 1; e >= 0; --e) {
|
41901 | var r = this.tryEntries[e];
|
41902 | if (r.tryLoc === t) {
|
41903 | var n = r.completion;
|
41904 | if ("throw" === n.type) {
|
41905 | var o = n.arg;
|
41906 | resetTryEntry(r);
|
41907 | }
|
41908 | return o;
|
41909 | }
|
41910 | }
|
41911 | throw new Error("illegal catch attempt");
|
41912 | },
|
41913 | delegateYield: function delegateYield(e, r, n) {
|
41914 | return this.delegate = {
|
41915 | iterator: values(e),
|
41916 | resultName: r,
|
41917 | nextLoc: n
|
41918 | }, "next" === this.method && (this.arg = t), y;
|
41919 | }
|
41920 | }, e;
|
41921 | }
|
41922 | module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
41923 |
|
41924 | }),
|
41925 |
|
41926 | (function(module, exports, __webpack_require__) {
|
41927 |
|
41928 | var arrayShuffle = __webpack_require__(633),
|
41929 | baseShuffle = __webpack_require__(636),
|
41930 | isArray = __webpack_require__(275);
|
41931 |
|
41932 |
|
41933 |
|
41934 |
|
41935 |
|
41936 |
|
41937 |
|
41938 |
|
41939 |
|
41940 |
|
41941 |
|
41942 |
|
41943 |
|
41944 |
|
41945 |
|
41946 |
|
41947 | function shuffle(collection) {
|
41948 | var func = isArray(collection) ? arrayShuffle : baseShuffle;
|
41949 | return func(collection);
|
41950 | }
|
41951 |
|
41952 | module.exports = shuffle;
|
41953 |
|
41954 |
|
41955 | }),
|
41956 |
|
41957 | (function(module, exports, __webpack_require__) {
|
41958 |
|
41959 | var copyArray = __webpack_require__(634),
|
41960 | shuffleSelf = __webpack_require__(270);
|
41961 |
|
41962 |
|
41963 |
|
41964 |
|
41965 |
|
41966 |
|
41967 |
|
41968 |
|
41969 | function arrayShuffle(array) {
|
41970 | return shuffleSelf(copyArray(array));
|
41971 | }
|
41972 |
|
41973 | module.exports = arrayShuffle;
|
41974 |
|
41975 |
|
41976 | }),
|
41977 |
|
41978 | (function(module, exports) {
|
41979 |
|
41980 |
|
41981 |
|
41982 |
|
41983 |
|
41984 |
|
41985 |
|
41986 |
|
41987 |
|
41988 | function copyArray(source, array) {
|
41989 | var index = -1,
|
41990 | length = source.length;
|
41991 |
|
41992 | array || (array = Array(length));
|
41993 | while (++index < length) {
|
41994 | array[index] = source[index];
|
41995 | }
|
41996 | return array;
|
41997 | }
|
41998 |
|
41999 | module.exports = copyArray;
|
42000 |
|
42001 |
|
42002 | }),
|
42003 |
|
42004 | (function(module, exports) {
|
42005 |
|
42006 |
|
42007 | var nativeFloor = Math.floor,
|
42008 | nativeRandom = Math.random;
|
42009 |
|
42010 |
|
42011 |
|
42012 |
|
42013 |
|
42014 |
|
42015 |
|
42016 |
|
42017 |
|
42018 |
|
42019 | function baseRandom(lower, upper) {
|
42020 | return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
|
42021 | }
|
42022 |
|
42023 | module.exports = baseRandom;
|
42024 |
|
42025 |
|
42026 | }),
|
42027 |
|
42028 | (function(module, exports, __webpack_require__) {
|
42029 |
|
42030 | var shuffleSelf = __webpack_require__(270),
|
42031 | values = __webpack_require__(271);
|
42032 |
|
42033 |
|
42034 |
|
42035 |
|
42036 |
|
42037 |
|
42038 |
|
42039 |
|
42040 | function baseShuffle(collection) {
|
42041 | return shuffleSelf(values(collection));
|
42042 | }
|
42043 |
|
42044 | module.exports = baseShuffle;
|
42045 |
|
42046 |
|
42047 | }),
|
42048 |
|
42049 | (function(module, exports, __webpack_require__) {
|
42050 |
|
42051 | var arrayMap = __webpack_require__(638);
|
42052 |
|
42053 |
|
42054 |
|
42055 |
|
42056 |
|
42057 |
|
42058 |
|
42059 |
|
42060 |
|
42061 |
|
42062 |
|
42063 | function baseValues(object, props) {
|
42064 | return arrayMap(props, function(key) {
|
42065 | return object[key];
|
42066 | });
|
42067 | }
|
42068 |
|
42069 | module.exports = baseValues;
|
42070 |
|
42071 |
|
42072 | }),
|
42073 |
|
42074 | (function(module, exports) {
|
42075 |
|
42076 |
|
42077 |
|
42078 |
|
42079 |
|
42080 |
|
42081 |
|
42082 |
|
42083 |
|
42084 |
|
42085 | function arrayMap(array, iteratee) {
|
42086 | var index = -1,
|
42087 | length = array == null ? 0 : array.length,
|
42088 | result = Array(length);
|
42089 |
|
42090 | while (++index < length) {
|
42091 | result[index] = iteratee(array[index], index, array);
|
42092 | }
|
42093 | return result;
|
42094 | }
|
42095 |
|
42096 | module.exports = arrayMap;
|
42097 |
|
42098 |
|
42099 | }),
|
42100 |
|
42101 | (function(module, exports, __webpack_require__) {
|
42102 |
|
42103 | var arrayLikeKeys = __webpack_require__(640),
|
42104 | baseKeys = __webpack_require__(653),
|
42105 | isArrayLike = __webpack_require__(656);
|
42106 |
|
42107 |
|
42108 |
|
42109 |
|
42110 |
|
42111 |
|
42112 |
|
42113 |
|
42114 |
|
42115 |
|
42116 |
|
42117 |
|
42118 |
|
42119 |
|
42120 |
|
42121 |
|
42122 |
|
42123 |
|
42124 |
|
42125 |
|
42126 |
|
42127 |
|
42128 |
|
42129 |
|
42130 |
|
42131 |
|
42132 |
|
42133 |
|
42134 |
|
42135 | function keys(object) {
|
42136 | return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
|
42137 | }
|
42138 |
|
42139 | module.exports = keys;
|
42140 |
|
42141 |
|
42142 | }),
|
42143 |
|
42144 | (function(module, exports, __webpack_require__) {
|
42145 |
|
42146 | var baseTimes = __webpack_require__(641),
|
42147 | isArguments = __webpack_require__(642),
|
42148 | isArray = __webpack_require__(275),
|
42149 | isBuffer = __webpack_require__(646),
|
42150 | isIndex = __webpack_require__(648),
|
42151 | isTypedArray = __webpack_require__(649);
|
42152 |
|
42153 |
|
42154 | var objectProto = Object.prototype;
|
42155 |
|
42156 |
|
42157 | var hasOwnProperty = objectProto.hasOwnProperty;
|
42158 |
|
42159 |
|
42160 |
|
42161 |
|
42162 |
|
42163 |
|
42164 |
|
42165 |
|
42166 |
|
42167 | function arrayLikeKeys(value, inherited) {
|
42168 | var isArr = isArray(value),
|
42169 | isArg = !isArr && isArguments(value),
|
42170 | isBuff = !isArr && !isArg && isBuffer(value),
|
42171 | isType = !isArr && !isArg && !isBuff && isTypedArray(value),
|
42172 | skipIndexes = isArr || isArg || isBuff || isType,
|
42173 | result = skipIndexes ? baseTimes(value.length, String) : [],
|
42174 | length = result.length;
|
42175 |
|
42176 | for (var key in value) {
|
42177 | if ((inherited || hasOwnProperty.call(value, key)) &&
|
42178 | !(skipIndexes && (
|
42179 |
|
42180 | key == 'length' ||
|
42181 |
|
42182 | (isBuff && (key == 'offset' || key == 'parent')) ||
|
42183 |
|
42184 | (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
|
42185 |
|
42186 | isIndex(key, length)
|
42187 | ))) {
|
42188 | result.push(key);
|
42189 | }
|
42190 | }
|
42191 | return result;
|
42192 | }
|
42193 |
|
42194 | module.exports = arrayLikeKeys;
|
42195 |
|
42196 |
|
42197 | }),
|
42198 |
|
42199 | (function(module, exports) {
|
42200 |
|
42201 |
|
42202 |
|
42203 |
|
42204 |
|
42205 |
|
42206 |
|
42207 |
|
42208 |
|
42209 |
|
42210 | function baseTimes(n, iteratee) {
|
42211 | var index = -1,
|
42212 | result = Array(n);
|
42213 |
|
42214 | while (++index < n) {
|
42215 | result[index] = iteratee(index);
|
42216 | }
|
42217 | return result;
|
42218 | }
|
42219 |
|
42220 | module.exports = baseTimes;
|
42221 |
|
42222 |
|
42223 | }),
|
42224 |
|
42225 | (function(module, exports, __webpack_require__) {
|
42226 |
|
42227 | var baseIsArguments = __webpack_require__(643),
|
42228 | isObjectLike = __webpack_require__(120);
|
42229 |
|
42230 |
|
42231 | var objectProto = Object.prototype;
|
42232 |
|
42233 |
|
42234 | var hasOwnProperty = objectProto.hasOwnProperty;
|
42235 |
|
42236 |
|
42237 | var propertyIsEnumerable = objectProto.propertyIsEnumerable;
|
42238 |
|
42239 |
|
42240 |
|
42241 |
|
42242 |
|
42243 |
|
42244 |
|
42245 |
|
42246 |
|
42247 |
|
42248 |
|
42249 |
|
42250 |
|
42251 |
|
42252 |
|
42253 |
|
42254 |
|
42255 |
|
42256 |
|
42257 | var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
|
42258 | return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
|
42259 | !propertyIsEnumerable.call(value, 'callee');
|
42260 | };
|
42261 |
|
42262 | module.exports = isArguments;
|
42263 |
|
42264 |
|
42265 | }),
|
42266 |
|
42267 | (function(module, exports, __webpack_require__) {
|
42268 |
|
42269 | var baseGetTag = __webpack_require__(119),
|
42270 | isObjectLike = __webpack_require__(120);
|
42271 |
|
42272 |
|
42273 | var argsTag = '[object Arguments]';
|
42274 |
|
42275 |
|
42276 |
|
42277 |
|
42278 |
|
42279 |
|
42280 |
|
42281 |
|
42282 | function baseIsArguments(value) {
|
42283 | return isObjectLike(value) && baseGetTag(value) == argsTag;
|
42284 | }
|
42285 |
|
42286 | module.exports = baseIsArguments;
|
42287 |
|
42288 |
|
42289 | }),
|
42290 |
|
42291 | (function(module, exports, __webpack_require__) {
|
42292 |
|
42293 | var Symbol = __webpack_require__(272);
|
42294 |
|
42295 |
|
42296 | var objectProto = Object.prototype;
|
42297 |
|
42298 |
|
42299 | var hasOwnProperty = objectProto.hasOwnProperty;
|
42300 |
|
42301 |
|
42302 |
|
42303 |
|
42304 |
|
42305 |
|
42306 | var nativeObjectToString = objectProto.toString;
|
42307 |
|
42308 |
|
42309 | var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
|
42310 |
|
42311 |
|
42312 |
|
42313 |
|
42314 |
|
42315 |
|
42316 |
|
42317 |
|
42318 | function getRawTag(value) {
|
42319 | var isOwn = hasOwnProperty.call(value, symToStringTag),
|
42320 | tag = value[symToStringTag];
|
42321 |
|
42322 | try {
|
42323 | value[symToStringTag] = undefined;
|
42324 | var unmasked = true;
|
42325 | } catch (e) {}
|
42326 |
|
42327 | var result = nativeObjectToString.call(value);
|
42328 | if (unmasked) {
|
42329 | if (isOwn) {
|
42330 | value[symToStringTag] = tag;
|
42331 | } else {
|
42332 | delete value[symToStringTag];
|
42333 | }
|
42334 | }
|
42335 | return result;
|
42336 | }
|
42337 |
|
42338 | module.exports = getRawTag;
|
42339 |
|
42340 |
|
42341 | }),
|
42342 |
|
42343 | (function(module, exports) {
|
42344 |
|
42345 |
|
42346 | var objectProto = Object.prototype;
|
42347 |
|
42348 |
|
42349 |
|
42350 |
|
42351 |
|
42352 |
|
42353 | var nativeObjectToString = objectProto.toString;
|
42354 |
|
42355 |
|
42356 |
|
42357 |
|
42358 |
|
42359 |
|
42360 |
|
42361 |
|
42362 | function objectToString(value) {
|
42363 | return nativeObjectToString.call(value);
|
42364 | }
|
42365 |
|
42366 | module.exports = objectToString;
|
42367 |
|
42368 |
|
42369 | }),
|
42370 |
|
42371 | (function(module, exports, __webpack_require__) {
|
42372 |
|
42373 | (function(module) {var root = __webpack_require__(273),
|
42374 | stubFalse = __webpack_require__(647);
|
42375 |
|
42376 |
|
42377 | var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
|
42378 |
|
42379 |
|
42380 | var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
|
42381 |
|
42382 |
|
42383 | var moduleExports = freeModule && freeModule.exports === freeExports;
|
42384 |
|
42385 |
|
42386 | var Buffer = moduleExports ? root.Buffer : undefined;
|
42387 |
|
42388 |
|
42389 | var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;
|
42390 |
|
42391 |
|
42392 |
|
42393 |
|
42394 |
|
42395 |
|
42396 |
|
42397 |
|
42398 |
|
42399 |
|
42400 |
|
42401 |
|
42402 |
|
42403 |
|
42404 |
|
42405 |
|
42406 |
|
42407 |
|
42408 | var isBuffer = nativeIsBuffer || stubFalse;
|
42409 |
|
42410 | module.exports = isBuffer;
|
42411 |
|
42412 | }.call(exports, __webpack_require__(276)(module)))
|
42413 |
|
42414 | }),
|
42415 |
|
42416 | (function(module, exports) {
|
42417 |
|
42418 |
|
42419 |
|
42420 |
|
42421 |
|
42422 |
|
42423 |
|
42424 |
|
42425 |
|
42426 |
|
42427 |
|
42428 |
|
42429 |
|
42430 |
|
42431 | function stubFalse() {
|
42432 | return false;
|
42433 | }
|
42434 |
|
42435 | module.exports = stubFalse;
|
42436 |
|
42437 |
|
42438 | }),
|
42439 |
|
42440 | (function(module, exports) {
|
42441 |
|
42442 |
|
42443 | var MAX_SAFE_INTEGER = 9007199254740991;
|
42444 |
|
42445 |
|
42446 | var reIsUint = /^(?:0|[1-9]\d*)$/;
|
42447 |
|
42448 |
|
42449 |
|
42450 |
|
42451 |
|
42452 |
|
42453 |
|
42454 |
|
42455 |
|
42456 | function isIndex(value, length) {
|
42457 | var type = typeof value;
|
42458 | length = length == null ? MAX_SAFE_INTEGER : length;
|
42459 |
|
42460 | return !!length &&
|
42461 | (type == 'number' ||
|
42462 | (type != 'symbol' && reIsUint.test(value))) &&
|
42463 | (value > -1 && value % 1 == 0 && value < length);
|
42464 | }
|
42465 |
|
42466 | module.exports = isIndex;
|
42467 |
|
42468 |
|
42469 | }),
|
42470 |
|
42471 | (function(module, exports, __webpack_require__) {
|
42472 |
|
42473 | var baseIsTypedArray = __webpack_require__(650),
|
42474 | baseUnary = __webpack_require__(651),
|
42475 | nodeUtil = __webpack_require__(652);
|
42476 |
|
42477 |
|
42478 | var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
|
42479 |
|
42480 |
|
42481 |
|
42482 |
|
42483 |
|
42484 |
|
42485 |
|
42486 |
|
42487 |
|
42488 |
|
42489 |
|
42490 |
|
42491 |
|
42492 |
|
42493 |
|
42494 |
|
42495 |
|
42496 |
|
42497 | var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
|
42498 |
|
42499 | module.exports = isTypedArray;
|
42500 |
|
42501 |
|
42502 | }),
|
42503 |
|
42504 | (function(module, exports, __webpack_require__) {
|
42505 |
|
42506 | var baseGetTag = __webpack_require__(119),
|
42507 | isLength = __webpack_require__(277),
|
42508 | isObjectLike = __webpack_require__(120);
|
42509 |
|
42510 |
|
42511 | var argsTag = '[object Arguments]',
|
42512 | arrayTag = '[object Array]',
|
42513 | boolTag = '[object Boolean]',
|
42514 | dateTag = '[object Date]',
|
42515 | errorTag = '[object Error]',
|
42516 | funcTag = '[object Function]',
|
42517 | mapTag = '[object Map]',
|
42518 | numberTag = '[object Number]',
|
42519 | objectTag = '[object Object]',
|
42520 | regexpTag = '[object RegExp]',
|
42521 | setTag = '[object Set]',
|
42522 | stringTag = '[object String]',
|
42523 | weakMapTag = '[object WeakMap]';
|
42524 |
|
42525 | var arrayBufferTag = '[object ArrayBuffer]',
|
42526 | dataViewTag = '[object DataView]',
|
42527 | float32Tag = '[object Float32Array]',
|
42528 | float64Tag = '[object Float64Array]',
|
42529 | int8Tag = '[object Int8Array]',
|
42530 | int16Tag = '[object Int16Array]',
|
42531 | int32Tag = '[object Int32Array]',
|
42532 | uint8Tag = '[object Uint8Array]',
|
42533 | uint8ClampedTag = '[object Uint8ClampedArray]',
|
42534 | uint16Tag = '[object Uint16Array]',
|
42535 | uint32Tag = '[object Uint32Array]';
|
42536 |
|
42537 |
|
42538 | var typedArrayTags = {};
|
42539 | typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
|
42540 | typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
|
42541 | typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
|
42542 | typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
|
42543 | typedArrayTags[uint32Tag] = true;
|
42544 | typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
|
42545 | typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
|
42546 | typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
|
42547 | typedArrayTags[errorTag] = typedArrayTags[funcTag] =
|
42548 | typedArrayTags[mapTag] = typedArrayTags[numberTag] =
|
42549 | typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
|
42550 | typedArrayTags[setTag] = typedArrayTags[stringTag] =
|
42551 | typedArrayTags[weakMapTag] = false;
|
42552 |
|
42553 |
|
42554 |
|
42555 |
|
42556 |
|
42557 |
|
42558 |
|
42559 |
|
42560 | function baseIsTypedArray(value) {
|
42561 | return isObjectLike(value) &&
|
42562 | isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
|
42563 | }
|
42564 |
|
42565 | module.exports = baseIsTypedArray;
|
42566 |
|
42567 |
|
42568 | }),
|
42569 |
|
42570 | (function(module, exports) {
|
42571 |
|
42572 |
|
42573 |
|
42574 |
|
42575 |
|
42576 |
|
42577 |
|
42578 |
|
42579 | function baseUnary(func) {
|
42580 | return function(value) {
|
42581 | return func(value);
|
42582 | };
|
42583 | }
|
42584 |
|
42585 | module.exports = baseUnary;
|
42586 |
|
42587 |
|
42588 | }),
|
42589 |
|
42590 | (function(module, exports, __webpack_require__) {
|
42591 |
|
42592 | (function(module) {var freeGlobal = __webpack_require__(274);
|
42593 |
|
42594 |
|
42595 | var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
|
42596 |
|
42597 |
|
42598 | var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
|
42599 |
|
42600 |
|
42601 | var moduleExports = freeModule && freeModule.exports === freeExports;
|
42602 |
|
42603 |
|
42604 | var freeProcess = moduleExports && freeGlobal.process;
|
42605 |
|
42606 |
|
42607 | var nodeUtil = (function() {
|
42608 | try {
|
42609 |
|
42610 | var types = freeModule && freeModule.require && freeModule.require('util').types;
|
42611 |
|
42612 | if (types) {
|
42613 | return types;
|
42614 | }
|
42615 |
|
42616 |
|
42617 | return freeProcess && freeProcess.binding && freeProcess.binding('util');
|
42618 | } catch (e) {}
|
42619 | }());
|
42620 |
|
42621 | module.exports = nodeUtil;
|
42622 |
|
42623 | }.call(exports, __webpack_require__(276)(module)))
|
42624 |
|
42625 | }),
|
42626 |
|
42627 | (function(module, exports, __webpack_require__) {
|
42628 |
|
42629 | var isPrototype = __webpack_require__(654),
|
42630 | nativeKeys = __webpack_require__(655);
|
42631 |
|
42632 |
|
42633 | var objectProto = Object.prototype;
|
42634 |
|
42635 |
|
42636 | var hasOwnProperty = objectProto.hasOwnProperty;
|
42637 |
|
42638 |
|
42639 |
|
42640 |
|
42641 |
|
42642 |
|
42643 |
|
42644 |
|
42645 | function baseKeys(object) {
|
42646 | if (!isPrototype(object)) {
|
42647 | return nativeKeys(object);
|
42648 | }
|
42649 | var result = [];
|
42650 | for (var key in Object(object)) {
|
42651 | if (hasOwnProperty.call(object, key) && key != 'constructor') {
|
42652 | result.push(key);
|
42653 | }
|
42654 | }
|
42655 | return result;
|
42656 | }
|
42657 |
|
42658 | module.exports = baseKeys;
|
42659 |
|
42660 |
|
42661 | }),
|
42662 |
|
42663 | (function(module, exports) {
|
42664 |
|
42665 |
|
42666 | var objectProto = Object.prototype;
|
42667 |
|
42668 |
|
42669 |
|
42670 |
|
42671 |
|
42672 |
|
42673 |
|
42674 |
|
42675 | function isPrototype(value) {
|
42676 | var Ctor = value && value.constructor,
|
42677 | proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
|
42678 |
|
42679 | return value === proto;
|
42680 | }
|
42681 |
|
42682 | module.exports = isPrototype;
|
42683 |
|
42684 |
|
42685 | }),
|
42686 |
|
42687 | (function(module, exports, __webpack_require__) {
|
42688 |
|
42689 | var overArg = __webpack_require__(278);
|
42690 |
|
42691 |
|
42692 | var nativeKeys = overArg(Object.keys, Object);
|
42693 |
|
42694 | module.exports = nativeKeys;
|
42695 |
|
42696 |
|
42697 | }),
|
42698 |
|
42699 | (function(module, exports, __webpack_require__) {
|
42700 |
|
42701 | var isFunction = __webpack_require__(657),
|
42702 | isLength = __webpack_require__(277);
|
42703 |
|
42704 |
|
42705 |
|
42706 |
|
42707 |
|
42708 |
|
42709 |
|
42710 |
|
42711 |
|
42712 |
|
42713 |
|
42714 |
|
42715 |
|
42716 |
|
42717 |
|
42718 |
|
42719 |
|
42720 |
|
42721 |
|
42722 |
|
42723 |
|
42724 |
|
42725 |
|
42726 |
|
42727 |
|
42728 |
|
42729 | function isArrayLike(value) {
|
42730 | return value != null && isLength(value.length) && !isFunction(value);
|
42731 | }
|
42732 |
|
42733 | module.exports = isArrayLike;
|
42734 |
|
42735 |
|
42736 | }),
|
42737 |
|
42738 | (function(module, exports, __webpack_require__) {
|
42739 |
|
42740 | var baseGetTag = __webpack_require__(119),
|
42741 | isObject = __webpack_require__(658);
|
42742 |
|
42743 |
|
42744 | var asyncTag = '[object AsyncFunction]',
|
42745 | funcTag = '[object Function]',
|
42746 | genTag = '[object GeneratorFunction]',
|
42747 | proxyTag = '[object Proxy]';
|
42748 |
|
42749 |
|
42750 |
|
42751 |
|
42752 |
|
42753 |
|
42754 |
|
42755 |
|
42756 |
|
42757 |
|
42758 |
|
42759 |
|
42760 |
|
42761 |
|
42762 |
|
42763 |
|
42764 |
|
42765 |
|
42766 | function isFunction(value) {
|
42767 | if (!isObject(value)) {
|
42768 | return false;
|
42769 | }
|
42770 |
|
42771 |
|
42772 | var tag = baseGetTag(value);
|
42773 | return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
|
42774 | }
|
42775 |
|
42776 | module.exports = isFunction;
|
42777 |
|
42778 |
|
42779 | }),
|
42780 |
|
42781 | (function(module, exports) {
|
42782 |
|
42783 |
|
42784 |
|
42785 |
|
42786 |
|
42787 |
|
42788 |
|
42789 |
|
42790 |
|
42791 |
|
42792 |
|
42793 |
|
42794 |
|
42795 |
|
42796 |
|
42797 |
|
42798 |
|
42799 |
|
42800 |
|
42801 |
|
42802 |
|
42803 |
|
42804 |
|
42805 |
|
42806 |
|
42807 |
|
42808 | function isObject(value) {
|
42809 | var type = typeof value;
|
42810 | return value != null && (type == 'object' || type == 'function');
|
42811 | }
|
42812 |
|
42813 | module.exports = isObject;
|
42814 |
|
42815 |
|
42816 | }),
|
42817 |
|
42818 | (function(module, exports, __webpack_require__) {
|
42819 |
|
42820 | var arrayWithHoles = __webpack_require__(660);
|
42821 | var iterableToArray = __webpack_require__(267);
|
42822 | var unsupportedIterableToArray = __webpack_require__(268);
|
42823 | var nonIterableRest = __webpack_require__(661);
|
42824 | function _toArray(arr) {
|
42825 | return arrayWithHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableRest();
|
42826 | }
|
42827 | module.exports = _toArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
42828 |
|
42829 | }),
|
42830 |
|
42831 | (function(module, exports) {
|
42832 |
|
42833 | function _arrayWithHoles(arr) {
|
42834 | if (Array.isArray(arr)) return arr;
|
42835 | }
|
42836 | module.exports = _arrayWithHoles, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
42837 |
|
42838 | }),
|
42839 |
|
42840 | (function(module, exports) {
|
42841 |
|
42842 | function _nonIterableRest() {
|
42843 | throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
42844 | }
|
42845 | module.exports = _nonIterableRest, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
42846 |
|
42847 | }),
|
42848 |
|
42849 | (function(module, exports, __webpack_require__) {
|
42850 |
|
42851 | var toPropertyKey = __webpack_require__(269);
|
42852 | function _defineProperties(target, props) {
|
42853 | for (var i = 0; i < props.length; i++) {
|
42854 | var descriptor = props[i];
|
42855 | descriptor.enumerable = descriptor.enumerable || false;
|
42856 | descriptor.configurable = true;
|
42857 | if ("value" in descriptor) descriptor.writable = true;
|
42858 | Object.defineProperty(target, toPropertyKey(descriptor.key), descriptor);
|
42859 | }
|
42860 | }
|
42861 | function _createClass(Constructor, protoProps, staticProps) {
|
42862 | if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
42863 | if (staticProps) _defineProperties(Constructor, staticProps);
|
42864 | Object.defineProperty(Constructor, "prototype", {
|
42865 | writable: false
|
42866 | });
|
42867 | return Constructor;
|
42868 | }
|
42869 | module.exports = _createClass, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
42870 |
|
42871 | }),
|
42872 |
|
42873 | (function(module, exports) {
|
42874 |
|
42875 | function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) {
|
42876 | var desc = {};
|
42877 | Object.keys(descriptor).forEach(function (key) {
|
42878 | desc[key] = descriptor[key];
|
42879 | });
|
42880 | desc.enumerable = !!desc.enumerable;
|
42881 | desc.configurable = !!desc.configurable;
|
42882 | if ('value' in desc || desc.initializer) {
|
42883 | desc.writable = true;
|
42884 | }
|
42885 | desc = decorators.slice().reverse().reduce(function (desc, decorator) {
|
42886 | return decorator(target, property, desc) || desc;
|
42887 | }, desc);
|
42888 | if (context && desc.initializer !== void 0) {
|
42889 | desc.value = desc.initializer ? desc.initializer.call(context) : void 0;
|
42890 | desc.initializer = undefined;
|
42891 | }
|
42892 | if (desc.initializer === void 0) {
|
42893 | Object.defineProperty(target, property, desc);
|
42894 | desc = null;
|
42895 | }
|
42896 | return desc;
|
42897 | }
|
42898 | module.exports = _applyDecoratedDescriptor, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
42899 |
|
42900 | }),
|
42901 |
|
42902 | (function(module, exports, __webpack_require__) {
|
42903 |
|
42904 |
|
42905 |
|
42906 |
|
42907 |
|
42908 |
|
42909 |
|
42910 |
|
42911 |
|
42912 |
|
42913 | (function () {
|
42914 |
|
42915 | var StateMachine = {
|
42916 |
|
42917 |
|
42918 |
|
42919 | VERSION: "2.4.0",
|
42920 |
|
42921 |
|
42922 |
|
42923 | Result: {
|
42924 | SUCCEEDED: 1,
|
42925 | NOTRANSITION: 2,
|
42926 | CANCELLED: 3,
|
42927 | PENDING: 4
|
42928 | },
|
42929 |
|
42930 | Error: {
|
42931 | INVALID_TRANSITION: 100,
|
42932 | PENDING_TRANSITION: 200,
|
42933 | INVALID_CALLBACK: 300
|
42934 | },
|
42935 |
|
42936 | WILDCARD: '*',
|
42937 | ASYNC: 'async',
|
42938 |
|
42939 |
|
42940 |
|
42941 | create: function(cfg, target) {
|
42942 |
|
42943 | var initial = (typeof cfg.initial == 'string') ? { state: cfg.initial } : cfg.initial;
|
42944 | var terminal = cfg.terminal || cfg['final'];
|
42945 | var fsm = target || cfg.target || {};
|
42946 | var events = cfg.events || [];
|
42947 | var callbacks = cfg.callbacks || {};
|
42948 | var map = {};
|
42949 | var transitions = {};
|
42950 |
|
42951 | var add = function(e) {
|
42952 | var from = Array.isArray(e.from) ? e.from : (e.from ? [e.from] : [StateMachine.WILDCARD]);
|
42953 | map[e.name] = map[e.name] || {};
|
42954 | for (var n = 0 ; n < from.length ; n++) {
|
42955 | transitions[from[n]] = transitions[from[n]] || [];
|
42956 | transitions[from[n]].push(e.name);
|
42957 |
|
42958 | map[e.name][from[n]] = e.to || from[n];
|
42959 | }
|
42960 | if (e.to)
|
42961 | transitions[e.to] = transitions[e.to] || [];
|
42962 | };
|
42963 |
|
42964 | if (initial) {
|
42965 | initial.event = initial.event || 'startup';
|
42966 | add({ name: initial.event, from: 'none', to: initial.state });
|
42967 | }
|
42968 |
|
42969 | for(var n = 0 ; n < events.length ; n++)
|
42970 | add(events[n]);
|
42971 |
|
42972 | for(var name in map) {
|
42973 | if (map.hasOwnProperty(name))
|
42974 | fsm[name] = StateMachine.buildEvent(name, map[name]);
|
42975 | }
|
42976 |
|
42977 | for(var name in callbacks) {
|
42978 | if (callbacks.hasOwnProperty(name))
|
42979 | fsm[name] = callbacks[name]
|
42980 | }
|
42981 |
|
42982 | fsm.current = 'none';
|
42983 | fsm.is = function(state) { return Array.isArray(state) ? (state.indexOf(this.current) >= 0) : (this.current === state); };
|
42984 | fsm.can = function(event) { return !this.transition && (map[event] !== undefined) && (map[event].hasOwnProperty(this.current) || map[event].hasOwnProperty(StateMachine.WILDCARD)); }
|
42985 | fsm.cannot = function(event) { return !this.can(event); };
|
42986 | fsm.transitions = function() { return (transitions[this.current] || []).concat(transitions[StateMachine.WILDCARD] || []); };
|
42987 | fsm.isFinished = function() { return this.is(terminal); };
|
42988 | fsm.error = cfg.error || function(name, from, to, args, error, msg, e) { throw e || msg; };
|
42989 | fsm.states = function() { return Object.keys(transitions).sort() };
|
42990 |
|
42991 | if (initial && !initial.defer)
|
42992 | fsm[initial.event]();
|
42993 |
|
42994 | return fsm;
|
42995 |
|
42996 | },
|
42997 |
|
42998 |
|
42999 |
|
43000 | doCallback: function(fsm, func, name, from, to, args) {
|
43001 | if (func) {
|
43002 | try {
|
43003 | return func.apply(fsm, [name, from, to].concat(args));
|
43004 | }
|
43005 | catch(e) {
|
43006 | return fsm.error(name, from, to, args, StateMachine.Error.INVALID_CALLBACK, "an exception occurred in a caller-provided callback function", e);
|
43007 | }
|
43008 | }
|
43009 | },
|
43010 |
|
43011 | beforeAnyEvent: function(fsm, name, from, to, args) { return StateMachine.doCallback(fsm, fsm['onbeforeevent'], name, from, to, args); },
|
43012 | afterAnyEvent: function(fsm, name, from, to, args) { return StateMachine.doCallback(fsm, fsm['onafterevent'] || fsm['onevent'], name, from, to, args); },
|
43013 | leaveAnyState: function(fsm, name, from, to, args) { return StateMachine.doCallback(fsm, fsm['onleavestate'], name, from, to, args); },
|
43014 | enterAnyState: function(fsm, name, from, to, args) { return StateMachine.doCallback(fsm, fsm['onenterstate'] || fsm['onstate'], name, from, to, args); },
|
43015 | changeState: function(fsm, name, from, to, args) { return StateMachine.doCallback(fsm, fsm['onchangestate'], name, from, to, args); },
|
43016 |
|
43017 | beforeThisEvent: function(fsm, name, from, to, args) { return StateMachine.doCallback(fsm, fsm['onbefore' + name], name, from, to, args); },
|
43018 | afterThisEvent: function(fsm, name, from, to, args) { return StateMachine.doCallback(fsm, fsm['onafter' + name] || fsm['on' + name], name, from, to, args); },
|
43019 | leaveThisState: function(fsm, name, from, to, args) { return StateMachine.doCallback(fsm, fsm['onleave' + from], name, from, to, args); },
|
43020 | enterThisState: function(fsm, name, from, to, args) { return StateMachine.doCallback(fsm, fsm['onenter' + to] || fsm['on' + to], name, from, to, args); },
|
43021 |
|
43022 | beforeEvent: function(fsm, name, from, to, args) {
|
43023 | if ((false === StateMachine.beforeThisEvent(fsm, name, from, to, args)) ||
|
43024 | (false === StateMachine.beforeAnyEvent( fsm, name, from, to, args)))
|
43025 | return false;
|
43026 | },
|
43027 |
|
43028 | afterEvent: function(fsm, name, from, to, args) {
|
43029 | StateMachine.afterThisEvent(fsm, name, from, to, args);
|
43030 | StateMachine.afterAnyEvent( fsm, name, from, to, args);
|
43031 | },
|
43032 |
|
43033 | leaveState: function(fsm, name, from, to, args) {
|
43034 | var specific = StateMachine.leaveThisState(fsm, name, from, to, args),
|
43035 | general = StateMachine.leaveAnyState( fsm, name, from, to, args);
|
43036 | if ((false === specific) || (false === general))
|
43037 | return false;
|
43038 | else if ((StateMachine.ASYNC === specific) || (StateMachine.ASYNC === general))
|
43039 | return StateMachine.ASYNC;
|
43040 | },
|
43041 |
|
43042 | enterState: function(fsm, name, from, to, args) {
|
43043 | StateMachine.enterThisState(fsm, name, from, to, args);
|
43044 | StateMachine.enterAnyState( fsm, name, from, to, args);
|
43045 | },
|
43046 |
|
43047 |
|
43048 |
|
43049 | buildEvent: function(name, map) {
|
43050 | return function() {
|
43051 |
|
43052 | var from = this.current;
|
43053 | var to = map[from] || (map[StateMachine.WILDCARD] != StateMachine.WILDCARD ? map[StateMachine.WILDCARD] : from) || from;
|
43054 | var args = Array.prototype.slice.call(arguments);
|
43055 |
|
43056 | if (this.transition)
|
43057 | return this.error(name, from, to, args, StateMachine.Error.PENDING_TRANSITION, "event " + name + " inappropriate because previous transition did not complete");
|
43058 |
|
43059 | if (this.cannot(name))
|
43060 | return this.error(name, from, to, args, StateMachine.Error.INVALID_TRANSITION, "event " + name + " inappropriate in current state " + this.current);
|
43061 |
|
43062 | if (false === StateMachine.beforeEvent(this, name, from, to, args))
|
43063 | return StateMachine.Result.CANCELLED;
|
43064 |
|
43065 | if (from === to) {
|
43066 | StateMachine.afterEvent(this, name, from, to, args);
|
43067 | return StateMachine.Result.NOTRANSITION;
|
43068 | }
|
43069 |
|
43070 |
|
43071 | var fsm = this;
|
43072 | this.transition = function() {
|
43073 | fsm.transition = null;
|
43074 | fsm.current = to;
|
43075 | StateMachine.enterState( fsm, name, from, to, args);
|
43076 | StateMachine.changeState(fsm, name, from, to, args);
|
43077 | StateMachine.afterEvent( fsm, name, from, to, args);
|
43078 | return StateMachine.Result.SUCCEEDED;
|
43079 | };
|
43080 | this.transition.cancel = function() {
|
43081 | fsm.transition = null;
|
43082 | StateMachine.afterEvent(fsm, name, from, to, args);
|
43083 | }
|
43084 |
|
43085 | var leave = StateMachine.leaveState(this, name, from, to, args);
|
43086 | if (false === leave) {
|
43087 | this.transition = null;
|
43088 | return StateMachine.Result.CANCELLED;
|
43089 | }
|
43090 | else if (StateMachine.ASYNC === leave) {
|
43091 | return StateMachine.Result.PENDING;
|
43092 | }
|
43093 | else {
|
43094 | if (this.transition)
|
43095 | return this.transition();
|
43096 | }
|
43097 |
|
43098 | };
|
43099 | }
|
43100 |
|
43101 | };
|
43102 |
|
43103 |
|
43104 |
|
43105 |
|
43106 |
|
43107 |
|
43108 | if (true) {
|
43109 | if (typeof module !== 'undefined' && module.exports) {
|
43110 | exports = module.exports = StateMachine;
|
43111 | }
|
43112 | exports.StateMachine = StateMachine;
|
43113 | }
|
43114 |
|
43115 |
|
43116 |
|
43117 | else if (typeof define === 'function' && define.amd) {
|
43118 | define(function(require) { return StateMachine; });
|
43119 | }
|
43120 |
|
43121 |
|
43122 |
|
43123 | else if (typeof window !== 'undefined') {
|
43124 | window.StateMachine = StateMachine;
|
43125 | }
|
43126 |
|
43127 |
|
43128 |
|
43129 | else if (typeof self !== 'undefined') {
|
43130 | self.StateMachine = StateMachine;
|
43131 | }
|
43132 |
|
43133 | }());
|
43134 |
|
43135 |
|
43136 | }),
|
43137 |
|
43138 | (function(module, exports, __webpack_require__) {
|
43139 |
|
43140 | var baseGetTag = __webpack_require__(119),
|
43141 | getPrototype = __webpack_require__(666),
|
43142 | isObjectLike = __webpack_require__(120);
|
43143 |
|
43144 |
|
43145 | var objectTag = '[object Object]';
|
43146 |
|
43147 |
|
43148 | var funcProto = Function.prototype,
|
43149 | objectProto = Object.prototype;
|
43150 |
|
43151 |
|
43152 | var funcToString = funcProto.toString;
|
43153 |
|
43154 |
|
43155 | var hasOwnProperty = objectProto.hasOwnProperty;
|
43156 |
|
43157 |
|
43158 | var objectCtorString = funcToString.call(Object);
|
43159 |
|
43160 |
|
43161 |
|
43162 |
|
43163 |
|
43164 |
|
43165 |
|
43166 |
|
43167 |
|
43168 |
|
43169 |
|
43170 |
|
43171 |
|
43172 |
|
43173 |
|
43174 |
|
43175 |
|
43176 |
|
43177 |
|
43178 |
|
43179 |
|
43180 |
|
43181 |
|
43182 |
|
43183 |
|
43184 |
|
43185 |
|
43186 |
|
43187 |
|
43188 | function isPlainObject(value) {
|
43189 | if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
|
43190 | return false;
|
43191 | }
|
43192 | var proto = getPrototype(value);
|
43193 | if (proto === null) {
|
43194 | return true;
|
43195 | }
|
43196 | var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
|
43197 | return typeof Ctor == 'function' && Ctor instanceof Ctor &&
|
43198 | funcToString.call(Ctor) == objectCtorString;
|
43199 | }
|
43200 |
|
43201 | module.exports = isPlainObject;
|
43202 |
|
43203 |
|
43204 | }),
|
43205 |
|
43206 | (function(module, exports, __webpack_require__) {
|
43207 |
|
43208 | var overArg = __webpack_require__(278);
|
43209 |
|
43210 |
|
43211 | var getPrototype = overArg(Object.getPrototypeOf, Object);
|
43212 |
|
43213 | module.exports = getPrototype;
|
43214 |
|
43215 |
|
43216 | }),
|
43217 |
|
43218 | (function(module, exports, __webpack_require__) {
|
43219 |
|
43220 | "use strict";
|
43221 | var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;
|
43222 |
|
43223 | var _interopRequireDefault = __webpack_require__(1);
|
43224 |
|
43225 | var _isIterable2 = _interopRequireDefault(__webpack_require__(668));
|
43226 |
|
43227 | var _from = _interopRequireDefault(__webpack_require__(253));
|
43228 |
|
43229 | var _set = _interopRequireDefault(__webpack_require__(265));
|
43230 |
|
43231 | var _concat = _interopRequireDefault(__webpack_require__(22));
|
43232 |
|
43233 | var _assign = _interopRequireDefault(__webpack_require__(153));
|
43234 |
|
43235 | var _map = _interopRequireDefault(__webpack_require__(35));
|
43236 |
|
43237 | var _defineProperty = _interopRequireDefault(__webpack_require__(92));
|
43238 |
|
43239 | var _typeof2 = _interopRequireDefault(__webpack_require__(73));
|
43240 |
|
43241 | (function (global, factory) {
|
43242 | ( false ? "undefined" : (0, _typeof2.default)(exports)) === 'object' && typeof module !== 'undefined' ? factory(exports, __webpack_require__(157)) : true ? !(__WEBPACK_AMD_DEFINE_ARRAY__ = [exports, __webpack_require__(157)], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
|
43243 | __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
|
43244 | (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
|
43245 | __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) : (global = global || self, factory(global.AV = global.AV || {}, global.AV));
|
43246 | })(void 0, function (exports, core) {
|
43247 | 'use strict';
|
43248 |
|
43249 | function _inheritsLoose(subClass, superClass) {
|
43250 | subClass.prototype = Object.create(superClass.prototype);
|
43251 | subClass.prototype.constructor = subClass;
|
43252 | subClass.__proto__ = superClass;
|
43253 | }
|
43254 |
|
43255 | function _toConsumableArray(arr) {
|
43256 | return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread();
|
43257 | }
|
43258 |
|
43259 | function _arrayWithoutHoles(arr) {
|
43260 | if (Array.isArray(arr)) {
|
43261 | for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) {
|
43262 | arr2[i] = arr[i];
|
43263 | }
|
43264 |
|
43265 | return arr2;
|
43266 | }
|
43267 | }
|
43268 |
|
43269 | function _iterableToArray(iter) {
|
43270 | if ((0, _isIterable2.default)(Object(iter)) || Object.prototype.toString.call(iter) === "[object Arguments]") return (0, _from.default)(iter);
|
43271 | }
|
43272 |
|
43273 | function _nonIterableSpread() {
|
43274 | throw new TypeError("Invalid attempt to spread non-iterable instance");
|
43275 | }
|
43276 |
|
43277 |
|
43278 |
|
43279 | if (!core.Protocals) {
|
43280 | throw new Error('LeanCloud Realtime SDK not installed');
|
43281 | }
|
43282 |
|
43283 | var CommandType = core.Protocals.CommandType,
|
43284 | GenericCommand = core.Protocals.GenericCommand,
|
43285 | AckCommand = core.Protocals.AckCommand;
|
43286 |
|
43287 | var warn = function warn(error) {
|
43288 | return console.warn(error.message);
|
43289 | };
|
43290 |
|
43291 | var LiveQueryClient = function (_EventEmitter) {
|
43292 | _inheritsLoose(LiveQueryClient, _EventEmitter);
|
43293 |
|
43294 | function LiveQueryClient(appId, subscriptionId, connection) {
|
43295 | var _this;
|
43296 |
|
43297 | _this = _EventEmitter.call(this) || this;
|
43298 | _this._appId = appId;
|
43299 | _this.id = subscriptionId;
|
43300 | _this._connection = connection;
|
43301 | _this._eventemitter = new core.EventEmitter();
|
43302 | _this._querys = new _set.default();
|
43303 | return _this;
|
43304 | }
|
43305 |
|
43306 | var _proto = LiveQueryClient.prototype;
|
43307 |
|
43308 | _proto._send = function _send(cmd) {
|
43309 | var _context;
|
43310 |
|
43311 | var _this$_connection;
|
43312 |
|
43313 | for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
43314 | args[_key - 1] = arguments[_key];
|
43315 | }
|
43316 |
|
43317 | return (_this$_connection = this._connection).send.apply(_this$_connection, (0, _concat.default)(_context = [(0, _assign.default)(cmd, {
|
43318 | appId: this._appId,
|
43319 | installationId: this.id,
|
43320 | service: 1
|
43321 | })]).call(_context, args));
|
43322 | };
|
43323 |
|
43324 | _proto._open = function _open() {
|
43325 | return this._send(new GenericCommand({
|
43326 | cmd: CommandType.login
|
43327 | }));
|
43328 | };
|
43329 |
|
43330 | _proto.close = function close() {
|
43331 | var _ee = this._eventemitter;
|
43332 |
|
43333 | _ee.emit('beforeclose');
|
43334 |
|
43335 | return this._send(new GenericCommand({
|
43336 | cmd: CommandType.logout
|
43337 | })).then(function () {
|
43338 | return _ee.emit('close');
|
43339 | });
|
43340 | };
|
43341 |
|
43342 | _proto.register = function register(liveQuery) {
|
43343 | this._querys.add(liveQuery);
|
43344 | };
|
43345 |
|
43346 | _proto.deregister = function deregister(liveQuery) {
|
43347 | var _this2 = this;
|
43348 |
|
43349 | this._querys.delete(liveQuery);
|
43350 |
|
43351 | setTimeout(function () {
|
43352 | if (!_this2._querys.size) _this2.close().catch(warn);
|
43353 | }, 0);
|
43354 | };
|
43355 |
|
43356 | _proto._dispatchCommand = function _dispatchCommand(command) {
|
43357 | if (command.cmd !== CommandType.data) {
|
43358 | this.emit('unhandledmessage', command);
|
43359 | return core.Promise.resolve();
|
43360 | }
|
43361 |
|
43362 | return this._dispatchDataCommand(command);
|
43363 | };
|
43364 |
|
43365 | _proto._dispatchDataCommand = function _dispatchDataCommand(_ref) {
|
43366 | var _ref$dataMessage = _ref.dataMessage,
|
43367 | ids = _ref$dataMessage.ids,
|
43368 | msg = _ref$dataMessage.msg;
|
43369 | this.emit('message', (0, _map.default)(msg).call(msg, function (_ref2) {
|
43370 | var data = _ref2.data;
|
43371 | return JSON.parse(data);
|
43372 | }));
|
43373 |
|
43374 | var command = new GenericCommand({
|
43375 | cmd: CommandType.ack,
|
43376 | ackMessage: new AckCommand({
|
43377 | ids: ids
|
43378 | })
|
43379 | });
|
43380 | return this._send(command, false).catch(warn);
|
43381 | };
|
43382 |
|
43383 | return LiveQueryClient;
|
43384 | }(core.EventEmitter);
|
43385 |
|
43386 | var finalize = function finalize(callback) {
|
43387 | return [
|
43388 | function (value) {
|
43389 | return callback(), value;
|
43390 | }, function (error) {
|
43391 | callback();
|
43392 | throw error;
|
43393 | }];
|
43394 | };
|
43395 |
|
43396 | var onRealtimeCreate = function onRealtimeCreate(realtime) {
|
43397 |
|
43398 | realtime._liveQueryClients = {};
|
43399 |
|
43400 | realtime.createLiveQueryClient = function (subscriptionId) {
|
43401 | var _realtime$_open$then;
|
43402 |
|
43403 | if (realtime._liveQueryClients[subscriptionId] !== undefined) {
|
43404 | return core.Promise.resolve(realtime._liveQueryClients[subscriptionId]);
|
43405 | }
|
43406 |
|
43407 | var promise = (_realtime$_open$then = realtime._open().then(function (connection) {
|
43408 | var client = new LiveQueryClient(realtime._options.appId, subscriptionId, connection);
|
43409 | connection.on('reconnect', function () {
|
43410 | return client._open().then(function () {
|
43411 | return client.emit('reconnect');
|
43412 | }, function (error) {
|
43413 | return client.emit('reconnecterror', error);
|
43414 | });
|
43415 | });
|
43416 |
|
43417 | client._eventemitter.on('beforeclose', function () {
|
43418 | delete realtime._liveQueryClients[client.id];
|
43419 | }, realtime);
|
43420 |
|
43421 | client._eventemitter.on('close', function () {
|
43422 | realtime._deregister(client);
|
43423 | }, realtime);
|
43424 |
|
43425 | return client._open().then(function () {
|
43426 | realtime._liveQueryClients[client.id] = client;
|
43427 |
|
43428 | realtime._register(client);
|
43429 |
|
43430 | return client;
|
43431 | });
|
43432 | })).then.apply(_realtime$_open$then, _toConsumableArray(finalize(function () {
|
43433 | if (realtime._deregisterPending) realtime._deregisterPending(promise);
|
43434 | })));
|
43435 |
|
43436 | realtime._liveQueryClients[subscriptionId] = promise;
|
43437 | if (realtime._registerPending) realtime._registerPending(promise);
|
43438 | return promise;
|
43439 | };
|
43440 |
|
43441 |
|
43442 | };
|
43443 |
|
43444 | var beforeCommandDispatch = function beforeCommandDispatch(command, realtime) {
|
43445 | var isLiveQueryCommand = command.installationId && command.service === 1;
|
43446 | if (!isLiveQueryCommand) return true;
|
43447 | var targetClient = realtime._liveQueryClients[command.installationId];
|
43448 |
|
43449 | if (targetClient) {
|
43450 | targetClient._dispatchCommand(command).catch(function (error) {
|
43451 | return console.warn(error);
|
43452 | });
|
43453 | } else {
|
43454 | console.warn('Unexpected message received without any live client match: %O', command);
|
43455 | }
|
43456 |
|
43457 | return false;
|
43458 | };
|
43459 |
|
43460 |
|
43461 | var LiveQueryPlugin = {
|
43462 | name: 'leancloud-realtime-plugin-live-query',
|
43463 | onRealtimeCreate: onRealtimeCreate,
|
43464 | beforeCommandDispatch: beforeCommandDispatch
|
43465 | };
|
43466 | exports.LiveQueryPlugin = LiveQueryPlugin;
|
43467 | (0, _defineProperty.default)(exports, '__esModule', {
|
43468 | value: true
|
43469 | });
|
43470 | });
|
43471 |
|
43472 | }),
|
43473 |
|
43474 | (function(module, exports, __webpack_require__) {
|
43475 |
|
43476 | module.exports = __webpack_require__(669);
|
43477 |
|
43478 | }),
|
43479 |
|
43480 | (function(module, exports, __webpack_require__) {
|
43481 |
|
43482 | module.exports = __webpack_require__(670);
|
43483 |
|
43484 |
|
43485 | }),
|
43486 |
|
43487 | (function(module, exports, __webpack_require__) {
|
43488 |
|
43489 | var parent = __webpack_require__(671);
|
43490 |
|
43491 | module.exports = parent;
|
43492 |
|
43493 |
|
43494 | }),
|
43495 |
|
43496 | (function(module, exports, __webpack_require__) {
|
43497 |
|
43498 | var parent = __webpack_require__(672);
|
43499 |
|
43500 | module.exports = parent;
|
43501 |
|
43502 |
|
43503 | }),
|
43504 |
|
43505 | (function(module, exports, __webpack_require__) {
|
43506 |
|
43507 | var parent = __webpack_require__(673);
|
43508 | __webpack_require__(39);
|
43509 |
|
43510 | module.exports = parent;
|
43511 |
|
43512 |
|
43513 | }),
|
43514 |
|
43515 | (function(module, exports, __webpack_require__) {
|
43516 |
|
43517 | __webpack_require__(38);
|
43518 | __webpack_require__(55);
|
43519 | var isIterable = __webpack_require__(674);
|
43520 |
|
43521 | module.exports = isIterable;
|
43522 |
|
43523 |
|
43524 | }),
|
43525 |
|
43526 | (function(module, exports, __webpack_require__) {
|
43527 |
|
43528 | var classof = __webpack_require__(51);
|
43529 | var hasOwn = __webpack_require__(13);
|
43530 | var wellKnownSymbol = __webpack_require__(9);
|
43531 | var Iterators = __webpack_require__(50);
|
43532 |
|
43533 | var ITERATOR = wellKnownSymbol('iterator');
|
43534 | var $Object = Object;
|
43535 |
|
43536 | module.exports = function (it) {
|
43537 | var O = $Object(it);
|
43538 | return O[ITERATOR] !== undefined
|
43539 | || '@@iterator' in O
|
43540 | || hasOwn(Iterators, classof(O));
|
43541 | };
|
43542 |
|
43543 |
|
43544 | })
|
43545 | ]);
|
43546 | });
|
43547 |
|
\ | No newline at end of file |