x-ui-design 0.1.60 → 0.1.61

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js CHANGED
@@ -1,14 +1,4 @@
1
- import { useState, useEffect, useMemo } from 'react';
2
-
3
- function _extends() {
4
- return _extends = Object.assign ? Object.assign.bind() : function (n) {
5
- for (var e = 1; e < arguments.length; e++) {
6
- var t = arguments[e];
7
- for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
8
- }
9
- return n;
10
- }, _extends.apply(null, arguments);
11
- }
1
+ import require$$0, { useState, useEffect, useMemo } from 'react';
12
2
 
13
3
  function clsx(...args) {
14
4
  return args.flatMap(arg => {
@@ -61,6 +51,1215 @@ function styleInject(css, ref) {
61
51
  var css_248z = ".style_xUi-button__He3BD {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n font-weight: 400;\n white-space: nowrap;\n vertical-align: middle;\n user-select: none;\n border: 1px solid transparent;\n cursor: pointer;\n transition: all 0.3s ease;\n border-radius: 6px;\n line-height: 1.5715;\n}\n\n.style_xUi-button-content__VHPLX {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n}\n\n.style_xUi-button-icon__KMMw- {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n line-height: 0;\n margin-right: 0.5em;\n}\n\n.style_xUi-button-icon__KMMw-:last-child {\n margin-right: 0;\n margin-left: 0.5em;\n}\n\n.style_xUi-button-spinner__qwvoJ {\n width: 1em;\n height: 1em;\n border: 1px solid transparent;\n border-top-color: var(--xui-text-color);\n border-radius: 50%;\n animation: style_xUi-spin__42i7y 1s linear infinite;\n}\n\n@keyframes style_xUi-spin__42i7y {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n}\n\n.style_xUi-button-size-small__sFKdz {\n padding: 4px 12px;\n font-size: 12px;\n height: 24px;\n}\n\n.style_xUi-button-size-middle__1LAB4 {\n padding: 0 16px;\n font-size: 14px;\n height: 32px;\n}\n\n.style_xUi-button-size-large__kEqUs {\n padding: 8px 20px;\n font-size: 16px;\n height: 40px;\n}\n\n.style_xUi-button-circle__rXsQE {\n padding: 0;\n border-radius: 50%;\n justify-content: center;\n}\n\n.style_xUi-button-circle__rXsQE.style_xUi-button-size-small__sFKdz {\n width: 24px;\n height: 24px;\n}\n\n.style_xUi-button-circle__rXsQE.style_xUi-button-size-large__kEqUs {\n width: 40px;\n height: 40px;\n}\n\n.style_xUi-button-round__bPJ5d {\n border-radius: 9999px;\n}\n\n.style_xUi-button-default__jquWr {\n background-color: #fff;\n border-color: var(--xui-border-color);\n color: rgba(0, 0, 0, 0.85);\n}\n\n.style_xUi-button-default__jquWr:hover {\n border-color: var(--xui-primary-color);\n color: var(--xui-primary-color);\n}\n\n.style_xUi-button-primary__5B32L {\n background-color: var(--xui-primary-color);\n border-color: var(--xui-primary-color);\n color: #fff;\n}\n\n.style_xUi-button-primary__5B32L:hover {\n background-color: var(--xui-primary-color-light);\n border-color: var(--xui-primary-color-light);\n color: #fff;\n}\n\n.style_xUi-button-dashed__eo6t6 {\n border-style: dashed;\n background-color: #fff;\n color: rgba(0, 0, 0, 0.85);\n border-color: var(--xui-border-color);\n}\n\n.style_xUi-button-dashed__eo6t6:hover {\n border-color: var(--xui-primary-color);\n color: var(--xui-primary-color);\n}\n\n.style_xUi-button-text__cdwR2 {\n background-color: transparent;\n border-color: transparent !important;\n color: rgba(0, 0, 0, 0.88);\n}\n\n.style_xUi-button-text__cdwR2:hover {\n color: rgba(0, 0, 0, 0.88);\n border-color: transparent;\n background-color: rgba(0, 0, 0, 0.04);\n}\n\n.style_xUi-button-link__56eDf {\n background-color: transparent;\n border-color: transparent !important;\n color: var(--xui-primary-color);\n}\n\n.style_xUi-button-link__56eDf:hover {\n border-color: transparent;\n color: var(--xui-primary-color-light);\n}\n\n.style_xUi-button-outlined__soRkh {\n background-color: transparent;\n border-color: var(--xui-border-color);\n color: #fff;\n}\n\n.style_xUi-button-filled__TIZ8- {\n background-color: transparent;\n color: var(--xui-text-color);\n border-color: var(--xui-border-color);\n}\n\n.style_xUi-button-danger__VaYGc {\n background-color: transparent;\n border-color: var(--xui-error-color);\n color: var(--xui-error-color);\n}\n\n.style_xUi-button-danger__VaYGc:hover {\n color: var(--xui-error-color-light);\n border-color: var(--xui-error-color-light);\n}\n\n.style_xUi-button-ghost__yuT29 {\n opacity: 0;\n}\n\n.style_xUi-button-ghost__yuT29:hover {\n opacity: 1;\n}\n\n.style_xUi-button-block__Fm2wb {\n display: flex;\n width: 100%;\n}\n\n.style_xUi-button-disabled__lpRBf,\n.style_xUi-button-loading__X1L9j {\n cursor: not-allowed;\n opacity: 0.5;\n color: var(--xui-text-color);\n border-color: var(--xui-border-color);\n background-color: var(--xui-color-disabled);\n pointer-events: none;\n}\n\n.style_xUi-button-loading__X1L9j {\n background-color: transparent\n}";
62
52
  styleInject(css_248z);
63
53
 
54
+ var jsxRuntime = {exports: {}};
55
+
56
+ var reactJsxRuntime_production_min = {};
57
+
58
+ /**
59
+ * @license React
60
+ * react-jsx-runtime.production.min.js
61
+ *
62
+ * Copyright (c) Facebook, Inc. and its affiliates.
63
+ *
64
+ * This source code is licensed under the MIT license found in the
65
+ * LICENSE file in the root directory of this source tree.
66
+ */
67
+ var hasRequiredReactJsxRuntime_production_min;
68
+ function requireReactJsxRuntime_production_min() {
69
+ if (hasRequiredReactJsxRuntime_production_min) return reactJsxRuntime_production_min;
70
+ hasRequiredReactJsxRuntime_production_min = 1;
71
+ var f = require$$0,
72
+ k = Symbol.for("react.element"),
73
+ l = Symbol.for("react.fragment"),
74
+ m = Object.prototype.hasOwnProperty,
75
+ n = f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,
76
+ p = {
77
+ key: !0,
78
+ ref: !0,
79
+ __self: !0,
80
+ __source: !0
81
+ };
82
+ function q(c, a, g) {
83
+ var b,
84
+ d = {},
85
+ e = null,
86
+ h = null;
87
+ void 0 !== g && (e = "" + g);
88
+ void 0 !== a.key && (e = "" + a.key);
89
+ void 0 !== a.ref && (h = a.ref);
90
+ for (b in a) m.call(a, b) && !p.hasOwnProperty(b) && (d[b] = a[b]);
91
+ if (c && c.defaultProps) for (b in a = c.defaultProps, a) void 0 === d[b] && (d[b] = a[b]);
92
+ return {
93
+ $$typeof: k,
94
+ type: c,
95
+ key: e,
96
+ ref: h,
97
+ props: d,
98
+ _owner: n.current
99
+ };
100
+ }
101
+ reactJsxRuntime_production_min.Fragment = l;
102
+ reactJsxRuntime_production_min.jsx = q;
103
+ reactJsxRuntime_production_min.jsxs = q;
104
+ return reactJsxRuntime_production_min;
105
+ }
106
+
107
+ var reactJsxRuntime_development = {};
108
+
109
+ /**
110
+ * @license React
111
+ * react-jsx-runtime.development.js
112
+ *
113
+ * Copyright (c) Facebook, Inc. and its affiliates.
114
+ *
115
+ * This source code is licensed under the MIT license found in the
116
+ * LICENSE file in the root directory of this source tree.
117
+ */
118
+ var hasRequiredReactJsxRuntime_development;
119
+ function requireReactJsxRuntime_development() {
120
+ if (hasRequiredReactJsxRuntime_development) return reactJsxRuntime_development;
121
+ hasRequiredReactJsxRuntime_development = 1;
122
+ if (process.env.NODE_ENV !== "production") {
123
+ (function () {
124
+
125
+ var React = require$$0;
126
+
127
+ // ATTENTION
128
+ // When adding new symbols to this file,
129
+ // Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'
130
+ // The Symbol used to tag the ReactElement-like types.
131
+ var REACT_ELEMENT_TYPE = Symbol.for('react.element');
132
+ var REACT_PORTAL_TYPE = Symbol.for('react.portal');
133
+ var REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');
134
+ var REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');
135
+ var REACT_PROFILER_TYPE = Symbol.for('react.profiler');
136
+ var REACT_PROVIDER_TYPE = Symbol.for('react.provider');
137
+ var REACT_CONTEXT_TYPE = Symbol.for('react.context');
138
+ var REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');
139
+ var REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');
140
+ var REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');
141
+ var REACT_MEMO_TYPE = Symbol.for('react.memo');
142
+ var REACT_LAZY_TYPE = Symbol.for('react.lazy');
143
+ var REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');
144
+ var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
145
+ var FAUX_ITERATOR_SYMBOL = '@@iterator';
146
+ function getIteratorFn(maybeIterable) {
147
+ if (maybeIterable === null || typeof maybeIterable !== 'object') {
148
+ return null;
149
+ }
150
+ var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
151
+ if (typeof maybeIterator === 'function') {
152
+ return maybeIterator;
153
+ }
154
+ return null;
155
+ }
156
+ var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
157
+ function error(format) {
158
+ {
159
+ {
160
+ for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
161
+ args[_key2 - 1] = arguments[_key2];
162
+ }
163
+ printWarning('error', format, args);
164
+ }
165
+ }
166
+ }
167
+ function printWarning(level, format, args) {
168
+ // When changing this logic, you might want to also
169
+ // update consoleWithStackDev.www.js as well.
170
+ {
171
+ var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
172
+ var stack = ReactDebugCurrentFrame.getStackAddendum();
173
+ if (stack !== '') {
174
+ format += '%s';
175
+ args = args.concat([stack]);
176
+ } // eslint-disable-next-line react-internal/safe-string-coercion
177
+
178
+ var argsWithFormat = args.map(function (item) {
179
+ return String(item);
180
+ }); // Careful: RN currently depends on this prefix
181
+
182
+ argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it
183
+ // breaks IE9: https://github.com/facebook/react/issues/13610
184
+ // eslint-disable-next-line react-internal/no-production-logging
185
+
186
+ Function.prototype.apply.call(console[level], console, argsWithFormat);
187
+ }
188
+ }
189
+
190
+ // -----------------------------------------------------------------------------
191
+
192
+ var enableScopeAPI = false; // Experimental Create Event Handle API.
193
+ var enableCacheElement = false;
194
+ var enableTransitionTracing = false; // No known bugs, but needs performance testing
195
+
196
+ var enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber
197
+ // stuff. Intended to enable React core members to more easily debug scheduling
198
+ // issues in DEV builds.
199
+
200
+ var enableDebugTracing = false; // Track which Fiber(s) schedule render work.
201
+
202
+ var REACT_MODULE_REFERENCE;
203
+ {
204
+ REACT_MODULE_REFERENCE = Symbol.for('react.module.reference');
205
+ }
206
+ function isValidElementType(type) {
207
+ if (typeof type === 'string' || typeof type === 'function') {
208
+ return true;
209
+ } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).
210
+
211
+ if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing) {
212
+ return true;
213
+ }
214
+ if (typeof type === 'object' && type !== null) {
215
+ if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE ||
216
+ // This needs to include all possible module reference object
217
+ // types supported by any Flight configuration anywhere since
218
+ // we don't know which Flight build this will end up being used
219
+ // with.
220
+ type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) {
221
+ return true;
222
+ }
223
+ }
224
+ return false;
225
+ }
226
+ function getWrappedName(outerType, innerType, wrapperName) {
227
+ var displayName = outerType.displayName;
228
+ if (displayName) {
229
+ return displayName;
230
+ }
231
+ var functionName = innerType.displayName || innerType.name || '';
232
+ return functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName;
233
+ } // Keep in sync with react-reconciler/getComponentNameFromFiber
234
+
235
+ function getContextName(type) {
236
+ return type.displayName || 'Context';
237
+ } // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead.
238
+
239
+ function getComponentNameFromType(type) {
240
+ if (type == null) {
241
+ // Host root, text node or just invalid type.
242
+ return null;
243
+ }
244
+ {
245
+ if (typeof type.tag === 'number') {
246
+ error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an issue.');
247
+ }
248
+ }
249
+ if (typeof type === 'function') {
250
+ return type.displayName || type.name || null;
251
+ }
252
+ if (typeof type === 'string') {
253
+ return type;
254
+ }
255
+ switch (type) {
256
+ case REACT_FRAGMENT_TYPE:
257
+ return 'Fragment';
258
+ case REACT_PORTAL_TYPE:
259
+ return 'Portal';
260
+ case REACT_PROFILER_TYPE:
261
+ return 'Profiler';
262
+ case REACT_STRICT_MODE_TYPE:
263
+ return 'StrictMode';
264
+ case REACT_SUSPENSE_TYPE:
265
+ return 'Suspense';
266
+ case REACT_SUSPENSE_LIST_TYPE:
267
+ return 'SuspenseList';
268
+ }
269
+ if (typeof type === 'object') {
270
+ switch (type.$$typeof) {
271
+ case REACT_CONTEXT_TYPE:
272
+ var context = type;
273
+ return getContextName(context) + '.Consumer';
274
+ case REACT_PROVIDER_TYPE:
275
+ var provider = type;
276
+ return getContextName(provider._context) + '.Provider';
277
+ case REACT_FORWARD_REF_TYPE:
278
+ return getWrappedName(type, type.render, 'ForwardRef');
279
+ case REACT_MEMO_TYPE:
280
+ var outerName = type.displayName || null;
281
+ if (outerName !== null) {
282
+ return outerName;
283
+ }
284
+ return getComponentNameFromType(type.type) || 'Memo';
285
+ case REACT_LAZY_TYPE:
286
+ {
287
+ var lazyComponent = type;
288
+ var payload = lazyComponent._payload;
289
+ var init = lazyComponent._init;
290
+ try {
291
+ return getComponentNameFromType(init(payload));
292
+ } catch (x) {
293
+ return null;
294
+ }
295
+ }
296
+
297
+ // eslint-disable-next-line no-fallthrough
298
+ }
299
+ }
300
+ return null;
301
+ }
302
+ var assign = Object.assign;
303
+
304
+ // Helpers to patch console.logs to avoid logging during side-effect free
305
+ // replaying on render function. This currently only patches the object
306
+ // lazily which won't cover if the log function was extracted eagerly.
307
+ // We could also eagerly patch the method.
308
+ var disabledDepth = 0;
309
+ var prevLog;
310
+ var prevInfo;
311
+ var prevWarn;
312
+ var prevError;
313
+ var prevGroup;
314
+ var prevGroupCollapsed;
315
+ var prevGroupEnd;
316
+ function disabledLog() {}
317
+ disabledLog.__reactDisabledLog = true;
318
+ function disableLogs() {
319
+ {
320
+ if (disabledDepth === 0) {
321
+ /* eslint-disable react-internal/no-production-logging */
322
+ prevLog = console.log;
323
+ prevInfo = console.info;
324
+ prevWarn = console.warn;
325
+ prevError = console.error;
326
+ prevGroup = console.group;
327
+ prevGroupCollapsed = console.groupCollapsed;
328
+ prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099
329
+
330
+ var props = {
331
+ configurable: true,
332
+ enumerable: true,
333
+ value: disabledLog,
334
+ writable: true
335
+ }; // $FlowFixMe Flow thinks console is immutable.
336
+
337
+ Object.defineProperties(console, {
338
+ info: props,
339
+ log: props,
340
+ warn: props,
341
+ error: props,
342
+ group: props,
343
+ groupCollapsed: props,
344
+ groupEnd: props
345
+ });
346
+ /* eslint-enable react-internal/no-production-logging */
347
+ }
348
+ disabledDepth++;
349
+ }
350
+ }
351
+ function reenableLogs() {
352
+ {
353
+ disabledDepth--;
354
+ if (disabledDepth === 0) {
355
+ /* eslint-disable react-internal/no-production-logging */
356
+ var props = {
357
+ configurable: true,
358
+ enumerable: true,
359
+ writable: true
360
+ }; // $FlowFixMe Flow thinks console is immutable.
361
+
362
+ Object.defineProperties(console, {
363
+ log: assign({}, props, {
364
+ value: prevLog
365
+ }),
366
+ info: assign({}, props, {
367
+ value: prevInfo
368
+ }),
369
+ warn: assign({}, props, {
370
+ value: prevWarn
371
+ }),
372
+ error: assign({}, props, {
373
+ value: prevError
374
+ }),
375
+ group: assign({}, props, {
376
+ value: prevGroup
377
+ }),
378
+ groupCollapsed: assign({}, props, {
379
+ value: prevGroupCollapsed
380
+ }),
381
+ groupEnd: assign({}, props, {
382
+ value: prevGroupEnd
383
+ })
384
+ });
385
+ /* eslint-enable react-internal/no-production-logging */
386
+ }
387
+ if (disabledDepth < 0) {
388
+ error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');
389
+ }
390
+ }
391
+ }
392
+ var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
393
+ var prefix;
394
+ function describeBuiltInComponentFrame(name, source, ownerFn) {
395
+ {
396
+ if (prefix === undefined) {
397
+ // Extract the VM specific prefix used by each line.
398
+ try {
399
+ throw Error();
400
+ } catch (x) {
401
+ var match = x.stack.trim().match(/\n( *(at )?)/);
402
+ prefix = match && match[1] || '';
403
+ }
404
+ } // We use the prefix to ensure our stacks line up with native stack frames.
405
+
406
+ return '\n' + prefix + name;
407
+ }
408
+ }
409
+ var reentry = false;
410
+ var componentFrameCache;
411
+ {
412
+ var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;
413
+ componentFrameCache = new PossiblyWeakMap();
414
+ }
415
+ function describeNativeComponentFrame(fn, construct) {
416
+ // If something asked for a stack inside a fake render, it should get ignored.
417
+ if (!fn || reentry) {
418
+ return '';
419
+ }
420
+ {
421
+ var frame = componentFrameCache.get(fn);
422
+ if (frame !== undefined) {
423
+ return frame;
424
+ }
425
+ }
426
+ var control;
427
+ reentry = true;
428
+ var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined.
429
+
430
+ Error.prepareStackTrace = undefined;
431
+ var previousDispatcher;
432
+ {
433
+ previousDispatcher = ReactCurrentDispatcher.current; // Set the dispatcher in DEV because this might be call in the render function
434
+ // for warnings.
435
+
436
+ ReactCurrentDispatcher.current = null;
437
+ disableLogs();
438
+ }
439
+ try {
440
+ // This should throw.
441
+ if (construct) {
442
+ // Something should be setting the props in the constructor.
443
+ var Fake = function () {
444
+ throw Error();
445
+ }; // $FlowFixMe
446
+
447
+ Object.defineProperty(Fake.prototype, 'props', {
448
+ set: function () {
449
+ // We use a throwing setter instead of frozen or non-writable props
450
+ // because that won't throw in a non-strict mode function.
451
+ throw Error();
452
+ }
453
+ });
454
+ if (typeof Reflect === 'object' && Reflect.construct) {
455
+ // We construct a different control for this case to include any extra
456
+ // frames added by the construct call.
457
+ try {
458
+ Reflect.construct(Fake, []);
459
+ } catch (x) {
460
+ control = x;
461
+ }
462
+ Reflect.construct(fn, [], Fake);
463
+ } else {
464
+ try {
465
+ Fake.call();
466
+ } catch (x) {
467
+ control = x;
468
+ }
469
+ fn.call(Fake.prototype);
470
+ }
471
+ } else {
472
+ try {
473
+ throw Error();
474
+ } catch (x) {
475
+ control = x;
476
+ }
477
+ fn();
478
+ }
479
+ } catch (sample) {
480
+ // This is inlined manually because closure doesn't do it for us.
481
+ if (sample && control && typeof sample.stack === 'string') {
482
+ // This extracts the first frame from the sample that isn't also in the control.
483
+ // Skipping one frame that we assume is the frame that calls the two.
484
+ var sampleLines = sample.stack.split('\n');
485
+ var controlLines = control.stack.split('\n');
486
+ var s = sampleLines.length - 1;
487
+ var c = controlLines.length - 1;
488
+ while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {
489
+ // We expect at least one stack frame to be shared.
490
+ // Typically this will be the root most one. However, stack frames may be
491
+ // cut off due to maximum stack limits. In this case, one maybe cut off
492
+ // earlier than the other. We assume that the sample is longer or the same
493
+ // and there for cut off earlier. So we should find the root most frame in
494
+ // the sample somewhere in the control.
495
+ c--;
496
+ }
497
+ for (; s >= 1 && c >= 0; s--, c--) {
498
+ // Next we find the first one that isn't the same which should be the
499
+ // frame that called our sample function and the control.
500
+ if (sampleLines[s] !== controlLines[c]) {
501
+ // In V8, the first line is describing the message but other VMs don't.
502
+ // If we're about to return the first line, and the control is also on the same
503
+ // line, that's a pretty good indicator that our sample threw at same line as
504
+ // the control. I.e. before we entered the sample frame. So we ignore this result.
505
+ // This can happen if you passed a class to function component, or non-function.
506
+ if (s !== 1 || c !== 1) {
507
+ do {
508
+ s--;
509
+ c--; // We may still have similar intermediate frames from the construct call.
510
+ // The next one that isn't the same should be our match though.
511
+
512
+ if (c < 0 || sampleLines[s] !== controlLines[c]) {
513
+ // V8 adds a "new" prefix for native classes. Let's remove it to make it prettier.
514
+ var _frame = '\n' + sampleLines[s].replace(' at new ', ' at '); // If our component frame is labeled "<anonymous>"
515
+ // but we have a user-provided "displayName"
516
+ // splice it in to make the stack more readable.
517
+
518
+ if (fn.displayName && _frame.includes('<anonymous>')) {
519
+ _frame = _frame.replace('<anonymous>', fn.displayName);
520
+ }
521
+ {
522
+ if (typeof fn === 'function') {
523
+ componentFrameCache.set(fn, _frame);
524
+ }
525
+ } // Return the line we found.
526
+
527
+ return _frame;
528
+ }
529
+ } while (s >= 1 && c >= 0);
530
+ }
531
+ break;
532
+ }
533
+ }
534
+ }
535
+ } finally {
536
+ reentry = false;
537
+ {
538
+ ReactCurrentDispatcher.current = previousDispatcher;
539
+ reenableLogs();
540
+ }
541
+ Error.prepareStackTrace = previousPrepareStackTrace;
542
+ } // Fallback to just using the name if we couldn't make it throw.
543
+
544
+ var name = fn ? fn.displayName || fn.name : '';
545
+ var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';
546
+ {
547
+ if (typeof fn === 'function') {
548
+ componentFrameCache.set(fn, syntheticFrame);
549
+ }
550
+ }
551
+ return syntheticFrame;
552
+ }
553
+ function describeFunctionComponentFrame(fn, source, ownerFn) {
554
+ {
555
+ return describeNativeComponentFrame(fn, false);
556
+ }
557
+ }
558
+ function shouldConstruct(Component) {
559
+ var prototype = Component.prototype;
560
+ return !!(prototype && prototype.isReactComponent);
561
+ }
562
+ function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {
563
+ if (type == null) {
564
+ return '';
565
+ }
566
+ if (typeof type === 'function') {
567
+ {
568
+ return describeNativeComponentFrame(type, shouldConstruct(type));
569
+ }
570
+ }
571
+ if (typeof type === 'string') {
572
+ return describeBuiltInComponentFrame(type);
573
+ }
574
+ switch (type) {
575
+ case REACT_SUSPENSE_TYPE:
576
+ return describeBuiltInComponentFrame('Suspense');
577
+ case REACT_SUSPENSE_LIST_TYPE:
578
+ return describeBuiltInComponentFrame('SuspenseList');
579
+ }
580
+ if (typeof type === 'object') {
581
+ switch (type.$$typeof) {
582
+ case REACT_FORWARD_REF_TYPE:
583
+ return describeFunctionComponentFrame(type.render);
584
+ case REACT_MEMO_TYPE:
585
+ // Memo may contain any component type so we recursively resolve it.
586
+ return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);
587
+ case REACT_LAZY_TYPE:
588
+ {
589
+ var lazyComponent = type;
590
+ var payload = lazyComponent._payload;
591
+ var init = lazyComponent._init;
592
+ try {
593
+ // Lazy may contain any component type so we recursively resolve it.
594
+ return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
595
+ } catch (x) {}
596
+ }
597
+ }
598
+ }
599
+ return '';
600
+ }
601
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
602
+ var loggedTypeFailures = {};
603
+ var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
604
+ function setCurrentlyValidatingElement(element) {
605
+ {
606
+ if (element) {
607
+ var owner = element._owner;
608
+ var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
609
+ ReactDebugCurrentFrame.setExtraStackFrame(stack);
610
+ } else {
611
+ ReactDebugCurrentFrame.setExtraStackFrame(null);
612
+ }
613
+ }
614
+ }
615
+ function checkPropTypes(typeSpecs, values, location, componentName, element) {
616
+ {
617
+ // $FlowFixMe This is okay but Flow doesn't know it.
618
+ var has = Function.call.bind(hasOwnProperty);
619
+ for (var typeSpecName in typeSpecs) {
620
+ if (has(typeSpecs, typeSpecName)) {
621
+ var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to
622
+ // fail the render phase where it didn't fail before. So we log it.
623
+ // After these have been cleaned up, we'll let them throw.
624
+
625
+ try {
626
+ // This is intentionally an invariant that gets caught. It's the same
627
+ // behavior as without this statement except with a better message.
628
+ if (typeof typeSpecs[typeSpecName] !== 'function') {
629
+ // eslint-disable-next-line react-internal/prod-error-codes
630
+ var err = Error((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`.');
631
+ err.name = 'Invariant Violation';
632
+ throw err;
633
+ }
634
+ error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');
635
+ } catch (ex) {
636
+ error$1 = ex;
637
+ }
638
+ if (error$1 && !(error$1 instanceof Error)) {
639
+ setCurrentlyValidatingElement(element);
640
+ error('%s: type specification of %s' + ' `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error$1);
641
+ setCurrentlyValidatingElement(null);
642
+ }
643
+ if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
644
+ // Only monitor this failure once because there tends to be a lot of the
645
+ // same error.
646
+ loggedTypeFailures[error$1.message] = true;
647
+ setCurrentlyValidatingElement(element);
648
+ error('Failed %s type: %s', location, error$1.message);
649
+ setCurrentlyValidatingElement(null);
650
+ }
651
+ }
652
+ }
653
+ }
654
+ }
655
+ var isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare
656
+
657
+ function isArray(a) {
658
+ return isArrayImpl(a);
659
+ }
660
+
661
+ /*
662
+ * The `'' + value` pattern (used in in perf-sensitive code) throws for Symbol
663
+ * and Temporal.* types. See https://github.com/facebook/react/pull/22064.
664
+ *
665
+ * The functions in this module will throw an easier-to-understand,
666
+ * easier-to-debug exception with a clear errors message message explaining the
667
+ * problem. (Instead of a confusing exception thrown inside the implementation
668
+ * of the `value` object).
669
+ */
670
+ // $FlowFixMe only called in DEV, so void return is not possible.
671
+ function typeName(value) {
672
+ {
673
+ // toStringTag is needed for namespaced types like Temporal.Instant
674
+ var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag;
675
+ var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object';
676
+ return type;
677
+ }
678
+ } // $FlowFixMe only called in DEV, so void return is not possible.
679
+
680
+ function willCoercionThrow(value) {
681
+ {
682
+ try {
683
+ testStringCoercion(value);
684
+ return false;
685
+ } catch (e) {
686
+ return true;
687
+ }
688
+ }
689
+ }
690
+ function testStringCoercion(value) {
691
+ // If you ended up here by following an exception call stack, here's what's
692
+ // happened: you supplied an object or symbol value to React (as a prop, key,
693
+ // DOM attribute, CSS property, string ref, etc.) and when React tried to
694
+ // coerce it to a string using `'' + value`, an exception was thrown.
695
+ //
696
+ // The most common types that will cause this exception are `Symbol` instances
697
+ // and Temporal objects like `Temporal.Instant`. But any object that has a
698
+ // `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this
699
+ // exception. (Library authors do this to prevent users from using built-in
700
+ // numeric operators like `+` or comparison operators like `>=` because custom
701
+ // methods are needed to perform accurate arithmetic or comparison.)
702
+ //
703
+ // To fix the problem, coerce this object or symbol value to a string before
704
+ // passing it to React. The most reliable way is usually `String(value)`.
705
+ //
706
+ // To find which value is throwing, check the browser or debugger console.
707
+ // Before this exception was thrown, there should be `console.error` output
708
+ // that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the
709
+ // problem and how that type was used: key, atrribute, input value prop, etc.
710
+ // In most cases, this console output also shows the component and its
711
+ // ancestor components where the exception happened.
712
+ //
713
+ // eslint-disable-next-line react-internal/safe-string-coercion
714
+ return '' + value;
715
+ }
716
+ function checkKeyStringCoercion(value) {
717
+ {
718
+ if (willCoercionThrow(value)) {
719
+ error('The provided key is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', typeName(value));
720
+ return testStringCoercion(value); // throw (to help callers find troubleshooting comments)
721
+ }
722
+ }
723
+ }
724
+ var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
725
+ var RESERVED_PROPS = {
726
+ key: true,
727
+ ref: true,
728
+ __self: true,
729
+ __source: true
730
+ };
731
+ var specialPropKeyWarningShown;
732
+ var specialPropRefWarningShown;
733
+ var didWarnAboutStringRefs;
734
+ {
735
+ didWarnAboutStringRefs = {};
736
+ }
737
+ function hasValidRef(config) {
738
+ {
739
+ if (hasOwnProperty.call(config, 'ref')) {
740
+ var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;
741
+ if (getter && getter.isReactWarning) {
742
+ return false;
743
+ }
744
+ }
745
+ }
746
+ return config.ref !== undefined;
747
+ }
748
+ function hasValidKey(config) {
749
+ {
750
+ if (hasOwnProperty.call(config, 'key')) {
751
+ var getter = Object.getOwnPropertyDescriptor(config, 'key').get;
752
+ if (getter && getter.isReactWarning) {
753
+ return false;
754
+ }
755
+ }
756
+ }
757
+ return config.key !== undefined;
758
+ }
759
+ function warnIfStringRefCannotBeAutoConverted(config, self) {
760
+ {
761
+ if (typeof config.ref === 'string' && ReactCurrentOwner.current && self && ReactCurrentOwner.current.stateNode !== self) {
762
+ var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);
763
+ if (!didWarnAboutStringRefs[componentName]) {
764
+ error('Component "%s" contains the string ref "%s". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref', getComponentNameFromType(ReactCurrentOwner.current.type), config.ref);
765
+ didWarnAboutStringRefs[componentName] = true;
766
+ }
767
+ }
768
+ }
769
+ }
770
+ function defineKeyPropWarningGetter(props, displayName) {
771
+ {
772
+ var warnAboutAccessingKey = function () {
773
+ if (!specialPropKeyWarningShown) {
774
+ specialPropKeyWarningShown = true;
775
+ error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);
776
+ }
777
+ };
778
+ warnAboutAccessingKey.isReactWarning = true;
779
+ Object.defineProperty(props, 'key', {
780
+ get: warnAboutAccessingKey,
781
+ configurable: true
782
+ });
783
+ }
784
+ }
785
+ function defineRefPropWarningGetter(props, displayName) {
786
+ {
787
+ var warnAboutAccessingRef = function () {
788
+ if (!specialPropRefWarningShown) {
789
+ specialPropRefWarningShown = true;
790
+ error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);
791
+ }
792
+ };
793
+ warnAboutAccessingRef.isReactWarning = true;
794
+ Object.defineProperty(props, 'ref', {
795
+ get: warnAboutAccessingRef,
796
+ configurable: true
797
+ });
798
+ }
799
+ }
800
+ /**
801
+ * Factory method to create a new React element. This no longer adheres to
802
+ * the class pattern, so do not use new to call it. Also, instanceof check
803
+ * will not work. Instead test $$typeof field against Symbol.for('react.element') to check
804
+ * if something is a React Element.
805
+ *
806
+ * @param {*} type
807
+ * @param {*} props
808
+ * @param {*} key
809
+ * @param {string|object} ref
810
+ * @param {*} owner
811
+ * @param {*} self A *temporary* helper to detect places where `this` is
812
+ * different from the `owner` when React.createElement is called, so that we
813
+ * can warn. We want to get rid of owner and replace string `ref`s with arrow
814
+ * functions, and as long as `this` and owner are the same, there will be no
815
+ * change in behavior.
816
+ * @param {*} source An annotation object (added by a transpiler or otherwise)
817
+ * indicating filename, line number, and/or other information.
818
+ * @internal
819
+ */
820
+
821
+ var ReactElement = function (type, key, ref, self, source, owner, props) {
822
+ var element = {
823
+ // This tag allows us to uniquely identify this as a React Element
824
+ $$typeof: REACT_ELEMENT_TYPE,
825
+ // Built-in properties that belong on the element
826
+ type: type,
827
+ key: key,
828
+ ref: ref,
829
+ props: props,
830
+ // Record the component responsible for creating this element.
831
+ _owner: owner
832
+ };
833
+ {
834
+ // The validation flag is currently mutative. We put it on
835
+ // an external backing store so that we can freeze the whole object.
836
+ // This can be replaced with a WeakMap once they are implemented in
837
+ // commonly used development environments.
838
+ element._store = {}; // To make comparing ReactElements easier for testing purposes, we make
839
+ // the validation flag non-enumerable (where possible, which should
840
+ // include every environment we run tests in), so the test framework
841
+ // ignores it.
842
+
843
+ Object.defineProperty(element._store, 'validated', {
844
+ configurable: false,
845
+ enumerable: false,
846
+ writable: true,
847
+ value: false
848
+ }); // self and source are DEV only properties.
849
+
850
+ Object.defineProperty(element, '_self', {
851
+ configurable: false,
852
+ enumerable: false,
853
+ writable: false,
854
+ value: self
855
+ }); // Two elements created in two different places should be considered
856
+ // equal for testing purposes and therefore we hide it from enumeration.
857
+
858
+ Object.defineProperty(element, '_source', {
859
+ configurable: false,
860
+ enumerable: false,
861
+ writable: false,
862
+ value: source
863
+ });
864
+ if (Object.freeze) {
865
+ Object.freeze(element.props);
866
+ Object.freeze(element);
867
+ }
868
+ }
869
+ return element;
870
+ };
871
+ /**
872
+ * https://github.com/reactjs/rfcs/pull/107
873
+ * @param {*} type
874
+ * @param {object} props
875
+ * @param {string} key
876
+ */
877
+
878
+ function jsxDEV(type, config, maybeKey, source, self) {
879
+ {
880
+ var propName; // Reserved names are extracted
881
+
882
+ var props = {};
883
+ var key = null;
884
+ var ref = null; // Currently, key can be spread in as a prop. This causes a potential
885
+ // issue if key is also explicitly declared (ie. <div {...props} key="Hi" />
886
+ // or <div key="Hi" {...props} /> ). We want to deprecate key spread,
887
+ // but as an intermediary step, we will use jsxDEV for everything except
888
+ // <div {...props} key="Hi" />, because we aren't currently able to tell if
889
+ // key is explicitly declared to be undefined or not.
890
+
891
+ if (maybeKey !== undefined) {
892
+ {
893
+ checkKeyStringCoercion(maybeKey);
894
+ }
895
+ key = '' + maybeKey;
896
+ }
897
+ if (hasValidKey(config)) {
898
+ {
899
+ checkKeyStringCoercion(config.key);
900
+ }
901
+ key = '' + config.key;
902
+ }
903
+ if (hasValidRef(config)) {
904
+ ref = config.ref;
905
+ warnIfStringRefCannotBeAutoConverted(config, self);
906
+ } // Remaining properties are added to a new props object
907
+
908
+ for (propName in config) {
909
+ if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
910
+ props[propName] = config[propName];
911
+ }
912
+ } // Resolve default props
913
+
914
+ if (type && type.defaultProps) {
915
+ var defaultProps = type.defaultProps;
916
+ for (propName in defaultProps) {
917
+ if (props[propName] === undefined) {
918
+ props[propName] = defaultProps[propName];
919
+ }
920
+ }
921
+ }
922
+ if (key || ref) {
923
+ var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;
924
+ if (key) {
925
+ defineKeyPropWarningGetter(props, displayName);
926
+ }
927
+ if (ref) {
928
+ defineRefPropWarningGetter(props, displayName);
929
+ }
930
+ }
931
+ return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
932
+ }
933
+ }
934
+ var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;
935
+ var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
936
+ function setCurrentlyValidatingElement$1(element) {
937
+ {
938
+ if (element) {
939
+ var owner = element._owner;
940
+ var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
941
+ ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
942
+ } else {
943
+ ReactDebugCurrentFrame$1.setExtraStackFrame(null);
944
+ }
945
+ }
946
+ }
947
+ var propTypesMisspellWarningShown;
948
+ {
949
+ propTypesMisspellWarningShown = false;
950
+ }
951
+ /**
952
+ * Verifies the object is a ReactElement.
953
+ * See https://reactjs.org/docs/react-api.html#isvalidelement
954
+ * @param {?object} object
955
+ * @return {boolean} True if `object` is a ReactElement.
956
+ * @final
957
+ */
958
+
959
+ function isValidElement(object) {
960
+ {
961
+ return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
962
+ }
963
+ }
964
+ function getDeclarationErrorAddendum() {
965
+ {
966
+ if (ReactCurrentOwner$1.current) {
967
+ var name = getComponentNameFromType(ReactCurrentOwner$1.current.type);
968
+ if (name) {
969
+ return '\n\nCheck the render method of `' + name + '`.';
970
+ }
971
+ }
972
+ return '';
973
+ }
974
+ }
975
+ function getSourceInfoErrorAddendum(source) {
976
+ {
977
+ if (source !== undefined) {
978
+ var fileName = source.fileName.replace(/^.*[\\\/]/, '');
979
+ var lineNumber = source.lineNumber;
980
+ return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.';
981
+ }
982
+ return '';
983
+ }
984
+ }
985
+ /**
986
+ * Warn if there's no key explicitly set on dynamic arrays of children or
987
+ * object keys are not valid. This allows us to keep track of children between
988
+ * updates.
989
+ */
990
+
991
+ var ownerHasKeyUseWarning = {};
992
+ function getCurrentComponentErrorInfo(parentType) {
993
+ {
994
+ var info = getDeclarationErrorAddendum();
995
+ if (!info) {
996
+ var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;
997
+ if (parentName) {
998
+ info = "\n\nCheck the top-level render call using <" + parentName + ">.";
999
+ }
1000
+ }
1001
+ return info;
1002
+ }
1003
+ }
1004
+ /**
1005
+ * Warn if the element doesn't have an explicit key assigned to it.
1006
+ * This element is in an array. The array could grow and shrink or be
1007
+ * reordered. All children that haven't already been validated are required to
1008
+ * have a "key" property assigned to it. Error statuses are cached so a warning
1009
+ * will only be shown once.
1010
+ *
1011
+ * @internal
1012
+ * @param {ReactElement} element Element that requires a key.
1013
+ * @param {*} parentType element's parent's type.
1014
+ */
1015
+
1016
+ function validateExplicitKey(element, parentType) {
1017
+ {
1018
+ if (!element._store || element._store.validated || element.key != null) {
1019
+ return;
1020
+ }
1021
+ element._store.validated = true;
1022
+ var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
1023
+ if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
1024
+ return;
1025
+ }
1026
+ ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a
1027
+ // property, it may be the creator of the child that's responsible for
1028
+ // assigning it a key.
1029
+
1030
+ var childOwner = '';
1031
+ if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) {
1032
+ // Give the component that originally created this child.
1033
+ childOwner = " It was passed a child from " + getComponentNameFromType(element._owner.type) + ".";
1034
+ }
1035
+ setCurrentlyValidatingElement$1(element);
1036
+ error('Each child in a list should have a unique "key" prop.' + '%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);
1037
+ setCurrentlyValidatingElement$1(null);
1038
+ }
1039
+ }
1040
+ /**
1041
+ * Ensure that every element either is passed in a static location, in an
1042
+ * array with an explicit keys property defined, or in an object literal
1043
+ * with valid key property.
1044
+ *
1045
+ * @internal
1046
+ * @param {ReactNode} node Statically passed child of any type.
1047
+ * @param {*} parentType node's parent's type.
1048
+ */
1049
+
1050
+ function validateChildKeys(node, parentType) {
1051
+ {
1052
+ if (typeof node !== 'object') {
1053
+ return;
1054
+ }
1055
+ if (isArray(node)) {
1056
+ for (var i = 0; i < node.length; i++) {
1057
+ var child = node[i];
1058
+ if (isValidElement(child)) {
1059
+ validateExplicitKey(child, parentType);
1060
+ }
1061
+ }
1062
+ } else if (isValidElement(node)) {
1063
+ // This element was passed in a valid location.
1064
+ if (node._store) {
1065
+ node._store.validated = true;
1066
+ }
1067
+ } else if (node) {
1068
+ var iteratorFn = getIteratorFn(node);
1069
+ if (typeof iteratorFn === 'function') {
1070
+ // Entry iterators used to provide implicit keys,
1071
+ // but now we print a separate warning for them later.
1072
+ if (iteratorFn !== node.entries) {
1073
+ var iterator = iteratorFn.call(node);
1074
+ var step;
1075
+ while (!(step = iterator.next()).done) {
1076
+ if (isValidElement(step.value)) {
1077
+ validateExplicitKey(step.value, parentType);
1078
+ }
1079
+ }
1080
+ }
1081
+ }
1082
+ }
1083
+ }
1084
+ }
1085
+ /**
1086
+ * Given an element, validate that its props follow the propTypes definition,
1087
+ * provided by the type.
1088
+ *
1089
+ * @param {ReactElement} element
1090
+ */
1091
+
1092
+ function validatePropTypes(element) {
1093
+ {
1094
+ var type = element.type;
1095
+ if (type === null || type === undefined || typeof type === 'string') {
1096
+ return;
1097
+ }
1098
+ var propTypes;
1099
+ if (typeof type === 'function') {
1100
+ propTypes = type.propTypes;
1101
+ } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE ||
1102
+ // Note: Memo only checks outer props here.
1103
+ // Inner props are checked in the reconciler.
1104
+ type.$$typeof === REACT_MEMO_TYPE)) {
1105
+ propTypes = type.propTypes;
1106
+ } else {
1107
+ return;
1108
+ }
1109
+ if (propTypes) {
1110
+ // Intentionally inside to avoid triggering lazy initializers:
1111
+ var name = getComponentNameFromType(type);
1112
+ checkPropTypes(propTypes, element.props, 'prop', name, element);
1113
+ } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {
1114
+ propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers:
1115
+
1116
+ var _name = getComponentNameFromType(type);
1117
+ error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown');
1118
+ }
1119
+ if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {
1120
+ error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');
1121
+ }
1122
+ }
1123
+ }
1124
+ /**
1125
+ * Given a fragment, validate that it can only be provided with fragment props
1126
+ * @param {ReactElement} fragment
1127
+ */
1128
+
1129
+ function validateFragmentProps(fragment) {
1130
+ {
1131
+ var keys = Object.keys(fragment.props);
1132
+ for (var i = 0; i < keys.length; i++) {
1133
+ var key = keys[i];
1134
+ if (key !== 'children' && key !== 'key') {
1135
+ setCurrentlyValidatingElement$1(fragment);
1136
+ error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);
1137
+ setCurrentlyValidatingElement$1(null);
1138
+ break;
1139
+ }
1140
+ }
1141
+ if (fragment.ref !== null) {
1142
+ setCurrentlyValidatingElement$1(fragment);
1143
+ error('Invalid attribute `ref` supplied to `React.Fragment`.');
1144
+ setCurrentlyValidatingElement$1(null);
1145
+ }
1146
+ }
1147
+ }
1148
+ var didWarnAboutKeySpread = {};
1149
+ function jsxWithValidation(type, props, key, isStaticChildren, source, self) {
1150
+ {
1151
+ var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to
1152
+ // succeed and there will likely be errors in render.
1153
+
1154
+ if (!validType) {
1155
+ var info = '';
1156
+ if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
1157
+ info += ' You likely forgot to export your component from the file ' + "it's defined in, or you might have mixed up default and named imports.";
1158
+ }
1159
+ var sourceInfo = getSourceInfoErrorAddendum(source);
1160
+ if (sourceInfo) {
1161
+ info += sourceInfo;
1162
+ } else {
1163
+ info += getDeclarationErrorAddendum();
1164
+ }
1165
+ var typeString;
1166
+ if (type === null) {
1167
+ typeString = 'null';
1168
+ } else if (isArray(type)) {
1169
+ typeString = 'array';
1170
+ } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {
1171
+ typeString = "<" + (getComponentNameFromType(type.type) || 'Unknown') + " />";
1172
+ info = ' Did you accidentally export a JSX literal instead of a component?';
1173
+ } else {
1174
+ typeString = typeof type;
1175
+ }
1176
+ error('React.jsx: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);
1177
+ }
1178
+ var element = jsxDEV(type, props, key, source, self); // The result can be nullish if a mock or a custom function is used.
1179
+ // TODO: Drop this when these are no longer allowed as the type argument.
1180
+
1181
+ if (element == null) {
1182
+ return element;
1183
+ } // Skip key warning if the type isn't valid since our key validation logic
1184
+ // doesn't expect a non-string/function type and can throw confusing errors.
1185
+ // We don't want exception behavior to differ between dev and prod.
1186
+ // (Rendering will throw with a helpful message and as soon as the type is
1187
+ // fixed, the key warnings will appear.)
1188
+
1189
+ if (validType) {
1190
+ var children = props.children;
1191
+ if (children !== undefined) {
1192
+ if (isStaticChildren) {
1193
+ if (isArray(children)) {
1194
+ for (var i = 0; i < children.length; i++) {
1195
+ validateChildKeys(children[i], type);
1196
+ }
1197
+ if (Object.freeze) {
1198
+ Object.freeze(children);
1199
+ }
1200
+ } else {
1201
+ error('React.jsx: Static children should always be an array. ' + 'You are likely explicitly calling React.jsxs or React.jsxDEV. ' + 'Use the Babel transform instead.');
1202
+ }
1203
+ } else {
1204
+ validateChildKeys(children, type);
1205
+ }
1206
+ }
1207
+ }
1208
+ {
1209
+ if (hasOwnProperty.call(props, 'key')) {
1210
+ var componentName = getComponentNameFromType(type);
1211
+ var keys = Object.keys(props).filter(function (k) {
1212
+ return k !== 'key';
1213
+ });
1214
+ var beforeExample = keys.length > 0 ? '{key: someKey, ' + keys.join(': ..., ') + ': ...}' : '{key: someKey}';
1215
+ if (!didWarnAboutKeySpread[componentName + beforeExample]) {
1216
+ var afterExample = keys.length > 0 ? '{' + keys.join(': ..., ') + ': ...}' : '{}';
1217
+ error('A props object containing a "key" prop is being spread into JSX:\n' + ' let props = %s;\n' + ' <%s {...props} />\n' + 'React keys must be passed directly to JSX without using spread:\n' + ' let props = %s;\n' + ' <%s key={someKey} {...props} />', beforeExample, componentName, afterExample, componentName);
1218
+ didWarnAboutKeySpread[componentName + beforeExample] = true;
1219
+ }
1220
+ }
1221
+ }
1222
+ if (type === REACT_FRAGMENT_TYPE) {
1223
+ validateFragmentProps(element);
1224
+ } else {
1225
+ validatePropTypes(element);
1226
+ }
1227
+ return element;
1228
+ }
1229
+ } // These two functions exist to still get child warnings in dev
1230
+ // even with the prod transform. This means that jsxDEV is purely
1231
+ // opt-in behavior for better messages but that we won't stop
1232
+ // giving you warnings if you use production apis.
1233
+
1234
+ function jsxWithValidationStatic(type, props, key) {
1235
+ {
1236
+ return jsxWithValidation(type, props, key, true);
1237
+ }
1238
+ }
1239
+ function jsxWithValidationDynamic(type, props, key) {
1240
+ {
1241
+ return jsxWithValidation(type, props, key, false);
1242
+ }
1243
+ }
1244
+ var jsx = jsxWithValidationDynamic; // we may want to special case jsxs internally to take advantage of static children.
1245
+ // for now we can ship identical prod functions
1246
+
1247
+ var jsxs = jsxWithValidationStatic;
1248
+ reactJsxRuntime_development.Fragment = REACT_FRAGMENT_TYPE;
1249
+ reactJsxRuntime_development.jsx = jsx;
1250
+ reactJsxRuntime_development.jsxs = jsxs;
1251
+ })();
1252
+ }
1253
+ return reactJsxRuntime_development;
1254
+ }
1255
+
1256
+ if (process.env.NODE_ENV === 'production') {
1257
+ jsxRuntime.exports = requireReactJsxRuntime_production_min();
1258
+ } else {
1259
+ jsxRuntime.exports = requireReactJsxRuntime_development();
1260
+ }
1261
+ var jsxRuntimeExports = jsxRuntime.exports;
1262
+
64
1263
  const ButtonComponent = ({
65
1264
  type = 'default',
66
1265
  variant = 'solid',
@@ -103,34 +1302,42 @@ const ButtonComponent = ({
103
1302
  [`${prefixCls}-disabled`]: disabled
104
1303
  }, className);
105
1304
  const iconNode = useMemo(() => {
106
- return innerLoading ? typeof loading === 'object' && loading.icon || /*#__PURE__*/React.createElement("span", {
1305
+ return innerLoading ? typeof loading === 'object' && loading.icon || /*#__PURE__*/jsxRuntimeExports.jsx("span", {
107
1306
  className: `${prefixCls}-spinner`
108
1307
  }) : icon;
109
1308
  }, [icon, innerLoading, loading, prefixCls]);
110
1309
  const content = useMemo(() => {
111
- return /*#__PURE__*/React.createElement(React.Fragment, null, iconNode && iconPosition === 'start' && /*#__PURE__*/React.createElement("span", {
112
- className: clsx(`${prefixCls}-icon`, customClassNames.icon),
113
- style: styles.icon
114
- }, iconNode), /*#__PURE__*/React.createElement("span", {
115
- className: `${prefixCls}-content`
116
- }, children), iconNode && iconPosition === 'end' && /*#__PURE__*/React.createElement("span", {
117
- className: clsx(`${prefixCls}-icon`, customClassNames.icon),
118
- style: styles.icon
119
- }, iconNode));
1310
+ return /*#__PURE__*/jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, {
1311
+ children: [iconNode && iconPosition === 'start' && /*#__PURE__*/jsxRuntimeExports.jsx("span", {
1312
+ className: clsx(`${prefixCls}-icon`, customClassNames.icon),
1313
+ style: styles.icon,
1314
+ children: iconNode
1315
+ }), /*#__PURE__*/jsxRuntimeExports.jsx("span", {
1316
+ className: `${prefixCls}-content`,
1317
+ children: children
1318
+ }), iconNode && iconPosition === 'end' && /*#__PURE__*/jsxRuntimeExports.jsx("span", {
1319
+ className: clsx(`${prefixCls}-icon`, customClassNames.icon),
1320
+ style: styles.icon,
1321
+ children: iconNode
1322
+ })]
1323
+ });
120
1324
  }, [children, customClassNames.icon, iconNode, iconPosition, prefixCls, styles.icon]);
121
1325
  const mergedDisabled = disabled || innerLoading;
122
1326
  if (href) {
123
- return /*#__PURE__*/React.createElement("a", {
1327
+ return /*#__PURE__*/jsxRuntimeExports.jsx("a", {
124
1328
  className: classes,
125
1329
  href: mergedDisabled ? undefined : href,
126
- "aria-disabled": mergedDisabled
127
- }, content);
1330
+ "aria-disabled": mergedDisabled,
1331
+ children: content
1332
+ });
128
1333
  }
129
- return /*#__PURE__*/React.createElement("button", _extends({
1334
+ return /*#__PURE__*/jsxRuntimeExports.jsx("button", {
130
1335
  type: htmlType,
131
1336
  className: classes,
132
- disabled: mergedDisabled
133
- }, restProps), content);
1337
+ disabled: mergedDisabled,
1338
+ ...restProps,
1339
+ children: content
1340
+ });
134
1341
  };
135
1342
 
136
1343
  export { ButtonComponent as Button };