@thecb/components 7.12.3-beta.0 → 7.12.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +1466 -560
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +1466 -560
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/atoms/icons/AutopayOnIcon.js +2 -2
- /package/src/components/atoms/icons/{ExternalLinkicon.js → ExternalLinkIcon.js} +0 -0
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
|
|
|
@@ -14110,7 +14167,9 @@ var TimeoutImage = function TimeoutImage() {
|
|
|
14110
14167
|
})))));
|
|
14111
14168
|
};
|
|
14112
14169
|
|
|
14113
|
-
var AutopayOnIcon = function AutopayOnIcon() {
|
|
14170
|
+
var AutopayOnIcon = function AutopayOnIcon(_ref) {
|
|
14171
|
+
var _ref$color = _ref.color,
|
|
14172
|
+
color = _ref$color === void 0 ? SEA_GREEN : _ref$color;
|
|
14114
14173
|
return /*#__PURE__*/React.createElement("svg", {
|
|
14115
14174
|
xmlns: "http://www.w3.org/2000/svg",
|
|
14116
14175
|
width: "12",
|
|
@@ -14123,7 +14182,7 @@ var AutopayOnIcon = function AutopayOnIcon() {
|
|
|
14123
14182
|
strokeWidth: "1"
|
|
14124
14183
|
}, /*#__PURE__*/React.createElement("path", {
|
|
14125
14184
|
className: "autopayIcon",
|
|
14126
|
-
fill:
|
|
14185
|
+
fill: color,
|
|
14127
14186
|
fillRule: "nonzero",
|
|
14128
14187
|
d: "M1.898 5.75c.079 0 .141-.02.188-.059a.281.281 0 00.094-.152 3.825 3.825 0 011.394-2.144A3.838 3.838 0 016 2.563c.5 0 .98.09 1.441.27.461.179.88.44 1.254.784l-.984.985A.542.542 0 007.547 5c0 .156.055.29.164.398.11.11.242.165.398.165h3.141c.156 0 .289-.055.398-.165A.542.542 0 0011.812 5V1.86a.542.542 0 00-.164-.399.542.542 0 00-.398-.164.542.542 0 00-.398.164l-.844.844A5.699 5.699 0 006 .688c-.938 0-1.809.207-2.613.62-.805.415-1.48.981-2.028 1.7A5.726 5.726 0 00.281 5.422a.265.265 0 00.059.223c.055.07.129.105.222.105h1.336zM6 12.312c.937 0 1.809-.207 2.613-.62a5.919 5.919 0 002.028-1.7 5.726 5.726 0 001.078-2.414.265.265 0 00-.059-.223.267.267 0 00-.223-.105h-1.335c-.079 0-.141.02-.188.059a.281.281 0 00-.094.152 3.825 3.825 0 01-1.394 2.144c-.711.555-1.52.833-2.426.833-.5 0-.98-.09-1.441-.27a3.985 3.985 0 01-1.254-.785l.984-.985A.542.542 0 004.453 8a.542.542 0 00-.164-.398.542.542 0 00-.398-.164H.75a.542.542 0 00-.398.164A.542.542 0 00.187 8v3.14c0 .157.055.29.165.4.109.108.242.163.398.163.156 0 .29-.055.398-.164l.844-.844A5.699 5.699 0 006 12.312z"
|
|
14129
14188
|
})));
|
|
@@ -21371,7 +21430,7 @@ var check = function (it) {
|
|
|
21371
21430
|
|
|
21372
21431
|
// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
|
|
21373
21432
|
var global_1 =
|
|
21374
|
-
// eslint-disable-next-line es
|
|
21433
|
+
// eslint-disable-next-line es/no-global-this -- safe
|
|
21375
21434
|
check(typeof globalThis == 'object' && globalThis) ||
|
|
21376
21435
|
check(typeof window == 'object' && window) ||
|
|
21377
21436
|
// eslint-disable-next-line no-restricted-globals -- safe
|
|
@@ -21390,12 +21449,12 @@ var fails = function (exec) {
|
|
|
21390
21449
|
|
|
21391
21450
|
// Detect IE8's incomplete defineProperty implementation
|
|
21392
21451
|
var descriptors = !fails(function () {
|
|
21393
|
-
// eslint-disable-next-line es
|
|
21452
|
+
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
21394
21453
|
return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
|
|
21395
21454
|
});
|
|
21396
21455
|
|
|
21397
21456
|
var functionBindNative = !fails(function () {
|
|
21398
|
-
// eslint-disable-next-line es
|
|
21457
|
+
// eslint-disable-next-line es/no-function-prototype-bind -- safe
|
|
21399
21458
|
var test = (function () { /* empty */ }).bind();
|
|
21400
21459
|
// eslint-disable-next-line no-prototype-builtins -- safe
|
|
21401
21460
|
return typeof test != 'function' || test.hasOwnProperty('prototype');
|
|
@@ -21408,7 +21467,7 @@ var functionCall = functionBindNative ? call.bind(call) : function () {
|
|
|
21408
21467
|
};
|
|
21409
21468
|
|
|
21410
21469
|
var $propertyIsEnumerable = {}.propertyIsEnumerable;
|
|
21411
|
-
// eslint-disable-next-line es
|
|
21470
|
+
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
21412
21471
|
var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
|
21413
21472
|
|
|
21414
21473
|
// Nashorn ~ JDK8 bug
|
|
@@ -21435,25 +21494,29 @@ var createPropertyDescriptor = function (bitmap, value) {
|
|
|
21435
21494
|
};
|
|
21436
21495
|
|
|
21437
21496
|
var FunctionPrototype = Function.prototype;
|
|
21438
|
-
var bind$1 = FunctionPrototype.bind;
|
|
21439
21497
|
var call$1 = FunctionPrototype.call;
|
|
21440
|
-
var
|
|
21498
|
+
var uncurryThisWithBind = functionBindNative && FunctionPrototype.bind.bind(call$1, call$1);
|
|
21441
21499
|
|
|
21442
|
-
var
|
|
21443
|
-
return
|
|
21444
|
-
} : function (fn) {
|
|
21445
|
-
return fn && function () {
|
|
21500
|
+
var functionUncurryThisRaw = function (fn) {
|
|
21501
|
+
return functionBindNative ? uncurryThisWithBind(fn) : function () {
|
|
21446
21502
|
return call$1.apply(fn, arguments);
|
|
21447
21503
|
};
|
|
21448
21504
|
};
|
|
21449
21505
|
|
|
21450
|
-
var toString$2 =
|
|
21451
|
-
var stringSlice =
|
|
21506
|
+
var toString$2 = functionUncurryThisRaw({}.toString);
|
|
21507
|
+
var stringSlice = functionUncurryThisRaw(''.slice);
|
|
21452
21508
|
|
|
21453
21509
|
var classofRaw = function (it) {
|
|
21454
21510
|
return stringSlice(toString$2(it), 8, -1);
|
|
21455
21511
|
};
|
|
21456
21512
|
|
|
21513
|
+
var functionUncurryThis = function (fn) {
|
|
21514
|
+
// Nashorn bug:
|
|
21515
|
+
// https://github.com/zloirock/core-js/issues/1128
|
|
21516
|
+
// https://github.com/zloirock/core-js/issues/1130
|
|
21517
|
+
if (classofRaw(fn) === 'Function') return functionUncurryThisRaw(fn);
|
|
21518
|
+
};
|
|
21519
|
+
|
|
21457
21520
|
var $Object = Object;
|
|
21458
21521
|
var split = functionUncurryThis(''.split);
|
|
21459
21522
|
|
|
@@ -21466,12 +21529,18 @@ var indexedObject = fails(function () {
|
|
|
21466
21529
|
return classofRaw(it) == 'String' ? split(it, '') : $Object(it);
|
|
21467
21530
|
} : $Object;
|
|
21468
21531
|
|
|
21532
|
+
// we can't use just `it == null` since of `document.all` special case
|
|
21533
|
+
// https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot-aec
|
|
21534
|
+
var isNullOrUndefined = function (it) {
|
|
21535
|
+
return it === null || it === undefined;
|
|
21536
|
+
};
|
|
21537
|
+
|
|
21469
21538
|
var $TypeError = TypeError;
|
|
21470
21539
|
|
|
21471
21540
|
// `RequireObjectCoercible` abstract operation
|
|
21472
21541
|
// https://tc39.es/ecma262/#sec-requireobjectcoercible
|
|
21473
21542
|
var requireObjectCoercible = function (it) {
|
|
21474
|
-
if (it
|
|
21543
|
+
if (isNullOrUndefined(it)) throw $TypeError("Can't call method on " + it);
|
|
21475
21544
|
return it;
|
|
21476
21545
|
};
|
|
21477
21546
|
|
|
@@ -21483,13 +21552,31 @@ var toIndexedObject = function (it) {
|
|
|
21483
21552
|
return indexedObject(requireObjectCoercible(it));
|
|
21484
21553
|
};
|
|
21485
21554
|
|
|
21555
|
+
var documentAll = typeof document == 'object' && document.all;
|
|
21556
|
+
|
|
21557
|
+
// https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot
|
|
21558
|
+
var IS_HTMLDDA = typeof documentAll == 'undefined' && documentAll !== undefined;
|
|
21559
|
+
|
|
21560
|
+
var documentAll_1 = {
|
|
21561
|
+
all: documentAll,
|
|
21562
|
+
IS_HTMLDDA: IS_HTMLDDA
|
|
21563
|
+
};
|
|
21564
|
+
|
|
21565
|
+
var documentAll$1 = documentAll_1.all;
|
|
21566
|
+
|
|
21486
21567
|
// `IsCallable` abstract operation
|
|
21487
21568
|
// https://tc39.es/ecma262/#sec-iscallable
|
|
21488
|
-
var isCallable = function (argument) {
|
|
21569
|
+
var isCallable = documentAll_1.IS_HTMLDDA ? function (argument) {
|
|
21570
|
+
return typeof argument == 'function' || argument === documentAll$1;
|
|
21571
|
+
} : function (argument) {
|
|
21489
21572
|
return typeof argument == 'function';
|
|
21490
21573
|
};
|
|
21491
21574
|
|
|
21492
|
-
var
|
|
21575
|
+
var documentAll$2 = documentAll_1.all;
|
|
21576
|
+
|
|
21577
|
+
var isObject = documentAll_1.IS_HTMLDDA ? function (it) {
|
|
21578
|
+
return typeof it == 'object' ? it !== null : isCallable(it) || it === documentAll$2;
|
|
21579
|
+
} : function (it) {
|
|
21493
21580
|
return typeof it == 'object' ? it !== null : isCallable(it);
|
|
21494
21581
|
};
|
|
21495
21582
|
|
|
@@ -21530,12 +21617,12 @@ if (!version && engineUserAgent) {
|
|
|
21530
21617
|
|
|
21531
21618
|
var engineV8Version = version;
|
|
21532
21619
|
|
|
21533
|
-
/* eslint-disable es
|
|
21620
|
+
/* eslint-disable es/no-symbol -- required for testing */
|
|
21534
21621
|
|
|
21535
21622
|
|
|
21536
21623
|
|
|
21537
|
-
// eslint-disable-next-line es
|
|
21538
|
-
var
|
|
21624
|
+
// eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
|
|
21625
|
+
var symbolConstructorDetection = !!Object.getOwnPropertySymbols && !fails(function () {
|
|
21539
21626
|
var symbol = Symbol();
|
|
21540
21627
|
// Chrome 38 Symbol has incorrect toString conversion
|
|
21541
21628
|
// `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
|
|
@@ -21544,10 +21631,10 @@ var nativeSymbol = !!Object.getOwnPropertySymbols && !fails(function () {
|
|
|
21544
21631
|
!Symbol.sham && engineV8Version && engineV8Version < 41;
|
|
21545
21632
|
});
|
|
21546
21633
|
|
|
21547
|
-
/* eslint-disable es
|
|
21634
|
+
/* eslint-disable es/no-symbol -- required for testing */
|
|
21548
21635
|
|
|
21549
21636
|
|
|
21550
|
-
var useSymbolAsUid =
|
|
21637
|
+
var useSymbolAsUid = symbolConstructorDetection
|
|
21551
21638
|
&& !Symbol.sham
|
|
21552
21639
|
&& typeof Symbol.iterator == 'symbol';
|
|
21553
21640
|
|
|
@@ -21582,7 +21669,7 @@ var aCallable = function (argument) {
|
|
|
21582
21669
|
// https://tc39.es/ecma262/#sec-getmethod
|
|
21583
21670
|
var getMethod = function (V, P) {
|
|
21584
21671
|
var func = V[P];
|
|
21585
|
-
return func
|
|
21672
|
+
return isNullOrUndefined(func) ? undefined : aCallable(func);
|
|
21586
21673
|
};
|
|
21587
21674
|
|
|
21588
21675
|
var $TypeError$2 = TypeError;
|
|
@@ -21597,7 +21684,7 @@ var ordinaryToPrimitive = function (input, pref) {
|
|
|
21597
21684
|
throw $TypeError$2("Can't convert object to primitive value");
|
|
21598
21685
|
};
|
|
21599
21686
|
|
|
21600
|
-
// eslint-disable-next-line es
|
|
21687
|
+
// eslint-disable-next-line es/no-object-defineproperty -- safe
|
|
21601
21688
|
var defineProperty = Object.defineProperty;
|
|
21602
21689
|
|
|
21603
21690
|
var defineGlobalProperty = function (key, value) {
|
|
@@ -21617,10 +21704,10 @@ var shared = createCommonjsModule(function (module) {
|
|
|
21617
21704
|
(module.exports = function (key, value) {
|
|
21618
21705
|
return sharedStore[key] || (sharedStore[key] = value !== undefined ? value : {});
|
|
21619
21706
|
})('versions', []).push({
|
|
21620
|
-
version: '3.
|
|
21707
|
+
version: '3.25.5',
|
|
21621
21708
|
mode: 'global',
|
|
21622
21709
|
copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
|
|
21623
|
-
license: 'https://github.com/zloirock/core-js/blob/v3.
|
|
21710
|
+
license: 'https://github.com/zloirock/core-js/blob/v3.25.5/LICENSE',
|
|
21624
21711
|
source: 'https://github.com/zloirock/core-js'
|
|
21625
21712
|
});
|
|
21626
21713
|
});
|
|
@@ -21637,7 +21724,7 @@ var hasOwnProperty = functionUncurryThis({}.hasOwnProperty);
|
|
|
21637
21724
|
|
|
21638
21725
|
// `HasOwnProperty` abstract operation
|
|
21639
21726
|
// https://tc39.es/ecma262/#sec-hasownproperty
|
|
21640
|
-
// eslint-disable-next-line es
|
|
21727
|
+
// eslint-disable-next-line es/no-object-hasown -- safe
|
|
21641
21728
|
var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
|
|
21642
21729
|
return hasOwnProperty(toObject(it), key);
|
|
21643
21730
|
};
|
|
@@ -21656,9 +21743,9 @@ var symbolFor = Symbol$1 && Symbol$1['for'];
|
|
|
21656
21743
|
var createWellKnownSymbol = useSymbolAsUid ? Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid;
|
|
21657
21744
|
|
|
21658
21745
|
var wellKnownSymbol = function (name) {
|
|
21659
|
-
if (!hasOwnProperty_1(WellKnownSymbolsStore, name) || !(
|
|
21746
|
+
if (!hasOwnProperty_1(WellKnownSymbolsStore, name) || !(symbolConstructorDetection || typeof WellKnownSymbolsStore[name] == 'string')) {
|
|
21660
21747
|
var description = 'Symbol.' + name;
|
|
21661
|
-
if (
|
|
21748
|
+
if (symbolConstructorDetection && hasOwnProperty_1(Symbol$1, name)) {
|
|
21662
21749
|
WellKnownSymbolsStore[name] = Symbol$1[name];
|
|
21663
21750
|
} else if (useSymbolAsUid && symbolFor) {
|
|
21664
21751
|
WellKnownSymbolsStore[name] = symbolFor(description);
|
|
@@ -21704,13 +21791,13 @@ var documentCreateElement = function (it) {
|
|
|
21704
21791
|
|
|
21705
21792
|
// Thanks to IE8 for its funny defineProperty
|
|
21706
21793
|
var ie8DomDefine = !descriptors && !fails(function () {
|
|
21707
|
-
// eslint-disable-next-line es
|
|
21794
|
+
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
21708
21795
|
return Object.defineProperty(documentCreateElement('div'), 'a', {
|
|
21709
21796
|
get: function () { return 7; }
|
|
21710
21797
|
}).a != 7;
|
|
21711
21798
|
});
|
|
21712
21799
|
|
|
21713
|
-
// eslint-disable-next-line es
|
|
21800
|
+
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
21714
21801
|
var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
|
21715
21802
|
|
|
21716
21803
|
// `Object.getOwnPropertyDescriptor` method
|
|
@@ -21731,7 +21818,7 @@ var objectGetOwnPropertyDescriptor = {
|
|
|
21731
21818
|
// V8 ~ Chrome 36-
|
|
21732
21819
|
// https://bugs.chromium.org/p/v8/issues/detail?id=3334
|
|
21733
21820
|
var v8PrototypeDefineBug = descriptors && fails(function () {
|
|
21734
|
-
// eslint-disable-next-line es
|
|
21821
|
+
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
21735
21822
|
return Object.defineProperty(function () { /* empty */ }, 'prototype', {
|
|
21736
21823
|
value: 42,
|
|
21737
21824
|
writable: false
|
|
@@ -21748,9 +21835,9 @@ var anObject = function (argument) {
|
|
|
21748
21835
|
};
|
|
21749
21836
|
|
|
21750
21837
|
var $TypeError$5 = TypeError;
|
|
21751
|
-
// eslint-disable-next-line es
|
|
21838
|
+
// eslint-disable-next-line es/no-object-defineproperty -- safe
|
|
21752
21839
|
var $defineProperty = Object.defineProperty;
|
|
21753
|
-
// eslint-disable-next-line es
|
|
21840
|
+
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
21754
21841
|
var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
|
|
21755
21842
|
var ENUMERABLE = 'enumerable';
|
|
21756
21843
|
var CONFIGURABLE = 'configurable';
|
|
@@ -21797,7 +21884,7 @@ var createNonEnumerableProperty = descriptors ? function (object, key, value) {
|
|
|
21797
21884
|
};
|
|
21798
21885
|
|
|
21799
21886
|
var FunctionPrototype$1 = Function.prototype;
|
|
21800
|
-
// eslint-disable-next-line es
|
|
21887
|
+
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
21801
21888
|
var getDescriptor = descriptors && Object.getOwnPropertyDescriptor;
|
|
21802
21889
|
|
|
21803
21890
|
var EXISTS$1 = hasOwnProperty_1(FunctionPrototype$1, 'name');
|
|
@@ -21824,7 +21911,7 @@ var inspectSource = sharedStore.inspectSource;
|
|
|
21824
21911
|
|
|
21825
21912
|
var WeakMap$1 = global_1.WeakMap;
|
|
21826
21913
|
|
|
21827
|
-
var
|
|
21914
|
+
var weakMapBasicDetection = isCallable(WeakMap$1) && /native code/.test(String(WeakMap$1));
|
|
21828
21915
|
|
|
21829
21916
|
var keys$1 = shared('keys');
|
|
21830
21917
|
|
|
@@ -21852,28 +21939,30 @@ var getterFor = function (TYPE) {
|
|
|
21852
21939
|
};
|
|
21853
21940
|
};
|
|
21854
21941
|
|
|
21855
|
-
if (
|
|
21942
|
+
if (weakMapBasicDetection || sharedStore.state) {
|
|
21856
21943
|
var store$1 = sharedStore.state || (sharedStore.state = new WeakMap$2());
|
|
21857
|
-
|
|
21858
|
-
|
|
21859
|
-
|
|
21944
|
+
/* eslint-disable no-self-assign -- prototype methods protection */
|
|
21945
|
+
store$1.get = store$1.get;
|
|
21946
|
+
store$1.has = store$1.has;
|
|
21947
|
+
store$1.set = store$1.set;
|
|
21948
|
+
/* eslint-enable no-self-assign -- prototype methods protection */
|
|
21860
21949
|
set = function (it, metadata) {
|
|
21861
|
-
if (
|
|
21950
|
+
if (store$1.has(it)) throw TypeError$1(OBJECT_ALREADY_INITIALIZED);
|
|
21862
21951
|
metadata.facade = it;
|
|
21863
|
-
|
|
21952
|
+
store$1.set(it, metadata);
|
|
21864
21953
|
return metadata;
|
|
21865
21954
|
};
|
|
21866
21955
|
get = function (it) {
|
|
21867
|
-
return
|
|
21956
|
+
return store$1.get(it) || {};
|
|
21868
21957
|
};
|
|
21869
21958
|
has = function (it) {
|
|
21870
|
-
return
|
|
21959
|
+
return store$1.has(it);
|
|
21871
21960
|
};
|
|
21872
21961
|
} else {
|
|
21873
21962
|
var STATE = sharedKey('state');
|
|
21874
21963
|
hiddenKeys[STATE] = true;
|
|
21875
21964
|
set = function (it, metadata) {
|
|
21876
|
-
if (hasOwnProperty_1(it, STATE)) throw
|
|
21965
|
+
if (hasOwnProperty_1(it, STATE)) throw TypeError$1(OBJECT_ALREADY_INITIALIZED);
|
|
21877
21966
|
metadata.facade = it;
|
|
21878
21967
|
createNonEnumerableProperty(it, STATE, metadata);
|
|
21879
21968
|
return metadata;
|
|
@@ -21901,7 +21990,7 @@ var CONFIGURABLE_FUNCTION_NAME = functionName.CONFIGURABLE;
|
|
|
21901
21990
|
|
|
21902
21991
|
var enforceInternalState = internalState.enforce;
|
|
21903
21992
|
var getInternalState = internalState.get;
|
|
21904
|
-
// eslint-disable-next-line es
|
|
21993
|
+
// eslint-disable-next-line es/no-object-defineproperty -- safe
|
|
21905
21994
|
var defineProperty = Object.defineProperty;
|
|
21906
21995
|
|
|
21907
21996
|
var CONFIGURABLE_LENGTH = descriptors && !fails(function () {
|
|
@@ -21970,7 +22059,7 @@ var floor = Math.floor;
|
|
|
21970
22059
|
|
|
21971
22060
|
// `Math.trunc` method
|
|
21972
22061
|
// https://tc39.es/ecma262/#sec-math.trunc
|
|
21973
|
-
// eslint-disable-next-line es
|
|
22062
|
+
// eslint-disable-next-line es/no-math-trunc -- safe
|
|
21974
22063
|
var mathTrunc = Math.trunc || function trunc(x) {
|
|
21975
22064
|
var n = +x;
|
|
21976
22065
|
return (n > 0 ? floor : ceil)(n);
|
|
@@ -22071,7 +22160,7 @@ var hiddenKeys$1 = enumBugKeys.concat('length', 'prototype');
|
|
|
22071
22160
|
|
|
22072
22161
|
// `Object.getOwnPropertyNames` method
|
|
22073
22162
|
// https://tc39.es/ecma262/#sec-object.getownpropertynames
|
|
22074
|
-
// eslint-disable-next-line es
|
|
22163
|
+
// eslint-disable-next-line es/no-object-getownpropertynames -- safe
|
|
22075
22164
|
var f$3 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
|
|
22076
22165
|
return objectKeysInternal(O, hiddenKeys$1);
|
|
22077
22166
|
};
|
|
@@ -22080,7 +22169,7 @@ var objectGetOwnPropertyNames = {
|
|
|
22080
22169
|
f: f$3
|
|
22081
22170
|
};
|
|
22082
22171
|
|
|
22083
|
-
// eslint-disable-next-line es
|
|
22172
|
+
// eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
|
|
22084
22173
|
var f$4 = Object.getOwnPropertySymbols;
|
|
22085
22174
|
|
|
22086
22175
|
var objectGetOwnPropertySymbols = {
|
|
@@ -22224,7 +22313,7 @@ var toString_1 = function (argument) {
|
|
|
22224
22313
|
var charAt = functionUncurryThis(''.charAt);
|
|
22225
22314
|
|
|
22226
22315
|
var FORCED = fails(function () {
|
|
22227
|
-
// eslint-disable-next-line es
|
|
22316
|
+
// eslint-disable-next-line es/no-array-string-prototype-at -- safe
|
|
22228
22317
|
return '𠮷'.at(-2) !== '\uD842';
|
|
22229
22318
|
});
|
|
22230
22319
|
|
|
@@ -22242,14 +22331,14 @@ _export({ target: 'String', proto: true, forced: FORCED }, {
|
|
|
22242
22331
|
|
|
22243
22332
|
// `Object.keys` method
|
|
22244
22333
|
// https://tc39.es/ecma262/#sec-object.keys
|
|
22245
|
-
// eslint-disable-next-line es
|
|
22334
|
+
// eslint-disable-next-line es/no-object-keys -- safe
|
|
22246
22335
|
var objectKeys = Object.keys || function keys(O) {
|
|
22247
22336
|
return objectKeysInternal(O, enumBugKeys);
|
|
22248
22337
|
};
|
|
22249
22338
|
|
|
22250
22339
|
// `Object.defineProperties` method
|
|
22251
22340
|
// https://tc39.es/ecma262/#sec-object.defineproperties
|
|
22252
|
-
// eslint-disable-next-line es
|
|
22341
|
+
// eslint-disable-next-line es/no-object-defineproperties -- safe
|
|
22253
22342
|
var f$5 = descriptors && !v8PrototypeDefineBug ? Object.defineProperties : function defineProperties(O, Properties) {
|
|
22254
22343
|
anObject(O);
|
|
22255
22344
|
var props = toIndexedObject(Properties);
|
|
@@ -22338,7 +22427,7 @@ hiddenKeys[IE_PROTO] = true;
|
|
|
22338
22427
|
|
|
22339
22428
|
// `Object.create` method
|
|
22340
22429
|
// https://tc39.es/ecma262/#sec-object.create
|
|
22341
|
-
// eslint-disable-next-line es
|
|
22430
|
+
// eslint-disable-next-line es/no-object-create -- safe
|
|
22342
22431
|
var objectCreate = Object.create || function create(O, Properties) {
|
|
22343
22432
|
var result;
|
|
22344
22433
|
if (O !== null) {
|
|
@@ -22384,13 +22473,13 @@ _export({ target: 'Array', proto: true }, {
|
|
|
22384
22473
|
|
|
22385
22474
|
addToUnscopables('at');
|
|
22386
22475
|
|
|
22387
|
-
// eslint-disable-next-line es
|
|
22388
|
-
var
|
|
22476
|
+
// eslint-disable-next-line es/no-typed-arrays -- safe
|
|
22477
|
+
var arrayBufferBasicDetection = typeof ArrayBuffer != 'undefined' && typeof DataView != 'undefined';
|
|
22389
22478
|
|
|
22390
22479
|
var correctPrototypeGetter = !fails(function () {
|
|
22391
22480
|
function F() { /* empty */ }
|
|
22392
22481
|
F.prototype.constructor = null;
|
|
22393
|
-
// eslint-disable-next-line es
|
|
22482
|
+
// eslint-disable-next-line es/no-object-getprototypeof -- required for testing
|
|
22394
22483
|
return Object.getPrototypeOf(new F()) !== F.prototype;
|
|
22395
22484
|
});
|
|
22396
22485
|
|
|
@@ -22400,7 +22489,7 @@ var ObjectPrototype = $Object$4.prototype;
|
|
|
22400
22489
|
|
|
22401
22490
|
// `Object.getPrototypeOf` method
|
|
22402
22491
|
// https://tc39.es/ecma262/#sec-object.getprototypeof
|
|
22403
|
-
// eslint-disable-next-line es
|
|
22492
|
+
// eslint-disable-next-line es/no-object-getprototypeof -- safe
|
|
22404
22493
|
var objectGetPrototypeOf = correctPrototypeGetter ? $Object$4.getPrototypeOf : function (O) {
|
|
22405
22494
|
var object = toObject(O);
|
|
22406
22495
|
if (hasOwnProperty_1(object, IE_PROTO$1)) return object[IE_PROTO$1];
|
|
@@ -22426,13 +22515,13 @@ var aPossiblePrototype = function (argument) {
|
|
|
22426
22515
|
// `Object.setPrototypeOf` method
|
|
22427
22516
|
// https://tc39.es/ecma262/#sec-object.setprototypeof
|
|
22428
22517
|
// Works with __proto__ only. Old v8 can't work with null proto objects.
|
|
22429
|
-
// eslint-disable-next-line es
|
|
22518
|
+
// eslint-disable-next-line es/no-object-setprototypeof -- safe
|
|
22430
22519
|
var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? function () {
|
|
22431
22520
|
var CORRECT_SETTER = false;
|
|
22432
22521
|
var test = {};
|
|
22433
22522
|
var setter;
|
|
22434
22523
|
try {
|
|
22435
|
-
// eslint-disable-next-line es
|
|
22524
|
+
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
22436
22525
|
setter = functionUncurryThis(Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set);
|
|
22437
22526
|
setter(test, []);
|
|
22438
22527
|
CORRECT_SETTER = test instanceof Array;
|
|
@@ -22469,7 +22558,7 @@ var TO_STRING_TAG$2 = wellKnownSymbol('toStringTag');
|
|
|
22469
22558
|
var TYPED_ARRAY_TAG = uid('TYPED_ARRAY_TAG');
|
|
22470
22559
|
var TYPED_ARRAY_CONSTRUCTOR = 'TypedArrayConstructor';
|
|
22471
22560
|
// Fixing native typed arrays in Opera Presto crashes the browser, see #595
|
|
22472
|
-
var NATIVE_ARRAY_BUFFER_VIEWS =
|
|
22561
|
+
var NATIVE_ARRAY_BUFFER_VIEWS = arrayBufferBasicDetection && !!objectSetPrototypeOf && classof(global_1.opera) !== 'Opera';
|
|
22473
22562
|
var TYPED_ARRAY_TAG_REQUIRED = false;
|
|
22474
22563
|
var NAME, Constructor, Prototype;
|
|
22475
22564
|
|
|
@@ -37458,49 +37547,624 @@ var TableHeading_styled = styled.th.withConfig({
|
|
|
37458
37547
|
return extraStyles;
|
|
37459
37548
|
});
|
|
37460
37549
|
|
|
37461
|
-
|
|
37462
|
-
value
|
|
37463
|
-
|
|
37464
|
-
|
|
37550
|
+
var validatorToPredicate = function validatorToPredicate(validatorFn, emptyCase) {
|
|
37551
|
+
return function (value) {
|
|
37552
|
+
for (var _len = arguments.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
37553
|
+
rest[_key - 1] = arguments[_key];
|
|
37554
|
+
}
|
|
37555
|
+
|
|
37556
|
+
return value === "" ? emptyCase : validatorFn.apply(void 0, [value].concat(rest));
|
|
37557
|
+
};
|
|
37558
|
+
};
|
|
37465
37559
|
|
|
37466
37560
|
var commonjsGlobal$1 = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
37467
37561
|
|
|
37468
|
-
|
|
37562
|
+
function getDefaultExportFromCjs(x) {
|
|
37563
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
37564
|
+
}
|
|
37565
|
+
|
|
37566
|
+
var dayjs_min = {
|
|
37567
|
+
exports: {}
|
|
37568
|
+
};
|
|
37469
37569
|
|
|
37470
37570
|
(function (module, exports) {
|
|
37471
|
-
!function
|
|
37472
|
-
|
|
37571
|
+
!function (t, e) {
|
|
37572
|
+
module.exports = e();
|
|
37573
|
+
}(commonjsGlobal$1, function () {
|
|
37574
|
+
var t = 1e3,
|
|
37575
|
+
e = 6e4,
|
|
37576
|
+
n = 36e5,
|
|
37577
|
+
r = "millisecond",
|
|
37578
|
+
i = "second",
|
|
37579
|
+
s = "minute",
|
|
37580
|
+
u = "hour",
|
|
37581
|
+
a = "day",
|
|
37582
|
+
o = "week",
|
|
37583
|
+
f = "month",
|
|
37584
|
+
h = "quarter",
|
|
37585
|
+
c = "year",
|
|
37586
|
+
d = "date",
|
|
37587
|
+
$ = "Invalid Date",
|
|
37588
|
+
l = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,
|
|
37589
|
+
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,
|
|
37590
|
+
M = {
|
|
37591
|
+
name: "en",
|
|
37592
|
+
weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),
|
|
37593
|
+
months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_")
|
|
37594
|
+
},
|
|
37595
|
+
m = function m(t, e, n) {
|
|
37596
|
+
var r = String(t);
|
|
37597
|
+
return !r || r.length >= e ? t : "" + Array(e + 1 - r.length).join(n) + t;
|
|
37598
|
+
},
|
|
37599
|
+
g = {
|
|
37600
|
+
s: m,
|
|
37601
|
+
z: function z(t) {
|
|
37602
|
+
var e = -t.utcOffset(),
|
|
37603
|
+
n = Math.abs(e),
|
|
37604
|
+
r = Math.floor(n / 60),
|
|
37605
|
+
i = n % 60;
|
|
37606
|
+
return (e <= 0 ? "+" : "-") + m(r, 2, "0") + ":" + m(i, 2, "0");
|
|
37607
|
+
},
|
|
37608
|
+
m: function t(e, n) {
|
|
37609
|
+
if (e.date() < n.date()) return -t(n, e);
|
|
37610
|
+
var r = 12 * (n.year() - e.year()) + (n.month() - e.month()),
|
|
37611
|
+
i = e.clone().add(r, f),
|
|
37612
|
+
s = n - i < 0,
|
|
37613
|
+
u = e.clone().add(r + (s ? -1 : 1), f);
|
|
37614
|
+
return +(-(r + (n - i) / (s ? i - u : u - i)) || 0);
|
|
37615
|
+
},
|
|
37616
|
+
a: function a(t) {
|
|
37617
|
+
return t < 0 ? Math.ceil(t) || 0 : Math.floor(t);
|
|
37618
|
+
},
|
|
37619
|
+
p: function p(t) {
|
|
37620
|
+
return {
|
|
37621
|
+
M: f,
|
|
37622
|
+
y: c,
|
|
37623
|
+
w: o,
|
|
37624
|
+
d: a,
|
|
37625
|
+
D: d,
|
|
37626
|
+
h: u,
|
|
37627
|
+
m: s,
|
|
37628
|
+
s: i,
|
|
37629
|
+
ms: r,
|
|
37630
|
+
Q: h
|
|
37631
|
+
}[t] || String(t || "").toLowerCase().replace(/s$/, "");
|
|
37632
|
+
},
|
|
37633
|
+
u: function u(t) {
|
|
37634
|
+
return void 0 === t;
|
|
37635
|
+
}
|
|
37636
|
+
},
|
|
37637
|
+
D = "en",
|
|
37638
|
+
v = {};
|
|
37473
37639
|
|
|
37474
|
-
|
|
37640
|
+
v[D] = M;
|
|
37475
37641
|
|
|
37476
|
-
var
|
|
37642
|
+
var p = function p(t) {
|
|
37643
|
+
return t instanceof _;
|
|
37644
|
+
},
|
|
37645
|
+
S = function S(t, e, n) {
|
|
37646
|
+
var r;
|
|
37647
|
+
if (!t) return D;
|
|
37648
|
+
if ("string" == typeof t) v[t] && (r = t), e && (v[t] = e, r = t);else {
|
|
37649
|
+
var i = t.name;
|
|
37650
|
+
v[i] = t, r = i;
|
|
37651
|
+
}
|
|
37652
|
+
return !n && r && (D = r), r || !n && D;
|
|
37653
|
+
},
|
|
37654
|
+
w = function w(t, e) {
|
|
37655
|
+
if (p(t)) return t.clone();
|
|
37656
|
+
var n = "object" == _typeof(e) ? e : {};
|
|
37657
|
+
return n.date = t, n.args = arguments, new _(n);
|
|
37658
|
+
},
|
|
37659
|
+
O = g;
|
|
37660
|
+
|
|
37661
|
+
O.l = S, O.i = p, O.w = function (t, e) {
|
|
37662
|
+
return w(t, {
|
|
37663
|
+
locale: e.$L,
|
|
37664
|
+
utc: e.$u,
|
|
37665
|
+
x: e.$x,
|
|
37666
|
+
$offset: e.$offset
|
|
37667
|
+
});
|
|
37668
|
+
};
|
|
37477
37669
|
|
|
37478
|
-
|
|
37479
|
-
|
|
37480
|
-
|
|
37670
|
+
var _ = function () {
|
|
37671
|
+
function M(t) {
|
|
37672
|
+
this.$L = S(t.locale, null, !0), this.parse(t);
|
|
37673
|
+
}
|
|
37674
|
+
|
|
37675
|
+
var m = M.prototype;
|
|
37676
|
+
return m.parse = function (t) {
|
|
37677
|
+
this.$d = function (t) {
|
|
37678
|
+
var e = t.date,
|
|
37679
|
+
n = t.utc;
|
|
37680
|
+
if (null === e) return new Date(NaN);
|
|
37681
|
+
if (O.u(e)) return new Date();
|
|
37682
|
+
if (e instanceof Date) return new Date(e);
|
|
37683
|
+
|
|
37684
|
+
if ("string" == typeof e && !/Z$/i.test(e)) {
|
|
37685
|
+
var r = e.match(l);
|
|
37686
|
+
|
|
37687
|
+
if (r) {
|
|
37688
|
+
var i = r[2] - 1 || 0,
|
|
37689
|
+
s = (r[7] || "0").substring(0, 3);
|
|
37690
|
+
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);
|
|
37691
|
+
}
|
|
37692
|
+
}
|
|
37693
|
+
|
|
37694
|
+
return new Date(e);
|
|
37695
|
+
}(t), this.$x = t.x || {}, this.init();
|
|
37696
|
+
}, m.init = function () {
|
|
37697
|
+
var t = this.$d;
|
|
37698
|
+
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();
|
|
37699
|
+
}, m.$utils = function () {
|
|
37700
|
+
return O;
|
|
37701
|
+
}, m.isValid = function () {
|
|
37702
|
+
return !(this.$d.toString() === $);
|
|
37703
|
+
}, m.isSame = function (t, e) {
|
|
37704
|
+
var n = w(t);
|
|
37705
|
+
return this.startOf(e) <= n && n <= this.endOf(e);
|
|
37706
|
+
}, m.isAfter = function (t, e) {
|
|
37707
|
+
return w(t) < this.startOf(e);
|
|
37708
|
+
}, m.isBefore = function (t, e) {
|
|
37709
|
+
return this.endOf(e) < w(t);
|
|
37710
|
+
}, m.$g = function (t, e, n) {
|
|
37711
|
+
return O.u(t) ? this[e] : this.set(n, t);
|
|
37712
|
+
}, m.unix = function () {
|
|
37713
|
+
return Math.floor(this.valueOf() / 1e3);
|
|
37714
|
+
}, m.valueOf = function () {
|
|
37715
|
+
return this.$d.getTime();
|
|
37716
|
+
}, m.startOf = function (t, e) {
|
|
37717
|
+
var n = this,
|
|
37718
|
+
r = !!O.u(e) || e,
|
|
37719
|
+
h = O.p(t),
|
|
37720
|
+
$ = function $(t, e) {
|
|
37721
|
+
var i = O.w(n.$u ? Date.UTC(n.$y, e, t) : new Date(n.$y, e, t), n);
|
|
37722
|
+
return r ? i : i.endOf(a);
|
|
37723
|
+
},
|
|
37724
|
+
l = function l(t, e) {
|
|
37725
|
+
return O.w(n.toDate()[t].apply(n.toDate("s"), (r ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e)), n);
|
|
37726
|
+
},
|
|
37727
|
+
y = this.$W,
|
|
37728
|
+
M = this.$M,
|
|
37729
|
+
m = this.$D,
|
|
37730
|
+
g = "set" + (this.$u ? "UTC" : "");
|
|
37731
|
+
|
|
37732
|
+
switch (h) {
|
|
37733
|
+
case c:
|
|
37734
|
+
return r ? $(1, 0) : $(31, 11);
|
|
37735
|
+
|
|
37736
|
+
case f:
|
|
37737
|
+
return r ? $(1, M) : $(0, M + 1);
|
|
37738
|
+
|
|
37739
|
+
case o:
|
|
37740
|
+
var D = this.$locale().weekStart || 0,
|
|
37741
|
+
v = (y < D ? y + 7 : y) - D;
|
|
37742
|
+
return $(r ? m - v : m + (6 - v), M);
|
|
37743
|
+
|
|
37744
|
+
case a:
|
|
37745
|
+
case d:
|
|
37746
|
+
return l(g + "Hours", 0);
|
|
37747
|
+
|
|
37748
|
+
case u:
|
|
37749
|
+
return l(g + "Minutes", 1);
|
|
37750
|
+
|
|
37751
|
+
case s:
|
|
37752
|
+
return l(g + "Seconds", 2);
|
|
37753
|
+
|
|
37754
|
+
case i:
|
|
37755
|
+
return l(g + "Milliseconds", 3);
|
|
37756
|
+
|
|
37757
|
+
default:
|
|
37758
|
+
return this.clone();
|
|
37759
|
+
}
|
|
37760
|
+
}, m.endOf = function (t) {
|
|
37761
|
+
return this.startOf(t, !1);
|
|
37762
|
+
}, m.$set = function (t, e) {
|
|
37763
|
+
var n,
|
|
37764
|
+
o = O.p(t),
|
|
37765
|
+
h = "set" + (this.$u ? "UTC" : ""),
|
|
37766
|
+
$ = (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],
|
|
37767
|
+
l = o === a ? this.$D + (e - this.$W) : e;
|
|
37768
|
+
|
|
37769
|
+
if (o === f || o === c) {
|
|
37770
|
+
var y = this.clone().set(d, 1);
|
|
37771
|
+
y.$d[$](l), y.init(), this.$d = y.set(d, Math.min(this.$D, y.daysInMonth())).$d;
|
|
37772
|
+
} else $ && this.$d[$](l);
|
|
37773
|
+
|
|
37774
|
+
return this.init(), this;
|
|
37775
|
+
}, m.set = function (t, e) {
|
|
37776
|
+
return this.clone().$set(t, e);
|
|
37777
|
+
}, m.get = function (t) {
|
|
37778
|
+
return this[O.p(t)]();
|
|
37779
|
+
}, m.add = function (r, h) {
|
|
37780
|
+
var d,
|
|
37781
|
+
$ = this;
|
|
37782
|
+
r = Number(r);
|
|
37783
|
+
|
|
37784
|
+
var l = O.p(h),
|
|
37785
|
+
y = function y(t) {
|
|
37786
|
+
var e = w($);
|
|
37787
|
+
return O.w(e.date(e.date() + Math.round(t * r)), $);
|
|
37788
|
+
};
|
|
37481
37789
|
|
|
37482
|
-
|
|
37790
|
+
if (l === f) return this.set(f, this.$M + r);
|
|
37791
|
+
if (l === c) return this.set(c, this.$y + r);
|
|
37792
|
+
if (l === a) return y(1);
|
|
37793
|
+
if (l === o) return y(7);
|
|
37794
|
+
var M = (d = {}, d[s] = e, d[u] = n, d[i] = t, d)[l] || 1,
|
|
37795
|
+
m = this.$d.getTime() + r * M;
|
|
37796
|
+
return O.w(m, this);
|
|
37797
|
+
}, m.subtract = function (t, e) {
|
|
37798
|
+
return this.add(-1 * t, e);
|
|
37799
|
+
}, m.format = function (t) {
|
|
37800
|
+
var e = this,
|
|
37801
|
+
n = this.$locale();
|
|
37802
|
+
if (!this.isValid()) return n.invalidDate || $;
|
|
37803
|
+
|
|
37804
|
+
var r = t || "YYYY-MM-DDTHH:mm:ssZ",
|
|
37805
|
+
i = O.z(this),
|
|
37806
|
+
s = this.$H,
|
|
37807
|
+
u = this.$m,
|
|
37808
|
+
a = this.$M,
|
|
37809
|
+
o = n.weekdays,
|
|
37810
|
+
f = n.months,
|
|
37811
|
+
h = function h(t, n, i, s) {
|
|
37812
|
+
return t && (t[n] || t(e, r)) || i[n].substr(0, s);
|
|
37813
|
+
},
|
|
37814
|
+
c = function c(t) {
|
|
37815
|
+
return O.s(s % 12 || 12, t, "0");
|
|
37816
|
+
},
|
|
37817
|
+
d = n.meridiem || function (t, e, n) {
|
|
37818
|
+
var r = t < 12 ? "AM" : "PM";
|
|
37819
|
+
return n ? r.toLowerCase() : r;
|
|
37820
|
+
},
|
|
37821
|
+
l = {
|
|
37822
|
+
YY: String(this.$y).slice(-2),
|
|
37823
|
+
YYYY: this.$y,
|
|
37824
|
+
M: a + 1,
|
|
37825
|
+
MM: O.s(a + 1, 2, "0"),
|
|
37826
|
+
MMM: h(n.monthsShort, a, f, 3),
|
|
37827
|
+
MMMM: h(f, a),
|
|
37828
|
+
D: this.$D,
|
|
37829
|
+
DD: O.s(this.$D, 2, "0"),
|
|
37830
|
+
d: String(this.$W),
|
|
37831
|
+
dd: h(n.weekdaysMin, this.$W, o, 2),
|
|
37832
|
+
ddd: h(n.weekdaysShort, this.$W, o, 3),
|
|
37833
|
+
dddd: o[this.$W],
|
|
37834
|
+
H: String(s),
|
|
37835
|
+
HH: O.s(s, 2, "0"),
|
|
37836
|
+
h: c(1),
|
|
37837
|
+
hh: c(2),
|
|
37838
|
+
a: d(s, u, !0),
|
|
37839
|
+
A: d(s, u, !1),
|
|
37840
|
+
m: String(u),
|
|
37841
|
+
mm: O.s(u, 2, "0"),
|
|
37842
|
+
s: String(this.$s),
|
|
37843
|
+
ss: O.s(this.$s, 2, "0"),
|
|
37844
|
+
SSS: O.s(this.$ms, 3, "0"),
|
|
37845
|
+
Z: i
|
|
37846
|
+
};
|
|
37483
37847
|
|
|
37484
|
-
|
|
37848
|
+
return r.replace(y, function (t, e) {
|
|
37849
|
+
return e || l[t] || i.replace(":", "");
|
|
37850
|
+
});
|
|
37851
|
+
}, m.utcOffset = function () {
|
|
37852
|
+
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
|
|
37853
|
+
}, m.diff = function (r, d, $) {
|
|
37854
|
+
var l,
|
|
37855
|
+
y = O.p(d),
|
|
37856
|
+
M = w(r),
|
|
37857
|
+
m = (M.utcOffset() - this.utcOffset()) * e,
|
|
37858
|
+
g = this - M,
|
|
37859
|
+
D = O.m(this, M);
|
|
37860
|
+
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);
|
|
37861
|
+
}, m.daysInMonth = function () {
|
|
37862
|
+
return this.endOf(f).$D;
|
|
37863
|
+
}, m.$locale = function () {
|
|
37864
|
+
return v[this.$L];
|
|
37865
|
+
}, m.locale = function (t, e) {
|
|
37866
|
+
if (!t) return this.$L;
|
|
37867
|
+
var n = this.clone(),
|
|
37868
|
+
r = S(t, e, !0);
|
|
37869
|
+
return r && (n.$L = r), n;
|
|
37870
|
+
}, m.clone = function () {
|
|
37871
|
+
return O.w(this.$d, this);
|
|
37872
|
+
}, m.toDate = function () {
|
|
37873
|
+
return new Date(this.valueOf());
|
|
37874
|
+
}, m.toJSON = function () {
|
|
37875
|
+
return this.isValid() ? this.toISOString() : null;
|
|
37876
|
+
}, m.toISOString = function () {
|
|
37877
|
+
return this.$d.toISOString();
|
|
37878
|
+
}, m.toString = function () {
|
|
37879
|
+
return this.$d.toUTCString();
|
|
37880
|
+
}, M;
|
|
37881
|
+
}(),
|
|
37882
|
+
b = _.prototype;
|
|
37883
|
+
|
|
37884
|
+
return w.prototype = b, [["$ms", r], ["$s", i], ["$m", s], ["$H", u], ["$W", a], ["$M", f], ["$y", c], ["$D", d]].forEach(function (t) {
|
|
37885
|
+
b[t[1]] = function (e) {
|
|
37886
|
+
return this.$g(e, t[0], t[1]);
|
|
37887
|
+
};
|
|
37888
|
+
}), w.extend = function (t, e) {
|
|
37889
|
+
return t.$i || (t(e, _, w), t.$i = !0), w;
|
|
37890
|
+
}, w.locale = S, w.isDayjs = p, w.unix = function (t) {
|
|
37891
|
+
return w(1e3 * t);
|
|
37892
|
+
}, w.en = v[D], w.Ls = v, w.p = {}, w;
|
|
37893
|
+
});
|
|
37894
|
+
})(dayjs_min);
|
|
37895
|
+
|
|
37896
|
+
var dayjs_minExports = dayjs_min.exports;
|
|
37897
|
+
var dayjs = /*@__PURE__*/getDefaultExportFromCjs(dayjs_minExports);
|
|
37898
|
+
var customParseFormat$1 = {
|
|
37899
|
+
exports: {}
|
|
37900
|
+
};
|
|
37485
37901
|
|
|
37486
37902
|
(function (module, exports) {
|
|
37487
|
-
!function(
|
|
37488
|
-
|
|
37903
|
+
!function (t, e) {
|
|
37904
|
+
module.exports = e();
|
|
37905
|
+
}(commonjsGlobal$1, function () {
|
|
37906
|
+
var t = {
|
|
37907
|
+
LTS: "h:mm:ss A",
|
|
37908
|
+
LT: "h:mm A",
|
|
37909
|
+
L: "MM/DD/YYYY",
|
|
37910
|
+
LL: "MMMM D, YYYY",
|
|
37911
|
+
LLL: "MMMM D, YYYY h:mm A",
|
|
37912
|
+
LLLL: "dddd, MMMM D, YYYY h:mm A"
|
|
37913
|
+
},
|
|
37914
|
+
e = /(\[[^[]*\])|([-:/.()\s]+)|(A|a|YYYY|YY?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,
|
|
37915
|
+
n = /\d\d/,
|
|
37916
|
+
r = /\d\d?/,
|
|
37917
|
+
i = /\d*[^\s\d-_:/()]+/,
|
|
37918
|
+
o = {},
|
|
37919
|
+
s = function s(t) {
|
|
37920
|
+
return (t = +t) + (t > 68 ? 1900 : 2e3);
|
|
37921
|
+
};
|
|
37922
|
+
|
|
37923
|
+
var a = function a(t) {
|
|
37924
|
+
return function (e) {
|
|
37925
|
+
this[t] = +e;
|
|
37926
|
+
};
|
|
37927
|
+
},
|
|
37928
|
+
f = [/[+-]\d\d:?(\d\d)?|Z/, function (t) {
|
|
37929
|
+
(this.zone || (this.zone = {})).offset = function (t) {
|
|
37930
|
+
if (!t) return 0;
|
|
37931
|
+
if ("Z" === t) return 0;
|
|
37932
|
+
var e = t.match(/([+-]|\d\d)/g),
|
|
37933
|
+
n = 60 * e[1] + (+e[2] || 0);
|
|
37934
|
+
return 0 === n ? 0 : "+" === e[0] ? -n : n;
|
|
37935
|
+
}(t);
|
|
37936
|
+
}],
|
|
37937
|
+
u = function u(t) {
|
|
37938
|
+
var e = o[t];
|
|
37939
|
+
return e && (e.indexOf ? e : e.s.concat(e.f));
|
|
37940
|
+
},
|
|
37941
|
+
h = function h(t, e) {
|
|
37942
|
+
var n,
|
|
37943
|
+
r = o.meridiem;
|
|
37944
|
+
|
|
37945
|
+
if (r) {
|
|
37946
|
+
for (var i = 1; i <= 24; i += 1) {
|
|
37947
|
+
if (t.indexOf(r(i, 0, e)) > -1) {
|
|
37948
|
+
n = i > 12;
|
|
37949
|
+
break;
|
|
37950
|
+
}
|
|
37951
|
+
}
|
|
37952
|
+
} else n = t === (e ? "pm" : "PM");
|
|
37953
|
+
|
|
37954
|
+
return n;
|
|
37955
|
+
},
|
|
37956
|
+
d = {
|
|
37957
|
+
A: [i, function (t) {
|
|
37958
|
+
this.afternoon = h(t, !1);
|
|
37959
|
+
}],
|
|
37960
|
+
a: [i, function (t) {
|
|
37961
|
+
this.afternoon = h(t, !0);
|
|
37962
|
+
}],
|
|
37963
|
+
S: [/\d/, function (t) {
|
|
37964
|
+
this.milliseconds = 100 * +t;
|
|
37965
|
+
}],
|
|
37966
|
+
SS: [n, function (t) {
|
|
37967
|
+
this.milliseconds = 10 * +t;
|
|
37968
|
+
}],
|
|
37969
|
+
SSS: [/\d{3}/, function (t) {
|
|
37970
|
+
this.milliseconds = +t;
|
|
37971
|
+
}],
|
|
37972
|
+
s: [r, a("seconds")],
|
|
37973
|
+
ss: [r, a("seconds")],
|
|
37974
|
+
m: [r, a("minutes")],
|
|
37975
|
+
mm: [r, a("minutes")],
|
|
37976
|
+
H: [r, a("hours")],
|
|
37977
|
+
h: [r, a("hours")],
|
|
37978
|
+
HH: [r, a("hours")],
|
|
37979
|
+
hh: [r, a("hours")],
|
|
37980
|
+
D: [r, a("day")],
|
|
37981
|
+
DD: [n, a("day")],
|
|
37982
|
+
Do: [i, function (t) {
|
|
37983
|
+
var e = o.ordinal,
|
|
37984
|
+
n = t.match(/\d+/);
|
|
37985
|
+
if (this.day = n[0], e) for (var r = 1; r <= 31; r += 1) {
|
|
37986
|
+
e(r).replace(/\[|\]/g, "") === t && (this.day = r);
|
|
37987
|
+
}
|
|
37988
|
+
}],
|
|
37989
|
+
M: [r, a("month")],
|
|
37990
|
+
MM: [n, a("month")],
|
|
37991
|
+
MMM: [i, function (t) {
|
|
37992
|
+
var e = u("months"),
|
|
37993
|
+
n = (u("monthsShort") || e.map(function (t) {
|
|
37994
|
+
return t.substr(0, 3);
|
|
37995
|
+
})).indexOf(t) + 1;
|
|
37996
|
+
if (n < 1) throw new Error();
|
|
37997
|
+
this.month = n % 12 || n;
|
|
37998
|
+
}],
|
|
37999
|
+
MMMM: [i, function (t) {
|
|
38000
|
+
var e = u("months").indexOf(t) + 1;
|
|
38001
|
+
if (e < 1) throw new Error();
|
|
38002
|
+
this.month = e % 12 || e;
|
|
38003
|
+
}],
|
|
38004
|
+
Y: [/[+-]?\d+/, a("year")],
|
|
38005
|
+
YY: [n, function (t) {
|
|
38006
|
+
this.year = s(t);
|
|
38007
|
+
}],
|
|
38008
|
+
YYYY: [/\d{4}/, a("year")],
|
|
38009
|
+
Z: f,
|
|
38010
|
+
ZZ: f
|
|
38011
|
+
};
|
|
38012
|
+
|
|
38013
|
+
function c(n) {
|
|
38014
|
+
var r, i;
|
|
38015
|
+
r = n, i = o && o.formats;
|
|
38016
|
+
|
|
38017
|
+
for (var s = (n = r.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, function (e, n, r) {
|
|
38018
|
+
var o = r && r.toUpperCase();
|
|
38019
|
+
return n || i[r] || t[r] || i[o].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, function (t, e, n) {
|
|
38020
|
+
return e || n.slice(1);
|
|
38021
|
+
});
|
|
38022
|
+
})).match(e), a = s.length, f = 0; f < a; f += 1) {
|
|
38023
|
+
var u = s[f],
|
|
38024
|
+
h = d[u],
|
|
38025
|
+
c = h && h[0],
|
|
38026
|
+
l = h && h[1];
|
|
38027
|
+
s[f] = l ? {
|
|
38028
|
+
regex: c,
|
|
38029
|
+
parser: l
|
|
38030
|
+
} : u.replace(/^\[|\]$/g, "");
|
|
38031
|
+
}
|
|
38032
|
+
|
|
38033
|
+
return function (t) {
|
|
38034
|
+
for (var e = {}, n = 0, r = 0; n < a; n += 1) {
|
|
38035
|
+
var i = s[n];
|
|
38036
|
+
if ("string" == typeof i) r += i.length;else {
|
|
38037
|
+
var o = i.regex,
|
|
38038
|
+
f = i.parser,
|
|
38039
|
+
u = t.substr(r),
|
|
38040
|
+
h = o.exec(u)[0];
|
|
38041
|
+
f.call(e, h), t = t.replace(h, "");
|
|
38042
|
+
}
|
|
38043
|
+
}
|
|
38044
|
+
|
|
38045
|
+
return function (t) {
|
|
38046
|
+
var e = t.afternoon;
|
|
38047
|
+
|
|
38048
|
+
if (void 0 !== e) {
|
|
38049
|
+
var n = t.hours;
|
|
38050
|
+
e ? n < 12 && (t.hours += 12) : 12 === n && (t.hours = 0), delete t.afternoon;
|
|
38051
|
+
}
|
|
38052
|
+
}(e), e;
|
|
38053
|
+
};
|
|
38054
|
+
}
|
|
37489
38055
|
|
|
37490
|
-
|
|
38056
|
+
return function (t, e, n) {
|
|
38057
|
+
n.p.customParseFormat = !0, t && t.parseTwoDigitYear && (s = t.parseTwoDigitYear);
|
|
38058
|
+
var r = e.prototype,
|
|
38059
|
+
i = r.parse;
|
|
38060
|
+
|
|
38061
|
+
r.parse = function (t) {
|
|
38062
|
+
var e = t.date,
|
|
38063
|
+
r = t.utc,
|
|
38064
|
+
s = t.args;
|
|
38065
|
+
this.$u = r;
|
|
38066
|
+
var a = s[1];
|
|
38067
|
+
|
|
38068
|
+
if ("string" == typeof a) {
|
|
38069
|
+
var f = !0 === s[2],
|
|
38070
|
+
u = !0 === s[3],
|
|
38071
|
+
h = f || u,
|
|
38072
|
+
d = s[2];
|
|
38073
|
+
u && (d = s[2]), o = this.$locale(), !f && d && (o = n.Ls[d]), this.$d = function (t, e, n) {
|
|
38074
|
+
try {
|
|
38075
|
+
if (["x", "X"].indexOf(e) > -1) return new Date(("X" === e ? 1e3 : 1) * t);
|
|
38076
|
+
var r = c(e)(t),
|
|
38077
|
+
i = r.year,
|
|
38078
|
+
o = r.month,
|
|
38079
|
+
s = r.day,
|
|
38080
|
+
a = r.hours,
|
|
38081
|
+
f = r.minutes,
|
|
38082
|
+
u = r.seconds,
|
|
38083
|
+
h = r.milliseconds,
|
|
38084
|
+
d = r.zone,
|
|
38085
|
+
l = new Date(),
|
|
38086
|
+
m = s || (i || o ? 1 : l.getDate()),
|
|
38087
|
+
M = i || l.getFullYear(),
|
|
38088
|
+
Y = 0;
|
|
38089
|
+
i && !o || (Y = o > 0 ? o - 1 : l.getMonth());
|
|
38090
|
+
var p = a || 0,
|
|
38091
|
+
v = f || 0,
|
|
38092
|
+
D = u || 0,
|
|
38093
|
+
g = h || 0;
|
|
38094
|
+
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);
|
|
38095
|
+
} catch (t) {
|
|
38096
|
+
return new Date("");
|
|
38097
|
+
}
|
|
38098
|
+
}(e, a, r), this.init(), d && !0 !== d && (this.$L = this.locale(d).$L), h && e != this.format(a) && (this.$d = new Date("")), o = {};
|
|
38099
|
+
} else if (a instanceof Array) for (var l = a.length, m = 1; m <= l; m += 1) {
|
|
38100
|
+
s[1] = a[m - 1];
|
|
38101
|
+
var M = n.apply(this, s);
|
|
37491
38102
|
|
|
37492
|
-
|
|
38103
|
+
if (M.isValid()) {
|
|
38104
|
+
this.$d = M.$d, this.$L = M.$L, this.init();
|
|
38105
|
+
break;
|
|
38106
|
+
}
|
|
38107
|
+
|
|
38108
|
+
m === l && (this.$d = new Date(""));
|
|
38109
|
+
} else i.call(this, t);
|
|
38110
|
+
};
|
|
38111
|
+
};
|
|
38112
|
+
});
|
|
38113
|
+
})(customParseFormat$1);
|
|
38114
|
+
|
|
38115
|
+
var customParseFormatExports = customParseFormat$1.exports;
|
|
38116
|
+
var customParseFormat = /*@__PURE__*/getDefaultExportFromCjs(customParseFormatExports);
|
|
38117
|
+
var isSameOrBefore$1 = {
|
|
38118
|
+
exports: {}
|
|
38119
|
+
};
|
|
37493
38120
|
|
|
37494
38121
|
(function (module, exports) {
|
|
37495
|
-
!function(e,
|
|
37496
|
-
|
|
38122
|
+
!function (e, i) {
|
|
38123
|
+
module.exports = i();
|
|
38124
|
+
}(commonjsGlobal$1, function () {
|
|
38125
|
+
return function (e, i) {
|
|
38126
|
+
i.prototype.isSameOrBefore = function (e, i) {
|
|
38127
|
+
return this.isSame(e, i) || this.isBefore(e, i);
|
|
38128
|
+
};
|
|
38129
|
+
};
|
|
38130
|
+
});
|
|
38131
|
+
})(isSameOrBefore$1);
|
|
37497
38132
|
|
|
37498
|
-
var
|
|
38133
|
+
var isSameOrBeforeExports = isSameOrBefore$1.exports;
|
|
38134
|
+
var isSameOrBefore = /*@__PURE__*/getDefaultExportFromCjs(isSameOrBeforeExports);
|
|
38135
|
+
var isSameOrAfter$1 = {
|
|
38136
|
+
exports: {}
|
|
38137
|
+
};
|
|
37499
38138
|
|
|
38139
|
+
(function (module, exports) {
|
|
38140
|
+
!function (e, t) {
|
|
38141
|
+
module.exports = t();
|
|
38142
|
+
}(commonjsGlobal$1, function () {
|
|
38143
|
+
return function (e, t) {
|
|
38144
|
+
t.prototype.isSameOrAfter = function (e, t) {
|
|
38145
|
+
return this.isSame(e, t) || this.isAfter(e, t);
|
|
38146
|
+
};
|
|
38147
|
+
};
|
|
38148
|
+
});
|
|
38149
|
+
})(isSameOrAfter$1);
|
|
38150
|
+
|
|
38151
|
+
var isSameOrAfterExports = isSameOrAfter$1.exports;
|
|
38152
|
+
var isSameOrAfter = /*@__PURE__*/getDefaultExportFromCjs(isSameOrAfterExports);
|
|
37500
38153
|
/* eslint-disable no-unused-vars */
|
|
37501
38154
|
|
|
37502
|
-
|
|
37503
|
-
|
|
38155
|
+
var createValidator = function createValidator(type, error) {
|
|
38156
|
+
var validator = function validator() {
|
|
38157
|
+
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
38158
|
+
args[_key2] = arguments[_key2];
|
|
38159
|
+
}
|
|
38160
|
+
|
|
38161
|
+
return {
|
|
38162
|
+
type: type,
|
|
38163
|
+
args: args,
|
|
38164
|
+
error: error
|
|
38165
|
+
};
|
|
38166
|
+
};
|
|
38167
|
+
|
|
37504
38168
|
validator.error = error;
|
|
37505
38169
|
return validator;
|
|
37506
38170
|
};
|
|
@@ -37508,30 +38172,38 @@ const createValidator = (type, error) => {
|
|
|
37508
38172
|
dayjs.extend(customParseFormat);
|
|
37509
38173
|
dayjs.extend(isSameOrBefore);
|
|
37510
38174
|
dayjs.extend(isSameOrAfter);
|
|
38175
|
+
var validatorFns = {};
|
|
38176
|
+
var INCLUDED_IN = "validator/INCLUDED_IN";
|
|
38177
|
+
var INCLUDED_IN_ERROR = "error/INCLUDED_IN";
|
|
38178
|
+
var includedIn = createValidator(INCLUDED_IN, INCLUDED_IN_ERROR);
|
|
37511
38179
|
|
|
37512
|
-
|
|
38180
|
+
validatorFns[INCLUDED_IN] = function (value, args, form) {
|
|
38181
|
+
return Array.isArray(args[0]) ? args[0].includes(value) : args[0] === value;
|
|
38182
|
+
};
|
|
38183
|
+
|
|
38184
|
+
var REQUIRED = "validator/REQUIRED";
|
|
38185
|
+
var REQUIRED_ERROR = "error/REQUIRED";
|
|
38186
|
+
var required = createValidator(REQUIRED, REQUIRED_ERROR);
|
|
37513
38187
|
|
|
37514
|
-
|
|
37515
|
-
|
|
37516
|
-
|
|
37517
|
-
validatorFns[INCLUDED_IN] = (value, args, form) =>
|
|
37518
|
-
Array.isArray(args[0]) ? args[0].includes(value) : args[0] === value;
|
|
38188
|
+
validatorFns[REQUIRED] = function (value, args, form) {
|
|
38189
|
+
return value !== "";
|
|
38190
|
+
};
|
|
37519
38191
|
|
|
37520
|
-
|
|
37521
|
-
|
|
37522
|
-
|
|
37523
|
-
validatorFns[REQUIRED] = (value, args, form) => value !== "";
|
|
38192
|
+
var ONLY_INTEGERS = "validator/ONLY_INTEGERS";
|
|
38193
|
+
var ONLY_INTEGERS_ERROR = "error/ONLY_INTEGERS";
|
|
38194
|
+
var onlyIntegers = createValidator(ONLY_INTEGERS, ONLY_INTEGERS_ERROR);
|
|
37524
38195
|
|
|
37525
|
-
|
|
37526
|
-
|
|
37527
|
-
|
|
37528
|
-
validatorFns[ONLY_INTEGERS] = (value, args, form) => /^(-?\d+)?$/.test(value);
|
|
38196
|
+
validatorFns[ONLY_INTEGERS] = function (value, args, form) {
|
|
38197
|
+
return /^(-?\d+)?$/.test(value);
|
|
38198
|
+
};
|
|
37529
38199
|
|
|
37530
|
-
|
|
37531
|
-
|
|
37532
|
-
|
|
37533
|
-
validatorFns[ONLY_NATURALS] = (value, args, form) => /^(\d+)?$/.test(value);
|
|
38200
|
+
var ONLY_NATURALS = "validator/ONLY_NATURALS";
|
|
38201
|
+
var ONLY_NATURALS_ERROR = "error/ONLY_NATURALS";
|
|
38202
|
+
var onlyNaturals = createValidator(ONLY_NATURALS, ONLY_NATURALS_ERROR);
|
|
37534
38203
|
|
|
38204
|
+
validatorFns[ONLY_NATURALS] = function (value, args, form) {
|
|
38205
|
+
return /^(\d+)?$/.test(value);
|
|
38206
|
+
};
|
|
37535
38207
|
/*
|
|
37536
38208
|
07/22: experimental expiration date constraint
|
|
37537
38209
|
should allow entry of expiration date using "/" character
|
|
@@ -37541,439 +38213,464 @@ not tested as validation function
|
|
|
37541
38213
|
to validate exp date instead use combo of:
|
|
37542
38214
|
required(), hasLength(), isValidMonth(), dateAfterToday()
|
|
37543
38215
|
*/
|
|
37544
|
-
|
|
37545
|
-
|
|
37546
|
-
|
|
37547
|
-
|
|
37548
|
-
|
|
37549
|
-
|
|
37550
|
-
validatorFns[ONLY_EXPIRATION_DATE] = (value, args, form)
|
|
37551
|
-
/^(\d?\d?\/?\d?\d?)?$/.test(value);
|
|
37552
|
-
|
|
37553
|
-
|
|
37554
|
-
|
|
37555
|
-
|
|
37556
|
-
|
|
37557
|
-
|
|
37558
|
-
)
|
|
37559
|
-
validatorFns[NUMBER_LESS_THAN] = (value, args, form) => {
|
|
38216
|
+
|
|
38217
|
+
|
|
38218
|
+
var ONLY_EXPIRATION_DATE = "validator/ONLY_EXPIRATION_DATE";
|
|
38219
|
+
var ONLY_EXPIRATION_DATE_ERROR = "error/ONLY_EXPIRATION_DATE";
|
|
38220
|
+
var onlyExpirationDate = createValidator(ONLY_EXPIRATION_DATE, ONLY_EXPIRATION_DATE_ERROR);
|
|
38221
|
+
|
|
38222
|
+
validatorFns[ONLY_EXPIRATION_DATE] = function (value, args, form) {
|
|
38223
|
+
return /^(\d?\d?\/?\d?\d?)?$/.test(value);
|
|
38224
|
+
};
|
|
38225
|
+
|
|
38226
|
+
var NUMBER_LESS_THAN = "validator/NUMBER_LESS_THAN";
|
|
38227
|
+
var NUMBER_LESS_THAN_ERROR = "error/NUMBER_LESS_THAN";
|
|
38228
|
+
var numberLessThan = createValidator(NUMBER_LESS_THAN, NUMBER_LESS_THAN_ERROR);
|
|
38229
|
+
|
|
38230
|
+
validatorFns[NUMBER_LESS_THAN] = function (value, args, form) {
|
|
37560
38231
|
if (value === "") {
|
|
37561
38232
|
return true;
|
|
37562
38233
|
}
|
|
38234
|
+
|
|
37563
38235
|
return Number(value) < args[0];
|
|
37564
38236
|
};
|
|
37565
38237
|
|
|
37566
|
-
|
|
37567
|
-
|
|
37568
|
-
|
|
37569
|
-
|
|
37570
|
-
|
|
37571
|
-
NUMBER_LESS_THAN_OR_EQUAL_TO,
|
|
37572
|
-
NUMBER_LESS_THAN_OR_EQUAL_TO_ERROR
|
|
37573
|
-
);
|
|
37574
|
-
validatorFns[NUMBER_LESS_THAN_OR_EQUAL_TO] = (value, args, form) => {
|
|
38238
|
+
var NUMBER_LESS_THAN_OR_EQUAL_TO = "validator/NUMBER_LESS_THAN_OR_EQUAL_TO";
|
|
38239
|
+
var NUMBER_LESS_THAN_OR_EQUAL_TO_ERROR = "error/NUMBER_LESS_THAN_OR_EQUAL_TO";
|
|
38240
|
+
var numberLessThanOrEqualTo = createValidator(NUMBER_LESS_THAN_OR_EQUAL_TO, NUMBER_LESS_THAN_OR_EQUAL_TO_ERROR);
|
|
38241
|
+
|
|
38242
|
+
validatorFns[NUMBER_LESS_THAN_OR_EQUAL_TO] = function (value, args, form) {
|
|
37575
38243
|
if (value === "") {
|
|
37576
38244
|
return true;
|
|
37577
38245
|
}
|
|
38246
|
+
|
|
37578
38247
|
return Number(value) <= args[0];
|
|
37579
38248
|
};
|
|
37580
38249
|
|
|
37581
|
-
|
|
37582
|
-
|
|
37583
|
-
|
|
37584
|
-
|
|
37585
|
-
|
|
37586
|
-
);
|
|
37587
|
-
validatorFns[NUMBER_GREATER_THAN] = (value, args, form) => {
|
|
38250
|
+
var NUMBER_GREATER_THAN = "validator/NUMBER_GREATER_THAN";
|
|
38251
|
+
var NUMBER_GREATER_THAN_ERROR = "error/NUMBER_GREATER_THAN";
|
|
38252
|
+
var numberGreaterThan = createValidator(NUMBER_GREATER_THAN, NUMBER_GREATER_THAN_ERROR);
|
|
38253
|
+
|
|
38254
|
+
validatorFns[NUMBER_GREATER_THAN] = function (value, args, form) {
|
|
37588
38255
|
if (value === "") {
|
|
37589
38256
|
return true;
|
|
37590
38257
|
}
|
|
38258
|
+
|
|
37591
38259
|
return Number(value) > args[0];
|
|
37592
38260
|
};
|
|
37593
38261
|
|
|
37594
|
-
|
|
37595
|
-
|
|
37596
|
-
|
|
37597
|
-
|
|
37598
|
-
|
|
37599
|
-
NUMBER_GREATER_THAN_OR_EQUAL_TO,
|
|
37600
|
-
NUMBER_GREATER_THAN_OR_EQUAL_TO_ERROR
|
|
37601
|
-
);
|
|
37602
|
-
validatorFns[NUMBER_GREATER_THAN_OR_EQUAL_TO] = (value, args, form) => {
|
|
38262
|
+
var NUMBER_GREATER_THAN_OR_EQUAL_TO = "validator/NUMBER_GREATER_THAN_OR_EQUAL_TO";
|
|
38263
|
+
var NUMBER_GREATER_THAN_OR_EQUAL_TO_ERROR = "error/NUMBER_GREATER_THAN_OR_EQUAL_TO";
|
|
38264
|
+
var numberGreaterThanOrEqualTo = createValidator(NUMBER_GREATER_THAN_OR_EQUAL_TO, NUMBER_GREATER_THAN_OR_EQUAL_TO_ERROR);
|
|
38265
|
+
|
|
38266
|
+
validatorFns[NUMBER_GREATER_THAN_OR_EQUAL_TO] = function (value, args, form) {
|
|
37603
38267
|
if (value === "") {
|
|
37604
38268
|
return true;
|
|
37605
38269
|
}
|
|
38270
|
+
|
|
37606
38271
|
return Number(value) >= args[0];
|
|
37607
38272
|
};
|
|
37608
38273
|
|
|
37609
|
-
|
|
37610
|
-
|
|
37611
|
-
|
|
37612
|
-
|
|
37613
|
-
|
|
38274
|
+
var MATCHES_FIELD = "validator/MATCHES_FIELD";
|
|
38275
|
+
var MATCHES_FIELD_ERROR$1 = "error/MATCHES_FIELD";
|
|
38276
|
+
var matchesField = createValidator(MATCHES_FIELD, MATCHES_FIELD_ERROR$1);
|
|
38277
|
+
|
|
38278
|
+
validatorFns[MATCHES_FIELD] = function (value, args, form) {
|
|
38279
|
+
var dependentField = form[args[0]];
|
|
38280
|
+
|
|
37614
38281
|
if (dependentField === undefined) {
|
|
37615
|
-
throw new Error(
|
|
37616
|
-
`${args[0]} was passed to matchesField, but that field does not exist in the form`
|
|
37617
|
-
);
|
|
38282
|
+
throw new Error("".concat(args[0], " was passed to matchesField, but that field does not exist in the form"));
|
|
37618
38283
|
}
|
|
37619
|
-
|
|
38284
|
+
|
|
38285
|
+
var dependentFieldValue = dependentField.rawValue;
|
|
37620
38286
|
return value === dependentFieldValue;
|
|
37621
38287
|
};
|
|
37622
38288
|
|
|
37623
|
-
|
|
37624
|
-
|
|
37625
|
-
|
|
37626
|
-
|
|
37627
|
-
|
|
37628
|
-
|
|
37629
|
-
|
|
37630
|
-
|
|
37631
|
-
|
|
37632
|
-
|
|
37633
|
-
|
|
37634
|
-
|
|
37635
|
-
|
|
37636
|
-
|
|
37637
|
-
|
|
37638
|
-
type: VALIDATE_WHEN,
|
|
37639
|
-
args: [dependentValidator, primaryValidator, optionalFieldName],
|
|
37640
|
-
error: dependentValidator.error
|
|
37641
|
-
});
|
|
38289
|
+
var validateWhenErrorMessage = function validateWhenErrorMessage(type) {
|
|
38290
|
+
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.");
|
|
38291
|
+
};
|
|
38292
|
+
|
|
38293
|
+
var VALIDATE_WHEN = "validator/VALIDATE_WHEN";
|
|
38294
|
+
var VALIDATE_WHEN_ERROR = "error/VALIDATE_WHEN";
|
|
38295
|
+
|
|
38296
|
+
var validateWhen = function validateWhen(dependentValidator, primaryValidator, optionalFieldName) {
|
|
38297
|
+
return {
|
|
38298
|
+
type: VALIDATE_WHEN,
|
|
38299
|
+
args: [dependentValidator, primaryValidator, optionalFieldName],
|
|
38300
|
+
error: dependentValidator.error
|
|
38301
|
+
};
|
|
38302
|
+
};
|
|
38303
|
+
|
|
37642
38304
|
validateWhen.error = VALIDATE_WHEN_ERROR;
|
|
37643
|
-
|
|
37644
|
-
|
|
37645
|
-
|
|
37646
|
-
|
|
37647
|
-
|
|
37648
|
-
|
|
37649
|
-
|
|
37650
|
-
|
|
38305
|
+
|
|
38306
|
+
validatorFns[VALIDATE_WHEN] = function (value, args, form) {
|
|
38307
|
+
var _args = _slicedToArray(args, 3),
|
|
38308
|
+
dependentValidator = _args[0],
|
|
38309
|
+
primaryValidator = _args[1],
|
|
38310
|
+
optionalFieldName = _args[2];
|
|
38311
|
+
|
|
38312
|
+
var dependsOnOtherField = typeof optionalFieldName === "string";
|
|
38313
|
+
|
|
38314
|
+
if (primaryValidator.type === undefined || typeof validatorFns[primaryValidator.type] !== "function") {
|
|
37651
38315
|
throw new Error(validateWhenErrorMessage(primaryValidator.type));
|
|
37652
38316
|
}
|
|
38317
|
+
|
|
37653
38318
|
if (dependsOnOtherField && form[optionalFieldName] === undefined) {
|
|
37654
|
-
throw new Error(
|
|
37655
|
-
`${args[2]} was passed to matchesField, but that field does not exist in the form`
|
|
37656
|
-
);
|
|
38319
|
+
throw new Error("".concat(args[2], " was passed to matchesField, but that field does not exist in the form"));
|
|
37657
38320
|
}
|
|
37658
38321
|
|
|
37659
|
-
|
|
37660
|
-
|
|
37661
|
-
|
|
37662
|
-
);
|
|
37663
|
-
|
|
37664
|
-
|
|
37665
|
-
|
|
37666
|
-
|
|
37667
|
-
|
|
37668
|
-
|
|
37669
|
-
|
|
37670
|
-
|
|
37671
|
-
|
|
37672
|
-
|
|
37673
|
-
|
|
37674
|
-
|
|
37675
|
-
|
|
37676
|
-
|
|
37677
|
-
|
|
37678
|
-
|
|
37679
|
-
|
|
37680
|
-
|
|
37681
|
-
const validateSumErrorMessage = type =>
|
|
37682
|
-
`${type} was passed to validateSum, but that validator type does not exist.
|
|
37683
|
-
Please check that you are only calling validator creator functions exported from
|
|
37684
|
-
redux-freeform in your form config and that you didn't forget to
|
|
37685
|
-
invoke the validator creator (you cannot pass the functions themselves to
|
|
37686
|
-
createFormState).`;
|
|
37687
|
-
const VALIDATE_SUM = "validator/VALIDATE_SUM";
|
|
37688
|
-
const VALIDATE_SUM_ERROR = "error/VALIDATE_SUM";
|
|
37689
|
-
const validateSum = (validator, fieldNamesArray) => ({
|
|
37690
|
-
type: VALIDATE_SUM,
|
|
37691
|
-
args: [validator, fieldNamesArray],
|
|
37692
|
-
error: validator.error
|
|
37693
|
-
});
|
|
38322
|
+
var primaryPredicate = validatorToPredicate(validatorFns[primaryValidator.type], false);
|
|
38323
|
+
var primaryValue = dependsOnOtherField ? form[optionalFieldName].rawValue : value;
|
|
38324
|
+
var primaryPredicatePassed = primaryPredicate(primaryValue, primaryValidator.args, form);
|
|
38325
|
+
return primaryPredicatePassed ? validatorFns[dependentValidator.type](value, dependentValidator.args, form) : true;
|
|
38326
|
+
};
|
|
38327
|
+
|
|
38328
|
+
var validateSumErrorMessage = function validateSumErrorMessage(type) {
|
|
38329
|
+
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).");
|
|
38330
|
+
};
|
|
38331
|
+
|
|
38332
|
+
var VALIDATE_SUM = "validator/VALIDATE_SUM";
|
|
38333
|
+
var VALIDATE_SUM_ERROR = "error/VALIDATE_SUM";
|
|
38334
|
+
|
|
38335
|
+
var validateSum = function validateSum(validator, fieldNamesArray) {
|
|
38336
|
+
return {
|
|
38337
|
+
type: VALIDATE_SUM,
|
|
38338
|
+
args: [validator, fieldNamesArray],
|
|
38339
|
+
error: validator.error
|
|
38340
|
+
};
|
|
38341
|
+
};
|
|
38342
|
+
|
|
37694
38343
|
validateSum.error = VALIDATE_SUM_ERROR;
|
|
37695
|
-
validatorFns[VALIDATE_SUM] = (value, args, form) => {
|
|
37696
|
-
const [validator, fieldNamesArray] = args;
|
|
37697
38344
|
|
|
37698
|
-
|
|
37699
|
-
|
|
37700
|
-
|
|
37701
|
-
|
|
38345
|
+
validatorFns[VALIDATE_SUM] = function (value, args, form) {
|
|
38346
|
+
var _args2 = _slicedToArray(args, 2),
|
|
38347
|
+
validator = _args2[0],
|
|
38348
|
+
fieldNamesArray = _args2[1];
|
|
38349
|
+
|
|
38350
|
+
if (validator.type === undefined || typeof validatorFns[validator.type] !== "function") {
|
|
37702
38351
|
throw new Error(validateSumErrorMessage(validator.type));
|
|
37703
38352
|
}
|
|
37704
38353
|
|
|
37705
|
-
|
|
37706
|
-
|
|
37707
|
-
|
|
37708
|
-
|
|
37709
|
-
|
|
38354
|
+
var _iterator = _createForOfIteratorHelper(fieldNamesArray),
|
|
38355
|
+
_step;
|
|
38356
|
+
|
|
38357
|
+
try {
|
|
38358
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
38359
|
+
var fieldName = _step.value;
|
|
38360
|
+
|
|
38361
|
+
if (form[fieldName] === undefined) {
|
|
38362
|
+
throw new Error("".concat(fieldName, " was passed to matchesField, but that field does not exist in the form"));
|
|
38363
|
+
}
|
|
37710
38364
|
}
|
|
38365
|
+
} catch (err) {
|
|
38366
|
+
_iterator.e(err);
|
|
38367
|
+
} finally {
|
|
38368
|
+
_iterator.f();
|
|
37711
38369
|
}
|
|
37712
38370
|
|
|
37713
|
-
|
|
37714
|
-
|
|
37715
|
-
|
|
37716
|
-
);
|
|
37717
|
-
|
|
38371
|
+
var sum = fieldNamesArray.reduce(function (acc, curr) {
|
|
38372
|
+
return acc + Number(form[curr].rawValue);
|
|
38373
|
+
}, Number(value));
|
|
37718
38374
|
return validatorFns[validator.type](sum, validator.args, form);
|
|
37719
38375
|
};
|
|
37720
38376
|
|
|
37721
|
-
|
|
37722
|
-
|
|
37723
|
-
|
|
37724
|
-
|
|
38377
|
+
var HAS_LENGTH = "validator/HAS_LENGTH";
|
|
38378
|
+
var HAS_LENGTH_ERROR = "error/HAS_LENGTH";
|
|
38379
|
+
var hasLength = createValidator(HAS_LENGTH, HAS_LENGTH_ERROR);
|
|
38380
|
+
|
|
38381
|
+
validatorFns[HAS_LENGTH] = function (value, args, form) {
|
|
37725
38382
|
if (value === "") {
|
|
37726
38383
|
return true;
|
|
37727
38384
|
}
|
|
37728
|
-
|
|
37729
|
-
|
|
38385
|
+
|
|
38386
|
+
var min = args[0];
|
|
38387
|
+
var max = args[1];
|
|
38388
|
+
|
|
37730
38389
|
if (max == undefined || min == undefined) {
|
|
37731
|
-
throw new Error(
|
|
37732
|
-
"Max and min need to be defined for hasLength, both or one of them is undefined"
|
|
37733
|
-
);
|
|
38390
|
+
throw new Error("Max and min need to be defined for hasLength, both or one of them is undefined");
|
|
37734
38391
|
}
|
|
38392
|
+
|
|
37735
38393
|
if (max < min) {
|
|
37736
|
-
throw new Error(
|
|
37737
|
-
"hasLength validator was passed a min greater than the max"
|
|
37738
|
-
);
|
|
38394
|
+
throw new Error("hasLength validator was passed a min greater than the max");
|
|
37739
38395
|
}
|
|
37740
|
-
|
|
38396
|
+
|
|
38397
|
+
var valueLength = value.length;
|
|
37741
38398
|
return max >= valueLength && valueLength >= min;
|
|
37742
38399
|
};
|
|
37743
38400
|
|
|
37744
|
-
|
|
37745
|
-
|
|
37746
|
-
|
|
37747
|
-
|
|
37748
|
-
|
|
37749
|
-
);
|
|
37750
|
-
validatorFns[DATE_BEFORE_TODAY] = (value, args, form) => {
|
|
38401
|
+
var DATE_BEFORE_TODAY = "validator/DATE_BEFORE_TODAY";
|
|
38402
|
+
var DATE_BEFORE_TODAY_ERROR = "error/DATE_BEFORE_TODAY";
|
|
38403
|
+
var dateBeforeToday = createValidator(DATE_BEFORE_TODAY, DATE_BEFORE_TODAY_ERROR);
|
|
38404
|
+
|
|
38405
|
+
validatorFns[DATE_BEFORE_TODAY] = function (value, args, form) {
|
|
37751
38406
|
if (value === "") {
|
|
37752
38407
|
return true;
|
|
37753
38408
|
}
|
|
37754
|
-
|
|
37755
|
-
|
|
37756
|
-
|
|
38409
|
+
|
|
38410
|
+
var dateFormat = args[0];
|
|
38411
|
+
var unit = args[1];
|
|
38412
|
+
var inclusive = args[2] || false;
|
|
37757
38413
|
|
|
37758
38414
|
if (dateFormat == undefined || unit == undefined) {
|
|
37759
|
-
throw new Error(
|
|
37760
|
-
"Date format and unit need to be defined for dateBeforeToday, one or both are undefined"
|
|
37761
|
-
);
|
|
38415
|
+
throw new Error("Date format and unit need to be defined for dateBeforeToday, one or both are undefined");
|
|
37762
38416
|
}
|
|
37763
|
-
|
|
37764
|
-
|
|
38417
|
+
|
|
38418
|
+
var now = dayjs();
|
|
38419
|
+
var dateValue = dayjs(value, dateFormat);
|
|
37765
38420
|
|
|
37766
38421
|
if (inclusive === true) {
|
|
37767
38422
|
return dateValue.isSameOrBefore(now, unit);
|
|
37768
38423
|
}
|
|
38424
|
+
|
|
37769
38425
|
return dateValue.isBefore(now, unit);
|
|
37770
38426
|
};
|
|
37771
38427
|
|
|
37772
|
-
|
|
37773
|
-
|
|
37774
|
-
|
|
37775
|
-
|
|
37776
|
-
|
|
37777
|
-
);
|
|
37778
|
-
validatorFns[DATE_AFTER_TODAY] = (value, args, form) => {
|
|
38428
|
+
var DATE_AFTER_TODAY = "validator/DATE_AFTER_TODAY";
|
|
38429
|
+
var DATE_AFTER_TODAY_ERROR = "error/DATE_AFTER_TODAY";
|
|
38430
|
+
var dateAfterToday = createValidator(DATE_AFTER_TODAY, DATE_AFTER_TODAY_ERROR);
|
|
38431
|
+
|
|
38432
|
+
validatorFns[DATE_AFTER_TODAY] = function (value, args, form) {
|
|
37779
38433
|
if (value === "") {
|
|
37780
38434
|
return true;
|
|
37781
38435
|
}
|
|
37782
|
-
|
|
37783
|
-
|
|
37784
|
-
|
|
38436
|
+
|
|
38437
|
+
var dateFormat = args[0];
|
|
38438
|
+
var unit = args[1];
|
|
38439
|
+
var inclusive = args[2] || false;
|
|
37785
38440
|
|
|
37786
38441
|
if (dateFormat == undefined || unit == undefined) {
|
|
37787
|
-
throw new Error(
|
|
37788
|
-
"Date format and unit need to be defined for dateAfterToday, one or both are undefined"
|
|
37789
|
-
);
|
|
38442
|
+
throw new Error("Date format and unit need to be defined for dateAfterToday, one or both are undefined");
|
|
37790
38443
|
}
|
|
37791
|
-
|
|
37792
|
-
|
|
38444
|
+
|
|
38445
|
+
var now = dayjs();
|
|
38446
|
+
var dateValue = dayjs(value, dateFormat);
|
|
37793
38447
|
|
|
37794
38448
|
if (inclusive === true) {
|
|
37795
38449
|
return dateValue.isSameOrAfter(now, unit);
|
|
37796
38450
|
}
|
|
38451
|
+
|
|
37797
38452
|
return dateValue.isAfter(now, unit);
|
|
37798
38453
|
};
|
|
37799
38454
|
|
|
37800
|
-
|
|
37801
|
-
|
|
37802
|
-
|
|
37803
|
-
|
|
37804
|
-
|
|
37805
|
-
);
|
|
37806
|
-
validatorFns[IS_VALID_MONTH] = (value, args, form) => {
|
|
38455
|
+
var IS_VALID_MONTH = "validator/IS_VALID_MONTH";
|
|
38456
|
+
var IS_VALID_MONTH_ERROR = "error/IS_VALID_MONTH";
|
|
38457
|
+
var isValidMonth = createValidator(IS_VALID_MONTH, IS_VALID_MONTH_ERROR);
|
|
38458
|
+
|
|
38459
|
+
validatorFns[IS_VALID_MONTH] = function (value, args, form) {
|
|
37807
38460
|
if (value === "") {
|
|
37808
38461
|
return true;
|
|
37809
|
-
}
|
|
37810
|
-
// Function takes one argument representing the character position
|
|
38462
|
+
} // Function takes one argument representing the character position
|
|
37811
38463
|
// In a date string to identify where the month is
|
|
37812
38464
|
// Eg "10/21/2021" - start position is 0
|
|
37813
38465
|
// Or "18/03/1990" - start position is 3
|
|
37814
38466
|
// Only works with two digit months (01, 02, 03, etc)
|
|
37815
|
-
|
|
37816
|
-
|
|
37817
|
-
|
|
38467
|
+
|
|
38468
|
+
|
|
38469
|
+
var monthStartPosition = parseInt(args[0]);
|
|
38470
|
+
var monthEndPosition = monthStartPosition + 2;
|
|
38471
|
+
|
|
38472
|
+
if (isNaN(monthStartPosition)) {
|
|
37818
38473
|
throw new Error("Month start position has to be a valid integer string");
|
|
37819
38474
|
}
|
|
37820
|
-
|
|
37821
|
-
|
|
38475
|
+
|
|
38476
|
+
var month = parseInt(value.slice(monthStartPosition, monthEndPosition));
|
|
38477
|
+
|
|
38478
|
+
if (isNaN(month)) {
|
|
37822
38479
|
return false;
|
|
37823
38480
|
}
|
|
38481
|
+
|
|
37824
38482
|
return month >= 1 && month <= 12;
|
|
37825
38483
|
};
|
|
37826
38484
|
|
|
37827
|
-
|
|
37828
|
-
|
|
37829
|
-
|
|
37830
|
-
|
|
38485
|
+
var MATCHES_REGEX = "validator/MATCHES_REGEX";
|
|
38486
|
+
var MATCHES_REGEX_ERROR = "error/MATCHES_REGEX";
|
|
38487
|
+
var matchesRegex = createValidator(MATCHES_REGEX, MATCHES_REGEX_ERROR);
|
|
38488
|
+
|
|
38489
|
+
validatorFns[MATCHES_REGEX] = function (value, args, form) {
|
|
37831
38490
|
if (value === "") {
|
|
37832
38491
|
return true;
|
|
37833
38492
|
}
|
|
38493
|
+
|
|
37834
38494
|
return new RegExp(args[0]).test(value); // new RexExp never throws an error, no matter the input
|
|
37835
|
-
};
|
|
38495
|
+
}; // based on http://www.brainjar.com/js/validation/
|
|
37836
38496
|
|
|
37837
|
-
|
|
37838
|
-
|
|
37839
|
-
|
|
37840
|
-
|
|
37841
|
-
|
|
37842
|
-
|
|
37843
|
-
);
|
|
37844
|
-
validatorFns[IS_ROUTING_NUMBER] = (value, args, form) => {
|
|
38497
|
+
|
|
38498
|
+
var IS_ROUTING_NUMBER = "validator/IS_ROUTING_NUMBER";
|
|
38499
|
+
var IS_ROUTING_NUMBER_ERROR = "error/IS_ROUTING_NUMBER";
|
|
38500
|
+
var isRoutingNumber = createValidator(IS_ROUTING_NUMBER, IS_ROUTING_NUMBER_ERROR);
|
|
38501
|
+
|
|
38502
|
+
validatorFns[IS_ROUTING_NUMBER] = function (value, args, form) {
|
|
37845
38503
|
if (value === "") {
|
|
37846
38504
|
return true;
|
|
37847
38505
|
}
|
|
38506
|
+
|
|
37848
38507
|
if (value.length != 9) {
|
|
37849
38508
|
return false;
|
|
37850
38509
|
}
|
|
37851
|
-
|
|
37852
|
-
|
|
37853
|
-
|
|
37854
|
-
|
|
37855
|
-
|
|
37856
|
-
|
|
37857
|
-
|
|
37858
|
-
|
|
37859
|
-
|
|
37860
|
-
|
|
37861
|
-
|
|
37862
|
-
|
|
37863
|
-
|
|
38510
|
+
|
|
38511
|
+
var sum = value.split("").map(function (ch) {
|
|
38512
|
+
return parseInt(ch);
|
|
38513
|
+
}).reduce(function (acc, cur, idx) {
|
|
38514
|
+
switch (idx % 3) {
|
|
38515
|
+
case 0:
|
|
38516
|
+
return acc + 3 * cur;
|
|
38517
|
+
|
|
38518
|
+
case 1:
|
|
38519
|
+
return acc + 7 * cur;
|
|
38520
|
+
|
|
38521
|
+
case 2:
|
|
38522
|
+
return acc + 1 * cur;
|
|
38523
|
+
}
|
|
38524
|
+
}, 0);
|
|
37864
38525
|
return sum != 0 && sum % 10 == 0;
|
|
37865
38526
|
};
|
|
37866
38527
|
|
|
37867
|
-
|
|
37868
|
-
|
|
37869
|
-
|
|
37870
|
-
|
|
38528
|
+
var HAS_NUMBER = "validator/HAS_NUMBER";
|
|
38529
|
+
var HAS_NUMBER_ERROR$1 = "error/HAS_NUMBER";
|
|
38530
|
+
var hasNumber = createValidator(HAS_NUMBER, HAS_NUMBER_ERROR$1);
|
|
38531
|
+
|
|
38532
|
+
validatorFns[HAS_NUMBER] = function (value, args, form) {
|
|
37871
38533
|
if (value === "") {
|
|
37872
38534
|
return true;
|
|
37873
38535
|
}
|
|
38536
|
+
|
|
37874
38537
|
return new RegExp(/[0-9]/).test(value);
|
|
37875
38538
|
};
|
|
37876
38539
|
|
|
37877
|
-
|
|
37878
|
-
|
|
37879
|
-
|
|
37880
|
-
|
|
37881
|
-
|
|
37882
|
-
);
|
|
37883
|
-
validatorFns[HAS_LOWERCASE_LETTER] = (value, args, form) => {
|
|
38540
|
+
var HAS_LOWERCASE_LETTER = "validator/HAS_LOWERCASE_LETTER";
|
|
38541
|
+
var HAS_LOWERCASE_LETTER_ERROR$1 = "error/HAS_LOWERCASE_LETTER";
|
|
38542
|
+
var hasLowercaseLetter = createValidator(HAS_LOWERCASE_LETTER, HAS_LOWERCASE_LETTER_ERROR$1);
|
|
38543
|
+
|
|
38544
|
+
validatorFns[HAS_LOWERCASE_LETTER] = function (value, args, form) {
|
|
37884
38545
|
if (value === "") {
|
|
37885
38546
|
return true;
|
|
37886
38547
|
}
|
|
38548
|
+
|
|
37887
38549
|
return new RegExp(/[a-z]/).test(value);
|
|
37888
38550
|
};
|
|
37889
38551
|
|
|
37890
|
-
|
|
37891
|
-
|
|
37892
|
-
|
|
37893
|
-
|
|
37894
|
-
|
|
37895
|
-
);
|
|
37896
|
-
validatorFns[HAS_UPPERCASE_LETTER] = (value, args, form) => {
|
|
38552
|
+
var HAS_UPPERCASE_LETTER = "validator/HAS_UPPERCASE_LETTER";
|
|
38553
|
+
var HAS_UPPERCASE_LETTER_ERROR$1 = "error/HAS_UPPERCASE_LETTER";
|
|
38554
|
+
var hasUppercaseLetter = createValidator(HAS_UPPERCASE_LETTER, HAS_UPPERCASE_LETTER_ERROR$1);
|
|
38555
|
+
|
|
38556
|
+
validatorFns[HAS_UPPERCASE_LETTER] = function (value, args, form) {
|
|
37897
38557
|
if (value === "") {
|
|
37898
38558
|
return true;
|
|
37899
38559
|
}
|
|
38560
|
+
|
|
37900
38561
|
return new RegExp(/[A-Z]/).test(value);
|
|
37901
38562
|
};
|
|
37902
38563
|
|
|
37903
|
-
|
|
37904
|
-
|
|
37905
|
-
|
|
37906
|
-
|
|
37907
|
-
|
|
37908
|
-
);
|
|
37909
|
-
validatorFns[HAS_SPECIAL_CHARACTER] = (value, args, form) => {
|
|
38564
|
+
var HAS_SPECIAL_CHARACTER = "validator/HAS_SPECIAL_CHARACTER";
|
|
38565
|
+
var HAS_SPECIAL_CHARACTER_ERROR$1 = "error/HAS_SPECIAL_CHARACTER";
|
|
38566
|
+
var hasSpecialCharacter = createValidator(HAS_SPECIAL_CHARACTER, HAS_SPECIAL_CHARACTER_ERROR$1);
|
|
38567
|
+
|
|
38568
|
+
validatorFns[HAS_SPECIAL_CHARACTER] = function (value, args, form) {
|
|
37910
38569
|
if (value === "") {
|
|
37911
38570
|
return true;
|
|
37912
38571
|
}
|
|
38572
|
+
|
|
37913
38573
|
return new RegExp(/[!@#$%^&*.?]/).test(value);
|
|
37914
38574
|
};
|
|
37915
38575
|
|
|
37916
|
-
|
|
37917
|
-
|
|
37918
|
-
|
|
37919
|
-
|
|
37920
|
-
|
|
37921
|
-
);
|
|
37922
|
-
validatorFns[IS_PROBABLY_EMAIL] = (value, args, form) => {
|
|
38576
|
+
var IS_PROBABLY_EMAIL = "validator/IS_PROBABLY_EMAIL";
|
|
38577
|
+
var IS_PROBABLY_EMAIL_ERROR = "error/IS_PROBABLY_EMAIL";
|
|
38578
|
+
var isProbablyEmail = createValidator(IS_PROBABLY_EMAIL, IS_PROBABLY_EMAIL_ERROR);
|
|
38579
|
+
|
|
38580
|
+
validatorFns[IS_PROBABLY_EMAIL] = function (value, args, form) {
|
|
37923
38581
|
if (value === "") {
|
|
37924
38582
|
return true;
|
|
37925
38583
|
}
|
|
38584
|
+
|
|
37926
38585
|
return new RegExp(/^\S+@\S+\.\S+$/).test(value);
|
|
37927
38586
|
};
|
|
37928
38587
|
|
|
37929
|
-
|
|
37930
|
-
|
|
37931
|
-
|
|
37932
|
-
|
|
37933
|
-
|
|
37934
|
-
|
|
38588
|
+
var runValidatorErrorMessage = function runValidatorErrorMessage(type) {
|
|
38589
|
+
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)");
|
|
38590
|
+
};
|
|
38591
|
+
|
|
38592
|
+
var runValidator = function runValidator(validator, value, form) {
|
|
38593
|
+
var validatorFn = validatorFns[validator.type];
|
|
37935
38594
|
|
|
37936
|
-
const runValidator = (validator, value, form) => {
|
|
37937
|
-
const validatorFn = validatorFns[validator.type];
|
|
37938
38595
|
if (validatorFn === undefined) {
|
|
37939
38596
|
throw new Error(runValidatorErrorMessage(validator.type));
|
|
37940
38597
|
}
|
|
38598
|
+
|
|
37941
38599
|
return validatorFn(value, validator.args, form) ? null : validator.error;
|
|
37942
38600
|
};
|
|
37943
38601
|
|
|
37944
|
-
|
|
37945
|
-
return validators
|
|
37946
|
-
|
|
37947
|
-
|
|
38602
|
+
var runFormValidators = function runFormValidators(fieldName, form, validators) {
|
|
38603
|
+
return validators.map(function (v) {
|
|
38604
|
+
return runValidator(v, form[fieldName].rawValue, form);
|
|
38605
|
+
}).filter(function (x) {
|
|
38606
|
+
return x !== null;
|
|
38607
|
+
});
|
|
38608
|
+
};
|
|
38609
|
+
|
|
38610
|
+
var computeConstraints = function computeConstraints(fieldName, form) {
|
|
38611
|
+
var constraints = form[fieldName].constraints;
|
|
38612
|
+
return runFormValidators(fieldName, form, constraints);
|
|
38613
|
+
};
|
|
38614
|
+
|
|
38615
|
+
var computeErrors = function computeErrors(fieldName, form) {
|
|
38616
|
+
var validators = form[fieldName].validators;
|
|
38617
|
+
return runFormValidators(fieldName, form, validators);
|
|
37948
38618
|
};
|
|
37949
38619
|
|
|
37950
|
-
|
|
37951
|
-
|
|
37952
|
-
|
|
38620
|
+
var computeErrorEntries = function computeErrorEntries(formState) {
|
|
38621
|
+
var fields = Object.entries(formState);
|
|
38622
|
+
|
|
38623
|
+
for (var _i = 0, _fields = fields; _i < _fields.length; _i++) {
|
|
38624
|
+
var entry = _fields[_i];
|
|
38625
|
+
var fieldName = entry[0];
|
|
38626
|
+
var errors = computeErrors(fieldName, formState);
|
|
38627
|
+
formState[fieldName].errors = errors;
|
|
38628
|
+
formState[fieldName].hasErrors = errors.length > 0;
|
|
38629
|
+
}
|
|
37953
38630
|
};
|
|
37954
38631
|
|
|
37955
|
-
|
|
37956
|
-
|
|
37957
|
-
|
|
38632
|
+
var computeDirtyEntries = function computeDirtyEntries(formState, changedFieldName) {
|
|
38633
|
+
var fields = Object.entries(formState);
|
|
38634
|
+
|
|
38635
|
+
for (var _i2 = 0, _fields2 = fields; _i2 < _fields2.length; _i2++) {
|
|
38636
|
+
var entry = _fields2[_i2];
|
|
38637
|
+
var fieldName = entry[0];
|
|
38638
|
+
var field = entry[1];
|
|
38639
|
+
var dirty = fieldName === changedFieldName ? true : field.dirty;
|
|
38640
|
+
formState[fieldName].dirty = dirty;
|
|
38641
|
+
}
|
|
37958
38642
|
};
|
|
37959
38643
|
|
|
37960
38644
|
var obj;
|
|
37961
|
-
var NOTHING = typeof Symbol !== "undefined" ? Symbol("immer-nothing") : (
|
|
37962
|
-
var DRAFTABLE = typeof Symbol !== "undefined" && Symbol
|
|
37963
|
-
var DRAFT_STATE = typeof Symbol !== "undefined" && Symbol
|
|
38645
|
+
var NOTHING = typeof Symbol !== "undefined" ? Symbol("immer-nothing") : (obj = {}, obj["immer-nothing"] = true, obj);
|
|
38646
|
+
var DRAFTABLE = typeof Symbol !== "undefined" && Symbol["for"] ? Symbol["for"]("immer-draftable") : "__$immer_draftable";
|
|
38647
|
+
var DRAFT_STATE = typeof Symbol !== "undefined" && Symbol["for"] ? Symbol["for"]("immer-state") : "__$immer_state";
|
|
38648
|
+
|
|
37964
38649
|
function isDraft(value) {
|
|
37965
38650
|
return !!value && !!value[DRAFT_STATE];
|
|
37966
38651
|
}
|
|
38652
|
+
|
|
37967
38653
|
function isDraftable(value) {
|
|
37968
|
-
if (!value) {
|
|
38654
|
+
if (!value) {
|
|
38655
|
+
return false;
|
|
38656
|
+
}
|
|
38657
|
+
|
|
37969
38658
|
return isPlainObject(value) || !!value[DRAFTABLE] || !!value.constructor[DRAFTABLE];
|
|
37970
38659
|
}
|
|
38660
|
+
|
|
37971
38661
|
function isPlainObject(value) {
|
|
37972
|
-
if (!value ||
|
|
37973
|
-
|
|
38662
|
+
if (!value || _typeof(value) !== "object") {
|
|
38663
|
+
return false;
|
|
38664
|
+
}
|
|
38665
|
+
|
|
38666
|
+
if (Array.isArray(value)) {
|
|
38667
|
+
return true;
|
|
38668
|
+
}
|
|
38669
|
+
|
|
37974
38670
|
var proto = Object.getPrototypeOf(value);
|
|
37975
38671
|
return !proto || proto === Object.prototype;
|
|
37976
38672
|
}
|
|
38673
|
+
|
|
37977
38674
|
var assign = Object.assign || function assign(target, value) {
|
|
37978
38675
|
for (var key in value) {
|
|
37979
38676
|
if (has$1(value, key)) {
|
|
@@ -37983,11 +38680,18 @@ var assign = Object.assign || function assign(target, value) {
|
|
|
37983
38680
|
|
|
37984
38681
|
return target;
|
|
37985
38682
|
};
|
|
37986
|
-
|
|
38683
|
+
|
|
38684
|
+
var ownKeys$2 = typeof Reflect !== "undefined" && Reflect.ownKeys ? Reflect.ownKeys : typeof Object.getOwnPropertySymbols !== "undefined" ? function (obj) {
|
|
38685
|
+
return Object.getOwnPropertyNames(obj).concat(Object.getOwnPropertySymbols(obj));
|
|
38686
|
+
} : Object.getOwnPropertyNames;
|
|
38687
|
+
|
|
37987
38688
|
function shallowCopy(base, invokeGetters) {
|
|
37988
|
-
if (
|
|
38689
|
+
if (invokeGetters === void 0) invokeGetters = false;
|
|
38690
|
+
|
|
38691
|
+
if (Array.isArray(base)) {
|
|
38692
|
+
return base.slice();
|
|
38693
|
+
}
|
|
37989
38694
|
|
|
37990
|
-
if (Array.isArray(base)) { return base.slice(); }
|
|
37991
38695
|
var clone = Object.create(Object.getPrototypeOf(base));
|
|
37992
38696
|
ownKeys$2(base).forEach(function (key) {
|
|
37993
38697
|
if (key === DRAFT_STATE) {
|
|
@@ -38017,20 +38721,28 @@ function shallowCopy(base, invokeGetters) {
|
|
|
38017
38721
|
});
|
|
38018
38722
|
return clone;
|
|
38019
38723
|
}
|
|
38724
|
+
|
|
38020
38725
|
function each(value, cb) {
|
|
38021
38726
|
if (Array.isArray(value)) {
|
|
38022
|
-
for (var i = 0; i < value.length; i++) {
|
|
38727
|
+
for (var i = 0; i < value.length; i++) {
|
|
38728
|
+
cb(i, value[i], value);
|
|
38729
|
+
}
|
|
38023
38730
|
} else {
|
|
38024
|
-
ownKeys$2(value).forEach(function (key) {
|
|
38731
|
+
ownKeys$2(value).forEach(function (key) {
|
|
38732
|
+
return cb(key, value[key], value);
|
|
38733
|
+
});
|
|
38025
38734
|
}
|
|
38026
38735
|
}
|
|
38736
|
+
|
|
38027
38737
|
function isEnumerable(base, prop) {
|
|
38028
38738
|
var desc = Object.getOwnPropertyDescriptor(base, prop);
|
|
38029
38739
|
return !!desc && desc.enumerable;
|
|
38030
38740
|
}
|
|
38741
|
+
|
|
38031
38742
|
function has$1(thing, prop) {
|
|
38032
38743
|
return Object.prototype.hasOwnProperty.call(thing, prop);
|
|
38033
38744
|
}
|
|
38745
|
+
|
|
38034
38746
|
function is(x, y) {
|
|
38035
38747
|
// From: https://github.com/facebook/fbjs/blob/c69904a511b900266935168223063dd8772dfc40/packages/fbjs/src/core/shallowEqual.js
|
|
38036
38748
|
if (x === y) {
|
|
@@ -38039,18 +38751,27 @@ function is(x, y) {
|
|
|
38039
38751
|
return x !== x && y !== y;
|
|
38040
38752
|
}
|
|
38041
38753
|
}
|
|
38754
|
+
|
|
38042
38755
|
function clone(obj) {
|
|
38043
|
-
if (!isDraftable(obj)) {
|
|
38044
|
-
|
|
38756
|
+
if (!isDraftable(obj)) {
|
|
38757
|
+
return obj;
|
|
38758
|
+
}
|
|
38759
|
+
|
|
38760
|
+
if (Array.isArray(obj)) {
|
|
38761
|
+
return obj.map(clone);
|
|
38762
|
+
}
|
|
38763
|
+
|
|
38045
38764
|
var cloned = Object.create(Object.getPrototypeOf(obj));
|
|
38046
38765
|
|
|
38047
|
-
for (var key in obj) {
|
|
38766
|
+
for (var key in obj) {
|
|
38767
|
+
cloned[key] = clone(obj[key]);
|
|
38768
|
+
}
|
|
38048
38769
|
|
|
38049
38770
|
return cloned;
|
|
38050
38771
|
}
|
|
38051
|
-
|
|
38052
38772
|
/** Each scope represents a `produce` call. */
|
|
38053
38773
|
|
|
38774
|
+
|
|
38054
38775
|
var ImmerScope = function ImmerScope(parent) {
|
|
38055
38776
|
this.drafts = [];
|
|
38056
38777
|
this.parent = parent; // Whenever the modified draft contains a draft from another scope, we
|
|
@@ -38061,7 +38782,7 @@ var ImmerScope = function ImmerScope(parent) {
|
|
|
38061
38782
|
this.patches = null;
|
|
38062
38783
|
};
|
|
38063
38784
|
|
|
38064
|
-
ImmerScope.prototype.usePatches = function usePatches
|
|
38785
|
+
ImmerScope.prototype.usePatches = function usePatches(patchListener) {
|
|
38065
38786
|
if (patchListener) {
|
|
38066
38787
|
this.patches = [];
|
|
38067
38788
|
this.inversePatches = [];
|
|
@@ -38069,17 +38790,18 @@ ImmerScope.prototype.usePatches = function usePatches (patchListener) {
|
|
|
38069
38790
|
}
|
|
38070
38791
|
};
|
|
38071
38792
|
|
|
38072
|
-
ImmerScope.prototype.revoke = function revoke$1
|
|
38793
|
+
ImmerScope.prototype.revoke = function revoke$1() {
|
|
38073
38794
|
this.leave();
|
|
38074
38795
|
this.drafts.forEach(revoke);
|
|
38075
38796
|
this.drafts = null; // Make draft-related methods throw.
|
|
38076
38797
|
};
|
|
38077
38798
|
|
|
38078
|
-
ImmerScope.prototype.leave = function leave
|
|
38799
|
+
ImmerScope.prototype.leave = function leave() {
|
|
38079
38800
|
if (this === ImmerScope.current) {
|
|
38080
38801
|
ImmerScope.current = this.parent;
|
|
38081
38802
|
}
|
|
38082
38803
|
};
|
|
38804
|
+
|
|
38083
38805
|
ImmerScope.current = null;
|
|
38084
38806
|
|
|
38085
38807
|
ImmerScope.enter = function () {
|
|
@@ -38088,11 +38810,11 @@ ImmerScope.enter = function () {
|
|
|
38088
38810
|
|
|
38089
38811
|
function revoke(draft) {
|
|
38090
38812
|
draft[DRAFT_STATE].revoke();
|
|
38091
|
-
}
|
|
38813
|
+
} // but share them all instead
|
|
38092
38814
|
|
|
38093
|
-
// but share them all instead
|
|
38094
38815
|
|
|
38095
38816
|
var descriptors$1 = {};
|
|
38817
|
+
|
|
38096
38818
|
function willFinalize(scope, result, isReplaced) {
|
|
38097
38819
|
scope.drafts.forEach(function (draft) {
|
|
38098
38820
|
draft[DRAFT_STATE].finalizing = true;
|
|
@@ -38107,9 +38829,10 @@ function willFinalize(scope, result, isReplaced) {
|
|
|
38107
38829
|
markChangesSweep(scope.drafts);
|
|
38108
38830
|
} // When a child draft is returned, look for changes.
|
|
38109
38831
|
else if (isDraft(result) && result[DRAFT_STATE].scope === scope) {
|
|
38110
|
-
|
|
38111
|
-
|
|
38832
|
+
markChangesSweep(scope.drafts);
|
|
38833
|
+
}
|
|
38112
38834
|
}
|
|
38835
|
+
|
|
38113
38836
|
function createProxy(base, parent) {
|
|
38114
38837
|
var isArray = Array.isArray(base);
|
|
38115
38838
|
var draft = clonePotentialDraft(base);
|
|
@@ -38163,7 +38886,11 @@ function peek(draft, prop) {
|
|
|
38163
38886
|
function get$1(state, prop) {
|
|
38164
38887
|
assertUnrevoked(state);
|
|
38165
38888
|
var value = peek(source(state), prop);
|
|
38166
|
-
|
|
38889
|
+
|
|
38890
|
+
if (state.finalizing) {
|
|
38891
|
+
return value;
|
|
38892
|
+
} // Create a draft if the value is unmodified.
|
|
38893
|
+
|
|
38167
38894
|
|
|
38168
38895
|
if (value === peek(state.base, prop) && isDraftable(value)) {
|
|
38169
38896
|
prepareCopy(state);
|
|
@@ -38178,7 +38905,10 @@ function set$1(state, prop, value) {
|
|
|
38178
38905
|
state.assigned[prop] = true;
|
|
38179
38906
|
|
|
38180
38907
|
if (!state.modified) {
|
|
38181
|
-
if (is(value, peek(source(state), prop))) {
|
|
38908
|
+
if (is(value, peek(source(state), prop))) {
|
|
38909
|
+
return;
|
|
38910
|
+
}
|
|
38911
|
+
|
|
38182
38912
|
markChanged(state);
|
|
38183
38913
|
prepareCopy(state);
|
|
38184
38914
|
}
|
|
@@ -38189,12 +38919,17 @@ function set$1(state, prop, value) {
|
|
|
38189
38919
|
function markChanged(state) {
|
|
38190
38920
|
if (!state.modified) {
|
|
38191
38921
|
state.modified = true;
|
|
38192
|
-
|
|
38922
|
+
|
|
38923
|
+
if (state.parent) {
|
|
38924
|
+
markChanged(state.parent);
|
|
38925
|
+
}
|
|
38193
38926
|
}
|
|
38194
38927
|
}
|
|
38195
38928
|
|
|
38196
38929
|
function prepareCopy(state) {
|
|
38197
|
-
if (!state.copy) {
|
|
38930
|
+
if (!state.copy) {
|
|
38931
|
+
state.copy = clonePotentialDraft(state.base);
|
|
38932
|
+
}
|
|
38198
38933
|
}
|
|
38199
38934
|
|
|
38200
38935
|
function clonePotentialDraft(base) {
|
|
@@ -38219,15 +38954,12 @@ function proxyProperty(draft, prop, enumerable) {
|
|
|
38219
38954
|
descriptors$1[prop] = desc = {
|
|
38220
38955
|
configurable: true,
|
|
38221
38956
|
enumerable: enumerable,
|
|
38222
|
-
|
|
38223
38957
|
get: function get$1$1() {
|
|
38224
38958
|
return get$1(this[DRAFT_STATE], prop);
|
|
38225
38959
|
},
|
|
38226
|
-
|
|
38227
38960
|
set: function set$1$1(value) {
|
|
38228
38961
|
set$1(this[DRAFT_STATE], prop, value);
|
|
38229
38962
|
}
|
|
38230
|
-
|
|
38231
38963
|
};
|
|
38232
38964
|
}
|
|
38233
38965
|
|
|
@@ -38235,7 +38967,9 @@ function proxyProperty(draft, prop, enumerable) {
|
|
|
38235
38967
|
}
|
|
38236
38968
|
|
|
38237
38969
|
function assertUnrevoked(state) {
|
|
38238
|
-
if (state.revoked === true) {
|
|
38970
|
+
if (state.revoked === true) {
|
|
38971
|
+
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)));
|
|
38972
|
+
}
|
|
38239
38973
|
} // This looks expensive, but only proxies are visited, and only objects without known changes are scanned.
|
|
38240
38974
|
|
|
38241
38975
|
|
|
@@ -38249,16 +38983,27 @@ function markChangesSweep(drafts) {
|
|
|
38249
38983
|
|
|
38250
38984
|
if (!state.modified) {
|
|
38251
38985
|
if (Array.isArray(state.base)) {
|
|
38252
|
-
if (hasArrayChanges(state)) {
|
|
38253
|
-
|
|
38986
|
+
if (hasArrayChanges(state)) {
|
|
38987
|
+
markChanged(state);
|
|
38988
|
+
}
|
|
38989
|
+
} else if (hasObjectChanges(state)) {
|
|
38990
|
+
markChanged(state);
|
|
38991
|
+
}
|
|
38254
38992
|
}
|
|
38255
38993
|
}
|
|
38256
38994
|
}
|
|
38257
38995
|
|
|
38258
38996
|
function markChangesRecursively(object) {
|
|
38259
|
-
if (!object ||
|
|
38997
|
+
if (!object || _typeof(object) !== "object") {
|
|
38998
|
+
return;
|
|
38999
|
+
}
|
|
39000
|
+
|
|
38260
39001
|
var state = object[DRAFT_STATE];
|
|
38261
|
-
|
|
39002
|
+
|
|
39003
|
+
if (!state) {
|
|
39004
|
+
return;
|
|
39005
|
+
}
|
|
39006
|
+
|
|
38262
39007
|
var base = state.base;
|
|
38263
39008
|
var draft = state.draft;
|
|
38264
39009
|
var assigned = state.assigned;
|
|
@@ -38288,14 +39033,20 @@ function markChangesRecursively(object) {
|
|
|
38288
39033
|
assigned.length = true;
|
|
38289
39034
|
|
|
38290
39035
|
if (draft.length < base.length) {
|
|
38291
|
-
for (var i = draft.length; i < base.length; i++) {
|
|
39036
|
+
for (var i = draft.length; i < base.length; i++) {
|
|
39037
|
+
assigned[i] = false;
|
|
39038
|
+
}
|
|
38292
39039
|
} else {
|
|
38293
|
-
for (var i$1 = base.length; i$1 < draft.length; i$1++) {
|
|
39040
|
+
for (var i$1 = base.length; i$1 < draft.length; i$1++) {
|
|
39041
|
+
assigned[i$1] = true;
|
|
39042
|
+
}
|
|
38294
39043
|
}
|
|
38295
39044
|
|
|
38296
39045
|
for (var i$2 = 0; i$2 < draft.length; i$2++) {
|
|
38297
39046
|
// Only untouched indices trigger recursion.
|
|
38298
|
-
if (assigned[i$2] === undefined) {
|
|
39047
|
+
if (assigned[i$2] === undefined) {
|
|
39048
|
+
markChangesRecursively(draft[i$2]);
|
|
39049
|
+
}
|
|
38299
39050
|
}
|
|
38300
39051
|
}
|
|
38301
39052
|
}
|
|
@@ -38316,13 +39067,13 @@ function hasObjectChanges(state) {
|
|
|
38316
39067
|
} // Once a base key is deleted, future changes go undetected, because its
|
|
38317
39068
|
// descriptor is erased. This branch detects any missed changes.
|
|
38318
39069
|
else {
|
|
38319
|
-
|
|
38320
|
-
|
|
39070
|
+
var value = draft[key];
|
|
39071
|
+
var state$1 = value && value[DRAFT_STATE];
|
|
38321
39072
|
|
|
38322
|
-
|
|
38323
|
-
|
|
38324
|
-
}
|
|
39073
|
+
if (state$1 ? state$1.base !== baseValue : !is(value, baseValue)) {
|
|
39074
|
+
return true;
|
|
38325
39075
|
}
|
|
39076
|
+
}
|
|
38326
39077
|
} // At this point, no keys were added or changed.
|
|
38327
39078
|
// Compare key count to determine if keys were deleted.
|
|
38328
39079
|
|
|
@@ -38332,7 +39083,10 @@ function hasObjectChanges(state) {
|
|
|
38332
39083
|
|
|
38333
39084
|
function hasArrayChanges(state) {
|
|
38334
39085
|
var draft = state.draft;
|
|
38335
|
-
|
|
39086
|
+
|
|
39087
|
+
if (draft.length !== state.base.length) {
|
|
39088
|
+
return true;
|
|
39089
|
+
} // See #116
|
|
38336
39090
|
// If we first shorten the length, our array interceptors will be removed.
|
|
38337
39091
|
// If after that new items are added, result in the same original length,
|
|
38338
39092
|
// those last items will have no intercepting property.
|
|
@@ -38340,9 +39094,13 @@ function hasArrayChanges(state) {
|
|
|
38340
39094
|
// N.B.: splice, unshift, etc only shift values around, but not prop descriptors, so we only have to check
|
|
38341
39095
|
// the last one
|
|
38342
39096
|
|
|
39097
|
+
|
|
38343
39098
|
var descriptor = Object.getOwnPropertyDescriptor(draft, draft.length - 1); // descriptor can be null, but only for newly created sparse arrays, eg. new Array(10)
|
|
38344
39099
|
|
|
38345
|
-
if (descriptor && !descriptor.get) {
|
|
39100
|
+
if (descriptor && !descriptor.get) {
|
|
39101
|
+
return true;
|
|
39102
|
+
} // For all other cases, we don't have to compare, as they would have been picked up by the index setters
|
|
39103
|
+
|
|
38346
39104
|
|
|
38347
39105
|
return false;
|
|
38348
39106
|
}
|
|
@@ -38356,11 +39114,12 @@ function createHiddenProperty(target, prop, value) {
|
|
|
38356
39114
|
}
|
|
38357
39115
|
|
|
38358
39116
|
var legacyProxy = /*#__PURE__*/Object.freeze({
|
|
38359
|
-
|
|
38360
|
-
|
|
39117
|
+
willFinalize: willFinalize,
|
|
39118
|
+
createProxy: createProxy
|
|
38361
39119
|
});
|
|
38362
39120
|
|
|
38363
39121
|
function willFinalize$1() {}
|
|
39122
|
+
|
|
38364
39123
|
function createProxy$1(base, parent) {
|
|
38365
39124
|
var scope = parent ? parent.scope : ImmerScope.current;
|
|
38366
39125
|
var state = {
|
|
@@ -38395,33 +39154,27 @@ function createProxy$1(base, parent) {
|
|
|
38395
39154
|
scope.drafts.push(proxy);
|
|
38396
39155
|
return proxy;
|
|
38397
39156
|
}
|
|
39157
|
+
|
|
38398
39158
|
var objectTraps = {
|
|
38399
39159
|
get: get$1$1,
|
|
38400
|
-
|
|
38401
39160
|
has: function has(target, prop) {
|
|
38402
39161
|
return prop in source$1(target);
|
|
38403
39162
|
},
|
|
38404
|
-
|
|
38405
39163
|
ownKeys: function ownKeys(target) {
|
|
38406
39164
|
return Reflect.ownKeys(source$1(target));
|
|
38407
39165
|
},
|
|
38408
|
-
|
|
38409
39166
|
set: set$1$1,
|
|
38410
39167
|
deleteProperty: deleteProperty,
|
|
38411
39168
|
getOwnPropertyDescriptor: getOwnPropertyDescriptor$2,
|
|
38412
|
-
|
|
38413
39169
|
defineProperty: function defineProperty() {
|
|
38414
39170
|
throw new Error("Object.defineProperty() cannot be used on an Immer draft"); // prettier-ignore
|
|
38415
39171
|
},
|
|
38416
|
-
|
|
38417
39172
|
getPrototypeOf: function getPrototypeOf(target) {
|
|
38418
39173
|
return Object.getPrototypeOf(target.base);
|
|
38419
39174
|
},
|
|
38420
|
-
|
|
38421
39175
|
setPrototypeOf: function setPrototypeOf() {
|
|
38422
39176
|
throw new Error("Object.setPrototypeOf() cannot be used on an Immer draft"); // prettier-ignore
|
|
38423
39177
|
}
|
|
38424
|
-
|
|
38425
39178
|
};
|
|
38426
39179
|
var arrayTraps = {};
|
|
38427
39180
|
each(objectTraps, function (key, fn) {
|
|
@@ -38460,7 +39213,10 @@ function peek$1(draft, prop) {
|
|
|
38460
39213
|
}
|
|
38461
39214
|
|
|
38462
39215
|
function get$1$1(state, prop) {
|
|
38463
|
-
if (prop === DRAFT_STATE) {
|
|
39216
|
+
if (prop === DRAFT_STATE) {
|
|
39217
|
+
return state;
|
|
39218
|
+
}
|
|
39219
|
+
|
|
38464
39220
|
var drafts = state.drafts; // Check for existing draft in unmodified state.
|
|
38465
39221
|
|
|
38466
39222
|
if (!state.modified && has$1(drafts, prop)) {
|
|
@@ -38476,7 +39232,10 @@ function get$1$1(state, prop) {
|
|
|
38476
39232
|
|
|
38477
39233
|
if (state.modified) {
|
|
38478
39234
|
// Assigned values are never drafted. This catches any drafts we created, too.
|
|
38479
|
-
if (value !== peek$1(state.base, prop)) {
|
|
39235
|
+
if (value !== peek$1(state.base, prop)) {
|
|
39236
|
+
return value;
|
|
39237
|
+
} // Store drafts on the copy (when one exists).
|
|
39238
|
+
|
|
38480
39239
|
|
|
38481
39240
|
drafts = state.copy;
|
|
38482
39241
|
}
|
|
@@ -38491,7 +39250,11 @@ function set$1$1(state, prop, value) {
|
|
|
38491
39250
|
// values may be drafts, but falsy values are never drafts.
|
|
38492
39251
|
|
|
38493
39252
|
var isUnchanged = value ? is(baseValue, value) || value === state.drafts[prop] : is(baseValue, value) && prop in state.base;
|
|
38494
|
-
|
|
39253
|
+
|
|
39254
|
+
if (isUnchanged) {
|
|
39255
|
+
return true;
|
|
39256
|
+
}
|
|
39257
|
+
|
|
38495
39258
|
markChanged$1(state);
|
|
38496
39259
|
}
|
|
38497
39260
|
|
|
@@ -38510,7 +39273,10 @@ function deleteProperty(state, prop) {
|
|
|
38510
39273
|
delete state.assigned[prop];
|
|
38511
39274
|
}
|
|
38512
39275
|
|
|
38513
|
-
if (state.copy) {
|
|
39276
|
+
if (state.copy) {
|
|
39277
|
+
delete state.copy[prop];
|
|
39278
|
+
}
|
|
39279
|
+
|
|
38514
39280
|
return true;
|
|
38515
39281
|
} // Note: We never coerce `desc.value` into an Immer draft, because we can't make
|
|
38516
39282
|
// the same guarantee in ES5 mode.
|
|
@@ -38533,13 +39299,16 @@ function markChanged$1(state) {
|
|
|
38533
39299
|
state.modified = true;
|
|
38534
39300
|
state.copy = assign(shallowCopy(state.base), state.drafts);
|
|
38535
39301
|
state.drafts = null;
|
|
38536
|
-
|
|
39302
|
+
|
|
39303
|
+
if (state.parent) {
|
|
39304
|
+
markChanged$1(state.parent);
|
|
39305
|
+
}
|
|
38537
39306
|
}
|
|
38538
39307
|
}
|
|
38539
39308
|
|
|
38540
39309
|
var modernProxy = /*#__PURE__*/Object.freeze({
|
|
38541
|
-
|
|
38542
|
-
|
|
39310
|
+
willFinalize: willFinalize$1,
|
|
39311
|
+
createProxy: createProxy$1
|
|
38543
39312
|
});
|
|
38544
39313
|
|
|
38545
39314
|
function generatePatches(state, basePath, patches, inversePatches) {
|
|
@@ -38548,14 +39317,13 @@ function generatePatches(state, basePath, patches, inversePatches) {
|
|
|
38548
39317
|
|
|
38549
39318
|
function generateArrayPatches(state, basePath, patches, inversePatches) {
|
|
38550
39319
|
var assign, assign$1;
|
|
38551
|
-
|
|
38552
39320
|
var base = state.base;
|
|
38553
39321
|
var copy = state.copy;
|
|
38554
39322
|
var assigned = state.assigned; // Reduce complexity by ensuring `base` is never longer.
|
|
38555
39323
|
|
|
38556
39324
|
if (copy.length < base.length) {
|
|
38557
|
-
|
|
38558
|
-
|
|
39325
|
+
assign = [copy, base], base = assign[0], copy = assign[1];
|
|
39326
|
+
assign$1 = [inversePatches, patches], patches = assign$1[0], inversePatches = assign$1[1];
|
|
38559
39327
|
}
|
|
38560
39328
|
|
|
38561
39329
|
var delta = copy.length - base.length; // Find the first replaced index.
|
|
@@ -38613,7 +39381,11 @@ function generateObjectPatches(state, basePath, patches, inversePatches) {
|
|
|
38613
39381
|
var origValue = base[key];
|
|
38614
39382
|
var value = copy[key];
|
|
38615
39383
|
var op = !assignedValue ? "remove" : key in base ? "replace" : "add";
|
|
38616
|
-
|
|
39384
|
+
|
|
39385
|
+
if (origValue === value && op === "replace") {
|
|
39386
|
+
return;
|
|
39387
|
+
}
|
|
39388
|
+
|
|
38617
39389
|
var path = basePath.concat(key);
|
|
38618
39390
|
patches.push(op === "remove" ? {
|
|
38619
39391
|
op: op,
|
|
@@ -38638,20 +39410,26 @@ function generateObjectPatches(state, basePath, patches, inversePatches) {
|
|
|
38638
39410
|
});
|
|
38639
39411
|
}
|
|
38640
39412
|
|
|
38641
|
-
var applyPatches = function (draft, patches) {
|
|
39413
|
+
var applyPatches = function applyPatches(draft, patches) {
|
|
38642
39414
|
for (var i$1 = 0, list = patches; i$1 < list.length; i$1 += 1) {
|
|
38643
39415
|
var patch = list[i$1];
|
|
38644
|
-
|
|
38645
39416
|
var path = patch.path;
|
|
38646
39417
|
var op = patch.op;
|
|
38647
39418
|
var value = clone(patch.value); // used to clone patch to ensure original patch is not modified, see #411
|
|
38648
39419
|
|
|
38649
|
-
if (!path.length) {
|
|
39420
|
+
if (!path.length) {
|
|
39421
|
+
throw new Error("Illegal state");
|
|
39422
|
+
}
|
|
39423
|
+
|
|
38650
39424
|
var base = draft;
|
|
38651
39425
|
|
|
38652
39426
|
for (var i = 0; i < path.length - 1; i++) {
|
|
38653
39427
|
base = base[path[i]];
|
|
38654
|
-
|
|
39428
|
+
|
|
39429
|
+
if (!base || _typeof(base) !== "object") {
|
|
39430
|
+
throw new Error("Cannot apply patch, path doesn't resolve: " + path.join("/"));
|
|
39431
|
+
} // prettier-ignore
|
|
39432
|
+
|
|
38655
39433
|
}
|
|
38656
39434
|
|
|
38657
39435
|
var key = path[path.length - 1];
|
|
@@ -38700,27 +39478,33 @@ var configDefaults = {
|
|
|
38700
39478
|
onDelete: null,
|
|
38701
39479
|
onCopy: null
|
|
38702
39480
|
};
|
|
39481
|
+
|
|
38703
39482
|
var Immer = function Immer(config) {
|
|
38704
39483
|
assign(this, configDefaults, config);
|
|
38705
39484
|
this.setUseProxies(this.useProxies);
|
|
38706
39485
|
this.produce = this.produce.bind(this);
|
|
38707
39486
|
};
|
|
38708
39487
|
|
|
38709
|
-
Immer.prototype.produce = function produce
|
|
38710
|
-
|
|
39488
|
+
Immer.prototype.produce = function produce(base, recipe, patchListener) {
|
|
39489
|
+
var this$1$1 = this; // curried invocation
|
|
38711
39490
|
|
|
38712
|
-
// curried invocation
|
|
38713
39491
|
if (typeof base === "function" && typeof recipe !== "function") {
|
|
38714
39492
|
var defaultBase = recipe;
|
|
38715
39493
|
recipe = base;
|
|
38716
39494
|
var self = this;
|
|
38717
39495
|
return function curriedProduce(base) {
|
|
38718
|
-
|
|
38719
|
-
|
|
38720
|
-
|
|
38721
|
-
|
|
39496
|
+
var this$1$1 = this;
|
|
39497
|
+
if (base === void 0) base = defaultBase;
|
|
39498
|
+
var args = [],
|
|
39499
|
+
len = arguments.length - 1;
|
|
39500
|
+
|
|
39501
|
+
while (len-- > 0) {
|
|
39502
|
+
args[len] = arguments[len + 1];
|
|
39503
|
+
}
|
|
38722
39504
|
|
|
38723
|
-
return self.produce(base, function (draft) {
|
|
39505
|
+
return self.produce(base, function (draft) {
|
|
39506
|
+
return recipe.call.apply(recipe, [this$1$1, draft].concat(args));
|
|
39507
|
+
}); // prettier-ignore
|
|
38724
39508
|
};
|
|
38725
39509
|
} // prettier-ignore
|
|
38726
39510
|
|
|
@@ -38746,7 +39530,11 @@ Immer.prototype.produce = function produce (base, recipe, patchListener) {
|
|
|
38746
39530
|
hasError = false;
|
|
38747
39531
|
} finally {
|
|
38748
39532
|
// finally instead of catch + rethrow better preserves original stack
|
|
38749
|
-
if (hasError) {
|
|
39533
|
+
if (hasError) {
|
|
39534
|
+
scope.revoke();
|
|
39535
|
+
} else {
|
|
39536
|
+
scope.leave();
|
|
39537
|
+
}
|
|
38750
39538
|
}
|
|
38751
39539
|
|
|
38752
39540
|
if (result instanceof Promise) {
|
|
@@ -38763,25 +39551,38 @@ Immer.prototype.produce = function produce (base, recipe, patchListener) {
|
|
|
38763
39551
|
return this.processResult(result, scope);
|
|
38764
39552
|
} else {
|
|
38765
39553
|
result = recipe(base);
|
|
38766
|
-
|
|
39554
|
+
|
|
39555
|
+
if (result === undefined) {
|
|
39556
|
+
return base;
|
|
39557
|
+
}
|
|
39558
|
+
|
|
38767
39559
|
return result !== NOTHING ? result : undefined;
|
|
38768
39560
|
}
|
|
38769
39561
|
};
|
|
38770
39562
|
|
|
38771
|
-
Immer.prototype.produceWithPatches = function produceWithPatches
|
|
38772
|
-
|
|
39563
|
+
Immer.prototype.produceWithPatches = function produceWithPatches(arg1, arg2, arg3) {
|
|
39564
|
+
var this$1$1 = this;
|
|
38773
39565
|
|
|
38774
39566
|
if (typeof arg1 === "function") {
|
|
38775
39567
|
return function (state) {
|
|
38776
|
-
|
|
38777
|
-
|
|
39568
|
+
var args = [],
|
|
39569
|
+
len = arguments.length - 1;
|
|
38778
39570
|
|
|
38779
|
-
|
|
38780
|
-
|
|
39571
|
+
while (len-- > 0) {
|
|
39572
|
+
args[len] = arguments[len + 1];
|
|
39573
|
+
}
|
|
39574
|
+
|
|
39575
|
+
return this$1$1.produceWithPatches(state, function (draft) {
|
|
39576
|
+
return arg1.apply(void 0, [draft].concat(args));
|
|
39577
|
+
});
|
|
39578
|
+
};
|
|
38781
39579
|
} // non-curried form
|
|
38782
39580
|
|
|
38783
39581
|
|
|
38784
|
-
if (arg3) {
|
|
39582
|
+
if (arg3) {
|
|
39583
|
+
throw new Error("A patch listener cannot be passed to produceWithPatches");
|
|
39584
|
+
}
|
|
39585
|
+
|
|
38785
39586
|
var patches, inversePatches;
|
|
38786
39587
|
var nextState = this.produce(arg1, arg2, function (p, ip) {
|
|
38787
39588
|
patches = p;
|
|
@@ -38790,7 +39591,7 @@ Immer.prototype.produceWithPatches = function produceWithPatches (arg1, arg2, ar
|
|
|
38790
39591
|
return [nextState, patches, inversePatches];
|
|
38791
39592
|
};
|
|
38792
39593
|
|
|
38793
|
-
Immer.prototype.createDraft = function createDraft
|
|
39594
|
+
Immer.prototype.createDraft = function createDraft(base) {
|
|
38794
39595
|
if (!isDraftable(base)) {
|
|
38795
39596
|
throw new Error("First argument to `createDraft` must be a plain object, an array, or an immerable object"); // prettier-ignore
|
|
38796
39597
|
}
|
|
@@ -38802,7 +39603,7 @@ Immer.prototype.createDraft = function createDraft (base) {
|
|
|
38802
39603
|
return proxy;
|
|
38803
39604
|
};
|
|
38804
39605
|
|
|
38805
|
-
Immer.prototype.finishDraft = function finishDraft
|
|
39606
|
+
Immer.prototype.finishDraft = function finishDraft(draft, patchListener) {
|
|
38806
39607
|
var state = draft && draft[DRAFT_STATE];
|
|
38807
39608
|
|
|
38808
39609
|
if (!state || !state.isManual) {
|
|
@@ -38818,16 +39619,16 @@ Immer.prototype.finishDraft = function finishDraft (draft, patchListener) {
|
|
|
38818
39619
|
return this.processResult(undefined, scope);
|
|
38819
39620
|
};
|
|
38820
39621
|
|
|
38821
|
-
Immer.prototype.setAutoFreeze = function setAutoFreeze
|
|
39622
|
+
Immer.prototype.setAutoFreeze = function setAutoFreeze(value) {
|
|
38822
39623
|
this.autoFreeze = value;
|
|
38823
39624
|
};
|
|
38824
39625
|
|
|
38825
|
-
Immer.prototype.setUseProxies = function setUseProxies
|
|
39626
|
+
Immer.prototype.setUseProxies = function setUseProxies(value) {
|
|
38826
39627
|
this.useProxies = value;
|
|
38827
39628
|
assign(this, value ? modernProxy : legacyProxy);
|
|
38828
39629
|
};
|
|
38829
39630
|
|
|
38830
|
-
Immer.prototype.applyPatches = function applyPatches$1
|
|
39631
|
+
Immer.prototype.applyPatches = function applyPatches$1(base, patches) {
|
|
38831
39632
|
// If a patch replaces the entire state, take that replacement as base
|
|
38832
39633
|
// before applying patches
|
|
38833
39634
|
var i;
|
|
@@ -38847,12 +39648,14 @@ Immer.prototype.applyPatches = function applyPatches$1 (base, patches) {
|
|
|
38847
39648
|
} // Otherwise, produce a copy of the base state.
|
|
38848
39649
|
|
|
38849
39650
|
|
|
38850
|
-
return this.produce(base, function (draft) {
|
|
39651
|
+
return this.produce(base, function (draft) {
|
|
39652
|
+
return applyPatches(draft, patches.slice(i + 1));
|
|
39653
|
+
});
|
|
38851
39654
|
};
|
|
38852
39655
|
/** @internal */
|
|
38853
39656
|
|
|
38854
39657
|
|
|
38855
|
-
Immer.prototype.processResult = function processResult
|
|
39658
|
+
Immer.prototype.processResult = function processResult(result, scope) {
|
|
38856
39659
|
var baseDraft = scope.drafts[0];
|
|
38857
39660
|
var isReplaced = result !== undefined && result !== baseDraft;
|
|
38858
39661
|
this.willFinalize(scope, result, isReplaced);
|
|
@@ -38900,13 +39703,15 @@ Immer.prototype.processResult = function processResult (result, scope) {
|
|
|
38900
39703
|
*/
|
|
38901
39704
|
|
|
38902
39705
|
|
|
38903
|
-
Immer.prototype.finalize = function finalize
|
|
38904
|
-
|
|
38905
|
-
|
|
39706
|
+
Immer.prototype.finalize = function finalize(draft, path, scope) {
|
|
39707
|
+
var this$1$1 = this;
|
|
38906
39708
|
var state = draft[DRAFT_STATE];
|
|
38907
39709
|
|
|
38908
39710
|
if (!state) {
|
|
38909
|
-
if (Object.isFrozen(draft)) {
|
|
39711
|
+
if (Object.isFrozen(draft)) {
|
|
39712
|
+
return draft;
|
|
39713
|
+
}
|
|
39714
|
+
|
|
38910
39715
|
return this.finalizeTree(draft, null, scope);
|
|
38911
39716
|
} // Never finalize drafts owned by another scope.
|
|
38912
39717
|
|
|
@@ -38929,13 +39734,17 @@ Immer.prototype.finalize = function finalize (draft, path, scope) {
|
|
|
38929
39734
|
var assigned = state.assigned;
|
|
38930
39735
|
|
|
38931
39736
|
for (var prop in assigned) {
|
|
38932
|
-
if (!assigned[prop]) {
|
|
39737
|
+
if (!assigned[prop]) {
|
|
39738
|
+
this.onDelete(state, prop);
|
|
39739
|
+
}
|
|
38933
39740
|
}
|
|
38934
39741
|
} else {
|
|
38935
39742
|
var base = state.base;
|
|
38936
|
-
|
|
39743
|
+
var copy = state.copy;
|
|
38937
39744
|
each(base, function (prop) {
|
|
38938
|
-
if (!has$1(copy, prop)) {
|
|
39745
|
+
if (!has$1(copy, prop)) {
|
|
39746
|
+
this$1$1.onDelete(state, prop);
|
|
39747
|
+
}
|
|
38939
39748
|
});
|
|
38940
39749
|
}
|
|
38941
39750
|
}
|
|
@@ -38963,9 +39772,8 @@ Immer.prototype.finalize = function finalize (draft, path, scope) {
|
|
|
38963
39772
|
*/
|
|
38964
39773
|
|
|
38965
39774
|
|
|
38966
|
-
Immer.prototype.finalizeTree = function finalizeTree
|
|
38967
|
-
|
|
38968
|
-
|
|
39775
|
+
Immer.prototype.finalizeTree = function finalizeTree(root, rootPath, scope) {
|
|
39776
|
+
var this$1$1 = this;
|
|
38969
39777
|
var state = root[DRAFT_STATE];
|
|
38970
39778
|
|
|
38971
39779
|
if (state) {
|
|
@@ -38979,7 +39787,7 @@ Immer.prototype.finalizeTree = function finalizeTree (root, rootPath, scope) {
|
|
|
38979
39787
|
|
|
38980
39788
|
var needPatches = !!rootPath && !!scope.patches;
|
|
38981
39789
|
|
|
38982
|
-
var finalizeProperty = function (prop, value, parent) {
|
|
39790
|
+
var finalizeProperty = function finalizeProperty(prop, value, parent) {
|
|
38983
39791
|
if (value === parent) {
|
|
38984
39792
|
throw Error("Immer forbids circular references");
|
|
38985
39793
|
} // In the `finalizeTree` method, only the `root` object may be a draft.
|
|
@@ -39006,14 +39814,16 @@ Immer.prototype.finalizeTree = function finalizeTree (root, rootPath, scope) {
|
|
|
39006
39814
|
} // Unchanged drafts are never passed to the `onAssign` hook.
|
|
39007
39815
|
|
|
39008
39816
|
|
|
39009
|
-
if (isDraftProp && value === state.base[prop]) {
|
|
39817
|
+
if (isDraftProp && value === state.base[prop]) {
|
|
39818
|
+
return;
|
|
39819
|
+
}
|
|
39010
39820
|
} // Unchanged draft properties are ignored.
|
|
39011
39821
|
else if (isDraftProp && is(value, state.base[prop])) {
|
|
39012
|
-
|
|
39013
|
-
|
|
39014
|
-
|
|
39015
|
-
|
|
39016
|
-
|
|
39822
|
+
return;
|
|
39823
|
+
} // Search new objects for unfinalized drafts. Frozen objects should never contain drafts.
|
|
39824
|
+
else if (isDraftable(value) && !Object.isFrozen(value)) {
|
|
39825
|
+
each(value, finalizeProperty);
|
|
39826
|
+
}
|
|
39017
39827
|
|
|
39018
39828
|
if (isDraftProp && this$1$1.onAssign) {
|
|
39019
39829
|
this$1$1.onAssign(state, prop, value);
|
|
@@ -39091,127 +39901,223 @@ immer.createDraft.bind(immer);
|
|
|
39091
39901
|
|
|
39092
39902
|
immer.finishDraft.bind(immer);
|
|
39093
39903
|
|
|
39094
|
-
|
|
39095
|
-
|
|
39096
|
-
|
|
39097
|
-
|
|
39904
|
+
var createInitialState = function createInitialState(formConfig) {
|
|
39905
|
+
var initialForm = {};
|
|
39906
|
+
var formConfigKeys = Object.keys(formConfig);
|
|
39907
|
+
|
|
39908
|
+
for (var _i3 = 0, _formConfigKeys = formConfigKeys; _i3 < _formConfigKeys.length; _i3++) {
|
|
39909
|
+
var formKey = _formConfigKeys[_i3];
|
|
39098
39910
|
initialForm[formKey] = {
|
|
39099
39911
|
dirty: false,
|
|
39100
39912
|
rawValue: formConfig[formKey].defaultValue || "",
|
|
39101
39913
|
validators: formConfig[formKey].validators || [],
|
|
39102
39914
|
constraints: formConfig[formKey].constraints || []
|
|
39103
39915
|
};
|
|
39104
|
-
}
|
|
39105
|
-
// Because validators require the entire form we have to do a
|
|
39916
|
+
} // Because validators require the entire form we have to do a
|
|
39106
39917
|
// second pass to add errors once the initial form has been
|
|
39107
39918
|
// constructed
|
|
39108
|
-
|
|
39109
|
-
|
|
39110
|
-
|
|
39111
|
-
|
|
39919
|
+
|
|
39920
|
+
|
|
39921
|
+
for (var _i4 = 0, _formConfigKeys2 = formConfigKeys; _i4 < _formConfigKeys2.length; _i4++) {
|
|
39922
|
+
var _formKey = _formConfigKeys2[_i4];
|
|
39923
|
+
var errors = computeErrors(_formKey, initialForm);
|
|
39924
|
+
initialForm[_formKey].errors = errors;
|
|
39925
|
+
initialForm[_formKey].hasErrors = errors.length > 0;
|
|
39112
39926
|
}
|
|
39927
|
+
|
|
39113
39928
|
return initialForm;
|
|
39114
39929
|
};
|
|
39115
39930
|
|
|
39116
|
-
|
|
39117
|
-
|
|
39118
|
-
|
|
39119
|
-
|
|
39120
|
-
|
|
39931
|
+
var SET = "field/SET";
|
|
39932
|
+
|
|
39933
|
+
var _set = function set(fieldName) {
|
|
39934
|
+
return function (value) {
|
|
39935
|
+
return {
|
|
39936
|
+
type: SET,
|
|
39937
|
+
payload: {
|
|
39938
|
+
fieldName: fieldName,
|
|
39939
|
+
value: value
|
|
39940
|
+
}
|
|
39941
|
+
};
|
|
39942
|
+
};
|
|
39943
|
+
};
|
|
39121
39944
|
|
|
39122
|
-
|
|
39123
|
-
const clear = () => ({ type: CLEAR });
|
|
39945
|
+
var CLEAR = "form/CLEAR";
|
|
39124
39946
|
|
|
39125
|
-
|
|
39126
|
-
|
|
39127
|
-
|
|
39128
|
-
|
|
39129
|
-
}
|
|
39947
|
+
var _clear = function clear() {
|
|
39948
|
+
return {
|
|
39949
|
+
type: CLEAR
|
|
39950
|
+
};
|
|
39951
|
+
};
|
|
39952
|
+
|
|
39953
|
+
var ADD_VALIDATOR = "field/ADD_VALIDATOR";
|
|
39954
|
+
|
|
39955
|
+
var _addValidator = function addValidator(fieldName) {
|
|
39956
|
+
return function (validator) {
|
|
39957
|
+
return {
|
|
39958
|
+
type: ADD_VALIDATOR,
|
|
39959
|
+
payload: {
|
|
39960
|
+
fieldName: fieldName,
|
|
39961
|
+
validator: validator
|
|
39962
|
+
}
|
|
39963
|
+
};
|
|
39964
|
+
};
|
|
39965
|
+
};
|
|
39966
|
+
|
|
39967
|
+
var REMOVE_VALIDATOR = "field/REMOVE_VALIDATOR";
|
|
39968
|
+
|
|
39969
|
+
var _removeValidator = function removeValidator(fieldName) {
|
|
39970
|
+
return function (validator) {
|
|
39971
|
+
return {
|
|
39972
|
+
type: REMOVE_VALIDATOR,
|
|
39973
|
+
payload: {
|
|
39974
|
+
fieldName: fieldName,
|
|
39975
|
+
validator: validator
|
|
39976
|
+
}
|
|
39977
|
+
};
|
|
39978
|
+
};
|
|
39979
|
+
};
|
|
39980
|
+
|
|
39981
|
+
var CLEAR_FIELD_VALIDATORS = "field/CLEAR_FIELD_VALIDATORS";
|
|
39982
|
+
|
|
39983
|
+
var clearFieldValidators = function clearFieldValidators(fieldName) {
|
|
39984
|
+
return function () {
|
|
39985
|
+
return {
|
|
39986
|
+
type: CLEAR_FIELD_VALIDATORS,
|
|
39987
|
+
payload: {
|
|
39988
|
+
fieldName: fieldName
|
|
39989
|
+
}
|
|
39990
|
+
};
|
|
39991
|
+
};
|
|
39992
|
+
};
|
|
39993
|
+
|
|
39994
|
+
var createFormReducer = function createFormReducer(formConfig) {
|
|
39995
|
+
return function () {
|
|
39996
|
+
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : createInitialState(formConfig);
|
|
39997
|
+
var action = arguments.length > 1 ? arguments[1] : undefined;
|
|
39998
|
+
|
|
39999
|
+
switch (action.type) {
|
|
40000
|
+
case SET:
|
|
40001
|
+
{
|
|
40002
|
+
var changedFieldName = action.payload.fieldName;
|
|
40003
|
+
var newRawValue = action.payload.value;
|
|
40004
|
+
return produce(state, function (draftState) {
|
|
40005
|
+
var originalValue = draftState[changedFieldName].rawValue;
|
|
40006
|
+
draftState[changedFieldName].rawValue = newRawValue;
|
|
40007
|
+
|
|
40008
|
+
if (computeConstraints(changedFieldName, draftState).length > 0) {
|
|
40009
|
+
// If the change violates constraints, revert the change
|
|
40010
|
+
draftState[changedFieldName].rawValue = originalValue;
|
|
40011
|
+
return draftState;
|
|
40012
|
+
}
|
|
39130
40013
|
|
|
39131
|
-
|
|
39132
|
-
|
|
39133
|
-
|
|
39134
|
-
) => {
|
|
39135
|
-
switch (action.type) {
|
|
39136
|
-
case SET:
|
|
39137
|
-
const changedFieldName = action.payload.fieldName;
|
|
39138
|
-
const newRawValue = action.payload.value;
|
|
39139
|
-
|
|
39140
|
-
return produce(state, draftState => {
|
|
39141
|
-
let originalValue = draftState[changedFieldName].rawValue;
|
|
39142
|
-
draftState[changedFieldName].rawValue = newRawValue;
|
|
39143
|
-
if (computeConstraints(changedFieldName, draftState).length > 0) {
|
|
39144
|
-
// If the change violates constraints, revert the change
|
|
39145
|
-
draftState[changedFieldName].rawValue = originalValue;
|
|
39146
|
-
return draftState;
|
|
40014
|
+
computeDirtyEntries(draftState, changedFieldName);
|
|
40015
|
+
computeErrorEntries(draftState);
|
|
40016
|
+
});
|
|
39147
40017
|
}
|
|
39148
40018
|
|
|
39149
|
-
|
|
39150
|
-
|
|
39151
|
-
|
|
39152
|
-
|
|
39153
|
-
|
|
39154
|
-
|
|
39155
|
-
|
|
39156
|
-
draftState
|
|
39157
|
-
|
|
40019
|
+
case CLEAR:
|
|
40020
|
+
return createInitialState(formConfig);
|
|
40021
|
+
|
|
40022
|
+
case ADD_VALIDATOR:
|
|
40023
|
+
{
|
|
40024
|
+
var fieldWithOverride = action.payload.fieldName;
|
|
40025
|
+
var newValidator = action.payload.validator;
|
|
40026
|
+
return produce(state, function (draftState) {
|
|
40027
|
+
draftState[fieldWithOverride].validators.push(newValidator);
|
|
40028
|
+
computeErrorEntries(draftState);
|
|
40029
|
+
});
|
|
39158
40030
|
}
|
|
39159
|
-
|
|
39160
|
-
|
|
39161
|
-
|
|
39162
|
-
|
|
39163
|
-
|
|
39164
|
-
|
|
39165
|
-
|
|
39166
|
-
|
|
39167
|
-
|
|
39168
|
-
|
|
39169
|
-
|
|
39170
|
-
|
|
39171
|
-
let field = entry[1];
|
|
39172
|
-
let errors = computeErrors(fieldName, draftState);
|
|
39173
|
-
let dirty = field.dirty;
|
|
39174
|
-
draftState[fieldName].errors = errors;
|
|
39175
|
-
draftState[fieldName].dirty = dirty;
|
|
39176
|
-
draftState[fieldName].hasErrors = errors.length > 0;
|
|
40031
|
+
|
|
40032
|
+
case REMOVE_VALIDATOR:
|
|
40033
|
+
{
|
|
40034
|
+
var fieldToOverride = action.payload.fieldName;
|
|
40035
|
+
var targetValidator = action.payload.validator;
|
|
40036
|
+
return produce(state, function (draftState) {
|
|
40037
|
+
var fieldValidators = draftState[fieldToOverride].validators;
|
|
40038
|
+
draftState[fieldToOverride].validators = fieldValidators.filter(function (validator) {
|
|
40039
|
+
return validator.type !== targetValidator.type;
|
|
40040
|
+
});
|
|
40041
|
+
computeErrorEntries(draftState);
|
|
40042
|
+
});
|
|
39177
40043
|
}
|
|
39178
|
-
|
|
39179
|
-
|
|
39180
|
-
|
|
39181
|
-
|
|
40044
|
+
|
|
40045
|
+
case CLEAR_FIELD_VALIDATORS:
|
|
40046
|
+
{
|
|
40047
|
+
var fieldToClear = action.payload.fieldName;
|
|
40048
|
+
return produce(state, function (draftState) {
|
|
40049
|
+
draftState[fieldToClear].validators = [];
|
|
40050
|
+
computeErrorEntries(draftState);
|
|
40051
|
+
});
|
|
40052
|
+
}
|
|
40053
|
+
|
|
40054
|
+
default:
|
|
40055
|
+
return state;
|
|
40056
|
+
}
|
|
40057
|
+
};
|
|
39182
40058
|
};
|
|
39183
40059
|
|
|
39184
|
-
|
|
40060
|
+
var createMapDispatchToProps = function createMapDispatchToProps(formConfig) {
|
|
39185
40061
|
// Do memo-ization
|
|
39186
|
-
|
|
39187
|
-
|
|
39188
|
-
return dispatch
|
|
40062
|
+
var cachedDispatch;
|
|
40063
|
+
var cacheValue;
|
|
40064
|
+
return function (dispatch) {
|
|
39189
40065
|
if (dispatch == cachedDispatch) {
|
|
39190
40066
|
return cacheValue;
|
|
39191
40067
|
}
|
|
39192
|
-
|
|
40068
|
+
|
|
40069
|
+
var dispatchObj = {};
|
|
39193
40070
|
dispatchObj.fields = {};
|
|
39194
|
-
|
|
39195
|
-
|
|
40071
|
+
var keys = Object.keys(formConfig);
|
|
40072
|
+
|
|
40073
|
+
var _loop = function _loop() {
|
|
40074
|
+
var fieldName = _keys[_i5];
|
|
39196
40075
|
dispatchObj.fields[fieldName] = {
|
|
39197
|
-
set:
|
|
39198
|
-
|
|
40076
|
+
set: function set(value) {
|
|
40077
|
+
return dispatch(_set(fieldName)(value));
|
|
40078
|
+
},
|
|
40079
|
+
addValidator: function addValidator(validator) {
|
|
40080
|
+
return dispatch(_addValidator(fieldName)(validator));
|
|
40081
|
+
},
|
|
40082
|
+
removeValidator: function removeValidator(validator) {
|
|
40083
|
+
return dispatch(_removeValidator(fieldName)(validator));
|
|
40084
|
+
},
|
|
40085
|
+
clear: function clear() {
|
|
40086
|
+
return dispatch(clearFieldValidators(fieldName)());
|
|
40087
|
+
}
|
|
39199
40088
|
};
|
|
40089
|
+
};
|
|
40090
|
+
|
|
40091
|
+
for (var _i5 = 0, _keys = keys; _i5 < _keys.length; _i5++) {
|
|
40092
|
+
_loop();
|
|
39200
40093
|
}
|
|
39201
|
-
|
|
40094
|
+
|
|
40095
|
+
dispatchObj.form = {
|
|
40096
|
+
clear: function clear() {
|
|
40097
|
+
return dispatch(_clear());
|
|
40098
|
+
}
|
|
40099
|
+
};
|
|
39202
40100
|
cachedDispatch = dispatch;
|
|
39203
|
-
cacheValue = {
|
|
40101
|
+
cacheValue = {
|
|
40102
|
+
actions: dispatchObj
|
|
40103
|
+
};
|
|
39204
40104
|
return cacheValue;
|
|
39205
40105
|
};
|
|
39206
40106
|
};
|
|
39207
40107
|
|
|
39208
|
-
|
|
40108
|
+
var mapStateToProps = function mapStateToProps(state) {
|
|
40109
|
+
return {
|
|
40110
|
+
fields: state
|
|
40111
|
+
};
|
|
40112
|
+
};
|
|
39209
40113
|
|
|
39210
|
-
|
|
39211
|
-
|
|
39212
|
-
|
|
39213
|
-
|
|
39214
|
-
|
|
40114
|
+
var createFormState = function createFormState(formConfig) {
|
|
40115
|
+
return {
|
|
40116
|
+
reducer: createFormReducer(formConfig),
|
|
40117
|
+
mapDispatchToProps: createMapDispatchToProps(formConfig),
|
|
40118
|
+
mapStateToProps: mapStateToProps
|
|
40119
|
+
};
|
|
40120
|
+
};
|
|
39215
40121
|
|
|
39216
40122
|
var AddressForm = function AddressForm(_ref) {
|
|
39217
40123
|
var _zipErrorMessages;
|