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