@carto/meridian-ds 1.4.3-alpha-codemirror.5 → 1.4.3-alpha-codemirror.6
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/CHANGELOG.md +2 -0
- package/dist/Alert-ChcvNOU6.cjs +133 -0
- package/dist/Alert-CpgfD3bq.js +134 -0
- package/dist/ArrowDown-8fLj23Ge.cjs +31 -0
- package/dist/ArrowDown-CY_wMVJT.js +32 -0
- package/dist/MenuItem-Br2jY2lt.cjs +164 -0
- package/dist/MenuItem-CXnnE5lK.js +165 -0
- package/dist/OpenDiagonallyRight-5HZXh46V.js +59 -0
- package/dist/OpenDiagonallyRight-BrRyCV4Q.cjs +58 -0
- package/dist/SwatchSquare-DDi0beUM.js +51 -0
- package/dist/SwatchSquare-w-U8-O-P.cjs +50 -0
- package/dist/components/index.cjs +4402 -2
- package/dist/components/index.js +2779 -2398
- package/dist/custom-icons/index.cjs +5857 -1
- package/dist/custom-icons/index.js +2658 -2279
- package/dist/palette-CD5ph5A-.cjs +5872 -0
- package/dist/{TablePaginationActions-Cj_BbjKR.js → palette-DI1CmQ2J.js} +1276 -653
- package/dist/paletteUtils-DEHchy2r.cjs +93 -0
- package/dist/paletteUtils-DTaXyq2Z.js +77 -0
- package/dist/theme/index.cjs +3135 -1
- package/dist/theme/index.js +1049 -1011
- package/dist/types/components/organisms/CodeArea/CodeAreaInput.d.ts.map +1 -1
- package/dist/types/utils/chartConstants.d.ts +3 -3
- package/dist/types/utils/chartConstants.d.ts.map +1 -1
- package/dist/types/widgets/CategoryWidgetUI/CategoryWidgetUI.d.ts +2 -2
- package/dist/types/widgets/CategoryWidgetUI/CategoryWidgetUI.d.ts.map +1 -1
- package/dist/types/widgets/PieWidgetUI/PieWidgetUI.d.ts +2 -2
- package/dist/types/widgets/PieWidgetUI/PieWidgetUI.d.ts.map +1 -1
- package/dist/types/widgets/PieWidgetUI/usePieCategories.d.ts +2 -2
- package/dist/types/widgets/PieWidgetUI/usePieCategories.d.ts.map +1 -1
- package/dist/types/widgets/comparative/ComparativeCategoryWidgetUI/ComparativeCategoryWidgetUI.d.ts +2 -2
- package/dist/types/widgets/comparative/ComparativeCategoryWidgetUI/ComparativeCategoryWidgetUI.d.ts.map +1 -1
- package/dist/types/widgets/comparative/ComparativeCategoryWidgetUI/transposeCategoryData.d.ts +2 -2
- package/dist/types/widgets/comparative/ComparativeCategoryWidgetUI/transposeCategoryData.d.ts.map +1 -1
- package/dist/types/widgets/index.d.ts +1 -0
- package/dist/types/widgets/index.d.ts.map +1 -1
- package/dist/widgets/index.cjs +7180 -21
- package/dist/widgets/index.js +5159 -3791
- package/package.json +1 -1
- package/dist/Alert-Bcn_9-oO.cjs +0 -4
- package/dist/Alert-mpNEqtBu.js +0 -130
- package/dist/ArrowDown-BD0WmQR3.cjs +0 -1
- package/dist/ArrowDown-CMhYkZ2p.js +0 -31
- package/dist/MenuItem-Cd34y6F3.js +0 -165
- package/dist/MenuItem-Dbss-WG1.cjs +0 -1
- package/dist/OpenDiagonallyRight-BkCaUpcr.js +0 -56
- package/dist/OpenDiagonallyRight-DqSU7b6o.cjs +0 -1
- package/dist/SwatchSquare-C34ayL4L.cjs +0 -1
- package/dist/SwatchSquare-CVpwEFFV.js +0 -48
- package/dist/TablePaginationActions-BfAn9gSh.cjs +0 -9
- package/dist/paletteUtils-BEwZhrLg.js +0 -262
- package/dist/paletteUtils-DLQVT9qo.cjs +0 -1
|
@@ -1,566 +1,808 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { jsx
|
|
3
|
-
import { Typography as
|
|
4
|
-
import { forwardRef
|
|
5
|
-
import { KeyboardArrowLeftOutlined
|
|
6
|
-
import { createIntlCache
|
|
7
|
-
function
|
|
8
|
-
return
|
|
1
|
+
import require$$0 from "react-is";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Typography as Typography$1, Tooltip, IconButton, styled, Box, alpha } from "@mui/material";
|
|
4
|
+
import { forwardRef } from "react";
|
|
5
|
+
import { KeyboardArrowLeftOutlined, KeyboardArrowRightOutlined } from "@mui/icons-material";
|
|
6
|
+
import { createIntlCache, createIntl, useIntl } from "react-intl";
|
|
7
|
+
function getDefaultExportFromCjs(x) {
|
|
8
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
9
9
|
}
|
|
10
|
-
var
|
|
10
|
+
var propTypes = { exports: {} };
|
|
11
11
|
/*
|
|
12
12
|
object-assign
|
|
13
13
|
(c) Sindre Sorhus
|
|
14
14
|
@license MIT
|
|
15
15
|
*/
|
|
16
|
-
var
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
16
|
+
var objectAssign;
|
|
17
|
+
var hasRequiredObjectAssign;
|
|
18
|
+
function requireObjectAssign() {
|
|
19
|
+
if (hasRequiredObjectAssign) return objectAssign;
|
|
20
|
+
hasRequiredObjectAssign = 1;
|
|
21
|
+
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
|
22
|
+
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
23
|
+
var propIsEnumerable = Object.prototype.propertyIsEnumerable;
|
|
24
|
+
function toObject(val) {
|
|
25
|
+
if (val === null || val === void 0) {
|
|
23
26
|
throw new TypeError("Object.assign cannot be called with null or undefined");
|
|
24
|
-
|
|
27
|
+
}
|
|
28
|
+
return Object(val);
|
|
25
29
|
}
|
|
26
|
-
function
|
|
30
|
+
function shouldUseNative() {
|
|
27
31
|
try {
|
|
28
|
-
if (!Object.assign)
|
|
29
|
-
return
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
32
|
+
if (!Object.assign) {
|
|
33
|
+
return false;
|
|
34
|
+
}
|
|
35
|
+
var test1 = new String("abc");
|
|
36
|
+
test1[5] = "de";
|
|
37
|
+
if (Object.getOwnPropertyNames(test1)[0] === "5") {
|
|
38
|
+
return false;
|
|
39
|
+
}
|
|
40
|
+
var test2 = {};
|
|
41
|
+
for (var i = 0; i < 10; i++) {
|
|
42
|
+
test2["_" + String.fromCharCode(i)] = i;
|
|
43
|
+
}
|
|
44
|
+
var order2 = Object.getOwnPropertyNames(test2).map(function(n) {
|
|
45
|
+
return test2[n];
|
|
46
|
+
});
|
|
47
|
+
if (order2.join("") !== "0123456789") {
|
|
48
|
+
return false;
|
|
49
|
+
}
|
|
50
|
+
var test3 = {};
|
|
51
|
+
"abcdefghijklmnopqrst".split("").forEach(function(letter) {
|
|
52
|
+
test3[letter] = letter;
|
|
37
53
|
});
|
|
38
|
-
if (
|
|
39
|
-
return
|
|
40
|
-
|
|
41
|
-
return
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
} catch {
|
|
45
|
-
return !1;
|
|
54
|
+
if (Object.keys(Object.assign({}, test3)).join("") !== "abcdefghijklmnopqrst") {
|
|
55
|
+
return false;
|
|
56
|
+
}
|
|
57
|
+
return true;
|
|
58
|
+
} catch (err) {
|
|
59
|
+
return false;
|
|
46
60
|
}
|
|
47
61
|
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
62
|
+
objectAssign = shouldUseNative() ? Object.assign : function(target, source) {
|
|
63
|
+
var from;
|
|
64
|
+
var to = toObject(target);
|
|
65
|
+
var symbols;
|
|
66
|
+
for (var s = 1; s < arguments.length; s++) {
|
|
67
|
+
from = Object(arguments[s]);
|
|
68
|
+
for (var key in from) {
|
|
69
|
+
if (hasOwnProperty.call(from, key)) {
|
|
70
|
+
to[key] = from[key];
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
if (getOwnPropertySymbols) {
|
|
74
|
+
symbols = getOwnPropertySymbols(from);
|
|
75
|
+
for (var i = 0; i < symbols.length; i++) {
|
|
76
|
+
if (propIsEnumerable.call(from, symbols[i])) {
|
|
77
|
+
to[symbols[i]] = from[symbols[i]];
|
|
78
|
+
}
|
|
79
|
+
}
|
|
57
80
|
}
|
|
58
81
|
}
|
|
59
|
-
return
|
|
60
|
-
}
|
|
82
|
+
return to;
|
|
83
|
+
};
|
|
84
|
+
return objectAssign;
|
|
61
85
|
}
|
|
62
|
-
var
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
86
|
+
var ReactPropTypesSecret_1;
|
|
87
|
+
var hasRequiredReactPropTypesSecret;
|
|
88
|
+
function requireReactPropTypesSecret() {
|
|
89
|
+
if (hasRequiredReactPropTypesSecret) return ReactPropTypesSecret_1;
|
|
90
|
+
hasRequiredReactPropTypesSecret = 1;
|
|
91
|
+
var ReactPropTypesSecret = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
|
|
92
|
+
ReactPropTypesSecret_1 = ReactPropTypesSecret;
|
|
93
|
+
return ReactPropTypesSecret_1;
|
|
68
94
|
}
|
|
69
|
-
var
|
|
70
|
-
|
|
71
|
-
|
|
95
|
+
var has;
|
|
96
|
+
var hasRequiredHas;
|
|
97
|
+
function requireHas() {
|
|
98
|
+
if (hasRequiredHas) return has;
|
|
99
|
+
hasRequiredHas = 1;
|
|
100
|
+
has = Function.call.bind(Object.prototype.hasOwnProperty);
|
|
101
|
+
return has;
|
|
72
102
|
}
|
|
73
|
-
var
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
103
|
+
var checkPropTypes_1;
|
|
104
|
+
var hasRequiredCheckPropTypes;
|
|
105
|
+
function requireCheckPropTypes() {
|
|
106
|
+
if (hasRequiredCheckPropTypes) return checkPropTypes_1;
|
|
107
|
+
hasRequiredCheckPropTypes = 1;
|
|
108
|
+
var printWarning = function() {
|
|
78
109
|
};
|
|
79
110
|
if (process.env.NODE_ENV !== "production") {
|
|
80
|
-
var
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
111
|
+
var ReactPropTypesSecret = requireReactPropTypesSecret();
|
|
112
|
+
var loggedTypeFailures = {};
|
|
113
|
+
var has2 = requireHas();
|
|
114
|
+
printWarning = function(text) {
|
|
115
|
+
var message = "Warning: " + text;
|
|
116
|
+
if (typeof console !== "undefined") {
|
|
117
|
+
console.error(message);
|
|
118
|
+
}
|
|
84
119
|
try {
|
|
85
|
-
throw new Error(
|
|
86
|
-
} catch {
|
|
120
|
+
throw new Error(message);
|
|
121
|
+
} catch (x) {
|
|
87
122
|
}
|
|
88
123
|
};
|
|
89
124
|
}
|
|
90
|
-
function
|
|
125
|
+
function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
|
|
91
126
|
if (process.env.NODE_ENV !== "production") {
|
|
92
|
-
for (var
|
|
93
|
-
if (
|
|
94
|
-
var
|
|
127
|
+
for (var typeSpecName in typeSpecs) {
|
|
128
|
+
if (has2(typeSpecs, typeSpecName)) {
|
|
129
|
+
var error;
|
|
95
130
|
try {
|
|
96
|
-
if (typeof
|
|
97
|
-
var
|
|
98
|
-
(
|
|
131
|
+
if (typeof typeSpecs[typeSpecName] !== "function") {
|
|
132
|
+
var err = Error(
|
|
133
|
+
(componentName || "React class") + ": " + location + " type `" + typeSpecName + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof typeSpecs[typeSpecName] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."
|
|
99
134
|
);
|
|
100
|
-
|
|
135
|
+
err.name = "Invariant Violation";
|
|
136
|
+
throw err;
|
|
101
137
|
}
|
|
102
|
-
|
|
103
|
-
} catch (
|
|
104
|
-
|
|
105
|
-
}
|
|
106
|
-
if (
|
|
107
|
-
(
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
138
|
+
error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
|
|
139
|
+
} catch (ex) {
|
|
140
|
+
error = ex;
|
|
141
|
+
}
|
|
142
|
+
if (error && !(error instanceof Error)) {
|
|
143
|
+
printWarning(
|
|
144
|
+
(componentName || "React class") + ": type specification of " + location + " `" + typeSpecName + "` is invalid; the type checker function must return `null` or an `Error` but returned a " + typeof error + ". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."
|
|
145
|
+
);
|
|
146
|
+
}
|
|
147
|
+
if (error instanceof Error && !(error.message in loggedTypeFailures)) {
|
|
148
|
+
loggedTypeFailures[error.message] = true;
|
|
149
|
+
var stack = getStack ? getStack() : "";
|
|
150
|
+
printWarning(
|
|
151
|
+
"Failed " + location + " type: " + error.message + (stack != null ? stack : "")
|
|
113
152
|
);
|
|
114
153
|
}
|
|
115
154
|
}
|
|
155
|
+
}
|
|
116
156
|
}
|
|
117
157
|
}
|
|
118
|
-
|
|
119
|
-
process.env.NODE_ENV !== "production"
|
|
120
|
-
|
|
158
|
+
checkPropTypes.resetWarningCache = function() {
|
|
159
|
+
if (process.env.NODE_ENV !== "production") {
|
|
160
|
+
loggedTypeFailures = {};
|
|
161
|
+
}
|
|
162
|
+
};
|
|
163
|
+
checkPropTypes_1 = checkPropTypes;
|
|
164
|
+
return checkPropTypes_1;
|
|
121
165
|
}
|
|
122
|
-
var
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
166
|
+
var factoryWithTypeCheckers;
|
|
167
|
+
var hasRequiredFactoryWithTypeCheckers;
|
|
168
|
+
function requireFactoryWithTypeCheckers() {
|
|
169
|
+
if (hasRequiredFactoryWithTypeCheckers) return factoryWithTypeCheckers;
|
|
170
|
+
hasRequiredFactoryWithTypeCheckers = 1;
|
|
171
|
+
var ReactIs = require$$0;
|
|
172
|
+
var assign = requireObjectAssign();
|
|
173
|
+
var ReactPropTypesSecret = requireReactPropTypesSecret();
|
|
174
|
+
var has2 = requireHas();
|
|
175
|
+
var checkPropTypes = requireCheckPropTypes();
|
|
176
|
+
var printWarning = function() {
|
|
127
177
|
};
|
|
128
|
-
process.env.NODE_ENV !== "production"
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
178
|
+
if (process.env.NODE_ENV !== "production") {
|
|
179
|
+
printWarning = function(text) {
|
|
180
|
+
var message = "Warning: " + text;
|
|
181
|
+
if (typeof console !== "undefined") {
|
|
182
|
+
console.error(message);
|
|
183
|
+
}
|
|
184
|
+
try {
|
|
185
|
+
throw new Error(message);
|
|
186
|
+
} catch (x) {
|
|
187
|
+
}
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
function emptyFunctionThatReturnsNull() {
|
|
137
191
|
return null;
|
|
138
192
|
}
|
|
139
|
-
|
|
140
|
-
var
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
193
|
+
factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
|
|
194
|
+
var ITERATOR_SYMBOL = typeof Symbol === "function" && Symbol.iterator;
|
|
195
|
+
var FAUX_ITERATOR_SYMBOL = "@@iterator";
|
|
196
|
+
function getIteratorFn(maybeIterable) {
|
|
197
|
+
var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
|
|
198
|
+
if (typeof iteratorFn === "function") {
|
|
199
|
+
return iteratorFn;
|
|
200
|
+
}
|
|
145
201
|
}
|
|
146
|
-
var
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
202
|
+
var ANONYMOUS = "<<anonymous>>";
|
|
203
|
+
var ReactPropTypes = {
|
|
204
|
+
array: createPrimitiveTypeChecker("array"),
|
|
205
|
+
bigint: createPrimitiveTypeChecker("bigint"),
|
|
206
|
+
bool: createPrimitiveTypeChecker("boolean"),
|
|
207
|
+
func: createPrimitiveTypeChecker("function"),
|
|
208
|
+
number: createPrimitiveTypeChecker("number"),
|
|
209
|
+
object: createPrimitiveTypeChecker("object"),
|
|
210
|
+
string: createPrimitiveTypeChecker("string"),
|
|
211
|
+
symbol: createPrimitiveTypeChecker("symbol"),
|
|
212
|
+
any: createAnyTypeChecker(),
|
|
213
|
+
arrayOf: createArrayOfTypeChecker,
|
|
214
|
+
element: createElementTypeChecker(),
|
|
215
|
+
elementType: createElementTypeTypeChecker(),
|
|
216
|
+
instanceOf: createInstanceTypeChecker,
|
|
217
|
+
node: createNodeChecker(),
|
|
218
|
+
objectOf: createObjectOfTypeChecker,
|
|
219
|
+
oneOf: createEnumTypeChecker,
|
|
220
|
+
oneOfType: createUnionTypeChecker,
|
|
221
|
+
shape: createShapeTypeChecker,
|
|
222
|
+
exact: createStrictShapeTypeChecker
|
|
166
223
|
};
|
|
167
|
-
function
|
|
168
|
-
|
|
224
|
+
function is(x, y) {
|
|
225
|
+
if (x === y) {
|
|
226
|
+
return x !== 0 || 1 / x === 1 / y;
|
|
227
|
+
} else {
|
|
228
|
+
return x !== x && y !== y;
|
|
229
|
+
}
|
|
169
230
|
}
|
|
170
|
-
function
|
|
171
|
-
this.message =
|
|
231
|
+
function PropTypeError(message, data2) {
|
|
232
|
+
this.message = message;
|
|
233
|
+
this.data = data2 && typeof data2 === "object" ? data2 : {};
|
|
234
|
+
this.stack = "";
|
|
172
235
|
}
|
|
173
|
-
|
|
174
|
-
function
|
|
175
|
-
if (process.env.NODE_ENV !== "production")
|
|
176
|
-
var
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
236
|
+
PropTypeError.prototype = Error.prototype;
|
|
237
|
+
function createChainableTypeChecker(validate) {
|
|
238
|
+
if (process.env.NODE_ENV !== "production") {
|
|
239
|
+
var manualPropTypeCallCache = {};
|
|
240
|
+
var manualPropTypeWarningCount = 0;
|
|
241
|
+
}
|
|
242
|
+
function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
|
|
243
|
+
componentName = componentName || ANONYMOUS;
|
|
244
|
+
propFullName = propFullName || propName;
|
|
245
|
+
if (secret !== ReactPropTypesSecret) {
|
|
246
|
+
if (throwOnDirectAccess) {
|
|
247
|
+
var err = new Error(
|
|
181
248
|
"Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types"
|
|
182
249
|
);
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
250
|
+
err.name = "Invariant Violation";
|
|
251
|
+
throw err;
|
|
252
|
+
} else if (process.env.NODE_ENV !== "production" && typeof console !== "undefined") {
|
|
253
|
+
var cacheKey = componentName + ":" + propName;
|
|
254
|
+
if (!manualPropTypeCallCache[cacheKey] && // Avoid spamming the console because they are often not actionable except for lib authors
|
|
255
|
+
manualPropTypeWarningCount < 3) {
|
|
256
|
+
printWarning(
|
|
257
|
+
"You are manually calling a React.PropTypes validation function for the `" + propFullName + "` prop on `" + componentName + "`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."
|
|
258
|
+
);
|
|
259
|
+
manualPropTypeCallCache[cacheKey] = true;
|
|
260
|
+
manualPropTypeWarningCount++;
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
if (props[propName] == null) {
|
|
265
|
+
if (isRequired) {
|
|
266
|
+
if (props[propName] === null) {
|
|
267
|
+
return new PropTypeError("The " + location + " `" + propFullName + "` is marked as required " + ("in `" + componentName + "`, but its value is `null`."));
|
|
268
|
+
}
|
|
269
|
+
return new PropTypeError("The " + location + " `" + propFullName + "` is marked as required in " + ("`" + componentName + "`, but its value is `undefined`."));
|
|
190
270
|
}
|
|
271
|
+
return null;
|
|
272
|
+
} else {
|
|
273
|
+
return validate(props, propName, componentName, location, propFullName);
|
|
191
274
|
}
|
|
192
|
-
return p[w] == null ? m ? p[w] === null ? new C("The " + T + " `" + v + "` is marked as required " + ("in `" + h + "`, but its value is `null`.")) : new C("The " + T + " `" + v + "` is marked as required in " + ("`" + h + "`, but its value is `undefined`.")) : null : t(p, w, h, T, v);
|
|
193
275
|
}
|
|
194
|
-
var
|
|
195
|
-
|
|
276
|
+
var chainedCheckType = checkType.bind(null, false);
|
|
277
|
+
chainedCheckType.isRequired = checkType.bind(null, true);
|
|
278
|
+
return chainedCheckType;
|
|
196
279
|
}
|
|
197
|
-
function
|
|
198
|
-
function
|
|
199
|
-
var
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
280
|
+
function createPrimitiveTypeChecker(expectedType) {
|
|
281
|
+
function validate(props, propName, componentName, location, propFullName, secret) {
|
|
282
|
+
var propValue = props[propName];
|
|
283
|
+
var propType = getPropType(propValue);
|
|
284
|
+
if (propType !== expectedType) {
|
|
285
|
+
var preciseType = getPreciseType(propValue);
|
|
286
|
+
return new PropTypeError(
|
|
287
|
+
"Invalid " + location + " `" + propFullName + "` of type " + ("`" + preciseType + "` supplied to `" + componentName + "`, expected ") + ("`" + expectedType + "`."),
|
|
288
|
+
{ expectedType }
|
|
205
289
|
);
|
|
206
290
|
}
|
|
207
291
|
return null;
|
|
208
292
|
}
|
|
209
|
-
return
|
|
293
|
+
return createChainableTypeChecker(validate);
|
|
210
294
|
}
|
|
211
|
-
function
|
|
212
|
-
return
|
|
295
|
+
function createAnyTypeChecker() {
|
|
296
|
+
return createChainableTypeChecker(emptyFunctionThatReturnsNull);
|
|
213
297
|
}
|
|
214
|
-
function
|
|
215
|
-
function
|
|
216
|
-
if (typeof
|
|
217
|
-
return new
|
|
218
|
-
var w = g[f];
|
|
219
|
-
if (!Array.isArray(w)) {
|
|
220
|
-
var h = B(w);
|
|
221
|
-
return new C("Invalid " + m + " `" + p + "` of type " + ("`" + h + "` supplied to `" + _ + "`, expected an array."));
|
|
298
|
+
function createArrayOfTypeChecker(typeChecker) {
|
|
299
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
300
|
+
if (typeof typeChecker !== "function") {
|
|
301
|
+
return new PropTypeError("Property `" + propFullName + "` of component `" + componentName + "` has invalid PropType notation inside arrayOf.");
|
|
222
302
|
}
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
303
|
+
var propValue = props[propName];
|
|
304
|
+
if (!Array.isArray(propValue)) {
|
|
305
|
+
var propType = getPropType(propValue);
|
|
306
|
+
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected an array."));
|
|
307
|
+
}
|
|
308
|
+
for (var i = 0; i < propValue.length; i++) {
|
|
309
|
+
var error = typeChecker(propValue, i, componentName, location, propFullName + "[" + i + "]", ReactPropTypesSecret);
|
|
310
|
+
if (error instanceof Error) {
|
|
311
|
+
return error;
|
|
312
|
+
}
|
|
227
313
|
}
|
|
228
314
|
return null;
|
|
229
315
|
}
|
|
230
|
-
return
|
|
316
|
+
return createChainableTypeChecker(validate);
|
|
231
317
|
}
|
|
232
|
-
function
|
|
233
|
-
function
|
|
234
|
-
var
|
|
235
|
-
if (!
|
|
236
|
-
var
|
|
237
|
-
return new
|
|
318
|
+
function createElementTypeChecker() {
|
|
319
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
320
|
+
var propValue = props[propName];
|
|
321
|
+
if (!isValidElement(propValue)) {
|
|
322
|
+
var propType = getPropType(propValue);
|
|
323
|
+
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected a single ReactElement."));
|
|
238
324
|
}
|
|
239
325
|
return null;
|
|
240
326
|
}
|
|
241
|
-
return
|
|
327
|
+
return createChainableTypeChecker(validate);
|
|
242
328
|
}
|
|
243
|
-
function
|
|
244
|
-
function
|
|
245
|
-
var
|
|
246
|
-
if (!
|
|
247
|
-
var
|
|
248
|
-
return new
|
|
329
|
+
function createElementTypeTypeChecker() {
|
|
330
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
331
|
+
var propValue = props[propName];
|
|
332
|
+
if (!ReactIs.isValidElementType(propValue)) {
|
|
333
|
+
var propType = getPropType(propValue);
|
|
334
|
+
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected a single ReactElement type."));
|
|
249
335
|
}
|
|
250
336
|
return null;
|
|
251
337
|
}
|
|
252
|
-
return
|
|
338
|
+
return createChainableTypeChecker(validate);
|
|
253
339
|
}
|
|
254
|
-
function
|
|
255
|
-
function
|
|
256
|
-
if (!(
|
|
257
|
-
var
|
|
258
|
-
|
|
340
|
+
function createInstanceTypeChecker(expectedClass) {
|
|
341
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
342
|
+
if (!(props[propName] instanceof expectedClass)) {
|
|
343
|
+
var expectedClassName = expectedClass.name || ANONYMOUS;
|
|
344
|
+
var actualClassName = getClassName(props[propName]);
|
|
345
|
+
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + actualClassName + "` supplied to `" + componentName + "`, expected ") + ("instance of `" + expectedClassName + "`."));
|
|
259
346
|
}
|
|
260
347
|
return null;
|
|
261
348
|
}
|
|
262
|
-
return
|
|
349
|
+
return createChainableTypeChecker(validate);
|
|
263
350
|
}
|
|
264
|
-
function
|
|
265
|
-
if (!Array.isArray(
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
351
|
+
function createEnumTypeChecker(expectedValues) {
|
|
352
|
+
if (!Array.isArray(expectedValues)) {
|
|
353
|
+
if (process.env.NODE_ENV !== "production") {
|
|
354
|
+
if (arguments.length > 1) {
|
|
355
|
+
printWarning(
|
|
356
|
+
"Invalid arguments supplied to oneOf, expected an array, got " + arguments.length + " arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."
|
|
357
|
+
);
|
|
358
|
+
} else {
|
|
359
|
+
printWarning("Invalid argument supplied to oneOf, expected an array.");
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
return emptyFunctionThatReturnsNull;
|
|
363
|
+
}
|
|
364
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
365
|
+
var propValue = props[propName];
|
|
366
|
+
for (var i = 0; i < expectedValues.length; i++) {
|
|
367
|
+
if (is(propValue, expectedValues[i])) {
|
|
272
368
|
return null;
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {
|
|
372
|
+
var type = getPreciseType(value);
|
|
373
|
+
if (type === "symbol") {
|
|
374
|
+
return String(value);
|
|
375
|
+
}
|
|
376
|
+
return value;
|
|
276
377
|
});
|
|
277
|
-
return new
|
|
378
|
+
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of value `" + String(propValue) + "` " + ("supplied to `" + componentName + "`, expected one of " + valuesString + "."));
|
|
278
379
|
}
|
|
279
|
-
return
|
|
380
|
+
return createChainableTypeChecker(validate);
|
|
280
381
|
}
|
|
281
|
-
function
|
|
282
|
-
function
|
|
283
|
-
if (typeof
|
|
284
|
-
return new
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
382
|
+
function createObjectOfTypeChecker(typeChecker) {
|
|
383
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
384
|
+
if (typeof typeChecker !== "function") {
|
|
385
|
+
return new PropTypeError("Property `" + propFullName + "` of component `" + componentName + "` has invalid PropType notation inside objectOf.");
|
|
386
|
+
}
|
|
387
|
+
var propValue = props[propName];
|
|
388
|
+
var propType = getPropType(propValue);
|
|
389
|
+
if (propType !== "object") {
|
|
390
|
+
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected an object."));
|
|
391
|
+
}
|
|
392
|
+
for (var key in propValue) {
|
|
393
|
+
if (has2(propValue, key)) {
|
|
394
|
+
var error = typeChecker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret);
|
|
395
|
+
if (error instanceof Error) {
|
|
396
|
+
return error;
|
|
397
|
+
}
|
|
293
398
|
}
|
|
399
|
+
}
|
|
294
400
|
return null;
|
|
295
401
|
}
|
|
296
|
-
return
|
|
402
|
+
return createChainableTypeChecker(validate);
|
|
297
403
|
}
|
|
298
|
-
function
|
|
299
|
-
if (!Array.isArray(
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
var g = t[c];
|
|
303
|
-
if (typeof g != "function")
|
|
304
|
-
return n(
|
|
305
|
-
"Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + ke(g) + " at index " + c + "."
|
|
306
|
-
), s;
|
|
404
|
+
function createUnionTypeChecker(arrayOfTypeCheckers) {
|
|
405
|
+
if (!Array.isArray(arrayOfTypeCheckers)) {
|
|
406
|
+
process.env.NODE_ENV !== "production" ? printWarning("Invalid argument supplied to oneOfType, expected an instance of array.") : void 0;
|
|
407
|
+
return emptyFunctionThatReturnsNull;
|
|
307
408
|
}
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
409
|
+
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
|
|
410
|
+
var checker = arrayOfTypeCheckers[i];
|
|
411
|
+
if (typeof checker !== "function") {
|
|
412
|
+
printWarning(
|
|
413
|
+
"Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + getPostfixForTypeWarning(checker) + " at index " + i + "."
|
|
414
|
+
);
|
|
415
|
+
return emptyFunctionThatReturnsNull;
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
419
|
+
var expectedTypes = [];
|
|
420
|
+
for (var i2 = 0; i2 < arrayOfTypeCheckers.length; i2++) {
|
|
421
|
+
var checker2 = arrayOfTypeCheckers[i2];
|
|
422
|
+
var checkerResult = checker2(props, propName, componentName, location, propFullName, ReactPropTypesSecret);
|
|
423
|
+
if (checkerResult == null) {
|
|
312
424
|
return null;
|
|
313
|
-
|
|
425
|
+
}
|
|
426
|
+
if (checkerResult.data && has2(checkerResult.data, "expectedType")) {
|
|
427
|
+
expectedTypes.push(checkerResult.data.expectedType);
|
|
428
|
+
}
|
|
314
429
|
}
|
|
315
|
-
var
|
|
316
|
-
return new
|
|
430
|
+
var expectedTypesMessage = expectedTypes.length > 0 ? ", expected one of type [" + expectedTypes.join(", ") + "]" : "";
|
|
431
|
+
return new PropTypeError("Invalid " + location + " `" + propFullName + "` supplied to " + ("`" + componentName + "`" + expectedTypesMessage + "."));
|
|
317
432
|
}
|
|
318
|
-
return
|
|
433
|
+
return createChainableTypeChecker(validate);
|
|
319
434
|
}
|
|
320
|
-
function
|
|
321
|
-
function
|
|
322
|
-
|
|
435
|
+
function createNodeChecker() {
|
|
436
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
437
|
+
if (!isNode(props[propName])) {
|
|
438
|
+
return new PropTypeError("Invalid " + location + " `" + propFullName + "` supplied to " + ("`" + componentName + "`, expected a ReactNode."));
|
|
439
|
+
}
|
|
440
|
+
return null;
|
|
323
441
|
}
|
|
324
|
-
return
|
|
442
|
+
return createChainableTypeChecker(validate);
|
|
325
443
|
}
|
|
326
|
-
function
|
|
327
|
-
return new
|
|
328
|
-
(
|
|
444
|
+
function invalidValidatorError(componentName, location, propFullName, key, type) {
|
|
445
|
+
return new PropTypeError(
|
|
446
|
+
(componentName || "React class") + ": " + location + " type `" + propFullName + "." + key + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + type + "`."
|
|
329
447
|
);
|
|
330
448
|
}
|
|
331
|
-
function
|
|
332
|
-
function
|
|
333
|
-
var
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
449
|
+
function createShapeTypeChecker(shapeTypes) {
|
|
450
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
451
|
+
var propValue = props[propName];
|
|
452
|
+
var propType = getPropType(propValue);
|
|
453
|
+
if (propType !== "object") {
|
|
454
|
+
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type `" + propType + "` " + ("supplied to `" + componentName + "`, expected `object`."));
|
|
455
|
+
}
|
|
456
|
+
for (var key in shapeTypes) {
|
|
457
|
+
var checker = shapeTypes[key];
|
|
458
|
+
if (typeof checker !== "function") {
|
|
459
|
+
return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
|
|
460
|
+
}
|
|
461
|
+
var error = checker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret);
|
|
462
|
+
if (error) {
|
|
463
|
+
return error;
|
|
464
|
+
}
|
|
343
465
|
}
|
|
344
466
|
return null;
|
|
345
467
|
}
|
|
346
|
-
return
|
|
468
|
+
return createChainableTypeChecker(validate);
|
|
347
469
|
}
|
|
348
|
-
function
|
|
349
|
-
function
|
|
350
|
-
var
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
if (
|
|
359
|
-
return
|
|
360
|
-
|
|
361
|
-
|
|
470
|
+
function createStrictShapeTypeChecker(shapeTypes) {
|
|
471
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
472
|
+
var propValue = props[propName];
|
|
473
|
+
var propType = getPropType(propValue);
|
|
474
|
+
if (propType !== "object") {
|
|
475
|
+
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type `" + propType + "` " + ("supplied to `" + componentName + "`, expected `object`."));
|
|
476
|
+
}
|
|
477
|
+
var allKeys = assign({}, props[propName], shapeTypes);
|
|
478
|
+
for (var key in allKeys) {
|
|
479
|
+
var checker = shapeTypes[key];
|
|
480
|
+
if (has2(shapeTypes, key) && typeof checker !== "function") {
|
|
481
|
+
return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
|
|
482
|
+
}
|
|
483
|
+
if (!checker) {
|
|
484
|
+
return new PropTypeError(
|
|
485
|
+
"Invalid " + location + " `" + propFullName + "` key `" + key + "` supplied to `" + componentName + "`.\nBad object: " + JSON.stringify(props[propName], null, " ") + "\nValid keys: " + JSON.stringify(Object.keys(shapeTypes), null, " ")
|
|
362
486
|
);
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
487
|
+
}
|
|
488
|
+
var error = checker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret);
|
|
489
|
+
if (error) {
|
|
490
|
+
return error;
|
|
491
|
+
}
|
|
366
492
|
}
|
|
367
493
|
return null;
|
|
368
494
|
}
|
|
369
|
-
return
|
|
495
|
+
return createChainableTypeChecker(validate);
|
|
370
496
|
}
|
|
371
|
-
function
|
|
372
|
-
switch (typeof
|
|
497
|
+
function isNode(propValue) {
|
|
498
|
+
switch (typeof propValue) {
|
|
373
499
|
case "number":
|
|
374
500
|
case "string":
|
|
375
501
|
case "undefined":
|
|
376
|
-
return
|
|
502
|
+
return true;
|
|
377
503
|
case "boolean":
|
|
378
|
-
return !
|
|
504
|
+
return !propValue;
|
|
379
505
|
case "object":
|
|
380
|
-
if (Array.isArray(
|
|
381
|
-
return
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
return !1;
|
|
506
|
+
if (Array.isArray(propValue)) {
|
|
507
|
+
return propValue.every(isNode);
|
|
508
|
+
}
|
|
509
|
+
if (propValue === null || isValidElement(propValue)) {
|
|
510
|
+
return true;
|
|
511
|
+
}
|
|
512
|
+
var iteratorFn = getIteratorFn(propValue);
|
|
513
|
+
if (iteratorFn) {
|
|
514
|
+
var iterator = iteratorFn.call(propValue);
|
|
515
|
+
var step;
|
|
516
|
+
if (iteratorFn !== propValue.entries) {
|
|
517
|
+
while (!(step = iterator.next()).done) {
|
|
518
|
+
if (!isNode(step.value)) {
|
|
519
|
+
return false;
|
|
520
|
+
}
|
|
396
521
|
}
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
522
|
+
} else {
|
|
523
|
+
while (!(step = iterator.next()).done) {
|
|
524
|
+
var entry = step.value;
|
|
525
|
+
if (entry) {
|
|
526
|
+
if (!isNode(entry[1])) {
|
|
527
|
+
return false;
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
} else {
|
|
533
|
+
return false;
|
|
534
|
+
}
|
|
535
|
+
return true;
|
|
400
536
|
default:
|
|
401
|
-
return
|
|
537
|
+
return false;
|
|
402
538
|
}
|
|
403
539
|
}
|
|
404
|
-
function
|
|
405
|
-
|
|
540
|
+
function isSymbol(propType, propValue) {
|
|
541
|
+
if (propType === "symbol") {
|
|
542
|
+
return true;
|
|
543
|
+
}
|
|
544
|
+
if (!propValue) {
|
|
545
|
+
return false;
|
|
546
|
+
}
|
|
547
|
+
if (propValue["@@toStringTag"] === "Symbol") {
|
|
548
|
+
return true;
|
|
549
|
+
}
|
|
550
|
+
if (typeof Symbol === "function" && propValue instanceof Symbol) {
|
|
551
|
+
return true;
|
|
552
|
+
}
|
|
553
|
+
return false;
|
|
406
554
|
}
|
|
407
|
-
function
|
|
408
|
-
var
|
|
409
|
-
|
|
555
|
+
function getPropType(propValue) {
|
|
556
|
+
var propType = typeof propValue;
|
|
557
|
+
if (Array.isArray(propValue)) {
|
|
558
|
+
return "array";
|
|
559
|
+
}
|
|
560
|
+
if (propValue instanceof RegExp) {
|
|
561
|
+
return "object";
|
|
562
|
+
}
|
|
563
|
+
if (isSymbol(propType, propValue)) {
|
|
564
|
+
return "symbol";
|
|
565
|
+
}
|
|
566
|
+
return propType;
|
|
410
567
|
}
|
|
411
|
-
function
|
|
412
|
-
if (typeof
|
|
413
|
-
return "" +
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
568
|
+
function getPreciseType(propValue) {
|
|
569
|
+
if (typeof propValue === "undefined" || propValue === null) {
|
|
570
|
+
return "" + propValue;
|
|
571
|
+
}
|
|
572
|
+
var propType = getPropType(propValue);
|
|
573
|
+
if (propType === "object") {
|
|
574
|
+
if (propValue instanceof Date) {
|
|
417
575
|
return "date";
|
|
418
|
-
if (
|
|
576
|
+
} else if (propValue instanceof RegExp) {
|
|
419
577
|
return "regexp";
|
|
578
|
+
}
|
|
420
579
|
}
|
|
421
|
-
return
|
|
580
|
+
return propType;
|
|
422
581
|
}
|
|
423
|
-
function
|
|
424
|
-
var
|
|
425
|
-
switch (
|
|
582
|
+
function getPostfixForTypeWarning(value) {
|
|
583
|
+
var type = getPreciseType(value);
|
|
584
|
+
switch (type) {
|
|
426
585
|
case "array":
|
|
427
586
|
case "object":
|
|
428
|
-
return "an " +
|
|
587
|
+
return "an " + type;
|
|
429
588
|
case "boolean":
|
|
430
589
|
case "date":
|
|
431
590
|
case "regexp":
|
|
432
|
-
return "a " +
|
|
591
|
+
return "a " + type;
|
|
433
592
|
default:
|
|
434
|
-
return
|
|
593
|
+
return type;
|
|
435
594
|
}
|
|
436
595
|
}
|
|
437
|
-
function
|
|
438
|
-
|
|
596
|
+
function getClassName(propValue) {
|
|
597
|
+
if (!propValue.constructor || !propValue.constructor.name) {
|
|
598
|
+
return ANONYMOUS;
|
|
599
|
+
}
|
|
600
|
+
return propValue.constructor.name;
|
|
439
601
|
}
|
|
440
|
-
|
|
441
|
-
|
|
602
|
+
ReactPropTypes.checkPropTypes = checkPropTypes;
|
|
603
|
+
ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;
|
|
604
|
+
ReactPropTypes.PropTypes = ReactPropTypes;
|
|
605
|
+
return ReactPropTypes;
|
|
606
|
+
};
|
|
607
|
+
return factoryWithTypeCheckers;
|
|
442
608
|
}
|
|
443
|
-
var
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
609
|
+
var factoryWithThrowingShims;
|
|
610
|
+
var hasRequiredFactoryWithThrowingShims;
|
|
611
|
+
function requireFactoryWithThrowingShims() {
|
|
612
|
+
if (hasRequiredFactoryWithThrowingShims) return factoryWithThrowingShims;
|
|
613
|
+
hasRequiredFactoryWithThrowingShims = 1;
|
|
614
|
+
var ReactPropTypesSecret = requireReactPropTypesSecret();
|
|
615
|
+
function emptyFunction() {
|
|
449
616
|
}
|
|
450
|
-
function
|
|
617
|
+
function emptyFunctionWithReset() {
|
|
451
618
|
}
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
);
|
|
458
|
-
throw M.name = "Invariant Violation", M;
|
|
619
|
+
emptyFunctionWithReset.resetWarningCache = emptyFunction;
|
|
620
|
+
factoryWithThrowingShims = function() {
|
|
621
|
+
function shim(props, propName, componentName, location, propFullName, secret) {
|
|
622
|
+
if (secret === ReactPropTypesSecret) {
|
|
623
|
+
return;
|
|
459
624
|
}
|
|
625
|
+
var err = new Error(
|
|
626
|
+
"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types"
|
|
627
|
+
);
|
|
628
|
+
err.name = "Invariant Violation";
|
|
629
|
+
throw err;
|
|
460
630
|
}
|
|
461
|
-
|
|
462
|
-
function
|
|
463
|
-
return
|
|
631
|
+
shim.isRequired = shim;
|
|
632
|
+
function getShim() {
|
|
633
|
+
return shim;
|
|
464
634
|
}
|
|
465
|
-
var
|
|
466
|
-
array:
|
|
467
|
-
bigint:
|
|
468
|
-
bool:
|
|
469
|
-
func:
|
|
470
|
-
number:
|
|
471
|
-
object:
|
|
472
|
-
string:
|
|
473
|
-
symbol:
|
|
474
|
-
any:
|
|
475
|
-
arrayOf:
|
|
476
|
-
element:
|
|
477
|
-
elementType:
|
|
478
|
-
instanceOf:
|
|
479
|
-
node:
|
|
480
|
-
objectOf:
|
|
481
|
-
oneOf:
|
|
482
|
-
oneOfType:
|
|
483
|
-
shape:
|
|
484
|
-
exact:
|
|
485
|
-
checkPropTypes:
|
|
486
|
-
resetWarningCache:
|
|
635
|
+
var ReactPropTypes = {
|
|
636
|
+
array: shim,
|
|
637
|
+
bigint: shim,
|
|
638
|
+
bool: shim,
|
|
639
|
+
func: shim,
|
|
640
|
+
number: shim,
|
|
641
|
+
object: shim,
|
|
642
|
+
string: shim,
|
|
643
|
+
symbol: shim,
|
|
644
|
+
any: shim,
|
|
645
|
+
arrayOf: getShim,
|
|
646
|
+
element: shim,
|
|
647
|
+
elementType: shim,
|
|
648
|
+
instanceOf: getShim,
|
|
649
|
+
node: shim,
|
|
650
|
+
objectOf: getShim,
|
|
651
|
+
oneOf: getShim,
|
|
652
|
+
oneOfType: getShim,
|
|
653
|
+
shape: getShim,
|
|
654
|
+
exact: getShim,
|
|
655
|
+
checkPropTypes: emptyFunctionWithReset,
|
|
656
|
+
resetWarningCache: emptyFunction
|
|
487
657
|
};
|
|
488
|
-
|
|
489
|
-
|
|
658
|
+
ReactPropTypes.PropTypes = ReactPropTypes;
|
|
659
|
+
return ReactPropTypes;
|
|
660
|
+
};
|
|
661
|
+
return factoryWithThrowingShims;
|
|
490
662
|
}
|
|
491
663
|
if (process.env.NODE_ENV !== "production") {
|
|
492
|
-
var
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
664
|
+
var ReactIs = require$$0;
|
|
665
|
+
var throwOnDirectAccess = true;
|
|
666
|
+
propTypes.exports = requireFactoryWithTypeCheckers()(ReactIs.isElement, throwOnDirectAccess);
|
|
667
|
+
} else {
|
|
668
|
+
propTypes.exports = requireFactoryWithThrowingShims()();
|
|
669
|
+
}
|
|
670
|
+
var propTypesExports = propTypes.exports;
|
|
671
|
+
const PropTypes = /* @__PURE__ */ getDefaultExportFromCjs(propTypesExports);
|
|
672
|
+
const responsivePropType = process.env.NODE_ENV !== "production" ? PropTypes.oneOfType([PropTypes.number, PropTypes.string, PropTypes.object, PropTypes.array]) : {};
|
|
673
|
+
function getPath(obj, path, checkVars = true) {
|
|
674
|
+
if (obj && obj.vars && checkVars) {
|
|
675
|
+
const val = `vars.${path}`.split(".").reduce((acc, item) => acc && acc[item] ? acc[item] : null, obj);
|
|
676
|
+
if (val != null) {
|
|
677
|
+
return val;
|
|
678
|
+
}
|
|
503
679
|
}
|
|
504
|
-
return
|
|
680
|
+
return path.split(".").reduce((acc, item) => {
|
|
681
|
+
if (acc && acc[item] != null) {
|
|
682
|
+
return acc[item];
|
|
683
|
+
}
|
|
684
|
+
return null;
|
|
685
|
+
}, obj);
|
|
505
686
|
}
|
|
506
|
-
const
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
687
|
+
const marginKeys = ["m", "mt", "mr", "mb", "ml", "mx", "my", "margin", "marginTop", "marginRight", "marginBottom", "marginLeft", "marginX", "marginY", "marginInline", "marginInlineStart", "marginInlineEnd", "marginBlock", "marginBlockStart", "marginBlockEnd"];
|
|
688
|
+
const paddingKeys = ["p", "pt", "pr", "pb", "pl", "px", "py", "padding", "paddingTop", "paddingRight", "paddingBottom", "paddingLeft", "paddingX", "paddingY", "paddingInline", "paddingInlineStart", "paddingInlineEnd", "paddingBlock", "paddingBlockStart", "paddingBlockEnd"];
|
|
689
|
+
const spacingKeys = [...marginKeys, ...paddingKeys];
|
|
690
|
+
function createUnaryUnit(theme, themeKey, defaultValue, propName) {
|
|
691
|
+
var _getPath;
|
|
692
|
+
const themeSpacing = (_getPath = getPath(theme, themeKey, false)) != null ? _getPath : defaultValue;
|
|
693
|
+
if (typeof themeSpacing === "number") {
|
|
694
|
+
return (abs) => {
|
|
695
|
+
if (typeof abs === "string") {
|
|
696
|
+
return abs;
|
|
697
|
+
}
|
|
698
|
+
if (process.env.NODE_ENV !== "production") {
|
|
699
|
+
if (typeof abs !== "number") {
|
|
700
|
+
console.error(`MUI: Expected ${propName} argument to be a number or a string, got ${abs}.`);
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
return themeSpacing * abs;
|
|
704
|
+
};
|
|
705
|
+
}
|
|
706
|
+
if (Array.isArray(themeSpacing)) {
|
|
707
|
+
return (abs) => {
|
|
708
|
+
if (typeof abs === "string") {
|
|
709
|
+
return abs;
|
|
710
|
+
}
|
|
711
|
+
if (process.env.NODE_ENV !== "production") {
|
|
712
|
+
if (!Number.isInteger(abs)) {
|
|
713
|
+
console.error([`MUI: The \`theme.${themeKey}\` array type cannot be combined with non integer values.You should either use an integer value that can be used as index, or define the \`theme.${themeKey}\` as a number.`].join("\n"));
|
|
714
|
+
} else if (abs > themeSpacing.length - 1) {
|
|
715
|
+
console.error([`MUI: The value provided (${abs}) overflows.`, `The supported values are: ${JSON.stringify(themeSpacing)}.`, `${abs} > ${themeSpacing.length - 1}, you need to add the missing values.`].join("\n"));
|
|
716
|
+
}
|
|
717
|
+
}
|
|
718
|
+
return themeSpacing[abs];
|
|
719
|
+
};
|
|
720
|
+
}
|
|
721
|
+
if (typeof themeSpacing === "function") {
|
|
722
|
+
return themeSpacing;
|
|
723
|
+
}
|
|
724
|
+
if (process.env.NODE_ENV !== "production") {
|
|
725
|
+
console.error([`MUI: The \`theme.${themeKey}\` value (${themeSpacing}) is invalid.`, "It should be a number, an array or a function."].join("\n"));
|
|
726
|
+
}
|
|
727
|
+
return () => void 0;
|
|
515
728
|
}
|
|
516
|
-
function
|
|
517
|
-
return
|
|
729
|
+
function createUnarySpacing(theme) {
|
|
730
|
+
return createUnaryUnit(theme, "spacing", 8, "spacing");
|
|
518
731
|
}
|
|
519
|
-
process.env.NODE_ENV !== "production"
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
732
|
+
process.env.NODE_ENV !== "production" ? marginKeys.reduce((obj, key) => {
|
|
733
|
+
obj[key] = responsivePropType;
|
|
734
|
+
return obj;
|
|
735
|
+
}, {}) : {};
|
|
736
|
+
process.env.NODE_ENV !== "production" ? paddingKeys.reduce((obj, key) => {
|
|
737
|
+
obj[key] = responsivePropType;
|
|
738
|
+
return obj;
|
|
739
|
+
}, {}) : {};
|
|
740
|
+
process.env.NODE_ENV !== "production" ? spacingKeys.reduce((obj, key) => {
|
|
741
|
+
obj[key] = responsivePropType;
|
|
742
|
+
return obj;
|
|
743
|
+
}, {}) : {};
|
|
744
|
+
function createSpacing(spacingInput = 8) {
|
|
745
|
+
if (spacingInput.mui) {
|
|
746
|
+
return spacingInput;
|
|
747
|
+
}
|
|
748
|
+
const transform = createUnarySpacing({
|
|
749
|
+
spacing: spacingInput
|
|
750
|
+
});
|
|
751
|
+
const spacing = (...argsInput) => {
|
|
752
|
+
if (process.env.NODE_ENV !== "production") {
|
|
753
|
+
if (!(argsInput.length <= 4)) {
|
|
754
|
+
console.error(`MUI: Too many arguments provided, expected between 0 and 4, got ${argsInput.length}`);
|
|
755
|
+
}
|
|
756
|
+
}
|
|
757
|
+
const args = argsInput.length === 0 ? [1] : argsInput;
|
|
758
|
+
return args.map((argument) => {
|
|
759
|
+
const output = transform(argument);
|
|
760
|
+
return typeof output === "number" ? `${output}px` : output;
|
|
761
|
+
}).join(" ");
|
|
762
|
+
};
|
|
763
|
+
spacing.mui = true;
|
|
764
|
+
return spacing;
|
|
532
765
|
}
|
|
533
|
-
const
|
|
766
|
+
const SPACING = 8;
|
|
767
|
+
const BREAKPOINTS = {
|
|
534
768
|
XS: 320,
|
|
535
769
|
SM: 600,
|
|
536
770
|
MD: 960,
|
|
537
771
|
LG: 1280,
|
|
538
772
|
XL: 1600
|
|
539
|
-
}
|
|
773
|
+
};
|
|
774
|
+
const getSpacing = createSpacing(SPACING);
|
|
775
|
+
const ICON_SIZE_SMALL = getSpacing(1.5);
|
|
776
|
+
const ICON_SIZE_MEDIUM = getSpacing(2.25);
|
|
777
|
+
const ICON_SIZE_LARGE = getSpacing(3);
|
|
778
|
+
const APPBAR_SIZE = getSpacing(6);
|
|
779
|
+
const NOTIFICATION_DURATION_IN_MS = 6e3;
|
|
780
|
+
const FontWeight = {
|
|
540
781
|
regular: 400,
|
|
541
782
|
medium: 500,
|
|
542
783
|
strong: 600
|
|
543
784
|
};
|
|
544
|
-
function
|
|
545
|
-
const
|
|
546
|
-
fontWeight:
|
|
547
|
-
fontStyle:
|
|
785
|
+
function _Typography({ italic, weight, style, children, ...otherProps }, ref) {
|
|
786
|
+
const fontConfiguration = {
|
|
787
|
+
fontWeight: FontWeight[weight],
|
|
788
|
+
fontStyle: italic ? "italic" : void 0
|
|
548
789
|
};
|
|
549
|
-
return /* @__PURE__ */
|
|
550
|
-
|
|
790
|
+
return /* @__PURE__ */ jsx(
|
|
791
|
+
Typography$1,
|
|
551
792
|
{
|
|
552
|
-
...
|
|
553
|
-
ref
|
|
793
|
+
...otherProps,
|
|
794
|
+
ref,
|
|
554
795
|
style: {
|
|
555
|
-
...
|
|
556
|
-
...
|
|
796
|
+
...fontConfiguration,
|
|
797
|
+
...style
|
|
557
798
|
},
|
|
558
799
|
"data-name": "typography",
|
|
559
|
-
children
|
|
800
|
+
children
|
|
560
801
|
}
|
|
561
802
|
);
|
|
562
803
|
}
|
|
563
|
-
const
|
|
804
|
+
const Typography = forwardRef(_Typography);
|
|
805
|
+
const en = {
|
|
564
806
|
c4r: {
|
|
565
807
|
button: {
|
|
566
808
|
cancel: "Cancel",
|
|
@@ -707,7 +949,8 @@ const qa = De(ta), ia = {
|
|
|
707
949
|
}
|
|
708
950
|
}
|
|
709
951
|
}
|
|
710
|
-
}
|
|
952
|
+
};
|
|
953
|
+
const es = {
|
|
711
954
|
c4r: {
|
|
712
955
|
button: {
|
|
713
956
|
cancel: "Cancelar",
|
|
@@ -852,7 +1095,8 @@ const qa = De(ta), ia = {
|
|
|
852
1095
|
}
|
|
853
1096
|
}
|
|
854
1097
|
}
|
|
855
|
-
}
|
|
1098
|
+
};
|
|
1099
|
+
const id = {
|
|
856
1100
|
c4r: {
|
|
857
1101
|
button: {
|
|
858
1102
|
cancel: "Batal",
|
|
@@ -999,16 +1243,25 @@ const qa = De(ta), ia = {
|
|
|
999
1243
|
}
|
|
1000
1244
|
}
|
|
1001
1245
|
}
|
|
1002
|
-
}
|
|
1003
|
-
|
|
1004
|
-
|
|
1246
|
+
};
|
|
1247
|
+
const messages = { en, es, id };
|
|
1248
|
+
function CanonicalizeLocaleList(locales) {
|
|
1249
|
+
return Intl.getCanonicalLocales(locales);
|
|
1005
1250
|
}
|
|
1006
|
-
function
|
|
1007
|
-
if (
|
|
1008
|
-
(
|
|
1009
|
-
|
|
1251
|
+
function __spreadArray(to, from, pack) {
|
|
1252
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
1253
|
+
if (ar || !(i in from)) {
|
|
1254
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
1255
|
+
ar[i] = from[i];
|
|
1256
|
+
}
|
|
1257
|
+
}
|
|
1258
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
1010
1259
|
}
|
|
1011
|
-
|
|
1260
|
+
typeof SuppressedError === "function" ? SuppressedError : function(error, suppressed, message) {
|
|
1261
|
+
var e = new Error(message);
|
|
1262
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
1263
|
+
};
|
|
1264
|
+
var data = {
|
|
1012
1265
|
supplemental: {
|
|
1013
1266
|
languageMatching: {
|
|
1014
1267
|
"written-new": [
|
|
@@ -3627,7 +3880,8 @@ var Q = {
|
|
|
3627
3880
|
]
|
|
3628
3881
|
}
|
|
3629
3882
|
}
|
|
3630
|
-
}
|
|
3883
|
+
};
|
|
3884
|
+
var regions = {
|
|
3631
3885
|
"001": [
|
|
3632
3886
|
"001",
|
|
3633
3887
|
"001-status-grouping",
|
|
@@ -4392,7 +4646,7 @@ var Q = {
|
|
|
4392
4646
|
"WF",
|
|
4393
4647
|
"WS"
|
|
4394
4648
|
],
|
|
4395
|
-
142: [
|
|
4649
|
+
"142": [
|
|
4396
4650
|
"030",
|
|
4397
4651
|
"034",
|
|
4398
4652
|
"035",
|
|
@@ -4451,7 +4705,7 @@ var Q = {
|
|
|
4451
4705
|
"VN",
|
|
4452
4706
|
"YE"
|
|
4453
4707
|
],
|
|
4454
|
-
143: [
|
|
4708
|
+
"143": [
|
|
4455
4709
|
"143",
|
|
4456
4710
|
"KG",
|
|
4457
4711
|
"KZ",
|
|
@@ -4459,7 +4713,7 @@ var Q = {
|
|
|
4459
4713
|
"TM",
|
|
4460
4714
|
"UZ"
|
|
4461
4715
|
],
|
|
4462
|
-
145: [
|
|
4716
|
+
"145": [
|
|
4463
4717
|
"145",
|
|
4464
4718
|
"AE",
|
|
4465
4719
|
"AM",
|
|
@@ -4480,7 +4734,7 @@ var Q = {
|
|
|
4480
4734
|
"TR",
|
|
4481
4735
|
"YE"
|
|
4482
4736
|
],
|
|
4483
|
-
150: [
|
|
4737
|
+
"150": [
|
|
4484
4738
|
"039",
|
|
4485
4739
|
"150",
|
|
4486
4740
|
"151",
|
|
@@ -4540,7 +4794,7 @@ var Q = {
|
|
|
4540
4794
|
"VA",
|
|
4541
4795
|
"XK"
|
|
4542
4796
|
],
|
|
4543
|
-
151: [
|
|
4797
|
+
"151": [
|
|
4544
4798
|
"151",
|
|
4545
4799
|
"BG",
|
|
4546
4800
|
"BY",
|
|
@@ -4553,7 +4807,7 @@ var Q = {
|
|
|
4553
4807
|
"SK",
|
|
4554
4808
|
"UA"
|
|
4555
4809
|
],
|
|
4556
|
-
154: [
|
|
4810
|
+
"154": [
|
|
4557
4811
|
"154",
|
|
4558
4812
|
"AX",
|
|
4559
4813
|
"CQ",
|
|
@@ -4573,7 +4827,7 @@ var Q = {
|
|
|
4573
4827
|
"SE",
|
|
4574
4828
|
"SJ"
|
|
4575
4829
|
],
|
|
4576
|
-
155: [
|
|
4830
|
+
"155": [
|
|
4577
4831
|
"155",
|
|
4578
4832
|
"AT",
|
|
4579
4833
|
"BE",
|
|
@@ -4585,7 +4839,7 @@ var Q = {
|
|
|
4585
4839
|
"MC",
|
|
4586
4840
|
"NL"
|
|
4587
4841
|
],
|
|
4588
|
-
202: [
|
|
4842
|
+
"202": [
|
|
4589
4843
|
"011",
|
|
4590
4844
|
"014",
|
|
4591
4845
|
"017",
|
|
@@ -4645,7 +4899,7 @@ var Q = {
|
|
|
4645
4899
|
"ZM",
|
|
4646
4900
|
"ZW"
|
|
4647
4901
|
],
|
|
4648
|
-
419: [
|
|
4902
|
+
"419": [
|
|
4649
4903
|
"005",
|
|
4650
4904
|
"013",
|
|
4651
4905
|
"029",
|
|
@@ -4703,7 +4957,7 @@ var Q = {
|
|
|
4703
4957
|
"VG",
|
|
4704
4958
|
"VI"
|
|
4705
4959
|
],
|
|
4706
|
-
EU: [
|
|
4960
|
+
"EU": [
|
|
4707
4961
|
"AT",
|
|
4708
4962
|
"BE",
|
|
4709
4963
|
"BG",
|
|
@@ -4733,7 +4987,7 @@ var Q = {
|
|
|
4733
4987
|
"SI",
|
|
4734
4988
|
"SK"
|
|
4735
4989
|
],
|
|
4736
|
-
EZ: [
|
|
4990
|
+
"EZ": [
|
|
4737
4991
|
"AT",
|
|
4738
4992
|
"BE",
|
|
4739
4993
|
"CY",
|
|
@@ -4755,7 +5009,7 @@ var Q = {
|
|
|
4755
5009
|
"SI",
|
|
4756
5010
|
"SK"
|
|
4757
5011
|
],
|
|
4758
|
-
QO: [
|
|
5012
|
+
"QO": [
|
|
4759
5013
|
"AC",
|
|
4760
5014
|
"AQ",
|
|
4761
5015
|
"CP",
|
|
@@ -4763,7 +5017,7 @@ var Q = {
|
|
|
4763
5017
|
"QO",
|
|
4764
5018
|
"TA"
|
|
4765
5019
|
],
|
|
4766
|
-
UN: [
|
|
5020
|
+
"UN": [
|
|
4767
5021
|
"AD",
|
|
4768
5022
|
"AE",
|
|
4769
5023
|
"AF",
|
|
@@ -4959,292 +5213,661 @@ var Q = {
|
|
|
4959
5213
|
"ZM",
|
|
4960
5214
|
"ZW"
|
|
4961
5215
|
]
|
|
4962
|
-
}
|
|
4963
|
-
|
|
4964
|
-
|
|
4965
|
-
|
|
5216
|
+
};
|
|
5217
|
+
var UNICODE_EXTENSION_SEQUENCE_REGEX = /-u(?:-[0-9a-z]{2,8})+/gi;
|
|
5218
|
+
function invariant(condition, message, Err) {
|
|
5219
|
+
if (Err === void 0) {
|
|
5220
|
+
Err = Error;
|
|
5221
|
+
}
|
|
5222
|
+
if (!condition) {
|
|
5223
|
+
throw new Err(message);
|
|
5224
|
+
}
|
|
4966
5225
|
}
|
|
4967
|
-
var
|
|
4968
|
-
|
|
4969
|
-
|
|
4970
|
-
|
|
4971
|
-
|
|
4972
|
-
|
|
5226
|
+
var DEFAULT_MATCHING_THRESHOLD = 838;
|
|
5227
|
+
var PROCESSED_DATA;
|
|
5228
|
+
function processData() {
|
|
5229
|
+
var _a, _b;
|
|
5230
|
+
if (!PROCESSED_DATA) {
|
|
5231
|
+
var paradigmLocales = (_b = (_a = data.supplemental.languageMatching["written-new"][0]) === null || _a === void 0 ? void 0 : _a.paradigmLocales) === null || _b === void 0 ? void 0 : _b._locales.split(" ");
|
|
5232
|
+
var matchVariables = data.supplemental.languageMatching["written-new"].slice(1, 5);
|
|
5233
|
+
var data$1 = data.supplemental.languageMatching["written-new"].slice(5);
|
|
5234
|
+
var matches = data$1.map(function(d) {
|
|
5235
|
+
var key = Object.keys(d)[0];
|
|
5236
|
+
var value = d[key];
|
|
4973
5237
|
return {
|
|
4974
|
-
supported:
|
|
4975
|
-
desired:
|
|
4976
|
-
distance: +
|
|
4977
|
-
oneway:
|
|
5238
|
+
supported: key,
|
|
5239
|
+
desired: value._desired,
|
|
5240
|
+
distance: +value._distance,
|
|
5241
|
+
oneway: value.oneway === "true" ? true : false
|
|
4978
5242
|
};
|
|
4979
5243
|
}, {});
|
|
4980
|
-
|
|
4981
|
-
matches
|
|
4982
|
-
matchVariables:
|
|
4983
|
-
var
|
|
4984
|
-
|
|
5244
|
+
PROCESSED_DATA = {
|
|
5245
|
+
matches,
|
|
5246
|
+
matchVariables: matchVariables.reduce(function(all, d) {
|
|
5247
|
+
var key = Object.keys(d)[0];
|
|
5248
|
+
var value = d[key];
|
|
5249
|
+
all[key.slice(1)] = value._value.split("+");
|
|
5250
|
+
return all;
|
|
4985
5251
|
}, {}),
|
|
4986
|
-
paradigmLocales:
|
|
4987
|
-
return new Intl.Locale(
|
|
4988
|
-
}),
|
|
5252
|
+
paradigmLocales: __spreadArray(__spreadArray([], paradigmLocales, true), paradigmLocales.map(function(l) {
|
|
5253
|
+
return new Intl.Locale(l.replace(/_/g, "-")).maximize().toString();
|
|
5254
|
+
}), true)
|
|
4989
5255
|
};
|
|
4990
5256
|
}
|
|
4991
|
-
return
|
|
5257
|
+
return PROCESSED_DATA;
|
|
4992
5258
|
}
|
|
4993
|
-
function
|
|
4994
|
-
var
|
|
4995
|
-
|
|
4996
|
-
|
|
4997
|
-
|
|
4998
|
-
|
|
4999
|
-
|
|
5259
|
+
function isMatched(locale, languageMatchInfoLocale, matchVariables) {
|
|
5260
|
+
var _a = languageMatchInfoLocale.split("-"), language = _a[0], script = _a[1], region = _a[2];
|
|
5261
|
+
var matches = true;
|
|
5262
|
+
if (region && region[0] === "$") {
|
|
5263
|
+
var shouldInclude = region[1] !== "!";
|
|
5264
|
+
var matchRegions = shouldInclude ? matchVariables[region.slice(1)] : matchVariables[region.slice(2)];
|
|
5265
|
+
var expandedMatchedRegions = matchRegions.map(function(r) {
|
|
5266
|
+
return regions[r] || [r];
|
|
5267
|
+
}).reduce(function(all, list) {
|
|
5268
|
+
return __spreadArray(__spreadArray([], all, true), list, true);
|
|
5000
5269
|
}, []);
|
|
5001
|
-
|
|
5002
|
-
} else
|
|
5003
|
-
|
|
5004
|
-
|
|
5270
|
+
matches && (matches = !(expandedMatchedRegions.indexOf(locale.region || "") > 1 != shouldInclude));
|
|
5271
|
+
} else {
|
|
5272
|
+
matches && (matches = locale.region ? region === "*" || region === locale.region : true);
|
|
5273
|
+
}
|
|
5274
|
+
matches && (matches = locale.script ? script === "*" || script === locale.script : true);
|
|
5275
|
+
matches && (matches = locale.language ? language === "*" || language === locale.language : true);
|
|
5276
|
+
return matches;
|
|
5005
5277
|
}
|
|
5006
|
-
function
|
|
5007
|
-
return [
|
|
5278
|
+
function serializeLSR(lsr) {
|
|
5279
|
+
return [lsr.language, lsr.script, lsr.region].filter(Boolean).join("-");
|
|
5008
5280
|
}
|
|
5009
|
-
function
|
|
5010
|
-
for (var
|
|
5011
|
-
var
|
|
5012
|
-
|
|
5013
|
-
|
|
5014
|
-
|
|
5281
|
+
function findMatchingDistanceForLSR(desired, supported, data2) {
|
|
5282
|
+
for (var _i = 0, _a = data2.matches; _i < _a.length; _i++) {
|
|
5283
|
+
var d = _a[_i];
|
|
5284
|
+
var matches = isMatched(desired, d.desired, data2.matchVariables) && isMatched(supported, d.supported, data2.matchVariables);
|
|
5285
|
+
if (!d.oneway && !matches) {
|
|
5286
|
+
matches = isMatched(desired, d.supported, data2.matchVariables) && isMatched(supported, d.desired, data2.matchVariables);
|
|
5287
|
+
}
|
|
5288
|
+
if (matches) {
|
|
5289
|
+
var distance = d.distance * 10;
|
|
5290
|
+
if (data2.paradigmLocales.indexOf(serializeLSR(desired)) > -1 != data2.paradigmLocales.indexOf(serializeLSR(supported)) > -1) {
|
|
5291
|
+
return distance - 1;
|
|
5292
|
+
}
|
|
5293
|
+
return distance;
|
|
5015
5294
|
}
|
|
5016
5295
|
}
|
|
5017
5296
|
throw new Error("No matching distance found");
|
|
5018
5297
|
}
|
|
5019
|
-
function
|
|
5020
|
-
var
|
|
5021
|
-
|
|
5022
|
-
|
|
5023
|
-
|
|
5024
|
-
|
|
5025
|
-
|
|
5026
|
-
|
|
5027
|
-
|
|
5028
|
-
|
|
5029
|
-
|
|
5030
|
-
|
|
5031
|
-
|
|
5032
|
-
|
|
5033
|
-
|
|
5034
|
-
|
|
5035
|
-
|
|
5036
|
-
|
|
5037
|
-
|
|
5038
|
-
|
|
5039
|
-
|
|
5040
|
-
|
|
5041
|
-
|
|
5042
|
-
|
|
5043
|
-
|
|
5044
|
-
|
|
5045
|
-
|
|
5298
|
+
function findMatchingDistance(desired, supported) {
|
|
5299
|
+
var desiredLocale = new Intl.Locale(desired).maximize();
|
|
5300
|
+
var supportedLocale = new Intl.Locale(supported).maximize();
|
|
5301
|
+
var desiredLSR = {
|
|
5302
|
+
language: desiredLocale.language,
|
|
5303
|
+
script: desiredLocale.script || "",
|
|
5304
|
+
region: desiredLocale.region || ""
|
|
5305
|
+
};
|
|
5306
|
+
var supportedLSR = {
|
|
5307
|
+
language: supportedLocale.language,
|
|
5308
|
+
script: supportedLocale.script || "",
|
|
5309
|
+
region: supportedLocale.region || ""
|
|
5310
|
+
};
|
|
5311
|
+
var matchingDistance = 0;
|
|
5312
|
+
var data2 = processData();
|
|
5313
|
+
if (desiredLSR.language !== supportedLSR.language) {
|
|
5314
|
+
matchingDistance += findMatchingDistanceForLSR({
|
|
5315
|
+
language: desiredLocale.language,
|
|
5316
|
+
script: "",
|
|
5317
|
+
region: ""
|
|
5318
|
+
}, {
|
|
5319
|
+
language: supportedLocale.language,
|
|
5320
|
+
script: "",
|
|
5321
|
+
region: ""
|
|
5322
|
+
}, data2);
|
|
5323
|
+
}
|
|
5324
|
+
if (desiredLSR.script !== supportedLSR.script) {
|
|
5325
|
+
matchingDistance += findMatchingDistanceForLSR({
|
|
5326
|
+
language: desiredLocale.language,
|
|
5327
|
+
script: desiredLSR.script,
|
|
5328
|
+
region: ""
|
|
5329
|
+
}, {
|
|
5330
|
+
language: supportedLocale.language,
|
|
5331
|
+
script: desiredLSR.script,
|
|
5332
|
+
region: ""
|
|
5333
|
+
}, data2);
|
|
5334
|
+
}
|
|
5335
|
+
if (desiredLSR.region !== supportedLSR.region) {
|
|
5336
|
+
matchingDistance += findMatchingDistanceForLSR(desiredLSR, supportedLSR, data2);
|
|
5337
|
+
}
|
|
5338
|
+
return matchingDistance;
|
|
5046
5339
|
}
|
|
5047
|
-
function
|
|
5048
|
-
|
|
5049
|
-
|
|
5340
|
+
function findBestMatch(requestedLocales, supportedLocales, threshold) {
|
|
5341
|
+
if (threshold === void 0) {
|
|
5342
|
+
threshold = DEFAULT_MATCHING_THRESHOLD;
|
|
5343
|
+
}
|
|
5344
|
+
var lowestDistance = Infinity;
|
|
5345
|
+
var result = {
|
|
5050
5346
|
matchedDesiredLocale: "",
|
|
5051
5347
|
distances: {}
|
|
5052
5348
|
};
|
|
5053
|
-
|
|
5054
|
-
|
|
5055
|
-
|
|
5056
|
-
|
|
5349
|
+
requestedLocales.forEach(function(desired, i) {
|
|
5350
|
+
if (!result.distances[desired]) {
|
|
5351
|
+
result.distances[desired] = {};
|
|
5352
|
+
}
|
|
5353
|
+
supportedLocales.forEach(function(supported) {
|
|
5354
|
+
var distance = findMatchingDistance(desired, supported) + 0 + i * 40;
|
|
5355
|
+
result.distances[desired][supported] = distance;
|
|
5356
|
+
if (distance < lowestDistance) {
|
|
5357
|
+
lowestDistance = distance;
|
|
5358
|
+
result.matchedDesiredLocale = desired;
|
|
5359
|
+
result.matchedSupportedLocale = supported;
|
|
5360
|
+
}
|
|
5057
5361
|
});
|
|
5058
|
-
})
|
|
5362
|
+
});
|
|
5363
|
+
if (lowestDistance >= threshold) {
|
|
5364
|
+
result.matchedDesiredLocale = void 0;
|
|
5365
|
+
result.matchedSupportedLocale = void 0;
|
|
5366
|
+
}
|
|
5367
|
+
return result;
|
|
5059
5368
|
}
|
|
5060
|
-
function
|
|
5061
|
-
var
|
|
5062
|
-
|
|
5063
|
-
|
|
5064
|
-
|
|
5065
|
-
|
|
5066
|
-
|
|
5067
|
-
|
|
5068
|
-
|
|
5369
|
+
function BestFitMatcher(availableLocales, requestedLocales, getDefaultLocale) {
|
|
5370
|
+
var foundLocale;
|
|
5371
|
+
var extension;
|
|
5372
|
+
var noExtensionLocales = [];
|
|
5373
|
+
var noExtensionLocaleMap = requestedLocales.reduce(function(all, l) {
|
|
5374
|
+
var noExtensionLocale = l.replace(UNICODE_EXTENSION_SEQUENCE_REGEX, "");
|
|
5375
|
+
noExtensionLocales.push(noExtensionLocale);
|
|
5376
|
+
all[noExtensionLocale] = l;
|
|
5377
|
+
return all;
|
|
5378
|
+
}, {});
|
|
5379
|
+
var result = findBestMatch(noExtensionLocales, availableLocales);
|
|
5380
|
+
if (result.matchedSupportedLocale && result.matchedDesiredLocale) {
|
|
5381
|
+
foundLocale = result.matchedSupportedLocale;
|
|
5382
|
+
extension = noExtensionLocaleMap[result.matchedDesiredLocale].slice(result.matchedDesiredLocale.length) || void 0;
|
|
5383
|
+
}
|
|
5384
|
+
if (!foundLocale) {
|
|
5385
|
+
return { locale: getDefaultLocale() };
|
|
5386
|
+
}
|
|
5387
|
+
return {
|
|
5388
|
+
locale: foundLocale,
|
|
5389
|
+
extension
|
|
5390
|
+
};
|
|
5069
5391
|
}
|
|
5070
|
-
function
|
|
5071
|
-
|
|
5072
|
-
|
|
5073
|
-
|
|
5074
|
-
|
|
5075
|
-
|
|
5076
|
-
|
|
5077
|
-
|
|
5392
|
+
function BestAvailableLocale(availableLocales, locale) {
|
|
5393
|
+
var candidate = locale;
|
|
5394
|
+
while (true) {
|
|
5395
|
+
if (availableLocales.indexOf(candidate) > -1) {
|
|
5396
|
+
return candidate;
|
|
5397
|
+
}
|
|
5398
|
+
var pos = candidate.lastIndexOf("-");
|
|
5399
|
+
if (!~pos) {
|
|
5400
|
+
return void 0;
|
|
5401
|
+
}
|
|
5402
|
+
if (pos >= 2 && candidate[pos - 2] === "-") {
|
|
5403
|
+
pos -= 2;
|
|
5404
|
+
}
|
|
5405
|
+
candidate = candidate.slice(0, pos);
|
|
5078
5406
|
}
|
|
5079
5407
|
}
|
|
5080
|
-
function
|
|
5081
|
-
|
|
5082
|
-
|
|
5083
|
-
|
|
5084
|
-
|
|
5408
|
+
function LookupMatcher(availableLocales, requestedLocales, getDefaultLocale) {
|
|
5409
|
+
var result = { locale: "" };
|
|
5410
|
+
for (var _i = 0, requestedLocales_1 = requestedLocales; _i < requestedLocales_1.length; _i++) {
|
|
5411
|
+
var locale = requestedLocales_1[_i];
|
|
5412
|
+
var noExtensionLocale = locale.replace(UNICODE_EXTENSION_SEQUENCE_REGEX, "");
|
|
5413
|
+
var availableLocale = BestAvailableLocale(availableLocales, noExtensionLocale);
|
|
5414
|
+
if (availableLocale) {
|
|
5415
|
+
result.locale = availableLocale;
|
|
5416
|
+
if (locale !== noExtensionLocale) {
|
|
5417
|
+
result.extension = locale.slice(noExtensionLocale.length, locale.length);
|
|
5418
|
+
}
|
|
5419
|
+
return result;
|
|
5420
|
+
}
|
|
5085
5421
|
}
|
|
5086
|
-
|
|
5422
|
+
result.locale = getDefaultLocale();
|
|
5423
|
+
return result;
|
|
5087
5424
|
}
|
|
5088
|
-
function
|
|
5089
|
-
|
|
5090
|
-
var
|
|
5091
|
-
|
|
5092
|
-
|
|
5093
|
-
|
|
5094
|
-
|
|
5425
|
+
function UnicodeExtensionValue(extension, key) {
|
|
5426
|
+
invariant(key.length === 2, "key must have 2 elements");
|
|
5427
|
+
var size = extension.length;
|
|
5428
|
+
var searchValue = "-".concat(key, "-");
|
|
5429
|
+
var pos = extension.indexOf(searchValue);
|
|
5430
|
+
if (pos !== -1) {
|
|
5431
|
+
var start = pos + 4;
|
|
5432
|
+
var end = start;
|
|
5433
|
+
var k = start;
|
|
5434
|
+
var done = false;
|
|
5435
|
+
while (!done) {
|
|
5436
|
+
var e = extension.indexOf("-", k);
|
|
5437
|
+
var len = void 0;
|
|
5438
|
+
if (e === -1) {
|
|
5439
|
+
len = size - k;
|
|
5440
|
+
} else {
|
|
5441
|
+
len = e - k;
|
|
5442
|
+
}
|
|
5443
|
+
if (len === 2) {
|
|
5444
|
+
done = true;
|
|
5445
|
+
} else if (e === -1) {
|
|
5446
|
+
end = size;
|
|
5447
|
+
done = true;
|
|
5448
|
+
} else {
|
|
5449
|
+
end = e;
|
|
5450
|
+
k = e + 1;
|
|
5451
|
+
}
|
|
5095
5452
|
}
|
|
5096
|
-
return
|
|
5453
|
+
return extension.slice(start, end);
|
|
5097
5454
|
}
|
|
5098
|
-
|
|
5455
|
+
searchValue = "-".concat(key);
|
|
5456
|
+
pos = extension.indexOf(searchValue);
|
|
5457
|
+
if (pos !== -1 && pos + 3 === size) {
|
|
5099
5458
|
return "";
|
|
5459
|
+
}
|
|
5460
|
+
return void 0;
|
|
5100
5461
|
}
|
|
5101
|
-
function
|
|
5102
|
-
var
|
|
5103
|
-
|
|
5104
|
-
|
|
5105
|
-
|
|
5106
|
-
|
|
5107
|
-
|
|
5108
|
-
|
|
5109
|
-
|
|
5110
|
-
|
|
5111
|
-
|
|
5112
|
-
|
|
5113
|
-
var
|
|
5114
|
-
|
|
5115
|
-
|
|
5116
|
-
|
|
5462
|
+
function ResolveLocale(availableLocales, requestedLocales, options, relevantExtensionKeys, localeData, getDefaultLocale) {
|
|
5463
|
+
var matcher = options.localeMatcher;
|
|
5464
|
+
var r;
|
|
5465
|
+
if (matcher === "lookup") {
|
|
5466
|
+
r = LookupMatcher(Array.from(availableLocales), requestedLocales, getDefaultLocale);
|
|
5467
|
+
} else {
|
|
5468
|
+
r = BestFitMatcher(Array.from(availableLocales), requestedLocales, getDefaultLocale);
|
|
5469
|
+
}
|
|
5470
|
+
var foundLocale = r.locale;
|
|
5471
|
+
var result = { locale: "", dataLocale: foundLocale };
|
|
5472
|
+
var supportedExtension = "-u";
|
|
5473
|
+
for (var _i = 0, relevantExtensionKeys_1 = relevantExtensionKeys; _i < relevantExtensionKeys_1.length; _i++) {
|
|
5474
|
+
var key = relevantExtensionKeys_1[_i];
|
|
5475
|
+
invariant(foundLocale in localeData, "Missing locale data for ".concat(foundLocale));
|
|
5476
|
+
var foundLocaleData = localeData[foundLocale];
|
|
5477
|
+
invariant(typeof foundLocaleData === "object" && foundLocaleData !== null, "locale data ".concat(key, " must be an object"));
|
|
5478
|
+
var keyLocaleData = foundLocaleData[key];
|
|
5479
|
+
invariant(Array.isArray(keyLocaleData), "keyLocaleData for ".concat(key, " must be an array"));
|
|
5480
|
+
var value = keyLocaleData[0];
|
|
5481
|
+
invariant(typeof value === "string" || value === null, "value must be string or null but got ".concat(typeof value, " in key ").concat(key));
|
|
5482
|
+
var supportedExtensionAddition = "";
|
|
5483
|
+
if (r.extension) {
|
|
5484
|
+
var requestedValue = UnicodeExtensionValue(r.extension, key);
|
|
5485
|
+
if (requestedValue !== void 0) {
|
|
5486
|
+
if (requestedValue !== "") {
|
|
5487
|
+
if (~keyLocaleData.indexOf(requestedValue)) {
|
|
5488
|
+
value = requestedValue;
|
|
5489
|
+
supportedExtensionAddition = "-".concat(key, "-").concat(value);
|
|
5490
|
+
}
|
|
5491
|
+
} else if (~requestedValue.indexOf("true")) {
|
|
5492
|
+
value = "true";
|
|
5493
|
+
supportedExtensionAddition = "-".concat(key);
|
|
5494
|
+
}
|
|
5495
|
+
}
|
|
5117
5496
|
}
|
|
5118
|
-
if (
|
|
5119
|
-
var
|
|
5120
|
-
|
|
5497
|
+
if (key in options) {
|
|
5498
|
+
var optionsValue = options[key];
|
|
5499
|
+
invariant(typeof optionsValue === "string" || typeof optionsValue === "undefined" || optionsValue === null, "optionsValue must be String, Undefined or Null");
|
|
5500
|
+
if (~keyLocaleData.indexOf(optionsValue)) {
|
|
5501
|
+
if (optionsValue !== value) {
|
|
5502
|
+
value = optionsValue;
|
|
5503
|
+
supportedExtensionAddition = "";
|
|
5504
|
+
}
|
|
5505
|
+
}
|
|
5121
5506
|
}
|
|
5122
|
-
|
|
5507
|
+
result[key] = value;
|
|
5508
|
+
supportedExtension += supportedExtensionAddition;
|
|
5123
5509
|
}
|
|
5124
|
-
if (
|
|
5125
|
-
var
|
|
5126
|
-
if (
|
|
5127
|
-
|
|
5128
|
-
else {
|
|
5129
|
-
var
|
|
5130
|
-
|
|
5510
|
+
if (supportedExtension.length > 2) {
|
|
5511
|
+
var privateIndex = foundLocale.indexOf("-x-");
|
|
5512
|
+
if (privateIndex === -1) {
|
|
5513
|
+
foundLocale = foundLocale + supportedExtension;
|
|
5514
|
+
} else {
|
|
5515
|
+
var preExtension = foundLocale.slice(0, privateIndex);
|
|
5516
|
+
var postExtension = foundLocale.slice(privateIndex, foundLocale.length);
|
|
5517
|
+
foundLocale = preExtension + supportedExtension + postExtension;
|
|
5131
5518
|
}
|
|
5132
|
-
|
|
5519
|
+
foundLocale = Intl.getCanonicalLocales(foundLocale)[0];
|
|
5133
5520
|
}
|
|
5134
|
-
|
|
5521
|
+
result.locale = foundLocale;
|
|
5522
|
+
return result;
|
|
5135
5523
|
}
|
|
5136
|
-
function
|
|
5137
|
-
return
|
|
5524
|
+
function match(requestedLocales, availableLocales, defaultLocale, opts) {
|
|
5525
|
+
return ResolveLocale(availableLocales, CanonicalizeLocaleList(requestedLocales), {
|
|
5138
5526
|
localeMatcher: "best fit"
|
|
5139
5527
|
}, [], {}, function() {
|
|
5140
|
-
return
|
|
5528
|
+
return defaultLocale;
|
|
5141
5529
|
}).locale;
|
|
5142
5530
|
}
|
|
5143
|
-
const
|
|
5144
|
-
function
|
|
5145
|
-
return Object.keys(
|
|
5146
|
-
(
|
|
5147
|
-
const
|
|
5148
|
-
|
|
5531
|
+
const DEFAULT_LOCALE = "en";
|
|
5532
|
+
function flattenMessages(nestedMessages, prefix = "") {
|
|
5533
|
+
return Object.keys(nestedMessages).reduce(
|
|
5534
|
+
(messages2, key) => {
|
|
5535
|
+
const value = nestedMessages[key];
|
|
5536
|
+
const prefixedKey = prefix ? `${prefix}.${key}` : key;
|
|
5537
|
+
if (typeof value === "string") {
|
|
5538
|
+
messages2[prefixedKey] = value;
|
|
5539
|
+
} else {
|
|
5540
|
+
Object.assign(messages2, flattenMessages(value, prefixedKey));
|
|
5541
|
+
}
|
|
5542
|
+
return messages2;
|
|
5149
5543
|
},
|
|
5150
5544
|
{}
|
|
5151
5545
|
);
|
|
5152
5546
|
}
|
|
5153
|
-
function
|
|
5154
|
-
const
|
|
5155
|
-
|
|
5156
|
-
|
|
5157
|
-
|
|
5547
|
+
function findMatchingMessagesLocale(locale, messages2) {
|
|
5548
|
+
const availableLocales = Object.keys(messages2);
|
|
5549
|
+
const matchedLocale = match(
|
|
5550
|
+
[locale],
|
|
5551
|
+
availableLocales,
|
|
5552
|
+
DEFAULT_LOCALE
|
|
5158
5553
|
);
|
|
5159
|
-
return
|
|
5554
|
+
return matchedLocale ? matchedLocale : DEFAULT_LOCALE;
|
|
5160
5555
|
}
|
|
5161
|
-
const
|
|
5162
|
-
|
|
5163
|
-
|
|
5164
|
-
|
|
5165
|
-
|
|
5166
|
-
|
|
5556
|
+
const cache = createIntlCache();
|
|
5557
|
+
const intlInstanceCache = /* @__PURE__ */ new WeakMap();
|
|
5558
|
+
const createIntlInstance = (intlConfig) => {
|
|
5559
|
+
const locale = (intlConfig == null ? void 0 : intlConfig.locale) || DEFAULT_LOCALE;
|
|
5560
|
+
const messagesLocale = findMatchingMessagesLocale(locale, messages);
|
|
5561
|
+
const intMessages = {
|
|
5562
|
+
...messages[messagesLocale] || {},
|
|
5563
|
+
...(intlConfig == null ? void 0 : intlConfig.messages) ?? {}
|
|
5564
|
+
};
|
|
5565
|
+
const combinedMessages = flattenMessages(intMessages);
|
|
5566
|
+
return createIntl(
|
|
5167
5567
|
{
|
|
5168
|
-
locale
|
|
5169
|
-
messages:
|
|
5568
|
+
locale,
|
|
5569
|
+
messages: combinedMessages
|
|
5170
5570
|
},
|
|
5171
|
-
|
|
5571
|
+
cache
|
|
5172
5572
|
);
|
|
5173
|
-
}, Ma = (e) => {
|
|
5174
|
-
const i = we.get(e);
|
|
5175
|
-
if (i)
|
|
5176
|
-
return i;
|
|
5177
|
-
const r = Ta(e);
|
|
5178
|
-
return we.set(e, r), r;
|
|
5179
5573
|
};
|
|
5180
|
-
|
|
5181
|
-
|
|
5574
|
+
const getGloballyCachedIntl = (intlConfig) => {
|
|
5575
|
+
const cachedInstance = intlInstanceCache.get(intlConfig);
|
|
5576
|
+
if (cachedInstance) {
|
|
5577
|
+
return cachedInstance;
|
|
5578
|
+
}
|
|
5579
|
+
const newInstance = createIntlInstance(intlConfig);
|
|
5580
|
+
intlInstanceCache.set(intlConfig, newInstance);
|
|
5581
|
+
return newInstance;
|
|
5582
|
+
};
|
|
5583
|
+
function useImperativeIntl(intlConfig) {
|
|
5584
|
+
return getGloballyCachedIntl(intlConfig);
|
|
5182
5585
|
}
|
|
5183
|
-
const
|
|
5586
|
+
const Root = styled(Box)(({ theme }) => ({
|
|
5184
5587
|
display: "flex",
|
|
5185
|
-
gap:
|
|
5186
|
-
marginLeft:
|
|
5187
|
-
}))
|
|
5588
|
+
gap: theme.spacing(0.5),
|
|
5589
|
+
marginLeft: theme.spacing(1)
|
|
5590
|
+
}));
|
|
5591
|
+
const Button = styled("div")(({ theme }) => ({
|
|
5188
5592
|
"& .MuiIconButton-root:not(.Mui-disabled)": {
|
|
5189
|
-
color:
|
|
5593
|
+
color: theme.palette.text.secondary
|
|
5190
5594
|
}
|
|
5191
5595
|
}));
|
|
5192
|
-
function
|
|
5193
|
-
count
|
|
5194
|
-
page
|
|
5195
|
-
rowsPerPage
|
|
5196
|
-
onPageChange
|
|
5197
|
-
lastPageTooltip
|
|
5596
|
+
function TablePaginationActions({
|
|
5597
|
+
count,
|
|
5598
|
+
page,
|
|
5599
|
+
rowsPerPage = 10,
|
|
5600
|
+
onPageChange,
|
|
5601
|
+
lastPageTooltip
|
|
5198
5602
|
}) {
|
|
5199
|
-
const
|
|
5200
|
-
|
|
5201
|
-
|
|
5202
|
-
|
|
5203
|
-
}
|
|
5603
|
+
const intl = useIntl();
|
|
5604
|
+
const intlConfig = useImperativeIntl(intl);
|
|
5605
|
+
const handleBackButtonClick = (event) => {
|
|
5606
|
+
onPageChange(event, page - 1);
|
|
5607
|
+
};
|
|
5608
|
+
const handleNextButtonClick = (event) => {
|
|
5609
|
+
onPageChange(event, page + 1);
|
|
5610
|
+
};
|
|
5611
|
+
const isLastPage = page === Math.ceil(count / rowsPerPage) - 1;
|
|
5612
|
+
const isFirstPage = page === 0;
|
|
5613
|
+
const prevLabel = intlConfig.formatMessage({
|
|
5204
5614
|
id: "c4r.form.pagination.prevPage"
|
|
5205
|
-
})
|
|
5615
|
+
});
|
|
5616
|
+
const nextLabel = intlConfig.formatMessage({
|
|
5206
5617
|
id: "c4r.form.pagination.nextPage"
|
|
5207
|
-
})
|
|
5618
|
+
});
|
|
5619
|
+
const noMorePagesText = intlConfig.formatMessage({
|
|
5208
5620
|
id: "c4r.form.pagination.noMorePages"
|
|
5209
5621
|
});
|
|
5210
|
-
return /* @__PURE__ */
|
|
5211
|
-
/* @__PURE__ */
|
|
5212
|
-
|
|
5622
|
+
return /* @__PURE__ */ jsxs(Root, { children: [
|
|
5623
|
+
/* @__PURE__ */ jsx(Tooltip, { title: isFirstPage ? noMorePagesText : prevLabel, children: /* @__PURE__ */ jsx(Button, { children: /* @__PURE__ */ jsx(
|
|
5624
|
+
IconButton,
|
|
5213
5625
|
{
|
|
5214
|
-
onClick:
|
|
5215
|
-
disabled:
|
|
5216
|
-
"aria-label":
|
|
5217
|
-
children: /* @__PURE__ */
|
|
5626
|
+
onClick: handleBackButtonClick,
|
|
5627
|
+
disabled: page === 0,
|
|
5628
|
+
"aria-label": prevLabel,
|
|
5629
|
+
children: /* @__PURE__ */ jsx(KeyboardArrowLeftOutlined, {})
|
|
5218
5630
|
}
|
|
5219
5631
|
) }) }),
|
|
5220
|
-
/* @__PURE__ */
|
|
5221
|
-
|
|
5632
|
+
/* @__PURE__ */ jsx(
|
|
5633
|
+
Tooltip,
|
|
5222
5634
|
{
|
|
5223
|
-
title:
|
|
5224
|
-
children: /* @__PURE__ */
|
|
5225
|
-
|
|
5635
|
+
title: isLastPage ? lastPageTooltip ?? noMorePagesText : nextLabel,
|
|
5636
|
+
children: /* @__PURE__ */ jsx(Button, { children: /* @__PURE__ */ jsx(
|
|
5637
|
+
IconButton,
|
|
5226
5638
|
{
|
|
5227
|
-
onClick:
|
|
5228
|
-
disabled:
|
|
5229
|
-
"aria-label":
|
|
5230
|
-
children: /* @__PURE__ */
|
|
5639
|
+
onClick: handleNextButtonClick,
|
|
5640
|
+
disabled: page >= Math.ceil(count / rowsPerPage) - 1,
|
|
5641
|
+
"aria-label": nextLabel.toLocaleLowerCase(),
|
|
5642
|
+
children: /* @__PURE__ */ jsx(KeyboardArrowRightOutlined, {})
|
|
5231
5643
|
}
|
|
5232
5644
|
) })
|
|
5233
5645
|
}
|
|
5234
5646
|
)
|
|
5235
5647
|
] });
|
|
5236
5648
|
}
|
|
5649
|
+
const COLOR_BLACK = "#2C3032";
|
|
5650
|
+
const COLOR_WHITE = "#FFFFFF";
|
|
5651
|
+
const COLOR_UNUSED = "#e91e63";
|
|
5652
|
+
const baseColors = {
|
|
5653
|
+
common: {
|
|
5654
|
+
black: COLOR_BLACK,
|
|
5655
|
+
white: COLOR_WHITE
|
|
5656
|
+
},
|
|
5657
|
+
neutral: {
|
|
5658
|
+
50: "#f8f9f9",
|
|
5659
|
+
100: "#e1e3e4",
|
|
5660
|
+
200: "#cbcdcf",
|
|
5661
|
+
300: "#b4b8ba",
|
|
5662
|
+
400: "#9da2a6",
|
|
5663
|
+
500: "#868d91",
|
|
5664
|
+
600: "#6f777c",
|
|
5665
|
+
700: "#595f63",
|
|
5666
|
+
800: "#43474a",
|
|
5667
|
+
900: COLOR_BLACK,
|
|
5668
|
+
A100: "#ddddde",
|
|
5669
|
+
A200: "#b9babb",
|
|
5670
|
+
A400: "#7c7e7f",
|
|
5671
|
+
A700: "#16191A"
|
|
5672
|
+
},
|
|
5673
|
+
blue: {
|
|
5674
|
+
100: "#B9DAF9",
|
|
5675
|
+
200: "#5DB2F6",
|
|
5676
|
+
300: "#358BE7",
|
|
5677
|
+
400: "#036FE2",
|
|
5678
|
+
500: "#024D9E"
|
|
5679
|
+
},
|
|
5680
|
+
green: {
|
|
5681
|
+
300: "#6BE2AD",
|
|
5682
|
+
400: "#47DB99",
|
|
5683
|
+
500: "#31996B"
|
|
5684
|
+
},
|
|
5685
|
+
lightGreen: {
|
|
5686
|
+
300: "#8CB24A",
|
|
5687
|
+
400: "#709F1D",
|
|
5688
|
+
500: "#435F11"
|
|
5689
|
+
},
|
|
5690
|
+
indigo: {
|
|
5691
|
+
300: "#34689F",
|
|
5692
|
+
400: "#024388",
|
|
5693
|
+
500: "#012C5A"
|
|
5694
|
+
},
|
|
5695
|
+
orange: {
|
|
5696
|
+
300: "#F4B134",
|
|
5697
|
+
400: "#F29E02",
|
|
5698
|
+
500: "#A96E01"
|
|
5699
|
+
},
|
|
5700
|
+
red: {
|
|
5701
|
+
300: "#CD593B",
|
|
5702
|
+
400: "#C1300B",
|
|
5703
|
+
500: "#872107"
|
|
5704
|
+
},
|
|
5705
|
+
qualitative: {
|
|
5706
|
+
// CARTO colors
|
|
5707
|
+
// TODO: Related discussion https://app.shortcut.com/cartoteam/story/264834/
|
|
5708
|
+
bold: {
|
|
5709
|
+
0: "#7F3C8D",
|
|
5710
|
+
1: "#11A579",
|
|
5711
|
+
2: "#3969AC",
|
|
5712
|
+
3: "#F2B701",
|
|
5713
|
+
4: "#E73F74",
|
|
5714
|
+
5: "#80BA5A",
|
|
5715
|
+
6: "#E68310",
|
|
5716
|
+
7: "#008695",
|
|
5717
|
+
8: "#CF1C90",
|
|
5718
|
+
9: "#f97b72",
|
|
5719
|
+
10: "#4b4b8f",
|
|
5720
|
+
11: "#A5AA99"
|
|
5721
|
+
}
|
|
5722
|
+
},
|
|
5723
|
+
shades: {
|
|
5724
|
+
dark: {
|
|
5725
|
+
90: alpha(COLOR_BLACK, 0.9),
|
|
5726
|
+
60: alpha(COLOR_BLACK, 0.6),
|
|
5727
|
+
40: alpha(COLOR_BLACK, 0.4),
|
|
5728
|
+
25: alpha(COLOR_BLACK, 0.25),
|
|
5729
|
+
12: alpha(COLOR_BLACK, 0.12),
|
|
5730
|
+
8: alpha(COLOR_BLACK, 0.08),
|
|
5731
|
+
4: alpha(COLOR_BLACK, 0.04)
|
|
5732
|
+
},
|
|
5733
|
+
light: {
|
|
5734
|
+
90: alpha(COLOR_WHITE, 0.9),
|
|
5735
|
+
60: alpha(COLOR_WHITE, 0.6),
|
|
5736
|
+
40: alpha(COLOR_WHITE, 0.4),
|
|
5737
|
+
25: alpha(COLOR_WHITE, 0.25),
|
|
5738
|
+
12: alpha(COLOR_WHITE, 0.12),
|
|
5739
|
+
8: alpha(COLOR_WHITE, 0.08),
|
|
5740
|
+
4: alpha(COLOR_WHITE, 0.04)
|
|
5741
|
+
}
|
|
5742
|
+
}
|
|
5743
|
+
};
|
|
5744
|
+
const commonPalette = {
|
|
5745
|
+
mode: "light",
|
|
5746
|
+
contrastThreshold: 3,
|
|
5747
|
+
tonalOffset: 0.2,
|
|
5748
|
+
common: { ...baseColors.common },
|
|
5749
|
+
primary: {
|
|
5750
|
+
main: baseColors.blue[400],
|
|
5751
|
+
dark: baseColors.blue[500],
|
|
5752
|
+
light: baseColors.blue[300],
|
|
5753
|
+
contrastText: baseColors.common.white,
|
|
5754
|
+
background: alpha(baseColors.blue[400], 0.08),
|
|
5755
|
+
relatedLight: "#EAF2FC",
|
|
5756
|
+
relatedDark: COLOR_UNUSED
|
|
5757
|
+
},
|
|
5758
|
+
secondary: {
|
|
5759
|
+
main: baseColors.green[400],
|
|
5760
|
+
dark: baseColors.green[500],
|
|
5761
|
+
light: baseColors.green[300],
|
|
5762
|
+
contrastText: baseColors.common.black,
|
|
5763
|
+
background: alpha(baseColors.green[400], 0.08),
|
|
5764
|
+
relatedLight: "#EFFCF5",
|
|
5765
|
+
relatedDark: COLOR_UNUSED
|
|
5766
|
+
},
|
|
5767
|
+
text: {
|
|
5768
|
+
primary: baseColors.common.black,
|
|
5769
|
+
secondary: baseColors.shades.dark[60],
|
|
5770
|
+
disabled: baseColors.shades.dark[25],
|
|
5771
|
+
hint: baseColors.shades.dark[40]
|
|
5772
|
+
},
|
|
5773
|
+
background: {
|
|
5774
|
+
paper: baseColors.common.white,
|
|
5775
|
+
default: baseColors.neutral[50]
|
|
5776
|
+
},
|
|
5777
|
+
action: {
|
|
5778
|
+
active: baseColors.shades.dark[40],
|
|
5779
|
+
hover: baseColors.shades.dark[8],
|
|
5780
|
+
disabledBackground: baseColors.neutral[100],
|
|
5781
|
+
disabled: baseColors.shades.dark[25],
|
|
5782
|
+
selected: baseColors.shades.dark[12],
|
|
5783
|
+
focus: baseColors.shades.dark[12],
|
|
5784
|
+
activatedOpacity: 0.12,
|
|
5785
|
+
hoverOpacity: 0.04,
|
|
5786
|
+
selectedOpacity: 0.08,
|
|
5787
|
+
disabledOpacity: 0.38,
|
|
5788
|
+
focusOpacity: 0.12
|
|
5789
|
+
},
|
|
5790
|
+
info: {
|
|
5791
|
+
main: baseColors.indigo[400],
|
|
5792
|
+
dark: baseColors.indigo[500],
|
|
5793
|
+
light: baseColors.indigo[300],
|
|
5794
|
+
contrastText: baseColors.common.white,
|
|
5795
|
+
relatedDark: "#0D2B4A",
|
|
5796
|
+
relatedLight: "#E9EEF4",
|
|
5797
|
+
background: COLOR_UNUSED
|
|
5798
|
+
},
|
|
5799
|
+
success: {
|
|
5800
|
+
main: baseColors.lightGreen[400],
|
|
5801
|
+
dark: baseColors.lightGreen[500],
|
|
5802
|
+
light: baseColors.lightGreen[300],
|
|
5803
|
+
contrastText: baseColors.common.white,
|
|
5804
|
+
relatedDark: "#3D541A",
|
|
5805
|
+
relatedLight: "#F2F5EB",
|
|
5806
|
+
background: COLOR_UNUSED
|
|
5807
|
+
},
|
|
5808
|
+
warning: {
|
|
5809
|
+
main: baseColors.orange[400],
|
|
5810
|
+
dark: baseColors.orange[500],
|
|
5811
|
+
light: baseColors.orange[300],
|
|
5812
|
+
contrastText: baseColors.common.black,
|
|
5813
|
+
relatedDark: "#78540F",
|
|
5814
|
+
relatedLight: "#FEF6EA",
|
|
5815
|
+
background: COLOR_UNUSED
|
|
5816
|
+
},
|
|
5817
|
+
error: {
|
|
5818
|
+
main: baseColors.red[400],
|
|
5819
|
+
light: baseColors.red[300],
|
|
5820
|
+
dark: baseColors.red[500],
|
|
5821
|
+
contrastText: baseColors.common.white,
|
|
5822
|
+
relatedDark: "#622215",
|
|
5823
|
+
relatedLight: "#F9EDEA",
|
|
5824
|
+
background: COLOR_UNUSED
|
|
5825
|
+
},
|
|
5826
|
+
grey: {
|
|
5827
|
+
...baseColors.neutral
|
|
5828
|
+
},
|
|
5829
|
+
divider: baseColors.shades.dark[12],
|
|
5830
|
+
// Custom common colors
|
|
5831
|
+
default: {
|
|
5832
|
+
main: baseColors.neutral[100],
|
|
5833
|
+
dark: baseColors.neutral[200],
|
|
5834
|
+
light: baseColors.neutral[50],
|
|
5835
|
+
outlinedBorder: baseColors.shades.dark[25],
|
|
5836
|
+
background: baseColors.shades.dark[4],
|
|
5837
|
+
relatedLight: COLOR_UNUSED,
|
|
5838
|
+
relatedDark: COLOR_UNUSED,
|
|
5839
|
+
contrastText: COLOR_UNUSED
|
|
5840
|
+
},
|
|
5841
|
+
brand: {
|
|
5842
|
+
navyBlue: "#162945",
|
|
5843
|
+
locationRed: "#EB1510",
|
|
5844
|
+
predictionBlue: "#1785FB",
|
|
5845
|
+
softBlue: "#F2F6F9",
|
|
5846
|
+
appBarMain: "#162945",
|
|
5847
|
+
appBarContrastText: baseColors.common.white
|
|
5848
|
+
},
|
|
5849
|
+
white: {
|
|
5850
|
+
...baseColors.shades.light
|
|
5851
|
+
},
|
|
5852
|
+
black: {
|
|
5853
|
+
...baseColors.shades.dark
|
|
5854
|
+
},
|
|
5855
|
+
qualitative: {
|
|
5856
|
+
...baseColors.qualitative
|
|
5857
|
+
}
|
|
5858
|
+
};
|
|
5237
5859
|
export {
|
|
5238
|
-
|
|
5239
|
-
|
|
5240
|
-
|
|
5241
|
-
|
|
5242
|
-
|
|
5243
|
-
|
|
5244
|
-
|
|
5245
|
-
|
|
5246
|
-
|
|
5247
|
-
|
|
5248
|
-
|
|
5249
|
-
|
|
5860
|
+
APPBAR_SIZE as A,
|
|
5861
|
+
BREAKPOINTS as B,
|
|
5862
|
+
ICON_SIZE_LARGE as I,
|
|
5863
|
+
NOTIFICATION_DURATION_IN_MS as N,
|
|
5864
|
+
SPACING as S,
|
|
5865
|
+
Typography as T,
|
|
5866
|
+
TablePaginationActions as a,
|
|
5867
|
+
ICON_SIZE_MEDIUM as b,
|
|
5868
|
+
ICON_SIZE_SMALL as c,
|
|
5869
|
+
commonPalette as d,
|
|
5870
|
+
getDefaultExportFromCjs as e,
|
|
5871
|
+
getSpacing as g,
|
|
5872
|
+
useImperativeIntl as u
|
|
5250
5873
|
};
|