react-sync-board 0.5.6 → 0.6.0

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 CHANGED
@@ -7,6 +7,27 @@ var recoil = require('recoil');
7
7
 
8
8
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
9
9
 
10
+ function _interopNamespace(e) {
11
+ if (e && e.__esModule) return e;
12
+ var n = Object.create(null);
13
+ if (e) {
14
+ Object.keys(e).forEach(function (k) {
15
+ if (k !== 'default') {
16
+ var d = Object.getOwnPropertyDescriptor(e, k);
17
+ Object.defineProperty(n, k, d.get ? d : {
18
+ enumerable: true,
19
+ get: function () {
20
+ return e[k];
21
+ }
22
+ });
23
+ }
24
+ });
25
+ }
26
+ n['default'] = e;
27
+ return Object.freeze(n);
28
+ }
29
+
30
+ var React__namespace = /*#__PURE__*/_interopNamespace(React);
10
31
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
11
32
 
12
33
  function ownKeys(object, enumerableOnly) {
@@ -468,26 +489,17 @@ function _createForOfIteratorHelper(o, allowArrayLike) {
468
489
  };
469
490
  }
470
491
 
471
- // This file replaces `index.js` in bundlers like webpack or Rollup,
472
-
473
492
  var nanoid = function nanoid() {
474
493
  var size = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 21;
475
494
  var id = '';
476
- var bytes = crypto.getRandomValues(new Uint8Array(size)); // A compact alternative for `for (var i = 0; i < step; i++)`.
495
+ var bytes = crypto.getRandomValues(new Uint8Array(size));
477
496
 
478
497
  while (size--) {
479
- // It is incorrect to use bytes exceeding the alphabet size.
480
- // The following mask reduces the random byte in the 0-255 value
481
- // range to the 0-63 value range. Therefore, adding hacks, such
482
- // as empty string fallback or magic numbers, is unneccessary because
483
- // the bitmask trims bytes down to the alphabet size.
484
498
  var _byte = bytes[size] & 63;
485
499
 
486
500
  if (_byte < 36) {
487
- // `0-9a-z`
488
501
  id += _byte.toString(36);
489
502
  } else if (_byte < 62) {
490
- // `A-Z`
491
503
  id += (_byte - 26).toString(36).toUpperCase();
492
504
  } else if (_byte < 63) {
493
505
  id += '_';
@@ -779,7 +791,7 @@ function memoize(fn) {
779
791
  };
780
792
  }
781
793
 
782
- var reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|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|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
794
+ 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
783
795
 
784
796
  var isPropValid = /* #__PURE__ */memoize(function (prop) {
785
797
  return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111
@@ -852,7 +864,13 @@ var StyleSheet = /*#__PURE__*/function () {
852
864
  var before;
853
865
 
854
866
  if (_this.tags.length === 0) {
855
- before = _this.prepend ? _this.container.firstChild : _this.before;
867
+ if (_this.insertionPoint) {
868
+ before = _this.insertionPoint.nextSibling;
869
+ } else if (_this.prepend) {
870
+ before = _this.container.firstChild;
871
+ } else {
872
+ before = _this.before;
873
+ }
856
874
  } else {
857
875
  before = _this.tags[_this.tags.length - 1].nextSibling;
858
876
  }
@@ -870,6 +888,7 @@ var StyleSheet = /*#__PURE__*/function () {
870
888
  this.key = options.key;
871
889
  this.container = options.container;
872
890
  this.prepend = options.prepend;
891
+ this.insertionPoint = options.insertionPoint;
873
892
  this.before = null;
874
893
  }
875
894
 
@@ -910,7 +929,7 @@ var StyleSheet = /*#__PURE__*/function () {
910
929
  // the big drawback is that the css won't be editable in devtools
911
930
  sheet.insertRule(rule, sheet.cssRules.length);
912
931
  } catch (e) {
913
- if (process.env.NODE_ENV !== 'production' && !/:(-moz-placeholder|-ms-input-placeholder|-moz-read-write|-moz-read-only){/.test(rule)) {
932
+ 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)) {
914
933
  console.error("There was a problem inserting the following rule: \"" + rule + "\"", e);
915
934
  }
916
935
  }
@@ -924,7 +943,7 @@ var StyleSheet = /*#__PURE__*/function () {
924
943
  _proto.flush = function flush() {
925
944
  // $FlowFixMe
926
945
  this.tags.forEach(function (tag) {
927
- return tag.parentNode.removeChild(tag);
946
+ return tag.parentNode && tag.parentNode.removeChild(tag);
928
947
  });
929
948
  this.tags = [];
930
949
  this.ctr = 0;
@@ -957,13 +976,19 @@ var abs = Math.abs;
957
976
  */
958
977
 
959
978
  var from = String.fromCharCode;
979
+ /**
980
+ * @param {object}
981
+ * @return {object}
982
+ */
983
+
984
+ var assign = Object.assign;
960
985
  /**
961
986
  * @param {string} value
962
987
  * @param {number} length
963
988
  * @return {number}
964
989
  */
965
990
 
966
- function hash(value, length) {
991
+ function hash$1(value, length) {
967
992
  return (((length << 2 ^ charat(value, 0)) << 2 ^ charat(value, 1)) << 2 ^ charat(value, 2)) << 2 ^ charat(value, 3);
968
993
  }
969
994
  /**
@@ -995,7 +1020,7 @@ function replace(value, pattern, replacement) {
995
1020
  }
996
1021
  /**
997
1022
  * @param {string} value
998
- * @param {string} value
1023
+ * @param {string} search
999
1024
  * @return {number}
1000
1025
  */
1001
1026
 
@@ -1064,11 +1089,11 @@ var character = 0;
1064
1089
  var characters = '';
1065
1090
  /**
1066
1091
  * @param {string} value
1067
- * @param {object} root
1068
- * @param {object?} parent
1092
+ * @param {object | null} root
1093
+ * @param {object | null} parent
1069
1094
  * @param {string} type
1070
- * @param {string[]} props
1071
- * @param {object[]} children
1095
+ * @param {string[] | string} props
1096
+ * @param {object[] | string} children
1072
1097
  * @param {number} length
1073
1098
  */
1074
1099
 
@@ -1087,13 +1112,15 @@ function node(value, root, parent, type, props, children, length) {
1087
1112
  };
1088
1113
  }
1089
1114
  /**
1090
- * @param {string} value
1091
1115
  * @param {object} root
1092
- * @param {string} type
1116
+ * @param {object} props
1117
+ * @return {object}
1093
1118
  */
1094
1119
 
1095
- function copy(value, root, type) {
1096
- return node(value, root.root, root.parent, type, root.props, root.children, 0);
1120
+ function copy(root, props) {
1121
+ return assign(node('', null, null, '', null, null, 0), root, {
1122
+ length: -root.length
1123
+ }, props);
1097
1124
  }
1098
1125
  /**
1099
1126
  * @return {number}
@@ -1252,7 +1279,8 @@ function delimiter(type) {
1252
1279
 
1253
1280
  case 34:
1254
1281
  case 39:
1255
- return delimiter(type === 34 || type === 39 ? type : character);
1282
+ if (type !== 34 && type !== 39) delimiter(character);
1283
+ break;
1256
1284
  // (
1257
1285
 
1258
1286
  case 40:
@@ -1336,11 +1364,18 @@ function parse(value, root, parent, rule, rules, rulesets, pseudo, points, decla
1336
1364
 
1337
1365
  while (scanning) {
1338
1366
  switch (previous = character, character = next()) {
1339
- // " ' [ (
1367
+ // (
1368
+ case 40:
1369
+ if (previous != 108 && characters.charCodeAt(length - 1) == 58) {
1370
+ if (indexof(characters += replace(delimit(character), '&', '&\f'), '&\f') != -1) ampersand = -1;
1371
+ break;
1372
+ }
1373
+
1374
+ // " ' [
1375
+
1340
1376
  case 34:
1341
1377
  case 39:
1342
1378
  case 91:
1343
- case 40:
1344
1379
  characters += delimit(character);
1345
1380
  break;
1346
1381
  // \t \n \r \s
@@ -1406,7 +1441,7 @@ function parse(value, root, parent, rule, rules, rulesets, pseudo, points, decla
1406
1441
  break;
1407
1442
 
1408
1443
  default:
1409
- parse(characters, reference, reference, reference, [''], children, length, points, children);
1444
+ parse(characters, reference, reference, reference, [''], children, 0, points, children);
1410
1445
  }
1411
1446
  }
1412
1447
 
@@ -1435,7 +1470,7 @@ function parse(value, root, parent, rule, rules, rulesets, pseudo, points, decla
1435
1470
  case 64:
1436
1471
  // -
1437
1472
  if (peek() === 45) characters += delimit(next());
1438
- atrule = peek(), offset = strlen(type = characters += identifier(caret())), character++;
1473
+ atrule = peek(), offset = length = strlen(type = characters += identifier(caret())), character++;
1439
1474
  break;
1440
1475
  // -
1441
1476
 
@@ -1505,7 +1540,7 @@ function declaration(value, root, parent, length) {
1505
1540
  */
1506
1541
 
1507
1542
  function prefix(value, length) {
1508
- switch (hash(value, length)) {
1543
+ switch (hash$1(value, length)) {
1509
1544
  // color-adjust
1510
1545
  case 5103:
1511
1546
  return WEBKIT + 'print-' + value + value;
@@ -1710,6 +1745,9 @@ function stringify(element, index, children, callback) {
1710
1745
  case COMMENT:
1711
1746
  return '';
1712
1747
 
1748
+ case KEYFRAMES:
1749
+ return element["return"] = element.value + '{' + serialize(element.children, callback) + '}';
1750
+
1713
1751
  case RULESET:
1714
1752
  element.value = element.props.join(',');
1715
1753
  }
@@ -1752,13 +1790,15 @@ function rulesheet(callback) {
1752
1790
  */
1753
1791
 
1754
1792
  function prefixer(element, index, children, callback) {
1755
- if (!element["return"]) switch (element.type) {
1793
+ if (element.length > -1) if (!element["return"]) switch (element.type) {
1756
1794
  case DECLARATION:
1757
1795
  element["return"] = prefix(element.value, element.length);
1758
1796
  break;
1759
1797
 
1760
1798
  case KEYFRAMES:
1761
- return serialize([copy(replace(element.value, '@', '@' + WEBKIT), element, '')], callback);
1799
+ return serialize([copy(element, {
1800
+ value: replace(element.value, '@', '@' + WEBKIT)
1801
+ })], callback);
1762
1802
 
1763
1803
  case RULESET:
1764
1804
  if (element.length) return combine(element.props, function (value) {
@@ -1766,11 +1806,19 @@ function prefixer(element, index, children, callback) {
1766
1806
  // :read-(only|write)
1767
1807
  case ':read-only':
1768
1808
  case ':read-write':
1769
- return serialize([copy(replace(value, /:(read-\w+)/, ':' + MOZ + '$1'), element, '')], callback);
1809
+ return serialize([copy(element, {
1810
+ props: [replace(value, /:(read-\w+)/, ':' + MOZ + '$1')]
1811
+ })], callback);
1770
1812
  // :placeholder
1771
1813
 
1772
1814
  case '::placeholder':
1773
- return serialize([copy(replace(value, /:(plac\w+)/, ':' + WEBKIT + 'input-$1'), element, ''), copy(replace(value, /:(plac\w+)/, ':' + MOZ + '$1'), element, ''), copy(replace(value, /:(plac\w+)/, MS + 'input-$1'), element, '')], callback);
1815
+ return serialize([copy(element, {
1816
+ props: [replace(value, /:(plac\w+)/, ':' + WEBKIT + 'input-$1')]
1817
+ }), copy(element, {
1818
+ props: [replace(value, /:(plac\w+)/, ':' + MOZ + '$1')]
1819
+ }), copy(element, {
1820
+ props: [replace(value, /:(plac\w+)/, MS + 'input-$1')]
1821
+ })], callback);
1774
1822
  }
1775
1823
 
1776
1824
  return '';
@@ -1780,6 +1828,29 @@ function prefixer(element, index, children, callback) {
1780
1828
 
1781
1829
  var last = function last(arr) {
1782
1830
  return arr.length ? arr[arr.length - 1] : null;
1831
+ }; // based on https://github.com/thysultan/stylis.js/blob/e6843c373ebcbbfade25ebcc23f540ed8508da0a/src/Tokenizer.js#L239-L244
1832
+
1833
+
1834
+ var identifierWithPointTracking = function identifierWithPointTracking(begin, points, index) {
1835
+ var previous = 0;
1836
+ var character = 0;
1837
+
1838
+ while (true) {
1839
+ previous = character;
1840
+ character = peek(); // &\f
1841
+
1842
+ if (previous === 38 && character === 12) {
1843
+ points[index] = 1;
1844
+ }
1845
+
1846
+ if (token(character)) {
1847
+ break;
1848
+ }
1849
+
1850
+ next();
1851
+ }
1852
+
1853
+ return slice(begin, position);
1783
1854
  };
1784
1855
 
1785
1856
  var toRules = function toRules(parsed, points) {
@@ -1799,7 +1870,7 @@ var toRules = function toRules(parsed, points) {
1799
1870
  points[index] = 1;
1800
1871
  }
1801
1872
 
1802
- parsed[index] += identifier(position - 1);
1873
+ parsed[index] += identifierWithPointTracking(position - 1, points, index);
1803
1874
  break;
1804
1875
 
1805
1876
  case 2:
@@ -1833,8 +1904,9 @@ var getRules = function getRules(value, points) {
1833
1904
  var fixedElements = /* #__PURE__ */new WeakMap();
1834
1905
 
1835
1906
  var compat = function compat(element) {
1836
- if (element.type !== 'rule' || !element.parent || // .length indicates if this rule contains pseudo or not
1837
- !element.length) {
1907
+ if (element.type !== 'rule' || !element.parent || // positive .length indicates that this rule contains pseudo
1908
+ // negative .length indicates that this rule has been already prefixed
1909
+ element.length < 1) {
1838
1910
  return;
1839
1911
  }
1840
1912
 
@@ -2070,7 +2142,8 @@ var createCache = function createCache(options) {
2070
2142
  container: container,
2071
2143
  nonce: options.nonce,
2072
2144
  speedy: options.speedy,
2073
- prepend: options.prepend
2145
+ prepend: options.prepend,
2146
+ insertionPoint: options.insertionPoint
2074
2147
  }),
2075
2148
  nonce: options.nonce,
2076
2149
  inserted: inserted,
@@ -2088,22 +2161,22 @@ var reactIs$1 = {exports: {}};
2088
2161
  var reactIs_production_min = {};
2089
2162
 
2090
2163
  var b = "function" === typeof Symbol && Symbol["for"],
2091
- c$1 = b ? Symbol["for"]("react.element") : 60103,
2164
+ c = b ? Symbol["for"]("react.element") : 60103,
2092
2165
  d = b ? Symbol["for"]("react.portal") : 60106,
2093
- e$1 = b ? Symbol["for"]("react.fragment") : 60107,
2094
- f$1 = b ? Symbol["for"]("react.strict_mode") : 60108,
2166
+ e = b ? Symbol["for"]("react.fragment") : 60107,
2167
+ f = b ? Symbol["for"]("react.strict_mode") : 60108,
2095
2168
  g = b ? Symbol["for"]("react.profiler") : 60114,
2096
2169
  h = b ? Symbol["for"]("react.provider") : 60109,
2097
2170
  k = b ? Symbol["for"]("react.context") : 60110,
2098
- l$1 = b ? Symbol["for"]("react.async_mode") : 60111,
2171
+ l = b ? Symbol["for"]("react.async_mode") : 60111,
2099
2172
  m = b ? Symbol["for"]("react.concurrent_mode") : 60111,
2100
- n$1 = b ? Symbol["for"]("react.forward_ref") : 60112,
2173
+ n = b ? Symbol["for"]("react.forward_ref") : 60112,
2101
2174
  p = b ? Symbol["for"]("react.suspense") : 60113,
2102
2175
  q = b ? Symbol["for"]("react.suspense_list") : 60120,
2103
2176
  r$1 = b ? Symbol["for"]("react.memo") : 60115,
2104
- t$1 = b ? Symbol["for"]("react.lazy") : 60116,
2177
+ t = b ? Symbol["for"]("react.lazy") : 60116,
2105
2178
  v = b ? Symbol["for"]("react.block") : 60121,
2106
- w$1 = b ? Symbol["for"]("react.fundamental") : 60117,
2179
+ w = b ? Symbol["for"]("react.fundamental") : 60117,
2107
2180
  x = b ? Symbol["for"]("react.responder") : 60118,
2108
2181
  y = b ? Symbol["for"]("react.scope") : 60119;
2109
2182
 
@@ -2112,21 +2185,21 @@ function z(a) {
2112
2185
  var u = a.$$typeof;
2113
2186
 
2114
2187
  switch (u) {
2115
- case c$1:
2188
+ case c:
2116
2189
  switch (a = a.type, a) {
2117
- case l$1:
2190
+ case l:
2118
2191
  case m:
2119
- case e$1:
2192
+ case e:
2120
2193
  case g:
2121
- case f$1:
2194
+ case f:
2122
2195
  case p:
2123
2196
  return a;
2124
2197
 
2125
2198
  default:
2126
2199
  switch (a = a && a.$$typeof, a) {
2127
2200
  case k:
2128
- case n$1:
2129
- case t$1:
2201
+ case n:
2202
+ case t:
2130
2203
  case r$1:
2131
2204
  case h:
2132
2205
  return a;
@@ -2147,22 +2220,22 @@ function A(a) {
2147
2220
  return z(a) === m;
2148
2221
  }
2149
2222
 
2150
- reactIs_production_min.AsyncMode = l$1;
2223
+ reactIs_production_min.AsyncMode = l;
2151
2224
  reactIs_production_min.ConcurrentMode = m;
2152
2225
  reactIs_production_min.ContextConsumer = k;
2153
2226
  reactIs_production_min.ContextProvider = h;
2154
- reactIs_production_min.Element = c$1;
2155
- reactIs_production_min.ForwardRef = n$1;
2156
- reactIs_production_min.Fragment = e$1;
2157
- reactIs_production_min.Lazy = t$1;
2227
+ reactIs_production_min.Element = c;
2228
+ reactIs_production_min.ForwardRef = n;
2229
+ reactIs_production_min.Fragment = e;
2230
+ reactIs_production_min.Lazy = t;
2158
2231
  reactIs_production_min.Memo = r$1;
2159
2232
  reactIs_production_min.Portal = d;
2160
2233
  reactIs_production_min.Profiler = g;
2161
- reactIs_production_min.StrictMode = f$1;
2234
+ reactIs_production_min.StrictMode = f;
2162
2235
  reactIs_production_min.Suspense = p;
2163
2236
 
2164
2237
  reactIs_production_min.isAsyncMode = function (a) {
2165
- return A(a) || z(a) === l$1;
2238
+ return A(a) || z(a) === l;
2166
2239
  };
2167
2240
 
2168
2241
  reactIs_production_min.isConcurrentMode = A;
@@ -2176,19 +2249,19 @@ reactIs_production_min.isContextProvider = function (a) {
2176
2249
  };
2177
2250
 
2178
2251
  reactIs_production_min.isElement = function (a) {
2179
- return "object" === _typeof(a) && null !== a && a.$$typeof === c$1;
2252
+ return "object" === _typeof(a) && null !== a && a.$$typeof === c;
2180
2253
  };
2181
2254
 
2182
2255
  reactIs_production_min.isForwardRef = function (a) {
2183
- return z(a) === n$1;
2256
+ return z(a) === n;
2184
2257
  };
2185
2258
 
2186
2259
  reactIs_production_min.isFragment = function (a) {
2187
- return z(a) === e$1;
2260
+ return z(a) === e;
2188
2261
  };
2189
2262
 
2190
2263
  reactIs_production_min.isLazy = function (a) {
2191
- return z(a) === t$1;
2264
+ return z(a) === t;
2192
2265
  };
2193
2266
 
2194
2267
  reactIs_production_min.isMemo = function (a) {
@@ -2204,7 +2277,7 @@ reactIs_production_min.isProfiler = function (a) {
2204
2277
  };
2205
2278
 
2206
2279
  reactIs_production_min.isStrictMode = function (a) {
2207
- return z(a) === f$1;
2280
+ return z(a) === f;
2208
2281
  };
2209
2282
 
2210
2283
  reactIs_production_min.isSuspense = function (a) {
@@ -2212,7 +2285,7 @@ reactIs_production_min.isSuspense = function (a) {
2212
2285
  };
2213
2286
 
2214
2287
  reactIs_production_min.isValidElementType = function (a) {
2215
- return "string" === typeof a || "function" === typeof a || a === e$1 || a === m || a === g || a === f$1 || a === p || a === q || "object" === _typeof(a) && null !== a && (a.$$typeof === t$1 || a.$$typeof === r$1 || a.$$typeof === h || a.$$typeof === k || a.$$typeof === n$1 || a.$$typeof === w$1 || a.$$typeof === x || a.$$typeof === y || a.$$typeof === v);
2288
+ return "string" === typeof a || "function" === typeof a || a === e || a === m || a === g || a === f || a === p || a === q || "object" === _typeof(a) && null !== a && (a.$$typeof === t || a.$$typeof === r$1 || a.$$typeof === h || a.$$typeof === k || a.$$typeof === n || a.$$typeof === w || a.$$typeof === x || a.$$typeof === y || a.$$typeof === v);
2216
2289
  };
2217
2290
 
2218
2291
  reactIs_production_min.typeOf = z;
@@ -2438,7 +2511,7 @@ function getRegisteredStyles$1(registered, registeredStyles, classNames) {
2438
2511
  return rawClassName;
2439
2512
  }
2440
2513
 
2441
- var insertStyles$1 = function insertStyles(cache, serialized, isStringTag) {
2514
+ var registerStyles$1 = function registerStyles(cache, serialized, isStringTag) {
2442
2515
  var className = cache.key + "-" + serialized.name;
2443
2516
 
2444
2517
  if ( // we only need to add the styles to the registered cache if the
@@ -2453,6 +2526,11 @@ var insertStyles$1 = function insertStyles(cache, serialized, isStringTag) {
2453
2526
  isBrowser$3 === false) && cache.registered[className] === undefined) {
2454
2527
  cache.registered[className] = serialized.styles;
2455
2528
  }
2529
+ };
2530
+
2531
+ var insertStyles$1 = function insertStyles(cache, serialized, isStringTag) {
2532
+ registerStyles$1(cache, serialized, isStringTag);
2533
+ var className = cache.key + "-" + serialized.name;
2456
2534
 
2457
2535
  if (cache.inserted[serialized.name] === undefined) {
2458
2536
  var current = serialized;
@@ -2610,7 +2688,7 @@ var processStyleValue$1 = function processStyleValue(key, value) {
2610
2688
  };
2611
2689
 
2612
2690
  if (process.env.NODE_ENV !== 'production') {
2613
- var contentValuePattern$1 = /(attr|counters?|url|(((repeating-)?(linear|radial))|conic)-gradient)\(|(no-)?(open|close)-quote/;
2691
+ var contentValuePattern$1 = /(var|attr|counters?|url|(((repeating-)?(linear|radial))|conic)-gradient)\(|(no-)?(open|close)-quote/;
2614
2692
  var contentValues$1 = ['normal', 'none', 'initial', 'inherit', 'unset'];
2615
2693
  var oldProcessStyleValue$1 = processStyleValue$1;
2616
2694
  var msPattern$1 = /^-ms-/;
@@ -2877,7 +2955,7 @@ var serializeStyles$1 = function serializeStyles(args, registered, mergedProps)
2877
2955
  };
2878
2956
  };
2879
2957
 
2880
- var hasOwnProperty = Object.prototype.hasOwnProperty;
2958
+ var hasOwnProperty = {}.hasOwnProperty;
2881
2959
  var EmotionCacheContext = /* #__PURE__ */React.createContext( // we're doing this to avoid preconstruct's dead code elimination in this one case
2882
2960
  // because this module is primarily intended for the browser and node
2883
2961
  // but it's also required in react native and similar environments sometimes
@@ -2887,6 +2965,11 @@ var EmotionCacheContext = /* #__PURE__ */React.createContext( // we're doing thi
2887
2965
  typeof HTMLElement !== 'undefined' ? /* #__PURE__ */createCache({
2888
2966
  key: 'css'
2889
2967
  }) : null);
2968
+
2969
+ if (process.env.NODE_ENV !== 'production') {
2970
+ EmotionCacheContext.displayName = 'EmotionCacheContext';
2971
+ }
2972
+
2890
2973
  EmotionCacheContext.Provider;
2891
2974
 
2892
2975
  var withEmotionCache = function withEmotionCache(func) {
@@ -2900,9 +2983,32 @@ var withEmotionCache = function withEmotionCache(func) {
2900
2983
 
2901
2984
  var ThemeContext = /* #__PURE__ */React.createContext({});
2902
2985
 
2986
+ if (process.env.NODE_ENV !== 'production') {
2987
+ ThemeContext.displayName = 'EmotionThemeContext';
2988
+ }
2989
+
2990
+ var useInsertionEffect$2 = React__namespace['useInsertion' + 'Effect'] ? React__namespace['useInsertion' + 'Effect'] : function useInsertionEffect(create) {
2991
+ create();
2992
+ };
2993
+
2994
+ function useInsertionEffectMaybe$1(create) {
2995
+ useInsertionEffect$2(create);
2996
+ }
2997
+
2903
2998
  var typePropName = '__EMOTION_TYPE_PLEASE_DO_NOT_USE__';
2904
2999
  var labelPropName = '__EMOTION_LABEL_PLEASE_DO_NOT_USE__';
2905
3000
 
3001
+ var Insertion$2 = function Insertion(_ref) {
3002
+ var cache = _ref.cache,
3003
+ serialized = _ref.serialized,
3004
+ isStringTag = _ref.isStringTag;
3005
+ registerStyles$1(cache, serialized, isStringTag);
3006
+ useInsertionEffectMaybe$1(function () {
3007
+ return insertStyles$1(cache, serialized, isStringTag);
3008
+ });
3009
+ return null;
3010
+ };
3011
+
2906
3012
  var Emotion = /* #__PURE__ */withEmotionCache(function (props, cache, ref) {
2907
3013
  var cssProp = props.css; // so that using `css` from `emotion` and passing the result to the css prop works
2908
3014
  // not passing the registered cache to serializeStyles because it would
@@ -2912,7 +3018,7 @@ var Emotion = /* #__PURE__ */withEmotionCache(function (props, cache, ref) {
2912
3018
  cssProp = cache.registered[cssProp];
2913
3019
  }
2914
3020
 
2915
- var type = props[typePropName];
3021
+ var WrappedComponent = props[typePropName];
2916
3022
  var registeredStyles = [cssProp];
2917
3023
  var className = '';
2918
3024
 
@@ -2922,7 +3028,7 @@ var Emotion = /* #__PURE__ */withEmotionCache(function (props, cache, ref) {
2922
3028
  className = props.className + " ";
2923
3029
  }
2924
3030
 
2925
- var serialized = serializeStyles$1(registeredStyles, undefined, typeof cssProp === 'function' || Array.isArray(cssProp) ? React.useContext(ThemeContext) : undefined);
3031
+ var serialized = serializeStyles$1(registeredStyles, undefined, React.useContext(ThemeContext));
2926
3032
 
2927
3033
  if (process.env.NODE_ENV !== 'production' && serialized.name.indexOf('-') === -1) {
2928
3034
  var labelFromStack = props[labelPropName];
@@ -2932,7 +3038,6 @@ var Emotion = /* #__PURE__ */withEmotionCache(function (props, cache, ref) {
2932
3038
  }
2933
3039
  }
2934
3040
 
2935
- insertStyles$1(cache, serialized, typeof type === 'string');
2936
3041
  className += cache.key + "-" + serialized.name;
2937
3042
  var newProps = {};
2938
3043
 
@@ -2944,8 +3049,11 @@ var Emotion = /* #__PURE__ */withEmotionCache(function (props, cache, ref) {
2944
3049
 
2945
3050
  newProps.ref = ref;
2946
3051
  newProps.className = className;
2947
- var ele = /*#__PURE__*/React.createElement(type, newProps);
2948
- return ele;
3052
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Insertion$2, {
3053
+ cache: cache,
3054
+ serialized: serialized,
3055
+ isStringTag: typeof WrappedComponent === 'string'
3056
+ }), /*#__PURE__*/React.createElement(WrappedComponent, newProps));
2949
3057
  });
2950
3058
 
2951
3059
  if (process.env.NODE_ENV !== 'production') {
@@ -2954,7 +3062,7 @@ if (process.env.NODE_ENV !== 'production') {
2954
3062
 
2955
3063
  var pkg = {
2956
3064
  name: "@emotion/react",
2957
- version: "11.4.0",
3065
+ version: "11.9.0",
2958
3066
  main: "dist/emotion-react.cjs.js",
2959
3067
  module: "dist/emotion-react.esm.js",
2960
3068
  browser: {
@@ -2962,19 +3070,19 @@ var pkg = {
2962
3070
  "./dist/emotion-react.esm.js": "./dist/emotion-react.browser.esm.js"
2963
3071
  },
2964
3072
  types: "types/index.d.ts",
2965
- files: ["src", "dist", "jsx-runtime", "jsx-dev-runtime", "isolated-hoist-non-react-statics-do-not-use-this-in-your-code", "types/*.d.ts", "macro.js", "macro.d.ts", "macro.js.flow"],
3073
+ files: ["src", "dist", "jsx-runtime", "jsx-dev-runtime", "_isolated-hnrs", "types/*.d.ts", "macro.js", "macro.d.ts", "macro.js.flow"],
2966
3074
  sideEffects: false,
2967
- author: "mitchellhamilton <mitchell@mitchellhamilton.me>",
3075
+ author: "Emotion Contributors",
2968
3076
  license: "MIT",
2969
3077
  scripts: {
2970
3078
  "test:typescript": "dtslint types"
2971
3079
  },
2972
3080
  dependencies: {
2973
3081
  "@babel/runtime": "^7.13.10",
2974
- "@emotion/cache": "^11.4.0",
2975
- "@emotion/serialize": "^1.0.2",
2976
- "@emotion/sheet": "^1.0.1",
2977
- "@emotion/utils": "^1.0.0",
3082
+ "@emotion/babel-plugin": "^11.7.1",
3083
+ "@emotion/cache": "^11.7.1",
3084
+ "@emotion/serialize": "^1.0.3",
3085
+ "@emotion/utils": "^1.1.0",
2978
3086
  "@emotion/weak-memoize": "^0.2.5",
2979
3087
  "hoist-non-react-statics": "^3.3.1"
2980
3088
  },
@@ -2992,15 +3100,16 @@ var pkg = {
2992
3100
  },
2993
3101
  devDependencies: {
2994
3102
  "@babel/core": "^7.13.10",
2995
- "@emotion/css": "11.1.3",
2996
- "@emotion/css-prettifier": "1.0.0",
3103
+ "@emotion/css": "11.9.0",
3104
+ "@emotion/css-prettifier": "1.0.1",
2997
3105
  "@emotion/server": "11.4.0",
2998
- "@emotion/styled": "11.3.0",
3106
+ "@emotion/styled": "11.8.1",
2999
3107
  "@types/react": "^16.9.11",
3000
- dtslint: "^0.3.0",
3108
+ dtslint: "^4.2.1",
3001
3109
  "html-tag-names": "^1.1.2",
3002
3110
  react: "16.14.0",
3003
- "svg-tag-names": "^1.1.1"
3111
+ "svg-tag-names": "^1.1.1",
3112
+ typescript: "^4.5.5"
3004
3113
  },
3005
3114
  repository: "https://github.com/emotion-js/emotion/tree/main/packages/react",
3006
3115
  publishConfig: {
@@ -3008,11 +3117,12 @@ var pkg = {
3008
3117
  },
3009
3118
  "umd:main": "dist/emotion-react.umd.min.js",
3010
3119
  preconstruct: {
3011
- entrypoints: ["./index.js", "./jsx-runtime.js", "./jsx-dev-runtime.js", "./isolated-hoist-non-react-statics-do-not-use-this-in-your-code.js"],
3120
+ entrypoints: ["./index.js", "./jsx-runtime.js", "./jsx-dev-runtime.js", "./_isolated-hnrs.js"],
3012
3121
  umdName: "emotionReact"
3013
3122
  }
3014
3123
  };
3015
3124
 
3125
+ var useInsertionEffect$1 = React__namespace['useInsertion' + 'Effect'] ? React__namespace['useInsertion' + 'Effect'] : React.useLayoutEffect;
3016
3126
  var warnedAboutCssPropForGlobal = false; // maintain place over rerenders.
3017
3127
  // initial render from browser, insertBefore context.sheet.tags[0] or if a style hasn't been inserted there yet, appendChild
3018
3128
  // initial client-side render from SSR, use place of hydrating tag
@@ -3028,14 +3138,15 @@ var Global = /* #__PURE__ */withEmotionCache(function (props, cache) {
3028
3138
  }
3029
3139
 
3030
3140
  var styles = props.styles;
3031
- var serialized = serializeStyles$1([styles], undefined, typeof styles === 'function' || Array.isArray(styles) ? React.useContext(ThemeContext) : undefined); // but it is based on a constant that will never change at runtime
3141
+ var serialized = serializeStyles$1([styles], undefined, React.useContext(ThemeContext)); // but it is based on a constant that will never change at runtime
3032
3142
  // it's effectively like having two implementations and switching them out
3033
3143
  // so it's not actually breaking anything
3034
3144
 
3035
3145
  var sheetRef = React.useRef();
3036
- React.useLayoutEffect(function () {
3037
- var key = cache.key + "-global";
3038
- var sheet = new StyleSheet({
3146
+ useInsertionEffect$1(function () {
3147
+ var key = cache.key + "-global"; // use case of https://github.com/emotion-js/emotion/issues/2675
3148
+
3149
+ var sheet = new cache.sheet.constructor({
3039
3150
  key: key,
3040
3151
  nonce: cache.sheet.nonce,
3041
3152
  container: cache.sheet.container,
@@ -3061,7 +3172,7 @@ var Global = /* #__PURE__ */withEmotionCache(function (props, cache) {
3061
3172
  sheet.flush();
3062
3173
  };
3063
3174
  }, [cache]);
3064
- React.useLayoutEffect(function () {
3175
+ useInsertionEffect$1(function () {
3065
3176
  var sheetRefCurrent = sheetRef.current;
3066
3177
  var sheet = sheetRefCurrent[0],
3067
3178
  rehydrating = sheetRefCurrent[1];
@@ -3176,8 +3287,20 @@ function merge(registered, css, className) {
3176
3287
  return rawClassName + css(registeredStyles);
3177
3288
  }
3178
3289
 
3290
+ var Insertion$1 = function Insertion(_ref) {
3291
+ var cache = _ref.cache,
3292
+ serializedArr = _ref.serializedArr;
3293
+ useInsertionEffectMaybe$1(function () {
3294
+ for (var i = 0; i < serializedArr.length; i++) {
3295
+ insertStyles$1(cache, serializedArr[i], false);
3296
+ }
3297
+ });
3298
+ return null;
3299
+ };
3300
+
3179
3301
  var ClassNames = /* #__PURE__ */withEmotionCache(function (props, cache) {
3180
3302
  var hasRendered = false;
3303
+ var serializedArr = [];
3181
3304
 
3182
3305
  var css = function css() {
3183
3306
  if (hasRendered && process.env.NODE_ENV !== 'production') {
@@ -3189,9 +3312,9 @@ var ClassNames = /* #__PURE__ */withEmotionCache(function (props, cache) {
3189
3312
  }
3190
3313
 
3191
3314
  var serialized = serializeStyles$1(args, cache.registered);
3192
- {
3193
- insertStyles$1(cache, serialized, false);
3194
- }
3315
+ serializedArr.push(serialized); // registration has to happen here as the result of this might get consumed by `cx`
3316
+
3317
+ registerStyles$1(cache, serialized, false);
3195
3318
  return cache.key + "-" + serialized.name;
3196
3319
  };
3197
3320
 
@@ -3214,7 +3337,10 @@ var ClassNames = /* #__PURE__ */withEmotionCache(function (props, cache) {
3214
3337
  };
3215
3338
  var ele = props.children(content);
3216
3339
  hasRendered = true;
3217
- return ele;
3340
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Insertion$1, {
3341
+ cache: cache,
3342
+ serializedArr: serializedArr
3343
+ }), ele);
3218
3344
  });
3219
3345
 
3220
3346
  if (process.env.NODE_ENV !== 'production') {
@@ -3227,7 +3353,10 @@ if (process.env.NODE_ENV !== 'production') {
3227
3353
  var isJest = typeof jest !== 'undefined';
3228
3354
 
3229
3355
  if (isBrowser$2 && !isJest) {
3230
- var globalContext = isBrowser$2 ? window : global;
3356
+ // globalThis has wide browser support - https://caniuse.com/?search=globalThis, Node.js 12 and later
3357
+ var globalContext = // $FlowIgnore
3358
+ typeof globalThis !== 'undefined' ? globalThis // eslint-disable-line no-undef
3359
+ : isBrowser$2 ? window : global;
3231
3360
  var globalKey = "__EMOTION_REACT_" + pkg.version.split('.')[0] + "__";
3232
3361
 
3233
3362
  if (globalContext[globalKey]) {
@@ -3252,7 +3381,7 @@ function getRegisteredStyles(registered, registeredStyles, classNames) {
3252
3381
  return rawClassName;
3253
3382
  }
3254
3383
 
3255
- var insertStyles = function insertStyles(cache, serialized, isStringTag) {
3384
+ var registerStyles = function registerStyles(cache, serialized, isStringTag) {
3256
3385
  var className = cache.key + "-" + serialized.name;
3257
3386
 
3258
3387
  if ( // we only need to add the styles to the registered cache if the
@@ -3267,6 +3396,11 @@ var insertStyles = function insertStyles(cache, serialized, isStringTag) {
3267
3396
  isBrowser$1 === false) && cache.registered[className] === undefined) {
3268
3397
  cache.registered[className] = serialized.styles;
3269
3398
  }
3399
+ };
3400
+
3401
+ var insertStyles = function insertStyles(cache, serialized, isStringTag) {
3402
+ registerStyles(cache, serialized, isStringTag);
3403
+ var className = cache.key + "-" + serialized.name;
3270
3404
 
3271
3405
  if (cache.inserted[serialized.name] === undefined) {
3272
3406
  var current = serialized;
@@ -3618,8 +3752,27 @@ var composeShouldForwardProps = function composeShouldForwardProps(tag, options,
3618
3752
  return shouldForwardProp;
3619
3753
  };
3620
3754
 
3755
+ var useInsertionEffect = React__namespace['useInsertion' + 'Effect'] ? React__namespace['useInsertion' + 'Effect'] : function useInsertionEffect(create) {
3756
+ create();
3757
+ };
3758
+
3759
+ function useInsertionEffectMaybe(create) {
3760
+ useInsertionEffect(create);
3761
+ }
3762
+
3621
3763
  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";
3622
3764
 
3765
+ var Insertion = function Insertion(_ref) {
3766
+ var cache = _ref.cache,
3767
+ serialized = _ref.serialized,
3768
+ isStringTag = _ref.isStringTag;
3769
+ registerStyles(cache, serialized, isStringTag);
3770
+ useInsertionEffectMaybe(function () {
3771
+ return insertStyles(cache, serialized, isStringTag);
3772
+ });
3773
+ return null;
3774
+ };
3775
+
3623
3776
  var createStyled = function createStyled(tag, options) {
3624
3777
  if (process.env.NODE_ENV !== 'production') {
3625
3778
  if (tag === undefined) {
@@ -3670,7 +3823,7 @@ var createStyled = function createStyled(tag, options) {
3670
3823
 
3671
3824
 
3672
3825
  var Styled = withEmotionCache(function (props, cache, ref) {
3673
- var finalTag = shouldUseAs && props.as || baseTag;
3826
+ var FinalTag = shouldUseAs && props.as || baseTag;
3674
3827
  var className = '';
3675
3828
  var classInterpolations = [];
3676
3829
  var mergedProps = props;
@@ -3692,14 +3845,13 @@ var createStyled = function createStyled(tag, options) {
3692
3845
  }
3693
3846
 
3694
3847
  var serialized = serializeStyles(styles.concat(classInterpolations), cache.registered, mergedProps);
3695
- insertStyles(cache, serialized, typeof finalTag === 'string');
3696
3848
  className += cache.key + "-" + serialized.name;
3697
3849
 
3698
3850
  if (targetClassName !== undefined) {
3699
3851
  className += " " + targetClassName;
3700
3852
  }
3701
3853
 
3702
- var finalShouldForwardProp = shouldUseAs && shouldForwardProp === undefined ? getDefaultShouldForwardProp(finalTag) : defaultShouldForwardProp;
3854
+ var finalShouldForwardProp = shouldUseAs && shouldForwardProp === undefined ? getDefaultShouldForwardProp(FinalTag) : defaultShouldForwardProp;
3703
3855
  var newProps = {};
3704
3856
 
3705
3857
  for (var _key in props) {
@@ -3713,8 +3865,11 @@ var createStyled = function createStyled(tag, options) {
3713
3865
 
3714
3866
  newProps.className = className;
3715
3867
  newProps.ref = ref;
3716
- var ele = /*#__PURE__*/React.createElement(finalTag, newProps);
3717
- return ele;
3868
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Insertion, {
3869
+ cache: cache,
3870
+ serialized: serialized,
3871
+ isStringTag: typeof FinalTag === 'string'
3872
+ }), /*#__PURE__*/React.createElement(FinalTag, newProps));
3718
3873
  });
3719
3874
  Styled.displayName = identifierName !== undefined ? identifierName : "Styled(" + (typeof baseTag === 'string' ? baseTag : baseTag.displayName || baseTag.name || 'Component') + ")";
3720
3875
  Styled.defaultProps = tag.defaultProps;
@@ -4822,15 +4977,15 @@ var Gesture = function Gesture(_ref6) {
4822
4977
  stateRef.current.noTap = false;
4823
4978
  } // Send tap event only if time less than 300ms
4824
4979
  else if (stateRef.current.timeStart - now < 300) {
4825
- queue(onTap, {
4826
- clientX: clientX,
4827
- clientY: clientY,
4828
- altKey: altKey,
4829
- ctrlKey: ctrlKey,
4830
- metaKey: metaKey,
4831
- target: target
4832
- });
4833
- }
4980
+ queue(onTap, {
4981
+ clientX: clientX,
4982
+ clientY: clientY,
4983
+ altKey: altKey,
4984
+ ctrlKey: ctrlKey,
4985
+ metaKey: metaKey,
4986
+ target: target
4987
+ });
4988
+ }
4834
4989
  }
4835
4990
  }, [onDragEnd, onTap, queue]);
4836
4991
  var onDoubleTapHandler = React__default['default'].useCallback(function (event) {
@@ -5156,10 +5311,10 @@ var Item = function Item(_ref5) {
5156
5311
  className: "corner top-left"
5157
5312
  }), /*#__PURE__*/React__default['default'].createElement("div", {
5158
5313
  className: "corner top-right"
5159
- }), /*#__PURE__*/React__default['default'].createElement("div", {
5160
- className: "corner bottom-left"
5161
5314
  }), /*#__PURE__*/React__default['default'].createElement("div", {
5162
5315
  className: "corner bottom-right"
5316
+ }), /*#__PURE__*/React__default['default'].createElement("div", {
5317
+ className: "corner bottom-left"
5163
5318
  }), isSelected && showResizeHandle && /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, resizeDirections.b && /*#__PURE__*/React__default['default'].createElement(ResizeHandler, {
5164
5319
  className: "resize resize-ratio",
5165
5320
  onResize: onResizeRatio
@@ -6219,154 +6374,223 @@ var ActionPane = function ActionPane(_ref) {
6219
6374
  }, children);
6220
6375
  };
6221
6376
 
6222
- function t(t, n, r) {
6223
- return Math.min(Math.max(t, r), n);
6377
+ /**
6378
+ * A simple guard function:
6379
+ *
6380
+ * ```js
6381
+ * Math.min(Math.max(low, value), high)
6382
+ * ```
6383
+ */
6384
+ function guard(low, high, value) {
6385
+ return Math.min(Math.max(low, value), high);
6224
6386
  }
6225
6387
 
6226
- var n = /*#__PURE__*/function (_Error) {
6227
- _inherits(n, _Error);
6388
+ var ColorError = /*#__PURE__*/function (_Error) {
6389
+ _inherits(ColorError, _Error);
6228
6390
 
6229
- var _super = _createSuper(n);
6391
+ var _super = _createSuper(ColorError);
6230
6392
 
6231
- function n(t) {
6232
- _classCallCheck(this, n);
6393
+ function ColorError(color) {
6394
+ _classCallCheck(this, ColorError);
6233
6395
 
6234
- return _super.call(this, "Failed to parse color: \"".concat(t, "\""));
6396
+ return _super.call(this, "Failed to parse color: \"".concat(color, "\""));
6235
6397
  }
6236
6398
 
6237
- return n;
6399
+ return ColorError;
6238
6400
  }( /*#__PURE__*/_wrapNativeSuper(Error));
6239
6401
 
6240
- function r(r) {
6241
- if ("string" != typeof r) throw new n(r);
6242
- if ("transparent" === r.trim().toLowerCase()) return [0, 0, 0, 0];
6243
- var e = r.trim();
6244
- e = u.test(r) ? function (t) {
6245
- var r = t.toLowerCase().trim(),
6246
- e = o[function (t) {
6247
- var n = 5381,
6248
- r = t.length;
6249
-
6250
- for (; r;) {
6251
- n = 33 * n ^ t.charCodeAt(--r);
6252
- }
6253
-
6254
- return (n >>> 0) % 2341;
6255
- }(r)];
6256
-
6257
- if (!e) throw new n(t);
6258
- return "#".concat(e);
6259
- }(r) : r;
6260
- var f = s.exec(e);
6261
-
6262
- if (f) {
6263
- var _t = Array.from(f).slice(1);
6402
+ var ColorError$1 = ColorError;
6403
+ /**
6404
+ * Parses a color into red, gree, blue, alpha parts
6405
+ *
6406
+ * @param color the input color. Can be a RGB, RBGA, HSL, HSLA, or named color
6407
+ */
6264
6408
 
6265
- return [].concat(_toConsumableArray(_t.slice(0, 3).map(function (t) {
6266
- return parseInt(_(t, 2), 16);
6267
- })), [parseInt(_(_t[3] || "f", 2), 16) / 255]);
6409
+ function parseToRgba(color) {
6410
+ if (typeof color !== 'string') throw new ColorError$1(color);
6411
+ if (color.trim().toLowerCase() === 'transparent') return [0, 0, 0, 0];
6412
+ var normalizedColor = color.trim();
6413
+ normalizedColor = namedColorRegex.test(color) ? nameToHex(color) : color;
6414
+ var reducedHexMatch = reducedHexRegex.exec(normalizedColor);
6415
+
6416
+ if (reducedHexMatch) {
6417
+ var arr = Array.from(reducedHexMatch).slice(1);
6418
+ return [].concat(_toConsumableArray(arr.slice(0, 3).map(function (x) {
6419
+ return parseInt(r(x, 2), 16);
6420
+ })), [parseInt(r(arr[3] || 'f', 2), 16) / 255]);
6268
6421
  }
6269
6422
 
6270
- var p = i.exec(e);
6423
+ var hexMatch = hexRegex.exec(normalizedColor);
6271
6424
 
6272
- if (p) {
6273
- var _t2 = Array.from(p).slice(1);
6425
+ if (hexMatch) {
6426
+ var _arr = Array.from(hexMatch).slice(1);
6274
6427
 
6275
- return [].concat(_toConsumableArray(_t2.slice(0, 3).map(function (t) {
6276
- return parseInt(t, 16);
6277
- })), [parseInt(_t2[3] || "ff", 16) / 255]);
6428
+ return [].concat(_toConsumableArray(_arr.slice(0, 3).map(function (x) {
6429
+ return parseInt(x, 16);
6430
+ })), [parseInt(_arr[3] || 'ff', 16) / 255]);
6278
6431
  }
6279
6432
 
6280
- var z = a.exec(e);
6433
+ var rgbaMatch = rgbaRegex.exec(normalizedColor);
6281
6434
 
6282
- if (z) {
6283
- var _t3 = Array.from(z).slice(1);
6435
+ if (rgbaMatch) {
6436
+ var _arr2 = Array.from(rgbaMatch).slice(1);
6284
6437
 
6285
- return [].concat(_toConsumableArray(_t3.slice(0, 3).map(function (t) {
6286
- return parseInt(t, 10);
6287
- })), [parseFloat(_t3[3] || "1")]);
6438
+ return [].concat(_toConsumableArray(_arr2.slice(0, 3).map(function (x) {
6439
+ return parseInt(x, 10);
6440
+ })), [parseFloat(_arr2[3] || '1')]);
6288
6441
  }
6289
6442
 
6290
- var h = c.exec(e);
6443
+ var hslaMatch = hslaRegex.exec(normalizedColor);
6291
6444
 
6292
- if (h) {
6293
- var _Array$from$slice$map = Array.from(h).slice(1).map(parseFloat),
6445
+ if (hslaMatch) {
6446
+ var _Array$from$slice$map = Array.from(hslaMatch).slice(1).map(parseFloat),
6294
6447
  _Array$from$slice$map2 = _slicedToArray(_Array$from$slice$map, 4),
6295
- _e = _Array$from$slice$map2[0],
6296
- _o = _Array$from$slice$map2[1],
6297
- _2 = _Array$from$slice$map2[2],
6298
- _s = _Array$from$slice$map2[3];
6299
-
6300
- if (t(0, 100, _o) !== _o) throw new n(r);
6301
- if (t(0, 100, _2) !== _2) throw new n(r);
6302
- return [].concat(_toConsumableArray(l(_e, _o, _2)), [_s || 1]);
6448
+ h = _Array$from$slice$map2[0],
6449
+ s = _Array$from$slice$map2[1],
6450
+ l = _Array$from$slice$map2[2],
6451
+ a = _Array$from$slice$map2[3];
6452
+
6453
+ if (guard(0, 100, s) !== s) throw new ColorError$1(color);
6454
+ if (guard(0, 100, l) !== l) throw new ColorError$1(color);
6455
+ return [].concat(_toConsumableArray(hslToRgb(h, s, l)), [a || 1]);
6303
6456
  }
6304
6457
 
6305
- throw new n(r);
6458
+ throw new ColorError$1(color);
6306
6459
  }
6307
6460
 
6308
- var e = function e(t) {
6309
- return parseInt(t.replace(/_/g, ""), 36);
6310
- },
6311
- o = "1q29ehhb 1n09sgk7 1kl1ekf_ _yl4zsno 16z9eiv3 1p29lhp8 _bd9zg04 17u0____ _iw9zhe5 _to73___ _r45e31e _7l6g016 _jh8ouiv _zn3qba8 1jy4zshs 11u87k0u 1ro9yvyo 1aj3xael 1gz9zjz0 _3w8l4xo 1bf1ekf_ _ke3v___ _4rrkb__ 13j776yz _646mbhl _nrjr4__ _le6mbhl 1n37ehkb _m75f91n _qj3bzfz 1939yygw 11i5z6x8 _1k5f8xs 1509441m 15t5lwgf _ae2th1n _tg1ugcv 1lp1ugcv 16e14up_ _h55rw7n _ny9yavn _7a11xb_ 1ih442g9 _pv442g9 1mv16xof 14e6y7tu 1oo9zkds 17d1cisi _4v9y70f _y98m8kc 1019pq0v 12o9zda8 _348j4f4 1et50i2o _8epa8__ _ts6senj 1o350i2o 1mi9eiuo 1259yrp0 1ln80gnw _632xcoy 1cn9zldc _f29edu4 1n490c8q _9f9ziet 1b94vk74 _m49zkct 1kz6s73a 1eu9dtog _q58s1rz 1dy9sjiq __u89jo3 _aj5nkwg _ld89jo3 13h9z6wx _qa9z2ii _l119xgq _bs5arju 1hj4nwk9 1qt4nwk9 1ge6wau6 14j9zlcw 11p1edc_ _ms1zcxe _439shk6 _jt9y70f _754zsow 1la40eju _oq5p___ _x279qkz 1fa5r3rv _yd2d9ip _424tcku _8y1di2_ _zi2uabw _yy7rn9h 12yz980_ __39ljp6 1b59zg0x _n39zfzp 1fy9zest _b33k___ _hp9wq92 1il50hz4 _io472ub _lj9z3eo 19z9ykg0 _8t8iu3a 12b9bl4a 1ak5yw0o _896v4ku _tb8k8lv _s59zi6t _c09ze0p 1lg80oqn 1id9z8wb _238nba5 1kq6wgdi _154zssg _tn3zk49 _da9y6tc 1sg7cv4f _r12jvtt 1gq5fmkz 1cs9rvci _lp9jn1c _xw1tdnb 13f9zje6 16f6973h _vo7ir40 _bt5arjf _rc45e4t _hr4e100 10v4e100 _hc9zke2 _w91egv_ _sj2r1kk 13c87yx8 _vqpds__ _ni8ggk8 _tj9yqfb 1ia2j4r4 _7x9b10u 1fc9ld4j 1eq9zldr _5j9lhpx _ez9zl6o _md61fzm".split(" ").reduce(function (t, n) {
6312
- var r = e(n.substring(0, 3)),
6313
- o = e(n.substring(3)).toString(16);
6314
- var _ = "";
6461
+ function hash(str) {
6462
+ var hash = 5381;
6463
+ var i = str.length;
6315
6464
 
6316
- for (var _t4 = 0; _t4 < 6 - o.length; _t4++) {
6317
- _ += "0";
6465
+ while (i) {
6466
+ hash = hash * 33 ^ str.charCodeAt(--i);
6318
6467
  }
6468
+ /* JavaScript does bitwise operations (like XOR, above) on 32-bit signed
6469
+ * integers. Since we want the results to be always positive, convert the
6470
+ * signed int to an unsigned by doing an unsigned bitshift. */
6471
+
6472
+
6473
+ return (hash >>> 0) % 2341;
6474
+ }
6319
6475
 
6320
- return t[r] = "".concat(_).concat(o), t;
6321
- }, {}),
6322
- _ = function _(t, n) {
6323
- return Array.from(Array(n)).map(function () {
6324
- return t;
6325
- }).join("");
6326
- },
6327
- s = new RegExp("^#".concat(_("([a-f0-9])", 3), "([a-f0-9])?$"), "i"),
6328
- i = new RegExp("^#".concat(_("([a-f0-9]{2})", 3), "([a-f0-9]{2})?$"), "i"),
6329
- a = new RegExp("^rgba?\\(\\s*(\\d+)\\s*".concat(_(",\\s*(\\d+)\\s*", 2), "(?:,\\s*([\\d.]+))?\\s*\\)$"), "i"),
6330
- c = /^hsla?\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%(?:\s*,\s*([\d.]+))?\s*\)$/i,
6331
- u = /^[a-z]+$/i,
6332
- f = function f(t) {
6333
- return Math.round(255 * t);
6334
- },
6335
- l = function l(t, n, r) {
6336
- var e = r / 100;
6337
- if (0 === n) return [e, e, e].map(f);
6338
-
6339
- var o = (t % 360 + 360) % 360 / 60,
6340
- _ = (1 - Math.abs(2 * e - 1)) * (n / 100),
6341
- s = _ * (1 - Math.abs(o % 2 - 1));
6342
-
6343
- var i = 0,
6344
- a = 0,
6345
- c = 0;
6346
- o >= 0 && o < 1 ? (i = _, a = s) : o >= 1 && o < 2 ? (i = s, a = _) : o >= 2 && o < 3 ? (a = _, c = s) : o >= 3 && o < 4 ? (a = s, c = _) : o >= 4 && o < 5 ? (i = s, c = _) : o >= 5 && o < 6 && (i = _, c = s);
6347
- var u = e - _ / 2;
6348
- return [i + u, a + u, c + u].map(f);
6476
+ var colorToInt = function colorToInt(x) {
6477
+ return parseInt(x.replace(/_/g, ''), 36);
6349
6478
  };
6350
6479
 
6351
- function w(t) {
6352
- if ("transparent" === t) return 0;
6480
+ var compressedColorMap = '1q29ehhb 1n09sgk7 1kl1ekf_ _yl4zsno 16z9eiv3 1p29lhp8 _bd9zg04 17u0____ _iw9zhe5 _to73___ _r45e31e _7l6g016 _jh8ouiv _zn3qba8 1jy4zshs 11u87k0u 1ro9yvyo 1aj3xael 1gz9zjz0 _3w8l4xo 1bf1ekf_ _ke3v___ _4rrkb__ 13j776yz _646mbhl _nrjr4__ _le6mbhl 1n37ehkb _m75f91n _qj3bzfz 1939yygw 11i5z6x8 _1k5f8xs 1509441m 15t5lwgf _ae2th1n _tg1ugcv 1lp1ugcv 16e14up_ _h55rw7n _ny9yavn _7a11xb_ 1ih442g9 _pv442g9 1mv16xof 14e6y7tu 1oo9zkds 17d1cisi _4v9y70f _y98m8kc 1019pq0v 12o9zda8 _348j4f4 1et50i2o _8epa8__ _ts6senj 1o350i2o 1mi9eiuo 1259yrp0 1ln80gnw _632xcoy 1cn9zldc _f29edu4 1n490c8q _9f9ziet 1b94vk74 _m49zkct 1kz6s73a 1eu9dtog _q58s1rz 1dy9sjiq __u89jo3 _aj5nkwg _ld89jo3 13h9z6wx _qa9z2ii _l119xgq _bs5arju 1hj4nwk9 1qt4nwk9 1ge6wau6 14j9zlcw 11p1edc_ _ms1zcxe _439shk6 _jt9y70f _754zsow 1la40eju _oq5p___ _x279qkz 1fa5r3rv _yd2d9ip _424tcku _8y1di2_ _zi2uabw _yy7rn9h 12yz980_ __39ljp6 1b59zg0x _n39zfzp 1fy9zest _b33k___ _hp9wq92 1il50hz4 _io472ub _lj9z3eo 19z9ykg0 _8t8iu3a 12b9bl4a 1ak5yw0o _896v4ku _tb8k8lv _s59zi6t _c09ze0p 1lg80oqn 1id9z8wb _238nba5 1kq6wgdi _154zssg _tn3zk49 _da9y6tc 1sg7cv4f _r12jvtt 1gq5fmkz 1cs9rvci _lp9jn1c _xw1tdnb 13f9zje6 16f6973h _vo7ir40 _bt5arjf _rc45e4t _hr4e100 10v4e100 _hc9zke2 _w91egv_ _sj2r1kk 13c87yx8 _vqpds__ _ni8ggk8 _tj9yqfb 1ia2j4r4 _7x9b10u 1fc9ld4j 1eq9zldr _5j9lhpx _ez9zl6o _md61fzm'.split(' ').reduce(function (acc, next) {
6481
+ var key = colorToInt(next.substring(0, 3));
6482
+ var hex = colorToInt(next.substring(3)).toString(16); // NOTE: padStart could be used here but it breaks Node 6 compat
6483
+ // https://github.com/ricokahler/color2k/issues/351
6484
+
6485
+ var prefix = '';
6353
6486
 
6354
- function n(t) {
6355
- var n = t / 255;
6356
- return n <= .03928 ? n / 12.92 : Math.pow((n + .055) / 1.055, 2.4);
6487
+ for (var i = 0; i < 6 - hex.length; i++) {
6488
+ prefix += '0';
6357
6489
  }
6358
6490
 
6359
- var _r = r(t),
6360
- _r2 = _slicedToArray(_r, 3),
6361
- e = _r2[0],
6362
- o = _r2[1],
6363
- _ = _r2[2];
6491
+ acc[key] = "".concat(prefix).concat(hex);
6492
+ return acc;
6493
+ }, {});
6494
+ /**
6495
+ * Checks if a string is a CSS named color and returns its equivalent hex value, otherwise returns the original color.
6496
+ */
6364
6497
 
6365
- return .2126 * n(e) + .7152 * n(o) + .0722 * n(_);
6498
+ function nameToHex(color) {
6499
+ var normalizedColorName = color.toLowerCase().trim();
6500
+ var result = compressedColorMap[hash(normalizedColorName)];
6501
+ if (!result) throw new ColorError$1(color);
6502
+ return "#".concat(result);
6366
6503
  }
6367
6504
 
6368
- function F(t) {
6369
- return w(t) > .179;
6505
+ var r = function r(str, amount) {
6506
+ return Array.from(Array(amount)).map(function () {
6507
+ return str;
6508
+ }).join('');
6509
+ };
6510
+
6511
+ var reducedHexRegex = new RegExp("^#".concat(r('([a-f0-9])', 3), "([a-f0-9])?$"), 'i');
6512
+ var hexRegex = new RegExp("^#".concat(r('([a-f0-9]{2})', 3), "([a-f0-9]{2})?$"), 'i');
6513
+ var rgbaRegex = new RegExp("^rgba?\\(\\s*(\\d+)\\s*".concat(r(',\\s*(\\d+)\\s*', 2), "(?:,\\s*([\\d.]+))?\\s*\\)$"), 'i');
6514
+ var hslaRegex = /^hsla?\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%(?:\s*,\s*([\d.]+))?\s*\)$/i;
6515
+ var namedColorRegex = /^[a-z]+$/i;
6516
+
6517
+ var roundColor = function roundColor(color) {
6518
+ return Math.round(color * 255);
6519
+ };
6520
+
6521
+ var hslToRgb = function hslToRgb(hue, saturation, lightness) {
6522
+ var l = lightness / 100;
6523
+
6524
+ if (saturation === 0) {
6525
+ // achromatic
6526
+ return [l, l, l].map(roundColor);
6527
+ } // formulae from https://en.wikipedia.org/wiki/HSL_and_HSV
6528
+
6529
+
6530
+ var huePrime = (hue % 360 + 360) % 360 / 60;
6531
+ var chroma = (1 - Math.abs(2 * l - 1)) * (saturation / 100);
6532
+ var secondComponent = chroma * (1 - Math.abs(huePrime % 2 - 1));
6533
+ var red = 0;
6534
+ var green = 0;
6535
+ var blue = 0;
6536
+
6537
+ if (huePrime >= 0 && huePrime < 1) {
6538
+ red = chroma;
6539
+ green = secondComponent;
6540
+ } else if (huePrime >= 1 && huePrime < 2) {
6541
+ red = secondComponent;
6542
+ green = chroma;
6543
+ } else if (huePrime >= 2 && huePrime < 3) {
6544
+ green = chroma;
6545
+ blue = secondComponent;
6546
+ } else if (huePrime >= 3 && huePrime < 4) {
6547
+ green = secondComponent;
6548
+ blue = chroma;
6549
+ } else if (huePrime >= 4 && huePrime < 5) {
6550
+ red = secondComponent;
6551
+ blue = chroma;
6552
+ } else if (huePrime >= 5 && huePrime < 6) {
6553
+ red = chroma;
6554
+ blue = secondComponent;
6555
+ }
6556
+
6557
+ var lightnessModification = l - chroma / 2;
6558
+ var finalRed = red + lightnessModification;
6559
+ var finalGreen = green + lightnessModification;
6560
+ var finalBlue = blue + lightnessModification;
6561
+ return [finalRed, finalGreen, finalBlue].map(roundColor);
6562
+ }; // taken from:
6563
+
6564
+ /**
6565
+ * Returns a number (float) representing the luminance of a color.
6566
+ */
6567
+
6568
+
6569
+ function getLuminance(color) {
6570
+ if (color === 'transparent') return 0;
6571
+
6572
+ function f(x) {
6573
+ var channel = x / 255;
6574
+ return channel <= 0.03928 ? channel / 12.92 : Math.pow((channel + 0.055) / 1.055, 2.4);
6575
+ }
6576
+
6577
+ var _parseToRgba = parseToRgba(color),
6578
+ _parseToRgba2 = _slicedToArray(_parseToRgba, 3),
6579
+ r = _parseToRgba2[0],
6580
+ g = _parseToRgba2[1],
6581
+ b = _parseToRgba2[2];
6582
+
6583
+ return 0.2126 * f(r) + 0.7152 * f(g) + 0.0722 * f(b);
6584
+ } // taken from:
6585
+ /**
6586
+ * An alternative function to `readableColor`. Returns whether or not the
6587
+ * readable color (i.e. the color to be place on top the input color) should be
6588
+ * black.
6589
+ */
6590
+
6591
+
6592
+ function readableColorIsBlack(color) {
6593
+ return getLuminance(color) > 0.179;
6370
6594
  }
6371
6595
 
6372
6596
  var _excluded$1 = ["pos"];
@@ -6387,7 +6611,7 @@ var Cursor = function Cursor(_ref3) {
6387
6611
  _ref3$size = _ref3.size,
6388
6612
  size = _ref3$size === void 0 ? 40 : _ref3$size,
6389
6613
  text = _ref3.text;
6390
- var textColor = F(color) ? "#222" : "#EEE";
6614
+ var textColor = readableColorIsBlack(color) ? "#222" : "#EEE";
6391
6615
  return /*#__PURE__*/React__default['default'].createElement(StyledCursor, null, /*#__PURE__*/React__default['default'].createElement("svg", {
6392
6616
  version: "1.1",
6393
6617
  id: "Layer_1",
@@ -8705,22 +8929,29 @@ var dayjs_min = {exports: {}};
8705
8929
  return void 0 === t;
8706
8930
  }
8707
8931
  },
8708
- D = "en",
8709
- v = {};
8932
+ v = "en",
8933
+ D = {};
8710
8934
 
8711
- v[D] = M;
8935
+ D[v] = M;
8712
8936
 
8713
8937
  var p = function p(t) {
8714
8938
  return t instanceof _;
8715
8939
  },
8716
- S = function S(t, e, n) {
8717
- var r;
8718
- if (!t) return D;
8719
- if ("string" == typeof t) v[t] && (r = t), e && (v[t] = e, r = t);else {
8720
- var i = t.name;
8721
- v[i] = t, r = i;
8940
+ S = function t(e, n, r) {
8941
+ var i;
8942
+ if (!e) return v;
8943
+
8944
+ if ("string" == typeof e) {
8945
+ var s = e.toLowerCase();
8946
+ D[s] && (i = s), n && (D[s] = n, i = s);
8947
+ var u = e.split("-");
8948
+ if (!i && u.length > 1) return t(u[0]);
8949
+ } else {
8950
+ var a = e.name;
8951
+ D[a] = e, i = a;
8722
8952
  }
8723
- return !n && r && (D = r), r || !n && D;
8953
+
8954
+ return !r && i && (v = i), i || !r && v;
8724
8955
  },
8725
8956
  w = function w(t, e) {
8726
8957
  if (p(t)) return t.clone();
@@ -8808,9 +9039,9 @@ var dayjs_min = {exports: {}};
8808
9039
  return r ? $(1, M) : $(0, M + 1);
8809
9040
 
8810
9041
  case o:
8811
- var D = this.$locale().weekStart || 0,
8812
- v = (y < D ? y + 7 : y) - D;
8813
- return $(r ? m - v : m + (6 - v), M);
9042
+ var v = this.$locale().weekStart || 0,
9043
+ D = (y < v ? y + 7 : y) - v;
9044
+ return $(r ? m - D : m + (6 - D), M);
8814
9045
 
8815
9046
  case a:
8816
9047
  case d:
@@ -8927,12 +9158,12 @@ var dayjs_min = {exports: {}};
8927
9158
  M = w(r),
8928
9159
  m = (M.utcOffset() - this.utcOffset()) * e,
8929
9160
  g = this - M,
8930
- D = O.m(this, M);
8931
- return D = (l = {}, l[c] = D / 12, l[f] = D, l[h] = D / 3, l[o] = (g - m) / 6048e5, l[a] = (g - m) / 864e5, l[u] = g / n, l[s] = g / e, l[i] = g / t, l)[y] || g, $ ? D : O.a(D);
9161
+ v = O.m(this, M);
9162
+ return v = (l = {}, l[c] = v / 12, l[f] = v, l[h] = v / 3, l[o] = (g - m) / 6048e5, l[a] = (g - m) / 864e5, l[u] = g / n, l[s] = g / e, l[i] = g / t, l)[y] || g, $ ? v : O.a(v);
8932
9163
  }, m.daysInMonth = function () {
8933
9164
  return this.endOf(f).$D;
8934
9165
  }, m.$locale = function () {
8935
- return v[this.$L];
9166
+ return D[this.$L];
8936
9167
  }, m.locale = function (t, e) {
8937
9168
  if (!t) return this.$L;
8938
9169
  var n = this.clone(),
@@ -8960,7 +9191,7 @@ var dayjs_min = {exports: {}};
8960
9191
  return t.$i || (t(e, _, w), t.$i = !0), w;
8961
9192
  }, w.locale = S, w.isDayjs = p, w.unix = function (t) {
8962
9193
  return w(1e3 * t);
8963
- }, w.en = v[D], w.Ls = v, w.p = {}, w;
9194
+ }, w.en = D[v], w.Ls = D, w.p = {}, w;
8964
9195
  });
8965
9196
  })(dayjs_min);
8966
9197