UNPKG

113 kBJavaScriptView Raw
1(function (global, factory) {
2 typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
3 typeof define === 'function' && define.amd ? define(factory) :
4 (global = global || self, global.rich = factory());
5}(this, function () { 'use strict';
6
7 var fails = function (exec) {
8 try {
9 return !!exec();
10 } catch (error) {
11 return true;
12 }
13 };
14
15 var toString = {}.toString;
16
17 var classofRaw = function (it) {
18 return toString.call(it).slice(8, -1);
19 };
20
21 // fallback for non-array-like ES3 and non-enumerable old V8 strings
22
23
24 var split = ''.split;
25
26 var indexedObject = fails(function () {
27 // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
28 // eslint-disable-next-line no-prototype-builtins
29 return !Object('z').propertyIsEnumerable(0);
30 }) ? function (it) {
31 return classofRaw(it) == 'String' ? split.call(it, '') : Object(it);
32 } : Object;
33
34 // `RequireObjectCoercible` abstract operation
35 // https://tc39.github.io/ecma262/#sec-requireobjectcoercible
36 var requireObjectCoercible = function (it) {
37 if (it == undefined) throw TypeError("Can't call method on " + it);
38 return it;
39 };
40
41 // toObject with fallback for non-array-like ES3 strings
42
43
44
45 var toIndexedObject = function (it) {
46 return indexedObject(requireObjectCoercible(it));
47 };
48
49 var ceil = Math.ceil;
50 var floor = Math.floor;
51
52 // `ToInteger` abstract operation
53 // https://tc39.github.io/ecma262/#sec-tointeger
54 var toInteger = function (argument) {
55 return isNaN(argument = +argument) ? 0 : (argument > 0 ? floor : ceil)(argument);
56 };
57
58 var min = Math.min;
59
60 // `ToLength` abstract operation
61 // https://tc39.github.io/ecma262/#sec-tolength
62 var toLength = function (argument) {
63 return argument > 0 ? min(toInteger(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
64 };
65
66 var max = Math.max;
67 var min$1 = Math.min;
68
69 // Helper for a popular repeating case of the spec:
70 // Let integer be ? ToInteger(index).
71 // If integer < 0, let result be max((length + integer), 0); else let result be min(length, length).
72 var toAbsoluteIndex = function (index, length) {
73 var integer = toInteger(index);
74 return integer < 0 ? max(integer + length, 0) : min$1(integer, length);
75 };
76
77 // `Array.prototype.{ indexOf, includes }` methods implementation
78 // false -> Array#indexOf
79 // https://tc39.github.io/ecma262/#sec-array.prototype.indexof
80 // true -> Array#includes
81 // https://tc39.github.io/ecma262/#sec-array.prototype.includes
82 var arrayIncludes = function (IS_INCLUDES) {
83 return function ($this, el, fromIndex) {
84 var O = toIndexedObject($this);
85 var length = toLength(O.length);
86 var index = toAbsoluteIndex(fromIndex, length);
87 var value;
88 // Array#includes uses SameValueZero equality algorithm
89 // eslint-disable-next-line no-self-compare
90 if (IS_INCLUDES && el != el) while (length > index) {
91 value = O[index++];
92 // eslint-disable-next-line no-self-compare
93 if (value != value) return true;
94 // Array#indexOf ignores holes, Array#includes - not
95 } else for (;length > index; index++) if (IS_INCLUDES || index in O) {
96 if (O[index] === el) return IS_INCLUDES || index || 0;
97 } return !IS_INCLUDES && -1;
98 };
99 };
100
101 // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
102 var global = typeof window == 'object' && window && window.Math == Math ? window
103 : typeof self == 'object' && self && self.Math == Math ? self
104 // eslint-disable-next-line no-new-func
105 : Function('return this')();
106
107 // Thank's IE8 for his funny defineProperty
108 var descriptors = !fails(function () {
109 return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;
110 });
111
112 var nativePropertyIsEnumerable = {}.propertyIsEnumerable;
113 var nativeGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
114
115 // Nashorn ~ JDK8 bug
116 var NASHORN_BUG = nativeGetOwnPropertyDescriptor && !nativePropertyIsEnumerable.call({ 1: 2 }, 1);
117
118 var f = NASHORN_BUG ? function propertyIsEnumerable(V) {
119 var descriptor = nativeGetOwnPropertyDescriptor(this, V);
120 return !!descriptor && descriptor.enumerable;
121 } : nativePropertyIsEnumerable;
122
123 var objectPropertyIsEnumerable = {
124 f: f
125 };
126
127 var createPropertyDescriptor = function (bitmap, value) {
128 return {
129 enumerable: !(bitmap & 1),
130 configurable: !(bitmap & 2),
131 writable: !(bitmap & 4),
132 value: value
133 };
134 };
135
136 var isObject = function (it) {
137 return typeof it === 'object' ? it !== null : typeof it === 'function';
138 };
139
140 // 7.1.1 ToPrimitive(input [, PreferredType])
141
142 // instead of the ES6 spec version, we didn't implement @@toPrimitive case
143 // and the second argument - flag - preferred type is a string
144 var toPrimitive = function (it, S) {
145 if (!isObject(it)) return it;
146 var fn, val;
147 if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
148 if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val;
149 if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
150 throw TypeError("Can't convert object to primitive value");
151 };
152
153 var hasOwnProperty = {}.hasOwnProperty;
154
155 var has = function (it, key) {
156 return hasOwnProperty.call(it, key);
157 };
158
159 var document$1 = global.document;
160 // typeof document.createElement is 'object' in old IE
161 var exist = isObject(document$1) && isObject(document$1.createElement);
162
163 var documentCreateElement = function (it) {
164 return exist ? document$1.createElement(it) : {};
165 };
166
167 // Thank's IE8 for his funny defineProperty
168 var ie8DomDefine = !descriptors && !fails(function () {
169 return Object.defineProperty(documentCreateElement('div'), 'a', {
170 get: function () { return 7; }
171 }).a != 7;
172 });
173
174 var nativeGetOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
175
176 var f$1 = descriptors ? nativeGetOwnPropertyDescriptor$1 : function getOwnPropertyDescriptor(O, P) {
177 O = toIndexedObject(O);
178 P = toPrimitive(P, true);
179 if (ie8DomDefine) try {
180 return nativeGetOwnPropertyDescriptor$1(O, P);
181 } catch (error) { /* empty */ }
182 if (has(O, P)) return createPropertyDescriptor(!objectPropertyIsEnumerable.f.call(O, P), O[P]);
183 };
184
185 var objectGetOwnPropertyDescriptor = {
186 f: f$1
187 };
188
189 var anObject = function (it) {
190 if (!isObject(it)) {
191 throw TypeError(String(it) + ' is not an object');
192 } return it;
193 };
194
195 var nativeDefineProperty = Object.defineProperty;
196
197 var f$2 = descriptors ? nativeDefineProperty : function defineProperty(O, P, Attributes) {
198 anObject(O);
199 P = toPrimitive(P, true);
200 anObject(Attributes);
201 if (ie8DomDefine) try {
202 return nativeDefineProperty(O, P, Attributes);
203 } catch (error) { /* empty */ }
204 if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported');
205 if ('value' in Attributes) O[P] = Attributes.value;
206 return O;
207 };
208
209 var objectDefineProperty = {
210 f: f$2
211 };
212
213 var hide = descriptors ? function (object, key, value) {
214 return objectDefineProperty.f(object, key, createPropertyDescriptor(1, value));
215 } : function (object, key, value) {
216 object[key] = value;
217 return object;
218 };
219
220 function createCommonjsModule(fn, module) {
221 return module = { exports: {} }, fn(module, module.exports), module.exports;
222 }
223
224 var setGlobal = function (key, value) {
225 try {
226 hide(global, key, value);
227 } catch (error) {
228 global[key] = value;
229 } return value;
230 };
231
232 var shared = createCommonjsModule(function (module) {
233 var SHARED = '__core-js_shared__';
234 var store = global[SHARED] || setGlobal(SHARED, {});
235
236 (module.exports = function (key, value) {
237 return store[key] || (store[key] = value !== undefined ? value : {});
238 })('versions', []).push({
239 version: '3.0.1',
240 mode: 'global',
241 copyright: '© 2019 Denis Pushkarev (zloirock.ru)'
242 });
243 });
244
245 var functionToString = shared('native-function-to-string', Function.toString);
246
247 var WeakMap = global.WeakMap;
248
249 var nativeWeakMap = typeof WeakMap === 'function' && /native code/.test(functionToString.call(WeakMap));
250
251 var id = 0;
252 var postfix = Math.random();
253
254 var uid = function (key) {
255 return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + postfix).toString(36));
256 };
257
258 var shared$1 = shared('keys');
259
260
261 var sharedKey = function (key) {
262 return shared$1[key] || (shared$1[key] = uid(key));
263 };
264
265 var hiddenKeys = {};
266
267 var WeakMap$1 = global.WeakMap;
268 var set, get, has$1;
269
270 var enforce = function (it) {
271 return has$1(it) ? get(it) : set(it, {});
272 };
273
274 var getterFor = function (TYPE) {
275 return function (it) {
276 var state;
277 if (!isObject(it) || (state = get(it)).type !== TYPE) {
278 throw TypeError('Incompatible receiver, ' + TYPE + ' required');
279 } return state;
280 };
281 };
282
283 if (nativeWeakMap) {
284 var store = new WeakMap$1();
285 var wmget = store.get;
286 var wmhas = store.has;
287 var wmset = store.set;
288 set = function (it, metadata) {
289 wmset.call(store, it, metadata);
290 return metadata;
291 };
292 get = function (it) {
293 return wmget.call(store, it) || {};
294 };
295 has$1 = function (it) {
296 return wmhas.call(store, it);
297 };
298 } else {
299 var STATE = sharedKey('state');
300 hiddenKeys[STATE] = true;
301 set = function (it, metadata) {
302 hide(it, STATE, metadata);
303 return metadata;
304 };
305 get = function (it) {
306 return has(it, STATE) ? it[STATE] : {};
307 };
308 has$1 = function (it) {
309 return has(it, STATE);
310 };
311 }
312
313 var internalState = {
314 set: set,
315 get: get,
316 has: has$1,
317 enforce: enforce,
318 getterFor: getterFor
319 };
320
321 var redefine = createCommonjsModule(function (module) {
322 var getInternalState = internalState.get;
323 var enforceInternalState = internalState.enforce;
324 var TEMPLATE = String(functionToString).split('toString');
325
326 shared('inspectSource', function (it) {
327 return functionToString.call(it);
328 });
329
330 (module.exports = function (O, key, value, options) {
331 var unsafe = options ? !!options.unsafe : false;
332 var simple = options ? !!options.enumerable : false;
333 var noTargetGet = options ? !!options.noTargetGet : false;
334 if (typeof value == 'function') {
335 if (typeof key == 'string' && !has(value, 'name')) hide(value, 'name', key);
336 enforceInternalState(value).source = TEMPLATE.join(typeof key == 'string' ? key : '');
337 }
338 if (O === global) {
339 if (simple) O[key] = value;
340 else setGlobal(key, value);
341 return;
342 } else if (!unsafe) {
343 delete O[key];
344 } else if (!noTargetGet && O[key]) {
345 simple = true;
346 }
347 if (simple) O[key] = value;
348 else hide(O, key, value);
349 // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
350 })(Function.prototype, 'toString', function toString() {
351 return typeof this == 'function' && getInternalState(this).source || functionToString.call(this);
352 });
353 });
354
355 var arrayIndexOf = arrayIncludes(false);
356
357
358 var objectKeysInternal = function (object, names) {
359 var O = toIndexedObject(object);
360 var i = 0;
361 var result = [];
362 var key;
363 for (key in O) !has(hiddenKeys, key) && has(O, key) && result.push(key);
364 // Don't enum bug & hidden keys
365 while (names.length > i) if (has(O, key = names[i++])) {
366 ~arrayIndexOf(result, key) || result.push(key);
367 }
368 return result;
369 };
370
371 // IE8- don't enum bug keys
372 var enumBugKeys = [
373 'constructor',
374 'hasOwnProperty',
375 'isPrototypeOf',
376 'propertyIsEnumerable',
377 'toLocaleString',
378 'toString',
379 'valueOf'
380 ];
381
382 // 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O)
383
384 var hiddenKeys$1 = enumBugKeys.concat('length', 'prototype');
385
386 var f$3 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
387 return objectKeysInternal(O, hiddenKeys$1);
388 };
389
390 var objectGetOwnPropertyNames = {
391 f: f$3
392 };
393
394 var f$4 = Object.getOwnPropertySymbols;
395
396 var objectGetOwnPropertySymbols = {
397 f: f$4
398 };
399
400 var Reflect = global.Reflect;
401
402 // all object keys, includes non-enumerable and symbols
403 var ownKeys = Reflect && Reflect.ownKeys || function ownKeys(it) {
404 var keys = objectGetOwnPropertyNames.f(anObject(it));
405 var getOwnPropertySymbols = objectGetOwnPropertySymbols.f;
406 return getOwnPropertySymbols ? keys.concat(getOwnPropertySymbols(it)) : keys;
407 };
408
409 var copyConstructorProperties = function (target, source) {
410 var keys = ownKeys(source);
411 var defineProperty = objectDefineProperty.f;
412 var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
413 for (var i = 0; i < keys.length; i++) {
414 var key = keys[i];
415 if (!has(target, key)) defineProperty(target, key, getOwnPropertyDescriptor(source, key));
416 }
417 };
418
419 var replacement = /#|\.prototype\./;
420
421 var isForced = function (feature, detection) {
422 var value = data[normalize(feature)];
423 return value == POLYFILL ? true
424 : value == NATIVE ? false
425 : typeof detection == 'function' ? fails(detection)
426 : !!detection;
427 };
428
429 var normalize = isForced.normalize = function (string) {
430 return String(string).replace(replacement, '.').toLowerCase();
431 };
432
433 var data = isForced.data = {};
434 var NATIVE = isForced.NATIVE = 'N';
435 var POLYFILL = isForced.POLYFILL = 'P';
436
437 var isForced_1 = isForced;
438
439 var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
440
441
442
443
444
445
446 /*
447 options.target - name of the target object
448 options.global - target is the global object
449 options.stat - export as static methods of target
450 options.proto - export as prototype methods of target
451 options.real - real prototype method for the `pure` version
452 options.forced - export even if the native feature is available
453 options.bind - bind methods to the target, required for the `pure` version
454 options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
455 options.unsafe - use the simple assignment of property instead of delete + defineProperty
456 options.sham - add a flag to not completely full polyfills
457 options.enumerable - export as enumerable property
458 options.noTargetGet - prevent calling a getter on target
459 */
460 var _export = function (options, source) {
461 var TARGET = options.target;
462 var GLOBAL = options.global;
463 var STATIC = options.stat;
464 var FORCED, target, key, targetProperty, sourceProperty, descriptor;
465 if (GLOBAL) {
466 target = global;
467 } else if (STATIC) {
468 target = global[TARGET] || setGlobal(TARGET, {});
469 } else {
470 target = (global[TARGET] || {}).prototype;
471 }
472 if (target) for (key in source) {
473 sourceProperty = source[key];
474 if (options.noTargetGet) {
475 descriptor = getOwnPropertyDescriptor(target, key);
476 targetProperty = descriptor && descriptor.value;
477 } else targetProperty = target[key];
478 FORCED = isForced_1(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
479 // contained in target
480 if (!FORCED && targetProperty !== undefined) {
481 if (typeof sourceProperty === typeof targetProperty) continue;
482 copyConstructorProperties(sourceProperty, targetProperty);
483 }
484 // add a flag to not completely full polyfills
485 if (options.sham || (targetProperty && targetProperty.sham)) {
486 hide(sourceProperty, 'sham', true);
487 }
488 // extend global
489 redefine(target, key, sourceProperty, options);
490 }
491 };
492
493 // Chrome 38 Symbol has incorrect toString conversion
494 var nativeSymbol = !fails(function () {
495 // eslint-disable-next-line no-undef
496 return !String(Symbol());
497 });
498
499 var store$1 = shared('wks');
500
501 var Symbol$1 = global.Symbol;
502
503
504 var wellKnownSymbol = function (name) {
505 return store$1[name] || (store$1[name] = nativeSymbol && Symbol$1[name]
506 || (nativeSymbol ? Symbol$1 : uid)('Symbol.' + name));
507 };
508
509 // 19.1.2.14 / 15.2.3.14 Object.keys(O)
510
511
512
513 var objectKeys = Object.keys || function keys(O) {
514 return objectKeysInternal(O, enumBugKeys);
515 };
516
517 var objectDefineProperties = descriptors ? Object.defineProperties : function defineProperties(O, Properties) {
518 anObject(O);
519 var keys = objectKeys(Properties);
520 var length = keys.length;
521 var i = 0;
522 var key;
523 while (length > i) objectDefineProperty.f(O, key = keys[i++], Properties[key]);
524 return O;
525 };
526
527 var document$2 = global.document;
528
529 var html = document$2 && document$2.documentElement;
530
531 // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
532
533
534
535
536
537 var IE_PROTO = sharedKey('IE_PROTO');
538 var PROTOTYPE = 'prototype';
539 var Empty = function () { /* empty */ };
540
541 // Create object with fake `null` prototype: use iframe Object with cleared prototype
542 var createDict = function () {
543 // Thrash, waste and sodomy: IE GC bug
544 var iframe = documentCreateElement('iframe');
545 var length = enumBugKeys.length;
546 var lt = '<';
547 var script = 'script';
548 var gt = '>';
549 var js = 'java' + script + ':';
550 var iframeDocument;
551 iframe.style.display = 'none';
552 html.appendChild(iframe);
553 iframe.src = String(js);
554 iframeDocument = iframe.contentWindow.document;
555 iframeDocument.open();
556 iframeDocument.write(lt + script + gt + 'document.F=Object' + lt + '/' + script + gt);
557 iframeDocument.close();
558 createDict = iframeDocument.F;
559 while (length--) delete createDict[PROTOTYPE][enumBugKeys[length]];
560 return createDict();
561 };
562
563 var objectCreate = Object.create || function create(O, Properties) {
564 var result;
565 if (O !== null) {
566 Empty[PROTOTYPE] = anObject(O);
567 result = new Empty();
568 Empty[PROTOTYPE] = null;
569 // add "__proto__" for Object.getPrototypeOf polyfill
570 result[IE_PROTO] = O;
571 } else result = createDict();
572 return Properties === undefined ? result : objectDefineProperties(result, Properties);
573 };
574
575 hiddenKeys[IE_PROTO] = true;
576
577 var UNSCOPABLES = wellKnownSymbol('unscopables');
578
579
580 var ArrayPrototype = Array.prototype;
581
582 // Array.prototype[@@unscopables]
583 // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables
584 if (ArrayPrototype[UNSCOPABLES] == undefined) {
585 hide(ArrayPrototype, UNSCOPABLES, objectCreate(null));
586 }
587
588 // add a key to Array.prototype[@@unscopables]
589 var addToUnscopables = function (key) {
590 ArrayPrototype[UNSCOPABLES][key] = true;
591 };
592
593 var internalIncludes = arrayIncludes(true);
594
595 // `Array.prototype.includes` method
596 // https://tc39.github.io/ecma262/#sec-array.prototype.includes
597 _export({ target: 'Array', proto: true }, {
598 includes: function includes(el /* , fromIndex = 0 */) {
599 return internalIncludes(this, el, arguments.length > 1 ? arguments[1] : undefined);
600 }
601 });
602
603 // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables
604 addToUnscopables('includes');
605
606 // `IsArray` abstract operation
607 // https://tc39.github.io/ecma262/#sec-isarray
608 var isArray$1 = Array.isArray || function isArray(arg) {
609 return classofRaw(arg) == 'Array';
610 };
611
612 var createProperty = function (object, key, value) {
613 var propertyKey = toPrimitive(key);
614 if (propertyKey in object) objectDefineProperty.f(object, propertyKey, createPropertyDescriptor(0, value));
615 else object[propertyKey] = value;
616 };
617
618 var SPECIES = wellKnownSymbol('species');
619
620 var arrayMethodHasSpeciesSupport = function (METHOD_NAME) {
621 return !fails(function () {
622 var array = [];
623 var constructor = array.constructor = {};
624 constructor[SPECIES] = function () {
625 return { foo: 1 };
626 };
627 return array[METHOD_NAME](Boolean).foo !== 1;
628 });
629 };
630
631 var SPECIES$1 = wellKnownSymbol('species');
632 var nativeSlice = [].slice;
633 var max$1 = Math.max;
634
635 var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('slice');
636
637 // `Array.prototype.slice` method
638 // https://tc39.github.io/ecma262/#sec-array.prototype.slice
639 // fallback for not array-like ES3 strings and DOM objects
640 _export({ target: 'Array', proto: true, forced: !SPECIES_SUPPORT }, {
641 slice: function slice(start, end) {
642 var O = toIndexedObject(this);
643 var length = toLength(O.length);
644 var k = toAbsoluteIndex(start, length);
645 var fin = toAbsoluteIndex(end === undefined ? length : end, length);
646 // inline `ArraySpeciesCreate` for usage native `Array#slice` where it's possible
647 var Constructor, result, n;
648 if (isArray$1(O)) {
649 Constructor = O.constructor;
650 // cross-realm fallback
651 if (typeof Constructor == 'function' && (Constructor === Array || isArray$1(Constructor.prototype))) {
652 Constructor = undefined;
653 } else if (isObject(Constructor)) {
654 Constructor = Constructor[SPECIES$1];
655 if (Constructor === null) Constructor = undefined;
656 }
657 if (Constructor === Array || Constructor === undefined) {
658 return nativeSlice.call(O, k, fin);
659 }
660 }
661 result = new (Constructor === undefined ? Array : Constructor)(max$1(fin - k, 0));
662 for (n = 0; k < fin; k++, n++) if (k in O) createProperty(result, n, O[k]);
663 result.length = n;
664 return result;
665 }
666 });
667
668 // `ToObject` abstract operation
669 // https://tc39.github.io/ecma262/#sec-toobject
670 var toObject = function (argument) {
671 return Object(requireObjectCoercible(argument));
672 };
673
674 // 19.1.2.1 Object.assign(target, source, ...)
675
676
677
678
679
680 var nativeAssign = Object.assign;
681
682 // should work with symbols and should have deterministic property order (V8 bug)
683 var objectAssign = !nativeAssign || fails(function () {
684 var A = {};
685 var B = {};
686 // eslint-disable-next-line no-undef
687 var symbol = Symbol();
688 var alphabet = 'abcdefghijklmnopqrst';
689 A[symbol] = 7;
690 alphabet.split('').forEach(function (chr) { B[chr] = chr; });
691 return nativeAssign({}, A)[symbol] != 7 || objectKeys(nativeAssign({}, B)).join('') != alphabet;
692 }) ? function assign(target, source) { // eslint-disable-line no-unused-vars
693 var T = toObject(target);
694 var argumentsLength = arguments.length;
695 var index = 1;
696 var getOwnPropertySymbols = objectGetOwnPropertySymbols.f;
697 var propertyIsEnumerable = objectPropertyIsEnumerable.f;
698 while (argumentsLength > index) {
699 var S = indexedObject(arguments[index++]);
700 var keys = getOwnPropertySymbols ? objectKeys(S).concat(getOwnPropertySymbols(S)) : objectKeys(S);
701 var length = keys.length;
702 var j = 0;
703 var key;
704 while (length > j) if (propertyIsEnumerable.call(S, key = keys[j++])) T[key] = S[key];
705 } return T;
706 } : nativeAssign;
707
708 // `Object.assign` method
709 // https://tc39.github.io/ecma262/#sec-object.assign
710 _export({ target: 'Object', stat: true, forced: Object.assign !== objectAssign }, { assign: objectAssign });
711
712 var MATCH = wellKnownSymbol('match');
713
714 // `IsRegExp` abstract operation
715 // https://tc39.github.io/ecma262/#sec-isregexp
716 var isRegexp = function (it) {
717 var isRegExp;
718 return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : classofRaw(it) == 'RegExp');
719 };
720
721 // helper for String#{startsWith, endsWith, includes}
722
723
724
725 var validateStringMethodArguments = function (that, searchString, NAME) {
726 if (isRegexp(searchString)) {
727 throw TypeError('String.prototype.' + NAME + " doesn't accept regex");
728 } return String(requireObjectCoercible(that));
729 };
730
731 var MATCH$1 = wellKnownSymbol('match');
732
733 var correctIsRegexpLogic = function (METHOD_NAME) {
734 var regexp = /./;
735 try {
736 '/./'[METHOD_NAME](regexp);
737 } catch (e) {
738 try {
739 regexp[MATCH$1] = false;
740 return '/./'[METHOD_NAME](regexp);
741 } catch (f) { /* empty */ }
742 } return false;
743 };
744
745 var INCLUDES = 'includes';
746
747 var CORRECT_IS_REGEXP_LOGIC = correctIsRegexpLogic(INCLUDES);
748
749 // `String.prototype.includes` method
750 // https://tc39.github.io/ecma262/#sec-string.prototype.includes
751 _export({ target: 'String', proto: true, forced: !CORRECT_IS_REGEXP_LOGIC }, {
752 includes: function includes(searchString /* , position = 0 */) {
753 return !!~validateStringMethodArguments(this, searchString, INCLUDES)
754 .indexOf(searchString, arguments.length > 1 ? arguments[1] : undefined);
755 }
756 });
757
758 // CONVERT_TO_STRING: true -> String#at
759 // CONVERT_TO_STRING: false -> String#codePointAt
760 var stringAt = function (that, pos, CONVERT_TO_STRING) {
761 var S = String(requireObjectCoercible(that));
762 var position = toInteger(pos);
763 var size = S.length;
764 var first, second;
765 if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
766 first = S.charCodeAt(position);
767 return first < 0xD800 || first > 0xDBFF || position + 1 === size
768 || (second = S.charCodeAt(position + 1)) < 0xDC00 || second > 0xDFFF
769 ? CONVERT_TO_STRING ? S.charAt(position) : first
770 : CONVERT_TO_STRING ? S.slice(position, position + 2) : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
771 };
772
773 // `AdvanceStringIndex` abstract operation
774 // https://tc39.github.io/ecma262/#sec-advancestringindex
775 var advanceStringIndex = function (S, index, unicode) {
776 return index + (unicode ? stringAt(S, index, true).length : 1);
777 };
778
779 // `RegExp.prototype.flags` getter implementation
780 // https://tc39.github.io/ecma262/#sec-get-regexp.prototype.flags
781 var regexpFlags = function () {
782 var that = anObject(this);
783 var result = '';
784 if (that.global) result += 'g';
785 if (that.ignoreCase) result += 'i';
786 if (that.multiline) result += 'm';
787 if (that.unicode) result += 'u';
788 if (that.sticky) result += 'y';
789 return result;
790 };
791
792 var nativeExec = RegExp.prototype.exec;
793 // This always refers to the native implementation, because the
794 // String#replace polyfill uses ./fix-regexp-well-known-symbol-logic.js,
795 // which loads this file before patching the method.
796 var nativeReplace = String.prototype.replace;
797
798 var patchedExec = nativeExec;
799
800 var UPDATES_LAST_INDEX_WRONG = (function () {
801 var re1 = /a/;
802 var re2 = /b*/g;
803 nativeExec.call(re1, 'a');
804 nativeExec.call(re2, 'a');
805 return re1.lastIndex !== 0 || re2.lastIndex !== 0;
806 })();
807
808 // nonparticipating capturing group, copied from es5-shim's String#split patch.
809 var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
810
811 var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED;
812
813 if (PATCH) {
814 patchedExec = function exec(str) {
815 var re = this;
816 var lastIndex, reCopy, match, i;
817
818 if (NPCG_INCLUDED) {
819 reCopy = new RegExp('^' + re.source + '$(?!\\s)', regexpFlags.call(re));
820 }
821 if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
822
823 match = nativeExec.call(re, str);
824
825 if (UPDATES_LAST_INDEX_WRONG && match) {
826 re.lastIndex = re.global ? match.index + match[0].length : lastIndex;
827 }
828 if (NPCG_INCLUDED && match && match.length > 1) {
829 // Fix browsers whose `exec` methods don't consistently return `undefined`
830 // for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/
831 nativeReplace.call(match[0], reCopy, function () {
832 for (i = 1; i < arguments.length - 2; i++) {
833 if (arguments[i] === undefined) match[i] = undefined;
834 }
835 });
836 }
837
838 return match;
839 };
840 }
841
842 var regexpExec = patchedExec;
843
844 // `RegExpExec` abstract operation
845 // https://tc39.github.io/ecma262/#sec-regexpexec
846 var regexpExecAbstract = function (R, S) {
847 var exec = R.exec;
848 if (typeof exec === 'function') {
849 var result = exec.call(R, S);
850 if (typeof result !== 'object') {
851 throw TypeError('RegExp exec method returned something other than an Object or null');
852 }
853 return result;
854 }
855
856 if (classofRaw(R) !== 'RegExp') {
857 throw TypeError('RegExp#exec called on incompatible receiver');
858 }
859
860 return regexpExec.call(R, S);
861 };
862
863 var SPECIES$2 = wellKnownSymbol('species');
864
865 var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () {
866 // #replace needs built-in support for named groups.
867 // #match works fine because it just return the exec results, even if it has
868 // a "grops" property.
869 var re = /./;
870 re.exec = function () {
871 var result = [];
872 result.groups = { a: '7' };
873 return result;
874 };
875 return ''.replace(re, '$<a>') !== '7';
876 });
877
878 // Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec
879 // Weex JS has frozen built-in prototypes, so use try / catch wrapper
880 var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails(function () {
881 var re = /(?:)/;
882 var originalExec = re.exec;
883 re.exec = function () { return originalExec.apply(this, arguments); };
884 var result = 'ab'.split(re);
885 return result.length !== 2 || result[0] !== 'a' || result[1] !== 'b';
886 });
887
888 var fixRegexpWellKnownSymbolLogic = function (KEY, length, exec, sham) {
889 var SYMBOL = wellKnownSymbol(KEY);
890
891 var DELEGATES_TO_SYMBOL = !fails(function () {
892 // String methods call symbol-named RegEp methods
893 var O = {};
894 O[SYMBOL] = function () { return 7; };
895 return ''[KEY](O) != 7;
896 });
897
898 var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails(function () {
899 // Symbol-named RegExp methods call .exec
900 var execCalled = false;
901 var re = /a/;
902 re.exec = function () { execCalled = true; return null; };
903
904 if (KEY === 'split') {
905 // RegExp[@@split] doesn't call the regex's exec method, but first creates
906 // a new one. We need to return the patched regex when creating the new one.
907 re.constructor = {};
908 re.constructor[SPECIES$2] = function () { return re; };
909 }
910
911 re[SYMBOL]('');
912 return !execCalled;
913 });
914
915 if (
916 !DELEGATES_TO_SYMBOL ||
917 !DELEGATES_TO_EXEC ||
918 (KEY === 'replace' && !REPLACE_SUPPORTS_NAMED_GROUPS) ||
919 (KEY === 'split' && !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC)
920 ) {
921 var nativeRegExpMethod = /./[SYMBOL];
922 var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {
923 if (regexp.exec === regexpExec) {
924 if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
925 // The native String method already delegates to @@method (this
926 // polyfilled function), leasing to infinite recursion.
927 // We avoid it by directly calling the native @@method method.
928 return { done: true, value: nativeRegExpMethod.call(regexp, str, arg2) };
929 }
930 return { done: true, value: nativeMethod.call(str, regexp, arg2) };
931 }
932 return { done: false };
933 });
934 var stringMethod = methods[0];
935 var regexMethod = methods[1];
936
937 redefine(String.prototype, KEY, stringMethod);
938 redefine(RegExp.prototype, SYMBOL, length == 2
939 // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue)
940 // 21.2.5.11 RegExp.prototype[@@split](string, limit)
941 ? function (string, arg) { return regexMethod.call(string, this, arg); }
942 // 21.2.5.6 RegExp.prototype[@@match](string)
943 // 21.2.5.9 RegExp.prototype[@@search](string)
944 : function (string) { return regexMethod.call(string, this); }
945 );
946 if (sham) hide(RegExp.prototype[SYMBOL], 'sham', true);
947 }
948 };
949
950 var max$2 = Math.max;
951 var min$2 = Math.min;
952 var floor$1 = Math.floor;
953 var SUBSTITUTION_SYMBOLS = /\$([$&`']|\d\d?|<[^>]*>)/g;
954 var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&`']|\d\d?)/g;
955
956 var maybeToString = function (it) {
957 return it === undefined ? it : String(it);
958 };
959
960 // @@replace logic
961 fixRegexpWellKnownSymbolLogic(
962 'replace',
963 2,
964 function (REPLACE, nativeReplace, maybeCallNative) {
965 return [
966 // `String.prototype.replace` method
967 // https://tc39.github.io/ecma262/#sec-string.prototype.replace
968 function replace(searchValue, replaceValue) {
969 var O = requireObjectCoercible(this);
970 var replacer = searchValue == undefined ? undefined : searchValue[REPLACE];
971 return replacer !== undefined
972 ? replacer.call(searchValue, O, replaceValue)
973 : nativeReplace.call(String(O), searchValue, replaceValue);
974 },
975 // `RegExp.prototype[@@replace]` method
976 // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@replace
977 function (regexp, replaceValue) {
978 var res = maybeCallNative(nativeReplace, regexp, this, replaceValue);
979 if (res.done) return res.value;
980
981 var rx = anObject(regexp);
982 var S = String(this);
983
984 var functionalReplace = typeof replaceValue === 'function';
985 if (!functionalReplace) replaceValue = String(replaceValue);
986
987 var global = rx.global;
988 if (global) {
989 var fullUnicode = rx.unicode;
990 rx.lastIndex = 0;
991 }
992 var results = [];
993 while (true) {
994 var result = regexpExecAbstract(rx, S);
995 if (result === null) break;
996
997 results.push(result);
998 if (!global) break;
999
1000 var matchStr = String(result[0]);
1001 if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
1002 }
1003
1004 var accumulatedResult = '';
1005 var nextSourcePosition = 0;
1006 for (var i = 0; i < results.length; i++) {
1007 result = results[i];
1008
1009 var matched = String(result[0]);
1010 var position = max$2(min$2(toInteger(result.index), S.length), 0);
1011 var captures = [];
1012 // NOTE: This is equivalent to
1013 // captures = result.slice(1).map(maybeToString)
1014 // but for some reason `nativeSlice.call(result, 1, result.length)` (called in
1015 // the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and
1016 // causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it.
1017 for (var j = 1; j < result.length; j++) captures.push(maybeToString(result[j]));
1018 var namedCaptures = result.groups;
1019 if (functionalReplace) {
1020 var replacerArgs = [matched].concat(captures, position, S);
1021 if (namedCaptures !== undefined) replacerArgs.push(namedCaptures);
1022 var replacement = String(replaceValue.apply(undefined, replacerArgs));
1023 } else {
1024 replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);
1025 }
1026 if (position >= nextSourcePosition) {
1027 accumulatedResult += S.slice(nextSourcePosition, position) + replacement;
1028 nextSourcePosition = position + matched.length;
1029 }
1030 }
1031 return accumulatedResult + S.slice(nextSourcePosition);
1032 }
1033 ];
1034
1035 // https://tc39.github.io/ecma262/#sec-getsubstitution
1036 function getSubstitution(matched, str, position, captures, namedCaptures, replacement) {
1037 var tailPos = position + matched.length;
1038 var m = captures.length;
1039 var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;
1040 if (namedCaptures !== undefined) {
1041 namedCaptures = toObject(namedCaptures);
1042 symbols = SUBSTITUTION_SYMBOLS;
1043 }
1044 return nativeReplace.call(replacement, symbols, function (match, ch) {
1045 var capture;
1046 switch (ch.charAt(0)) {
1047 case '$': return '$';
1048 case '&': return matched;
1049 case '`': return str.slice(0, position);
1050 case "'": return str.slice(tailPos);
1051 case '<':
1052 capture = namedCaptures[ch.slice(1, -1)];
1053 break;
1054 default: // \d\d?
1055 var n = +ch;
1056 if (n === 0) return match;
1057 if (n > m) {
1058 var f = floor$1(n / 10);
1059 if (f === 0) return match;
1060 if (f <= m) return captures[f - 1] === undefined ? ch.charAt(1) : captures[f - 1] + ch.charAt(1);
1061 return match;
1062 }
1063 capture = captures[n - 1];
1064 }
1065 return capture === undefined ? '' : capture;
1066 });
1067 }
1068 }
1069 );
1070
1071 var aFunction = function (it) {
1072 if (typeof it != 'function') {
1073 throw TypeError(String(it) + ' is not a function');
1074 } return it;
1075 };
1076
1077 var SPECIES$3 = wellKnownSymbol('species');
1078
1079 // `SpeciesConstructor` abstract operation
1080 // https://tc39.github.io/ecma262/#sec-speciesconstructor
1081 var speciesConstructor = function (O, defaultConstructor) {
1082 var C = anObject(O).constructor;
1083 var S;
1084 return C === undefined || (S = anObject(C)[SPECIES$3]) == undefined ? defaultConstructor : aFunction(S);
1085 };
1086
1087 var arrayPush = [].push;
1088 var min$3 = Math.min;
1089 var MAX_UINT32 = 0xFFFFFFFF;
1090
1091 // babel-minify transpiles RegExp('x', 'y') -> /x/y and it causes SyntaxError
1092 var SUPPORTS_Y = !fails(function () { return !RegExp(MAX_UINT32, 'y'); });
1093
1094 // @@split logic
1095 fixRegexpWellKnownSymbolLogic(
1096 'split',
1097 2,
1098 function (SPLIT, nativeSplit, maybeCallNative) {
1099 var internalSplit;
1100 if (
1101 'abbc'.split(/(b)*/)[1] == 'c' ||
1102 'test'.split(/(?:)/, -1).length != 4 ||
1103 'ab'.split(/(?:ab)*/).length != 2 ||
1104 '.'.split(/(.?)(.?)/).length != 4 ||
1105 '.'.split(/()()/).length > 1 ||
1106 ''.split(/.?/).length
1107 ) {
1108 // based on es5-shim implementation, need to rework it
1109 internalSplit = function (separator, limit) {
1110 var string = String(requireObjectCoercible(this));
1111 var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
1112 if (lim === 0) return [];
1113 if (separator === undefined) return [string];
1114 // If `separator` is not a regex, use native split
1115 if (!isRegexp(separator)) {
1116 return nativeSplit.call(string, separator, lim);
1117 }
1118 var output = [];
1119 var flags = (separator.ignoreCase ? 'i' : '') +
1120 (separator.multiline ? 'm' : '') +
1121 (separator.unicode ? 'u' : '') +
1122 (separator.sticky ? 'y' : '');
1123 var lastLastIndex = 0;
1124 // Make `global` and avoid `lastIndex` issues by working with a copy
1125 var separatorCopy = new RegExp(separator.source, flags + 'g');
1126 var match, lastIndex, lastLength;
1127 while (match = regexpExec.call(separatorCopy, string)) {
1128 lastIndex = separatorCopy.lastIndex;
1129 if (lastIndex > lastLastIndex) {
1130 output.push(string.slice(lastLastIndex, match.index));
1131 if (match.length > 1 && match.index < string.length) arrayPush.apply(output, match.slice(1));
1132 lastLength = match[0].length;
1133 lastLastIndex = lastIndex;
1134 if (output.length >= lim) break;
1135 }
1136 if (separatorCopy.lastIndex === match.index) separatorCopy.lastIndex++; // Avoid an infinite loop
1137 }
1138 if (lastLastIndex === string.length) {
1139 if (lastLength || !separatorCopy.test('')) output.push('');
1140 } else output.push(string.slice(lastLastIndex));
1141 return output.length > lim ? output.slice(0, lim) : output;
1142 };
1143 // Chakra, V8
1144 } else if ('0'.split(undefined, 0).length) {
1145 internalSplit = function (separator, limit) {
1146 return separator === undefined && limit === 0 ? [] : nativeSplit.call(this, separator, limit);
1147 };
1148 } else internalSplit = nativeSplit;
1149
1150 return [
1151 // `String.prototype.split` method
1152 // https://tc39.github.io/ecma262/#sec-string.prototype.split
1153 function split(separator, limit) {
1154 var O = requireObjectCoercible(this);
1155 var splitter = separator == undefined ? undefined : separator[SPLIT];
1156 return splitter !== undefined
1157 ? splitter.call(separator, O, limit)
1158 : internalSplit.call(String(O), separator, limit);
1159 },
1160 // `RegExp.prototype[@@split]` method
1161 // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@split
1162 //
1163 // NOTE: This cannot be properly polyfilled in engines that don't support
1164 // the 'y' flag.
1165 function (regexp, limit) {
1166 var res = maybeCallNative(internalSplit, regexp, this, limit, internalSplit !== nativeSplit);
1167 if (res.done) return res.value;
1168
1169 var rx = anObject(regexp);
1170 var S = String(this);
1171 var C = speciesConstructor(rx, RegExp);
1172
1173 var unicodeMatching = rx.unicode;
1174 var flags = (rx.ignoreCase ? 'i' : '') +
1175 (rx.multiline ? 'm' : '') +
1176 (rx.unicode ? 'u' : '') +
1177 (SUPPORTS_Y ? 'y' : 'g');
1178
1179 // ^(? + rx + ) is needed, in combination with some S slicing, to
1180 // simulate the 'y' flag.
1181 var splitter = new C(SUPPORTS_Y ? rx : '^(?:' + rx.source + ')', flags);
1182 var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
1183 if (lim === 0) return [];
1184 if (S.length === 0) return regexpExecAbstract(splitter, S) === null ? [S] : [];
1185 var p = 0;
1186 var q = 0;
1187 var A = [];
1188 while (q < S.length) {
1189 splitter.lastIndex = SUPPORTS_Y ? q : 0;
1190 var z = regexpExecAbstract(splitter, SUPPORTS_Y ? S : S.slice(q));
1191 var e;
1192 if (
1193 z === null ||
1194 (e = min$3(toLength(splitter.lastIndex + (SUPPORTS_Y ? 0 : q)), S.length)) === p
1195 ) {
1196 q = advanceStringIndex(S, q, unicodeMatching);
1197 } else {
1198 A.push(S.slice(p, q));
1199 if (A.length === lim) return A;
1200 for (var i = 1; i <= z.length - 1; i++) {
1201 A.push(z[i]);
1202 if (A.length === lim) return A;
1203 }
1204 q = p = e;
1205 }
1206 }
1207 A.push(S.slice(p));
1208 return A;
1209 }
1210 ];
1211 },
1212 !SUPPORTS_Y
1213 );
1214
1215 var quot = /"/g;
1216
1217 // B.2.3.2.1 CreateHTML(string, tag, attribute, value)
1218 // https://tc39.github.io/ecma262/#sec-createhtml
1219 var createHtml = function (string, tag, attribute, value) {
1220 var S = String(requireObjectCoercible(string));
1221 var p1 = '<' + tag;
1222 if (attribute !== '') p1 += ' ' + attribute + '="' + String(value).replace(quot, '&quot;') + '"';
1223 return p1 + '>' + S + '</' + tag + '>';
1224 };
1225
1226 // check the existence of a method, lowercase
1227 // of a tag and escaping quotes in arguments
1228 var forcedStringHtmlMethod = function (METHOD_NAME) {
1229 return fails(function () {
1230 var test = ''[METHOD_NAME]('"');
1231 return test !== test.toLowerCase() || test.split('"').length > 3;
1232 });
1233 };
1234
1235 var FORCED = forcedStringHtmlMethod('bold');
1236
1237 // `String.prototype.bold` method
1238 // https://tc39.github.io/ecma262/#sec-string.prototype.bold
1239 _export({ target: 'String', proto: true, forced: FORCED }, {
1240 bold: function bold() {
1241 return createHtml(this, 'b', '', '');
1242 }
1243 });
1244
1245 var FORCED$1 = forcedStringHtmlMethod('link');
1246
1247 // `String.prototype.link` method
1248 // https://tc39.github.io/ecma262/#sec-string.prototype.link
1249 _export({ target: 'String', proto: true, forced: FORCED$1 }, {
1250 link: function link(url) {
1251 return createHtml(this, 'a', 'href', url);
1252 }
1253 });
1254
1255 function _inheritsLoose(subClass, superClass) {
1256 subClass.prototype = Object.create(superClass.prototype);
1257 subClass.prototype.constructor = subClass;
1258 subClass.__proto__ = superClass;
1259 }
1260
1261 var sloppyArrayMethod = function (METHOD_NAME, argument) {
1262 var method = [][METHOD_NAME];
1263 return !method || !fails(function () {
1264 // eslint-disable-next-line no-useless-call,no-throw-literal
1265 method.call(null, argument || function () { throw 1; }, 1);
1266 });
1267 };
1268
1269 var nativeJoin = [].join;
1270
1271 var ES3_STRINGS = indexedObject != Object;
1272 var SLOPPY_METHOD = sloppyArrayMethod('join', ',');
1273
1274 // `Array.prototype.join` method
1275 // https://tc39.github.io/ecma262/#sec-array.prototype.join
1276 _export({ target: 'Array', proto: true, forced: ES3_STRINGS || SLOPPY_METHOD }, {
1277 join: function join(separator) {
1278 return nativeJoin.call(toIndexedObject(this), separator === undefined ? ',' : separator);
1279 }
1280 });
1281
1282 // optional / simple context binding
1283 var bindContext = function (fn, that, length) {
1284 aFunction(fn);
1285 if (that === undefined) return fn;
1286 switch (length) {
1287 case 0: return function () {
1288 return fn.call(that);
1289 };
1290 case 1: return function (a) {
1291 return fn.call(that, a);
1292 };
1293 case 2: return function (a, b) {
1294 return fn.call(that, a, b);
1295 };
1296 case 3: return function (a, b, c) {
1297 return fn.call(that, a, b, c);
1298 };
1299 }
1300 return function (/* ...args */) {
1301 return fn.apply(that, arguments);
1302 };
1303 };
1304
1305 var SPECIES$4 = wellKnownSymbol('species');
1306
1307 // `ArraySpeciesCreate` abstract operation
1308 // https://tc39.github.io/ecma262/#sec-arrayspeciescreate
1309 var arraySpeciesCreate = function (originalArray, length) {
1310 var C;
1311 if (isArray$1(originalArray)) {
1312 C = originalArray.constructor;
1313 // cross-realm fallback
1314 if (typeof C == 'function' && (C === Array || isArray$1(C.prototype))) C = undefined;
1315 else if (isObject(C)) {
1316 C = C[SPECIES$4];
1317 if (C === null) C = undefined;
1318 }
1319 } return new (C === undefined ? Array : C)(length === 0 ? 0 : length);
1320 };
1321
1322 // `Array.prototype.{ forEach, map, filter, some, every, find, findIndex }` methods implementation
1323 // 0 -> Array#forEach
1324 // https://tc39.github.io/ecma262/#sec-array.prototype.foreach
1325 // 1 -> Array#map
1326 // https://tc39.github.io/ecma262/#sec-array.prototype.map
1327 // 2 -> Array#filter
1328 // https://tc39.github.io/ecma262/#sec-array.prototype.filter
1329 // 3 -> Array#some
1330 // https://tc39.github.io/ecma262/#sec-array.prototype.some
1331 // 4 -> Array#every
1332 // https://tc39.github.io/ecma262/#sec-array.prototype.every
1333 // 5 -> Array#find
1334 // https://tc39.github.io/ecma262/#sec-array.prototype.find
1335 // 6 -> Array#findIndex
1336 // https://tc39.github.io/ecma262/#sec-array.prototype.findIndex
1337 var arrayMethods = function (TYPE, specificCreate) {
1338 var IS_MAP = TYPE == 1;
1339 var IS_FILTER = TYPE == 2;
1340 var IS_SOME = TYPE == 3;
1341 var IS_EVERY = TYPE == 4;
1342 var IS_FIND_INDEX = TYPE == 6;
1343 var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
1344 var create = specificCreate || arraySpeciesCreate;
1345 return function ($this, callbackfn, that) {
1346 var O = toObject($this);
1347 var self = indexedObject(O);
1348 var boundFunction = bindContext(callbackfn, that, 3);
1349 var length = toLength(self.length);
1350 var index = 0;
1351 var target = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined;
1352 var value, result;
1353 for (;length > index; index++) if (NO_HOLES || index in self) {
1354 value = self[index];
1355 result = boundFunction(value, index, O);
1356 if (TYPE) {
1357 if (IS_MAP) target[index] = result; // map
1358 else if (result) switch (TYPE) {
1359 case 3: return true; // some
1360 case 5: return value; // find
1361 case 6: return index; // findIndex
1362 case 2: target.push(value); // filter
1363 } else if (IS_EVERY) return false; // every
1364 }
1365 }
1366 return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
1367 };
1368 };
1369
1370 var internalMap = arrayMethods(1);
1371
1372 var SPECIES_SUPPORT$1 = arrayMethodHasSpeciesSupport('map');
1373
1374 // `Array.prototype.map` method
1375 // https://tc39.github.io/ecma262/#sec-array.prototype.map
1376 // with adding support of @@species
1377 _export({ target: 'Array', proto: true, forced: !SPECIES_SUPPORT$1 }, {
1378 map: function map(callbackfn /* , thisArg */) {
1379 return internalMap(this, callbackfn, arguments[1]);
1380 }
1381 });
1382
1383 var FAILS_ON_PRIMITIVES = fails(function () { objectKeys(1); });
1384
1385 // `Object.keys` method
1386 // https://tc39.github.io/ecma262/#sec-object.keys
1387 _export({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES }, {
1388 keys: function keys(it) {
1389 return objectKeys(toObject(it));
1390 }
1391 });
1392
1393 var ENDS_WITH = 'endsWith';
1394 var nativeEndsWith = ''[ENDS_WITH];
1395 var min$4 = Math.min;
1396
1397 var CORRECT_IS_REGEXP_LOGIC$1 = correctIsRegexpLogic(ENDS_WITH);
1398
1399 // `String.prototype.endsWith` method
1400 // https://tc39.github.io/ecma262/#sec-string.prototype.endswith
1401 _export({ target: 'String', proto: true, forced: !CORRECT_IS_REGEXP_LOGIC$1 }, {
1402 endsWith: function endsWith(searchString /* , endPosition = @length */) {
1403 var that = validateStringMethodArguments(this, searchString, ENDS_WITH);
1404 var endPosition = arguments.length > 1 ? arguments[1] : undefined;
1405 var len = toLength(that.length);
1406 var end = endPosition === undefined ? len : min$4(toLength(endPosition), len);
1407 var search = String(searchString);
1408 return nativeEndsWith
1409 ? nativeEndsWith.call(that, search, end)
1410 : that.slice(end - search.length, end) === search;
1411 }
1412 });
1413
1414 // iterable DOM collections
1415 // flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
1416 var domIterables = {
1417 CSSRuleList: 0,
1418 CSSStyleDeclaration: 0,
1419 CSSValueList: 0,
1420 ClientRectList: 0,
1421 DOMRectList: 0,
1422 DOMStringList: 0,
1423 DOMTokenList: 1,
1424 DataTransferItemList: 0,
1425 FileList: 0,
1426 HTMLAllCollection: 0,
1427 HTMLCollection: 0,
1428 HTMLFormElement: 0,
1429 HTMLSelectElement: 0,
1430 MediaList: 0,
1431 MimeTypeArray: 0,
1432 NamedNodeMap: 0,
1433 NodeList: 1,
1434 PaintRequestList: 0,
1435 Plugin: 0,
1436 PluginArray: 0,
1437 SVGLengthList: 0,
1438 SVGNumberList: 0,
1439 SVGPathSegList: 0,
1440 SVGPointList: 0,
1441 SVGStringList: 0,
1442 SVGTransformList: 0,
1443 SourceBufferList: 0,
1444 StyleSheetList: 0,
1445 TextTrackCueList: 0,
1446 TextTrackList: 0,
1447 TouchList: 0
1448 };
1449
1450 var nativeForEach = [].forEach;
1451 var internalForEach = arrayMethods(0);
1452
1453 var SLOPPY_METHOD$1 = sloppyArrayMethod('forEach');
1454
1455 // `Array.prototype.forEach` method implementation
1456 // https://tc39.github.io/ecma262/#sec-array.prototype.foreach
1457 var arrayForEach = SLOPPY_METHOD$1 ? function forEach(callbackfn /* , thisArg */) {
1458 return internalForEach(this, callbackfn, arguments[1]);
1459 } : nativeForEach;
1460
1461 for (var COLLECTION_NAME in domIterables) {
1462 var Collection = global[COLLECTION_NAME];
1463 var CollectionPrototype = Collection && Collection.prototype;
1464 // some Chrome versions have non-configurable methods on DOMTokenList
1465 if (CollectionPrototype && CollectionPrototype.forEach !== arrayForEach) try {
1466 hide(CollectionPrototype, 'forEach', arrayForEach);
1467 } catch (error) {
1468 CollectionPrototype.forEach = arrayForEach;
1469 }
1470 }
1471
1472 var TO_STRING_TAG = wellKnownSymbol('toStringTag');
1473 // ES3 wrong here
1474 var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
1475
1476 // fallback for IE11 Script Access Denied error
1477 var tryGet = function (it, key) {
1478 try {
1479 return it[key];
1480 } catch (error) { /* empty */ }
1481 };
1482
1483 // getting tag from ES6+ `Object.prototype.toString`
1484 var classof = function (it) {
1485 var O, tag, result;
1486 return it === undefined ? 'Undefined' : it === null ? 'Null'
1487 // @@toStringTag case
1488 : typeof (tag = tryGet(O = Object(it), TO_STRING_TAG)) == 'string' ? tag
1489 // builtinTag case
1490 : CORRECT_ARGUMENTS ? classofRaw(O)
1491 // ES3 arguments fallback
1492 : (result = classofRaw(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : result;
1493 };
1494
1495 var TO_STRING_TAG$1 = wellKnownSymbol('toStringTag');
1496 var test = {};
1497
1498 test[TO_STRING_TAG$1] = 'z';
1499
1500 // `Object.prototype.toString` method implementation
1501 // https://tc39.github.io/ecma262/#sec-object.prototype.tostring
1502 var objectToString = String(test) !== '[object z]' ? function toString() {
1503 return '[object ' + classof(this) + ']';
1504 } : test.toString;
1505
1506 var ObjectPrototype = Object.prototype;
1507
1508 // `Object.prototype.toString` method
1509 // https://tc39.github.io/ecma262/#sec-object.prototype.tostring
1510 if (objectToString !== ObjectPrototype.toString) {
1511 redefine(ObjectPrototype, 'toString', objectToString, { unsafe: true });
1512 }
1513
1514 var TO_STRING = 'toString';
1515 var nativeToString = /./[TO_STRING];
1516
1517 var NOT_GENERIC = fails(function () { return nativeToString.call({ source: 'a', flags: 'b' }) != '/a/b'; });
1518 // FF44- RegExp#toString has a wrong name
1519 var INCORRECT_NAME = nativeToString.name != TO_STRING;
1520
1521 // `RegExp.prototype.toString` method
1522 // https://tc39.github.io/ecma262/#sec-regexp.prototype.tostring
1523 if (NOT_GENERIC || INCORRECT_NAME) {
1524 redefine(RegExp.prototype, TO_STRING, function toString() {
1525 var R = anObject(this);
1526 return '/'.concat(R.source, '/',
1527 'flags' in R ? R.flags : !descriptors && R instanceof RegExp ? regexpFlags.call(R) : undefined);
1528 }, { unsafe: true });
1529 }
1530
1531 var oP = Object.prototype;
1532 /**
1533 * 是否对象
1534 * @param {any} o 判断变量
1535 * @return {boolean} 结构
1536 */
1537
1538 function isObject$1(o) {
1539 return oP.toString.call(o) === '[object Object]';
1540 }
1541 /**
1542 * 是否string
1543 * @param {*} o
1544 */
1545
1546 function isString(o) {
1547 return typeof o === 'string';
1548 }
1549
1550 // @@match logic
1551 fixRegexpWellKnownSymbolLogic(
1552 'match',
1553 1,
1554 function (MATCH, nativeMatch, maybeCallNative) {
1555 return [
1556 // `String.prototype.match` method
1557 // https://tc39.github.io/ecma262/#sec-string.prototype.match
1558 function match(regexp) {
1559 var O = requireObjectCoercible(this);
1560 var matcher = regexp == undefined ? undefined : regexp[MATCH];
1561 return matcher !== undefined ? matcher.call(regexp, O) : new RegExp(regexp)[MATCH](String(O));
1562 },
1563 // `RegExp.prototype[@@match]` method
1564 // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@match
1565 function (regexp) {
1566 var res = maybeCallNative(nativeMatch, regexp, this);
1567 if (res.done) return res.value;
1568
1569 var rx = anObject(regexp);
1570 var S = String(this);
1571
1572 if (!rx.global) return regexpExecAbstract(rx, S);
1573
1574 var fullUnicode = rx.unicode;
1575 rx.lastIndex = 0;
1576 var A = [];
1577 var n = 0;
1578 var result;
1579 while ((result = regexpExecAbstract(rx, S)) !== null) {
1580 var matchStr = String(result[0]);
1581 A[n] = matchStr;
1582 if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
1583 n++;
1584 }
1585 return n === 0 ? null : A;
1586 }
1587 ];
1588 }
1589 );
1590
1591 /**
1592 * 获得文本块最后一行,并移除
1593 * @parma {array<object>} 文本块
1594 * @return {array<object>} 最后一行
1595 */
1596
1597 function helperGetLastLIne(textList) {
1598 var results = [];
1599
1600 for (var i = textList.length - 1; i >= 0; i--) {
1601 var inlineText = textList[i].content;
1602 var match = inlineText.match(/\n(.*?)$/);
1603
1604 if (match) {
1605 var matched = match[1],
1606 index = match.index; // 后置文本清理
1607
1608 textList[i].content = inlineText.substr(0, index + 1);
1609 results.push(Object.assign({}, textList[i], {
1610 content: matched
1611 }));
1612 break;
1613 } else {
1614 results.push(textList[i]); // 清理textList末尾
1615
1616 textList.pop();
1617 }
1618 }
1619
1620 return results.reverse();
1621 }
1622 /**
1623 * 事件绑定
1624 * @param {HTMLElement} el 绑定dom
1625 * @param {string} event 事件名
1626 * @param {function} func 回调函数
1627 * @return {function} 解绑函数
1628 */
1629
1630 function addEvent(el, event, func) {
1631 var callback = function callback(e) {
1632 return func(e);
1633 };
1634
1635 el.addEventListener(event, callback);
1636 return function () {
1637 return el.removeEventListener(event, callback);
1638 };
1639 }
1640
1641 var EMOJIMAP = {
1642 "[仰慕]": {
1643 path: "baozi/emjoy-仰慕.png",
1644 url: "https://img.guihuazhi.com/image/hz/be/b8/beb847c8e54dbec49b9b5338d7c1d734v64x64.png",
1645 size: 5630,
1646 extra: {
1647 format: "png",
1648 width: 64,
1649 height: 64
1650 }
1651 },
1652 "[无辜]": {
1653 path: "baozi/emjoy-无辜.png",
1654 url: "https://img.guihuazhi.com/image/hz/70/39/7039531f0bffbf4b1d3d624c66582384v64x64.png",
1655 size: 5060,
1656 extra: {
1657 format: "png",
1658 width: 64,
1659 height: 64
1660 }
1661 },
1662 "[很尴尬]": {
1663 path: "baozi/emjoy-尴尬.png",
1664 url: "https://img.guihuazhi.com/image/hz/10/72/1072373c470e4595dc731d0d4e5c6b0dv64x64.png",
1665 size: 4366,
1666 extra: {
1667 format: "png",
1668 width: 64,
1669 height: 64
1670 }
1671 },
1672 "[拍桌子]": {
1673 path: "baozi/emjoy-拍桌子.png",
1674 url: "https://img.guihuazhi.com/image/hz/7e/97/7e97bf7d6c338a7f873e7102cc328d22v64x64.png",
1675 size: 4414,
1676 extra: {
1677 format: "png",
1678 width: 64,
1679 height: 64
1680 }
1681 },
1682 "[砸]": {
1683 path: "baozi/emjoy-砸.png",
1684 url: "https://img.guihuazhi.com/image/hz/64/15/64152abbd09f2b2de9e260711d2e22bdv64x64.png",
1685 size: 4341,
1686 extra: {
1687 format: "png",
1688 width: 64,
1689 height: 64
1690 }
1691 },
1692 "[伸舌头]": {
1693 path: "baozi/emjoy-伸舌头.png",
1694 url: "https://img.guihuazhi.com/image/hz/ca/ac/caacc0be3e3b9289df95302b71d2dbd6v64x64.png",
1695 size: 4417,
1696 extra: {
1697 format: "png",
1698 width: 64,
1699 height: 64
1700 }
1701 },
1702 "[老大]": {
1703 path: "baozi/emjoy-老大.png",
1704 url: "https://img.guihuazhi.com/image/hz/6f/6f/6f6f4ce92111f4e70567aac629baf259v64x64.png",
1705 size: 4580,
1706 extra: {
1707 format: "png",
1708 width: 64,
1709 height: 64
1710 }
1711 },
1712 "[寒]": {
1713 path: "baozi/emjoy-寒.png",
1714 url: "https://img.guihuazhi.com/image/hz/e4/85/e4852abf339c746cda85f2472d61a64dv64x64.png",
1715 size: 5235,
1716 extra: {
1717 format: "png",
1718 width: 64,
1719 height: 64
1720 }
1721 },
1722 "[哭]": {
1723 path: "baozi/emjoy-哭.png",
1724 url: "https://img.guihuazhi.com/image/hz/12/0a/120a0b976fadb97d38e8f5563e5a9774v64x64.png",
1725 size: 4666,
1726 extra: {
1727 format: "png",
1728 width: 64,
1729 height: 64
1730 }
1731 },
1732 "[伤心]": {
1733 path: "baozi/emjoy-伤心.png",
1734 url: "https://img.guihuazhi.com/image/hz/57/a9/57a93a97b24d63216a077094936b4a91v64x64.png",
1735 size: 4873,
1736 extra: {
1737 format: "png",
1738 width: 64,
1739 height: 64
1740 }
1741 },
1742 "[很得意]": {
1743 path: "baozi/emjoy-得意.png",
1744 url: "https://img.guihuazhi.com/image/hz/a0/71/a07163f8f7a7209cf63a6977ae6f4391v64x64.png",
1745 size: 4284,
1746 extra: {
1747 format: "png",
1748 width: 64,
1749 height: 64
1750 }
1751 },
1752 "[恐怖]": {
1753 path: "baozi/emjoy-恐怖.png",
1754 url: "https://img.guihuazhi.com/image/hz/9a/f2/9af270856b4eb517baf5a0e46cc42c4bv64x64.png",
1755 size: 5315,
1756 extra: {
1757 format: "png",
1758 width: 64,
1759 height: 64
1760 }
1761 },
1762 "[哭泣]": {
1763 path: "baozi/emjoy-大哭.png",
1764 url: "https://img.guihuazhi.com/image/hz/44/a3/44a341f00d3fd5d186b3b39e57a76c75v64x64.png",
1765 size: 5291,
1766 extra: {
1767 format: "png",
1768 width: 64,
1769 height: 64
1770 }
1771 },
1772 "[激动]": {
1773 path: "baozi/emjoy-激动.png",
1774 url: "https://img.guihuazhi.com/image/hz/8a/fe/8afe8eedb5121214fffb4d0f7176dbadv64x64.png",
1775 size: 4847,
1776 extra: {
1777 format: "png",
1778 width: 64,
1779 height: 64
1780 }
1781 },
1782 "[赞]": {
1783 path: "baozi/emjoy-赞.png",
1784 url: "https://img.guihuazhi.com/image/hz/c9/29/c92900946a1294a5bbef065477ccb4a5v64x64.png",
1785 size: 5606,
1786 extra: {
1787 format: "png",
1788 width: 64,
1789 height: 64
1790 }
1791 },
1792 "[唱歌]": {
1793 path: "baozi/emjoy-唱歌.png",
1794 url: "https://img.guihuazhi.com/image/hz/89/f3/89f3573aa24b4986b30ac7da47578cf1v64x64.png",
1795 size: 4326,
1796 extra: {
1797 format: "png",
1798 width: 64,
1799 height: 64
1800 }
1801 },
1802 "[害羞]": {
1803 path: "baozi/emjoy-害羞.png",
1804 url: "https://img.guihuazhi.com/image/hz/7b/a4/7ba46a63994991bb4bc0ad52e7bd72edv64x64.png",
1805 size: 5374,
1806 extra: {
1807 format: "png",
1808 width: 64,
1809 height: 64
1810 }
1811 },
1812 "[脸红]": {
1813 path: "baozi/emjoy-脸红.png",
1814 url: "https://img.guihuazhi.com/image/hz/75/26/7526ae1a305c1b07703f495eca264d6dv64x64.png",
1815 size: 4326,
1816 extra: {
1817 format: "png",
1818 width: 64,
1819 height: 64
1820 }
1821 },
1822 "[微笑]": {
1823 path: "baozi/emjoy-微笑.png",
1824 url: "https://img.guihuazhi.com/image/hz/ff/51/ff51e1843d77e9c49b2cc2b5c6ab9921v64x64.png",
1825 size: 4043,
1826 extra: {
1827 format: "png",
1828 width: 64,
1829 height: 64
1830 }
1831 },
1832 "[好可怜]": {
1833 path: "baozi/emjoy-可怜.png",
1834 url: "https://img.guihuazhi.com/image/hz/7a/dd/7add2c28e54047e8120c50ba20b44090v64x64.png",
1835 size: 5777,
1836 extra: {
1837 format: "png",
1838 width: 64,
1839 height: 64
1840 }
1841 },
1842 "[酷酷的]": {
1843 path: "baozi/emjoy-酷.png",
1844 url: "https://img.guihuazhi.com/image/hz/be/56/be56121eecc3fa3ff3306125b643c308v64x64.png",
1845 size: 4436,
1846 extra: {
1847 format: "png",
1848 width: 64,
1849 height: 64
1850 }
1851 },
1852 "[心碎]": {
1853 path: "baozi/emjoy-心碎.png",
1854 url: "https://img.guihuazhi.com/image/hz/ae/a3/aea3ca62cb19b02ba228de04b06c0d69v64x64.png",
1855 size: 3600,
1856 extra: {
1857 format: "png",
1858 width: 64,
1859 height: 64
1860 }
1861 },
1862 "[很惊讶]": {
1863 path: "baozi/emjoy-惊讶.png",
1864 url: "https://img.guihuazhi.com/image/hz/86/58/86581676dfd2a7196d6bbfade1f1e5d4v64x64.png",
1865 size: 5028,
1866 extra: {
1867 format: "png",
1868 width: 64,
1869 height: 64
1870 }
1871 },
1872 "[气愤]": {
1873 path: "baozi/emjoy-气愤.png",
1874 url: "https://img.guihuazhi.com/image/hz/aa/7d/aa7dd0514f09d51667219087fc0f5992v64x64.png",
1875 size: 5199,
1876 extra: {
1877 format: "png",
1878 width: 64,
1879 height: 64
1880 }
1881 },
1882 "[喊话]": {
1883 path: "baozi/emjoy-喊话.png",
1884 url: "https://img.guihuazhi.com/image/hz/83/a2/83a208392933b0db34981b0f9dc16575v64x64.png",
1885 size: 4506,
1886 extra: {
1887 format: "png",
1888 width: 64,
1889 height: 64
1890 }
1891 },
1892 "[握手]": {
1893 path: "baozi/emjoy-握手.png",
1894 url: "https://img.guihuazhi.com/image/hz/7e/4e/7e4ecba2ea1822df06e37c2e852412cfv64x64.png",
1895 size: 3580,
1896 extra: {
1897 format: "png",
1898 width: 64,
1899 height: 64
1900 }
1901 },
1902 "[撒娇]": {
1903 path: "baozi/emjoy-撒娇.png",
1904 url: "https://img.guihuazhi.com/image/hz/f1/67/f1676a269584a45342fca2a9b099e8f6v64x64.png",
1905 size: 4830,
1906 extra: {
1907 format: "png",
1908 width: 64,
1909 height: 64
1910 }
1911 },
1912 "[晕了]": {
1913 path: "baozi/emjoy-晕了.png",
1914 url: "https://img.guihuazhi.com/image/hz/e7/ae/e7ae71b1bfb43ab3a23409e2cf7904bev64x64.png",
1915 size: 5286,
1916 extra: {
1917 format: "png",
1918 width: 64,
1919 height: 64
1920 }
1921 },
1922 "[惊吓]": {
1923 path: "baozi/emjoy-惊吓.png",
1924 url: "https://img.guihuazhi.com/image/hz/f3/75/f3759ebf2c0057f729e35a0a6461fb78v64x64.png",
1925 size: 4756,
1926 extra: {
1927 format: "png",
1928 width: 64,
1929 height: 64
1930 }
1931 },
1932 "[汗]": {
1933 path: "baozi/emjoy-汗.png",
1934 url: "https://img.guihuazhi.com/image/hz/82/4b/824b80638f072cd16c769f82543df32av64x64.png",
1935 size: 4739,
1936 extra: {
1937 format: "png",
1938 width: 64,
1939 height: 64
1940 }
1941 },
1942 "[流口水]": {
1943 path: "baozi/emjoy-流口水.png",
1944 url: "https://img.guihuazhi.com/image/hz/ed/89/ed89ac58ffc8a161d489aba283d2d528v64x64.png",
1945 size: 5049,
1946 extra: {
1947 format: "png",
1948 width: 64,
1949 height: 64
1950 }
1951 },
1952 "[鼻血]": {
1953 path: "baozi/emjoy-鼻血.png",
1954 url: "https://img.guihuazhi.com/image/hz/60/7f/607fe2826d650cd489b7a50c966d8742v64x64.png",
1955 size: 4970,
1956 extra: {
1957 format: "png",
1958 width: 64,
1959 height: 64
1960 }
1961 },
1962 "[喜欢]": {
1963 path: "baozi/emjoy-喜欢.png",
1964 url: "https://img.guihuazhi.com/image/hz/bb/6b/bb6b1b7996d28d4da396b1c16ae8301bv64x64.png",
1965 size: 4806,
1966 extra: {
1967 format: "png",
1968 width: 64,
1969 height: 64
1970 }
1971 },
1972 "[邪恶]": {
1973 path: "baozi/emjoy-邪恶.png",
1974 url: "https://img.guihuazhi.com/image/hz/35/ba/35ba542143382619426a8f8ddb171066v64x64.png",
1975 size: 3832,
1976 extra: {
1977 format: "png",
1978 width: 64,
1979 height: 64
1980 }
1981 },
1982 "[啵]": {
1983 path: "baozi/emjoy-啵.png",
1984 url: "https://img.guihuazhi.com/image/hz/78/3c/783cb7bfa01e307d7b15dbbc90935810v64x64.png",
1985 size: 4795,
1986 extra: {
1987 format: "png",
1988 width: 64,
1989 height: 64
1990 }
1991 },
1992 "[望]": {
1993 path: "baozi/emjoy-望.png",
1994 url: "https://img.guihuazhi.com/image/hz/73/24/7324a37bc01af2c6dd10fbb0d1c71f8bv64x64.png",
1995 size: 4336,
1996 extra: {
1997 format: "png",
1998 width: 64,
1999 height: 64
2000 }
2001 },
2002 "[鲜花]": {
2003 path: "baozi/emjoy-鲜花.png",
2004 url: "https://img.guihuazhi.com/image/hz/b6/15/b61511a3a54294493221244af6aee259v64x64.png",
2005 size: 3851,
2006 extra: {
2007 format: "png",
2008 width: 64,
2009 height: 64
2010 }
2011 },
2012 "[招呼]": {
2013 path: "baozi/emjoy-招呼.png",
2014 url: "https://img.guihuazhi.com/image/hz/65/e3/65e36b358ab7da9dae5d33830be5f8c0v64x64.png",
2015 size: 4926,
2016 extra: {
2017 format: "png",
2018 width: 64,
2019 height: 64
2020 }
2021 },
2022 "[心跳]": {
2023 path: "baozi/emjoy-心跳.png",
2024 url: "https://img.guihuazhi.com/image/hz/dd/9a/dd9a2aed589dcf23150e91fd3aef0266v64x64.png",
2025 size: 2621,
2026 extra: {
2027 format: "png",
2028 width: 64,
2029 height: 64
2030 }
2031 },
2032 "[YEAH]": {
2033 path: "baozi/emjoy-YEAH.png",
2034 url: "https://img.guihuazhi.com/image/hz/62/89/62895cb504e98777570512624f0af4a1v64x64.png",
2035 size: 4643,
2036 extra: {
2037 format: "png",
2038 width: 64,
2039 height: 64
2040 }
2041 },
2042 "[色眯眯]": {
2043 path: "baozi/emjoy-色眯眯.png",
2044 url: "https://img.guihuazhi.com/image/hz/48/45/4845befe545d23876f63e58337c8d247v64x64.png",
2045 size: 5094,
2046 extra: {
2047 format: "png",
2048 width: 64,
2049 height: 64
2050 }
2051 },
2052 "[委屈]": {
2053 path: "baozi/emjoy-委屈.png",
2054 url: "https://img.guihuazhi.com/image/hz/54/dd/54ddeafc73887aae0e57b5632a7c657ev64x64.png",
2055 size: 5216,
2056 extra: {
2057 format: "png",
2058 width: 64,
2059 height: 64
2060 }
2061 },
2062 "[眨眼]": {
2063 path: "baozi/emjoy-眨眼.png",
2064 url: "https://img.guihuazhi.com/image/hz/c7/3d/c73d26c5288c9e8892b5b99f9c569d6ev64x64.png",
2065 size: 4870,
2066 extra: {
2067 format: "png",
2068 width: 64,
2069 height: 64
2070 }
2071 },
2072 "[超人]": {
2073 path: "baozi/emjoy-超人.png",
2074 url: "https://img.guihuazhi.com/image/hz/d6/30/d630613c6d04cc96fe69deb1cfdc9dfbv64x64.png",
2075 size: 6140,
2076 extra: {
2077 format: "png",
2078 width: 64,
2079 height: 64
2080 }
2081 },
2082 "[无语]": {
2083 path: "baozi/emjoy-无语.png",
2084 url: "https://img.guihuazhi.com/image/hz/1c/e8/1ce8040edaa53cf62125992dfb4f809av64x64.png",
2085 size: 4595,
2086 extra: {
2087 format: "png",
2088 width: 64,
2089 height: 64
2090 }
2091 },
2092 "[亲]": {
2093 path: "baozi/emjoy-亲.png",
2094 url: "https://img.guihuazhi.com/image/hz/8c/d2/8cd2afab975c05d3f3032edebd51bbecv64x64.png",
2095 size: 4212,
2096 extra: {
2097 format: "png",
2098 width: 64,
2099 height: 64
2100 }
2101 },
2102 "[送花]": {
2103 path: "baozi/emjoy-送花.png",
2104 url: "https://img.guihuazhi.com/image/hz/26/a7/26a72e449320a256da34208fcc22b8c9v64x64.png",
2105 size: 4979,
2106 extra: {
2107 format: "png",
2108 width: 64,
2109 height: 64
2110 }
2111 },
2112 "[鄙视你]": {
2113 path: "baozi/emjoy-鄙视.png",
2114 url: "https://img.guihuazhi.com/image/hz/5b/39/5b398b001f3a04f08c981b85c8f0656cv64x64.png",
2115 size: 4681,
2116 extra: {
2117 format: "png",
2118 width: 64,
2119 height: 64
2120 }
2121 },
2122 "[敲死你]": {
2123 path: "baozi/emjoy-敲死你.png",
2124 url: "https://img.guihuazhi.com/image/hz/e5/cc/e5cc14f7a9f4541bde668bb464504004v64x64.png",
2125 size: 5008,
2126 extra: {
2127 format: "png",
2128 width: 64,
2129 height: 64
2130 }
2131 },
2132 "[飞吻]": {
2133 path: "baozi/emjoy-飞吻.png",
2134 url: "https://img.guihuazhi.com/image/hz/27/11/27118e2567041c571d2cd1e172973cc7v64x64.png",
2135 size: 5297,
2136 extra: {
2137 format: "png",
2138 width: 64,
2139 height: 64
2140 }
2141 },
2142 "[好棒]": {
2143 path: "baozi/emjoy-好棒.png",
2144 url: "https://img.guihuazhi.com/image/hz/40/70/4070f5751ad5b0f08ffe6486ba417032v64x64.png",
2145 size: 4715,
2146 extra: {
2147 format: "png",
2148 width: 64,
2149 height: 64
2150 }
2151 },
2152 "[擦汗]": {
2153 path: "baozi/emjoy-擦汗.png",
2154 url: "https://img.guihuazhi.com/image/hz/3b/e8/3be8fcc14aa0233d43d9783ab961ee61v64x64.png",
2155 size: 4743,
2156 extra: {
2157 format: "png",
2158 width: 64,
2159 height: 64
2160 }
2161 },
2162 "[笑]": {
2163 path: "baozi/emjoy-笑.png",
2164 url: "https://img.guihuazhi.com/image/hz/c6/20/c620f03514d2c8c05e20417e0e9087abv64x64.png",
2165 size: 4827,
2166 extra: {
2167 format: "png",
2168 width: 64,
2169 height: 64
2170 }
2171 },
2172 "[白眼你]": {
2173 path: "baozi/emjoy-白眼.png",
2174 url: "https://img.guihuazhi.com/image/hz/06/2a/062a5f697e6beca419411f5f09d89758v64x64.png",
2175 size: 4302,
2176 extra: {
2177 format: "png",
2178 width: 64,
2179 height: 64
2180 }
2181 },
2182 "[睡着]": {
2183 path: "baozi/emjoy-睡着.png",
2184 url: "https://img.guihuazhi.com/image/hz/7f/be/7fbe368bc47e21776a2d6df8e4068098v64x64.png",
2185 size: 4960,
2186 extra: {
2187 format: "png",
2188 width: 64,
2189 height: 64
2190 }
2191 },
2192 "[不要]": {
2193 path: "baozi/emjoy-不要.png",
2194 url: "https://img.guihuazhi.com/image/hz/80/1c/801c3e81183c35bfc422e81840ac1ecav64x64.png",
2195 size: 4895,
2196 extra: {
2197 format: "png",
2198 width: 64,
2199 height: 64
2200 }
2201 },
2202 "[震惊]": {
2203 path: "baozi/emjoy-震惊.png",
2204 url: "https://img.guihuazhi.com/image/hz/e6/83/e6831e8d17570632b0ac8378b5eec126v64x64.png",
2205 size: 4719,
2206 extra: {
2207 format: "png",
2208 width: 64,
2209 height: 64
2210 }
2211 },
2212 "[你闭嘴]": {
2213 path: "baozi/emjoy-闭嘴.png",
2214 url: "https://img.guihuazhi.com/image/hz/6a/bc/6abcf5968d2071449c6badc10e985c97v64x64.png",
2215 size: 5114,
2216 extra: {
2217 format: "png",
2218 width: 64,
2219 height: 64
2220 }
2221 },
2222 "[很开心]": {
2223 path: "baozi/emjoy-开心.png",
2224 url: "https://img.guihuazhi.com/image/hz/49/78/49789caaab6d77bbfade89c36bdf035dv64x64.png",
2225 size: 4645,
2226 extra: {
2227 format: "png",
2228 width: 64,
2229 height: 64
2230 }
2231 },
2232 "[找死]": {
2233 path: "baozi/emjoy-找死.png",
2234 url: "https://img.guihuazhi.com/image/hz/32/93/3293d2021375bce4c8e5396b4389e18ev64x64.png",
2235 size: 5042,
2236 extra: {
2237 format: "png",
2238 width: 64,
2239 height: 64
2240 }
2241 },
2242 "[吆喝]": {
2243 path: "baozi/emjoy-吆喝.png",
2244 url: "https://img.guihuazhi.com/image/hz/ef/70/ef704a7456b786926c0e05363bf55f3dv64x64.png",
2245 size: 4920,
2246 extra: {
2247 format: "png",
2248 width: 64,
2249 height: 64
2250 }
2251 },
2252 "[恩恩]": {
2253 path: "baozi/emjoy-恩恩.png",
2254 url: "https://img.guihuazhi.com/image/hz/1b/89/1b89ea4f8b80b5e833dc3d10248d64fbv64x64.png",
2255 size: 4441,
2256 extra: {
2257 format: "png",
2258 width: 64,
2259 height: 64
2260 }
2261 },
2262 "[偷笑]": {
2263 path: "baozi/emjoy-偷笑.png",
2264 url: "https://img.guihuazhi.com/image/hz/71/6c/716c8524441c7f86d47f2dda9cbb9326v64x64.png",
2265 size: 4664,
2266 extra: {
2267 format: "png",
2268 width: 64,
2269 height: 64
2270 }
2271 },
2272 "[嘿嘿]": {
2273 path: "baozi/emjoy-嘿嘿.png",
2274 url: "https://img.guihuazhi.com/image/hz/93/91/9391104836222ea5cbdb1fa1788da78fv64x64.png",
2275 size: 5491,
2276 extra: {
2277 format: "png",
2278 width: 64,
2279 height: 64
2280 }
2281 },
2282 "[凶]": {
2283 path: "baozi/emjoy-凶.png",
2284 url: "https://img.guihuazhi.com/image/hz/77/61/7761acca1c11288106b39c747f4d2b96v64x64.png",
2285 size: 4791,
2286 extra: {
2287 format: "png",
2288 width: 64,
2289 height: 64
2290 }
2291 },
2292 "[色色地]": {
2293 path: "baozi/emjoy-色色地.png",
2294 url: "https://img.guihuazhi.com/image/hz/4a/22/4a22c81918e7c6ff94d7025f20f074e8v64x64.png",
2295 size: 5505,
2296 extra: {
2297 format: "png",
2298 width: 64,
2299 height: 64
2300 }
2301 },
2302 "[呼噜]": {
2303 path: "baozi/emjoy-呼噜.png",
2304 url: "https://img.guihuazhi.com/image/hz/93/a7/93a7e0afa57e46b72332b5d1dd4dc672v64x64.png",
2305 size: 4393,
2306 extra: {
2307 format: "png",
2308 width: 64,
2309 height: 64
2310 }
2311 },
2312 "[挑衅]": {
2313 path: "baozi/emjoy-挑衅.png",
2314 url: "https://img.guihuazhi.com/image/hz/5e/ca/5eca8ce7a7a7d8803ce37ab27c72e8c7v64x64.png",
2315 size: 4844,
2316 extra: {
2317 format: "png",
2318 width: 64,
2319 height: 64
2320 }
2321 },
2322 "[自转]": {
2323 path: "baozi/emjoy-自转.png",
2324 url: "https://img.guihuazhi.com/image/hz/3e/dd/3edd58fe54f1b1be9d74504818e74be8v64x64.png",
2325 size: 4255,
2326 extra: {
2327 format: "png",
2328 width: 64,
2329 height: 64
2330 }
2331 },
2332 "[猪]": {
2333 path: "baozi/emjoy-猪.png",
2334 url: "https://img.guihuazhi.com/image/hz/b0/46/b046909cdd98f2e5fe018dff5a88b555v64x64.png",
2335 size: 5309,
2336 extra: {
2337 format: "png",
2338 width: 64,
2339 height: 64
2340 }
2341 },
2342 "[困了]": {
2343 path: "baozi/emjoy-困.png",
2344 url: "https://img.guihuazhi.com/image/hz/f2/d2/f2d287b2c60984486429b716c5ebf1c8v64x64.png",
2345 size: 5342,
2346 extra: {
2347 format: "png",
2348 width: 64,
2349 height: 64
2350 }
2351 },
2352 "[骂]": {
2353 path: "baozi/emjoy-骂.png",
2354 url: "https://img.guihuazhi.com/image/hz/07/10/07108da97afa2270cba0d7601c378c90v64x64.png",
2355 size: 5196,
2356 extra: {
2357 format: "png",
2358 width: 64,
2359 height: 64
2360 }
2361 },
2362 "[不行]": {
2363 path: "baozi/emjoy-不行.png",
2364 url: "https://img.guihuazhi.com/image/hz/4a/d3/4ad3961fb0f3fd5717c8c134c1872336v64x64.png",
2365 size: 4388,
2366 extra: {
2367 format: "png",
2368 width: 64,
2369 height: 64
2370 }
2371 },
2372 "[鼓掌]": {
2373 path: "baozi/emjoy-鼓掌.png",
2374 url: "https://img.guihuazhi.com/image/hz/5c/7c/5c7cc145f650389fe87f44db2df68aeev64x64.png",
2375 size: 4776,
2376 extra: {
2377 format: "png",
2378 width: 64,
2379 height: 64
2380 }
2381 },
2382 "[挖鼻孔]": {
2383 path: "baozi/emjoy-挖鼻孔.png",
2384 url: "https://img.guihuazhi.com/image/hz/59/a0/59a08ddfea1f8d9a50bdbd0892256abev64x64.png",
2385 size: 4532,
2386 extra: {
2387 format: "png",
2388 width: 64,
2389 height: 64
2390 }
2391 },
2392 "[问号]": {
2393 path: "baozi/emjoy-问号.png",
2394 url: "https://img.guihuazhi.com/image/hz/93/0c/930c4ffd65c70ccd1170d54168b3c345v64x64.png",
2395 size: 5442,
2396 extra: {
2397 format: "png",
2398 width: 64,
2399 height: 64
2400 }
2401 },
2402 "[翻滚]": {
2403 path: "baozi/emjoy-翻滚.png",
2404 url: "https://img.guihuazhi.com/image/hz/99/55/99550b55b88603da86b91bd92afdef6bv64x64.png",
2405 size: 4404,
2406 extra: {
2407 format: "png",
2408 width: 64,
2409 height: 64
2410 }
2411 },
2412 "[红牌]": {
2413 path: "baozi/emjoy-红牌.png",
2414 url: "https://img.guihuazhi.com/image/hz/8d/9c/8d9cad073bf6e0fbed169099a1c28566v64x64.png",
2415 size: 4390,
2416 extra: {
2417 format: "png",
2418 width: 64,
2419 height: 64
2420 }
2421 },
2422 "[哭闹]": {
2423 path: "baozi/emjoy-哭闹.png",
2424 url: "https://img.guihuazhi.com/image/hz/47/6b/476b73654b30b2a8cb9ea796287deb0av64x64.png",
2425 size: 5479,
2426 extra: {
2427 format: "png",
2428 width: 64,
2429 height: 64
2430 }
2431 },
2432 "[路过]": {
2433 path: "baozi/emjoy-路过.png",
2434 url: "https://img.guihuazhi.com/image/hz/0e/b3/0eb350c7b1bddc516fc3e3b750047bc0v64x64.png",
2435 size: 5660,
2436 extra: {
2437 format: "png",
2438 width: 64,
2439 height: 64
2440 }
2441 },
2442 "[怒吼]": {
2443 path: "baozi/emjoy-怒吼.png",
2444 url: "https://img.guihuazhi.com/image/hz/1f/53/1f53c920f7e8e6129aa9432aa5f926e3v64x64.png",
2445 size: 5396,
2446 extra: {
2447 format: "png",
2448 width: 64,
2449 height: 64
2450 }
2451 },
2452 "[嘲笑]": {
2453 path: "baozi/emjoy-嘲笑.png",
2454 url: "https://img.guihuazhi.com/image/hz/9a/7b/9a7b09f98ef03b62bca4d416c9d3ddfev64x64.png",
2455 size: 5429,
2456 extra: {
2457 format: "png",
2458 width: 64,
2459 height: 64
2460 }
2461 },
2462 "[飘过]": {
2463 path: "baozi/emjoy-飘过.png",
2464 url: "https://img.guihuazhi.com/image/hz/d0/63/d0631ab1b36b4f182d06093f9dfb582bv64x64.png",
2465 size: 4668,
2466 extra: {
2467 format: "png",
2468 width: 64,
2469 height: 64
2470 }
2471 },
2472 "[扇扇子]": {
2473 path: "baozi/emjoy-扇扇子.png",
2474 url: "https://img.guihuazhi.com/image/hz/5f/29/5f299c9d356e090898ce08116c7a4544v64x64.png",
2475 size: 5340,
2476 extra: {
2477 format: "png",
2478 width: 64,
2479 height: 64
2480 }
2481 },
2482 "[狂暴]": {
2483 path: "baozi/emjoy-狂暴.png",
2484 url: "https://img.guihuazhi.com/image/hz/19/b1/19b19674d569dbe681a3975245b3047fv64x64.png",
2485 size: 5834,
2486 extra: {
2487 format: "png",
2488 width: 64,
2489 height: 64
2490 }
2491 },
2492 "[拽]": {
2493 path: "baozi/emjoy-拽.png",
2494 url: "https://img.guihuazhi.com/image/hz/af/e6/afe6b79595f1a44fcb6a8f36809d0f45v64x64.png",
2495 size: 4842,
2496 extra: {
2497 format: "png",
2498 width: 64,
2499 height: 64
2500 }
2501 },
2502 "[真爱]": {
2503 path: "baozi/emjoy-真爱.png",
2504 url: "https://img.guihuazhi.com/image/hz/9f/75/9f757c37b05ac6999a397c36f2ffe446v64x64.png",
2505 size: 4942,
2506 extra: {
2507 format: "png",
2508 width: 64,
2509 height: 64
2510 }
2511 },
2512 "[亮瞎]": {
2513 path: "baozi/emjoy-亮瞎.png",
2514 url: "https://img.guihuazhi.com/image/hz/91/79/917982eaab84c5681196b97a1a14ff78v64x64.png",
2515 size: 4312,
2516 extra: {
2517 format: "png",
2518 width: 64,
2519 height: 64
2520 }
2521 },
2522 "[吐]": {
2523 path: "baozi/emjoy-吐.png",
2524 url: "https://img.guihuazhi.com/image/hz/4c/12/4c12f13b64ce04c0d2501b119c2b5076v64x64.png",
2525 size: 4634,
2526 extra: {
2527 format: "png",
2528 width: 64,
2529 height: 64
2530 }
2531 },
2532 "[拍拍头]": {
2533 path: "baozi/emjoy-拍拍头.png",
2534 url: "https://img.guihuazhi.com/image/hz/d3/f7/d3f711bff015f336f2fe731c8ff4a3d7v64x64.png",
2535 size: 5684,
2536 extra: {
2537 format: "png",
2538 width: 64,
2539 height: 64
2540 }
2541 },
2542 "[很愤怒]": {
2543 path: "baozi/emjoy-愤怒.png",
2544 url: "https://img.guihuazhi.com/image/hz/f5/bd/f5bd9bf217272c8cdc63a9d8b7b92168v64x64.png",
2545 size: 4724,
2546 extra: {
2547 format: "png",
2548 width: 64,
2549 height: 64
2550 }
2551 },
2552 "[不屑]": {
2553 path: "baozi/emjoy-不屑.png",
2554 url: "https://img.guihuazhi.com/image/hz/21/b6/21b616be233ead2c7fa4630bc6d59534v64x64.png",
2555 size: 4489,
2556 extra: {
2557 format: "png",
2558 width: 64,
2559 height: 64
2560 }
2561 },
2562 "[思考]": {
2563 path: "baozi/emjoy-思考.png",
2564 url: "https://img.guihuazhi.com/image/hz/da/f0/daf01c4ffc8c097c351d9257992a065fv64x64.png",
2565 size: 5280,
2566 extra: {
2567 format: "png",
2568 width: 64,
2569 height: 64
2570 }
2571 },
2572 "[吃萝卜]": {
2573 path: "baozi/emjoy-吃萝卜.png",
2574 url: "https://img.guihuazhi.com/image/hz/88/b8/88b805601afc3b6cf848c9a3f2ed6ac2v64x64.png",
2575 size: 5483,
2576 extra: {
2577 format: "png",
2578 width: 64,
2579 height: 64
2580 }
2581 },
2582 "[领悟]": {
2583 path: "baozi/emjoy-领悟.png",
2584 url: "https://img.guihuazhi.com/image/hz/db/9c/db9c0fb724a51b45ca50a30e0a5aceb2v64x64.png",
2585 size: 5163,
2586 extra: {
2587 format: "png",
2588 width: 64,
2589 height: 64
2590 }
2591 },
2592 "[不好意思]": {
2593 path: "baozi/emjoy-不好意思.png",
2594 url: "https://img.guihuazhi.com/image/hz/0d/80/0d809d00308faf23430dfbde83b150cev64x64.png",
2595 size: 4845,
2596 extra: {
2597 format: "png",
2598 width: 64,
2599 height: 64
2600 }
2601 },
2602 "[平常心]": {
2603 path: "face/emjoy-平常心.png",
2604 url: "https://img.guihuazhi.com/image/hz/8c/a5/8ca59a7a58427bc539fc80b12b258c97v64x64.png",
2605 size: 5169,
2606 extra: {
2607 format: "png",
2608 width: 64,
2609 height: 64
2610 }
2611 },
2612 "[无趣]": {
2613 path: "face/emjoy-无趣.png",
2614 url: "https://img.guihuazhi.com/image/hz/e0/d9/e0d9296d0b98e3609612fde62992dc88v64x64.png",
2615 size: 5265,
2616 extra: {
2617 format: "png",
2618 width: 64,
2619 height: 64
2620 }
2621 },
2622 "[色]": {
2623 path: "face/emjoy-色.png",
2624 url: "https://img.guihuazhi.com/image/hz/7a/8c/7a8c7d606cc04871b3902aac704b4e53v64x64.png",
2625 size: 6612,
2626 extra: {
2627 format: "png",
2628 width: 64,
2629 height: 64
2630 }
2631 },
2632 "[酷]": {
2633 path: "face/emjoy-酷.png",
2634 url: "https://img.guihuazhi.com/image/hz/a3/1b/a31bf3fb6a18467844a749f2191eb347v64x64.png",
2635 size: 5259,
2636 extra: {
2637 format: "png",
2638 width: 64,
2639 height: 64
2640 }
2641 },
2642 "[发呆]": {
2643 path: "face/emjoy-发呆.png",
2644 url: "https://img.guihuazhi.com/image/hz/df/ef/dfef50f2db2df97a9d4fcfd5e182cd25v64x64.png",
2645 size: 5559,
2646 extra: {
2647 format: "png",
2648 width: 64,
2649 height: 64
2650 }
2651 },
2652 "[流泪]": {
2653 path: "face/emjoy-流泪.png",
2654 url: "https://img.guihuazhi.com/image/hz/eb/34/eb349d6d71ec644f38e99715f2bdf1f8v64x64.png",
2655 size: 5594,
2656 extra: {
2657 format: "png",
2658 width: 64,
2659 height: 64
2660 }
2661 },
2662 "[坏笑]": {
2663 path: "face/emjoy-坏笑.png",
2664 url: "https://img.guihuazhi.com/image/hz/2a/0a/2a0a0eb3827fa5366b7989d11e768c1cv64x64.png",
2665 size: 5267,
2666 extra: {
2667 format: "png",
2668 width: 64,
2669 height: 64
2670 }
2671 },
2672 "[别理我]": {
2673 path: "face/emjoy-别理我.png",
2674 url: "https://img.guihuazhi.com/image/hz/e7/7a/e77ade1ed275f5d1d225def2f52c7ea5v64x64.png",
2675 size: 5359,
2676 extra: {
2677 format: "png",
2678 width: 64,
2679 height: 64
2680 }
2681 },
2682 "[鄙视]": {
2683 path: "face/emjoy-鄙视.png",
2684 url: "https://img.guihuazhi.com/image/hz/fb/c0/fbc08fb69773ad29bc7c11bc86cb16f6v64x64.png",
2685 size: 5499,
2686 extra: {
2687 format: "png",
2688 width: 64,
2689 height: 64
2690 }
2691 },
2692 "[白眼]": {
2693 path: "face/emjoy-白眼.png",
2694 url: "https://img.guihuazhi.com/image/hz/3a/7d/3a7dbb8d7e84ef0e95c81ce75edfd728v64x64.png",
2695 size: 5352,
2696 extra: {
2697 format: "png",
2698 width: 64,
2699 height: 64
2700 }
2701 },
2702 "[糗大了]": {
2703 path: "face/emjoy-糗大了.png",
2704 url: "https://img.guihuazhi.com/image/hz/8c/e7/8ce7dc9570d687f6fc5c94e249057e02v64x64.png",
2705 size: 5893,
2706 extra: {
2707 format: "png",
2708 width: 64,
2709 height: 64
2710 }
2711 },
2712 "[愤怒]": {
2713 path: "face/emjoy-愤怒.png",
2714 url: "https://img.guihuazhi.com/image/hz/88/c5/88c52cadd197b0d3c4d78575b66aecacv64x64.png",
2715 size: 5892,
2716 extra: {
2717 format: "png",
2718 width: 64,
2719 height: 64
2720 }
2721 },
2722 "[开心]": {
2723 path: "face/emjoy-开心.png",
2724 url: "https://img.guihuazhi.com/image/hz/16/78/1678448ce7c7a888cccdc174b2af1904v64x64.png",
2725 size: 5223,
2726 extra: {
2727 format: "png",
2728 width: 64,
2729 height: 64
2730 }
2731 },
2732 "[抠鼻]": {
2733 path: "face/emjoy-抠鼻.png",
2734 url: "https://img.guihuazhi.com/image/hz/d9/4b/d94b15fcd0b656d8215e7838456e2dc5v64x64.png",
2735 size: 5974,
2736 extra: {
2737 format: "png",
2738 width: 64,
2739 height: 64
2740 }
2741 },
2742 "[惊恐]": {
2743 path: "face/emjoy-惊恐.png",
2744 url: "https://img.guihuazhi.com/image/hz/f6/02/f6020c7607143e0926b12d9cd5b37c10v64x64.png",
2745 size: 5820,
2746 extra: {
2747 format: "png",
2748 width: 64,
2749 height: 64
2750 }
2751 },
2752 "[石化]": {
2753 path: "face/emjoy-石化.png",
2754 url: "https://img.guihuazhi.com/image/hz/60/aa/60aa69303a9f074fb057c456447a8fa3v64x64.png",
2755 size: 4659,
2756 extra: {
2757 format: "png",
2758 width: 64,
2759 height: 64
2760 }
2761 },
2762 "[叹气]": {
2763 path: "face/emjoy-叹气.png",
2764 url: "https://img.guihuazhi.com/image/hz/82/cb/82cbc293f830d5aaa72796c468a3679av64x64.png",
2765 size: 5876,
2766 extra: {
2767 format: "png",
2768 width: 64,
2769 height: 64
2770 }
2771 },
2772 "[衰]": {
2773 path: "face/emjoy-衰.png",
2774 url: "https://img.guihuazhi.com/image/hz/dc/96/dc965db3071274c0c1d567a322676deav64x64.png",
2775 size: 5551,
2776 extra: {
2777 format: "png",
2778 width: 64,
2779 height: 64
2780 }
2781 },
2782 "[疑问]": {
2783 path: "face/emjoy-疑问.png",
2784 url: "https://img.guihuazhi.com/image/hz/f5/a6/f5a6b9b3b5102104562c9887e2d28374v64x64.png",
2785 size: 5778,
2786 extra: {
2787 format: "png",
2788 width: 64,
2789 height: 64
2790 }
2791 },
2792 "[兴奋]": {
2793 path: "face/emjoy-兴奋.png",
2794 url: "https://img.guihuazhi.com/image/hz/7b/e3/7be3cf9927f962ee9f596d00d48ddee2v64x64.png",
2795 size: 6223,
2796 extra: {
2797 format: "png",
2798 width: 64,
2799 height: 64
2800 }
2801 },
2802 "[傲慢]": {
2803 path: "face/emjoy-傲慢.png",
2804 url: "https://img.guihuazhi.com/image/hz/d5/22/d5223164691db6d3e7dc03007e84f282v64x64.png",
2805 size: 5653,
2806 extra: {
2807 format: "png",
2808 width: 64,
2809 height: 64
2810 }
2811 },
2812 "[得意]": {
2813 path: "face/emjoy-得意.png",
2814 url: "https://img.guihuazhi.com/image/hz/55/f1/55f145cf742908ccb670b7aeae8c7cfdv64x64.png",
2815 size: 6549,
2816 extra: {
2817 format: "png",
2818 width: 64,
2819 height: 64
2820 }
2821 },
2822 "[冷汗]": {
2823 path: "face/emjoy-冷汗.png",
2824 url: "https://img.guihuazhi.com/image/hz/5f/1a/5f1aa8089421458c0873805dec747255v64x64.png",
2825 size: 5767,
2826 extra: {
2827 format: "png",
2828 width: 64,
2829 height: 64
2830 }
2831 },
2832 "[天使]": {
2833 path: "face/emjoy-天使.png",
2834 url: "https://img.guihuazhi.com/image/hz/92/cc/92cc1af0df03eb287f891f207c4b1396v64x64.png",
2835 size: 6304,
2836 extra: {
2837 format: "png",
2838 width: 64,
2839 height: 64
2840 }
2841 },
2842 "[大哭]": {
2843 path: "face/emjoy-大哭.png",
2844 url: "https://img.guihuazhi.com/image/hz/7e/72/7e72b376fdc5ac4fcee2af225c1a0b9fv64x64.png",
2845 size: 6575,
2846 extra: {
2847 format: "png",
2848 width: 64,
2849 height: 64
2850 }
2851 },
2852 "[打脸]": {
2853 path: "face/emjoy-打脸.png",
2854 url: "https://img.guihuazhi.com/image/hz/ae/ab/aeab96044342108d821e98aadb2956ebv64x64.png",
2855 size: 6279,
2856 extra: {
2857 format: "png",
2858 width: 64,
2859 height: 64
2860 }
2861 },
2862 "[敬佩]": {
2863 path: "face/emjoy-敬佩.png",
2864 url: "https://img.guihuazhi.com/image/hz/58/a2/58a24c0fe38ae7143bb04e10c9929793v64x64.png",
2865 size: 6444,
2866 extra: {
2867 format: "png",
2868 width: 64,
2869 height: 64
2870 }
2871 },
2872 "[咒骂]": {
2873 path: "face/emjoy-咒骂.png",
2874 url: "https://img.guihuazhi.com/image/hz/7f/87/7f87183a0e4a9af49f5cbd3cbe87e8eev64x64.png",
2875 size: 6546,
2876 extra: {
2877 format: "png",
2878 width: 64,
2879 height: 64
2880 }
2881 },
2882 "[嘘]": {
2883 path: "face/emjoy-嘘.png",
2884 url: "https://img.guihuazhi.com/image/hz/d9/ff/d9ff83b65797aa08d0d51f4bee985e25v64x64.png",
2885 size: 6100,
2886 extra: {
2887 format: "png",
2888 width: 64,
2889 height: 64
2890 }
2891 },
2892 "[冲]": {
2893 path: "face/emjoy-冲.png",
2894 url: "https://img.guihuazhi.com/image/hz/9b/1d/9b1d95f25c257af5f0e0f6ee5c8dd8fbv64x64.png",
2895 size: 6444,
2896 extra: {
2897 format: "png",
2898 width: 64,
2899 height: 64
2900 }
2901 },
2902 "[尴尬]": {
2903 path: "face/emjoy-尴尬.png",
2904 url: "https://img.guihuazhi.com/image/hz/61/d3/61d3da3918898932dcc435c9b1d3083av64x64.png",
2905 size: 5847,
2906 extra: {
2907 format: "png",
2908 width: 64,
2909 height: 64
2910 }
2911 },
2912 "[伤不起]": {
2913 path: "face/emjoy-伤不起.png",
2914 url: "https://img.guihuazhi.com/image/hz/29/89/2989e7e4d558cd763c85d995aa8c0bd7v64x64.png",
2915 size: 6350,
2916 extra: {
2917 format: "png",
2918 width: 64,
2919 height: 64
2920 }
2921 },
2922 "[撇嘴]": {
2923 path: "face/emjoy-撇嘴.png",
2924 url: "https://img.guihuazhi.com/image/hz/62/db/62db4738d5a54028a382f44e8a132b00v64x64.png",
2925 size: 5911,
2926 extra: {
2927 format: "png",
2928 width: 64,
2929 height: 64
2930 }
2931 },
2932 "[憨笑]": {
2933 path: "face/emjoy-憨笑.png",
2934 url: "https://img.guihuazhi.com/image/hz/23/cb/23cb04762579f9913f0183be5b5cc5d7v64x64.png",
2935 size: 5467,
2936 extra: {
2937 format: "png",
2938 width: 64,
2939 height: 64
2940 }
2941 },
2942 "[难过]": {
2943 path: "face/emjoy-难过.png",
2944 url: "https://img.guihuazhi.com/image/hz/6b/d6/6bd6673be270329d309b31b5e39b2c35v64x64.png",
2945 size: 5764,
2946 extra: {
2947 format: "png",
2948 width: 64,
2949 height: 64
2950 }
2951 },
2952 "[困]": {
2953 path: "face/emjoy-困.png",
2954 url: "https://img.guihuazhi.com/image/hz/c4/67/c467ca3d60a10d55b13026c49ba86d7bv64x64.png",
2955 size: 5387,
2956 extra: {
2957 format: "png",
2958 width: 64,
2959 height: 64
2960 }
2961 },
2962 "[调皮]": {
2963 path: "face/emjoy-调皮.png",
2964 url: "https://img.guihuazhi.com/image/hz/19/a8/19a80696bf7c68a9c95aa3990c0177f6v64x64.png",
2965 size: 6517,
2966 extra: {
2967 format: "png",
2968 width: 64,
2969 height: 64
2970 }
2971 },
2972 "[奋斗]": {
2973 path: "face/emjoy-奋斗.png",
2974 url: "https://img.guihuazhi.com/image/hz/bb/d2/bbd21c056a793a1d9365d0192d26be36v64x64.png",
2975 size: 6832,
2976 extra: {
2977 format: "png",
2978 width: 64,
2979 height: 64
2980 }
2981 },
2982 "[再见]": {
2983 path: "face/emjoy-再见.png",
2984 url: "https://img.guihuazhi.com/image/hz/34/54/3454379bb9658cf9b319d567e133bbaev64x64.png",
2985 size: 5702,
2986 extra: {
2987 format: "png",
2988 width: 64,
2989 height: 64
2990 }
2991 },
2992 "[可怜]": {
2993 path: "face/emjoy-可怜.png",
2994 url: "https://img.guihuazhi.com/image/hz/e6/7c/e67c01fe0363c81e00b24d13efb88337v64x64.png",
2995 size: 6174,
2996 extra: {
2997 format: "png",
2998 width: 64,
2999 height: 64
3000 }
3001 },
3002 "[折磨]": {
3003 path: "face/emjoy-折磨.png",
3004 url: "https://img.guihuazhi.com/image/hz/56/92/5692711958868348b47138dfd1b0883ev64x64.png",
3005 size: 6439,
3006 extra: {
3007 format: "png",
3008 width: 64,
3009 height: 64
3010 }
3011 },
3012 "[闭嘴]": {
3013 path: "face/emjoy-闭嘴.png",
3014 url: "https://img.guihuazhi.com/image/hz/e4/7f/e47fb51a6158cf9cb69c4cabbda39ecfv64x64.png",
3015 size: 5845,
3016 extra: {
3017 format: "png",
3018 width: 64,
3019 height: 64
3020 }
3021 },
3022 "[恶心]": {
3023 path: "face/emjoy-恶心.png",
3024 url: "https://img.guihuazhi.com/image/hz/e0/d2/e0d23ce71c4de57f8d05e2f0bf42a632v64x64.png",
3025 size: 5220,
3026 extra: {
3027 format: "png",
3028 width: 64,
3029 height: 64
3030 }
3031 },
3032 "[快哭了]": {
3033 path: "face/emjoy-快哭了.png",
3034 url: "https://img.guihuazhi.com/image/hz/d4/7c/d47ce311e43b3783c4760d889e57f8dfv64x64.png",
3035 size: 5812,
3036 extra: {
3037 format: "png",
3038 width: 64,
3039 height: 64
3040 }
3041 },
3042 "[晕]": {
3043 path: "face/emjoy-晕.png",
3044 url: "https://img.guihuazhi.com/image/hz/f4/4d/f44d222f7efa39156bd4b1393e0a6244v64x64.png",
3045 size: 6848,
3046 extra: {
3047 format: "png",
3048 width: 64,
3049 height: 64
3050 }
3051 },
3052 "[砸头]": {
3053 path: "face/emjoy-砸头.png",
3054 url: "https://img.guihuazhi.com/image/hz/ea/16/ea16caf9f766961ace3480eb1a919d66v64x64.png",
3055 size: 6106,
3056 extra: {
3057 format: "png",
3058 width: 64,
3059 height: 64
3060 }
3061 },
3062 "[求带]": {
3063 path: "face/emjoy-求带.png",
3064 url: "https://img.guihuazhi.com/image/hz/44/b8/44b8c0218b74f1097b807dc8675d4e1bv64x64.png",
3065 size: 6194,
3066 extra: {
3067 format: "png",
3068 width: 64,
3069 height: 64
3070 }
3071 },
3072 "[惊讶]": {
3073 path: "face/emjoy-惊讶.png",
3074 url: "https://img.guihuazhi.com/image/hz/e0/08/e008246dedfe9cab397930193fb14dc4v64x64.png",
3075 size: 5624,
3076 extra: {
3077 format: "png",
3078 width: 64,
3079 height: 64
3080 }
3081 },
3082 "[睡觉]": {
3083 path: "face/emjoy-睡觉.png",
3084 url: "https://img.guihuazhi.com/image/hz/72/50/7250644d613fdf7a2eaecc72f4014527v64x64.png",
3085 size: 5526,
3086 extra: {
3087 format: "png",
3088 width: 64,
3089 height: 64
3090 }
3091 }
3092 };
3093
3094 /**
3095 * @type {boolean} 是否开发环境
3096 */
3097
3098 var isDev = false;
3099 /**
3100 * @type {boolean} 是是否服务端渲染
3101 */
3102
3103 var isSSR = false;
3104
3105 try {
3106 isDev = process.env && process.env.NODE_ENV === 'development';
3107 isSSR = process.env && process.env.VUE_ENV === 'server';
3108 } catch (e) {} //
3109
3110 /**
3111 * @type {Regexp} 判断是否合法图片
3112 */
3113
3114
3115 var validImageRegexp = /^(http|https):\/\/(imgtest|img)\.guihuazhi\.com\/[A-z0-9/.]*?$/;
3116 /**
3117 * @type {Regexp} 表情校验
3118 */
3119
3120 var validEmoji = /(\[[\u4e00-\u9fa5]{1,4}\])/g;
3121
3122 var Parse =
3123 /*#__PURE__*/
3124 function () {
3125 function Parse(option) {
3126 this.platform = option.platform;
3127 }
3128
3129 var _proto = Parse.prototype;
3130
3131 _proto.createElement = function createElement(d) {
3132 var _this = this;
3133
3134 if (isObject$1(d)) {
3135 var tag = d.tag,
3136 _d$attrs = d.attrs,
3137 attrs = _d$attrs === void 0 ? {} : _d$attrs,
3138 _d$child = d.child,
3139 child = _d$child === void 0 ? [] : _d$child,
3140 props = d.props,
3141 content = d.content;
3142 var node = document.createElement(tag);
3143 Object.keys(attrs).forEach(function (key) {
3144 node.setAttribute(key, attrs[key]);
3145 });
3146
3147 if (tag === 'img') {
3148 node = this.renderImageDom(props, attrs);
3149 }
3150
3151 if (tag === 'a') {
3152 node = this.renderLinkDom(props);
3153 }
3154
3155 if (content) {
3156 node.innerHTML = content;
3157 } else {
3158 child.forEach(function (c) {
3159 node.appendChild(_this.createElement(c));
3160 });
3161 }
3162
3163 return node;
3164 } else if (typeof d === 'string') {
3165 return document.createTextNode(d);
3166 }
3167 };
3168
3169 _proto.reset = function reset() {
3170 this.unbindImageEvents && this.unbindImageEvents();
3171 } // 懒加载图片
3172 ;
3173
3174 _proto.bindImageLazyLoad = function bindImageLazyLoad() {
3175 var _this2 = this;
3176
3177 this.clientHeight = window.screen.height;
3178 this.unbindImageEvents = addEvent(window, 'scroll', this.loadImageFunc.bind(this));
3179 setTimeout(function () {
3180 // 初始化时加载一次图片
3181 _this2.loadImageFunc();
3182 }, 0);
3183 } // 取消懒加载图片
3184 ;
3185
3186 _proto.unbindImageLazyLoad = function unbindImageLazyLoad() {
3187 this.unbindImageEvents();
3188 };
3189
3190 _proto.loadImageFunc = function loadImageFunc() {
3191 var _this3 = this;
3192
3193 (this.imageDoc = this.imageDoc || document.querySelectorAll(".huazhi.huazhi-" + this.platform + " img")).forEach(function (el) {
3194 if (el.getAttribute('src')) return;
3195 var src = el.dataset.src;
3196 var o = el.getBoundingClientRect();
3197
3198 if (o.top < _this3.clientHeight) {
3199 el.setAttribute('src', src);
3200 el.previousSibling.style.opacity = 0;
3201 }
3202 });
3203 }
3204 /**
3205 * dom-tree => html
3206 * @param {array<object>} tree
3207 */
3208 ;
3209
3210 _proto.renderDomTreeHTML = function renderDomTreeHTML(tree, platform) {
3211 var _this4 = this;
3212
3213 return tree.map(function (block) {
3214 switch (block.tag) {
3215 case 'h2':
3216 return "<h2>" + _this4.renderDomTreeHTML(block.child) + "</h2>";
3217
3218 case 'blockquote':
3219 return "<blockquote>" + _this4.renderDomTreeHTML(block.child) + "</blockquote>";
3220
3221 case 'p':
3222 return "<p>" + _this4.renderDomTreeHTML(block.child) + "</p>";
3223
3224 case 'b':
3225 return "<b>" + block.content + "</b>";
3226
3227 case 'i':
3228 return "<i style=\"background-image: url(" + block.props.url + ")\" emoji=\"" + block.props.emoji + "\"></i>";
3229
3230 case 'img':
3231 return _this4.renderImage(block.props, block.attrs);
3232
3233 case 'video':
3234 return _this4.renderVideo(block.props);
3235
3236 case 'hr':
3237 return '<hr />';
3238
3239 case 'a':
3240 return _this4.renderLink(block.props);
3241 // webview内禁止直接跳转
3242
3243 default:
3244 // 非兼容格式不做显示
3245 return isString(block) ? block : '';
3246 }
3247 }).join('');
3248 } // replaceBlock(block) {
3249 // return block.replace
3250 // }
3251
3252 /**
3253 * 针对web的文本解析处理
3254 * @param {array<object>} json
3255 * @return
3256 */
3257 ;
3258
3259 _proto.jsonToDomTree = function jsonToDomTree(json) {
3260 var results = [];
3261 var imageIndex = 0;
3262
3263 if (typeof json === 'string') {
3264 try {
3265 json = JSON.parse(json);
3266 } catch (e) {
3267 //
3268 return results;
3269 }
3270 }
3271
3272 for (var i = 0, l = json.length; i < l; i++) {
3273 var block = json[i];
3274
3275 if (block.type === 'text') {
3276 var tag = void 0;
3277
3278 if (block.head === 1) {
3279 tag = 'h2';
3280 } else if (block.block === 1) {
3281 tag = 'blockquote';
3282 } else {
3283 tag = 'p';
3284 }
3285
3286 var child = this.parseInline(block.value);
3287 results.push({
3288 tag: tag,
3289 child: child
3290 });
3291 } else if (block.type === 'image' && this.isImage(block)) {
3292 results.push({
3293 tag: 'img',
3294 attrs: {
3295 src: block.url,
3296 index: imageIndex++
3297 },
3298 props: block
3299 });
3300 } else if (block.type === 'line') {
3301 results.push({
3302 tag: 'hr'
3303 });
3304 } else if (block.type === 'video') {
3305 results.push({
3306 tag: 'video',
3307 props: block
3308 });
3309 }
3310 }
3311
3312 return results;
3313 }
3314 /**
3315 * 评论中的文本解析
3316 * @param {string} str 评论文本
3317 * @return {string} html文本
3318 */
3319 ;
3320
3321 _proto.parseComment = function parseComment(str) {
3322 var result = this.parseEmoji(str);
3323 var html = this.renderDomTreeHTML(result, this.platform);
3324 return html;
3325 }
3326 /**
3327 * json => html
3328 * @param {string|array<object>} json 原始json数据 | 数组结构
3329 * @param {string} platform 平台 web | mobile | webview | editor
3330 * @param {HTMLElement} wrapperDom 是否返回document对象
3331 * @param {number} containerWidth 容器宽度
3332 * @return {string|HTMLElement} html字符串/document对象
3333 */
3334 ;
3335
3336 _proto.jsonToHTML = function jsonToHTML(json, wrapperDom, containerWidth) {
3337 if (containerWidth === void 0) {
3338 containerWidth = 0;
3339 }
3340
3341 // json解析
3342 if (typeof json === 'string') {
3343 try {
3344 json = JSON.parse(json);
3345 } catch (e) {
3346 if (isDev) throw new Error('json type error');
3347 return '';
3348 }
3349 }
3350
3351 var tree = this.jsonToDomTree(json); // console.log('tree', JSON.parse(JSON.stringify(tree)))
3352
3353 var html = this.renderDomTreeHTML(tree, this.platform, containerWidth); // ssr环境或者editor直接返回html
3354
3355 if (isSSR || this.platform === 'editor') {
3356 return html;
3357 }
3358
3359 if (wrapperDom) {
3360 wrapperDom.classList.add('huazhi', "huazhi-" + this.platform);
3361 wrapperDom.innerHTML = html;
3362 } // 移动端初始化
3363
3364
3365 if (this.lazyLoad) {
3366 this.bindImageLazyLoad();
3367 }
3368
3369 if (this.initEvents && typeof this.initEvents === 'function') {
3370 this.initEvents();
3371 }
3372
3373 return wrapperDom ? wrapperDom : html;
3374 };
3375
3376 _proto.renderText = function renderText(value) {
3377 var html = '';
3378 var length = value.length;
3379
3380 for (var i = 0; i < length; i++) {
3381 var v = value[i];
3382
3383 if (v.bold) {
3384 html += "<strong>" + v.content + "</strong>";
3385 } else if (v.type === 'link') {
3386 html += "" + this.renderLink(v);
3387 } else {
3388 html += "" + v.content;
3389 }
3390 }
3391
3392 if (length === 0) {
3393 html = '<br>';
3394 }
3395
3396 return html;
3397 };
3398
3399 _proto.renderBlock = function renderBlock(o) {
3400 var classStr = o.center ? "class='ql-align-center'" : '';
3401
3402 if (o.head) {
3403 return "<h2 " + classStr + ">" + this.renderText(o.value) + "</h2>";
3404 } else if (o.block) {
3405 return "<blockquote " + classStr + ">" + this.renderText(o.value) + "</blockquote>";
3406 } else {
3407 return "<p " + classStr + ">" + this.renderText(o.value) + "</p>";
3408 }
3409 };
3410
3411 _proto.renderLine = function renderLine() {
3412 return "<hr />";
3413 };
3414
3415 _proto.renderList = function renderList(o) {
3416 var html = '';
3417 var liList = '';
3418 var length = o.value.length;
3419
3420 for (var i = 0; i < length; i++) {
3421 var v = o.value[i];
3422 liList += "<li>" + this.renderText(v) + "</li>";
3423 }
3424
3425 if (o.type === 'ol') {
3426 html = "<ol>" + liList + "</ol>";
3427 } else if (o.type === 'ul') {
3428 html = "<ul>" + liList + "</ul>";
3429 }
3430
3431 return html;
3432 }
3433 /**
3434 * json => html
3435 * @param {string|array<object>} json 原始json数据 | 数组结构
3436 * @param {string} platform 平台 web | mobile | webview | editor
3437 * @param {HTMLElement} wrapperDom 是否返回document对象
3438 * @param {number} containerWidth 容器宽度
3439 * @return {string|HTMLElement} html字符串/document对象
3440 */
3441 ;
3442
3443 _proto.jsonToHTML2 = function jsonToHTML2(json, wrapperDom, containerWidth) {
3444 if (containerWidth === void 0) {
3445 containerWidth = 0;
3446 }
3447
3448 // json解析
3449 if (typeof json === 'string') {
3450 try {
3451 json = JSON.parse(json);
3452 } catch (e) {
3453 if (isDev) throw new Error('json type error');
3454 return '';
3455 }
3456 } // const renderMap = {
3457 // 'text': this.renderBlock,
3458 // 'line': this.renderLine,
3459 // 'image': this.renderImage,
3460 // 'video': this.renderVideo,
3461 // 'ul': this.renderList,
3462 // 'ol': this.renderList,
3463 // };
3464
3465
3466 var html = '';
3467 var length = json.length;
3468
3469 for (var i = 0; i < length; i++) {
3470 var j = json[i];
3471 var type = j.type;
3472
3473 if (type === 'text') {
3474 html += this.renderBlock(j);
3475 } else if (type === 'line') {
3476 html += this.renderLine(j);
3477 } else if (type === 'image') {
3478 html += this.renderImage(j);
3479 } else if (type === 'video') {
3480 html += this.renderVideo(j);
3481 } else if (type === 'ul' || type === 'ol') {
3482 html += this.renderList(j);
3483 } else {
3484 if (j.content) {
3485 html += "<p>" + json[i].content + "</p>";
3486 }
3487
3488 html += this.renderLine(j);
3489 }
3490 }
3491
3492 if (this.initEvents && typeof this.initEvents === 'function') {
3493 // webview绑定事件
3494 this.initEvents();
3495 }
3496
3497 return html;
3498 }
3499 /**
3500 * 解析表情
3501 * @param {string} 原始文本
3502 * @return {array<object|string>} 表情字符串数组
3503 */
3504 ;
3505
3506 _proto.parseEmoji = function parseEmoji(text) {
3507 if (typeof text !== 'string') return '';
3508 var results = [];
3509 var splitIndex = 0;
3510 var tmp;
3511
3512 while (tmp = validEmoji.exec(text)) {
3513 var _tmp = tmp,
3514 emojiName = _tmp[0],
3515 startIndex = _tmp.index;
3516 var lastIndex = validEmoji.lastIndex; // 若表情存在
3517
3518 if (EMOJIMAP[emojiName]) {
3519 results.push(text.substring(splitIndex, startIndex));
3520 results.push({
3521 tag: 'i',
3522 props: {
3523 emoji: emojiName,
3524 url: EMOJIMAP[emojiName].url
3525 },
3526 attr: {}
3527 }); // 修改下次截取位置
3528
3529 splitIndex = lastIndex;
3530 }
3531 } // 末尾处理
3532
3533
3534 if (splitIndex < text.length) {
3535 results.push(text.substring(splitIndex));
3536 }
3537
3538 return results;
3539 }
3540 /**
3541 * 解析行内文本
3542 * @param {array<object>} 行内文本数组
3543 * @param {string} platform
3544 */
3545 ;
3546
3547 _proto.parseInline = function parseInline(inlineList) {
3548 var results = [];
3549
3550 for (var j = 0, l = inlineList.length; j < l; j++) {
3551 var inline = inlineList[j];
3552
3553 if (inline.type === 'string') {
3554 if (this.platform === 'editor') {
3555 // 编辑器连续换行bug
3556 if (j === inlineList.length - 1) {
3557 if (inline.content.endsWith('\n') || inline.content.endsWith('\r\n')) {
3558 inline.content = inline.content.slice(0, -1);
3559 }
3560 }
3561 }
3562
3563 if (inline.bold === 1) {
3564 // 加粗文本
3565 results.push({
3566 tag: 'b',
3567 attr: {},
3568 content: inline.content
3569 });
3570 } else {
3571 // 纯文本
3572 results.push.apply(results, this.parseEmoji(inline.content));
3573 }
3574 } else if (inline.type === 'link') {
3575 results.push({
3576 tag: 'a',
3577 props: Object.assign({}, inline)
3578 });
3579 }
3580 }
3581
3582 return results;
3583 }
3584 /**
3585 * 校验是否合法图片
3586 * @param {object} image 上传获得image对象
3587 * @return {boolean} 检测结果
3588 */
3589 ;
3590
3591 _proto.isImage = function isImage(image) {
3592 return isObject$1(image) && typeof image.url === 'string' && validImageRegexp.test(image.url);
3593 }
3594 /**
3595 * html => json
3596 * 富文本编辑内容格式化
3597 * @param {string|object} source html字符串/detail结构
3598 * @param {boolean} isOps 是否quill的detail结构
3599 * @param {boolean} isJSonString 是否转为json-string
3600 * @return {array<object>} j
3601 */
3602 ;
3603
3604 _proto.htmlToJSON = function htmlToJSON(source, isOps, isJSonString) {
3605 if (isJSonString === void 0) {
3606 isJSonString = true;
3607 }
3608
3609 if (isUndefined(source) || !isString(source) && !isArray(source)) {
3610 if (isDev) throw new Error('source must be a string type or quill detail');
3611 return isJSonString ? '[]' : [];
3612 }
3613
3614 var results = [];
3615 return results;
3616 };
3617
3618 return Parse;
3619 }();
3620
3621 var getUrlType = function getUrlType(url) {
3622 if (url.includes('guihuazhi.com')) {
3623 if (url.includes('article')) {
3624 return 'article';
3625 } else if (url.includes('topic')) {
3626 return 'topic';
3627 } else {
3628 return 'other';
3629 }
3630 } else {
3631 return 'other';
3632 }
3633 };
3634
3635 var routes = {
3636 article: {
3637 route: '/app/article/detail',
3638 id: 'aid'
3639 },
3640 topic: {
3641 route: '/app/topic/detail',
3642 id: 'topicId'
3643 },
3644 other: {
3645 route: '',
3646 id: 'id'
3647 }
3648 }; // const getClientRoute = (type) => {
3649 //
3650 //
3651 // return o[type]
3652 // };
3653
3654 var getId = function getId(url) {
3655 var str = url.split('?')[0].split('/').pop();
3656 return str.slice(0, -5);
3657 };
3658
3659 var textToJson = function textToJson(element) {
3660 return {
3661 type: 'string',
3662 content: element.nodeValue
3663 };
3664 };
3665
3666 var strongToJson = function strongToJson(element) {
3667 return {
3668 type: 'string',
3669 bold: 1,
3670 content: element.innerText
3671 };
3672 };
3673
3674 var aToJson = function aToJson(element) {
3675 return {
3676 type: 'link',
3677 content: element.innerText,
3678 route: {
3679 webURL: element.href
3680 }
3681 };
3682 };
3683
3684 var getValue = function getValue(element) {
3685 var elementList = element.childNodes;
3686 var length = elementList.length;
3687 var value = [];
3688
3689 for (var i = 0; i < length; i++) {
3690 var _element = elementList[i];
3691 var elementType = _element.nodeName;
3692 var func = elementListToJsonMap[elementType];
3693
3694 if (func) {
3695 var result = func(_element);
3696 value.push(result);
3697 }
3698 }
3699
3700 return value;
3701 };
3702
3703 var blockElementToJson = function blockElementToJson(element) {
3704 var o = {
3705 type: 'text'
3706 };
3707
3708 if (element.nodeName === 'H2') {
3709 o.head = 1;
3710 } else if (element.nodeName === 'BLOCKQUOTE') {
3711 o.block = 1;
3712 }
3713
3714 if (element.classList.contains('ql-align-center')) {
3715 o.center = 1;
3716 }
3717
3718 o.value = getValue(element);
3719 return o;
3720 };
3721
3722 var hrToJson = function hrToJson() {
3723 return {
3724 type: 'line'
3725 };
3726 };
3727
3728 var imageToJson = function imageToJson(element) {
3729 var o = {
3730 type: 'image'
3731 };
3732 var height = element.getAttribute('height');
3733 var width = element.getAttribute('width');
3734 var size = element.getAttribute('size');
3735 var format = element.getAttribute('format');
3736 var url = element.getAttribute('url');
3737 var value = element.getAttribute('value');
3738 o = Object.assign(o, {
3739 height: height,
3740 width: width,
3741 size: size,
3742 format: format,
3743 url: url,
3744 desc: value
3745 });
3746 return o;
3747 };
3748
3749 var videoToJson = function videoToJson(element) {
3750 var o = {
3751 type: 'video'
3752 };
3753 var result = JSON.parse(element.getAttribute('result'));
3754 o = Object.assign(o, result);
3755 return o;
3756 };
3757
3758 var divToJson = function divToJson(element) {
3759 if (element.classList.contains('huazhi-image')) {
3760 return imageToJson(element);
3761 } else if (element.classList.contains('huazhi-video')) {
3762 return videoToJson(element);
3763 }
3764 };
3765
3766 var listToJson = function listToJson(element) {
3767 var o = {};
3768 var value = [];
3769
3770 if (element.nodeName === 'UL') {
3771 o.type = 'ul';
3772 } else if (element.nodeName === 'OL') {
3773 o.type = 'ol';
3774 }
3775
3776 var elementList = element.childNodes;
3777 var length = elementList.length;
3778
3779 for (var i = 0; i < length; i++) {
3780 var _element2 = elementList[i];
3781 var result = getValue(_element2);
3782 value.push(result);
3783 }
3784
3785 o.value = value;
3786 return o;
3787 };
3788
3789 var elementListToJsonMap = {
3790 '#text': textToJson,
3791 'STRONG': strongToJson,
3792 'A': aToJson,
3793 'P': blockElementToJson,
3794 'H2': blockElementToJson,
3795 'BLOCKQUOTE': blockElementToJson,
3796 'HR': hrToJson,
3797 'DIV': divToJson,
3798 'VIDEO': videoToJson,
3799 'UL': listToJson,
3800 'OL': listToJson
3801 };
3802
3803 var removeSpace = function removeSpace(json) {
3804 // 清除后换行
3805 var length = json.length;
3806 var count1 = 0;
3807 var count2 = length;
3808
3809 for (var i = 0; i < length; i++) {
3810 if (json[i].value && json[i].value.length === 0) {
3811 count1 += 1;
3812 } else {
3813 break;
3814 }
3815 }
3816
3817 for (var _i = length - 1; _i >= 0; _i--) {
3818 if (json[_i].value && json[_i].value.length === 0) {
3819 count2 -= 1;
3820 } else {
3821 break;
3822 }
3823 }
3824
3825 return json.slice(count1, count2);
3826 };
3827
3828 var WebRich =
3829 /*#__PURE__*/
3830 function (_Parse) {
3831 _inheritsLoose(WebRich, _Parse);
3832
3833 function WebRich(option) {
3834 return _Parse.call(this, option) || this;
3835 }
3836
3837 var _proto = WebRich.prototype;
3838
3839 _proto.renderImage = function renderImage(props) {
3840 // 适配quill自定义图片样式
3841 var format = props.format,
3842 height = props.height,
3843 width = props.width,
3844 size = props.size,
3845 url = props.url,
3846 _props$desc = props.desc,
3847 desc = _props$desc === void 0 ? '' : _props$desc;
3848 var o = {
3849 format: format,
3850 height: height,
3851 width: width,
3852 size: size,
3853 url: url
3854 };
3855 var value = desc.replace(/ /g, "&nbsp;");
3856 return "<div class=\"huazhi-image\" image=" + JSON.stringify(o) + " value=" + value + "></div>";
3857 };
3858
3859 _proto.renderLink = function renderLink(props) {
3860 // return `<p><a href="${props.route.webURL}" target="_blank">${props.content}</a></p>`;
3861 return "<a class=\"huazhi-link\" target=\"_blank\" href=\"" + (props.route.webUrl || props.route.webURL) + "\">" + props.content + "</a>";
3862 };
3863
3864 _proto.renderVideo = function renderVideo(props) {
3865 return "<video class=\"huazhi-video\" src=\"" + props.url + "\" controls=\"controls\" result=" + JSON.stringify(props) + "></video>";
3866 }
3867 /**
3868 * elementList => json
3869 * 富文本编辑内容格式化
3870 * @param {array} elementList
3871 * @return {array} json结构
3872 */
3873 ;
3874
3875 _proto.elementListToJson = function elementListToJson(elementList) {
3876 var length = elementList.length;
3877 var json = [];
3878
3879 for (var i = 0; i < length; i++) {
3880 var element = elementList[i];
3881 var elementType = element.nodeName;
3882 var func = elementListToJsonMap[elementType];
3883
3884 if (func) {
3885 var result = func(element);
3886 json.push(result);
3887 }
3888 }
3889
3890 json = removeSpace(json);
3891 return json;
3892 };
3893
3894 /**
3895 * ops => json
3896 * 富文本编辑内容格式化
3897 * @param {object} source html字符串/detail结构
3898 * @param {boolean} isJSonString 是否转为json-string
3899 * @return {array<object>|string} json结构
3900 */
3901 _proto.opsToHTML = function opsToHTML(source, isJSonString) {
3902 if (isJSonString === void 0) {
3903 isJSonString = false;
3904 }
3905
3906 var results = [];
3907 var tmp = null;
3908
3909 for (var i = 0, l = source.length; i < l; i++) {
3910 var _source$i = source[i],
3911 insert = _source$i.insert,
3912 _source$i$attributes = _source$i.attributes,
3913 attributes = _source$i$attributes === void 0 ? {} : _source$i$attributes; // 文本
3914
3915 if (typeof insert === 'string') {
3916 var bold = attributes.bold,
3917 header = attributes.header,
3918 blockquote = attributes.blockquote,
3919 link = attributes.link;
3920
3921 if (!tmp) {
3922 tmp = {
3923 type: 'text',
3924 value: []
3925 };
3926 } // 标题或者引用
3927
3928
3929 if (header === 2 || blockquote === true) {
3930 var lastLine = helperGetLastLIne(tmp.value);
3931
3932 if (tmp.value.length) {
3933 results.push(tmp);
3934 }
3935
3936 tmp = null;
3937 var block = {
3938 type: 'text',
3939 value: lastLine
3940 };
3941 if (header === 2) block.head = 1;
3942 if (blockquote === true) block.block = 1;
3943 results.push(block);
3944 } else if (bold) {
3945 tmp.value.push({
3946 type: 'string',
3947 bold: 1,
3948 content: insert
3949 });
3950 } else if (link) {
3951 var _params;
3952
3953 // 链接处理
3954 var type = getUrlType(link);
3955 var info = routes[type];
3956 var value = {
3957 type: 'link',
3958 content: insert,
3959 route: {
3960 route: info.route,
3961 webUrl: link,
3962 params: (_params = {}, _params[info.id] = getId(link), _params)
3963 }
3964 };
3965 tmp.value.push(value);
3966 } else {
3967 tmp.value.push({
3968 type: 'string',
3969 content: insert
3970 });
3971 } // 非文本
3972
3973 } else if (isObject$1(insert)) {
3974 // 清理文本
3975 if (tmp && tmp.value.length) {
3976 results.push(tmp);
3977 tmp = null;
3978 } // 图片提取
3979
3980
3981 if (insert.image && this.isImage(insert.image)) {
3982 results.push(Object.assign({}, insert.image, {
3983 type: 'image'
3984 }));
3985 } // 分割线
3986
3987
3988 if (insert.hr === true) {
3989 results.push({
3990 type: 'line'
3991 });
3992 } // 视频提取
3993
3994
3995 if (insert.simpleVideo && insert.simpleVideo.url) {
3996 results.push(Object.assign({}, insert.simpleVideo, {
3997 type: 'video'
3998 }));
3999 }
4000 } // 末尾不考虑其他因素
4001
4002
4003 if (i === l - 1 && tmp) {
4004 results.push(tmp);
4005 }
4006 }
4007
4008 return isJSonString ? JSON.stringify(results) : results;
4009 };
4010
4011 return WebRich;
4012 }(Parse);
4013
4014 return WebRich;
4015
4016}));