@bigbinary/neeto-commons-frontend 3.0.1 → 3.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/utils.js CHANGED
@@ -3,7 +3,7 @@ import { values, curry, toPairs, pipe, omit, isEmpty } from 'ramda';
3
3
  import i18next from 'i18next';
4
4
  import { getRandomInt, preprocessForSerialization } from '@bigbinary/neeto-cist';
5
5
  import { Toastr } from '@bigbinary/neetoui';
6
- import require$$0 from 'util';
6
+ import { stringify, parse } from 'qs';
7
7
  import dayjs from 'dayjs';
8
8
  import relativeTime from 'dayjs/plugin/relativeTime';
9
9
  import updateLocale from 'dayjs/plugin/updateLocale';
@@ -486,2038 +486,6 @@ try {
486
486
  }
487
487
  }
488
488
 
489
- /* eslint complexity: [2, 18], max-statements: [2, 33] */
490
- var shams = function hasSymbols() {
491
- if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; }
492
- if (typeof Symbol.iterator === 'symbol') { return true; }
493
-
494
- var obj = {};
495
- var sym = Symbol('test');
496
- var symObj = Object(sym);
497
- if (typeof sym === 'string') { return false; }
498
-
499
- if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; }
500
- if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; }
501
-
502
- // temp disabled per https://github.com/ljharb/object.assign/issues/17
503
- // if (sym instanceof Symbol) { return false; }
504
- // temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4
505
- // if (!(symObj instanceof Symbol)) { return false; }
506
-
507
- // if (typeof Symbol.prototype.toString !== 'function') { return false; }
508
- // if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; }
509
-
510
- var symVal = 42;
511
- obj[sym] = symVal;
512
- for (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop
513
- if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; }
514
-
515
- if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; }
516
-
517
- var syms = Object.getOwnPropertySymbols(obj);
518
- if (syms.length !== 1 || syms[0] !== sym) { return false; }
519
-
520
- if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; }
521
-
522
- if (typeof Object.getOwnPropertyDescriptor === 'function') {
523
- var descriptor = Object.getOwnPropertyDescriptor(obj, sym);
524
- if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; }
525
- }
526
-
527
- return true;
528
- };
529
-
530
- var origSymbol = typeof Symbol !== 'undefined' && Symbol;
531
- var hasSymbolSham = shams;
532
-
533
- var hasSymbols$1 = function hasNativeSymbols() {
534
- if (typeof origSymbol !== 'function') { return false; }
535
- if (typeof Symbol !== 'function') { return false; }
536
- if (typeof origSymbol('foo') !== 'symbol') { return false; }
537
- if (typeof Symbol('bar') !== 'symbol') { return false; }
538
-
539
- return hasSymbolSham();
540
- };
541
-
542
- /* eslint no-invalid-this: 1 */
543
-
544
- var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';
545
- var slice = Array.prototype.slice;
546
- var toStr$1 = Object.prototype.toString;
547
- var funcType = '[object Function]';
548
-
549
- var implementation$1 = function bind(that) {
550
- var target = this;
551
- if (typeof target !== 'function' || toStr$1.call(target) !== funcType) {
552
- throw new TypeError(ERROR_MESSAGE + target);
553
- }
554
- var args = slice.call(arguments, 1);
555
-
556
- var bound;
557
- var binder = function () {
558
- if (this instanceof bound) {
559
- var result = target.apply(
560
- this,
561
- args.concat(slice.call(arguments))
562
- );
563
- if (Object(result) === result) {
564
- return result;
565
- }
566
- return this;
567
- } else {
568
- return target.apply(
569
- that,
570
- args.concat(slice.call(arguments))
571
- );
572
- }
573
- };
574
-
575
- var boundLength = Math.max(0, target.length - args.length);
576
- var boundArgs = [];
577
- for (var i = 0; i < boundLength; i++) {
578
- boundArgs.push('$' + i);
579
- }
580
-
581
- bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder);
582
-
583
- if (target.prototype) {
584
- var Empty = function Empty() {};
585
- Empty.prototype = target.prototype;
586
- bound.prototype = new Empty();
587
- Empty.prototype = null;
588
- }
589
-
590
- return bound;
591
- };
592
-
593
- var implementation = implementation$1;
594
-
595
- var functionBind = Function.prototype.bind || implementation;
596
-
597
- var bind$1 = functionBind;
598
-
599
- var src = bind$1.call(Function.call, Object.prototype.hasOwnProperty);
600
-
601
- var undefined$1;
602
-
603
- var $SyntaxError = SyntaxError;
604
- var $Function = Function;
605
- var $TypeError$1 = TypeError;
606
-
607
- // eslint-disable-next-line consistent-return
608
- var getEvalledConstructor = function (expressionSyntax) {
609
- try {
610
- return $Function('"use strict"; return (' + expressionSyntax + ').constructor;')();
611
- } catch (e) {}
612
- };
613
-
614
- var $gOPD = Object.getOwnPropertyDescriptor;
615
- if ($gOPD) {
616
- try {
617
- $gOPD({}, '');
618
- } catch (e) {
619
- $gOPD = null; // this is IE 8, which has a broken gOPD
620
- }
621
- }
622
-
623
- var throwTypeError = function () {
624
- throw new $TypeError$1();
625
- };
626
- var ThrowTypeError = $gOPD
627
- ? (function () {
628
- try {
629
- // eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties
630
- arguments.callee; // IE 8 does not throw here
631
- return throwTypeError;
632
- } catch (calleeThrows) {
633
- try {
634
- // IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')
635
- return $gOPD(arguments, 'callee').get;
636
- } catch (gOPDthrows) {
637
- return throwTypeError;
638
- }
639
- }
640
- }())
641
- : throwTypeError;
642
-
643
- var hasSymbols = hasSymbols$1();
644
-
645
- var getProto = Object.getPrototypeOf || function (x) { return x.__proto__; }; // eslint-disable-line no-proto
646
-
647
- var needsEval = {};
648
-
649
- var TypedArray = typeof Uint8Array === 'undefined' ? undefined$1 : getProto(Uint8Array);
650
-
651
- var INTRINSICS = {
652
- '%AggregateError%': typeof AggregateError === 'undefined' ? undefined$1 : AggregateError,
653
- '%Array%': Array,
654
- '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined$1 : ArrayBuffer,
655
- '%ArrayIteratorPrototype%': hasSymbols ? getProto([][Symbol.iterator]()) : undefined$1,
656
- '%AsyncFromSyncIteratorPrototype%': undefined$1,
657
- '%AsyncFunction%': needsEval,
658
- '%AsyncGenerator%': needsEval,
659
- '%AsyncGeneratorFunction%': needsEval,
660
- '%AsyncIteratorPrototype%': needsEval,
661
- '%Atomics%': typeof Atomics === 'undefined' ? undefined$1 : Atomics,
662
- '%BigInt%': typeof BigInt === 'undefined' ? undefined$1 : BigInt,
663
- '%BigInt64Array%': typeof BigInt64Array === 'undefined' ? undefined$1 : BigInt64Array,
664
- '%BigUint64Array%': typeof BigUint64Array === 'undefined' ? undefined$1 : BigUint64Array,
665
- '%Boolean%': Boolean,
666
- '%DataView%': typeof DataView === 'undefined' ? undefined$1 : DataView,
667
- '%Date%': Date,
668
- '%decodeURI%': decodeURI,
669
- '%decodeURIComponent%': decodeURIComponent,
670
- '%encodeURI%': encodeURI,
671
- '%encodeURIComponent%': encodeURIComponent,
672
- '%Error%': Error,
673
- '%eval%': eval, // eslint-disable-line no-eval
674
- '%EvalError%': EvalError,
675
- '%Float32Array%': typeof Float32Array === 'undefined' ? undefined$1 : Float32Array,
676
- '%Float64Array%': typeof Float64Array === 'undefined' ? undefined$1 : Float64Array,
677
- '%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined$1 : FinalizationRegistry,
678
- '%Function%': $Function,
679
- '%GeneratorFunction%': needsEval,
680
- '%Int8Array%': typeof Int8Array === 'undefined' ? undefined$1 : Int8Array,
681
- '%Int16Array%': typeof Int16Array === 'undefined' ? undefined$1 : Int16Array,
682
- '%Int32Array%': typeof Int32Array === 'undefined' ? undefined$1 : Int32Array,
683
- '%isFinite%': isFinite,
684
- '%isNaN%': isNaN,
685
- '%IteratorPrototype%': hasSymbols ? getProto(getProto([][Symbol.iterator]())) : undefined$1,
686
- '%JSON%': typeof JSON === 'object' ? JSON : undefined$1,
687
- '%Map%': typeof Map === 'undefined' ? undefined$1 : Map,
688
- '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols ? undefined$1 : getProto(new Map()[Symbol.iterator]()),
689
- '%Math%': Math,
690
- '%Number%': Number,
691
- '%Object%': Object,
692
- '%parseFloat%': parseFloat,
693
- '%parseInt%': parseInt,
694
- '%Promise%': typeof Promise === 'undefined' ? undefined$1 : Promise,
695
- '%Proxy%': typeof Proxy === 'undefined' ? undefined$1 : Proxy,
696
- '%RangeError%': RangeError,
697
- '%ReferenceError%': ReferenceError,
698
- '%Reflect%': typeof Reflect === 'undefined' ? undefined$1 : Reflect,
699
- '%RegExp%': RegExp,
700
- '%Set%': typeof Set === 'undefined' ? undefined$1 : Set,
701
- '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols ? undefined$1 : getProto(new Set()[Symbol.iterator]()),
702
- '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined$1 : SharedArrayBuffer,
703
- '%String%': String,
704
- '%StringIteratorPrototype%': hasSymbols ? getProto(''[Symbol.iterator]()) : undefined$1,
705
- '%Symbol%': hasSymbols ? Symbol : undefined$1,
706
- '%SyntaxError%': $SyntaxError,
707
- '%ThrowTypeError%': ThrowTypeError,
708
- '%TypedArray%': TypedArray,
709
- '%TypeError%': $TypeError$1,
710
- '%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined$1 : Uint8Array,
711
- '%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined$1 : Uint8ClampedArray,
712
- '%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined$1 : Uint16Array,
713
- '%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined$1 : Uint32Array,
714
- '%URIError%': URIError,
715
- '%WeakMap%': typeof WeakMap === 'undefined' ? undefined$1 : WeakMap,
716
- '%WeakRef%': typeof WeakRef === 'undefined' ? undefined$1 : WeakRef,
717
- '%WeakSet%': typeof WeakSet === 'undefined' ? undefined$1 : WeakSet
718
- };
719
-
720
- try {
721
- null.error; // eslint-disable-line no-unused-expressions
722
- } catch (e) {
723
- // https://github.com/tc39/proposal-shadowrealm/pull/384#issuecomment-1364264229
724
- var errorProto = getProto(getProto(e));
725
- INTRINSICS['%Error.prototype%'] = errorProto;
726
- }
727
-
728
- var doEval = function doEval(name) {
729
- var value;
730
- if (name === '%AsyncFunction%') {
731
- value = getEvalledConstructor('async function () {}');
732
- } else if (name === '%GeneratorFunction%') {
733
- value = getEvalledConstructor('function* () {}');
734
- } else if (name === '%AsyncGeneratorFunction%') {
735
- value = getEvalledConstructor('async function* () {}');
736
- } else if (name === '%AsyncGenerator%') {
737
- var fn = doEval('%AsyncGeneratorFunction%');
738
- if (fn) {
739
- value = fn.prototype;
740
- }
741
- } else if (name === '%AsyncIteratorPrototype%') {
742
- var gen = doEval('%AsyncGenerator%');
743
- if (gen) {
744
- value = getProto(gen.prototype);
745
- }
746
- }
747
-
748
- INTRINSICS[name] = value;
749
-
750
- return value;
751
- };
752
-
753
- var LEGACY_ALIASES = {
754
- '%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'],
755
- '%ArrayPrototype%': ['Array', 'prototype'],
756
- '%ArrayProto_entries%': ['Array', 'prototype', 'entries'],
757
- '%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'],
758
- '%ArrayProto_keys%': ['Array', 'prototype', 'keys'],
759
- '%ArrayProto_values%': ['Array', 'prototype', 'values'],
760
- '%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'],
761
- '%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'],
762
- '%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'],
763
- '%BooleanPrototype%': ['Boolean', 'prototype'],
764
- '%DataViewPrototype%': ['DataView', 'prototype'],
765
- '%DatePrototype%': ['Date', 'prototype'],
766
- '%ErrorPrototype%': ['Error', 'prototype'],
767
- '%EvalErrorPrototype%': ['EvalError', 'prototype'],
768
- '%Float32ArrayPrototype%': ['Float32Array', 'prototype'],
769
- '%Float64ArrayPrototype%': ['Float64Array', 'prototype'],
770
- '%FunctionPrototype%': ['Function', 'prototype'],
771
- '%Generator%': ['GeneratorFunction', 'prototype'],
772
- '%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'],
773
- '%Int8ArrayPrototype%': ['Int8Array', 'prototype'],
774
- '%Int16ArrayPrototype%': ['Int16Array', 'prototype'],
775
- '%Int32ArrayPrototype%': ['Int32Array', 'prototype'],
776
- '%JSONParse%': ['JSON', 'parse'],
777
- '%JSONStringify%': ['JSON', 'stringify'],
778
- '%MapPrototype%': ['Map', 'prototype'],
779
- '%NumberPrototype%': ['Number', 'prototype'],
780
- '%ObjectPrototype%': ['Object', 'prototype'],
781
- '%ObjProto_toString%': ['Object', 'prototype', 'toString'],
782
- '%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'],
783
- '%PromisePrototype%': ['Promise', 'prototype'],
784
- '%PromiseProto_then%': ['Promise', 'prototype', 'then'],
785
- '%Promise_all%': ['Promise', 'all'],
786
- '%Promise_reject%': ['Promise', 'reject'],
787
- '%Promise_resolve%': ['Promise', 'resolve'],
788
- '%RangeErrorPrototype%': ['RangeError', 'prototype'],
789
- '%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'],
790
- '%RegExpPrototype%': ['RegExp', 'prototype'],
791
- '%SetPrototype%': ['Set', 'prototype'],
792
- '%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'],
793
- '%StringPrototype%': ['String', 'prototype'],
794
- '%SymbolPrototype%': ['Symbol', 'prototype'],
795
- '%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'],
796
- '%TypedArrayPrototype%': ['TypedArray', 'prototype'],
797
- '%TypeErrorPrototype%': ['TypeError', 'prototype'],
798
- '%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'],
799
- '%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'],
800
- '%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'],
801
- '%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'],
802
- '%URIErrorPrototype%': ['URIError', 'prototype'],
803
- '%WeakMapPrototype%': ['WeakMap', 'prototype'],
804
- '%WeakSetPrototype%': ['WeakSet', 'prototype']
805
- };
806
-
807
- var bind = functionBind;
808
- var hasOwn$1 = src;
809
- var $concat$1 = bind.call(Function.call, Array.prototype.concat);
810
- var $spliceApply = bind.call(Function.apply, Array.prototype.splice);
811
- var $replace$1 = bind.call(Function.call, String.prototype.replace);
812
- var $strSlice = bind.call(Function.call, String.prototype.slice);
813
- var $exec = bind.call(Function.call, RegExp.prototype.exec);
814
-
815
- /* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */
816
- var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
817
- var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */
818
- var stringToPath = function stringToPath(string) {
819
- var first = $strSlice(string, 0, 1);
820
- var last = $strSlice(string, -1);
821
- if (first === '%' && last !== '%') {
822
- throw new $SyntaxError('invalid intrinsic syntax, expected closing `%`');
823
- } else if (last === '%' && first !== '%') {
824
- throw new $SyntaxError('invalid intrinsic syntax, expected opening `%`');
825
- }
826
- var result = [];
827
- $replace$1(string, rePropName, function (match, number, quote, subString) {
828
- result[result.length] = quote ? $replace$1(subString, reEscapeChar, '$1') : number || match;
829
- });
830
- return result;
831
- };
832
- /* end adaptation */
833
-
834
- var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {
835
- var intrinsicName = name;
836
- var alias;
837
- if (hasOwn$1(LEGACY_ALIASES, intrinsicName)) {
838
- alias = LEGACY_ALIASES[intrinsicName];
839
- intrinsicName = '%' + alias[0] + '%';
840
- }
841
-
842
- if (hasOwn$1(INTRINSICS, intrinsicName)) {
843
- var value = INTRINSICS[intrinsicName];
844
- if (value === needsEval) {
845
- value = doEval(intrinsicName);
846
- }
847
- if (typeof value === 'undefined' && !allowMissing) {
848
- throw new $TypeError$1('intrinsic ' + name + ' exists, but is not available. Please file an issue!');
849
- }
850
-
851
- return {
852
- alias: alias,
853
- name: intrinsicName,
854
- value: value
855
- };
856
- }
857
-
858
- throw new $SyntaxError('intrinsic ' + name + ' does not exist!');
859
- };
860
-
861
- var getIntrinsic = function GetIntrinsic(name, allowMissing) {
862
- if (typeof name !== 'string' || name.length === 0) {
863
- throw new $TypeError$1('intrinsic name must be a non-empty string');
864
- }
865
- if (arguments.length > 1 && typeof allowMissing !== 'boolean') {
866
- throw new $TypeError$1('"allowMissing" argument must be a boolean');
867
- }
868
-
869
- if ($exec(/^%?[^%]*%?$/, name) === null) {
870
- throw new $SyntaxError('`%` may not be present anywhere but at the beginning and end of the intrinsic name');
871
- }
872
- var parts = stringToPath(name);
873
- var intrinsicBaseName = parts.length > 0 ? parts[0] : '';
874
-
875
- var intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing);
876
- var intrinsicRealName = intrinsic.name;
877
- var value = intrinsic.value;
878
- var skipFurtherCaching = false;
879
-
880
- var alias = intrinsic.alias;
881
- if (alias) {
882
- intrinsicBaseName = alias[0];
883
- $spliceApply(parts, $concat$1([0, 1], alias));
884
- }
885
-
886
- for (var i = 1, isOwn = true; i < parts.length; i += 1) {
887
- var part = parts[i];
888
- var first = $strSlice(part, 0, 1);
889
- var last = $strSlice(part, -1);
890
- if (
891
- (
892
- (first === '"' || first === "'" || first === '`')
893
- || (last === '"' || last === "'" || last === '`')
894
- )
895
- && first !== last
896
- ) {
897
- throw new $SyntaxError('property names with quotes must have matching quotes');
898
- }
899
- if (part === 'constructor' || !isOwn) {
900
- skipFurtherCaching = true;
901
- }
902
-
903
- intrinsicBaseName += '.' + part;
904
- intrinsicRealName = '%' + intrinsicBaseName + '%';
905
-
906
- if (hasOwn$1(INTRINSICS, intrinsicRealName)) {
907
- value = INTRINSICS[intrinsicRealName];
908
- } else if (value != null) {
909
- if (!(part in value)) {
910
- if (!allowMissing) {
911
- throw new $TypeError$1('base intrinsic for ' + name + ' exists, but the property is not available.');
912
- }
913
- return void undefined$1;
914
- }
915
- if ($gOPD && (i + 1) >= parts.length) {
916
- var desc = $gOPD(value, part);
917
- isOwn = !!desc;
918
-
919
- // By convention, when a data property is converted to an accessor
920
- // property to emulate a data property that does not suffer from
921
- // the override mistake, that accessor's getter is marked with
922
- // an `originalValue` property. Here, when we detect this, we
923
- // uphold the illusion by pretending to see that original data
924
- // property, i.e., returning the value rather than the getter
925
- // itself.
926
- if (isOwn && 'get' in desc && !('originalValue' in desc.get)) {
927
- value = desc.get;
928
- } else {
929
- value = value[part];
930
- }
931
- } else {
932
- isOwn = hasOwn$1(value, part);
933
- value = value[part];
934
- }
935
-
936
- if (isOwn && !skipFurtherCaching) {
937
- INTRINSICS[intrinsicRealName] = value;
938
- }
939
- }
940
- }
941
- return value;
942
- };
943
-
944
- var callBind$1 = {exports: {}};
945
-
946
- (function (module) {
947
-
948
- var bind = functionBind;
949
- var GetIntrinsic = getIntrinsic;
950
-
951
- var $apply = GetIntrinsic('%Function.prototype.apply%');
952
- var $call = GetIntrinsic('%Function.prototype.call%');
953
- var $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply);
954
-
955
- var $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true);
956
- var $defineProperty = GetIntrinsic('%Object.defineProperty%', true);
957
- var $max = GetIntrinsic('%Math.max%');
958
-
959
- if ($defineProperty) {
960
- try {
961
- $defineProperty({}, 'a', { value: 1 });
962
- } catch (e) {
963
- // IE 8 has a broken defineProperty
964
- $defineProperty = null;
965
- }
966
- }
967
-
968
- module.exports = function callBind(originalFunction) {
969
- var func = $reflectApply(bind, $call, arguments);
970
- if ($gOPD && $defineProperty) {
971
- var desc = $gOPD(func, 'length');
972
- if (desc.configurable) {
973
- // original length, plus the receiver, minus any additional arguments (after the receiver)
974
- $defineProperty(
975
- func,
976
- 'length',
977
- { value: 1 + $max(0, originalFunction.length - (arguments.length - 1)) }
978
- );
979
- }
980
- }
981
- return func;
982
- };
983
-
984
- var applyBind = function applyBind() {
985
- return $reflectApply(bind, $apply, arguments);
986
- };
987
-
988
- if ($defineProperty) {
989
- $defineProperty(module.exports, 'apply', { value: applyBind });
990
- } else {
991
- module.exports.apply = applyBind;
992
- }
993
- } (callBind$1));
994
-
995
- var GetIntrinsic$1 = getIntrinsic;
996
-
997
- var callBind = callBind$1.exports;
998
-
999
- var $indexOf = callBind(GetIntrinsic$1('String.prototype.indexOf'));
1000
-
1001
- var callBound$1 = function callBoundIntrinsic(name, allowMissing) {
1002
- var intrinsic = GetIntrinsic$1(name, !!allowMissing);
1003
- if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) {
1004
- return callBind(intrinsic);
1005
- }
1006
- return intrinsic;
1007
- };
1008
-
1009
- var util_inspect = require$$0.inspect;
1010
-
1011
- var hasMap = typeof Map === 'function' && Map.prototype;
1012
- var mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, 'size') : null;
1013
- var mapSize = hasMap && mapSizeDescriptor && typeof mapSizeDescriptor.get === 'function' ? mapSizeDescriptor.get : null;
1014
- var mapForEach = hasMap && Map.prototype.forEach;
1015
- var hasSet = typeof Set === 'function' && Set.prototype;
1016
- var setSizeDescriptor = Object.getOwnPropertyDescriptor && hasSet ? Object.getOwnPropertyDescriptor(Set.prototype, 'size') : null;
1017
- var setSize = hasSet && setSizeDescriptor && typeof setSizeDescriptor.get === 'function' ? setSizeDescriptor.get : null;
1018
- var setForEach = hasSet && Set.prototype.forEach;
1019
- var hasWeakMap = typeof WeakMap === 'function' && WeakMap.prototype;
1020
- var weakMapHas = hasWeakMap ? WeakMap.prototype.has : null;
1021
- var hasWeakSet = typeof WeakSet === 'function' && WeakSet.prototype;
1022
- var weakSetHas = hasWeakSet ? WeakSet.prototype.has : null;
1023
- var hasWeakRef = typeof WeakRef === 'function' && WeakRef.prototype;
1024
- var weakRefDeref = hasWeakRef ? WeakRef.prototype.deref : null;
1025
- var booleanValueOf = Boolean.prototype.valueOf;
1026
- var objectToString = Object.prototype.toString;
1027
- var functionToString = Function.prototype.toString;
1028
- var $match = String.prototype.match;
1029
- var $slice = String.prototype.slice;
1030
- var $replace = String.prototype.replace;
1031
- var $toUpperCase = String.prototype.toUpperCase;
1032
- var $toLowerCase = String.prototype.toLowerCase;
1033
- var $test = RegExp.prototype.test;
1034
- var $concat = Array.prototype.concat;
1035
- var $join = Array.prototype.join;
1036
- var $arrSlice = Array.prototype.slice;
1037
- var $floor = Math.floor;
1038
- var bigIntValueOf = typeof BigInt === 'function' ? BigInt.prototype.valueOf : null;
1039
- var gOPS = Object.getOwnPropertySymbols;
1040
- var symToString = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol' ? Symbol.prototype.toString : null;
1041
- var hasShammedSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'object';
1042
- // ie, `has-tostringtag/shams
1043
- var toStringTag = typeof Symbol === 'function' && Symbol.toStringTag && (typeof Symbol.toStringTag === hasShammedSymbols ? 'object' : 'symbol')
1044
- ? Symbol.toStringTag
1045
- : null;
1046
- var isEnumerable = Object.prototype.propertyIsEnumerable;
1047
-
1048
- var gPO = (typeof Reflect === 'function' ? Reflect.getPrototypeOf : Object.getPrototypeOf) || (
1049
- [].__proto__ === Array.prototype // eslint-disable-line no-proto
1050
- ? function (O) {
1051
- return O.__proto__; // eslint-disable-line no-proto
1052
- }
1053
- : null
1054
- );
1055
-
1056
- function addNumericSeparator(num, str) {
1057
- if (
1058
- num === Infinity
1059
- || num === -Infinity
1060
- || num !== num
1061
- || (num && num > -1000 && num < 1000)
1062
- || $test.call(/e/, str)
1063
- ) {
1064
- return str;
1065
- }
1066
- var sepRegex = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;
1067
- if (typeof num === 'number') {
1068
- var int = num < 0 ? -$floor(-num) : $floor(num); // trunc(num)
1069
- if (int !== num) {
1070
- var intStr = String(int);
1071
- var dec = $slice.call(str, intStr.length + 1);
1072
- return $replace.call(intStr, sepRegex, '$&_') + '.' + $replace.call($replace.call(dec, /([0-9]{3})/g, '$&_'), /_$/, '');
1073
- }
1074
- }
1075
- return $replace.call(str, sepRegex, '$&_');
1076
- }
1077
-
1078
- var utilInspect = util_inspect;
1079
- var inspectCustom = utilInspect.custom;
1080
- var inspectSymbol = isSymbol(inspectCustom) ? inspectCustom : null;
1081
-
1082
- var objectInspect = function inspect_(obj, options, depth, seen) {
1083
- var opts = options || {};
1084
-
1085
- if (has$3(opts, 'quoteStyle') && (opts.quoteStyle !== 'single' && opts.quoteStyle !== 'double')) {
1086
- throw new TypeError('option "quoteStyle" must be "single" or "double"');
1087
- }
1088
- if (
1089
- has$3(opts, 'maxStringLength') && (typeof opts.maxStringLength === 'number'
1090
- ? opts.maxStringLength < 0 && opts.maxStringLength !== Infinity
1091
- : opts.maxStringLength !== null
1092
- )
1093
- ) {
1094
- throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');
1095
- }
1096
- var customInspect = has$3(opts, 'customInspect') ? opts.customInspect : true;
1097
- if (typeof customInspect !== 'boolean' && customInspect !== 'symbol') {
1098
- throw new TypeError('option "customInspect", if provided, must be `true`, `false`, or `\'symbol\'`');
1099
- }
1100
-
1101
- if (
1102
- has$3(opts, 'indent')
1103
- && opts.indent !== null
1104
- && opts.indent !== '\t'
1105
- && !(parseInt(opts.indent, 10) === opts.indent && opts.indent > 0)
1106
- ) {
1107
- throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');
1108
- }
1109
- if (has$3(opts, 'numericSeparator') && typeof opts.numericSeparator !== 'boolean') {
1110
- throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');
1111
- }
1112
- var numericSeparator = opts.numericSeparator;
1113
-
1114
- if (typeof obj === 'undefined') {
1115
- return 'undefined';
1116
- }
1117
- if (obj === null) {
1118
- return 'null';
1119
- }
1120
- if (typeof obj === 'boolean') {
1121
- return obj ? 'true' : 'false';
1122
- }
1123
-
1124
- if (typeof obj === 'string') {
1125
- return inspectString(obj, opts);
1126
- }
1127
- if (typeof obj === 'number') {
1128
- if (obj === 0) {
1129
- return Infinity / obj > 0 ? '0' : '-0';
1130
- }
1131
- var str = String(obj);
1132
- return numericSeparator ? addNumericSeparator(obj, str) : str;
1133
- }
1134
- if (typeof obj === 'bigint') {
1135
- var bigIntStr = String(obj) + 'n';
1136
- return numericSeparator ? addNumericSeparator(obj, bigIntStr) : bigIntStr;
1137
- }
1138
-
1139
- var maxDepth = typeof opts.depth === 'undefined' ? 5 : opts.depth;
1140
- if (typeof depth === 'undefined') { depth = 0; }
1141
- if (depth >= maxDepth && maxDepth > 0 && typeof obj === 'object') {
1142
- return isArray$3(obj) ? '[Array]' : '[Object]';
1143
- }
1144
-
1145
- var indent = getIndent(opts, depth);
1146
-
1147
- if (typeof seen === 'undefined') {
1148
- seen = [];
1149
- } else if (indexOf$1(seen, obj) >= 0) {
1150
- return '[Circular]';
1151
- }
1152
-
1153
- function inspect(value, from, noIndent) {
1154
- if (from) {
1155
- seen = $arrSlice.call(seen);
1156
- seen.push(from);
1157
- }
1158
- if (noIndent) {
1159
- var newOpts = {
1160
- depth: opts.depth
1161
- };
1162
- if (has$3(opts, 'quoteStyle')) {
1163
- newOpts.quoteStyle = opts.quoteStyle;
1164
- }
1165
- return inspect_(value, newOpts, depth + 1, seen);
1166
- }
1167
- return inspect_(value, opts, depth + 1, seen);
1168
- }
1169
-
1170
- if (typeof obj === 'function' && !isRegExp$1(obj)) { // in older engines, regexes are callable
1171
- var name = nameOf(obj);
1172
- var keys = arrObjKeys(obj, inspect);
1173
- return '[Function' + (name ? ': ' + name : ' (anonymous)') + ']' + (keys.length > 0 ? ' { ' + $join.call(keys, ', ') + ' }' : '');
1174
- }
1175
- if (isSymbol(obj)) {
1176
- var symString = hasShammedSymbols ? $replace.call(String(obj), /^(Symbol\(.*\))_[^)]*$/, '$1') : symToString.call(obj);
1177
- return typeof obj === 'object' && !hasShammedSymbols ? markBoxed(symString) : symString;
1178
- }
1179
- if (isElement(obj)) {
1180
- var s = '<' + $toLowerCase.call(String(obj.nodeName));
1181
- var attrs = obj.attributes || [];
1182
- for (var i = 0; i < attrs.length; i++) {
1183
- s += ' ' + attrs[i].name + '=' + wrapQuotes(quote(attrs[i].value), 'double', opts);
1184
- }
1185
- s += '>';
1186
- if (obj.childNodes && obj.childNodes.length) { s += '...'; }
1187
- s += '</' + $toLowerCase.call(String(obj.nodeName)) + '>';
1188
- return s;
1189
- }
1190
- if (isArray$3(obj)) {
1191
- if (obj.length === 0) { return '[]'; }
1192
- var xs = arrObjKeys(obj, inspect);
1193
- if (indent && !singleLineValues(xs)) {
1194
- return '[' + indentedJoin(xs, indent) + ']';
1195
- }
1196
- return '[ ' + $join.call(xs, ', ') + ' ]';
1197
- }
1198
- if (isError(obj)) {
1199
- var parts = arrObjKeys(obj, inspect);
1200
- if (!('cause' in Error.prototype) && 'cause' in obj && !isEnumerable.call(obj, 'cause')) {
1201
- return '{ [' + String(obj) + '] ' + $join.call($concat.call('[cause]: ' + inspect(obj.cause), parts), ', ') + ' }';
1202
- }
1203
- if (parts.length === 0) { return '[' + String(obj) + ']'; }
1204
- return '{ [' + String(obj) + '] ' + $join.call(parts, ', ') + ' }';
1205
- }
1206
- if (typeof obj === 'object' && customInspect) {
1207
- if (inspectSymbol && typeof obj[inspectSymbol] === 'function' && utilInspect) {
1208
- return utilInspect(obj, { depth: maxDepth - depth });
1209
- } else if (customInspect !== 'symbol' && typeof obj.inspect === 'function') {
1210
- return obj.inspect();
1211
- }
1212
- }
1213
- if (isMap(obj)) {
1214
- var mapParts = [];
1215
- if (mapForEach) {
1216
- mapForEach.call(obj, function (value, key) {
1217
- mapParts.push(inspect(key, obj, true) + ' => ' + inspect(value, obj));
1218
- });
1219
- }
1220
- return collectionOf('Map', mapSize.call(obj), mapParts, indent);
1221
- }
1222
- if (isSet(obj)) {
1223
- var setParts = [];
1224
- if (setForEach) {
1225
- setForEach.call(obj, function (value) {
1226
- setParts.push(inspect(value, obj));
1227
- });
1228
- }
1229
- return collectionOf('Set', setSize.call(obj), setParts, indent);
1230
- }
1231
- if (isWeakMap(obj)) {
1232
- return weakCollectionOf('WeakMap');
1233
- }
1234
- if (isWeakSet(obj)) {
1235
- return weakCollectionOf('WeakSet');
1236
- }
1237
- if (isWeakRef(obj)) {
1238
- return weakCollectionOf('WeakRef');
1239
- }
1240
- if (isNumber(obj)) {
1241
- return markBoxed(inspect(Number(obj)));
1242
- }
1243
- if (isBigInt(obj)) {
1244
- return markBoxed(inspect(bigIntValueOf.call(obj)));
1245
- }
1246
- if (isBoolean(obj)) {
1247
- return markBoxed(booleanValueOf.call(obj));
1248
- }
1249
- if (isString(obj)) {
1250
- return markBoxed(inspect(String(obj)));
1251
- }
1252
- if (!isDate(obj) && !isRegExp$1(obj)) {
1253
- var ys = arrObjKeys(obj, inspect);
1254
- var isPlainObject = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object;
1255
- var protoTag = obj instanceof Object ? '' : 'null prototype';
1256
- var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr(obj), 8, -1) : protoTag ? 'Object' : '';
1257
- var constructorTag = isPlainObject || typeof obj.constructor !== 'function' ? '' : obj.constructor.name ? obj.constructor.name + ' ' : '';
1258
- var tag = constructorTag + (stringTag || protoTag ? '[' + $join.call($concat.call([], stringTag || [], protoTag || []), ': ') + '] ' : '');
1259
- if (ys.length === 0) { return tag + '{}'; }
1260
- if (indent) {
1261
- return tag + '{' + indentedJoin(ys, indent) + '}';
1262
- }
1263
- return tag + '{ ' + $join.call(ys, ', ') + ' }';
1264
- }
1265
- return String(obj);
1266
- };
1267
-
1268
- function wrapQuotes(s, defaultStyle, opts) {
1269
- var quoteChar = (opts.quoteStyle || defaultStyle) === 'double' ? '"' : "'";
1270
- return quoteChar + s + quoteChar;
1271
- }
1272
-
1273
- function quote(s) {
1274
- return $replace.call(String(s), /"/g, '&quot;');
1275
- }
1276
-
1277
- function isArray$3(obj) { return toStr(obj) === '[object Array]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
1278
- function isDate(obj) { return toStr(obj) === '[object Date]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
1279
- function isRegExp$1(obj) { return toStr(obj) === '[object RegExp]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
1280
- function isError(obj) { return toStr(obj) === '[object Error]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
1281
- function isString(obj) { return toStr(obj) === '[object String]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
1282
- function isNumber(obj) { return toStr(obj) === '[object Number]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
1283
- function isBoolean(obj) { return toStr(obj) === '[object Boolean]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
1284
-
1285
- // Symbol and BigInt do have Symbol.toStringTag by spec, so that can't be used to eliminate false positives
1286
- function isSymbol(obj) {
1287
- if (hasShammedSymbols) {
1288
- return obj && typeof obj === 'object' && obj instanceof Symbol;
1289
- }
1290
- if (typeof obj === 'symbol') {
1291
- return true;
1292
- }
1293
- if (!obj || typeof obj !== 'object' || !symToString) {
1294
- return false;
1295
- }
1296
- try {
1297
- symToString.call(obj);
1298
- return true;
1299
- } catch (e) {}
1300
- return false;
1301
- }
1302
-
1303
- function isBigInt(obj) {
1304
- if (!obj || typeof obj !== 'object' || !bigIntValueOf) {
1305
- return false;
1306
- }
1307
- try {
1308
- bigIntValueOf.call(obj);
1309
- return true;
1310
- } catch (e) {}
1311
- return false;
1312
- }
1313
-
1314
- var hasOwn = Object.prototype.hasOwnProperty || function (key) { return key in this; };
1315
- function has$3(obj, key) {
1316
- return hasOwn.call(obj, key);
1317
- }
1318
-
1319
- function toStr(obj) {
1320
- return objectToString.call(obj);
1321
- }
1322
-
1323
- function nameOf(f) {
1324
- if (f.name) { return f.name; }
1325
- var m = $match.call(functionToString.call(f), /^function\s*([\w$]+)/);
1326
- if (m) { return m[1]; }
1327
- return null;
1328
- }
1329
-
1330
- function indexOf$1(xs, x) {
1331
- if (xs.indexOf) { return xs.indexOf(x); }
1332
- for (var i = 0, l = xs.length; i < l; i++) {
1333
- if (xs[i] === x) { return i; }
1334
- }
1335
- return -1;
1336
- }
1337
-
1338
- function isMap(x) {
1339
- if (!mapSize || !x || typeof x !== 'object') {
1340
- return false;
1341
- }
1342
- try {
1343
- mapSize.call(x);
1344
- try {
1345
- setSize.call(x);
1346
- } catch (s) {
1347
- return true;
1348
- }
1349
- return x instanceof Map; // core-js workaround, pre-v2.5.0
1350
- } catch (e) {}
1351
- return false;
1352
- }
1353
-
1354
- function isWeakMap(x) {
1355
- if (!weakMapHas || !x || typeof x !== 'object') {
1356
- return false;
1357
- }
1358
- try {
1359
- weakMapHas.call(x, weakMapHas);
1360
- try {
1361
- weakSetHas.call(x, weakSetHas);
1362
- } catch (s) {
1363
- return true;
1364
- }
1365
- return x instanceof WeakMap; // core-js workaround, pre-v2.5.0
1366
- } catch (e) {}
1367
- return false;
1368
- }
1369
-
1370
- function isWeakRef(x) {
1371
- if (!weakRefDeref || !x || typeof x !== 'object') {
1372
- return false;
1373
- }
1374
- try {
1375
- weakRefDeref.call(x);
1376
- return true;
1377
- } catch (e) {}
1378
- return false;
1379
- }
1380
-
1381
- function isSet(x) {
1382
- if (!setSize || !x || typeof x !== 'object') {
1383
- return false;
1384
- }
1385
- try {
1386
- setSize.call(x);
1387
- try {
1388
- mapSize.call(x);
1389
- } catch (m) {
1390
- return true;
1391
- }
1392
- return x instanceof Set; // core-js workaround, pre-v2.5.0
1393
- } catch (e) {}
1394
- return false;
1395
- }
1396
-
1397
- function isWeakSet(x) {
1398
- if (!weakSetHas || !x || typeof x !== 'object') {
1399
- return false;
1400
- }
1401
- try {
1402
- weakSetHas.call(x, weakSetHas);
1403
- try {
1404
- weakMapHas.call(x, weakMapHas);
1405
- } catch (s) {
1406
- return true;
1407
- }
1408
- return x instanceof WeakSet; // core-js workaround, pre-v2.5.0
1409
- } catch (e) {}
1410
- return false;
1411
- }
1412
-
1413
- function isElement(x) {
1414
- if (!x || typeof x !== 'object') { return false; }
1415
- if (typeof HTMLElement !== 'undefined' && x instanceof HTMLElement) {
1416
- return true;
1417
- }
1418
- return typeof x.nodeName === 'string' && typeof x.getAttribute === 'function';
1419
- }
1420
-
1421
- function inspectString(str, opts) {
1422
- if (str.length > opts.maxStringLength) {
1423
- var remaining = str.length - opts.maxStringLength;
1424
- var trailer = '... ' + remaining + ' more character' + (remaining > 1 ? 's' : '');
1425
- return inspectString($slice.call(str, 0, opts.maxStringLength), opts) + trailer;
1426
- }
1427
- // eslint-disable-next-line no-control-regex
1428
- var s = $replace.call($replace.call(str, /(['\\])/g, '\\$1'), /[\x00-\x1f]/g, lowbyte);
1429
- return wrapQuotes(s, 'single', opts);
1430
- }
1431
-
1432
- function lowbyte(c) {
1433
- var n = c.charCodeAt(0);
1434
- var x = {
1435
- 8: 'b',
1436
- 9: 't',
1437
- 10: 'n',
1438
- 12: 'f',
1439
- 13: 'r'
1440
- }[n];
1441
- if (x) { return '\\' + x; }
1442
- return '\\x' + (n < 0x10 ? '0' : '') + $toUpperCase.call(n.toString(16));
1443
- }
1444
-
1445
- function markBoxed(str) {
1446
- return 'Object(' + str + ')';
1447
- }
1448
-
1449
- function weakCollectionOf(type) {
1450
- return type + ' { ? }';
1451
- }
1452
-
1453
- function collectionOf(type, size, entries, indent) {
1454
- var joinedEntries = indent ? indentedJoin(entries, indent) : $join.call(entries, ', ');
1455
- return type + ' (' + size + ') {' + joinedEntries + '}';
1456
- }
1457
-
1458
- function singleLineValues(xs) {
1459
- for (var i = 0; i < xs.length; i++) {
1460
- if (indexOf$1(xs[i], '\n') >= 0) {
1461
- return false;
1462
- }
1463
- }
1464
- return true;
1465
- }
1466
-
1467
- function getIndent(opts, depth) {
1468
- var baseIndent;
1469
- if (opts.indent === '\t') {
1470
- baseIndent = '\t';
1471
- } else if (typeof opts.indent === 'number' && opts.indent > 0) {
1472
- baseIndent = $join.call(Array(opts.indent + 1), ' ');
1473
- } else {
1474
- return null;
1475
- }
1476
- return {
1477
- base: baseIndent,
1478
- prev: $join.call(Array(depth + 1), baseIndent)
1479
- };
1480
- }
1481
-
1482
- function indentedJoin(xs, indent) {
1483
- if (xs.length === 0) { return ''; }
1484
- var lineJoiner = '\n' + indent.prev + indent.base;
1485
- return lineJoiner + $join.call(xs, ',' + lineJoiner) + '\n' + indent.prev;
1486
- }
1487
-
1488
- function arrObjKeys(obj, inspect) {
1489
- var isArr = isArray$3(obj);
1490
- var xs = [];
1491
- if (isArr) {
1492
- xs.length = obj.length;
1493
- for (var i = 0; i < obj.length; i++) {
1494
- xs[i] = has$3(obj, i) ? inspect(obj[i], obj) : '';
1495
- }
1496
- }
1497
- var syms = typeof gOPS === 'function' ? gOPS(obj) : [];
1498
- var symMap;
1499
- if (hasShammedSymbols) {
1500
- symMap = {};
1501
- for (var k = 0; k < syms.length; k++) {
1502
- symMap['$' + syms[k]] = syms[k];
1503
- }
1504
- }
1505
-
1506
- for (var key in obj) { // eslint-disable-line no-restricted-syntax
1507
- if (!has$3(obj, key)) { continue; } // eslint-disable-line no-restricted-syntax, no-continue
1508
- if (isArr && String(Number(key)) === key && key < obj.length) { continue; } // eslint-disable-line no-restricted-syntax, no-continue
1509
- if (hasShammedSymbols && symMap['$' + key] instanceof Symbol) {
1510
- // this is to prevent shammed Symbols, which are stored as strings, from being included in the string key section
1511
- continue; // eslint-disable-line no-restricted-syntax, no-continue
1512
- } else if ($test.call(/[^\w$]/, key)) {
1513
- xs.push(inspect(key, obj) + ': ' + inspect(obj[key], obj));
1514
- } else {
1515
- xs.push(key + ': ' + inspect(obj[key], obj));
1516
- }
1517
- }
1518
- if (typeof gOPS === 'function') {
1519
- for (var j = 0; j < syms.length; j++) {
1520
- if (isEnumerable.call(obj, syms[j])) {
1521
- xs.push('[' + inspect(syms[j]) + ']: ' + inspect(obj[syms[j]], obj));
1522
- }
1523
- }
1524
- }
1525
- return xs;
1526
- }
1527
-
1528
- var GetIntrinsic = getIntrinsic;
1529
- var callBound = callBound$1;
1530
- var inspect = objectInspect;
1531
-
1532
- var $TypeError = GetIntrinsic('%TypeError%');
1533
- var $WeakMap = GetIntrinsic('%WeakMap%', true);
1534
- var $Map = GetIntrinsic('%Map%', true);
1535
-
1536
- var $weakMapGet = callBound('WeakMap.prototype.get', true);
1537
- var $weakMapSet = callBound('WeakMap.prototype.set', true);
1538
- var $weakMapHas = callBound('WeakMap.prototype.has', true);
1539
- var $mapGet = callBound('Map.prototype.get', true);
1540
- var $mapSet = callBound('Map.prototype.set', true);
1541
- var $mapHas = callBound('Map.prototype.has', true);
1542
-
1543
- /*
1544
- * This function traverses the list returning the node corresponding to the
1545
- * given key.
1546
- *
1547
- * That node is also moved to the head of the list, so that if it's accessed
1548
- * again we don't need to traverse the whole list. By doing so, all the recently
1549
- * used nodes can be accessed relatively quickly.
1550
- */
1551
- var listGetNode = function (list, key) { // eslint-disable-line consistent-return
1552
- for (var prev = list, curr; (curr = prev.next) !== null; prev = curr) {
1553
- if (curr.key === key) {
1554
- prev.next = curr.next;
1555
- curr.next = list.next;
1556
- list.next = curr; // eslint-disable-line no-param-reassign
1557
- return curr;
1558
- }
1559
- }
1560
- };
1561
-
1562
- var listGet = function (objects, key) {
1563
- var node = listGetNode(objects, key);
1564
- return node && node.value;
1565
- };
1566
- var listSet = function (objects, key, value) {
1567
- var node = listGetNode(objects, key);
1568
- if (node) {
1569
- node.value = value;
1570
- } else {
1571
- // Prepend the new node to the beginning of the list
1572
- objects.next = { // eslint-disable-line no-param-reassign
1573
- key: key,
1574
- next: objects.next,
1575
- value: value
1576
- };
1577
- }
1578
- };
1579
- var listHas = function (objects, key) {
1580
- return !!listGetNode(objects, key);
1581
- };
1582
-
1583
- var sideChannel = function getSideChannel() {
1584
- var $wm;
1585
- var $m;
1586
- var $o;
1587
- var channel = {
1588
- assert: function (key) {
1589
- if (!channel.has(key)) {
1590
- throw new $TypeError('Side channel does not contain ' + inspect(key));
1591
- }
1592
- },
1593
- get: function (key) { // eslint-disable-line consistent-return
1594
- if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {
1595
- if ($wm) {
1596
- return $weakMapGet($wm, key);
1597
- }
1598
- } else if ($Map) {
1599
- if ($m) {
1600
- return $mapGet($m, key);
1601
- }
1602
- } else {
1603
- if ($o) { // eslint-disable-line no-lonely-if
1604
- return listGet($o, key);
1605
- }
1606
- }
1607
- },
1608
- has: function (key) {
1609
- if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {
1610
- if ($wm) {
1611
- return $weakMapHas($wm, key);
1612
- }
1613
- } else if ($Map) {
1614
- if ($m) {
1615
- return $mapHas($m, key);
1616
- }
1617
- } else {
1618
- if ($o) { // eslint-disable-line no-lonely-if
1619
- return listHas($o, key);
1620
- }
1621
- }
1622
- return false;
1623
- },
1624
- set: function (key, value) {
1625
- if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {
1626
- if (!$wm) {
1627
- $wm = new $WeakMap();
1628
- }
1629
- $weakMapSet($wm, key, value);
1630
- } else if ($Map) {
1631
- if (!$m) {
1632
- $m = new $Map();
1633
- }
1634
- $mapSet($m, key, value);
1635
- } else {
1636
- if (!$o) {
1637
- /*
1638
- * Initialize the linked list as an empty node, so that we don't have
1639
- * to special-case handling of the first node: we can always refer to
1640
- * it as (previous node).next, instead of something like (list).head
1641
- */
1642
- $o = { key: {}, next: null };
1643
- }
1644
- listSet($o, key, value);
1645
- }
1646
- }
1647
- };
1648
- return channel;
1649
- };
1650
-
1651
- var replace = String.prototype.replace;
1652
- var percentTwenties = /%20/g;
1653
-
1654
- var Format = {
1655
- RFC1738: 'RFC1738',
1656
- RFC3986: 'RFC3986'
1657
- };
1658
-
1659
- var formats$3 = {
1660
- 'default': Format.RFC3986,
1661
- formatters: {
1662
- RFC1738: function (value) {
1663
- return replace.call(value, percentTwenties, '+');
1664
- },
1665
- RFC3986: function (value) {
1666
- return String(value);
1667
- }
1668
- },
1669
- RFC1738: Format.RFC1738,
1670
- RFC3986: Format.RFC3986
1671
- };
1672
-
1673
- var formats$2 = formats$3;
1674
-
1675
- var has$2 = Object.prototype.hasOwnProperty;
1676
- var isArray$2 = Array.isArray;
1677
-
1678
- var hexTable = (function () {
1679
- var array = [];
1680
- for (var i = 0; i < 256; ++i) {
1681
- array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase());
1682
- }
1683
-
1684
- return array;
1685
- }());
1686
-
1687
- var compactQueue = function compactQueue(queue) {
1688
- while (queue.length > 1) {
1689
- var item = queue.pop();
1690
- var obj = item.obj[item.prop];
1691
-
1692
- if (isArray$2(obj)) {
1693
- var compacted = [];
1694
-
1695
- for (var j = 0; j < obj.length; ++j) {
1696
- if (typeof obj[j] !== 'undefined') {
1697
- compacted.push(obj[j]);
1698
- }
1699
- }
1700
-
1701
- item.obj[item.prop] = compacted;
1702
- }
1703
- }
1704
- };
1705
-
1706
- var arrayToObject = function arrayToObject(source, options) {
1707
- var obj = options && options.plainObjects ? Object.create(null) : {};
1708
- for (var i = 0; i < source.length; ++i) {
1709
- if (typeof source[i] !== 'undefined') {
1710
- obj[i] = source[i];
1711
- }
1712
- }
1713
-
1714
- return obj;
1715
- };
1716
-
1717
- var merge = function merge(target, source, options) {
1718
- /* eslint no-param-reassign: 0 */
1719
- if (!source) {
1720
- return target;
1721
- }
1722
-
1723
- if (typeof source !== 'object') {
1724
- if (isArray$2(target)) {
1725
- target.push(source);
1726
- } else if (target && typeof target === 'object') {
1727
- if ((options && (options.plainObjects || options.allowPrototypes)) || !has$2.call(Object.prototype, source)) {
1728
- target[source] = true;
1729
- }
1730
- } else {
1731
- return [target, source];
1732
- }
1733
-
1734
- return target;
1735
- }
1736
-
1737
- if (!target || typeof target !== 'object') {
1738
- return [target].concat(source);
1739
- }
1740
-
1741
- var mergeTarget = target;
1742
- if (isArray$2(target) && !isArray$2(source)) {
1743
- mergeTarget = arrayToObject(target, options);
1744
- }
1745
-
1746
- if (isArray$2(target) && isArray$2(source)) {
1747
- source.forEach(function (item, i) {
1748
- if (has$2.call(target, i)) {
1749
- var targetItem = target[i];
1750
- if (targetItem && typeof targetItem === 'object' && item && typeof item === 'object') {
1751
- target[i] = merge(targetItem, item, options);
1752
- } else {
1753
- target.push(item);
1754
- }
1755
- } else {
1756
- target[i] = item;
1757
- }
1758
- });
1759
- return target;
1760
- }
1761
-
1762
- return Object.keys(source).reduce(function (acc, key) {
1763
- var value = source[key];
1764
-
1765
- if (has$2.call(acc, key)) {
1766
- acc[key] = merge(acc[key], value, options);
1767
- } else {
1768
- acc[key] = value;
1769
- }
1770
- return acc;
1771
- }, mergeTarget);
1772
- };
1773
-
1774
- var assign = function assignSingleSource(target, source) {
1775
- return Object.keys(source).reduce(function (acc, key) {
1776
- acc[key] = source[key];
1777
- return acc;
1778
- }, target);
1779
- };
1780
-
1781
- var decode = function (str, decoder, charset) {
1782
- var strWithoutPlus = str.replace(/\+/g, ' ');
1783
- if (charset === 'iso-8859-1') {
1784
- // unescape never throws, no try...catch needed:
1785
- return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape);
1786
- }
1787
- // utf-8
1788
- try {
1789
- return decodeURIComponent(strWithoutPlus);
1790
- } catch (e) {
1791
- return strWithoutPlus;
1792
- }
1793
- };
1794
-
1795
- var encode = function encode(str, defaultEncoder, charset, kind, format) {
1796
- // This code was originally written by Brian White (mscdex) for the io.js core querystring library.
1797
- // It has been adapted here for stricter adherence to RFC 3986
1798
- if (str.length === 0) {
1799
- return str;
1800
- }
1801
-
1802
- var string = str;
1803
- if (typeof str === 'symbol') {
1804
- string = Symbol.prototype.toString.call(str);
1805
- } else if (typeof str !== 'string') {
1806
- string = String(str);
1807
- }
1808
-
1809
- if (charset === 'iso-8859-1') {
1810
- return escape(string).replace(/%u[0-9a-f]{4}/gi, function ($0) {
1811
- return '%26%23' + parseInt($0.slice(2), 16) + '%3B';
1812
- });
1813
- }
1814
-
1815
- var out = '';
1816
- for (var i = 0; i < string.length; ++i) {
1817
- var c = string.charCodeAt(i);
1818
-
1819
- if (
1820
- c === 0x2D // -
1821
- || c === 0x2E // .
1822
- || c === 0x5F // _
1823
- || c === 0x7E // ~
1824
- || (c >= 0x30 && c <= 0x39) // 0-9
1825
- || (c >= 0x41 && c <= 0x5A) // a-z
1826
- || (c >= 0x61 && c <= 0x7A) // A-Z
1827
- || (format === formats$2.RFC1738 && (c === 0x28 || c === 0x29)) // ( )
1828
- ) {
1829
- out += string.charAt(i);
1830
- continue;
1831
- }
1832
-
1833
- if (c < 0x80) {
1834
- out = out + hexTable[c];
1835
- continue;
1836
- }
1837
-
1838
- if (c < 0x800) {
1839
- out = out + (hexTable[0xC0 | (c >> 6)] + hexTable[0x80 | (c & 0x3F)]);
1840
- continue;
1841
- }
1842
-
1843
- if (c < 0xD800 || c >= 0xE000) {
1844
- out = out + (hexTable[0xE0 | (c >> 12)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]);
1845
- continue;
1846
- }
1847
-
1848
- i += 1;
1849
- c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF));
1850
- /* eslint operator-linebreak: [2, "before"] */
1851
- out += hexTable[0xF0 | (c >> 18)]
1852
- + hexTable[0x80 | ((c >> 12) & 0x3F)]
1853
- + hexTable[0x80 | ((c >> 6) & 0x3F)]
1854
- + hexTable[0x80 | (c & 0x3F)];
1855
- }
1856
-
1857
- return out;
1858
- };
1859
-
1860
- var compact = function compact(value) {
1861
- var queue = [{ obj: { o: value }, prop: 'o' }];
1862
- var refs = [];
1863
-
1864
- for (var i = 0; i < queue.length; ++i) {
1865
- var item = queue[i];
1866
- var obj = item.obj[item.prop];
1867
-
1868
- var keys = Object.keys(obj);
1869
- for (var j = 0; j < keys.length; ++j) {
1870
- var key = keys[j];
1871
- var val = obj[key];
1872
- if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) {
1873
- queue.push({ obj: obj, prop: key });
1874
- refs.push(val);
1875
- }
1876
- }
1877
- }
1878
-
1879
- compactQueue(queue);
1880
-
1881
- return value;
1882
- };
1883
-
1884
- var isRegExp = function isRegExp(obj) {
1885
- return Object.prototype.toString.call(obj) === '[object RegExp]';
1886
- };
1887
-
1888
- var isBuffer = function isBuffer(obj) {
1889
- if (!obj || typeof obj !== 'object') {
1890
- return false;
1891
- }
1892
-
1893
- return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));
1894
- };
1895
-
1896
- var combine = function combine(a, b) {
1897
- return [].concat(a, b);
1898
- };
1899
-
1900
- var maybeMap = function maybeMap(val, fn) {
1901
- if (isArray$2(val)) {
1902
- var mapped = [];
1903
- for (var i = 0; i < val.length; i += 1) {
1904
- mapped.push(fn(val[i]));
1905
- }
1906
- return mapped;
1907
- }
1908
- return fn(val);
1909
- };
1910
-
1911
- var utils$2 = {
1912
- arrayToObject: arrayToObject,
1913
- assign: assign,
1914
- combine: combine,
1915
- compact: compact,
1916
- decode: decode,
1917
- encode: encode,
1918
- isBuffer: isBuffer,
1919
- isRegExp: isRegExp,
1920
- maybeMap: maybeMap,
1921
- merge: merge
1922
- };
1923
-
1924
- var getSideChannel = sideChannel;
1925
- var utils$1 = utils$2;
1926
- var formats$1 = formats$3;
1927
- var has$1 = Object.prototype.hasOwnProperty;
1928
-
1929
- var arrayPrefixGenerators = {
1930
- brackets: function brackets(prefix) {
1931
- return prefix + '[]';
1932
- },
1933
- comma: 'comma',
1934
- indices: function indices(prefix, key) {
1935
- return prefix + '[' + key + ']';
1936
- },
1937
- repeat: function repeat(prefix) {
1938
- return prefix;
1939
- }
1940
- };
1941
-
1942
- var isArray$1 = Array.isArray;
1943
- var split = String.prototype.split;
1944
- var push = Array.prototype.push;
1945
- var pushToArray = function (arr, valueOrArray) {
1946
- push.apply(arr, isArray$1(valueOrArray) ? valueOrArray : [valueOrArray]);
1947
- };
1948
-
1949
- var toISO = Date.prototype.toISOString;
1950
-
1951
- var defaultFormat = formats$1['default'];
1952
- var defaults$1 = {
1953
- addQueryPrefix: false,
1954
- allowDots: false,
1955
- charset: 'utf-8',
1956
- charsetSentinel: false,
1957
- delimiter: '&',
1958
- encode: true,
1959
- encoder: utils$1.encode,
1960
- encodeValuesOnly: false,
1961
- format: defaultFormat,
1962
- formatter: formats$1.formatters[defaultFormat],
1963
- // deprecated
1964
- indices: false,
1965
- serializeDate: function serializeDate(date) {
1966
- return toISO.call(date);
1967
- },
1968
- skipNulls: false,
1969
- strictNullHandling: false
1970
- };
1971
-
1972
- var isNonNullishPrimitive = function isNonNullishPrimitive(v) {
1973
- return typeof v === 'string'
1974
- || typeof v === 'number'
1975
- || typeof v === 'boolean'
1976
- || typeof v === 'symbol'
1977
- || typeof v === 'bigint';
1978
- };
1979
-
1980
- var sentinel = {};
1981
-
1982
- var stringify$1 = function stringify(
1983
- object,
1984
- prefix,
1985
- generateArrayPrefix,
1986
- commaRoundTrip,
1987
- strictNullHandling,
1988
- skipNulls,
1989
- encoder,
1990
- filter,
1991
- sort,
1992
- allowDots,
1993
- serializeDate,
1994
- format,
1995
- formatter,
1996
- encodeValuesOnly,
1997
- charset,
1998
- sideChannel
1999
- ) {
2000
- var obj = object;
2001
-
2002
- var tmpSc = sideChannel;
2003
- var step = 0;
2004
- var findFlag = false;
2005
- while ((tmpSc = tmpSc.get(sentinel)) !== void undefined && !findFlag) {
2006
- // Where object last appeared in the ref tree
2007
- var pos = tmpSc.get(object);
2008
- step += 1;
2009
- if (typeof pos !== 'undefined') {
2010
- if (pos === step) {
2011
- throw new RangeError('Cyclic object value');
2012
- } else {
2013
- findFlag = true; // Break while
2014
- }
2015
- }
2016
- if (typeof tmpSc.get(sentinel) === 'undefined') {
2017
- step = 0;
2018
- }
2019
- }
2020
-
2021
- if (typeof filter === 'function') {
2022
- obj = filter(prefix, obj);
2023
- } else if (obj instanceof Date) {
2024
- obj = serializeDate(obj);
2025
- } else if (generateArrayPrefix === 'comma' && isArray$1(obj)) {
2026
- obj = utils$1.maybeMap(obj, function (value) {
2027
- if (value instanceof Date) {
2028
- return serializeDate(value);
2029
- }
2030
- return value;
2031
- });
2032
- }
2033
-
2034
- if (obj === null) {
2035
- if (strictNullHandling) {
2036
- return encoder && !encodeValuesOnly ? encoder(prefix, defaults$1.encoder, charset, 'key', format) : prefix;
2037
- }
2038
-
2039
- obj = '';
2040
- }
2041
-
2042
- if (isNonNullishPrimitive(obj) || utils$1.isBuffer(obj)) {
2043
- if (encoder) {
2044
- var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults$1.encoder, charset, 'key', format);
2045
- if (generateArrayPrefix === 'comma' && encodeValuesOnly) {
2046
- var valuesArray = split.call(String(obj), ',');
2047
- var valuesJoined = '';
2048
- for (var i = 0; i < valuesArray.length; ++i) {
2049
- valuesJoined += (i === 0 ? '' : ',') + formatter(encoder(valuesArray[i], defaults$1.encoder, charset, 'value', format));
2050
- }
2051
- return [formatter(keyValue) + (commaRoundTrip && isArray$1(obj) && valuesArray.length === 1 ? '[]' : '') + '=' + valuesJoined];
2052
- }
2053
- return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults$1.encoder, charset, 'value', format))];
2054
- }
2055
- return [formatter(prefix) + '=' + formatter(String(obj))];
2056
- }
2057
-
2058
- var values = [];
2059
-
2060
- if (typeof obj === 'undefined') {
2061
- return values;
2062
- }
2063
-
2064
- var objKeys;
2065
- if (generateArrayPrefix === 'comma' && isArray$1(obj)) {
2066
- // we need to join elements in
2067
- objKeys = [{ value: obj.length > 0 ? obj.join(',') || null : void undefined }];
2068
- } else if (isArray$1(filter)) {
2069
- objKeys = filter;
2070
- } else {
2071
- var keys = Object.keys(obj);
2072
- objKeys = sort ? keys.sort(sort) : keys;
2073
- }
2074
-
2075
- var adjustedPrefix = commaRoundTrip && isArray$1(obj) && obj.length === 1 ? prefix + '[]' : prefix;
2076
-
2077
- for (var j = 0; j < objKeys.length; ++j) {
2078
- var key = objKeys[j];
2079
- var value = typeof key === 'object' && typeof key.value !== 'undefined' ? key.value : obj[key];
2080
-
2081
- if (skipNulls && value === null) {
2082
- continue;
2083
- }
2084
-
2085
- var keyPrefix = isArray$1(obj)
2086
- ? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(adjustedPrefix, key) : adjustedPrefix
2087
- : adjustedPrefix + (allowDots ? '.' + key : '[' + key + ']');
2088
-
2089
- sideChannel.set(object, step);
2090
- var valueSideChannel = getSideChannel();
2091
- valueSideChannel.set(sentinel, sideChannel);
2092
- pushToArray(values, stringify(
2093
- value,
2094
- keyPrefix,
2095
- generateArrayPrefix,
2096
- commaRoundTrip,
2097
- strictNullHandling,
2098
- skipNulls,
2099
- encoder,
2100
- filter,
2101
- sort,
2102
- allowDots,
2103
- serializeDate,
2104
- format,
2105
- formatter,
2106
- encodeValuesOnly,
2107
- charset,
2108
- valueSideChannel
2109
- ));
2110
- }
2111
-
2112
- return values;
2113
- };
2114
-
2115
- var normalizeStringifyOptions = function normalizeStringifyOptions(opts) {
2116
- if (!opts) {
2117
- return defaults$1;
2118
- }
2119
-
2120
- if (opts.encoder !== null && typeof opts.encoder !== 'undefined' && typeof opts.encoder !== 'function') {
2121
- throw new TypeError('Encoder has to be a function.');
2122
- }
2123
-
2124
- var charset = opts.charset || defaults$1.charset;
2125
- if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {
2126
- throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');
2127
- }
2128
-
2129
- var format = formats$1['default'];
2130
- if (typeof opts.format !== 'undefined') {
2131
- if (!has$1.call(formats$1.formatters, opts.format)) {
2132
- throw new TypeError('Unknown format option provided.');
2133
- }
2134
- format = opts.format;
2135
- }
2136
- var formatter = formats$1.formatters[format];
2137
-
2138
- var filter = defaults$1.filter;
2139
- if (typeof opts.filter === 'function' || isArray$1(opts.filter)) {
2140
- filter = opts.filter;
2141
- }
2142
-
2143
- return {
2144
- addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults$1.addQueryPrefix,
2145
- allowDots: typeof opts.allowDots === 'undefined' ? defaults$1.allowDots : !!opts.allowDots,
2146
- charset: charset,
2147
- charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults$1.charsetSentinel,
2148
- delimiter: typeof opts.delimiter === 'undefined' ? defaults$1.delimiter : opts.delimiter,
2149
- encode: typeof opts.encode === 'boolean' ? opts.encode : defaults$1.encode,
2150
- encoder: typeof opts.encoder === 'function' ? opts.encoder : defaults$1.encoder,
2151
- encodeValuesOnly: typeof opts.encodeValuesOnly === 'boolean' ? opts.encodeValuesOnly : defaults$1.encodeValuesOnly,
2152
- filter: filter,
2153
- format: format,
2154
- formatter: formatter,
2155
- serializeDate: typeof opts.serializeDate === 'function' ? opts.serializeDate : defaults$1.serializeDate,
2156
- skipNulls: typeof opts.skipNulls === 'boolean' ? opts.skipNulls : defaults$1.skipNulls,
2157
- sort: typeof opts.sort === 'function' ? opts.sort : null,
2158
- strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults$1.strictNullHandling
2159
- };
2160
- };
2161
-
2162
- var stringify_1 = function (object, opts) {
2163
- var obj = object;
2164
- var options = normalizeStringifyOptions(opts);
2165
-
2166
- var objKeys;
2167
- var filter;
2168
-
2169
- if (typeof options.filter === 'function') {
2170
- filter = options.filter;
2171
- obj = filter('', obj);
2172
- } else if (isArray$1(options.filter)) {
2173
- filter = options.filter;
2174
- objKeys = filter;
2175
- }
2176
-
2177
- var keys = [];
2178
-
2179
- if (typeof obj !== 'object' || obj === null) {
2180
- return '';
2181
- }
2182
-
2183
- var arrayFormat;
2184
- if (opts && opts.arrayFormat in arrayPrefixGenerators) {
2185
- arrayFormat = opts.arrayFormat;
2186
- } else if (opts && 'indices' in opts) {
2187
- arrayFormat = opts.indices ? 'indices' : 'repeat';
2188
- } else {
2189
- arrayFormat = 'indices';
2190
- }
2191
-
2192
- var generateArrayPrefix = arrayPrefixGenerators[arrayFormat];
2193
- if (opts && 'commaRoundTrip' in opts && typeof opts.commaRoundTrip !== 'boolean') {
2194
- throw new TypeError('`commaRoundTrip` must be a boolean, or absent');
2195
- }
2196
- var commaRoundTrip = generateArrayPrefix === 'comma' && opts && opts.commaRoundTrip;
2197
-
2198
- if (!objKeys) {
2199
- objKeys = Object.keys(obj);
2200
- }
2201
-
2202
- if (options.sort) {
2203
- objKeys.sort(options.sort);
2204
- }
2205
-
2206
- var sideChannel = getSideChannel();
2207
- for (var i = 0; i < objKeys.length; ++i) {
2208
- var key = objKeys[i];
2209
-
2210
- if (options.skipNulls && obj[key] === null) {
2211
- continue;
2212
- }
2213
- pushToArray(keys, stringify$1(
2214
- obj[key],
2215
- key,
2216
- generateArrayPrefix,
2217
- commaRoundTrip,
2218
- options.strictNullHandling,
2219
- options.skipNulls,
2220
- options.encode ? options.encoder : null,
2221
- options.filter,
2222
- options.sort,
2223
- options.allowDots,
2224
- options.serializeDate,
2225
- options.format,
2226
- options.formatter,
2227
- options.encodeValuesOnly,
2228
- options.charset,
2229
- sideChannel
2230
- ));
2231
- }
2232
-
2233
- var joined = keys.join(options.delimiter);
2234
- var prefix = options.addQueryPrefix === true ? '?' : '';
2235
-
2236
- if (options.charsetSentinel) {
2237
- if (options.charset === 'iso-8859-1') {
2238
- // encodeURIComponent('&#10003;'), the "numeric entity" representation of a checkmark
2239
- prefix += 'utf8=%26%2310003%3B&';
2240
- } else {
2241
- // encodeURIComponent('✓')
2242
- prefix += 'utf8=%E2%9C%93&';
2243
- }
2244
- }
2245
-
2246
- return joined.length > 0 ? prefix + joined : '';
2247
- };
2248
-
2249
- var utils = utils$2;
2250
-
2251
- var has = Object.prototype.hasOwnProperty;
2252
- var isArray = Array.isArray;
2253
-
2254
- var defaults = {
2255
- allowDots: false,
2256
- allowPrototypes: false,
2257
- allowSparse: false,
2258
- arrayLimit: 20,
2259
- charset: 'utf-8',
2260
- charsetSentinel: false,
2261
- comma: false,
2262
- decoder: utils.decode,
2263
- delimiter: '&',
2264
- depth: 5,
2265
- ignoreQueryPrefix: false,
2266
- interpretNumericEntities: false,
2267
- parameterLimit: 1000,
2268
- parseArrays: true,
2269
- plainObjects: false,
2270
- strictNullHandling: false
2271
- };
2272
-
2273
- var interpretNumericEntities = function (str) {
2274
- return str.replace(/&#(\d+);/g, function ($0, numberStr) {
2275
- return String.fromCharCode(parseInt(numberStr, 10));
2276
- });
2277
- };
2278
-
2279
- var parseArrayValue = function (val, options) {
2280
- if (val && typeof val === 'string' && options.comma && val.indexOf(',') > -1) {
2281
- return val.split(',');
2282
- }
2283
-
2284
- return val;
2285
- };
2286
-
2287
- // This is what browsers will submit when the ✓ character occurs in an
2288
- // application/x-www-form-urlencoded body and the encoding of the page containing
2289
- // the form is iso-8859-1, or when the submitted form has an accept-charset
2290
- // attribute of iso-8859-1. Presumably also with other charsets that do not contain
2291
- // the ✓ character, such as us-ascii.
2292
- var isoSentinel = 'utf8=%26%2310003%3B'; // encodeURIComponent('&#10003;')
2293
-
2294
- // These are the percent-encoded utf-8 octets representing a checkmark, indicating that the request actually is utf-8 encoded.
2295
- var charsetSentinel = 'utf8=%E2%9C%93'; // encodeURIComponent('✓')
2296
-
2297
- var parseValues = function parseQueryStringValues(str, options) {
2298
- var obj = {};
2299
- var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str;
2300
- var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit;
2301
- var parts = cleanStr.split(options.delimiter, limit);
2302
- var skipIndex = -1; // Keep track of where the utf8 sentinel was found
2303
- var i;
2304
-
2305
- var charset = options.charset;
2306
- if (options.charsetSentinel) {
2307
- for (i = 0; i < parts.length; ++i) {
2308
- if (parts[i].indexOf('utf8=') === 0) {
2309
- if (parts[i] === charsetSentinel) {
2310
- charset = 'utf-8';
2311
- } else if (parts[i] === isoSentinel) {
2312
- charset = 'iso-8859-1';
2313
- }
2314
- skipIndex = i;
2315
- i = parts.length; // The eslint settings do not allow break;
2316
- }
2317
- }
2318
- }
2319
-
2320
- for (i = 0; i < parts.length; ++i) {
2321
- if (i === skipIndex) {
2322
- continue;
2323
- }
2324
- var part = parts[i];
2325
-
2326
- var bracketEqualsPos = part.indexOf(']=');
2327
- var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1;
2328
-
2329
- var key, val;
2330
- if (pos === -1) {
2331
- key = options.decoder(part, defaults.decoder, charset, 'key');
2332
- val = options.strictNullHandling ? null : '';
2333
- } else {
2334
- key = options.decoder(part.slice(0, pos), defaults.decoder, charset, 'key');
2335
- val = utils.maybeMap(
2336
- parseArrayValue(part.slice(pos + 1), options),
2337
- function (encodedVal) {
2338
- return options.decoder(encodedVal, defaults.decoder, charset, 'value');
2339
- }
2340
- );
2341
- }
2342
-
2343
- if (val && options.interpretNumericEntities && charset === 'iso-8859-1') {
2344
- val = interpretNumericEntities(val);
2345
- }
2346
-
2347
- if (part.indexOf('[]=') > -1) {
2348
- val = isArray(val) ? [val] : val;
2349
- }
2350
-
2351
- if (has.call(obj, key)) {
2352
- obj[key] = utils.combine(obj[key], val);
2353
- } else {
2354
- obj[key] = val;
2355
- }
2356
- }
2357
-
2358
- return obj;
2359
- };
2360
-
2361
- var parseObject = function (chain, val, options, valuesParsed) {
2362
- var leaf = valuesParsed ? val : parseArrayValue(val, options);
2363
-
2364
- for (var i = chain.length - 1; i >= 0; --i) {
2365
- var obj;
2366
- var root = chain[i];
2367
-
2368
- if (root === '[]' && options.parseArrays) {
2369
- obj = [].concat(leaf);
2370
- } else {
2371
- obj = options.plainObjects ? Object.create(null) : {};
2372
- var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;
2373
- var index = parseInt(cleanRoot, 10);
2374
- if (!options.parseArrays && cleanRoot === '') {
2375
- obj = { 0: leaf };
2376
- } else if (
2377
- !isNaN(index)
2378
- && root !== cleanRoot
2379
- && String(index) === cleanRoot
2380
- && index >= 0
2381
- && (options.parseArrays && index <= options.arrayLimit)
2382
- ) {
2383
- obj = [];
2384
- obj[index] = leaf;
2385
- } else if (cleanRoot !== '__proto__') {
2386
- obj[cleanRoot] = leaf;
2387
- }
2388
- }
2389
-
2390
- leaf = obj;
2391
- }
2392
-
2393
- return leaf;
2394
- };
2395
-
2396
- var parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesParsed) {
2397
- if (!givenKey) {
2398
- return;
2399
- }
2400
-
2401
- // Transform dot notation to bracket notation
2402
- var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, '[$1]') : givenKey;
2403
-
2404
- // The regex chunks
2405
-
2406
- var brackets = /(\[[^[\]]*])/;
2407
- var child = /(\[[^[\]]*])/g;
2408
-
2409
- // Get the parent
2410
-
2411
- var segment = options.depth > 0 && brackets.exec(key);
2412
- var parent = segment ? key.slice(0, segment.index) : key;
2413
-
2414
- // Stash the parent if it exists
2415
-
2416
- var keys = [];
2417
- if (parent) {
2418
- // If we aren't using plain objects, optionally prefix keys that would overwrite object prototype properties
2419
- if (!options.plainObjects && has.call(Object.prototype, parent)) {
2420
- if (!options.allowPrototypes) {
2421
- return;
2422
- }
2423
- }
2424
-
2425
- keys.push(parent);
2426
- }
2427
-
2428
- // Loop through children appending to the array until we hit depth
2429
-
2430
- var i = 0;
2431
- while (options.depth > 0 && (segment = child.exec(key)) !== null && i < options.depth) {
2432
- i += 1;
2433
- if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) {
2434
- if (!options.allowPrototypes) {
2435
- return;
2436
- }
2437
- }
2438
- keys.push(segment[1]);
2439
- }
2440
-
2441
- // If there's a remainder, just add whatever is left
2442
-
2443
- if (segment) {
2444
- keys.push('[' + key.slice(segment.index) + ']');
2445
- }
2446
-
2447
- return parseObject(keys, val, options, valuesParsed);
2448
- };
2449
-
2450
- var normalizeParseOptions = function normalizeParseOptions(opts) {
2451
- if (!opts) {
2452
- return defaults;
2453
- }
2454
-
2455
- if (opts.decoder !== null && opts.decoder !== undefined && typeof opts.decoder !== 'function') {
2456
- throw new TypeError('Decoder has to be a function.');
2457
- }
2458
-
2459
- if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {
2460
- throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');
2461
- }
2462
- var charset = typeof opts.charset === 'undefined' ? defaults.charset : opts.charset;
2463
-
2464
- return {
2465
- allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots,
2466
- allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults.allowPrototypes,
2467
- allowSparse: typeof opts.allowSparse === 'boolean' ? opts.allowSparse : defaults.allowSparse,
2468
- arrayLimit: typeof opts.arrayLimit === 'number' ? opts.arrayLimit : defaults.arrayLimit,
2469
- charset: charset,
2470
- charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,
2471
- comma: typeof opts.comma === 'boolean' ? opts.comma : defaults.comma,
2472
- decoder: typeof opts.decoder === 'function' ? opts.decoder : defaults.decoder,
2473
- delimiter: typeof opts.delimiter === 'string' || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter,
2474
- // eslint-disable-next-line no-implicit-coercion, no-extra-parens
2475
- depth: (typeof opts.depth === 'number' || opts.depth === false) ? +opts.depth : defaults.depth,
2476
- ignoreQueryPrefix: opts.ignoreQueryPrefix === true,
2477
- interpretNumericEntities: typeof opts.interpretNumericEntities === 'boolean' ? opts.interpretNumericEntities : defaults.interpretNumericEntities,
2478
- parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults.parameterLimit,
2479
- parseArrays: opts.parseArrays !== false,
2480
- plainObjects: typeof opts.plainObjects === 'boolean' ? opts.plainObjects : defaults.plainObjects,
2481
- strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling
2482
- };
2483
- };
2484
-
2485
- var parse$1 = function (str, opts) {
2486
- var options = normalizeParseOptions(opts);
2487
-
2488
- if (str === '' || str === null || typeof str === 'undefined') {
2489
- return options.plainObjects ? Object.create(null) : {};
2490
- }
2491
-
2492
- var tempObj = typeof str === 'string' ? parseValues(str, options) : str;
2493
- var obj = options.plainObjects ? Object.create(null) : {};
2494
-
2495
- // Iterate over the keys and setup the new object
2496
-
2497
- var keys = Object.keys(tempObj);
2498
- for (var i = 0; i < keys.length; ++i) {
2499
- var key = keys[i];
2500
- var newObj = parseKeys(key, tempObj[key], options, typeof str === 'string');
2501
- obj = utils.merge(obj, newObj, options);
2502
- }
2503
-
2504
- if (options.allowSparse === true) {
2505
- return obj;
2506
- }
2507
-
2508
- return utils.compact(obj);
2509
- };
2510
-
2511
- var stringify = stringify_1;
2512
- var parse = parse$1;
2513
- var formats = formats$3;
2514
-
2515
- var lib = {
2516
- formats: formats,
2517
- parse: parse,
2518
- stringify: stringify
2519
- };
2520
-
2521
489
  var _this = undefined;
2522
490
  function ownKeys$1(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
2523
491
  function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$1(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$1(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
@@ -2605,7 +573,7 @@ var buildUrl = function buildUrl(route, params) {
2605
573
  route = route.replace(":".concat(key), encodeURIComponent(value));
2606
574
  }
2607
575
  });
2608
- var queryParams = pipe(omit(placeHolders), preprocessForSerialization, lib.stringify)(params);
576
+ var queryParams = pipe(omit(placeHolders), preprocessForSerialization, stringify)(params);
2609
577
  return isEmpty(queryParams) ? route : "".concat(route, "?").concat(queryParams);
2610
578
  };
2611
579
  var toLocale = function toLocale(number) {
@@ -2615,7 +583,7 @@ var toLocale = function toLocale(number) {
2615
583
  };
2616
584
  var getQueryParams = function getQueryParams() {
2617
585
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
2618
- return lib.parse(location.search, _objectSpread$1({
586
+ return parse(location.search, _objectSpread$1({
2619
587
  ignoreQueryPrefix: true
2620
588
  }, options));
2621
589
  };