@thecb/components 8.4.7-beta.6 → 8.4.8-beta.0
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/dist/index.cjs.js +1472 -560
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +2 -28
- package/dist/index.esm.js +1472 -560
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/atoms/index.d.ts +0 -1
- package/src/components/molecules/radio-group/index.d.ts +1 -1
- package/src/components/molecules/radio-section/RadioSection.js +123 -113
- package/src/constants/colors.js +2 -0
- package/src/types/common/index.ts +0 -1
- package/src/components/atoms/searchable-select/index.d.ts +0 -28
- package/src/types/common/SearchableSelectOption.ts +0 -4
package/dist/index.esm.js
CHANGED
|
@@ -195,6 +195,63 @@ function _nonIterableRest() {
|
|
|
195
195
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
196
196
|
}
|
|
197
197
|
|
|
198
|
+
function _createForOfIteratorHelper(o, allowArrayLike) {
|
|
199
|
+
var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
|
|
200
|
+
|
|
201
|
+
if (!it) {
|
|
202
|
+
if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
|
|
203
|
+
if (it) o = it;
|
|
204
|
+
var i = 0;
|
|
205
|
+
|
|
206
|
+
var F = function () {};
|
|
207
|
+
|
|
208
|
+
return {
|
|
209
|
+
s: F,
|
|
210
|
+
n: function () {
|
|
211
|
+
if (i >= o.length) return {
|
|
212
|
+
done: true
|
|
213
|
+
};
|
|
214
|
+
return {
|
|
215
|
+
done: false,
|
|
216
|
+
value: o[i++]
|
|
217
|
+
};
|
|
218
|
+
},
|
|
219
|
+
e: function (e) {
|
|
220
|
+
throw e;
|
|
221
|
+
},
|
|
222
|
+
f: F
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
var normalCompletion = true,
|
|
230
|
+
didErr = false,
|
|
231
|
+
err;
|
|
232
|
+
return {
|
|
233
|
+
s: function () {
|
|
234
|
+
it = it.call(o);
|
|
235
|
+
},
|
|
236
|
+
n: function () {
|
|
237
|
+
var step = it.next();
|
|
238
|
+
normalCompletion = step.done;
|
|
239
|
+
return step;
|
|
240
|
+
},
|
|
241
|
+
e: function (e) {
|
|
242
|
+
didErr = true;
|
|
243
|
+
err = e;
|
|
244
|
+
},
|
|
245
|
+
f: function () {
|
|
246
|
+
try {
|
|
247
|
+
if (!normalCompletion && it.return != null) it.return();
|
|
248
|
+
} finally {
|
|
249
|
+
if (didErr) throw err;
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
};
|
|
253
|
+
}
|
|
254
|
+
|
|
198
255
|
/*! *****************************************************************************
|
|
199
256
|
Copyright (c) Microsoft Corporation.
|
|
200
257
|
|
|
@@ -4989,6 +5046,8 @@ var BLACK_SQUEEZE = "#EAF2F7";
|
|
|
4989
5046
|
var GREY_CHATEAU = "#959CA8"; // CBS-500
|
|
4990
5047
|
|
|
4991
5048
|
var COOL_GREY_05 = "#fbfcfd"; // CBS-050
|
|
5049
|
+
|
|
5050
|
+
var MANATEE_GREY = "#878E9B"; // CB-60 (cool)
|
|
4992
5051
|
// BLUE
|
|
4993
5052
|
|
|
4994
5053
|
var CLOUDBURST_BLUE = "#26395c";
|
|
@@ -5123,6 +5182,7 @@ var colors = /*#__PURE__*/Object.freeze({
|
|
|
5123
5182
|
CHARADE_GREY: CHARADE_GREY,
|
|
5124
5183
|
GRECIAN_GREY: GRECIAN_GREY,
|
|
5125
5184
|
COOL_GREY_05: COOL_GREY_05,
|
|
5185
|
+
MANATEE_GREY: MANATEE_GREY,
|
|
5126
5186
|
BLACK_SQUEEZE: BLACK_SQUEEZE,
|
|
5127
5187
|
GREY_CHATEAU: GREY_CHATEAU,
|
|
5128
5188
|
CLOUDBURST_BLUE: CLOUDBURST_BLUE,
|
|
@@ -22394,7 +22454,7 @@ var check = function (it) {
|
|
|
22394
22454
|
|
|
22395
22455
|
// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
|
|
22396
22456
|
var global_1 =
|
|
22397
|
-
// eslint-disable-next-line es
|
|
22457
|
+
// eslint-disable-next-line es/no-global-this -- safe
|
|
22398
22458
|
check(typeof globalThis == 'object' && globalThis) ||
|
|
22399
22459
|
check(typeof window == 'object' && window) ||
|
|
22400
22460
|
// eslint-disable-next-line no-restricted-globals -- safe
|
|
@@ -22413,12 +22473,12 @@ var fails = function (exec) {
|
|
|
22413
22473
|
|
|
22414
22474
|
// Detect IE8's incomplete defineProperty implementation
|
|
22415
22475
|
var descriptors = !fails(function () {
|
|
22416
|
-
// eslint-disable-next-line es
|
|
22476
|
+
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
22417
22477
|
return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
|
|
22418
22478
|
});
|
|
22419
22479
|
|
|
22420
22480
|
var functionBindNative = !fails(function () {
|
|
22421
|
-
// eslint-disable-next-line es
|
|
22481
|
+
// eslint-disable-next-line es/no-function-prototype-bind -- safe
|
|
22422
22482
|
var test = (function () { /* empty */ }).bind();
|
|
22423
22483
|
// eslint-disable-next-line no-prototype-builtins -- safe
|
|
22424
22484
|
return typeof test != 'function' || test.hasOwnProperty('prototype');
|
|
@@ -22431,7 +22491,7 @@ var functionCall = functionBindNative ? call.bind(call) : function () {
|
|
|
22431
22491
|
};
|
|
22432
22492
|
|
|
22433
22493
|
var $propertyIsEnumerable = {}.propertyIsEnumerable;
|
|
22434
|
-
// eslint-disable-next-line es
|
|
22494
|
+
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
22435
22495
|
var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
|
22436
22496
|
|
|
22437
22497
|
// Nashorn ~ JDK8 bug
|
|
@@ -22458,25 +22518,29 @@ var createPropertyDescriptor = function (bitmap, value) {
|
|
|
22458
22518
|
};
|
|
22459
22519
|
|
|
22460
22520
|
var FunctionPrototype = Function.prototype;
|
|
22461
|
-
var bind$1 = FunctionPrototype.bind;
|
|
22462
22521
|
var call$1 = FunctionPrototype.call;
|
|
22463
|
-
var
|
|
22522
|
+
var uncurryThisWithBind = functionBindNative && FunctionPrototype.bind.bind(call$1, call$1);
|
|
22464
22523
|
|
|
22465
|
-
var
|
|
22466
|
-
return
|
|
22467
|
-
} : function (fn) {
|
|
22468
|
-
return fn && function () {
|
|
22524
|
+
var functionUncurryThisRaw = function (fn) {
|
|
22525
|
+
return functionBindNative ? uncurryThisWithBind(fn) : function () {
|
|
22469
22526
|
return call$1.apply(fn, arguments);
|
|
22470
22527
|
};
|
|
22471
22528
|
};
|
|
22472
22529
|
|
|
22473
|
-
var toString$2 =
|
|
22474
|
-
var stringSlice =
|
|
22530
|
+
var toString$2 = functionUncurryThisRaw({}.toString);
|
|
22531
|
+
var stringSlice = functionUncurryThisRaw(''.slice);
|
|
22475
22532
|
|
|
22476
22533
|
var classofRaw = function (it) {
|
|
22477
22534
|
return stringSlice(toString$2(it), 8, -1);
|
|
22478
22535
|
};
|
|
22479
22536
|
|
|
22537
|
+
var functionUncurryThis = function (fn) {
|
|
22538
|
+
// Nashorn bug:
|
|
22539
|
+
// https://github.com/zloirock/core-js/issues/1128
|
|
22540
|
+
// https://github.com/zloirock/core-js/issues/1130
|
|
22541
|
+
if (classofRaw(fn) === 'Function') return functionUncurryThisRaw(fn);
|
|
22542
|
+
};
|
|
22543
|
+
|
|
22480
22544
|
var $Object = Object;
|
|
22481
22545
|
var split = functionUncurryThis(''.split);
|
|
22482
22546
|
|
|
@@ -22489,12 +22553,18 @@ var indexedObject = fails(function () {
|
|
|
22489
22553
|
return classofRaw(it) == 'String' ? split(it, '') : $Object(it);
|
|
22490
22554
|
} : $Object;
|
|
22491
22555
|
|
|
22556
|
+
// we can't use just `it == null` since of `document.all` special case
|
|
22557
|
+
// https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot-aec
|
|
22558
|
+
var isNullOrUndefined = function (it) {
|
|
22559
|
+
return it === null || it === undefined;
|
|
22560
|
+
};
|
|
22561
|
+
|
|
22492
22562
|
var $TypeError = TypeError;
|
|
22493
22563
|
|
|
22494
22564
|
// `RequireObjectCoercible` abstract operation
|
|
22495
22565
|
// https://tc39.es/ecma262/#sec-requireobjectcoercible
|
|
22496
22566
|
var requireObjectCoercible = function (it) {
|
|
22497
|
-
if (it
|
|
22567
|
+
if (isNullOrUndefined(it)) throw $TypeError("Can't call method on " + it);
|
|
22498
22568
|
return it;
|
|
22499
22569
|
};
|
|
22500
22570
|
|
|
@@ -22506,13 +22576,31 @@ var toIndexedObject = function (it) {
|
|
|
22506
22576
|
return indexedObject(requireObjectCoercible(it));
|
|
22507
22577
|
};
|
|
22508
22578
|
|
|
22579
|
+
var documentAll = typeof document == 'object' && document.all;
|
|
22580
|
+
|
|
22581
|
+
// https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot
|
|
22582
|
+
var IS_HTMLDDA = typeof documentAll == 'undefined' && documentAll !== undefined;
|
|
22583
|
+
|
|
22584
|
+
var documentAll_1 = {
|
|
22585
|
+
all: documentAll,
|
|
22586
|
+
IS_HTMLDDA: IS_HTMLDDA
|
|
22587
|
+
};
|
|
22588
|
+
|
|
22589
|
+
var documentAll$1 = documentAll_1.all;
|
|
22590
|
+
|
|
22509
22591
|
// `IsCallable` abstract operation
|
|
22510
22592
|
// https://tc39.es/ecma262/#sec-iscallable
|
|
22511
|
-
var isCallable = function (argument) {
|
|
22593
|
+
var isCallable = documentAll_1.IS_HTMLDDA ? function (argument) {
|
|
22594
|
+
return typeof argument == 'function' || argument === documentAll$1;
|
|
22595
|
+
} : function (argument) {
|
|
22512
22596
|
return typeof argument == 'function';
|
|
22513
22597
|
};
|
|
22514
22598
|
|
|
22515
|
-
var
|
|
22599
|
+
var documentAll$2 = documentAll_1.all;
|
|
22600
|
+
|
|
22601
|
+
var isObject = documentAll_1.IS_HTMLDDA ? function (it) {
|
|
22602
|
+
return typeof it == 'object' ? it !== null : isCallable(it) || it === documentAll$2;
|
|
22603
|
+
} : function (it) {
|
|
22516
22604
|
return typeof it == 'object' ? it !== null : isCallable(it);
|
|
22517
22605
|
};
|
|
22518
22606
|
|
|
@@ -22553,12 +22641,12 @@ if (!version && engineUserAgent) {
|
|
|
22553
22641
|
|
|
22554
22642
|
var engineV8Version = version;
|
|
22555
22643
|
|
|
22556
|
-
/* eslint-disable es
|
|
22644
|
+
/* eslint-disable es/no-symbol -- required for testing */
|
|
22557
22645
|
|
|
22558
22646
|
|
|
22559
22647
|
|
|
22560
|
-
// eslint-disable-next-line es
|
|
22561
|
-
var
|
|
22648
|
+
// eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
|
|
22649
|
+
var symbolConstructorDetection = !!Object.getOwnPropertySymbols && !fails(function () {
|
|
22562
22650
|
var symbol = Symbol();
|
|
22563
22651
|
// Chrome 38 Symbol has incorrect toString conversion
|
|
22564
22652
|
// `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
|
|
@@ -22567,10 +22655,10 @@ var nativeSymbol = !!Object.getOwnPropertySymbols && !fails(function () {
|
|
|
22567
22655
|
!Symbol.sham && engineV8Version && engineV8Version < 41;
|
|
22568
22656
|
});
|
|
22569
22657
|
|
|
22570
|
-
/* eslint-disable es
|
|
22658
|
+
/* eslint-disable es/no-symbol -- required for testing */
|
|
22571
22659
|
|
|
22572
22660
|
|
|
22573
|
-
var useSymbolAsUid =
|
|
22661
|
+
var useSymbolAsUid = symbolConstructorDetection
|
|
22574
22662
|
&& !Symbol.sham
|
|
22575
22663
|
&& typeof Symbol.iterator == 'symbol';
|
|
22576
22664
|
|
|
@@ -22605,7 +22693,7 @@ var aCallable = function (argument) {
|
|
|
22605
22693
|
// https://tc39.es/ecma262/#sec-getmethod
|
|
22606
22694
|
var getMethod = function (V, P) {
|
|
22607
22695
|
var func = V[P];
|
|
22608
|
-
return func
|
|
22696
|
+
return isNullOrUndefined(func) ? undefined : aCallable(func);
|
|
22609
22697
|
};
|
|
22610
22698
|
|
|
22611
22699
|
var $TypeError$2 = TypeError;
|
|
@@ -22620,7 +22708,7 @@ var ordinaryToPrimitive = function (input, pref) {
|
|
|
22620
22708
|
throw $TypeError$2("Can't convert object to primitive value");
|
|
22621
22709
|
};
|
|
22622
22710
|
|
|
22623
|
-
// eslint-disable-next-line es
|
|
22711
|
+
// eslint-disable-next-line es/no-object-defineproperty -- safe
|
|
22624
22712
|
var defineProperty = Object.defineProperty;
|
|
22625
22713
|
|
|
22626
22714
|
var defineGlobalProperty = function (key, value) {
|
|
@@ -22640,10 +22728,10 @@ var shared = createCommonjsModule(function (module) {
|
|
|
22640
22728
|
(module.exports = function (key, value) {
|
|
22641
22729
|
return sharedStore[key] || (sharedStore[key] = value !== undefined ? value : {});
|
|
22642
22730
|
})('versions', []).push({
|
|
22643
|
-
version: '3.
|
|
22731
|
+
version: '3.25.5',
|
|
22644
22732
|
mode: 'global',
|
|
22645
22733
|
copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
|
|
22646
|
-
license: 'https://github.com/zloirock/core-js/blob/v3.
|
|
22734
|
+
license: 'https://github.com/zloirock/core-js/blob/v3.25.5/LICENSE',
|
|
22647
22735
|
source: 'https://github.com/zloirock/core-js'
|
|
22648
22736
|
});
|
|
22649
22737
|
});
|
|
@@ -22660,7 +22748,7 @@ var hasOwnProperty = functionUncurryThis({}.hasOwnProperty);
|
|
|
22660
22748
|
|
|
22661
22749
|
// `HasOwnProperty` abstract operation
|
|
22662
22750
|
// https://tc39.es/ecma262/#sec-hasownproperty
|
|
22663
|
-
// eslint-disable-next-line es
|
|
22751
|
+
// eslint-disable-next-line es/no-object-hasown -- safe
|
|
22664
22752
|
var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
|
|
22665
22753
|
return hasOwnProperty(toObject(it), key);
|
|
22666
22754
|
};
|
|
@@ -22679,9 +22767,9 @@ var symbolFor = Symbol$1 && Symbol$1['for'];
|
|
|
22679
22767
|
var createWellKnownSymbol = useSymbolAsUid ? Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid;
|
|
22680
22768
|
|
|
22681
22769
|
var wellKnownSymbol = function (name) {
|
|
22682
|
-
if (!hasOwnProperty_1(WellKnownSymbolsStore, name) || !(
|
|
22770
|
+
if (!hasOwnProperty_1(WellKnownSymbolsStore, name) || !(symbolConstructorDetection || typeof WellKnownSymbolsStore[name] == 'string')) {
|
|
22683
22771
|
var description = 'Symbol.' + name;
|
|
22684
|
-
if (
|
|
22772
|
+
if (symbolConstructorDetection && hasOwnProperty_1(Symbol$1, name)) {
|
|
22685
22773
|
WellKnownSymbolsStore[name] = Symbol$1[name];
|
|
22686
22774
|
} else if (useSymbolAsUid && symbolFor) {
|
|
22687
22775
|
WellKnownSymbolsStore[name] = symbolFor(description);
|
|
@@ -22727,13 +22815,13 @@ var documentCreateElement = function (it) {
|
|
|
22727
22815
|
|
|
22728
22816
|
// Thanks to IE8 for its funny defineProperty
|
|
22729
22817
|
var ie8DomDefine = !descriptors && !fails(function () {
|
|
22730
|
-
// eslint-disable-next-line es
|
|
22818
|
+
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
22731
22819
|
return Object.defineProperty(documentCreateElement('div'), 'a', {
|
|
22732
22820
|
get: function () { return 7; }
|
|
22733
22821
|
}).a != 7;
|
|
22734
22822
|
});
|
|
22735
22823
|
|
|
22736
|
-
// eslint-disable-next-line es
|
|
22824
|
+
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
22737
22825
|
var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
|
22738
22826
|
|
|
22739
22827
|
// `Object.getOwnPropertyDescriptor` method
|
|
@@ -22754,7 +22842,7 @@ var objectGetOwnPropertyDescriptor = {
|
|
|
22754
22842
|
// V8 ~ Chrome 36-
|
|
22755
22843
|
// https://bugs.chromium.org/p/v8/issues/detail?id=3334
|
|
22756
22844
|
var v8PrototypeDefineBug = descriptors && fails(function () {
|
|
22757
|
-
// eslint-disable-next-line es
|
|
22845
|
+
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
22758
22846
|
return Object.defineProperty(function () { /* empty */ }, 'prototype', {
|
|
22759
22847
|
value: 42,
|
|
22760
22848
|
writable: false
|
|
@@ -22771,9 +22859,9 @@ var anObject = function (argument) {
|
|
|
22771
22859
|
};
|
|
22772
22860
|
|
|
22773
22861
|
var $TypeError$5 = TypeError;
|
|
22774
|
-
// eslint-disable-next-line es
|
|
22862
|
+
// eslint-disable-next-line es/no-object-defineproperty -- safe
|
|
22775
22863
|
var $defineProperty = Object.defineProperty;
|
|
22776
|
-
// eslint-disable-next-line es
|
|
22864
|
+
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
22777
22865
|
var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
|
|
22778
22866
|
var ENUMERABLE = 'enumerable';
|
|
22779
22867
|
var CONFIGURABLE = 'configurable';
|
|
@@ -22820,7 +22908,7 @@ var createNonEnumerableProperty = descriptors ? function (object, key, value) {
|
|
|
22820
22908
|
};
|
|
22821
22909
|
|
|
22822
22910
|
var FunctionPrototype$1 = Function.prototype;
|
|
22823
|
-
// eslint-disable-next-line es
|
|
22911
|
+
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
22824
22912
|
var getDescriptor = descriptors && Object.getOwnPropertyDescriptor;
|
|
22825
22913
|
|
|
22826
22914
|
var EXISTS$1 = hasOwnProperty_1(FunctionPrototype$1, 'name');
|
|
@@ -22847,7 +22935,7 @@ var inspectSource = sharedStore.inspectSource;
|
|
|
22847
22935
|
|
|
22848
22936
|
var WeakMap$1 = global_1.WeakMap;
|
|
22849
22937
|
|
|
22850
|
-
var
|
|
22938
|
+
var weakMapBasicDetection = isCallable(WeakMap$1) && /native code/.test(String(WeakMap$1));
|
|
22851
22939
|
|
|
22852
22940
|
var keys$1 = shared('keys');
|
|
22853
22941
|
|
|
@@ -22875,28 +22963,30 @@ var getterFor = function (TYPE) {
|
|
|
22875
22963
|
};
|
|
22876
22964
|
};
|
|
22877
22965
|
|
|
22878
|
-
if (
|
|
22966
|
+
if (weakMapBasicDetection || sharedStore.state) {
|
|
22879
22967
|
var store$1 = sharedStore.state || (sharedStore.state = new WeakMap$2());
|
|
22880
|
-
|
|
22881
|
-
|
|
22882
|
-
|
|
22968
|
+
/* eslint-disable no-self-assign -- prototype methods protection */
|
|
22969
|
+
store$1.get = store$1.get;
|
|
22970
|
+
store$1.has = store$1.has;
|
|
22971
|
+
store$1.set = store$1.set;
|
|
22972
|
+
/* eslint-enable no-self-assign -- prototype methods protection */
|
|
22883
22973
|
set = function (it, metadata) {
|
|
22884
|
-
if (
|
|
22974
|
+
if (store$1.has(it)) throw TypeError$1(OBJECT_ALREADY_INITIALIZED);
|
|
22885
22975
|
metadata.facade = it;
|
|
22886
|
-
|
|
22976
|
+
store$1.set(it, metadata);
|
|
22887
22977
|
return metadata;
|
|
22888
22978
|
};
|
|
22889
22979
|
get = function (it) {
|
|
22890
|
-
return
|
|
22980
|
+
return store$1.get(it) || {};
|
|
22891
22981
|
};
|
|
22892
22982
|
has = function (it) {
|
|
22893
|
-
return
|
|
22983
|
+
return store$1.has(it);
|
|
22894
22984
|
};
|
|
22895
22985
|
} else {
|
|
22896
22986
|
var STATE = sharedKey('state');
|
|
22897
22987
|
hiddenKeys[STATE] = true;
|
|
22898
22988
|
set = function (it, metadata) {
|
|
22899
|
-
if (hasOwnProperty_1(it, STATE)) throw
|
|
22989
|
+
if (hasOwnProperty_1(it, STATE)) throw TypeError$1(OBJECT_ALREADY_INITIALIZED);
|
|
22900
22990
|
metadata.facade = it;
|
|
22901
22991
|
createNonEnumerableProperty(it, STATE, metadata);
|
|
22902
22992
|
return metadata;
|
|
@@ -22924,7 +23014,7 @@ var CONFIGURABLE_FUNCTION_NAME = functionName.CONFIGURABLE;
|
|
|
22924
23014
|
|
|
22925
23015
|
var enforceInternalState = internalState.enforce;
|
|
22926
23016
|
var getInternalState = internalState.get;
|
|
22927
|
-
// eslint-disable-next-line es
|
|
23017
|
+
// eslint-disable-next-line es/no-object-defineproperty -- safe
|
|
22928
23018
|
var defineProperty = Object.defineProperty;
|
|
22929
23019
|
|
|
22930
23020
|
var CONFIGURABLE_LENGTH = descriptors && !fails(function () {
|
|
@@ -22993,7 +23083,7 @@ var floor = Math.floor;
|
|
|
22993
23083
|
|
|
22994
23084
|
// `Math.trunc` method
|
|
22995
23085
|
// https://tc39.es/ecma262/#sec-math.trunc
|
|
22996
|
-
// eslint-disable-next-line es
|
|
23086
|
+
// eslint-disable-next-line es/no-math-trunc -- safe
|
|
22997
23087
|
var mathTrunc = Math.trunc || function trunc(x) {
|
|
22998
23088
|
var n = +x;
|
|
22999
23089
|
return (n > 0 ? floor : ceil)(n);
|
|
@@ -23094,7 +23184,7 @@ var hiddenKeys$1 = enumBugKeys.concat('length', 'prototype');
|
|
|
23094
23184
|
|
|
23095
23185
|
// `Object.getOwnPropertyNames` method
|
|
23096
23186
|
// https://tc39.es/ecma262/#sec-object.getownpropertynames
|
|
23097
|
-
// eslint-disable-next-line es
|
|
23187
|
+
// eslint-disable-next-line es/no-object-getownpropertynames -- safe
|
|
23098
23188
|
var f$3 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
|
|
23099
23189
|
return objectKeysInternal(O, hiddenKeys$1);
|
|
23100
23190
|
};
|
|
@@ -23103,7 +23193,7 @@ var objectGetOwnPropertyNames = {
|
|
|
23103
23193
|
f: f$3
|
|
23104
23194
|
};
|
|
23105
23195
|
|
|
23106
|
-
// eslint-disable-next-line es
|
|
23196
|
+
// eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
|
|
23107
23197
|
var f$4 = Object.getOwnPropertySymbols;
|
|
23108
23198
|
|
|
23109
23199
|
var objectGetOwnPropertySymbols = {
|
|
@@ -23247,7 +23337,7 @@ var toString_1 = function (argument) {
|
|
|
23247
23337
|
var charAt = functionUncurryThis(''.charAt);
|
|
23248
23338
|
|
|
23249
23339
|
var FORCED = fails(function () {
|
|
23250
|
-
// eslint-disable-next-line es
|
|
23340
|
+
// eslint-disable-next-line es/no-array-string-prototype-at -- safe
|
|
23251
23341
|
return '𠮷'.at(-2) !== '\uD842';
|
|
23252
23342
|
});
|
|
23253
23343
|
|
|
@@ -23265,14 +23355,14 @@ _export({ target: 'String', proto: true, forced: FORCED }, {
|
|
|
23265
23355
|
|
|
23266
23356
|
// `Object.keys` method
|
|
23267
23357
|
// https://tc39.es/ecma262/#sec-object.keys
|
|
23268
|
-
// eslint-disable-next-line es
|
|
23358
|
+
// eslint-disable-next-line es/no-object-keys -- safe
|
|
23269
23359
|
var objectKeys = Object.keys || function keys(O) {
|
|
23270
23360
|
return objectKeysInternal(O, enumBugKeys);
|
|
23271
23361
|
};
|
|
23272
23362
|
|
|
23273
23363
|
// `Object.defineProperties` method
|
|
23274
23364
|
// https://tc39.es/ecma262/#sec-object.defineproperties
|
|
23275
|
-
// eslint-disable-next-line es
|
|
23365
|
+
// eslint-disable-next-line es/no-object-defineproperties -- safe
|
|
23276
23366
|
var f$5 = descriptors && !v8PrototypeDefineBug ? Object.defineProperties : function defineProperties(O, Properties) {
|
|
23277
23367
|
anObject(O);
|
|
23278
23368
|
var props = toIndexedObject(Properties);
|
|
@@ -23361,7 +23451,7 @@ hiddenKeys[IE_PROTO] = true;
|
|
|
23361
23451
|
|
|
23362
23452
|
// `Object.create` method
|
|
23363
23453
|
// https://tc39.es/ecma262/#sec-object.create
|
|
23364
|
-
// eslint-disable-next-line es
|
|
23454
|
+
// eslint-disable-next-line es/no-object-create -- safe
|
|
23365
23455
|
var objectCreate = Object.create || function create(O, Properties) {
|
|
23366
23456
|
var result;
|
|
23367
23457
|
if (O !== null) {
|
|
@@ -23407,13 +23497,13 @@ _export({ target: 'Array', proto: true }, {
|
|
|
23407
23497
|
|
|
23408
23498
|
addToUnscopables('at');
|
|
23409
23499
|
|
|
23410
|
-
// eslint-disable-next-line es
|
|
23411
|
-
var
|
|
23500
|
+
// eslint-disable-next-line es/no-typed-arrays -- safe
|
|
23501
|
+
var arrayBufferBasicDetection = typeof ArrayBuffer != 'undefined' && typeof DataView != 'undefined';
|
|
23412
23502
|
|
|
23413
23503
|
var correctPrototypeGetter = !fails(function () {
|
|
23414
23504
|
function F() { /* empty */ }
|
|
23415
23505
|
F.prototype.constructor = null;
|
|
23416
|
-
// eslint-disable-next-line es
|
|
23506
|
+
// eslint-disable-next-line es/no-object-getprototypeof -- required for testing
|
|
23417
23507
|
return Object.getPrototypeOf(new F()) !== F.prototype;
|
|
23418
23508
|
});
|
|
23419
23509
|
|
|
@@ -23423,7 +23513,7 @@ var ObjectPrototype = $Object$4.prototype;
|
|
|
23423
23513
|
|
|
23424
23514
|
// `Object.getPrototypeOf` method
|
|
23425
23515
|
// https://tc39.es/ecma262/#sec-object.getprototypeof
|
|
23426
|
-
// eslint-disable-next-line es
|
|
23516
|
+
// eslint-disable-next-line es/no-object-getprototypeof -- safe
|
|
23427
23517
|
var objectGetPrototypeOf = correctPrototypeGetter ? $Object$4.getPrototypeOf : function (O) {
|
|
23428
23518
|
var object = toObject(O);
|
|
23429
23519
|
if (hasOwnProperty_1(object, IE_PROTO$1)) return object[IE_PROTO$1];
|
|
@@ -23449,13 +23539,13 @@ var aPossiblePrototype = function (argument) {
|
|
|
23449
23539
|
// `Object.setPrototypeOf` method
|
|
23450
23540
|
// https://tc39.es/ecma262/#sec-object.setprototypeof
|
|
23451
23541
|
// Works with __proto__ only. Old v8 can't work with null proto objects.
|
|
23452
|
-
// eslint-disable-next-line es
|
|
23542
|
+
// eslint-disable-next-line es/no-object-setprototypeof -- safe
|
|
23453
23543
|
var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? function () {
|
|
23454
23544
|
var CORRECT_SETTER = false;
|
|
23455
23545
|
var test = {};
|
|
23456
23546
|
var setter;
|
|
23457
23547
|
try {
|
|
23458
|
-
// eslint-disable-next-line es
|
|
23548
|
+
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
23459
23549
|
setter = functionUncurryThis(Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set);
|
|
23460
23550
|
setter(test, []);
|
|
23461
23551
|
CORRECT_SETTER = test instanceof Array;
|
|
@@ -23492,7 +23582,7 @@ var TO_STRING_TAG$2 = wellKnownSymbol('toStringTag');
|
|
|
23492
23582
|
var TYPED_ARRAY_TAG = uid('TYPED_ARRAY_TAG');
|
|
23493
23583
|
var TYPED_ARRAY_CONSTRUCTOR = 'TypedArrayConstructor';
|
|
23494
23584
|
// Fixing native typed arrays in Opera Presto crashes the browser, see #595
|
|
23495
|
-
var NATIVE_ARRAY_BUFFER_VIEWS =
|
|
23585
|
+
var NATIVE_ARRAY_BUFFER_VIEWS = arrayBufferBasicDetection && !!objectSetPrototypeOf && classof(global_1.opera) !== 'Opera';
|
|
23496
23586
|
var TYPED_ARRAY_TAG_REQUIRED = false;
|
|
23497
23587
|
var NAME, Constructor, Prototype;
|
|
23498
23588
|
|
|
@@ -38530,49 +38620,624 @@ var TableHeading_styled = styled.th.withConfig({
|
|
|
38530
38620
|
return extraStyles;
|
|
38531
38621
|
});
|
|
38532
38622
|
|
|
38533
|
-
|
|
38534
|
-
value
|
|
38535
|
-
|
|
38536
|
-
|
|
38623
|
+
var validatorToPredicate = function validatorToPredicate(validatorFn, emptyCase) {
|
|
38624
|
+
return function (value) {
|
|
38625
|
+
for (var _len = arguments.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
38626
|
+
rest[_key - 1] = arguments[_key];
|
|
38627
|
+
}
|
|
38628
|
+
|
|
38629
|
+
return value === "" ? emptyCase : validatorFn.apply(void 0, [value].concat(rest));
|
|
38630
|
+
};
|
|
38631
|
+
};
|
|
38537
38632
|
|
|
38538
38633
|
var commonjsGlobal$1 = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
38539
38634
|
|
|
38540
|
-
|
|
38635
|
+
function getDefaultExportFromCjs(x) {
|
|
38636
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
38637
|
+
}
|
|
38638
|
+
|
|
38639
|
+
var dayjs_min = {
|
|
38640
|
+
exports: {}
|
|
38641
|
+
};
|
|
38541
38642
|
|
|
38542
38643
|
(function (module, exports) {
|
|
38543
|
-
!function
|
|
38544
|
-
|
|
38644
|
+
!function (t, e) {
|
|
38645
|
+
module.exports = e();
|
|
38646
|
+
}(commonjsGlobal$1, function () {
|
|
38647
|
+
var t = 1e3,
|
|
38648
|
+
e = 6e4,
|
|
38649
|
+
n = 36e5,
|
|
38650
|
+
r = "millisecond",
|
|
38651
|
+
i = "second",
|
|
38652
|
+
s = "minute",
|
|
38653
|
+
u = "hour",
|
|
38654
|
+
a = "day",
|
|
38655
|
+
o = "week",
|
|
38656
|
+
f = "month",
|
|
38657
|
+
h = "quarter",
|
|
38658
|
+
c = "year",
|
|
38659
|
+
d = "date",
|
|
38660
|
+
$ = "Invalid Date",
|
|
38661
|
+
l = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,
|
|
38662
|
+
y = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,
|
|
38663
|
+
M = {
|
|
38664
|
+
name: "en",
|
|
38665
|
+
weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),
|
|
38666
|
+
months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_")
|
|
38667
|
+
},
|
|
38668
|
+
m = function m(t, e, n) {
|
|
38669
|
+
var r = String(t);
|
|
38670
|
+
return !r || r.length >= e ? t : "" + Array(e + 1 - r.length).join(n) + t;
|
|
38671
|
+
},
|
|
38672
|
+
g = {
|
|
38673
|
+
s: m,
|
|
38674
|
+
z: function z(t) {
|
|
38675
|
+
var e = -t.utcOffset(),
|
|
38676
|
+
n = Math.abs(e),
|
|
38677
|
+
r = Math.floor(n / 60),
|
|
38678
|
+
i = n % 60;
|
|
38679
|
+
return (e <= 0 ? "+" : "-") + m(r, 2, "0") + ":" + m(i, 2, "0");
|
|
38680
|
+
},
|
|
38681
|
+
m: function t(e, n) {
|
|
38682
|
+
if (e.date() < n.date()) return -t(n, e);
|
|
38683
|
+
var r = 12 * (n.year() - e.year()) + (n.month() - e.month()),
|
|
38684
|
+
i = e.clone().add(r, f),
|
|
38685
|
+
s = n - i < 0,
|
|
38686
|
+
u = e.clone().add(r + (s ? -1 : 1), f);
|
|
38687
|
+
return +(-(r + (n - i) / (s ? i - u : u - i)) || 0);
|
|
38688
|
+
},
|
|
38689
|
+
a: function a(t) {
|
|
38690
|
+
return t < 0 ? Math.ceil(t) || 0 : Math.floor(t);
|
|
38691
|
+
},
|
|
38692
|
+
p: function p(t) {
|
|
38693
|
+
return {
|
|
38694
|
+
M: f,
|
|
38695
|
+
y: c,
|
|
38696
|
+
w: o,
|
|
38697
|
+
d: a,
|
|
38698
|
+
D: d,
|
|
38699
|
+
h: u,
|
|
38700
|
+
m: s,
|
|
38701
|
+
s: i,
|
|
38702
|
+
ms: r,
|
|
38703
|
+
Q: h
|
|
38704
|
+
}[t] || String(t || "").toLowerCase().replace(/s$/, "");
|
|
38705
|
+
},
|
|
38706
|
+
u: function u(t) {
|
|
38707
|
+
return void 0 === t;
|
|
38708
|
+
}
|
|
38709
|
+
},
|
|
38710
|
+
D = "en",
|
|
38711
|
+
v = {};
|
|
38545
38712
|
|
|
38546
|
-
|
|
38713
|
+
v[D] = M;
|
|
38547
38714
|
|
|
38548
|
-
var
|
|
38715
|
+
var p = function p(t) {
|
|
38716
|
+
return t instanceof _;
|
|
38717
|
+
},
|
|
38718
|
+
S = function S(t, e, n) {
|
|
38719
|
+
var r;
|
|
38720
|
+
if (!t) return D;
|
|
38721
|
+
if ("string" == typeof t) v[t] && (r = t), e && (v[t] = e, r = t);else {
|
|
38722
|
+
var i = t.name;
|
|
38723
|
+
v[i] = t, r = i;
|
|
38724
|
+
}
|
|
38725
|
+
return !n && r && (D = r), r || !n && D;
|
|
38726
|
+
},
|
|
38727
|
+
w = function w(t, e) {
|
|
38728
|
+
if (p(t)) return t.clone();
|
|
38729
|
+
var n = "object" == _typeof(e) ? e : {};
|
|
38730
|
+
return n.date = t, n.args = arguments, new _(n);
|
|
38731
|
+
},
|
|
38732
|
+
O = g;
|
|
38733
|
+
|
|
38734
|
+
O.l = S, O.i = p, O.w = function (t, e) {
|
|
38735
|
+
return w(t, {
|
|
38736
|
+
locale: e.$L,
|
|
38737
|
+
utc: e.$u,
|
|
38738
|
+
x: e.$x,
|
|
38739
|
+
$offset: e.$offset
|
|
38740
|
+
});
|
|
38741
|
+
};
|
|
38549
38742
|
|
|
38550
|
-
|
|
38551
|
-
|
|
38552
|
-
|
|
38743
|
+
var _ = function () {
|
|
38744
|
+
function M(t) {
|
|
38745
|
+
this.$L = S(t.locale, null, !0), this.parse(t);
|
|
38746
|
+
}
|
|
38553
38747
|
|
|
38554
|
-
var
|
|
38748
|
+
var m = M.prototype;
|
|
38749
|
+
return m.parse = function (t) {
|
|
38750
|
+
this.$d = function (t) {
|
|
38751
|
+
var e = t.date,
|
|
38752
|
+
n = t.utc;
|
|
38753
|
+
if (null === e) return new Date(NaN);
|
|
38754
|
+
if (O.u(e)) return new Date();
|
|
38755
|
+
if (e instanceof Date) return new Date(e);
|
|
38756
|
+
|
|
38757
|
+
if ("string" == typeof e && !/Z$/i.test(e)) {
|
|
38758
|
+
var r = e.match(l);
|
|
38759
|
+
|
|
38760
|
+
if (r) {
|
|
38761
|
+
var i = r[2] - 1 || 0,
|
|
38762
|
+
s = (r[7] || "0").substring(0, 3);
|
|
38763
|
+
return n ? new Date(Date.UTC(r[1], i, r[3] || 1, r[4] || 0, r[5] || 0, r[6] || 0, s)) : new Date(r[1], i, r[3] || 1, r[4] || 0, r[5] || 0, r[6] || 0, s);
|
|
38764
|
+
}
|
|
38765
|
+
}
|
|
38555
38766
|
|
|
38556
|
-
|
|
38767
|
+
return new Date(e);
|
|
38768
|
+
}(t), this.$x = t.x || {}, this.init();
|
|
38769
|
+
}, m.init = function () {
|
|
38770
|
+
var t = this.$d;
|
|
38771
|
+
this.$y = t.getFullYear(), this.$M = t.getMonth(), this.$D = t.getDate(), this.$W = t.getDay(), this.$H = t.getHours(), this.$m = t.getMinutes(), this.$s = t.getSeconds(), this.$ms = t.getMilliseconds();
|
|
38772
|
+
}, m.$utils = function () {
|
|
38773
|
+
return O;
|
|
38774
|
+
}, m.isValid = function () {
|
|
38775
|
+
return !(this.$d.toString() === $);
|
|
38776
|
+
}, m.isSame = function (t, e) {
|
|
38777
|
+
var n = w(t);
|
|
38778
|
+
return this.startOf(e) <= n && n <= this.endOf(e);
|
|
38779
|
+
}, m.isAfter = function (t, e) {
|
|
38780
|
+
return w(t) < this.startOf(e);
|
|
38781
|
+
}, m.isBefore = function (t, e) {
|
|
38782
|
+
return this.endOf(e) < w(t);
|
|
38783
|
+
}, m.$g = function (t, e, n) {
|
|
38784
|
+
return O.u(t) ? this[e] : this.set(n, t);
|
|
38785
|
+
}, m.unix = function () {
|
|
38786
|
+
return Math.floor(this.valueOf() / 1e3);
|
|
38787
|
+
}, m.valueOf = function () {
|
|
38788
|
+
return this.$d.getTime();
|
|
38789
|
+
}, m.startOf = function (t, e) {
|
|
38790
|
+
var n = this,
|
|
38791
|
+
r = !!O.u(e) || e,
|
|
38792
|
+
h = O.p(t),
|
|
38793
|
+
$ = function $(t, e) {
|
|
38794
|
+
var i = O.w(n.$u ? Date.UTC(n.$y, e, t) : new Date(n.$y, e, t), n);
|
|
38795
|
+
return r ? i : i.endOf(a);
|
|
38796
|
+
},
|
|
38797
|
+
l = function l(t, e) {
|
|
38798
|
+
return O.w(n.toDate()[t].apply(n.toDate("s"), (r ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e)), n);
|
|
38799
|
+
},
|
|
38800
|
+
y = this.$W,
|
|
38801
|
+
M = this.$M,
|
|
38802
|
+
m = this.$D,
|
|
38803
|
+
g = "set" + (this.$u ? "UTC" : "");
|
|
38804
|
+
|
|
38805
|
+
switch (h) {
|
|
38806
|
+
case c:
|
|
38807
|
+
return r ? $(1, 0) : $(31, 11);
|
|
38808
|
+
|
|
38809
|
+
case f:
|
|
38810
|
+
return r ? $(1, M) : $(0, M + 1);
|
|
38811
|
+
|
|
38812
|
+
case o:
|
|
38813
|
+
var D = this.$locale().weekStart || 0,
|
|
38814
|
+
v = (y < D ? y + 7 : y) - D;
|
|
38815
|
+
return $(r ? m - v : m + (6 - v), M);
|
|
38816
|
+
|
|
38817
|
+
case a:
|
|
38818
|
+
case d:
|
|
38819
|
+
return l(g + "Hours", 0);
|
|
38820
|
+
|
|
38821
|
+
case u:
|
|
38822
|
+
return l(g + "Minutes", 1);
|
|
38823
|
+
|
|
38824
|
+
case s:
|
|
38825
|
+
return l(g + "Seconds", 2);
|
|
38826
|
+
|
|
38827
|
+
case i:
|
|
38828
|
+
return l(g + "Milliseconds", 3);
|
|
38829
|
+
|
|
38830
|
+
default:
|
|
38831
|
+
return this.clone();
|
|
38832
|
+
}
|
|
38833
|
+
}, m.endOf = function (t) {
|
|
38834
|
+
return this.startOf(t, !1);
|
|
38835
|
+
}, m.$set = function (t, e) {
|
|
38836
|
+
var n,
|
|
38837
|
+
o = O.p(t),
|
|
38838
|
+
h = "set" + (this.$u ? "UTC" : ""),
|
|
38839
|
+
$ = (n = {}, n[a] = h + "Date", n[d] = h + "Date", n[f] = h + "Month", n[c] = h + "FullYear", n[u] = h + "Hours", n[s] = h + "Minutes", n[i] = h + "Seconds", n[r] = h + "Milliseconds", n)[o],
|
|
38840
|
+
l = o === a ? this.$D + (e - this.$W) : e;
|
|
38841
|
+
|
|
38842
|
+
if (o === f || o === c) {
|
|
38843
|
+
var y = this.clone().set(d, 1);
|
|
38844
|
+
y.$d[$](l), y.init(), this.$d = y.set(d, Math.min(this.$D, y.daysInMonth())).$d;
|
|
38845
|
+
} else $ && this.$d[$](l);
|
|
38846
|
+
|
|
38847
|
+
return this.init(), this;
|
|
38848
|
+
}, m.set = function (t, e) {
|
|
38849
|
+
return this.clone().$set(t, e);
|
|
38850
|
+
}, m.get = function (t) {
|
|
38851
|
+
return this[O.p(t)]();
|
|
38852
|
+
}, m.add = function (r, h) {
|
|
38853
|
+
var d,
|
|
38854
|
+
$ = this;
|
|
38855
|
+
r = Number(r);
|
|
38856
|
+
|
|
38857
|
+
var l = O.p(h),
|
|
38858
|
+
y = function y(t) {
|
|
38859
|
+
var e = w($);
|
|
38860
|
+
return O.w(e.date(e.date() + Math.round(t * r)), $);
|
|
38861
|
+
};
|
|
38862
|
+
|
|
38863
|
+
if (l === f) return this.set(f, this.$M + r);
|
|
38864
|
+
if (l === c) return this.set(c, this.$y + r);
|
|
38865
|
+
if (l === a) return y(1);
|
|
38866
|
+
if (l === o) return y(7);
|
|
38867
|
+
var M = (d = {}, d[s] = e, d[u] = n, d[i] = t, d)[l] || 1,
|
|
38868
|
+
m = this.$d.getTime() + r * M;
|
|
38869
|
+
return O.w(m, this);
|
|
38870
|
+
}, m.subtract = function (t, e) {
|
|
38871
|
+
return this.add(-1 * t, e);
|
|
38872
|
+
}, m.format = function (t) {
|
|
38873
|
+
var e = this,
|
|
38874
|
+
n = this.$locale();
|
|
38875
|
+
if (!this.isValid()) return n.invalidDate || $;
|
|
38876
|
+
|
|
38877
|
+
var r = t || "YYYY-MM-DDTHH:mm:ssZ",
|
|
38878
|
+
i = O.z(this),
|
|
38879
|
+
s = this.$H,
|
|
38880
|
+
u = this.$m,
|
|
38881
|
+
a = this.$M,
|
|
38882
|
+
o = n.weekdays,
|
|
38883
|
+
f = n.months,
|
|
38884
|
+
h = function h(t, n, i, s) {
|
|
38885
|
+
return t && (t[n] || t(e, r)) || i[n].substr(0, s);
|
|
38886
|
+
},
|
|
38887
|
+
c = function c(t) {
|
|
38888
|
+
return O.s(s % 12 || 12, t, "0");
|
|
38889
|
+
},
|
|
38890
|
+
d = n.meridiem || function (t, e, n) {
|
|
38891
|
+
var r = t < 12 ? "AM" : "PM";
|
|
38892
|
+
return n ? r.toLowerCase() : r;
|
|
38893
|
+
},
|
|
38894
|
+
l = {
|
|
38895
|
+
YY: String(this.$y).slice(-2),
|
|
38896
|
+
YYYY: this.$y,
|
|
38897
|
+
M: a + 1,
|
|
38898
|
+
MM: O.s(a + 1, 2, "0"),
|
|
38899
|
+
MMM: h(n.monthsShort, a, f, 3),
|
|
38900
|
+
MMMM: h(f, a),
|
|
38901
|
+
D: this.$D,
|
|
38902
|
+
DD: O.s(this.$D, 2, "0"),
|
|
38903
|
+
d: String(this.$W),
|
|
38904
|
+
dd: h(n.weekdaysMin, this.$W, o, 2),
|
|
38905
|
+
ddd: h(n.weekdaysShort, this.$W, o, 3),
|
|
38906
|
+
dddd: o[this.$W],
|
|
38907
|
+
H: String(s),
|
|
38908
|
+
HH: O.s(s, 2, "0"),
|
|
38909
|
+
h: c(1),
|
|
38910
|
+
hh: c(2),
|
|
38911
|
+
a: d(s, u, !0),
|
|
38912
|
+
A: d(s, u, !1),
|
|
38913
|
+
m: String(u),
|
|
38914
|
+
mm: O.s(u, 2, "0"),
|
|
38915
|
+
s: String(this.$s),
|
|
38916
|
+
ss: O.s(this.$s, 2, "0"),
|
|
38917
|
+
SSS: O.s(this.$ms, 3, "0"),
|
|
38918
|
+
Z: i
|
|
38919
|
+
};
|
|
38920
|
+
|
|
38921
|
+
return r.replace(y, function (t, e) {
|
|
38922
|
+
return e || l[t] || i.replace(":", "");
|
|
38923
|
+
});
|
|
38924
|
+
}, m.utcOffset = function () {
|
|
38925
|
+
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
|
|
38926
|
+
}, m.diff = function (r, d, $) {
|
|
38927
|
+
var l,
|
|
38928
|
+
y = O.p(d),
|
|
38929
|
+
M = w(r),
|
|
38930
|
+
m = (M.utcOffset() - this.utcOffset()) * e,
|
|
38931
|
+
g = this - M,
|
|
38932
|
+
D = O.m(this, M);
|
|
38933
|
+
return D = (l = {}, l[c] = D / 12, l[f] = D, l[h] = D / 3, l[o] = (g - m) / 6048e5, l[a] = (g - m) / 864e5, l[u] = g / n, l[s] = g / e, l[i] = g / t, l)[y] || g, $ ? D : O.a(D);
|
|
38934
|
+
}, m.daysInMonth = function () {
|
|
38935
|
+
return this.endOf(f).$D;
|
|
38936
|
+
}, m.$locale = function () {
|
|
38937
|
+
return v[this.$L];
|
|
38938
|
+
}, m.locale = function (t, e) {
|
|
38939
|
+
if (!t) return this.$L;
|
|
38940
|
+
var n = this.clone(),
|
|
38941
|
+
r = S(t, e, !0);
|
|
38942
|
+
return r && (n.$L = r), n;
|
|
38943
|
+
}, m.clone = function () {
|
|
38944
|
+
return O.w(this.$d, this);
|
|
38945
|
+
}, m.toDate = function () {
|
|
38946
|
+
return new Date(this.valueOf());
|
|
38947
|
+
}, m.toJSON = function () {
|
|
38948
|
+
return this.isValid() ? this.toISOString() : null;
|
|
38949
|
+
}, m.toISOString = function () {
|
|
38950
|
+
return this.$d.toISOString();
|
|
38951
|
+
}, m.toString = function () {
|
|
38952
|
+
return this.$d.toUTCString();
|
|
38953
|
+
}, M;
|
|
38954
|
+
}(),
|
|
38955
|
+
b = _.prototype;
|
|
38956
|
+
|
|
38957
|
+
return w.prototype = b, [["$ms", r], ["$s", i], ["$m", s], ["$H", u], ["$W", a], ["$M", f], ["$y", c], ["$D", d]].forEach(function (t) {
|
|
38958
|
+
b[t[1]] = function (e) {
|
|
38959
|
+
return this.$g(e, t[0], t[1]);
|
|
38960
|
+
};
|
|
38961
|
+
}), w.extend = function (t, e) {
|
|
38962
|
+
return t.$i || (t(e, _, w), t.$i = !0), w;
|
|
38963
|
+
}, w.locale = S, w.isDayjs = p, w.unix = function (t) {
|
|
38964
|
+
return w(1e3 * t);
|
|
38965
|
+
}, w.en = v[D], w.Ls = v, w.p = {}, w;
|
|
38966
|
+
});
|
|
38967
|
+
})(dayjs_min);
|
|
38968
|
+
|
|
38969
|
+
var dayjs_minExports = dayjs_min.exports;
|
|
38970
|
+
var dayjs = /*@__PURE__*/getDefaultExportFromCjs(dayjs_minExports);
|
|
38971
|
+
var customParseFormat$1 = {
|
|
38972
|
+
exports: {}
|
|
38973
|
+
};
|
|
38557
38974
|
|
|
38558
38975
|
(function (module, exports) {
|
|
38559
|
-
!function(
|
|
38560
|
-
|
|
38976
|
+
!function (t, e) {
|
|
38977
|
+
module.exports = e();
|
|
38978
|
+
}(commonjsGlobal$1, function () {
|
|
38979
|
+
var t = {
|
|
38980
|
+
LTS: "h:mm:ss A",
|
|
38981
|
+
LT: "h:mm A",
|
|
38982
|
+
L: "MM/DD/YYYY",
|
|
38983
|
+
LL: "MMMM D, YYYY",
|
|
38984
|
+
LLL: "MMMM D, YYYY h:mm A",
|
|
38985
|
+
LLLL: "dddd, MMMM D, YYYY h:mm A"
|
|
38986
|
+
},
|
|
38987
|
+
e = /(\[[^[]*\])|([-:/.()\s]+)|(A|a|YYYY|YY?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,
|
|
38988
|
+
n = /\d\d/,
|
|
38989
|
+
r = /\d\d?/,
|
|
38990
|
+
i = /\d*[^\s\d-_:/()]+/,
|
|
38991
|
+
o = {},
|
|
38992
|
+
s = function s(t) {
|
|
38993
|
+
return (t = +t) + (t > 68 ? 1900 : 2e3);
|
|
38994
|
+
};
|
|
38995
|
+
|
|
38996
|
+
var a = function a(t) {
|
|
38997
|
+
return function (e) {
|
|
38998
|
+
this[t] = +e;
|
|
38999
|
+
};
|
|
39000
|
+
},
|
|
39001
|
+
f = [/[+-]\d\d:?(\d\d)?|Z/, function (t) {
|
|
39002
|
+
(this.zone || (this.zone = {})).offset = function (t) {
|
|
39003
|
+
if (!t) return 0;
|
|
39004
|
+
if ("Z" === t) return 0;
|
|
39005
|
+
var e = t.match(/([+-]|\d\d)/g),
|
|
39006
|
+
n = 60 * e[1] + (+e[2] || 0);
|
|
39007
|
+
return 0 === n ? 0 : "+" === e[0] ? -n : n;
|
|
39008
|
+
}(t);
|
|
39009
|
+
}],
|
|
39010
|
+
u = function u(t) {
|
|
39011
|
+
var e = o[t];
|
|
39012
|
+
return e && (e.indexOf ? e : e.s.concat(e.f));
|
|
39013
|
+
},
|
|
39014
|
+
h = function h(t, e) {
|
|
39015
|
+
var n,
|
|
39016
|
+
r = o.meridiem;
|
|
39017
|
+
|
|
39018
|
+
if (r) {
|
|
39019
|
+
for (var i = 1; i <= 24; i += 1) {
|
|
39020
|
+
if (t.indexOf(r(i, 0, e)) > -1) {
|
|
39021
|
+
n = i > 12;
|
|
39022
|
+
break;
|
|
39023
|
+
}
|
|
39024
|
+
}
|
|
39025
|
+
} else n = t === (e ? "pm" : "PM");
|
|
39026
|
+
|
|
39027
|
+
return n;
|
|
39028
|
+
},
|
|
39029
|
+
d = {
|
|
39030
|
+
A: [i, function (t) {
|
|
39031
|
+
this.afternoon = h(t, !1);
|
|
39032
|
+
}],
|
|
39033
|
+
a: [i, function (t) {
|
|
39034
|
+
this.afternoon = h(t, !0);
|
|
39035
|
+
}],
|
|
39036
|
+
S: [/\d/, function (t) {
|
|
39037
|
+
this.milliseconds = 100 * +t;
|
|
39038
|
+
}],
|
|
39039
|
+
SS: [n, function (t) {
|
|
39040
|
+
this.milliseconds = 10 * +t;
|
|
39041
|
+
}],
|
|
39042
|
+
SSS: [/\d{3}/, function (t) {
|
|
39043
|
+
this.milliseconds = +t;
|
|
39044
|
+
}],
|
|
39045
|
+
s: [r, a("seconds")],
|
|
39046
|
+
ss: [r, a("seconds")],
|
|
39047
|
+
m: [r, a("minutes")],
|
|
39048
|
+
mm: [r, a("minutes")],
|
|
39049
|
+
H: [r, a("hours")],
|
|
39050
|
+
h: [r, a("hours")],
|
|
39051
|
+
HH: [r, a("hours")],
|
|
39052
|
+
hh: [r, a("hours")],
|
|
39053
|
+
D: [r, a("day")],
|
|
39054
|
+
DD: [n, a("day")],
|
|
39055
|
+
Do: [i, function (t) {
|
|
39056
|
+
var e = o.ordinal,
|
|
39057
|
+
n = t.match(/\d+/);
|
|
39058
|
+
if (this.day = n[0], e) for (var r = 1; r <= 31; r += 1) {
|
|
39059
|
+
e(r).replace(/\[|\]/g, "") === t && (this.day = r);
|
|
39060
|
+
}
|
|
39061
|
+
}],
|
|
39062
|
+
M: [r, a("month")],
|
|
39063
|
+
MM: [n, a("month")],
|
|
39064
|
+
MMM: [i, function (t) {
|
|
39065
|
+
var e = u("months"),
|
|
39066
|
+
n = (u("monthsShort") || e.map(function (t) {
|
|
39067
|
+
return t.substr(0, 3);
|
|
39068
|
+
})).indexOf(t) + 1;
|
|
39069
|
+
if (n < 1) throw new Error();
|
|
39070
|
+
this.month = n % 12 || n;
|
|
39071
|
+
}],
|
|
39072
|
+
MMMM: [i, function (t) {
|
|
39073
|
+
var e = u("months").indexOf(t) + 1;
|
|
39074
|
+
if (e < 1) throw new Error();
|
|
39075
|
+
this.month = e % 12 || e;
|
|
39076
|
+
}],
|
|
39077
|
+
Y: [/[+-]?\d+/, a("year")],
|
|
39078
|
+
YY: [n, function (t) {
|
|
39079
|
+
this.year = s(t);
|
|
39080
|
+
}],
|
|
39081
|
+
YYYY: [/\d{4}/, a("year")],
|
|
39082
|
+
Z: f,
|
|
39083
|
+
ZZ: f
|
|
39084
|
+
};
|
|
39085
|
+
|
|
39086
|
+
function c(n) {
|
|
39087
|
+
var r, i;
|
|
39088
|
+
r = n, i = o && o.formats;
|
|
39089
|
+
|
|
39090
|
+
for (var s = (n = r.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, function (e, n, r) {
|
|
39091
|
+
var o = r && r.toUpperCase();
|
|
39092
|
+
return n || i[r] || t[r] || i[o].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, function (t, e, n) {
|
|
39093
|
+
return e || n.slice(1);
|
|
39094
|
+
});
|
|
39095
|
+
})).match(e), a = s.length, f = 0; f < a; f += 1) {
|
|
39096
|
+
var u = s[f],
|
|
39097
|
+
h = d[u],
|
|
39098
|
+
c = h && h[0],
|
|
39099
|
+
l = h && h[1];
|
|
39100
|
+
s[f] = l ? {
|
|
39101
|
+
regex: c,
|
|
39102
|
+
parser: l
|
|
39103
|
+
} : u.replace(/^\[|\]$/g, "");
|
|
39104
|
+
}
|
|
39105
|
+
|
|
39106
|
+
return function (t) {
|
|
39107
|
+
for (var e = {}, n = 0, r = 0; n < a; n += 1) {
|
|
39108
|
+
var i = s[n];
|
|
39109
|
+
if ("string" == typeof i) r += i.length;else {
|
|
39110
|
+
var o = i.regex,
|
|
39111
|
+
f = i.parser,
|
|
39112
|
+
u = t.substr(r),
|
|
39113
|
+
h = o.exec(u)[0];
|
|
39114
|
+
f.call(e, h), t = t.replace(h, "");
|
|
39115
|
+
}
|
|
39116
|
+
}
|
|
39117
|
+
|
|
39118
|
+
return function (t) {
|
|
39119
|
+
var e = t.afternoon;
|
|
38561
39120
|
|
|
38562
|
-
|
|
39121
|
+
if (void 0 !== e) {
|
|
39122
|
+
var n = t.hours;
|
|
39123
|
+
e ? n < 12 && (t.hours += 12) : 12 === n && (t.hours = 0), delete t.afternoon;
|
|
39124
|
+
}
|
|
39125
|
+
}(e), e;
|
|
39126
|
+
};
|
|
39127
|
+
}
|
|
39128
|
+
|
|
39129
|
+
return function (t, e, n) {
|
|
39130
|
+
n.p.customParseFormat = !0, t && t.parseTwoDigitYear && (s = t.parseTwoDigitYear);
|
|
39131
|
+
var r = e.prototype,
|
|
39132
|
+
i = r.parse;
|
|
39133
|
+
|
|
39134
|
+
r.parse = function (t) {
|
|
39135
|
+
var e = t.date,
|
|
39136
|
+
r = t.utc,
|
|
39137
|
+
s = t.args;
|
|
39138
|
+
this.$u = r;
|
|
39139
|
+
var a = s[1];
|
|
39140
|
+
|
|
39141
|
+
if ("string" == typeof a) {
|
|
39142
|
+
var f = !0 === s[2],
|
|
39143
|
+
u = !0 === s[3],
|
|
39144
|
+
h = f || u,
|
|
39145
|
+
d = s[2];
|
|
39146
|
+
u && (d = s[2]), o = this.$locale(), !f && d && (o = n.Ls[d]), this.$d = function (t, e, n) {
|
|
39147
|
+
try {
|
|
39148
|
+
if (["x", "X"].indexOf(e) > -1) return new Date(("X" === e ? 1e3 : 1) * t);
|
|
39149
|
+
var r = c(e)(t),
|
|
39150
|
+
i = r.year,
|
|
39151
|
+
o = r.month,
|
|
39152
|
+
s = r.day,
|
|
39153
|
+
a = r.hours,
|
|
39154
|
+
f = r.minutes,
|
|
39155
|
+
u = r.seconds,
|
|
39156
|
+
h = r.milliseconds,
|
|
39157
|
+
d = r.zone,
|
|
39158
|
+
l = new Date(),
|
|
39159
|
+
m = s || (i || o ? 1 : l.getDate()),
|
|
39160
|
+
M = i || l.getFullYear(),
|
|
39161
|
+
Y = 0;
|
|
39162
|
+
i && !o || (Y = o > 0 ? o - 1 : l.getMonth());
|
|
39163
|
+
var p = a || 0,
|
|
39164
|
+
v = f || 0,
|
|
39165
|
+
D = u || 0,
|
|
39166
|
+
g = h || 0;
|
|
39167
|
+
return d ? new Date(Date.UTC(M, Y, m, p, v, D, g + 60 * d.offset * 1e3)) : n ? new Date(Date.UTC(M, Y, m, p, v, D, g)) : new Date(M, Y, m, p, v, D, g);
|
|
39168
|
+
} catch (t) {
|
|
39169
|
+
return new Date("");
|
|
39170
|
+
}
|
|
39171
|
+
}(e, a, r), this.init(), d && !0 !== d && (this.$L = this.locale(d).$L), h && e != this.format(a) && (this.$d = new Date("")), o = {};
|
|
39172
|
+
} else if (a instanceof Array) for (var l = a.length, m = 1; m <= l; m += 1) {
|
|
39173
|
+
s[1] = a[m - 1];
|
|
39174
|
+
var M = n.apply(this, s);
|
|
38563
39175
|
|
|
38564
|
-
|
|
39176
|
+
if (M.isValid()) {
|
|
39177
|
+
this.$d = M.$d, this.$L = M.$L, this.init();
|
|
39178
|
+
break;
|
|
39179
|
+
}
|
|
39180
|
+
|
|
39181
|
+
m === l && (this.$d = new Date(""));
|
|
39182
|
+
} else i.call(this, t);
|
|
39183
|
+
};
|
|
39184
|
+
};
|
|
39185
|
+
});
|
|
39186
|
+
})(customParseFormat$1);
|
|
39187
|
+
|
|
39188
|
+
var customParseFormatExports = customParseFormat$1.exports;
|
|
39189
|
+
var customParseFormat = /*@__PURE__*/getDefaultExportFromCjs(customParseFormatExports);
|
|
39190
|
+
var isSameOrBefore$1 = {
|
|
39191
|
+
exports: {}
|
|
39192
|
+
};
|
|
38565
39193
|
|
|
38566
39194
|
(function (module, exports) {
|
|
38567
|
-
!function(e,
|
|
38568
|
-
|
|
39195
|
+
!function (e, i) {
|
|
39196
|
+
module.exports = i();
|
|
39197
|
+
}(commonjsGlobal$1, function () {
|
|
39198
|
+
return function (e, i) {
|
|
39199
|
+
i.prototype.isSameOrBefore = function (e, i) {
|
|
39200
|
+
return this.isSame(e, i) || this.isBefore(e, i);
|
|
39201
|
+
};
|
|
39202
|
+
};
|
|
39203
|
+
});
|
|
39204
|
+
})(isSameOrBefore$1);
|
|
39205
|
+
|
|
39206
|
+
var isSameOrBeforeExports = isSameOrBefore$1.exports;
|
|
39207
|
+
var isSameOrBefore = /*@__PURE__*/getDefaultExportFromCjs(isSameOrBeforeExports);
|
|
39208
|
+
var isSameOrAfter$1 = {
|
|
39209
|
+
exports: {}
|
|
39210
|
+
};
|
|
38569
39211
|
|
|
38570
|
-
|
|
39212
|
+
(function (module, exports) {
|
|
39213
|
+
!function (e, t) {
|
|
39214
|
+
module.exports = t();
|
|
39215
|
+
}(commonjsGlobal$1, function () {
|
|
39216
|
+
return function (e, t) {
|
|
39217
|
+
t.prototype.isSameOrAfter = function (e, t) {
|
|
39218
|
+
return this.isSame(e, t) || this.isAfter(e, t);
|
|
39219
|
+
};
|
|
39220
|
+
};
|
|
39221
|
+
});
|
|
39222
|
+
})(isSameOrAfter$1);
|
|
38571
39223
|
|
|
39224
|
+
var isSameOrAfterExports = isSameOrAfter$1.exports;
|
|
39225
|
+
var isSameOrAfter = /*@__PURE__*/getDefaultExportFromCjs(isSameOrAfterExports);
|
|
38572
39226
|
/* eslint-disable no-unused-vars */
|
|
38573
39227
|
|
|
38574
|
-
|
|
38575
|
-
|
|
39228
|
+
var createValidator = function createValidator(type, error) {
|
|
39229
|
+
var validator = function validator() {
|
|
39230
|
+
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
39231
|
+
args[_key2] = arguments[_key2];
|
|
39232
|
+
}
|
|
39233
|
+
|
|
39234
|
+
return {
|
|
39235
|
+
type: type,
|
|
39236
|
+
args: args,
|
|
39237
|
+
error: error
|
|
39238
|
+
};
|
|
39239
|
+
};
|
|
39240
|
+
|
|
38576
39241
|
validator.error = error;
|
|
38577
39242
|
return validator;
|
|
38578
39243
|
};
|
|
@@ -38580,30 +39245,38 @@ const createValidator = (type, error) => {
|
|
|
38580
39245
|
dayjs.extend(customParseFormat);
|
|
38581
39246
|
dayjs.extend(isSameOrBefore);
|
|
38582
39247
|
dayjs.extend(isSameOrAfter);
|
|
39248
|
+
var validatorFns = {};
|
|
39249
|
+
var INCLUDED_IN = "validator/INCLUDED_IN";
|
|
39250
|
+
var INCLUDED_IN_ERROR = "error/INCLUDED_IN";
|
|
39251
|
+
var includedIn = createValidator(INCLUDED_IN, INCLUDED_IN_ERROR);
|
|
39252
|
+
|
|
39253
|
+
validatorFns[INCLUDED_IN] = function (value, args, form) {
|
|
39254
|
+
return Array.isArray(args[0]) ? args[0].includes(value) : args[0] === value;
|
|
39255
|
+
};
|
|
38583
39256
|
|
|
38584
|
-
|
|
39257
|
+
var REQUIRED = "validator/REQUIRED";
|
|
39258
|
+
var REQUIRED_ERROR = "error/REQUIRED";
|
|
39259
|
+
var required = createValidator(REQUIRED, REQUIRED_ERROR);
|
|
38585
39260
|
|
|
38586
|
-
|
|
38587
|
-
|
|
38588
|
-
|
|
38589
|
-
validatorFns[INCLUDED_IN] = (value, args, form) =>
|
|
38590
|
-
Array.isArray(args[0]) ? args[0].includes(value) : args[0] === value;
|
|
39261
|
+
validatorFns[REQUIRED] = function (value, args, form) {
|
|
39262
|
+
return value !== "";
|
|
39263
|
+
};
|
|
38591
39264
|
|
|
38592
|
-
|
|
38593
|
-
|
|
38594
|
-
|
|
38595
|
-
validatorFns[REQUIRED] = (value, args, form) => value !== "";
|
|
39265
|
+
var ONLY_INTEGERS = "validator/ONLY_INTEGERS";
|
|
39266
|
+
var ONLY_INTEGERS_ERROR = "error/ONLY_INTEGERS";
|
|
39267
|
+
var onlyIntegers = createValidator(ONLY_INTEGERS, ONLY_INTEGERS_ERROR);
|
|
38596
39268
|
|
|
38597
|
-
|
|
38598
|
-
|
|
38599
|
-
|
|
38600
|
-
validatorFns[ONLY_INTEGERS] = (value, args, form) => /^(-?\d+)?$/.test(value);
|
|
39269
|
+
validatorFns[ONLY_INTEGERS] = function (value, args, form) {
|
|
39270
|
+
return /^(-?\d+)?$/.test(value);
|
|
39271
|
+
};
|
|
38601
39272
|
|
|
38602
|
-
|
|
38603
|
-
|
|
38604
|
-
|
|
38605
|
-
validatorFns[ONLY_NATURALS] = (value, args, form) => /^(\d+)?$/.test(value);
|
|
39273
|
+
var ONLY_NATURALS = "validator/ONLY_NATURALS";
|
|
39274
|
+
var ONLY_NATURALS_ERROR = "error/ONLY_NATURALS";
|
|
39275
|
+
var onlyNaturals = createValidator(ONLY_NATURALS, ONLY_NATURALS_ERROR);
|
|
38606
39276
|
|
|
39277
|
+
validatorFns[ONLY_NATURALS] = function (value, args, form) {
|
|
39278
|
+
return /^(\d+)?$/.test(value);
|
|
39279
|
+
};
|
|
38607
39280
|
/*
|
|
38608
39281
|
07/22: experimental expiration date constraint
|
|
38609
39282
|
should allow entry of expiration date using "/" character
|
|
@@ -38613,439 +39286,464 @@ not tested as validation function
|
|
|
38613
39286
|
to validate exp date instead use combo of:
|
|
38614
39287
|
required(), hasLength(), isValidMonth(), dateAfterToday()
|
|
38615
39288
|
*/
|
|
38616
|
-
|
|
38617
|
-
|
|
38618
|
-
|
|
38619
|
-
|
|
38620
|
-
|
|
38621
|
-
|
|
38622
|
-
validatorFns[ONLY_EXPIRATION_DATE] = (value, args, form)
|
|
38623
|
-
/^(\d?\d?\/?\d?\d?)?$/.test(value);
|
|
38624
|
-
|
|
38625
|
-
|
|
38626
|
-
|
|
38627
|
-
|
|
38628
|
-
|
|
38629
|
-
|
|
38630
|
-
)
|
|
38631
|
-
validatorFns[NUMBER_LESS_THAN] = (value, args, form) => {
|
|
39289
|
+
|
|
39290
|
+
|
|
39291
|
+
var ONLY_EXPIRATION_DATE = "validator/ONLY_EXPIRATION_DATE";
|
|
39292
|
+
var ONLY_EXPIRATION_DATE_ERROR = "error/ONLY_EXPIRATION_DATE";
|
|
39293
|
+
var onlyExpirationDate = createValidator(ONLY_EXPIRATION_DATE, ONLY_EXPIRATION_DATE_ERROR);
|
|
39294
|
+
|
|
39295
|
+
validatorFns[ONLY_EXPIRATION_DATE] = function (value, args, form) {
|
|
39296
|
+
return /^(\d?\d?\/?\d?\d?)?$/.test(value);
|
|
39297
|
+
};
|
|
39298
|
+
|
|
39299
|
+
var NUMBER_LESS_THAN = "validator/NUMBER_LESS_THAN";
|
|
39300
|
+
var NUMBER_LESS_THAN_ERROR = "error/NUMBER_LESS_THAN";
|
|
39301
|
+
var numberLessThan = createValidator(NUMBER_LESS_THAN, NUMBER_LESS_THAN_ERROR);
|
|
39302
|
+
|
|
39303
|
+
validatorFns[NUMBER_LESS_THAN] = function (value, args, form) {
|
|
38632
39304
|
if (value === "") {
|
|
38633
39305
|
return true;
|
|
38634
39306
|
}
|
|
39307
|
+
|
|
38635
39308
|
return Number(value) < args[0];
|
|
38636
39309
|
};
|
|
38637
39310
|
|
|
38638
|
-
|
|
38639
|
-
|
|
38640
|
-
|
|
38641
|
-
|
|
38642
|
-
|
|
38643
|
-
NUMBER_LESS_THAN_OR_EQUAL_TO,
|
|
38644
|
-
NUMBER_LESS_THAN_OR_EQUAL_TO_ERROR
|
|
38645
|
-
);
|
|
38646
|
-
validatorFns[NUMBER_LESS_THAN_OR_EQUAL_TO] = (value, args, form) => {
|
|
39311
|
+
var NUMBER_LESS_THAN_OR_EQUAL_TO = "validator/NUMBER_LESS_THAN_OR_EQUAL_TO";
|
|
39312
|
+
var NUMBER_LESS_THAN_OR_EQUAL_TO_ERROR = "error/NUMBER_LESS_THAN_OR_EQUAL_TO";
|
|
39313
|
+
var numberLessThanOrEqualTo = createValidator(NUMBER_LESS_THAN_OR_EQUAL_TO, NUMBER_LESS_THAN_OR_EQUAL_TO_ERROR);
|
|
39314
|
+
|
|
39315
|
+
validatorFns[NUMBER_LESS_THAN_OR_EQUAL_TO] = function (value, args, form) {
|
|
38647
39316
|
if (value === "") {
|
|
38648
39317
|
return true;
|
|
38649
39318
|
}
|
|
39319
|
+
|
|
38650
39320
|
return Number(value) <= args[0];
|
|
38651
39321
|
};
|
|
38652
39322
|
|
|
38653
|
-
|
|
38654
|
-
|
|
38655
|
-
|
|
38656
|
-
|
|
38657
|
-
|
|
38658
|
-
);
|
|
38659
|
-
validatorFns[NUMBER_GREATER_THAN] = (value, args, form) => {
|
|
39323
|
+
var NUMBER_GREATER_THAN = "validator/NUMBER_GREATER_THAN";
|
|
39324
|
+
var NUMBER_GREATER_THAN_ERROR = "error/NUMBER_GREATER_THAN";
|
|
39325
|
+
var numberGreaterThan = createValidator(NUMBER_GREATER_THAN, NUMBER_GREATER_THAN_ERROR);
|
|
39326
|
+
|
|
39327
|
+
validatorFns[NUMBER_GREATER_THAN] = function (value, args, form) {
|
|
38660
39328
|
if (value === "") {
|
|
38661
39329
|
return true;
|
|
38662
39330
|
}
|
|
39331
|
+
|
|
38663
39332
|
return Number(value) > args[0];
|
|
38664
39333
|
};
|
|
38665
39334
|
|
|
38666
|
-
|
|
38667
|
-
|
|
38668
|
-
|
|
38669
|
-
|
|
38670
|
-
|
|
38671
|
-
NUMBER_GREATER_THAN_OR_EQUAL_TO,
|
|
38672
|
-
NUMBER_GREATER_THAN_OR_EQUAL_TO_ERROR
|
|
38673
|
-
);
|
|
38674
|
-
validatorFns[NUMBER_GREATER_THAN_OR_EQUAL_TO] = (value, args, form) => {
|
|
39335
|
+
var NUMBER_GREATER_THAN_OR_EQUAL_TO = "validator/NUMBER_GREATER_THAN_OR_EQUAL_TO";
|
|
39336
|
+
var NUMBER_GREATER_THAN_OR_EQUAL_TO_ERROR = "error/NUMBER_GREATER_THAN_OR_EQUAL_TO";
|
|
39337
|
+
var numberGreaterThanOrEqualTo = createValidator(NUMBER_GREATER_THAN_OR_EQUAL_TO, NUMBER_GREATER_THAN_OR_EQUAL_TO_ERROR);
|
|
39338
|
+
|
|
39339
|
+
validatorFns[NUMBER_GREATER_THAN_OR_EQUAL_TO] = function (value, args, form) {
|
|
38675
39340
|
if (value === "") {
|
|
38676
39341
|
return true;
|
|
38677
39342
|
}
|
|
39343
|
+
|
|
38678
39344
|
return Number(value) >= args[0];
|
|
38679
39345
|
};
|
|
38680
39346
|
|
|
38681
|
-
|
|
38682
|
-
|
|
38683
|
-
|
|
38684
|
-
|
|
38685
|
-
|
|
39347
|
+
var MATCHES_FIELD = "validator/MATCHES_FIELD";
|
|
39348
|
+
var MATCHES_FIELD_ERROR$1 = "error/MATCHES_FIELD";
|
|
39349
|
+
var matchesField = createValidator(MATCHES_FIELD, MATCHES_FIELD_ERROR$1);
|
|
39350
|
+
|
|
39351
|
+
validatorFns[MATCHES_FIELD] = function (value, args, form) {
|
|
39352
|
+
var dependentField = form[args[0]];
|
|
39353
|
+
|
|
38686
39354
|
if (dependentField === undefined) {
|
|
38687
|
-
throw new Error(
|
|
38688
|
-
`${args[0]} was passed to matchesField, but that field does not exist in the form`
|
|
38689
|
-
);
|
|
39355
|
+
throw new Error("".concat(args[0], " was passed to matchesField, but that field does not exist in the form"));
|
|
38690
39356
|
}
|
|
38691
|
-
|
|
39357
|
+
|
|
39358
|
+
var dependentFieldValue = dependentField.rawValue;
|
|
38692
39359
|
return value === dependentFieldValue;
|
|
38693
39360
|
};
|
|
38694
39361
|
|
|
38695
|
-
|
|
38696
|
-
|
|
38697
|
-
|
|
38698
|
-
|
|
38699
|
-
|
|
38700
|
-
|
|
38701
|
-
|
|
38702
|
-
|
|
38703
|
-
|
|
38704
|
-
|
|
38705
|
-
|
|
38706
|
-
|
|
38707
|
-
|
|
38708
|
-
|
|
38709
|
-
|
|
38710
|
-
type: VALIDATE_WHEN,
|
|
38711
|
-
args: [dependentValidator, primaryValidator, optionalFieldName],
|
|
38712
|
-
error: dependentValidator.error
|
|
38713
|
-
});
|
|
39362
|
+
var validateWhenErrorMessage = function validateWhenErrorMessage(type) {
|
|
39363
|
+
return "".concat(type, " was passed to validateWhen, but that validator type does not exist.\n Please check that you are only calling validator creator functions exported from\n redux-freeform in your form config and that you didn't forget to\n invoke the validator creator (you cannot pass the functions themselves to\n createFormState). Also make sure you aren't passing validateWhen() to validateWhen\n as the primary validator.");
|
|
39364
|
+
};
|
|
39365
|
+
|
|
39366
|
+
var VALIDATE_WHEN = "validator/VALIDATE_WHEN";
|
|
39367
|
+
var VALIDATE_WHEN_ERROR = "error/VALIDATE_WHEN";
|
|
39368
|
+
|
|
39369
|
+
var validateWhen = function validateWhen(dependentValidator, primaryValidator, optionalFieldName) {
|
|
39370
|
+
return {
|
|
39371
|
+
type: VALIDATE_WHEN,
|
|
39372
|
+
args: [dependentValidator, primaryValidator, optionalFieldName],
|
|
39373
|
+
error: dependentValidator.error
|
|
39374
|
+
};
|
|
39375
|
+
};
|
|
39376
|
+
|
|
38714
39377
|
validateWhen.error = VALIDATE_WHEN_ERROR;
|
|
38715
|
-
|
|
38716
|
-
|
|
38717
|
-
|
|
38718
|
-
|
|
38719
|
-
|
|
38720
|
-
|
|
38721
|
-
|
|
38722
|
-
|
|
39378
|
+
|
|
39379
|
+
validatorFns[VALIDATE_WHEN] = function (value, args, form) {
|
|
39380
|
+
var _args = _slicedToArray(args, 3),
|
|
39381
|
+
dependentValidator = _args[0],
|
|
39382
|
+
primaryValidator = _args[1],
|
|
39383
|
+
optionalFieldName = _args[2];
|
|
39384
|
+
|
|
39385
|
+
var dependsOnOtherField = typeof optionalFieldName === "string";
|
|
39386
|
+
|
|
39387
|
+
if (primaryValidator.type === undefined || typeof validatorFns[primaryValidator.type] !== "function") {
|
|
38723
39388
|
throw new Error(validateWhenErrorMessage(primaryValidator.type));
|
|
38724
39389
|
}
|
|
39390
|
+
|
|
38725
39391
|
if (dependsOnOtherField && form[optionalFieldName] === undefined) {
|
|
38726
|
-
throw new Error(
|
|
38727
|
-
`${args[2]} was passed to matchesField, but that field does not exist in the form`
|
|
38728
|
-
);
|
|
39392
|
+
throw new Error("".concat(args[2], " was passed to matchesField, but that field does not exist in the form"));
|
|
38729
39393
|
}
|
|
38730
39394
|
|
|
38731
|
-
|
|
38732
|
-
|
|
38733
|
-
|
|
38734
|
-
);
|
|
38735
|
-
|
|
38736
|
-
|
|
38737
|
-
|
|
38738
|
-
|
|
38739
|
-
|
|
38740
|
-
|
|
38741
|
-
|
|
38742
|
-
|
|
38743
|
-
|
|
38744
|
-
|
|
38745
|
-
|
|
38746
|
-
|
|
38747
|
-
|
|
38748
|
-
|
|
38749
|
-
|
|
38750
|
-
|
|
38751
|
-
|
|
38752
|
-
|
|
38753
|
-
const validateSumErrorMessage = type =>
|
|
38754
|
-
`${type} was passed to validateSum, but that validator type does not exist.
|
|
38755
|
-
Please check that you are only calling validator creator functions exported from
|
|
38756
|
-
redux-freeform in your form config and that you didn't forget to
|
|
38757
|
-
invoke the validator creator (you cannot pass the functions themselves to
|
|
38758
|
-
createFormState).`;
|
|
38759
|
-
const VALIDATE_SUM = "validator/VALIDATE_SUM";
|
|
38760
|
-
const VALIDATE_SUM_ERROR = "error/VALIDATE_SUM";
|
|
38761
|
-
const validateSum = (validator, fieldNamesArray) => ({
|
|
38762
|
-
type: VALIDATE_SUM,
|
|
38763
|
-
args: [validator, fieldNamesArray],
|
|
38764
|
-
error: validator.error
|
|
38765
|
-
});
|
|
39395
|
+
var primaryPredicate = validatorToPredicate(validatorFns[primaryValidator.type], false);
|
|
39396
|
+
var primaryValue = dependsOnOtherField ? form[optionalFieldName].rawValue : value;
|
|
39397
|
+
var primaryPredicatePassed = primaryPredicate(primaryValue, primaryValidator.args, form);
|
|
39398
|
+
return primaryPredicatePassed ? validatorFns[dependentValidator.type](value, dependentValidator.args, form) : true;
|
|
39399
|
+
};
|
|
39400
|
+
|
|
39401
|
+
var validateSumErrorMessage = function validateSumErrorMessage(type) {
|
|
39402
|
+
return "".concat(type, " was passed to validateSum, but that validator type does not exist.\n Please check that you are only calling validator creator functions exported from\n redux-freeform in your form config and that you didn't forget to\n invoke the validator creator (you cannot pass the functions themselves to\n createFormState).");
|
|
39403
|
+
};
|
|
39404
|
+
|
|
39405
|
+
var VALIDATE_SUM = "validator/VALIDATE_SUM";
|
|
39406
|
+
var VALIDATE_SUM_ERROR = "error/VALIDATE_SUM";
|
|
39407
|
+
|
|
39408
|
+
var validateSum = function validateSum(validator, fieldNamesArray) {
|
|
39409
|
+
return {
|
|
39410
|
+
type: VALIDATE_SUM,
|
|
39411
|
+
args: [validator, fieldNamesArray],
|
|
39412
|
+
error: validator.error
|
|
39413
|
+
};
|
|
39414
|
+
};
|
|
39415
|
+
|
|
38766
39416
|
validateSum.error = VALIDATE_SUM_ERROR;
|
|
38767
|
-
validatorFns[VALIDATE_SUM] = (value, args, form) => {
|
|
38768
|
-
const [validator, fieldNamesArray] = args;
|
|
38769
39417
|
|
|
38770
|
-
|
|
38771
|
-
|
|
38772
|
-
|
|
38773
|
-
|
|
39418
|
+
validatorFns[VALIDATE_SUM] = function (value, args, form) {
|
|
39419
|
+
var _args2 = _slicedToArray(args, 2),
|
|
39420
|
+
validator = _args2[0],
|
|
39421
|
+
fieldNamesArray = _args2[1];
|
|
39422
|
+
|
|
39423
|
+
if (validator.type === undefined || typeof validatorFns[validator.type] !== "function") {
|
|
38774
39424
|
throw new Error(validateSumErrorMessage(validator.type));
|
|
38775
39425
|
}
|
|
38776
39426
|
|
|
38777
|
-
|
|
38778
|
-
|
|
38779
|
-
|
|
38780
|
-
|
|
38781
|
-
|
|
39427
|
+
var _iterator = _createForOfIteratorHelper(fieldNamesArray),
|
|
39428
|
+
_step;
|
|
39429
|
+
|
|
39430
|
+
try {
|
|
39431
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
39432
|
+
var fieldName = _step.value;
|
|
39433
|
+
|
|
39434
|
+
if (form[fieldName] === undefined) {
|
|
39435
|
+
throw new Error("".concat(fieldName, " was passed to matchesField, but that field does not exist in the form"));
|
|
39436
|
+
}
|
|
38782
39437
|
}
|
|
39438
|
+
} catch (err) {
|
|
39439
|
+
_iterator.e(err);
|
|
39440
|
+
} finally {
|
|
39441
|
+
_iterator.f();
|
|
38783
39442
|
}
|
|
38784
39443
|
|
|
38785
|
-
|
|
38786
|
-
|
|
38787
|
-
|
|
38788
|
-
);
|
|
38789
|
-
|
|
39444
|
+
var sum = fieldNamesArray.reduce(function (acc, curr) {
|
|
39445
|
+
return acc + Number(form[curr].rawValue);
|
|
39446
|
+
}, Number(value));
|
|
38790
39447
|
return validatorFns[validator.type](sum, validator.args, form);
|
|
38791
39448
|
};
|
|
38792
39449
|
|
|
38793
|
-
|
|
38794
|
-
|
|
38795
|
-
|
|
38796
|
-
|
|
39450
|
+
var HAS_LENGTH = "validator/HAS_LENGTH";
|
|
39451
|
+
var HAS_LENGTH_ERROR = "error/HAS_LENGTH";
|
|
39452
|
+
var hasLength = createValidator(HAS_LENGTH, HAS_LENGTH_ERROR);
|
|
39453
|
+
|
|
39454
|
+
validatorFns[HAS_LENGTH] = function (value, args, form) {
|
|
38797
39455
|
if (value === "") {
|
|
38798
39456
|
return true;
|
|
38799
39457
|
}
|
|
38800
|
-
|
|
38801
|
-
|
|
39458
|
+
|
|
39459
|
+
var min = args[0];
|
|
39460
|
+
var max = args[1];
|
|
39461
|
+
|
|
38802
39462
|
if (max == undefined || min == undefined) {
|
|
38803
|
-
throw new Error(
|
|
38804
|
-
"Max and min need to be defined for hasLength, both or one of them is undefined"
|
|
38805
|
-
);
|
|
39463
|
+
throw new Error("Max and min need to be defined for hasLength, both or one of them is undefined");
|
|
38806
39464
|
}
|
|
39465
|
+
|
|
38807
39466
|
if (max < min) {
|
|
38808
|
-
throw new Error(
|
|
38809
|
-
"hasLength validator was passed a min greater than the max"
|
|
38810
|
-
);
|
|
39467
|
+
throw new Error("hasLength validator was passed a min greater than the max");
|
|
38811
39468
|
}
|
|
38812
|
-
|
|
39469
|
+
|
|
39470
|
+
var valueLength = value.length;
|
|
38813
39471
|
return max >= valueLength && valueLength >= min;
|
|
38814
39472
|
};
|
|
38815
39473
|
|
|
38816
|
-
|
|
38817
|
-
|
|
38818
|
-
|
|
38819
|
-
|
|
38820
|
-
|
|
38821
|
-
);
|
|
38822
|
-
validatorFns[DATE_BEFORE_TODAY] = (value, args, form) => {
|
|
39474
|
+
var DATE_BEFORE_TODAY = "validator/DATE_BEFORE_TODAY";
|
|
39475
|
+
var DATE_BEFORE_TODAY_ERROR = "error/DATE_BEFORE_TODAY";
|
|
39476
|
+
var dateBeforeToday = createValidator(DATE_BEFORE_TODAY, DATE_BEFORE_TODAY_ERROR);
|
|
39477
|
+
|
|
39478
|
+
validatorFns[DATE_BEFORE_TODAY] = function (value, args, form) {
|
|
38823
39479
|
if (value === "") {
|
|
38824
39480
|
return true;
|
|
38825
39481
|
}
|
|
38826
|
-
|
|
38827
|
-
|
|
38828
|
-
|
|
39482
|
+
|
|
39483
|
+
var dateFormat = args[0];
|
|
39484
|
+
var unit = args[1];
|
|
39485
|
+
var inclusive = args[2] || false;
|
|
38829
39486
|
|
|
38830
39487
|
if (dateFormat == undefined || unit == undefined) {
|
|
38831
|
-
throw new Error(
|
|
38832
|
-
"Date format and unit need to be defined for dateBeforeToday, one or both are undefined"
|
|
38833
|
-
);
|
|
39488
|
+
throw new Error("Date format and unit need to be defined for dateBeforeToday, one or both are undefined");
|
|
38834
39489
|
}
|
|
38835
|
-
|
|
38836
|
-
|
|
39490
|
+
|
|
39491
|
+
var now = dayjs();
|
|
39492
|
+
var dateValue = dayjs(value, dateFormat);
|
|
38837
39493
|
|
|
38838
39494
|
if (inclusive === true) {
|
|
38839
39495
|
return dateValue.isSameOrBefore(now, unit);
|
|
38840
39496
|
}
|
|
39497
|
+
|
|
38841
39498
|
return dateValue.isBefore(now, unit);
|
|
38842
39499
|
};
|
|
38843
39500
|
|
|
38844
|
-
|
|
38845
|
-
|
|
38846
|
-
|
|
38847
|
-
|
|
38848
|
-
|
|
38849
|
-
);
|
|
38850
|
-
validatorFns[DATE_AFTER_TODAY] = (value, args, form) => {
|
|
39501
|
+
var DATE_AFTER_TODAY = "validator/DATE_AFTER_TODAY";
|
|
39502
|
+
var DATE_AFTER_TODAY_ERROR = "error/DATE_AFTER_TODAY";
|
|
39503
|
+
var dateAfterToday = createValidator(DATE_AFTER_TODAY, DATE_AFTER_TODAY_ERROR);
|
|
39504
|
+
|
|
39505
|
+
validatorFns[DATE_AFTER_TODAY] = function (value, args, form) {
|
|
38851
39506
|
if (value === "") {
|
|
38852
39507
|
return true;
|
|
38853
39508
|
}
|
|
38854
|
-
|
|
38855
|
-
|
|
38856
|
-
|
|
39509
|
+
|
|
39510
|
+
var dateFormat = args[0];
|
|
39511
|
+
var unit = args[1];
|
|
39512
|
+
var inclusive = args[2] || false;
|
|
38857
39513
|
|
|
38858
39514
|
if (dateFormat == undefined || unit == undefined) {
|
|
38859
|
-
throw new Error(
|
|
38860
|
-
"Date format and unit need to be defined for dateAfterToday, one or both are undefined"
|
|
38861
|
-
);
|
|
39515
|
+
throw new Error("Date format and unit need to be defined for dateAfterToday, one or both are undefined");
|
|
38862
39516
|
}
|
|
38863
|
-
|
|
38864
|
-
|
|
39517
|
+
|
|
39518
|
+
var now = dayjs();
|
|
39519
|
+
var dateValue = dayjs(value, dateFormat);
|
|
38865
39520
|
|
|
38866
39521
|
if (inclusive === true) {
|
|
38867
39522
|
return dateValue.isSameOrAfter(now, unit);
|
|
38868
39523
|
}
|
|
39524
|
+
|
|
38869
39525
|
return dateValue.isAfter(now, unit);
|
|
38870
39526
|
};
|
|
38871
39527
|
|
|
38872
|
-
|
|
38873
|
-
|
|
38874
|
-
|
|
38875
|
-
|
|
38876
|
-
|
|
38877
|
-
);
|
|
38878
|
-
validatorFns[IS_VALID_MONTH] = (value, args, form) => {
|
|
39528
|
+
var IS_VALID_MONTH = "validator/IS_VALID_MONTH";
|
|
39529
|
+
var IS_VALID_MONTH_ERROR = "error/IS_VALID_MONTH";
|
|
39530
|
+
var isValidMonth = createValidator(IS_VALID_MONTH, IS_VALID_MONTH_ERROR);
|
|
39531
|
+
|
|
39532
|
+
validatorFns[IS_VALID_MONTH] = function (value, args, form) {
|
|
38879
39533
|
if (value === "") {
|
|
38880
39534
|
return true;
|
|
38881
|
-
}
|
|
38882
|
-
// Function takes one argument representing the character position
|
|
39535
|
+
} // Function takes one argument representing the character position
|
|
38883
39536
|
// In a date string to identify where the month is
|
|
38884
39537
|
// Eg "10/21/2021" - start position is 0
|
|
38885
39538
|
// Or "18/03/1990" - start position is 3
|
|
38886
39539
|
// Only works with two digit months (01, 02, 03, etc)
|
|
38887
|
-
|
|
38888
|
-
|
|
38889
|
-
|
|
39540
|
+
|
|
39541
|
+
|
|
39542
|
+
var monthStartPosition = parseInt(args[0]);
|
|
39543
|
+
var monthEndPosition = monthStartPosition + 2;
|
|
39544
|
+
|
|
39545
|
+
if (isNaN(monthStartPosition)) {
|
|
38890
39546
|
throw new Error("Month start position has to be a valid integer string");
|
|
38891
39547
|
}
|
|
38892
|
-
|
|
38893
|
-
|
|
39548
|
+
|
|
39549
|
+
var month = parseInt(value.slice(monthStartPosition, monthEndPosition));
|
|
39550
|
+
|
|
39551
|
+
if (isNaN(month)) {
|
|
38894
39552
|
return false;
|
|
38895
39553
|
}
|
|
39554
|
+
|
|
38896
39555
|
return month >= 1 && month <= 12;
|
|
38897
39556
|
};
|
|
38898
39557
|
|
|
38899
|
-
|
|
38900
|
-
|
|
38901
|
-
|
|
38902
|
-
|
|
39558
|
+
var MATCHES_REGEX = "validator/MATCHES_REGEX";
|
|
39559
|
+
var MATCHES_REGEX_ERROR = "error/MATCHES_REGEX";
|
|
39560
|
+
var matchesRegex = createValidator(MATCHES_REGEX, MATCHES_REGEX_ERROR);
|
|
39561
|
+
|
|
39562
|
+
validatorFns[MATCHES_REGEX] = function (value, args, form) {
|
|
38903
39563
|
if (value === "") {
|
|
38904
39564
|
return true;
|
|
38905
39565
|
}
|
|
39566
|
+
|
|
38906
39567
|
return new RegExp(args[0]).test(value); // new RexExp never throws an error, no matter the input
|
|
38907
|
-
};
|
|
39568
|
+
}; // based on http://www.brainjar.com/js/validation/
|
|
38908
39569
|
|
|
38909
|
-
|
|
38910
|
-
|
|
38911
|
-
|
|
38912
|
-
|
|
38913
|
-
|
|
38914
|
-
|
|
38915
|
-
);
|
|
38916
|
-
validatorFns[IS_ROUTING_NUMBER] = (value, args, form) => {
|
|
39570
|
+
|
|
39571
|
+
var IS_ROUTING_NUMBER = "validator/IS_ROUTING_NUMBER";
|
|
39572
|
+
var IS_ROUTING_NUMBER_ERROR = "error/IS_ROUTING_NUMBER";
|
|
39573
|
+
var isRoutingNumber = createValidator(IS_ROUTING_NUMBER, IS_ROUTING_NUMBER_ERROR);
|
|
39574
|
+
|
|
39575
|
+
validatorFns[IS_ROUTING_NUMBER] = function (value, args, form) {
|
|
38917
39576
|
if (value === "") {
|
|
38918
39577
|
return true;
|
|
38919
39578
|
}
|
|
39579
|
+
|
|
38920
39580
|
if (value.length != 9) {
|
|
38921
39581
|
return false;
|
|
38922
39582
|
}
|
|
38923
|
-
|
|
38924
|
-
|
|
38925
|
-
|
|
38926
|
-
|
|
38927
|
-
|
|
38928
|
-
|
|
38929
|
-
|
|
38930
|
-
|
|
38931
|
-
|
|
38932
|
-
|
|
38933
|
-
|
|
38934
|
-
|
|
38935
|
-
|
|
39583
|
+
|
|
39584
|
+
var sum = value.split("").map(function (ch) {
|
|
39585
|
+
return parseInt(ch);
|
|
39586
|
+
}).reduce(function (acc, cur, idx) {
|
|
39587
|
+
switch (idx % 3) {
|
|
39588
|
+
case 0:
|
|
39589
|
+
return acc + 3 * cur;
|
|
39590
|
+
|
|
39591
|
+
case 1:
|
|
39592
|
+
return acc + 7 * cur;
|
|
39593
|
+
|
|
39594
|
+
case 2:
|
|
39595
|
+
return acc + 1 * cur;
|
|
39596
|
+
}
|
|
39597
|
+
}, 0);
|
|
38936
39598
|
return sum != 0 && sum % 10 == 0;
|
|
38937
39599
|
};
|
|
38938
39600
|
|
|
38939
|
-
|
|
38940
|
-
|
|
38941
|
-
|
|
38942
|
-
|
|
39601
|
+
var HAS_NUMBER = "validator/HAS_NUMBER";
|
|
39602
|
+
var HAS_NUMBER_ERROR$1 = "error/HAS_NUMBER";
|
|
39603
|
+
var hasNumber = createValidator(HAS_NUMBER, HAS_NUMBER_ERROR$1);
|
|
39604
|
+
|
|
39605
|
+
validatorFns[HAS_NUMBER] = function (value, args, form) {
|
|
38943
39606
|
if (value === "") {
|
|
38944
39607
|
return true;
|
|
38945
39608
|
}
|
|
39609
|
+
|
|
38946
39610
|
return new RegExp(/[0-9]/).test(value);
|
|
38947
39611
|
};
|
|
38948
39612
|
|
|
38949
|
-
|
|
38950
|
-
|
|
38951
|
-
|
|
38952
|
-
|
|
38953
|
-
|
|
38954
|
-
);
|
|
38955
|
-
validatorFns[HAS_LOWERCASE_LETTER] = (value, args, form) => {
|
|
39613
|
+
var HAS_LOWERCASE_LETTER = "validator/HAS_LOWERCASE_LETTER";
|
|
39614
|
+
var HAS_LOWERCASE_LETTER_ERROR$1 = "error/HAS_LOWERCASE_LETTER";
|
|
39615
|
+
var hasLowercaseLetter = createValidator(HAS_LOWERCASE_LETTER, HAS_LOWERCASE_LETTER_ERROR$1);
|
|
39616
|
+
|
|
39617
|
+
validatorFns[HAS_LOWERCASE_LETTER] = function (value, args, form) {
|
|
38956
39618
|
if (value === "") {
|
|
38957
39619
|
return true;
|
|
38958
39620
|
}
|
|
39621
|
+
|
|
38959
39622
|
return new RegExp(/[a-z]/).test(value);
|
|
38960
39623
|
};
|
|
38961
39624
|
|
|
38962
|
-
|
|
38963
|
-
|
|
38964
|
-
|
|
38965
|
-
|
|
38966
|
-
|
|
38967
|
-
);
|
|
38968
|
-
validatorFns[HAS_UPPERCASE_LETTER] = (value, args, form) => {
|
|
39625
|
+
var HAS_UPPERCASE_LETTER = "validator/HAS_UPPERCASE_LETTER";
|
|
39626
|
+
var HAS_UPPERCASE_LETTER_ERROR$1 = "error/HAS_UPPERCASE_LETTER";
|
|
39627
|
+
var hasUppercaseLetter = createValidator(HAS_UPPERCASE_LETTER, HAS_UPPERCASE_LETTER_ERROR$1);
|
|
39628
|
+
|
|
39629
|
+
validatorFns[HAS_UPPERCASE_LETTER] = function (value, args, form) {
|
|
38969
39630
|
if (value === "") {
|
|
38970
39631
|
return true;
|
|
38971
39632
|
}
|
|
39633
|
+
|
|
38972
39634
|
return new RegExp(/[A-Z]/).test(value);
|
|
38973
39635
|
};
|
|
38974
39636
|
|
|
38975
|
-
|
|
38976
|
-
|
|
38977
|
-
|
|
38978
|
-
|
|
38979
|
-
|
|
38980
|
-
);
|
|
38981
|
-
validatorFns[HAS_SPECIAL_CHARACTER] = (value, args, form) => {
|
|
39637
|
+
var HAS_SPECIAL_CHARACTER = "validator/HAS_SPECIAL_CHARACTER";
|
|
39638
|
+
var HAS_SPECIAL_CHARACTER_ERROR$1 = "error/HAS_SPECIAL_CHARACTER";
|
|
39639
|
+
var hasSpecialCharacter = createValidator(HAS_SPECIAL_CHARACTER, HAS_SPECIAL_CHARACTER_ERROR$1);
|
|
39640
|
+
|
|
39641
|
+
validatorFns[HAS_SPECIAL_CHARACTER] = function (value, args, form) {
|
|
38982
39642
|
if (value === "") {
|
|
38983
39643
|
return true;
|
|
38984
39644
|
}
|
|
39645
|
+
|
|
38985
39646
|
return new RegExp(/[!@#$%^&*.?]/).test(value);
|
|
38986
39647
|
};
|
|
38987
39648
|
|
|
38988
|
-
|
|
38989
|
-
|
|
38990
|
-
|
|
38991
|
-
|
|
38992
|
-
|
|
38993
|
-
);
|
|
38994
|
-
validatorFns[IS_PROBABLY_EMAIL] = (value, args, form) => {
|
|
39649
|
+
var IS_PROBABLY_EMAIL = "validator/IS_PROBABLY_EMAIL";
|
|
39650
|
+
var IS_PROBABLY_EMAIL_ERROR = "error/IS_PROBABLY_EMAIL";
|
|
39651
|
+
var isProbablyEmail = createValidator(IS_PROBABLY_EMAIL, IS_PROBABLY_EMAIL_ERROR);
|
|
39652
|
+
|
|
39653
|
+
validatorFns[IS_PROBABLY_EMAIL] = function (value, args, form) {
|
|
38995
39654
|
if (value === "") {
|
|
38996
39655
|
return true;
|
|
38997
39656
|
}
|
|
39657
|
+
|
|
38998
39658
|
return new RegExp(/^\S+@\S+\.\S+$/).test(value);
|
|
38999
39659
|
};
|
|
39000
39660
|
|
|
39001
|
-
|
|
39002
|
-
|
|
39003
|
-
|
|
39004
|
-
|
|
39005
|
-
|
|
39006
|
-
|
|
39661
|
+
var runValidatorErrorMessage = function runValidatorErrorMessage(type) {
|
|
39662
|
+
return "".concat(type, " was passed to runValidator, but that validator type does not exist. \n Please check that you are only calling validator creator functions exported from \n redux-freeform in your form config and that you didn't forget to \n invoke the validator creator (you cannot pass the functions themselves to \n createFormState)");
|
|
39663
|
+
};
|
|
39664
|
+
|
|
39665
|
+
var runValidator = function runValidator(validator, value, form) {
|
|
39666
|
+
var validatorFn = validatorFns[validator.type];
|
|
39007
39667
|
|
|
39008
|
-
const runValidator = (validator, value, form) => {
|
|
39009
|
-
const validatorFn = validatorFns[validator.type];
|
|
39010
39668
|
if (validatorFn === undefined) {
|
|
39011
39669
|
throw new Error(runValidatorErrorMessage(validator.type));
|
|
39012
39670
|
}
|
|
39671
|
+
|
|
39013
39672
|
return validatorFn(value, validator.args, form) ? null : validator.error;
|
|
39014
39673
|
};
|
|
39015
39674
|
|
|
39016
|
-
|
|
39017
|
-
return validators
|
|
39018
|
-
|
|
39019
|
-
|
|
39675
|
+
var runFormValidators = function runFormValidators(fieldName, form, validators) {
|
|
39676
|
+
return validators.map(function (v) {
|
|
39677
|
+
return runValidator(v, form[fieldName].rawValue, form);
|
|
39678
|
+
}).filter(function (x) {
|
|
39679
|
+
return x !== null;
|
|
39680
|
+
});
|
|
39681
|
+
};
|
|
39682
|
+
|
|
39683
|
+
var computeConstraints = function computeConstraints(fieldName, form) {
|
|
39684
|
+
var constraints = form[fieldName].constraints;
|
|
39685
|
+
return runFormValidators(fieldName, form, constraints);
|
|
39686
|
+
};
|
|
39687
|
+
|
|
39688
|
+
var computeErrors = function computeErrors(fieldName, form) {
|
|
39689
|
+
var validators = form[fieldName].validators;
|
|
39690
|
+
return runFormValidators(fieldName, form, validators);
|
|
39020
39691
|
};
|
|
39021
39692
|
|
|
39022
|
-
|
|
39023
|
-
|
|
39024
|
-
|
|
39693
|
+
var computeErrorEntries = function computeErrorEntries(formState) {
|
|
39694
|
+
var fields = Object.entries(formState);
|
|
39695
|
+
|
|
39696
|
+
for (var _i = 0, _fields = fields; _i < _fields.length; _i++) {
|
|
39697
|
+
var entry = _fields[_i];
|
|
39698
|
+
var fieldName = entry[0];
|
|
39699
|
+
var errors = computeErrors(fieldName, formState);
|
|
39700
|
+
formState[fieldName].errors = errors;
|
|
39701
|
+
formState[fieldName].hasErrors = errors.length > 0;
|
|
39702
|
+
}
|
|
39025
39703
|
};
|
|
39026
39704
|
|
|
39027
|
-
|
|
39028
|
-
|
|
39029
|
-
|
|
39705
|
+
var computeDirtyEntries = function computeDirtyEntries(formState, changedFieldName) {
|
|
39706
|
+
var fields = Object.entries(formState);
|
|
39707
|
+
|
|
39708
|
+
for (var _i2 = 0, _fields2 = fields; _i2 < _fields2.length; _i2++) {
|
|
39709
|
+
var entry = _fields2[_i2];
|
|
39710
|
+
var fieldName = entry[0];
|
|
39711
|
+
var field = entry[1];
|
|
39712
|
+
var dirty = fieldName === changedFieldName ? true : field.dirty;
|
|
39713
|
+
formState[fieldName].dirty = dirty;
|
|
39714
|
+
}
|
|
39030
39715
|
};
|
|
39031
39716
|
|
|
39032
39717
|
var obj;
|
|
39033
|
-
var NOTHING = typeof Symbol !== "undefined" ? Symbol("immer-nothing") : (
|
|
39034
|
-
var DRAFTABLE = typeof Symbol !== "undefined" && Symbol
|
|
39035
|
-
var DRAFT_STATE = typeof Symbol !== "undefined" && Symbol
|
|
39718
|
+
var NOTHING = typeof Symbol !== "undefined" ? Symbol("immer-nothing") : (obj = {}, obj["immer-nothing"] = true, obj);
|
|
39719
|
+
var DRAFTABLE = typeof Symbol !== "undefined" && Symbol["for"] ? Symbol["for"]("immer-draftable") : "__$immer_draftable";
|
|
39720
|
+
var DRAFT_STATE = typeof Symbol !== "undefined" && Symbol["for"] ? Symbol["for"]("immer-state") : "__$immer_state";
|
|
39721
|
+
|
|
39036
39722
|
function isDraft(value) {
|
|
39037
39723
|
return !!value && !!value[DRAFT_STATE];
|
|
39038
39724
|
}
|
|
39725
|
+
|
|
39039
39726
|
function isDraftable(value) {
|
|
39040
|
-
if (!value) {
|
|
39727
|
+
if (!value) {
|
|
39728
|
+
return false;
|
|
39729
|
+
}
|
|
39730
|
+
|
|
39041
39731
|
return isPlainObject(value) || !!value[DRAFTABLE] || !!value.constructor[DRAFTABLE];
|
|
39042
39732
|
}
|
|
39733
|
+
|
|
39043
39734
|
function isPlainObject(value) {
|
|
39044
|
-
if (!value ||
|
|
39045
|
-
|
|
39735
|
+
if (!value || _typeof(value) !== "object") {
|
|
39736
|
+
return false;
|
|
39737
|
+
}
|
|
39738
|
+
|
|
39739
|
+
if (Array.isArray(value)) {
|
|
39740
|
+
return true;
|
|
39741
|
+
}
|
|
39742
|
+
|
|
39046
39743
|
var proto = Object.getPrototypeOf(value);
|
|
39047
39744
|
return !proto || proto === Object.prototype;
|
|
39048
39745
|
}
|
|
39746
|
+
|
|
39049
39747
|
var assign = Object.assign || function assign(target, value) {
|
|
39050
39748
|
for (var key in value) {
|
|
39051
39749
|
if (has$1(value, key)) {
|
|
@@ -39055,11 +39753,18 @@ var assign = Object.assign || function assign(target, value) {
|
|
|
39055
39753
|
|
|
39056
39754
|
return target;
|
|
39057
39755
|
};
|
|
39058
|
-
|
|
39756
|
+
|
|
39757
|
+
var ownKeys$2 = typeof Reflect !== "undefined" && Reflect.ownKeys ? Reflect.ownKeys : typeof Object.getOwnPropertySymbols !== "undefined" ? function (obj) {
|
|
39758
|
+
return Object.getOwnPropertyNames(obj).concat(Object.getOwnPropertySymbols(obj));
|
|
39759
|
+
} : Object.getOwnPropertyNames;
|
|
39760
|
+
|
|
39059
39761
|
function shallowCopy(base, invokeGetters) {
|
|
39060
|
-
if (
|
|
39762
|
+
if (invokeGetters === void 0) invokeGetters = false;
|
|
39763
|
+
|
|
39764
|
+
if (Array.isArray(base)) {
|
|
39765
|
+
return base.slice();
|
|
39766
|
+
}
|
|
39061
39767
|
|
|
39062
|
-
if (Array.isArray(base)) { return base.slice(); }
|
|
39063
39768
|
var clone = Object.create(Object.getPrototypeOf(base));
|
|
39064
39769
|
ownKeys$2(base).forEach(function (key) {
|
|
39065
39770
|
if (key === DRAFT_STATE) {
|
|
@@ -39089,20 +39794,28 @@ function shallowCopy(base, invokeGetters) {
|
|
|
39089
39794
|
});
|
|
39090
39795
|
return clone;
|
|
39091
39796
|
}
|
|
39797
|
+
|
|
39092
39798
|
function each(value, cb) {
|
|
39093
39799
|
if (Array.isArray(value)) {
|
|
39094
|
-
for (var i = 0; i < value.length; i++) {
|
|
39800
|
+
for (var i = 0; i < value.length; i++) {
|
|
39801
|
+
cb(i, value[i], value);
|
|
39802
|
+
}
|
|
39095
39803
|
} else {
|
|
39096
|
-
ownKeys$2(value).forEach(function (key) {
|
|
39804
|
+
ownKeys$2(value).forEach(function (key) {
|
|
39805
|
+
return cb(key, value[key], value);
|
|
39806
|
+
});
|
|
39097
39807
|
}
|
|
39098
39808
|
}
|
|
39809
|
+
|
|
39099
39810
|
function isEnumerable(base, prop) {
|
|
39100
39811
|
var desc = Object.getOwnPropertyDescriptor(base, prop);
|
|
39101
39812
|
return !!desc && desc.enumerable;
|
|
39102
39813
|
}
|
|
39814
|
+
|
|
39103
39815
|
function has$1(thing, prop) {
|
|
39104
39816
|
return Object.prototype.hasOwnProperty.call(thing, prop);
|
|
39105
39817
|
}
|
|
39818
|
+
|
|
39106
39819
|
function is(x, y) {
|
|
39107
39820
|
// From: https://github.com/facebook/fbjs/blob/c69904a511b900266935168223063dd8772dfc40/packages/fbjs/src/core/shallowEqual.js
|
|
39108
39821
|
if (x === y) {
|
|
@@ -39111,18 +39824,27 @@ function is(x, y) {
|
|
|
39111
39824
|
return x !== x && y !== y;
|
|
39112
39825
|
}
|
|
39113
39826
|
}
|
|
39827
|
+
|
|
39114
39828
|
function clone(obj) {
|
|
39115
|
-
if (!isDraftable(obj)) {
|
|
39116
|
-
|
|
39829
|
+
if (!isDraftable(obj)) {
|
|
39830
|
+
return obj;
|
|
39831
|
+
}
|
|
39832
|
+
|
|
39833
|
+
if (Array.isArray(obj)) {
|
|
39834
|
+
return obj.map(clone);
|
|
39835
|
+
}
|
|
39836
|
+
|
|
39117
39837
|
var cloned = Object.create(Object.getPrototypeOf(obj));
|
|
39118
39838
|
|
|
39119
|
-
for (var key in obj) {
|
|
39839
|
+
for (var key in obj) {
|
|
39840
|
+
cloned[key] = clone(obj[key]);
|
|
39841
|
+
}
|
|
39120
39842
|
|
|
39121
39843
|
return cloned;
|
|
39122
39844
|
}
|
|
39123
|
-
|
|
39124
39845
|
/** Each scope represents a `produce` call. */
|
|
39125
39846
|
|
|
39847
|
+
|
|
39126
39848
|
var ImmerScope = function ImmerScope(parent) {
|
|
39127
39849
|
this.drafts = [];
|
|
39128
39850
|
this.parent = parent; // Whenever the modified draft contains a draft from another scope, we
|
|
@@ -39133,7 +39855,7 @@ var ImmerScope = function ImmerScope(parent) {
|
|
|
39133
39855
|
this.patches = null;
|
|
39134
39856
|
};
|
|
39135
39857
|
|
|
39136
|
-
ImmerScope.prototype.usePatches = function usePatches
|
|
39858
|
+
ImmerScope.prototype.usePatches = function usePatches(patchListener) {
|
|
39137
39859
|
if (patchListener) {
|
|
39138
39860
|
this.patches = [];
|
|
39139
39861
|
this.inversePatches = [];
|
|
@@ -39141,17 +39863,18 @@ ImmerScope.prototype.usePatches = function usePatches (patchListener) {
|
|
|
39141
39863
|
}
|
|
39142
39864
|
};
|
|
39143
39865
|
|
|
39144
|
-
ImmerScope.prototype.revoke = function revoke$1
|
|
39866
|
+
ImmerScope.prototype.revoke = function revoke$1() {
|
|
39145
39867
|
this.leave();
|
|
39146
39868
|
this.drafts.forEach(revoke);
|
|
39147
39869
|
this.drafts = null; // Make draft-related methods throw.
|
|
39148
39870
|
};
|
|
39149
39871
|
|
|
39150
|
-
ImmerScope.prototype.leave = function leave
|
|
39872
|
+
ImmerScope.prototype.leave = function leave() {
|
|
39151
39873
|
if (this === ImmerScope.current) {
|
|
39152
39874
|
ImmerScope.current = this.parent;
|
|
39153
39875
|
}
|
|
39154
39876
|
};
|
|
39877
|
+
|
|
39155
39878
|
ImmerScope.current = null;
|
|
39156
39879
|
|
|
39157
39880
|
ImmerScope.enter = function () {
|
|
@@ -39160,11 +39883,11 @@ ImmerScope.enter = function () {
|
|
|
39160
39883
|
|
|
39161
39884
|
function revoke(draft) {
|
|
39162
39885
|
draft[DRAFT_STATE].revoke();
|
|
39163
|
-
}
|
|
39886
|
+
} // but share them all instead
|
|
39164
39887
|
|
|
39165
|
-
// but share them all instead
|
|
39166
39888
|
|
|
39167
39889
|
var descriptors$1 = {};
|
|
39890
|
+
|
|
39168
39891
|
function willFinalize(scope, result, isReplaced) {
|
|
39169
39892
|
scope.drafts.forEach(function (draft) {
|
|
39170
39893
|
draft[DRAFT_STATE].finalizing = true;
|
|
@@ -39179,9 +39902,10 @@ function willFinalize(scope, result, isReplaced) {
|
|
|
39179
39902
|
markChangesSweep(scope.drafts);
|
|
39180
39903
|
} // When a child draft is returned, look for changes.
|
|
39181
39904
|
else if (isDraft(result) && result[DRAFT_STATE].scope === scope) {
|
|
39182
|
-
|
|
39183
|
-
|
|
39905
|
+
markChangesSweep(scope.drafts);
|
|
39906
|
+
}
|
|
39184
39907
|
}
|
|
39908
|
+
|
|
39185
39909
|
function createProxy(base, parent) {
|
|
39186
39910
|
var isArray = Array.isArray(base);
|
|
39187
39911
|
var draft = clonePotentialDraft(base);
|
|
@@ -39235,7 +39959,11 @@ function peek(draft, prop) {
|
|
|
39235
39959
|
function get$1(state, prop) {
|
|
39236
39960
|
assertUnrevoked(state);
|
|
39237
39961
|
var value = peek(source(state), prop);
|
|
39238
|
-
|
|
39962
|
+
|
|
39963
|
+
if (state.finalizing) {
|
|
39964
|
+
return value;
|
|
39965
|
+
} // Create a draft if the value is unmodified.
|
|
39966
|
+
|
|
39239
39967
|
|
|
39240
39968
|
if (value === peek(state.base, prop) && isDraftable(value)) {
|
|
39241
39969
|
prepareCopy(state);
|
|
@@ -39250,7 +39978,10 @@ function set$1(state, prop, value) {
|
|
|
39250
39978
|
state.assigned[prop] = true;
|
|
39251
39979
|
|
|
39252
39980
|
if (!state.modified) {
|
|
39253
|
-
if (is(value, peek(source(state), prop))) {
|
|
39981
|
+
if (is(value, peek(source(state), prop))) {
|
|
39982
|
+
return;
|
|
39983
|
+
}
|
|
39984
|
+
|
|
39254
39985
|
markChanged(state);
|
|
39255
39986
|
prepareCopy(state);
|
|
39256
39987
|
}
|
|
@@ -39261,12 +39992,17 @@ function set$1(state, prop, value) {
|
|
|
39261
39992
|
function markChanged(state) {
|
|
39262
39993
|
if (!state.modified) {
|
|
39263
39994
|
state.modified = true;
|
|
39264
|
-
|
|
39995
|
+
|
|
39996
|
+
if (state.parent) {
|
|
39997
|
+
markChanged(state.parent);
|
|
39998
|
+
}
|
|
39265
39999
|
}
|
|
39266
40000
|
}
|
|
39267
40001
|
|
|
39268
40002
|
function prepareCopy(state) {
|
|
39269
|
-
if (!state.copy) {
|
|
40003
|
+
if (!state.copy) {
|
|
40004
|
+
state.copy = clonePotentialDraft(state.base);
|
|
40005
|
+
}
|
|
39270
40006
|
}
|
|
39271
40007
|
|
|
39272
40008
|
function clonePotentialDraft(base) {
|
|
@@ -39291,15 +40027,12 @@ function proxyProperty(draft, prop, enumerable) {
|
|
|
39291
40027
|
descriptors$1[prop] = desc = {
|
|
39292
40028
|
configurable: true,
|
|
39293
40029
|
enumerable: enumerable,
|
|
39294
|
-
|
|
39295
40030
|
get: function get$1$1() {
|
|
39296
40031
|
return get$1(this[DRAFT_STATE], prop);
|
|
39297
40032
|
},
|
|
39298
|
-
|
|
39299
40033
|
set: function set$1$1(value) {
|
|
39300
40034
|
set$1(this[DRAFT_STATE], prop, value);
|
|
39301
40035
|
}
|
|
39302
|
-
|
|
39303
40036
|
};
|
|
39304
40037
|
}
|
|
39305
40038
|
|
|
@@ -39307,7 +40040,9 @@ function proxyProperty(draft, prop, enumerable) {
|
|
|
39307
40040
|
}
|
|
39308
40041
|
|
|
39309
40042
|
function assertUnrevoked(state) {
|
|
39310
|
-
if (state.revoked === true) {
|
|
40043
|
+
if (state.revoked === true) {
|
|
40044
|
+
throw new Error("Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? " + JSON.stringify(source(state)));
|
|
40045
|
+
}
|
|
39311
40046
|
} // This looks expensive, but only proxies are visited, and only objects without known changes are scanned.
|
|
39312
40047
|
|
|
39313
40048
|
|
|
@@ -39321,16 +40056,27 @@ function markChangesSweep(drafts) {
|
|
|
39321
40056
|
|
|
39322
40057
|
if (!state.modified) {
|
|
39323
40058
|
if (Array.isArray(state.base)) {
|
|
39324
|
-
if (hasArrayChanges(state)) {
|
|
39325
|
-
|
|
40059
|
+
if (hasArrayChanges(state)) {
|
|
40060
|
+
markChanged(state);
|
|
40061
|
+
}
|
|
40062
|
+
} else if (hasObjectChanges(state)) {
|
|
40063
|
+
markChanged(state);
|
|
40064
|
+
}
|
|
39326
40065
|
}
|
|
39327
40066
|
}
|
|
39328
40067
|
}
|
|
39329
40068
|
|
|
39330
40069
|
function markChangesRecursively(object) {
|
|
39331
|
-
if (!object ||
|
|
40070
|
+
if (!object || _typeof(object) !== "object") {
|
|
40071
|
+
return;
|
|
40072
|
+
}
|
|
40073
|
+
|
|
39332
40074
|
var state = object[DRAFT_STATE];
|
|
39333
|
-
|
|
40075
|
+
|
|
40076
|
+
if (!state) {
|
|
40077
|
+
return;
|
|
40078
|
+
}
|
|
40079
|
+
|
|
39334
40080
|
var base = state.base;
|
|
39335
40081
|
var draft = state.draft;
|
|
39336
40082
|
var assigned = state.assigned;
|
|
@@ -39360,14 +40106,20 @@ function markChangesRecursively(object) {
|
|
|
39360
40106
|
assigned.length = true;
|
|
39361
40107
|
|
|
39362
40108
|
if (draft.length < base.length) {
|
|
39363
|
-
for (var i = draft.length; i < base.length; i++) {
|
|
40109
|
+
for (var i = draft.length; i < base.length; i++) {
|
|
40110
|
+
assigned[i] = false;
|
|
40111
|
+
}
|
|
39364
40112
|
} else {
|
|
39365
|
-
for (var i$1 = base.length; i$1 < draft.length; i$1++) {
|
|
40113
|
+
for (var i$1 = base.length; i$1 < draft.length; i$1++) {
|
|
40114
|
+
assigned[i$1] = true;
|
|
40115
|
+
}
|
|
39366
40116
|
}
|
|
39367
40117
|
|
|
39368
40118
|
for (var i$2 = 0; i$2 < draft.length; i$2++) {
|
|
39369
40119
|
// Only untouched indices trigger recursion.
|
|
39370
|
-
if (assigned[i$2] === undefined) {
|
|
40120
|
+
if (assigned[i$2] === undefined) {
|
|
40121
|
+
markChangesRecursively(draft[i$2]);
|
|
40122
|
+
}
|
|
39371
40123
|
}
|
|
39372
40124
|
}
|
|
39373
40125
|
}
|
|
@@ -39388,13 +40140,13 @@ function hasObjectChanges(state) {
|
|
|
39388
40140
|
} // Once a base key is deleted, future changes go undetected, because its
|
|
39389
40141
|
// descriptor is erased. This branch detects any missed changes.
|
|
39390
40142
|
else {
|
|
39391
|
-
|
|
39392
|
-
|
|
40143
|
+
var value = draft[key];
|
|
40144
|
+
var state$1 = value && value[DRAFT_STATE];
|
|
39393
40145
|
|
|
39394
|
-
|
|
39395
|
-
|
|
39396
|
-
}
|
|
40146
|
+
if (state$1 ? state$1.base !== baseValue : !is(value, baseValue)) {
|
|
40147
|
+
return true;
|
|
39397
40148
|
}
|
|
40149
|
+
}
|
|
39398
40150
|
} // At this point, no keys were added or changed.
|
|
39399
40151
|
// Compare key count to determine if keys were deleted.
|
|
39400
40152
|
|
|
@@ -39404,7 +40156,10 @@ function hasObjectChanges(state) {
|
|
|
39404
40156
|
|
|
39405
40157
|
function hasArrayChanges(state) {
|
|
39406
40158
|
var draft = state.draft;
|
|
39407
|
-
|
|
40159
|
+
|
|
40160
|
+
if (draft.length !== state.base.length) {
|
|
40161
|
+
return true;
|
|
40162
|
+
} // See #116
|
|
39408
40163
|
// If we first shorten the length, our array interceptors will be removed.
|
|
39409
40164
|
// If after that new items are added, result in the same original length,
|
|
39410
40165
|
// those last items will have no intercepting property.
|
|
@@ -39412,9 +40167,13 @@ function hasArrayChanges(state) {
|
|
|
39412
40167
|
// N.B.: splice, unshift, etc only shift values around, but not prop descriptors, so we only have to check
|
|
39413
40168
|
// the last one
|
|
39414
40169
|
|
|
40170
|
+
|
|
39415
40171
|
var descriptor = Object.getOwnPropertyDescriptor(draft, draft.length - 1); // descriptor can be null, but only for newly created sparse arrays, eg. new Array(10)
|
|
39416
40172
|
|
|
39417
|
-
if (descriptor && !descriptor.get) {
|
|
40173
|
+
if (descriptor && !descriptor.get) {
|
|
40174
|
+
return true;
|
|
40175
|
+
} // For all other cases, we don't have to compare, as they would have been picked up by the index setters
|
|
40176
|
+
|
|
39418
40177
|
|
|
39419
40178
|
return false;
|
|
39420
40179
|
}
|
|
@@ -39428,11 +40187,12 @@ function createHiddenProperty(target, prop, value) {
|
|
|
39428
40187
|
}
|
|
39429
40188
|
|
|
39430
40189
|
var legacyProxy = /*#__PURE__*/Object.freeze({
|
|
39431
|
-
|
|
39432
|
-
|
|
40190
|
+
willFinalize: willFinalize,
|
|
40191
|
+
createProxy: createProxy
|
|
39433
40192
|
});
|
|
39434
40193
|
|
|
39435
40194
|
function willFinalize$1() {}
|
|
40195
|
+
|
|
39436
40196
|
function createProxy$1(base, parent) {
|
|
39437
40197
|
var scope = parent ? parent.scope : ImmerScope.current;
|
|
39438
40198
|
var state = {
|
|
@@ -39467,33 +40227,27 @@ function createProxy$1(base, parent) {
|
|
|
39467
40227
|
scope.drafts.push(proxy);
|
|
39468
40228
|
return proxy;
|
|
39469
40229
|
}
|
|
40230
|
+
|
|
39470
40231
|
var objectTraps = {
|
|
39471
40232
|
get: get$1$1,
|
|
39472
|
-
|
|
39473
40233
|
has: function has(target, prop) {
|
|
39474
40234
|
return prop in source$1(target);
|
|
39475
40235
|
},
|
|
39476
|
-
|
|
39477
40236
|
ownKeys: function ownKeys(target) {
|
|
39478
40237
|
return Reflect.ownKeys(source$1(target));
|
|
39479
40238
|
},
|
|
39480
|
-
|
|
39481
40239
|
set: set$1$1,
|
|
39482
40240
|
deleteProperty: deleteProperty,
|
|
39483
40241
|
getOwnPropertyDescriptor: getOwnPropertyDescriptor$2,
|
|
39484
|
-
|
|
39485
40242
|
defineProperty: function defineProperty() {
|
|
39486
40243
|
throw new Error("Object.defineProperty() cannot be used on an Immer draft"); // prettier-ignore
|
|
39487
40244
|
},
|
|
39488
|
-
|
|
39489
40245
|
getPrototypeOf: function getPrototypeOf(target) {
|
|
39490
40246
|
return Object.getPrototypeOf(target.base);
|
|
39491
40247
|
},
|
|
39492
|
-
|
|
39493
40248
|
setPrototypeOf: function setPrototypeOf() {
|
|
39494
40249
|
throw new Error("Object.setPrototypeOf() cannot be used on an Immer draft"); // prettier-ignore
|
|
39495
40250
|
}
|
|
39496
|
-
|
|
39497
40251
|
};
|
|
39498
40252
|
var arrayTraps = {};
|
|
39499
40253
|
each(objectTraps, function (key, fn) {
|
|
@@ -39532,7 +40286,10 @@ function peek$1(draft, prop) {
|
|
|
39532
40286
|
}
|
|
39533
40287
|
|
|
39534
40288
|
function get$1$1(state, prop) {
|
|
39535
|
-
if (prop === DRAFT_STATE) {
|
|
40289
|
+
if (prop === DRAFT_STATE) {
|
|
40290
|
+
return state;
|
|
40291
|
+
}
|
|
40292
|
+
|
|
39536
40293
|
var drafts = state.drafts; // Check for existing draft in unmodified state.
|
|
39537
40294
|
|
|
39538
40295
|
if (!state.modified && has$1(drafts, prop)) {
|
|
@@ -39548,7 +40305,10 @@ function get$1$1(state, prop) {
|
|
|
39548
40305
|
|
|
39549
40306
|
if (state.modified) {
|
|
39550
40307
|
// Assigned values are never drafted. This catches any drafts we created, too.
|
|
39551
|
-
if (value !== peek$1(state.base, prop)) {
|
|
40308
|
+
if (value !== peek$1(state.base, prop)) {
|
|
40309
|
+
return value;
|
|
40310
|
+
} // Store drafts on the copy (when one exists).
|
|
40311
|
+
|
|
39552
40312
|
|
|
39553
40313
|
drafts = state.copy;
|
|
39554
40314
|
}
|
|
@@ -39563,7 +40323,11 @@ function set$1$1(state, prop, value) {
|
|
|
39563
40323
|
// values may be drafts, but falsy values are never drafts.
|
|
39564
40324
|
|
|
39565
40325
|
var isUnchanged = value ? is(baseValue, value) || value === state.drafts[prop] : is(baseValue, value) && prop in state.base;
|
|
39566
|
-
|
|
40326
|
+
|
|
40327
|
+
if (isUnchanged) {
|
|
40328
|
+
return true;
|
|
40329
|
+
}
|
|
40330
|
+
|
|
39567
40331
|
markChanged$1(state);
|
|
39568
40332
|
}
|
|
39569
40333
|
|
|
@@ -39582,7 +40346,10 @@ function deleteProperty(state, prop) {
|
|
|
39582
40346
|
delete state.assigned[prop];
|
|
39583
40347
|
}
|
|
39584
40348
|
|
|
39585
|
-
if (state.copy) {
|
|
40349
|
+
if (state.copy) {
|
|
40350
|
+
delete state.copy[prop];
|
|
40351
|
+
}
|
|
40352
|
+
|
|
39586
40353
|
return true;
|
|
39587
40354
|
} // Note: We never coerce `desc.value` into an Immer draft, because we can't make
|
|
39588
40355
|
// the same guarantee in ES5 mode.
|
|
@@ -39605,13 +40372,16 @@ function markChanged$1(state) {
|
|
|
39605
40372
|
state.modified = true;
|
|
39606
40373
|
state.copy = assign(shallowCopy(state.base), state.drafts);
|
|
39607
40374
|
state.drafts = null;
|
|
39608
|
-
|
|
40375
|
+
|
|
40376
|
+
if (state.parent) {
|
|
40377
|
+
markChanged$1(state.parent);
|
|
40378
|
+
}
|
|
39609
40379
|
}
|
|
39610
40380
|
}
|
|
39611
40381
|
|
|
39612
40382
|
var modernProxy = /*#__PURE__*/Object.freeze({
|
|
39613
|
-
|
|
39614
|
-
|
|
40383
|
+
willFinalize: willFinalize$1,
|
|
40384
|
+
createProxy: createProxy$1
|
|
39615
40385
|
});
|
|
39616
40386
|
|
|
39617
40387
|
function generatePatches(state, basePath, patches, inversePatches) {
|
|
@@ -39620,14 +40390,13 @@ function generatePatches(state, basePath, patches, inversePatches) {
|
|
|
39620
40390
|
|
|
39621
40391
|
function generateArrayPatches(state, basePath, patches, inversePatches) {
|
|
39622
40392
|
var assign, assign$1;
|
|
39623
|
-
|
|
39624
40393
|
var base = state.base;
|
|
39625
40394
|
var copy = state.copy;
|
|
39626
40395
|
var assigned = state.assigned; // Reduce complexity by ensuring `base` is never longer.
|
|
39627
40396
|
|
|
39628
40397
|
if (copy.length < base.length) {
|
|
39629
|
-
|
|
39630
|
-
|
|
40398
|
+
assign = [copy, base], base = assign[0], copy = assign[1];
|
|
40399
|
+
assign$1 = [inversePatches, patches], patches = assign$1[0], inversePatches = assign$1[1];
|
|
39631
40400
|
}
|
|
39632
40401
|
|
|
39633
40402
|
var delta = copy.length - base.length; // Find the first replaced index.
|
|
@@ -39685,7 +40454,11 @@ function generateObjectPatches(state, basePath, patches, inversePatches) {
|
|
|
39685
40454
|
var origValue = base[key];
|
|
39686
40455
|
var value = copy[key];
|
|
39687
40456
|
var op = !assignedValue ? "remove" : key in base ? "replace" : "add";
|
|
39688
|
-
|
|
40457
|
+
|
|
40458
|
+
if (origValue === value && op === "replace") {
|
|
40459
|
+
return;
|
|
40460
|
+
}
|
|
40461
|
+
|
|
39689
40462
|
var path = basePath.concat(key);
|
|
39690
40463
|
patches.push(op === "remove" ? {
|
|
39691
40464
|
op: op,
|
|
@@ -39710,20 +40483,26 @@ function generateObjectPatches(state, basePath, patches, inversePatches) {
|
|
|
39710
40483
|
});
|
|
39711
40484
|
}
|
|
39712
40485
|
|
|
39713
|
-
var applyPatches = function (draft, patches) {
|
|
40486
|
+
var applyPatches = function applyPatches(draft, patches) {
|
|
39714
40487
|
for (var i$1 = 0, list = patches; i$1 < list.length; i$1 += 1) {
|
|
39715
40488
|
var patch = list[i$1];
|
|
39716
|
-
|
|
39717
40489
|
var path = patch.path;
|
|
39718
40490
|
var op = patch.op;
|
|
39719
40491
|
var value = clone(patch.value); // used to clone patch to ensure original patch is not modified, see #411
|
|
39720
40492
|
|
|
39721
|
-
if (!path.length) {
|
|
40493
|
+
if (!path.length) {
|
|
40494
|
+
throw new Error("Illegal state");
|
|
40495
|
+
}
|
|
40496
|
+
|
|
39722
40497
|
var base = draft;
|
|
39723
40498
|
|
|
39724
40499
|
for (var i = 0; i < path.length - 1; i++) {
|
|
39725
40500
|
base = base[path[i]];
|
|
39726
|
-
|
|
40501
|
+
|
|
40502
|
+
if (!base || _typeof(base) !== "object") {
|
|
40503
|
+
throw new Error("Cannot apply patch, path doesn't resolve: " + path.join("/"));
|
|
40504
|
+
} // prettier-ignore
|
|
40505
|
+
|
|
39727
40506
|
}
|
|
39728
40507
|
|
|
39729
40508
|
var key = path[path.length - 1];
|
|
@@ -39772,27 +40551,33 @@ var configDefaults = {
|
|
|
39772
40551
|
onDelete: null,
|
|
39773
40552
|
onCopy: null
|
|
39774
40553
|
};
|
|
40554
|
+
|
|
39775
40555
|
var Immer = function Immer(config) {
|
|
39776
40556
|
assign(this, configDefaults, config);
|
|
39777
40557
|
this.setUseProxies(this.useProxies);
|
|
39778
40558
|
this.produce = this.produce.bind(this);
|
|
39779
40559
|
};
|
|
39780
40560
|
|
|
39781
|
-
Immer.prototype.produce = function produce
|
|
39782
|
-
|
|
40561
|
+
Immer.prototype.produce = function produce(base, recipe, patchListener) {
|
|
40562
|
+
var this$1$1 = this; // curried invocation
|
|
39783
40563
|
|
|
39784
|
-
// curried invocation
|
|
39785
40564
|
if (typeof base === "function" && typeof recipe !== "function") {
|
|
39786
40565
|
var defaultBase = recipe;
|
|
39787
40566
|
recipe = base;
|
|
39788
40567
|
var self = this;
|
|
39789
40568
|
return function curriedProduce(base) {
|
|
39790
|
-
|
|
39791
|
-
|
|
39792
|
-
|
|
39793
|
-
|
|
40569
|
+
var this$1$1 = this;
|
|
40570
|
+
if (base === void 0) base = defaultBase;
|
|
40571
|
+
var args = [],
|
|
40572
|
+
len = arguments.length - 1;
|
|
39794
40573
|
|
|
39795
|
-
|
|
40574
|
+
while (len-- > 0) {
|
|
40575
|
+
args[len] = arguments[len + 1];
|
|
40576
|
+
}
|
|
40577
|
+
|
|
40578
|
+
return self.produce(base, function (draft) {
|
|
40579
|
+
return recipe.call.apply(recipe, [this$1$1, draft].concat(args));
|
|
40580
|
+
}); // prettier-ignore
|
|
39796
40581
|
};
|
|
39797
40582
|
} // prettier-ignore
|
|
39798
40583
|
|
|
@@ -39818,7 +40603,11 @@ Immer.prototype.produce = function produce (base, recipe, patchListener) {
|
|
|
39818
40603
|
hasError = false;
|
|
39819
40604
|
} finally {
|
|
39820
40605
|
// finally instead of catch + rethrow better preserves original stack
|
|
39821
|
-
if (hasError) {
|
|
40606
|
+
if (hasError) {
|
|
40607
|
+
scope.revoke();
|
|
40608
|
+
} else {
|
|
40609
|
+
scope.leave();
|
|
40610
|
+
}
|
|
39822
40611
|
}
|
|
39823
40612
|
|
|
39824
40613
|
if (result instanceof Promise) {
|
|
@@ -39835,25 +40624,38 @@ Immer.prototype.produce = function produce (base, recipe, patchListener) {
|
|
|
39835
40624
|
return this.processResult(result, scope);
|
|
39836
40625
|
} else {
|
|
39837
40626
|
result = recipe(base);
|
|
39838
|
-
|
|
40627
|
+
|
|
40628
|
+
if (result === undefined) {
|
|
40629
|
+
return base;
|
|
40630
|
+
}
|
|
40631
|
+
|
|
39839
40632
|
return result !== NOTHING ? result : undefined;
|
|
39840
40633
|
}
|
|
39841
40634
|
};
|
|
39842
40635
|
|
|
39843
|
-
Immer.prototype.produceWithPatches = function produceWithPatches
|
|
39844
|
-
|
|
40636
|
+
Immer.prototype.produceWithPatches = function produceWithPatches(arg1, arg2, arg3) {
|
|
40637
|
+
var this$1$1 = this;
|
|
39845
40638
|
|
|
39846
40639
|
if (typeof arg1 === "function") {
|
|
39847
40640
|
return function (state) {
|
|
39848
|
-
|
|
39849
|
-
|
|
40641
|
+
var args = [],
|
|
40642
|
+
len = arguments.length - 1;
|
|
39850
40643
|
|
|
39851
|
-
|
|
39852
|
-
|
|
40644
|
+
while (len-- > 0) {
|
|
40645
|
+
args[len] = arguments[len + 1];
|
|
40646
|
+
}
|
|
40647
|
+
|
|
40648
|
+
return this$1$1.produceWithPatches(state, function (draft) {
|
|
40649
|
+
return arg1.apply(void 0, [draft].concat(args));
|
|
40650
|
+
});
|
|
40651
|
+
};
|
|
39853
40652
|
} // non-curried form
|
|
39854
40653
|
|
|
39855
40654
|
|
|
39856
|
-
if (arg3) {
|
|
40655
|
+
if (arg3) {
|
|
40656
|
+
throw new Error("A patch listener cannot be passed to produceWithPatches");
|
|
40657
|
+
}
|
|
40658
|
+
|
|
39857
40659
|
var patches, inversePatches;
|
|
39858
40660
|
var nextState = this.produce(arg1, arg2, function (p, ip) {
|
|
39859
40661
|
patches = p;
|
|
@@ -39862,7 +40664,7 @@ Immer.prototype.produceWithPatches = function produceWithPatches (arg1, arg2, ar
|
|
|
39862
40664
|
return [nextState, patches, inversePatches];
|
|
39863
40665
|
};
|
|
39864
40666
|
|
|
39865
|
-
Immer.prototype.createDraft = function createDraft
|
|
40667
|
+
Immer.prototype.createDraft = function createDraft(base) {
|
|
39866
40668
|
if (!isDraftable(base)) {
|
|
39867
40669
|
throw new Error("First argument to `createDraft` must be a plain object, an array, or an immerable object"); // prettier-ignore
|
|
39868
40670
|
}
|
|
@@ -39874,7 +40676,7 @@ Immer.prototype.createDraft = function createDraft (base) {
|
|
|
39874
40676
|
return proxy;
|
|
39875
40677
|
};
|
|
39876
40678
|
|
|
39877
|
-
Immer.prototype.finishDraft = function finishDraft
|
|
40679
|
+
Immer.prototype.finishDraft = function finishDraft(draft, patchListener) {
|
|
39878
40680
|
var state = draft && draft[DRAFT_STATE];
|
|
39879
40681
|
|
|
39880
40682
|
if (!state || !state.isManual) {
|
|
@@ -39890,16 +40692,16 @@ Immer.prototype.finishDraft = function finishDraft (draft, patchListener) {
|
|
|
39890
40692
|
return this.processResult(undefined, scope);
|
|
39891
40693
|
};
|
|
39892
40694
|
|
|
39893
|
-
Immer.prototype.setAutoFreeze = function setAutoFreeze
|
|
40695
|
+
Immer.prototype.setAutoFreeze = function setAutoFreeze(value) {
|
|
39894
40696
|
this.autoFreeze = value;
|
|
39895
40697
|
};
|
|
39896
40698
|
|
|
39897
|
-
Immer.prototype.setUseProxies = function setUseProxies
|
|
40699
|
+
Immer.prototype.setUseProxies = function setUseProxies(value) {
|
|
39898
40700
|
this.useProxies = value;
|
|
39899
40701
|
assign(this, value ? modernProxy : legacyProxy);
|
|
39900
40702
|
};
|
|
39901
40703
|
|
|
39902
|
-
Immer.prototype.applyPatches = function applyPatches$1
|
|
40704
|
+
Immer.prototype.applyPatches = function applyPatches$1(base, patches) {
|
|
39903
40705
|
// If a patch replaces the entire state, take that replacement as base
|
|
39904
40706
|
// before applying patches
|
|
39905
40707
|
var i;
|
|
@@ -39919,12 +40721,14 @@ Immer.prototype.applyPatches = function applyPatches$1 (base, patches) {
|
|
|
39919
40721
|
} // Otherwise, produce a copy of the base state.
|
|
39920
40722
|
|
|
39921
40723
|
|
|
39922
|
-
return this.produce(base, function (draft) {
|
|
40724
|
+
return this.produce(base, function (draft) {
|
|
40725
|
+
return applyPatches(draft, patches.slice(i + 1));
|
|
40726
|
+
});
|
|
39923
40727
|
};
|
|
39924
40728
|
/** @internal */
|
|
39925
40729
|
|
|
39926
40730
|
|
|
39927
|
-
Immer.prototype.processResult = function processResult
|
|
40731
|
+
Immer.prototype.processResult = function processResult(result, scope) {
|
|
39928
40732
|
var baseDraft = scope.drafts[0];
|
|
39929
40733
|
var isReplaced = result !== undefined && result !== baseDraft;
|
|
39930
40734
|
this.willFinalize(scope, result, isReplaced);
|
|
@@ -39972,13 +40776,15 @@ Immer.prototype.processResult = function processResult (result, scope) {
|
|
|
39972
40776
|
*/
|
|
39973
40777
|
|
|
39974
40778
|
|
|
39975
|
-
Immer.prototype.finalize = function finalize
|
|
39976
|
-
|
|
39977
|
-
|
|
40779
|
+
Immer.prototype.finalize = function finalize(draft, path, scope) {
|
|
40780
|
+
var this$1$1 = this;
|
|
39978
40781
|
var state = draft[DRAFT_STATE];
|
|
39979
40782
|
|
|
39980
40783
|
if (!state) {
|
|
39981
|
-
if (Object.isFrozen(draft)) {
|
|
40784
|
+
if (Object.isFrozen(draft)) {
|
|
40785
|
+
return draft;
|
|
40786
|
+
}
|
|
40787
|
+
|
|
39982
40788
|
return this.finalizeTree(draft, null, scope);
|
|
39983
40789
|
} // Never finalize drafts owned by another scope.
|
|
39984
40790
|
|
|
@@ -40001,13 +40807,17 @@ Immer.prototype.finalize = function finalize (draft, path, scope) {
|
|
|
40001
40807
|
var assigned = state.assigned;
|
|
40002
40808
|
|
|
40003
40809
|
for (var prop in assigned) {
|
|
40004
|
-
if (!assigned[prop]) {
|
|
40810
|
+
if (!assigned[prop]) {
|
|
40811
|
+
this.onDelete(state, prop);
|
|
40812
|
+
}
|
|
40005
40813
|
}
|
|
40006
40814
|
} else {
|
|
40007
40815
|
var base = state.base;
|
|
40008
|
-
|
|
40816
|
+
var copy = state.copy;
|
|
40009
40817
|
each(base, function (prop) {
|
|
40010
|
-
if (!has$1(copy, prop)) {
|
|
40818
|
+
if (!has$1(copy, prop)) {
|
|
40819
|
+
this$1$1.onDelete(state, prop);
|
|
40820
|
+
}
|
|
40011
40821
|
});
|
|
40012
40822
|
}
|
|
40013
40823
|
}
|
|
@@ -40035,9 +40845,8 @@ Immer.prototype.finalize = function finalize (draft, path, scope) {
|
|
|
40035
40845
|
*/
|
|
40036
40846
|
|
|
40037
40847
|
|
|
40038
|
-
Immer.prototype.finalizeTree = function finalizeTree
|
|
40039
|
-
|
|
40040
|
-
|
|
40848
|
+
Immer.prototype.finalizeTree = function finalizeTree(root, rootPath, scope) {
|
|
40849
|
+
var this$1$1 = this;
|
|
40041
40850
|
var state = root[DRAFT_STATE];
|
|
40042
40851
|
|
|
40043
40852
|
if (state) {
|
|
@@ -40051,7 +40860,7 @@ Immer.prototype.finalizeTree = function finalizeTree (root, rootPath, scope) {
|
|
|
40051
40860
|
|
|
40052
40861
|
var needPatches = !!rootPath && !!scope.patches;
|
|
40053
40862
|
|
|
40054
|
-
var finalizeProperty = function (prop, value, parent) {
|
|
40863
|
+
var finalizeProperty = function finalizeProperty(prop, value, parent) {
|
|
40055
40864
|
if (value === parent) {
|
|
40056
40865
|
throw Error("Immer forbids circular references");
|
|
40057
40866
|
} // In the `finalizeTree` method, only the `root` object may be a draft.
|
|
@@ -40078,14 +40887,16 @@ Immer.prototype.finalizeTree = function finalizeTree (root, rootPath, scope) {
|
|
|
40078
40887
|
} // Unchanged drafts are never passed to the `onAssign` hook.
|
|
40079
40888
|
|
|
40080
40889
|
|
|
40081
|
-
if (isDraftProp && value === state.base[prop]) {
|
|
40890
|
+
if (isDraftProp && value === state.base[prop]) {
|
|
40891
|
+
return;
|
|
40892
|
+
}
|
|
40082
40893
|
} // Unchanged draft properties are ignored.
|
|
40083
40894
|
else if (isDraftProp && is(value, state.base[prop])) {
|
|
40084
|
-
|
|
40085
|
-
|
|
40086
|
-
|
|
40087
|
-
|
|
40088
|
-
|
|
40895
|
+
return;
|
|
40896
|
+
} // Search new objects for unfinalized drafts. Frozen objects should never contain drafts.
|
|
40897
|
+
else if (isDraftable(value) && !Object.isFrozen(value)) {
|
|
40898
|
+
each(value, finalizeProperty);
|
|
40899
|
+
}
|
|
40089
40900
|
|
|
40090
40901
|
if (isDraftProp && this$1$1.onAssign) {
|
|
40091
40902
|
this$1$1.onAssign(state, prop, value);
|
|
@@ -40163,127 +40974,223 @@ immer.createDraft.bind(immer);
|
|
|
40163
40974
|
|
|
40164
40975
|
immer.finishDraft.bind(immer);
|
|
40165
40976
|
|
|
40166
|
-
|
|
40167
|
-
|
|
40168
|
-
|
|
40169
|
-
|
|
40977
|
+
var createInitialState = function createInitialState(formConfig) {
|
|
40978
|
+
var initialForm = {};
|
|
40979
|
+
var formConfigKeys = Object.keys(formConfig);
|
|
40980
|
+
|
|
40981
|
+
for (var _i3 = 0, _formConfigKeys = formConfigKeys; _i3 < _formConfigKeys.length; _i3++) {
|
|
40982
|
+
var formKey = _formConfigKeys[_i3];
|
|
40170
40983
|
initialForm[formKey] = {
|
|
40171
40984
|
dirty: false,
|
|
40172
40985
|
rawValue: formConfig[formKey].defaultValue || "",
|
|
40173
40986
|
validators: formConfig[formKey].validators || [],
|
|
40174
40987
|
constraints: formConfig[formKey].constraints || []
|
|
40175
40988
|
};
|
|
40176
|
-
}
|
|
40177
|
-
// Because validators require the entire form we have to do a
|
|
40989
|
+
} // Because validators require the entire form we have to do a
|
|
40178
40990
|
// second pass to add errors once the initial form has been
|
|
40179
40991
|
// constructed
|
|
40180
|
-
|
|
40181
|
-
|
|
40182
|
-
|
|
40183
|
-
|
|
40992
|
+
|
|
40993
|
+
|
|
40994
|
+
for (var _i4 = 0, _formConfigKeys2 = formConfigKeys; _i4 < _formConfigKeys2.length; _i4++) {
|
|
40995
|
+
var _formKey = _formConfigKeys2[_i4];
|
|
40996
|
+
var errors = computeErrors(_formKey, initialForm);
|
|
40997
|
+
initialForm[_formKey].errors = errors;
|
|
40998
|
+
initialForm[_formKey].hasErrors = errors.length > 0;
|
|
40184
40999
|
}
|
|
41000
|
+
|
|
40185
41001
|
return initialForm;
|
|
40186
41002
|
};
|
|
40187
41003
|
|
|
40188
|
-
|
|
40189
|
-
|
|
40190
|
-
|
|
40191
|
-
|
|
40192
|
-
|
|
41004
|
+
var SET = "field/SET";
|
|
41005
|
+
|
|
41006
|
+
var _set = function set(fieldName) {
|
|
41007
|
+
return function (value) {
|
|
41008
|
+
return {
|
|
41009
|
+
type: SET,
|
|
41010
|
+
payload: {
|
|
41011
|
+
fieldName: fieldName,
|
|
41012
|
+
value: value
|
|
41013
|
+
}
|
|
41014
|
+
};
|
|
41015
|
+
};
|
|
41016
|
+
};
|
|
40193
41017
|
|
|
40194
|
-
|
|
40195
|
-
const clear = () => ({ type: CLEAR });
|
|
41018
|
+
var CLEAR = "form/CLEAR";
|
|
40196
41019
|
|
|
40197
|
-
|
|
40198
|
-
|
|
40199
|
-
|
|
40200
|
-
|
|
40201
|
-
}
|
|
41020
|
+
var _clear = function clear() {
|
|
41021
|
+
return {
|
|
41022
|
+
type: CLEAR
|
|
41023
|
+
};
|
|
41024
|
+
};
|
|
41025
|
+
|
|
41026
|
+
var ADD_VALIDATOR = "field/ADD_VALIDATOR";
|
|
41027
|
+
|
|
41028
|
+
var _addValidator = function addValidator(fieldName) {
|
|
41029
|
+
return function (validator) {
|
|
41030
|
+
return {
|
|
41031
|
+
type: ADD_VALIDATOR,
|
|
41032
|
+
payload: {
|
|
41033
|
+
fieldName: fieldName,
|
|
41034
|
+
validator: validator
|
|
41035
|
+
}
|
|
41036
|
+
};
|
|
41037
|
+
};
|
|
41038
|
+
};
|
|
41039
|
+
|
|
41040
|
+
var REMOVE_VALIDATOR = "field/REMOVE_VALIDATOR";
|
|
40202
41041
|
|
|
40203
|
-
|
|
40204
|
-
|
|
40205
|
-
|
|
40206
|
-
|
|
40207
|
-
|
|
40208
|
-
|
|
40209
|
-
|
|
40210
|
-
|
|
40211
|
-
|
|
40212
|
-
|
|
40213
|
-
|
|
40214
|
-
|
|
40215
|
-
|
|
40216
|
-
|
|
40217
|
-
|
|
40218
|
-
|
|
41042
|
+
var _removeValidator = function removeValidator(fieldName) {
|
|
41043
|
+
return function (validator) {
|
|
41044
|
+
return {
|
|
41045
|
+
type: REMOVE_VALIDATOR,
|
|
41046
|
+
payload: {
|
|
41047
|
+
fieldName: fieldName,
|
|
41048
|
+
validator: validator
|
|
41049
|
+
}
|
|
41050
|
+
};
|
|
41051
|
+
};
|
|
41052
|
+
};
|
|
41053
|
+
|
|
41054
|
+
var CLEAR_FIELD_VALIDATORS = "field/CLEAR_FIELD_VALIDATORS";
|
|
41055
|
+
|
|
41056
|
+
var clearFieldValidators = function clearFieldValidators(fieldName) {
|
|
41057
|
+
return function () {
|
|
41058
|
+
return {
|
|
41059
|
+
type: CLEAR_FIELD_VALIDATORS,
|
|
41060
|
+
payload: {
|
|
41061
|
+
fieldName: fieldName
|
|
41062
|
+
}
|
|
41063
|
+
};
|
|
41064
|
+
};
|
|
41065
|
+
};
|
|
41066
|
+
|
|
41067
|
+
var createFormReducer = function createFormReducer(formConfig) {
|
|
41068
|
+
return function () {
|
|
41069
|
+
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : createInitialState(formConfig);
|
|
41070
|
+
var action = arguments.length > 1 ? arguments[1] : undefined;
|
|
41071
|
+
|
|
41072
|
+
switch (action.type) {
|
|
41073
|
+
case SET:
|
|
41074
|
+
{
|
|
41075
|
+
var changedFieldName = action.payload.fieldName;
|
|
41076
|
+
var newRawValue = action.payload.value;
|
|
41077
|
+
return produce(state, function (draftState) {
|
|
41078
|
+
var originalValue = draftState[changedFieldName].rawValue;
|
|
41079
|
+
draftState[changedFieldName].rawValue = newRawValue;
|
|
41080
|
+
|
|
41081
|
+
if (computeConstraints(changedFieldName, draftState).length > 0) {
|
|
41082
|
+
// If the change violates constraints, revert the change
|
|
41083
|
+
draftState[changedFieldName].rawValue = originalValue;
|
|
41084
|
+
return draftState;
|
|
41085
|
+
}
|
|
41086
|
+
|
|
41087
|
+
computeDirtyEntries(draftState, changedFieldName);
|
|
41088
|
+
computeErrorEntries(draftState);
|
|
41089
|
+
});
|
|
40219
41090
|
}
|
|
40220
41091
|
|
|
40221
|
-
|
|
40222
|
-
|
|
40223
|
-
|
|
40224
|
-
|
|
40225
|
-
|
|
40226
|
-
|
|
40227
|
-
|
|
40228
|
-
draftState
|
|
40229
|
-
|
|
41092
|
+
case CLEAR:
|
|
41093
|
+
return createInitialState(formConfig);
|
|
41094
|
+
|
|
41095
|
+
case ADD_VALIDATOR:
|
|
41096
|
+
{
|
|
41097
|
+
var fieldWithOverride = action.payload.fieldName;
|
|
41098
|
+
var newValidator = action.payload.validator;
|
|
41099
|
+
return produce(state, function (draftState) {
|
|
41100
|
+
draftState[fieldWithOverride].validators.push(newValidator);
|
|
41101
|
+
computeErrorEntries(draftState);
|
|
41102
|
+
});
|
|
40230
41103
|
}
|
|
40231
|
-
|
|
40232
|
-
|
|
40233
|
-
|
|
40234
|
-
|
|
40235
|
-
|
|
40236
|
-
|
|
40237
|
-
|
|
40238
|
-
|
|
40239
|
-
|
|
40240
|
-
|
|
40241
|
-
|
|
40242
|
-
|
|
40243
|
-
let field = entry[1];
|
|
40244
|
-
let errors = computeErrors(fieldName, draftState);
|
|
40245
|
-
let dirty = field.dirty;
|
|
40246
|
-
draftState[fieldName].errors = errors;
|
|
40247
|
-
draftState[fieldName].dirty = dirty;
|
|
40248
|
-
draftState[fieldName].hasErrors = errors.length > 0;
|
|
41104
|
+
|
|
41105
|
+
case REMOVE_VALIDATOR:
|
|
41106
|
+
{
|
|
41107
|
+
var fieldToOverride = action.payload.fieldName;
|
|
41108
|
+
var targetValidator = action.payload.validator;
|
|
41109
|
+
return produce(state, function (draftState) {
|
|
41110
|
+
var fieldValidators = draftState[fieldToOverride].validators;
|
|
41111
|
+
draftState[fieldToOverride].validators = fieldValidators.filter(function (validator) {
|
|
41112
|
+
return validator.type !== targetValidator.type;
|
|
41113
|
+
});
|
|
41114
|
+
computeErrorEntries(draftState);
|
|
41115
|
+
});
|
|
40249
41116
|
}
|
|
40250
|
-
|
|
40251
|
-
|
|
40252
|
-
|
|
40253
|
-
|
|
41117
|
+
|
|
41118
|
+
case CLEAR_FIELD_VALIDATORS:
|
|
41119
|
+
{
|
|
41120
|
+
var fieldToClear = action.payload.fieldName;
|
|
41121
|
+
return produce(state, function (draftState) {
|
|
41122
|
+
draftState[fieldToClear].validators = [];
|
|
41123
|
+
computeErrorEntries(draftState);
|
|
41124
|
+
});
|
|
41125
|
+
}
|
|
41126
|
+
|
|
41127
|
+
default:
|
|
41128
|
+
return state;
|
|
41129
|
+
}
|
|
41130
|
+
};
|
|
40254
41131
|
};
|
|
40255
41132
|
|
|
40256
|
-
|
|
41133
|
+
var createMapDispatchToProps = function createMapDispatchToProps(formConfig) {
|
|
40257
41134
|
// Do memo-ization
|
|
40258
|
-
|
|
40259
|
-
|
|
40260
|
-
return dispatch
|
|
41135
|
+
var cachedDispatch;
|
|
41136
|
+
var cacheValue;
|
|
41137
|
+
return function (dispatch) {
|
|
40261
41138
|
if (dispatch == cachedDispatch) {
|
|
40262
41139
|
return cacheValue;
|
|
40263
41140
|
}
|
|
40264
|
-
|
|
41141
|
+
|
|
41142
|
+
var dispatchObj = {};
|
|
40265
41143
|
dispatchObj.fields = {};
|
|
40266
|
-
|
|
40267
|
-
|
|
41144
|
+
var keys = Object.keys(formConfig);
|
|
41145
|
+
|
|
41146
|
+
var _loop = function _loop() {
|
|
41147
|
+
var fieldName = _keys[_i5];
|
|
40268
41148
|
dispatchObj.fields[fieldName] = {
|
|
40269
|
-
set:
|
|
40270
|
-
|
|
41149
|
+
set: function set(value) {
|
|
41150
|
+
return dispatch(_set(fieldName)(value));
|
|
41151
|
+
},
|
|
41152
|
+
addValidator: function addValidator(validator) {
|
|
41153
|
+
return dispatch(_addValidator(fieldName)(validator));
|
|
41154
|
+
},
|
|
41155
|
+
removeValidator: function removeValidator(validator) {
|
|
41156
|
+
return dispatch(_removeValidator(fieldName)(validator));
|
|
41157
|
+
},
|
|
41158
|
+
clear: function clear() {
|
|
41159
|
+
return dispatch(clearFieldValidators(fieldName)());
|
|
41160
|
+
}
|
|
40271
41161
|
};
|
|
41162
|
+
};
|
|
41163
|
+
|
|
41164
|
+
for (var _i5 = 0, _keys = keys; _i5 < _keys.length; _i5++) {
|
|
41165
|
+
_loop();
|
|
40272
41166
|
}
|
|
40273
|
-
|
|
41167
|
+
|
|
41168
|
+
dispatchObj.form = {
|
|
41169
|
+
clear: function clear() {
|
|
41170
|
+
return dispatch(_clear());
|
|
41171
|
+
}
|
|
41172
|
+
};
|
|
40274
41173
|
cachedDispatch = dispatch;
|
|
40275
|
-
cacheValue = {
|
|
41174
|
+
cacheValue = {
|
|
41175
|
+
actions: dispatchObj
|
|
41176
|
+
};
|
|
40276
41177
|
return cacheValue;
|
|
40277
41178
|
};
|
|
40278
41179
|
};
|
|
40279
41180
|
|
|
40280
|
-
|
|
41181
|
+
var mapStateToProps = function mapStateToProps(state) {
|
|
41182
|
+
return {
|
|
41183
|
+
fields: state
|
|
41184
|
+
};
|
|
41185
|
+
};
|
|
40281
41186
|
|
|
40282
|
-
|
|
40283
|
-
|
|
40284
|
-
|
|
40285
|
-
|
|
40286
|
-
|
|
41187
|
+
var createFormState = function createFormState(formConfig) {
|
|
41188
|
+
return {
|
|
41189
|
+
reducer: createFormReducer(formConfig),
|
|
41190
|
+
mapDispatchToProps: createMapDispatchToProps(formConfig),
|
|
41191
|
+
mapStateToProps: mapStateToProps
|
|
41192
|
+
};
|
|
41193
|
+
};
|
|
40287
41194
|
|
|
40288
41195
|
var AddressForm = function AddressForm(_ref) {
|
|
40289
41196
|
var _zipErrorMessages;
|
|
@@ -49403,6 +50310,8 @@ var fallbackValues$Q = {
|
|
|
49403
50310
|
dataQa: string,
|
|
49404
50311
|
content: <React Component(s)> e.g.: <Box><Stack>cool content stuff</Stack></Box> (any collection of components will work),
|
|
49405
50312
|
rightTitleContent: <React Component(s)> (rendered on the very right of the title section, use to supplement "rightIcons" with text, as in expired CC status, or render other custom content)
|
|
50313
|
+
contentOverride: <React Component(s)> (Replace the radio section and the containers with different content,
|
|
50314
|
+
intended for inserting a divider bar or other non-interactive css)
|
|
49406
50315
|
}
|
|
49407
50316
|
|
|
49408
50317
|
Also takes an "openSection" which should equal the id of the section that should be open
|
|
@@ -49430,6 +50339,8 @@ var RadioSection = function RadioSection(_ref) {
|
|
|
49430
50339
|
initiallyOpen = _ref$initiallyOpen === void 0 ? true : _ref$initiallyOpen,
|
|
49431
50340
|
_ref$openHeight = _ref.openHeight,
|
|
49432
50341
|
openHeight = _ref$openHeight === void 0 ? "auto" : _ref$openHeight,
|
|
50342
|
+
_ref$containerStyles = _ref.containerStyles,
|
|
50343
|
+
containerStyles = _ref$containerStyles === void 0 ? "" : _ref$containerStyles,
|
|
49433
50344
|
ariaDescribedBy = _ref.ariaDescribedBy;
|
|
49434
50345
|
|
|
49435
50346
|
var handleKeyDown = function handleKeyDown(id, e) {
|
|
@@ -49482,13 +50393,14 @@ var RadioSection = function RadioSection(_ref) {
|
|
|
49482
50393
|
return /*#__PURE__*/React.createElement(Box, {
|
|
49483
50394
|
padding: "1px",
|
|
49484
50395
|
border: "1px solid ".concat(themeValues.borderColor),
|
|
49485
|
-
borderRadius: "4px"
|
|
50396
|
+
borderRadius: "4px",
|
|
50397
|
+
extraStyles: containerStyles
|
|
49486
50398
|
}, /*#__PURE__*/React.createElement(Stack, {
|
|
49487
50399
|
childGap: "0"
|
|
49488
50400
|
}, sections.filter(function (section) {
|
|
49489
50401
|
return !section.hidden;
|
|
49490
50402
|
}).map(function (section) {
|
|
49491
|
-
return /*#__PURE__*/React.createElement(Motion, {
|
|
50403
|
+
return contentOverride ? contentOverride : /*#__PURE__*/React.createElement(Motion, {
|
|
49492
50404
|
tabIndex: section.hideRadioButton || section.disabled ? "-1" : "0",
|
|
49493
50405
|
onKeyDown: function onKeyDown(e) {
|
|
49494
50406
|
return !section.disabled && handleKeyDown(section.id, e);
|