@khanacademy/keypad-context 2.0.0 → 3.0.1

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