genesys-react-components 0.1.0-alpha.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,2865 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var genesysDevIcons = require('genesys-dev-icons');
6
+
7
+ var react = {exports: {}};
8
+
9
+ var react_production_min = {};
10
+
11
+ /*
12
+ object-assign
13
+ (c) Sindre Sorhus
14
+ @license MIT
15
+ */
16
+ /* eslint-disable no-unused-vars */
17
+ var getOwnPropertySymbols = Object.getOwnPropertySymbols;
18
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
19
+ var propIsEnumerable = Object.prototype.propertyIsEnumerable;
20
+
21
+ function toObject(val) {
22
+ if (val === null || val === undefined) {
23
+ throw new TypeError('Object.assign cannot be called with null or undefined');
24
+ }
25
+
26
+ return Object(val);
27
+ }
28
+
29
+ function shouldUseNative() {
30
+ try {
31
+ if (!Object.assign) {
32
+ return false;
33
+ }
34
+
35
+ // Detect buggy property enumeration order in older V8 versions.
36
+
37
+ // https://bugs.chromium.org/p/v8/issues/detail?id=4118
38
+ var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
39
+ test1[5] = 'de';
40
+ if (Object.getOwnPropertyNames(test1)[0] === '5') {
41
+ return false;
42
+ }
43
+
44
+ // https://bugs.chromium.org/p/v8/issues/detail?id=3056
45
+ var test2 = {};
46
+ for (var i = 0; i < 10; i++) {
47
+ test2['_' + String.fromCharCode(i)] = i;
48
+ }
49
+ var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
50
+ return test2[n];
51
+ });
52
+ if (order2.join('') !== '0123456789') {
53
+ return false;
54
+ }
55
+
56
+ // https://bugs.chromium.org/p/v8/issues/detail?id=3056
57
+ var test3 = {};
58
+ 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
59
+ test3[letter] = letter;
60
+ });
61
+ if (Object.keys(Object.assign({}, test3)).join('') !==
62
+ 'abcdefghijklmnopqrst') {
63
+ return false;
64
+ }
65
+
66
+ return true;
67
+ } catch (err) {
68
+ // We don't expect any of the above to throw, but better to be safe.
69
+ return false;
70
+ }
71
+ }
72
+
73
+ var objectAssign = shouldUseNative() ? Object.assign : function (target, source) {
74
+ var from;
75
+ var to = toObject(target);
76
+ var symbols;
77
+
78
+ for (var s = 1; s < arguments.length; s++) {
79
+ from = Object(arguments[s]);
80
+
81
+ for (var key in from) {
82
+ if (hasOwnProperty.call(from, key)) {
83
+ to[key] = from[key];
84
+ }
85
+ }
86
+
87
+ if (getOwnPropertySymbols) {
88
+ symbols = getOwnPropertySymbols(from);
89
+ for (var i = 0; i < symbols.length; i++) {
90
+ if (propIsEnumerable.call(from, symbols[i])) {
91
+ to[symbols[i]] = from[symbols[i]];
92
+ }
93
+ }
94
+ }
95
+ }
96
+
97
+ return to;
98
+ };
99
+
100
+ /** @license React v17.0.2
101
+ * react.production.min.js
102
+ *
103
+ * Copyright (c) Facebook, Inc. and its affiliates.
104
+ *
105
+ * This source code is licensed under the MIT license found in the
106
+ * LICENSE file in the root directory of this source tree.
107
+ */
108
+ var l=objectAssign,n=60103,p=60106;react_production_min.Fragment=60107;react_production_min.StrictMode=60108;react_production_min.Profiler=60114;var q=60109,r=60110,t=60112;react_production_min.Suspense=60113;var u=60115,v=60116;
109
+ if("function"===typeof Symbol&&Symbol.for){var w=Symbol.for;n=w("react.element");p=w("react.portal");react_production_min.Fragment=w("react.fragment");react_production_min.StrictMode=w("react.strict_mode");react_production_min.Profiler=w("react.profiler");q=w("react.provider");r=w("react.context");t=w("react.forward_ref");react_production_min.Suspense=w("react.suspense");u=w("react.memo");v=w("react.lazy");}var x="function"===typeof Symbol&&Symbol.iterator;
110
+ function y(a){if(null===a||"object"!==typeof a)return null;a=x&&a[x]||a["@@iterator"];return "function"===typeof a?a:null}function z(a){for(var b="https://reactjs.org/docs/error-decoder.html?invariant="+a,c=1;c<arguments.length;c++)b+="&args[]="+encodeURIComponent(arguments[c]);return "Minified React error #"+a+"; visit "+b+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}
111
+ var A={isMounted:function(){return !1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},B={};function C(a,b,c){this.props=a;this.context=b;this.refs=B;this.updater=c||A;}C.prototype.isReactComponent={};C.prototype.setState=function(a,b){if("object"!==typeof a&&"function"!==typeof a&&null!=a)throw Error(z(85));this.updater.enqueueSetState(this,a,b,"setState");};C.prototype.forceUpdate=function(a){this.updater.enqueueForceUpdate(this,a,"forceUpdate");};
112
+ function D(){}D.prototype=C.prototype;function E(a,b,c){this.props=a;this.context=b;this.refs=B;this.updater=c||A;}var F=E.prototype=new D;F.constructor=E;l(F,C.prototype);F.isPureReactComponent=!0;var G={current:null},H=Object.prototype.hasOwnProperty,I={key:!0,ref:!0,__self:!0,__source:!0};
113
+ function J(a,b,c){var e,d={},k=null,h=null;if(null!=b)for(e in void 0!==b.ref&&(h=b.ref),void 0!==b.key&&(k=""+b.key),b)H.call(b,e)&&!I.hasOwnProperty(e)&&(d[e]=b[e]);var g=arguments.length-2;if(1===g)d.children=c;else if(1<g){for(var f=Array(g),m=0;m<g;m++)f[m]=arguments[m+2];d.children=f;}if(a&&a.defaultProps)for(e in g=a.defaultProps,g)void 0===d[e]&&(d[e]=g[e]);return {$$typeof:n,type:a,key:k,ref:h,props:d,_owner:G.current}}
114
+ function K(a,b){return {$$typeof:n,type:a.type,key:b,ref:a.ref,props:a.props,_owner:a._owner}}function L(a){return "object"===typeof a&&null!==a&&a.$$typeof===n}function escape(a){var b={"=":"=0",":":"=2"};return "$"+a.replace(/[=:]/g,function(a){return b[a]})}var M=/\/+/g;function N(a,b){return "object"===typeof a&&null!==a&&null!=a.key?escape(""+a.key):b.toString(36)}
115
+ function O(a,b,c,e,d){var k=typeof a;if("undefined"===k||"boolean"===k)a=null;var h=!1;if(null===a)h=!0;else switch(k){case "string":case "number":h=!0;break;case "object":switch(a.$$typeof){case n:case p:h=!0;}}if(h)return h=a,d=d(h),a=""===e?"."+N(h,0):e,Array.isArray(d)?(c="",null!=a&&(c=a.replace(M,"$&/")+"/"),O(d,b,c,"",function(a){return a})):null!=d&&(L(d)&&(d=K(d,c+(!d.key||h&&h.key===d.key?"":(""+d.key).replace(M,"$&/")+"/")+a)),b.push(d)),1;h=0;e=""===e?".":e+":";if(Array.isArray(a))for(var g=
116
+ 0;g<a.length;g++){k=a[g];var f=e+N(k,g);h+=O(k,b,c,f,d);}else if(f=y(a),"function"===typeof f)for(a=f.call(a),g=0;!(k=a.next()).done;)k=k.value,f=e+N(k,g++),h+=O(k,b,c,f,d);else if("object"===k)throw b=""+a,Error(z(31,"[object Object]"===b?"object with keys {"+Object.keys(a).join(", ")+"}":b));return h}function P(a,b,c){if(null==a)return a;var e=[],d=0;O(a,e,"","",function(a){return b.call(c,a,d++)});return e}
117
+ function Q(a){if(-1===a._status){var b=a._result;b=b();a._status=0;a._result=b;b.then(function(b){0===a._status&&(b=b.default,a._status=1,a._result=b);},function(b){0===a._status&&(a._status=2,a._result=b);});}if(1===a._status)return a._result;throw a._result;}var R={current:null};function S(){var a=R.current;if(null===a)throw Error(z(321));return a}var T={ReactCurrentDispatcher:R,ReactCurrentBatchConfig:{transition:0},ReactCurrentOwner:G,IsSomeRendererActing:{current:!1},assign:l};
118
+ react_production_min.Children={map:P,forEach:function(a,b,c){P(a,function(){b.apply(this,arguments);},c);},count:function(a){var b=0;P(a,function(){b++;});return b},toArray:function(a){return P(a,function(a){return a})||[]},only:function(a){if(!L(a))throw Error(z(143));return a}};react_production_min.Component=C;react_production_min.PureComponent=E;react_production_min.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=T;
119
+ react_production_min.cloneElement=function(a,b,c){if(null===a||void 0===a)throw Error(z(267,a));var e=l({},a.props),d=a.key,k=a.ref,h=a._owner;if(null!=b){void 0!==b.ref&&(k=b.ref,h=G.current);void 0!==b.key&&(d=""+b.key);if(a.type&&a.type.defaultProps)var g=a.type.defaultProps;for(f in b)H.call(b,f)&&!I.hasOwnProperty(f)&&(e[f]=void 0===b[f]&&void 0!==g?g[f]:b[f]);}var f=arguments.length-2;if(1===f)e.children=c;else if(1<f){g=Array(f);for(var m=0;m<f;m++)g[m]=arguments[m+2];e.children=g;}return {$$typeof:n,type:a.type,
120
+ key:d,ref:k,props:e,_owner:h}};react_production_min.createContext=function(a,b){void 0===b&&(b=null);a={$$typeof:r,_calculateChangedBits:b,_currentValue:a,_currentValue2:a,_threadCount:0,Provider:null,Consumer:null};a.Provider={$$typeof:q,_context:a};return a.Consumer=a};react_production_min.createElement=J;react_production_min.createFactory=function(a){var b=J.bind(null,a);b.type=a;return b};react_production_min.createRef=function(){return {current:null}};react_production_min.forwardRef=function(a){return {$$typeof:t,render:a}};react_production_min.isValidElement=L;
121
+ react_production_min.lazy=function(a){return {$$typeof:v,_payload:{_status:-1,_result:a},_init:Q}};react_production_min.memo=function(a,b){return {$$typeof:u,type:a,compare:void 0===b?null:b}};react_production_min.useCallback=function(a,b){return S().useCallback(a,b)};react_production_min.useContext=function(a,b){return S().useContext(a,b)};react_production_min.useDebugValue=function(){};react_production_min.useEffect=function(a,b){return S().useEffect(a,b)};react_production_min.useImperativeHandle=function(a,b,c){return S().useImperativeHandle(a,b,c)};
122
+ react_production_min.useLayoutEffect=function(a,b){return S().useLayoutEffect(a,b)};react_production_min.useMemo=function(a,b){return S().useMemo(a,b)};react_production_min.useReducer=function(a,b,c){return S().useReducer(a,b,c)};react_production_min.useRef=function(a){return S().useRef(a)};react_production_min.useState=function(a){return S().useState(a)};react_production_min.version="17.0.2";
123
+
124
+ var react_development = {};
125
+
126
+ /** @license React v17.0.2
127
+ * react.development.js
128
+ *
129
+ * Copyright (c) Facebook, Inc. and its affiliates.
130
+ *
131
+ * This source code is licensed under the MIT license found in the
132
+ * LICENSE file in the root directory of this source tree.
133
+ */
134
+
135
+ (function (exports) {
136
+
137
+ if (process.env.NODE_ENV !== "production") {
138
+ (function() {
139
+
140
+ var _assign = objectAssign;
141
+
142
+ // TODO: this is special because it gets imported during build.
143
+ var ReactVersion = '17.0.2';
144
+
145
+ // ATTENTION
146
+ // When adding new symbols to this file,
147
+ // Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'
148
+ // The Symbol used to tag the ReactElement-like types. If there is no native Symbol
149
+ // nor polyfill, then a plain number is used for performance.
150
+ var REACT_ELEMENT_TYPE = 0xeac7;
151
+ var REACT_PORTAL_TYPE = 0xeaca;
152
+ exports.Fragment = 0xeacb;
153
+ exports.StrictMode = 0xeacc;
154
+ exports.Profiler = 0xead2;
155
+ var REACT_PROVIDER_TYPE = 0xeacd;
156
+ var REACT_CONTEXT_TYPE = 0xeace;
157
+ var REACT_FORWARD_REF_TYPE = 0xead0;
158
+ exports.Suspense = 0xead1;
159
+ var REACT_SUSPENSE_LIST_TYPE = 0xead8;
160
+ var REACT_MEMO_TYPE = 0xead3;
161
+ var REACT_LAZY_TYPE = 0xead4;
162
+ var REACT_BLOCK_TYPE = 0xead9;
163
+ var REACT_SERVER_BLOCK_TYPE = 0xeada;
164
+ var REACT_FUNDAMENTAL_TYPE = 0xead5;
165
+ var REACT_DEBUG_TRACING_MODE_TYPE = 0xeae1;
166
+ var REACT_LEGACY_HIDDEN_TYPE = 0xeae3;
167
+
168
+ if (typeof Symbol === 'function' && Symbol.for) {
169
+ var symbolFor = Symbol.for;
170
+ REACT_ELEMENT_TYPE = symbolFor('react.element');
171
+ REACT_PORTAL_TYPE = symbolFor('react.portal');
172
+ exports.Fragment = symbolFor('react.fragment');
173
+ exports.StrictMode = symbolFor('react.strict_mode');
174
+ exports.Profiler = symbolFor('react.profiler');
175
+ REACT_PROVIDER_TYPE = symbolFor('react.provider');
176
+ REACT_CONTEXT_TYPE = symbolFor('react.context');
177
+ REACT_FORWARD_REF_TYPE = symbolFor('react.forward_ref');
178
+ exports.Suspense = symbolFor('react.suspense');
179
+ REACT_SUSPENSE_LIST_TYPE = symbolFor('react.suspense_list');
180
+ REACT_MEMO_TYPE = symbolFor('react.memo');
181
+ REACT_LAZY_TYPE = symbolFor('react.lazy');
182
+ REACT_BLOCK_TYPE = symbolFor('react.block');
183
+ REACT_SERVER_BLOCK_TYPE = symbolFor('react.server.block');
184
+ REACT_FUNDAMENTAL_TYPE = symbolFor('react.fundamental');
185
+ symbolFor('react.scope');
186
+ symbolFor('react.opaque.id');
187
+ REACT_DEBUG_TRACING_MODE_TYPE = symbolFor('react.debug_trace_mode');
188
+ symbolFor('react.offscreen');
189
+ REACT_LEGACY_HIDDEN_TYPE = symbolFor('react.legacy_hidden');
190
+ }
191
+
192
+ var MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
193
+ var FAUX_ITERATOR_SYMBOL = '@@iterator';
194
+ function getIteratorFn(maybeIterable) {
195
+ if (maybeIterable === null || typeof maybeIterable !== 'object') {
196
+ return null;
197
+ }
198
+
199
+ var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
200
+
201
+ if (typeof maybeIterator === 'function') {
202
+ return maybeIterator;
203
+ }
204
+
205
+ return null;
206
+ }
207
+
208
+ /**
209
+ * Keeps track of the current dispatcher.
210
+ */
211
+ var ReactCurrentDispatcher = {
212
+ /**
213
+ * @internal
214
+ * @type {ReactComponent}
215
+ */
216
+ current: null
217
+ };
218
+
219
+ /**
220
+ * Keeps track of the current batch's configuration such as how long an update
221
+ * should suspend for if it needs to.
222
+ */
223
+ var ReactCurrentBatchConfig = {
224
+ transition: 0
225
+ };
226
+
227
+ /**
228
+ * Keeps track of the current owner.
229
+ *
230
+ * The current owner is the component who should own any components that are
231
+ * currently being constructed.
232
+ */
233
+ var ReactCurrentOwner = {
234
+ /**
235
+ * @internal
236
+ * @type {ReactComponent}
237
+ */
238
+ current: null
239
+ };
240
+
241
+ var ReactDebugCurrentFrame = {};
242
+ var currentExtraStackFrame = null;
243
+ function setExtraStackFrame(stack) {
244
+ {
245
+ currentExtraStackFrame = stack;
246
+ }
247
+ }
248
+
249
+ {
250
+ ReactDebugCurrentFrame.setExtraStackFrame = function (stack) {
251
+ {
252
+ currentExtraStackFrame = stack;
253
+ }
254
+ }; // Stack implementation injected by the current renderer.
255
+
256
+
257
+ ReactDebugCurrentFrame.getCurrentStack = null;
258
+
259
+ ReactDebugCurrentFrame.getStackAddendum = function () {
260
+ var stack = ''; // Add an extra top frame while an element is being validated
261
+
262
+ if (currentExtraStackFrame) {
263
+ stack += currentExtraStackFrame;
264
+ } // Delegate to the injected renderer-specific implementation
265
+
266
+
267
+ var impl = ReactDebugCurrentFrame.getCurrentStack;
268
+
269
+ if (impl) {
270
+ stack += impl() || '';
271
+ }
272
+
273
+ return stack;
274
+ };
275
+ }
276
+
277
+ /**
278
+ * Used by act() to track whether you're inside an act() scope.
279
+ */
280
+ var IsSomeRendererActing = {
281
+ current: false
282
+ };
283
+
284
+ var ReactSharedInternals = {
285
+ ReactCurrentDispatcher: ReactCurrentDispatcher,
286
+ ReactCurrentBatchConfig: ReactCurrentBatchConfig,
287
+ ReactCurrentOwner: ReactCurrentOwner,
288
+ IsSomeRendererActing: IsSomeRendererActing,
289
+ // Used by renderers to avoid bundling object-assign twice in UMD bundles:
290
+ assign: _assign
291
+ };
292
+
293
+ {
294
+ ReactSharedInternals.ReactDebugCurrentFrame = ReactDebugCurrentFrame;
295
+ }
296
+
297
+ // by calls to these methods by a Babel plugin.
298
+ //
299
+ // In PROD (or in packages without access to React internals),
300
+ // they are left as they are instead.
301
+
302
+ function warn(format) {
303
+ {
304
+ for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
305
+ args[_key - 1] = arguments[_key];
306
+ }
307
+
308
+ printWarning('warn', format, args);
309
+ }
310
+ }
311
+ function error(format) {
312
+ {
313
+ for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
314
+ args[_key2 - 1] = arguments[_key2];
315
+ }
316
+
317
+ printWarning('error', format, args);
318
+ }
319
+ }
320
+
321
+ function printWarning(level, format, args) {
322
+ // When changing this logic, you might want to also
323
+ // update consoleWithStackDev.www.js as well.
324
+ {
325
+ var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
326
+ var stack = ReactDebugCurrentFrame.getStackAddendum();
327
+
328
+ if (stack !== '') {
329
+ format += '%s';
330
+ args = args.concat([stack]);
331
+ }
332
+
333
+ var argsWithFormat = args.map(function (item) {
334
+ return '' + item;
335
+ }); // Careful: RN currently depends on this prefix
336
+
337
+ argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it
338
+ // breaks IE9: https://github.com/facebook/react/issues/13610
339
+ // eslint-disable-next-line react-internal/no-production-logging
340
+
341
+ Function.prototype.apply.call(console[level], console, argsWithFormat);
342
+ }
343
+ }
344
+
345
+ var didWarnStateUpdateForUnmountedComponent = {};
346
+
347
+ function warnNoop(publicInstance, callerName) {
348
+ {
349
+ var _constructor = publicInstance.constructor;
350
+ var componentName = _constructor && (_constructor.displayName || _constructor.name) || 'ReactClass';
351
+ var warningKey = componentName + "." + callerName;
352
+
353
+ if (didWarnStateUpdateForUnmountedComponent[warningKey]) {
354
+ return;
355
+ }
356
+
357
+ error("Can't call %s on a component that is not yet mounted. " + 'This is a no-op, but it might indicate a bug in your application. ' + 'Instead, assign to `this.state` directly or define a `state = {};` ' + 'class property with the desired state in the %s component.', callerName, componentName);
358
+
359
+ didWarnStateUpdateForUnmountedComponent[warningKey] = true;
360
+ }
361
+ }
362
+ /**
363
+ * This is the abstract API for an update queue.
364
+ */
365
+
366
+
367
+ var ReactNoopUpdateQueue = {
368
+ /**
369
+ * Checks whether or not this composite component is mounted.
370
+ * @param {ReactClass} publicInstance The instance we want to test.
371
+ * @return {boolean} True if mounted, false otherwise.
372
+ * @protected
373
+ * @final
374
+ */
375
+ isMounted: function (publicInstance) {
376
+ return false;
377
+ },
378
+
379
+ /**
380
+ * Forces an update. This should only be invoked when it is known with
381
+ * certainty that we are **not** in a DOM transaction.
382
+ *
383
+ * You may want to call this when you know that some deeper aspect of the
384
+ * component's state has changed but `setState` was not called.
385
+ *
386
+ * This will not invoke `shouldComponentUpdate`, but it will invoke
387
+ * `componentWillUpdate` and `componentDidUpdate`.
388
+ *
389
+ * @param {ReactClass} publicInstance The instance that should rerender.
390
+ * @param {?function} callback Called after component is updated.
391
+ * @param {?string} callerName name of the calling function in the public API.
392
+ * @internal
393
+ */
394
+ enqueueForceUpdate: function (publicInstance, callback, callerName) {
395
+ warnNoop(publicInstance, 'forceUpdate');
396
+ },
397
+
398
+ /**
399
+ * Replaces all of the state. Always use this or `setState` to mutate state.
400
+ * You should treat `this.state` as immutable.
401
+ *
402
+ * There is no guarantee that `this.state` will be immediately updated, so
403
+ * accessing `this.state` after calling this method may return the old value.
404
+ *
405
+ * @param {ReactClass} publicInstance The instance that should rerender.
406
+ * @param {object} completeState Next state.
407
+ * @param {?function} callback Called after component is updated.
408
+ * @param {?string} callerName name of the calling function in the public API.
409
+ * @internal
410
+ */
411
+ enqueueReplaceState: function (publicInstance, completeState, callback, callerName) {
412
+ warnNoop(publicInstance, 'replaceState');
413
+ },
414
+
415
+ /**
416
+ * Sets a subset of the state. This only exists because _pendingState is
417
+ * internal. This provides a merging strategy that is not available to deep
418
+ * properties which is confusing. TODO: Expose pendingState or don't use it
419
+ * during the merge.
420
+ *
421
+ * @param {ReactClass} publicInstance The instance that should rerender.
422
+ * @param {object} partialState Next partial state to be merged with state.
423
+ * @param {?function} callback Called after component is updated.
424
+ * @param {?string} Name of the calling function in the public API.
425
+ * @internal
426
+ */
427
+ enqueueSetState: function (publicInstance, partialState, callback, callerName) {
428
+ warnNoop(publicInstance, 'setState');
429
+ }
430
+ };
431
+
432
+ var emptyObject = {};
433
+
434
+ {
435
+ Object.freeze(emptyObject);
436
+ }
437
+ /**
438
+ * Base class helpers for the updating state of a component.
439
+ */
440
+
441
+
442
+ function Component(props, context, updater) {
443
+ this.props = props;
444
+ this.context = context; // If a component has string refs, we will assign a different object later.
445
+
446
+ this.refs = emptyObject; // We initialize the default updater but the real one gets injected by the
447
+ // renderer.
448
+
449
+ this.updater = updater || ReactNoopUpdateQueue;
450
+ }
451
+
452
+ Component.prototype.isReactComponent = {};
453
+ /**
454
+ * Sets a subset of the state. Always use this to mutate
455
+ * state. You should treat `this.state` as immutable.
456
+ *
457
+ * There is no guarantee that `this.state` will be immediately updated, so
458
+ * accessing `this.state` after calling this method may return the old value.
459
+ *
460
+ * There is no guarantee that calls to `setState` will run synchronously,
461
+ * as they may eventually be batched together. You can provide an optional
462
+ * callback that will be executed when the call to setState is actually
463
+ * completed.
464
+ *
465
+ * When a function is provided to setState, it will be called at some point in
466
+ * the future (not synchronously). It will be called with the up to date
467
+ * component arguments (state, props, context). These values can be different
468
+ * from this.* because your function may be called after receiveProps but before
469
+ * shouldComponentUpdate, and this new state, props, and context will not yet be
470
+ * assigned to this.
471
+ *
472
+ * @param {object|function} partialState Next partial state or function to
473
+ * produce next partial state to be merged with current state.
474
+ * @param {?function} callback Called after state is updated.
475
+ * @final
476
+ * @protected
477
+ */
478
+
479
+ Component.prototype.setState = function (partialState, callback) {
480
+ if (!(typeof partialState === 'object' || typeof partialState === 'function' || partialState == null)) {
481
+ {
482
+ throw Error( "setState(...): takes an object of state variables to update or a function which returns an object of state variables." );
483
+ }
484
+ }
485
+
486
+ this.updater.enqueueSetState(this, partialState, callback, 'setState');
487
+ };
488
+ /**
489
+ * Forces an update. This should only be invoked when it is known with
490
+ * certainty that we are **not** in a DOM transaction.
491
+ *
492
+ * You may want to call this when you know that some deeper aspect of the
493
+ * component's state has changed but `setState` was not called.
494
+ *
495
+ * This will not invoke `shouldComponentUpdate`, but it will invoke
496
+ * `componentWillUpdate` and `componentDidUpdate`.
497
+ *
498
+ * @param {?function} callback Called after update is complete.
499
+ * @final
500
+ * @protected
501
+ */
502
+
503
+
504
+ Component.prototype.forceUpdate = function (callback) {
505
+ this.updater.enqueueForceUpdate(this, callback, 'forceUpdate');
506
+ };
507
+ /**
508
+ * Deprecated APIs. These APIs used to exist on classic React classes but since
509
+ * we would like to deprecate them, we're not going to move them over to this
510
+ * modern base class. Instead, we define a getter that warns if it's accessed.
511
+ */
512
+
513
+
514
+ {
515
+ var deprecatedAPIs = {
516
+ isMounted: ['isMounted', 'Instead, make sure to clean up subscriptions and pending requests in ' + 'componentWillUnmount to prevent memory leaks.'],
517
+ replaceState: ['replaceState', 'Refactor your code to use setState instead (see ' + 'https://github.com/facebook/react/issues/3236).']
518
+ };
519
+
520
+ var defineDeprecationWarning = function (methodName, info) {
521
+ Object.defineProperty(Component.prototype, methodName, {
522
+ get: function () {
523
+ warn('%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]);
524
+
525
+ return undefined;
526
+ }
527
+ });
528
+ };
529
+
530
+ for (var fnName in deprecatedAPIs) {
531
+ if (deprecatedAPIs.hasOwnProperty(fnName)) {
532
+ defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
533
+ }
534
+ }
535
+ }
536
+
537
+ function ComponentDummy() {}
538
+
539
+ ComponentDummy.prototype = Component.prototype;
540
+ /**
541
+ * Convenience component with default shallow equality check for sCU.
542
+ */
543
+
544
+ function PureComponent(props, context, updater) {
545
+ this.props = props;
546
+ this.context = context; // If a component has string refs, we will assign a different object later.
547
+
548
+ this.refs = emptyObject;
549
+ this.updater = updater || ReactNoopUpdateQueue;
550
+ }
551
+
552
+ var pureComponentPrototype = PureComponent.prototype = new ComponentDummy();
553
+ pureComponentPrototype.constructor = PureComponent; // Avoid an extra prototype jump for these methods.
554
+
555
+ _assign(pureComponentPrototype, Component.prototype);
556
+
557
+ pureComponentPrototype.isPureReactComponent = true;
558
+
559
+ // an immutable object with a single mutable value
560
+ function createRef() {
561
+ var refObject = {
562
+ current: null
563
+ };
564
+
565
+ {
566
+ Object.seal(refObject);
567
+ }
568
+
569
+ return refObject;
570
+ }
571
+
572
+ function getWrappedName(outerType, innerType, wrapperName) {
573
+ var functionName = innerType.displayName || innerType.name || '';
574
+ return outerType.displayName || (functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName);
575
+ }
576
+
577
+ function getContextName(type) {
578
+ return type.displayName || 'Context';
579
+ }
580
+
581
+ function getComponentName(type) {
582
+ if (type == null) {
583
+ // Host root, text node or just invalid type.
584
+ return null;
585
+ }
586
+
587
+ {
588
+ if (typeof type.tag === 'number') {
589
+ error('Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.');
590
+ }
591
+ }
592
+
593
+ if (typeof type === 'function') {
594
+ return type.displayName || type.name || null;
595
+ }
596
+
597
+ if (typeof type === 'string') {
598
+ return type;
599
+ }
600
+
601
+ switch (type) {
602
+ case exports.Fragment:
603
+ return 'Fragment';
604
+
605
+ case REACT_PORTAL_TYPE:
606
+ return 'Portal';
607
+
608
+ case exports.Profiler:
609
+ return 'Profiler';
610
+
611
+ case exports.StrictMode:
612
+ return 'StrictMode';
613
+
614
+ case exports.Suspense:
615
+ return 'Suspense';
616
+
617
+ case REACT_SUSPENSE_LIST_TYPE:
618
+ return 'SuspenseList';
619
+ }
620
+
621
+ if (typeof type === 'object') {
622
+ switch (type.$$typeof) {
623
+ case REACT_CONTEXT_TYPE:
624
+ var context = type;
625
+ return getContextName(context) + '.Consumer';
626
+
627
+ case REACT_PROVIDER_TYPE:
628
+ var provider = type;
629
+ return getContextName(provider._context) + '.Provider';
630
+
631
+ case REACT_FORWARD_REF_TYPE:
632
+ return getWrappedName(type, type.render, 'ForwardRef');
633
+
634
+ case REACT_MEMO_TYPE:
635
+ return getComponentName(type.type);
636
+
637
+ case REACT_BLOCK_TYPE:
638
+ return getComponentName(type._render);
639
+
640
+ case REACT_LAZY_TYPE:
641
+ {
642
+ var lazyComponent = type;
643
+ var payload = lazyComponent._payload;
644
+ var init = lazyComponent._init;
645
+
646
+ try {
647
+ return getComponentName(init(payload));
648
+ } catch (x) {
649
+ return null;
650
+ }
651
+ }
652
+ }
653
+ }
654
+
655
+ return null;
656
+ }
657
+
658
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
659
+ var RESERVED_PROPS = {
660
+ key: true,
661
+ ref: true,
662
+ __self: true,
663
+ __source: true
664
+ };
665
+ var specialPropKeyWarningShown, specialPropRefWarningShown, didWarnAboutStringRefs;
666
+
667
+ {
668
+ didWarnAboutStringRefs = {};
669
+ }
670
+
671
+ function hasValidRef(config) {
672
+ {
673
+ if (hasOwnProperty.call(config, 'ref')) {
674
+ var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;
675
+
676
+ if (getter && getter.isReactWarning) {
677
+ return false;
678
+ }
679
+ }
680
+ }
681
+
682
+ return config.ref !== undefined;
683
+ }
684
+
685
+ function hasValidKey(config) {
686
+ {
687
+ if (hasOwnProperty.call(config, 'key')) {
688
+ var getter = Object.getOwnPropertyDescriptor(config, 'key').get;
689
+
690
+ if (getter && getter.isReactWarning) {
691
+ return false;
692
+ }
693
+ }
694
+ }
695
+
696
+ return config.key !== undefined;
697
+ }
698
+
699
+ function defineKeyPropWarningGetter(props, displayName) {
700
+ var warnAboutAccessingKey = function () {
701
+ {
702
+ if (!specialPropKeyWarningShown) {
703
+ specialPropKeyWarningShown = true;
704
+
705
+ 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);
706
+ }
707
+ }
708
+ };
709
+
710
+ warnAboutAccessingKey.isReactWarning = true;
711
+ Object.defineProperty(props, 'key', {
712
+ get: warnAboutAccessingKey,
713
+ configurable: true
714
+ });
715
+ }
716
+
717
+ function defineRefPropWarningGetter(props, displayName) {
718
+ var warnAboutAccessingRef = function () {
719
+ {
720
+ if (!specialPropRefWarningShown) {
721
+ specialPropRefWarningShown = true;
722
+
723
+ 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);
724
+ }
725
+ }
726
+ };
727
+
728
+ warnAboutAccessingRef.isReactWarning = true;
729
+ Object.defineProperty(props, 'ref', {
730
+ get: warnAboutAccessingRef,
731
+ configurable: true
732
+ });
733
+ }
734
+
735
+ function warnIfStringRefCannotBeAutoConverted(config) {
736
+ {
737
+ if (typeof config.ref === 'string' && ReactCurrentOwner.current && config.__self && ReactCurrentOwner.current.stateNode !== config.__self) {
738
+ var componentName = getComponentName(ReactCurrentOwner.current.type);
739
+
740
+ if (!didWarnAboutStringRefs[componentName]) {
741
+ 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', componentName, config.ref);
742
+
743
+ didWarnAboutStringRefs[componentName] = true;
744
+ }
745
+ }
746
+ }
747
+ }
748
+ /**
749
+ * Factory method to create a new React element. This no longer adheres to
750
+ * the class pattern, so do not use new to call it. Also, instanceof check
751
+ * will not work. Instead test $$typeof field against Symbol.for('react.element') to check
752
+ * if something is a React Element.
753
+ *
754
+ * @param {*} type
755
+ * @param {*} props
756
+ * @param {*} key
757
+ * @param {string|object} ref
758
+ * @param {*} owner
759
+ * @param {*} self A *temporary* helper to detect places where `this` is
760
+ * different from the `owner` when React.createElement is called, so that we
761
+ * can warn. We want to get rid of owner and replace string `ref`s with arrow
762
+ * functions, and as long as `this` and owner are the same, there will be no
763
+ * change in behavior.
764
+ * @param {*} source An annotation object (added by a transpiler or otherwise)
765
+ * indicating filename, line number, and/or other information.
766
+ * @internal
767
+ */
768
+
769
+
770
+ var ReactElement = function (type, key, ref, self, source, owner, props) {
771
+ var element = {
772
+ // This tag allows us to uniquely identify this as a React Element
773
+ $$typeof: REACT_ELEMENT_TYPE,
774
+ // Built-in properties that belong on the element
775
+ type: type,
776
+ key: key,
777
+ ref: ref,
778
+ props: props,
779
+ // Record the component responsible for creating this element.
780
+ _owner: owner
781
+ };
782
+
783
+ {
784
+ // The validation flag is currently mutative. We put it on
785
+ // an external backing store so that we can freeze the whole object.
786
+ // This can be replaced with a WeakMap once they are implemented in
787
+ // commonly used development environments.
788
+ element._store = {}; // To make comparing ReactElements easier for testing purposes, we make
789
+ // the validation flag non-enumerable (where possible, which should
790
+ // include every environment we run tests in), so the test framework
791
+ // ignores it.
792
+
793
+ Object.defineProperty(element._store, 'validated', {
794
+ configurable: false,
795
+ enumerable: false,
796
+ writable: true,
797
+ value: false
798
+ }); // self and source are DEV only properties.
799
+
800
+ Object.defineProperty(element, '_self', {
801
+ configurable: false,
802
+ enumerable: false,
803
+ writable: false,
804
+ value: self
805
+ }); // Two elements created in two different places should be considered
806
+ // equal for testing purposes and therefore we hide it from enumeration.
807
+
808
+ Object.defineProperty(element, '_source', {
809
+ configurable: false,
810
+ enumerable: false,
811
+ writable: false,
812
+ value: source
813
+ });
814
+
815
+ if (Object.freeze) {
816
+ Object.freeze(element.props);
817
+ Object.freeze(element);
818
+ }
819
+ }
820
+
821
+ return element;
822
+ };
823
+ /**
824
+ * Create and return a new ReactElement of the given type.
825
+ * See https://reactjs.org/docs/react-api.html#createelement
826
+ */
827
+
828
+ function createElement(type, config, children) {
829
+ var propName; // Reserved names are extracted
830
+
831
+ var props = {};
832
+ var key = null;
833
+ var ref = null;
834
+ var self = null;
835
+ var source = null;
836
+
837
+ if (config != null) {
838
+ if (hasValidRef(config)) {
839
+ ref = config.ref;
840
+
841
+ {
842
+ warnIfStringRefCannotBeAutoConverted(config);
843
+ }
844
+ }
845
+
846
+ if (hasValidKey(config)) {
847
+ key = '' + config.key;
848
+ }
849
+
850
+ self = config.__self === undefined ? null : config.__self;
851
+ source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object
852
+
853
+ for (propName in config) {
854
+ if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
855
+ props[propName] = config[propName];
856
+ }
857
+ }
858
+ } // Children can be more than one argument, and those are transferred onto
859
+ // the newly allocated props object.
860
+
861
+
862
+ var childrenLength = arguments.length - 2;
863
+
864
+ if (childrenLength === 1) {
865
+ props.children = children;
866
+ } else if (childrenLength > 1) {
867
+ var childArray = Array(childrenLength);
868
+
869
+ for (var i = 0; i < childrenLength; i++) {
870
+ childArray[i] = arguments[i + 2];
871
+ }
872
+
873
+ {
874
+ if (Object.freeze) {
875
+ Object.freeze(childArray);
876
+ }
877
+ }
878
+
879
+ props.children = childArray;
880
+ } // Resolve default props
881
+
882
+
883
+ if (type && type.defaultProps) {
884
+ var defaultProps = type.defaultProps;
885
+
886
+ for (propName in defaultProps) {
887
+ if (props[propName] === undefined) {
888
+ props[propName] = defaultProps[propName];
889
+ }
890
+ }
891
+ }
892
+
893
+ {
894
+ if (key || ref) {
895
+ var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;
896
+
897
+ if (key) {
898
+ defineKeyPropWarningGetter(props, displayName);
899
+ }
900
+
901
+ if (ref) {
902
+ defineRefPropWarningGetter(props, displayName);
903
+ }
904
+ }
905
+ }
906
+
907
+ return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
908
+ }
909
+ function cloneAndReplaceKey(oldElement, newKey) {
910
+ var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);
911
+ return newElement;
912
+ }
913
+ /**
914
+ * Clone and return a new ReactElement using element as the starting point.
915
+ * See https://reactjs.org/docs/react-api.html#cloneelement
916
+ */
917
+
918
+ function cloneElement(element, config, children) {
919
+ if (!!(element === null || element === undefined)) {
920
+ {
921
+ throw Error( "React.cloneElement(...): The argument must be a React element, but you passed " + element + "." );
922
+ }
923
+ }
924
+
925
+ var propName; // Original props are copied
926
+
927
+ var props = _assign({}, element.props); // Reserved names are extracted
928
+
929
+
930
+ var key = element.key;
931
+ var ref = element.ref; // Self is preserved since the owner is preserved.
932
+
933
+ var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a
934
+ // transpiler, and the original source is probably a better indicator of the
935
+ // true owner.
936
+
937
+ var source = element._source; // Owner will be preserved, unless ref is overridden
938
+
939
+ var owner = element._owner;
940
+
941
+ if (config != null) {
942
+ if (hasValidRef(config)) {
943
+ // Silently steal the ref from the parent.
944
+ ref = config.ref;
945
+ owner = ReactCurrentOwner.current;
946
+ }
947
+
948
+ if (hasValidKey(config)) {
949
+ key = '' + config.key;
950
+ } // Remaining properties override existing props
951
+
952
+
953
+ var defaultProps;
954
+
955
+ if (element.type && element.type.defaultProps) {
956
+ defaultProps = element.type.defaultProps;
957
+ }
958
+
959
+ for (propName in config) {
960
+ if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
961
+ if (config[propName] === undefined && defaultProps !== undefined) {
962
+ // Resolve default props
963
+ props[propName] = defaultProps[propName];
964
+ } else {
965
+ props[propName] = config[propName];
966
+ }
967
+ }
968
+ }
969
+ } // Children can be more than one argument, and those are transferred onto
970
+ // the newly allocated props object.
971
+
972
+
973
+ var childrenLength = arguments.length - 2;
974
+
975
+ if (childrenLength === 1) {
976
+ props.children = children;
977
+ } else if (childrenLength > 1) {
978
+ var childArray = Array(childrenLength);
979
+
980
+ for (var i = 0; i < childrenLength; i++) {
981
+ childArray[i] = arguments[i + 2];
982
+ }
983
+
984
+ props.children = childArray;
985
+ }
986
+
987
+ return ReactElement(element.type, key, ref, self, source, owner, props);
988
+ }
989
+ /**
990
+ * Verifies the object is a ReactElement.
991
+ * See https://reactjs.org/docs/react-api.html#isvalidelement
992
+ * @param {?object} object
993
+ * @return {boolean} True if `object` is a ReactElement.
994
+ * @final
995
+ */
996
+
997
+ function isValidElement(object) {
998
+ return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
999
+ }
1000
+
1001
+ var SEPARATOR = '.';
1002
+ var SUBSEPARATOR = ':';
1003
+ /**
1004
+ * Escape and wrap key so it is safe to use as a reactid
1005
+ *
1006
+ * @param {string} key to be escaped.
1007
+ * @return {string} the escaped key.
1008
+ */
1009
+
1010
+ function escape(key) {
1011
+ var escapeRegex = /[=:]/g;
1012
+ var escaperLookup = {
1013
+ '=': '=0',
1014
+ ':': '=2'
1015
+ };
1016
+ var escapedString = key.replace(escapeRegex, function (match) {
1017
+ return escaperLookup[match];
1018
+ });
1019
+ return '$' + escapedString;
1020
+ }
1021
+ /**
1022
+ * TODO: Test that a single child and an array with one item have the same key
1023
+ * pattern.
1024
+ */
1025
+
1026
+
1027
+ var didWarnAboutMaps = false;
1028
+ var userProvidedKeyEscapeRegex = /\/+/g;
1029
+
1030
+ function escapeUserProvidedKey(text) {
1031
+ return text.replace(userProvidedKeyEscapeRegex, '$&/');
1032
+ }
1033
+ /**
1034
+ * Generate a key string that identifies a element within a set.
1035
+ *
1036
+ * @param {*} element A element that could contain a manual key.
1037
+ * @param {number} index Index that is used if a manual key is not provided.
1038
+ * @return {string}
1039
+ */
1040
+
1041
+
1042
+ function getElementKey(element, index) {
1043
+ // Do some typechecking here since we call this blindly. We want to ensure
1044
+ // that we don't block potential future ES APIs.
1045
+ if (typeof element === 'object' && element !== null && element.key != null) {
1046
+ // Explicit key
1047
+ return escape('' + element.key);
1048
+ } // Implicit key determined by the index in the set
1049
+
1050
+
1051
+ return index.toString(36);
1052
+ }
1053
+
1054
+ function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {
1055
+ var type = typeof children;
1056
+
1057
+ if (type === 'undefined' || type === 'boolean') {
1058
+ // All of the above are perceived as null.
1059
+ children = null;
1060
+ }
1061
+
1062
+ var invokeCallback = false;
1063
+
1064
+ if (children === null) {
1065
+ invokeCallback = true;
1066
+ } else {
1067
+ switch (type) {
1068
+ case 'string':
1069
+ case 'number':
1070
+ invokeCallback = true;
1071
+ break;
1072
+
1073
+ case 'object':
1074
+ switch (children.$$typeof) {
1075
+ case REACT_ELEMENT_TYPE:
1076
+ case REACT_PORTAL_TYPE:
1077
+ invokeCallback = true;
1078
+ }
1079
+
1080
+ }
1081
+ }
1082
+
1083
+ if (invokeCallback) {
1084
+ var _child = children;
1085
+ var mappedChild = callback(_child); // If it's the only child, treat the name as if it was wrapped in an array
1086
+ // so that it's consistent if the number of children grows:
1087
+
1088
+ var childKey = nameSoFar === '' ? SEPARATOR + getElementKey(_child, 0) : nameSoFar;
1089
+
1090
+ if (Array.isArray(mappedChild)) {
1091
+ var escapedChildKey = '';
1092
+
1093
+ if (childKey != null) {
1094
+ escapedChildKey = escapeUserProvidedKey(childKey) + '/';
1095
+ }
1096
+
1097
+ mapIntoArray(mappedChild, array, escapedChildKey, '', function (c) {
1098
+ return c;
1099
+ });
1100
+ } else if (mappedChild != null) {
1101
+ if (isValidElement(mappedChild)) {
1102
+ mappedChild = cloneAndReplaceKey(mappedChild, // Keep both the (mapped) and old keys if they differ, just as
1103
+ // traverseAllChildren used to do for objects as children
1104
+ escapedPrefix + ( // $FlowFixMe Flow incorrectly thinks React.Portal doesn't have a key
1105
+ mappedChild.key && (!_child || _child.key !== mappedChild.key) ? // $FlowFixMe Flow incorrectly thinks existing element's key can be a number
1106
+ escapeUserProvidedKey('' + mappedChild.key) + '/' : '') + childKey);
1107
+ }
1108
+
1109
+ array.push(mappedChild);
1110
+ }
1111
+
1112
+ return 1;
1113
+ }
1114
+
1115
+ var child;
1116
+ var nextName;
1117
+ var subtreeCount = 0; // Count of children found in the current subtree.
1118
+
1119
+ var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR;
1120
+
1121
+ if (Array.isArray(children)) {
1122
+ for (var i = 0; i < children.length; i++) {
1123
+ child = children[i];
1124
+ nextName = nextNamePrefix + getElementKey(child, i);
1125
+ subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback);
1126
+ }
1127
+ } else {
1128
+ var iteratorFn = getIteratorFn(children);
1129
+
1130
+ if (typeof iteratorFn === 'function') {
1131
+ var iterableChildren = children;
1132
+
1133
+ {
1134
+ // Warn about using Maps as children
1135
+ if (iteratorFn === iterableChildren.entries) {
1136
+ if (!didWarnAboutMaps) {
1137
+ warn('Using Maps as children is not supported. ' + 'Use an array of keyed ReactElements instead.');
1138
+ }
1139
+
1140
+ didWarnAboutMaps = true;
1141
+ }
1142
+ }
1143
+
1144
+ var iterator = iteratorFn.call(iterableChildren);
1145
+ var step;
1146
+ var ii = 0;
1147
+
1148
+ while (!(step = iterator.next()).done) {
1149
+ child = step.value;
1150
+ nextName = nextNamePrefix + getElementKey(child, ii++);
1151
+ subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback);
1152
+ }
1153
+ } else if (type === 'object') {
1154
+ var childrenString = '' + children;
1155
+
1156
+ {
1157
+ {
1158
+ throw Error( "Objects are not valid as a React child (found: " + (childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString) + "). If you meant to render a collection of children, use an array instead." );
1159
+ }
1160
+ }
1161
+ }
1162
+ }
1163
+
1164
+ return subtreeCount;
1165
+ }
1166
+
1167
+ /**
1168
+ * Maps children that are typically specified as `props.children`.
1169
+ *
1170
+ * See https://reactjs.org/docs/react-api.html#reactchildrenmap
1171
+ *
1172
+ * The provided mapFunction(child, index) will be called for each
1173
+ * leaf child.
1174
+ *
1175
+ * @param {?*} children Children tree container.
1176
+ * @param {function(*, int)} func The map function.
1177
+ * @param {*} context Context for mapFunction.
1178
+ * @return {object} Object containing the ordered map of results.
1179
+ */
1180
+ function mapChildren(children, func, context) {
1181
+ if (children == null) {
1182
+ return children;
1183
+ }
1184
+
1185
+ var result = [];
1186
+ var count = 0;
1187
+ mapIntoArray(children, result, '', '', function (child) {
1188
+ return func.call(context, child, count++);
1189
+ });
1190
+ return result;
1191
+ }
1192
+ /**
1193
+ * Count the number of children that are typically specified as
1194
+ * `props.children`.
1195
+ *
1196
+ * See https://reactjs.org/docs/react-api.html#reactchildrencount
1197
+ *
1198
+ * @param {?*} children Children tree container.
1199
+ * @return {number} The number of children.
1200
+ */
1201
+
1202
+
1203
+ function countChildren(children) {
1204
+ var n = 0;
1205
+ mapChildren(children, function () {
1206
+ n++; // Don't return anything
1207
+ });
1208
+ return n;
1209
+ }
1210
+
1211
+ /**
1212
+ * Iterates through children that are typically specified as `props.children`.
1213
+ *
1214
+ * See https://reactjs.org/docs/react-api.html#reactchildrenforeach
1215
+ *
1216
+ * The provided forEachFunc(child, index) will be called for each
1217
+ * leaf child.
1218
+ *
1219
+ * @param {?*} children Children tree container.
1220
+ * @param {function(*, int)} forEachFunc
1221
+ * @param {*} forEachContext Context for forEachContext.
1222
+ */
1223
+ function forEachChildren(children, forEachFunc, forEachContext) {
1224
+ mapChildren(children, function () {
1225
+ forEachFunc.apply(this, arguments); // Don't return anything.
1226
+ }, forEachContext);
1227
+ }
1228
+ /**
1229
+ * Flatten a children object (typically specified as `props.children`) and
1230
+ * return an array with appropriately re-keyed children.
1231
+ *
1232
+ * See https://reactjs.org/docs/react-api.html#reactchildrentoarray
1233
+ */
1234
+
1235
+
1236
+ function toArray(children) {
1237
+ return mapChildren(children, function (child) {
1238
+ return child;
1239
+ }) || [];
1240
+ }
1241
+ /**
1242
+ * Returns the first child in a collection of children and verifies that there
1243
+ * is only one child in the collection.
1244
+ *
1245
+ * See https://reactjs.org/docs/react-api.html#reactchildrenonly
1246
+ *
1247
+ * The current implementation of this function assumes that a single child gets
1248
+ * passed without a wrapper, but the purpose of this helper function is to
1249
+ * abstract away the particular structure of children.
1250
+ *
1251
+ * @param {?object} children Child collection structure.
1252
+ * @return {ReactElement} The first and only `ReactElement` contained in the
1253
+ * structure.
1254
+ */
1255
+
1256
+
1257
+ function onlyChild(children) {
1258
+ if (!isValidElement(children)) {
1259
+ {
1260
+ throw Error( "React.Children.only expected to receive a single React element child." );
1261
+ }
1262
+ }
1263
+
1264
+ return children;
1265
+ }
1266
+
1267
+ function createContext(defaultValue, calculateChangedBits) {
1268
+ if (calculateChangedBits === undefined) {
1269
+ calculateChangedBits = null;
1270
+ } else {
1271
+ {
1272
+ if (calculateChangedBits !== null && typeof calculateChangedBits !== 'function') {
1273
+ error('createContext: Expected the optional second argument to be a ' + 'function. Instead received: %s', calculateChangedBits);
1274
+ }
1275
+ }
1276
+ }
1277
+
1278
+ var context = {
1279
+ $$typeof: REACT_CONTEXT_TYPE,
1280
+ _calculateChangedBits: calculateChangedBits,
1281
+ // As a workaround to support multiple concurrent renderers, we categorize
1282
+ // some renderers as primary and others as secondary. We only expect
1283
+ // there to be two concurrent renderers at most: React Native (primary) and
1284
+ // Fabric (secondary); React DOM (primary) and React ART (secondary).
1285
+ // Secondary renderers store their context values on separate fields.
1286
+ _currentValue: defaultValue,
1287
+ _currentValue2: defaultValue,
1288
+ // Used to track how many concurrent renderers this context currently
1289
+ // supports within in a single renderer. Such as parallel server rendering.
1290
+ _threadCount: 0,
1291
+ // These are circular
1292
+ Provider: null,
1293
+ Consumer: null
1294
+ };
1295
+ context.Provider = {
1296
+ $$typeof: REACT_PROVIDER_TYPE,
1297
+ _context: context
1298
+ };
1299
+ var hasWarnedAboutUsingNestedContextConsumers = false;
1300
+ var hasWarnedAboutUsingConsumerProvider = false;
1301
+ var hasWarnedAboutDisplayNameOnConsumer = false;
1302
+
1303
+ {
1304
+ // A separate object, but proxies back to the original context object for
1305
+ // backwards compatibility. It has a different $$typeof, so we can properly
1306
+ // warn for the incorrect usage of Context as a Consumer.
1307
+ var Consumer = {
1308
+ $$typeof: REACT_CONTEXT_TYPE,
1309
+ _context: context,
1310
+ _calculateChangedBits: context._calculateChangedBits
1311
+ }; // $FlowFixMe: Flow complains about not setting a value, which is intentional here
1312
+
1313
+ Object.defineProperties(Consumer, {
1314
+ Provider: {
1315
+ get: function () {
1316
+ if (!hasWarnedAboutUsingConsumerProvider) {
1317
+ hasWarnedAboutUsingConsumerProvider = true;
1318
+
1319
+ error('Rendering <Context.Consumer.Provider> is not supported and will be removed in ' + 'a future major release. Did you mean to render <Context.Provider> instead?');
1320
+ }
1321
+
1322
+ return context.Provider;
1323
+ },
1324
+ set: function (_Provider) {
1325
+ context.Provider = _Provider;
1326
+ }
1327
+ },
1328
+ _currentValue: {
1329
+ get: function () {
1330
+ return context._currentValue;
1331
+ },
1332
+ set: function (_currentValue) {
1333
+ context._currentValue = _currentValue;
1334
+ }
1335
+ },
1336
+ _currentValue2: {
1337
+ get: function () {
1338
+ return context._currentValue2;
1339
+ },
1340
+ set: function (_currentValue2) {
1341
+ context._currentValue2 = _currentValue2;
1342
+ }
1343
+ },
1344
+ _threadCount: {
1345
+ get: function () {
1346
+ return context._threadCount;
1347
+ },
1348
+ set: function (_threadCount) {
1349
+ context._threadCount = _threadCount;
1350
+ }
1351
+ },
1352
+ Consumer: {
1353
+ get: function () {
1354
+ if (!hasWarnedAboutUsingNestedContextConsumers) {
1355
+ hasWarnedAboutUsingNestedContextConsumers = true;
1356
+
1357
+ error('Rendering <Context.Consumer.Consumer> is not supported and will be removed in ' + 'a future major release. Did you mean to render <Context.Consumer> instead?');
1358
+ }
1359
+
1360
+ return context.Consumer;
1361
+ }
1362
+ },
1363
+ displayName: {
1364
+ get: function () {
1365
+ return context.displayName;
1366
+ },
1367
+ set: function (displayName) {
1368
+ if (!hasWarnedAboutDisplayNameOnConsumer) {
1369
+ warn('Setting `displayName` on Context.Consumer has no effect. ' + "You should set it directly on the context with Context.displayName = '%s'.", displayName);
1370
+
1371
+ hasWarnedAboutDisplayNameOnConsumer = true;
1372
+ }
1373
+ }
1374
+ }
1375
+ }); // $FlowFixMe: Flow complains about missing properties because it doesn't understand defineProperty
1376
+
1377
+ context.Consumer = Consumer;
1378
+ }
1379
+
1380
+ {
1381
+ context._currentRenderer = null;
1382
+ context._currentRenderer2 = null;
1383
+ }
1384
+
1385
+ return context;
1386
+ }
1387
+
1388
+ var Uninitialized = -1;
1389
+ var Pending = 0;
1390
+ var Resolved = 1;
1391
+ var Rejected = 2;
1392
+
1393
+ function lazyInitializer(payload) {
1394
+ if (payload._status === Uninitialized) {
1395
+ var ctor = payload._result;
1396
+ var thenable = ctor(); // Transition to the next state.
1397
+
1398
+ var pending = payload;
1399
+ pending._status = Pending;
1400
+ pending._result = thenable;
1401
+ thenable.then(function (moduleObject) {
1402
+ if (payload._status === Pending) {
1403
+ var defaultExport = moduleObject.default;
1404
+
1405
+ {
1406
+ if (defaultExport === undefined) {
1407
+ error('lazy: Expected the result of a dynamic import() call. ' + 'Instead received: %s\n\nYour code should look like: \n ' + // Break up imports to avoid accidentally parsing them as dependencies.
1408
+ 'const MyComponent = lazy(() => imp' + "ort('./MyComponent'))", moduleObject);
1409
+ }
1410
+ } // Transition to the next state.
1411
+
1412
+
1413
+ var resolved = payload;
1414
+ resolved._status = Resolved;
1415
+ resolved._result = defaultExport;
1416
+ }
1417
+ }, function (error) {
1418
+ if (payload._status === Pending) {
1419
+ // Transition to the next state.
1420
+ var rejected = payload;
1421
+ rejected._status = Rejected;
1422
+ rejected._result = error;
1423
+ }
1424
+ });
1425
+ }
1426
+
1427
+ if (payload._status === Resolved) {
1428
+ return payload._result;
1429
+ } else {
1430
+ throw payload._result;
1431
+ }
1432
+ }
1433
+
1434
+ function lazy(ctor) {
1435
+ var payload = {
1436
+ // We use these fields to store the result.
1437
+ _status: -1,
1438
+ _result: ctor
1439
+ };
1440
+ var lazyType = {
1441
+ $$typeof: REACT_LAZY_TYPE,
1442
+ _payload: payload,
1443
+ _init: lazyInitializer
1444
+ };
1445
+
1446
+ {
1447
+ // In production, this would just set it on the object.
1448
+ var defaultProps;
1449
+ var propTypes; // $FlowFixMe
1450
+
1451
+ Object.defineProperties(lazyType, {
1452
+ defaultProps: {
1453
+ configurable: true,
1454
+ get: function () {
1455
+ return defaultProps;
1456
+ },
1457
+ set: function (newDefaultProps) {
1458
+ error('React.lazy(...): It is not supported to assign `defaultProps` to ' + 'a lazy component import. Either specify them where the component ' + 'is defined, or create a wrapping component around it.');
1459
+
1460
+ defaultProps = newDefaultProps; // Match production behavior more closely:
1461
+ // $FlowFixMe
1462
+
1463
+ Object.defineProperty(lazyType, 'defaultProps', {
1464
+ enumerable: true
1465
+ });
1466
+ }
1467
+ },
1468
+ propTypes: {
1469
+ configurable: true,
1470
+ get: function () {
1471
+ return propTypes;
1472
+ },
1473
+ set: function (newPropTypes) {
1474
+ error('React.lazy(...): It is not supported to assign `propTypes` to ' + 'a lazy component import. Either specify them where the component ' + 'is defined, or create a wrapping component around it.');
1475
+
1476
+ propTypes = newPropTypes; // Match production behavior more closely:
1477
+ // $FlowFixMe
1478
+
1479
+ Object.defineProperty(lazyType, 'propTypes', {
1480
+ enumerable: true
1481
+ });
1482
+ }
1483
+ }
1484
+ });
1485
+ }
1486
+
1487
+ return lazyType;
1488
+ }
1489
+
1490
+ function forwardRef(render) {
1491
+ {
1492
+ if (render != null && render.$$typeof === REACT_MEMO_TYPE) {
1493
+ error('forwardRef requires a render function but received a `memo` ' + 'component. Instead of forwardRef(memo(...)), use ' + 'memo(forwardRef(...)).');
1494
+ } else if (typeof render !== 'function') {
1495
+ error('forwardRef requires a render function but was given %s.', render === null ? 'null' : typeof render);
1496
+ } else {
1497
+ if (render.length !== 0 && render.length !== 2) {
1498
+ error('forwardRef render functions accept exactly two parameters: props and ref. %s', render.length === 1 ? 'Did you forget to use the ref parameter?' : 'Any additional parameter will be undefined.');
1499
+ }
1500
+ }
1501
+
1502
+ if (render != null) {
1503
+ if (render.defaultProps != null || render.propTypes != null) {
1504
+ error('forwardRef render functions do not support propTypes or defaultProps. ' + 'Did you accidentally pass a React component?');
1505
+ }
1506
+ }
1507
+ }
1508
+
1509
+ var elementType = {
1510
+ $$typeof: REACT_FORWARD_REF_TYPE,
1511
+ render: render
1512
+ };
1513
+
1514
+ {
1515
+ var ownName;
1516
+ Object.defineProperty(elementType, 'displayName', {
1517
+ enumerable: false,
1518
+ configurable: true,
1519
+ get: function () {
1520
+ return ownName;
1521
+ },
1522
+ set: function (name) {
1523
+ ownName = name;
1524
+
1525
+ if (render.displayName == null) {
1526
+ render.displayName = name;
1527
+ }
1528
+ }
1529
+ });
1530
+ }
1531
+
1532
+ return elementType;
1533
+ }
1534
+
1535
+ // Filter certain DOM attributes (e.g. src, href) if their values are empty strings.
1536
+
1537
+ var enableScopeAPI = false; // Experimental Create Event Handle API.
1538
+
1539
+ function isValidElementType(type) {
1540
+ if (typeof type === 'string' || typeof type === 'function') {
1541
+ return true;
1542
+ } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).
1543
+
1544
+
1545
+ if (type === exports.Fragment || type === exports.Profiler || type === REACT_DEBUG_TRACING_MODE_TYPE || type === exports.StrictMode || type === exports.Suspense || type === REACT_SUSPENSE_LIST_TYPE || type === REACT_LEGACY_HIDDEN_TYPE || enableScopeAPI ) {
1546
+ return true;
1547
+ }
1548
+
1549
+ if (typeof type === 'object' && type !== null) {
1550
+ 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 || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_BLOCK_TYPE || type[0] === REACT_SERVER_BLOCK_TYPE) {
1551
+ return true;
1552
+ }
1553
+ }
1554
+
1555
+ return false;
1556
+ }
1557
+
1558
+ function memo(type, compare) {
1559
+ {
1560
+ if (!isValidElementType(type)) {
1561
+ error('memo: The first argument must be a component. Instead ' + 'received: %s', type === null ? 'null' : typeof type);
1562
+ }
1563
+ }
1564
+
1565
+ var elementType = {
1566
+ $$typeof: REACT_MEMO_TYPE,
1567
+ type: type,
1568
+ compare: compare === undefined ? null : compare
1569
+ };
1570
+
1571
+ {
1572
+ var ownName;
1573
+ Object.defineProperty(elementType, 'displayName', {
1574
+ enumerable: false,
1575
+ configurable: true,
1576
+ get: function () {
1577
+ return ownName;
1578
+ },
1579
+ set: function (name) {
1580
+ ownName = name;
1581
+
1582
+ if (type.displayName == null) {
1583
+ type.displayName = name;
1584
+ }
1585
+ }
1586
+ });
1587
+ }
1588
+
1589
+ return elementType;
1590
+ }
1591
+
1592
+ function resolveDispatcher() {
1593
+ var dispatcher = ReactCurrentDispatcher.current;
1594
+
1595
+ if (!(dispatcher !== null)) {
1596
+ {
1597
+ throw Error( "Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem." );
1598
+ }
1599
+ }
1600
+
1601
+ return dispatcher;
1602
+ }
1603
+
1604
+ function useContext(Context, unstable_observedBits) {
1605
+ var dispatcher = resolveDispatcher();
1606
+
1607
+ {
1608
+ if (unstable_observedBits !== undefined) {
1609
+ error('useContext() second argument is reserved for future ' + 'use in React. Passing it is not supported. ' + 'You passed: %s.%s', unstable_observedBits, typeof unstable_observedBits === 'number' && Array.isArray(arguments[2]) ? '\n\nDid you call array.map(useContext)? ' + 'Calling Hooks inside a loop is not supported. ' + 'Learn more at https://reactjs.org/link/rules-of-hooks' : '');
1610
+ } // TODO: add a more generic warning for invalid values.
1611
+
1612
+
1613
+ if (Context._context !== undefined) {
1614
+ var realContext = Context._context; // Don't deduplicate because this legitimately causes bugs
1615
+ // and nobody should be using this in existing code.
1616
+
1617
+ if (realContext.Consumer === Context) {
1618
+ error('Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be ' + 'removed in a future major release. Did you mean to call useContext(Context) instead?');
1619
+ } else if (realContext.Provider === Context) {
1620
+ error('Calling useContext(Context.Provider) is not supported. ' + 'Did you mean to call useContext(Context) instead?');
1621
+ }
1622
+ }
1623
+ }
1624
+
1625
+ return dispatcher.useContext(Context, unstable_observedBits);
1626
+ }
1627
+ function useState(initialState) {
1628
+ var dispatcher = resolveDispatcher();
1629
+ return dispatcher.useState(initialState);
1630
+ }
1631
+ function useReducer(reducer, initialArg, init) {
1632
+ var dispatcher = resolveDispatcher();
1633
+ return dispatcher.useReducer(reducer, initialArg, init);
1634
+ }
1635
+ function useRef(initialValue) {
1636
+ var dispatcher = resolveDispatcher();
1637
+ return dispatcher.useRef(initialValue);
1638
+ }
1639
+ function useEffect(create, deps) {
1640
+ var dispatcher = resolveDispatcher();
1641
+ return dispatcher.useEffect(create, deps);
1642
+ }
1643
+ function useLayoutEffect(create, deps) {
1644
+ var dispatcher = resolveDispatcher();
1645
+ return dispatcher.useLayoutEffect(create, deps);
1646
+ }
1647
+ function useCallback(callback, deps) {
1648
+ var dispatcher = resolveDispatcher();
1649
+ return dispatcher.useCallback(callback, deps);
1650
+ }
1651
+ function useMemo(create, deps) {
1652
+ var dispatcher = resolveDispatcher();
1653
+ return dispatcher.useMemo(create, deps);
1654
+ }
1655
+ function useImperativeHandle(ref, create, deps) {
1656
+ var dispatcher = resolveDispatcher();
1657
+ return dispatcher.useImperativeHandle(ref, create, deps);
1658
+ }
1659
+ function useDebugValue(value, formatterFn) {
1660
+ {
1661
+ var dispatcher = resolveDispatcher();
1662
+ return dispatcher.useDebugValue(value, formatterFn);
1663
+ }
1664
+ }
1665
+
1666
+ // Helpers to patch console.logs to avoid logging during side-effect free
1667
+ // replaying on render function. This currently only patches the object
1668
+ // lazily which won't cover if the log function was extracted eagerly.
1669
+ // We could also eagerly patch the method.
1670
+ var disabledDepth = 0;
1671
+ var prevLog;
1672
+ var prevInfo;
1673
+ var prevWarn;
1674
+ var prevError;
1675
+ var prevGroup;
1676
+ var prevGroupCollapsed;
1677
+ var prevGroupEnd;
1678
+
1679
+ function disabledLog() {}
1680
+
1681
+ disabledLog.__reactDisabledLog = true;
1682
+ function disableLogs() {
1683
+ {
1684
+ if (disabledDepth === 0) {
1685
+ /* eslint-disable react-internal/no-production-logging */
1686
+ prevLog = console.log;
1687
+ prevInfo = console.info;
1688
+ prevWarn = console.warn;
1689
+ prevError = console.error;
1690
+ prevGroup = console.group;
1691
+ prevGroupCollapsed = console.groupCollapsed;
1692
+ prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099
1693
+
1694
+ var props = {
1695
+ configurable: true,
1696
+ enumerable: true,
1697
+ value: disabledLog,
1698
+ writable: true
1699
+ }; // $FlowFixMe Flow thinks console is immutable.
1700
+
1701
+ Object.defineProperties(console, {
1702
+ info: props,
1703
+ log: props,
1704
+ warn: props,
1705
+ error: props,
1706
+ group: props,
1707
+ groupCollapsed: props,
1708
+ groupEnd: props
1709
+ });
1710
+ /* eslint-enable react-internal/no-production-logging */
1711
+ }
1712
+
1713
+ disabledDepth++;
1714
+ }
1715
+ }
1716
+ function reenableLogs() {
1717
+ {
1718
+ disabledDepth--;
1719
+
1720
+ if (disabledDepth === 0) {
1721
+ /* eslint-disable react-internal/no-production-logging */
1722
+ var props = {
1723
+ configurable: true,
1724
+ enumerable: true,
1725
+ writable: true
1726
+ }; // $FlowFixMe Flow thinks console is immutable.
1727
+
1728
+ Object.defineProperties(console, {
1729
+ log: _assign({}, props, {
1730
+ value: prevLog
1731
+ }),
1732
+ info: _assign({}, props, {
1733
+ value: prevInfo
1734
+ }),
1735
+ warn: _assign({}, props, {
1736
+ value: prevWarn
1737
+ }),
1738
+ error: _assign({}, props, {
1739
+ value: prevError
1740
+ }),
1741
+ group: _assign({}, props, {
1742
+ value: prevGroup
1743
+ }),
1744
+ groupCollapsed: _assign({}, props, {
1745
+ value: prevGroupCollapsed
1746
+ }),
1747
+ groupEnd: _assign({}, props, {
1748
+ value: prevGroupEnd
1749
+ })
1750
+ });
1751
+ /* eslint-enable react-internal/no-production-logging */
1752
+ }
1753
+
1754
+ if (disabledDepth < 0) {
1755
+ error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');
1756
+ }
1757
+ }
1758
+ }
1759
+
1760
+ var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher;
1761
+ var prefix;
1762
+ function describeBuiltInComponentFrame(name, source, ownerFn) {
1763
+ {
1764
+ if (prefix === undefined) {
1765
+ // Extract the VM specific prefix used by each line.
1766
+ try {
1767
+ throw Error();
1768
+ } catch (x) {
1769
+ var match = x.stack.trim().match(/\n( *(at )?)/);
1770
+ prefix = match && match[1] || '';
1771
+ }
1772
+ } // We use the prefix to ensure our stacks line up with native stack frames.
1773
+
1774
+
1775
+ return '\n' + prefix + name;
1776
+ }
1777
+ }
1778
+ var reentry = false;
1779
+ var componentFrameCache;
1780
+
1781
+ {
1782
+ var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;
1783
+ componentFrameCache = new PossiblyWeakMap();
1784
+ }
1785
+
1786
+ function describeNativeComponentFrame(fn, construct) {
1787
+ // If something asked for a stack inside a fake render, it should get ignored.
1788
+ if (!fn || reentry) {
1789
+ return '';
1790
+ }
1791
+
1792
+ {
1793
+ var frame = componentFrameCache.get(fn);
1794
+
1795
+ if (frame !== undefined) {
1796
+ return frame;
1797
+ }
1798
+ }
1799
+
1800
+ var control;
1801
+ reentry = true;
1802
+ var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined.
1803
+
1804
+ Error.prepareStackTrace = undefined;
1805
+ var previousDispatcher;
1806
+
1807
+ {
1808
+ previousDispatcher = ReactCurrentDispatcher$1.current; // Set the dispatcher in DEV because this might be call in the render function
1809
+ // for warnings.
1810
+
1811
+ ReactCurrentDispatcher$1.current = null;
1812
+ disableLogs();
1813
+ }
1814
+
1815
+ try {
1816
+ // This should throw.
1817
+ if (construct) {
1818
+ // Something should be setting the props in the constructor.
1819
+ var Fake = function () {
1820
+ throw Error();
1821
+ }; // $FlowFixMe
1822
+
1823
+
1824
+ Object.defineProperty(Fake.prototype, 'props', {
1825
+ set: function () {
1826
+ // We use a throwing setter instead of frozen or non-writable props
1827
+ // because that won't throw in a non-strict mode function.
1828
+ throw Error();
1829
+ }
1830
+ });
1831
+
1832
+ if (typeof Reflect === 'object' && Reflect.construct) {
1833
+ // We construct a different control for this case to include any extra
1834
+ // frames added by the construct call.
1835
+ try {
1836
+ Reflect.construct(Fake, []);
1837
+ } catch (x) {
1838
+ control = x;
1839
+ }
1840
+
1841
+ Reflect.construct(fn, [], Fake);
1842
+ } else {
1843
+ try {
1844
+ Fake.call();
1845
+ } catch (x) {
1846
+ control = x;
1847
+ }
1848
+
1849
+ fn.call(Fake.prototype);
1850
+ }
1851
+ } else {
1852
+ try {
1853
+ throw Error();
1854
+ } catch (x) {
1855
+ control = x;
1856
+ }
1857
+
1858
+ fn();
1859
+ }
1860
+ } catch (sample) {
1861
+ // This is inlined manually because closure doesn't do it for us.
1862
+ if (sample && control && typeof sample.stack === 'string') {
1863
+ // This extracts the first frame from the sample that isn't also in the control.
1864
+ // Skipping one frame that we assume is the frame that calls the two.
1865
+ var sampleLines = sample.stack.split('\n');
1866
+ var controlLines = control.stack.split('\n');
1867
+ var s = sampleLines.length - 1;
1868
+ var c = controlLines.length - 1;
1869
+
1870
+ while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {
1871
+ // We expect at least one stack frame to be shared.
1872
+ // Typically this will be the root most one. However, stack frames may be
1873
+ // cut off due to maximum stack limits. In this case, one maybe cut off
1874
+ // earlier than the other. We assume that the sample is longer or the same
1875
+ // and there for cut off earlier. So we should find the root most frame in
1876
+ // the sample somewhere in the control.
1877
+ c--;
1878
+ }
1879
+
1880
+ for (; s >= 1 && c >= 0; s--, c--) {
1881
+ // Next we find the first one that isn't the same which should be the
1882
+ // frame that called our sample function and the control.
1883
+ if (sampleLines[s] !== controlLines[c]) {
1884
+ // In V8, the first line is describing the message but other VMs don't.
1885
+ // If we're about to return the first line, and the control is also on the same
1886
+ // line, that's a pretty good indicator that our sample threw at same line as
1887
+ // the control. I.e. before we entered the sample frame. So we ignore this result.
1888
+ // This can happen if you passed a class to function component, or non-function.
1889
+ if (s !== 1 || c !== 1) {
1890
+ do {
1891
+ s--;
1892
+ c--; // We may still have similar intermediate frames from the construct call.
1893
+ // The next one that isn't the same should be our match though.
1894
+
1895
+ if (c < 0 || sampleLines[s] !== controlLines[c]) {
1896
+ // V8 adds a "new" prefix for native classes. Let's remove it to make it prettier.
1897
+ var _frame = '\n' + sampleLines[s].replace(' at new ', ' at ');
1898
+
1899
+ {
1900
+ if (typeof fn === 'function') {
1901
+ componentFrameCache.set(fn, _frame);
1902
+ }
1903
+ } // Return the line we found.
1904
+
1905
+
1906
+ return _frame;
1907
+ }
1908
+ } while (s >= 1 && c >= 0);
1909
+ }
1910
+
1911
+ break;
1912
+ }
1913
+ }
1914
+ }
1915
+ } finally {
1916
+ reentry = false;
1917
+
1918
+ {
1919
+ ReactCurrentDispatcher$1.current = previousDispatcher;
1920
+ reenableLogs();
1921
+ }
1922
+
1923
+ Error.prepareStackTrace = previousPrepareStackTrace;
1924
+ } // Fallback to just using the name if we couldn't make it throw.
1925
+
1926
+
1927
+ var name = fn ? fn.displayName || fn.name : '';
1928
+ var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';
1929
+
1930
+ {
1931
+ if (typeof fn === 'function') {
1932
+ componentFrameCache.set(fn, syntheticFrame);
1933
+ }
1934
+ }
1935
+
1936
+ return syntheticFrame;
1937
+ }
1938
+ function describeFunctionComponentFrame(fn, source, ownerFn) {
1939
+ {
1940
+ return describeNativeComponentFrame(fn, false);
1941
+ }
1942
+ }
1943
+
1944
+ function shouldConstruct(Component) {
1945
+ var prototype = Component.prototype;
1946
+ return !!(prototype && prototype.isReactComponent);
1947
+ }
1948
+
1949
+ function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {
1950
+
1951
+ if (type == null) {
1952
+ return '';
1953
+ }
1954
+
1955
+ if (typeof type === 'function') {
1956
+ {
1957
+ return describeNativeComponentFrame(type, shouldConstruct(type));
1958
+ }
1959
+ }
1960
+
1961
+ if (typeof type === 'string') {
1962
+ return describeBuiltInComponentFrame(type);
1963
+ }
1964
+
1965
+ switch (type) {
1966
+ case exports.Suspense:
1967
+ return describeBuiltInComponentFrame('Suspense');
1968
+
1969
+ case REACT_SUSPENSE_LIST_TYPE:
1970
+ return describeBuiltInComponentFrame('SuspenseList');
1971
+ }
1972
+
1973
+ if (typeof type === 'object') {
1974
+ switch (type.$$typeof) {
1975
+ case REACT_FORWARD_REF_TYPE:
1976
+ return describeFunctionComponentFrame(type.render);
1977
+
1978
+ case REACT_MEMO_TYPE:
1979
+ // Memo may contain any component type so we recursively resolve it.
1980
+ return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);
1981
+
1982
+ case REACT_BLOCK_TYPE:
1983
+ return describeFunctionComponentFrame(type._render);
1984
+
1985
+ case REACT_LAZY_TYPE:
1986
+ {
1987
+ var lazyComponent = type;
1988
+ var payload = lazyComponent._payload;
1989
+ var init = lazyComponent._init;
1990
+
1991
+ try {
1992
+ // Lazy may contain any component type so we recursively resolve it.
1993
+ return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
1994
+ } catch (x) {}
1995
+ }
1996
+ }
1997
+ }
1998
+
1999
+ return '';
2000
+ }
2001
+
2002
+ var loggedTypeFailures = {};
2003
+ var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
2004
+
2005
+ function setCurrentlyValidatingElement(element) {
2006
+ {
2007
+ if (element) {
2008
+ var owner = element._owner;
2009
+ var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
2010
+ ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
2011
+ } else {
2012
+ ReactDebugCurrentFrame$1.setExtraStackFrame(null);
2013
+ }
2014
+ }
2015
+ }
2016
+
2017
+ function checkPropTypes(typeSpecs, values, location, componentName, element) {
2018
+ {
2019
+ // $FlowFixMe This is okay but Flow doesn't know it.
2020
+ var has = Function.call.bind(Object.prototype.hasOwnProperty);
2021
+
2022
+ for (var typeSpecName in typeSpecs) {
2023
+ if (has(typeSpecs, typeSpecName)) {
2024
+ var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to
2025
+ // fail the render phase where it didn't fail before. So we log it.
2026
+ // After these have been cleaned up, we'll let them throw.
2027
+
2028
+ try {
2029
+ // This is intentionally an invariant that gets caught. It's the same
2030
+ // behavior as without this statement except with a better message.
2031
+ if (typeof typeSpecs[typeSpecName] !== 'function') {
2032
+ 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`.');
2033
+ err.name = 'Invariant Violation';
2034
+ throw err;
2035
+ }
2036
+
2037
+ error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');
2038
+ } catch (ex) {
2039
+ error$1 = ex;
2040
+ }
2041
+
2042
+ if (error$1 && !(error$1 instanceof Error)) {
2043
+ setCurrentlyValidatingElement(element);
2044
+
2045
+ 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);
2046
+
2047
+ setCurrentlyValidatingElement(null);
2048
+ }
2049
+
2050
+ if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
2051
+ // Only monitor this failure once because there tends to be a lot of the
2052
+ // same error.
2053
+ loggedTypeFailures[error$1.message] = true;
2054
+ setCurrentlyValidatingElement(element);
2055
+
2056
+ error('Failed %s type: %s', location, error$1.message);
2057
+
2058
+ setCurrentlyValidatingElement(null);
2059
+ }
2060
+ }
2061
+ }
2062
+ }
2063
+ }
2064
+
2065
+ function setCurrentlyValidatingElement$1(element) {
2066
+ {
2067
+ if (element) {
2068
+ var owner = element._owner;
2069
+ var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
2070
+ setExtraStackFrame(stack);
2071
+ } else {
2072
+ setExtraStackFrame(null);
2073
+ }
2074
+ }
2075
+ }
2076
+
2077
+ var propTypesMisspellWarningShown;
2078
+
2079
+ {
2080
+ propTypesMisspellWarningShown = false;
2081
+ }
2082
+
2083
+ function getDeclarationErrorAddendum() {
2084
+ if (ReactCurrentOwner.current) {
2085
+ var name = getComponentName(ReactCurrentOwner.current.type);
2086
+
2087
+ if (name) {
2088
+ return '\n\nCheck the render method of `' + name + '`.';
2089
+ }
2090
+ }
2091
+
2092
+ return '';
2093
+ }
2094
+
2095
+ function getSourceInfoErrorAddendum(source) {
2096
+ if (source !== undefined) {
2097
+ var fileName = source.fileName.replace(/^.*[\\\/]/, '');
2098
+ var lineNumber = source.lineNumber;
2099
+ return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.';
2100
+ }
2101
+
2102
+ return '';
2103
+ }
2104
+
2105
+ function getSourceInfoErrorAddendumForProps(elementProps) {
2106
+ if (elementProps !== null && elementProps !== undefined) {
2107
+ return getSourceInfoErrorAddendum(elementProps.__source);
2108
+ }
2109
+
2110
+ return '';
2111
+ }
2112
+ /**
2113
+ * Warn if there's no key explicitly set on dynamic arrays of children or
2114
+ * object keys are not valid. This allows us to keep track of children between
2115
+ * updates.
2116
+ */
2117
+
2118
+
2119
+ var ownerHasKeyUseWarning = {};
2120
+
2121
+ function getCurrentComponentErrorInfo(parentType) {
2122
+ var info = getDeclarationErrorAddendum();
2123
+
2124
+ if (!info) {
2125
+ var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;
2126
+
2127
+ if (parentName) {
2128
+ info = "\n\nCheck the top-level render call using <" + parentName + ">.";
2129
+ }
2130
+ }
2131
+
2132
+ return info;
2133
+ }
2134
+ /**
2135
+ * Warn if the element doesn't have an explicit key assigned to it.
2136
+ * This element is in an array. The array could grow and shrink or be
2137
+ * reordered. All children that haven't already been validated are required to
2138
+ * have a "key" property assigned to it. Error statuses are cached so a warning
2139
+ * will only be shown once.
2140
+ *
2141
+ * @internal
2142
+ * @param {ReactElement} element Element that requires a key.
2143
+ * @param {*} parentType element's parent's type.
2144
+ */
2145
+
2146
+
2147
+ function validateExplicitKey(element, parentType) {
2148
+ if (!element._store || element._store.validated || element.key != null) {
2149
+ return;
2150
+ }
2151
+
2152
+ element._store.validated = true;
2153
+ var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
2154
+
2155
+ if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
2156
+ return;
2157
+ }
2158
+
2159
+ ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a
2160
+ // property, it may be the creator of the child that's responsible for
2161
+ // assigning it a key.
2162
+
2163
+ var childOwner = '';
2164
+
2165
+ if (element && element._owner && element._owner !== ReactCurrentOwner.current) {
2166
+ // Give the component that originally created this child.
2167
+ childOwner = " It was passed a child from " + getComponentName(element._owner.type) + ".";
2168
+ }
2169
+
2170
+ {
2171
+ setCurrentlyValidatingElement$1(element);
2172
+
2173
+ 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);
2174
+
2175
+ setCurrentlyValidatingElement$1(null);
2176
+ }
2177
+ }
2178
+ /**
2179
+ * Ensure that every element either is passed in a static location, in an
2180
+ * array with an explicit keys property defined, or in an object literal
2181
+ * with valid key property.
2182
+ *
2183
+ * @internal
2184
+ * @param {ReactNode} node Statically passed child of any type.
2185
+ * @param {*} parentType node's parent's type.
2186
+ */
2187
+
2188
+
2189
+ function validateChildKeys(node, parentType) {
2190
+ if (typeof node !== 'object') {
2191
+ return;
2192
+ }
2193
+
2194
+ if (Array.isArray(node)) {
2195
+ for (var i = 0; i < node.length; i++) {
2196
+ var child = node[i];
2197
+
2198
+ if (isValidElement(child)) {
2199
+ validateExplicitKey(child, parentType);
2200
+ }
2201
+ }
2202
+ } else if (isValidElement(node)) {
2203
+ // This element was passed in a valid location.
2204
+ if (node._store) {
2205
+ node._store.validated = true;
2206
+ }
2207
+ } else if (node) {
2208
+ var iteratorFn = getIteratorFn(node);
2209
+
2210
+ if (typeof iteratorFn === 'function') {
2211
+ // Entry iterators used to provide implicit keys,
2212
+ // but now we print a separate warning for them later.
2213
+ if (iteratorFn !== node.entries) {
2214
+ var iterator = iteratorFn.call(node);
2215
+ var step;
2216
+
2217
+ while (!(step = iterator.next()).done) {
2218
+ if (isValidElement(step.value)) {
2219
+ validateExplicitKey(step.value, parentType);
2220
+ }
2221
+ }
2222
+ }
2223
+ }
2224
+ }
2225
+ }
2226
+ /**
2227
+ * Given an element, validate that its props follow the propTypes definition,
2228
+ * provided by the type.
2229
+ *
2230
+ * @param {ReactElement} element
2231
+ */
2232
+
2233
+
2234
+ function validatePropTypes(element) {
2235
+ {
2236
+ var type = element.type;
2237
+
2238
+ if (type === null || type === undefined || typeof type === 'string') {
2239
+ return;
2240
+ }
2241
+
2242
+ var propTypes;
2243
+
2244
+ if (typeof type === 'function') {
2245
+ propTypes = type.propTypes;
2246
+ } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.
2247
+ // Inner props are checked in the reconciler.
2248
+ type.$$typeof === REACT_MEMO_TYPE)) {
2249
+ propTypes = type.propTypes;
2250
+ } else {
2251
+ return;
2252
+ }
2253
+
2254
+ if (propTypes) {
2255
+ // Intentionally inside to avoid triggering lazy initializers:
2256
+ var name = getComponentName(type);
2257
+ checkPropTypes(propTypes, element.props, 'prop', name, element);
2258
+ } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {
2259
+ propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers:
2260
+
2261
+ var _name = getComponentName(type);
2262
+
2263
+ error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown');
2264
+ }
2265
+
2266
+ if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {
2267
+ error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');
2268
+ }
2269
+ }
2270
+ }
2271
+ /**
2272
+ * Given a fragment, validate that it can only be provided with fragment props
2273
+ * @param {ReactElement} fragment
2274
+ */
2275
+
2276
+
2277
+ function validateFragmentProps(fragment) {
2278
+ {
2279
+ var keys = Object.keys(fragment.props);
2280
+
2281
+ for (var i = 0; i < keys.length; i++) {
2282
+ var key = keys[i];
2283
+
2284
+ if (key !== 'children' && key !== 'key') {
2285
+ setCurrentlyValidatingElement$1(fragment);
2286
+
2287
+ error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);
2288
+
2289
+ setCurrentlyValidatingElement$1(null);
2290
+ break;
2291
+ }
2292
+ }
2293
+
2294
+ if (fragment.ref !== null) {
2295
+ setCurrentlyValidatingElement$1(fragment);
2296
+
2297
+ error('Invalid attribute `ref` supplied to `React.Fragment`.');
2298
+
2299
+ setCurrentlyValidatingElement$1(null);
2300
+ }
2301
+ }
2302
+ }
2303
+ function createElementWithValidation(type, props, children) {
2304
+ var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to
2305
+ // succeed and there will likely be errors in render.
2306
+
2307
+ if (!validType) {
2308
+ var info = '';
2309
+
2310
+ if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
2311
+ 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.";
2312
+ }
2313
+
2314
+ var sourceInfo = getSourceInfoErrorAddendumForProps(props);
2315
+
2316
+ if (sourceInfo) {
2317
+ info += sourceInfo;
2318
+ } else {
2319
+ info += getDeclarationErrorAddendum();
2320
+ }
2321
+
2322
+ var typeString;
2323
+
2324
+ if (type === null) {
2325
+ typeString = 'null';
2326
+ } else if (Array.isArray(type)) {
2327
+ typeString = 'array';
2328
+ } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {
2329
+ typeString = "<" + (getComponentName(type.type) || 'Unknown') + " />";
2330
+ info = ' Did you accidentally export a JSX literal instead of a component?';
2331
+ } else {
2332
+ typeString = typeof type;
2333
+ }
2334
+
2335
+ {
2336
+ error('React.createElement: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);
2337
+ }
2338
+ }
2339
+
2340
+ var element = createElement.apply(this, arguments); // The result can be nullish if a mock or a custom function is used.
2341
+ // TODO: Drop this when these are no longer allowed as the type argument.
2342
+
2343
+ if (element == null) {
2344
+ return element;
2345
+ } // Skip key warning if the type isn't valid since our key validation logic
2346
+ // doesn't expect a non-string/function type and can throw confusing errors.
2347
+ // We don't want exception behavior to differ between dev and prod.
2348
+ // (Rendering will throw with a helpful message and as soon as the type is
2349
+ // fixed, the key warnings will appear.)
2350
+
2351
+
2352
+ if (validType) {
2353
+ for (var i = 2; i < arguments.length; i++) {
2354
+ validateChildKeys(arguments[i], type);
2355
+ }
2356
+ }
2357
+
2358
+ if (type === exports.Fragment) {
2359
+ validateFragmentProps(element);
2360
+ } else {
2361
+ validatePropTypes(element);
2362
+ }
2363
+
2364
+ return element;
2365
+ }
2366
+ var didWarnAboutDeprecatedCreateFactory = false;
2367
+ function createFactoryWithValidation(type) {
2368
+ var validatedFactory = createElementWithValidation.bind(null, type);
2369
+ validatedFactory.type = type;
2370
+
2371
+ {
2372
+ if (!didWarnAboutDeprecatedCreateFactory) {
2373
+ didWarnAboutDeprecatedCreateFactory = true;
2374
+
2375
+ warn('React.createFactory() is deprecated and will be removed in ' + 'a future major release. Consider using JSX ' + 'or use React.createElement() directly instead.');
2376
+ } // Legacy hook: remove it
2377
+
2378
+
2379
+ Object.defineProperty(validatedFactory, 'type', {
2380
+ enumerable: false,
2381
+ get: function () {
2382
+ warn('Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.');
2383
+
2384
+ Object.defineProperty(this, 'type', {
2385
+ value: type
2386
+ });
2387
+ return type;
2388
+ }
2389
+ });
2390
+ }
2391
+
2392
+ return validatedFactory;
2393
+ }
2394
+ function cloneElementWithValidation(element, props, children) {
2395
+ var newElement = cloneElement.apply(this, arguments);
2396
+
2397
+ for (var i = 2; i < arguments.length; i++) {
2398
+ validateChildKeys(arguments[i], newElement.type);
2399
+ }
2400
+
2401
+ validatePropTypes(newElement);
2402
+ return newElement;
2403
+ }
2404
+
2405
+ {
2406
+
2407
+ try {
2408
+ var frozenObject = Object.freeze({});
2409
+ /* eslint-disable no-new */
2410
+
2411
+ new Map([[frozenObject, null]]);
2412
+ new Set([frozenObject]);
2413
+ /* eslint-enable no-new */
2414
+ } catch (e) {
2415
+ }
2416
+ }
2417
+
2418
+ var createElement$1 = createElementWithValidation ;
2419
+ var cloneElement$1 = cloneElementWithValidation ;
2420
+ var createFactory = createFactoryWithValidation ;
2421
+ var Children = {
2422
+ map: mapChildren,
2423
+ forEach: forEachChildren,
2424
+ count: countChildren,
2425
+ toArray: toArray,
2426
+ only: onlyChild
2427
+ };
2428
+
2429
+ exports.Children = Children;
2430
+ exports.Component = Component;
2431
+ exports.PureComponent = PureComponent;
2432
+ exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ReactSharedInternals;
2433
+ exports.cloneElement = cloneElement$1;
2434
+ exports.createContext = createContext;
2435
+ exports.createElement = createElement$1;
2436
+ exports.createFactory = createFactory;
2437
+ exports.createRef = createRef;
2438
+ exports.forwardRef = forwardRef;
2439
+ exports.isValidElement = isValidElement;
2440
+ exports.lazy = lazy;
2441
+ exports.memo = memo;
2442
+ exports.useCallback = useCallback;
2443
+ exports.useContext = useContext;
2444
+ exports.useDebugValue = useDebugValue;
2445
+ exports.useEffect = useEffect;
2446
+ exports.useImperativeHandle = useImperativeHandle;
2447
+ exports.useLayoutEffect = useLayoutEffect;
2448
+ exports.useMemo = useMemo;
2449
+ exports.useReducer = useReducer;
2450
+ exports.useRef = useRef;
2451
+ exports.useState = useState;
2452
+ exports.version = ReactVersion;
2453
+ })();
2454
+ }
2455
+ }(react_development));
2456
+
2457
+ if (process.env.NODE_ENV === 'production') {
2458
+ react.exports = react_production_min;
2459
+ } else {
2460
+ react.exports = react_development;
2461
+ }
2462
+
2463
+ var React = react.exports;
2464
+
2465
+ function styleInject(css, ref) {
2466
+ if ( ref === void 0 ) ref = {};
2467
+ var insertAt = ref.insertAt;
2468
+
2469
+ if (!css || typeof document === 'undefined') { return; }
2470
+
2471
+ var head = document.head || document.getElementsByTagName('head')[0];
2472
+ var style = document.createElement('style');
2473
+ style.type = 'text/css';
2474
+
2475
+ if (insertAt === 'top') {
2476
+ if (head.firstChild) {
2477
+ head.insertBefore(style, head.firstChild);
2478
+ } else {
2479
+ head.appendChild(style);
2480
+ }
2481
+ } else {
2482
+ head.appendChild(style);
2483
+ }
2484
+
2485
+ if (style.styleSheet) {
2486
+ style.styleSheet.cssText = css;
2487
+ } else {
2488
+ style.appendChild(document.createTextNode(css));
2489
+ }
2490
+ }
2491
+
2492
+ var css_248z$c = ".DxAccordion_dx-accordion__1T5zT {\n margin: 0; }\n .DxAccordion_dx-accordion__1T5zT .DxAccordion_accordion-heading__1QXkT {\n border-width: 0 0 1px 0;\n border-style: solid;\n border-color: #bfd4e4;\n font-style: normal;\n font-weight: bold;\n font-size: 14px;\n line-height: 14px;\n color: #54565a;\n padding: 13px 20px;\n display: flex;\n flex-flow: row nowrap;\n justify-content: space-between;\n align-items: center;\n cursor: pointer; }\n .DxAccordion_dx-accordion__1T5zT .DxAccordion_accordion-heading__1QXkT .DxAccordion_icon__3_rrp {\n line-height: 0; }\n .DxAccordion_dx-accordion__1T5zT .DxAccordion_accordion-content__Yl2U7 {\n padding: 13px 20px 20px 20px;\n border-bottom: 1px solid #bfd4e4; }\n .DxAccordion_dx-accordion__1T5zT .DxAccordion_accordion-content__Yl2U7 *:first-child {\n margin-top: 0; }\n .DxAccordion_dx-accordion__1T5zT .DxAccordion_accordion-content__Yl2U7 *:last-child {\n margin-bottom: 0; }\n";
2493
+ styleInject(css_248z$c);
2494
+
2495
+ function DxAccordion(props) {
2496
+ var _a = react.exports.useState(props.showOpen || false), isOpen = _a[0], setIsOpen = _a[1];
2497
+ return (React.createElement("div", { className: 'dx-accordion' },
2498
+ React.createElement("div", { className: 'accordion-heading', onClick: function () { return setIsOpen(!isOpen); } },
2499
+ props.title,
2500
+ " ",
2501
+ React.createElement(genesysDevIcons.GenesysDevIcon, { icon: isOpen ? genesysDevIcons.GenesysDevIcons.AppChevronUp : genesysDevIcons.GenesysDevIcons.AppChevronDown })),
2502
+ isOpen ? React.createElement("div", { className: 'accordion-content' }, props.children) : undefined));
2503
+ }
2504
+
2505
+ var css_248z$b = ".DxAccordionGroup_dx-accordion-group__37aPZ {\n margin: 40px 0; }\n";
2506
+ styleInject(css_248z$b);
2507
+
2508
+ function DxAccordionGroup(props) {
2509
+ return React.createElement("div", { className: 'dx-accordion-group' }, props.children);
2510
+ }
2511
+
2512
+ var css_248z$a = ".DxButton_dx-button__2ur-Y {\n margin: 15px 10px;\n border-radius: 2px;\n padding: 8px 15px;\n cursor: pointer;\n font-weight: 500; }\n .DxButton_dx-button-primary__3e__r {\n color: #ffffff;\n border: 1px solid #419bb2;\n background-color: #419bb2; }\n .DxButton_dx-button-primary__3e__r:hover {\n background-color: #317b8d;\n border-color: #317b8d;\n transition: 0.1s; }\n .DxButton_dx-button-primary__3e__r:focus {\n background-color: #419bb2;\n border-color: #419bb2;\n box-shadow: 0 0 0 2px #aac9ff;\n transition: 0.1s; }\n .DxButton_dx-button-primary__3e__r:disabled {\n background-color: #9aafb540;\n border-color: #9aafb540;\n transition: 0.1s; }\n .DxButton_dx-button-secondary__2ZG1b {\n color: #419bb2;\n border: 1px solid #419bb2;\n background-color: #ffffff; }\n .DxButton_dx-button-secondary__2ZG1b:hover {\n color: #317b8d;\n border-color: #317b8d;\n transition: 0.1s; }\n .DxButton_dx-button-secondary__2ZG1b:focus {\n color: #419bb2;\n border-color: #419bb2;\n box-shadow: 0 0 0 2px #aac9ff;\n transition: 0.1s; }\n .DxButton_dx-button-secondary__2ZG1b:disabled {\n color: #8a9a9e;\n background-color: #e0e6e8;\n border-color: #e0e6e8;\n transition: 0.1s; }\n";
2513
+ styleInject(css_248z$a);
2514
+
2515
+ function DxButton(props) {
2516
+ var classNames = ['dx-button'];
2517
+ classNames.push("dx-button-".concat(props.type || 'primary'));
2518
+ if (props.className)
2519
+ classNames.push(props.className);
2520
+ var handleClick = function (e) {
2521
+ if (!props.onClick)
2522
+ return;
2523
+ e.preventDefault();
2524
+ e.stopPropagation();
2525
+ props.onClick();
2526
+ };
2527
+ return (React.createElement("button", { className: classNames.join(' '), type: 'button', onClick: handleClick, disabled: props.disabled === true }, props.children));
2528
+ }
2529
+
2530
+ /*! *****************************************************************************
2531
+ Copyright (c) Microsoft Corporation.
2532
+
2533
+ Permission to use, copy, modify, and/or distribute this software for any
2534
+ purpose with or without fee is hereby granted.
2535
+
2536
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
2537
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
2538
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
2539
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
2540
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
2541
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
2542
+ PERFORMANCE OF THIS SOFTWARE.
2543
+ ***************************************************************************** */
2544
+
2545
+ function __spreadArray(to, from, pack) {
2546
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
2547
+ if (ar || !(i in from)) {
2548
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
2549
+ ar[i] = from[i];
2550
+ }
2551
+ }
2552
+ return to.concat(ar || Array.prototype.slice.call(from));
2553
+ }
2554
+
2555
+ // Unique ID creation requires a high quality random # generator. In the browser we therefore
2556
+ // require the crypto API and do not support built-in fallback to lower quality random number
2557
+ // generators (like Math.random()).
2558
+ var getRandomValues;
2559
+ var rnds8 = new Uint8Array(16);
2560
+ function rng() {
2561
+ // lazy load so that environments that need to polyfill have a chance to do so
2562
+ if (!getRandomValues) {
2563
+ // getRandomValues needs to be invoked in a context where "this" is a Crypto implementation. Also,
2564
+ // find the complete implementation of crypto (msCrypto) on IE11.
2565
+ getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto !== 'undefined' && typeof msCrypto.getRandomValues === 'function' && msCrypto.getRandomValues.bind(msCrypto);
2566
+
2567
+ if (!getRandomValues) {
2568
+ throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
2569
+ }
2570
+ }
2571
+
2572
+ return getRandomValues(rnds8);
2573
+ }
2574
+
2575
+ var REGEX = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;
2576
+
2577
+ function validate(uuid) {
2578
+ return typeof uuid === 'string' && REGEX.test(uuid);
2579
+ }
2580
+
2581
+ /**
2582
+ * Convert array of 16 byte values to UUID string format of the form:
2583
+ * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
2584
+ */
2585
+
2586
+ var byteToHex = [];
2587
+
2588
+ for (var i = 0; i < 256; ++i) {
2589
+ byteToHex.push((i + 0x100).toString(16).substr(1));
2590
+ }
2591
+
2592
+ function stringify(arr) {
2593
+ var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
2594
+ // Note: Be careful editing this code! It's been tuned for performance
2595
+ // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
2596
+ var uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one
2597
+ // of the following:
2598
+ // - One or more input array values don't map to a hex octet (leading to
2599
+ // "undefined" in the uuid)
2600
+ // - Invalid input values for the RFC `version` or `variant` fields
2601
+
2602
+ if (!validate(uuid)) {
2603
+ throw TypeError('Stringified UUID is invalid');
2604
+ }
2605
+
2606
+ return uuid;
2607
+ }
2608
+
2609
+ function v4(options, buf, offset) {
2610
+ options = options || {};
2611
+ var rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
2612
+
2613
+ rnds[6] = rnds[6] & 0x0f | 0x40;
2614
+ rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
2615
+
2616
+ if (buf) {
2617
+ offset = offset || 0;
2618
+
2619
+ for (var i = 0; i < 16; ++i) {
2620
+ buf[offset + i] = rnds[i];
2621
+ }
2622
+
2623
+ return buf;
2624
+ }
2625
+
2626
+ return stringify(rnds);
2627
+ }
2628
+
2629
+ var css_248z$9 = ".DxItemGroup_dx-item-group__ozNLt {\n display: block;\n border: 0;\n margin: 0;\n padding: 0; }\n .DxItemGroup_dx-item-group__ozNLt label {\n display: flex;\n flex-flow: row nowrap;\n align-items: center;\n margin: 15px 0; }\n .DxItemGroup_dx-item-group__ozNLt label:first-of-type {\n margin-top: 0; }\n .DxItemGroup_dx-item-group__ozNLt label .DxItemGroup_label-text__2EYeh {\n font-family: Roboto;\n font-style: normal;\n font-weight: normal;\n font-size: 12px;\n line-height: 18px;\n color: #75757a; }\n";
2630
+ styleInject(css_248z$9);
2631
+
2632
+ var css_248z$8 = ".checkbox_dx-item-group__3pTki input[type='checkbox'] {\n -webkit-appearance: none;\n appearance: none;\n margin: 0 8px 0 0;\n width: 16px;\n height: 16px;\n border: 1px solid #8a96a3;\n border-radius: 2px;\n background-color: #ffffff;\n flex-shrink: 0; }\n\n.checkbox_dx-item-group__3pTki input[type='checkbox']::before {\n display: none; }\n\n.checkbox_dx-item-group__3pTki input[type='checkbox']:checked {\n background-color: #8a96a3; }\n\n.checkbox_dx-item-group__3pTki input[type='checkbox']:checked::before {\n display: block;\n position: relative;\n top: 7px;\n left: 3px;\n font-size: 9px;\n line-height: 0;\n color: #ffffff;\n content: '\\f103';\n font-family: genesys-dev-icons !important;\n font-style: normal;\n font-weight: normal !important;\n font-feature-settings: normal;\n font-variant: normal;\n text-transform: none;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale; }\n\n.checkbox_dx-item-group__3pTki input[type='checkbox']:not(:disabled):hover {\n border-color: #4d5061; }\n\n.checkbox_dx-item-group__3pTki input[type='checkbox']:not(:disabled):focus {\n outline: #aac9ff solid 2px; }\n\n.checkbox_dx-item-group__3pTki input[type='checkbox']:not(:disabled):focus-visible {\n outline: 0; }\n";
2633
+ styleInject(css_248z$8);
2634
+
2635
+ var css_248z$7 = ".radiobutton_dx-item-group__3Bq3q input[type='radio'] {\n -webkit-appearance: none;\n appearance: none;\n margin: 0 8px 0 0;\n width: 16px;\n height: 16px;\n border: 1px solid #8a96a3;\n border-radius: 8px;\n background-color: #ffffff;\n flex-shrink: 0; }\n\n.radiobutton_dx-item-group__3Bq3q input[type='radio']::before {\n display: none; }\n\n.radiobutton_dx-item-group__3Bq3q input[type='radio']:checked::before {\n content: '';\n display: block;\n width: 10px;\n height: 10px;\n border-radius: 8px;\n position: relative;\n top: 2px;\n left: 2px;\n background-color: #8a96a3; }\n\n.radiobutton_dx-item-group__3Bq3q input[type='radio']:not(:disabled):hover {\n border-color: #4d5061; }\n\n.radiobutton_dx-item-group__3Bq3q input[type='radio']:not(:disabled):focus {\n outline: #aac9ff solid 2px; }\n\n.radiobutton_dx-item-group__3Bq3q input[type='radio']:not(:disabled):focus-visible {\n outline: 0; }\n";
2636
+ styleInject(css_248z$7);
2637
+
2638
+ var css_248z$6 = ".dropdown_dx-select-group__1mcKQ {\n appearance: none;\n position: relative; }\n .dropdown_dx-select-group__1mcKQ select {\n border: 1px solid #8a96a3;\n border-radius: 2px;\n background-color: #ffffff;\n font-style: normal;\n font-weight: 300;\n font-size: 12px;\n line-height: 14px;\n color: #75757a;\n padding: 8px 32px 8px 12px;\n width: 100%;\n appearance: none; }\n .dropdown_dx-select-group__1mcKQ select:focus-visible {\n outline: 2px solid #aac9ff; }\n .dropdown_dx-select-group__1mcKQ select option {\n background: #aac9ff -webkit-linear-gradient(bottom, #aac9ff 0%, #aac9ff 100%); }\n .dropdown_dx-select-group__1mcKQ::after {\n position: absolute;\n bottom: 12px;\n right: 12px;\n content: '\\f104';\n font-size: 8px;\n font-family: genesys-dev-icons !important;\n font-style: normal;\n font-weight: normal !important;\n font-feature-settings: normal;\n font-variant: normal;\n text-transform: none;\n line-height: 1;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n pointer-events: none; }\n";
2639
+ styleInject(css_248z$6);
2640
+
2641
+ var css_248z$5 = ".multiselect_dx-multiselect-group__mjN0v {\n appearance: none;\n position: relative; }\n .multiselect_dx-multiselect-group__mjN0v select {\n border: 1px solid #8a96a3;\n border-radius: 2px;\n background-color: #ffffff;\n font-style: normal;\n font-weight: 300;\n font-size: 12px;\n line-height: 14px;\n color: #75757a;\n width: 100%;\n appearance: none;\n scrollbar-color: #b0b2b5 transparent; }\n .multiselect_dx-multiselect-group__mjN0v select:focus-visible {\n outline: 2px solid #aac9ff; }\n .multiselect_dx-multiselect-group__mjN0v select option {\n overflow: hidden;\n white-space: pre;\n text-overflow: ellipsis;\n -webkit-appearance: none;\n font-style: normal;\n font-weight: 300;\n font-size: 12px;\n line-height: 31px;\n padding: 8px 12px;\n color: #75757a; }\n .multiselect_dx-multiselect-group__mjN0v select option:checked {\n background: #aac9ff -webkit-linear-gradient(bottom, #aac9ff 0%, #aac9ff 100%); }\n .multiselect_dx-multiselect-group__mjN0v select::-webkit-scrollbar {\n -webkit-appearance: none;\n width: 7px;\n height: 7px; }\n .multiselect_dx-multiselect-group__mjN0v select::-webkit-scrollbar-thumb {\n border-radius: 4px;\n background-color: #b0b2b5; }\n .multiselect_dx-multiselect-group__mjN0v select::-webkit-scrollbar-corner {\n background: transparent; }\n";
2642
+ styleInject(css_248z$5);
2643
+
2644
+ var css_248z$4 = ".DxLabel_dx-label__1oz8P {\n margin: 20px 0;\n display: block; }\n .DxLabel_dx-label__1oz8P .DxLabel_label-text__2expn,\n .DxLabel_dx-label__1oz8P .DxLabel_input-description__3bv8Y {\n display: block;\n font-family: Roboto;\n font-style: normal;\n font-weight: 400;\n font-size: 12px;\n line-height: 14px;\n color: #75757a; }\n .DxLabel_dx-label__1oz8P .DxLabel_label-text__2expn {\n margin: 0 0 4px 0; }\n .DxLabel_dx-label__1oz8P .DxLabel_input-description__3bv8Y {\n padding: 6px 20px;\n display: flex;\n flex-flow: row nowrap;\n gap: 8px; }\n .DxLabel_dx-label__1oz8P .DxLabel_input-description__3bv8Y .DxLabel_icon__20FqS {\n color: #597393;\n line-height: 0; }\n";
2645
+ styleInject(css_248z$4);
2646
+
2647
+ function DxLabel(props) {
2648
+ var hasLabel = props.label && props.label !== '';
2649
+ var description = props.description ? (React.createElement("div", { className: 'input-description' },
2650
+ React.createElement(genesysDevIcons.GenesysDevIcon, { icon: genesysDevIcons.GenesysDevIcons.AppInfoSolid }),
2651
+ React.createElement("span", null, props.description))) : undefined;
2652
+ if (props.useFieldset) {
2653
+ return (React.createElement("fieldset", { className: 'dx-label ' + props.className || '' },
2654
+ props.label ? React.createElement("legend", { className: 'label-text' }, props.label) : undefined,
2655
+ props.children,
2656
+ description));
2657
+ }
2658
+ return (React.createElement("label", { className: 'dx-label ' + props.className || '' },
2659
+ hasLabel ? React.createElement("span", { className: 'label-text' }, props.label) : undefined,
2660
+ props.children,
2661
+ description));
2662
+ }
2663
+
2664
+ function DxItemGroup(props) {
2665
+ var _a = react.exports.useState(props.items.map(function (item) {
2666
+ return { item: item, isSelected: false };
2667
+ })), data = _a[0], setData = _a[1];
2668
+ var id = react.exports.useState(v4())[0];
2669
+ // data changed
2670
+ react.exports.useEffect(function () {
2671
+ if (props.onItemsChanged)
2672
+ props.onItemsChanged(data);
2673
+ // eslint-disable-next-line react-hooks/exhaustive-deps
2674
+ }, [data]);
2675
+ // Handle checkbox changed
2676
+ var onChange = function (idx, item, e) {
2677
+ if (props.onItemChanged)
2678
+ props.onItemChanged(item, e.target.checked);
2679
+ var newData = __spreadArray([], data, true);
2680
+ // Unselect everything if it's radio buttons
2681
+ if (props.format === 'radio')
2682
+ newData.forEach(function (value) { return (value.isSelected = false); });
2683
+ // Set the selected state of the new item
2684
+ newData[idx].isSelected = e.target.checked;
2685
+ setData(newData);
2686
+ };
2687
+ switch (props.format) {
2688
+ case 'multiselect':
2689
+ case 'dropdown': {
2690
+ return (React.createElement(DxLabel, { label: props.title, description: props.description },
2691
+ React.createElement("div", { className: "dx-item-group".concat(props.format === 'multiselect' ? ' dx-multiselect-group' : ' dx-select-group') },
2692
+ React.createElement("select", { multiple: props.format === 'multiselect' }, data.map(function (d, i) { return (React.createElement("option", { key: i, value: d.item.value }, d.item.label)); })))));
2693
+ }
2694
+ case 'checkbox':
2695
+ case 'radio':
2696
+ default: {
2697
+ return (React.createElement(DxLabel, { label: props.title, description: props.description, className: 'dx-item-group', useFieldset: true }, data.map(function (d, i) { return (React.createElement("label", { key: i },
2698
+ React.createElement("input", { type: props.format, name: props.format === 'checkbox' ? "".concat(id, "-").concat(i) : id, id: d.item.label, value: d.item.value, checked: d.isSelected, onChange: function (e) { return onChange(i, d.item, e); } }),
2699
+ React.createElement("span", { className: 'label-text' }, d.item.label))); })));
2700
+ }
2701
+ }
2702
+ }
2703
+
2704
+ var css_248z$3 = ".DxTabbedContent_dx-tabbed-content__3SJb- {\n margin: 40px 0; }\n .DxTabbedContent_dx-tabbed-content__3SJb- .DxTabbedContent_tab-titles__1ibYk {\n border-bottom: 1px solid #bfd4e4;\n font-weight: normal;\n font-size: 14px;\n line-height: 20px; }\n .DxTabbedContent_dx-tabbed-content__3SJb- .DxTabbedContent_tab-titles__1ibYk .DxTabbedContent_tab-title__Ii3ai {\n display: inline-block;\n padding: 5px 20px;\n border-bottom: 1px solid transparent;\n cursor: pointer; }\n .DxTabbedContent_dx-tabbed-content__3SJb- .DxTabbedContent_tab-titles__1ibYk .DxTabbedContent_tab-title__Ii3ai.DxTabbedContent_active__3GXCy {\n border-bottom-color: #597393;\n font-weight: bold; }\n .DxTabbedContent_dx-tabbed-content__3SJb- .DxTabbedContent_tab-titles__1ibYk .DxTabbedContent_tab-title__Ii3ai p {\n margin: 0;\n display: inline; }\n .DxTabbedContent_dx-tabbed-content__3SJb- .DxTabbedContent_tab-content__1V8mt {\n padding: 13px 20px 20px 20px;\n border-bottom: 1px solid #bfd4e4; }\n .DxTabbedContent_dx-tabbed-content__3SJb- .DxTabbedContent_tab-content__1V8mt *:first-child {\n margin-top: 0; }\n .DxTabbedContent_dx-tabbed-content__3SJb- .DxTabbedContent_tab-content__1V8mt *:last-child {\n margin-bottom: 0; }\n";
2705
+ styleInject(css_248z$3);
2706
+
2707
+ function DxTabbedContent(props) {
2708
+ var _a = react.exports.useState(props.initialTabId || 0), activeTab = _a[0], setActiveTab = _a[1];
2709
+ var titles = react.exports.useState(
2710
+ // Scrape titles from child elements
2711
+ React.Children.toArray(props.children).map(function (child) {
2712
+ if (!child || !child.props || !child.props.title)
2713
+ return 'Unknown title';
2714
+ return child.props.title;
2715
+ }))[0];
2716
+ return (React.createElement("div", { className: 'dx-tabbed-content' },
2717
+ React.createElement("div", { className: 'tab-titles' }, titles.map(function (title, i) { return (React.createElement("span", { key: i, className: "tab-title".concat(i === activeTab ? ' active' : ''), onClick: function () { return setActiveTab(i); } }, title)); })),
2718
+ React.createElement("div", { className: 'tab-content' }, React.Children.toArray(props.children)[activeTab])));
2719
+ }
2720
+
2721
+ var css_248z$2 = "";
2722
+ styleInject(css_248z$2);
2723
+
2724
+ function DxTabPanel(props) {
2725
+ return React.createElement("div", { className: 'dx-tab-panel' }, props.children);
2726
+ }
2727
+
2728
+ var css_248z$1 = ".DxTextbox_dx-textbox__wFxOx {\n display: flex;\n flex-flow: row nowrap;\n justify-content: space-between;\n align-items: center;\n gap: 10px;\n border: 1px solid #c6cbd1;\n border-radius: 2px;\n margin: 0;\n padding: 0 10px;\n height: 32px; }\n .DxTextbox_dx-textbox__wFxOx.DxTextbox_with-label__3hgLC {\n margin-top: 0; }\n .DxTextbox_dx-textbox__wFxOx:focus-within {\n outline: #aac9ff solid 2px; }\n .DxTextbox_dx-textbox__wFxOx .DxTextbox_icon__3ysoe {\n display: block;\n flex: none;\n color: #75757a; }\n .DxTextbox_dx-textbox__wFxOx .DxTextbox_icon__3ysoe.DxTextbox_input-icon__3FUqW {\n font-size: 14px;\n line-height: 0; }\n .DxTextbox_dx-textbox__wFxOx .DxTextbox_icon__3ysoe.DxTextbox_clear-icon__3OXVK {\n font-size: 11px;\n line-height: 0;\n cursor: pointer;\n padding: 4px;\n margin-right: -4px; }\n .DxTextbox_dx-textbox__wFxOx input {\n flex-grow: 1;\n border: 0;\n background: #ffffff;\n box-sizing: border-box;\n height: 32px;\n width: 100%;\n padding: 0;\n margin: 0;\n font-family: Roboto;\n font-style: normal;\n font-weight: normal;\n font-size: 14px;\n line-height: 16px;\n color: #272d2d; }\n .DxTextbox_dx-textbox__wFxOx input:focus-visible {\n outline: 0; }\n .DxTextbox_dx-textbox__wFxOx input::placeholder {\n font-family: Roboto;\n font-style: normal;\n font-weight: 300;\n font-size: 14px;\n line-height: 16px;\n color: #757576; }\n";
2729
+ styleInject(css_248z$1);
2730
+
2731
+ function DxTextbox(props) {
2732
+ var _a = react.exports.useState(props.changeDebounceMs || 300), debounceMs = _a[0], setDebounceMs = _a[1];
2733
+ var _b = react.exports.useState(props.initialValue || ''), value = _b[0], setValue = _b[1];
2734
+ var _c = react.exports.useState(false), isFocused = _c[0], setIsFocused = _c[1];
2735
+ var _d = react.exports.useState(Date.now()), escapePressed = _d[0], setEscapePressed = _d[1];
2736
+ var _e = react.exports.useState(undefined), step = _e[0], setStep = _e[1];
2737
+ var _f = react.exports.useState(undefined), timer = _f[0], setTimer = _f[1];
2738
+ // Constructor
2739
+ react.exports.useEffect(function () {
2740
+ // Register global key bindings
2741
+ document.addEventListener('keydown', globalKeyBindings, false);
2742
+ return function () {
2743
+ document.removeEventListener('keydown', globalKeyBindings, false);
2744
+ };
2745
+ }, []);
2746
+ // Escape pressed
2747
+ react.exports.useEffect(function () {
2748
+ var _a;
2749
+ if (!isFocused)
2750
+ return;
2751
+ setValue('');
2752
+ (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.blur();
2753
+ // eslint-disable-next-line react-hooks/exhaustive-deps
2754
+ }, [escapePressed]);
2755
+ // Value changed
2756
+ react.exports.useEffect(function () {
2757
+ if (props.inputType === 'decimal') {
2758
+ // Normalize step setting
2759
+ if (!isNaN(parseFloat(value))) {
2760
+ var match = /\.(.+)/.exec(value);
2761
+ console.log(match);
2762
+ if (match) {
2763
+ var s = "0.".concat(Array.apply(null, Array(match[1].length - 1))
2764
+ .map(function () { return '0'; })
2765
+ .join(''), "1");
2766
+ console.log(s);
2767
+ setStep(s);
2768
+ }
2769
+ }
2770
+ }
2771
+ else if (props.inputType === 'integer') {
2772
+ // Overwrite value as integer to forcibly truncate floating point numbers
2773
+ setValue(parseInt(value).toString());
2774
+ }
2775
+ // Debounce onChange notification
2776
+ if (!props.onChange)
2777
+ return;
2778
+ clearTimeout(timer);
2779
+ setTimer(setTimeout(function () { return (props.onChange ? props.onChange(value) : undefined); }, debounceMs));
2780
+ // eslint-disable-next-line react-hooks/exhaustive-deps
2781
+ }, [value]);
2782
+ // Update state from props
2783
+ react.exports.useEffect(function () {
2784
+ setDebounceMs(props.changeDebounceMs || 300);
2785
+ }, [props.changeDebounceMs]);
2786
+ // Normalize inputRef
2787
+ var inputRef = react.exports.useRef(null);
2788
+ if (props.inputRef)
2789
+ inputRef = props.inputRef;
2790
+ var hasLabel = props.label && props.label !== '';
2791
+ // Global key bindings
2792
+ function globalKeyBindings(event) {
2793
+ // Escape - cancel search
2794
+ if (event.key === 'Escape') {
2795
+ event.stopPropagation();
2796
+ event.preventDefault();
2797
+ setEscapePressed(Date.now());
2798
+ return;
2799
+ }
2800
+ }
2801
+ // Normalize input type
2802
+ var inputType = props.inputType;
2803
+ if (inputType === 'integer' || inputType === 'decimal')
2804
+ inputType = 'number';
2805
+ // TODO: handle props.inputType
2806
+ var component = (React.createElement("div", { className: "dx-textbox".concat(hasLabel ? ' with-label' : ''), style: {} },
2807
+ props.icon ? React.createElement(genesysDevIcons.GenesysDevIcon, { icon: props.icon, className: 'input-icon' }) : undefined,
2808
+ React.createElement("input", { className: 'dx-input', type: inputType, step: step, value: value, placeholder: props.placeholder, onChange: function (e) { return setValue(e.target.value); }, ref: inputRef, onFocus: function () {
2809
+ setIsFocused(true);
2810
+ if (props.onFocus)
2811
+ props.onFocus();
2812
+ }, onBlur: function () {
2813
+ setIsFocused(false);
2814
+ if (props.onBlur)
2815
+ props.onBlur();
2816
+ } }),
2817
+ props.clearButton && (value || isFocused) ? (React.createElement(genesysDevIcons.GenesysDevIcon, { icon: genesysDevIcons.GenesysDevIcons.AppTimes, className: 'clear-icon', onClick: function () { return setValue(''); } })) : undefined));
2818
+ // Render
2819
+ return (React.createElement(DxLabel, { label: props.label, description: props.description }, component));
2820
+ }
2821
+
2822
+ var css_248z = ".DxToggle_dx-toggle-container__3GWTw {\n display: inline-block; }\n .DxToggle_dx-toggle-container__3GWTw .DxToggle_dx-toggle__1uxFT {\n background: #f5f8fb;\n border: 1px solid #c6cbd1;\n border-radius: 6px;\n height: 26px;\n padding: 0px 4px;\n display: flex;\n flex-flow: row nowrap;\n justify-content: space-between;\n align-items: center;\n gap: 2px;\n cursor: pointer; }\n .DxToggle_dx-toggle-container__3GWTw .DxToggle_dx-toggle__1uxFT:hover .DxToggle_slider__9me7n {\n border-color: #aac9ff; }\n .DxToggle_dx-toggle-container__3GWTw .DxToggle_dx-toggle__1uxFT .DxToggle_icon__2qdMU {\n font-size: 10px;\n line-height: 0;\n margin: 0 5px;\n color: #c4c4c4; }\n .DxToggle_dx-toggle-container__3GWTw .DxToggle_dx-toggle__1uxFT .DxToggle_clear-placeholder__1mVW2 {\n width: 19px;\n padding: 0 1px 0 0;\n margin: 0;\n display: block; }\n .DxToggle_dx-toggle-container__3GWTw .DxToggle_dx-toggle__1uxFT .DxToggle_slider__9me7n {\n height: 22px;\n width: 22px;\n border-radius: 22px;\n background-color: #419bb2;\n box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.25);\n display: flex;\n align-items: center;\n justify-content: center;\n border: 1px solid transparent; }\n .DxToggle_dx-toggle-container__3GWTw .DxToggle_dx-toggle__1uxFT .DxToggle_slider__9me7n .DxToggle_icon__2qdMU {\n font-size: 10px;\n line-height: 0;\n color: #ffffff;\n padding: 0;\n margin: 0; }\n";
2823
+ styleInject(css_248z);
2824
+
2825
+ function DxToggle(props) {
2826
+ var _a = react.exports.useState(props.isTriState ? props.initialValue : props.initialValue || false), value = _a[0], setValue = _a[1];
2827
+ var trueIcon = props.trueIcon || genesysDevIcons.GenesysDevIcons.AppCheck;
2828
+ var falseIcon = props.falseIcon || genesysDevIcons.GenesysDevIcons.AppTimes;
2829
+ react.exports.useEffect(function () {
2830
+ if (props.onChange)
2831
+ props.onChange(value);
2832
+ // eslint-disable-next-line react-hooks/exhaustive-deps
2833
+ }, [value]);
2834
+ var toggleValue = function () {
2835
+ if (props.isTriState) {
2836
+ if (value === undefined)
2837
+ setValue(true);
2838
+ else if (value === true)
2839
+ setValue(false);
2840
+ else
2841
+ setValue(undefined);
2842
+ }
2843
+ else {
2844
+ setValue(!value);
2845
+ }
2846
+ };
2847
+ return (React.createElement(DxLabel, { label: props.label, description: props.description },
2848
+ React.createElement("div", { className: 'dx-toggle-container' },
2849
+ React.createElement("div", { className: 'dx-toggle', onClick: toggleValue },
2850
+ value !== false ? React.createElement(genesysDevIcons.GenesysDevIcon, { icon: falseIcon }) : undefined,
2851
+ value === true && props.isTriState ? React.createElement("div", { className: 'clear-placeholder' }, "\u00A0") : undefined,
2852
+ React.createElement("div", { className: 'slider' }, value !== undefined ? React.createElement(genesysDevIcons.GenesysDevIcon, { icon: value ? trueIcon : falseIcon }) : undefined),
2853
+ value === false && props.isTriState ? React.createElement("div", { className: 'clear-placeholder' }, "\u00A0") : undefined,
2854
+ value !== true ? React.createElement(genesysDevIcons.GenesysDevIcon, { icon: trueIcon }) : undefined))));
2855
+ }
2856
+
2857
+ exports.DxAccordion = DxAccordion;
2858
+ exports.DxAccordionGroup = DxAccordionGroup;
2859
+ exports.DxButton = DxButton;
2860
+ exports.DxItemGroup = DxItemGroup;
2861
+ exports.DxTabPanel = DxTabPanel;
2862
+ exports.DxTabbedContent = DxTabbedContent;
2863
+ exports.DxTextbox = DxTextbox;
2864
+ exports.DxToggle = DxToggle;
2865
+ //# sourceMappingURL=index.js.map