sixseconds-modules 1.6.147 → 1.6.151
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 +896 -1314
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +1 -3
- package/dist/index.es.js +897 -1315
- package/dist/index.es.js.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -11,10 +11,9 @@
|
|
|
11
11
|
}
|
|
12
12
|
})();
|
|
13
13
|
import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
14
|
-
import { Box, Typography, Dialog, Stack as Stack$1, Button as Button$1, styled, IconButton, Grid, Avatar, Chip, Link, Divider, ClickAwayListener, useMediaQuery, MenuItem, AppBar, Container, Badge, FormLabel, TextField, InputAdornment
|
|
14
|
+
import { Box, Typography, Dialog, Stack as Stack$1, Button as Button$1, styled, IconButton, Grid, Avatar, Chip, Link, Divider, ClickAwayListener, useMediaQuery, MenuItem, AppBar, Container, Badge, FormLabel, TextField, InputAdornment } from "@mui/material";
|
|
15
15
|
import * as React from "react";
|
|
16
16
|
import React__default, { useRef, useEffect, useState, useCallback, useMemo, useLayoutEffect, createContext, forwardRef, createElement, useContext, Component } from "react";
|
|
17
|
-
import { CacheProvider } from "@emotion/react";
|
|
18
17
|
import axios from "axios";
|
|
19
18
|
import Cookies from "js-cookie";
|
|
20
19
|
import MenuIcon from "@mui/icons-material/Menu";
|
|
@@ -373,8 +372,8 @@ deepmerge.all = function deepmergeAll(array2, options) {
|
|
|
373
372
|
if (!Array.isArray(array2)) {
|
|
374
373
|
throw new Error("first argument should be an array");
|
|
375
374
|
}
|
|
376
|
-
return array2.reduce(function(
|
|
377
|
-
return deepmerge(
|
|
375
|
+
return array2.reduce(function(prev, next) {
|
|
376
|
+
return deepmerge(prev, next, options);
|
|
378
377
|
}, {});
|
|
379
378
|
};
|
|
380
379
|
var deepmerge_1 = deepmerge;
|
|
@@ -449,10 +448,10 @@ function eq(value, other) {
|
|
|
449
448
|
return value === other || value !== value && other !== other;
|
|
450
449
|
}
|
|
451
450
|
function assocIndexOf(array2, key) {
|
|
452
|
-
var
|
|
453
|
-
while (
|
|
454
|
-
if (eq(array2[
|
|
455
|
-
return
|
|
451
|
+
var length = array2.length;
|
|
452
|
+
while (length--) {
|
|
453
|
+
if (eq(array2[length][0], key)) {
|
|
454
|
+
return length;
|
|
456
455
|
}
|
|
457
456
|
}
|
|
458
457
|
return -1;
|
|
@@ -491,9 +490,9 @@ function listCacheSet(key, value) {
|
|
|
491
490
|
return this;
|
|
492
491
|
}
|
|
493
492
|
function ListCache(entries) {
|
|
494
|
-
var index = -1,
|
|
493
|
+
var index = -1, length = entries == null ? 0 : entries.length;
|
|
495
494
|
this.clear();
|
|
496
|
-
while (++index <
|
|
495
|
+
while (++index < length) {
|
|
497
496
|
var entry = entries[index];
|
|
498
497
|
this.set(entry[0], entry[1]);
|
|
499
498
|
}
|
|
@@ -531,10 +530,10 @@ function isFunction$2(value) {
|
|
|
531
530
|
return tag == funcTag$2 || tag == genTag$1 || tag == asyncTag || tag == proxyTag;
|
|
532
531
|
}
|
|
533
532
|
var coreJsData = root["__core-js_shared__"];
|
|
534
|
-
var maskSrcKey =
|
|
533
|
+
var maskSrcKey = function() {
|
|
535
534
|
var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
|
|
536
535
|
return uid ? "Symbol(src)_1." + uid : "";
|
|
537
|
-
}
|
|
536
|
+
}();
|
|
538
537
|
function isMasked(func) {
|
|
539
538
|
return !!maskSrcKey && maskSrcKey in func;
|
|
540
539
|
}
|
|
@@ -611,9 +610,9 @@ function hashSet(key, value) {
|
|
|
611
610
|
return this;
|
|
612
611
|
}
|
|
613
612
|
function Hash(entries) {
|
|
614
|
-
var index = -1,
|
|
613
|
+
var index = -1, length = entries == null ? 0 : entries.length;
|
|
615
614
|
this.clear();
|
|
616
|
-
while (++index <
|
|
615
|
+
while (++index < length) {
|
|
617
616
|
var entry = entries[index];
|
|
618
617
|
this.set(entry[0], entry[1]);
|
|
619
618
|
}
|
|
@@ -657,9 +656,9 @@ function mapCacheSet(key, value) {
|
|
|
657
656
|
return this;
|
|
658
657
|
}
|
|
659
658
|
function MapCache(entries) {
|
|
660
|
-
var index = -1,
|
|
659
|
+
var index = -1, length = entries == null ? 0 : entries.length;
|
|
661
660
|
this.clear();
|
|
662
|
-
while (++index <
|
|
661
|
+
while (++index < length) {
|
|
663
662
|
var entry = entries[index];
|
|
664
663
|
this.set(entry[0], entry[1]);
|
|
665
664
|
}
|
|
@@ -695,22 +694,22 @@ Stack.prototype.get = stackGet;
|
|
|
695
694
|
Stack.prototype.has = stackHas;
|
|
696
695
|
Stack.prototype.set = stackSet;
|
|
697
696
|
function arrayEach(array2, iteratee) {
|
|
698
|
-
var index = -1,
|
|
699
|
-
while (++index <
|
|
697
|
+
var index = -1, length = array2 == null ? 0 : array2.length;
|
|
698
|
+
while (++index < length) {
|
|
700
699
|
if (iteratee(array2[index], index, array2) === false) {
|
|
701
700
|
break;
|
|
702
701
|
}
|
|
703
702
|
}
|
|
704
703
|
return array2;
|
|
705
704
|
}
|
|
706
|
-
var defineProperty =
|
|
705
|
+
var defineProperty = function() {
|
|
707
706
|
try {
|
|
708
707
|
var func = getNative(Object, "defineProperty");
|
|
709
708
|
func({}, "", {});
|
|
710
709
|
return func;
|
|
711
710
|
} catch (e) {
|
|
712
711
|
}
|
|
713
|
-
}
|
|
712
|
+
}();
|
|
714
713
|
function baseAssignValue(object2, key, value) {
|
|
715
714
|
if (key == "__proto__" && defineProperty) {
|
|
716
715
|
defineProperty(object2, key, {
|
|
@@ -734,8 +733,8 @@ function assignValue(object2, key, value) {
|
|
|
734
733
|
function copyObject(source, props, object2, customizer) {
|
|
735
734
|
var isNew = !object2;
|
|
736
735
|
object2 || (object2 = {});
|
|
737
|
-
var index = -1,
|
|
738
|
-
while (++index <
|
|
736
|
+
var index = -1, length = props.length;
|
|
737
|
+
while (++index < length) {
|
|
739
738
|
var key = props[index];
|
|
740
739
|
var newValue = void 0;
|
|
741
740
|
if (newValue === void 0) {
|
|
@@ -763,9 +762,9 @@ function baseIsArguments(value) {
|
|
|
763
762
|
var objectProto$6 = Object.prototype;
|
|
764
763
|
var hasOwnProperty$4 = objectProto$6.hasOwnProperty;
|
|
765
764
|
var propertyIsEnumerable$1 = objectProto$6.propertyIsEnumerable;
|
|
766
|
-
var isArguments = baseIsArguments(/* @__PURE__ */
|
|
765
|
+
var isArguments = baseIsArguments(/* @__PURE__ */ function() {
|
|
767
766
|
return arguments;
|
|
768
|
-
}
|
|
767
|
+
}()) ? baseIsArguments : function(value) {
|
|
769
768
|
return isObjectLike(value) && hasOwnProperty$4.call(value, "callee") && !propertyIsEnumerable$1.call(value, "callee");
|
|
770
769
|
};
|
|
771
770
|
var isArray$1 = Array.isArray;
|
|
@@ -780,10 +779,10 @@ var nativeIsBuffer = Buffer$1 ? Buffer$1.isBuffer : void 0;
|
|
|
780
779
|
var isBuffer = nativeIsBuffer || stubFalse;
|
|
781
780
|
var MAX_SAFE_INTEGER$1 = 9007199254740991;
|
|
782
781
|
var reIsUint = /^(?:0|[1-9]\d*)$/;
|
|
783
|
-
function isIndex(value,
|
|
782
|
+
function isIndex(value, length) {
|
|
784
783
|
var type = typeof value;
|
|
785
|
-
|
|
786
|
-
return !!
|
|
784
|
+
length = length == null ? MAX_SAFE_INTEGER$1 : length;
|
|
785
|
+
return !!length && (type == "number" || type != "symbol" && reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length);
|
|
787
786
|
}
|
|
788
787
|
var MAX_SAFE_INTEGER = 9007199254740991;
|
|
789
788
|
function isLength(value) {
|
|
@@ -806,7 +805,7 @@ var freeExports$1 = typeof exports == "object" && exports && !exports.nodeType &
|
|
|
806
805
|
var freeModule$1 = freeExports$1 && typeof module == "object" && module && !module.nodeType && module;
|
|
807
806
|
var moduleExports$1 = freeModule$1 && freeModule$1.exports === freeExports$1;
|
|
808
807
|
var freeProcess = moduleExports$1 && freeGlobal.process;
|
|
809
|
-
var nodeUtil =
|
|
808
|
+
var nodeUtil = function() {
|
|
810
809
|
try {
|
|
811
810
|
var types = freeModule$1 && freeModule$1.require && freeModule$1.require("util").types;
|
|
812
811
|
if (types) {
|
|
@@ -815,19 +814,19 @@ var nodeUtil = (function() {
|
|
|
815
814
|
return freeProcess && freeProcess.binding && freeProcess.binding("util");
|
|
816
815
|
} catch (e) {
|
|
817
816
|
}
|
|
818
|
-
}
|
|
817
|
+
}();
|
|
819
818
|
var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
|
|
820
819
|
var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
|
|
821
820
|
var objectProto$5 = Object.prototype;
|
|
822
821
|
var hasOwnProperty$3 = objectProto$5.hasOwnProperty;
|
|
823
822
|
function arrayLikeKeys(value, inherited) {
|
|
824
|
-
var isArr = isArray$1(value), isArg = !isArr && isArguments(value), isBuff = !isArr && !isArg && isBuffer(value), isType = !isArr && !isArg && !isBuff && isTypedArray(value), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? baseTimes(value.length, String) : [],
|
|
823
|
+
var isArr = isArray$1(value), isArg = !isArr && isArguments(value), isBuff = !isArr && !isArg && isBuffer(value), isType = !isArr && !isArg && !isBuff && isTypedArray(value), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? baseTimes(value.length, String) : [], length = result.length;
|
|
825
824
|
for (var key in value) {
|
|
826
825
|
if ((inherited || hasOwnProperty$3.call(value, key)) && !(skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode.
|
|
827
826
|
(key == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
|
|
828
827
|
isBuff && (key == "offset" || key == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
|
|
829
828
|
isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || // Skip index properties.
|
|
830
|
-
isIndex(key,
|
|
829
|
+
isIndex(key, length)))) {
|
|
831
830
|
result.push(key);
|
|
832
831
|
}
|
|
833
832
|
}
|
|
@@ -899,21 +898,21 @@ function cloneBuffer(buffer, isDeep) {
|
|
|
899
898
|
if (isDeep) {
|
|
900
899
|
return buffer.slice();
|
|
901
900
|
}
|
|
902
|
-
var
|
|
901
|
+
var length = buffer.length, result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
|
|
903
902
|
buffer.copy(result);
|
|
904
903
|
return result;
|
|
905
904
|
}
|
|
906
905
|
function copyArray(source, array2) {
|
|
907
|
-
var index = -1,
|
|
908
|
-
array2 || (array2 = Array(
|
|
909
|
-
while (++index <
|
|
906
|
+
var index = -1, length = source.length;
|
|
907
|
+
array2 || (array2 = Array(length));
|
|
908
|
+
while (++index < length) {
|
|
910
909
|
array2[index] = source[index];
|
|
911
910
|
}
|
|
912
911
|
return array2;
|
|
913
912
|
}
|
|
914
913
|
function arrayFilter(array2, predicate) {
|
|
915
|
-
var index = -1,
|
|
916
|
-
while (++index <
|
|
914
|
+
var index = -1, length = array2 == null ? 0 : array2.length, resIndex = 0, result = [];
|
|
915
|
+
while (++index < length) {
|
|
917
916
|
var value = array2[index];
|
|
918
917
|
if (predicate(value, index, array2)) {
|
|
919
918
|
result[resIndex++] = value;
|
|
@@ -940,8 +939,8 @@ function copySymbols(source, object2) {
|
|
|
940
939
|
return copyObject(source, getSymbols(source), object2);
|
|
941
940
|
}
|
|
942
941
|
function arrayPush(array2, values) {
|
|
943
|
-
var index = -1,
|
|
944
|
-
while (++index <
|
|
942
|
+
var index = -1, length = values.length, offset2 = array2.length;
|
|
943
|
+
while (++index < length) {
|
|
945
944
|
array2[offset2 + index] = values[index];
|
|
946
945
|
}
|
|
947
946
|
return array2;
|
|
@@ -999,8 +998,8 @@ if (DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag$2 || Map
|
|
|
999
998
|
var objectProto = Object.prototype;
|
|
1000
999
|
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
1001
1000
|
function initCloneArray(array2) {
|
|
1002
|
-
var
|
|
1003
|
-
if (
|
|
1001
|
+
var length = array2.length, result = new array2.constructor(length);
|
|
1002
|
+
if (length && typeof array2[0] == "string" && hasOwnProperty.call(array2, "index")) {
|
|
1004
1003
|
result.index = array2.index;
|
|
1005
1004
|
result.input = array2.input;
|
|
1006
1005
|
}
|
|
@@ -1066,7 +1065,7 @@ function initCloneByTag(object2, tag, isDeep) {
|
|
|
1066
1065
|
}
|
|
1067
1066
|
}
|
|
1068
1067
|
var objectCreate = Object.create;
|
|
1069
|
-
var baseCreate = /* @__PURE__ */
|
|
1068
|
+
var baseCreate = /* @__PURE__ */ function() {
|
|
1070
1069
|
function object2() {
|
|
1071
1070
|
}
|
|
1072
1071
|
return function(proto2) {
|
|
@@ -1081,7 +1080,7 @@ var baseCreate = /* @__PURE__ */ (function() {
|
|
|
1081
1080
|
object2.prototype = void 0;
|
|
1082
1081
|
return result;
|
|
1083
1082
|
};
|
|
1084
|
-
}
|
|
1083
|
+
}();
|
|
1085
1084
|
function initCloneObject(object2) {
|
|
1086
1085
|
return typeof object2.constructor == "function" && !isPrototype(object2) ? baseCreate(getPrototype(object2)) : {};
|
|
1087
1086
|
}
|
|
@@ -1179,11 +1178,11 @@ function requireReactFastCompare() {
|
|
|
1179
1178
|
function equal(a, b) {
|
|
1180
1179
|
if (a === b) return true;
|
|
1181
1180
|
if (a && b && typeof a == "object" && typeof b == "object") {
|
|
1182
|
-
var arrA = isArray2(a), arrB = isArray2(b), i,
|
|
1181
|
+
var arrA = isArray2(a), arrB = isArray2(b), i, length, key;
|
|
1183
1182
|
if (arrA && arrB) {
|
|
1184
|
-
|
|
1185
|
-
if (
|
|
1186
|
-
for (i =
|
|
1183
|
+
length = a.length;
|
|
1184
|
+
if (length != b.length) return false;
|
|
1185
|
+
for (i = length; i-- !== 0; )
|
|
1187
1186
|
if (!equal(a[i], b[i])) return false;
|
|
1188
1187
|
return true;
|
|
1189
1188
|
}
|
|
@@ -1195,14 +1194,14 @@ function requireReactFastCompare() {
|
|
|
1195
1194
|
if (regexpA != regexpB) return false;
|
|
1196
1195
|
if (regexpA && regexpB) return a.toString() == b.toString();
|
|
1197
1196
|
var keys2 = keyList(a);
|
|
1198
|
-
|
|
1199
|
-
if (
|
|
1197
|
+
length = keys2.length;
|
|
1198
|
+
if (length !== keyList(b).length)
|
|
1200
1199
|
return false;
|
|
1201
|
-
for (i =
|
|
1200
|
+
for (i = length; i-- !== 0; )
|
|
1202
1201
|
if (!hasProp.call(b, keys2[i])) return false;
|
|
1203
1202
|
if (hasElementType && a instanceof Element && b instanceof Element)
|
|
1204
1203
|
return a === b;
|
|
1205
|
-
for (i =
|
|
1204
|
+
for (i = length; i-- !== 0; ) {
|
|
1206
1205
|
key = keys2[i];
|
|
1207
1206
|
if (key === "_owner" && a.$$typeof) {
|
|
1208
1207
|
continue;
|
|
@@ -1247,8 +1246,8 @@ function clone$2(value) {
|
|
|
1247
1246
|
return baseClone(value, CLONE_SYMBOLS_FLAG);
|
|
1248
1247
|
}
|
|
1249
1248
|
function arrayMap(array2, iteratee) {
|
|
1250
|
-
var index = -1,
|
|
1251
|
-
while (++index <
|
|
1249
|
+
var index = -1, length = array2 == null ? 0 : array2.length, result = Array(length);
|
|
1250
|
+
while (++index < length) {
|
|
1252
1251
|
result[index] = iteratee(array2[index], index, array2);
|
|
1253
1252
|
}
|
|
1254
1253
|
return result;
|
|
@@ -1293,8 +1292,8 @@ var stringToPath = memoizeCapped(function(string2) {
|
|
|
1293
1292
|
if (string2.charCodeAt(0) === 46) {
|
|
1294
1293
|
result.push("");
|
|
1295
1294
|
}
|
|
1296
|
-
string2.replace(rePropName, function(
|
|
1297
|
-
result.push(quote ? subString.replace(reEscapeChar, "$1") : number2 ||
|
|
1295
|
+
string2.replace(rePropName, function(match, number2, quote, subString) {
|
|
1296
|
+
result.push(quote ? subString.replace(reEscapeChar, "$1") : number2 || match);
|
|
1298
1297
|
});
|
|
1299
1298
|
return result;
|
|
1300
1299
|
});
|
|
@@ -1343,7 +1342,7 @@ function requireReactIs_production_min() {
|
|
|
1343
1342
|
if (hasRequiredReactIs_production_min) return reactIs_production_min;
|
|
1344
1343
|
hasRequiredReactIs_production_min = 1;
|
|
1345
1344
|
var b = "function" === typeof Symbol && Symbol.for, c = b ? Symbol.for("react.element") : 60103, d = b ? Symbol.for("react.portal") : 60106, e = b ? Symbol.for("react.fragment") : 60107, f = b ? Symbol.for("react.strict_mode") : 60108, g = b ? Symbol.for("react.profiler") : 60114, h = b ? Symbol.for("react.provider") : 60109, k = b ? Symbol.for("react.context") : 60110, l = b ? Symbol.for("react.async_mode") : 60111, m = b ? Symbol.for("react.concurrent_mode") : 60111, n = b ? Symbol.for("react.forward_ref") : 60112, p = b ? Symbol.for("react.suspense") : 60113, q = b ? Symbol.for("react.suspense_list") : 60120, r = b ? Symbol.for("react.memo") : 60115, t = b ? Symbol.for("react.lazy") : 60116, v = b ? Symbol.for("react.block") : 60121, w = b ? Symbol.for("react.fundamental") : 60117, x = b ? Symbol.for("react.responder") : 60118, y = b ? Symbol.for("react.scope") : 60119;
|
|
1346
|
-
function
|
|
1345
|
+
function z2(a) {
|
|
1347
1346
|
if ("object" === typeof a && null !== a) {
|
|
1348
1347
|
var u = a.$$typeof;
|
|
1349
1348
|
switch (u) {
|
|
@@ -1374,7 +1373,7 @@ function requireReactIs_production_min() {
|
|
|
1374
1373
|
}
|
|
1375
1374
|
}
|
|
1376
1375
|
function A(a) {
|
|
1377
|
-
return
|
|
1376
|
+
return z2(a) === m;
|
|
1378
1377
|
}
|
|
1379
1378
|
reactIs_production_min.AsyncMode = l;
|
|
1380
1379
|
reactIs_production_min.ConcurrentMode = m;
|
|
@@ -1390,46 +1389,46 @@ function requireReactIs_production_min() {
|
|
|
1390
1389
|
reactIs_production_min.StrictMode = f;
|
|
1391
1390
|
reactIs_production_min.Suspense = p;
|
|
1392
1391
|
reactIs_production_min.isAsyncMode = function(a) {
|
|
1393
|
-
return A(a) ||
|
|
1392
|
+
return A(a) || z2(a) === l;
|
|
1394
1393
|
};
|
|
1395
1394
|
reactIs_production_min.isConcurrentMode = A;
|
|
1396
1395
|
reactIs_production_min.isContextConsumer = function(a) {
|
|
1397
|
-
return
|
|
1396
|
+
return z2(a) === k;
|
|
1398
1397
|
};
|
|
1399
1398
|
reactIs_production_min.isContextProvider = function(a) {
|
|
1400
|
-
return
|
|
1399
|
+
return z2(a) === h;
|
|
1401
1400
|
};
|
|
1402
1401
|
reactIs_production_min.isElement = function(a) {
|
|
1403
1402
|
return "object" === typeof a && null !== a && a.$$typeof === c;
|
|
1404
1403
|
};
|
|
1405
1404
|
reactIs_production_min.isForwardRef = function(a) {
|
|
1406
|
-
return
|
|
1405
|
+
return z2(a) === n;
|
|
1407
1406
|
};
|
|
1408
1407
|
reactIs_production_min.isFragment = function(a) {
|
|
1409
|
-
return
|
|
1408
|
+
return z2(a) === e;
|
|
1410
1409
|
};
|
|
1411
1410
|
reactIs_production_min.isLazy = function(a) {
|
|
1412
|
-
return
|
|
1411
|
+
return z2(a) === t;
|
|
1413
1412
|
};
|
|
1414
1413
|
reactIs_production_min.isMemo = function(a) {
|
|
1415
|
-
return
|
|
1414
|
+
return z2(a) === r;
|
|
1416
1415
|
};
|
|
1417
1416
|
reactIs_production_min.isPortal = function(a) {
|
|
1418
|
-
return
|
|
1417
|
+
return z2(a) === d;
|
|
1419
1418
|
};
|
|
1420
1419
|
reactIs_production_min.isProfiler = function(a) {
|
|
1421
|
-
return
|
|
1420
|
+
return z2(a) === g;
|
|
1422
1421
|
};
|
|
1423
1422
|
reactIs_production_min.isStrictMode = function(a) {
|
|
1424
|
-
return
|
|
1423
|
+
return z2(a) === f;
|
|
1425
1424
|
};
|
|
1426
1425
|
reactIs_production_min.isSuspense = function(a) {
|
|
1427
|
-
return
|
|
1426
|
+
return z2(a) === p;
|
|
1428
1427
|
};
|
|
1429
1428
|
reactIs_production_min.isValidElementType = function(a) {
|
|
1430
1429
|
return "string" === typeof a || "function" === typeof a || a === e || a === m || a === g || a === f || a === p || a === q || "object" === typeof a && null !== a && (a.$$typeof === t || a.$$typeof === r || a.$$typeof === h || a.$$typeof === k || a.$$typeof === n || a.$$typeof === w || a.$$typeof === x || a.$$typeof === y || a.$$typeof === v);
|
|
1431
1430
|
};
|
|
1432
|
-
reactIs_production_min.typeOf =
|
|
1431
|
+
reactIs_production_min.typeOf = z2;
|
|
1433
1432
|
return reactIs_production_min;
|
|
1434
1433
|
}
|
|
1435
1434
|
var reactIs_development = {};
|
|
@@ -1920,9 +1919,9 @@ function useFormik(_ref) {
|
|
|
1920
1919
|
});
|
|
1921
1920
|
var state = stateRef.current;
|
|
1922
1921
|
var dispatch = useCallback(function(action) {
|
|
1923
|
-
var
|
|
1924
|
-
stateRef.current = formikReducer(
|
|
1925
|
-
if (
|
|
1922
|
+
var prev = stateRef.current;
|
|
1923
|
+
stateRef.current = formikReducer(prev, action);
|
|
1924
|
+
if (prev !== stateRef.current) setIteration(function(x) {
|
|
1926
1925
|
return x + 1;
|
|
1927
1926
|
});
|
|
1928
1927
|
}, []);
|
|
@@ -1977,14 +1976,14 @@ function useFormik(_ref) {
|
|
|
1977
1976
|
return runSingleFieldLevelValidation(f, getIn$1(values, f));
|
|
1978
1977
|
}) : [Promise.resolve("DO_NOT_DELETE_YOU_WILL_BE_FIRED")];
|
|
1979
1978
|
return Promise.all(fieldValidations).then(function(fieldErrorsList) {
|
|
1980
|
-
return fieldErrorsList.reduce(function(
|
|
1979
|
+
return fieldErrorsList.reduce(function(prev, curr, index) {
|
|
1981
1980
|
if (curr === "DO_NOT_DELETE_YOU_WILL_BE_FIRED") {
|
|
1982
|
-
return
|
|
1981
|
+
return prev;
|
|
1983
1982
|
}
|
|
1984
1983
|
if (curr) {
|
|
1985
|
-
|
|
1984
|
+
prev = setIn(prev, fieldKeysWithValidation[index], curr);
|
|
1986
1985
|
}
|
|
1987
|
-
return
|
|
1986
|
+
return prev;
|
|
1988
1987
|
}, {});
|
|
1989
1988
|
});
|
|
1990
1989
|
}, [runSingleFieldLevelValidation]);
|
|
@@ -2195,16 +2194,15 @@ function useFormik(_ref) {
|
|
|
2195
2194
|
});
|
|
2196
2195
|
}, []);
|
|
2197
2196
|
var setFieldValue = useEventCallback(function(field, value, shouldValidate) {
|
|
2198
|
-
var resolvedValue = isFunction$1(value) ? value(getIn$1(state.values, field)) : value;
|
|
2199
2197
|
dispatch({
|
|
2200
2198
|
type: "SET_FIELD_VALUE",
|
|
2201
2199
|
payload: {
|
|
2202
2200
|
field,
|
|
2203
|
-
value
|
|
2201
|
+
value
|
|
2204
2202
|
}
|
|
2205
2203
|
});
|
|
2206
2204
|
var willValidate = shouldValidate === void 0 ? validateOnChange : shouldValidate;
|
|
2207
|
-
return willValidate ? validateFormWithHighPriority(setIn(state.values, field,
|
|
2205
|
+
return willValidate ? validateFormWithHighPriority(setIn(state.values, field, value)) : Promise.resolve();
|
|
2208
2206
|
});
|
|
2209
2207
|
var executeChange = useCallback(function(eventOrTextValue, maybePath) {
|
|
2210
2208
|
var field = maybePath;
|
|
@@ -2659,8 +2657,7 @@ function createEnv(opts) {
|
|
|
2659
2657
|
}
|
|
2660
2658
|
var util;
|
|
2661
2659
|
(function(util2) {
|
|
2662
|
-
util2.assertEqual = (
|
|
2663
|
-
};
|
|
2660
|
+
util2.assertEqual = (val) => val;
|
|
2664
2661
|
function assertIs(_arg) {
|
|
2665
2662
|
}
|
|
2666
2663
|
util2.assertIs = assertIs;
|
|
@@ -2704,7 +2701,7 @@ var util;
|
|
|
2704
2701
|
}
|
|
2705
2702
|
return void 0;
|
|
2706
2703
|
};
|
|
2707
|
-
util2.isInteger = typeof Number.isInteger === "function" ? (val) => Number.isInteger(val) : (val) => typeof val === "number" &&
|
|
2704
|
+
util2.isInteger = typeof Number.isInteger === "function" ? (val) => Number.isInteger(val) : (val) => typeof val === "number" && isFinite(val) && Math.floor(val) === val;
|
|
2708
2705
|
function joinValues(array2, separator = " | ") {
|
|
2709
2706
|
return array2.map((val) => typeof val === "string" ? `'${val}'` : val).join(separator);
|
|
2710
2707
|
}
|
|
@@ -2756,7 +2753,7 @@ const getParsedType = (data) => {
|
|
|
2756
2753
|
case "string":
|
|
2757
2754
|
return ZodParsedType.string;
|
|
2758
2755
|
case "number":
|
|
2759
|
-
return
|
|
2756
|
+
return isNaN(data) ? ZodParsedType.nan : ZodParsedType.number;
|
|
2760
2757
|
case "boolean":
|
|
2761
2758
|
return ZodParsedType.boolean;
|
|
2762
2759
|
case "function":
|
|
@@ -2807,6 +2804,10 @@ const ZodIssueCode = util.arrayToEnum([
|
|
|
2807
2804
|
"not_multiple_of",
|
|
2808
2805
|
"not_finite"
|
|
2809
2806
|
]);
|
|
2807
|
+
const quotelessJson = (obj) => {
|
|
2808
|
+
const json = JSON.stringify(obj, null, 2);
|
|
2809
|
+
return json.replace(/"([^"]+)":/g, "$1:");
|
|
2810
|
+
};
|
|
2810
2811
|
class ZodError extends Error {
|
|
2811
2812
|
get errors() {
|
|
2812
2813
|
return this.issues;
|
|
@@ -2884,9 +2885,8 @@ class ZodError extends Error {
|
|
|
2884
2885
|
const formErrors = [];
|
|
2885
2886
|
for (const sub of this.issues) {
|
|
2886
2887
|
if (sub.path.length > 0) {
|
|
2887
|
-
|
|
2888
|
-
fieldErrors[
|
|
2889
|
-
fieldErrors[firstEl].push(mapper(sub));
|
|
2888
|
+
fieldErrors[sub.path[0]] = fieldErrors[sub.path[0]] || [];
|
|
2889
|
+
fieldErrors[sub.path[0]].push(mapper(sub));
|
|
2890
2890
|
} else {
|
|
2891
2891
|
formErrors.push(mapper(sub));
|
|
2892
2892
|
}
|
|
@@ -2962,8 +2962,6 @@ const errorMap = (issue, _ctx) => {
|
|
|
2962
2962
|
message = `String must contain ${issue.exact ? "exactly" : issue.inclusive ? `at least` : `over`} ${issue.minimum} character(s)`;
|
|
2963
2963
|
else if (issue.type === "number")
|
|
2964
2964
|
message = `Number must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${issue.minimum}`;
|
|
2965
|
-
else if (issue.type === "bigint")
|
|
2966
|
-
message = `Number must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${issue.minimum}`;
|
|
2967
2965
|
else if (issue.type === "date")
|
|
2968
2966
|
message = `Date must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${new Date(Number(issue.minimum))}`;
|
|
2969
2967
|
else
|
|
@@ -3002,6 +3000,9 @@ const errorMap = (issue, _ctx) => {
|
|
|
3002
3000
|
return { message };
|
|
3003
3001
|
};
|
|
3004
3002
|
let overrideErrorMap = errorMap;
|
|
3003
|
+
function setErrorMap(map2) {
|
|
3004
|
+
overrideErrorMap = map2;
|
|
3005
|
+
}
|
|
3005
3006
|
function getErrorMap() {
|
|
3006
3007
|
return overrideErrorMap;
|
|
3007
3008
|
}
|
|
@@ -3030,6 +3031,7 @@ const makeIssue = (params) => {
|
|
|
3030
3031
|
message: errorMessage
|
|
3031
3032
|
};
|
|
3032
3033
|
};
|
|
3034
|
+
const EMPTY_PATH = [];
|
|
3033
3035
|
function addIssueToContext(ctx, issueData) {
|
|
3034
3036
|
const overrideMap = getErrorMap();
|
|
3035
3037
|
const issue = makeIssue({
|
|
@@ -3112,11 +3114,24 @@ const isAborted = (x) => x.status === "aborted";
|
|
|
3112
3114
|
const isDirty = (x) => x.status === "dirty";
|
|
3113
3115
|
const isValid$3 = (x) => x.status === "valid";
|
|
3114
3116
|
const isAsync = (x) => typeof Promise !== "undefined" && x instanceof Promise;
|
|
3117
|
+
function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
3118
|
+
if (typeof state === "function" ? receiver !== state || true : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
3119
|
+
return state.get(receiver);
|
|
3120
|
+
}
|
|
3121
|
+
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|
3122
|
+
if (typeof state === "function" ? receiver !== state || true : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
3123
|
+
return state.set(receiver, value), value;
|
|
3124
|
+
}
|
|
3125
|
+
typeof SuppressedError === "function" ? SuppressedError : function(error, suppressed, message) {
|
|
3126
|
+
var e = new Error(message);
|
|
3127
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
3128
|
+
};
|
|
3115
3129
|
var errorUtil;
|
|
3116
3130
|
(function(errorUtil2) {
|
|
3117
3131
|
errorUtil2.errToObj = (message) => typeof message === "string" ? { message } : message || {};
|
|
3118
|
-
errorUtil2.toString = (message) => typeof message === "string" ? message : message
|
|
3132
|
+
errorUtil2.toString = (message) => typeof message === "string" ? message : message === null || message === void 0 ? void 0 : message.message;
|
|
3119
3133
|
})(errorUtil || (errorUtil = {}));
|
|
3134
|
+
var _ZodEnum_cache, _ZodNativeEnum_cache;
|
|
3120
3135
|
class ParseInputLazyPath {
|
|
3121
3136
|
constructor(parent, value, path, key) {
|
|
3122
3137
|
this._cachedPath = [];
|
|
@@ -3127,7 +3142,7 @@ class ParseInputLazyPath {
|
|
|
3127
3142
|
}
|
|
3128
3143
|
get path() {
|
|
3129
3144
|
if (!this._cachedPath.length) {
|
|
3130
|
-
if (
|
|
3145
|
+
if (this._key instanceof Array) {
|
|
3131
3146
|
this._cachedPath.push(...this._path, ...this._key);
|
|
3132
3147
|
} else {
|
|
3133
3148
|
this._cachedPath.push(...this._path, this._key);
|
|
@@ -3165,16 +3180,17 @@ function processCreateParams(params) {
|
|
|
3165
3180
|
if (errorMap2)
|
|
3166
3181
|
return { errorMap: errorMap2, description };
|
|
3167
3182
|
const customMap = (iss, ctx) => {
|
|
3183
|
+
var _a, _b;
|
|
3168
3184
|
const { message } = params;
|
|
3169
3185
|
if (iss.code === "invalid_enum_value") {
|
|
3170
|
-
return { message: message
|
|
3186
|
+
return { message: message !== null && message !== void 0 ? message : ctx.defaultError };
|
|
3171
3187
|
}
|
|
3172
3188
|
if (typeof ctx.data === "undefined") {
|
|
3173
|
-
return { message: message
|
|
3189
|
+
return { message: (_a = message !== null && message !== void 0 ? message : required_error) !== null && _a !== void 0 ? _a : ctx.defaultError };
|
|
3174
3190
|
}
|
|
3175
3191
|
if (iss.code !== "invalid_type")
|
|
3176
3192
|
return { message: ctx.defaultError };
|
|
3177
|
-
return { message: message
|
|
3193
|
+
return { message: (_b = message !== null && message !== void 0 ? message : invalid_type_error) !== null && _b !== void 0 ? _b : ctx.defaultError };
|
|
3178
3194
|
};
|
|
3179
3195
|
return { errorMap: customMap, description };
|
|
3180
3196
|
}
|
|
@@ -3226,13 +3242,14 @@ class ZodType {
|
|
|
3226
3242
|
throw result.error;
|
|
3227
3243
|
}
|
|
3228
3244
|
safeParse(data, params) {
|
|
3245
|
+
var _a;
|
|
3229
3246
|
const ctx = {
|
|
3230
3247
|
common: {
|
|
3231
3248
|
issues: [],
|
|
3232
|
-
async: params
|
|
3233
|
-
contextualErrorMap: params
|
|
3249
|
+
async: (_a = params === null || params === void 0 ? void 0 : params.async) !== null && _a !== void 0 ? _a : false,
|
|
3250
|
+
contextualErrorMap: params === null || params === void 0 ? void 0 : params.errorMap
|
|
3234
3251
|
},
|
|
3235
|
-
path: params
|
|
3252
|
+
path: (params === null || params === void 0 ? void 0 : params.path) || [],
|
|
3236
3253
|
schemaErrorMap: this._def.errorMap,
|
|
3237
3254
|
parent: null,
|
|
3238
3255
|
data,
|
|
@@ -3242,6 +3259,7 @@ class ZodType {
|
|
|
3242
3259
|
return handleResult(ctx, result);
|
|
3243
3260
|
}
|
|
3244
3261
|
"~validate"(data) {
|
|
3262
|
+
var _a, _b;
|
|
3245
3263
|
const ctx = {
|
|
3246
3264
|
common: {
|
|
3247
3265
|
issues: [],
|
|
@@ -3262,7 +3280,7 @@ class ZodType {
|
|
|
3262
3280
|
issues: ctx.common.issues
|
|
3263
3281
|
};
|
|
3264
3282
|
} catch (err) {
|
|
3265
|
-
if (err
|
|
3283
|
+
if ((_b = (_a = err === null || err === void 0 ? void 0 : err.message) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === null || _b === void 0 ? void 0 : _b.includes("encountered")) {
|
|
3266
3284
|
this["~standard"].async = true;
|
|
3267
3285
|
}
|
|
3268
3286
|
ctx.common = {
|
|
@@ -3287,10 +3305,10 @@ class ZodType {
|
|
|
3287
3305
|
const ctx = {
|
|
3288
3306
|
common: {
|
|
3289
3307
|
issues: [],
|
|
3290
|
-
contextualErrorMap: params
|
|
3308
|
+
contextualErrorMap: params === null || params === void 0 ? void 0 : params.errorMap,
|
|
3291
3309
|
async: true
|
|
3292
3310
|
},
|
|
3293
|
-
path: params
|
|
3311
|
+
path: (params === null || params === void 0 ? void 0 : params.path) || [],
|
|
3294
3312
|
schemaErrorMap: this._def.errorMap,
|
|
3295
3313
|
parent: null,
|
|
3296
3314
|
data,
|
|
@@ -3515,20 +3533,16 @@ function isValidJWT(jwt, alg) {
|
|
|
3515
3533
|
return false;
|
|
3516
3534
|
try {
|
|
3517
3535
|
const [header] = jwt.split(".");
|
|
3518
|
-
if (!header)
|
|
3519
|
-
return false;
|
|
3520
3536
|
const base64 = header.replace(/-/g, "+").replace(/_/g, "/").padEnd(header.length + (4 - header.length % 4) % 4, "=");
|
|
3521
3537
|
const decoded = JSON.parse(atob(base64));
|
|
3522
3538
|
if (typeof decoded !== "object" || decoded === null)
|
|
3523
3539
|
return false;
|
|
3524
|
-
if (
|
|
3525
|
-
return false;
|
|
3526
|
-
if (!decoded.alg)
|
|
3540
|
+
if (!decoded.typ || !decoded.alg)
|
|
3527
3541
|
return false;
|
|
3528
3542
|
if (alg && decoded.alg !== alg)
|
|
3529
3543
|
return false;
|
|
3530
3544
|
return true;
|
|
3531
|
-
} catch {
|
|
3545
|
+
} catch (_a) {
|
|
3532
3546
|
return false;
|
|
3533
3547
|
}
|
|
3534
3548
|
}
|
|
@@ -3687,7 +3701,7 @@ class ZodString extends ZodType {
|
|
|
3687
3701
|
} else if (check.kind === "url") {
|
|
3688
3702
|
try {
|
|
3689
3703
|
new URL(input.data);
|
|
3690
|
-
} catch {
|
|
3704
|
+
} catch (_a) {
|
|
3691
3705
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
3692
3706
|
addIssueToContext(ctx, {
|
|
3693
3707
|
validation: "url",
|
|
@@ -3899,6 +3913,7 @@ class ZodString extends ZodType {
|
|
|
3899
3913
|
return this._addCheck({ kind: "cidr", ...errorUtil.errToObj(options) });
|
|
3900
3914
|
}
|
|
3901
3915
|
datetime(options) {
|
|
3916
|
+
var _a, _b;
|
|
3902
3917
|
if (typeof options === "string") {
|
|
3903
3918
|
return this._addCheck({
|
|
3904
3919
|
kind: "datetime",
|
|
@@ -3910,10 +3925,10 @@ class ZodString extends ZodType {
|
|
|
3910
3925
|
}
|
|
3911
3926
|
return this._addCheck({
|
|
3912
3927
|
kind: "datetime",
|
|
3913
|
-
precision: typeof options
|
|
3914
|
-
offset: options
|
|
3915
|
-
local: options
|
|
3916
|
-
...errorUtil.errToObj(options
|
|
3928
|
+
precision: typeof (options === null || options === void 0 ? void 0 : options.precision) === "undefined" ? null : options === null || options === void 0 ? void 0 : options.precision,
|
|
3929
|
+
offset: (_a = options === null || options === void 0 ? void 0 : options.offset) !== null && _a !== void 0 ? _a : false,
|
|
3930
|
+
local: (_b = options === null || options === void 0 ? void 0 : options.local) !== null && _b !== void 0 ? _b : false,
|
|
3931
|
+
...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message)
|
|
3917
3932
|
});
|
|
3918
3933
|
}
|
|
3919
3934
|
date(message) {
|
|
@@ -3929,8 +3944,8 @@ class ZodString extends ZodType {
|
|
|
3929
3944
|
}
|
|
3930
3945
|
return this._addCheck({
|
|
3931
3946
|
kind: "time",
|
|
3932
|
-
precision: typeof options
|
|
3933
|
-
...errorUtil.errToObj(options
|
|
3947
|
+
precision: typeof (options === null || options === void 0 ? void 0 : options.precision) === "undefined" ? null : options === null || options === void 0 ? void 0 : options.precision,
|
|
3948
|
+
...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message)
|
|
3934
3949
|
});
|
|
3935
3950
|
}
|
|
3936
3951
|
duration(message) {
|
|
@@ -3947,8 +3962,8 @@ class ZodString extends ZodType {
|
|
|
3947
3962
|
return this._addCheck({
|
|
3948
3963
|
kind: "includes",
|
|
3949
3964
|
value,
|
|
3950
|
-
position: options
|
|
3951
|
-
...errorUtil.errToObj(options
|
|
3965
|
+
position: options === null || options === void 0 ? void 0 : options.position,
|
|
3966
|
+
...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message)
|
|
3952
3967
|
});
|
|
3953
3968
|
}
|
|
3954
3969
|
startsWith(value, message) {
|
|
@@ -4080,10 +4095,11 @@ class ZodString extends ZodType {
|
|
|
4080
4095
|
}
|
|
4081
4096
|
}
|
|
4082
4097
|
ZodString.create = (params) => {
|
|
4098
|
+
var _a;
|
|
4083
4099
|
return new ZodString({
|
|
4084
4100
|
checks: [],
|
|
4085
4101
|
typeName: ZodFirstPartyTypeKind.ZodString,
|
|
4086
|
-
coerce: params
|
|
4102
|
+
coerce: (_a = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a !== void 0 ? _a : false,
|
|
4087
4103
|
...processCreateParams(params)
|
|
4088
4104
|
});
|
|
4089
4105
|
};
|
|
@@ -4091,9 +4107,9 @@ function floatSafeRemainder(val, step) {
|
|
|
4091
4107
|
const valDecCount = (val.toString().split(".")[1] || "").length;
|
|
4092
4108
|
const stepDecCount = (step.toString().split(".")[1] || "").length;
|
|
4093
4109
|
const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount;
|
|
4094
|
-
const valInt =
|
|
4095
|
-
const stepInt =
|
|
4096
|
-
return valInt % stepInt / 10
|
|
4110
|
+
const valInt = parseInt(val.toFixed(decCount).replace(".", ""));
|
|
4111
|
+
const stepInt = parseInt(step.toFixed(decCount).replace(".", ""));
|
|
4112
|
+
return valInt % stepInt / Math.pow(10, decCount);
|
|
4097
4113
|
}
|
|
4098
4114
|
class ZodNumber extends ZodType {
|
|
4099
4115
|
constructor() {
|
|
@@ -4303,8 +4319,7 @@ class ZodNumber extends ZodType {
|
|
|
4303
4319
|
return !!this._def.checks.find((ch) => ch.kind === "int" || ch.kind === "multipleOf" && util.isInteger(ch.value));
|
|
4304
4320
|
}
|
|
4305
4321
|
get isFinite() {
|
|
4306
|
-
let max2 = null;
|
|
4307
|
-
let min2 = null;
|
|
4322
|
+
let max2 = null, min2 = null;
|
|
4308
4323
|
for (const ch of this._def.checks) {
|
|
4309
4324
|
if (ch.kind === "finite" || ch.kind === "int" || ch.kind === "multipleOf") {
|
|
4310
4325
|
return true;
|
|
@@ -4323,7 +4338,7 @@ ZodNumber.create = (params) => {
|
|
|
4323
4338
|
return new ZodNumber({
|
|
4324
4339
|
checks: [],
|
|
4325
4340
|
typeName: ZodFirstPartyTypeKind.ZodNumber,
|
|
4326
|
-
coerce: params
|
|
4341
|
+
coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false,
|
|
4327
4342
|
...processCreateParams(params)
|
|
4328
4343
|
});
|
|
4329
4344
|
};
|
|
@@ -4337,7 +4352,7 @@ class ZodBigInt extends ZodType {
|
|
|
4337
4352
|
if (this._def.coerce) {
|
|
4338
4353
|
try {
|
|
4339
4354
|
input.data = BigInt(input.data);
|
|
4340
|
-
} catch {
|
|
4355
|
+
} catch (_a) {
|
|
4341
4356
|
return this._getInvalidInput(input);
|
|
4342
4357
|
}
|
|
4343
4358
|
}
|
|
@@ -4492,10 +4507,11 @@ class ZodBigInt extends ZodType {
|
|
|
4492
4507
|
}
|
|
4493
4508
|
}
|
|
4494
4509
|
ZodBigInt.create = (params) => {
|
|
4510
|
+
var _a;
|
|
4495
4511
|
return new ZodBigInt({
|
|
4496
4512
|
checks: [],
|
|
4497
4513
|
typeName: ZodFirstPartyTypeKind.ZodBigInt,
|
|
4498
|
-
coerce: params
|
|
4514
|
+
coerce: (_a = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a !== void 0 ? _a : false,
|
|
4499
4515
|
...processCreateParams(params)
|
|
4500
4516
|
});
|
|
4501
4517
|
};
|
|
@@ -4520,7 +4536,7 @@ class ZodBoolean extends ZodType {
|
|
|
4520
4536
|
ZodBoolean.create = (params) => {
|
|
4521
4537
|
return new ZodBoolean({
|
|
4522
4538
|
typeName: ZodFirstPartyTypeKind.ZodBoolean,
|
|
4523
|
-
coerce: params
|
|
4539
|
+
coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false,
|
|
4524
4540
|
...processCreateParams(params)
|
|
4525
4541
|
});
|
|
4526
4542
|
};
|
|
@@ -4539,7 +4555,7 @@ class ZodDate extends ZodType {
|
|
|
4539
4555
|
});
|
|
4540
4556
|
return INVALID;
|
|
4541
4557
|
}
|
|
4542
|
-
if (
|
|
4558
|
+
if (isNaN(input.data.getTime())) {
|
|
4543
4559
|
const ctx2 = this._getOrReturnCtx(input);
|
|
4544
4560
|
addIssueToContext(ctx2, {
|
|
4545
4561
|
code: ZodIssueCode.invalid_date
|
|
@@ -4628,7 +4644,7 @@ class ZodDate extends ZodType {
|
|
|
4628
4644
|
ZodDate.create = (params) => {
|
|
4629
4645
|
return new ZodDate({
|
|
4630
4646
|
checks: [],
|
|
4631
|
-
coerce: params
|
|
4647
|
+
coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false,
|
|
4632
4648
|
typeName: ZodFirstPartyTypeKind.ZodDate,
|
|
4633
4649
|
...processCreateParams(params)
|
|
4634
4650
|
});
|
|
@@ -4903,8 +4919,7 @@ class ZodObject extends ZodType {
|
|
|
4903
4919
|
return this._cached;
|
|
4904
4920
|
const shape = this._def.shape();
|
|
4905
4921
|
const keys2 = util.objectKeys(shape);
|
|
4906
|
-
this._cached = { shape, keys: keys2 };
|
|
4907
|
-
return this._cached;
|
|
4922
|
+
return this._cached = { shape, keys: keys2 };
|
|
4908
4923
|
}
|
|
4909
4924
|
_parse(input) {
|
|
4910
4925
|
const parsedType = this._getType(input);
|
|
@@ -5002,10 +5017,11 @@ class ZodObject extends ZodType {
|
|
|
5002
5017
|
unknownKeys: "strict",
|
|
5003
5018
|
...message !== void 0 ? {
|
|
5004
5019
|
errorMap: (issue, ctx) => {
|
|
5005
|
-
|
|
5020
|
+
var _a, _b, _c, _d;
|
|
5021
|
+
const defaultError = (_c = (_b = (_a = this._def).errorMap) === null || _b === void 0 ? void 0 : _b.call(_a, issue, ctx).message) !== null && _c !== void 0 ? _c : ctx.defaultError;
|
|
5006
5022
|
if (issue.code === "unrecognized_keys")
|
|
5007
5023
|
return {
|
|
5008
|
-
message: errorUtil.errToObj(message).message
|
|
5024
|
+
message: (_d = errorUtil.errToObj(message).message) !== null && _d !== void 0 ? _d : defaultError
|
|
5009
5025
|
};
|
|
5010
5026
|
return {
|
|
5011
5027
|
message: defaultError
|
|
@@ -5136,11 +5152,11 @@ class ZodObject extends ZodType {
|
|
|
5136
5152
|
}
|
|
5137
5153
|
pick(mask) {
|
|
5138
5154
|
const shape = {};
|
|
5139
|
-
|
|
5155
|
+
util.objectKeys(mask).forEach((key) => {
|
|
5140
5156
|
if (mask[key] && this.shape[key]) {
|
|
5141
5157
|
shape[key] = this.shape[key];
|
|
5142
5158
|
}
|
|
5143
|
-
}
|
|
5159
|
+
});
|
|
5144
5160
|
return new ZodObject({
|
|
5145
5161
|
...this._def,
|
|
5146
5162
|
shape: () => shape
|
|
@@ -5148,11 +5164,11 @@ class ZodObject extends ZodType {
|
|
|
5148
5164
|
}
|
|
5149
5165
|
omit(mask) {
|
|
5150
5166
|
const shape = {};
|
|
5151
|
-
|
|
5167
|
+
util.objectKeys(this.shape).forEach((key) => {
|
|
5152
5168
|
if (!mask[key]) {
|
|
5153
5169
|
shape[key] = this.shape[key];
|
|
5154
5170
|
}
|
|
5155
|
-
}
|
|
5171
|
+
});
|
|
5156
5172
|
return new ZodObject({
|
|
5157
5173
|
...this._def,
|
|
5158
5174
|
shape: () => shape
|
|
@@ -5166,14 +5182,14 @@ class ZodObject extends ZodType {
|
|
|
5166
5182
|
}
|
|
5167
5183
|
partial(mask) {
|
|
5168
5184
|
const newShape = {};
|
|
5169
|
-
|
|
5185
|
+
util.objectKeys(this.shape).forEach((key) => {
|
|
5170
5186
|
const fieldSchema = this.shape[key];
|
|
5171
5187
|
if (mask && !mask[key]) {
|
|
5172
5188
|
newShape[key] = fieldSchema;
|
|
5173
5189
|
} else {
|
|
5174
5190
|
newShape[key] = fieldSchema.optional();
|
|
5175
5191
|
}
|
|
5176
|
-
}
|
|
5192
|
+
});
|
|
5177
5193
|
return new ZodObject({
|
|
5178
5194
|
...this._def,
|
|
5179
5195
|
shape: () => newShape
|
|
@@ -5181,7 +5197,7 @@ class ZodObject extends ZodType {
|
|
|
5181
5197
|
}
|
|
5182
5198
|
required(mask) {
|
|
5183
5199
|
const newShape = {};
|
|
5184
|
-
|
|
5200
|
+
util.objectKeys(this.shape).forEach((key) => {
|
|
5185
5201
|
if (mask && !mask[key]) {
|
|
5186
5202
|
newShape[key] = this.shape[key];
|
|
5187
5203
|
} else {
|
|
@@ -5192,7 +5208,7 @@ class ZodObject extends ZodType {
|
|
|
5192
5208
|
}
|
|
5193
5209
|
newShape[key] = newField;
|
|
5194
5210
|
}
|
|
5195
|
-
}
|
|
5211
|
+
});
|
|
5196
5212
|
return new ZodObject({
|
|
5197
5213
|
...this._def,
|
|
5198
5214
|
shape: () => newShape
|
|
@@ -5320,6 +5336,113 @@ ZodUnion.create = (types, params) => {
|
|
|
5320
5336
|
...processCreateParams(params)
|
|
5321
5337
|
});
|
|
5322
5338
|
};
|
|
5339
|
+
const getDiscriminator = (type) => {
|
|
5340
|
+
if (type instanceof ZodLazy) {
|
|
5341
|
+
return getDiscriminator(type.schema);
|
|
5342
|
+
} else if (type instanceof ZodEffects) {
|
|
5343
|
+
return getDiscriminator(type.innerType());
|
|
5344
|
+
} else if (type instanceof ZodLiteral) {
|
|
5345
|
+
return [type.value];
|
|
5346
|
+
} else if (type instanceof ZodEnum) {
|
|
5347
|
+
return type.options;
|
|
5348
|
+
} else if (type instanceof ZodNativeEnum) {
|
|
5349
|
+
return util.objectValues(type.enum);
|
|
5350
|
+
} else if (type instanceof ZodDefault) {
|
|
5351
|
+
return getDiscriminator(type._def.innerType);
|
|
5352
|
+
} else if (type instanceof ZodUndefined) {
|
|
5353
|
+
return [void 0];
|
|
5354
|
+
} else if (type instanceof ZodNull) {
|
|
5355
|
+
return [null];
|
|
5356
|
+
} else if (type instanceof ZodOptional) {
|
|
5357
|
+
return [void 0, ...getDiscriminator(type.unwrap())];
|
|
5358
|
+
} else if (type instanceof ZodNullable) {
|
|
5359
|
+
return [null, ...getDiscriminator(type.unwrap())];
|
|
5360
|
+
} else if (type instanceof ZodBranded) {
|
|
5361
|
+
return getDiscriminator(type.unwrap());
|
|
5362
|
+
} else if (type instanceof ZodReadonly) {
|
|
5363
|
+
return getDiscriminator(type.unwrap());
|
|
5364
|
+
} else if (type instanceof ZodCatch) {
|
|
5365
|
+
return getDiscriminator(type._def.innerType);
|
|
5366
|
+
} else {
|
|
5367
|
+
return [];
|
|
5368
|
+
}
|
|
5369
|
+
};
|
|
5370
|
+
class ZodDiscriminatedUnion extends ZodType {
|
|
5371
|
+
_parse(input) {
|
|
5372
|
+
const { ctx } = this._processInputParams(input);
|
|
5373
|
+
if (ctx.parsedType !== ZodParsedType.object) {
|
|
5374
|
+
addIssueToContext(ctx, {
|
|
5375
|
+
code: ZodIssueCode.invalid_type,
|
|
5376
|
+
expected: ZodParsedType.object,
|
|
5377
|
+
received: ctx.parsedType
|
|
5378
|
+
});
|
|
5379
|
+
return INVALID;
|
|
5380
|
+
}
|
|
5381
|
+
const discriminator = this.discriminator;
|
|
5382
|
+
const discriminatorValue = ctx.data[discriminator];
|
|
5383
|
+
const option = this.optionsMap.get(discriminatorValue);
|
|
5384
|
+
if (!option) {
|
|
5385
|
+
addIssueToContext(ctx, {
|
|
5386
|
+
code: ZodIssueCode.invalid_union_discriminator,
|
|
5387
|
+
options: Array.from(this.optionsMap.keys()),
|
|
5388
|
+
path: [discriminator]
|
|
5389
|
+
});
|
|
5390
|
+
return INVALID;
|
|
5391
|
+
}
|
|
5392
|
+
if (ctx.common.async) {
|
|
5393
|
+
return option._parseAsync({
|
|
5394
|
+
data: ctx.data,
|
|
5395
|
+
path: ctx.path,
|
|
5396
|
+
parent: ctx
|
|
5397
|
+
});
|
|
5398
|
+
} else {
|
|
5399
|
+
return option._parseSync({
|
|
5400
|
+
data: ctx.data,
|
|
5401
|
+
path: ctx.path,
|
|
5402
|
+
parent: ctx
|
|
5403
|
+
});
|
|
5404
|
+
}
|
|
5405
|
+
}
|
|
5406
|
+
get discriminator() {
|
|
5407
|
+
return this._def.discriminator;
|
|
5408
|
+
}
|
|
5409
|
+
get options() {
|
|
5410
|
+
return this._def.options;
|
|
5411
|
+
}
|
|
5412
|
+
get optionsMap() {
|
|
5413
|
+
return this._def.optionsMap;
|
|
5414
|
+
}
|
|
5415
|
+
/**
|
|
5416
|
+
* The constructor of the discriminated union schema. Its behaviour is very similar to that of the normal z.union() constructor.
|
|
5417
|
+
* However, it only allows a union of objects, all of which need to share a discriminator property. This property must
|
|
5418
|
+
* have a different value for each object in the union.
|
|
5419
|
+
* @param discriminator the name of the discriminator property
|
|
5420
|
+
* @param types an array of object schemas
|
|
5421
|
+
* @param params
|
|
5422
|
+
*/
|
|
5423
|
+
static create(discriminator, options, params) {
|
|
5424
|
+
const optionsMap = /* @__PURE__ */ new Map();
|
|
5425
|
+
for (const type of options) {
|
|
5426
|
+
const discriminatorValues = getDiscriminator(type.shape[discriminator]);
|
|
5427
|
+
if (!discriminatorValues.length) {
|
|
5428
|
+
throw new Error(`A discriminator value for key \`${discriminator}\` could not be extracted from all schema options`);
|
|
5429
|
+
}
|
|
5430
|
+
for (const value of discriminatorValues) {
|
|
5431
|
+
if (optionsMap.has(value)) {
|
|
5432
|
+
throw new Error(`Discriminator property ${String(discriminator)} has duplicate value ${String(value)}`);
|
|
5433
|
+
}
|
|
5434
|
+
optionsMap.set(value, type);
|
|
5435
|
+
}
|
|
5436
|
+
}
|
|
5437
|
+
return new ZodDiscriminatedUnion({
|
|
5438
|
+
typeName: ZodFirstPartyTypeKind.ZodDiscriminatedUnion,
|
|
5439
|
+
discriminator,
|
|
5440
|
+
options,
|
|
5441
|
+
optionsMap,
|
|
5442
|
+
...processCreateParams(params)
|
|
5443
|
+
});
|
|
5444
|
+
}
|
|
5445
|
+
}
|
|
5323
5446
|
function mergeValues(a, b) {
|
|
5324
5447
|
const aType = getParsedType(a);
|
|
5325
5448
|
const bType = getParsedType(b);
|
|
@@ -5478,6 +5601,59 @@ ZodTuple.create = (schemas, params) => {
|
|
|
5478
5601
|
...processCreateParams(params)
|
|
5479
5602
|
});
|
|
5480
5603
|
};
|
|
5604
|
+
class ZodRecord extends ZodType {
|
|
5605
|
+
get keySchema() {
|
|
5606
|
+
return this._def.keyType;
|
|
5607
|
+
}
|
|
5608
|
+
get valueSchema() {
|
|
5609
|
+
return this._def.valueType;
|
|
5610
|
+
}
|
|
5611
|
+
_parse(input) {
|
|
5612
|
+
const { status, ctx } = this._processInputParams(input);
|
|
5613
|
+
if (ctx.parsedType !== ZodParsedType.object) {
|
|
5614
|
+
addIssueToContext(ctx, {
|
|
5615
|
+
code: ZodIssueCode.invalid_type,
|
|
5616
|
+
expected: ZodParsedType.object,
|
|
5617
|
+
received: ctx.parsedType
|
|
5618
|
+
});
|
|
5619
|
+
return INVALID;
|
|
5620
|
+
}
|
|
5621
|
+
const pairs = [];
|
|
5622
|
+
const keyType = this._def.keyType;
|
|
5623
|
+
const valueType = this._def.valueType;
|
|
5624
|
+
for (const key in ctx.data) {
|
|
5625
|
+
pairs.push({
|
|
5626
|
+
key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, key)),
|
|
5627
|
+
value: valueType._parse(new ParseInputLazyPath(ctx, ctx.data[key], ctx.path, key)),
|
|
5628
|
+
alwaysSet: key in ctx.data
|
|
5629
|
+
});
|
|
5630
|
+
}
|
|
5631
|
+
if (ctx.common.async) {
|
|
5632
|
+
return ParseStatus.mergeObjectAsync(status, pairs);
|
|
5633
|
+
} else {
|
|
5634
|
+
return ParseStatus.mergeObjectSync(status, pairs);
|
|
5635
|
+
}
|
|
5636
|
+
}
|
|
5637
|
+
get element() {
|
|
5638
|
+
return this._def.valueType;
|
|
5639
|
+
}
|
|
5640
|
+
static create(first, second, third) {
|
|
5641
|
+
if (second instanceof ZodType) {
|
|
5642
|
+
return new ZodRecord({
|
|
5643
|
+
keyType: first,
|
|
5644
|
+
valueType: second,
|
|
5645
|
+
typeName: ZodFirstPartyTypeKind.ZodRecord,
|
|
5646
|
+
...processCreateParams(third)
|
|
5647
|
+
});
|
|
5648
|
+
}
|
|
5649
|
+
return new ZodRecord({
|
|
5650
|
+
keyType: ZodString.create(),
|
|
5651
|
+
valueType: first,
|
|
5652
|
+
typeName: ZodFirstPartyTypeKind.ZodRecord,
|
|
5653
|
+
...processCreateParams(second)
|
|
5654
|
+
});
|
|
5655
|
+
}
|
|
5656
|
+
}
|
|
5481
5657
|
class ZodMap extends ZodType {
|
|
5482
5658
|
get keySchema() {
|
|
5483
5659
|
return this._def.keyType;
|
|
@@ -5629,6 +5805,121 @@ ZodSet.create = (valueType, params) => {
|
|
|
5629
5805
|
...processCreateParams(params)
|
|
5630
5806
|
});
|
|
5631
5807
|
};
|
|
5808
|
+
class ZodFunction extends ZodType {
|
|
5809
|
+
constructor() {
|
|
5810
|
+
super(...arguments);
|
|
5811
|
+
this.validate = this.implement;
|
|
5812
|
+
}
|
|
5813
|
+
_parse(input) {
|
|
5814
|
+
const { ctx } = this._processInputParams(input);
|
|
5815
|
+
if (ctx.parsedType !== ZodParsedType.function) {
|
|
5816
|
+
addIssueToContext(ctx, {
|
|
5817
|
+
code: ZodIssueCode.invalid_type,
|
|
5818
|
+
expected: ZodParsedType.function,
|
|
5819
|
+
received: ctx.parsedType
|
|
5820
|
+
});
|
|
5821
|
+
return INVALID;
|
|
5822
|
+
}
|
|
5823
|
+
function makeArgsIssue(args, error) {
|
|
5824
|
+
return makeIssue({
|
|
5825
|
+
data: args,
|
|
5826
|
+
path: ctx.path,
|
|
5827
|
+
errorMaps: [
|
|
5828
|
+
ctx.common.contextualErrorMap,
|
|
5829
|
+
ctx.schemaErrorMap,
|
|
5830
|
+
getErrorMap(),
|
|
5831
|
+
errorMap
|
|
5832
|
+
].filter((x) => !!x),
|
|
5833
|
+
issueData: {
|
|
5834
|
+
code: ZodIssueCode.invalid_arguments,
|
|
5835
|
+
argumentsError: error
|
|
5836
|
+
}
|
|
5837
|
+
});
|
|
5838
|
+
}
|
|
5839
|
+
function makeReturnsIssue(returns, error) {
|
|
5840
|
+
return makeIssue({
|
|
5841
|
+
data: returns,
|
|
5842
|
+
path: ctx.path,
|
|
5843
|
+
errorMaps: [
|
|
5844
|
+
ctx.common.contextualErrorMap,
|
|
5845
|
+
ctx.schemaErrorMap,
|
|
5846
|
+
getErrorMap(),
|
|
5847
|
+
errorMap
|
|
5848
|
+
].filter((x) => !!x),
|
|
5849
|
+
issueData: {
|
|
5850
|
+
code: ZodIssueCode.invalid_return_type,
|
|
5851
|
+
returnTypeError: error
|
|
5852
|
+
}
|
|
5853
|
+
});
|
|
5854
|
+
}
|
|
5855
|
+
const params = { errorMap: ctx.common.contextualErrorMap };
|
|
5856
|
+
const fn = ctx.data;
|
|
5857
|
+
if (this._def.returns instanceof ZodPromise) {
|
|
5858
|
+
const me = this;
|
|
5859
|
+
return OK(async function(...args) {
|
|
5860
|
+
const error = new ZodError([]);
|
|
5861
|
+
const parsedArgs = await me._def.args.parseAsync(args, params).catch((e) => {
|
|
5862
|
+
error.addIssue(makeArgsIssue(args, e));
|
|
5863
|
+
throw error;
|
|
5864
|
+
});
|
|
5865
|
+
const result = await Reflect.apply(fn, this, parsedArgs);
|
|
5866
|
+
const parsedReturns = await me._def.returns._def.type.parseAsync(result, params).catch((e) => {
|
|
5867
|
+
error.addIssue(makeReturnsIssue(result, e));
|
|
5868
|
+
throw error;
|
|
5869
|
+
});
|
|
5870
|
+
return parsedReturns;
|
|
5871
|
+
});
|
|
5872
|
+
} else {
|
|
5873
|
+
const me = this;
|
|
5874
|
+
return OK(function(...args) {
|
|
5875
|
+
const parsedArgs = me._def.args.safeParse(args, params);
|
|
5876
|
+
if (!parsedArgs.success) {
|
|
5877
|
+
throw new ZodError([makeArgsIssue(args, parsedArgs.error)]);
|
|
5878
|
+
}
|
|
5879
|
+
const result = Reflect.apply(fn, this, parsedArgs.data);
|
|
5880
|
+
const parsedReturns = me._def.returns.safeParse(result, params);
|
|
5881
|
+
if (!parsedReturns.success) {
|
|
5882
|
+
throw new ZodError([makeReturnsIssue(result, parsedReturns.error)]);
|
|
5883
|
+
}
|
|
5884
|
+
return parsedReturns.data;
|
|
5885
|
+
});
|
|
5886
|
+
}
|
|
5887
|
+
}
|
|
5888
|
+
parameters() {
|
|
5889
|
+
return this._def.args;
|
|
5890
|
+
}
|
|
5891
|
+
returnType() {
|
|
5892
|
+
return this._def.returns;
|
|
5893
|
+
}
|
|
5894
|
+
args(...items) {
|
|
5895
|
+
return new ZodFunction({
|
|
5896
|
+
...this._def,
|
|
5897
|
+
args: ZodTuple.create(items).rest(ZodUnknown.create())
|
|
5898
|
+
});
|
|
5899
|
+
}
|
|
5900
|
+
returns(returnType) {
|
|
5901
|
+
return new ZodFunction({
|
|
5902
|
+
...this._def,
|
|
5903
|
+
returns: returnType
|
|
5904
|
+
});
|
|
5905
|
+
}
|
|
5906
|
+
implement(func) {
|
|
5907
|
+
const validatedFunc = this.parse(func);
|
|
5908
|
+
return validatedFunc;
|
|
5909
|
+
}
|
|
5910
|
+
strictImplement(func) {
|
|
5911
|
+
const validatedFunc = this.parse(func);
|
|
5912
|
+
return validatedFunc;
|
|
5913
|
+
}
|
|
5914
|
+
static create(args, returns, params) {
|
|
5915
|
+
return new ZodFunction({
|
|
5916
|
+
args: args ? args : ZodTuple.create([]).rest(ZodUnknown.create()),
|
|
5917
|
+
returns: returns || ZodUnknown.create(),
|
|
5918
|
+
typeName: ZodFirstPartyTypeKind.ZodFunction,
|
|
5919
|
+
...processCreateParams(params)
|
|
5920
|
+
});
|
|
5921
|
+
}
|
|
5922
|
+
}
|
|
5632
5923
|
class ZodLazy extends ZodType {
|
|
5633
5924
|
get schema() {
|
|
5634
5925
|
return this._def.getter();
|
|
@@ -5678,6 +5969,10 @@ function createZodEnum(values, params) {
|
|
|
5678
5969
|
});
|
|
5679
5970
|
}
|
|
5680
5971
|
class ZodEnum extends ZodType {
|
|
5972
|
+
constructor() {
|
|
5973
|
+
super(...arguments);
|
|
5974
|
+
_ZodEnum_cache.set(this, void 0);
|
|
5975
|
+
}
|
|
5681
5976
|
_parse(input) {
|
|
5682
5977
|
if (typeof input.data !== "string") {
|
|
5683
5978
|
const ctx = this._getOrReturnCtx(input);
|
|
@@ -5689,10 +5984,10 @@ class ZodEnum extends ZodType {
|
|
|
5689
5984
|
});
|
|
5690
5985
|
return INVALID;
|
|
5691
5986
|
}
|
|
5692
|
-
if (!this
|
|
5693
|
-
this
|
|
5987
|
+
if (!__classPrivateFieldGet(this, _ZodEnum_cache)) {
|
|
5988
|
+
__classPrivateFieldSet(this, _ZodEnum_cache, new Set(this._def.values));
|
|
5694
5989
|
}
|
|
5695
|
-
if (!this.
|
|
5990
|
+
if (!__classPrivateFieldGet(this, _ZodEnum_cache).has(input.data)) {
|
|
5696
5991
|
const ctx = this._getOrReturnCtx(input);
|
|
5697
5992
|
const expectedValues = this._def.values;
|
|
5698
5993
|
addIssueToContext(ctx, {
|
|
@@ -5741,8 +6036,13 @@ class ZodEnum extends ZodType {
|
|
|
5741
6036
|
});
|
|
5742
6037
|
}
|
|
5743
6038
|
}
|
|
6039
|
+
_ZodEnum_cache = /* @__PURE__ */ new WeakMap();
|
|
5744
6040
|
ZodEnum.create = createZodEnum;
|
|
5745
6041
|
class ZodNativeEnum extends ZodType {
|
|
6042
|
+
constructor() {
|
|
6043
|
+
super(...arguments);
|
|
6044
|
+
_ZodNativeEnum_cache.set(this, void 0);
|
|
6045
|
+
}
|
|
5746
6046
|
_parse(input) {
|
|
5747
6047
|
const nativeEnumValues = util.getValidEnumValues(this._def.values);
|
|
5748
6048
|
const ctx = this._getOrReturnCtx(input);
|
|
@@ -5755,10 +6055,10 @@ class ZodNativeEnum extends ZodType {
|
|
|
5755
6055
|
});
|
|
5756
6056
|
return INVALID;
|
|
5757
6057
|
}
|
|
5758
|
-
if (!this
|
|
5759
|
-
this
|
|
6058
|
+
if (!__classPrivateFieldGet(this, _ZodNativeEnum_cache)) {
|
|
6059
|
+
__classPrivateFieldSet(this, _ZodNativeEnum_cache, new Set(util.getValidEnumValues(this._def.values)));
|
|
5760
6060
|
}
|
|
5761
|
-
if (!this.
|
|
6061
|
+
if (!__classPrivateFieldGet(this, _ZodNativeEnum_cache).has(input.data)) {
|
|
5762
6062
|
const expectedValues = util.objectValues(nativeEnumValues);
|
|
5763
6063
|
addIssueToContext(ctx, {
|
|
5764
6064
|
received: ctx.data,
|
|
@@ -5773,6 +6073,7 @@ class ZodNativeEnum extends ZodType {
|
|
|
5773
6073
|
return this._def.values;
|
|
5774
6074
|
}
|
|
5775
6075
|
}
|
|
6076
|
+
_ZodNativeEnum_cache = /* @__PURE__ */ new WeakMap();
|
|
5776
6077
|
ZodNativeEnum.create = (values, params) => {
|
|
5777
6078
|
return new ZodNativeEnum({
|
|
5778
6079
|
values,
|
|
@@ -5913,7 +6214,7 @@ class ZodEffects extends ZodType {
|
|
|
5913
6214
|
parent: ctx
|
|
5914
6215
|
});
|
|
5915
6216
|
if (!isValid$3(base))
|
|
5916
|
-
return
|
|
6217
|
+
return base;
|
|
5917
6218
|
const result = effect.transform(base.value, checkCtx);
|
|
5918
6219
|
if (result instanceof Promise) {
|
|
5919
6220
|
throw new Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);
|
|
@@ -5922,11 +6223,8 @@ class ZodEffects extends ZodType {
|
|
|
5922
6223
|
} else {
|
|
5923
6224
|
return this._def.schema._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx }).then((base) => {
|
|
5924
6225
|
if (!isValid$3(base))
|
|
5925
|
-
return
|
|
5926
|
-
return Promise.resolve(effect.transform(base.value, checkCtx)).then((result) => ({
|
|
5927
|
-
status: status.value,
|
|
5928
|
-
value: result
|
|
5929
|
-
}));
|
|
6226
|
+
return base;
|
|
6227
|
+
return Promise.resolve(effect.transform(base.value, checkCtx)).then((result) => ({ status: status.value, value: result }));
|
|
5930
6228
|
});
|
|
5931
6229
|
}
|
|
5932
6230
|
}
|
|
@@ -6086,6 +6384,7 @@ ZodNaN.create = (params) => {
|
|
|
6086
6384
|
...processCreateParams(params)
|
|
6087
6385
|
});
|
|
6088
6386
|
};
|
|
6387
|
+
const BRAND = Symbol("zod_brand");
|
|
6089
6388
|
class ZodBranded extends ZodType {
|
|
6090
6389
|
_parse(input) {
|
|
6091
6390
|
const { ctx } = this._processInputParams(input);
|
|
@@ -6177,6 +6476,38 @@ ZodReadonly.create = (type, params) => {
|
|
|
6177
6476
|
...processCreateParams(params)
|
|
6178
6477
|
});
|
|
6179
6478
|
};
|
|
6479
|
+
function cleanParams(params, data) {
|
|
6480
|
+
const p = typeof params === "function" ? params(data) : typeof params === "string" ? { message: params } : params;
|
|
6481
|
+
const p2 = typeof p === "string" ? { message: p } : p;
|
|
6482
|
+
return p2;
|
|
6483
|
+
}
|
|
6484
|
+
function custom(check, _params = {}, fatal) {
|
|
6485
|
+
if (check)
|
|
6486
|
+
return ZodAny.create().superRefine((data, ctx) => {
|
|
6487
|
+
var _a, _b;
|
|
6488
|
+
const r = check(data);
|
|
6489
|
+
if (r instanceof Promise) {
|
|
6490
|
+
return r.then((r2) => {
|
|
6491
|
+
var _a2, _b2;
|
|
6492
|
+
if (!r2) {
|
|
6493
|
+
const params = cleanParams(_params, data);
|
|
6494
|
+
const _fatal = (_b2 = (_a2 = params.fatal) !== null && _a2 !== void 0 ? _a2 : fatal) !== null && _b2 !== void 0 ? _b2 : true;
|
|
6495
|
+
ctx.addIssue({ code: "custom", ...params, fatal: _fatal });
|
|
6496
|
+
}
|
|
6497
|
+
});
|
|
6498
|
+
}
|
|
6499
|
+
if (!r) {
|
|
6500
|
+
const params = cleanParams(_params, data);
|
|
6501
|
+
const _fatal = (_b = (_a = params.fatal) !== null && _a !== void 0 ? _a : fatal) !== null && _b !== void 0 ? _b : true;
|
|
6502
|
+
ctx.addIssue({ code: "custom", ...params, fatal: _fatal });
|
|
6503
|
+
}
|
|
6504
|
+
return;
|
|
6505
|
+
});
|
|
6506
|
+
return ZodAny.create();
|
|
6507
|
+
}
|
|
6508
|
+
const late = {
|
|
6509
|
+
object: ZodObject.lazycreate
|
|
6510
|
+
};
|
|
6180
6511
|
var ZodFirstPartyTypeKind;
|
|
6181
6512
|
(function(ZodFirstPartyTypeKind2) {
|
|
6182
6513
|
ZodFirstPartyTypeKind2["ZodString"] = "ZodString";
|
|
@@ -6216,20 +6547,177 @@ var ZodFirstPartyTypeKind;
|
|
|
6216
6547
|
ZodFirstPartyTypeKind2["ZodPipeline"] = "ZodPipeline";
|
|
6217
6548
|
ZodFirstPartyTypeKind2["ZodReadonly"] = "ZodReadonly";
|
|
6218
6549
|
})(ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {}));
|
|
6550
|
+
const instanceOfType = (cls, params = {
|
|
6551
|
+
message: `Input not instance of ${cls.name}`
|
|
6552
|
+
}) => custom((data) => data instanceof cls, params);
|
|
6219
6553
|
const stringType = ZodString.create;
|
|
6220
|
-
|
|
6221
|
-
|
|
6222
|
-
|
|
6223
|
-
|
|
6224
|
-
|
|
6225
|
-
|
|
6226
|
-
|
|
6227
|
-
|
|
6228
|
-
|
|
6554
|
+
const numberType = ZodNumber.create;
|
|
6555
|
+
const nanType = ZodNaN.create;
|
|
6556
|
+
const bigIntType = ZodBigInt.create;
|
|
6557
|
+
const booleanType = ZodBoolean.create;
|
|
6558
|
+
const dateType = ZodDate.create;
|
|
6559
|
+
const symbolType = ZodSymbol.create;
|
|
6560
|
+
const undefinedType = ZodUndefined.create;
|
|
6561
|
+
const nullType = ZodNull.create;
|
|
6562
|
+
const anyType = ZodAny.create;
|
|
6563
|
+
const unknownType = ZodUnknown.create;
|
|
6564
|
+
const neverType = ZodNever.create;
|
|
6565
|
+
const voidType = ZodVoid.create;
|
|
6566
|
+
const arrayType = ZodArray.create;
|
|
6567
|
+
const objectType = ZodObject.create;
|
|
6568
|
+
const strictObjectType = ZodObject.strictCreate;
|
|
6569
|
+
const unionType = ZodUnion.create;
|
|
6570
|
+
const discriminatedUnionType = ZodDiscriminatedUnion.create;
|
|
6571
|
+
const intersectionType = ZodIntersection.create;
|
|
6572
|
+
const tupleType = ZodTuple.create;
|
|
6573
|
+
const recordType = ZodRecord.create;
|
|
6574
|
+
const mapType = ZodMap.create;
|
|
6575
|
+
const setType = ZodSet.create;
|
|
6576
|
+
const functionType = ZodFunction.create;
|
|
6577
|
+
const lazyType = ZodLazy.create;
|
|
6578
|
+
const literalType = ZodLiteral.create;
|
|
6579
|
+
const enumType = ZodEnum.create;
|
|
6580
|
+
const nativeEnumType = ZodNativeEnum.create;
|
|
6581
|
+
const promiseType = ZodPromise.create;
|
|
6582
|
+
const effectsType = ZodEffects.create;
|
|
6583
|
+
const optionalType = ZodOptional.create;
|
|
6584
|
+
const nullableType = ZodNullable.create;
|
|
6585
|
+
const preprocessType = ZodEffects.createWithPreprocess;
|
|
6586
|
+
const pipelineType = ZodPipeline.create;
|
|
6587
|
+
const ostring = () => stringType().optional();
|
|
6588
|
+
const onumber = () => numberType().optional();
|
|
6589
|
+
const oboolean = () => booleanType().optional();
|
|
6590
|
+
const coerce = {
|
|
6591
|
+
string: (arg) => ZodString.create({ ...arg, coerce: true }),
|
|
6592
|
+
number: (arg) => ZodNumber.create({ ...arg, coerce: true }),
|
|
6593
|
+
boolean: (arg) => ZodBoolean.create({
|
|
6594
|
+
...arg,
|
|
6595
|
+
coerce: true
|
|
6596
|
+
}),
|
|
6597
|
+
bigint: (arg) => ZodBigInt.create({ ...arg, coerce: true }),
|
|
6598
|
+
date: (arg) => ZodDate.create({ ...arg, coerce: true })
|
|
6599
|
+
};
|
|
6600
|
+
const NEVER = INVALID;
|
|
6601
|
+
var z = /* @__PURE__ */ Object.freeze({
|
|
6602
|
+
__proto__: null,
|
|
6603
|
+
defaultErrorMap: errorMap,
|
|
6604
|
+
setErrorMap,
|
|
6605
|
+
getErrorMap,
|
|
6606
|
+
makeIssue,
|
|
6607
|
+
EMPTY_PATH,
|
|
6608
|
+
addIssueToContext,
|
|
6609
|
+
ParseStatus,
|
|
6610
|
+
INVALID,
|
|
6611
|
+
DIRTY,
|
|
6612
|
+
OK,
|
|
6613
|
+
isAborted,
|
|
6614
|
+
isDirty,
|
|
6615
|
+
isValid: isValid$3,
|
|
6616
|
+
isAsync,
|
|
6617
|
+
get util() {
|
|
6618
|
+
return util;
|
|
6619
|
+
},
|
|
6620
|
+
get objectUtil() {
|
|
6621
|
+
return objectUtil;
|
|
6622
|
+
},
|
|
6623
|
+
ZodParsedType,
|
|
6624
|
+
getParsedType,
|
|
6625
|
+
ZodType,
|
|
6626
|
+
datetimeRegex,
|
|
6627
|
+
ZodString,
|
|
6628
|
+
ZodNumber,
|
|
6629
|
+
ZodBigInt,
|
|
6630
|
+
ZodBoolean,
|
|
6631
|
+
ZodDate,
|
|
6632
|
+
ZodSymbol,
|
|
6633
|
+
ZodUndefined,
|
|
6634
|
+
ZodNull,
|
|
6635
|
+
ZodAny,
|
|
6636
|
+
ZodUnknown,
|
|
6637
|
+
ZodNever,
|
|
6638
|
+
ZodVoid,
|
|
6639
|
+
ZodArray,
|
|
6640
|
+
ZodObject,
|
|
6641
|
+
ZodUnion,
|
|
6642
|
+
ZodDiscriminatedUnion,
|
|
6643
|
+
ZodIntersection,
|
|
6644
|
+
ZodTuple,
|
|
6645
|
+
ZodRecord,
|
|
6646
|
+
ZodMap,
|
|
6647
|
+
ZodSet,
|
|
6648
|
+
ZodFunction,
|
|
6649
|
+
ZodLazy,
|
|
6650
|
+
ZodLiteral,
|
|
6651
|
+
ZodEnum,
|
|
6652
|
+
ZodNativeEnum,
|
|
6653
|
+
ZodPromise,
|
|
6654
|
+
ZodEffects,
|
|
6655
|
+
ZodTransformer: ZodEffects,
|
|
6656
|
+
ZodOptional,
|
|
6657
|
+
ZodNullable,
|
|
6658
|
+
ZodDefault,
|
|
6659
|
+
ZodCatch,
|
|
6660
|
+
ZodNaN,
|
|
6661
|
+
BRAND,
|
|
6662
|
+
ZodBranded,
|
|
6663
|
+
ZodPipeline,
|
|
6664
|
+
ZodReadonly,
|
|
6665
|
+
custom,
|
|
6666
|
+
Schema: ZodType,
|
|
6667
|
+
ZodSchema: ZodType,
|
|
6668
|
+
late,
|
|
6669
|
+
get ZodFirstPartyTypeKind() {
|
|
6670
|
+
return ZodFirstPartyTypeKind;
|
|
6671
|
+
},
|
|
6672
|
+
coerce,
|
|
6673
|
+
any: anyType,
|
|
6674
|
+
array: arrayType,
|
|
6675
|
+
bigint: bigIntType,
|
|
6676
|
+
boolean: booleanType,
|
|
6677
|
+
date: dateType,
|
|
6678
|
+
discriminatedUnion: discriminatedUnionType,
|
|
6679
|
+
effect: effectsType,
|
|
6680
|
+
"enum": enumType,
|
|
6681
|
+
"function": functionType,
|
|
6682
|
+
"instanceof": instanceOfType,
|
|
6683
|
+
intersection: intersectionType,
|
|
6684
|
+
lazy: lazyType,
|
|
6685
|
+
literal: literalType,
|
|
6686
|
+
map: mapType,
|
|
6687
|
+
nan: nanType,
|
|
6688
|
+
nativeEnum: nativeEnumType,
|
|
6689
|
+
never: neverType,
|
|
6690
|
+
"null": nullType,
|
|
6691
|
+
nullable: nullableType,
|
|
6692
|
+
number: numberType,
|
|
6693
|
+
object: objectType,
|
|
6694
|
+
oboolean,
|
|
6695
|
+
onumber,
|
|
6696
|
+
optional: optionalType,
|
|
6697
|
+
ostring,
|
|
6698
|
+
pipeline: pipelineType,
|
|
6699
|
+
preprocess: preprocessType,
|
|
6700
|
+
promise: promiseType,
|
|
6701
|
+
record: recordType,
|
|
6702
|
+
set: setType,
|
|
6703
|
+
strictObject: strictObjectType,
|
|
6704
|
+
string: stringType,
|
|
6705
|
+
symbol: symbolType,
|
|
6706
|
+
transformer: effectsType,
|
|
6707
|
+
tuple: tupleType,
|
|
6708
|
+
"undefined": undefinedType,
|
|
6709
|
+
union: unionType,
|
|
6710
|
+
unknown: unknownType,
|
|
6711
|
+
"void": voidType,
|
|
6712
|
+
NEVER,
|
|
6713
|
+
ZodIssueCode,
|
|
6714
|
+
quotelessJson,
|
|
6715
|
+
ZodError
|
|
6716
|
+
});
|
|
6229
6717
|
const __vite_import_meta_env__ = { "BASE_URL": "/", "DEV": false, "MODE": "development", "PROD": true, "SSR": false, "VITE_MODULES_CARDS_ADMIN_FRONTEND_BASE_URL": "https://dev-sso.6seconds.org", "VITE_MODULES_CARDS_HOME_FRONTEND_BASE_URL": "https://dev-sso.6seconds.org", "VITE_MODULES_CERT_FRONTEND_BASE_URL": "https://dev-sso.6seconds.org", "VITE_MODULES_ENV": "dev", "VITE_MODULES_EVENTS_FRONTEND_BASE_URL": "https://dev-sso.6seconds.org", "VITE_MODULES_SSO_BACKEND_BASE_URL": "https://dev-ssoapi.6seconds.org", "VITE_MODULES_SSO_FRONTEND_BASE_URL": "https://dev-sso.6seconds.org", "VITE_MODULES_TOOLS_FRONTEND_BASE_URL": "https://dev-sso.6seconds.org" };
|
|
6230
6718
|
const env = createEnv({
|
|
6231
6719
|
client: {
|
|
6232
|
-
VITE_MODULES_ENV:
|
|
6720
|
+
VITE_MODULES_ENV: z.string()
|
|
6233
6721
|
},
|
|
6234
6722
|
runtimeEnv: __vite_import_meta_env__
|
|
6235
6723
|
});
|
|
@@ -6775,8 +7263,8 @@ function removeFormattingTokens(input) {
|
|
|
6775
7263
|
return input.replace(/\\/g, "");
|
|
6776
7264
|
}
|
|
6777
7265
|
function makeFormatFunction(format2) {
|
|
6778
|
-
var array2 = format2.match(formattingTokens), i,
|
|
6779
|
-
for (i = 0,
|
|
7266
|
+
var array2 = format2.match(formattingTokens), i, length;
|
|
7267
|
+
for (i = 0, length = array2.length; i < length; i++) {
|
|
6780
7268
|
if (formatTokenFunctions[array2[i]]) {
|
|
6781
7269
|
array2[i] = formatTokenFunctions[array2[i]];
|
|
6782
7270
|
} else {
|
|
@@ -6785,7 +7273,7 @@ function makeFormatFunction(format2) {
|
|
|
6785
7273
|
}
|
|
6786
7274
|
return function(mom) {
|
|
6787
7275
|
var output = "", i2;
|
|
6788
|
-
for (i2 = 0; i2 <
|
|
7276
|
+
for (i2 = 0; i2 < length; i2++) {
|
|
6789
7277
|
output += isFunction2(array2[i2]) ? array2[i2].call(mom, format2) : array2[i2];
|
|
6790
7278
|
}
|
|
6791
7279
|
return output;
|
|
@@ -7923,18 +8411,18 @@ function normalizeLocale(key) {
|
|
|
7923
8411
|
return key ? key.toLowerCase().replace("_", "-") : key;
|
|
7924
8412
|
}
|
|
7925
8413
|
function chooseLocale(names) {
|
|
7926
|
-
var i = 0, j,
|
|
8414
|
+
var i = 0, j, next, locale2, split;
|
|
7927
8415
|
while (i < names.length) {
|
|
7928
8416
|
split = normalizeLocale(names[i]).split("-");
|
|
7929
8417
|
j = split.length;
|
|
7930
|
-
|
|
7931
|
-
|
|
8418
|
+
next = normalizeLocale(names[i + 1]);
|
|
8419
|
+
next = next ? next.split("-") : null;
|
|
7932
8420
|
while (j > 0) {
|
|
7933
8421
|
locale2 = loadLocale(split.slice(0, j).join("-"));
|
|
7934
8422
|
if (locale2) {
|
|
7935
8423
|
return locale2;
|
|
7936
8424
|
}
|
|
7937
|
-
if (
|
|
8425
|
+
if (next && next.length >= j && commonPrefix(split, next) >= j - 1) {
|
|
7938
8426
|
break;
|
|
7939
8427
|
}
|
|
7940
8428
|
j--;
|
|
@@ -8129,11 +8617,11 @@ var extendedIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\
|
|
|
8129
8617
|
PST: -8 * 60
|
|
8130
8618
|
};
|
|
8131
8619
|
function configFromISO(config) {
|
|
8132
|
-
var i, l, string2 = config._i,
|
|
8133
|
-
if (
|
|
8620
|
+
var i, l, string2 = config._i, match = extendedIsoRegex.exec(string2) || basicIsoRegex.exec(string2), allowTime, dateFormat, timeFormat, tzFormat, isoDatesLen = isoDates.length, isoTimesLen = isoTimes.length;
|
|
8621
|
+
if (match) {
|
|
8134
8622
|
getParsingFlags(config).iso = true;
|
|
8135
8623
|
for (i = 0, l = isoDatesLen; i < l; i++) {
|
|
8136
|
-
if (isoDates[i][1].exec(
|
|
8624
|
+
if (isoDates[i][1].exec(match[1])) {
|
|
8137
8625
|
dateFormat = isoDates[i][0];
|
|
8138
8626
|
allowTime = isoDates[i][2] !== false;
|
|
8139
8627
|
break;
|
|
@@ -8143,10 +8631,10 @@ function configFromISO(config) {
|
|
|
8143
8631
|
config._isValid = false;
|
|
8144
8632
|
return;
|
|
8145
8633
|
}
|
|
8146
|
-
if (
|
|
8634
|
+
if (match[3]) {
|
|
8147
8635
|
for (i = 0, l = isoTimesLen; i < l; i++) {
|
|
8148
|
-
if (isoTimes[i][1].exec(
|
|
8149
|
-
timeFormat = (
|
|
8636
|
+
if (isoTimes[i][1].exec(match[3])) {
|
|
8637
|
+
timeFormat = (match[2] || " ") + isoTimes[i][0];
|
|
8150
8638
|
break;
|
|
8151
8639
|
}
|
|
8152
8640
|
}
|
|
@@ -8159,8 +8647,8 @@ function configFromISO(config) {
|
|
|
8159
8647
|
config._isValid = false;
|
|
8160
8648
|
return;
|
|
8161
8649
|
}
|
|
8162
|
-
if (
|
|
8163
|
-
if (tzRegex.exec(
|
|
8650
|
+
if (match[4]) {
|
|
8651
|
+
if (tzRegex.exec(match[4])) {
|
|
8164
8652
|
tzFormat = "Z";
|
|
8165
8653
|
} else {
|
|
8166
8654
|
config._isValid = false;
|
|
@@ -8224,21 +8712,21 @@ function calculateOffset(obsOffset, militaryOffset, numOffset) {
|
|
|
8224
8712
|
}
|
|
8225
8713
|
}
|
|
8226
8714
|
function configFromRFC2822(config) {
|
|
8227
|
-
var
|
|
8228
|
-
if (
|
|
8715
|
+
var match = rfc2822.exec(preprocessRFC2822(config._i)), parsedArray;
|
|
8716
|
+
if (match) {
|
|
8229
8717
|
parsedArray = extractFromRFC2822Strings(
|
|
8230
|
-
|
|
8231
|
-
|
|
8232
|
-
|
|
8233
|
-
|
|
8234
|
-
|
|
8235
|
-
|
|
8718
|
+
match[4],
|
|
8719
|
+
match[3],
|
|
8720
|
+
match[2],
|
|
8721
|
+
match[5],
|
|
8722
|
+
match[6],
|
|
8723
|
+
match[7]
|
|
8236
8724
|
);
|
|
8237
|
-
if (!checkWeekday(
|
|
8725
|
+
if (!checkWeekday(match[1], parsedArray, config)) {
|
|
8238
8726
|
return;
|
|
8239
8727
|
}
|
|
8240
8728
|
config._a = parsedArray;
|
|
8241
|
-
config._tzm = calculateOffset(
|
|
8729
|
+
config._tzm = calculateOffset(match[8], match[9], match[10]);
|
|
8242
8730
|
config._d = createUTCDate.apply(null, config._a);
|
|
8243
8731
|
config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);
|
|
8244
8732
|
getParsingFlags(config).rfc2822 = true;
|
|
@@ -8873,7 +9361,7 @@ function isUtc() {
|
|
|
8873
9361
|
}
|
|
8874
9362
|
var aspNetRegex = /^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/, isoRegex = /^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;
|
|
8875
9363
|
function createDuration(input, key) {
|
|
8876
|
-
var duration = input,
|
|
9364
|
+
var duration = input, match = null, sign2, ret, diffRes;
|
|
8877
9365
|
if (isDuration(input)) {
|
|
8878
9366
|
duration = {
|
|
8879
9367
|
ms: input._milliseconds,
|
|
@@ -8887,27 +9375,27 @@ function createDuration(input, key) {
|
|
|
8887
9375
|
} else {
|
|
8888
9376
|
duration.milliseconds = +input;
|
|
8889
9377
|
}
|
|
8890
|
-
} else if (
|
|
8891
|
-
sign2 =
|
|
9378
|
+
} else if (match = aspNetRegex.exec(input)) {
|
|
9379
|
+
sign2 = match[1] === "-" ? -1 : 1;
|
|
8892
9380
|
duration = {
|
|
8893
9381
|
y: 0,
|
|
8894
|
-
d: toInt(
|
|
8895
|
-
h: toInt(
|
|
8896
|
-
m: toInt(
|
|
8897
|
-
s: toInt(
|
|
8898
|
-
ms: toInt(absRound(
|
|
9382
|
+
d: toInt(match[DATE]) * sign2,
|
|
9383
|
+
h: toInt(match[HOUR]) * sign2,
|
|
9384
|
+
m: toInt(match[MINUTE]) * sign2,
|
|
9385
|
+
s: toInt(match[SECOND]) * sign2,
|
|
9386
|
+
ms: toInt(absRound(match[MILLISECOND] * 1e3)) * sign2
|
|
8899
9387
|
// the millisecond decimal point is included in the match
|
|
8900
9388
|
};
|
|
8901
|
-
} else if (
|
|
8902
|
-
sign2 =
|
|
9389
|
+
} else if (match = isoRegex.exec(input)) {
|
|
9390
|
+
sign2 = match[1] === "-" ? -1 : 1;
|
|
8903
9391
|
duration = {
|
|
8904
|
-
y: parseIso(
|
|
8905
|
-
M: parseIso(
|
|
8906
|
-
w: parseIso(
|
|
8907
|
-
d: parseIso(
|
|
8908
|
-
h: parseIso(
|
|
8909
|
-
m: parseIso(
|
|
8910
|
-
s: parseIso(
|
|
9392
|
+
y: parseIso(match[2], sign2),
|
|
9393
|
+
M: parseIso(match[3], sign2),
|
|
9394
|
+
w: parseIso(match[4], sign2),
|
|
9395
|
+
d: parseIso(match[5], sign2),
|
|
9396
|
+
h: parseIso(match[6], sign2),
|
|
9397
|
+
m: parseIso(match[7], sign2),
|
|
9398
|
+
s: parseIso(match[8], sign2)
|
|
8911
9399
|
};
|
|
8912
9400
|
} else if (duration == null) {
|
|
8913
9401
|
duration = {};
|
|
@@ -9227,16 +9715,16 @@ function inspect() {
|
|
|
9227
9715
|
if (!this.isValid()) {
|
|
9228
9716
|
return "moment.invalid(/* " + this._i + " */)";
|
|
9229
9717
|
}
|
|
9230
|
-
var func = "moment", zone = "",
|
|
9718
|
+
var func = "moment", zone = "", prefix, year, datetime, suffix;
|
|
9231
9719
|
if (!this.isLocal()) {
|
|
9232
9720
|
func = this.utcOffset() === 0 ? "moment.utc" : "moment.parseZone";
|
|
9233
9721
|
zone = "Z";
|
|
9234
9722
|
}
|
|
9235
|
-
|
|
9723
|
+
prefix = "[" + func + '("]';
|
|
9236
9724
|
year = 0 <= this.year() && this.year() <= 9999 ? "YYYY" : "YYYYYY";
|
|
9237
9725
|
datetime = "-MM-DD[T]HH:mm:ss.SSS";
|
|
9238
9726
|
suffix = zone + '[")]';
|
|
9239
|
-
return this.format(
|
|
9727
|
+
return this.format(prefix + year + datetime + suffix);
|
|
9240
9728
|
}
|
|
9241
9729
|
function format(inputString) {
|
|
9242
9730
|
if (!inputString) {
|
|
@@ -9245,7 +9733,7 @@ function format(inputString) {
|
|
|
9245
9733
|
var output = formatMoment(this, inputString);
|
|
9246
9734
|
return this.localeData().postformat(output);
|
|
9247
9735
|
}
|
|
9248
|
-
function from
|
|
9736
|
+
function from(time, withoutSuffix) {
|
|
9249
9737
|
if (this.isValid() && (isMoment(time) && time.isValid() || createLocal(time).isValid())) {
|
|
9250
9738
|
return createDuration({ to: this, from: time }).locale(this.locale()).humanize(!withoutSuffix);
|
|
9251
9739
|
} else {
|
|
@@ -9512,12 +10000,12 @@ addRegexToken("yyyy", matchUnsigned);
|
|
|
9512
10000
|
addRegexToken("yo", matchEraYearOrdinal);
|
|
9513
10001
|
addParseToken(["y", "yy", "yyy", "yyyy"], YEAR);
|
|
9514
10002
|
addParseToken(["yo"], function(input, array2, config, token2) {
|
|
9515
|
-
var
|
|
10003
|
+
var match;
|
|
9516
10004
|
if (config._locale._eraYearOrdinalRegex) {
|
|
9517
|
-
|
|
10005
|
+
match = input.match(config._locale._eraYearOrdinalRegex);
|
|
9518
10006
|
}
|
|
9519
10007
|
if (config._locale.eraYearOrdinalParse) {
|
|
9520
|
-
array2[YEAR] = config._locale.eraYearOrdinalParse(input,
|
|
10008
|
+
array2[YEAR] = config._locale.eraYearOrdinalParse(input, match);
|
|
9521
10009
|
} else {
|
|
9522
10010
|
array2[YEAR] = parseInt(input, 10);
|
|
9523
10011
|
}
|
|
@@ -9836,15 +10324,15 @@ addFormatToken(0, ["SSSSSSSSS", 9], 0, function() {
|
|
|
9836
10324
|
addRegexToken("S", match1to3, match1);
|
|
9837
10325
|
addRegexToken("SS", match1to3, match2);
|
|
9838
10326
|
addRegexToken("SSS", match1to3, match3);
|
|
9839
|
-
var token
|
|
9840
|
-
for (token
|
|
9841
|
-
addRegexToken(token
|
|
10327
|
+
var token, getSetMillisecond;
|
|
10328
|
+
for (token = "SSSS"; token.length <= 9; token += "S") {
|
|
10329
|
+
addRegexToken(token, matchUnsigned);
|
|
9842
10330
|
}
|
|
9843
10331
|
function parseMs(input, array2) {
|
|
9844
10332
|
array2[MILLISECOND] = toInt(("0." + input) * 1e3);
|
|
9845
10333
|
}
|
|
9846
|
-
for (token
|
|
9847
|
-
addParseToken(token
|
|
10334
|
+
for (token = "S"; token.length <= 9; token += "S") {
|
|
10335
|
+
addParseToken(token, parseMs);
|
|
9848
10336
|
}
|
|
9849
10337
|
getSetMillisecond = makeGetSet("Milliseconds", false);
|
|
9850
10338
|
addFormatToken("z", 0, 0, "zoneAbbr");
|
|
@@ -9862,7 +10350,7 @@ proto.clone = clone$1;
|
|
|
9862
10350
|
proto.diff = diff;
|
|
9863
10351
|
proto.endOf = endOf;
|
|
9864
10352
|
proto.format = format;
|
|
9865
|
-
proto.from = from
|
|
10353
|
+
proto.from = from;
|
|
9866
10354
|
proto.fromNow = fromNow;
|
|
9867
10355
|
proto.to = to;
|
|
9868
10356
|
proto.toNow = toNow;
|
|
@@ -10093,7 +10581,7 @@ hooks.langData = deprecate(
|
|
|
10093
10581
|
getLocale
|
|
10094
10582
|
);
|
|
10095
10583
|
var mathAbs = Math.abs;
|
|
10096
|
-
function abs
|
|
10584
|
+
function abs() {
|
|
10097
10585
|
var data = this._data;
|
|
10098
10586
|
this._milliseconds = mathAbs(this._milliseconds);
|
|
10099
10587
|
this._days = mathAbs(this._days);
|
|
@@ -10295,7 +10783,7 @@ function humanize(argWithSuffix, argThresholds) {
|
|
|
10295
10783
|
}
|
|
10296
10784
|
return locale2.postformat(output);
|
|
10297
10785
|
}
|
|
10298
|
-
var abs$1
|
|
10786
|
+
var abs$1 = Math.abs;
|
|
10299
10787
|
function sign(x) {
|
|
10300
10788
|
return (x > 0) - (x < 0) || +x;
|
|
10301
10789
|
}
|
|
@@ -10303,7 +10791,7 @@ function toISOString$1() {
|
|
|
10303
10791
|
if (!this.isValid()) {
|
|
10304
10792
|
return this.localeData().invalidDate();
|
|
10305
10793
|
}
|
|
10306
|
-
var seconds2 = abs$1
|
|
10794
|
+
var seconds2 = abs$1(this._milliseconds) / 1e3, days2 = abs$1(this._days), months2 = abs$1(this._months), minutes2, hours2, years2, s, total = this.asSeconds(), totalSign, ymSign, daysSign, hmsSign;
|
|
10307
10795
|
if (!total) {
|
|
10308
10796
|
return "P0D";
|
|
10309
10797
|
}
|
|
@@ -10322,7 +10810,7 @@ function toISOString$1() {
|
|
|
10322
10810
|
}
|
|
10323
10811
|
var proto$2 = Duration.prototype;
|
|
10324
10812
|
proto$2.isValid = isValid$1;
|
|
10325
|
-
proto$2.abs = abs
|
|
10813
|
+
proto$2.abs = abs;
|
|
10326
10814
|
proto$2.add = add$1;
|
|
10327
10815
|
proto$2.subtract = subtract$1;
|
|
10328
10816
|
proto$2.as = as;
|
|
@@ -10535,7 +11023,7 @@ function requireTinyCase() {
|
|
|
10535
11023
|
const upperFirst = (str) => str[0].toUpperCase() + str.slice(1);
|
|
10536
11024
|
const join = (str, d) => words(str).join(d).toLowerCase();
|
|
10537
11025
|
const camelCase = (str) => words(str).reduce(
|
|
10538
|
-
(acc,
|
|
11026
|
+
(acc, next) => `${acc}${!acc ? next.toLowerCase() : next[0].toUpperCase() + next.slice(1).toLowerCase()}`,
|
|
10539
11027
|
""
|
|
10540
11028
|
);
|
|
10541
11029
|
const pascalCase = (str) => upperFirst(camelCase(str));
|
|
@@ -10576,32 +11064,32 @@ function requireToposort() {
|
|
|
10576
11064
|
if (!visited[i]) visit(nodes[i], i, /* @__PURE__ */ new Set());
|
|
10577
11065
|
}
|
|
10578
11066
|
return sorted;
|
|
10579
|
-
function visit(
|
|
10580
|
-
if (predecessors.has(
|
|
11067
|
+
function visit(node, i2, predecessors) {
|
|
11068
|
+
if (predecessors.has(node)) {
|
|
10581
11069
|
var nodeRep;
|
|
10582
11070
|
try {
|
|
10583
|
-
nodeRep = ", node was:" + JSON.stringify(
|
|
11071
|
+
nodeRep = ", node was:" + JSON.stringify(node);
|
|
10584
11072
|
} catch (e) {
|
|
10585
11073
|
nodeRep = "";
|
|
10586
11074
|
}
|
|
10587
11075
|
throw new Error("Cyclic dependency" + nodeRep);
|
|
10588
11076
|
}
|
|
10589
|
-
if (!nodesHash.has(
|
|
10590
|
-
throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: " + JSON.stringify(
|
|
11077
|
+
if (!nodesHash.has(node)) {
|
|
11078
|
+
throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: " + JSON.stringify(node));
|
|
10591
11079
|
}
|
|
10592
11080
|
if (visited[i2]) return;
|
|
10593
11081
|
visited[i2] = true;
|
|
10594
|
-
var outgoing = outgoingEdges.get(
|
|
11082
|
+
var outgoing = outgoingEdges.get(node) || /* @__PURE__ */ new Set();
|
|
10595
11083
|
outgoing = Array.from(outgoing);
|
|
10596
11084
|
if (i2 = outgoing.length) {
|
|
10597
|
-
predecessors.add(
|
|
11085
|
+
predecessors.add(node);
|
|
10598
11086
|
do {
|
|
10599
11087
|
var child = outgoing[--i2];
|
|
10600
11088
|
visit(child, nodesHash.get(child), predecessors);
|
|
10601
11089
|
} while (i2);
|
|
10602
|
-
predecessors.delete(
|
|
11090
|
+
predecessors.delete(node);
|
|
10603
11091
|
}
|
|
10604
|
-
sorted[--cursor] =
|
|
11092
|
+
sorted[--cursor] = node;
|
|
10605
11093
|
}
|
|
10606
11094
|
}
|
|
10607
11095
|
function uniqueNodes(arr) {
|
|
@@ -10882,8 +11370,8 @@ class Reference {
|
|
|
10882
11370
|
this.isContext = this.key[0] === prefixes.context;
|
|
10883
11371
|
this.isValue = this.key[0] === prefixes.value;
|
|
10884
11372
|
this.isSibling = !this.isContext && !this.isValue;
|
|
10885
|
-
let
|
|
10886
|
-
this.path = this.key.slice(
|
|
11373
|
+
let prefix = this.isContext ? prefixes.context : this.isValue ? prefixes.value : "";
|
|
11374
|
+
this.path = this.key.slice(prefix.length);
|
|
10887
11375
|
this.getter = this.path && propertyExprExports.getter(this.path, true);
|
|
10888
11376
|
this.map = options.map;
|
|
10889
11377
|
}
|
|
@@ -10928,7 +11416,7 @@ function createValidation(config) {
|
|
|
10928
11416
|
options,
|
|
10929
11417
|
originalValue,
|
|
10930
11418
|
schema
|
|
10931
|
-
}, panic,
|
|
11419
|
+
}, panic, next) {
|
|
10932
11420
|
const {
|
|
10933
11421
|
name,
|
|
10934
11422
|
test,
|
|
@@ -10942,34 +11430,31 @@ function createValidation(config) {
|
|
|
10942
11430
|
abortEarly = schema.spec.abortEarly,
|
|
10943
11431
|
disableStackTrace = schema.spec.disableStackTrace
|
|
10944
11432
|
} = options;
|
|
10945
|
-
|
|
10946
|
-
value,
|
|
10947
|
-
|
|
10948
|
-
context
|
|
10949
|
-
};
|
|
11433
|
+
function resolve(item) {
|
|
11434
|
+
return Reference.isRef(item) ? item.getValue(value, parent, context) : item;
|
|
11435
|
+
}
|
|
10950
11436
|
function createError(overrides = {}) {
|
|
10951
|
-
const nextParams =
|
|
11437
|
+
const nextParams = Object.assign({
|
|
10952
11438
|
value,
|
|
10953
11439
|
originalValue,
|
|
10954
11440
|
label: schema.spec.label,
|
|
10955
11441
|
path: overrides.path || path,
|
|
10956
11442
|
spec: schema.spec,
|
|
10957
11443
|
disableStackTrace: overrides.disableStackTrace || disableStackTrace
|
|
10958
|
-
}, params, overrides.params)
|
|
11444
|
+
}, params, overrides.params);
|
|
11445
|
+
for (const key of Object.keys(nextParams)) nextParams[key] = resolve(nextParams[key]);
|
|
10959
11446
|
const error = new ValidationError(ValidationError.formatError(overrides.message || message, nextParams), value, nextParams.path, overrides.type || name, nextParams.disableStackTrace);
|
|
10960
11447
|
error.params = nextParams;
|
|
10961
11448
|
return error;
|
|
10962
11449
|
}
|
|
10963
|
-
const invalid = abortEarly ? panic :
|
|
11450
|
+
const invalid = abortEarly ? panic : next;
|
|
10964
11451
|
let ctx = {
|
|
10965
11452
|
path,
|
|
10966
11453
|
parent,
|
|
10967
11454
|
type: name,
|
|
10968
11455
|
from: options.from,
|
|
10969
11456
|
createError,
|
|
10970
|
-
resolve
|
|
10971
|
-
return resolveMaybeRef(item, resolveOptions);
|
|
10972
|
-
},
|
|
11457
|
+
resolve,
|
|
10973
11458
|
options,
|
|
10974
11459
|
originalValue,
|
|
10975
11460
|
schema
|
|
@@ -10977,7 +11462,7 @@ function createValidation(config) {
|
|
|
10977
11462
|
const handleResult2 = (validOrError) => {
|
|
10978
11463
|
if (ValidationError.isError(validOrError)) invalid(validOrError);
|
|
10979
11464
|
else if (!validOrError) invalid(createError());
|
|
10980
|
-
else
|
|
11465
|
+
else next(null);
|
|
10981
11466
|
};
|
|
10982
11467
|
const handleError = (err) => {
|
|
10983
11468
|
if (ValidationError.isError(err)) invalid(err);
|
|
@@ -11006,16 +11491,6 @@ function createValidation(config) {
|
|
|
11006
11491
|
validate.OPTIONS = config;
|
|
11007
11492
|
return validate;
|
|
11008
11493
|
}
|
|
11009
|
-
function resolveParams(params, options) {
|
|
11010
|
-
if (!params) return params;
|
|
11011
|
-
for (const key of Object.keys(params)) {
|
|
11012
|
-
params[key] = resolveMaybeRef(params[key], options);
|
|
11013
|
-
}
|
|
11014
|
-
return params;
|
|
11015
|
-
}
|
|
11016
|
-
function resolveMaybeRef(item, options) {
|
|
11017
|
-
return Reference.isRef(item) ? item.getValue(options.value, options.parent, options.context) : item;
|
|
11018
|
-
}
|
|
11019
11494
|
function getIn(schema, path, value, context = value) {
|
|
11020
11495
|
let parent, lastPart, lastPartDebug;
|
|
11021
11496
|
if (!path) return {
|
|
@@ -11075,105 +11550,42 @@ class ReferenceSet extends Set {
|
|
|
11075
11550
|
return new ReferenceSet(this.values());
|
|
11076
11551
|
}
|
|
11077
11552
|
merge(newItems, removeItems) {
|
|
11078
|
-
const
|
|
11079
|
-
newItems.forEach((value) =>
|
|
11080
|
-
removeItems.forEach((value) =>
|
|
11081
|
-
return
|
|
11553
|
+
const next = this.clone();
|
|
11554
|
+
newItems.forEach((value) => next.add(value));
|
|
11555
|
+
removeItems.forEach((value) => next.delete(value));
|
|
11556
|
+
return next;
|
|
11082
11557
|
}
|
|
11083
11558
|
}
|
|
11084
11559
|
function clone(src, seen = /* @__PURE__ */ new Map()) {
|
|
11085
11560
|
if (isSchema(src) || !src || typeof src !== "object") return src;
|
|
11086
11561
|
if (seen.has(src)) return seen.get(src);
|
|
11087
|
-
let
|
|
11562
|
+
let copy;
|
|
11088
11563
|
if (src instanceof Date) {
|
|
11089
|
-
|
|
11090
|
-
seen.set(src,
|
|
11564
|
+
copy = new Date(src.getTime());
|
|
11565
|
+
seen.set(src, copy);
|
|
11091
11566
|
} else if (src instanceof RegExp) {
|
|
11092
|
-
|
|
11093
|
-
seen.set(src,
|
|
11567
|
+
copy = new RegExp(src);
|
|
11568
|
+
seen.set(src, copy);
|
|
11094
11569
|
} else if (Array.isArray(src)) {
|
|
11095
|
-
|
|
11096
|
-
seen.set(src,
|
|
11097
|
-
for (let i = 0; i < src.length; i++)
|
|
11570
|
+
copy = new Array(src.length);
|
|
11571
|
+
seen.set(src, copy);
|
|
11572
|
+
for (let i = 0; i < src.length; i++) copy[i] = clone(src[i], seen);
|
|
11098
11573
|
} else if (src instanceof Map) {
|
|
11099
|
-
|
|
11100
|
-
seen.set(src,
|
|
11101
|
-
for (const [k, v] of src.entries())
|
|
11574
|
+
copy = /* @__PURE__ */ new Map();
|
|
11575
|
+
seen.set(src, copy);
|
|
11576
|
+
for (const [k, v] of src.entries()) copy.set(k, clone(v, seen));
|
|
11102
11577
|
} else if (src instanceof Set) {
|
|
11103
|
-
|
|
11104
|
-
seen.set(src,
|
|
11105
|
-
for (const v of src)
|
|
11578
|
+
copy = /* @__PURE__ */ new Set();
|
|
11579
|
+
seen.set(src, copy);
|
|
11580
|
+
for (const v of src) copy.add(clone(v, seen));
|
|
11106
11581
|
} else if (src instanceof Object) {
|
|
11107
|
-
|
|
11108
|
-
seen.set(src,
|
|
11109
|
-
for (const [k, v] of Object.entries(src))
|
|
11582
|
+
copy = {};
|
|
11583
|
+
seen.set(src, copy);
|
|
11584
|
+
for (const [k, v] of Object.entries(src)) copy[k] = clone(v, seen);
|
|
11110
11585
|
} else {
|
|
11111
11586
|
throw Error(`Unable to clone ${src}`);
|
|
11112
11587
|
}
|
|
11113
|
-
return
|
|
11114
|
-
}
|
|
11115
|
-
function createStandardPath(path) {
|
|
11116
|
-
if (!(path != null && path.length)) {
|
|
11117
|
-
return void 0;
|
|
11118
|
-
}
|
|
11119
|
-
const segments = [];
|
|
11120
|
-
let currentSegment = "";
|
|
11121
|
-
let inBrackets = false;
|
|
11122
|
-
let inQuotes = false;
|
|
11123
|
-
for (let i = 0; i < path.length; i++) {
|
|
11124
|
-
const char2 = path[i];
|
|
11125
|
-
if (char2 === "[" && !inQuotes) {
|
|
11126
|
-
if (currentSegment) {
|
|
11127
|
-
segments.push(...currentSegment.split(".").filter(Boolean));
|
|
11128
|
-
currentSegment = "";
|
|
11129
|
-
}
|
|
11130
|
-
inBrackets = true;
|
|
11131
|
-
continue;
|
|
11132
|
-
}
|
|
11133
|
-
if (char2 === "]" && !inQuotes) {
|
|
11134
|
-
if (currentSegment) {
|
|
11135
|
-
if (/^\d+$/.test(currentSegment)) {
|
|
11136
|
-
segments.push(currentSegment);
|
|
11137
|
-
} else {
|
|
11138
|
-
segments.push(currentSegment.replace(/^"|"$/g, ""));
|
|
11139
|
-
}
|
|
11140
|
-
currentSegment = "";
|
|
11141
|
-
}
|
|
11142
|
-
inBrackets = false;
|
|
11143
|
-
continue;
|
|
11144
|
-
}
|
|
11145
|
-
if (char2 === '"') {
|
|
11146
|
-
inQuotes = !inQuotes;
|
|
11147
|
-
continue;
|
|
11148
|
-
}
|
|
11149
|
-
if (char2 === "." && !inBrackets && !inQuotes) {
|
|
11150
|
-
if (currentSegment) {
|
|
11151
|
-
segments.push(currentSegment);
|
|
11152
|
-
currentSegment = "";
|
|
11153
|
-
}
|
|
11154
|
-
continue;
|
|
11155
|
-
}
|
|
11156
|
-
currentSegment += char2;
|
|
11157
|
-
}
|
|
11158
|
-
if (currentSegment) {
|
|
11159
|
-
segments.push(...currentSegment.split(".").filter(Boolean));
|
|
11160
|
-
}
|
|
11161
|
-
return segments;
|
|
11162
|
-
}
|
|
11163
|
-
function createStandardIssues(error, parentPath) {
|
|
11164
|
-
const path = parentPath ? `${parentPath}.${error.path}` : error.path;
|
|
11165
|
-
return error.errors.map((err) => ({
|
|
11166
|
-
message: err,
|
|
11167
|
-
path: createStandardPath(path)
|
|
11168
|
-
}));
|
|
11169
|
-
}
|
|
11170
|
-
function issuesFromValidationError(error, parentPath) {
|
|
11171
|
-
var _error$inner;
|
|
11172
|
-
if (!((_error$inner = error.inner) != null && _error$inner.length) && error.errors.length) {
|
|
11173
|
-
return createStandardIssues(error, parentPath);
|
|
11174
|
-
}
|
|
11175
|
-
const path = parentPath ? `${parentPath}.${error.path}` : error.path;
|
|
11176
|
-
return error.inner.flatMap((err) => issuesFromValidationError(err, path));
|
|
11588
|
+
return copy;
|
|
11177
11589
|
}
|
|
11178
11590
|
class Schema {
|
|
11179
11591
|
constructor(options) {
|
|
@@ -11219,30 +11631,30 @@ class Schema {
|
|
|
11219
11631
|
if (spec) Object.assign(this.spec, spec);
|
|
11220
11632
|
return this;
|
|
11221
11633
|
}
|
|
11222
|
-
const
|
|
11223
|
-
|
|
11224
|
-
|
|
11225
|
-
|
|
11226
|
-
|
|
11227
|
-
|
|
11228
|
-
|
|
11229
|
-
|
|
11230
|
-
|
|
11231
|
-
|
|
11232
|
-
|
|
11233
|
-
|
|
11234
|
-
return
|
|
11634
|
+
const next = Object.create(Object.getPrototypeOf(this));
|
|
11635
|
+
next.type = this.type;
|
|
11636
|
+
next._typeCheck = this._typeCheck;
|
|
11637
|
+
next._whitelist = this._whitelist.clone();
|
|
11638
|
+
next._blacklist = this._blacklist.clone();
|
|
11639
|
+
next.internalTests = Object.assign({}, this.internalTests);
|
|
11640
|
+
next.exclusiveTests = Object.assign({}, this.exclusiveTests);
|
|
11641
|
+
next.deps = [...this.deps];
|
|
11642
|
+
next.conditions = [...this.conditions];
|
|
11643
|
+
next.tests = [...this.tests];
|
|
11644
|
+
next.transforms = [...this.transforms];
|
|
11645
|
+
next.spec = clone(Object.assign({}, this.spec, spec));
|
|
11646
|
+
return next;
|
|
11235
11647
|
}
|
|
11236
11648
|
label(label) {
|
|
11237
|
-
let
|
|
11238
|
-
|
|
11239
|
-
return
|
|
11649
|
+
let next = this.clone();
|
|
11650
|
+
next.spec.label = label;
|
|
11651
|
+
return next;
|
|
11240
11652
|
}
|
|
11241
11653
|
meta(...args) {
|
|
11242
11654
|
if (args.length === 0) return this.spec.meta;
|
|
11243
|
-
let
|
|
11244
|
-
|
|
11245
|
-
return
|
|
11655
|
+
let next = this.clone();
|
|
11656
|
+
next.spec.meta = Object.assign(next.spec.meta || {}, args[0]);
|
|
11657
|
+
return next;
|
|
11246
11658
|
}
|
|
11247
11659
|
withMutation(fn) {
|
|
11248
11660
|
let before = this._mutate;
|
|
@@ -11263,9 +11675,9 @@ class Schema {
|
|
|
11263
11675
|
combined._blacklist = base._blacklist.merge(schema._blacklist, schema._whitelist);
|
|
11264
11676
|
combined.tests = base.tests;
|
|
11265
11677
|
combined.exclusiveTests = base.exclusiveTests;
|
|
11266
|
-
combined.withMutation((
|
|
11678
|
+
combined.withMutation((next) => {
|
|
11267
11679
|
schema.tests.forEach((fn) => {
|
|
11268
|
-
|
|
11680
|
+
next.test(fn.OPTIONS);
|
|
11269
11681
|
});
|
|
11270
11682
|
});
|
|
11271
11683
|
combined.transforms = [...base.transforms, ...combined.transforms];
|
|
@@ -11304,11 +11716,9 @@ class Schema {
|
|
|
11304
11716
|
* Run the configured transform pipeline over an input value.
|
|
11305
11717
|
*/
|
|
11306
11718
|
cast(value, options = {}) {
|
|
11307
|
-
let resolvedSchema = this.resolve(Object.assign({
|
|
11719
|
+
let resolvedSchema = this.resolve(Object.assign({
|
|
11308
11720
|
value
|
|
11309
|
-
|
|
11310
|
-
// context: options.context,
|
|
11311
|
-
}));
|
|
11721
|
+
}, options));
|
|
11312
11722
|
let allowOptionality = options.assert === "ignore-optionality";
|
|
11313
11723
|
let result = resolvedSchema._cast(value, options);
|
|
11314
11724
|
if (options.assert !== false && !resolvedSchema.isType(result)) {
|
|
@@ -11325,13 +11735,13 @@ attempted value: ${formattedValue}
|
|
|
11325
11735
|
return result;
|
|
11326
11736
|
}
|
|
11327
11737
|
_cast(rawValue, options) {
|
|
11328
|
-
let value = rawValue === void 0 ? rawValue : this.transforms.reduce((prevValue, fn) => fn.call(this, prevValue, rawValue, this
|
|
11738
|
+
let value = rawValue === void 0 ? rawValue : this.transforms.reduce((prevValue, fn) => fn.call(this, prevValue, rawValue, this), rawValue);
|
|
11329
11739
|
if (value === void 0) {
|
|
11330
11740
|
value = this.getDefault(options);
|
|
11331
11741
|
}
|
|
11332
11742
|
return value;
|
|
11333
11743
|
}
|
|
11334
|
-
_validate(_value, options = {}, panic,
|
|
11744
|
+
_validate(_value, options = {}, panic, next) {
|
|
11335
11745
|
let {
|
|
11336
11746
|
path,
|
|
11337
11747
|
originalValue = _value,
|
|
@@ -11355,7 +11765,7 @@ attempted value: ${formattedValue}
|
|
|
11355
11765
|
tests: initialTests
|
|
11356
11766
|
}, panic, (initialErrors) => {
|
|
11357
11767
|
if (initialErrors.length) {
|
|
11358
|
-
return
|
|
11768
|
+
return next(initialErrors, value);
|
|
11359
11769
|
}
|
|
11360
11770
|
this.runTests({
|
|
11361
11771
|
path,
|
|
@@ -11363,14 +11773,14 @@ attempted value: ${formattedValue}
|
|
|
11363
11773
|
originalValue,
|
|
11364
11774
|
options,
|
|
11365
11775
|
tests: this.tests
|
|
11366
|
-
}, panic,
|
|
11776
|
+
}, panic, next);
|
|
11367
11777
|
});
|
|
11368
11778
|
}
|
|
11369
11779
|
/**
|
|
11370
11780
|
* Executes a set of validations, either schema, produced Tests or a nested
|
|
11371
11781
|
* schema validate result.
|
|
11372
11782
|
*/
|
|
11373
|
-
runTests(runOptions, panic,
|
|
11783
|
+
runTests(runOptions, panic, next) {
|
|
11374
11784
|
let fired = false;
|
|
11375
11785
|
let {
|
|
11376
11786
|
tests,
|
|
@@ -11387,7 +11797,7 @@ attempted value: ${formattedValue}
|
|
|
11387
11797
|
let nextOnce = (arg) => {
|
|
11388
11798
|
if (fired) return;
|
|
11389
11799
|
fired = true;
|
|
11390
|
-
|
|
11800
|
+
next(arg, value);
|
|
11391
11801
|
};
|
|
11392
11802
|
let count = tests.length;
|
|
11393
11803
|
let nestedErrors = [];
|
|
@@ -11440,7 +11850,7 @@ attempted value: ${formattedValue}
|
|
|
11440
11850
|
[isIndex2 ? "index" : "key"]: k,
|
|
11441
11851
|
path: isIndex2 || k.includes(".") ? `${parentPath || ""}[${isIndex2 ? k : `"${k}"`}]` : (parentPath ? `${parentPath}.` : "") + key
|
|
11442
11852
|
});
|
|
11443
|
-
return (_, panic,
|
|
11853
|
+
return (_, panic, next) => this.resolve(testOptions)._validate(value, testOptions, panic, next);
|
|
11444
11854
|
}
|
|
11445
11855
|
validate(value, options) {
|
|
11446
11856
|
var _options$disableStack2;
|
|
@@ -11504,10 +11914,10 @@ attempted value: ${formattedValue}
|
|
|
11504
11914
|
if (arguments.length === 0) {
|
|
11505
11915
|
return this._getDefault();
|
|
11506
11916
|
}
|
|
11507
|
-
let
|
|
11917
|
+
let next = this.clone({
|
|
11508
11918
|
default: def
|
|
11509
11919
|
});
|
|
11510
|
-
return
|
|
11920
|
+
return next;
|
|
11511
11921
|
}
|
|
11512
11922
|
strict(isStrict = true) {
|
|
11513
11923
|
return this.clone({
|
|
@@ -11515,30 +11925,30 @@ attempted value: ${formattedValue}
|
|
|
11515
11925
|
});
|
|
11516
11926
|
}
|
|
11517
11927
|
nullability(nullable, message) {
|
|
11518
|
-
const
|
|
11928
|
+
const next = this.clone({
|
|
11519
11929
|
nullable
|
|
11520
11930
|
});
|
|
11521
|
-
|
|
11931
|
+
next.internalTests.nullable = createValidation({
|
|
11522
11932
|
message,
|
|
11523
11933
|
name: "nullable",
|
|
11524
11934
|
test(value) {
|
|
11525
11935
|
return value === null ? this.schema.spec.nullable : true;
|
|
11526
11936
|
}
|
|
11527
11937
|
});
|
|
11528
|
-
return
|
|
11938
|
+
return next;
|
|
11529
11939
|
}
|
|
11530
11940
|
optionality(optional, message) {
|
|
11531
|
-
const
|
|
11941
|
+
const next = this.clone({
|
|
11532
11942
|
optional
|
|
11533
11943
|
});
|
|
11534
|
-
|
|
11944
|
+
next.internalTests.optionality = createValidation({
|
|
11535
11945
|
message,
|
|
11536
11946
|
name: "optionality",
|
|
11537
11947
|
test(value) {
|
|
11538
11948
|
return value === void 0 ? this.schema.spec.optional : true;
|
|
11539
11949
|
}
|
|
11540
11950
|
});
|
|
11541
|
-
return
|
|
11951
|
+
return next;
|
|
11542
11952
|
}
|
|
11543
11953
|
optional() {
|
|
11544
11954
|
return this.optionality(true);
|
|
@@ -11553,15 +11963,15 @@ attempted value: ${formattedValue}
|
|
|
11553
11963
|
return this.nullability(false, message);
|
|
11554
11964
|
}
|
|
11555
11965
|
required(message = mixed.required) {
|
|
11556
|
-
return this.clone().withMutation((
|
|
11966
|
+
return this.clone().withMutation((next) => next.nonNullable(message).defined(message));
|
|
11557
11967
|
}
|
|
11558
11968
|
notRequired() {
|
|
11559
|
-
return this.clone().withMutation((
|
|
11969
|
+
return this.clone().withMutation((next) => next.nullable().optional());
|
|
11560
11970
|
}
|
|
11561
11971
|
transform(fn) {
|
|
11562
|
-
let
|
|
11563
|
-
|
|
11564
|
-
return
|
|
11972
|
+
let next = this.clone();
|
|
11973
|
+
next.transforms.push(fn);
|
|
11974
|
+
return next;
|
|
11565
11975
|
}
|
|
11566
11976
|
/**
|
|
11567
11977
|
* Adds a test function to the schema's queue of tests.
|
|
@@ -11600,39 +12010,39 @@ attempted value: ${formattedValue}
|
|
|
11600
12010
|
}
|
|
11601
12011
|
if (opts.message === void 0) opts.message = mixed.default;
|
|
11602
12012
|
if (typeof opts.test !== "function") throw new TypeError("`test` is a required parameters");
|
|
11603
|
-
let
|
|
12013
|
+
let next = this.clone();
|
|
11604
12014
|
let validate = createValidation(opts);
|
|
11605
|
-
let isExclusive = opts.exclusive || opts.name &&
|
|
12015
|
+
let isExclusive = opts.exclusive || opts.name && next.exclusiveTests[opts.name] === true;
|
|
11606
12016
|
if (opts.exclusive) {
|
|
11607
12017
|
if (!opts.name) throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");
|
|
11608
12018
|
}
|
|
11609
|
-
if (opts.name)
|
|
11610
|
-
|
|
12019
|
+
if (opts.name) next.exclusiveTests[opts.name] = !!opts.exclusive;
|
|
12020
|
+
next.tests = next.tests.filter((fn) => {
|
|
11611
12021
|
if (fn.OPTIONS.name === opts.name) {
|
|
11612
12022
|
if (isExclusive) return false;
|
|
11613
12023
|
if (fn.OPTIONS.test === validate.OPTIONS.test) return false;
|
|
11614
12024
|
}
|
|
11615
12025
|
return true;
|
|
11616
12026
|
});
|
|
11617
|
-
|
|
11618
|
-
return
|
|
12027
|
+
next.tests.push(validate);
|
|
12028
|
+
return next;
|
|
11619
12029
|
}
|
|
11620
12030
|
when(keys2, options) {
|
|
11621
12031
|
if (!Array.isArray(keys2) && typeof keys2 !== "string") {
|
|
11622
12032
|
options = keys2;
|
|
11623
12033
|
keys2 = ".";
|
|
11624
12034
|
}
|
|
11625
|
-
let
|
|
12035
|
+
let next = this.clone();
|
|
11626
12036
|
let deps = toArray(keys2).map((key) => new Reference(key));
|
|
11627
12037
|
deps.forEach((dep) => {
|
|
11628
|
-
if (dep.isSibling)
|
|
12038
|
+
if (dep.isSibling) next.deps.push(dep.key);
|
|
11629
12039
|
});
|
|
11630
|
-
|
|
11631
|
-
return
|
|
12040
|
+
next.conditions.push(typeof options === "function" ? new Condition(deps, options) : Condition.fromOptions(deps, options));
|
|
12041
|
+
return next;
|
|
11632
12042
|
}
|
|
11633
12043
|
typeError(message) {
|
|
11634
|
-
let
|
|
11635
|
-
|
|
12044
|
+
let next = this.clone();
|
|
12045
|
+
next.internalTests.typeError = createValidation({
|
|
11636
12046
|
message,
|
|
11637
12047
|
name: "typeError",
|
|
11638
12048
|
skipAbsent: true,
|
|
@@ -11645,15 +12055,15 @@ attempted value: ${formattedValue}
|
|
|
11645
12055
|
return true;
|
|
11646
12056
|
}
|
|
11647
12057
|
});
|
|
11648
|
-
return
|
|
12058
|
+
return next;
|
|
11649
12059
|
}
|
|
11650
12060
|
oneOf(enums, message = mixed.oneOf) {
|
|
11651
|
-
let
|
|
12061
|
+
let next = this.clone();
|
|
11652
12062
|
enums.forEach((val) => {
|
|
11653
|
-
|
|
11654
|
-
|
|
12063
|
+
next._whitelist.add(val);
|
|
12064
|
+
next._blacklist.delete(val);
|
|
11655
12065
|
});
|
|
11656
|
-
|
|
12066
|
+
next.internalTests.whiteList = createValidation({
|
|
11657
12067
|
message,
|
|
11658
12068
|
name: "oneOf",
|
|
11659
12069
|
skipAbsent: true,
|
|
@@ -11668,15 +12078,15 @@ attempted value: ${formattedValue}
|
|
|
11668
12078
|
});
|
|
11669
12079
|
}
|
|
11670
12080
|
});
|
|
11671
|
-
return
|
|
12081
|
+
return next;
|
|
11672
12082
|
}
|
|
11673
12083
|
notOneOf(enums, message = mixed.notOneOf) {
|
|
11674
|
-
let
|
|
12084
|
+
let next = this.clone();
|
|
11675
12085
|
enums.forEach((val) => {
|
|
11676
|
-
|
|
11677
|
-
|
|
12086
|
+
next._blacklist.add(val);
|
|
12087
|
+
next._whitelist.delete(val);
|
|
11678
12088
|
});
|
|
11679
|
-
|
|
12089
|
+
next.internalTests.blacklist = createValidation({
|
|
11680
12090
|
message,
|
|
11681
12091
|
name: "notOneOf",
|
|
11682
12092
|
test(value) {
|
|
@@ -11691,12 +12101,12 @@ attempted value: ${formattedValue}
|
|
|
11691
12101
|
return true;
|
|
11692
12102
|
}
|
|
11693
12103
|
});
|
|
11694
|
-
return
|
|
12104
|
+
return next;
|
|
11695
12105
|
}
|
|
11696
12106
|
strip(strip = true) {
|
|
11697
|
-
let
|
|
11698
|
-
|
|
11699
|
-
return
|
|
12107
|
+
let next = this.clone();
|
|
12108
|
+
next.spec.strip = strip;
|
|
12109
|
+
return next;
|
|
11700
12110
|
}
|
|
11701
12111
|
/**
|
|
11702
12112
|
* Return a serialized description of the schema including validations, flags, types etc.
|
|
@@ -11704,57 +12114,29 @@ attempted value: ${formattedValue}
|
|
|
11704
12114
|
* @param options Provide any needed context for resolving runtime schema alterations (lazy, when conditions, etc).
|
|
11705
12115
|
*/
|
|
11706
12116
|
describe(options) {
|
|
11707
|
-
const
|
|
12117
|
+
const next = (options ? this.resolve(options) : this).clone();
|
|
11708
12118
|
const {
|
|
11709
12119
|
label,
|
|
11710
12120
|
meta,
|
|
11711
12121
|
optional,
|
|
11712
12122
|
nullable
|
|
11713
|
-
} =
|
|
12123
|
+
} = next.spec;
|
|
11714
12124
|
const description = {
|
|
11715
12125
|
meta,
|
|
11716
12126
|
label,
|
|
11717
12127
|
optional,
|
|
11718
12128
|
nullable,
|
|
11719
|
-
default:
|
|
11720
|
-
type:
|
|
11721
|
-
oneOf:
|
|
11722
|
-
notOneOf:
|
|
11723
|
-
tests:
|
|
11724
|
-
|
|
11725
|
-
|
|
11726
|
-
|
|
11727
|
-
params
|
|
11728
|
-
};
|
|
11729
|
-
})
|
|
12129
|
+
default: next.getDefault(options),
|
|
12130
|
+
type: next.type,
|
|
12131
|
+
oneOf: next._whitelist.describe(),
|
|
12132
|
+
notOneOf: next._blacklist.describe(),
|
|
12133
|
+
tests: next.tests.map((fn) => ({
|
|
12134
|
+
name: fn.OPTIONS.name,
|
|
12135
|
+
params: fn.OPTIONS.params
|
|
12136
|
+
})).filter((n, idx, list) => list.findIndex((c) => c.name === n.name) === idx)
|
|
11730
12137
|
};
|
|
11731
12138
|
return description;
|
|
11732
12139
|
}
|
|
11733
|
-
get ["~standard"]() {
|
|
11734
|
-
const schema = this;
|
|
11735
|
-
const standard = {
|
|
11736
|
-
version: 1,
|
|
11737
|
-
vendor: "yup",
|
|
11738
|
-
async validate(value) {
|
|
11739
|
-
try {
|
|
11740
|
-
const result = await schema.validate(value, {
|
|
11741
|
-
abortEarly: false
|
|
11742
|
-
});
|
|
11743
|
-
return {
|
|
11744
|
-
value: result
|
|
11745
|
-
};
|
|
11746
|
-
} catch (err) {
|
|
11747
|
-
if (err instanceof ValidationError) {
|
|
11748
|
-
return {
|
|
11749
|
-
issues: issuesFromValidationError(err)
|
|
11750
|
-
};
|
|
11751
|
-
}
|
|
11752
|
-
throw err;
|
|
11753
|
-
}
|
|
11754
|
-
}
|
|
11755
|
-
};
|
|
11756
|
-
return standard;
|
|
11757
|
-
}
|
|
11758
12140
|
}
|
|
11759
12141
|
Schema.prototype.__isYupSchema__ = true;
|
|
11760
12142
|
for (const method of ["validate", "validateSync"]) Schema.prototype[`${method}At`] = function(path, value, options = {}) {
|
|
@@ -11853,8 +12235,8 @@ class StringSchema extends Schema {
|
|
|
11853
12235
|
}
|
|
11854
12236
|
});
|
|
11855
12237
|
this.withMutation(() => {
|
|
11856
|
-
this.transform((value, _raw) => {
|
|
11857
|
-
if (!
|
|
12238
|
+
this.transform((value, _raw, ctx) => {
|
|
12239
|
+
if (!ctx.spec.coerce || ctx.isType(value)) return value;
|
|
11858
12240
|
if (Array.isArray(value)) return value;
|
|
11859
12241
|
const strValue = value != null && value.toString ? value.toString() : value;
|
|
11860
12242
|
if (strValue === objStringTag) return value;
|
|
@@ -11876,17 +12258,17 @@ class StringSchema extends Schema {
|
|
|
11876
12258
|
return schema;
|
|
11877
12259
|
});
|
|
11878
12260
|
}
|
|
11879
|
-
length(
|
|
12261
|
+
length(length, message = string.length) {
|
|
11880
12262
|
return this.test({
|
|
11881
12263
|
message,
|
|
11882
12264
|
name: "length",
|
|
11883
12265
|
exclusive: true,
|
|
11884
12266
|
params: {
|
|
11885
|
-
length
|
|
12267
|
+
length
|
|
11886
12268
|
},
|
|
11887
12269
|
skipAbsent: true,
|
|
11888
12270
|
test(value) {
|
|
11889
|
-
return value.length === this.resolve(
|
|
12271
|
+
return value.length === this.resolve(length);
|
|
11890
12272
|
}
|
|
11891
12273
|
});
|
|
11892
12274
|
}
|
|
@@ -12056,15 +12438,15 @@ class NumberSchema extends Schema {
|
|
|
12056
12438
|
}
|
|
12057
12439
|
});
|
|
12058
12440
|
this.withMutation(() => {
|
|
12059
|
-
this.transform((value, _raw) => {
|
|
12060
|
-
if (!
|
|
12441
|
+
this.transform((value, _raw, ctx) => {
|
|
12442
|
+
if (!ctx.spec.coerce) return value;
|
|
12061
12443
|
let parsed = value;
|
|
12062
12444
|
if (typeof parsed === "string") {
|
|
12063
12445
|
parsed = parsed.replace(/\s/g, "");
|
|
12064
12446
|
if (parsed === "") return NaN;
|
|
12065
12447
|
parsed = +parsed;
|
|
12066
12448
|
}
|
|
12067
|
-
if (
|
|
12449
|
+
if (ctx.isType(parsed) || parsed === null) return parsed;
|
|
12068
12450
|
return parseFloat(parsed);
|
|
12069
12451
|
});
|
|
12070
12452
|
});
|
|
@@ -12163,8 +12545,8 @@ class DateSchema extends Schema {
|
|
|
12163
12545
|
}
|
|
12164
12546
|
});
|
|
12165
12547
|
this.withMutation(() => {
|
|
12166
|
-
this.transform((value, _raw) => {
|
|
12167
|
-
if (!
|
|
12548
|
+
this.transform((value, _raw, ctx) => {
|
|
12549
|
+
if (!ctx.spec.coerce || ctx.isType(value) || value === null) return value;
|
|
12168
12550
|
value = parseIsoDate(value);
|
|
12169
12551
|
return !isNaN(value) ? new Date(value) : DateSchema.INVALID_DATE;
|
|
12170
12552
|
});
|
|
@@ -12218,9 +12600,9 @@ function sortFields(fields, excludedEdges = []) {
|
|
|
12218
12600
|
let nodes = /* @__PURE__ */ new Set();
|
|
12219
12601
|
let excludes = new Set(excludedEdges.map(([a, b]) => `${a}-${b}`));
|
|
12220
12602
|
function addNode(depPath, key) {
|
|
12221
|
-
let
|
|
12222
|
-
nodes.add(
|
|
12223
|
-
if (!excludes.has(`${key}-${
|
|
12603
|
+
let node = propertyExprExports.split(depPath)[0];
|
|
12604
|
+
nodes.add(node);
|
|
12605
|
+
if (!excludes.has(`${key}-${node}`)) edges.push([key, node]);
|
|
12224
12606
|
}
|
|
12225
12607
|
for (const key of Object.keys(fields)) {
|
|
12226
12608
|
let value = fields[key];
|
|
@@ -12246,7 +12628,7 @@ function sortByKeyOrder(keys2) {
|
|
|
12246
12628
|
return findIndex(keys2, a) - findIndex(keys2, b);
|
|
12247
12629
|
};
|
|
12248
12630
|
}
|
|
12249
|
-
const parseJson = (value, _,
|
|
12631
|
+
const parseJson = (value, _, ctx) => {
|
|
12250
12632
|
if (typeof value !== "string") {
|
|
12251
12633
|
return value;
|
|
12252
12634
|
}
|
|
@@ -12255,7 +12637,7 @@ const parseJson = (value, _, schema) => {
|
|
|
12255
12637
|
parsed = JSON.parse(value);
|
|
12256
12638
|
} catch (err) {
|
|
12257
12639
|
}
|
|
12258
|
-
return
|
|
12640
|
+
return ctx.isType(parsed) ? parsed : value;
|
|
12259
12641
|
};
|
|
12260
12642
|
function deepPartial(schema) {
|
|
12261
12643
|
if ("fields" in schema) {
|
|
@@ -12331,9 +12713,9 @@ class ObjectSchema extends Schema {
|
|
|
12331
12713
|
for (const prop of props) {
|
|
12332
12714
|
let field = fields[prop];
|
|
12333
12715
|
let exists = prop in value;
|
|
12334
|
-
let inputValue = value[prop];
|
|
12335
12716
|
if (field) {
|
|
12336
12717
|
let fieldValue;
|
|
12718
|
+
let inputValue = value[prop];
|
|
12337
12719
|
innerOptions.path = (options.path ? `${options.path}.` : "") + prop;
|
|
12338
12720
|
field = field.resolve({
|
|
12339
12721
|
value: inputValue,
|
|
@@ -12346,20 +12728,23 @@ class ObjectSchema extends Schema {
|
|
|
12346
12728
|
isChanged = isChanged || prop in value;
|
|
12347
12729
|
continue;
|
|
12348
12730
|
}
|
|
12349
|
-
fieldValue = !options.__validating || !strict ?
|
|
12731
|
+
fieldValue = !options.__validating || !strict ? (
|
|
12732
|
+
// TODO: use _cast, this is double resolving
|
|
12733
|
+
field.cast(value[prop], innerOptions)
|
|
12734
|
+
) : value[prop];
|
|
12350
12735
|
if (fieldValue !== void 0) {
|
|
12351
12736
|
intermediateValue[prop] = fieldValue;
|
|
12352
12737
|
}
|
|
12353
12738
|
} else if (exists && !strip) {
|
|
12354
|
-
intermediateValue[prop] =
|
|
12739
|
+
intermediateValue[prop] = value[prop];
|
|
12355
12740
|
}
|
|
12356
|
-
if (exists !== prop in intermediateValue || intermediateValue[prop] !==
|
|
12741
|
+
if (exists !== prop in intermediateValue || intermediateValue[prop] !== value[prop]) {
|
|
12357
12742
|
isChanged = true;
|
|
12358
12743
|
}
|
|
12359
12744
|
}
|
|
12360
12745
|
return isChanged ? intermediateValue : value;
|
|
12361
12746
|
}
|
|
12362
|
-
_validate(_value, options = {}, panic,
|
|
12747
|
+
_validate(_value, options = {}, panic, next) {
|
|
12363
12748
|
let {
|
|
12364
12749
|
from: from2 = [],
|
|
12365
12750
|
originalValue = _value,
|
|
@@ -12373,7 +12758,7 @@ class ObjectSchema extends Schema {
|
|
|
12373
12758
|
options.originalValue = originalValue;
|
|
12374
12759
|
super._validate(_value, options, panic, (objectErrors, value) => {
|
|
12375
12760
|
if (!recursive || !isObject2(value)) {
|
|
12376
|
-
|
|
12761
|
+
next(objectErrors, value);
|
|
12377
12762
|
return;
|
|
12378
12763
|
}
|
|
12379
12764
|
originalValue = originalValue || value;
|
|
@@ -12397,26 +12782,26 @@ class ObjectSchema extends Schema {
|
|
|
12397
12782
|
originalValue,
|
|
12398
12783
|
options
|
|
12399
12784
|
}, panic, (fieldErrors) => {
|
|
12400
|
-
|
|
12785
|
+
next(fieldErrors.sort(this._sortErrors).concat(objectErrors), value);
|
|
12401
12786
|
});
|
|
12402
12787
|
});
|
|
12403
12788
|
}
|
|
12404
12789
|
clone(spec) {
|
|
12405
|
-
const
|
|
12406
|
-
|
|
12407
|
-
|
|
12408
|
-
|
|
12409
|
-
|
|
12410
|
-
return
|
|
12790
|
+
const next = super.clone(spec);
|
|
12791
|
+
next.fields = Object.assign({}, this.fields);
|
|
12792
|
+
next._nodes = this._nodes;
|
|
12793
|
+
next._excludedEdges = this._excludedEdges;
|
|
12794
|
+
next._sortErrors = this._sortErrors;
|
|
12795
|
+
return next;
|
|
12411
12796
|
}
|
|
12412
12797
|
concat(schema) {
|
|
12413
|
-
let
|
|
12414
|
-
let nextFields =
|
|
12798
|
+
let next = super.concat(schema);
|
|
12799
|
+
let nextFields = next.fields;
|
|
12415
12800
|
for (let [field, schemaOrRef] of Object.entries(this.fields)) {
|
|
12416
12801
|
const target = nextFields[field];
|
|
12417
12802
|
nextFields[field] = target === void 0 ? schemaOrRef : target;
|
|
12418
12803
|
}
|
|
12419
|
-
return
|
|
12804
|
+
return next.withMutation((s) => (
|
|
12420
12805
|
// XXX: excludes here is wrong
|
|
12421
12806
|
s.setFields(nextFields, [...this._excludedEdges, ...schema._excludedEdges])
|
|
12422
12807
|
));
|
|
@@ -12444,21 +12829,21 @@ class ObjectSchema extends Schema {
|
|
|
12444
12829
|
return dft;
|
|
12445
12830
|
}
|
|
12446
12831
|
setFields(shape, excludedEdges) {
|
|
12447
|
-
let
|
|
12448
|
-
|
|
12449
|
-
|
|
12450
|
-
|
|
12451
|
-
if (excludedEdges)
|
|
12452
|
-
return
|
|
12832
|
+
let next = this.clone();
|
|
12833
|
+
next.fields = shape;
|
|
12834
|
+
next._nodes = sortFields(shape, excludedEdges);
|
|
12835
|
+
next._sortErrors = sortByKeyOrder(Object.keys(shape));
|
|
12836
|
+
if (excludedEdges) next._excludedEdges = excludedEdges;
|
|
12837
|
+
return next;
|
|
12453
12838
|
}
|
|
12454
12839
|
shape(additions, excludes = []) {
|
|
12455
|
-
return this.clone().withMutation((
|
|
12456
|
-
let edges =
|
|
12840
|
+
return this.clone().withMutation((next) => {
|
|
12841
|
+
let edges = next._excludedEdges;
|
|
12457
12842
|
if (excludes.length) {
|
|
12458
12843
|
if (!Array.isArray(excludes[0])) excludes = [excludes];
|
|
12459
|
-
edges = [...
|
|
12844
|
+
edges = [...next._excludedEdges, ...excludes];
|
|
12460
12845
|
}
|
|
12461
|
-
return
|
|
12846
|
+
return next.setFields(Object.assign(next.fields, additions), edges);
|
|
12462
12847
|
});
|
|
12463
12848
|
}
|
|
12464
12849
|
partial() {
|
|
@@ -12469,8 +12854,8 @@ class ObjectSchema extends Schema {
|
|
|
12469
12854
|
return this.setFields(partial);
|
|
12470
12855
|
}
|
|
12471
12856
|
deepPartial() {
|
|
12472
|
-
const
|
|
12473
|
-
return
|
|
12857
|
+
const next = deepPartial(this);
|
|
12858
|
+
return next;
|
|
12474
12859
|
}
|
|
12475
12860
|
pick(keys2) {
|
|
12476
12861
|
const picked = {};
|
|
@@ -12533,7 +12918,7 @@ class ObjectSchema extends Schema {
|
|
|
12533
12918
|
message = noAllow;
|
|
12534
12919
|
noAllow = true;
|
|
12535
12920
|
}
|
|
12536
|
-
let
|
|
12921
|
+
let next = this.test({
|
|
12537
12922
|
name: "noUnknown",
|
|
12538
12923
|
exclusive: true,
|
|
12539
12924
|
message,
|
|
@@ -12547,8 +12932,8 @@ class ObjectSchema extends Schema {
|
|
|
12547
12932
|
});
|
|
12548
12933
|
}
|
|
12549
12934
|
});
|
|
12550
|
-
|
|
12551
|
-
return
|
|
12935
|
+
next.spec.noUnknown = noAllow;
|
|
12936
|
+
return next;
|
|
12552
12937
|
}
|
|
12553
12938
|
unknown(allow = true, message = object.noUnknown) {
|
|
12554
12939
|
return this.noUnknown(!allow, message);
|
|
@@ -12571,10 +12956,10 @@ class ObjectSchema extends Schema {
|
|
|
12571
12956
|
return this.transformKeys((key) => tinyCaseExports.snakeCase(key).toUpperCase());
|
|
12572
12957
|
}
|
|
12573
12958
|
describe(options) {
|
|
12574
|
-
const
|
|
12959
|
+
const next = (options ? this.resolve(options) : this).clone();
|
|
12575
12960
|
const base = super.describe(options);
|
|
12576
12961
|
base.fields = {};
|
|
12577
|
-
for (const [key, value] of Object.entries(
|
|
12962
|
+
for (const [key, value] of Object.entries(next.fields)) {
|
|
12578
12963
|
var _innerOptions2;
|
|
12579
12964
|
let innerOptions = options;
|
|
12580
12965
|
if ((_innerOptions2 = innerOptions) != null && _innerOptions2.value) {
|
|
@@ -12687,8 +13072,8 @@ function requireDist() {
|
|
|
12687
13072
|
dist.default = urlcat2;
|
|
12688
13073
|
function urlcatImpl(pathTemplate, params, baseUrl) {
|
|
12689
13074
|
var _a = path(pathTemplate, params), renderedPath = _a.renderedPath, remainingParams = _a.remainingParams;
|
|
12690
|
-
var
|
|
12691
|
-
var renderedQuery = query(
|
|
13075
|
+
var cleanParams2 = removeNullOrUndef(remainingParams);
|
|
13076
|
+
var renderedQuery = query(cleanParams2);
|
|
12692
13077
|
var pathAndQuery = join(renderedPath, "?", renderedQuery);
|
|
12693
13078
|
return baseUrl ? join(baseUrl, "/", pathAndQuery) : pathAndQuery;
|
|
12694
13079
|
}
|
|
@@ -13327,13 +13712,13 @@ function ViewProfileDialog({ userData, setInitialState, isOpen }) {
|
|
|
13327
13712
|
Dialog,
|
|
13328
13713
|
{
|
|
13329
13714
|
fullWidth: false,
|
|
13330
|
-
sx: { "& .MuiPaper-root": { maxWidth: "800px", borderRadius: "12px"
|
|
13715
|
+
sx: { "& .MuiPaper-root": { maxWidth: "800px", borderRadius: "12px" } },
|
|
13331
13716
|
onClose: () => handleCloseUtil(setInitialState),
|
|
13332
13717
|
open: isOpen,
|
|
13333
13718
|
"aria-labelledby": "draggable-dialog-title",
|
|
13334
13719
|
children: [
|
|
13335
13720
|
/* @__PURE__ */ jsxs(ProfileStyled, { children: [
|
|
13336
|
-
/* @__PURE__ */ jsx(Box, { sx: { textAlign: "right", padding: "10px 10px" }, children: /* @__PURE__ */ jsx(
|
|
13721
|
+
/* @__PURE__ */ jsx(Box, { sx: { textAlign: "right", padding: "10px 10px 0px 0px" }, children: /* @__PURE__ */ jsx(
|
|
13337
13722
|
IconButton,
|
|
13338
13723
|
{
|
|
13339
13724
|
onClick: () => setInitialState((p) => ({ ...p, toggles: { ...p.toggles, viewProfile: false } })),
|
|
@@ -13342,7 +13727,7 @@ function ViewProfileDialog({ userData, setInitialState, isOpen }) {
|
|
|
13342
13727
|
children: /* @__PURE__ */ jsx(CloseIcon, {})
|
|
13343
13728
|
}
|
|
13344
13729
|
) }),
|
|
13345
|
-
/* @__PURE__ */ jsx(Box, { sx: { p: 2
|
|
13730
|
+
/* @__PURE__ */ jsx(Box, { sx: { p: 2 }, children: /* @__PURE__ */ jsxs(Grid, { container: true, spacing: 2, children: [
|
|
13346
13731
|
/* @__PURE__ */ jsxs(Grid, { item: true, xs: 12, lg: 5, children: [
|
|
13347
13732
|
/* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(
|
|
13348
13733
|
Avatar,
|
|
@@ -13513,7 +13898,7 @@ function ChangePasswordDialog({ isOpen, email, t: t2, setInitialState }) {
|
|
|
13513
13898
|
onClose: () => handleCloseUtil(setInitialState),
|
|
13514
13899
|
open: isOpen,
|
|
13515
13900
|
"aria-labelledby": "draggable-dialog-title",
|
|
13516
|
-
children: /* @__PURE__ */ jsx("form", { onSubmit: formik.handleSubmit, children: /* @__PURE__ */ jsx(ChangePasswordStyled, { children: /* @__PURE__ */ jsxs(Box, { sx: {
|
|
13901
|
+
children: /* @__PURE__ */ jsx("form", { onSubmit: formik.handleSubmit, children: /* @__PURE__ */ jsx(ChangePasswordStyled, { children: /* @__PURE__ */ jsxs(Box, { sx: { pr: { xs: 0, lg: 8 }, p: 2 }, children: [
|
|
13517
13902
|
/* @__PURE__ */ jsx(Typography, { variant: "h6", sx: { display: "flex", alignItems: "center" }, className: "Heading", children: "Change Password" }),
|
|
13518
13903
|
/* @__PURE__ */ jsx(
|
|
13519
13904
|
Box,
|
|
@@ -13525,7 +13910,7 @@ function ChangePasswordDialog({ isOpen, email, t: t2, setInitialState }) {
|
|
|
13525
13910
|
mt: 2
|
|
13526
13911
|
},
|
|
13527
13912
|
children: /* @__PURE__ */ jsxs(Grid, { container: true, spacing: 2, children: [
|
|
13528
|
-
/* @__PURE__ */ jsxs(Grid, { item: true, xs: 12,
|
|
13913
|
+
/* @__PURE__ */ jsxs(Grid, { item: true, xs: 12, lg: 6, children: [
|
|
13529
13914
|
/* @__PURE__ */ jsx(
|
|
13530
13915
|
LabeledInput,
|
|
13531
13916
|
{
|
|
@@ -13533,13 +13918,12 @@ function ChangePasswordDialog({ isOpen, email, t: t2, setInitialState }) {
|
|
|
13533
13918
|
label: t2("New password"),
|
|
13534
13919
|
fullWidth: true,
|
|
13535
13920
|
size: "small",
|
|
13536
|
-
...formik.getFieldProps("newPassword")
|
|
13537
|
-
sx: { width: { md: "93%", lg: "93%", xs: "99%" } }
|
|
13921
|
+
...formik.getFieldProps("newPassword")
|
|
13538
13922
|
}
|
|
13539
13923
|
),
|
|
13540
13924
|
/* @__PURE__ */ jsx(ErrorMessage, { formik, fieldName: "newPassword" })
|
|
13541
13925
|
] }),
|
|
13542
|
-
/* @__PURE__ */ jsxs(Grid, { item: true, xs: 12,
|
|
13926
|
+
/* @__PURE__ */ jsxs(Grid, { item: true, xs: 12, lg: 6, children: [
|
|
13543
13927
|
/* @__PURE__ */ jsx(
|
|
13544
13928
|
LabeledInput,
|
|
13545
13929
|
{
|
|
@@ -13547,8 +13931,7 @@ function ChangePasswordDialog({ isOpen, email, t: t2, setInitialState }) {
|
|
|
13547
13931
|
label: t2("Confirm new password"),
|
|
13548
13932
|
fullWidth: true,
|
|
13549
13933
|
size: "small",
|
|
13550
|
-
...formik.getFieldProps("passwordConfirmation")
|
|
13551
|
-
sx: { width: { md: "99%", lg: "99%", xs: "99%" } }
|
|
13934
|
+
...formik.getFieldProps("passwordConfirmation")
|
|
13552
13935
|
}
|
|
13553
13936
|
),
|
|
13554
13937
|
/* @__PURE__ */ jsx(ErrorMessage, { formik, fieldName: "passwordConfirmation" })
|
|
@@ -13558,7 +13941,7 @@ function ChangePasswordDialog({ isOpen, email, t: t2, setInitialState }) {
|
|
|
13558
13941
|
{
|
|
13559
13942
|
isLoading: formik.isSubmitting,
|
|
13560
13943
|
className: "invite",
|
|
13561
|
-
sx: { width: "auto !important"
|
|
13944
|
+
sx: { width: "auto !important" },
|
|
13562
13945
|
type: "submit",
|
|
13563
13946
|
disabled: formik.isSubmitting,
|
|
13564
13947
|
btnTitle: t2("Change Password")
|
|
@@ -13870,7 +14253,7 @@ function parseThreshold(scrollThreshold) {
|
|
|
13870
14253
|
}
|
|
13871
14254
|
var InfiniteScroll = (
|
|
13872
14255
|
/** @class */
|
|
13873
|
-
|
|
14256
|
+
function(_super) {
|
|
13874
14257
|
__extends(InfiniteScroll2, _super);
|
|
13875
14258
|
function InfiniteScroll2(props) {
|
|
13876
14259
|
var _this = _super.call(this, props) || this;
|
|
@@ -14085,7 +14468,7 @@ var InfiniteScroll = (
|
|
|
14085
14468
|
);
|
|
14086
14469
|
};
|
|
14087
14470
|
return InfiniteScroll2;
|
|
14088
|
-
}
|
|
14471
|
+
}(Component)
|
|
14089
14472
|
);
|
|
14090
14473
|
const Notification = ({ setInitialState, notificationAccessApps, initialState, t: t2 }) => {
|
|
14091
14474
|
const [notifications, setNotifications] = useState([]);
|
|
@@ -14129,8 +14512,8 @@ const Notification = ({ setInitialState, notificationAccessApps, initialState, t
|
|
|
14129
14512
|
return;
|
|
14130
14513
|
}
|
|
14131
14514
|
const newNotifications = pager?.data?.map((itm) => transformNotifications(itm));
|
|
14132
|
-
setNotifications((
|
|
14133
|
-
setPage((
|
|
14515
|
+
setNotifications((prev) => [...prev, ...newNotifications]);
|
|
14516
|
+
setPage((prev) => prev + 1);
|
|
14134
14517
|
}
|
|
14135
14518
|
};
|
|
14136
14519
|
return /* @__PURE__ */ jsx(ClickAwayListener, { onClickAway: () => handleCloseUtil(setInitialState), children: /* @__PURE__ */ jsxs(
|
|
@@ -14497,7 +14880,7 @@ const UserProfile = ({ t: t2, userData, setInitialState, extraMenuOptions, route
|
|
|
14497
14880
|
] }) })
|
|
14498
14881
|
] });
|
|
14499
14882
|
};
|
|
14500
|
-
const Header
|
|
14883
|
+
const Header = ({
|
|
14501
14884
|
router,
|
|
14502
14885
|
frontCustomComponent,
|
|
14503
14886
|
endCustomComponents,
|
|
@@ -15103,804 +15486,6 @@ const PreviousLoginBanner = ({ t: t2, router, sx }) => {
|
|
|
15103
15486
|
}
|
|
15104
15487
|
);
|
|
15105
15488
|
};
|
|
15106
|
-
function sheetForTag(tag) {
|
|
15107
|
-
if (tag.sheet) {
|
|
15108
|
-
return tag.sheet;
|
|
15109
|
-
}
|
|
15110
|
-
for (var i = 0; i < document.styleSheets.length; i++) {
|
|
15111
|
-
if (document.styleSheets[i].ownerNode === tag) {
|
|
15112
|
-
return document.styleSheets[i];
|
|
15113
|
-
}
|
|
15114
|
-
}
|
|
15115
|
-
return void 0;
|
|
15116
|
-
}
|
|
15117
|
-
function createStyleElement(options) {
|
|
15118
|
-
var tag = document.createElement("style");
|
|
15119
|
-
tag.setAttribute("data-emotion", options.key);
|
|
15120
|
-
if (options.nonce !== void 0) {
|
|
15121
|
-
tag.setAttribute("nonce", options.nonce);
|
|
15122
|
-
}
|
|
15123
|
-
tag.appendChild(document.createTextNode(""));
|
|
15124
|
-
tag.setAttribute("data-s", "");
|
|
15125
|
-
return tag;
|
|
15126
|
-
}
|
|
15127
|
-
var StyleSheet = /* @__PURE__ */ (function() {
|
|
15128
|
-
function StyleSheet2(options) {
|
|
15129
|
-
var _this = this;
|
|
15130
|
-
this._insertTag = function(tag) {
|
|
15131
|
-
var before;
|
|
15132
|
-
if (_this.tags.length === 0) {
|
|
15133
|
-
if (_this.insertionPoint) {
|
|
15134
|
-
before = _this.insertionPoint.nextSibling;
|
|
15135
|
-
} else if (_this.prepend) {
|
|
15136
|
-
before = _this.container.firstChild;
|
|
15137
|
-
} else {
|
|
15138
|
-
before = _this.before;
|
|
15139
|
-
}
|
|
15140
|
-
} else {
|
|
15141
|
-
before = _this.tags[_this.tags.length - 1].nextSibling;
|
|
15142
|
-
}
|
|
15143
|
-
_this.container.insertBefore(tag, before);
|
|
15144
|
-
_this.tags.push(tag);
|
|
15145
|
-
};
|
|
15146
|
-
this.isSpeedy = options.speedy === void 0 ? true : options.speedy;
|
|
15147
|
-
this.tags = [];
|
|
15148
|
-
this.ctr = 0;
|
|
15149
|
-
this.nonce = options.nonce;
|
|
15150
|
-
this.key = options.key;
|
|
15151
|
-
this.container = options.container;
|
|
15152
|
-
this.prepend = options.prepend;
|
|
15153
|
-
this.insertionPoint = options.insertionPoint;
|
|
15154
|
-
this.before = null;
|
|
15155
|
-
}
|
|
15156
|
-
var _proto = StyleSheet2.prototype;
|
|
15157
|
-
_proto.hydrate = function hydrate(nodes) {
|
|
15158
|
-
nodes.forEach(this._insertTag);
|
|
15159
|
-
};
|
|
15160
|
-
_proto.insert = function insert(rule) {
|
|
15161
|
-
if (this.ctr % (this.isSpeedy ? 65e3 : 1) === 0) {
|
|
15162
|
-
this._insertTag(createStyleElement(this));
|
|
15163
|
-
}
|
|
15164
|
-
var tag = this.tags[this.tags.length - 1];
|
|
15165
|
-
if (this.isSpeedy) {
|
|
15166
|
-
var sheet = sheetForTag(tag);
|
|
15167
|
-
try {
|
|
15168
|
-
sheet.insertRule(rule, sheet.cssRules.length);
|
|
15169
|
-
} catch (e) {
|
|
15170
|
-
}
|
|
15171
|
-
} else {
|
|
15172
|
-
tag.appendChild(document.createTextNode(rule));
|
|
15173
|
-
}
|
|
15174
|
-
this.ctr++;
|
|
15175
|
-
};
|
|
15176
|
-
_proto.flush = function flush() {
|
|
15177
|
-
this.tags.forEach(function(tag) {
|
|
15178
|
-
var _tag$parentNode;
|
|
15179
|
-
return (_tag$parentNode = tag.parentNode) == null ? void 0 : _tag$parentNode.removeChild(tag);
|
|
15180
|
-
});
|
|
15181
|
-
this.tags = [];
|
|
15182
|
-
this.ctr = 0;
|
|
15183
|
-
};
|
|
15184
|
-
return StyleSheet2;
|
|
15185
|
-
})();
|
|
15186
|
-
var MS = "-ms-";
|
|
15187
|
-
var MOZ = "-moz-";
|
|
15188
|
-
var WEBKIT = "-webkit-";
|
|
15189
|
-
var COMMENT = "comm";
|
|
15190
|
-
var RULESET = "rule";
|
|
15191
|
-
var DECLARATION = "decl";
|
|
15192
|
-
var IMPORT = "@import";
|
|
15193
|
-
var KEYFRAMES = "@keyframes";
|
|
15194
|
-
var LAYER = "@layer";
|
|
15195
|
-
var abs = Math.abs;
|
|
15196
|
-
var from = String.fromCharCode;
|
|
15197
|
-
var assign = Object.assign;
|
|
15198
|
-
function hash(value, length2) {
|
|
15199
|
-
return charat(value, 0) ^ 45 ? (((length2 << 2 ^ charat(value, 0)) << 2 ^ charat(value, 1)) << 2 ^ charat(value, 2)) << 2 ^ charat(value, 3) : 0;
|
|
15200
|
-
}
|
|
15201
|
-
function trim(value) {
|
|
15202
|
-
return value.trim();
|
|
15203
|
-
}
|
|
15204
|
-
function match(value, pattern) {
|
|
15205
|
-
return (value = pattern.exec(value)) ? value[0] : value;
|
|
15206
|
-
}
|
|
15207
|
-
function replace(value, pattern, replacement) {
|
|
15208
|
-
return value.replace(pattern, replacement);
|
|
15209
|
-
}
|
|
15210
|
-
function indexof(value, search) {
|
|
15211
|
-
return value.indexOf(search);
|
|
15212
|
-
}
|
|
15213
|
-
function charat(value, index) {
|
|
15214
|
-
return value.charCodeAt(index) | 0;
|
|
15215
|
-
}
|
|
15216
|
-
function substr(value, begin, end) {
|
|
15217
|
-
return value.slice(begin, end);
|
|
15218
|
-
}
|
|
15219
|
-
function strlen(value) {
|
|
15220
|
-
return value.length;
|
|
15221
|
-
}
|
|
15222
|
-
function sizeof(value) {
|
|
15223
|
-
return value.length;
|
|
15224
|
-
}
|
|
15225
|
-
function append(value, array2) {
|
|
15226
|
-
return array2.push(value), value;
|
|
15227
|
-
}
|
|
15228
|
-
function combine(array2, callback) {
|
|
15229
|
-
return array2.map(callback).join("");
|
|
15230
|
-
}
|
|
15231
|
-
var line = 1;
|
|
15232
|
-
var column = 1;
|
|
15233
|
-
var length = 0;
|
|
15234
|
-
var position = 0;
|
|
15235
|
-
var character = 0;
|
|
15236
|
-
var characters = "";
|
|
15237
|
-
function node(value, root2, parent, type, props, children, length2) {
|
|
15238
|
-
return { value, root: root2, parent, type, props, children, line, column, length: length2, return: "" };
|
|
15239
|
-
}
|
|
15240
|
-
function copy(root2, props) {
|
|
15241
|
-
return assign(node("", null, null, "", null, null, 0), root2, { length: -root2.length }, props);
|
|
15242
|
-
}
|
|
15243
|
-
function char() {
|
|
15244
|
-
return character;
|
|
15245
|
-
}
|
|
15246
|
-
function prev() {
|
|
15247
|
-
character = position > 0 ? charat(characters, --position) : 0;
|
|
15248
|
-
if (column--, character === 10)
|
|
15249
|
-
column = 1, line--;
|
|
15250
|
-
return character;
|
|
15251
|
-
}
|
|
15252
|
-
function next() {
|
|
15253
|
-
character = position < length ? charat(characters, position++) : 0;
|
|
15254
|
-
if (column++, character === 10)
|
|
15255
|
-
column = 1, line++;
|
|
15256
|
-
return character;
|
|
15257
|
-
}
|
|
15258
|
-
function peek() {
|
|
15259
|
-
return charat(characters, position);
|
|
15260
|
-
}
|
|
15261
|
-
function caret() {
|
|
15262
|
-
return position;
|
|
15263
|
-
}
|
|
15264
|
-
function slice(begin, end) {
|
|
15265
|
-
return substr(characters, begin, end);
|
|
15266
|
-
}
|
|
15267
|
-
function token(type) {
|
|
15268
|
-
switch (type) {
|
|
15269
|
-
// \0 \t \n \r \s whitespace token
|
|
15270
|
-
case 0:
|
|
15271
|
-
case 9:
|
|
15272
|
-
case 10:
|
|
15273
|
-
case 13:
|
|
15274
|
-
case 32:
|
|
15275
|
-
return 5;
|
|
15276
|
-
// ! + , / > @ ~ isolate token
|
|
15277
|
-
case 33:
|
|
15278
|
-
case 43:
|
|
15279
|
-
case 44:
|
|
15280
|
-
case 47:
|
|
15281
|
-
case 62:
|
|
15282
|
-
case 64:
|
|
15283
|
-
case 126:
|
|
15284
|
-
// ; { } breakpoint token
|
|
15285
|
-
case 59:
|
|
15286
|
-
case 123:
|
|
15287
|
-
case 125:
|
|
15288
|
-
return 4;
|
|
15289
|
-
// : accompanied token
|
|
15290
|
-
case 58:
|
|
15291
|
-
return 3;
|
|
15292
|
-
// " ' ( [ opening delimit token
|
|
15293
|
-
case 34:
|
|
15294
|
-
case 39:
|
|
15295
|
-
case 40:
|
|
15296
|
-
case 91:
|
|
15297
|
-
return 2;
|
|
15298
|
-
// ) ] closing delimit token
|
|
15299
|
-
case 41:
|
|
15300
|
-
case 93:
|
|
15301
|
-
return 1;
|
|
15302
|
-
}
|
|
15303
|
-
return 0;
|
|
15304
|
-
}
|
|
15305
|
-
function alloc(value) {
|
|
15306
|
-
return line = column = 1, length = strlen(characters = value), position = 0, [];
|
|
15307
|
-
}
|
|
15308
|
-
function dealloc(value) {
|
|
15309
|
-
return characters = "", value;
|
|
15310
|
-
}
|
|
15311
|
-
function delimit(type) {
|
|
15312
|
-
return trim(slice(position - 1, delimiter(type === 91 ? type + 2 : type === 40 ? type + 1 : type)));
|
|
15313
|
-
}
|
|
15314
|
-
function whitespace(type) {
|
|
15315
|
-
while (character = peek())
|
|
15316
|
-
if (character < 33)
|
|
15317
|
-
next();
|
|
15318
|
-
else
|
|
15319
|
-
break;
|
|
15320
|
-
return token(type) > 2 || token(character) > 3 ? "" : " ";
|
|
15321
|
-
}
|
|
15322
|
-
function escaping(index, count) {
|
|
15323
|
-
while (--count && next())
|
|
15324
|
-
if (character < 48 || character > 102 || character > 57 && character < 65 || character > 70 && character < 97)
|
|
15325
|
-
break;
|
|
15326
|
-
return slice(index, caret() + (count < 6 && peek() == 32 && next() == 32));
|
|
15327
|
-
}
|
|
15328
|
-
function delimiter(type) {
|
|
15329
|
-
while (next())
|
|
15330
|
-
switch (character) {
|
|
15331
|
-
// ] ) " '
|
|
15332
|
-
case type:
|
|
15333
|
-
return position;
|
|
15334
|
-
// " '
|
|
15335
|
-
case 34:
|
|
15336
|
-
case 39:
|
|
15337
|
-
if (type !== 34 && type !== 39)
|
|
15338
|
-
delimiter(character);
|
|
15339
|
-
break;
|
|
15340
|
-
// (
|
|
15341
|
-
case 40:
|
|
15342
|
-
if (type === 41)
|
|
15343
|
-
delimiter(type);
|
|
15344
|
-
break;
|
|
15345
|
-
// \
|
|
15346
|
-
case 92:
|
|
15347
|
-
next();
|
|
15348
|
-
break;
|
|
15349
|
-
}
|
|
15350
|
-
return position;
|
|
15351
|
-
}
|
|
15352
|
-
function commenter(type, index) {
|
|
15353
|
-
while (next())
|
|
15354
|
-
if (type + character === 47 + 10)
|
|
15355
|
-
break;
|
|
15356
|
-
else if (type + character === 42 + 42 && peek() === 47)
|
|
15357
|
-
break;
|
|
15358
|
-
return "/*" + slice(index, position - 1) + "*" + from(type === 47 ? type : next());
|
|
15359
|
-
}
|
|
15360
|
-
function identifier(index) {
|
|
15361
|
-
while (!token(peek()))
|
|
15362
|
-
next();
|
|
15363
|
-
return slice(index, position);
|
|
15364
|
-
}
|
|
15365
|
-
function compile(value) {
|
|
15366
|
-
return dealloc(parse("", null, null, null, [""], value = alloc(value), 0, [0], value));
|
|
15367
|
-
}
|
|
15368
|
-
function parse(value, root2, parent, rule, rules, rulesets, pseudo, points, declarations) {
|
|
15369
|
-
var index = 0;
|
|
15370
|
-
var offset2 = 0;
|
|
15371
|
-
var length2 = pseudo;
|
|
15372
|
-
var atrule = 0;
|
|
15373
|
-
var property = 0;
|
|
15374
|
-
var previous = 0;
|
|
15375
|
-
var variable = 1;
|
|
15376
|
-
var scanning = 1;
|
|
15377
|
-
var ampersand = 1;
|
|
15378
|
-
var character2 = 0;
|
|
15379
|
-
var type = "";
|
|
15380
|
-
var props = rules;
|
|
15381
|
-
var children = rulesets;
|
|
15382
|
-
var reference = rule;
|
|
15383
|
-
var characters2 = type;
|
|
15384
|
-
while (scanning)
|
|
15385
|
-
switch (previous = character2, character2 = next()) {
|
|
15386
|
-
// (
|
|
15387
|
-
case 40:
|
|
15388
|
-
if (previous != 108 && charat(characters2, length2 - 1) == 58) {
|
|
15389
|
-
if (indexof(characters2 += replace(delimit(character2), "&", "&\f"), "&\f") != -1)
|
|
15390
|
-
ampersand = -1;
|
|
15391
|
-
break;
|
|
15392
|
-
}
|
|
15393
|
-
// " ' [
|
|
15394
|
-
case 34:
|
|
15395
|
-
case 39:
|
|
15396
|
-
case 91:
|
|
15397
|
-
characters2 += delimit(character2);
|
|
15398
|
-
break;
|
|
15399
|
-
// \t \n \r \s
|
|
15400
|
-
case 9:
|
|
15401
|
-
case 10:
|
|
15402
|
-
case 13:
|
|
15403
|
-
case 32:
|
|
15404
|
-
characters2 += whitespace(previous);
|
|
15405
|
-
break;
|
|
15406
|
-
// \
|
|
15407
|
-
case 92:
|
|
15408
|
-
characters2 += escaping(caret() - 1, 7);
|
|
15409
|
-
continue;
|
|
15410
|
-
// /
|
|
15411
|
-
case 47:
|
|
15412
|
-
switch (peek()) {
|
|
15413
|
-
case 42:
|
|
15414
|
-
case 47:
|
|
15415
|
-
append(comment(commenter(next(), caret()), root2, parent), declarations);
|
|
15416
|
-
break;
|
|
15417
|
-
default:
|
|
15418
|
-
characters2 += "/";
|
|
15419
|
-
}
|
|
15420
|
-
break;
|
|
15421
|
-
// {
|
|
15422
|
-
case 123 * variable:
|
|
15423
|
-
points[index++] = strlen(characters2) * ampersand;
|
|
15424
|
-
// } ; \0
|
|
15425
|
-
case 125 * variable:
|
|
15426
|
-
case 59:
|
|
15427
|
-
case 0:
|
|
15428
|
-
switch (character2) {
|
|
15429
|
-
// \0 }
|
|
15430
|
-
case 0:
|
|
15431
|
-
case 125:
|
|
15432
|
-
scanning = 0;
|
|
15433
|
-
// ;
|
|
15434
|
-
case 59 + offset2:
|
|
15435
|
-
if (ampersand == -1) characters2 = replace(characters2, /\f/g, "");
|
|
15436
|
-
if (property > 0 && strlen(characters2) - length2)
|
|
15437
|
-
append(property > 32 ? declaration(characters2 + ";", rule, parent, length2 - 1) : declaration(replace(characters2, " ", "") + ";", rule, parent, length2 - 2), declarations);
|
|
15438
|
-
break;
|
|
15439
|
-
// @ ;
|
|
15440
|
-
case 59:
|
|
15441
|
-
characters2 += ";";
|
|
15442
|
-
// { rule/at-rule
|
|
15443
|
-
default:
|
|
15444
|
-
append(reference = ruleset(characters2, root2, parent, index, offset2, rules, points, type, props = [], children = [], length2), rulesets);
|
|
15445
|
-
if (character2 === 123)
|
|
15446
|
-
if (offset2 === 0)
|
|
15447
|
-
parse(characters2, root2, reference, reference, props, rulesets, length2, points, children);
|
|
15448
|
-
else
|
|
15449
|
-
switch (atrule === 99 && charat(characters2, 3) === 110 ? 100 : atrule) {
|
|
15450
|
-
// d l m s
|
|
15451
|
-
case 100:
|
|
15452
|
-
case 108:
|
|
15453
|
-
case 109:
|
|
15454
|
-
case 115:
|
|
15455
|
-
parse(value, reference, reference, rule && append(ruleset(value, reference, reference, 0, 0, rules, points, type, rules, props = [], length2), children), rules, children, length2, points, rule ? props : children);
|
|
15456
|
-
break;
|
|
15457
|
-
default:
|
|
15458
|
-
parse(characters2, reference, reference, reference, [""], children, 0, points, children);
|
|
15459
|
-
}
|
|
15460
|
-
}
|
|
15461
|
-
index = offset2 = property = 0, variable = ampersand = 1, type = characters2 = "", length2 = pseudo;
|
|
15462
|
-
break;
|
|
15463
|
-
// :
|
|
15464
|
-
case 58:
|
|
15465
|
-
length2 = 1 + strlen(characters2), property = previous;
|
|
15466
|
-
default:
|
|
15467
|
-
if (variable < 1) {
|
|
15468
|
-
if (character2 == 123)
|
|
15469
|
-
--variable;
|
|
15470
|
-
else if (character2 == 125 && variable++ == 0 && prev() == 125)
|
|
15471
|
-
continue;
|
|
15472
|
-
}
|
|
15473
|
-
switch (characters2 += from(character2), character2 * variable) {
|
|
15474
|
-
// &
|
|
15475
|
-
case 38:
|
|
15476
|
-
ampersand = offset2 > 0 ? 1 : (characters2 += "\f", -1);
|
|
15477
|
-
break;
|
|
15478
|
-
// ,
|
|
15479
|
-
case 44:
|
|
15480
|
-
points[index++] = (strlen(characters2) - 1) * ampersand, ampersand = 1;
|
|
15481
|
-
break;
|
|
15482
|
-
// @
|
|
15483
|
-
case 64:
|
|
15484
|
-
if (peek() === 45)
|
|
15485
|
-
characters2 += delimit(next());
|
|
15486
|
-
atrule = peek(), offset2 = length2 = strlen(type = characters2 += identifier(caret())), character2++;
|
|
15487
|
-
break;
|
|
15488
|
-
// -
|
|
15489
|
-
case 45:
|
|
15490
|
-
if (previous === 45 && strlen(characters2) == 2)
|
|
15491
|
-
variable = 0;
|
|
15492
|
-
}
|
|
15493
|
-
}
|
|
15494
|
-
return rulesets;
|
|
15495
|
-
}
|
|
15496
|
-
function ruleset(value, root2, parent, index, offset2, rules, points, type, props, children, length2) {
|
|
15497
|
-
var post = offset2 - 1;
|
|
15498
|
-
var rule = offset2 === 0 ? rules : [""];
|
|
15499
|
-
var size = sizeof(rule);
|
|
15500
|
-
for (var i = 0, j = 0, k = 0; i < index; ++i)
|
|
15501
|
-
for (var x = 0, y = substr(value, post + 1, post = abs(j = points[i])), z = value; x < size; ++x)
|
|
15502
|
-
if (z = trim(j > 0 ? rule[x] + " " + y : replace(y, /&\f/g, rule[x])))
|
|
15503
|
-
props[k++] = z;
|
|
15504
|
-
return node(value, root2, parent, offset2 === 0 ? RULESET : type, props, children, length2);
|
|
15505
|
-
}
|
|
15506
|
-
function comment(value, root2, parent) {
|
|
15507
|
-
return node(value, root2, parent, COMMENT, from(char()), substr(value, 2, -2), 0);
|
|
15508
|
-
}
|
|
15509
|
-
function declaration(value, root2, parent, length2) {
|
|
15510
|
-
return node(value, root2, parent, DECLARATION, substr(value, 0, length2), substr(value, length2 + 1, -1), length2);
|
|
15511
|
-
}
|
|
15512
|
-
function serialize(children, callback) {
|
|
15513
|
-
var output = "";
|
|
15514
|
-
var length2 = sizeof(children);
|
|
15515
|
-
for (var i = 0; i < length2; i++)
|
|
15516
|
-
output += callback(children[i], i, children, callback) || "";
|
|
15517
|
-
return output;
|
|
15518
|
-
}
|
|
15519
|
-
function stringify(element, index, children, callback) {
|
|
15520
|
-
switch (element.type) {
|
|
15521
|
-
case LAYER:
|
|
15522
|
-
if (element.children.length) break;
|
|
15523
|
-
case IMPORT:
|
|
15524
|
-
case DECLARATION:
|
|
15525
|
-
return element.return = element.return || element.value;
|
|
15526
|
-
case COMMENT:
|
|
15527
|
-
return "";
|
|
15528
|
-
case KEYFRAMES:
|
|
15529
|
-
return element.return = element.value + "{" + serialize(element.children, callback) + "}";
|
|
15530
|
-
case RULESET:
|
|
15531
|
-
element.value = element.props.join(",");
|
|
15532
|
-
}
|
|
15533
|
-
return strlen(children = serialize(element.children, callback)) ? element.return = element.value + "{" + children + "}" : "";
|
|
15534
|
-
}
|
|
15535
|
-
function middleware(collection) {
|
|
15536
|
-
var length2 = sizeof(collection);
|
|
15537
|
-
return function(element, index, children, callback) {
|
|
15538
|
-
var output = "";
|
|
15539
|
-
for (var i = 0; i < length2; i++)
|
|
15540
|
-
output += collection[i](element, index, children, callback) || "";
|
|
15541
|
-
return output;
|
|
15542
|
-
};
|
|
15543
|
-
}
|
|
15544
|
-
function rulesheet(callback) {
|
|
15545
|
-
return function(element) {
|
|
15546
|
-
if (!element.root) {
|
|
15547
|
-
if (element = element.return)
|
|
15548
|
-
callback(element);
|
|
15549
|
-
}
|
|
15550
|
-
};
|
|
15551
|
-
}
|
|
15552
|
-
var identifierWithPointTracking = function identifierWithPointTracking2(begin, points, index) {
|
|
15553
|
-
var previous = 0;
|
|
15554
|
-
var character2 = 0;
|
|
15555
|
-
while (true) {
|
|
15556
|
-
previous = character2;
|
|
15557
|
-
character2 = peek();
|
|
15558
|
-
if (previous === 38 && character2 === 12) {
|
|
15559
|
-
points[index] = 1;
|
|
15560
|
-
}
|
|
15561
|
-
if (token(character2)) {
|
|
15562
|
-
break;
|
|
15563
|
-
}
|
|
15564
|
-
next();
|
|
15565
|
-
}
|
|
15566
|
-
return slice(begin, position);
|
|
15567
|
-
};
|
|
15568
|
-
var toRules = function toRules2(parsed, points) {
|
|
15569
|
-
var index = -1;
|
|
15570
|
-
var character2 = 44;
|
|
15571
|
-
do {
|
|
15572
|
-
switch (token(character2)) {
|
|
15573
|
-
case 0:
|
|
15574
|
-
if (character2 === 38 && peek() === 12) {
|
|
15575
|
-
points[index] = 1;
|
|
15576
|
-
}
|
|
15577
|
-
parsed[index] += identifierWithPointTracking(position - 1, points, index);
|
|
15578
|
-
break;
|
|
15579
|
-
case 2:
|
|
15580
|
-
parsed[index] += delimit(character2);
|
|
15581
|
-
break;
|
|
15582
|
-
case 4:
|
|
15583
|
-
if (character2 === 44) {
|
|
15584
|
-
parsed[++index] = peek() === 58 ? "&\f" : "";
|
|
15585
|
-
points[index] = parsed[index].length;
|
|
15586
|
-
break;
|
|
15587
|
-
}
|
|
15588
|
-
// fallthrough
|
|
15589
|
-
default:
|
|
15590
|
-
parsed[index] += from(character2);
|
|
15591
|
-
}
|
|
15592
|
-
} while (character2 = next());
|
|
15593
|
-
return parsed;
|
|
15594
|
-
};
|
|
15595
|
-
var getRules = function getRules2(value, points) {
|
|
15596
|
-
return dealloc(toRules(alloc(value), points));
|
|
15597
|
-
};
|
|
15598
|
-
var fixedElements = /* @__PURE__ */ new WeakMap();
|
|
15599
|
-
var compat = function compat2(element) {
|
|
15600
|
-
if (element.type !== "rule" || !element.parent || // positive .length indicates that this rule contains pseudo
|
|
15601
|
-
// negative .length indicates that this rule has been already prefixed
|
|
15602
|
-
element.length < 1) {
|
|
15603
|
-
return;
|
|
15604
|
-
}
|
|
15605
|
-
var value = element.value;
|
|
15606
|
-
var parent = element.parent;
|
|
15607
|
-
var isImplicitRule = element.column === parent.column && element.line === parent.line;
|
|
15608
|
-
while (parent.type !== "rule") {
|
|
15609
|
-
parent = parent.parent;
|
|
15610
|
-
if (!parent) return;
|
|
15611
|
-
}
|
|
15612
|
-
if (element.props.length === 1 && value.charCodeAt(0) !== 58 && !fixedElements.get(parent)) {
|
|
15613
|
-
return;
|
|
15614
|
-
}
|
|
15615
|
-
if (isImplicitRule) {
|
|
15616
|
-
return;
|
|
15617
|
-
}
|
|
15618
|
-
fixedElements.set(element, true);
|
|
15619
|
-
var points = [];
|
|
15620
|
-
var rules = getRules(value, points);
|
|
15621
|
-
var parentRules = parent.props;
|
|
15622
|
-
for (var i = 0, k = 0; i < rules.length; i++) {
|
|
15623
|
-
for (var j = 0; j < parentRules.length; j++, k++) {
|
|
15624
|
-
element.props[k] = points[i] ? rules[i].replace(/&\f/g, parentRules[j]) : parentRules[j] + " " + rules[i];
|
|
15625
|
-
}
|
|
15626
|
-
}
|
|
15627
|
-
};
|
|
15628
|
-
var removeLabel = function removeLabel2(element) {
|
|
15629
|
-
if (element.type === "decl") {
|
|
15630
|
-
var value = element.value;
|
|
15631
|
-
if (
|
|
15632
|
-
// charcode for l
|
|
15633
|
-
value.charCodeAt(0) === 108 && // charcode for b
|
|
15634
|
-
value.charCodeAt(2) === 98
|
|
15635
|
-
) {
|
|
15636
|
-
element["return"] = "";
|
|
15637
|
-
element.value = "";
|
|
15638
|
-
}
|
|
15639
|
-
}
|
|
15640
|
-
};
|
|
15641
|
-
function prefix(value, length2) {
|
|
15642
|
-
switch (hash(value, length2)) {
|
|
15643
|
-
// color-adjust
|
|
15644
|
-
case 5103:
|
|
15645
|
-
return WEBKIT + "print-" + value + value;
|
|
15646
|
-
// animation, animation-(delay|direction|duration|fill-mode|iteration-count|name|play-state|timing-function)
|
|
15647
|
-
case 5737:
|
|
15648
|
-
case 4201:
|
|
15649
|
-
case 3177:
|
|
15650
|
-
case 3433:
|
|
15651
|
-
case 1641:
|
|
15652
|
-
case 4457:
|
|
15653
|
-
case 2921:
|
|
15654
|
-
// text-decoration, filter, clip-path, backface-visibility, column, box-decoration-break
|
|
15655
|
-
case 5572:
|
|
15656
|
-
case 6356:
|
|
15657
|
-
case 5844:
|
|
15658
|
-
case 3191:
|
|
15659
|
-
case 6645:
|
|
15660
|
-
case 3005:
|
|
15661
|
-
// mask, mask-image, mask-(mode|clip|size), mask-(repeat|origin), mask-position, mask-composite,
|
|
15662
|
-
case 6391:
|
|
15663
|
-
case 5879:
|
|
15664
|
-
case 5623:
|
|
15665
|
-
case 6135:
|
|
15666
|
-
case 4599:
|
|
15667
|
-
case 4855:
|
|
15668
|
-
// background-clip, columns, column-(count|fill|gap|rule|rule-color|rule-style|rule-width|span|width)
|
|
15669
|
-
case 4215:
|
|
15670
|
-
case 6389:
|
|
15671
|
-
case 5109:
|
|
15672
|
-
case 5365:
|
|
15673
|
-
case 5621:
|
|
15674
|
-
case 3829:
|
|
15675
|
-
return WEBKIT + value + value;
|
|
15676
|
-
// appearance, user-select, transform, hyphens, text-size-adjust
|
|
15677
|
-
case 5349:
|
|
15678
|
-
case 4246:
|
|
15679
|
-
case 4810:
|
|
15680
|
-
case 6968:
|
|
15681
|
-
case 2756:
|
|
15682
|
-
return WEBKIT + value + MOZ + value + MS + value + value;
|
|
15683
|
-
// flex, flex-direction
|
|
15684
|
-
case 6828:
|
|
15685
|
-
case 4268:
|
|
15686
|
-
return WEBKIT + value + MS + value + value;
|
|
15687
|
-
// order
|
|
15688
|
-
case 6165:
|
|
15689
|
-
return WEBKIT + value + MS + "flex-" + value + value;
|
|
15690
|
-
// align-items
|
|
15691
|
-
case 5187:
|
|
15692
|
-
return WEBKIT + value + replace(value, /(\w+).+(:[^]+)/, WEBKIT + "box-$1$2" + MS + "flex-$1$2") + value;
|
|
15693
|
-
// align-self
|
|
15694
|
-
case 5443:
|
|
15695
|
-
return WEBKIT + value + MS + "flex-item-" + replace(value, /flex-|-self/, "") + value;
|
|
15696
|
-
// align-content
|
|
15697
|
-
case 4675:
|
|
15698
|
-
return WEBKIT + value + MS + "flex-line-pack" + replace(value, /align-content|flex-|-self/, "") + value;
|
|
15699
|
-
// flex-shrink
|
|
15700
|
-
case 5548:
|
|
15701
|
-
return WEBKIT + value + MS + replace(value, "shrink", "negative") + value;
|
|
15702
|
-
// flex-basis
|
|
15703
|
-
case 5292:
|
|
15704
|
-
return WEBKIT + value + MS + replace(value, "basis", "preferred-size") + value;
|
|
15705
|
-
// flex-grow
|
|
15706
|
-
case 6060:
|
|
15707
|
-
return WEBKIT + "box-" + replace(value, "-grow", "") + WEBKIT + value + MS + replace(value, "grow", "positive") + value;
|
|
15708
|
-
// transition
|
|
15709
|
-
case 4554:
|
|
15710
|
-
return WEBKIT + replace(value, /([^-])(transform)/g, "$1" + WEBKIT + "$2") + value;
|
|
15711
|
-
// cursor
|
|
15712
|
-
case 6187:
|
|
15713
|
-
return replace(replace(replace(value, /(zoom-|grab)/, WEBKIT + "$1"), /(image-set)/, WEBKIT + "$1"), value, "") + value;
|
|
15714
|
-
// background, background-image
|
|
15715
|
-
case 5495:
|
|
15716
|
-
case 3959:
|
|
15717
|
-
return replace(value, /(image-set\([^]*)/, WEBKIT + "$1$`$1");
|
|
15718
|
-
// justify-content
|
|
15719
|
-
case 4968:
|
|
15720
|
-
return replace(replace(value, /(.+:)(flex-)?(.*)/, WEBKIT + "box-pack:$3" + MS + "flex-pack:$3"), /s.+-b[^;]+/, "justify") + WEBKIT + value + value;
|
|
15721
|
-
// (margin|padding)-inline-(start|end)
|
|
15722
|
-
case 4095:
|
|
15723
|
-
case 3583:
|
|
15724
|
-
case 4068:
|
|
15725
|
-
case 2532:
|
|
15726
|
-
return replace(value, /(.+)-inline(.+)/, WEBKIT + "$1$2") + value;
|
|
15727
|
-
// (min|max)?(width|height|inline-size|block-size)
|
|
15728
|
-
case 8116:
|
|
15729
|
-
case 7059:
|
|
15730
|
-
case 5753:
|
|
15731
|
-
case 5535:
|
|
15732
|
-
case 5445:
|
|
15733
|
-
case 5701:
|
|
15734
|
-
case 4933:
|
|
15735
|
-
case 4677:
|
|
15736
|
-
case 5533:
|
|
15737
|
-
case 5789:
|
|
15738
|
-
case 5021:
|
|
15739
|
-
case 4765:
|
|
15740
|
-
if (strlen(value) - 1 - length2 > 6) switch (charat(value, length2 + 1)) {
|
|
15741
|
-
// (m)ax-content, (m)in-content
|
|
15742
|
-
case 109:
|
|
15743
|
-
if (charat(value, length2 + 4) !== 45) break;
|
|
15744
|
-
// (f)ill-available, (f)it-content
|
|
15745
|
-
case 102:
|
|
15746
|
-
return replace(value, /(.+:)(.+)-([^]+)/, "$1" + WEBKIT + "$2-$3$1" + MOZ + (charat(value, length2 + 3) == 108 ? "$3" : "$2-$3")) + value;
|
|
15747
|
-
// (s)tretch
|
|
15748
|
-
case 115:
|
|
15749
|
-
return ~indexof(value, "stretch") ? prefix(replace(value, "stretch", "fill-available"), length2) + value : value;
|
|
15750
|
-
}
|
|
15751
|
-
break;
|
|
15752
|
-
// position: sticky
|
|
15753
|
-
case 4949:
|
|
15754
|
-
if (charat(value, length2 + 1) !== 115) break;
|
|
15755
|
-
// display: (flex|inline-flex)
|
|
15756
|
-
case 6444:
|
|
15757
|
-
switch (charat(value, strlen(value) - 3 - (~indexof(value, "!important") && 10))) {
|
|
15758
|
-
// stic(k)y
|
|
15759
|
-
case 107:
|
|
15760
|
-
return replace(value, ":", ":" + WEBKIT) + value;
|
|
15761
|
-
// (inline-)?fl(e)x
|
|
15762
|
-
case 101:
|
|
15763
|
-
return replace(value, /(.+:)([^;!]+)(;|!.+)?/, "$1" + WEBKIT + (charat(value, 14) === 45 ? "inline-" : "") + "box$3$1" + WEBKIT + "$2$3$1" + MS + "$2box$3") + value;
|
|
15764
|
-
}
|
|
15765
|
-
break;
|
|
15766
|
-
// writing-mode
|
|
15767
|
-
case 5936:
|
|
15768
|
-
switch (charat(value, length2 + 11)) {
|
|
15769
|
-
// vertical-l(r)
|
|
15770
|
-
case 114:
|
|
15771
|
-
return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, "tb") + value;
|
|
15772
|
-
// vertical-r(l)
|
|
15773
|
-
case 108:
|
|
15774
|
-
return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, "tb-rl") + value;
|
|
15775
|
-
// horizontal(-)tb
|
|
15776
|
-
case 45:
|
|
15777
|
-
return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, "lr") + value;
|
|
15778
|
-
}
|
|
15779
|
-
return WEBKIT + value + MS + value + value;
|
|
15780
|
-
}
|
|
15781
|
-
return value;
|
|
15782
|
-
}
|
|
15783
|
-
var prefixer = function prefixer2(element, index, children, callback) {
|
|
15784
|
-
if (element.length > -1) {
|
|
15785
|
-
if (!element["return"]) switch (element.type) {
|
|
15786
|
-
case DECLARATION:
|
|
15787
|
-
element["return"] = prefix(element.value, element.length);
|
|
15788
|
-
break;
|
|
15789
|
-
case KEYFRAMES:
|
|
15790
|
-
return serialize([copy(element, {
|
|
15791
|
-
value: replace(element.value, "@", "@" + WEBKIT)
|
|
15792
|
-
})], callback);
|
|
15793
|
-
case RULESET:
|
|
15794
|
-
if (element.length) return combine(element.props, function(value) {
|
|
15795
|
-
switch (match(value, /(::plac\w+|:read-\w+)/)) {
|
|
15796
|
-
// :read-(only|write)
|
|
15797
|
-
case ":read-only":
|
|
15798
|
-
case ":read-write":
|
|
15799
|
-
return serialize([copy(element, {
|
|
15800
|
-
props: [replace(value, /:(read-\w+)/, ":" + MOZ + "$1")]
|
|
15801
|
-
})], callback);
|
|
15802
|
-
// :placeholder
|
|
15803
|
-
case "::placeholder":
|
|
15804
|
-
return serialize([copy(element, {
|
|
15805
|
-
props: [replace(value, /:(plac\w+)/, ":" + WEBKIT + "input-$1")]
|
|
15806
|
-
}), copy(element, {
|
|
15807
|
-
props: [replace(value, /:(plac\w+)/, ":" + MOZ + "$1")]
|
|
15808
|
-
}), copy(element, {
|
|
15809
|
-
props: [replace(value, /:(plac\w+)/, MS + "input-$1")]
|
|
15810
|
-
})], callback);
|
|
15811
|
-
}
|
|
15812
|
-
return "";
|
|
15813
|
-
});
|
|
15814
|
-
}
|
|
15815
|
-
}
|
|
15816
|
-
};
|
|
15817
|
-
var defaultStylisPlugins = [prefixer];
|
|
15818
|
-
var createCache = function createCache2(options) {
|
|
15819
|
-
var key = options.key;
|
|
15820
|
-
if (key === "css") {
|
|
15821
|
-
var ssrStyles = document.querySelectorAll("style[data-emotion]:not([data-s])");
|
|
15822
|
-
Array.prototype.forEach.call(ssrStyles, function(node2) {
|
|
15823
|
-
var dataEmotionAttribute = node2.getAttribute("data-emotion");
|
|
15824
|
-
if (dataEmotionAttribute.indexOf(" ") === -1) {
|
|
15825
|
-
return;
|
|
15826
|
-
}
|
|
15827
|
-
document.head.appendChild(node2);
|
|
15828
|
-
node2.setAttribute("data-s", "");
|
|
15829
|
-
});
|
|
15830
|
-
}
|
|
15831
|
-
var stylisPlugins = options.stylisPlugins || defaultStylisPlugins;
|
|
15832
|
-
var inserted = {};
|
|
15833
|
-
var container;
|
|
15834
|
-
var nodesToHydrate = [];
|
|
15835
|
-
{
|
|
15836
|
-
container = options.container || document.head;
|
|
15837
|
-
Array.prototype.forEach.call(
|
|
15838
|
-
// this means we will ignore elements which don't have a space in them which
|
|
15839
|
-
// means that the style elements we're looking at are only Emotion 11 server-rendered style elements
|
|
15840
|
-
document.querySelectorAll('style[data-emotion^="' + key + ' "]'),
|
|
15841
|
-
function(node2) {
|
|
15842
|
-
var attrib = node2.getAttribute("data-emotion").split(" ");
|
|
15843
|
-
for (var i = 1; i < attrib.length; i++) {
|
|
15844
|
-
inserted[attrib[i]] = true;
|
|
15845
|
-
}
|
|
15846
|
-
nodesToHydrate.push(node2);
|
|
15847
|
-
}
|
|
15848
|
-
);
|
|
15849
|
-
}
|
|
15850
|
-
var _insert;
|
|
15851
|
-
var omnipresentPlugins = [compat, removeLabel];
|
|
15852
|
-
{
|
|
15853
|
-
var currentSheet;
|
|
15854
|
-
var finalizingPlugins = [stringify, rulesheet(function(rule) {
|
|
15855
|
-
currentSheet.insert(rule);
|
|
15856
|
-
})];
|
|
15857
|
-
var serializer = middleware(omnipresentPlugins.concat(stylisPlugins, finalizingPlugins));
|
|
15858
|
-
var stylis = function stylis2(styles) {
|
|
15859
|
-
return serialize(compile(styles), serializer);
|
|
15860
|
-
};
|
|
15861
|
-
_insert = function insert(selector, serialized, sheet, shouldCache) {
|
|
15862
|
-
currentSheet = sheet;
|
|
15863
|
-
stylis(selector ? selector + "{" + serialized.styles + "}" : serialized.styles);
|
|
15864
|
-
if (shouldCache) {
|
|
15865
|
-
cache.inserted[serialized.name] = true;
|
|
15866
|
-
}
|
|
15867
|
-
};
|
|
15868
|
-
}
|
|
15869
|
-
var cache = {
|
|
15870
|
-
key,
|
|
15871
|
-
sheet: new StyleSheet({
|
|
15872
|
-
key,
|
|
15873
|
-
container,
|
|
15874
|
-
nonce: options.nonce,
|
|
15875
|
-
speedy: options.speedy,
|
|
15876
|
-
prepend: options.prepend,
|
|
15877
|
-
insertionPoint: options.insertionPoint
|
|
15878
|
-
}),
|
|
15879
|
-
nonce: options.nonce,
|
|
15880
|
-
inserted,
|
|
15881
|
-
registered: {},
|
|
15882
|
-
insert: _insert
|
|
15883
|
-
};
|
|
15884
|
-
cache.sheet.hydrate(nodesToHydrate);
|
|
15885
|
-
return cache;
|
|
15886
|
-
};
|
|
15887
|
-
unstable_ClassNameGenerator.configure((componentName) => `sixseconds-modules-${componentName}`);
|
|
15888
|
-
function MuiProvider({ children }) {
|
|
15889
|
-
const [cache, setCache] = useState(null);
|
|
15890
|
-
useEffect(() => {
|
|
15891
|
-
if (typeof window !== "undefined") {
|
|
15892
|
-
const emotionCache = createCache({
|
|
15893
|
-
key: "sixseconds",
|
|
15894
|
-
prepend: false
|
|
15895
|
-
});
|
|
15896
|
-
setCache(emotionCache);
|
|
15897
|
-
}
|
|
15898
|
-
}, []);
|
|
15899
|
-
if (!cache) {
|
|
15900
|
-
return /* @__PURE__ */ jsx(Fragment, { children });
|
|
15901
|
-
}
|
|
15902
|
-
return /* @__PURE__ */ jsx(CacheProvider, { value: cache, children });
|
|
15903
|
-
}
|
|
15904
15489
|
const App = () => {
|
|
15905
15490
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
15906
15491
|
/* @__PURE__ */ jsx(
|
|
@@ -16056,9 +15641,6 @@ const App = () => {
|
|
|
16056
15641
|
/* @__PURE__ */ jsx(PreviousLoginBanner, { t: (s) => s })
|
|
16057
15642
|
] });
|
|
16058
15643
|
};
|
|
16059
|
-
function Header(props) {
|
|
16060
|
-
return /* @__PURE__ */ jsx(MuiProvider, { children: /* @__PURE__ */ jsx(Header$1, { ...props }) });
|
|
16061
|
-
}
|
|
16062
15644
|
export {
|
|
16063
15645
|
CookiesUtil,
|
|
16064
15646
|
DangerDialog,
|