@thecb/components 8.4.8-beta.0 → 8.4.8-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +549 -1436
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +549 -1436
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/atoms/solid-divider/SolidDivider.js +4 -4
- package/src/components/molecules/radio-section/RadioSection.js +113 -121
package/dist/index.esm.js
CHANGED
|
@@ -195,63 +195,6 @@ 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
|
-
|
|
255
198
|
/*! *****************************************************************************
|
|
256
199
|
Copyright (c) Microsoft Corporation.
|
|
257
200
|
|
|
@@ -19065,14 +19008,12 @@ function _extends$1() {
|
|
|
19065
19008
|
_extends$1 = Object.assign ? Object.assign.bind() : function (target) {
|
|
19066
19009
|
for (var i = 1; i < arguments.length; i++) {
|
|
19067
19010
|
var source = arguments[i];
|
|
19068
|
-
|
|
19069
19011
|
for (var key in source) {
|
|
19070
19012
|
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
19071
19013
|
target[key] = source[key];
|
|
19072
19014
|
}
|
|
19073
19015
|
}
|
|
19074
19016
|
}
|
|
19075
|
-
|
|
19076
19017
|
return target;
|
|
19077
19018
|
};
|
|
19078
19019
|
return _extends$1.apply(this, arguments);
|
|
@@ -19082,7 +19023,6 @@ function _assertThisInitialized(self) {
|
|
|
19082
19023
|
if (self === void 0) {
|
|
19083
19024
|
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
19084
19025
|
}
|
|
19085
|
-
|
|
19086
19026
|
return self;
|
|
19087
19027
|
}
|
|
19088
19028
|
|
|
@@ -19115,7 +19055,6 @@ function _isNativeReflectConstruct() {
|
|
|
19115
19055
|
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
19116
19056
|
if (Reflect.construct.sham) return false;
|
|
19117
19057
|
if (typeof Proxy === "function") return true;
|
|
19118
|
-
|
|
19119
19058
|
try {
|
|
19120
19059
|
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
19121
19060
|
return true;
|
|
@@ -19137,30 +19076,23 @@ function _construct(Parent, args, Class) {
|
|
|
19137
19076
|
return instance;
|
|
19138
19077
|
};
|
|
19139
19078
|
}
|
|
19140
|
-
|
|
19141
19079
|
return _construct.apply(null, arguments);
|
|
19142
19080
|
}
|
|
19143
19081
|
|
|
19144
19082
|
function _wrapNativeSuper(Class) {
|
|
19145
19083
|
var _cache = typeof Map === "function" ? new Map() : undefined;
|
|
19146
|
-
|
|
19147
19084
|
_wrapNativeSuper = function _wrapNativeSuper(Class) {
|
|
19148
19085
|
if (Class === null || !_isNativeFunction(Class)) return Class;
|
|
19149
|
-
|
|
19150
19086
|
if (typeof Class !== "function") {
|
|
19151
19087
|
throw new TypeError("Super expression must either be null or a function");
|
|
19152
19088
|
}
|
|
19153
|
-
|
|
19154
19089
|
if (typeof _cache !== "undefined") {
|
|
19155
19090
|
if (_cache.has(Class)) return _cache.get(Class);
|
|
19156
|
-
|
|
19157
19091
|
_cache.set(Class, Wrapper);
|
|
19158
19092
|
}
|
|
19159
|
-
|
|
19160
19093
|
function Wrapper() {
|
|
19161
19094
|
return _construct(Class, arguments, _getPrototypeOf(this).constructor);
|
|
19162
19095
|
}
|
|
19163
|
-
|
|
19164
19096
|
Wrapper.prototype = Object.create(Class.prototype, {
|
|
19165
19097
|
constructor: {
|
|
19166
19098
|
value: Wrapper,
|
|
@@ -19171,7 +19103,6 @@ function _wrapNativeSuper(Class) {
|
|
|
19171
19103
|
});
|
|
19172
19104
|
return _setPrototypeOf(Wrapper, Class);
|
|
19173
19105
|
};
|
|
19174
|
-
|
|
19175
19106
|
return _wrapNativeSuper(Class);
|
|
19176
19107
|
}
|
|
19177
19108
|
|
|
@@ -22521,26 +22452,19 @@ var FunctionPrototype = Function.prototype;
|
|
|
22521
22452
|
var call$1 = FunctionPrototype.call;
|
|
22522
22453
|
var uncurryThisWithBind = functionBindNative && FunctionPrototype.bind.bind(call$1, call$1);
|
|
22523
22454
|
|
|
22524
|
-
var
|
|
22525
|
-
return
|
|
22455
|
+
var functionUncurryThis = functionBindNative ? uncurryThisWithBind : function (fn) {
|
|
22456
|
+
return function () {
|
|
22526
22457
|
return call$1.apply(fn, arguments);
|
|
22527
22458
|
};
|
|
22528
22459
|
};
|
|
22529
22460
|
|
|
22530
|
-
var toString$2 =
|
|
22531
|
-
var stringSlice =
|
|
22461
|
+
var toString$2 = functionUncurryThis({}.toString);
|
|
22462
|
+
var stringSlice = functionUncurryThis(''.slice);
|
|
22532
22463
|
|
|
22533
22464
|
var classofRaw = function (it) {
|
|
22534
22465
|
return stringSlice(toString$2(it), 8, -1);
|
|
22535
22466
|
};
|
|
22536
22467
|
|
|
22537
|
-
var functionUncurryThis = function (fn) {
|
|
22538
|
-
// Nashorn bug:
|
|
22539
|
-
// https://github.com/zloirock/core-js/issues/1128
|
|
22540
|
-
// https://github.com/zloirock/core-js/issues/1130
|
|
22541
|
-
if (classofRaw(fn) === 'Function') return functionUncurryThisRaw(fn);
|
|
22542
|
-
};
|
|
22543
|
-
|
|
22544
22468
|
var $Object = Object;
|
|
22545
22469
|
var split = functionUncurryThis(''.split);
|
|
22546
22470
|
|
|
@@ -22579,6 +22503,7 @@ var toIndexedObject = function (it) {
|
|
|
22579
22503
|
var documentAll = typeof document == 'object' && document.all;
|
|
22580
22504
|
|
|
22581
22505
|
// https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot
|
|
22506
|
+
// eslint-disable-next-line unicorn/no-typeof-undefined -- required for testing
|
|
22582
22507
|
var IS_HTMLDDA = typeof documentAll == 'undefined' && documentAll !== undefined;
|
|
22583
22508
|
|
|
22584
22509
|
var documentAll_1 = {
|
|
@@ -22614,7 +22539,7 @@ var getBuiltIn = function (namespace, method) {
|
|
|
22614
22539
|
|
|
22615
22540
|
var objectIsPrototypeOf = functionUncurryThis({}.isPrototypeOf);
|
|
22616
22541
|
|
|
22617
|
-
var engineUserAgent =
|
|
22542
|
+
var engineUserAgent = typeof navigator != 'undefined' && String(navigator.userAgent) || '';
|
|
22618
22543
|
|
|
22619
22544
|
var process$1 = global_1.process;
|
|
22620
22545
|
var Deno = global_1.Deno;
|
|
@@ -22728,10 +22653,10 @@ var shared = createCommonjsModule(function (module) {
|
|
|
22728
22653
|
(module.exports = function (key, value) {
|
|
22729
22654
|
return sharedStore[key] || (sharedStore[key] = value !== undefined ? value : {});
|
|
22730
22655
|
})('versions', []).push({
|
|
22731
|
-
version: '3.
|
|
22656
|
+
version: '3.29.0',
|
|
22732
22657
|
mode: 'global',
|
|
22733
|
-
copyright: '© 2014-
|
|
22734
|
-
license: 'https://github.com/zloirock/core-js/blob/v3.
|
|
22658
|
+
copyright: '© 2014-2023 Denis Pushkarev (zloirock.ru)',
|
|
22659
|
+
license: 'https://github.com/zloirock/core-js/blob/v3.29.0/LICENSE',
|
|
22735
22660
|
source: 'https://github.com/zloirock/core-js'
|
|
22736
22661
|
});
|
|
22737
22662
|
});
|
|
@@ -22761,21 +22686,15 @@ var uid = function (key) {
|
|
|
22761
22686
|
return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString$3(++id + postfix, 36);
|
|
22762
22687
|
};
|
|
22763
22688
|
|
|
22764
|
-
var WellKnownSymbolsStore = shared('wks');
|
|
22765
22689
|
var Symbol$1 = global_1.Symbol;
|
|
22766
|
-
var
|
|
22767
|
-
var createWellKnownSymbol = useSymbolAsUid ? Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid;
|
|
22690
|
+
var WellKnownSymbolsStore = shared('wks');
|
|
22691
|
+
var createWellKnownSymbol = useSymbolAsUid ? Symbol$1['for'] || Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid;
|
|
22768
22692
|
|
|
22769
22693
|
var wellKnownSymbol = function (name) {
|
|
22770
|
-
if (!hasOwnProperty_1(WellKnownSymbolsStore, name)
|
|
22771
|
-
|
|
22772
|
-
|
|
22773
|
-
|
|
22774
|
-
} else if (useSymbolAsUid && symbolFor) {
|
|
22775
|
-
WellKnownSymbolsStore[name] = symbolFor(description);
|
|
22776
|
-
} else {
|
|
22777
|
-
WellKnownSymbolsStore[name] = createWellKnownSymbol(description);
|
|
22778
|
-
}
|
|
22694
|
+
if (!hasOwnProperty_1(WellKnownSymbolsStore, name)) {
|
|
22695
|
+
WellKnownSymbolsStore[name] = symbolConstructorDetection && hasOwnProperty_1(Symbol$1, name)
|
|
22696
|
+
? Symbol$1[name]
|
|
22697
|
+
: createWellKnownSymbol('Symbol.' + name);
|
|
22779
22698
|
} return WellKnownSymbolsStore[name];
|
|
22780
22699
|
};
|
|
22781
22700
|
|
|
@@ -23014,8 +22933,12 @@ var CONFIGURABLE_FUNCTION_NAME = functionName.CONFIGURABLE;
|
|
|
23014
22933
|
|
|
23015
22934
|
var enforceInternalState = internalState.enforce;
|
|
23016
22935
|
var getInternalState = internalState.get;
|
|
22936
|
+
var $String = String;
|
|
23017
22937
|
// eslint-disable-next-line es/no-object-defineproperty -- safe
|
|
23018
22938
|
var defineProperty = Object.defineProperty;
|
|
22939
|
+
var stringSlice = functionUncurryThis(''.slice);
|
|
22940
|
+
var replace = functionUncurryThis(''.replace);
|
|
22941
|
+
var join = functionUncurryThis([].join);
|
|
23019
22942
|
|
|
23020
22943
|
var CONFIGURABLE_LENGTH = descriptors && !fails(function () {
|
|
23021
22944
|
return defineProperty(function () { /* empty */ }, 'length', { value: 8 }).length !== 8;
|
|
@@ -23024,8 +22947,8 @@ var CONFIGURABLE_LENGTH = descriptors && !fails(function () {
|
|
|
23024
22947
|
var TEMPLATE = String(String).split('String');
|
|
23025
22948
|
|
|
23026
22949
|
var makeBuiltIn = module.exports = function (value, name, options) {
|
|
23027
|
-
if (String(name)
|
|
23028
|
-
name = '[' + String(name)
|
|
22950
|
+
if (stringSlice($String(name), 0, 7) === 'Symbol(') {
|
|
22951
|
+
name = '[' + replace($String(name), /^Symbol\(([^)]*)\)/, '$1') + ']';
|
|
23029
22952
|
}
|
|
23030
22953
|
if (options && options.getter) name = 'get ' + name;
|
|
23031
22954
|
if (options && options.setter) name = 'set ' + name;
|
|
@@ -23044,7 +22967,7 @@ var makeBuiltIn = module.exports = function (value, name, options) {
|
|
|
23044
22967
|
} catch (error) { /* empty */ }
|
|
23045
22968
|
var state = enforceInternalState(value);
|
|
23046
22969
|
if (!hasOwnProperty_1(state, 'source')) {
|
|
23047
|
-
state.source =
|
|
22970
|
+
state.source = join(TEMPLATE, typeof name == 'string' ? name : '');
|
|
23048
22971
|
} return value;
|
|
23049
22972
|
};
|
|
23050
22973
|
|
|
@@ -23500,6 +23423,12 @@ addToUnscopables('at');
|
|
|
23500
23423
|
// eslint-disable-next-line es/no-typed-arrays -- safe
|
|
23501
23424
|
var arrayBufferBasicDetection = typeof ArrayBuffer != 'undefined' && typeof DataView != 'undefined';
|
|
23502
23425
|
|
|
23426
|
+
var defineBuiltInAccessor = function (target, name, descriptor) {
|
|
23427
|
+
if (descriptor.get) makeBuiltIn_1(descriptor.get, name, { getter: true });
|
|
23428
|
+
if (descriptor.set) makeBuiltIn_1(descriptor.set, name, { setter: true });
|
|
23429
|
+
return objectDefineProperty.f(target, name, descriptor);
|
|
23430
|
+
};
|
|
23431
|
+
|
|
23503
23432
|
var correctPrototypeGetter = !fails(function () {
|
|
23504
23433
|
function F() { /* empty */ }
|
|
23505
23434
|
F.prototype.constructor = null;
|
|
@@ -23523,6 +23452,13 @@ var objectGetPrototypeOf = correctPrototypeGetter ? $Object$4.getPrototypeOf : f
|
|
|
23523
23452
|
} return object instanceof $Object$4 ? ObjectPrototype : null;
|
|
23524
23453
|
};
|
|
23525
23454
|
|
|
23455
|
+
var functionUncurryThisAccessor = function (object, key, method) {
|
|
23456
|
+
try {
|
|
23457
|
+
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
23458
|
+
return functionUncurryThis(aCallable(Object.getOwnPropertyDescriptor(object, key)[method]));
|
|
23459
|
+
} catch (error) { /* empty */ }
|
|
23460
|
+
};
|
|
23461
|
+
|
|
23526
23462
|
var $String$3 = String;
|
|
23527
23463
|
var $TypeError$6 = TypeError;
|
|
23528
23464
|
|
|
@@ -23545,8 +23481,7 @@ var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? functio
|
|
|
23545
23481
|
var test = {};
|
|
23546
23482
|
var setter;
|
|
23547
23483
|
try {
|
|
23548
|
-
|
|
23549
|
-
setter = functionUncurryThis(Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set);
|
|
23484
|
+
setter = functionUncurryThisAccessor(Object.prototype, '__proto__', 'set');
|
|
23550
23485
|
setter(test, []);
|
|
23551
23486
|
CORRECT_SETTER = test instanceof Array;
|
|
23552
23487
|
} catch (error) { /* empty */ }
|
|
@@ -23559,14 +23494,6 @@ var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? functio
|
|
|
23559
23494
|
};
|
|
23560
23495
|
}() : undefined);
|
|
23561
23496
|
|
|
23562
|
-
var defineProperty$2 = objectDefineProperty.f;
|
|
23563
|
-
|
|
23564
|
-
|
|
23565
|
-
|
|
23566
|
-
|
|
23567
|
-
|
|
23568
|
-
|
|
23569
|
-
|
|
23570
23497
|
var enforceInternalState = internalState.enforce;
|
|
23571
23498
|
var getInternalState = internalState.get;
|
|
23572
23499
|
var Int8Array = global_1.Int8Array;
|
|
@@ -23717,9 +23644,12 @@ if (NATIVE_ARRAY_BUFFER_VIEWS && objectGetPrototypeOf(Uint8ClampedArrayPrototype
|
|
|
23717
23644
|
|
|
23718
23645
|
if (descriptors && !hasOwnProperty_1(TypedArrayPrototype, TO_STRING_TAG$2)) {
|
|
23719
23646
|
TYPED_ARRAY_TAG_REQUIRED = true;
|
|
23720
|
-
|
|
23721
|
-
|
|
23722
|
-
|
|
23647
|
+
defineBuiltInAccessor(TypedArrayPrototype, TO_STRING_TAG$2, {
|
|
23648
|
+
configurable: true,
|
|
23649
|
+
get: function () {
|
|
23650
|
+
return isObject(this) ? this[TYPED_ARRAY_TAG] : undefined;
|
|
23651
|
+
}
|
|
23652
|
+
});
|
|
23723
23653
|
for (NAME in TypedArrayConstructorsList) if (global_1[NAME]) {
|
|
23724
23654
|
createNonEnumerableProperty(global_1[NAME], TYPED_ARRAY_TAG, NAME);
|
|
23725
23655
|
}
|
|
@@ -27412,14 +27342,16 @@ var fallbackValues$x = {
|
|
|
27412
27342
|
};
|
|
27413
27343
|
|
|
27414
27344
|
var SolidDivider = function SolidDivider(_ref) {
|
|
27415
|
-
var
|
|
27345
|
+
var borderColor = _ref.borderColor,
|
|
27346
|
+
borderSize = _ref.borderSize,
|
|
27347
|
+
themeValues = _ref.themeValues;
|
|
27416
27348
|
return /*#__PURE__*/React.createElement(Box, {
|
|
27417
27349
|
padding: "0",
|
|
27418
27350
|
minWidth: "100%",
|
|
27419
27351
|
minHeight: "1px",
|
|
27420
|
-
borderColor: themeValues.borderColor,
|
|
27421
|
-
borderSize: themeValues.borderSize,
|
|
27422
|
-
borderWidthOverride: "0px 0px ".concat(themeValues.borderSize, " 0px")
|
|
27352
|
+
borderColor: borderColor || themeValues.borderColor,
|
|
27353
|
+
borderSize: borderSize || themeValues.borderSize,
|
|
27354
|
+
borderWidthOverride: "0px 0px ".concat(borderSize || themeValues.borderSize, " 0px")
|
|
27423
27355
|
});
|
|
27424
27356
|
};
|
|
27425
27357
|
|
|
@@ -38620,624 +38552,49 @@ var TableHeading_styled = styled.th.withConfig({
|
|
|
38620
38552
|
return extraStyles;
|
|
38621
38553
|
});
|
|
38622
38554
|
|
|
38623
|
-
|
|
38624
|
-
|
|
38625
|
-
|
|
38626
|
-
|
|
38627
|
-
}
|
|
38628
|
-
|
|
38629
|
-
return value === "" ? emptyCase : validatorFn.apply(void 0, [value].concat(rest));
|
|
38630
|
-
};
|
|
38631
|
-
};
|
|
38555
|
+
const validatorToPredicate = (validatorFn, emptyCase) => (
|
|
38556
|
+
value,
|
|
38557
|
+
...rest
|
|
38558
|
+
) => (value === "" ? emptyCase : validatorFn(value, ...rest));
|
|
38632
38559
|
|
|
38633
38560
|
var commonjsGlobal$1 = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
38634
38561
|
|
|
38635
|
-
|
|
38636
|
-
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
38637
|
-
}
|
|
38638
|
-
|
|
38639
|
-
var dayjs_min = {
|
|
38640
|
-
exports: {}
|
|
38641
|
-
};
|
|
38562
|
+
var dayjs_min = {exports: {}};
|
|
38642
38563
|
|
|
38643
38564
|
(function (module, exports) {
|
|
38644
|
-
|
|
38645
|
-
|
|
38646
|
-
}(commonjsGlobal$1, function () {
|
|
38647
|
-
var t = 1e3,
|
|
38648
|
-
e = 6e4,
|
|
38649
|
-
n = 36e5,
|
|
38650
|
-
r = "millisecond",
|
|
38651
|
-
i = "second",
|
|
38652
|
-
s = "minute",
|
|
38653
|
-
u = "hour",
|
|
38654
|
-
a = "day",
|
|
38655
|
-
o = "week",
|
|
38656
|
-
f = "month",
|
|
38657
|
-
h = "quarter",
|
|
38658
|
-
c = "year",
|
|
38659
|
-
d = "date",
|
|
38660
|
-
$ = "Invalid Date",
|
|
38661
|
-
l = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,
|
|
38662
|
-
y = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,
|
|
38663
|
-
M = {
|
|
38664
|
-
name: "en",
|
|
38665
|
-
weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),
|
|
38666
|
-
months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_")
|
|
38667
|
-
},
|
|
38668
|
-
m = function m(t, e, n) {
|
|
38669
|
-
var r = String(t);
|
|
38670
|
-
return !r || r.length >= e ? t : "" + Array(e + 1 - r.length).join(n) + t;
|
|
38671
|
-
},
|
|
38672
|
-
g = {
|
|
38673
|
-
s: m,
|
|
38674
|
-
z: function z(t) {
|
|
38675
|
-
var e = -t.utcOffset(),
|
|
38676
|
-
n = Math.abs(e),
|
|
38677
|
-
r = Math.floor(n / 60),
|
|
38678
|
-
i = n % 60;
|
|
38679
|
-
return (e <= 0 ? "+" : "-") + m(r, 2, "0") + ":" + m(i, 2, "0");
|
|
38680
|
-
},
|
|
38681
|
-
m: function t(e, n) {
|
|
38682
|
-
if (e.date() < n.date()) return -t(n, e);
|
|
38683
|
-
var r = 12 * (n.year() - e.year()) + (n.month() - e.month()),
|
|
38684
|
-
i = e.clone().add(r, f),
|
|
38685
|
-
s = n - i < 0,
|
|
38686
|
-
u = e.clone().add(r + (s ? -1 : 1), f);
|
|
38687
|
-
return +(-(r + (n - i) / (s ? i - u : u - i)) || 0);
|
|
38688
|
-
},
|
|
38689
|
-
a: function a(t) {
|
|
38690
|
-
return t < 0 ? Math.ceil(t) || 0 : Math.floor(t);
|
|
38691
|
-
},
|
|
38692
|
-
p: function p(t) {
|
|
38693
|
-
return {
|
|
38694
|
-
M: f,
|
|
38695
|
-
y: c,
|
|
38696
|
-
w: o,
|
|
38697
|
-
d: a,
|
|
38698
|
-
D: d,
|
|
38699
|
-
h: u,
|
|
38700
|
-
m: s,
|
|
38701
|
-
s: i,
|
|
38702
|
-
ms: r,
|
|
38703
|
-
Q: h
|
|
38704
|
-
}[t] || String(t || "").toLowerCase().replace(/s$/, "");
|
|
38705
|
-
},
|
|
38706
|
-
u: function u(t) {
|
|
38707
|
-
return void 0 === t;
|
|
38708
|
-
}
|
|
38709
|
-
},
|
|
38710
|
-
D = "en",
|
|
38711
|
-
v = {};
|
|
38712
|
-
|
|
38713
|
-
v[D] = M;
|
|
38714
|
-
|
|
38715
|
-
var p = function p(t) {
|
|
38716
|
-
return t instanceof _;
|
|
38717
|
-
},
|
|
38718
|
-
S = function S(t, e, n) {
|
|
38719
|
-
var r;
|
|
38720
|
-
if (!t) return D;
|
|
38721
|
-
if ("string" == typeof t) v[t] && (r = t), e && (v[t] = e, r = t);else {
|
|
38722
|
-
var i = t.name;
|
|
38723
|
-
v[i] = t, r = i;
|
|
38724
|
-
}
|
|
38725
|
-
return !n && r && (D = r), r || !n && D;
|
|
38726
|
-
},
|
|
38727
|
-
w = function w(t, e) {
|
|
38728
|
-
if (p(t)) return t.clone();
|
|
38729
|
-
var n = "object" == _typeof(e) ? e : {};
|
|
38730
|
-
return n.date = t, n.args = arguments, new _(n);
|
|
38731
|
-
},
|
|
38732
|
-
O = g;
|
|
38733
|
-
|
|
38734
|
-
O.l = S, O.i = p, O.w = function (t, e) {
|
|
38735
|
-
return w(t, {
|
|
38736
|
-
locale: e.$L,
|
|
38737
|
-
utc: e.$u,
|
|
38738
|
-
x: e.$x,
|
|
38739
|
-
$offset: e.$offset
|
|
38740
|
-
});
|
|
38741
|
-
};
|
|
38742
|
-
|
|
38743
|
-
var _ = function () {
|
|
38744
|
-
function M(t) {
|
|
38745
|
-
this.$L = S(t.locale, null, !0), this.parse(t);
|
|
38746
|
-
}
|
|
38747
|
-
|
|
38748
|
-
var m = M.prototype;
|
|
38749
|
-
return m.parse = function (t) {
|
|
38750
|
-
this.$d = function (t) {
|
|
38751
|
-
var e = t.date,
|
|
38752
|
-
n = t.utc;
|
|
38753
|
-
if (null === e) return new Date(NaN);
|
|
38754
|
-
if (O.u(e)) return new Date();
|
|
38755
|
-
if (e instanceof Date) return new Date(e);
|
|
38756
|
-
|
|
38757
|
-
if ("string" == typeof e && !/Z$/i.test(e)) {
|
|
38758
|
-
var r = e.match(l);
|
|
38759
|
-
|
|
38760
|
-
if (r) {
|
|
38761
|
-
var i = r[2] - 1 || 0,
|
|
38762
|
-
s = (r[7] || "0").substring(0, 3);
|
|
38763
|
-
return n ? new Date(Date.UTC(r[1], i, r[3] || 1, r[4] || 0, r[5] || 0, r[6] || 0, s)) : new Date(r[1], i, r[3] || 1, r[4] || 0, r[5] || 0, r[6] || 0, s);
|
|
38764
|
-
}
|
|
38765
|
-
}
|
|
38766
|
-
|
|
38767
|
-
return new Date(e);
|
|
38768
|
-
}(t), this.$x = t.x || {}, this.init();
|
|
38769
|
-
}, m.init = function () {
|
|
38770
|
-
var t = this.$d;
|
|
38771
|
-
this.$y = t.getFullYear(), this.$M = t.getMonth(), this.$D = t.getDate(), this.$W = t.getDay(), this.$H = t.getHours(), this.$m = t.getMinutes(), this.$s = t.getSeconds(), this.$ms = t.getMilliseconds();
|
|
38772
|
-
}, m.$utils = function () {
|
|
38773
|
-
return O;
|
|
38774
|
-
}, m.isValid = function () {
|
|
38775
|
-
return !(this.$d.toString() === $);
|
|
38776
|
-
}, m.isSame = function (t, e) {
|
|
38777
|
-
var n = w(t);
|
|
38778
|
-
return this.startOf(e) <= n && n <= this.endOf(e);
|
|
38779
|
-
}, m.isAfter = function (t, e) {
|
|
38780
|
-
return w(t) < this.startOf(e);
|
|
38781
|
-
}, m.isBefore = function (t, e) {
|
|
38782
|
-
return this.endOf(e) < w(t);
|
|
38783
|
-
}, m.$g = function (t, e, n) {
|
|
38784
|
-
return O.u(t) ? this[e] : this.set(n, t);
|
|
38785
|
-
}, m.unix = function () {
|
|
38786
|
-
return Math.floor(this.valueOf() / 1e3);
|
|
38787
|
-
}, m.valueOf = function () {
|
|
38788
|
-
return this.$d.getTime();
|
|
38789
|
-
}, m.startOf = function (t, e) {
|
|
38790
|
-
var n = this,
|
|
38791
|
-
r = !!O.u(e) || e,
|
|
38792
|
-
h = O.p(t),
|
|
38793
|
-
$ = function $(t, e) {
|
|
38794
|
-
var i = O.w(n.$u ? Date.UTC(n.$y, e, t) : new Date(n.$y, e, t), n);
|
|
38795
|
-
return r ? i : i.endOf(a);
|
|
38796
|
-
},
|
|
38797
|
-
l = function l(t, e) {
|
|
38798
|
-
return O.w(n.toDate()[t].apply(n.toDate("s"), (r ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e)), n);
|
|
38799
|
-
},
|
|
38800
|
-
y = this.$W,
|
|
38801
|
-
M = this.$M,
|
|
38802
|
-
m = this.$D,
|
|
38803
|
-
g = "set" + (this.$u ? "UTC" : "");
|
|
38565
|
+
!function(t,e){module.exports=e();}(commonjsGlobal$1,(function(){var t=1e3,e=6e4,n=36e5,r="millisecond",i="second",s="minute",u="hour",a="day",o="week",f="month",h="quarter",c="year",d="date",$="Invalid Date",l=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,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,M={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},m=function(t,e,n){var r=String(t);return !r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},g={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return (e<=0?"+":"-")+m(r,2,"0")+":"+m(i,2,"0")},m:function t(e,n){if(e.date()<n.date())return -t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,f),s=n-i<0,u=e.clone().add(r+(s?-1:1),f);return +(-(r+(n-i)/(s?i-u:u-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return {M:f,y:c,w:o,d:a,D:d,h:u,m:s,s:i,ms:r,Q:h}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},D="en",v={};v[D]=M;var p=function(t){return t instanceof _},S=function(t,e,n){var r;if(!t)return D;if("string"==typeof t)v[t]&&(r=t),e&&(v[t]=e,r=t);else {var i=t.name;v[i]=t,r=i;}return !n&&r&&(D=r),r||!n&&D},w=function(t,e){if(p(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},O=g;O.l=S,O.i=p,O.w=function(t,e){return w(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function M(t){this.$L=S(t.locale,null,!0),this.parse(t);}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(O.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match(l);if(r){var i=r[2]-1||0,s=(r[7]||"0").substring(0,3);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)}}return new Date(e)}(t),this.$x=t.x||{},this.init();},m.init=function(){var t=this.$d;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();},m.$utils=function(){return O},m.isValid=function(){return !(this.$d.toString()===$)},m.isSame=function(t,e){var n=w(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return w(t)<this.startOf(e)},m.isBefore=function(t,e){return this.endOf(e)<w(t)},m.$g=function(t,e,n){return O.u(t)?this[e]:this.set(n,t)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(t,e){var n=this,r=!!O.u(e)||e,h=O.p(t),$=function(t,e){var i=O.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return r?i:i.endOf(a)},l=function(t,e){return O.w(n.toDate()[t].apply(n.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},y=this.$W,M=this.$M,m=this.$D,g="set"+(this.$u?"UTC":"");switch(h){case c:return r?$(1,0):$(31,11);case f:return r?$(1,M):$(0,M+1);case o:var D=this.$locale().weekStart||0,v=(y<D?y+7:y)-D;return $(r?m-v:m+(6-v),M);case a:case d:return l(g+"Hours",0);case u:return l(g+"Minutes",1);case s:return l(g+"Seconds",2);case i:return l(g+"Milliseconds",3);default:return this.clone()}},m.endOf=function(t){return this.startOf(t,!1)},m.$set=function(t,e){var n,o=O.p(t),h="set"+(this.$u?"UTC":""),$=(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],l=o===a?this.$D+(e-this.$W):e;if(o===f||o===c){var y=this.clone().set(d,1);y.$d[$](l),y.init(),this.$d=y.set(d,Math.min(this.$D,y.daysInMonth())).$d;}else $&&this.$d[$](l);return this.init(),this},m.set=function(t,e){return this.clone().$set(t,e)},m.get=function(t){return this[O.p(t)]()},m.add=function(r,h){var d,$=this;r=Number(r);var l=O.p(h),y=function(t){var e=w($);return O.w(e.date(e.date()+Math.round(t*r)),$)};if(l===f)return this.set(f,this.$M+r);if(l===c)return this.set(c,this.$y+r);if(l===a)return y(1);if(l===o)return y(7);var M=(d={},d[s]=e,d[u]=n,d[i]=t,d)[l]||1,m=this.$d.getTime()+r*M;return O.w(m,this)},m.subtract=function(t,e){return this.add(-1*t,e)},m.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||$;var r=t||"YYYY-MM-DDTHH:mm:ssZ",i=O.z(this),s=this.$H,u=this.$m,a=this.$M,o=n.weekdays,f=n.months,h=function(t,n,i,s){return t&&(t[n]||t(e,r))||i[n].substr(0,s)},c=function(t){return O.s(s%12||12,t,"0")},d=n.meridiem||function(t,e,n){var r=t<12?"AM":"PM";return n?r.toLowerCase():r},l={YY:String(this.$y).slice(-2),YYYY:this.$y,M:a+1,MM:O.s(a+1,2,"0"),MMM:h(n.monthsShort,a,f,3),MMMM:h(f,a),D:this.$D,DD:O.s(this.$D,2,"0"),d:String(this.$W),dd:h(n.weekdaysMin,this.$W,o,2),ddd:h(n.weekdaysShort,this.$W,o,3),dddd:o[this.$W],H:String(s),HH:O.s(s,2,"0"),h:c(1),hh:c(2),a:d(s,u,!0),A:d(s,u,!1),m:String(u),mm:O.s(u,2,"0"),s:String(this.$s),ss:O.s(this.$s,2,"0"),SSS:O.s(this.$ms,3,"0"),Z:i};return r.replace(y,(function(t,e){return e||l[t]||i.replace(":","")}))},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(r,d,$){var l,y=O.p(d),M=w(r),m=(M.utcOffset()-this.utcOffset())*e,g=this-M,D=O.m(this,M);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)},m.daysInMonth=function(){return this.endOf(f).$D},m.$locale=function(){return v[this.$L]},m.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=S(t,e,!0);return r&&(n.$L=r),n},m.clone=function(){return O.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},M}(),b=_.prototype;return w.prototype=b,[["$ms",r],["$s",i],["$m",s],["$H",u],["$W",a],["$M",f],["$y",c],["$D",d]].forEach((function(t){b[t[1]]=function(e){return this.$g(e,t[0],t[1])};})),w.extend=function(t,e){return t.$i||(t(e,_,w),t.$i=!0),w},w.locale=S,w.isDayjs=p,w.unix=function(t){return w(1e3*t)},w.en=v[D],w.Ls=v,w.p={},w}));
|
|
38566
|
+
}(dayjs_min));
|
|
38804
38567
|
|
|
38805
|
-
|
|
38806
|
-
case c:
|
|
38807
|
-
return r ? $(1, 0) : $(31, 11);
|
|
38568
|
+
var dayjs = dayjs_min.exports;
|
|
38808
38569
|
|
|
38809
|
-
|
|
38810
|
-
return r ? $(1, M) : $(0, M + 1);
|
|
38811
|
-
|
|
38812
|
-
case o:
|
|
38813
|
-
var D = this.$locale().weekStart || 0,
|
|
38814
|
-
v = (y < D ? y + 7 : y) - D;
|
|
38815
|
-
return $(r ? m - v : m + (6 - v), M);
|
|
38816
|
-
|
|
38817
|
-
case a:
|
|
38818
|
-
case d:
|
|
38819
|
-
return l(g + "Hours", 0);
|
|
38820
|
-
|
|
38821
|
-
case u:
|
|
38822
|
-
return l(g + "Minutes", 1);
|
|
38823
|
-
|
|
38824
|
-
case s:
|
|
38825
|
-
return l(g + "Seconds", 2);
|
|
38826
|
-
|
|
38827
|
-
case i:
|
|
38828
|
-
return l(g + "Milliseconds", 3);
|
|
38829
|
-
|
|
38830
|
-
default:
|
|
38831
|
-
return this.clone();
|
|
38832
|
-
}
|
|
38833
|
-
}, m.endOf = function (t) {
|
|
38834
|
-
return this.startOf(t, !1);
|
|
38835
|
-
}, m.$set = function (t, e) {
|
|
38836
|
-
var n,
|
|
38837
|
-
o = O.p(t),
|
|
38838
|
-
h = "set" + (this.$u ? "UTC" : ""),
|
|
38839
|
-
$ = (n = {}, n[a] = h + "Date", n[d] = h + "Date", n[f] = h + "Month", n[c] = h + "FullYear", n[u] = h + "Hours", n[s] = h + "Minutes", n[i] = h + "Seconds", n[r] = h + "Milliseconds", n)[o],
|
|
38840
|
-
l = o === a ? this.$D + (e - this.$W) : e;
|
|
38841
|
-
|
|
38842
|
-
if (o === f || o === c) {
|
|
38843
|
-
var y = this.clone().set(d, 1);
|
|
38844
|
-
y.$d[$](l), y.init(), this.$d = y.set(d, Math.min(this.$D, y.daysInMonth())).$d;
|
|
38845
|
-
} else $ && this.$d[$](l);
|
|
38846
|
-
|
|
38847
|
-
return this.init(), this;
|
|
38848
|
-
}, m.set = function (t, e) {
|
|
38849
|
-
return this.clone().$set(t, e);
|
|
38850
|
-
}, m.get = function (t) {
|
|
38851
|
-
return this[O.p(t)]();
|
|
38852
|
-
}, m.add = function (r, h) {
|
|
38853
|
-
var d,
|
|
38854
|
-
$ = this;
|
|
38855
|
-
r = Number(r);
|
|
38856
|
-
|
|
38857
|
-
var l = O.p(h),
|
|
38858
|
-
y = function y(t) {
|
|
38859
|
-
var e = w($);
|
|
38860
|
-
return O.w(e.date(e.date() + Math.round(t * r)), $);
|
|
38861
|
-
};
|
|
38862
|
-
|
|
38863
|
-
if (l === f) return this.set(f, this.$M + r);
|
|
38864
|
-
if (l === c) return this.set(c, this.$y + r);
|
|
38865
|
-
if (l === a) return y(1);
|
|
38866
|
-
if (l === o) return y(7);
|
|
38867
|
-
var M = (d = {}, d[s] = e, d[u] = n, d[i] = t, d)[l] || 1,
|
|
38868
|
-
m = this.$d.getTime() + r * M;
|
|
38869
|
-
return O.w(m, this);
|
|
38870
|
-
}, m.subtract = function (t, e) {
|
|
38871
|
-
return this.add(-1 * t, e);
|
|
38872
|
-
}, m.format = function (t) {
|
|
38873
|
-
var e = this,
|
|
38874
|
-
n = this.$locale();
|
|
38875
|
-
if (!this.isValid()) return n.invalidDate || $;
|
|
38876
|
-
|
|
38877
|
-
var r = t || "YYYY-MM-DDTHH:mm:ssZ",
|
|
38878
|
-
i = O.z(this),
|
|
38879
|
-
s = this.$H,
|
|
38880
|
-
u = this.$m,
|
|
38881
|
-
a = this.$M,
|
|
38882
|
-
o = n.weekdays,
|
|
38883
|
-
f = n.months,
|
|
38884
|
-
h = function h(t, n, i, s) {
|
|
38885
|
-
return t && (t[n] || t(e, r)) || i[n].substr(0, s);
|
|
38886
|
-
},
|
|
38887
|
-
c = function c(t) {
|
|
38888
|
-
return O.s(s % 12 || 12, t, "0");
|
|
38889
|
-
},
|
|
38890
|
-
d = n.meridiem || function (t, e, n) {
|
|
38891
|
-
var r = t < 12 ? "AM" : "PM";
|
|
38892
|
-
return n ? r.toLowerCase() : r;
|
|
38893
|
-
},
|
|
38894
|
-
l = {
|
|
38895
|
-
YY: String(this.$y).slice(-2),
|
|
38896
|
-
YYYY: this.$y,
|
|
38897
|
-
M: a + 1,
|
|
38898
|
-
MM: O.s(a + 1, 2, "0"),
|
|
38899
|
-
MMM: h(n.monthsShort, a, f, 3),
|
|
38900
|
-
MMMM: h(f, a),
|
|
38901
|
-
D: this.$D,
|
|
38902
|
-
DD: O.s(this.$D, 2, "0"),
|
|
38903
|
-
d: String(this.$W),
|
|
38904
|
-
dd: h(n.weekdaysMin, this.$W, o, 2),
|
|
38905
|
-
ddd: h(n.weekdaysShort, this.$W, o, 3),
|
|
38906
|
-
dddd: o[this.$W],
|
|
38907
|
-
H: String(s),
|
|
38908
|
-
HH: O.s(s, 2, "0"),
|
|
38909
|
-
h: c(1),
|
|
38910
|
-
hh: c(2),
|
|
38911
|
-
a: d(s, u, !0),
|
|
38912
|
-
A: d(s, u, !1),
|
|
38913
|
-
m: String(u),
|
|
38914
|
-
mm: O.s(u, 2, "0"),
|
|
38915
|
-
s: String(this.$s),
|
|
38916
|
-
ss: O.s(this.$s, 2, "0"),
|
|
38917
|
-
SSS: O.s(this.$ms, 3, "0"),
|
|
38918
|
-
Z: i
|
|
38919
|
-
};
|
|
38920
|
-
|
|
38921
|
-
return r.replace(y, function (t, e) {
|
|
38922
|
-
return e || l[t] || i.replace(":", "");
|
|
38923
|
-
});
|
|
38924
|
-
}, m.utcOffset = function () {
|
|
38925
|
-
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
|
|
38926
|
-
}, m.diff = function (r, d, $) {
|
|
38927
|
-
var l,
|
|
38928
|
-
y = O.p(d),
|
|
38929
|
-
M = w(r),
|
|
38930
|
-
m = (M.utcOffset() - this.utcOffset()) * e,
|
|
38931
|
-
g = this - M,
|
|
38932
|
-
D = O.m(this, M);
|
|
38933
|
-
return D = (l = {}, l[c] = D / 12, l[f] = D, l[h] = D / 3, l[o] = (g - m) / 6048e5, l[a] = (g - m) / 864e5, l[u] = g / n, l[s] = g / e, l[i] = g / t, l)[y] || g, $ ? D : O.a(D);
|
|
38934
|
-
}, m.daysInMonth = function () {
|
|
38935
|
-
return this.endOf(f).$D;
|
|
38936
|
-
}, m.$locale = function () {
|
|
38937
|
-
return v[this.$L];
|
|
38938
|
-
}, m.locale = function (t, e) {
|
|
38939
|
-
if (!t) return this.$L;
|
|
38940
|
-
var n = this.clone(),
|
|
38941
|
-
r = S(t, e, !0);
|
|
38942
|
-
return r && (n.$L = r), n;
|
|
38943
|
-
}, m.clone = function () {
|
|
38944
|
-
return O.w(this.$d, this);
|
|
38945
|
-
}, m.toDate = function () {
|
|
38946
|
-
return new Date(this.valueOf());
|
|
38947
|
-
}, m.toJSON = function () {
|
|
38948
|
-
return this.isValid() ? this.toISOString() : null;
|
|
38949
|
-
}, m.toISOString = function () {
|
|
38950
|
-
return this.$d.toISOString();
|
|
38951
|
-
}, m.toString = function () {
|
|
38952
|
-
return this.$d.toUTCString();
|
|
38953
|
-
}, M;
|
|
38954
|
-
}(),
|
|
38955
|
-
b = _.prototype;
|
|
38956
|
-
|
|
38957
|
-
return w.prototype = b, [["$ms", r], ["$s", i], ["$m", s], ["$H", u], ["$W", a], ["$M", f], ["$y", c], ["$D", d]].forEach(function (t) {
|
|
38958
|
-
b[t[1]] = function (e) {
|
|
38959
|
-
return this.$g(e, t[0], t[1]);
|
|
38960
|
-
};
|
|
38961
|
-
}), w.extend = function (t, e) {
|
|
38962
|
-
return t.$i || (t(e, _, w), t.$i = !0), w;
|
|
38963
|
-
}, w.locale = S, w.isDayjs = p, w.unix = function (t) {
|
|
38964
|
-
return w(1e3 * t);
|
|
38965
|
-
}, w.en = v[D], w.Ls = v, w.p = {}, w;
|
|
38966
|
-
});
|
|
38967
|
-
})(dayjs_min);
|
|
38968
|
-
|
|
38969
|
-
var dayjs_minExports = dayjs_min.exports;
|
|
38970
|
-
var dayjs = /*@__PURE__*/getDefaultExportFromCjs(dayjs_minExports);
|
|
38971
|
-
var customParseFormat$1 = {
|
|
38972
|
-
exports: {}
|
|
38973
|
-
};
|
|
38570
|
+
var customParseFormat$1 = {exports: {}};
|
|
38974
38571
|
|
|
38975
38572
|
(function (module, exports) {
|
|
38976
|
-
|
|
38977
|
-
|
|
38978
|
-
}(commonjsGlobal$1, function () {
|
|
38979
|
-
var t = {
|
|
38980
|
-
LTS: "h:mm:ss A",
|
|
38981
|
-
LT: "h:mm A",
|
|
38982
|
-
L: "MM/DD/YYYY",
|
|
38983
|
-
LL: "MMMM D, YYYY",
|
|
38984
|
-
LLL: "MMMM D, YYYY h:mm A",
|
|
38985
|
-
LLLL: "dddd, MMMM D, YYYY h:mm A"
|
|
38986
|
-
},
|
|
38987
|
-
e = /(\[[^[]*\])|([-:/.()\s]+)|(A|a|YYYY|YY?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,
|
|
38988
|
-
n = /\d\d/,
|
|
38989
|
-
r = /\d\d?/,
|
|
38990
|
-
i = /\d*[^\s\d-_:/()]+/,
|
|
38991
|
-
o = {},
|
|
38992
|
-
s = function s(t) {
|
|
38993
|
-
return (t = +t) + (t > 68 ? 1900 : 2e3);
|
|
38994
|
-
};
|
|
38573
|
+
!function(t,e){module.exports=e();}(commonjsGlobal$1,(function(){var t={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},e=/(\[[^[]*\])|([-:/.()\s]+)|(A|a|YYYY|YY?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,n=/\d\d/,r=/\d\d?/,i=/\d*[^\s\d-_:/()]+/,o={},s=function(t){return (t=+t)+(t>68?1900:2e3)};var a=function(t){return function(e){this[t]=+e;}},f=[/[+-]\d\d:?(\d\d)?|Z/,function(t){(this.zone||(this.zone={})).offset=function(t){if(!t)return 0;if("Z"===t)return 0;var e=t.match(/([+-]|\d\d)/g),n=60*e[1]+(+e[2]||0);return 0===n?0:"+"===e[0]?-n:n}(t);}],u=function(t){var e=o[t];return e&&(e.indexOf?e:e.s.concat(e.f))},h=function(t,e){var n,r=o.meridiem;if(r){for(var i=1;i<=24;i+=1)if(t.indexOf(r(i,0,e))>-1){n=i>12;break}}else n=t===(e?"pm":"PM");return n},d={A:[i,function(t){this.afternoon=h(t,!1);}],a:[i,function(t){this.afternoon=h(t,!0);}],S:[/\d/,function(t){this.milliseconds=100*+t;}],SS:[n,function(t){this.milliseconds=10*+t;}],SSS:[/\d{3}/,function(t){this.milliseconds=+t;}],s:[r,a("seconds")],ss:[r,a("seconds")],m:[r,a("minutes")],mm:[r,a("minutes")],H:[r,a("hours")],h:[r,a("hours")],HH:[r,a("hours")],hh:[r,a("hours")],D:[r,a("day")],DD:[n,a("day")],Do:[i,function(t){var e=o.ordinal,n=t.match(/\d+/);if(this.day=n[0],e)for(var r=1;r<=31;r+=1)e(r).replace(/\[|\]/g,"")===t&&(this.day=r);}],M:[r,a("month")],MM:[n,a("month")],MMM:[i,function(t){var e=u("months"),n=(u("monthsShort")||e.map((function(t){return t.substr(0,3)}))).indexOf(t)+1;if(n<1)throw new Error;this.month=n%12||n;}],MMMM:[i,function(t){var e=u("months").indexOf(t)+1;if(e<1)throw new Error;this.month=e%12||e;}],Y:[/[+-]?\d+/,a("year")],YY:[n,function(t){this.year=s(t);}],YYYY:[/\d{4}/,a("year")],Z:f,ZZ:f};function c(n){var r,i;r=n,i=o&&o.formats;for(var s=(n=r.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(e,n,r){var o=r&&r.toUpperCase();return n||i[r]||t[r]||i[o].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(t,e,n){return e||n.slice(1)}))}))).match(e),a=s.length,f=0;f<a;f+=1){var u=s[f],h=d[u],c=h&&h[0],l=h&&h[1];s[f]=l?{regex:c,parser:l}:u.replace(/^\[|\]$/g,"");}return function(t){for(var e={},n=0,r=0;n<a;n+=1){var i=s[n];if("string"==typeof i)r+=i.length;else {var o=i.regex,f=i.parser,u=t.substr(r),h=o.exec(u)[0];f.call(e,h),t=t.replace(h,"");}}return function(t){var e=t.afternoon;if(void 0!==e){var n=t.hours;e?n<12&&(t.hours+=12):12===n&&(t.hours=0),delete t.afternoon;}}(e),e}}return function(t,e,n){n.p.customParseFormat=!0,t&&t.parseTwoDigitYear&&(s=t.parseTwoDigitYear);var r=e.prototype,i=r.parse;r.parse=function(t){var e=t.date,r=t.utc,s=t.args;this.$u=r;var a=s[1];if("string"==typeof a){var f=!0===s[2],u=!0===s[3],h=f||u,d=s[2];u&&(d=s[2]),o=this.$locale(),!f&&d&&(o=n.Ls[d]),this.$d=function(t,e,n){try{if(["x","X"].indexOf(e)>-1)return new Date(("X"===e?1e3:1)*t);var r=c(e)(t),i=r.year,o=r.month,s=r.day,a=r.hours,f=r.minutes,u=r.seconds,h=r.milliseconds,d=r.zone,l=new Date,m=s||(i||o?1:l.getDate()),M=i||l.getFullYear(),Y=0;i&&!o||(Y=o>0?o-1:l.getMonth());var p=a||0,v=f||0,D=u||0,g=h||0;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)}catch(t){return new Date("")}}(e,a,r),this.init(),d&&!0!==d&&(this.$L=this.locale(d).$L),h&&e!=this.format(a)&&(this.$d=new Date("")),o={};}else if(a instanceof Array)for(var l=a.length,m=1;m<=l;m+=1){s[1]=a[m-1];var M=n.apply(this,s);if(M.isValid()){this.$d=M.$d,this.$L=M.$L,this.init();break}m===l&&(this.$d=new Date(""));}else i.call(this,t);};}}));
|
|
38574
|
+
}(customParseFormat$1));
|
|
38995
38575
|
|
|
38996
|
-
|
|
38997
|
-
return function (e) {
|
|
38998
|
-
this[t] = +e;
|
|
38999
|
-
};
|
|
39000
|
-
},
|
|
39001
|
-
f = [/[+-]\d\d:?(\d\d)?|Z/, function (t) {
|
|
39002
|
-
(this.zone || (this.zone = {})).offset = function (t) {
|
|
39003
|
-
if (!t) return 0;
|
|
39004
|
-
if ("Z" === t) return 0;
|
|
39005
|
-
var e = t.match(/([+-]|\d\d)/g),
|
|
39006
|
-
n = 60 * e[1] + (+e[2] || 0);
|
|
39007
|
-
return 0 === n ? 0 : "+" === e[0] ? -n : n;
|
|
39008
|
-
}(t);
|
|
39009
|
-
}],
|
|
39010
|
-
u = function u(t) {
|
|
39011
|
-
var e = o[t];
|
|
39012
|
-
return e && (e.indexOf ? e : e.s.concat(e.f));
|
|
39013
|
-
},
|
|
39014
|
-
h = function h(t, e) {
|
|
39015
|
-
var n,
|
|
39016
|
-
r = o.meridiem;
|
|
39017
|
-
|
|
39018
|
-
if (r) {
|
|
39019
|
-
for (var i = 1; i <= 24; i += 1) {
|
|
39020
|
-
if (t.indexOf(r(i, 0, e)) > -1) {
|
|
39021
|
-
n = i > 12;
|
|
39022
|
-
break;
|
|
39023
|
-
}
|
|
39024
|
-
}
|
|
39025
|
-
} else n = t === (e ? "pm" : "PM");
|
|
38576
|
+
var customParseFormat = customParseFormat$1.exports;
|
|
39026
38577
|
|
|
39027
|
-
|
|
39028
|
-
},
|
|
39029
|
-
d = {
|
|
39030
|
-
A: [i, function (t) {
|
|
39031
|
-
this.afternoon = h(t, !1);
|
|
39032
|
-
}],
|
|
39033
|
-
a: [i, function (t) {
|
|
39034
|
-
this.afternoon = h(t, !0);
|
|
39035
|
-
}],
|
|
39036
|
-
S: [/\d/, function (t) {
|
|
39037
|
-
this.milliseconds = 100 * +t;
|
|
39038
|
-
}],
|
|
39039
|
-
SS: [n, function (t) {
|
|
39040
|
-
this.milliseconds = 10 * +t;
|
|
39041
|
-
}],
|
|
39042
|
-
SSS: [/\d{3}/, function (t) {
|
|
39043
|
-
this.milliseconds = +t;
|
|
39044
|
-
}],
|
|
39045
|
-
s: [r, a("seconds")],
|
|
39046
|
-
ss: [r, a("seconds")],
|
|
39047
|
-
m: [r, a("minutes")],
|
|
39048
|
-
mm: [r, a("minutes")],
|
|
39049
|
-
H: [r, a("hours")],
|
|
39050
|
-
h: [r, a("hours")],
|
|
39051
|
-
HH: [r, a("hours")],
|
|
39052
|
-
hh: [r, a("hours")],
|
|
39053
|
-
D: [r, a("day")],
|
|
39054
|
-
DD: [n, a("day")],
|
|
39055
|
-
Do: [i, function (t) {
|
|
39056
|
-
var e = o.ordinal,
|
|
39057
|
-
n = t.match(/\d+/);
|
|
39058
|
-
if (this.day = n[0], e) for (var r = 1; r <= 31; r += 1) {
|
|
39059
|
-
e(r).replace(/\[|\]/g, "") === t && (this.day = r);
|
|
39060
|
-
}
|
|
39061
|
-
}],
|
|
39062
|
-
M: [r, a("month")],
|
|
39063
|
-
MM: [n, a("month")],
|
|
39064
|
-
MMM: [i, function (t) {
|
|
39065
|
-
var e = u("months"),
|
|
39066
|
-
n = (u("monthsShort") || e.map(function (t) {
|
|
39067
|
-
return t.substr(0, 3);
|
|
39068
|
-
})).indexOf(t) + 1;
|
|
39069
|
-
if (n < 1) throw new Error();
|
|
39070
|
-
this.month = n % 12 || n;
|
|
39071
|
-
}],
|
|
39072
|
-
MMMM: [i, function (t) {
|
|
39073
|
-
var e = u("months").indexOf(t) + 1;
|
|
39074
|
-
if (e < 1) throw new Error();
|
|
39075
|
-
this.month = e % 12 || e;
|
|
39076
|
-
}],
|
|
39077
|
-
Y: [/[+-]?\d+/, a("year")],
|
|
39078
|
-
YY: [n, function (t) {
|
|
39079
|
-
this.year = s(t);
|
|
39080
|
-
}],
|
|
39081
|
-
YYYY: [/\d{4}/, a("year")],
|
|
39082
|
-
Z: f,
|
|
39083
|
-
ZZ: f
|
|
39084
|
-
};
|
|
38578
|
+
var isSameOrBefore$1 = {exports: {}};
|
|
39085
38579
|
|
|
39086
|
-
|
|
39087
|
-
|
|
39088
|
-
|
|
39089
|
-
|
|
39090
|
-
for (var s = (n = r.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, function (e, n, r) {
|
|
39091
|
-
var o = r && r.toUpperCase();
|
|
39092
|
-
return n || i[r] || t[r] || i[o].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, function (t, e, n) {
|
|
39093
|
-
return e || n.slice(1);
|
|
39094
|
-
});
|
|
39095
|
-
})).match(e), a = s.length, f = 0; f < a; f += 1) {
|
|
39096
|
-
var u = s[f],
|
|
39097
|
-
h = d[u],
|
|
39098
|
-
c = h && h[0],
|
|
39099
|
-
l = h && h[1];
|
|
39100
|
-
s[f] = l ? {
|
|
39101
|
-
regex: c,
|
|
39102
|
-
parser: l
|
|
39103
|
-
} : u.replace(/^\[|\]$/g, "");
|
|
39104
|
-
}
|
|
39105
|
-
|
|
39106
|
-
return function (t) {
|
|
39107
|
-
for (var e = {}, n = 0, r = 0; n < a; n += 1) {
|
|
39108
|
-
var i = s[n];
|
|
39109
|
-
if ("string" == typeof i) r += i.length;else {
|
|
39110
|
-
var o = i.regex,
|
|
39111
|
-
f = i.parser,
|
|
39112
|
-
u = t.substr(r),
|
|
39113
|
-
h = o.exec(u)[0];
|
|
39114
|
-
f.call(e, h), t = t.replace(h, "");
|
|
39115
|
-
}
|
|
39116
|
-
}
|
|
39117
|
-
|
|
39118
|
-
return function (t) {
|
|
39119
|
-
var e = t.afternoon;
|
|
39120
|
-
|
|
39121
|
-
if (void 0 !== e) {
|
|
39122
|
-
var n = t.hours;
|
|
39123
|
-
e ? n < 12 && (t.hours += 12) : 12 === n && (t.hours = 0), delete t.afternoon;
|
|
39124
|
-
}
|
|
39125
|
-
}(e), e;
|
|
39126
|
-
};
|
|
39127
|
-
}
|
|
39128
|
-
|
|
39129
|
-
return function (t, e, n) {
|
|
39130
|
-
n.p.customParseFormat = !0, t && t.parseTwoDigitYear && (s = t.parseTwoDigitYear);
|
|
39131
|
-
var r = e.prototype,
|
|
39132
|
-
i = r.parse;
|
|
39133
|
-
|
|
39134
|
-
r.parse = function (t) {
|
|
39135
|
-
var e = t.date,
|
|
39136
|
-
r = t.utc,
|
|
39137
|
-
s = t.args;
|
|
39138
|
-
this.$u = r;
|
|
39139
|
-
var a = s[1];
|
|
39140
|
-
|
|
39141
|
-
if ("string" == typeof a) {
|
|
39142
|
-
var f = !0 === s[2],
|
|
39143
|
-
u = !0 === s[3],
|
|
39144
|
-
h = f || u,
|
|
39145
|
-
d = s[2];
|
|
39146
|
-
u && (d = s[2]), o = this.$locale(), !f && d && (o = n.Ls[d]), this.$d = function (t, e, n) {
|
|
39147
|
-
try {
|
|
39148
|
-
if (["x", "X"].indexOf(e) > -1) return new Date(("X" === e ? 1e3 : 1) * t);
|
|
39149
|
-
var r = c(e)(t),
|
|
39150
|
-
i = r.year,
|
|
39151
|
-
o = r.month,
|
|
39152
|
-
s = r.day,
|
|
39153
|
-
a = r.hours,
|
|
39154
|
-
f = r.minutes,
|
|
39155
|
-
u = r.seconds,
|
|
39156
|
-
h = r.milliseconds,
|
|
39157
|
-
d = r.zone,
|
|
39158
|
-
l = new Date(),
|
|
39159
|
-
m = s || (i || o ? 1 : l.getDate()),
|
|
39160
|
-
M = i || l.getFullYear(),
|
|
39161
|
-
Y = 0;
|
|
39162
|
-
i && !o || (Y = o > 0 ? o - 1 : l.getMonth());
|
|
39163
|
-
var p = a || 0,
|
|
39164
|
-
v = f || 0,
|
|
39165
|
-
D = u || 0,
|
|
39166
|
-
g = h || 0;
|
|
39167
|
-
return d ? new Date(Date.UTC(M, Y, m, p, v, D, g + 60 * d.offset * 1e3)) : n ? new Date(Date.UTC(M, Y, m, p, v, D, g)) : new Date(M, Y, m, p, v, D, g);
|
|
39168
|
-
} catch (t) {
|
|
39169
|
-
return new Date("");
|
|
39170
|
-
}
|
|
39171
|
-
}(e, a, r), this.init(), d && !0 !== d && (this.$L = this.locale(d).$L), h && e != this.format(a) && (this.$d = new Date("")), o = {};
|
|
39172
|
-
} else if (a instanceof Array) for (var l = a.length, m = 1; m <= l; m += 1) {
|
|
39173
|
-
s[1] = a[m - 1];
|
|
39174
|
-
var M = n.apply(this, s);
|
|
39175
|
-
|
|
39176
|
-
if (M.isValid()) {
|
|
39177
|
-
this.$d = M.$d, this.$L = M.$L, this.init();
|
|
39178
|
-
break;
|
|
39179
|
-
}
|
|
38580
|
+
(function (module, exports) {
|
|
38581
|
+
!function(e,i){module.exports=i();}(commonjsGlobal$1,(function(){return function(e,i){i.prototype.isSameOrBefore=function(e,i){return this.isSame(e,i)||this.isBefore(e,i)};}}));
|
|
38582
|
+
}(isSameOrBefore$1));
|
|
39180
38583
|
|
|
39181
|
-
|
|
39182
|
-
} else i.call(this, t);
|
|
39183
|
-
};
|
|
39184
|
-
};
|
|
39185
|
-
});
|
|
39186
|
-
})(customParseFormat$1);
|
|
38584
|
+
var isSameOrBefore = isSameOrBefore$1.exports;
|
|
39187
38585
|
|
|
39188
|
-
var
|
|
39189
|
-
var customParseFormat = /*@__PURE__*/getDefaultExportFromCjs(customParseFormatExports);
|
|
39190
|
-
var isSameOrBefore$1 = {
|
|
39191
|
-
exports: {}
|
|
39192
|
-
};
|
|
38586
|
+
var isSameOrAfter$1 = {exports: {}};
|
|
39193
38587
|
|
|
39194
38588
|
(function (module, exports) {
|
|
39195
|
-
|
|
39196
|
-
|
|
39197
|
-
}(commonjsGlobal$1, function () {
|
|
39198
|
-
return function (e, i) {
|
|
39199
|
-
i.prototype.isSameOrBefore = function (e, i) {
|
|
39200
|
-
return this.isSame(e, i) || this.isBefore(e, i);
|
|
39201
|
-
};
|
|
39202
|
-
};
|
|
39203
|
-
});
|
|
39204
|
-
})(isSameOrBefore$1);
|
|
38589
|
+
!function(e,t){module.exports=t();}(commonjsGlobal$1,(function(){return function(e,t){t.prototype.isSameOrAfter=function(e,t){return this.isSame(e,t)||this.isAfter(e,t)};}}));
|
|
38590
|
+
}(isSameOrAfter$1));
|
|
39205
38591
|
|
|
39206
|
-
var
|
|
39207
|
-
var isSameOrBefore = /*@__PURE__*/getDefaultExportFromCjs(isSameOrBeforeExports);
|
|
39208
|
-
var isSameOrAfter$1 = {
|
|
39209
|
-
exports: {}
|
|
39210
|
-
};
|
|
39211
|
-
|
|
39212
|
-
(function (module, exports) {
|
|
39213
|
-
!function (e, t) {
|
|
39214
|
-
module.exports = t();
|
|
39215
|
-
}(commonjsGlobal$1, function () {
|
|
39216
|
-
return function (e, t) {
|
|
39217
|
-
t.prototype.isSameOrAfter = function (e, t) {
|
|
39218
|
-
return this.isSame(e, t) || this.isAfter(e, t);
|
|
39219
|
-
};
|
|
39220
|
-
};
|
|
39221
|
-
});
|
|
39222
|
-
})(isSameOrAfter$1);
|
|
38592
|
+
var isSameOrAfter = isSameOrAfter$1.exports;
|
|
39223
38593
|
|
|
39224
|
-
var isSameOrAfterExports = isSameOrAfter$1.exports;
|
|
39225
|
-
var isSameOrAfter = /*@__PURE__*/getDefaultExportFromCjs(isSameOrAfterExports);
|
|
39226
38594
|
/* eslint-disable no-unused-vars */
|
|
39227
38595
|
|
|
39228
|
-
|
|
39229
|
-
|
|
39230
|
-
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
39231
|
-
args[_key2] = arguments[_key2];
|
|
39232
|
-
}
|
|
39233
|
-
|
|
39234
|
-
return {
|
|
39235
|
-
type: type,
|
|
39236
|
-
args: args,
|
|
39237
|
-
error: error
|
|
39238
|
-
};
|
|
39239
|
-
};
|
|
39240
|
-
|
|
38596
|
+
const createValidator = (type, error) => {
|
|
38597
|
+
let validator = (...args) => ({ type, args, error });
|
|
39241
38598
|
validator.error = error;
|
|
39242
38599
|
return validator;
|
|
39243
38600
|
};
|
|
@@ -39245,38 +38602,30 @@ var createValidator = function createValidator(type, error) {
|
|
|
39245
38602
|
dayjs.extend(customParseFormat);
|
|
39246
38603
|
dayjs.extend(isSameOrBefore);
|
|
39247
38604
|
dayjs.extend(isSameOrAfter);
|
|
39248
|
-
var validatorFns = {};
|
|
39249
|
-
var INCLUDED_IN = "validator/INCLUDED_IN";
|
|
39250
|
-
var INCLUDED_IN_ERROR = "error/INCLUDED_IN";
|
|
39251
|
-
var includedIn = createValidator(INCLUDED_IN, INCLUDED_IN_ERROR);
|
|
39252
38605
|
|
|
39253
|
-
validatorFns
|
|
39254
|
-
return Array.isArray(args[0]) ? args[0].includes(value) : args[0] === value;
|
|
39255
|
-
};
|
|
39256
|
-
|
|
39257
|
-
var REQUIRED = "validator/REQUIRED";
|
|
39258
|
-
var REQUIRED_ERROR = "error/REQUIRED";
|
|
39259
|
-
var required = createValidator(REQUIRED, REQUIRED_ERROR);
|
|
38606
|
+
let validatorFns = {};
|
|
39260
38607
|
|
|
39261
|
-
|
|
39262
|
-
|
|
39263
|
-
|
|
38608
|
+
const INCLUDED_IN = "validator/INCLUDED_IN";
|
|
38609
|
+
const INCLUDED_IN_ERROR = "error/INCLUDED_IN";
|
|
38610
|
+
const includedIn = createValidator(INCLUDED_IN, INCLUDED_IN_ERROR);
|
|
38611
|
+
validatorFns[INCLUDED_IN] = (value, args, form) =>
|
|
38612
|
+
Array.isArray(args[0]) ? args[0].includes(value) : args[0] === value;
|
|
39264
38613
|
|
|
39265
|
-
|
|
39266
|
-
|
|
39267
|
-
|
|
38614
|
+
const REQUIRED = "validator/REQUIRED";
|
|
38615
|
+
const REQUIRED_ERROR = "error/REQUIRED";
|
|
38616
|
+
const required = createValidator(REQUIRED, REQUIRED_ERROR);
|
|
38617
|
+
validatorFns[REQUIRED] = (value, args, form) => value !== "";
|
|
39268
38618
|
|
|
39269
|
-
|
|
39270
|
-
|
|
39271
|
-
|
|
38619
|
+
const ONLY_INTEGERS = "validator/ONLY_INTEGERS";
|
|
38620
|
+
const ONLY_INTEGERS_ERROR = "error/ONLY_INTEGERS";
|
|
38621
|
+
const onlyIntegers = createValidator(ONLY_INTEGERS, ONLY_INTEGERS_ERROR);
|
|
38622
|
+
validatorFns[ONLY_INTEGERS] = (value, args, form) => /^(-?\d+)?$/.test(value);
|
|
39272
38623
|
|
|
39273
|
-
|
|
39274
|
-
|
|
39275
|
-
|
|
38624
|
+
const ONLY_NATURALS = "validator/ONLY_NATURALS";
|
|
38625
|
+
const ONLY_NATURALS_ERROR = "error/ONLY_NATURALS";
|
|
38626
|
+
const onlyNaturals = createValidator(ONLY_NATURALS, ONLY_NATURALS_ERROR);
|
|
38627
|
+
validatorFns[ONLY_NATURALS] = (value, args, form) => /^(\d+)?$/.test(value);
|
|
39276
38628
|
|
|
39277
|
-
validatorFns[ONLY_NATURALS] = function (value, args, form) {
|
|
39278
|
-
return /^(\d+)?$/.test(value);
|
|
39279
|
-
};
|
|
39280
38629
|
/*
|
|
39281
38630
|
07/22: experimental expiration date constraint
|
|
39282
38631
|
should allow entry of expiration date using "/" character
|
|
@@ -39286,464 +38635,439 @@ not tested as validation function
|
|
|
39286
38635
|
to validate exp date instead use combo of:
|
|
39287
38636
|
required(), hasLength(), isValidMonth(), dateAfterToday()
|
|
39288
38637
|
*/
|
|
39289
|
-
|
|
39290
|
-
|
|
39291
|
-
|
|
39292
|
-
|
|
39293
|
-
|
|
39294
|
-
|
|
39295
|
-
validatorFns[ONLY_EXPIRATION_DATE] =
|
|
39296
|
-
|
|
39297
|
-
|
|
39298
|
-
|
|
39299
|
-
|
|
39300
|
-
|
|
39301
|
-
|
|
39302
|
-
|
|
39303
|
-
|
|
38638
|
+
const ONLY_EXPIRATION_DATE = "validator/ONLY_EXPIRATION_DATE";
|
|
38639
|
+
const ONLY_EXPIRATION_DATE_ERROR = "error/ONLY_EXPIRATION_DATE";
|
|
38640
|
+
const onlyExpirationDate = createValidator(
|
|
38641
|
+
ONLY_EXPIRATION_DATE,
|
|
38642
|
+
ONLY_EXPIRATION_DATE_ERROR
|
|
38643
|
+
);
|
|
38644
|
+
validatorFns[ONLY_EXPIRATION_DATE] = (value, args, form) =>
|
|
38645
|
+
/^(\d?\d?\/?\d?\d?)?$/.test(value);
|
|
38646
|
+
|
|
38647
|
+
const NUMBER_LESS_THAN = "validator/NUMBER_LESS_THAN";
|
|
38648
|
+
const NUMBER_LESS_THAN_ERROR = "error/NUMBER_LESS_THAN";
|
|
38649
|
+
const numberLessThan = createValidator(
|
|
38650
|
+
NUMBER_LESS_THAN,
|
|
38651
|
+
NUMBER_LESS_THAN_ERROR
|
|
38652
|
+
);
|
|
38653
|
+
validatorFns[NUMBER_LESS_THAN] = (value, args, form) => {
|
|
39304
38654
|
if (value === "") {
|
|
39305
38655
|
return true;
|
|
39306
38656
|
}
|
|
39307
|
-
|
|
39308
38657
|
return Number(value) < args[0];
|
|
39309
38658
|
};
|
|
39310
38659
|
|
|
39311
|
-
|
|
39312
|
-
|
|
39313
|
-
|
|
39314
|
-
|
|
39315
|
-
|
|
38660
|
+
const NUMBER_LESS_THAN_OR_EQUAL_TO =
|
|
38661
|
+
"validator/NUMBER_LESS_THAN_OR_EQUAL_TO";
|
|
38662
|
+
const NUMBER_LESS_THAN_OR_EQUAL_TO_ERROR =
|
|
38663
|
+
"error/NUMBER_LESS_THAN_OR_EQUAL_TO";
|
|
38664
|
+
const numberLessThanOrEqualTo = createValidator(
|
|
38665
|
+
NUMBER_LESS_THAN_OR_EQUAL_TO,
|
|
38666
|
+
NUMBER_LESS_THAN_OR_EQUAL_TO_ERROR
|
|
38667
|
+
);
|
|
38668
|
+
validatorFns[NUMBER_LESS_THAN_OR_EQUAL_TO] = (value, args, form) => {
|
|
39316
38669
|
if (value === "") {
|
|
39317
38670
|
return true;
|
|
39318
38671
|
}
|
|
39319
|
-
|
|
39320
38672
|
return Number(value) <= args[0];
|
|
39321
38673
|
};
|
|
39322
38674
|
|
|
39323
|
-
|
|
39324
|
-
|
|
39325
|
-
|
|
39326
|
-
|
|
39327
|
-
|
|
38675
|
+
const NUMBER_GREATER_THAN = "validator/NUMBER_GREATER_THAN";
|
|
38676
|
+
const NUMBER_GREATER_THAN_ERROR = "error/NUMBER_GREATER_THAN";
|
|
38677
|
+
const numberGreaterThan = createValidator(
|
|
38678
|
+
NUMBER_GREATER_THAN,
|
|
38679
|
+
NUMBER_GREATER_THAN_ERROR
|
|
38680
|
+
);
|
|
38681
|
+
validatorFns[NUMBER_GREATER_THAN] = (value, args, form) => {
|
|
39328
38682
|
if (value === "") {
|
|
39329
38683
|
return true;
|
|
39330
38684
|
}
|
|
39331
|
-
|
|
39332
38685
|
return Number(value) > args[0];
|
|
39333
38686
|
};
|
|
39334
38687
|
|
|
39335
|
-
|
|
39336
|
-
|
|
39337
|
-
|
|
39338
|
-
|
|
39339
|
-
|
|
38688
|
+
const NUMBER_GREATER_THAN_OR_EQUAL_TO =
|
|
38689
|
+
"validator/NUMBER_GREATER_THAN_OR_EQUAL_TO";
|
|
38690
|
+
const NUMBER_GREATER_THAN_OR_EQUAL_TO_ERROR =
|
|
38691
|
+
"error/NUMBER_GREATER_THAN_OR_EQUAL_TO";
|
|
38692
|
+
const numberGreaterThanOrEqualTo = createValidator(
|
|
38693
|
+
NUMBER_GREATER_THAN_OR_EQUAL_TO,
|
|
38694
|
+
NUMBER_GREATER_THAN_OR_EQUAL_TO_ERROR
|
|
38695
|
+
);
|
|
38696
|
+
validatorFns[NUMBER_GREATER_THAN_OR_EQUAL_TO] = (value, args, form) => {
|
|
39340
38697
|
if (value === "") {
|
|
39341
38698
|
return true;
|
|
39342
38699
|
}
|
|
39343
|
-
|
|
39344
38700
|
return Number(value) >= args[0];
|
|
39345
38701
|
};
|
|
39346
38702
|
|
|
39347
|
-
|
|
39348
|
-
|
|
39349
|
-
|
|
39350
|
-
|
|
39351
|
-
|
|
39352
|
-
var dependentField = form[args[0]];
|
|
39353
|
-
|
|
38703
|
+
const MATCHES_FIELD = "validator/MATCHES_FIELD";
|
|
38704
|
+
const MATCHES_FIELD_ERROR$1 = "error/MATCHES_FIELD";
|
|
38705
|
+
const matchesField = createValidator(MATCHES_FIELD, MATCHES_FIELD_ERROR$1);
|
|
38706
|
+
validatorFns[MATCHES_FIELD] = (value, args, form) => {
|
|
38707
|
+
const dependentField = form[args[0]];
|
|
39354
38708
|
if (dependentField === undefined) {
|
|
39355
|
-
throw new Error(
|
|
38709
|
+
throw new Error(
|
|
38710
|
+
`${args[0]} was passed to matchesField, but that field does not exist in the form`
|
|
38711
|
+
);
|
|
39356
38712
|
}
|
|
39357
|
-
|
|
39358
|
-
var dependentFieldValue = dependentField.rawValue;
|
|
38713
|
+
const dependentFieldValue = dependentField.rawValue;
|
|
39359
38714
|
return value === dependentFieldValue;
|
|
39360
38715
|
};
|
|
39361
38716
|
|
|
39362
|
-
|
|
39363
|
-
|
|
39364
|
-
|
|
39365
|
-
|
|
39366
|
-
|
|
39367
|
-
|
|
39368
|
-
|
|
39369
|
-
|
|
39370
|
-
|
|
39371
|
-
|
|
39372
|
-
|
|
39373
|
-
|
|
39374
|
-
|
|
39375
|
-
|
|
39376
|
-
|
|
38717
|
+
const validateWhenErrorMessage = type =>
|
|
38718
|
+
`${type} was passed to validateWhen, but that validator type does not exist.
|
|
38719
|
+
Please check that you are only calling validator creator functions exported from
|
|
38720
|
+
redux-freeform in your form config and that you didn't forget to
|
|
38721
|
+
invoke the validator creator (you cannot pass the functions themselves to
|
|
38722
|
+
createFormState). Also make sure you aren't passing validateWhen() to validateWhen
|
|
38723
|
+
as the primary validator.`;
|
|
38724
|
+
|
|
38725
|
+
const VALIDATE_WHEN = "validator/VALIDATE_WHEN";
|
|
38726
|
+
const VALIDATE_WHEN_ERROR = "error/VALIDATE_WHEN";
|
|
38727
|
+
const validateWhen = (
|
|
38728
|
+
dependentValidator,
|
|
38729
|
+
primaryValidator,
|
|
38730
|
+
optionalFieldName
|
|
38731
|
+
) => ({
|
|
38732
|
+
type: VALIDATE_WHEN,
|
|
38733
|
+
args: [dependentValidator, primaryValidator, optionalFieldName],
|
|
38734
|
+
error: dependentValidator.error
|
|
38735
|
+
});
|
|
39377
38736
|
validateWhen.error = VALIDATE_WHEN_ERROR;
|
|
39378
|
-
|
|
39379
|
-
|
|
39380
|
-
|
|
39381
|
-
|
|
39382
|
-
|
|
39383
|
-
|
|
39384
|
-
|
|
39385
|
-
|
|
39386
|
-
|
|
39387
|
-
if (primaryValidator.type === undefined || typeof validatorFns[primaryValidator.type] !== "function") {
|
|
38737
|
+
validatorFns[VALIDATE_WHEN] = (value, args, form) => {
|
|
38738
|
+
const [dependentValidator, primaryValidator, optionalFieldName] = args;
|
|
38739
|
+
const dependsOnOtherField = typeof optionalFieldName === "string";
|
|
38740
|
+
|
|
38741
|
+
if (
|
|
38742
|
+
primaryValidator.type === undefined ||
|
|
38743
|
+
typeof validatorFns[primaryValidator.type] !== "function"
|
|
38744
|
+
) {
|
|
39388
38745
|
throw new Error(validateWhenErrorMessage(primaryValidator.type));
|
|
39389
38746
|
}
|
|
39390
|
-
|
|
39391
38747
|
if (dependsOnOtherField && form[optionalFieldName] === undefined) {
|
|
39392
|
-
throw new Error(
|
|
38748
|
+
throw new Error(
|
|
38749
|
+
`${args[2]} was passed to matchesField, but that field does not exist in the form`
|
|
38750
|
+
);
|
|
39393
38751
|
}
|
|
39394
38752
|
|
|
39395
|
-
|
|
39396
|
-
|
|
39397
|
-
|
|
39398
|
-
|
|
39399
|
-
|
|
39400
|
-
|
|
39401
|
-
|
|
39402
|
-
|
|
39403
|
-
|
|
39404
|
-
|
|
39405
|
-
|
|
39406
|
-
|
|
39407
|
-
|
|
39408
|
-
|
|
39409
|
-
|
|
39410
|
-
|
|
39411
|
-
|
|
39412
|
-
|
|
39413
|
-
|
|
39414
|
-
|
|
39415
|
-
|
|
38753
|
+
const primaryPredicate = validatorToPredicate(
|
|
38754
|
+
validatorFns[primaryValidator.type],
|
|
38755
|
+
false
|
|
38756
|
+
);
|
|
38757
|
+
const primaryValue = dependsOnOtherField
|
|
38758
|
+
? form[optionalFieldName].rawValue
|
|
38759
|
+
: value;
|
|
38760
|
+
const primaryPredicatePassed = primaryPredicate(
|
|
38761
|
+
primaryValue,
|
|
38762
|
+
primaryValidator.args,
|
|
38763
|
+
form
|
|
38764
|
+
);
|
|
38765
|
+
|
|
38766
|
+
return primaryPredicatePassed
|
|
38767
|
+
? validatorFns[dependentValidator.type](
|
|
38768
|
+
value,
|
|
38769
|
+
dependentValidator.args,
|
|
38770
|
+
form
|
|
38771
|
+
)
|
|
38772
|
+
: true;
|
|
38773
|
+
};
|
|
38774
|
+
|
|
38775
|
+
const validateSumErrorMessage = type =>
|
|
38776
|
+
`${type} was passed to validateSum, but that validator type does not exist.
|
|
38777
|
+
Please check that you are only calling validator creator functions exported from
|
|
38778
|
+
redux-freeform in your form config and that you didn't forget to
|
|
38779
|
+
invoke the validator creator (you cannot pass the functions themselves to
|
|
38780
|
+
createFormState).`;
|
|
38781
|
+
const VALIDATE_SUM = "validator/VALIDATE_SUM";
|
|
38782
|
+
const VALIDATE_SUM_ERROR = "error/VALIDATE_SUM";
|
|
38783
|
+
const validateSum = (validator, fieldNamesArray) => ({
|
|
38784
|
+
type: VALIDATE_SUM,
|
|
38785
|
+
args: [validator, fieldNamesArray],
|
|
38786
|
+
error: validator.error
|
|
38787
|
+
});
|
|
39416
38788
|
validateSum.error = VALIDATE_SUM_ERROR;
|
|
38789
|
+
validatorFns[VALIDATE_SUM] = (value, args, form) => {
|
|
38790
|
+
const [validator, fieldNamesArray] = args;
|
|
39417
38791
|
|
|
39418
|
-
|
|
39419
|
-
|
|
39420
|
-
|
|
39421
|
-
|
|
39422
|
-
|
|
39423
|
-
if (validator.type === undefined || typeof validatorFns[validator.type] !== "function") {
|
|
38792
|
+
if (
|
|
38793
|
+
validator.type === undefined ||
|
|
38794
|
+
typeof validatorFns[validator.type] !== "function"
|
|
38795
|
+
) {
|
|
39424
38796
|
throw new Error(validateSumErrorMessage(validator.type));
|
|
39425
38797
|
}
|
|
39426
38798
|
|
|
39427
|
-
|
|
39428
|
-
|
|
39429
|
-
|
|
39430
|
-
|
|
39431
|
-
|
|
39432
|
-
var fieldName = _step.value;
|
|
39433
|
-
|
|
39434
|
-
if (form[fieldName] === undefined) {
|
|
39435
|
-
throw new Error("".concat(fieldName, " was passed to matchesField, but that field does not exist in the form"));
|
|
39436
|
-
}
|
|
38799
|
+
for (const fieldName of fieldNamesArray) {
|
|
38800
|
+
if (form[fieldName] === undefined) {
|
|
38801
|
+
throw new Error(
|
|
38802
|
+
`${fieldName} was passed to matchesField, but that field does not exist in the form`
|
|
38803
|
+
);
|
|
39437
38804
|
}
|
|
39438
|
-
} catch (err) {
|
|
39439
|
-
_iterator.e(err);
|
|
39440
|
-
} finally {
|
|
39441
|
-
_iterator.f();
|
|
39442
38805
|
}
|
|
39443
38806
|
|
|
39444
|
-
|
|
39445
|
-
|
|
39446
|
-
|
|
38807
|
+
const sum = fieldNamesArray.reduce(
|
|
38808
|
+
(acc, curr) => acc + Number(form[curr].rawValue),
|
|
38809
|
+
Number(value)
|
|
38810
|
+
);
|
|
38811
|
+
|
|
39447
38812
|
return validatorFns[validator.type](sum, validator.args, form);
|
|
39448
38813
|
};
|
|
39449
38814
|
|
|
39450
|
-
|
|
39451
|
-
|
|
39452
|
-
|
|
39453
|
-
|
|
39454
|
-
validatorFns[HAS_LENGTH] = function (value, args, form) {
|
|
38815
|
+
const HAS_LENGTH = "validator/HAS_LENGTH";
|
|
38816
|
+
const HAS_LENGTH_ERROR = "error/HAS_LENGTH";
|
|
38817
|
+
const hasLength = createValidator(HAS_LENGTH, HAS_LENGTH_ERROR);
|
|
38818
|
+
validatorFns[HAS_LENGTH] = (value, args, form) => {
|
|
39455
38819
|
if (value === "") {
|
|
39456
38820
|
return true;
|
|
39457
38821
|
}
|
|
39458
|
-
|
|
39459
|
-
|
|
39460
|
-
var max = args[1];
|
|
39461
|
-
|
|
38822
|
+
const min = args[0];
|
|
38823
|
+
const max = args[1];
|
|
39462
38824
|
if (max == undefined || min == undefined) {
|
|
39463
|
-
throw new Error(
|
|
38825
|
+
throw new Error(
|
|
38826
|
+
"Max and min need to be defined for hasLength, both or one of them is undefined"
|
|
38827
|
+
);
|
|
39464
38828
|
}
|
|
39465
|
-
|
|
39466
38829
|
if (max < min) {
|
|
39467
|
-
throw new Error(
|
|
38830
|
+
throw new Error(
|
|
38831
|
+
"hasLength validator was passed a min greater than the max"
|
|
38832
|
+
);
|
|
39468
38833
|
}
|
|
39469
|
-
|
|
39470
|
-
var valueLength = value.length;
|
|
38834
|
+
const valueLength = value.length;
|
|
39471
38835
|
return max >= valueLength && valueLength >= min;
|
|
39472
38836
|
};
|
|
39473
38837
|
|
|
39474
|
-
|
|
39475
|
-
|
|
39476
|
-
|
|
39477
|
-
|
|
39478
|
-
|
|
38838
|
+
const DATE_BEFORE_TODAY = "validator/DATE_BEFORE_TODAY";
|
|
38839
|
+
const DATE_BEFORE_TODAY_ERROR = "error/DATE_BEFORE_TODAY";
|
|
38840
|
+
const dateBeforeToday = createValidator(
|
|
38841
|
+
DATE_BEFORE_TODAY,
|
|
38842
|
+
DATE_BEFORE_TODAY_ERROR
|
|
38843
|
+
);
|
|
38844
|
+
validatorFns[DATE_BEFORE_TODAY] = (value, args, form) => {
|
|
39479
38845
|
if (value === "") {
|
|
39480
38846
|
return true;
|
|
39481
38847
|
}
|
|
39482
|
-
|
|
39483
|
-
|
|
39484
|
-
|
|
39485
|
-
var inclusive = args[2] || false;
|
|
38848
|
+
const dateFormat = args[0];
|
|
38849
|
+
const unit = args[1];
|
|
38850
|
+
const inclusive = args[2] || false;
|
|
39486
38851
|
|
|
39487
38852
|
if (dateFormat == undefined || unit == undefined) {
|
|
39488
|
-
throw new Error(
|
|
38853
|
+
throw new Error(
|
|
38854
|
+
"Date format and unit need to be defined for dateBeforeToday, one or both are undefined"
|
|
38855
|
+
);
|
|
39489
38856
|
}
|
|
39490
|
-
|
|
39491
|
-
|
|
39492
|
-
var dateValue = dayjs(value, dateFormat);
|
|
38857
|
+
const now = dayjs();
|
|
38858
|
+
const dateValue = dayjs(value, dateFormat);
|
|
39493
38859
|
|
|
39494
38860
|
if (inclusive === true) {
|
|
39495
38861
|
return dateValue.isSameOrBefore(now, unit);
|
|
39496
38862
|
}
|
|
39497
|
-
|
|
39498
38863
|
return dateValue.isBefore(now, unit);
|
|
39499
38864
|
};
|
|
39500
38865
|
|
|
39501
|
-
|
|
39502
|
-
|
|
39503
|
-
|
|
39504
|
-
|
|
39505
|
-
|
|
38866
|
+
const DATE_AFTER_TODAY = "validator/DATE_AFTER_TODAY";
|
|
38867
|
+
const DATE_AFTER_TODAY_ERROR = "error/DATE_AFTER_TODAY";
|
|
38868
|
+
const dateAfterToday = createValidator(
|
|
38869
|
+
DATE_AFTER_TODAY,
|
|
38870
|
+
DATE_AFTER_TODAY_ERROR
|
|
38871
|
+
);
|
|
38872
|
+
validatorFns[DATE_AFTER_TODAY] = (value, args, form) => {
|
|
39506
38873
|
if (value === "") {
|
|
39507
38874
|
return true;
|
|
39508
38875
|
}
|
|
39509
|
-
|
|
39510
|
-
|
|
39511
|
-
|
|
39512
|
-
var inclusive = args[2] || false;
|
|
38876
|
+
const dateFormat = args[0];
|
|
38877
|
+
const unit = args[1];
|
|
38878
|
+
const inclusive = args[2] || false;
|
|
39513
38879
|
|
|
39514
38880
|
if (dateFormat == undefined || unit == undefined) {
|
|
39515
|
-
throw new Error(
|
|
38881
|
+
throw new Error(
|
|
38882
|
+
"Date format and unit need to be defined for dateAfterToday, one or both are undefined"
|
|
38883
|
+
);
|
|
39516
38884
|
}
|
|
39517
|
-
|
|
39518
|
-
|
|
39519
|
-
var dateValue = dayjs(value, dateFormat);
|
|
38885
|
+
const now = dayjs();
|
|
38886
|
+
const dateValue = dayjs(value, dateFormat);
|
|
39520
38887
|
|
|
39521
38888
|
if (inclusive === true) {
|
|
39522
38889
|
return dateValue.isSameOrAfter(now, unit);
|
|
39523
38890
|
}
|
|
39524
|
-
|
|
39525
38891
|
return dateValue.isAfter(now, unit);
|
|
39526
38892
|
};
|
|
39527
38893
|
|
|
39528
|
-
|
|
39529
|
-
|
|
39530
|
-
|
|
39531
|
-
|
|
39532
|
-
|
|
38894
|
+
const IS_VALID_MONTH = "validator/IS_VALID_MONTH";
|
|
38895
|
+
const IS_VALID_MONTH_ERROR = "error/IS_VALID_MONTH";
|
|
38896
|
+
const isValidMonth = createValidator(
|
|
38897
|
+
IS_VALID_MONTH,
|
|
38898
|
+
IS_VALID_MONTH_ERROR
|
|
38899
|
+
);
|
|
38900
|
+
validatorFns[IS_VALID_MONTH] = (value, args, form) => {
|
|
39533
38901
|
if (value === "") {
|
|
39534
38902
|
return true;
|
|
39535
|
-
}
|
|
38903
|
+
}
|
|
38904
|
+
// Function takes one argument representing the character position
|
|
39536
38905
|
// In a date string to identify where the month is
|
|
39537
38906
|
// Eg "10/21/2021" - start position is 0
|
|
39538
38907
|
// Or "18/03/1990" - start position is 3
|
|
39539
38908
|
// Only works with two digit months (01, 02, 03, etc)
|
|
39540
|
-
|
|
39541
|
-
|
|
39542
|
-
|
|
39543
|
-
var monthEndPosition = monthStartPosition + 2;
|
|
39544
|
-
|
|
39545
|
-
if (isNaN(monthStartPosition)) {
|
|
38909
|
+
const monthStartPosition = parseInt(args[0]);
|
|
38910
|
+
const monthEndPosition = monthStartPosition + 2;
|
|
38911
|
+
if (monthStartPosition === NaN) {
|
|
39546
38912
|
throw new Error("Month start position has to be a valid integer string");
|
|
39547
38913
|
}
|
|
39548
|
-
|
|
39549
|
-
|
|
39550
|
-
|
|
39551
|
-
if (isNaN(month)) {
|
|
38914
|
+
const month = parseInt(value.slice(monthStartPosition, monthEndPosition));
|
|
38915
|
+
if (month === NaN) {
|
|
39552
38916
|
return false;
|
|
39553
38917
|
}
|
|
39554
|
-
|
|
39555
38918
|
return month >= 1 && month <= 12;
|
|
39556
38919
|
};
|
|
39557
38920
|
|
|
39558
|
-
|
|
39559
|
-
|
|
39560
|
-
|
|
39561
|
-
|
|
39562
|
-
validatorFns[MATCHES_REGEX] = function (value, args, form) {
|
|
38921
|
+
const MATCHES_REGEX = "validator/MATCHES_REGEX";
|
|
38922
|
+
const MATCHES_REGEX_ERROR = "error/MATCHES_REGEX";
|
|
38923
|
+
const matchesRegex = createValidator(MATCHES_REGEX, MATCHES_REGEX_ERROR);
|
|
38924
|
+
validatorFns[MATCHES_REGEX] = (value, args, form) => {
|
|
39563
38925
|
if (value === "") {
|
|
39564
38926
|
return true;
|
|
39565
38927
|
}
|
|
39566
|
-
|
|
39567
38928
|
return new RegExp(args[0]).test(value); // new RexExp never throws an error, no matter the input
|
|
39568
|
-
};
|
|
39569
|
-
|
|
39570
|
-
|
|
39571
|
-
var IS_ROUTING_NUMBER = "validator/IS_ROUTING_NUMBER";
|
|
39572
|
-
var IS_ROUTING_NUMBER_ERROR = "error/IS_ROUTING_NUMBER";
|
|
39573
|
-
var isRoutingNumber = createValidator(IS_ROUTING_NUMBER, IS_ROUTING_NUMBER_ERROR);
|
|
38929
|
+
};
|
|
39574
38930
|
|
|
39575
|
-
|
|
38931
|
+
// based on http://www.brainjar.com/js/validation/
|
|
38932
|
+
const IS_ROUTING_NUMBER = "validator/IS_ROUTING_NUMBER";
|
|
38933
|
+
const IS_ROUTING_NUMBER_ERROR = "error/IS_ROUTING_NUMBER";
|
|
38934
|
+
const isRoutingNumber = createValidator(
|
|
38935
|
+
IS_ROUTING_NUMBER,
|
|
38936
|
+
IS_ROUTING_NUMBER_ERROR
|
|
38937
|
+
);
|
|
38938
|
+
validatorFns[IS_ROUTING_NUMBER] = (value, args, form) => {
|
|
39576
38939
|
if (value === "") {
|
|
39577
38940
|
return true;
|
|
39578
38941
|
}
|
|
39579
|
-
|
|
39580
38942
|
if (value.length != 9) {
|
|
39581
38943
|
return false;
|
|
39582
38944
|
}
|
|
39583
|
-
|
|
39584
|
-
|
|
39585
|
-
|
|
39586
|
-
|
|
39587
|
-
|
|
39588
|
-
|
|
39589
|
-
|
|
39590
|
-
|
|
39591
|
-
|
|
39592
|
-
|
|
39593
|
-
|
|
39594
|
-
|
|
39595
|
-
|
|
39596
|
-
}
|
|
39597
|
-
}, 0);
|
|
38945
|
+
const sum = value
|
|
38946
|
+
.split("")
|
|
38947
|
+
.map(ch => parseInt(ch))
|
|
38948
|
+
.reduce((acc, cur, idx) => {
|
|
38949
|
+
switch (idx % 3) {
|
|
38950
|
+
case 0:
|
|
38951
|
+
return acc + 3 * cur;
|
|
38952
|
+
case 1:
|
|
38953
|
+
return acc + 7 * cur;
|
|
38954
|
+
case 2:
|
|
38955
|
+
return acc + 1 * cur;
|
|
38956
|
+
}
|
|
38957
|
+
}, 0);
|
|
39598
38958
|
return sum != 0 && sum % 10 == 0;
|
|
39599
38959
|
};
|
|
39600
38960
|
|
|
39601
|
-
|
|
39602
|
-
|
|
39603
|
-
|
|
39604
|
-
|
|
39605
|
-
validatorFns[HAS_NUMBER] = function (value, args, form) {
|
|
38961
|
+
const HAS_NUMBER = "validator/HAS_NUMBER";
|
|
38962
|
+
const HAS_NUMBER_ERROR$1 = "error/HAS_NUMBER";
|
|
38963
|
+
const hasNumber = createValidator(HAS_NUMBER, HAS_NUMBER_ERROR$1);
|
|
38964
|
+
validatorFns[HAS_NUMBER] = (value, args, form) => {
|
|
39606
38965
|
if (value === "") {
|
|
39607
38966
|
return true;
|
|
39608
38967
|
}
|
|
39609
|
-
|
|
39610
38968
|
return new RegExp(/[0-9]/).test(value);
|
|
39611
38969
|
};
|
|
39612
38970
|
|
|
39613
|
-
|
|
39614
|
-
|
|
39615
|
-
|
|
39616
|
-
|
|
39617
|
-
|
|
38971
|
+
const HAS_LOWERCASE_LETTER = "validator/HAS_LOWERCASE_LETTER";
|
|
38972
|
+
const HAS_LOWERCASE_LETTER_ERROR$1 = "error/HAS_LOWERCASE_LETTER";
|
|
38973
|
+
const hasLowercaseLetter = createValidator(
|
|
38974
|
+
HAS_LOWERCASE_LETTER,
|
|
38975
|
+
HAS_LOWERCASE_LETTER_ERROR$1
|
|
38976
|
+
);
|
|
38977
|
+
validatorFns[HAS_LOWERCASE_LETTER] = (value, args, form) => {
|
|
39618
38978
|
if (value === "") {
|
|
39619
38979
|
return true;
|
|
39620
38980
|
}
|
|
39621
|
-
|
|
39622
38981
|
return new RegExp(/[a-z]/).test(value);
|
|
39623
38982
|
};
|
|
39624
38983
|
|
|
39625
|
-
|
|
39626
|
-
|
|
39627
|
-
|
|
39628
|
-
|
|
39629
|
-
|
|
38984
|
+
const HAS_UPPERCASE_LETTER = "validator/HAS_UPPERCASE_LETTER";
|
|
38985
|
+
const HAS_UPPERCASE_LETTER_ERROR$1 = "error/HAS_UPPERCASE_LETTER";
|
|
38986
|
+
const hasUppercaseLetter = createValidator(
|
|
38987
|
+
HAS_UPPERCASE_LETTER,
|
|
38988
|
+
HAS_UPPERCASE_LETTER_ERROR$1
|
|
38989
|
+
);
|
|
38990
|
+
validatorFns[HAS_UPPERCASE_LETTER] = (value, args, form) => {
|
|
39630
38991
|
if (value === "") {
|
|
39631
38992
|
return true;
|
|
39632
38993
|
}
|
|
39633
|
-
|
|
39634
38994
|
return new RegExp(/[A-Z]/).test(value);
|
|
39635
38995
|
};
|
|
39636
38996
|
|
|
39637
|
-
|
|
39638
|
-
|
|
39639
|
-
|
|
39640
|
-
|
|
39641
|
-
|
|
38997
|
+
const HAS_SPECIAL_CHARACTER = "validator/HAS_SPECIAL_CHARACTER";
|
|
38998
|
+
const HAS_SPECIAL_CHARACTER_ERROR$1 = "error/HAS_SPECIAL_CHARACTER";
|
|
38999
|
+
const hasSpecialCharacter = createValidator(
|
|
39000
|
+
HAS_SPECIAL_CHARACTER,
|
|
39001
|
+
HAS_SPECIAL_CHARACTER_ERROR$1
|
|
39002
|
+
);
|
|
39003
|
+
validatorFns[HAS_SPECIAL_CHARACTER] = (value, args, form) => {
|
|
39642
39004
|
if (value === "") {
|
|
39643
39005
|
return true;
|
|
39644
39006
|
}
|
|
39645
|
-
|
|
39646
39007
|
return new RegExp(/[!@#$%^&*.?]/).test(value);
|
|
39647
39008
|
};
|
|
39648
39009
|
|
|
39649
|
-
|
|
39650
|
-
|
|
39651
|
-
|
|
39652
|
-
|
|
39653
|
-
|
|
39010
|
+
const IS_PROBABLY_EMAIL = "validator/IS_PROBABLY_EMAIL";
|
|
39011
|
+
const IS_PROBABLY_EMAIL_ERROR = "error/IS_PROBABLY_EMAIL";
|
|
39012
|
+
const isProbablyEmail = createValidator(
|
|
39013
|
+
IS_PROBABLY_EMAIL,
|
|
39014
|
+
IS_PROBABLY_EMAIL_ERROR
|
|
39015
|
+
);
|
|
39016
|
+
validatorFns[IS_PROBABLY_EMAIL] = (value, args, form) => {
|
|
39654
39017
|
if (value === "") {
|
|
39655
39018
|
return true;
|
|
39656
39019
|
}
|
|
39657
|
-
|
|
39658
39020
|
return new RegExp(/^\S+@\S+\.\S+$/).test(value);
|
|
39659
39021
|
};
|
|
39660
39022
|
|
|
39661
|
-
|
|
39662
|
-
|
|
39663
|
-
|
|
39664
|
-
|
|
39665
|
-
|
|
39666
|
-
|
|
39023
|
+
const runValidatorErrorMessage = type =>
|
|
39024
|
+
`${type} was passed to runValidator, but that validator type does not exist.
|
|
39025
|
+
Please check that you are only calling validator creator functions exported from
|
|
39026
|
+
redux-freeform in your form config and that you didn't forget to
|
|
39027
|
+
invoke the validator creator (you cannot pass the functions themselves to
|
|
39028
|
+
createFormState)`;
|
|
39667
39029
|
|
|
39030
|
+
const runValidator = (validator, value, form) => {
|
|
39031
|
+
const validatorFn = validatorFns[validator.type];
|
|
39668
39032
|
if (validatorFn === undefined) {
|
|
39669
39033
|
throw new Error(runValidatorErrorMessage(validator.type));
|
|
39670
39034
|
}
|
|
39671
|
-
|
|
39672
39035
|
return validatorFn(value, validator.args, form) ? null : validator.error;
|
|
39673
39036
|
};
|
|
39674
39037
|
|
|
39675
|
-
|
|
39676
|
-
return validators
|
|
39677
|
-
|
|
39678
|
-
|
|
39679
|
-
return x !== null;
|
|
39680
|
-
});
|
|
39681
|
-
};
|
|
39682
|
-
|
|
39683
|
-
var computeConstraints = function computeConstraints(fieldName, form) {
|
|
39684
|
-
var constraints = form[fieldName].constraints;
|
|
39685
|
-
return runFormValidators(fieldName, form, constraints);
|
|
39686
|
-
};
|
|
39687
|
-
|
|
39688
|
-
var computeErrors = function computeErrors(fieldName, form) {
|
|
39689
|
-
var validators = form[fieldName].validators;
|
|
39690
|
-
return runFormValidators(fieldName, form, validators);
|
|
39038
|
+
const _computeErrors = (fieldName, form, validators) => {
|
|
39039
|
+
return validators
|
|
39040
|
+
.map(v => runValidator(v, form[fieldName].rawValue, form))
|
|
39041
|
+
.filter(x => x !== null);
|
|
39691
39042
|
};
|
|
39692
39043
|
|
|
39693
|
-
|
|
39694
|
-
|
|
39695
|
-
|
|
39696
|
-
for (var _i = 0, _fields = fields; _i < _fields.length; _i++) {
|
|
39697
|
-
var entry = _fields[_i];
|
|
39698
|
-
var fieldName = entry[0];
|
|
39699
|
-
var errors = computeErrors(fieldName, formState);
|
|
39700
|
-
formState[fieldName].errors = errors;
|
|
39701
|
-
formState[fieldName].hasErrors = errors.length > 0;
|
|
39702
|
-
}
|
|
39044
|
+
const computeConstraints = (fieldName, form) => {
|
|
39045
|
+
const constraints = form[fieldName].constraints;
|
|
39046
|
+
return _computeErrors(fieldName, form, constraints);
|
|
39703
39047
|
};
|
|
39704
39048
|
|
|
39705
|
-
|
|
39706
|
-
|
|
39707
|
-
|
|
39708
|
-
for (var _i2 = 0, _fields2 = fields; _i2 < _fields2.length; _i2++) {
|
|
39709
|
-
var entry = _fields2[_i2];
|
|
39710
|
-
var fieldName = entry[0];
|
|
39711
|
-
var field = entry[1];
|
|
39712
|
-
var dirty = fieldName === changedFieldName ? true : field.dirty;
|
|
39713
|
-
formState[fieldName].dirty = dirty;
|
|
39714
|
-
}
|
|
39049
|
+
const computeErrors = (fieldName, form) => {
|
|
39050
|
+
const validators = form[fieldName].validators;
|
|
39051
|
+
return _computeErrors(fieldName, form, validators);
|
|
39715
39052
|
};
|
|
39716
39053
|
|
|
39717
39054
|
var obj;
|
|
39718
|
-
var NOTHING = typeof Symbol !== "undefined" ? Symbol("immer-nothing") : (obj = {}, obj["immer-nothing"] = true, obj);
|
|
39719
|
-
var DRAFTABLE = typeof Symbol !== "undefined" && Symbol
|
|
39720
|
-
var DRAFT_STATE = typeof Symbol !== "undefined" && Symbol
|
|
39721
|
-
|
|
39055
|
+
var NOTHING = typeof Symbol !== "undefined" ? Symbol("immer-nothing") : ( obj = {}, obj["immer-nothing"] = true, obj );
|
|
39056
|
+
var DRAFTABLE = typeof Symbol !== "undefined" && Symbol.for ? Symbol.for("immer-draftable") : "__$immer_draftable";
|
|
39057
|
+
var DRAFT_STATE = typeof Symbol !== "undefined" && Symbol.for ? Symbol.for("immer-state") : "__$immer_state";
|
|
39722
39058
|
function isDraft(value) {
|
|
39723
39059
|
return !!value && !!value[DRAFT_STATE];
|
|
39724
39060
|
}
|
|
39725
|
-
|
|
39726
39061
|
function isDraftable(value) {
|
|
39727
|
-
if (!value) {
|
|
39728
|
-
return false;
|
|
39729
|
-
}
|
|
39730
|
-
|
|
39062
|
+
if (!value) { return false; }
|
|
39731
39063
|
return isPlainObject(value) || !!value[DRAFTABLE] || !!value.constructor[DRAFTABLE];
|
|
39732
39064
|
}
|
|
39733
|
-
|
|
39734
39065
|
function isPlainObject(value) {
|
|
39735
|
-
if (!value ||
|
|
39736
|
-
|
|
39737
|
-
}
|
|
39738
|
-
|
|
39739
|
-
if (Array.isArray(value)) {
|
|
39740
|
-
return true;
|
|
39741
|
-
}
|
|
39742
|
-
|
|
39066
|
+
if (!value || typeof value !== "object") { return false; }
|
|
39067
|
+
if (Array.isArray(value)) { return true; }
|
|
39743
39068
|
var proto = Object.getPrototypeOf(value);
|
|
39744
39069
|
return !proto || proto === Object.prototype;
|
|
39745
39070
|
}
|
|
39746
|
-
|
|
39747
39071
|
var assign = Object.assign || function assign(target, value) {
|
|
39748
39072
|
for (var key in value) {
|
|
39749
39073
|
if (has$1(value, key)) {
|
|
@@ -39753,18 +39077,11 @@ var assign = Object.assign || function assign(target, value) {
|
|
|
39753
39077
|
|
|
39754
39078
|
return target;
|
|
39755
39079
|
};
|
|
39756
|
-
|
|
39757
|
-
var ownKeys$2 = typeof Reflect !== "undefined" && Reflect.ownKeys ? Reflect.ownKeys : typeof Object.getOwnPropertySymbols !== "undefined" ? function (obj) {
|
|
39758
|
-
return Object.getOwnPropertyNames(obj).concat(Object.getOwnPropertySymbols(obj));
|
|
39759
|
-
} : Object.getOwnPropertyNames;
|
|
39760
|
-
|
|
39080
|
+
var ownKeys$2 = typeof Reflect !== "undefined" && Reflect.ownKeys ? Reflect.ownKeys : typeof Object.getOwnPropertySymbols !== "undefined" ? function (obj) { return Object.getOwnPropertyNames(obj).concat(Object.getOwnPropertySymbols(obj)); } : Object.getOwnPropertyNames;
|
|
39761
39081
|
function shallowCopy(base, invokeGetters) {
|
|
39762
|
-
if (invokeGetters === void 0) invokeGetters = false;
|
|
39763
|
-
|
|
39764
|
-
if (Array.isArray(base)) {
|
|
39765
|
-
return base.slice();
|
|
39766
|
-
}
|
|
39082
|
+
if ( invokeGetters === void 0 ) invokeGetters = false;
|
|
39767
39083
|
|
|
39084
|
+
if (Array.isArray(base)) { return base.slice(); }
|
|
39768
39085
|
var clone = Object.create(Object.getPrototypeOf(base));
|
|
39769
39086
|
ownKeys$2(base).forEach(function (key) {
|
|
39770
39087
|
if (key === DRAFT_STATE) {
|
|
@@ -39794,28 +39111,20 @@ function shallowCopy(base, invokeGetters) {
|
|
|
39794
39111
|
});
|
|
39795
39112
|
return clone;
|
|
39796
39113
|
}
|
|
39797
|
-
|
|
39798
39114
|
function each(value, cb) {
|
|
39799
39115
|
if (Array.isArray(value)) {
|
|
39800
|
-
for (var i = 0; i < value.length; i++) {
|
|
39801
|
-
cb(i, value[i], value);
|
|
39802
|
-
}
|
|
39116
|
+
for (var i = 0; i < value.length; i++) { cb(i, value[i], value); }
|
|
39803
39117
|
} else {
|
|
39804
|
-
ownKeys$2(value).forEach(function (key) {
|
|
39805
|
-
return cb(key, value[key], value);
|
|
39806
|
-
});
|
|
39118
|
+
ownKeys$2(value).forEach(function (key) { return cb(key, value[key], value); });
|
|
39807
39119
|
}
|
|
39808
39120
|
}
|
|
39809
|
-
|
|
39810
39121
|
function isEnumerable(base, prop) {
|
|
39811
39122
|
var desc = Object.getOwnPropertyDescriptor(base, prop);
|
|
39812
39123
|
return !!desc && desc.enumerable;
|
|
39813
39124
|
}
|
|
39814
|
-
|
|
39815
39125
|
function has$1(thing, prop) {
|
|
39816
39126
|
return Object.prototype.hasOwnProperty.call(thing, prop);
|
|
39817
39127
|
}
|
|
39818
|
-
|
|
39819
39128
|
function is(x, y) {
|
|
39820
39129
|
// From: https://github.com/facebook/fbjs/blob/c69904a511b900266935168223063dd8772dfc40/packages/fbjs/src/core/shallowEqual.js
|
|
39821
39130
|
if (x === y) {
|
|
@@ -39824,26 +39133,17 @@ function is(x, y) {
|
|
|
39824
39133
|
return x !== x && y !== y;
|
|
39825
39134
|
}
|
|
39826
39135
|
}
|
|
39827
|
-
|
|
39828
39136
|
function clone(obj) {
|
|
39829
|
-
if (!isDraftable(obj)) {
|
|
39830
|
-
|
|
39831
|
-
}
|
|
39832
|
-
|
|
39833
|
-
if (Array.isArray(obj)) {
|
|
39834
|
-
return obj.map(clone);
|
|
39835
|
-
}
|
|
39836
|
-
|
|
39137
|
+
if (!isDraftable(obj)) { return obj; }
|
|
39138
|
+
if (Array.isArray(obj)) { return obj.map(clone); }
|
|
39837
39139
|
var cloned = Object.create(Object.getPrototypeOf(obj));
|
|
39838
39140
|
|
|
39839
|
-
for (var key in obj) {
|
|
39840
|
-
cloned[key] = clone(obj[key]);
|
|
39841
|
-
}
|
|
39141
|
+
for (var key in obj) { cloned[key] = clone(obj[key]); }
|
|
39842
39142
|
|
|
39843
39143
|
return cloned;
|
|
39844
39144
|
}
|
|
39845
|
-
/** Each scope represents a `produce` call. */
|
|
39846
39145
|
|
|
39146
|
+
/** Each scope represents a `produce` call. */
|
|
39847
39147
|
|
|
39848
39148
|
var ImmerScope = function ImmerScope(parent) {
|
|
39849
39149
|
this.drafts = [];
|
|
@@ -39855,7 +39155,7 @@ var ImmerScope = function ImmerScope(parent) {
|
|
|
39855
39155
|
this.patches = null;
|
|
39856
39156
|
};
|
|
39857
39157
|
|
|
39858
|
-
ImmerScope.prototype.usePatches = function usePatches(patchListener) {
|
|
39158
|
+
ImmerScope.prototype.usePatches = function usePatches (patchListener) {
|
|
39859
39159
|
if (patchListener) {
|
|
39860
39160
|
this.patches = [];
|
|
39861
39161
|
this.inversePatches = [];
|
|
@@ -39863,18 +39163,17 @@ ImmerScope.prototype.usePatches = function usePatches(patchListener) {
|
|
|
39863
39163
|
}
|
|
39864
39164
|
};
|
|
39865
39165
|
|
|
39866
|
-
ImmerScope.prototype.revoke = function revoke$1() {
|
|
39166
|
+
ImmerScope.prototype.revoke = function revoke$1 () {
|
|
39867
39167
|
this.leave();
|
|
39868
39168
|
this.drafts.forEach(revoke);
|
|
39869
39169
|
this.drafts = null; // Make draft-related methods throw.
|
|
39870
39170
|
};
|
|
39871
39171
|
|
|
39872
|
-
ImmerScope.prototype.leave = function leave() {
|
|
39172
|
+
ImmerScope.prototype.leave = function leave () {
|
|
39873
39173
|
if (this === ImmerScope.current) {
|
|
39874
39174
|
ImmerScope.current = this.parent;
|
|
39875
39175
|
}
|
|
39876
39176
|
};
|
|
39877
|
-
|
|
39878
39177
|
ImmerScope.current = null;
|
|
39879
39178
|
|
|
39880
39179
|
ImmerScope.enter = function () {
|
|
@@ -39883,11 +39182,11 @@ ImmerScope.enter = function () {
|
|
|
39883
39182
|
|
|
39884
39183
|
function revoke(draft) {
|
|
39885
39184
|
draft[DRAFT_STATE].revoke();
|
|
39886
|
-
}
|
|
39185
|
+
}
|
|
39887
39186
|
|
|
39187
|
+
// but share them all instead
|
|
39888
39188
|
|
|
39889
39189
|
var descriptors$1 = {};
|
|
39890
|
-
|
|
39891
39190
|
function willFinalize(scope, result, isReplaced) {
|
|
39892
39191
|
scope.drafts.forEach(function (draft) {
|
|
39893
39192
|
draft[DRAFT_STATE].finalizing = true;
|
|
@@ -39902,10 +39201,9 @@ function willFinalize(scope, result, isReplaced) {
|
|
|
39902
39201
|
markChangesSweep(scope.drafts);
|
|
39903
39202
|
} // When a child draft is returned, look for changes.
|
|
39904
39203
|
else if (isDraft(result) && result[DRAFT_STATE].scope === scope) {
|
|
39905
|
-
|
|
39906
|
-
|
|
39204
|
+
markChangesSweep(scope.drafts);
|
|
39205
|
+
}
|
|
39907
39206
|
}
|
|
39908
|
-
|
|
39909
39207
|
function createProxy(base, parent) {
|
|
39910
39208
|
var isArray = Array.isArray(base);
|
|
39911
39209
|
var draft = clonePotentialDraft(base);
|
|
@@ -39959,11 +39257,7 @@ function peek(draft, prop) {
|
|
|
39959
39257
|
function get$1(state, prop) {
|
|
39960
39258
|
assertUnrevoked(state);
|
|
39961
39259
|
var value = peek(source(state), prop);
|
|
39962
|
-
|
|
39963
|
-
if (state.finalizing) {
|
|
39964
|
-
return value;
|
|
39965
|
-
} // Create a draft if the value is unmodified.
|
|
39966
|
-
|
|
39260
|
+
if (state.finalizing) { return value; } // Create a draft if the value is unmodified.
|
|
39967
39261
|
|
|
39968
39262
|
if (value === peek(state.base, prop) && isDraftable(value)) {
|
|
39969
39263
|
prepareCopy(state);
|
|
@@ -39978,10 +39272,7 @@ function set$1(state, prop, value) {
|
|
|
39978
39272
|
state.assigned[prop] = true;
|
|
39979
39273
|
|
|
39980
39274
|
if (!state.modified) {
|
|
39981
|
-
if (is(value, peek(source(state), prop))) {
|
|
39982
|
-
return;
|
|
39983
|
-
}
|
|
39984
|
-
|
|
39275
|
+
if (is(value, peek(source(state), prop))) { return; }
|
|
39985
39276
|
markChanged(state);
|
|
39986
39277
|
prepareCopy(state);
|
|
39987
39278
|
}
|
|
@@ -39992,17 +39283,12 @@ function set$1(state, prop, value) {
|
|
|
39992
39283
|
function markChanged(state) {
|
|
39993
39284
|
if (!state.modified) {
|
|
39994
39285
|
state.modified = true;
|
|
39995
|
-
|
|
39996
|
-
if (state.parent) {
|
|
39997
|
-
markChanged(state.parent);
|
|
39998
|
-
}
|
|
39286
|
+
if (state.parent) { markChanged(state.parent); }
|
|
39999
39287
|
}
|
|
40000
39288
|
}
|
|
40001
39289
|
|
|
40002
39290
|
function prepareCopy(state) {
|
|
40003
|
-
if (!state.copy) {
|
|
40004
|
-
state.copy = clonePotentialDraft(state.base);
|
|
40005
|
-
}
|
|
39291
|
+
if (!state.copy) { state.copy = clonePotentialDraft(state.base); }
|
|
40006
39292
|
}
|
|
40007
39293
|
|
|
40008
39294
|
function clonePotentialDraft(base) {
|
|
@@ -40027,12 +39313,15 @@ function proxyProperty(draft, prop, enumerable) {
|
|
|
40027
39313
|
descriptors$1[prop] = desc = {
|
|
40028
39314
|
configurable: true,
|
|
40029
39315
|
enumerable: enumerable,
|
|
39316
|
+
|
|
40030
39317
|
get: function get$1$1() {
|
|
40031
39318
|
return get$1(this[DRAFT_STATE], prop);
|
|
40032
39319
|
},
|
|
39320
|
+
|
|
40033
39321
|
set: function set$1$1(value) {
|
|
40034
39322
|
set$1(this[DRAFT_STATE], prop, value);
|
|
40035
39323
|
}
|
|
39324
|
+
|
|
40036
39325
|
};
|
|
40037
39326
|
}
|
|
40038
39327
|
|
|
@@ -40040,9 +39329,7 @@ function proxyProperty(draft, prop, enumerable) {
|
|
|
40040
39329
|
}
|
|
40041
39330
|
|
|
40042
39331
|
function assertUnrevoked(state) {
|
|
40043
|
-
if (state.revoked === true) {
|
|
40044
|
-
throw new Error("Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? " + JSON.stringify(source(state)));
|
|
40045
|
-
}
|
|
39332
|
+
if (state.revoked === true) { 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))); }
|
|
40046
39333
|
} // This looks expensive, but only proxies are visited, and only objects without known changes are scanned.
|
|
40047
39334
|
|
|
40048
39335
|
|
|
@@ -40056,27 +39343,16 @@ function markChangesSweep(drafts) {
|
|
|
40056
39343
|
|
|
40057
39344
|
if (!state.modified) {
|
|
40058
39345
|
if (Array.isArray(state.base)) {
|
|
40059
|
-
if (hasArrayChanges(state)) {
|
|
40060
|
-
|
|
40061
|
-
}
|
|
40062
|
-
} else if (hasObjectChanges(state)) {
|
|
40063
|
-
markChanged(state);
|
|
40064
|
-
}
|
|
39346
|
+
if (hasArrayChanges(state)) { markChanged(state); }
|
|
39347
|
+
} else if (hasObjectChanges(state)) { markChanged(state); }
|
|
40065
39348
|
}
|
|
40066
39349
|
}
|
|
40067
39350
|
}
|
|
40068
39351
|
|
|
40069
39352
|
function markChangesRecursively(object) {
|
|
40070
|
-
if (!object ||
|
|
40071
|
-
return;
|
|
40072
|
-
}
|
|
40073
|
-
|
|
39353
|
+
if (!object || typeof object !== "object") { return; }
|
|
40074
39354
|
var state = object[DRAFT_STATE];
|
|
40075
|
-
|
|
40076
|
-
if (!state) {
|
|
40077
|
-
return;
|
|
40078
|
-
}
|
|
40079
|
-
|
|
39355
|
+
if (!state) { return; }
|
|
40080
39356
|
var base = state.base;
|
|
40081
39357
|
var draft = state.draft;
|
|
40082
39358
|
var assigned = state.assigned;
|
|
@@ -40106,20 +39382,14 @@ function markChangesRecursively(object) {
|
|
|
40106
39382
|
assigned.length = true;
|
|
40107
39383
|
|
|
40108
39384
|
if (draft.length < base.length) {
|
|
40109
|
-
for (var i = draft.length; i < base.length; i++) {
|
|
40110
|
-
assigned[i] = false;
|
|
40111
|
-
}
|
|
39385
|
+
for (var i = draft.length; i < base.length; i++) { assigned[i] = false; }
|
|
40112
39386
|
} else {
|
|
40113
|
-
for (var i$1 = base.length; i$1 < draft.length; i$1++) {
|
|
40114
|
-
assigned[i$1] = true;
|
|
40115
|
-
}
|
|
39387
|
+
for (var i$1 = base.length; i$1 < draft.length; i$1++) { assigned[i$1] = true; }
|
|
40116
39388
|
}
|
|
40117
39389
|
|
|
40118
39390
|
for (var i$2 = 0; i$2 < draft.length; i$2++) {
|
|
40119
39391
|
// Only untouched indices trigger recursion.
|
|
40120
|
-
if (assigned[i$2] === undefined) {
|
|
40121
|
-
markChangesRecursively(draft[i$2]);
|
|
40122
|
-
}
|
|
39392
|
+
if (assigned[i$2] === undefined) { markChangesRecursively(draft[i$2]); }
|
|
40123
39393
|
}
|
|
40124
39394
|
}
|
|
40125
39395
|
}
|
|
@@ -40140,13 +39410,13 @@ function hasObjectChanges(state) {
|
|
|
40140
39410
|
} // Once a base key is deleted, future changes go undetected, because its
|
|
40141
39411
|
// descriptor is erased. This branch detects any missed changes.
|
|
40142
39412
|
else {
|
|
40143
|
-
|
|
40144
|
-
|
|
39413
|
+
var value = draft[key];
|
|
39414
|
+
var state$1 = value && value[DRAFT_STATE];
|
|
40145
39415
|
|
|
40146
|
-
|
|
40147
|
-
|
|
39416
|
+
if (state$1 ? state$1.base !== baseValue : !is(value, baseValue)) {
|
|
39417
|
+
return true;
|
|
39418
|
+
}
|
|
40148
39419
|
}
|
|
40149
|
-
}
|
|
40150
39420
|
} // At this point, no keys were added or changed.
|
|
40151
39421
|
// Compare key count to determine if keys were deleted.
|
|
40152
39422
|
|
|
@@ -40156,10 +39426,7 @@ function hasObjectChanges(state) {
|
|
|
40156
39426
|
|
|
40157
39427
|
function hasArrayChanges(state) {
|
|
40158
39428
|
var draft = state.draft;
|
|
40159
|
-
|
|
40160
|
-
if (draft.length !== state.base.length) {
|
|
40161
|
-
return true;
|
|
40162
|
-
} // See #116
|
|
39429
|
+
if (draft.length !== state.base.length) { return true; } // See #116
|
|
40163
39430
|
// If we first shorten the length, our array interceptors will be removed.
|
|
40164
39431
|
// If after that new items are added, result in the same original length,
|
|
40165
39432
|
// those last items will have no intercepting property.
|
|
@@ -40167,13 +39434,9 @@ function hasArrayChanges(state) {
|
|
|
40167
39434
|
// N.B.: splice, unshift, etc only shift values around, but not prop descriptors, so we only have to check
|
|
40168
39435
|
// the last one
|
|
40169
39436
|
|
|
40170
|
-
|
|
40171
39437
|
var descriptor = Object.getOwnPropertyDescriptor(draft, draft.length - 1); // descriptor can be null, but only for newly created sparse arrays, eg. new Array(10)
|
|
40172
39438
|
|
|
40173
|
-
if (descriptor && !descriptor.get) {
|
|
40174
|
-
return true;
|
|
40175
|
-
} // For all other cases, we don't have to compare, as they would have been picked up by the index setters
|
|
40176
|
-
|
|
39439
|
+
if (descriptor && !descriptor.get) { return true; } // For all other cases, we don't have to compare, as they would have been picked up by the index setters
|
|
40177
39440
|
|
|
40178
39441
|
return false;
|
|
40179
39442
|
}
|
|
@@ -40187,12 +39450,11 @@ function createHiddenProperty(target, prop, value) {
|
|
|
40187
39450
|
}
|
|
40188
39451
|
|
|
40189
39452
|
var legacyProxy = /*#__PURE__*/Object.freeze({
|
|
40190
|
-
|
|
40191
|
-
|
|
39453
|
+
willFinalize: willFinalize,
|
|
39454
|
+
createProxy: createProxy
|
|
40192
39455
|
});
|
|
40193
39456
|
|
|
40194
39457
|
function willFinalize$1() {}
|
|
40195
|
-
|
|
40196
39458
|
function createProxy$1(base, parent) {
|
|
40197
39459
|
var scope = parent ? parent.scope : ImmerScope.current;
|
|
40198
39460
|
var state = {
|
|
@@ -40227,27 +39489,33 @@ function createProxy$1(base, parent) {
|
|
|
40227
39489
|
scope.drafts.push(proxy);
|
|
40228
39490
|
return proxy;
|
|
40229
39491
|
}
|
|
40230
|
-
|
|
40231
39492
|
var objectTraps = {
|
|
40232
39493
|
get: get$1$1,
|
|
39494
|
+
|
|
40233
39495
|
has: function has(target, prop) {
|
|
40234
39496
|
return prop in source$1(target);
|
|
40235
39497
|
},
|
|
39498
|
+
|
|
40236
39499
|
ownKeys: function ownKeys(target) {
|
|
40237
39500
|
return Reflect.ownKeys(source$1(target));
|
|
40238
39501
|
},
|
|
39502
|
+
|
|
40239
39503
|
set: set$1$1,
|
|
40240
39504
|
deleteProperty: deleteProperty,
|
|
40241
39505
|
getOwnPropertyDescriptor: getOwnPropertyDescriptor$2,
|
|
39506
|
+
|
|
40242
39507
|
defineProperty: function defineProperty() {
|
|
40243
39508
|
throw new Error("Object.defineProperty() cannot be used on an Immer draft"); // prettier-ignore
|
|
40244
39509
|
},
|
|
39510
|
+
|
|
40245
39511
|
getPrototypeOf: function getPrototypeOf(target) {
|
|
40246
39512
|
return Object.getPrototypeOf(target.base);
|
|
40247
39513
|
},
|
|
39514
|
+
|
|
40248
39515
|
setPrototypeOf: function setPrototypeOf() {
|
|
40249
39516
|
throw new Error("Object.setPrototypeOf() cannot be used on an Immer draft"); // prettier-ignore
|
|
40250
39517
|
}
|
|
39518
|
+
|
|
40251
39519
|
};
|
|
40252
39520
|
var arrayTraps = {};
|
|
40253
39521
|
each(objectTraps, function (key, fn) {
|
|
@@ -40286,10 +39554,7 @@ function peek$1(draft, prop) {
|
|
|
40286
39554
|
}
|
|
40287
39555
|
|
|
40288
39556
|
function get$1$1(state, prop) {
|
|
40289
|
-
if (prop === DRAFT_STATE) {
|
|
40290
|
-
return state;
|
|
40291
|
-
}
|
|
40292
|
-
|
|
39557
|
+
if (prop === DRAFT_STATE) { return state; }
|
|
40293
39558
|
var drafts = state.drafts; // Check for existing draft in unmodified state.
|
|
40294
39559
|
|
|
40295
39560
|
if (!state.modified && has$1(drafts, prop)) {
|
|
@@ -40305,10 +39570,7 @@ function get$1$1(state, prop) {
|
|
|
40305
39570
|
|
|
40306
39571
|
if (state.modified) {
|
|
40307
39572
|
// Assigned values are never drafted. This catches any drafts we created, too.
|
|
40308
|
-
if (value !== peek$1(state.base, prop)) {
|
|
40309
|
-
return value;
|
|
40310
|
-
} // Store drafts on the copy (when one exists).
|
|
40311
|
-
|
|
39573
|
+
if (value !== peek$1(state.base, prop)) { return value; } // Store drafts on the copy (when one exists).
|
|
40312
39574
|
|
|
40313
39575
|
drafts = state.copy;
|
|
40314
39576
|
}
|
|
@@ -40323,11 +39585,7 @@ function set$1$1(state, prop, value) {
|
|
|
40323
39585
|
// values may be drafts, but falsy values are never drafts.
|
|
40324
39586
|
|
|
40325
39587
|
var isUnchanged = value ? is(baseValue, value) || value === state.drafts[prop] : is(baseValue, value) && prop in state.base;
|
|
40326
|
-
|
|
40327
|
-
if (isUnchanged) {
|
|
40328
|
-
return true;
|
|
40329
|
-
}
|
|
40330
|
-
|
|
39588
|
+
if (isUnchanged) { return true; }
|
|
40331
39589
|
markChanged$1(state);
|
|
40332
39590
|
}
|
|
40333
39591
|
|
|
@@ -40346,10 +39604,7 @@ function deleteProperty(state, prop) {
|
|
|
40346
39604
|
delete state.assigned[prop];
|
|
40347
39605
|
}
|
|
40348
39606
|
|
|
40349
|
-
if (state.copy) {
|
|
40350
|
-
delete state.copy[prop];
|
|
40351
|
-
}
|
|
40352
|
-
|
|
39607
|
+
if (state.copy) { delete state.copy[prop]; }
|
|
40353
39608
|
return true;
|
|
40354
39609
|
} // Note: We never coerce `desc.value` into an Immer draft, because we can't make
|
|
40355
39610
|
// the same guarantee in ES5 mode.
|
|
@@ -40372,16 +39627,13 @@ function markChanged$1(state) {
|
|
|
40372
39627
|
state.modified = true;
|
|
40373
39628
|
state.copy = assign(shallowCopy(state.base), state.drafts);
|
|
40374
39629
|
state.drafts = null;
|
|
40375
|
-
|
|
40376
|
-
if (state.parent) {
|
|
40377
|
-
markChanged$1(state.parent);
|
|
40378
|
-
}
|
|
39630
|
+
if (state.parent) { markChanged$1(state.parent); }
|
|
40379
39631
|
}
|
|
40380
39632
|
}
|
|
40381
39633
|
|
|
40382
39634
|
var modernProxy = /*#__PURE__*/Object.freeze({
|
|
40383
|
-
|
|
40384
|
-
|
|
39635
|
+
willFinalize: willFinalize$1,
|
|
39636
|
+
createProxy: createProxy$1
|
|
40385
39637
|
});
|
|
40386
39638
|
|
|
40387
39639
|
function generatePatches(state, basePath, patches, inversePatches) {
|
|
@@ -40390,13 +39642,14 @@ function generatePatches(state, basePath, patches, inversePatches) {
|
|
|
40390
39642
|
|
|
40391
39643
|
function generateArrayPatches(state, basePath, patches, inversePatches) {
|
|
40392
39644
|
var assign, assign$1;
|
|
39645
|
+
|
|
40393
39646
|
var base = state.base;
|
|
40394
39647
|
var copy = state.copy;
|
|
40395
39648
|
var assigned = state.assigned; // Reduce complexity by ensuring `base` is never longer.
|
|
40396
39649
|
|
|
40397
39650
|
if (copy.length < base.length) {
|
|
40398
|
-
assign = [copy, base], base = assign[0], copy = assign[1];
|
|
40399
|
-
assign$1 = [inversePatches, patches], patches = assign$1[0], inversePatches = assign$1[1];
|
|
39651
|
+
(assign = [copy, base], base = assign[0], copy = assign[1]);
|
|
39652
|
+
(assign$1 = [inversePatches, patches], patches = assign$1[0], inversePatches = assign$1[1]);
|
|
40400
39653
|
}
|
|
40401
39654
|
|
|
40402
39655
|
var delta = copy.length - base.length; // Find the first replaced index.
|
|
@@ -40454,11 +39707,7 @@ function generateObjectPatches(state, basePath, patches, inversePatches) {
|
|
|
40454
39707
|
var origValue = base[key];
|
|
40455
39708
|
var value = copy[key];
|
|
40456
39709
|
var op = !assignedValue ? "remove" : key in base ? "replace" : "add";
|
|
40457
|
-
|
|
40458
|
-
if (origValue === value && op === "replace") {
|
|
40459
|
-
return;
|
|
40460
|
-
}
|
|
40461
|
-
|
|
39710
|
+
if (origValue === value && op === "replace") { return; }
|
|
40462
39711
|
var path = basePath.concat(key);
|
|
40463
39712
|
patches.push(op === "remove" ? {
|
|
40464
39713
|
op: op,
|
|
@@ -40483,26 +39732,20 @@ function generateObjectPatches(state, basePath, patches, inversePatches) {
|
|
|
40483
39732
|
});
|
|
40484
39733
|
}
|
|
40485
39734
|
|
|
40486
|
-
var applyPatches = function
|
|
39735
|
+
var applyPatches = function (draft, patches) {
|
|
40487
39736
|
for (var i$1 = 0, list = patches; i$1 < list.length; i$1 += 1) {
|
|
40488
39737
|
var patch = list[i$1];
|
|
39738
|
+
|
|
40489
39739
|
var path = patch.path;
|
|
40490
39740
|
var op = patch.op;
|
|
40491
39741
|
var value = clone(patch.value); // used to clone patch to ensure original patch is not modified, see #411
|
|
40492
39742
|
|
|
40493
|
-
if (!path.length) {
|
|
40494
|
-
throw new Error("Illegal state");
|
|
40495
|
-
}
|
|
40496
|
-
|
|
39743
|
+
if (!path.length) { throw new Error("Illegal state"); }
|
|
40497
39744
|
var base = draft;
|
|
40498
39745
|
|
|
40499
39746
|
for (var i = 0; i < path.length - 1; i++) {
|
|
40500
39747
|
base = base[path[i]];
|
|
40501
|
-
|
|
40502
|
-
if (!base || _typeof(base) !== "object") {
|
|
40503
|
-
throw new Error("Cannot apply patch, path doesn't resolve: " + path.join("/"));
|
|
40504
|
-
} // prettier-ignore
|
|
40505
|
-
|
|
39748
|
+
if (!base || typeof base !== "object") { throw new Error("Cannot apply patch, path doesn't resolve: " + path.join("/")); } // prettier-ignore
|
|
40506
39749
|
}
|
|
40507
39750
|
|
|
40508
39751
|
var key = path[path.length - 1];
|
|
@@ -40551,33 +39794,27 @@ var configDefaults = {
|
|
|
40551
39794
|
onDelete: null,
|
|
40552
39795
|
onCopy: null
|
|
40553
39796
|
};
|
|
40554
|
-
|
|
40555
39797
|
var Immer = function Immer(config) {
|
|
40556
39798
|
assign(this, configDefaults, config);
|
|
40557
39799
|
this.setUseProxies(this.useProxies);
|
|
40558
39800
|
this.produce = this.produce.bind(this);
|
|
40559
39801
|
};
|
|
40560
39802
|
|
|
40561
|
-
Immer.prototype.produce = function produce(base, recipe, patchListener) {
|
|
40562
|
-
|
|
39803
|
+
Immer.prototype.produce = function produce (base, recipe, patchListener) {
|
|
39804
|
+
var this$1$1 = this;
|
|
40563
39805
|
|
|
39806
|
+
// curried invocation
|
|
40564
39807
|
if (typeof base === "function" && typeof recipe !== "function") {
|
|
40565
39808
|
var defaultBase = recipe;
|
|
40566
39809
|
recipe = base;
|
|
40567
39810
|
var self = this;
|
|
40568
39811
|
return function curriedProduce(base) {
|
|
40569
|
-
|
|
40570
|
-
|
|
40571
|
-
|
|
40572
|
-
|
|
39812
|
+
var this$1$1 = this;
|
|
39813
|
+
if ( base === void 0 ) base = defaultBase;
|
|
39814
|
+
var args = [], len = arguments.length - 1;
|
|
39815
|
+
while ( len-- > 0 ) args[ len ] = arguments[ len + 1 ];
|
|
40573
39816
|
|
|
40574
|
-
|
|
40575
|
-
args[len] = arguments[len + 1];
|
|
40576
|
-
}
|
|
40577
|
-
|
|
40578
|
-
return self.produce(base, function (draft) {
|
|
40579
|
-
return recipe.call.apply(recipe, [this$1$1, draft].concat(args));
|
|
40580
|
-
}); // prettier-ignore
|
|
39817
|
+
return self.produce(base, function (draft) { return recipe.call.apply(recipe, [ this$1$1, draft ].concat( args )); }); // prettier-ignore
|
|
40581
39818
|
};
|
|
40582
39819
|
} // prettier-ignore
|
|
40583
39820
|
|
|
@@ -40603,11 +39840,7 @@ Immer.prototype.produce = function produce(base, recipe, patchListener) {
|
|
|
40603
39840
|
hasError = false;
|
|
40604
39841
|
} finally {
|
|
40605
39842
|
// finally instead of catch + rethrow better preserves original stack
|
|
40606
|
-
if (hasError) {
|
|
40607
|
-
scope.revoke();
|
|
40608
|
-
} else {
|
|
40609
|
-
scope.leave();
|
|
40610
|
-
}
|
|
39843
|
+
if (hasError) { scope.revoke(); }else { scope.leave(); }
|
|
40611
39844
|
}
|
|
40612
39845
|
|
|
40613
39846
|
if (result instanceof Promise) {
|
|
@@ -40624,38 +39857,25 @@ Immer.prototype.produce = function produce(base, recipe, patchListener) {
|
|
|
40624
39857
|
return this.processResult(result, scope);
|
|
40625
39858
|
} else {
|
|
40626
39859
|
result = recipe(base);
|
|
40627
|
-
|
|
40628
|
-
if (result === undefined) {
|
|
40629
|
-
return base;
|
|
40630
|
-
}
|
|
40631
|
-
|
|
39860
|
+
if (result === undefined) { return base; }
|
|
40632
39861
|
return result !== NOTHING ? result : undefined;
|
|
40633
39862
|
}
|
|
40634
39863
|
};
|
|
40635
39864
|
|
|
40636
|
-
Immer.prototype.produceWithPatches = function produceWithPatches(arg1, arg2, arg3) {
|
|
40637
|
-
|
|
39865
|
+
Immer.prototype.produceWithPatches = function produceWithPatches (arg1, arg2, arg3) {
|
|
39866
|
+
var this$1$1 = this;
|
|
40638
39867
|
|
|
40639
39868
|
if (typeof arg1 === "function") {
|
|
40640
39869
|
return function (state) {
|
|
40641
|
-
|
|
40642
|
-
|
|
39870
|
+
var args = [], len = arguments.length - 1;
|
|
39871
|
+
while ( len-- > 0 ) args[ len ] = arguments[ len + 1 ];
|
|
40643
39872
|
|
|
40644
|
-
|
|
40645
|
-
|
|
40646
|
-
}
|
|
40647
|
-
|
|
40648
|
-
return this$1$1.produceWithPatches(state, function (draft) {
|
|
40649
|
-
return arg1.apply(void 0, [draft].concat(args));
|
|
40650
|
-
});
|
|
40651
|
-
};
|
|
39873
|
+
return this$1$1.produceWithPatches(state, function (draft) { return arg1.apply(void 0, [ draft ].concat( args )); });
|
|
39874
|
+
};
|
|
40652
39875
|
} // non-curried form
|
|
40653
39876
|
|
|
40654
39877
|
|
|
40655
|
-
if (arg3) {
|
|
40656
|
-
throw new Error("A patch listener cannot be passed to produceWithPatches");
|
|
40657
|
-
}
|
|
40658
|
-
|
|
39878
|
+
if (arg3) { throw new Error("A patch listener cannot be passed to produceWithPatches"); }
|
|
40659
39879
|
var patches, inversePatches;
|
|
40660
39880
|
var nextState = this.produce(arg1, arg2, function (p, ip) {
|
|
40661
39881
|
patches = p;
|
|
@@ -40664,7 +39884,7 @@ Immer.prototype.produceWithPatches = function produceWithPatches(arg1, arg2, arg
|
|
|
40664
39884
|
return [nextState, patches, inversePatches];
|
|
40665
39885
|
};
|
|
40666
39886
|
|
|
40667
|
-
Immer.prototype.createDraft = function createDraft(base) {
|
|
39887
|
+
Immer.prototype.createDraft = function createDraft (base) {
|
|
40668
39888
|
if (!isDraftable(base)) {
|
|
40669
39889
|
throw new Error("First argument to `createDraft` must be a plain object, an array, or an immerable object"); // prettier-ignore
|
|
40670
39890
|
}
|
|
@@ -40676,7 +39896,7 @@ Immer.prototype.createDraft = function createDraft(base) {
|
|
|
40676
39896
|
return proxy;
|
|
40677
39897
|
};
|
|
40678
39898
|
|
|
40679
|
-
Immer.prototype.finishDraft = function finishDraft(draft, patchListener) {
|
|
39899
|
+
Immer.prototype.finishDraft = function finishDraft (draft, patchListener) {
|
|
40680
39900
|
var state = draft && draft[DRAFT_STATE];
|
|
40681
39901
|
|
|
40682
39902
|
if (!state || !state.isManual) {
|
|
@@ -40692,16 +39912,16 @@ Immer.prototype.finishDraft = function finishDraft(draft, patchListener) {
|
|
|
40692
39912
|
return this.processResult(undefined, scope);
|
|
40693
39913
|
};
|
|
40694
39914
|
|
|
40695
|
-
Immer.prototype.setAutoFreeze = function setAutoFreeze(value) {
|
|
39915
|
+
Immer.prototype.setAutoFreeze = function setAutoFreeze (value) {
|
|
40696
39916
|
this.autoFreeze = value;
|
|
40697
39917
|
};
|
|
40698
39918
|
|
|
40699
|
-
Immer.prototype.setUseProxies = function setUseProxies(value) {
|
|
39919
|
+
Immer.prototype.setUseProxies = function setUseProxies (value) {
|
|
40700
39920
|
this.useProxies = value;
|
|
40701
39921
|
assign(this, value ? modernProxy : legacyProxy);
|
|
40702
39922
|
};
|
|
40703
39923
|
|
|
40704
|
-
Immer.prototype.applyPatches = function applyPatches$1(base, patches) {
|
|
39924
|
+
Immer.prototype.applyPatches = function applyPatches$1 (base, patches) {
|
|
40705
39925
|
// If a patch replaces the entire state, take that replacement as base
|
|
40706
39926
|
// before applying patches
|
|
40707
39927
|
var i;
|
|
@@ -40721,14 +39941,12 @@ Immer.prototype.applyPatches = function applyPatches$1(base, patches) {
|
|
|
40721
39941
|
} // Otherwise, produce a copy of the base state.
|
|
40722
39942
|
|
|
40723
39943
|
|
|
40724
|
-
return this.produce(base, function (draft) {
|
|
40725
|
-
return applyPatches(draft, patches.slice(i + 1));
|
|
40726
|
-
});
|
|
39944
|
+
return this.produce(base, function (draft) { return applyPatches(draft, patches.slice(i + 1)); });
|
|
40727
39945
|
};
|
|
40728
39946
|
/** @internal */
|
|
40729
39947
|
|
|
40730
39948
|
|
|
40731
|
-
Immer.prototype.processResult = function processResult(result, scope) {
|
|
39949
|
+
Immer.prototype.processResult = function processResult (result, scope) {
|
|
40732
39950
|
var baseDraft = scope.drafts[0];
|
|
40733
39951
|
var isReplaced = result !== undefined && result !== baseDraft;
|
|
40734
39952
|
this.willFinalize(scope, result, isReplaced);
|
|
@@ -40776,15 +39994,13 @@ Immer.prototype.processResult = function processResult(result, scope) {
|
|
|
40776
39994
|
*/
|
|
40777
39995
|
|
|
40778
39996
|
|
|
40779
|
-
Immer.prototype.finalize = function finalize(draft, path, scope) {
|
|
40780
|
-
|
|
39997
|
+
Immer.prototype.finalize = function finalize (draft, path, scope) {
|
|
39998
|
+
var this$1$1 = this;
|
|
39999
|
+
|
|
40781
40000
|
var state = draft[DRAFT_STATE];
|
|
40782
40001
|
|
|
40783
40002
|
if (!state) {
|
|
40784
|
-
if (Object.isFrozen(draft)) {
|
|
40785
|
-
return draft;
|
|
40786
|
-
}
|
|
40787
|
-
|
|
40003
|
+
if (Object.isFrozen(draft)) { return draft; }
|
|
40788
40004
|
return this.finalizeTree(draft, null, scope);
|
|
40789
40005
|
} // Never finalize drafts owned by another scope.
|
|
40790
40006
|
|
|
@@ -40807,17 +40023,13 @@ Immer.prototype.finalize = function finalize(draft, path, scope) {
|
|
|
40807
40023
|
var assigned = state.assigned;
|
|
40808
40024
|
|
|
40809
40025
|
for (var prop in assigned) {
|
|
40810
|
-
if (!assigned[prop]) {
|
|
40811
|
-
this.onDelete(state, prop);
|
|
40812
|
-
}
|
|
40026
|
+
if (!assigned[prop]) { this.onDelete(state, prop); }
|
|
40813
40027
|
}
|
|
40814
40028
|
} else {
|
|
40815
40029
|
var base = state.base;
|
|
40816
|
-
|
|
40030
|
+
var copy = state.copy;
|
|
40817
40031
|
each(base, function (prop) {
|
|
40818
|
-
if (!has$1(copy, prop)) {
|
|
40819
|
-
this$1$1.onDelete(state, prop);
|
|
40820
|
-
}
|
|
40032
|
+
if (!has$1(copy, prop)) { this$1$1.onDelete(state, prop); }
|
|
40821
40033
|
});
|
|
40822
40034
|
}
|
|
40823
40035
|
}
|
|
@@ -40845,8 +40057,9 @@ Immer.prototype.finalize = function finalize(draft, path, scope) {
|
|
|
40845
40057
|
*/
|
|
40846
40058
|
|
|
40847
40059
|
|
|
40848
|
-
Immer.prototype.finalizeTree = function finalizeTree(root, rootPath, scope) {
|
|
40849
|
-
|
|
40060
|
+
Immer.prototype.finalizeTree = function finalizeTree (root, rootPath, scope) {
|
|
40061
|
+
var this$1$1 = this;
|
|
40062
|
+
|
|
40850
40063
|
var state = root[DRAFT_STATE];
|
|
40851
40064
|
|
|
40852
40065
|
if (state) {
|
|
@@ -40860,7 +40073,7 @@ Immer.prototype.finalizeTree = function finalizeTree(root, rootPath, scope) {
|
|
|
40860
40073
|
|
|
40861
40074
|
var needPatches = !!rootPath && !!scope.patches;
|
|
40862
40075
|
|
|
40863
|
-
var finalizeProperty = function
|
|
40076
|
+
var finalizeProperty = function (prop, value, parent) {
|
|
40864
40077
|
if (value === parent) {
|
|
40865
40078
|
throw Error("Immer forbids circular references");
|
|
40866
40079
|
} // In the `finalizeTree` method, only the `root` object may be a draft.
|
|
@@ -40887,16 +40100,14 @@ Immer.prototype.finalizeTree = function finalizeTree(root, rootPath, scope) {
|
|
|
40887
40100
|
} // Unchanged drafts are never passed to the `onAssign` hook.
|
|
40888
40101
|
|
|
40889
40102
|
|
|
40890
|
-
if (isDraftProp && value === state.base[prop]) {
|
|
40891
|
-
return;
|
|
40892
|
-
}
|
|
40103
|
+
if (isDraftProp && value === state.base[prop]) { return; }
|
|
40893
40104
|
} // Unchanged draft properties are ignored.
|
|
40894
40105
|
else if (isDraftProp && is(value, state.base[prop])) {
|
|
40895
|
-
|
|
40896
|
-
|
|
40897
|
-
|
|
40898
|
-
|
|
40899
|
-
|
|
40106
|
+
return;
|
|
40107
|
+
} // Search new objects for unfinalized drafts. Frozen objects should never contain drafts.
|
|
40108
|
+
else if (isDraftable(value) && !Object.isFrozen(value)) {
|
|
40109
|
+
each(value, finalizeProperty);
|
|
40110
|
+
}
|
|
40900
40111
|
|
|
40901
40112
|
if (isDraftProp && this$1$1.onAssign) {
|
|
40902
40113
|
this$1$1.onAssign(state, prop, value);
|
|
@@ -40974,223 +40185,127 @@ immer.createDraft.bind(immer);
|
|
|
40974
40185
|
|
|
40975
40186
|
immer.finishDraft.bind(immer);
|
|
40976
40187
|
|
|
40977
|
-
|
|
40978
|
-
|
|
40979
|
-
|
|
40980
|
-
|
|
40981
|
-
for (var _i3 = 0, _formConfigKeys = formConfigKeys; _i3 < _formConfigKeys.length; _i3++) {
|
|
40982
|
-
var formKey = _formConfigKeys[_i3];
|
|
40188
|
+
const createInitialState = formConfig => {
|
|
40189
|
+
let initialForm = {};
|
|
40190
|
+
const formConfigKeys = Object.keys(formConfig);
|
|
40191
|
+
for (let formKey of formConfigKeys) {
|
|
40983
40192
|
initialForm[formKey] = {
|
|
40984
40193
|
dirty: false,
|
|
40985
40194
|
rawValue: formConfig[formKey].defaultValue || "",
|
|
40986
40195
|
validators: formConfig[formKey].validators || [],
|
|
40987
40196
|
constraints: formConfig[formKey].constraints || []
|
|
40988
40197
|
};
|
|
40989
|
-
}
|
|
40198
|
+
}
|
|
40199
|
+
// Because validators require the entire form we have to do a
|
|
40990
40200
|
// second pass to add errors once the initial form has been
|
|
40991
40201
|
// constructed
|
|
40992
|
-
|
|
40993
|
-
|
|
40994
|
-
|
|
40995
|
-
|
|
40996
|
-
var errors = computeErrors(_formKey, initialForm);
|
|
40997
|
-
initialForm[_formKey].errors = errors;
|
|
40998
|
-
initialForm[_formKey].hasErrors = errors.length > 0;
|
|
40202
|
+
for (let formKey of formConfigKeys) {
|
|
40203
|
+
let errors = computeErrors(formKey, initialForm);
|
|
40204
|
+
initialForm[formKey].errors = errors;
|
|
40205
|
+
initialForm[formKey].hasErrors = errors.length > 0;
|
|
40999
40206
|
}
|
|
41000
|
-
|
|
41001
40207
|
return initialForm;
|
|
41002
40208
|
};
|
|
41003
40209
|
|
|
41004
|
-
|
|
41005
|
-
|
|
41006
|
-
|
|
41007
|
-
|
|
41008
|
-
|
|
41009
|
-
type: SET,
|
|
41010
|
-
payload: {
|
|
41011
|
-
fieldName: fieldName,
|
|
41012
|
-
value: value
|
|
41013
|
-
}
|
|
41014
|
-
};
|
|
41015
|
-
};
|
|
41016
|
-
};
|
|
41017
|
-
|
|
41018
|
-
var CLEAR = "form/CLEAR";
|
|
41019
|
-
|
|
41020
|
-
var _clear = function clear() {
|
|
41021
|
-
return {
|
|
41022
|
-
type: CLEAR
|
|
41023
|
-
};
|
|
41024
|
-
};
|
|
41025
|
-
|
|
41026
|
-
var ADD_VALIDATOR = "field/ADD_VALIDATOR";
|
|
41027
|
-
|
|
41028
|
-
var _addValidator = function addValidator(fieldName) {
|
|
41029
|
-
return function (validator) {
|
|
41030
|
-
return {
|
|
41031
|
-
type: ADD_VALIDATOR,
|
|
41032
|
-
payload: {
|
|
41033
|
-
fieldName: fieldName,
|
|
41034
|
-
validator: validator
|
|
41035
|
-
}
|
|
41036
|
-
};
|
|
41037
|
-
};
|
|
41038
|
-
};
|
|
41039
|
-
|
|
41040
|
-
var REMOVE_VALIDATOR = "field/REMOVE_VALIDATOR";
|
|
41041
|
-
|
|
41042
|
-
var _removeValidator = function removeValidator(fieldName) {
|
|
41043
|
-
return function (validator) {
|
|
41044
|
-
return {
|
|
41045
|
-
type: REMOVE_VALIDATOR,
|
|
41046
|
-
payload: {
|
|
41047
|
-
fieldName: fieldName,
|
|
41048
|
-
validator: validator
|
|
41049
|
-
}
|
|
41050
|
-
};
|
|
41051
|
-
};
|
|
41052
|
-
};
|
|
41053
|
-
|
|
41054
|
-
var CLEAR_FIELD_VALIDATORS = "field/CLEAR_FIELD_VALIDATORS";
|
|
41055
|
-
|
|
41056
|
-
var clearFieldValidators = function clearFieldValidators(fieldName) {
|
|
41057
|
-
return function () {
|
|
41058
|
-
return {
|
|
41059
|
-
type: CLEAR_FIELD_VALIDATORS,
|
|
41060
|
-
payload: {
|
|
41061
|
-
fieldName: fieldName
|
|
41062
|
-
}
|
|
41063
|
-
};
|
|
41064
|
-
};
|
|
41065
|
-
};
|
|
40210
|
+
const SET = "field/SET";
|
|
40211
|
+
const set$2 = fieldName => value => ({
|
|
40212
|
+
type: SET,
|
|
40213
|
+
payload: { fieldName, value }
|
|
40214
|
+
});
|
|
41066
40215
|
|
|
41067
|
-
|
|
41068
|
-
|
|
41069
|
-
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : createInitialState(formConfig);
|
|
41070
|
-
var action = arguments.length > 1 ? arguments[1] : undefined;
|
|
40216
|
+
const CLEAR = "form/CLEAR";
|
|
40217
|
+
const clear = () => ({ type: CLEAR });
|
|
41071
40218
|
|
|
41072
|
-
|
|
41073
|
-
|
|
41074
|
-
|
|
41075
|
-
|
|
41076
|
-
|
|
41077
|
-
return produce(state, function (draftState) {
|
|
41078
|
-
var originalValue = draftState[changedFieldName].rawValue;
|
|
41079
|
-
draftState[changedFieldName].rawValue = newRawValue;
|
|
41080
|
-
|
|
41081
|
-
if (computeConstraints(changedFieldName, draftState).length > 0) {
|
|
41082
|
-
// If the change violates constraints, revert the change
|
|
41083
|
-
draftState[changedFieldName].rawValue = originalValue;
|
|
41084
|
-
return draftState;
|
|
41085
|
-
}
|
|
40219
|
+
const ADD_VALIDATOR = "field/ADD_VALIDATOR";
|
|
40220
|
+
const addValidator = fieldName => validator => ({
|
|
40221
|
+
type: ADD_VALIDATOR,
|
|
40222
|
+
payload: { fieldName, validator }
|
|
40223
|
+
});
|
|
41086
40224
|
|
|
41087
|
-
|
|
41088
|
-
|
|
41089
|
-
|
|
40225
|
+
const createFormReducer = formConfig => (
|
|
40226
|
+
state = createInitialState(formConfig),
|
|
40227
|
+
action
|
|
40228
|
+
) => {
|
|
40229
|
+
switch (action.type) {
|
|
40230
|
+
case SET:
|
|
40231
|
+
const changedFieldName = action.payload.fieldName;
|
|
40232
|
+
const newRawValue = action.payload.value;
|
|
40233
|
+
|
|
40234
|
+
return produce(state, draftState => {
|
|
40235
|
+
let originalValue = draftState[changedFieldName].rawValue;
|
|
40236
|
+
draftState[changedFieldName].rawValue = newRawValue;
|
|
40237
|
+
if (computeConstraints(changedFieldName, draftState).length > 0) {
|
|
40238
|
+
// If the change violates constraints, revert the change
|
|
40239
|
+
draftState[changedFieldName].rawValue = originalValue;
|
|
40240
|
+
return draftState;
|
|
41090
40241
|
}
|
|
41091
40242
|
|
|
41092
|
-
|
|
41093
|
-
|
|
41094
|
-
|
|
41095
|
-
|
|
41096
|
-
|
|
41097
|
-
|
|
41098
|
-
|
|
41099
|
-
|
|
41100
|
-
|
|
41101
|
-
computeErrorEntries(draftState);
|
|
41102
|
-
});
|
|
40243
|
+
const fields = Object.entries(draftState);
|
|
40244
|
+
for (let entry of fields) {
|
|
40245
|
+
let fieldName = entry[0];
|
|
40246
|
+
let field = entry[1];
|
|
40247
|
+
let errors = computeErrors(fieldName, draftState);
|
|
40248
|
+
let dirty = fieldName === changedFieldName ? true : field.dirty;
|
|
40249
|
+
draftState[fieldName].errors = errors;
|
|
40250
|
+
draftState[fieldName].dirty = dirty;
|
|
40251
|
+
draftState[fieldName].hasErrors = errors.length > 0;
|
|
41103
40252
|
}
|
|
41104
|
-
|
|
41105
|
-
|
|
41106
|
-
|
|
41107
|
-
|
|
41108
|
-
|
|
41109
|
-
|
|
41110
|
-
|
|
41111
|
-
|
|
41112
|
-
|
|
41113
|
-
|
|
41114
|
-
|
|
41115
|
-
|
|
41116
|
-
|
|
41117
|
-
|
|
41118
|
-
|
|
41119
|
-
|
|
41120
|
-
|
|
41121
|
-
|
|
41122
|
-
draftState[fieldToClear].validators = [];
|
|
41123
|
-
computeErrorEntries(draftState);
|
|
41124
|
-
});
|
|
40253
|
+
});
|
|
40254
|
+
case CLEAR:
|
|
40255
|
+
return createInitialState(formConfig);
|
|
40256
|
+
case ADD_VALIDATOR:
|
|
40257
|
+
const fieldWithOverride = action.payload.fieldName;
|
|
40258
|
+
const newValidator = action.payload.validator;
|
|
40259
|
+
|
|
40260
|
+
return produce(state, draftState => {
|
|
40261
|
+
draftState[fieldWithOverride].validators.push(newValidator);
|
|
40262
|
+
const fields = Object.entries(draftState);
|
|
40263
|
+
for (let entry of fields) {
|
|
40264
|
+
let fieldName = entry[0];
|
|
40265
|
+
let field = entry[1];
|
|
40266
|
+
let errors = computeErrors(fieldName, draftState);
|
|
40267
|
+
let dirty = field.dirty;
|
|
40268
|
+
draftState[fieldName].errors = errors;
|
|
40269
|
+
draftState[fieldName].dirty = dirty;
|
|
40270
|
+
draftState[fieldName].hasErrors = errors.length > 0;
|
|
41125
40271
|
}
|
|
41126
|
-
|
|
41127
|
-
|
|
41128
|
-
|
|
41129
|
-
|
|
41130
|
-
};
|
|
40272
|
+
});
|
|
40273
|
+
default:
|
|
40274
|
+
return state;
|
|
40275
|
+
}
|
|
41131
40276
|
};
|
|
41132
40277
|
|
|
41133
|
-
|
|
40278
|
+
const createMapDispatchToProps = formConfig => {
|
|
41134
40279
|
// Do memo-ization
|
|
41135
|
-
|
|
41136
|
-
|
|
41137
|
-
return
|
|
40280
|
+
let cachedDispatch;
|
|
40281
|
+
let cacheValue;
|
|
40282
|
+
return dispatch => {
|
|
41138
40283
|
if (dispatch == cachedDispatch) {
|
|
41139
40284
|
return cacheValue;
|
|
41140
40285
|
}
|
|
41141
|
-
|
|
41142
|
-
var dispatchObj = {};
|
|
40286
|
+
let dispatchObj = {};
|
|
41143
40287
|
dispatchObj.fields = {};
|
|
41144
|
-
|
|
41145
|
-
|
|
41146
|
-
var _loop = function _loop() {
|
|
41147
|
-
var fieldName = _keys[_i5];
|
|
40288
|
+
const keys = Object.keys(formConfig);
|
|
40289
|
+
for (let fieldName of keys) {
|
|
41148
40290
|
dispatchObj.fields[fieldName] = {
|
|
41149
|
-
set:
|
|
41150
|
-
|
|
41151
|
-
},
|
|
41152
|
-
addValidator: function addValidator(validator) {
|
|
41153
|
-
return dispatch(_addValidator(fieldName)(validator));
|
|
41154
|
-
},
|
|
41155
|
-
removeValidator: function removeValidator(validator) {
|
|
41156
|
-
return dispatch(_removeValidator(fieldName)(validator));
|
|
41157
|
-
},
|
|
41158
|
-
clear: function clear() {
|
|
41159
|
-
return dispatch(clearFieldValidators(fieldName)());
|
|
41160
|
-
}
|
|
40291
|
+
set: value => dispatch(set$2(fieldName)(value)),
|
|
40292
|
+
addValidator: validator => dispatch(addValidator(fieldName)(validator))
|
|
41161
40293
|
};
|
|
41162
|
-
};
|
|
41163
|
-
|
|
41164
|
-
for (var _i5 = 0, _keys = keys; _i5 < _keys.length; _i5++) {
|
|
41165
|
-
_loop();
|
|
41166
40294
|
}
|
|
41167
|
-
|
|
41168
|
-
dispatchObj.form = {
|
|
41169
|
-
clear: function clear() {
|
|
41170
|
-
return dispatch(_clear());
|
|
41171
|
-
}
|
|
41172
|
-
};
|
|
40295
|
+
dispatchObj.form = { clear: () => dispatch(clear()) };
|
|
41173
40296
|
cachedDispatch = dispatch;
|
|
41174
|
-
cacheValue = {
|
|
41175
|
-
actions: dispatchObj
|
|
41176
|
-
};
|
|
40297
|
+
cacheValue = { actions: dispatchObj };
|
|
41177
40298
|
return cacheValue;
|
|
41178
40299
|
};
|
|
41179
40300
|
};
|
|
41180
40301
|
|
|
41181
|
-
|
|
41182
|
-
return {
|
|
41183
|
-
fields: state
|
|
41184
|
-
};
|
|
41185
|
-
};
|
|
40302
|
+
const mapStateToProps = state => ({ fields: state });
|
|
41186
40303
|
|
|
41187
|
-
|
|
41188
|
-
|
|
41189
|
-
|
|
41190
|
-
|
|
41191
|
-
|
|
41192
|
-
};
|
|
41193
|
-
};
|
|
40304
|
+
const createFormState = formConfig => ({
|
|
40305
|
+
reducer: createFormReducer(formConfig),
|
|
40306
|
+
mapDispatchToProps: createMapDispatchToProps(formConfig),
|
|
40307
|
+
mapStateToProps: mapStateToProps
|
|
40308
|
+
});
|
|
41194
40309
|
|
|
41195
40310
|
var AddressForm = function AddressForm(_ref) {
|
|
41196
40311
|
var _zipErrorMessages;
|
|
@@ -50310,8 +49425,6 @@ var fallbackValues$Q = {
|
|
|
50310
49425
|
dataQa: string,
|
|
50311
49426
|
content: <React Component(s)> e.g.: <Box><Stack>cool content stuff</Stack></Box> (any collection of components will work),
|
|
50312
49427
|
rightTitleContent: <React Component(s)> (rendered on the very right of the title section, use to supplement "rightIcons" with text, as in expired CC status, or render other custom content)
|
|
50313
|
-
contentOverride: <React Component(s)> (Replace the radio section and the containers with different content,
|
|
50314
|
-
intended for inserting a divider bar or other non-interactive css)
|
|
50315
49428
|
}
|
|
50316
49429
|
|
|
50317
49430
|
Also takes an "openSection" which should equal the id of the section that should be open
|
|
@@ -50400,7 +49513,7 @@ var RadioSection = function RadioSection(_ref) {
|
|
|
50400
49513
|
}, sections.filter(function (section) {
|
|
50401
49514
|
return !section.hidden;
|
|
50402
49515
|
}).map(function (section) {
|
|
50403
|
-
return
|
|
49516
|
+
return /*#__PURE__*/React.createElement(Motion, {
|
|
50404
49517
|
tabIndex: section.hideRadioButton || section.disabled ? "-1" : "0",
|
|
50405
49518
|
onKeyDown: function onKeyDown(e) {
|
|
50406
49519
|
return !section.disabled && handleKeyDown(section.id, e);
|