@carto/meridian-ds 1.4.3-alpha-tag.1 → 1.4.3-alpha-tag.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/dist/Alert--QYebQp3.js +134 -0
- package/dist/Alert-DFaAeTZf.cjs +133 -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/SwatchSquare-DDi0beUM.js +51 -0
- package/dist/SwatchSquare-w-U8-O-P.cjs +50 -0
- package/dist/TablePaginationActions-BG2gWq0M.cjs +5643 -0
- package/dist/{TablePaginationActions-WZ3P4O35.js → TablePaginationActions-Dit3VW-A.js} +1065 -653
- package/dist/components/index.cjs +3540 -1
- package/dist/components/index.js +2324 -1965
- package/dist/custom-icons/index.cjs +5908 -1
- package/dist/custom-icons/index.js +2681 -2298
- package/dist/paletteUtils-B9ybmwiI.cjs +304 -0
- package/dist/paletteUtils-BHqJlHm9.js +288 -0
- package/dist/theme/index.cjs +3135 -1
- package/dist/theme/index.js +1050 -1011
- 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-BAvr1f31.js +0 -130
- package/dist/Alert-DPGMxifE.cjs +0 -4
- 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/SwatchSquare-C34ayL4L.cjs +0 -1
- package/dist/SwatchSquare-CVpwEFFV.js +0 -48
- package/dist/TablePaginationActions-Bp1DCaIE.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 } 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
|
+
}
|
|
190
262
|
}
|
|
191
263
|
}
|
|
192
|
-
|
|
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`."));
|
|
270
|
+
}
|
|
271
|
+
return null;
|
|
272
|
+
} else {
|
|
273
|
+
return validate(props, propName, componentName, location, propFullName);
|
|
274
|
+
}
|
|
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
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
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.");
|
|
302
|
+
}
|
|
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."));
|
|
222
307
|
}
|
|
223
|
-
for (var
|
|
224
|
-
var
|
|
225
|
-
if (
|
|
226
|
-
return
|
|
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
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
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;
|
|
408
|
+
}
|
|
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
|
+
}
|
|
307
417
|
}
|
|
308
|
-
function
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
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
|
-
|
|
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
|
+
}
|
|
521
|
+
}
|
|
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
|
+
}
|
|
396
530
|
}
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
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",
|
|
@@ -701,7 +943,8 @@ const qa = De(ta), ia = {
|
|
|
701
943
|
}
|
|
702
944
|
}
|
|
703
945
|
}
|
|
704
|
-
}
|
|
946
|
+
};
|
|
947
|
+
const es = {
|
|
705
948
|
c4r: {
|
|
706
949
|
button: {
|
|
707
950
|
cancel: "Cancelar",
|
|
@@ -840,7 +1083,8 @@ const qa = De(ta), ia = {
|
|
|
840
1083
|
}
|
|
841
1084
|
}
|
|
842
1085
|
}
|
|
843
|
-
}
|
|
1086
|
+
};
|
|
1087
|
+
const id = {
|
|
844
1088
|
c4r: {
|
|
845
1089
|
button: {
|
|
846
1090
|
cancel: "Batal",
|
|
@@ -981,16 +1225,25 @@ const qa = De(ta), ia = {
|
|
|
981
1225
|
}
|
|
982
1226
|
}
|
|
983
1227
|
}
|
|
984
|
-
}
|
|
985
|
-
|
|
986
|
-
|
|
1228
|
+
};
|
|
1229
|
+
const messages = { en, es, id };
|
|
1230
|
+
function CanonicalizeLocaleList(locales) {
|
|
1231
|
+
return Intl.getCanonicalLocales(locales);
|
|
987
1232
|
}
|
|
988
|
-
function
|
|
989
|
-
if (
|
|
990
|
-
(
|
|
991
|
-
|
|
1233
|
+
function __spreadArray(to, from, pack) {
|
|
1234
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
1235
|
+
if (ar || !(i in from)) {
|
|
1236
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
1237
|
+
ar[i] = from[i];
|
|
1238
|
+
}
|
|
1239
|
+
}
|
|
1240
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
992
1241
|
}
|
|
993
|
-
|
|
1242
|
+
typeof SuppressedError === "function" ? SuppressedError : function(error, suppressed, message) {
|
|
1243
|
+
var e = new Error(message);
|
|
1244
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
1245
|
+
};
|
|
1246
|
+
var data = {
|
|
994
1247
|
supplemental: {
|
|
995
1248
|
languageMatching: {
|
|
996
1249
|
"written-new": [
|
|
@@ -3609,7 +3862,8 @@ var Q = {
|
|
|
3609
3862
|
]
|
|
3610
3863
|
}
|
|
3611
3864
|
}
|
|
3612
|
-
}
|
|
3865
|
+
};
|
|
3866
|
+
var regions = {
|
|
3613
3867
|
"001": [
|
|
3614
3868
|
"001",
|
|
3615
3869
|
"001-status-grouping",
|
|
@@ -4374,7 +4628,7 @@ var Q = {
|
|
|
4374
4628
|
"WF",
|
|
4375
4629
|
"WS"
|
|
4376
4630
|
],
|
|
4377
|
-
142: [
|
|
4631
|
+
"142": [
|
|
4378
4632
|
"030",
|
|
4379
4633
|
"034",
|
|
4380
4634
|
"035",
|
|
@@ -4433,7 +4687,7 @@ var Q = {
|
|
|
4433
4687
|
"VN",
|
|
4434
4688
|
"YE"
|
|
4435
4689
|
],
|
|
4436
|
-
143: [
|
|
4690
|
+
"143": [
|
|
4437
4691
|
"143",
|
|
4438
4692
|
"KG",
|
|
4439
4693
|
"KZ",
|
|
@@ -4441,7 +4695,7 @@ var Q = {
|
|
|
4441
4695
|
"TM",
|
|
4442
4696
|
"UZ"
|
|
4443
4697
|
],
|
|
4444
|
-
145: [
|
|
4698
|
+
"145": [
|
|
4445
4699
|
"145",
|
|
4446
4700
|
"AE",
|
|
4447
4701
|
"AM",
|
|
@@ -4462,7 +4716,7 @@ var Q = {
|
|
|
4462
4716
|
"TR",
|
|
4463
4717
|
"YE"
|
|
4464
4718
|
],
|
|
4465
|
-
150: [
|
|
4719
|
+
"150": [
|
|
4466
4720
|
"039",
|
|
4467
4721
|
"150",
|
|
4468
4722
|
"151",
|
|
@@ -4522,7 +4776,7 @@ var Q = {
|
|
|
4522
4776
|
"VA",
|
|
4523
4777
|
"XK"
|
|
4524
4778
|
],
|
|
4525
|
-
151: [
|
|
4779
|
+
"151": [
|
|
4526
4780
|
"151",
|
|
4527
4781
|
"BG",
|
|
4528
4782
|
"BY",
|
|
@@ -4535,7 +4789,7 @@ var Q = {
|
|
|
4535
4789
|
"SK",
|
|
4536
4790
|
"UA"
|
|
4537
4791
|
],
|
|
4538
|
-
154: [
|
|
4792
|
+
"154": [
|
|
4539
4793
|
"154",
|
|
4540
4794
|
"AX",
|
|
4541
4795
|
"CQ",
|
|
@@ -4555,7 +4809,7 @@ var Q = {
|
|
|
4555
4809
|
"SE",
|
|
4556
4810
|
"SJ"
|
|
4557
4811
|
],
|
|
4558
|
-
155: [
|
|
4812
|
+
"155": [
|
|
4559
4813
|
"155",
|
|
4560
4814
|
"AT",
|
|
4561
4815
|
"BE",
|
|
@@ -4567,7 +4821,7 @@ var Q = {
|
|
|
4567
4821
|
"MC",
|
|
4568
4822
|
"NL"
|
|
4569
4823
|
],
|
|
4570
|
-
202: [
|
|
4824
|
+
"202": [
|
|
4571
4825
|
"011",
|
|
4572
4826
|
"014",
|
|
4573
4827
|
"017",
|
|
@@ -4627,7 +4881,7 @@ var Q = {
|
|
|
4627
4881
|
"ZM",
|
|
4628
4882
|
"ZW"
|
|
4629
4883
|
],
|
|
4630
|
-
419: [
|
|
4884
|
+
"419": [
|
|
4631
4885
|
"005",
|
|
4632
4886
|
"013",
|
|
4633
4887
|
"029",
|
|
@@ -4685,7 +4939,7 @@ var Q = {
|
|
|
4685
4939
|
"VG",
|
|
4686
4940
|
"VI"
|
|
4687
4941
|
],
|
|
4688
|
-
EU: [
|
|
4942
|
+
"EU": [
|
|
4689
4943
|
"AT",
|
|
4690
4944
|
"BE",
|
|
4691
4945
|
"BG",
|
|
@@ -4715,7 +4969,7 @@ var Q = {
|
|
|
4715
4969
|
"SI",
|
|
4716
4970
|
"SK"
|
|
4717
4971
|
],
|
|
4718
|
-
EZ: [
|
|
4972
|
+
"EZ": [
|
|
4719
4973
|
"AT",
|
|
4720
4974
|
"BE",
|
|
4721
4975
|
"CY",
|
|
@@ -4737,7 +4991,7 @@ var Q = {
|
|
|
4737
4991
|
"SI",
|
|
4738
4992
|
"SK"
|
|
4739
4993
|
],
|
|
4740
|
-
QO: [
|
|
4994
|
+
"QO": [
|
|
4741
4995
|
"AC",
|
|
4742
4996
|
"AQ",
|
|
4743
4997
|
"CP",
|
|
@@ -4745,7 +4999,7 @@ var Q = {
|
|
|
4745
4999
|
"QO",
|
|
4746
5000
|
"TA"
|
|
4747
5001
|
],
|
|
4748
|
-
UN: [
|
|
5002
|
+
"UN": [
|
|
4749
5003
|
"AD",
|
|
4750
5004
|
"AE",
|
|
4751
5005
|
"AF",
|
|
@@ -4941,275 +5195,433 @@ var Q = {
|
|
|
4941
5195
|
"ZM",
|
|
4942
5196
|
"ZW"
|
|
4943
5197
|
]
|
|
4944
|
-
}
|
|
4945
|
-
|
|
4946
|
-
|
|
4947
|
-
|
|
5198
|
+
};
|
|
5199
|
+
var UNICODE_EXTENSION_SEQUENCE_REGEX = /-u(?:-[0-9a-z]{2,8})+/gi;
|
|
5200
|
+
function invariant(condition, message, Err) {
|
|
5201
|
+
if (Err === void 0) {
|
|
5202
|
+
Err = Error;
|
|
5203
|
+
}
|
|
5204
|
+
if (!condition) {
|
|
5205
|
+
throw new Err(message);
|
|
5206
|
+
}
|
|
4948
5207
|
}
|
|
4949
|
-
var
|
|
4950
|
-
|
|
4951
|
-
|
|
4952
|
-
|
|
4953
|
-
|
|
4954
|
-
|
|
5208
|
+
var DEFAULT_MATCHING_THRESHOLD = 838;
|
|
5209
|
+
var PROCESSED_DATA;
|
|
5210
|
+
function processData() {
|
|
5211
|
+
var _a, _b;
|
|
5212
|
+
if (!PROCESSED_DATA) {
|
|
5213
|
+
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(" ");
|
|
5214
|
+
var matchVariables = data.supplemental.languageMatching["written-new"].slice(1, 5);
|
|
5215
|
+
var data$1 = data.supplemental.languageMatching["written-new"].slice(5);
|
|
5216
|
+
var matches = data$1.map(function(d) {
|
|
5217
|
+
var key = Object.keys(d)[0];
|
|
5218
|
+
var value = d[key];
|
|
4955
5219
|
return {
|
|
4956
|
-
supported:
|
|
4957
|
-
desired:
|
|
4958
|
-
distance: +
|
|
4959
|
-
oneway:
|
|
5220
|
+
supported: key,
|
|
5221
|
+
desired: value._desired,
|
|
5222
|
+
distance: +value._distance,
|
|
5223
|
+
oneway: value.oneway === "true" ? true : false
|
|
4960
5224
|
};
|
|
4961
5225
|
}, {});
|
|
4962
|
-
|
|
4963
|
-
matches
|
|
4964
|
-
matchVariables:
|
|
4965
|
-
var
|
|
4966
|
-
|
|
5226
|
+
PROCESSED_DATA = {
|
|
5227
|
+
matches,
|
|
5228
|
+
matchVariables: matchVariables.reduce(function(all, d) {
|
|
5229
|
+
var key = Object.keys(d)[0];
|
|
5230
|
+
var value = d[key];
|
|
5231
|
+
all[key.slice(1)] = value._value.split("+");
|
|
5232
|
+
return all;
|
|
4967
5233
|
}, {}),
|
|
4968
|
-
paradigmLocales:
|
|
4969
|
-
return new Intl.Locale(
|
|
4970
|
-
}),
|
|
5234
|
+
paradigmLocales: __spreadArray(__spreadArray([], paradigmLocales, true), paradigmLocales.map(function(l) {
|
|
5235
|
+
return new Intl.Locale(l.replace(/_/g, "-")).maximize().toString();
|
|
5236
|
+
}), true)
|
|
4971
5237
|
};
|
|
4972
5238
|
}
|
|
4973
|
-
return
|
|
5239
|
+
return PROCESSED_DATA;
|
|
4974
5240
|
}
|
|
4975
|
-
function
|
|
4976
|
-
var
|
|
4977
|
-
|
|
4978
|
-
|
|
4979
|
-
|
|
4980
|
-
|
|
4981
|
-
|
|
5241
|
+
function isMatched(locale, languageMatchInfoLocale, matchVariables) {
|
|
5242
|
+
var _a = languageMatchInfoLocale.split("-"), language = _a[0], script = _a[1], region = _a[2];
|
|
5243
|
+
var matches = true;
|
|
5244
|
+
if (region && region[0] === "$") {
|
|
5245
|
+
var shouldInclude = region[1] !== "!";
|
|
5246
|
+
var matchRegions = shouldInclude ? matchVariables[region.slice(1)] : matchVariables[region.slice(2)];
|
|
5247
|
+
var expandedMatchedRegions = matchRegions.map(function(r) {
|
|
5248
|
+
return regions[r] || [r];
|
|
5249
|
+
}).reduce(function(all, list) {
|
|
5250
|
+
return __spreadArray(__spreadArray([], all, true), list, true);
|
|
4982
5251
|
}, []);
|
|
4983
|
-
|
|
4984
|
-
} else
|
|
4985
|
-
|
|
4986
|
-
|
|
5252
|
+
matches && (matches = !(expandedMatchedRegions.indexOf(locale.region || "") > 1 != shouldInclude));
|
|
5253
|
+
} else {
|
|
5254
|
+
matches && (matches = locale.region ? region === "*" || region === locale.region : true);
|
|
5255
|
+
}
|
|
5256
|
+
matches && (matches = locale.script ? script === "*" || script === locale.script : true);
|
|
5257
|
+
matches && (matches = locale.language ? language === "*" || language === locale.language : true);
|
|
5258
|
+
return matches;
|
|
4987
5259
|
}
|
|
4988
|
-
function
|
|
4989
|
-
return [
|
|
5260
|
+
function serializeLSR(lsr) {
|
|
5261
|
+
return [lsr.language, lsr.script, lsr.region].filter(Boolean).join("-");
|
|
4990
5262
|
}
|
|
4991
|
-
function
|
|
4992
|
-
for (var
|
|
4993
|
-
var
|
|
4994
|
-
|
|
4995
|
-
|
|
4996
|
-
|
|
5263
|
+
function findMatchingDistanceForLSR(desired, supported, data2) {
|
|
5264
|
+
for (var _i = 0, _a = data2.matches; _i < _a.length; _i++) {
|
|
5265
|
+
var d = _a[_i];
|
|
5266
|
+
var matches = isMatched(desired, d.desired, data2.matchVariables) && isMatched(supported, d.supported, data2.matchVariables);
|
|
5267
|
+
if (!d.oneway && !matches) {
|
|
5268
|
+
matches = isMatched(desired, d.supported, data2.matchVariables) && isMatched(supported, d.desired, data2.matchVariables);
|
|
5269
|
+
}
|
|
5270
|
+
if (matches) {
|
|
5271
|
+
var distance = d.distance * 10;
|
|
5272
|
+
if (data2.paradigmLocales.indexOf(serializeLSR(desired)) > -1 != data2.paradigmLocales.indexOf(serializeLSR(supported)) > -1) {
|
|
5273
|
+
return distance - 1;
|
|
5274
|
+
}
|
|
5275
|
+
return distance;
|
|
4997
5276
|
}
|
|
4998
5277
|
}
|
|
4999
5278
|
throw new Error("No matching distance found");
|
|
5000
5279
|
}
|
|
5001
|
-
function
|
|
5002
|
-
var
|
|
5003
|
-
|
|
5004
|
-
|
|
5005
|
-
|
|
5006
|
-
|
|
5007
|
-
|
|
5008
|
-
|
|
5009
|
-
|
|
5010
|
-
|
|
5011
|
-
|
|
5012
|
-
|
|
5013
|
-
|
|
5014
|
-
|
|
5015
|
-
|
|
5016
|
-
|
|
5017
|
-
|
|
5018
|
-
|
|
5019
|
-
|
|
5020
|
-
|
|
5021
|
-
|
|
5022
|
-
|
|
5023
|
-
|
|
5024
|
-
|
|
5025
|
-
|
|
5026
|
-
|
|
5027
|
-
|
|
5280
|
+
function findMatchingDistance(desired, supported) {
|
|
5281
|
+
var desiredLocale = new Intl.Locale(desired).maximize();
|
|
5282
|
+
var supportedLocale = new Intl.Locale(supported).maximize();
|
|
5283
|
+
var desiredLSR = {
|
|
5284
|
+
language: desiredLocale.language,
|
|
5285
|
+
script: desiredLocale.script || "",
|
|
5286
|
+
region: desiredLocale.region || ""
|
|
5287
|
+
};
|
|
5288
|
+
var supportedLSR = {
|
|
5289
|
+
language: supportedLocale.language,
|
|
5290
|
+
script: supportedLocale.script || "",
|
|
5291
|
+
region: supportedLocale.region || ""
|
|
5292
|
+
};
|
|
5293
|
+
var matchingDistance = 0;
|
|
5294
|
+
var data2 = processData();
|
|
5295
|
+
if (desiredLSR.language !== supportedLSR.language) {
|
|
5296
|
+
matchingDistance += findMatchingDistanceForLSR({
|
|
5297
|
+
language: desiredLocale.language,
|
|
5298
|
+
script: "",
|
|
5299
|
+
region: ""
|
|
5300
|
+
}, {
|
|
5301
|
+
language: supportedLocale.language,
|
|
5302
|
+
script: "",
|
|
5303
|
+
region: ""
|
|
5304
|
+
}, data2);
|
|
5305
|
+
}
|
|
5306
|
+
if (desiredLSR.script !== supportedLSR.script) {
|
|
5307
|
+
matchingDistance += findMatchingDistanceForLSR({
|
|
5308
|
+
language: desiredLocale.language,
|
|
5309
|
+
script: desiredLSR.script,
|
|
5310
|
+
region: ""
|
|
5311
|
+
}, {
|
|
5312
|
+
language: supportedLocale.language,
|
|
5313
|
+
script: desiredLSR.script,
|
|
5314
|
+
region: ""
|
|
5315
|
+
}, data2);
|
|
5316
|
+
}
|
|
5317
|
+
if (desiredLSR.region !== supportedLSR.region) {
|
|
5318
|
+
matchingDistance += findMatchingDistanceForLSR(desiredLSR, supportedLSR, data2);
|
|
5319
|
+
}
|
|
5320
|
+
return matchingDistance;
|
|
5028
5321
|
}
|
|
5029
|
-
function
|
|
5030
|
-
|
|
5031
|
-
|
|
5322
|
+
function findBestMatch(requestedLocales, supportedLocales, threshold) {
|
|
5323
|
+
if (threshold === void 0) {
|
|
5324
|
+
threshold = DEFAULT_MATCHING_THRESHOLD;
|
|
5325
|
+
}
|
|
5326
|
+
var lowestDistance = Infinity;
|
|
5327
|
+
var result = {
|
|
5032
5328
|
matchedDesiredLocale: "",
|
|
5033
5329
|
distances: {}
|
|
5034
5330
|
};
|
|
5035
|
-
|
|
5036
|
-
|
|
5037
|
-
|
|
5038
|
-
|
|
5331
|
+
requestedLocales.forEach(function(desired, i) {
|
|
5332
|
+
if (!result.distances[desired]) {
|
|
5333
|
+
result.distances[desired] = {};
|
|
5334
|
+
}
|
|
5335
|
+
supportedLocales.forEach(function(supported) {
|
|
5336
|
+
var distance = findMatchingDistance(desired, supported) + 0 + i * 40;
|
|
5337
|
+
result.distances[desired][supported] = distance;
|
|
5338
|
+
if (distance < lowestDistance) {
|
|
5339
|
+
lowestDistance = distance;
|
|
5340
|
+
result.matchedDesiredLocale = desired;
|
|
5341
|
+
result.matchedSupportedLocale = supported;
|
|
5342
|
+
}
|
|
5039
5343
|
});
|
|
5040
|
-
})
|
|
5344
|
+
});
|
|
5345
|
+
if (lowestDistance >= threshold) {
|
|
5346
|
+
result.matchedDesiredLocale = void 0;
|
|
5347
|
+
result.matchedSupportedLocale = void 0;
|
|
5348
|
+
}
|
|
5349
|
+
return result;
|
|
5041
5350
|
}
|
|
5042
|
-
function
|
|
5043
|
-
var
|
|
5044
|
-
|
|
5045
|
-
|
|
5046
|
-
|
|
5047
|
-
|
|
5048
|
-
|
|
5049
|
-
|
|
5050
|
-
|
|
5351
|
+
function BestFitMatcher(availableLocales, requestedLocales, getDefaultLocale) {
|
|
5352
|
+
var foundLocale;
|
|
5353
|
+
var extension;
|
|
5354
|
+
var noExtensionLocales = [];
|
|
5355
|
+
var noExtensionLocaleMap = requestedLocales.reduce(function(all, l) {
|
|
5356
|
+
var noExtensionLocale = l.replace(UNICODE_EXTENSION_SEQUENCE_REGEX, "");
|
|
5357
|
+
noExtensionLocales.push(noExtensionLocale);
|
|
5358
|
+
all[noExtensionLocale] = l;
|
|
5359
|
+
return all;
|
|
5360
|
+
}, {});
|
|
5361
|
+
var result = findBestMatch(noExtensionLocales, availableLocales);
|
|
5362
|
+
if (result.matchedSupportedLocale && result.matchedDesiredLocale) {
|
|
5363
|
+
foundLocale = result.matchedSupportedLocale;
|
|
5364
|
+
extension = noExtensionLocaleMap[result.matchedDesiredLocale].slice(result.matchedDesiredLocale.length) || void 0;
|
|
5365
|
+
}
|
|
5366
|
+
if (!foundLocale) {
|
|
5367
|
+
return { locale: getDefaultLocale() };
|
|
5368
|
+
}
|
|
5369
|
+
return {
|
|
5370
|
+
locale: foundLocale,
|
|
5371
|
+
extension
|
|
5372
|
+
};
|
|
5051
5373
|
}
|
|
5052
|
-
function
|
|
5053
|
-
|
|
5054
|
-
|
|
5055
|
-
|
|
5056
|
-
|
|
5057
|
-
|
|
5058
|
-
|
|
5059
|
-
|
|
5374
|
+
function BestAvailableLocale(availableLocales, locale) {
|
|
5375
|
+
var candidate = locale;
|
|
5376
|
+
while (true) {
|
|
5377
|
+
if (availableLocales.indexOf(candidate) > -1) {
|
|
5378
|
+
return candidate;
|
|
5379
|
+
}
|
|
5380
|
+
var pos = candidate.lastIndexOf("-");
|
|
5381
|
+
if (!~pos) {
|
|
5382
|
+
return void 0;
|
|
5383
|
+
}
|
|
5384
|
+
if (pos >= 2 && candidate[pos - 2] === "-") {
|
|
5385
|
+
pos -= 2;
|
|
5386
|
+
}
|
|
5387
|
+
candidate = candidate.slice(0, pos);
|
|
5060
5388
|
}
|
|
5061
5389
|
}
|
|
5062
|
-
function
|
|
5063
|
-
|
|
5064
|
-
|
|
5065
|
-
|
|
5066
|
-
|
|
5390
|
+
function LookupMatcher(availableLocales, requestedLocales, getDefaultLocale) {
|
|
5391
|
+
var result = { locale: "" };
|
|
5392
|
+
for (var _i = 0, requestedLocales_1 = requestedLocales; _i < requestedLocales_1.length; _i++) {
|
|
5393
|
+
var locale = requestedLocales_1[_i];
|
|
5394
|
+
var noExtensionLocale = locale.replace(UNICODE_EXTENSION_SEQUENCE_REGEX, "");
|
|
5395
|
+
var availableLocale = BestAvailableLocale(availableLocales, noExtensionLocale);
|
|
5396
|
+
if (availableLocale) {
|
|
5397
|
+
result.locale = availableLocale;
|
|
5398
|
+
if (locale !== noExtensionLocale) {
|
|
5399
|
+
result.extension = locale.slice(noExtensionLocale.length, locale.length);
|
|
5400
|
+
}
|
|
5401
|
+
return result;
|
|
5402
|
+
}
|
|
5067
5403
|
}
|
|
5068
|
-
|
|
5404
|
+
result.locale = getDefaultLocale();
|
|
5405
|
+
return result;
|
|
5069
5406
|
}
|
|
5070
|
-
function
|
|
5071
|
-
|
|
5072
|
-
var
|
|
5073
|
-
|
|
5074
|
-
|
|
5075
|
-
|
|
5076
|
-
|
|
5407
|
+
function UnicodeExtensionValue(extension, key) {
|
|
5408
|
+
invariant(key.length === 2, "key must have 2 elements");
|
|
5409
|
+
var size = extension.length;
|
|
5410
|
+
var searchValue = "-".concat(key, "-");
|
|
5411
|
+
var pos = extension.indexOf(searchValue);
|
|
5412
|
+
if (pos !== -1) {
|
|
5413
|
+
var start = pos + 4;
|
|
5414
|
+
var end = start;
|
|
5415
|
+
var k = start;
|
|
5416
|
+
var done = false;
|
|
5417
|
+
while (!done) {
|
|
5418
|
+
var e = extension.indexOf("-", k);
|
|
5419
|
+
var len = void 0;
|
|
5420
|
+
if (e === -1) {
|
|
5421
|
+
len = size - k;
|
|
5422
|
+
} else {
|
|
5423
|
+
len = e - k;
|
|
5424
|
+
}
|
|
5425
|
+
if (len === 2) {
|
|
5426
|
+
done = true;
|
|
5427
|
+
} else if (e === -1) {
|
|
5428
|
+
end = size;
|
|
5429
|
+
done = true;
|
|
5430
|
+
} else {
|
|
5431
|
+
end = e;
|
|
5432
|
+
k = e + 1;
|
|
5433
|
+
}
|
|
5077
5434
|
}
|
|
5078
|
-
return
|
|
5435
|
+
return extension.slice(start, end);
|
|
5079
5436
|
}
|
|
5080
|
-
|
|
5437
|
+
searchValue = "-".concat(key);
|
|
5438
|
+
pos = extension.indexOf(searchValue);
|
|
5439
|
+
if (pos !== -1 && pos + 3 === size) {
|
|
5081
5440
|
return "";
|
|
5441
|
+
}
|
|
5442
|
+
return void 0;
|
|
5082
5443
|
}
|
|
5083
|
-
function
|
|
5084
|
-
var
|
|
5085
|
-
|
|
5086
|
-
|
|
5087
|
-
|
|
5088
|
-
|
|
5089
|
-
|
|
5090
|
-
|
|
5091
|
-
|
|
5092
|
-
|
|
5093
|
-
|
|
5094
|
-
|
|
5095
|
-
var
|
|
5096
|
-
|
|
5097
|
-
|
|
5098
|
-
|
|
5444
|
+
function ResolveLocale(availableLocales, requestedLocales, options, relevantExtensionKeys, localeData, getDefaultLocale) {
|
|
5445
|
+
var matcher = options.localeMatcher;
|
|
5446
|
+
var r;
|
|
5447
|
+
if (matcher === "lookup") {
|
|
5448
|
+
r = LookupMatcher(Array.from(availableLocales), requestedLocales, getDefaultLocale);
|
|
5449
|
+
} else {
|
|
5450
|
+
r = BestFitMatcher(Array.from(availableLocales), requestedLocales, getDefaultLocale);
|
|
5451
|
+
}
|
|
5452
|
+
var foundLocale = r.locale;
|
|
5453
|
+
var result = { locale: "", dataLocale: foundLocale };
|
|
5454
|
+
var supportedExtension = "-u";
|
|
5455
|
+
for (var _i = 0, relevantExtensionKeys_1 = relevantExtensionKeys; _i < relevantExtensionKeys_1.length; _i++) {
|
|
5456
|
+
var key = relevantExtensionKeys_1[_i];
|
|
5457
|
+
invariant(foundLocale in localeData, "Missing locale data for ".concat(foundLocale));
|
|
5458
|
+
var foundLocaleData = localeData[foundLocale];
|
|
5459
|
+
invariant(typeof foundLocaleData === "object" && foundLocaleData !== null, "locale data ".concat(key, " must be an object"));
|
|
5460
|
+
var keyLocaleData = foundLocaleData[key];
|
|
5461
|
+
invariant(Array.isArray(keyLocaleData), "keyLocaleData for ".concat(key, " must be an array"));
|
|
5462
|
+
var value = keyLocaleData[0];
|
|
5463
|
+
invariant(typeof value === "string" || value === null, "value must be string or null but got ".concat(typeof value, " in key ").concat(key));
|
|
5464
|
+
var supportedExtensionAddition = "";
|
|
5465
|
+
if (r.extension) {
|
|
5466
|
+
var requestedValue = UnicodeExtensionValue(r.extension, key);
|
|
5467
|
+
if (requestedValue !== void 0) {
|
|
5468
|
+
if (requestedValue !== "") {
|
|
5469
|
+
if (~keyLocaleData.indexOf(requestedValue)) {
|
|
5470
|
+
value = requestedValue;
|
|
5471
|
+
supportedExtensionAddition = "-".concat(key, "-").concat(value);
|
|
5472
|
+
}
|
|
5473
|
+
} else if (~requestedValue.indexOf("true")) {
|
|
5474
|
+
value = "true";
|
|
5475
|
+
supportedExtensionAddition = "-".concat(key);
|
|
5476
|
+
}
|
|
5477
|
+
}
|
|
5099
5478
|
}
|
|
5100
|
-
if (
|
|
5101
|
-
var
|
|
5102
|
-
|
|
5479
|
+
if (key in options) {
|
|
5480
|
+
var optionsValue = options[key];
|
|
5481
|
+
invariant(typeof optionsValue === "string" || typeof optionsValue === "undefined" || optionsValue === null, "optionsValue must be String, Undefined or Null");
|
|
5482
|
+
if (~keyLocaleData.indexOf(optionsValue)) {
|
|
5483
|
+
if (optionsValue !== value) {
|
|
5484
|
+
value = optionsValue;
|
|
5485
|
+
supportedExtensionAddition = "";
|
|
5486
|
+
}
|
|
5487
|
+
}
|
|
5103
5488
|
}
|
|
5104
|
-
|
|
5489
|
+
result[key] = value;
|
|
5490
|
+
supportedExtension += supportedExtensionAddition;
|
|
5105
5491
|
}
|
|
5106
|
-
if (
|
|
5107
|
-
var
|
|
5108
|
-
if (
|
|
5109
|
-
|
|
5110
|
-
else {
|
|
5111
|
-
var
|
|
5112
|
-
|
|
5492
|
+
if (supportedExtension.length > 2) {
|
|
5493
|
+
var privateIndex = foundLocale.indexOf("-x-");
|
|
5494
|
+
if (privateIndex === -1) {
|
|
5495
|
+
foundLocale = foundLocale + supportedExtension;
|
|
5496
|
+
} else {
|
|
5497
|
+
var preExtension = foundLocale.slice(0, privateIndex);
|
|
5498
|
+
var postExtension = foundLocale.slice(privateIndex, foundLocale.length);
|
|
5499
|
+
foundLocale = preExtension + supportedExtension + postExtension;
|
|
5113
5500
|
}
|
|
5114
|
-
|
|
5501
|
+
foundLocale = Intl.getCanonicalLocales(foundLocale)[0];
|
|
5115
5502
|
}
|
|
5116
|
-
|
|
5503
|
+
result.locale = foundLocale;
|
|
5504
|
+
return result;
|
|
5117
5505
|
}
|
|
5118
|
-
function
|
|
5119
|
-
return
|
|
5506
|
+
function match(requestedLocales, availableLocales, defaultLocale, opts) {
|
|
5507
|
+
return ResolveLocale(availableLocales, CanonicalizeLocaleList(requestedLocales), {
|
|
5120
5508
|
localeMatcher: "best fit"
|
|
5121
5509
|
}, [], {}, function() {
|
|
5122
|
-
return
|
|
5510
|
+
return defaultLocale;
|
|
5123
5511
|
}).locale;
|
|
5124
5512
|
}
|
|
5125
|
-
const
|
|
5126
|
-
function
|
|
5127
|
-
return Object.keys(
|
|
5128
|
-
(
|
|
5129
|
-
const
|
|
5130
|
-
|
|
5513
|
+
const DEFAULT_LOCALE = "en";
|
|
5514
|
+
function flattenMessages(nestedMessages, prefix = "") {
|
|
5515
|
+
return Object.keys(nestedMessages).reduce(
|
|
5516
|
+
(messages2, key) => {
|
|
5517
|
+
const value = nestedMessages[key];
|
|
5518
|
+
const prefixedKey = prefix ? `${prefix}.${key}` : key;
|
|
5519
|
+
if (typeof value === "string") {
|
|
5520
|
+
messages2[prefixedKey] = value;
|
|
5521
|
+
} else {
|
|
5522
|
+
Object.assign(messages2, flattenMessages(value, prefixedKey));
|
|
5523
|
+
}
|
|
5524
|
+
return messages2;
|
|
5131
5525
|
},
|
|
5132
5526
|
{}
|
|
5133
5527
|
);
|
|
5134
5528
|
}
|
|
5135
|
-
function
|
|
5136
|
-
const
|
|
5137
|
-
|
|
5138
|
-
|
|
5139
|
-
|
|
5529
|
+
function findMatchingMessagesLocale(locale, messages2) {
|
|
5530
|
+
const availableLocales = Object.keys(messages2);
|
|
5531
|
+
const matchedLocale = match(
|
|
5532
|
+
[locale],
|
|
5533
|
+
availableLocales,
|
|
5534
|
+
DEFAULT_LOCALE
|
|
5140
5535
|
);
|
|
5141
|
-
return
|
|
5536
|
+
return matchedLocale ? matchedLocale : DEFAULT_LOCALE;
|
|
5142
5537
|
}
|
|
5143
|
-
const
|
|
5144
|
-
|
|
5145
|
-
|
|
5146
|
-
|
|
5147
|
-
|
|
5148
|
-
|
|
5538
|
+
const cache = createIntlCache();
|
|
5539
|
+
const intlInstanceCache = /* @__PURE__ */ new WeakMap();
|
|
5540
|
+
const createIntlInstance = (intlConfig) => {
|
|
5541
|
+
const locale = (intlConfig == null ? void 0 : intlConfig.locale) || DEFAULT_LOCALE;
|
|
5542
|
+
const messagesLocale = findMatchingMessagesLocale(locale, messages);
|
|
5543
|
+
const intMessages = {
|
|
5544
|
+
...messages[messagesLocale] || {},
|
|
5545
|
+
...(intlConfig == null ? void 0 : intlConfig.messages) ?? {}
|
|
5546
|
+
};
|
|
5547
|
+
const combinedMessages = flattenMessages(intMessages);
|
|
5548
|
+
return createIntl(
|
|
5149
5549
|
{
|
|
5150
|
-
locale
|
|
5151
|
-
messages:
|
|
5550
|
+
locale,
|
|
5551
|
+
messages: combinedMessages
|
|
5152
5552
|
},
|
|
5153
|
-
|
|
5553
|
+
cache
|
|
5154
5554
|
);
|
|
5155
|
-
}, Ma = (e) => {
|
|
5156
|
-
const i = we.get(e);
|
|
5157
|
-
if (i)
|
|
5158
|
-
return i;
|
|
5159
|
-
const r = Sa(e);
|
|
5160
|
-
return we.set(e, r), r;
|
|
5161
5555
|
};
|
|
5162
|
-
|
|
5163
|
-
|
|
5556
|
+
const getGloballyCachedIntl = (intlConfig) => {
|
|
5557
|
+
const cachedInstance = intlInstanceCache.get(intlConfig);
|
|
5558
|
+
if (cachedInstance) {
|
|
5559
|
+
return cachedInstance;
|
|
5560
|
+
}
|
|
5561
|
+
const newInstance = createIntlInstance(intlConfig);
|
|
5562
|
+
intlInstanceCache.set(intlConfig, newInstance);
|
|
5563
|
+
return newInstance;
|
|
5564
|
+
};
|
|
5565
|
+
function useImperativeIntl(intlConfig) {
|
|
5566
|
+
return getGloballyCachedIntl(intlConfig);
|
|
5164
5567
|
}
|
|
5165
|
-
const
|
|
5568
|
+
const Root = styled(Box)(({ theme }) => ({
|
|
5166
5569
|
display: "flex",
|
|
5167
|
-
gap:
|
|
5168
|
-
marginLeft:
|
|
5169
|
-
}))
|
|
5570
|
+
gap: theme.spacing(0.5),
|
|
5571
|
+
marginLeft: theme.spacing(1)
|
|
5572
|
+
}));
|
|
5573
|
+
const Button = styled("div")(({ theme }) => ({
|
|
5170
5574
|
"& .MuiIconButton-root:not(.Mui-disabled)": {
|
|
5171
|
-
color:
|
|
5575
|
+
color: theme.palette.text.secondary
|
|
5172
5576
|
}
|
|
5173
5577
|
}));
|
|
5174
|
-
function
|
|
5175
|
-
count
|
|
5176
|
-
page
|
|
5177
|
-
rowsPerPage
|
|
5178
|
-
onPageChange
|
|
5179
|
-
lastPageTooltip
|
|
5578
|
+
function TablePaginationActions({
|
|
5579
|
+
count,
|
|
5580
|
+
page,
|
|
5581
|
+
rowsPerPage = 10,
|
|
5582
|
+
onPageChange,
|
|
5583
|
+
lastPageTooltip
|
|
5180
5584
|
}) {
|
|
5181
|
-
const
|
|
5182
|
-
|
|
5183
|
-
|
|
5184
|
-
|
|
5185
|
-
}
|
|
5585
|
+
const intl = useIntl();
|
|
5586
|
+
const intlConfig = useImperativeIntl(intl);
|
|
5587
|
+
const handleBackButtonClick = (event) => {
|
|
5588
|
+
onPageChange(event, page - 1);
|
|
5589
|
+
};
|
|
5590
|
+
const handleNextButtonClick = (event) => {
|
|
5591
|
+
onPageChange(event, page + 1);
|
|
5592
|
+
};
|
|
5593
|
+
const isLastPage = page === Math.ceil(count / rowsPerPage) - 1;
|
|
5594
|
+
const isFirstPage = page === 0;
|
|
5595
|
+
const prevLabel = intlConfig.formatMessage({
|
|
5186
5596
|
id: "c4r.form.pagination.prevPage"
|
|
5187
|
-
})
|
|
5597
|
+
});
|
|
5598
|
+
const nextLabel = intlConfig.formatMessage({
|
|
5188
5599
|
id: "c4r.form.pagination.nextPage"
|
|
5189
|
-
})
|
|
5600
|
+
});
|
|
5601
|
+
const noMorePagesText = intlConfig.formatMessage({
|
|
5190
5602
|
id: "c4r.form.pagination.noMorePages"
|
|
5191
5603
|
});
|
|
5192
|
-
return /* @__PURE__ */
|
|
5193
|
-
/* @__PURE__ */
|
|
5194
|
-
|
|
5604
|
+
return /* @__PURE__ */ jsxs(Root, { children: [
|
|
5605
|
+
/* @__PURE__ */ jsx(Tooltip, { title: isFirstPage ? noMorePagesText : prevLabel, children: /* @__PURE__ */ jsx(Button, { children: /* @__PURE__ */ jsx(
|
|
5606
|
+
IconButton,
|
|
5195
5607
|
{
|
|
5196
|
-
onClick:
|
|
5197
|
-
disabled:
|
|
5198
|
-
"aria-label":
|
|
5199
|
-
children: /* @__PURE__ */
|
|
5608
|
+
onClick: handleBackButtonClick,
|
|
5609
|
+
disabled: page === 0,
|
|
5610
|
+
"aria-label": prevLabel,
|
|
5611
|
+
children: /* @__PURE__ */ jsx(KeyboardArrowLeftOutlined, {})
|
|
5200
5612
|
}
|
|
5201
5613
|
) }) }),
|
|
5202
|
-
/* @__PURE__ */
|
|
5203
|
-
|
|
5614
|
+
/* @__PURE__ */ jsx(
|
|
5615
|
+
Tooltip,
|
|
5204
5616
|
{
|
|
5205
|
-
title:
|
|
5206
|
-
children: /* @__PURE__ */
|
|
5207
|
-
|
|
5617
|
+
title: isLastPage ? lastPageTooltip ?? noMorePagesText : nextLabel,
|
|
5618
|
+
children: /* @__PURE__ */ jsx(Button, { children: /* @__PURE__ */ jsx(
|
|
5619
|
+
IconButton,
|
|
5208
5620
|
{
|
|
5209
|
-
onClick:
|
|
5210
|
-
disabled:
|
|
5211
|
-
"aria-label":
|
|
5212
|
-
children: /* @__PURE__ */
|
|
5621
|
+
onClick: handleNextButtonClick,
|
|
5622
|
+
disabled: page >= Math.ceil(count / rowsPerPage) - 1,
|
|
5623
|
+
"aria-label": nextLabel.toLocaleLowerCase(),
|
|
5624
|
+
children: /* @__PURE__ */ jsx(KeyboardArrowRightOutlined, {})
|
|
5213
5625
|
}
|
|
5214
5626
|
) })
|
|
5215
5627
|
}
|
|
@@ -5217,16 +5629,16 @@ function xa({
|
|
|
5217
5629
|
] });
|
|
5218
5630
|
}
|
|
5219
5631
|
export {
|
|
5220
|
-
|
|
5221
|
-
|
|
5222
|
-
|
|
5223
|
-
|
|
5224
|
-
|
|
5225
|
-
|
|
5226
|
-
|
|
5227
|
-
|
|
5228
|
-
|
|
5229
|
-
|
|
5230
|
-
|
|
5231
|
-
|
|
5632
|
+
APPBAR_SIZE as A,
|
|
5633
|
+
BREAKPOINTS as B,
|
|
5634
|
+
ICON_SIZE_LARGE as I,
|
|
5635
|
+
NOTIFICATION_DURATION_IN_MS as N,
|
|
5636
|
+
SPACING as S,
|
|
5637
|
+
Typography as T,
|
|
5638
|
+
TablePaginationActions as a,
|
|
5639
|
+
ICON_SIZE_MEDIUM as b,
|
|
5640
|
+
ICON_SIZE_SMALL as c,
|
|
5641
|
+
getDefaultExportFromCjs as d,
|
|
5642
|
+
getSpacing as g,
|
|
5643
|
+
useImperativeIntl as u
|
|
5232
5644
|
};
|