kritzel-stencil 0.0.104 → 0.0.105

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/dist/cjs/index-D62tBCuq.js.map +1 -1
  2. package/dist/cjs/kritzel-brush-style_18.cjs.entry.js +22 -2050
  3. package/dist/cjs/kritzel-brush-style_18.cjs.entry.js.map +1 -1
  4. package/dist/cjs/stencil.cjs.js.map +1 -1
  5. package/dist/collection/classes/handlers/rotation.handler.js +1 -0
  6. package/dist/collection/classes/handlers/rotation.handler.js.map +1 -1
  7. package/dist/collection/classes/objects/image.class.js +2 -4
  8. package/dist/collection/classes/objects/image.class.js.map +1 -1
  9. package/dist/collection/classes/objects/selection-group.class.js +8 -7
  10. package/dist/collection/classes/objects/selection-group.class.js.map +1 -1
  11. package/dist/collection/classes/reviver.class.js +1 -1
  12. package/dist/collection/classes/reviver.class.js.map +1 -1
  13. package/dist/collection/classes/structures/octree.structure.js +2 -2
  14. package/dist/collection/classes/structures/octree.structure.js.map +1 -1
  15. package/dist/collection/classes/tools/image-tool.class.js +2 -1
  16. package/dist/collection/classes/tools/image-tool.class.js.map +1 -1
  17. package/dist/collection/components/core/kritzel-engine/kritzel-engine.js +4 -4
  18. package/dist/collection/components/core/kritzel-engine/kritzel-engine.js.map +1 -1
  19. package/dist/collection/components/shared/kritzel-brush-style/kritzel-brush-style.js +1 -1
  20. package/dist/collection/components/shared/kritzel-dropdown/kritzel-dropdown.js +1 -1
  21. package/dist/collection/components/shared/kritzel-font-family/kritzel-font-family.js +1 -1
  22. package/dist/collection/helpers/object.helper.js +2 -15
  23. package/dist/collection/helpers/object.helper.js.map +1 -1
  24. package/dist/components/kritzel-controls.js +1 -1
  25. package/dist/components/kritzel-editor.js +3 -3
  26. package/dist/components/kritzel-engine.js +1 -1
  27. package/dist/components/{p-DMSOfO6k.js → p-C3vo4rx8.js} +23 -22
  28. package/dist/components/p-C3vo4rx8.js.map +1 -0
  29. package/dist/components/{p-DJUnTtGg.js → p-D31-QJwi.js} +3 -3
  30. package/dist/components/{p-DJUnTtGg.js.map → p-D31-QJwi.js.map} +1 -1
  31. package/dist/components/p-DC8SDK2U.js.map +1 -1
  32. package/dist/components/p-DT8_Rz-o.js +785 -0
  33. package/dist/components/p-DT8_Rz-o.js.map +1 -0
  34. package/dist/esm/index-BOJOOWaP.js.map +1 -1
  35. package/dist/esm/kritzel-brush-style_18.entry.js +22 -2050
  36. package/dist/esm/kritzel-brush-style_18.entry.js.map +1 -1
  37. package/dist/esm/stencil.js.map +1 -1
  38. package/dist/stencil/p-BOJOOWaP.js.map +1 -1
  39. package/dist/stencil/p-d0394bb5.entry.js +2 -0
  40. package/dist/stencil/p-d0394bb5.entry.js.map +1 -0
  41. package/dist/stencil/stencil.esm.js +1 -1
  42. package/dist/stencil/stencil.esm.js.map +1 -1
  43. package/dist/types/classes/objects/image.class.d.ts +2 -2
  44. package/dist/types/helpers/object.helper.d.ts +0 -1
  45. package/package.json +3 -5
  46. package/dist/components/p-CFkDfXW4.js +0 -2814
  47. package/dist/components/p-CFkDfXW4.js.map +0 -1
  48. package/dist/components/p-DMSOfO6k.js.map +0 -1
  49. package/dist/stencil/p-f059fbff.entry.js +0 -2
  50. package/dist/stencil/p-f059fbff.entry.js.map +0 -1
@@ -314,2023 +314,6 @@ class KritzelMathHelper {
314
314
  }
315
315
  }
316
316
 
317
- /** Detect free variable `global` from Node.js. */
318
- var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
319
-
320
- /** Detect free variable `self`. */
321
- var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
322
-
323
- /** Used as a reference to the global object. */
324
- var root = freeGlobal || freeSelf || Function('return this')();
325
-
326
- /** Built-in value references. */
327
- var Symbol = root.Symbol;
328
-
329
- /** Used for built-in method references. */
330
- var objectProto$b = Object.prototype;
331
-
332
- /** Used to check objects for own properties. */
333
- var hasOwnProperty$8 = objectProto$b.hasOwnProperty;
334
-
335
- /**
336
- * Used to resolve the
337
- * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
338
- * of values.
339
- */
340
- var nativeObjectToString$1 = objectProto$b.toString;
341
-
342
- /** Built-in value references. */
343
- var symToStringTag$1 = Symbol ? Symbol.toStringTag : undefined;
344
-
345
- /**
346
- * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
347
- *
348
- * @private
349
- * @param {*} value The value to query.
350
- * @returns {string} Returns the raw `toStringTag`.
351
- */
352
- function getRawTag(value) {
353
- var isOwn = hasOwnProperty$8.call(value, symToStringTag$1),
354
- tag = value[symToStringTag$1];
355
-
356
- try {
357
- value[symToStringTag$1] = undefined;
358
- var unmasked = true;
359
- } catch (e) {}
360
-
361
- var result = nativeObjectToString$1.call(value);
362
- if (unmasked) {
363
- if (isOwn) {
364
- value[symToStringTag$1] = tag;
365
- } else {
366
- delete value[symToStringTag$1];
367
- }
368
- }
369
- return result;
370
- }
371
-
372
- /** Used for built-in method references. */
373
- var objectProto$a = Object.prototype;
374
-
375
- /**
376
- * Used to resolve the
377
- * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
378
- * of values.
379
- */
380
- var nativeObjectToString = objectProto$a.toString;
381
-
382
- /**
383
- * Converts `value` to a string using `Object.prototype.toString`.
384
- *
385
- * @private
386
- * @param {*} value The value to convert.
387
- * @returns {string} Returns the converted string.
388
- */
389
- function objectToString(value) {
390
- return nativeObjectToString.call(value);
391
- }
392
-
393
- /** `Object#toString` result references. */
394
- var nullTag = '[object Null]',
395
- undefinedTag = '[object Undefined]';
396
-
397
- /** Built-in value references. */
398
- var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
399
-
400
- /**
401
- * The base implementation of `getTag` without fallbacks for buggy environments.
402
- *
403
- * @private
404
- * @param {*} value The value to query.
405
- * @returns {string} Returns the `toStringTag`.
406
- */
407
- function baseGetTag(value) {
408
- if (value == null) {
409
- return value === undefined ? undefinedTag : nullTag;
410
- }
411
- return (symToStringTag && symToStringTag in Object(value))
412
- ? getRawTag(value)
413
- : objectToString(value);
414
- }
415
-
416
- /**
417
- * Checks if `value` is object-like. A value is object-like if it's not `null`
418
- * and has a `typeof` result of "object".
419
- *
420
- * @static
421
- * @memberOf _
422
- * @since 4.0.0
423
- * @category Lang
424
- * @param {*} value The value to check.
425
- * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
426
- * @example
427
- *
428
- * _.isObjectLike({});
429
- * // => true
430
- *
431
- * _.isObjectLike([1, 2, 3]);
432
- * // => true
433
- *
434
- * _.isObjectLike(_.noop);
435
- * // => false
436
- *
437
- * _.isObjectLike(null);
438
- * // => false
439
- */
440
- function isObjectLike(value) {
441
- return value != null && typeof value == 'object';
442
- }
443
-
444
- /**
445
- * Checks if `value` is classified as an `Array` object.
446
- *
447
- * @static
448
- * @memberOf _
449
- * @since 0.1.0
450
- * @category Lang
451
- * @param {*} value The value to check.
452
- * @returns {boolean} Returns `true` if `value` is an array, else `false`.
453
- * @example
454
- *
455
- * _.isArray([1, 2, 3]);
456
- * // => true
457
- *
458
- * _.isArray(document.body.children);
459
- * // => false
460
- *
461
- * _.isArray('abc');
462
- * // => false
463
- *
464
- * _.isArray(_.noop);
465
- * // => false
466
- */
467
- var isArray = Array.isArray;
468
-
469
- /**
470
- * Checks if `value` is the
471
- * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
472
- * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
473
- *
474
- * @static
475
- * @memberOf _
476
- * @since 0.1.0
477
- * @category Lang
478
- * @param {*} value The value to check.
479
- * @returns {boolean} Returns `true` if `value` is an object, else `false`.
480
- * @example
481
- *
482
- * _.isObject({});
483
- * // => true
484
- *
485
- * _.isObject([1, 2, 3]);
486
- * // => true
487
- *
488
- * _.isObject(_.noop);
489
- * // => true
490
- *
491
- * _.isObject(null);
492
- * // => false
493
- */
494
- function isObject(value) {
495
- var type = typeof value;
496
- return value != null && (type == 'object' || type == 'function');
497
- }
498
-
499
- /** `Object#toString` result references. */
500
- var asyncTag = '[object AsyncFunction]',
501
- funcTag$2 = '[object Function]',
502
- genTag$1 = '[object GeneratorFunction]',
503
- proxyTag = '[object Proxy]';
504
-
505
- /**
506
- * Checks if `value` is classified as a `Function` object.
507
- *
508
- * @static
509
- * @memberOf _
510
- * @since 0.1.0
511
- * @category Lang
512
- * @param {*} value The value to check.
513
- * @returns {boolean} Returns `true` if `value` is a function, else `false`.
514
- * @example
515
- *
516
- * _.isFunction(_);
517
- * // => true
518
- *
519
- * _.isFunction(/abc/);
520
- * // => false
521
- */
522
- function isFunction(value) {
523
- if (!isObject(value)) {
524
- return false;
525
- }
526
- // The use of `Object#toString` avoids issues with the `typeof` operator
527
- // in Safari 9 which returns 'object' for typed arrays and other constructors.
528
- var tag = baseGetTag(value);
529
- return tag == funcTag$2 || tag == genTag$1 || tag == asyncTag || tag == proxyTag;
530
- }
531
-
532
- /** Used to detect overreaching core-js shims. */
533
- var coreJsData = root['__core-js_shared__'];
534
-
535
- /** Used to detect methods masquerading as native. */
536
- var maskSrcKey = (function() {
537
- var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
538
- return uid ? ('Symbol(src)_1.' + uid) : '';
539
- }());
540
-
541
- /**
542
- * Checks if `func` has its source masked.
543
- *
544
- * @private
545
- * @param {Function} func The function to check.
546
- * @returns {boolean} Returns `true` if `func` is masked, else `false`.
547
- */
548
- function isMasked(func) {
549
- return !!maskSrcKey && (maskSrcKey in func);
550
- }
551
-
552
- /** Used for built-in method references. */
553
- var funcProto$1 = Function.prototype;
554
-
555
- /** Used to resolve the decompiled source of functions. */
556
- var funcToString$1 = funcProto$1.toString;
557
-
558
- /**
559
- * Converts `func` to its source code.
560
- *
561
- * @private
562
- * @param {Function} func The function to convert.
563
- * @returns {string} Returns the source code.
564
- */
565
- function toSource(func) {
566
- if (func != null) {
567
- try {
568
- return funcToString$1.call(func);
569
- } catch (e) {}
570
- try {
571
- return (func + '');
572
- } catch (e) {}
573
- }
574
- return '';
575
- }
576
-
577
- /**
578
- * Used to match `RegExp`
579
- * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
580
- */
581
- var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
582
-
583
- /** Used to detect host constructors (Safari). */
584
- var reIsHostCtor = /^\[object .+?Constructor\]$/;
585
-
586
- /** Used for built-in method references. */
587
- var funcProto = Function.prototype,
588
- objectProto$9 = Object.prototype;
589
-
590
- /** Used to resolve the decompiled source of functions. */
591
- var funcToString = funcProto.toString;
592
-
593
- /** Used to check objects for own properties. */
594
- var hasOwnProperty$7 = objectProto$9.hasOwnProperty;
595
-
596
- /** Used to detect if a method is native. */
597
- var reIsNative = RegExp('^' +
598
- funcToString.call(hasOwnProperty$7).replace(reRegExpChar, '\\$&')
599
- .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
600
- );
601
-
602
- /**
603
- * The base implementation of `_.isNative` without bad shim checks.
604
- *
605
- * @private
606
- * @param {*} value The value to check.
607
- * @returns {boolean} Returns `true` if `value` is a native function,
608
- * else `false`.
609
- */
610
- function baseIsNative(value) {
611
- if (!isObject(value) || isMasked(value)) {
612
- return false;
613
- }
614
- var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
615
- return pattern.test(toSource(value));
616
- }
617
-
618
- /**
619
- * Gets the value at `key` of `object`.
620
- *
621
- * @private
622
- * @param {Object} [object] The object to query.
623
- * @param {string} key The key of the property to get.
624
- * @returns {*} Returns the property value.
625
- */
626
- function getValue(object, key) {
627
- return object == null ? undefined : object[key];
628
- }
629
-
630
- /**
631
- * Gets the native function at `key` of `object`.
632
- *
633
- * @private
634
- * @param {Object} object The object to query.
635
- * @param {string} key The key of the method to get.
636
- * @returns {*} Returns the function if it's native, else `undefined`.
637
- */
638
- function getNative(object, key) {
639
- var value = getValue(object, key);
640
- return baseIsNative(value) ? value : undefined;
641
- }
642
-
643
- /* Built-in method references that are verified to be native. */
644
- var WeakMap = getNative(root, 'WeakMap');
645
-
646
- /** Built-in value references. */
647
- var objectCreate = Object.create;
648
-
649
- /**
650
- * The base implementation of `_.create` without support for assigning
651
- * properties to the created object.
652
- *
653
- * @private
654
- * @param {Object} proto The object to inherit from.
655
- * @returns {Object} Returns the new object.
656
- */
657
- var baseCreate = (function() {
658
- function object() {}
659
- return function(proto) {
660
- if (!isObject(proto)) {
661
- return {};
662
- }
663
- if (objectCreate) {
664
- return objectCreate(proto);
665
- }
666
- object.prototype = proto;
667
- var result = new object;
668
- object.prototype = undefined;
669
- return result;
670
- };
671
- }());
672
-
673
- var defineProperty = (function() {
674
- try {
675
- var func = getNative(Object, 'defineProperty');
676
- func({}, '', {});
677
- return func;
678
- } catch (e) {}
679
- }());
680
-
681
- /**
682
- * A specialized version of `_.forEach` for arrays without support for
683
- * iteratee shorthands.
684
- *
685
- * @private
686
- * @param {Array} [array] The array to iterate over.
687
- * @param {Function} iteratee The function invoked per iteration.
688
- * @returns {Array} Returns `array`.
689
- */
690
- function arrayEach(array, iteratee) {
691
- var index = -1,
692
- length = array == null ? 0 : array.length;
693
-
694
- while (++index < length) {
695
- if (iteratee(array[index], index, array) === false) {
696
- break;
697
- }
698
- }
699
- return array;
700
- }
701
-
702
- /** Used as references for various `Number` constants. */
703
- var MAX_SAFE_INTEGER$1 = 9007199254740991;
704
-
705
- /** Used to detect unsigned integer values. */
706
- var reIsUint = /^(?:0|[1-9]\d*)$/;
707
-
708
- /**
709
- * Checks if `value` is a valid array-like index.
710
- *
711
- * @private
712
- * @param {*} value The value to check.
713
- * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
714
- * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
715
- */
716
- function isIndex(value, length) {
717
- var type = typeof value;
718
- length = length == null ? MAX_SAFE_INTEGER$1 : length;
719
-
720
- return !!length &&
721
- (type == 'number' ||
722
- (type != 'symbol' && reIsUint.test(value))) &&
723
- (value > -1 && value % 1 == 0 && value < length);
724
- }
725
-
726
- /**
727
- * The base implementation of `assignValue` and `assignMergeValue` without
728
- * value checks.
729
- *
730
- * @private
731
- * @param {Object} object The object to modify.
732
- * @param {string} key The key of the property to assign.
733
- * @param {*} value The value to assign.
734
- */
735
- function baseAssignValue(object, key, value) {
736
- if (key == '__proto__' && defineProperty) {
737
- defineProperty(object, key, {
738
- 'configurable': true,
739
- 'enumerable': true,
740
- 'value': value,
741
- 'writable': true
742
- });
743
- } else {
744
- object[key] = value;
745
- }
746
- }
747
-
748
- /**
749
- * Performs a
750
- * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
751
- * comparison between two values to determine if they are equivalent.
752
- *
753
- * @static
754
- * @memberOf _
755
- * @since 4.0.0
756
- * @category Lang
757
- * @param {*} value The value to compare.
758
- * @param {*} other The other value to compare.
759
- * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
760
- * @example
761
- *
762
- * var object = { 'a': 1 };
763
- * var other = { 'a': 1 };
764
- *
765
- * _.eq(object, object);
766
- * // => true
767
- *
768
- * _.eq(object, other);
769
- * // => false
770
- *
771
- * _.eq('a', 'a');
772
- * // => true
773
- *
774
- * _.eq('a', Object('a'));
775
- * // => false
776
- *
777
- * _.eq(NaN, NaN);
778
- * // => true
779
- */
780
- function eq(value, other) {
781
- return value === other || (value !== value && other !== other);
782
- }
783
-
784
- /** Used for built-in method references. */
785
- var objectProto$8 = Object.prototype;
786
-
787
- /** Used to check objects for own properties. */
788
- var hasOwnProperty$6 = objectProto$8.hasOwnProperty;
789
-
790
- /**
791
- * Assigns `value` to `key` of `object` if the existing value is not equivalent
792
- * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
793
- * for equality comparisons.
794
- *
795
- * @private
796
- * @param {Object} object The object to modify.
797
- * @param {string} key The key of the property to assign.
798
- * @param {*} value The value to assign.
799
- */
800
- function assignValue(object, key, value) {
801
- var objValue = object[key];
802
- if (!(hasOwnProperty$6.call(object, key) && eq(objValue, value)) ||
803
- (value === undefined && !(key in object))) {
804
- baseAssignValue(object, key, value);
805
- }
806
- }
807
-
808
- /** Used as references for various `Number` constants. */
809
- var MAX_SAFE_INTEGER = 9007199254740991;
810
-
811
- /**
812
- * Checks if `value` is a valid array-like length.
813
- *
814
- * **Note:** This method is loosely based on
815
- * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
816
- *
817
- * @static
818
- * @memberOf _
819
- * @since 4.0.0
820
- * @category Lang
821
- * @param {*} value The value to check.
822
- * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
823
- * @example
824
- *
825
- * _.isLength(3);
826
- * // => true
827
- *
828
- * _.isLength(Number.MIN_VALUE);
829
- * // => false
830
- *
831
- * _.isLength(Infinity);
832
- * // => false
833
- *
834
- * _.isLength('3');
835
- * // => false
836
- */
837
- function isLength(value) {
838
- return typeof value == 'number' &&
839
- value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
840
- }
841
-
842
- /**
843
- * Checks if `value` is array-like. A value is considered array-like if it's
844
- * not a function and has a `value.length` that's an integer greater than or
845
- * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
846
- *
847
- * @static
848
- * @memberOf _
849
- * @since 4.0.0
850
- * @category Lang
851
- * @param {*} value The value to check.
852
- * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
853
- * @example
854
- *
855
- * _.isArrayLike([1, 2, 3]);
856
- * // => true
857
- *
858
- * _.isArrayLike(document.body.children);
859
- * // => true
860
- *
861
- * _.isArrayLike('abc');
862
- * // => true
863
- *
864
- * _.isArrayLike(_.noop);
865
- * // => false
866
- */
867
- function isArrayLike(value) {
868
- return value != null && isLength(value.length) && !isFunction(value);
869
- }
870
-
871
- /** Used for built-in method references. */
872
- var objectProto$7 = Object.prototype;
873
-
874
- /**
875
- * Checks if `value` is likely a prototype object.
876
- *
877
- * @private
878
- * @param {*} value The value to check.
879
- * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
880
- */
881
- function isPrototype(value) {
882
- var Ctor = value && value.constructor,
883
- proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto$7;
884
-
885
- return value === proto;
886
- }
887
-
888
- /**
889
- * The base implementation of `_.times` without support for iteratee shorthands
890
- * or max array length checks.
891
- *
892
- * @private
893
- * @param {number} n The number of times to invoke `iteratee`.
894
- * @param {Function} iteratee The function invoked per iteration.
895
- * @returns {Array} Returns the array of results.
896
- */
897
- function baseTimes(n, iteratee) {
898
- var index = -1,
899
- result = Array(n);
900
-
901
- while (++index < n) {
902
- result[index] = iteratee(index);
903
- }
904
- return result;
905
- }
906
-
907
- /** `Object#toString` result references. */
908
- var argsTag$2 = '[object Arguments]';
909
-
910
- /**
911
- * The base implementation of `_.isArguments`.
912
- *
913
- * @private
914
- * @param {*} value The value to check.
915
- * @returns {boolean} Returns `true` if `value` is an `arguments` object,
916
- */
917
- function baseIsArguments(value) {
918
- return isObjectLike(value) && baseGetTag(value) == argsTag$2;
919
- }
920
-
921
- /** Used for built-in method references. */
922
- var objectProto$6 = Object.prototype;
923
-
924
- /** Used to check objects for own properties. */
925
- var hasOwnProperty$5 = objectProto$6.hasOwnProperty;
926
-
927
- /** Built-in value references. */
928
- var propertyIsEnumerable$1 = objectProto$6.propertyIsEnumerable;
929
-
930
- /**
931
- * Checks if `value` is likely an `arguments` object.
932
- *
933
- * @static
934
- * @memberOf _
935
- * @since 0.1.0
936
- * @category Lang
937
- * @param {*} value The value to check.
938
- * @returns {boolean} Returns `true` if `value` is an `arguments` object,
939
- * else `false`.
940
- * @example
941
- *
942
- * _.isArguments(function() { return arguments; }());
943
- * // => true
944
- *
945
- * _.isArguments([1, 2, 3]);
946
- * // => false
947
- */
948
- var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
949
- return isObjectLike(value) && hasOwnProperty$5.call(value, 'callee') &&
950
- !propertyIsEnumerable$1.call(value, 'callee');
951
- };
952
-
953
- /**
954
- * This method returns `false`.
955
- *
956
- * @static
957
- * @memberOf _
958
- * @since 4.13.0
959
- * @category Util
960
- * @returns {boolean} Returns `false`.
961
- * @example
962
- *
963
- * _.times(2, _.stubFalse);
964
- * // => [false, false]
965
- */
966
- function stubFalse() {
967
- return false;
968
- }
969
-
970
- /** Detect free variable `exports`. */
971
- var freeExports$2 = typeof exports == 'object' && exports && !exports.nodeType && exports;
972
-
973
- /** Detect free variable `module`. */
974
- var freeModule$1 = freeExports$2 && typeof module == 'object' && module && !module.nodeType && module;
975
-
976
- /** Detect the popular CommonJS extension `module.exports`. */
977
- var moduleExports$1 = freeModule$1 && freeModule$1.exports === freeExports$2;
978
-
979
- /** Built-in value references. */
980
- var Buffer = moduleExports$1 ? root.Buffer : undefined;
981
-
982
- /* Built-in method references for those with the same name as other `lodash` methods. */
983
- var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;
984
-
985
- /**
986
- * Checks if `value` is a buffer.
987
- *
988
- * @static
989
- * @memberOf _
990
- * @since 4.3.0
991
- * @category Lang
992
- * @param {*} value The value to check.
993
- * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
994
- * @example
995
- *
996
- * _.isBuffer(new Buffer(2));
997
- * // => true
998
- *
999
- * _.isBuffer(new Uint8Array(2));
1000
- * // => false
1001
- */
1002
- var isBuffer = nativeIsBuffer || stubFalse;
1003
-
1004
- /** `Object#toString` result references. */
1005
- var argsTag$1 = '[object Arguments]',
1006
- arrayTag$1 = '[object Array]',
1007
- boolTag$2 = '[object Boolean]',
1008
- dateTag$2 = '[object Date]',
1009
- errorTag$1 = '[object Error]',
1010
- funcTag$1 = '[object Function]',
1011
- mapTag$4 = '[object Map]',
1012
- numberTag$2 = '[object Number]',
1013
- objectTag$2 = '[object Object]',
1014
- regexpTag$2 = '[object RegExp]',
1015
- setTag$4 = '[object Set]',
1016
- stringTag$2 = '[object String]',
1017
- weakMapTag$2 = '[object WeakMap]';
1018
-
1019
- var arrayBufferTag$2 = '[object ArrayBuffer]',
1020
- dataViewTag$3 = '[object DataView]',
1021
- float32Tag$2 = '[object Float32Array]',
1022
- float64Tag$2 = '[object Float64Array]',
1023
- int8Tag$2 = '[object Int8Array]',
1024
- int16Tag$2 = '[object Int16Array]',
1025
- int32Tag$2 = '[object Int32Array]',
1026
- uint8Tag$2 = '[object Uint8Array]',
1027
- uint8ClampedTag$2 = '[object Uint8ClampedArray]',
1028
- uint16Tag$2 = '[object Uint16Array]',
1029
- uint32Tag$2 = '[object Uint32Array]';
1030
-
1031
- /** Used to identify `toStringTag` values of typed arrays. */
1032
- var typedArrayTags = {};
1033
- typedArrayTags[float32Tag$2] = typedArrayTags[float64Tag$2] =
1034
- typedArrayTags[int8Tag$2] = typedArrayTags[int16Tag$2] =
1035
- typedArrayTags[int32Tag$2] = typedArrayTags[uint8Tag$2] =
1036
- typedArrayTags[uint8ClampedTag$2] = typedArrayTags[uint16Tag$2] =
1037
- typedArrayTags[uint32Tag$2] = true;
1038
- typedArrayTags[argsTag$1] = typedArrayTags[arrayTag$1] =
1039
- typedArrayTags[arrayBufferTag$2] = typedArrayTags[boolTag$2] =
1040
- typedArrayTags[dataViewTag$3] = typedArrayTags[dateTag$2] =
1041
- typedArrayTags[errorTag$1] = typedArrayTags[funcTag$1] =
1042
- typedArrayTags[mapTag$4] = typedArrayTags[numberTag$2] =
1043
- typedArrayTags[objectTag$2] = typedArrayTags[regexpTag$2] =
1044
- typedArrayTags[setTag$4] = typedArrayTags[stringTag$2] =
1045
- typedArrayTags[weakMapTag$2] = false;
1046
-
1047
- /**
1048
- * The base implementation of `_.isTypedArray` without Node.js optimizations.
1049
- *
1050
- * @private
1051
- * @param {*} value The value to check.
1052
- * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
1053
- */
1054
- function baseIsTypedArray(value) {
1055
- return isObjectLike(value) &&
1056
- isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
1057
- }
1058
-
1059
- /**
1060
- * The base implementation of `_.unary` without support for storing metadata.
1061
- *
1062
- * @private
1063
- * @param {Function} func The function to cap arguments for.
1064
- * @returns {Function} Returns the new capped function.
1065
- */
1066
- function baseUnary(func) {
1067
- return function(value) {
1068
- return func(value);
1069
- };
1070
- }
1071
-
1072
- /** Detect free variable `exports`. */
1073
- var freeExports$1 = typeof exports == 'object' && exports && !exports.nodeType && exports;
1074
-
1075
- /** Detect free variable `module`. */
1076
- var freeModule = freeExports$1 && typeof module == 'object' && module && !module.nodeType && module;
1077
-
1078
- /** Detect the popular CommonJS extension `module.exports`. */
1079
- var moduleExports = freeModule && freeModule.exports === freeExports$1;
1080
-
1081
- /** Detect free variable `process` from Node.js. */
1082
- var freeProcess = moduleExports && freeGlobal.process;
1083
-
1084
- /** Used to access faster Node.js helpers. */
1085
- var nodeUtil = (function() {
1086
- try {
1087
- // Use `util.types` for Node.js 10+.
1088
- var types = freeModule && freeModule.require && freeModule.require('util').types;
1089
-
1090
- if (types) {
1091
- return types;
1092
- }
1093
-
1094
- // Legacy `process.binding('util')` for Node.js < 10.
1095
- return freeProcess && freeProcess.binding && freeProcess.binding('util');
1096
- } catch (e) {}
1097
- }());
1098
-
1099
- /* Node.js helper references. */
1100
- var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
1101
-
1102
- /**
1103
- * Checks if `value` is classified as a typed array.
1104
- *
1105
- * @static
1106
- * @memberOf _
1107
- * @since 3.0.0
1108
- * @category Lang
1109
- * @param {*} value The value to check.
1110
- * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
1111
- * @example
1112
- *
1113
- * _.isTypedArray(new Uint8Array);
1114
- * // => true
1115
- *
1116
- * _.isTypedArray([]);
1117
- * // => false
1118
- */
1119
- var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
1120
-
1121
- /** Used for built-in method references. */
1122
- var objectProto$5 = Object.prototype;
1123
-
1124
- /** Used to check objects for own properties. */
1125
- var hasOwnProperty$4 = objectProto$5.hasOwnProperty;
1126
-
1127
- /**
1128
- * Creates an array of the enumerable property names of the array-like `value`.
1129
- *
1130
- * @private
1131
- * @param {*} value The value to query.
1132
- * @param {boolean} inherited Specify returning inherited property names.
1133
- * @returns {Array} Returns the array of property names.
1134
- */
1135
- function arrayLikeKeys(value, inherited) {
1136
- var isArr = isArray(value),
1137
- isArg = !isArr && isArguments(value),
1138
- isBuff = !isArr && !isArg && isBuffer(value),
1139
- isType = !isArr && !isArg && !isBuff && isTypedArray(value),
1140
- skipIndexes = isArr || isArg || isBuff || isType,
1141
- result = skipIndexes ? baseTimes(value.length, String) : [],
1142
- length = result.length;
1143
-
1144
- for (var key in value) {
1145
- if ((hasOwnProperty$4.call(value, key)) &&
1146
- !(skipIndexes && (
1147
- // Safari 9 has enumerable `arguments.length` in strict mode.
1148
- key == 'length' ||
1149
- // Node.js 0.10 has enumerable non-index properties on buffers.
1150
- (isBuff && (key == 'offset' || key == 'parent')) ||
1151
- // PhantomJS 2 has enumerable non-index properties on typed arrays.
1152
- (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
1153
- // Skip index properties.
1154
- isIndex(key, length)
1155
- ))) {
1156
- result.push(key);
1157
- }
1158
- }
1159
- return result;
1160
- }
1161
-
1162
- /**
1163
- * Creates a unary function that invokes `func` with its argument transformed.
1164
- *
1165
- * @private
1166
- * @param {Function} func The function to wrap.
1167
- * @param {Function} transform The argument transform.
1168
- * @returns {Function} Returns the new function.
1169
- */
1170
- function overArg(func, transform) {
1171
- return function(arg) {
1172
- return func(transform(arg));
1173
- };
1174
- }
1175
-
1176
- /* Built-in method references for those with the same name as other `lodash` methods. */
1177
- var nativeKeys = overArg(Object.keys, Object);
1178
-
1179
- /** Used for built-in method references. */
1180
- var objectProto$4 = Object.prototype;
1181
-
1182
- /** Used to check objects for own properties. */
1183
- var hasOwnProperty$3 = objectProto$4.hasOwnProperty;
1184
-
1185
- /**
1186
- * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
1187
- *
1188
- * @private
1189
- * @param {Object} object The object to query.
1190
- * @returns {Array} Returns the array of property names.
1191
- */
1192
- function baseKeys(object) {
1193
- if (!isPrototype(object)) {
1194
- return nativeKeys(object);
1195
- }
1196
- var result = [];
1197
- for (var key in Object(object)) {
1198
- if (hasOwnProperty$3.call(object, key) && key != 'constructor') {
1199
- result.push(key);
1200
- }
1201
- }
1202
- return result;
1203
- }
1204
-
1205
- /**
1206
- * Creates an array of the own enumerable property names of `object`.
1207
- *
1208
- * **Note:** Non-object values are coerced to objects. See the
1209
- * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
1210
- * for more details.
1211
- *
1212
- * @static
1213
- * @since 0.1.0
1214
- * @memberOf _
1215
- * @category Object
1216
- * @param {Object} object The object to query.
1217
- * @returns {Array} Returns the array of property names.
1218
- * @example
1219
- *
1220
- * function Foo() {
1221
- * this.a = 1;
1222
- * this.b = 2;
1223
- * }
1224
- *
1225
- * Foo.prototype.c = 3;
1226
- *
1227
- * _.keys(new Foo);
1228
- * // => ['a', 'b'] (iteration order is not guaranteed)
1229
- *
1230
- * _.keys('hi');
1231
- * // => ['0', '1']
1232
- */
1233
- function keys(object) {
1234
- return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
1235
- }
1236
-
1237
- /* Built-in method references that are verified to be native. */
1238
- var nativeCreate = getNative(Object, 'create');
1239
-
1240
- /**
1241
- * Removes all key-value entries from the hash.
1242
- *
1243
- * @private
1244
- * @name clear
1245
- * @memberOf Hash
1246
- */
1247
- function hashClear() {
1248
- this.__data__ = nativeCreate ? nativeCreate(null) : {};
1249
- this.size = 0;
1250
- }
1251
-
1252
- /**
1253
- * Removes `key` and its value from the hash.
1254
- *
1255
- * @private
1256
- * @name delete
1257
- * @memberOf Hash
1258
- * @param {Object} hash The hash to modify.
1259
- * @param {string} key The key of the value to remove.
1260
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
1261
- */
1262
- function hashDelete(key) {
1263
- var result = this.has(key) && delete this.__data__[key];
1264
- this.size -= result ? 1 : 0;
1265
- return result;
1266
- }
1267
-
1268
- /** Used to stand-in for `undefined` hash values. */
1269
- var HASH_UNDEFINED$1 = '__lodash_hash_undefined__';
1270
-
1271
- /** Used for built-in method references. */
1272
- var objectProto$3 = Object.prototype;
1273
-
1274
- /** Used to check objects for own properties. */
1275
- var hasOwnProperty$2 = objectProto$3.hasOwnProperty;
1276
-
1277
- /**
1278
- * Gets the hash value for `key`.
1279
- *
1280
- * @private
1281
- * @name get
1282
- * @memberOf Hash
1283
- * @param {string} key The key of the value to get.
1284
- * @returns {*} Returns the entry value.
1285
- */
1286
- function hashGet(key) {
1287
- var data = this.__data__;
1288
- if (nativeCreate) {
1289
- var result = data[key];
1290
- return result === HASH_UNDEFINED$1 ? undefined : result;
1291
- }
1292
- return hasOwnProperty$2.call(data, key) ? data[key] : undefined;
1293
- }
1294
-
1295
- /** Used for built-in method references. */
1296
- var objectProto$2 = Object.prototype;
1297
-
1298
- /** Used to check objects for own properties. */
1299
- var hasOwnProperty$1 = objectProto$2.hasOwnProperty;
1300
-
1301
- /**
1302
- * Checks if a hash value for `key` exists.
1303
- *
1304
- * @private
1305
- * @name has
1306
- * @memberOf Hash
1307
- * @param {string} key The key of the entry to check.
1308
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
1309
- */
1310
- function hashHas(key) {
1311
- var data = this.__data__;
1312
- return nativeCreate ? (data[key] !== undefined) : hasOwnProperty$1.call(data, key);
1313
- }
1314
-
1315
- /** Used to stand-in for `undefined` hash values. */
1316
- var HASH_UNDEFINED = '__lodash_hash_undefined__';
1317
-
1318
- /**
1319
- * Sets the hash `key` to `value`.
1320
- *
1321
- * @private
1322
- * @name set
1323
- * @memberOf Hash
1324
- * @param {string} key The key of the value to set.
1325
- * @param {*} value The value to set.
1326
- * @returns {Object} Returns the hash instance.
1327
- */
1328
- function hashSet(key, value) {
1329
- var data = this.__data__;
1330
- this.size += this.has(key) ? 0 : 1;
1331
- data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
1332
- return this;
1333
- }
1334
-
1335
- /**
1336
- * Creates a hash object.
1337
- *
1338
- * @private
1339
- * @constructor
1340
- * @param {Array} [entries] The key-value pairs to cache.
1341
- */
1342
- function Hash(entries) {
1343
- var index = -1,
1344
- length = entries == null ? 0 : entries.length;
1345
-
1346
- this.clear();
1347
- while (++index < length) {
1348
- var entry = entries[index];
1349
- this.set(entry[0], entry[1]);
1350
- }
1351
- }
1352
-
1353
- // Add methods to `Hash`.
1354
- Hash.prototype.clear = hashClear;
1355
- Hash.prototype['delete'] = hashDelete;
1356
- Hash.prototype.get = hashGet;
1357
- Hash.prototype.has = hashHas;
1358
- Hash.prototype.set = hashSet;
1359
-
1360
- /**
1361
- * Removes all key-value entries from the list cache.
1362
- *
1363
- * @private
1364
- * @name clear
1365
- * @memberOf ListCache
1366
- */
1367
- function listCacheClear() {
1368
- this.__data__ = [];
1369
- this.size = 0;
1370
- }
1371
-
1372
- /**
1373
- * Gets the index at which the `key` is found in `array` of key-value pairs.
1374
- *
1375
- * @private
1376
- * @param {Array} array The array to inspect.
1377
- * @param {*} key The key to search for.
1378
- * @returns {number} Returns the index of the matched value, else `-1`.
1379
- */
1380
- function assocIndexOf(array, key) {
1381
- var length = array.length;
1382
- while (length--) {
1383
- if (eq(array[length][0], key)) {
1384
- return length;
1385
- }
1386
- }
1387
- return -1;
1388
- }
1389
-
1390
- /** Used for built-in method references. */
1391
- var arrayProto = Array.prototype;
1392
-
1393
- /** Built-in value references. */
1394
- var splice = arrayProto.splice;
1395
-
1396
- /**
1397
- * Removes `key` and its value from the list cache.
1398
- *
1399
- * @private
1400
- * @name delete
1401
- * @memberOf ListCache
1402
- * @param {string} key The key of the value to remove.
1403
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
1404
- */
1405
- function listCacheDelete(key) {
1406
- var data = this.__data__,
1407
- index = assocIndexOf(data, key);
1408
-
1409
- if (index < 0) {
1410
- return false;
1411
- }
1412
- var lastIndex = data.length - 1;
1413
- if (index == lastIndex) {
1414
- data.pop();
1415
- } else {
1416
- splice.call(data, index, 1);
1417
- }
1418
- --this.size;
1419
- return true;
1420
- }
1421
-
1422
- /**
1423
- * Gets the list cache value for `key`.
1424
- *
1425
- * @private
1426
- * @name get
1427
- * @memberOf ListCache
1428
- * @param {string} key The key of the value to get.
1429
- * @returns {*} Returns the entry value.
1430
- */
1431
- function listCacheGet(key) {
1432
- var data = this.__data__,
1433
- index = assocIndexOf(data, key);
1434
-
1435
- return index < 0 ? undefined : data[index][1];
1436
- }
1437
-
1438
- /**
1439
- * Checks if a list cache value for `key` exists.
1440
- *
1441
- * @private
1442
- * @name has
1443
- * @memberOf ListCache
1444
- * @param {string} key The key of the entry to check.
1445
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
1446
- */
1447
- function listCacheHas(key) {
1448
- return assocIndexOf(this.__data__, key) > -1;
1449
- }
1450
-
1451
- /**
1452
- * Sets the list cache `key` to `value`.
1453
- *
1454
- * @private
1455
- * @name set
1456
- * @memberOf ListCache
1457
- * @param {string} key The key of the value to set.
1458
- * @param {*} value The value to set.
1459
- * @returns {Object} Returns the list cache instance.
1460
- */
1461
- function listCacheSet(key, value) {
1462
- var data = this.__data__,
1463
- index = assocIndexOf(data, key);
1464
-
1465
- if (index < 0) {
1466
- ++this.size;
1467
- data.push([key, value]);
1468
- } else {
1469
- data[index][1] = value;
1470
- }
1471
- return this;
1472
- }
1473
-
1474
- /**
1475
- * Creates an list cache object.
1476
- *
1477
- * @private
1478
- * @constructor
1479
- * @param {Array} [entries] The key-value pairs to cache.
1480
- */
1481
- function ListCache(entries) {
1482
- var index = -1,
1483
- length = entries == null ? 0 : entries.length;
1484
-
1485
- this.clear();
1486
- while (++index < length) {
1487
- var entry = entries[index];
1488
- this.set(entry[0], entry[1]);
1489
- }
1490
- }
1491
-
1492
- // Add methods to `ListCache`.
1493
- ListCache.prototype.clear = listCacheClear;
1494
- ListCache.prototype['delete'] = listCacheDelete;
1495
- ListCache.prototype.get = listCacheGet;
1496
- ListCache.prototype.has = listCacheHas;
1497
- ListCache.prototype.set = listCacheSet;
1498
-
1499
- /* Built-in method references that are verified to be native. */
1500
- var Map$1 = getNative(root, 'Map');
1501
-
1502
- /**
1503
- * Removes all key-value entries from the map.
1504
- *
1505
- * @private
1506
- * @name clear
1507
- * @memberOf MapCache
1508
- */
1509
- function mapCacheClear() {
1510
- this.size = 0;
1511
- this.__data__ = {
1512
- 'hash': new Hash,
1513
- 'map': new (Map$1 || ListCache),
1514
- 'string': new Hash
1515
- };
1516
- }
1517
-
1518
- /**
1519
- * Checks if `value` is suitable for use as unique object key.
1520
- *
1521
- * @private
1522
- * @param {*} value The value to check.
1523
- * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
1524
- */
1525
- function isKeyable(value) {
1526
- var type = typeof value;
1527
- return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
1528
- ? (value !== '__proto__')
1529
- : (value === null);
1530
- }
1531
-
1532
- /**
1533
- * Gets the data for `map`.
1534
- *
1535
- * @private
1536
- * @param {Object} map The map to query.
1537
- * @param {string} key The reference key.
1538
- * @returns {*} Returns the map data.
1539
- */
1540
- function getMapData(map, key) {
1541
- var data = map.__data__;
1542
- return isKeyable(key)
1543
- ? data[typeof key == 'string' ? 'string' : 'hash']
1544
- : data.map;
1545
- }
1546
-
1547
- /**
1548
- * Removes `key` and its value from the map.
1549
- *
1550
- * @private
1551
- * @name delete
1552
- * @memberOf MapCache
1553
- * @param {string} key The key of the value to remove.
1554
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
1555
- */
1556
- function mapCacheDelete(key) {
1557
- var result = getMapData(this, key)['delete'](key);
1558
- this.size -= result ? 1 : 0;
1559
- return result;
1560
- }
1561
-
1562
- /**
1563
- * Gets the map value for `key`.
1564
- *
1565
- * @private
1566
- * @name get
1567
- * @memberOf MapCache
1568
- * @param {string} key The key of the value to get.
1569
- * @returns {*} Returns the entry value.
1570
- */
1571
- function mapCacheGet(key) {
1572
- return getMapData(this, key).get(key);
1573
- }
1574
-
1575
- /**
1576
- * Checks if a map value for `key` exists.
1577
- *
1578
- * @private
1579
- * @name has
1580
- * @memberOf MapCache
1581
- * @param {string} key The key of the entry to check.
1582
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
1583
- */
1584
- function mapCacheHas(key) {
1585
- return getMapData(this, key).has(key);
1586
- }
1587
-
1588
- /**
1589
- * Sets the map `key` to `value`.
1590
- *
1591
- * @private
1592
- * @name set
1593
- * @memberOf MapCache
1594
- * @param {string} key The key of the value to set.
1595
- * @param {*} value The value to set.
1596
- * @returns {Object} Returns the map cache instance.
1597
- */
1598
- function mapCacheSet(key, value) {
1599
- var data = getMapData(this, key),
1600
- size = data.size;
1601
-
1602
- data.set(key, value);
1603
- this.size += data.size == size ? 0 : 1;
1604
- return this;
1605
- }
1606
-
1607
- /**
1608
- * Creates a map cache object to store key-value pairs.
1609
- *
1610
- * @private
1611
- * @constructor
1612
- * @param {Array} [entries] The key-value pairs to cache.
1613
- */
1614
- function MapCache(entries) {
1615
- var index = -1,
1616
- length = entries == null ? 0 : entries.length;
1617
-
1618
- this.clear();
1619
- while (++index < length) {
1620
- var entry = entries[index];
1621
- this.set(entry[0], entry[1]);
1622
- }
1623
- }
1624
-
1625
- // Add methods to `MapCache`.
1626
- MapCache.prototype.clear = mapCacheClear;
1627
- MapCache.prototype['delete'] = mapCacheDelete;
1628
- MapCache.prototype.get = mapCacheGet;
1629
- MapCache.prototype.has = mapCacheHas;
1630
- MapCache.prototype.set = mapCacheSet;
1631
-
1632
- /**
1633
- * Appends the elements of `values` to `array`.
1634
- *
1635
- * @private
1636
- * @param {Array} array The array to modify.
1637
- * @param {Array} values The values to append.
1638
- * @returns {Array} Returns `array`.
1639
- */
1640
- function arrayPush(array, values) {
1641
- var index = -1,
1642
- length = values.length,
1643
- offset = array.length;
1644
-
1645
- while (++index < length) {
1646
- array[offset + index] = values[index];
1647
- }
1648
- return array;
1649
- }
1650
-
1651
- /** Built-in value references. */
1652
- var getPrototype = overArg(Object.getPrototypeOf, Object);
1653
-
1654
- /**
1655
- * Removes all key-value entries from the stack.
1656
- *
1657
- * @private
1658
- * @name clear
1659
- * @memberOf Stack
1660
- */
1661
- function stackClear() {
1662
- this.__data__ = new ListCache;
1663
- this.size = 0;
1664
- }
1665
-
1666
- /**
1667
- * Removes `key` and its value from the stack.
1668
- *
1669
- * @private
1670
- * @name delete
1671
- * @memberOf Stack
1672
- * @param {string} key The key of the value to remove.
1673
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
1674
- */
1675
- function stackDelete(key) {
1676
- var data = this.__data__,
1677
- result = data['delete'](key);
1678
-
1679
- this.size = data.size;
1680
- return result;
1681
- }
1682
-
1683
- /**
1684
- * Gets the stack value for `key`.
1685
- *
1686
- * @private
1687
- * @name get
1688
- * @memberOf Stack
1689
- * @param {string} key The key of the value to get.
1690
- * @returns {*} Returns the entry value.
1691
- */
1692
- function stackGet(key) {
1693
- return this.__data__.get(key);
1694
- }
1695
-
1696
- /**
1697
- * Checks if a stack value for `key` exists.
1698
- *
1699
- * @private
1700
- * @name has
1701
- * @memberOf Stack
1702
- * @param {string} key The key of the entry to check.
1703
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
1704
- */
1705
- function stackHas(key) {
1706
- return this.__data__.has(key);
1707
- }
1708
-
1709
- /** Used as the size to enable large array optimizations. */
1710
- var LARGE_ARRAY_SIZE = 200;
1711
-
1712
- /**
1713
- * Sets the stack `key` to `value`.
1714
- *
1715
- * @private
1716
- * @name set
1717
- * @memberOf Stack
1718
- * @param {string} key The key of the value to set.
1719
- * @param {*} value The value to set.
1720
- * @returns {Object} Returns the stack cache instance.
1721
- */
1722
- function stackSet(key, value) {
1723
- var data = this.__data__;
1724
- if (data instanceof ListCache) {
1725
- var pairs = data.__data__;
1726
- if (!Map$1 || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
1727
- pairs.push([key, value]);
1728
- this.size = ++data.size;
1729
- return this;
1730
- }
1731
- data = this.__data__ = new MapCache(pairs);
1732
- }
1733
- data.set(key, value);
1734
- this.size = data.size;
1735
- return this;
1736
- }
1737
-
1738
- /**
1739
- * Creates a stack cache object to store key-value pairs.
1740
- *
1741
- * @private
1742
- * @constructor
1743
- * @param {Array} [entries] The key-value pairs to cache.
1744
- */
1745
- function Stack(entries) {
1746
- var data = this.__data__ = new ListCache(entries);
1747
- this.size = data.size;
1748
- }
1749
-
1750
- // Add methods to `Stack`.
1751
- Stack.prototype.clear = stackClear;
1752
- Stack.prototype['delete'] = stackDelete;
1753
- Stack.prototype.get = stackGet;
1754
- Stack.prototype.has = stackHas;
1755
- Stack.prototype.set = stackSet;
1756
-
1757
- /** Detect free variable `exports`. */
1758
- var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
1759
-
1760
- /** Detect free variable `module`. */
1761
- freeExports && typeof module == 'object' && module && !module.nodeType && module;
1762
-
1763
- /**
1764
- * Creates a clone of `buffer`.
1765
- *
1766
- * @private
1767
- * @param {Buffer} buffer The buffer to clone.
1768
- * @param {boolean} [isDeep] Specify a deep clone.
1769
- * @returns {Buffer} Returns the cloned buffer.
1770
- */
1771
- function cloneBuffer(buffer, isDeep) {
1772
- {
1773
- return buffer.slice();
1774
- }
1775
- }
1776
-
1777
- /**
1778
- * A specialized version of `_.filter` for arrays without support for
1779
- * iteratee shorthands.
1780
- *
1781
- * @private
1782
- * @param {Array} [array] The array to iterate over.
1783
- * @param {Function} predicate The function invoked per iteration.
1784
- * @returns {Array} Returns the new filtered array.
1785
- */
1786
- function arrayFilter(array, predicate) {
1787
- var index = -1,
1788
- length = array == null ? 0 : array.length,
1789
- resIndex = 0,
1790
- result = [];
1791
-
1792
- while (++index < length) {
1793
- var value = array[index];
1794
- if (predicate(value, index, array)) {
1795
- result[resIndex++] = value;
1796
- }
1797
- }
1798
- return result;
1799
- }
1800
-
1801
- /**
1802
- * This method returns a new empty array.
1803
- *
1804
- * @static
1805
- * @memberOf _
1806
- * @since 4.13.0
1807
- * @category Util
1808
- * @returns {Array} Returns the new empty array.
1809
- * @example
1810
- *
1811
- * var arrays = _.times(2, _.stubArray);
1812
- *
1813
- * console.log(arrays);
1814
- * // => [[], []]
1815
- *
1816
- * console.log(arrays[0] === arrays[1]);
1817
- * // => false
1818
- */
1819
- function stubArray() {
1820
- return [];
1821
- }
1822
-
1823
- /** Used for built-in method references. */
1824
- var objectProto$1 = Object.prototype;
1825
-
1826
- /** Built-in value references. */
1827
- var propertyIsEnumerable = objectProto$1.propertyIsEnumerable;
1828
-
1829
- /* Built-in method references for those with the same name as other `lodash` methods. */
1830
- var nativeGetSymbols = Object.getOwnPropertySymbols;
1831
-
1832
- /**
1833
- * Creates an array of the own enumerable symbols of `object`.
1834
- *
1835
- * @private
1836
- * @param {Object} object The object to query.
1837
- * @returns {Array} Returns the array of symbols.
1838
- */
1839
- var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
1840
- if (object == null) {
1841
- return [];
1842
- }
1843
- object = Object(object);
1844
- return arrayFilter(nativeGetSymbols(object), function(symbol) {
1845
- return propertyIsEnumerable.call(object, symbol);
1846
- });
1847
- };
1848
-
1849
- /**
1850
- * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
1851
- * `keysFunc` and `symbolsFunc` to get the enumerable property names and
1852
- * symbols of `object`.
1853
- *
1854
- * @private
1855
- * @param {Object} object The object to query.
1856
- * @param {Function} keysFunc The function to get the keys of `object`.
1857
- * @param {Function} symbolsFunc The function to get the symbols of `object`.
1858
- * @returns {Array} Returns the array of property names and symbols.
1859
- */
1860
- function baseGetAllKeys(object, keysFunc, symbolsFunc) {
1861
- var result = keysFunc(object);
1862
- return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
1863
- }
1864
-
1865
- /**
1866
- * Creates an array of own enumerable property names and symbols of `object`.
1867
- *
1868
- * @private
1869
- * @param {Object} object The object to query.
1870
- * @returns {Array} Returns the array of property names and symbols.
1871
- */
1872
- function getAllKeys(object) {
1873
- return baseGetAllKeys(object, keys, getSymbols);
1874
- }
1875
-
1876
- /* Built-in method references that are verified to be native. */
1877
- var DataView$1 = getNative(root, 'DataView');
1878
-
1879
- /* Built-in method references that are verified to be native. */
1880
- var Promise$1 = getNative(root, 'Promise');
1881
-
1882
- /* Built-in method references that are verified to be native. */
1883
- var Set$1 = getNative(root, 'Set');
1884
-
1885
- /** `Object#toString` result references. */
1886
- var mapTag$3 = '[object Map]',
1887
- objectTag$1 = '[object Object]',
1888
- promiseTag = '[object Promise]',
1889
- setTag$3 = '[object Set]',
1890
- weakMapTag$1 = '[object WeakMap]';
1891
-
1892
- var dataViewTag$2 = '[object DataView]';
1893
-
1894
- /** Used to detect maps, sets, and weakmaps. */
1895
- var dataViewCtorString = toSource(DataView$1),
1896
- mapCtorString = toSource(Map$1),
1897
- promiseCtorString = toSource(Promise$1),
1898
- setCtorString = toSource(Set$1),
1899
- weakMapCtorString = toSource(WeakMap);
1900
-
1901
- /**
1902
- * Gets the `toStringTag` of `value`.
1903
- *
1904
- * @private
1905
- * @param {*} value The value to query.
1906
- * @returns {string} Returns the `toStringTag`.
1907
- */
1908
- var getTag = baseGetTag;
1909
-
1910
- // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
1911
- if ((DataView$1 && getTag(new DataView$1(new ArrayBuffer(1))) != dataViewTag$2) ||
1912
- (Map$1 && getTag(new Map$1) != mapTag$3) ||
1913
- (Promise$1 && getTag(Promise$1.resolve()) != promiseTag) ||
1914
- (Set$1 && getTag(new Set$1) != setTag$3) ||
1915
- (WeakMap && getTag(new WeakMap) != weakMapTag$1)) {
1916
- getTag = function(value) {
1917
- var result = baseGetTag(value),
1918
- Ctor = result == objectTag$1 ? value.constructor : undefined,
1919
- ctorString = Ctor ? toSource(Ctor) : '';
1920
-
1921
- if (ctorString) {
1922
- switch (ctorString) {
1923
- case dataViewCtorString: return dataViewTag$2;
1924
- case mapCtorString: return mapTag$3;
1925
- case promiseCtorString: return promiseTag;
1926
- case setCtorString: return setTag$3;
1927
- case weakMapCtorString: return weakMapTag$1;
1928
- }
1929
- }
1930
- return result;
1931
- };
1932
- }
1933
-
1934
- /** Used for built-in method references. */
1935
- var objectProto = Object.prototype;
1936
-
1937
- /** Used to check objects for own properties. */
1938
- var hasOwnProperty = objectProto.hasOwnProperty;
1939
-
1940
- /**
1941
- * Initializes an array clone.
1942
- *
1943
- * @private
1944
- * @param {Array} array The array to clone.
1945
- * @returns {Array} Returns the initialized clone.
1946
- */
1947
- function initCloneArray(array) {
1948
- var length = array.length,
1949
- result = new array.constructor(length);
1950
-
1951
- // Add properties assigned by `RegExp#exec`.
1952
- if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
1953
- result.index = array.index;
1954
- result.input = array.input;
1955
- }
1956
- return result;
1957
- }
1958
-
1959
- /** Built-in value references. */
1960
- var Uint8Array$1 = root.Uint8Array;
1961
-
1962
- /**
1963
- * Creates a clone of `arrayBuffer`.
1964
- *
1965
- * @private
1966
- * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
1967
- * @returns {ArrayBuffer} Returns the cloned array buffer.
1968
- */
1969
- function cloneArrayBuffer(arrayBuffer) {
1970
- var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
1971
- new Uint8Array$1(result).set(new Uint8Array$1(arrayBuffer));
1972
- return result;
1973
- }
1974
-
1975
- /**
1976
- * Creates a clone of `dataView`.
1977
- *
1978
- * @private
1979
- * @param {Object} dataView The data view to clone.
1980
- * @param {boolean} [isDeep] Specify a deep clone.
1981
- * @returns {Object} Returns the cloned data view.
1982
- */
1983
- function cloneDataView(dataView, isDeep) {
1984
- var buffer = cloneArrayBuffer(dataView.buffer) ;
1985
- return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
1986
- }
1987
-
1988
- /** Used to match `RegExp` flags from their coerced string values. */
1989
- var reFlags = /\w*$/;
1990
-
1991
- /**
1992
- * Creates a clone of `regexp`.
1993
- *
1994
- * @private
1995
- * @param {Object} regexp The regexp to clone.
1996
- * @returns {Object} Returns the cloned regexp.
1997
- */
1998
- function cloneRegExp(regexp) {
1999
- var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
2000
- result.lastIndex = regexp.lastIndex;
2001
- return result;
2002
- }
2003
-
2004
- /** Used to convert symbols to primitives and strings. */
2005
- var symbolProto = Symbol ? Symbol.prototype : undefined,
2006
- symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
2007
-
2008
- /**
2009
- * Creates a clone of the `symbol` object.
2010
- *
2011
- * @private
2012
- * @param {Object} symbol The symbol object to clone.
2013
- * @returns {Object} Returns the cloned symbol object.
2014
- */
2015
- function cloneSymbol(symbol) {
2016
- return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
2017
- }
2018
-
2019
- /**
2020
- * Creates a clone of `typedArray`.
2021
- *
2022
- * @private
2023
- * @param {Object} typedArray The typed array to clone.
2024
- * @param {boolean} [isDeep] Specify a deep clone.
2025
- * @returns {Object} Returns the cloned typed array.
2026
- */
2027
- function cloneTypedArray(typedArray, isDeep) {
2028
- var buffer = cloneArrayBuffer(typedArray.buffer) ;
2029
- return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
2030
- }
2031
-
2032
- /** `Object#toString` result references. */
2033
- var boolTag$1 = '[object Boolean]',
2034
- dateTag$1 = '[object Date]',
2035
- mapTag$2 = '[object Map]',
2036
- numberTag$1 = '[object Number]',
2037
- regexpTag$1 = '[object RegExp]',
2038
- setTag$2 = '[object Set]',
2039
- stringTag$1 = '[object String]',
2040
- symbolTag$1 = '[object Symbol]';
2041
-
2042
- var arrayBufferTag$1 = '[object ArrayBuffer]',
2043
- dataViewTag$1 = '[object DataView]',
2044
- float32Tag$1 = '[object Float32Array]',
2045
- float64Tag$1 = '[object Float64Array]',
2046
- int8Tag$1 = '[object Int8Array]',
2047
- int16Tag$1 = '[object Int16Array]',
2048
- int32Tag$1 = '[object Int32Array]',
2049
- uint8Tag$1 = '[object Uint8Array]',
2050
- uint8ClampedTag$1 = '[object Uint8ClampedArray]',
2051
- uint16Tag$1 = '[object Uint16Array]',
2052
- uint32Tag$1 = '[object Uint32Array]';
2053
-
2054
- /**
2055
- * Initializes an object clone based on its `toStringTag`.
2056
- *
2057
- * **Note:** This function only supports cloning values with tags of
2058
- * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
2059
- *
2060
- * @private
2061
- * @param {Object} object The object to clone.
2062
- * @param {string} tag The `toStringTag` of the object to clone.
2063
- * @param {boolean} [isDeep] Specify a deep clone.
2064
- * @returns {Object} Returns the initialized clone.
2065
- */
2066
- function initCloneByTag(object, tag, isDeep) {
2067
- var Ctor = object.constructor;
2068
- switch (tag) {
2069
- case arrayBufferTag$1:
2070
- return cloneArrayBuffer(object);
2071
-
2072
- case boolTag$1:
2073
- case dateTag$1:
2074
- return new Ctor(+object);
2075
-
2076
- case dataViewTag$1:
2077
- return cloneDataView(object);
2078
-
2079
- case float32Tag$1: case float64Tag$1:
2080
- case int8Tag$1: case int16Tag$1: case int32Tag$1:
2081
- case uint8Tag$1: case uint8ClampedTag$1: case uint16Tag$1: case uint32Tag$1:
2082
- return cloneTypedArray(object);
2083
-
2084
- case mapTag$2:
2085
- return new Ctor;
2086
-
2087
- case numberTag$1:
2088
- case stringTag$1:
2089
- return new Ctor(object);
2090
-
2091
- case regexpTag$1:
2092
- return cloneRegExp(object);
2093
-
2094
- case setTag$2:
2095
- return new Ctor;
2096
-
2097
- case symbolTag$1:
2098
- return cloneSymbol(object);
2099
- }
2100
- }
2101
-
2102
- /**
2103
- * Initializes an object clone.
2104
- *
2105
- * @private
2106
- * @param {Object} object The object to clone.
2107
- * @returns {Object} Returns the initialized clone.
2108
- */
2109
- function initCloneObject(object) {
2110
- return (typeof object.constructor == 'function' && !isPrototype(object))
2111
- ? baseCreate(getPrototype(object))
2112
- : {};
2113
- }
2114
-
2115
- /** `Object#toString` result references. */
2116
- var mapTag$1 = '[object Map]';
2117
-
2118
- /**
2119
- * The base implementation of `_.isMap` without Node.js optimizations.
2120
- *
2121
- * @private
2122
- * @param {*} value The value to check.
2123
- * @returns {boolean} Returns `true` if `value` is a map, else `false`.
2124
- */
2125
- function baseIsMap(value) {
2126
- return isObjectLike(value) && getTag(value) == mapTag$1;
2127
- }
2128
-
2129
- /* Node.js helper references. */
2130
- var nodeIsMap = nodeUtil && nodeUtil.isMap;
2131
-
2132
- /**
2133
- * Checks if `value` is classified as a `Map` object.
2134
- *
2135
- * @static
2136
- * @memberOf _
2137
- * @since 4.3.0
2138
- * @category Lang
2139
- * @param {*} value The value to check.
2140
- * @returns {boolean} Returns `true` if `value` is a map, else `false`.
2141
- * @example
2142
- *
2143
- * _.isMap(new Map);
2144
- * // => true
2145
- *
2146
- * _.isMap(new WeakMap);
2147
- * // => false
2148
- */
2149
- var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
2150
-
2151
- /** `Object#toString` result references. */
2152
- var setTag$1 = '[object Set]';
2153
-
2154
- /**
2155
- * The base implementation of `_.isSet` without Node.js optimizations.
2156
- *
2157
- * @private
2158
- * @param {*} value The value to check.
2159
- * @returns {boolean} Returns `true` if `value` is a set, else `false`.
2160
- */
2161
- function baseIsSet(value) {
2162
- return isObjectLike(value) && getTag(value) == setTag$1;
2163
- }
2164
-
2165
- /* Node.js helper references. */
2166
- var nodeIsSet = nodeUtil && nodeUtil.isSet;
2167
-
2168
- /**
2169
- * Checks if `value` is classified as a `Set` object.
2170
- *
2171
- * @static
2172
- * @memberOf _
2173
- * @since 4.3.0
2174
- * @category Lang
2175
- * @param {*} value The value to check.
2176
- * @returns {boolean} Returns `true` if `value` is a set, else `false`.
2177
- * @example
2178
- *
2179
- * _.isSet(new Set);
2180
- * // => true
2181
- *
2182
- * _.isSet(new WeakSet);
2183
- * // => false
2184
- */
2185
- var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
2186
-
2187
- /** `Object#toString` result references. */
2188
- var argsTag = '[object Arguments]',
2189
- arrayTag = '[object Array]',
2190
- boolTag = '[object Boolean]',
2191
- dateTag = '[object Date]',
2192
- errorTag = '[object Error]',
2193
- funcTag = '[object Function]',
2194
- genTag = '[object GeneratorFunction]',
2195
- mapTag = '[object Map]',
2196
- numberTag = '[object Number]',
2197
- objectTag = '[object Object]',
2198
- regexpTag = '[object RegExp]',
2199
- setTag = '[object Set]',
2200
- stringTag = '[object String]',
2201
- symbolTag = '[object Symbol]',
2202
- weakMapTag = '[object WeakMap]';
2203
-
2204
- var arrayBufferTag = '[object ArrayBuffer]',
2205
- dataViewTag = '[object DataView]',
2206
- float32Tag = '[object Float32Array]',
2207
- float64Tag = '[object Float64Array]',
2208
- int8Tag = '[object Int8Array]',
2209
- int16Tag = '[object Int16Array]',
2210
- int32Tag = '[object Int32Array]',
2211
- uint8Tag = '[object Uint8Array]',
2212
- uint8ClampedTag = '[object Uint8ClampedArray]',
2213
- uint16Tag = '[object Uint16Array]',
2214
- uint32Tag = '[object Uint32Array]';
2215
-
2216
- /** Used to identify `toStringTag` values supported by `_.clone`. */
2217
- var cloneableTags = {};
2218
- cloneableTags[argsTag] = cloneableTags[arrayTag] =
2219
- cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
2220
- cloneableTags[boolTag] = cloneableTags[dateTag] =
2221
- cloneableTags[float32Tag] = cloneableTags[float64Tag] =
2222
- cloneableTags[int8Tag] = cloneableTags[int16Tag] =
2223
- cloneableTags[int32Tag] = cloneableTags[mapTag] =
2224
- cloneableTags[numberTag] = cloneableTags[objectTag] =
2225
- cloneableTags[regexpTag] = cloneableTags[setTag] =
2226
- cloneableTags[stringTag] = cloneableTags[symbolTag] =
2227
- cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
2228
- cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
2229
- cloneableTags[errorTag] = cloneableTags[funcTag] =
2230
- cloneableTags[weakMapTag] = false;
2231
-
2232
- /**
2233
- * The base implementation of `_.clone` and `_.cloneDeep` which tracks
2234
- * traversed objects.
2235
- *
2236
- * @private
2237
- * @param {*} value The value to clone.
2238
- * @param {boolean} bitmask The bitmask flags.
2239
- * 1 - Deep clone
2240
- * 2 - Flatten inherited properties
2241
- * 4 - Clone symbols
2242
- * @param {Function} [customizer] The function to customize cloning.
2243
- * @param {string} [key] The key of `value`.
2244
- * @param {Object} [object] The parent object of `value`.
2245
- * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
2246
- * @returns {*} Returns the cloned value.
2247
- */
2248
- function baseClone(value, bitmask, customizer, key, object, stack) {
2249
- var result;
2250
- if (result !== undefined) {
2251
- return result;
2252
- }
2253
- if (!isObject(value)) {
2254
- return value;
2255
- }
2256
- var isArr = isArray(value);
2257
- if (isArr) {
2258
- result = initCloneArray(value);
2259
- } else {
2260
- var tag = getTag(value),
2261
- isFunc = tag == funcTag || tag == genTag;
2262
-
2263
- if (isBuffer(value)) {
2264
- return cloneBuffer(value);
2265
- }
2266
- if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
2267
- result = (isFunc) ? {} : initCloneObject(value);
2268
- } else {
2269
- if (!cloneableTags[tag]) {
2270
- return object ? value : {};
2271
- }
2272
- result = initCloneByTag(value, tag);
2273
- }
2274
- }
2275
- // Check for circular references and return its corresponding clone.
2276
- stack || (stack = new Stack);
2277
- var stacked = stack.get(value);
2278
- if (stacked) {
2279
- return stacked;
2280
- }
2281
- stack.set(value, result);
2282
-
2283
- if (isSet(value)) {
2284
- value.forEach(function(subValue) {
2285
- result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
2286
- });
2287
- } else if (isMap(value)) {
2288
- value.forEach(function(subValue, key) {
2289
- result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
2290
- });
2291
- }
2292
-
2293
- var keysFunc = (getAllKeys)
2294
- ;
2295
-
2296
- var props = isArr ? undefined : keysFunc(value);
2297
- arrayEach(props || value, function(subValue, key) {
2298
- if (props) {
2299
- key = subValue;
2300
- subValue = value[key];
2301
- }
2302
- // Recursively populate clone (susceptible to call stack limits).
2303
- assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
2304
- });
2305
- return result;
2306
- }
2307
-
2308
- /** Used to compose bitmasks for cloning. */
2309
- var CLONE_DEEP_FLAG = 1,
2310
- CLONE_SYMBOLS_FLAG = 4;
2311
-
2312
- /**
2313
- * This method is like `_.clone` except that it recursively clones `value`.
2314
- *
2315
- * @static
2316
- * @memberOf _
2317
- * @since 1.0.0
2318
- * @category Lang
2319
- * @param {*} value The value to recursively clone.
2320
- * @returns {*} Returns the deep cloned value.
2321
- * @see _.clone
2322
- * @example
2323
- *
2324
- * var objects = [{ 'a': 1 }, { 'b': 2 }];
2325
- *
2326
- * var deep = _.cloneDeep(objects);
2327
- * console.log(deep[0] === objects[0]);
2328
- * // => false
2329
- */
2330
- function cloneDeep(value) {
2331
- return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
2332
- }
2333
-
2334
317
  var __rest = (undefined && undefined.__rest) || function (s, e) {
2335
318
  var t = {};
2336
319
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
@@ -2343,25 +326,13 @@ var __rest = (undefined && undefined.__rest) || function (s, e) {
2343
326
  return t;
2344
327
  };
2345
328
  class ObjectHelper {
2346
- static safeStringify(obj, indent = 2) {
2347
- const seen = new WeakSet();
2348
- return JSON.stringify(obj, (_key, value) => {
2349
- if (typeof value === 'object' && value !== null) {
2350
- if (seen.has(value)) {
2351
- return undefined;
2352
- }
2353
- seen.add(value);
2354
- }
2355
- return value;
2356
- }, indent);
2357
- }
2358
329
  static generateUUID() {
2359
330
  return Math.random().toString(36).substr(2, 9);
2360
331
  }
2361
332
  static clone(objOrObjs) {
2362
333
  const cloneObject = (obj) => {
2363
- const rest = __rest(obj, ["_store", "_elementRef", "totalWidth", "totalHeight"]);
2364
- return cloneDeep(rest);
334
+ const remainingProps = __rest(obj, ["_store", "_elementRef", "totalWidth", "totalHeight"]);
335
+ return structuredClone(remainingProps);
2365
336
  };
2366
337
  if (Array.isArray(objOrObjs)) {
2367
338
  return objOrObjs.map(cloneObject);
@@ -3488,17 +1459,15 @@ class KritzelEraserTool extends KritzelBaseTool {
3488
1459
  }
3489
1460
 
3490
1461
  class KritzelImage extends KritzelBaseObject {
3491
- constructor(store, img) {
1462
+ constructor(store) {
3492
1463
  super(store);
3493
1464
  this.__class__ = 'KritzelImage';
1465
+ this.src = '';
3494
1466
  this.debugInfoVisible = true;
3495
- this.img = img;
3496
1467
  this.x = 0;
3497
1468
  this.y = 0;
3498
1469
  this.translateX = 0;
3499
1470
  this.translateY = 0;
3500
- this.width = img.width;
3501
- this.height = img.height;
3502
1471
  this.scale = this._store.state.scale;
3503
1472
  }
3504
1473
  resize(x, y, width, height) {
@@ -3895,6 +1864,7 @@ class KritzelRotationHandler extends KritzelBaseHandler {
3895
1864
  const currentRotation = Math.atan2(groupCenterY - cursorY, groupCenterX - cursorX);
3896
1865
  this.rotation = currentRotation - this.initialRotation;
3897
1866
  this._store.state.selectionGroup.rotate(this.rotation);
1867
+ this._store.rerender();
3898
1868
  clearTimeout(this._store.state.longTouchTimeout);
3899
1869
  }
3900
1870
  }
@@ -4357,7 +2327,7 @@ class KritzelReviver {
4357
2327
  revivedObj = new KritzelText(this._store, obj.fontSize, obj.fontFamily).revive(obj);
4358
2328
  break;
4359
2329
  case 'KritzelImage':
4360
- revivedObj = new KritzelImage(this._store, obj.img).revive(obj);
2330
+ revivedObj = new KritzelImage(this._store).revive(obj);
4361
2331
  break;
4362
2332
  case 'KritzelSelectionGroup':
4363
2333
  revivedObj = new KritzelSelectionGroup(this._store).revive(obj);
@@ -4459,13 +2429,13 @@ class KritzelSelectionGroup extends KritzelBaseObject {
4459
2429
  const heightScaleFactor = height / this.height;
4460
2430
  const deltaX = x - this.translateX;
4461
2431
  const deltaY = y - this.translateY;
4462
- this.objects.forEach(obj => {
4463
- const updatedWidth = obj.width * widthScaleFactor;
4464
- const updatedHeight = obj.height * heightScaleFactor;
4465
- const updatedX = obj.translateX + deltaX + (obj.translateX - this.translateX) * (widthScaleFactor - 1);
4466
- const updatedY = obj.translateY + deltaY + (obj.translateY - this.translateY) * (heightScaleFactor - 1);
4467
- obj.resize(updatedX, updatedY, updatedWidth, updatedHeight);
4468
- this._store.state.objectsOctree.update(obj);
2432
+ this.objects.forEach(child => {
2433
+ const updatedWidth = child.width * widthScaleFactor;
2434
+ const updatedHeight = child.height * heightScaleFactor;
2435
+ const updatedX = child.translateX + deltaX + (child.translateX - this.translateX) * (widthScaleFactor - 1);
2436
+ const updatedY = child.translateY + deltaY + (child.translateY - this.translateY) * (heightScaleFactor - 1);
2437
+ child.resize(updatedX, updatedY, updatedWidth, updatedHeight);
2438
+ this._store.state.objectsOctree.update(child);
4469
2439
  });
4470
2440
  this.refreshObjectDimensions();
4471
2441
  this.unchangedObjects = ObjectHelper.clone(this.objects);
@@ -4486,6 +2456,7 @@ class KritzelSelectionGroup extends KritzelBaseObject {
4486
2456
  child.translateX = centerX + rotatedX - child.totalWidth / 2 / child.scale;
4487
2457
  child.translateY = centerY + rotatedY - child.totalHeight / 2 / child.scale;
4488
2458
  child.rotation = this.objects.length === 1 ? value : value + unchangedChild.rotation;
2459
+ this._store.state.objectsOctree.update(child);
4489
2460
  });
4490
2461
  }
4491
2462
  copy() {
@@ -4628,7 +2599,8 @@ class KritzelImageTool extends KritzelBaseTool {
4628
2599
  return { scaledWidth, scaledHeight };
4629
2600
  }
4630
2601
  createKritzelImage(img, width, height) {
4631
- const image = new KritzelImage(this._store, img);
2602
+ const image = new KritzelImage(this._store);
2603
+ image.src = img.src;
4632
2604
  image.width = width;
4633
2605
  image.height = height;
4634
2606
  image.zIndex = this._store.currentZIndex;
@@ -5181,11 +3153,11 @@ class KritzelOctree {
5181
3153
  ];
5182
3154
  }
5183
3155
  intersects(a, b) {
5184
- return !((a.x >= b.x + b.width || // a is completely to the right of b
3156
+ return !(a.x >= b.x + b.width || // a is completely to the right of b
5185
3157
  a.x + a.width <= b.x || // a is completely to the left of b
5186
3158
  a.y >= b.y + b.height || // a is completely below b
5187
3159
  a.y + a.height <= b.y // a is completely above b
5188
- ));
3160
+ );
5189
3161
  }
5190
3162
  }
5191
3163
 
@@ -5958,7 +3930,7 @@ const KritzelEngine = class {
5958
3930
  width: object === null || object === void 0 ? void 0 : object.width.toString(),
5959
3931
  position: 'absolute',
5960
3932
  overflow: 'visible',
5961
- }, viewBox: object === null || object === void 0 ? void 0 : object.viewBox }, h("path", { d: object === null || object === void 0 ? void 0 : object.d, fill: object.fill, stroke: object === null || object === void 0 ? void 0 : object.stroke }))), object instanceof KritzelImage && (h("img", { ref: el => object.mount(el), src: object.img.src, style: {
3933
+ }, viewBox: object === null || object === void 0 ? void 0 : object.viewBox }, h("path", { d: object === null || object === void 0 ? void 0 : object.d, fill: object.fill, stroke: object === null || object === void 0 ? void 0 : object.stroke }))), object instanceof KritzelImage && (h("img", { ref: el => object.mount(el), src: object.src, style: {
5962
3934
  width: '100%',
5963
3935
  height: '100%',
5964
3936
  userSelect: 'none',
@@ -6025,7 +3997,7 @@ const KritzelEngine = class {
6025
3997
  fill: 'transparent',
6026
3998
  cursor: 'grab',
6027
3999
  }, visibility: object.selected && !this.isSelecting ? 'visible' : 'hidden' }), h("g", { style: { display: this.store.state.debugInfo.showObjectInfo ? 'block' : 'none', pointerEvents: 'none' } }, h("foreignObject", { x: object.totalWidth.toString(), y: "0", width: "400px", height: "160px", style: { minHeight: '0', minWidth: '0', display: object.debugInfoVisible ? 'block' : 'none' } }, h("div", { style: { width: '100%', height: '100%' } }, h("div", { style: { whiteSpace: 'nowrap' } }, "zIndex: ", object.zIndex), h("div", { style: { whiteSpace: 'nowrap' } }, "translateX: ", object.translateX), h("div", { style: { whiteSpace: 'nowrap' } }, "translateY: ", object.translateY), h("div", { style: { whiteSpace: 'nowrap' } }, "width: ", object.width), h("div", { style: { whiteSpace: 'nowrap' } }, "height: ", object.height), h("div", { style: { whiteSpace: 'nowrap' } }, "scale: ", object.scale), h("div", { style: { whiteSpace: 'nowrap' } }, "rotation: ", object.rotation)))))));
6028
- }), h("svg", { key: '76788f88c63996a85778fac600f568e651f2604f', class: "object", xmlns: "http://www.w3.org/2000/svg", style: {
4000
+ }), h("svg", { key: '9f862215ce2de4cc0745942bc946897f5f5e24b7', class: "object", xmlns: "http://www.w3.org/2000/svg", style: {
6029
4001
  height: (_u = this.store.state.currentPath) === null || _u === void 0 ? void 0 : _u.height.toString(),
6030
4002
  width: (_v = this.store.state.currentPath) === null || _v === void 0 ? void 0 : _v.width.toString(),
6031
4003
  left: '0',
@@ -6035,12 +4007,12 @@ const KritzelEngine = class {
6035
4007
  transform: (_x = this.store.state.currentPath) === null || _x === void 0 ? void 0 : _x.transformationMatrix,
6036
4008
  transformOrigin: 'top left',
6037
4009
  overflow: 'visible',
6038
- }, viewBox: (_y = this.store.state.currentPath) === null || _y === void 0 ? void 0 : _y.viewBox }, h("path", { key: 'e0356205729f20a61f5bbac14393d4d607a7c865', d: (_z = this.store.state.currentPath) === null || _z === void 0 ? void 0 : _z.d, fill: (_0 = this.store.state.currentPath) === null || _0 === void 0 ? void 0 : _0.fill, stroke: (_1 = this.store.state.currentPath) === null || _1 === void 0 ? void 0 : _1.stroke }))), this.store.state.isContextMenuVisible && (h("kritzel-context-menu", { key: '23ab721c25518e6c6a6e6e163fa0753e054cb5e7', ref: el => (this.contextMenuElement = el), items: this.store.state.contextMenuItems, style: {
4010
+ }, viewBox: (_y = this.store.state.currentPath) === null || _y === void 0 ? void 0 : _y.viewBox }, h("path", { key: 'e1f0ea5ee56c8fb753438c978750151c688e9330', d: (_z = this.store.state.currentPath) === null || _z === void 0 ? void 0 : _z.d, fill: (_0 = this.store.state.currentPath) === null || _0 === void 0 ? void 0 : _0.fill, stroke: (_1 = this.store.state.currentPath) === null || _1 === void 0 ? void 0 : _1.stroke }))), this.store.state.isContextMenuVisible && (h("kritzel-context-menu", { key: '89184b62326fcfde61ee4922ec5d640b16a191a7', ref: el => (this.contextMenuElement = el), items: this.store.state.contextMenuItems, style: {
6039
4011
  position: 'fixed',
6040
4012
  left: `${this.store.state.contextMenuX}px`,
6041
4013
  top: `${this.store.state.contextMenuY}px`,
6042
4014
  zIndex: '10000',
6043
- }, onActionSelected: event => this.handleContextMenuAction(event) })), ((_2 = this.store.state) === null || _2 === void 0 ? void 0 : _2.activeTool) instanceof KritzelEraserTool && !this.store.state.isScaling && h("kritzel-cursor-trail", { key: '01f90ff856d6a3b0812ce47796fd59dbbf0cd52d' })));
4015
+ }, onActionSelected: event => this.handleContextMenuAction(event) })), ((_2 = this.store.state) === null || _2 === void 0 ? void 0 : _2.activeTool) instanceof KritzelEraserTool && !this.store.state.isScaling && h("kritzel-cursor-trail", { key: '8797da3afce7d97e0f94ec9f90522b9ad35bb71b' })));
6044
4016
  }
6045
4017
  get host() { return getElement(this); }
6046
4018
  };