@groupeactual/ui-kit 0.3.5 → 0.3.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +138 -2662
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +304 -2829
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -4
- package/src/DesignSystemProvider.tsx +2 -9
package/dist/cjs/index.js
CHANGED
|
@@ -4,6 +4,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
6
|
var React = require('react');
|
|
7
|
+
var emStyled = require('@emotion/styled');
|
|
8
|
+
var react = require('@emotion/react');
|
|
7
9
|
|
|
8
10
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
9
11
|
|
|
@@ -27,6 +29,7 @@ function _interopNamespace(e) {
|
|
|
27
29
|
|
|
28
30
|
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
29
31
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
32
|
+
var emStyled__default = /*#__PURE__*/_interopDefaultLegacy(emStyled);
|
|
30
33
|
|
|
31
34
|
/******************************************************************************
|
|
32
35
|
Copyright (c) Microsoft Corporation.
|
|
@@ -230,1373 +233,9 @@ function _objectWithoutPropertiesLoose(source, excluded) {
|
|
|
230
233
|
return target;
|
|
231
234
|
}
|
|
232
235
|
|
|
233
|
-
|
|
234
|
-
var cache = Object.create(null);
|
|
235
|
-
return function (arg) {
|
|
236
|
-
if (cache[arg] === undefined) cache[arg] = fn(arg);
|
|
237
|
-
return cache[arg];
|
|
238
|
-
};
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
var reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|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|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|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|loading|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|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|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
|
|
242
|
-
|
|
243
|
-
var isPropValid = /* #__PURE__ */memoize$1(function (prop) {
|
|
244
|
-
return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111
|
|
245
|
-
/* o */
|
|
246
|
-
&& prop.charCodeAt(1) === 110
|
|
247
|
-
/* n */
|
|
248
|
-
&& prop.charCodeAt(2) < 91;
|
|
249
|
-
}
|
|
250
|
-
/* Z+1 */
|
|
251
|
-
);
|
|
252
|
-
|
|
253
|
-
/*
|
|
254
|
-
|
|
255
|
-
Based off glamor's StyleSheet, thanks Sunil ❤️
|
|
256
|
-
|
|
257
|
-
high performance StyleSheet for css-in-js systems
|
|
258
|
-
|
|
259
|
-
- uses multiple style tags behind the scenes for millions of rules
|
|
260
|
-
- uses `insertRule` for appending in production for *much* faster performance
|
|
261
|
-
|
|
262
|
-
// usage
|
|
263
|
-
|
|
264
|
-
import { StyleSheet } from '@emotion/sheet'
|
|
265
|
-
|
|
266
|
-
let styleSheet = new StyleSheet({ key: '', container: document.head })
|
|
267
|
-
|
|
268
|
-
styleSheet.insert('#box { border: 1px solid red; }')
|
|
269
|
-
- appends a css rule into the stylesheet
|
|
270
|
-
|
|
271
|
-
styleSheet.flush()
|
|
272
|
-
- empties the stylesheet of all its contents
|
|
273
|
-
|
|
274
|
-
*/
|
|
275
|
-
// $FlowFixMe
|
|
276
|
-
function sheetForTag(tag) {
|
|
277
|
-
if (tag.sheet) {
|
|
278
|
-
// $FlowFixMe
|
|
279
|
-
return tag.sheet;
|
|
280
|
-
} // this weirdness brought to you by firefox
|
|
281
|
-
|
|
282
|
-
/* istanbul ignore next */
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
for (var i = 0; i < document.styleSheets.length; i++) {
|
|
286
|
-
if (document.styleSheets[i].ownerNode === tag) {
|
|
287
|
-
// $FlowFixMe
|
|
288
|
-
return document.styleSheets[i];
|
|
289
|
-
}
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
function createStyleElement(options) {
|
|
294
|
-
var tag = document.createElement('style');
|
|
295
|
-
tag.setAttribute('data-emotion', options.key);
|
|
296
|
-
|
|
297
|
-
if (options.nonce !== undefined) {
|
|
298
|
-
tag.setAttribute('nonce', options.nonce);
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
tag.appendChild(document.createTextNode(''));
|
|
302
|
-
tag.setAttribute('data-s', '');
|
|
303
|
-
return tag;
|
|
304
|
-
}
|
|
305
|
-
|
|
306
|
-
var StyleSheet = /*#__PURE__*/function () {
|
|
307
|
-
// Using Node instead of HTMLElement since container may be a ShadowRoot
|
|
308
|
-
function StyleSheet(options) {
|
|
309
|
-
var _this = this;
|
|
310
|
-
|
|
311
|
-
this._insertTag = function (tag) {
|
|
312
|
-
var before;
|
|
313
|
-
|
|
314
|
-
if (_this.tags.length === 0) {
|
|
315
|
-
if (_this.insertionPoint) {
|
|
316
|
-
before = _this.insertionPoint.nextSibling;
|
|
317
|
-
} else if (_this.prepend) {
|
|
318
|
-
before = _this.container.firstChild;
|
|
319
|
-
} else {
|
|
320
|
-
before = _this.before;
|
|
321
|
-
}
|
|
322
|
-
} else {
|
|
323
|
-
before = _this.tags[_this.tags.length - 1].nextSibling;
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
_this.container.insertBefore(tag, before);
|
|
327
|
-
|
|
328
|
-
_this.tags.push(tag);
|
|
329
|
-
};
|
|
330
|
-
|
|
331
|
-
this.isSpeedy = options.speedy === undefined ? process.env.NODE_ENV === 'production' : options.speedy;
|
|
332
|
-
this.tags = [];
|
|
333
|
-
this.ctr = 0;
|
|
334
|
-
this.nonce = options.nonce; // key is the value of the data-emotion attribute, it's used to identify different sheets
|
|
335
|
-
|
|
336
|
-
this.key = options.key;
|
|
337
|
-
this.container = options.container;
|
|
338
|
-
this.prepend = options.prepend;
|
|
339
|
-
this.insertionPoint = options.insertionPoint;
|
|
340
|
-
this.before = null;
|
|
341
|
-
}
|
|
342
|
-
|
|
343
|
-
var _proto = StyleSheet.prototype;
|
|
344
|
-
|
|
345
|
-
_proto.hydrate = function hydrate(nodes) {
|
|
346
|
-
nodes.forEach(this._insertTag);
|
|
347
|
-
};
|
|
348
|
-
|
|
349
|
-
_proto.insert = function insert(rule) {
|
|
350
|
-
// the max length is how many rules we have per style tag, it's 65000 in speedy mode
|
|
351
|
-
// it's 1 in dev because we insert source maps that map a single rule to a location
|
|
352
|
-
// and you can only have one source map per style tag
|
|
353
|
-
if (this.ctr % (this.isSpeedy ? 65000 : 1) === 0) {
|
|
354
|
-
this._insertTag(createStyleElement(this));
|
|
355
|
-
}
|
|
356
|
-
|
|
357
|
-
var tag = this.tags[this.tags.length - 1];
|
|
358
|
-
|
|
359
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
360
|
-
var isImportRule = rule.charCodeAt(0) === 64 && rule.charCodeAt(1) === 105;
|
|
361
|
-
|
|
362
|
-
if (isImportRule && this._alreadyInsertedOrderInsensitiveRule) {
|
|
363
|
-
// this would only cause problem in speedy mode
|
|
364
|
-
// but we don't want enabling speedy to affect the observable behavior
|
|
365
|
-
// so we report this error at all times
|
|
366
|
-
console.error("You're attempting to insert the following rule:\n" + rule + '\n\n`@import` rules must be before all other types of rules in a stylesheet but other rules have already been inserted. Please ensure that `@import` rules are before all other rules.');
|
|
367
|
-
}
|
|
368
|
-
this._alreadyInsertedOrderInsensitiveRule = this._alreadyInsertedOrderInsensitiveRule || !isImportRule;
|
|
369
|
-
}
|
|
370
|
-
|
|
371
|
-
if (this.isSpeedy) {
|
|
372
|
-
var sheet = sheetForTag(tag);
|
|
373
|
-
|
|
374
|
-
try {
|
|
375
|
-
// this is the ultrafast version, works across browsers
|
|
376
|
-
// the big drawback is that the css won't be editable in devtools
|
|
377
|
-
sheet.insertRule(rule, sheet.cssRules.length);
|
|
378
|
-
} catch (e) {
|
|
379
|
-
if (process.env.NODE_ENV !== 'production' && !/:(-moz-placeholder|-moz-focus-inner|-moz-focusring|-ms-input-placeholder|-moz-read-write|-moz-read-only|-ms-clear){/.test(rule)) {
|
|
380
|
-
console.error("There was a problem inserting the following rule: \"" + rule + "\"", e);
|
|
381
|
-
}
|
|
382
|
-
}
|
|
383
|
-
} else {
|
|
384
|
-
tag.appendChild(document.createTextNode(rule));
|
|
385
|
-
}
|
|
386
|
-
|
|
387
|
-
this.ctr++;
|
|
388
|
-
};
|
|
389
|
-
|
|
390
|
-
_proto.flush = function flush() {
|
|
391
|
-
// $FlowFixMe
|
|
392
|
-
this.tags.forEach(function (tag) {
|
|
393
|
-
return tag.parentNode && tag.parentNode.removeChild(tag);
|
|
394
|
-
});
|
|
395
|
-
this.tags = [];
|
|
396
|
-
this.ctr = 0;
|
|
397
|
-
|
|
398
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
399
|
-
this._alreadyInsertedOrderInsensitiveRule = false;
|
|
400
|
-
}
|
|
401
|
-
};
|
|
402
|
-
|
|
403
|
-
return StyleSheet;
|
|
404
|
-
}();
|
|
405
|
-
|
|
406
|
-
var MS = '-ms-';
|
|
407
|
-
var MOZ = '-moz-';
|
|
408
|
-
var WEBKIT = '-webkit-';
|
|
409
|
-
|
|
410
|
-
var COMMENT = 'comm';
|
|
411
|
-
var RULESET = 'rule';
|
|
412
|
-
var DECLARATION = 'decl';
|
|
413
|
-
var IMPORT = '@import';
|
|
414
|
-
var KEYFRAMES = '@keyframes';
|
|
415
|
-
|
|
416
|
-
/**
|
|
417
|
-
* @param {number}
|
|
418
|
-
* @return {number}
|
|
419
|
-
*/
|
|
420
|
-
var abs = Math.abs;
|
|
421
|
-
|
|
422
|
-
/**
|
|
423
|
-
* @param {number}
|
|
424
|
-
* @return {string}
|
|
425
|
-
*/
|
|
426
|
-
var from = String.fromCharCode;
|
|
427
|
-
|
|
428
|
-
/**
|
|
429
|
-
* @param {object}
|
|
430
|
-
* @return {object}
|
|
431
|
-
*/
|
|
432
|
-
var assign$1 = Object.assign;
|
|
433
|
-
|
|
434
|
-
/**
|
|
435
|
-
* @param {string} value
|
|
436
|
-
* @param {number} length
|
|
437
|
-
* @return {number}
|
|
438
|
-
*/
|
|
439
|
-
function hash (value, length) {
|
|
440
|
-
return (((((((length << 2) ^ charat(value, 0)) << 2) ^ charat(value, 1)) << 2) ^ charat(value, 2)) << 2) ^ charat(value, 3)
|
|
441
|
-
}
|
|
442
|
-
|
|
443
|
-
/**
|
|
444
|
-
* @param {string} value
|
|
445
|
-
* @return {string}
|
|
446
|
-
*/
|
|
447
|
-
function trim (value) {
|
|
448
|
-
return value.trim()
|
|
449
|
-
}
|
|
450
|
-
|
|
451
|
-
/**
|
|
452
|
-
* @param {string} value
|
|
453
|
-
* @param {RegExp} pattern
|
|
454
|
-
* @return {string?}
|
|
455
|
-
*/
|
|
456
|
-
function match (value, pattern) {
|
|
457
|
-
return (value = pattern.exec(value)) ? value[0] : value
|
|
458
|
-
}
|
|
459
|
-
|
|
460
|
-
/**
|
|
461
|
-
* @param {string} value
|
|
462
|
-
* @param {(string|RegExp)} pattern
|
|
463
|
-
* @param {string} replacement
|
|
464
|
-
* @return {string}
|
|
465
|
-
*/
|
|
466
|
-
function replace (value, pattern, replacement) {
|
|
467
|
-
return value.replace(pattern, replacement)
|
|
468
|
-
}
|
|
469
|
-
|
|
470
|
-
/**
|
|
471
|
-
* @param {string} value
|
|
472
|
-
* @param {string} search
|
|
473
|
-
* @return {number}
|
|
474
|
-
*/
|
|
475
|
-
function indexof (value, search) {
|
|
476
|
-
return value.indexOf(search)
|
|
477
|
-
}
|
|
478
|
-
|
|
479
|
-
/**
|
|
480
|
-
* @param {string} value
|
|
481
|
-
* @param {number} index
|
|
482
|
-
* @return {number}
|
|
483
|
-
*/
|
|
484
|
-
function charat (value, index) {
|
|
485
|
-
return value.charCodeAt(index) | 0
|
|
486
|
-
}
|
|
487
|
-
|
|
488
|
-
/**
|
|
489
|
-
* @param {string} value
|
|
490
|
-
* @param {number} begin
|
|
491
|
-
* @param {number} end
|
|
492
|
-
* @return {string}
|
|
493
|
-
*/
|
|
494
|
-
function substr (value, begin, end) {
|
|
495
|
-
return value.slice(begin, end)
|
|
496
|
-
}
|
|
497
|
-
|
|
498
|
-
/**
|
|
499
|
-
* @param {string} value
|
|
500
|
-
* @return {number}
|
|
501
|
-
*/
|
|
502
|
-
function strlen (value) {
|
|
503
|
-
return value.length
|
|
504
|
-
}
|
|
505
|
-
|
|
506
|
-
/**
|
|
507
|
-
* @param {any[]} value
|
|
508
|
-
* @return {number}
|
|
509
|
-
*/
|
|
510
|
-
function sizeof (value) {
|
|
511
|
-
return value.length
|
|
512
|
-
}
|
|
513
|
-
|
|
514
|
-
/**
|
|
515
|
-
* @param {any} value
|
|
516
|
-
* @param {any[]} array
|
|
517
|
-
* @return {any}
|
|
518
|
-
*/
|
|
519
|
-
function append (value, array) {
|
|
520
|
-
return array.push(value), value
|
|
521
|
-
}
|
|
522
|
-
|
|
523
|
-
/**
|
|
524
|
-
* @param {string[]} array
|
|
525
|
-
* @param {function} callback
|
|
526
|
-
* @return {string}
|
|
527
|
-
*/
|
|
528
|
-
function combine (array, callback) {
|
|
529
|
-
return array.map(callback).join('')
|
|
530
|
-
}
|
|
531
|
-
|
|
532
|
-
var line = 1;
|
|
533
|
-
var column = 1;
|
|
534
|
-
var length = 0;
|
|
535
|
-
var position$1 = 0;
|
|
536
|
-
var character = 0;
|
|
537
|
-
var characters = '';
|
|
538
|
-
|
|
539
|
-
/**
|
|
540
|
-
* @param {string} value
|
|
541
|
-
* @param {object | null} root
|
|
542
|
-
* @param {object | null} parent
|
|
543
|
-
* @param {string} type
|
|
544
|
-
* @param {string[] | string} props
|
|
545
|
-
* @param {object[] | string} children
|
|
546
|
-
* @param {number} length
|
|
547
|
-
*/
|
|
548
|
-
function node (value, root, parent, type, props, children, length) {
|
|
549
|
-
return {value: value, root: root, parent: parent, type: type, props: props, children: children, line: line, column: column, length: length, return: ''}
|
|
550
|
-
}
|
|
551
|
-
|
|
552
|
-
/**
|
|
553
|
-
* @param {object} root
|
|
554
|
-
* @param {object} props
|
|
555
|
-
* @return {object}
|
|
556
|
-
*/
|
|
557
|
-
function copy (root, props) {
|
|
558
|
-
return assign$1(node('', null, null, '', null, null, 0), root, {length: -root.length}, props)
|
|
559
|
-
}
|
|
560
|
-
|
|
561
|
-
/**
|
|
562
|
-
* @return {number}
|
|
563
|
-
*/
|
|
564
|
-
function char () {
|
|
565
|
-
return character
|
|
566
|
-
}
|
|
567
|
-
|
|
568
|
-
/**
|
|
569
|
-
* @return {number}
|
|
570
|
-
*/
|
|
571
|
-
function prev () {
|
|
572
|
-
character = position$1 > 0 ? charat(characters, --position$1) : 0;
|
|
573
|
-
|
|
574
|
-
if (column--, character === 10)
|
|
575
|
-
column = 1, line--;
|
|
576
|
-
|
|
577
|
-
return character
|
|
578
|
-
}
|
|
579
|
-
|
|
580
|
-
/**
|
|
581
|
-
* @return {number}
|
|
582
|
-
*/
|
|
583
|
-
function next () {
|
|
584
|
-
character = position$1 < length ? charat(characters, position$1++) : 0;
|
|
585
|
-
|
|
586
|
-
if (column++, character === 10)
|
|
587
|
-
column = 1, line++;
|
|
588
|
-
|
|
589
|
-
return character
|
|
590
|
-
}
|
|
591
|
-
|
|
592
|
-
/**
|
|
593
|
-
* @return {number}
|
|
594
|
-
*/
|
|
595
|
-
function peek () {
|
|
596
|
-
return charat(characters, position$1)
|
|
597
|
-
}
|
|
598
|
-
|
|
599
|
-
/**
|
|
600
|
-
* @return {number}
|
|
601
|
-
*/
|
|
602
|
-
function caret () {
|
|
603
|
-
return position$1
|
|
604
|
-
}
|
|
605
|
-
|
|
606
|
-
/**
|
|
607
|
-
* @param {number} begin
|
|
608
|
-
* @param {number} end
|
|
609
|
-
* @return {string}
|
|
610
|
-
*/
|
|
611
|
-
function slice (begin, end) {
|
|
612
|
-
return substr(characters, begin, end)
|
|
613
|
-
}
|
|
614
|
-
|
|
615
|
-
/**
|
|
616
|
-
* @param {number} type
|
|
617
|
-
* @return {number}
|
|
618
|
-
*/
|
|
619
|
-
function token (type) {
|
|
620
|
-
switch (type) {
|
|
621
|
-
// \0 \t \n \r \s whitespace token
|
|
622
|
-
case 0: case 9: case 10: case 13: case 32:
|
|
623
|
-
return 5
|
|
624
|
-
// ! + , / > @ ~ isolate token
|
|
625
|
-
case 33: case 43: case 44: case 47: case 62: case 64: case 126:
|
|
626
|
-
// ; { } breakpoint token
|
|
627
|
-
case 59: case 123: case 125:
|
|
628
|
-
return 4
|
|
629
|
-
// : accompanied token
|
|
630
|
-
case 58:
|
|
631
|
-
return 3
|
|
632
|
-
// " ' ( [ opening delimit token
|
|
633
|
-
case 34: case 39: case 40: case 91:
|
|
634
|
-
return 2
|
|
635
|
-
// ) ] closing delimit token
|
|
636
|
-
case 41: case 93:
|
|
637
|
-
return 1
|
|
638
|
-
}
|
|
639
|
-
|
|
640
|
-
return 0
|
|
641
|
-
}
|
|
642
|
-
|
|
643
|
-
/**
|
|
644
|
-
* @param {string} value
|
|
645
|
-
* @return {any[]}
|
|
646
|
-
*/
|
|
647
|
-
function alloc (value) {
|
|
648
|
-
return line = column = 1, length = strlen(characters = value), position$1 = 0, []
|
|
649
|
-
}
|
|
650
|
-
|
|
651
|
-
/**
|
|
652
|
-
* @param {any} value
|
|
653
|
-
* @return {any}
|
|
654
|
-
*/
|
|
655
|
-
function dealloc (value) {
|
|
656
|
-
return characters = '', value
|
|
657
|
-
}
|
|
658
|
-
|
|
659
|
-
/**
|
|
660
|
-
* @param {number} type
|
|
661
|
-
* @return {string}
|
|
662
|
-
*/
|
|
663
|
-
function delimit (type) {
|
|
664
|
-
return trim(slice(position$1 - 1, delimiter(type === 91 ? type + 2 : type === 40 ? type + 1 : type)))
|
|
665
|
-
}
|
|
666
|
-
|
|
667
|
-
/**
|
|
668
|
-
* @param {number} type
|
|
669
|
-
* @return {string}
|
|
670
|
-
*/
|
|
671
|
-
function whitespace (type) {
|
|
672
|
-
while (character = peek())
|
|
673
|
-
if (character < 33)
|
|
674
|
-
next();
|
|
675
|
-
else
|
|
676
|
-
break
|
|
677
|
-
|
|
678
|
-
return token(type) > 2 || token(character) > 3 ? '' : ' '
|
|
679
|
-
}
|
|
680
|
-
|
|
681
|
-
/**
|
|
682
|
-
* @param {number} index
|
|
683
|
-
* @param {number} count
|
|
684
|
-
* @return {string}
|
|
685
|
-
*/
|
|
686
|
-
function escaping (index, count) {
|
|
687
|
-
while (--count && next())
|
|
688
|
-
// not 0-9 A-F a-f
|
|
689
|
-
if (character < 48 || character > 102 || (character > 57 && character < 65) || (character > 70 && character < 97))
|
|
690
|
-
break
|
|
691
|
-
|
|
692
|
-
return slice(index, caret() + (count < 6 && peek() == 32 && next() == 32))
|
|
693
|
-
}
|
|
694
|
-
|
|
695
|
-
/**
|
|
696
|
-
* @param {number} type
|
|
697
|
-
* @return {number}
|
|
698
|
-
*/
|
|
699
|
-
function delimiter (type) {
|
|
700
|
-
while (next())
|
|
701
|
-
switch (character) {
|
|
702
|
-
// ] ) " '
|
|
703
|
-
case type:
|
|
704
|
-
return position$1
|
|
705
|
-
// " '
|
|
706
|
-
case 34: case 39:
|
|
707
|
-
if (type !== 34 && type !== 39)
|
|
708
|
-
delimiter(character);
|
|
709
|
-
break
|
|
710
|
-
// (
|
|
711
|
-
case 40:
|
|
712
|
-
if (type === 41)
|
|
713
|
-
delimiter(type);
|
|
714
|
-
break
|
|
715
|
-
// \
|
|
716
|
-
case 92:
|
|
717
|
-
next();
|
|
718
|
-
break
|
|
719
|
-
}
|
|
720
|
-
|
|
721
|
-
return position$1
|
|
722
|
-
}
|
|
723
|
-
|
|
724
|
-
/**
|
|
725
|
-
* @param {number} type
|
|
726
|
-
* @param {number} index
|
|
727
|
-
* @return {number}
|
|
728
|
-
*/
|
|
729
|
-
function commenter (type, index) {
|
|
730
|
-
while (next())
|
|
731
|
-
// //
|
|
732
|
-
if (type + character === 47 + 10)
|
|
733
|
-
break
|
|
734
|
-
// /*
|
|
735
|
-
else if (type + character === 42 + 42 && peek() === 47)
|
|
736
|
-
break
|
|
737
|
-
|
|
738
|
-
return '/*' + slice(index, position$1 - 1) + '*' + from(type === 47 ? type : next())
|
|
739
|
-
}
|
|
740
|
-
|
|
741
|
-
/**
|
|
742
|
-
* @param {number} index
|
|
743
|
-
* @return {string}
|
|
744
|
-
*/
|
|
745
|
-
function identifier (index) {
|
|
746
|
-
while (!token(peek()))
|
|
747
|
-
next();
|
|
748
|
-
|
|
749
|
-
return slice(index, position$1)
|
|
750
|
-
}
|
|
751
|
-
|
|
752
|
-
/**
|
|
753
|
-
* @param {string} value
|
|
754
|
-
* @return {object[]}
|
|
755
|
-
*/
|
|
756
|
-
function compile (value) {
|
|
757
|
-
return dealloc(parse('', null, null, null, [''], value = alloc(value), 0, [0], value))
|
|
758
|
-
}
|
|
759
|
-
|
|
760
|
-
/**
|
|
761
|
-
* @param {string} value
|
|
762
|
-
* @param {object} root
|
|
763
|
-
* @param {object?} parent
|
|
764
|
-
* @param {string[]} rule
|
|
765
|
-
* @param {string[]} rules
|
|
766
|
-
* @param {string[]} rulesets
|
|
767
|
-
* @param {number[]} pseudo
|
|
768
|
-
* @param {number[]} points
|
|
769
|
-
* @param {string[]} declarations
|
|
770
|
-
* @return {object}
|
|
771
|
-
*/
|
|
772
|
-
function parse (value, root, parent, rule, rules, rulesets, pseudo, points, declarations) {
|
|
773
|
-
var index = 0;
|
|
774
|
-
var offset = 0;
|
|
775
|
-
var length = pseudo;
|
|
776
|
-
var atrule = 0;
|
|
777
|
-
var property = 0;
|
|
778
|
-
var previous = 0;
|
|
779
|
-
var variable = 1;
|
|
780
|
-
var scanning = 1;
|
|
781
|
-
var ampersand = 1;
|
|
782
|
-
var character = 0;
|
|
783
|
-
var type = '';
|
|
784
|
-
var props = rules;
|
|
785
|
-
var children = rulesets;
|
|
786
|
-
var reference = rule;
|
|
787
|
-
var characters = type;
|
|
788
|
-
|
|
789
|
-
while (scanning)
|
|
790
|
-
switch (previous = character, character = next()) {
|
|
791
|
-
// (
|
|
792
|
-
case 40:
|
|
793
|
-
if (previous != 108 && characters.charCodeAt(length - 1) == 58) {
|
|
794
|
-
if (indexof(characters += replace(delimit(character), '&', '&\f'), '&\f') != -1)
|
|
795
|
-
ampersand = -1;
|
|
796
|
-
break
|
|
797
|
-
}
|
|
798
|
-
// " ' [
|
|
799
|
-
case 34: case 39: case 91:
|
|
800
|
-
characters += delimit(character);
|
|
801
|
-
break
|
|
802
|
-
// \t \n \r \s
|
|
803
|
-
case 9: case 10: case 13: case 32:
|
|
804
|
-
characters += whitespace(previous);
|
|
805
|
-
break
|
|
806
|
-
// \
|
|
807
|
-
case 92:
|
|
808
|
-
characters += escaping(caret() - 1, 7);
|
|
809
|
-
continue
|
|
810
|
-
// /
|
|
811
|
-
case 47:
|
|
812
|
-
switch (peek()) {
|
|
813
|
-
case 42: case 47:
|
|
814
|
-
append(comment(commenter(next(), caret()), root, parent), declarations);
|
|
815
|
-
break
|
|
816
|
-
default:
|
|
817
|
-
characters += '/';
|
|
818
|
-
}
|
|
819
|
-
break
|
|
820
|
-
// {
|
|
821
|
-
case 123 * variable:
|
|
822
|
-
points[index++] = strlen(characters) * ampersand;
|
|
823
|
-
// } ; \0
|
|
824
|
-
case 125 * variable: case 59: case 0:
|
|
825
|
-
switch (character) {
|
|
826
|
-
// \0 }
|
|
827
|
-
case 0: case 125: scanning = 0;
|
|
828
|
-
// ;
|
|
829
|
-
case 59 + offset:
|
|
830
|
-
if (property > 0 && (strlen(characters) - length))
|
|
831
|
-
append(property > 32 ? declaration(characters + ';', rule, parent, length - 1) : declaration(replace(characters, ' ', '') + ';', rule, parent, length - 2), declarations);
|
|
832
|
-
break
|
|
833
|
-
// @ ;
|
|
834
|
-
case 59: characters += ';';
|
|
835
|
-
// { rule/at-rule
|
|
836
|
-
default:
|
|
837
|
-
append(reference = ruleset(characters, root, parent, index, offset, rules, points, type, props = [], children = [], length), rulesets);
|
|
838
|
-
|
|
839
|
-
if (character === 123)
|
|
840
|
-
if (offset === 0)
|
|
841
|
-
parse(characters, root, reference, reference, props, rulesets, length, points, children);
|
|
842
|
-
else
|
|
843
|
-
switch (atrule) {
|
|
844
|
-
// d m s
|
|
845
|
-
case 100: case 109: case 115:
|
|
846
|
-
parse(value, reference, reference, rule && append(ruleset(value, reference, reference, 0, 0, rules, points, type, rules, props = [], length), children), rules, children, length, points, rule ? props : children);
|
|
847
|
-
break
|
|
848
|
-
default:
|
|
849
|
-
parse(characters, reference, reference, reference, [''], children, 0, points, children);
|
|
850
|
-
}
|
|
851
|
-
}
|
|
852
|
-
|
|
853
|
-
index = offset = property = 0, variable = ampersand = 1, type = characters = '', length = pseudo;
|
|
854
|
-
break
|
|
855
|
-
// :
|
|
856
|
-
case 58:
|
|
857
|
-
length = 1 + strlen(characters), property = previous;
|
|
858
|
-
default:
|
|
859
|
-
if (variable < 1)
|
|
860
|
-
if (character == 123)
|
|
861
|
-
--variable;
|
|
862
|
-
else if (character == 125 && variable++ == 0 && prev() == 125)
|
|
863
|
-
continue
|
|
864
|
-
|
|
865
|
-
switch (characters += from(character), character * variable) {
|
|
866
|
-
// &
|
|
867
|
-
case 38:
|
|
868
|
-
ampersand = offset > 0 ? 1 : (characters += '\f', -1);
|
|
869
|
-
break
|
|
870
|
-
// ,
|
|
871
|
-
case 44:
|
|
872
|
-
points[index++] = (strlen(characters) - 1) * ampersand, ampersand = 1;
|
|
873
|
-
break
|
|
874
|
-
// @
|
|
875
|
-
case 64:
|
|
876
|
-
// -
|
|
877
|
-
if (peek() === 45)
|
|
878
|
-
characters += delimit(next());
|
|
879
|
-
|
|
880
|
-
atrule = peek(), offset = length = strlen(type = characters += identifier(caret())), character++;
|
|
881
|
-
break
|
|
882
|
-
// -
|
|
883
|
-
case 45:
|
|
884
|
-
if (previous === 45 && strlen(characters) == 2)
|
|
885
|
-
variable = 0;
|
|
886
|
-
}
|
|
887
|
-
}
|
|
888
|
-
|
|
889
|
-
return rulesets
|
|
890
|
-
}
|
|
891
|
-
|
|
892
|
-
/**
|
|
893
|
-
* @param {string} value
|
|
894
|
-
* @param {object} root
|
|
895
|
-
* @param {object?} parent
|
|
896
|
-
* @param {number} index
|
|
897
|
-
* @param {number} offset
|
|
898
|
-
* @param {string[]} rules
|
|
899
|
-
* @param {number[]} points
|
|
900
|
-
* @param {string} type
|
|
901
|
-
* @param {string[]} props
|
|
902
|
-
* @param {string[]} children
|
|
903
|
-
* @param {number} length
|
|
904
|
-
* @return {object}
|
|
905
|
-
*/
|
|
906
|
-
function ruleset (value, root, parent, index, offset, rules, points, type, props, children, length) {
|
|
907
|
-
var post = offset - 1;
|
|
908
|
-
var rule = offset === 0 ? rules : [''];
|
|
909
|
-
var size = sizeof(rule);
|
|
910
|
-
|
|
911
|
-
for (var i = 0, j = 0, k = 0; i < index; ++i)
|
|
912
|
-
for (var x = 0, y = substr(value, post + 1, post = abs(j = points[i])), z = value; x < size; ++x)
|
|
913
|
-
if (z = trim(j > 0 ? rule[x] + ' ' + y : replace(y, /&\f/g, rule[x])))
|
|
914
|
-
props[k++] = z;
|
|
915
|
-
|
|
916
|
-
return node(value, root, parent, offset === 0 ? RULESET : type, props, children, length)
|
|
917
|
-
}
|
|
918
|
-
|
|
919
|
-
/**
|
|
920
|
-
* @param {number} value
|
|
921
|
-
* @param {object} root
|
|
922
|
-
* @param {object?} parent
|
|
923
|
-
* @return {object}
|
|
924
|
-
*/
|
|
925
|
-
function comment (value, root, parent) {
|
|
926
|
-
return node(value, root, parent, COMMENT, from(char()), substr(value, 2, -2), 0)
|
|
927
|
-
}
|
|
928
|
-
|
|
929
|
-
/**
|
|
930
|
-
* @param {string} value
|
|
931
|
-
* @param {object} root
|
|
932
|
-
* @param {object?} parent
|
|
933
|
-
* @param {number} length
|
|
934
|
-
* @return {object}
|
|
935
|
-
*/
|
|
936
|
-
function declaration (value, root, parent, length) {
|
|
937
|
-
return node(value, root, parent, DECLARATION, substr(value, 0, length), substr(value, length + 1, -1), length)
|
|
938
|
-
}
|
|
939
|
-
|
|
940
|
-
/**
|
|
941
|
-
* @param {string} value
|
|
942
|
-
* @param {number} length
|
|
943
|
-
* @return {string}
|
|
944
|
-
*/
|
|
945
|
-
function prefix (value, length) {
|
|
946
|
-
switch (hash(value, length)) {
|
|
947
|
-
// color-adjust
|
|
948
|
-
case 5103:
|
|
949
|
-
return WEBKIT + 'print-' + value + value
|
|
950
|
-
// animation, animation-(delay|direction|duration|fill-mode|iteration-count|name|play-state|timing-function)
|
|
951
|
-
case 5737: case 4201: case 3177: case 3433: case 1641: case 4457: case 2921:
|
|
952
|
-
// text-decoration, filter, clip-path, backface-visibility, column, box-decoration-break
|
|
953
|
-
case 5572: case 6356: case 5844: case 3191: case 6645: case 3005:
|
|
954
|
-
// mask, mask-image, mask-(mode|clip|size), mask-(repeat|origin), mask-position, mask-composite,
|
|
955
|
-
case 6391: case 5879: case 5623: case 6135: case 4599: case 4855:
|
|
956
|
-
// background-clip, columns, column-(count|fill|gap|rule|rule-color|rule-style|rule-width|span|width)
|
|
957
|
-
case 4215: case 6389: case 5109: case 5365: case 5621: case 3829:
|
|
958
|
-
return WEBKIT + value + value
|
|
959
|
-
// appearance, user-select, transform, hyphens, text-size-adjust
|
|
960
|
-
case 5349: case 4246: case 4810: case 6968: case 2756:
|
|
961
|
-
return WEBKIT + value + MOZ + value + MS + value + value
|
|
962
|
-
// flex, flex-direction
|
|
963
|
-
case 6828: case 4268:
|
|
964
|
-
return WEBKIT + value + MS + value + value
|
|
965
|
-
// order
|
|
966
|
-
case 6165:
|
|
967
|
-
return WEBKIT + value + MS + 'flex-' + value + value
|
|
968
|
-
// align-items
|
|
969
|
-
case 5187:
|
|
970
|
-
return WEBKIT + value + replace(value, /(\w+).+(:[^]+)/, WEBKIT + 'box-$1$2' + MS + 'flex-$1$2') + value
|
|
971
|
-
// align-self
|
|
972
|
-
case 5443:
|
|
973
|
-
return WEBKIT + value + MS + 'flex-item-' + replace(value, /flex-|-self/, '') + value
|
|
974
|
-
// align-content
|
|
975
|
-
case 4675:
|
|
976
|
-
return WEBKIT + value + MS + 'flex-line-pack' + replace(value, /align-content|flex-|-self/, '') + value
|
|
977
|
-
// flex-shrink
|
|
978
|
-
case 5548:
|
|
979
|
-
return WEBKIT + value + MS + replace(value, 'shrink', 'negative') + value
|
|
980
|
-
// flex-basis
|
|
981
|
-
case 5292:
|
|
982
|
-
return WEBKIT + value + MS + replace(value, 'basis', 'preferred-size') + value
|
|
983
|
-
// flex-grow
|
|
984
|
-
case 6060:
|
|
985
|
-
return WEBKIT + 'box-' + replace(value, '-grow', '') + WEBKIT + value + MS + replace(value, 'grow', 'positive') + value
|
|
986
|
-
// transition
|
|
987
|
-
case 4554:
|
|
988
|
-
return WEBKIT + replace(value, /([^-])(transform)/g, '$1' + WEBKIT + '$2') + value
|
|
989
|
-
// cursor
|
|
990
|
-
case 6187:
|
|
991
|
-
return replace(replace(replace(value, /(zoom-|grab)/, WEBKIT + '$1'), /(image-set)/, WEBKIT + '$1'), value, '') + value
|
|
992
|
-
// background, background-image
|
|
993
|
-
case 5495: case 3959:
|
|
994
|
-
return replace(value, /(image-set\([^]*)/, WEBKIT + '$1' + '$`$1')
|
|
995
|
-
// justify-content
|
|
996
|
-
case 4968:
|
|
997
|
-
return replace(replace(value, /(.+:)(flex-)?(.*)/, WEBKIT + 'box-pack:$3' + MS + 'flex-pack:$3'), /s.+-b[^;]+/, 'justify') + WEBKIT + value + value
|
|
998
|
-
// (margin|padding)-inline-(start|end)
|
|
999
|
-
case 4095: case 3583: case 4068: case 2532:
|
|
1000
|
-
return replace(value, /(.+)-inline(.+)/, WEBKIT + '$1$2') + value
|
|
1001
|
-
// (min|max)?(width|height|inline-size|block-size)
|
|
1002
|
-
case 8116: case 7059: case 5753: case 5535:
|
|
1003
|
-
case 5445: case 5701: case 4933: case 4677:
|
|
1004
|
-
case 5533: case 5789: case 5021: case 4765:
|
|
1005
|
-
// stretch, max-content, min-content, fill-available
|
|
1006
|
-
if (strlen(value) - 1 - length > 6)
|
|
1007
|
-
switch (charat(value, length + 1)) {
|
|
1008
|
-
// (m)ax-content, (m)in-content
|
|
1009
|
-
case 109:
|
|
1010
|
-
// -
|
|
1011
|
-
if (charat(value, length + 4) !== 45)
|
|
1012
|
-
break
|
|
1013
|
-
// (f)ill-available, (f)it-content
|
|
1014
|
-
case 102:
|
|
1015
|
-
return replace(value, /(.+:)(.+)-([^]+)/, '$1' + WEBKIT + '$2-$3' + '$1' + MOZ + (charat(value, length + 3) == 108 ? '$3' : '$2-$3')) + value
|
|
1016
|
-
// (s)tretch
|
|
1017
|
-
case 115:
|
|
1018
|
-
return ~indexof(value, 'stretch') ? prefix(replace(value, 'stretch', 'fill-available'), length) + value : value
|
|
1019
|
-
}
|
|
1020
|
-
break
|
|
1021
|
-
// position: sticky
|
|
1022
|
-
case 4949:
|
|
1023
|
-
// (s)ticky?
|
|
1024
|
-
if (charat(value, length + 1) !== 115)
|
|
1025
|
-
break
|
|
1026
|
-
// display: (flex|inline-flex)
|
|
1027
|
-
case 6444:
|
|
1028
|
-
switch (charat(value, strlen(value) - 3 - (~indexof(value, '!important') && 10))) {
|
|
1029
|
-
// stic(k)y
|
|
1030
|
-
case 107:
|
|
1031
|
-
return replace(value, ':', ':' + WEBKIT) + value
|
|
1032
|
-
// (inline-)?fl(e)x
|
|
1033
|
-
case 101:
|
|
1034
|
-
return replace(value, /(.+:)([^;!]+)(;|!.+)?/, '$1' + WEBKIT + (charat(value, 14) === 45 ? 'inline-' : '') + 'box$3' + '$1' + WEBKIT + '$2$3' + '$1' + MS + '$2box$3') + value
|
|
1035
|
-
}
|
|
1036
|
-
break
|
|
1037
|
-
// writing-mode
|
|
1038
|
-
case 5936:
|
|
1039
|
-
switch (charat(value, length + 11)) {
|
|
1040
|
-
// vertical-l(r)
|
|
1041
|
-
case 114:
|
|
1042
|
-
return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, 'tb') + value
|
|
1043
|
-
// vertical-r(l)
|
|
1044
|
-
case 108:
|
|
1045
|
-
return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, 'tb-rl') + value
|
|
1046
|
-
// horizontal(-)tb
|
|
1047
|
-
case 45:
|
|
1048
|
-
return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, 'lr') + value
|
|
1049
|
-
}
|
|
1050
|
-
|
|
1051
|
-
return WEBKIT + value + MS + value + value
|
|
1052
|
-
}
|
|
1053
|
-
|
|
1054
|
-
return value
|
|
1055
|
-
}
|
|
1056
|
-
|
|
1057
|
-
/**
|
|
1058
|
-
* @param {object[]} children
|
|
1059
|
-
* @param {function} callback
|
|
1060
|
-
* @return {string}
|
|
1061
|
-
*/
|
|
1062
|
-
function serialize (children, callback) {
|
|
1063
|
-
var output = '';
|
|
1064
|
-
var length = sizeof(children);
|
|
1065
|
-
|
|
1066
|
-
for (var i = 0; i < length; i++)
|
|
1067
|
-
output += callback(children[i], i, children, callback) || '';
|
|
1068
|
-
|
|
1069
|
-
return output
|
|
1070
|
-
}
|
|
1071
|
-
|
|
1072
|
-
/**
|
|
1073
|
-
* @param {object} element
|
|
1074
|
-
* @param {number} index
|
|
1075
|
-
* @param {object[]} children
|
|
1076
|
-
* @param {function} callback
|
|
1077
|
-
* @return {string}
|
|
1078
|
-
*/
|
|
1079
|
-
function stringify (element, index, children, callback) {
|
|
1080
|
-
switch (element.type) {
|
|
1081
|
-
case IMPORT: case DECLARATION: return element.return = element.return || element.value
|
|
1082
|
-
case COMMENT: return ''
|
|
1083
|
-
case KEYFRAMES: return element.return = element.value + '{' + serialize(element.children, callback) + '}'
|
|
1084
|
-
case RULESET: element.value = element.props.join(',');
|
|
1085
|
-
}
|
|
1086
|
-
|
|
1087
|
-
return strlen(children = serialize(element.children, callback)) ? element.return = element.value + '{' + children + '}' : ''
|
|
1088
|
-
}
|
|
1089
|
-
|
|
1090
|
-
/**
|
|
1091
|
-
* @param {function[]} collection
|
|
1092
|
-
* @return {function}
|
|
1093
|
-
*/
|
|
1094
|
-
function middleware (collection) {
|
|
1095
|
-
var length = sizeof(collection);
|
|
1096
|
-
|
|
1097
|
-
return function (element, index, children, callback) {
|
|
1098
|
-
var output = '';
|
|
1099
|
-
|
|
1100
|
-
for (var i = 0; i < length; i++)
|
|
1101
|
-
output += collection[i](element, index, children, callback) || '';
|
|
1102
|
-
|
|
1103
|
-
return output
|
|
1104
|
-
}
|
|
1105
|
-
}
|
|
1106
|
-
|
|
1107
|
-
/**
|
|
1108
|
-
* @param {function} callback
|
|
1109
|
-
* @return {function}
|
|
1110
|
-
*/
|
|
1111
|
-
function rulesheet (callback) {
|
|
1112
|
-
return function (element) {
|
|
1113
|
-
if (!element.root)
|
|
1114
|
-
if (element = element.return)
|
|
1115
|
-
callback(element);
|
|
1116
|
-
}
|
|
1117
|
-
}
|
|
1118
|
-
|
|
1119
|
-
/**
|
|
1120
|
-
* @param {object} element
|
|
1121
|
-
* @param {number} index
|
|
1122
|
-
* @param {object[]} children
|
|
1123
|
-
* @param {function} callback
|
|
1124
|
-
*/
|
|
1125
|
-
function prefixer (element, index, children, callback) {
|
|
1126
|
-
if (element.length > -1)
|
|
1127
|
-
if (!element.return)
|
|
1128
|
-
switch (element.type) {
|
|
1129
|
-
case DECLARATION: element.return = prefix(element.value, element.length);
|
|
1130
|
-
break
|
|
1131
|
-
case KEYFRAMES:
|
|
1132
|
-
return serialize([copy(element, {value: replace(element.value, '@', '@' + WEBKIT)})], callback)
|
|
1133
|
-
case RULESET:
|
|
1134
|
-
if (element.length)
|
|
1135
|
-
return combine(element.props, function (value) {
|
|
1136
|
-
switch (match(value, /(::plac\w+|:read-\w+)/)) {
|
|
1137
|
-
// :read-(only|write)
|
|
1138
|
-
case ':read-only': case ':read-write':
|
|
1139
|
-
return serialize([copy(element, {props: [replace(value, /:(read-\w+)/, ':' + MOZ + '$1')]})], callback)
|
|
1140
|
-
// :placeholder
|
|
1141
|
-
case '::placeholder':
|
|
1142
|
-
return serialize([
|
|
1143
|
-
copy(element, {props: [replace(value, /:(plac\w+)/, ':' + WEBKIT + 'input-$1')]}),
|
|
1144
|
-
copy(element, {props: [replace(value, /:(plac\w+)/, ':' + MOZ + '$1')]}),
|
|
1145
|
-
copy(element, {props: [replace(value, /:(plac\w+)/, MS + 'input-$1')]})
|
|
1146
|
-
], callback)
|
|
1147
|
-
}
|
|
1148
|
-
|
|
1149
|
-
return ''
|
|
1150
|
-
})
|
|
1151
|
-
}
|
|
1152
|
-
}
|
|
1153
|
-
|
|
1154
|
-
var weakMemoize = function weakMemoize(func) {
|
|
1155
|
-
// $FlowFixMe flow doesn't include all non-primitive types as allowed for weakmaps
|
|
1156
|
-
var cache = new WeakMap();
|
|
1157
|
-
return function (arg) {
|
|
1158
|
-
if (cache.has(arg)) {
|
|
1159
|
-
// $FlowFixMe
|
|
1160
|
-
return cache.get(arg);
|
|
1161
|
-
}
|
|
1162
|
-
|
|
1163
|
-
var ret = func(arg);
|
|
1164
|
-
cache.set(arg, ret);
|
|
1165
|
-
return ret;
|
|
1166
|
-
};
|
|
1167
|
-
};
|
|
1168
|
-
|
|
1169
|
-
var identifierWithPointTracking = function identifierWithPointTracking(begin, points, index) {
|
|
1170
|
-
var previous = 0;
|
|
1171
|
-
var character = 0;
|
|
1172
|
-
|
|
1173
|
-
while (true) {
|
|
1174
|
-
previous = character;
|
|
1175
|
-
character = peek(); // &\f
|
|
1176
|
-
|
|
1177
|
-
if (previous === 38 && character === 12) {
|
|
1178
|
-
points[index] = 1;
|
|
1179
|
-
}
|
|
1180
|
-
|
|
1181
|
-
if (token(character)) {
|
|
1182
|
-
break;
|
|
1183
|
-
}
|
|
1184
|
-
|
|
1185
|
-
next();
|
|
1186
|
-
}
|
|
1187
|
-
|
|
1188
|
-
return slice(begin, position$1);
|
|
1189
|
-
};
|
|
1190
|
-
|
|
1191
|
-
var toRules = function toRules(parsed, points) {
|
|
1192
|
-
// pretend we've started with a comma
|
|
1193
|
-
var index = -1;
|
|
1194
|
-
var character = 44;
|
|
1195
|
-
|
|
1196
|
-
do {
|
|
1197
|
-
switch (token(character)) {
|
|
1198
|
-
case 0:
|
|
1199
|
-
// &\f
|
|
1200
|
-
if (character === 38 && peek() === 12) {
|
|
1201
|
-
// this is not 100% correct, we don't account for literal sequences here - like for example quoted strings
|
|
1202
|
-
// stylis inserts \f after & to know when & where it should replace this sequence with the context selector
|
|
1203
|
-
// and when it should just concatenate the outer and inner selectors
|
|
1204
|
-
// it's very unlikely for this sequence to actually appear in a different context, so we just leverage this fact here
|
|
1205
|
-
points[index] = 1;
|
|
1206
|
-
}
|
|
1207
|
-
|
|
1208
|
-
parsed[index] += identifierWithPointTracking(position$1 - 1, points, index);
|
|
1209
|
-
break;
|
|
1210
|
-
|
|
1211
|
-
case 2:
|
|
1212
|
-
parsed[index] += delimit(character);
|
|
1213
|
-
break;
|
|
1214
|
-
|
|
1215
|
-
case 4:
|
|
1216
|
-
// comma
|
|
1217
|
-
if (character === 44) {
|
|
1218
|
-
// colon
|
|
1219
|
-
parsed[++index] = peek() === 58 ? '&\f' : '';
|
|
1220
|
-
points[index] = parsed[index].length;
|
|
1221
|
-
break;
|
|
1222
|
-
}
|
|
1223
|
-
|
|
1224
|
-
// fallthrough
|
|
1225
|
-
|
|
1226
|
-
default:
|
|
1227
|
-
parsed[index] += from(character);
|
|
1228
|
-
}
|
|
1229
|
-
} while (character = next());
|
|
1230
|
-
|
|
1231
|
-
return parsed;
|
|
1232
|
-
};
|
|
1233
|
-
|
|
1234
|
-
var getRules = function getRules(value, points) {
|
|
1235
|
-
return dealloc(toRules(alloc(value), points));
|
|
1236
|
-
}; // WeakSet would be more appropriate, but only WeakMap is supported in IE11
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
var fixedElements = /* #__PURE__ */new WeakMap();
|
|
1240
|
-
var compat = function compat(element) {
|
|
1241
|
-
if (element.type !== 'rule' || !element.parent || // positive .length indicates that this rule contains pseudo
|
|
1242
|
-
// negative .length indicates that this rule has been already prefixed
|
|
1243
|
-
element.length < 1) {
|
|
1244
|
-
return;
|
|
1245
|
-
}
|
|
1246
|
-
|
|
1247
|
-
var value = element.value,
|
|
1248
|
-
parent = element.parent;
|
|
1249
|
-
var isImplicitRule = element.column === parent.column && element.line === parent.line;
|
|
1250
|
-
|
|
1251
|
-
while (parent.type !== 'rule') {
|
|
1252
|
-
parent = parent.parent;
|
|
1253
|
-
if (!parent) return;
|
|
1254
|
-
} // short-circuit for the simplest case
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
if (element.props.length === 1 && value.charCodeAt(0) !== 58
|
|
1258
|
-
/* colon */
|
|
1259
|
-
&& !fixedElements.get(parent)) {
|
|
1260
|
-
return;
|
|
1261
|
-
} // if this is an implicitly inserted rule (the one eagerly inserted at the each new nested level)
|
|
1262
|
-
// then the props has already been manipulated beforehand as they that array is shared between it and its "rule parent"
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
if (isImplicitRule) {
|
|
1266
|
-
return;
|
|
1267
|
-
}
|
|
1268
|
-
|
|
1269
|
-
fixedElements.set(element, true);
|
|
1270
|
-
var points = [];
|
|
1271
|
-
var rules = getRules(value, points);
|
|
1272
|
-
var parentRules = parent.props;
|
|
1273
|
-
|
|
1274
|
-
for (var i = 0, k = 0; i < rules.length; i++) {
|
|
1275
|
-
for (var j = 0; j < parentRules.length; j++, k++) {
|
|
1276
|
-
element.props[k] = points[i] ? rules[i].replace(/&\f/g, parentRules[j]) : parentRules[j] + " " + rules[i];
|
|
1277
|
-
}
|
|
1278
|
-
}
|
|
1279
|
-
};
|
|
1280
|
-
var removeLabel = function removeLabel(element) {
|
|
1281
|
-
if (element.type === 'decl') {
|
|
1282
|
-
var value = element.value;
|
|
1283
|
-
|
|
1284
|
-
if ( // charcode for l
|
|
1285
|
-
value.charCodeAt(0) === 108 && // charcode for b
|
|
1286
|
-
value.charCodeAt(2) === 98) {
|
|
1287
|
-
// this ignores label
|
|
1288
|
-
element["return"] = '';
|
|
1289
|
-
element.value = '';
|
|
1290
|
-
}
|
|
1291
|
-
}
|
|
1292
|
-
};
|
|
1293
|
-
var ignoreFlag = 'emotion-disable-server-rendering-unsafe-selector-warning-please-do-not-use-this-the-warning-exists-for-a-reason';
|
|
1294
|
-
|
|
1295
|
-
var isIgnoringComment = function isIgnoringComment(element) {
|
|
1296
|
-
return element.type === 'comm' && element.children.indexOf(ignoreFlag) > -1;
|
|
1297
|
-
};
|
|
1298
|
-
|
|
1299
|
-
var createUnsafeSelectorsAlarm = function createUnsafeSelectorsAlarm(cache) {
|
|
1300
|
-
return function (element, index, children) {
|
|
1301
|
-
if (element.type !== 'rule' || cache.compat) return;
|
|
1302
|
-
var unsafePseudoClasses = element.value.match(/(:first|:nth|:nth-last)-child/g);
|
|
1303
|
-
|
|
1304
|
-
if (unsafePseudoClasses) {
|
|
1305
|
-
var isNested = element.parent === children[0]; // in nested rules comments become children of the "auto-inserted" rule
|
|
1306
|
-
//
|
|
1307
|
-
// considering this input:
|
|
1308
|
-
// .a {
|
|
1309
|
-
// .b /* comm */ {}
|
|
1310
|
-
// color: hotpink;
|
|
1311
|
-
// }
|
|
1312
|
-
// we get output corresponding to this:
|
|
1313
|
-
// .a {
|
|
1314
|
-
// & {
|
|
1315
|
-
// /* comm */
|
|
1316
|
-
// color: hotpink;
|
|
1317
|
-
// }
|
|
1318
|
-
// .b {}
|
|
1319
|
-
// }
|
|
1320
|
-
|
|
1321
|
-
var commentContainer = isNested ? children[0].children : // global rule at the root level
|
|
1322
|
-
children;
|
|
1323
|
-
|
|
1324
|
-
for (var i = commentContainer.length - 1; i >= 0; i--) {
|
|
1325
|
-
var node = commentContainer[i];
|
|
1326
|
-
|
|
1327
|
-
if (node.line < element.line) {
|
|
1328
|
-
break;
|
|
1329
|
-
} // it is quite weird but comments are *usually* put at `column: element.column - 1`
|
|
1330
|
-
// so we seek *from the end* for the node that is earlier than the rule's `element` and check that
|
|
1331
|
-
// this will also match inputs like this:
|
|
1332
|
-
// .a {
|
|
1333
|
-
// /* comm */
|
|
1334
|
-
// .b {}
|
|
1335
|
-
// }
|
|
1336
|
-
//
|
|
1337
|
-
// but that is fine
|
|
1338
|
-
//
|
|
1339
|
-
// it would be the easiest to change the placement of the comment to be the first child of the rule:
|
|
1340
|
-
// .a {
|
|
1341
|
-
// .b { /* comm */ }
|
|
1342
|
-
// }
|
|
1343
|
-
// with such inputs we wouldn't have to search for the comment at all
|
|
1344
|
-
// TODO: consider changing this comment placement in the next major version
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
if (node.column < element.column) {
|
|
1348
|
-
if (isIgnoringComment(node)) {
|
|
1349
|
-
return;
|
|
1350
|
-
}
|
|
1351
|
-
|
|
1352
|
-
break;
|
|
1353
|
-
}
|
|
1354
|
-
}
|
|
1355
|
-
|
|
1356
|
-
unsafePseudoClasses.forEach(function (unsafePseudoClass) {
|
|
1357
|
-
console.error("The pseudo class \"" + unsafePseudoClass + "\" is potentially unsafe when doing server-side rendering. Try changing it to \"" + unsafePseudoClass.split('-child')[0] + "-of-type\".");
|
|
1358
|
-
});
|
|
1359
|
-
}
|
|
1360
|
-
};
|
|
1361
|
-
};
|
|
1362
|
-
|
|
1363
|
-
var isImportRule = function isImportRule(element) {
|
|
1364
|
-
return element.type.charCodeAt(1) === 105 && element.type.charCodeAt(0) === 64;
|
|
1365
|
-
};
|
|
1366
|
-
|
|
1367
|
-
var isPrependedWithRegularRules = function isPrependedWithRegularRules(index, children) {
|
|
1368
|
-
for (var i = index - 1; i >= 0; i--) {
|
|
1369
|
-
if (!isImportRule(children[i])) {
|
|
1370
|
-
return true;
|
|
1371
|
-
}
|
|
1372
|
-
}
|
|
1373
|
-
|
|
1374
|
-
return false;
|
|
1375
|
-
}; // use this to remove incorrect elements from further processing
|
|
1376
|
-
// so they don't get handed to the `sheet` (or anything else)
|
|
1377
|
-
// as that could potentially lead to additional logs which in turn could be overhelming to the user
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
var nullifyElement = function nullifyElement(element) {
|
|
1381
|
-
element.type = '';
|
|
1382
|
-
element.value = '';
|
|
1383
|
-
element["return"] = '';
|
|
1384
|
-
element.children = '';
|
|
1385
|
-
element.props = '';
|
|
1386
|
-
};
|
|
1387
|
-
|
|
1388
|
-
var incorrectImportAlarm = function incorrectImportAlarm(element, index, children) {
|
|
1389
|
-
if (!isImportRule(element)) {
|
|
1390
|
-
return;
|
|
1391
|
-
}
|
|
1392
|
-
|
|
1393
|
-
if (element.parent) {
|
|
1394
|
-
console.error("`@import` rules can't be nested inside other rules. Please move it to the top level and put it before regular rules. Keep in mind that they can only be used within global styles.");
|
|
1395
|
-
nullifyElement(element);
|
|
1396
|
-
} else if (isPrependedWithRegularRules(index, children)) {
|
|
1397
|
-
console.error("`@import` rules can't be after other rules. Please put your `@import` rules before your other rules.");
|
|
1398
|
-
nullifyElement(element);
|
|
1399
|
-
}
|
|
1400
|
-
};
|
|
1401
|
-
|
|
1402
|
-
var isBrowser$5 = typeof document !== 'undefined';
|
|
1403
|
-
var getServerStylisCache = isBrowser$5 ? undefined : weakMemoize(function () {
|
|
1404
|
-
return memoize$1(function () {
|
|
1405
|
-
var cache = {};
|
|
1406
|
-
return function (name) {
|
|
1407
|
-
return cache[name];
|
|
1408
|
-
};
|
|
1409
|
-
});
|
|
1410
|
-
});
|
|
1411
|
-
var defaultStylisPlugins = [prefixer];
|
|
1412
|
-
|
|
1413
|
-
var createCache = function createCache(options) {
|
|
1414
|
-
var key = options.key;
|
|
1415
|
-
|
|
1416
|
-
if (process.env.NODE_ENV !== 'production' && !key) {
|
|
1417
|
-
throw new Error("You have to configure `key` for your cache. Please make sure it's unique (and not equal to 'css') as it's used for linking styles to your cache.\n" + "If multiple caches share the same key they might \"fight\" for each other's style elements.");
|
|
1418
|
-
}
|
|
1419
|
-
|
|
1420
|
-
if (isBrowser$5 && key === 'css') {
|
|
1421
|
-
var ssrStyles = document.querySelectorAll("style[data-emotion]:not([data-s])"); // get SSRed styles out of the way of React's hydration
|
|
1422
|
-
// document.head is a safe place to move them to(though note document.head is not necessarily the last place they will be)
|
|
1423
|
-
// note this very very intentionally targets all style elements regardless of the key to ensure
|
|
1424
|
-
// that creating a cache works inside of render of a React component
|
|
1425
|
-
|
|
1426
|
-
Array.prototype.forEach.call(ssrStyles, function (node) {
|
|
1427
|
-
// we want to only move elements which have a space in the data-emotion attribute value
|
|
1428
|
-
// because that indicates that it is an Emotion 11 server-side rendered style elements
|
|
1429
|
-
// while we will already ignore Emotion 11 client-side inserted styles because of the :not([data-s]) part in the selector
|
|
1430
|
-
// Emotion 10 client-side inserted styles did not have data-s (but importantly did not have a space in their data-emotion attributes)
|
|
1431
|
-
// so checking for the space ensures that loading Emotion 11 after Emotion 10 has inserted some styles
|
|
1432
|
-
// will not result in the Emotion 10 styles being destroyed
|
|
1433
|
-
var dataEmotionAttribute = node.getAttribute('data-emotion');
|
|
1434
|
-
|
|
1435
|
-
if (dataEmotionAttribute.indexOf(' ') === -1) {
|
|
1436
|
-
return;
|
|
1437
|
-
}
|
|
1438
|
-
document.head.appendChild(node);
|
|
1439
|
-
node.setAttribute('data-s', '');
|
|
1440
|
-
});
|
|
1441
|
-
}
|
|
1442
|
-
|
|
1443
|
-
var stylisPlugins = options.stylisPlugins || defaultStylisPlugins;
|
|
1444
|
-
|
|
1445
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
1446
|
-
// $FlowFixMe
|
|
1447
|
-
if (/[^a-z-]/.test(key)) {
|
|
1448
|
-
throw new Error("Emotion key must only contain lower case alphabetical characters and - but \"" + key + "\" was passed");
|
|
1449
|
-
}
|
|
1450
|
-
}
|
|
1451
|
-
|
|
1452
|
-
var inserted = {};
|
|
1453
|
-
var container;
|
|
1454
|
-
var nodesToHydrate = [];
|
|
1455
|
-
|
|
1456
|
-
if (isBrowser$5) {
|
|
1457
|
-
container = options.container || document.head;
|
|
1458
|
-
Array.prototype.forEach.call( // this means we will ignore elements which don't have a space in them which
|
|
1459
|
-
// means that the style elements we're looking at are only Emotion 11 server-rendered style elements
|
|
1460
|
-
document.querySelectorAll("style[data-emotion^=\"" + key + " \"]"), function (node) {
|
|
1461
|
-
var attrib = node.getAttribute("data-emotion").split(' '); // $FlowFixMe
|
|
1462
|
-
|
|
1463
|
-
for (var i = 1; i < attrib.length; i++) {
|
|
1464
|
-
inserted[attrib[i]] = true;
|
|
1465
|
-
}
|
|
1466
|
-
|
|
1467
|
-
nodesToHydrate.push(node);
|
|
1468
|
-
});
|
|
1469
|
-
}
|
|
1470
|
-
|
|
1471
|
-
var _insert;
|
|
1472
|
-
|
|
1473
|
-
var omnipresentPlugins = [compat, removeLabel];
|
|
1474
|
-
|
|
1475
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
1476
|
-
omnipresentPlugins.push(createUnsafeSelectorsAlarm({
|
|
1477
|
-
get compat() {
|
|
1478
|
-
return cache.compat;
|
|
1479
|
-
}
|
|
1480
|
-
|
|
1481
|
-
}), incorrectImportAlarm);
|
|
1482
|
-
}
|
|
1483
|
-
|
|
1484
|
-
if (isBrowser$5) {
|
|
1485
|
-
var currentSheet;
|
|
1486
|
-
var finalizingPlugins = [stringify, process.env.NODE_ENV !== 'production' ? function (element) {
|
|
1487
|
-
if (!element.root) {
|
|
1488
|
-
if (element["return"]) {
|
|
1489
|
-
currentSheet.insert(element["return"]);
|
|
1490
|
-
} else if (element.value && element.type !== COMMENT) {
|
|
1491
|
-
// insert empty rule in non-production environments
|
|
1492
|
-
// so @emotion/jest can grab `key` from the (JS)DOM for caches without any rules inserted yet
|
|
1493
|
-
currentSheet.insert(element.value + "{}");
|
|
1494
|
-
}
|
|
1495
|
-
}
|
|
1496
|
-
} : rulesheet(function (rule) {
|
|
1497
|
-
currentSheet.insert(rule);
|
|
1498
|
-
})];
|
|
1499
|
-
var serializer = middleware(omnipresentPlugins.concat(stylisPlugins, finalizingPlugins));
|
|
1500
|
-
|
|
1501
|
-
var stylis = function stylis(styles) {
|
|
1502
|
-
return serialize(compile(styles), serializer);
|
|
1503
|
-
};
|
|
1504
|
-
|
|
1505
|
-
_insert = function insert(selector, serialized, sheet, shouldCache) {
|
|
1506
|
-
currentSheet = sheet;
|
|
1507
|
-
|
|
1508
|
-
if (process.env.NODE_ENV !== 'production' && serialized.map !== undefined) {
|
|
1509
|
-
currentSheet = {
|
|
1510
|
-
insert: function insert(rule) {
|
|
1511
|
-
sheet.insert(rule + serialized.map);
|
|
1512
|
-
}
|
|
1513
|
-
};
|
|
1514
|
-
}
|
|
1515
|
-
|
|
1516
|
-
stylis(selector ? selector + "{" + serialized.styles + "}" : serialized.styles);
|
|
1517
|
-
|
|
1518
|
-
if (shouldCache) {
|
|
1519
|
-
cache.inserted[serialized.name] = true;
|
|
1520
|
-
}
|
|
1521
|
-
};
|
|
1522
|
-
} else {
|
|
1523
|
-
var _finalizingPlugins = [stringify];
|
|
1524
|
-
|
|
1525
|
-
var _serializer = middleware(omnipresentPlugins.concat(stylisPlugins, _finalizingPlugins));
|
|
1526
|
-
|
|
1527
|
-
var _stylis = function _stylis(styles) {
|
|
1528
|
-
return serialize(compile(styles), _serializer);
|
|
1529
|
-
}; // $FlowFixMe
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
var serverStylisCache = getServerStylisCache(stylisPlugins)(key);
|
|
1533
|
-
|
|
1534
|
-
var getRules = function getRules(selector, serialized) {
|
|
1535
|
-
var name = serialized.name;
|
|
1536
|
-
|
|
1537
|
-
if (serverStylisCache[name] === undefined) {
|
|
1538
|
-
serverStylisCache[name] = _stylis(selector ? selector + "{" + serialized.styles + "}" : serialized.styles);
|
|
1539
|
-
}
|
|
1540
|
-
|
|
1541
|
-
return serverStylisCache[name];
|
|
1542
|
-
};
|
|
1543
|
-
|
|
1544
|
-
_insert = function _insert(selector, serialized, sheet, shouldCache) {
|
|
1545
|
-
var name = serialized.name;
|
|
1546
|
-
var rules = getRules(selector, serialized);
|
|
1547
|
-
|
|
1548
|
-
if (cache.compat === undefined) {
|
|
1549
|
-
// in regular mode, we don't set the styles on the inserted cache
|
|
1550
|
-
// since we don't need to and that would be wasting memory
|
|
1551
|
-
// we return them so that they are rendered in a style tag
|
|
1552
|
-
if (shouldCache) {
|
|
1553
|
-
cache.inserted[name] = true;
|
|
1554
|
-
}
|
|
1555
|
-
|
|
1556
|
-
if ( // using === development instead of !== production
|
|
1557
|
-
// because if people do ssr in tests, the source maps showing up would be annoying
|
|
1558
|
-
process.env.NODE_ENV === 'development' && serialized.map !== undefined) {
|
|
1559
|
-
return rules + serialized.map;
|
|
1560
|
-
}
|
|
1561
|
-
|
|
1562
|
-
return rules;
|
|
1563
|
-
} else {
|
|
1564
|
-
// in compat mode, we put the styles on the inserted cache so
|
|
1565
|
-
// that emotion-server can pull out the styles
|
|
1566
|
-
// except when we don't want to cache it which was in Global but now
|
|
1567
|
-
// is nowhere but we don't want to do a major right now
|
|
1568
|
-
// and just in case we're going to leave the case here
|
|
1569
|
-
// it's also not affecting client side bundle size
|
|
1570
|
-
// so it's really not a big deal
|
|
1571
|
-
if (shouldCache) {
|
|
1572
|
-
cache.inserted[name] = rules;
|
|
1573
|
-
} else {
|
|
1574
|
-
return rules;
|
|
1575
|
-
}
|
|
1576
|
-
}
|
|
1577
|
-
};
|
|
1578
|
-
}
|
|
1579
|
-
|
|
1580
|
-
var cache = {
|
|
1581
|
-
key: key,
|
|
1582
|
-
sheet: new StyleSheet({
|
|
1583
|
-
key: key,
|
|
1584
|
-
container: container,
|
|
1585
|
-
nonce: options.nonce,
|
|
1586
|
-
speedy: options.speedy,
|
|
1587
|
-
prepend: options.prepend,
|
|
1588
|
-
insertionPoint: options.insertionPoint
|
|
1589
|
-
}),
|
|
1590
|
-
nonce: options.nonce,
|
|
1591
|
-
inserted: inserted,
|
|
1592
|
-
registered: {},
|
|
1593
|
-
insert: _insert
|
|
1594
|
-
};
|
|
1595
|
-
cache.sheet.hydrate(nodesToHydrate);
|
|
1596
|
-
return cache;
|
|
1597
|
-
};
|
|
236
|
+
var propTypes = {exports: {}};
|
|
1598
237
|
|
|
1599
|
-
var reactIs$
|
|
238
|
+
var reactIs$1 = {exports: {}};
|
|
1600
239
|
|
|
1601
240
|
var reactIs_production_min$1 = {};
|
|
1602
241
|
|
|
@@ -1797,1298 +436,11 @@ reactIs_development$1.typeOf = typeOf;
|
|
|
1797
436
|
}
|
|
1798
437
|
|
|
1799
438
|
if (process.env.NODE_ENV === 'production') {
|
|
1800
|
-
reactIs$
|
|
439
|
+
reactIs$1.exports = reactIs_production_min$1;
|
|
1801
440
|
} else {
|
|
1802
|
-
reactIs$
|
|
1803
|
-
}
|
|
1804
|
-
|
|
1805
|
-
var reactIs$1 = reactIs$2.exports;
|
|
1806
|
-
var FORWARD_REF_STATICS = {
|
|
1807
|
-
'$$typeof': true,
|
|
1808
|
-
render: true,
|
|
1809
|
-
defaultProps: true,
|
|
1810
|
-
displayName: true,
|
|
1811
|
-
propTypes: true
|
|
1812
|
-
};
|
|
1813
|
-
var MEMO_STATICS = {
|
|
1814
|
-
'$$typeof': true,
|
|
1815
|
-
compare: true,
|
|
1816
|
-
defaultProps: true,
|
|
1817
|
-
displayName: true,
|
|
1818
|
-
propTypes: true,
|
|
1819
|
-
type: true
|
|
1820
|
-
};
|
|
1821
|
-
var TYPE_STATICS = {};
|
|
1822
|
-
TYPE_STATICS[reactIs$1.ForwardRef] = FORWARD_REF_STATICS;
|
|
1823
|
-
TYPE_STATICS[reactIs$1.Memo] = MEMO_STATICS;
|
|
1824
|
-
|
|
1825
|
-
var isBrowser$4 = typeof document !== 'undefined';
|
|
1826
|
-
function getRegisteredStyles(registered, registeredStyles, classNames) {
|
|
1827
|
-
var rawClassName = '';
|
|
1828
|
-
classNames.split(' ').forEach(function (className) {
|
|
1829
|
-
if (registered[className] !== undefined) {
|
|
1830
|
-
registeredStyles.push(registered[className] + ";");
|
|
1831
|
-
} else {
|
|
1832
|
-
rawClassName += className + " ";
|
|
1833
|
-
}
|
|
1834
|
-
});
|
|
1835
|
-
return rawClassName;
|
|
1836
|
-
}
|
|
1837
|
-
var registerStyles = function registerStyles(cache, serialized, isStringTag) {
|
|
1838
|
-
var className = cache.key + "-" + serialized.name;
|
|
1839
|
-
|
|
1840
|
-
if ( // we only need to add the styles to the registered cache if the
|
|
1841
|
-
// class name could be used further down
|
|
1842
|
-
// the tree but if it's a string tag, we know it won't
|
|
1843
|
-
// so we don't have to add it to registered cache.
|
|
1844
|
-
// this improves memory usage since we can avoid storing the whole style string
|
|
1845
|
-
(isStringTag === false || // we need to always store it if we're in compat mode and
|
|
1846
|
-
// in node since emotion-server relies on whether a style is in
|
|
1847
|
-
// the registered cache to know whether a style is global or not
|
|
1848
|
-
// also, note that this check will be dead code eliminated in the browser
|
|
1849
|
-
isBrowser$4 === false && cache.compat !== undefined) && cache.registered[className] === undefined) {
|
|
1850
|
-
cache.registered[className] = serialized.styles;
|
|
1851
|
-
}
|
|
1852
|
-
};
|
|
1853
|
-
var insertStyles = function insertStyles(cache, serialized, isStringTag) {
|
|
1854
|
-
registerStyles(cache, serialized, isStringTag);
|
|
1855
|
-
var className = cache.key + "-" + serialized.name;
|
|
1856
|
-
|
|
1857
|
-
if (cache.inserted[serialized.name] === undefined) {
|
|
1858
|
-
var stylesForSSR = '';
|
|
1859
|
-
var current = serialized;
|
|
1860
|
-
|
|
1861
|
-
do {
|
|
1862
|
-
var maybeStyles = cache.insert(serialized === current ? "." + className : '', current, cache.sheet, true);
|
|
1863
|
-
|
|
1864
|
-
if (!isBrowser$4 && maybeStyles !== undefined) {
|
|
1865
|
-
stylesForSSR += maybeStyles;
|
|
1866
|
-
}
|
|
1867
|
-
|
|
1868
|
-
current = current.next;
|
|
1869
|
-
} while (current !== undefined);
|
|
1870
|
-
|
|
1871
|
-
if (!isBrowser$4 && stylesForSSR.length !== 0) {
|
|
1872
|
-
return stylesForSSR;
|
|
1873
|
-
}
|
|
1874
|
-
}
|
|
1875
|
-
};
|
|
1876
|
-
|
|
1877
|
-
/* eslint-disable */
|
|
1878
|
-
// Inspired by https://github.com/garycourt/murmurhash-js
|
|
1879
|
-
// Ported from https://github.com/aappleby/smhasher/blob/61a0530f28277f2e850bfc39600ce61d02b518de/src/MurmurHash2.cpp#L37-L86
|
|
1880
|
-
function murmur2(str) {
|
|
1881
|
-
// 'm' and 'r' are mixing constants generated offline.
|
|
1882
|
-
// They're not really 'magic', they just happen to work well.
|
|
1883
|
-
// const m = 0x5bd1e995;
|
|
1884
|
-
// const r = 24;
|
|
1885
|
-
// Initialize the hash
|
|
1886
|
-
var h = 0; // Mix 4 bytes at a time into the hash
|
|
1887
|
-
|
|
1888
|
-
var k,
|
|
1889
|
-
i = 0,
|
|
1890
|
-
len = str.length;
|
|
1891
|
-
|
|
1892
|
-
for (; len >= 4; ++i, len -= 4) {
|
|
1893
|
-
k = str.charCodeAt(i) & 0xff | (str.charCodeAt(++i) & 0xff) << 8 | (str.charCodeAt(++i) & 0xff) << 16 | (str.charCodeAt(++i) & 0xff) << 24;
|
|
1894
|
-
k =
|
|
1895
|
-
/* Math.imul(k, m): */
|
|
1896
|
-
(k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16);
|
|
1897
|
-
k ^=
|
|
1898
|
-
/* k >>> r: */
|
|
1899
|
-
k >>> 24;
|
|
1900
|
-
h =
|
|
1901
|
-
/* Math.imul(k, m): */
|
|
1902
|
-
(k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16) ^
|
|
1903
|
-
/* Math.imul(h, m): */
|
|
1904
|
-
(h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);
|
|
1905
|
-
} // Handle the last few bytes of the input array
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
switch (len) {
|
|
1909
|
-
case 3:
|
|
1910
|
-
h ^= (str.charCodeAt(i + 2) & 0xff) << 16;
|
|
1911
|
-
|
|
1912
|
-
case 2:
|
|
1913
|
-
h ^= (str.charCodeAt(i + 1) & 0xff) << 8;
|
|
1914
|
-
|
|
1915
|
-
case 1:
|
|
1916
|
-
h ^= str.charCodeAt(i) & 0xff;
|
|
1917
|
-
h =
|
|
1918
|
-
/* Math.imul(h, m): */
|
|
1919
|
-
(h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);
|
|
1920
|
-
} // Do a few final mixes of the hash to ensure the last few
|
|
1921
|
-
// bytes are well-incorporated.
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
h ^= h >>> 13;
|
|
1925
|
-
h =
|
|
1926
|
-
/* Math.imul(h, m): */
|
|
1927
|
-
(h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);
|
|
1928
|
-
return ((h ^ h >>> 15) >>> 0).toString(36);
|
|
1929
|
-
}
|
|
1930
|
-
|
|
1931
|
-
var unitlessKeys = {
|
|
1932
|
-
animationIterationCount: 1,
|
|
1933
|
-
borderImageOutset: 1,
|
|
1934
|
-
borderImageSlice: 1,
|
|
1935
|
-
borderImageWidth: 1,
|
|
1936
|
-
boxFlex: 1,
|
|
1937
|
-
boxFlexGroup: 1,
|
|
1938
|
-
boxOrdinalGroup: 1,
|
|
1939
|
-
columnCount: 1,
|
|
1940
|
-
columns: 1,
|
|
1941
|
-
flex: 1,
|
|
1942
|
-
flexGrow: 1,
|
|
1943
|
-
flexPositive: 1,
|
|
1944
|
-
flexShrink: 1,
|
|
1945
|
-
flexNegative: 1,
|
|
1946
|
-
flexOrder: 1,
|
|
1947
|
-
gridRow: 1,
|
|
1948
|
-
gridRowEnd: 1,
|
|
1949
|
-
gridRowSpan: 1,
|
|
1950
|
-
gridRowStart: 1,
|
|
1951
|
-
gridColumn: 1,
|
|
1952
|
-
gridColumnEnd: 1,
|
|
1953
|
-
gridColumnSpan: 1,
|
|
1954
|
-
gridColumnStart: 1,
|
|
1955
|
-
msGridRow: 1,
|
|
1956
|
-
msGridRowSpan: 1,
|
|
1957
|
-
msGridColumn: 1,
|
|
1958
|
-
msGridColumnSpan: 1,
|
|
1959
|
-
fontWeight: 1,
|
|
1960
|
-
lineHeight: 1,
|
|
1961
|
-
opacity: 1,
|
|
1962
|
-
order: 1,
|
|
1963
|
-
orphans: 1,
|
|
1964
|
-
tabSize: 1,
|
|
1965
|
-
widows: 1,
|
|
1966
|
-
zIndex: 1,
|
|
1967
|
-
zoom: 1,
|
|
1968
|
-
WebkitLineClamp: 1,
|
|
1969
|
-
// SVG-related properties
|
|
1970
|
-
fillOpacity: 1,
|
|
1971
|
-
floodOpacity: 1,
|
|
1972
|
-
stopOpacity: 1,
|
|
1973
|
-
strokeDasharray: 1,
|
|
1974
|
-
strokeDashoffset: 1,
|
|
1975
|
-
strokeMiterlimit: 1,
|
|
1976
|
-
strokeOpacity: 1,
|
|
1977
|
-
strokeWidth: 1
|
|
1978
|
-
};
|
|
1979
|
-
|
|
1980
|
-
var ILLEGAL_ESCAPE_SEQUENCE_ERROR$1 = "You have illegal escape sequence in your template literal, most likely inside content's property value.\nBecause you write your CSS inside a JavaScript string you actually have to do double escaping, so for example \"content: '\\00d7';\" should become \"content: '\\\\00d7';\".\nYou can read more about this here:\nhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences";
|
|
1981
|
-
var UNDEFINED_AS_OBJECT_KEY_ERROR = "You have passed in falsy value as style object's key (can happen when in example you pass unexported component as computed key).";
|
|
1982
|
-
var hyphenateRegex = /[A-Z]|^ms/g;
|
|
1983
|
-
var animationRegex = /_EMO_([^_]+?)_([^]*?)_EMO_/g;
|
|
1984
|
-
|
|
1985
|
-
var isCustomProperty = function isCustomProperty(property) {
|
|
1986
|
-
return property.charCodeAt(1) === 45;
|
|
1987
|
-
};
|
|
1988
|
-
|
|
1989
|
-
var isProcessableValue = function isProcessableValue(value) {
|
|
1990
|
-
return value != null && typeof value !== 'boolean';
|
|
1991
|
-
};
|
|
1992
|
-
|
|
1993
|
-
var processStyleName = /* #__PURE__ */memoize$1(function (styleName) {
|
|
1994
|
-
return isCustomProperty(styleName) ? styleName : styleName.replace(hyphenateRegex, '-$&').toLowerCase();
|
|
1995
|
-
});
|
|
1996
|
-
|
|
1997
|
-
var processStyleValue = function processStyleValue(key, value) {
|
|
1998
|
-
switch (key) {
|
|
1999
|
-
case 'animation':
|
|
2000
|
-
case 'animationName':
|
|
2001
|
-
{
|
|
2002
|
-
if (typeof value === 'string') {
|
|
2003
|
-
return value.replace(animationRegex, function (match, p1, p2) {
|
|
2004
|
-
cursor = {
|
|
2005
|
-
name: p1,
|
|
2006
|
-
styles: p2,
|
|
2007
|
-
next: cursor
|
|
2008
|
-
};
|
|
2009
|
-
return p1;
|
|
2010
|
-
});
|
|
2011
|
-
}
|
|
2012
|
-
}
|
|
2013
|
-
}
|
|
2014
|
-
|
|
2015
|
-
if (unitlessKeys[key] !== 1 && !isCustomProperty(key) && typeof value === 'number' && value !== 0) {
|
|
2016
|
-
return value + 'px';
|
|
2017
|
-
}
|
|
2018
|
-
|
|
2019
|
-
return value;
|
|
2020
|
-
};
|
|
2021
|
-
|
|
2022
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
2023
|
-
var contentValuePattern = /(var|attr|counters?|url|(((repeating-)?(linear|radial))|conic)-gradient)\(|(no-)?(open|close)-quote/;
|
|
2024
|
-
var contentValues = ['normal', 'none', 'initial', 'inherit', 'unset'];
|
|
2025
|
-
var oldProcessStyleValue = processStyleValue;
|
|
2026
|
-
var msPattern = /^-ms-/;
|
|
2027
|
-
var hyphenPattern = /-(.)/g;
|
|
2028
|
-
var hyphenatedCache = {};
|
|
2029
|
-
|
|
2030
|
-
processStyleValue = function processStyleValue(key, value) {
|
|
2031
|
-
if (key === 'content') {
|
|
2032
|
-
if (typeof value !== 'string' || contentValues.indexOf(value) === -1 && !contentValuePattern.test(value) && (value.charAt(0) !== value.charAt(value.length - 1) || value.charAt(0) !== '"' && value.charAt(0) !== "'")) {
|
|
2033
|
-
throw new Error("You seem to be using a value for 'content' without quotes, try replacing it with `content: '\"" + value + "\"'`");
|
|
2034
|
-
}
|
|
2035
|
-
}
|
|
2036
|
-
|
|
2037
|
-
var processed = oldProcessStyleValue(key, value);
|
|
2038
|
-
|
|
2039
|
-
if (processed !== '' && !isCustomProperty(key) && key.indexOf('-') !== -1 && hyphenatedCache[key] === undefined) {
|
|
2040
|
-
hyphenatedCache[key] = true;
|
|
2041
|
-
console.error("Using kebab-case for css properties in objects is not supported. Did you mean " + key.replace(msPattern, 'ms-').replace(hyphenPattern, function (str, _char) {
|
|
2042
|
-
return _char.toUpperCase();
|
|
2043
|
-
}) + "?");
|
|
2044
|
-
}
|
|
2045
|
-
|
|
2046
|
-
return processed;
|
|
2047
|
-
};
|
|
2048
|
-
}
|
|
2049
|
-
|
|
2050
|
-
var noComponentSelectorMessage = 'Component selectors can only be used in conjunction with ' + '@emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware ' + 'compiler transform.';
|
|
2051
|
-
|
|
2052
|
-
function handleInterpolation(mergedProps, registered, interpolation) {
|
|
2053
|
-
if (interpolation == null) {
|
|
2054
|
-
return '';
|
|
2055
|
-
}
|
|
2056
|
-
|
|
2057
|
-
if (interpolation.__emotion_styles !== undefined) {
|
|
2058
|
-
if (process.env.NODE_ENV !== 'production' && interpolation.toString() === 'NO_COMPONENT_SELECTOR') {
|
|
2059
|
-
throw new Error(noComponentSelectorMessage);
|
|
2060
|
-
}
|
|
2061
|
-
|
|
2062
|
-
return interpolation;
|
|
2063
|
-
}
|
|
2064
|
-
|
|
2065
|
-
switch (typeof interpolation) {
|
|
2066
|
-
case 'boolean':
|
|
2067
|
-
{
|
|
2068
|
-
return '';
|
|
2069
|
-
}
|
|
2070
|
-
|
|
2071
|
-
case 'object':
|
|
2072
|
-
{
|
|
2073
|
-
if (interpolation.anim === 1) {
|
|
2074
|
-
cursor = {
|
|
2075
|
-
name: interpolation.name,
|
|
2076
|
-
styles: interpolation.styles,
|
|
2077
|
-
next: cursor
|
|
2078
|
-
};
|
|
2079
|
-
return interpolation.name;
|
|
2080
|
-
}
|
|
2081
|
-
|
|
2082
|
-
if (interpolation.styles !== undefined) {
|
|
2083
|
-
var next = interpolation.next;
|
|
2084
|
-
|
|
2085
|
-
if (next !== undefined) {
|
|
2086
|
-
// not the most efficient thing ever but this is a pretty rare case
|
|
2087
|
-
// and there will be very few iterations of this generally
|
|
2088
|
-
while (next !== undefined) {
|
|
2089
|
-
cursor = {
|
|
2090
|
-
name: next.name,
|
|
2091
|
-
styles: next.styles,
|
|
2092
|
-
next: cursor
|
|
2093
|
-
};
|
|
2094
|
-
next = next.next;
|
|
2095
|
-
}
|
|
2096
|
-
}
|
|
2097
|
-
|
|
2098
|
-
var styles = interpolation.styles + ";";
|
|
2099
|
-
|
|
2100
|
-
if (process.env.NODE_ENV !== 'production' && interpolation.map !== undefined) {
|
|
2101
|
-
styles += interpolation.map;
|
|
2102
|
-
}
|
|
2103
|
-
|
|
2104
|
-
return styles;
|
|
2105
|
-
}
|
|
2106
|
-
|
|
2107
|
-
return createStringFromObject(mergedProps, registered, interpolation);
|
|
2108
|
-
}
|
|
2109
|
-
|
|
2110
|
-
case 'function':
|
|
2111
|
-
{
|
|
2112
|
-
if (mergedProps !== undefined) {
|
|
2113
|
-
var previousCursor = cursor;
|
|
2114
|
-
var result = interpolation(mergedProps);
|
|
2115
|
-
cursor = previousCursor;
|
|
2116
|
-
return handleInterpolation(mergedProps, registered, result);
|
|
2117
|
-
} else if (process.env.NODE_ENV !== 'production') {
|
|
2118
|
-
console.error('Functions that are interpolated in css calls will be stringified.\n' + 'If you want to have a css call based on props, create a function that returns a css call like this\n' + 'let dynamicStyle = (props) => css`color: ${props.color}`\n' + 'It can be called directly with props or interpolated in a styled call like this\n' + "let SomeComponent = styled('div')`${dynamicStyle}`");
|
|
2119
|
-
}
|
|
2120
|
-
|
|
2121
|
-
break;
|
|
2122
|
-
}
|
|
2123
|
-
|
|
2124
|
-
case 'string':
|
|
2125
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
2126
|
-
var matched = [];
|
|
2127
|
-
var replaced = interpolation.replace(animationRegex, function (match, p1, p2) {
|
|
2128
|
-
var fakeVarName = "animation" + matched.length;
|
|
2129
|
-
matched.push("const " + fakeVarName + " = keyframes`" + p2.replace(/^@keyframes animation-\w+/, '') + "`");
|
|
2130
|
-
return "${" + fakeVarName + "}";
|
|
2131
|
-
});
|
|
2132
|
-
|
|
2133
|
-
if (matched.length) {
|
|
2134
|
-
console.error('`keyframes` output got interpolated into plain string, please wrap it with `css`.\n\n' + 'Instead of doing this:\n\n' + [].concat(matched, ["`" + replaced + "`"]).join('\n') + '\n\nYou should wrap it with `css` like this:\n\n' + ("css`" + replaced + "`"));
|
|
2135
|
-
}
|
|
2136
|
-
}
|
|
2137
|
-
|
|
2138
|
-
break;
|
|
2139
|
-
} // finalize string values (regular strings and functions interpolated into css calls)
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
if (registered == null) {
|
|
2143
|
-
return interpolation;
|
|
2144
|
-
}
|
|
2145
|
-
|
|
2146
|
-
var cached = registered[interpolation];
|
|
2147
|
-
return cached !== undefined ? cached : interpolation;
|
|
2148
|
-
}
|
|
2149
|
-
|
|
2150
|
-
function createStringFromObject(mergedProps, registered, obj) {
|
|
2151
|
-
var string = '';
|
|
2152
|
-
|
|
2153
|
-
if (Array.isArray(obj)) {
|
|
2154
|
-
for (var i = 0; i < obj.length; i++) {
|
|
2155
|
-
string += handleInterpolation(mergedProps, registered, obj[i]) + ";";
|
|
2156
|
-
}
|
|
2157
|
-
} else {
|
|
2158
|
-
for (var _key in obj) {
|
|
2159
|
-
var value = obj[_key];
|
|
2160
|
-
|
|
2161
|
-
if (typeof value !== 'object') {
|
|
2162
|
-
if (registered != null && registered[value] !== undefined) {
|
|
2163
|
-
string += _key + "{" + registered[value] + "}";
|
|
2164
|
-
} else if (isProcessableValue(value)) {
|
|
2165
|
-
string += processStyleName(_key) + ":" + processStyleValue(_key, value) + ";";
|
|
2166
|
-
}
|
|
2167
|
-
} else {
|
|
2168
|
-
if (_key === 'NO_COMPONENT_SELECTOR' && process.env.NODE_ENV !== 'production') {
|
|
2169
|
-
throw new Error(noComponentSelectorMessage);
|
|
2170
|
-
}
|
|
2171
|
-
|
|
2172
|
-
if (Array.isArray(value) && typeof value[0] === 'string' && (registered == null || registered[value[0]] === undefined)) {
|
|
2173
|
-
for (var _i = 0; _i < value.length; _i++) {
|
|
2174
|
-
if (isProcessableValue(value[_i])) {
|
|
2175
|
-
string += processStyleName(_key) + ":" + processStyleValue(_key, value[_i]) + ";";
|
|
2176
|
-
}
|
|
2177
|
-
}
|
|
2178
|
-
} else {
|
|
2179
|
-
var interpolated = handleInterpolation(mergedProps, registered, value);
|
|
2180
|
-
|
|
2181
|
-
switch (_key) {
|
|
2182
|
-
case 'animation':
|
|
2183
|
-
case 'animationName':
|
|
2184
|
-
{
|
|
2185
|
-
string += processStyleName(_key) + ":" + interpolated + ";";
|
|
2186
|
-
break;
|
|
2187
|
-
}
|
|
2188
|
-
|
|
2189
|
-
default:
|
|
2190
|
-
{
|
|
2191
|
-
if (process.env.NODE_ENV !== 'production' && _key === 'undefined') {
|
|
2192
|
-
console.error(UNDEFINED_AS_OBJECT_KEY_ERROR);
|
|
2193
|
-
}
|
|
2194
|
-
|
|
2195
|
-
string += _key + "{" + interpolated + "}";
|
|
2196
|
-
}
|
|
2197
|
-
}
|
|
2198
|
-
}
|
|
2199
|
-
}
|
|
2200
|
-
}
|
|
2201
|
-
}
|
|
2202
|
-
|
|
2203
|
-
return string;
|
|
2204
|
-
}
|
|
2205
|
-
|
|
2206
|
-
var labelPattern = /label:\s*([^\s;\n{]+)\s*(;|$)/g;
|
|
2207
|
-
var sourceMapPattern;
|
|
2208
|
-
|
|
2209
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
2210
|
-
sourceMapPattern = /\/\*#\ssourceMappingURL=data:application\/json;\S+\s+\*\//g;
|
|
2211
|
-
} // this is the cursor for keyframes
|
|
2212
|
-
// keyframes are stored on the SerializedStyles object as a linked list
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
var cursor;
|
|
2216
|
-
var serializeStyles = function serializeStyles(args, registered, mergedProps) {
|
|
2217
|
-
if (args.length === 1 && typeof args[0] === 'object' && args[0] !== null && args[0].styles !== undefined) {
|
|
2218
|
-
return args[0];
|
|
2219
|
-
}
|
|
2220
|
-
|
|
2221
|
-
var stringMode = true;
|
|
2222
|
-
var styles = '';
|
|
2223
|
-
cursor = undefined;
|
|
2224
|
-
var strings = args[0];
|
|
2225
|
-
|
|
2226
|
-
if (strings == null || strings.raw === undefined) {
|
|
2227
|
-
stringMode = false;
|
|
2228
|
-
styles += handleInterpolation(mergedProps, registered, strings);
|
|
2229
|
-
} else {
|
|
2230
|
-
if (process.env.NODE_ENV !== 'production' && strings[0] === undefined) {
|
|
2231
|
-
console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR$1);
|
|
2232
|
-
}
|
|
2233
|
-
|
|
2234
|
-
styles += strings[0];
|
|
2235
|
-
} // we start at 1 since we've already handled the first arg
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
for (var i = 1; i < args.length; i++) {
|
|
2239
|
-
styles += handleInterpolation(mergedProps, registered, args[i]);
|
|
2240
|
-
|
|
2241
|
-
if (stringMode) {
|
|
2242
|
-
if (process.env.NODE_ENV !== 'production' && strings[i] === undefined) {
|
|
2243
|
-
console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR$1);
|
|
2244
|
-
}
|
|
2245
|
-
|
|
2246
|
-
styles += strings[i];
|
|
2247
|
-
}
|
|
2248
|
-
}
|
|
2249
|
-
|
|
2250
|
-
var sourceMap;
|
|
2251
|
-
|
|
2252
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
2253
|
-
styles = styles.replace(sourceMapPattern, function (match) {
|
|
2254
|
-
sourceMap = match;
|
|
2255
|
-
return '';
|
|
2256
|
-
});
|
|
2257
|
-
} // using a global regex with .exec is stateful so lastIndex has to be reset each time
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
labelPattern.lastIndex = 0;
|
|
2261
|
-
var identifierName = '';
|
|
2262
|
-
var match; // https://esbench.com/bench/5b809c2cf2949800a0f61fb5
|
|
2263
|
-
|
|
2264
|
-
while ((match = labelPattern.exec(styles)) !== null) {
|
|
2265
|
-
identifierName += '-' + // $FlowFixMe we know it's not null
|
|
2266
|
-
match[1];
|
|
2267
|
-
}
|
|
2268
|
-
|
|
2269
|
-
var name = murmur2(styles) + identifierName;
|
|
2270
|
-
|
|
2271
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
2272
|
-
// $FlowFixMe SerializedStyles type doesn't have toString property (and we don't want to add it)
|
|
2273
|
-
return {
|
|
2274
|
-
name: name,
|
|
2275
|
-
styles: styles,
|
|
2276
|
-
map: sourceMap,
|
|
2277
|
-
next: cursor,
|
|
2278
|
-
toString: function toString() {
|
|
2279
|
-
return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
|
|
2280
|
-
}
|
|
2281
|
-
};
|
|
2282
|
-
}
|
|
2283
|
-
|
|
2284
|
-
return {
|
|
2285
|
-
name: name,
|
|
2286
|
-
styles: styles,
|
|
2287
|
-
next: cursor
|
|
2288
|
-
};
|
|
2289
|
-
};
|
|
2290
|
-
|
|
2291
|
-
var isBrowser$3 = typeof document !== 'undefined';
|
|
2292
|
-
|
|
2293
|
-
var syncFallback = function syncFallback(create) {
|
|
2294
|
-
return create();
|
|
2295
|
-
};
|
|
2296
|
-
|
|
2297
|
-
var useInsertionEffect = React__namespace['useInsertion' + 'Effect'] ? React__namespace['useInsertion' + 'Effect'] : false;
|
|
2298
|
-
var useInsertionEffectAlwaysWithSyncFallback = !isBrowser$3 ? syncFallback : useInsertionEffect || syncFallback;
|
|
2299
|
-
var useInsertionEffectWithLayoutFallback = useInsertionEffect || React.useLayoutEffect;
|
|
2300
|
-
|
|
2301
|
-
var isBrowser$2 = typeof document !== 'undefined';
|
|
2302
|
-
var hasOwnProperty$1 = {}.hasOwnProperty;
|
|
2303
|
-
|
|
2304
|
-
var EmotionCacheContext = /* #__PURE__ */React.createContext( // we're doing this to avoid preconstruct's dead code elimination in this one case
|
|
2305
|
-
// because this module is primarily intended for the browser and node
|
|
2306
|
-
// but it's also required in react native and similar environments sometimes
|
|
2307
|
-
// and we could have a special build just for that
|
|
2308
|
-
// but this is much easier and the native packages
|
|
2309
|
-
// might use a different theme context in the future anyway
|
|
2310
|
-
typeof HTMLElement !== 'undefined' ? /* #__PURE__ */createCache({
|
|
2311
|
-
key: 'css'
|
|
2312
|
-
}) : null);
|
|
2313
|
-
|
|
2314
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
2315
|
-
EmotionCacheContext.displayName = 'EmotionCacheContext';
|
|
441
|
+
reactIs$1.exports = reactIs_development$1;
|
|
2316
442
|
}
|
|
2317
443
|
|
|
2318
|
-
EmotionCacheContext.Provider;
|
|
2319
|
-
|
|
2320
|
-
var withEmotionCache = function withEmotionCache(func) {
|
|
2321
|
-
// $FlowFixMe
|
|
2322
|
-
return /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
2323
|
-
// the cache will never be null in the browser
|
|
2324
|
-
var cache = React.useContext(EmotionCacheContext);
|
|
2325
|
-
return func(props, cache, ref);
|
|
2326
|
-
});
|
|
2327
|
-
};
|
|
2328
|
-
|
|
2329
|
-
if (!isBrowser$2) {
|
|
2330
|
-
withEmotionCache = function withEmotionCache(func) {
|
|
2331
|
-
return function (props) {
|
|
2332
|
-
var cache = React.useContext(EmotionCacheContext);
|
|
2333
|
-
|
|
2334
|
-
if (cache === null) {
|
|
2335
|
-
// yes, we're potentially creating this on every render
|
|
2336
|
-
// it doesn't actually matter though since it's only on the server
|
|
2337
|
-
// so there will only every be a single render
|
|
2338
|
-
// that could change in the future because of suspense and etc. but for now,
|
|
2339
|
-
// this works and i don't want to optimise for a future thing that we aren't sure about
|
|
2340
|
-
cache = createCache({
|
|
2341
|
-
key: 'css'
|
|
2342
|
-
});
|
|
2343
|
-
return /*#__PURE__*/React.createElement(EmotionCacheContext.Provider, {
|
|
2344
|
-
value: cache
|
|
2345
|
-
}, func(props, cache));
|
|
2346
|
-
} else {
|
|
2347
|
-
return func(props, cache);
|
|
2348
|
-
}
|
|
2349
|
-
};
|
|
2350
|
-
};
|
|
2351
|
-
}
|
|
2352
|
-
|
|
2353
|
-
var ThemeContext$2 = /* #__PURE__ */React.createContext({});
|
|
2354
|
-
|
|
2355
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
2356
|
-
ThemeContext$2.displayName = 'EmotionThemeContext';
|
|
2357
|
-
}
|
|
2358
|
-
|
|
2359
|
-
var getTheme = function getTheme(outerTheme, theme) {
|
|
2360
|
-
if (typeof theme === 'function') {
|
|
2361
|
-
var mergedTheme = theme(outerTheme);
|
|
2362
|
-
|
|
2363
|
-
if (process.env.NODE_ENV !== 'production' && (mergedTheme == null || typeof mergedTheme !== 'object' || Array.isArray(mergedTheme))) {
|
|
2364
|
-
throw new Error('[ThemeProvider] Please return an object from your theme function, i.e. theme={() => ({})}!');
|
|
2365
|
-
}
|
|
2366
|
-
|
|
2367
|
-
return mergedTheme;
|
|
2368
|
-
}
|
|
2369
|
-
|
|
2370
|
-
if (process.env.NODE_ENV !== 'production' && (theme == null || typeof theme !== 'object' || Array.isArray(theme))) {
|
|
2371
|
-
throw new Error('[ThemeProvider] Please make your theme prop a plain object');
|
|
2372
|
-
}
|
|
2373
|
-
|
|
2374
|
-
return _extends({}, outerTheme, theme);
|
|
2375
|
-
};
|
|
2376
|
-
|
|
2377
|
-
var createCacheWithTheme = /* #__PURE__ */weakMemoize(function (outerTheme) {
|
|
2378
|
-
return weakMemoize(function (theme) {
|
|
2379
|
-
return getTheme(outerTheme, theme);
|
|
2380
|
-
});
|
|
2381
|
-
});
|
|
2382
|
-
var ThemeProvider = function ThemeProvider(props) {
|
|
2383
|
-
var theme = React.useContext(ThemeContext$2);
|
|
2384
|
-
|
|
2385
|
-
if (props.theme !== theme) {
|
|
2386
|
-
theme = createCacheWithTheme(theme)(props.theme);
|
|
2387
|
-
}
|
|
2388
|
-
|
|
2389
|
-
return /*#__PURE__*/React.createElement(ThemeContext$2.Provider, {
|
|
2390
|
-
value: theme
|
|
2391
|
-
}, props.children);
|
|
2392
|
-
};
|
|
2393
|
-
|
|
2394
|
-
var typePropName = '__EMOTION_TYPE_PLEASE_DO_NOT_USE__';
|
|
2395
|
-
var labelPropName = '__EMOTION_LABEL_PLEASE_DO_NOT_USE__';
|
|
2396
|
-
|
|
2397
|
-
var Insertion$2 = function Insertion(_ref) {
|
|
2398
|
-
var cache = _ref.cache,
|
|
2399
|
-
serialized = _ref.serialized,
|
|
2400
|
-
isStringTag = _ref.isStringTag;
|
|
2401
|
-
registerStyles(cache, serialized, isStringTag);
|
|
2402
|
-
var rules = useInsertionEffectAlwaysWithSyncFallback(function () {
|
|
2403
|
-
return insertStyles(cache, serialized, isStringTag);
|
|
2404
|
-
});
|
|
2405
|
-
|
|
2406
|
-
if (!isBrowser$2 && rules !== undefined) {
|
|
2407
|
-
var _ref2;
|
|
2408
|
-
|
|
2409
|
-
var serializedNames = serialized.name;
|
|
2410
|
-
var next = serialized.next;
|
|
2411
|
-
|
|
2412
|
-
while (next !== undefined) {
|
|
2413
|
-
serializedNames += ' ' + next.name;
|
|
2414
|
-
next = next.next;
|
|
2415
|
-
}
|
|
2416
|
-
|
|
2417
|
-
return /*#__PURE__*/React.createElement("style", (_ref2 = {}, _ref2["data-emotion"] = cache.key + " " + serializedNames, _ref2.dangerouslySetInnerHTML = {
|
|
2418
|
-
__html: rules
|
|
2419
|
-
}, _ref2.nonce = cache.sheet.nonce, _ref2));
|
|
2420
|
-
}
|
|
2421
|
-
|
|
2422
|
-
return null;
|
|
2423
|
-
};
|
|
2424
|
-
|
|
2425
|
-
var Emotion = /* #__PURE__ */withEmotionCache(function (props, cache, ref) {
|
|
2426
|
-
var cssProp = props.css; // so that using `css` from `emotion` and passing the result to the css prop works
|
|
2427
|
-
// not passing the registered cache to serializeStyles because it would
|
|
2428
|
-
// make certain babel optimisations not possible
|
|
2429
|
-
|
|
2430
|
-
if (typeof cssProp === 'string' && cache.registered[cssProp] !== undefined) {
|
|
2431
|
-
cssProp = cache.registered[cssProp];
|
|
2432
|
-
}
|
|
2433
|
-
|
|
2434
|
-
var WrappedComponent = props[typePropName];
|
|
2435
|
-
var registeredStyles = [cssProp];
|
|
2436
|
-
var className = '';
|
|
2437
|
-
|
|
2438
|
-
if (typeof props.className === 'string') {
|
|
2439
|
-
className = getRegisteredStyles(cache.registered, registeredStyles, props.className);
|
|
2440
|
-
} else if (props.className != null) {
|
|
2441
|
-
className = props.className + " ";
|
|
2442
|
-
}
|
|
2443
|
-
|
|
2444
|
-
var serialized = serializeStyles(registeredStyles, undefined, React.useContext(ThemeContext$2));
|
|
2445
|
-
|
|
2446
|
-
if (process.env.NODE_ENV !== 'production' && serialized.name.indexOf('-') === -1) {
|
|
2447
|
-
var labelFromStack = props[labelPropName];
|
|
2448
|
-
|
|
2449
|
-
if (labelFromStack) {
|
|
2450
|
-
serialized = serializeStyles([serialized, 'label:' + labelFromStack + ';']);
|
|
2451
|
-
}
|
|
2452
|
-
}
|
|
2453
|
-
|
|
2454
|
-
className += cache.key + "-" + serialized.name;
|
|
2455
|
-
var newProps = {};
|
|
2456
|
-
|
|
2457
|
-
for (var key in props) {
|
|
2458
|
-
if (hasOwnProperty$1.call(props, key) && key !== 'css' && key !== typePropName && (process.env.NODE_ENV === 'production' || key !== labelPropName)) {
|
|
2459
|
-
newProps[key] = props[key];
|
|
2460
|
-
}
|
|
2461
|
-
}
|
|
2462
|
-
|
|
2463
|
-
newProps.ref = ref;
|
|
2464
|
-
newProps.className = className;
|
|
2465
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Insertion$2, {
|
|
2466
|
-
cache: cache,
|
|
2467
|
-
serialized: serialized,
|
|
2468
|
-
isStringTag: typeof WrappedComponent === 'string'
|
|
2469
|
-
}), /*#__PURE__*/React.createElement(WrappedComponent, newProps));
|
|
2470
|
-
});
|
|
2471
|
-
|
|
2472
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
2473
|
-
Emotion.displayName = 'EmotionCssPropInternal';
|
|
2474
|
-
}
|
|
2475
|
-
|
|
2476
|
-
var pkg = {
|
|
2477
|
-
name: "@emotion/react",
|
|
2478
|
-
version: "11.10.4",
|
|
2479
|
-
main: "dist/emotion-react.cjs.js",
|
|
2480
|
-
module: "dist/emotion-react.esm.js",
|
|
2481
|
-
browser: {
|
|
2482
|
-
"./dist/emotion-react.esm.js": "./dist/emotion-react.browser.esm.js"
|
|
2483
|
-
},
|
|
2484
|
-
exports: {
|
|
2485
|
-
".": {
|
|
2486
|
-
module: {
|
|
2487
|
-
worker: "./dist/emotion-react.worker.esm.js",
|
|
2488
|
-
browser: "./dist/emotion-react.browser.esm.js",
|
|
2489
|
-
"default": "./dist/emotion-react.esm.js"
|
|
2490
|
-
},
|
|
2491
|
-
"default": "./dist/emotion-react.cjs.js"
|
|
2492
|
-
},
|
|
2493
|
-
"./jsx-runtime": {
|
|
2494
|
-
module: {
|
|
2495
|
-
worker: "./jsx-runtime/dist/emotion-react-jsx-runtime.worker.esm.js",
|
|
2496
|
-
browser: "./jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js",
|
|
2497
|
-
"default": "./jsx-runtime/dist/emotion-react-jsx-runtime.esm.js"
|
|
2498
|
-
},
|
|
2499
|
-
"default": "./jsx-runtime/dist/emotion-react-jsx-runtime.cjs.js"
|
|
2500
|
-
},
|
|
2501
|
-
"./_isolated-hnrs": {
|
|
2502
|
-
module: {
|
|
2503
|
-
worker: "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.worker.esm.js",
|
|
2504
|
-
browser: "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.browser.esm.js",
|
|
2505
|
-
"default": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.esm.js"
|
|
2506
|
-
},
|
|
2507
|
-
"default": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.cjs.js"
|
|
2508
|
-
},
|
|
2509
|
-
"./jsx-dev-runtime": {
|
|
2510
|
-
module: {
|
|
2511
|
-
worker: "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.worker.esm.js",
|
|
2512
|
-
browser: "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.browser.esm.js",
|
|
2513
|
-
"default": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.esm.js"
|
|
2514
|
-
},
|
|
2515
|
-
"default": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.cjs.js"
|
|
2516
|
-
},
|
|
2517
|
-
"./package.json": "./package.json",
|
|
2518
|
-
"./types/css-prop": "./types/css-prop.d.ts",
|
|
2519
|
-
"./macro": "./macro.js"
|
|
2520
|
-
},
|
|
2521
|
-
types: "types/index.d.ts",
|
|
2522
|
-
files: [
|
|
2523
|
-
"src",
|
|
2524
|
-
"dist",
|
|
2525
|
-
"jsx-runtime",
|
|
2526
|
-
"jsx-dev-runtime",
|
|
2527
|
-
"_isolated-hnrs",
|
|
2528
|
-
"types/*.d.ts",
|
|
2529
|
-
"macro.js",
|
|
2530
|
-
"macro.d.ts",
|
|
2531
|
-
"macro.js.flow"
|
|
2532
|
-
],
|
|
2533
|
-
sideEffects: false,
|
|
2534
|
-
author: "Emotion Contributors",
|
|
2535
|
-
license: "MIT",
|
|
2536
|
-
scripts: {
|
|
2537
|
-
"test:typescript": "dtslint types"
|
|
2538
|
-
},
|
|
2539
|
-
dependencies: {
|
|
2540
|
-
"@babel/runtime": "^7.18.3",
|
|
2541
|
-
"@emotion/babel-plugin": "^11.10.0",
|
|
2542
|
-
"@emotion/cache": "^11.10.0",
|
|
2543
|
-
"@emotion/serialize": "^1.1.0",
|
|
2544
|
-
"@emotion/use-insertion-effect-with-fallbacks": "^1.0.0",
|
|
2545
|
-
"@emotion/utils": "^1.2.0",
|
|
2546
|
-
"@emotion/weak-memoize": "^0.3.0",
|
|
2547
|
-
"hoist-non-react-statics": "^3.3.1"
|
|
2548
|
-
},
|
|
2549
|
-
peerDependencies: {
|
|
2550
|
-
"@babel/core": "^7.0.0",
|
|
2551
|
-
react: ">=16.8.0"
|
|
2552
|
-
},
|
|
2553
|
-
peerDependenciesMeta: {
|
|
2554
|
-
"@babel/core": {
|
|
2555
|
-
optional: true
|
|
2556
|
-
},
|
|
2557
|
-
"@types/react": {
|
|
2558
|
-
optional: true
|
|
2559
|
-
}
|
|
2560
|
-
},
|
|
2561
|
-
devDependencies: {
|
|
2562
|
-
"@babel/core": "^7.18.5",
|
|
2563
|
-
"@definitelytyped/dtslint": "0.0.112",
|
|
2564
|
-
"@emotion/css": "11.10.0",
|
|
2565
|
-
"@emotion/css-prettifier": "1.1.0",
|
|
2566
|
-
"@emotion/server": "11.10.0",
|
|
2567
|
-
"@emotion/styled": "11.10.4",
|
|
2568
|
-
"html-tag-names": "^1.1.2",
|
|
2569
|
-
react: "16.14.0",
|
|
2570
|
-
"svg-tag-names": "^1.1.1",
|
|
2571
|
-
typescript: "^4.5.5"
|
|
2572
|
-
},
|
|
2573
|
-
repository: "https://github.com/emotion-js/emotion/tree/main/packages/react",
|
|
2574
|
-
publishConfig: {
|
|
2575
|
-
access: "public"
|
|
2576
|
-
},
|
|
2577
|
-
"umd:main": "dist/emotion-react.umd.min.js",
|
|
2578
|
-
preconstruct: {
|
|
2579
|
-
entrypoints: [
|
|
2580
|
-
"./index.js",
|
|
2581
|
-
"./jsx-runtime.js",
|
|
2582
|
-
"./jsx-dev-runtime.js",
|
|
2583
|
-
"./_isolated-hnrs.js"
|
|
2584
|
-
],
|
|
2585
|
-
umdName: "emotionReact",
|
|
2586
|
-
exports: {
|
|
2587
|
-
envConditions: [
|
|
2588
|
-
"browser",
|
|
2589
|
-
"worker"
|
|
2590
|
-
],
|
|
2591
|
-
extra: {
|
|
2592
|
-
"./types/css-prop": "./types/css-prop.d.ts",
|
|
2593
|
-
"./macro": "./macro.js"
|
|
2594
|
-
}
|
|
2595
|
-
}
|
|
2596
|
-
}
|
|
2597
|
-
};
|
|
2598
|
-
|
|
2599
|
-
var warnedAboutCssPropForGlobal = false; // maintain place over rerenders.
|
|
2600
|
-
// initial render from browser, insertBefore context.sheet.tags[0] or if a style hasn't been inserted there yet, appendChild
|
|
2601
|
-
// initial client-side render from SSR, use place of hydrating tag
|
|
2602
|
-
|
|
2603
|
-
var Global = /* #__PURE__ */withEmotionCache(function (props, cache) {
|
|
2604
|
-
if (process.env.NODE_ENV !== 'production' && !warnedAboutCssPropForGlobal && ( // check for className as well since the user is
|
|
2605
|
-
// probably using the custom createElement which
|
|
2606
|
-
// means it will be turned into a className prop
|
|
2607
|
-
// $FlowFixMe I don't really want to add it to the type since it shouldn't be used
|
|
2608
|
-
props.className || props.css)) {
|
|
2609
|
-
console.error("It looks like you're using the css prop on Global, did you mean to use the styles prop instead?");
|
|
2610
|
-
warnedAboutCssPropForGlobal = true;
|
|
2611
|
-
}
|
|
2612
|
-
|
|
2613
|
-
var styles = props.styles;
|
|
2614
|
-
var serialized = serializeStyles([styles], undefined, React.useContext(ThemeContext$2));
|
|
2615
|
-
|
|
2616
|
-
if (!isBrowser$2) {
|
|
2617
|
-
var _ref;
|
|
2618
|
-
|
|
2619
|
-
var serializedNames = serialized.name;
|
|
2620
|
-
var serializedStyles = serialized.styles;
|
|
2621
|
-
var next = serialized.next;
|
|
2622
|
-
|
|
2623
|
-
while (next !== undefined) {
|
|
2624
|
-
serializedNames += ' ' + next.name;
|
|
2625
|
-
serializedStyles += next.styles;
|
|
2626
|
-
next = next.next;
|
|
2627
|
-
}
|
|
2628
|
-
|
|
2629
|
-
var shouldCache = cache.compat === true;
|
|
2630
|
-
var rules = cache.insert("", {
|
|
2631
|
-
name: serializedNames,
|
|
2632
|
-
styles: serializedStyles
|
|
2633
|
-
}, cache.sheet, shouldCache);
|
|
2634
|
-
|
|
2635
|
-
if (shouldCache) {
|
|
2636
|
-
return null;
|
|
2637
|
-
}
|
|
2638
|
-
|
|
2639
|
-
return /*#__PURE__*/React.createElement("style", (_ref = {}, _ref["data-emotion"] = cache.key + "-global " + serializedNames, _ref.dangerouslySetInnerHTML = {
|
|
2640
|
-
__html: rules
|
|
2641
|
-
}, _ref.nonce = cache.sheet.nonce, _ref));
|
|
2642
|
-
} // yes, i know these hooks are used conditionally
|
|
2643
|
-
// but it is based on a constant that will never change at runtime
|
|
2644
|
-
// it's effectively like having two implementations and switching them out
|
|
2645
|
-
// so it's not actually breaking anything
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
var sheetRef = React.useRef();
|
|
2649
|
-
useInsertionEffectWithLayoutFallback(function () {
|
|
2650
|
-
var key = cache.key + "-global"; // use case of https://github.com/emotion-js/emotion/issues/2675
|
|
2651
|
-
|
|
2652
|
-
var sheet = new cache.sheet.constructor({
|
|
2653
|
-
key: key,
|
|
2654
|
-
nonce: cache.sheet.nonce,
|
|
2655
|
-
container: cache.sheet.container,
|
|
2656
|
-
speedy: cache.sheet.isSpeedy
|
|
2657
|
-
});
|
|
2658
|
-
var rehydrating = false; // $FlowFixMe
|
|
2659
|
-
|
|
2660
|
-
var node = document.querySelector("style[data-emotion=\"" + key + " " + serialized.name + "\"]");
|
|
2661
|
-
|
|
2662
|
-
if (cache.sheet.tags.length) {
|
|
2663
|
-
sheet.before = cache.sheet.tags[0];
|
|
2664
|
-
}
|
|
2665
|
-
|
|
2666
|
-
if (node !== null) {
|
|
2667
|
-
rehydrating = true; // clear the hash so this node won't be recognizable as rehydratable by other <Global/>s
|
|
2668
|
-
|
|
2669
|
-
node.setAttribute('data-emotion', key);
|
|
2670
|
-
sheet.hydrate([node]);
|
|
2671
|
-
}
|
|
2672
|
-
|
|
2673
|
-
sheetRef.current = [sheet, rehydrating];
|
|
2674
|
-
return function () {
|
|
2675
|
-
sheet.flush();
|
|
2676
|
-
};
|
|
2677
|
-
}, [cache]);
|
|
2678
|
-
useInsertionEffectWithLayoutFallback(function () {
|
|
2679
|
-
var sheetRefCurrent = sheetRef.current;
|
|
2680
|
-
var sheet = sheetRefCurrent[0],
|
|
2681
|
-
rehydrating = sheetRefCurrent[1];
|
|
2682
|
-
|
|
2683
|
-
if (rehydrating) {
|
|
2684
|
-
sheetRefCurrent[1] = false;
|
|
2685
|
-
return;
|
|
2686
|
-
}
|
|
2687
|
-
|
|
2688
|
-
if (serialized.next !== undefined) {
|
|
2689
|
-
// insert keyframes
|
|
2690
|
-
insertStyles(cache, serialized.next, true);
|
|
2691
|
-
}
|
|
2692
|
-
|
|
2693
|
-
if (sheet.tags.length) {
|
|
2694
|
-
// if this doesn't exist then it will be null so the style element will be appended
|
|
2695
|
-
var element = sheet.tags[sheet.tags.length - 1].nextElementSibling;
|
|
2696
|
-
sheet.before = element;
|
|
2697
|
-
sheet.flush();
|
|
2698
|
-
}
|
|
2699
|
-
|
|
2700
|
-
cache.insert("", serialized, sheet, false);
|
|
2701
|
-
}, [cache, serialized.name]);
|
|
2702
|
-
return null;
|
|
2703
|
-
});
|
|
2704
|
-
|
|
2705
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
2706
|
-
Global.displayName = 'EmotionGlobal';
|
|
2707
|
-
}
|
|
2708
|
-
|
|
2709
|
-
function css() {
|
|
2710
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
2711
|
-
args[_key] = arguments[_key];
|
|
2712
|
-
}
|
|
2713
|
-
|
|
2714
|
-
return serializeStyles(args);
|
|
2715
|
-
}
|
|
2716
|
-
|
|
2717
|
-
var keyframes = function keyframes() {
|
|
2718
|
-
var insertable = css.apply(void 0, arguments);
|
|
2719
|
-
var name = "animation-" + insertable.name; // $FlowFixMe
|
|
2720
|
-
|
|
2721
|
-
return {
|
|
2722
|
-
name: name,
|
|
2723
|
-
styles: "@keyframes " + name + "{" + insertable.styles + "}",
|
|
2724
|
-
anim: 1,
|
|
2725
|
-
toString: function toString() {
|
|
2726
|
-
return "_EMO_" + this.name + "_" + this.styles + "_EMO_";
|
|
2727
|
-
}
|
|
2728
|
-
};
|
|
2729
|
-
};
|
|
2730
|
-
|
|
2731
|
-
var classnames = function classnames(args) {
|
|
2732
|
-
var len = args.length;
|
|
2733
|
-
var i = 0;
|
|
2734
|
-
var cls = '';
|
|
2735
|
-
|
|
2736
|
-
for (; i < len; i++) {
|
|
2737
|
-
var arg = args[i];
|
|
2738
|
-
if (arg == null) continue;
|
|
2739
|
-
var toAdd = void 0;
|
|
2740
|
-
|
|
2741
|
-
switch (typeof arg) {
|
|
2742
|
-
case 'boolean':
|
|
2743
|
-
break;
|
|
2744
|
-
|
|
2745
|
-
case 'object':
|
|
2746
|
-
{
|
|
2747
|
-
if (Array.isArray(arg)) {
|
|
2748
|
-
toAdd = classnames(arg);
|
|
2749
|
-
} else {
|
|
2750
|
-
if (process.env.NODE_ENV !== 'production' && arg.styles !== undefined && arg.name !== undefined) {
|
|
2751
|
-
console.error('You have passed styles created with `css` from `@emotion/react` package to the `cx`.\n' + '`cx` is meant to compose class names (strings) so you should convert those styles to a class name by passing them to the `css` received from <ClassNames/> component.');
|
|
2752
|
-
}
|
|
2753
|
-
|
|
2754
|
-
toAdd = '';
|
|
2755
|
-
|
|
2756
|
-
for (var k in arg) {
|
|
2757
|
-
if (arg[k] && k) {
|
|
2758
|
-
toAdd && (toAdd += ' ');
|
|
2759
|
-
toAdd += k;
|
|
2760
|
-
}
|
|
2761
|
-
}
|
|
2762
|
-
}
|
|
2763
|
-
|
|
2764
|
-
break;
|
|
2765
|
-
}
|
|
2766
|
-
|
|
2767
|
-
default:
|
|
2768
|
-
{
|
|
2769
|
-
toAdd = arg;
|
|
2770
|
-
}
|
|
2771
|
-
}
|
|
2772
|
-
|
|
2773
|
-
if (toAdd) {
|
|
2774
|
-
cls && (cls += ' ');
|
|
2775
|
-
cls += toAdd;
|
|
2776
|
-
}
|
|
2777
|
-
}
|
|
2778
|
-
|
|
2779
|
-
return cls;
|
|
2780
|
-
};
|
|
2781
|
-
|
|
2782
|
-
function merge$1(registered, css, className) {
|
|
2783
|
-
var registeredStyles = [];
|
|
2784
|
-
var rawClassName = getRegisteredStyles(registered, registeredStyles, className);
|
|
2785
|
-
|
|
2786
|
-
if (registeredStyles.length < 2) {
|
|
2787
|
-
return className;
|
|
2788
|
-
}
|
|
2789
|
-
|
|
2790
|
-
return rawClassName + css(registeredStyles);
|
|
2791
|
-
}
|
|
2792
|
-
|
|
2793
|
-
var Insertion$1 = function Insertion(_ref) {
|
|
2794
|
-
var cache = _ref.cache,
|
|
2795
|
-
serializedArr = _ref.serializedArr;
|
|
2796
|
-
var rules = useInsertionEffectAlwaysWithSyncFallback(function () {
|
|
2797
|
-
var rules = '';
|
|
2798
|
-
|
|
2799
|
-
for (var i = 0; i < serializedArr.length; i++) {
|
|
2800
|
-
var res = insertStyles(cache, serializedArr[i], false);
|
|
2801
|
-
|
|
2802
|
-
if (!isBrowser$2 && res !== undefined) {
|
|
2803
|
-
rules += res;
|
|
2804
|
-
}
|
|
2805
|
-
}
|
|
2806
|
-
|
|
2807
|
-
if (!isBrowser$2) {
|
|
2808
|
-
return rules;
|
|
2809
|
-
}
|
|
2810
|
-
});
|
|
2811
|
-
|
|
2812
|
-
if (!isBrowser$2 && rules.length !== 0) {
|
|
2813
|
-
var _ref2;
|
|
2814
|
-
|
|
2815
|
-
return /*#__PURE__*/React.createElement("style", (_ref2 = {}, _ref2["data-emotion"] = cache.key + " " + serializedArr.map(function (serialized) {
|
|
2816
|
-
return serialized.name;
|
|
2817
|
-
}).join(' '), _ref2.dangerouslySetInnerHTML = {
|
|
2818
|
-
__html: rules
|
|
2819
|
-
}, _ref2.nonce = cache.sheet.nonce, _ref2));
|
|
2820
|
-
}
|
|
2821
|
-
|
|
2822
|
-
return null;
|
|
2823
|
-
};
|
|
2824
|
-
|
|
2825
|
-
var ClassNames = /* #__PURE__ */withEmotionCache(function (props, cache) {
|
|
2826
|
-
var hasRendered = false;
|
|
2827
|
-
var serializedArr = [];
|
|
2828
|
-
|
|
2829
|
-
var css = function css() {
|
|
2830
|
-
if (hasRendered && process.env.NODE_ENV !== 'production') {
|
|
2831
|
-
throw new Error('css can only be used during render');
|
|
2832
|
-
}
|
|
2833
|
-
|
|
2834
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
2835
|
-
args[_key] = arguments[_key];
|
|
2836
|
-
}
|
|
2837
|
-
|
|
2838
|
-
var serialized = serializeStyles(args, cache.registered);
|
|
2839
|
-
serializedArr.push(serialized); // registration has to happen here as the result of this might get consumed by `cx`
|
|
2840
|
-
|
|
2841
|
-
registerStyles(cache, serialized, false);
|
|
2842
|
-
return cache.key + "-" + serialized.name;
|
|
2843
|
-
};
|
|
2844
|
-
|
|
2845
|
-
var cx = function cx() {
|
|
2846
|
-
if (hasRendered && process.env.NODE_ENV !== 'production') {
|
|
2847
|
-
throw new Error('cx can only be used during render');
|
|
2848
|
-
}
|
|
2849
|
-
|
|
2850
|
-
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
2851
|
-
args[_key2] = arguments[_key2];
|
|
2852
|
-
}
|
|
2853
|
-
|
|
2854
|
-
return merge$1(cache.registered, css, classnames(args));
|
|
2855
|
-
};
|
|
2856
|
-
|
|
2857
|
-
var content = {
|
|
2858
|
-
css: css,
|
|
2859
|
-
cx: cx,
|
|
2860
|
-
theme: React.useContext(ThemeContext$2)
|
|
2861
|
-
};
|
|
2862
|
-
var ele = props.children(content);
|
|
2863
|
-
hasRendered = true;
|
|
2864
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Insertion$1, {
|
|
2865
|
-
cache: cache,
|
|
2866
|
-
serializedArr: serializedArr
|
|
2867
|
-
}), ele);
|
|
2868
|
-
});
|
|
2869
|
-
|
|
2870
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
2871
|
-
ClassNames.displayName = 'EmotionClassNames';
|
|
2872
|
-
}
|
|
2873
|
-
|
|
2874
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
2875
|
-
var isBrowser$1 = typeof document !== 'undefined'; // #1727 for some reason Jest evaluates modules twice if some consuming module gets mocked with jest.mock
|
|
2876
|
-
|
|
2877
|
-
var isJest = typeof jest !== 'undefined';
|
|
2878
|
-
|
|
2879
|
-
if (isBrowser$1 && !isJest) {
|
|
2880
|
-
// globalThis has wide browser support - https://caniuse.com/?search=globalThis, Node.js 12 and later
|
|
2881
|
-
var globalContext = // $FlowIgnore
|
|
2882
|
-
typeof globalThis !== 'undefined' ? globalThis // eslint-disable-line no-undef
|
|
2883
|
-
: isBrowser$1 ? window : global;
|
|
2884
|
-
var globalKey = "__EMOTION_REACT_" + pkg.version.split('.')[0] + "__";
|
|
2885
|
-
|
|
2886
|
-
if (globalContext[globalKey]) {
|
|
2887
|
-
console.warn('You are loading @emotion/react when it is already loaded. Running ' + 'multiple instances may cause problems. This can happen if multiple ' + 'versions are used, or if multiple builds of the same version are ' + 'used.');
|
|
2888
|
-
}
|
|
2889
|
-
|
|
2890
|
-
globalContext[globalKey] = true;
|
|
2891
|
-
}
|
|
2892
|
-
}
|
|
2893
|
-
|
|
2894
|
-
var testOmitPropsOnStringTag = isPropValid;
|
|
2895
|
-
|
|
2896
|
-
var testOmitPropsOnComponent = function testOmitPropsOnComponent(key) {
|
|
2897
|
-
return key !== 'theme';
|
|
2898
|
-
};
|
|
2899
|
-
|
|
2900
|
-
var getDefaultShouldForwardProp = function getDefaultShouldForwardProp(tag) {
|
|
2901
|
-
return typeof tag === 'string' && // 96 is one less than the char code
|
|
2902
|
-
// for "a" so this is checking that
|
|
2903
|
-
// it's a lowercase character
|
|
2904
|
-
tag.charCodeAt(0) > 96 ? testOmitPropsOnStringTag : testOmitPropsOnComponent;
|
|
2905
|
-
};
|
|
2906
|
-
var composeShouldForwardProps = function composeShouldForwardProps(tag, options, isReal) {
|
|
2907
|
-
var shouldForwardProp;
|
|
2908
|
-
|
|
2909
|
-
if (options) {
|
|
2910
|
-
var optionsShouldForwardProp = options.shouldForwardProp;
|
|
2911
|
-
shouldForwardProp = tag.__emotion_forwardProp && optionsShouldForwardProp ? function (propName) {
|
|
2912
|
-
return tag.__emotion_forwardProp(propName) && optionsShouldForwardProp(propName);
|
|
2913
|
-
} : optionsShouldForwardProp;
|
|
2914
|
-
}
|
|
2915
|
-
|
|
2916
|
-
if (typeof shouldForwardProp !== 'function' && isReal) {
|
|
2917
|
-
shouldForwardProp = tag.__emotion_forwardProp;
|
|
2918
|
-
}
|
|
2919
|
-
|
|
2920
|
-
return shouldForwardProp;
|
|
2921
|
-
};
|
|
2922
|
-
|
|
2923
|
-
var ILLEGAL_ESCAPE_SEQUENCE_ERROR = "You have illegal escape sequence in your template literal, most likely inside content's property value.\nBecause you write your CSS inside a JavaScript string you actually have to do double escaping, so for example \"content: '\\00d7';\" should become \"content: '\\\\00d7';\".\nYou can read more about this here:\nhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences";
|
|
2924
|
-
var isBrowser = typeof document !== 'undefined';
|
|
2925
|
-
|
|
2926
|
-
var Insertion = function Insertion(_ref) {
|
|
2927
|
-
var cache = _ref.cache,
|
|
2928
|
-
serialized = _ref.serialized,
|
|
2929
|
-
isStringTag = _ref.isStringTag;
|
|
2930
|
-
registerStyles(cache, serialized, isStringTag);
|
|
2931
|
-
var rules = useInsertionEffectAlwaysWithSyncFallback(function () {
|
|
2932
|
-
return insertStyles(cache, serialized, isStringTag);
|
|
2933
|
-
});
|
|
2934
|
-
|
|
2935
|
-
if (!isBrowser && rules !== undefined) {
|
|
2936
|
-
var _ref2;
|
|
2937
|
-
|
|
2938
|
-
var serializedNames = serialized.name;
|
|
2939
|
-
var next = serialized.next;
|
|
2940
|
-
|
|
2941
|
-
while (next !== undefined) {
|
|
2942
|
-
serializedNames += ' ' + next.name;
|
|
2943
|
-
next = next.next;
|
|
2944
|
-
}
|
|
2945
|
-
|
|
2946
|
-
return /*#__PURE__*/React.createElement("style", (_ref2 = {}, _ref2["data-emotion"] = cache.key + " " + serializedNames, _ref2.dangerouslySetInnerHTML = {
|
|
2947
|
-
__html: rules
|
|
2948
|
-
}, _ref2.nonce = cache.sheet.nonce, _ref2));
|
|
2949
|
-
}
|
|
2950
|
-
|
|
2951
|
-
return null;
|
|
2952
|
-
};
|
|
2953
|
-
|
|
2954
|
-
var createStyled$1 = function createStyled(tag, options) {
|
|
2955
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
2956
|
-
if (tag === undefined) {
|
|
2957
|
-
throw new Error('You are trying to create a styled element with an undefined component.\nYou may have forgotten to import it.');
|
|
2958
|
-
}
|
|
2959
|
-
}
|
|
2960
|
-
|
|
2961
|
-
var isReal = tag.__emotion_real === tag;
|
|
2962
|
-
var baseTag = isReal && tag.__emotion_base || tag;
|
|
2963
|
-
var identifierName;
|
|
2964
|
-
var targetClassName;
|
|
2965
|
-
|
|
2966
|
-
if (options !== undefined) {
|
|
2967
|
-
identifierName = options.label;
|
|
2968
|
-
targetClassName = options.target;
|
|
2969
|
-
}
|
|
2970
|
-
|
|
2971
|
-
var shouldForwardProp = composeShouldForwardProps(tag, options, isReal);
|
|
2972
|
-
var defaultShouldForwardProp = shouldForwardProp || getDefaultShouldForwardProp(baseTag);
|
|
2973
|
-
var shouldUseAs = !defaultShouldForwardProp('as');
|
|
2974
|
-
return function () {
|
|
2975
|
-
var args = arguments;
|
|
2976
|
-
var styles = isReal && tag.__emotion_styles !== undefined ? tag.__emotion_styles.slice(0) : [];
|
|
2977
|
-
|
|
2978
|
-
if (identifierName !== undefined) {
|
|
2979
|
-
styles.push("label:" + identifierName + ";");
|
|
2980
|
-
}
|
|
2981
|
-
|
|
2982
|
-
if (args[0] == null || args[0].raw === undefined) {
|
|
2983
|
-
styles.push.apply(styles, args);
|
|
2984
|
-
} else {
|
|
2985
|
-
if (process.env.NODE_ENV !== 'production' && args[0][0] === undefined) {
|
|
2986
|
-
console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR);
|
|
2987
|
-
}
|
|
2988
|
-
|
|
2989
|
-
styles.push(args[0][0]);
|
|
2990
|
-
var len = args.length;
|
|
2991
|
-
var i = 1;
|
|
2992
|
-
|
|
2993
|
-
for (; i < len; i++) {
|
|
2994
|
-
if (process.env.NODE_ENV !== 'production' && args[0][i] === undefined) {
|
|
2995
|
-
console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR);
|
|
2996
|
-
}
|
|
2997
|
-
|
|
2998
|
-
styles.push(args[i], args[0][i]);
|
|
2999
|
-
}
|
|
3000
|
-
} // $FlowFixMe: we need to cast StatelessFunctionalComponent to our PrivateStyledComponent class
|
|
3001
|
-
|
|
3002
|
-
|
|
3003
|
-
var Styled = withEmotionCache(function (props, cache, ref) {
|
|
3004
|
-
var FinalTag = shouldUseAs && props.as || baseTag;
|
|
3005
|
-
var className = '';
|
|
3006
|
-
var classInterpolations = [];
|
|
3007
|
-
var mergedProps = props;
|
|
3008
|
-
|
|
3009
|
-
if (props.theme == null) {
|
|
3010
|
-
mergedProps = {};
|
|
3011
|
-
|
|
3012
|
-
for (var key in props) {
|
|
3013
|
-
mergedProps[key] = props[key];
|
|
3014
|
-
}
|
|
3015
|
-
|
|
3016
|
-
mergedProps.theme = React.useContext(ThemeContext$2);
|
|
3017
|
-
}
|
|
3018
|
-
|
|
3019
|
-
if (typeof props.className === 'string') {
|
|
3020
|
-
className = getRegisteredStyles(cache.registered, classInterpolations, props.className);
|
|
3021
|
-
} else if (props.className != null) {
|
|
3022
|
-
className = props.className + " ";
|
|
3023
|
-
}
|
|
3024
|
-
|
|
3025
|
-
var serialized = serializeStyles(styles.concat(classInterpolations), cache.registered, mergedProps);
|
|
3026
|
-
className += cache.key + "-" + serialized.name;
|
|
3027
|
-
|
|
3028
|
-
if (targetClassName !== undefined) {
|
|
3029
|
-
className += " " + targetClassName;
|
|
3030
|
-
}
|
|
3031
|
-
|
|
3032
|
-
var finalShouldForwardProp = shouldUseAs && shouldForwardProp === undefined ? getDefaultShouldForwardProp(FinalTag) : defaultShouldForwardProp;
|
|
3033
|
-
var newProps = {};
|
|
3034
|
-
|
|
3035
|
-
for (var _key in props) {
|
|
3036
|
-
if (shouldUseAs && _key === 'as') continue;
|
|
3037
|
-
|
|
3038
|
-
if ( // $FlowFixMe
|
|
3039
|
-
finalShouldForwardProp(_key)) {
|
|
3040
|
-
newProps[_key] = props[_key];
|
|
3041
|
-
}
|
|
3042
|
-
}
|
|
3043
|
-
|
|
3044
|
-
newProps.className = className;
|
|
3045
|
-
newProps.ref = ref;
|
|
3046
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Insertion, {
|
|
3047
|
-
cache: cache,
|
|
3048
|
-
serialized: serialized,
|
|
3049
|
-
isStringTag: typeof FinalTag === 'string'
|
|
3050
|
-
}), /*#__PURE__*/React.createElement(FinalTag, newProps));
|
|
3051
|
-
});
|
|
3052
|
-
Styled.displayName = identifierName !== undefined ? identifierName : "Styled(" + (typeof baseTag === 'string' ? baseTag : baseTag.displayName || baseTag.name || 'Component') + ")";
|
|
3053
|
-
Styled.defaultProps = tag.defaultProps;
|
|
3054
|
-
Styled.__emotion_real = Styled;
|
|
3055
|
-
Styled.__emotion_base = baseTag;
|
|
3056
|
-
Styled.__emotion_styles = styles;
|
|
3057
|
-
Styled.__emotion_forwardProp = shouldForwardProp;
|
|
3058
|
-
Object.defineProperty(Styled, 'toString', {
|
|
3059
|
-
value: function value() {
|
|
3060
|
-
if (targetClassName === undefined && process.env.NODE_ENV !== 'production') {
|
|
3061
|
-
return 'NO_COMPONENT_SELECTOR';
|
|
3062
|
-
} // $FlowFixMe: coerce undefined to string
|
|
3063
|
-
|
|
3064
|
-
|
|
3065
|
-
return "." + targetClassName;
|
|
3066
|
-
}
|
|
3067
|
-
});
|
|
3068
|
-
|
|
3069
|
-
Styled.withComponent = function (nextTag, nextOptions) {
|
|
3070
|
-
return createStyled(nextTag, _extends({}, options, nextOptions, {
|
|
3071
|
-
shouldForwardProp: composeShouldForwardProps(Styled, nextOptions, true)
|
|
3072
|
-
})).apply(void 0, styles);
|
|
3073
|
-
};
|
|
3074
|
-
|
|
3075
|
-
return Styled;
|
|
3076
|
-
};
|
|
3077
|
-
};
|
|
3078
|
-
|
|
3079
|
-
var tags = ['a', 'abbr', 'address', 'area', 'article', 'aside', 'audio', 'b', 'base', 'bdi', 'bdo', 'big', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'cite', 'code', 'col', 'colgroup', 'data', 'datalist', 'dd', 'del', 'details', 'dfn', 'dialog', 'div', 'dl', 'dt', 'em', 'embed', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'iframe', 'img', 'input', 'ins', 'kbd', 'keygen', 'label', 'legend', 'li', 'link', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meta', 'meter', 'nav', 'noscript', 'object', 'ol', 'optgroup', 'option', 'output', 'p', 'param', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'script', 'section', 'select', 'small', 'source', 'span', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'textarea', 'tfoot', 'th', 'thead', 'time', 'title', 'tr', 'track', 'u', 'ul', 'var', 'video', 'wbr', // SVG
|
|
3080
|
-
'circle', 'clipPath', 'defs', 'ellipse', 'foreignObject', 'g', 'image', 'line', 'linearGradient', 'mask', 'path', 'pattern', 'polygon', 'polyline', 'radialGradient', 'rect', 'stop', 'svg', 'text', 'tspan'];
|
|
3081
|
-
|
|
3082
|
-
var newStyled = createStyled$1.bind();
|
|
3083
|
-
tags.forEach(function (tagName) {
|
|
3084
|
-
// $FlowFixMe: we can ignore this because its exposed type is defined by the CreateStyled type
|
|
3085
|
-
newStyled[tagName] = newStyled(tagName);
|
|
3086
|
-
});
|
|
3087
|
-
|
|
3088
|
-
var emStyled = newStyled;
|
|
3089
|
-
|
|
3090
|
-
var propTypes = {exports: {}};
|
|
3091
|
-
|
|
3092
444
|
/*
|
|
3093
445
|
object-assign
|
|
3094
446
|
(c) Sindre Sorhus
|
|
@@ -3300,7 +652,7 @@ var checkPropTypes_1 = checkPropTypes$1;
|
|
|
3300
652
|
* LICENSE file in the root directory of this source tree.
|
|
3301
653
|
*/
|
|
3302
654
|
|
|
3303
|
-
var ReactIs$1 = reactIs$
|
|
655
|
+
var ReactIs$1 = reactIs$1.exports;
|
|
3304
656
|
var assign = objectAssign;
|
|
3305
657
|
|
|
3306
658
|
var ReactPropTypesSecret$1 = ReactPropTypesSecret_1;
|
|
@@ -3972,7 +1324,7 @@ var factoryWithThrowingShims = function() {
|
|
|
3972
1324
|
*/
|
|
3973
1325
|
|
|
3974
1326
|
if (process.env.NODE_ENV !== 'production') {
|
|
3975
|
-
var ReactIs = reactIs$
|
|
1327
|
+
var ReactIs = reactIs$1.exports;
|
|
3976
1328
|
|
|
3977
1329
|
// By explicitly using `prop-types` you are opting into new development behavior.
|
|
3978
1330
|
// http://fb.me/prop-types-in-prod
|
|
@@ -3996,7 +1348,7 @@ function GlobalStyles$1(props) {
|
|
|
3996
1348
|
defaultTheme = {}
|
|
3997
1349
|
} = props;
|
|
3998
1350
|
const globalStyles = typeof styles === 'function' ? themeInput => styles(isEmpty$4(themeInput) ? defaultTheme : themeInput) : styles;
|
|
3999
|
-
return /*#__PURE__*/jsxRuntime.jsx(Global, {
|
|
1351
|
+
return /*#__PURE__*/jsxRuntime.jsx(react.Global, {
|
|
4000
1352
|
styles: globalStyles
|
|
4001
1353
|
});
|
|
4002
1354
|
}
|
|
@@ -4011,7 +1363,7 @@ process.env.NODE_ENV !== "production" ? GlobalStyles$1.propTypes = {
|
|
|
4011
1363
|
* LICENSE file in the root directory of this source tree.
|
|
4012
1364
|
*/
|
|
4013
1365
|
function styled$2(tag, options) {
|
|
4014
|
-
const stylesFactory =
|
|
1366
|
+
const stylesFactory = emStyled__default["default"](tag, options);
|
|
4015
1367
|
|
|
4016
1368
|
if (process.env.NODE_ENV !== 'production') {
|
|
4017
1369
|
return (...styles) => {
|
|
@@ -6136,6 +3488,75 @@ function useTheme$3() {
|
|
|
6136
3488
|
return theme;
|
|
6137
3489
|
}
|
|
6138
3490
|
|
|
3491
|
+
const hasSymbol = typeof Symbol === 'function' && Symbol.for;
|
|
3492
|
+
var nested = hasSymbol ? Symbol.for('mui.nested') : '__THEME_NESTED__';
|
|
3493
|
+
|
|
3494
|
+
function mergeOuterLocalTheme(outerTheme, localTheme) {
|
|
3495
|
+
if (typeof localTheme === 'function') {
|
|
3496
|
+
const mergedTheme = localTheme(outerTheme);
|
|
3497
|
+
|
|
3498
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
3499
|
+
if (!mergedTheme) {
|
|
3500
|
+
console.error(['MUI: You should return an object from your theme function, i.e.', '<ThemeProvider theme={() => ({})} />'].join('\n'));
|
|
3501
|
+
}
|
|
3502
|
+
}
|
|
3503
|
+
|
|
3504
|
+
return mergedTheme;
|
|
3505
|
+
}
|
|
3506
|
+
|
|
3507
|
+
return _extends({}, outerTheme, localTheme);
|
|
3508
|
+
}
|
|
3509
|
+
/**
|
|
3510
|
+
* This component takes a `theme` prop.
|
|
3511
|
+
* It makes the `theme` available down the React tree thanks to React context.
|
|
3512
|
+
* This component should preferably be used at **the root of your component tree**.
|
|
3513
|
+
*/
|
|
3514
|
+
|
|
3515
|
+
|
|
3516
|
+
function ThemeProvider$1(props) {
|
|
3517
|
+
const {
|
|
3518
|
+
children,
|
|
3519
|
+
theme: localTheme
|
|
3520
|
+
} = props;
|
|
3521
|
+
const outerTheme = useTheme$3();
|
|
3522
|
+
|
|
3523
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
3524
|
+
if (outerTheme === null && typeof localTheme === 'function') {
|
|
3525
|
+
console.error(['MUI: You are providing a theme function prop to the ThemeProvider component:', '<ThemeProvider theme={outerTheme => outerTheme} />', '', 'However, no outer theme is present.', 'Make sure a theme is already injected higher in the React tree ' + 'or provide a theme object.'].join('\n'));
|
|
3526
|
+
}
|
|
3527
|
+
}
|
|
3528
|
+
|
|
3529
|
+
const theme = React__namespace.useMemo(() => {
|
|
3530
|
+
const output = outerTheme === null ? localTheme : mergeOuterLocalTheme(outerTheme, localTheme);
|
|
3531
|
+
|
|
3532
|
+
if (output != null) {
|
|
3533
|
+
output[nested] = outerTheme !== null;
|
|
3534
|
+
}
|
|
3535
|
+
|
|
3536
|
+
return output;
|
|
3537
|
+
}, [localTheme, outerTheme]);
|
|
3538
|
+
return /*#__PURE__*/jsxRuntime.jsx(ThemeContext$1.Provider, {
|
|
3539
|
+
value: theme,
|
|
3540
|
+
children: children
|
|
3541
|
+
});
|
|
3542
|
+
}
|
|
3543
|
+
|
|
3544
|
+
process.env.NODE_ENV !== "production" ? ThemeProvider$1.propTypes = {
|
|
3545
|
+
/**
|
|
3546
|
+
* Your component tree.
|
|
3547
|
+
*/
|
|
3548
|
+
children: PropTypes.node,
|
|
3549
|
+
|
|
3550
|
+
/**
|
|
3551
|
+
* A theme object. You can provide a function to extend the outer theme.
|
|
3552
|
+
*/
|
|
3553
|
+
theme: PropTypes.oneOfType([PropTypes.object, PropTypes.func]).isRequired
|
|
3554
|
+
} : void 0;
|
|
3555
|
+
|
|
3556
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
3557
|
+
process.env.NODE_ENV !== "production" ? ThemeProvider$1.propTypes = exactProp(ThemeProvider$1.propTypes) : void 0;
|
|
3558
|
+
}
|
|
3559
|
+
|
|
6139
3560
|
function isObjectEmpty(obj) {
|
|
6140
3561
|
return Object.keys(obj).length === 0;
|
|
6141
3562
|
}
|
|
@@ -6758,6 +4179,61 @@ function lighten(color, coefficient) {
|
|
|
6758
4179
|
return recomposeColor(color);
|
|
6759
4180
|
}
|
|
6760
4181
|
|
|
4182
|
+
function InnerThemeProvider(props) {
|
|
4183
|
+
const theme = useTheme$1();
|
|
4184
|
+
return /*#__PURE__*/jsxRuntime.jsx(react.ThemeContext.Provider, {
|
|
4185
|
+
value: typeof theme === 'object' ? theme : {},
|
|
4186
|
+
children: props.children
|
|
4187
|
+
});
|
|
4188
|
+
}
|
|
4189
|
+
|
|
4190
|
+
process.env.NODE_ENV !== "production" ? InnerThemeProvider.propTypes = {
|
|
4191
|
+
/**
|
|
4192
|
+
* Your component tree.
|
|
4193
|
+
*/
|
|
4194
|
+
children: PropTypes.node
|
|
4195
|
+
} : void 0;
|
|
4196
|
+
/**
|
|
4197
|
+
* This component makes the `theme` available down the React tree.
|
|
4198
|
+
* It should preferably be used at **the root of your component tree**.
|
|
4199
|
+
*/
|
|
4200
|
+
|
|
4201
|
+
function ThemeProvider(props) {
|
|
4202
|
+
const {
|
|
4203
|
+
children,
|
|
4204
|
+
theme: localTheme
|
|
4205
|
+
} = props;
|
|
4206
|
+
return /*#__PURE__*/jsxRuntime.jsx(ThemeProvider$1, {
|
|
4207
|
+
theme: localTheme,
|
|
4208
|
+
children: /*#__PURE__*/jsxRuntime.jsx(InnerThemeProvider, {
|
|
4209
|
+
children: children
|
|
4210
|
+
})
|
|
4211
|
+
});
|
|
4212
|
+
}
|
|
4213
|
+
|
|
4214
|
+
process.env.NODE_ENV !== "production" ? ThemeProvider.propTypes
|
|
4215
|
+
/* remove-proptypes */
|
|
4216
|
+
= {
|
|
4217
|
+
// ----------------------------- Warning --------------------------------
|
|
4218
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
4219
|
+
// | To update them edit the d.ts file and run "yarn proptypes" |
|
|
4220
|
+
// ----------------------------------------------------------------------
|
|
4221
|
+
|
|
4222
|
+
/**
|
|
4223
|
+
* Your component tree.
|
|
4224
|
+
*/
|
|
4225
|
+
children: PropTypes.node,
|
|
4226
|
+
|
|
4227
|
+
/**
|
|
4228
|
+
* A theme object. You can provide a function to extend the outer theme.
|
|
4229
|
+
*/
|
|
4230
|
+
theme: PropTypes.oneOfType([PropTypes.func, PropTypes.object]).isRequired
|
|
4231
|
+
} : void 0;
|
|
4232
|
+
|
|
4233
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
4234
|
+
process.env.NODE_ENV !== "production" ? ThemeProvider.propTypes = exactProp(ThemeProvider.propTypes) : void 0;
|
|
4235
|
+
}
|
|
4236
|
+
|
|
6761
4237
|
/**
|
|
6762
4238
|
* Determines if a given element is a DOM element name (i.e. not a React component).
|
|
6763
4239
|
*/
|
|
@@ -42089,7 +39565,7 @@ let _ = t => t,
|
|
|
42089
39565
|
_t4;
|
|
42090
39566
|
const DURATION = 550;
|
|
42091
39567
|
const DELAY_RIPPLE = 80;
|
|
42092
|
-
const enterKeyframe = keyframes(_t || (_t = _`
|
|
39568
|
+
const enterKeyframe = react.keyframes(_t || (_t = _`
|
|
42093
39569
|
0% {
|
|
42094
39570
|
transform: scale(0);
|
|
42095
39571
|
opacity: 0.1;
|
|
@@ -42100,7 +39576,7 @@ const enterKeyframe = keyframes(_t || (_t = _`
|
|
|
42100
39576
|
opacity: 0.3;
|
|
42101
39577
|
}
|
|
42102
39578
|
`));
|
|
42103
|
-
const exitKeyframe = keyframes(_t2 || (_t2 = _`
|
|
39579
|
+
const exitKeyframe = react.keyframes(_t2 || (_t2 = _`
|
|
42104
39580
|
0% {
|
|
42105
39581
|
opacity: 1;
|
|
42106
39582
|
}
|
|
@@ -42109,7 +39585,7 @@ const exitKeyframe = keyframes(_t2 || (_t2 = _`
|
|
|
42109
39585
|
opacity: 0;
|
|
42110
39586
|
}
|
|
42111
39587
|
`));
|
|
42112
|
-
const pulsateKeyframe = keyframes(_t3 || (_t3 = _`
|
|
39588
|
+
const pulsateKeyframe = react.keyframes(_t3 || (_t3 = _`
|
|
42113
39589
|
0% {
|
|
42114
39590
|
transform: scale(1);
|
|
42115
39591
|
}
|