@bigbinary/neeto-commons-frontend 3.0.0 → 3.0.2

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/react-utils.js CHANGED
@@ -11,7 +11,7 @@ import { usePersistedQuery as usePersistedQuery$1 } from '@bigbinary/neeto-commo
11
11
  import axios from 'axios';
12
12
  import { getFromLocalStorage } from '@bigbinary/neeto-commons-frontend/utils';
13
13
  import { useQuery, useQueryClient, useMutation } from 'react-query';
14
- import require$$0 from 'util';
14
+ import { parse as parse$1 } from 'qs';
15
15
  import { Helmet } from 'react-helmet';
16
16
 
17
17
  var IGNORABLE_ERRORS_REGEX = /(window\.requestAnimationFrame|ResizeObserver|ChunkLoadError|window\.webkit\.messageHandlers|Request aborted|Network Error)/;
@@ -3620,2044 +3620,12 @@ var usePrevious = function usePrevious(value) {
3620
3620
  return ref.current;
3621
3621
  };
3622
3622
 
3623
- /* eslint complexity: [2, 18], max-statements: [2, 33] */
3624
- var shams = function hasSymbols() {
3625
- if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; }
3626
- if (typeof Symbol.iterator === 'symbol') { return true; }
3627
-
3628
- var obj = {};
3629
- var sym = Symbol('test');
3630
- var symObj = Object(sym);
3631
- if (typeof sym === 'string') { return false; }
3632
-
3633
- if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; }
3634
- if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; }
3635
-
3636
- // temp disabled per https://github.com/ljharb/object.assign/issues/17
3637
- // if (sym instanceof Symbol) { return false; }
3638
- // temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4
3639
- // if (!(symObj instanceof Symbol)) { return false; }
3640
-
3641
- // if (typeof Symbol.prototype.toString !== 'function') { return false; }
3642
- // if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; }
3643
-
3644
- var symVal = 42;
3645
- obj[sym] = symVal;
3646
- for (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop
3647
- if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; }
3648
-
3649
- if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; }
3650
-
3651
- var syms = Object.getOwnPropertySymbols(obj);
3652
- if (syms.length !== 1 || syms[0] !== sym) { return false; }
3653
-
3654
- if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; }
3655
-
3656
- if (typeof Object.getOwnPropertyDescriptor === 'function') {
3657
- var descriptor = Object.getOwnPropertyDescriptor(obj, sym);
3658
- if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; }
3659
- }
3660
-
3661
- return true;
3662
- };
3663
-
3664
- var origSymbol = typeof Symbol !== 'undefined' && Symbol;
3665
- var hasSymbolSham = shams;
3666
-
3667
- var hasSymbols$1 = function hasNativeSymbols() {
3668
- if (typeof origSymbol !== 'function') { return false; }
3669
- if (typeof Symbol !== 'function') { return false; }
3670
- if (typeof origSymbol('foo') !== 'symbol') { return false; }
3671
- if (typeof Symbol('bar') !== 'symbol') { return false; }
3672
-
3673
- return hasSymbolSham();
3674
- };
3675
-
3676
- /* eslint no-invalid-this: 1 */
3677
-
3678
- var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';
3679
- var slice = Array.prototype.slice;
3680
- var toStr$1 = Object.prototype.toString;
3681
- var funcType = '[object Function]';
3682
-
3683
- var implementation$1 = function bind(that) {
3684
- var target = this;
3685
- if (typeof target !== 'function' || toStr$1.call(target) !== funcType) {
3686
- throw new TypeError(ERROR_MESSAGE + target);
3687
- }
3688
- var args = slice.call(arguments, 1);
3689
-
3690
- var bound;
3691
- var binder = function () {
3692
- if (this instanceof bound) {
3693
- var result = target.apply(
3694
- this,
3695
- args.concat(slice.call(arguments))
3696
- );
3697
- if (Object(result) === result) {
3698
- return result;
3699
- }
3700
- return this;
3701
- } else {
3702
- return target.apply(
3703
- that,
3704
- args.concat(slice.call(arguments))
3705
- );
3706
- }
3707
- };
3708
-
3709
- var boundLength = Math.max(0, target.length - args.length);
3710
- var boundArgs = [];
3711
- for (var i = 0; i < boundLength; i++) {
3712
- boundArgs.push('$' + i);
3713
- }
3714
-
3715
- bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder);
3716
-
3717
- if (target.prototype) {
3718
- var Empty = function Empty() {};
3719
- Empty.prototype = target.prototype;
3720
- bound.prototype = new Empty();
3721
- Empty.prototype = null;
3722
- }
3723
-
3724
- return bound;
3725
- };
3726
-
3727
- var implementation = implementation$1;
3728
-
3729
- var functionBind = Function.prototype.bind || implementation;
3730
-
3731
- var bind$1 = functionBind;
3732
-
3733
- var src = bind$1.call(Function.call, Object.prototype.hasOwnProperty);
3734
-
3735
- var undefined$1;
3736
-
3737
- var $SyntaxError = SyntaxError;
3738
- var $Function = Function;
3739
- var $TypeError$1 = TypeError;
3740
-
3741
- // eslint-disable-next-line consistent-return
3742
- var getEvalledConstructor = function (expressionSyntax) {
3743
- try {
3744
- return $Function('"use strict"; return (' + expressionSyntax + ').constructor;')();
3745
- } catch (e) {}
3746
- };
3747
-
3748
- var $gOPD = Object.getOwnPropertyDescriptor;
3749
- if ($gOPD) {
3750
- try {
3751
- $gOPD({}, '');
3752
- } catch (e) {
3753
- $gOPD = null; // this is IE 8, which has a broken gOPD
3754
- }
3755
- }
3756
-
3757
- var throwTypeError = function () {
3758
- throw new $TypeError$1();
3759
- };
3760
- var ThrowTypeError = $gOPD
3761
- ? (function () {
3762
- try {
3763
- // eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties
3764
- arguments.callee; // IE 8 does not throw here
3765
- return throwTypeError;
3766
- } catch (calleeThrows) {
3767
- try {
3768
- // IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')
3769
- return $gOPD(arguments, 'callee').get;
3770
- } catch (gOPDthrows) {
3771
- return throwTypeError;
3772
- }
3773
- }
3774
- }())
3775
- : throwTypeError;
3776
-
3777
- var hasSymbols = hasSymbols$1();
3778
-
3779
- var getProto = Object.getPrototypeOf || function (x) { return x.__proto__; }; // eslint-disable-line no-proto
3780
-
3781
- var needsEval = {};
3782
-
3783
- var TypedArray = typeof Uint8Array === 'undefined' ? undefined$1 : getProto(Uint8Array);
3784
-
3785
- var INTRINSICS = {
3786
- '%AggregateError%': typeof AggregateError === 'undefined' ? undefined$1 : AggregateError,
3787
- '%Array%': Array,
3788
- '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined$1 : ArrayBuffer,
3789
- '%ArrayIteratorPrototype%': hasSymbols ? getProto([][Symbol.iterator]()) : undefined$1,
3790
- '%AsyncFromSyncIteratorPrototype%': undefined$1,
3791
- '%AsyncFunction%': needsEval,
3792
- '%AsyncGenerator%': needsEval,
3793
- '%AsyncGeneratorFunction%': needsEval,
3794
- '%AsyncIteratorPrototype%': needsEval,
3795
- '%Atomics%': typeof Atomics === 'undefined' ? undefined$1 : Atomics,
3796
- '%BigInt%': typeof BigInt === 'undefined' ? undefined$1 : BigInt,
3797
- '%BigInt64Array%': typeof BigInt64Array === 'undefined' ? undefined$1 : BigInt64Array,
3798
- '%BigUint64Array%': typeof BigUint64Array === 'undefined' ? undefined$1 : BigUint64Array,
3799
- '%Boolean%': Boolean,
3800
- '%DataView%': typeof DataView === 'undefined' ? undefined$1 : DataView,
3801
- '%Date%': Date,
3802
- '%decodeURI%': decodeURI,
3803
- '%decodeURIComponent%': decodeURIComponent,
3804
- '%encodeURI%': encodeURI,
3805
- '%encodeURIComponent%': encodeURIComponent,
3806
- '%Error%': Error,
3807
- '%eval%': eval, // eslint-disable-line no-eval
3808
- '%EvalError%': EvalError,
3809
- '%Float32Array%': typeof Float32Array === 'undefined' ? undefined$1 : Float32Array,
3810
- '%Float64Array%': typeof Float64Array === 'undefined' ? undefined$1 : Float64Array,
3811
- '%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined$1 : FinalizationRegistry,
3812
- '%Function%': $Function,
3813
- '%GeneratorFunction%': needsEval,
3814
- '%Int8Array%': typeof Int8Array === 'undefined' ? undefined$1 : Int8Array,
3815
- '%Int16Array%': typeof Int16Array === 'undefined' ? undefined$1 : Int16Array,
3816
- '%Int32Array%': typeof Int32Array === 'undefined' ? undefined$1 : Int32Array,
3817
- '%isFinite%': isFinite,
3818
- '%isNaN%': isNaN,
3819
- '%IteratorPrototype%': hasSymbols ? getProto(getProto([][Symbol.iterator]())) : undefined$1,
3820
- '%JSON%': typeof JSON === 'object' ? JSON : undefined$1,
3821
- '%Map%': typeof Map === 'undefined' ? undefined$1 : Map,
3822
- '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols ? undefined$1 : getProto(new Map()[Symbol.iterator]()),
3823
- '%Math%': Math,
3824
- '%Number%': Number,
3825
- '%Object%': Object,
3826
- '%parseFloat%': parseFloat,
3827
- '%parseInt%': parseInt,
3828
- '%Promise%': typeof Promise === 'undefined' ? undefined$1 : Promise,
3829
- '%Proxy%': typeof Proxy === 'undefined' ? undefined$1 : Proxy,
3830
- '%RangeError%': RangeError,
3831
- '%ReferenceError%': ReferenceError,
3832
- '%Reflect%': typeof Reflect === 'undefined' ? undefined$1 : Reflect,
3833
- '%RegExp%': RegExp,
3834
- '%Set%': typeof Set === 'undefined' ? undefined$1 : Set,
3835
- '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols ? undefined$1 : getProto(new Set()[Symbol.iterator]()),
3836
- '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined$1 : SharedArrayBuffer,
3837
- '%String%': String,
3838
- '%StringIteratorPrototype%': hasSymbols ? getProto(''[Symbol.iterator]()) : undefined$1,
3839
- '%Symbol%': hasSymbols ? Symbol : undefined$1,
3840
- '%SyntaxError%': $SyntaxError,
3841
- '%ThrowTypeError%': ThrowTypeError,
3842
- '%TypedArray%': TypedArray,
3843
- '%TypeError%': $TypeError$1,
3844
- '%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined$1 : Uint8Array,
3845
- '%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined$1 : Uint8ClampedArray,
3846
- '%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined$1 : Uint16Array,
3847
- '%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined$1 : Uint32Array,
3848
- '%URIError%': URIError,
3849
- '%WeakMap%': typeof WeakMap === 'undefined' ? undefined$1 : WeakMap,
3850
- '%WeakRef%': typeof WeakRef === 'undefined' ? undefined$1 : WeakRef,
3851
- '%WeakSet%': typeof WeakSet === 'undefined' ? undefined$1 : WeakSet
3852
- };
3853
-
3854
- try {
3855
- null.error; // eslint-disable-line no-unused-expressions
3856
- } catch (e) {
3857
- // https://github.com/tc39/proposal-shadowrealm/pull/384#issuecomment-1364264229
3858
- var errorProto = getProto(getProto(e));
3859
- INTRINSICS['%Error.prototype%'] = errorProto;
3860
- }
3861
-
3862
- var doEval = function doEval(name) {
3863
- var value;
3864
- if (name === '%AsyncFunction%') {
3865
- value = getEvalledConstructor('async function () {}');
3866
- } else if (name === '%GeneratorFunction%') {
3867
- value = getEvalledConstructor('function* () {}');
3868
- } else if (name === '%AsyncGeneratorFunction%') {
3869
- value = getEvalledConstructor('async function* () {}');
3870
- } else if (name === '%AsyncGenerator%') {
3871
- var fn = doEval('%AsyncGeneratorFunction%');
3872
- if (fn) {
3873
- value = fn.prototype;
3874
- }
3875
- } else if (name === '%AsyncIteratorPrototype%') {
3876
- var gen = doEval('%AsyncGenerator%');
3877
- if (gen) {
3878
- value = getProto(gen.prototype);
3879
- }
3880
- }
3881
-
3882
- INTRINSICS[name] = value;
3883
-
3884
- return value;
3885
- };
3886
-
3887
- var LEGACY_ALIASES = {
3888
- '%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'],
3889
- '%ArrayPrototype%': ['Array', 'prototype'],
3890
- '%ArrayProto_entries%': ['Array', 'prototype', 'entries'],
3891
- '%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'],
3892
- '%ArrayProto_keys%': ['Array', 'prototype', 'keys'],
3893
- '%ArrayProto_values%': ['Array', 'prototype', 'values'],
3894
- '%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'],
3895
- '%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'],
3896
- '%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'],
3897
- '%BooleanPrototype%': ['Boolean', 'prototype'],
3898
- '%DataViewPrototype%': ['DataView', 'prototype'],
3899
- '%DatePrototype%': ['Date', 'prototype'],
3900
- '%ErrorPrototype%': ['Error', 'prototype'],
3901
- '%EvalErrorPrototype%': ['EvalError', 'prototype'],
3902
- '%Float32ArrayPrototype%': ['Float32Array', 'prototype'],
3903
- '%Float64ArrayPrototype%': ['Float64Array', 'prototype'],
3904
- '%FunctionPrototype%': ['Function', 'prototype'],
3905
- '%Generator%': ['GeneratorFunction', 'prototype'],
3906
- '%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'],
3907
- '%Int8ArrayPrototype%': ['Int8Array', 'prototype'],
3908
- '%Int16ArrayPrototype%': ['Int16Array', 'prototype'],
3909
- '%Int32ArrayPrototype%': ['Int32Array', 'prototype'],
3910
- '%JSONParse%': ['JSON', 'parse'],
3911
- '%JSONStringify%': ['JSON', 'stringify'],
3912
- '%MapPrototype%': ['Map', 'prototype'],
3913
- '%NumberPrototype%': ['Number', 'prototype'],
3914
- '%ObjectPrototype%': ['Object', 'prototype'],
3915
- '%ObjProto_toString%': ['Object', 'prototype', 'toString'],
3916
- '%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'],
3917
- '%PromisePrototype%': ['Promise', 'prototype'],
3918
- '%PromiseProto_then%': ['Promise', 'prototype', 'then'],
3919
- '%Promise_all%': ['Promise', 'all'],
3920
- '%Promise_reject%': ['Promise', 'reject'],
3921
- '%Promise_resolve%': ['Promise', 'resolve'],
3922
- '%RangeErrorPrototype%': ['RangeError', 'prototype'],
3923
- '%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'],
3924
- '%RegExpPrototype%': ['RegExp', 'prototype'],
3925
- '%SetPrototype%': ['Set', 'prototype'],
3926
- '%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'],
3927
- '%StringPrototype%': ['String', 'prototype'],
3928
- '%SymbolPrototype%': ['Symbol', 'prototype'],
3929
- '%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'],
3930
- '%TypedArrayPrototype%': ['TypedArray', 'prototype'],
3931
- '%TypeErrorPrototype%': ['TypeError', 'prototype'],
3932
- '%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'],
3933
- '%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'],
3934
- '%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'],
3935
- '%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'],
3936
- '%URIErrorPrototype%': ['URIError', 'prototype'],
3937
- '%WeakMapPrototype%': ['WeakMap', 'prototype'],
3938
- '%WeakSetPrototype%': ['WeakSet', 'prototype']
3939
- };
3940
-
3941
- var bind = functionBind;
3942
- var hasOwn$1 = src;
3943
- var $concat$1 = bind.call(Function.call, Array.prototype.concat);
3944
- var $spliceApply = bind.call(Function.apply, Array.prototype.splice);
3945
- var $replace$1 = bind.call(Function.call, String.prototype.replace);
3946
- var $strSlice = bind.call(Function.call, String.prototype.slice);
3947
- var $exec = bind.call(Function.call, RegExp.prototype.exec);
3948
-
3949
- /* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */
3950
- var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
3951
- var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */
3952
- var stringToPath = function stringToPath(string) {
3953
- var first = $strSlice(string, 0, 1);
3954
- var last = $strSlice(string, -1);
3955
- if (first === '%' && last !== '%') {
3956
- throw new $SyntaxError('invalid intrinsic syntax, expected closing `%`');
3957
- } else if (last === '%' && first !== '%') {
3958
- throw new $SyntaxError('invalid intrinsic syntax, expected opening `%`');
3959
- }
3960
- var result = [];
3961
- $replace$1(string, rePropName, function (match, number, quote, subString) {
3962
- result[result.length] = quote ? $replace$1(subString, reEscapeChar, '$1') : number || match;
3963
- });
3964
- return result;
3965
- };
3966
- /* end adaptation */
3967
-
3968
- var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {
3969
- var intrinsicName = name;
3970
- var alias;
3971
- if (hasOwn$1(LEGACY_ALIASES, intrinsicName)) {
3972
- alias = LEGACY_ALIASES[intrinsicName];
3973
- intrinsicName = '%' + alias[0] + '%';
3974
- }
3975
-
3976
- if (hasOwn$1(INTRINSICS, intrinsicName)) {
3977
- var value = INTRINSICS[intrinsicName];
3978
- if (value === needsEval) {
3979
- value = doEval(intrinsicName);
3980
- }
3981
- if (typeof value === 'undefined' && !allowMissing) {
3982
- throw new $TypeError$1('intrinsic ' + name + ' exists, but is not available. Please file an issue!');
3983
- }
3984
-
3985
- return {
3986
- alias: alias,
3987
- name: intrinsicName,
3988
- value: value
3989
- };
3990
- }
3991
-
3992
- throw new $SyntaxError('intrinsic ' + name + ' does not exist!');
3993
- };
3994
-
3995
- var getIntrinsic = function GetIntrinsic(name, allowMissing) {
3996
- if (typeof name !== 'string' || name.length === 0) {
3997
- throw new $TypeError$1('intrinsic name must be a non-empty string');
3998
- }
3999
- if (arguments.length > 1 && typeof allowMissing !== 'boolean') {
4000
- throw new $TypeError$1('"allowMissing" argument must be a boolean');
4001
- }
4002
-
4003
- if ($exec(/^%?[^%]*%?$/, name) === null) {
4004
- throw new $SyntaxError('`%` may not be present anywhere but at the beginning and end of the intrinsic name');
4005
- }
4006
- var parts = stringToPath(name);
4007
- var intrinsicBaseName = parts.length > 0 ? parts[0] : '';
4008
-
4009
- var intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing);
4010
- var intrinsicRealName = intrinsic.name;
4011
- var value = intrinsic.value;
4012
- var skipFurtherCaching = false;
4013
-
4014
- var alias = intrinsic.alias;
4015
- if (alias) {
4016
- intrinsicBaseName = alias[0];
4017
- $spliceApply(parts, $concat$1([0, 1], alias));
4018
- }
4019
-
4020
- for (var i = 1, isOwn = true; i < parts.length; i += 1) {
4021
- var part = parts[i];
4022
- var first = $strSlice(part, 0, 1);
4023
- var last = $strSlice(part, -1);
4024
- if (
4025
- (
4026
- (first === '"' || first === "'" || first === '`')
4027
- || (last === '"' || last === "'" || last === '`')
4028
- )
4029
- && first !== last
4030
- ) {
4031
- throw new $SyntaxError('property names with quotes must have matching quotes');
4032
- }
4033
- if (part === 'constructor' || !isOwn) {
4034
- skipFurtherCaching = true;
4035
- }
4036
-
4037
- intrinsicBaseName += '.' + part;
4038
- intrinsicRealName = '%' + intrinsicBaseName + '%';
4039
-
4040
- if (hasOwn$1(INTRINSICS, intrinsicRealName)) {
4041
- value = INTRINSICS[intrinsicRealName];
4042
- } else if (value != null) {
4043
- if (!(part in value)) {
4044
- if (!allowMissing) {
4045
- throw new $TypeError$1('base intrinsic for ' + name + ' exists, but the property is not available.');
4046
- }
4047
- return void undefined$1;
4048
- }
4049
- if ($gOPD && (i + 1) >= parts.length) {
4050
- var desc = $gOPD(value, part);
4051
- isOwn = !!desc;
4052
-
4053
- // By convention, when a data property is converted to an accessor
4054
- // property to emulate a data property that does not suffer from
4055
- // the override mistake, that accessor's getter is marked with
4056
- // an `originalValue` property. Here, when we detect this, we
4057
- // uphold the illusion by pretending to see that original data
4058
- // property, i.e., returning the value rather than the getter
4059
- // itself.
4060
- if (isOwn && 'get' in desc && !('originalValue' in desc.get)) {
4061
- value = desc.get;
4062
- } else {
4063
- value = value[part];
4064
- }
4065
- } else {
4066
- isOwn = hasOwn$1(value, part);
4067
- value = value[part];
4068
- }
4069
-
4070
- if (isOwn && !skipFurtherCaching) {
4071
- INTRINSICS[intrinsicRealName] = value;
4072
- }
4073
- }
4074
- }
4075
- return value;
4076
- };
4077
-
4078
- var callBind$1 = {exports: {}};
4079
-
4080
- (function (module) {
4081
-
4082
- var bind = functionBind;
4083
- var GetIntrinsic = getIntrinsic;
4084
-
4085
- var $apply = GetIntrinsic('%Function.prototype.apply%');
4086
- var $call = GetIntrinsic('%Function.prototype.call%');
4087
- var $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply);
4088
-
4089
- var $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true);
4090
- var $defineProperty = GetIntrinsic('%Object.defineProperty%', true);
4091
- var $max = GetIntrinsic('%Math.max%');
4092
-
4093
- if ($defineProperty) {
4094
- try {
4095
- $defineProperty({}, 'a', { value: 1 });
4096
- } catch (e) {
4097
- // IE 8 has a broken defineProperty
4098
- $defineProperty = null;
4099
- }
4100
- }
4101
-
4102
- module.exports = function callBind(originalFunction) {
4103
- var func = $reflectApply(bind, $call, arguments);
4104
- if ($gOPD && $defineProperty) {
4105
- var desc = $gOPD(func, 'length');
4106
- if (desc.configurable) {
4107
- // original length, plus the receiver, minus any additional arguments (after the receiver)
4108
- $defineProperty(
4109
- func,
4110
- 'length',
4111
- { value: 1 + $max(0, originalFunction.length - (arguments.length - 1)) }
4112
- );
4113
- }
4114
- }
4115
- return func;
4116
- };
4117
-
4118
- var applyBind = function applyBind() {
4119
- return $reflectApply(bind, $apply, arguments);
4120
- };
4121
-
4122
- if ($defineProperty) {
4123
- $defineProperty(module.exports, 'apply', { value: applyBind });
4124
- } else {
4125
- module.exports.apply = applyBind;
4126
- }
4127
- } (callBind$1));
4128
-
4129
- var GetIntrinsic$1 = getIntrinsic;
4130
-
4131
- var callBind = callBind$1.exports;
4132
-
4133
- var $indexOf = callBind(GetIntrinsic$1('String.prototype.indexOf'));
4134
-
4135
- var callBound$1 = function callBoundIntrinsic(name, allowMissing) {
4136
- var intrinsic = GetIntrinsic$1(name, !!allowMissing);
4137
- if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) {
4138
- return callBind(intrinsic);
4139
- }
4140
- return intrinsic;
4141
- };
4142
-
4143
- var util_inspect = require$$0.inspect;
4144
-
4145
- var hasMap = typeof Map === 'function' && Map.prototype;
4146
- var mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, 'size') : null;
4147
- var mapSize = hasMap && mapSizeDescriptor && typeof mapSizeDescriptor.get === 'function' ? mapSizeDescriptor.get : null;
4148
- var mapForEach = hasMap && Map.prototype.forEach;
4149
- var hasSet = typeof Set === 'function' && Set.prototype;
4150
- var setSizeDescriptor = Object.getOwnPropertyDescriptor && hasSet ? Object.getOwnPropertyDescriptor(Set.prototype, 'size') : null;
4151
- var setSize = hasSet && setSizeDescriptor && typeof setSizeDescriptor.get === 'function' ? setSizeDescriptor.get : null;
4152
- var setForEach = hasSet && Set.prototype.forEach;
4153
- var hasWeakMap = typeof WeakMap === 'function' && WeakMap.prototype;
4154
- var weakMapHas = hasWeakMap ? WeakMap.prototype.has : null;
4155
- var hasWeakSet = typeof WeakSet === 'function' && WeakSet.prototype;
4156
- var weakSetHas = hasWeakSet ? WeakSet.prototype.has : null;
4157
- var hasWeakRef = typeof WeakRef === 'function' && WeakRef.prototype;
4158
- var weakRefDeref = hasWeakRef ? WeakRef.prototype.deref : null;
4159
- var booleanValueOf = Boolean.prototype.valueOf;
4160
- var objectToString = Object.prototype.toString;
4161
- var functionToString = Function.prototype.toString;
4162
- var $match = String.prototype.match;
4163
- var $slice = String.prototype.slice;
4164
- var $replace = String.prototype.replace;
4165
- var $toUpperCase = String.prototype.toUpperCase;
4166
- var $toLowerCase = String.prototype.toLowerCase;
4167
- var $test = RegExp.prototype.test;
4168
- var $concat = Array.prototype.concat;
4169
- var $join = Array.prototype.join;
4170
- var $arrSlice = Array.prototype.slice;
4171
- var $floor = Math.floor;
4172
- var bigIntValueOf = typeof BigInt === 'function' ? BigInt.prototype.valueOf : null;
4173
- var gOPS = Object.getOwnPropertySymbols;
4174
- var symToString = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol' ? Symbol.prototype.toString : null;
4175
- var hasShammedSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'object';
4176
- // ie, `has-tostringtag/shams
4177
- var toStringTag = typeof Symbol === 'function' && Symbol.toStringTag && (typeof Symbol.toStringTag === hasShammedSymbols ? 'object' : 'symbol')
4178
- ? Symbol.toStringTag
4179
- : null;
4180
- var isEnumerable = Object.prototype.propertyIsEnumerable;
4181
-
4182
- var gPO = (typeof Reflect === 'function' ? Reflect.getPrototypeOf : Object.getPrototypeOf) || (
4183
- [].__proto__ === Array.prototype // eslint-disable-line no-proto
4184
- ? function (O) {
4185
- return O.__proto__; // eslint-disable-line no-proto
4186
- }
4187
- : null
4188
- );
4189
-
4190
- function addNumericSeparator(num, str) {
4191
- if (
4192
- num === Infinity
4193
- || num === -Infinity
4194
- || num !== num
4195
- || (num && num > -1000 && num < 1000)
4196
- || $test.call(/e/, str)
4197
- ) {
4198
- return str;
4199
- }
4200
- var sepRegex = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;
4201
- if (typeof num === 'number') {
4202
- var int = num < 0 ? -$floor(-num) : $floor(num); // trunc(num)
4203
- if (int !== num) {
4204
- var intStr = String(int);
4205
- var dec = $slice.call(str, intStr.length + 1);
4206
- return $replace.call(intStr, sepRegex, '$&_') + '.' + $replace.call($replace.call(dec, /([0-9]{3})/g, '$&_'), /_$/, '');
4207
- }
4208
- }
4209
- return $replace.call(str, sepRegex, '$&_');
4210
- }
4211
-
4212
- var utilInspect = util_inspect;
4213
- var inspectCustom = utilInspect.custom;
4214
- var inspectSymbol = isSymbol(inspectCustom) ? inspectCustom : null;
4215
-
4216
- var objectInspect = function inspect_(obj, options, depth, seen) {
4217
- var opts = options || {};
4218
-
4219
- if (has$3(opts, 'quoteStyle') && (opts.quoteStyle !== 'single' && opts.quoteStyle !== 'double')) {
4220
- throw new TypeError('option "quoteStyle" must be "single" or "double"');
4221
- }
4222
- if (
4223
- has$3(opts, 'maxStringLength') && (typeof opts.maxStringLength === 'number'
4224
- ? opts.maxStringLength < 0 && opts.maxStringLength !== Infinity
4225
- : opts.maxStringLength !== null
4226
- )
4227
- ) {
4228
- throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');
4229
- }
4230
- var customInspect = has$3(opts, 'customInspect') ? opts.customInspect : true;
4231
- if (typeof customInspect !== 'boolean' && customInspect !== 'symbol') {
4232
- throw new TypeError('option "customInspect", if provided, must be `true`, `false`, or `\'symbol\'`');
4233
- }
4234
-
4235
- if (
4236
- has$3(opts, 'indent')
4237
- && opts.indent !== null
4238
- && opts.indent !== '\t'
4239
- && !(parseInt(opts.indent, 10) === opts.indent && opts.indent > 0)
4240
- ) {
4241
- throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');
4242
- }
4243
- if (has$3(opts, 'numericSeparator') && typeof opts.numericSeparator !== 'boolean') {
4244
- throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');
4245
- }
4246
- var numericSeparator = opts.numericSeparator;
4247
-
4248
- if (typeof obj === 'undefined') {
4249
- return 'undefined';
4250
- }
4251
- if (obj === null) {
4252
- return 'null';
4253
- }
4254
- if (typeof obj === 'boolean') {
4255
- return obj ? 'true' : 'false';
4256
- }
4257
-
4258
- if (typeof obj === 'string') {
4259
- return inspectString(obj, opts);
4260
- }
4261
- if (typeof obj === 'number') {
4262
- if (obj === 0) {
4263
- return Infinity / obj > 0 ? '0' : '-0';
4264
- }
4265
- var str = String(obj);
4266
- return numericSeparator ? addNumericSeparator(obj, str) : str;
4267
- }
4268
- if (typeof obj === 'bigint') {
4269
- var bigIntStr = String(obj) + 'n';
4270
- return numericSeparator ? addNumericSeparator(obj, bigIntStr) : bigIntStr;
4271
- }
4272
-
4273
- var maxDepth = typeof opts.depth === 'undefined' ? 5 : opts.depth;
4274
- if (typeof depth === 'undefined') { depth = 0; }
4275
- if (depth >= maxDepth && maxDepth > 0 && typeof obj === 'object') {
4276
- return isArray$3(obj) ? '[Array]' : '[Object]';
4277
- }
4278
-
4279
- var indent = getIndent(opts, depth);
4280
-
4281
- if (typeof seen === 'undefined') {
4282
- seen = [];
4283
- } else if (indexOf(seen, obj) >= 0) {
4284
- return '[Circular]';
4285
- }
4286
-
4287
- function inspect(value, from, noIndent) {
4288
- if (from) {
4289
- seen = $arrSlice.call(seen);
4290
- seen.push(from);
4291
- }
4292
- if (noIndent) {
4293
- var newOpts = {
4294
- depth: opts.depth
4295
- };
4296
- if (has$3(opts, 'quoteStyle')) {
4297
- newOpts.quoteStyle = opts.quoteStyle;
4298
- }
4299
- return inspect_(value, newOpts, depth + 1, seen);
4300
- }
4301
- return inspect_(value, opts, depth + 1, seen);
4302
- }
4303
-
4304
- if (typeof obj === 'function' && !isRegExp$1(obj)) { // in older engines, regexes are callable
4305
- var name = nameOf(obj);
4306
- var keys = arrObjKeys(obj, inspect);
4307
- return '[Function' + (name ? ': ' + name : ' (anonymous)') + ']' + (keys.length > 0 ? ' { ' + $join.call(keys, ', ') + ' }' : '');
4308
- }
4309
- if (isSymbol(obj)) {
4310
- var symString = hasShammedSymbols ? $replace.call(String(obj), /^(Symbol\(.*\))_[^)]*$/, '$1') : symToString.call(obj);
4311
- return typeof obj === 'object' && !hasShammedSymbols ? markBoxed(symString) : symString;
4312
- }
4313
- if (isElement(obj)) {
4314
- var s = '<' + $toLowerCase.call(String(obj.nodeName));
4315
- var attrs = obj.attributes || [];
4316
- for (var i = 0; i < attrs.length; i++) {
4317
- s += ' ' + attrs[i].name + '=' + wrapQuotes(quote(attrs[i].value), 'double', opts);
4318
- }
4319
- s += '>';
4320
- if (obj.childNodes && obj.childNodes.length) { s += '...'; }
4321
- s += '</' + $toLowerCase.call(String(obj.nodeName)) + '>';
4322
- return s;
4323
- }
4324
- if (isArray$3(obj)) {
4325
- if (obj.length === 0) { return '[]'; }
4326
- var xs = arrObjKeys(obj, inspect);
4327
- if (indent && !singleLineValues(xs)) {
4328
- return '[' + indentedJoin(xs, indent) + ']';
4329
- }
4330
- return '[ ' + $join.call(xs, ', ') + ' ]';
4331
- }
4332
- if (isError(obj)) {
4333
- var parts = arrObjKeys(obj, inspect);
4334
- if (!('cause' in Error.prototype) && 'cause' in obj && !isEnumerable.call(obj, 'cause')) {
4335
- return '{ [' + String(obj) + '] ' + $join.call($concat.call('[cause]: ' + inspect(obj.cause), parts), ', ') + ' }';
4336
- }
4337
- if (parts.length === 0) { return '[' + String(obj) + ']'; }
4338
- return '{ [' + String(obj) + '] ' + $join.call(parts, ', ') + ' }';
4339
- }
4340
- if (typeof obj === 'object' && customInspect) {
4341
- if (inspectSymbol && typeof obj[inspectSymbol] === 'function' && utilInspect) {
4342
- return utilInspect(obj, { depth: maxDepth - depth });
4343
- } else if (customInspect !== 'symbol' && typeof obj.inspect === 'function') {
4344
- return obj.inspect();
4345
- }
4346
- }
4347
- if (isMap(obj)) {
4348
- var mapParts = [];
4349
- if (mapForEach) {
4350
- mapForEach.call(obj, function (value, key) {
4351
- mapParts.push(inspect(key, obj, true) + ' => ' + inspect(value, obj));
4352
- });
4353
- }
4354
- return collectionOf('Map', mapSize.call(obj), mapParts, indent);
4355
- }
4356
- if (isSet(obj)) {
4357
- var setParts = [];
4358
- if (setForEach) {
4359
- setForEach.call(obj, function (value) {
4360
- setParts.push(inspect(value, obj));
4361
- });
4362
- }
4363
- return collectionOf('Set', setSize.call(obj), setParts, indent);
4364
- }
4365
- if (isWeakMap(obj)) {
4366
- return weakCollectionOf('WeakMap');
4367
- }
4368
- if (isWeakSet(obj)) {
4369
- return weakCollectionOf('WeakSet');
4370
- }
4371
- if (isWeakRef(obj)) {
4372
- return weakCollectionOf('WeakRef');
4373
- }
4374
- if (isNumber(obj)) {
4375
- return markBoxed(inspect(Number(obj)));
4376
- }
4377
- if (isBigInt(obj)) {
4378
- return markBoxed(inspect(bigIntValueOf.call(obj)));
4379
- }
4380
- if (isBoolean(obj)) {
4381
- return markBoxed(booleanValueOf.call(obj));
4382
- }
4383
- if (isString(obj)) {
4384
- return markBoxed(inspect(String(obj)));
4385
- }
4386
- if (!isDate(obj) && !isRegExp$1(obj)) {
4387
- var ys = arrObjKeys(obj, inspect);
4388
- var isPlainObject = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object;
4389
- var protoTag = obj instanceof Object ? '' : 'null prototype';
4390
- var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr(obj), 8, -1) : protoTag ? 'Object' : '';
4391
- var constructorTag = isPlainObject || typeof obj.constructor !== 'function' ? '' : obj.constructor.name ? obj.constructor.name + ' ' : '';
4392
- var tag = constructorTag + (stringTag || protoTag ? '[' + $join.call($concat.call([], stringTag || [], protoTag || []), ': ') + '] ' : '');
4393
- if (ys.length === 0) { return tag + '{}'; }
4394
- if (indent) {
4395
- return tag + '{' + indentedJoin(ys, indent) + '}';
4396
- }
4397
- return tag + '{ ' + $join.call(ys, ', ') + ' }';
4398
- }
4399
- return String(obj);
4400
- };
4401
-
4402
- function wrapQuotes(s, defaultStyle, opts) {
4403
- var quoteChar = (opts.quoteStyle || defaultStyle) === 'double' ? '"' : "'";
4404
- return quoteChar + s + quoteChar;
4405
- }
4406
-
4407
- function quote(s) {
4408
- return $replace.call(String(s), /"/g, '&quot;');
4409
- }
4410
-
4411
- function isArray$3(obj) { return toStr(obj) === '[object Array]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
4412
- function isDate(obj) { return toStr(obj) === '[object Date]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
4413
- function isRegExp$1(obj) { return toStr(obj) === '[object RegExp]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
4414
- function isError(obj) { return toStr(obj) === '[object Error]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
4415
- function isString(obj) { return toStr(obj) === '[object String]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
4416
- function isNumber(obj) { return toStr(obj) === '[object Number]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
4417
- function isBoolean(obj) { return toStr(obj) === '[object Boolean]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
4418
-
4419
- // Symbol and BigInt do have Symbol.toStringTag by spec, so that can't be used to eliminate false positives
4420
- function isSymbol(obj) {
4421
- if (hasShammedSymbols) {
4422
- return obj && typeof obj === 'object' && obj instanceof Symbol;
4423
- }
4424
- if (typeof obj === 'symbol') {
4425
- return true;
4426
- }
4427
- if (!obj || typeof obj !== 'object' || !symToString) {
4428
- return false;
4429
- }
4430
- try {
4431
- symToString.call(obj);
4432
- return true;
4433
- } catch (e) {}
4434
- return false;
4435
- }
4436
-
4437
- function isBigInt(obj) {
4438
- if (!obj || typeof obj !== 'object' || !bigIntValueOf) {
4439
- return false;
4440
- }
4441
- try {
4442
- bigIntValueOf.call(obj);
4443
- return true;
4444
- } catch (e) {}
4445
- return false;
4446
- }
4447
-
4448
- var hasOwn = Object.prototype.hasOwnProperty || function (key) { return key in this; };
4449
- function has$3(obj, key) {
4450
- return hasOwn.call(obj, key);
4451
- }
4452
-
4453
- function toStr(obj) {
4454
- return objectToString.call(obj);
4455
- }
4456
-
4457
- function nameOf(f) {
4458
- if (f.name) { return f.name; }
4459
- var m = $match.call(functionToString.call(f), /^function\s*([\w$]+)/);
4460
- if (m) { return m[1]; }
4461
- return null;
4462
- }
4463
-
4464
- function indexOf(xs, x) {
4465
- if (xs.indexOf) { return xs.indexOf(x); }
4466
- for (var i = 0, l = xs.length; i < l; i++) {
4467
- if (xs[i] === x) { return i; }
4468
- }
4469
- return -1;
4470
- }
4471
-
4472
- function isMap(x) {
4473
- if (!mapSize || !x || typeof x !== 'object') {
4474
- return false;
4475
- }
4476
- try {
4477
- mapSize.call(x);
4478
- try {
4479
- setSize.call(x);
4480
- } catch (s) {
4481
- return true;
4482
- }
4483
- return x instanceof Map; // core-js workaround, pre-v2.5.0
4484
- } catch (e) {}
4485
- return false;
4486
- }
4487
-
4488
- function isWeakMap(x) {
4489
- if (!weakMapHas || !x || typeof x !== 'object') {
4490
- return false;
4491
- }
4492
- try {
4493
- weakMapHas.call(x, weakMapHas);
4494
- try {
4495
- weakSetHas.call(x, weakSetHas);
4496
- } catch (s) {
4497
- return true;
4498
- }
4499
- return x instanceof WeakMap; // core-js workaround, pre-v2.5.0
4500
- } catch (e) {}
4501
- return false;
4502
- }
4503
-
4504
- function isWeakRef(x) {
4505
- if (!weakRefDeref || !x || typeof x !== 'object') {
4506
- return false;
4507
- }
4508
- try {
4509
- weakRefDeref.call(x);
4510
- return true;
4511
- } catch (e) {}
4512
- return false;
4513
- }
4514
-
4515
- function isSet(x) {
4516
- if (!setSize || !x || typeof x !== 'object') {
4517
- return false;
4518
- }
4519
- try {
4520
- setSize.call(x);
4521
- try {
4522
- mapSize.call(x);
4523
- } catch (m) {
4524
- return true;
4525
- }
4526
- return x instanceof Set; // core-js workaround, pre-v2.5.0
4527
- } catch (e) {}
4528
- return false;
4529
- }
4530
-
4531
- function isWeakSet(x) {
4532
- if (!weakSetHas || !x || typeof x !== 'object') {
4533
- return false;
4534
- }
4535
- try {
4536
- weakSetHas.call(x, weakSetHas);
4537
- try {
4538
- weakMapHas.call(x, weakMapHas);
4539
- } catch (s) {
4540
- return true;
4541
- }
4542
- return x instanceof WeakSet; // core-js workaround, pre-v2.5.0
4543
- } catch (e) {}
4544
- return false;
4545
- }
4546
-
4547
- function isElement(x) {
4548
- if (!x || typeof x !== 'object') { return false; }
4549
- if (typeof HTMLElement !== 'undefined' && x instanceof HTMLElement) {
4550
- return true;
4551
- }
4552
- return typeof x.nodeName === 'string' && typeof x.getAttribute === 'function';
4553
- }
4554
-
4555
- function inspectString(str, opts) {
4556
- if (str.length > opts.maxStringLength) {
4557
- var remaining = str.length - opts.maxStringLength;
4558
- var trailer = '... ' + remaining + ' more character' + (remaining > 1 ? 's' : '');
4559
- return inspectString($slice.call(str, 0, opts.maxStringLength), opts) + trailer;
4560
- }
4561
- // eslint-disable-next-line no-control-regex
4562
- var s = $replace.call($replace.call(str, /(['\\])/g, '\\$1'), /[\x00-\x1f]/g, lowbyte);
4563
- return wrapQuotes(s, 'single', opts);
4564
- }
4565
-
4566
- function lowbyte(c) {
4567
- var n = c.charCodeAt(0);
4568
- var x = {
4569
- 8: 'b',
4570
- 9: 't',
4571
- 10: 'n',
4572
- 12: 'f',
4573
- 13: 'r'
4574
- }[n];
4575
- if (x) { return '\\' + x; }
4576
- return '\\x' + (n < 0x10 ? '0' : '') + $toUpperCase.call(n.toString(16));
4577
- }
4578
-
4579
- function markBoxed(str) {
4580
- return 'Object(' + str + ')';
4581
- }
4582
-
4583
- function weakCollectionOf(type) {
4584
- return type + ' { ? }';
4585
- }
4586
-
4587
- function collectionOf(type, size, entries, indent) {
4588
- var joinedEntries = indent ? indentedJoin(entries, indent) : $join.call(entries, ', ');
4589
- return type + ' (' + size + ') {' + joinedEntries + '}';
4590
- }
4591
-
4592
- function singleLineValues(xs) {
4593
- for (var i = 0; i < xs.length; i++) {
4594
- if (indexOf(xs[i], '\n') >= 0) {
4595
- return false;
4596
- }
4597
- }
4598
- return true;
4599
- }
4600
-
4601
- function getIndent(opts, depth) {
4602
- var baseIndent;
4603
- if (opts.indent === '\t') {
4604
- baseIndent = '\t';
4605
- } else if (typeof opts.indent === 'number' && opts.indent > 0) {
4606
- baseIndent = $join.call(Array(opts.indent + 1), ' ');
4607
- } else {
4608
- return null;
4609
- }
4610
- return {
4611
- base: baseIndent,
4612
- prev: $join.call(Array(depth + 1), baseIndent)
4613
- };
4614
- }
4615
-
4616
- function indentedJoin(xs, indent) {
4617
- if (xs.length === 0) { return ''; }
4618
- var lineJoiner = '\n' + indent.prev + indent.base;
4619
- return lineJoiner + $join.call(xs, ',' + lineJoiner) + '\n' + indent.prev;
4620
- }
4621
-
4622
- function arrObjKeys(obj, inspect) {
4623
- var isArr = isArray$3(obj);
4624
- var xs = [];
4625
- if (isArr) {
4626
- xs.length = obj.length;
4627
- for (var i = 0; i < obj.length; i++) {
4628
- xs[i] = has$3(obj, i) ? inspect(obj[i], obj) : '';
4629
- }
4630
- }
4631
- var syms = typeof gOPS === 'function' ? gOPS(obj) : [];
4632
- var symMap;
4633
- if (hasShammedSymbols) {
4634
- symMap = {};
4635
- for (var k = 0; k < syms.length; k++) {
4636
- symMap['$' + syms[k]] = syms[k];
4637
- }
4638
- }
4639
-
4640
- for (var key in obj) { // eslint-disable-line no-restricted-syntax
4641
- if (!has$3(obj, key)) { continue; } // eslint-disable-line no-restricted-syntax, no-continue
4642
- if (isArr && String(Number(key)) === key && key < obj.length) { continue; } // eslint-disable-line no-restricted-syntax, no-continue
4643
- if (hasShammedSymbols && symMap['$' + key] instanceof Symbol) {
4644
- // this is to prevent shammed Symbols, which are stored as strings, from being included in the string key section
4645
- continue; // eslint-disable-line no-restricted-syntax, no-continue
4646
- } else if ($test.call(/[^\w$]/, key)) {
4647
- xs.push(inspect(key, obj) + ': ' + inspect(obj[key], obj));
4648
- } else {
4649
- xs.push(key + ': ' + inspect(obj[key], obj));
4650
- }
4651
- }
4652
- if (typeof gOPS === 'function') {
4653
- for (var j = 0; j < syms.length; j++) {
4654
- if (isEnumerable.call(obj, syms[j])) {
4655
- xs.push('[' + inspect(syms[j]) + ']: ' + inspect(obj[syms[j]], obj));
4656
- }
4657
- }
4658
- }
4659
- return xs;
4660
- }
4661
-
4662
- var GetIntrinsic = getIntrinsic;
4663
- var callBound = callBound$1;
4664
- var inspect = objectInspect;
4665
-
4666
- var $TypeError = GetIntrinsic('%TypeError%');
4667
- var $WeakMap = GetIntrinsic('%WeakMap%', true);
4668
- var $Map = GetIntrinsic('%Map%', true);
4669
-
4670
- var $weakMapGet = callBound('WeakMap.prototype.get', true);
4671
- var $weakMapSet = callBound('WeakMap.prototype.set', true);
4672
- var $weakMapHas = callBound('WeakMap.prototype.has', true);
4673
- var $mapGet = callBound('Map.prototype.get', true);
4674
- var $mapSet = callBound('Map.prototype.set', true);
4675
- var $mapHas = callBound('Map.prototype.has', true);
4676
-
4677
- /*
4678
- * This function traverses the list returning the node corresponding to the
4679
- * given key.
4680
- *
4681
- * That node is also moved to the head of the list, so that if it's accessed
4682
- * again we don't need to traverse the whole list. By doing so, all the recently
4683
- * used nodes can be accessed relatively quickly.
4684
- */
4685
- var listGetNode = function (list, key) { // eslint-disable-line consistent-return
4686
- for (var prev = list, curr; (curr = prev.next) !== null; prev = curr) {
4687
- if (curr.key === key) {
4688
- prev.next = curr.next;
4689
- curr.next = list.next;
4690
- list.next = curr; // eslint-disable-line no-param-reassign
4691
- return curr;
4692
- }
4693
- }
4694
- };
4695
-
4696
- var listGet = function (objects, key) {
4697
- var node = listGetNode(objects, key);
4698
- return node && node.value;
4699
- };
4700
- var listSet = function (objects, key, value) {
4701
- var node = listGetNode(objects, key);
4702
- if (node) {
4703
- node.value = value;
4704
- } else {
4705
- // Prepend the new node to the beginning of the list
4706
- objects.next = { // eslint-disable-line no-param-reassign
4707
- key: key,
4708
- next: objects.next,
4709
- value: value
4710
- };
4711
- }
4712
- };
4713
- var listHas = function (objects, key) {
4714
- return !!listGetNode(objects, key);
4715
- };
4716
-
4717
- var sideChannel = function getSideChannel() {
4718
- var $wm;
4719
- var $m;
4720
- var $o;
4721
- var channel = {
4722
- assert: function (key) {
4723
- if (!channel.has(key)) {
4724
- throw new $TypeError('Side channel does not contain ' + inspect(key));
4725
- }
4726
- },
4727
- get: function (key) { // eslint-disable-line consistent-return
4728
- if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {
4729
- if ($wm) {
4730
- return $weakMapGet($wm, key);
4731
- }
4732
- } else if ($Map) {
4733
- if ($m) {
4734
- return $mapGet($m, key);
4735
- }
4736
- } else {
4737
- if ($o) { // eslint-disable-line no-lonely-if
4738
- return listGet($o, key);
4739
- }
4740
- }
4741
- },
4742
- has: function (key) {
4743
- if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {
4744
- if ($wm) {
4745
- return $weakMapHas($wm, key);
4746
- }
4747
- } else if ($Map) {
4748
- if ($m) {
4749
- return $mapHas($m, key);
4750
- }
4751
- } else {
4752
- if ($o) { // eslint-disable-line no-lonely-if
4753
- return listHas($o, key);
4754
- }
4755
- }
4756
- return false;
4757
- },
4758
- set: function (key, value) {
4759
- if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {
4760
- if (!$wm) {
4761
- $wm = new $WeakMap();
4762
- }
4763
- $weakMapSet($wm, key, value);
4764
- } else if ($Map) {
4765
- if (!$m) {
4766
- $m = new $Map();
4767
- }
4768
- $mapSet($m, key, value);
4769
- } else {
4770
- if (!$o) {
4771
- /*
4772
- * Initialize the linked list as an empty node, so that we don't have
4773
- * to special-case handling of the first node: we can always refer to
4774
- * it as (previous node).next, instead of something like (list).head
4775
- */
4776
- $o = { key: {}, next: null };
4777
- }
4778
- listSet($o, key, value);
4779
- }
4780
- }
4781
- };
4782
- return channel;
4783
- };
4784
-
4785
- var replace = String.prototype.replace;
4786
- var percentTwenties = /%20/g;
4787
-
4788
- var Format = {
4789
- RFC1738: 'RFC1738',
4790
- RFC3986: 'RFC3986'
4791
- };
4792
-
4793
- var formats$3 = {
4794
- 'default': Format.RFC3986,
4795
- formatters: {
4796
- RFC1738: function (value) {
4797
- return replace.call(value, percentTwenties, '+');
4798
- },
4799
- RFC3986: function (value) {
4800
- return String(value);
4801
- }
4802
- },
4803
- RFC1738: Format.RFC1738,
4804
- RFC3986: Format.RFC3986
4805
- };
4806
-
4807
- var formats$2 = formats$3;
4808
-
4809
- var has$2 = Object.prototype.hasOwnProperty;
4810
- var isArray$2 = Array.isArray;
4811
-
4812
- var hexTable = (function () {
4813
- var array = [];
4814
- for (var i = 0; i < 256; ++i) {
4815
- array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase());
4816
- }
4817
-
4818
- return array;
4819
- }());
4820
-
4821
- var compactQueue = function compactQueue(queue) {
4822
- while (queue.length > 1) {
4823
- var item = queue.pop();
4824
- var obj = item.obj[item.prop];
4825
-
4826
- if (isArray$2(obj)) {
4827
- var compacted = [];
4828
-
4829
- for (var j = 0; j < obj.length; ++j) {
4830
- if (typeof obj[j] !== 'undefined') {
4831
- compacted.push(obj[j]);
4832
- }
4833
- }
4834
-
4835
- item.obj[item.prop] = compacted;
4836
- }
4837
- }
4838
- };
4839
-
4840
- var arrayToObject = function arrayToObject(source, options) {
4841
- var obj = options && options.plainObjects ? Object.create(null) : {};
4842
- for (var i = 0; i < source.length; ++i) {
4843
- if (typeof source[i] !== 'undefined') {
4844
- obj[i] = source[i];
4845
- }
4846
- }
4847
-
4848
- return obj;
4849
- };
4850
-
4851
- var merge = function merge(target, source, options) {
4852
- /* eslint no-param-reassign: 0 */
4853
- if (!source) {
4854
- return target;
4855
- }
4856
-
4857
- if (typeof source !== 'object') {
4858
- if (isArray$2(target)) {
4859
- target.push(source);
4860
- } else if (target && typeof target === 'object') {
4861
- if ((options && (options.plainObjects || options.allowPrototypes)) || !has$2.call(Object.prototype, source)) {
4862
- target[source] = true;
4863
- }
4864
- } else {
4865
- return [target, source];
4866
- }
4867
-
4868
- return target;
4869
- }
4870
-
4871
- if (!target || typeof target !== 'object') {
4872
- return [target].concat(source);
4873
- }
4874
-
4875
- var mergeTarget = target;
4876
- if (isArray$2(target) && !isArray$2(source)) {
4877
- mergeTarget = arrayToObject(target, options);
4878
- }
4879
-
4880
- if (isArray$2(target) && isArray$2(source)) {
4881
- source.forEach(function (item, i) {
4882
- if (has$2.call(target, i)) {
4883
- var targetItem = target[i];
4884
- if (targetItem && typeof targetItem === 'object' && item && typeof item === 'object') {
4885
- target[i] = merge(targetItem, item, options);
4886
- } else {
4887
- target.push(item);
4888
- }
4889
- } else {
4890
- target[i] = item;
4891
- }
4892
- });
4893
- return target;
4894
- }
4895
-
4896
- return Object.keys(source).reduce(function (acc, key) {
4897
- var value = source[key];
4898
-
4899
- if (has$2.call(acc, key)) {
4900
- acc[key] = merge(acc[key], value, options);
4901
- } else {
4902
- acc[key] = value;
4903
- }
4904
- return acc;
4905
- }, mergeTarget);
4906
- };
4907
-
4908
- var assign = function assignSingleSource(target, source) {
4909
- return Object.keys(source).reduce(function (acc, key) {
4910
- acc[key] = source[key];
4911
- return acc;
4912
- }, target);
4913
- };
4914
-
4915
- var decode = function (str, decoder, charset) {
4916
- var strWithoutPlus = str.replace(/\+/g, ' ');
4917
- if (charset === 'iso-8859-1') {
4918
- // unescape never throws, no try...catch needed:
4919
- return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape);
4920
- }
4921
- // utf-8
4922
- try {
4923
- return decodeURIComponent(strWithoutPlus);
4924
- } catch (e) {
4925
- return strWithoutPlus;
4926
- }
4927
- };
4928
-
4929
- var encode = function encode(str, defaultEncoder, charset, kind, format) {
4930
- // This code was originally written by Brian White (mscdex) for the io.js core querystring library.
4931
- // It has been adapted here for stricter adherence to RFC 3986
4932
- if (str.length === 0) {
4933
- return str;
4934
- }
4935
-
4936
- var string = str;
4937
- if (typeof str === 'symbol') {
4938
- string = Symbol.prototype.toString.call(str);
4939
- } else if (typeof str !== 'string') {
4940
- string = String(str);
4941
- }
4942
-
4943
- if (charset === 'iso-8859-1') {
4944
- return escape(string).replace(/%u[0-9a-f]{4}/gi, function ($0) {
4945
- return '%26%23' + parseInt($0.slice(2), 16) + '%3B';
4946
- });
4947
- }
4948
-
4949
- var out = '';
4950
- for (var i = 0; i < string.length; ++i) {
4951
- var c = string.charCodeAt(i);
4952
-
4953
- if (
4954
- c === 0x2D // -
4955
- || c === 0x2E // .
4956
- || c === 0x5F // _
4957
- || c === 0x7E // ~
4958
- || (c >= 0x30 && c <= 0x39) // 0-9
4959
- || (c >= 0x41 && c <= 0x5A) // a-z
4960
- || (c >= 0x61 && c <= 0x7A) // A-Z
4961
- || (format === formats$2.RFC1738 && (c === 0x28 || c === 0x29)) // ( )
4962
- ) {
4963
- out += string.charAt(i);
4964
- continue;
4965
- }
4966
-
4967
- if (c < 0x80) {
4968
- out = out + hexTable[c];
4969
- continue;
4970
- }
4971
-
4972
- if (c < 0x800) {
4973
- out = out + (hexTable[0xC0 | (c >> 6)] + hexTable[0x80 | (c & 0x3F)]);
4974
- continue;
4975
- }
4976
-
4977
- if (c < 0xD800 || c >= 0xE000) {
4978
- out = out + (hexTable[0xE0 | (c >> 12)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]);
4979
- continue;
4980
- }
4981
-
4982
- i += 1;
4983
- c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF));
4984
- /* eslint operator-linebreak: [2, "before"] */
4985
- out += hexTable[0xF0 | (c >> 18)]
4986
- + hexTable[0x80 | ((c >> 12) & 0x3F)]
4987
- + hexTable[0x80 | ((c >> 6) & 0x3F)]
4988
- + hexTable[0x80 | (c & 0x3F)];
4989
- }
4990
-
4991
- return out;
4992
- };
4993
-
4994
- var compact = function compact(value) {
4995
- var queue = [{ obj: { o: value }, prop: 'o' }];
4996
- var refs = [];
4997
-
4998
- for (var i = 0; i < queue.length; ++i) {
4999
- var item = queue[i];
5000
- var obj = item.obj[item.prop];
5001
-
5002
- var keys = Object.keys(obj);
5003
- for (var j = 0; j < keys.length; ++j) {
5004
- var key = keys[j];
5005
- var val = obj[key];
5006
- if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) {
5007
- queue.push({ obj: obj, prop: key });
5008
- refs.push(val);
5009
- }
5010
- }
5011
- }
5012
-
5013
- compactQueue(queue);
5014
-
5015
- return value;
5016
- };
5017
-
5018
- var isRegExp = function isRegExp(obj) {
5019
- return Object.prototype.toString.call(obj) === '[object RegExp]';
5020
- };
5021
-
5022
- var isBuffer = function isBuffer(obj) {
5023
- if (!obj || typeof obj !== 'object') {
5024
- return false;
5025
- }
5026
-
5027
- return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));
5028
- };
5029
-
5030
- var combine = function combine(a, b) {
5031
- return [].concat(a, b);
5032
- };
5033
-
5034
- var maybeMap = function maybeMap(val, fn) {
5035
- if (isArray$2(val)) {
5036
- var mapped = [];
5037
- for (var i = 0; i < val.length; i += 1) {
5038
- mapped.push(fn(val[i]));
5039
- }
5040
- return mapped;
5041
- }
5042
- return fn(val);
5043
- };
5044
-
5045
- var utils$2 = {
5046
- arrayToObject: arrayToObject,
5047
- assign: assign,
5048
- combine: combine,
5049
- compact: compact,
5050
- decode: decode,
5051
- encode: encode,
5052
- isBuffer: isBuffer,
5053
- isRegExp: isRegExp,
5054
- maybeMap: maybeMap,
5055
- merge: merge
5056
- };
5057
-
5058
- var getSideChannel = sideChannel;
5059
- var utils$1 = utils$2;
5060
- var formats$1 = formats$3;
5061
- var has$1 = Object.prototype.hasOwnProperty;
5062
-
5063
- var arrayPrefixGenerators = {
5064
- brackets: function brackets(prefix) {
5065
- return prefix + '[]';
5066
- },
5067
- comma: 'comma',
5068
- indices: function indices(prefix, key) {
5069
- return prefix + '[' + key + ']';
5070
- },
5071
- repeat: function repeat(prefix) {
5072
- return prefix;
5073
- }
5074
- };
5075
-
5076
- var isArray$1 = Array.isArray;
5077
- var split = String.prototype.split;
5078
- var push = Array.prototype.push;
5079
- var pushToArray = function (arr, valueOrArray) {
5080
- push.apply(arr, isArray$1(valueOrArray) ? valueOrArray : [valueOrArray]);
5081
- };
5082
-
5083
- var toISO = Date.prototype.toISOString;
5084
-
5085
- var defaultFormat = formats$1['default'];
5086
- var defaults$1 = {
5087
- addQueryPrefix: false,
5088
- allowDots: false,
5089
- charset: 'utf-8',
5090
- charsetSentinel: false,
5091
- delimiter: '&',
5092
- encode: true,
5093
- encoder: utils$1.encode,
5094
- encodeValuesOnly: false,
5095
- format: defaultFormat,
5096
- formatter: formats$1.formatters[defaultFormat],
5097
- // deprecated
5098
- indices: false,
5099
- serializeDate: function serializeDate(date) {
5100
- return toISO.call(date);
5101
- },
5102
- skipNulls: false,
5103
- strictNullHandling: false
5104
- };
5105
-
5106
- var isNonNullishPrimitive = function isNonNullishPrimitive(v) {
5107
- return typeof v === 'string'
5108
- || typeof v === 'number'
5109
- || typeof v === 'boolean'
5110
- || typeof v === 'symbol'
5111
- || typeof v === 'bigint';
5112
- };
5113
-
5114
- var sentinel = {};
5115
-
5116
- var stringify$1 = function stringify(
5117
- object,
5118
- prefix,
5119
- generateArrayPrefix,
5120
- commaRoundTrip,
5121
- strictNullHandling,
5122
- skipNulls,
5123
- encoder,
5124
- filter,
5125
- sort,
5126
- allowDots,
5127
- serializeDate,
5128
- format,
5129
- formatter,
5130
- encodeValuesOnly,
5131
- charset,
5132
- sideChannel
5133
- ) {
5134
- var obj = object;
5135
-
5136
- var tmpSc = sideChannel;
5137
- var step = 0;
5138
- var findFlag = false;
5139
- while ((tmpSc = tmpSc.get(sentinel)) !== void undefined && !findFlag) {
5140
- // Where object last appeared in the ref tree
5141
- var pos = tmpSc.get(object);
5142
- step += 1;
5143
- if (typeof pos !== 'undefined') {
5144
- if (pos === step) {
5145
- throw new RangeError('Cyclic object value');
5146
- } else {
5147
- findFlag = true; // Break while
5148
- }
5149
- }
5150
- if (typeof tmpSc.get(sentinel) === 'undefined') {
5151
- step = 0;
5152
- }
5153
- }
5154
-
5155
- if (typeof filter === 'function') {
5156
- obj = filter(prefix, obj);
5157
- } else if (obj instanceof Date) {
5158
- obj = serializeDate(obj);
5159
- } else if (generateArrayPrefix === 'comma' && isArray$1(obj)) {
5160
- obj = utils$1.maybeMap(obj, function (value) {
5161
- if (value instanceof Date) {
5162
- return serializeDate(value);
5163
- }
5164
- return value;
5165
- });
5166
- }
5167
-
5168
- if (obj === null) {
5169
- if (strictNullHandling) {
5170
- return encoder && !encodeValuesOnly ? encoder(prefix, defaults$1.encoder, charset, 'key', format) : prefix;
5171
- }
5172
-
5173
- obj = '';
5174
- }
5175
-
5176
- if (isNonNullishPrimitive(obj) || utils$1.isBuffer(obj)) {
5177
- if (encoder) {
5178
- var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults$1.encoder, charset, 'key', format);
5179
- if (generateArrayPrefix === 'comma' && encodeValuesOnly) {
5180
- var valuesArray = split.call(String(obj), ',');
5181
- var valuesJoined = '';
5182
- for (var i = 0; i < valuesArray.length; ++i) {
5183
- valuesJoined += (i === 0 ? '' : ',') + formatter(encoder(valuesArray[i], defaults$1.encoder, charset, 'value', format));
5184
- }
5185
- return [formatter(keyValue) + (commaRoundTrip && isArray$1(obj) && valuesArray.length === 1 ? '[]' : '') + '=' + valuesJoined];
5186
- }
5187
- return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults$1.encoder, charset, 'value', format))];
5188
- }
5189
- return [formatter(prefix) + '=' + formatter(String(obj))];
5190
- }
5191
-
5192
- var values = [];
5193
-
5194
- if (typeof obj === 'undefined') {
5195
- return values;
5196
- }
5197
-
5198
- var objKeys;
5199
- if (generateArrayPrefix === 'comma' && isArray$1(obj)) {
5200
- // we need to join elements in
5201
- objKeys = [{ value: obj.length > 0 ? obj.join(',') || null : void undefined }];
5202
- } else if (isArray$1(filter)) {
5203
- objKeys = filter;
5204
- } else {
5205
- var keys = Object.keys(obj);
5206
- objKeys = sort ? keys.sort(sort) : keys;
5207
- }
5208
-
5209
- var adjustedPrefix = commaRoundTrip && isArray$1(obj) && obj.length === 1 ? prefix + '[]' : prefix;
5210
-
5211
- for (var j = 0; j < objKeys.length; ++j) {
5212
- var key = objKeys[j];
5213
- var value = typeof key === 'object' && typeof key.value !== 'undefined' ? key.value : obj[key];
5214
-
5215
- if (skipNulls && value === null) {
5216
- continue;
5217
- }
5218
-
5219
- var keyPrefix = isArray$1(obj)
5220
- ? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(adjustedPrefix, key) : adjustedPrefix
5221
- : adjustedPrefix + (allowDots ? '.' + key : '[' + key + ']');
5222
-
5223
- sideChannel.set(object, step);
5224
- var valueSideChannel = getSideChannel();
5225
- valueSideChannel.set(sentinel, sideChannel);
5226
- pushToArray(values, stringify(
5227
- value,
5228
- keyPrefix,
5229
- generateArrayPrefix,
5230
- commaRoundTrip,
5231
- strictNullHandling,
5232
- skipNulls,
5233
- encoder,
5234
- filter,
5235
- sort,
5236
- allowDots,
5237
- serializeDate,
5238
- format,
5239
- formatter,
5240
- encodeValuesOnly,
5241
- charset,
5242
- valueSideChannel
5243
- ));
5244
- }
5245
-
5246
- return values;
5247
- };
5248
-
5249
- var normalizeStringifyOptions = function normalizeStringifyOptions(opts) {
5250
- if (!opts) {
5251
- return defaults$1;
5252
- }
5253
-
5254
- if (opts.encoder !== null && typeof opts.encoder !== 'undefined' && typeof opts.encoder !== 'function') {
5255
- throw new TypeError('Encoder has to be a function.');
5256
- }
5257
-
5258
- var charset = opts.charset || defaults$1.charset;
5259
- if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {
5260
- throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');
5261
- }
5262
-
5263
- var format = formats$1['default'];
5264
- if (typeof opts.format !== 'undefined') {
5265
- if (!has$1.call(formats$1.formatters, opts.format)) {
5266
- throw new TypeError('Unknown format option provided.');
5267
- }
5268
- format = opts.format;
5269
- }
5270
- var formatter = formats$1.formatters[format];
5271
-
5272
- var filter = defaults$1.filter;
5273
- if (typeof opts.filter === 'function' || isArray$1(opts.filter)) {
5274
- filter = opts.filter;
5275
- }
5276
-
5277
- return {
5278
- addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults$1.addQueryPrefix,
5279
- allowDots: typeof opts.allowDots === 'undefined' ? defaults$1.allowDots : !!opts.allowDots,
5280
- charset: charset,
5281
- charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults$1.charsetSentinel,
5282
- delimiter: typeof opts.delimiter === 'undefined' ? defaults$1.delimiter : opts.delimiter,
5283
- encode: typeof opts.encode === 'boolean' ? opts.encode : defaults$1.encode,
5284
- encoder: typeof opts.encoder === 'function' ? opts.encoder : defaults$1.encoder,
5285
- encodeValuesOnly: typeof opts.encodeValuesOnly === 'boolean' ? opts.encodeValuesOnly : defaults$1.encodeValuesOnly,
5286
- filter: filter,
5287
- format: format,
5288
- formatter: formatter,
5289
- serializeDate: typeof opts.serializeDate === 'function' ? opts.serializeDate : defaults$1.serializeDate,
5290
- skipNulls: typeof opts.skipNulls === 'boolean' ? opts.skipNulls : defaults$1.skipNulls,
5291
- sort: typeof opts.sort === 'function' ? opts.sort : null,
5292
- strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults$1.strictNullHandling
5293
- };
5294
- };
5295
-
5296
- var stringify_1 = function (object, opts) {
5297
- var obj = object;
5298
- var options = normalizeStringifyOptions(opts);
5299
-
5300
- var objKeys;
5301
- var filter;
5302
-
5303
- if (typeof options.filter === 'function') {
5304
- filter = options.filter;
5305
- obj = filter('', obj);
5306
- } else if (isArray$1(options.filter)) {
5307
- filter = options.filter;
5308
- objKeys = filter;
5309
- }
5310
-
5311
- var keys = [];
5312
-
5313
- if (typeof obj !== 'object' || obj === null) {
5314
- return '';
5315
- }
5316
-
5317
- var arrayFormat;
5318
- if (opts && opts.arrayFormat in arrayPrefixGenerators) {
5319
- arrayFormat = opts.arrayFormat;
5320
- } else if (opts && 'indices' in opts) {
5321
- arrayFormat = opts.indices ? 'indices' : 'repeat';
5322
- } else {
5323
- arrayFormat = 'indices';
5324
- }
5325
-
5326
- var generateArrayPrefix = arrayPrefixGenerators[arrayFormat];
5327
- if (opts && 'commaRoundTrip' in opts && typeof opts.commaRoundTrip !== 'boolean') {
5328
- throw new TypeError('`commaRoundTrip` must be a boolean, or absent');
5329
- }
5330
- var commaRoundTrip = generateArrayPrefix === 'comma' && opts && opts.commaRoundTrip;
5331
-
5332
- if (!objKeys) {
5333
- objKeys = Object.keys(obj);
5334
- }
5335
-
5336
- if (options.sort) {
5337
- objKeys.sort(options.sort);
5338
- }
5339
-
5340
- var sideChannel = getSideChannel();
5341
- for (var i = 0; i < objKeys.length; ++i) {
5342
- var key = objKeys[i];
5343
-
5344
- if (options.skipNulls && obj[key] === null) {
5345
- continue;
5346
- }
5347
- pushToArray(keys, stringify$1(
5348
- obj[key],
5349
- key,
5350
- generateArrayPrefix,
5351
- commaRoundTrip,
5352
- options.strictNullHandling,
5353
- options.skipNulls,
5354
- options.encode ? options.encoder : null,
5355
- options.filter,
5356
- options.sort,
5357
- options.allowDots,
5358
- options.serializeDate,
5359
- options.format,
5360
- options.formatter,
5361
- options.encodeValuesOnly,
5362
- options.charset,
5363
- sideChannel
5364
- ));
5365
- }
5366
-
5367
- var joined = keys.join(options.delimiter);
5368
- var prefix = options.addQueryPrefix === true ? '?' : '';
5369
-
5370
- if (options.charsetSentinel) {
5371
- if (options.charset === 'iso-8859-1') {
5372
- // encodeURIComponent('&#10003;'), the "numeric entity" representation of a checkmark
5373
- prefix += 'utf8=%26%2310003%3B&';
5374
- } else {
5375
- // encodeURIComponent('✓')
5376
- prefix += 'utf8=%E2%9C%93&';
5377
- }
5378
- }
5379
-
5380
- return joined.length > 0 ? prefix + joined : '';
5381
- };
5382
-
5383
- var utils = utils$2;
5384
-
5385
- var has = Object.prototype.hasOwnProperty;
5386
- var isArray = Array.isArray;
5387
-
5388
- var defaults = {
5389
- allowDots: false,
5390
- allowPrototypes: false,
5391
- allowSparse: false,
5392
- arrayLimit: 20,
5393
- charset: 'utf-8',
5394
- charsetSentinel: false,
5395
- comma: false,
5396
- decoder: utils.decode,
5397
- delimiter: '&',
5398
- depth: 5,
5399
- ignoreQueryPrefix: false,
5400
- interpretNumericEntities: false,
5401
- parameterLimit: 1000,
5402
- parseArrays: true,
5403
- plainObjects: false,
5404
- strictNullHandling: false
5405
- };
5406
-
5407
- var interpretNumericEntities = function (str) {
5408
- return str.replace(/&#(\d+);/g, function ($0, numberStr) {
5409
- return String.fromCharCode(parseInt(numberStr, 10));
5410
- });
5411
- };
5412
-
5413
- var parseArrayValue = function (val, options) {
5414
- if (val && typeof val === 'string' && options.comma && val.indexOf(',') > -1) {
5415
- return val.split(',');
5416
- }
5417
-
5418
- return val;
5419
- };
5420
-
5421
- // This is what browsers will submit when the ✓ character occurs in an
5422
- // application/x-www-form-urlencoded body and the encoding of the page containing
5423
- // the form is iso-8859-1, or when the submitted form has an accept-charset
5424
- // attribute of iso-8859-1. Presumably also with other charsets that do not contain
5425
- // the ✓ character, such as us-ascii.
5426
- var isoSentinel = 'utf8=%26%2310003%3B'; // encodeURIComponent('&#10003;')
5427
-
5428
- // These are the percent-encoded utf-8 octets representing a checkmark, indicating that the request actually is utf-8 encoded.
5429
- var charsetSentinel = 'utf8=%E2%9C%93'; // encodeURIComponent('✓')
5430
-
5431
- var parseValues = function parseQueryStringValues(str, options) {
5432
- var obj = {};
5433
- var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str;
5434
- var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit;
5435
- var parts = cleanStr.split(options.delimiter, limit);
5436
- var skipIndex = -1; // Keep track of where the utf8 sentinel was found
5437
- var i;
5438
-
5439
- var charset = options.charset;
5440
- if (options.charsetSentinel) {
5441
- for (i = 0; i < parts.length; ++i) {
5442
- if (parts[i].indexOf('utf8=') === 0) {
5443
- if (parts[i] === charsetSentinel) {
5444
- charset = 'utf-8';
5445
- } else if (parts[i] === isoSentinel) {
5446
- charset = 'iso-8859-1';
5447
- }
5448
- skipIndex = i;
5449
- i = parts.length; // The eslint settings do not allow break;
5450
- }
5451
- }
5452
- }
5453
-
5454
- for (i = 0; i < parts.length; ++i) {
5455
- if (i === skipIndex) {
5456
- continue;
5457
- }
5458
- var part = parts[i];
5459
-
5460
- var bracketEqualsPos = part.indexOf(']=');
5461
- var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1;
5462
-
5463
- var key, val;
5464
- if (pos === -1) {
5465
- key = options.decoder(part, defaults.decoder, charset, 'key');
5466
- val = options.strictNullHandling ? null : '';
5467
- } else {
5468
- key = options.decoder(part.slice(0, pos), defaults.decoder, charset, 'key');
5469
- val = utils.maybeMap(
5470
- parseArrayValue(part.slice(pos + 1), options),
5471
- function (encodedVal) {
5472
- return options.decoder(encodedVal, defaults.decoder, charset, 'value');
5473
- }
5474
- );
5475
- }
5476
-
5477
- if (val && options.interpretNumericEntities && charset === 'iso-8859-1') {
5478
- val = interpretNumericEntities(val);
5479
- }
5480
-
5481
- if (part.indexOf('[]=') > -1) {
5482
- val = isArray(val) ? [val] : val;
5483
- }
5484
-
5485
- if (has.call(obj, key)) {
5486
- obj[key] = utils.combine(obj[key], val);
5487
- } else {
5488
- obj[key] = val;
5489
- }
5490
- }
5491
-
5492
- return obj;
5493
- };
5494
-
5495
- var parseObject = function (chain, val, options, valuesParsed) {
5496
- var leaf = valuesParsed ? val : parseArrayValue(val, options);
5497
-
5498
- for (var i = chain.length - 1; i >= 0; --i) {
5499
- var obj;
5500
- var root = chain[i];
5501
-
5502
- if (root === '[]' && options.parseArrays) {
5503
- obj = [].concat(leaf);
5504
- } else {
5505
- obj = options.plainObjects ? Object.create(null) : {};
5506
- var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;
5507
- var index = parseInt(cleanRoot, 10);
5508
- if (!options.parseArrays && cleanRoot === '') {
5509
- obj = { 0: leaf };
5510
- } else if (
5511
- !isNaN(index)
5512
- && root !== cleanRoot
5513
- && String(index) === cleanRoot
5514
- && index >= 0
5515
- && (options.parseArrays && index <= options.arrayLimit)
5516
- ) {
5517
- obj = [];
5518
- obj[index] = leaf;
5519
- } else if (cleanRoot !== '__proto__') {
5520
- obj[cleanRoot] = leaf;
5521
- }
5522
- }
5523
-
5524
- leaf = obj;
5525
- }
5526
-
5527
- return leaf;
5528
- };
5529
-
5530
- var parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesParsed) {
5531
- if (!givenKey) {
5532
- return;
5533
- }
5534
-
5535
- // Transform dot notation to bracket notation
5536
- var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, '[$1]') : givenKey;
5537
-
5538
- // The regex chunks
5539
-
5540
- var brackets = /(\[[^[\]]*])/;
5541
- var child = /(\[[^[\]]*])/g;
5542
-
5543
- // Get the parent
5544
-
5545
- var segment = options.depth > 0 && brackets.exec(key);
5546
- var parent = segment ? key.slice(0, segment.index) : key;
5547
-
5548
- // Stash the parent if it exists
5549
-
5550
- var keys = [];
5551
- if (parent) {
5552
- // If we aren't using plain objects, optionally prefix keys that would overwrite object prototype properties
5553
- if (!options.plainObjects && has.call(Object.prototype, parent)) {
5554
- if (!options.allowPrototypes) {
5555
- return;
5556
- }
5557
- }
5558
-
5559
- keys.push(parent);
5560
- }
5561
-
5562
- // Loop through children appending to the array until we hit depth
5563
-
5564
- var i = 0;
5565
- while (options.depth > 0 && (segment = child.exec(key)) !== null && i < options.depth) {
5566
- i += 1;
5567
- if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) {
5568
- if (!options.allowPrototypes) {
5569
- return;
5570
- }
5571
- }
5572
- keys.push(segment[1]);
5573
- }
5574
-
5575
- // If there's a remainder, just add whatever is left
5576
-
5577
- if (segment) {
5578
- keys.push('[' + key.slice(segment.index) + ']');
5579
- }
5580
-
5581
- return parseObject(keys, val, options, valuesParsed);
5582
- };
5583
-
5584
- var normalizeParseOptions = function normalizeParseOptions(opts) {
5585
- if (!opts) {
5586
- return defaults;
5587
- }
5588
-
5589
- if (opts.decoder !== null && opts.decoder !== undefined && typeof opts.decoder !== 'function') {
5590
- throw new TypeError('Decoder has to be a function.');
5591
- }
5592
-
5593
- if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {
5594
- throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');
5595
- }
5596
- var charset = typeof opts.charset === 'undefined' ? defaults.charset : opts.charset;
5597
-
5598
- return {
5599
- allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots,
5600
- allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults.allowPrototypes,
5601
- allowSparse: typeof opts.allowSparse === 'boolean' ? opts.allowSparse : defaults.allowSparse,
5602
- arrayLimit: typeof opts.arrayLimit === 'number' ? opts.arrayLimit : defaults.arrayLimit,
5603
- charset: charset,
5604
- charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,
5605
- comma: typeof opts.comma === 'boolean' ? opts.comma : defaults.comma,
5606
- decoder: typeof opts.decoder === 'function' ? opts.decoder : defaults.decoder,
5607
- delimiter: typeof opts.delimiter === 'string' || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter,
5608
- // eslint-disable-next-line no-implicit-coercion, no-extra-parens
5609
- depth: (typeof opts.depth === 'number' || opts.depth === false) ? +opts.depth : defaults.depth,
5610
- ignoreQueryPrefix: opts.ignoreQueryPrefix === true,
5611
- interpretNumericEntities: typeof opts.interpretNumericEntities === 'boolean' ? opts.interpretNumericEntities : defaults.interpretNumericEntities,
5612
- parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults.parameterLimit,
5613
- parseArrays: opts.parseArrays !== false,
5614
- plainObjects: typeof opts.plainObjects === 'boolean' ? opts.plainObjects : defaults.plainObjects,
5615
- strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling
5616
- };
5617
- };
5618
-
5619
- var parse$2 = function (str, opts) {
5620
- var options = normalizeParseOptions(opts);
5621
-
5622
- if (str === '' || str === null || typeof str === 'undefined') {
5623
- return options.plainObjects ? Object.create(null) : {};
5624
- }
5625
-
5626
- var tempObj = typeof str === 'string' ? parseValues(str, options) : str;
5627
- var obj = options.plainObjects ? Object.create(null) : {};
5628
-
5629
- // Iterate over the keys and setup the new object
5630
-
5631
- var keys = Object.keys(tempObj);
5632
- for (var i = 0; i < keys.length; ++i) {
5633
- var key = keys[i];
5634
- var newObj = parseKeys(key, tempObj[key], options, typeof str === 'string');
5635
- obj = utils.merge(obj, newObj, options);
5636
- }
5637
-
5638
- if (options.allowSparse === true) {
5639
- return obj;
5640
- }
5641
-
5642
- return utils.compact(obj);
5643
- };
5644
-
5645
- var stringify = stringify_1;
5646
- var parse$1 = parse$2;
5647
- var formats = formats$3;
5648
-
5649
- var lib = {
5650
- formats: formats,
5651
- parse: parse$1,
5652
- stringify: stringify
5653
- };
5654
-
5655
3623
  function ownKeys(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; }
5656
3624
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
5657
3625
  var useQueryParams = function useQueryParams() {
5658
3626
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
5659
3627
  var location = useLocation();
5660
- return lib.parse(location.search, _objectSpread({
3628
+ return parse$1(location.search, _objectSpread({
5661
3629
  ignoreQueryPrefix: true
5662
3630
  }, options));
5663
3631
  };