UNPKG

137 kBJavaScriptView Raw
1(function (global, factory) {
2 typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react'), require('jss')) :
3 typeof define === 'function' && define.amd ? define(['exports', 'react', 'jss'], factory) :
4 (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.reactJss = {}, global.React, global.jss));
5}(this, (function (exports, React, jss) { 'use strict';
6
7 function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
9 var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
10
11 function _extends() {
12 _extends = Object.assign || function (target) {
13 for (var i = 1; i < arguments.length; i++) {
14 var source = arguments[i];
15
16 for (var key in source) {
17 if (Object.prototype.hasOwnProperty.call(source, key)) {
18 target[key] = source[key];
19 }
20 }
21 }
22
23 return target;
24 };
25
26 return _extends.apply(this, arguments);
27 }
28
29 function _objectWithoutPropertiesLoose(source, excluded) {
30 if (source == null) return {};
31 var target = {};
32 var sourceKeys = Object.keys(source);
33 var key, i;
34
35 for (i = 0; i < sourceKeys.length; i++) {
36 key = sourceKeys[i];
37 if (excluded.indexOf(key) >= 0) continue;
38 target[key] = source[key];
39 }
40
41 return target;
42 }
43
44 function getDefaultExportFromCjs (x) {
45 return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
46 }
47
48 function createCommonjsModule(fn, basedir, module) {
49 return module = {
50 path: basedir,
51 exports: {},
52 require: function (path, base) {
53 return commonjsRequire(path, (base === undefined || base === null) ? module.path : base);
54 }
55 }, fn(module, module.exports), module.exports;
56 }
57
58 function getAugmentedNamespace(n) {
59 if (n.__esModule) return n;
60 var a = Object.defineProperty({}, '__esModule', {value: true});
61 Object.keys(n).forEach(function (k) {
62 var d = Object.getOwnPropertyDescriptor(n, k);
63 Object.defineProperty(a, k, d.get ? d : {
64 enumerable: true,
65 get: function () {
66 return n[k];
67 }
68 });
69 });
70 return a;
71 }
72
73 function commonjsRequire () {
74 throw new Error('Dynamic requires are not currently supported by @rollup/plugin-commonjs');
75 }
76
77 var reactIs_production_min = createCommonjsModule(function (module, exports) {
78 Object.defineProperty(exports,"__esModule",{value:!0});
79 var b="function"===typeof Symbol&&Symbol.for,c=b?Symbol.for("react.element"):60103,d=b?Symbol.for("react.portal"):60106,e=b?Symbol.for("react.fragment"):60107,f=b?Symbol.for("react.strict_mode"):60108,g=b?Symbol.for("react.profiler"):60114,h=b?Symbol.for("react.provider"):60109,k=b?Symbol.for("react.context"):60110,l=b?Symbol.for("react.concurrent_mode"):60111,m=b?Symbol.for("react.forward_ref"):60112,n=b?Symbol.for("react.suspense"):60113,q=b?Symbol.for("react.memo"):60115,r=b?Symbol.for("react.lazy"):
80 60116;function t(a){if("object"===typeof a&&null!==a){var p=a.$$typeof;switch(p){case c:switch(a=a.type,a){case l:case e:case g:case f:return a;default:switch(a=a&&a.$$typeof,a){case k:case m:case h:return a;default:return p}}case d:return p}}}function u(a){return t(a)===l}exports.typeOf=t;exports.AsyncMode=l;exports.ConcurrentMode=l;exports.ContextConsumer=k;exports.ContextProvider=h;exports.Element=c;exports.ForwardRef=m;exports.Fragment=e;exports.Profiler=g;exports.Portal=d;
81 exports.StrictMode=f;exports.isValidElementType=function(a){return "string"===typeof a||"function"===typeof a||a===e||a===l||a===g||a===f||a===n||"object"===typeof a&&null!==a&&(a.$$typeof===r||a.$$typeof===q||a.$$typeof===h||a.$$typeof===k||a.$$typeof===m)};exports.isAsyncMode=function(a){return u(a)};exports.isConcurrentMode=u;exports.isContextConsumer=function(a){return t(a)===k};exports.isContextProvider=function(a){return t(a)===h};
82 exports.isElement=function(a){return "object"===typeof a&&null!==a&&a.$$typeof===c};exports.isForwardRef=function(a){return t(a)===m};exports.isFragment=function(a){return t(a)===e};exports.isProfiler=function(a){return t(a)===g};exports.isPortal=function(a){return t(a)===d};exports.isStrictMode=function(a){return t(a)===f};
83 });
84
85 var reactIs_development = createCommonjsModule(function (module, exports) {
86
87
88
89 {
90 (function() {
91
92 Object.defineProperty(exports, '__esModule', { value: true });
93
94 // The Symbol used to tag the ReactElement-like types. If there is no native Symbol
95 // nor polyfill, then a plain number is used for performance.
96 var hasSymbol = typeof Symbol === 'function' && Symbol.for;
97
98 var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
99 var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
100 var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
101 var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
102 var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
103 var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
104 var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace;
105 var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
106 var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
107 var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
108 var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
109 var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
110
111 function isValidElementType(type) {
112 return typeof type === 'string' || typeof type === 'function' ||
113 // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
114 type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || typeof type === 'object' && type !== null && (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);
115 }
116
117 /**
118 * Forked from fbjs/warning:
119 * https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/__forks__/warning.js
120 *
121 * Only change is we use console.warn instead of console.error,
122 * and do nothing when 'console' is not supported.
123 * This really simplifies the code.
124 * ---
125 * Similar to invariant but only logs a warning if the condition is not met.
126 * This can be used to log issues in development environments in critical
127 * paths. Removing the logging code for production environments will keep the
128 * same logic and follow the same code paths.
129 */
130
131 var lowPriorityWarning = function () {};
132
133 {
134 var printWarning = function (format) {
135 for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
136 args[_key - 1] = arguments[_key];
137 }
138
139 var argIndex = 0;
140 var message = 'Warning: ' + format.replace(/%s/g, function () {
141 return args[argIndex++];
142 });
143 if (typeof console !== 'undefined') {
144 console.warn(message);
145 }
146 try {
147 // --- Welcome to debugging React ---
148 // This error was thrown as a convenience so that you can use this stack
149 // to find the callsite that caused this warning to fire.
150 throw new Error(message);
151 } catch (x) {}
152 };
153
154 lowPriorityWarning = function (condition, format) {
155 if (format === undefined) {
156 throw new Error('`lowPriorityWarning(condition, format, ...args)` requires a warning ' + 'message argument');
157 }
158 if (!condition) {
159 for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
160 args[_key2 - 2] = arguments[_key2];
161 }
162
163 printWarning.apply(undefined, [format].concat(args));
164 }
165 };
166 }
167
168 var lowPriorityWarning$1 = lowPriorityWarning;
169
170 function typeOf(object) {
171 if (typeof object === 'object' && object !== null) {
172 var $$typeof = object.$$typeof;
173
174 switch ($$typeof) {
175 case REACT_ELEMENT_TYPE:
176 var type = object.type;
177
178 switch (type) {
179 case REACT_CONCURRENT_MODE_TYPE:
180 case REACT_FRAGMENT_TYPE:
181 case REACT_PROFILER_TYPE:
182 case REACT_STRICT_MODE_TYPE:
183 return type;
184 default:
185 var $$typeofType = type && type.$$typeof;
186
187 switch ($$typeofType) {
188 case REACT_CONTEXT_TYPE:
189 case REACT_FORWARD_REF_TYPE:
190 case REACT_PROVIDER_TYPE:
191 return $$typeofType;
192 default:
193 return $$typeof;
194 }
195 }
196 case REACT_PORTAL_TYPE:
197 return $$typeof;
198 }
199 }
200
201 return undefined;
202 }
203
204 // AsyncMode alias is deprecated along with isAsyncMode
205 var AsyncMode = REACT_CONCURRENT_MODE_TYPE;
206 var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
207 var ContextConsumer = REACT_CONTEXT_TYPE;
208 var ContextProvider = REACT_PROVIDER_TYPE;
209 var Element = REACT_ELEMENT_TYPE;
210 var ForwardRef = REACT_FORWARD_REF_TYPE;
211 var Fragment = REACT_FRAGMENT_TYPE;
212 var Profiler = REACT_PROFILER_TYPE;
213 var Portal = REACT_PORTAL_TYPE;
214 var StrictMode = REACT_STRICT_MODE_TYPE;
215
216 var hasWarnedAboutDeprecatedIsAsyncMode = false;
217
218 // AsyncMode should be deprecated
219 function isAsyncMode(object) {
220 {
221 if (!hasWarnedAboutDeprecatedIsAsyncMode) {
222 hasWarnedAboutDeprecatedIsAsyncMode = true;
223 lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');
224 }
225 }
226 return isConcurrentMode(object);
227 }
228 function isConcurrentMode(object) {
229 return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
230 }
231 function isContextConsumer(object) {
232 return typeOf(object) === REACT_CONTEXT_TYPE;
233 }
234 function isContextProvider(object) {
235 return typeOf(object) === REACT_PROVIDER_TYPE;
236 }
237 function isElement(object) {
238 return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
239 }
240 function isForwardRef(object) {
241 return typeOf(object) === REACT_FORWARD_REF_TYPE;
242 }
243 function isFragment(object) {
244 return typeOf(object) === REACT_FRAGMENT_TYPE;
245 }
246 function isProfiler(object) {
247 return typeOf(object) === REACT_PROFILER_TYPE;
248 }
249 function isPortal(object) {
250 return typeOf(object) === REACT_PORTAL_TYPE;
251 }
252 function isStrictMode(object) {
253 return typeOf(object) === REACT_STRICT_MODE_TYPE;
254 }
255
256 exports.typeOf = typeOf;
257 exports.AsyncMode = AsyncMode;
258 exports.ConcurrentMode = ConcurrentMode;
259 exports.ContextConsumer = ContextConsumer;
260 exports.ContextProvider = ContextProvider;
261 exports.Element = Element;
262 exports.ForwardRef = ForwardRef;
263 exports.Fragment = Fragment;
264 exports.Profiler = Profiler;
265 exports.Portal = Portal;
266 exports.StrictMode = StrictMode;
267 exports.isValidElementType = isValidElementType;
268 exports.isAsyncMode = isAsyncMode;
269 exports.isConcurrentMode = isConcurrentMode;
270 exports.isContextConsumer = isContextConsumer;
271 exports.isContextProvider = isContextProvider;
272 exports.isElement = isElement;
273 exports.isForwardRef = isForwardRef;
274 exports.isFragment = isFragment;
275 exports.isProfiler = isProfiler;
276 exports.isPortal = isPortal;
277 exports.isStrictMode = isStrictMode;
278 })();
279 }
280 });
281
282 var reactIs = createCommonjsModule(function (module) {
283
284 {
285 module.exports = reactIs_development;
286 }
287 });
288
289 /**
290 * Copyright 2015, Yahoo! Inc.
291 * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
292 */
293
294 var REACT_STATICS = {
295 childContextTypes: true,
296 contextType: true,
297 contextTypes: true,
298 defaultProps: true,
299 displayName: true,
300 getDefaultProps: true,
301 getDerivedStateFromError: true,
302 getDerivedStateFromProps: true,
303 mixins: true,
304 propTypes: true,
305 type: true
306 };
307
308 var KNOWN_STATICS = {
309 name: true,
310 length: true,
311 prototype: true,
312 caller: true,
313 callee: true,
314 arguments: true,
315 arity: true
316 };
317
318 var FORWARD_REF_STATICS = {
319 '$$typeof': true,
320 render: true
321 };
322
323 var TYPE_STATICS = {};
324 TYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS;
325
326 var defineProperty = Object.defineProperty;
327 var getOwnPropertyNames = Object.getOwnPropertyNames;
328 var getOwnPropertySymbols = Object.getOwnPropertySymbols;
329 var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
330 var getPrototypeOf = Object.getPrototypeOf;
331 var objectPrototype = Object.prototype;
332
333 function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {
334 if (typeof sourceComponent !== 'string') {
335 // don't hoist over string (html) components
336
337 if (objectPrototype) {
338 var inheritedComponent = getPrototypeOf(sourceComponent);
339 if (inheritedComponent && inheritedComponent !== objectPrototype) {
340 hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);
341 }
342 }
343
344 var keys = getOwnPropertyNames(sourceComponent);
345
346 if (getOwnPropertySymbols) {
347 keys = keys.concat(getOwnPropertySymbols(sourceComponent));
348 }
349
350 var targetStatics = TYPE_STATICS[targetComponent['$$typeof']] || REACT_STATICS;
351 var sourceStatics = TYPE_STATICS[sourceComponent['$$typeof']] || REACT_STATICS;
352
353 for (var i = 0; i < keys.length; ++i) {
354 var key = keys[i];
355 if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) {
356 var descriptor = getOwnPropertyDescriptor(sourceComponent, key);
357 try {
358 // Avoid failures from read-only properties
359 defineProperty(targetComponent, key, descriptor);
360 } catch (e) {}
361 }
362 }
363
364 return targetComponent;
365 }
366
367 return targetComponent;
368 }
369
370 var hoistNonReactStatics_cjs = hoistNonReactStatics;
371
372 function warning(condition, message) {
373 {
374 if (condition) {
375 return;
376 }
377
378 var text = "Warning: " + message;
379
380 if (typeof console !== 'undefined') {
381 console.warn(text);
382 }
383
384 try {
385 throw Error(text);
386 } catch (x) {}
387 }
388 }
389
390 /*
391 object-assign
392 (c) Sindre Sorhus
393 @license MIT
394 */
395 /* eslint-disable no-unused-vars */
396 var getOwnPropertySymbols$1 = Object.getOwnPropertySymbols;
397 var hasOwnProperty = Object.prototype.hasOwnProperty;
398 var propIsEnumerable = Object.prototype.propertyIsEnumerable;
399
400 function toObject(val) {
401 if (val === null || val === undefined) {
402 throw new TypeError('Object.assign cannot be called with null or undefined');
403 }
404
405 return Object(val);
406 }
407
408 function shouldUseNative() {
409 try {
410 if (!Object.assign) {
411 return false;
412 }
413
414 // Detect buggy property enumeration order in older V8 versions.
415
416 // https://bugs.chromium.org/p/v8/issues/detail?id=4118
417 var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
418 test1[5] = 'de';
419 if (Object.getOwnPropertyNames(test1)[0] === '5') {
420 return false;
421 }
422
423 // https://bugs.chromium.org/p/v8/issues/detail?id=3056
424 var test2 = {};
425 for (var i = 0; i < 10; i++) {
426 test2['_' + String.fromCharCode(i)] = i;
427 }
428 var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
429 return test2[n];
430 });
431 if (order2.join('') !== '0123456789') {
432 return false;
433 }
434
435 // https://bugs.chromium.org/p/v8/issues/detail?id=3056
436 var test3 = {};
437 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
438 test3[letter] = letter;
439 });
440 if (Object.keys(Object.assign({}, test3)).join('') !==
441 'abcdefghijklmnopqrst') {
442 return false;
443 }
444
445 return true;
446 } catch (err) {
447 // We don't expect any of the above to throw, but better to be safe.
448 return false;
449 }
450 }
451
452 module.exports = shouldUseNative() ? Object.assign : function (target, source) {
453 var from;
454 var to = toObject(target);
455 var symbols;
456
457 for (var s = 1; s < arguments.length; s++) {
458 from = Object(arguments[s]);
459
460 for (var key in from) {
461 if (hasOwnProperty.call(from, key)) {
462 to[key] = from[key];
463 }
464 }
465
466 if (getOwnPropertySymbols$1) {
467 symbols = getOwnPropertySymbols$1(from);
468 for (var i = 0; i < symbols.length; i++) {
469 if (propIsEnumerable.call(from, symbols[i])) {
470 to[symbols[i]] = from[symbols[i]];
471 }
472 }
473 }
474 }
475
476 return to;
477 };
478
479 var objectAssign = /*#__PURE__*/Object.freeze({
480 __proto__: null
481 });
482
483 /**
484 * Copyright (c) 2013-present, Facebook, Inc.
485 *
486 * This source code is licensed under the MIT license found in the
487 * LICENSE file in the root directory of this source tree.
488 */
489
490 var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
491
492 var ReactPropTypesSecret_1 = ReactPropTypesSecret;
493
494 var printWarning = function() {};
495
496 {
497 var ReactPropTypesSecret$1 = ReactPropTypesSecret_1;
498 var loggedTypeFailures = {};
499
500 printWarning = function(text) {
501 var message = 'Warning: ' + text;
502 if (typeof console !== 'undefined') {
503 console.error(message);
504 }
505 try {
506 // --- Welcome to debugging React ---
507 // This error was thrown as a convenience so that you can use this stack
508 // to find the callsite that caused this warning to fire.
509 throw new Error(message);
510 } catch (x) {}
511 };
512 }
513
514 /**
515 * Assert that the values match with the type specs.
516 * Error messages are memorized and will only be shown once.
517 *
518 * @param {object} typeSpecs Map of name to a ReactPropType
519 * @param {object} values Runtime values that need to be type-checked
520 * @param {string} location e.g. "prop", "context", "child context"
521 * @param {string} componentName Name of the component for error messages.
522 * @param {?Function} getStack Returns the component stack.
523 * @private
524 */
525 function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
526 {
527 for (var typeSpecName in typeSpecs) {
528 if (typeSpecs.hasOwnProperty(typeSpecName)) {
529 var error;
530 // Prop type validation may throw. In case they do, we don't want to
531 // fail the render phase where it didn't fail before. So we log it.
532 // After these have been cleaned up, we'll let them throw.
533 try {
534 // This is intentionally an invariant that gets caught. It's the same
535 // behavior as without this statement except with a better message.
536 if (typeof typeSpecs[typeSpecName] !== 'function') {
537 var err = Error(
538 (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +
539 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.'
540 );
541 err.name = 'Invariant Violation';
542 throw err;
543 }
544 error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret$1);
545 } catch (ex) {
546 error = ex;
547 }
548 if (error && !(error instanceof Error)) {
549 printWarning(
550 (componentName || 'React class') + ': type specification of ' +
551 location + ' `' + typeSpecName + '` is invalid; the type checker ' +
552 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' +
553 'You may have forgotten to pass an argument to the type checker ' +
554 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +
555 'shape all require an argument).'
556 );
557
558 }
559 if (error instanceof Error && !(error.message in loggedTypeFailures)) {
560 // Only monitor this failure once because there tends to be a lot of the
561 // same error.
562 loggedTypeFailures[error.message] = true;
563
564 var stack = getStack ? getStack() : '';
565
566 printWarning(
567 'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')
568 );
569 }
570 }
571 }
572 }
573 }
574
575 var checkPropTypes_1 = checkPropTypes;
576
577 var assign = /*@__PURE__*/getAugmentedNamespace(objectAssign);
578
579 var printWarning$1 = function() {};
580
581 {
582 printWarning$1 = function(text) {
583 var message = 'Warning: ' + text;
584 if (typeof console !== 'undefined') {
585 console.error(message);
586 }
587 try {
588 // --- Welcome to debugging React ---
589 // This error was thrown as a convenience so that you can use this stack
590 // to find the callsite that caused this warning to fire.
591 throw new Error(message);
592 } catch (x) {}
593 };
594 }
595
596 function emptyFunctionThatReturnsNull() {
597 return null;
598 }
599
600 var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
601 /* global Symbol */
602 var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
603 var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
604
605 /**
606 * Returns the iterator method function contained on the iterable object.
607 *
608 * Be sure to invoke the function with the iterable as context:
609 *
610 * var iteratorFn = getIteratorFn(myIterable);
611 * if (iteratorFn) {
612 * var iterator = iteratorFn.call(myIterable);
613 * ...
614 * }
615 *
616 * @param {?object} maybeIterable
617 * @return {?function}
618 */
619 function getIteratorFn(maybeIterable) {
620 var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
621 if (typeof iteratorFn === 'function') {
622 return iteratorFn;
623 }
624 }
625
626 /**
627 * Collection of methods that allow declaration and validation of props that are
628 * supplied to React components. Example usage:
629 *
630 * var Props = require('ReactPropTypes');
631 * var MyArticle = React.createClass({
632 * propTypes: {
633 * // An optional string prop named "description".
634 * description: Props.string,
635 *
636 * // A required enum prop named "category".
637 * category: Props.oneOf(['News','Photos']).isRequired,
638 *
639 * // A prop named "dialog" that requires an instance of Dialog.
640 * dialog: Props.instanceOf(Dialog).isRequired
641 * },
642 * render: function() { ... }
643 * });
644 *
645 * A more formal specification of how these methods are used:
646 *
647 * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
648 * decl := ReactPropTypes.{type}(.isRequired)?
649 *
650 * Each and every declaration produces a function with the same signature. This
651 * allows the creation of custom validation functions. For example:
652 *
653 * var MyLink = React.createClass({
654 * propTypes: {
655 * // An optional string or URI prop named "href".
656 * href: function(props, propName, componentName) {
657 * var propValue = props[propName];
658 * if (propValue != null && typeof propValue !== 'string' &&
659 * !(propValue instanceof URI)) {
660 * return new Error(
661 * 'Expected a string or an URI for ' + propName + ' in ' +
662 * componentName
663 * );
664 * }
665 * }
666 * },
667 * render: function() {...}
668 * });
669 *
670 * @internal
671 */
672
673 var ANONYMOUS = '<<anonymous>>';
674
675 // Important!
676 // Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
677 var ReactPropTypes = {
678 array: createPrimitiveTypeChecker('array'),
679 bool: createPrimitiveTypeChecker('boolean'),
680 func: createPrimitiveTypeChecker('function'),
681 number: createPrimitiveTypeChecker('number'),
682 object: createPrimitiveTypeChecker('object'),
683 string: createPrimitiveTypeChecker('string'),
684 symbol: createPrimitiveTypeChecker('symbol'),
685
686 any: createAnyTypeChecker(),
687 arrayOf: createArrayOfTypeChecker,
688 element: createElementTypeChecker(),
689 instanceOf: createInstanceTypeChecker,
690 node: createNodeChecker(),
691 objectOf: createObjectOfTypeChecker,
692 oneOf: createEnumTypeChecker,
693 oneOfType: createUnionTypeChecker,
694 shape: createShapeTypeChecker,
695 exact: createStrictShapeTypeChecker,
696 };
697
698 /**
699 * inlined Object.is polyfill to avoid requiring consumers ship their own
700 * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
701 */
702 /*eslint-disable no-self-compare*/
703 function is(x, y) {
704 // SameValue algorithm
705 if (x === y) {
706 // Steps 1-5, 7-10
707 // Steps 6.b-6.e: +0 != -0
708 return x !== 0 || 1 / x === 1 / y;
709 } else {
710 // Step 6.a: NaN == NaN
711 return x !== x && y !== y;
712 }
713 }
714 /*eslint-enable no-self-compare*/
715
716 /**
717 * We use an Error-like object for backward compatibility as people may call
718 * PropTypes directly and inspect their output. However, we don't use real
719 * Errors anymore. We don't inspect their stack anyway, and creating them
720 * is prohibitively expensive if they are created too often, such as what
721 * happens in oneOfType() for any type before the one that matched.
722 */
723 function PropTypeError(message) {
724 this.message = message;
725 this.stack = '';
726 }
727 // Make `instanceof Error` still work for returned errors.
728 PropTypeError.prototype = Error.prototype;
729
730 function createChainableTypeChecker(validate) {
731 {
732 var manualPropTypeCallCache = {};
733 var manualPropTypeWarningCount = 0;
734 }
735 function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
736 componentName = componentName || ANONYMOUS;
737 propFullName = propFullName || propName;
738
739 if (secret !== ReactPropTypesSecret_1) {
740 if (throwOnDirectAccess) {
741 // New behavior only for users of `prop-types` package
742 var err = new Error(
743 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
744 'Use `PropTypes.checkPropTypes()` to call them. ' +
745 'Read more at http://fb.me/use-check-prop-types'
746 );
747 err.name = 'Invariant Violation';
748 throw err;
749 } else if ( typeof console !== 'undefined') {
750 // Old behavior for people using React.PropTypes
751 var cacheKey = componentName + ':' + propName;
752 if (
753 !manualPropTypeCallCache[cacheKey] &&
754 // Avoid spamming the console because they are often not actionable except for lib authors
755 manualPropTypeWarningCount < 3
756 ) {
757 printWarning$1(
758 'You are manually calling a React.PropTypes validation ' +
759 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' +
760 'and will throw in the standalone `prop-types` package. ' +
761 'You may be seeing this warning due to a third-party PropTypes ' +
762 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.'
763 );
764 manualPropTypeCallCache[cacheKey] = true;
765 manualPropTypeWarningCount++;
766 }
767 }
768 }
769 if (props[propName] == null) {
770 if (isRequired) {
771 if (props[propName] === null) {
772 return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
773 }
774 return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
775 }
776 return null;
777 } else {
778 return validate(props, propName, componentName, location, propFullName);
779 }
780 }
781
782 var chainedCheckType = checkType.bind(null, false);
783 chainedCheckType.isRequired = checkType.bind(null, true);
784
785 return chainedCheckType;
786 }
787
788 function createPrimitiveTypeChecker(expectedType) {
789 function validate(props, propName, componentName, location, propFullName, secret) {
790 var propValue = props[propName];
791 var propType = getPropType(propValue);
792 if (propType !== expectedType) {
793 // `propValue` being instance of, say, date/regexp, pass the 'object'
794 // check, but we can offer a more precise error message here rather than
795 // 'of type `object`'.
796 var preciseType = getPreciseType(propValue);
797
798 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'));
799 }
800 return null;
801 }
802 return createChainableTypeChecker(validate);
803 }
804
805 function createAnyTypeChecker() {
806 return createChainableTypeChecker(emptyFunctionThatReturnsNull);
807 }
808
809 function createArrayOfTypeChecker(typeChecker) {
810 function validate(props, propName, componentName, location, propFullName) {
811 if (typeof typeChecker !== 'function') {
812 return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
813 }
814 var propValue = props[propName];
815 if (!Array.isArray(propValue)) {
816 var propType = getPropType(propValue);
817 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
818 }
819 for (var i = 0; i < propValue.length; i++) {
820 var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret_1);
821 if (error instanceof Error) {
822 return error;
823 }
824 }
825 return null;
826 }
827 return createChainableTypeChecker(validate);
828 }
829
830 function createElementTypeChecker() {
831 function validate(props, propName, componentName, location, propFullName) {
832 var propValue = props[propName];
833 if (!isValidElement(propValue)) {
834 var propType = getPropType(propValue);
835 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
836 }
837 return null;
838 }
839 return createChainableTypeChecker(validate);
840 }
841
842 function createInstanceTypeChecker(expectedClass) {
843 function validate(props, propName, componentName, location, propFullName) {
844 if (!(props[propName] instanceof expectedClass)) {
845 var expectedClassName = expectedClass.name || ANONYMOUS;
846 var actualClassName = getClassName(props[propName]);
847 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
848 }
849 return null;
850 }
851 return createChainableTypeChecker(validate);
852 }
853
854 function createEnumTypeChecker(expectedValues) {
855 if (!Array.isArray(expectedValues)) {
856 printWarning$1('Invalid argument supplied to oneOf, expected an instance of array.') ;
857 return emptyFunctionThatReturnsNull;
858 }
859
860 function validate(props, propName, componentName, location, propFullName) {
861 var propValue = props[propName];
862 for (var i = 0; i < expectedValues.length; i++) {
863 if (is(propValue, expectedValues[i])) {
864 return null;
865 }
866 }
867
868 var valuesString = JSON.stringify(expectedValues);
869 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
870 }
871 return createChainableTypeChecker(validate);
872 }
873
874 function createObjectOfTypeChecker(typeChecker) {
875 function validate(props, propName, componentName, location, propFullName) {
876 if (typeof typeChecker !== 'function') {
877 return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
878 }
879 var propValue = props[propName];
880 var propType = getPropType(propValue);
881 if (propType !== 'object') {
882 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
883 }
884 for (var key in propValue) {
885 if (propValue.hasOwnProperty(key)) {
886 var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret_1);
887 if (error instanceof Error) {
888 return error;
889 }
890 }
891 }
892 return null;
893 }
894 return createChainableTypeChecker(validate);
895 }
896
897 function createUnionTypeChecker(arrayOfTypeCheckers) {
898 if (!Array.isArray(arrayOfTypeCheckers)) {
899 printWarning$1('Invalid argument supplied to oneOfType, expected an instance of array.') ;
900 return emptyFunctionThatReturnsNull;
901 }
902
903 for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
904 var checker = arrayOfTypeCheckers[i];
905 if (typeof checker !== 'function') {
906 printWarning$1(
907 'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' +
908 'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.'
909 );
910 return emptyFunctionThatReturnsNull;
911 }
912 }
913
914 function validate(props, propName, componentName, location, propFullName) {
915 for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
916 var checker = arrayOfTypeCheckers[i];
917 if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret_1) == null) {
918 return null;
919 }
920 }
921
922 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.'));
923 }
924 return createChainableTypeChecker(validate);
925 }
926
927 function createNodeChecker() {
928 function validate(props, propName, componentName, location, propFullName) {
929 if (!isNode(props[propName])) {
930 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
931 }
932 return null;
933 }
934 return createChainableTypeChecker(validate);
935 }
936
937 function createShapeTypeChecker(shapeTypes) {
938 function validate(props, propName, componentName, location, propFullName) {
939 var propValue = props[propName];
940 var propType = getPropType(propValue);
941 if (propType !== 'object') {
942 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
943 }
944 for (var key in shapeTypes) {
945 var checker = shapeTypes[key];
946 if (!checker) {
947 continue;
948 }
949 var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret_1);
950 if (error) {
951 return error;
952 }
953 }
954 return null;
955 }
956 return createChainableTypeChecker(validate);
957 }
958
959 function createStrictShapeTypeChecker(shapeTypes) {
960 function validate(props, propName, componentName, location, propFullName) {
961 var propValue = props[propName];
962 var propType = getPropType(propValue);
963 if (propType !== 'object') {
964 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
965 }
966 // We need to check all keys in case some are required but missing from
967 // props.
968 var allKeys = assign({}, props[propName], shapeTypes);
969 for (var key in allKeys) {
970 var checker = shapeTypes[key];
971 if (!checker) {
972 return new PropTypeError(
973 'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' +
974 '\nBad object: ' + JSON.stringify(props[propName], null, ' ') +
975 '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')
976 );
977 }
978 var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret_1);
979 if (error) {
980 return error;
981 }
982 }
983 return null;
984 }
985
986 return createChainableTypeChecker(validate);
987 }
988
989 function isNode(propValue) {
990 switch (typeof propValue) {
991 case 'number':
992 case 'string':
993 case 'undefined':
994 return true;
995 case 'boolean':
996 return !propValue;
997 case 'object':
998 if (Array.isArray(propValue)) {
999 return propValue.every(isNode);
1000 }
1001 if (propValue === null || isValidElement(propValue)) {
1002 return true;
1003 }
1004
1005 var iteratorFn = getIteratorFn(propValue);
1006 if (iteratorFn) {
1007 var iterator = iteratorFn.call(propValue);
1008 var step;
1009 if (iteratorFn !== propValue.entries) {
1010 while (!(step = iterator.next()).done) {
1011 if (!isNode(step.value)) {
1012 return false;
1013 }
1014 }
1015 } else {
1016 // Iterator will provide entry [k,v] tuples rather than values.
1017 while (!(step = iterator.next()).done) {
1018 var entry = step.value;
1019 if (entry) {
1020 if (!isNode(entry[1])) {
1021 return false;
1022 }
1023 }
1024 }
1025 }
1026 } else {
1027 return false;
1028 }
1029
1030 return true;
1031 default:
1032 return false;
1033 }
1034 }
1035
1036 function isSymbol(propType, propValue) {
1037 // Native Symbol.
1038 if (propType === 'symbol') {
1039 return true;
1040 }
1041
1042 // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
1043 if (propValue['@@toStringTag'] === 'Symbol') {
1044 return true;
1045 }
1046
1047 // Fallback for non-spec compliant Symbols which are polyfilled.
1048 if (typeof Symbol === 'function' && propValue instanceof Symbol) {
1049 return true;
1050 }
1051
1052 return false;
1053 }
1054
1055 // Equivalent of `typeof` but with special handling for array and regexp.
1056 function getPropType(propValue) {
1057 var propType = typeof propValue;
1058 if (Array.isArray(propValue)) {
1059 return 'array';
1060 }
1061 if (propValue instanceof RegExp) {
1062 // Old webkits (at least until Android 4.0) return 'function' rather than
1063 // 'object' for typeof a RegExp. We'll normalize this here so that /bla/
1064 // passes PropTypes.object.
1065 return 'object';
1066 }
1067 if (isSymbol(propType, propValue)) {
1068 return 'symbol';
1069 }
1070 return propType;
1071 }
1072
1073 // This handles more types than `getPropType`. Only used for error messages.
1074 // See `createPrimitiveTypeChecker`.
1075 function getPreciseType(propValue) {
1076 if (typeof propValue === 'undefined' || propValue === null) {
1077 return '' + propValue;
1078 }
1079 var propType = getPropType(propValue);
1080 if (propType === 'object') {
1081 if (propValue instanceof Date) {
1082 return 'date';
1083 } else if (propValue instanceof RegExp) {
1084 return 'regexp';
1085 }
1086 }
1087 return propType;
1088 }
1089
1090 // Returns a string that is postfixed to a warning about an invalid type.
1091 // For example, "undefined" or "of type array"
1092 function getPostfixForTypeWarning(value) {
1093 var type = getPreciseType(value);
1094 switch (type) {
1095 case 'array':
1096 case 'object':
1097 return 'an ' + type;
1098 case 'boolean':
1099 case 'date':
1100 case 'regexp':
1101 return 'a ' + type;
1102 default:
1103 return type;
1104 }
1105 }
1106
1107 // Returns class name of the object, if any.
1108 function getClassName(propValue) {
1109 if (!propValue.constructor || !propValue.constructor.name) {
1110 return ANONYMOUS;
1111 }
1112 return propValue.constructor.name;
1113 }
1114
1115 ReactPropTypes.checkPropTypes = checkPropTypes_1;
1116 ReactPropTypes.PropTypes = ReactPropTypes;
1117
1118 return ReactPropTypes;
1119 };
1120
1121 var propTypes = createCommonjsModule(function (module) {
1122 /**
1123 * Copyright (c) 2013-present, Facebook, Inc.
1124 *
1125 * This source code is licensed under the MIT license found in the
1126 * LICENSE file in the root directory of this source tree.
1127 */
1128
1129 {
1130 var REACT_ELEMENT_TYPE = (typeof Symbol === 'function' &&
1131 Symbol.for &&
1132 Symbol.for('react.element')) ||
1133 0xeac7;
1134
1135 var isValidElement = function(object) {
1136 return typeof object === 'object' &&
1137 object !== null &&
1138 object.$$typeof === REACT_ELEMENT_TYPE;
1139 };
1140
1141 // By explicitly using `prop-types` you are opting into new development behavior.
1142 // http://fb.me/prop-types-in-prod
1143 var throwOnDirectAccess = true;
1144 module.exports = factoryWithTypeCheckers(isValidElement, throwOnDirectAccess);
1145 }
1146 });
1147
1148 {
1149 module.exports = require('./cjs/react-is.development.js');
1150 }
1151
1152 var reactIs$1 = /*#__PURE__*/Object.freeze({
1153 __proto__: null
1154 });
1155
1156 var ReactIs = /*@__PURE__*/getAugmentedNamespace(reactIs$1);
1157
1158 /**
1159 * Copyright 2015, Yahoo! Inc.
1160 * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
1161 */
1162
1163 var REACT_STATICS$1 = {
1164 childContextTypes: true,
1165 contextType: true,
1166 contextTypes: true,
1167 defaultProps: true,
1168 displayName: true,
1169 getDefaultProps: true,
1170 getDerivedStateFromError: true,
1171 getDerivedStateFromProps: true,
1172 mixins: true,
1173 propTypes: true,
1174 type: true
1175 };
1176
1177 var KNOWN_STATICS$1 = {
1178 name: true,
1179 length: true,
1180 prototype: true,
1181 caller: true,
1182 callee: true,
1183 arguments: true,
1184 arity: true
1185 };
1186
1187 var FORWARD_REF_STATICS$1 = {
1188 '$$typeof': true,
1189 render: true,
1190 defaultProps: true,
1191 displayName: true,
1192 propTypes: true
1193 };
1194
1195 var MEMO_STATICS = {
1196 '$$typeof': true,
1197 compare: true,
1198 defaultProps: true,
1199 displayName: true,
1200 propTypes: true,
1201 type: true
1202 };
1203
1204 var TYPE_STATICS$1 = {};
1205 TYPE_STATICS$1[ReactIs.ForwardRef] = FORWARD_REF_STATICS$1;
1206
1207 function getStatics(component) {
1208 if (ReactIs.isMemo(component)) {
1209 return MEMO_STATICS;
1210 }
1211 return TYPE_STATICS$1[component['$$typeof']] || REACT_STATICS$1;
1212 }
1213
1214 var defineProperty$1 = Object.defineProperty;
1215 var getOwnPropertyNames$1 = Object.getOwnPropertyNames;
1216 var getOwnPropertySymbols$2 = Object.getOwnPropertySymbols;
1217 var getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
1218 var getPrototypeOf$1 = Object.getPrototypeOf;
1219 var objectPrototype$1 = Object.prototype;
1220
1221 function hoistNonReactStatics$1(targetComponent, sourceComponent, blacklist) {
1222 if (typeof sourceComponent !== 'string') {
1223 // don't hoist over string (html) components
1224
1225 if (objectPrototype$1) {
1226 var inheritedComponent = getPrototypeOf$1(sourceComponent);
1227 if (inheritedComponent && inheritedComponent !== objectPrototype$1) {
1228 hoistNonReactStatics$1(targetComponent, inheritedComponent, blacklist);
1229 }
1230 }
1231
1232 var keys = getOwnPropertyNames$1(sourceComponent);
1233
1234 if (getOwnPropertySymbols$2) {
1235 keys = keys.concat(getOwnPropertySymbols$2(sourceComponent));
1236 }
1237
1238 var targetStatics = getStatics(targetComponent);
1239 var sourceStatics = getStatics(sourceComponent);
1240
1241 for (var i = 0; i < keys.length; ++i) {
1242 var key = keys[i];
1243 if (!KNOWN_STATICS$1[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) {
1244 var descriptor = getOwnPropertyDescriptor$1(sourceComponent, key);
1245 try {
1246 // Avoid failures from read-only properties
1247 defineProperty$1(targetComponent, key, descriptor);
1248 } catch (e) {}
1249 }
1250 }
1251
1252 return targetComponent;
1253 }
1254
1255 return targetComponent;
1256 }
1257
1258 var hoistNonReactStatics_cjs$1 = hoistNonReactStatics$1;
1259
1260 var getDisplayName_1 = createCommonjsModule(function (module, exports) {
1261
1262 Object.defineProperty(exports, "__esModule", {
1263 value: true
1264 });
1265 exports.default = getDisplayName;
1266 function getDisplayName(Component) {
1267 return Component.displayName || Component.name || (typeof Component === 'string' && Component.length > 0 ? Component : 'Unknown');
1268 }
1269 });
1270
1271 var getDisplayName = /*@__PURE__*/getDefaultExportFromCjs(getDisplayName_1);
1272
1273 function _defineProperty(obj, key, value) {
1274 if (key in obj) {
1275 Object.defineProperty(obj, key, {
1276 value: value,
1277 enumerable: true,
1278 configurable: true,
1279 writable: true
1280 });
1281 } else {
1282 obj[key] = value;
1283 }
1284
1285 return obj;
1286 }
1287
1288 function _extends$1() {
1289 _extends$1 = Object.assign || function (target) {
1290 for (var i = 1; i < arguments.length; i++) {
1291 var source = arguments[i];
1292
1293 for (var key in source) {
1294 if (Object.prototype.hasOwnProperty.call(source, key)) {
1295 target[key] = source[key];
1296 }
1297 }
1298 }
1299
1300 return target;
1301 };
1302
1303 return _extends$1.apply(this, arguments);
1304 }
1305
1306 function _inheritsLoose(subClass, superClass) {
1307 subClass.prototype = Object.create(superClass.prototype);
1308 subClass.prototype.constructor = subClass;
1309 subClass.__proto__ = superClass;
1310 }
1311
1312 function _assertThisInitialized(self) {
1313 if (self === void 0) {
1314 throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
1315 }
1316
1317 return self;
1318 }
1319
1320 function isObject(obj) {
1321 return obj !== null && typeof obj === 'object' && !Array.isArray(obj);
1322 }
1323
1324 function createThemeProvider(context) {
1325 var ThemeProvider =
1326 /*#__PURE__*/
1327 function (_React$Component) {
1328 _inheritsLoose(ThemeProvider, _React$Component);
1329
1330 function ThemeProvider() {
1331 var _this;
1332
1333 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
1334 args[_key] = arguments[_key];
1335 }
1336
1337 _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
1338
1339 _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "cachedTheme", void 0);
1340
1341 _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "lastOuterTheme", void 0);
1342
1343 _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "lastTheme", void 0);
1344
1345 _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "renderProvider", function (outerTheme) {
1346 var children = _this.props.children;
1347 return React__default['default'].createElement(context.Provider, {
1348 value: _this.getTheme(outerTheme)
1349 }, children);
1350 });
1351
1352 return _this;
1353 }
1354
1355 var _proto = ThemeProvider.prototype;
1356
1357 // Get the theme from the props, supporting both (outerTheme) => {} as well as object notation
1358 _proto.getTheme = function getTheme(outerTheme) {
1359 if (this.props.theme !== this.lastTheme || outerTheme !== this.lastOuterTheme || !this.cachedTheme) {
1360 this.lastOuterTheme = outerTheme;
1361 this.lastTheme = this.props.theme;
1362
1363 if (typeof this.lastTheme === 'function') {
1364 var theme = this.props.theme;
1365 this.cachedTheme = theme(outerTheme);
1366 warning(isObject(this.cachedTheme), '[ThemeProvider] Please return an object from your theme function') ;
1367 } else {
1368 var _theme = this.props.theme;
1369 warning(isObject(_theme), '[ThemeProvider] Please make your theme prop a plain object') ;
1370 this.cachedTheme = outerTheme ? _extends$1({}, outerTheme, _theme) : _theme;
1371 }
1372 }
1373
1374 return this.cachedTheme;
1375 };
1376
1377 _proto.render = function render() {
1378 var children = this.props.children;
1379
1380 if (!children) {
1381 return null;
1382 }
1383
1384 return React__default['default'].createElement(context.Consumer, null, this.renderProvider);
1385 };
1386
1387 return ThemeProvider;
1388 }(React__default['default'].Component);
1389
1390 {
1391 ThemeProvider.propTypes = {
1392 // eslint-disable-next-line react/require-default-props
1393 children: propTypes.node,
1394 theme: propTypes.oneOfType([propTypes.shape({}), propTypes.func]).isRequired
1395 };
1396 }
1397
1398 return ThemeProvider;
1399 }
1400
1401 function createWithTheme(context) {
1402 return function hoc(Component) {
1403 var withTheme = React__default['default'].forwardRef(function (props, ref) {
1404 return React__default['default'].createElement(context.Consumer, null, function (theme) {
1405 warning(isObject(theme), '[theming] Please use withTheme only with the ThemeProvider') ;
1406 return React__default['default'].createElement(Component, _extends$1({
1407 theme: theme,
1408 ref: ref
1409 }, props));
1410 });
1411 });
1412
1413 {
1414 withTheme.displayName = "WithTheme(" + getDisplayName(Component) + ")";
1415 }
1416
1417 hoistNonReactStatics_cjs$1(withTheme, Component);
1418 return withTheme;
1419 };
1420 }
1421
1422 function createUseTheme(context) {
1423 var useTheme = function useTheme() {
1424 var theme = React__default['default'].useContext(context);
1425 warning(isObject(theme), '[theming] Please use useTheme only with the ThemeProvider') ;
1426 return theme;
1427 };
1428
1429 return useTheme;
1430 }
1431
1432 function createTheming(context) {
1433 return {
1434 context: context,
1435 withTheme: createWithTheme(context),
1436 useTheme: createUseTheme(context),
1437 ThemeProvider: createThemeProvider(context)
1438 };
1439 }
1440
1441 var ThemeContext = React.createContext();
1442
1443 var _createTheming = createTheming(ThemeContext),
1444 withTheme = _createTheming.withTheme,
1445 ThemeProvider = _createTheming.ThemeProvider,
1446 useTheme = _createTheming.useTheme;
1447
1448 var getDisplayName$1 = function getDisplayName(Component) {
1449 return Component.displayName || Component.name || 'Component';
1450 };
1451
1452 var memoize = function memoize(fn) {
1453 var lastArgs;
1454 var lastResult;
1455 return function () {
1456 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
1457 args[_key] = arguments[_key];
1458 }
1459
1460 if (Array.isArray(lastArgs) && args.length === lastArgs.length) {
1461 var isSame = true;
1462
1463 for (var i = 0; i < args.length; i++) {
1464 if (args[i] !== lastArgs[i]) {
1465 isSame = false;
1466 }
1467 }
1468
1469 if (isSame) {
1470 return lastResult;
1471 }
1472 }
1473
1474 lastArgs = args;
1475 lastResult = fn.apply(void 0, args);
1476 return lastResult;
1477 };
1478 };
1479
1480 var mergeClasses = function mergeClasses(baseClasses, additionalClasses) {
1481 var combinedClasses = _extends({}, baseClasses);
1482
1483 for (var name in additionalClasses) {
1484 combinedClasses[name] = name in combinedClasses ? combinedClasses[name] + " " + additionalClasses[name] : additionalClasses[name];
1485 }
1486
1487 return combinedClasses;
1488 };
1489
1490 /**
1491 * Global index counter to preserve source order.
1492 * As we create the style sheet during componentWillMount lifecycle,
1493 * children are handled after the parents, so the order of style elements would
1494 * be parent->child. It is a problem though when a parent passes a className
1495 * which needs to override any childs styles. StyleSheet of the child has a higher
1496 * specificity, because of the source order.
1497 * So our solution is to render sheets them in the reverse order child->sheet, so
1498 * that parent has a higher specificity.
1499 *
1500 * We start at [Number.MIN_SAFE_INTEGER] to always insert sheets from react-jss first before any
1501 * sheet which might be inserted manually by the user.
1502 */
1503 var index = Number.MIN_SAFE_INTEGER || -1e9;
1504
1505 var getSheetIndex = function getSheetIndex() {
1506 return index++;
1507 };
1508
1509 var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
1510
1511 var isBrowser = (typeof window === "undefined" ? "undefined" : _typeof(window)) === "object" && (typeof document === "undefined" ? "undefined" : _typeof(document)) === 'object' && document.nodeType === 9;
1512
1513 var JssContext = React.createContext({
1514 classNamePrefix: '',
1515 disableStylesGeneration: false,
1516 isSSR: !isBrowser
1517 });
1518
1519 var defaultManagers = new Map();
1520 var getManager = function getManager(context, managerId) {
1521 // If `managers` map is present in the context, we use it in order to
1522 // let JssProvider reset them when new response has to render server-side.
1523 var managers = context.managers;
1524
1525 if (managers) {
1526 if (!managers[managerId]) {
1527 managers[managerId] = new jss.SheetsManager();
1528 }
1529
1530 return managers[managerId];
1531 }
1532
1533 var manager = defaultManagers.get(managerId);
1534
1535 if (!manager) {
1536 manager = new jss.SheetsManager();
1537 defaultManagers.set(managerId, manager);
1538 }
1539
1540 return manager;
1541 };
1542 var manageSheet = function manageSheet(options) {
1543 var sheet = options.sheet,
1544 context = options.context,
1545 index = options.index,
1546 theme = options.theme;
1547
1548 if (!sheet) {
1549 return;
1550 }
1551
1552 var manager = getManager(context, index);
1553 manager.manage(theme);
1554
1555 if (context.registry) {
1556 context.registry.add(sheet);
1557 }
1558 };
1559 var unmanageSheet = function unmanageSheet(options) {
1560 if (!options.sheet) {
1561 return;
1562 }
1563
1564 var manager = getManager(options.context, options.index);
1565 manager.unmanage(options.theme);
1566 };
1567
1568 var now = Date.now();
1569 var fnValuesNs = "fnValues" + now;
1570 var fnRuleNs = "fnStyle" + ++now;
1571
1572 var functionPlugin = function functionPlugin() {
1573 return {
1574 onCreateRule: function onCreateRule(name, decl, options) {
1575 if (typeof decl !== 'function') return null;
1576 var rule = jss.createRule(name, {}, options);
1577 rule[fnRuleNs] = decl;
1578 return rule;
1579 },
1580 onProcessStyle: function onProcessStyle(style, rule) {
1581 // We need to extract function values from the declaration, so that we can keep core unaware of them.
1582 // We need to do that only once.
1583 // We don't need to extract functions on each style update, since this can happen only once.
1584 // We don't support function values inside of function rules.
1585 if (fnValuesNs in rule || fnRuleNs in rule) return style;
1586 var fnValues = {};
1587
1588 for (var prop in style) {
1589 var value = style[prop];
1590 if (typeof value !== 'function') continue;
1591 delete style[prop];
1592 fnValues[prop] = value;
1593 }
1594
1595 rule[fnValuesNs] = fnValues;
1596 return style;
1597 },
1598 onUpdate: function onUpdate(data, rule, sheet, options) {
1599 var styleRule = rule;
1600 var fnRule = styleRule[fnRuleNs]; // If we have a style function, the entire rule is dynamic and style object
1601 // will be returned from that function.
1602
1603 if (fnRule) {
1604 // Empty object will remove all currently defined props
1605 // in case function rule returns a falsy value.
1606 styleRule.style = fnRule(data) || {};
1607
1608 {
1609 for (var prop in styleRule.style) {
1610 if (typeof styleRule.style[prop] === 'function') {
1611 warning(false, '[JSS] Function values inside function rules are not supported.') ;
1612 break;
1613 }
1614 }
1615 }
1616 }
1617
1618 var fnValues = styleRule[fnValuesNs]; // If we have a fn values map, it is a rule with function values.
1619
1620 if (fnValues) {
1621 for (var _prop in fnValues) {
1622 styleRule.prop(_prop, fnValues[_prop](data), options);
1623 }
1624 }
1625 }
1626 };
1627 };
1628
1629 function symbolObservablePonyfill(root) {
1630 var result;
1631 var Symbol = root.Symbol;
1632
1633 if (typeof Symbol === 'function') {
1634 if (Symbol.observable) {
1635 result = Symbol.observable;
1636 } else {
1637 result = Symbol('observable');
1638 Symbol.observable = result;
1639 }
1640 } else {
1641 result = '@@observable';
1642 }
1643
1644 return result;
1645 }
1646
1647 /* global window */
1648
1649 var root;
1650
1651 if (typeof self !== 'undefined') {
1652 root = self;
1653 } else if (typeof window !== 'undefined') {
1654 root = window;
1655 } else if (typeof global !== 'undefined') {
1656 root = global;
1657 } else if (typeof module !== 'undefined') {
1658 root = module;
1659 } else {
1660 root = Function('return this')();
1661 }
1662
1663 var result = symbolObservablePonyfill(root);
1664
1665 var isObservable = function isObservable(value) {
1666 return value && value[result] && value === value[result]();
1667 };
1668
1669 var observablePlugin = function observablePlugin(updateOptions) {
1670 return {
1671 onCreateRule: function onCreateRule(name, decl, options) {
1672 if (!isObservable(decl)) return null;
1673 var style$ = decl;
1674 var rule = jss.createRule(name, {}, options); // TODO
1675 // Call `stream.subscribe()` returns a subscription, which should be explicitly
1676 // unsubscribed from when we know this sheet is no longer needed.
1677
1678 style$.subscribe(function (style) {
1679 for (var prop in style) {
1680 rule.prop(prop, style[prop], updateOptions);
1681 }
1682 });
1683 return rule;
1684 },
1685 onProcessRule: function onProcessRule(rule) {
1686 if (rule && rule.type !== 'style') return;
1687 var styleRule = rule;
1688 var style = styleRule.style;
1689
1690 var _loop = function _loop(prop) {
1691 var value = style[prop];
1692 if (!isObservable(value)) return "continue";
1693 delete style[prop];
1694 value.subscribe({
1695 next: function next(nextValue) {
1696 styleRule.prop(prop, nextValue, updateOptions);
1697 }
1698 });
1699 };
1700
1701 for (var prop in style) {
1702 var _ret = _loop(prop);
1703
1704 if (_ret === "continue") continue;
1705 }
1706 }
1707 };
1708 };
1709
1710 var semiWithNl = /;\n/;
1711 /**
1712 * Naive CSS parser.
1713 * - Supports only rule body (no selectors)
1714 * - Requires semicolon and new line after the value (except of last line)
1715 * - No nested rules support
1716 */
1717
1718 var parse = function parse(cssText) {
1719 var style = {};
1720 var split = cssText.split(semiWithNl);
1721
1722 for (var i = 0; i < split.length; i++) {
1723 var decl = (split[i] || '').trim();
1724 if (!decl) continue;
1725 var colonIndex = decl.indexOf(':');
1726
1727 if (colonIndex === -1) {
1728 warning(false, "[JSS] Malformed CSS string \"" + decl + "\"") ;
1729 continue;
1730 }
1731
1732 var prop = decl.substr(0, colonIndex).trim();
1733 var value = decl.substr(colonIndex + 1).trim();
1734 style[prop] = value;
1735 }
1736
1737 return style;
1738 };
1739
1740 var onProcessRule = function onProcessRule(rule) {
1741 if (typeof rule.style === 'string') {
1742 rule.style = parse(rule.style);
1743 }
1744 };
1745
1746 function templatePlugin() {
1747 return {
1748 onProcessRule: onProcessRule
1749 };
1750 }
1751
1752 var at = '@global';
1753 var atPrefix = '@global ';
1754
1755 var GlobalContainerRule =
1756 /*#__PURE__*/
1757 function () {
1758 function GlobalContainerRule(key, styles, options) {
1759 this.type = 'global';
1760 this.at = at;
1761 this.isProcessed = false;
1762 this.key = key;
1763 this.options = options;
1764 this.rules = new jss.RuleList(_extends({}, options, {
1765 parent: this
1766 }));
1767
1768 for (var selector in styles) {
1769 this.rules.add(selector, styles[selector]);
1770 }
1771
1772 this.rules.process();
1773 }
1774 /**
1775 * Get a rule.
1776 */
1777
1778
1779 var _proto = GlobalContainerRule.prototype;
1780
1781 _proto.getRule = function getRule(name) {
1782 return this.rules.get(name);
1783 }
1784 /**
1785 * Create and register rule, run plugins.
1786 */
1787 ;
1788
1789 _proto.addRule = function addRule(name, style, options) {
1790 var rule = this.rules.add(name, style, options);
1791 if (rule) this.options.jss.plugins.onProcessRule(rule);
1792 return rule;
1793 }
1794 /**
1795 * Replace rule, run plugins.
1796 */
1797 ;
1798
1799 _proto.replaceRule = function replaceRule(name, style, options) {
1800 var newRule = this.rules.replace(name, style, options);
1801 if (newRule) this.options.jss.plugins.onProcessRule(newRule);
1802 return newRule;
1803 }
1804 /**
1805 * Get index of a rule.
1806 */
1807 ;
1808
1809 _proto.indexOf = function indexOf(rule) {
1810 return this.rules.indexOf(rule);
1811 }
1812 /**
1813 * Generates a CSS string.
1814 */
1815 ;
1816
1817 _proto.toString = function toString(options) {
1818 return this.rules.toString(options);
1819 };
1820
1821 return GlobalContainerRule;
1822 }();
1823
1824 var GlobalPrefixedRule =
1825 /*#__PURE__*/
1826 function () {
1827 function GlobalPrefixedRule(key, style, options) {
1828 this.type = 'global';
1829 this.at = at;
1830 this.isProcessed = false;
1831 this.key = key;
1832 this.options = options;
1833 var selector = key.substr(atPrefix.length);
1834 this.rule = options.jss.createRule(selector, style, _extends({}, options, {
1835 parent: this
1836 }));
1837 }
1838
1839 var _proto2 = GlobalPrefixedRule.prototype;
1840
1841 _proto2.toString = function toString(options) {
1842 return this.rule ? this.rule.toString(options) : '';
1843 };
1844
1845 return GlobalPrefixedRule;
1846 }();
1847
1848 var separatorRegExp = /\s*,\s*/g;
1849
1850 function addScope(selector, scope) {
1851 var parts = selector.split(separatorRegExp);
1852 var scoped = '';
1853
1854 for (var i = 0; i < parts.length; i++) {
1855 scoped += scope + " " + parts[i].trim();
1856 if (parts[i + 1]) scoped += ', ';
1857 }
1858
1859 return scoped;
1860 }
1861
1862 function handleNestedGlobalContainerRule(rule, sheet) {
1863 var options = rule.options,
1864 style = rule.style;
1865 var rules = style ? style[at] : null;
1866 if (!rules) return;
1867
1868 for (var name in rules) {
1869 sheet.addRule(name, rules[name], _extends({}, options, {
1870 selector: addScope(name, rule.selector)
1871 }));
1872 }
1873
1874 delete style[at];
1875 }
1876
1877 function handlePrefixedGlobalRule(rule, sheet) {
1878 var options = rule.options,
1879 style = rule.style;
1880
1881 for (var prop in style) {
1882 if (prop[0] !== '@' || prop.substr(0, at.length) !== at) continue;
1883 var selector = addScope(prop.substr(at.length), rule.selector);
1884 sheet.addRule(selector, style[prop], _extends({}, options, {
1885 selector: selector
1886 }));
1887 delete style[prop];
1888 }
1889 }
1890 /**
1891 * Convert nested rules to separate, remove them from original styles.
1892 */
1893
1894
1895 function jssGlobal() {
1896 function onCreateRule(name, styles, options) {
1897 if (!name) return null;
1898
1899 if (name === at) {
1900 return new GlobalContainerRule(name, styles, options);
1901 }
1902
1903 if (name[0] === '@' && name.substr(0, atPrefix.length) === atPrefix) {
1904 return new GlobalPrefixedRule(name, styles, options);
1905 }
1906
1907 var parent = options.parent;
1908
1909 if (parent) {
1910 if (parent.type === 'global' || parent.options.parent && parent.options.parent.type === 'global') {
1911 options.scoped = false;
1912 }
1913 }
1914
1915 if (!options.selector && options.scoped === false) {
1916 options.selector = name;
1917 }
1918
1919 return null;
1920 }
1921
1922 function onProcessRule(rule, sheet) {
1923 if (rule.type !== 'style' || !sheet) return;
1924 handleNestedGlobalContainerRule(rule, sheet);
1925 handlePrefixedGlobalRule(rule, sheet);
1926 }
1927
1928 return {
1929 onCreateRule: onCreateRule,
1930 onProcessRule: onProcessRule
1931 };
1932 }
1933
1934 var isObject$1 = function isObject(obj) {
1935 return obj && typeof obj === 'object' && !Array.isArray(obj);
1936 };
1937
1938 var valueNs = "extendCurrValue" + Date.now();
1939
1940 function mergeExtend(style, rule, sheet, newStyle) {
1941 var extendType = typeof style.extend; // Extend using a rule name.
1942
1943 if (extendType === 'string') {
1944 if (!sheet) return;
1945 var refRule = sheet.getRule(style.extend);
1946 if (!refRule) return;
1947
1948 if (refRule === rule) {
1949 warning(false, "[JSS] A rule tries to extend itself \n" + rule.toString()) ;
1950 return;
1951 }
1952
1953 var parent = refRule.options.parent;
1954
1955 if (parent) {
1956 var originalStyle = parent.rules.raw[style.extend];
1957 extend(originalStyle, rule, sheet, newStyle);
1958 }
1959
1960 return;
1961 } // Extend using an array.
1962
1963
1964 if (Array.isArray(style.extend)) {
1965 for (var index = 0; index < style.extend.length; index++) {
1966 var singleExtend = style.extend[index];
1967 var singleStyle = typeof singleExtend === 'string' ? _extends({}, style, {
1968 extend: singleExtend
1969 }) : style.extend[index];
1970 extend(singleStyle, rule, sheet, newStyle);
1971 }
1972
1973 return;
1974 } // Extend is a style object.
1975
1976
1977 for (var prop in style.extend) {
1978 if (prop === 'extend') {
1979 extend(style.extend.extend, rule, sheet, newStyle);
1980 continue;
1981 }
1982
1983 if (isObject$1(style.extend[prop])) {
1984 if (!(prop in newStyle)) newStyle[prop] = {};
1985 extend(style.extend[prop], rule, sheet, newStyle[prop]);
1986 continue;
1987 }
1988
1989 newStyle[prop] = style.extend[prop];
1990 }
1991 }
1992
1993 function mergeRest(style, rule, sheet, newStyle) {
1994 // Copy base style.
1995 for (var prop in style) {
1996 if (prop === 'extend') continue;
1997
1998 if (isObject$1(newStyle[prop]) && isObject$1(style[prop])) {
1999 extend(style[prop], rule, sheet, newStyle[prop]);
2000 continue;
2001 }
2002
2003 if (isObject$1(style[prop])) {
2004 newStyle[prop] = extend(style[prop], rule, sheet);
2005 continue;
2006 }
2007
2008 newStyle[prop] = style[prop];
2009 }
2010 }
2011 /**
2012 * Recursively extend styles.
2013 */
2014
2015
2016 function extend(style, rule, sheet, newStyle) {
2017 if (newStyle === void 0) {
2018 newStyle = {};
2019 }
2020
2021 mergeExtend(style, rule, sheet, newStyle);
2022 mergeRest(style, rule, sheet, newStyle);
2023 return newStyle;
2024 }
2025 /**
2026 * Handle `extend` property.
2027 */
2028
2029
2030 function jssExtend() {
2031 function onProcessStyle(style, rule, sheet) {
2032 if ('extend' in style) return extend(style, rule, sheet);
2033 return style;
2034 }
2035
2036 function onChangeValue(value, prop, rule) {
2037 if (prop !== 'extend') return value; // Value is empty, remove properties set previously.
2038
2039 if (value == null || value === false) {
2040 for (var key in rule[valueNs]) {
2041 rule.prop(key, null);
2042 }
2043
2044 rule[valueNs] = null;
2045 return null;
2046 }
2047
2048 if (typeof value === 'object') {
2049 for (var _key in value) {
2050 rule.prop(_key, value[_key]);
2051 }
2052
2053 rule[valueNs] = value;
2054 } // Make sure we don't set the value in the core.
2055
2056
2057 return null;
2058 }
2059
2060 return {
2061 onProcessStyle: onProcessStyle,
2062 onChangeValue: onChangeValue
2063 };
2064 }
2065
2066 var separatorRegExp$1 = /\s*,\s*/g;
2067 var parentRegExp = /&/g;
2068 var refRegExp = /\$([\w-]+)/g;
2069 /**
2070 * Convert nested rules to separate, remove them from original styles.
2071 */
2072
2073 function jssNested() {
2074 // Get a function to be used for $ref replacement.
2075 function getReplaceRef(container, sheet) {
2076 return function (match, key) {
2077 var rule = container.getRule(key) || sheet && sheet.getRule(key);
2078
2079 if (rule) {
2080 return rule.selector;
2081 }
2082
2083 warning(false, "[JSS] Could not find the referenced rule \"" + key + "\" in \"" + (container.options.meta || container.toString()) + "\".") ;
2084 return key;
2085 };
2086 }
2087
2088 function replaceParentRefs(nestedProp, parentProp) {
2089 var parentSelectors = parentProp.split(separatorRegExp$1);
2090 var nestedSelectors = nestedProp.split(separatorRegExp$1);
2091 var result = '';
2092
2093 for (var i = 0; i < parentSelectors.length; i++) {
2094 var parent = parentSelectors[i];
2095
2096 for (var j = 0; j < nestedSelectors.length; j++) {
2097 var nested = nestedSelectors[j];
2098 if (result) result += ', '; // Replace all & by the parent or prefix & with the parent.
2099
2100 result += nested.indexOf('&') !== -1 ? nested.replace(parentRegExp, parent) : parent + " " + nested;
2101 }
2102 }
2103
2104 return result;
2105 }
2106
2107 function getOptions(rule, container, prevOptions) {
2108 // Options has been already created, now we only increase index.
2109 if (prevOptions) return _extends({}, prevOptions, {
2110 index: prevOptions.index + 1
2111 });
2112 var nestingLevel = rule.options.nestingLevel;
2113 nestingLevel = nestingLevel === undefined ? 1 : nestingLevel + 1;
2114
2115 var options = _extends({}, rule.options, {
2116 nestingLevel: nestingLevel,
2117 index: container.indexOf(rule) + 1 // We don't need the parent name to be set options for chlid.
2118
2119 });
2120
2121 delete options.name;
2122 return options;
2123 }
2124
2125 function onProcessStyle(style, rule, sheet) {
2126 if (rule.type !== 'style') return style;
2127 var styleRule = rule;
2128 var container = styleRule.options.parent;
2129 var options;
2130 var replaceRef;
2131
2132 for (var prop in style) {
2133 var isNested = prop.indexOf('&') !== -1;
2134 var isNestedConditional = prop[0] === '@';
2135 if (!isNested && !isNestedConditional) continue;
2136 options = getOptions(styleRule, container, options);
2137
2138 if (isNested) {
2139 var selector = replaceParentRefs(prop, styleRule.selector); // Lazily create the ref replacer function just once for
2140 // all nested rules within the sheet.
2141
2142 if (!replaceRef) replaceRef = getReplaceRef(container, sheet); // Replace all $refs.
2143
2144 selector = selector.replace(refRegExp, replaceRef);
2145 var name = styleRule.key + "-" + prop;
2146
2147 if ('replaceRule' in container) {
2148 // for backward compatibility
2149 container.replaceRule(name, style[prop], _extends({}, options, {
2150 selector: selector
2151 }));
2152 } else {
2153 container.addRule(name, style[prop], _extends({}, options, {
2154 selector: selector
2155 }));
2156 }
2157 } else if (isNestedConditional) {
2158 // Place conditional right after the parent rule to ensure right ordering.
2159 container.addRule(prop, {}, options).addRule(styleRule.key, style[prop], {
2160 selector: styleRule.selector
2161 });
2162 }
2163
2164 delete style[prop];
2165 }
2166
2167 return style;
2168 }
2169
2170 return {
2171 onProcessStyle: onProcessStyle
2172 };
2173 }
2174
2175 /**
2176 * Set selector.
2177 *
2178 * @param original rule
2179 * @param className class string
2180 * @return flag indicating function was successfull or not
2181 */
2182
2183 function registerClass(rule, className) {
2184 // Skip falsy values
2185 if (!className) return true; // Support array of class names `{composes: ['foo', 'bar']}`
2186
2187 if (Array.isArray(className)) {
2188 for (var index = 0; index < className.length; index++) {
2189 var isSetted = registerClass(rule, className[index]);
2190 if (!isSetted) return false;
2191 }
2192
2193 return true;
2194 } // Support space separated class names `{composes: 'foo bar'}`
2195
2196
2197 if (className.indexOf(' ') > -1) {
2198 return registerClass(rule, className.split(' '));
2199 }
2200
2201 var parent = rule.options.parent; // It is a ref to a local rule.
2202
2203 if (className[0] === '$') {
2204 var refRule = parent.getRule(className.substr(1));
2205
2206 if (!refRule) {
2207 warning(false, "[JSS] Referenced rule is not defined. \n" + rule.toString()) ;
2208 return false;
2209 }
2210
2211 if (refRule === rule) {
2212 warning(false, "[JSS] Cyclic composition detected. \n" + rule.toString()) ;
2213 return false;
2214 }
2215
2216 parent.classes[rule.key] += " " + parent.classes[refRule.key];
2217 return true;
2218 }
2219
2220 parent.classes[rule.key] += " " + className;
2221 return true;
2222 }
2223 /**
2224 * Convert compose property to additional class, remove property from original styles.
2225 */
2226
2227
2228 function jssCompose() {
2229 function onProcessStyle(style, rule) {
2230 if (!('composes' in style)) return style;
2231 registerClass(rule, style.composes); // Remove composes property to prevent infinite loop.
2232
2233 delete style.composes;
2234 return style;
2235 }
2236
2237 return {
2238 onProcessStyle: onProcessStyle
2239 };
2240 }
2241
2242 /* eslint-disable no-var, prefer-template */
2243 var uppercasePattern = /[A-Z]/g;
2244 var msPattern = /^ms-/;
2245 var cache = {};
2246
2247 function toHyphenLower(match) {
2248 return '-' + match.toLowerCase()
2249 }
2250
2251 function hyphenateStyleName(name) {
2252 if (cache.hasOwnProperty(name)) {
2253 return cache[name]
2254 }
2255
2256 var hName = name.replace(uppercasePattern, toHyphenLower);
2257 return (cache[name] = msPattern.test(hName) ? '-' + hName : hName)
2258 }
2259
2260 /**
2261 * Convert camel cased property names to dash separated.
2262 */
2263
2264 function convertCase(style) {
2265 var converted = {};
2266
2267 for (var prop in style) {
2268 var key = prop.indexOf('--') === 0 ? prop : hyphenateStyleName(prop);
2269 converted[key] = style[prop];
2270 }
2271
2272 if (style.fallbacks) {
2273 if (Array.isArray(style.fallbacks)) converted.fallbacks = style.fallbacks.map(convertCase);else converted.fallbacks = convertCase(style.fallbacks);
2274 }
2275
2276 return converted;
2277 }
2278 /**
2279 * Allow camel cased property names by converting them back to dasherized.
2280 */
2281
2282
2283 function camelCase() {
2284 function onProcessStyle(style) {
2285 if (Array.isArray(style)) {
2286 // Handle rules like @font-face, which can have multiple styles in an array
2287 for (var index = 0; index < style.length; index++) {
2288 style[index] = convertCase(style[index]);
2289 }
2290
2291 return style;
2292 }
2293
2294 return convertCase(style);
2295 }
2296
2297 function onChangeValue(value, prop, rule) {
2298 if (prop.indexOf('--') === 0) {
2299 return value;
2300 }
2301
2302 var hyphenatedProp = hyphenateStyleName(prop); // There was no camel case in place
2303
2304 if (prop === hyphenatedProp) return value;
2305 rule.prop(hyphenatedProp, value); // Core will ignore that property value we set the proper one above.
2306
2307 return null;
2308 }
2309
2310 return {
2311 onProcessStyle: onProcessStyle,
2312 onChangeValue: onChangeValue
2313 };
2314 }
2315
2316 var px = jss.hasCSSTOMSupport && CSS ? CSS.px : 'px';
2317 var ms = jss.hasCSSTOMSupport && CSS ? CSS.ms : 'ms';
2318 var percent = jss.hasCSSTOMSupport && CSS ? CSS.percent : '%';
2319 /**
2320 * Generated jss-plugin-default-unit CSS property units
2321 */
2322
2323 var defaultUnits = {
2324 // Animation properties
2325 'animation-delay': ms,
2326 'animation-duration': ms,
2327 // Background properties
2328 'background-position': px,
2329 'background-position-x': px,
2330 'background-position-y': px,
2331 'background-size': px,
2332 // Border Properties
2333 border: px,
2334 'border-bottom': px,
2335 'border-bottom-left-radius': px,
2336 'border-bottom-right-radius': px,
2337 'border-bottom-width': px,
2338 'border-left': px,
2339 'border-left-width': px,
2340 'border-radius': px,
2341 'border-right': px,
2342 'border-right-width': px,
2343 'border-top': px,
2344 'border-top-left-radius': px,
2345 'border-top-right-radius': px,
2346 'border-top-width': px,
2347 'border-width': px,
2348 'border-block': px,
2349 'border-block-end': px,
2350 'border-block-end-width': px,
2351 'border-block-start': px,
2352 'border-block-start-width': px,
2353 'border-block-width': px,
2354 'border-inline': px,
2355 'border-inline-end': px,
2356 'border-inline-end-width': px,
2357 'border-inline-start': px,
2358 'border-inline-start-width': px,
2359 'border-inline-width': px,
2360 'border-start-start-radius': px,
2361 'border-start-end-radius': px,
2362 'border-end-start-radius': px,
2363 'border-end-end-radius': px,
2364 // Margin properties
2365 margin: px,
2366 'margin-bottom': px,
2367 'margin-left': px,
2368 'margin-right': px,
2369 'margin-top': px,
2370 'margin-block': px,
2371 'margin-block-end': px,
2372 'margin-block-start': px,
2373 'margin-inline': px,
2374 'margin-inline-end': px,
2375 'margin-inline-start': px,
2376 // Padding properties
2377 padding: px,
2378 'padding-bottom': px,
2379 'padding-left': px,
2380 'padding-right': px,
2381 'padding-top': px,
2382 'padding-block': px,
2383 'padding-block-end': px,
2384 'padding-block-start': px,
2385 'padding-inline': px,
2386 'padding-inline-end': px,
2387 'padding-inline-start': px,
2388 // Mask properties
2389 'mask-position-x': px,
2390 'mask-position-y': px,
2391 'mask-size': px,
2392 // Width and height properties
2393 height: px,
2394 width: px,
2395 'min-height': px,
2396 'max-height': px,
2397 'min-width': px,
2398 'max-width': px,
2399 // Position properties
2400 bottom: px,
2401 left: px,
2402 top: px,
2403 right: px,
2404 inset: px,
2405 'inset-block': px,
2406 'inset-block-end': px,
2407 'inset-block-start': px,
2408 'inset-inline': px,
2409 'inset-inline-end': px,
2410 'inset-inline-start': px,
2411 // Shadow properties
2412 'box-shadow': px,
2413 'text-shadow': px,
2414 // Column properties
2415 'column-gap': px,
2416 'column-rule': px,
2417 'column-rule-width': px,
2418 'column-width': px,
2419 // Font and text properties
2420 'font-size': px,
2421 'font-size-delta': px,
2422 'letter-spacing': px,
2423 'text-decoration-thickness': px,
2424 'text-indent': px,
2425 'text-stroke': px,
2426 'text-stroke-width': px,
2427 'word-spacing': px,
2428 // Motion properties
2429 motion: px,
2430 'motion-offset': px,
2431 // Outline properties
2432 outline: px,
2433 'outline-offset': px,
2434 'outline-width': px,
2435 // Perspective properties
2436 perspective: px,
2437 'perspective-origin-x': percent,
2438 'perspective-origin-y': percent,
2439 // Transform properties
2440 'transform-origin': percent,
2441 'transform-origin-x': percent,
2442 'transform-origin-y': percent,
2443 'transform-origin-z': percent,
2444 // Transition properties
2445 'transition-delay': ms,
2446 'transition-duration': ms,
2447 // Alignment properties
2448 'vertical-align': px,
2449 'flex-basis': px,
2450 // Some random properties
2451 'shape-margin': px,
2452 size: px,
2453 gap: px,
2454 // Grid properties
2455 grid: px,
2456 'grid-gap': px,
2457 'row-gap': px,
2458 'grid-row-gap': px,
2459 'grid-column-gap': px,
2460 'grid-template-rows': px,
2461 'grid-template-columns': px,
2462 'grid-auto-rows': px,
2463 'grid-auto-columns': px,
2464 // Not existing properties.
2465 // Used to avoid issues with jss-plugin-expand integration.
2466 'box-shadow-x': px,
2467 'box-shadow-y': px,
2468 'box-shadow-blur': px,
2469 'box-shadow-spread': px,
2470 'font-line-height': px,
2471 'text-shadow-x': px,
2472 'text-shadow-y': px,
2473 'text-shadow-blur': px
2474 };
2475 /**
2476 * Clones the object and adds a camel cased property version.
2477 */
2478
2479 function addCamelCasedVersion(obj) {
2480 var regExp = /(-[a-z])/g;
2481
2482 var replace = function replace(str) {
2483 return str[1].toUpperCase();
2484 };
2485
2486 var newObj = {};
2487
2488 for (var key in obj) {
2489 newObj[key] = obj[key];
2490 newObj[key.replace(regExp, replace)] = obj[key];
2491 }
2492
2493 return newObj;
2494 }
2495
2496 var units = addCamelCasedVersion(defaultUnits);
2497 /**
2498 * Recursive deep style passing function
2499 */
2500
2501 function iterate(prop, value, options) {
2502 if (value == null) return value;
2503
2504 if (Array.isArray(value)) {
2505 for (var i = 0; i < value.length; i++) {
2506 value[i] = iterate(prop, value[i], options);
2507 }
2508 } else if (typeof value === 'object') {
2509 if (prop === 'fallbacks') {
2510 for (var innerProp in value) {
2511 value[innerProp] = iterate(innerProp, value[innerProp], options);
2512 }
2513 } else {
2514 for (var _innerProp in value) {
2515 value[_innerProp] = iterate(prop + "-" + _innerProp, value[_innerProp], options);
2516 }
2517 } // eslint-disable-next-line no-restricted-globals
2518
2519 } else if (typeof value === 'number' && isNaN(value) === false) {
2520 var unit = options[prop] || units[prop]; // Add the unit if available, except for the special case of 0px.
2521
2522 if (unit && !(value === 0 && unit === px)) {
2523 return typeof unit === 'function' ? unit(value).toString() : "" + value + unit;
2524 }
2525
2526 return value.toString();
2527 }
2528
2529 return value;
2530 }
2531 /**
2532 * Add unit to numeric values.
2533 */
2534
2535
2536 function defaultUnit(options) {
2537 if (options === void 0) {
2538 options = {};
2539 }
2540
2541 var camelCasedOptions = addCamelCasedVersion(options);
2542
2543 function onProcessStyle(style, rule) {
2544 if (rule.type !== 'style') return style;
2545
2546 for (var prop in style) {
2547 style[prop] = iterate(prop, style[prop], camelCasedOptions);
2548 }
2549
2550 return style;
2551 }
2552
2553 function onChangeValue(value, prop) {
2554 return iterate(prop, value, camelCasedOptions);
2555 }
2556
2557 return {
2558 onProcessStyle: onProcessStyle,
2559 onChangeValue: onChangeValue
2560 };
2561 }
2562
2563 /**
2564 * A scheme for converting properties from array to regular style.
2565 * All properties listed below will be transformed to a string separated by space.
2566 */
2567 var propArray = {
2568 'background-size': true,
2569 'background-position': true,
2570 border: true,
2571 'border-bottom': true,
2572 'border-left': true,
2573 'border-top': true,
2574 'border-right': true,
2575 'border-radius': true,
2576 'border-image': true,
2577 'border-width': true,
2578 'border-style': true,
2579 'border-color': true,
2580 'box-shadow': true,
2581 flex: true,
2582 margin: true,
2583 padding: true,
2584 outline: true,
2585 'transform-origin': true,
2586 transform: true,
2587 transition: true
2588 /**
2589 * A scheme for converting arrays to regular styles inside of objects.
2590 * For e.g.: "{position: [0, 0]}" => "background-position: 0 0;".
2591 */
2592
2593 };
2594 var propArrayInObj = {
2595 position: true,
2596 // background-position
2597 size: true // background-size
2598
2599 /**
2600 * A scheme for parsing and building correct styles from passed objects.
2601 */
2602
2603 };
2604 var propObj = {
2605 padding: {
2606 top: 0,
2607 right: 0,
2608 bottom: 0,
2609 left: 0
2610 },
2611 margin: {
2612 top: 0,
2613 right: 0,
2614 bottom: 0,
2615 left: 0
2616 },
2617 background: {
2618 attachment: null,
2619 color: null,
2620 image: null,
2621 position: null,
2622 repeat: null
2623 },
2624 border: {
2625 width: null,
2626 style: null,
2627 color: null
2628 },
2629 'border-top': {
2630 width: null,
2631 style: null,
2632 color: null
2633 },
2634 'border-right': {
2635 width: null,
2636 style: null,
2637 color: null
2638 },
2639 'border-bottom': {
2640 width: null,
2641 style: null,
2642 color: null
2643 },
2644 'border-left': {
2645 width: null,
2646 style: null,
2647 color: null
2648 },
2649 outline: {
2650 width: null,
2651 style: null,
2652 color: null
2653 },
2654 'list-style': {
2655 type: null,
2656 position: null,
2657 image: null
2658 },
2659 transition: {
2660 property: null,
2661 duration: null,
2662 'timing-function': null,
2663 timingFunction: null,
2664 // Needed for avoiding comilation issues with jss-plugin-camel-case
2665 delay: null
2666 },
2667 animation: {
2668 name: null,
2669 duration: null,
2670 'timing-function': null,
2671 timingFunction: null,
2672 // Needed to avoid compilation issues with jss-plugin-camel-case
2673 delay: null,
2674 'iteration-count': null,
2675 iterationCount: null,
2676 // Needed to avoid compilation issues with jss-plugin-camel-case
2677 direction: null,
2678 'fill-mode': null,
2679 fillMode: null,
2680 // Needed to avoid compilation issues with jss-plugin-camel-case
2681 'play-state': null,
2682 playState: null // Needed to avoid compilation issues with jss-plugin-camel-case
2683
2684 },
2685 'box-shadow': {
2686 x: 0,
2687 y: 0,
2688 blur: 0,
2689 spread: 0,
2690 color: null,
2691 inset: null
2692 },
2693 'text-shadow': {
2694 x: 0,
2695 y: 0,
2696 blur: null,
2697 color: null
2698 /**
2699 * A scheme for converting non-standart properties inside object.
2700 * For e.g.: include 'border-radius' property inside 'border' object.
2701 */
2702
2703 }
2704 };
2705 var customPropObj = {
2706 border: {
2707 radius: 'border-radius',
2708 image: 'border-image',
2709 width: 'border-width',
2710 style: 'border-style',
2711 color: 'border-color'
2712 },
2713 'border-bottom': {
2714 width: 'border-bottom-width',
2715 style: 'border-bottom-style',
2716 color: 'border-bottom-color'
2717 },
2718 'border-top': {
2719 width: 'border-top-width',
2720 style: 'border-top-style',
2721 color: 'border-top-color'
2722 },
2723 'border-left': {
2724 width: 'border-left-width',
2725 style: 'border-left-style',
2726 color: 'border-left-color'
2727 },
2728 'border-right': {
2729 width: 'border-right-width',
2730 style: 'border-right-style',
2731 color: 'border-right-color'
2732 },
2733 background: {
2734 size: 'background-size',
2735 image: 'background-image'
2736 },
2737 font: {
2738 style: 'font-style',
2739 variant: 'font-variant',
2740 weight: 'font-weight',
2741 stretch: 'font-stretch',
2742 size: 'font-size',
2743 family: 'font-family',
2744 lineHeight: 'line-height',
2745 // Needed to avoid compilation issues with jss-plugin-camel-case
2746 'line-height': 'line-height'
2747 },
2748 flex: {
2749 grow: 'flex-grow',
2750 basis: 'flex-basis',
2751 direction: 'flex-direction',
2752 wrap: 'flex-wrap',
2753 flow: 'flex-flow',
2754 shrink: 'flex-shrink'
2755 },
2756 align: {
2757 self: 'align-self',
2758 items: 'align-items',
2759 content: 'align-content'
2760 },
2761 grid: {
2762 'template-columns': 'grid-template-columns',
2763 templateColumns: 'grid-template-columns',
2764 'template-rows': 'grid-template-rows',
2765 templateRows: 'grid-template-rows',
2766 'template-areas': 'grid-template-areas',
2767 templateAreas: 'grid-template-areas',
2768 template: 'grid-template',
2769 'auto-columns': 'grid-auto-columns',
2770 autoColumns: 'grid-auto-columns',
2771 'auto-rows': 'grid-auto-rows',
2772 autoRows: 'grid-auto-rows',
2773 'auto-flow': 'grid-auto-flow',
2774 autoFlow: 'grid-auto-flow',
2775 row: 'grid-row',
2776 column: 'grid-column',
2777 'row-start': 'grid-row-start',
2778 rowStart: 'grid-row-start',
2779 'row-end': 'grid-row-end',
2780 rowEnd: 'grid-row-end',
2781 'column-start': 'grid-column-start',
2782 columnStart: 'grid-column-start',
2783 'column-end': 'grid-column-end',
2784 columnEnd: 'grid-column-end',
2785 area: 'grid-area',
2786 gap: 'grid-gap',
2787 'row-gap': 'grid-row-gap',
2788 rowGap: 'grid-row-gap',
2789 'column-gap': 'grid-column-gap',
2790 columnGap: 'grid-column-gap'
2791 }
2792 };
2793 /* eslint-disable no-use-before-define */
2794
2795 /**
2796 * Map values by given prop.
2797 *
2798 * @param {Array} array of values
2799 * @param {String} original property
2800 * @param {String} original rule
2801 * @return {String} mapped values
2802 */
2803
2804 function mapValuesByProp(value, prop, rule) {
2805 return value.map(function (item) {
2806 return objectToArray(item, prop, rule, false, true);
2807 });
2808 }
2809 /**
2810 * Convert array to nested array, if needed
2811 */
2812
2813
2814 function processArray(value, prop, scheme, rule) {
2815 if (scheme[prop] == null) return value;
2816 if (value.length === 0) return [];
2817 if (Array.isArray(value[0])) return processArray(value[0], prop, scheme, rule);
2818
2819 if (typeof value[0] === 'object') {
2820 return mapValuesByProp(value, prop, rule);
2821 }
2822
2823 return [value];
2824 }
2825 /**
2826 * Convert object to array.
2827 */
2828
2829
2830 function objectToArray(value, prop, rule, isFallback, isInArray) {
2831 if (!(propObj[prop] || customPropObj[prop])) return [];
2832 var result = []; // Check if exists any non-standard property
2833
2834 if (customPropObj[prop]) {
2835 // eslint-disable-next-line no-param-reassign
2836 value = customPropsToStyle(value, rule, customPropObj[prop], isFallback);
2837 } // Pass throught all standart props
2838
2839
2840 if (Object.keys(value).length) {
2841 for (var baseProp in propObj[prop]) {
2842 if (value[baseProp]) {
2843 if (Array.isArray(value[baseProp])) {
2844 result.push(propArrayInObj[baseProp] === null ? value[baseProp] : value[baseProp].join(' '));
2845 } else result.push(value[baseProp]);
2846
2847 continue;
2848 } // Add default value from props config.
2849
2850
2851 if (propObj[prop][baseProp] != null) {
2852 result.push(propObj[prop][baseProp]);
2853 }
2854 }
2855 }
2856
2857 if (!result.length || isInArray) return result;
2858 return [result];
2859 }
2860 /**
2861 * Convert custom properties values to styles adding them to rule directly
2862 */
2863
2864
2865 function customPropsToStyle(value, rule, customProps, isFallback) {
2866 for (var prop in customProps) {
2867 var propName = customProps[prop]; // If current property doesn't exist already in rule - add new one
2868
2869 if (typeof value[prop] !== 'undefined' && (isFallback || !rule.prop(propName))) {
2870 var _styleDetector;
2871
2872 var appendedValue = styleDetector((_styleDetector = {}, _styleDetector[propName] = value[prop], _styleDetector), rule)[propName]; // Add style directly in rule
2873
2874 if (isFallback) rule.style.fallbacks[propName] = appendedValue;else rule.style[propName] = appendedValue;
2875 } // Delete converted property to avoid double converting
2876
2877
2878 delete value[prop];
2879 }
2880
2881 return value;
2882 }
2883 /**
2884 * Detect if a style needs to be converted.
2885 */
2886
2887
2888 function styleDetector(style, rule, isFallback) {
2889 for (var prop in style) {
2890 var value = style[prop];
2891
2892 if (Array.isArray(value)) {
2893 // Check double arrays to avoid recursion.
2894 if (!Array.isArray(value[0])) {
2895 if (prop === 'fallbacks') {
2896 for (var index = 0; index < style.fallbacks.length; index++) {
2897 style.fallbacks[index] = styleDetector(style.fallbacks[index], rule, true);
2898 }
2899
2900 continue;
2901 }
2902
2903 style[prop] = processArray(value, prop, propArray, rule); // Avoid creating properties with empty values
2904
2905 if (!style[prop].length) delete style[prop];
2906 }
2907 } else if (typeof value === 'object') {
2908 if (prop === 'fallbacks') {
2909 style.fallbacks = styleDetector(style.fallbacks, rule, true);
2910 continue;
2911 }
2912
2913 style[prop] = objectToArray(value, prop, rule, isFallback); // Avoid creating properties with empty values
2914
2915 if (!style[prop].length) delete style[prop];
2916 } // Maybe a computed value resulting in an empty string
2917 else if (style[prop] === '') delete style[prop];
2918 }
2919
2920 return style;
2921 }
2922 /**
2923 * Adds possibility to write expanded styles.
2924 */
2925
2926
2927 function jssExpand() {
2928 function onProcessStyle(style, rule) {
2929 if (!style || rule.type !== 'style') return style;
2930
2931 if (Array.isArray(style)) {
2932 // Pass rules one by one and reformat them
2933 for (var index = 0; index < style.length; index++) {
2934 style[index] = styleDetector(style[index], rule);
2935 }
2936
2937 return style;
2938 }
2939
2940 return styleDetector(style, rule);
2941 }
2942
2943 return {
2944 onProcessStyle: onProcessStyle
2945 };
2946 }
2947
2948 function _arrayLikeToArray(arr, len) {
2949 if (len == null || len > arr.length) len = arr.length;
2950
2951 for (var i = 0, arr2 = new Array(len); i < len; i++) {
2952 arr2[i] = arr[i];
2953 }
2954
2955 return arr2;
2956 }
2957
2958 function _arrayWithoutHoles(arr) {
2959 if (Array.isArray(arr)) return _arrayLikeToArray(arr);
2960 }
2961
2962 function _iterableToArray(iter) {
2963 if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);
2964 }
2965
2966 function _unsupportedIterableToArray(o, minLen) {
2967 if (!o) return;
2968 if (typeof o === "string") return _arrayLikeToArray(o, minLen);
2969 var n = Object.prototype.toString.call(o).slice(8, -1);
2970 if (n === "Object" && o.constructor) n = o.constructor.name;
2971 if (n === "Map" || n === "Set") return Array.from(n);
2972 if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
2973 }
2974
2975 function _nonIterableSpread() {
2976 throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
2977 }
2978
2979 function _toConsumableArray(arr) {
2980 return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
2981 }
2982
2983 // Export javascript style and css style vendor prefixes.
2984 var js = '';
2985 var css = '';
2986 var vendor = '';
2987 var browser = '';
2988 var isTouch = isBrowser && 'ontouchstart' in document.documentElement; // We should not do anything if required serverside.
2989
2990 if (isBrowser) {
2991 // Order matters. We need to check Webkit the last one because
2992 // other vendors use to add Webkit prefixes to some properties
2993 var jsCssMap = {
2994 Moz: '-moz-',
2995 ms: '-ms-',
2996 O: '-o-',
2997 Webkit: '-webkit-'
2998 };
2999
3000 var _document$createEleme = document.createElement('p'),
3001 style = _document$createEleme.style;
3002
3003 var testProp = 'Transform';
3004
3005 for (var key in jsCssMap) {
3006 if (key + testProp in style) {
3007 js = key;
3008 css = jsCssMap[key];
3009 break;
3010 }
3011 } // Correctly detect the Edge browser.
3012
3013
3014 if (js === 'Webkit' && 'msHyphens' in style) {
3015 js = 'ms';
3016 css = jsCssMap.ms;
3017 browser = 'edge';
3018 } // Correctly detect the Safari browser.
3019
3020
3021 if (js === 'Webkit' && '-apple-trailing-word' in style) {
3022 vendor = 'apple';
3023 }
3024 }
3025 /**
3026 * Vendor prefix string for the current browser.
3027 *
3028 * @type {{js: String, css: String, vendor: String, browser: String}}
3029 * @api public
3030 */
3031
3032
3033 var prefix = {
3034 js: js,
3035 css: css,
3036 vendor: vendor,
3037 browser: browser,
3038 isTouch: isTouch
3039 };
3040
3041 /**
3042 * Test if a keyframe at-rule should be prefixed or not
3043 *
3044 * @param {String} vendor prefix string for the current browser.
3045 * @return {String}
3046 * @api public
3047 */
3048
3049 function supportedKeyframes(key) {
3050 // Keyframes is already prefixed. e.g. key = '@-webkit-keyframes a'
3051 if (key[1] === '-') return key; // No need to prefix IE/Edge. Older browsers will ignore unsupported rules.
3052 // https://caniuse.com/#search=keyframes
3053
3054 if (prefix.js === 'ms') return key;
3055 return "@" + prefix.css + "keyframes" + key.substr(10);
3056 }
3057
3058 // https://caniuse.com/#search=appearance
3059
3060 var appearence = {
3061 noPrefill: ['appearance'],
3062 supportedProperty: function supportedProperty(prop) {
3063 if (prop !== 'appearance') return false;
3064 if (prefix.js === 'ms') return "-webkit-" + prop;
3065 return prefix.css + prop;
3066 }
3067 };
3068
3069 // https://caniuse.com/#search=color-adjust
3070
3071 var colorAdjust = {
3072 noPrefill: ['color-adjust'],
3073 supportedProperty: function supportedProperty(prop) {
3074 if (prop !== 'color-adjust') return false;
3075 if (prefix.js === 'Webkit') return prefix.css + "print-" + prop;
3076 return prop;
3077 }
3078 };
3079
3080 var regExp = /[-\s]+(.)?/g;
3081 /**
3082 * Replaces the letter with the capital letter
3083 *
3084 * @param {String} match
3085 * @param {String} c
3086 * @return {String}
3087 * @api private
3088 */
3089
3090 function toUpper(match, c) {
3091 return c ? c.toUpperCase() : '';
3092 }
3093 /**
3094 * Convert dash separated strings to camel-cased.
3095 *
3096 * @param {String} str
3097 * @return {String}
3098 * @api private
3099 */
3100
3101
3102 function camelize(str) {
3103 return str.replace(regExp, toUpper);
3104 }
3105
3106 /**
3107 * Convert dash separated strings to pascal cased.
3108 *
3109 * @param {String} str
3110 * @return {String}
3111 * @api private
3112 */
3113
3114 function pascalize(str) {
3115 return camelize("-" + str);
3116 }
3117
3118 // but we can use a longhand property instead.
3119 // https://caniuse.com/#search=mask
3120
3121 var mask = {
3122 noPrefill: ['mask'],
3123 supportedProperty: function supportedProperty(prop, style) {
3124 if (!/^mask/.test(prop)) return false;
3125
3126 if (prefix.js === 'Webkit') {
3127 var longhand = 'mask-image';
3128
3129 if (camelize(longhand) in style) {
3130 return prop;
3131 }
3132
3133 if (prefix.js + pascalize(longhand) in style) {
3134 return prefix.css + prop;
3135 }
3136 }
3137
3138 return prop;
3139 }
3140 };
3141
3142 // https://caniuse.com/#search=text-orientation
3143
3144 var textOrientation = {
3145 noPrefill: ['text-orientation'],
3146 supportedProperty: function supportedProperty(prop) {
3147 if (prop !== 'text-orientation') return false;
3148
3149 if (prefix.vendor === 'apple' && !prefix.isTouch) {
3150 return prefix.css + prop;
3151 }
3152
3153 return prop;
3154 }
3155 };
3156
3157 // https://caniuse.com/#search=transform
3158
3159 var transform = {
3160 noPrefill: ['transform'],
3161 supportedProperty: function supportedProperty(prop, style, options) {
3162 if (prop !== 'transform') return false;
3163
3164 if (options.transform) {
3165 return prop;
3166 }
3167
3168 return prefix.css + prop;
3169 }
3170 };
3171
3172 // https://caniuse.com/#search=transition
3173
3174 var transition = {
3175 noPrefill: ['transition'],
3176 supportedProperty: function supportedProperty(prop, style, options) {
3177 if (prop !== 'transition') return false;
3178
3179 if (options.transition) {
3180 return prop;
3181 }
3182
3183 return prefix.css + prop;
3184 }
3185 };
3186
3187 // https://caniuse.com/#search=writing-mode
3188
3189 var writingMode = {
3190 noPrefill: ['writing-mode'],
3191 supportedProperty: function supportedProperty(prop) {
3192 if (prop !== 'writing-mode') return false;
3193
3194 if (prefix.js === 'Webkit' || prefix.js === 'ms' && prefix.browser !== 'edge') {
3195 return prefix.css + prop;
3196 }
3197
3198 return prop;
3199 }
3200 };
3201
3202 // https://caniuse.com/#search=user-select
3203
3204 var userSelect = {
3205 noPrefill: ['user-select'],
3206 supportedProperty: function supportedProperty(prop) {
3207 if (prop !== 'user-select') return false;
3208
3209 if (prefix.js === 'Moz' || prefix.js === 'ms' || prefix.vendor === 'apple') {
3210 return prefix.css + prop;
3211 }
3212
3213 return prop;
3214 }
3215 };
3216
3217 // https://caniuse.com/#search=multicolumn
3218 // https://github.com/postcss/autoprefixer/issues/491
3219 // https://github.com/postcss/autoprefixer/issues/177
3220
3221 var breakPropsOld = {
3222 supportedProperty: function supportedProperty(prop, style) {
3223 if (!/^break-/.test(prop)) return false;
3224
3225 if (prefix.js === 'Webkit') {
3226 var jsProp = "WebkitColumn" + pascalize(prop);
3227 return jsProp in style ? prefix.css + "column-" + prop : false;
3228 }
3229
3230 if (prefix.js === 'Moz') {
3231 var _jsProp = "page" + pascalize(prop);
3232
3233 return _jsProp in style ? "page-" + prop : false;
3234 }
3235
3236 return false;
3237 }
3238 };
3239
3240 // See https://github.com/postcss/autoprefixer/issues/324.
3241
3242 var inlineLogicalOld = {
3243 supportedProperty: function supportedProperty(prop, style) {
3244 if (!/^(border|margin|padding)-inline/.test(prop)) return false;
3245 if (prefix.js === 'Moz') return prop;
3246 var newProp = prop.replace('-inline', '');
3247 return prefix.js + pascalize(newProp) in style ? prefix.css + newProp : false;
3248 }
3249 };
3250
3251 // Camelization is required because we can't test using.
3252 // CSS syntax for e.g. in FF.
3253
3254 var unprefixed = {
3255 supportedProperty: function supportedProperty(prop, style) {
3256 return camelize(prop) in style ? prop : false;
3257 }
3258 };
3259
3260 var prefixed = {
3261 supportedProperty: function supportedProperty(prop, style) {
3262 var pascalized = pascalize(prop); // Return custom CSS variable without prefixing.
3263
3264 if (prop[0] === '-') return prop; // Return already prefixed value without prefixing.
3265
3266 if (prop[0] === '-' && prop[1] === '-') return prop;
3267 if (prefix.js + pascalized in style) return prefix.css + prop; // Try webkit fallback.
3268
3269 if (prefix.js !== 'Webkit' && "Webkit" + pascalized in style) return "-webkit-" + prop;
3270 return false;
3271 }
3272 };
3273
3274 // https://caniuse.com/#search=scroll-snap
3275
3276 var scrollSnap = {
3277 supportedProperty: function supportedProperty(prop) {
3278 if (prop.substring(0, 11) !== 'scroll-snap') return false;
3279
3280 if (prefix.js === 'ms') {
3281 return "" + prefix.css + prop;
3282 }
3283
3284 return prop;
3285 }
3286 };
3287
3288 // https://caniuse.com/#search=overscroll-behavior
3289
3290 var overscrollBehavior = {
3291 supportedProperty: function supportedProperty(prop) {
3292 if (prop !== 'overscroll-behavior') return false;
3293
3294 if (prefix.js === 'ms') {
3295 return prefix.css + "scroll-chaining";
3296 }
3297
3298 return prop;
3299 }
3300 };
3301
3302 var propMap = {
3303 'flex-grow': 'flex-positive',
3304 'flex-shrink': 'flex-negative',
3305 'flex-basis': 'flex-preferred-size',
3306 'justify-content': 'flex-pack',
3307 order: 'flex-order',
3308 'align-items': 'flex-align',
3309 'align-content': 'flex-line-pack' // 'align-self' is handled by 'align-self' plugin.
3310
3311 }; // Support old flex spec from 2012.
3312
3313 var flex2012 = {
3314 supportedProperty: function supportedProperty(prop, style) {
3315 var newProp = propMap[prop];
3316 if (!newProp) return false;
3317 return prefix.js + pascalize(newProp) in style ? prefix.css + newProp : false;
3318 }
3319 };
3320
3321 var propMap$1 = {
3322 flex: 'box-flex',
3323 'flex-grow': 'box-flex',
3324 'flex-direction': ['box-orient', 'box-direction'],
3325 order: 'box-ordinal-group',
3326 'align-items': 'box-align',
3327 'flex-flow': ['box-orient', 'box-direction'],
3328 'justify-content': 'box-pack'
3329 };
3330 var propKeys = Object.keys(propMap$1);
3331
3332 var prefixCss = function prefixCss(p) {
3333 return prefix.css + p;
3334 }; // Support old flex spec from 2009.
3335
3336
3337 var flex2009 = {
3338 supportedProperty: function supportedProperty(prop, style, _ref) {
3339 var multiple = _ref.multiple;
3340
3341 if (propKeys.indexOf(prop) > -1) {
3342 var newProp = propMap$1[prop];
3343
3344 if (!Array.isArray(newProp)) {
3345 return prefix.js + pascalize(newProp) in style ? prefix.css + newProp : false;
3346 }
3347
3348 if (!multiple) return false;
3349
3350 for (var i = 0; i < newProp.length; i++) {
3351 if (!(prefix.js + pascalize(newProp[0]) in style)) {
3352 return false;
3353 }
3354 }
3355
3356 return newProp.map(prefixCss);
3357 }
3358
3359 return false;
3360 }
3361 };
3362
3363 // plugins = [
3364 // ...plugins,
3365 // breakPropsOld,
3366 // inlineLogicalOld,
3367 // unprefixed,
3368 // prefixed,
3369 // scrollSnap,
3370 // flex2012,
3371 // flex2009
3372 // ]
3373 // Plugins without 'noPrefill' value, going last.
3374 // 'flex-*' plugins should be at the bottom.
3375 // 'flex2009' going after 'flex2012'.
3376 // 'prefixed' going after 'unprefixed'
3377
3378 var plugins = [appearence, colorAdjust, mask, textOrientation, transform, transition, writingMode, userSelect, breakPropsOld, inlineLogicalOld, unprefixed, prefixed, scrollSnap, overscrollBehavior, flex2012, flex2009];
3379 var propertyDetectors = plugins.filter(function (p) {
3380 return p.supportedProperty;
3381 }).map(function (p) {
3382 return p.supportedProperty;
3383 });
3384 var noPrefill = plugins.filter(function (p) {
3385 return p.noPrefill;
3386 }).reduce(function (a, p) {
3387 a.push.apply(a, _toConsumableArray(p.noPrefill));
3388 return a;
3389 }, []);
3390
3391 var el;
3392 var cache$1 = {};
3393
3394 if (isBrowser) {
3395 el = document.createElement('p'); // We test every property on vendor prefix requirement.
3396 // Once tested, result is cached. It gives us up to 70% perf boost.
3397 // http://jsperf.com/element-style-object-access-vs-plain-object
3398 //
3399 // Prefill cache with known css properties to reduce amount of
3400 // properties we need to feature test at runtime.
3401 // http://davidwalsh.name/vendor-prefix
3402
3403 var computed = window.getComputedStyle(document.documentElement, '');
3404
3405 for (var key$1 in computed) {
3406 // eslint-disable-next-line no-restricted-globals
3407 if (!isNaN(key$1)) cache$1[computed[key$1]] = computed[key$1];
3408 } // Properties that cannot be correctly detected using the
3409 // cache prefill method.
3410
3411
3412 noPrefill.forEach(function (x) {
3413 return delete cache$1[x];
3414 });
3415 }
3416 /**
3417 * Test if a property is supported, returns supported property with vendor
3418 * prefix if required. Returns `false` if not supported.
3419 *
3420 * @param {String} prop dash separated
3421 * @param {Object} [options]
3422 * @return {String|Boolean}
3423 * @api public
3424 */
3425
3426
3427 function supportedProperty(prop, options) {
3428 if (options === void 0) {
3429 options = {};
3430 }
3431
3432 // For server-side rendering.
3433 if (!el) return prop; // Remove cache for benchmark tests or return property from the cache.
3434
3435 if ( cache$1[prop] != null) {
3436 return cache$1[prop];
3437 } // Check if 'transition' or 'transform' natively supported in browser.
3438
3439
3440 if (prop === 'transition' || prop === 'transform') {
3441 options[prop] = prop in el.style;
3442 } // Find a plugin for current prefix property.
3443
3444
3445 for (var i = 0; i < propertyDetectors.length; i++) {
3446 cache$1[prop] = propertyDetectors[i](prop, el.style, options); // Break loop, if value found.
3447
3448 if (cache$1[prop]) break;
3449 } // Reset styles for current property.
3450 // Firefox can even throw an error for invalid properties, e.g., "0".
3451
3452
3453 try {
3454 el.style[prop] = '';
3455 } catch (err) {
3456 return false;
3457 }
3458
3459 return cache$1[prop];
3460 }
3461
3462 var cache$1$1 = {};
3463 var transitionProperties = {
3464 transition: 1,
3465 'transition-property': 1,
3466 '-webkit-transition': 1,
3467 '-webkit-transition-property': 1
3468 };
3469 var transPropsRegExp = /(^\s*[\w-]+)|, (\s*[\w-]+)(?![^()]*\))/g;
3470 var el$1;
3471 /**
3472 * Returns prefixed value transition/transform if needed.
3473 *
3474 * @param {String} match
3475 * @param {String} p1
3476 * @param {String} p2
3477 * @return {String}
3478 * @api private
3479 */
3480
3481 function prefixTransitionCallback(match, p1, p2) {
3482 if (p1 === 'var') return 'var';
3483 if (p1 === 'all') return 'all';
3484 if (p2 === 'all') return ', all';
3485 var prefixedValue = p1 ? supportedProperty(p1) : ", " + supportedProperty(p2);
3486 if (!prefixedValue) return p1 || p2;
3487 return prefixedValue;
3488 }
3489
3490 if (isBrowser) el$1 = document.createElement('p');
3491 /**
3492 * Returns prefixed value if needed. Returns `false` if value is not supported.
3493 *
3494 * @param {String} property
3495 * @param {String} value
3496 * @return {String|Boolean}
3497 * @api public
3498 */
3499
3500 function supportedValue(property, value) {
3501 // For server-side rendering.
3502 var prefixedValue = value;
3503 if (!el$1 || property === 'content') return value; // It is a string or a number as a string like '1'.
3504 // We want only prefixable values here.
3505 // eslint-disable-next-line no-restricted-globals
3506
3507 if (typeof prefixedValue !== 'string' || !isNaN(parseInt(prefixedValue, 10))) {
3508 return prefixedValue;
3509 } // Create cache key for current value.
3510
3511
3512 var cacheKey = property + prefixedValue; // Remove cache for benchmark tests or return value from cache.
3513
3514 if ( cache$1$1[cacheKey] != null) {
3515 return cache$1$1[cacheKey];
3516 } // IE can even throw an error in some cases, for e.g. style.content = 'bar'.
3517
3518
3519 try {
3520 // Test value as it is.
3521 el$1.style[property] = prefixedValue;
3522 } catch (err) {
3523 // Return false if value not supported.
3524 cache$1$1[cacheKey] = false;
3525 return false;
3526 } // If 'transition' or 'transition-property' property.
3527
3528
3529 if (transitionProperties[property]) {
3530 prefixedValue = prefixedValue.replace(transPropsRegExp, prefixTransitionCallback);
3531 } else if (el$1.style[property] === '') {
3532 // Value with a vendor prefix.
3533 prefixedValue = prefix.css + prefixedValue; // Hardcode test to convert "flex" to "-ms-flexbox" for IE10.
3534
3535 if (prefixedValue === '-ms-flex') el$1.style[property] = '-ms-flexbox'; // Test prefixed value.
3536
3537 el$1.style[property] = prefixedValue; // Return false if value not supported.
3538
3539 if (el$1.style[property] === '') {
3540 cache$1$1[cacheKey] = false;
3541 return false;
3542 }
3543 } // Reset styles for current property.
3544
3545
3546 el$1.style[property] = ''; // Write current value to cache.
3547
3548 cache$1$1[cacheKey] = prefixedValue;
3549 return cache$1$1[cacheKey];
3550 }
3551
3552 /**
3553 * Add vendor prefix to a property name when needed.
3554 */
3555
3556 function jssVendorPrefixer() {
3557 function onProcessRule(rule) {
3558 if (rule.type === 'keyframes') {
3559 var atRule = rule;
3560 atRule.at = supportedKeyframes(atRule.at);
3561 }
3562 }
3563
3564 function prefixStyle(style) {
3565 for (var prop in style) {
3566 var value = style[prop];
3567
3568 if (prop === 'fallbacks' && Array.isArray(value)) {
3569 style[prop] = value.map(prefixStyle);
3570 continue;
3571 }
3572
3573 var changeProp = false;
3574 var supportedProp = supportedProperty(prop);
3575 if (supportedProp && supportedProp !== prop) changeProp = true;
3576 var changeValue = false;
3577 var supportedValue$1 = supportedValue(supportedProp, jss.toCssValue(value));
3578 if (supportedValue$1 && supportedValue$1 !== value) changeValue = true;
3579
3580 if (changeProp || changeValue) {
3581 if (changeProp) delete style[prop];
3582 style[supportedProp || prop] = supportedValue$1 || value;
3583 }
3584 }
3585
3586 return style;
3587 }
3588
3589 function onProcessStyle(style, rule) {
3590 if (rule.type !== 'style') return style;
3591 return prefixStyle(style);
3592 }
3593
3594 function onChangeValue(value, prop) {
3595 return supportedValue(prop, jss.toCssValue(value)) || value;
3596 }
3597
3598 return {
3599 onProcessRule: onProcessRule,
3600 onProcessStyle: onProcessStyle,
3601 onChangeValue: onChangeValue
3602 };
3603 }
3604
3605 /**
3606 * Sort props by length.
3607 */
3608 function jssPropsSort() {
3609 var sort = function sort(prop0, prop1) {
3610 if (prop0.length === prop1.length) {
3611 return prop0 > prop1 ? 1 : -1;
3612 }
3613
3614 return prop0.length - prop1.length;
3615 };
3616
3617 return {
3618 onProcessStyle: function onProcessStyle(style, rule) {
3619 if (rule.type !== 'style') return style;
3620 var newStyle = {};
3621 var props = Object.keys(style).sort(sort);
3622
3623 for (var i = 0; i < props.length; i++) {
3624 newStyle[props[i]] = style[props[i]];
3625 }
3626
3627 return newStyle;
3628 }
3629 };
3630 }
3631
3632 var create = function create(options) {
3633 if (options === void 0) {
3634 options = {};
3635 }
3636
3637 return {
3638 plugins: [functionPlugin(), observablePlugin(options.observable), templatePlugin(), jssGlobal(), jssExtend(), jssNested(), jssCompose(), camelCase(), defaultUnit(options.defaultUnit), jssExpand(), jssVendorPrefixer(), jssPropsSort()]
3639 };
3640 };
3641
3642 var defaultJss = jss.create(create());
3643
3644 var sheetsMeta = new WeakMap();
3645 var getMeta = function getMeta(sheet) {
3646 return sheetsMeta.get(sheet);
3647 };
3648 var addMeta = function addMeta(sheet, meta) {
3649 sheetsMeta.set(sheet, meta);
3650 };
3651
3652 var getStyles = function getStyles(options) {
3653 var styles = options.styles;
3654
3655 if (typeof styles !== 'function') {
3656 return styles;
3657 }
3658
3659 warning(styles.length !== 0, "[JSS] <" + (options.name || 'Hook') + " />'s styles function doesn't rely on the \"theme\" argument. We recommend declaring styles as an object instead.") ;
3660 return styles(options.theme);
3661 };
3662
3663 function getSheetOptions(options, link) {
3664 var minify;
3665
3666 if (options.context.id && options.context.id.minify != null) {
3667 minify = options.context.id.minify;
3668 }
3669
3670 var classNamePrefix = options.context.classNamePrefix || '';
3671
3672 if (options.name && !minify) {
3673 classNamePrefix += options.name.replace(/\s/g, '-') + "-";
3674 }
3675
3676 var meta = '';
3677 if (options.name) meta = options.name + ", ";
3678 meta += typeof options.styles === 'function' ? 'Themed' : 'Unthemed';
3679 return _extends({}, options.sheetOptions, {
3680 index: options.index,
3681 meta: meta,
3682 classNamePrefix: classNamePrefix,
3683 link: link,
3684 generateId: options.sheetOptions && options.sheetOptions.generateId ? options.sheetOptions.generateId : options.context.generateId
3685 });
3686 }
3687
3688 var createStyleSheet = function createStyleSheet(options) {
3689 if (options.context.disableStylesGeneration) {
3690 return undefined;
3691 }
3692
3693 var manager = getManager(options.context, options.index);
3694 var existingSheet = manager.get(options.theme);
3695
3696 if (existingSheet) {
3697 return existingSheet;
3698 }
3699
3700 var jss$1 = options.context.jss || defaultJss;
3701 var styles = getStyles(options);
3702 var dynamicStyles = jss.getDynamicStyles(styles);
3703 var sheet = jss$1.createStyleSheet(styles, getSheetOptions(options, dynamicStyles !== null));
3704 addMeta(sheet, {
3705 dynamicStyles: dynamicStyles,
3706 styles: styles
3707 });
3708 manager.add(options.theme, sheet);
3709 return sheet;
3710 };
3711 var removeDynamicRules = function removeDynamicRules(sheet, rules) {
3712 // Loop over each dynamic rule and remove the dynamic rule
3713 // We can't just remove the whole sheet as this has all of the rules for every component instance
3714 for (var key in rules) {
3715 sheet.deleteRule(rules[key]);
3716 }
3717 };
3718 var updateDynamicRules = function updateDynamicRules(data, sheet, rules) {
3719 // Loop over each dynamic rule and update it
3720 // We can't just update the whole sheet as this has all of the rules for every component instance
3721 for (var key in rules) {
3722 sheet.updateOne(rules[key], data);
3723 }
3724 };
3725 var addDynamicRules = function addDynamicRules(sheet, data) {
3726 var meta = getMeta(sheet);
3727
3728 if (!meta) {
3729 return undefined;
3730 }
3731
3732 var rules = {}; // Loop over each dynamic rule and add it to the stylesheet
3733
3734 for (var key in meta.dynamicStyles) {
3735 var initialRuleCount = sheet.rules.index.length;
3736 var originalRule = sheet.addRule(key, meta.dynamicStyles[key]); // Loop through all created rules, fixes updating dynamic rules
3737
3738 for (var i = initialRuleCount; i < sheet.rules.index.length; i++) {
3739 var rule = sheet.rules.index[i];
3740 sheet.updateOne(rule, data); // If it's the original rule, we need to add it by the correct key so the hook and hoc
3741 // can correctly concat the dynamic class with the static one
3742
3743 rules[originalRule === rule ? key : rule.key] = rule;
3744 }
3745 }
3746
3747 return rules;
3748 };
3749
3750 var getSheetClasses = function getSheetClasses(sheet, dynamicRules) {
3751 if (!dynamicRules) {
3752 return sheet.classes;
3753 }
3754
3755 var meta = getMeta(sheet);
3756
3757 if (!meta) {
3758 return sheet.classes;
3759 }
3760
3761 var classes = {};
3762
3763 for (var key in meta.styles) {
3764 classes[key] = sheet.classes[key];
3765
3766 if (key in dynamicRules) {
3767 classes[key] += " " + sheet.classes[dynamicRules[key].key];
3768 }
3769 }
3770
3771 return classes;
3772 };
3773
3774 function getUseInsertionEffect(isSSR) {
3775 return isSSR ? React.useEffect : React__default['default'].useInsertionEffect || // React 18+ (https://github.com/reactwg/react-18/discussions/110)
3776 React.useLayoutEffect;
3777 }
3778
3779 var noTheme = {};
3780
3781 var createUseStyles = function createUseStyles(styles, options) {
3782 if (options === void 0) {
3783 options = {};
3784 }
3785
3786 var _options = options,
3787 _options$index = _options.index,
3788 index = _options$index === void 0 ? getSheetIndex() : _options$index,
3789 theming = _options.theming,
3790 name = _options.name,
3791 sheetOptions = _objectWithoutPropertiesLoose(_options, ["index", "theming", "name"]);
3792
3793 var ThemeContext$1 = theming && theming.context || ThemeContext;
3794
3795 var useTheme = function useTheme(theme) {
3796 if (typeof styles === 'function') {
3797 return theme || React.useContext(ThemeContext$1) || noTheme;
3798 }
3799
3800 return noTheme;
3801 };
3802
3803 var emptyObject = {};
3804 return function useStyles(data) {
3805 var isFirstMount = React.useRef(true);
3806 var context = React.useContext(JssContext);
3807 var theme = useTheme(data && data.theme);
3808
3809 var _useMemo = React.useMemo(function () {
3810 var newSheet = createStyleSheet({
3811 context: context,
3812 styles: styles,
3813 name: name,
3814 theme: theme,
3815 index: index,
3816 sheetOptions: sheetOptions
3817 });
3818
3819 if (newSheet && context.isSSR) {
3820 // manage immediately during SSRs. browsers will manage the sheet through useInsertionEffect below
3821 manageSheet({
3822 index: index,
3823 context: context,
3824 sheet: newSheet,
3825 theme: theme
3826 });
3827 }
3828
3829 return [newSheet, newSheet ? addDynamicRules(newSheet, data) : null];
3830 }, [context, theme]),
3831 sheet = _useMemo[0],
3832 dynamicRules = _useMemo[1];
3833
3834 getUseInsertionEffect(context.isSSR)(function () {
3835 // We only need to update the rules on a subsequent update and not in the first mount
3836 if (sheet && dynamicRules && !isFirstMount.current) {
3837 updateDynamicRules(data, sheet, dynamicRules);
3838 }
3839 }, [data]);
3840 getUseInsertionEffect(context.isSSR)(function () {
3841 if (sheet) {
3842 manageSheet({
3843 index: index,
3844 context: context,
3845 sheet: sheet,
3846 theme: theme
3847 });
3848 }
3849
3850 return function () {
3851 if (sheet) {
3852 unmanageSheet({
3853 index: index,
3854 context: context,
3855 sheet: sheet,
3856 theme: theme
3857 }); // when sheet changes, remove related dynamic rules
3858
3859 if (dynamicRules) {
3860 removeDynamicRules(sheet, dynamicRules);
3861 }
3862 }
3863 };
3864 }, [sheet]);
3865 var classes = React.useMemo(function () {
3866 return sheet && dynamicRules ? getSheetClasses(sheet, dynamicRules) : emptyObject;
3867 }, [sheet, dynamicRules]);
3868 React.useDebugValue(classes);
3869 React.useDebugValue(theme === noTheme ? 'No theme' : theme);
3870 React.useEffect(function () {
3871 isFirstMount.current = false;
3872 });
3873 return classes;
3874 };
3875 };
3876
3877 var NoRenderer = function NoRenderer(props) {
3878 return props.children || null;
3879 };
3880 /**
3881 * HOC creator function that wrapps the user component.
3882 *
3883 * `withStyles(styles, [options])(Component)`
3884 */
3885
3886
3887 var createWithStyles = function createWithStyles(styles, options) {
3888 if (options === void 0) {
3889 options = {};
3890 }
3891
3892 var _options = options,
3893 _options$index = _options.index,
3894 index = _options$index === void 0 ? getSheetIndex() : _options$index,
3895 theming = _options.theming,
3896 injectTheme = _options.injectTheme,
3897 sheetOptions = _objectWithoutPropertiesLoose(_options, ["index", "theming", "injectTheme"]);
3898
3899 var ThemeContext$1 = theming ? theming.context : ThemeContext;
3900 return function (InnerComponent) {
3901 if (InnerComponent === void 0) {
3902 InnerComponent = NoRenderer;
3903 }
3904
3905 var displayName = getDisplayName$1(InnerComponent);
3906 var mergeClassesProp = memoize(function (sheetClasses, classesProp) {
3907 return classesProp ? mergeClasses(sheetClasses, classesProp) : sheetClasses;
3908 });
3909 var hookOptions = Object.assign(sheetOptions, {
3910 theming: theming,
3911 index: index,
3912 name: displayName
3913 });
3914 var useStyles = createUseStyles(styles, hookOptions);
3915 var WithStyles = React.forwardRef(function (props, ref) {
3916 var theme = React.useContext(ThemeContext$1);
3917
3918 var newProps = _extends({}, props);
3919
3920 if (injectTheme && newProps.theme == null) {
3921 newProps.theme = theme;
3922 }
3923
3924 var sheetClasses = useStyles(newProps);
3925 var classes = mergeClassesProp(sheetClasses, props.classes);
3926 return React.createElement(InnerComponent, _extends({}, newProps, {
3927 classes: classes,
3928 ref: ref
3929 }));
3930 });
3931 WithStyles.displayName = "WithStyles(" + displayName + ")";
3932 WithStyles.defaultProps = _extends({}, InnerComponent.defaultProps);
3933 WithStyles.InnerComponent = InnerComponent;
3934 return hoistNonReactStatics_cjs(WithStyles, InnerComponent);
3935 };
3936 };
3937
3938 function shallowEqualObjects(objA, objB) {
3939 if (objA === objB) {
3940 return true;
3941 }
3942
3943 if (!objA || !objB) {
3944 return false;
3945 }
3946
3947 var aKeys = Object.keys(objA);
3948 var bKeys = Object.keys(objB);
3949 var len = aKeys.length;
3950
3951 if (bKeys.length !== len) {
3952 return false;
3953 }
3954
3955 for (var i = 0; i < len; i++) {
3956 var key = aKeys[i];
3957
3958 if (objA[key] !== objB[key]) {
3959 return false;
3960 }
3961 }
3962
3963 return true;
3964 }
3965
3966 var initialContext = {};
3967 function JssProvider(props) {
3968 var managersRef = React.useRef({});
3969 var prevContextRef = React.useRef();
3970 var registryRef = React.useRef(null);
3971
3972 var createContext = function createContext(parentContext, prevContext) {
3973 if (prevContext === void 0) {
3974 prevContext = initialContext;
3975 }
3976
3977 var registry = props.registry,
3978 classNamePrefix = props.classNamePrefix,
3979 jss$1 = props.jss,
3980 generateId = props.generateId,
3981 disableStylesGeneration = props.disableStylesGeneration,
3982 media = props.media,
3983 id = props.id,
3984 isSSR = props.isSSR;
3985
3986 var context = _extends({}, parentContext);
3987
3988 if (registry) {
3989 context.registry = registry; // This way we identify a new request on the server, because user will create
3990 // a new Registry instance for each.
3991
3992 if (registry !== registryRef.current) {
3993 // We reset managers because we have to regenerate all sheets for the new request.
3994 managersRef.current = {};
3995 registryRef.current = registry;
3996 }
3997 }
3998
3999 context.managers = managersRef.current;
4000
4001 if (id !== undefined) {
4002 context.id = id;
4003 }
4004
4005 if (generateId !== undefined) {
4006 context.generateId = generateId;
4007 } else if (!context.generateId || !prevContext || context.id !== prevContext.id) {
4008 context.generateId = jss.createGenerateId(context.id);
4009 }
4010
4011 if (classNamePrefix) {
4012 context.classNamePrefix = (context.classNamePrefix || '') + classNamePrefix;
4013 }
4014
4015 if (media !== undefined) {
4016 context.media = media;
4017 }
4018
4019 if (jss$1) {
4020 context.jss = jss$1;
4021 }
4022
4023 if (disableStylesGeneration !== undefined) {
4024 context.disableStylesGeneration = disableStylesGeneration;
4025 }
4026
4027 if (isSSR !== undefined) {
4028 context.isSSR = isSSR;
4029 }
4030
4031 if (prevContext && shallowEqualObjects(prevContext, context)) {
4032 return prevContext;
4033 }
4034
4035 return context;
4036 };
4037
4038 var renderProvider = function renderProvider(parentContext) {
4039 var children = props.children;
4040 var context = createContext(parentContext, prevContextRef.current);
4041 prevContextRef.current = context;
4042 return React.createElement(JssContext.Provider, {
4043 value: context
4044 }, children);
4045 };
4046
4047 return React.createElement(JssContext.Consumer, null, renderProvider);
4048 }
4049
4050 function memoize$1(fn) {
4051 var cache = {};
4052 return function (arg) {
4053 if (cache[arg] === undefined) cache[arg] = fn(arg);
4054 return cache[arg];
4055 };
4056 }
4057
4058 var reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|default|defer|dir|disabled|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|itemProp|itemScope|itemType|itemID|itemRef|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/; // https://esbench.com/bench/5bfee68a4cd7e6009ef61d23
4059
4060 var index$1 = memoize$1(function (prop) {
4061 return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111
4062 /* o */
4063 && prop.charCodeAt(1) === 110
4064 /* n */
4065 && prop.charCodeAt(2) < 91;
4066 }
4067 /* Z+1 */
4068 );
4069
4070 var parseStyles = function parseStyles(args) {
4071 var dynamicStyles = [];
4072 var staticStyle;
4073 var labels = []; // Not using ...rest to optimize perf.
4074
4075 for (var key in args) {
4076 var style = args[key];
4077 if (!style) continue;
4078
4079 if (typeof style === 'function') {
4080 dynamicStyles.push(style);
4081 } else {
4082 if (!staticStyle) staticStyle = {};
4083 Object.assign(staticStyle, style);
4084 var _staticStyle = staticStyle,
4085 _label = _staticStyle.label;
4086
4087 if (_label) {
4088 if (labels.indexOf(_label) === -1) labels.push(_label);
4089 }
4090 }
4091 }
4092
4093 var styles = {};
4094 var label = labels.length === 0 ? 'sc' : labels.join('-');
4095
4096 if (staticStyle) {
4097 // Label should not leak to the core.
4098 if ('label' in staticStyle) delete staticStyle.label;
4099 styles[label] = staticStyle;
4100 } // When there is only one function rule, we don't need to wrap it.
4101
4102
4103 if (dynamicStyles.length === 1) {
4104 styles.scd = dynamicStyles[0];
4105 } // We create a new function rule which will call all other function rules
4106 // and merge the styles they return.
4107
4108
4109 if (dynamicStyles.length > 1) {
4110 styles.scd = function (props) {
4111 var merged = {};
4112
4113 for (var i = 0; i < dynamicStyles.length; i++) {
4114 var dynamicStyle = dynamicStyles[i](props);
4115 if (dynamicStyle) Object.assign(merged, dynamicStyle);
4116 }
4117
4118 return merged;
4119 };
4120 }
4121
4122 return {
4123 styles: styles,
4124 label: label
4125 };
4126 };
4127
4128 var shouldForwardPropSymbol = Symbol('react-jss-styled');
4129
4130 var getShouldForwardProp = function getShouldForwardProp(tagOrComponent, options) {
4131 var shouldForwardProp = options.shouldForwardProp;
4132 var childShouldForwardProp = tagOrComponent[shouldForwardPropSymbol];
4133 var finalShouldForwardProp = shouldForwardProp || childShouldForwardProp;
4134
4135 if (shouldForwardProp && childShouldForwardProp) {
4136 finalShouldForwardProp = function finalShouldForwardProp(prop) {
4137 return childShouldForwardProp(prop) && shouldForwardProp(prop);
4138 };
4139 }
4140
4141 return finalShouldForwardProp;
4142 };
4143
4144 var getChildProps = function getChildProps(props, shouldForwardProp, isTag) {
4145 var childProps = {};
4146
4147 for (var prop in props) {
4148 if (shouldForwardProp) {
4149 if (shouldForwardProp(prop) === true) {
4150 childProps[prop] = props[prop];
4151 }
4152
4153 continue;
4154 } // We don't want to pass non-dom props to the DOM.
4155
4156
4157 if (isTag) {
4158 if (index$1(prop)) {
4159 childProps[prop] = props[prop];
4160 }
4161
4162 continue;
4163 }
4164
4165 childProps[prop] = props[prop];
4166 }
4167
4168 return childProps;
4169 }; // eslint-disable-next-line no-unused-vars
4170
4171
4172 var configureStyled = function configureStyled(tagOrComponent, options) {
4173 if (options === void 0) {
4174 options = {};
4175 }
4176
4177 var _options = options,
4178 theming = _options.theming;
4179 var isTag = typeof tagOrComponent === 'string';
4180 var ThemeContext$1 = theming ? theming.context : ThemeContext;
4181 var shouldForwardProp = getShouldForwardProp(tagOrComponent, options);
4182
4183 var _options2 = options,
4184 _ = _options2.shouldForwardProp,
4185 hookOptions = _objectWithoutPropertiesLoose(_options2, ["shouldForwardProp"]);
4186
4187 return function createStyledComponent() {
4188 // eslint-disable-next-line prefer-rest-params
4189 var _parseStyles = parseStyles(arguments),
4190 styles = _parseStyles.styles,
4191 label = _parseStyles.label;
4192
4193 var useStyles = createUseStyles(styles, hookOptions);
4194
4195 var Styled = function Styled(props) {
4196 var as = props.as,
4197 className = props.className;
4198 var theme = React.useContext(ThemeContext$1);
4199 var propsWithTheme = Object.assign({
4200 theme: theme
4201 }, props);
4202 var classes = useStyles(propsWithTheme);
4203 var childProps = getChildProps(props, shouldForwardProp, isTag);
4204 var classNames = ((classes[label] || classes.sc || '') + " " + (classes.scd || '')).trim();
4205 childProps.className = className ? className + " " + classNames : classNames;
4206
4207 if (!isTag && shouldForwardProp) {
4208 tagOrComponent[shouldForwardPropSymbol] = shouldForwardProp;
4209 }
4210
4211 if (isTag && as) {
4212 return React.createElement(as, childProps);
4213 }
4214
4215 return React.createElement(tagOrComponent, childProps);
4216 };
4217
4218 return Styled;
4219 };
4220 };
4221
4222 var MAX_RULES_PER_SHEET = 10000;
4223 var defaultJss$1 = jss.create(create());
4224
4225 var createCss = function createCss(jss) {
4226 if (jss === void 0) {
4227 jss = defaultJss$1;
4228 }
4229
4230 var cache = new Map();
4231 var ruleIndex = 0;
4232 var sheet;
4233
4234 var getSheet = function getSheet() {
4235 if (!sheet || sheet.rules.index.length > MAX_RULES_PER_SHEET) {
4236 sheet = jss.createStyleSheet().attach();
4237 }
4238
4239 return sheet;
4240 };
4241
4242 function css() {
4243 // eslint-disable-next-line prefer-rest-params
4244 var args = arguments; // We can avoid the need for stringification with a babel plugin,
4245 // which could generate a hash at build time and add it to the object.
4246
4247 var argsStr = JSON.stringify(args);
4248 var cached = cache.get(argsStr);
4249 if (cached) return cached.className;
4250 var flatArgs = []; // Flatten arguments which can be
4251 // - style objects
4252 // - array of style objects
4253 // - arrays of style objects
4254
4255 for (var argIndex in args) {
4256 var arg = args[argIndex];
4257
4258 if (!Array.isArray(arg)) {
4259 flatArgs.push(arg);
4260 continue;
4261 }
4262
4263 for (var innerArgIndex = 0; innerArgIndex < arg.length; innerArgIndex++) {
4264 flatArgs.push(arg[innerArgIndex]);
4265 }
4266 }
4267
4268 var mergedStyle = {};
4269 var labels = [];
4270
4271 for (var i = 0; i < flatArgs.length; i++) {
4272 var style = flatArgs[i];
4273 if (!style) continue;
4274 var styleObject = style; // It can be a class name that css() has previously generated.
4275
4276 if (typeof style === 'string') {
4277 // eslint-disable-next-line no-shadow
4278 var _cached = cache.get(style);
4279
4280 if (_cached) {
4281 // eslint-disable-next-line prefer-spread
4282 if (_cached.labels.length) labels.push.apply(labels, _cached.labels);
4283 styleObject = _cached.style;
4284 }
4285 }
4286
4287 if (styleObject.label && labels.indexOf(styleObject.label) === -1) labels.push(styleObject.label);
4288 Object.assign(mergedStyle, styleObject);
4289 }
4290
4291 delete mergedStyle.label;
4292 var label = labels.length === 0 ? 'css' : labels.join('-');
4293 var key = label + "-" + ruleIndex++;
4294 getSheet().addRule(key, mergedStyle);
4295 var className = getSheet().classes[key];
4296 var cacheValue = {
4297 style: mergedStyle,
4298 labels: labels,
4299 className: className
4300 };
4301 cache.set(argsStr, cacheValue);
4302 cache.set(className, cacheValue);
4303 return className;
4304 } // For testing only.
4305
4306
4307 css.getSheet = getSheet;
4308 return css;
4309 };
4310
4311 var css$1 = createCss();
4312
4313 /* eslint-disable prefer-rest-params, prefer-spread */
4314 var create$1 = function create(css) {
4315 if (css === void 0) {
4316 css = css$1;
4317 }
4318
4319 return function createElement(type, props) {
4320 var args = arguments;
4321
4322 if (props && props.css) {
4323 var className = css(props.css);
4324 var newProps = Object.assign({}, props);
4325 newProps.className = props.className ? props.className + " " + className : className;
4326 delete newProps.css;
4327 args[1] = newProps;
4328 }
4329
4330 return React.createElement.apply(undefined, args);
4331 };
4332 };
4333 var jsx = create$1();
4334
4335 Object.defineProperty(exports, 'SheetsRegistry', {
4336 enumerable: true,
4337 get: function () {
4338 return jss.SheetsRegistry;
4339 }
4340 });
4341 Object.defineProperty(exports, 'createGenerateId', {
4342 enumerable: true,
4343 get: function () {
4344 return jss.createGenerateId;
4345 }
4346 });
4347 exports.JssContext = JssContext;
4348 exports.JssProvider = JssProvider;
4349 exports.ThemeProvider = ThemeProvider;
4350 exports.createJsx = create$1;
4351 exports.createTheming = createTheming;
4352 exports.createUseStyles = createUseStyles;
4353 exports.default = createWithStyles;
4354 exports.jss = defaultJss;
4355 exports.jsx = jsx;
4356 exports.styled = configureStyled;
4357 exports.useTheme = useTheme;
4358 exports.withStyles = createWithStyles;
4359 exports.withTheme = withTheme;
4360
4361 Object.defineProperty(exports, '__esModule', { value: true });
4362
4363})));
4364//# sourceMappingURL=react-jss.js.map