UNPKG

887 kBJavaScriptView Raw
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() {
11return /******/ (function(modules) { // webpackBootstrap
12/******/ // The module cache
13/******/ var installedModules = {};
14/******/
15/******/ // The require function
16/******/ function __webpack_require__(moduleId) {
17/******/
18/******/ // Check if module is in cache
19/******/ if(installedModules[moduleId]) {
20/******/ return installedModules[moduleId].exports;
21/******/ }
22/******/ // Create a new module (and put it into the cache)
23/******/ var module = installedModules[moduleId] = {
24/******/ i: moduleId,
25/******/ l: false,
26/******/ exports: {}
27/******/ };
28/******/
29/******/ // Execute the module function
30/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
31/******/
32/******/ // Flag the module as loaded
33/******/ module.l = true;
34/******/
35/******/ // Return the exports of the module
36/******/ return module.exports;
37/******/ }
38/******/
39/******/
40/******/ // expose the modules object (__webpack_modules__)
41/******/ __webpack_require__.m = modules;
42/******/
43/******/ // expose the module cache
44/******/ __webpack_require__.c = installedModules;
45/******/
46/******/ // define getter function for harmony exports
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/******/ // Object.prototype.hasOwnProperty.call
67/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
68/******/
69/******/ // __webpack_public_path__
70/******/ __webpack_require__.p = "";
71/******/
72/******/ // Load entry module and return exports
73/******/ return __webpack_require__(__webpack_require__.s = 249);
74/******/ })
75/************************************************************************/
76/******/ ([
77/* 0 */
78/***/ (function(module, exports, __webpack_require__) {
79
80"use strict";
81
82var global = __webpack_require__(6);
83var apply = __webpack_require__(69);
84var uncurryThis = __webpack_require__(4);
85var isCallable = __webpack_require__(7);
86var getOwnPropertyDescriptor = __webpack_require__(71).f;
87var isForced = __webpack_require__(149);
88var path = __webpack_require__(10);
89var bind = __webpack_require__(45);
90var createNonEnumerableProperty = __webpack_require__(35);
91var hasOwn = __webpack_require__(14);
92
93var 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 options.target - name of the target object
109 options.global - target is the global object
110 options.stat - export as static methods of target
111 options.proto - export as prototype methods of target
112 options.real - real prototype method for the `pure` version
113 options.forced - export even if the native feature is available
114 options.bind - bind methods to the target, required for the `pure` version
115 options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
116 options.unsafe - use the simple assignment of property instead of delete + defineProperty
117 options.sham - add a flag to not completely full polyfills
118 options.enumerable - export as enumerable property
119 options.dontCallGetSet - prevent calling a getter on target
120 options.name - the .name of the function if it does not match the key
121*/
122module.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 // contains in native
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 // export native or implementation
149 sourceProperty = (USE_NATIVE && nativeProperty) ? nativeProperty : source[key];
150
151 if (USE_NATIVE && typeof targetProperty == typeof sourceProperty) continue;
152
153 // bind timers to global for call from export context
154 if (options.bind && USE_NATIVE) resultProperty = bind(sourceProperty, global);
155 // wrap global constructors for prevent changs in this version
156 else if (options.wrap && USE_NATIVE) resultProperty = wrapConstructor(sourceProperty);
157 // make static versions for prototype methods
158 else if (PROTO && isCallable(sourceProperty)) resultProperty = uncurryThis(sourceProperty);
159 // default case
160 else resultProperty = sourceProperty;
161
162 // add a flag to not completely full polyfills
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 // export virtual prototype methods
175 createNonEnumerableProperty(path[VIRTUAL_PROTOTYPE], key, sourceProperty);
176 // export real prototype methods
177 if (options.real && targetPrototype && !targetPrototype[key]) {
178 createNonEnumerableProperty(targetPrototype, key, sourceProperty);
179 }
180 }
181 }
182};
183
184
185/***/ }),
186/* 1 */
187/***/ (function(module, exports) {
188
189function _interopRequireDefault(obj) {
190 return obj && obj.__esModule ? obj : {
191 "default": obj
192 };
193}
194
195module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;
196
197/***/ }),
198/* 2 */
199/***/ (function(module, __webpack_exports__, __webpack_require__) {
200
201"use strict";
202Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
203/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__index_default_js__ = __webpack_require__(290);
204/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return __WEBPACK_IMPORTED_MODULE_0__index_default_js__["a"]; });
205/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__index_js__ = __webpack_require__(126);
206/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "VERSION", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["VERSION"]; });
207/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "restArguments", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["restArguments"]; });
208/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isObject", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isObject"]; });
209/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isNull", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isNull"]; });
210/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isUndefined", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isUndefined"]; });
211/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isBoolean", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isBoolean"]; });
212/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isElement", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isElement"]; });
213/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isString", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isString"]; });
214/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isNumber", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isNumber"]; });
215/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isDate", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isDate"]; });
216/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isRegExp", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isRegExp"]; });
217/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isError", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isError"]; });
218/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isSymbol", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isSymbol"]; });
219/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isArrayBuffer", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isArrayBuffer"]; });
220/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isDataView", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isDataView"]; });
221/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isArray", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isArray"]; });
222/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isFunction", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isFunction"]; });
223/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isArguments", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isArguments"]; });
224/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isFinite", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isFinite"]; });
225/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isNaN", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isNaN"]; });
226/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isTypedArray", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isTypedArray"]; });
227/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isEmpty", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isEmpty"]; });
228/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isMatch", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isMatch"]; });
229/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isEqual", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isEqual"]; });
230/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isMap", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isMap"]; });
231/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isWeakMap", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isWeakMap"]; });
232/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isSet", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isSet"]; });
233/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isWeakSet", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isWeakSet"]; });
234/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "keys", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["keys"]; });
235/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "allKeys", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["allKeys"]; });
236/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "values", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["values"]; });
237/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "pairs", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["pairs"]; });
238/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "invert", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["invert"]; });
239/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "functions", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["functions"]; });
240/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "methods", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["methods"]; });
241/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "extend", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["extend"]; });
242/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "extendOwn", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["extendOwn"]; });
243/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "assign", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["assign"]; });
244/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "defaults", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["defaults"]; });
245/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "create", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["create"]; });
246/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "clone", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["clone"]; });
247/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "tap", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["tap"]; });
248/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "get", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["get"]; });
249/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "has", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["has"]; });
250/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "mapObject", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["mapObject"]; });
251/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "identity", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["identity"]; });
252/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "constant", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["constant"]; });
253/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "noop", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["noop"]; });
254/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "toPath", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["toPath"]; });
255/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "property", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["property"]; });
256/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "propertyOf", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["propertyOf"]; });
257/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "matcher", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["matcher"]; });
258/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "matches", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["matches"]; });
259/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "times", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["times"]; });
260/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "random", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["random"]; });
261/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "now", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["now"]; });
262/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "escape", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["escape"]; });
263/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "unescape", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["unescape"]; });
264/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "templateSettings", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["templateSettings"]; });
265/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "template", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["template"]; });
266/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "result", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["result"]; });
267/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "uniqueId", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["uniqueId"]; });
268/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "chain", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["chain"]; });
269/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "iteratee", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["iteratee"]; });
270/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "partial", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["partial"]; });
271/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "bind", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["bind"]; });
272/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "bindAll", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["bindAll"]; });
273/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "memoize", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["memoize"]; });
274/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "delay", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["delay"]; });
275/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "defer", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["defer"]; });
276/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "throttle", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["throttle"]; });
277/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "debounce", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["debounce"]; });
278/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "wrap", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["wrap"]; });
279/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "negate", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["negate"]; });
280/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "compose", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["compose"]; });
281/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "after", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["after"]; });
282/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "before", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["before"]; });
283/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "once", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["once"]; });
284/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "findKey", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["findKey"]; });
285/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "findIndex", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["findIndex"]; });
286/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "findLastIndex", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["findLastIndex"]; });
287/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "sortedIndex", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["sortedIndex"]; });
288/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "indexOf", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["indexOf"]; });
289/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "lastIndexOf", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["lastIndexOf"]; });
290/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "find", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["find"]; });
291/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "detect", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["detect"]; });
292/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "findWhere", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["findWhere"]; });
293/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "each", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["each"]; });
294/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "forEach", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["forEach"]; });
295/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "map", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["map"]; });
296/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "collect", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["collect"]; });
297/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "reduce", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["reduce"]; });
298/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "foldl", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["foldl"]; });
299/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "inject", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["inject"]; });
300/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "reduceRight", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["reduceRight"]; });
301/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "foldr", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["foldr"]; });
302/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "filter", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["filter"]; });
303/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "select", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["select"]; });
304/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "reject", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["reject"]; });
305/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "every", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["every"]; });
306/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "all", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["all"]; });
307/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "some", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["some"]; });
308/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "any", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["any"]; });
309/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "contains", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["contains"]; });
310/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "includes", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["includes"]; });
311/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "include", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["include"]; });
312/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "invoke", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["invoke"]; });
313/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "pluck", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["pluck"]; });
314/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "where", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["where"]; });
315/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "max", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["max"]; });
316/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "min", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["min"]; });
317/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "shuffle", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["shuffle"]; });
318/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "sample", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["sample"]; });
319/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "sortBy", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["sortBy"]; });
320/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "groupBy", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["groupBy"]; });
321/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "indexBy", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["indexBy"]; });
322/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "countBy", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["countBy"]; });
323/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "partition", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["partition"]; });
324/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "toArray", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["toArray"]; });
325/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "size", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["size"]; });
326/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "pick", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["pick"]; });
327/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "omit", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["omit"]; });
328/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "first", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["first"]; });
329/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "head", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["head"]; });
330/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "take", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["take"]; });
331/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "initial", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["initial"]; });
332/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "last", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["last"]; });
333/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "rest", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["rest"]; });
334/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "tail", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["tail"]; });
335/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "drop", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["drop"]; });
336/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "compact", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["compact"]; });
337/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "flatten", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["flatten"]; });
338/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "without", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["without"]; });
339/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "uniq", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["uniq"]; });
340/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "unique", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["unique"]; });
341/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "union", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["union"]; });
342/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "intersection", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["intersection"]; });
343/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "difference", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["difference"]; });
344/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "unzip", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["unzip"]; });
345/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "transpose", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["transpose"]; });
346/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "zip", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["zip"]; });
347/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "object", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["object"]; });
348/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "range", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["range"]; });
349/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "chunk", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["chunk"]; });
350/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "mixin", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["mixin"]; });
351// ESM Exports
352// ===========
353// This module is the package entry point for ES module users. In other words,
354// it is the module they are interfacing with when they import from the whole
355// package instead of from a submodule, like this:
356//
357// ```js
358// import { map } from 'underscore';
359// ```
360//
361// The difference with `./index-default`, which is the package entry point for
362// CommonJS, AMD and UMD users, is purely technical. In ES modules, named and
363// default exports are considered to be siblings, so when you have a default
364// export, its properties are not automatically available as named exports. For
365// this reason, we re-export the named exports in addition to providing the same
366// default export as in `./index-default`.
367
368
369
370
371/***/ }),
372/* 3 */
373/***/ (function(module, exports) {
374
375module.exports = function (exec) {
376 try {
377 return !!exec();
378 } catch (error) {
379 return true;
380 }
381};
382
383
384/***/ }),
385/* 4 */
386/***/ (function(module, exports, __webpack_require__) {
387
388var NATIVE_BIND = __webpack_require__(70);
389
390var FunctionPrototype = Function.prototype;
391var bind = FunctionPrototype.bind;
392var call = FunctionPrototype.call;
393var uncurryThis = NATIVE_BIND && bind.bind(call, call);
394
395module.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/* 5 */
406/***/ (function(module, __webpack_exports__, __webpack_require__) {
407
408"use strict";
409/* WEBPACK VAR INJECTION */(function(global) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return VERSION; });
410/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "p", function() { return root; });
411/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ArrayProto; });
412/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return ObjProto; });
413/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return SymbolProto; });
414/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "o", function() { return push; });
415/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "q", function() { return slice; });
416/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "t", function() { return toString; });
417/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return hasOwnProperty; });
418/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "r", function() { return supportsArrayBuffer; });
419/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "s", function() { return supportsDataView; });
420/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "k", function() { return nativeIsArray; });
421/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "m", function() { return nativeKeys; });
422/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "j", function() { return nativeCreate; });
423/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "l", function() { return nativeIsView; });
424/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return _isNaN; });
425/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return _isFinite; });
426/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return hasEnumBug; });
427/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "n", function() { return nonEnumerableProps; });
428/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return MAX_ARRAY_INDEX; });
429// Current version.
430var VERSION = '1.12.1';
431
432// Establish the root object, `window` (`self`) in the browser, `global`
433// on the server, or `this` in some virtual machines. We use `self`
434// instead of `window` for `WebWorker` support.
435var root = typeof self == 'object' && self.self === self && self ||
436 typeof global == 'object' && global.global === global && global ||
437 Function('return this')() ||
438 {};
439
440// Save bytes in the minified (but not gzipped) version:
441var ArrayProto = Array.prototype, ObjProto = Object.prototype;
442var SymbolProto = typeof Symbol !== 'undefined' ? Symbol.prototype : null;
443
444// Create quick reference variables for speed access to core prototypes.
445var push = ArrayProto.push,
446 slice = ArrayProto.slice,
447 toString = ObjProto.toString,
448 hasOwnProperty = ObjProto.hasOwnProperty;
449
450// Modern feature detection.
451var supportsArrayBuffer = typeof ArrayBuffer !== 'undefined',
452 supportsDataView = typeof DataView !== 'undefined';
453
454// All **ECMAScript 5+** native function implementations that we hope to use
455// are declared here.
456var nativeIsArray = Array.isArray,
457 nativeKeys = Object.keys,
458 nativeCreate = Object.create,
459 nativeIsView = supportsArrayBuffer && ArrayBuffer.isView;
460
461// Create references to these builtin functions because we override them.
462var _isNaN = isNaN,
463 _isFinite = isFinite;
464
465// Keys in IE < 9 that won't be iterated by `for key in ...` and thus missed.
466var hasEnumBug = !{toString: null}.propertyIsEnumerable('toString');
467var nonEnumerableProps = ['valueOf', 'isPrototypeOf', 'toString',
468 'propertyIsEnumerable', 'hasOwnProperty', 'toLocaleString'];
469
470// The largest integer that can be represented exactly.
471var MAX_ARRAY_INDEX = Math.pow(2, 53) - 1;
472
473/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(112)))
474
475/***/ }),
476/* 6 */
477/***/ (function(module, exports, __webpack_require__) {
478
479/* WEBPACK VAR INJECTION */(function(global) {var check = function (it) {
480 return it && it.Math == Math && it;
481};
482
483// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
484module.exports =
485 // eslint-disable-next-line es-x/no-global-this -- safe
486 check(typeof globalThis == 'object' && globalThis) ||
487 check(typeof window == 'object' && window) ||
488 // eslint-disable-next-line no-restricted-globals -- safe
489 check(typeof self == 'object' && self) ||
490 check(typeof global == 'object' && global) ||
491 // eslint-disable-next-line no-new-func -- fallback
492 (function () { return this; })() || Function('return this')();
493
494/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(112)))
495
496/***/ }),
497/* 7 */
498/***/ (function(module, exports) {
499
500// `IsCallable` abstract operation
501// https://tc39.es/ecma262/#sec-iscallable
502module.exports = function (argument) {
503 return typeof argument == 'function';
504};
505
506
507/***/ }),
508/* 8 */
509/***/ (function(module, exports, __webpack_require__) {
510
511var path = __webpack_require__(10);
512var hasOwn = __webpack_require__(14);
513var wrappedWellKnownSymbolModule = __webpack_require__(144);
514var defineProperty = __webpack_require__(22).f;
515
516module.exports = function (NAME) {
517 var Symbol = path.Symbol || (path.Symbol = {});
518 if (!hasOwn(Symbol, NAME)) defineProperty(Symbol, NAME, {
519 value: wrappedWellKnownSymbolModule.f(NAME)
520 });
521};
522
523
524/***/ }),
525/* 9 */
526/***/ (function(module, exports, __webpack_require__) {
527
528var global = __webpack_require__(6);
529var shared = __webpack_require__(73);
530var hasOwn = __webpack_require__(14);
531var uid = __webpack_require__(92);
532var NATIVE_SYMBOL = __webpack_require__(57);
533var USE_SYMBOL_AS_UID = __webpack_require__(147);
534
535var WellKnownSymbolsStore = shared('wks');
536var Symbol = global.Symbol;
537var symbolFor = Symbol && Symbol['for'];
538var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol : Symbol && Symbol.withoutSetter || uid;
539
540module.exports = function (name) {
541 if (!hasOwn(WellKnownSymbolsStore, name) || !(NATIVE_SYMBOL || typeof WellKnownSymbolsStore[name] == 'string')) {
542 var description = 'Symbol.' + name;
543 if (NATIVE_SYMBOL && hasOwn(Symbol, name)) {
544 WellKnownSymbolsStore[name] = Symbol[name];
545 } else if (USE_SYMBOL_AS_UID && symbolFor) {
546 WellKnownSymbolsStore[name] = symbolFor(description);
547 } else {
548 WellKnownSymbolsStore[name] = createWellKnownSymbol(description);
549 }
550 } return WellKnownSymbolsStore[name];
551};
552
553
554/***/ }),
555/* 10 */
556/***/ (function(module, exports) {
557
558module.exports = {};
559
560
561/***/ }),
562/* 11 */
563/***/ (function(module, exports, __webpack_require__) {
564
565var isCallable = __webpack_require__(7);
566
567module.exports = function (it) {
568 return typeof it == 'object' ? it !== null : isCallable(it);
569};
570
571
572/***/ }),
573/* 12 */
574/***/ (function(module, exports, __webpack_require__) {
575
576module.exports = __webpack_require__(252);
577
578/***/ }),
579/* 13 */
580/***/ (function(module, exports, __webpack_require__) {
581
582var NATIVE_BIND = __webpack_require__(70);
583
584var call = Function.prototype.call;
585
586module.exports = NATIVE_BIND ? call.bind(call) : function () {
587 return call.apply(call, arguments);
588};
589
590
591/***/ }),
592/* 14 */
593/***/ (function(module, exports, __webpack_require__) {
594
595var uncurryThis = __webpack_require__(4);
596var toObject = __webpack_require__(34);
597
598var hasOwnProperty = uncurryThis({}.hasOwnProperty);
599
600// `HasOwnProperty` abstract operation
601// https://tc39.es/ecma262/#sec-hasownproperty
602// eslint-disable-next-line es-x/no-object-hasown -- safe
603module.exports = Object.hasOwn || function hasOwn(it, key) {
604 return hasOwnProperty(toObject(it), key);
605};
606
607
608/***/ }),
609/* 15 */
610/***/ (function(module, __webpack_exports__, __webpack_require__) {
611
612"use strict";
613/* harmony export (immutable) */ __webpack_exports__["a"] = keys;
614/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isObject_js__ = __webpack_require__(52);
615/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__setup_js__ = __webpack_require__(5);
616/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__has_js__ = __webpack_require__(40);
617/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__collectNonEnumProps_js__ = __webpack_require__(180);
618
619
620
621
622
623// Retrieve the names of an object's own properties.
624// Delegates to **ECMAScript 5**'s native `Object.keys`.
625function keys(obj) {
626 if (!Object(__WEBPACK_IMPORTED_MODULE_0__isObject_js__["a" /* default */])(obj)) return [];
627 if (__WEBPACK_IMPORTED_MODULE_1__setup_js__["m" /* nativeKeys */]) return Object(__WEBPACK_IMPORTED_MODULE_1__setup_js__["m" /* nativeKeys */])(obj);
628 var keys = [];
629 for (var key in obj) if (Object(__WEBPACK_IMPORTED_MODULE_2__has_js__["a" /* default */])(obj, key)) keys.push(key);
630 // Ahem, IE < 9.
631 if (__WEBPACK_IMPORTED_MODULE_1__setup_js__["h" /* hasEnumBug */]) Object(__WEBPACK_IMPORTED_MODULE_3__collectNonEnumProps_js__["a" /* default */])(obj, keys);
632 return keys;
633}
634
635
636/***/ }),
637/* 16 */
638/***/ (function(module, exports, __webpack_require__) {
639
640var fails = __webpack_require__(3);
641
642// Detect IE8's incomplete defineProperty implementation
643module.exports = !fails(function () {
644 // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
645 return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
646});
647
648
649/***/ }),
650/* 17 */
651/***/ (function(module, __webpack_exports__, __webpack_require__) {
652
653"use strict";
654/* harmony export (immutable) */ __webpack_exports__["a"] = tagTester;
655/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(5);
656
657
658// Internal function for creating a `toString`-based type tester.
659function tagTester(name) {
660 var tag = '[object ' + name + ']';
661 return function(obj) {
662 return __WEBPACK_IMPORTED_MODULE_0__setup_js__["t" /* toString */].call(obj) === tag;
663 };
664}
665
666
667/***/ }),
668/* 18 */
669/***/ (function(module, exports, __webpack_require__) {
670
671var path = __webpack_require__(10);
672var global = __webpack_require__(6);
673var isCallable = __webpack_require__(7);
674
675var aFunction = function (variable) {
676 return isCallable(variable) ? variable : undefined;
677};
678
679module.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/* 19 */
687/***/ (function(module, exports, __webpack_require__) {
688
689var isObject = __webpack_require__(11);
690
691var $String = String;
692var $TypeError = TypeError;
693
694// `Assert: Type(argument) is Object`
695module.exports = function (argument) {
696 if (isObject(argument)) return argument;
697 throw $TypeError($String(argument) + ' is not an object');
698};
699
700
701/***/ }),
702/* 20 */
703/***/ (function(module, __webpack_exports__, __webpack_require__) {
704
705"use strict";
706/* harmony export (immutable) */ __webpack_exports__["a"] = cb;
707/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__underscore_js__ = __webpack_require__(24);
708/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__baseIteratee_js__ = __webpack_require__(190);
709/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__iteratee_js__ = __webpack_require__(191);
710
711
712
713
714// The function we call internally to generate a callback. It invokes
715// `_.iteratee` if overridden, otherwise `baseIteratee`.
716function cb(value, context, argCount) {
717 if (__WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */].iteratee !== __WEBPACK_IMPORTED_MODULE_2__iteratee_js__["a" /* default */]) return __WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */].iteratee(value, context);
718 return Object(__WEBPACK_IMPORTED_MODULE_1__baseIteratee_js__["a" /* default */])(value, context, argCount);
719}
720
721
722/***/ }),
723/* 21 */
724/***/ (function(module, exports, __webpack_require__) {
725
726var uncurryThis = __webpack_require__(4);
727
728module.exports = uncurryThis({}.isPrototypeOf);
729
730
731/***/ }),
732/* 22 */
733/***/ (function(module, exports, __webpack_require__) {
734
735var DESCRIPTORS = __webpack_require__(16);
736var IE8_DOM_DEFINE = __webpack_require__(148);
737var V8_PROTOTYPE_DEFINE_BUG = __webpack_require__(150);
738var anObject = __webpack_require__(19);
739var toPropertyKey = __webpack_require__(88);
740
741var $TypeError = TypeError;
742// eslint-disable-next-line es-x/no-object-defineproperty -- safe
743var $defineProperty = Object.defineProperty;
744// eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
745var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
746var ENUMERABLE = 'enumerable';
747var CONFIGURABLE = 'configurable';
748var WRITABLE = 'writable';
749
750// `Object.defineProperty` method
751// https://tc39.es/ecma262/#sec-object.defineproperty
752exports.f = DESCRIPTORS ? V8_PROTOTYPE_DEFINE_BUG ? function defineProperty(O, P, Attributes) {
753 anObject(O);
754 P = toPropertyKey(P);
755 anObject(Attributes);
756 if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
757 var current = $getOwnPropertyDescriptor(O, P);
758 if (current && current[WRITABLE]) {
759 O[P] = Attributes.value;
760 Attributes = {
761 configurable: CONFIGURABLE in Attributes ? Attributes[CONFIGURABLE] : current[CONFIGURABLE],
762 enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
763 writable: false
764 };
765 }
766 } return $defineProperty(O, P, Attributes);
767} : $defineProperty : function defineProperty(O, P, Attributes) {
768 anObject(O);
769 P = toPropertyKey(P);
770 anObject(Attributes);
771 if (IE8_DOM_DEFINE) try {
772 return $defineProperty(O, P, Attributes);
773 } catch (error) { /* empty */ }
774 if ('get' in Attributes || 'set' in Attributes) throw $TypeError('Accessors not supported');
775 if ('value' in Attributes) O[P] = Attributes.value;
776 return O;
777};
778
779
780/***/ }),
781/* 23 */
782/***/ (function(module, __webpack_exports__, __webpack_require__) {
783
784"use strict";
785/* harmony export (immutable) */ __webpack_exports__["a"] = restArguments;
786// Some functions take a variable number of arguments, or a few expected
787// arguments at the beginning and then a variable number of values to operate
788// on. This helper accumulates all remaining arguments past the function’s
789// argument length (or an explicit `startIndex`), into an array that becomes
790// the last argument. Similar to ES6’s "rest parameter".
791function restArguments(func, startIndex) {
792 startIndex = startIndex == null ? func.length - 1 : +startIndex;
793 return function() {
794 var length = Math.max(arguments.length - startIndex, 0),
795 rest = Array(length),
796 index = 0;
797 for (; index < length; index++) {
798 rest[index] = arguments[index + startIndex];
799 }
800 switch (startIndex) {
801 case 0: return func.call(this, rest);
802 case 1: return func.call(this, arguments[0], rest);
803 case 2: return func.call(this, arguments[0], arguments[1], rest);
804 }
805 var args = Array(startIndex + 1);
806 for (index = 0; index < startIndex; index++) {
807 args[index] = arguments[index];
808 }
809 args[startIndex] = rest;
810 return func.apply(this, args);
811 };
812}
813
814
815/***/ }),
816/* 24 */
817/***/ (function(module, __webpack_exports__, __webpack_require__) {
818
819"use strict";
820/* harmony export (immutable) */ __webpack_exports__["a"] = _;
821/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(5);
822
823
824// If Underscore is called as a function, it returns a wrapped object that can
825// be used OO-style. This wrapper holds altered versions of all functions added
826// through `_.mixin`. Wrapped objects may be chained.
827function _(obj) {
828 if (obj instanceof _) return obj;
829 if (!(this instanceof _)) return new _(obj);
830 this._wrapped = obj;
831}
832
833_.VERSION = __WEBPACK_IMPORTED_MODULE_0__setup_js__["e" /* VERSION */];
834
835// Extracts the result from a wrapped and chained object.
836_.prototype.value = function() {
837 return this._wrapped;
838};
839
840// Provide unwrapping proxies for some methods used in engine operations
841// such as arithmetic and JSON stringification.
842_.prototype.valueOf = _.prototype.toJSON = _.prototype.value;
843
844_.prototype.toString = function() {
845 return String(this._wrapped);
846};
847
848
849/***/ }),
850/* 25 */
851/***/ (function(module, __webpack_exports__, __webpack_require__) {
852
853"use strict";
854/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createSizePropertyCheck_js__ = __webpack_require__(178);
855/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__getLength_js__ = __webpack_require__(28);
856
857
858
859// Internal helper for collection methods to determine whether a collection
860// should be iterated as an array or as an object.
861// Related: https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength
862// Avoids a very nasty iOS 8 JIT bug on ARM-64. #2094
863/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createSizePropertyCheck_js__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__getLength_js__["a" /* default */]));
864
865
866/***/ }),
867/* 26 */
868/***/ (function(module, exports, __webpack_require__) {
869
870"use strict";
871
872
873var _interopRequireDefault = __webpack_require__(1);
874
875var _concat = _interopRequireDefault(__webpack_require__(30));
876
877var _promise = _interopRequireDefault(__webpack_require__(12));
878
879var _ = __webpack_require__(2);
880
881var md5 = __webpack_require__(502);
882
883var _require = __webpack_require__(2),
884 extend = _require.extend;
885
886var AV = __webpack_require__(65);
887
888var AVError = __webpack_require__(43);
889
890var _require2 = __webpack_require__(29),
891 getSessionToken = _require2.getSessionToken;
892
893var ajax = __webpack_require__(108); // 计算 X-LC-Sign 的签名方法
894
895
896var sign = function sign(key, isMasterKey) {
897 var _context2;
898
899 var now = new Date().getTime();
900 var signature = md5(now + key);
901
902 if (isMasterKey) {
903 var _context;
904
905 return (0, _concat.default)(_context = "".concat(signature, ",")).call(_context, now, ",master");
906 }
907
908 return (0, _concat.default)(_context2 = "".concat(signature, ",")).call(_context2, now);
909};
910
911var setAppKey = function setAppKey(headers, signKey) {
912 if (signKey) {
913 headers['X-LC-Sign'] = sign(AV.applicationKey);
914 } else {
915 headers['X-LC-Key'] = AV.applicationKey;
916 }
917};
918
919var setHeaders = function setHeaders() {
920 var authOptions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
921 var signKey = arguments.length > 1 ? arguments[1] : undefined;
922 var headers = {
923 'X-LC-Id': AV.applicationId,
924 'Content-Type': 'application/json;charset=UTF-8'
925 };
926 var useMasterKey = false;
927
928 if (typeof authOptions.useMasterKey === 'boolean') {
929 useMasterKey = authOptions.useMasterKey;
930 } else if (typeof AV._config.useMasterKey === 'boolean') {
931 useMasterKey = AV._config.useMasterKey;
932 }
933
934 if (useMasterKey) {
935 if (AV.masterKey) {
936 if (signKey) {
937 headers['X-LC-Sign'] = sign(AV.masterKey, true);
938 } else {
939 headers['X-LC-Key'] = "".concat(AV.masterKey, ",master");
940 }
941 } else {
942 console.warn('masterKey is not set, fall back to use appKey');
943 setAppKey(headers, signKey);
944 }
945 } else {
946 setAppKey(headers, signKey);
947 }
948
949 if (AV.hookKey) {
950 headers['X-LC-Hook-Key'] = AV.hookKey;
951 }
952
953 if (AV._config.production !== null) {
954 headers['X-LC-Prod'] = String(AV._config.production);
955 }
956
957 headers[ false ? 'User-Agent' : 'X-LC-UA'] = AV._sharedConfig.userAgent;
958 return _promise.default.resolve().then(function () {
959 // Pass the session token
960 var sessionToken = getSessionToken(authOptions);
961
962 if (sessionToken) {
963 headers['X-LC-Session'] = sessionToken;
964 } else if (!AV._config.disableCurrentUser) {
965 return AV.User.currentAsync().then(function (currentUser) {
966 if (currentUser && currentUser._sessionToken) {
967 headers['X-LC-Session'] = currentUser._sessionToken;
968 }
969
970 return headers;
971 });
972 }
973
974 return headers;
975 });
976};
977
978var createApiUrl = function createApiUrl(_ref) {
979 var _ref$service = _ref.service,
980 service = _ref$service === void 0 ? 'api' : _ref$service,
981 _ref$version = _ref.version,
982 version = _ref$version === void 0 ? '1.1' : _ref$version,
983 path = _ref.path;
984 var apiURL = AV._config.serverURLs[service];
985 if (!apiURL) throw new Error("undefined server URL for ".concat(service));
986
987 if (apiURL.charAt(apiURL.length - 1) !== '/') {
988 apiURL += '/';
989 }
990
991 apiURL += version;
992
993 if (path) {
994 apiURL += path;
995 }
996
997 return apiURL;
998};
999/**
1000 * Low level REST API client. Call REST endpoints with authorization headers.
1001 * @function AV.request
1002 * @since 3.0.0
1003 * @param {Object} options
1004 * @param {String} options.method HTTP method
1005 * @param {String} options.path endpoint path, e.g. `/classes/Test/55759577e4b029ae6015ac20`
1006 * @param {Object} [options.query] query string dict
1007 * @param {Object} [options.data] HTTP body
1008 * @param {AuthOptions} [options.authOptions]
1009 * @param {String} [options.service = 'api']
1010 * @param {String} [options.version = '1.1']
1011 */
1012
1013
1014var request = function request(_ref2) {
1015 var service = _ref2.service,
1016 version = _ref2.version,
1017 method = _ref2.method,
1018 path = _ref2.path,
1019 query = _ref2.query,
1020 data = _ref2.data,
1021 authOptions = _ref2.authOptions,
1022 _ref2$signKey = _ref2.signKey,
1023 signKey = _ref2$signKey === void 0 ? true : _ref2$signKey;
1024
1025 if (!(AV.applicationId && (AV.applicationKey || AV.masterKey))) {
1026 throw new Error('Not initialized');
1027 }
1028
1029 if (AV._appRouter) {
1030 AV._appRouter.refresh();
1031 }
1032
1033 var timeout = AV._config.requestTimeout;
1034 var url = createApiUrl({
1035 service: service,
1036 path: path,
1037 version: version
1038 });
1039 return setHeaders(authOptions, signKey).then(function (headers) {
1040 return ajax({
1041 method: method,
1042 url: url,
1043 query: query,
1044 data: data,
1045 headers: headers,
1046 timeout: timeout
1047 }).catch(function (error) {
1048 var errorJSON = {
1049 code: error.code || -1,
1050 error: error.message || error.responseText
1051 };
1052
1053 if (error.response && error.response.code) {
1054 errorJSON = error.response;
1055 } else if (error.responseText) {
1056 try {
1057 errorJSON = JSON.parse(error.responseText);
1058 } catch (e) {// If we fail to parse the error text, that's okay.
1059 }
1060 }
1061
1062 errorJSON.rawMessage = errorJSON.rawMessage || errorJSON.error;
1063
1064 if (!AV._sharedConfig.keepErrorRawMessage) {
1065 var _context3, _context4;
1066
1067 errorJSON.error += (0, _concat.default)(_context3 = (0, _concat.default)(_context4 = " [".concat(error.statusCode || 'N/A', " ")).call(_context4, method, " ")).call(_context3, url, "]");
1068 } // Transform the error into an instance of AVError by trying to parse
1069 // the error string as JSON.
1070
1071
1072 var err = new AVError(errorJSON.code, errorJSON.error);
1073 delete errorJSON.error;
1074 throw _.extend(err, errorJSON);
1075 });
1076 });
1077}; // lagecy request
1078
1079
1080var _request = function _request(route, className, objectId, method, data, authOptions, query) {
1081 var path = '';
1082 if (route) path += "/".concat(route);
1083 if (className) path += "/".concat(className);
1084 if (objectId) path += "/".concat(objectId); // for migeration
1085
1086 if (data && data._fetchWhenSave) throw new Error('_fetchWhenSave should be in the query');
1087 if (data && data._where) throw new Error('_where should be in the query');
1088
1089 if (method && method.toLowerCase() === 'get') {
1090 query = extend({}, query, data);
1091 data = null;
1092 }
1093
1094 return request({
1095 method: method,
1096 path: path,
1097 query: query,
1098 data: data,
1099 authOptions: authOptions
1100 });
1101};
1102
1103AV.request = request;
1104module.exports = {
1105 _request: _request,
1106 request: request
1107};
1108
1109/***/ }),
1110/* 27 */
1111/***/ (function(module, __webpack_exports__, __webpack_require__) {
1112
1113"use strict";
1114/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(17);
1115/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__setup_js__ = __webpack_require__(5);
1116
1117
1118
1119var isFunction = Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" /* default */])('Function');
1120
1121// Optimize `isFunction` if appropriate. Work around some `typeof` bugs in old
1122// v8, IE 11 (#1621), Safari 8 (#1929), and PhantomJS (#2236).
1123var nodelist = __WEBPACK_IMPORTED_MODULE_1__setup_js__["p" /* root */].document && __WEBPACK_IMPORTED_MODULE_1__setup_js__["p" /* root */].document.childNodes;
1124if (typeof /./ != 'function' && typeof Int8Array != 'object' && typeof nodelist != 'function') {
1125 isFunction = function(obj) {
1126 return typeof obj == 'function' || false;
1127 };
1128}
1129
1130/* harmony default export */ __webpack_exports__["a"] = (isFunction);
1131
1132
1133/***/ }),
1134/* 28 */
1135/***/ (function(module, __webpack_exports__, __webpack_require__) {
1136
1137"use strict";
1138/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__shallowProperty_js__ = __webpack_require__(179);
1139
1140
1141// Internal helper to obtain the `length` property of an object.
1142/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__shallowProperty_js__["a" /* default */])('length'));
1143
1144
1145/***/ }),
1146/* 29 */
1147/***/ (function(module, exports, __webpack_require__) {
1148
1149"use strict";
1150
1151
1152var _interopRequireDefault = __webpack_require__(1);
1153
1154var _keys = _interopRequireDefault(__webpack_require__(55));
1155
1156var _getPrototypeOf = _interopRequireDefault(__webpack_require__(142));
1157
1158var _promise = _interopRequireDefault(__webpack_require__(12));
1159
1160var _ = __webpack_require__(2); // Helper function to check null or undefined.
1161
1162
1163var isNullOrUndefined = function isNullOrUndefined(x) {
1164 return _.isNull(x) || _.isUndefined(x);
1165};
1166
1167var ensureArray = function ensureArray(target) {
1168 if (_.isArray(target)) {
1169 return target;
1170 }
1171
1172 if (target === undefined || target === null) {
1173 return [];
1174 }
1175
1176 return [target];
1177};
1178
1179var transformFetchOptions = function transformFetchOptions() {
1180 var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
1181 keys = (0, _keys.default)(_ref),
1182 include = _ref.include,
1183 includeACL = _ref.includeACL;
1184
1185 var fetchOptions = {};
1186
1187 if (keys) {
1188 fetchOptions.keys = ensureArray(keys).join(',');
1189 }
1190
1191 if (include) {
1192 fetchOptions.include = ensureArray(include).join(',');
1193 }
1194
1195 if (includeACL) {
1196 fetchOptions.returnACL = includeACL;
1197 }
1198
1199 return fetchOptions;
1200};
1201
1202var getSessionToken = function getSessionToken(authOptions) {
1203 if (authOptions.sessionToken) {
1204 return authOptions.sessionToken;
1205 }
1206
1207 if (authOptions.user && typeof authOptions.user.getSessionToken === 'function') {
1208 return authOptions.user.getSessionToken();
1209 }
1210};
1211
1212var tap = function tap(interceptor) {
1213 return function (value) {
1214 return interceptor(value), value;
1215 };
1216}; // Shared empty constructor function to aid in prototype-chain creation.
1217
1218
1219var EmptyConstructor = function EmptyConstructor() {}; // Helper function to correctly set up the prototype chain, for subclasses.
1220// Similar to `goog.inherits`, but uses a hash of prototype properties and
1221// class properties to be extended.
1222
1223
1224var inherits = function inherits(parent, protoProps, staticProps) {
1225 var child; // The constructor function for the new subclass is either defined by you
1226 // (the "constructor" property in your `extend` definition), or defaulted
1227 // by us to simply call the parent's constructor.
1228
1229 if (protoProps && protoProps.hasOwnProperty('constructor')) {
1230 child = protoProps.constructor;
1231 } else {
1232 /** @ignore */
1233 child = function child() {
1234 parent.apply(this, arguments);
1235 };
1236 } // Inherit class (static) properties from parent.
1237
1238
1239 _.extend(child, parent); // Set the prototype chain to inherit from `parent`, without calling
1240 // `parent`'s constructor function.
1241
1242
1243 EmptyConstructor.prototype = parent.prototype;
1244 child.prototype = new EmptyConstructor(); // Add prototype properties (instance properties) to the subclass,
1245 // if supplied.
1246
1247 if (protoProps) {
1248 _.extend(child.prototype, protoProps);
1249 } // Add static properties to the constructor function, if supplied.
1250
1251
1252 if (staticProps) {
1253 _.extend(child, staticProps);
1254 } // Correctly set child's `prototype.constructor`.
1255
1256
1257 child.prototype.constructor = child; // Set a convenience property in case the parent's prototype is
1258 // needed later.
1259
1260 child.__super__ = parent.prototype;
1261 return child;
1262}; // Suppress the date string format warning in Weixin DevTools
1263// Link: https://developers.weixin.qq.com/community/minihome/doc/00080c6f244718053550067736b401
1264
1265
1266var parseDate = typeof wx === 'undefined' ? function (iso8601) {
1267 return new Date(iso8601);
1268} : function (iso8601) {
1269 return new Date(Date.parse(iso8601));
1270};
1271
1272var setValue = function setValue(target, key, value) {
1273 // '.' is not allowed in Class keys, escaping is not in concern now.
1274 var segs = key.split('.');
1275 var lastSeg = segs.pop();
1276 var currentTarget = target;
1277 segs.forEach(function (seg) {
1278 if (currentTarget[seg] === undefined) currentTarget[seg] = {};
1279 currentTarget = currentTarget[seg];
1280 });
1281 currentTarget[lastSeg] = value;
1282 return target;
1283};
1284
1285var findValue = function findValue(target, key) {
1286 var segs = key.split('.');
1287 var firstSeg = segs[0];
1288 var lastSeg = segs.pop();
1289 var currentTarget = target;
1290
1291 for (var i = 0; i < segs.length; i++) {
1292 currentTarget = currentTarget[segs[i]];
1293
1294 if (currentTarget === undefined) {
1295 return [undefined, undefined, lastSeg];
1296 }
1297 }
1298
1299 var value = currentTarget[lastSeg];
1300 return [value, currentTarget, lastSeg, firstSeg];
1301};
1302
1303var isPlainObject = function isPlainObject(obj) {
1304 return _.isObject(obj) && (0, _getPrototypeOf.default)(obj) === Object.prototype;
1305};
1306
1307var continueWhile = function continueWhile(predicate, asyncFunction) {
1308 if (predicate()) {
1309 return asyncFunction().then(function () {
1310 return continueWhile(predicate, asyncFunction);
1311 });
1312 }
1313
1314 return _promise.default.resolve();
1315};
1316
1317module.exports = {
1318 isNullOrUndefined: isNullOrUndefined,
1319 ensureArray: ensureArray,
1320 transformFetchOptions: transformFetchOptions,
1321 getSessionToken: getSessionToken,
1322 tap: tap,
1323 inherits: inherits,
1324 parseDate: parseDate,
1325 setValue: setValue,
1326 findValue: findValue,
1327 isPlainObject: isPlainObject,
1328 continueWhile: continueWhile
1329};
1330
1331/***/ }),
1332/* 30 */
1333/***/ (function(module, exports, __webpack_require__) {
1334
1335module.exports = __webpack_require__(362);
1336
1337/***/ }),
1338/* 31 */
1339/***/ (function(module, exports, __webpack_require__) {
1340
1341var isCallable = __webpack_require__(7);
1342var tryToString = __webpack_require__(72);
1343
1344var $TypeError = TypeError;
1345
1346// `Assert: IsCallable(argument) is true`
1347module.exports = function (argument) {
1348 if (isCallable(argument)) return argument;
1349 throw $TypeError(tryToString(argument) + ' is not a function');
1350};
1351
1352
1353/***/ }),
1354/* 32 */
1355/***/ (function(module, exports) {
1356
1357module.exports = true;
1358
1359
1360/***/ }),
1361/* 33 */
1362/***/ (function(module, exports, __webpack_require__) {
1363
1364// toObject with fallback for non-array-like ES3 strings
1365var IndexedObject = __webpack_require__(114);
1366var requireObjectCoercible = __webpack_require__(115);
1367
1368module.exports = function (it) {
1369 return IndexedObject(requireObjectCoercible(it));
1370};
1371
1372
1373/***/ }),
1374/* 34 */
1375/***/ (function(module, exports, __webpack_require__) {
1376
1377var requireObjectCoercible = __webpack_require__(115);
1378
1379var $Object = Object;
1380
1381// `ToObject` abstract operation
1382// https://tc39.es/ecma262/#sec-toobject
1383module.exports = function (argument) {
1384 return $Object(requireObjectCoercible(argument));
1385};
1386
1387
1388/***/ }),
1389/* 35 */
1390/***/ (function(module, exports, __webpack_require__) {
1391
1392var DESCRIPTORS = __webpack_require__(16);
1393var definePropertyModule = __webpack_require__(22);
1394var createPropertyDescriptor = __webpack_require__(44);
1395
1396module.exports = DESCRIPTORS ? function (object, key, value) {
1397 return definePropertyModule.f(object, key, createPropertyDescriptor(1, value));
1398} : function (object, key, value) {
1399 object[key] = value;
1400 return object;
1401};
1402
1403
1404/***/ }),
1405/* 36 */
1406/***/ (function(module, exports, __webpack_require__) {
1407
1408module.exports = __webpack_require__(374);
1409
1410/***/ }),
1411/* 37 */
1412/***/ (function(module, exports, __webpack_require__) {
1413
1414var bind = __webpack_require__(45);
1415var call = __webpack_require__(13);
1416var anObject = __webpack_require__(19);
1417var tryToString = __webpack_require__(72);
1418var isArrayIteratorMethod = __webpack_require__(156);
1419var lengthOfArrayLike = __webpack_require__(46);
1420var isPrototypeOf = __webpack_require__(21);
1421var getIterator = __webpack_require__(157);
1422var getIteratorMethod = __webpack_require__(99);
1423var iteratorClose = __webpack_require__(158);
1424
1425var $TypeError = TypeError;
1426
1427var Result = function (stopped, result) {
1428 this.stopped = stopped;
1429 this.result = result;
1430};
1431
1432var ResultPrototype = Result.prototype;
1433
1434module.exports = function (iterable, unboundFunction, options) {
1435 var that = options && options.that;
1436 var AS_ENTRIES = !!(options && options.AS_ENTRIES);
1437 var IS_ITERATOR = !!(options && options.IS_ITERATOR);
1438 var INTERRUPTED = !!(options && options.INTERRUPTED);
1439 var fn = bind(unboundFunction, that);
1440 var iterator, iterFn, index, length, result, next, step;
1441
1442 var stop = function (condition) {
1443 if (iterator) iteratorClose(iterator, 'normal', condition);
1444 return new Result(true, condition);
1445 };
1446
1447 var callFn = function (value) {
1448 if (AS_ENTRIES) {
1449 anObject(value);
1450 return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);
1451 } return INTERRUPTED ? fn(value, stop) : fn(value);
1452 };
1453
1454 if (IS_ITERATOR) {
1455 iterator = iterable;
1456 } else {
1457 iterFn = getIteratorMethod(iterable);
1458 if (!iterFn) throw $TypeError(tryToString(iterable) + ' is not iterable');
1459 // optimisation for array iterators
1460 if (isArrayIteratorMethod(iterFn)) {
1461 for (index = 0, length = lengthOfArrayLike(iterable); length > index; index++) {
1462 result = callFn(iterable[index]);
1463 if (result && isPrototypeOf(ResultPrototype, result)) return result;
1464 } return new Result(false);
1465 }
1466 iterator = getIterator(iterable, iterFn);
1467 }
1468
1469 next = iterator.next;
1470 while (!(step = call(next, iterator)).done) {
1471 try {
1472 result = callFn(step.value);
1473 } catch (error) {
1474 iteratorClose(iterator, 'throw', error);
1475 }
1476 if (typeof result == 'object' && result && isPrototypeOf(ResultPrototype, result)) return result;
1477 } return new Result(false);
1478};
1479
1480
1481/***/ }),
1482/* 38 */
1483/***/ (function(module, exports, __webpack_require__) {
1484
1485var NATIVE_WEAK_MAP = __webpack_require__(160);
1486var global = __webpack_require__(6);
1487var uncurryThis = __webpack_require__(4);
1488var isObject = __webpack_require__(11);
1489var createNonEnumerableProperty = __webpack_require__(35);
1490var hasOwn = __webpack_require__(14);
1491var shared = __webpack_require__(117);
1492var sharedKey = __webpack_require__(94);
1493var hiddenKeys = __webpack_require__(74);
1494
1495var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
1496var TypeError = global.TypeError;
1497var WeakMap = global.WeakMap;
1498var set, get, has;
1499
1500var enforce = function (it) {
1501 return has(it) ? get(it) : set(it, {});
1502};
1503
1504var getterFor = function (TYPE) {
1505 return function (it) {
1506 var state;
1507 if (!isObject(it) || (state = get(it)).type !== TYPE) {
1508 throw TypeError('Incompatible receiver, ' + TYPE + ' required');
1509 } return state;
1510 };
1511};
1512
1513if (NATIVE_WEAK_MAP || shared.state) {
1514 var store = shared.state || (shared.state = new WeakMap());
1515 var wmget = uncurryThis(store.get);
1516 var wmhas = uncurryThis(store.has);
1517 var wmset = uncurryThis(store.set);
1518 set = function (it, metadata) {
1519 if (wmhas(store, it)) throw new TypeError(OBJECT_ALREADY_INITIALIZED);
1520 metadata.facade = it;
1521 wmset(store, it, metadata);
1522 return metadata;
1523 };
1524 get = function (it) {
1525 return wmget(store, it) || {};
1526 };
1527 has = function (it) {
1528 return wmhas(store, it);
1529 };
1530} else {
1531 var STATE = sharedKey('state');
1532 hiddenKeys[STATE] = true;
1533 set = function (it, metadata) {
1534 if (hasOwn(it, STATE)) throw new TypeError(OBJECT_ALREADY_INITIALIZED);
1535 metadata.facade = it;
1536 createNonEnumerableProperty(it, STATE, metadata);
1537 return metadata;
1538 };
1539 get = function (it) {
1540 return hasOwn(it, STATE) ? it[STATE] : {};
1541 };
1542 has = function (it) {
1543 return hasOwn(it, STATE);
1544 };
1545}
1546
1547module.exports = {
1548 set: set,
1549 get: get,
1550 has: has,
1551 enforce: enforce,
1552 getterFor: getterFor
1553};
1554
1555
1556/***/ }),
1557/* 39 */
1558/***/ (function(module, exports, __webpack_require__) {
1559
1560var createNonEnumerableProperty = __webpack_require__(35);
1561
1562module.exports = function (target, key, value, options) {
1563 if (options && options.enumerable) target[key] = value;
1564 else createNonEnumerableProperty(target, key, value);
1565 return target;
1566};
1567
1568
1569/***/ }),
1570/* 40 */
1571/***/ (function(module, __webpack_exports__, __webpack_require__) {
1572
1573"use strict";
1574/* harmony export (immutable) */ __webpack_exports__["a"] = has;
1575/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(5);
1576
1577
1578// Internal function to check whether `key` is an own property name of `obj`.
1579function has(obj, key) {
1580 return obj != null && __WEBPACK_IMPORTED_MODULE_0__setup_js__["i" /* hasOwnProperty */].call(obj, key);
1581}
1582
1583
1584/***/ }),
1585/* 41 */
1586/***/ (function(module, exports, __webpack_require__) {
1587
1588var path = __webpack_require__(10);
1589
1590module.exports = function (CONSTRUCTOR) {
1591 return path[CONSTRUCTOR + 'Prototype'];
1592};
1593
1594
1595/***/ }),
1596/* 42 */
1597/***/ (function(module, exports, __webpack_require__) {
1598
1599module.exports = __webpack_require__(367);
1600
1601/***/ }),
1602/* 43 */
1603/***/ (function(module, exports, __webpack_require__) {
1604
1605"use strict";
1606
1607
1608var _interopRequireDefault = __webpack_require__(1);
1609
1610var _setPrototypeOf = _interopRequireDefault(__webpack_require__(227));
1611
1612var _getPrototypeOf = _interopRequireDefault(__webpack_require__(142));
1613
1614var _ = __webpack_require__(2);
1615/**
1616 * @class AV.Error
1617 */
1618
1619
1620function AVError(code, message) {
1621 if (this instanceof AVError ? this.constructor : void 0) {
1622 var error = new Error(message);
1623 (0, _setPrototypeOf.default)(error, (0, _getPrototypeOf.default)(this));
1624 error.code = code;
1625 return error;
1626 }
1627
1628 return new AVError(code, message);
1629}
1630
1631AVError.prototype = Object.create(Error.prototype, {
1632 constructor: {
1633 value: Error,
1634 enumerable: false,
1635 writable: true,
1636 configurable: true
1637 }
1638});
1639(0, _setPrototypeOf.default)(AVError, Error);
1640
1641_.extend(AVError,
1642/** @lends AV.Error */
1643{
1644 /**
1645 * Error code indicating some error other than those enumerated here.
1646 * @constant
1647 */
1648 OTHER_CAUSE: -1,
1649
1650 /**
1651 * Error code indicating that something has gone wrong with the server.
1652 * If you get this error code, it is AV's fault.
1653 * @constant
1654 */
1655 INTERNAL_SERVER_ERROR: 1,
1656
1657 /**
1658 * Error code indicating the connection to the AV servers failed.
1659 * @constant
1660 */
1661 CONNECTION_FAILED: 100,
1662
1663 /**
1664 * Error code indicating the specified object doesn't exist.
1665 * @constant
1666 */
1667 OBJECT_NOT_FOUND: 101,
1668
1669 /**
1670 * Error code indicating you tried to query with a datatype that doesn't
1671 * support it, like exact matching an array or object.
1672 * @constant
1673 */
1674 INVALID_QUERY: 102,
1675
1676 /**
1677 * Error code indicating a missing or invalid classname. Classnames are
1678 * case-sensitive. They must start with a letter, and a-zA-Z0-9_ are the
1679 * only valid characters.
1680 * @constant
1681 */
1682 INVALID_CLASS_NAME: 103,
1683
1684 /**
1685 * Error code indicating an unspecified object id.
1686 * @constant
1687 */
1688 MISSING_OBJECT_ID: 104,
1689
1690 /**
1691 * Error code indicating an invalid key name. Keys are case-sensitive. They
1692 * must start with a letter, and a-zA-Z0-9_ are the only valid characters.
1693 * @constant
1694 */
1695 INVALID_KEY_NAME: 105,
1696
1697 /**
1698 * Error code indicating a malformed pointer. You should not see this unless
1699 * you have been mucking about changing internal AV code.
1700 * @constant
1701 */
1702 INVALID_POINTER: 106,
1703
1704 /**
1705 * Error code indicating that badly formed JSON was received upstream. This
1706 * either indicates you have done something unusual with modifying how
1707 * things encode to JSON, or the network is failing badly.
1708 * @constant
1709 */
1710 INVALID_JSON: 107,
1711
1712 /**
1713 * Error code indicating that the feature you tried to access is only
1714 * available internally for testing purposes.
1715 * @constant
1716 */
1717 COMMAND_UNAVAILABLE: 108,
1718
1719 /**
1720 * You must call AV.initialize before using the AV library.
1721 * @constant
1722 */
1723 NOT_INITIALIZED: 109,
1724
1725 /**
1726 * Error code indicating that a field was set to an inconsistent type.
1727 * @constant
1728 */
1729 INCORRECT_TYPE: 111,
1730
1731 /**
1732 * Error code indicating an invalid channel name. A channel name is either
1733 * an empty string (the broadcast channel) or contains only a-zA-Z0-9_
1734 * characters.
1735 * @constant
1736 */
1737 INVALID_CHANNEL_NAME: 112,
1738
1739 /**
1740 * Error code indicating that push is misconfigured.
1741 * @constant
1742 */
1743 PUSH_MISCONFIGURED: 115,
1744
1745 /**
1746 * Error code indicating that the object is too large.
1747 * @constant
1748 */
1749 OBJECT_TOO_LARGE: 116,
1750
1751 /**
1752 * Error code indicating that the operation isn't allowed for clients.
1753 * @constant
1754 */
1755 OPERATION_FORBIDDEN: 119,
1756
1757 /**
1758 * Error code indicating the result was not found in the cache.
1759 * @constant
1760 */
1761 CACHE_MISS: 120,
1762
1763 /**
1764 * Error code indicating that an invalid key was used in a nested
1765 * JSONObject.
1766 * @constant
1767 */
1768 INVALID_NESTED_KEY: 121,
1769
1770 /**
1771 * Error code indicating that an invalid filename was used for AVFile.
1772 * A valid file name contains only a-zA-Z0-9_. characters and is between 1
1773 * and 128 characters.
1774 * @constant
1775 */
1776 INVALID_FILE_NAME: 122,
1777
1778 /**
1779 * Error code indicating an invalid ACL was provided.
1780 * @constant
1781 */
1782 INVALID_ACL: 123,
1783
1784 /**
1785 * Error code indicating that the request timed out on the server. Typically
1786 * this indicates that the request is too expensive to run.
1787 * @constant
1788 */
1789 TIMEOUT: 124,
1790
1791 /**
1792 * Error code indicating that the email address was invalid.
1793 * @constant
1794 */
1795 INVALID_EMAIL_ADDRESS: 125,
1796
1797 /**
1798 * Error code indicating a missing content type.
1799 * @constant
1800 */
1801 MISSING_CONTENT_TYPE: 126,
1802
1803 /**
1804 * Error code indicating a missing content length.
1805 * @constant
1806 */
1807 MISSING_CONTENT_LENGTH: 127,
1808
1809 /**
1810 * Error code indicating an invalid content length.
1811 * @constant
1812 */
1813 INVALID_CONTENT_LENGTH: 128,
1814
1815 /**
1816 * Error code indicating a file that was too large.
1817 * @constant
1818 */
1819 FILE_TOO_LARGE: 129,
1820
1821 /**
1822 * Error code indicating an error saving a file.
1823 * @constant
1824 */
1825 FILE_SAVE_ERROR: 130,
1826
1827 /**
1828 * Error code indicating an error deleting a file.
1829 * @constant
1830 */
1831 FILE_DELETE_ERROR: 153,
1832
1833 /**
1834 * Error code indicating that a unique field was given a value that is
1835 * already taken.
1836 * @constant
1837 */
1838 DUPLICATE_VALUE: 137,
1839
1840 /**
1841 * Error code indicating that a role's name is invalid.
1842 * @constant
1843 */
1844 INVALID_ROLE_NAME: 139,
1845
1846 /**
1847 * Error code indicating that an application quota was exceeded. Upgrade to
1848 * resolve.
1849 * @constant
1850 */
1851 EXCEEDED_QUOTA: 140,
1852
1853 /**
1854 * Error code indicating that a Cloud Code script failed.
1855 * @constant
1856 */
1857 SCRIPT_FAILED: 141,
1858
1859 /**
1860 * Error code indicating that a Cloud Code validation failed.
1861 * @constant
1862 */
1863 VALIDATION_ERROR: 142,
1864
1865 /**
1866 * Error code indicating that invalid image data was provided.
1867 * @constant
1868 */
1869 INVALID_IMAGE_DATA: 150,
1870
1871 /**
1872 * Error code indicating an unsaved file.
1873 * @constant
1874 */
1875 UNSAVED_FILE_ERROR: 151,
1876
1877 /**
1878 * Error code indicating an invalid push time.
1879 * @constant
1880 */
1881 INVALID_PUSH_TIME_ERROR: 152,
1882
1883 /**
1884 * Error code indicating that the username is missing or empty.
1885 * @constant
1886 */
1887 USERNAME_MISSING: 200,
1888
1889 /**
1890 * Error code indicating that the password is missing or empty.
1891 * @constant
1892 */
1893 PASSWORD_MISSING: 201,
1894
1895 /**
1896 * Error code indicating that the username has already been taken.
1897 * @constant
1898 */
1899 USERNAME_TAKEN: 202,
1900
1901 /**
1902 * Error code indicating that the email has already been taken.
1903 * @constant
1904 */
1905 EMAIL_TAKEN: 203,
1906
1907 /**
1908 * Error code indicating that the email is missing, but must be specified.
1909 * @constant
1910 */
1911 EMAIL_MISSING: 204,
1912
1913 /**
1914 * Error code indicating that a user with the specified email was not found.
1915 * @constant
1916 */
1917 EMAIL_NOT_FOUND: 205,
1918
1919 /**
1920 * Error code indicating that a user object without a valid session could
1921 * not be altered.
1922 * @constant
1923 */
1924 SESSION_MISSING: 206,
1925
1926 /**
1927 * Error code indicating that a user can only be created through signup.
1928 * @constant
1929 */
1930 MUST_CREATE_USER_THROUGH_SIGNUP: 207,
1931
1932 /**
1933 * Error code indicating that an an account being linked is already linked
1934 * to another user.
1935 * @constant
1936 */
1937 ACCOUNT_ALREADY_LINKED: 208,
1938
1939 /**
1940 * Error code indicating that a user cannot be linked to an account because
1941 * that account's id could not be found.
1942 * @constant
1943 */
1944 LINKED_ID_MISSING: 250,
1945
1946 /**
1947 * Error code indicating that a user with a linked (e.g. Facebook) account
1948 * has an invalid session.
1949 * @constant
1950 */
1951 INVALID_LINKED_SESSION: 251,
1952
1953 /**
1954 * Error code indicating that a service being linked (e.g. Facebook or
1955 * Twitter) is unsupported.
1956 * @constant
1957 */
1958 UNSUPPORTED_SERVICE: 252,
1959
1960 /**
1961 * Error code indicating a real error code is unavailable because
1962 * we had to use an XDomainRequest object to allow CORS requests in
1963 * Internet Explorer, which strips the body from HTTP responses that have
1964 * a non-2XX status code.
1965 * @constant
1966 */
1967 X_DOMAIN_REQUEST: 602
1968});
1969
1970module.exports = AVError;
1971
1972/***/ }),
1973/* 44 */
1974/***/ (function(module, exports) {
1975
1976module.exports = function (bitmap, value) {
1977 return {
1978 enumerable: !(bitmap & 1),
1979 configurable: !(bitmap & 2),
1980 writable: !(bitmap & 4),
1981 value: value
1982 };
1983};
1984
1985
1986/***/ }),
1987/* 45 */
1988/***/ (function(module, exports, __webpack_require__) {
1989
1990var uncurryThis = __webpack_require__(4);
1991var aCallable = __webpack_require__(31);
1992var NATIVE_BIND = __webpack_require__(70);
1993
1994var bind = uncurryThis(uncurryThis.bind);
1995
1996// optional / simple context binding
1997module.exports = function (fn, that) {
1998 aCallable(fn);
1999 return that === undefined ? fn : NATIVE_BIND ? bind(fn, that) : function (/* ...args */) {
2000 return fn.apply(that, arguments);
2001 };
2002};
2003
2004
2005/***/ }),
2006/* 46 */
2007/***/ (function(module, exports, __webpack_require__) {
2008
2009var toLength = __webpack_require__(263);
2010
2011// `LengthOfArrayLike` abstract operation
2012// https://tc39.es/ecma262/#sec-lengthofarraylike
2013module.exports = function (obj) {
2014 return toLength(obj.length);
2015};
2016
2017
2018/***/ }),
2019/* 47 */
2020/***/ (function(module, exports, __webpack_require__) {
2021
2022/* global ActiveXObject -- old IE, WSH */
2023var anObject = __webpack_require__(19);
2024var definePropertiesModule = __webpack_require__(154);
2025var enumBugKeys = __webpack_require__(121);
2026var hiddenKeys = __webpack_require__(74);
2027var html = __webpack_require__(155);
2028var documentCreateElement = __webpack_require__(118);
2029var sharedKey = __webpack_require__(94);
2030
2031var GT = '>';
2032var LT = '<';
2033var PROTOTYPE = 'prototype';
2034var SCRIPT = 'script';
2035var IE_PROTO = sharedKey('IE_PROTO');
2036
2037var EmptyConstructor = function () { /* empty */ };
2038
2039var scriptTag = function (content) {
2040 return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
2041};
2042
2043// Create object with fake `null` prototype: use ActiveX Object with cleared prototype
2044var NullProtoObjectViaActiveX = function (activeXDocument) {
2045 activeXDocument.write(scriptTag(''));
2046 activeXDocument.close();
2047 var temp = activeXDocument.parentWindow.Object;
2048 activeXDocument = null; // avoid memory leak
2049 return temp;
2050};
2051
2052// Create object with fake `null` prototype: use iframe Object with cleared prototype
2053var NullProtoObjectViaIFrame = function () {
2054 // Thrash, waste and sodomy: IE GC bug
2055 var iframe = documentCreateElement('iframe');
2056 var JS = 'java' + SCRIPT + ':';
2057 var iframeDocument;
2058 iframe.style.display = 'none';
2059 html.appendChild(iframe);
2060 // https://github.com/zloirock/core-js/issues/475
2061 iframe.src = String(JS);
2062 iframeDocument = iframe.contentWindow.document;
2063 iframeDocument.open();
2064 iframeDocument.write(scriptTag('document.F=Object'));
2065 iframeDocument.close();
2066 return iframeDocument.F;
2067};
2068
2069// Check for document.domain and active x support
2070// No need to use active x approach when document.domain is not set
2071// see https://github.com/es-shims/es5-shim/issues/150
2072// variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
2073// avoid IE GC bug
2074var activeXDocument;
2075var NullProtoObject = function () {
2076 try {
2077 activeXDocument = new ActiveXObject('htmlfile');
2078 } catch (error) { /* ignore */ }
2079 NullProtoObject = typeof document != 'undefined'
2080 ? document.domain && activeXDocument
2081 ? NullProtoObjectViaActiveX(activeXDocument) // old IE
2082 : NullProtoObjectViaIFrame()
2083 : NullProtoObjectViaActiveX(activeXDocument); // WSH
2084 var length = enumBugKeys.length;
2085 while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
2086 return NullProtoObject();
2087};
2088
2089hiddenKeys[IE_PROTO] = true;
2090
2091// `Object.create` method
2092// https://tc39.es/ecma262/#sec-object.create
2093// eslint-disable-next-line es-x/no-object-create -- safe
2094module.exports = Object.create || function create(O, Properties) {
2095 var result;
2096 if (O !== null) {
2097 EmptyConstructor[PROTOTYPE] = anObject(O);
2098 result = new EmptyConstructor();
2099 EmptyConstructor[PROTOTYPE] = null;
2100 // add "__proto__" for Object.getPrototypeOf polyfill
2101 result[IE_PROTO] = O;
2102 } else result = NullProtoObject();
2103 return Properties === undefined ? result : definePropertiesModule.f(result, Properties);
2104};
2105
2106
2107/***/ }),
2108/* 48 */
2109/***/ (function(module, exports, __webpack_require__) {
2110
2111"use strict";
2112
2113var toIndexedObject = __webpack_require__(33);
2114var addToUnscopables = __webpack_require__(159);
2115var Iterators = __webpack_require__(58);
2116var InternalStateModule = __webpack_require__(38);
2117var defineProperty = __webpack_require__(22).f;
2118var defineIterator = __webpack_require__(124);
2119var IS_PURE = __webpack_require__(32);
2120var DESCRIPTORS = __webpack_require__(16);
2121
2122var ARRAY_ITERATOR = 'Array Iterator';
2123var setInternalState = InternalStateModule.set;
2124var getInternalState = InternalStateModule.getterFor(ARRAY_ITERATOR);
2125
2126// `Array.prototype.entries` method
2127// https://tc39.es/ecma262/#sec-array.prototype.entries
2128// `Array.prototype.keys` method
2129// https://tc39.es/ecma262/#sec-array.prototype.keys
2130// `Array.prototype.values` method
2131// https://tc39.es/ecma262/#sec-array.prototype.values
2132// `Array.prototype[@@iterator]` method
2133// https://tc39.es/ecma262/#sec-array.prototype-@@iterator
2134// `CreateArrayIterator` internal method
2135// https://tc39.es/ecma262/#sec-createarrayiterator
2136module.exports = defineIterator(Array, 'Array', function (iterated, kind) {
2137 setInternalState(this, {
2138 type: ARRAY_ITERATOR,
2139 target: toIndexedObject(iterated), // target
2140 index: 0, // next index
2141 kind: kind // kind
2142 });
2143// `%ArrayIteratorPrototype%.next` method
2144// https://tc39.es/ecma262/#sec-%arrayiteratorprototype%.next
2145}, function () {
2146 var state = getInternalState(this);
2147 var target = state.target;
2148 var kind = state.kind;
2149 var index = state.index++;
2150 if (!target || index >= target.length) {
2151 state.target = undefined;
2152 return { value: undefined, done: true };
2153 }
2154 if (kind == 'keys') return { value: index, done: false };
2155 if (kind == 'values') return { value: target[index], done: false };
2156 return { value: [index, target[index]], done: false };
2157}, 'values');
2158
2159// argumentsList[@@iterator] is %ArrayProto_values%
2160// https://tc39.es/ecma262/#sec-createunmappedargumentsobject
2161// https://tc39.es/ecma262/#sec-createmappedargumentsobject
2162var values = Iterators.Arguments = Iterators.Array;
2163
2164// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
2165addToUnscopables('keys');
2166addToUnscopables('values');
2167addToUnscopables('entries');
2168
2169// V8 ~ Chrome 45- bug
2170if (!IS_PURE && DESCRIPTORS && values.name !== 'values') try {
2171 defineProperty(values, 'name', { value: 'values' });
2172} catch (error) { /* empty */ }
2173
2174
2175/***/ }),
2176/* 49 */
2177/***/ (function(module, exports, __webpack_require__) {
2178
2179var TO_STRING_TAG_SUPPORT = __webpack_require__(122);
2180var defineProperty = __webpack_require__(22).f;
2181var createNonEnumerableProperty = __webpack_require__(35);
2182var hasOwn = __webpack_require__(14);
2183var toString = __webpack_require__(270);
2184var wellKnownSymbol = __webpack_require__(9);
2185
2186var TO_STRING_TAG = wellKnownSymbol('toStringTag');
2187
2188module.exports = function (it, TAG, STATIC, SET_METHOD) {
2189 if (it) {
2190 var target = STATIC ? it : it.prototype;
2191 if (!hasOwn(target, TO_STRING_TAG)) {
2192 defineProperty(target, TO_STRING_TAG, { configurable: true, value: TAG });
2193 }
2194 if (SET_METHOD && !TO_STRING_TAG_SUPPORT) {
2195 createNonEnumerableProperty(target, 'toString', toString);
2196 }
2197 }
2198};
2199
2200
2201/***/ }),
2202/* 50 */
2203/***/ (function(module, exports, __webpack_require__) {
2204
2205"use strict";
2206
2207var aCallable = __webpack_require__(31);
2208
2209var PromiseCapability = function (C) {
2210 var resolve, reject;
2211 this.promise = new C(function ($$resolve, $$reject) {
2212 if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor');
2213 resolve = $$resolve;
2214 reject = $$reject;
2215 });
2216 this.resolve = aCallable(resolve);
2217 this.reject = aCallable(reject);
2218};
2219
2220// `NewPromiseCapability` abstract operation
2221// https://tc39.es/ecma262/#sec-newpromisecapability
2222module.exports.f = function (C) {
2223 return new PromiseCapability(C);
2224};
2225
2226
2227/***/ }),
2228/* 51 */
2229/***/ (function(module, exports, __webpack_require__) {
2230
2231__webpack_require__(48);
2232var DOMIterables = __webpack_require__(289);
2233var global = __webpack_require__(6);
2234var classof = __webpack_require__(59);
2235var createNonEnumerableProperty = __webpack_require__(35);
2236var Iterators = __webpack_require__(58);
2237var wellKnownSymbol = __webpack_require__(9);
2238
2239var TO_STRING_TAG = wellKnownSymbol('toStringTag');
2240
2241for (var COLLECTION_NAME in DOMIterables) {
2242 var Collection = global[COLLECTION_NAME];
2243 var CollectionPrototype = Collection && Collection.prototype;
2244 if (CollectionPrototype && classof(CollectionPrototype) !== TO_STRING_TAG) {
2245 createNonEnumerableProperty(CollectionPrototype, TO_STRING_TAG, COLLECTION_NAME);
2246 }
2247 Iterators[COLLECTION_NAME] = Iterators.Array;
2248}
2249
2250
2251/***/ }),
2252/* 52 */
2253/***/ (function(module, __webpack_exports__, __webpack_require__) {
2254
2255"use strict";
2256/* harmony export (immutable) */ __webpack_exports__["a"] = isObject;
2257// Is a given variable an object?
2258function isObject(obj) {
2259 var type = typeof obj;
2260 return type === 'function' || type === 'object' && !!obj;
2261}
2262
2263
2264/***/ }),
2265/* 53 */
2266/***/ (function(module, __webpack_exports__, __webpack_require__) {
2267
2268"use strict";
2269/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(5);
2270/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__tagTester_js__ = __webpack_require__(17);
2271
2272
2273
2274// Is a given value an array?
2275// Delegates to ECMA5's native `Array.isArray`.
2276/* harmony default export */ __webpack_exports__["a"] = (__WEBPACK_IMPORTED_MODULE_0__setup_js__["k" /* nativeIsArray */] || Object(__WEBPACK_IMPORTED_MODULE_1__tagTester_js__["a" /* default */])('Array'));
2277
2278
2279/***/ }),
2280/* 54 */
2281/***/ (function(module, __webpack_exports__, __webpack_require__) {
2282
2283"use strict";
2284/* harmony export (immutable) */ __webpack_exports__["a"] = each;
2285/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__optimizeCb_js__ = __webpack_require__(82);
2286/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isArrayLike_js__ = __webpack_require__(25);
2287/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__keys_js__ = __webpack_require__(15);
2288
2289
2290
2291
2292// The cornerstone for collection functions, an `each`
2293// implementation, aka `forEach`.
2294// Handles raw objects in addition to array-likes. Treats all
2295// sparse array-likes as if they were dense.
2296function each(obj, iteratee, context) {
2297 iteratee = Object(__WEBPACK_IMPORTED_MODULE_0__optimizeCb_js__["a" /* default */])(iteratee, context);
2298 var i, length;
2299 if (Object(__WEBPACK_IMPORTED_MODULE_1__isArrayLike_js__["a" /* default */])(obj)) {
2300 for (i = 0, length = obj.length; i < length; i++) {
2301 iteratee(obj[i], i, obj);
2302 }
2303 } else {
2304 var _keys = Object(__WEBPACK_IMPORTED_MODULE_2__keys_js__["a" /* default */])(obj);
2305 for (i = 0, length = _keys.length; i < length; i++) {
2306 iteratee(obj[_keys[i]], _keys[i], obj);
2307 }
2308 }
2309 return obj;
2310}
2311
2312
2313/***/ }),
2314/* 55 */
2315/***/ (function(module, exports, __webpack_require__) {
2316
2317module.exports = __webpack_require__(381);
2318
2319/***/ }),
2320/* 56 */
2321/***/ (function(module, exports, __webpack_require__) {
2322
2323var uncurryThis = __webpack_require__(4);
2324
2325var toString = uncurryThis({}.toString);
2326var stringSlice = uncurryThis(''.slice);
2327
2328module.exports = function (it) {
2329 return stringSlice(toString(it), 8, -1);
2330};
2331
2332
2333/***/ }),
2334/* 57 */
2335/***/ (function(module, exports, __webpack_require__) {
2336
2337/* eslint-disable es-x/no-symbol -- required for testing */
2338var V8_VERSION = __webpack_require__(90);
2339var fails = __webpack_require__(3);
2340
2341// eslint-disable-next-line es-x/no-object-getownpropertysymbols -- required for testing
2342module.exports = !!Object.getOwnPropertySymbols && !fails(function () {
2343 var symbol = Symbol();
2344 // Chrome 38 Symbol has incorrect toString conversion
2345 // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
2346 return !String(symbol) || !(Object(symbol) instanceof Symbol) ||
2347 // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
2348 !Symbol.sham && V8_VERSION && V8_VERSION < 41;
2349});
2350
2351
2352/***/ }),
2353/* 58 */
2354/***/ (function(module, exports) {
2355
2356module.exports = {};
2357
2358
2359/***/ }),
2360/* 59 */
2361/***/ (function(module, exports, __webpack_require__) {
2362
2363var TO_STRING_TAG_SUPPORT = __webpack_require__(122);
2364var isCallable = __webpack_require__(7);
2365var classofRaw = __webpack_require__(56);
2366var wellKnownSymbol = __webpack_require__(9);
2367
2368var TO_STRING_TAG = wellKnownSymbol('toStringTag');
2369var $Object = Object;
2370
2371// ES3 wrong here
2372var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
2373
2374// fallback for IE11 Script Access Denied error
2375var tryGet = function (it, key) {
2376 try {
2377 return it[key];
2378 } catch (error) { /* empty */ }
2379};
2380
2381// getting tag from ES6+ `Object.prototype.toString`
2382module.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {
2383 var O, tag, result;
2384 return it === undefined ? 'Undefined' : it === null ? 'Null'
2385 // @@toStringTag case
2386 : typeof (tag = tryGet(O = $Object(it), TO_STRING_TAG)) == 'string' ? tag
2387 // builtinTag case
2388 : CORRECT_ARGUMENTS ? classofRaw(O)
2389 // ES3 arguments fallback
2390 : (result = classofRaw(O)) == 'Object' && isCallable(O.callee) ? 'Arguments' : result;
2391};
2392
2393
2394/***/ }),
2395/* 60 */
2396/***/ (function(module, exports) {
2397
2398// empty
2399
2400
2401/***/ }),
2402/* 61 */
2403/***/ (function(module, exports, __webpack_require__) {
2404
2405var global = __webpack_require__(6);
2406
2407module.exports = global.Promise;
2408
2409
2410/***/ }),
2411/* 62 */
2412/***/ (function(module, __webpack_exports__, __webpack_require__) {
2413
2414"use strict";
2415/* harmony export (immutable) */ __webpack_exports__["a"] = values;
2416/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__keys_js__ = __webpack_require__(15);
2417
2418
2419// Retrieve the values of an object's properties.
2420function values(obj) {
2421 var _keys = Object(__WEBPACK_IMPORTED_MODULE_0__keys_js__["a" /* default */])(obj);
2422 var length = _keys.length;
2423 var values = Array(length);
2424 for (var i = 0; i < length; i++) {
2425 values[i] = obj[_keys[i]];
2426 }
2427 return values;
2428}
2429
2430
2431/***/ }),
2432/* 63 */
2433/***/ (function(module, __webpack_exports__, __webpack_require__) {
2434
2435"use strict";
2436/* harmony export (immutable) */ __webpack_exports__["a"] = flatten;
2437/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__getLength_js__ = __webpack_require__(28);
2438/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isArrayLike_js__ = __webpack_require__(25);
2439/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__isArray_js__ = __webpack_require__(53);
2440/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__isArguments_js__ = __webpack_require__(129);
2441
2442
2443
2444
2445
2446// Internal implementation of a recursive `flatten` function.
2447function flatten(input, depth, strict, output) {
2448 output = output || [];
2449 if (!depth && depth !== 0) {
2450 depth = Infinity;
2451 } else if (depth <= 0) {
2452 return output.concat(input);
2453 }
2454 var idx = output.length;
2455 for (var i = 0, length = Object(__WEBPACK_IMPORTED_MODULE_0__getLength_js__["a" /* default */])(input); i < length; i++) {
2456 var value = input[i];
2457 if (Object(__WEBPACK_IMPORTED_MODULE_1__isArrayLike_js__["a" /* default */])(value) && (Object(__WEBPACK_IMPORTED_MODULE_2__isArray_js__["a" /* default */])(value) || Object(__WEBPACK_IMPORTED_MODULE_3__isArguments_js__["a" /* default */])(value))) {
2458 // Flatten current level of array or arguments object.
2459 if (depth > 1) {
2460 flatten(value, depth - 1, strict, output);
2461 idx = output.length;
2462 } else {
2463 var j = 0, len = value.length;
2464 while (j < len) output[idx++] = value[j++];
2465 }
2466 } else if (!strict) {
2467 output[idx++] = value;
2468 }
2469 }
2470 return output;
2471}
2472
2473
2474/***/ }),
2475/* 64 */
2476/***/ (function(module, __webpack_exports__, __webpack_require__) {
2477
2478"use strict";
2479/* harmony export (immutable) */ __webpack_exports__["a"] = map;
2480/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__cb_js__ = __webpack_require__(20);
2481/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isArrayLike_js__ = __webpack_require__(25);
2482/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__keys_js__ = __webpack_require__(15);
2483
2484
2485
2486
2487// Return the results of applying the iteratee to each element.
2488function map(obj, iteratee, context) {
2489 iteratee = Object(__WEBPACK_IMPORTED_MODULE_0__cb_js__["a" /* default */])(iteratee, context);
2490 var _keys = !Object(__WEBPACK_IMPORTED_MODULE_1__isArrayLike_js__["a" /* default */])(obj) && Object(__WEBPACK_IMPORTED_MODULE_2__keys_js__["a" /* default */])(obj),
2491 length = (_keys || obj).length,
2492 results = Array(length);
2493 for (var index = 0; index < length; index++) {
2494 var currentKey = _keys ? _keys[index] : index;
2495 results[index] = iteratee(obj[currentKey], currentKey, obj);
2496 }
2497 return results;
2498}
2499
2500
2501/***/ }),
2502/* 65 */
2503/***/ (function(module, exports, __webpack_require__) {
2504
2505"use strict";
2506/* WEBPACK VAR INJECTION */(function(global) {
2507
2508var _interopRequireDefault = __webpack_require__(1);
2509
2510var _promise = _interopRequireDefault(__webpack_require__(12));
2511
2512var _concat = _interopRequireDefault(__webpack_require__(30));
2513
2514var _map = _interopRequireDefault(__webpack_require__(42));
2515
2516var _keys = _interopRequireDefault(__webpack_require__(141));
2517
2518var _stringify = _interopRequireDefault(__webpack_require__(36));
2519
2520var _indexOf = _interopRequireDefault(__webpack_require__(86));
2521
2522var _keys2 = _interopRequireDefault(__webpack_require__(55));
2523
2524var _ = __webpack_require__(2);
2525
2526var uuid = __webpack_require__(221);
2527
2528var debug = __webpack_require__(67);
2529
2530var _require = __webpack_require__(29),
2531 inherits = _require.inherits,
2532 parseDate = _require.parseDate;
2533
2534var version = __webpack_require__(223);
2535
2536var _require2 = __webpack_require__(68),
2537 setAdapters = _require2.setAdapters,
2538 adapterManager = _require2.adapterManager;
2539
2540var AV = global.AV || {}; // All internal configuration items
2541
2542AV._config = {
2543 serverURLs: {},
2544 useMasterKey: false,
2545 production: null,
2546 realtime: null,
2547 requestTimeout: null
2548};
2549var initialUserAgent = "LeanCloud-JS-SDK/".concat(version); // configs shared by all AV instances
2550
2551AV._sharedConfig = {
2552 userAgent: initialUserAgent,
2553 liveQueryRealtime: null
2554};
2555adapterManager.on('platformInfo', function (platformInfo) {
2556 var ua = initialUserAgent;
2557
2558 if (platformInfo) {
2559 if (platformInfo.userAgent) {
2560 ua = platformInfo.userAgent;
2561 } else {
2562 var comments = platformInfo.name;
2563
2564 if (platformInfo.version) {
2565 comments += "/".concat(platformInfo.version);
2566 }
2567
2568 if (platformInfo.extra) {
2569 comments += "; ".concat(platformInfo.extra);
2570 }
2571
2572 ua += " (".concat(comments, ")");
2573 }
2574 }
2575
2576 AV._sharedConfig.userAgent = ua;
2577});
2578/**
2579 * Contains all AV API classes and functions.
2580 * @namespace AV
2581 */
2582
2583/**
2584 * Returns prefix for localStorage keys used by this instance of AV.
2585 * @param {String} path The relative suffix to append to it.
2586 * null or undefined is treated as the empty string.
2587 * @return {String} The full key name.
2588 * @private
2589 */
2590
2591AV._getAVPath = function (path) {
2592 if (!AV.applicationId) {
2593 throw new Error('You need to call AV.initialize before using AV.');
2594 }
2595
2596 if (!path) {
2597 path = '';
2598 }
2599
2600 if (!_.isString(path)) {
2601 throw new Error("Tried to get a localStorage path that wasn't a String.");
2602 }
2603
2604 if (path[0] === '/') {
2605 path = path.substring(1);
2606 }
2607
2608 return 'AV/' + AV.applicationId + '/' + path;
2609};
2610/**
2611 * Returns the unique string for this app on this machine.
2612 * Gets reset when localStorage is cleared.
2613 * @private
2614 */
2615
2616
2617AV._installationId = null;
2618
2619AV._getInstallationId = function () {
2620 // See if it's cached in RAM.
2621 if (AV._installationId) {
2622 return _promise.default.resolve(AV._installationId);
2623 } // Try to get it from localStorage.
2624
2625
2626 var path = AV._getAVPath('installationId');
2627
2628 return AV.localStorage.getItemAsync(path).then(function (_installationId) {
2629 AV._installationId = _installationId;
2630
2631 if (!AV._installationId) {
2632 // It wasn't in localStorage, so create a new one.
2633 AV._installationId = _installationId = uuid();
2634 return AV.localStorage.setItemAsync(path, _installationId).then(function () {
2635 return _installationId;
2636 });
2637 }
2638
2639 return _installationId;
2640 });
2641};
2642
2643AV._subscriptionId = null;
2644
2645AV._refreshSubscriptionId = function () {
2646 var path = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : AV._getAVPath('subscriptionId');
2647 var subscriptionId = AV._subscriptionId = uuid();
2648 return AV.localStorage.setItemAsync(path, subscriptionId).then(function () {
2649 return subscriptionId;
2650 });
2651};
2652
2653AV._getSubscriptionId = function () {
2654 // See if it's cached in RAM.
2655 if (AV._subscriptionId) {
2656 return _promise.default.resolve(AV._subscriptionId);
2657 } // Try to get it from localStorage.
2658
2659
2660 var path = AV._getAVPath('subscriptionId');
2661
2662 return AV.localStorage.getItemAsync(path).then(function (_subscriptionId) {
2663 AV._subscriptionId = _subscriptionId;
2664
2665 if (!AV._subscriptionId) {
2666 // It wasn't in localStorage, so create a new one.
2667 _subscriptionId = AV._refreshSubscriptionId(path);
2668 }
2669
2670 return _subscriptionId;
2671 });
2672};
2673
2674AV._parseDate = parseDate; // A self-propagating extend function.
2675
2676AV._extend = function (protoProps, classProps) {
2677 var child = inherits(this, protoProps, classProps);
2678 child.extend = this.extend;
2679 return child;
2680};
2681/**
2682 * Converts a value in a AV Object into the appropriate representation.
2683 * This is the JS equivalent of Java's AV.maybeReferenceAndEncode(Object)
2684 * if seenObjects is falsey. Otherwise any AV.Objects not in
2685 * seenObjects will be fully embedded rather than encoded
2686 * as a pointer. This array will be used to prevent going into an infinite
2687 * loop because we have circular references. If <seenObjects>
2688 * is set, then none of the AV Objects that are serialized can be dirty.
2689 * @private
2690 */
2691
2692
2693AV._encode = function (value, seenObjects, disallowObjects) {
2694 var full = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
2695
2696 if (value instanceof AV.Object) {
2697 if (disallowObjects) {
2698 throw new Error('AV.Objects not allowed here');
2699 }
2700
2701 if (!seenObjects || _.include(seenObjects, value) || !value._hasData) {
2702 return value._toPointer();
2703 }
2704
2705 return value._toFullJSON((0, _concat.default)(seenObjects).call(seenObjects, value), full);
2706 }
2707
2708 if (value instanceof AV.ACL) {
2709 return value.toJSON();
2710 }
2711
2712 if (_.isDate(value)) {
2713 return full ? {
2714 __type: 'Date',
2715 iso: value.toJSON()
2716 } : value.toJSON();
2717 }
2718
2719 if (value instanceof AV.GeoPoint) {
2720 return value.toJSON();
2721 }
2722
2723 if (_.isArray(value)) {
2724 return (0, _map.default)(_).call(_, value, function (x) {
2725 return AV._encode(x, seenObjects, disallowObjects, full);
2726 });
2727 }
2728
2729 if (_.isRegExp(value)) {
2730 return value.source;
2731 }
2732
2733 if (value instanceof AV.Relation) {
2734 return value.toJSON();
2735 }
2736
2737 if (value instanceof AV.Op) {
2738 return value.toJSON();
2739 }
2740
2741 if (value instanceof AV.File) {
2742 if (!value.url() && !value.id) {
2743 throw new Error('Tried to save an object containing an unsaved file.');
2744 }
2745
2746 return value._toFullJSON(seenObjects, full);
2747 }
2748
2749 if (_.isObject(value)) {
2750 return _.mapObject(value, function (v, k) {
2751 return AV._encode(v, seenObjects, disallowObjects, full);
2752 });
2753 }
2754
2755 return value;
2756};
2757/**
2758 * The inverse function of AV._encode.
2759 * @private
2760 */
2761
2762
2763AV._decode = function (value, key) {
2764 if (!_.isObject(value) || _.isDate(value)) {
2765 return value;
2766 }
2767
2768 if (_.isArray(value)) {
2769 return (0, _map.default)(_).call(_, value, function (v) {
2770 return AV._decode(v);
2771 });
2772 }
2773
2774 if (value instanceof AV.Object) {
2775 return value;
2776 }
2777
2778 if (value instanceof AV.File) {
2779 return value;
2780 }
2781
2782 if (value instanceof AV.Op) {
2783 return value;
2784 }
2785
2786 if (value instanceof AV.GeoPoint) {
2787 return value;
2788 }
2789
2790 if (value instanceof AV.ACL) {
2791 return value;
2792 }
2793
2794 if (key === 'ACL') {
2795 return new AV.ACL(value);
2796 }
2797
2798 if (value.__op) {
2799 return AV.Op._decode(value);
2800 }
2801
2802 var className;
2803
2804 if (value.__type === 'Pointer') {
2805 className = value.className;
2806
2807 var pointer = AV.Object._create(className);
2808
2809 if ((0, _keys.default)(value).length > 3) {
2810 var v = _.clone(value);
2811
2812 delete v.__type;
2813 delete v.className;
2814
2815 pointer._finishFetch(v, true);
2816 } else {
2817 pointer._finishFetch({
2818 objectId: value.objectId
2819 }, false);
2820 }
2821
2822 return pointer;
2823 }
2824
2825 if (value.__type === 'Object') {
2826 // It's an Object included in a query result.
2827 className = value.className;
2828
2829 var _v = _.clone(value);
2830
2831 delete _v.__type;
2832 delete _v.className;
2833
2834 var object = AV.Object._create(className);
2835
2836 object._finishFetch(_v, true);
2837
2838 return object;
2839 }
2840
2841 if (value.__type === 'Date') {
2842 return AV._parseDate(value.iso);
2843 }
2844
2845 if (value.__type === 'GeoPoint') {
2846 return new AV.GeoPoint({
2847 latitude: value.latitude,
2848 longitude: value.longitude
2849 });
2850 }
2851
2852 if (value.__type === 'Relation') {
2853 if (!key) throw new Error('key missing decoding a Relation');
2854 var relation = new AV.Relation(null, key);
2855 relation.targetClassName = value.className;
2856 return relation;
2857 }
2858
2859 if (value.__type === 'File') {
2860 var file = new AV.File(value.name);
2861
2862 var _v2 = _.clone(value);
2863
2864 delete _v2.__type;
2865
2866 file._finishFetch(_v2);
2867
2868 return file;
2869 }
2870
2871 return _.mapObject(value, AV._decode);
2872};
2873/**
2874 * The inverse function of {@link AV.Object#toFullJSON}.
2875 * @since 3.0.0
2876 * @method
2877 * @param {Object}
2878 * return {AV.Object|AV.File|any}
2879 */
2880
2881
2882AV.parseJSON = AV._decode;
2883/**
2884 * Similar to JSON.parse, except that AV internal types will be used if possible.
2885 * Inverse to {@link AV.stringify}
2886 * @since 3.14.0
2887 * @param {string} text the string to parse.
2888 * @return {AV.Object|AV.File|any}
2889 */
2890
2891AV.parse = function (text) {
2892 return AV.parseJSON(JSON.parse(text));
2893};
2894/**
2895 * Serialize a target containing AV.Object, similar to JSON.stringify.
2896 * Inverse to {@link AV.parse}
2897 * @since 3.14.0
2898 * @return {string}
2899 */
2900
2901
2902AV.stringify = function (target) {
2903 return (0, _stringify.default)(AV._encode(target, [], false, true));
2904};
2905
2906AV._encodeObjectOrArray = function (value) {
2907 var encodeAVObject = function encodeAVObject(object) {
2908 if (object && object._toFullJSON) {
2909 object = object._toFullJSON([]);
2910 }
2911
2912 return _.mapObject(object, function (value) {
2913 return AV._encode(value, []);
2914 });
2915 };
2916
2917 if (_.isArray(value)) {
2918 return (0, _map.default)(value).call(value, function (object) {
2919 return encodeAVObject(object);
2920 });
2921 } else {
2922 return encodeAVObject(value);
2923 }
2924};
2925
2926AV._arrayEach = _.each;
2927/**
2928 * Does a deep traversal of every item in object, calling func on every one.
2929 * @param {Object} object The object or array to traverse deeply.
2930 * @param {Function} func The function to call for every item. It will
2931 * be passed the item as an argument. If it returns a truthy value, that
2932 * value will replace the item in its parent container.
2933 * @returns {} the result of calling func on the top-level object itself.
2934 * @private
2935 */
2936
2937AV._traverse = function (object, func, seen) {
2938 if (object instanceof AV.Object) {
2939 seen = seen || [];
2940
2941 if ((0, _indexOf.default)(_).call(_, seen, object) >= 0) {
2942 // We've already visited this object in this call.
2943 return;
2944 }
2945
2946 seen.push(object);
2947
2948 AV._traverse(object.attributes, func, seen);
2949
2950 return func(object);
2951 }
2952
2953 if (object instanceof AV.Relation || object instanceof AV.File) {
2954 // Nothing needs to be done, but we don't want to recurse into the
2955 // object's parent infinitely, so we catch this case.
2956 return func(object);
2957 }
2958
2959 if (_.isArray(object)) {
2960 _.each(object, function (child, index) {
2961 var newChild = AV._traverse(child, func, seen);
2962
2963 if (newChild) {
2964 object[index] = newChild;
2965 }
2966 });
2967
2968 return func(object);
2969 }
2970
2971 if (_.isObject(object)) {
2972 AV._each(object, function (child, key) {
2973 var newChild = AV._traverse(child, func, seen);
2974
2975 if (newChild) {
2976 object[key] = newChild;
2977 }
2978 });
2979
2980 return func(object);
2981 }
2982
2983 return func(object);
2984};
2985/**
2986 * This is like _.each, except:
2987 * * it doesn't work for so-called array-like objects,
2988 * * it does work for dictionaries with a "length" attribute.
2989 * @private
2990 */
2991
2992
2993AV._objectEach = AV._each = function (obj, callback) {
2994 if (_.isObject(obj)) {
2995 _.each((0, _keys2.default)(_).call(_, obj), function (key) {
2996 callback(obj[key], key);
2997 });
2998 } else {
2999 _.each(obj, callback);
3000 }
3001};
3002/**
3003 * @namespace
3004 * @since 3.14.0
3005 */
3006
3007
3008AV.debug = {
3009 /**
3010 * Enable debug
3011 */
3012 enable: function enable() {
3013 var namespaces = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'leancloud*';
3014 return debug.enable(namespaces);
3015 },
3016
3017 /**
3018 * Disable debug
3019 */
3020 disable: debug.disable
3021};
3022/**
3023 * Specify Adapters
3024 * @since 4.4.0
3025 * @function
3026 * @param {Adapters} newAdapters See {@link https://url.leanapp.cn/adapter-type-definitions @leancloud/adapter-types} for detailed definitions.
3027 */
3028
3029AV.setAdapters = setAdapters;
3030module.exports = AV;
3031/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(112)))
3032
3033/***/ }),
3034/* 66 */
3035/***/ (function(module, exports, __webpack_require__) {
3036
3037var bind = __webpack_require__(45);
3038var uncurryThis = __webpack_require__(4);
3039var IndexedObject = __webpack_require__(114);
3040var toObject = __webpack_require__(34);
3041var lengthOfArrayLike = __webpack_require__(46);
3042var arraySpeciesCreate = __webpack_require__(219);
3043
3044var push = uncurryThis([].push);
3045
3046// `Array.prototype.{ forEach, map, filter, some, every, find, findIndex, filterReject }` methods implementation
3047var createMethod = function (TYPE) {
3048 var IS_MAP = TYPE == 1;
3049 var IS_FILTER = TYPE == 2;
3050 var IS_SOME = TYPE == 3;
3051 var IS_EVERY = TYPE == 4;
3052 var IS_FIND_INDEX = TYPE == 6;
3053 var IS_FILTER_REJECT = TYPE == 7;
3054 var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
3055 return function ($this, callbackfn, that, specificCreate) {
3056 var O = toObject($this);
3057 var self = IndexedObject(O);
3058 var boundFunction = bind(callbackfn, that);
3059 var length = lengthOfArrayLike(self);
3060 var index = 0;
3061 var create = specificCreate || arraySpeciesCreate;
3062 var target = IS_MAP ? create($this, length) : IS_FILTER || IS_FILTER_REJECT ? create($this, 0) : undefined;
3063 var value, result;
3064 for (;length > index; index++) if (NO_HOLES || index in self) {
3065 value = self[index];
3066 result = boundFunction(value, index, O);
3067 if (TYPE) {
3068 if (IS_MAP) target[index] = result; // map
3069 else if (result) switch (TYPE) {
3070 case 3: return true; // some
3071 case 5: return value; // find
3072 case 6: return index; // findIndex
3073 case 2: push(target, value); // filter
3074 } else switch (TYPE) {
3075 case 4: return false; // every
3076 case 7: push(target, value); // filterReject
3077 }
3078 }
3079 }
3080 return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
3081 };
3082};
3083
3084module.exports = {
3085 // `Array.prototype.forEach` method
3086 // https://tc39.es/ecma262/#sec-array.prototype.foreach
3087 forEach: createMethod(0),
3088 // `Array.prototype.map` method
3089 // https://tc39.es/ecma262/#sec-array.prototype.map
3090 map: createMethod(1),
3091 // `Array.prototype.filter` method
3092 // https://tc39.es/ecma262/#sec-array.prototype.filter
3093 filter: createMethod(2),
3094 // `Array.prototype.some` method
3095 // https://tc39.es/ecma262/#sec-array.prototype.some
3096 some: createMethod(3),
3097 // `Array.prototype.every` method
3098 // https://tc39.es/ecma262/#sec-array.prototype.every
3099 every: createMethod(4),
3100 // `Array.prototype.find` method
3101 // https://tc39.es/ecma262/#sec-array.prototype.find
3102 find: createMethod(5),
3103 // `Array.prototype.findIndex` method
3104 // https://tc39.es/ecma262/#sec-array.prototype.findIndex
3105 findIndex: createMethod(6),
3106 // `Array.prototype.filterReject` method
3107 // https://github.com/tc39/proposal-array-filtering
3108 filterReject: createMethod(7)
3109};
3110
3111
3112/***/ }),
3113/* 67 */
3114/***/ (function(module, exports, __webpack_require__) {
3115
3116"use strict";
3117
3118
3119function _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); }
3120
3121/* eslint-env browser */
3122
3123/**
3124 * This is the web browser implementation of `debug()`.
3125 */
3126exports.log = log;
3127exports.formatArgs = formatArgs;
3128exports.save = save;
3129exports.load = load;
3130exports.useColors = useColors;
3131exports.storage = localstorage();
3132/**
3133 * Colors.
3134 */
3135
3136exports.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'];
3137/**
3138 * Currently only WebKit-based Web Inspectors, Firefox >= v31,
3139 * and the Firebug extension (any Firefox version) are known
3140 * to support "%c" CSS customizations.
3141 *
3142 * TODO: add a `localStorage` variable to explicitly enable/disable colors
3143 */
3144// eslint-disable-next-line complexity
3145
3146function useColors() {
3147 // NB: In an Electron preload script, document will be defined but not fully
3148 // initialized. Since we know we're in Chrome, we'll just detect this case
3149 // explicitly
3150 if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {
3151 return true;
3152 } // Internet Explorer and Edge do not support colors.
3153
3154
3155 if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
3156 return false;
3157 } // Is webkit? http://stackoverflow.com/a/16459606/376773
3158 // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
3159
3160
3161 return typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773
3162 typeof window !== 'undefined' && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31?
3163 // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
3164 typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker
3165 typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
3166}
3167/**
3168 * Colorize log arguments if enabled.
3169 *
3170 * @api public
3171 */
3172
3173
3174function formatArgs(args) {
3175 args[0] = (this.useColors ? '%c' : '') + this.namespace + (this.useColors ? ' %c' : ' ') + args[0] + (this.useColors ? '%c ' : ' ') + '+' + module.exports.humanize(this.diff);
3176
3177 if (!this.useColors) {
3178 return;
3179 }
3180
3181 var c = 'color: ' + this.color;
3182 args.splice(1, 0, c, 'color: inherit'); // The final "%c" is somewhat tricky, because there could be other
3183 // arguments passed either before or after the %c, so we need to
3184 // figure out the correct index to insert the CSS into
3185
3186 var index = 0;
3187 var lastC = 0;
3188 args[0].replace(/%[a-zA-Z%]/g, function (match) {
3189 if (match === '%%') {
3190 return;
3191 }
3192
3193 index++;
3194
3195 if (match === '%c') {
3196 // We only are interested in the *last* %c
3197 // (the user may have provided their own)
3198 lastC = index;
3199 }
3200 });
3201 args.splice(lastC, 0, c);
3202}
3203/**
3204 * Invokes `console.log()` when available.
3205 * No-op when `console.log` is not a "function".
3206 *
3207 * @api public
3208 */
3209
3210
3211function log() {
3212 var _console;
3213
3214 // This hackery is required for IE8/9, where
3215 // the `console.log` function doesn't have 'apply'
3216 return (typeof console === "undefined" ? "undefined" : _typeof(console)) === 'object' && console.log && (_console = console).log.apply(_console, arguments);
3217}
3218/**
3219 * Save `namespaces`.
3220 *
3221 * @param {String} namespaces
3222 * @api private
3223 */
3224
3225
3226function save(namespaces) {
3227 try {
3228 if (namespaces) {
3229 exports.storage.setItem('debug', namespaces);
3230 } else {
3231 exports.storage.removeItem('debug');
3232 }
3233 } catch (error) {// Swallow
3234 // XXX (@Qix-) should we be logging these?
3235 }
3236}
3237/**
3238 * Load `namespaces`.
3239 *
3240 * @return {String} returns the previously persisted debug modes
3241 * @api private
3242 */
3243
3244
3245function load() {
3246 var r;
3247
3248 try {
3249 r = exports.storage.getItem('debug');
3250 } catch (error) {} // Swallow
3251 // XXX (@Qix-) should we be logging these?
3252 // If debug isn't set in LS, and we're in Electron, try to load $DEBUG
3253
3254
3255 if (!r && typeof process !== 'undefined' && 'env' in process) {
3256 r = process.env.DEBUG;
3257 }
3258
3259 return r;
3260}
3261/**
3262 * Localstorage attempts to return the localstorage.
3263 *
3264 * This is necessary because safari throws
3265 * when a user disables cookies/localstorage
3266 * and you attempt to access it.
3267 *
3268 * @return {LocalStorage}
3269 * @api private
3270 */
3271
3272
3273function localstorage() {
3274 try {
3275 // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context
3276 // The Browser also has localStorage in the global context.
3277 return localStorage;
3278 } catch (error) {// Swallow
3279 // XXX (@Qix-) should we be logging these?
3280 }
3281}
3282
3283module.exports = __webpack_require__(386)(exports);
3284var formatters = module.exports.formatters;
3285/**
3286 * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
3287 */
3288
3289formatters.j = function (v) {
3290 try {
3291 return JSON.stringify(v);
3292 } catch (error) {
3293 return '[UnexpectedJSONParseError]: ' + error.message;
3294 }
3295};
3296
3297
3298
3299/***/ }),
3300/* 68 */
3301/***/ (function(module, exports, __webpack_require__) {
3302
3303"use strict";
3304
3305
3306var _interopRequireDefault = __webpack_require__(1);
3307
3308var _keys = _interopRequireDefault(__webpack_require__(55));
3309
3310var _ = __webpack_require__(2);
3311
3312var EventEmitter = __webpack_require__(224);
3313
3314var _require = __webpack_require__(29),
3315 inherits = _require.inherits;
3316
3317var AdapterManager = inherits(EventEmitter, {
3318 constructor: function constructor() {
3319 EventEmitter.apply(this);
3320 this._adapters = {};
3321 },
3322 getAdapter: function getAdapter(name) {
3323 var adapter = this._adapters[name];
3324
3325 if (adapter === undefined) {
3326 throw new Error("".concat(name, " adapter is not configured"));
3327 }
3328
3329 return adapter;
3330 },
3331 setAdapters: function setAdapters(newAdapters) {
3332 var _this = this;
3333
3334 _.extend(this._adapters, newAdapters);
3335
3336 (0, _keys.default)(_).call(_, newAdapters).forEach(function (name) {
3337 return _this.emit(name, newAdapters[name]);
3338 });
3339 }
3340});
3341var adapterManager = new AdapterManager();
3342module.exports = {
3343 getAdapter: adapterManager.getAdapter.bind(adapterManager),
3344 setAdapters: adapterManager.setAdapters.bind(adapterManager),
3345 adapterManager: adapterManager
3346};
3347
3348/***/ }),
3349/* 69 */
3350/***/ (function(module, exports, __webpack_require__) {
3351
3352var NATIVE_BIND = __webpack_require__(70);
3353
3354var FunctionPrototype = Function.prototype;
3355var apply = FunctionPrototype.apply;
3356var call = FunctionPrototype.call;
3357
3358// eslint-disable-next-line es-x/no-reflect -- safe
3359module.exports = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND ? call.bind(apply) : function () {
3360 return call.apply(apply, arguments);
3361});
3362
3363
3364/***/ }),
3365/* 70 */
3366/***/ (function(module, exports, __webpack_require__) {
3367
3368var fails = __webpack_require__(3);
3369
3370module.exports = !fails(function () {
3371 // eslint-disable-next-line es-x/no-function-prototype-bind -- safe
3372 var test = (function () { /* empty */ }).bind();
3373 // eslint-disable-next-line no-prototype-builtins -- safe
3374 return typeof test != 'function' || test.hasOwnProperty('prototype');
3375});
3376
3377
3378/***/ }),
3379/* 71 */
3380/***/ (function(module, exports, __webpack_require__) {
3381
3382var DESCRIPTORS = __webpack_require__(16);
3383var call = __webpack_require__(13);
3384var propertyIsEnumerableModule = __webpack_require__(113);
3385var createPropertyDescriptor = __webpack_require__(44);
3386var toIndexedObject = __webpack_require__(33);
3387var toPropertyKey = __webpack_require__(88);
3388var hasOwn = __webpack_require__(14);
3389var IE8_DOM_DEFINE = __webpack_require__(148);
3390
3391// eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
3392var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
3393
3394// `Object.getOwnPropertyDescriptor` method
3395// https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
3396exports.f = DESCRIPTORS ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
3397 O = toIndexedObject(O);
3398 P = toPropertyKey(P);
3399 if (IE8_DOM_DEFINE) try {
3400 return $getOwnPropertyDescriptor(O, P);
3401 } catch (error) { /* empty */ }
3402 if (hasOwn(O, P)) return createPropertyDescriptor(!call(propertyIsEnumerableModule.f, O, P), O[P]);
3403};
3404
3405
3406/***/ }),
3407/* 72 */
3408/***/ (function(module, exports) {
3409
3410var $String = String;
3411
3412module.exports = function (argument) {
3413 try {
3414 return $String(argument);
3415 } catch (error) {
3416 return 'Object';
3417 }
3418};
3419
3420
3421/***/ }),
3422/* 73 */
3423/***/ (function(module, exports, __webpack_require__) {
3424
3425var IS_PURE = __webpack_require__(32);
3426var store = __webpack_require__(117);
3427
3428(module.exports = function (key, value) {
3429 return store[key] || (store[key] = value !== undefined ? value : {});
3430})('versions', []).push({
3431 version: '3.23.3',
3432 mode: IS_PURE ? 'pure' : 'global',
3433 copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
3434 license: 'https://github.com/zloirock/core-js/blob/v3.23.3/LICENSE',
3435 source: 'https://github.com/zloirock/core-js'
3436});
3437
3438
3439/***/ }),
3440/* 74 */
3441/***/ (function(module, exports) {
3442
3443module.exports = {};
3444
3445
3446/***/ }),
3447/* 75 */
3448/***/ (function(module, exports, __webpack_require__) {
3449
3450var classof = __webpack_require__(59);
3451
3452var $String = String;
3453
3454module.exports = function (argument) {
3455 if (classof(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string');
3456 return $String(argument);
3457};
3458
3459
3460/***/ }),
3461/* 76 */
3462/***/ (function(module, exports) {
3463
3464module.exports = function (exec) {
3465 try {
3466 return { error: false, value: exec() };
3467 } catch (error) {
3468 return { error: true, value: error };
3469 }
3470};
3471
3472
3473/***/ }),
3474/* 77 */
3475/***/ (function(module, exports, __webpack_require__) {
3476
3477var global = __webpack_require__(6);
3478var NativePromiseConstructor = __webpack_require__(61);
3479var isCallable = __webpack_require__(7);
3480var isForced = __webpack_require__(149);
3481var inspectSource = __webpack_require__(123);
3482var wellKnownSymbol = __webpack_require__(9);
3483var IS_BROWSER = __webpack_require__(279);
3484var IS_PURE = __webpack_require__(32);
3485var V8_VERSION = __webpack_require__(90);
3486
3487var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;
3488var SPECIES = wellKnownSymbol('species');
3489var SUBCLASSING = false;
3490var NATIVE_PROMISE_REJECTION_EVENT = isCallable(global.PromiseRejectionEvent);
3491
3492var FORCED_PROMISE_CONSTRUCTOR = isForced('Promise', function () {
3493 var PROMISE_CONSTRUCTOR_SOURCE = inspectSource(NativePromiseConstructor);
3494 var GLOBAL_CORE_JS_PROMISE = PROMISE_CONSTRUCTOR_SOURCE !== String(NativePromiseConstructor);
3495 // V8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables
3496 // https://bugs.chromium.org/p/chromium/issues/detail?id=830565
3497 // We can't detect it synchronously, so just check versions
3498 if (!GLOBAL_CORE_JS_PROMISE && V8_VERSION === 66) return true;
3499 // We need Promise#{ catch, finally } in the pure version for preventing prototype pollution
3500 if (IS_PURE && !(NativePromisePrototype['catch'] && NativePromisePrototype['finally'])) return true;
3501 // We can't use @@species feature detection in V8 since it causes
3502 // deoptimization and performance degradation
3503 // https://github.com/zloirock/core-js/issues/679
3504 if (V8_VERSION >= 51 && /native code/.test(PROMISE_CONSTRUCTOR_SOURCE)) return false;
3505 // Detect correctness of subclassing with @@species support
3506 var promise = new NativePromiseConstructor(function (resolve) { resolve(1); });
3507 var FakePromise = function (exec) {
3508 exec(function () { /* empty */ }, function () { /* empty */ });
3509 };
3510 var constructor = promise.constructor = {};
3511 constructor[SPECIES] = FakePromise;
3512 SUBCLASSING = promise.then(function () { /* empty */ }) instanceof FakePromise;
3513 if (!SUBCLASSING) return true;
3514 // Unhandled rejections tracking support, NodeJS Promise without it fails @@species test
3515 return !GLOBAL_CORE_JS_PROMISE && IS_BROWSER && !NATIVE_PROMISE_REJECTION_EVENT;
3516});
3517
3518module.exports = {
3519 CONSTRUCTOR: FORCED_PROMISE_CONSTRUCTOR,
3520 REJECTION_EVENT: NATIVE_PROMISE_REJECTION_EVENT,
3521 SUBCLASSING: SUBCLASSING
3522};
3523
3524
3525/***/ }),
3526/* 78 */
3527/***/ (function(module, exports, __webpack_require__) {
3528
3529"use strict";
3530
3531var charAt = __webpack_require__(288).charAt;
3532var toString = __webpack_require__(75);
3533var InternalStateModule = __webpack_require__(38);
3534var defineIterator = __webpack_require__(124);
3535
3536var STRING_ITERATOR = 'String Iterator';
3537var setInternalState = InternalStateModule.set;
3538var getInternalState = InternalStateModule.getterFor(STRING_ITERATOR);
3539
3540// `String.prototype[@@iterator]` method
3541// https://tc39.es/ecma262/#sec-string.prototype-@@iterator
3542defineIterator(String, 'String', function (iterated) {
3543 setInternalState(this, {
3544 type: STRING_ITERATOR,
3545 string: toString(iterated),
3546 index: 0
3547 });
3548// `%StringIteratorPrototype%.next` method
3549// https://tc39.es/ecma262/#sec-%stringiteratorprototype%.next
3550}, function next() {
3551 var state = getInternalState(this);
3552 var string = state.string;
3553 var index = state.index;
3554 var point;
3555 if (index >= string.length) return { value: undefined, done: true };
3556 point = charAt(string, index);
3557 state.index += point.length;
3558 return { value: point, done: false };
3559});
3560
3561
3562/***/ }),
3563/* 79 */
3564/***/ (function(module, __webpack_exports__, __webpack_require__) {
3565
3566"use strict";
3567/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return hasStringTagBug; });
3568/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return isIE11; });
3569/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(5);
3570/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__hasObjectTag_js__ = __webpack_require__(296);
3571
3572
3573
3574// In IE 10 - Edge 13, `DataView` has string tag `'[object Object]'`.
3575// In IE 11, the most common among them, this problem also applies to
3576// `Map`, `WeakMap` and `Set`.
3577var hasStringTagBug = (
3578 __WEBPACK_IMPORTED_MODULE_0__setup_js__["s" /* supportsDataView */] && Object(__WEBPACK_IMPORTED_MODULE_1__hasObjectTag_js__["a" /* default */])(new DataView(new ArrayBuffer(8)))
3579 ),
3580 isIE11 = (typeof Map !== 'undefined' && Object(__WEBPACK_IMPORTED_MODULE_1__hasObjectTag_js__["a" /* default */])(new Map));
3581
3582
3583/***/ }),
3584/* 80 */
3585/***/ (function(module, __webpack_exports__, __webpack_require__) {
3586
3587"use strict";
3588/* harmony export (immutable) */ __webpack_exports__["a"] = allKeys;
3589/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isObject_js__ = __webpack_require__(52);
3590/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__setup_js__ = __webpack_require__(5);
3591/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__collectNonEnumProps_js__ = __webpack_require__(180);
3592
3593
3594
3595
3596// Retrieve all the enumerable property names of an object.
3597function allKeys(obj) {
3598 if (!Object(__WEBPACK_IMPORTED_MODULE_0__isObject_js__["a" /* default */])(obj)) return [];
3599 var keys = [];
3600 for (var key in obj) keys.push(key);
3601 // Ahem, IE < 9.
3602 if (__WEBPACK_IMPORTED_MODULE_1__setup_js__["h" /* hasEnumBug */]) Object(__WEBPACK_IMPORTED_MODULE_2__collectNonEnumProps_js__["a" /* default */])(obj, keys);
3603 return keys;
3604}
3605
3606
3607/***/ }),
3608/* 81 */
3609/***/ (function(module, __webpack_exports__, __webpack_require__) {
3610
3611"use strict";
3612/* harmony export (immutable) */ __webpack_exports__["a"] = toPath;
3613/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__underscore_js__ = __webpack_require__(24);
3614/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__toPath_js__ = __webpack_require__(189);
3615
3616
3617
3618// Internal wrapper for `_.toPath` to enable minification.
3619// Similar to `cb` for `_.iteratee`.
3620function toPath(path) {
3621 return __WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */].toPath(path);
3622}
3623
3624
3625/***/ }),
3626/* 82 */
3627/***/ (function(module, __webpack_exports__, __webpack_require__) {
3628
3629"use strict";
3630/* harmony export (immutable) */ __webpack_exports__["a"] = optimizeCb;
3631// Internal function that returns an efficient (for current engines) version
3632// of the passed-in callback, to be repeatedly applied in other Underscore
3633// functions.
3634function optimizeCb(func, context, argCount) {
3635 if (context === void 0) return func;
3636 switch (argCount == null ? 3 : argCount) {
3637 case 1: return function(value) {
3638 return func.call(context, value);
3639 };
3640 // The 2-argument case is omitted because we’re not using it.
3641 case 3: return function(value, index, collection) {
3642 return func.call(context, value, index, collection);
3643 };
3644 case 4: return function(accumulator, value, index, collection) {
3645 return func.call(context, accumulator, value, index, collection);
3646 };
3647 }
3648 return function() {
3649 return func.apply(context, arguments);
3650 };
3651}
3652
3653
3654/***/ }),
3655/* 83 */
3656/***/ (function(module, __webpack_exports__, __webpack_require__) {
3657
3658"use strict";
3659/* harmony export (immutable) */ __webpack_exports__["a"] = filter;
3660/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__cb_js__ = __webpack_require__(20);
3661/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__each_js__ = __webpack_require__(54);
3662
3663
3664
3665// Return all the elements that pass a truth test.
3666function filter(obj, predicate, context) {
3667 var results = [];
3668 predicate = Object(__WEBPACK_IMPORTED_MODULE_0__cb_js__["a" /* default */])(predicate, context);
3669 Object(__WEBPACK_IMPORTED_MODULE_1__each_js__["a" /* default */])(obj, function(value, index, list) {
3670 if (predicate(value, index, list)) results.push(value);
3671 });
3672 return results;
3673}
3674
3675
3676/***/ }),
3677/* 84 */
3678/***/ (function(module, __webpack_exports__, __webpack_require__) {
3679
3680"use strict";
3681/* harmony export (immutable) */ __webpack_exports__["a"] = contains;
3682/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__ = __webpack_require__(25);
3683/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__values_js__ = __webpack_require__(62);
3684/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__indexOf_js__ = __webpack_require__(205);
3685
3686
3687
3688
3689// Determine if the array or object contains a given item (using `===`).
3690function contains(obj, item, fromIndex, guard) {
3691 if (!Object(__WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__["a" /* default */])(obj)) obj = Object(__WEBPACK_IMPORTED_MODULE_1__values_js__["a" /* default */])(obj);
3692 if (typeof fromIndex != 'number' || guard) fromIndex = 0;
3693 return Object(__WEBPACK_IMPORTED_MODULE_2__indexOf_js__["a" /* default */])(obj, item, fromIndex) >= 0;
3694}
3695
3696
3697/***/ }),
3698/* 85 */
3699/***/ (function(module, exports, __webpack_require__) {
3700
3701var classof = __webpack_require__(56);
3702
3703// `IsArray` abstract operation
3704// https://tc39.es/ecma262/#sec-isarray
3705// eslint-disable-next-line es-x/no-array-isarray -- safe
3706module.exports = Array.isArray || function isArray(argument) {
3707 return classof(argument) == 'Array';
3708};
3709
3710
3711/***/ }),
3712/* 86 */
3713/***/ (function(module, exports, __webpack_require__) {
3714
3715module.exports = __webpack_require__(376);
3716
3717/***/ }),
3718/* 87 */
3719/***/ (function(module, exports, __webpack_require__) {
3720
3721module.exports = __webpack_require__(229);
3722
3723/***/ }),
3724/* 88 */
3725/***/ (function(module, exports, __webpack_require__) {
3726
3727var toPrimitive = __webpack_require__(256);
3728var isSymbol = __webpack_require__(89);
3729
3730// `ToPropertyKey` abstract operation
3731// https://tc39.es/ecma262/#sec-topropertykey
3732module.exports = function (argument) {
3733 var key = toPrimitive(argument, 'string');
3734 return isSymbol(key) ? key : key + '';
3735};
3736
3737
3738/***/ }),
3739/* 89 */
3740/***/ (function(module, exports, __webpack_require__) {
3741
3742var getBuiltIn = __webpack_require__(18);
3743var isCallable = __webpack_require__(7);
3744var isPrototypeOf = __webpack_require__(21);
3745var USE_SYMBOL_AS_UID = __webpack_require__(147);
3746
3747var $Object = Object;
3748
3749module.exports = USE_SYMBOL_AS_UID ? function (it) {
3750 return typeof it == 'symbol';
3751} : function (it) {
3752 var $Symbol = getBuiltIn('Symbol');
3753 return isCallable($Symbol) && isPrototypeOf($Symbol.prototype, $Object(it));
3754};
3755
3756
3757/***/ }),
3758/* 90 */
3759/***/ (function(module, exports, __webpack_require__) {
3760
3761var global = __webpack_require__(6);
3762var userAgent = __webpack_require__(91);
3763
3764var process = global.process;
3765var Deno = global.Deno;
3766var versions = process && process.versions || Deno && Deno.version;
3767var v8 = versions && versions.v8;
3768var match, version;
3769
3770if (v8) {
3771 match = v8.split('.');
3772 // in old Chrome, versions of V8 isn't V8 = Chrome / 10
3773 // but their correct versions are not interesting for us
3774 version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
3775}
3776
3777// BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
3778// so check `userAgent` even if `.v8` exists, but 0
3779if (!version && userAgent) {
3780 match = userAgent.match(/Edge\/(\d+)/);
3781 if (!match || match[1] >= 74) {
3782 match = userAgent.match(/Chrome\/(\d+)/);
3783 if (match) version = +match[1];
3784 }
3785}
3786
3787module.exports = version;
3788
3789
3790/***/ }),
3791/* 91 */
3792/***/ (function(module, exports, __webpack_require__) {
3793
3794var getBuiltIn = __webpack_require__(18);
3795
3796module.exports = getBuiltIn('navigator', 'userAgent') || '';
3797
3798
3799/***/ }),
3800/* 92 */
3801/***/ (function(module, exports, __webpack_require__) {
3802
3803var uncurryThis = __webpack_require__(4);
3804
3805var id = 0;
3806var postfix = Math.random();
3807var toString = uncurryThis(1.0.toString);
3808
3809module.exports = function (key) {
3810 return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36);
3811};
3812
3813
3814/***/ }),
3815/* 93 */
3816/***/ (function(module, exports, __webpack_require__) {
3817
3818var hasOwn = __webpack_require__(14);
3819var isCallable = __webpack_require__(7);
3820var toObject = __webpack_require__(34);
3821var sharedKey = __webpack_require__(94);
3822var CORRECT_PROTOTYPE_GETTER = __webpack_require__(151);
3823
3824var IE_PROTO = sharedKey('IE_PROTO');
3825var $Object = Object;
3826var ObjectPrototype = $Object.prototype;
3827
3828// `Object.getPrototypeOf` method
3829// https://tc39.es/ecma262/#sec-object.getprototypeof
3830// eslint-disable-next-line es-x/no-object-getprototypeof -- safe
3831module.exports = CORRECT_PROTOTYPE_GETTER ? $Object.getPrototypeOf : function (O) {
3832 var object = toObject(O);
3833 if (hasOwn(object, IE_PROTO)) return object[IE_PROTO];
3834 var constructor = object.constructor;
3835 if (isCallable(constructor) && object instanceof constructor) {
3836 return constructor.prototype;
3837 } return object instanceof $Object ? ObjectPrototype : null;
3838};
3839
3840
3841/***/ }),
3842/* 94 */
3843/***/ (function(module, exports, __webpack_require__) {
3844
3845var shared = __webpack_require__(73);
3846var uid = __webpack_require__(92);
3847
3848var keys = shared('keys');
3849
3850module.exports = function (key) {
3851 return keys[key] || (keys[key] = uid(key));
3852};
3853
3854
3855/***/ }),
3856/* 95 */
3857/***/ (function(module, exports, __webpack_require__) {
3858
3859/* eslint-disable no-proto -- safe */
3860var uncurryThis = __webpack_require__(4);
3861var anObject = __webpack_require__(19);
3862var aPossiblePrototype = __webpack_require__(259);
3863
3864// `Object.setPrototypeOf` method
3865// https://tc39.es/ecma262/#sec-object.setprototypeof
3866// Works with __proto__ only. Old v8 can't work with null proto objects.
3867// eslint-disable-next-line es-x/no-object-setprototypeof -- safe
3868module.exports = Object.setPrototypeOf || ('__proto__' in {} ? function () {
3869 var CORRECT_SETTER = false;
3870 var test = {};
3871 var setter;
3872 try {
3873 // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
3874 setter = uncurryThis(Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set);
3875 setter(test, []);
3876 CORRECT_SETTER = test instanceof Array;
3877 } catch (error) { /* empty */ }
3878 return function setPrototypeOf(O, proto) {
3879 anObject(O);
3880 aPossiblePrototype(proto);
3881 if (CORRECT_SETTER) setter(O, proto);
3882 else O.__proto__ = proto;
3883 return O;
3884 };
3885}() : undefined);
3886
3887
3888/***/ }),
3889/* 96 */
3890/***/ (function(module, exports, __webpack_require__) {
3891
3892var internalObjectKeys = __webpack_require__(152);
3893var enumBugKeys = __webpack_require__(121);
3894
3895var hiddenKeys = enumBugKeys.concat('length', 'prototype');
3896
3897// `Object.getOwnPropertyNames` method
3898// https://tc39.es/ecma262/#sec-object.getownpropertynames
3899// eslint-disable-next-line es-x/no-object-getownpropertynames -- safe
3900exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
3901 return internalObjectKeys(O, hiddenKeys);
3902};
3903
3904
3905/***/ }),
3906/* 97 */
3907/***/ (function(module, exports) {
3908
3909// eslint-disable-next-line es-x/no-object-getownpropertysymbols -- safe
3910exports.f = Object.getOwnPropertySymbols;
3911
3912
3913/***/ }),
3914/* 98 */
3915/***/ (function(module, exports, __webpack_require__) {
3916
3917var internalObjectKeys = __webpack_require__(152);
3918var enumBugKeys = __webpack_require__(121);
3919
3920// `Object.keys` method
3921// https://tc39.es/ecma262/#sec-object.keys
3922// eslint-disable-next-line es-x/no-object-keys -- safe
3923module.exports = Object.keys || function keys(O) {
3924 return internalObjectKeys(O, enumBugKeys);
3925};
3926
3927
3928/***/ }),
3929/* 99 */
3930/***/ (function(module, exports, __webpack_require__) {
3931
3932var classof = __webpack_require__(59);
3933var getMethod = __webpack_require__(116);
3934var Iterators = __webpack_require__(58);
3935var wellKnownSymbol = __webpack_require__(9);
3936
3937var ITERATOR = wellKnownSymbol('iterator');
3938
3939module.exports = function (it) {
3940 if (it != undefined) return getMethod(it, ITERATOR)
3941 || getMethod(it, '@@iterator')
3942 || Iterators[classof(it)];
3943};
3944
3945
3946/***/ }),
3947/* 100 */
3948/***/ (function(module, exports, __webpack_require__) {
3949
3950var isPrototypeOf = __webpack_require__(21);
3951
3952var $TypeError = TypeError;
3953
3954module.exports = function (it, Prototype) {
3955 if (isPrototypeOf(Prototype, it)) return it;
3956 throw $TypeError('Incorrect invocation');
3957};
3958
3959
3960/***/ }),
3961/* 101 */
3962/***/ (function(module, exports, __webpack_require__) {
3963
3964var uncurryThis = __webpack_require__(4);
3965var fails = __webpack_require__(3);
3966var isCallable = __webpack_require__(7);
3967var classof = __webpack_require__(59);
3968var getBuiltIn = __webpack_require__(18);
3969var inspectSource = __webpack_require__(123);
3970
3971var noop = function () { /* empty */ };
3972var empty = [];
3973var construct = getBuiltIn('Reflect', 'construct');
3974var constructorRegExp = /^\s*(?:class|function)\b/;
3975var exec = uncurryThis(constructorRegExp.exec);
3976var INCORRECT_TO_STRING = !constructorRegExp.exec(noop);
3977
3978var isConstructorModern = function isConstructor(argument) {
3979 if (!isCallable(argument)) return false;
3980 try {
3981 construct(noop, empty, argument);
3982 return true;
3983 } catch (error) {
3984 return false;
3985 }
3986};
3987
3988var isConstructorLegacy = function isConstructor(argument) {
3989 if (!isCallable(argument)) return false;
3990 switch (classof(argument)) {
3991 case 'AsyncFunction':
3992 case 'GeneratorFunction':
3993 case 'AsyncGeneratorFunction': return false;
3994 }
3995 try {
3996 // we can't check .prototype since constructors produced by .bind haven't it
3997 // `Function#toString` throws on some built-it function in some legacy engines
3998 // (for example, `DOMQuad` and similar in FF41-)
3999 return INCORRECT_TO_STRING || !!exec(constructorRegExp, inspectSource(argument));
4000 } catch (error) {
4001 return true;
4002 }
4003};
4004
4005isConstructorLegacy.sham = true;
4006
4007// `IsConstructor` abstract operation
4008// https://tc39.es/ecma262/#sec-isconstructor
4009module.exports = !construct || fails(function () {
4010 var called;
4011 return isConstructorModern(isConstructorModern.call)
4012 || !isConstructorModern(Object)
4013 || !isConstructorModern(function () { called = true; })
4014 || called;
4015}) ? isConstructorLegacy : isConstructorModern;
4016
4017
4018/***/ }),
4019/* 102 */
4020/***/ (function(module, exports, __webpack_require__) {
4021
4022var uncurryThis = __webpack_require__(4);
4023
4024module.exports = uncurryThis([].slice);
4025
4026
4027/***/ }),
4028/* 103 */
4029/***/ (function(module, __webpack_exports__, __webpack_require__) {
4030
4031"use strict";
4032/* harmony export (immutable) */ __webpack_exports__["a"] = matcher;
4033/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__extendOwn_js__ = __webpack_require__(133);
4034/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isMatch_js__ = __webpack_require__(181);
4035
4036
4037
4038// Returns a predicate for checking whether an object has a given set of
4039// `key:value` pairs.
4040function matcher(attrs) {
4041 attrs = Object(__WEBPACK_IMPORTED_MODULE_0__extendOwn_js__["a" /* default */])({}, attrs);
4042 return function(obj) {
4043 return Object(__WEBPACK_IMPORTED_MODULE_1__isMatch_js__["a" /* default */])(obj, attrs);
4044 };
4045}
4046
4047
4048/***/ }),
4049/* 104 */
4050/***/ (function(module, __webpack_exports__, __webpack_require__) {
4051
4052"use strict";
4053/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(23);
4054/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__executeBound_js__ = __webpack_require__(197);
4055/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__underscore_js__ = __webpack_require__(24);
4056
4057
4058
4059
4060// Partially apply a function by creating a version that has had some of its
4061// arguments pre-filled, without changing its dynamic `this` context. `_` acts
4062// as a placeholder by default, allowing any combination of arguments to be
4063// pre-filled. Set `_.partial.placeholder` for a custom placeholder argument.
4064var partial = Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" /* default */])(function(func, boundArgs) {
4065 var placeholder = partial.placeholder;
4066 var bound = function() {
4067 var position = 0, length = boundArgs.length;
4068 var args = Array(length);
4069 for (var i = 0; i < length; i++) {
4070 args[i] = boundArgs[i] === placeholder ? arguments[position++] : boundArgs[i];
4071 }
4072 while (position < arguments.length) args.push(arguments[position++]);
4073 return Object(__WEBPACK_IMPORTED_MODULE_1__executeBound_js__["a" /* default */])(func, bound, this, this, args);
4074 };
4075 return bound;
4076});
4077
4078partial.placeholder = __WEBPACK_IMPORTED_MODULE_2__underscore_js__["a" /* default */];
4079/* harmony default export */ __webpack_exports__["a"] = (partial);
4080
4081
4082/***/ }),
4083/* 105 */
4084/***/ (function(module, __webpack_exports__, __webpack_require__) {
4085
4086"use strict";
4087/* harmony export (immutable) */ __webpack_exports__["a"] = group;
4088/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__cb_js__ = __webpack_require__(20);
4089/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__each_js__ = __webpack_require__(54);
4090
4091
4092
4093// An internal function used for aggregate "group by" operations.
4094function group(behavior, partition) {
4095 return function(obj, iteratee, context) {
4096 var result = partition ? [[], []] : {};
4097 iteratee = Object(__WEBPACK_IMPORTED_MODULE_0__cb_js__["a" /* default */])(iteratee, context);
4098 Object(__WEBPACK_IMPORTED_MODULE_1__each_js__["a" /* default */])(obj, function(value, index) {
4099 var key = iteratee(value, index, obj);
4100 behavior(result, value, key);
4101 });
4102 return result;
4103 };
4104}
4105
4106
4107/***/ }),
4108/* 106 */
4109/***/ (function(module, exports, __webpack_require__) {
4110
4111"use strict";
4112
4113var toPropertyKey = __webpack_require__(88);
4114var definePropertyModule = __webpack_require__(22);
4115var createPropertyDescriptor = __webpack_require__(44);
4116
4117module.exports = function (object, key, value) {
4118 var propertyKey = toPropertyKey(key);
4119 if (propertyKey in object) definePropertyModule.f(object, propertyKey, createPropertyDescriptor(0, value));
4120 else object[propertyKey] = value;
4121};
4122
4123
4124/***/ }),
4125/* 107 */
4126/***/ (function(module, exports, __webpack_require__) {
4127
4128var fails = __webpack_require__(3);
4129var wellKnownSymbol = __webpack_require__(9);
4130var V8_VERSION = __webpack_require__(90);
4131
4132var SPECIES = wellKnownSymbol('species');
4133
4134module.exports = function (METHOD_NAME) {
4135 // We can't use this feature detection in V8 since it causes
4136 // deoptimization and serious performance degradation
4137 // https://github.com/zloirock/core-js/issues/677
4138 return V8_VERSION >= 51 || !fails(function () {
4139 var array = [];
4140 var constructor = array.constructor = {};
4141 constructor[SPECIES] = function () {
4142 return { foo: 1 };
4143 };
4144 return array[METHOD_NAME](Boolean).foo !== 1;
4145 });
4146};
4147
4148
4149/***/ }),
4150/* 108 */
4151/***/ (function(module, exports, __webpack_require__) {
4152
4153"use strict";
4154
4155
4156var _interopRequireDefault = __webpack_require__(1);
4157
4158var _typeof2 = _interopRequireDefault(__webpack_require__(109));
4159
4160var _filter = _interopRequireDefault(__webpack_require__(437));
4161
4162var _map = _interopRequireDefault(__webpack_require__(42));
4163
4164var _keys = _interopRequireDefault(__webpack_require__(141));
4165
4166var _stringify = _interopRequireDefault(__webpack_require__(36));
4167
4168var _concat = _interopRequireDefault(__webpack_require__(30));
4169
4170var _ = __webpack_require__(2);
4171
4172var _require = __webpack_require__(442),
4173 timeout = _require.timeout;
4174
4175var debug = __webpack_require__(67);
4176
4177var debugRequest = debug('leancloud:request');
4178var debugRequestError = debug('leancloud:request:error');
4179
4180var _require2 = __webpack_require__(68),
4181 getAdapter = _require2.getAdapter;
4182
4183var requestsCount = 0;
4184
4185var ajax = function ajax(_ref) {
4186 var method = _ref.method,
4187 url = _ref.url,
4188 query = _ref.query,
4189 data = _ref.data,
4190 _ref$headers = _ref.headers,
4191 headers = _ref$headers === void 0 ? {} : _ref$headers,
4192 time = _ref.timeout,
4193 onprogress = _ref.onprogress;
4194
4195 if (query) {
4196 var _context, _context2, _context4;
4197
4198 var queryString = (0, _filter.default)(_context = (0, _map.default)(_context2 = (0, _keys.default)(query)).call(_context2, function (key) {
4199 var _context3;
4200
4201 var value = query[key];
4202 if (value === undefined) return undefined;
4203 var v = (0, _typeof2.default)(value) === 'object' ? (0, _stringify.default)(value) : value;
4204 return (0, _concat.default)(_context3 = "".concat(encodeURIComponent(key), "=")).call(_context3, encodeURIComponent(v));
4205 })).call(_context, function (qs) {
4206 return qs;
4207 }).join('&');
4208 url = (0, _concat.default)(_context4 = "".concat(url, "?")).call(_context4, queryString);
4209 }
4210
4211 var count = requestsCount++;
4212 debugRequest('request(%d) %s %s %o %o %o', count, method, url, query, data, headers);
4213 var request = getAdapter('request');
4214 var promise = request(url, {
4215 method: method,
4216 headers: headers,
4217 data: data,
4218 onprogress: onprogress
4219 }).then(function (response) {
4220 debugRequest('response(%d) %d %O %o', count, response.status, response.data || response.text, response.header);
4221
4222 if (response.ok === false) {
4223 var error = new Error();
4224 error.response = response;
4225 throw error;
4226 }
4227
4228 return response.data;
4229 }).catch(function (error) {
4230 if (error.response) {
4231 if (!debug.enabled('leancloud:request')) {
4232 debugRequestError('request(%d) %s %s %o %o %o', count, method, url, query, data, headers);
4233 }
4234
4235 debugRequestError('response(%d) %d %O %o', count, error.response.status, error.response.data || error.response.text, error.response.header);
4236 error.statusCode = error.response.status;
4237 error.responseText = error.response.text;
4238 error.response = error.response.data;
4239 }
4240
4241 throw error;
4242 });
4243 return time ? timeout(promise, time) : promise;
4244};
4245
4246module.exports = ajax;
4247
4248/***/ }),
4249/* 109 */
4250/***/ (function(module, exports, __webpack_require__) {
4251
4252var _Symbol = __webpack_require__(231);
4253
4254var _Symbol$iterator = __webpack_require__(432);
4255
4256function _typeof(obj) {
4257 "@babel/helpers - typeof";
4258
4259 return (module.exports = _typeof = "function" == typeof _Symbol && "symbol" == typeof _Symbol$iterator ? function (obj) {
4260 return typeof obj;
4261 } : function (obj) {
4262 return obj && "function" == typeof _Symbol && obj.constructor === _Symbol && obj !== _Symbol.prototype ? "symbol" : typeof obj;
4263 }, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(obj);
4264}
4265
4266module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
4267
4268/***/ }),
4269/* 110 */
4270/***/ (function(module, exports, __webpack_require__) {
4271
4272module.exports = __webpack_require__(447);
4273
4274/***/ }),
4275/* 111 */
4276/***/ (function(module, exports, __webpack_require__) {
4277
4278var $ = __webpack_require__(0);
4279var uncurryThis = __webpack_require__(4);
4280var hiddenKeys = __webpack_require__(74);
4281var isObject = __webpack_require__(11);
4282var hasOwn = __webpack_require__(14);
4283var defineProperty = __webpack_require__(22).f;
4284var getOwnPropertyNamesModule = __webpack_require__(96);
4285var getOwnPropertyNamesExternalModule = __webpack_require__(234);
4286var isExtensible = __webpack_require__(247);
4287var uid = __webpack_require__(92);
4288var FREEZING = __webpack_require__(562);
4289
4290var REQUIRED = false;
4291var METADATA = uid('meta');
4292var id = 0;
4293
4294var setMetadata = function (it) {
4295 defineProperty(it, METADATA, { value: {
4296 objectID: 'O' + id++, // object ID
4297 weakData: {} // weak collections IDs
4298 } });
4299};
4300
4301var fastKey = function (it, create) {
4302 // return a primitive with prefix
4303 if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;
4304 if (!hasOwn(it, METADATA)) {
4305 // can't set metadata to uncaught frozen object
4306 if (!isExtensible(it)) return 'F';
4307 // not necessary to add metadata
4308 if (!create) return 'E';
4309 // add missing metadata
4310 setMetadata(it);
4311 // return object ID
4312 } return it[METADATA].objectID;
4313};
4314
4315var getWeakData = function (it, create) {
4316 if (!hasOwn(it, METADATA)) {
4317 // can't set metadata to uncaught frozen object
4318 if (!isExtensible(it)) return true;
4319 // not necessary to add metadata
4320 if (!create) return false;
4321 // add missing metadata
4322 setMetadata(it);
4323 // return the store of weak collections IDs
4324 } return it[METADATA].weakData;
4325};
4326
4327// add metadata on freeze-family methods calling
4328var onFreeze = function (it) {
4329 if (FREEZING && REQUIRED && isExtensible(it) && !hasOwn(it, METADATA)) setMetadata(it);
4330 return it;
4331};
4332
4333var enable = function () {
4334 meta.enable = function () { /* empty */ };
4335 REQUIRED = true;
4336 var getOwnPropertyNames = getOwnPropertyNamesModule.f;
4337 var splice = uncurryThis([].splice);
4338 var test = {};
4339 test[METADATA] = 1;
4340
4341 // prevent exposing of metadata key
4342 if (getOwnPropertyNames(test).length) {
4343 getOwnPropertyNamesModule.f = function (it) {
4344 var result = getOwnPropertyNames(it);
4345 for (var i = 0, length = result.length; i < length; i++) {
4346 if (result[i] === METADATA) {
4347 splice(result, i, 1);
4348 break;
4349 }
4350 } return result;
4351 };
4352
4353 $({ target: 'Object', stat: true, forced: true }, {
4354 getOwnPropertyNames: getOwnPropertyNamesExternalModule.f
4355 });
4356 }
4357};
4358
4359var meta = module.exports = {
4360 enable: enable,
4361 fastKey: fastKey,
4362 getWeakData: getWeakData,
4363 onFreeze: onFreeze
4364};
4365
4366hiddenKeys[METADATA] = true;
4367
4368
4369/***/ }),
4370/* 112 */
4371/***/ (function(module, exports) {
4372
4373var g;
4374
4375// This works in non-strict mode
4376g = (function() {
4377 return this;
4378})();
4379
4380try {
4381 // This works if eval is allowed (see CSP)
4382 g = g || Function("return this")() || (1,eval)("this");
4383} catch(e) {
4384 // This works if the window reference is available
4385 if(typeof window === "object")
4386 g = window;
4387}
4388
4389// g can still be undefined, but nothing to do about it...
4390// We return undefined, instead of nothing here, so it's
4391// easier to handle this case. if(!global) { ...}
4392
4393module.exports = g;
4394
4395
4396/***/ }),
4397/* 113 */
4398/***/ (function(module, exports, __webpack_require__) {
4399
4400"use strict";
4401
4402var $propertyIsEnumerable = {}.propertyIsEnumerable;
4403// eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
4404var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
4405
4406// Nashorn ~ JDK8 bug
4407var NASHORN_BUG = getOwnPropertyDescriptor && !$propertyIsEnumerable.call({ 1: 2 }, 1);
4408
4409// `Object.prototype.propertyIsEnumerable` method implementation
4410// https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
4411exports.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
4412 var descriptor = getOwnPropertyDescriptor(this, V);
4413 return !!descriptor && descriptor.enumerable;
4414} : $propertyIsEnumerable;
4415
4416
4417/***/ }),
4418/* 114 */
4419/***/ (function(module, exports, __webpack_require__) {
4420
4421var uncurryThis = __webpack_require__(4);
4422var fails = __webpack_require__(3);
4423var classof = __webpack_require__(56);
4424
4425var $Object = Object;
4426var split = uncurryThis(''.split);
4427
4428// fallback for non-array-like ES3 and non-enumerable old V8 strings
4429module.exports = fails(function () {
4430 // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
4431 // eslint-disable-next-line no-prototype-builtins -- safe
4432 return !$Object('z').propertyIsEnumerable(0);
4433}) ? function (it) {
4434 return classof(it) == 'String' ? split(it, '') : $Object(it);
4435} : $Object;
4436
4437
4438/***/ }),
4439/* 115 */
4440/***/ (function(module, exports) {
4441
4442var $TypeError = TypeError;
4443
4444// `RequireObjectCoercible` abstract operation
4445// https://tc39.es/ecma262/#sec-requireobjectcoercible
4446module.exports = function (it) {
4447 if (it == undefined) throw $TypeError("Can't call method on " + it);
4448 return it;
4449};
4450
4451
4452/***/ }),
4453/* 116 */
4454/***/ (function(module, exports, __webpack_require__) {
4455
4456var aCallable = __webpack_require__(31);
4457
4458// `GetMethod` abstract operation
4459// https://tc39.es/ecma262/#sec-getmethod
4460module.exports = function (V, P) {
4461 var func = V[P];
4462 return func == null ? undefined : aCallable(func);
4463};
4464
4465
4466/***/ }),
4467/* 117 */
4468/***/ (function(module, exports, __webpack_require__) {
4469
4470var global = __webpack_require__(6);
4471var defineGlobalProperty = __webpack_require__(258);
4472
4473var SHARED = '__core-js_shared__';
4474var store = global[SHARED] || defineGlobalProperty(SHARED, {});
4475
4476module.exports = store;
4477
4478
4479/***/ }),
4480/* 118 */
4481/***/ (function(module, exports, __webpack_require__) {
4482
4483var global = __webpack_require__(6);
4484var isObject = __webpack_require__(11);
4485
4486var document = global.document;
4487// typeof document.createElement is 'object' in old IE
4488var EXISTS = isObject(document) && isObject(document.createElement);
4489
4490module.exports = function (it) {
4491 return EXISTS ? document.createElement(it) : {};
4492};
4493
4494
4495/***/ }),
4496/* 119 */
4497/***/ (function(module, exports, __webpack_require__) {
4498
4499var toIntegerOrInfinity = __webpack_require__(120);
4500
4501var max = Math.max;
4502var min = Math.min;
4503
4504// Helper for a popular repeating case of the spec:
4505// Let integer be ? ToInteger(index).
4506// If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
4507module.exports = function (index, length) {
4508 var integer = toIntegerOrInfinity(index);
4509 return integer < 0 ? max(integer + length, 0) : min(integer, length);
4510};
4511
4512
4513/***/ }),
4514/* 120 */
4515/***/ (function(module, exports, __webpack_require__) {
4516
4517var trunc = __webpack_require__(262);
4518
4519// `ToIntegerOrInfinity` abstract operation
4520// https://tc39.es/ecma262/#sec-tointegerorinfinity
4521module.exports = function (argument) {
4522 var number = +argument;
4523 // eslint-disable-next-line no-self-compare -- NaN check
4524 return number !== number || number === 0 ? 0 : trunc(number);
4525};
4526
4527
4528/***/ }),
4529/* 121 */
4530/***/ (function(module, exports) {
4531
4532// IE8- don't enum bug keys
4533module.exports = [
4534 'constructor',
4535 'hasOwnProperty',
4536 'isPrototypeOf',
4537 'propertyIsEnumerable',
4538 'toLocaleString',
4539 'toString',
4540 'valueOf'
4541];
4542
4543
4544/***/ }),
4545/* 122 */
4546/***/ (function(module, exports, __webpack_require__) {
4547
4548var wellKnownSymbol = __webpack_require__(9);
4549
4550var TO_STRING_TAG = wellKnownSymbol('toStringTag');
4551var test = {};
4552
4553test[TO_STRING_TAG] = 'z';
4554
4555module.exports = String(test) === '[object z]';
4556
4557
4558/***/ }),
4559/* 123 */
4560/***/ (function(module, exports, __webpack_require__) {
4561
4562var uncurryThis = __webpack_require__(4);
4563var isCallable = __webpack_require__(7);
4564var store = __webpack_require__(117);
4565
4566var functionToString = uncurryThis(Function.toString);
4567
4568// this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
4569if (!isCallable(store.inspectSource)) {
4570 store.inspectSource = function (it) {
4571 return functionToString(it);
4572 };
4573}
4574
4575module.exports = store.inspectSource;
4576
4577
4578/***/ }),
4579/* 124 */
4580/***/ (function(module, exports, __webpack_require__) {
4581
4582"use strict";
4583
4584var $ = __webpack_require__(0);
4585var call = __webpack_require__(13);
4586var IS_PURE = __webpack_require__(32);
4587var FunctionName = __webpack_require__(268);
4588var isCallable = __webpack_require__(7);
4589var createIteratorConstructor = __webpack_require__(269);
4590var getPrototypeOf = __webpack_require__(93);
4591var setPrototypeOf = __webpack_require__(95);
4592var setToStringTag = __webpack_require__(49);
4593var createNonEnumerableProperty = __webpack_require__(35);
4594var defineBuiltIn = __webpack_require__(39);
4595var wellKnownSymbol = __webpack_require__(9);
4596var Iterators = __webpack_require__(58);
4597var IteratorsCore = __webpack_require__(161);
4598
4599var PROPER_FUNCTION_NAME = FunctionName.PROPER;
4600var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE;
4601var IteratorPrototype = IteratorsCore.IteratorPrototype;
4602var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;
4603var ITERATOR = wellKnownSymbol('iterator');
4604var KEYS = 'keys';
4605var VALUES = 'values';
4606var ENTRIES = 'entries';
4607
4608var returnThis = function () { return this; };
4609
4610module.exports = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
4611 createIteratorConstructor(IteratorConstructor, NAME, next);
4612
4613 var getIterationMethod = function (KIND) {
4614 if (KIND === DEFAULT && defaultIterator) return defaultIterator;
4615 if (!BUGGY_SAFARI_ITERATORS && KIND in IterablePrototype) return IterablePrototype[KIND];
4616 switch (KIND) {
4617 case KEYS: return function keys() { return new IteratorConstructor(this, KIND); };
4618 case VALUES: return function values() { return new IteratorConstructor(this, KIND); };
4619 case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); };
4620 } return function () { return new IteratorConstructor(this); };
4621 };
4622
4623 var TO_STRING_TAG = NAME + ' Iterator';
4624 var INCORRECT_VALUES_NAME = false;
4625 var IterablePrototype = Iterable.prototype;
4626 var nativeIterator = IterablePrototype[ITERATOR]
4627 || IterablePrototype['@@iterator']
4628 || DEFAULT && IterablePrototype[DEFAULT];
4629 var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);
4630 var anyNativeIterator = NAME == 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;
4631 var CurrentIteratorPrototype, methods, KEY;
4632
4633 // fix native
4634 if (anyNativeIterator) {
4635 CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable()));
4636 if (CurrentIteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {
4637 if (!IS_PURE && getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {
4638 if (setPrototypeOf) {
4639 setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype);
4640 } else if (!isCallable(CurrentIteratorPrototype[ITERATOR])) {
4641 defineBuiltIn(CurrentIteratorPrototype, ITERATOR, returnThis);
4642 }
4643 }
4644 // Set @@toStringTag to native iterators
4645 setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true, true);
4646 if (IS_PURE) Iterators[TO_STRING_TAG] = returnThis;
4647 }
4648 }
4649
4650 // fix Array.prototype.{ values, @@iterator }.name in V8 / FF
4651 if (PROPER_FUNCTION_NAME && DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) {
4652 if (!IS_PURE && CONFIGURABLE_FUNCTION_NAME) {
4653 createNonEnumerableProperty(IterablePrototype, 'name', VALUES);
4654 } else {
4655 INCORRECT_VALUES_NAME = true;
4656 defaultIterator = function values() { return call(nativeIterator, this); };
4657 }
4658 }
4659
4660 // export additional methods
4661 if (DEFAULT) {
4662 methods = {
4663 values: getIterationMethod(VALUES),
4664 keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),
4665 entries: getIterationMethod(ENTRIES)
4666 };
4667 if (FORCED) for (KEY in methods) {
4668 if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
4669 defineBuiltIn(IterablePrototype, KEY, methods[KEY]);
4670 }
4671 } else $({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
4672 }
4673
4674 // define iterator
4675 if ((!IS_PURE || FORCED) && IterablePrototype[ITERATOR] !== defaultIterator) {
4676 defineBuiltIn(IterablePrototype, ITERATOR, defaultIterator, { name: DEFAULT });
4677 }
4678 Iterators[NAME] = defaultIterator;
4679
4680 return methods;
4681};
4682
4683
4684/***/ }),
4685/* 125 */
4686/***/ (function(module, exports, __webpack_require__) {
4687
4688var classof = __webpack_require__(56);
4689var global = __webpack_require__(6);
4690
4691module.exports = classof(global.process) == 'process';
4692
4693
4694/***/ }),
4695/* 126 */
4696/***/ (function(module, __webpack_exports__, __webpack_require__) {
4697
4698"use strict";
4699Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
4700/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(5);
4701/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "VERSION", function() { return __WEBPACK_IMPORTED_MODULE_0__setup_js__["e"]; });
4702/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__restArguments_js__ = __webpack_require__(23);
4703/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "restArguments", function() { return __WEBPACK_IMPORTED_MODULE_1__restArguments_js__["a"]; });
4704/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__isObject_js__ = __webpack_require__(52);
4705/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isObject", function() { return __WEBPACK_IMPORTED_MODULE_2__isObject_js__["a"]; });
4706/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__isNull_js__ = __webpack_require__(291);
4707/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isNull", function() { return __WEBPACK_IMPORTED_MODULE_3__isNull_js__["a"]; });
4708/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__isUndefined_js__ = __webpack_require__(170);
4709/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isUndefined", function() { return __WEBPACK_IMPORTED_MODULE_4__isUndefined_js__["a"]; });
4710/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__isBoolean_js__ = __webpack_require__(171);
4711/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isBoolean", function() { return __WEBPACK_IMPORTED_MODULE_5__isBoolean_js__["a"]; });
4712/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__isElement_js__ = __webpack_require__(292);
4713/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isElement", function() { return __WEBPACK_IMPORTED_MODULE_6__isElement_js__["a"]; });
4714/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__isString_js__ = __webpack_require__(127);
4715/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isString", function() { return __WEBPACK_IMPORTED_MODULE_7__isString_js__["a"]; });
4716/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__isNumber_js__ = __webpack_require__(172);
4717/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isNumber", function() { return __WEBPACK_IMPORTED_MODULE_8__isNumber_js__["a"]; });
4718/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__isDate_js__ = __webpack_require__(293);
4719/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isDate", function() { return __WEBPACK_IMPORTED_MODULE_9__isDate_js__["a"]; });
4720/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__isRegExp_js__ = __webpack_require__(294);
4721/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isRegExp", function() { return __WEBPACK_IMPORTED_MODULE_10__isRegExp_js__["a"]; });
4722/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__isError_js__ = __webpack_require__(295);
4723/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isError", function() { return __WEBPACK_IMPORTED_MODULE_11__isError_js__["a"]; });
4724/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__isSymbol_js__ = __webpack_require__(173);
4725/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isSymbol", function() { return __WEBPACK_IMPORTED_MODULE_12__isSymbol_js__["a"]; });
4726/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__isArrayBuffer_js__ = __webpack_require__(174);
4727/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isArrayBuffer", function() { return __WEBPACK_IMPORTED_MODULE_13__isArrayBuffer_js__["a"]; });
4728/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__isDataView_js__ = __webpack_require__(128);
4729/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isDataView", function() { return __WEBPACK_IMPORTED_MODULE_14__isDataView_js__["a"]; });
4730/* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__isArray_js__ = __webpack_require__(53);
4731/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isArray", function() { return __WEBPACK_IMPORTED_MODULE_15__isArray_js__["a"]; });
4732/* harmony import */ var __WEBPACK_IMPORTED_MODULE_16__isFunction_js__ = __webpack_require__(27);
4733/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isFunction", function() { return __WEBPACK_IMPORTED_MODULE_16__isFunction_js__["a"]; });
4734/* harmony import */ var __WEBPACK_IMPORTED_MODULE_17__isArguments_js__ = __webpack_require__(129);
4735/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isArguments", function() { return __WEBPACK_IMPORTED_MODULE_17__isArguments_js__["a"]; });
4736/* harmony import */ var __WEBPACK_IMPORTED_MODULE_18__isFinite_js__ = __webpack_require__(297);
4737/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isFinite", function() { return __WEBPACK_IMPORTED_MODULE_18__isFinite_js__["a"]; });
4738/* harmony import */ var __WEBPACK_IMPORTED_MODULE_19__isNaN_js__ = __webpack_require__(175);
4739/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isNaN", function() { return __WEBPACK_IMPORTED_MODULE_19__isNaN_js__["a"]; });
4740/* harmony import */ var __WEBPACK_IMPORTED_MODULE_20__isTypedArray_js__ = __webpack_require__(176);
4741/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isTypedArray", function() { return __WEBPACK_IMPORTED_MODULE_20__isTypedArray_js__["a"]; });
4742/* harmony import */ var __WEBPACK_IMPORTED_MODULE_21__isEmpty_js__ = __webpack_require__(299);
4743/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isEmpty", function() { return __WEBPACK_IMPORTED_MODULE_21__isEmpty_js__["a"]; });
4744/* harmony import */ var __WEBPACK_IMPORTED_MODULE_22__isMatch_js__ = __webpack_require__(181);
4745/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isMatch", function() { return __WEBPACK_IMPORTED_MODULE_22__isMatch_js__["a"]; });
4746/* harmony import */ var __WEBPACK_IMPORTED_MODULE_23__isEqual_js__ = __webpack_require__(300);
4747/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isEqual", function() { return __WEBPACK_IMPORTED_MODULE_23__isEqual_js__["a"]; });
4748/* harmony import */ var __WEBPACK_IMPORTED_MODULE_24__isMap_js__ = __webpack_require__(302);
4749/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isMap", function() { return __WEBPACK_IMPORTED_MODULE_24__isMap_js__["a"]; });
4750/* harmony import */ var __WEBPACK_IMPORTED_MODULE_25__isWeakMap_js__ = __webpack_require__(303);
4751/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isWeakMap", function() { return __WEBPACK_IMPORTED_MODULE_25__isWeakMap_js__["a"]; });
4752/* harmony import */ var __WEBPACK_IMPORTED_MODULE_26__isSet_js__ = __webpack_require__(304);
4753/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isSet", function() { return __WEBPACK_IMPORTED_MODULE_26__isSet_js__["a"]; });
4754/* harmony import */ var __WEBPACK_IMPORTED_MODULE_27__isWeakSet_js__ = __webpack_require__(305);
4755/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isWeakSet", function() { return __WEBPACK_IMPORTED_MODULE_27__isWeakSet_js__["a"]; });
4756/* harmony import */ var __WEBPACK_IMPORTED_MODULE_28__keys_js__ = __webpack_require__(15);
4757/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "keys", function() { return __WEBPACK_IMPORTED_MODULE_28__keys_js__["a"]; });
4758/* harmony import */ var __WEBPACK_IMPORTED_MODULE_29__allKeys_js__ = __webpack_require__(80);
4759/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "allKeys", function() { return __WEBPACK_IMPORTED_MODULE_29__allKeys_js__["a"]; });
4760/* harmony import */ var __WEBPACK_IMPORTED_MODULE_30__values_js__ = __webpack_require__(62);
4761/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "values", function() { return __WEBPACK_IMPORTED_MODULE_30__values_js__["a"]; });
4762/* harmony import */ var __WEBPACK_IMPORTED_MODULE_31__pairs_js__ = __webpack_require__(306);
4763/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "pairs", function() { return __WEBPACK_IMPORTED_MODULE_31__pairs_js__["a"]; });
4764/* harmony import */ var __WEBPACK_IMPORTED_MODULE_32__invert_js__ = __webpack_require__(182);
4765/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "invert", function() { return __WEBPACK_IMPORTED_MODULE_32__invert_js__["a"]; });
4766/* harmony import */ var __WEBPACK_IMPORTED_MODULE_33__functions_js__ = __webpack_require__(183);
4767/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "functions", function() { return __WEBPACK_IMPORTED_MODULE_33__functions_js__["a"]; });
4768/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "methods", function() { return __WEBPACK_IMPORTED_MODULE_33__functions_js__["a"]; });
4769/* harmony import */ var __WEBPACK_IMPORTED_MODULE_34__extend_js__ = __webpack_require__(184);
4770/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "extend", function() { return __WEBPACK_IMPORTED_MODULE_34__extend_js__["a"]; });
4771/* harmony import */ var __WEBPACK_IMPORTED_MODULE_35__extendOwn_js__ = __webpack_require__(133);
4772/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "extendOwn", function() { return __WEBPACK_IMPORTED_MODULE_35__extendOwn_js__["a"]; });
4773/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "assign", function() { return __WEBPACK_IMPORTED_MODULE_35__extendOwn_js__["a"]; });
4774/* harmony import */ var __WEBPACK_IMPORTED_MODULE_36__defaults_js__ = __webpack_require__(185);
4775/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "defaults", function() { return __WEBPACK_IMPORTED_MODULE_36__defaults_js__["a"]; });
4776/* harmony import */ var __WEBPACK_IMPORTED_MODULE_37__create_js__ = __webpack_require__(307);
4777/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "create", function() { return __WEBPACK_IMPORTED_MODULE_37__create_js__["a"]; });
4778/* harmony import */ var __WEBPACK_IMPORTED_MODULE_38__clone_js__ = __webpack_require__(187);
4779/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "clone", function() { return __WEBPACK_IMPORTED_MODULE_38__clone_js__["a"]; });
4780/* harmony import */ var __WEBPACK_IMPORTED_MODULE_39__tap_js__ = __webpack_require__(308);
4781/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "tap", function() { return __WEBPACK_IMPORTED_MODULE_39__tap_js__["a"]; });
4782/* harmony import */ var __WEBPACK_IMPORTED_MODULE_40__get_js__ = __webpack_require__(188);
4783/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "get", function() { return __WEBPACK_IMPORTED_MODULE_40__get_js__["a"]; });
4784/* harmony import */ var __WEBPACK_IMPORTED_MODULE_41__has_js__ = __webpack_require__(309);
4785/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "has", function() { return __WEBPACK_IMPORTED_MODULE_41__has_js__["a"]; });
4786/* harmony import */ var __WEBPACK_IMPORTED_MODULE_42__mapObject_js__ = __webpack_require__(310);
4787/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "mapObject", function() { return __WEBPACK_IMPORTED_MODULE_42__mapObject_js__["a"]; });
4788/* harmony import */ var __WEBPACK_IMPORTED_MODULE_43__identity_js__ = __webpack_require__(135);
4789/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "identity", function() { return __WEBPACK_IMPORTED_MODULE_43__identity_js__["a"]; });
4790/* harmony import */ var __WEBPACK_IMPORTED_MODULE_44__constant_js__ = __webpack_require__(177);
4791/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "constant", function() { return __WEBPACK_IMPORTED_MODULE_44__constant_js__["a"]; });
4792/* harmony import */ var __WEBPACK_IMPORTED_MODULE_45__noop_js__ = __webpack_require__(192);
4793/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "noop", function() { return __WEBPACK_IMPORTED_MODULE_45__noop_js__["a"]; });
4794/* harmony import */ var __WEBPACK_IMPORTED_MODULE_46__toPath_js__ = __webpack_require__(189);
4795/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "toPath", function() { return __WEBPACK_IMPORTED_MODULE_46__toPath_js__["a"]; });
4796/* harmony import */ var __WEBPACK_IMPORTED_MODULE_47__property_js__ = __webpack_require__(136);
4797/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "property", function() { return __WEBPACK_IMPORTED_MODULE_47__property_js__["a"]; });
4798/* harmony import */ var __WEBPACK_IMPORTED_MODULE_48__propertyOf_js__ = __webpack_require__(311);
4799/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "propertyOf", function() { return __WEBPACK_IMPORTED_MODULE_48__propertyOf_js__["a"]; });
4800/* harmony import */ var __WEBPACK_IMPORTED_MODULE_49__matcher_js__ = __webpack_require__(103);
4801/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "matcher", function() { return __WEBPACK_IMPORTED_MODULE_49__matcher_js__["a"]; });
4802/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "matches", function() { return __WEBPACK_IMPORTED_MODULE_49__matcher_js__["a"]; });
4803/* harmony import */ var __WEBPACK_IMPORTED_MODULE_50__times_js__ = __webpack_require__(312);
4804/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "times", function() { return __WEBPACK_IMPORTED_MODULE_50__times_js__["a"]; });
4805/* harmony import */ var __WEBPACK_IMPORTED_MODULE_51__random_js__ = __webpack_require__(193);
4806/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "random", function() { return __WEBPACK_IMPORTED_MODULE_51__random_js__["a"]; });
4807/* harmony import */ var __WEBPACK_IMPORTED_MODULE_52__now_js__ = __webpack_require__(137);
4808/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "now", function() { return __WEBPACK_IMPORTED_MODULE_52__now_js__["a"]; });
4809/* harmony import */ var __WEBPACK_IMPORTED_MODULE_53__escape_js__ = __webpack_require__(313);
4810/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "escape", function() { return __WEBPACK_IMPORTED_MODULE_53__escape_js__["a"]; });
4811/* harmony import */ var __WEBPACK_IMPORTED_MODULE_54__unescape_js__ = __webpack_require__(314);
4812/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "unescape", function() { return __WEBPACK_IMPORTED_MODULE_54__unescape_js__["a"]; });
4813/* harmony import */ var __WEBPACK_IMPORTED_MODULE_55__templateSettings_js__ = __webpack_require__(196);
4814/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "templateSettings", function() { return __WEBPACK_IMPORTED_MODULE_55__templateSettings_js__["a"]; });
4815/* harmony import */ var __WEBPACK_IMPORTED_MODULE_56__template_js__ = __webpack_require__(316);
4816/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "template", function() { return __WEBPACK_IMPORTED_MODULE_56__template_js__["a"]; });
4817/* harmony import */ var __WEBPACK_IMPORTED_MODULE_57__result_js__ = __webpack_require__(317);
4818/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "result", function() { return __WEBPACK_IMPORTED_MODULE_57__result_js__["a"]; });
4819/* harmony import */ var __WEBPACK_IMPORTED_MODULE_58__uniqueId_js__ = __webpack_require__(318);
4820/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "uniqueId", function() { return __WEBPACK_IMPORTED_MODULE_58__uniqueId_js__["a"]; });
4821/* harmony import */ var __WEBPACK_IMPORTED_MODULE_59__chain_js__ = __webpack_require__(319);
4822/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "chain", function() { return __WEBPACK_IMPORTED_MODULE_59__chain_js__["a"]; });
4823/* harmony import */ var __WEBPACK_IMPORTED_MODULE_60__iteratee_js__ = __webpack_require__(191);
4824/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "iteratee", function() { return __WEBPACK_IMPORTED_MODULE_60__iteratee_js__["a"]; });
4825/* harmony import */ var __WEBPACK_IMPORTED_MODULE_61__partial_js__ = __webpack_require__(104);
4826/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "partial", function() { return __WEBPACK_IMPORTED_MODULE_61__partial_js__["a"]; });
4827/* harmony import */ var __WEBPACK_IMPORTED_MODULE_62__bind_js__ = __webpack_require__(198);
4828/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "bind", function() { return __WEBPACK_IMPORTED_MODULE_62__bind_js__["a"]; });
4829/* harmony import */ var __WEBPACK_IMPORTED_MODULE_63__bindAll_js__ = __webpack_require__(320);
4830/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "bindAll", function() { return __WEBPACK_IMPORTED_MODULE_63__bindAll_js__["a"]; });
4831/* harmony import */ var __WEBPACK_IMPORTED_MODULE_64__memoize_js__ = __webpack_require__(321);
4832/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "memoize", function() { return __WEBPACK_IMPORTED_MODULE_64__memoize_js__["a"]; });
4833/* harmony import */ var __WEBPACK_IMPORTED_MODULE_65__delay_js__ = __webpack_require__(199);
4834/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "delay", function() { return __WEBPACK_IMPORTED_MODULE_65__delay_js__["a"]; });
4835/* harmony import */ var __WEBPACK_IMPORTED_MODULE_66__defer_js__ = __webpack_require__(322);
4836/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "defer", function() { return __WEBPACK_IMPORTED_MODULE_66__defer_js__["a"]; });
4837/* harmony import */ var __WEBPACK_IMPORTED_MODULE_67__throttle_js__ = __webpack_require__(323);
4838/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "throttle", function() { return __WEBPACK_IMPORTED_MODULE_67__throttle_js__["a"]; });
4839/* harmony import */ var __WEBPACK_IMPORTED_MODULE_68__debounce_js__ = __webpack_require__(324);
4840/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "debounce", function() { return __WEBPACK_IMPORTED_MODULE_68__debounce_js__["a"]; });
4841/* harmony import */ var __WEBPACK_IMPORTED_MODULE_69__wrap_js__ = __webpack_require__(325);
4842/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "wrap", function() { return __WEBPACK_IMPORTED_MODULE_69__wrap_js__["a"]; });
4843/* harmony import */ var __WEBPACK_IMPORTED_MODULE_70__negate_js__ = __webpack_require__(138);
4844/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "negate", function() { return __WEBPACK_IMPORTED_MODULE_70__negate_js__["a"]; });
4845/* harmony import */ var __WEBPACK_IMPORTED_MODULE_71__compose_js__ = __webpack_require__(326);
4846/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "compose", function() { return __WEBPACK_IMPORTED_MODULE_71__compose_js__["a"]; });
4847/* harmony import */ var __WEBPACK_IMPORTED_MODULE_72__after_js__ = __webpack_require__(327);
4848/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "after", function() { return __WEBPACK_IMPORTED_MODULE_72__after_js__["a"]; });
4849/* harmony import */ var __WEBPACK_IMPORTED_MODULE_73__before_js__ = __webpack_require__(200);
4850/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "before", function() { return __WEBPACK_IMPORTED_MODULE_73__before_js__["a"]; });
4851/* harmony import */ var __WEBPACK_IMPORTED_MODULE_74__once_js__ = __webpack_require__(328);
4852/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "once", function() { return __WEBPACK_IMPORTED_MODULE_74__once_js__["a"]; });
4853/* harmony import */ var __WEBPACK_IMPORTED_MODULE_75__findKey_js__ = __webpack_require__(201);
4854/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "findKey", function() { return __WEBPACK_IMPORTED_MODULE_75__findKey_js__["a"]; });
4855/* harmony import */ var __WEBPACK_IMPORTED_MODULE_76__findIndex_js__ = __webpack_require__(139);
4856/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "findIndex", function() { return __WEBPACK_IMPORTED_MODULE_76__findIndex_js__["a"]; });
4857/* harmony import */ var __WEBPACK_IMPORTED_MODULE_77__findLastIndex_js__ = __webpack_require__(203);
4858/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "findLastIndex", function() { return __WEBPACK_IMPORTED_MODULE_77__findLastIndex_js__["a"]; });
4859/* harmony import */ var __WEBPACK_IMPORTED_MODULE_78__sortedIndex_js__ = __webpack_require__(204);
4860/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "sortedIndex", function() { return __WEBPACK_IMPORTED_MODULE_78__sortedIndex_js__["a"]; });
4861/* harmony import */ var __WEBPACK_IMPORTED_MODULE_79__indexOf_js__ = __webpack_require__(205);
4862/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "indexOf", function() { return __WEBPACK_IMPORTED_MODULE_79__indexOf_js__["a"]; });
4863/* harmony import */ var __WEBPACK_IMPORTED_MODULE_80__lastIndexOf_js__ = __webpack_require__(329);
4864/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "lastIndexOf", function() { return __WEBPACK_IMPORTED_MODULE_80__lastIndexOf_js__["a"]; });
4865/* harmony import */ var __WEBPACK_IMPORTED_MODULE_81__find_js__ = __webpack_require__(207);
4866/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "find", function() { return __WEBPACK_IMPORTED_MODULE_81__find_js__["a"]; });
4867/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "detect", function() { return __WEBPACK_IMPORTED_MODULE_81__find_js__["a"]; });
4868/* harmony import */ var __WEBPACK_IMPORTED_MODULE_82__findWhere_js__ = __webpack_require__(330);
4869/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "findWhere", function() { return __WEBPACK_IMPORTED_MODULE_82__findWhere_js__["a"]; });
4870/* harmony import */ var __WEBPACK_IMPORTED_MODULE_83__each_js__ = __webpack_require__(54);
4871/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "each", function() { return __WEBPACK_IMPORTED_MODULE_83__each_js__["a"]; });
4872/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "forEach", function() { return __WEBPACK_IMPORTED_MODULE_83__each_js__["a"]; });
4873/* harmony import */ var __WEBPACK_IMPORTED_MODULE_84__map_js__ = __webpack_require__(64);
4874/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "map", function() { return __WEBPACK_IMPORTED_MODULE_84__map_js__["a"]; });
4875/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "collect", function() { return __WEBPACK_IMPORTED_MODULE_84__map_js__["a"]; });
4876/* harmony import */ var __WEBPACK_IMPORTED_MODULE_85__reduce_js__ = __webpack_require__(331);
4877/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "reduce", function() { return __WEBPACK_IMPORTED_MODULE_85__reduce_js__["a"]; });
4878/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "foldl", function() { return __WEBPACK_IMPORTED_MODULE_85__reduce_js__["a"]; });
4879/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "inject", function() { return __WEBPACK_IMPORTED_MODULE_85__reduce_js__["a"]; });
4880/* harmony import */ var __WEBPACK_IMPORTED_MODULE_86__reduceRight_js__ = __webpack_require__(332);
4881/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "reduceRight", function() { return __WEBPACK_IMPORTED_MODULE_86__reduceRight_js__["a"]; });
4882/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "foldr", function() { return __WEBPACK_IMPORTED_MODULE_86__reduceRight_js__["a"]; });
4883/* harmony import */ var __WEBPACK_IMPORTED_MODULE_87__filter_js__ = __webpack_require__(83);
4884/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "filter", function() { return __WEBPACK_IMPORTED_MODULE_87__filter_js__["a"]; });
4885/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "select", function() { return __WEBPACK_IMPORTED_MODULE_87__filter_js__["a"]; });
4886/* harmony import */ var __WEBPACK_IMPORTED_MODULE_88__reject_js__ = __webpack_require__(333);
4887/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "reject", function() { return __WEBPACK_IMPORTED_MODULE_88__reject_js__["a"]; });
4888/* harmony import */ var __WEBPACK_IMPORTED_MODULE_89__every_js__ = __webpack_require__(334);
4889/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "every", function() { return __WEBPACK_IMPORTED_MODULE_89__every_js__["a"]; });
4890/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "all", function() { return __WEBPACK_IMPORTED_MODULE_89__every_js__["a"]; });
4891/* harmony import */ var __WEBPACK_IMPORTED_MODULE_90__some_js__ = __webpack_require__(335);
4892/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "some", function() { return __WEBPACK_IMPORTED_MODULE_90__some_js__["a"]; });
4893/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "any", function() { return __WEBPACK_IMPORTED_MODULE_90__some_js__["a"]; });
4894/* harmony import */ var __WEBPACK_IMPORTED_MODULE_91__contains_js__ = __webpack_require__(84);
4895/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "contains", function() { return __WEBPACK_IMPORTED_MODULE_91__contains_js__["a"]; });
4896/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "includes", function() { return __WEBPACK_IMPORTED_MODULE_91__contains_js__["a"]; });
4897/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "include", function() { return __WEBPACK_IMPORTED_MODULE_91__contains_js__["a"]; });
4898/* harmony import */ var __WEBPACK_IMPORTED_MODULE_92__invoke_js__ = __webpack_require__(336);
4899/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "invoke", function() { return __WEBPACK_IMPORTED_MODULE_92__invoke_js__["a"]; });
4900/* harmony import */ var __WEBPACK_IMPORTED_MODULE_93__pluck_js__ = __webpack_require__(140);
4901/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "pluck", function() { return __WEBPACK_IMPORTED_MODULE_93__pluck_js__["a"]; });
4902/* harmony import */ var __WEBPACK_IMPORTED_MODULE_94__where_js__ = __webpack_require__(337);
4903/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "where", function() { return __WEBPACK_IMPORTED_MODULE_94__where_js__["a"]; });
4904/* harmony import */ var __WEBPACK_IMPORTED_MODULE_95__max_js__ = __webpack_require__(209);
4905/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "max", function() { return __WEBPACK_IMPORTED_MODULE_95__max_js__["a"]; });
4906/* harmony import */ var __WEBPACK_IMPORTED_MODULE_96__min_js__ = __webpack_require__(338);
4907/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "min", function() { return __WEBPACK_IMPORTED_MODULE_96__min_js__["a"]; });
4908/* harmony import */ var __WEBPACK_IMPORTED_MODULE_97__shuffle_js__ = __webpack_require__(339);
4909/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "shuffle", function() { return __WEBPACK_IMPORTED_MODULE_97__shuffle_js__["a"]; });
4910/* harmony import */ var __WEBPACK_IMPORTED_MODULE_98__sample_js__ = __webpack_require__(210);
4911/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "sample", function() { return __WEBPACK_IMPORTED_MODULE_98__sample_js__["a"]; });
4912/* harmony import */ var __WEBPACK_IMPORTED_MODULE_99__sortBy_js__ = __webpack_require__(340);
4913/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "sortBy", function() { return __WEBPACK_IMPORTED_MODULE_99__sortBy_js__["a"]; });
4914/* harmony import */ var __WEBPACK_IMPORTED_MODULE_100__groupBy_js__ = __webpack_require__(341);
4915/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "groupBy", function() { return __WEBPACK_IMPORTED_MODULE_100__groupBy_js__["a"]; });
4916/* harmony import */ var __WEBPACK_IMPORTED_MODULE_101__indexBy_js__ = __webpack_require__(342);
4917/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "indexBy", function() { return __WEBPACK_IMPORTED_MODULE_101__indexBy_js__["a"]; });
4918/* harmony import */ var __WEBPACK_IMPORTED_MODULE_102__countBy_js__ = __webpack_require__(343);
4919/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "countBy", function() { return __WEBPACK_IMPORTED_MODULE_102__countBy_js__["a"]; });
4920/* harmony import */ var __WEBPACK_IMPORTED_MODULE_103__partition_js__ = __webpack_require__(344);
4921/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "partition", function() { return __WEBPACK_IMPORTED_MODULE_103__partition_js__["a"]; });
4922/* harmony import */ var __WEBPACK_IMPORTED_MODULE_104__toArray_js__ = __webpack_require__(345);
4923/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "toArray", function() { return __WEBPACK_IMPORTED_MODULE_104__toArray_js__["a"]; });
4924/* harmony import */ var __WEBPACK_IMPORTED_MODULE_105__size_js__ = __webpack_require__(346);
4925/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "size", function() { return __WEBPACK_IMPORTED_MODULE_105__size_js__["a"]; });
4926/* harmony import */ var __WEBPACK_IMPORTED_MODULE_106__pick_js__ = __webpack_require__(211);
4927/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "pick", function() { return __WEBPACK_IMPORTED_MODULE_106__pick_js__["a"]; });
4928/* harmony import */ var __WEBPACK_IMPORTED_MODULE_107__omit_js__ = __webpack_require__(348);
4929/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "omit", function() { return __WEBPACK_IMPORTED_MODULE_107__omit_js__["a"]; });
4930/* harmony import */ var __WEBPACK_IMPORTED_MODULE_108__first_js__ = __webpack_require__(349);
4931/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "first", function() { return __WEBPACK_IMPORTED_MODULE_108__first_js__["a"]; });
4932/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "head", function() { return __WEBPACK_IMPORTED_MODULE_108__first_js__["a"]; });
4933/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "take", function() { return __WEBPACK_IMPORTED_MODULE_108__first_js__["a"]; });
4934/* harmony import */ var __WEBPACK_IMPORTED_MODULE_109__initial_js__ = __webpack_require__(212);
4935/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "initial", function() { return __WEBPACK_IMPORTED_MODULE_109__initial_js__["a"]; });
4936/* harmony import */ var __WEBPACK_IMPORTED_MODULE_110__last_js__ = __webpack_require__(350);
4937/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "last", function() { return __WEBPACK_IMPORTED_MODULE_110__last_js__["a"]; });
4938/* harmony import */ var __WEBPACK_IMPORTED_MODULE_111__rest_js__ = __webpack_require__(213);
4939/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "rest", function() { return __WEBPACK_IMPORTED_MODULE_111__rest_js__["a"]; });
4940/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "tail", function() { return __WEBPACK_IMPORTED_MODULE_111__rest_js__["a"]; });
4941/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "drop", function() { return __WEBPACK_IMPORTED_MODULE_111__rest_js__["a"]; });
4942/* harmony import */ var __WEBPACK_IMPORTED_MODULE_112__compact_js__ = __webpack_require__(351);
4943/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "compact", function() { return __WEBPACK_IMPORTED_MODULE_112__compact_js__["a"]; });
4944/* harmony import */ var __WEBPACK_IMPORTED_MODULE_113__flatten_js__ = __webpack_require__(352);
4945/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "flatten", function() { return __WEBPACK_IMPORTED_MODULE_113__flatten_js__["a"]; });
4946/* harmony import */ var __WEBPACK_IMPORTED_MODULE_114__without_js__ = __webpack_require__(353);
4947/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "without", function() { return __WEBPACK_IMPORTED_MODULE_114__without_js__["a"]; });
4948/* harmony import */ var __WEBPACK_IMPORTED_MODULE_115__uniq_js__ = __webpack_require__(215);
4949/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "uniq", function() { return __WEBPACK_IMPORTED_MODULE_115__uniq_js__["a"]; });
4950/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "unique", function() { return __WEBPACK_IMPORTED_MODULE_115__uniq_js__["a"]; });
4951/* harmony import */ var __WEBPACK_IMPORTED_MODULE_116__union_js__ = __webpack_require__(354);
4952/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "union", function() { return __WEBPACK_IMPORTED_MODULE_116__union_js__["a"]; });
4953/* harmony import */ var __WEBPACK_IMPORTED_MODULE_117__intersection_js__ = __webpack_require__(355);
4954/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "intersection", function() { return __WEBPACK_IMPORTED_MODULE_117__intersection_js__["a"]; });
4955/* harmony import */ var __WEBPACK_IMPORTED_MODULE_118__difference_js__ = __webpack_require__(214);
4956/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "difference", function() { return __WEBPACK_IMPORTED_MODULE_118__difference_js__["a"]; });
4957/* harmony import */ var __WEBPACK_IMPORTED_MODULE_119__unzip_js__ = __webpack_require__(216);
4958/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "unzip", function() { return __WEBPACK_IMPORTED_MODULE_119__unzip_js__["a"]; });
4959/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "transpose", function() { return __WEBPACK_IMPORTED_MODULE_119__unzip_js__["a"]; });
4960/* harmony import */ var __WEBPACK_IMPORTED_MODULE_120__zip_js__ = __webpack_require__(356);
4961/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "zip", function() { return __WEBPACK_IMPORTED_MODULE_120__zip_js__["a"]; });
4962/* harmony import */ var __WEBPACK_IMPORTED_MODULE_121__object_js__ = __webpack_require__(357);
4963/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "object", function() { return __WEBPACK_IMPORTED_MODULE_121__object_js__["a"]; });
4964/* harmony import */ var __WEBPACK_IMPORTED_MODULE_122__range_js__ = __webpack_require__(358);
4965/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "range", function() { return __WEBPACK_IMPORTED_MODULE_122__range_js__["a"]; });
4966/* harmony import */ var __WEBPACK_IMPORTED_MODULE_123__chunk_js__ = __webpack_require__(359);
4967/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "chunk", function() { return __WEBPACK_IMPORTED_MODULE_123__chunk_js__["a"]; });
4968/* harmony import */ var __WEBPACK_IMPORTED_MODULE_124__mixin_js__ = __webpack_require__(360);
4969/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "mixin", function() { return __WEBPACK_IMPORTED_MODULE_124__mixin_js__["a"]; });
4970/* harmony import */ var __WEBPACK_IMPORTED_MODULE_125__underscore_array_methods_js__ = __webpack_require__(361);
4971/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return __WEBPACK_IMPORTED_MODULE_125__underscore_array_methods_js__["a"]; });
4972// Named Exports
4973// =============
4974
4975// Underscore.js 1.12.1
4976// https://underscorejs.org
4977// (c) 2009-2020 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
4978// Underscore may be freely distributed under the MIT license.
4979
4980// Baseline setup.
4981
4982
4983
4984// Object Functions
4985// ----------------
4986// Our most fundamental functions operate on any JavaScript object.
4987// Most functions in Underscore depend on at least one function in this section.
4988
4989// A group of functions that check the types of core JavaScript values.
4990// These are often informally referred to as the "isType" functions.
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018// Functions that treat an object as a dictionary of key-value pairs.
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035// Utility Functions
5036// -----------------
5037// A bit of a grab bag: Predicate-generating functions for use with filters and
5038// loops, string escaping and templating, create random numbers and unique ids,
5039// and functions that facilitate Underscore's chaining and iteration conventions.
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059// Function (ahem) Functions
5060// -------------------------
5061// These functions take a function as an argument and return a new function
5062// as the result. Also known as higher-order functions.
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078// Finders
5079// -------
5080// Functions that extract (the position of) a single element from an object
5081// or array based on some criterion.
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091// Collection Functions
5092// --------------------
5093// Functions that work on any collection of elements: either an array, or
5094// an object of key-value pairs.
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119// `_.pick` and `_.omit` are actually object functions, but we put
5120// them here in order to create a more natural reading order in the
5121// monolithic build as they depend on `_.contains`.
5122
5123
5124
5125// Array Functions
5126// ---------------
5127// Functions that operate on arrays (and array-likes) only, because they’re
5128// expressed in terms of operations on an ordered list of values.
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146// OOP
5147// ---
5148// These modules support the "object-oriented" calling style. See also
5149// `underscore.js` and `index-default.js`.
5150
5151
5152
5153
5154/***/ }),
5155/* 127 */
5156/***/ (function(module, __webpack_exports__, __webpack_require__) {
5157
5158"use strict";
5159/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(17);
5160
5161
5162/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" /* default */])('String'));
5163
5164
5165/***/ }),
5166/* 128 */
5167/***/ (function(module, __webpack_exports__, __webpack_require__) {
5168
5169"use strict";
5170/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(17);
5171/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isFunction_js__ = __webpack_require__(27);
5172/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__isArrayBuffer_js__ = __webpack_require__(174);
5173/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__stringTagBug_js__ = __webpack_require__(79);
5174
5175
5176
5177
5178
5179var isDataView = Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" /* default */])('DataView');
5180
5181// In IE 10 - Edge 13, we need a different heuristic
5182// to determine whether an object is a `DataView`.
5183function ie10IsDataView(obj) {
5184 return obj != null && Object(__WEBPACK_IMPORTED_MODULE_1__isFunction_js__["a" /* default */])(obj.getInt8) && Object(__WEBPACK_IMPORTED_MODULE_2__isArrayBuffer_js__["a" /* default */])(obj.buffer);
5185}
5186
5187/* harmony default export */ __webpack_exports__["a"] = (__WEBPACK_IMPORTED_MODULE_3__stringTagBug_js__["a" /* hasStringTagBug */] ? ie10IsDataView : isDataView);
5188
5189
5190/***/ }),
5191/* 129 */
5192/***/ (function(module, __webpack_exports__, __webpack_require__) {
5193
5194"use strict";
5195/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(17);
5196/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__has_js__ = __webpack_require__(40);
5197
5198
5199
5200var isArguments = Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" /* default */])('Arguments');
5201
5202// Define a fallback version of the method in browsers (ahem, IE < 9), where
5203// there isn't any inspectable "Arguments" type.
5204(function() {
5205 if (!isArguments(arguments)) {
5206 isArguments = function(obj) {
5207 return Object(__WEBPACK_IMPORTED_MODULE_1__has_js__["a" /* default */])(obj, 'callee');
5208 };
5209 }
5210}());
5211
5212/* harmony default export */ __webpack_exports__["a"] = (isArguments);
5213
5214
5215/***/ }),
5216/* 130 */
5217/***/ (function(module, __webpack_exports__, __webpack_require__) {
5218
5219"use strict";
5220/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__shallowProperty_js__ = __webpack_require__(179);
5221
5222
5223// Internal helper to obtain the `byteLength` property of an object.
5224/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__shallowProperty_js__["a" /* default */])('byteLength'));
5225
5226
5227/***/ }),
5228/* 131 */
5229/***/ (function(module, __webpack_exports__, __webpack_require__) {
5230
5231"use strict";
5232/* harmony export (immutable) */ __webpack_exports__["a"] = ie11fingerprint;
5233/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return mapMethods; });
5234/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return weakMapMethods; });
5235/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return setMethods; });
5236/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__getLength_js__ = __webpack_require__(28);
5237/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isFunction_js__ = __webpack_require__(27);
5238/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__allKeys_js__ = __webpack_require__(80);
5239
5240
5241
5242
5243// Since the regular `Object.prototype.toString` type tests don't work for
5244// some types in IE 11, we use a fingerprinting heuristic instead, based
5245// on the methods. It's not great, but it's the best we got.
5246// The fingerprint method lists are defined below.
5247function ie11fingerprint(methods) {
5248 var length = Object(__WEBPACK_IMPORTED_MODULE_0__getLength_js__["a" /* default */])(methods);
5249 return function(obj) {
5250 if (obj == null) return false;
5251 // `Map`, `WeakMap` and `Set` have no enumerable keys.
5252 var keys = Object(__WEBPACK_IMPORTED_MODULE_2__allKeys_js__["a" /* default */])(obj);
5253 if (Object(__WEBPACK_IMPORTED_MODULE_0__getLength_js__["a" /* default */])(keys)) return false;
5254 for (var i = 0; i < length; i++) {
5255 if (!Object(__WEBPACK_IMPORTED_MODULE_1__isFunction_js__["a" /* default */])(obj[methods[i]])) return false;
5256 }
5257 // If we are testing against `WeakMap`, we need to ensure that
5258 // `obj` doesn't have a `forEach` method in order to distinguish
5259 // it from a regular `Map`.
5260 return methods !== weakMapMethods || !Object(__WEBPACK_IMPORTED_MODULE_1__isFunction_js__["a" /* default */])(obj[forEachName]);
5261 };
5262}
5263
5264// In the interest of compact minification, we write
5265// each string in the fingerprints only once.
5266var forEachName = 'forEach',
5267 hasName = 'has',
5268 commonInit = ['clear', 'delete'],
5269 mapTail = ['get', hasName, 'set'];
5270
5271// `Map`, `WeakMap` and `Set` each have slightly different
5272// combinations of the above sublists.
5273var mapMethods = commonInit.concat(forEachName, mapTail),
5274 weakMapMethods = commonInit.concat(mapTail),
5275 setMethods = ['add'].concat(commonInit, forEachName, hasName);
5276
5277
5278/***/ }),
5279/* 132 */
5280/***/ (function(module, __webpack_exports__, __webpack_require__) {
5281
5282"use strict";
5283/* harmony export (immutable) */ __webpack_exports__["a"] = createAssigner;
5284// An internal function for creating assigner functions.
5285function createAssigner(keysFunc, defaults) {
5286 return function(obj) {
5287 var length = arguments.length;
5288 if (defaults) obj = Object(obj);
5289 if (length < 2 || obj == null) return obj;
5290 for (var index = 1; index < length; index++) {
5291 var source = arguments[index],
5292 keys = keysFunc(source),
5293 l = keys.length;
5294 for (var i = 0; i < l; i++) {
5295 var key = keys[i];
5296 if (!defaults || obj[key] === void 0) obj[key] = source[key];
5297 }
5298 }
5299 return obj;
5300 };
5301}
5302
5303
5304/***/ }),
5305/* 133 */
5306/***/ (function(module, __webpack_exports__, __webpack_require__) {
5307
5308"use strict";
5309/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createAssigner_js__ = __webpack_require__(132);
5310/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__keys_js__ = __webpack_require__(15);
5311
5312
5313
5314// Assigns a given object with all the own properties in the passed-in
5315// object(s).
5316// (https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/assign)
5317/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createAssigner_js__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__keys_js__["a" /* default */]));
5318
5319
5320/***/ }),
5321/* 134 */
5322/***/ (function(module, __webpack_exports__, __webpack_require__) {
5323
5324"use strict";
5325/* harmony export (immutable) */ __webpack_exports__["a"] = deepGet;
5326// Internal function to obtain a nested property in `obj` along `path`.
5327function deepGet(obj, path) {
5328 var length = path.length;
5329 for (var i = 0; i < length; i++) {
5330 if (obj == null) return void 0;
5331 obj = obj[path[i]];
5332 }
5333 return length ? obj : void 0;
5334}
5335
5336
5337/***/ }),
5338/* 135 */
5339/***/ (function(module, __webpack_exports__, __webpack_require__) {
5340
5341"use strict";
5342/* harmony export (immutable) */ __webpack_exports__["a"] = identity;
5343// Keep the identity function around for default iteratees.
5344function identity(value) {
5345 return value;
5346}
5347
5348
5349/***/ }),
5350/* 136 */
5351/***/ (function(module, __webpack_exports__, __webpack_require__) {
5352
5353"use strict";
5354/* harmony export (immutable) */ __webpack_exports__["a"] = property;
5355/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__deepGet_js__ = __webpack_require__(134);
5356/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__toPath_js__ = __webpack_require__(81);
5357
5358
5359
5360// Creates a function that, when passed an object, will traverse that object’s
5361// properties down the given `path`, specified as an array of keys or indices.
5362function property(path) {
5363 path = Object(__WEBPACK_IMPORTED_MODULE_1__toPath_js__["a" /* default */])(path);
5364 return function(obj) {
5365 return Object(__WEBPACK_IMPORTED_MODULE_0__deepGet_js__["a" /* default */])(obj, path);
5366 };
5367}
5368
5369
5370/***/ }),
5371/* 137 */
5372/***/ (function(module, __webpack_exports__, __webpack_require__) {
5373
5374"use strict";
5375// A (possibly faster) way to get the current timestamp as an integer.
5376/* harmony default export */ __webpack_exports__["a"] = (Date.now || function() {
5377 return new Date().getTime();
5378});
5379
5380
5381/***/ }),
5382/* 138 */
5383/***/ (function(module, __webpack_exports__, __webpack_require__) {
5384
5385"use strict";
5386/* harmony export (immutable) */ __webpack_exports__["a"] = negate;
5387// Returns a negated version of the passed-in predicate.
5388function negate(predicate) {
5389 return function() {
5390 return !predicate.apply(this, arguments);
5391 };
5392}
5393
5394
5395/***/ }),
5396/* 139 */
5397/***/ (function(module, __webpack_exports__, __webpack_require__) {
5398
5399"use strict";
5400/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createPredicateIndexFinder_js__ = __webpack_require__(202);
5401
5402
5403// Returns the first index on an array-like that passes a truth test.
5404/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createPredicateIndexFinder_js__["a" /* default */])(1));
5405
5406
5407/***/ }),
5408/* 140 */
5409/***/ (function(module, __webpack_exports__, __webpack_require__) {
5410
5411"use strict";
5412/* harmony export (immutable) */ __webpack_exports__["a"] = pluck;
5413/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__map_js__ = __webpack_require__(64);
5414/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__property_js__ = __webpack_require__(136);
5415
5416
5417
5418// Convenience version of a common use case of `_.map`: fetching a property.
5419function pluck(obj, key) {
5420 return Object(__WEBPACK_IMPORTED_MODULE_0__map_js__["a" /* default */])(obj, Object(__WEBPACK_IMPORTED_MODULE_1__property_js__["a" /* default */])(key));
5421}
5422
5423
5424/***/ }),
5425/* 141 */
5426/***/ (function(module, exports, __webpack_require__) {
5427
5428module.exports = __webpack_require__(371);
5429
5430/***/ }),
5431/* 142 */
5432/***/ (function(module, exports, __webpack_require__) {
5433
5434module.exports = __webpack_require__(222);
5435
5436/***/ }),
5437/* 143 */
5438/***/ (function(module, exports, __webpack_require__) {
5439
5440module.exports = __webpack_require__(230);
5441
5442/***/ }),
5443/* 144 */
5444/***/ (function(module, exports, __webpack_require__) {
5445
5446var wellKnownSymbol = __webpack_require__(9);
5447
5448exports.f = wellKnownSymbol;
5449
5450
5451/***/ }),
5452/* 145 */
5453/***/ (function(module, exports, __webpack_require__) {
5454
5455module.exports = __webpack_require__(477);
5456
5457/***/ }),
5458/* 146 */
5459/***/ (function(module, exports, __webpack_require__) {
5460
5461var defineBuiltIn = __webpack_require__(39);
5462
5463module.exports = function (target, src, options) {
5464 for (var key in src) {
5465 if (options && options.unsafe && target[key]) target[key] = src[key];
5466 else defineBuiltIn(target, key, src[key], options);
5467 } return target;
5468};
5469
5470
5471/***/ }),
5472/* 147 */
5473/***/ (function(module, exports, __webpack_require__) {
5474
5475/* eslint-disable es-x/no-symbol -- required for testing */
5476var NATIVE_SYMBOL = __webpack_require__(57);
5477
5478module.exports = NATIVE_SYMBOL
5479 && !Symbol.sham
5480 && typeof Symbol.iterator == 'symbol';
5481
5482
5483/***/ }),
5484/* 148 */
5485/***/ (function(module, exports, __webpack_require__) {
5486
5487var DESCRIPTORS = __webpack_require__(16);
5488var fails = __webpack_require__(3);
5489var createElement = __webpack_require__(118);
5490
5491// Thanks to IE8 for its funny defineProperty
5492module.exports = !DESCRIPTORS && !fails(function () {
5493 // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
5494 return Object.defineProperty(createElement('div'), 'a', {
5495 get: function () { return 7; }
5496 }).a != 7;
5497});
5498
5499
5500/***/ }),
5501/* 149 */
5502/***/ (function(module, exports, __webpack_require__) {
5503
5504var fails = __webpack_require__(3);
5505var isCallable = __webpack_require__(7);
5506
5507var replacement = /#|\.prototype\./;
5508
5509var isForced = function (feature, detection) {
5510 var value = data[normalize(feature)];
5511 return value == POLYFILL ? true
5512 : value == NATIVE ? false
5513 : isCallable(detection) ? fails(detection)
5514 : !!detection;
5515};
5516
5517var normalize = isForced.normalize = function (string) {
5518 return String(string).replace(replacement, '.').toLowerCase();
5519};
5520
5521var data = isForced.data = {};
5522var NATIVE = isForced.NATIVE = 'N';
5523var POLYFILL = isForced.POLYFILL = 'P';
5524
5525module.exports = isForced;
5526
5527
5528/***/ }),
5529/* 150 */
5530/***/ (function(module, exports, __webpack_require__) {
5531
5532var DESCRIPTORS = __webpack_require__(16);
5533var fails = __webpack_require__(3);
5534
5535// V8 ~ Chrome 36-
5536// https://bugs.chromium.org/p/v8/issues/detail?id=3334
5537module.exports = DESCRIPTORS && fails(function () {
5538 // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
5539 return Object.defineProperty(function () { /* empty */ }, 'prototype', {
5540 value: 42,
5541 writable: false
5542 }).prototype != 42;
5543});
5544
5545
5546/***/ }),
5547/* 151 */
5548/***/ (function(module, exports, __webpack_require__) {
5549
5550var fails = __webpack_require__(3);
5551
5552module.exports = !fails(function () {
5553 function F() { /* empty */ }
5554 F.prototype.constructor = null;
5555 // eslint-disable-next-line es-x/no-object-getprototypeof -- required for testing
5556 return Object.getPrototypeOf(new F()) !== F.prototype;
5557});
5558
5559
5560/***/ }),
5561/* 152 */
5562/***/ (function(module, exports, __webpack_require__) {
5563
5564var uncurryThis = __webpack_require__(4);
5565var hasOwn = __webpack_require__(14);
5566var toIndexedObject = __webpack_require__(33);
5567var indexOf = __webpack_require__(153).indexOf;
5568var hiddenKeys = __webpack_require__(74);
5569
5570var push = uncurryThis([].push);
5571
5572module.exports = function (object, names) {
5573 var O = toIndexedObject(object);
5574 var i = 0;
5575 var result = [];
5576 var key;
5577 for (key in O) !hasOwn(hiddenKeys, key) && hasOwn(O, key) && push(result, key);
5578 // Don't enum bug & hidden keys
5579 while (names.length > i) if (hasOwn(O, key = names[i++])) {
5580 ~indexOf(result, key) || push(result, key);
5581 }
5582 return result;
5583};
5584
5585
5586/***/ }),
5587/* 153 */
5588/***/ (function(module, exports, __webpack_require__) {
5589
5590var toIndexedObject = __webpack_require__(33);
5591var toAbsoluteIndex = __webpack_require__(119);
5592var lengthOfArrayLike = __webpack_require__(46);
5593
5594// `Array.prototype.{ indexOf, includes }` methods implementation
5595var createMethod = function (IS_INCLUDES) {
5596 return function ($this, el, fromIndex) {
5597 var O = toIndexedObject($this);
5598 var length = lengthOfArrayLike(O);
5599 var index = toAbsoluteIndex(fromIndex, length);
5600 var value;
5601 // Array#includes uses SameValueZero equality algorithm
5602 // eslint-disable-next-line no-self-compare -- NaN check
5603 if (IS_INCLUDES && el != el) while (length > index) {
5604 value = O[index++];
5605 // eslint-disable-next-line no-self-compare -- NaN check
5606 if (value != value) return true;
5607 // Array#indexOf ignores holes, Array#includes - not
5608 } else for (;length > index; index++) {
5609 if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
5610 } return !IS_INCLUDES && -1;
5611 };
5612};
5613
5614module.exports = {
5615 // `Array.prototype.includes` method
5616 // https://tc39.es/ecma262/#sec-array.prototype.includes
5617 includes: createMethod(true),
5618 // `Array.prototype.indexOf` method
5619 // https://tc39.es/ecma262/#sec-array.prototype.indexof
5620 indexOf: createMethod(false)
5621};
5622
5623
5624/***/ }),
5625/* 154 */
5626/***/ (function(module, exports, __webpack_require__) {
5627
5628var DESCRIPTORS = __webpack_require__(16);
5629var V8_PROTOTYPE_DEFINE_BUG = __webpack_require__(150);
5630var definePropertyModule = __webpack_require__(22);
5631var anObject = __webpack_require__(19);
5632var toIndexedObject = __webpack_require__(33);
5633var objectKeys = __webpack_require__(98);
5634
5635// `Object.defineProperties` method
5636// https://tc39.es/ecma262/#sec-object.defineproperties
5637// eslint-disable-next-line es-x/no-object-defineproperties -- safe
5638exports.f = DESCRIPTORS && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {
5639 anObject(O);
5640 var props = toIndexedObject(Properties);
5641 var keys = objectKeys(Properties);
5642 var length = keys.length;
5643 var index = 0;
5644 var key;
5645 while (length > index) definePropertyModule.f(O, key = keys[index++], props[key]);
5646 return O;
5647};
5648
5649
5650/***/ }),
5651/* 155 */
5652/***/ (function(module, exports, __webpack_require__) {
5653
5654var getBuiltIn = __webpack_require__(18);
5655
5656module.exports = getBuiltIn('document', 'documentElement');
5657
5658
5659/***/ }),
5660/* 156 */
5661/***/ (function(module, exports, __webpack_require__) {
5662
5663var wellKnownSymbol = __webpack_require__(9);
5664var Iterators = __webpack_require__(58);
5665
5666var ITERATOR = wellKnownSymbol('iterator');
5667var ArrayPrototype = Array.prototype;
5668
5669// check on default Array iterator
5670module.exports = function (it) {
5671 return it !== undefined && (Iterators.Array === it || ArrayPrototype[ITERATOR] === it);
5672};
5673
5674
5675/***/ }),
5676/* 157 */
5677/***/ (function(module, exports, __webpack_require__) {
5678
5679var call = __webpack_require__(13);
5680var aCallable = __webpack_require__(31);
5681var anObject = __webpack_require__(19);
5682var tryToString = __webpack_require__(72);
5683var getIteratorMethod = __webpack_require__(99);
5684
5685var $TypeError = TypeError;
5686
5687module.exports = function (argument, usingIterator) {
5688 var iteratorMethod = arguments.length < 2 ? getIteratorMethod(argument) : usingIterator;
5689 if (aCallable(iteratorMethod)) return anObject(call(iteratorMethod, argument));
5690 throw $TypeError(tryToString(argument) + ' is not iterable');
5691};
5692
5693
5694/***/ }),
5695/* 158 */
5696/***/ (function(module, exports, __webpack_require__) {
5697
5698var call = __webpack_require__(13);
5699var anObject = __webpack_require__(19);
5700var getMethod = __webpack_require__(116);
5701
5702module.exports = function (iterator, kind, value) {
5703 var innerResult, innerError;
5704 anObject(iterator);
5705 try {
5706 innerResult = getMethod(iterator, 'return');
5707 if (!innerResult) {
5708 if (kind === 'throw') throw value;
5709 return value;
5710 }
5711 innerResult = call(innerResult, iterator);
5712 } catch (error) {
5713 innerError = true;
5714 innerResult = error;
5715 }
5716 if (kind === 'throw') throw value;
5717 if (innerError) throw innerResult;
5718 anObject(innerResult);
5719 return value;
5720};
5721
5722
5723/***/ }),
5724/* 159 */
5725/***/ (function(module, exports) {
5726
5727module.exports = function () { /* empty */ };
5728
5729
5730/***/ }),
5731/* 160 */
5732/***/ (function(module, exports, __webpack_require__) {
5733
5734var global = __webpack_require__(6);
5735var isCallable = __webpack_require__(7);
5736var inspectSource = __webpack_require__(123);
5737
5738var WeakMap = global.WeakMap;
5739
5740module.exports = isCallable(WeakMap) && /native code/.test(inspectSource(WeakMap));
5741
5742
5743/***/ }),
5744/* 161 */
5745/***/ (function(module, exports, __webpack_require__) {
5746
5747"use strict";
5748
5749var fails = __webpack_require__(3);
5750var isCallable = __webpack_require__(7);
5751var create = __webpack_require__(47);
5752var getPrototypeOf = __webpack_require__(93);
5753var defineBuiltIn = __webpack_require__(39);
5754var wellKnownSymbol = __webpack_require__(9);
5755var IS_PURE = __webpack_require__(32);
5756
5757var ITERATOR = wellKnownSymbol('iterator');
5758var BUGGY_SAFARI_ITERATORS = false;
5759
5760// `%IteratorPrototype%` object
5761// https://tc39.es/ecma262/#sec-%iteratorprototype%-object
5762var IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator;
5763
5764/* eslint-disable es-x/no-array-prototype-keys -- safe */
5765if ([].keys) {
5766 arrayIterator = [].keys();
5767 // Safari 8 has buggy iterators w/o `next`
5768 if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS = true;
5769 else {
5770 PrototypeOfArrayIteratorPrototype = getPrototypeOf(getPrototypeOf(arrayIterator));
5771 if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype = PrototypeOfArrayIteratorPrototype;
5772 }
5773}
5774
5775var NEW_ITERATOR_PROTOTYPE = IteratorPrototype == undefined || fails(function () {
5776 var test = {};
5777 // FF44- legacy iterators case
5778 return IteratorPrototype[ITERATOR].call(test) !== test;
5779});
5780
5781if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype = {};
5782else if (IS_PURE) IteratorPrototype = create(IteratorPrototype);
5783
5784// `%IteratorPrototype%[@@iterator]()` method
5785// https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator
5786if (!isCallable(IteratorPrototype[ITERATOR])) {
5787 defineBuiltIn(IteratorPrototype, ITERATOR, function () {
5788 return this;
5789 });
5790}
5791
5792module.exports = {
5793 IteratorPrototype: IteratorPrototype,
5794 BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS
5795};
5796
5797
5798/***/ }),
5799/* 162 */
5800/***/ (function(module, exports, __webpack_require__) {
5801
5802"use strict";
5803
5804var getBuiltIn = __webpack_require__(18);
5805var definePropertyModule = __webpack_require__(22);
5806var wellKnownSymbol = __webpack_require__(9);
5807var DESCRIPTORS = __webpack_require__(16);
5808
5809var SPECIES = wellKnownSymbol('species');
5810
5811module.exports = function (CONSTRUCTOR_NAME) {
5812 var Constructor = getBuiltIn(CONSTRUCTOR_NAME);
5813 var defineProperty = definePropertyModule.f;
5814
5815 if (DESCRIPTORS && Constructor && !Constructor[SPECIES]) {
5816 defineProperty(Constructor, SPECIES, {
5817 configurable: true,
5818 get: function () { return this; }
5819 });
5820 }
5821};
5822
5823
5824/***/ }),
5825/* 163 */
5826/***/ (function(module, exports, __webpack_require__) {
5827
5828var anObject = __webpack_require__(19);
5829var aConstructor = __webpack_require__(164);
5830var wellKnownSymbol = __webpack_require__(9);
5831
5832var SPECIES = wellKnownSymbol('species');
5833
5834// `SpeciesConstructor` abstract operation
5835// https://tc39.es/ecma262/#sec-speciesconstructor
5836module.exports = function (O, defaultConstructor) {
5837 var C = anObject(O).constructor;
5838 var S;
5839 return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? defaultConstructor : aConstructor(S);
5840};
5841
5842
5843/***/ }),
5844/* 164 */
5845/***/ (function(module, exports, __webpack_require__) {
5846
5847var isConstructor = __webpack_require__(101);
5848var tryToString = __webpack_require__(72);
5849
5850var $TypeError = TypeError;
5851
5852// `Assert: IsConstructor(argument) is true`
5853module.exports = function (argument) {
5854 if (isConstructor(argument)) return argument;
5855 throw $TypeError(tryToString(argument) + ' is not a constructor');
5856};
5857
5858
5859/***/ }),
5860/* 165 */
5861/***/ (function(module, exports, __webpack_require__) {
5862
5863var global = __webpack_require__(6);
5864var apply = __webpack_require__(69);
5865var bind = __webpack_require__(45);
5866var isCallable = __webpack_require__(7);
5867var hasOwn = __webpack_require__(14);
5868var fails = __webpack_require__(3);
5869var html = __webpack_require__(155);
5870var arraySlice = __webpack_require__(102);
5871var createElement = __webpack_require__(118);
5872var validateArgumentsLength = __webpack_require__(273);
5873var IS_IOS = __webpack_require__(166);
5874var IS_NODE = __webpack_require__(125);
5875
5876var set = global.setImmediate;
5877var clear = global.clearImmediate;
5878var process = global.process;
5879var Dispatch = global.Dispatch;
5880var Function = global.Function;
5881var MessageChannel = global.MessageChannel;
5882var String = global.String;
5883var counter = 0;
5884var queue = {};
5885var ONREADYSTATECHANGE = 'onreadystatechange';
5886var location, defer, channel, port;
5887
5888try {
5889 // Deno throws a ReferenceError on `location` access without `--location` flag
5890 location = global.location;
5891} catch (error) { /* empty */ }
5892
5893var run = function (id) {
5894 if (hasOwn(queue, id)) {
5895 var fn = queue[id];
5896 delete queue[id];
5897 fn();
5898 }
5899};
5900
5901var runner = function (id) {
5902 return function () {
5903 run(id);
5904 };
5905};
5906
5907var listener = function (event) {
5908 run(event.data);
5909};
5910
5911var post = function (id) {
5912 // old engines have not location.origin
5913 global.postMessage(String(id), location.protocol + '//' + location.host);
5914};
5915
5916// Node.js 0.9+ & IE10+ has setImmediate, otherwise:
5917if (!set || !clear) {
5918 set = function setImmediate(handler) {
5919 validateArgumentsLength(arguments.length, 1);
5920 var fn = isCallable(handler) ? handler : Function(handler);
5921 var args = arraySlice(arguments, 1);
5922 queue[++counter] = function () {
5923 apply(fn, undefined, args);
5924 };
5925 defer(counter);
5926 return counter;
5927 };
5928 clear = function clearImmediate(id) {
5929 delete queue[id];
5930 };
5931 // Node.js 0.8-
5932 if (IS_NODE) {
5933 defer = function (id) {
5934 process.nextTick(runner(id));
5935 };
5936 // Sphere (JS game engine) Dispatch API
5937 } else if (Dispatch && Dispatch.now) {
5938 defer = function (id) {
5939 Dispatch.now(runner(id));
5940 };
5941 // Browsers with MessageChannel, includes WebWorkers
5942 // except iOS - https://github.com/zloirock/core-js/issues/624
5943 } else if (MessageChannel && !IS_IOS) {
5944 channel = new MessageChannel();
5945 port = channel.port2;
5946 channel.port1.onmessage = listener;
5947 defer = bind(port.postMessage, port);
5948 // Browsers with postMessage, skip WebWorkers
5949 // IE8 has postMessage, but it's sync & typeof its postMessage is 'object'
5950 } else if (
5951 global.addEventListener &&
5952 isCallable(global.postMessage) &&
5953 !global.importScripts &&
5954 location && location.protocol !== 'file:' &&
5955 !fails(post)
5956 ) {
5957 defer = post;
5958 global.addEventListener('message', listener, false);
5959 // IE8-
5960 } else if (ONREADYSTATECHANGE in createElement('script')) {
5961 defer = function (id) {
5962 html.appendChild(createElement('script'))[ONREADYSTATECHANGE] = function () {
5963 html.removeChild(this);
5964 run(id);
5965 };
5966 };
5967 // Rest old browsers
5968 } else {
5969 defer = function (id) {
5970 setTimeout(runner(id), 0);
5971 };
5972 }
5973}
5974
5975module.exports = {
5976 set: set,
5977 clear: clear
5978};
5979
5980
5981/***/ }),
5982/* 166 */
5983/***/ (function(module, exports, __webpack_require__) {
5984
5985var userAgent = __webpack_require__(91);
5986
5987module.exports = /(?:ipad|iphone|ipod).*applewebkit/i.test(userAgent);
5988
5989
5990/***/ }),
5991/* 167 */
5992/***/ (function(module, exports, __webpack_require__) {
5993
5994var NativePromiseConstructor = __webpack_require__(61);
5995var checkCorrectnessOfIteration = __webpack_require__(168);
5996var FORCED_PROMISE_CONSTRUCTOR = __webpack_require__(77).CONSTRUCTOR;
5997
5998module.exports = FORCED_PROMISE_CONSTRUCTOR || !checkCorrectnessOfIteration(function (iterable) {
5999 NativePromiseConstructor.all(iterable).then(undefined, function () { /* empty */ });
6000});
6001
6002
6003/***/ }),
6004/* 168 */
6005/***/ (function(module, exports, __webpack_require__) {
6006
6007var wellKnownSymbol = __webpack_require__(9);
6008
6009var ITERATOR = wellKnownSymbol('iterator');
6010var SAFE_CLOSING = false;
6011
6012try {
6013 var called = 0;
6014 var iteratorWithReturn = {
6015 next: function () {
6016 return { done: !!called++ };
6017 },
6018 'return': function () {
6019 SAFE_CLOSING = true;
6020 }
6021 };
6022 iteratorWithReturn[ITERATOR] = function () {
6023 return this;
6024 };
6025 // eslint-disable-next-line es-x/no-array-from, no-throw-literal -- required for testing
6026 Array.from(iteratorWithReturn, function () { throw 2; });
6027} catch (error) { /* empty */ }
6028
6029module.exports = function (exec, SKIP_CLOSING) {
6030 if (!SKIP_CLOSING && !SAFE_CLOSING) return false;
6031 var ITERATION_SUPPORT = false;
6032 try {
6033 var object = {};
6034 object[ITERATOR] = function () {
6035 return {
6036 next: function () {
6037 return { done: ITERATION_SUPPORT = true };
6038 }
6039 };
6040 };
6041 exec(object);
6042 } catch (error) { /* empty */ }
6043 return ITERATION_SUPPORT;
6044};
6045
6046
6047/***/ }),
6048/* 169 */
6049/***/ (function(module, exports, __webpack_require__) {
6050
6051var anObject = __webpack_require__(19);
6052var isObject = __webpack_require__(11);
6053var newPromiseCapability = __webpack_require__(50);
6054
6055module.exports = function (C, x) {
6056 anObject(C);
6057 if (isObject(x) && x.constructor === C) return x;
6058 var promiseCapability = newPromiseCapability.f(C);
6059 var resolve = promiseCapability.resolve;
6060 resolve(x);
6061 return promiseCapability.promise;
6062};
6063
6064
6065/***/ }),
6066/* 170 */
6067/***/ (function(module, __webpack_exports__, __webpack_require__) {
6068
6069"use strict";
6070/* harmony export (immutable) */ __webpack_exports__["a"] = isUndefined;
6071// Is a given variable undefined?
6072function isUndefined(obj) {
6073 return obj === void 0;
6074}
6075
6076
6077/***/ }),
6078/* 171 */
6079/***/ (function(module, __webpack_exports__, __webpack_require__) {
6080
6081"use strict";
6082/* harmony export (immutable) */ __webpack_exports__["a"] = isBoolean;
6083/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(5);
6084
6085
6086// Is a given value a boolean?
6087function isBoolean(obj) {
6088 return obj === true || obj === false || __WEBPACK_IMPORTED_MODULE_0__setup_js__["t" /* toString */].call(obj) === '[object Boolean]';
6089}
6090
6091
6092/***/ }),
6093/* 172 */
6094/***/ (function(module, __webpack_exports__, __webpack_require__) {
6095
6096"use strict";
6097/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(17);
6098
6099
6100/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" /* default */])('Number'));
6101
6102
6103/***/ }),
6104/* 173 */
6105/***/ (function(module, __webpack_exports__, __webpack_require__) {
6106
6107"use strict";
6108/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(17);
6109
6110
6111/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" /* default */])('Symbol'));
6112
6113
6114/***/ }),
6115/* 174 */
6116/***/ (function(module, __webpack_exports__, __webpack_require__) {
6117
6118"use strict";
6119/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(17);
6120
6121
6122/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" /* default */])('ArrayBuffer'));
6123
6124
6125/***/ }),
6126/* 175 */
6127/***/ (function(module, __webpack_exports__, __webpack_require__) {
6128
6129"use strict";
6130/* harmony export (immutable) */ __webpack_exports__["a"] = isNaN;
6131/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(5);
6132/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isNumber_js__ = __webpack_require__(172);
6133
6134
6135
6136// Is the given value `NaN`?
6137function isNaN(obj) {
6138 return Object(__WEBPACK_IMPORTED_MODULE_1__isNumber_js__["a" /* default */])(obj) && Object(__WEBPACK_IMPORTED_MODULE_0__setup_js__["g" /* _isNaN */])(obj);
6139}
6140
6141
6142/***/ }),
6143/* 176 */
6144/***/ (function(module, __webpack_exports__, __webpack_require__) {
6145
6146"use strict";
6147/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(5);
6148/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isDataView_js__ = __webpack_require__(128);
6149/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constant_js__ = __webpack_require__(177);
6150/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__isBufferLike_js__ = __webpack_require__(298);
6151
6152
6153
6154
6155
6156// Is a given value a typed array?
6157var typedArrayPattern = /\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;
6158function isTypedArray(obj) {
6159 // `ArrayBuffer.isView` is the most future-proof, so use it when available.
6160 // Otherwise, fall back on the above regular expression.
6161 return __WEBPACK_IMPORTED_MODULE_0__setup_js__["l" /* nativeIsView */] ? (Object(__WEBPACK_IMPORTED_MODULE_0__setup_js__["l" /* nativeIsView */])(obj) && !Object(__WEBPACK_IMPORTED_MODULE_1__isDataView_js__["a" /* default */])(obj)) :
6162 Object(__WEBPACK_IMPORTED_MODULE_3__isBufferLike_js__["a" /* default */])(obj) && typedArrayPattern.test(__WEBPACK_IMPORTED_MODULE_0__setup_js__["t" /* toString */].call(obj));
6163}
6164
6165/* harmony default export */ __webpack_exports__["a"] = (__WEBPACK_IMPORTED_MODULE_0__setup_js__["r" /* supportsArrayBuffer */] ? isTypedArray : Object(__WEBPACK_IMPORTED_MODULE_2__constant_js__["a" /* default */])(false));
6166
6167
6168/***/ }),
6169/* 177 */
6170/***/ (function(module, __webpack_exports__, __webpack_require__) {
6171
6172"use strict";
6173/* harmony export (immutable) */ __webpack_exports__["a"] = constant;
6174// Predicate-generating function. Often useful outside of Underscore.
6175function constant(value) {
6176 return function() {
6177 return value;
6178 };
6179}
6180
6181
6182/***/ }),
6183/* 178 */
6184/***/ (function(module, __webpack_exports__, __webpack_require__) {
6185
6186"use strict";
6187/* harmony export (immutable) */ __webpack_exports__["a"] = createSizePropertyCheck;
6188/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(5);
6189
6190
6191// Common internal logic for `isArrayLike` and `isBufferLike`.
6192function createSizePropertyCheck(getSizeProperty) {
6193 return function(collection) {
6194 var sizeProperty = getSizeProperty(collection);
6195 return typeof sizeProperty == 'number' && sizeProperty >= 0 && sizeProperty <= __WEBPACK_IMPORTED_MODULE_0__setup_js__["b" /* MAX_ARRAY_INDEX */];
6196 }
6197}
6198
6199
6200/***/ }),
6201/* 179 */
6202/***/ (function(module, __webpack_exports__, __webpack_require__) {
6203
6204"use strict";
6205/* harmony export (immutable) */ __webpack_exports__["a"] = shallowProperty;
6206// Internal helper to generate a function to obtain property `key` from `obj`.
6207function shallowProperty(key) {
6208 return function(obj) {
6209 return obj == null ? void 0 : obj[key];
6210 };
6211}
6212
6213
6214/***/ }),
6215/* 180 */
6216/***/ (function(module, __webpack_exports__, __webpack_require__) {
6217
6218"use strict";
6219/* harmony export (immutable) */ __webpack_exports__["a"] = collectNonEnumProps;
6220/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(5);
6221/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isFunction_js__ = __webpack_require__(27);
6222/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__has_js__ = __webpack_require__(40);
6223
6224
6225
6226
6227// Internal helper to create a simple lookup structure.
6228// `collectNonEnumProps` used to depend on `_.contains`, but this led to
6229// circular imports. `emulatedSet` is a one-off solution that only works for
6230// arrays of strings.
6231function emulatedSet(keys) {
6232 var hash = {};
6233 for (var l = keys.length, i = 0; i < l; ++i) hash[keys[i]] = true;
6234 return {
6235 contains: function(key) { return hash[key]; },
6236 push: function(key) {
6237 hash[key] = true;
6238 return keys.push(key);
6239 }
6240 };
6241}
6242
6243// Internal helper. Checks `keys` for the presence of keys in IE < 9 that won't
6244// be iterated by `for key in ...` and thus missed. Extends `keys` in place if
6245// needed.
6246function collectNonEnumProps(obj, keys) {
6247 keys = emulatedSet(keys);
6248 var nonEnumIdx = __WEBPACK_IMPORTED_MODULE_0__setup_js__["n" /* nonEnumerableProps */].length;
6249 var constructor = obj.constructor;
6250 var proto = Object(__WEBPACK_IMPORTED_MODULE_1__isFunction_js__["a" /* default */])(constructor) && constructor.prototype || __WEBPACK_IMPORTED_MODULE_0__setup_js__["c" /* ObjProto */];
6251
6252 // Constructor is a special case.
6253 var prop = 'constructor';
6254 if (Object(__WEBPACK_IMPORTED_MODULE_2__has_js__["a" /* default */])(obj, prop) && !keys.contains(prop)) keys.push(prop);
6255
6256 while (nonEnumIdx--) {
6257 prop = __WEBPACK_IMPORTED_MODULE_0__setup_js__["n" /* nonEnumerableProps */][nonEnumIdx];
6258 if (prop in obj && obj[prop] !== proto[prop] && !keys.contains(prop)) {
6259 keys.push(prop);
6260 }
6261 }
6262}
6263
6264
6265/***/ }),
6266/* 181 */
6267/***/ (function(module, __webpack_exports__, __webpack_require__) {
6268
6269"use strict";
6270/* harmony export (immutable) */ __webpack_exports__["a"] = isMatch;
6271/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__keys_js__ = __webpack_require__(15);
6272
6273
6274// Returns whether an object has a given set of `key:value` pairs.
6275function isMatch(object, attrs) {
6276 var _keys = Object(__WEBPACK_IMPORTED_MODULE_0__keys_js__["a" /* default */])(attrs), length = _keys.length;
6277 if (object == null) return !length;
6278 var obj = Object(object);
6279 for (var i = 0; i < length; i++) {
6280 var key = _keys[i];
6281 if (attrs[key] !== obj[key] || !(key in obj)) return false;
6282 }
6283 return true;
6284}
6285
6286
6287/***/ }),
6288/* 182 */
6289/***/ (function(module, __webpack_exports__, __webpack_require__) {
6290
6291"use strict";
6292/* harmony export (immutable) */ __webpack_exports__["a"] = invert;
6293/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__keys_js__ = __webpack_require__(15);
6294
6295
6296// Invert the keys and values of an object. The values must be serializable.
6297function invert(obj) {
6298 var result = {};
6299 var _keys = Object(__WEBPACK_IMPORTED_MODULE_0__keys_js__["a" /* default */])(obj);
6300 for (var i = 0, length = _keys.length; i < length; i++) {
6301 result[obj[_keys[i]]] = _keys[i];
6302 }
6303 return result;
6304}
6305
6306
6307/***/ }),
6308/* 183 */
6309/***/ (function(module, __webpack_exports__, __webpack_require__) {
6310
6311"use strict";
6312/* harmony export (immutable) */ __webpack_exports__["a"] = functions;
6313/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isFunction_js__ = __webpack_require__(27);
6314
6315
6316// Return a sorted list of the function names available on the object.
6317function functions(obj) {
6318 var names = [];
6319 for (var key in obj) {
6320 if (Object(__WEBPACK_IMPORTED_MODULE_0__isFunction_js__["a" /* default */])(obj[key])) names.push(key);
6321 }
6322 return names.sort();
6323}
6324
6325
6326/***/ }),
6327/* 184 */
6328/***/ (function(module, __webpack_exports__, __webpack_require__) {
6329
6330"use strict";
6331/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createAssigner_js__ = __webpack_require__(132);
6332/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__allKeys_js__ = __webpack_require__(80);
6333
6334
6335
6336// Extend a given object with all the properties in passed-in object(s).
6337/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createAssigner_js__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__allKeys_js__["a" /* default */]));
6338
6339
6340/***/ }),
6341/* 185 */
6342/***/ (function(module, __webpack_exports__, __webpack_require__) {
6343
6344"use strict";
6345/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createAssigner_js__ = __webpack_require__(132);
6346/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__allKeys_js__ = __webpack_require__(80);
6347
6348
6349
6350// Fill in a given object with default properties.
6351/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createAssigner_js__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__allKeys_js__["a" /* default */], true));
6352
6353
6354/***/ }),
6355/* 186 */
6356/***/ (function(module, __webpack_exports__, __webpack_require__) {
6357
6358"use strict";
6359/* harmony export (immutable) */ __webpack_exports__["a"] = baseCreate;
6360/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isObject_js__ = __webpack_require__(52);
6361/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__setup_js__ = __webpack_require__(5);
6362
6363
6364
6365// Create a naked function reference for surrogate-prototype-swapping.
6366function ctor() {
6367 return function(){};
6368}
6369
6370// An internal function for creating a new object that inherits from another.
6371function baseCreate(prototype) {
6372 if (!Object(__WEBPACK_IMPORTED_MODULE_0__isObject_js__["a" /* default */])(prototype)) return {};
6373 if (__WEBPACK_IMPORTED_MODULE_1__setup_js__["j" /* nativeCreate */]) return Object(__WEBPACK_IMPORTED_MODULE_1__setup_js__["j" /* nativeCreate */])(prototype);
6374 var Ctor = ctor();
6375 Ctor.prototype = prototype;
6376 var result = new Ctor;
6377 Ctor.prototype = null;
6378 return result;
6379}
6380
6381
6382/***/ }),
6383/* 187 */
6384/***/ (function(module, __webpack_exports__, __webpack_require__) {
6385
6386"use strict";
6387/* harmony export (immutable) */ __webpack_exports__["a"] = clone;
6388/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isObject_js__ = __webpack_require__(52);
6389/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isArray_js__ = __webpack_require__(53);
6390/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__extend_js__ = __webpack_require__(184);
6391
6392
6393
6394
6395// Create a (shallow-cloned) duplicate of an object.
6396function clone(obj) {
6397 if (!Object(__WEBPACK_IMPORTED_MODULE_0__isObject_js__["a" /* default */])(obj)) return obj;
6398 return Object(__WEBPACK_IMPORTED_MODULE_1__isArray_js__["a" /* default */])(obj) ? obj.slice() : Object(__WEBPACK_IMPORTED_MODULE_2__extend_js__["a" /* default */])({}, obj);
6399}
6400
6401
6402/***/ }),
6403/* 188 */
6404/***/ (function(module, __webpack_exports__, __webpack_require__) {
6405
6406"use strict";
6407/* harmony export (immutable) */ __webpack_exports__["a"] = get;
6408/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__toPath_js__ = __webpack_require__(81);
6409/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__deepGet_js__ = __webpack_require__(134);
6410/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__isUndefined_js__ = __webpack_require__(170);
6411
6412
6413
6414
6415// Get the value of the (deep) property on `path` from `object`.
6416// If any property in `path` does not exist or if the value is
6417// `undefined`, return `defaultValue` instead.
6418// The `path` is normalized through `_.toPath`.
6419function get(object, path, defaultValue) {
6420 var value = Object(__WEBPACK_IMPORTED_MODULE_1__deepGet_js__["a" /* default */])(object, Object(__WEBPACK_IMPORTED_MODULE_0__toPath_js__["a" /* default */])(path));
6421 return Object(__WEBPACK_IMPORTED_MODULE_2__isUndefined_js__["a" /* default */])(value) ? defaultValue : value;
6422}
6423
6424
6425/***/ }),
6426/* 189 */
6427/***/ (function(module, __webpack_exports__, __webpack_require__) {
6428
6429"use strict";
6430/* harmony export (immutable) */ __webpack_exports__["a"] = toPath;
6431/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__underscore_js__ = __webpack_require__(24);
6432/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isArray_js__ = __webpack_require__(53);
6433
6434
6435
6436// Normalize a (deep) property `path` to array.
6437// Like `_.iteratee`, this function can be customized.
6438function toPath(path) {
6439 return Object(__WEBPACK_IMPORTED_MODULE_1__isArray_js__["a" /* default */])(path) ? path : [path];
6440}
6441__WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */].toPath = toPath;
6442
6443
6444/***/ }),
6445/* 190 */
6446/***/ (function(module, __webpack_exports__, __webpack_require__) {
6447
6448"use strict";
6449/* harmony export (immutable) */ __webpack_exports__["a"] = baseIteratee;
6450/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__identity_js__ = __webpack_require__(135);
6451/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isFunction_js__ = __webpack_require__(27);
6452/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__isObject_js__ = __webpack_require__(52);
6453/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__isArray_js__ = __webpack_require__(53);
6454/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__matcher_js__ = __webpack_require__(103);
6455/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__property_js__ = __webpack_require__(136);
6456/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__optimizeCb_js__ = __webpack_require__(82);
6457
6458
6459
6460
6461
6462
6463
6464
6465// An internal function to generate callbacks that can be applied to each
6466// element in a collection, returning the desired result — either `_.identity`,
6467// an arbitrary callback, a property matcher, or a property accessor.
6468function baseIteratee(value, context, argCount) {
6469 if (value == null) return __WEBPACK_IMPORTED_MODULE_0__identity_js__["a" /* default */];
6470 if (Object(__WEBPACK_IMPORTED_MODULE_1__isFunction_js__["a" /* default */])(value)) return Object(__WEBPACK_IMPORTED_MODULE_6__optimizeCb_js__["a" /* default */])(value, context, argCount);
6471 if (Object(__WEBPACK_IMPORTED_MODULE_2__isObject_js__["a" /* default */])(value) && !Object(__WEBPACK_IMPORTED_MODULE_3__isArray_js__["a" /* default */])(value)) return Object(__WEBPACK_IMPORTED_MODULE_4__matcher_js__["a" /* default */])(value);
6472 return Object(__WEBPACK_IMPORTED_MODULE_5__property_js__["a" /* default */])(value);
6473}
6474
6475
6476/***/ }),
6477/* 191 */
6478/***/ (function(module, __webpack_exports__, __webpack_require__) {
6479
6480"use strict";
6481/* harmony export (immutable) */ __webpack_exports__["a"] = iteratee;
6482/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__underscore_js__ = __webpack_require__(24);
6483/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__baseIteratee_js__ = __webpack_require__(190);
6484
6485
6486
6487// External wrapper for our callback generator. Users may customize
6488// `_.iteratee` if they want additional predicate/iteratee shorthand styles.
6489// This abstraction hides the internal-only `argCount` argument.
6490function iteratee(value, context) {
6491 return Object(__WEBPACK_IMPORTED_MODULE_1__baseIteratee_js__["a" /* default */])(value, context, Infinity);
6492}
6493__WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */].iteratee = iteratee;
6494
6495
6496/***/ }),
6497/* 192 */
6498/***/ (function(module, __webpack_exports__, __webpack_require__) {
6499
6500"use strict";
6501/* harmony export (immutable) */ __webpack_exports__["a"] = noop;
6502// Predicate-generating function. Often useful outside of Underscore.
6503function noop(){}
6504
6505
6506/***/ }),
6507/* 193 */
6508/***/ (function(module, __webpack_exports__, __webpack_require__) {
6509
6510"use strict";
6511/* harmony export (immutable) */ __webpack_exports__["a"] = random;
6512// Return a random integer between `min` and `max` (inclusive).
6513function random(min, max) {
6514 if (max == null) {
6515 max = min;
6516 min = 0;
6517 }
6518 return min + Math.floor(Math.random() * (max - min + 1));
6519}
6520
6521
6522/***/ }),
6523/* 194 */
6524/***/ (function(module, __webpack_exports__, __webpack_require__) {
6525
6526"use strict";
6527/* harmony export (immutable) */ __webpack_exports__["a"] = createEscaper;
6528/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__keys_js__ = __webpack_require__(15);
6529
6530
6531// Internal helper to generate functions for escaping and unescaping strings
6532// to/from HTML interpolation.
6533function createEscaper(map) {
6534 var escaper = function(match) {
6535 return map[match];
6536 };
6537 // Regexes for identifying a key that needs to be escaped.
6538 var source = '(?:' + Object(__WEBPACK_IMPORTED_MODULE_0__keys_js__["a" /* default */])(map).join('|') + ')';
6539 var testRegexp = RegExp(source);
6540 var replaceRegexp = RegExp(source, 'g');
6541 return function(string) {
6542 string = string == null ? '' : '' + string;
6543 return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string;
6544 };
6545}
6546
6547
6548/***/ }),
6549/* 195 */
6550/***/ (function(module, __webpack_exports__, __webpack_require__) {
6551
6552"use strict";
6553// Internal list of HTML entities for escaping.
6554/* harmony default export */ __webpack_exports__["a"] = ({
6555 '&': '&amp;',
6556 '<': '&lt;',
6557 '>': '&gt;',
6558 '"': '&quot;',
6559 "'": '&#x27;',
6560 '`': '&#x60;'
6561});
6562
6563
6564/***/ }),
6565/* 196 */
6566/***/ (function(module, __webpack_exports__, __webpack_require__) {
6567
6568"use strict";
6569/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__underscore_js__ = __webpack_require__(24);
6570
6571
6572// By default, Underscore uses ERB-style template delimiters. Change the
6573// following template settings to use alternative delimiters.
6574/* harmony default export */ __webpack_exports__["a"] = (__WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */].templateSettings = {
6575 evaluate: /<%([\s\S]+?)%>/g,
6576 interpolate: /<%=([\s\S]+?)%>/g,
6577 escape: /<%-([\s\S]+?)%>/g
6578});
6579
6580
6581/***/ }),
6582/* 197 */
6583/***/ (function(module, __webpack_exports__, __webpack_require__) {
6584
6585"use strict";
6586/* harmony export (immutable) */ __webpack_exports__["a"] = executeBound;
6587/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__baseCreate_js__ = __webpack_require__(186);
6588/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isObject_js__ = __webpack_require__(52);
6589
6590
6591
6592// Internal function to execute `sourceFunc` bound to `context` with optional
6593// `args`. Determines whether to execute a function as a constructor or as a
6594// normal function.
6595function executeBound(sourceFunc, boundFunc, context, callingContext, args) {
6596 if (!(callingContext instanceof boundFunc)) return sourceFunc.apply(context, args);
6597 var self = Object(__WEBPACK_IMPORTED_MODULE_0__baseCreate_js__["a" /* default */])(sourceFunc.prototype);
6598 var result = sourceFunc.apply(self, args);
6599 if (Object(__WEBPACK_IMPORTED_MODULE_1__isObject_js__["a" /* default */])(result)) return result;
6600 return self;
6601}
6602
6603
6604/***/ }),
6605/* 198 */
6606/***/ (function(module, __webpack_exports__, __webpack_require__) {
6607
6608"use strict";
6609/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(23);
6610/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isFunction_js__ = __webpack_require__(27);
6611/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__executeBound_js__ = __webpack_require__(197);
6612
6613
6614
6615
6616// Create a function bound to a given object (assigning `this`, and arguments,
6617// optionally).
6618/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" /* default */])(function(func, context, args) {
6619 if (!Object(__WEBPACK_IMPORTED_MODULE_1__isFunction_js__["a" /* default */])(func)) throw new TypeError('Bind must be called on a function');
6620 var bound = Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" /* default */])(function(callArgs) {
6621 return Object(__WEBPACK_IMPORTED_MODULE_2__executeBound_js__["a" /* default */])(func, bound, context, this, args.concat(callArgs));
6622 });
6623 return bound;
6624}));
6625
6626
6627/***/ }),
6628/* 199 */
6629/***/ (function(module, __webpack_exports__, __webpack_require__) {
6630
6631"use strict";
6632/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(23);
6633
6634
6635// Delays a function for the given number of milliseconds, and then calls
6636// it with the arguments supplied.
6637/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" /* default */])(function(func, wait, args) {
6638 return setTimeout(function() {
6639 return func.apply(null, args);
6640 }, wait);
6641}));
6642
6643
6644/***/ }),
6645/* 200 */
6646/***/ (function(module, __webpack_exports__, __webpack_require__) {
6647
6648"use strict";
6649/* harmony export (immutable) */ __webpack_exports__["a"] = before;
6650// Returns a function that will only be executed up to (but not including) the
6651// Nth call.
6652function before(times, func) {
6653 var memo;
6654 return function() {
6655 if (--times > 0) {
6656 memo = func.apply(this, arguments);
6657 }
6658 if (times <= 1) func = null;
6659 return memo;
6660 };
6661}
6662
6663
6664/***/ }),
6665/* 201 */
6666/***/ (function(module, __webpack_exports__, __webpack_require__) {
6667
6668"use strict";
6669/* harmony export (immutable) */ __webpack_exports__["a"] = findKey;
6670/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__cb_js__ = __webpack_require__(20);
6671/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__keys_js__ = __webpack_require__(15);
6672
6673
6674
6675// Returns the first key on an object that passes a truth test.
6676function findKey(obj, predicate, context) {
6677 predicate = Object(__WEBPACK_IMPORTED_MODULE_0__cb_js__["a" /* default */])(predicate, context);
6678 var _keys = Object(__WEBPACK_IMPORTED_MODULE_1__keys_js__["a" /* default */])(obj), key;
6679 for (var i = 0, length = _keys.length; i < length; i++) {
6680 key = _keys[i];
6681 if (predicate(obj[key], key, obj)) return key;
6682 }
6683}
6684
6685
6686/***/ }),
6687/* 202 */
6688/***/ (function(module, __webpack_exports__, __webpack_require__) {
6689
6690"use strict";
6691/* harmony export (immutable) */ __webpack_exports__["a"] = createPredicateIndexFinder;
6692/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__cb_js__ = __webpack_require__(20);
6693/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__getLength_js__ = __webpack_require__(28);
6694
6695
6696
6697// Internal function to generate `_.findIndex` and `_.findLastIndex`.
6698function createPredicateIndexFinder(dir) {
6699 return function(array, predicate, context) {
6700 predicate = Object(__WEBPACK_IMPORTED_MODULE_0__cb_js__["a" /* default */])(predicate, context);
6701 var length = Object(__WEBPACK_IMPORTED_MODULE_1__getLength_js__["a" /* default */])(array);
6702 var index = dir > 0 ? 0 : length - 1;
6703 for (; index >= 0 && index < length; index += dir) {
6704 if (predicate(array[index], index, array)) return index;
6705 }
6706 return -1;
6707 };
6708}
6709
6710
6711/***/ }),
6712/* 203 */
6713/***/ (function(module, __webpack_exports__, __webpack_require__) {
6714
6715"use strict";
6716/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createPredicateIndexFinder_js__ = __webpack_require__(202);
6717
6718
6719// Returns the last index on an array-like that passes a truth test.
6720/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createPredicateIndexFinder_js__["a" /* default */])(-1));
6721
6722
6723/***/ }),
6724/* 204 */
6725/***/ (function(module, __webpack_exports__, __webpack_require__) {
6726
6727"use strict";
6728/* harmony export (immutable) */ __webpack_exports__["a"] = sortedIndex;
6729/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__cb_js__ = __webpack_require__(20);
6730/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__getLength_js__ = __webpack_require__(28);
6731
6732
6733
6734// Use a comparator function to figure out the smallest index at which
6735// an object should be inserted so as to maintain order. Uses binary search.
6736function sortedIndex(array, obj, iteratee, context) {
6737 iteratee = Object(__WEBPACK_IMPORTED_MODULE_0__cb_js__["a" /* default */])(iteratee, context, 1);
6738 var value = iteratee(obj);
6739 var low = 0, high = Object(__WEBPACK_IMPORTED_MODULE_1__getLength_js__["a" /* default */])(array);
6740 while (low < high) {
6741 var mid = Math.floor((low + high) / 2);
6742 if (iteratee(array[mid]) < value) low = mid + 1; else high = mid;
6743 }
6744 return low;
6745}
6746
6747
6748/***/ }),
6749/* 205 */
6750/***/ (function(module, __webpack_exports__, __webpack_require__) {
6751
6752"use strict";
6753/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__sortedIndex_js__ = __webpack_require__(204);
6754/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__findIndex_js__ = __webpack_require__(139);
6755/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__createIndexFinder_js__ = __webpack_require__(206);
6756
6757
6758
6759
6760// Return the position of the first occurrence of an item in an array,
6761// or -1 if the item is not included in the array.
6762// If the array is large and already in sort order, pass `true`
6763// for **isSorted** to use binary search.
6764/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_2__createIndexFinder_js__["a" /* default */])(1, __WEBPACK_IMPORTED_MODULE_1__findIndex_js__["a" /* default */], __WEBPACK_IMPORTED_MODULE_0__sortedIndex_js__["a" /* default */]));
6765
6766
6767/***/ }),
6768/* 206 */
6769/***/ (function(module, __webpack_exports__, __webpack_require__) {
6770
6771"use strict";
6772/* harmony export (immutable) */ __webpack_exports__["a"] = createIndexFinder;
6773/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__getLength_js__ = __webpack_require__(28);
6774/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__setup_js__ = __webpack_require__(5);
6775/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__isNaN_js__ = __webpack_require__(175);
6776
6777
6778
6779
6780// Internal function to generate the `_.indexOf` and `_.lastIndexOf` functions.
6781function createIndexFinder(dir, predicateFind, sortedIndex) {
6782 return function(array, item, idx) {
6783 var i = 0, length = Object(__WEBPACK_IMPORTED_MODULE_0__getLength_js__["a" /* default */])(array);
6784 if (typeof idx == 'number') {
6785 if (dir > 0) {
6786 i = idx >= 0 ? idx : Math.max(idx + length, i);
6787 } else {
6788 length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;
6789 }
6790 } else if (sortedIndex && idx && length) {
6791 idx = sortedIndex(array, item);
6792 return array[idx] === item ? idx : -1;
6793 }
6794 if (item !== item) {
6795 idx = predicateFind(__WEBPACK_IMPORTED_MODULE_1__setup_js__["q" /* slice */].call(array, i, length), __WEBPACK_IMPORTED_MODULE_2__isNaN_js__["a" /* default */]);
6796 return idx >= 0 ? idx + i : -1;
6797 }
6798 for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {
6799 if (array[idx] === item) return idx;
6800 }
6801 return -1;
6802 };
6803}
6804
6805
6806/***/ }),
6807/* 207 */
6808/***/ (function(module, __webpack_exports__, __webpack_require__) {
6809
6810"use strict";
6811/* harmony export (immutable) */ __webpack_exports__["a"] = find;
6812/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__ = __webpack_require__(25);
6813/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__findIndex_js__ = __webpack_require__(139);
6814/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__findKey_js__ = __webpack_require__(201);
6815
6816
6817
6818
6819// Return the first value which passes a truth test.
6820function find(obj, predicate, context) {
6821 var keyFinder = Object(__WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__["a" /* default */])(obj) ? __WEBPACK_IMPORTED_MODULE_1__findIndex_js__["a" /* default */] : __WEBPACK_IMPORTED_MODULE_2__findKey_js__["a" /* default */];
6822 var key = keyFinder(obj, predicate, context);
6823 if (key !== void 0 && key !== -1) return obj[key];
6824}
6825
6826
6827/***/ }),
6828/* 208 */
6829/***/ (function(module, __webpack_exports__, __webpack_require__) {
6830
6831"use strict";
6832/* harmony export (immutable) */ __webpack_exports__["a"] = createReduce;
6833/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__ = __webpack_require__(25);
6834/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__keys_js__ = __webpack_require__(15);
6835/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__optimizeCb_js__ = __webpack_require__(82);
6836
6837
6838
6839
6840// Internal helper to create a reducing function, iterating left or right.
6841function createReduce(dir) {
6842 // Wrap code that reassigns argument variables in a separate function than
6843 // the one that accesses `arguments.length` to avoid a perf hit. (#1991)
6844 var reducer = function(obj, iteratee, memo, initial) {
6845 var _keys = !Object(__WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__["a" /* default */])(obj) && Object(__WEBPACK_IMPORTED_MODULE_1__keys_js__["a" /* default */])(obj),
6846 length = (_keys || obj).length,
6847 index = dir > 0 ? 0 : length - 1;
6848 if (!initial) {
6849 memo = obj[_keys ? _keys[index] : index];
6850 index += dir;
6851 }
6852 for (; index >= 0 && index < length; index += dir) {
6853 var currentKey = _keys ? _keys[index] : index;
6854 memo = iteratee(memo, obj[currentKey], currentKey, obj);
6855 }
6856 return memo;
6857 };
6858
6859 return function(obj, iteratee, memo, context) {
6860 var initial = arguments.length >= 3;
6861 return reducer(obj, Object(__WEBPACK_IMPORTED_MODULE_2__optimizeCb_js__["a" /* default */])(iteratee, context, 4), memo, initial);
6862 };
6863}
6864
6865
6866/***/ }),
6867/* 209 */
6868/***/ (function(module, __webpack_exports__, __webpack_require__) {
6869
6870"use strict";
6871/* harmony export (immutable) */ __webpack_exports__["a"] = max;
6872/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__ = __webpack_require__(25);
6873/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__values_js__ = __webpack_require__(62);
6874/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__cb_js__ = __webpack_require__(20);
6875/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__each_js__ = __webpack_require__(54);
6876
6877
6878
6879
6880
6881// Return the maximum element (or element-based computation).
6882function max(obj, iteratee, context) {
6883 var result = -Infinity, lastComputed = -Infinity,
6884 value, computed;
6885 if (iteratee == null || typeof iteratee == 'number' && typeof obj[0] != 'object' && obj != null) {
6886 obj = Object(__WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__["a" /* default */])(obj) ? obj : Object(__WEBPACK_IMPORTED_MODULE_1__values_js__["a" /* default */])(obj);
6887 for (var i = 0, length = obj.length; i < length; i++) {
6888 value = obj[i];
6889 if (value != null && value > result) {
6890 result = value;
6891 }
6892 }
6893 } else {
6894 iteratee = Object(__WEBPACK_IMPORTED_MODULE_2__cb_js__["a" /* default */])(iteratee, context);
6895 Object(__WEBPACK_IMPORTED_MODULE_3__each_js__["a" /* default */])(obj, function(v, index, list) {
6896 computed = iteratee(v, index, list);
6897 if (computed > lastComputed || computed === -Infinity && result === -Infinity) {
6898 result = v;
6899 lastComputed = computed;
6900 }
6901 });
6902 }
6903 return result;
6904}
6905
6906
6907/***/ }),
6908/* 210 */
6909/***/ (function(module, __webpack_exports__, __webpack_require__) {
6910
6911"use strict";
6912/* harmony export (immutable) */ __webpack_exports__["a"] = sample;
6913/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__ = __webpack_require__(25);
6914/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__clone_js__ = __webpack_require__(187);
6915/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__values_js__ = __webpack_require__(62);
6916/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__getLength_js__ = __webpack_require__(28);
6917/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__random_js__ = __webpack_require__(193);
6918
6919
6920
6921
6922
6923
6924// Sample **n** random values from a collection using the modern version of the
6925// [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher–Yates_shuffle).
6926// If **n** is not specified, returns a single random element.
6927// The internal `guard` argument allows it to work with `_.map`.
6928function sample(obj, n, guard) {
6929 if (n == null || guard) {
6930 if (!Object(__WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__["a" /* default */])(obj)) obj = Object(__WEBPACK_IMPORTED_MODULE_2__values_js__["a" /* default */])(obj);
6931 return obj[Object(__WEBPACK_IMPORTED_MODULE_4__random_js__["a" /* default */])(obj.length - 1)];
6932 }
6933 var sample = Object(__WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__["a" /* default */])(obj) ? Object(__WEBPACK_IMPORTED_MODULE_1__clone_js__["a" /* default */])(obj) : Object(__WEBPACK_IMPORTED_MODULE_2__values_js__["a" /* default */])(obj);
6934 var length = Object(__WEBPACK_IMPORTED_MODULE_3__getLength_js__["a" /* default */])(sample);
6935 n = Math.max(Math.min(n, length), 0);
6936 var last = length - 1;
6937 for (var index = 0; index < n; index++) {
6938 var rand = Object(__WEBPACK_IMPORTED_MODULE_4__random_js__["a" /* default */])(index, last);
6939 var temp = sample[index];
6940 sample[index] = sample[rand];
6941 sample[rand] = temp;
6942 }
6943 return sample.slice(0, n);
6944}
6945
6946
6947/***/ }),
6948/* 211 */
6949/***/ (function(module, __webpack_exports__, __webpack_require__) {
6950
6951"use strict";
6952/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(23);
6953/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isFunction_js__ = __webpack_require__(27);
6954/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__optimizeCb_js__ = __webpack_require__(82);
6955/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__allKeys_js__ = __webpack_require__(80);
6956/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__keyInObj_js__ = __webpack_require__(347);
6957/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__flatten_js__ = __webpack_require__(63);
6958
6959
6960
6961
6962
6963
6964
6965// Return a copy of the object only containing the allowed properties.
6966/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" /* default */])(function(obj, keys) {
6967 var result = {}, iteratee = keys[0];
6968 if (obj == null) return result;
6969 if (Object(__WEBPACK_IMPORTED_MODULE_1__isFunction_js__["a" /* default */])(iteratee)) {
6970 if (keys.length > 1) iteratee = Object(__WEBPACK_IMPORTED_MODULE_2__optimizeCb_js__["a" /* default */])(iteratee, keys[1]);
6971 keys = Object(__WEBPACK_IMPORTED_MODULE_3__allKeys_js__["a" /* default */])(obj);
6972 } else {
6973 iteratee = __WEBPACK_IMPORTED_MODULE_4__keyInObj_js__["a" /* default */];
6974 keys = Object(__WEBPACK_IMPORTED_MODULE_5__flatten_js__["a" /* default */])(keys, false, false);
6975 obj = Object(obj);
6976 }
6977 for (var i = 0, length = keys.length; i < length; i++) {
6978 var key = keys[i];
6979 var value = obj[key];
6980 if (iteratee(value, key, obj)) result[key] = value;
6981 }
6982 return result;
6983}));
6984
6985
6986/***/ }),
6987/* 212 */
6988/***/ (function(module, __webpack_exports__, __webpack_require__) {
6989
6990"use strict";
6991/* harmony export (immutable) */ __webpack_exports__["a"] = initial;
6992/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(5);
6993
6994
6995// Returns everything but the last entry of the array. Especially useful on
6996// the arguments object. Passing **n** will return all the values in
6997// the array, excluding the last N.
6998function initial(array, n, guard) {
6999 return __WEBPACK_IMPORTED_MODULE_0__setup_js__["q" /* slice */].call(array, 0, Math.max(0, array.length - (n == null || guard ? 1 : n)));
7000}
7001
7002
7003/***/ }),
7004/* 213 */
7005/***/ (function(module, __webpack_exports__, __webpack_require__) {
7006
7007"use strict";
7008/* harmony export (immutable) */ __webpack_exports__["a"] = rest;
7009/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(5);
7010
7011
7012// Returns everything but the first entry of the `array`. Especially useful on
7013// the `arguments` object. Passing an **n** will return the rest N values in the
7014// `array`.
7015function rest(array, n, guard) {
7016 return __WEBPACK_IMPORTED_MODULE_0__setup_js__["q" /* slice */].call(array, n == null || guard ? 1 : n);
7017}
7018
7019
7020/***/ }),
7021/* 214 */
7022/***/ (function(module, __webpack_exports__, __webpack_require__) {
7023
7024"use strict";
7025/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(23);
7026/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__flatten_js__ = __webpack_require__(63);
7027/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__filter_js__ = __webpack_require__(83);
7028/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__contains_js__ = __webpack_require__(84);
7029
7030
7031
7032
7033
7034// Take the difference between one array and a number of other arrays.
7035// Only the elements present in just the first array will remain.
7036/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" /* default */])(function(array, rest) {
7037 rest = Object(__WEBPACK_IMPORTED_MODULE_1__flatten_js__["a" /* default */])(rest, true, true);
7038 return Object(__WEBPACK_IMPORTED_MODULE_2__filter_js__["a" /* default */])(array, function(value){
7039 return !Object(__WEBPACK_IMPORTED_MODULE_3__contains_js__["a" /* default */])(rest, value);
7040 });
7041}));
7042
7043
7044/***/ }),
7045/* 215 */
7046/***/ (function(module, __webpack_exports__, __webpack_require__) {
7047
7048"use strict";
7049/* harmony export (immutable) */ __webpack_exports__["a"] = uniq;
7050/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isBoolean_js__ = __webpack_require__(171);
7051/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__cb_js__ = __webpack_require__(20);
7052/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__getLength_js__ = __webpack_require__(28);
7053/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__contains_js__ = __webpack_require__(84);
7054
7055
7056
7057
7058
7059// Produce a duplicate-free version of the array. If the array has already
7060// been sorted, you have the option of using a faster algorithm.
7061// The faster algorithm will not work with an iteratee if the iteratee
7062// is not a one-to-one function, so providing an iteratee will disable
7063// the faster algorithm.
7064function uniq(array, isSorted, iteratee, context) {
7065 if (!Object(__WEBPACK_IMPORTED_MODULE_0__isBoolean_js__["a" /* default */])(isSorted)) {
7066 context = iteratee;
7067 iteratee = isSorted;
7068 isSorted = false;
7069 }
7070 if (iteratee != null) iteratee = Object(__WEBPACK_IMPORTED_MODULE_1__cb_js__["a" /* default */])(iteratee, context);
7071 var result = [];
7072 var seen = [];
7073 for (var i = 0, length = Object(__WEBPACK_IMPORTED_MODULE_2__getLength_js__["a" /* default */])(array); i < length; i++) {
7074 var value = array[i],
7075 computed = iteratee ? iteratee(value, i, array) : value;
7076 if (isSorted && !iteratee) {
7077 if (!i || seen !== computed) result.push(value);
7078 seen = computed;
7079 } else if (iteratee) {
7080 if (!Object(__WEBPACK_IMPORTED_MODULE_3__contains_js__["a" /* default */])(seen, computed)) {
7081 seen.push(computed);
7082 result.push(value);
7083 }
7084 } else if (!Object(__WEBPACK_IMPORTED_MODULE_3__contains_js__["a" /* default */])(result, value)) {
7085 result.push(value);
7086 }
7087 }
7088 return result;
7089}
7090
7091
7092/***/ }),
7093/* 216 */
7094/***/ (function(module, __webpack_exports__, __webpack_require__) {
7095
7096"use strict";
7097/* harmony export (immutable) */ __webpack_exports__["a"] = unzip;
7098/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__max_js__ = __webpack_require__(209);
7099/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__getLength_js__ = __webpack_require__(28);
7100/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__pluck_js__ = __webpack_require__(140);
7101
7102
7103
7104
7105// Complement of zip. Unzip accepts an array of arrays and groups
7106// each array's elements on shared indices.
7107function unzip(array) {
7108 var length = array && Object(__WEBPACK_IMPORTED_MODULE_0__max_js__["a" /* default */])(array, __WEBPACK_IMPORTED_MODULE_1__getLength_js__["a" /* default */]).length || 0;
7109 var result = Array(length);
7110
7111 for (var index = 0; index < length; index++) {
7112 result[index] = Object(__WEBPACK_IMPORTED_MODULE_2__pluck_js__["a" /* default */])(array, index);
7113 }
7114 return result;
7115}
7116
7117
7118/***/ }),
7119/* 217 */
7120/***/ (function(module, __webpack_exports__, __webpack_require__) {
7121
7122"use strict";
7123/* harmony export (immutable) */ __webpack_exports__["a"] = chainResult;
7124/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__underscore_js__ = __webpack_require__(24);
7125
7126
7127// Helper function to continue chaining intermediate results.
7128function chainResult(instance, obj) {
7129 return instance._chain ? Object(__WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */])(obj).chain() : obj;
7130}
7131
7132
7133/***/ }),
7134/* 218 */
7135/***/ (function(module, exports, __webpack_require__) {
7136
7137"use strict";
7138
7139var $ = __webpack_require__(0);
7140var fails = __webpack_require__(3);
7141var isArray = __webpack_require__(85);
7142var isObject = __webpack_require__(11);
7143var toObject = __webpack_require__(34);
7144var lengthOfArrayLike = __webpack_require__(46);
7145var doesNotExceedSafeInteger = __webpack_require__(365);
7146var createProperty = __webpack_require__(106);
7147var arraySpeciesCreate = __webpack_require__(219);
7148var arrayMethodHasSpeciesSupport = __webpack_require__(107);
7149var wellKnownSymbol = __webpack_require__(9);
7150var V8_VERSION = __webpack_require__(90);
7151
7152var IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable');
7153
7154// We can't use this feature detection in V8 since it causes
7155// deoptimization and serious performance degradation
7156// https://github.com/zloirock/core-js/issues/679
7157var IS_CONCAT_SPREADABLE_SUPPORT = V8_VERSION >= 51 || !fails(function () {
7158 var array = [];
7159 array[IS_CONCAT_SPREADABLE] = false;
7160 return array.concat()[0] !== array;
7161});
7162
7163var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('concat');
7164
7165var isConcatSpreadable = function (O) {
7166 if (!isObject(O)) return false;
7167 var spreadable = O[IS_CONCAT_SPREADABLE];
7168 return spreadable !== undefined ? !!spreadable : isArray(O);
7169};
7170
7171var FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT;
7172
7173// `Array.prototype.concat` method
7174// https://tc39.es/ecma262/#sec-array.prototype.concat
7175// with adding support of @@isConcatSpreadable and @@species
7176$({ target: 'Array', proto: true, arity: 1, forced: FORCED }, {
7177 // eslint-disable-next-line no-unused-vars -- required for `.length`
7178 concat: function concat(arg) {
7179 var O = toObject(this);
7180 var A = arraySpeciesCreate(O, 0);
7181 var n = 0;
7182 var i, k, length, len, E;
7183 for (i = -1, length = arguments.length; i < length; i++) {
7184 E = i === -1 ? O : arguments[i];
7185 if (isConcatSpreadable(E)) {
7186 len = lengthOfArrayLike(E);
7187 doesNotExceedSafeInteger(n + len);
7188 for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]);
7189 } else {
7190 doesNotExceedSafeInteger(n + 1);
7191 createProperty(A, n++, E);
7192 }
7193 }
7194 A.length = n;
7195 return A;
7196 }
7197});
7198
7199
7200/***/ }),
7201/* 219 */
7202/***/ (function(module, exports, __webpack_require__) {
7203
7204var arraySpeciesConstructor = __webpack_require__(366);
7205
7206// `ArraySpeciesCreate` abstract operation
7207// https://tc39.es/ecma262/#sec-arrayspeciescreate
7208module.exports = function (originalArray, length) {
7209 return new (arraySpeciesConstructor(originalArray))(length === 0 ? 0 : length);
7210};
7211
7212
7213/***/ }),
7214/* 220 */
7215/***/ (function(module, exports, __webpack_require__) {
7216
7217var $ = __webpack_require__(0);
7218var getBuiltIn = __webpack_require__(18);
7219var apply = __webpack_require__(69);
7220var call = __webpack_require__(13);
7221var uncurryThis = __webpack_require__(4);
7222var fails = __webpack_require__(3);
7223var isArray = __webpack_require__(85);
7224var isCallable = __webpack_require__(7);
7225var isObject = __webpack_require__(11);
7226var isSymbol = __webpack_require__(89);
7227var arraySlice = __webpack_require__(102);
7228var NATIVE_SYMBOL = __webpack_require__(57);
7229
7230var $stringify = getBuiltIn('JSON', 'stringify');
7231var exec = uncurryThis(/./.exec);
7232var charAt = uncurryThis(''.charAt);
7233var charCodeAt = uncurryThis(''.charCodeAt);
7234var replace = uncurryThis(''.replace);
7235var numberToString = uncurryThis(1.0.toString);
7236
7237var tester = /[\uD800-\uDFFF]/g;
7238var low = /^[\uD800-\uDBFF]$/;
7239var hi = /^[\uDC00-\uDFFF]$/;
7240
7241var WRONG_SYMBOLS_CONVERSION = !NATIVE_SYMBOL || fails(function () {
7242 var symbol = getBuiltIn('Symbol')();
7243 // MS Edge converts symbol values to JSON as {}
7244 return $stringify([symbol]) != '[null]'
7245 // WebKit converts symbol values to JSON as null
7246 || $stringify({ a: symbol }) != '{}'
7247 // V8 throws on boxed symbols
7248 || $stringify(Object(symbol)) != '{}';
7249});
7250
7251// https://github.com/tc39/proposal-well-formed-stringify
7252var ILL_FORMED_UNICODE = fails(function () {
7253 return $stringify('\uDF06\uD834') !== '"\\udf06\\ud834"'
7254 || $stringify('\uDEAD') !== '"\\udead"';
7255});
7256
7257var stringifyWithSymbolsFix = function (it, replacer) {
7258 var args = arraySlice(arguments);
7259 var $replacer = replacer;
7260 if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined
7261 if (!isArray(replacer)) replacer = function (key, value) {
7262 if (isCallable($replacer)) value = call($replacer, this, key, value);
7263 if (!isSymbol(value)) return value;
7264 };
7265 args[1] = replacer;
7266 return apply($stringify, null, args);
7267};
7268
7269var fixIllFormed = function (match, offset, string) {
7270 var prev = charAt(string, offset - 1);
7271 var next = charAt(string, offset + 1);
7272 if ((exec(low, match) && !exec(hi, next)) || (exec(hi, match) && !exec(low, prev))) {
7273 return '\\u' + numberToString(charCodeAt(match, 0), 16);
7274 } return match;
7275};
7276
7277if ($stringify) {
7278 // `JSON.stringify` method
7279 // https://tc39.es/ecma262/#sec-json.stringify
7280 $({ target: 'JSON', stat: true, arity: 3, forced: WRONG_SYMBOLS_CONVERSION || ILL_FORMED_UNICODE }, {
7281 // eslint-disable-next-line no-unused-vars -- required for `.length`
7282 stringify: function stringify(it, replacer, space) {
7283 var args = arraySlice(arguments);
7284 var result = apply(WRONG_SYMBOLS_CONVERSION ? stringifyWithSymbolsFix : $stringify, null, args);
7285 return ILL_FORMED_UNICODE && typeof result == 'string' ? replace(result, tester, fixIllFormed) : result;
7286 }
7287 });
7288}
7289
7290
7291/***/ }),
7292/* 221 */
7293/***/ (function(module, exports, __webpack_require__) {
7294
7295var rng = __webpack_require__(384);
7296var bytesToUuid = __webpack_require__(385);
7297
7298function v4(options, buf, offset) {
7299 var i = buf && offset || 0;
7300
7301 if (typeof(options) == 'string') {
7302 buf = options === 'binary' ? new Array(16) : null;
7303 options = null;
7304 }
7305 options = options || {};
7306
7307 var rnds = options.random || (options.rng || rng)();
7308
7309 // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
7310 rnds[6] = (rnds[6] & 0x0f) | 0x40;
7311 rnds[8] = (rnds[8] & 0x3f) | 0x80;
7312
7313 // Copy bytes to buffer, if provided
7314 if (buf) {
7315 for (var ii = 0; ii < 16; ++ii) {
7316 buf[i + ii] = rnds[ii];
7317 }
7318 }
7319
7320 return buf || bytesToUuid(rnds);
7321}
7322
7323module.exports = v4;
7324
7325
7326/***/ }),
7327/* 222 */
7328/***/ (function(module, exports, __webpack_require__) {
7329
7330var parent = __webpack_require__(388);
7331
7332module.exports = parent;
7333
7334
7335/***/ }),
7336/* 223 */
7337/***/ (function(module, exports, __webpack_require__) {
7338
7339"use strict";
7340
7341
7342module.exports = '4.15.1';
7343
7344/***/ }),
7345/* 224 */
7346/***/ (function(module, exports, __webpack_require__) {
7347
7348"use strict";
7349
7350
7351var has = Object.prototype.hasOwnProperty
7352 , prefix = '~';
7353
7354/**
7355 * Constructor to create a storage for our `EE` objects.
7356 * An `Events` instance is a plain object whose properties are event names.
7357 *
7358 * @constructor
7359 * @api private
7360 */
7361function Events() {}
7362
7363//
7364// We try to not inherit from `Object.prototype`. In some engines creating an
7365// instance in this way is faster than calling `Object.create(null)` directly.
7366// If `Object.create(null)` is not supported we prefix the event names with a
7367// character to make sure that the built-in object properties are not
7368// overridden or used as an attack vector.
7369//
7370if (Object.create) {
7371 Events.prototype = Object.create(null);
7372
7373 //
7374 // This hack is needed because the `__proto__` property is still inherited in
7375 // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5.
7376 //
7377 if (!new Events().__proto__) prefix = false;
7378}
7379
7380/**
7381 * Representation of a single event listener.
7382 *
7383 * @param {Function} fn The listener function.
7384 * @param {Mixed} context The context to invoke the listener with.
7385 * @param {Boolean} [once=false] Specify if the listener is a one-time listener.
7386 * @constructor
7387 * @api private
7388 */
7389function EE(fn, context, once) {
7390 this.fn = fn;
7391 this.context = context;
7392 this.once = once || false;
7393}
7394
7395/**
7396 * Minimal `EventEmitter` interface that is molded against the Node.js
7397 * `EventEmitter` interface.
7398 *
7399 * @constructor
7400 * @api public
7401 */
7402function EventEmitter() {
7403 this._events = new Events();
7404 this._eventsCount = 0;
7405}
7406
7407/**
7408 * Return an array listing the events for which the emitter has registered
7409 * listeners.
7410 *
7411 * @returns {Array}
7412 * @api public
7413 */
7414EventEmitter.prototype.eventNames = function eventNames() {
7415 var names = []
7416 , events
7417 , name;
7418
7419 if (this._eventsCount === 0) return names;
7420
7421 for (name in (events = this._events)) {
7422 if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);
7423 }
7424
7425 if (Object.getOwnPropertySymbols) {
7426 return names.concat(Object.getOwnPropertySymbols(events));
7427 }
7428
7429 return names;
7430};
7431
7432/**
7433 * Return the listeners registered for a given event.
7434 *
7435 * @param {String|Symbol} event The event name.
7436 * @param {Boolean} exists Only check if there are listeners.
7437 * @returns {Array|Boolean}
7438 * @api public
7439 */
7440EventEmitter.prototype.listeners = function listeners(event, exists) {
7441 var evt = prefix ? prefix + event : event
7442 , available = this._events[evt];
7443
7444 if (exists) return !!available;
7445 if (!available) return [];
7446 if (available.fn) return [available.fn];
7447
7448 for (var i = 0, l = available.length, ee = new Array(l); i < l; i++) {
7449 ee[i] = available[i].fn;
7450 }
7451
7452 return ee;
7453};
7454
7455/**
7456 * Calls each of the listeners registered for a given event.
7457 *
7458 * @param {String|Symbol} event The event name.
7459 * @returns {Boolean} `true` if the event had listeners, else `false`.
7460 * @api public
7461 */
7462EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {
7463 var evt = prefix ? prefix + event : event;
7464
7465 if (!this._events[evt]) return false;
7466
7467 var listeners = this._events[evt]
7468 , len = arguments.length
7469 , args
7470 , i;
7471
7472 if (listeners.fn) {
7473 if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);
7474
7475 switch (len) {
7476 case 1: return listeners.fn.call(listeners.context), true;
7477 case 2: return listeners.fn.call(listeners.context, a1), true;
7478 case 3: return listeners.fn.call(listeners.context, a1, a2), true;
7479 case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;
7480 case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;
7481 case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;
7482 }
7483
7484 for (i = 1, args = new Array(len -1); i < len; i++) {
7485 args[i - 1] = arguments[i];
7486 }
7487
7488 listeners.fn.apply(listeners.context, args);
7489 } else {
7490 var length = listeners.length
7491 , j;
7492
7493 for (i = 0; i < length; i++) {
7494 if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);
7495
7496 switch (len) {
7497 case 1: listeners[i].fn.call(listeners[i].context); break;
7498 case 2: listeners[i].fn.call(listeners[i].context, a1); break;
7499 case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;
7500 case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break;
7501 default:
7502 if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {
7503 args[j - 1] = arguments[j];
7504 }
7505
7506 listeners[i].fn.apply(listeners[i].context, args);
7507 }
7508 }
7509 }
7510
7511 return true;
7512};
7513
7514/**
7515 * Add a listener for a given event.
7516 *
7517 * @param {String|Symbol} event The event name.
7518 * @param {Function} fn The listener function.
7519 * @param {Mixed} [context=this] The context to invoke the listener with.
7520 * @returns {EventEmitter} `this`.
7521 * @api public
7522 */
7523EventEmitter.prototype.on = function on(event, fn, context) {
7524 var listener = new EE(fn, context || this)
7525 , evt = prefix ? prefix + event : event;
7526
7527 if (!this._events[evt]) this._events[evt] = listener, this._eventsCount++;
7528 else if (!this._events[evt].fn) this._events[evt].push(listener);
7529 else this._events[evt] = [this._events[evt], listener];
7530
7531 return this;
7532};
7533
7534/**
7535 * Add a one-time listener for a given event.
7536 *
7537 * @param {String|Symbol} event The event name.
7538 * @param {Function} fn The listener function.
7539 * @param {Mixed} [context=this] The context to invoke the listener with.
7540 * @returns {EventEmitter} `this`.
7541 * @api public
7542 */
7543EventEmitter.prototype.once = function once(event, fn, context) {
7544 var listener = new EE(fn, context || this, true)
7545 , evt = prefix ? prefix + event : event;
7546
7547 if (!this._events[evt]) this._events[evt] = listener, this._eventsCount++;
7548 else if (!this._events[evt].fn) this._events[evt].push(listener);
7549 else this._events[evt] = [this._events[evt], listener];
7550
7551 return this;
7552};
7553
7554/**
7555 * Remove the listeners of a given event.
7556 *
7557 * @param {String|Symbol} event The event name.
7558 * @param {Function} fn Only remove the listeners that match this function.
7559 * @param {Mixed} context Only remove the listeners that have this context.
7560 * @param {Boolean} once Only remove one-time listeners.
7561 * @returns {EventEmitter} `this`.
7562 * @api public
7563 */
7564EventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {
7565 var evt = prefix ? prefix + event : event;
7566
7567 if (!this._events[evt]) return this;
7568 if (!fn) {
7569 if (--this._eventsCount === 0) this._events = new Events();
7570 else delete this._events[evt];
7571 return this;
7572 }
7573
7574 var listeners = this._events[evt];
7575
7576 if (listeners.fn) {
7577 if (
7578 listeners.fn === fn
7579 && (!once || listeners.once)
7580 && (!context || listeners.context === context)
7581 ) {
7582 if (--this._eventsCount === 0) this._events = new Events();
7583 else delete this._events[evt];
7584 }
7585 } else {
7586 for (var i = 0, events = [], length = listeners.length; i < length; i++) {
7587 if (
7588 listeners[i].fn !== fn
7589 || (once && !listeners[i].once)
7590 || (context && listeners[i].context !== context)
7591 ) {
7592 events.push(listeners[i]);
7593 }
7594 }
7595
7596 //
7597 // Reset the array, or remove it completely if we have no more listeners.
7598 //
7599 if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;
7600 else if (--this._eventsCount === 0) this._events = new Events();
7601 else delete this._events[evt];
7602 }
7603
7604 return this;
7605};
7606
7607/**
7608 * Remove all listeners, or those of the specified event.
7609 *
7610 * @param {String|Symbol} [event] The event name.
7611 * @returns {EventEmitter} `this`.
7612 * @api public
7613 */
7614EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {
7615 var evt;
7616
7617 if (event) {
7618 evt = prefix ? prefix + event : event;
7619 if (this._events[evt]) {
7620 if (--this._eventsCount === 0) this._events = new Events();
7621 else delete this._events[evt];
7622 }
7623 } else {
7624 this._events = new Events();
7625 this._eventsCount = 0;
7626 }
7627
7628 return this;
7629};
7630
7631//
7632// Alias methods names because people roll like that.
7633//
7634EventEmitter.prototype.off = EventEmitter.prototype.removeListener;
7635EventEmitter.prototype.addListener = EventEmitter.prototype.on;
7636
7637//
7638// This function doesn't apply anymore.
7639//
7640EventEmitter.prototype.setMaxListeners = function setMaxListeners() {
7641 return this;
7642};
7643
7644//
7645// Expose the prefix.
7646//
7647EventEmitter.prefixed = prefix;
7648
7649//
7650// Allow `EventEmitter` to be imported as module namespace.
7651//
7652EventEmitter.EventEmitter = EventEmitter;
7653
7654//
7655// Expose the module.
7656//
7657if (true) {
7658 module.exports = EventEmitter;
7659}
7660
7661
7662/***/ }),
7663/* 225 */
7664/***/ (function(module, exports, __webpack_require__) {
7665
7666"use strict";
7667
7668
7669var _interopRequireDefault = __webpack_require__(1);
7670
7671var _promise = _interopRequireDefault(__webpack_require__(12));
7672
7673var _require = __webpack_require__(68),
7674 getAdapter = _require.getAdapter;
7675
7676var syncApiNames = ['getItem', 'setItem', 'removeItem', 'clear'];
7677var localStorage = {
7678 get async() {
7679 return getAdapter('storage').async;
7680 }
7681
7682}; // wrap sync apis with async ones.
7683
7684syncApiNames.forEach(function (apiName) {
7685 localStorage[apiName + 'Async'] = function () {
7686 var storage = getAdapter('storage');
7687 return _promise.default.resolve(storage[apiName].apply(storage, arguments));
7688 };
7689
7690 localStorage[apiName] = function () {
7691 var storage = getAdapter('storage');
7692
7693 if (!storage.async) {
7694 return storage[apiName].apply(storage, arguments);
7695 }
7696
7697 var error = new Error('Synchronous API [' + apiName + '] is not available in this runtime.');
7698 error.code = 'SYNC_API_NOT_AVAILABLE';
7699 throw error;
7700 };
7701});
7702module.exports = localStorage;
7703
7704/***/ }),
7705/* 226 */
7706/***/ (function(module, exports, __webpack_require__) {
7707
7708"use strict";
7709
7710
7711var _interopRequireDefault = __webpack_require__(1);
7712
7713var _concat = _interopRequireDefault(__webpack_require__(30));
7714
7715var _stringify = _interopRequireDefault(__webpack_require__(36));
7716
7717var storage = __webpack_require__(225);
7718
7719var AV = __webpack_require__(65);
7720
7721var removeAsync = exports.removeAsync = storage.removeItemAsync.bind(storage);
7722
7723var getCacheData = function getCacheData(cacheData, key) {
7724 try {
7725 cacheData = JSON.parse(cacheData);
7726 } catch (e) {
7727 return null;
7728 }
7729
7730 if (cacheData) {
7731 var expired = cacheData.expiredAt && cacheData.expiredAt < Date.now();
7732
7733 if (!expired) {
7734 return cacheData.value;
7735 }
7736
7737 return removeAsync(key).then(function () {
7738 return null;
7739 });
7740 }
7741
7742 return null;
7743};
7744
7745exports.getAsync = function (key) {
7746 var _context;
7747
7748 key = (0, _concat.default)(_context = "AV/".concat(AV.applicationId, "/")).call(_context, key);
7749 return storage.getItemAsync(key).then(function (cache) {
7750 return getCacheData(cache, key);
7751 });
7752};
7753
7754exports.setAsync = function (key, value, ttl) {
7755 var _context2;
7756
7757 var cache = {
7758 value: value
7759 };
7760
7761 if (typeof ttl === 'number') {
7762 cache.expiredAt = Date.now() + ttl;
7763 }
7764
7765 return storage.setItemAsync((0, _concat.default)(_context2 = "AV/".concat(AV.applicationId, "/")).call(_context2, key), (0, _stringify.default)(cache));
7766};
7767
7768/***/ }),
7769/* 227 */
7770/***/ (function(module, exports, __webpack_require__) {
7771
7772module.exports = __webpack_require__(228);
7773
7774/***/ }),
7775/* 228 */
7776/***/ (function(module, exports, __webpack_require__) {
7777
7778var parent = __webpack_require__(390);
7779
7780module.exports = parent;
7781
7782
7783/***/ }),
7784/* 229 */
7785/***/ (function(module, exports, __webpack_require__) {
7786
7787var parent = __webpack_require__(393);
7788
7789module.exports = parent;
7790
7791
7792/***/ }),
7793/* 230 */
7794/***/ (function(module, exports, __webpack_require__) {
7795
7796var parent = __webpack_require__(396);
7797
7798module.exports = parent;
7799
7800
7801/***/ }),
7802/* 231 */
7803/***/ (function(module, exports, __webpack_require__) {
7804
7805module.exports = __webpack_require__(399);
7806
7807/***/ }),
7808/* 232 */
7809/***/ (function(module, exports, __webpack_require__) {
7810
7811var parent = __webpack_require__(402);
7812__webpack_require__(51);
7813
7814module.exports = parent;
7815
7816
7817/***/ }),
7818/* 233 */
7819/***/ (function(module, exports, __webpack_require__) {
7820
7821// TODO: Remove this module from `core-js@4` since it's split to modules listed below
7822__webpack_require__(403);
7823__webpack_require__(405);
7824__webpack_require__(406);
7825__webpack_require__(220);
7826__webpack_require__(407);
7827
7828
7829/***/ }),
7830/* 234 */
7831/***/ (function(module, exports, __webpack_require__) {
7832
7833/* eslint-disable es-x/no-object-getownpropertynames -- safe */
7834var classof = __webpack_require__(56);
7835var toIndexedObject = __webpack_require__(33);
7836var $getOwnPropertyNames = __webpack_require__(96).f;
7837var arraySlice = __webpack_require__(404);
7838
7839var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames
7840 ? Object.getOwnPropertyNames(window) : [];
7841
7842var getWindowNames = function (it) {
7843 try {
7844 return $getOwnPropertyNames(it);
7845 } catch (error) {
7846 return arraySlice(windowNames);
7847 }
7848};
7849
7850// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window
7851module.exports.f = function getOwnPropertyNames(it) {
7852 return windowNames && classof(it) == 'Window'
7853 ? getWindowNames(it)
7854 : $getOwnPropertyNames(toIndexedObject(it));
7855};
7856
7857
7858/***/ }),
7859/* 235 */
7860/***/ (function(module, exports, __webpack_require__) {
7861
7862var call = __webpack_require__(13);
7863var getBuiltIn = __webpack_require__(18);
7864var wellKnownSymbol = __webpack_require__(9);
7865var defineBuiltIn = __webpack_require__(39);
7866
7867module.exports = function () {
7868 var Symbol = getBuiltIn('Symbol');
7869 var SymbolPrototype = Symbol && Symbol.prototype;
7870 var valueOf = SymbolPrototype && SymbolPrototype.valueOf;
7871 var TO_PRIMITIVE = wellKnownSymbol('toPrimitive');
7872
7873 if (SymbolPrototype && !SymbolPrototype[TO_PRIMITIVE]) {
7874 // `Symbol.prototype[@@toPrimitive]` method
7875 // https://tc39.es/ecma262/#sec-symbol.prototype-@@toprimitive
7876 // eslint-disable-next-line no-unused-vars -- required for .length
7877 defineBuiltIn(SymbolPrototype, TO_PRIMITIVE, function (hint) {
7878 return call(valueOf, this);
7879 }, { arity: 1 });
7880 }
7881};
7882
7883
7884/***/ }),
7885/* 236 */
7886/***/ (function(module, exports, __webpack_require__) {
7887
7888var NATIVE_SYMBOL = __webpack_require__(57);
7889
7890/* eslint-disable es-x/no-symbol -- safe */
7891module.exports = NATIVE_SYMBOL && !!Symbol['for'] && !!Symbol.keyFor;
7892
7893
7894/***/ }),
7895/* 237 */
7896/***/ (function(module, exports, __webpack_require__) {
7897
7898var defineWellKnownSymbol = __webpack_require__(8);
7899
7900// `Symbol.iterator` well-known symbol
7901// https://tc39.es/ecma262/#sec-symbol.iterator
7902defineWellKnownSymbol('iterator');
7903
7904
7905/***/ }),
7906/* 238 */
7907/***/ (function(module, exports, __webpack_require__) {
7908
7909var parent = __webpack_require__(436);
7910__webpack_require__(51);
7911
7912module.exports = parent;
7913
7914
7915/***/ }),
7916/* 239 */
7917/***/ (function(module, exports, __webpack_require__) {
7918
7919var parent = __webpack_require__(456);
7920
7921module.exports = parent;
7922
7923
7924/***/ }),
7925/* 240 */
7926/***/ (function(module, exports, __webpack_require__) {
7927
7928module.exports = __webpack_require__(232);
7929
7930/***/ }),
7931/* 241 */
7932/***/ (function(module, exports, __webpack_require__) {
7933
7934module.exports = __webpack_require__(460);
7935
7936/***/ }),
7937/* 242 */
7938/***/ (function(module, exports, __webpack_require__) {
7939
7940"use strict";
7941
7942var uncurryThis = __webpack_require__(4);
7943var aCallable = __webpack_require__(31);
7944var isObject = __webpack_require__(11);
7945var hasOwn = __webpack_require__(14);
7946var arraySlice = __webpack_require__(102);
7947var NATIVE_BIND = __webpack_require__(70);
7948
7949var $Function = Function;
7950var concat = uncurryThis([].concat);
7951var join = uncurryThis([].join);
7952var factories = {};
7953
7954var construct = function (C, argsLength, args) {
7955 if (!hasOwn(factories, argsLength)) {
7956 for (var list = [], i = 0; i < argsLength; i++) list[i] = 'a[' + i + ']';
7957 factories[argsLength] = $Function('C,a', 'return new C(' + join(list, ',') + ')');
7958 } return factories[argsLength](C, args);
7959};
7960
7961// `Function.prototype.bind` method implementation
7962// https://tc39.es/ecma262/#sec-function.prototype.bind
7963module.exports = NATIVE_BIND ? $Function.bind : function bind(that /* , ...args */) {
7964 var F = aCallable(this);
7965 var Prototype = F.prototype;
7966 var partArgs = arraySlice(arguments, 1);
7967 var boundFunction = function bound(/* args... */) {
7968 var args = concat(partArgs, arraySlice(arguments));
7969 return this instanceof boundFunction ? construct(F, args.length, args) : F.apply(that, args);
7970 };
7971 if (isObject(Prototype)) boundFunction.prototype = Prototype;
7972 return boundFunction;
7973};
7974
7975
7976/***/ }),
7977/* 243 */
7978/***/ (function(module, exports, __webpack_require__) {
7979
7980module.exports = __webpack_require__(481);
7981
7982/***/ }),
7983/* 244 */
7984/***/ (function(module, exports, __webpack_require__) {
7985
7986module.exports = __webpack_require__(484);
7987
7988/***/ }),
7989/* 245 */
7990/***/ (function(module, exports) {
7991
7992var charenc = {
7993 // UTF-8 encoding
7994 utf8: {
7995 // Convert a string to a byte array
7996 stringToBytes: function(str) {
7997 return charenc.bin.stringToBytes(unescape(encodeURIComponent(str)));
7998 },
7999
8000 // Convert a byte array to a string
8001 bytesToString: function(bytes) {
8002 return decodeURIComponent(escape(charenc.bin.bytesToString(bytes)));
8003 }
8004 },
8005
8006 // Binary encoding
8007 bin: {
8008 // Convert a string to a byte array
8009 stringToBytes: function(str) {
8010 for (var bytes = [], i = 0; i < str.length; i++)
8011 bytes.push(str.charCodeAt(i) & 0xFF);
8012 return bytes;
8013 },
8014
8015 // Convert a byte array to a string
8016 bytesToString: function(bytes) {
8017 for (var str = [], i = 0; i < bytes.length; i++)
8018 str.push(String.fromCharCode(bytes[i]));
8019 return str.join('');
8020 }
8021 }
8022};
8023
8024module.exports = charenc;
8025
8026
8027/***/ }),
8028/* 246 */
8029/***/ (function(module, exports, __webpack_require__) {
8030
8031module.exports = __webpack_require__(528);
8032
8033/***/ }),
8034/* 247 */
8035/***/ (function(module, exports, __webpack_require__) {
8036
8037var fails = __webpack_require__(3);
8038var isObject = __webpack_require__(11);
8039var classof = __webpack_require__(56);
8040var ARRAY_BUFFER_NON_EXTENSIBLE = __webpack_require__(561);
8041
8042// eslint-disable-next-line es-x/no-object-isextensible -- safe
8043var $isExtensible = Object.isExtensible;
8044var FAILS_ON_PRIMITIVES = fails(function () { $isExtensible(1); });
8045
8046// `Object.isExtensible` method
8047// https://tc39.es/ecma262/#sec-object.isextensible
8048module.exports = (FAILS_ON_PRIMITIVES || ARRAY_BUFFER_NON_EXTENSIBLE) ? function isExtensible(it) {
8049 if (!isObject(it)) return false;
8050 if (ARRAY_BUFFER_NON_EXTENSIBLE && classof(it) == 'ArrayBuffer') return false;
8051 return $isExtensible ? $isExtensible(it) : true;
8052} : $isExtensible;
8053
8054
8055/***/ }),
8056/* 248 */
8057/***/ (function(module, exports, __webpack_require__) {
8058
8059"use strict";
8060
8061var $ = __webpack_require__(0);
8062var global = __webpack_require__(6);
8063var InternalMetadataModule = __webpack_require__(111);
8064var fails = __webpack_require__(3);
8065var createNonEnumerableProperty = __webpack_require__(35);
8066var iterate = __webpack_require__(37);
8067var anInstance = __webpack_require__(100);
8068var isCallable = __webpack_require__(7);
8069var isObject = __webpack_require__(11);
8070var setToStringTag = __webpack_require__(49);
8071var defineProperty = __webpack_require__(22).f;
8072var forEach = __webpack_require__(66).forEach;
8073var DESCRIPTORS = __webpack_require__(16);
8074var InternalStateModule = __webpack_require__(38);
8075
8076var setInternalState = InternalStateModule.set;
8077var internalStateGetterFor = InternalStateModule.getterFor;
8078
8079module.exports = function (CONSTRUCTOR_NAME, wrapper, common) {
8080 var IS_MAP = CONSTRUCTOR_NAME.indexOf('Map') !== -1;
8081 var IS_WEAK = CONSTRUCTOR_NAME.indexOf('Weak') !== -1;
8082 var ADDER = IS_MAP ? 'set' : 'add';
8083 var NativeConstructor = global[CONSTRUCTOR_NAME];
8084 var NativePrototype = NativeConstructor && NativeConstructor.prototype;
8085 var exported = {};
8086 var Constructor;
8087
8088 if (!DESCRIPTORS || !isCallable(NativeConstructor)
8089 || !(IS_WEAK || NativePrototype.forEach && !fails(function () { new NativeConstructor().entries().next(); }))
8090 ) {
8091 // create collection constructor
8092 Constructor = common.getConstructor(wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER);
8093 InternalMetadataModule.enable();
8094 } else {
8095 Constructor = wrapper(function (target, iterable) {
8096 setInternalState(anInstance(target, Prototype), {
8097 type: CONSTRUCTOR_NAME,
8098 collection: new NativeConstructor()
8099 });
8100 if (iterable != undefined) iterate(iterable, target[ADDER], { that: target, AS_ENTRIES: IS_MAP });
8101 });
8102
8103 var Prototype = Constructor.prototype;
8104
8105 var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME);
8106
8107 forEach(['add', 'clear', 'delete', 'forEach', 'get', 'has', 'set', 'keys', 'values', 'entries'], function (KEY) {
8108 var IS_ADDER = KEY == 'add' || KEY == 'set';
8109 if (KEY in NativePrototype && !(IS_WEAK && KEY == 'clear')) {
8110 createNonEnumerableProperty(Prototype, KEY, function (a, b) {
8111 var collection = getInternalState(this).collection;
8112 if (!IS_ADDER && IS_WEAK && !isObject(a)) return KEY == 'get' ? undefined : false;
8113 var result = collection[KEY](a === 0 ? 0 : a, b);
8114 return IS_ADDER ? this : result;
8115 });
8116 }
8117 });
8118
8119 IS_WEAK || defineProperty(Prototype, 'size', {
8120 configurable: true,
8121 get: function () {
8122 return getInternalState(this).collection.size;
8123 }
8124 });
8125 }
8126
8127 setToStringTag(Constructor, CONSTRUCTOR_NAME, false, true);
8128
8129 exported[CONSTRUCTOR_NAME] = Constructor;
8130 $({ global: true, forced: true }, exported);
8131
8132 if (!IS_WEAK) common.setStrong(Constructor, CONSTRUCTOR_NAME, IS_MAP);
8133
8134 return Constructor;
8135};
8136
8137
8138/***/ }),
8139/* 249 */
8140/***/ (function(module, exports, __webpack_require__) {
8141
8142"use strict";
8143
8144
8145var AV = __webpack_require__(250);
8146
8147var useAdatpers = __webpack_require__(545);
8148
8149module.exports = useAdatpers(AV);
8150
8151/***/ }),
8152/* 250 */
8153/***/ (function(module, exports, __webpack_require__) {
8154
8155"use strict";
8156
8157
8158module.exports = __webpack_require__(251);
8159
8160/***/ }),
8161/* 251 */
8162/***/ (function(module, exports, __webpack_require__) {
8163
8164"use strict";
8165
8166
8167var _interopRequireDefault = __webpack_require__(1);
8168
8169var _promise = _interopRequireDefault(__webpack_require__(12));
8170
8171/*!
8172 * LeanCloud JavaScript SDK
8173 * https://leancloud.cn
8174 *
8175 * Copyright 2016 LeanCloud.cn, Inc.
8176 * The LeanCloud JavaScript SDK is freely distributable under the MIT license.
8177 */
8178var _ = __webpack_require__(2);
8179
8180var AV = __webpack_require__(65);
8181
8182AV._ = _;
8183AV.version = __webpack_require__(223);
8184AV.Promise = _promise.default;
8185AV.localStorage = __webpack_require__(225);
8186AV.Cache = __webpack_require__(226);
8187AV.Error = __webpack_require__(43);
8188
8189__webpack_require__(392);
8190
8191__webpack_require__(443)(AV);
8192
8193__webpack_require__(444)(AV);
8194
8195__webpack_require__(445)(AV);
8196
8197__webpack_require__(446)(AV);
8198
8199__webpack_require__(451)(AV);
8200
8201__webpack_require__(452)(AV);
8202
8203__webpack_require__(506)(AV);
8204
8205__webpack_require__(531)(AV);
8206
8207__webpack_require__(532)(AV);
8208
8209__webpack_require__(534)(AV);
8210
8211__webpack_require__(535)(AV);
8212
8213__webpack_require__(536)(AV);
8214
8215__webpack_require__(537)(AV);
8216
8217__webpack_require__(538)(AV);
8218
8219__webpack_require__(539)(AV);
8220
8221__webpack_require__(540)(AV);
8222
8223__webpack_require__(541)(AV);
8224
8225__webpack_require__(542)(AV);
8226
8227AV.Conversation = __webpack_require__(543);
8228
8229__webpack_require__(544);
8230
8231module.exports = AV;
8232/**
8233 * Options to controll the authentication for an operation
8234 * @typedef {Object} AuthOptions
8235 * @property {String} [sessionToken] Specify a user to excute the operation as.
8236 * @property {AV.User} [user] Specify a user to excute the operation as. The user must have _sessionToken. This option will be ignored if sessionToken option provided.
8237 * @property {Boolean} [useMasterKey] Indicates whether masterKey is used for this operation. Only valid when masterKey is set.
8238 */
8239
8240/**
8241 * Options to controll the authentication for an SMS operation
8242 * @typedef {Object} SMSAuthOptions
8243 * @property {String} [sessionToken] Specify a user to excute the operation as.
8244 * @property {AV.User} [user] Specify a user to excute the operation as. The user must have _sessionToken. This option will be ignored if sessionToken option provided.
8245 * @property {Boolean} [useMasterKey] Indicates whether masterKey is used for this operation. Only valid when masterKey is set.
8246 * @property {String} [validateToken] a validate token returned by {@link AV.Cloud.verifyCaptcha}
8247 */
8248
8249/***/ }),
8250/* 252 */
8251/***/ (function(module, exports, __webpack_require__) {
8252
8253var parent = __webpack_require__(253);
8254__webpack_require__(51);
8255
8256module.exports = parent;
8257
8258
8259/***/ }),
8260/* 253 */
8261/***/ (function(module, exports, __webpack_require__) {
8262
8263__webpack_require__(254);
8264__webpack_require__(48);
8265__webpack_require__(60);
8266__webpack_require__(271);
8267__webpack_require__(285);
8268__webpack_require__(286);
8269__webpack_require__(287);
8270__webpack_require__(78);
8271var path = __webpack_require__(10);
8272
8273module.exports = path.Promise;
8274
8275
8276/***/ }),
8277/* 254 */
8278/***/ (function(module, exports, __webpack_require__) {
8279
8280// TODO: Remove this module from `core-js@4` since it's replaced to module below
8281__webpack_require__(255);
8282
8283
8284/***/ }),
8285/* 255 */
8286/***/ (function(module, exports, __webpack_require__) {
8287
8288"use strict";
8289
8290var $ = __webpack_require__(0);
8291var isPrototypeOf = __webpack_require__(21);
8292var getPrototypeOf = __webpack_require__(93);
8293var setPrototypeOf = __webpack_require__(95);
8294var copyConstructorProperties = __webpack_require__(260);
8295var create = __webpack_require__(47);
8296var createNonEnumerableProperty = __webpack_require__(35);
8297var createPropertyDescriptor = __webpack_require__(44);
8298var clearErrorStack = __webpack_require__(264);
8299var installErrorCause = __webpack_require__(265);
8300var iterate = __webpack_require__(37);
8301var normalizeStringArgument = __webpack_require__(266);
8302var wellKnownSymbol = __webpack_require__(9);
8303var ERROR_STACK_INSTALLABLE = __webpack_require__(267);
8304
8305var TO_STRING_TAG = wellKnownSymbol('toStringTag');
8306var $Error = Error;
8307var push = [].push;
8308
8309var $AggregateError = function AggregateError(errors, message /* , options */) {
8310 var options = arguments.length > 2 ? arguments[2] : undefined;
8311 var isInstance = isPrototypeOf(AggregateErrorPrototype, this);
8312 var that;
8313 if (setPrototypeOf) {
8314 that = setPrototypeOf(new $Error(), isInstance ? getPrototypeOf(this) : AggregateErrorPrototype);
8315 } else {
8316 that = isInstance ? this : create(AggregateErrorPrototype);
8317 createNonEnumerableProperty(that, TO_STRING_TAG, 'Error');
8318 }
8319 if (message !== undefined) createNonEnumerableProperty(that, 'message', normalizeStringArgument(message));
8320 if (ERROR_STACK_INSTALLABLE) createNonEnumerableProperty(that, 'stack', clearErrorStack(that.stack, 1));
8321 installErrorCause(that, options);
8322 var errorsArray = [];
8323 iterate(errors, push, { that: errorsArray });
8324 createNonEnumerableProperty(that, 'errors', errorsArray);
8325 return that;
8326};
8327
8328if (setPrototypeOf) setPrototypeOf($AggregateError, $Error);
8329else copyConstructorProperties($AggregateError, $Error, { name: true });
8330
8331var AggregateErrorPrototype = $AggregateError.prototype = create($Error.prototype, {
8332 constructor: createPropertyDescriptor(1, $AggregateError),
8333 message: createPropertyDescriptor(1, ''),
8334 name: createPropertyDescriptor(1, 'AggregateError')
8335});
8336
8337// `AggregateError` constructor
8338// https://tc39.es/ecma262/#sec-aggregate-error-constructor
8339$({ global: true, constructor: true, arity: 2 }, {
8340 AggregateError: $AggregateError
8341});
8342
8343
8344/***/ }),
8345/* 256 */
8346/***/ (function(module, exports, __webpack_require__) {
8347
8348var call = __webpack_require__(13);
8349var isObject = __webpack_require__(11);
8350var isSymbol = __webpack_require__(89);
8351var getMethod = __webpack_require__(116);
8352var ordinaryToPrimitive = __webpack_require__(257);
8353var wellKnownSymbol = __webpack_require__(9);
8354
8355var $TypeError = TypeError;
8356var TO_PRIMITIVE = wellKnownSymbol('toPrimitive');
8357
8358// `ToPrimitive` abstract operation
8359// https://tc39.es/ecma262/#sec-toprimitive
8360module.exports = function (input, pref) {
8361 if (!isObject(input) || isSymbol(input)) return input;
8362 var exoticToPrim = getMethod(input, TO_PRIMITIVE);
8363 var result;
8364 if (exoticToPrim) {
8365 if (pref === undefined) pref = 'default';
8366 result = call(exoticToPrim, input, pref);
8367 if (!isObject(result) || isSymbol(result)) return result;
8368 throw $TypeError("Can't convert object to primitive value");
8369 }
8370 if (pref === undefined) pref = 'number';
8371 return ordinaryToPrimitive(input, pref);
8372};
8373
8374
8375/***/ }),
8376/* 257 */
8377/***/ (function(module, exports, __webpack_require__) {
8378
8379var call = __webpack_require__(13);
8380var isCallable = __webpack_require__(7);
8381var isObject = __webpack_require__(11);
8382
8383var $TypeError = TypeError;
8384
8385// `OrdinaryToPrimitive` abstract operation
8386// https://tc39.es/ecma262/#sec-ordinarytoprimitive
8387module.exports = function (input, pref) {
8388 var fn, val;
8389 if (pref === 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val;
8390 if (isCallable(fn = input.valueOf) && !isObject(val = call(fn, input))) return val;
8391 if (pref !== 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val;
8392 throw $TypeError("Can't convert object to primitive value");
8393};
8394
8395
8396/***/ }),
8397/* 258 */
8398/***/ (function(module, exports, __webpack_require__) {
8399
8400var global = __webpack_require__(6);
8401
8402// eslint-disable-next-line es-x/no-object-defineproperty -- safe
8403var defineProperty = Object.defineProperty;
8404
8405module.exports = function (key, value) {
8406 try {
8407 defineProperty(global, key, { value: value, configurable: true, writable: true });
8408 } catch (error) {
8409 global[key] = value;
8410 } return value;
8411};
8412
8413
8414/***/ }),
8415/* 259 */
8416/***/ (function(module, exports, __webpack_require__) {
8417
8418var isCallable = __webpack_require__(7);
8419
8420var $String = String;
8421var $TypeError = TypeError;
8422
8423module.exports = function (argument) {
8424 if (typeof argument == 'object' || isCallable(argument)) return argument;
8425 throw $TypeError("Can't set " + $String(argument) + ' as a prototype');
8426};
8427
8428
8429/***/ }),
8430/* 260 */
8431/***/ (function(module, exports, __webpack_require__) {
8432
8433var hasOwn = __webpack_require__(14);
8434var ownKeys = __webpack_require__(261);
8435var getOwnPropertyDescriptorModule = __webpack_require__(71);
8436var definePropertyModule = __webpack_require__(22);
8437
8438module.exports = function (target, source, exceptions) {
8439 var keys = ownKeys(source);
8440 var defineProperty = definePropertyModule.f;
8441 var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
8442 for (var i = 0; i < keys.length; i++) {
8443 var key = keys[i];
8444 if (!hasOwn(target, key) && !(exceptions && hasOwn(exceptions, key))) {
8445 defineProperty(target, key, getOwnPropertyDescriptor(source, key));
8446 }
8447 }
8448};
8449
8450
8451/***/ }),
8452/* 261 */
8453/***/ (function(module, exports, __webpack_require__) {
8454
8455var getBuiltIn = __webpack_require__(18);
8456var uncurryThis = __webpack_require__(4);
8457var getOwnPropertyNamesModule = __webpack_require__(96);
8458var getOwnPropertySymbolsModule = __webpack_require__(97);
8459var anObject = __webpack_require__(19);
8460
8461var concat = uncurryThis([].concat);
8462
8463// all object keys, includes non-enumerable and symbols
8464module.exports = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
8465 var keys = getOwnPropertyNamesModule.f(anObject(it));
8466 var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
8467 return getOwnPropertySymbols ? concat(keys, getOwnPropertySymbols(it)) : keys;
8468};
8469
8470
8471/***/ }),
8472/* 262 */
8473/***/ (function(module, exports) {
8474
8475var ceil = Math.ceil;
8476var floor = Math.floor;
8477
8478// `Math.trunc` method
8479// https://tc39.es/ecma262/#sec-math.trunc
8480// eslint-disable-next-line es-x/no-math-trunc -- safe
8481module.exports = Math.trunc || function trunc(x) {
8482 var n = +x;
8483 return (n > 0 ? floor : ceil)(n);
8484};
8485
8486
8487/***/ }),
8488/* 263 */
8489/***/ (function(module, exports, __webpack_require__) {
8490
8491var toIntegerOrInfinity = __webpack_require__(120);
8492
8493var min = Math.min;
8494
8495// `ToLength` abstract operation
8496// https://tc39.es/ecma262/#sec-tolength
8497module.exports = function (argument) {
8498 return argument > 0 ? min(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
8499};
8500
8501
8502/***/ }),
8503/* 264 */
8504/***/ (function(module, exports, __webpack_require__) {
8505
8506var uncurryThis = __webpack_require__(4);
8507
8508var $Error = Error;
8509var replace = uncurryThis(''.replace);
8510
8511var TEST = (function (arg) { return String($Error(arg).stack); })('zxcasd');
8512var V8_OR_CHAKRA_STACK_ENTRY = /\n\s*at [^:]*:[^\n]*/;
8513var IS_V8_OR_CHAKRA_STACK = V8_OR_CHAKRA_STACK_ENTRY.test(TEST);
8514
8515module.exports = function (stack, dropEntries) {
8516 if (IS_V8_OR_CHAKRA_STACK && typeof stack == 'string' && !$Error.prepareStackTrace) {
8517 while (dropEntries--) stack = replace(stack, V8_OR_CHAKRA_STACK_ENTRY, '');
8518 } return stack;
8519};
8520
8521
8522/***/ }),
8523/* 265 */
8524/***/ (function(module, exports, __webpack_require__) {
8525
8526var isObject = __webpack_require__(11);
8527var createNonEnumerableProperty = __webpack_require__(35);
8528
8529// `InstallErrorCause` abstract operation
8530// https://tc39.es/proposal-error-cause/#sec-errorobjects-install-error-cause
8531module.exports = function (O, options) {
8532 if (isObject(options) && 'cause' in options) {
8533 createNonEnumerableProperty(O, 'cause', options.cause);
8534 }
8535};
8536
8537
8538/***/ }),
8539/* 266 */
8540/***/ (function(module, exports, __webpack_require__) {
8541
8542var toString = __webpack_require__(75);
8543
8544module.exports = function (argument, $default) {
8545 return argument === undefined ? arguments.length < 2 ? '' : $default : toString(argument);
8546};
8547
8548
8549/***/ }),
8550/* 267 */
8551/***/ (function(module, exports, __webpack_require__) {
8552
8553var fails = __webpack_require__(3);
8554var createPropertyDescriptor = __webpack_require__(44);
8555
8556module.exports = !fails(function () {
8557 var error = Error('a');
8558 if (!('stack' in error)) return true;
8559 // eslint-disable-next-line es-x/no-object-defineproperty -- safe
8560 Object.defineProperty(error, 'stack', createPropertyDescriptor(1, 7));
8561 return error.stack !== 7;
8562});
8563
8564
8565/***/ }),
8566/* 268 */
8567/***/ (function(module, exports, __webpack_require__) {
8568
8569var DESCRIPTORS = __webpack_require__(16);
8570var hasOwn = __webpack_require__(14);
8571
8572var FunctionPrototype = Function.prototype;
8573// eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
8574var getDescriptor = DESCRIPTORS && Object.getOwnPropertyDescriptor;
8575
8576var EXISTS = hasOwn(FunctionPrototype, 'name');
8577// additional protection from minified / mangled / dropped function names
8578var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
8579var CONFIGURABLE = EXISTS && (!DESCRIPTORS || (DESCRIPTORS && getDescriptor(FunctionPrototype, 'name').configurable));
8580
8581module.exports = {
8582 EXISTS: EXISTS,
8583 PROPER: PROPER,
8584 CONFIGURABLE: CONFIGURABLE
8585};
8586
8587
8588/***/ }),
8589/* 269 */
8590/***/ (function(module, exports, __webpack_require__) {
8591
8592"use strict";
8593
8594var IteratorPrototype = __webpack_require__(161).IteratorPrototype;
8595var create = __webpack_require__(47);
8596var createPropertyDescriptor = __webpack_require__(44);
8597var setToStringTag = __webpack_require__(49);
8598var Iterators = __webpack_require__(58);
8599
8600var returnThis = function () { return this; };
8601
8602module.exports = function (IteratorConstructor, NAME, next, ENUMERABLE_NEXT) {
8603 var TO_STRING_TAG = NAME + ' Iterator';
8604 IteratorConstructor.prototype = create(IteratorPrototype, { next: createPropertyDescriptor(+!ENUMERABLE_NEXT, next) });
8605 setToStringTag(IteratorConstructor, TO_STRING_TAG, false, true);
8606 Iterators[TO_STRING_TAG] = returnThis;
8607 return IteratorConstructor;
8608};
8609
8610
8611/***/ }),
8612/* 270 */
8613/***/ (function(module, exports, __webpack_require__) {
8614
8615"use strict";
8616
8617var TO_STRING_TAG_SUPPORT = __webpack_require__(122);
8618var classof = __webpack_require__(59);
8619
8620// `Object.prototype.toString` method implementation
8621// https://tc39.es/ecma262/#sec-object.prototype.tostring
8622module.exports = TO_STRING_TAG_SUPPORT ? {}.toString : function toString() {
8623 return '[object ' + classof(this) + ']';
8624};
8625
8626
8627/***/ }),
8628/* 271 */
8629/***/ (function(module, exports, __webpack_require__) {
8630
8631// TODO: Remove this module from `core-js@4` since it's split to modules listed below
8632__webpack_require__(272);
8633__webpack_require__(280);
8634__webpack_require__(281);
8635__webpack_require__(282);
8636__webpack_require__(283);
8637__webpack_require__(284);
8638
8639
8640/***/ }),
8641/* 272 */
8642/***/ (function(module, exports, __webpack_require__) {
8643
8644"use strict";
8645
8646var $ = __webpack_require__(0);
8647var IS_PURE = __webpack_require__(32);
8648var IS_NODE = __webpack_require__(125);
8649var global = __webpack_require__(6);
8650var call = __webpack_require__(13);
8651var defineBuiltIn = __webpack_require__(39);
8652var setPrototypeOf = __webpack_require__(95);
8653var setToStringTag = __webpack_require__(49);
8654var setSpecies = __webpack_require__(162);
8655var aCallable = __webpack_require__(31);
8656var isCallable = __webpack_require__(7);
8657var isObject = __webpack_require__(11);
8658var anInstance = __webpack_require__(100);
8659var speciesConstructor = __webpack_require__(163);
8660var task = __webpack_require__(165).set;
8661var microtask = __webpack_require__(274);
8662var hostReportErrors = __webpack_require__(277);
8663var perform = __webpack_require__(76);
8664var Queue = __webpack_require__(278);
8665var InternalStateModule = __webpack_require__(38);
8666var NativePromiseConstructor = __webpack_require__(61);
8667var PromiseConstructorDetection = __webpack_require__(77);
8668var newPromiseCapabilityModule = __webpack_require__(50);
8669
8670var PROMISE = 'Promise';
8671var FORCED_PROMISE_CONSTRUCTOR = PromiseConstructorDetection.CONSTRUCTOR;
8672var NATIVE_PROMISE_REJECTION_EVENT = PromiseConstructorDetection.REJECTION_EVENT;
8673var NATIVE_PROMISE_SUBCLASSING = PromiseConstructorDetection.SUBCLASSING;
8674var getInternalPromiseState = InternalStateModule.getterFor(PROMISE);
8675var setInternalState = InternalStateModule.set;
8676var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;
8677var PromiseConstructor = NativePromiseConstructor;
8678var PromisePrototype = NativePromisePrototype;
8679var TypeError = global.TypeError;
8680var document = global.document;
8681var process = global.process;
8682var newPromiseCapability = newPromiseCapabilityModule.f;
8683var newGenericPromiseCapability = newPromiseCapability;
8684
8685var DISPATCH_EVENT = !!(document && document.createEvent && global.dispatchEvent);
8686var UNHANDLED_REJECTION = 'unhandledrejection';
8687var REJECTION_HANDLED = 'rejectionhandled';
8688var PENDING = 0;
8689var FULFILLED = 1;
8690var REJECTED = 2;
8691var HANDLED = 1;
8692var UNHANDLED = 2;
8693
8694var Internal, OwnPromiseCapability, PromiseWrapper, nativeThen;
8695
8696// helpers
8697var isThenable = function (it) {
8698 var then;
8699 return isObject(it) && isCallable(then = it.then) ? then : false;
8700};
8701
8702var callReaction = function (reaction, state) {
8703 var value = state.value;
8704 var ok = state.state == FULFILLED;
8705 var handler = ok ? reaction.ok : reaction.fail;
8706 var resolve = reaction.resolve;
8707 var reject = reaction.reject;
8708 var domain = reaction.domain;
8709 var result, then, exited;
8710 try {
8711 if (handler) {
8712 if (!ok) {
8713 if (state.rejection === UNHANDLED) onHandleUnhandled(state);
8714 state.rejection = HANDLED;
8715 }
8716 if (handler === true) result = value;
8717 else {
8718 if (domain) domain.enter();
8719 result = handler(value); // can throw
8720 if (domain) {
8721 domain.exit();
8722 exited = true;
8723 }
8724 }
8725 if (result === reaction.promise) {
8726 reject(TypeError('Promise-chain cycle'));
8727 } else if (then = isThenable(result)) {
8728 call(then, result, resolve, reject);
8729 } else resolve(result);
8730 } else reject(value);
8731 } catch (error) {
8732 if (domain && !exited) domain.exit();
8733 reject(error);
8734 }
8735};
8736
8737var notify = function (state, isReject) {
8738 if (state.notified) return;
8739 state.notified = true;
8740 microtask(function () {
8741 var reactions = state.reactions;
8742 var reaction;
8743 while (reaction = reactions.get()) {
8744 callReaction(reaction, state);
8745 }
8746 state.notified = false;
8747 if (isReject && !state.rejection) onUnhandled(state);
8748 });
8749};
8750
8751var dispatchEvent = function (name, promise, reason) {
8752 var event, handler;
8753 if (DISPATCH_EVENT) {
8754 event = document.createEvent('Event');
8755 event.promise = promise;
8756 event.reason = reason;
8757 event.initEvent(name, false, true);
8758 global.dispatchEvent(event);
8759 } else event = { promise: promise, reason: reason };
8760 if (!NATIVE_PROMISE_REJECTION_EVENT && (handler = global['on' + name])) handler(event);
8761 else if (name === UNHANDLED_REJECTION) hostReportErrors('Unhandled promise rejection', reason);
8762};
8763
8764var onUnhandled = function (state) {
8765 call(task, global, function () {
8766 var promise = state.facade;
8767 var value = state.value;
8768 var IS_UNHANDLED = isUnhandled(state);
8769 var result;
8770 if (IS_UNHANDLED) {
8771 result = perform(function () {
8772 if (IS_NODE) {
8773 process.emit('unhandledRejection', value, promise);
8774 } else dispatchEvent(UNHANDLED_REJECTION, promise, value);
8775 });
8776 // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should
8777 state.rejection = IS_NODE || isUnhandled(state) ? UNHANDLED : HANDLED;
8778 if (result.error) throw result.value;
8779 }
8780 });
8781};
8782
8783var isUnhandled = function (state) {
8784 return state.rejection !== HANDLED && !state.parent;
8785};
8786
8787var onHandleUnhandled = function (state) {
8788 call(task, global, function () {
8789 var promise = state.facade;
8790 if (IS_NODE) {
8791 process.emit('rejectionHandled', promise);
8792 } else dispatchEvent(REJECTION_HANDLED, promise, state.value);
8793 });
8794};
8795
8796var bind = function (fn, state, unwrap) {
8797 return function (value) {
8798 fn(state, value, unwrap);
8799 };
8800};
8801
8802var internalReject = function (state, value, unwrap) {
8803 if (state.done) return;
8804 state.done = true;
8805 if (unwrap) state = unwrap;
8806 state.value = value;
8807 state.state = REJECTED;
8808 notify(state, true);
8809};
8810
8811var internalResolve = function (state, value, unwrap) {
8812 if (state.done) return;
8813 state.done = true;
8814 if (unwrap) state = unwrap;
8815 try {
8816 if (state.facade === value) throw TypeError("Promise can't be resolved itself");
8817 var then = isThenable(value);
8818 if (then) {
8819 microtask(function () {
8820 var wrapper = { done: false };
8821 try {
8822 call(then, value,
8823 bind(internalResolve, wrapper, state),
8824 bind(internalReject, wrapper, state)
8825 );
8826 } catch (error) {
8827 internalReject(wrapper, error, state);
8828 }
8829 });
8830 } else {
8831 state.value = value;
8832 state.state = FULFILLED;
8833 notify(state, false);
8834 }
8835 } catch (error) {
8836 internalReject({ done: false }, error, state);
8837 }
8838};
8839
8840// constructor polyfill
8841if (FORCED_PROMISE_CONSTRUCTOR) {
8842 // 25.4.3.1 Promise(executor)
8843 PromiseConstructor = function Promise(executor) {
8844 anInstance(this, PromisePrototype);
8845 aCallable(executor);
8846 call(Internal, this);
8847 var state = getInternalPromiseState(this);
8848 try {
8849 executor(bind(internalResolve, state), bind(internalReject, state));
8850 } catch (error) {
8851 internalReject(state, error);
8852 }
8853 };
8854
8855 PromisePrototype = PromiseConstructor.prototype;
8856
8857 // eslint-disable-next-line no-unused-vars -- required for `.length`
8858 Internal = function Promise(executor) {
8859 setInternalState(this, {
8860 type: PROMISE,
8861 done: false,
8862 notified: false,
8863 parent: false,
8864 reactions: new Queue(),
8865 rejection: false,
8866 state: PENDING,
8867 value: undefined
8868 });
8869 };
8870
8871 // `Promise.prototype.then` method
8872 // https://tc39.es/ecma262/#sec-promise.prototype.then
8873 Internal.prototype = defineBuiltIn(PromisePrototype, 'then', function then(onFulfilled, onRejected) {
8874 var state = getInternalPromiseState(this);
8875 var reaction = newPromiseCapability(speciesConstructor(this, PromiseConstructor));
8876 state.parent = true;
8877 reaction.ok = isCallable(onFulfilled) ? onFulfilled : true;
8878 reaction.fail = isCallable(onRejected) && onRejected;
8879 reaction.domain = IS_NODE ? process.domain : undefined;
8880 if (state.state == PENDING) state.reactions.add(reaction);
8881 else microtask(function () {
8882 callReaction(reaction, state);
8883 });
8884 return reaction.promise;
8885 });
8886
8887 OwnPromiseCapability = function () {
8888 var promise = new Internal();
8889 var state = getInternalPromiseState(promise);
8890 this.promise = promise;
8891 this.resolve = bind(internalResolve, state);
8892 this.reject = bind(internalReject, state);
8893 };
8894
8895 newPromiseCapabilityModule.f = newPromiseCapability = function (C) {
8896 return C === PromiseConstructor || C === PromiseWrapper
8897 ? new OwnPromiseCapability(C)
8898 : newGenericPromiseCapability(C);
8899 };
8900
8901 if (!IS_PURE && isCallable(NativePromiseConstructor) && NativePromisePrototype !== Object.prototype) {
8902 nativeThen = NativePromisePrototype.then;
8903
8904 if (!NATIVE_PROMISE_SUBCLASSING) {
8905 // make `Promise#then` return a polyfilled `Promise` for native promise-based APIs
8906 defineBuiltIn(NativePromisePrototype, 'then', function then(onFulfilled, onRejected) {
8907 var that = this;
8908 return new PromiseConstructor(function (resolve, reject) {
8909 call(nativeThen, that, resolve, reject);
8910 }).then(onFulfilled, onRejected);
8911 // https://github.com/zloirock/core-js/issues/640
8912 }, { unsafe: true });
8913 }
8914
8915 // make `.constructor === Promise` work for native promise-based APIs
8916 try {
8917 delete NativePromisePrototype.constructor;
8918 } catch (error) { /* empty */ }
8919
8920 // make `instanceof Promise` work for native promise-based APIs
8921 if (setPrototypeOf) {
8922 setPrototypeOf(NativePromisePrototype, PromisePrototype);
8923 }
8924 }
8925}
8926
8927$({ global: true, constructor: true, wrap: true, forced: FORCED_PROMISE_CONSTRUCTOR }, {
8928 Promise: PromiseConstructor
8929});
8930
8931setToStringTag(PromiseConstructor, PROMISE, false, true);
8932setSpecies(PROMISE);
8933
8934
8935/***/ }),
8936/* 273 */
8937/***/ (function(module, exports) {
8938
8939var $TypeError = TypeError;
8940
8941module.exports = function (passed, required) {
8942 if (passed < required) throw $TypeError('Not enough arguments');
8943 return passed;
8944};
8945
8946
8947/***/ }),
8948/* 274 */
8949/***/ (function(module, exports, __webpack_require__) {
8950
8951var global = __webpack_require__(6);
8952var bind = __webpack_require__(45);
8953var getOwnPropertyDescriptor = __webpack_require__(71).f;
8954var macrotask = __webpack_require__(165).set;
8955var IS_IOS = __webpack_require__(166);
8956var IS_IOS_PEBBLE = __webpack_require__(275);
8957var IS_WEBOS_WEBKIT = __webpack_require__(276);
8958var IS_NODE = __webpack_require__(125);
8959
8960var MutationObserver = global.MutationObserver || global.WebKitMutationObserver;
8961var document = global.document;
8962var process = global.process;
8963var Promise = global.Promise;
8964// Node.js 11 shows ExperimentalWarning on getting `queueMicrotask`
8965var queueMicrotaskDescriptor = getOwnPropertyDescriptor(global, 'queueMicrotask');
8966var queueMicrotask = queueMicrotaskDescriptor && queueMicrotaskDescriptor.value;
8967
8968var flush, head, last, notify, toggle, node, promise, then;
8969
8970// modern engines have queueMicrotask method
8971if (!queueMicrotask) {
8972 flush = function () {
8973 var parent, fn;
8974 if (IS_NODE && (parent = process.domain)) parent.exit();
8975 while (head) {
8976 fn = head.fn;
8977 head = head.next;
8978 try {
8979 fn();
8980 } catch (error) {
8981 if (head) notify();
8982 else last = undefined;
8983 throw error;
8984 }
8985 } last = undefined;
8986 if (parent) parent.enter();
8987 };
8988
8989 // browsers with MutationObserver, except iOS - https://github.com/zloirock/core-js/issues/339
8990 // also except WebOS Webkit https://github.com/zloirock/core-js/issues/898
8991 if (!IS_IOS && !IS_NODE && !IS_WEBOS_WEBKIT && MutationObserver && document) {
8992 toggle = true;
8993 node = document.createTextNode('');
8994 new MutationObserver(flush).observe(node, { characterData: true });
8995 notify = function () {
8996 node.data = toggle = !toggle;
8997 };
8998 // environments with maybe non-completely correct, but existent Promise
8999 } else if (!IS_IOS_PEBBLE && Promise && Promise.resolve) {
9000 // Promise.resolve without an argument throws an error in LG WebOS 2
9001 promise = Promise.resolve(undefined);
9002 // workaround of WebKit ~ iOS Safari 10.1 bug
9003 promise.constructor = Promise;
9004 then = bind(promise.then, promise);
9005 notify = function () {
9006 then(flush);
9007 };
9008 // Node.js without promises
9009 } else if (IS_NODE) {
9010 notify = function () {
9011 process.nextTick(flush);
9012 };
9013 // for other environments - macrotask based on:
9014 // - setImmediate
9015 // - MessageChannel
9016 // - window.postMessage
9017 // - onreadystatechange
9018 // - setTimeout
9019 } else {
9020 // strange IE + webpack dev server bug - use .bind(global)
9021 macrotask = bind(macrotask, global);
9022 notify = function () {
9023 macrotask(flush);
9024 };
9025 }
9026}
9027
9028module.exports = queueMicrotask || function (fn) {
9029 var task = { fn: fn, next: undefined };
9030 if (last) last.next = task;
9031 if (!head) {
9032 head = task;
9033 notify();
9034 } last = task;
9035};
9036
9037
9038/***/ }),
9039/* 275 */
9040/***/ (function(module, exports, __webpack_require__) {
9041
9042var userAgent = __webpack_require__(91);
9043var global = __webpack_require__(6);
9044
9045module.exports = /ipad|iphone|ipod/i.test(userAgent) && global.Pebble !== undefined;
9046
9047
9048/***/ }),
9049/* 276 */
9050/***/ (function(module, exports, __webpack_require__) {
9051
9052var userAgent = __webpack_require__(91);
9053
9054module.exports = /web0s(?!.*chrome)/i.test(userAgent);
9055
9056
9057/***/ }),
9058/* 277 */
9059/***/ (function(module, exports, __webpack_require__) {
9060
9061var global = __webpack_require__(6);
9062
9063module.exports = function (a, b) {
9064 var console = global.console;
9065 if (console && console.error) {
9066 arguments.length == 1 ? console.error(a) : console.error(a, b);
9067 }
9068};
9069
9070
9071/***/ }),
9072/* 278 */
9073/***/ (function(module, exports) {
9074
9075var Queue = function () {
9076 this.head = null;
9077 this.tail = null;
9078};
9079
9080Queue.prototype = {
9081 add: function (item) {
9082 var entry = { item: item, next: null };
9083 if (this.head) this.tail.next = entry;
9084 else this.head = entry;
9085 this.tail = entry;
9086 },
9087 get: function () {
9088 var entry = this.head;
9089 if (entry) {
9090 this.head = entry.next;
9091 if (this.tail === entry) this.tail = null;
9092 return entry.item;
9093 }
9094 }
9095};
9096
9097module.exports = Queue;
9098
9099
9100/***/ }),
9101/* 279 */
9102/***/ (function(module, exports) {
9103
9104module.exports = typeof window == 'object' && typeof Deno != 'object';
9105
9106
9107/***/ }),
9108/* 280 */
9109/***/ (function(module, exports, __webpack_require__) {
9110
9111"use strict";
9112
9113var $ = __webpack_require__(0);
9114var call = __webpack_require__(13);
9115var aCallable = __webpack_require__(31);
9116var newPromiseCapabilityModule = __webpack_require__(50);
9117var perform = __webpack_require__(76);
9118var iterate = __webpack_require__(37);
9119var PROMISE_STATICS_INCORRECT_ITERATION = __webpack_require__(167);
9120
9121// `Promise.all` method
9122// https://tc39.es/ecma262/#sec-promise.all
9123$({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION }, {
9124 all: function all(iterable) {
9125 var C = this;
9126 var capability = newPromiseCapabilityModule.f(C);
9127 var resolve = capability.resolve;
9128 var reject = capability.reject;
9129 var result = perform(function () {
9130 var $promiseResolve = aCallable(C.resolve);
9131 var values = [];
9132 var counter = 0;
9133 var remaining = 1;
9134 iterate(iterable, function (promise) {
9135 var index = counter++;
9136 var alreadyCalled = false;
9137 remaining++;
9138 call($promiseResolve, C, promise).then(function (value) {
9139 if (alreadyCalled) return;
9140 alreadyCalled = true;
9141 values[index] = value;
9142 --remaining || resolve(values);
9143 }, reject);
9144 });
9145 --remaining || resolve(values);
9146 });
9147 if (result.error) reject(result.value);
9148 return capability.promise;
9149 }
9150});
9151
9152
9153/***/ }),
9154/* 281 */
9155/***/ (function(module, exports, __webpack_require__) {
9156
9157"use strict";
9158
9159var $ = __webpack_require__(0);
9160var IS_PURE = __webpack_require__(32);
9161var FORCED_PROMISE_CONSTRUCTOR = __webpack_require__(77).CONSTRUCTOR;
9162var NativePromiseConstructor = __webpack_require__(61);
9163var getBuiltIn = __webpack_require__(18);
9164var isCallable = __webpack_require__(7);
9165var defineBuiltIn = __webpack_require__(39);
9166
9167var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;
9168
9169// `Promise.prototype.catch` method
9170// https://tc39.es/ecma262/#sec-promise.prototype.catch
9171$({ target: 'Promise', proto: true, forced: FORCED_PROMISE_CONSTRUCTOR, real: true }, {
9172 'catch': function (onRejected) {
9173 return this.then(undefined, onRejected);
9174 }
9175});
9176
9177// makes sure that native promise-based APIs `Promise#catch` properly works with patched `Promise#then`
9178if (!IS_PURE && isCallable(NativePromiseConstructor)) {
9179 var method = getBuiltIn('Promise').prototype['catch'];
9180 if (NativePromisePrototype['catch'] !== method) {
9181 defineBuiltIn(NativePromisePrototype, 'catch', method, { unsafe: true });
9182 }
9183}
9184
9185
9186/***/ }),
9187/* 282 */
9188/***/ (function(module, exports, __webpack_require__) {
9189
9190"use strict";
9191
9192var $ = __webpack_require__(0);
9193var call = __webpack_require__(13);
9194var aCallable = __webpack_require__(31);
9195var newPromiseCapabilityModule = __webpack_require__(50);
9196var perform = __webpack_require__(76);
9197var iterate = __webpack_require__(37);
9198var PROMISE_STATICS_INCORRECT_ITERATION = __webpack_require__(167);
9199
9200// `Promise.race` method
9201// https://tc39.es/ecma262/#sec-promise.race
9202$({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION }, {
9203 race: function race(iterable) {
9204 var C = this;
9205 var capability = newPromiseCapabilityModule.f(C);
9206 var reject = capability.reject;
9207 var result = perform(function () {
9208 var $promiseResolve = aCallable(C.resolve);
9209 iterate(iterable, function (promise) {
9210 call($promiseResolve, C, promise).then(capability.resolve, reject);
9211 });
9212 });
9213 if (result.error) reject(result.value);
9214 return capability.promise;
9215 }
9216});
9217
9218
9219/***/ }),
9220/* 283 */
9221/***/ (function(module, exports, __webpack_require__) {
9222
9223"use strict";
9224
9225var $ = __webpack_require__(0);
9226var call = __webpack_require__(13);
9227var newPromiseCapabilityModule = __webpack_require__(50);
9228var FORCED_PROMISE_CONSTRUCTOR = __webpack_require__(77).CONSTRUCTOR;
9229
9230// `Promise.reject` method
9231// https://tc39.es/ecma262/#sec-promise.reject
9232$({ target: 'Promise', stat: true, forced: FORCED_PROMISE_CONSTRUCTOR }, {
9233 reject: function reject(r) {
9234 var capability = newPromiseCapabilityModule.f(this);
9235 call(capability.reject, undefined, r);
9236 return capability.promise;
9237 }
9238});
9239
9240
9241/***/ }),
9242/* 284 */
9243/***/ (function(module, exports, __webpack_require__) {
9244
9245"use strict";
9246
9247var $ = __webpack_require__(0);
9248var getBuiltIn = __webpack_require__(18);
9249var IS_PURE = __webpack_require__(32);
9250var NativePromiseConstructor = __webpack_require__(61);
9251var FORCED_PROMISE_CONSTRUCTOR = __webpack_require__(77).CONSTRUCTOR;
9252var promiseResolve = __webpack_require__(169);
9253
9254var PromiseConstructorWrapper = getBuiltIn('Promise');
9255var CHECK_WRAPPER = IS_PURE && !FORCED_PROMISE_CONSTRUCTOR;
9256
9257// `Promise.resolve` method
9258// https://tc39.es/ecma262/#sec-promise.resolve
9259$({ target: 'Promise', stat: true, forced: IS_PURE || FORCED_PROMISE_CONSTRUCTOR }, {
9260 resolve: function resolve(x) {
9261 return promiseResolve(CHECK_WRAPPER && this === PromiseConstructorWrapper ? NativePromiseConstructor : this, x);
9262 }
9263});
9264
9265
9266/***/ }),
9267/* 285 */
9268/***/ (function(module, exports, __webpack_require__) {
9269
9270"use strict";
9271
9272var $ = __webpack_require__(0);
9273var call = __webpack_require__(13);
9274var aCallable = __webpack_require__(31);
9275var newPromiseCapabilityModule = __webpack_require__(50);
9276var perform = __webpack_require__(76);
9277var iterate = __webpack_require__(37);
9278
9279// `Promise.allSettled` method
9280// https://tc39.es/ecma262/#sec-promise.allsettled
9281$({ target: 'Promise', stat: true }, {
9282 allSettled: function allSettled(iterable) {
9283 var C = this;
9284 var capability = newPromiseCapabilityModule.f(C);
9285 var resolve = capability.resolve;
9286 var reject = capability.reject;
9287 var result = perform(function () {
9288 var promiseResolve = aCallable(C.resolve);
9289 var values = [];
9290 var counter = 0;
9291 var remaining = 1;
9292 iterate(iterable, function (promise) {
9293 var index = counter++;
9294 var alreadyCalled = false;
9295 remaining++;
9296 call(promiseResolve, C, promise).then(function (value) {
9297 if (alreadyCalled) return;
9298 alreadyCalled = true;
9299 values[index] = { status: 'fulfilled', value: value };
9300 --remaining || resolve(values);
9301 }, function (error) {
9302 if (alreadyCalled) return;
9303 alreadyCalled = true;
9304 values[index] = { status: 'rejected', reason: error };
9305 --remaining || resolve(values);
9306 });
9307 });
9308 --remaining || resolve(values);
9309 });
9310 if (result.error) reject(result.value);
9311 return capability.promise;
9312 }
9313});
9314
9315
9316/***/ }),
9317/* 286 */
9318/***/ (function(module, exports, __webpack_require__) {
9319
9320"use strict";
9321
9322var $ = __webpack_require__(0);
9323var call = __webpack_require__(13);
9324var aCallable = __webpack_require__(31);
9325var getBuiltIn = __webpack_require__(18);
9326var newPromiseCapabilityModule = __webpack_require__(50);
9327var perform = __webpack_require__(76);
9328var iterate = __webpack_require__(37);
9329
9330var PROMISE_ANY_ERROR = 'No one promise resolved';
9331
9332// `Promise.any` method
9333// https://tc39.es/ecma262/#sec-promise.any
9334$({ target: 'Promise', stat: true }, {
9335 any: function any(iterable) {
9336 var C = this;
9337 var AggregateError = getBuiltIn('AggregateError');
9338 var capability = newPromiseCapabilityModule.f(C);
9339 var resolve = capability.resolve;
9340 var reject = capability.reject;
9341 var result = perform(function () {
9342 var promiseResolve = aCallable(C.resolve);
9343 var errors = [];
9344 var counter = 0;
9345 var remaining = 1;
9346 var alreadyResolved = false;
9347 iterate(iterable, function (promise) {
9348 var index = counter++;
9349 var alreadyRejected = false;
9350 remaining++;
9351 call(promiseResolve, C, promise).then(function (value) {
9352 if (alreadyRejected || alreadyResolved) return;
9353 alreadyResolved = true;
9354 resolve(value);
9355 }, function (error) {
9356 if (alreadyRejected || alreadyResolved) return;
9357 alreadyRejected = true;
9358 errors[index] = error;
9359 --remaining || reject(new AggregateError(errors, PROMISE_ANY_ERROR));
9360 });
9361 });
9362 --remaining || reject(new AggregateError(errors, PROMISE_ANY_ERROR));
9363 });
9364 if (result.error) reject(result.value);
9365 return capability.promise;
9366 }
9367});
9368
9369
9370/***/ }),
9371/* 287 */
9372/***/ (function(module, exports, __webpack_require__) {
9373
9374"use strict";
9375
9376var $ = __webpack_require__(0);
9377var IS_PURE = __webpack_require__(32);
9378var NativePromiseConstructor = __webpack_require__(61);
9379var fails = __webpack_require__(3);
9380var getBuiltIn = __webpack_require__(18);
9381var isCallable = __webpack_require__(7);
9382var speciesConstructor = __webpack_require__(163);
9383var promiseResolve = __webpack_require__(169);
9384var defineBuiltIn = __webpack_require__(39);
9385
9386var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;
9387
9388// Safari bug https://bugs.webkit.org/show_bug.cgi?id=200829
9389var NON_GENERIC = !!NativePromiseConstructor && fails(function () {
9390 // eslint-disable-next-line unicorn/no-thenable -- required for testing
9391 NativePromisePrototype['finally'].call({ then: function () { /* empty */ } }, function () { /* empty */ });
9392});
9393
9394// `Promise.prototype.finally` method
9395// https://tc39.es/ecma262/#sec-promise.prototype.finally
9396$({ target: 'Promise', proto: true, real: true, forced: NON_GENERIC }, {
9397 'finally': function (onFinally) {
9398 var C = speciesConstructor(this, getBuiltIn('Promise'));
9399 var isFunction = isCallable(onFinally);
9400 return this.then(
9401 isFunction ? function (x) {
9402 return promiseResolve(C, onFinally()).then(function () { return x; });
9403 } : onFinally,
9404 isFunction ? function (e) {
9405 return promiseResolve(C, onFinally()).then(function () { throw e; });
9406 } : onFinally
9407 );
9408 }
9409});
9410
9411// makes sure that native promise-based APIs `Promise#finally` properly works with patched `Promise#then`
9412if (!IS_PURE && isCallable(NativePromiseConstructor)) {
9413 var method = getBuiltIn('Promise').prototype['finally'];
9414 if (NativePromisePrototype['finally'] !== method) {
9415 defineBuiltIn(NativePromisePrototype, 'finally', method, { unsafe: true });
9416 }
9417}
9418
9419
9420/***/ }),
9421/* 288 */
9422/***/ (function(module, exports, __webpack_require__) {
9423
9424var uncurryThis = __webpack_require__(4);
9425var toIntegerOrInfinity = __webpack_require__(120);
9426var toString = __webpack_require__(75);
9427var requireObjectCoercible = __webpack_require__(115);
9428
9429var charAt = uncurryThis(''.charAt);
9430var charCodeAt = uncurryThis(''.charCodeAt);
9431var stringSlice = uncurryThis(''.slice);
9432
9433var createMethod = function (CONVERT_TO_STRING) {
9434 return function ($this, pos) {
9435 var S = toString(requireObjectCoercible($this));
9436 var position = toIntegerOrInfinity(pos);
9437 var size = S.length;
9438 var first, second;
9439 if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
9440 first = charCodeAt(S, position);
9441 return first < 0xD800 || first > 0xDBFF || position + 1 === size
9442 || (second = charCodeAt(S, position + 1)) < 0xDC00 || second > 0xDFFF
9443 ? CONVERT_TO_STRING
9444 ? charAt(S, position)
9445 : first
9446 : CONVERT_TO_STRING
9447 ? stringSlice(S, position, position + 2)
9448 : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
9449 };
9450};
9451
9452module.exports = {
9453 // `String.prototype.codePointAt` method
9454 // https://tc39.es/ecma262/#sec-string.prototype.codepointat
9455 codeAt: createMethod(false),
9456 // `String.prototype.at` method
9457 // https://github.com/mathiasbynens/String.prototype.at
9458 charAt: createMethod(true)
9459};
9460
9461
9462/***/ }),
9463/* 289 */
9464/***/ (function(module, exports) {
9465
9466// iterable DOM collections
9467// flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
9468module.exports = {
9469 CSSRuleList: 0,
9470 CSSStyleDeclaration: 0,
9471 CSSValueList: 0,
9472 ClientRectList: 0,
9473 DOMRectList: 0,
9474 DOMStringList: 0,
9475 DOMTokenList: 1,
9476 DataTransferItemList: 0,
9477 FileList: 0,
9478 HTMLAllCollection: 0,
9479 HTMLCollection: 0,
9480 HTMLFormElement: 0,
9481 HTMLSelectElement: 0,
9482 MediaList: 0,
9483 MimeTypeArray: 0,
9484 NamedNodeMap: 0,
9485 NodeList: 1,
9486 PaintRequestList: 0,
9487 Plugin: 0,
9488 PluginArray: 0,
9489 SVGLengthList: 0,
9490 SVGNumberList: 0,
9491 SVGPathSegList: 0,
9492 SVGPointList: 0,
9493 SVGStringList: 0,
9494 SVGTransformList: 0,
9495 SourceBufferList: 0,
9496 StyleSheetList: 0,
9497 TextTrackCueList: 0,
9498 TextTrackList: 0,
9499 TouchList: 0
9500};
9501
9502
9503/***/ }),
9504/* 290 */
9505/***/ (function(module, __webpack_exports__, __webpack_require__) {
9506
9507"use strict";
9508/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__index_js__ = __webpack_require__(126);
9509// Default Export
9510// ==============
9511// In this module, we mix our bundled exports into the `_` object and export
9512// the result. This is analogous to setting `module.exports = _` in CommonJS.
9513// Hence, this module is also the entry point of our UMD bundle and the package
9514// entry point for CommonJS and AMD users. In other words, this is (the source
9515// of) the module you are interfacing with when you do any of the following:
9516//
9517// ```js
9518// // CommonJS
9519// var _ = require('underscore');
9520//
9521// // AMD
9522// define(['underscore'], function(_) {...});
9523//
9524// // UMD in the browser
9525// // _ is available as a global variable
9526// ```
9527
9528
9529
9530// Add all of the Underscore functions to the wrapper object.
9531var _ = Object(__WEBPACK_IMPORTED_MODULE_0__index_js__["mixin"])(__WEBPACK_IMPORTED_MODULE_0__index_js__);
9532// Legacy Node.js API.
9533_._ = _;
9534// Export the Underscore API.
9535/* harmony default export */ __webpack_exports__["a"] = (_);
9536
9537
9538/***/ }),
9539/* 291 */
9540/***/ (function(module, __webpack_exports__, __webpack_require__) {
9541
9542"use strict";
9543/* harmony export (immutable) */ __webpack_exports__["a"] = isNull;
9544// Is a given value equal to null?
9545function isNull(obj) {
9546 return obj === null;
9547}
9548
9549
9550/***/ }),
9551/* 292 */
9552/***/ (function(module, __webpack_exports__, __webpack_require__) {
9553
9554"use strict";
9555/* harmony export (immutable) */ __webpack_exports__["a"] = isElement;
9556// Is a given value a DOM element?
9557function isElement(obj) {
9558 return !!(obj && obj.nodeType === 1);
9559}
9560
9561
9562/***/ }),
9563/* 293 */
9564/***/ (function(module, __webpack_exports__, __webpack_require__) {
9565
9566"use strict";
9567/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(17);
9568
9569
9570/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" /* default */])('Date'));
9571
9572
9573/***/ }),
9574/* 294 */
9575/***/ (function(module, __webpack_exports__, __webpack_require__) {
9576
9577"use strict";
9578/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(17);
9579
9580
9581/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" /* default */])('RegExp'));
9582
9583
9584/***/ }),
9585/* 295 */
9586/***/ (function(module, __webpack_exports__, __webpack_require__) {
9587
9588"use strict";
9589/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(17);
9590
9591
9592/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" /* default */])('Error'));
9593
9594
9595/***/ }),
9596/* 296 */
9597/***/ (function(module, __webpack_exports__, __webpack_require__) {
9598
9599"use strict";
9600/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(17);
9601
9602
9603/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" /* default */])('Object'));
9604
9605
9606/***/ }),
9607/* 297 */
9608/***/ (function(module, __webpack_exports__, __webpack_require__) {
9609
9610"use strict";
9611/* harmony export (immutable) */ __webpack_exports__["a"] = isFinite;
9612/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(5);
9613/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isSymbol_js__ = __webpack_require__(173);
9614
9615
9616
9617// Is a given object a finite number?
9618function isFinite(obj) {
9619 return !Object(__WEBPACK_IMPORTED_MODULE_1__isSymbol_js__["a" /* default */])(obj) && Object(__WEBPACK_IMPORTED_MODULE_0__setup_js__["f" /* _isFinite */])(obj) && !isNaN(parseFloat(obj));
9620}
9621
9622
9623/***/ }),
9624/* 298 */
9625/***/ (function(module, __webpack_exports__, __webpack_require__) {
9626
9627"use strict";
9628/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createSizePropertyCheck_js__ = __webpack_require__(178);
9629/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__getByteLength_js__ = __webpack_require__(130);
9630
9631
9632
9633// Internal helper to determine whether we should spend extensive checks against
9634// `ArrayBuffer` et al.
9635/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createSizePropertyCheck_js__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__getByteLength_js__["a" /* default */]));
9636
9637
9638/***/ }),
9639/* 299 */
9640/***/ (function(module, __webpack_exports__, __webpack_require__) {
9641
9642"use strict";
9643/* harmony export (immutable) */ __webpack_exports__["a"] = isEmpty;
9644/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__getLength_js__ = __webpack_require__(28);
9645/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isArray_js__ = __webpack_require__(53);
9646/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__isString_js__ = __webpack_require__(127);
9647/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__isArguments_js__ = __webpack_require__(129);
9648/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__keys_js__ = __webpack_require__(15);
9649
9650
9651
9652
9653
9654
9655// Is a given array, string, or object empty?
9656// An "empty" object has no enumerable own-properties.
9657function isEmpty(obj) {
9658 if (obj == null) return true;
9659 // Skip the more expensive `toString`-based type checks if `obj` has no
9660 // `.length`.
9661 var length = Object(__WEBPACK_IMPORTED_MODULE_0__getLength_js__["a" /* default */])(obj);
9662 if (typeof length == 'number' && (
9663 Object(__WEBPACK_IMPORTED_MODULE_1__isArray_js__["a" /* default */])(obj) || Object(__WEBPACK_IMPORTED_MODULE_2__isString_js__["a" /* default */])(obj) || Object(__WEBPACK_IMPORTED_MODULE_3__isArguments_js__["a" /* default */])(obj)
9664 )) return length === 0;
9665 return Object(__WEBPACK_IMPORTED_MODULE_0__getLength_js__["a" /* default */])(Object(__WEBPACK_IMPORTED_MODULE_4__keys_js__["a" /* default */])(obj)) === 0;
9666}
9667
9668
9669/***/ }),
9670/* 300 */
9671/***/ (function(module, __webpack_exports__, __webpack_require__) {
9672
9673"use strict";
9674/* harmony export (immutable) */ __webpack_exports__["a"] = isEqual;
9675/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__underscore_js__ = __webpack_require__(24);
9676/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__setup_js__ = __webpack_require__(5);
9677/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__getByteLength_js__ = __webpack_require__(130);
9678/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__isTypedArray_js__ = __webpack_require__(176);
9679/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__isFunction_js__ = __webpack_require__(27);
9680/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__stringTagBug_js__ = __webpack_require__(79);
9681/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__isDataView_js__ = __webpack_require__(128);
9682/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__keys_js__ = __webpack_require__(15);
9683/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__has_js__ = __webpack_require__(40);
9684/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__toBufferView_js__ = __webpack_require__(301);
9685
9686
9687
9688
9689
9690
9691
9692
9693
9694
9695
9696// We use this string twice, so give it a name for minification.
9697var tagDataView = '[object DataView]';
9698
9699// Internal recursive comparison function for `_.isEqual`.
9700function eq(a, b, aStack, bStack) {
9701 // Identical objects are equal. `0 === -0`, but they aren't identical.
9702 // See the [Harmony `egal` proposal](https://wiki.ecmascript.org/doku.php?id=harmony:egal).
9703 if (a === b) return a !== 0 || 1 / a === 1 / b;
9704 // `null` or `undefined` only equal to itself (strict comparison).
9705 if (a == null || b == null) return false;
9706 // `NaN`s are equivalent, but non-reflexive.
9707 if (a !== a) return b !== b;
9708 // Exhaust primitive checks
9709 var type = typeof a;
9710 if (type !== 'function' && type !== 'object' && typeof b != 'object') return false;
9711 return deepEq(a, b, aStack, bStack);
9712}
9713
9714// Internal recursive comparison function for `_.isEqual`.
9715function deepEq(a, b, aStack, bStack) {
9716 // Unwrap any wrapped objects.
9717 if (a instanceof __WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */]) a = a._wrapped;
9718 if (b instanceof __WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */]) b = b._wrapped;
9719 // Compare `[[Class]]` names.
9720 var className = __WEBPACK_IMPORTED_MODULE_1__setup_js__["t" /* toString */].call(a);
9721 if (className !== __WEBPACK_IMPORTED_MODULE_1__setup_js__["t" /* toString */].call(b)) return false;
9722 // Work around a bug in IE 10 - Edge 13.
9723 if (__WEBPACK_IMPORTED_MODULE_5__stringTagBug_js__["a" /* hasStringTagBug */] && className == '[object Object]' && Object(__WEBPACK_IMPORTED_MODULE_6__isDataView_js__["a" /* default */])(a)) {
9724 if (!Object(__WEBPACK_IMPORTED_MODULE_6__isDataView_js__["a" /* default */])(b)) return false;
9725 className = tagDataView;
9726 }
9727 switch (className) {
9728 // These types are compared by value.
9729 case '[object RegExp]':
9730 // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i')
9731 case '[object String]':
9732 // Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is
9733 // equivalent to `new String("5")`.
9734 return '' + a === '' + b;
9735 case '[object Number]':
9736 // `NaN`s are equivalent, but non-reflexive.
9737 // Object(NaN) is equivalent to NaN.
9738 if (+a !== +a) return +b !== +b;
9739 // An `egal` comparison is performed for other numeric values.
9740 return +a === 0 ? 1 / +a === 1 / b : +a === +b;
9741 case '[object Date]':
9742 case '[object Boolean]':
9743 // Coerce dates and booleans to numeric primitive values. Dates are compared by their
9744 // millisecond representations. Note that invalid dates with millisecond representations
9745 // of `NaN` are not equivalent.
9746 return +a === +b;
9747 case '[object Symbol]':
9748 return __WEBPACK_IMPORTED_MODULE_1__setup_js__["d" /* SymbolProto */].valueOf.call(a) === __WEBPACK_IMPORTED_MODULE_1__setup_js__["d" /* SymbolProto */].valueOf.call(b);
9749 case '[object ArrayBuffer]':
9750 case tagDataView:
9751 // Coerce to typed array so we can fall through.
9752 return deepEq(Object(__WEBPACK_IMPORTED_MODULE_9__toBufferView_js__["a" /* default */])(a), Object(__WEBPACK_IMPORTED_MODULE_9__toBufferView_js__["a" /* default */])(b), aStack, bStack);
9753 }
9754
9755 var areArrays = className === '[object Array]';
9756 if (!areArrays && Object(__WEBPACK_IMPORTED_MODULE_3__isTypedArray_js__["a" /* default */])(a)) {
9757 var byteLength = Object(__WEBPACK_IMPORTED_MODULE_2__getByteLength_js__["a" /* default */])(a);
9758 if (byteLength !== Object(__WEBPACK_IMPORTED_MODULE_2__getByteLength_js__["a" /* default */])(b)) return false;
9759 if (a.buffer === b.buffer && a.byteOffset === b.byteOffset) return true;
9760 areArrays = true;
9761 }
9762 if (!areArrays) {
9763 if (typeof a != 'object' || typeof b != 'object') return false;
9764
9765 // Objects with different constructors are not equivalent, but `Object`s or `Array`s
9766 // from different frames are.
9767 var aCtor = a.constructor, bCtor = b.constructor;
9768 if (aCtor !== bCtor && !(Object(__WEBPACK_IMPORTED_MODULE_4__isFunction_js__["a" /* default */])(aCtor) && aCtor instanceof aCtor &&
9769 Object(__WEBPACK_IMPORTED_MODULE_4__isFunction_js__["a" /* default */])(bCtor) && bCtor instanceof bCtor)
9770 && ('constructor' in a && 'constructor' in b)) {
9771 return false;
9772 }
9773 }
9774 // Assume equality for cyclic structures. The algorithm for detecting cyclic
9775 // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.
9776
9777 // Initializing stack of traversed objects.
9778 // It's done here since we only need them for objects and arrays comparison.
9779 aStack = aStack || [];
9780 bStack = bStack || [];
9781 var length = aStack.length;
9782 while (length--) {
9783 // Linear search. Performance is inversely proportional to the number of
9784 // unique nested structures.
9785 if (aStack[length] === a) return bStack[length] === b;
9786 }
9787
9788 // Add the first object to the stack of traversed objects.
9789 aStack.push(a);
9790 bStack.push(b);
9791
9792 // Recursively compare objects and arrays.
9793 if (areArrays) {
9794 // Compare array lengths to determine if a deep comparison is necessary.
9795 length = a.length;
9796 if (length !== b.length) return false;
9797 // Deep compare the contents, ignoring non-numeric properties.
9798 while (length--) {
9799 if (!eq(a[length], b[length], aStack, bStack)) return false;
9800 }
9801 } else {
9802 // Deep compare objects.
9803 var _keys = Object(__WEBPACK_IMPORTED_MODULE_7__keys_js__["a" /* default */])(a), key;
9804 length = _keys.length;
9805 // Ensure that both objects contain the same number of properties before comparing deep equality.
9806 if (Object(__WEBPACK_IMPORTED_MODULE_7__keys_js__["a" /* default */])(b).length !== length) return false;
9807 while (length--) {
9808 // Deep compare each member
9809 key = _keys[length];
9810 if (!(Object(__WEBPACK_IMPORTED_MODULE_8__has_js__["a" /* default */])(b, key) && eq(a[key], b[key], aStack, bStack))) return false;
9811 }
9812 }
9813 // Remove the first object from the stack of traversed objects.
9814 aStack.pop();
9815 bStack.pop();
9816 return true;
9817}
9818
9819// Perform a deep comparison to check if two objects are equal.
9820function isEqual(a, b) {
9821 return eq(a, b);
9822}
9823
9824
9825/***/ }),
9826/* 301 */
9827/***/ (function(module, __webpack_exports__, __webpack_require__) {
9828
9829"use strict";
9830/* harmony export (immutable) */ __webpack_exports__["a"] = toBufferView;
9831/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__getByteLength_js__ = __webpack_require__(130);
9832
9833
9834// Internal function to wrap or shallow-copy an ArrayBuffer,
9835// typed array or DataView to a new view, reusing the buffer.
9836function toBufferView(bufferSource) {
9837 return new Uint8Array(
9838 bufferSource.buffer || bufferSource,
9839 bufferSource.byteOffset || 0,
9840 Object(__WEBPACK_IMPORTED_MODULE_0__getByteLength_js__["a" /* default */])(bufferSource)
9841 );
9842}
9843
9844
9845/***/ }),
9846/* 302 */
9847/***/ (function(module, __webpack_exports__, __webpack_require__) {
9848
9849"use strict";
9850/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(17);
9851/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__stringTagBug_js__ = __webpack_require__(79);
9852/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__methodFingerprint_js__ = __webpack_require__(131);
9853
9854
9855
9856
9857/* harmony default export */ __webpack_exports__["a"] = (__WEBPACK_IMPORTED_MODULE_1__stringTagBug_js__["b" /* isIE11 */] ? Object(__WEBPACK_IMPORTED_MODULE_2__methodFingerprint_js__["a" /* ie11fingerprint */])(__WEBPACK_IMPORTED_MODULE_2__methodFingerprint_js__["b" /* mapMethods */]) : Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" /* default */])('Map'));
9858
9859
9860/***/ }),
9861/* 303 */
9862/***/ (function(module, __webpack_exports__, __webpack_require__) {
9863
9864"use strict";
9865/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(17);
9866/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__stringTagBug_js__ = __webpack_require__(79);
9867/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__methodFingerprint_js__ = __webpack_require__(131);
9868
9869
9870
9871
9872/* harmony default export */ __webpack_exports__["a"] = (__WEBPACK_IMPORTED_MODULE_1__stringTagBug_js__["b" /* isIE11 */] ? Object(__WEBPACK_IMPORTED_MODULE_2__methodFingerprint_js__["a" /* ie11fingerprint */])(__WEBPACK_IMPORTED_MODULE_2__methodFingerprint_js__["d" /* weakMapMethods */]) : Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" /* default */])('WeakMap'));
9873
9874
9875/***/ }),
9876/* 304 */
9877/***/ (function(module, __webpack_exports__, __webpack_require__) {
9878
9879"use strict";
9880/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(17);
9881/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__stringTagBug_js__ = __webpack_require__(79);
9882/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__methodFingerprint_js__ = __webpack_require__(131);
9883
9884
9885
9886
9887/* harmony default export */ __webpack_exports__["a"] = (__WEBPACK_IMPORTED_MODULE_1__stringTagBug_js__["b" /* isIE11 */] ? Object(__WEBPACK_IMPORTED_MODULE_2__methodFingerprint_js__["a" /* ie11fingerprint */])(__WEBPACK_IMPORTED_MODULE_2__methodFingerprint_js__["c" /* setMethods */]) : Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" /* default */])('Set'));
9888
9889
9890/***/ }),
9891/* 305 */
9892/***/ (function(module, __webpack_exports__, __webpack_require__) {
9893
9894"use strict";
9895/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(17);
9896
9897
9898/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" /* default */])('WeakSet'));
9899
9900
9901/***/ }),
9902/* 306 */
9903/***/ (function(module, __webpack_exports__, __webpack_require__) {
9904
9905"use strict";
9906/* harmony export (immutable) */ __webpack_exports__["a"] = pairs;
9907/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__keys_js__ = __webpack_require__(15);
9908
9909
9910// Convert an object into a list of `[key, value]` pairs.
9911// The opposite of `_.object` with one argument.
9912function pairs(obj) {
9913 var _keys = Object(__WEBPACK_IMPORTED_MODULE_0__keys_js__["a" /* default */])(obj);
9914 var length = _keys.length;
9915 var pairs = Array(length);
9916 for (var i = 0; i < length; i++) {
9917 pairs[i] = [_keys[i], obj[_keys[i]]];
9918 }
9919 return pairs;
9920}
9921
9922
9923/***/ }),
9924/* 307 */
9925/***/ (function(module, __webpack_exports__, __webpack_require__) {
9926
9927"use strict";
9928/* harmony export (immutable) */ __webpack_exports__["a"] = create;
9929/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__baseCreate_js__ = __webpack_require__(186);
9930/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__extendOwn_js__ = __webpack_require__(133);
9931
9932
9933
9934// Creates an object that inherits from the given prototype object.
9935// If additional properties are provided then they will be added to the
9936// created object.
9937function create(prototype, props) {
9938 var result = Object(__WEBPACK_IMPORTED_MODULE_0__baseCreate_js__["a" /* default */])(prototype);
9939 if (props) Object(__WEBPACK_IMPORTED_MODULE_1__extendOwn_js__["a" /* default */])(result, props);
9940 return result;
9941}
9942
9943
9944/***/ }),
9945/* 308 */
9946/***/ (function(module, __webpack_exports__, __webpack_require__) {
9947
9948"use strict";
9949/* harmony export (immutable) */ __webpack_exports__["a"] = tap;
9950// Invokes `interceptor` with the `obj` and then returns `obj`.
9951// The primary purpose of this method is to "tap into" a method chain, in
9952// order to perform operations on intermediate results within the chain.
9953function tap(obj, interceptor) {
9954 interceptor(obj);
9955 return obj;
9956}
9957
9958
9959/***/ }),
9960/* 309 */
9961/***/ (function(module, __webpack_exports__, __webpack_require__) {
9962
9963"use strict";
9964/* harmony export (immutable) */ __webpack_exports__["a"] = has;
9965/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__has_js__ = __webpack_require__(40);
9966/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__toPath_js__ = __webpack_require__(81);
9967
9968
9969
9970// Shortcut function for checking if an object has a given property directly on
9971// itself (in other words, not on a prototype). Unlike the internal `has`
9972// function, this public version can also traverse nested properties.
9973function has(obj, path) {
9974 path = Object(__WEBPACK_IMPORTED_MODULE_1__toPath_js__["a" /* default */])(path);
9975 var length = path.length;
9976 for (var i = 0; i < length; i++) {
9977 var key = path[i];
9978 if (!Object(__WEBPACK_IMPORTED_MODULE_0__has_js__["a" /* default */])(obj, key)) return false;
9979 obj = obj[key];
9980 }
9981 return !!length;
9982}
9983
9984
9985/***/ }),
9986/* 310 */
9987/***/ (function(module, __webpack_exports__, __webpack_require__) {
9988
9989"use strict";
9990/* harmony export (immutable) */ __webpack_exports__["a"] = mapObject;
9991/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__cb_js__ = __webpack_require__(20);
9992/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__keys_js__ = __webpack_require__(15);
9993
9994
9995
9996// Returns the results of applying the `iteratee` to each element of `obj`.
9997// In contrast to `_.map` it returns an object.
9998function mapObject(obj, iteratee, context) {
9999 iteratee = Object(__WEBPACK_IMPORTED_MODULE_0__cb_js__["a" /* default */])(iteratee, context);
10000 var _keys = Object(__WEBPACK_IMPORTED_MODULE_1__keys_js__["a" /* default */])(obj),
10001 length = _keys.length,
10002 results = {};
10003 for (var index = 0; index < length; index++) {
10004 var currentKey = _keys[index];
10005 results[currentKey] = iteratee(obj[currentKey], currentKey, obj);
10006 }
10007 return results;
10008}
10009
10010
10011/***/ }),
10012/* 311 */
10013/***/ (function(module, __webpack_exports__, __webpack_require__) {
10014
10015"use strict";
10016/* harmony export (immutable) */ __webpack_exports__["a"] = propertyOf;
10017/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__noop_js__ = __webpack_require__(192);
10018/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__get_js__ = __webpack_require__(188);
10019
10020
10021
10022// Generates a function for a given object that returns a given property.
10023function propertyOf(obj) {
10024 if (obj == null) return __WEBPACK_IMPORTED_MODULE_0__noop_js__["a" /* default */];
10025 return function(path) {
10026 return Object(__WEBPACK_IMPORTED_MODULE_1__get_js__["a" /* default */])(obj, path);
10027 };
10028}
10029
10030
10031/***/ }),
10032/* 312 */
10033/***/ (function(module, __webpack_exports__, __webpack_require__) {
10034
10035"use strict";
10036/* harmony export (immutable) */ __webpack_exports__["a"] = times;
10037/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__optimizeCb_js__ = __webpack_require__(82);
10038
10039
10040// Run a function **n** times.
10041function times(n, iteratee, context) {
10042 var accum = Array(Math.max(0, n));
10043 iteratee = Object(__WEBPACK_IMPORTED_MODULE_0__optimizeCb_js__["a" /* default */])(iteratee, context, 1);
10044 for (var i = 0; i < n; i++) accum[i] = iteratee(i);
10045 return accum;
10046}
10047
10048
10049/***/ }),
10050/* 313 */
10051/***/ (function(module, __webpack_exports__, __webpack_require__) {
10052
10053"use strict";
10054/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createEscaper_js__ = __webpack_require__(194);
10055/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__escapeMap_js__ = __webpack_require__(195);
10056
10057
10058
10059// Function for escaping strings to HTML interpolation.
10060/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createEscaper_js__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__escapeMap_js__["a" /* default */]));
10061
10062
10063/***/ }),
10064/* 314 */
10065/***/ (function(module, __webpack_exports__, __webpack_require__) {
10066
10067"use strict";
10068/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createEscaper_js__ = __webpack_require__(194);
10069/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__unescapeMap_js__ = __webpack_require__(315);
10070
10071
10072
10073// Function for unescaping strings from HTML interpolation.
10074/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createEscaper_js__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__unescapeMap_js__["a" /* default */]));
10075
10076
10077/***/ }),
10078/* 315 */
10079/***/ (function(module, __webpack_exports__, __webpack_require__) {
10080
10081"use strict";
10082/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__invert_js__ = __webpack_require__(182);
10083/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__escapeMap_js__ = __webpack_require__(195);
10084
10085
10086
10087// Internal list of HTML entities for unescaping.
10088/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__invert_js__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__escapeMap_js__["a" /* default */]));
10089
10090
10091/***/ }),
10092/* 316 */
10093/***/ (function(module, __webpack_exports__, __webpack_require__) {
10094
10095"use strict";
10096/* harmony export (immutable) */ __webpack_exports__["a"] = template;
10097/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__defaults_js__ = __webpack_require__(185);
10098/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__underscore_js__ = __webpack_require__(24);
10099/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__templateSettings_js__ = __webpack_require__(196);
10100
10101
10102
10103
10104// When customizing `_.templateSettings`, if you don't want to define an
10105// interpolation, evaluation or escaping regex, we need one that is
10106// guaranteed not to match.
10107var noMatch = /(.)^/;
10108
10109// Certain characters need to be escaped so that they can be put into a
10110// string literal.
10111var escapes = {
10112 "'": "'",
10113 '\\': '\\',
10114 '\r': 'r',
10115 '\n': 'n',
10116 '\u2028': 'u2028',
10117 '\u2029': 'u2029'
10118};
10119
10120var escapeRegExp = /\\|'|\r|\n|\u2028|\u2029/g;
10121
10122function escapeChar(match) {
10123 return '\\' + escapes[match];
10124}
10125
10126var bareIdentifier = /^\s*(\w|\$)+\s*$/;
10127
10128// JavaScript micro-templating, similar to John Resig's implementation.
10129// Underscore templating handles arbitrary delimiters, preserves whitespace,
10130// and correctly escapes quotes within interpolated code.
10131// NB: `oldSettings` only exists for backwards compatibility.
10132function template(text, settings, oldSettings) {
10133 if (!settings && oldSettings) settings = oldSettings;
10134 settings = Object(__WEBPACK_IMPORTED_MODULE_0__defaults_js__["a" /* default */])({}, settings, __WEBPACK_IMPORTED_MODULE_1__underscore_js__["a" /* default */].templateSettings);
10135
10136 // Combine delimiters into one regular expression via alternation.
10137 var matcher = RegExp([
10138 (settings.escape || noMatch).source,
10139 (settings.interpolate || noMatch).source,
10140 (settings.evaluate || noMatch).source
10141 ].join('|') + '|$', 'g');
10142
10143 // Compile the template source, escaping string literals appropriately.
10144 var index = 0;
10145 var source = "__p+='";
10146 text.replace(matcher, function(match, escape, interpolate, evaluate, offset) {
10147 source += text.slice(index, offset).replace(escapeRegExp, escapeChar);
10148 index = offset + match.length;
10149
10150 if (escape) {
10151 source += "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'";
10152 } else if (interpolate) {
10153 source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'";
10154 } else if (evaluate) {
10155 source += "';\n" + evaluate + "\n__p+='";
10156 }
10157
10158 // Adobe VMs need the match returned to produce the correct offset.
10159 return match;
10160 });
10161 source += "';\n";
10162
10163 var argument = settings.variable;
10164 if (argument) {
10165 if (!bareIdentifier.test(argument)) throw new Error(argument);
10166 } else {
10167 // If a variable is not specified, place data values in local scope.
10168 source = 'with(obj||{}){\n' + source + '}\n';
10169 argument = 'obj';
10170 }
10171
10172 source = "var __t,__p='',__j=Array.prototype.join," +
10173 "print=function(){__p+=__j.call(arguments,'');};\n" +
10174 source + 'return __p;\n';
10175
10176 var render;
10177 try {
10178 render = new Function(argument, '_', source);
10179 } catch (e) {
10180 e.source = source;
10181 throw e;
10182 }
10183
10184 var template = function(data) {
10185 return render.call(this, data, __WEBPACK_IMPORTED_MODULE_1__underscore_js__["a" /* default */]);
10186 };
10187
10188 // Provide the compiled source as a convenience for precompilation.
10189 template.source = 'function(' + argument + '){\n' + source + '}';
10190
10191 return template;
10192}
10193
10194
10195/***/ }),
10196/* 317 */
10197/***/ (function(module, __webpack_exports__, __webpack_require__) {
10198
10199"use strict";
10200/* harmony export (immutable) */ __webpack_exports__["a"] = result;
10201/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isFunction_js__ = __webpack_require__(27);
10202/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__toPath_js__ = __webpack_require__(81);
10203
10204
10205
10206// Traverses the children of `obj` along `path`. If a child is a function, it
10207// is invoked with its parent as context. Returns the value of the final
10208// child, or `fallback` if any child is undefined.
10209function result(obj, path, fallback) {
10210 path = Object(__WEBPACK_IMPORTED_MODULE_1__toPath_js__["a" /* default */])(path);
10211 var length = path.length;
10212 if (!length) {
10213 return Object(__WEBPACK_IMPORTED_MODULE_0__isFunction_js__["a" /* default */])(fallback) ? fallback.call(obj) : fallback;
10214 }
10215 for (var i = 0; i < length; i++) {
10216 var prop = obj == null ? void 0 : obj[path[i]];
10217 if (prop === void 0) {
10218 prop = fallback;
10219 i = length; // Ensure we don't continue iterating.
10220 }
10221 obj = Object(__WEBPACK_IMPORTED_MODULE_0__isFunction_js__["a" /* default */])(prop) ? prop.call(obj) : prop;
10222 }
10223 return obj;
10224}
10225
10226
10227/***/ }),
10228/* 318 */
10229/***/ (function(module, __webpack_exports__, __webpack_require__) {
10230
10231"use strict";
10232/* harmony export (immutable) */ __webpack_exports__["a"] = uniqueId;
10233// Generate a unique integer id (unique within the entire client session).
10234// Useful for temporary DOM ids.
10235var idCounter = 0;
10236function uniqueId(prefix) {
10237 var id = ++idCounter + '';
10238 return prefix ? prefix + id : id;
10239}
10240
10241
10242/***/ }),
10243/* 319 */
10244/***/ (function(module, __webpack_exports__, __webpack_require__) {
10245
10246"use strict";
10247/* harmony export (immutable) */ __webpack_exports__["a"] = chain;
10248/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__underscore_js__ = __webpack_require__(24);
10249
10250
10251// Start chaining a wrapped Underscore object.
10252function chain(obj) {
10253 var instance = Object(__WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */])(obj);
10254 instance._chain = true;
10255 return instance;
10256}
10257
10258
10259/***/ }),
10260/* 320 */
10261/***/ (function(module, __webpack_exports__, __webpack_require__) {
10262
10263"use strict";
10264/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(23);
10265/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__flatten_js__ = __webpack_require__(63);
10266/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__bind_js__ = __webpack_require__(198);
10267
10268
10269
10270
10271// Bind a number of an object's methods to that object. Remaining arguments
10272// are the method names to be bound. Useful for ensuring that all callbacks
10273// defined on an object belong to it.
10274/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" /* default */])(function(obj, keys) {
10275 keys = Object(__WEBPACK_IMPORTED_MODULE_1__flatten_js__["a" /* default */])(keys, false, false);
10276 var index = keys.length;
10277 if (index < 1) throw new Error('bindAll must be passed function names');
10278 while (index--) {
10279 var key = keys[index];
10280 obj[key] = Object(__WEBPACK_IMPORTED_MODULE_2__bind_js__["a" /* default */])(obj[key], obj);
10281 }
10282 return obj;
10283}));
10284
10285
10286/***/ }),
10287/* 321 */
10288/***/ (function(module, __webpack_exports__, __webpack_require__) {
10289
10290"use strict";
10291/* harmony export (immutable) */ __webpack_exports__["a"] = memoize;
10292/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__has_js__ = __webpack_require__(40);
10293
10294
10295// Memoize an expensive function by storing its results.
10296function memoize(func, hasher) {
10297 var memoize = function(key) {
10298 var cache = memoize.cache;
10299 var address = '' + (hasher ? hasher.apply(this, arguments) : key);
10300 if (!Object(__WEBPACK_IMPORTED_MODULE_0__has_js__["a" /* default */])(cache, address)) cache[address] = func.apply(this, arguments);
10301 return cache[address];
10302 };
10303 memoize.cache = {};
10304 return memoize;
10305}
10306
10307
10308/***/ }),
10309/* 322 */
10310/***/ (function(module, __webpack_exports__, __webpack_require__) {
10311
10312"use strict";
10313/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__partial_js__ = __webpack_require__(104);
10314/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__delay_js__ = __webpack_require__(199);
10315/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__underscore_js__ = __webpack_require__(24);
10316
10317
10318
10319
10320// Defers a function, scheduling it to run after the current call stack has
10321// cleared.
10322/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__partial_js__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__delay_js__["a" /* default */], __WEBPACK_IMPORTED_MODULE_2__underscore_js__["a" /* default */], 1));
10323
10324
10325/***/ }),
10326/* 323 */
10327/***/ (function(module, __webpack_exports__, __webpack_require__) {
10328
10329"use strict";
10330/* harmony export (immutable) */ __webpack_exports__["a"] = throttle;
10331/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__now_js__ = __webpack_require__(137);
10332
10333
10334// Returns a function, that, when invoked, will only be triggered at most once
10335// during a given window of time. Normally, the throttled function will run
10336// as much as it can, without ever going more than once per `wait` duration;
10337// but if you'd like to disable the execution on the leading edge, pass
10338// `{leading: false}`. To disable execution on the trailing edge, ditto.
10339function throttle(func, wait, options) {
10340 var timeout, context, args, result;
10341 var previous = 0;
10342 if (!options) options = {};
10343
10344 var later = function() {
10345 previous = options.leading === false ? 0 : Object(__WEBPACK_IMPORTED_MODULE_0__now_js__["a" /* default */])();
10346 timeout = null;
10347 result = func.apply(context, args);
10348 if (!timeout) context = args = null;
10349 };
10350
10351 var throttled = function() {
10352 var _now = Object(__WEBPACK_IMPORTED_MODULE_0__now_js__["a" /* default */])();
10353 if (!previous && options.leading === false) previous = _now;
10354 var remaining = wait - (_now - previous);
10355 context = this;
10356 args = arguments;
10357 if (remaining <= 0 || remaining > wait) {
10358 if (timeout) {
10359 clearTimeout(timeout);
10360 timeout = null;
10361 }
10362 previous = _now;
10363 result = func.apply(context, args);
10364 if (!timeout) context = args = null;
10365 } else if (!timeout && options.trailing !== false) {
10366 timeout = setTimeout(later, remaining);
10367 }
10368 return result;
10369 };
10370
10371 throttled.cancel = function() {
10372 clearTimeout(timeout);
10373 previous = 0;
10374 timeout = context = args = null;
10375 };
10376
10377 return throttled;
10378}
10379
10380
10381/***/ }),
10382/* 324 */
10383/***/ (function(module, __webpack_exports__, __webpack_require__) {
10384
10385"use strict";
10386/* harmony export (immutable) */ __webpack_exports__["a"] = debounce;
10387/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(23);
10388/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__now_js__ = __webpack_require__(137);
10389
10390
10391
10392// When a sequence of calls of the returned function ends, the argument
10393// function is triggered. The end of a sequence is defined by the `wait`
10394// parameter. If `immediate` is passed, the argument function will be
10395// triggered at the beginning of the sequence instead of at the end.
10396function debounce(func, wait, immediate) {
10397 var timeout, previous, args, result, context;
10398
10399 var later = function() {
10400 var passed = Object(__WEBPACK_IMPORTED_MODULE_1__now_js__["a" /* default */])() - previous;
10401 if (wait > passed) {
10402 timeout = setTimeout(later, wait - passed);
10403 } else {
10404 timeout = null;
10405 if (!immediate) result = func.apply(context, args);
10406 // This check is needed because `func` can recursively invoke `debounced`.
10407 if (!timeout) args = context = null;
10408 }
10409 };
10410
10411 var debounced = Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" /* default */])(function(_args) {
10412 context = this;
10413 args = _args;
10414 previous = Object(__WEBPACK_IMPORTED_MODULE_1__now_js__["a" /* default */])();
10415 if (!timeout) {
10416 timeout = setTimeout(later, wait);
10417 if (immediate) result = func.apply(context, args);
10418 }
10419 return result;
10420 });
10421
10422 debounced.cancel = function() {
10423 clearTimeout(timeout);
10424 timeout = args = context = null;
10425 };
10426
10427 return debounced;
10428}
10429
10430
10431/***/ }),
10432/* 325 */
10433/***/ (function(module, __webpack_exports__, __webpack_require__) {
10434
10435"use strict";
10436/* harmony export (immutable) */ __webpack_exports__["a"] = wrap;
10437/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__partial_js__ = __webpack_require__(104);
10438
10439
10440// Returns the first function passed as an argument to the second,
10441// allowing you to adjust arguments, run code before and after, and
10442// conditionally execute the original function.
10443function wrap(func, wrapper) {
10444 return Object(__WEBPACK_IMPORTED_MODULE_0__partial_js__["a" /* default */])(wrapper, func);
10445}
10446
10447
10448/***/ }),
10449/* 326 */
10450/***/ (function(module, __webpack_exports__, __webpack_require__) {
10451
10452"use strict";
10453/* harmony export (immutable) */ __webpack_exports__["a"] = compose;
10454// Returns a function that is the composition of a list of functions, each
10455// consuming the return value of the function that follows.
10456function compose() {
10457 var args = arguments;
10458 var start = args.length - 1;
10459 return function() {
10460 var i = start;
10461 var result = args[start].apply(this, arguments);
10462 while (i--) result = args[i].call(this, result);
10463 return result;
10464 };
10465}
10466
10467
10468/***/ }),
10469/* 327 */
10470/***/ (function(module, __webpack_exports__, __webpack_require__) {
10471
10472"use strict";
10473/* harmony export (immutable) */ __webpack_exports__["a"] = after;
10474// Returns a function that will only be executed on and after the Nth call.
10475function after(times, func) {
10476 return function() {
10477 if (--times < 1) {
10478 return func.apply(this, arguments);
10479 }
10480 };
10481}
10482
10483
10484/***/ }),
10485/* 328 */
10486/***/ (function(module, __webpack_exports__, __webpack_require__) {
10487
10488"use strict";
10489/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__partial_js__ = __webpack_require__(104);
10490/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__before_js__ = __webpack_require__(200);
10491
10492
10493
10494// Returns a function that will be executed at most one time, no matter how
10495// often you call it. Useful for lazy initialization.
10496/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__partial_js__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__before_js__["a" /* default */], 2));
10497
10498
10499/***/ }),
10500/* 329 */
10501/***/ (function(module, __webpack_exports__, __webpack_require__) {
10502
10503"use strict";
10504/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__findLastIndex_js__ = __webpack_require__(203);
10505/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__createIndexFinder_js__ = __webpack_require__(206);
10506
10507
10508
10509// Return the position of the last occurrence of an item in an array,
10510// or -1 if the item is not included in the array.
10511/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_1__createIndexFinder_js__["a" /* default */])(-1, __WEBPACK_IMPORTED_MODULE_0__findLastIndex_js__["a" /* default */]));
10512
10513
10514/***/ }),
10515/* 330 */
10516/***/ (function(module, __webpack_exports__, __webpack_require__) {
10517
10518"use strict";
10519/* harmony export (immutable) */ __webpack_exports__["a"] = findWhere;
10520/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__find_js__ = __webpack_require__(207);
10521/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__matcher_js__ = __webpack_require__(103);
10522
10523
10524
10525// Convenience version of a common use case of `_.find`: getting the first
10526// object containing specific `key:value` pairs.
10527function findWhere(obj, attrs) {
10528 return Object(__WEBPACK_IMPORTED_MODULE_0__find_js__["a" /* default */])(obj, Object(__WEBPACK_IMPORTED_MODULE_1__matcher_js__["a" /* default */])(attrs));
10529}
10530
10531
10532/***/ }),
10533/* 331 */
10534/***/ (function(module, __webpack_exports__, __webpack_require__) {
10535
10536"use strict";
10537/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createReduce_js__ = __webpack_require__(208);
10538
10539
10540// **Reduce** builds up a single result from a list of values, aka `inject`,
10541// or `foldl`.
10542/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createReduce_js__["a" /* default */])(1));
10543
10544
10545/***/ }),
10546/* 332 */
10547/***/ (function(module, __webpack_exports__, __webpack_require__) {
10548
10549"use strict";
10550/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createReduce_js__ = __webpack_require__(208);
10551
10552
10553// The right-associative version of reduce, also known as `foldr`.
10554/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createReduce_js__["a" /* default */])(-1));
10555
10556
10557/***/ }),
10558/* 333 */
10559/***/ (function(module, __webpack_exports__, __webpack_require__) {
10560
10561"use strict";
10562/* harmony export (immutable) */ __webpack_exports__["a"] = reject;
10563/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__filter_js__ = __webpack_require__(83);
10564/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__negate_js__ = __webpack_require__(138);
10565/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__cb_js__ = __webpack_require__(20);
10566
10567
10568
10569
10570// Return all the elements for which a truth test fails.
10571function reject(obj, predicate, context) {
10572 return Object(__WEBPACK_IMPORTED_MODULE_0__filter_js__["a" /* default */])(obj, Object(__WEBPACK_IMPORTED_MODULE_1__negate_js__["a" /* default */])(Object(__WEBPACK_IMPORTED_MODULE_2__cb_js__["a" /* default */])(predicate)), context);
10573}
10574
10575
10576/***/ }),
10577/* 334 */
10578/***/ (function(module, __webpack_exports__, __webpack_require__) {
10579
10580"use strict";
10581/* harmony export (immutable) */ __webpack_exports__["a"] = every;
10582/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__cb_js__ = __webpack_require__(20);
10583/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isArrayLike_js__ = __webpack_require__(25);
10584/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__keys_js__ = __webpack_require__(15);
10585
10586
10587
10588
10589// Determine whether all of the elements pass a truth test.
10590function every(obj, predicate, context) {
10591 predicate = Object(__WEBPACK_IMPORTED_MODULE_0__cb_js__["a" /* default */])(predicate, context);
10592 var _keys = !Object(__WEBPACK_IMPORTED_MODULE_1__isArrayLike_js__["a" /* default */])(obj) && Object(__WEBPACK_IMPORTED_MODULE_2__keys_js__["a" /* default */])(obj),
10593 length = (_keys || obj).length;
10594 for (var index = 0; index < length; index++) {
10595 var currentKey = _keys ? _keys[index] : index;
10596 if (!predicate(obj[currentKey], currentKey, obj)) return false;
10597 }
10598 return true;
10599}
10600
10601
10602/***/ }),
10603/* 335 */
10604/***/ (function(module, __webpack_exports__, __webpack_require__) {
10605
10606"use strict";
10607/* harmony export (immutable) */ __webpack_exports__["a"] = some;
10608/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__cb_js__ = __webpack_require__(20);
10609/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isArrayLike_js__ = __webpack_require__(25);
10610/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__keys_js__ = __webpack_require__(15);
10611
10612
10613
10614
10615// Determine if at least one element in the object passes a truth test.
10616function some(obj, predicate, context) {
10617 predicate = Object(__WEBPACK_IMPORTED_MODULE_0__cb_js__["a" /* default */])(predicate, context);
10618 var _keys = !Object(__WEBPACK_IMPORTED_MODULE_1__isArrayLike_js__["a" /* default */])(obj) && Object(__WEBPACK_IMPORTED_MODULE_2__keys_js__["a" /* default */])(obj),
10619 length = (_keys || obj).length;
10620 for (var index = 0; index < length; index++) {
10621 var currentKey = _keys ? _keys[index] : index;
10622 if (predicate(obj[currentKey], currentKey, obj)) return true;
10623 }
10624 return false;
10625}
10626
10627
10628/***/ }),
10629/* 336 */
10630/***/ (function(module, __webpack_exports__, __webpack_require__) {
10631
10632"use strict";
10633/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(23);
10634/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isFunction_js__ = __webpack_require__(27);
10635/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__map_js__ = __webpack_require__(64);
10636/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__deepGet_js__ = __webpack_require__(134);
10637/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__toPath_js__ = __webpack_require__(81);
10638
10639
10640
10641
10642
10643
10644// Invoke a method (with arguments) on every item in a collection.
10645/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" /* default */])(function(obj, path, args) {
10646 var contextPath, func;
10647 if (Object(__WEBPACK_IMPORTED_MODULE_1__isFunction_js__["a" /* default */])(path)) {
10648 func = path;
10649 } else {
10650 path = Object(__WEBPACK_IMPORTED_MODULE_4__toPath_js__["a" /* default */])(path);
10651 contextPath = path.slice(0, -1);
10652 path = path[path.length - 1];
10653 }
10654 return Object(__WEBPACK_IMPORTED_MODULE_2__map_js__["a" /* default */])(obj, function(context) {
10655 var method = func;
10656 if (!method) {
10657 if (contextPath && contextPath.length) {
10658 context = Object(__WEBPACK_IMPORTED_MODULE_3__deepGet_js__["a" /* default */])(context, contextPath);
10659 }
10660 if (context == null) return void 0;
10661 method = context[path];
10662 }
10663 return method == null ? method : method.apply(context, args);
10664 });
10665}));
10666
10667
10668/***/ }),
10669/* 337 */
10670/***/ (function(module, __webpack_exports__, __webpack_require__) {
10671
10672"use strict";
10673/* harmony export (immutable) */ __webpack_exports__["a"] = where;
10674/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__filter_js__ = __webpack_require__(83);
10675/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__matcher_js__ = __webpack_require__(103);
10676
10677
10678
10679// Convenience version of a common use case of `_.filter`: selecting only
10680// objects containing specific `key:value` pairs.
10681function where(obj, attrs) {
10682 return Object(__WEBPACK_IMPORTED_MODULE_0__filter_js__["a" /* default */])(obj, Object(__WEBPACK_IMPORTED_MODULE_1__matcher_js__["a" /* default */])(attrs));
10683}
10684
10685
10686/***/ }),
10687/* 338 */
10688/***/ (function(module, __webpack_exports__, __webpack_require__) {
10689
10690"use strict";
10691/* harmony export (immutable) */ __webpack_exports__["a"] = min;
10692/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__ = __webpack_require__(25);
10693/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__values_js__ = __webpack_require__(62);
10694/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__cb_js__ = __webpack_require__(20);
10695/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__each_js__ = __webpack_require__(54);
10696
10697
10698
10699
10700
10701// Return the minimum element (or element-based computation).
10702function min(obj, iteratee, context) {
10703 var result = Infinity, lastComputed = Infinity,
10704 value, computed;
10705 if (iteratee == null || typeof iteratee == 'number' && typeof obj[0] != 'object' && obj != null) {
10706 obj = Object(__WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__["a" /* default */])(obj) ? obj : Object(__WEBPACK_IMPORTED_MODULE_1__values_js__["a" /* default */])(obj);
10707 for (var i = 0, length = obj.length; i < length; i++) {
10708 value = obj[i];
10709 if (value != null && value < result) {
10710 result = value;
10711 }
10712 }
10713 } else {
10714 iteratee = Object(__WEBPACK_IMPORTED_MODULE_2__cb_js__["a" /* default */])(iteratee, context);
10715 Object(__WEBPACK_IMPORTED_MODULE_3__each_js__["a" /* default */])(obj, function(v, index, list) {
10716 computed = iteratee(v, index, list);
10717 if (computed < lastComputed || computed === Infinity && result === Infinity) {
10718 result = v;
10719 lastComputed = computed;
10720 }
10721 });
10722 }
10723 return result;
10724}
10725
10726
10727/***/ }),
10728/* 339 */
10729/***/ (function(module, __webpack_exports__, __webpack_require__) {
10730
10731"use strict";
10732/* harmony export (immutable) */ __webpack_exports__["a"] = shuffle;
10733/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__sample_js__ = __webpack_require__(210);
10734
10735
10736// Shuffle a collection.
10737function shuffle(obj) {
10738 return Object(__WEBPACK_IMPORTED_MODULE_0__sample_js__["a" /* default */])(obj, Infinity);
10739}
10740
10741
10742/***/ }),
10743/* 340 */
10744/***/ (function(module, __webpack_exports__, __webpack_require__) {
10745
10746"use strict";
10747/* harmony export (immutable) */ __webpack_exports__["a"] = sortBy;
10748/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__cb_js__ = __webpack_require__(20);
10749/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__pluck_js__ = __webpack_require__(140);
10750/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__map_js__ = __webpack_require__(64);
10751
10752
10753
10754
10755// Sort the object's values by a criterion produced by an iteratee.
10756function sortBy(obj, iteratee, context) {
10757 var index = 0;
10758 iteratee = Object(__WEBPACK_IMPORTED_MODULE_0__cb_js__["a" /* default */])(iteratee, context);
10759 return Object(__WEBPACK_IMPORTED_MODULE_1__pluck_js__["a" /* default */])(Object(__WEBPACK_IMPORTED_MODULE_2__map_js__["a" /* default */])(obj, function(value, key, list) {
10760 return {
10761 value: value,
10762 index: index++,
10763 criteria: iteratee(value, key, list)
10764 };
10765 }).sort(function(left, right) {
10766 var a = left.criteria;
10767 var b = right.criteria;
10768 if (a !== b) {
10769 if (a > b || a === void 0) return 1;
10770 if (a < b || b === void 0) return -1;
10771 }
10772 return left.index - right.index;
10773 }), 'value');
10774}
10775
10776
10777/***/ }),
10778/* 341 */
10779/***/ (function(module, __webpack_exports__, __webpack_require__) {
10780
10781"use strict";
10782/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__group_js__ = __webpack_require__(105);
10783/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__has_js__ = __webpack_require__(40);
10784
10785
10786
10787// Groups the object's values by a criterion. Pass either a string attribute
10788// to group by, or a function that returns the criterion.
10789/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__group_js__["a" /* default */])(function(result, value, key) {
10790 if (Object(__WEBPACK_IMPORTED_MODULE_1__has_js__["a" /* default */])(result, key)) result[key].push(value); else result[key] = [value];
10791}));
10792
10793
10794/***/ }),
10795/* 342 */
10796/***/ (function(module, __webpack_exports__, __webpack_require__) {
10797
10798"use strict";
10799/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__group_js__ = __webpack_require__(105);
10800
10801
10802// Indexes the object's values by a criterion, similar to `_.groupBy`, but for
10803// when you know that your index values will be unique.
10804/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__group_js__["a" /* default */])(function(result, value, key) {
10805 result[key] = value;
10806}));
10807
10808
10809/***/ }),
10810/* 343 */
10811/***/ (function(module, __webpack_exports__, __webpack_require__) {
10812
10813"use strict";
10814/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__group_js__ = __webpack_require__(105);
10815/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__has_js__ = __webpack_require__(40);
10816
10817
10818
10819// Counts instances of an object that group by a certain criterion. Pass
10820// either a string attribute to count by, or a function that returns the
10821// criterion.
10822/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__group_js__["a" /* default */])(function(result, value, key) {
10823 if (Object(__WEBPACK_IMPORTED_MODULE_1__has_js__["a" /* default */])(result, key)) result[key]++; else result[key] = 1;
10824}));
10825
10826
10827/***/ }),
10828/* 344 */
10829/***/ (function(module, __webpack_exports__, __webpack_require__) {
10830
10831"use strict";
10832/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__group_js__ = __webpack_require__(105);
10833
10834
10835// Split a collection into two arrays: one whose elements all pass the given
10836// truth test, and one whose elements all do not pass the truth test.
10837/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__group_js__["a" /* default */])(function(result, value, pass) {
10838 result[pass ? 0 : 1].push(value);
10839}, true));
10840
10841
10842/***/ }),
10843/* 345 */
10844/***/ (function(module, __webpack_exports__, __webpack_require__) {
10845
10846"use strict";
10847/* harmony export (immutable) */ __webpack_exports__["a"] = toArray;
10848/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isArray_js__ = __webpack_require__(53);
10849/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__setup_js__ = __webpack_require__(5);
10850/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__isString_js__ = __webpack_require__(127);
10851/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__isArrayLike_js__ = __webpack_require__(25);
10852/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__map_js__ = __webpack_require__(64);
10853/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__identity_js__ = __webpack_require__(135);
10854/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__values_js__ = __webpack_require__(62);
10855
10856
10857
10858
10859
10860
10861
10862
10863// Safely create a real, live array from anything iterable.
10864var reStrSymbol = /[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;
10865function toArray(obj) {
10866 if (!obj) return [];
10867 if (Object(__WEBPACK_IMPORTED_MODULE_0__isArray_js__["a" /* default */])(obj)) return __WEBPACK_IMPORTED_MODULE_1__setup_js__["q" /* slice */].call(obj);
10868 if (Object(__WEBPACK_IMPORTED_MODULE_2__isString_js__["a" /* default */])(obj)) {
10869 // Keep surrogate pair characters together.
10870 return obj.match(reStrSymbol);
10871 }
10872 if (Object(__WEBPACK_IMPORTED_MODULE_3__isArrayLike_js__["a" /* default */])(obj)) return Object(__WEBPACK_IMPORTED_MODULE_4__map_js__["a" /* default */])(obj, __WEBPACK_IMPORTED_MODULE_5__identity_js__["a" /* default */]);
10873 return Object(__WEBPACK_IMPORTED_MODULE_6__values_js__["a" /* default */])(obj);
10874}
10875
10876
10877/***/ }),
10878/* 346 */
10879/***/ (function(module, __webpack_exports__, __webpack_require__) {
10880
10881"use strict";
10882/* harmony export (immutable) */ __webpack_exports__["a"] = size;
10883/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__ = __webpack_require__(25);
10884/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__keys_js__ = __webpack_require__(15);
10885
10886
10887
10888// Return the number of elements in a collection.
10889function size(obj) {
10890 if (obj == null) return 0;
10891 return Object(__WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__["a" /* default */])(obj) ? obj.length : Object(__WEBPACK_IMPORTED_MODULE_1__keys_js__["a" /* default */])(obj).length;
10892}
10893
10894
10895/***/ }),
10896/* 347 */
10897/***/ (function(module, __webpack_exports__, __webpack_require__) {
10898
10899"use strict";
10900/* harmony export (immutable) */ __webpack_exports__["a"] = keyInObj;
10901// Internal `_.pick` helper function to determine whether `key` is an enumerable
10902// property name of `obj`.
10903function keyInObj(value, key, obj) {
10904 return key in obj;
10905}
10906
10907
10908/***/ }),
10909/* 348 */
10910/***/ (function(module, __webpack_exports__, __webpack_require__) {
10911
10912"use strict";
10913/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(23);
10914/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isFunction_js__ = __webpack_require__(27);
10915/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__negate_js__ = __webpack_require__(138);
10916/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__map_js__ = __webpack_require__(64);
10917/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__flatten_js__ = __webpack_require__(63);
10918/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__contains_js__ = __webpack_require__(84);
10919/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__pick_js__ = __webpack_require__(211);
10920
10921
10922
10923
10924
10925
10926
10927
10928// Return a copy of the object without the disallowed properties.
10929/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" /* default */])(function(obj, keys) {
10930 var iteratee = keys[0], context;
10931 if (Object(__WEBPACK_IMPORTED_MODULE_1__isFunction_js__["a" /* default */])(iteratee)) {
10932 iteratee = Object(__WEBPACK_IMPORTED_MODULE_2__negate_js__["a" /* default */])(iteratee);
10933 if (keys.length > 1) context = keys[1];
10934 } else {
10935 keys = Object(__WEBPACK_IMPORTED_MODULE_3__map_js__["a" /* default */])(Object(__WEBPACK_IMPORTED_MODULE_4__flatten_js__["a" /* default */])(keys, false, false), String);
10936 iteratee = function(value, key) {
10937 return !Object(__WEBPACK_IMPORTED_MODULE_5__contains_js__["a" /* default */])(keys, key);
10938 };
10939 }
10940 return Object(__WEBPACK_IMPORTED_MODULE_6__pick_js__["a" /* default */])(obj, iteratee, context);
10941}));
10942
10943
10944/***/ }),
10945/* 349 */
10946/***/ (function(module, __webpack_exports__, __webpack_require__) {
10947
10948"use strict";
10949/* harmony export (immutable) */ __webpack_exports__["a"] = first;
10950/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__initial_js__ = __webpack_require__(212);
10951
10952
10953// Get the first element of an array. Passing **n** will return the first N
10954// values in the array. The **guard** check allows it to work with `_.map`.
10955function first(array, n, guard) {
10956 if (array == null || array.length < 1) return n == null || guard ? void 0 : [];
10957 if (n == null || guard) return array[0];
10958 return Object(__WEBPACK_IMPORTED_MODULE_0__initial_js__["a" /* default */])(array, array.length - n);
10959}
10960
10961
10962/***/ }),
10963/* 350 */
10964/***/ (function(module, __webpack_exports__, __webpack_require__) {
10965
10966"use strict";
10967/* harmony export (immutable) */ __webpack_exports__["a"] = last;
10968/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__rest_js__ = __webpack_require__(213);
10969
10970
10971// Get the last element of an array. Passing **n** will return the last N
10972// values in the array.
10973function last(array, n, guard) {
10974 if (array == null || array.length < 1) return n == null || guard ? void 0 : [];
10975 if (n == null || guard) return array[array.length - 1];
10976 return Object(__WEBPACK_IMPORTED_MODULE_0__rest_js__["a" /* default */])(array, Math.max(0, array.length - n));
10977}
10978
10979
10980/***/ }),
10981/* 351 */
10982/***/ (function(module, __webpack_exports__, __webpack_require__) {
10983
10984"use strict";
10985/* harmony export (immutable) */ __webpack_exports__["a"] = compact;
10986/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__filter_js__ = __webpack_require__(83);
10987
10988
10989// Trim out all falsy values from an array.
10990function compact(array) {
10991 return Object(__WEBPACK_IMPORTED_MODULE_0__filter_js__["a" /* default */])(array, Boolean);
10992}
10993
10994
10995/***/ }),
10996/* 352 */
10997/***/ (function(module, __webpack_exports__, __webpack_require__) {
10998
10999"use strict";
11000/* harmony export (immutable) */ __webpack_exports__["a"] = flatten;
11001/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__flatten_js__ = __webpack_require__(63);
11002
11003
11004// Flatten out an array, either recursively (by default), or up to `depth`.
11005// Passing `true` or `false` as `depth` means `1` or `Infinity`, respectively.
11006function flatten(array, depth) {
11007 return Object(__WEBPACK_IMPORTED_MODULE_0__flatten_js__["a" /* default */])(array, depth, false);
11008}
11009
11010
11011/***/ }),
11012/* 353 */
11013/***/ (function(module, __webpack_exports__, __webpack_require__) {
11014
11015"use strict";
11016/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(23);
11017/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__difference_js__ = __webpack_require__(214);
11018
11019
11020
11021// Return a version of the array that does not contain the specified value(s).
11022/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" /* default */])(function(array, otherArrays) {
11023 return Object(__WEBPACK_IMPORTED_MODULE_1__difference_js__["a" /* default */])(array, otherArrays);
11024}));
11025
11026
11027/***/ }),
11028/* 354 */
11029/***/ (function(module, __webpack_exports__, __webpack_require__) {
11030
11031"use strict";
11032/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(23);
11033/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__uniq_js__ = __webpack_require__(215);
11034/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__flatten_js__ = __webpack_require__(63);
11035
11036
11037
11038
11039// Produce an array that contains the union: each distinct element from all of
11040// the passed-in arrays.
11041/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" /* default */])(function(arrays) {
11042 return Object(__WEBPACK_IMPORTED_MODULE_1__uniq_js__["a" /* default */])(Object(__WEBPACK_IMPORTED_MODULE_2__flatten_js__["a" /* default */])(arrays, true, true));
11043}));
11044
11045
11046/***/ }),
11047/* 355 */
11048/***/ (function(module, __webpack_exports__, __webpack_require__) {
11049
11050"use strict";
11051/* harmony export (immutable) */ __webpack_exports__["a"] = intersection;
11052/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__getLength_js__ = __webpack_require__(28);
11053/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__contains_js__ = __webpack_require__(84);
11054
11055
11056
11057// Produce an array that contains every item shared between all the
11058// passed-in arrays.
11059function intersection(array) {
11060 var result = [];
11061 var argsLength = arguments.length;
11062 for (var i = 0, length = Object(__WEBPACK_IMPORTED_MODULE_0__getLength_js__["a" /* default */])(array); i < length; i++) {
11063 var item = array[i];
11064 if (Object(__WEBPACK_IMPORTED_MODULE_1__contains_js__["a" /* default */])(result, item)) continue;
11065 var j;
11066 for (j = 1; j < argsLength; j++) {
11067 if (!Object(__WEBPACK_IMPORTED_MODULE_1__contains_js__["a" /* default */])(arguments[j], item)) break;
11068 }
11069 if (j === argsLength) result.push(item);
11070 }
11071 return result;
11072}
11073
11074
11075/***/ }),
11076/* 356 */
11077/***/ (function(module, __webpack_exports__, __webpack_require__) {
11078
11079"use strict";
11080/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(23);
11081/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__unzip_js__ = __webpack_require__(216);
11082
11083
11084
11085// Zip together multiple lists into a single array -- elements that share
11086// an index go together.
11087/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__unzip_js__["a" /* default */]));
11088
11089
11090/***/ }),
11091/* 357 */
11092/***/ (function(module, __webpack_exports__, __webpack_require__) {
11093
11094"use strict";
11095/* harmony export (immutable) */ __webpack_exports__["a"] = object;
11096/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__getLength_js__ = __webpack_require__(28);
11097
11098
11099// Converts lists into objects. Pass either a single array of `[key, value]`
11100// pairs, or two parallel arrays of the same length -- one of keys, and one of
11101// the corresponding values. Passing by pairs is the reverse of `_.pairs`.
11102function object(list, values) {
11103 var result = {};
11104 for (var i = 0, length = Object(__WEBPACK_IMPORTED_MODULE_0__getLength_js__["a" /* default */])(list); i < length; i++) {
11105 if (values) {
11106 result[list[i]] = values[i];
11107 } else {
11108 result[list[i][0]] = list[i][1];
11109 }
11110 }
11111 return result;
11112}
11113
11114
11115/***/ }),
11116/* 358 */
11117/***/ (function(module, __webpack_exports__, __webpack_require__) {
11118
11119"use strict";
11120/* harmony export (immutable) */ __webpack_exports__["a"] = range;
11121// Generate an integer Array containing an arithmetic progression. A port of
11122// the native Python `range()` function. See
11123// [the Python documentation](https://docs.python.org/library/functions.html#range).
11124function range(start, stop, step) {
11125 if (stop == null) {
11126 stop = start || 0;
11127 start = 0;
11128 }
11129 if (!step) {
11130 step = stop < start ? -1 : 1;
11131 }
11132
11133 var length = Math.max(Math.ceil((stop - start) / step), 0);
11134 var range = Array(length);
11135
11136 for (var idx = 0; idx < length; idx++, start += step) {
11137 range[idx] = start;
11138 }
11139
11140 return range;
11141}
11142
11143
11144/***/ }),
11145/* 359 */
11146/***/ (function(module, __webpack_exports__, __webpack_require__) {
11147
11148"use strict";
11149/* harmony export (immutable) */ __webpack_exports__["a"] = chunk;
11150/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(5);
11151
11152
11153// Chunk a single array into multiple arrays, each containing `count` or fewer
11154// items.
11155function chunk(array, count) {
11156 if (count == null || count < 1) return [];
11157 var result = [];
11158 var i = 0, length = array.length;
11159 while (i < length) {
11160 result.push(__WEBPACK_IMPORTED_MODULE_0__setup_js__["q" /* slice */].call(array, i, i += count));
11161 }
11162 return result;
11163}
11164
11165
11166/***/ }),
11167/* 360 */
11168/***/ (function(module, __webpack_exports__, __webpack_require__) {
11169
11170"use strict";
11171/* harmony export (immutable) */ __webpack_exports__["a"] = mixin;
11172/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__underscore_js__ = __webpack_require__(24);
11173/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__each_js__ = __webpack_require__(54);
11174/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__functions_js__ = __webpack_require__(183);
11175/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__setup_js__ = __webpack_require__(5);
11176/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__chainResult_js__ = __webpack_require__(217);
11177
11178
11179
11180
11181
11182
11183// Add your own custom functions to the Underscore object.
11184function mixin(obj) {
11185 Object(__WEBPACK_IMPORTED_MODULE_1__each_js__["a" /* default */])(Object(__WEBPACK_IMPORTED_MODULE_2__functions_js__["a" /* default */])(obj), function(name) {
11186 var func = __WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */][name] = obj[name];
11187 __WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */].prototype[name] = function() {
11188 var args = [this._wrapped];
11189 __WEBPACK_IMPORTED_MODULE_3__setup_js__["o" /* push */].apply(args, arguments);
11190 return Object(__WEBPACK_IMPORTED_MODULE_4__chainResult_js__["a" /* default */])(this, func.apply(__WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */], args));
11191 };
11192 });
11193 return __WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */];
11194}
11195
11196
11197/***/ }),
11198/* 361 */
11199/***/ (function(module, __webpack_exports__, __webpack_require__) {
11200
11201"use strict";
11202/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__underscore_js__ = __webpack_require__(24);
11203/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__each_js__ = __webpack_require__(54);
11204/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__setup_js__ = __webpack_require__(5);
11205/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__chainResult_js__ = __webpack_require__(217);
11206
11207
11208
11209
11210
11211// Add all mutator `Array` functions to the wrapper.
11212Object(__WEBPACK_IMPORTED_MODULE_1__each_js__["a" /* default */])(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) {
11213 var method = __WEBPACK_IMPORTED_MODULE_2__setup_js__["a" /* ArrayProto */][name];
11214 __WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */].prototype[name] = function() {
11215 var obj = this._wrapped;
11216 if (obj != null) {
11217 method.apply(obj, arguments);
11218 if ((name === 'shift' || name === 'splice') && obj.length === 0) {
11219 delete obj[0];
11220 }
11221 }
11222 return Object(__WEBPACK_IMPORTED_MODULE_3__chainResult_js__["a" /* default */])(this, obj);
11223 };
11224});
11225
11226// Add all accessor `Array` functions to the wrapper.
11227Object(__WEBPACK_IMPORTED_MODULE_1__each_js__["a" /* default */])(['concat', 'join', 'slice'], function(name) {
11228 var method = __WEBPACK_IMPORTED_MODULE_2__setup_js__["a" /* ArrayProto */][name];
11229 __WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */].prototype[name] = function() {
11230 var obj = this._wrapped;
11231 if (obj != null) obj = method.apply(obj, arguments);
11232 return Object(__WEBPACK_IMPORTED_MODULE_3__chainResult_js__["a" /* default */])(this, obj);
11233 };
11234});
11235
11236/* harmony default export */ __webpack_exports__["a"] = (__WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */]);
11237
11238
11239/***/ }),
11240/* 362 */
11241/***/ (function(module, exports, __webpack_require__) {
11242
11243var parent = __webpack_require__(363);
11244
11245module.exports = parent;
11246
11247
11248/***/ }),
11249/* 363 */
11250/***/ (function(module, exports, __webpack_require__) {
11251
11252var isPrototypeOf = __webpack_require__(21);
11253var method = __webpack_require__(364);
11254
11255var ArrayPrototype = Array.prototype;
11256
11257module.exports = function (it) {
11258 var own = it.concat;
11259 return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.concat) ? method : own;
11260};
11261
11262
11263/***/ }),
11264/* 364 */
11265/***/ (function(module, exports, __webpack_require__) {
11266
11267__webpack_require__(218);
11268var entryVirtual = __webpack_require__(41);
11269
11270module.exports = entryVirtual('Array').concat;
11271
11272
11273/***/ }),
11274/* 365 */
11275/***/ (function(module, exports) {
11276
11277var $TypeError = TypeError;
11278var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF; // 2 ** 53 - 1 == 9007199254740991
11279
11280module.exports = function (it) {
11281 if (it > MAX_SAFE_INTEGER) throw $TypeError('Maximum allowed index exceeded');
11282 return it;
11283};
11284
11285
11286/***/ }),
11287/* 366 */
11288/***/ (function(module, exports, __webpack_require__) {
11289
11290var isArray = __webpack_require__(85);
11291var isConstructor = __webpack_require__(101);
11292var isObject = __webpack_require__(11);
11293var wellKnownSymbol = __webpack_require__(9);
11294
11295var SPECIES = wellKnownSymbol('species');
11296var $Array = Array;
11297
11298// a part of `ArraySpeciesCreate` abstract operation
11299// https://tc39.es/ecma262/#sec-arrayspeciescreate
11300module.exports = function (originalArray) {
11301 var C;
11302 if (isArray(originalArray)) {
11303 C = originalArray.constructor;
11304 // cross-realm fallback
11305 if (isConstructor(C) && (C === $Array || isArray(C.prototype))) C = undefined;
11306 else if (isObject(C)) {
11307 C = C[SPECIES];
11308 if (C === null) C = undefined;
11309 }
11310 } return C === undefined ? $Array : C;
11311};
11312
11313
11314/***/ }),
11315/* 367 */
11316/***/ (function(module, exports, __webpack_require__) {
11317
11318var parent = __webpack_require__(368);
11319
11320module.exports = parent;
11321
11322
11323/***/ }),
11324/* 368 */
11325/***/ (function(module, exports, __webpack_require__) {
11326
11327var isPrototypeOf = __webpack_require__(21);
11328var method = __webpack_require__(369);
11329
11330var ArrayPrototype = Array.prototype;
11331
11332module.exports = function (it) {
11333 var own = it.map;
11334 return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.map) ? method : own;
11335};
11336
11337
11338/***/ }),
11339/* 369 */
11340/***/ (function(module, exports, __webpack_require__) {
11341
11342__webpack_require__(370);
11343var entryVirtual = __webpack_require__(41);
11344
11345module.exports = entryVirtual('Array').map;
11346
11347
11348/***/ }),
11349/* 370 */
11350/***/ (function(module, exports, __webpack_require__) {
11351
11352"use strict";
11353
11354var $ = __webpack_require__(0);
11355var $map = __webpack_require__(66).map;
11356var arrayMethodHasSpeciesSupport = __webpack_require__(107);
11357
11358var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('map');
11359
11360// `Array.prototype.map` method
11361// https://tc39.es/ecma262/#sec-array.prototype.map
11362// with adding support of @@species
11363$({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
11364 map: function map(callbackfn /* , thisArg */) {
11365 return $map(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
11366 }
11367});
11368
11369
11370/***/ }),
11371/* 371 */
11372/***/ (function(module, exports, __webpack_require__) {
11373
11374var parent = __webpack_require__(372);
11375
11376module.exports = parent;
11377
11378
11379/***/ }),
11380/* 372 */
11381/***/ (function(module, exports, __webpack_require__) {
11382
11383__webpack_require__(373);
11384var path = __webpack_require__(10);
11385
11386module.exports = path.Object.keys;
11387
11388
11389/***/ }),
11390/* 373 */
11391/***/ (function(module, exports, __webpack_require__) {
11392
11393var $ = __webpack_require__(0);
11394var toObject = __webpack_require__(34);
11395var nativeKeys = __webpack_require__(98);
11396var fails = __webpack_require__(3);
11397
11398var FAILS_ON_PRIMITIVES = fails(function () { nativeKeys(1); });
11399
11400// `Object.keys` method
11401// https://tc39.es/ecma262/#sec-object.keys
11402$({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES }, {
11403 keys: function keys(it) {
11404 return nativeKeys(toObject(it));
11405 }
11406});
11407
11408
11409/***/ }),
11410/* 374 */
11411/***/ (function(module, exports, __webpack_require__) {
11412
11413var parent = __webpack_require__(375);
11414
11415module.exports = parent;
11416
11417
11418/***/ }),
11419/* 375 */
11420/***/ (function(module, exports, __webpack_require__) {
11421
11422__webpack_require__(220);
11423var path = __webpack_require__(10);
11424var apply = __webpack_require__(69);
11425
11426// eslint-disable-next-line es-x/no-json -- safe
11427if (!path.JSON) path.JSON = { stringify: JSON.stringify };
11428
11429// eslint-disable-next-line no-unused-vars -- required for `.length`
11430module.exports = function stringify(it, replacer, space) {
11431 return apply(path.JSON.stringify, null, arguments);
11432};
11433
11434
11435/***/ }),
11436/* 376 */
11437/***/ (function(module, exports, __webpack_require__) {
11438
11439var parent = __webpack_require__(377);
11440
11441module.exports = parent;
11442
11443
11444/***/ }),
11445/* 377 */
11446/***/ (function(module, exports, __webpack_require__) {
11447
11448var isPrototypeOf = __webpack_require__(21);
11449var method = __webpack_require__(378);
11450
11451var ArrayPrototype = Array.prototype;
11452
11453module.exports = function (it) {
11454 var own = it.indexOf;
11455 return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.indexOf) ? method : own;
11456};
11457
11458
11459/***/ }),
11460/* 378 */
11461/***/ (function(module, exports, __webpack_require__) {
11462
11463__webpack_require__(379);
11464var entryVirtual = __webpack_require__(41);
11465
11466module.exports = entryVirtual('Array').indexOf;
11467
11468
11469/***/ }),
11470/* 379 */
11471/***/ (function(module, exports, __webpack_require__) {
11472
11473"use strict";
11474
11475/* eslint-disable es-x/no-array-prototype-indexof -- required for testing */
11476var $ = __webpack_require__(0);
11477var uncurryThis = __webpack_require__(4);
11478var $IndexOf = __webpack_require__(153).indexOf;
11479var arrayMethodIsStrict = __webpack_require__(380);
11480
11481var un$IndexOf = uncurryThis([].indexOf);
11482
11483var NEGATIVE_ZERO = !!un$IndexOf && 1 / un$IndexOf([1], 1, -0) < 0;
11484var STRICT_METHOD = arrayMethodIsStrict('indexOf');
11485
11486// `Array.prototype.indexOf` method
11487// https://tc39.es/ecma262/#sec-array.prototype.indexof
11488$({ target: 'Array', proto: true, forced: NEGATIVE_ZERO || !STRICT_METHOD }, {
11489 indexOf: function indexOf(searchElement /* , fromIndex = 0 */) {
11490 var fromIndex = arguments.length > 1 ? arguments[1] : undefined;
11491 return NEGATIVE_ZERO
11492 // convert -0 to +0
11493 ? un$IndexOf(this, searchElement, fromIndex) || 0
11494 : $IndexOf(this, searchElement, fromIndex);
11495 }
11496});
11497
11498
11499/***/ }),
11500/* 380 */
11501/***/ (function(module, exports, __webpack_require__) {
11502
11503"use strict";
11504
11505var fails = __webpack_require__(3);
11506
11507module.exports = function (METHOD_NAME, argument) {
11508 var method = [][METHOD_NAME];
11509 return !!method && fails(function () {
11510 // eslint-disable-next-line no-useless-call -- required for testing
11511 method.call(null, argument || function () { return 1; }, 1);
11512 });
11513};
11514
11515
11516/***/ }),
11517/* 381 */
11518/***/ (function(module, exports, __webpack_require__) {
11519
11520__webpack_require__(51);
11521var classof = __webpack_require__(59);
11522var hasOwn = __webpack_require__(14);
11523var isPrototypeOf = __webpack_require__(21);
11524var method = __webpack_require__(382);
11525
11526var ArrayPrototype = Array.prototype;
11527
11528var DOMIterables = {
11529 DOMTokenList: true,
11530 NodeList: true
11531};
11532
11533module.exports = function (it) {
11534 var own = it.keys;
11535 return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.keys)
11536 || hasOwn(DOMIterables, classof(it)) ? method : own;
11537};
11538
11539
11540/***/ }),
11541/* 382 */
11542/***/ (function(module, exports, __webpack_require__) {
11543
11544var parent = __webpack_require__(383);
11545
11546module.exports = parent;
11547
11548
11549/***/ }),
11550/* 383 */
11551/***/ (function(module, exports, __webpack_require__) {
11552
11553__webpack_require__(48);
11554__webpack_require__(60);
11555var entryVirtual = __webpack_require__(41);
11556
11557module.exports = entryVirtual('Array').keys;
11558
11559
11560/***/ }),
11561/* 384 */
11562/***/ (function(module, exports) {
11563
11564// Unique ID creation requires a high quality random # generator. In the
11565// browser this is a little complicated due to unknown quality of Math.random()
11566// and inconsistent support for the `crypto` API. We do the best we can via
11567// feature-detection
11568
11569// getRandomValues needs to be invoked in a context where "this" is a Crypto
11570// implementation. Also, find the complete implementation of crypto on IE11.
11571var getRandomValues = (typeof(crypto) != 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto)) ||
11572 (typeof(msCrypto) != 'undefined' && typeof window.msCrypto.getRandomValues == 'function' && msCrypto.getRandomValues.bind(msCrypto));
11573
11574if (getRandomValues) {
11575 // WHATWG crypto RNG - http://wiki.whatwg.org/wiki/Crypto
11576 var rnds8 = new Uint8Array(16); // eslint-disable-line no-undef
11577
11578 module.exports = function whatwgRNG() {
11579 getRandomValues(rnds8);
11580 return rnds8;
11581 };
11582} else {
11583 // Math.random()-based (RNG)
11584 //
11585 // If all else fails, use Math.random(). It's fast, but is of unspecified
11586 // quality.
11587 var rnds = new Array(16);
11588
11589 module.exports = function mathRNG() {
11590 for (var i = 0, r; i < 16; i++) {
11591 if ((i & 0x03) === 0) r = Math.random() * 0x100000000;
11592 rnds[i] = r >>> ((i & 0x03) << 3) & 0xff;
11593 }
11594
11595 return rnds;
11596 };
11597}
11598
11599
11600/***/ }),
11601/* 385 */
11602/***/ (function(module, exports) {
11603
11604/**
11605 * Convert array of 16 byte values to UUID string format of the form:
11606 * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
11607 */
11608var byteToHex = [];
11609for (var i = 0; i < 256; ++i) {
11610 byteToHex[i] = (i + 0x100).toString(16).substr(1);
11611}
11612
11613function bytesToUuid(buf, offset) {
11614 var i = offset || 0;
11615 var bth = byteToHex;
11616 // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4
11617 return ([bth[buf[i++]], bth[buf[i++]],
11618 bth[buf[i++]], bth[buf[i++]], '-',
11619 bth[buf[i++]], bth[buf[i++]], '-',
11620 bth[buf[i++]], bth[buf[i++]], '-',
11621 bth[buf[i++]], bth[buf[i++]], '-',
11622 bth[buf[i++]], bth[buf[i++]],
11623 bth[buf[i++]], bth[buf[i++]],
11624 bth[buf[i++]], bth[buf[i++]]]).join('');
11625}
11626
11627module.exports = bytesToUuid;
11628
11629
11630/***/ }),
11631/* 386 */
11632/***/ (function(module, exports, __webpack_require__) {
11633
11634"use strict";
11635
11636
11637/**
11638 * This is the common logic for both the Node.js and web browser
11639 * implementations of `debug()`.
11640 */
11641function setup(env) {
11642 createDebug.debug = createDebug;
11643 createDebug.default = createDebug;
11644 createDebug.coerce = coerce;
11645 createDebug.disable = disable;
11646 createDebug.enable = enable;
11647 createDebug.enabled = enabled;
11648 createDebug.humanize = __webpack_require__(387);
11649 Object.keys(env).forEach(function (key) {
11650 createDebug[key] = env[key];
11651 });
11652 /**
11653 * Active `debug` instances.
11654 */
11655
11656 createDebug.instances = [];
11657 /**
11658 * The currently active debug mode names, and names to skip.
11659 */
11660
11661 createDebug.names = [];
11662 createDebug.skips = [];
11663 /**
11664 * Map of special "%n" handling functions, for the debug "format" argument.
11665 *
11666 * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
11667 */
11668
11669 createDebug.formatters = {};
11670 /**
11671 * Selects a color for a debug namespace
11672 * @param {String} namespace The namespace string for the for the debug instance to be colored
11673 * @return {Number|String} An ANSI color code for the given namespace
11674 * @api private
11675 */
11676
11677 function selectColor(namespace) {
11678 var hash = 0;
11679
11680 for (var i = 0; i < namespace.length; i++) {
11681 hash = (hash << 5) - hash + namespace.charCodeAt(i);
11682 hash |= 0; // Convert to 32bit integer
11683 }
11684
11685 return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
11686 }
11687
11688 createDebug.selectColor = selectColor;
11689 /**
11690 * Create a debugger with the given `namespace`.
11691 *
11692 * @param {String} namespace
11693 * @return {Function}
11694 * @api public
11695 */
11696
11697 function createDebug(namespace) {
11698 var prevTime;
11699
11700 function debug() {
11701 // Disabled?
11702 if (!debug.enabled) {
11703 return;
11704 }
11705
11706 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
11707 args[_key] = arguments[_key];
11708 }
11709
11710 var self = debug; // Set `diff` timestamp
11711
11712 var curr = Number(new Date());
11713 var ms = curr - (prevTime || curr);
11714 self.diff = ms;
11715 self.prev = prevTime;
11716 self.curr = curr;
11717 prevTime = curr;
11718 args[0] = createDebug.coerce(args[0]);
11719
11720 if (typeof args[0] !== 'string') {
11721 // Anything else let's inspect with %O
11722 args.unshift('%O');
11723 } // Apply any `formatters` transformations
11724
11725
11726 var index = 0;
11727 args[0] = args[0].replace(/%([a-zA-Z%])/g, function (match, format) {
11728 // If we encounter an escaped % then don't increase the array index
11729 if (match === '%%') {
11730 return match;
11731 }
11732
11733 index++;
11734 var formatter = createDebug.formatters[format];
11735
11736 if (typeof formatter === 'function') {
11737 var val = args[index];
11738 match = formatter.call(self, val); // Now we need to remove `args[index]` since it's inlined in the `format`
11739
11740 args.splice(index, 1);
11741 index--;
11742 }
11743
11744 return match;
11745 }); // Apply env-specific formatting (colors, etc.)
11746
11747 createDebug.formatArgs.call(self, args);
11748 var logFn = self.log || createDebug.log;
11749 logFn.apply(self, args);
11750 }
11751
11752 debug.namespace = namespace;
11753 debug.enabled = createDebug.enabled(namespace);
11754 debug.useColors = createDebug.useColors();
11755 debug.color = selectColor(namespace);
11756 debug.destroy = destroy;
11757 debug.extend = extend; // Debug.formatArgs = formatArgs;
11758 // debug.rawLog = rawLog;
11759 // env-specific initialization logic for debug instances
11760
11761 if (typeof createDebug.init === 'function') {
11762 createDebug.init(debug);
11763 }
11764
11765 createDebug.instances.push(debug);
11766 return debug;
11767 }
11768
11769 function destroy() {
11770 var index = createDebug.instances.indexOf(this);
11771
11772 if (index !== -1) {
11773 createDebug.instances.splice(index, 1);
11774 return true;
11775 }
11776
11777 return false;
11778 }
11779
11780 function extend(namespace, delimiter) {
11781 return createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);
11782 }
11783 /**
11784 * Enables a debug mode by namespaces. This can include modes
11785 * separated by a colon and wildcards.
11786 *
11787 * @param {String} namespaces
11788 * @api public
11789 */
11790
11791
11792 function enable(namespaces) {
11793 createDebug.save(namespaces);
11794 createDebug.names = [];
11795 createDebug.skips = [];
11796 var i;
11797 var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
11798 var len = split.length;
11799
11800 for (i = 0; i < len; i++) {
11801 if (!split[i]) {
11802 // ignore empty strings
11803 continue;
11804 }
11805
11806 namespaces = split[i].replace(/\*/g, '.*?');
11807
11808 if (namespaces[0] === '-') {
11809 createDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));
11810 } else {
11811 createDebug.names.push(new RegExp('^' + namespaces + '$'));
11812 }
11813 }
11814
11815 for (i = 0; i < createDebug.instances.length; i++) {
11816 var instance = createDebug.instances[i];
11817 instance.enabled = createDebug.enabled(instance.namespace);
11818 }
11819 }
11820 /**
11821 * Disable debug output.
11822 *
11823 * @api public
11824 */
11825
11826
11827 function disable() {
11828 createDebug.enable('');
11829 }
11830 /**
11831 * Returns true if the given mode name is enabled, false otherwise.
11832 *
11833 * @param {String} name
11834 * @return {Boolean}
11835 * @api public
11836 */
11837
11838
11839 function enabled(name) {
11840 if (name[name.length - 1] === '*') {
11841 return true;
11842 }
11843
11844 var i;
11845 var len;
11846
11847 for (i = 0, len = createDebug.skips.length; i < len; i++) {
11848 if (createDebug.skips[i].test(name)) {
11849 return false;
11850 }
11851 }
11852
11853 for (i = 0, len = createDebug.names.length; i < len; i++) {
11854 if (createDebug.names[i].test(name)) {
11855 return true;
11856 }
11857 }
11858
11859 return false;
11860 }
11861 /**
11862 * Coerce `val`.
11863 *
11864 * @param {Mixed} val
11865 * @return {Mixed}
11866 * @api private
11867 */
11868
11869
11870 function coerce(val) {
11871 if (val instanceof Error) {
11872 return val.stack || val.message;
11873 }
11874
11875 return val;
11876 }
11877
11878 createDebug.enable(createDebug.load());
11879 return createDebug;
11880}
11881
11882module.exports = setup;
11883
11884
11885
11886/***/ }),
11887/* 387 */
11888/***/ (function(module, exports) {
11889
11890/**
11891 * Helpers.
11892 */
11893
11894var s = 1000;
11895var m = s * 60;
11896var h = m * 60;
11897var d = h * 24;
11898var w = d * 7;
11899var y = d * 365.25;
11900
11901/**
11902 * Parse or format the given `val`.
11903 *
11904 * Options:
11905 *
11906 * - `long` verbose formatting [false]
11907 *
11908 * @param {String|Number} val
11909 * @param {Object} [options]
11910 * @throws {Error} throw an error if val is not a non-empty string or a number
11911 * @return {String|Number}
11912 * @api public
11913 */
11914
11915module.exports = function(val, options) {
11916 options = options || {};
11917 var type = typeof val;
11918 if (type === 'string' && val.length > 0) {
11919 return parse(val);
11920 } else if (type === 'number' && isFinite(val)) {
11921 return options.long ? fmtLong(val) : fmtShort(val);
11922 }
11923 throw new Error(
11924 'val is not a non-empty string or a valid number. val=' +
11925 JSON.stringify(val)
11926 );
11927};
11928
11929/**
11930 * Parse the given `str` and return milliseconds.
11931 *
11932 * @param {String} str
11933 * @return {Number}
11934 * @api private
11935 */
11936
11937function parse(str) {
11938 str = String(str);
11939 if (str.length > 100) {
11940 return;
11941 }
11942 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(
11943 str
11944 );
11945 if (!match) {
11946 return;
11947 }
11948 var n = parseFloat(match[1]);
11949 var type = (match[2] || 'ms').toLowerCase();
11950 switch (type) {
11951 case 'years':
11952 case 'year':
11953 case 'yrs':
11954 case 'yr':
11955 case 'y':
11956 return n * y;
11957 case 'weeks':
11958 case 'week':
11959 case 'w':
11960 return n * w;
11961 case 'days':
11962 case 'day':
11963 case 'd':
11964 return n * d;
11965 case 'hours':
11966 case 'hour':
11967 case 'hrs':
11968 case 'hr':
11969 case 'h':
11970 return n * h;
11971 case 'minutes':
11972 case 'minute':
11973 case 'mins':
11974 case 'min':
11975 case 'm':
11976 return n * m;
11977 case 'seconds':
11978 case 'second':
11979 case 'secs':
11980 case 'sec':
11981 case 's':
11982 return n * s;
11983 case 'milliseconds':
11984 case 'millisecond':
11985 case 'msecs':
11986 case 'msec':
11987 case 'ms':
11988 return n;
11989 default:
11990 return undefined;
11991 }
11992}
11993
11994/**
11995 * Short format for `ms`.
11996 *
11997 * @param {Number} ms
11998 * @return {String}
11999 * @api private
12000 */
12001
12002function fmtShort(ms) {
12003 var msAbs = Math.abs(ms);
12004 if (msAbs >= d) {
12005 return Math.round(ms / d) + 'd';
12006 }
12007 if (msAbs >= h) {
12008 return Math.round(ms / h) + 'h';
12009 }
12010 if (msAbs >= m) {
12011 return Math.round(ms / m) + 'm';
12012 }
12013 if (msAbs >= s) {
12014 return Math.round(ms / s) + 's';
12015 }
12016 return ms + 'ms';
12017}
12018
12019/**
12020 * Long format for `ms`.
12021 *
12022 * @param {Number} ms
12023 * @return {String}
12024 * @api private
12025 */
12026
12027function fmtLong(ms) {
12028 var msAbs = Math.abs(ms);
12029 if (msAbs >= d) {
12030 return plural(ms, msAbs, d, 'day');
12031 }
12032 if (msAbs >= h) {
12033 return plural(ms, msAbs, h, 'hour');
12034 }
12035 if (msAbs >= m) {
12036 return plural(ms, msAbs, m, 'minute');
12037 }
12038 if (msAbs >= s) {
12039 return plural(ms, msAbs, s, 'second');
12040 }
12041 return ms + ' ms';
12042}
12043
12044/**
12045 * Pluralization helper.
12046 */
12047
12048function plural(ms, msAbs, n, name) {
12049 var isPlural = msAbs >= n * 1.5;
12050 return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');
12051}
12052
12053
12054/***/ }),
12055/* 388 */
12056/***/ (function(module, exports, __webpack_require__) {
12057
12058__webpack_require__(389);
12059var path = __webpack_require__(10);
12060
12061module.exports = path.Object.getPrototypeOf;
12062
12063
12064/***/ }),
12065/* 389 */
12066/***/ (function(module, exports, __webpack_require__) {
12067
12068var $ = __webpack_require__(0);
12069var fails = __webpack_require__(3);
12070var toObject = __webpack_require__(34);
12071var nativeGetPrototypeOf = __webpack_require__(93);
12072var CORRECT_PROTOTYPE_GETTER = __webpack_require__(151);
12073
12074var FAILS_ON_PRIMITIVES = fails(function () { nativeGetPrototypeOf(1); });
12075
12076// `Object.getPrototypeOf` method
12077// https://tc39.es/ecma262/#sec-object.getprototypeof
12078$({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES, sham: !CORRECT_PROTOTYPE_GETTER }, {
12079 getPrototypeOf: function getPrototypeOf(it) {
12080 return nativeGetPrototypeOf(toObject(it));
12081 }
12082});
12083
12084
12085
12086/***/ }),
12087/* 390 */
12088/***/ (function(module, exports, __webpack_require__) {
12089
12090__webpack_require__(391);
12091var path = __webpack_require__(10);
12092
12093module.exports = path.Object.setPrototypeOf;
12094
12095
12096/***/ }),
12097/* 391 */
12098/***/ (function(module, exports, __webpack_require__) {
12099
12100var $ = __webpack_require__(0);
12101var setPrototypeOf = __webpack_require__(95);
12102
12103// `Object.setPrototypeOf` method
12104// https://tc39.es/ecma262/#sec-object.setprototypeof
12105$({ target: 'Object', stat: true }, {
12106 setPrototypeOf: setPrototypeOf
12107});
12108
12109
12110/***/ }),
12111/* 392 */
12112/***/ (function(module, exports, __webpack_require__) {
12113
12114"use strict";
12115
12116
12117var _interopRequireDefault = __webpack_require__(1);
12118
12119var _slice = _interopRequireDefault(__webpack_require__(87));
12120
12121var _concat = _interopRequireDefault(__webpack_require__(30));
12122
12123var _defineProperty = _interopRequireDefault(__webpack_require__(143));
12124
12125var AV = __webpack_require__(65);
12126
12127var AppRouter = __webpack_require__(398);
12128
12129var _require = __webpack_require__(29),
12130 isNullOrUndefined = _require.isNullOrUndefined;
12131
12132var _require2 = __webpack_require__(2),
12133 extend = _require2.extend,
12134 isObject = _require2.isObject,
12135 isEmpty = _require2.isEmpty;
12136
12137var isCNApp = function isCNApp(appId) {
12138 return (0, _slice.default)(appId).call(appId, -9) !== '-MdYXbMMI';
12139};
12140
12141var fillServerURLs = function fillServerURLs(url) {
12142 return {
12143 push: url,
12144 stats: url,
12145 engine: url,
12146 api: url,
12147 rtm: url
12148 };
12149};
12150
12151function getDefaultServerURLs(appId) {
12152 var _context, _context2, _context3, _context4, _context5;
12153
12154 if (isCNApp(appId)) {
12155 return {};
12156 }
12157
12158 var id = (0, _slice.default)(appId).call(appId, 0, 8).toLowerCase();
12159 var domain = 'lncldglobal.com';
12160 return {
12161 push: (0, _concat.default)(_context = "https://".concat(id, ".push.")).call(_context, domain),
12162 stats: (0, _concat.default)(_context2 = "https://".concat(id, ".stats.")).call(_context2, domain),
12163 engine: (0, _concat.default)(_context3 = "https://".concat(id, ".engine.")).call(_context3, domain),
12164 api: (0, _concat.default)(_context4 = "https://".concat(id, ".api.")).call(_context4, domain),
12165 rtm: (0, _concat.default)(_context5 = "https://".concat(id, ".rtm.")).call(_context5, domain)
12166 };
12167}
12168
12169var _disableAppRouter = false;
12170var _initialized = false;
12171/**
12172 * URLs for services
12173 * @typedef {Object} ServerURLs
12174 * @property {String} [api] serverURL for API service
12175 * @property {String} [engine] serverURL for engine service
12176 * @property {String} [stats] serverURL for stats service
12177 * @property {String} [push] serverURL for push service
12178 * @property {String} [rtm] serverURL for LiveQuery service
12179 */
12180
12181/**
12182 * Call this method first to set up your authentication tokens for AV.
12183 * You can get your app keys from the LeanCloud dashboard on http://leancloud.cn .
12184 * @function AV.init
12185 * @param {Object} options
12186 * @param {String} options.appId application id
12187 * @param {String} options.appKey application key
12188 * @param {String} [options.masterKey] application master key
12189 * @param {Boolean} [options.production]
12190 * @param {String|ServerURLs} [options.serverURL] URLs for services. if a string was given, it will be applied for all services.
12191 * @param {Boolean} [options.disableCurrentUser]
12192 */
12193
12194AV.init = function init(options) {
12195 if (!isObject(options)) {
12196 return AV.init({
12197 appId: options,
12198 appKey: arguments.length <= 1 ? undefined : arguments[1],
12199 masterKey: arguments.length <= 2 ? undefined : arguments[2]
12200 });
12201 }
12202
12203 var appId = options.appId,
12204 appKey = options.appKey,
12205 masterKey = options.masterKey,
12206 hookKey = options.hookKey,
12207 serverURL = options.serverURL,
12208 _options$serverURLs = options.serverURLs,
12209 serverURLs = _options$serverURLs === void 0 ? serverURL : _options$serverURLs,
12210 disableCurrentUser = options.disableCurrentUser,
12211 production = options.production,
12212 realtime = options.realtime;
12213 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.');
12214 if (!appId) throw new TypeError('appId must be a string');
12215 if (!appKey) throw new TypeError('appKey must be a string');
12216 if ("Weapp" !== 'NODE_JS' && masterKey) console.warn('MasterKey is not supposed to be used at client side.');
12217
12218 if (isCNApp(appId)) {
12219 if (!serverURLs && isEmpty(AV._config.serverURLs)) {
12220 throw new TypeError("serverURL option is required for apps from CN region");
12221 }
12222 }
12223
12224 if (appId !== AV._config.applicationId) {
12225 // overwrite all keys when reinitializing as a new app
12226 AV._config.masterKey = masterKey;
12227 AV._config.hookKey = hookKey;
12228 } else {
12229 if (masterKey) AV._config.masterKey = masterKey;
12230 if (hookKey) AV._config.hookKey = hookKey;
12231 }
12232
12233 AV._config.applicationId = appId;
12234 AV._config.applicationKey = appKey;
12235
12236 if (!isNullOrUndefined(production)) {
12237 AV.setProduction(production);
12238 }
12239
12240 if (typeof disableCurrentUser !== 'undefined') AV._config.disableCurrentUser = disableCurrentUser;
12241 var disableAppRouter = _disableAppRouter || typeof serverURLs !== 'undefined';
12242
12243 if (!disableAppRouter) {
12244 AV._appRouter = new AppRouter(AV);
12245 }
12246
12247 AV._setServerURLs(extend({}, getDefaultServerURLs(appId), AV._config.serverURLs, typeof serverURLs === 'string' ? fillServerURLs(serverURLs) : serverURLs), disableAppRouter);
12248
12249 if (realtime) {
12250 AV._config.realtime = realtime;
12251 } else if (AV._sharedConfig.liveQueryRealtime) {
12252 var _AV$_config$serverURL = AV._config.serverURLs,
12253 api = _AV$_config$serverURL.api,
12254 rtm = _AV$_config$serverURL.rtm;
12255 AV._config.realtime = new AV._sharedConfig.liveQueryRealtime({
12256 appId: appId,
12257 appKey: appKey,
12258 server: {
12259 api: api,
12260 RTMRouter: rtm
12261 }
12262 });
12263 }
12264
12265 _initialized = true;
12266}; // If we're running in node.js, allow using the master key.
12267
12268
12269if (false) {
12270 AV.Cloud = AV.Cloud || {};
12271 /**
12272 * Switches the LeanCloud SDK to using the Master key. The Master key grants
12273 * priveleged access to the data in LeanCloud and can be used to bypass ACLs and
12274 * other restrictions that are applied to the client SDKs.
12275 * <p><strong><em>Available in Cloud Code and Node.js only.</em></strong>
12276 * </p>
12277 */
12278
12279 AV.Cloud.useMasterKey = function () {
12280 AV._config.useMasterKey = true;
12281 };
12282}
12283/**
12284 * Call this method to set production environment variable.
12285 * @function AV.setProduction
12286 * @param {Boolean} production True is production environment,and
12287 * it's true by default.
12288 */
12289
12290
12291AV.setProduction = function (production) {
12292 if (!isNullOrUndefined(production)) {
12293 AV._config.production = production ? 1 : 0;
12294 } else {
12295 // change to default value
12296 AV._config.production = null;
12297 }
12298};
12299
12300AV._setServerURLs = function (urls) {
12301 var disableAppRouter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
12302
12303 if (typeof urls !== 'string') {
12304 extend(AV._config.serverURLs, urls);
12305 } else {
12306 AV._config.serverURLs = fillServerURLs(urls);
12307 }
12308
12309 if (disableAppRouter) {
12310 if (AV._appRouter) {
12311 AV._appRouter.disable();
12312 } else {
12313 _disableAppRouter = true;
12314 }
12315 }
12316};
12317/**
12318 * Set server URLs for services.
12319 * @function AV.setServerURL
12320 * @since 4.3.0
12321 * @param {String|ServerURLs} urls URLs for services. if a string was given, it will be applied for all services.
12322 * You can also set them when initializing SDK with `options.serverURL`
12323 */
12324
12325
12326AV.setServerURL = function (urls) {
12327 return AV._setServerURLs(urls);
12328};
12329
12330AV.setServerURLs = AV.setServerURL;
12331
12332AV.keepErrorRawMessage = function (value) {
12333 AV._sharedConfig.keepErrorRawMessage = value;
12334};
12335/**
12336 * Set a deadline for requests to complete.
12337 * Note that file upload requests are not affected.
12338 * @function AV.setRequestTimeout
12339 * @since 3.6.0
12340 * @param {number} ms
12341 */
12342
12343
12344AV.setRequestTimeout = function (ms) {
12345 AV._config.requestTimeout = ms;
12346}; // backword compatible
12347
12348
12349AV.initialize = AV.init;
12350
12351var defineConfig = function defineConfig(property) {
12352 return (0, _defineProperty.default)(AV, property, {
12353 get: function get() {
12354 return AV._config[property];
12355 },
12356 set: function set(value) {
12357 AV._config[property] = value;
12358 }
12359 });
12360};
12361
12362['applicationId', 'applicationKey', 'masterKey', 'hookKey'].forEach(defineConfig);
12363
12364/***/ }),
12365/* 393 */
12366/***/ (function(module, exports, __webpack_require__) {
12367
12368var isPrototypeOf = __webpack_require__(21);
12369var method = __webpack_require__(394);
12370
12371var ArrayPrototype = Array.prototype;
12372
12373module.exports = function (it) {
12374 var own = it.slice;
12375 return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.slice) ? method : own;
12376};
12377
12378
12379/***/ }),
12380/* 394 */
12381/***/ (function(module, exports, __webpack_require__) {
12382
12383__webpack_require__(395);
12384var entryVirtual = __webpack_require__(41);
12385
12386module.exports = entryVirtual('Array').slice;
12387
12388
12389/***/ }),
12390/* 395 */
12391/***/ (function(module, exports, __webpack_require__) {
12392
12393"use strict";
12394
12395var $ = __webpack_require__(0);
12396var isArray = __webpack_require__(85);
12397var isConstructor = __webpack_require__(101);
12398var isObject = __webpack_require__(11);
12399var toAbsoluteIndex = __webpack_require__(119);
12400var lengthOfArrayLike = __webpack_require__(46);
12401var toIndexedObject = __webpack_require__(33);
12402var createProperty = __webpack_require__(106);
12403var wellKnownSymbol = __webpack_require__(9);
12404var arrayMethodHasSpeciesSupport = __webpack_require__(107);
12405var un$Slice = __webpack_require__(102);
12406
12407var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('slice');
12408
12409var SPECIES = wellKnownSymbol('species');
12410var $Array = Array;
12411var max = Math.max;
12412
12413// `Array.prototype.slice` method
12414// https://tc39.es/ecma262/#sec-array.prototype.slice
12415// fallback for not array-like ES3 strings and DOM objects
12416$({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
12417 slice: function slice(start, end) {
12418 var O = toIndexedObject(this);
12419 var length = lengthOfArrayLike(O);
12420 var k = toAbsoluteIndex(start, length);
12421 var fin = toAbsoluteIndex(end === undefined ? length : end, length);
12422 // inline `ArraySpeciesCreate` for usage native `Array#slice` where it's possible
12423 var Constructor, result, n;
12424 if (isArray(O)) {
12425 Constructor = O.constructor;
12426 // cross-realm fallback
12427 if (isConstructor(Constructor) && (Constructor === $Array || isArray(Constructor.prototype))) {
12428 Constructor = undefined;
12429 } else if (isObject(Constructor)) {
12430 Constructor = Constructor[SPECIES];
12431 if (Constructor === null) Constructor = undefined;
12432 }
12433 if (Constructor === $Array || Constructor === undefined) {
12434 return un$Slice(O, k, fin);
12435 }
12436 }
12437 result = new (Constructor === undefined ? $Array : Constructor)(max(fin - k, 0));
12438 for (n = 0; k < fin; k++, n++) if (k in O) createProperty(result, n, O[k]);
12439 result.length = n;
12440 return result;
12441 }
12442});
12443
12444
12445/***/ }),
12446/* 396 */
12447/***/ (function(module, exports, __webpack_require__) {
12448
12449__webpack_require__(397);
12450var path = __webpack_require__(10);
12451
12452var Object = path.Object;
12453
12454var defineProperty = module.exports = function defineProperty(it, key, desc) {
12455 return Object.defineProperty(it, key, desc);
12456};
12457
12458if (Object.defineProperty.sham) defineProperty.sham = true;
12459
12460
12461/***/ }),
12462/* 397 */
12463/***/ (function(module, exports, __webpack_require__) {
12464
12465var $ = __webpack_require__(0);
12466var DESCRIPTORS = __webpack_require__(16);
12467var defineProperty = __webpack_require__(22).f;
12468
12469// `Object.defineProperty` method
12470// https://tc39.es/ecma262/#sec-object.defineproperty
12471// eslint-disable-next-line es-x/no-object-defineproperty -- safe
12472$({ target: 'Object', stat: true, forced: Object.defineProperty !== defineProperty, sham: !DESCRIPTORS }, {
12473 defineProperty: defineProperty
12474});
12475
12476
12477/***/ }),
12478/* 398 */
12479/***/ (function(module, exports, __webpack_require__) {
12480
12481"use strict";
12482
12483
12484var ajax = __webpack_require__(108);
12485
12486var Cache = __webpack_require__(226);
12487
12488function AppRouter(AV) {
12489 var _this = this;
12490
12491 this.AV = AV;
12492 this.lockedUntil = 0;
12493 Cache.getAsync('serverURLs').then(function (data) {
12494 if (_this.disabled) return;
12495 if (!data) return _this.lock(0);
12496 var serverURLs = data.serverURLs,
12497 lockedUntil = data.lockedUntil;
12498
12499 _this.AV._setServerURLs(serverURLs, false);
12500
12501 _this.lockedUntil = lockedUntil;
12502 }).catch(function () {
12503 return _this.lock(0);
12504 });
12505}
12506
12507AppRouter.prototype.disable = function disable() {
12508 this.disabled = true;
12509};
12510
12511AppRouter.prototype.lock = function lock(ttl) {
12512 this.lockedUntil = Date.now() + ttl;
12513};
12514
12515AppRouter.prototype.refresh = function refresh() {
12516 var _this2 = this;
12517
12518 if (this.disabled) return;
12519 if (Date.now() < this.lockedUntil) return;
12520 this.lock(10);
12521 var url = 'https://app-router.com/2/route';
12522 return ajax({
12523 method: 'get',
12524 url: url,
12525 query: {
12526 appId: this.AV.applicationId
12527 }
12528 }).then(function (servers) {
12529 if (_this2.disabled) return;
12530 var ttl = servers.ttl;
12531 if (!ttl) throw new Error('missing ttl');
12532 ttl = ttl * 1000;
12533 var protocal = 'https://';
12534 var serverURLs = {
12535 push: protocal + servers.push_server,
12536 stats: protocal + servers.stats_server,
12537 engine: protocal + servers.engine_server,
12538 api: protocal + servers.api_server
12539 };
12540
12541 _this2.AV._setServerURLs(serverURLs, false);
12542
12543 _this2.lock(ttl);
12544
12545 return Cache.setAsync('serverURLs', {
12546 serverURLs: serverURLs,
12547 lockedUntil: _this2.lockedUntil
12548 }, ttl);
12549 }).catch(function (error) {
12550 // bypass all errors
12551 console.warn("refresh server URLs failed: ".concat(error.message));
12552
12553 _this2.lock(600);
12554 });
12555};
12556
12557module.exports = AppRouter;
12558
12559/***/ }),
12560/* 399 */
12561/***/ (function(module, exports, __webpack_require__) {
12562
12563module.exports = __webpack_require__(400);
12564
12565
12566/***/ }),
12567/* 400 */
12568/***/ (function(module, exports, __webpack_require__) {
12569
12570var parent = __webpack_require__(401);
12571__webpack_require__(424);
12572__webpack_require__(425);
12573__webpack_require__(426);
12574__webpack_require__(427);
12575__webpack_require__(428);
12576// TODO: Remove from `core-js@4`
12577__webpack_require__(429);
12578__webpack_require__(430);
12579__webpack_require__(431);
12580
12581module.exports = parent;
12582
12583
12584/***/ }),
12585/* 401 */
12586/***/ (function(module, exports, __webpack_require__) {
12587
12588var parent = __webpack_require__(232);
12589
12590module.exports = parent;
12591
12592
12593/***/ }),
12594/* 402 */
12595/***/ (function(module, exports, __webpack_require__) {
12596
12597__webpack_require__(218);
12598__webpack_require__(60);
12599__webpack_require__(233);
12600__webpack_require__(408);
12601__webpack_require__(409);
12602__webpack_require__(410);
12603__webpack_require__(411);
12604__webpack_require__(237);
12605__webpack_require__(412);
12606__webpack_require__(413);
12607__webpack_require__(414);
12608__webpack_require__(415);
12609__webpack_require__(416);
12610__webpack_require__(417);
12611__webpack_require__(418);
12612__webpack_require__(419);
12613__webpack_require__(420);
12614__webpack_require__(421);
12615__webpack_require__(422);
12616__webpack_require__(423);
12617var path = __webpack_require__(10);
12618
12619module.exports = path.Symbol;
12620
12621
12622/***/ }),
12623/* 403 */
12624/***/ (function(module, exports, __webpack_require__) {
12625
12626"use strict";
12627
12628var $ = __webpack_require__(0);
12629var global = __webpack_require__(6);
12630var call = __webpack_require__(13);
12631var uncurryThis = __webpack_require__(4);
12632var IS_PURE = __webpack_require__(32);
12633var DESCRIPTORS = __webpack_require__(16);
12634var NATIVE_SYMBOL = __webpack_require__(57);
12635var fails = __webpack_require__(3);
12636var hasOwn = __webpack_require__(14);
12637var isPrototypeOf = __webpack_require__(21);
12638var anObject = __webpack_require__(19);
12639var toIndexedObject = __webpack_require__(33);
12640var toPropertyKey = __webpack_require__(88);
12641var $toString = __webpack_require__(75);
12642var createPropertyDescriptor = __webpack_require__(44);
12643var nativeObjectCreate = __webpack_require__(47);
12644var objectKeys = __webpack_require__(98);
12645var getOwnPropertyNamesModule = __webpack_require__(96);
12646var getOwnPropertyNamesExternal = __webpack_require__(234);
12647var getOwnPropertySymbolsModule = __webpack_require__(97);
12648var getOwnPropertyDescriptorModule = __webpack_require__(71);
12649var definePropertyModule = __webpack_require__(22);
12650var definePropertiesModule = __webpack_require__(154);
12651var propertyIsEnumerableModule = __webpack_require__(113);
12652var defineBuiltIn = __webpack_require__(39);
12653var shared = __webpack_require__(73);
12654var sharedKey = __webpack_require__(94);
12655var hiddenKeys = __webpack_require__(74);
12656var uid = __webpack_require__(92);
12657var wellKnownSymbol = __webpack_require__(9);
12658var wrappedWellKnownSymbolModule = __webpack_require__(144);
12659var defineWellKnownSymbol = __webpack_require__(8);
12660var defineSymbolToPrimitive = __webpack_require__(235);
12661var setToStringTag = __webpack_require__(49);
12662var InternalStateModule = __webpack_require__(38);
12663var $forEach = __webpack_require__(66).forEach;
12664
12665var HIDDEN = sharedKey('hidden');
12666var SYMBOL = 'Symbol';
12667var PROTOTYPE = 'prototype';
12668
12669var setInternalState = InternalStateModule.set;
12670var getInternalState = InternalStateModule.getterFor(SYMBOL);
12671
12672var ObjectPrototype = Object[PROTOTYPE];
12673var $Symbol = global.Symbol;
12674var SymbolPrototype = $Symbol && $Symbol[PROTOTYPE];
12675var TypeError = global.TypeError;
12676var QObject = global.QObject;
12677var nativeGetOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
12678var nativeDefineProperty = definePropertyModule.f;
12679var nativeGetOwnPropertyNames = getOwnPropertyNamesExternal.f;
12680var nativePropertyIsEnumerable = propertyIsEnumerableModule.f;
12681var push = uncurryThis([].push);
12682
12683var AllSymbols = shared('symbols');
12684var ObjectPrototypeSymbols = shared('op-symbols');
12685var WellKnownSymbolsStore = shared('wks');
12686
12687// Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173
12688var USE_SETTER = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;
12689
12690// fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687
12691var setSymbolDescriptor = DESCRIPTORS && fails(function () {
12692 return nativeObjectCreate(nativeDefineProperty({}, 'a', {
12693 get: function () { return nativeDefineProperty(this, 'a', { value: 7 }).a; }
12694 })).a != 7;
12695}) ? function (O, P, Attributes) {
12696 var ObjectPrototypeDescriptor = nativeGetOwnPropertyDescriptor(ObjectPrototype, P);
12697 if (ObjectPrototypeDescriptor) delete ObjectPrototype[P];
12698 nativeDefineProperty(O, P, Attributes);
12699 if (ObjectPrototypeDescriptor && O !== ObjectPrototype) {
12700 nativeDefineProperty(ObjectPrototype, P, ObjectPrototypeDescriptor);
12701 }
12702} : nativeDefineProperty;
12703
12704var wrap = function (tag, description) {
12705 var symbol = AllSymbols[tag] = nativeObjectCreate(SymbolPrototype);
12706 setInternalState(symbol, {
12707 type: SYMBOL,
12708 tag: tag,
12709 description: description
12710 });
12711 if (!DESCRIPTORS) symbol.description = description;
12712 return symbol;
12713};
12714
12715var $defineProperty = function defineProperty(O, P, Attributes) {
12716 if (O === ObjectPrototype) $defineProperty(ObjectPrototypeSymbols, P, Attributes);
12717 anObject(O);
12718 var key = toPropertyKey(P);
12719 anObject(Attributes);
12720 if (hasOwn(AllSymbols, key)) {
12721 if (!Attributes.enumerable) {
12722 if (!hasOwn(O, HIDDEN)) nativeDefineProperty(O, HIDDEN, createPropertyDescriptor(1, {}));
12723 O[HIDDEN][key] = true;
12724 } else {
12725 if (hasOwn(O, HIDDEN) && O[HIDDEN][key]) O[HIDDEN][key] = false;
12726 Attributes = nativeObjectCreate(Attributes, { enumerable: createPropertyDescriptor(0, false) });
12727 } return setSymbolDescriptor(O, key, Attributes);
12728 } return nativeDefineProperty(O, key, Attributes);
12729};
12730
12731var $defineProperties = function defineProperties(O, Properties) {
12732 anObject(O);
12733 var properties = toIndexedObject(Properties);
12734 var keys = objectKeys(properties).concat($getOwnPropertySymbols(properties));
12735 $forEach(keys, function (key) {
12736 if (!DESCRIPTORS || call($propertyIsEnumerable, properties, key)) $defineProperty(O, key, properties[key]);
12737 });
12738 return O;
12739};
12740
12741var $create = function create(O, Properties) {
12742 return Properties === undefined ? nativeObjectCreate(O) : $defineProperties(nativeObjectCreate(O), Properties);
12743};
12744
12745var $propertyIsEnumerable = function propertyIsEnumerable(V) {
12746 var P = toPropertyKey(V);
12747 var enumerable = call(nativePropertyIsEnumerable, this, P);
12748 if (this === ObjectPrototype && hasOwn(AllSymbols, P) && !hasOwn(ObjectPrototypeSymbols, P)) return false;
12749 return enumerable || !hasOwn(this, P) || !hasOwn(AllSymbols, P) || hasOwn(this, HIDDEN) && this[HIDDEN][P]
12750 ? enumerable : true;
12751};
12752
12753var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(O, P) {
12754 var it = toIndexedObject(O);
12755 var key = toPropertyKey(P);
12756 if (it === ObjectPrototype && hasOwn(AllSymbols, key) && !hasOwn(ObjectPrototypeSymbols, key)) return;
12757 var descriptor = nativeGetOwnPropertyDescriptor(it, key);
12758 if (descriptor && hasOwn(AllSymbols, key) && !(hasOwn(it, HIDDEN) && it[HIDDEN][key])) {
12759 descriptor.enumerable = true;
12760 }
12761 return descriptor;
12762};
12763
12764var $getOwnPropertyNames = function getOwnPropertyNames(O) {
12765 var names = nativeGetOwnPropertyNames(toIndexedObject(O));
12766 var result = [];
12767 $forEach(names, function (key) {
12768 if (!hasOwn(AllSymbols, key) && !hasOwn(hiddenKeys, key)) push(result, key);
12769 });
12770 return result;
12771};
12772
12773var $getOwnPropertySymbols = function (O) {
12774 var IS_OBJECT_PROTOTYPE = O === ObjectPrototype;
12775 var names = nativeGetOwnPropertyNames(IS_OBJECT_PROTOTYPE ? ObjectPrototypeSymbols : toIndexedObject(O));
12776 var result = [];
12777 $forEach(names, function (key) {
12778 if (hasOwn(AllSymbols, key) && (!IS_OBJECT_PROTOTYPE || hasOwn(ObjectPrototype, key))) {
12779 push(result, AllSymbols[key]);
12780 }
12781 });
12782 return result;
12783};
12784
12785// `Symbol` constructor
12786// https://tc39.es/ecma262/#sec-symbol-constructor
12787if (!NATIVE_SYMBOL) {
12788 $Symbol = function Symbol() {
12789 if (isPrototypeOf(SymbolPrototype, this)) throw TypeError('Symbol is not a constructor');
12790 var description = !arguments.length || arguments[0] === undefined ? undefined : $toString(arguments[0]);
12791 var tag = uid(description);
12792 var setter = function (value) {
12793 if (this === ObjectPrototype) call(setter, ObjectPrototypeSymbols, value);
12794 if (hasOwn(this, HIDDEN) && hasOwn(this[HIDDEN], tag)) this[HIDDEN][tag] = false;
12795 setSymbolDescriptor(this, tag, createPropertyDescriptor(1, value));
12796 };
12797 if (DESCRIPTORS && USE_SETTER) setSymbolDescriptor(ObjectPrototype, tag, { configurable: true, set: setter });
12798 return wrap(tag, description);
12799 };
12800
12801 SymbolPrototype = $Symbol[PROTOTYPE];
12802
12803 defineBuiltIn(SymbolPrototype, 'toString', function toString() {
12804 return getInternalState(this).tag;
12805 });
12806
12807 defineBuiltIn($Symbol, 'withoutSetter', function (description) {
12808 return wrap(uid(description), description);
12809 });
12810
12811 propertyIsEnumerableModule.f = $propertyIsEnumerable;
12812 definePropertyModule.f = $defineProperty;
12813 definePropertiesModule.f = $defineProperties;
12814 getOwnPropertyDescriptorModule.f = $getOwnPropertyDescriptor;
12815 getOwnPropertyNamesModule.f = getOwnPropertyNamesExternal.f = $getOwnPropertyNames;
12816 getOwnPropertySymbolsModule.f = $getOwnPropertySymbols;
12817
12818 wrappedWellKnownSymbolModule.f = function (name) {
12819 return wrap(wellKnownSymbol(name), name);
12820 };
12821
12822 if (DESCRIPTORS) {
12823 // https://github.com/tc39/proposal-Symbol-description
12824 nativeDefineProperty(SymbolPrototype, 'description', {
12825 configurable: true,
12826 get: function description() {
12827 return getInternalState(this).description;
12828 }
12829 });
12830 if (!IS_PURE) {
12831 defineBuiltIn(ObjectPrototype, 'propertyIsEnumerable', $propertyIsEnumerable, { unsafe: true });
12832 }
12833 }
12834}
12835
12836$({ global: true, constructor: true, wrap: true, forced: !NATIVE_SYMBOL, sham: !NATIVE_SYMBOL }, {
12837 Symbol: $Symbol
12838});
12839
12840$forEach(objectKeys(WellKnownSymbolsStore), function (name) {
12841 defineWellKnownSymbol(name);
12842});
12843
12844$({ target: SYMBOL, stat: true, forced: !NATIVE_SYMBOL }, {
12845 useSetter: function () { USE_SETTER = true; },
12846 useSimple: function () { USE_SETTER = false; }
12847});
12848
12849$({ target: 'Object', stat: true, forced: !NATIVE_SYMBOL, sham: !DESCRIPTORS }, {
12850 // `Object.create` method
12851 // https://tc39.es/ecma262/#sec-object.create
12852 create: $create,
12853 // `Object.defineProperty` method
12854 // https://tc39.es/ecma262/#sec-object.defineproperty
12855 defineProperty: $defineProperty,
12856 // `Object.defineProperties` method
12857 // https://tc39.es/ecma262/#sec-object.defineproperties
12858 defineProperties: $defineProperties,
12859 // `Object.getOwnPropertyDescriptor` method
12860 // https://tc39.es/ecma262/#sec-object.getownpropertydescriptors
12861 getOwnPropertyDescriptor: $getOwnPropertyDescriptor
12862});
12863
12864$({ target: 'Object', stat: true, forced: !NATIVE_SYMBOL }, {
12865 // `Object.getOwnPropertyNames` method
12866 // https://tc39.es/ecma262/#sec-object.getownpropertynames
12867 getOwnPropertyNames: $getOwnPropertyNames
12868});
12869
12870// `Symbol.prototype[@@toPrimitive]` method
12871// https://tc39.es/ecma262/#sec-symbol.prototype-@@toprimitive
12872defineSymbolToPrimitive();
12873
12874// `Symbol.prototype[@@toStringTag]` property
12875// https://tc39.es/ecma262/#sec-symbol.prototype-@@tostringtag
12876setToStringTag($Symbol, SYMBOL);
12877
12878hiddenKeys[HIDDEN] = true;
12879
12880
12881/***/ }),
12882/* 404 */
12883/***/ (function(module, exports, __webpack_require__) {
12884
12885var toAbsoluteIndex = __webpack_require__(119);
12886var lengthOfArrayLike = __webpack_require__(46);
12887var createProperty = __webpack_require__(106);
12888
12889var $Array = Array;
12890var max = Math.max;
12891
12892module.exports = function (O, start, end) {
12893 var length = lengthOfArrayLike(O);
12894 var k = toAbsoluteIndex(start, length);
12895 var fin = toAbsoluteIndex(end === undefined ? length : end, length);
12896 var result = $Array(max(fin - k, 0));
12897 for (var n = 0; k < fin; k++, n++) createProperty(result, n, O[k]);
12898 result.length = n;
12899 return result;
12900};
12901
12902
12903/***/ }),
12904/* 405 */
12905/***/ (function(module, exports, __webpack_require__) {
12906
12907var $ = __webpack_require__(0);
12908var getBuiltIn = __webpack_require__(18);
12909var hasOwn = __webpack_require__(14);
12910var toString = __webpack_require__(75);
12911var shared = __webpack_require__(73);
12912var NATIVE_SYMBOL_REGISTRY = __webpack_require__(236);
12913
12914var StringToSymbolRegistry = shared('string-to-symbol-registry');
12915var SymbolToStringRegistry = shared('symbol-to-string-registry');
12916
12917// `Symbol.for` method
12918// https://tc39.es/ecma262/#sec-symbol.for
12919$({ target: 'Symbol', stat: true, forced: !NATIVE_SYMBOL_REGISTRY }, {
12920 'for': function (key) {
12921 var string = toString(key);
12922 if (hasOwn(StringToSymbolRegistry, string)) return StringToSymbolRegistry[string];
12923 var symbol = getBuiltIn('Symbol')(string);
12924 StringToSymbolRegistry[string] = symbol;
12925 SymbolToStringRegistry[symbol] = string;
12926 return symbol;
12927 }
12928});
12929
12930
12931/***/ }),
12932/* 406 */
12933/***/ (function(module, exports, __webpack_require__) {
12934
12935var $ = __webpack_require__(0);
12936var hasOwn = __webpack_require__(14);
12937var isSymbol = __webpack_require__(89);
12938var tryToString = __webpack_require__(72);
12939var shared = __webpack_require__(73);
12940var NATIVE_SYMBOL_REGISTRY = __webpack_require__(236);
12941
12942var SymbolToStringRegistry = shared('symbol-to-string-registry');
12943
12944// `Symbol.keyFor` method
12945// https://tc39.es/ecma262/#sec-symbol.keyfor
12946$({ target: 'Symbol', stat: true, forced: !NATIVE_SYMBOL_REGISTRY }, {
12947 keyFor: function keyFor(sym) {
12948 if (!isSymbol(sym)) throw TypeError(tryToString(sym) + ' is not a symbol');
12949 if (hasOwn(SymbolToStringRegistry, sym)) return SymbolToStringRegistry[sym];
12950 }
12951});
12952
12953
12954/***/ }),
12955/* 407 */
12956/***/ (function(module, exports, __webpack_require__) {
12957
12958var $ = __webpack_require__(0);
12959var NATIVE_SYMBOL = __webpack_require__(57);
12960var fails = __webpack_require__(3);
12961var getOwnPropertySymbolsModule = __webpack_require__(97);
12962var toObject = __webpack_require__(34);
12963
12964// V8 ~ Chrome 38 and 39 `Object.getOwnPropertySymbols` fails on primitives
12965// https://bugs.chromium.org/p/v8/issues/detail?id=3443
12966var FORCED = !NATIVE_SYMBOL || fails(function () { getOwnPropertySymbolsModule.f(1); });
12967
12968// `Object.getOwnPropertySymbols` method
12969// https://tc39.es/ecma262/#sec-object.getownpropertysymbols
12970$({ target: 'Object', stat: true, forced: FORCED }, {
12971 getOwnPropertySymbols: function getOwnPropertySymbols(it) {
12972 var $getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
12973 return $getOwnPropertySymbols ? $getOwnPropertySymbols(toObject(it)) : [];
12974 }
12975});
12976
12977
12978/***/ }),
12979/* 408 */
12980/***/ (function(module, exports, __webpack_require__) {
12981
12982var defineWellKnownSymbol = __webpack_require__(8);
12983
12984// `Symbol.asyncIterator` well-known symbol
12985// https://tc39.es/ecma262/#sec-symbol.asynciterator
12986defineWellKnownSymbol('asyncIterator');
12987
12988
12989/***/ }),
12990/* 409 */
12991/***/ (function(module, exports) {
12992
12993// empty
12994
12995
12996/***/ }),
12997/* 410 */
12998/***/ (function(module, exports, __webpack_require__) {
12999
13000var defineWellKnownSymbol = __webpack_require__(8);
13001
13002// `Symbol.hasInstance` well-known symbol
13003// https://tc39.es/ecma262/#sec-symbol.hasinstance
13004defineWellKnownSymbol('hasInstance');
13005
13006
13007/***/ }),
13008/* 411 */
13009/***/ (function(module, exports, __webpack_require__) {
13010
13011var defineWellKnownSymbol = __webpack_require__(8);
13012
13013// `Symbol.isConcatSpreadable` well-known symbol
13014// https://tc39.es/ecma262/#sec-symbol.isconcatspreadable
13015defineWellKnownSymbol('isConcatSpreadable');
13016
13017
13018/***/ }),
13019/* 412 */
13020/***/ (function(module, exports, __webpack_require__) {
13021
13022var defineWellKnownSymbol = __webpack_require__(8);
13023
13024// `Symbol.match` well-known symbol
13025// https://tc39.es/ecma262/#sec-symbol.match
13026defineWellKnownSymbol('match');
13027
13028
13029/***/ }),
13030/* 413 */
13031/***/ (function(module, exports, __webpack_require__) {
13032
13033var defineWellKnownSymbol = __webpack_require__(8);
13034
13035// `Symbol.matchAll` well-known symbol
13036// https://tc39.es/ecma262/#sec-symbol.matchall
13037defineWellKnownSymbol('matchAll');
13038
13039
13040/***/ }),
13041/* 414 */
13042/***/ (function(module, exports, __webpack_require__) {
13043
13044var defineWellKnownSymbol = __webpack_require__(8);
13045
13046// `Symbol.replace` well-known symbol
13047// https://tc39.es/ecma262/#sec-symbol.replace
13048defineWellKnownSymbol('replace');
13049
13050
13051/***/ }),
13052/* 415 */
13053/***/ (function(module, exports, __webpack_require__) {
13054
13055var defineWellKnownSymbol = __webpack_require__(8);
13056
13057// `Symbol.search` well-known symbol
13058// https://tc39.es/ecma262/#sec-symbol.search
13059defineWellKnownSymbol('search');
13060
13061
13062/***/ }),
13063/* 416 */
13064/***/ (function(module, exports, __webpack_require__) {
13065
13066var defineWellKnownSymbol = __webpack_require__(8);
13067
13068// `Symbol.species` well-known symbol
13069// https://tc39.es/ecma262/#sec-symbol.species
13070defineWellKnownSymbol('species');
13071
13072
13073/***/ }),
13074/* 417 */
13075/***/ (function(module, exports, __webpack_require__) {
13076
13077var defineWellKnownSymbol = __webpack_require__(8);
13078
13079// `Symbol.split` well-known symbol
13080// https://tc39.es/ecma262/#sec-symbol.split
13081defineWellKnownSymbol('split');
13082
13083
13084/***/ }),
13085/* 418 */
13086/***/ (function(module, exports, __webpack_require__) {
13087
13088var defineWellKnownSymbol = __webpack_require__(8);
13089var defineSymbolToPrimitive = __webpack_require__(235);
13090
13091// `Symbol.toPrimitive` well-known symbol
13092// https://tc39.es/ecma262/#sec-symbol.toprimitive
13093defineWellKnownSymbol('toPrimitive');
13094
13095// `Symbol.prototype[@@toPrimitive]` method
13096// https://tc39.es/ecma262/#sec-symbol.prototype-@@toprimitive
13097defineSymbolToPrimitive();
13098
13099
13100/***/ }),
13101/* 419 */
13102/***/ (function(module, exports, __webpack_require__) {
13103
13104var getBuiltIn = __webpack_require__(18);
13105var defineWellKnownSymbol = __webpack_require__(8);
13106var setToStringTag = __webpack_require__(49);
13107
13108// `Symbol.toStringTag` well-known symbol
13109// https://tc39.es/ecma262/#sec-symbol.tostringtag
13110defineWellKnownSymbol('toStringTag');
13111
13112// `Symbol.prototype[@@toStringTag]` property
13113// https://tc39.es/ecma262/#sec-symbol.prototype-@@tostringtag
13114setToStringTag(getBuiltIn('Symbol'), 'Symbol');
13115
13116
13117/***/ }),
13118/* 420 */
13119/***/ (function(module, exports, __webpack_require__) {
13120
13121var defineWellKnownSymbol = __webpack_require__(8);
13122
13123// `Symbol.unscopables` well-known symbol
13124// https://tc39.es/ecma262/#sec-symbol.unscopables
13125defineWellKnownSymbol('unscopables');
13126
13127
13128/***/ }),
13129/* 421 */
13130/***/ (function(module, exports, __webpack_require__) {
13131
13132var global = __webpack_require__(6);
13133var setToStringTag = __webpack_require__(49);
13134
13135// JSON[@@toStringTag] property
13136// https://tc39.es/ecma262/#sec-json-@@tostringtag
13137setToStringTag(global.JSON, 'JSON', true);
13138
13139
13140/***/ }),
13141/* 422 */
13142/***/ (function(module, exports) {
13143
13144// empty
13145
13146
13147/***/ }),
13148/* 423 */
13149/***/ (function(module, exports) {
13150
13151// empty
13152
13153
13154/***/ }),
13155/* 424 */
13156/***/ (function(module, exports, __webpack_require__) {
13157
13158var defineWellKnownSymbol = __webpack_require__(8);
13159
13160// `Symbol.asyncDispose` well-known symbol
13161// https://github.com/tc39/proposal-using-statement
13162defineWellKnownSymbol('asyncDispose');
13163
13164
13165/***/ }),
13166/* 425 */
13167/***/ (function(module, exports, __webpack_require__) {
13168
13169var defineWellKnownSymbol = __webpack_require__(8);
13170
13171// `Symbol.dispose` well-known symbol
13172// https://github.com/tc39/proposal-using-statement
13173defineWellKnownSymbol('dispose');
13174
13175
13176/***/ }),
13177/* 426 */
13178/***/ (function(module, exports, __webpack_require__) {
13179
13180var defineWellKnownSymbol = __webpack_require__(8);
13181
13182// `Symbol.matcher` well-known symbol
13183// https://github.com/tc39/proposal-pattern-matching
13184defineWellKnownSymbol('matcher');
13185
13186
13187/***/ }),
13188/* 427 */
13189/***/ (function(module, exports, __webpack_require__) {
13190
13191var defineWellKnownSymbol = __webpack_require__(8);
13192
13193// `Symbol.metadataKey` well-known symbol
13194// https://github.com/tc39/proposal-decorator-metadata
13195defineWellKnownSymbol('metadataKey');
13196
13197
13198/***/ }),
13199/* 428 */
13200/***/ (function(module, exports, __webpack_require__) {
13201
13202var defineWellKnownSymbol = __webpack_require__(8);
13203
13204// `Symbol.observable` well-known symbol
13205// https://github.com/tc39/proposal-observable
13206defineWellKnownSymbol('observable');
13207
13208
13209/***/ }),
13210/* 429 */
13211/***/ (function(module, exports, __webpack_require__) {
13212
13213// TODO: Remove from `core-js@4`
13214var defineWellKnownSymbol = __webpack_require__(8);
13215
13216// `Symbol.metadata` well-known symbol
13217// https://github.com/tc39/proposal-decorators
13218defineWellKnownSymbol('metadata');
13219
13220
13221/***/ }),
13222/* 430 */
13223/***/ (function(module, exports, __webpack_require__) {
13224
13225// TODO: remove from `core-js@4`
13226var defineWellKnownSymbol = __webpack_require__(8);
13227
13228// `Symbol.patternMatch` well-known symbol
13229// https://github.com/tc39/proposal-pattern-matching
13230defineWellKnownSymbol('patternMatch');
13231
13232
13233/***/ }),
13234/* 431 */
13235/***/ (function(module, exports, __webpack_require__) {
13236
13237// TODO: remove from `core-js@4`
13238var defineWellKnownSymbol = __webpack_require__(8);
13239
13240defineWellKnownSymbol('replaceAll');
13241
13242
13243/***/ }),
13244/* 432 */
13245/***/ (function(module, exports, __webpack_require__) {
13246
13247module.exports = __webpack_require__(433);
13248
13249/***/ }),
13250/* 433 */
13251/***/ (function(module, exports, __webpack_require__) {
13252
13253module.exports = __webpack_require__(434);
13254
13255
13256/***/ }),
13257/* 434 */
13258/***/ (function(module, exports, __webpack_require__) {
13259
13260var parent = __webpack_require__(435);
13261
13262module.exports = parent;
13263
13264
13265/***/ }),
13266/* 435 */
13267/***/ (function(module, exports, __webpack_require__) {
13268
13269var parent = __webpack_require__(238);
13270
13271module.exports = parent;
13272
13273
13274/***/ }),
13275/* 436 */
13276/***/ (function(module, exports, __webpack_require__) {
13277
13278__webpack_require__(48);
13279__webpack_require__(60);
13280__webpack_require__(78);
13281__webpack_require__(237);
13282var WrappedWellKnownSymbolModule = __webpack_require__(144);
13283
13284module.exports = WrappedWellKnownSymbolModule.f('iterator');
13285
13286
13287/***/ }),
13288/* 437 */
13289/***/ (function(module, exports, __webpack_require__) {
13290
13291module.exports = __webpack_require__(438);
13292
13293/***/ }),
13294/* 438 */
13295/***/ (function(module, exports, __webpack_require__) {
13296
13297var parent = __webpack_require__(439);
13298
13299module.exports = parent;
13300
13301
13302/***/ }),
13303/* 439 */
13304/***/ (function(module, exports, __webpack_require__) {
13305
13306var isPrototypeOf = __webpack_require__(21);
13307var method = __webpack_require__(440);
13308
13309var ArrayPrototype = Array.prototype;
13310
13311module.exports = function (it) {
13312 var own = it.filter;
13313 return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.filter) ? method : own;
13314};
13315
13316
13317/***/ }),
13318/* 440 */
13319/***/ (function(module, exports, __webpack_require__) {
13320
13321__webpack_require__(441);
13322var entryVirtual = __webpack_require__(41);
13323
13324module.exports = entryVirtual('Array').filter;
13325
13326
13327/***/ }),
13328/* 441 */
13329/***/ (function(module, exports, __webpack_require__) {
13330
13331"use strict";
13332
13333var $ = __webpack_require__(0);
13334var $filter = __webpack_require__(66).filter;
13335var arrayMethodHasSpeciesSupport = __webpack_require__(107);
13336
13337var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('filter');
13338
13339// `Array.prototype.filter` method
13340// https://tc39.es/ecma262/#sec-array.prototype.filter
13341// with adding support of @@species
13342$({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
13343 filter: function filter(callbackfn /* , thisArg */) {
13344 return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
13345 }
13346});
13347
13348
13349/***/ }),
13350/* 442 */
13351/***/ (function(module, exports, __webpack_require__) {
13352
13353"use strict";
13354// Copyright (c) 2015-2017 David M. Lee, II
13355
13356
13357/**
13358 * Local reference to TimeoutError
13359 * @private
13360 */
13361var TimeoutError;
13362
13363/**
13364 * Rejects a promise with a {@link TimeoutError} if it does not settle within
13365 * the specified timeout.
13366 *
13367 * @param {Promise} promise The promise.
13368 * @param {number} timeoutMillis Number of milliseconds to wait on settling.
13369 * @returns {Promise} Either resolves/rejects with `promise`, or rejects with
13370 * `TimeoutError`, whichever settles first.
13371 */
13372var timeout = module.exports.timeout = function(promise, timeoutMillis) {
13373 var error = new TimeoutError(),
13374 timeout;
13375
13376 return Promise.race([
13377 promise,
13378 new Promise(function(resolve, reject) {
13379 timeout = setTimeout(function() {
13380 reject(error);
13381 }, timeoutMillis);
13382 }),
13383 ]).then(function(v) {
13384 clearTimeout(timeout);
13385 return v;
13386 }, function(err) {
13387 clearTimeout(timeout);
13388 throw err;
13389 });
13390};
13391
13392/**
13393 * Exception indicating that the timeout expired.
13394 */
13395TimeoutError = module.exports.TimeoutError = function() {
13396 Error.call(this)
13397 this.stack = Error().stack
13398 this.message = 'Timeout';
13399};
13400
13401TimeoutError.prototype = Object.create(Error.prototype);
13402TimeoutError.prototype.name = "TimeoutError";
13403
13404
13405/***/ }),
13406/* 443 */
13407/***/ (function(module, exports, __webpack_require__) {
13408
13409"use strict";
13410
13411
13412var _interopRequireDefault = __webpack_require__(1);
13413
13414var _slice = _interopRequireDefault(__webpack_require__(87));
13415
13416var _keys = _interopRequireDefault(__webpack_require__(55));
13417
13418var _concat = _interopRequireDefault(__webpack_require__(30));
13419
13420var _ = __webpack_require__(2);
13421
13422module.exports = function (AV) {
13423 var eventSplitter = /\s+/;
13424 var slice = (0, _slice.default)(Array.prototype);
13425 /**
13426 * @class
13427 *
13428 * <p>AV.Events is a fork of Backbone's Events module, provided for your
13429 * convenience.</p>
13430 *
13431 * <p>A module that can be mixed in to any object in order to provide
13432 * it with custom events. You may bind callback functions to an event
13433 * with `on`, or remove these functions with `off`.
13434 * Triggering an event fires all callbacks in the order that `on` was
13435 * called.
13436 *
13437 * @private
13438 * @example
13439 * var object = {};
13440 * _.extend(object, AV.Events);
13441 * object.on('expand', function(){ alert('expanded'); });
13442 * object.trigger('expand');</pre></p>
13443 *
13444 */
13445
13446 AV.Events = {
13447 /**
13448 * Bind one or more space separated events, `events`, to a `callback`
13449 * function. Passing `"all"` will bind the callback to all events fired.
13450 */
13451 on: function on(events, callback, context) {
13452 var calls, event, node, tail, list;
13453
13454 if (!callback) {
13455 return this;
13456 }
13457
13458 events = events.split(eventSplitter);
13459 calls = this._callbacks || (this._callbacks = {}); // Create an immutable callback list, allowing traversal during
13460 // modification. The tail is an empty object that will always be used
13461 // as the next node.
13462
13463 event = events.shift();
13464
13465 while (event) {
13466 list = calls[event];
13467 node = list ? list.tail : {};
13468 node.next = tail = {};
13469 node.context = context;
13470 node.callback = callback;
13471 calls[event] = {
13472 tail: tail,
13473 next: list ? list.next : node
13474 };
13475 event = events.shift();
13476 }
13477
13478 return this;
13479 },
13480
13481 /**
13482 * Remove one or many callbacks. If `context` is null, removes all callbacks
13483 * with that function. If `callback` is null, removes all callbacks for the
13484 * event. If `events` is null, removes all bound callbacks for all events.
13485 */
13486 off: function off(events, callback, context) {
13487 var event, calls, node, tail, cb, ctx; // No events, or removing *all* events.
13488
13489 if (!(calls = this._callbacks)) {
13490 return;
13491 }
13492
13493 if (!(events || callback || context)) {
13494 delete this._callbacks;
13495 return this;
13496 } // Loop through the listed events and contexts, splicing them out of the
13497 // linked list of callbacks if appropriate.
13498
13499
13500 events = events ? events.split(eventSplitter) : (0, _keys.default)(_).call(_, calls);
13501 event = events.shift();
13502
13503 while (event) {
13504 node = calls[event];
13505 delete calls[event];
13506
13507 if (!node || !(callback || context)) {
13508 continue;
13509 } // Create a new list, omitting the indicated callbacks.
13510
13511
13512 tail = node.tail;
13513 node = node.next;
13514
13515 while (node !== tail) {
13516 cb = node.callback;
13517 ctx = node.context;
13518
13519 if (callback && cb !== callback || context && ctx !== context) {
13520 this.on(event, cb, ctx);
13521 }
13522
13523 node = node.next;
13524 }
13525
13526 event = events.shift();
13527 }
13528
13529 return this;
13530 },
13531
13532 /**
13533 * Trigger one or many events, firing all bound callbacks. Callbacks are
13534 * passed the same arguments as `trigger` is, apart from the event name
13535 * (unless you're listening on `"all"`, which will cause your callback to
13536 * receive the true name of the event as the first argument).
13537 */
13538 trigger: function trigger(events) {
13539 var event, node, calls, tail, args, all, rest;
13540
13541 if (!(calls = this._callbacks)) {
13542 return this;
13543 }
13544
13545 all = calls.all;
13546 events = events.split(eventSplitter);
13547 rest = slice.call(arguments, 1); // For each event, walk through the linked list of callbacks twice,
13548 // first to trigger the event, then to trigger any `"all"` callbacks.
13549
13550 event = events.shift();
13551
13552 while (event) {
13553 node = calls[event];
13554
13555 if (node) {
13556 tail = node.tail;
13557
13558 while ((node = node.next) !== tail) {
13559 node.callback.apply(node.context || this, rest);
13560 }
13561 }
13562
13563 node = all;
13564
13565 if (node) {
13566 var _context;
13567
13568 tail = node.tail;
13569 args = (0, _concat.default)(_context = [event]).call(_context, rest);
13570
13571 while ((node = node.next) !== tail) {
13572 node.callback.apply(node.context || this, args);
13573 }
13574 }
13575
13576 event = events.shift();
13577 }
13578
13579 return this;
13580 }
13581 };
13582 /**
13583 * @function
13584 */
13585
13586 AV.Events.bind = AV.Events.on;
13587 /**
13588 * @function
13589 */
13590
13591 AV.Events.unbind = AV.Events.off;
13592};
13593
13594/***/ }),
13595/* 444 */
13596/***/ (function(module, exports, __webpack_require__) {
13597
13598"use strict";
13599
13600
13601var _interopRequireDefault = __webpack_require__(1);
13602
13603var _promise = _interopRequireDefault(__webpack_require__(12));
13604
13605var _ = __webpack_require__(2);
13606/*global navigator: false */
13607
13608
13609module.exports = function (AV) {
13610 /**
13611 * Creates a new GeoPoint with any of the following forms:<br>
13612 * @example
13613 * new GeoPoint(otherGeoPoint)
13614 * new GeoPoint(30, 30)
13615 * new GeoPoint([30, 30])
13616 * new GeoPoint({latitude: 30, longitude: 30})
13617 * new GeoPoint() // defaults to (0, 0)
13618 * @class
13619 *
13620 * <p>Represents a latitude / longitude point that may be associated
13621 * with a key in a AVObject or used as a reference point for geo queries.
13622 * This allows proximity-based queries on the key.</p>
13623 *
13624 * <p>Only one key in a class may contain a GeoPoint.</p>
13625 *
13626 * <p>Example:<pre>
13627 * var point = new AV.GeoPoint(30.0, -20.0);
13628 * var object = new AV.Object("PlaceObject");
13629 * object.set("location", point);
13630 * object.save();</pre></p>
13631 */
13632 AV.GeoPoint = function (arg1, arg2) {
13633 if (_.isArray(arg1)) {
13634 AV.GeoPoint._validate(arg1[0], arg1[1]);
13635
13636 this.latitude = arg1[0];
13637 this.longitude = arg1[1];
13638 } else if (_.isObject(arg1)) {
13639 AV.GeoPoint._validate(arg1.latitude, arg1.longitude);
13640
13641 this.latitude = arg1.latitude;
13642 this.longitude = arg1.longitude;
13643 } else if (_.isNumber(arg1) && _.isNumber(arg2)) {
13644 AV.GeoPoint._validate(arg1, arg2);
13645
13646 this.latitude = arg1;
13647 this.longitude = arg2;
13648 } else {
13649 this.latitude = 0;
13650 this.longitude = 0;
13651 } // Add properties so that anyone using Webkit or Mozilla will get an error
13652 // if they try to set values that are out of bounds.
13653
13654
13655 var self = this;
13656
13657 if (this.__defineGetter__ && this.__defineSetter__) {
13658 // Use _latitude and _longitude to actually store the values, and add
13659 // getters and setters for latitude and longitude.
13660 this._latitude = this.latitude;
13661 this._longitude = this.longitude;
13662
13663 this.__defineGetter__('latitude', function () {
13664 return self._latitude;
13665 });
13666
13667 this.__defineGetter__('longitude', function () {
13668 return self._longitude;
13669 });
13670
13671 this.__defineSetter__('latitude', function (val) {
13672 AV.GeoPoint._validate(val, self.longitude);
13673
13674 self._latitude = val;
13675 });
13676
13677 this.__defineSetter__('longitude', function (val) {
13678 AV.GeoPoint._validate(self.latitude, val);
13679
13680 self._longitude = val;
13681 });
13682 }
13683 };
13684 /**
13685 * @lends AV.GeoPoint.prototype
13686 * @property {float} latitude North-south portion of the coordinate, in range
13687 * [-90, 90]. Throws an exception if set out of range in a modern browser.
13688 * @property {float} longitude East-west portion of the coordinate, in range
13689 * [-180, 180]. Throws if set out of range in a modern browser.
13690 */
13691
13692 /**
13693 * Throws an exception if the given lat-long is out of bounds.
13694 * @private
13695 */
13696
13697
13698 AV.GeoPoint._validate = function (latitude, longitude) {
13699 if (latitude < -90.0) {
13700 throw new Error('AV.GeoPoint latitude ' + latitude + ' < -90.0.');
13701 }
13702
13703 if (latitude > 90.0) {
13704 throw new Error('AV.GeoPoint latitude ' + latitude + ' > 90.0.');
13705 }
13706
13707 if (longitude < -180.0) {
13708 throw new Error('AV.GeoPoint longitude ' + longitude + ' < -180.0.');
13709 }
13710
13711 if (longitude > 180.0) {
13712 throw new Error('AV.GeoPoint longitude ' + longitude + ' > 180.0.');
13713 }
13714 };
13715 /**
13716 * Creates a GeoPoint with the user's current location, if available.
13717 * @return {Promise.<AV.GeoPoint>}
13718 */
13719
13720
13721 AV.GeoPoint.current = function () {
13722 return new _promise.default(function (resolve, reject) {
13723 navigator.geolocation.getCurrentPosition(function (location) {
13724 resolve(new AV.GeoPoint({
13725 latitude: location.coords.latitude,
13726 longitude: location.coords.longitude
13727 }));
13728 }, reject);
13729 });
13730 };
13731
13732 _.extend(AV.GeoPoint.prototype,
13733 /** @lends AV.GeoPoint.prototype */
13734 {
13735 /**
13736 * Returns a JSON representation of the GeoPoint, suitable for AV.
13737 * @return {Object}
13738 */
13739 toJSON: function toJSON() {
13740 AV.GeoPoint._validate(this.latitude, this.longitude);
13741
13742 return {
13743 __type: 'GeoPoint',
13744 latitude: this.latitude,
13745 longitude: this.longitude
13746 };
13747 },
13748
13749 /**
13750 * Returns the distance from this GeoPoint to another in radians.
13751 * @param {AV.GeoPoint} point the other AV.GeoPoint.
13752 * @return {Number}
13753 */
13754 radiansTo: function radiansTo(point) {
13755 var d2r = Math.PI / 180.0;
13756 var lat1rad = this.latitude * d2r;
13757 var long1rad = this.longitude * d2r;
13758 var lat2rad = point.latitude * d2r;
13759 var long2rad = point.longitude * d2r;
13760 var deltaLat = lat1rad - lat2rad;
13761 var deltaLong = long1rad - long2rad;
13762 var sinDeltaLatDiv2 = Math.sin(deltaLat / 2);
13763 var sinDeltaLongDiv2 = Math.sin(deltaLong / 2); // Square of half the straight line chord distance between both points.
13764
13765 var a = sinDeltaLatDiv2 * sinDeltaLatDiv2 + Math.cos(lat1rad) * Math.cos(lat2rad) * sinDeltaLongDiv2 * sinDeltaLongDiv2;
13766 a = Math.min(1.0, a);
13767 return 2 * Math.asin(Math.sqrt(a));
13768 },
13769
13770 /**
13771 * Returns the distance from this GeoPoint to another in kilometers.
13772 * @param {AV.GeoPoint} point the other AV.GeoPoint.
13773 * @return {Number}
13774 */
13775 kilometersTo: function kilometersTo(point) {
13776 return this.radiansTo(point) * 6371.0;
13777 },
13778
13779 /**
13780 * Returns the distance from this GeoPoint to another in miles.
13781 * @param {AV.GeoPoint} point the other AV.GeoPoint.
13782 * @return {Number}
13783 */
13784 milesTo: function milesTo(point) {
13785 return this.radiansTo(point) * 3958.8;
13786 }
13787 });
13788};
13789
13790/***/ }),
13791/* 445 */
13792/***/ (function(module, exports, __webpack_require__) {
13793
13794"use strict";
13795
13796
13797var _ = __webpack_require__(2);
13798
13799module.exports = function (AV) {
13800 var PUBLIC_KEY = '*';
13801 /**
13802 * Creates a new ACL.
13803 * If no argument is given, the ACL has no permissions for anyone.
13804 * If the argument is a AV.User, the ACL will have read and write
13805 * permission for only that user.
13806 * If the argument is any other JSON object, that object will be interpretted
13807 * as a serialized ACL created with toJSON().
13808 * @see AV.Object#setACL
13809 * @class
13810 *
13811 * <p>An ACL, or Access Control List can be added to any
13812 * <code>AV.Object</code> to restrict access to only a subset of users
13813 * of your application.</p>
13814 */
13815
13816 AV.ACL = function (arg1) {
13817 var self = this;
13818 self.permissionsById = {};
13819
13820 if (_.isObject(arg1)) {
13821 if (arg1 instanceof AV.User) {
13822 self.setReadAccess(arg1, true);
13823 self.setWriteAccess(arg1, true);
13824 } else {
13825 if (_.isFunction(arg1)) {
13826 throw new Error('AV.ACL() called with a function. Did you forget ()?');
13827 }
13828
13829 AV._objectEach(arg1, function (accessList, userId) {
13830 if (!_.isString(userId)) {
13831 throw new Error('Tried to create an ACL with an invalid userId.');
13832 }
13833
13834 self.permissionsById[userId] = {};
13835
13836 AV._objectEach(accessList, function (allowed, permission) {
13837 if (permission !== 'read' && permission !== 'write') {
13838 throw new Error('Tried to create an ACL with an invalid permission type.');
13839 }
13840
13841 if (!_.isBoolean(allowed)) {
13842 throw new Error('Tried to create an ACL with an invalid permission value.');
13843 }
13844
13845 self.permissionsById[userId][permission] = allowed;
13846 });
13847 });
13848 }
13849 }
13850 };
13851 /**
13852 * Returns a JSON-encoded version of the ACL.
13853 * @return {Object}
13854 */
13855
13856
13857 AV.ACL.prototype.toJSON = function () {
13858 return _.clone(this.permissionsById);
13859 };
13860
13861 AV.ACL.prototype._setAccess = function (accessType, userId, allowed) {
13862 if (userId instanceof AV.User) {
13863 userId = userId.id;
13864 } else if (userId instanceof AV.Role) {
13865 userId = 'role:' + userId.getName();
13866 }
13867
13868 if (!_.isString(userId)) {
13869 throw new Error('userId must be a string.');
13870 }
13871
13872 if (!_.isBoolean(allowed)) {
13873 throw new Error('allowed must be either true or false.');
13874 }
13875
13876 var permissions = this.permissionsById[userId];
13877
13878 if (!permissions) {
13879 if (!allowed) {
13880 // The user already doesn't have this permission, so no action needed.
13881 return;
13882 } else {
13883 permissions = {};
13884 this.permissionsById[userId] = permissions;
13885 }
13886 }
13887
13888 if (allowed) {
13889 this.permissionsById[userId][accessType] = true;
13890 } else {
13891 delete permissions[accessType];
13892
13893 if (_.isEmpty(permissions)) {
13894 delete this.permissionsById[userId];
13895 }
13896 }
13897 };
13898
13899 AV.ACL.prototype._getAccess = function (accessType, userId) {
13900 if (userId instanceof AV.User) {
13901 userId = userId.id;
13902 } else if (userId instanceof AV.Role) {
13903 userId = 'role:' + userId.getName();
13904 }
13905
13906 var permissions = this.permissionsById[userId];
13907
13908 if (!permissions) {
13909 return false;
13910 }
13911
13912 return permissions[accessType] ? true : false;
13913 };
13914 /**
13915 * Set whether the given user is allowed to read this object.
13916 * @param userId An instance of AV.User or its objectId.
13917 * @param {Boolean} allowed Whether that user should have read access.
13918 */
13919
13920
13921 AV.ACL.prototype.setReadAccess = function (userId, allowed) {
13922 this._setAccess('read', userId, allowed);
13923 };
13924 /**
13925 * Get whether the given user id is *explicitly* allowed to read this object.
13926 * Even if this returns false, the user may still be able to access it if
13927 * getPublicReadAccess returns true or a role that the user belongs to has
13928 * write access.
13929 * @param userId An instance of AV.User or its objectId, or a AV.Role.
13930 * @return {Boolean}
13931 */
13932
13933
13934 AV.ACL.prototype.getReadAccess = function (userId) {
13935 return this._getAccess('read', userId);
13936 };
13937 /**
13938 * Set whether the given user id is allowed to write this object.
13939 * @param userId An instance of AV.User or its objectId, or a AV.Role..
13940 * @param {Boolean} allowed Whether that user should have write access.
13941 */
13942
13943
13944 AV.ACL.prototype.setWriteAccess = function (userId, allowed) {
13945 this._setAccess('write', userId, allowed);
13946 };
13947 /**
13948 * Get whether the given user id is *explicitly* allowed to write this object.
13949 * Even if this returns false, the user may still be able to write it if
13950 * getPublicWriteAccess returns true or a role that the user belongs to has
13951 * write access.
13952 * @param userId An instance of AV.User or its objectId, or a AV.Role.
13953 * @return {Boolean}
13954 */
13955
13956
13957 AV.ACL.prototype.getWriteAccess = function (userId) {
13958 return this._getAccess('write', userId);
13959 };
13960 /**
13961 * Set whether the public is allowed to read this object.
13962 * @param {Boolean} allowed
13963 */
13964
13965
13966 AV.ACL.prototype.setPublicReadAccess = function (allowed) {
13967 this.setReadAccess(PUBLIC_KEY, allowed);
13968 };
13969 /**
13970 * Get whether the public is allowed to read this object.
13971 * @return {Boolean}
13972 */
13973
13974
13975 AV.ACL.prototype.getPublicReadAccess = function () {
13976 return this.getReadAccess(PUBLIC_KEY);
13977 };
13978 /**
13979 * Set whether the public is allowed to write this object.
13980 * @param {Boolean} allowed
13981 */
13982
13983
13984 AV.ACL.prototype.setPublicWriteAccess = function (allowed) {
13985 this.setWriteAccess(PUBLIC_KEY, allowed);
13986 };
13987 /**
13988 * Get whether the public is allowed to write this object.
13989 * @return {Boolean}
13990 */
13991
13992
13993 AV.ACL.prototype.getPublicWriteAccess = function () {
13994 return this.getWriteAccess(PUBLIC_KEY);
13995 };
13996 /**
13997 * Get whether users belonging to the given role are allowed
13998 * to read this object. Even if this returns false, the role may
13999 * still be able to write it if a parent role has read access.
14000 *
14001 * @param role The name of the role, or a AV.Role object.
14002 * @return {Boolean} true if the role has read access. false otherwise.
14003 * @throws {String} If role is neither a AV.Role nor a String.
14004 */
14005
14006
14007 AV.ACL.prototype.getRoleReadAccess = function (role) {
14008 if (role instanceof AV.Role) {
14009 // Normalize to the String name
14010 role = role.getName();
14011 }
14012
14013 if (_.isString(role)) {
14014 return this.getReadAccess('role:' + role);
14015 }
14016
14017 throw new Error('role must be a AV.Role or a String');
14018 };
14019 /**
14020 * Get whether users belonging to the given role are allowed
14021 * to write this object. Even if this returns false, the role may
14022 * still be able to write it if a parent role has write access.
14023 *
14024 * @param role The name of the role, or a AV.Role object.
14025 * @return {Boolean} true if the role has write access. false otherwise.
14026 * @throws {String} If role is neither a AV.Role nor a String.
14027 */
14028
14029
14030 AV.ACL.prototype.getRoleWriteAccess = function (role) {
14031 if (role instanceof AV.Role) {
14032 // Normalize to the String name
14033 role = role.getName();
14034 }
14035
14036 if (_.isString(role)) {
14037 return this.getWriteAccess('role:' + role);
14038 }
14039
14040 throw new Error('role must be a AV.Role or a String');
14041 };
14042 /**
14043 * Set whether users belonging to the given role are allowed
14044 * to read this object.
14045 *
14046 * @param role The name of the role, or a AV.Role object.
14047 * @param {Boolean} allowed Whether the given role can read this object.
14048 * @throws {String} If role is neither a AV.Role nor a String.
14049 */
14050
14051
14052 AV.ACL.prototype.setRoleReadAccess = function (role, allowed) {
14053 if (role instanceof AV.Role) {
14054 // Normalize to the String name
14055 role = role.getName();
14056 }
14057
14058 if (_.isString(role)) {
14059 this.setReadAccess('role:' + role, allowed);
14060 return;
14061 }
14062
14063 throw new Error('role must be a AV.Role or a String');
14064 };
14065 /**
14066 * Set whether users belonging to the given role are allowed
14067 * to write this object.
14068 *
14069 * @param role The name of the role, or a AV.Role object.
14070 * @param {Boolean} allowed Whether the given role can write this object.
14071 * @throws {String} If role is neither a AV.Role nor a String.
14072 */
14073
14074
14075 AV.ACL.prototype.setRoleWriteAccess = function (role, allowed) {
14076 if (role instanceof AV.Role) {
14077 // Normalize to the String name
14078 role = role.getName();
14079 }
14080
14081 if (_.isString(role)) {
14082 this.setWriteAccess('role:' + role, allowed);
14083 return;
14084 }
14085
14086 throw new Error('role must be a AV.Role or a String');
14087 };
14088};
14089
14090/***/ }),
14091/* 446 */
14092/***/ (function(module, exports, __webpack_require__) {
14093
14094"use strict";
14095
14096
14097var _interopRequireDefault = __webpack_require__(1);
14098
14099var _concat = _interopRequireDefault(__webpack_require__(30));
14100
14101var _find = _interopRequireDefault(__webpack_require__(110));
14102
14103var _indexOf = _interopRequireDefault(__webpack_require__(86));
14104
14105var _map = _interopRequireDefault(__webpack_require__(42));
14106
14107var _ = __webpack_require__(2);
14108
14109module.exports = function (AV) {
14110 /**
14111 * @private
14112 * @class
14113 * A AV.Op is an atomic operation that can be applied to a field in a
14114 * AV.Object. For example, calling <code>object.set("foo", "bar")</code>
14115 * is an example of a AV.Op.Set. Calling <code>object.unset("foo")</code>
14116 * is a AV.Op.Unset. These operations are stored in a AV.Object and
14117 * sent to the server as part of <code>object.save()</code> operations.
14118 * Instances of AV.Op should be immutable.
14119 *
14120 * You should not create subclasses of AV.Op or instantiate AV.Op
14121 * directly.
14122 */
14123 AV.Op = function () {
14124 this._initialize.apply(this, arguments);
14125 };
14126
14127 _.extend(AV.Op.prototype,
14128 /** @lends AV.Op.prototype */
14129 {
14130 _initialize: function _initialize() {}
14131 });
14132
14133 _.extend(AV.Op, {
14134 /**
14135 * To create a new Op, call AV.Op._extend();
14136 * @private
14137 */
14138 _extend: AV._extend,
14139 // A map of __op string to decoder function.
14140 _opDecoderMap: {},
14141
14142 /**
14143 * Registers a function to convert a json object with an __op field into an
14144 * instance of a subclass of AV.Op.
14145 * @private
14146 */
14147 _registerDecoder: function _registerDecoder(opName, decoder) {
14148 AV.Op._opDecoderMap[opName] = decoder;
14149 },
14150
14151 /**
14152 * Converts a json object into an instance of a subclass of AV.Op.
14153 * @private
14154 */
14155 _decode: function _decode(json) {
14156 var decoder = AV.Op._opDecoderMap[json.__op];
14157
14158 if (decoder) {
14159 return decoder(json);
14160 } else {
14161 return undefined;
14162 }
14163 }
14164 });
14165 /*
14166 * Add a handler for Batch ops.
14167 */
14168
14169
14170 AV.Op._registerDecoder('Batch', function (json) {
14171 var op = null;
14172
14173 AV._arrayEach(json.ops, function (nextOp) {
14174 nextOp = AV.Op._decode(nextOp);
14175 op = nextOp._mergeWithPrevious(op);
14176 });
14177
14178 return op;
14179 });
14180 /**
14181 * @private
14182 * @class
14183 * A Set operation indicates that either the field was changed using
14184 * AV.Object.set, or it is a mutable container that was detected as being
14185 * changed.
14186 */
14187
14188
14189 AV.Op.Set = AV.Op._extend(
14190 /** @lends AV.Op.Set.prototype */
14191 {
14192 _initialize: function _initialize(value) {
14193 this._value = value;
14194 },
14195
14196 /**
14197 * Returns the new value of this field after the set.
14198 */
14199 value: function value() {
14200 return this._value;
14201 },
14202
14203 /**
14204 * Returns a JSON version of the operation suitable for sending to AV.
14205 * @return {Object}
14206 */
14207 toJSON: function toJSON() {
14208 return AV._encode(this.value());
14209 },
14210 _mergeWithPrevious: function _mergeWithPrevious(previous) {
14211 return this;
14212 },
14213 _estimate: function _estimate(oldValue) {
14214 return this.value();
14215 }
14216 });
14217 /**
14218 * A sentinel value that is returned by AV.Op.Unset._estimate to
14219 * indicate the field should be deleted. Basically, if you find _UNSET as a
14220 * value in your object, you should remove that key.
14221 */
14222
14223 AV.Op._UNSET = {};
14224 /**
14225 * @private
14226 * @class
14227 * An Unset operation indicates that this field has been deleted from the
14228 * object.
14229 */
14230
14231 AV.Op.Unset = AV.Op._extend(
14232 /** @lends AV.Op.Unset.prototype */
14233 {
14234 /**
14235 * Returns a JSON version of the operation suitable for sending to AV.
14236 * @return {Object}
14237 */
14238 toJSON: function toJSON() {
14239 return {
14240 __op: 'Delete'
14241 };
14242 },
14243 _mergeWithPrevious: function _mergeWithPrevious(previous) {
14244 return this;
14245 },
14246 _estimate: function _estimate(oldValue) {
14247 return AV.Op._UNSET;
14248 }
14249 });
14250
14251 AV.Op._registerDecoder('Delete', function (json) {
14252 return new AV.Op.Unset();
14253 });
14254 /**
14255 * @private
14256 * @class
14257 * An Increment is an atomic operation where the numeric value for the field
14258 * will be increased by a given amount.
14259 */
14260
14261
14262 AV.Op.Increment = AV.Op._extend(
14263 /** @lends AV.Op.Increment.prototype */
14264 {
14265 _initialize: function _initialize(amount) {
14266 this._amount = amount;
14267 },
14268
14269 /**
14270 * Returns the amount to increment by.
14271 * @return {Number} the amount to increment by.
14272 */
14273 amount: function amount() {
14274 return this._amount;
14275 },
14276
14277 /**
14278 * Returns a JSON version of the operation suitable for sending to AV.
14279 * @return {Object}
14280 */
14281 toJSON: function toJSON() {
14282 return {
14283 __op: 'Increment',
14284 amount: this._amount
14285 };
14286 },
14287 _mergeWithPrevious: function _mergeWithPrevious(previous) {
14288 if (!previous) {
14289 return this;
14290 } else if (previous instanceof AV.Op.Unset) {
14291 return new AV.Op.Set(this.amount());
14292 } else if (previous instanceof AV.Op.Set) {
14293 return new AV.Op.Set(previous.value() + this.amount());
14294 } else if (previous instanceof AV.Op.Increment) {
14295 return new AV.Op.Increment(this.amount() + previous.amount());
14296 } else {
14297 throw new Error('Op is invalid after previous op.');
14298 }
14299 },
14300 _estimate: function _estimate(oldValue) {
14301 if (!oldValue) {
14302 return this.amount();
14303 }
14304
14305 return oldValue + this.amount();
14306 }
14307 });
14308
14309 AV.Op._registerDecoder('Increment', function (json) {
14310 return new AV.Op.Increment(json.amount);
14311 });
14312 /**
14313 * @private
14314 * @class
14315 * BitAnd is an atomic operation where the given value will be bit and to the
14316 * value than is stored in this field.
14317 */
14318
14319
14320 AV.Op.BitAnd = AV.Op._extend(
14321 /** @lends AV.Op.BitAnd.prototype */
14322 {
14323 _initialize: function _initialize(value) {
14324 this._value = value;
14325 },
14326 value: function value() {
14327 return this._value;
14328 },
14329
14330 /**
14331 * Returns a JSON version of the operation suitable for sending to AV.
14332 * @return {Object}
14333 */
14334 toJSON: function toJSON() {
14335 return {
14336 __op: 'BitAnd',
14337 value: this.value()
14338 };
14339 },
14340 _mergeWithPrevious: function _mergeWithPrevious(previous) {
14341 if (!previous) {
14342 return this;
14343 } else if (previous instanceof AV.Op.Unset) {
14344 return new AV.Op.Set(0);
14345 } else if (previous instanceof AV.Op.Set) {
14346 return new AV.Op.Set(previous.value() & this.value());
14347 } else {
14348 throw new Error('Op is invalid after previous op.');
14349 }
14350 },
14351 _estimate: function _estimate(oldValue) {
14352 return oldValue & this.value();
14353 }
14354 });
14355
14356 AV.Op._registerDecoder('BitAnd', function (json) {
14357 return new AV.Op.BitAnd(json.value);
14358 });
14359 /**
14360 * @private
14361 * @class
14362 * BitOr is an atomic operation where the given value will be bit and to the
14363 * value than is stored in this field.
14364 */
14365
14366
14367 AV.Op.BitOr = AV.Op._extend(
14368 /** @lends AV.Op.BitOr.prototype */
14369 {
14370 _initialize: function _initialize(value) {
14371 this._value = value;
14372 },
14373 value: function value() {
14374 return this._value;
14375 },
14376
14377 /**
14378 * Returns a JSON version of the operation suitable for sending to AV.
14379 * @return {Object}
14380 */
14381 toJSON: function toJSON() {
14382 return {
14383 __op: 'BitOr',
14384 value: this.value()
14385 };
14386 },
14387 _mergeWithPrevious: function _mergeWithPrevious(previous) {
14388 if (!previous) {
14389 return this;
14390 } else if (previous instanceof AV.Op.Unset) {
14391 return new AV.Op.Set(this.value());
14392 } else if (previous instanceof AV.Op.Set) {
14393 return new AV.Op.Set(previous.value() | this.value());
14394 } else {
14395 throw new Error('Op is invalid after previous op.');
14396 }
14397 },
14398 _estimate: function _estimate(oldValue) {
14399 return oldValue | this.value();
14400 }
14401 });
14402
14403 AV.Op._registerDecoder('BitOr', function (json) {
14404 return new AV.Op.BitOr(json.value);
14405 });
14406 /**
14407 * @private
14408 * @class
14409 * BitXor is an atomic operation where the given value will be bit and to the
14410 * value than is stored in this field.
14411 */
14412
14413
14414 AV.Op.BitXor = AV.Op._extend(
14415 /** @lends AV.Op.BitXor.prototype */
14416 {
14417 _initialize: function _initialize(value) {
14418 this._value = value;
14419 },
14420 value: function value() {
14421 return this._value;
14422 },
14423
14424 /**
14425 * Returns a JSON version of the operation suitable for sending to AV.
14426 * @return {Object}
14427 */
14428 toJSON: function toJSON() {
14429 return {
14430 __op: 'BitXor',
14431 value: this.value()
14432 };
14433 },
14434 _mergeWithPrevious: function _mergeWithPrevious(previous) {
14435 if (!previous) {
14436 return this;
14437 } else if (previous instanceof AV.Op.Unset) {
14438 return new AV.Op.Set(this.value());
14439 } else if (previous instanceof AV.Op.Set) {
14440 return new AV.Op.Set(previous.value() ^ this.value());
14441 } else {
14442 throw new Error('Op is invalid after previous op.');
14443 }
14444 },
14445 _estimate: function _estimate(oldValue) {
14446 return oldValue ^ this.value();
14447 }
14448 });
14449
14450 AV.Op._registerDecoder('BitXor', function (json) {
14451 return new AV.Op.BitXor(json.value);
14452 });
14453 /**
14454 * @private
14455 * @class
14456 * Add is an atomic operation where the given objects will be appended to the
14457 * array that is stored in this field.
14458 */
14459
14460
14461 AV.Op.Add = AV.Op._extend(
14462 /** @lends AV.Op.Add.prototype */
14463 {
14464 _initialize: function _initialize(objects) {
14465 this._objects = objects;
14466 },
14467
14468 /**
14469 * Returns the objects to be added to the array.
14470 * @return {Array} The objects to be added to the array.
14471 */
14472 objects: function objects() {
14473 return this._objects;
14474 },
14475
14476 /**
14477 * Returns a JSON version of the operation suitable for sending to AV.
14478 * @return {Object}
14479 */
14480 toJSON: function toJSON() {
14481 return {
14482 __op: 'Add',
14483 objects: AV._encode(this.objects())
14484 };
14485 },
14486 _mergeWithPrevious: function _mergeWithPrevious(previous) {
14487 if (!previous) {
14488 return this;
14489 } else if (previous instanceof AV.Op.Unset) {
14490 return new AV.Op.Set(this.objects());
14491 } else if (previous instanceof AV.Op.Set) {
14492 return new AV.Op.Set(this._estimate(previous.value()));
14493 } else if (previous instanceof AV.Op.Add) {
14494 var _context;
14495
14496 return new AV.Op.Add((0, _concat.default)(_context = previous.objects()).call(_context, this.objects()));
14497 } else {
14498 throw new Error('Op is invalid after previous op.');
14499 }
14500 },
14501 _estimate: function _estimate(oldValue) {
14502 if (!oldValue) {
14503 return _.clone(this.objects());
14504 } else {
14505 return (0, _concat.default)(oldValue).call(oldValue, this.objects());
14506 }
14507 }
14508 });
14509
14510 AV.Op._registerDecoder('Add', function (json) {
14511 return new AV.Op.Add(AV._decode(json.objects));
14512 });
14513 /**
14514 * @private
14515 * @class
14516 * AddUnique is an atomic operation where the given items will be appended to
14517 * the array that is stored in this field only if they were not already
14518 * present in the array.
14519 */
14520
14521
14522 AV.Op.AddUnique = AV.Op._extend(
14523 /** @lends AV.Op.AddUnique.prototype */
14524 {
14525 _initialize: function _initialize(objects) {
14526 this._objects = _.uniq(objects);
14527 },
14528
14529 /**
14530 * Returns the objects to be added to the array.
14531 * @return {Array} The objects to be added to the array.
14532 */
14533 objects: function objects() {
14534 return this._objects;
14535 },
14536
14537 /**
14538 * Returns a JSON version of the operation suitable for sending to AV.
14539 * @return {Object}
14540 */
14541 toJSON: function toJSON() {
14542 return {
14543 __op: 'AddUnique',
14544 objects: AV._encode(this.objects())
14545 };
14546 },
14547 _mergeWithPrevious: function _mergeWithPrevious(previous) {
14548 if (!previous) {
14549 return this;
14550 } else if (previous instanceof AV.Op.Unset) {
14551 return new AV.Op.Set(this.objects());
14552 } else if (previous instanceof AV.Op.Set) {
14553 return new AV.Op.Set(this._estimate(previous.value()));
14554 } else if (previous instanceof AV.Op.AddUnique) {
14555 return new AV.Op.AddUnique(this._estimate(previous.objects()));
14556 } else {
14557 throw new Error('Op is invalid after previous op.');
14558 }
14559 },
14560 _estimate: function _estimate(oldValue) {
14561 if (!oldValue) {
14562 return _.clone(this.objects());
14563 } else {
14564 // We can't just take the _.uniq(_.union(...)) of oldValue and
14565 // this.objects, because the uniqueness may not apply to oldValue
14566 // (especially if the oldValue was set via .set())
14567 var newValue = _.clone(oldValue);
14568
14569 AV._arrayEach(this.objects(), function (obj) {
14570 if (obj instanceof AV.Object && obj.id) {
14571 var matchingObj = (0, _find.default)(_).call(_, newValue, function (anObj) {
14572 return anObj instanceof AV.Object && anObj.id === obj.id;
14573 });
14574
14575 if (!matchingObj) {
14576 newValue.push(obj);
14577 } else {
14578 var index = (0, _indexOf.default)(_).call(_, newValue, matchingObj);
14579 newValue[index] = obj;
14580 }
14581 } else if (!_.contains(newValue, obj)) {
14582 newValue.push(obj);
14583 }
14584 });
14585
14586 return newValue;
14587 }
14588 }
14589 });
14590
14591 AV.Op._registerDecoder('AddUnique', function (json) {
14592 return new AV.Op.AddUnique(AV._decode(json.objects));
14593 });
14594 /**
14595 * @private
14596 * @class
14597 * Remove is an atomic operation where the given objects will be removed from
14598 * the array that is stored in this field.
14599 */
14600
14601
14602 AV.Op.Remove = AV.Op._extend(
14603 /** @lends AV.Op.Remove.prototype */
14604 {
14605 _initialize: function _initialize(objects) {
14606 this._objects = _.uniq(objects);
14607 },
14608
14609 /**
14610 * Returns the objects to be removed from the array.
14611 * @return {Array} The objects to be removed from the array.
14612 */
14613 objects: function objects() {
14614 return this._objects;
14615 },
14616
14617 /**
14618 * Returns a JSON version of the operation suitable for sending to AV.
14619 * @return {Object}
14620 */
14621 toJSON: function toJSON() {
14622 return {
14623 __op: 'Remove',
14624 objects: AV._encode(this.objects())
14625 };
14626 },
14627 _mergeWithPrevious: function _mergeWithPrevious(previous) {
14628 if (!previous) {
14629 return this;
14630 } else if (previous instanceof AV.Op.Unset) {
14631 return previous;
14632 } else if (previous instanceof AV.Op.Set) {
14633 return new AV.Op.Set(this._estimate(previous.value()));
14634 } else if (previous instanceof AV.Op.Remove) {
14635 return new AV.Op.Remove(_.union(previous.objects(), this.objects()));
14636 } else {
14637 throw new Error('Op is invalid after previous op.');
14638 }
14639 },
14640 _estimate: function _estimate(oldValue) {
14641 if (!oldValue) {
14642 return [];
14643 } else {
14644 var newValue = _.difference(oldValue, this.objects()); // If there are saved AV Objects being removed, also remove them.
14645
14646
14647 AV._arrayEach(this.objects(), function (obj) {
14648 if (obj instanceof AV.Object && obj.id) {
14649 newValue = _.reject(newValue, function (other) {
14650 return other instanceof AV.Object && other.id === obj.id;
14651 });
14652 }
14653 });
14654
14655 return newValue;
14656 }
14657 }
14658 });
14659
14660 AV.Op._registerDecoder('Remove', function (json) {
14661 return new AV.Op.Remove(AV._decode(json.objects));
14662 });
14663 /**
14664 * @private
14665 * @class
14666 * A Relation operation indicates that the field is an instance of
14667 * AV.Relation, and objects are being added to, or removed from, that
14668 * relation.
14669 */
14670
14671
14672 AV.Op.Relation = AV.Op._extend(
14673 /** @lends AV.Op.Relation.prototype */
14674 {
14675 _initialize: function _initialize(adds, removes) {
14676 this._targetClassName = null;
14677 var self = this;
14678
14679 var pointerToId = function pointerToId(object) {
14680 if (object instanceof AV.Object) {
14681 if (!object.id) {
14682 throw new Error("You can't add an unsaved AV.Object to a relation.");
14683 }
14684
14685 if (!self._targetClassName) {
14686 self._targetClassName = object.className;
14687 }
14688
14689 if (self._targetClassName !== object.className) {
14690 throw new Error('Tried to create a AV.Relation with 2 different types: ' + self._targetClassName + ' and ' + object.className + '.');
14691 }
14692
14693 return object.id;
14694 }
14695
14696 return object;
14697 };
14698
14699 this.relationsToAdd = _.uniq((0, _map.default)(_).call(_, adds, pointerToId));
14700 this.relationsToRemove = _.uniq((0, _map.default)(_).call(_, removes, pointerToId));
14701 },
14702
14703 /**
14704 * Returns an array of unfetched AV.Object that are being added to the
14705 * relation.
14706 * @return {Array}
14707 */
14708 added: function added() {
14709 var self = this;
14710 return (0, _map.default)(_).call(_, this.relationsToAdd, function (objectId) {
14711 var object = AV.Object._create(self._targetClassName);
14712
14713 object.id = objectId;
14714 return object;
14715 });
14716 },
14717
14718 /**
14719 * Returns an array of unfetched AV.Object that are being removed from
14720 * the relation.
14721 * @return {Array}
14722 */
14723 removed: function removed() {
14724 var self = this;
14725 return (0, _map.default)(_).call(_, this.relationsToRemove, function (objectId) {
14726 var object = AV.Object._create(self._targetClassName);
14727
14728 object.id = objectId;
14729 return object;
14730 });
14731 },
14732
14733 /**
14734 * Returns a JSON version of the operation suitable for sending to AV.
14735 * @return {Object}
14736 */
14737 toJSON: function toJSON() {
14738 var adds = null;
14739 var removes = null;
14740 var self = this;
14741
14742 var idToPointer = function idToPointer(id) {
14743 return {
14744 __type: 'Pointer',
14745 className: self._targetClassName,
14746 objectId: id
14747 };
14748 };
14749
14750 var pointers = null;
14751
14752 if (this.relationsToAdd.length > 0) {
14753 pointers = (0, _map.default)(_).call(_, this.relationsToAdd, idToPointer);
14754 adds = {
14755 __op: 'AddRelation',
14756 objects: pointers
14757 };
14758 }
14759
14760 if (this.relationsToRemove.length > 0) {
14761 pointers = (0, _map.default)(_).call(_, this.relationsToRemove, idToPointer);
14762 removes = {
14763 __op: 'RemoveRelation',
14764 objects: pointers
14765 };
14766 }
14767
14768 if (adds && removes) {
14769 return {
14770 __op: 'Batch',
14771 ops: [adds, removes]
14772 };
14773 }
14774
14775 return adds || removes || {};
14776 },
14777 _mergeWithPrevious: function _mergeWithPrevious(previous) {
14778 if (!previous) {
14779 return this;
14780 } else if (previous instanceof AV.Op.Unset) {
14781 throw new Error("You can't modify a relation after deleting it.");
14782 } else if (previous instanceof AV.Op.Relation) {
14783 if (previous._targetClassName && previous._targetClassName !== this._targetClassName) {
14784 throw new Error('Related object must be of class ' + previous._targetClassName + ', but ' + this._targetClassName + ' was passed in.');
14785 }
14786
14787 var newAdd = _.union(_.difference(previous.relationsToAdd, this.relationsToRemove), this.relationsToAdd);
14788
14789 var newRemove = _.union(_.difference(previous.relationsToRemove, this.relationsToAdd), this.relationsToRemove);
14790
14791 var newRelation = new AV.Op.Relation(newAdd, newRemove);
14792 newRelation._targetClassName = this._targetClassName;
14793 return newRelation;
14794 } else {
14795 throw new Error('Op is invalid after previous op.');
14796 }
14797 },
14798 _estimate: function _estimate(oldValue, object, key) {
14799 if (!oldValue) {
14800 var relation = new AV.Relation(object, key);
14801 relation.targetClassName = this._targetClassName;
14802 } else if (oldValue instanceof AV.Relation) {
14803 if (this._targetClassName) {
14804 if (oldValue.targetClassName) {
14805 if (oldValue.targetClassName !== this._targetClassName) {
14806 throw new Error('Related object must be a ' + oldValue.targetClassName + ', but a ' + this._targetClassName + ' was passed in.');
14807 }
14808 } else {
14809 oldValue.targetClassName = this._targetClassName;
14810 }
14811 }
14812
14813 return oldValue;
14814 } else {
14815 throw new Error('Op is invalid after previous op.');
14816 }
14817 }
14818 });
14819
14820 AV.Op._registerDecoder('AddRelation', function (json) {
14821 return new AV.Op.Relation(AV._decode(json.objects), []);
14822 });
14823
14824 AV.Op._registerDecoder('RemoveRelation', function (json) {
14825 return new AV.Op.Relation([], AV._decode(json.objects));
14826 });
14827};
14828
14829/***/ }),
14830/* 447 */
14831/***/ (function(module, exports, __webpack_require__) {
14832
14833var parent = __webpack_require__(448);
14834
14835module.exports = parent;
14836
14837
14838/***/ }),
14839/* 448 */
14840/***/ (function(module, exports, __webpack_require__) {
14841
14842var isPrototypeOf = __webpack_require__(21);
14843var method = __webpack_require__(449);
14844
14845var ArrayPrototype = Array.prototype;
14846
14847module.exports = function (it) {
14848 var own = it.find;
14849 return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.find) ? method : own;
14850};
14851
14852
14853/***/ }),
14854/* 449 */
14855/***/ (function(module, exports, __webpack_require__) {
14856
14857__webpack_require__(450);
14858var entryVirtual = __webpack_require__(41);
14859
14860module.exports = entryVirtual('Array').find;
14861
14862
14863/***/ }),
14864/* 450 */
14865/***/ (function(module, exports, __webpack_require__) {
14866
14867"use strict";
14868
14869var $ = __webpack_require__(0);
14870var $find = __webpack_require__(66).find;
14871var addToUnscopables = __webpack_require__(159);
14872
14873var FIND = 'find';
14874var SKIPS_HOLES = true;
14875
14876// Shouldn't skip holes
14877if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES = false; });
14878
14879// `Array.prototype.find` method
14880// https://tc39.es/ecma262/#sec-array.prototype.find
14881$({ target: 'Array', proto: true, forced: SKIPS_HOLES }, {
14882 find: function find(callbackfn /* , that = undefined */) {
14883 return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
14884 }
14885});
14886
14887// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
14888addToUnscopables(FIND);
14889
14890
14891/***/ }),
14892/* 451 */
14893/***/ (function(module, exports, __webpack_require__) {
14894
14895"use strict";
14896
14897
14898var _ = __webpack_require__(2);
14899
14900module.exports = function (AV) {
14901 /**
14902 * Creates a new Relation for the given parent object and key. This
14903 * constructor should rarely be used directly, but rather created by
14904 * {@link AV.Object#relation}.
14905 * @param {AV.Object} parent The parent of this relation.
14906 * @param {String} key The key for this relation on the parent.
14907 * @see AV.Object#relation
14908 * @class
14909 *
14910 * <p>
14911 * A class that is used to access all of the children of a many-to-many
14912 * relationship. Each instance of AV.Relation is associated with a
14913 * particular parent object and key.
14914 * </p>
14915 */
14916 AV.Relation = function (parent, key) {
14917 if (!_.isString(key)) {
14918 throw new TypeError('key must be a string');
14919 }
14920
14921 this.parent = parent;
14922 this.key = key;
14923 this.targetClassName = null;
14924 };
14925 /**
14926 * Creates a query that can be used to query the parent objects in this relation.
14927 * @param {String} parentClass The parent class or name.
14928 * @param {String} relationKey The relation field key in parent.
14929 * @param {AV.Object} child The child object.
14930 * @return {AV.Query}
14931 */
14932
14933
14934 AV.Relation.reverseQuery = function (parentClass, relationKey, child) {
14935 var query = new AV.Query(parentClass);
14936 query.equalTo(relationKey, child._toPointer());
14937 return query;
14938 };
14939
14940 _.extend(AV.Relation.prototype,
14941 /** @lends AV.Relation.prototype */
14942 {
14943 /**
14944 * Makes sure that this relation has the right parent and key.
14945 * @private
14946 */
14947 _ensureParentAndKey: function _ensureParentAndKey(parent, key) {
14948 this.parent = this.parent || parent;
14949 this.key = this.key || key;
14950
14951 if (this.parent !== parent) {
14952 throw new Error('Internal Error. Relation retrieved from two different Objects.');
14953 }
14954
14955 if (this.key !== key) {
14956 throw new Error('Internal Error. Relation retrieved from two different keys.');
14957 }
14958 },
14959
14960 /**
14961 * Adds a AV.Object or an array of AV.Objects to the relation.
14962 * @param {AV.Object|AV.Object[]} objects The item or items to add.
14963 */
14964 add: function add(objects) {
14965 if (!_.isArray(objects)) {
14966 objects = [objects];
14967 }
14968
14969 var change = new AV.Op.Relation(objects, []);
14970 this.parent.set(this.key, change);
14971 this.targetClassName = change._targetClassName;
14972 },
14973
14974 /**
14975 * Removes a AV.Object or an array of AV.Objects from this relation.
14976 * @param {AV.Object|AV.Object[]} objects The item or items to remove.
14977 */
14978 remove: function remove(objects) {
14979 if (!_.isArray(objects)) {
14980 objects = [objects];
14981 }
14982
14983 var change = new AV.Op.Relation([], objects);
14984 this.parent.set(this.key, change);
14985 this.targetClassName = change._targetClassName;
14986 },
14987
14988 /**
14989 * Returns a JSON version of the object suitable for saving to disk.
14990 * @return {Object}
14991 */
14992 toJSON: function toJSON() {
14993 return {
14994 __type: 'Relation',
14995 className: this.targetClassName
14996 };
14997 },
14998
14999 /**
15000 * Returns a AV.Query that is limited to objects in this
15001 * relation.
15002 * @return {AV.Query}
15003 */
15004 query: function query() {
15005 var targetClass;
15006 var query;
15007
15008 if (!this.targetClassName) {
15009 targetClass = AV.Object._getSubclass(this.parent.className);
15010 query = new AV.Query(targetClass);
15011 query._defaultParams.redirectClassNameForKey = this.key;
15012 } else {
15013 targetClass = AV.Object._getSubclass(this.targetClassName);
15014 query = new AV.Query(targetClass);
15015 }
15016
15017 query._addCondition('$relatedTo', 'object', this.parent._toPointer());
15018
15019 query._addCondition('$relatedTo', 'key', this.key);
15020
15021 return query;
15022 }
15023 });
15024};
15025
15026/***/ }),
15027/* 452 */
15028/***/ (function(module, exports, __webpack_require__) {
15029
15030"use strict";
15031
15032
15033var _interopRequireDefault = __webpack_require__(1);
15034
15035var _promise = _interopRequireDefault(__webpack_require__(12));
15036
15037var _ = __webpack_require__(2);
15038
15039var cos = __webpack_require__(453);
15040
15041var qiniu = __webpack_require__(454);
15042
15043var s3 = __webpack_require__(501);
15044
15045var AVError = __webpack_require__(43);
15046
15047var _require = __webpack_require__(26),
15048 request = _require.request,
15049 AVRequest = _require._request;
15050
15051var _require2 = __webpack_require__(29),
15052 tap = _require2.tap,
15053 transformFetchOptions = _require2.transformFetchOptions;
15054
15055var debug = __webpack_require__(67)('leancloud:file');
15056
15057var parseBase64 = __webpack_require__(505);
15058
15059module.exports = function (AV) {
15060 // port from browserify path module
15061 // since react-native packager won't shim node modules.
15062 var extname = function extname(path) {
15063 if (!_.isString(path)) return '';
15064 return path.match(/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/)[4];
15065 };
15066
15067 var b64Digit = function b64Digit(number) {
15068 if (number < 26) {
15069 return String.fromCharCode(65 + number);
15070 }
15071
15072 if (number < 52) {
15073 return String.fromCharCode(97 + (number - 26));
15074 }
15075
15076 if (number < 62) {
15077 return String.fromCharCode(48 + (number - 52));
15078 }
15079
15080 if (number === 62) {
15081 return '+';
15082 }
15083
15084 if (number === 63) {
15085 return '/';
15086 }
15087
15088 throw new Error('Tried to encode large digit ' + number + ' in base64.');
15089 };
15090
15091 var encodeBase64 = function encodeBase64(array) {
15092 var chunks = [];
15093 chunks.length = Math.ceil(array.length / 3);
15094
15095 _.times(chunks.length, function (i) {
15096 var b1 = array[i * 3];
15097 var b2 = array[i * 3 + 1] || 0;
15098 var b3 = array[i * 3 + 2] || 0;
15099 var has2 = i * 3 + 1 < array.length;
15100 var has3 = i * 3 + 2 < array.length;
15101 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('');
15102 });
15103
15104 return chunks.join('');
15105 };
15106 /**
15107 * An AV.File is a local representation of a file that is saved to the AV
15108 * cloud.
15109 * @param name {String} The file's name. This will change to a unique value
15110 * once the file has finished saving.
15111 * @param data {Array} The data for the file, as either:
15112 * 1. an Array of byte value Numbers, or
15113 * 2. an Object like { base64: "..." } with a base64-encoded String.
15114 * 3. a Blob(File) selected with a file upload control in a browser.
15115 * 4. an Object like { blob: {uri: "..."} } that mimics Blob
15116 * in some non-browser environments such as React Native.
15117 * 5. a Buffer in Node.js runtime.
15118 * 6. a Stream in Node.js runtime.
15119 *
15120 * For example:<pre>
15121 * var fileUploadControl = $("#profilePhotoFileUpload")[0];
15122 * if (fileUploadControl.files.length > 0) {
15123 * var file = fileUploadControl.files[0];
15124 * var name = "photo.jpg";
15125 * var file = new AV.File(name, file);
15126 * file.save().then(function() {
15127 * // The file has been saved to AV.
15128 * }, function(error) {
15129 * // The file either could not be read, or could not be saved to AV.
15130 * });
15131 * }</pre>
15132 *
15133 * @class
15134 * @param [mimeType] {String} Content-Type header to use for the file. If
15135 * this is omitted, the content type will be inferred from the name's
15136 * extension.
15137 */
15138
15139
15140 AV.File = function (name, data, mimeType) {
15141 this.attributes = {
15142 name: name,
15143 url: '',
15144 metaData: {},
15145 // 用来存储转换后要上传的 base64 String
15146 base64: ''
15147 };
15148
15149 if (_.isString(data)) {
15150 throw new TypeError('Creating an AV.File from a String is not yet supported.');
15151 }
15152
15153 if (_.isArray(data)) {
15154 this.attributes.metaData.size = data.length;
15155 data = {
15156 base64: encodeBase64(data)
15157 };
15158 }
15159
15160 this._extName = '';
15161 this._data = data;
15162 this._uploadHeaders = {};
15163
15164 if (data && data.blob && typeof data.blob.uri === 'string') {
15165 this._extName = extname(data.blob.uri);
15166 }
15167
15168 if (typeof Blob !== 'undefined' && data instanceof Blob) {
15169 if (data.size) {
15170 this.attributes.metaData.size = data.size;
15171 }
15172
15173 if (data.name) {
15174 this._extName = extname(data.name);
15175 }
15176 }
15177
15178 var owner;
15179
15180 if (data && data.owner) {
15181 owner = data.owner;
15182 } else if (!AV._config.disableCurrentUser) {
15183 try {
15184 owner = AV.User.current();
15185 } catch (error) {
15186 if ('SYNC_API_NOT_AVAILABLE' !== error.code) {
15187 throw error;
15188 }
15189 }
15190 }
15191
15192 this.attributes.metaData.owner = owner ? owner.id : 'unknown';
15193 this.set('mime_type', mimeType);
15194 };
15195 /**
15196 * Creates a fresh AV.File object with exists url for saving to AVOS Cloud.
15197 * @param {String} name the file name
15198 * @param {String} url the file url.
15199 * @param {Object} [metaData] the file metadata object.
15200 * @param {String} [type] Content-Type header to use for the file. If
15201 * this is omitted, the content type will be inferred from the name's
15202 * extension.
15203 * @return {AV.File} the file object
15204 */
15205
15206
15207 AV.File.withURL = function (name, url, metaData, type) {
15208 if (!name || !url) {
15209 throw new Error('Please provide file name and url');
15210 }
15211
15212 var file = new AV.File(name, null, type); //copy metaData properties to file.
15213
15214 if (metaData) {
15215 for (var prop in metaData) {
15216 if (!file.attributes.metaData[prop]) file.attributes.metaData[prop] = metaData[prop];
15217 }
15218 }
15219
15220 file.attributes.url = url; //Mark the file is from external source.
15221
15222 file.attributes.metaData.__source = 'external';
15223 file.attributes.metaData.size = 0;
15224 return file;
15225 };
15226 /**
15227 * Creates a file object with exists objectId.
15228 * @param {String} objectId The objectId string
15229 * @return {AV.File} the file object
15230 */
15231
15232
15233 AV.File.createWithoutData = function (objectId) {
15234 if (!objectId) {
15235 throw new TypeError('The objectId must be provided');
15236 }
15237
15238 var file = new AV.File();
15239 file.id = objectId;
15240 return file;
15241 };
15242 /**
15243 * Request file censor.
15244 * @since 4.13.0
15245 * @param {String} objectId
15246 * @return {Promise.<string>}
15247 */
15248
15249
15250 AV.File.censor = function (objectId) {
15251 if (!AV._config.masterKey) {
15252 throw new Error('Cannot censor a file without masterKey');
15253 }
15254
15255 return request({
15256 method: 'POST',
15257 path: "/files/".concat(objectId, "/censor"),
15258 authOptions: {
15259 useMasterKey: true
15260 }
15261 }).then(function (res) {
15262 return res.censorResult;
15263 });
15264 };
15265
15266 _.extend(AV.File.prototype,
15267 /** @lends AV.File.prototype */
15268 {
15269 className: '_File',
15270 _toFullJSON: function _toFullJSON(seenObjects) {
15271 var _this = this;
15272
15273 var full = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
15274
15275 var json = _.clone(this.attributes);
15276
15277 AV._objectEach(json, function (val, key) {
15278 json[key] = AV._encode(val, seenObjects, undefined, full);
15279 });
15280
15281 AV._objectEach(this._operations, function (val, key) {
15282 json[key] = val;
15283 });
15284
15285 if (_.has(this, 'id')) {
15286 json.objectId = this.id;
15287 }
15288
15289 ['createdAt', 'updatedAt'].forEach(function (key) {
15290 if (_.has(_this, key)) {
15291 var val = _this[key];
15292 json[key] = _.isDate(val) ? val.toJSON() : val;
15293 }
15294 });
15295
15296 if (full) {
15297 json.__type = 'File';
15298 }
15299
15300 return json;
15301 },
15302
15303 /**
15304 * Returns a JSON version of the file with meta data.
15305 * Inverse to {@link AV.parseJSON}
15306 * @since 3.0.0
15307 * @return {Object}
15308 */
15309 toFullJSON: function toFullJSON() {
15310 var seenObjects = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
15311 return this._toFullJSON(seenObjects);
15312 },
15313
15314 /**
15315 * Returns a JSON version of the object.
15316 * @return {Object}
15317 */
15318 toJSON: function toJSON(key, holder) {
15319 var seenObjects = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [this];
15320 return this._toFullJSON(seenObjects, false);
15321 },
15322
15323 /**
15324 * Gets a Pointer referencing this file.
15325 * @private
15326 */
15327 _toPointer: function _toPointer() {
15328 return {
15329 __type: 'Pointer',
15330 className: this.className,
15331 objectId: this.id
15332 };
15333 },
15334
15335 /**
15336 * Returns the ACL for this file.
15337 * @returns {AV.ACL} An instance of AV.ACL.
15338 */
15339 getACL: function getACL() {
15340 return this._acl;
15341 },
15342
15343 /**
15344 * Sets the ACL to be used for this file.
15345 * @param {AV.ACL} acl An instance of AV.ACL.
15346 */
15347 setACL: function setACL(acl) {
15348 if (!(acl instanceof AV.ACL)) {
15349 return new AVError(AVError.OTHER_CAUSE, 'ACL must be a AV.ACL.');
15350 }
15351
15352 this._acl = acl;
15353 return this;
15354 },
15355
15356 /**
15357 * Gets the name of the file. Before save is called, this is the filename
15358 * given by the user. After save is called, that name gets prefixed with a
15359 * unique identifier.
15360 */
15361 name: function name() {
15362 return this.get('name');
15363 },
15364
15365 /**
15366 * Gets the url of the file. It is only available after you save the file or
15367 * after you get the file from a AV.Object.
15368 * @return {String}
15369 */
15370 url: function url() {
15371 return this.get('url');
15372 },
15373
15374 /**
15375 * Gets the attributs of the file object.
15376 * @param {String} The attribute name which want to get.
15377 * @returns {Any}
15378 */
15379 get: function get(attrName) {
15380 switch (attrName) {
15381 case 'objectId':
15382 return this.id;
15383
15384 case 'url':
15385 case 'name':
15386 case 'mime_type':
15387 case 'metaData':
15388 case 'createdAt':
15389 case 'updatedAt':
15390 return this.attributes[attrName];
15391
15392 default:
15393 return this.attributes.metaData[attrName];
15394 }
15395 },
15396
15397 /**
15398 * Set the metaData of the file object.
15399 * @param {Object} Object is an key value Object for setting metaData.
15400 * @param {String} attr is an optional metadata key.
15401 * @param {Object} value is an optional metadata value.
15402 * @returns {String|Number|Array|Object}
15403 */
15404 set: function set() {
15405 var _this2 = this;
15406
15407 var set = function set(attrName, value) {
15408 switch (attrName) {
15409 case 'name':
15410 case 'url':
15411 case 'mime_type':
15412 case 'base64':
15413 case 'metaData':
15414 _this2.attributes[attrName] = value;
15415 break;
15416
15417 default:
15418 // File 并非一个 AVObject,不能完全自定义其他属性,所以只能都放在 metaData 上面
15419 _this2.attributes.metaData[attrName] = value;
15420 break;
15421 }
15422 };
15423
15424 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
15425 args[_key] = arguments[_key];
15426 }
15427
15428 switch (args.length) {
15429 case 1:
15430 // 传入一个 Object
15431 for (var k in args[0]) {
15432 set(k, args[0][k]);
15433 }
15434
15435 break;
15436
15437 case 2:
15438 set(args[0], args[1]);
15439 break;
15440 }
15441
15442 return this;
15443 },
15444
15445 /**
15446 * Set a header for the upload request.
15447 * For more infomation, go to https://url.leanapp.cn/avfile-upload-headers
15448 *
15449 * @param {String} key header key
15450 * @param {String} value header value
15451 * @return {AV.File} this
15452 */
15453 setUploadHeader: function setUploadHeader(key, value) {
15454 this._uploadHeaders[key] = value;
15455 return this;
15456 },
15457
15458 /**
15459 * <p>Returns the file's metadata JSON object if no arguments is given.Returns the
15460 * metadata value if a key is given.Set metadata value if key and value are both given.</p>
15461 * <p><pre>
15462 * var metadata = file.metaData(); //Get metadata JSON object.
15463 * var size = file.metaData('size'); // Get the size metadata value.
15464 * file.metaData('format', 'jpeg'); //set metadata attribute and value.
15465 *</pre></p>
15466 * @return {Object} The file's metadata JSON object.
15467 * @param {String} attr an optional metadata key.
15468 * @param {Object} value an optional metadata value.
15469 **/
15470 metaData: function metaData(attr, value) {
15471 if (attr && value) {
15472 this.attributes.metaData[attr] = value;
15473 return this;
15474 } else if (attr && !value) {
15475 return this.attributes.metaData[attr];
15476 } else {
15477 return this.attributes.metaData;
15478 }
15479 },
15480
15481 /**
15482 * 如果文件是图片,获取图片的缩略图URL。可以传入宽度、高度、质量、格式等参数。
15483 * @return {String} 缩略图URL
15484 * @param {Number} width 宽度,单位:像素
15485 * @param {Number} heigth 高度,单位:像素
15486 * @param {Number} quality 质量,1-100的数字,默认100
15487 * @param {Number} scaleToFit 是否将图片自适应大小。默认为true。
15488 * @param {String} fmt 格式,默认为png,也可以为jpeg,gif等格式。
15489 */
15490 thumbnailURL: function thumbnailURL(width, height) {
15491 var quality = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 100;
15492 var scaleToFit = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
15493 var fmt = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 'png';
15494 var url = this.attributes.url;
15495
15496 if (!url) {
15497 throw new Error('Invalid url.');
15498 }
15499
15500 if (!width || !height || width <= 0 || height <= 0) {
15501 throw new Error('Invalid width or height value.');
15502 }
15503
15504 if (quality <= 0 || quality > 100) {
15505 throw new Error('Invalid quality value.');
15506 }
15507
15508 var mode = scaleToFit ? 2 : 1;
15509 return url + '?imageView/' + mode + '/w/' + width + '/h/' + height + '/q/' + quality + '/format/' + fmt;
15510 },
15511
15512 /**
15513 * Returns the file's size.
15514 * @return {Number} The file's size in bytes.
15515 **/
15516 size: function size() {
15517 return this.metaData().size;
15518 },
15519
15520 /**
15521 * Returns the file's owner.
15522 * @return {String} The file's owner id.
15523 */
15524 ownerId: function ownerId() {
15525 return this.metaData().owner;
15526 },
15527
15528 /**
15529 * Destroy the file.
15530 * @param {AuthOptions} options
15531 * @return {Promise} A promise that is fulfilled when the destroy
15532 * completes.
15533 */
15534 destroy: function destroy(options) {
15535 if (!this.id) {
15536 return _promise.default.reject(new Error('The file id does not eixst.'));
15537 }
15538
15539 var request = AVRequest('files', null, this.id, 'DELETE', null, options);
15540 return request;
15541 },
15542
15543 /**
15544 * Request Qiniu upload token
15545 * @param {string} type
15546 * @return {Promise} Resolved with the response
15547 * @private
15548 */
15549 _fileToken: function _fileToken(type, authOptions) {
15550 var name = this.attributes.name;
15551 var extName = extname(name);
15552
15553 if (!extName && this._extName) {
15554 name += this._extName;
15555 extName = this._extName;
15556 }
15557
15558 var data = {
15559 name: name,
15560 keep_file_name: authOptions.keepFileName,
15561 key: authOptions.key,
15562 ACL: this._acl,
15563 mime_type: type,
15564 metaData: this.attributes.metaData
15565 };
15566 return AVRequest('fileTokens', null, null, 'POST', data, authOptions);
15567 },
15568
15569 /**
15570 * @callback UploadProgressCallback
15571 * @param {XMLHttpRequestProgressEvent} event - The progress event with 'loaded' and 'total' attributes
15572 */
15573
15574 /**
15575 * Saves the file to the AV cloud.
15576 * @param {AuthOptions} [options] AuthOptions plus:
15577 * @param {UploadProgressCallback} [options.onprogress] 文件上传进度,在 Node.js 中无效,回调参数说明详见 {@link UploadProgressCallback}。
15578 * @param {boolean} [options.keepFileName = false] 保留下载文件的文件名。
15579 * @param {string} [options.key] 指定文件的 key。设置该选项需要使用 masterKey
15580 * @return {Promise} Promise that is resolved when the save finishes.
15581 */
15582 save: function save() {
15583 var _this3 = this;
15584
15585 var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
15586
15587 if (this.id) {
15588 throw new Error('File is already saved.');
15589 }
15590
15591 if (!this._previousSave) {
15592 if (this._data) {
15593 var mimeType = this.get('mime_type');
15594 this._previousSave = this._fileToken(mimeType, options).then(function (uploadInfo) {
15595 if (uploadInfo.mime_type) {
15596 mimeType = uploadInfo.mime_type;
15597
15598 _this3.set('mime_type', mimeType);
15599 }
15600
15601 _this3._token = uploadInfo.token;
15602 return _promise.default.resolve().then(function () {
15603 var data = _this3._data;
15604
15605 if (data && data.base64) {
15606 return parseBase64(data.base64, mimeType);
15607 }
15608
15609 if (data && data.blob) {
15610 if (!data.blob.type && mimeType) {
15611 data.blob.type = mimeType;
15612 }
15613
15614 if (!data.blob.name) {
15615 data.blob.name = _this3.get('name');
15616 }
15617
15618 return data.blob;
15619 }
15620
15621 if (typeof Blob !== 'undefined' && data instanceof Blob) {
15622 return data;
15623 }
15624
15625 throw new TypeError('malformed file data');
15626 }).then(function (data) {
15627 var _options = _.extend({}, options); // filter out download progress events
15628
15629
15630 if (options.onprogress) {
15631 _options.onprogress = function (event) {
15632 if (event.direction === 'download') return;
15633 return options.onprogress(event);
15634 };
15635 }
15636
15637 switch (uploadInfo.provider) {
15638 case 's3':
15639 return s3(uploadInfo, data, _this3, _options);
15640
15641 case 'qcloud':
15642 return cos(uploadInfo, data, _this3, _options);
15643
15644 case 'qiniu':
15645 default:
15646 return qiniu(uploadInfo, data, _this3, _options);
15647 }
15648 }).then(tap(function () {
15649 return _this3._callback(true);
15650 }), function (error) {
15651 _this3._callback(false);
15652
15653 throw error;
15654 });
15655 });
15656 } else if (this.attributes.url && this.attributes.metaData.__source === 'external') {
15657 // external link file.
15658 var data = {
15659 name: this.attributes.name,
15660 ACL: this._acl,
15661 metaData: this.attributes.metaData,
15662 mime_type: this.mimeType,
15663 url: this.attributes.url
15664 };
15665 this._previousSave = AVRequest('files', null, null, 'post', data, options).then(function (response) {
15666 _this3.id = response.objectId;
15667 return _this3;
15668 });
15669 }
15670 }
15671
15672 return this._previousSave;
15673 },
15674 _callback: function _callback(success) {
15675 AVRequest('fileCallback', null, null, 'post', {
15676 token: this._token,
15677 result: success
15678 }).catch(debug);
15679 delete this._token;
15680 delete this._data;
15681 },
15682
15683 /**
15684 * fetch the file from server. If the server's representation of the
15685 * model differs from its current attributes, they will be overriden,
15686 * @param {Object} fetchOptions Optional options to set 'keys',
15687 * 'include' and 'includeACL' option.
15688 * @param {AuthOptions} options
15689 * @return {Promise} A promise that is fulfilled when the fetch
15690 * completes.
15691 */
15692 fetch: function fetch(fetchOptions, options) {
15693 if (!this.id) {
15694 throw new Error('Cannot fetch unsaved file');
15695 }
15696
15697 var request = AVRequest('files', null, this.id, 'GET', transformFetchOptions(fetchOptions), options);
15698 return request.then(this._finishFetch.bind(this));
15699 },
15700 _finishFetch: function _finishFetch(response) {
15701 var value = AV.Object.prototype.parse(response);
15702 value.attributes = {
15703 name: value.name,
15704 url: value.url,
15705 mime_type: value.mime_type,
15706 bucket: value.bucket
15707 };
15708 value.attributes.metaData = value.metaData || {};
15709 value.id = value.objectId; // clean
15710
15711 delete value.objectId;
15712 delete value.metaData;
15713 delete value.url;
15714 delete value.name;
15715 delete value.mime_type;
15716 delete value.bucket;
15717
15718 _.extend(this, value);
15719
15720 return this;
15721 },
15722
15723 /**
15724 * Request file censor
15725 * @since 4.13.0
15726 * @return {Promise.<string>}
15727 */
15728 censor: function censor() {
15729 if (!this.id) {
15730 throw new Error('Cannot censor an unsaved file');
15731 }
15732
15733 return AV.File.censor(this.id);
15734 }
15735 });
15736};
15737
15738/***/ }),
15739/* 453 */
15740/***/ (function(module, exports, __webpack_require__) {
15741
15742"use strict";
15743
15744
15745var _require = __webpack_require__(68),
15746 getAdapter = _require.getAdapter;
15747
15748var debug = __webpack_require__(67)('cos');
15749
15750module.exports = function (uploadInfo, data, file) {
15751 var saveOptions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
15752 var url = uploadInfo.upload_url + '?sign=' + encodeURIComponent(uploadInfo.token);
15753 var fileFormData = {
15754 field: 'fileContent',
15755 data: data,
15756 name: file.attributes.name
15757 };
15758 var options = {
15759 headers: file._uploadHeaders,
15760 data: {
15761 op: 'upload'
15762 },
15763 onprogress: saveOptions.onprogress
15764 };
15765 debug('url: %s, file: %o, options: %o', url, fileFormData, options);
15766 var upload = getAdapter('upload');
15767 return upload(url, fileFormData, options).then(function (response) {
15768 debug(response.status, response.data);
15769
15770 if (response.ok === false) {
15771 var error = new Error(response.status);
15772 error.response = response;
15773 throw error;
15774 }
15775
15776 file.attributes.url = uploadInfo.url;
15777 file._bucket = uploadInfo.bucket;
15778 file.id = uploadInfo.objectId;
15779 return file;
15780 }, function (error) {
15781 var response = error.response;
15782
15783 if (response) {
15784 debug(response.status, response.data);
15785 error.statusCode = response.status;
15786 error.response = response.data;
15787 }
15788
15789 throw error;
15790 });
15791};
15792
15793/***/ }),
15794/* 454 */
15795/***/ (function(module, exports, __webpack_require__) {
15796
15797"use strict";
15798
15799
15800var _sliceInstanceProperty2 = __webpack_require__(87);
15801
15802var _Array$from = __webpack_require__(455);
15803
15804var _Symbol = __webpack_require__(240);
15805
15806var _getIteratorMethod = __webpack_require__(241);
15807
15808var _Reflect$construct = __webpack_require__(465);
15809
15810var _interopRequireDefault = __webpack_require__(1);
15811
15812var _inherits2 = _interopRequireDefault(__webpack_require__(469));
15813
15814var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(491));
15815
15816var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(493));
15817
15818var _classCallCheck2 = _interopRequireDefault(__webpack_require__(498));
15819
15820var _createClass2 = _interopRequireDefault(__webpack_require__(499));
15821
15822var _stringify = _interopRequireDefault(__webpack_require__(36));
15823
15824var _concat = _interopRequireDefault(__webpack_require__(30));
15825
15826var _promise = _interopRequireDefault(__webpack_require__(12));
15827
15828var _slice = _interopRequireDefault(__webpack_require__(87));
15829
15830function _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); }; }
15831
15832function _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; } }
15833
15834function _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; } } }; }
15835
15836function _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); }
15837
15838function _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; }
15839
15840var _require = __webpack_require__(68),
15841 getAdapter = _require.getAdapter;
15842
15843var debug = __webpack_require__(67)('leancloud:qiniu');
15844
15845var ajax = __webpack_require__(108);
15846
15847var btoa = __webpack_require__(500);
15848
15849var SHARD_THRESHOLD = 1024 * 1024 * 64;
15850var CHUNK_SIZE = 1024 * 1024 * 16;
15851
15852function upload(uploadInfo, data, file) {
15853 var saveOptions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
15854 // Get the uptoken to upload files to qiniu.
15855 var uptoken = uploadInfo.token;
15856 var url = uploadInfo.upload_url || 'https://upload.qiniup.com';
15857 var fileFormData = {
15858 field: 'file',
15859 data: data,
15860 name: file.attributes.name
15861 };
15862 var options = {
15863 headers: file._uploadHeaders,
15864 data: {
15865 name: file.attributes.name,
15866 key: uploadInfo.key,
15867 token: uptoken
15868 },
15869 onprogress: saveOptions.onprogress
15870 };
15871 debug('url: %s, file: %o, options: %o', url, fileFormData, options);
15872 var upload = getAdapter('upload');
15873 return upload(url, fileFormData, options).then(function (response) {
15874 debug(response.status, response.data);
15875
15876 if (response.ok === false) {
15877 var message = response.status;
15878
15879 if (response.data) {
15880 if (response.data.error) {
15881 message = response.data.error;
15882 } else {
15883 message = (0, _stringify.default)(response.data);
15884 }
15885 }
15886
15887 var error = new Error(message);
15888 error.response = response;
15889 throw error;
15890 }
15891
15892 file.attributes.url = uploadInfo.url;
15893 file._bucket = uploadInfo.bucket;
15894 file.id = uploadInfo.objectId;
15895 return file;
15896 }, function (error) {
15897 var response = error.response;
15898
15899 if (response) {
15900 debug(response.status, response.data);
15901 error.statusCode = response.status;
15902 error.response = response.data;
15903 }
15904
15905 throw error;
15906 });
15907}
15908
15909function urlSafeBase64(string) {
15910 var base64 = btoa(unescape(encodeURIComponent(string)));
15911 var result = '';
15912
15913 var _iterator = _createForOfIteratorHelper(base64),
15914 _step;
15915
15916 try {
15917 for (_iterator.s(); !(_step = _iterator.n()).done;) {
15918 var ch = _step.value;
15919
15920 switch (ch) {
15921 case '+':
15922 result += '-';
15923 break;
15924
15925 case '/':
15926 result += '_';
15927 break;
15928
15929 default:
15930 result += ch;
15931 }
15932 }
15933 } catch (err) {
15934 _iterator.e(err);
15935 } finally {
15936 _iterator.f();
15937 }
15938
15939 return result;
15940}
15941
15942var ShardUploader = /*#__PURE__*/function () {
15943 function ShardUploader(uploadInfo, data, file, saveOptions) {
15944 var _context,
15945 _context2,
15946 _this = this;
15947
15948 (0, _classCallCheck2.default)(this, ShardUploader);
15949 this.uploadInfo = uploadInfo;
15950 this.data = data;
15951 this.file = file;
15952 this.size = undefined;
15953 this.offset = 0;
15954 this.uploadedChunks = 0;
15955 var key = urlSafeBase64(uploadInfo.key);
15956 var uploadURL = uploadInfo.upload_url || 'https://upload.qiniup.com';
15957 this.baseURL = (0, _concat.default)(_context = (0, _concat.default)(_context2 = "".concat(uploadURL, "/buckets/")).call(_context2, uploadInfo.bucket, "/objects/")).call(_context, key, "/uploads");
15958 this.upToken = 'UpToken ' + uploadInfo.token;
15959 this.uploaded = 0;
15960
15961 if (saveOptions && saveOptions.onprogress) {
15962 this.onProgress = function (_ref) {
15963 var loaded = _ref.loaded;
15964 loaded += _this.uploadedChunks * CHUNK_SIZE;
15965
15966 if (loaded <= _this.uploaded) {
15967 return;
15968 }
15969
15970 if (_this.size) {
15971 saveOptions.onprogress({
15972 loaded: loaded,
15973 total: _this.size,
15974 percent: loaded / _this.size * 100
15975 });
15976 } else {
15977 saveOptions.onprogress({
15978 loaded: loaded
15979 });
15980 }
15981
15982 _this.uploaded = loaded;
15983 };
15984 }
15985 }
15986 /**
15987 * @returns {Promise<string>}
15988 */
15989
15990
15991 (0, _createClass2.default)(ShardUploader, [{
15992 key: "getUploadId",
15993 value: function getUploadId() {
15994 return ajax({
15995 method: 'POST',
15996 url: this.baseURL,
15997 headers: {
15998 Authorization: this.upToken
15999 }
16000 }).then(function (res) {
16001 return res.uploadId;
16002 });
16003 }
16004 }, {
16005 key: "getChunk",
16006 value: function getChunk() {
16007 throw new Error('Not implemented');
16008 }
16009 /**
16010 * @param {string} uploadId
16011 * @param {number} partNumber
16012 * @param {any} data
16013 * @returns {Promise<{ partNumber: number, etag: string }>}
16014 */
16015
16016 }, {
16017 key: "uploadPart",
16018 value: function uploadPart(uploadId, partNumber, data) {
16019 var _context3, _context4;
16020
16021 return ajax({
16022 method: 'PUT',
16023 url: (0, _concat.default)(_context3 = (0, _concat.default)(_context4 = "".concat(this.baseURL, "/")).call(_context4, uploadId, "/")).call(_context3, partNumber),
16024 headers: {
16025 Authorization: this.upToken
16026 },
16027 data: data,
16028 onprogress: this.onProgress
16029 }).then(function (_ref2) {
16030 var etag = _ref2.etag;
16031 return {
16032 partNumber: partNumber,
16033 etag: etag
16034 };
16035 });
16036 }
16037 }, {
16038 key: "stopUpload",
16039 value: function stopUpload(uploadId) {
16040 var _context5;
16041
16042 return ajax({
16043 method: 'DELETE',
16044 url: (0, _concat.default)(_context5 = "".concat(this.baseURL, "/")).call(_context5, uploadId),
16045 headers: {
16046 Authorization: this.upToken
16047 }
16048 });
16049 }
16050 }, {
16051 key: "upload",
16052 value: function upload() {
16053 var _this2 = this;
16054
16055 var parts = [];
16056 return this.getUploadId().then(function (uploadId) {
16057 var uploadPart = function uploadPart() {
16058 return _promise.default.resolve(_this2.getChunk()).then(function (chunk) {
16059 if (!chunk) {
16060 return;
16061 }
16062
16063 var partNumber = parts.length + 1;
16064 return _this2.uploadPart(uploadId, partNumber, chunk).then(function (part) {
16065 parts.push(part);
16066 _this2.uploadedChunks++;
16067 return uploadPart();
16068 });
16069 }).catch(function (error) {
16070 return _this2.stopUpload(uploadId).then(function () {
16071 return _promise.default.reject(error);
16072 });
16073 });
16074 };
16075
16076 return uploadPart().then(function () {
16077 var _context6;
16078
16079 return ajax({
16080 method: 'POST',
16081 url: (0, _concat.default)(_context6 = "".concat(_this2.baseURL, "/")).call(_context6, uploadId),
16082 headers: {
16083 Authorization: _this2.upToken
16084 },
16085 data: {
16086 parts: parts,
16087 fname: _this2.file.attributes.name,
16088 mimeType: _this2.file.attributes.mime_type
16089 }
16090 });
16091 });
16092 }).then(function () {
16093 _this2.file.attributes.url = _this2.uploadInfo.url;
16094 _this2.file._bucket = _this2.uploadInfo.bucket;
16095 _this2.file.id = _this2.uploadInfo.objectId;
16096 return _this2.file;
16097 });
16098 }
16099 }]);
16100 return ShardUploader;
16101}();
16102
16103var BlobUploader = /*#__PURE__*/function (_ShardUploader) {
16104 (0, _inherits2.default)(BlobUploader, _ShardUploader);
16105
16106 var _super = _createSuper(BlobUploader);
16107
16108 function BlobUploader(uploadInfo, data, file, saveOptions) {
16109 var _this3;
16110
16111 (0, _classCallCheck2.default)(this, BlobUploader);
16112 _this3 = _super.call(this, uploadInfo, data, file, saveOptions);
16113 _this3.size = data.size;
16114 return _this3;
16115 }
16116 /**
16117 * @returns {Blob | null}
16118 */
16119
16120
16121 (0, _createClass2.default)(BlobUploader, [{
16122 key: "getChunk",
16123 value: function getChunk() {
16124 var _context7;
16125
16126 if (this.offset >= this.size) {
16127 return null;
16128 }
16129
16130 var chunk = (0, _slice.default)(_context7 = this.data).call(_context7, this.offset, this.offset + CHUNK_SIZE);
16131 this.offset += chunk.size;
16132 return chunk;
16133 }
16134 }]);
16135 return BlobUploader;
16136}(ShardUploader);
16137
16138function isBlob(data) {
16139 return typeof Blob !== 'undefined' && data instanceof Blob;
16140}
16141
16142module.exports = function (uploadInfo, data, file) {
16143 var saveOptions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
16144
16145 if (isBlob(data) && data.size >= SHARD_THRESHOLD) {
16146 return new BlobUploader(uploadInfo, data, file, saveOptions).upload();
16147 }
16148
16149 return upload(uploadInfo, data, file, saveOptions);
16150};
16151
16152/***/ }),
16153/* 455 */
16154/***/ (function(module, exports, __webpack_require__) {
16155
16156module.exports = __webpack_require__(239);
16157
16158/***/ }),
16159/* 456 */
16160/***/ (function(module, exports, __webpack_require__) {
16161
16162__webpack_require__(78);
16163__webpack_require__(457);
16164var path = __webpack_require__(10);
16165
16166module.exports = path.Array.from;
16167
16168
16169/***/ }),
16170/* 457 */
16171/***/ (function(module, exports, __webpack_require__) {
16172
16173var $ = __webpack_require__(0);
16174var from = __webpack_require__(458);
16175var checkCorrectnessOfIteration = __webpack_require__(168);
16176
16177var INCORRECT_ITERATION = !checkCorrectnessOfIteration(function (iterable) {
16178 // eslint-disable-next-line es-x/no-array-from -- required for testing
16179 Array.from(iterable);
16180});
16181
16182// `Array.from` method
16183// https://tc39.es/ecma262/#sec-array.from
16184$({ target: 'Array', stat: true, forced: INCORRECT_ITERATION }, {
16185 from: from
16186});
16187
16188
16189/***/ }),
16190/* 458 */
16191/***/ (function(module, exports, __webpack_require__) {
16192
16193"use strict";
16194
16195var bind = __webpack_require__(45);
16196var call = __webpack_require__(13);
16197var toObject = __webpack_require__(34);
16198var callWithSafeIterationClosing = __webpack_require__(459);
16199var isArrayIteratorMethod = __webpack_require__(156);
16200var isConstructor = __webpack_require__(101);
16201var lengthOfArrayLike = __webpack_require__(46);
16202var createProperty = __webpack_require__(106);
16203var getIterator = __webpack_require__(157);
16204var getIteratorMethod = __webpack_require__(99);
16205
16206var $Array = Array;
16207
16208// `Array.from` method implementation
16209// https://tc39.es/ecma262/#sec-array.from
16210module.exports = function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) {
16211 var O = toObject(arrayLike);
16212 var IS_CONSTRUCTOR = isConstructor(this);
16213 var argumentsLength = arguments.length;
16214 var mapfn = argumentsLength > 1 ? arguments[1] : undefined;
16215 var mapping = mapfn !== undefined;
16216 if (mapping) mapfn = bind(mapfn, argumentsLength > 2 ? arguments[2] : undefined);
16217 var iteratorMethod = getIteratorMethod(O);
16218 var index = 0;
16219 var length, result, step, iterator, next, value;
16220 // if the target is not iterable or it's an array with the default iterator - use a simple case
16221 if (iteratorMethod && !(this === $Array && isArrayIteratorMethod(iteratorMethod))) {
16222 iterator = getIterator(O, iteratorMethod);
16223 next = iterator.next;
16224 result = IS_CONSTRUCTOR ? new this() : [];
16225 for (;!(step = call(next, iterator)).done; index++) {
16226 value = mapping ? callWithSafeIterationClosing(iterator, mapfn, [step.value, index], true) : step.value;
16227 createProperty(result, index, value);
16228 }
16229 } else {
16230 length = lengthOfArrayLike(O);
16231 result = IS_CONSTRUCTOR ? new this(length) : $Array(length);
16232 for (;length > index; index++) {
16233 value = mapping ? mapfn(O[index], index) : O[index];
16234 createProperty(result, index, value);
16235 }
16236 }
16237 result.length = index;
16238 return result;
16239};
16240
16241
16242/***/ }),
16243/* 459 */
16244/***/ (function(module, exports, __webpack_require__) {
16245
16246var anObject = __webpack_require__(19);
16247var iteratorClose = __webpack_require__(158);
16248
16249// call something on iterator step with safe closing on error
16250module.exports = function (iterator, fn, value, ENTRIES) {
16251 try {
16252 return ENTRIES ? fn(anObject(value)[0], value[1]) : fn(value);
16253 } catch (error) {
16254 iteratorClose(iterator, 'throw', error);
16255 }
16256};
16257
16258
16259/***/ }),
16260/* 460 */
16261/***/ (function(module, exports, __webpack_require__) {
16262
16263module.exports = __webpack_require__(461);
16264
16265
16266/***/ }),
16267/* 461 */
16268/***/ (function(module, exports, __webpack_require__) {
16269
16270var parent = __webpack_require__(462);
16271
16272module.exports = parent;
16273
16274
16275/***/ }),
16276/* 462 */
16277/***/ (function(module, exports, __webpack_require__) {
16278
16279var parent = __webpack_require__(463);
16280
16281module.exports = parent;
16282
16283
16284/***/ }),
16285/* 463 */
16286/***/ (function(module, exports, __webpack_require__) {
16287
16288var parent = __webpack_require__(464);
16289__webpack_require__(51);
16290
16291module.exports = parent;
16292
16293
16294/***/ }),
16295/* 464 */
16296/***/ (function(module, exports, __webpack_require__) {
16297
16298__webpack_require__(48);
16299__webpack_require__(78);
16300var getIteratorMethod = __webpack_require__(99);
16301
16302module.exports = getIteratorMethod;
16303
16304
16305/***/ }),
16306/* 465 */
16307/***/ (function(module, exports, __webpack_require__) {
16308
16309module.exports = __webpack_require__(466);
16310
16311/***/ }),
16312/* 466 */
16313/***/ (function(module, exports, __webpack_require__) {
16314
16315var parent = __webpack_require__(467);
16316
16317module.exports = parent;
16318
16319
16320/***/ }),
16321/* 467 */
16322/***/ (function(module, exports, __webpack_require__) {
16323
16324__webpack_require__(468);
16325var path = __webpack_require__(10);
16326
16327module.exports = path.Reflect.construct;
16328
16329
16330/***/ }),
16331/* 468 */
16332/***/ (function(module, exports, __webpack_require__) {
16333
16334var $ = __webpack_require__(0);
16335var getBuiltIn = __webpack_require__(18);
16336var apply = __webpack_require__(69);
16337var bind = __webpack_require__(242);
16338var aConstructor = __webpack_require__(164);
16339var anObject = __webpack_require__(19);
16340var isObject = __webpack_require__(11);
16341var create = __webpack_require__(47);
16342var fails = __webpack_require__(3);
16343
16344var nativeConstruct = getBuiltIn('Reflect', 'construct');
16345var ObjectPrototype = Object.prototype;
16346var push = [].push;
16347
16348// `Reflect.construct` method
16349// https://tc39.es/ecma262/#sec-reflect.construct
16350// MS Edge supports only 2 arguments and argumentsList argument is optional
16351// FF Nightly sets third argument as `new.target`, but does not create `this` from it
16352var NEW_TARGET_BUG = fails(function () {
16353 function F() { /* empty */ }
16354 return !(nativeConstruct(function () { /* empty */ }, [], F) instanceof F);
16355});
16356
16357var ARGS_BUG = !fails(function () {
16358 nativeConstruct(function () { /* empty */ });
16359});
16360
16361var FORCED = NEW_TARGET_BUG || ARGS_BUG;
16362
16363$({ target: 'Reflect', stat: true, forced: FORCED, sham: FORCED }, {
16364 construct: function construct(Target, args /* , newTarget */) {
16365 aConstructor(Target);
16366 anObject(args);
16367 var newTarget = arguments.length < 3 ? Target : aConstructor(arguments[2]);
16368 if (ARGS_BUG && !NEW_TARGET_BUG) return nativeConstruct(Target, args, newTarget);
16369 if (Target == newTarget) {
16370 // w/o altered newTarget, optimization for 0-4 arguments
16371 switch (args.length) {
16372 case 0: return new Target();
16373 case 1: return new Target(args[0]);
16374 case 2: return new Target(args[0], args[1]);
16375 case 3: return new Target(args[0], args[1], args[2]);
16376 case 4: return new Target(args[0], args[1], args[2], args[3]);
16377 }
16378 // w/o altered newTarget, lot of arguments case
16379 var $args = [null];
16380 apply(push, $args, args);
16381 return new (apply(bind, Target, $args))();
16382 }
16383 // with altered newTarget, not support built-in constructors
16384 var proto = newTarget.prototype;
16385 var instance = create(isObject(proto) ? proto : ObjectPrototype);
16386 var result = apply(Target, instance, args);
16387 return isObject(result) ? result : instance;
16388 }
16389});
16390
16391
16392/***/ }),
16393/* 469 */
16394/***/ (function(module, exports, __webpack_require__) {
16395
16396var _Object$create = __webpack_require__(470);
16397
16398var _Object$defineProperty = __webpack_require__(145);
16399
16400var setPrototypeOf = __webpack_require__(480);
16401
16402function _inherits(subClass, superClass) {
16403 if (typeof superClass !== "function" && superClass !== null) {
16404 throw new TypeError("Super expression must either be null or a function");
16405 }
16406
16407 subClass.prototype = _Object$create(superClass && superClass.prototype, {
16408 constructor: {
16409 value: subClass,
16410 writable: true,
16411 configurable: true
16412 }
16413 });
16414
16415 _Object$defineProperty(subClass, "prototype", {
16416 writable: false
16417 });
16418
16419 if (superClass) setPrototypeOf(subClass, superClass);
16420}
16421
16422module.exports = _inherits, module.exports.__esModule = true, module.exports["default"] = module.exports;
16423
16424/***/ }),
16425/* 470 */
16426/***/ (function(module, exports, __webpack_require__) {
16427
16428module.exports = __webpack_require__(471);
16429
16430/***/ }),
16431/* 471 */
16432/***/ (function(module, exports, __webpack_require__) {
16433
16434module.exports = __webpack_require__(472);
16435
16436
16437/***/ }),
16438/* 472 */
16439/***/ (function(module, exports, __webpack_require__) {
16440
16441var parent = __webpack_require__(473);
16442
16443module.exports = parent;
16444
16445
16446/***/ }),
16447/* 473 */
16448/***/ (function(module, exports, __webpack_require__) {
16449
16450var parent = __webpack_require__(474);
16451
16452module.exports = parent;
16453
16454
16455/***/ }),
16456/* 474 */
16457/***/ (function(module, exports, __webpack_require__) {
16458
16459var parent = __webpack_require__(475);
16460
16461module.exports = parent;
16462
16463
16464/***/ }),
16465/* 475 */
16466/***/ (function(module, exports, __webpack_require__) {
16467
16468__webpack_require__(476);
16469var path = __webpack_require__(10);
16470
16471var Object = path.Object;
16472
16473module.exports = function create(P, D) {
16474 return Object.create(P, D);
16475};
16476
16477
16478/***/ }),
16479/* 476 */
16480/***/ (function(module, exports, __webpack_require__) {
16481
16482// TODO: Remove from `core-js@4`
16483var $ = __webpack_require__(0);
16484var DESCRIPTORS = __webpack_require__(16);
16485var create = __webpack_require__(47);
16486
16487// `Object.create` method
16488// https://tc39.es/ecma262/#sec-object.create
16489$({ target: 'Object', stat: true, sham: !DESCRIPTORS }, {
16490 create: create
16491});
16492
16493
16494/***/ }),
16495/* 477 */
16496/***/ (function(module, exports, __webpack_require__) {
16497
16498module.exports = __webpack_require__(478);
16499
16500
16501/***/ }),
16502/* 478 */
16503/***/ (function(module, exports, __webpack_require__) {
16504
16505var parent = __webpack_require__(479);
16506
16507module.exports = parent;
16508
16509
16510/***/ }),
16511/* 479 */
16512/***/ (function(module, exports, __webpack_require__) {
16513
16514var parent = __webpack_require__(230);
16515
16516module.exports = parent;
16517
16518
16519/***/ }),
16520/* 480 */
16521/***/ (function(module, exports, __webpack_require__) {
16522
16523var _Object$setPrototypeOf = __webpack_require__(243);
16524
16525var _bindInstanceProperty = __webpack_require__(244);
16526
16527function _setPrototypeOf(o, p) {
16528 var _context;
16529
16530 module.exports = _setPrototypeOf = _Object$setPrototypeOf ? _bindInstanceProperty(_context = _Object$setPrototypeOf).call(_context) : function _setPrototypeOf(o, p) {
16531 o.__proto__ = p;
16532 return o;
16533 }, module.exports.__esModule = true, module.exports["default"] = module.exports;
16534 return _setPrototypeOf(o, p);
16535}
16536
16537module.exports = _setPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
16538
16539/***/ }),
16540/* 481 */
16541/***/ (function(module, exports, __webpack_require__) {
16542
16543module.exports = __webpack_require__(482);
16544
16545
16546/***/ }),
16547/* 482 */
16548/***/ (function(module, exports, __webpack_require__) {
16549
16550var parent = __webpack_require__(483);
16551
16552module.exports = parent;
16553
16554
16555/***/ }),
16556/* 483 */
16557/***/ (function(module, exports, __webpack_require__) {
16558
16559var parent = __webpack_require__(228);
16560
16561module.exports = parent;
16562
16563
16564/***/ }),
16565/* 484 */
16566/***/ (function(module, exports, __webpack_require__) {
16567
16568module.exports = __webpack_require__(485);
16569
16570
16571/***/ }),
16572/* 485 */
16573/***/ (function(module, exports, __webpack_require__) {
16574
16575var parent = __webpack_require__(486);
16576
16577module.exports = parent;
16578
16579
16580/***/ }),
16581/* 486 */
16582/***/ (function(module, exports, __webpack_require__) {
16583
16584var parent = __webpack_require__(487);
16585
16586module.exports = parent;
16587
16588
16589/***/ }),
16590/* 487 */
16591/***/ (function(module, exports, __webpack_require__) {
16592
16593var parent = __webpack_require__(488);
16594
16595module.exports = parent;
16596
16597
16598/***/ }),
16599/* 488 */
16600/***/ (function(module, exports, __webpack_require__) {
16601
16602var isPrototypeOf = __webpack_require__(21);
16603var method = __webpack_require__(489);
16604
16605var FunctionPrototype = Function.prototype;
16606
16607module.exports = function (it) {
16608 var own = it.bind;
16609 return it === FunctionPrototype || (isPrototypeOf(FunctionPrototype, it) && own === FunctionPrototype.bind) ? method : own;
16610};
16611
16612
16613/***/ }),
16614/* 489 */
16615/***/ (function(module, exports, __webpack_require__) {
16616
16617__webpack_require__(490);
16618var entryVirtual = __webpack_require__(41);
16619
16620module.exports = entryVirtual('Function').bind;
16621
16622
16623/***/ }),
16624/* 490 */
16625/***/ (function(module, exports, __webpack_require__) {
16626
16627// TODO: Remove from `core-js@4`
16628var $ = __webpack_require__(0);
16629var bind = __webpack_require__(242);
16630
16631// `Function.prototype.bind` method
16632// https://tc39.es/ecma262/#sec-function.prototype.bind
16633$({ target: 'Function', proto: true, forced: Function.bind !== bind }, {
16634 bind: bind
16635});
16636
16637
16638/***/ }),
16639/* 491 */
16640/***/ (function(module, exports, __webpack_require__) {
16641
16642var _typeof = __webpack_require__(109)["default"];
16643
16644var assertThisInitialized = __webpack_require__(492);
16645
16646function _possibleConstructorReturn(self, call) {
16647 if (call && (_typeof(call) === "object" || typeof call === "function")) {
16648 return call;
16649 } else if (call !== void 0) {
16650 throw new TypeError("Derived constructors may only return object or undefined");
16651 }
16652
16653 return assertThisInitialized(self);
16654}
16655
16656module.exports = _possibleConstructorReturn, module.exports.__esModule = true, module.exports["default"] = module.exports;
16657
16658/***/ }),
16659/* 492 */
16660/***/ (function(module, exports) {
16661
16662function _assertThisInitialized(self) {
16663 if (self === void 0) {
16664 throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
16665 }
16666
16667 return self;
16668}
16669
16670module.exports = _assertThisInitialized, module.exports.__esModule = true, module.exports["default"] = module.exports;
16671
16672/***/ }),
16673/* 493 */
16674/***/ (function(module, exports, __webpack_require__) {
16675
16676var _Object$setPrototypeOf = __webpack_require__(243);
16677
16678var _bindInstanceProperty = __webpack_require__(244);
16679
16680var _Object$getPrototypeOf = __webpack_require__(494);
16681
16682function _getPrototypeOf(o) {
16683 var _context;
16684
16685 module.exports = _getPrototypeOf = _Object$setPrototypeOf ? _bindInstanceProperty(_context = _Object$getPrototypeOf).call(_context) : function _getPrototypeOf(o) {
16686 return o.__proto__ || _Object$getPrototypeOf(o);
16687 }, module.exports.__esModule = true, module.exports["default"] = module.exports;
16688 return _getPrototypeOf(o);
16689}
16690
16691module.exports = _getPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
16692
16693/***/ }),
16694/* 494 */
16695/***/ (function(module, exports, __webpack_require__) {
16696
16697module.exports = __webpack_require__(495);
16698
16699/***/ }),
16700/* 495 */
16701/***/ (function(module, exports, __webpack_require__) {
16702
16703module.exports = __webpack_require__(496);
16704
16705
16706/***/ }),
16707/* 496 */
16708/***/ (function(module, exports, __webpack_require__) {
16709
16710var parent = __webpack_require__(497);
16711
16712module.exports = parent;
16713
16714
16715/***/ }),
16716/* 497 */
16717/***/ (function(module, exports, __webpack_require__) {
16718
16719var parent = __webpack_require__(222);
16720
16721module.exports = parent;
16722
16723
16724/***/ }),
16725/* 498 */
16726/***/ (function(module, exports) {
16727
16728function _classCallCheck(instance, Constructor) {
16729 if (!(instance instanceof Constructor)) {
16730 throw new TypeError("Cannot call a class as a function");
16731 }
16732}
16733
16734module.exports = _classCallCheck, module.exports.__esModule = true, module.exports["default"] = module.exports;
16735
16736/***/ }),
16737/* 499 */
16738/***/ (function(module, exports, __webpack_require__) {
16739
16740var _Object$defineProperty = __webpack_require__(145);
16741
16742function _defineProperties(target, props) {
16743 for (var i = 0; i < props.length; i++) {
16744 var descriptor = props[i];
16745 descriptor.enumerable = descriptor.enumerable || false;
16746 descriptor.configurable = true;
16747 if ("value" in descriptor) descriptor.writable = true;
16748
16749 _Object$defineProperty(target, descriptor.key, descriptor);
16750 }
16751}
16752
16753function _createClass(Constructor, protoProps, staticProps) {
16754 if (protoProps) _defineProperties(Constructor.prototype, protoProps);
16755 if (staticProps) _defineProperties(Constructor, staticProps);
16756
16757 _Object$defineProperty(Constructor, "prototype", {
16758 writable: false
16759 });
16760
16761 return Constructor;
16762}
16763
16764module.exports = _createClass, module.exports.__esModule = true, module.exports["default"] = module.exports;
16765
16766/***/ }),
16767/* 500 */
16768/***/ (function(module, exports, __webpack_require__) {
16769
16770"use strict";
16771
16772
16773var _interopRequireDefault = __webpack_require__(1);
16774
16775var _slice = _interopRequireDefault(__webpack_require__(87));
16776
16777// base64 character set, plus padding character (=)
16778var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
16779
16780module.exports = function (string) {
16781 var result = '';
16782
16783 for (var i = 0; i < string.length;) {
16784 var a = string.charCodeAt(i++);
16785 var b = string.charCodeAt(i++);
16786 var c = string.charCodeAt(i++);
16787
16788 if (a > 255 || b > 255 || c > 255) {
16789 throw new TypeError('Failed to encode base64: The string to be encoded contains characters outside of the Latin1 range.');
16790 }
16791
16792 var bitmap = a << 16 | b << 8 | c;
16793 result += b64.charAt(bitmap >> 18 & 63) + b64.charAt(bitmap >> 12 & 63) + b64.charAt(bitmap >> 6 & 63) + b64.charAt(bitmap & 63);
16794 } // To determine the final padding
16795
16796
16797 var rest = string.length % 3; // If there's need of padding, replace the last 'A's with equal signs
16798
16799 return rest ? (0, _slice.default)(result).call(result, 0, rest - 3) + '==='.substring(rest) : result;
16800};
16801
16802/***/ }),
16803/* 501 */
16804/***/ (function(module, exports, __webpack_require__) {
16805
16806"use strict";
16807
16808
16809var _ = __webpack_require__(2);
16810
16811var ajax = __webpack_require__(108);
16812
16813module.exports = function upload(uploadInfo, data, file) {
16814 var saveOptions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
16815 return ajax({
16816 url: uploadInfo.upload_url,
16817 method: 'PUT',
16818 data: data,
16819 headers: _.extend({
16820 'Content-Type': file.get('mime_type'),
16821 'Cache-Control': 'public, max-age=31536000'
16822 }, file._uploadHeaders),
16823 onprogress: saveOptions.onprogress
16824 }).then(function () {
16825 file.attributes.url = uploadInfo.url;
16826 file._bucket = uploadInfo.bucket;
16827 file.id = uploadInfo.objectId;
16828 return file;
16829 });
16830};
16831
16832/***/ }),
16833/* 502 */
16834/***/ (function(module, exports, __webpack_require__) {
16835
16836(function(){
16837 var crypt = __webpack_require__(503),
16838 utf8 = __webpack_require__(245).utf8,
16839 isBuffer = __webpack_require__(504),
16840 bin = __webpack_require__(245).bin,
16841
16842 // The core
16843 md5 = function (message, options) {
16844 // Convert to byte array
16845 if (message.constructor == String)
16846 if (options && options.encoding === 'binary')
16847 message = bin.stringToBytes(message);
16848 else
16849 message = utf8.stringToBytes(message);
16850 else if (isBuffer(message))
16851 message = Array.prototype.slice.call(message, 0);
16852 else if (!Array.isArray(message))
16853 message = message.toString();
16854 // else, assume byte array already
16855
16856 var m = crypt.bytesToWords(message),
16857 l = message.length * 8,
16858 a = 1732584193,
16859 b = -271733879,
16860 c = -1732584194,
16861 d = 271733878;
16862
16863 // Swap endian
16864 for (var i = 0; i < m.length; i++) {
16865 m[i] = ((m[i] << 8) | (m[i] >>> 24)) & 0x00FF00FF |
16866 ((m[i] << 24) | (m[i] >>> 8)) & 0xFF00FF00;
16867 }
16868
16869 // Padding
16870 m[l >>> 5] |= 0x80 << (l % 32);
16871 m[(((l + 64) >>> 9) << 4) + 14] = l;
16872
16873 // Method shortcuts
16874 var FF = md5._ff,
16875 GG = md5._gg,
16876 HH = md5._hh,
16877 II = md5._ii;
16878
16879 for (var i = 0; i < m.length; i += 16) {
16880
16881 var aa = a,
16882 bb = b,
16883 cc = c,
16884 dd = d;
16885
16886 a = FF(a, b, c, d, m[i+ 0], 7, -680876936);
16887 d = FF(d, a, b, c, m[i+ 1], 12, -389564586);
16888 c = FF(c, d, a, b, m[i+ 2], 17, 606105819);
16889 b = FF(b, c, d, a, m[i+ 3], 22, -1044525330);
16890 a = FF(a, b, c, d, m[i+ 4], 7, -176418897);
16891 d = FF(d, a, b, c, m[i+ 5], 12, 1200080426);
16892 c = FF(c, d, a, b, m[i+ 6], 17, -1473231341);
16893 b = FF(b, c, d, a, m[i+ 7], 22, -45705983);
16894 a = FF(a, b, c, d, m[i+ 8], 7, 1770035416);
16895 d = FF(d, a, b, c, m[i+ 9], 12, -1958414417);
16896 c = FF(c, d, a, b, m[i+10], 17, -42063);
16897 b = FF(b, c, d, a, m[i+11], 22, -1990404162);
16898 a = FF(a, b, c, d, m[i+12], 7, 1804603682);
16899 d = FF(d, a, b, c, m[i+13], 12, -40341101);
16900 c = FF(c, d, a, b, m[i+14], 17, -1502002290);
16901 b = FF(b, c, d, a, m[i+15], 22, 1236535329);
16902
16903 a = GG(a, b, c, d, m[i+ 1], 5, -165796510);
16904 d = GG(d, a, b, c, m[i+ 6], 9, -1069501632);
16905 c = GG(c, d, a, b, m[i+11], 14, 643717713);
16906 b = GG(b, c, d, a, m[i+ 0], 20, -373897302);
16907 a = GG(a, b, c, d, m[i+ 5], 5, -701558691);
16908 d = GG(d, a, b, c, m[i+10], 9, 38016083);
16909 c = GG(c, d, a, b, m[i+15], 14, -660478335);
16910 b = GG(b, c, d, a, m[i+ 4], 20, -405537848);
16911 a = GG(a, b, c, d, m[i+ 9], 5, 568446438);
16912 d = GG(d, a, b, c, m[i+14], 9, -1019803690);
16913 c = GG(c, d, a, b, m[i+ 3], 14, -187363961);
16914 b = GG(b, c, d, a, m[i+ 8], 20, 1163531501);
16915 a = GG(a, b, c, d, m[i+13], 5, -1444681467);
16916 d = GG(d, a, b, c, m[i+ 2], 9, -51403784);
16917 c = GG(c, d, a, b, m[i+ 7], 14, 1735328473);
16918 b = GG(b, c, d, a, m[i+12], 20, -1926607734);
16919
16920 a = HH(a, b, c, d, m[i+ 5], 4, -378558);
16921 d = HH(d, a, b, c, m[i+ 8], 11, -2022574463);
16922 c = HH(c, d, a, b, m[i+11], 16, 1839030562);
16923 b = HH(b, c, d, a, m[i+14], 23, -35309556);
16924 a = HH(a, b, c, d, m[i+ 1], 4, -1530992060);
16925 d = HH(d, a, b, c, m[i+ 4], 11, 1272893353);
16926 c = HH(c, d, a, b, m[i+ 7], 16, -155497632);
16927 b = HH(b, c, d, a, m[i+10], 23, -1094730640);
16928 a = HH(a, b, c, d, m[i+13], 4, 681279174);
16929 d = HH(d, a, b, c, m[i+ 0], 11, -358537222);
16930 c = HH(c, d, a, b, m[i+ 3], 16, -722521979);
16931 b = HH(b, c, d, a, m[i+ 6], 23, 76029189);
16932 a = HH(a, b, c, d, m[i+ 9], 4, -640364487);
16933 d = HH(d, a, b, c, m[i+12], 11, -421815835);
16934 c = HH(c, d, a, b, m[i+15], 16, 530742520);
16935 b = HH(b, c, d, a, m[i+ 2], 23, -995338651);
16936
16937 a = II(a, b, c, d, m[i+ 0], 6, -198630844);
16938 d = II(d, a, b, c, m[i+ 7], 10, 1126891415);
16939 c = II(c, d, a, b, m[i+14], 15, -1416354905);
16940 b = II(b, c, d, a, m[i+ 5], 21, -57434055);
16941 a = II(a, b, c, d, m[i+12], 6, 1700485571);
16942 d = II(d, a, b, c, m[i+ 3], 10, -1894986606);
16943 c = II(c, d, a, b, m[i+10], 15, -1051523);
16944 b = II(b, c, d, a, m[i+ 1], 21, -2054922799);
16945 a = II(a, b, c, d, m[i+ 8], 6, 1873313359);
16946 d = II(d, a, b, c, m[i+15], 10, -30611744);
16947 c = II(c, d, a, b, m[i+ 6], 15, -1560198380);
16948 b = II(b, c, d, a, m[i+13], 21, 1309151649);
16949 a = II(a, b, c, d, m[i+ 4], 6, -145523070);
16950 d = II(d, a, b, c, m[i+11], 10, -1120210379);
16951 c = II(c, d, a, b, m[i+ 2], 15, 718787259);
16952 b = II(b, c, d, a, m[i+ 9], 21, -343485551);
16953
16954 a = (a + aa) >>> 0;
16955 b = (b + bb) >>> 0;
16956 c = (c + cc) >>> 0;
16957 d = (d + dd) >>> 0;
16958 }
16959
16960 return crypt.endian([a, b, c, d]);
16961 };
16962
16963 // Auxiliary functions
16964 md5._ff = function (a, b, c, d, x, s, t) {
16965 var n = a + (b & c | ~b & d) + (x >>> 0) + t;
16966 return ((n << s) | (n >>> (32 - s))) + b;
16967 };
16968 md5._gg = function (a, b, c, d, x, s, t) {
16969 var n = a + (b & d | c & ~d) + (x >>> 0) + t;
16970 return ((n << s) | (n >>> (32 - s))) + b;
16971 };
16972 md5._hh = function (a, b, c, d, x, s, t) {
16973 var n = a + (b ^ c ^ d) + (x >>> 0) + t;
16974 return ((n << s) | (n >>> (32 - s))) + b;
16975 };
16976 md5._ii = function (a, b, c, d, x, s, t) {
16977 var n = a + (c ^ (b | ~d)) + (x >>> 0) + t;
16978 return ((n << s) | (n >>> (32 - s))) + b;
16979 };
16980
16981 // Package private blocksize
16982 md5._blocksize = 16;
16983 md5._digestsize = 16;
16984
16985 module.exports = function (message, options) {
16986 if (message === undefined || message === null)
16987 throw new Error('Illegal argument ' + message);
16988
16989 var digestbytes = crypt.wordsToBytes(md5(message, options));
16990 return options && options.asBytes ? digestbytes :
16991 options && options.asString ? bin.bytesToString(digestbytes) :
16992 crypt.bytesToHex(digestbytes);
16993 };
16994
16995})();
16996
16997
16998/***/ }),
16999/* 503 */
17000/***/ (function(module, exports) {
17001
17002(function() {
17003 var base64map
17004 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/',
17005
17006 crypt = {
17007 // Bit-wise rotation left
17008 rotl: function(n, b) {
17009 return (n << b) | (n >>> (32 - b));
17010 },
17011
17012 // Bit-wise rotation right
17013 rotr: function(n, b) {
17014 return (n << (32 - b)) | (n >>> b);
17015 },
17016
17017 // Swap big-endian to little-endian and vice versa
17018 endian: function(n) {
17019 // If number given, swap endian
17020 if (n.constructor == Number) {
17021 return crypt.rotl(n, 8) & 0x00FF00FF | crypt.rotl(n, 24) & 0xFF00FF00;
17022 }
17023
17024 // Else, assume array and swap all items
17025 for (var i = 0; i < n.length; i++)
17026 n[i] = crypt.endian(n[i]);
17027 return n;
17028 },
17029
17030 // Generate an array of any length of random bytes
17031 randomBytes: function(n) {
17032 for (var bytes = []; n > 0; n--)
17033 bytes.push(Math.floor(Math.random() * 256));
17034 return bytes;
17035 },
17036
17037 // Convert a byte array to big-endian 32-bit words
17038 bytesToWords: function(bytes) {
17039 for (var words = [], i = 0, b = 0; i < bytes.length; i++, b += 8)
17040 words[b >>> 5] |= bytes[i] << (24 - b % 32);
17041 return words;
17042 },
17043
17044 // Convert big-endian 32-bit words to a byte array
17045 wordsToBytes: function(words) {
17046 for (var bytes = [], b = 0; b < words.length * 32; b += 8)
17047 bytes.push((words[b >>> 5] >>> (24 - b % 32)) & 0xFF);
17048 return bytes;
17049 },
17050
17051 // Convert a byte array to a hex string
17052 bytesToHex: function(bytes) {
17053 for (var hex = [], i = 0; i < bytes.length; i++) {
17054 hex.push((bytes[i] >>> 4).toString(16));
17055 hex.push((bytes[i] & 0xF).toString(16));
17056 }
17057 return hex.join('');
17058 },
17059
17060 // Convert a hex string to a byte array
17061 hexToBytes: function(hex) {
17062 for (var bytes = [], c = 0; c < hex.length; c += 2)
17063 bytes.push(parseInt(hex.substr(c, 2), 16));
17064 return bytes;
17065 },
17066
17067 // Convert a byte array to a base-64 string
17068 bytesToBase64: function(bytes) {
17069 for (var base64 = [], i = 0; i < bytes.length; i += 3) {
17070 var triplet = (bytes[i] << 16) | (bytes[i + 1] << 8) | bytes[i + 2];
17071 for (var j = 0; j < 4; j++)
17072 if (i * 8 + j * 6 <= bytes.length * 8)
17073 base64.push(base64map.charAt((triplet >>> 6 * (3 - j)) & 0x3F));
17074 else
17075 base64.push('=');
17076 }
17077 return base64.join('');
17078 },
17079
17080 // Convert a base-64 string to a byte array
17081 base64ToBytes: function(base64) {
17082 // Remove non-base-64 characters
17083 base64 = base64.replace(/[^A-Z0-9+\/]/ig, '');
17084
17085 for (var bytes = [], i = 0, imod4 = 0; i < base64.length;
17086 imod4 = ++i % 4) {
17087 if (imod4 == 0) continue;
17088 bytes.push(((base64map.indexOf(base64.charAt(i - 1))
17089 & (Math.pow(2, -2 * imod4 + 8) - 1)) << (imod4 * 2))
17090 | (base64map.indexOf(base64.charAt(i)) >>> (6 - imod4 * 2)));
17091 }
17092 return bytes;
17093 }
17094 };
17095
17096 module.exports = crypt;
17097})();
17098
17099
17100/***/ }),
17101/* 504 */
17102/***/ (function(module, exports) {
17103
17104/*!
17105 * Determine if an object is a Buffer
17106 *
17107 * @author Feross Aboukhadijeh <https://feross.org>
17108 * @license MIT
17109 */
17110
17111// The _isBuffer check is for Safari 5-7 support, because it's missing
17112// Object.prototype.constructor. Remove this eventually
17113module.exports = function (obj) {
17114 return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer)
17115}
17116
17117function isBuffer (obj) {
17118 return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)
17119}
17120
17121// For Node v0.10 support. Remove this eventually.
17122function isSlowBuffer (obj) {
17123 return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0))
17124}
17125
17126
17127/***/ }),
17128/* 505 */
17129/***/ (function(module, exports, __webpack_require__) {
17130
17131"use strict";
17132
17133
17134var _interopRequireDefault = __webpack_require__(1);
17135
17136var _indexOf = _interopRequireDefault(__webpack_require__(86));
17137
17138var dataURItoBlob = function dataURItoBlob(dataURI, type) {
17139 var _context;
17140
17141 var byteString; // 传入的 base64,不是 dataURL
17142
17143 if ((0, _indexOf.default)(dataURI).call(dataURI, 'base64') < 0) {
17144 byteString = atob(dataURI);
17145 } else if ((0, _indexOf.default)(_context = dataURI.split(',')[0]).call(_context, 'base64') >= 0) {
17146 type = type || dataURI.split(',')[0].split(':')[1].split(';')[0];
17147 byteString = atob(dataURI.split(',')[1]);
17148 } else {
17149 byteString = unescape(dataURI.split(',')[1]);
17150 }
17151
17152 var ia = new Uint8Array(byteString.length);
17153
17154 for (var i = 0; i < byteString.length; i++) {
17155 ia[i] = byteString.charCodeAt(i);
17156 }
17157
17158 return new Blob([ia], {
17159 type: type
17160 });
17161};
17162
17163module.exports = dataURItoBlob;
17164
17165/***/ }),
17166/* 506 */
17167/***/ (function(module, exports, __webpack_require__) {
17168
17169"use strict";
17170
17171
17172var _interopRequireDefault = __webpack_require__(1);
17173
17174var _slicedToArray2 = _interopRequireDefault(__webpack_require__(507));
17175
17176var _map = _interopRequireDefault(__webpack_require__(42));
17177
17178var _indexOf = _interopRequireDefault(__webpack_require__(86));
17179
17180var _find = _interopRequireDefault(__webpack_require__(110));
17181
17182var _promise = _interopRequireDefault(__webpack_require__(12));
17183
17184var _concat = _interopRequireDefault(__webpack_require__(30));
17185
17186var _keys2 = _interopRequireDefault(__webpack_require__(55));
17187
17188var _stringify = _interopRequireDefault(__webpack_require__(36));
17189
17190var _defineProperty = _interopRequireDefault(__webpack_require__(143));
17191
17192var _getOwnPropertyDescriptor = _interopRequireDefault(__webpack_require__(246));
17193
17194var _ = __webpack_require__(2);
17195
17196var AVError = __webpack_require__(43);
17197
17198var _require = __webpack_require__(26),
17199 _request = _require._request;
17200
17201var _require2 = __webpack_require__(29),
17202 isNullOrUndefined = _require2.isNullOrUndefined,
17203 ensureArray = _require2.ensureArray,
17204 transformFetchOptions = _require2.transformFetchOptions,
17205 setValue = _require2.setValue,
17206 findValue = _require2.findValue,
17207 isPlainObject = _require2.isPlainObject,
17208 continueWhile = _require2.continueWhile;
17209
17210var recursiveToPointer = function recursiveToPointer(value) {
17211 if (_.isArray(value)) return (0, _map.default)(value).call(value, recursiveToPointer);
17212 if (isPlainObject(value)) return _.mapObject(value, recursiveToPointer);
17213 if (_.isObject(value) && value._toPointer) return value._toPointer();
17214 return value;
17215};
17216
17217var RESERVED_KEYS = ['objectId', 'createdAt', 'updatedAt'];
17218
17219var checkReservedKey = function checkReservedKey(key) {
17220 if ((0, _indexOf.default)(RESERVED_KEYS).call(RESERVED_KEYS, key) !== -1) {
17221 throw new Error("key[".concat(key, "] is reserved"));
17222 }
17223};
17224
17225var handleBatchResults = function handleBatchResults(results) {
17226 var firstError = (0, _find.default)(_).call(_, results, function (result) {
17227 return result instanceof Error;
17228 });
17229
17230 if (!firstError) {
17231 return results;
17232 }
17233
17234 var error = new AVError(firstError.code, firstError.message);
17235 error.results = results;
17236 throw error;
17237}; // Helper function to get a value from a Backbone object as a property
17238// or as a function.
17239
17240
17241function getValue(object, prop) {
17242 if (!(object && object[prop])) {
17243 return null;
17244 }
17245
17246 return _.isFunction(object[prop]) ? object[prop]() : object[prop];
17247} // AV.Object is analogous to the Java AVObject.
17248// It also implements the same interface as a Backbone model.
17249
17250
17251module.exports = function (AV) {
17252 /**
17253 * Creates a new model with defined attributes. A client id (cid) is
17254 * automatically generated and assigned for you.
17255 *
17256 * <p>You won't normally call this method directly. It is recommended that
17257 * you use a subclass of <code>AV.Object</code> instead, created by calling
17258 * <code>extend</code>.</p>
17259 *
17260 * <p>However, if you don't want to use a subclass, or aren't sure which
17261 * subclass is appropriate, you can use this form:<pre>
17262 * var object = new AV.Object("ClassName");
17263 * </pre>
17264 * That is basically equivalent to:<pre>
17265 * var MyClass = AV.Object.extend("ClassName");
17266 * var object = new MyClass();
17267 * </pre></p>
17268 *
17269 * @param {Object} attributes The initial set of data to store in the object.
17270 * @param {Object} options A set of Backbone-like options for creating the
17271 * object. The only option currently supported is "collection".
17272 * @see AV.Object.extend
17273 *
17274 * @class
17275 *
17276 * <p>The fundamental unit of AV data, which implements the Backbone Model
17277 * interface.</p>
17278 */
17279 AV.Object = function (attributes, options) {
17280 // Allow new AV.Object("ClassName") as a shortcut to _create.
17281 if (_.isString(attributes)) {
17282 return AV.Object._create.apply(this, arguments);
17283 }
17284
17285 attributes = attributes || {};
17286
17287 if (options && options.parse) {
17288 attributes = this.parse(attributes);
17289 attributes = this._mergeMagicFields(attributes);
17290 }
17291
17292 var defaults = getValue(this, 'defaults');
17293
17294 if (defaults) {
17295 attributes = _.extend({}, defaults, attributes);
17296 }
17297
17298 if (options && options.collection) {
17299 this.collection = options.collection;
17300 }
17301
17302 this._serverData = {}; // The last known data for this object from cloud.
17303
17304 this._opSetQueue = [{}]; // List of sets of changes to the data.
17305
17306 this._flags = {};
17307 this.attributes = {}; // The best estimate of this's current data.
17308
17309 this._hashedJSON = {}; // Hash of values of containers at last save.
17310
17311 this._escapedAttributes = {};
17312 this.cid = _.uniqueId('c');
17313 this.changed = {};
17314 this._silent = {};
17315 this._pending = {};
17316 this.set(attributes, {
17317 silent: true
17318 });
17319 this.changed = {};
17320 this._silent = {};
17321 this._pending = {};
17322 this._hasData = true;
17323 this._previousAttributes = _.clone(this.attributes);
17324 this.initialize.apply(this, arguments);
17325 };
17326 /**
17327 * @lends AV.Object.prototype
17328 * @property {String} id The objectId of the AV Object.
17329 */
17330
17331 /**
17332 * Saves the given list of AV.Object.
17333 * If any error is encountered, stops and calls the error handler.
17334 *
17335 * @example
17336 * AV.Object.saveAll([object1, object2, ...]).then(function(list) {
17337 * // All the objects were saved.
17338 * }, function(error) {
17339 * // An error occurred while saving one of the objects.
17340 * });
17341 *
17342 * @param {Array} list A list of <code>AV.Object</code>.
17343 */
17344
17345
17346 AV.Object.saveAll = function (list, options) {
17347 return AV.Object._deepSaveAsync(list, null, options);
17348 };
17349 /**
17350 * Fetch the given list of AV.Object.
17351 *
17352 * @param {AV.Object[]} objects A list of <code>AV.Object</code>
17353 * @param {AuthOptions} options
17354 * @return {Promise.<AV.Object[]>} The given list of <code>AV.Object</code>, updated
17355 */
17356
17357
17358 AV.Object.fetchAll = function (objects, options) {
17359 return _promise.default.resolve().then(function () {
17360 return _request('batch', null, null, 'POST', {
17361 requests: (0, _map.default)(_).call(_, objects, function (object) {
17362 var _context;
17363
17364 if (!object.className) throw new Error('object must have className to fetch');
17365 if (!object.id) throw new Error('object must have id to fetch');
17366 if (object.dirty()) throw new Error('object is modified but not saved');
17367 return {
17368 method: 'GET',
17369 path: (0, _concat.default)(_context = "/1.1/classes/".concat(object.className, "/")).call(_context, object.id)
17370 };
17371 })
17372 }, options);
17373 }).then(function (response) {
17374 var results = (0, _map.default)(_).call(_, objects, function (object, i) {
17375 if (response[i].success) {
17376 var fetchedAttrs = object.parse(response[i].success);
17377
17378 object._cleanupUnsetKeys(fetchedAttrs);
17379
17380 object._finishFetch(fetchedAttrs);
17381
17382 return object;
17383 }
17384
17385 if (response[i].success === null) {
17386 return new AVError(AVError.OBJECT_NOT_FOUND, 'Object not found.');
17387 }
17388
17389 return new AVError(response[i].error.code, response[i].error.error);
17390 });
17391 return handleBatchResults(results);
17392 });
17393 }; // Attach all inheritable methods to the AV.Object prototype.
17394
17395
17396 _.extend(AV.Object.prototype, AV.Events,
17397 /** @lends AV.Object.prototype */
17398 {
17399 _fetchWhenSave: false,
17400
17401 /**
17402 * Initialize is an empty function by default. Override it with your own
17403 * initialization logic.
17404 */
17405 initialize: function initialize() {},
17406
17407 /**
17408 * Set whether to enable fetchWhenSave option when updating object.
17409 * When set true, SDK would fetch the latest object after saving.
17410 * Default is false.
17411 *
17412 * @deprecated use AV.Object#save with options.fetchWhenSave instead
17413 * @param {boolean} enable true to enable fetchWhenSave option.
17414 */
17415 fetchWhenSave: function fetchWhenSave(enable) {
17416 console.warn('AV.Object#fetchWhenSave is deprecated, use AV.Object#save with options.fetchWhenSave instead.');
17417
17418 if (!_.isBoolean(enable)) {
17419 throw new Error('Expect boolean value for fetchWhenSave');
17420 }
17421
17422 this._fetchWhenSave = enable;
17423 },
17424
17425 /**
17426 * Returns the object's objectId.
17427 * @return {String} the objectId.
17428 */
17429 getObjectId: function getObjectId() {
17430 return this.id;
17431 },
17432
17433 /**
17434 * Returns the object's createdAt attribute.
17435 * @return {Date}
17436 */
17437 getCreatedAt: function getCreatedAt() {
17438 return this.createdAt;
17439 },
17440
17441 /**
17442 * Returns the object's updatedAt attribute.
17443 * @return {Date}
17444 */
17445 getUpdatedAt: function getUpdatedAt() {
17446 return this.updatedAt;
17447 },
17448
17449 /**
17450 * Returns a JSON version of the object.
17451 * @return {Object}
17452 */
17453 toJSON: function toJSON(key, holder) {
17454 var seenObjects = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
17455 return this._toFullJSON(seenObjects, false);
17456 },
17457
17458 /**
17459 * Returns a JSON version of the object with meta data.
17460 * Inverse to {@link AV.parseJSON}
17461 * @since 3.0.0
17462 * @return {Object}
17463 */
17464 toFullJSON: function toFullJSON() {
17465 var seenObjects = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
17466 return this._toFullJSON(seenObjects);
17467 },
17468 _toFullJSON: function _toFullJSON(seenObjects) {
17469 var _this = this;
17470
17471 var full = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
17472
17473 var json = _.clone(this.attributes);
17474
17475 if (_.isArray(seenObjects)) {
17476 var newSeenObjects = (0, _concat.default)(seenObjects).call(seenObjects, this);
17477 }
17478
17479 AV._objectEach(json, function (val, key) {
17480 json[key] = AV._encode(val, newSeenObjects, undefined, full);
17481 });
17482
17483 AV._objectEach(this._operations, function (val, key) {
17484 json[key] = val;
17485 });
17486
17487 if (_.has(this, 'id')) {
17488 json.objectId = this.id;
17489 }
17490
17491 ['createdAt', 'updatedAt'].forEach(function (key) {
17492 if (_.has(_this, key)) {
17493 var val = _this[key];
17494 json[key] = _.isDate(val) ? val.toJSON() : val;
17495 }
17496 });
17497
17498 if (full) {
17499 json.__type = 'Object';
17500 if (_.isArray(seenObjects) && seenObjects.length) json.__type = 'Pointer';
17501 json.className = this.className;
17502 }
17503
17504 return json;
17505 },
17506
17507 /**
17508 * Updates _hashedJSON to reflect the current state of this object.
17509 * Adds any changed hash values to the set of pending changes.
17510 * @private
17511 */
17512 _refreshCache: function _refreshCache() {
17513 var self = this;
17514
17515 if (self._refreshingCache) {
17516 return;
17517 }
17518
17519 self._refreshingCache = true;
17520
17521 AV._objectEach(this.attributes, function (value, key) {
17522 if (value instanceof AV.Object) {
17523 value._refreshCache();
17524 } else if (_.isObject(value)) {
17525 if (self._resetCacheForKey(key)) {
17526 self.set(key, new AV.Op.Set(value), {
17527 silent: true
17528 });
17529 }
17530 }
17531 });
17532
17533 delete self._refreshingCache;
17534 },
17535
17536 /**
17537 * Returns true if this object has been modified since its last
17538 * save/refresh. If an attribute is specified, it returns true only if that
17539 * particular attribute has been modified since the last save/refresh.
17540 * @param {String} attr An attribute name (optional).
17541 * @return {Boolean}
17542 */
17543 dirty: function dirty(attr) {
17544 this._refreshCache();
17545
17546 var currentChanges = _.last(this._opSetQueue);
17547
17548 if (attr) {
17549 return currentChanges[attr] ? true : false;
17550 }
17551
17552 if (!this.id) {
17553 return true;
17554 }
17555
17556 if ((0, _keys2.default)(_).call(_, currentChanges).length > 0) {
17557 return true;
17558 }
17559
17560 return false;
17561 },
17562
17563 /**
17564 * Returns the keys of the modified attribute since its last save/refresh.
17565 * @return {String[]}
17566 */
17567 dirtyKeys: function dirtyKeys() {
17568 this._refreshCache();
17569
17570 var currentChanges = _.last(this._opSetQueue);
17571
17572 return (0, _keys2.default)(_).call(_, currentChanges);
17573 },
17574
17575 /**
17576 * Gets a Pointer referencing this Object.
17577 * @private
17578 */
17579 _toPointer: function _toPointer() {
17580 // if (!this.id) {
17581 // throw new Error("Can't serialize an unsaved AV.Object");
17582 // }
17583 return {
17584 __type: 'Pointer',
17585 className: this.className,
17586 objectId: this.id
17587 };
17588 },
17589
17590 /**
17591 * Gets the value of an attribute.
17592 * @param {String} attr The string name of an attribute.
17593 */
17594 get: function get(attr) {
17595 switch (attr) {
17596 case 'objectId':
17597 return this.id;
17598
17599 case 'createdAt':
17600 case 'updatedAt':
17601 return this[attr];
17602
17603 default:
17604 return this.attributes[attr];
17605 }
17606 },
17607
17608 /**
17609 * Gets a relation on the given class for the attribute.
17610 * @param {String} attr The attribute to get the relation for.
17611 * @return {AV.Relation}
17612 */
17613 relation: function relation(attr) {
17614 var value = this.get(attr);
17615
17616 if (value) {
17617 if (!(value instanceof AV.Relation)) {
17618 throw new Error('Called relation() on non-relation field ' + attr);
17619 }
17620
17621 value._ensureParentAndKey(this, attr);
17622
17623 return value;
17624 } else {
17625 return new AV.Relation(this, attr);
17626 }
17627 },
17628
17629 /**
17630 * Gets the HTML-escaped value of an attribute.
17631 */
17632 escape: function escape(attr) {
17633 var html = this._escapedAttributes[attr];
17634
17635 if (html) {
17636 return html;
17637 }
17638
17639 var val = this.attributes[attr];
17640 var escaped;
17641
17642 if (isNullOrUndefined(val)) {
17643 escaped = '';
17644 } else {
17645 escaped = _.escape(val.toString());
17646 }
17647
17648 this._escapedAttributes[attr] = escaped;
17649 return escaped;
17650 },
17651
17652 /**
17653 * Returns <code>true</code> if the attribute contains a value that is not
17654 * null or undefined.
17655 * @param {String} attr The string name of the attribute.
17656 * @return {Boolean}
17657 */
17658 has: function has(attr) {
17659 return !isNullOrUndefined(this.attributes[attr]);
17660 },
17661
17662 /**
17663 * Pulls "special" fields like objectId, createdAt, etc. out of attrs
17664 * and puts them on "this" directly. Removes them from attrs.
17665 * @param attrs - A dictionary with the data for this AV.Object.
17666 * @private
17667 */
17668 _mergeMagicFields: function _mergeMagicFields(attrs) {
17669 // Check for changes of magic fields.
17670 var model = this;
17671 var specialFields = ['objectId', 'createdAt', 'updatedAt'];
17672
17673 AV._arrayEach(specialFields, function (attr) {
17674 if (attrs[attr]) {
17675 if (attr === 'objectId') {
17676 model.id = attrs[attr];
17677 } else if ((attr === 'createdAt' || attr === 'updatedAt') && !_.isDate(attrs[attr])) {
17678 model[attr] = AV._parseDate(attrs[attr]);
17679 } else {
17680 model[attr] = attrs[attr];
17681 }
17682
17683 delete attrs[attr];
17684 }
17685 });
17686
17687 return attrs;
17688 },
17689
17690 /**
17691 * Returns the json to be sent to the server.
17692 * @private
17693 */
17694 _startSave: function _startSave() {
17695 this._opSetQueue.push({});
17696 },
17697
17698 /**
17699 * Called when a save fails because of an error. Any changes that were part
17700 * of the save need to be merged with changes made after the save. This
17701 * might throw an exception is you do conflicting operations. For example,
17702 * if you do:
17703 * object.set("foo", "bar");
17704 * object.set("invalid field name", "baz");
17705 * object.save();
17706 * object.increment("foo");
17707 * then this will throw when the save fails and the client tries to merge
17708 * "bar" with the +1.
17709 * @private
17710 */
17711 _cancelSave: function _cancelSave() {
17712 var failedChanges = _.first(this._opSetQueue);
17713
17714 this._opSetQueue = _.rest(this._opSetQueue);
17715
17716 var nextChanges = _.first(this._opSetQueue);
17717
17718 AV._objectEach(failedChanges, function (op, key) {
17719 var op1 = failedChanges[key];
17720 var op2 = nextChanges[key];
17721
17722 if (op1 && op2) {
17723 nextChanges[key] = op2._mergeWithPrevious(op1);
17724 } else if (op1) {
17725 nextChanges[key] = op1;
17726 }
17727 });
17728
17729 this._saving = this._saving - 1;
17730 },
17731
17732 /**
17733 * Called when a save completes successfully. This merges the changes that
17734 * were saved into the known server data, and overrides it with any data
17735 * sent directly from the server.
17736 * @private
17737 */
17738 _finishSave: function _finishSave(serverData) {
17739 var _context2;
17740
17741 // Grab a copy of any object referenced by this object. These instances
17742 // may have already been fetched, and we don't want to lose their data.
17743 // Note that doing it like this means we will unify separate copies of the
17744 // same object, but that's a risk we have to take.
17745 var fetchedObjects = {};
17746
17747 AV._traverse(this.attributes, function (object) {
17748 if (object instanceof AV.Object && object.id && object._hasData) {
17749 fetchedObjects[object.id] = object;
17750 }
17751 });
17752
17753 var savedChanges = _.first(this._opSetQueue);
17754
17755 this._opSetQueue = _.rest(this._opSetQueue);
17756
17757 this._applyOpSet(savedChanges, this._serverData);
17758
17759 this._mergeMagicFields(serverData);
17760
17761 var self = this;
17762
17763 AV._objectEach(serverData, function (value, key) {
17764 self._serverData[key] = AV._decode(value, key); // Look for any objects that might have become unfetched and fix them
17765 // by replacing their values with the previously observed values.
17766
17767 var fetched = AV._traverse(self._serverData[key], function (object) {
17768 if (object instanceof AV.Object && fetchedObjects[object.id]) {
17769 return fetchedObjects[object.id];
17770 }
17771 });
17772
17773 if (fetched) {
17774 self._serverData[key] = fetched;
17775 }
17776 });
17777
17778 this._rebuildAllEstimatedData();
17779
17780 var opSetQueue = (0, _map.default)(_context2 = this._opSetQueue).call(_context2, _.clone);
17781
17782 this._refreshCache();
17783
17784 this._opSetQueue = opSetQueue;
17785 this._saving = this._saving - 1;
17786 },
17787
17788 /**
17789 * Called when a fetch or login is complete to set the known server data to
17790 * the given object.
17791 * @private
17792 */
17793 _finishFetch: function _finishFetch(serverData, hasData) {
17794 // Clear out any changes the user might have made previously.
17795 this._opSetQueue = [{}]; // Bring in all the new server data.
17796
17797 this._mergeMagicFields(serverData);
17798
17799 var self = this;
17800
17801 AV._objectEach(serverData, function (value, key) {
17802 self._serverData[key] = AV._decode(value, key);
17803 }); // Refresh the attributes.
17804
17805
17806 this._rebuildAllEstimatedData(); // Clear out the cache of mutable containers.
17807
17808
17809 this._refreshCache();
17810
17811 this._opSetQueue = [{}];
17812 this._hasData = hasData;
17813 },
17814
17815 /**
17816 * Applies the set of AV.Op in opSet to the object target.
17817 * @private
17818 */
17819 _applyOpSet: function _applyOpSet(opSet, target) {
17820 var self = this;
17821
17822 AV._objectEach(opSet, function (change, key) {
17823 var _findValue = findValue(target, key),
17824 _findValue2 = (0, _slicedToArray2.default)(_findValue, 3),
17825 value = _findValue2[0],
17826 actualTarget = _findValue2[1],
17827 actualKey = _findValue2[2];
17828
17829 setValue(target, key, change._estimate(value, self, key));
17830
17831 if (actualTarget && actualTarget[actualKey] === AV.Op._UNSET) {
17832 delete actualTarget[actualKey];
17833 }
17834 });
17835 },
17836
17837 /**
17838 * Replaces the cached value for key with the current value.
17839 * Returns true if the new value is different than the old value.
17840 * @private
17841 */
17842 _resetCacheForKey: function _resetCacheForKey(key) {
17843 var value = this.attributes[key];
17844
17845 if (_.isObject(value) && !(value instanceof AV.Object) && !(value instanceof AV.File)) {
17846 var json = (0, _stringify.default)(recursiveToPointer(value));
17847
17848 if (this._hashedJSON[key] !== json) {
17849 var wasSet = !!this._hashedJSON[key];
17850 this._hashedJSON[key] = json;
17851 return wasSet;
17852 }
17853 }
17854
17855 return false;
17856 },
17857
17858 /**
17859 * Populates attributes[key] by starting with the last known data from the
17860 * server, and applying all of the local changes that have been made to that
17861 * key since then.
17862 * @private
17863 */
17864 _rebuildEstimatedDataForKey: function _rebuildEstimatedDataForKey(key) {
17865 var self = this;
17866 delete this.attributes[key];
17867
17868 if (this._serverData[key]) {
17869 this.attributes[key] = this._serverData[key];
17870 }
17871
17872 AV._arrayEach(this._opSetQueue, function (opSet) {
17873 var op = opSet[key];
17874
17875 if (op) {
17876 var _findValue3 = findValue(self.attributes, key),
17877 _findValue4 = (0, _slicedToArray2.default)(_findValue3, 4),
17878 value = _findValue4[0],
17879 actualTarget = _findValue4[1],
17880 actualKey = _findValue4[2],
17881 firstKey = _findValue4[3];
17882
17883 setValue(self.attributes, key, op._estimate(value, self, key));
17884
17885 if (actualTarget && actualTarget[actualKey] === AV.Op._UNSET) {
17886 delete actualTarget[actualKey];
17887 }
17888
17889 self._resetCacheForKey(firstKey);
17890 }
17891 });
17892 },
17893
17894 /**
17895 * Populates attributes by starting with the last known data from the
17896 * server, and applying all of the local changes that have been made since
17897 * then.
17898 * @private
17899 */
17900 _rebuildAllEstimatedData: function _rebuildAllEstimatedData() {
17901 var self = this;
17902
17903 var previousAttributes = _.clone(this.attributes);
17904
17905 this.attributes = _.clone(this._serverData);
17906
17907 AV._arrayEach(this._opSetQueue, function (opSet) {
17908 self._applyOpSet(opSet, self.attributes);
17909
17910 AV._objectEach(opSet, function (op, key) {
17911 self._resetCacheForKey(key);
17912 });
17913 }); // Trigger change events for anything that changed because of the fetch.
17914
17915
17916 AV._objectEach(previousAttributes, function (oldValue, key) {
17917 if (self.attributes[key] !== oldValue) {
17918 self.trigger('change:' + key, self, self.attributes[key], {});
17919 }
17920 });
17921
17922 AV._objectEach(this.attributes, function (newValue, key) {
17923 if (!_.has(previousAttributes, key)) {
17924 self.trigger('change:' + key, self, newValue, {});
17925 }
17926 });
17927 },
17928
17929 /**
17930 * Sets a hash of model attributes on the object, firing
17931 * <code>"change"</code> unless you choose to silence it.
17932 *
17933 * <p>You can call it with an object containing keys and values, or with one
17934 * key and value. For example:</p>
17935 *
17936 * @example
17937 * gameTurn.set({
17938 * player: player1,
17939 * diceRoll: 2
17940 * });
17941 *
17942 * game.set("currentPlayer", player2);
17943 *
17944 * game.set("finished", true);
17945 *
17946 * @param {String} key The key to set.
17947 * @param {Any} value The value to give it.
17948 * @param {Object} [options]
17949 * @param {Boolean} [options.silent]
17950 * @return {AV.Object} self if succeeded, throws if the value is not valid.
17951 * @see AV.Object#validate
17952 */
17953 set: function set(key, value, options) {
17954 var attrs;
17955
17956 if (_.isObject(key) || isNullOrUndefined(key)) {
17957 attrs = _.mapObject(key, function (v, k) {
17958 checkReservedKey(k);
17959 return AV._decode(v, k);
17960 });
17961 options = value;
17962 } else {
17963 attrs = {};
17964 checkReservedKey(key);
17965 attrs[key] = AV._decode(value, key);
17966 } // Extract attributes and options.
17967
17968
17969 options = options || {};
17970
17971 if (!attrs) {
17972 return this;
17973 }
17974
17975 if (attrs instanceof AV.Object) {
17976 attrs = attrs.attributes;
17977 } // If the unset option is used, every attribute should be a Unset.
17978
17979
17980 if (options.unset) {
17981 AV._objectEach(attrs, function (unused_value, key) {
17982 attrs[key] = new AV.Op.Unset();
17983 });
17984 } // Apply all the attributes to get the estimated values.
17985
17986
17987 var dataToValidate = _.clone(attrs);
17988
17989 var self = this;
17990
17991 AV._objectEach(dataToValidate, function (value, key) {
17992 if (value instanceof AV.Op) {
17993 dataToValidate[key] = value._estimate(self.attributes[key], self, key);
17994
17995 if (dataToValidate[key] === AV.Op._UNSET) {
17996 delete dataToValidate[key];
17997 }
17998 }
17999 }); // Run validation.
18000
18001
18002 this._validate(attrs, options);
18003
18004 options.changes = {};
18005 var escaped = this._escapedAttributes; // Update attributes.
18006
18007 AV._arrayEach((0, _keys2.default)(_).call(_, attrs), function (attr) {
18008 var val = attrs[attr]; // If this is a relation object we need to set the parent correctly,
18009 // since the location where it was parsed does not have access to
18010 // this object.
18011
18012 if (val instanceof AV.Relation) {
18013 val.parent = self;
18014 }
18015
18016 if (!(val instanceof AV.Op)) {
18017 val = new AV.Op.Set(val);
18018 } // See if this change will actually have any effect.
18019
18020
18021 var isRealChange = true;
18022
18023 if (val instanceof AV.Op.Set && _.isEqual(self.attributes[attr], val.value)) {
18024 isRealChange = false;
18025 }
18026
18027 if (isRealChange) {
18028 delete escaped[attr];
18029
18030 if (options.silent) {
18031 self._silent[attr] = true;
18032 } else {
18033 options.changes[attr] = true;
18034 }
18035 }
18036
18037 var currentChanges = _.last(self._opSetQueue);
18038
18039 currentChanges[attr] = val._mergeWithPrevious(currentChanges[attr]);
18040
18041 self._rebuildEstimatedDataForKey(attr);
18042
18043 if (isRealChange) {
18044 self.changed[attr] = self.attributes[attr];
18045
18046 if (!options.silent) {
18047 self._pending[attr] = true;
18048 }
18049 } else {
18050 delete self.changed[attr];
18051 delete self._pending[attr];
18052 }
18053 });
18054
18055 if (!options.silent) {
18056 this.change(options);
18057 }
18058
18059 return this;
18060 },
18061
18062 /**
18063 * Remove an attribute from the model, firing <code>"change"</code> unless
18064 * you choose to silence it. This is a noop if the attribute doesn't
18065 * exist.
18066 * @param key {String} The key.
18067 */
18068 unset: function unset(attr, options) {
18069 options = options || {};
18070 options.unset = true;
18071 return this.set(attr, null, options);
18072 },
18073
18074 /**
18075 * Atomically increments the value of the given attribute the next time the
18076 * object is saved. If no amount is specified, 1 is used by default.
18077 *
18078 * @param key {String} The key.
18079 * @param amount {Number} The amount to increment by.
18080 */
18081 increment: function increment(attr, amount) {
18082 if (_.isUndefined(amount) || _.isNull(amount)) {
18083 amount = 1;
18084 }
18085
18086 return this.set(attr, new AV.Op.Increment(amount));
18087 },
18088
18089 /**
18090 * Atomically add an object to the end of the array associated with a given
18091 * key.
18092 * @param key {String} The key.
18093 * @param item {} The item to add.
18094 */
18095 add: function add(attr, item) {
18096 return this.set(attr, new AV.Op.Add(ensureArray(item)));
18097 },
18098
18099 /**
18100 * Atomically add an object to the array associated with a given key, only
18101 * if it is not already present in the array. The position of the insert is
18102 * not guaranteed.
18103 *
18104 * @param key {String} The key.
18105 * @param item {} The object to add.
18106 */
18107 addUnique: function addUnique(attr, item) {
18108 return this.set(attr, new AV.Op.AddUnique(ensureArray(item)));
18109 },
18110
18111 /**
18112 * Atomically remove all instances of an object from the array associated
18113 * with a given key.
18114 *
18115 * @param key {String} The key.
18116 * @param item {} The object to remove.
18117 */
18118 remove: function remove(attr, item) {
18119 return this.set(attr, new AV.Op.Remove(ensureArray(item)));
18120 },
18121
18122 /**
18123 * Atomically apply a "bit and" operation on the value associated with a
18124 * given key.
18125 *
18126 * @param key {String} The key.
18127 * @param value {Number} The value to apply.
18128 */
18129 bitAnd: function bitAnd(attr, value) {
18130 return this.set(attr, new AV.Op.BitAnd(value));
18131 },
18132
18133 /**
18134 * Atomically apply a "bit or" operation on the value associated with a
18135 * given key.
18136 *
18137 * @param key {String} The key.
18138 * @param value {Number} The value to apply.
18139 */
18140 bitOr: function bitOr(attr, value) {
18141 return this.set(attr, new AV.Op.BitOr(value));
18142 },
18143
18144 /**
18145 * Atomically apply a "bit xor" operation on the value associated with a
18146 * given key.
18147 *
18148 * @param key {String} The key.
18149 * @param value {Number} The value to apply.
18150 */
18151 bitXor: function bitXor(attr, value) {
18152 return this.set(attr, new AV.Op.BitXor(value));
18153 },
18154
18155 /**
18156 * Returns an instance of a subclass of AV.Op describing what kind of
18157 * modification has been performed on this field since the last time it was
18158 * saved. For example, after calling object.increment("x"), calling
18159 * object.op("x") would return an instance of AV.Op.Increment.
18160 *
18161 * @param key {String} The key.
18162 * @returns {AV.Op} The operation, or undefined if none.
18163 */
18164 op: function op(attr) {
18165 return _.last(this._opSetQueue)[attr];
18166 },
18167
18168 /**
18169 * Clear all attributes on the model, firing <code>"change"</code> unless
18170 * you choose to silence it.
18171 */
18172 clear: function clear(options) {
18173 options = options || {};
18174 options.unset = true;
18175
18176 var keysToClear = _.extend(this.attributes, this._operations);
18177
18178 return this.set(keysToClear, options);
18179 },
18180
18181 /**
18182 * Clears any (or specific) changes to the model made since the last save.
18183 * @param {string|string[]} [keys] specify keys to revert.
18184 */
18185 revert: function revert(keys) {
18186 var lastOp = _.last(this._opSetQueue);
18187
18188 var _keys = ensureArray(keys || (0, _keys2.default)(_).call(_, lastOp));
18189
18190 _keys.forEach(function (key) {
18191 delete lastOp[key];
18192 });
18193
18194 this._rebuildAllEstimatedData();
18195
18196 return this;
18197 },
18198
18199 /**
18200 * Returns a JSON-encoded set of operations to be sent with the next save
18201 * request.
18202 * @private
18203 */
18204 _getSaveJSON: function _getSaveJSON() {
18205 var json = _.clone(_.first(this._opSetQueue));
18206
18207 AV._objectEach(json, function (op, key) {
18208 json[key] = op.toJSON();
18209 });
18210
18211 return json;
18212 },
18213
18214 /**
18215 * Returns true if this object can be serialized for saving.
18216 * @private
18217 */
18218 _canBeSerialized: function _canBeSerialized() {
18219 return AV.Object._canBeSerializedAsValue(this.attributes);
18220 },
18221
18222 /**
18223 * Fetch the model from the server. If the server's representation of the
18224 * model differs from its current attributes, they will be overriden,
18225 * triggering a <code>"change"</code> event.
18226 * @param {Object} fetchOptions Optional options to set 'keys',
18227 * 'include' and 'includeACL' option.
18228 * @param {AuthOptions} options
18229 * @return {Promise} A promise that is fulfilled when the fetch
18230 * completes.
18231 */
18232 fetch: function fetch() {
18233 var fetchOptions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
18234 var options = arguments.length > 1 ? arguments[1] : undefined;
18235
18236 if (!this.id) {
18237 throw new Error('Cannot fetch unsaved object');
18238 }
18239
18240 var self = this;
18241
18242 var request = _request('classes', this.className, this.id, 'GET', transformFetchOptions(fetchOptions), options);
18243
18244 return request.then(function (response) {
18245 var fetchedAttrs = self.parse(response);
18246
18247 self._cleanupUnsetKeys(fetchedAttrs, (0, _keys2.default)(fetchOptions) ? ensureArray((0, _keys2.default)(fetchOptions)).join(',').split(',') : undefined);
18248
18249 self._finishFetch(fetchedAttrs, true);
18250
18251 return self;
18252 });
18253 },
18254 _cleanupUnsetKeys: function _cleanupUnsetKeys(fetchedAttrs) {
18255 var _this2 = this;
18256
18257 var fetchedKeys = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : (0, _keys2.default)(_).call(_, this._serverData);
18258
18259 _.forEach(fetchedKeys, function (key) {
18260 if (fetchedAttrs[key] === undefined) delete _this2._serverData[key];
18261 });
18262 },
18263
18264 /**
18265 * Set a hash of model attributes, and save the model to the server.
18266 * updatedAt will be updated when the request returns.
18267 * You can either call it as:<pre>
18268 * object.save();</pre>
18269 * or<pre>
18270 * object.save(null, options);</pre>
18271 * or<pre>
18272 * object.save(attrs, options);</pre>
18273 * or<pre>
18274 * object.save(key, value, options);</pre>
18275 *
18276 * @example
18277 * gameTurn.save({
18278 * player: "Jake Cutter",
18279 * diceRoll: 2
18280 * }).then(function(gameTurnAgain) {
18281 * // The save was successful.
18282 * }, function(error) {
18283 * // The save failed. Error is an instance of AVError.
18284 * });
18285 *
18286 * @param {AuthOptions} options AuthOptions plus:
18287 * @param {Boolean} options.fetchWhenSave fetch and update object after save succeeded
18288 * @param {AV.Query} options.query Save object only when it matches the query
18289 * @return {Promise} A promise that is fulfilled when the save
18290 * completes.
18291 * @see AVError
18292 */
18293 save: function save(arg1, arg2, arg3) {
18294 var attrs, current, options;
18295
18296 if (_.isObject(arg1) || isNullOrUndefined(arg1)) {
18297 attrs = arg1;
18298 options = arg2;
18299 } else {
18300 attrs = {};
18301 attrs[arg1] = arg2;
18302 options = arg3;
18303 }
18304
18305 options = _.clone(options) || {};
18306
18307 if (options.wait) {
18308 current = _.clone(this.attributes);
18309 }
18310
18311 var setOptions = _.clone(options) || {};
18312
18313 if (setOptions.wait) {
18314 setOptions.silent = true;
18315 }
18316
18317 if (attrs) {
18318 this.set(attrs, setOptions);
18319 }
18320
18321 var model = this;
18322 var unsavedChildren = [];
18323 var unsavedFiles = [];
18324
18325 AV.Object._findUnsavedChildren(model, unsavedChildren, unsavedFiles);
18326
18327 if (unsavedChildren.length + unsavedFiles.length > 1) {
18328 return AV.Object._deepSaveAsync(this, model, options);
18329 }
18330
18331 this._startSave();
18332
18333 this._saving = (this._saving || 0) + 1;
18334 this._allPreviousSaves = this._allPreviousSaves || _promise.default.resolve();
18335 this._allPreviousSaves = this._allPreviousSaves.catch(function (e) {}).then(function () {
18336 var method = model.id ? 'PUT' : 'POST';
18337
18338 var json = model._getSaveJSON();
18339
18340 var query = {};
18341
18342 if (model._fetchWhenSave || options.fetchWhenSave) {
18343 query['new'] = 'true';
18344 } // user login option
18345
18346
18347 if (options._failOnNotExist) {
18348 query.failOnNotExist = 'true';
18349 }
18350
18351 if (options.query) {
18352 var queryParams;
18353
18354 if (typeof options.query._getParams === 'function') {
18355 queryParams = options.query._getParams();
18356
18357 if (queryParams) {
18358 query.where = queryParams.where;
18359 }
18360 }
18361
18362 if (!query.where) {
18363 var error = new Error('options.query is not an AV.Query');
18364 throw error;
18365 }
18366 }
18367
18368 _.extend(json, model._flags);
18369
18370 var route = 'classes';
18371 var className = model.className;
18372
18373 if (model.className === '_User' && !model.id) {
18374 // Special-case user sign-up.
18375 route = 'users';
18376 className = null;
18377 } //hook makeRequest in options.
18378
18379
18380 var makeRequest = options._makeRequest || _request;
18381 var requestPromise = makeRequest(route, className, model.id, method, json, options, query);
18382 requestPromise = requestPromise.then(function (resp) {
18383 var serverAttrs = model.parse(resp);
18384
18385 if (options.wait) {
18386 serverAttrs = _.extend(attrs || {}, serverAttrs);
18387 }
18388
18389 model._finishSave(serverAttrs);
18390
18391 if (options.wait) {
18392 model.set(current, setOptions);
18393 }
18394
18395 return model;
18396 }, function (error) {
18397 model._cancelSave();
18398
18399 throw error;
18400 });
18401 return requestPromise;
18402 });
18403 return this._allPreviousSaves;
18404 },
18405
18406 /**
18407 * Destroy this model on the server if it was already persisted.
18408 * Optimistically removes the model from its collection, if it has one.
18409 * @param {AuthOptions} options AuthOptions plus:
18410 * @param {Boolean} [options.wait] wait for the server to respond
18411 * before removal.
18412 *
18413 * @return {Promise} A promise that is fulfilled when the destroy
18414 * completes.
18415 */
18416 destroy: function destroy(options) {
18417 options = options || {};
18418 var model = this;
18419
18420 var triggerDestroy = function triggerDestroy() {
18421 model.trigger('destroy', model, model.collection, options);
18422 };
18423
18424 if (!this.id) {
18425 return triggerDestroy();
18426 }
18427
18428 if (!options.wait) {
18429 triggerDestroy();
18430 }
18431
18432 var request = _request('classes', this.className, this.id, 'DELETE', this._flags, options);
18433
18434 return request.then(function () {
18435 if (options.wait) {
18436 triggerDestroy();
18437 }
18438
18439 return model;
18440 });
18441 },
18442
18443 /**
18444 * Converts a response into the hash of attributes to be set on the model.
18445 * @ignore
18446 */
18447 parse: function parse(resp) {
18448 var output = _.clone(resp);
18449
18450 ['createdAt', 'updatedAt'].forEach(function (key) {
18451 if (output[key]) {
18452 output[key] = AV._parseDate(output[key]);
18453 }
18454 });
18455
18456 if (output.createdAt && !output.updatedAt) {
18457 output.updatedAt = output.createdAt;
18458 }
18459
18460 return output;
18461 },
18462
18463 /**
18464 * Creates a new model with identical attributes to this one.
18465 * @return {AV.Object}
18466 */
18467 clone: function clone() {
18468 return new this.constructor(this.attributes);
18469 },
18470
18471 /**
18472 * Returns true if this object has never been saved to AV.
18473 * @return {Boolean}
18474 */
18475 isNew: function isNew() {
18476 return !this.id;
18477 },
18478
18479 /**
18480 * Call this method to manually fire a `"change"` event for this model and
18481 * a `"change:attribute"` event for each changed attribute.
18482 * Calling this will cause all objects observing the model to update.
18483 */
18484 change: function change(options) {
18485 options = options || {};
18486 var changing = this._changing;
18487 this._changing = true; // Silent changes become pending changes.
18488
18489 var self = this;
18490
18491 AV._objectEach(this._silent, function (attr) {
18492 self._pending[attr] = true;
18493 }); // Silent changes are triggered.
18494
18495
18496 var changes = _.extend({}, options.changes, this._silent);
18497
18498 this._silent = {};
18499
18500 AV._objectEach(changes, function (unused_value, attr) {
18501 self.trigger('change:' + attr, self, self.get(attr), options);
18502 });
18503
18504 if (changing) {
18505 return this;
18506 } // This is to get around lint not letting us make a function in a loop.
18507
18508
18509 var deleteChanged = function deleteChanged(value, attr) {
18510 if (!self._pending[attr] && !self._silent[attr]) {
18511 delete self.changed[attr];
18512 }
18513 }; // Continue firing `"change"` events while there are pending changes.
18514
18515
18516 while (!_.isEmpty(this._pending)) {
18517 this._pending = {};
18518 this.trigger('change', this, options); // Pending and silent changes still remain.
18519
18520 AV._objectEach(this.changed, deleteChanged);
18521
18522 self._previousAttributes = _.clone(this.attributes);
18523 }
18524
18525 this._changing = false;
18526 return this;
18527 },
18528
18529 /**
18530 * Gets the previous value of an attribute, recorded at the time the last
18531 * <code>"change"</code> event was fired.
18532 * @param {String} attr Name of the attribute to get.
18533 */
18534 previous: function previous(attr) {
18535 if (!arguments.length || !this._previousAttributes) {
18536 return null;
18537 }
18538
18539 return this._previousAttributes[attr];
18540 },
18541
18542 /**
18543 * Gets all of the attributes of the model at the time of the previous
18544 * <code>"change"</code> event.
18545 * @return {Object}
18546 */
18547 previousAttributes: function previousAttributes() {
18548 return _.clone(this._previousAttributes);
18549 },
18550
18551 /**
18552 * Checks if the model is currently in a valid state. It's only possible to
18553 * get into an *invalid* state if you're using silent changes.
18554 * @return {Boolean}
18555 */
18556 isValid: function isValid() {
18557 try {
18558 this.validate(this.attributes);
18559 } catch (error) {
18560 return false;
18561 }
18562
18563 return true;
18564 },
18565
18566 /**
18567 * You should not call this function directly unless you subclass
18568 * <code>AV.Object</code>, in which case you can override this method
18569 * to provide additional validation on <code>set</code> and
18570 * <code>save</code>. Your implementation should throw an Error if
18571 * the attrs is invalid
18572 *
18573 * @param {Object} attrs The current data to validate.
18574 * @see AV.Object#set
18575 */
18576 validate: function validate(attrs) {
18577 if (_.has(attrs, 'ACL') && !(attrs.ACL instanceof AV.ACL)) {
18578 throw new AVError(AVError.OTHER_CAUSE, 'ACL must be a AV.ACL.');
18579 }
18580 },
18581
18582 /**
18583 * Run validation against a set of incoming attributes, returning `true`
18584 * if all is well. If a specific `error` callback has been passed,
18585 * call that instead of firing the general `"error"` event.
18586 * @private
18587 */
18588 _validate: function _validate(attrs, options) {
18589 if (options.silent || !this.validate) {
18590 return;
18591 }
18592
18593 attrs = _.extend({}, this.attributes, attrs);
18594 this.validate(attrs);
18595 },
18596
18597 /**
18598 * Returns the ACL for this object.
18599 * @returns {AV.ACL} An instance of AV.ACL.
18600 * @see AV.Object#get
18601 */
18602 getACL: function getACL() {
18603 return this.get('ACL');
18604 },
18605
18606 /**
18607 * Sets the ACL to be used for this object.
18608 * @param {AV.ACL} acl An instance of AV.ACL.
18609 * @param {Object} options Optional Backbone-like options object to be
18610 * passed in to set.
18611 * @return {AV.Object} self
18612 * @see AV.Object#set
18613 */
18614 setACL: function setACL(acl, options) {
18615 return this.set('ACL', acl, options);
18616 },
18617 disableBeforeHook: function disableBeforeHook() {
18618 this.ignoreHook('beforeSave');
18619 this.ignoreHook('beforeUpdate');
18620 this.ignoreHook('beforeDelete');
18621 },
18622 disableAfterHook: function disableAfterHook() {
18623 this.ignoreHook('afterSave');
18624 this.ignoreHook('afterUpdate');
18625 this.ignoreHook('afterDelete');
18626 },
18627 ignoreHook: function ignoreHook(hookName) {
18628 if (!_.contains(['beforeSave', 'afterSave', 'beforeUpdate', 'afterUpdate', 'beforeDelete', 'afterDelete'], hookName)) {
18629 throw new Error('Unsupported hookName: ' + hookName);
18630 }
18631
18632 if (!AV.hookKey) {
18633 throw new Error('ignoreHook required hookKey');
18634 }
18635
18636 if (!this._flags.__ignore_hooks) {
18637 this._flags.__ignore_hooks = [];
18638 }
18639
18640 this._flags.__ignore_hooks.push(hookName);
18641 }
18642 });
18643 /**
18644 * Creates an instance of a subclass of AV.Object for the give classname
18645 * and id.
18646 * @param {String|Function} class the className or a subclass of AV.Object.
18647 * @param {String} id The object id of this model.
18648 * @return {AV.Object} A new subclass instance of AV.Object.
18649 */
18650
18651
18652 AV.Object.createWithoutData = function (klass, id, hasData) {
18653 var _klass;
18654
18655 if (_.isString(klass)) {
18656 _klass = AV.Object._getSubclass(klass);
18657 } else if (klass.prototype && klass.prototype instanceof AV.Object) {
18658 _klass = klass;
18659 } else {
18660 throw new Error('class must be a string or a subclass of AV.Object.');
18661 }
18662
18663 if (!id) {
18664 throw new TypeError('The objectId must be provided');
18665 }
18666
18667 var object = new _klass();
18668 object.id = id;
18669 object._hasData = hasData;
18670 return object;
18671 };
18672 /**
18673 * Delete objects in batch.
18674 * @param {AV.Object[]} objects The <code>AV.Object</code> array to be deleted.
18675 * @param {AuthOptions} options
18676 * @return {Promise} A promise that is fulfilled when the save
18677 * completes.
18678 */
18679
18680
18681 AV.Object.destroyAll = function (objects) {
18682 var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
18683
18684 if (!objects || objects.length === 0) {
18685 return _promise.default.resolve();
18686 }
18687
18688 var objectsByClassNameAndFlags = _.groupBy(objects, function (object) {
18689 return (0, _stringify.default)({
18690 className: object.className,
18691 flags: object._flags
18692 });
18693 });
18694
18695 var body = {
18696 requests: (0, _map.default)(_).call(_, objectsByClassNameAndFlags, function (objects) {
18697 var _context3;
18698
18699 var ids = (0, _map.default)(_).call(_, objects, 'id').join(',');
18700 return {
18701 method: 'DELETE',
18702 path: (0, _concat.default)(_context3 = "/1.1/classes/".concat(objects[0].className, "/")).call(_context3, ids),
18703 body: objects[0]._flags
18704 };
18705 })
18706 };
18707 return _request('batch', null, null, 'POST', body, options).then(function (response) {
18708 var firstError = (0, _find.default)(_).call(_, response, function (result) {
18709 return !result.success;
18710 });
18711 if (firstError) throw new AVError(firstError.error.code, firstError.error.error);
18712 return undefined;
18713 });
18714 };
18715 /**
18716 * Returns the appropriate subclass for making new instances of the given
18717 * className string.
18718 * @private
18719 */
18720
18721
18722 AV.Object._getSubclass = function (className) {
18723 if (!_.isString(className)) {
18724 throw new Error('AV.Object._getSubclass requires a string argument.');
18725 }
18726
18727 var ObjectClass = AV.Object._classMap[className];
18728
18729 if (!ObjectClass) {
18730 ObjectClass = AV.Object.extend(className);
18731 AV.Object._classMap[className] = ObjectClass;
18732 }
18733
18734 return ObjectClass;
18735 };
18736 /**
18737 * Creates an instance of a subclass of AV.Object for the given classname.
18738 * @private
18739 */
18740
18741
18742 AV.Object._create = function (className, attributes, options) {
18743 var ObjectClass = AV.Object._getSubclass(className);
18744
18745 return new ObjectClass(attributes, options);
18746 }; // Set up a map of className to class so that we can create new instances of
18747 // AV Objects from JSON automatically.
18748
18749
18750 AV.Object._classMap = {};
18751 AV.Object._extend = AV._extend;
18752 /**
18753 * Creates a new model with defined attributes,
18754 * It's the same with
18755 * <pre>
18756 * new AV.Object(attributes, options);
18757 * </pre>
18758 * @param {Object} attributes The initial set of data to store in the object.
18759 * @param {Object} options A set of Backbone-like options for creating the
18760 * object. The only option currently supported is "collection".
18761 * @return {AV.Object}
18762 * @since v0.4.4
18763 * @see AV.Object
18764 * @see AV.Object.extend
18765 */
18766
18767 AV.Object['new'] = function (attributes, options) {
18768 return new AV.Object(attributes, options);
18769 };
18770 /**
18771 * Creates a new subclass of AV.Object for the given AV class name.
18772 *
18773 * <p>Every extension of a AV class will inherit from the most recent
18774 * previous extension of that class. When a AV.Object is automatically
18775 * created by parsing JSON, it will use the most recent extension of that
18776 * class.</p>
18777 *
18778 * @example
18779 * var MyClass = AV.Object.extend("MyClass", {
18780 * // Instance properties
18781 * }, {
18782 * // Class properties
18783 * });
18784 *
18785 * @param {String} className The name of the AV class backing this model.
18786 * @param {Object} protoProps Instance properties to add to instances of the
18787 * class returned from this method.
18788 * @param {Object} classProps Class properties to add the class returned from
18789 * this method.
18790 * @return {Class} A new subclass of AV.Object.
18791 */
18792
18793
18794 AV.Object.extend = function (className, protoProps, classProps) {
18795 // Handle the case with only two args.
18796 if (!_.isString(className)) {
18797 if (className && _.has(className, 'className')) {
18798 return AV.Object.extend(className.className, className, protoProps);
18799 } else {
18800 throw new Error("AV.Object.extend's first argument should be the className.");
18801 }
18802 } // If someone tries to subclass "User", coerce it to the right type.
18803
18804
18805 if (className === 'User') {
18806 className = '_User';
18807 }
18808
18809 var NewClassObject = null;
18810
18811 if (_.has(AV.Object._classMap, className)) {
18812 var OldClassObject = AV.Object._classMap[className]; // This new subclass has been told to extend both from "this" and from
18813 // OldClassObject. This is multiple inheritance, which isn't supported.
18814 // For now, let's just pick one.
18815
18816 if (protoProps || classProps) {
18817 NewClassObject = OldClassObject._extend(protoProps, classProps);
18818 } else {
18819 return OldClassObject;
18820 }
18821 } else {
18822 protoProps = protoProps || {};
18823 protoProps._className = className;
18824 NewClassObject = this._extend(protoProps, classProps);
18825 } // Extending a subclass should reuse the classname automatically.
18826
18827
18828 NewClassObject.extend = function (arg0) {
18829 var _context4;
18830
18831 if (_.isString(arg0) || arg0 && _.has(arg0, 'className')) {
18832 return AV.Object.extend.apply(NewClassObject, arguments);
18833 }
18834
18835 var newArguments = (0, _concat.default)(_context4 = [className]).call(_context4, _.toArray(arguments));
18836 return AV.Object.extend.apply(NewClassObject, newArguments);
18837 }; // Add the query property descriptor.
18838
18839
18840 (0, _defineProperty.default)(NewClassObject, 'query', (0, _getOwnPropertyDescriptor.default)(AV.Object, 'query'));
18841
18842 NewClassObject['new'] = function (attributes, options) {
18843 return new NewClassObject(attributes, options);
18844 };
18845
18846 AV.Object._classMap[className] = NewClassObject;
18847 return NewClassObject;
18848 }; // ES6 class syntax support
18849
18850
18851 (0, _defineProperty.default)(AV.Object.prototype, 'className', {
18852 get: function get() {
18853 var className = this._className || this.constructor._LCClassName || this.constructor.name; // If someone tries to subclass "User", coerce it to the right type.
18854
18855 if (className === 'User') {
18856 return '_User';
18857 }
18858
18859 return className;
18860 }
18861 });
18862 /**
18863 * Register a class.
18864 * If a subclass of <code>AV.Object</code> is defined with your own implement
18865 * rather then <code>AV.Object.extend</code>, the subclass must be registered.
18866 * @param {Function} klass A subclass of <code>AV.Object</code>
18867 * @param {String} [name] Specify the name of the class. Useful when the class might be uglified.
18868 * @example
18869 * class Person extend AV.Object {}
18870 * AV.Object.register(Person);
18871 */
18872
18873 AV.Object.register = function (klass, name) {
18874 if (!(klass.prototype instanceof AV.Object)) {
18875 throw new Error('registered class is not a subclass of AV.Object');
18876 }
18877
18878 var className = name || klass.name;
18879
18880 if (!className.length) {
18881 throw new Error('registered class must be named');
18882 }
18883
18884 if (name) {
18885 klass._LCClassName = name;
18886 }
18887
18888 AV.Object._classMap[className] = klass;
18889 };
18890 /**
18891 * Get a new Query of the current class
18892 * @name query
18893 * @memberof AV.Object
18894 * @type AV.Query
18895 * @readonly
18896 * @since v3.1.0
18897 * @example
18898 * const Post = AV.Object.extend('Post');
18899 * Post.query.equalTo('author', 'leancloud').find().then();
18900 */
18901
18902
18903 (0, _defineProperty.default)(AV.Object, 'query', {
18904 get: function get() {
18905 return new AV.Query(this.prototype.className);
18906 }
18907 });
18908
18909 AV.Object._findUnsavedChildren = function (objects, children, files) {
18910 AV._traverse(objects, function (object) {
18911 if (object instanceof AV.Object) {
18912 if (object.dirty()) {
18913 children.push(object);
18914 }
18915
18916 return;
18917 }
18918
18919 if (object instanceof AV.File) {
18920 if (!object.id) {
18921 files.push(object);
18922 }
18923
18924 return;
18925 }
18926 });
18927 };
18928
18929 AV.Object._canBeSerializedAsValue = function (object) {
18930 var canBeSerializedAsValue = true;
18931
18932 if (object instanceof AV.Object || object instanceof AV.File) {
18933 canBeSerializedAsValue = !!object.id;
18934 } else if (_.isArray(object)) {
18935 AV._arrayEach(object, function (child) {
18936 if (!AV.Object._canBeSerializedAsValue(child)) {
18937 canBeSerializedAsValue = false;
18938 }
18939 });
18940 } else if (_.isObject(object)) {
18941 AV._objectEach(object, function (child) {
18942 if (!AV.Object._canBeSerializedAsValue(child)) {
18943 canBeSerializedAsValue = false;
18944 }
18945 });
18946 }
18947
18948 return canBeSerializedAsValue;
18949 };
18950
18951 AV.Object._deepSaveAsync = function (object, model, options) {
18952 var unsavedChildren = [];
18953 var unsavedFiles = [];
18954
18955 AV.Object._findUnsavedChildren(object, unsavedChildren, unsavedFiles);
18956
18957 unsavedFiles = _.uniq(unsavedFiles);
18958
18959 var promise = _promise.default.resolve();
18960
18961 _.each(unsavedFiles, function (file) {
18962 promise = promise.then(function () {
18963 return file.save();
18964 });
18965 });
18966
18967 var objects = _.uniq(unsavedChildren);
18968
18969 var remaining = _.uniq(objects);
18970
18971 return promise.then(function () {
18972 return continueWhile(function () {
18973 return remaining.length > 0;
18974 }, function () {
18975 // Gather up all the objects that can be saved in this batch.
18976 var batch = [];
18977 var newRemaining = [];
18978
18979 AV._arrayEach(remaining, function (object) {
18980 if (object._canBeSerialized()) {
18981 batch.push(object);
18982 } else {
18983 newRemaining.push(object);
18984 }
18985 });
18986
18987 remaining = newRemaining; // If we can't save any objects, there must be a circular reference.
18988
18989 if (batch.length === 0) {
18990 return _promise.default.reject(new AVError(AVError.OTHER_CAUSE, 'Tried to save a batch with a cycle.'));
18991 } // Reserve a spot in every object's save queue.
18992
18993
18994 var readyToStart = _promise.default.resolve((0, _map.default)(_).call(_, batch, function (object) {
18995 return object._allPreviousSaves || _promise.default.resolve();
18996 })); // Save a single batch, whether previous saves succeeded or failed.
18997
18998
18999 var bathSavePromise = readyToStart.then(function () {
19000 return _request('batch', null, null, 'POST', {
19001 requests: (0, _map.default)(_).call(_, batch, function (object) {
19002 var method = object.id ? 'PUT' : 'POST';
19003
19004 var json = object._getSaveJSON();
19005
19006 _.extend(json, object._flags);
19007
19008 var route = 'classes';
19009 var className = object.className;
19010 var path = "/".concat(route, "/").concat(className);
19011
19012 if (object.className === '_User' && !object.id) {
19013 // Special-case user sign-up.
19014 path = '/users';
19015 }
19016
19017 var path = "/1.1".concat(path);
19018
19019 if (object.id) {
19020 path = path + '/' + object.id;
19021 }
19022
19023 object._startSave();
19024
19025 return {
19026 method: method,
19027 path: path,
19028 body: json,
19029 params: options && options.fetchWhenSave ? {
19030 fetchWhenSave: true
19031 } : undefined
19032 };
19033 })
19034 }, options).then(function (response) {
19035 var results = (0, _map.default)(_).call(_, batch, function (object, i) {
19036 if (response[i].success) {
19037 object._finishSave(object.parse(response[i].success));
19038
19039 return object;
19040 }
19041
19042 object._cancelSave();
19043
19044 return new AVError(response[i].error.code, response[i].error.error);
19045 });
19046 return handleBatchResults(results);
19047 });
19048 });
19049
19050 AV._arrayEach(batch, function (object) {
19051 object._allPreviousSaves = bathSavePromise;
19052 });
19053
19054 return bathSavePromise;
19055 });
19056 }).then(function () {
19057 return object;
19058 });
19059 };
19060};
19061
19062/***/ }),
19063/* 507 */
19064/***/ (function(module, exports, __webpack_require__) {
19065
19066var arrayWithHoles = __webpack_require__(508);
19067
19068var iterableToArrayLimit = __webpack_require__(516);
19069
19070var unsupportedIterableToArray = __webpack_require__(517);
19071
19072var nonIterableRest = __webpack_require__(527);
19073
19074function _slicedToArray(arr, i) {
19075 return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();
19076}
19077
19078module.exports = _slicedToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
19079
19080/***/ }),
19081/* 508 */
19082/***/ (function(module, exports, __webpack_require__) {
19083
19084var _Array$isArray = __webpack_require__(509);
19085
19086function _arrayWithHoles(arr) {
19087 if (_Array$isArray(arr)) return arr;
19088}
19089
19090module.exports = _arrayWithHoles, module.exports.__esModule = true, module.exports["default"] = module.exports;
19091
19092/***/ }),
19093/* 509 */
19094/***/ (function(module, exports, __webpack_require__) {
19095
19096module.exports = __webpack_require__(510);
19097
19098/***/ }),
19099/* 510 */
19100/***/ (function(module, exports, __webpack_require__) {
19101
19102module.exports = __webpack_require__(511);
19103
19104
19105/***/ }),
19106/* 511 */
19107/***/ (function(module, exports, __webpack_require__) {
19108
19109var parent = __webpack_require__(512);
19110
19111module.exports = parent;
19112
19113
19114/***/ }),
19115/* 512 */
19116/***/ (function(module, exports, __webpack_require__) {
19117
19118var parent = __webpack_require__(513);
19119
19120module.exports = parent;
19121
19122
19123/***/ }),
19124/* 513 */
19125/***/ (function(module, exports, __webpack_require__) {
19126
19127var parent = __webpack_require__(514);
19128
19129module.exports = parent;
19130
19131
19132/***/ }),
19133/* 514 */
19134/***/ (function(module, exports, __webpack_require__) {
19135
19136__webpack_require__(515);
19137var path = __webpack_require__(10);
19138
19139module.exports = path.Array.isArray;
19140
19141
19142/***/ }),
19143/* 515 */
19144/***/ (function(module, exports, __webpack_require__) {
19145
19146var $ = __webpack_require__(0);
19147var isArray = __webpack_require__(85);
19148
19149// `Array.isArray` method
19150// https://tc39.es/ecma262/#sec-array.isarray
19151$({ target: 'Array', stat: true }, {
19152 isArray: isArray
19153});
19154
19155
19156/***/ }),
19157/* 516 */
19158/***/ (function(module, exports, __webpack_require__) {
19159
19160var _Symbol = __webpack_require__(231);
19161
19162var _getIteratorMethod = __webpack_require__(241);
19163
19164function _iterableToArrayLimit(arr, i) {
19165 var _i = arr == null ? null : typeof _Symbol !== "undefined" && _getIteratorMethod(arr) || arr["@@iterator"];
19166
19167 if (_i == null) return;
19168 var _arr = [];
19169 var _n = true;
19170 var _d = false;
19171
19172 var _s, _e;
19173
19174 try {
19175 for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
19176 _arr.push(_s.value);
19177
19178 if (i && _arr.length === i) break;
19179 }
19180 } catch (err) {
19181 _d = true;
19182 _e = err;
19183 } finally {
19184 try {
19185 if (!_n && _i["return"] != null) _i["return"]();
19186 } finally {
19187 if (_d) throw _e;
19188 }
19189 }
19190
19191 return _arr;
19192}
19193
19194module.exports = _iterableToArrayLimit, module.exports.__esModule = true, module.exports["default"] = module.exports;
19195
19196/***/ }),
19197/* 517 */
19198/***/ (function(module, exports, __webpack_require__) {
19199
19200var _sliceInstanceProperty = __webpack_require__(518);
19201
19202var _Array$from = __webpack_require__(522);
19203
19204var arrayLikeToArray = __webpack_require__(526);
19205
19206function _unsupportedIterableToArray(o, minLen) {
19207 var _context;
19208
19209 if (!o) return;
19210 if (typeof o === "string") return arrayLikeToArray(o, minLen);
19211
19212 var n = _sliceInstanceProperty(_context = Object.prototype.toString.call(o)).call(_context, 8, -1);
19213
19214 if (n === "Object" && o.constructor) n = o.constructor.name;
19215 if (n === "Map" || n === "Set") return _Array$from(o);
19216 if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);
19217}
19218
19219module.exports = _unsupportedIterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
19220
19221/***/ }),
19222/* 518 */
19223/***/ (function(module, exports, __webpack_require__) {
19224
19225module.exports = __webpack_require__(519);
19226
19227/***/ }),
19228/* 519 */
19229/***/ (function(module, exports, __webpack_require__) {
19230
19231module.exports = __webpack_require__(520);
19232
19233
19234/***/ }),
19235/* 520 */
19236/***/ (function(module, exports, __webpack_require__) {
19237
19238var parent = __webpack_require__(521);
19239
19240module.exports = parent;
19241
19242
19243/***/ }),
19244/* 521 */
19245/***/ (function(module, exports, __webpack_require__) {
19246
19247var parent = __webpack_require__(229);
19248
19249module.exports = parent;
19250
19251
19252/***/ }),
19253/* 522 */
19254/***/ (function(module, exports, __webpack_require__) {
19255
19256module.exports = __webpack_require__(523);
19257
19258/***/ }),
19259/* 523 */
19260/***/ (function(module, exports, __webpack_require__) {
19261
19262module.exports = __webpack_require__(524);
19263
19264
19265/***/ }),
19266/* 524 */
19267/***/ (function(module, exports, __webpack_require__) {
19268
19269var parent = __webpack_require__(525);
19270
19271module.exports = parent;
19272
19273
19274/***/ }),
19275/* 525 */
19276/***/ (function(module, exports, __webpack_require__) {
19277
19278var parent = __webpack_require__(239);
19279
19280module.exports = parent;
19281
19282
19283/***/ }),
19284/* 526 */
19285/***/ (function(module, exports) {
19286
19287function _arrayLikeToArray(arr, len) {
19288 if (len == null || len > arr.length) len = arr.length;
19289
19290 for (var i = 0, arr2 = new Array(len); i < len; i++) {
19291 arr2[i] = arr[i];
19292 }
19293
19294 return arr2;
19295}
19296
19297module.exports = _arrayLikeToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
19298
19299/***/ }),
19300/* 527 */
19301/***/ (function(module, exports) {
19302
19303function _nonIterableRest() {
19304 throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
19305}
19306
19307module.exports = _nonIterableRest, module.exports.__esModule = true, module.exports["default"] = module.exports;
19308
19309/***/ }),
19310/* 528 */
19311/***/ (function(module, exports, __webpack_require__) {
19312
19313var parent = __webpack_require__(529);
19314
19315module.exports = parent;
19316
19317
19318/***/ }),
19319/* 529 */
19320/***/ (function(module, exports, __webpack_require__) {
19321
19322__webpack_require__(530);
19323var path = __webpack_require__(10);
19324
19325var Object = path.Object;
19326
19327var getOwnPropertyDescriptor = module.exports = function getOwnPropertyDescriptor(it, key) {
19328 return Object.getOwnPropertyDescriptor(it, key);
19329};
19330
19331if (Object.getOwnPropertyDescriptor.sham) getOwnPropertyDescriptor.sham = true;
19332
19333
19334/***/ }),
19335/* 530 */
19336/***/ (function(module, exports, __webpack_require__) {
19337
19338var $ = __webpack_require__(0);
19339var fails = __webpack_require__(3);
19340var toIndexedObject = __webpack_require__(33);
19341var nativeGetOwnPropertyDescriptor = __webpack_require__(71).f;
19342var DESCRIPTORS = __webpack_require__(16);
19343
19344var FAILS_ON_PRIMITIVES = fails(function () { nativeGetOwnPropertyDescriptor(1); });
19345var FORCED = !DESCRIPTORS || FAILS_ON_PRIMITIVES;
19346
19347// `Object.getOwnPropertyDescriptor` method
19348// https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
19349$({ target: 'Object', stat: true, forced: FORCED, sham: !DESCRIPTORS }, {
19350 getOwnPropertyDescriptor: function getOwnPropertyDescriptor(it, key) {
19351 return nativeGetOwnPropertyDescriptor(toIndexedObject(it), key);
19352 }
19353});
19354
19355
19356/***/ }),
19357/* 531 */
19358/***/ (function(module, exports, __webpack_require__) {
19359
19360"use strict";
19361
19362
19363var _ = __webpack_require__(2);
19364
19365var AVError = __webpack_require__(43);
19366
19367module.exports = function (AV) {
19368 AV.Role = AV.Object.extend('_Role',
19369 /** @lends AV.Role.prototype */
19370 {
19371 // Instance Methods
19372
19373 /**
19374 * Represents a Role on the AV server. Roles represent groupings of
19375 * Users for the purposes of granting permissions (e.g. specifying an ACL
19376 * for an Object). Roles are specified by their sets of child users and
19377 * child roles, all of which are granted any permissions that the parent
19378 * role has.
19379 *
19380 * <p>Roles must have a name (which cannot be changed after creation of the
19381 * role), and must specify an ACL.</p>
19382 * An AV.Role is a local representation of a role persisted to the AV
19383 * cloud.
19384 * @class AV.Role
19385 * @param {String} name The name of the Role to create.
19386 * @param {AV.ACL} acl The ACL for this role.
19387 */
19388 constructor: function constructor(name, acl) {
19389 if (_.isString(name)) {
19390 AV.Object.prototype.constructor.call(this, null, null);
19391 this.setName(name);
19392 } else {
19393 AV.Object.prototype.constructor.call(this, name, acl);
19394 }
19395
19396 if (acl) {
19397 if (!(acl instanceof AV.ACL)) {
19398 throw new TypeError('acl must be an instance of AV.ACL');
19399 } else {
19400 this.setACL(acl);
19401 }
19402 }
19403 },
19404
19405 /**
19406 * Gets the name of the role. You can alternatively call role.get("name")
19407 *
19408 * @return {String} the name of the role.
19409 */
19410 getName: function getName() {
19411 return this.get('name');
19412 },
19413
19414 /**
19415 * Sets the name for a role. This value must be set before the role has
19416 * been saved to the server, and cannot be set once the role has been
19417 * saved.
19418 *
19419 * <p>
19420 * A role's name can only contain alphanumeric characters, _, -, and
19421 * spaces.
19422 * </p>
19423 *
19424 * <p>This is equivalent to calling role.set("name", name)</p>
19425 *
19426 * @param {String} name The name of the role.
19427 */
19428 setName: function setName(name, options) {
19429 return this.set('name', name, options);
19430 },
19431
19432 /**
19433 * Gets the AV.Relation for the AV.Users that are direct
19434 * children of this role. These users are granted any privileges that this
19435 * role has been granted (e.g. read or write access through ACLs). You can
19436 * add or remove users from the role through this relation.
19437 *
19438 * <p>This is equivalent to calling role.relation("users")</p>
19439 *
19440 * @return {AV.Relation} the relation for the users belonging to this
19441 * role.
19442 */
19443 getUsers: function getUsers() {
19444 return this.relation('users');
19445 },
19446
19447 /**
19448 * Gets the AV.Relation for the AV.Roles that are direct
19449 * children of this role. These roles' users are granted any privileges that
19450 * this role has been granted (e.g. read or write access through ACLs). You
19451 * can add or remove child roles from this role through this relation.
19452 *
19453 * <p>This is equivalent to calling role.relation("roles")</p>
19454 *
19455 * @return {AV.Relation} the relation for the roles belonging to this
19456 * role.
19457 */
19458 getRoles: function getRoles() {
19459 return this.relation('roles');
19460 },
19461
19462 /**
19463 * @ignore
19464 */
19465 validate: function validate(attrs, options) {
19466 if ('name' in attrs && attrs.name !== this.getName()) {
19467 var newName = attrs.name;
19468
19469 if (this.id && this.id !== attrs.objectId) {
19470 // Check to see if the objectId being set matches this.id.
19471 // This happens during a fetch -- the id is set before calling fetch.
19472 // Let the name be set in this case.
19473 return new AVError(AVError.OTHER_CAUSE, "A role's name can only be set before it has been saved.");
19474 }
19475
19476 if (!_.isString(newName)) {
19477 return new AVError(AVError.OTHER_CAUSE, "A role's name must be a String.");
19478 }
19479
19480 if (!/^[0-9a-zA-Z\-_ ]+$/.test(newName)) {
19481 return new AVError(AVError.OTHER_CAUSE, "A role's name can only contain alphanumeric characters, _," + ' -, and spaces.');
19482 }
19483 }
19484
19485 if (AV.Object.prototype.validate) {
19486 return AV.Object.prototype.validate.call(this, attrs, options);
19487 }
19488
19489 return false;
19490 }
19491 });
19492};
19493
19494/***/ }),
19495/* 532 */
19496/***/ (function(module, exports, __webpack_require__) {
19497
19498"use strict";
19499
19500
19501var _interopRequireDefault = __webpack_require__(1);
19502
19503var _defineProperty2 = _interopRequireDefault(__webpack_require__(533));
19504
19505var _promise = _interopRequireDefault(__webpack_require__(12));
19506
19507var _map = _interopRequireDefault(__webpack_require__(42));
19508
19509var _find = _interopRequireDefault(__webpack_require__(110));
19510
19511var _stringify = _interopRequireDefault(__webpack_require__(36));
19512
19513var _ = __webpack_require__(2);
19514
19515var uuid = __webpack_require__(221);
19516
19517var AVError = __webpack_require__(43);
19518
19519var _require = __webpack_require__(26),
19520 AVRequest = _require._request,
19521 request = _require.request;
19522
19523var _require2 = __webpack_require__(68),
19524 getAdapter = _require2.getAdapter;
19525
19526var PLATFORM_ANONYMOUS = 'anonymous';
19527var PLATFORM_QQAPP = 'lc_qqapp';
19528
19529var mergeUnionDataIntoAuthData = function mergeUnionDataIntoAuthData() {
19530 var defaultUnionIdPlatform = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'weixin';
19531 return function (authData, unionId) {
19532 var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
19533 _ref$unionIdPlatform = _ref.unionIdPlatform,
19534 unionIdPlatform = _ref$unionIdPlatform === void 0 ? defaultUnionIdPlatform : _ref$unionIdPlatform,
19535 _ref$asMainAccount = _ref.asMainAccount,
19536 asMainAccount = _ref$asMainAccount === void 0 ? false : _ref$asMainAccount;
19537
19538 if (typeof unionId !== 'string') throw new AVError(AVError.OTHER_CAUSE, 'unionId is not a string');
19539 if (typeof unionIdPlatform !== 'string') throw new AVError(AVError.OTHER_CAUSE, 'unionIdPlatform is not a string');
19540 return _.extend({}, authData, {
19541 platform: unionIdPlatform,
19542 unionid: unionId,
19543 main_account: Boolean(asMainAccount)
19544 });
19545 };
19546};
19547
19548module.exports = function (AV) {
19549 /**
19550 * @class
19551 *
19552 * <p>An AV.User object is a local representation of a user persisted to the
19553 * LeanCloud server. This class is a subclass of an AV.Object, and retains the
19554 * same functionality of an AV.Object, but also extends it with various
19555 * user specific methods, like authentication, signing up, and validation of
19556 * uniqueness.</p>
19557 */
19558 AV.User = AV.Object.extend('_User',
19559 /** @lends AV.User.prototype */
19560 {
19561 // Instance Variables
19562 _isCurrentUser: false,
19563 // Instance Methods
19564
19565 /**
19566 * Internal method to handle special fields in a _User response.
19567 * @private
19568 */
19569 _mergeMagicFields: function _mergeMagicFields(attrs) {
19570 if (attrs.sessionToken) {
19571 this._sessionToken = attrs.sessionToken;
19572 delete attrs.sessionToken;
19573 }
19574
19575 return AV.User.__super__._mergeMagicFields.call(this, attrs);
19576 },
19577
19578 /**
19579 * Removes null values from authData (which exist temporarily for
19580 * unlinking)
19581 * @private
19582 */
19583 _cleanupAuthData: function _cleanupAuthData() {
19584 if (!this.isCurrent()) {
19585 return;
19586 }
19587
19588 var authData = this.get('authData');
19589
19590 if (!authData) {
19591 return;
19592 }
19593
19594 AV._objectEach(this.get('authData'), function (value, key) {
19595 if (!authData[key]) {
19596 delete authData[key];
19597 }
19598 });
19599 },
19600
19601 /**
19602 * Synchronizes authData for all providers.
19603 * @private
19604 */
19605 _synchronizeAllAuthData: function _synchronizeAllAuthData() {
19606 var authData = this.get('authData');
19607
19608 if (!authData) {
19609 return;
19610 }
19611
19612 var self = this;
19613
19614 AV._objectEach(this.get('authData'), function (value, key) {
19615 self._synchronizeAuthData(key);
19616 });
19617 },
19618
19619 /**
19620 * Synchronizes auth data for a provider (e.g. puts the access token in the
19621 * right place to be used by the Facebook SDK).
19622 * @private
19623 */
19624 _synchronizeAuthData: function _synchronizeAuthData(provider) {
19625 if (!this.isCurrent()) {
19626 return;
19627 }
19628
19629 var authType;
19630
19631 if (_.isString(provider)) {
19632 authType = provider;
19633 provider = AV.User._authProviders[authType];
19634 } else {
19635 authType = provider.getAuthType();
19636 }
19637
19638 var authData = this.get('authData');
19639
19640 if (!authData || !provider) {
19641 return;
19642 }
19643
19644 var success = provider.restoreAuthentication(authData[authType]);
19645
19646 if (!success) {
19647 this.dissociateAuthData(provider);
19648 }
19649 },
19650 _handleSaveResult: function _handleSaveResult(makeCurrent) {
19651 // Clean up and synchronize the authData object, removing any unset values
19652 if (makeCurrent && !AV._config.disableCurrentUser) {
19653 this._isCurrentUser = true;
19654 }
19655
19656 this._cleanupAuthData();
19657
19658 this._synchronizeAllAuthData(); // Don't keep the password around.
19659
19660
19661 delete this._serverData.password;
19662
19663 this._rebuildEstimatedDataForKey('password');
19664
19665 this._refreshCache();
19666
19667 if ((makeCurrent || this.isCurrent()) && !AV._config.disableCurrentUser) {
19668 // Some old version of leanengine-node-sdk will overwrite
19669 // AV.User._saveCurrentUser which returns no Promise.
19670 // So we need a Promise wrapper.
19671 return _promise.default.resolve(AV.User._saveCurrentUser(this));
19672 } else {
19673 return _promise.default.resolve();
19674 }
19675 },
19676
19677 /**
19678 * Unlike in the Android/iOS SDKs, logInWith is unnecessary, since you can
19679 * call linkWith on the user (even if it doesn't exist yet on the server).
19680 * @private
19681 */
19682 _linkWith: function _linkWith(provider, data) {
19683 var _this = this;
19684
19685 var _ref2 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
19686 _ref2$failOnNotExist = _ref2.failOnNotExist,
19687 failOnNotExist = _ref2$failOnNotExist === void 0 ? false : _ref2$failOnNotExist,
19688 useMasterKey = _ref2.useMasterKey,
19689 sessionToken = _ref2.sessionToken,
19690 user = _ref2.user;
19691
19692 var authType;
19693
19694 if (_.isString(provider)) {
19695 authType = provider;
19696 provider = AV.User._authProviders[provider];
19697 } else {
19698 authType = provider.getAuthType();
19699 }
19700
19701 if (data) {
19702 return this.save({
19703 authData: (0, _defineProperty2.default)({}, authType, data)
19704 }, {
19705 useMasterKey: useMasterKey,
19706 sessionToken: sessionToken,
19707 user: user,
19708 fetchWhenSave: !!this.get('authData'),
19709 _failOnNotExist: failOnNotExist
19710 }).then(function (model) {
19711 return model._handleSaveResult(true).then(function () {
19712 return model;
19713 });
19714 });
19715 } else {
19716 return provider.authenticate().then(function (result) {
19717 return _this._linkWith(provider, result);
19718 });
19719 }
19720 },
19721
19722 /**
19723 * Associate the user with a third party authData.
19724 * @since 3.3.0
19725 * @param {Object} authData The response json data returned from third party token, maybe like { openid: 'abc123', access_token: '123abc', expires_in: 1382686496 }
19726 * @param {string} platform Available platform for sign up.
19727 * @return {Promise<AV.User>} A promise that is fulfilled with the user when completed.
19728 * @example user.associateWithAuthData({
19729 * openid: 'abc123',
19730 * access_token: '123abc',
19731 * expires_in: 1382686496
19732 * }, 'weixin').then(function(user) {
19733 * //Access user here
19734 * }).catch(function(error) {
19735 * //console.error("error: ", error);
19736 * });
19737 */
19738 associateWithAuthData: function associateWithAuthData(authData, platform) {
19739 return this._linkWith(platform, authData);
19740 },
19741
19742 /**
19743 * Associate the user with a third party authData and unionId.
19744 * @since 3.5.0
19745 * @param {Object} authData The response json data returned from third party token, maybe like { openid: 'abc123', access_token: '123abc', expires_in: 1382686496 }
19746 * @param {string} platform Available platform for sign up.
19747 * @param {string} unionId
19748 * @param {Object} [unionLoginOptions]
19749 * @param {string} [unionLoginOptions.unionIdPlatform = 'weixin'] unionId platform
19750 * @param {boolean} [unionLoginOptions.asMainAccount = false] If true, the unionId will be associated with the user.
19751 * @return {Promise<AV.User>} A promise that is fulfilled with the user when completed.
19752 * @example user.associateWithAuthDataAndUnionId({
19753 * openid: 'abc123',
19754 * access_token: '123abc',
19755 * expires_in: 1382686496
19756 * }, 'weixin', 'union123', {
19757 * unionIdPlatform: 'weixin',
19758 * asMainAccount: true,
19759 * }).then(function(user) {
19760 * //Access user here
19761 * }).catch(function(error) {
19762 * //console.error("error: ", error);
19763 * });
19764 */
19765 associateWithAuthDataAndUnionId: function associateWithAuthDataAndUnionId(authData, platform, unionId, unionOptions) {
19766 return this._linkWith(platform, mergeUnionDataIntoAuthData()(authData, unionId, unionOptions));
19767 },
19768
19769 /**
19770 * Associate the user with the identity of the current mini-app.
19771 * @since 4.6.0
19772 * @param {Object} [authInfo]
19773 * @param {Object} [option]
19774 * @param {Boolean} [option.failOnNotExist] If true, the login request will fail when no user matches this authInfo.authData exists.
19775 * @return {Promise<AV.User>}
19776 */
19777 associateWithMiniApp: function associateWithMiniApp(authInfo, option) {
19778 var _this2 = this;
19779
19780 if (authInfo === undefined) {
19781 var getAuthInfo = getAdapter('getAuthInfo');
19782 return getAuthInfo().then(function (authInfo) {
19783 return _this2._linkWith(authInfo.provider, authInfo.authData, option);
19784 });
19785 }
19786
19787 return this._linkWith(authInfo.provider, authInfo.authData, option);
19788 },
19789
19790 /**
19791 * 将用户与 QQ 小程序用户进行关联。适用于为已经在用户系统中存在的用户关联当前使用 QQ 小程序的微信帐号。
19792 * 仅在 QQ 小程序中可用。
19793 *
19794 * @deprecated Please use {@link AV.User#associateWithMiniApp}
19795 * @since 4.2.0
19796 * @param {Object} [options]
19797 * @param {boolean} [options.preferUnionId = false] 如果服务端在登录时获取到了用户的 UnionId,是否将 UnionId 保存在用户账号中。
19798 * @param {string} [options.unionIdPlatform = 'qq'] (only take effect when preferUnionId) unionId platform
19799 * @param {boolean} [options.asMainAccount = true] (only take effect when preferUnionId) If true, the unionId will be associated with the user.
19800 * @return {Promise<AV.User>}
19801 */
19802 associateWithQQApp: function associateWithQQApp() {
19803 var _this3 = this;
19804
19805 var _ref3 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
19806 _ref3$preferUnionId = _ref3.preferUnionId,
19807 preferUnionId = _ref3$preferUnionId === void 0 ? false : _ref3$preferUnionId,
19808 _ref3$unionIdPlatform = _ref3.unionIdPlatform,
19809 unionIdPlatform = _ref3$unionIdPlatform === void 0 ? 'qq' : _ref3$unionIdPlatform,
19810 _ref3$asMainAccount = _ref3.asMainAccount,
19811 asMainAccount = _ref3$asMainAccount === void 0 ? true : _ref3$asMainAccount;
19812
19813 var getAuthInfo = getAdapter('getAuthInfo');
19814 return getAuthInfo({
19815 preferUnionId: preferUnionId,
19816 asMainAccount: asMainAccount,
19817 platform: unionIdPlatform
19818 }).then(function (authInfo) {
19819 authInfo.provider = PLATFORM_QQAPP;
19820 return _this3.associateWithMiniApp(authInfo);
19821 });
19822 },
19823
19824 /**
19825 * 将用户与微信小程序用户进行关联。适用于为已经在用户系统中存在的用户关联当前使用微信小程序的微信帐号。
19826 * 仅在微信小程序中可用。
19827 *
19828 * @deprecated Please use {@link AV.User#associateWithMiniApp}
19829 * @since 3.13.0
19830 * @param {Object} [options]
19831 * @param {boolean} [options.preferUnionId = false] 当用户满足 {@link https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/union-id.html 获取 UnionId 的条件} 时,是否将 UnionId 保存在用户账号中。
19832 * @param {string} [options.unionIdPlatform = 'weixin'] (only take effect when preferUnionId) unionId platform
19833 * @param {boolean} [options.asMainAccount = true] (only take effect when preferUnionId) If true, the unionId will be associated with the user.
19834 * @return {Promise<AV.User>}
19835 */
19836 associateWithWeapp: function associateWithWeapp() {
19837 var _this4 = this;
19838
19839 var _ref4 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
19840 _ref4$preferUnionId = _ref4.preferUnionId,
19841 preferUnionId = _ref4$preferUnionId === void 0 ? false : _ref4$preferUnionId,
19842 _ref4$unionIdPlatform = _ref4.unionIdPlatform,
19843 unionIdPlatform = _ref4$unionIdPlatform === void 0 ? 'weixin' : _ref4$unionIdPlatform,
19844 _ref4$asMainAccount = _ref4.asMainAccount,
19845 asMainAccount = _ref4$asMainAccount === void 0 ? true : _ref4$asMainAccount;
19846
19847 var getAuthInfo = getAdapter('getAuthInfo');
19848 return getAuthInfo({
19849 preferUnionId: preferUnionId,
19850 asMainAccount: asMainAccount,
19851 platform: unionIdPlatform
19852 }).then(function (authInfo) {
19853 return _this4.associateWithMiniApp(authInfo);
19854 });
19855 },
19856
19857 /**
19858 * @deprecated renamed to {@link AV.User#associateWithWeapp}
19859 * @return {Promise<AV.User>}
19860 */
19861 linkWithWeapp: function linkWithWeapp(options) {
19862 console.warn('DEPRECATED: User#linkWithWeapp 已废弃,请使用 User#associateWithWeapp 代替');
19863 return this.associateWithWeapp(options);
19864 },
19865
19866 /**
19867 * 将用户与 QQ 小程序用户进行关联。适用于为已经在用户系统中存在的用户关联当前使用 QQ 小程序的 QQ 帐号。
19868 * 仅在 QQ 小程序中可用。
19869 *
19870 * @deprecated Please use {@link AV.User#associateWithMiniApp}
19871 * @since 4.2.0
19872 * @param {string} unionId
19873 * @param {Object} [unionOptions]
19874 * @param {string} [unionOptions.unionIdPlatform = 'qq'] unionId platform
19875 * @param {boolean} [unionOptions.asMainAccount = false] If true, the unionId will be associated with the user.
19876 * @return {Promise<AV.User>}
19877 */
19878 associateWithQQAppWithUnionId: function associateWithQQAppWithUnionId(unionId) {
19879 var _this5 = this;
19880
19881 var _ref5 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
19882 _ref5$unionIdPlatform = _ref5.unionIdPlatform,
19883 unionIdPlatform = _ref5$unionIdPlatform === void 0 ? 'qq' : _ref5$unionIdPlatform,
19884 _ref5$asMainAccount = _ref5.asMainAccount,
19885 asMainAccount = _ref5$asMainAccount === void 0 ? false : _ref5$asMainAccount;
19886
19887 var getAuthInfo = getAdapter('getAuthInfo');
19888 return getAuthInfo({
19889 platform: unionIdPlatform
19890 }).then(function (authInfo) {
19891 authInfo = AV.User.mergeUnionId(authInfo, unionId, {
19892 asMainAccount: asMainAccount
19893 });
19894 authInfo.provider = PLATFORM_QQAPP;
19895 return _this5.associateWithMiniApp(authInfo);
19896 });
19897 },
19898
19899 /**
19900 * 将用户与微信小程序用户进行关联。适用于为已经在用户系统中存在的用户关联当前使用微信小程序的微信帐号。
19901 * 仅在微信小程序中可用。
19902 *
19903 * @deprecated Please use {@link AV.User#associateWithMiniApp}
19904 * @since 3.13.0
19905 * @param {string} unionId
19906 * @param {Object} [unionOptions]
19907 * @param {string} [unionOptions.unionIdPlatform = 'weixin'] unionId platform
19908 * @param {boolean} [unionOptions.asMainAccount = false] If true, the unionId will be associated with the user.
19909 * @return {Promise<AV.User>}
19910 */
19911 associateWithWeappWithUnionId: function associateWithWeappWithUnionId(unionId) {
19912 var _this6 = this;
19913
19914 var _ref6 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
19915 _ref6$unionIdPlatform = _ref6.unionIdPlatform,
19916 unionIdPlatform = _ref6$unionIdPlatform === void 0 ? 'weixin' : _ref6$unionIdPlatform,
19917 _ref6$asMainAccount = _ref6.asMainAccount,
19918 asMainAccount = _ref6$asMainAccount === void 0 ? false : _ref6$asMainAccount;
19919
19920 var getAuthInfo = getAdapter('getAuthInfo');
19921 return getAuthInfo({
19922 platform: unionIdPlatform
19923 }).then(function (authInfo) {
19924 authInfo = AV.User.mergeUnionId(authInfo, unionId, {
19925 asMainAccount: asMainAccount
19926 });
19927 return _this6.associateWithMiniApp(authInfo);
19928 });
19929 },
19930
19931 /**
19932 * Unlinks a user from a service.
19933 * @param {string} platform
19934 * @return {Promise<AV.User>}
19935 * @since 3.3.0
19936 */
19937 dissociateAuthData: function dissociateAuthData(provider) {
19938 this.unset("authData.".concat(provider));
19939 return this.save().then(function (model) {
19940 return model._handleSaveResult(true).then(function () {
19941 return model;
19942 });
19943 });
19944 },
19945
19946 /**
19947 * @private
19948 * @deprecated
19949 */
19950 _unlinkFrom: function _unlinkFrom(provider) {
19951 console.warn('DEPRECATED: User#_unlinkFrom 已废弃,请使用 User#dissociateAuthData 代替');
19952 return this.dissociateAuthData(provider);
19953 },
19954
19955 /**
19956 * Checks whether a user is linked to a service.
19957 * @private
19958 */
19959 _isLinked: function _isLinked(provider) {
19960 var authType;
19961
19962 if (_.isString(provider)) {
19963 authType = provider;
19964 } else {
19965 authType = provider.getAuthType();
19966 }
19967
19968 var authData = this.get('authData') || {};
19969 return !!authData[authType];
19970 },
19971
19972 /**
19973 * Checks whether a user is anonymous.
19974 * @since 3.9.0
19975 * @return {boolean}
19976 */
19977 isAnonymous: function isAnonymous() {
19978 return this._isLinked(PLATFORM_ANONYMOUS);
19979 },
19980 logOut: function logOut() {
19981 this._logOutWithAll();
19982
19983 this._isCurrentUser = false;
19984 },
19985
19986 /**
19987 * Deauthenticates all providers.
19988 * @private
19989 */
19990 _logOutWithAll: function _logOutWithAll() {
19991 var authData = this.get('authData');
19992
19993 if (!authData) {
19994 return;
19995 }
19996
19997 var self = this;
19998
19999 AV._objectEach(this.get('authData'), function (value, key) {
20000 self._logOutWith(key);
20001 });
20002 },
20003
20004 /**
20005 * Deauthenticates a single provider (e.g. removing access tokens from the
20006 * Facebook SDK).
20007 * @private
20008 */
20009 _logOutWith: function _logOutWith(provider) {
20010 if (!this.isCurrent()) {
20011 return;
20012 }
20013
20014 if (_.isString(provider)) {
20015 provider = AV.User._authProviders[provider];
20016 }
20017
20018 if (provider && provider.deauthenticate) {
20019 provider.deauthenticate();
20020 }
20021 },
20022
20023 /**
20024 * Signs up a new user. You should call this instead of save for
20025 * new AV.Users. This will create a new AV.User on the server, and
20026 * also persist the session on disk so that you can access the user using
20027 * <code>current</code>.
20028 *
20029 * <p>A username and password must be set before calling signUp.</p>
20030 *
20031 * @param {Object} attrs Extra fields to set on the new user, or null.
20032 * @param {AuthOptions} options
20033 * @return {Promise} A promise that is fulfilled when the signup
20034 * finishes.
20035 * @see AV.User.signUp
20036 */
20037 signUp: function signUp(attrs, options) {
20038 var error;
20039 var username = attrs && attrs.username || this.get('username');
20040
20041 if (!username || username === '') {
20042 error = new AVError(AVError.OTHER_CAUSE, 'Cannot sign up user with an empty name.');
20043 throw error;
20044 }
20045
20046 var password = attrs && attrs.password || this.get('password');
20047
20048 if (!password || password === '') {
20049 error = new AVError(AVError.OTHER_CAUSE, 'Cannot sign up user with an empty password.');
20050 throw error;
20051 }
20052
20053 return this.save(attrs, options).then(function (model) {
20054 if (model.isAnonymous()) {
20055 model.unset("authData.".concat(PLATFORM_ANONYMOUS));
20056 model._opSetQueue = [{}];
20057 }
20058
20059 return model._handleSaveResult(true).then(function () {
20060 return model;
20061 });
20062 });
20063 },
20064
20065 /**
20066 * Signs up a new user with mobile phone and sms code.
20067 * You should call this instead of save for
20068 * new AV.Users. This will create a new AV.User on the server, and
20069 * also persist the session on disk so that you can access the user using
20070 * <code>current</code>.
20071 *
20072 * <p>A username and password must be set before calling signUp.</p>
20073 *
20074 * @param {Object} attrs Extra fields to set on the new user, or null.
20075 * @param {AuthOptions} options
20076 * @return {Promise} A promise that is fulfilled when the signup
20077 * finishes.
20078 * @see AV.User.signUpOrlogInWithMobilePhone
20079 * @see AV.Cloud.requestSmsCode
20080 */
20081 signUpOrlogInWithMobilePhone: function signUpOrlogInWithMobilePhone(attrs) {
20082 var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
20083 var error;
20084 var mobilePhoneNumber = attrs && attrs.mobilePhoneNumber || this.get('mobilePhoneNumber');
20085
20086 if (!mobilePhoneNumber || mobilePhoneNumber === '') {
20087 error = new AVError(AVError.OTHER_CAUSE, 'Cannot sign up or login user by mobilePhoneNumber ' + 'with an empty mobilePhoneNumber.');
20088 throw error;
20089 }
20090
20091 var smsCode = attrs && attrs.smsCode || this.get('smsCode');
20092
20093 if (!smsCode || smsCode === '') {
20094 error = new AVError(AVError.OTHER_CAUSE, 'Cannot sign up or login user by mobilePhoneNumber ' + 'with an empty smsCode.');
20095 throw error;
20096 }
20097
20098 options._makeRequest = function (route, className, id, method, json) {
20099 return AVRequest('usersByMobilePhone', null, null, 'POST', json);
20100 };
20101
20102 return this.save(attrs, options).then(function (model) {
20103 delete model.attributes.smsCode;
20104 delete model._serverData.smsCode;
20105 return model._handleSaveResult(true).then(function () {
20106 return model;
20107 });
20108 });
20109 },
20110
20111 /**
20112 * The same with {@link AV.User.loginWithAuthData}, except that you can set attributes before login.
20113 * @since 3.7.0
20114 */
20115 loginWithAuthData: function loginWithAuthData(authData, platform, options) {
20116 return this._linkWith(platform, authData, options);
20117 },
20118
20119 /**
20120 * The same with {@link AV.User.loginWithAuthDataAndUnionId}, except that you can set attributes before login.
20121 * @since 3.7.0
20122 */
20123 loginWithAuthDataAndUnionId: function loginWithAuthDataAndUnionId(authData, platform, unionId, unionLoginOptions) {
20124 return this.loginWithAuthData(mergeUnionDataIntoAuthData()(authData, unionId, unionLoginOptions), platform, unionLoginOptions);
20125 },
20126
20127 /**
20128 * The same with {@link AV.User.loginWithWeapp}, except that you can set attributes before login.
20129 * @deprecated please use {@link AV.User#loginWithMiniApp}
20130 * @since 3.7.0
20131 * @param {Object} [options]
20132 * @param {boolean} [options.failOnNotExist] If true, the login request will fail when no user matches this authData exists.
20133 * @param {boolean} [options.preferUnionId] 当用户满足 {@link https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/union-id.html 获取 UnionId 的条件} 时,是否使用 UnionId 登录。(since 3.13.0)
20134 * @param {string} [options.unionIdPlatform = 'weixin'] (only take effect when preferUnionId) unionId platform
20135 * @param {boolean} [options.asMainAccount = true] (only take effect when preferUnionId) If true, the unionId will be associated with the user.
20136 * @return {Promise<AV.User>}
20137 */
20138 loginWithWeapp: function loginWithWeapp() {
20139 var _this7 = this;
20140
20141 var _ref7 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
20142 _ref7$preferUnionId = _ref7.preferUnionId,
20143 preferUnionId = _ref7$preferUnionId === void 0 ? false : _ref7$preferUnionId,
20144 _ref7$unionIdPlatform = _ref7.unionIdPlatform,
20145 unionIdPlatform = _ref7$unionIdPlatform === void 0 ? 'weixin' : _ref7$unionIdPlatform,
20146 _ref7$asMainAccount = _ref7.asMainAccount,
20147 asMainAccount = _ref7$asMainAccount === void 0 ? true : _ref7$asMainAccount,
20148 _ref7$failOnNotExist = _ref7.failOnNotExist,
20149 failOnNotExist = _ref7$failOnNotExist === void 0 ? false : _ref7$failOnNotExist,
20150 useMasterKey = _ref7.useMasterKey,
20151 sessionToken = _ref7.sessionToken,
20152 user = _ref7.user;
20153
20154 var getAuthInfo = getAdapter('getAuthInfo');
20155 return getAuthInfo({
20156 preferUnionId: preferUnionId,
20157 asMainAccount: asMainAccount,
20158 platform: unionIdPlatform
20159 }).then(function (authInfo) {
20160 return _this7.loginWithMiniApp(authInfo, {
20161 failOnNotExist: failOnNotExist,
20162 useMasterKey: useMasterKey,
20163 sessionToken: sessionToken,
20164 user: user
20165 });
20166 });
20167 },
20168
20169 /**
20170 * The same with {@link AV.User.loginWithWeappWithUnionId}, except that you can set attributes before login.
20171 * @deprecated please use {@link AV.User#loginWithMiniApp}
20172 * @since 3.13.0
20173 */
20174 loginWithWeappWithUnionId: function loginWithWeappWithUnionId(unionId) {
20175 var _this8 = this;
20176
20177 var _ref8 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
20178 _ref8$unionIdPlatform = _ref8.unionIdPlatform,
20179 unionIdPlatform = _ref8$unionIdPlatform === void 0 ? 'weixin' : _ref8$unionIdPlatform,
20180 _ref8$asMainAccount = _ref8.asMainAccount,
20181 asMainAccount = _ref8$asMainAccount === void 0 ? false : _ref8$asMainAccount,
20182 _ref8$failOnNotExist = _ref8.failOnNotExist,
20183 failOnNotExist = _ref8$failOnNotExist === void 0 ? false : _ref8$failOnNotExist,
20184 useMasterKey = _ref8.useMasterKey,
20185 sessionToken = _ref8.sessionToken,
20186 user = _ref8.user;
20187
20188 var getAuthInfo = getAdapter('getAuthInfo');
20189 return getAuthInfo({
20190 platform: unionIdPlatform
20191 }).then(function (authInfo) {
20192 authInfo = AV.User.mergeUnionId(authInfo, unionId, {
20193 asMainAccount: asMainAccount
20194 });
20195 return _this8.loginWithMiniApp(authInfo, {
20196 failOnNotExist: failOnNotExist,
20197 useMasterKey: useMasterKey,
20198 sessionToken: sessionToken,
20199 user: user
20200 });
20201 });
20202 },
20203
20204 /**
20205 * The same with {@link AV.User.loginWithQQApp}, except that you can set attributes before login.
20206 * @deprecated please use {@link AV.User#loginWithMiniApp}
20207 * @since 4.2.0
20208 * @param {Object} [options]
20209 * @param {boolean} [options.failOnNotExist] If true, the login request will fail when no user matches this authData exists.
20210 * @param {boolean} [options.preferUnionId] 如果服务端在登录时获取到了用户的 UnionId,是否将 UnionId 保存在用户账号中。
20211 * @param {string} [options.unionIdPlatform = 'qq'] (only take effect when preferUnionId) unionId platform
20212 * @param {boolean} [options.asMainAccount = true] (only take effect when preferUnionId) If true, the unionId will be associated with the user.
20213 */
20214 loginWithQQApp: function loginWithQQApp() {
20215 var _this9 = this;
20216
20217 var _ref9 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
20218 _ref9$preferUnionId = _ref9.preferUnionId,
20219 preferUnionId = _ref9$preferUnionId === void 0 ? false : _ref9$preferUnionId,
20220 _ref9$unionIdPlatform = _ref9.unionIdPlatform,
20221 unionIdPlatform = _ref9$unionIdPlatform === void 0 ? 'qq' : _ref9$unionIdPlatform,
20222 _ref9$asMainAccount = _ref9.asMainAccount,
20223 asMainAccount = _ref9$asMainAccount === void 0 ? true : _ref9$asMainAccount,
20224 _ref9$failOnNotExist = _ref9.failOnNotExist,
20225 failOnNotExist = _ref9$failOnNotExist === void 0 ? false : _ref9$failOnNotExist,
20226 useMasterKey = _ref9.useMasterKey,
20227 sessionToken = _ref9.sessionToken,
20228 user = _ref9.user;
20229
20230 var getAuthInfo = getAdapter('getAuthInfo');
20231 return getAuthInfo({
20232 preferUnionId: preferUnionId,
20233 asMainAccount: asMainAccount,
20234 platform: unionIdPlatform
20235 }).then(function (authInfo) {
20236 authInfo.provider = PLATFORM_QQAPP;
20237 return _this9.loginWithMiniApp(authInfo, {
20238 failOnNotExist: failOnNotExist,
20239 useMasterKey: useMasterKey,
20240 sessionToken: sessionToken,
20241 user: user
20242 });
20243 });
20244 },
20245
20246 /**
20247 * The same with {@link AV.User.loginWithQQAppWithUnionId}, except that you can set attributes before login.
20248 * @deprecated please use {@link AV.User#loginWithMiniApp}
20249 * @since 4.2.0
20250 */
20251 loginWithQQAppWithUnionId: function loginWithQQAppWithUnionId(unionId) {
20252 var _this10 = this;
20253
20254 var _ref10 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
20255 _ref10$unionIdPlatfor = _ref10.unionIdPlatform,
20256 unionIdPlatform = _ref10$unionIdPlatfor === void 0 ? 'qq' : _ref10$unionIdPlatfor,
20257 _ref10$asMainAccount = _ref10.asMainAccount,
20258 asMainAccount = _ref10$asMainAccount === void 0 ? false : _ref10$asMainAccount,
20259 _ref10$failOnNotExist = _ref10.failOnNotExist,
20260 failOnNotExist = _ref10$failOnNotExist === void 0 ? false : _ref10$failOnNotExist,
20261 useMasterKey = _ref10.useMasterKey,
20262 sessionToken = _ref10.sessionToken,
20263 user = _ref10.user;
20264
20265 var getAuthInfo = getAdapter('getAuthInfo');
20266 return getAuthInfo({
20267 platform: unionIdPlatform
20268 }).then(function (authInfo) {
20269 authInfo = AV.User.mergeUnionId(authInfo, unionId, {
20270 asMainAccount: asMainAccount
20271 });
20272 authInfo.provider = PLATFORM_QQAPP;
20273 return _this10.loginWithMiniApp(authInfo, {
20274 failOnNotExist: failOnNotExist,
20275 useMasterKey: useMasterKey,
20276 sessionToken: sessionToken,
20277 user: user
20278 });
20279 });
20280 },
20281
20282 /**
20283 * The same with {@link AV.User.loginWithMiniApp}, except that you can set attributes before login.
20284 * @since 4.6.0
20285 */
20286 loginWithMiniApp: function loginWithMiniApp(authInfo, option) {
20287 var _this11 = this;
20288
20289 if (authInfo === undefined) {
20290 var getAuthInfo = getAdapter('getAuthInfo');
20291 return getAuthInfo().then(function (authInfo) {
20292 return _this11.loginWithAuthData(authInfo.authData, authInfo.provider, option);
20293 });
20294 }
20295
20296 return this.loginWithAuthData(authInfo.authData, authInfo.provider, option);
20297 },
20298
20299 /**
20300 * Logs in a AV.User. On success, this saves the session to localStorage,
20301 * so you can retrieve the currently logged in user using
20302 * <code>current</code>.
20303 *
20304 * <p>A username and password must be set before calling logIn.</p>
20305 *
20306 * @see AV.User.logIn
20307 * @return {Promise} A promise that is fulfilled with the user when
20308 * the login is complete.
20309 */
20310 logIn: function logIn() {
20311 var model = this;
20312 var request = AVRequest('login', null, null, 'POST', this.toJSON());
20313 return request.then(function (resp) {
20314 var serverAttrs = model.parse(resp);
20315
20316 model._finishFetch(serverAttrs);
20317
20318 return model._handleSaveResult(true).then(function () {
20319 if (!serverAttrs.smsCode) delete model.attributes['smsCode'];
20320 return model;
20321 });
20322 });
20323 },
20324
20325 /**
20326 * @see AV.Object#save
20327 */
20328 save: function save(arg1, arg2, arg3) {
20329 var attrs, options;
20330
20331 if (_.isObject(arg1) || _.isNull(arg1) || _.isUndefined(arg1)) {
20332 attrs = arg1;
20333 options = arg2;
20334 } else {
20335 attrs = {};
20336 attrs[arg1] = arg2;
20337 options = arg3;
20338 }
20339
20340 options = options || {};
20341 return AV.Object.prototype.save.call(this, attrs, options).then(function (model) {
20342 return model._handleSaveResult(false).then(function () {
20343 return model;
20344 });
20345 });
20346 },
20347
20348 /**
20349 * Follow a user
20350 * @since 0.3.0
20351 * @param {Object | AV.User | String} options if an AV.User or string is given, it will be used as the target user.
20352 * @param {AV.User | String} options.user The target user or user's objectId to follow.
20353 * @param {Object} [options.attributes] key-value attributes dictionary to be used as
20354 * conditions of followerQuery/followeeQuery.
20355 * @param {AuthOptions} [authOptions]
20356 */
20357 follow: function follow(options, authOptions) {
20358 if (!this.id) {
20359 throw new Error('Please signin.');
20360 }
20361
20362 var user;
20363 var attributes;
20364
20365 if (options.user) {
20366 user = options.user;
20367 attributes = options.attributes;
20368 } else {
20369 user = options;
20370 }
20371
20372 var userObjectId = _.isString(user) ? user : user.id;
20373
20374 if (!userObjectId) {
20375 throw new Error('Invalid target user.');
20376 }
20377
20378 var route = 'users/' + this.id + '/friendship/' + userObjectId;
20379 var request = AVRequest(route, null, null, 'POST', AV._encode(attributes), authOptions);
20380 return request;
20381 },
20382
20383 /**
20384 * Unfollow a user.
20385 * @since 0.3.0
20386 * @param {Object | AV.User | String} options if an AV.User or string is given, it will be used as the target user.
20387 * @param {AV.User | String} options.user The target user or user's objectId to unfollow.
20388 * @param {AuthOptions} [authOptions]
20389 */
20390 unfollow: function unfollow(options, authOptions) {
20391 if (!this.id) {
20392 throw new Error('Please signin.');
20393 }
20394
20395 var user;
20396
20397 if (options.user) {
20398 user = options.user;
20399 } else {
20400 user = options;
20401 }
20402
20403 var userObjectId = _.isString(user) ? user : user.id;
20404
20405 if (!userObjectId) {
20406 throw new Error('Invalid target user.');
20407 }
20408
20409 var route = 'users/' + this.id + '/friendship/' + userObjectId;
20410 var request = AVRequest(route, null, null, 'DELETE', null, authOptions);
20411 return request;
20412 },
20413
20414 /**
20415 * Get the user's followers and followees.
20416 * @since 4.8.0
20417 * @param {Object} [options]
20418 * @param {Number} [options.skip]
20419 * @param {Number} [options.limit]
20420 * @param {AuthOptions} [authOptions]
20421 */
20422 getFollowersAndFollowees: function getFollowersAndFollowees(options, authOptions) {
20423 if (!this.id) {
20424 throw new Error('Please signin.');
20425 }
20426
20427 return request({
20428 method: 'GET',
20429 path: "/users/".concat(this.id, "/followersAndFollowees"),
20430 query: {
20431 skip: options && options.skip,
20432 limit: options && options.limit,
20433 include: 'follower,followee',
20434 keys: 'follower,followee'
20435 },
20436 authOptions: authOptions
20437 }).then(function (_ref11) {
20438 var followers = _ref11.followers,
20439 followees = _ref11.followees;
20440 return {
20441 followers: (0, _map.default)(followers).call(followers, function (_ref12) {
20442 var follower = _ref12.follower;
20443 return AV._decode(follower);
20444 }),
20445 followees: (0, _map.default)(followees).call(followees, function (_ref13) {
20446 var followee = _ref13.followee;
20447 return AV._decode(followee);
20448 })
20449 };
20450 });
20451 },
20452
20453 /**
20454 *Create a follower query to query the user's followers.
20455 * @since 0.3.0
20456 * @see AV.User#followerQuery
20457 */
20458 followerQuery: function followerQuery() {
20459 return AV.User.followerQuery(this.id);
20460 },
20461
20462 /**
20463 *Create a followee query to query the user's followees.
20464 * @since 0.3.0
20465 * @see AV.User#followeeQuery
20466 */
20467 followeeQuery: function followeeQuery() {
20468 return AV.User.followeeQuery(this.id);
20469 },
20470
20471 /**
20472 * @see AV.Object#fetch
20473 */
20474 fetch: function fetch(fetchOptions, options) {
20475 return AV.Object.prototype.fetch.call(this, fetchOptions, options).then(function (model) {
20476 return model._handleSaveResult(false).then(function () {
20477 return model;
20478 });
20479 });
20480 },
20481
20482 /**
20483 * Update user's new password safely based on old password.
20484 * @param {String} oldPassword the old password.
20485 * @param {String} newPassword the new password.
20486 * @param {AuthOptions} options
20487 */
20488 updatePassword: function updatePassword(oldPassword, newPassword, options) {
20489 var _this12 = this;
20490
20491 var route = 'users/' + this.id + '/updatePassword';
20492 var params = {
20493 old_password: oldPassword,
20494 new_password: newPassword
20495 };
20496 var request = AVRequest(route, null, null, 'PUT', params, options);
20497 return request.then(function (resp) {
20498 _this12._finishFetch(_this12.parse(resp));
20499
20500 return _this12._handleSaveResult(true).then(function () {
20501 return resp;
20502 });
20503 });
20504 },
20505
20506 /**
20507 * Returns true if <code>current</code> would return this user.
20508 * @see AV.User#current
20509 */
20510 isCurrent: function isCurrent() {
20511 return this._isCurrentUser;
20512 },
20513
20514 /**
20515 * Returns get("username").
20516 * @return {String}
20517 * @see AV.Object#get
20518 */
20519 getUsername: function getUsername() {
20520 return this.get('username');
20521 },
20522
20523 /**
20524 * Returns get("mobilePhoneNumber").
20525 * @return {String}
20526 * @see AV.Object#get
20527 */
20528 getMobilePhoneNumber: function getMobilePhoneNumber() {
20529 return this.get('mobilePhoneNumber');
20530 },
20531
20532 /**
20533 * Calls set("mobilePhoneNumber", phoneNumber, options) and returns the result.
20534 * @param {String} mobilePhoneNumber
20535 * @return {Boolean}
20536 * @see AV.Object#set
20537 */
20538 setMobilePhoneNumber: function setMobilePhoneNumber(phone, options) {
20539 return this.set('mobilePhoneNumber', phone, options);
20540 },
20541
20542 /**
20543 * Calls set("username", username, options) and returns the result.
20544 * @param {String} username
20545 * @return {Boolean}
20546 * @see AV.Object#set
20547 */
20548 setUsername: function setUsername(username, options) {
20549 return this.set('username', username, options);
20550 },
20551
20552 /**
20553 * Calls set("password", password, options) and returns the result.
20554 * @param {String} password
20555 * @return {Boolean}
20556 * @see AV.Object#set
20557 */
20558 setPassword: function setPassword(password, options) {
20559 return this.set('password', password, options);
20560 },
20561
20562 /**
20563 * Returns get("email").
20564 * @return {String}
20565 * @see AV.Object#get
20566 */
20567 getEmail: function getEmail() {
20568 return this.get('email');
20569 },
20570
20571 /**
20572 * Calls set("email", email, options) and returns the result.
20573 * @param {String} email
20574 * @param {AuthOptions} options
20575 * @return {Boolean}
20576 * @see AV.Object#set
20577 */
20578 setEmail: function setEmail(email, options) {
20579 return this.set('email', email, options);
20580 },
20581
20582 /**
20583 * Checks whether this user is the current user and has been authenticated.
20584 * @deprecated 如果要判断当前用户的登录状态是否有效,请使用 currentUser.isAuthenticated().then(),
20585 * 如果要判断该用户是否是当前登录用户,请使用 user.id === currentUser.id
20586 * @return (Boolean) whether this user is the current user and is logged in.
20587 */
20588 authenticated: function authenticated() {
20589 console.warn('DEPRECATED: 如果要判断当前用户的登录状态是否有效,请使用 currentUser.isAuthenticated().then(),如果要判断该用户是否是当前登录用户,请使用 user.id === currentUser.id。');
20590 return !!this._sessionToken && !AV._config.disableCurrentUser && AV.User.current() && AV.User.current().id === this.id;
20591 },
20592
20593 /**
20594 * Detects if current sessionToken is valid.
20595 *
20596 * @since 2.0.0
20597 * @return Promise.<Boolean>
20598 */
20599 isAuthenticated: function isAuthenticated() {
20600 var _this13 = this;
20601
20602 return _promise.default.resolve().then(function () {
20603 return !!_this13._sessionToken && AV.User._fetchUserBySessionToken(_this13._sessionToken).then(function () {
20604 return true;
20605 }, function (error) {
20606 if (error.code === 211) {
20607 return false;
20608 }
20609
20610 throw error;
20611 });
20612 });
20613 },
20614
20615 /**
20616 * Get sessionToken of current user.
20617 * @return {String} sessionToken
20618 */
20619 getSessionToken: function getSessionToken() {
20620 return this._sessionToken;
20621 },
20622
20623 /**
20624 * Refresh sessionToken of current user.
20625 * @since 2.1.0
20626 * @param {AuthOptions} [options]
20627 * @return {Promise.<AV.User>} user with refreshed sessionToken
20628 */
20629 refreshSessionToken: function refreshSessionToken(options) {
20630 var _this14 = this;
20631
20632 return AVRequest("users/".concat(this.id, "/refreshSessionToken"), null, null, 'PUT', null, options).then(function (response) {
20633 _this14._finishFetch(response);
20634
20635 return _this14._handleSaveResult(true).then(function () {
20636 return _this14;
20637 });
20638 });
20639 },
20640
20641 /**
20642 * Get this user's Roles.
20643 * @param {AuthOptions} [options]
20644 * @return {Promise.<AV.Role[]>} A promise that is fulfilled with the roles when
20645 * the query is complete.
20646 */
20647 getRoles: function getRoles(options) {
20648 var _context;
20649
20650 return (0, _find.default)(_context = AV.Relation.reverseQuery('_Role', 'users', this)).call(_context, options);
20651 }
20652 },
20653 /** @lends AV.User */
20654 {
20655 // Class Variables
20656 // The currently logged-in user.
20657 _currentUser: null,
20658 // Whether currentUser is known to match the serialized version on disk.
20659 // This is useful for saving a localstorage check if you try to load
20660 // _currentUser frequently while there is none stored.
20661 _currentUserMatchesDisk: false,
20662 // The localStorage key suffix that the current user is stored under.
20663 _CURRENT_USER_KEY: 'currentUser',
20664 // The mapping of auth provider names to actual providers
20665 _authProviders: {},
20666 // Class Methods
20667
20668 /**
20669 * Signs up a new user with a username (or email) and password.
20670 * This will create a new AV.User on the server, and also persist the
20671 * session in localStorage so that you can access the user using
20672 * {@link #current}.
20673 *
20674 * @param {String} username The username (or email) to sign up with.
20675 * @param {String} password The password to sign up with.
20676 * @param {Object} [attrs] Extra fields to set on the new user.
20677 * @param {AuthOptions} [options]
20678 * @return {Promise} A promise that is fulfilled with the user when
20679 * the signup completes.
20680 * @see AV.User#signUp
20681 */
20682 signUp: function signUp(username, password, attrs, options) {
20683 attrs = attrs || {};
20684 attrs.username = username;
20685 attrs.password = password;
20686
20687 var user = AV.Object._create('_User');
20688
20689 return user.signUp(attrs, options);
20690 },
20691
20692 /**
20693 * Logs in a user with a username (or email) and password. On success, this
20694 * saves the session to disk, so you can retrieve the currently logged in
20695 * user using <code>current</code>.
20696 *
20697 * @param {String} username The username (or email) to log in with.
20698 * @param {String} password The password to log in with.
20699 * @return {Promise} A promise that is fulfilled with the user when
20700 * the login completes.
20701 * @see AV.User#logIn
20702 */
20703 logIn: function logIn(username, password) {
20704 var user = AV.Object._create('_User');
20705
20706 user._finishFetch({
20707 username: username,
20708 password: password
20709 });
20710
20711 return user.logIn();
20712 },
20713
20714 /**
20715 * Logs in a user with a session token. On success, this saves the session
20716 * to disk, so you can retrieve the currently logged in user using
20717 * <code>current</code>.
20718 *
20719 * @param {String} sessionToken The sessionToken to log in with.
20720 * @return {Promise} A promise that is fulfilled with the user when
20721 * the login completes.
20722 */
20723 become: function become(sessionToken) {
20724 return this._fetchUserBySessionToken(sessionToken).then(function (user) {
20725 return user._handleSaveResult(true).then(function () {
20726 return user;
20727 });
20728 });
20729 },
20730 _fetchUserBySessionToken: function _fetchUserBySessionToken(sessionToken) {
20731 if (sessionToken === undefined) {
20732 return _promise.default.reject(new Error('The sessionToken cannot be undefined'));
20733 }
20734
20735 var user = AV.Object._create('_User');
20736
20737 return request({
20738 method: 'GET',
20739 path: '/users/me',
20740 authOptions: {
20741 sessionToken: sessionToken
20742 }
20743 }).then(function (resp) {
20744 var serverAttrs = user.parse(resp);
20745
20746 user._finishFetch(serverAttrs);
20747
20748 return user;
20749 });
20750 },
20751
20752 /**
20753 * Logs in a user with a mobile phone number and sms code sent by
20754 * AV.User.requestLoginSmsCode.On success, this
20755 * saves the session to disk, so you can retrieve the currently logged in
20756 * user using <code>current</code>.
20757 *
20758 * @param {String} mobilePhone The user's mobilePhoneNumber
20759 * @param {String} smsCode The sms code sent by AV.User.requestLoginSmsCode
20760 * @return {Promise} A promise that is fulfilled with the user when
20761 * the login completes.
20762 * @see AV.User#logIn
20763 */
20764 logInWithMobilePhoneSmsCode: function logInWithMobilePhoneSmsCode(mobilePhone, smsCode) {
20765 var user = AV.Object._create('_User');
20766
20767 user._finishFetch({
20768 mobilePhoneNumber: mobilePhone,
20769 smsCode: smsCode
20770 });
20771
20772 return user.logIn();
20773 },
20774
20775 /**
20776 * Signs up or logs in a user with a mobilePhoneNumber and smsCode.
20777 * On success, this saves the session to disk, so you can retrieve the currently
20778 * logged in user using <code>current</code>.
20779 *
20780 * @param {String} mobilePhoneNumber The user's mobilePhoneNumber.
20781 * @param {String} smsCode The sms code sent by AV.Cloud.requestSmsCode
20782 * @param {Object} attributes The user's other attributes such as username etc.
20783 * @param {AuthOptions} options
20784 * @return {Promise} A promise that is fulfilled with the user when
20785 * the login completes.
20786 * @see AV.User#signUpOrlogInWithMobilePhone
20787 * @see AV.Cloud.requestSmsCode
20788 */
20789 signUpOrlogInWithMobilePhone: function signUpOrlogInWithMobilePhone(mobilePhoneNumber, smsCode, attrs, options) {
20790 attrs = attrs || {};
20791 attrs.mobilePhoneNumber = mobilePhoneNumber;
20792 attrs.smsCode = smsCode;
20793
20794 var user = AV.Object._create('_User');
20795
20796 return user.signUpOrlogInWithMobilePhone(attrs, options);
20797 },
20798
20799 /**
20800 * Logs in a user with a mobile phone number and password. On success, this
20801 * saves the session to disk, so you can retrieve the currently logged in
20802 * user using <code>current</code>.
20803 *
20804 * @param {String} mobilePhone The user's mobilePhoneNumber
20805 * @param {String} password The password to log in with.
20806 * @return {Promise} A promise that is fulfilled with the user when
20807 * the login completes.
20808 * @see AV.User#logIn
20809 */
20810 logInWithMobilePhone: function logInWithMobilePhone(mobilePhone, password) {
20811 var user = AV.Object._create('_User');
20812
20813 user._finishFetch({
20814 mobilePhoneNumber: mobilePhone,
20815 password: password
20816 });
20817
20818 return user.logIn();
20819 },
20820
20821 /**
20822 * Logs in a user with email and password.
20823 *
20824 * @since 3.13.0
20825 * @param {String} email The user's email.
20826 * @param {String} password The password to log in with.
20827 * @return {Promise} A promise that is fulfilled with the user when
20828 * the login completes.
20829 */
20830 loginWithEmail: function loginWithEmail(email, password) {
20831 var user = AV.Object._create('_User');
20832
20833 user._finishFetch({
20834 email: email,
20835 password: password
20836 });
20837
20838 return user.logIn();
20839 },
20840
20841 /**
20842 * Signs up or logs in a user with a third party auth data(AccessToken).
20843 * On success, this saves the session to disk, so you can retrieve the currently
20844 * logged in user using <code>current</code>.
20845 *
20846 * @since 3.7.0
20847 * @param {Object} authData The response json data returned from third party token, maybe like { openid: 'abc123', access_token: '123abc', expires_in: 1382686496 }
20848 * @param {string} platform Available platform for sign up.
20849 * @param {Object} [options]
20850 * @param {boolean} [options.failOnNotExist] If true, the login request will fail when no user matches this authData exists.
20851 * @return {Promise} A promise that is fulfilled with the user when
20852 * the login completes.
20853 * @example AV.User.loginWithAuthData({
20854 * openid: 'abc123',
20855 * access_token: '123abc',
20856 * expires_in: 1382686496
20857 * }, 'weixin').then(function(user) {
20858 * //Access user here
20859 * }).catch(function(error) {
20860 * //console.error("error: ", error);
20861 * });
20862 * @see {@link https://leancloud.cn/docs/js_guide.html#绑定第三方平台账户}
20863 */
20864 loginWithAuthData: function loginWithAuthData(authData, platform, options) {
20865 return AV.User._logInWith(platform, authData, options);
20866 },
20867
20868 /**
20869 * @deprecated renamed to {@link AV.User.loginWithAuthData}
20870 */
20871 signUpOrlogInWithAuthData: function signUpOrlogInWithAuthData() {
20872 console.warn('DEPRECATED: User.signUpOrlogInWithAuthData 已废弃,请使用 User#loginWithAuthData 代替');
20873 return this.loginWithAuthData.apply(this, arguments);
20874 },
20875
20876 /**
20877 * Signs up or logs in a user with a third party authData and unionId.
20878 * @since 3.7.0
20879 * @param {Object} authData The response json data returned from third party token, maybe like { openid: 'abc123', access_token: '123abc', expires_in: 1382686496 }
20880 * @param {string} platform Available platform for sign up.
20881 * @param {string} unionId
20882 * @param {Object} [unionLoginOptions]
20883 * @param {string} [unionLoginOptions.unionIdPlatform = 'weixin'] unionId platform
20884 * @param {boolean} [unionLoginOptions.asMainAccount = false] If true, the unionId will be associated with the user.
20885 * @param {boolean} [unionLoginOptions.failOnNotExist] If true, the login request will fail when no user matches this authData exists.
20886 * @return {Promise<AV.User>} A promise that is fulfilled with the user when completed.
20887 * @example AV.User.loginWithAuthDataAndUnionId({
20888 * openid: 'abc123',
20889 * access_token: '123abc',
20890 * expires_in: 1382686496
20891 * }, 'weixin', 'union123', {
20892 * unionIdPlatform: 'weixin',
20893 * asMainAccount: true,
20894 * }).then(function(user) {
20895 * //Access user here
20896 * }).catch(function(error) {
20897 * //console.error("error: ", error);
20898 * });
20899 */
20900 loginWithAuthDataAndUnionId: function loginWithAuthDataAndUnionId(authData, platform, unionId, unionLoginOptions) {
20901 return this.loginWithAuthData(mergeUnionDataIntoAuthData()(authData, unionId, unionLoginOptions), platform, unionLoginOptions);
20902 },
20903
20904 /**
20905 * @deprecated renamed to {@link AV.User.loginWithAuthDataAndUnionId}
20906 * @since 3.5.0
20907 */
20908 signUpOrlogInWithAuthDataAndUnionId: function signUpOrlogInWithAuthDataAndUnionId() {
20909 console.warn('DEPRECATED: User.signUpOrlogInWithAuthDataAndUnionId 已废弃,请使用 User#loginWithAuthDataAndUnionId 代替');
20910 return this.loginWithAuthDataAndUnionId.apply(this, arguments);
20911 },
20912
20913 /**
20914 * Merge unionId into authInfo.
20915 * @since 4.6.0
20916 * @param {Object} authInfo
20917 * @param {String} unionId
20918 * @param {Object} [unionIdOption]
20919 * @param {Boolean} [unionIdOption.asMainAccount] If true, the unionId will be associated with the user.
20920 */
20921 mergeUnionId: function mergeUnionId(authInfo, unionId) {
20922 var _ref14 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
20923 _ref14$asMainAccount = _ref14.asMainAccount,
20924 asMainAccount = _ref14$asMainAccount === void 0 ? false : _ref14$asMainAccount;
20925
20926 authInfo = JSON.parse((0, _stringify.default)(authInfo));
20927 var _authInfo = authInfo,
20928 authData = _authInfo.authData,
20929 platform = _authInfo.platform;
20930 authData.platform = platform;
20931 authData.main_account = asMainAccount;
20932 authData.unionid = unionId;
20933 return authInfo;
20934 },
20935
20936 /**
20937 * 使用当前使用微信小程序的微信用户身份注册或登录,成功后用户的 session 会在设备上持久化保存,之后可以使用 AV.User.current() 获取当前登录用户。
20938 * 仅在微信小程序中可用。
20939 *
20940 * @deprecated please use {@link AV.User.loginWithMiniApp}
20941 * @since 2.0.0
20942 * @param {Object} [options]
20943 * @param {boolean} [options.preferUnionId] 当用户满足 {@link https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/union-id.html 获取 UnionId 的条件} 时,是否使用 UnionId 登录。(since 3.13.0)
20944 * @param {string} [options.unionIdPlatform = 'weixin'] (only take effect when preferUnionId) unionId platform
20945 * @param {boolean} [options.asMainAccount = true] (only take effect when preferUnionId) If true, the unionId will be associated with the user.
20946 * @param {boolean} [options.failOnNotExist] If true, the login request will fail when no user matches this authData exists. (since v3.7.0)
20947 * @return {Promise.<AV.User>}
20948 */
20949 loginWithWeapp: function loginWithWeapp() {
20950 var _this15 = this;
20951
20952 var _ref15 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
20953 _ref15$preferUnionId = _ref15.preferUnionId,
20954 preferUnionId = _ref15$preferUnionId === void 0 ? false : _ref15$preferUnionId,
20955 _ref15$unionIdPlatfor = _ref15.unionIdPlatform,
20956 unionIdPlatform = _ref15$unionIdPlatfor === void 0 ? 'weixin' : _ref15$unionIdPlatfor,
20957 _ref15$asMainAccount = _ref15.asMainAccount,
20958 asMainAccount = _ref15$asMainAccount === void 0 ? true : _ref15$asMainAccount,
20959 _ref15$failOnNotExist = _ref15.failOnNotExist,
20960 failOnNotExist = _ref15$failOnNotExist === void 0 ? false : _ref15$failOnNotExist,
20961 useMasterKey = _ref15.useMasterKey,
20962 sessionToken = _ref15.sessionToken,
20963 user = _ref15.user;
20964
20965 var getAuthInfo = getAdapter('getAuthInfo');
20966 return getAuthInfo({
20967 preferUnionId: preferUnionId,
20968 asMainAccount: asMainAccount,
20969 platform: unionIdPlatform
20970 }).then(function (authInfo) {
20971 return _this15.loginWithMiniApp(authInfo, {
20972 failOnNotExist: failOnNotExist,
20973 useMasterKey: useMasterKey,
20974 sessionToken: sessionToken,
20975 user: user
20976 });
20977 });
20978 },
20979
20980 /**
20981 * 使用当前使用微信小程序的微信用户身份注册或登录,
20982 * 仅在微信小程序中可用。
20983 *
20984 * @deprecated please use {@link AV.User.loginWithMiniApp}
20985 * @since 3.13.0
20986 * @param {Object} [unionLoginOptions]
20987 * @param {string} [unionLoginOptions.unionIdPlatform = 'weixin'] unionId platform
20988 * @param {boolean} [unionLoginOptions.asMainAccount = false] If true, the unionId will be associated with the user.
20989 * @param {boolean} [unionLoginOptions.failOnNotExist] If true, the login request will fail when no user matches this authData exists. * @return {Promise.<AV.User>}
20990 */
20991 loginWithWeappWithUnionId: function loginWithWeappWithUnionId(unionId) {
20992 var _this16 = this;
20993
20994 var _ref16 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
20995 _ref16$unionIdPlatfor = _ref16.unionIdPlatform,
20996 unionIdPlatform = _ref16$unionIdPlatfor === void 0 ? 'weixin' : _ref16$unionIdPlatfor,
20997 _ref16$asMainAccount = _ref16.asMainAccount,
20998 asMainAccount = _ref16$asMainAccount === void 0 ? false : _ref16$asMainAccount,
20999 _ref16$failOnNotExist = _ref16.failOnNotExist,
21000 failOnNotExist = _ref16$failOnNotExist === void 0 ? false : _ref16$failOnNotExist,
21001 useMasterKey = _ref16.useMasterKey,
21002 sessionToken = _ref16.sessionToken,
21003 user = _ref16.user;
21004
21005 var getAuthInfo = getAdapter('getAuthInfo');
21006 return getAuthInfo({
21007 platform: unionIdPlatform
21008 }).then(function (authInfo) {
21009 authInfo = AV.User.mergeUnionId(authInfo, unionId, {
21010 asMainAccount: asMainAccount
21011 });
21012 return _this16.loginWithMiniApp(authInfo, {
21013 failOnNotExist: failOnNotExist,
21014 useMasterKey: useMasterKey,
21015 sessionToken: sessionToken,
21016 user: user
21017 });
21018 });
21019 },
21020
21021 /**
21022 * 使用当前使用 QQ 小程序的 QQ 用户身份注册或登录,成功后用户的 session 会在设备上持久化保存,之后可以使用 AV.User.current() 获取当前登录用户。
21023 * 仅在 QQ 小程序中可用。
21024 *
21025 * @deprecated please use {@link AV.User.loginWithMiniApp}
21026 * @since 4.2.0
21027 * @param {Object} [options]
21028 * @param {boolean} [options.preferUnionId] 如果服务端在登录时获取到了用户的 UnionId,是否将 UnionId 保存在用户账号中。
21029 * @param {string} [options.unionIdPlatform = 'qq'] (only take effect when preferUnionId) unionId platform
21030 * @param {boolean} [options.asMainAccount = true] (only take effect when preferUnionId) If true, the unionId will be associated with the user.
21031 * @param {boolean} [options.failOnNotExist] If true, the login request will fail when no user matches this authData exists. (since v3.7.0)
21032 * @return {Promise.<AV.User>}
21033 */
21034 loginWithQQApp: function loginWithQQApp() {
21035 var _this17 = this;
21036
21037 var _ref17 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
21038 _ref17$preferUnionId = _ref17.preferUnionId,
21039 preferUnionId = _ref17$preferUnionId === void 0 ? false : _ref17$preferUnionId,
21040 _ref17$unionIdPlatfor = _ref17.unionIdPlatform,
21041 unionIdPlatform = _ref17$unionIdPlatfor === void 0 ? 'qq' : _ref17$unionIdPlatfor,
21042 _ref17$asMainAccount = _ref17.asMainAccount,
21043 asMainAccount = _ref17$asMainAccount === void 0 ? true : _ref17$asMainAccount,
21044 _ref17$failOnNotExist = _ref17.failOnNotExist,
21045 failOnNotExist = _ref17$failOnNotExist === void 0 ? false : _ref17$failOnNotExist,
21046 useMasterKey = _ref17.useMasterKey,
21047 sessionToken = _ref17.sessionToken,
21048 user = _ref17.user;
21049
21050 var getAuthInfo = getAdapter('getAuthInfo');
21051 return getAuthInfo({
21052 preferUnionId: preferUnionId,
21053 asMainAccount: asMainAccount,
21054 platform: unionIdPlatform
21055 }).then(function (authInfo) {
21056 authInfo.provider = PLATFORM_QQAPP;
21057 return _this17.loginWithMiniApp(authInfo, {
21058 failOnNotExist: failOnNotExist,
21059 useMasterKey: useMasterKey,
21060 sessionToken: sessionToken,
21061 user: user
21062 });
21063 });
21064 },
21065
21066 /**
21067 * 使用当前使用 QQ 小程序的 QQ 用户身份注册或登录,
21068 * 仅在 QQ 小程序中可用。
21069 *
21070 * @deprecated please use {@link AV.User.loginWithMiniApp}
21071 * @since 4.2.0
21072 * @param {Object} [unionLoginOptions]
21073 * @param {string} [unionLoginOptions.unionIdPlatform = 'qq'] unionId platform
21074 * @param {boolean} [unionLoginOptions.asMainAccount = false] If true, the unionId will be associated with the user.
21075 * @param {boolean} [unionLoginOptions.failOnNotExist] If true, the login request will fail when no user matches this authData exists.
21076 * @return {Promise.<AV.User>}
21077 */
21078 loginWithQQAppWithUnionId: function loginWithQQAppWithUnionId(unionId) {
21079 var _this18 = this;
21080
21081 var _ref18 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
21082 _ref18$unionIdPlatfor = _ref18.unionIdPlatform,
21083 unionIdPlatform = _ref18$unionIdPlatfor === void 0 ? 'qq' : _ref18$unionIdPlatfor,
21084 _ref18$asMainAccount = _ref18.asMainAccount,
21085 asMainAccount = _ref18$asMainAccount === void 0 ? false : _ref18$asMainAccount,
21086 _ref18$failOnNotExist = _ref18.failOnNotExist,
21087 failOnNotExist = _ref18$failOnNotExist === void 0 ? false : _ref18$failOnNotExist,
21088 useMasterKey = _ref18.useMasterKey,
21089 sessionToken = _ref18.sessionToken,
21090 user = _ref18.user;
21091
21092 var getAuthInfo = getAdapter('getAuthInfo');
21093 return getAuthInfo({
21094 platform: unionIdPlatform
21095 }).then(function (authInfo) {
21096 authInfo = AV.User.mergeUnionId(authInfo, unionId, {
21097 asMainAccount: asMainAccount
21098 });
21099 authInfo.provider = PLATFORM_QQAPP;
21100 return _this18.loginWithMiniApp(authInfo, {
21101 failOnNotExist: failOnNotExist,
21102 useMasterKey: useMasterKey,
21103 sessionToken: sessionToken,
21104 user: user
21105 });
21106 });
21107 },
21108
21109 /**
21110 * Register or login using the identity of the current mini-app.
21111 * @param {Object} authInfo
21112 * @param {Object} [option]
21113 * @param {Boolean} [option.failOnNotExist] If true, the login request will fail when no user matches this authInfo.authData exists.
21114 */
21115 loginWithMiniApp: function loginWithMiniApp(authInfo, option) {
21116 var _this19 = this;
21117
21118 if (authInfo === undefined) {
21119 var getAuthInfo = getAdapter('getAuthInfo');
21120 return getAuthInfo().then(function (authInfo) {
21121 return _this19.loginWithAuthData(authInfo.authData, authInfo.provider, option);
21122 });
21123 }
21124
21125 return this.loginWithAuthData(authInfo.authData, authInfo.provider, option);
21126 },
21127
21128 /**
21129 * Only use for DI in tests to produce deterministic IDs.
21130 */
21131 _genId: function _genId() {
21132 return uuid();
21133 },
21134
21135 /**
21136 * Creates an anonymous user.
21137 *
21138 * @since 3.9.0
21139 * @return {Promise.<AV.User>}
21140 */
21141 loginAnonymously: function loginAnonymously() {
21142 return this.loginWithAuthData({
21143 id: AV.User._genId()
21144 }, 'anonymous');
21145 },
21146 associateWithAuthData: function associateWithAuthData(userObj, platform, authData) {
21147 console.warn('DEPRECATED: User.associateWithAuthData 已废弃,请使用 User#associateWithAuthData 代替');
21148 return userObj._linkWith(platform, authData);
21149 },
21150
21151 /**
21152 * Logs out the currently logged in user session. This will remove the
21153 * session from disk, log out of linked services, and future calls to
21154 * <code>current</code> will return <code>null</code>.
21155 * @return {Promise}
21156 */
21157 logOut: function logOut() {
21158 if (AV._config.disableCurrentUser) {
21159 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');
21160 return _promise.default.resolve(null);
21161 }
21162
21163 if (AV.User._currentUser !== null) {
21164 AV.User._currentUser._logOutWithAll();
21165
21166 AV.User._currentUser._isCurrentUser = false;
21167 }
21168
21169 AV.User._currentUserMatchesDisk = true;
21170 AV.User._currentUser = null;
21171 return AV.localStorage.removeItemAsync(AV._getAVPath(AV.User._CURRENT_USER_KEY)).then(function () {
21172 return AV._refreshSubscriptionId();
21173 });
21174 },
21175
21176 /**
21177 *Create a follower query for special user to query the user's followers.
21178 * @param {String} userObjectId The user object id.
21179 * @return {AV.FriendShipQuery}
21180 * @since 0.3.0
21181 */
21182 followerQuery: function followerQuery(userObjectId) {
21183 if (!userObjectId || !_.isString(userObjectId)) {
21184 throw new Error('Invalid user object id.');
21185 }
21186
21187 var query = new AV.FriendShipQuery('_Follower');
21188 query._friendshipTag = 'follower';
21189 query.equalTo('user', AV.Object.createWithoutData('_User', userObjectId));
21190 return query;
21191 },
21192
21193 /**
21194 *Create a followee query for special user to query the user's followees.
21195 * @param {String} userObjectId The user object id.
21196 * @return {AV.FriendShipQuery}
21197 * @since 0.3.0
21198 */
21199 followeeQuery: function followeeQuery(userObjectId) {
21200 if (!userObjectId || !_.isString(userObjectId)) {
21201 throw new Error('Invalid user object id.');
21202 }
21203
21204 var query = new AV.FriendShipQuery('_Followee');
21205 query._friendshipTag = 'followee';
21206 query.equalTo('user', AV.Object.createWithoutData('_User', userObjectId));
21207 return query;
21208 },
21209
21210 /**
21211 * Requests a password reset email to be sent to the specified email address
21212 * associated with the user account. This email allows the user to securely
21213 * reset their password on the AV site.
21214 *
21215 * @param {String} email The email address associated with the user that
21216 * forgot their password.
21217 * @return {Promise}
21218 */
21219 requestPasswordReset: function requestPasswordReset(email) {
21220 var json = {
21221 email: email
21222 };
21223 var request = AVRequest('requestPasswordReset', null, null, 'POST', json);
21224 return request;
21225 },
21226
21227 /**
21228 * Requests a verify email to be sent to the specified email address
21229 * associated with the user account. This email allows the user to securely
21230 * verify their email address on the AV site.
21231 *
21232 * @param {String} email The email address associated with the user that
21233 * doesn't verify their email address.
21234 * @return {Promise}
21235 */
21236 requestEmailVerify: function requestEmailVerify(email) {
21237 var json = {
21238 email: email
21239 };
21240 var request = AVRequest('requestEmailVerify', null, null, 'POST', json);
21241 return request;
21242 },
21243
21244 /**
21245 * Requests a verify sms code to be sent to the specified mobile phone
21246 * number associated with the user account. This sms code allows the user to
21247 * verify their mobile phone number by calling AV.User.verifyMobilePhone
21248 *
21249 * @param {String} mobilePhoneNumber The mobile phone number associated with the
21250 * user that doesn't verify their mobile phone number.
21251 * @param {SMSAuthOptions} [options]
21252 * @return {Promise}
21253 */
21254 requestMobilePhoneVerify: function requestMobilePhoneVerify(mobilePhoneNumber) {
21255 var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
21256 var data = {
21257 mobilePhoneNumber: mobilePhoneNumber
21258 };
21259
21260 if (options.validateToken) {
21261 data.validate_token = options.validateToken;
21262 }
21263
21264 var request = AVRequest('requestMobilePhoneVerify', null, null, 'POST', data, options);
21265 return request;
21266 },
21267
21268 /**
21269 * Requests a reset password sms code to be sent to the specified mobile phone
21270 * number associated with the user account. This sms code allows the user to
21271 * reset their account's password by calling AV.User.resetPasswordBySmsCode
21272 *
21273 * @param {String} mobilePhoneNumber The mobile phone number associated with the
21274 * user that doesn't verify their mobile phone number.
21275 * @param {SMSAuthOptions} [options]
21276 * @return {Promise}
21277 */
21278 requestPasswordResetBySmsCode: function requestPasswordResetBySmsCode(mobilePhoneNumber) {
21279 var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
21280 var data = {
21281 mobilePhoneNumber: mobilePhoneNumber
21282 };
21283
21284 if (options.validateToken) {
21285 data.validate_token = options.validateToken;
21286 }
21287
21288 var request = AVRequest('requestPasswordResetBySmsCode', null, null, 'POST', data, options);
21289 return request;
21290 },
21291
21292 /**
21293 * Requests a change mobile phone number sms code to be sent to the mobilePhoneNumber.
21294 * This sms code allows current user to reset it's mobilePhoneNumber by
21295 * calling {@link AV.User.changePhoneNumber}
21296 * @since 4.7.0
21297 * @param {String} mobilePhoneNumber
21298 * @param {Number} [ttl] ttl of sms code (default is 6 minutes)
21299 * @param {SMSAuthOptions} [options]
21300 * @return {Promise}
21301 */
21302 requestChangePhoneNumber: function requestChangePhoneNumber(mobilePhoneNumber, ttl, options) {
21303 var data = {
21304 mobilePhoneNumber: mobilePhoneNumber
21305 };
21306
21307 if (ttl) {
21308 data.ttl = options.ttl;
21309 }
21310
21311 if (options && options.validateToken) {
21312 data.validate_token = options.validateToken;
21313 }
21314
21315 return AVRequest('requestChangePhoneNumber', null, null, 'POST', data, options);
21316 },
21317
21318 /**
21319 * Makes a call to reset user's account mobilePhoneNumber by sms code.
21320 * The sms code is sent by {@link AV.User.requestChangePhoneNumber}
21321 * @since 4.7.0
21322 * @param {String} mobilePhoneNumber
21323 * @param {String} code The sms code.
21324 * @return {Promise}
21325 */
21326 changePhoneNumber: function changePhoneNumber(mobilePhoneNumber, code) {
21327 var data = {
21328 mobilePhoneNumber: mobilePhoneNumber,
21329 code: code
21330 };
21331 return AVRequest('changePhoneNumber', null, null, 'POST', data);
21332 },
21333
21334 /**
21335 * Makes a call to reset user's account password by sms code and new password.
21336 * The sms code is sent by AV.User.requestPasswordResetBySmsCode.
21337 * @param {String} code The sms code sent by AV.User.Cloud.requestSmsCode
21338 * @param {String} password The new password.
21339 * @return {Promise} A promise that will be resolved with the result
21340 * of the function.
21341 */
21342 resetPasswordBySmsCode: function resetPasswordBySmsCode(code, password) {
21343 var json = {
21344 password: password
21345 };
21346 var request = AVRequest('resetPasswordBySmsCode', null, code, 'PUT', json);
21347 return request;
21348 },
21349
21350 /**
21351 * Makes a call to verify sms code that sent by AV.User.Cloud.requestSmsCode
21352 * If verify successfully,the user mobilePhoneVerified attribute will be true.
21353 * @param {String} code The sms code sent by AV.User.Cloud.requestSmsCode
21354 * @return {Promise} A promise that will be resolved with the result
21355 * of the function.
21356 */
21357 verifyMobilePhone: function verifyMobilePhone(code) {
21358 var request = AVRequest('verifyMobilePhone', null, code, 'POST', null);
21359 return request;
21360 },
21361
21362 /**
21363 * Requests a logIn sms code to be sent to the specified mobile phone
21364 * number associated with the user account. This sms code allows the user to
21365 * login by AV.User.logInWithMobilePhoneSmsCode function.
21366 *
21367 * @param {String} mobilePhoneNumber The mobile phone number associated with the
21368 * user that want to login by AV.User.logInWithMobilePhoneSmsCode
21369 * @param {SMSAuthOptions} [options]
21370 * @return {Promise}
21371 */
21372 requestLoginSmsCode: function requestLoginSmsCode(mobilePhoneNumber) {
21373 var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
21374 var data = {
21375 mobilePhoneNumber: mobilePhoneNumber
21376 };
21377
21378 if (options.validateToken) {
21379 data.validate_token = options.validateToken;
21380 }
21381
21382 var request = AVRequest('requestLoginSmsCode', null, null, 'POST', data, options);
21383 return request;
21384 },
21385
21386 /**
21387 * Retrieves the currently logged in AVUser with a valid session,
21388 * either from memory or localStorage, if necessary.
21389 * @return {Promise.<AV.User>} resolved with the currently logged in AV.User.
21390 */
21391 currentAsync: function currentAsync() {
21392 if (AV._config.disableCurrentUser) {
21393 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');
21394 return _promise.default.resolve(null);
21395 }
21396
21397 if (AV.User._currentUser) {
21398 return _promise.default.resolve(AV.User._currentUser);
21399 }
21400
21401 if (AV.User._currentUserMatchesDisk) {
21402 return _promise.default.resolve(AV.User._currentUser);
21403 }
21404
21405 return AV.localStorage.getItemAsync(AV._getAVPath(AV.User._CURRENT_USER_KEY)).then(function (userData) {
21406 if (!userData) {
21407 return null;
21408 } // Load the user from local storage.
21409
21410
21411 AV.User._currentUserMatchesDisk = true;
21412 AV.User._currentUser = AV.Object._create('_User');
21413 AV.User._currentUser._isCurrentUser = true;
21414 var json = JSON.parse(userData);
21415 AV.User._currentUser.id = json._id;
21416 delete json._id;
21417 AV.User._currentUser._sessionToken = json._sessionToken;
21418 delete json._sessionToken;
21419
21420 AV.User._currentUser._finishFetch(json); //AV.User._currentUser.set(json);
21421
21422
21423 AV.User._currentUser._synchronizeAllAuthData();
21424
21425 AV.User._currentUser._refreshCache();
21426
21427 AV.User._currentUser._opSetQueue = [{}];
21428 return AV.User._currentUser;
21429 });
21430 },
21431
21432 /**
21433 * Retrieves the currently logged in AVUser with a valid session,
21434 * either from memory or localStorage, if necessary.
21435 * @return {AV.User} The currently logged in AV.User.
21436 */
21437 current: function current() {
21438 if (AV._config.disableCurrentUser) {
21439 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');
21440 return null;
21441 }
21442
21443 if (AV.localStorage.async) {
21444 var error = new Error('Synchronous API User.current() is not available in this runtime. Use User.currentAsync() instead.');
21445 error.code = 'SYNC_API_NOT_AVAILABLE';
21446 throw error;
21447 }
21448
21449 if (AV.User._currentUser) {
21450 return AV.User._currentUser;
21451 }
21452
21453 if (AV.User._currentUserMatchesDisk) {
21454 return AV.User._currentUser;
21455 } // Load the user from local storage.
21456
21457
21458 AV.User._currentUserMatchesDisk = true;
21459 var userData = AV.localStorage.getItem(AV._getAVPath(AV.User._CURRENT_USER_KEY));
21460
21461 if (!userData) {
21462 return null;
21463 }
21464
21465 AV.User._currentUser = AV.Object._create('_User');
21466 AV.User._currentUser._isCurrentUser = true;
21467 var json = JSON.parse(userData);
21468 AV.User._currentUser.id = json._id;
21469 delete json._id;
21470 AV.User._currentUser._sessionToken = json._sessionToken;
21471 delete json._sessionToken;
21472
21473 AV.User._currentUser._finishFetch(json); //AV.User._currentUser.set(json);
21474
21475
21476 AV.User._currentUser._synchronizeAllAuthData();
21477
21478 AV.User._currentUser._refreshCache();
21479
21480 AV.User._currentUser._opSetQueue = [{}];
21481 return AV.User._currentUser;
21482 },
21483
21484 /**
21485 * Persists a user as currentUser to localStorage, and into the singleton.
21486 * @private
21487 */
21488 _saveCurrentUser: function _saveCurrentUser(user) {
21489 var promise;
21490
21491 if (AV.User._currentUser !== user) {
21492 promise = AV.User.logOut();
21493 } else {
21494 promise = _promise.default.resolve();
21495 }
21496
21497 return promise.then(function () {
21498 user._isCurrentUser = true;
21499 AV.User._currentUser = user;
21500
21501 var json = user._toFullJSON();
21502
21503 json._id = user.id;
21504 json._sessionToken = user._sessionToken;
21505 return AV.localStorage.setItemAsync(AV._getAVPath(AV.User._CURRENT_USER_KEY), (0, _stringify.default)(json)).then(function () {
21506 AV.User._currentUserMatchesDisk = true;
21507 return AV._refreshSubscriptionId();
21508 });
21509 });
21510 },
21511 _registerAuthenticationProvider: function _registerAuthenticationProvider(provider) {
21512 AV.User._authProviders[provider.getAuthType()] = provider; // Synchronize the current user with the auth provider.
21513
21514 if (!AV._config.disableCurrentUser && AV.User.current()) {
21515 AV.User.current()._synchronizeAuthData(provider.getAuthType());
21516 }
21517 },
21518 _logInWith: function _logInWith(provider, authData, options) {
21519 var user = AV.Object._create('_User');
21520
21521 return user._linkWith(provider, authData, options);
21522 }
21523 });
21524};
21525
21526/***/ }),
21527/* 533 */
21528/***/ (function(module, exports, __webpack_require__) {
21529
21530var _Object$defineProperty = __webpack_require__(145);
21531
21532function _defineProperty(obj, key, value) {
21533 if (key in obj) {
21534 _Object$defineProperty(obj, key, {
21535 value: value,
21536 enumerable: true,
21537 configurable: true,
21538 writable: true
21539 });
21540 } else {
21541 obj[key] = value;
21542 }
21543
21544 return obj;
21545}
21546
21547module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports;
21548
21549/***/ }),
21550/* 534 */
21551/***/ (function(module, exports, __webpack_require__) {
21552
21553"use strict";
21554
21555
21556var _interopRequireDefault = __webpack_require__(1);
21557
21558var _map = _interopRequireDefault(__webpack_require__(42));
21559
21560var _promise = _interopRequireDefault(__webpack_require__(12));
21561
21562var _keys = _interopRequireDefault(__webpack_require__(55));
21563
21564var _stringify = _interopRequireDefault(__webpack_require__(36));
21565
21566var _find = _interopRequireDefault(__webpack_require__(110));
21567
21568var _concat = _interopRequireDefault(__webpack_require__(30));
21569
21570var _ = __webpack_require__(2);
21571
21572var debug = __webpack_require__(67)('leancloud:query');
21573
21574var AVError = __webpack_require__(43);
21575
21576var _require = __webpack_require__(26),
21577 _request = _require._request,
21578 request = _require.request;
21579
21580var _require2 = __webpack_require__(29),
21581 ensureArray = _require2.ensureArray,
21582 transformFetchOptions = _require2.transformFetchOptions,
21583 continueWhile = _require2.continueWhile;
21584
21585var requires = function requires(value, message) {
21586 if (value === undefined) {
21587 throw new Error(message);
21588 }
21589}; // AV.Query is a way to create a list of AV.Objects.
21590
21591
21592module.exports = function (AV) {
21593 /**
21594 * Creates a new AV.Query for the given AV.Object subclass.
21595 * @param {Class|String} objectClass An instance of a subclass of AV.Object, or a AV className string.
21596 * @class
21597 *
21598 * <p>AV.Query defines a query that is used to fetch AV.Objects. The
21599 * most common use case is finding all objects that match a query through the
21600 * <code>find</code> method. For example, this sample code fetches all objects
21601 * of class <code>MyClass</code>. It calls a different function depending on
21602 * whether the fetch succeeded or not.
21603 *
21604 * <pre>
21605 * var query = new AV.Query(MyClass);
21606 * query.find().then(function(results) {
21607 * // results is an array of AV.Object.
21608 * }, function(error) {
21609 * // error is an instance of AVError.
21610 * });</pre></p>
21611 *
21612 * <p>An AV.Query can also be used to retrieve a single object whose id is
21613 * known, through the get method. For example, this sample code fetches an
21614 * object of class <code>MyClass</code> and id <code>myId</code>. It calls a
21615 * different function depending on whether the fetch succeeded or not.
21616 *
21617 * <pre>
21618 * var query = new AV.Query(MyClass);
21619 * query.get(myId).then(function(object) {
21620 * // object is an instance of AV.Object.
21621 * }, function(error) {
21622 * // error is an instance of AVError.
21623 * });</pre></p>
21624 *
21625 * <p>An AV.Query can also be used to count the number of objects that match
21626 * the query without retrieving all of those objects. For example, this
21627 * sample code counts the number of objects of the class <code>MyClass</code>
21628 * <pre>
21629 * var query = new AV.Query(MyClass);
21630 * query.count().then(function(number) {
21631 * // There are number instances of MyClass.
21632 * }, function(error) {
21633 * // error is an instance of AVError.
21634 * });</pre></p>
21635 */
21636 AV.Query = function (objectClass) {
21637 if (_.isString(objectClass)) {
21638 objectClass = AV.Object._getSubclass(objectClass);
21639 }
21640
21641 this.objectClass = objectClass;
21642 this.className = objectClass.prototype.className;
21643 this._where = {};
21644 this._include = [];
21645 this._select = [];
21646 this._limit = -1; // negative limit means, do not send a limit
21647
21648 this._skip = 0;
21649 this._defaultParams = {};
21650 };
21651 /**
21652 * Constructs a AV.Query that is the OR of the passed in queries. For
21653 * example:
21654 * <pre>var compoundQuery = AV.Query.or(query1, query2, query3);</pre>
21655 *
21656 * will create a compoundQuery that is an or of the query1, query2, and
21657 * query3.
21658 * @param {...AV.Query} var_args The list of queries to OR.
21659 * @return {AV.Query} The query that is the OR of the passed in queries.
21660 */
21661
21662
21663 AV.Query.or = function () {
21664 var queries = _.toArray(arguments);
21665
21666 var className = null;
21667
21668 AV._arrayEach(queries, function (q) {
21669 if (_.isNull(className)) {
21670 className = q.className;
21671 }
21672
21673 if (className !== q.className) {
21674 throw new Error('All queries must be for the same class');
21675 }
21676 });
21677
21678 var query = new AV.Query(className);
21679
21680 query._orQuery(queries);
21681
21682 return query;
21683 };
21684 /**
21685 * Constructs a AV.Query that is the AND of the passed in queries. For
21686 * example:
21687 * <pre>var compoundQuery = AV.Query.and(query1, query2, query3);</pre>
21688 *
21689 * will create a compoundQuery that is an 'and' of the query1, query2, and
21690 * query3.
21691 * @param {...AV.Query} var_args The list of queries to AND.
21692 * @return {AV.Query} The query that is the AND of the passed in queries.
21693 */
21694
21695
21696 AV.Query.and = function () {
21697 var queries = _.toArray(arguments);
21698
21699 var className = null;
21700
21701 AV._arrayEach(queries, function (q) {
21702 if (_.isNull(className)) {
21703 className = q.className;
21704 }
21705
21706 if (className !== q.className) {
21707 throw new Error('All queries must be for the same class');
21708 }
21709 });
21710
21711 var query = new AV.Query(className);
21712
21713 query._andQuery(queries);
21714
21715 return query;
21716 };
21717 /**
21718 * Retrieves a list of AVObjects that satisfy the CQL.
21719 * CQL syntax please see {@link https://leancloud.cn/docs/cql_guide.html CQL Guide}.
21720 *
21721 * @param {String} cql A CQL string, see {@link https://leancloud.cn/docs/cql_guide.html CQL Guide}.
21722 * @param {Array} pvalues An array contains placeholder values.
21723 * @param {AuthOptions} options
21724 * @return {Promise} A promise that is resolved with the results when
21725 * the query completes.
21726 */
21727
21728
21729 AV.Query.doCloudQuery = function (cql, pvalues, options) {
21730 var params = {
21731 cql: cql
21732 };
21733
21734 if (_.isArray(pvalues)) {
21735 params.pvalues = pvalues;
21736 } else {
21737 options = pvalues;
21738 }
21739
21740 var request = _request('cloudQuery', null, null, 'GET', params, options);
21741
21742 return request.then(function (response) {
21743 //query to process results.
21744 var query = new AV.Query(response.className);
21745 var results = (0, _map.default)(_).call(_, response.results, function (json) {
21746 var obj = query._newObject(response);
21747
21748 if (obj._finishFetch) {
21749 obj._finishFetch(query._processResult(json), true);
21750 }
21751
21752 return obj;
21753 });
21754 return {
21755 results: results,
21756 count: response.count,
21757 className: response.className
21758 };
21759 });
21760 };
21761 /**
21762 * Return a query with conditions from json.
21763 * This can be useful to send a query from server side to client side.
21764 * @since 4.0.0
21765 * @param {Object} json from {@link AV.Query#toJSON}
21766 * @return {AV.Query}
21767 */
21768
21769
21770 AV.Query.fromJSON = function (_ref) {
21771 var className = _ref.className,
21772 where = _ref.where,
21773 include = _ref.include,
21774 select = _ref.select,
21775 includeACL = _ref.includeACL,
21776 limit = _ref.limit,
21777 skip = _ref.skip,
21778 order = _ref.order;
21779
21780 if (typeof className !== 'string') {
21781 throw new TypeError('Invalid Query JSON, className must be a String.');
21782 }
21783
21784 var query = new AV.Query(className);
21785
21786 _.extend(query, {
21787 _where: where,
21788 _include: include,
21789 _select: select,
21790 _includeACL: includeACL,
21791 _limit: limit,
21792 _skip: skip,
21793 _order: order
21794 });
21795
21796 return query;
21797 };
21798
21799 AV.Query._extend = AV._extend;
21800
21801 _.extend(AV.Query.prototype,
21802 /** @lends AV.Query.prototype */
21803 {
21804 //hook to iterate result. Added by dennis<xzhuang@avoscloud.com>.
21805 _processResult: function _processResult(obj) {
21806 return obj;
21807 },
21808
21809 /**
21810 * Constructs an AV.Object whose id is already known by fetching data from
21811 * the server.
21812 *
21813 * @param {String} objectId The id of the object to be fetched.
21814 * @param {AuthOptions} options
21815 * @return {Promise.<AV.Object>}
21816 */
21817 get: function get(objectId, options) {
21818 if (!_.isString(objectId)) {
21819 throw new Error('objectId must be a string');
21820 }
21821
21822 if (objectId === '') {
21823 return _promise.default.reject(new AVError(AVError.OBJECT_NOT_FOUND, 'Object not found.'));
21824 }
21825
21826 var obj = this._newObject();
21827
21828 obj.id = objectId;
21829
21830 var queryJSON = this._getParams();
21831
21832 var fetchOptions = {};
21833 if ((0, _keys.default)(queryJSON)) fetchOptions.keys = (0, _keys.default)(queryJSON);
21834 if (queryJSON.include) fetchOptions.include = queryJSON.include;
21835 if (queryJSON.includeACL) fetchOptions.includeACL = queryJSON.includeACL;
21836 return _request('classes', this.className, objectId, 'GET', transformFetchOptions(fetchOptions), options).then(function (response) {
21837 if (_.isEmpty(response)) throw new AVError(AVError.OBJECT_NOT_FOUND, 'Object not found.');
21838
21839 obj._finishFetch(obj.parse(response), true);
21840
21841 return obj;
21842 });
21843 },
21844
21845 /**
21846 * Returns a JSON representation of this query.
21847 * @return {Object}
21848 */
21849 toJSON: function toJSON() {
21850 var className = this.className,
21851 where = this._where,
21852 include = this._include,
21853 select = this._select,
21854 includeACL = this._includeACL,
21855 limit = this._limit,
21856 skip = this._skip,
21857 order = this._order;
21858 return {
21859 className: className,
21860 where: where,
21861 include: include,
21862 select: select,
21863 includeACL: includeACL,
21864 limit: limit,
21865 skip: skip,
21866 order: order
21867 };
21868 },
21869 _getParams: function _getParams() {
21870 var params = _.extend({}, this._defaultParams, {
21871 where: this._where
21872 });
21873
21874 if (this._include.length > 0) {
21875 params.include = this._include.join(',');
21876 }
21877
21878 if (this._select.length > 0) {
21879 params.keys = this._select.join(',');
21880 }
21881
21882 if (this._includeACL !== undefined) {
21883 params.returnACL = this._includeACL;
21884 }
21885
21886 if (this._limit >= 0) {
21887 params.limit = this._limit;
21888 }
21889
21890 if (this._skip > 0) {
21891 params.skip = this._skip;
21892 }
21893
21894 if (this._order !== undefined) {
21895 params.order = this._order;
21896 }
21897
21898 return params;
21899 },
21900 _newObject: function _newObject(response) {
21901 var obj;
21902
21903 if (response && response.className) {
21904 obj = new AV.Object(response.className);
21905 } else {
21906 obj = new this.objectClass();
21907 }
21908
21909 return obj;
21910 },
21911 _createRequest: function _createRequest() {
21912 var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this._getParams();
21913 var options = arguments.length > 1 ? arguments[1] : undefined;
21914 var path = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "/classes/".concat(this.className);
21915
21916 if (encodeURIComponent((0, _stringify.default)(params)).length > 2000) {
21917 var body = {
21918 requests: [{
21919 method: 'GET',
21920 path: "/1.1".concat(path),
21921 params: params
21922 }]
21923 };
21924 return request({
21925 path: '/batch',
21926 method: 'POST',
21927 data: body,
21928 authOptions: options
21929 }).then(function (response) {
21930 var result = response[0];
21931
21932 if (result.success) {
21933 return result.success;
21934 }
21935
21936 var error = new AVError(result.error.code, result.error.error || 'Unknown batch error');
21937 throw error;
21938 });
21939 }
21940
21941 return request({
21942 method: 'GET',
21943 path: path,
21944 query: params,
21945 authOptions: options
21946 });
21947 },
21948 _parseResponse: function _parseResponse(response) {
21949 var _this = this;
21950
21951 return (0, _map.default)(_).call(_, response.results, function (json) {
21952 var obj = _this._newObject(response);
21953
21954 if (obj._finishFetch) {
21955 obj._finishFetch(_this._processResult(json), true);
21956 }
21957
21958 return obj;
21959 });
21960 },
21961
21962 /**
21963 * Retrieves a list of AVObjects that satisfy this query.
21964 *
21965 * @param {AuthOptions} options
21966 * @return {Promise} A promise that is resolved with the results when
21967 * the query completes.
21968 */
21969 find: function find(options) {
21970 var request = this._createRequest(undefined, options);
21971
21972 return request.then(this._parseResponse.bind(this));
21973 },
21974
21975 /**
21976 * Retrieves both AVObjects and total count.
21977 *
21978 * @since 4.12.0
21979 * @param {AuthOptions} options
21980 * @return {Promise} A tuple contains results and count.
21981 */
21982 findAndCount: function findAndCount(options) {
21983 var _this2 = this;
21984
21985 var params = this._getParams();
21986
21987 params.count = 1;
21988
21989 var request = this._createRequest(params, options);
21990
21991 return request.then(function (response) {
21992 return [_this2._parseResponse(response), response.count];
21993 });
21994 },
21995
21996 /**
21997 * scan a Query. masterKey required.
21998 *
21999 * @since 2.1.0
22000 * @param {object} [options]
22001 * @param {string} [options.orderedBy] specify the key to sort
22002 * @param {number} [options.batchSize] specify the batch size for each request
22003 * @param {AuthOptions} [authOptions]
22004 * @return {AsyncIterator.<AV.Object>}
22005 * @example const testIterator = {
22006 * [Symbol.asyncIterator]() {
22007 * return new Query('Test').scan(undefined, { useMasterKey: true });
22008 * },
22009 * };
22010 * for await (const test of testIterator) {
22011 * console.log(test.id);
22012 * }
22013 */
22014 scan: function scan() {
22015 var _this3 = this;
22016
22017 var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
22018 orderedBy = _ref2.orderedBy,
22019 batchSize = _ref2.batchSize;
22020
22021 var authOptions = arguments.length > 1 ? arguments[1] : undefined;
22022
22023 var condition = this._getParams();
22024
22025 debug('scan %O', condition);
22026
22027 if (condition.order) {
22028 console.warn('The order of the query is ignored for Query#scan. Checkout the orderedBy option of Query#scan.');
22029 delete condition.order;
22030 }
22031
22032 if (condition.skip) {
22033 console.warn('The skip option of the query is ignored for Query#scan.');
22034 delete condition.skip;
22035 }
22036
22037 if (condition.limit) {
22038 console.warn('The limit option of the query is ignored for Query#scan.');
22039 delete condition.limit;
22040 }
22041
22042 if (orderedBy) condition.scan_key = orderedBy;
22043 if (batchSize) condition.limit = batchSize;
22044 var cursor;
22045 var remainResults = [];
22046 return {
22047 next: function next() {
22048 if (remainResults.length) {
22049 return _promise.default.resolve({
22050 done: false,
22051 value: remainResults.shift()
22052 });
22053 }
22054
22055 if (cursor === null) {
22056 return _promise.default.resolve({
22057 done: true
22058 });
22059 }
22060
22061 return _request('scan/classes', _this3.className, null, 'GET', cursor ? _.extend({}, condition, {
22062 cursor: cursor
22063 }) : condition, authOptions).then(function (response) {
22064 cursor = response.cursor;
22065
22066 if (response.results.length) {
22067 var results = _this3._parseResponse(response);
22068
22069 results.forEach(function (result) {
22070 return remainResults.push(result);
22071 });
22072 }
22073
22074 if (cursor === null && remainResults.length === 0) {
22075 return {
22076 done: true
22077 };
22078 }
22079
22080 return {
22081 done: false,
22082 value: remainResults.shift()
22083 };
22084 });
22085 }
22086 };
22087 },
22088
22089 /**
22090 * Delete objects retrieved by this query.
22091 * @param {AuthOptions} options
22092 * @return {Promise} A promise that is fulfilled when the save
22093 * completes.
22094 */
22095 destroyAll: function destroyAll(options) {
22096 var self = this;
22097 return (0, _find.default)(self).call(self, options).then(function (objects) {
22098 return AV.Object.destroyAll(objects, options);
22099 });
22100 },
22101
22102 /**
22103 * Counts the number of objects that match this query.
22104 *
22105 * @param {AuthOptions} options
22106 * @return {Promise} A promise that is resolved with the count when
22107 * the query completes.
22108 */
22109 count: function count(options) {
22110 var params = this._getParams();
22111
22112 params.limit = 0;
22113 params.count = 1;
22114
22115 var request = this._createRequest(params, options);
22116
22117 return request.then(function (response) {
22118 return response.count;
22119 });
22120 },
22121
22122 /**
22123 * Retrieves at most one AV.Object that satisfies this query.
22124 *
22125 * @param {AuthOptions} options
22126 * @return {Promise} A promise that is resolved with the object when
22127 * the query completes.
22128 */
22129 first: function first(options) {
22130 var self = this;
22131
22132 var params = this._getParams();
22133
22134 params.limit = 1;
22135
22136 var request = this._createRequest(params, options);
22137
22138 return request.then(function (response) {
22139 return (0, _map.default)(_).call(_, response.results, function (json) {
22140 var obj = self._newObject();
22141
22142 if (obj._finishFetch) {
22143 obj._finishFetch(self._processResult(json), true);
22144 }
22145
22146 return obj;
22147 })[0];
22148 });
22149 },
22150
22151 /**
22152 * Sets the number of results to skip before returning any results.
22153 * This is useful for pagination.
22154 * Default is to skip zero results.
22155 * @param {Number} n the number of results to skip.
22156 * @return {AV.Query} Returns the query, so you can chain this call.
22157 */
22158 skip: function skip(n) {
22159 requires(n, 'undefined is not a valid skip value');
22160 this._skip = n;
22161 return this;
22162 },
22163
22164 /**
22165 * Sets the limit of the number of results to return. The default limit is
22166 * 100, with a maximum of 1000 results being returned at a time.
22167 * @param {Number} n the number of results to limit to.
22168 * @return {AV.Query} Returns the query, so you can chain this call.
22169 */
22170 limit: function limit(n) {
22171 requires(n, 'undefined is not a valid limit value');
22172 this._limit = n;
22173 return this;
22174 },
22175
22176 /**
22177 * Add a constraint to the query that requires a particular key's value to
22178 * be equal to the provided value.
22179 * @param {String} key The key to check.
22180 * @param value The value that the AV.Object must contain.
22181 * @return {AV.Query} Returns the query, so you can chain this call.
22182 */
22183 equalTo: function equalTo(key, value) {
22184 requires(key, 'undefined is not a valid key');
22185 requires(value, 'undefined is not a valid value');
22186 this._where[key] = AV._encode(value);
22187 return this;
22188 },
22189
22190 /**
22191 * Helper for condition queries
22192 * @private
22193 */
22194 _addCondition: function _addCondition(key, condition, value) {
22195 requires(key, 'undefined is not a valid condition key');
22196 requires(condition, 'undefined is not a valid condition');
22197 requires(value, 'undefined is not a valid condition value'); // Check if we already have a condition
22198
22199 if (!this._where[key]) {
22200 this._where[key] = {};
22201 }
22202
22203 this._where[key][condition] = AV._encode(value);
22204 return this;
22205 },
22206
22207 /**
22208 * Add a constraint to the query that requires a particular
22209 * <strong>array</strong> key's length to be equal to the provided value.
22210 * @param {String} key The array key to check.
22211 * @param {number} value The length value.
22212 * @return {AV.Query} Returns the query, so you can chain this call.
22213 */
22214 sizeEqualTo: function sizeEqualTo(key, value) {
22215 this._addCondition(key, '$size', value);
22216
22217 return this;
22218 },
22219
22220 /**
22221 * Add a constraint to the query that requires a particular key's value to
22222 * be not equal to the provided value.
22223 * @param {String} key The key to check.
22224 * @param value The value that must not be equalled.
22225 * @return {AV.Query} Returns the query, so you can chain this call.
22226 */
22227 notEqualTo: function notEqualTo(key, value) {
22228 this._addCondition(key, '$ne', value);
22229
22230 return this;
22231 },
22232
22233 /**
22234 * Add a constraint to the query that requires a particular key's value to
22235 * be less than the provided value.
22236 * @param {String} key The key to check.
22237 * @param value The value that provides an upper bound.
22238 * @return {AV.Query} Returns the query, so you can chain this call.
22239 */
22240 lessThan: function lessThan(key, value) {
22241 this._addCondition(key, '$lt', value);
22242
22243 return this;
22244 },
22245
22246 /**
22247 * Add a constraint to the query that requires a particular key's value to
22248 * be greater than the provided value.
22249 * @param {String} key The key to check.
22250 * @param value The value that provides an lower bound.
22251 * @return {AV.Query} Returns the query, so you can chain this call.
22252 */
22253 greaterThan: function greaterThan(key, value) {
22254 this._addCondition(key, '$gt', value);
22255
22256 return this;
22257 },
22258
22259 /**
22260 * Add a constraint to the query that requires a particular key's value to
22261 * be less than or equal to the provided value.
22262 * @param {String} key The key to check.
22263 * @param value The value that provides an upper bound.
22264 * @return {AV.Query} Returns the query, so you can chain this call.
22265 */
22266 lessThanOrEqualTo: function lessThanOrEqualTo(key, value) {
22267 this._addCondition(key, '$lte', value);
22268
22269 return this;
22270 },
22271
22272 /**
22273 * Add a constraint to the query that requires a particular key's value to
22274 * be greater than or equal to the provided value.
22275 * @param {String} key The key to check.
22276 * @param value The value that provides an lower bound.
22277 * @return {AV.Query} Returns the query, so you can chain this call.
22278 */
22279 greaterThanOrEqualTo: function greaterThanOrEqualTo(key, value) {
22280 this._addCondition(key, '$gte', value);
22281
22282 return this;
22283 },
22284
22285 /**
22286 * Add a constraint to the query that requires a particular key's value to
22287 * be contained in the provided list of values.
22288 * @param {String} key The key to check.
22289 * @param {Array} values The values that will match.
22290 * @return {AV.Query} Returns the query, so you can chain this call.
22291 */
22292 containedIn: function containedIn(key, values) {
22293 this._addCondition(key, '$in', values);
22294
22295 return this;
22296 },
22297
22298 /**
22299 * Add a constraint to the query that requires a particular key's value to
22300 * not be contained in the provided list of values.
22301 * @param {String} key The key to check.
22302 * @param {Array} values The values that will not match.
22303 * @return {AV.Query} Returns the query, so you can chain this call.
22304 */
22305 notContainedIn: function notContainedIn(key, values) {
22306 this._addCondition(key, '$nin', values);
22307
22308 return this;
22309 },
22310
22311 /**
22312 * Add a constraint to the query that requires a particular key's value to
22313 * contain each one of the provided list of values.
22314 * @param {String} key The key to check. This key's value must be an array.
22315 * @param {Array} values The values that will match.
22316 * @return {AV.Query} Returns the query, so you can chain this call.
22317 */
22318 containsAll: function containsAll(key, values) {
22319 this._addCondition(key, '$all', values);
22320
22321 return this;
22322 },
22323
22324 /**
22325 * Add a constraint for finding objects that contain the given key.
22326 * @param {String} key The key that should exist.
22327 * @return {AV.Query} Returns the query, so you can chain this call.
22328 */
22329 exists: function exists(key) {
22330 this._addCondition(key, '$exists', true);
22331
22332 return this;
22333 },
22334
22335 /**
22336 * Add a constraint for finding objects that do not contain a given key.
22337 * @param {String} key The key that should not exist
22338 * @return {AV.Query} Returns the query, so you can chain this call.
22339 */
22340 doesNotExist: function doesNotExist(key) {
22341 this._addCondition(key, '$exists', false);
22342
22343 return this;
22344 },
22345
22346 /**
22347 * Add a regular expression constraint for finding string values that match
22348 * the provided regular expression.
22349 * This may be slow for large datasets.
22350 * @param {String} key The key that the string to match is stored in.
22351 * @param {RegExp} regex The regular expression pattern to match.
22352 * @return {AV.Query} Returns the query, so you can chain this call.
22353 */
22354 matches: function matches(key, regex, modifiers) {
22355 this._addCondition(key, '$regex', regex);
22356
22357 if (!modifiers) {
22358 modifiers = '';
22359 } // Javascript regex options support mig as inline options but store them
22360 // as properties of the object. We support mi & should migrate them to
22361 // modifiers
22362
22363
22364 if (regex.ignoreCase) {
22365 modifiers += 'i';
22366 }
22367
22368 if (regex.multiline) {
22369 modifiers += 'm';
22370 }
22371
22372 if (modifiers && modifiers.length) {
22373 this._addCondition(key, '$options', modifiers);
22374 }
22375
22376 return this;
22377 },
22378
22379 /**
22380 * Add a constraint that requires that a key's value matches a AV.Query
22381 * constraint.
22382 * @param {String} key The key that the contains the object to match the
22383 * query.
22384 * @param {AV.Query} query The query that should match.
22385 * @return {AV.Query} Returns the query, so you can chain this call.
22386 */
22387 matchesQuery: function matchesQuery(key, query) {
22388 var queryJSON = query._getParams();
22389
22390 queryJSON.className = query.className;
22391
22392 this._addCondition(key, '$inQuery', queryJSON);
22393
22394 return this;
22395 },
22396
22397 /**
22398 * Add a constraint that requires that a key's value not matches a
22399 * AV.Query constraint.
22400 * @param {String} key The key that the contains the object to match the
22401 * query.
22402 * @param {AV.Query} query The query that should not match.
22403 * @return {AV.Query} Returns the query, so you can chain this call.
22404 */
22405 doesNotMatchQuery: function doesNotMatchQuery(key, query) {
22406 var queryJSON = query._getParams();
22407
22408 queryJSON.className = query.className;
22409
22410 this._addCondition(key, '$notInQuery', queryJSON);
22411
22412 return this;
22413 },
22414
22415 /**
22416 * Add a constraint that requires that a key's value matches a value in
22417 * an object returned by a different AV.Query.
22418 * @param {String} key The key that contains the value that is being
22419 * matched.
22420 * @param {String} queryKey The key in the objects returned by the query to
22421 * match against.
22422 * @param {AV.Query} query The query to run.
22423 * @return {AV.Query} Returns the query, so you can chain this call.
22424 */
22425 matchesKeyInQuery: function matchesKeyInQuery(key, queryKey, query) {
22426 var queryJSON = query._getParams();
22427
22428 queryJSON.className = query.className;
22429
22430 this._addCondition(key, '$select', {
22431 key: queryKey,
22432 query: queryJSON
22433 });
22434
22435 return this;
22436 },
22437
22438 /**
22439 * Add a constraint that requires that a key's value not match a value in
22440 * an object returned by a different AV.Query.
22441 * @param {String} key The key that contains the value that is being
22442 * excluded.
22443 * @param {String} queryKey The key in the objects returned by the query to
22444 * match against.
22445 * @param {AV.Query} query The query to run.
22446 * @return {AV.Query} Returns the query, so you can chain this call.
22447 */
22448 doesNotMatchKeyInQuery: function doesNotMatchKeyInQuery(key, queryKey, query) {
22449 var queryJSON = query._getParams();
22450
22451 queryJSON.className = query.className;
22452
22453 this._addCondition(key, '$dontSelect', {
22454 key: queryKey,
22455 query: queryJSON
22456 });
22457
22458 return this;
22459 },
22460
22461 /**
22462 * Add constraint that at least one of the passed in queries matches.
22463 * @param {Array} queries
22464 * @return {AV.Query} Returns the query, so you can chain this call.
22465 * @private
22466 */
22467 _orQuery: function _orQuery(queries) {
22468 var queryJSON = (0, _map.default)(_).call(_, queries, function (q) {
22469 return q._getParams().where;
22470 });
22471 this._where.$or = queryJSON;
22472 return this;
22473 },
22474
22475 /**
22476 * Add constraint that both of the passed in queries matches.
22477 * @param {Array} queries
22478 * @return {AV.Query} Returns the query, so you can chain this call.
22479 * @private
22480 */
22481 _andQuery: function _andQuery(queries) {
22482 var queryJSON = (0, _map.default)(_).call(_, queries, function (q) {
22483 return q._getParams().where;
22484 });
22485 this._where.$and = queryJSON;
22486 return this;
22487 },
22488
22489 /**
22490 * Converts a string into a regex that matches it.
22491 * Surrounding with \Q .. \E does this, we just need to escape \E's in
22492 * the text separately.
22493 * @private
22494 */
22495 _quote: function _quote(s) {
22496 return '\\Q' + s.replace('\\E', '\\E\\\\E\\Q') + '\\E';
22497 },
22498
22499 /**
22500 * Add a constraint for finding string values that contain a provided
22501 * string. This may be slow for large datasets.
22502 * @param {String} key The key that the string to match is stored in.
22503 * @param {String} substring The substring that the value must contain.
22504 * @return {AV.Query} Returns the query, so you can chain this call.
22505 */
22506 contains: function contains(key, value) {
22507 this._addCondition(key, '$regex', this._quote(value));
22508
22509 return this;
22510 },
22511
22512 /**
22513 * Add a constraint for finding string values that start with a provided
22514 * string. This query will use the backend index, so it will be fast even
22515 * for large datasets.
22516 * @param {String} key The key that the string to match is stored in.
22517 * @param {String} prefix The substring that the value must start with.
22518 * @return {AV.Query} Returns the query, so you can chain this call.
22519 */
22520 startsWith: function startsWith(key, value) {
22521 this._addCondition(key, '$regex', '^' + this._quote(value));
22522
22523 return this;
22524 },
22525
22526 /**
22527 * Add a constraint for finding string values that end with a provided
22528 * string. This will be slow for large datasets.
22529 * @param {String} key The key that the string to match is stored in.
22530 * @param {String} suffix The substring that the value must end with.
22531 * @return {AV.Query} Returns the query, so you can chain this call.
22532 */
22533 endsWith: function endsWith(key, value) {
22534 this._addCondition(key, '$regex', this._quote(value) + '$');
22535
22536 return this;
22537 },
22538
22539 /**
22540 * Sorts the results in ascending order by the given key.
22541 *
22542 * @param {String} key The key to order by.
22543 * @return {AV.Query} Returns the query, so you can chain this call.
22544 */
22545 ascending: function ascending(key) {
22546 requires(key, 'undefined is not a valid key');
22547 this._order = key;
22548 return this;
22549 },
22550
22551 /**
22552 * Also sorts the results in ascending order by the given key. The previous sort keys have
22553 * precedence over this key.
22554 *
22555 * @param {String} key The key to order by
22556 * @return {AV.Query} Returns the query so you can chain this call.
22557 */
22558 addAscending: function addAscending(key) {
22559 requires(key, 'undefined is not a valid key');
22560 if (this._order) this._order += ',' + key;else this._order = key;
22561 return this;
22562 },
22563
22564 /**
22565 * Sorts the results in descending order by the given key.
22566 *
22567 * @param {String} key The key to order by.
22568 * @return {AV.Query} Returns the query, so you can chain this call.
22569 */
22570 descending: function descending(key) {
22571 requires(key, 'undefined is not a valid key');
22572 this._order = '-' + key;
22573 return this;
22574 },
22575
22576 /**
22577 * Also sorts the results in descending order by the given key. The previous sort keys have
22578 * precedence over this key.
22579 *
22580 * @param {String} key The key to order by
22581 * @return {AV.Query} Returns the query so you can chain this call.
22582 */
22583 addDescending: function addDescending(key) {
22584 requires(key, 'undefined is not a valid key');
22585 if (this._order) this._order += ',-' + key;else this._order = '-' + key;
22586 return this;
22587 },
22588
22589 /**
22590 * Add a proximity based constraint for finding objects with key point
22591 * values near the point given.
22592 * @param {String} key The key that the AV.GeoPoint is stored in.
22593 * @param {AV.GeoPoint} point The reference AV.GeoPoint that is used.
22594 * @return {AV.Query} Returns the query, so you can chain this call.
22595 */
22596 near: function near(key, point) {
22597 if (!(point instanceof AV.GeoPoint)) {
22598 // Try to cast it to a GeoPoint, so that near("loc", [20,30]) works.
22599 point = new AV.GeoPoint(point);
22600 }
22601
22602 this._addCondition(key, '$nearSphere', point);
22603
22604 return this;
22605 },
22606
22607 /**
22608 * Add a proximity based constraint for finding objects with key point
22609 * values near the point given and within the maximum distance given.
22610 * @param {String} key The key that the AV.GeoPoint is stored in.
22611 * @param {AV.GeoPoint} point The reference AV.GeoPoint that is used.
22612 * @param maxDistance Maximum distance (in radians) of results to return.
22613 * @return {AV.Query} Returns the query, so you can chain this call.
22614 */
22615 withinRadians: function withinRadians(key, point, distance) {
22616 this.near(key, point);
22617
22618 this._addCondition(key, '$maxDistance', distance);
22619
22620 return this;
22621 },
22622
22623 /**
22624 * Add a proximity based constraint for finding objects with key point
22625 * values near the point given and within the maximum distance given.
22626 * Radius of earth used is 3958.8 miles.
22627 * @param {String} key The key that the AV.GeoPoint is stored in.
22628 * @param {AV.GeoPoint} point The reference AV.GeoPoint that is used.
22629 * @param {Number} maxDistance Maximum distance (in miles) of results to
22630 * return.
22631 * @return {AV.Query} Returns the query, so you can chain this call.
22632 */
22633 withinMiles: function withinMiles(key, point, distance) {
22634 return this.withinRadians(key, point, distance / 3958.8);
22635 },
22636
22637 /**
22638 * Add a proximity based constraint for finding objects with key point
22639 * values near the point given and within the maximum distance given.
22640 * Radius of earth used is 6371.0 kilometers.
22641 * @param {String} key The key that the AV.GeoPoint is stored in.
22642 * @param {AV.GeoPoint} point The reference AV.GeoPoint that is used.
22643 * @param {Number} maxDistance Maximum distance (in kilometers) of results
22644 * to return.
22645 * @return {AV.Query} Returns the query, so you can chain this call.
22646 */
22647 withinKilometers: function withinKilometers(key, point, distance) {
22648 return this.withinRadians(key, point, distance / 6371.0);
22649 },
22650
22651 /**
22652 * Add a constraint to the query that requires a particular key's
22653 * coordinates be contained within a given rectangular geographic bounding
22654 * box.
22655 * @param {String} key The key to be constrained.
22656 * @param {AV.GeoPoint} southwest
22657 * The lower-left inclusive corner of the box.
22658 * @param {AV.GeoPoint} northeast
22659 * The upper-right inclusive corner of the box.
22660 * @return {AV.Query} Returns the query, so you can chain this call.
22661 */
22662 withinGeoBox: function withinGeoBox(key, southwest, northeast) {
22663 if (!(southwest instanceof AV.GeoPoint)) {
22664 southwest = new AV.GeoPoint(southwest);
22665 }
22666
22667 if (!(northeast instanceof AV.GeoPoint)) {
22668 northeast = new AV.GeoPoint(northeast);
22669 }
22670
22671 this._addCondition(key, '$within', {
22672 $box: [southwest, northeast]
22673 });
22674
22675 return this;
22676 },
22677
22678 /**
22679 * Include nested AV.Objects for the provided key. You can use dot
22680 * notation to specify which fields in the included object are also fetch.
22681 * @param {String[]} keys The name of the key to include.
22682 * @return {AV.Query} Returns the query, so you can chain this call.
22683 */
22684 include: function include(keys) {
22685 var _this4 = this;
22686
22687 requires(keys, 'undefined is not a valid key');
22688
22689 _.forEach(arguments, function (keys) {
22690 var _context;
22691
22692 _this4._include = (0, _concat.default)(_context = _this4._include).call(_context, ensureArray(keys));
22693 });
22694
22695 return this;
22696 },
22697
22698 /**
22699 * Include the ACL.
22700 * @param {Boolean} [value=true] Whether to include the ACL
22701 * @return {AV.Query} Returns the query, so you can chain this call.
22702 */
22703 includeACL: function includeACL() {
22704 var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
22705 this._includeACL = value;
22706 return this;
22707 },
22708
22709 /**
22710 * Restrict the fields of the returned AV.Objects to include only the
22711 * provided keys. If this is called multiple times, then all of the keys
22712 * specified in each of the calls will be included.
22713 * @param {String[]} keys The names of the keys to include.
22714 * @return {AV.Query} Returns the query, so you can chain this call.
22715 */
22716 select: function select(keys) {
22717 var _this5 = this;
22718
22719 requires(keys, 'undefined is not a valid key');
22720
22721 _.forEach(arguments, function (keys) {
22722 var _context2;
22723
22724 _this5._select = (0, _concat.default)(_context2 = _this5._select).call(_context2, ensureArray(keys));
22725 });
22726
22727 return this;
22728 },
22729
22730 /**
22731 * Iterates over each result of a query, calling a callback for each one. If
22732 * the callback returns a promise, the iteration will not continue until
22733 * that promise has been fulfilled. If the callback returns a rejected
22734 * promise, then iteration will stop with that error. The items are
22735 * processed in an unspecified order. The query may not have any sort order,
22736 * and may not use limit or skip.
22737 * @param callback {Function} Callback that will be called with each result
22738 * of the query.
22739 * @return {Promise} A promise that will be fulfilled once the
22740 * iteration has completed.
22741 */
22742 each: function each(callback) {
22743 var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
22744
22745 if (this._order || this._skip || this._limit >= 0) {
22746 var error = new Error('Cannot iterate on a query with sort, skip, or limit.');
22747 return _promise.default.reject(error);
22748 }
22749
22750 var query = new AV.Query(this.objectClass); // We can override the batch size from the options.
22751 // This is undocumented, but useful for testing.
22752
22753 query._limit = options.batchSize || 100;
22754 query._where = _.clone(this._where);
22755 query._include = _.clone(this._include);
22756 query.ascending('objectId');
22757 var finished = false;
22758 return continueWhile(function () {
22759 return !finished;
22760 }, function () {
22761 return (0, _find.default)(query).call(query, options).then(function (results) {
22762 var callbacksDone = _promise.default.resolve();
22763
22764 _.each(results, function (result) {
22765 callbacksDone = callbacksDone.then(function () {
22766 return callback(result);
22767 });
22768 });
22769
22770 return callbacksDone.then(function () {
22771 if (results.length >= query._limit) {
22772 query.greaterThan('objectId', results[results.length - 1].id);
22773 } else {
22774 finished = true;
22775 }
22776 });
22777 });
22778 });
22779 },
22780
22781 /**
22782 * Subscribe the changes of this query.
22783 *
22784 * LiveQuery is not included in the default bundle: {@link https://url.leanapp.cn/enable-live-query}.
22785 *
22786 * @since 3.0.0
22787 * @return {AV.LiveQuery} An eventemitter which can be used to get LiveQuery updates;
22788 */
22789 subscribe: function subscribe(options) {
22790 return AV.LiveQuery.init(this, options);
22791 }
22792 });
22793
22794 AV.FriendShipQuery = AV.Query._extend({
22795 _newObject: function _newObject() {
22796 var UserClass = AV.Object._getSubclass('_User');
22797
22798 return new UserClass();
22799 },
22800 _processResult: function _processResult(json) {
22801 if (json && json[this._friendshipTag]) {
22802 var user = json[this._friendshipTag];
22803
22804 if (user.__type === 'Pointer' && user.className === '_User') {
22805 delete user.__type;
22806 delete user.className;
22807 }
22808
22809 return user;
22810 } else {
22811 return null;
22812 }
22813 }
22814 });
22815};
22816
22817/***/ }),
22818/* 535 */
22819/***/ (function(module, exports, __webpack_require__) {
22820
22821"use strict";
22822
22823
22824var _interopRequireDefault = __webpack_require__(1);
22825
22826var _promise = _interopRequireDefault(__webpack_require__(12));
22827
22828var _keys = _interopRequireDefault(__webpack_require__(55));
22829
22830var _ = __webpack_require__(2);
22831
22832var EventEmitter = __webpack_require__(224);
22833
22834var _require = __webpack_require__(29),
22835 inherits = _require.inherits;
22836
22837var _require2 = __webpack_require__(26),
22838 request = _require2.request;
22839
22840var subscribe = function subscribe(queryJSON, subscriptionId) {
22841 return request({
22842 method: 'POST',
22843 path: '/LiveQuery/subscribe',
22844 data: {
22845 query: queryJSON,
22846 id: subscriptionId
22847 }
22848 });
22849};
22850
22851module.exports = function (AV) {
22852 var requireRealtime = function requireRealtime() {
22853 if (!AV._config.realtime) {
22854 throw new Error('LiveQuery not supported. Please use the LiveQuery bundle. https://url.leanapp.cn/enable-live-query');
22855 }
22856 };
22857 /**
22858 * @class
22859 * A LiveQuery, created by {@link AV.Query#subscribe} is an EventEmitter notifies changes of the Query.
22860 * @since 3.0.0
22861 */
22862
22863
22864 AV.LiveQuery = inherits(EventEmitter,
22865 /** @lends AV.LiveQuery.prototype */
22866 {
22867 constructor: function constructor(id, client, queryJSON, subscriptionId) {
22868 var _this = this;
22869
22870 EventEmitter.apply(this);
22871 this.id = id;
22872 this._client = client;
22873
22874 this._client.register(this);
22875
22876 this._queryJSON = queryJSON;
22877 this._subscriptionId = subscriptionId;
22878 this._onMessage = this._dispatch.bind(this);
22879
22880 this._onReconnect = function () {
22881 subscribe(_this._queryJSON, _this._subscriptionId).catch(function (error) {
22882 return console.error("LiveQuery resubscribe error: ".concat(error.message));
22883 });
22884 };
22885
22886 client.on('message', this._onMessage);
22887 client.on('reconnect', this._onReconnect);
22888 },
22889 _dispatch: function _dispatch(message) {
22890 var _this2 = this;
22891
22892 message.forEach(function (_ref) {
22893 var op = _ref.op,
22894 object = _ref.object,
22895 queryId = _ref.query_id,
22896 updatedKeys = _ref.updatedKeys;
22897 if (queryId !== _this2.id) return;
22898 var target = AV.parseJSON(_.extend({
22899 __type: object.className === '_File' ? 'File' : 'Object'
22900 }, object));
22901
22902 if (updatedKeys) {
22903 /**
22904 * An existing AV.Object which fulfills the Query you subscribe is updated.
22905 * @event AV.LiveQuery#update
22906 * @param {AV.Object|AV.File} target updated object
22907 * @param {String[]} updatedKeys updated keys
22908 */
22909
22910 /**
22911 * An existing AV.Object which doesn't fulfill the Query is updated and now it fulfills the Query.
22912 * @event AV.LiveQuery#enter
22913 * @param {AV.Object|AV.File} target updated object
22914 * @param {String[]} updatedKeys updated keys
22915 */
22916
22917 /**
22918 * An existing AV.Object which fulfills the Query is updated and now it doesn't fulfill the Query.
22919 * @event AV.LiveQuery#leave
22920 * @param {AV.Object|AV.File} target updated object
22921 * @param {String[]} updatedKeys updated keys
22922 */
22923 _this2.emit(op, target, updatedKeys);
22924 } else {
22925 /**
22926 * A new AV.Object which fulfills the Query you subscribe is created.
22927 * @event AV.LiveQuery#create
22928 * @param {AV.Object|AV.File} target updated object
22929 */
22930
22931 /**
22932 * An existing AV.Object which fulfills the Query you subscribe is deleted.
22933 * @event AV.LiveQuery#delete
22934 * @param {AV.Object|AV.File} target updated object
22935 */
22936 _this2.emit(op, target);
22937 }
22938 });
22939 },
22940
22941 /**
22942 * unsubscribe the query
22943 *
22944 * @return {Promise}
22945 */
22946 unsubscribe: function unsubscribe() {
22947 var client = this._client;
22948 client.off('message', this._onMessage);
22949 client.off('reconnect', this._onReconnect);
22950 client.deregister(this);
22951 return request({
22952 method: 'POST',
22953 path: '/LiveQuery/unsubscribe',
22954 data: {
22955 id: client.id,
22956 query_id: this.id
22957 }
22958 });
22959 }
22960 },
22961 /** @lends AV.LiveQuery */
22962 {
22963 init: function init(query) {
22964 var _ref2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
22965 _ref2$subscriptionId = _ref2.subscriptionId,
22966 userDefinedSubscriptionId = _ref2$subscriptionId === void 0 ? AV._getSubscriptionId() : _ref2$subscriptionId;
22967
22968 requireRealtime();
22969 if (!(query instanceof AV.Query)) throw new TypeError('LiveQuery must be inited with a Query');
22970 return _promise.default.resolve(userDefinedSubscriptionId).then(function (subscriptionId) {
22971 return AV._config.realtime.createLiveQueryClient(subscriptionId).then(function (liveQueryClient) {
22972 var _query$_getParams = query._getParams(),
22973 where = _query$_getParams.where,
22974 keys = (0, _keys.default)(_query$_getParams),
22975 returnACL = _query$_getParams.returnACL;
22976
22977 var queryJSON = {
22978 where: where,
22979 keys: keys,
22980 returnACL: returnACL,
22981 className: query.className
22982 };
22983 var promise = subscribe(queryJSON, subscriptionId).then(function (_ref3) {
22984 var queryId = _ref3.query_id;
22985 return new AV.LiveQuery(queryId, liveQueryClient, queryJSON, subscriptionId);
22986 }).finally(function () {
22987 liveQueryClient.deregister(promise);
22988 });
22989 liveQueryClient.register(promise);
22990 return promise;
22991 });
22992 });
22993 },
22994
22995 /**
22996 * Pause the LiveQuery connection. This is useful to deactivate the SDK when the app is swtiched to background.
22997 * @static
22998 * @return void
22999 */
23000 pause: function pause() {
23001 requireRealtime();
23002 return AV._config.realtime.pause();
23003 },
23004
23005 /**
23006 * Resume the LiveQuery connection. All subscriptions will be restored after reconnection.
23007 * @static
23008 * @return void
23009 */
23010 resume: function resume() {
23011 requireRealtime();
23012 return AV._config.realtime.resume();
23013 }
23014 });
23015};
23016
23017/***/ }),
23018/* 536 */
23019/***/ (function(module, exports, __webpack_require__) {
23020
23021"use strict";
23022
23023
23024var _ = __webpack_require__(2);
23025
23026var _require = __webpack_require__(29),
23027 tap = _require.tap;
23028
23029module.exports = function (AV) {
23030 /**
23031 * @class
23032 * @example
23033 * AV.Captcha.request().then(captcha => {
23034 * captcha.bind({
23035 * textInput: 'code', // the id for textInput
23036 * image: 'captcha',
23037 * verifyButton: 'verify',
23038 * }, {
23039 * success: (validateCode) => {}, // next step
23040 * error: (error) => {}, // present error.message to user
23041 * });
23042 * });
23043 */
23044 AV.Captcha = function Captcha(options, authOptions) {
23045 this._options = options;
23046 this._authOptions = authOptions;
23047 /**
23048 * The image url of the captcha
23049 * @type string
23050 */
23051
23052 this.url = undefined;
23053 /**
23054 * The captchaToken of the captcha.
23055 * @type string
23056 */
23057
23058 this.captchaToken = undefined;
23059 /**
23060 * The validateToken of the captcha.
23061 * @type string
23062 */
23063
23064 this.validateToken = undefined;
23065 };
23066 /**
23067 * Refresh the captcha
23068 * @return {Promise.<string>} a new capcha url
23069 */
23070
23071
23072 AV.Captcha.prototype.refresh = function refresh() {
23073 var _this = this;
23074
23075 return AV.Cloud._requestCaptcha(this._options, this._authOptions).then(function (_ref) {
23076 var captchaToken = _ref.captchaToken,
23077 url = _ref.url;
23078
23079 _.extend(_this, {
23080 captchaToken: captchaToken,
23081 url: url
23082 });
23083
23084 return url;
23085 });
23086 };
23087 /**
23088 * Verify the captcha
23089 * @param {String} code The code from user input
23090 * @return {Promise.<string>} validateToken if the code is valid
23091 */
23092
23093
23094 AV.Captcha.prototype.verify = function verify(code) {
23095 var _this2 = this;
23096
23097 return AV.Cloud.verifyCaptcha(code, this.captchaToken).then(tap(function (validateToken) {
23098 return _this2.validateToken = validateToken;
23099 }));
23100 };
23101
23102 if (false) {
23103 /**
23104 * Bind the captcha to HTMLElements. <b>ONLY AVAILABLE in browsers</b>.
23105 * @param [elements]
23106 * @param {String|HTMLInputElement} [elements.textInput] An input element typed text, or the id for the element.
23107 * @param {String|HTMLImageElement} [elements.image] An image element, or the id for the element.
23108 * @param {String|HTMLElement} [elements.verifyButton] A button element, or the id for the element.
23109 * @param [callbacks]
23110 * @param {Function} [callbacks.success] Success callback will be called if the code is verified. The param `validateCode` can be used for further SMS request.
23111 * @param {Function} [callbacks.error] Error callback will be called if something goes wrong, detailed in param `error.message`.
23112 */
23113 AV.Captcha.prototype.bind = function bind(_ref2, _ref3) {
23114 var _this3 = this;
23115
23116 var textInput = _ref2.textInput,
23117 image = _ref2.image,
23118 verifyButton = _ref2.verifyButton;
23119 var success = _ref3.success,
23120 error = _ref3.error;
23121
23122 if (typeof textInput === 'string') {
23123 textInput = document.getElementById(textInput);
23124 if (!textInput) throw new Error("textInput with id ".concat(textInput, " not found"));
23125 }
23126
23127 if (typeof image === 'string') {
23128 image = document.getElementById(image);
23129 if (!image) throw new Error("image with id ".concat(image, " not found"));
23130 }
23131
23132 if (typeof verifyButton === 'string') {
23133 verifyButton = document.getElementById(verifyButton);
23134 if (!verifyButton) throw new Error("verifyButton with id ".concat(verifyButton, " not found"));
23135 }
23136
23137 this.__refresh = function () {
23138 return _this3.refresh().then(function (url) {
23139 image.src = url;
23140
23141 if (textInput) {
23142 textInput.value = '';
23143 textInput.focus();
23144 }
23145 }).catch(function (err) {
23146 return console.warn("refresh captcha fail: ".concat(err.message));
23147 });
23148 };
23149
23150 if (image) {
23151 this.__image = image;
23152 image.src = this.url;
23153 image.addEventListener('click', this.__refresh);
23154 }
23155
23156 this.__verify = function () {
23157 var code = textInput.value;
23158
23159 _this3.verify(code).catch(function (err) {
23160 _this3.__refresh();
23161
23162 throw err;
23163 }).then(success, error).catch(function (err) {
23164 return console.warn("verify captcha fail: ".concat(err.message));
23165 });
23166 };
23167
23168 if (textInput && verifyButton) {
23169 this.__verifyButton = verifyButton;
23170 verifyButton.addEventListener('click', this.__verify);
23171 }
23172 };
23173 /**
23174 * unbind the captcha from HTMLElements. <b>ONLY AVAILABLE in browsers</b>.
23175 */
23176
23177
23178 AV.Captcha.prototype.unbind = function unbind() {
23179 if (this.__image) this.__image.removeEventListener('click', this.__refresh);
23180 if (this.__verifyButton) this.__verifyButton.removeEventListener('click', this.__verify);
23181 };
23182 }
23183 /**
23184 * Request a captcha
23185 * @param [options]
23186 * @param {Number} [options.width] width(px) of the captcha, ranged 60-200
23187 * @param {Number} [options.height] height(px) of the captcha, ranged 30-100
23188 * @param {Number} [options.size=4] length of the captcha, ranged 3-6. MasterKey required.
23189 * @param {Number} [options.ttl=60] time to live(s), ranged 10-180. MasterKey required.
23190 * @return {Promise.<AV.Captcha>}
23191 */
23192
23193
23194 AV.Captcha.request = function (options, authOptions) {
23195 var captcha = new AV.Captcha(options, authOptions);
23196 return captcha.refresh().then(function () {
23197 return captcha;
23198 });
23199 };
23200};
23201
23202/***/ }),
23203/* 537 */
23204/***/ (function(module, exports, __webpack_require__) {
23205
23206"use strict";
23207
23208
23209var _interopRequireDefault = __webpack_require__(1);
23210
23211var _promise = _interopRequireDefault(__webpack_require__(12));
23212
23213var _ = __webpack_require__(2);
23214
23215var _require = __webpack_require__(26),
23216 _request = _require._request,
23217 request = _require.request;
23218
23219module.exports = function (AV) {
23220 /**
23221 * Contains functions for calling and declaring
23222 * <p><strong><em>
23223 * Some functions are only available from Cloud Code.
23224 * </em></strong></p>
23225 *
23226 * @namespace
23227 * @borrows AV.Captcha.request as requestCaptcha
23228 */
23229 AV.Cloud = AV.Cloud || {};
23230
23231 _.extend(AV.Cloud,
23232 /** @lends AV.Cloud */
23233 {
23234 /**
23235 * Makes a call to a cloud function.
23236 * @param {String} name The function name.
23237 * @param {Object} [data] The parameters to send to the cloud function.
23238 * @param {AuthOptions} [options]
23239 * @return {Promise} A promise that will be resolved with the result
23240 * of the function.
23241 */
23242 run: function run(name, data, options) {
23243 return request({
23244 service: 'engine',
23245 method: 'POST',
23246 path: "/functions/".concat(name),
23247 data: AV._encode(data, null, true),
23248 authOptions: options
23249 }).then(function (resp) {
23250 return AV._decode(resp).result;
23251 });
23252 },
23253
23254 /**
23255 * Makes a call to a cloud function, you can send {AV.Object} as param or a field of param; the response
23256 * from server will also be parsed as an {AV.Object}, array of {AV.Object}, or object includes {AV.Object}
23257 * @param {String} name The function name.
23258 * @param {Object} [data] The parameters to send to the cloud function.
23259 * @param {AuthOptions} [options]
23260 * @return {Promise} A promise that will be resolved with the result of the function.
23261 */
23262 rpc: function rpc(name, data, options) {
23263 if (_.isArray(data)) {
23264 return _promise.default.reject(new Error("Can't pass Array as the param of rpc function in JavaScript SDK."));
23265 }
23266
23267 return request({
23268 service: 'engine',
23269 method: 'POST',
23270 path: "/call/".concat(name),
23271 data: AV._encodeObjectOrArray(data),
23272 authOptions: options
23273 }).then(function (resp) {
23274 return AV._decode(resp).result;
23275 });
23276 },
23277
23278 /**
23279 * Make a call to request server date time.
23280 * @return {Promise.<Date>} A promise that will be resolved with the result
23281 * of the function.
23282 * @since 0.5.9
23283 */
23284 getServerDate: function getServerDate() {
23285 return _request('date', null, null, 'GET').then(function (resp) {
23286 return AV._decode(resp);
23287 });
23288 },
23289
23290 /**
23291 * Makes a call to request an sms code for operation verification.
23292 * @param {String|Object} data The mobile phone number string or a JSON
23293 * object that contains mobilePhoneNumber,template,sign,op,ttl,name etc.
23294 * @param {String} data.mobilePhoneNumber
23295 * @param {String} [data.template] sms template name
23296 * @param {String} [data.sign] sms signature name
23297 * @param {String} [data.smsType] sending code by `sms` (default) or `voice` call
23298 * @param {SMSAuthOptions} [options]
23299 * @return {Promise} A promise that will be resolved if the request succeed
23300 */
23301 requestSmsCode: function requestSmsCode(data) {
23302 var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
23303
23304 if (_.isString(data)) {
23305 data = {
23306 mobilePhoneNumber: data
23307 };
23308 }
23309
23310 if (!data.mobilePhoneNumber) {
23311 throw new Error('Missing mobilePhoneNumber.');
23312 }
23313
23314 if (options.validateToken) {
23315 data = _.extend({}, data, {
23316 validate_token: options.validateToken
23317 });
23318 }
23319
23320 return _request('requestSmsCode', null, null, 'POST', data, options);
23321 },
23322
23323 /**
23324 * Makes a call to verify sms code that sent by AV.Cloud.requestSmsCode
23325 * @param {String} code The sms code sent by AV.Cloud.requestSmsCode
23326 * @param {phone} phone The mobile phoner number.
23327 * @return {Promise} A promise that will be resolved with the result
23328 * of the function.
23329 */
23330 verifySmsCode: function verifySmsCode(code, phone) {
23331 if (!code) throw new Error('Missing sms code.');
23332 var params = {};
23333
23334 if (_.isString(phone)) {
23335 params['mobilePhoneNumber'] = phone;
23336 }
23337
23338 return _request('verifySmsCode', code, null, 'POST', params);
23339 },
23340 _requestCaptcha: function _requestCaptcha(options, authOptions) {
23341 return _request('requestCaptcha', null, null, 'GET', options, authOptions).then(function (_ref) {
23342 var url = _ref.captcha_url,
23343 captchaToken = _ref.captcha_token;
23344 return {
23345 captchaToken: captchaToken,
23346 url: url
23347 };
23348 });
23349 },
23350
23351 /**
23352 * Request a captcha.
23353 */
23354 requestCaptcha: AV.Captcha.request,
23355
23356 /**
23357 * Verify captcha code. This is the low-level API for captcha.
23358 * Checkout {@link AV.Captcha} for high abstract APIs.
23359 * @param {String} code the code from user input
23360 * @param {String} captchaToken captchaToken returned by {@link AV.Cloud.requestCaptcha}
23361 * @return {Promise.<String>} validateToken if the code is valid
23362 */
23363 verifyCaptcha: function verifyCaptcha(code, captchaToken) {
23364 return _request('verifyCaptcha', null, null, 'POST', {
23365 captcha_code: code,
23366 captcha_token: captchaToken
23367 }).then(function (_ref2) {
23368 var validateToken = _ref2.validate_token;
23369 return validateToken;
23370 });
23371 }
23372 });
23373};
23374
23375/***/ }),
23376/* 538 */
23377/***/ (function(module, exports, __webpack_require__) {
23378
23379"use strict";
23380
23381
23382var request = __webpack_require__(26).request;
23383
23384module.exports = function (AV) {
23385 AV.Installation = AV.Object.extend('_Installation');
23386 /**
23387 * @namespace
23388 */
23389
23390 AV.Push = AV.Push || {};
23391 /**
23392 * Sends a push notification.
23393 * @param {Object} data The data of the push notification.
23394 * @param {String[]} [data.channels] An Array of channels to push to.
23395 * @param {Date} [data.push_time] A Date object for when to send the push.
23396 * @param {Date} [data.expiration_time] A Date object for when to expire
23397 * the push.
23398 * @param {Number} [data.expiration_interval] The seconds from now to expire the push.
23399 * @param {Number} [data.flow_control] The clients to notify per second
23400 * @param {AV.Query} [data.where] An AV.Query over AV.Installation that is used to match
23401 * a set of installations to push to.
23402 * @param {String} [data.cql] A CQL statement over AV.Installation that is used to match
23403 * a set of installations to push to.
23404 * @param {Object} data.data The data to send as part of the push.
23405 More details: https://url.leanapp.cn/pushData
23406 * @param {AuthOptions} [options]
23407 * @return {Promise}
23408 */
23409
23410 AV.Push.send = function (data, options) {
23411 if (data.where) {
23412 data.where = data.where._getParams().where;
23413 }
23414
23415 if (data.where && data.cql) {
23416 throw new Error("Both where and cql can't be set");
23417 }
23418
23419 if (data.push_time) {
23420 data.push_time = data.push_time.toJSON();
23421 }
23422
23423 if (data.expiration_time) {
23424 data.expiration_time = data.expiration_time.toJSON();
23425 }
23426
23427 if (data.expiration_time && data.expiration_interval) {
23428 throw new Error("Both expiration_time and expiration_interval can't be set");
23429 }
23430
23431 return request({
23432 service: 'push',
23433 method: 'POST',
23434 path: '/push',
23435 data: data,
23436 authOptions: options
23437 });
23438 };
23439};
23440
23441/***/ }),
23442/* 539 */
23443/***/ (function(module, exports, __webpack_require__) {
23444
23445"use strict";
23446
23447
23448var _interopRequireDefault = __webpack_require__(1);
23449
23450var _promise = _interopRequireDefault(__webpack_require__(12));
23451
23452var _typeof2 = _interopRequireDefault(__webpack_require__(109));
23453
23454var _ = __webpack_require__(2);
23455
23456var AVRequest = __webpack_require__(26)._request;
23457
23458var _require = __webpack_require__(29),
23459 getSessionToken = _require.getSessionToken;
23460
23461module.exports = function (AV) {
23462 var getUser = function getUser() {
23463 var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
23464 var sessionToken = getSessionToken(options);
23465
23466 if (sessionToken) {
23467 return AV.User._fetchUserBySessionToken(getSessionToken(options));
23468 }
23469
23470 return AV.User.currentAsync();
23471 };
23472
23473 var getUserPointer = function getUserPointer(options) {
23474 return getUser(options).then(function (currUser) {
23475 return AV.Object.createWithoutData('_User', currUser.id)._toPointer();
23476 });
23477 };
23478 /**
23479 * Contains functions to deal with Status in LeanCloud.
23480 * @class
23481 */
23482
23483
23484 AV.Status = function (imageUrl, message) {
23485 this.data = {};
23486 this.inboxType = 'default';
23487 this.query = null;
23488
23489 if (imageUrl && (0, _typeof2.default)(imageUrl) === 'object') {
23490 this.data = imageUrl;
23491 } else {
23492 if (imageUrl) {
23493 this.data.image = imageUrl;
23494 }
23495
23496 if (message) {
23497 this.data.message = message;
23498 }
23499 }
23500
23501 return this;
23502 };
23503
23504 _.extend(AV.Status.prototype,
23505 /** @lends AV.Status.prototype */
23506 {
23507 /**
23508 * Gets the value of an attribute in status data.
23509 * @param {String} attr The string name of an attribute.
23510 */
23511 get: function get(attr) {
23512 return this.data[attr];
23513 },
23514
23515 /**
23516 * Sets a hash of model attributes on the status data.
23517 * @param {String} key The key to set.
23518 * @param {any} value The value to give it.
23519 */
23520 set: function set(key, value) {
23521 this.data[key] = value;
23522 return this;
23523 },
23524
23525 /**
23526 * Destroy this status,then it will not be avaiable in other user's inboxes.
23527 * @param {AuthOptions} options
23528 * @return {Promise} A promise that is fulfilled when the destroy
23529 * completes.
23530 */
23531 destroy: function destroy(options) {
23532 if (!this.id) return _promise.default.reject(new Error('The status id is not exists.'));
23533 var request = AVRequest('statuses', null, this.id, 'DELETE', options);
23534 return request;
23535 },
23536
23537 /**
23538 * Cast the AV.Status object to an AV.Object pointer.
23539 * @return {AV.Object} A AV.Object pointer.
23540 */
23541 toObject: function toObject() {
23542 if (!this.id) return null;
23543 return AV.Object.createWithoutData('_Status', this.id);
23544 },
23545 _getDataJSON: function _getDataJSON() {
23546 var json = _.clone(this.data);
23547
23548 return AV._encode(json);
23549 },
23550
23551 /**
23552 * Send a status by a AV.Query object.
23553 * @since 0.3.0
23554 * @param {AuthOptions} options
23555 * @return {Promise} A promise that is fulfilled when the send
23556 * completes.
23557 * @example
23558 * // send a status to male users
23559 * var status = new AVStatus('image url', 'a message');
23560 * status.query = new AV.Query('_User');
23561 * status.query.equalTo('gender', 'male');
23562 * status.send().then(function(){
23563 * //send status successfully.
23564 * }, function(err){
23565 * //an error threw.
23566 * console.dir(err);
23567 * });
23568 */
23569 send: function send() {
23570 var _this = this;
23571
23572 var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
23573
23574 if (!getSessionToken(options) && !AV.User.current()) {
23575 throw new Error('Please signin an user.');
23576 }
23577
23578 if (!this.query) {
23579 return AV.Status.sendStatusToFollowers(this, options);
23580 }
23581
23582 return getUserPointer(options).then(function (currUser) {
23583 var query = _this.query._getParams();
23584
23585 query.className = _this.query.className;
23586 var data = {};
23587 data.query = query;
23588 _this.data = _this.data || {};
23589 _this.data.source = _this.data.source || currUser;
23590 data.data = _this._getDataJSON();
23591 data.inboxType = _this.inboxType || 'default';
23592 return AVRequest('statuses', null, null, 'POST', data, options);
23593 }).then(function (response) {
23594 _this.id = response.objectId;
23595 _this.createdAt = AV._parseDate(response.createdAt);
23596 return _this;
23597 });
23598 },
23599 _finishFetch: function _finishFetch(serverData) {
23600 this.id = serverData.objectId;
23601 this.createdAt = AV._parseDate(serverData.createdAt);
23602 this.updatedAt = AV._parseDate(serverData.updatedAt);
23603 this.messageId = serverData.messageId;
23604 delete serverData.messageId;
23605 delete serverData.objectId;
23606 delete serverData.createdAt;
23607 delete serverData.updatedAt;
23608 this.data = AV._decode(serverData);
23609 }
23610 });
23611 /**
23612 * Send a status to current signined user's followers.
23613 * @since 0.3.0
23614 * @param {AV.Status} status A status object to be send to followers.
23615 * @param {AuthOptions} options
23616 * @return {Promise} A promise that is fulfilled when the send
23617 * completes.
23618 * @example
23619 * var status = new AVStatus('image url', 'a message');
23620 * AV.Status.sendStatusToFollowers(status).then(function(){
23621 * //send status successfully.
23622 * }, function(err){
23623 * //an error threw.
23624 * console.dir(err);
23625 * });
23626 */
23627
23628
23629 AV.Status.sendStatusToFollowers = function (status) {
23630 var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
23631
23632 if (!getSessionToken(options) && !AV.User.current()) {
23633 throw new Error('Please signin an user.');
23634 }
23635
23636 return getUserPointer(options).then(function (currUser) {
23637 var query = {};
23638 query.className = '_Follower';
23639 query.keys = 'follower';
23640 query.where = {
23641 user: currUser
23642 };
23643 var data = {};
23644 data.query = query;
23645 status.data = status.data || {};
23646 status.data.source = status.data.source || currUser;
23647 data.data = status._getDataJSON();
23648 data.inboxType = status.inboxType || 'default';
23649 var request = AVRequest('statuses', null, null, 'POST', data, options);
23650 return request.then(function (response) {
23651 status.id = response.objectId;
23652 status.createdAt = AV._parseDate(response.createdAt);
23653 return status;
23654 });
23655 });
23656 };
23657 /**
23658 * <p>Send a status from current signined user to other user's private status inbox.</p>
23659 * @since 0.3.0
23660 * @param {AV.Status} status A status object to be send to followers.
23661 * @param {String} target The target user or user's objectId.
23662 * @param {AuthOptions} options
23663 * @return {Promise} A promise that is fulfilled when the send
23664 * completes.
23665 * @example
23666 * // send a private status to user '52e84e47e4b0f8de283b079b'
23667 * var status = new AVStatus('image url', 'a message');
23668 * AV.Status.sendPrivateStatus(status, '52e84e47e4b0f8de283b079b').then(function(){
23669 * //send status successfully.
23670 * }, function(err){
23671 * //an error threw.
23672 * console.dir(err);
23673 * });
23674 */
23675
23676
23677 AV.Status.sendPrivateStatus = function (status, target) {
23678 var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
23679
23680 if (!getSessionToken(options) && !AV.User.current()) {
23681 throw new Error('Please signin an user.');
23682 }
23683
23684 if (!target) {
23685 throw new Error('Invalid target user.');
23686 }
23687
23688 var userObjectId = _.isString(target) ? target : target.id;
23689
23690 if (!userObjectId) {
23691 throw new Error('Invalid target user.');
23692 }
23693
23694 return getUserPointer(options).then(function (currUser) {
23695 var query = {};
23696 query.className = '_User';
23697 query.where = {
23698 objectId: userObjectId
23699 };
23700 var data = {};
23701 data.query = query;
23702 status.data = status.data || {};
23703 status.data.source = status.data.source || currUser;
23704 data.data = status._getDataJSON();
23705 data.inboxType = 'private';
23706 status.inboxType = 'private';
23707 var request = AVRequest('statuses', null, null, 'POST', data, options);
23708 return request.then(function (response) {
23709 status.id = response.objectId;
23710 status.createdAt = AV._parseDate(response.createdAt);
23711 return status;
23712 });
23713 });
23714 };
23715 /**
23716 * Count unread statuses in someone's inbox.
23717 * @since 0.3.0
23718 * @param {AV.User} owner The status owner.
23719 * @param {String} inboxType The inbox type, 'default' by default.
23720 * @param {AuthOptions} options
23721 * @return {Promise} A promise that is fulfilled when the count
23722 * completes.
23723 * @example
23724 * AV.Status.countUnreadStatuses(AV.User.current()).then(function(response){
23725 * console.log(response.unread); //unread statuses number.
23726 * console.log(response.total); //total statuses number.
23727 * });
23728 */
23729
23730
23731 AV.Status.countUnreadStatuses = function (owner) {
23732 var inboxType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'default';
23733 var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
23734 if (!_.isString(inboxType)) options = inboxType;
23735
23736 if (!getSessionToken(options) && owner == null && !AV.User.current()) {
23737 throw new Error('Please signin an user or pass the owner objectId.');
23738 }
23739
23740 return _promise.default.resolve(owner || getUser(options)).then(function (owner) {
23741 var params = {};
23742 params.inboxType = AV._encode(inboxType);
23743 params.owner = AV._encode(owner);
23744 return AVRequest('subscribe/statuses/count', null, null, 'GET', params, options);
23745 });
23746 };
23747 /**
23748 * reset unread statuses count in someone's inbox.
23749 * @since 2.1.0
23750 * @param {AV.User} owner The status owner.
23751 * @param {String} inboxType The inbox type, 'default' by default.
23752 * @param {AuthOptions} options
23753 * @return {Promise} A promise that is fulfilled when the reset
23754 * completes.
23755 * @example
23756 * AV.Status.resetUnreadCount(AV.User.current()).then(function(response){
23757 * console.log(response.unread); //unread statuses number.
23758 * console.log(response.total); //total statuses number.
23759 * });
23760 */
23761
23762
23763 AV.Status.resetUnreadCount = function (owner) {
23764 var inboxType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'default';
23765 var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
23766 if (!_.isString(inboxType)) options = inboxType;
23767
23768 if (!getSessionToken(options) && owner == null && !AV.User.current()) {
23769 throw new Error('Please signin an user or pass the owner objectId.');
23770 }
23771
23772 return _promise.default.resolve(owner || getUser(options)).then(function (owner) {
23773 var params = {};
23774 params.inboxType = AV._encode(inboxType);
23775 params.owner = AV._encode(owner);
23776 return AVRequest('subscribe/statuses/resetUnreadCount', null, null, 'POST', params, options);
23777 });
23778 };
23779 /**
23780 * Create a status query to find someone's published statuses.
23781 * @since 0.3.0
23782 * @param {AV.User} source The status source, typically the publisher.
23783 * @return {AV.Query} The query object for status.
23784 * @example
23785 * //Find current user's published statuses.
23786 * var query = AV.Status.statusQuery(AV.User.current());
23787 * query.find().then(function(statuses){
23788 * //process statuses
23789 * });
23790 */
23791
23792
23793 AV.Status.statusQuery = function (source) {
23794 var query = new AV.Query('_Status');
23795
23796 if (source) {
23797 query.equalTo('source', source);
23798 }
23799
23800 return query;
23801 };
23802 /**
23803 * <p>AV.InboxQuery defines a query that is used to fetch somebody's inbox statuses.</p>
23804 * @class
23805 */
23806
23807
23808 AV.InboxQuery = AV.Query._extend(
23809 /** @lends AV.InboxQuery.prototype */
23810 {
23811 _objectClass: AV.Status,
23812 _sinceId: 0,
23813 _maxId: 0,
23814 _inboxType: 'default',
23815 _owner: null,
23816 _newObject: function _newObject() {
23817 return new AV.Status();
23818 },
23819 _createRequest: function _createRequest(params, options) {
23820 return AV.InboxQuery.__super__._createRequest.call(this, params, options, '/subscribe/statuses');
23821 },
23822
23823 /**
23824 * Sets the messageId of results to skip before returning any results.
23825 * This is useful for pagination.
23826 * Default is zero.
23827 * @param {Number} n the mesage id.
23828 * @return {AV.InboxQuery} Returns the query, so you can chain this call.
23829 */
23830 sinceId: function sinceId(id) {
23831 this._sinceId = id;
23832 return this;
23833 },
23834
23835 /**
23836 * Sets the maximal messageId of results。
23837 * This is useful for pagination.
23838 * Default is zero that is no limition.
23839 * @param {Number} n the mesage id.
23840 * @return {AV.InboxQuery} Returns the query, so you can chain this call.
23841 */
23842 maxId: function maxId(id) {
23843 this._maxId = id;
23844 return this;
23845 },
23846
23847 /**
23848 * Sets the owner of the querying inbox.
23849 * @param {AV.User} owner The inbox owner.
23850 * @return {AV.InboxQuery} Returns the query, so you can chain this call.
23851 */
23852 owner: function owner(_owner) {
23853 this._owner = _owner;
23854 return this;
23855 },
23856
23857 /**
23858 * Sets the querying inbox type.default is 'default'.
23859 * @param {String} type The inbox type.
23860 * @return {AV.InboxQuery} Returns the query, so you can chain this call.
23861 */
23862 inboxType: function inboxType(type) {
23863 this._inboxType = type;
23864 return this;
23865 },
23866 _getParams: function _getParams() {
23867 var params = AV.InboxQuery.__super__._getParams.call(this);
23868
23869 params.owner = AV._encode(this._owner);
23870 params.inboxType = AV._encode(this._inboxType);
23871 params.sinceId = AV._encode(this._sinceId);
23872 params.maxId = AV._encode(this._maxId);
23873 return params;
23874 }
23875 });
23876 /**
23877 * Create a inbox status query to find someone's inbox statuses.
23878 * @since 0.3.0
23879 * @param {AV.User} owner The inbox's owner
23880 * @param {String} inboxType The inbox type,'default' by default.
23881 * @return {AV.InboxQuery} The inbox query object.
23882 * @see AV.InboxQuery
23883 * @example
23884 * //Find current user's default inbox statuses.
23885 * var query = AV.Status.inboxQuery(AV.User.current());
23886 * //find the statuses after the last message id
23887 * query.sinceId(lastMessageId);
23888 * query.find().then(function(statuses){
23889 * //process statuses
23890 * });
23891 */
23892
23893 AV.Status.inboxQuery = function (owner, inboxType) {
23894 var query = new AV.InboxQuery(AV.Status);
23895
23896 if (owner) {
23897 query._owner = owner;
23898 }
23899
23900 if (inboxType) {
23901 query._inboxType = inboxType;
23902 }
23903
23904 return query;
23905 };
23906};
23907
23908/***/ }),
23909/* 540 */
23910/***/ (function(module, exports, __webpack_require__) {
23911
23912"use strict";
23913
23914
23915var _interopRequireDefault = __webpack_require__(1);
23916
23917var _stringify = _interopRequireDefault(__webpack_require__(36));
23918
23919var _map = _interopRequireDefault(__webpack_require__(42));
23920
23921var _ = __webpack_require__(2);
23922
23923var AVRequest = __webpack_require__(26)._request;
23924
23925module.exports = function (AV) {
23926 /**
23927 * A builder to generate sort string for app searching.For example:
23928 * @class
23929 * @since 0.5.1
23930 * @example
23931 * var builder = new AV.SearchSortBuilder();
23932 * builder.ascending('key1').descending('key2','max');
23933 * var query = new AV.SearchQuery('Player');
23934 * query.sortBy(builder);
23935 * query.find().then();
23936 */
23937 AV.SearchSortBuilder = function () {
23938 this._sortFields = [];
23939 };
23940
23941 _.extend(AV.SearchSortBuilder.prototype,
23942 /** @lends AV.SearchSortBuilder.prototype */
23943 {
23944 _addField: function _addField(key, order, mode, missing) {
23945 var field = {};
23946 field[key] = {
23947 order: order || 'asc',
23948 mode: mode || 'avg',
23949 missing: '_' + (missing || 'last')
23950 };
23951
23952 this._sortFields.push(field);
23953
23954 return this;
23955 },
23956
23957 /**
23958 * Sorts the results in ascending order by the given key and options.
23959 *
23960 * @param {String} key The key to order by.
23961 * @param {String} mode The sort mode, default is 'avg', you can choose
23962 * 'max' or 'min' too.
23963 * @param {String} missing The missing key behaviour, default is 'last',
23964 * you can choose 'first' too.
23965 * @return {AV.SearchSortBuilder} Returns the builder, so you can chain this call.
23966 */
23967 ascending: function ascending(key, mode, missing) {
23968 return this._addField(key, 'asc', mode, missing);
23969 },
23970
23971 /**
23972 * Sorts the results in descending order by the given key and options.
23973 *
23974 * @param {String} key The key to order by.
23975 * @param {String} mode The sort mode, default is 'avg', you can choose
23976 * 'max' or 'min' too.
23977 * @param {String} missing The missing key behaviour, default is 'last',
23978 * you can choose 'first' too.
23979 * @return {AV.SearchSortBuilder} Returns the builder, so you can chain this call.
23980 */
23981 descending: function descending(key, mode, missing) {
23982 return this._addField(key, 'desc', mode, missing);
23983 },
23984
23985 /**
23986 * Add a proximity based constraint for finding objects with key point
23987 * values near the point given.
23988 * @param {String} key The key that the AV.GeoPoint is stored in.
23989 * @param {AV.GeoPoint} point The reference AV.GeoPoint that is used.
23990 * @param {Object} options The other options such as mode,order, unit etc.
23991 * @return {AV.SearchSortBuilder} Returns the builder, so you can chain this call.
23992 */
23993 whereNear: function whereNear(key, point, options) {
23994 options = options || {};
23995 var field = {};
23996 var geo = {
23997 lat: point.latitude,
23998 lon: point.longitude
23999 };
24000 var m = {
24001 order: options.order || 'asc',
24002 mode: options.mode || 'avg',
24003 unit: options.unit || 'km'
24004 };
24005 m[key] = geo;
24006 field['_geo_distance'] = m;
24007
24008 this._sortFields.push(field);
24009
24010 return this;
24011 },
24012
24013 /**
24014 * Build a sort string by configuration.
24015 * @return {String} the sort string.
24016 */
24017 build: function build() {
24018 return (0, _stringify.default)(AV._encode(this._sortFields));
24019 }
24020 });
24021 /**
24022 * App searching query.Use just like AV.Query:
24023 *
24024 * Visit <a href='https://leancloud.cn/docs/app_search_guide.html'>App Searching Guide</a>
24025 * for more details.
24026 * @class
24027 * @since 0.5.1
24028 * @example
24029 * var query = new AV.SearchQuery('Player');
24030 * query.queryString('*');
24031 * query.find().then(function(results) {
24032 * console.log('Found %d objects', query.hits());
24033 * //Process results
24034 * });
24035 */
24036
24037
24038 AV.SearchQuery = AV.Query._extend(
24039 /** @lends AV.SearchQuery.prototype */
24040 {
24041 _sid: null,
24042 _hits: 0,
24043 _queryString: null,
24044 _highlights: null,
24045 _sortBuilder: null,
24046 _clazz: null,
24047 constructor: function constructor(className) {
24048 if (className) {
24049 this._clazz = className;
24050 } else {
24051 className = '__INVALID_CLASS';
24052 }
24053
24054 AV.Query.call(this, className);
24055 },
24056 _createRequest: function _createRequest(params, options) {
24057 return AVRequest('search/select', null, null, 'GET', params || this._getParams(), options);
24058 },
24059
24060 /**
24061 * Sets the sid of app searching query.Default is null.
24062 * @param {String} sid Scroll id for searching.
24063 * @return {AV.SearchQuery} Returns the query, so you can chain this call.
24064 */
24065 sid: function sid(_sid) {
24066 this._sid = _sid;
24067 return this;
24068 },
24069
24070 /**
24071 * Sets the query string of app searching.
24072 * @param {String} q The query string.
24073 * @return {AV.SearchQuery} Returns the query, so you can chain this call.
24074 */
24075 queryString: function queryString(q) {
24076 this._queryString = q;
24077 return this;
24078 },
24079
24080 /**
24081 * Sets the highlight fields. Such as
24082 * <pre><code>
24083 * query.highlights('title');
24084 * //or pass an array.
24085 * query.highlights(['title', 'content'])
24086 * </code></pre>
24087 * @param {String|String[]} highlights a list of fields.
24088 * @return {AV.SearchQuery} Returns the query, so you can chain this call.
24089 */
24090 highlights: function highlights(_highlights) {
24091 var objects;
24092
24093 if (_highlights && _.isString(_highlights)) {
24094 objects = _.toArray(arguments);
24095 } else {
24096 objects = _highlights;
24097 }
24098
24099 this._highlights = objects;
24100 return this;
24101 },
24102
24103 /**
24104 * Sets the sort builder for this query.
24105 * @see AV.SearchSortBuilder
24106 * @param { AV.SearchSortBuilder} builder The sort builder.
24107 * @return {AV.SearchQuery} Returns the query, so you can chain this call.
24108 *
24109 */
24110 sortBy: function sortBy(builder) {
24111 this._sortBuilder = builder;
24112 return this;
24113 },
24114
24115 /**
24116 * Returns the number of objects that match this query.
24117 * @return {Number}
24118 */
24119 hits: function hits() {
24120 if (!this._hits) {
24121 this._hits = 0;
24122 }
24123
24124 return this._hits;
24125 },
24126 _processResult: function _processResult(json) {
24127 delete json['className'];
24128 delete json['_app_url'];
24129 delete json['_deeplink'];
24130 return json;
24131 },
24132
24133 /**
24134 * Returns true when there are more documents can be retrieved by this
24135 * query instance, you can call find function to get more results.
24136 * @see AV.SearchQuery#find
24137 * @return {Boolean}
24138 */
24139 hasMore: function hasMore() {
24140 return !this._hitEnd;
24141 },
24142
24143 /**
24144 * Reset current query instance state(such as sid, hits etc) except params
24145 * for a new searching. After resetting, hasMore() will return true.
24146 */
24147 reset: function reset() {
24148 this._hitEnd = false;
24149 this._sid = null;
24150 this._hits = 0;
24151 },
24152
24153 /**
24154 * Retrieves a list of AVObjects that satisfy this query.
24155 * Either options.success or options.error is called when the find
24156 * completes.
24157 *
24158 * @see AV.Query#find
24159 * @param {AuthOptions} options
24160 * @return {Promise} A promise that is resolved with the results when
24161 * the query completes.
24162 */
24163 find: function find(options) {
24164 var self = this;
24165
24166 var request = this._createRequest(undefined, options);
24167
24168 return request.then(function (response) {
24169 //update sid for next querying.
24170 if (response.sid) {
24171 self._oldSid = self._sid;
24172 self._sid = response.sid;
24173 } else {
24174 self._sid = null;
24175 self._hitEnd = true;
24176 }
24177
24178 self._hits = response.hits || 0;
24179 return (0, _map.default)(_).call(_, response.results, function (json) {
24180 if (json.className) {
24181 response.className = json.className;
24182 }
24183
24184 var obj = self._newObject(response);
24185
24186 obj.appURL = json['_app_url'];
24187
24188 obj._finishFetch(self._processResult(json), true);
24189
24190 return obj;
24191 });
24192 });
24193 },
24194 _getParams: function _getParams() {
24195 var params = AV.SearchQuery.__super__._getParams.call(this);
24196
24197 delete params.where;
24198
24199 if (this._clazz) {
24200 params.clazz = this.className;
24201 }
24202
24203 if (this._sid) {
24204 params.sid = this._sid;
24205 }
24206
24207 if (!this._queryString) {
24208 throw new Error('Please set query string.');
24209 } else {
24210 params.q = this._queryString;
24211 }
24212
24213 if (this._highlights) {
24214 params.highlights = this._highlights.join(',');
24215 }
24216
24217 if (this._sortBuilder && params.order) {
24218 throw new Error('sort and order can not be set at same time.');
24219 }
24220
24221 if (this._sortBuilder) {
24222 params.sort = this._sortBuilder.build();
24223 }
24224
24225 return params;
24226 }
24227 });
24228};
24229/**
24230 * Sorts the results in ascending order by the given key.
24231 *
24232 * @method AV.SearchQuery#ascending
24233 * @param {String} key The key to order by.
24234 * @return {AV.SearchQuery} Returns the query, so you can chain this call.
24235 */
24236
24237/**
24238 * Also sorts the results in ascending order by the given key. The previous sort keys have
24239 * precedence over this key.
24240 *
24241 * @method AV.SearchQuery#addAscending
24242 * @param {String} key The key to order by
24243 * @return {AV.SearchQuery} Returns the query so you can chain this call.
24244 */
24245
24246/**
24247 * Sorts the results in descending order by the given key.
24248 *
24249 * @method AV.SearchQuery#descending
24250 * @param {String} key The key to order by.
24251 * @return {AV.SearchQuery} Returns the query, so you can chain this call.
24252 */
24253
24254/**
24255 * Also sorts the results in descending order by the given key. The previous sort keys have
24256 * precedence over this key.
24257 *
24258 * @method AV.SearchQuery#addDescending
24259 * @param {String} key The key to order by
24260 * @return {AV.SearchQuery} Returns the query so you can chain this call.
24261 */
24262
24263/**
24264 * Include nested AV.Objects for the provided key. You can use dot
24265 * notation to specify which fields in the included object are also fetch.
24266 * @method AV.SearchQuery#include
24267 * @param {String[]} keys The name of the key to include.
24268 * @return {AV.SearchQuery} Returns the query, so you can chain this call.
24269 */
24270
24271/**
24272 * Sets the number of results to skip before returning any results.
24273 * This is useful for pagination.
24274 * Default is to skip zero results.
24275 * @method AV.SearchQuery#skip
24276 * @param {Number} n the number of results to skip.
24277 * @return {AV.SearchQuery} Returns the query, so you can chain this call.
24278 */
24279
24280/**
24281 * Sets the limit of the number of results to return. The default limit is
24282 * 100, with a maximum of 1000 results being returned at a time.
24283 * @method AV.SearchQuery#limit
24284 * @param {Number} n the number of results to limit to.
24285 * @return {AV.SearchQuery} Returns the query, so you can chain this call.
24286 */
24287
24288/***/ }),
24289/* 541 */
24290/***/ (function(module, exports, __webpack_require__) {
24291
24292"use strict";
24293
24294
24295var _interopRequireDefault = __webpack_require__(1);
24296
24297var _promise = _interopRequireDefault(__webpack_require__(12));
24298
24299var _ = __webpack_require__(2);
24300
24301var AVError = __webpack_require__(43);
24302
24303var _require = __webpack_require__(26),
24304 request = _require.request;
24305
24306module.exports = function (AV) {
24307 /**
24308 * 包含了使用了 LeanCloud
24309 * <a href='/docs/leaninsight_guide.html'>离线数据分析功能</a>的函数。
24310 * <p><strong><em>
24311 * 仅在云引擎运行环境下有效。
24312 * </em></strong></p>
24313 * @namespace
24314 */
24315 AV.Insight = AV.Insight || {};
24316
24317 _.extend(AV.Insight,
24318 /** @lends AV.Insight */
24319 {
24320 /**
24321 * 开始一个 Insight 任务。结果里将返回 Job id,你可以拿得到的 id 使用
24322 * AV.Insight.JobQuery 查询任务状态和结果。
24323 * @param {Object} jobConfig 任务配置的 JSON 对象,例如:<code><pre>
24324 * { "sql" : "select count(*) as c,gender from _User group by gender",
24325 * "saveAs": {
24326 * "className" : "UserGender",
24327 * "limit": 1
24328 * }
24329 * }
24330 * </pre></code>
24331 * sql 指定任务执行的 SQL 语句, saveAs(可选) 指定将结果保存在哪张表里,limit 最大 1000。
24332 * @param {AuthOptions} [options]
24333 * @return {Promise} A promise that will be resolved with the result
24334 * of the function.
24335 */
24336 startJob: function startJob(jobConfig, options) {
24337 if (!jobConfig || !jobConfig.sql) {
24338 throw new Error('Please provide the sql to run the job.');
24339 }
24340
24341 var data = {
24342 jobConfig: jobConfig,
24343 appId: AV.applicationId
24344 };
24345 return request({
24346 path: '/bigquery/jobs',
24347 method: 'POST',
24348 data: AV._encode(data, null, true),
24349 authOptions: options,
24350 signKey: false
24351 }).then(function (resp) {
24352 return AV._decode(resp).id;
24353 });
24354 },
24355
24356 /**
24357 * 监听 Insight 任务事件(未来推出独立部署的离线分析服务后开放)
24358 * <p><strong><em>
24359 * 仅在云引擎运行环境下有效。
24360 * </em></strong></p>
24361 * @param {String} event 监听的事件,目前尚不支持。
24362 * @param {Function} 监听回调函数,接收 (err, id) 两个参数,err 表示错误信息,
24363 * id 表示任务 id。接下来你可以拿这个 id 使用AV.Insight.JobQuery 查询任务状态和结果。
24364 *
24365 */
24366 on: function on(event, cb) {}
24367 });
24368 /**
24369 * 创建一个对象,用于查询 Insight 任务状态和结果。
24370 * @class
24371 * @param {String} id 任务 id
24372 * @since 0.5.5
24373 */
24374
24375
24376 AV.Insight.JobQuery = function (id, className) {
24377 if (!id) {
24378 throw new Error('Please provide the job id.');
24379 }
24380
24381 this.id = id;
24382 this.className = className;
24383 this._skip = 0;
24384 this._limit = 100;
24385 };
24386
24387 _.extend(AV.Insight.JobQuery.prototype,
24388 /** @lends AV.Insight.JobQuery.prototype */
24389 {
24390 /**
24391 * Sets the number of results to skip before returning any results.
24392 * This is useful for pagination.
24393 * Default is to skip zero results.
24394 * @param {Number} n the number of results to skip.
24395 * @return {AV.Query} Returns the query, so you can chain this call.
24396 */
24397 skip: function skip(n) {
24398 this._skip = n;
24399 return this;
24400 },
24401
24402 /**
24403 * Sets the limit of the number of results to return. The default limit is
24404 * 100, with a maximum of 1000 results being returned at a time.
24405 * @param {Number} n the number of results to limit to.
24406 * @return {AV.Query} Returns the query, so you can chain this call.
24407 */
24408 limit: function limit(n) {
24409 this._limit = n;
24410 return this;
24411 },
24412
24413 /**
24414 * 查询任务状态和结果,任务结果为一个 JSON 对象,包括 status 表示任务状态, totalCount 表示总数,
24415 * results 数组表示任务结果数组,previewCount 表示可以返回的结果总数,任务的开始和截止时间
24416 * startTime、endTime 等信息。
24417 *
24418 * @param {AuthOptions} [options]
24419 * @return {Promise} A promise that will be resolved with the result
24420 * of the function.
24421 *
24422 */
24423 find: function find(options) {
24424 var params = {
24425 skip: this._skip,
24426 limit: this._limit
24427 };
24428 return request({
24429 path: "/bigquery/jobs/".concat(this.id),
24430 method: 'GET',
24431 query: params,
24432 authOptions: options,
24433 signKey: false
24434 }).then(function (response) {
24435 if (response.error) {
24436 return _promise.default.reject(new AVError(response.code, response.error));
24437 }
24438
24439 return _promise.default.resolve(response);
24440 });
24441 }
24442 });
24443};
24444
24445/***/ }),
24446/* 542 */
24447/***/ (function(module, exports, __webpack_require__) {
24448
24449"use strict";
24450
24451
24452var _interopRequireDefault = __webpack_require__(1);
24453
24454var _promise = _interopRequireDefault(__webpack_require__(12));
24455
24456var _ = __webpack_require__(2);
24457
24458var _require = __webpack_require__(26),
24459 LCRequest = _require.request;
24460
24461var _require2 = __webpack_require__(29),
24462 getSessionToken = _require2.getSessionToken;
24463
24464module.exports = function (AV) {
24465 var getUserWithSessionToken = function getUserWithSessionToken(authOptions) {
24466 if (authOptions.user) {
24467 if (!authOptions.user._sessionToken) {
24468 throw new Error('authOptions.user is not signed in.');
24469 }
24470
24471 return _promise.default.resolve(authOptions.user);
24472 }
24473
24474 if (authOptions.sessionToken) {
24475 return AV.User._fetchUserBySessionToken(authOptions.sessionToken);
24476 }
24477
24478 return AV.User.currentAsync();
24479 };
24480
24481 var getSessionTokenAsync = function getSessionTokenAsync(authOptions) {
24482 var sessionToken = getSessionToken(authOptions);
24483
24484 if (sessionToken) {
24485 return _promise.default.resolve(sessionToken);
24486 }
24487
24488 return AV.User.currentAsync().then(function (user) {
24489 if (user) {
24490 return user.getSessionToken();
24491 }
24492 });
24493 };
24494 /**
24495 * Contains functions to deal with Friendship in LeanCloud.
24496 * @class
24497 */
24498
24499
24500 AV.Friendship = {
24501 /**
24502 * Request friendship.
24503 * @since 4.8.0
24504 * @param {String | AV.User | Object} options if an AV.User or string is given, it will be used as the friend.
24505 * @param {AV.User | string} options.friend The friend (or friend's objectId) to follow.
24506 * @param {Object} [options.attributes] key-value attributes dictionary to be used as conditions of followeeQuery.
24507 * @param {AuthOptions} [authOptions]
24508 * @return {Promise<void>}
24509 */
24510 request: function request(options) {
24511 var authOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
24512 var friend;
24513 var attributes;
24514
24515 if (options.friend) {
24516 friend = options.friend;
24517 attributes = options.attributes;
24518 } else {
24519 friend = options;
24520 }
24521
24522 var friendObj = _.isString(friend) ? AV.Object.createWithoutData('_User', friend) : friend;
24523 return getUserWithSessionToken(authOptions).then(function (userObj) {
24524 if (!userObj) {
24525 throw new Error('Please signin an user.');
24526 }
24527
24528 return LCRequest({
24529 method: 'POST',
24530 path: '/users/friendshipRequests',
24531 data: {
24532 user: userObj._toPointer(),
24533 friend: friendObj._toPointer(),
24534 friendship: attributes
24535 },
24536 authOptions: authOptions
24537 });
24538 });
24539 },
24540
24541 /**
24542 * Accept a friendship request.
24543 * @since 4.8.0
24544 * @param {AV.Object | string | Object} options if an AV.Object or string is given, it will be used as the request in _FriendshipRequest.
24545 * @param {AV.Object} options.request The request (or it's objectId) to be accepted.
24546 * @param {Object} [options.attributes] key-value attributes dictionary to be used as conditions of {@link AV#followeeQuery}.
24547 * @param {AuthOptions} [authOptions]
24548 * @return {Promise<void>}
24549 */
24550 acceptRequest: function acceptRequest(options) {
24551 var authOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
24552 var request;
24553 var attributes;
24554
24555 if (options.request) {
24556 request = options.request;
24557 attributes = options.attributes;
24558 } else {
24559 request = options;
24560 }
24561
24562 var requestId = _.isString(request) ? request : request.id;
24563 return getSessionTokenAsync(authOptions).then(function (sessionToken) {
24564 if (!sessionToken) {
24565 throw new Error('Please signin an user.');
24566 }
24567
24568 return LCRequest({
24569 method: 'PUT',
24570 path: '/users/friendshipRequests/' + requestId + '/accept',
24571 data: {
24572 friendship: AV._encode(attributes)
24573 },
24574 authOptions: authOptions
24575 });
24576 });
24577 },
24578
24579 /**
24580 * Decline a friendship request.
24581 * @param {AV.Object | string} request The request (or it's objectId) to be declined.
24582 * @param {AuthOptions} [authOptions]
24583 * @return {Promise<void>}
24584 */
24585 declineRequest: function declineRequest(request) {
24586 var authOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
24587 var requestId = _.isString(request) ? request : request.id;
24588 return getSessionTokenAsync(authOptions).then(function (sessionToken) {
24589 if (!sessionToken) {
24590 throw new Error('Please signin an user.');
24591 }
24592
24593 return LCRequest({
24594 method: 'PUT',
24595 path: '/users/friendshipRequests/' + requestId + '/decline',
24596 authOptions: authOptions
24597 });
24598 });
24599 }
24600 };
24601};
24602
24603/***/ }),
24604/* 543 */
24605/***/ (function(module, exports, __webpack_require__) {
24606
24607"use strict";
24608
24609
24610var _interopRequireDefault = __webpack_require__(1);
24611
24612var _stringify = _interopRequireDefault(__webpack_require__(36));
24613
24614var _ = __webpack_require__(2);
24615
24616var _require = __webpack_require__(26),
24617 _request = _require._request;
24618
24619var AV = __webpack_require__(65);
24620
24621var serializeMessage = function serializeMessage(message) {
24622 if (typeof message === 'string') {
24623 return message;
24624 }
24625
24626 if (typeof message.getPayload === 'function') {
24627 return (0, _stringify.default)(message.getPayload());
24628 }
24629
24630 return (0, _stringify.default)(message);
24631};
24632/**
24633 * <p>An AV.Conversation is a local representation of a LeanCloud realtime's
24634 * conversation. This class is a subclass of AV.Object, and retains the
24635 * same functionality of an AV.Object, but also extends it with various
24636 * conversation specific methods, like get members, creators of this conversation.
24637 * </p>
24638 *
24639 * @class AV.Conversation
24640 * @param {String} name The name of the Role to create.
24641 * @param {Object} [options]
24642 * @param {Boolean} [options.isSystem] Set this conversation as system conversation.
24643 * @param {Boolean} [options.isTransient] Set this conversation as transient conversation.
24644 */
24645
24646
24647module.exports = AV.Object.extend('_Conversation',
24648/** @lends AV.Conversation.prototype */
24649{
24650 constructor: function constructor(name) {
24651 var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
24652 AV.Object.prototype.constructor.call(this, null, null);
24653 this.set('name', name);
24654
24655 if (options.isSystem !== undefined) {
24656 this.set('sys', options.isSystem ? true : false);
24657 }
24658
24659 if (options.isTransient !== undefined) {
24660 this.set('tr', options.isTransient ? true : false);
24661 }
24662 },
24663
24664 /**
24665 * Get current conversation's creator.
24666 *
24667 * @return {String}
24668 */
24669 getCreator: function getCreator() {
24670 return this.get('c');
24671 },
24672
24673 /**
24674 * Get the last message's time.
24675 *
24676 * @return {Date}
24677 */
24678 getLastMessageAt: function getLastMessageAt() {
24679 return this.get('lm');
24680 },
24681
24682 /**
24683 * Get this conversation's members
24684 *
24685 * @return {String[]}
24686 */
24687 getMembers: function getMembers() {
24688 return this.get('m');
24689 },
24690
24691 /**
24692 * Add a member to this conversation
24693 *
24694 * @param {String} member
24695 */
24696 addMember: function addMember(member) {
24697 return this.add('m', member);
24698 },
24699
24700 /**
24701 * Get this conversation's members who set this conversation as muted.
24702 *
24703 * @return {String[]}
24704 */
24705 getMutedMembers: function getMutedMembers() {
24706 return this.get('mu');
24707 },
24708
24709 /**
24710 * Get this conversation's name field.
24711 *
24712 * @return String
24713 */
24714 getName: function getName() {
24715 return this.get('name');
24716 },
24717
24718 /**
24719 * Returns true if this conversation is transient conversation.
24720 *
24721 * @return {Boolean}
24722 */
24723 isTransient: function isTransient() {
24724 return this.get('tr');
24725 },
24726
24727 /**
24728 * Returns true if this conversation is system conversation.
24729 *
24730 * @return {Boolean}
24731 */
24732 isSystem: function isSystem() {
24733 return this.get('sys');
24734 },
24735
24736 /**
24737 * Send realtime message to this conversation, using HTTP request.
24738 *
24739 * @param {String} fromClient Sender's client id.
24740 * @param {String|Object} message The message which will send to conversation.
24741 * It could be a raw string, or an object with a `toJSON` method, like a
24742 * realtime SDK's Message object. See more: {@link https://leancloud.cn/docs/realtime_guide-js.html#消息}
24743 * @param {Object} [options]
24744 * @param {Boolean} [options.transient] Whether send this message as transient message or not.
24745 * @param {String[]} [options.toClients] Ids of clients to send to. This option can be used only in system conversation.
24746 * @param {Object} [options.pushData] Push data to this message. See more: {@link https://url.leanapp.cn/pushData 推送消息内容}
24747 * @param {AuthOptions} [authOptions]
24748 * @return {Promise}
24749 */
24750 send: function send(fromClient, message) {
24751 var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
24752 var authOptions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
24753 var data = {
24754 from_peer: fromClient,
24755 conv_id: this.id,
24756 transient: false,
24757 message: serializeMessage(message)
24758 };
24759
24760 if (options.toClients !== undefined) {
24761 data.to_peers = options.toClients;
24762 }
24763
24764 if (options.transient !== undefined) {
24765 data.transient = options.transient ? true : false;
24766 }
24767
24768 if (options.pushData !== undefined) {
24769 data.push_data = options.pushData;
24770 }
24771
24772 return _request('rtm', 'messages', null, 'POST', data, authOptions);
24773 },
24774
24775 /**
24776 * Send realtime broadcast message to all clients, via this conversation, using HTTP request.
24777 *
24778 * @param {String} fromClient Sender's client id.
24779 * @param {String|Object} message The message which will send to conversation.
24780 * It could be a raw string, or an object with a `toJSON` method, like a
24781 * realtime SDK's Message object. See more: {@link https://leancloud.cn/docs/realtime_guide-js.html#消息}.
24782 * @param {Object} [options]
24783 * @param {Object} [options.pushData] Push data to this message. See more: {@link https://url.leanapp.cn/pushData 推送消息内容}.
24784 * @param {Object} [options.validTill] The message will valid till this time.
24785 * @param {AuthOptions} [authOptions]
24786 * @return {Promise}
24787 */
24788 broadcast: function broadcast(fromClient, message) {
24789 var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
24790 var authOptions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
24791 var data = {
24792 from_peer: fromClient,
24793 conv_id: this.id,
24794 message: serializeMessage(message)
24795 };
24796
24797 if (options.pushData !== undefined) {
24798 data.push = options.pushData;
24799 }
24800
24801 if (options.validTill !== undefined) {
24802 var ts = options.validTill;
24803
24804 if (_.isDate(ts)) {
24805 ts = ts.getTime();
24806 }
24807
24808 options.valid_till = ts;
24809 }
24810
24811 return _request('rtm', 'broadcast', null, 'POST', data, authOptions);
24812 }
24813});
24814
24815/***/ }),
24816/* 544 */
24817/***/ (function(module, exports, __webpack_require__) {
24818
24819"use strict";
24820
24821
24822var _interopRequireDefault = __webpack_require__(1);
24823
24824var _promise = _interopRequireDefault(__webpack_require__(12));
24825
24826var _map = _interopRequireDefault(__webpack_require__(42));
24827
24828var _concat = _interopRequireDefault(__webpack_require__(30));
24829
24830var _ = __webpack_require__(2);
24831
24832var _require = __webpack_require__(26),
24833 request = _require.request;
24834
24835var _require2 = __webpack_require__(29),
24836 ensureArray = _require2.ensureArray,
24837 parseDate = _require2.parseDate;
24838
24839var AV = __webpack_require__(65);
24840/**
24841 * The version change interval for Leaderboard
24842 * @enum
24843 */
24844
24845
24846AV.LeaderboardVersionChangeInterval = {
24847 NEVER: 'never',
24848 DAY: 'day',
24849 WEEK: 'week',
24850 MONTH: 'month'
24851};
24852/**
24853 * The order of the leaderboard results
24854 * @enum
24855 */
24856
24857AV.LeaderboardOrder = {
24858 ASCENDING: 'ascending',
24859 DESCENDING: 'descending'
24860};
24861/**
24862 * The update strategy for Leaderboard
24863 * @enum
24864 */
24865
24866AV.LeaderboardUpdateStrategy = {
24867 /** Only keep the best statistic. If the leaderboard is in descending order, the best statistic is the highest one. */
24868 BETTER: 'better',
24869
24870 /** Keep the last updated statistic */
24871 LAST: 'last',
24872
24873 /** Keep the sum of all updated statistics */
24874 SUM: 'sum'
24875};
24876/**
24877 * @typedef {Object} Ranking
24878 * @property {number} rank Starts at 0
24879 * @property {number} value the statistic value of this ranking
24880 * @property {AV.User} user The user of this ranking
24881 * @property {Statistic[]} [includedStatistics] Other statistics of the user, specified by the `includeStatistic` option of `AV.Leaderboard.getResults()`
24882 */
24883
24884/**
24885 * @typedef {Object} LeaderboardArchive
24886 * @property {string} statisticName
24887 * @property {number} version version of the leaderboard
24888 * @property {string} status
24889 * @property {string} url URL for the downloadable archive
24890 * @property {Date} activatedAt time when this version became active
24891 * @property {Date} deactivatedAt time when this version was deactivated by a version incrementing
24892 */
24893
24894/**
24895 * @class
24896 */
24897
24898function Statistic(_ref) {
24899 var name = _ref.name,
24900 value = _ref.value,
24901 version = _ref.version;
24902
24903 /**
24904 * @type {string}
24905 */
24906 this.name = name;
24907 /**
24908 * @type {number}
24909 */
24910
24911 this.value = value;
24912 /**
24913 * @type {number?}
24914 */
24915
24916 this.version = version;
24917}
24918
24919var parseStatisticData = function parseStatisticData(statisticData) {
24920 var _AV$_decode = AV._decode(statisticData),
24921 name = _AV$_decode.statisticName,
24922 value = _AV$_decode.statisticValue,
24923 version = _AV$_decode.version;
24924
24925 return new Statistic({
24926 name: name,
24927 value: value,
24928 version: version
24929 });
24930};
24931/**
24932 * @class
24933 */
24934
24935
24936AV.Leaderboard = function Leaderboard(statisticName) {
24937 /**
24938 * @type {string}
24939 */
24940 this.statisticName = statisticName;
24941 /**
24942 * @type {AV.LeaderboardOrder}
24943 */
24944
24945 this.order = undefined;
24946 /**
24947 * @type {AV.LeaderboardUpdateStrategy}
24948 */
24949
24950 this.updateStrategy = undefined;
24951 /**
24952 * @type {AV.LeaderboardVersionChangeInterval}
24953 */
24954
24955 this.versionChangeInterval = undefined;
24956 /**
24957 * @type {number}
24958 */
24959
24960 this.version = undefined;
24961 /**
24962 * @type {Date?}
24963 */
24964
24965 this.nextResetAt = undefined;
24966 /**
24967 * @type {Date?}
24968 */
24969
24970 this.createdAt = undefined;
24971};
24972
24973var Leaderboard = AV.Leaderboard;
24974/**
24975 * Create an instance of Leaderboard for the give statistic name.
24976 * @param {string} statisticName
24977 * @return {AV.Leaderboard}
24978 */
24979
24980AV.Leaderboard.createWithoutData = function (statisticName) {
24981 return new Leaderboard(statisticName);
24982};
24983/**
24984 * (masterKey required) Create a new Leaderboard.
24985 * @param {Object} options
24986 * @param {string} options.statisticName
24987 * @param {AV.LeaderboardOrder} options.order
24988 * @param {AV.LeaderboardVersionChangeInterval} [options.versionChangeInterval] default to WEEK
24989 * @param {AV.LeaderboardUpdateStrategy} [options.updateStrategy] default to BETTER
24990 * @param {AuthOptions} [authOptions]
24991 * @return {Promise<AV.Leaderboard>}
24992 */
24993
24994
24995AV.Leaderboard.createLeaderboard = function (_ref2, authOptions) {
24996 var statisticName = _ref2.statisticName,
24997 order = _ref2.order,
24998 versionChangeInterval = _ref2.versionChangeInterval,
24999 updateStrategy = _ref2.updateStrategy;
25000 return request({
25001 method: 'POST',
25002 path: '/leaderboard/leaderboards',
25003 data: {
25004 statisticName: statisticName,
25005 order: order,
25006 versionChangeInterval: versionChangeInterval,
25007 updateStrategy: updateStrategy
25008 },
25009 authOptions: authOptions
25010 }).then(function (data) {
25011 var leaderboard = new Leaderboard(statisticName);
25012 return leaderboard._finishFetch(data);
25013 });
25014};
25015/**
25016 * Get the Leaderboard with the specified statistic name.
25017 * @param {string} statisticName
25018 * @param {AuthOptions} [authOptions]
25019 * @return {Promise<AV.Leaderboard>}
25020 */
25021
25022
25023AV.Leaderboard.getLeaderboard = function (statisticName, authOptions) {
25024 return Leaderboard.createWithoutData(statisticName).fetch(authOptions);
25025};
25026/**
25027 * Get Statistics for the specified user.
25028 * @param {AV.User} user The specified AV.User pointer.
25029 * @param {Object} [options]
25030 * @param {string[]} [options.statisticNames] Specify the statisticNames. If not set, all statistics of the user will be fetched.
25031 * @param {AuthOptions} [authOptions]
25032 * @return {Promise<Statistic[]>}
25033 */
25034
25035
25036AV.Leaderboard.getStatistics = function (user) {
25037 var _ref3 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
25038 statisticNames = _ref3.statisticNames;
25039
25040 var authOptions = arguments.length > 2 ? arguments[2] : undefined;
25041 return _promise.default.resolve().then(function () {
25042 if (!(user && user.id)) throw new Error('user must be an AV.User');
25043 return request({
25044 method: 'GET',
25045 path: "/leaderboard/users/".concat(user.id, "/statistics"),
25046 query: {
25047 statistics: statisticNames ? ensureArray(statisticNames).join(',') : undefined
25048 },
25049 authOptions: authOptions
25050 }).then(function (_ref4) {
25051 var results = _ref4.results;
25052 return (0, _map.default)(results).call(results, parseStatisticData);
25053 });
25054 });
25055};
25056/**
25057 * Update Statistics for the specified user.
25058 * @param {AV.User} user The specified AV.User pointer.
25059 * @param {Object} statistics A name-value pair representing the statistics to update.
25060 * @param {AuthOptions} [options] AuthOptions plus:
25061 * @param {boolean} [options.overwrite] Wethere to overwrite these statistics disregarding the updateStrategy of there leaderboards
25062 * @return {Promise<Statistic[]>}
25063 */
25064
25065
25066AV.Leaderboard.updateStatistics = function (user, statistics) {
25067 var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
25068 return _promise.default.resolve().then(function () {
25069 if (!(user && user.id)) throw new Error('user must be an AV.User');
25070 var data = (0, _map.default)(_).call(_, statistics, function (value, key) {
25071 return {
25072 statisticName: key,
25073 statisticValue: value
25074 };
25075 });
25076 var overwrite = options.overwrite;
25077 return request({
25078 method: 'POST',
25079 path: "/leaderboard/users/".concat(user.id, "/statistics"),
25080 query: {
25081 overwrite: overwrite ? 1 : undefined
25082 },
25083 data: data,
25084 authOptions: options
25085 }).then(function (_ref5) {
25086 var results = _ref5.results;
25087 return (0, _map.default)(results).call(results, parseStatisticData);
25088 });
25089 });
25090};
25091/**
25092 * Delete Statistics for the specified user.
25093 * @param {AV.User} user The specified AV.User pointer.
25094 * @param {Object} statistics A name-value pair representing the statistics to delete.
25095 * @param {AuthOptions} [options]
25096 * @return {Promise<void>}
25097 */
25098
25099
25100AV.Leaderboard.deleteStatistics = function (user, statisticNames, authOptions) {
25101 return _promise.default.resolve().then(function () {
25102 if (!(user && user.id)) throw new Error('user must be an AV.User');
25103 return request({
25104 method: 'DELETE',
25105 path: "/leaderboard/users/".concat(user.id, "/statistics"),
25106 query: {
25107 statistics: ensureArray(statisticNames).join(',')
25108 },
25109 authOptions: authOptions
25110 }).then(function () {
25111 return undefined;
25112 });
25113 });
25114};
25115
25116_.extend(Leaderboard.prototype,
25117/** @lends AV.Leaderboard.prototype */
25118{
25119 _finishFetch: function _finishFetch(data) {
25120 var _this = this;
25121
25122 _.forEach(data, function (value, key) {
25123 if (key === 'updatedAt' || key === 'objectId') return;
25124
25125 if (key === 'expiredAt') {
25126 key = 'nextResetAt';
25127 }
25128
25129 if (key === 'createdAt') {
25130 value = parseDate(value);
25131 }
25132
25133 if (value && value.__type === 'Date') {
25134 value = parseDate(value.iso);
25135 }
25136
25137 _this[key] = value;
25138 });
25139
25140 return this;
25141 },
25142
25143 /**
25144 * Fetch data from the srever.
25145 * @param {AuthOptions} [authOptions]
25146 * @return {Promise<AV.Leaderboard>}
25147 */
25148 fetch: function fetch(authOptions) {
25149 var _this2 = this;
25150
25151 return request({
25152 method: 'GET',
25153 path: "/leaderboard/leaderboards/".concat(this.statisticName),
25154 authOptions: authOptions
25155 }).then(function (data) {
25156 return _this2._finishFetch(data);
25157 });
25158 },
25159
25160 /**
25161 * Counts the number of users participated in this leaderboard
25162 * @param {Object} [options]
25163 * @param {number} [options.version] Specify the version of the leaderboard
25164 * @param {AuthOptions} [authOptions]
25165 * @return {Promise<number>}
25166 */
25167 count: function count() {
25168 var _ref6 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
25169 version = _ref6.version;
25170
25171 var authOptions = arguments.length > 1 ? arguments[1] : undefined;
25172 return request({
25173 method: 'GET',
25174 path: "/leaderboard/leaderboards/".concat(this.statisticName, "/ranks"),
25175 query: {
25176 count: 1,
25177 limit: 0,
25178 version: version
25179 },
25180 authOptions: authOptions
25181 }).then(function (_ref7) {
25182 var count = _ref7.count;
25183 return count;
25184 });
25185 },
25186 _getResults: function _getResults(_ref8, authOptions, userId) {
25187 var _context;
25188
25189 var skip = _ref8.skip,
25190 limit = _ref8.limit,
25191 selectUserKeys = _ref8.selectUserKeys,
25192 includeUserKeys = _ref8.includeUserKeys,
25193 includeStatistics = _ref8.includeStatistics,
25194 version = _ref8.version;
25195 return request({
25196 method: 'GET',
25197 path: (0, _concat.default)(_context = "/leaderboard/leaderboards/".concat(this.statisticName, "/ranks")).call(_context, userId ? "/".concat(userId) : ''),
25198 query: {
25199 skip: skip,
25200 limit: limit,
25201 selectUserKeys: _.union(ensureArray(selectUserKeys), ensureArray(includeUserKeys)).join(',') || undefined,
25202 includeUser: includeUserKeys ? ensureArray(includeUserKeys).join(',') : undefined,
25203 includeStatistics: includeStatistics ? ensureArray(includeStatistics).join(',') : undefined,
25204 version: version
25205 },
25206 authOptions: authOptions
25207 }).then(function (_ref9) {
25208 var rankings = _ref9.results;
25209 return (0, _map.default)(rankings).call(rankings, function (rankingData) {
25210 var _AV$_decode2 = AV._decode(rankingData),
25211 user = _AV$_decode2.user,
25212 value = _AV$_decode2.statisticValue,
25213 rank = _AV$_decode2.rank,
25214 _AV$_decode2$statisti = _AV$_decode2.statistics,
25215 statistics = _AV$_decode2$statisti === void 0 ? [] : _AV$_decode2$statisti;
25216
25217 return {
25218 user: user,
25219 value: value,
25220 rank: rank,
25221 includedStatistics: (0, _map.default)(statistics).call(statistics, parseStatisticData)
25222 };
25223 });
25224 });
25225 },
25226
25227 /**
25228 * Retrieve a list of ranked users for this Leaderboard.
25229 * @param {Object} [options]
25230 * @param {number} [options.skip] The number of results to skip. This is useful for pagination.
25231 * @param {number} [options.limit] The limit of the number of results.
25232 * @param {string[]} [options.selectUserKeys] Specify keys of the users to include in the Rankings
25233 * @param {string[]} [options.includeUserKeys] If the value of a selected user keys is a Pointer, use this options to include its value.
25234 * @param {string[]} [options.includeStatistics] Specify other statistics to include in the Rankings
25235 * @param {number} [options.version] Specify the version of the leaderboard
25236 * @param {AuthOptions} [authOptions]
25237 * @return {Promise<Ranking[]>}
25238 */
25239 getResults: function getResults() {
25240 var _ref10 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
25241 skip = _ref10.skip,
25242 limit = _ref10.limit,
25243 selectUserKeys = _ref10.selectUserKeys,
25244 includeUserKeys = _ref10.includeUserKeys,
25245 includeStatistics = _ref10.includeStatistics,
25246 version = _ref10.version;
25247
25248 var authOptions = arguments.length > 1 ? arguments[1] : undefined;
25249 return this._getResults({
25250 skip: skip,
25251 limit: limit,
25252 selectUserKeys: selectUserKeys,
25253 includeUserKeys: includeUserKeys,
25254 includeStatistics: includeStatistics,
25255 version: version
25256 }, authOptions);
25257 },
25258
25259 /**
25260 * Retrieve a list of ranked users for this Leaderboard, centered on the specified user.
25261 * @param {AV.User} user The specified AV.User pointer.
25262 * @param {Object} [options]
25263 * @param {number} [options.limit] The limit of the number of results.
25264 * @param {string[]} [options.selectUserKeys] Specify keys of the users to include in the Rankings
25265 * @param {string[]} [options.includeUserKeys] If the value of a selected user keys is a Pointer, use this options to include its value.
25266 * @param {string[]} [options.includeStatistics] Specify other statistics to include in the Rankings
25267 * @param {number} [options.version] Specify the version of the leaderboard
25268 * @param {AuthOptions} [authOptions]
25269 * @return {Promise<Ranking[]>}
25270 */
25271 getResultsAroundUser: function getResultsAroundUser(user) {
25272 var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
25273 var authOptions = arguments.length > 2 ? arguments[2] : undefined;
25274
25275 // getResultsAroundUser(options, authOptions)
25276 if (user && typeof user.id !== 'string') {
25277 return this.getResultsAroundUser(undefined, user, options);
25278 }
25279
25280 var limit = options.limit,
25281 selectUserKeys = options.selectUserKeys,
25282 includeUserKeys = options.includeUserKeys,
25283 includeStatistics = options.includeStatistics,
25284 version = options.version;
25285 return this._getResults({
25286 limit: limit,
25287 selectUserKeys: selectUserKeys,
25288 includeUserKeys: includeUserKeys,
25289 includeStatistics: includeStatistics,
25290 version: version
25291 }, authOptions, user ? user.id : 'self');
25292 },
25293 _update: function _update(data, authOptions) {
25294 var _this3 = this;
25295
25296 return request({
25297 method: 'PUT',
25298 path: "/leaderboard/leaderboards/".concat(this.statisticName),
25299 data: data,
25300 authOptions: authOptions
25301 }).then(function (result) {
25302 return _this3._finishFetch(result);
25303 });
25304 },
25305
25306 /**
25307 * (masterKey required) Update the version change interval of the Leaderboard.
25308 * @param {AV.LeaderboardVersionChangeInterval} versionChangeInterval
25309 * @param {AuthOptions} [authOptions]
25310 * @return {Promise<AV.Leaderboard>}
25311 */
25312 updateVersionChangeInterval: function updateVersionChangeInterval(versionChangeInterval, authOptions) {
25313 return this._update({
25314 versionChangeInterval: versionChangeInterval
25315 }, authOptions);
25316 },
25317
25318 /**
25319 * (masterKey required) Update the version change interval of the Leaderboard.
25320 * @param {AV.LeaderboardUpdateStrategy} updateStrategy
25321 * @param {AuthOptions} [authOptions]
25322 * @return {Promise<AV.Leaderboard>}
25323 */
25324 updateUpdateStrategy: function updateUpdateStrategy(updateStrategy, authOptions) {
25325 return this._update({
25326 updateStrategy: updateStrategy
25327 }, authOptions);
25328 },
25329
25330 /**
25331 * (masterKey required) Reset the Leaderboard. The version of the Leaderboard will be incremented by 1.
25332 * @param {AuthOptions} [authOptions]
25333 * @return {Promise<AV.Leaderboard>}
25334 */
25335 reset: function reset(authOptions) {
25336 var _this4 = this;
25337
25338 return request({
25339 method: 'PUT',
25340 path: "/leaderboard/leaderboards/".concat(this.statisticName, "/incrementVersion"),
25341 authOptions: authOptions
25342 }).then(function (data) {
25343 return _this4._finishFetch(data);
25344 });
25345 },
25346
25347 /**
25348 * (masterKey required) Delete the Leaderboard and its all archived versions.
25349 * @param {AuthOptions} [authOptions]
25350 * @return {void}
25351 */
25352 destroy: function destroy(authOptions) {
25353 return AV.request({
25354 method: 'DELETE',
25355 path: "/leaderboard/leaderboards/".concat(this.statisticName),
25356 authOptions: authOptions
25357 }).then(function () {
25358 return undefined;
25359 });
25360 },
25361
25362 /**
25363 * (masterKey required) Get archived versions.
25364 * @param {Object} [options]
25365 * @param {number} [options.skip] The number of results to skip. This is useful for pagination.
25366 * @param {number} [options.limit] The limit of the number of results.
25367 * @param {AuthOptions} [authOptions]
25368 * @return {Promise<LeaderboardArchive[]>}
25369 */
25370 getArchives: function getArchives() {
25371 var _this5 = this;
25372
25373 var _ref11 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
25374 skip = _ref11.skip,
25375 limit = _ref11.limit;
25376
25377 var authOptions = arguments.length > 1 ? arguments[1] : undefined;
25378 return request({
25379 method: 'GET',
25380 path: "/leaderboard/leaderboards/".concat(this.statisticName, "/archives"),
25381 query: {
25382 skip: skip,
25383 limit: limit
25384 },
25385 authOptions: authOptions
25386 }).then(function (_ref12) {
25387 var results = _ref12.results;
25388 return (0, _map.default)(results).call(results, function (_ref13) {
25389 var version = _ref13.version,
25390 status = _ref13.status,
25391 url = _ref13.url,
25392 activatedAt = _ref13.activatedAt,
25393 deactivatedAt = _ref13.deactivatedAt;
25394 return {
25395 statisticName: _this5.statisticName,
25396 version: version,
25397 status: status,
25398 url: url,
25399 activatedAt: parseDate(activatedAt.iso),
25400 deactivatedAt: parseDate(deactivatedAt.iso)
25401 };
25402 });
25403 });
25404 }
25405});
25406
25407/***/ }),
25408/* 545 */
25409/***/ (function(module, exports, __webpack_require__) {
25410
25411"use strict";
25412
25413
25414var adapters = __webpack_require__(546);
25415
25416module.exports = function (AV) {
25417 AV.setAdapters(adapters);
25418 return AV;
25419};
25420
25421/***/ }),
25422/* 546 */
25423/***/ (function(module, exports, __webpack_require__) {
25424
25425"use strict";
25426
25427
25428var _interopRequireDefault = __webpack_require__(1);
25429
25430var _typeof2 = _interopRequireDefault(__webpack_require__(109));
25431
25432var _defineProperty = _interopRequireDefault(__webpack_require__(143));
25433
25434var _setPrototypeOf = _interopRequireDefault(__webpack_require__(227));
25435
25436var _assign2 = _interopRequireDefault(__webpack_require__(547));
25437
25438var _indexOf = _interopRequireDefault(__webpack_require__(86));
25439
25440var _getOwnPropertySymbols = _interopRequireDefault(__webpack_require__(552));
25441
25442var _promise = _interopRequireDefault(__webpack_require__(12));
25443
25444var _symbol = _interopRequireDefault(__webpack_require__(240));
25445
25446var _iterator = _interopRequireDefault(__webpack_require__(555));
25447
25448var _weakMap = _interopRequireDefault(__webpack_require__(556));
25449
25450var _keys = _interopRequireDefault(__webpack_require__(141));
25451
25452var _getOwnPropertyDescriptor = _interopRequireDefault(__webpack_require__(246));
25453
25454var _getPrototypeOf = _interopRequireDefault(__webpack_require__(142));
25455
25456var _map = _interopRequireDefault(__webpack_require__(564));
25457
25458(0, _defineProperty.default)(exports, '__esModule', {
25459 value: true
25460});
25461/******************************************************************************
25462Copyright (c) Microsoft Corporation.
25463
25464Permission to use, copy, modify, and/or distribute this software for any
25465purpose with or without fee is hereby granted.
25466
25467THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
25468REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
25469AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
25470INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
25471LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
25472OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
25473PERFORMANCE OF THIS SOFTWARE.
25474***************************************************************************** */
25475
25476/* global Reflect, Promise */
25477
25478var _extendStatics$ = function extendStatics$1(d, b) {
25479 _extendStatics$ = _setPrototypeOf.default || {
25480 __proto__: []
25481 } instanceof Array && function (d, b) {
25482 d.__proto__ = b;
25483 } || function (d, b) {
25484 for (var p in b) {
25485 if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
25486 }
25487 };
25488
25489 return _extendStatics$(d, b);
25490};
25491
25492function __extends$1(d, b) {
25493 if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
25494
25495 _extendStatics$(d, b);
25496
25497 function __() {
25498 this.constructor = d;
25499 }
25500
25501 d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
25502}
25503
25504var _assign = function __assign() {
25505 _assign = _assign2.default || function __assign(t) {
25506 for (var s, i = 1, n = arguments.length; i < n; i++) {
25507 s = arguments[i];
25508
25509 for (var p in s) {
25510 if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
25511 }
25512 }
25513
25514 return t;
25515 };
25516
25517 return _assign.apply(this, arguments);
25518};
25519
25520function __rest(s, e) {
25521 var t = {};
25522
25523 for (var p in s) {
25524 if (Object.prototype.hasOwnProperty.call(s, p) && (0, _indexOf.default)(e).call(e, p) < 0) t[p] = s[p];
25525 }
25526
25527 if (s != null && typeof _getOwnPropertySymbols.default === "function") for (var i = 0, p = (0, _getOwnPropertySymbols.default)(s); i < p.length; i++) {
25528 if ((0, _indexOf.default)(e).call(e, p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
25529 }
25530 return t;
25531}
25532
25533function __awaiter(thisArg, _arguments, P, generator) {
25534 function adopt(value) {
25535 return value instanceof P ? value : new P(function (resolve) {
25536 resolve(value);
25537 });
25538 }
25539
25540 return new (P || (P = _promise.default))(function (resolve, reject) {
25541 function fulfilled(value) {
25542 try {
25543 step(generator.next(value));
25544 } catch (e) {
25545 reject(e);
25546 }
25547 }
25548
25549 function rejected(value) {
25550 try {
25551 step(generator["throw"](value));
25552 } catch (e) {
25553 reject(e);
25554 }
25555 }
25556
25557 function step(result) {
25558 result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
25559 }
25560
25561 step((generator = generator.apply(thisArg, _arguments || [])).next());
25562 });
25563}
25564
25565function __generator(thisArg, body) {
25566 var _ = {
25567 label: 0,
25568 sent: function sent() {
25569 if (t[0] & 1) throw t[1];
25570 return t[1];
25571 },
25572 trys: [],
25573 ops: []
25574 },
25575 f,
25576 y,
25577 t,
25578 g;
25579 return g = {
25580 next: verb(0),
25581 "throw": verb(1),
25582 "return": verb(2)
25583 }, typeof _symbol.default === "function" && (g[_iterator.default] = function () {
25584 return this;
25585 }), g;
25586
25587 function verb(n) {
25588 return function (v) {
25589 return step([n, v]);
25590 };
25591 }
25592
25593 function step(op) {
25594 if (f) throw new TypeError("Generator is already executing.");
25595
25596 while (_) {
25597 try {
25598 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;
25599 if (y = 0, t) op = [op[0] & 2, t.value];
25600
25601 switch (op[0]) {
25602 case 0:
25603 case 1:
25604 t = op;
25605 break;
25606
25607 case 4:
25608 _.label++;
25609 return {
25610 value: op[1],
25611 done: false
25612 };
25613
25614 case 5:
25615 _.label++;
25616 y = op[1];
25617 op = [0];
25618 continue;
25619
25620 case 7:
25621 op = _.ops.pop();
25622
25623 _.trys.pop();
25624
25625 continue;
25626
25627 default:
25628 if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
25629 _ = 0;
25630 continue;
25631 }
25632
25633 if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
25634 _.label = op[1];
25635 break;
25636 }
25637
25638 if (op[0] === 6 && _.label < t[1]) {
25639 _.label = t[1];
25640 t = op;
25641 break;
25642 }
25643
25644 if (t && _.label < t[2]) {
25645 _.label = t[2];
25646
25647 _.ops.push(op);
25648
25649 break;
25650 }
25651
25652 if (t[2]) _.ops.pop();
25653
25654 _.trys.pop();
25655
25656 continue;
25657 }
25658
25659 op = body.call(thisArg, _);
25660 } catch (e) {
25661 op = [6, e];
25662 y = 0;
25663 } finally {
25664 f = t = 0;
25665 }
25666 }
25667
25668 if (op[0] & 5) throw op[1];
25669 return {
25670 value: op[0] ? op[1] : void 0,
25671 done: true
25672 };
25673 }
25674}
25675
25676var PROVIDER = "lc_weapp";
25677var PLATFORM = "weixin";
25678
25679function getLoginCode() {
25680 return new _promise.default(function (resolve, reject) {
25681 wx.login({
25682 success: function success(res) {
25683 return res.code ? resolve(res.code) : reject(new Error(res.errMsg));
25684 },
25685 fail: function fail(_a) {
25686 var errMsg = _a.errMsg;
25687 return reject(new Error(errMsg));
25688 }
25689 });
25690 });
25691}
25692
25693var getAuthInfo = function getAuthInfo(_a) {
25694 var _b = _a === void 0 ? {} : _a,
25695 _c = _b.platform,
25696 platform = _c === void 0 ? PLATFORM : _c,
25697 _d = _b.preferUnionId,
25698 preferUnionId = _d === void 0 ? false : _d,
25699 _e = _b.asMainAccount,
25700 asMainAccount = _e === void 0 ? false : _e;
25701
25702 return __awaiter(this, void 0, void 0, function () {
25703 var code, authData;
25704 return __generator(this, function (_f) {
25705 switch (_f.label) {
25706 case 0:
25707 return [4
25708 /*yield*/
25709 , getLoginCode()];
25710
25711 case 1:
25712 code = _f.sent();
25713 authData = {
25714 code: code
25715 };
25716
25717 if (preferUnionId) {
25718 authData.platform = platform;
25719 authData.main_account = asMainAccount;
25720 }
25721
25722 return [2
25723 /*return*/
25724 , {
25725 authData: authData,
25726 platform: platform,
25727 provider: PROVIDER
25728 }];
25729 }
25730 });
25731 });
25732};
25733
25734var storage = {
25735 getItem: function getItem(key) {
25736 return wx.getStorageSync(key);
25737 },
25738 setItem: function setItem(key, value) {
25739 return wx.setStorageSync(key, value);
25740 },
25741 removeItem: function removeItem(key) {
25742 return wx.removeStorageSync(key);
25743 },
25744 clear: function clear() {
25745 return wx.clearStorageSync();
25746 }
25747};
25748/******************************************************************************
25749Copyright (c) Microsoft Corporation.
25750
25751Permission to use, copy, modify, and/or distribute this software for any
25752purpose with or without fee is hereby granted.
25753
25754THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
25755REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
25756AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
25757INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
25758LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
25759OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
25760PERFORMANCE OF THIS SOFTWARE.
25761***************************************************************************** */
25762
25763/* global Reflect, Promise */
25764
25765var _extendStatics = function extendStatics(d, b) {
25766 _extendStatics = _setPrototypeOf.default || {
25767 __proto__: []
25768 } instanceof Array && function (d, b) {
25769 d.__proto__ = b;
25770 } || function (d, b) {
25771 for (var p in b) {
25772 if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
25773 }
25774 };
25775
25776 return _extendStatics(d, b);
25777};
25778
25779function __extends(d, b) {
25780 if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
25781
25782 _extendStatics(d, b);
25783
25784 function __() {
25785 this.constructor = d;
25786 }
25787
25788 d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
25789}
25790
25791var AbortError =
25792/** @class */
25793function (_super) {
25794 __extends(AbortError, _super);
25795
25796 function AbortError() {
25797 var _this = _super !== null && _super.apply(this, arguments) || this;
25798
25799 _this.name = "AbortError";
25800 return _this;
25801 }
25802
25803 return AbortError;
25804}(Error);
25805
25806var request = function request(url, options) {
25807 if (options === void 0) {
25808 options = {};
25809 }
25810
25811 var method = options.method,
25812 data = options.data,
25813 headers = options.headers,
25814 signal = options.signal;
25815
25816 if (signal === null || signal === void 0 ? void 0 : signal.aborted) {
25817 return _promise.default.reject(new AbortError("Request aborted"));
25818 }
25819
25820 return new _promise.default(function (resolve, reject) {
25821 var task = wx.request({
25822 url: url,
25823 method: method,
25824 data: data,
25825 header: headers,
25826 complete: function complete(res) {
25827 signal === null || signal === void 0 ? void 0 : signal.removeEventListener("abort", abortListener);
25828
25829 if (!res.statusCode) {
25830 reject(new Error(res.errMsg));
25831 return;
25832 }
25833
25834 resolve({
25835 ok: !(res.statusCode >= 400),
25836 status: res.statusCode,
25837 headers: res.header,
25838 data: res.data
25839 });
25840 }
25841 });
25842
25843 var abortListener = function abortListener() {
25844 reject(new AbortError("Request aborted"));
25845 task.abort();
25846 };
25847
25848 signal === null || signal === void 0 ? void 0 : signal.addEventListener("abort", abortListener);
25849 });
25850};
25851
25852var upload = function upload(url, file, options) {
25853 if (options === void 0) {
25854 options = {};
25855 }
25856
25857 var headers = options.headers,
25858 data = options.data,
25859 onprogress = options.onprogress,
25860 signal = options.signal;
25861
25862 if (signal === null || signal === void 0 ? void 0 : signal.aborted) {
25863 return _promise.default.reject(new AbortError("Request aborted"));
25864 }
25865
25866 if (!(file && file.data && file.data.uri)) {
25867 return _promise.default.reject(new TypeError("File data must be an object like { uri: localPath }."));
25868 }
25869
25870 return new _promise.default(function (resolve, reject) {
25871 var task = wx.uploadFile({
25872 url: url,
25873 header: headers,
25874 filePath: file.data.uri,
25875 name: file.field,
25876 formData: data,
25877 success: function success(response) {
25878 var status = response.statusCode,
25879 data = response.data,
25880 rest = __rest(response, ["statusCode", "data"]);
25881
25882 resolve(_assign(_assign({}, rest), {
25883 data: typeof data === "string" ? JSON.parse(data) : data,
25884 status: status,
25885 ok: !(status >= 400)
25886 }));
25887 },
25888 fail: function fail(response) {
25889 reject(new Error(response.errMsg));
25890 },
25891 complete: function complete() {
25892 signal === null || signal === void 0 ? void 0 : signal.removeEventListener("abort", abortListener);
25893 }
25894 });
25895
25896 var abortListener = function abortListener() {
25897 reject(new AbortError("Request aborted"));
25898 task.abort();
25899 };
25900
25901 signal === null || signal === void 0 ? void 0 : signal.addEventListener("abort", abortListener);
25902
25903 if (onprogress) {
25904 task.onProgressUpdate(function (event) {
25905 return onprogress({
25906 loaded: event.totalBytesSent,
25907 total: event.totalBytesExpectedToSend,
25908 percent: event.progress
25909 });
25910 });
25911 }
25912 });
25913};
25914/**
25915 * @author Toru Nagashima <https://github.com/mysticatea>
25916 * @copyright 2015 Toru Nagashima. All rights reserved.
25917 * See LICENSE file in root directory for full license.
25918 */
25919
25920/**
25921 * @typedef {object} PrivateData
25922 * @property {EventTarget} eventTarget The event target.
25923 * @property {{type:string}} event The original event object.
25924 * @property {number} eventPhase The current event phase.
25925 * @property {EventTarget|null} currentTarget The current event target.
25926 * @property {boolean} canceled The flag to prevent default.
25927 * @property {boolean} stopped The flag to stop propagation.
25928 * @property {boolean} immediateStopped The flag to stop propagation immediately.
25929 * @property {Function|null} passiveListener The listener if the current listener is passive. Otherwise this is null.
25930 * @property {number} timeStamp The unix time.
25931 * @private
25932 */
25933
25934/**
25935 * Private data for event wrappers.
25936 * @type {WeakMap<Event, PrivateData>}
25937 * @private
25938 */
25939
25940
25941var privateData = new _weakMap.default();
25942/**
25943 * Cache for wrapper classes.
25944 * @type {WeakMap<Object, Function>}
25945 * @private
25946 */
25947
25948var wrappers = new _weakMap.default();
25949/**
25950 * Get private data.
25951 * @param {Event} event The event object to get private data.
25952 * @returns {PrivateData} The private data of the event.
25953 * @private
25954 */
25955
25956function pd(event) {
25957 var retv = privateData.get(event);
25958 console.assert(retv != null, "'this' is expected an Event object, but got", event);
25959 return retv;
25960}
25961/**
25962 * https://dom.spec.whatwg.org/#set-the-canceled-flag
25963 * @param data {PrivateData} private data.
25964 */
25965
25966
25967function setCancelFlag(data) {
25968 if (data.passiveListener != null) {
25969 if (typeof console !== "undefined" && typeof console.error === "function") {
25970 console.error("Unable to preventDefault inside passive event listener invocation.", data.passiveListener);
25971 }
25972
25973 return;
25974 }
25975
25976 if (!data.event.cancelable) {
25977 return;
25978 }
25979
25980 data.canceled = true;
25981
25982 if (typeof data.event.preventDefault === "function") {
25983 data.event.preventDefault();
25984 }
25985}
25986/**
25987 * @see https://dom.spec.whatwg.org/#interface-event
25988 * @private
25989 */
25990
25991/**
25992 * The event wrapper.
25993 * @constructor
25994 * @param {EventTarget} eventTarget The event target of this dispatching.
25995 * @param {Event|{type:string}} event The original event to wrap.
25996 */
25997
25998
25999function Event(eventTarget, event) {
26000 privateData.set(this, {
26001 eventTarget: eventTarget,
26002 event: event,
26003 eventPhase: 2,
26004 currentTarget: eventTarget,
26005 canceled: false,
26006 stopped: false,
26007 immediateStopped: false,
26008 passiveListener: null,
26009 timeStamp: event.timeStamp || Date.now()
26010 }); // https://heycam.github.io/webidl/#Unforgeable
26011
26012 (0, _defineProperty.default)(this, "isTrusted", {
26013 value: false,
26014 enumerable: true
26015 }); // Define accessors
26016
26017 var keys = (0, _keys.default)(event);
26018
26019 for (var i = 0; i < keys.length; ++i) {
26020 var key = keys[i];
26021
26022 if (!(key in this)) {
26023 (0, _defineProperty.default)(this, key, defineRedirectDescriptor(key));
26024 }
26025 }
26026} // Should be enumerable, but class methods are not enumerable.
26027
26028
26029Event.prototype = {
26030 /**
26031 * The type of this event.
26032 * @type {string}
26033 */
26034 get type() {
26035 return pd(this).event.type;
26036 },
26037
26038 /**
26039 * The target of this event.
26040 * @type {EventTarget}
26041 */
26042 get target() {
26043 return pd(this).eventTarget;
26044 },
26045
26046 /**
26047 * The target of this event.
26048 * @type {EventTarget}
26049 */
26050 get currentTarget() {
26051 return pd(this).currentTarget;
26052 },
26053
26054 /**
26055 * @returns {EventTarget[]} The composed path of this event.
26056 */
26057 composedPath: function composedPath() {
26058 var currentTarget = pd(this).currentTarget;
26059
26060 if (currentTarget == null) {
26061 return [];
26062 }
26063
26064 return [currentTarget];
26065 },
26066
26067 /**
26068 * Constant of NONE.
26069 * @type {number}
26070 */
26071 get NONE() {
26072 return 0;
26073 },
26074
26075 /**
26076 * Constant of CAPTURING_PHASE.
26077 * @type {number}
26078 */
26079 get CAPTURING_PHASE() {
26080 return 1;
26081 },
26082
26083 /**
26084 * Constant of AT_TARGET.
26085 * @type {number}
26086 */
26087 get AT_TARGET() {
26088 return 2;
26089 },
26090
26091 /**
26092 * Constant of BUBBLING_PHASE.
26093 * @type {number}
26094 */
26095 get BUBBLING_PHASE() {
26096 return 3;
26097 },
26098
26099 /**
26100 * The target of this event.
26101 * @type {number}
26102 */
26103 get eventPhase() {
26104 return pd(this).eventPhase;
26105 },
26106
26107 /**
26108 * Stop event bubbling.
26109 * @returns {void}
26110 */
26111 stopPropagation: function stopPropagation() {
26112 var data = pd(this);
26113 data.stopped = true;
26114
26115 if (typeof data.event.stopPropagation === "function") {
26116 data.event.stopPropagation();
26117 }
26118 },
26119
26120 /**
26121 * Stop event bubbling.
26122 * @returns {void}
26123 */
26124 stopImmediatePropagation: function stopImmediatePropagation() {
26125 var data = pd(this);
26126 data.stopped = true;
26127 data.immediateStopped = true;
26128
26129 if (typeof data.event.stopImmediatePropagation === "function") {
26130 data.event.stopImmediatePropagation();
26131 }
26132 },
26133
26134 /**
26135 * The flag to be bubbling.
26136 * @type {boolean}
26137 */
26138 get bubbles() {
26139 return Boolean(pd(this).event.bubbles);
26140 },
26141
26142 /**
26143 * The flag to be cancelable.
26144 * @type {boolean}
26145 */
26146 get cancelable() {
26147 return Boolean(pd(this).event.cancelable);
26148 },
26149
26150 /**
26151 * Cancel this event.
26152 * @returns {void}
26153 */
26154 preventDefault: function preventDefault() {
26155 setCancelFlag(pd(this));
26156 },
26157
26158 /**
26159 * The flag to indicate cancellation state.
26160 * @type {boolean}
26161 */
26162 get defaultPrevented() {
26163 return pd(this).canceled;
26164 },
26165
26166 /**
26167 * The flag to be composed.
26168 * @type {boolean}
26169 */
26170 get composed() {
26171 return Boolean(pd(this).event.composed);
26172 },
26173
26174 /**
26175 * The unix time of this event.
26176 * @type {number}
26177 */
26178 get timeStamp() {
26179 return pd(this).timeStamp;
26180 },
26181
26182 /**
26183 * The target of this event.
26184 * @type {EventTarget}
26185 * @deprecated
26186 */
26187 get srcElement() {
26188 return pd(this).eventTarget;
26189 },
26190
26191 /**
26192 * The flag to stop event bubbling.
26193 * @type {boolean}
26194 * @deprecated
26195 */
26196 get cancelBubble() {
26197 return pd(this).stopped;
26198 },
26199
26200 set cancelBubble(value) {
26201 if (!value) {
26202 return;
26203 }
26204
26205 var data = pd(this);
26206 data.stopped = true;
26207
26208 if (typeof data.event.cancelBubble === "boolean") {
26209 data.event.cancelBubble = true;
26210 }
26211 },
26212
26213 /**
26214 * The flag to indicate cancellation state.
26215 * @type {boolean}
26216 * @deprecated
26217 */
26218 get returnValue() {
26219 return !pd(this).canceled;
26220 },
26221
26222 set returnValue(value) {
26223 if (!value) {
26224 setCancelFlag(pd(this));
26225 }
26226 },
26227
26228 /**
26229 * Initialize this event object. But do nothing under event dispatching.
26230 * @param {string} type The event type.
26231 * @param {boolean} [bubbles=false] The flag to be possible to bubble up.
26232 * @param {boolean} [cancelable=false] The flag to be possible to cancel.
26233 * @deprecated
26234 */
26235 initEvent: function initEvent() {// Do nothing.
26236 }
26237}; // `constructor` is not enumerable.
26238
26239(0, _defineProperty.default)(Event.prototype, "constructor", {
26240 value: Event,
26241 configurable: true,
26242 writable: true
26243}); // Ensure `event instanceof window.Event` is `true`.
26244
26245if (typeof window !== "undefined" && typeof window.Event !== "undefined") {
26246 (0, _setPrototypeOf.default)(Event.prototype, window.Event.prototype); // Make association for wrappers.
26247
26248 wrappers.set(window.Event.prototype, Event);
26249}
26250/**
26251 * Get the property descriptor to redirect a given property.
26252 * @param {string} key Property name to define property descriptor.
26253 * @returns {PropertyDescriptor} The property descriptor to redirect the property.
26254 * @private
26255 */
26256
26257
26258function defineRedirectDescriptor(key) {
26259 return {
26260 get: function get() {
26261 return pd(this).event[key];
26262 },
26263 set: function set(value) {
26264 pd(this).event[key] = value;
26265 },
26266 configurable: true,
26267 enumerable: true
26268 };
26269}
26270/**
26271 * Get the property descriptor to call a given method property.
26272 * @param {string} key Property name to define property descriptor.
26273 * @returns {PropertyDescriptor} The property descriptor to call the method property.
26274 * @private
26275 */
26276
26277
26278function defineCallDescriptor(key) {
26279 return {
26280 value: function value() {
26281 var event = pd(this).event;
26282 return event[key].apply(event, arguments);
26283 },
26284 configurable: true,
26285 enumerable: true
26286 };
26287}
26288/**
26289 * Define new wrapper class.
26290 * @param {Function} BaseEvent The base wrapper class.
26291 * @param {Object} proto The prototype of the original event.
26292 * @returns {Function} The defined wrapper class.
26293 * @private
26294 */
26295
26296
26297function defineWrapper(BaseEvent, proto) {
26298 var keys = (0, _keys.default)(proto);
26299
26300 if (keys.length === 0) {
26301 return BaseEvent;
26302 }
26303 /** CustomEvent */
26304
26305
26306 function CustomEvent(eventTarget, event) {
26307 BaseEvent.call(this, eventTarget, event);
26308 }
26309
26310 CustomEvent.prototype = Object.create(BaseEvent.prototype, {
26311 constructor: {
26312 value: CustomEvent,
26313 configurable: true,
26314 writable: true
26315 }
26316 }); // Define accessors.
26317
26318 for (var i = 0; i < keys.length; ++i) {
26319 var key = keys[i];
26320
26321 if (!(key in BaseEvent.prototype)) {
26322 var descriptor = (0, _getOwnPropertyDescriptor.default)(proto, key);
26323 var isFunc = typeof descriptor.value === "function";
26324 (0, _defineProperty.default)(CustomEvent.prototype, key, isFunc ? defineCallDescriptor(key) : defineRedirectDescriptor(key));
26325 }
26326 }
26327
26328 return CustomEvent;
26329}
26330/**
26331 * Get the wrapper class of a given prototype.
26332 * @param {Object} proto The prototype of the original event to get its wrapper.
26333 * @returns {Function} The wrapper class.
26334 * @private
26335 */
26336
26337
26338function getWrapper(proto) {
26339 if (proto == null || proto === Object.prototype) {
26340 return Event;
26341 }
26342
26343 var wrapper = wrappers.get(proto);
26344
26345 if (wrapper == null) {
26346 wrapper = defineWrapper(getWrapper((0, _getPrototypeOf.default)(proto)), proto);
26347 wrappers.set(proto, wrapper);
26348 }
26349
26350 return wrapper;
26351}
26352/**
26353 * Wrap a given event to management a dispatching.
26354 * @param {EventTarget} eventTarget The event target of this dispatching.
26355 * @param {Object} event The event to wrap.
26356 * @returns {Event} The wrapper instance.
26357 * @private
26358 */
26359
26360
26361function wrapEvent(eventTarget, event) {
26362 var Wrapper = getWrapper((0, _getPrototypeOf.default)(event));
26363 return new Wrapper(eventTarget, event);
26364}
26365/**
26366 * Get the immediateStopped flag of a given event.
26367 * @param {Event} event The event to get.
26368 * @returns {boolean} The flag to stop propagation immediately.
26369 * @private
26370 */
26371
26372
26373function isStopped(event) {
26374 return pd(event).immediateStopped;
26375}
26376/**
26377 * Set the current event phase of a given event.
26378 * @param {Event} event The event to set current target.
26379 * @param {number} eventPhase New event phase.
26380 * @returns {void}
26381 * @private
26382 */
26383
26384
26385function setEventPhase(event, eventPhase) {
26386 pd(event).eventPhase = eventPhase;
26387}
26388/**
26389 * Set the current target of a given event.
26390 * @param {Event} event The event to set current target.
26391 * @param {EventTarget|null} currentTarget New current target.
26392 * @returns {void}
26393 * @private
26394 */
26395
26396
26397function setCurrentTarget(event, currentTarget) {
26398 pd(event).currentTarget = currentTarget;
26399}
26400/**
26401 * Set a passive listener of a given event.
26402 * @param {Event} event The event to set current target.
26403 * @param {Function|null} passiveListener New passive listener.
26404 * @returns {void}
26405 * @private
26406 */
26407
26408
26409function setPassiveListener(event, passiveListener) {
26410 pd(event).passiveListener = passiveListener;
26411}
26412/**
26413 * @typedef {object} ListenerNode
26414 * @property {Function} listener
26415 * @property {1|2|3} listenerType
26416 * @property {boolean} passive
26417 * @property {boolean} once
26418 * @property {ListenerNode|null} next
26419 * @private
26420 */
26421
26422/**
26423 * @type {WeakMap<object, Map<string, ListenerNode>>}
26424 * @private
26425 */
26426
26427
26428var listenersMap = new _weakMap.default(); // Listener types
26429
26430var CAPTURE = 1;
26431var BUBBLE = 2;
26432var ATTRIBUTE = 3;
26433/**
26434 * Check whether a given value is an object or not.
26435 * @param {any} x The value to check.
26436 * @returns {boolean} `true` if the value is an object.
26437 */
26438
26439function isObject(x) {
26440 return x !== null && (0, _typeof2.default)(x) === "object"; //eslint-disable-line no-restricted-syntax
26441}
26442/**
26443 * Get listeners.
26444 * @param {EventTarget} eventTarget The event target to get.
26445 * @returns {Map<string, ListenerNode>} The listeners.
26446 * @private
26447 */
26448
26449
26450function getListeners(eventTarget) {
26451 var listeners = listenersMap.get(eventTarget);
26452
26453 if (listeners == null) {
26454 throw new TypeError("'this' is expected an EventTarget object, but got another value.");
26455 }
26456
26457 return listeners;
26458}
26459/**
26460 * Get the property descriptor for the event attribute of a given event.
26461 * @param {string} eventName The event name to get property descriptor.
26462 * @returns {PropertyDescriptor} The property descriptor.
26463 * @private
26464 */
26465
26466
26467function defineEventAttributeDescriptor(eventName) {
26468 return {
26469 get: function get() {
26470 var listeners = getListeners(this);
26471 var node = listeners.get(eventName);
26472
26473 while (node != null) {
26474 if (node.listenerType === ATTRIBUTE) {
26475 return node.listener;
26476 }
26477
26478 node = node.next;
26479 }
26480
26481 return null;
26482 },
26483 set: function set(listener) {
26484 if (typeof listener !== "function" && !isObject(listener)) {
26485 listener = null; // eslint-disable-line no-param-reassign
26486 }
26487
26488 var listeners = getListeners(this); // Traverse to the tail while removing old value.
26489
26490 var prev = null;
26491 var node = listeners.get(eventName);
26492
26493 while (node != null) {
26494 if (node.listenerType === ATTRIBUTE) {
26495 // Remove old value.
26496 if (prev !== null) {
26497 prev.next = node.next;
26498 } else if (node.next !== null) {
26499 listeners.set(eventName, node.next);
26500 } else {
26501 listeners.delete(eventName);
26502 }
26503 } else {
26504 prev = node;
26505 }
26506
26507 node = node.next;
26508 } // Add new value.
26509
26510
26511 if (listener !== null) {
26512 var newNode = {
26513 listener: listener,
26514 listenerType: ATTRIBUTE,
26515 passive: false,
26516 once: false,
26517 next: null
26518 };
26519
26520 if (prev === null) {
26521 listeners.set(eventName, newNode);
26522 } else {
26523 prev.next = newNode;
26524 }
26525 }
26526 },
26527 configurable: true,
26528 enumerable: true
26529 };
26530}
26531/**
26532 * Define an event attribute (e.g. `eventTarget.onclick`).
26533 * @param {Object} eventTargetPrototype The event target prototype to define an event attrbite.
26534 * @param {string} eventName The event name to define.
26535 * @returns {void}
26536 */
26537
26538
26539function defineEventAttribute(eventTargetPrototype, eventName) {
26540 (0, _defineProperty.default)(eventTargetPrototype, "on".concat(eventName), defineEventAttributeDescriptor(eventName));
26541}
26542/**
26543 * Define a custom EventTarget with event attributes.
26544 * @param {string[]} eventNames Event names for event attributes.
26545 * @returns {EventTarget} The custom EventTarget.
26546 * @private
26547 */
26548
26549
26550function defineCustomEventTarget(eventNames) {
26551 /** CustomEventTarget */
26552 function CustomEventTarget() {
26553 EventTarget.call(this);
26554 }
26555
26556 CustomEventTarget.prototype = Object.create(EventTarget.prototype, {
26557 constructor: {
26558 value: CustomEventTarget,
26559 configurable: true,
26560 writable: true
26561 }
26562 });
26563
26564 for (var i = 0; i < eventNames.length; ++i) {
26565 defineEventAttribute(CustomEventTarget.prototype, eventNames[i]);
26566 }
26567
26568 return CustomEventTarget;
26569}
26570/**
26571 * EventTarget.
26572 *
26573 * - This is constructor if no arguments.
26574 * - This is a function which returns a CustomEventTarget constructor if there are arguments.
26575 *
26576 * For example:
26577 *
26578 * class A extends EventTarget {}
26579 * class B extends EventTarget("message") {}
26580 * class C extends EventTarget("message", "error") {}
26581 * class D extends EventTarget(["message", "error"]) {}
26582 */
26583
26584
26585function EventTarget() {
26586 /*eslint-disable consistent-return */
26587 if (this instanceof EventTarget) {
26588 listenersMap.set(this, new _map.default());
26589 return;
26590 }
26591
26592 if (arguments.length === 1 && Array.isArray(arguments[0])) {
26593 return defineCustomEventTarget(arguments[0]);
26594 }
26595
26596 if (arguments.length > 0) {
26597 var types = new Array(arguments.length);
26598
26599 for (var i = 0; i < arguments.length; ++i) {
26600 types[i] = arguments[i];
26601 }
26602
26603 return defineCustomEventTarget(types);
26604 }
26605
26606 throw new TypeError("Cannot call a class as a function");
26607 /*eslint-enable consistent-return */
26608} // Should be enumerable, but class methods are not enumerable.
26609
26610
26611EventTarget.prototype = {
26612 /**
26613 * Add a given listener to this event target.
26614 * @param {string} eventName The event name to add.
26615 * @param {Function} listener The listener to add.
26616 * @param {boolean|{capture?:boolean,passive?:boolean,once?:boolean}} [options] The options for this listener.
26617 * @returns {void}
26618 */
26619 addEventListener: function addEventListener(eventName, listener, options) {
26620 if (listener == null) {
26621 return;
26622 }
26623
26624 if (typeof listener !== "function" && !isObject(listener)) {
26625 throw new TypeError("'listener' should be a function or an object.");
26626 }
26627
26628 var listeners = getListeners(this);
26629 var optionsIsObj = isObject(options);
26630 var capture = optionsIsObj ? Boolean(options.capture) : Boolean(options);
26631 var listenerType = capture ? CAPTURE : BUBBLE;
26632 var newNode = {
26633 listener: listener,
26634 listenerType: listenerType,
26635 passive: optionsIsObj && Boolean(options.passive),
26636 once: optionsIsObj && Boolean(options.once),
26637 next: null
26638 }; // Set it as the first node if the first node is null.
26639
26640 var node = listeners.get(eventName);
26641
26642 if (node === undefined) {
26643 listeners.set(eventName, newNode);
26644 return;
26645 } // Traverse to the tail while checking duplication..
26646
26647
26648 var prev = null;
26649
26650 while (node != null) {
26651 if (node.listener === listener && node.listenerType === listenerType) {
26652 // Should ignore duplication.
26653 return;
26654 }
26655
26656 prev = node;
26657 node = node.next;
26658 } // Add it.
26659
26660
26661 prev.next = newNode;
26662 },
26663
26664 /**
26665 * Remove a given listener from this event target.
26666 * @param {string} eventName The event name to remove.
26667 * @param {Function} listener The listener to remove.
26668 * @param {boolean|{capture?:boolean,passive?:boolean,once?:boolean}} [options] The options for this listener.
26669 * @returns {void}
26670 */
26671 removeEventListener: function removeEventListener(eventName, listener, options) {
26672 if (listener == null) {
26673 return;
26674 }
26675
26676 var listeners = getListeners(this);
26677 var capture = isObject(options) ? Boolean(options.capture) : Boolean(options);
26678 var listenerType = capture ? CAPTURE : BUBBLE;
26679 var prev = null;
26680 var node = listeners.get(eventName);
26681
26682 while (node != null) {
26683 if (node.listener === listener && node.listenerType === listenerType) {
26684 if (prev !== null) {
26685 prev.next = node.next;
26686 } else if (node.next !== null) {
26687 listeners.set(eventName, node.next);
26688 } else {
26689 listeners.delete(eventName);
26690 }
26691
26692 return;
26693 }
26694
26695 prev = node;
26696 node = node.next;
26697 }
26698 },
26699
26700 /**
26701 * Dispatch a given event.
26702 * @param {Event|{type:string}} event The event to dispatch.
26703 * @returns {boolean} `false` if canceled.
26704 */
26705 dispatchEvent: function dispatchEvent(event) {
26706 if (event == null || typeof event.type !== "string") {
26707 throw new TypeError('"event.type" should be a string.');
26708 } // If listeners aren't registered, terminate.
26709
26710
26711 var listeners = getListeners(this);
26712 var eventName = event.type;
26713 var node = listeners.get(eventName);
26714
26715 if (node == null) {
26716 return true;
26717 } // Since we cannot rewrite several properties, so wrap object.
26718
26719
26720 var wrappedEvent = wrapEvent(this, event); // This doesn't process capturing phase and bubbling phase.
26721 // This isn't participating in a tree.
26722
26723 var prev = null;
26724
26725 while (node != null) {
26726 // Remove this listener if it's once
26727 if (node.once) {
26728 if (prev !== null) {
26729 prev.next = node.next;
26730 } else if (node.next !== null) {
26731 listeners.set(eventName, node.next);
26732 } else {
26733 listeners.delete(eventName);
26734 }
26735 } else {
26736 prev = node;
26737 } // Call this listener
26738
26739
26740 setPassiveListener(wrappedEvent, node.passive ? node.listener : null);
26741
26742 if (typeof node.listener === "function") {
26743 try {
26744 node.listener.call(this, wrappedEvent);
26745 } catch (err) {
26746 if (typeof console !== "undefined" && typeof console.error === "function") {
26747 console.error(err);
26748 }
26749 }
26750 } else if (node.listenerType !== ATTRIBUTE && typeof node.listener.handleEvent === "function") {
26751 node.listener.handleEvent(wrappedEvent);
26752 } // Break if `event.stopImmediatePropagation` was called.
26753
26754
26755 if (isStopped(wrappedEvent)) {
26756 break;
26757 }
26758
26759 node = node.next;
26760 }
26761
26762 setPassiveListener(wrappedEvent, null);
26763 setEventPhase(wrappedEvent, 0);
26764 setCurrentTarget(wrappedEvent, null);
26765 return !wrappedEvent.defaultPrevented;
26766 }
26767}; // `constructor` is not enumerable.
26768
26769(0, _defineProperty.default)(EventTarget.prototype, "constructor", {
26770 value: EventTarget,
26771 configurable: true,
26772 writable: true
26773}); // Ensure `eventTarget instanceof window.EventTarget` is `true`.
26774
26775if (typeof window !== "undefined" && typeof window.EventTarget !== "undefined") {
26776 (0, _setPrototypeOf.default)(EventTarget.prototype, window.EventTarget.prototype);
26777}
26778
26779var WS =
26780/** @class */
26781function (_super) {
26782 __extends$1(WS, _super);
26783
26784 function WS(url, protocol) {
26785 var _this = _super.call(this) || this;
26786
26787 _this._readyState = WS.CLOSED;
26788
26789 if (!url) {
26790 throw new TypeError("Failed to construct 'WebSocket': url required");
26791 }
26792
26793 _this._url = url;
26794 _this._protocol = protocol;
26795 return _this;
26796 }
26797
26798 (0, _defineProperty.default)(WS.prototype, "url", {
26799 get: function get() {
26800 return this._url;
26801 },
26802 enumerable: false,
26803 configurable: true
26804 });
26805 (0, _defineProperty.default)(WS.prototype, "protocol", {
26806 get: function get() {
26807 return this._protocol;
26808 },
26809 enumerable: false,
26810 configurable: true
26811 });
26812 (0, _defineProperty.default)(WS.prototype, "readyState", {
26813 get: function get() {
26814 return this._readyState;
26815 },
26816 enumerable: false,
26817 configurable: true
26818 });
26819 WS.CONNECTING = 0;
26820 WS.OPEN = 1;
26821 WS.CLOSING = 2;
26822 WS.CLOSED = 3;
26823 return WS;
26824}(EventTarget("open", "error", "message", "close"));
26825
26826var WechatWS =
26827/** @class */
26828function (_super) {
26829 __extends$1(WechatWS, _super);
26830
26831 function WechatWS(url, protocol) {
26832 var _this = _super.call(this, url, protocol) || this;
26833
26834 if (protocol && !(wx.canIUse && wx.canIUse("connectSocket.object.protocols"))) {
26835 throw new Error("subprotocol not supported in weapp");
26836 }
26837
26838 _this._readyState = WS.CONNECTING;
26839
26840 var errorHandler = function errorHandler(event) {
26841 _this._readyState = WS.CLOSED;
26842
26843 _this.dispatchEvent({
26844 type: "error",
26845 message: event.errMsg
26846 });
26847 };
26848
26849 var socketTask = wx.connectSocket({
26850 url: url,
26851 protocols: _this._protocol === undefined || Array.isArray(_this._protocol) ? _this._protocol : [_this._protocol],
26852 fail: function fail(error) {
26853 return setTimeout(function () {
26854 return errorHandler(error);
26855 }, 0);
26856 }
26857 });
26858 _this._socketTask = socketTask;
26859 socketTask.onOpen(function () {
26860 _this._readyState = WS.OPEN;
26861
26862 _this.dispatchEvent({
26863 type: "open"
26864 });
26865 });
26866 socketTask.onError(errorHandler);
26867 socketTask.onMessage(function (event) {
26868 var data = event.data;
26869
26870 _this.dispatchEvent({
26871 data: data,
26872 type: "message"
26873 });
26874 });
26875 socketTask.onClose(function (event) {
26876 _this._readyState = WS.CLOSED;
26877 var code = event.code,
26878 reason = event.reason;
26879
26880 _this.dispatchEvent({
26881 code: code,
26882 reason: reason,
26883 type: "close"
26884 });
26885 });
26886 return _this;
26887 }
26888
26889 WechatWS.prototype.close = function () {
26890 if (this.readyState === WS.CLOSED) return;
26891
26892 if (this.readyState === WS.CONNECTING) {
26893 console.warn("close WebSocket which is connecting might not work");
26894 }
26895
26896 this._socketTask.close({});
26897 };
26898
26899 WechatWS.prototype.send = function (data) {
26900 if (this.readyState !== WS.OPEN) {
26901 throw new Error("INVALID_STATE_ERR");
26902 }
26903
26904 if (!(typeof data === "string" || data instanceof ArrayBuffer)) {
26905 throw new TypeError("only String/ArrayBuffer supported");
26906 }
26907
26908 this._socketTask.send({
26909 data: data
26910 });
26911 };
26912
26913 return WechatWS;
26914}(WS);
26915
26916var WebSocket = WechatWS;
26917var platformInfo = {
26918 name: "Weapp"
26919};
26920exports.WebSocket = WebSocket;
26921exports.getAuthInfo = getAuthInfo;
26922exports.platformInfo = platformInfo;
26923exports.request = request;
26924exports.storage = storage;
26925exports.upload = upload;
26926
26927/***/ }),
26928/* 547 */
26929/***/ (function(module, exports, __webpack_require__) {
26930
26931module.exports = __webpack_require__(548);
26932
26933/***/ }),
26934/* 548 */
26935/***/ (function(module, exports, __webpack_require__) {
26936
26937var parent = __webpack_require__(549);
26938
26939module.exports = parent;
26940
26941
26942/***/ }),
26943/* 549 */
26944/***/ (function(module, exports, __webpack_require__) {
26945
26946__webpack_require__(550);
26947var path = __webpack_require__(10);
26948
26949module.exports = path.Object.assign;
26950
26951
26952/***/ }),
26953/* 550 */
26954/***/ (function(module, exports, __webpack_require__) {
26955
26956var $ = __webpack_require__(0);
26957var assign = __webpack_require__(551);
26958
26959// `Object.assign` method
26960// https://tc39.es/ecma262/#sec-object.assign
26961// eslint-disable-next-line es-x/no-object-assign -- required for testing
26962$({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== assign }, {
26963 assign: assign
26964});
26965
26966
26967/***/ }),
26968/* 551 */
26969/***/ (function(module, exports, __webpack_require__) {
26970
26971"use strict";
26972
26973var DESCRIPTORS = __webpack_require__(16);
26974var uncurryThis = __webpack_require__(4);
26975var call = __webpack_require__(13);
26976var fails = __webpack_require__(3);
26977var objectKeys = __webpack_require__(98);
26978var getOwnPropertySymbolsModule = __webpack_require__(97);
26979var propertyIsEnumerableModule = __webpack_require__(113);
26980var toObject = __webpack_require__(34);
26981var IndexedObject = __webpack_require__(114);
26982
26983// eslint-disable-next-line es-x/no-object-assign -- safe
26984var $assign = Object.assign;
26985// eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
26986var defineProperty = Object.defineProperty;
26987var concat = uncurryThis([].concat);
26988
26989// `Object.assign` method
26990// https://tc39.es/ecma262/#sec-object.assign
26991module.exports = !$assign || fails(function () {
26992 // should have correct order of operations (Edge bug)
26993 if (DESCRIPTORS && $assign({ b: 1 }, $assign(defineProperty({}, 'a', {
26994 enumerable: true,
26995 get: function () {
26996 defineProperty(this, 'b', {
26997 value: 3,
26998 enumerable: false
26999 });
27000 }
27001 }), { b: 2 })).b !== 1) return true;
27002 // should work with symbols and should have deterministic property order (V8 bug)
27003 var A = {};
27004 var B = {};
27005 // eslint-disable-next-line es-x/no-symbol -- safe
27006 var symbol = Symbol();
27007 var alphabet = 'abcdefghijklmnopqrst';
27008 A[symbol] = 7;
27009 alphabet.split('').forEach(function (chr) { B[chr] = chr; });
27010 return $assign({}, A)[symbol] != 7 || objectKeys($assign({}, B)).join('') != alphabet;
27011}) ? function assign(target, source) { // eslint-disable-line no-unused-vars -- required for `.length`
27012 var T = toObject(target);
27013 var argumentsLength = arguments.length;
27014 var index = 1;
27015 var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
27016 var propertyIsEnumerable = propertyIsEnumerableModule.f;
27017 while (argumentsLength > index) {
27018 var S = IndexedObject(arguments[index++]);
27019 var keys = getOwnPropertySymbols ? concat(objectKeys(S), getOwnPropertySymbols(S)) : objectKeys(S);
27020 var length = keys.length;
27021 var j = 0;
27022 var key;
27023 while (length > j) {
27024 key = keys[j++];
27025 if (!DESCRIPTORS || call(propertyIsEnumerable, S, key)) T[key] = S[key];
27026 }
27027 } return T;
27028} : $assign;
27029
27030
27031/***/ }),
27032/* 552 */
27033/***/ (function(module, exports, __webpack_require__) {
27034
27035module.exports = __webpack_require__(553);
27036
27037/***/ }),
27038/* 553 */
27039/***/ (function(module, exports, __webpack_require__) {
27040
27041var parent = __webpack_require__(554);
27042
27043module.exports = parent;
27044
27045
27046/***/ }),
27047/* 554 */
27048/***/ (function(module, exports, __webpack_require__) {
27049
27050__webpack_require__(233);
27051var path = __webpack_require__(10);
27052
27053module.exports = path.Object.getOwnPropertySymbols;
27054
27055
27056/***/ }),
27057/* 555 */
27058/***/ (function(module, exports, __webpack_require__) {
27059
27060module.exports = __webpack_require__(238);
27061
27062/***/ }),
27063/* 556 */
27064/***/ (function(module, exports, __webpack_require__) {
27065
27066module.exports = __webpack_require__(557);
27067
27068/***/ }),
27069/* 557 */
27070/***/ (function(module, exports, __webpack_require__) {
27071
27072var parent = __webpack_require__(558);
27073__webpack_require__(51);
27074
27075module.exports = parent;
27076
27077
27078/***/ }),
27079/* 558 */
27080/***/ (function(module, exports, __webpack_require__) {
27081
27082__webpack_require__(48);
27083__webpack_require__(60);
27084__webpack_require__(559);
27085var path = __webpack_require__(10);
27086
27087module.exports = path.WeakMap;
27088
27089
27090/***/ }),
27091/* 559 */
27092/***/ (function(module, exports, __webpack_require__) {
27093
27094// TODO: Remove this module from `core-js@4` since it's replaced to module below
27095__webpack_require__(560);
27096
27097
27098/***/ }),
27099/* 560 */
27100/***/ (function(module, exports, __webpack_require__) {
27101
27102"use strict";
27103
27104var global = __webpack_require__(6);
27105var uncurryThis = __webpack_require__(4);
27106var defineBuiltIns = __webpack_require__(146);
27107var InternalMetadataModule = __webpack_require__(111);
27108var collection = __webpack_require__(248);
27109var collectionWeak = __webpack_require__(563);
27110var isObject = __webpack_require__(11);
27111var isExtensible = __webpack_require__(247);
27112var enforceInternalState = __webpack_require__(38).enforce;
27113var NATIVE_WEAK_MAP = __webpack_require__(160);
27114
27115var IS_IE11 = !global.ActiveXObject && 'ActiveXObject' in global;
27116var InternalWeakMap;
27117
27118var wrapper = function (init) {
27119 return function WeakMap() {
27120 return init(this, arguments.length ? arguments[0] : undefined);
27121 };
27122};
27123
27124// `WeakMap` constructor
27125// https://tc39.es/ecma262/#sec-weakmap-constructor
27126var $WeakMap = collection('WeakMap', wrapper, collectionWeak);
27127
27128// IE11 WeakMap frozen keys fix
27129// We can't use feature detection because it crash some old IE builds
27130// https://github.com/zloirock/core-js/issues/485
27131if (NATIVE_WEAK_MAP && IS_IE11) {
27132 InternalWeakMap = collectionWeak.getConstructor(wrapper, 'WeakMap', true);
27133 InternalMetadataModule.enable();
27134 var WeakMapPrototype = $WeakMap.prototype;
27135 var nativeDelete = uncurryThis(WeakMapPrototype['delete']);
27136 var nativeHas = uncurryThis(WeakMapPrototype.has);
27137 var nativeGet = uncurryThis(WeakMapPrototype.get);
27138 var nativeSet = uncurryThis(WeakMapPrototype.set);
27139 defineBuiltIns(WeakMapPrototype, {
27140 'delete': function (key) {
27141 if (isObject(key) && !isExtensible(key)) {
27142 var state = enforceInternalState(this);
27143 if (!state.frozen) state.frozen = new InternalWeakMap();
27144 return nativeDelete(this, key) || state.frozen['delete'](key);
27145 } return nativeDelete(this, key);
27146 },
27147 has: function has(key) {
27148 if (isObject(key) && !isExtensible(key)) {
27149 var state = enforceInternalState(this);
27150 if (!state.frozen) state.frozen = new InternalWeakMap();
27151 return nativeHas(this, key) || state.frozen.has(key);
27152 } return nativeHas(this, key);
27153 },
27154 get: function get(key) {
27155 if (isObject(key) && !isExtensible(key)) {
27156 var state = enforceInternalState(this);
27157 if (!state.frozen) state.frozen = new InternalWeakMap();
27158 return nativeHas(this, key) ? nativeGet(this, key) : state.frozen.get(key);
27159 } return nativeGet(this, key);
27160 },
27161 set: function set(key, value) {
27162 if (isObject(key) && !isExtensible(key)) {
27163 var state = enforceInternalState(this);
27164 if (!state.frozen) state.frozen = new InternalWeakMap();
27165 nativeHas(this, key) ? nativeSet(this, key, value) : state.frozen.set(key, value);
27166 } else nativeSet(this, key, value);
27167 return this;
27168 }
27169 });
27170}
27171
27172
27173/***/ }),
27174/* 561 */
27175/***/ (function(module, exports, __webpack_require__) {
27176
27177// FF26- bug: ArrayBuffers are non-extensible, but Object.isExtensible does not report it
27178var fails = __webpack_require__(3);
27179
27180module.exports = fails(function () {
27181 if (typeof ArrayBuffer == 'function') {
27182 var buffer = new ArrayBuffer(8);
27183 // eslint-disable-next-line es-x/no-object-isextensible, es-x/no-object-defineproperty -- safe
27184 if (Object.isExtensible(buffer)) Object.defineProperty(buffer, 'a', { value: 8 });
27185 }
27186});
27187
27188
27189/***/ }),
27190/* 562 */
27191/***/ (function(module, exports, __webpack_require__) {
27192
27193var fails = __webpack_require__(3);
27194
27195module.exports = !fails(function () {
27196 // eslint-disable-next-line es-x/no-object-isextensible, es-x/no-object-preventextensions -- required for testing
27197 return Object.isExtensible(Object.preventExtensions({}));
27198});
27199
27200
27201/***/ }),
27202/* 563 */
27203/***/ (function(module, exports, __webpack_require__) {
27204
27205"use strict";
27206
27207var uncurryThis = __webpack_require__(4);
27208var defineBuiltIns = __webpack_require__(146);
27209var getWeakData = __webpack_require__(111).getWeakData;
27210var anObject = __webpack_require__(19);
27211var isObject = __webpack_require__(11);
27212var anInstance = __webpack_require__(100);
27213var iterate = __webpack_require__(37);
27214var ArrayIterationModule = __webpack_require__(66);
27215var hasOwn = __webpack_require__(14);
27216var InternalStateModule = __webpack_require__(38);
27217
27218var setInternalState = InternalStateModule.set;
27219var internalStateGetterFor = InternalStateModule.getterFor;
27220var find = ArrayIterationModule.find;
27221var findIndex = ArrayIterationModule.findIndex;
27222var splice = uncurryThis([].splice);
27223var id = 0;
27224
27225// fallback for uncaught frozen keys
27226var uncaughtFrozenStore = function (store) {
27227 return store.frozen || (store.frozen = new UncaughtFrozenStore());
27228};
27229
27230var UncaughtFrozenStore = function () {
27231 this.entries = [];
27232};
27233
27234var findUncaughtFrozen = function (store, key) {
27235 return find(store.entries, function (it) {
27236 return it[0] === key;
27237 });
27238};
27239
27240UncaughtFrozenStore.prototype = {
27241 get: function (key) {
27242 var entry = findUncaughtFrozen(this, key);
27243 if (entry) return entry[1];
27244 },
27245 has: function (key) {
27246 return !!findUncaughtFrozen(this, key);
27247 },
27248 set: function (key, value) {
27249 var entry = findUncaughtFrozen(this, key);
27250 if (entry) entry[1] = value;
27251 else this.entries.push([key, value]);
27252 },
27253 'delete': function (key) {
27254 var index = findIndex(this.entries, function (it) {
27255 return it[0] === key;
27256 });
27257 if (~index) splice(this.entries, index, 1);
27258 return !!~index;
27259 }
27260};
27261
27262module.exports = {
27263 getConstructor: function (wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER) {
27264 var Constructor = wrapper(function (that, iterable) {
27265 anInstance(that, Prototype);
27266 setInternalState(that, {
27267 type: CONSTRUCTOR_NAME,
27268 id: id++,
27269 frozen: undefined
27270 });
27271 if (iterable != undefined) iterate(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP });
27272 });
27273
27274 var Prototype = Constructor.prototype;
27275
27276 var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME);
27277
27278 var define = function (that, key, value) {
27279 var state = getInternalState(that);
27280 var data = getWeakData(anObject(key), true);
27281 if (data === true) uncaughtFrozenStore(state).set(key, value);
27282 else data[state.id] = value;
27283 return that;
27284 };
27285
27286 defineBuiltIns(Prototype, {
27287 // `{ WeakMap, WeakSet }.prototype.delete(key)` methods
27288 // https://tc39.es/ecma262/#sec-weakmap.prototype.delete
27289 // https://tc39.es/ecma262/#sec-weakset.prototype.delete
27290 'delete': function (key) {
27291 var state = getInternalState(this);
27292 if (!isObject(key)) return false;
27293 var data = getWeakData(key);
27294 if (data === true) return uncaughtFrozenStore(state)['delete'](key);
27295 return data && hasOwn(data, state.id) && delete data[state.id];
27296 },
27297 // `{ WeakMap, WeakSet }.prototype.has(key)` methods
27298 // https://tc39.es/ecma262/#sec-weakmap.prototype.has
27299 // https://tc39.es/ecma262/#sec-weakset.prototype.has
27300 has: function has(key) {
27301 var state = getInternalState(this);
27302 if (!isObject(key)) return false;
27303 var data = getWeakData(key);
27304 if (data === true) return uncaughtFrozenStore(state).has(key);
27305 return data && hasOwn(data, state.id);
27306 }
27307 });
27308
27309 defineBuiltIns(Prototype, IS_MAP ? {
27310 // `WeakMap.prototype.get(key)` method
27311 // https://tc39.es/ecma262/#sec-weakmap.prototype.get
27312 get: function get(key) {
27313 var state = getInternalState(this);
27314 if (isObject(key)) {
27315 var data = getWeakData(key);
27316 if (data === true) return uncaughtFrozenStore(state).get(key);
27317 return data ? data[state.id] : undefined;
27318 }
27319 },
27320 // `WeakMap.prototype.set(key, value)` method
27321 // https://tc39.es/ecma262/#sec-weakmap.prototype.set
27322 set: function set(key, value) {
27323 return define(this, key, value);
27324 }
27325 } : {
27326 // `WeakSet.prototype.add(value)` method
27327 // https://tc39.es/ecma262/#sec-weakset.prototype.add
27328 add: function add(value) {
27329 return define(this, value, true);
27330 }
27331 });
27332
27333 return Constructor;
27334 }
27335};
27336
27337
27338/***/ }),
27339/* 564 */
27340/***/ (function(module, exports, __webpack_require__) {
27341
27342module.exports = __webpack_require__(565);
27343
27344/***/ }),
27345/* 565 */
27346/***/ (function(module, exports, __webpack_require__) {
27347
27348var parent = __webpack_require__(566);
27349__webpack_require__(51);
27350
27351module.exports = parent;
27352
27353
27354/***/ }),
27355/* 566 */
27356/***/ (function(module, exports, __webpack_require__) {
27357
27358__webpack_require__(48);
27359__webpack_require__(567);
27360__webpack_require__(60);
27361__webpack_require__(78);
27362var path = __webpack_require__(10);
27363
27364module.exports = path.Map;
27365
27366
27367/***/ }),
27368/* 567 */
27369/***/ (function(module, exports, __webpack_require__) {
27370
27371// TODO: Remove this module from `core-js@4` since it's replaced to module below
27372__webpack_require__(568);
27373
27374
27375/***/ }),
27376/* 568 */
27377/***/ (function(module, exports, __webpack_require__) {
27378
27379"use strict";
27380
27381var collection = __webpack_require__(248);
27382var collectionStrong = __webpack_require__(569);
27383
27384// `Map` constructor
27385// https://tc39.es/ecma262/#sec-map-objects
27386collection('Map', function (init) {
27387 return function Map() { return init(this, arguments.length ? arguments[0] : undefined); };
27388}, collectionStrong);
27389
27390
27391/***/ }),
27392/* 569 */
27393/***/ (function(module, exports, __webpack_require__) {
27394
27395"use strict";
27396
27397var defineProperty = __webpack_require__(22).f;
27398var create = __webpack_require__(47);
27399var defineBuiltIns = __webpack_require__(146);
27400var bind = __webpack_require__(45);
27401var anInstance = __webpack_require__(100);
27402var iterate = __webpack_require__(37);
27403var defineIterator = __webpack_require__(124);
27404var setSpecies = __webpack_require__(162);
27405var DESCRIPTORS = __webpack_require__(16);
27406var fastKey = __webpack_require__(111).fastKey;
27407var InternalStateModule = __webpack_require__(38);
27408
27409var setInternalState = InternalStateModule.set;
27410var internalStateGetterFor = InternalStateModule.getterFor;
27411
27412module.exports = {
27413 getConstructor: function (wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER) {
27414 var Constructor = wrapper(function (that, iterable) {
27415 anInstance(that, Prototype);
27416 setInternalState(that, {
27417 type: CONSTRUCTOR_NAME,
27418 index: create(null),
27419 first: undefined,
27420 last: undefined,
27421 size: 0
27422 });
27423 if (!DESCRIPTORS) that.size = 0;
27424 if (iterable != undefined) iterate(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP });
27425 });
27426
27427 var Prototype = Constructor.prototype;
27428
27429 var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME);
27430
27431 var define = function (that, key, value) {
27432 var state = getInternalState(that);
27433 var entry = getEntry(that, key);
27434 var previous, index;
27435 // change existing entry
27436 if (entry) {
27437 entry.value = value;
27438 // create new entry
27439 } else {
27440 state.last = entry = {
27441 index: index = fastKey(key, true),
27442 key: key,
27443 value: value,
27444 previous: previous = state.last,
27445 next: undefined,
27446 removed: false
27447 };
27448 if (!state.first) state.first = entry;
27449 if (previous) previous.next = entry;
27450 if (DESCRIPTORS) state.size++;
27451 else that.size++;
27452 // add to index
27453 if (index !== 'F') state.index[index] = entry;
27454 } return that;
27455 };
27456
27457 var getEntry = function (that, key) {
27458 var state = getInternalState(that);
27459 // fast case
27460 var index = fastKey(key);
27461 var entry;
27462 if (index !== 'F') return state.index[index];
27463 // frozen object case
27464 for (entry = state.first; entry; entry = entry.next) {
27465 if (entry.key == key) return entry;
27466 }
27467 };
27468
27469 defineBuiltIns(Prototype, {
27470 // `{ Map, Set }.prototype.clear()` methods
27471 // https://tc39.es/ecma262/#sec-map.prototype.clear
27472 // https://tc39.es/ecma262/#sec-set.prototype.clear
27473 clear: function clear() {
27474 var that = this;
27475 var state = getInternalState(that);
27476 var data = state.index;
27477 var entry = state.first;
27478 while (entry) {
27479 entry.removed = true;
27480 if (entry.previous) entry.previous = entry.previous.next = undefined;
27481 delete data[entry.index];
27482 entry = entry.next;
27483 }
27484 state.first = state.last = undefined;
27485 if (DESCRIPTORS) state.size = 0;
27486 else that.size = 0;
27487 },
27488 // `{ Map, Set }.prototype.delete(key)` methods
27489 // https://tc39.es/ecma262/#sec-map.prototype.delete
27490 // https://tc39.es/ecma262/#sec-set.prototype.delete
27491 'delete': function (key) {
27492 var that = this;
27493 var state = getInternalState(that);
27494 var entry = getEntry(that, key);
27495 if (entry) {
27496 var next = entry.next;
27497 var prev = entry.previous;
27498 delete state.index[entry.index];
27499 entry.removed = true;
27500 if (prev) prev.next = next;
27501 if (next) next.previous = prev;
27502 if (state.first == entry) state.first = next;
27503 if (state.last == entry) state.last = prev;
27504 if (DESCRIPTORS) state.size--;
27505 else that.size--;
27506 } return !!entry;
27507 },
27508 // `{ Map, Set }.prototype.forEach(callbackfn, thisArg = undefined)` methods
27509 // https://tc39.es/ecma262/#sec-map.prototype.foreach
27510 // https://tc39.es/ecma262/#sec-set.prototype.foreach
27511 forEach: function forEach(callbackfn /* , that = undefined */) {
27512 var state = getInternalState(this);
27513 var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined);
27514 var entry;
27515 while (entry = entry ? entry.next : state.first) {
27516 boundFunction(entry.value, entry.key, this);
27517 // revert to the last existing entry
27518 while (entry && entry.removed) entry = entry.previous;
27519 }
27520 },
27521 // `{ Map, Set}.prototype.has(key)` methods
27522 // https://tc39.es/ecma262/#sec-map.prototype.has
27523 // https://tc39.es/ecma262/#sec-set.prototype.has
27524 has: function has(key) {
27525 return !!getEntry(this, key);
27526 }
27527 });
27528
27529 defineBuiltIns(Prototype, IS_MAP ? {
27530 // `Map.prototype.get(key)` method
27531 // https://tc39.es/ecma262/#sec-map.prototype.get
27532 get: function get(key) {
27533 var entry = getEntry(this, key);
27534 return entry && entry.value;
27535 },
27536 // `Map.prototype.set(key, value)` method
27537 // https://tc39.es/ecma262/#sec-map.prototype.set
27538 set: function set(key, value) {
27539 return define(this, key === 0 ? 0 : key, value);
27540 }
27541 } : {
27542 // `Set.prototype.add(value)` method
27543 // https://tc39.es/ecma262/#sec-set.prototype.add
27544 add: function add(value) {
27545 return define(this, value = value === 0 ? 0 : value, value);
27546 }
27547 });
27548 if (DESCRIPTORS) defineProperty(Prototype, 'size', {
27549 get: function () {
27550 return getInternalState(this).size;
27551 }
27552 });
27553 return Constructor;
27554 },
27555 setStrong: function (Constructor, CONSTRUCTOR_NAME, IS_MAP) {
27556 var ITERATOR_NAME = CONSTRUCTOR_NAME + ' Iterator';
27557 var getInternalCollectionState = internalStateGetterFor(CONSTRUCTOR_NAME);
27558 var getInternalIteratorState = internalStateGetterFor(ITERATOR_NAME);
27559 // `{ Map, Set }.prototype.{ keys, values, entries, @@iterator }()` methods
27560 // https://tc39.es/ecma262/#sec-map.prototype.entries
27561 // https://tc39.es/ecma262/#sec-map.prototype.keys
27562 // https://tc39.es/ecma262/#sec-map.prototype.values
27563 // https://tc39.es/ecma262/#sec-map.prototype-@@iterator
27564 // https://tc39.es/ecma262/#sec-set.prototype.entries
27565 // https://tc39.es/ecma262/#sec-set.prototype.keys
27566 // https://tc39.es/ecma262/#sec-set.prototype.values
27567 // https://tc39.es/ecma262/#sec-set.prototype-@@iterator
27568 defineIterator(Constructor, CONSTRUCTOR_NAME, function (iterated, kind) {
27569 setInternalState(this, {
27570 type: ITERATOR_NAME,
27571 target: iterated,
27572 state: getInternalCollectionState(iterated),
27573 kind: kind,
27574 last: undefined
27575 });
27576 }, function () {
27577 var state = getInternalIteratorState(this);
27578 var kind = state.kind;
27579 var entry = state.last;
27580 // revert to the last existing entry
27581 while (entry && entry.removed) entry = entry.previous;
27582 // get next entry
27583 if (!state.target || !(state.last = entry = entry ? entry.next : state.state.first)) {
27584 // or finish the iteration
27585 state.target = undefined;
27586 return { value: undefined, done: true };
27587 }
27588 // return step by kind
27589 if (kind == 'keys') return { value: entry.key, done: false };
27590 if (kind == 'values') return { value: entry.value, done: false };
27591 return { value: [entry.key, entry.value], done: false };
27592 }, IS_MAP ? 'entries' : 'values', !IS_MAP, true);
27593
27594 // `{ Map, Set }.prototype[@@species]` accessors
27595 // https://tc39.es/ecma262/#sec-get-map-@@species
27596 // https://tc39.es/ecma262/#sec-get-set-@@species
27597 setSpecies(CONSTRUCTOR_NAME);
27598 }
27599};
27600
27601
27602/***/ })
27603/******/ ]);
27604});
27605//# sourceMappingURL=av-weapp.js.map
\No newline at end of file