@tanstack/query-devtools 5.0.0-alpha.49 → 5.0.0-alpha.51

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.
@@ -2,6 +2,7 @@ const sharedConfig = {};
2
2
  function setHydrateContext(context) {
3
3
  sharedConfig.context = context;
4
4
  }
5
+
5
6
  const equalFn = (a, b) => a === b;
6
7
  const $PROXY = Symbol("solid-proxy");
7
8
  const $TRACK = Symbol("solid-track");
@@ -407,6 +408,7 @@ function createProvider(id, options) {
407
408
  return res;
408
409
  };
409
410
  }
411
+
410
412
  const FALLBACK$1 = Symbol("fallback");
411
413
  function dispose$1(d) {
412
414
  for (let i = 0; i < d.length; i++) d[i]();
@@ -451,7 +453,8 @@ function mapArray(list, mapFn, options = {}) {
451
453
  });
452
454
  len = 1;
453
455
  }
454
- } else if (len === 0) {
456
+ }
457
+ else if (len === 0) {
455
458
  mapped = new Array(newLen);
456
459
  for (j = 0; j < newLen; j++) {
457
460
  items[j] = newItems[j];
@@ -656,6 +659,7 @@ function mergeProps(...sources) {
656
659
  }
657
660
  return target;
658
661
  }
662
+
659
663
  function For(props) {
660
664
  const fallback = "fallback" in props && {
661
665
  fallback: () => props.fallback
@@ -737,6 +741,7 @@ const SVGNamespace = {
737
741
  xlink: "http://www.w3.org/1999/xlink",
738
742
  xml: "http://www.w3.org/XML/1998/namespace"
739
743
  };
744
+
740
745
  function reconcileArrays(parentNode, a, b) {
741
746
  let bLength = b.length,
742
747
  aEnd = a.length,
@@ -793,6 +798,7 @@ function reconcileArrays(parentNode, a, b) {
793
798
  }
794
799
  }
795
800
  }
801
+
796
802
  const $$EVENTS = "_$DX_DELEGATE";
797
803
  function render(code, element, init, options = {}) {
798
804
  let disposer;
@@ -1067,9 +1073,9 @@ function normalizeIncomingArray(normalized, array, current, unwrap) {
1067
1073
  prev = current && current[i];
1068
1074
  if (item instanceof Node) {
1069
1075
  normalized.push(item);
1070
- } else if (item == null || item === true || item === false) ;else if (Array.isArray(item)) {
1076
+ } else if (item == null || item === true || item === false) ; else if (Array.isArray(item)) {
1071
1077
  dynamic = normalizeIncomingArray(normalized, item, prev) || dynamic;
1072
- } else if (typeof item === "function") {
1078
+ } else if ((typeof item) === "function") {
1073
1079
  if (unwrap) {
1074
1080
  while (typeof item === "function") item = item();
1075
1081
  dynamic = normalizeIncomingArray(normalized, Array.isArray(item) ? item : [item], Array.isArray(prev) ? prev : [prev]) || dynamic;
@@ -1835,6 +1841,7 @@ function sheetForTag(tag) {
1835
1841
 
1836
1842
  /* istanbul ignore next */
1837
1843
 
1844
+
1838
1845
  for (var i = 0; i < document.styleSheets.length; i++) {
1839
1846
  if (document.styleSheets[i].ownerNode === tag) {
1840
1847
  // $FlowFixMe
@@ -1842,22 +1849,28 @@ function sheetForTag(tag) {
1842
1849
  }
1843
1850
  }
1844
1851
  }
1852
+
1845
1853
  function createStyleElement(options) {
1846
1854
  var tag = document.createElement('style');
1847
1855
  tag.setAttribute('data-emotion', options.key);
1856
+
1848
1857
  if (options.nonce !== undefined) {
1849
1858
  tag.setAttribute('nonce', options.nonce);
1850
1859
  }
1860
+
1851
1861
  tag.appendChild(document.createTextNode(''));
1852
1862
  tag.setAttribute('data-s', '');
1853
1863
  return tag;
1854
1864
  }
1865
+
1855
1866
  var StyleSheet = /*#__PURE__*/function () {
1856
1867
  // Using Node instead of HTMLElement since container may be a ShadowRoot
1857
1868
  function StyleSheet(options) {
1858
1869
  var _this = this;
1870
+
1859
1871
  this._insertTag = function (tag) {
1860
1872
  var before;
1873
+
1861
1874
  if (_this.tags.length === 0) {
1862
1875
  if (_this.insertionPoint) {
1863
1876
  before = _this.insertionPoint.nextSibling;
@@ -1869,9 +1882,12 @@ var StyleSheet = /*#__PURE__*/function () {
1869
1882
  } else {
1870
1883
  before = _this.tags[_this.tags.length - 1].nextSibling;
1871
1884
  }
1885
+
1872
1886
  _this.container.insertBefore(tag, before);
1887
+
1873
1888
  _this.tags.push(tag);
1874
1889
  };
1890
+
1875
1891
  this.isSpeedy = options.speedy === undefined ? process.env.NODE_ENV === 'production' : options.speedy;
1876
1892
  this.tags = [];
1877
1893
  this.ctr = 0;
@@ -1883,10 +1899,13 @@ var StyleSheet = /*#__PURE__*/function () {
1883
1899
  this.insertionPoint = options.insertionPoint;
1884
1900
  this.before = null;
1885
1901
  }
1902
+
1886
1903
  var _proto = StyleSheet.prototype;
1904
+
1887
1905
  _proto.hydrate = function hydrate(nodes) {
1888
1906
  nodes.forEach(this._insertTag);
1889
1907
  };
1908
+
1890
1909
  _proto.insert = function insert(rule) {
1891
1910
  // the max length is how many rules we have per style tag, it's 65000 in speedy mode
1892
1911
  // it's 1 in dev because we insert source maps that map a single rule to a location
@@ -1894,9 +1913,12 @@ var StyleSheet = /*#__PURE__*/function () {
1894
1913
  if (this.ctr % (this.isSpeedy ? 65000 : 1) === 0) {
1895
1914
  this._insertTag(createStyleElement(this));
1896
1915
  }
1916
+
1897
1917
  var tag = this.tags[this.tags.length - 1];
1918
+
1898
1919
  if (process.env.NODE_ENV !== 'production') {
1899
1920
  var isImportRule = rule.charCodeAt(0) === 64 && rule.charCodeAt(1) === 105;
1921
+
1900
1922
  if (isImportRule && this._alreadyInsertedOrderInsensitiveRule) {
1901
1923
  // this would only cause problem in speedy mode
1902
1924
  // but we don't want enabling speedy to affect the observable behavior
@@ -1905,8 +1927,10 @@ var StyleSheet = /*#__PURE__*/function () {
1905
1927
  }
1906
1928
  this._alreadyInsertedOrderInsensitiveRule = this._alreadyInsertedOrderInsensitiveRule || !isImportRule;
1907
1929
  }
1930
+
1908
1931
  if (this.isSpeedy) {
1909
1932
  var sheet = sheetForTag(tag);
1933
+
1910
1934
  try {
1911
1935
  // this is the ultrafast version, works across browsers
1912
1936
  // the big drawback is that the css won't be editable in devtools
@@ -1919,8 +1943,10 @@ var StyleSheet = /*#__PURE__*/function () {
1919
1943
  } else {
1920
1944
  tag.appendChild(document.createTextNode(rule));
1921
1945
  }
1946
+
1922
1947
  this.ctr++;
1923
1948
  };
1949
+
1924
1950
  _proto.flush = function flush() {
1925
1951
  // $FlowFixMe
1926
1952
  this.tags.forEach(function (tag) {
@@ -1928,16 +1954,19 @@ var StyleSheet = /*#__PURE__*/function () {
1928
1954
  });
1929
1955
  this.tags = [];
1930
1956
  this.ctr = 0;
1957
+
1931
1958
  if (process.env.NODE_ENV !== 'production') {
1932
1959
  this._alreadyInsertedOrderInsensitiveRule = false;
1933
1960
  }
1934
1961
  };
1962
+
1935
1963
  return StyleSheet;
1936
1964
  }();
1937
1965
 
1938
1966
  var MS = '-ms-';
1939
1967
  var MOZ = '-moz-';
1940
1968
  var WEBKIT = '-webkit-';
1969
+
1941
1970
  var COMMENT = 'comm';
1942
1971
  var RULESET = 'rule';
1943
1972
  var DECLARATION = 'decl';
@@ -1968,16 +1997,16 @@ var assign = Object.assign;
1968
1997
  * @param {number} length
1969
1998
  * @return {number}
1970
1999
  */
1971
- function hash(value, length) {
1972
- return charat(value, 0) ^ 45 ? (((length << 2 ^ charat(value, 0)) << 2 ^ charat(value, 1)) << 2 ^ charat(value, 2)) << 2 ^ charat(value, 3) : 0;
2000
+ function hash (value, length) {
2001
+ return charat(value, 0) ^ 45 ? (((((((length << 2) ^ charat(value, 0)) << 2) ^ charat(value, 1)) << 2) ^ charat(value, 2)) << 2) ^ charat(value, 3) : 0
1973
2002
  }
1974
2003
 
1975
2004
  /**
1976
2005
  * @param {string} value
1977
2006
  * @return {string}
1978
2007
  */
1979
- function trim(value) {
1980
- return value.trim();
2008
+ function trim (value) {
2009
+ return value.trim()
1981
2010
  }
1982
2011
 
1983
2012
  /**
@@ -1985,8 +2014,8 @@ function trim(value) {
1985
2014
  * @param {RegExp} pattern
1986
2015
  * @return {string?}
1987
2016
  */
1988
- function match(value, pattern) {
1989
- return (value = pattern.exec(value)) ? value[0] : value;
2017
+ function match (value, pattern) {
2018
+ return (value = pattern.exec(value)) ? value[0] : value
1990
2019
  }
1991
2020
 
1992
2021
  /**
@@ -1995,8 +2024,8 @@ function match(value, pattern) {
1995
2024
  * @param {string} replacement
1996
2025
  * @return {string}
1997
2026
  */
1998
- function replace(value, pattern, replacement) {
1999
- return value.replace(pattern, replacement);
2027
+ function replace (value, pattern, replacement) {
2028
+ return value.replace(pattern, replacement)
2000
2029
  }
2001
2030
 
2002
2031
  /**
@@ -2004,8 +2033,8 @@ function replace(value, pattern, replacement) {
2004
2033
  * @param {string} search
2005
2034
  * @return {number}
2006
2035
  */
2007
- function indexof(value, search) {
2008
- return value.indexOf(search);
2036
+ function indexof (value, search) {
2037
+ return value.indexOf(search)
2009
2038
  }
2010
2039
 
2011
2040
  /**
@@ -2013,8 +2042,8 @@ function indexof(value, search) {
2013
2042
  * @param {number} index
2014
2043
  * @return {number}
2015
2044
  */
2016
- function charat(value, index) {
2017
- return value.charCodeAt(index) | 0;
2045
+ function charat (value, index) {
2046
+ return value.charCodeAt(index) | 0
2018
2047
  }
2019
2048
 
2020
2049
  /**
@@ -2023,24 +2052,24 @@ function charat(value, index) {
2023
2052
  * @param {number} end
2024
2053
  * @return {string}
2025
2054
  */
2026
- function substr(value, begin, end) {
2027
- return value.slice(begin, end);
2055
+ function substr (value, begin, end) {
2056
+ return value.slice(begin, end)
2028
2057
  }
2029
2058
 
2030
2059
  /**
2031
2060
  * @param {string} value
2032
2061
  * @return {number}
2033
2062
  */
2034
- function strlen(value) {
2035
- return value.length;
2063
+ function strlen (value) {
2064
+ return value.length
2036
2065
  }
2037
2066
 
2038
2067
  /**
2039
2068
  * @param {any[]} value
2040
2069
  * @return {number}
2041
2070
  */
2042
- function sizeof(value) {
2043
- return value.length;
2071
+ function sizeof (value) {
2072
+ return value.length
2044
2073
  }
2045
2074
 
2046
2075
  /**
@@ -2048,8 +2077,8 @@ function sizeof(value) {
2048
2077
  * @param {any[]} array
2049
2078
  * @return {any}
2050
2079
  */
2051
- function append(value, array) {
2052
- return array.push(value), value;
2080
+ function append (value, array) {
2081
+ return array.push(value), value
2053
2082
  }
2054
2083
 
2055
2084
  /**
@@ -2057,8 +2086,8 @@ function append(value, array) {
2057
2086
  * @param {function} callback
2058
2087
  * @return {string}
2059
2088
  */
2060
- function combine(array, callback) {
2061
- return array.map(callback).join('');
2089
+ function combine (array, callback) {
2090
+ return array.map(callback).join('')
2062
2091
  }
2063
2092
 
2064
2093
  var line = 1;
@@ -2077,19 +2106,8 @@ var characters = '';
2077
2106
  * @param {object[] | string} children
2078
2107
  * @param {number} length
2079
2108
  */
2080
- function node(value, root, parent, type, props, children, length) {
2081
- return {
2082
- value: value,
2083
- root: root,
2084
- parent: parent,
2085
- type: type,
2086
- props: props,
2087
- children: children,
2088
- line: line,
2089
- column: column,
2090
- length: length,
2091
- return: ''
2092
- };
2109
+ function node (value, root, parent, type, props, children, length) {
2110
+ return {value: value, root: root, parent: parent, type: type, props: props, children: children, line: line, column: column, length: length, return: ''}
2093
2111
  }
2094
2112
 
2095
2113
  /**
@@ -2097,49 +2115,53 @@ function node(value, root, parent, type, props, children, length) {
2097
2115
  * @param {object} props
2098
2116
  * @return {object}
2099
2117
  */
2100
- function copy$1(root, props) {
2101
- return assign(node('', null, null, '', null, null, 0), root, {
2102
- length: -root.length
2103
- }, props);
2118
+ function copy$1 (root, props) {
2119
+ return assign(node('', null, null, '', null, null, 0), root, {length: -root.length}, props)
2104
2120
  }
2105
2121
 
2106
2122
  /**
2107
2123
  * @return {number}
2108
2124
  */
2109
- function char() {
2110
- return character;
2125
+ function char () {
2126
+ return character
2111
2127
  }
2112
2128
 
2113
2129
  /**
2114
2130
  * @return {number}
2115
2131
  */
2116
- function prev() {
2117
- character = position > 0 ? charat(characters, --position) : 0;
2118
- if (column--, character === 10) column = 1, line--;
2119
- return character;
2132
+ function prev () {
2133
+ character = position > 0 ? charat(characters, --position) : 0;
2134
+
2135
+ if (column--, character === 10)
2136
+ column = 1, line--;
2137
+
2138
+ return character
2120
2139
  }
2121
2140
 
2122
2141
  /**
2123
2142
  * @return {number}
2124
2143
  */
2125
- function next() {
2126
- character = position < length ? charat(characters, position++) : 0;
2127
- if (column++, character === 10) column = 1, line++;
2128
- return character;
2144
+ function next () {
2145
+ character = position < length ? charat(characters, position++) : 0;
2146
+
2147
+ if (column++, character === 10)
2148
+ column = 1, line++;
2149
+
2150
+ return character
2129
2151
  }
2130
2152
 
2131
2153
  /**
2132
2154
  * @return {number}
2133
2155
  */
2134
- function peek() {
2135
- return charat(characters, position);
2156
+ function peek () {
2157
+ return charat(characters, position)
2136
2158
  }
2137
2159
 
2138
2160
  /**
2139
2161
  * @return {number}
2140
2162
  */
2141
- function caret() {
2142
- return position;
2163
+ function caret () {
2164
+ return position
2143
2165
  }
2144
2166
 
2145
2167
  /**
@@ -2147,84 +2169,74 @@ function caret() {
2147
2169
  * @param {number} end
2148
2170
  * @return {string}
2149
2171
  */
2150
- function slice(begin, end) {
2151
- return substr(characters, begin, end);
2172
+ function slice (begin, end) {
2173
+ return substr(characters, begin, end)
2152
2174
  }
2153
2175
 
2154
2176
  /**
2155
2177
  * @param {number} type
2156
2178
  * @return {number}
2157
2179
  */
2158
- function token(type) {
2159
- switch (type) {
2160
- // \0 \t \n \r \s whitespace token
2161
- case 0:
2162
- case 9:
2163
- case 10:
2164
- case 13:
2165
- case 32:
2166
- return 5;
2167
- // ! + , / > @ ~ isolate token
2168
- case 33:
2169
- case 43:
2170
- case 44:
2171
- case 47:
2172
- case 62:
2173
- case 64:
2174
- case 126:
2175
- // ; { } breakpoint token
2176
- case 59:
2177
- case 123:
2178
- case 125:
2179
- return 4;
2180
- // : accompanied token
2181
- case 58:
2182
- return 3;
2183
- // " ' ( [ opening delimit token
2184
- case 34:
2185
- case 39:
2186
- case 40:
2187
- case 91:
2188
- return 2;
2189
- // ) ] closing delimit token
2190
- case 41:
2191
- case 93:
2192
- return 1;
2193
- }
2194
- return 0;
2180
+ function token (type) {
2181
+ switch (type) {
2182
+ // \0 \t \n \r \s whitespace token
2183
+ case 0: case 9: case 10: case 13: case 32:
2184
+ return 5
2185
+ // ! + , / > @ ~ isolate token
2186
+ case 33: case 43: case 44: case 47: case 62: case 64: case 126:
2187
+ // ; { } breakpoint token
2188
+ case 59: case 123: case 125:
2189
+ return 4
2190
+ // : accompanied token
2191
+ case 58:
2192
+ return 3
2193
+ // " ' ( [ opening delimit token
2194
+ case 34: case 39: case 40: case 91:
2195
+ return 2
2196
+ // ) ] closing delimit token
2197
+ case 41: case 93:
2198
+ return 1
2199
+ }
2200
+
2201
+ return 0
2195
2202
  }
2196
2203
 
2197
2204
  /**
2198
2205
  * @param {string} value
2199
2206
  * @return {any[]}
2200
2207
  */
2201
- function alloc(value) {
2202
- return line = column = 1, length = strlen(characters = value), position = 0, [];
2208
+ function alloc (value) {
2209
+ return line = column = 1, length = strlen(characters = value), position = 0, []
2203
2210
  }
2204
2211
 
2205
2212
  /**
2206
2213
  * @param {any} value
2207
2214
  * @return {any}
2208
2215
  */
2209
- function dealloc(value) {
2210
- return characters = '', value;
2216
+ function dealloc (value) {
2217
+ return characters = '', value
2211
2218
  }
2212
2219
 
2213
2220
  /**
2214
2221
  * @param {number} type
2215
2222
  * @return {string}
2216
2223
  */
2217
- function delimit(type) {
2218
- return trim(slice(position - 1, delimiter(type === 91 ? type + 2 : type === 40 ? type + 1 : type)));
2224
+ function delimit (type) {
2225
+ return trim(slice(position - 1, delimiter(type === 91 ? type + 2 : type === 40 ? type + 1 : type)))
2219
2226
  }
2220
2227
 
2221
2228
  /**
2222
2229
  * @param {number} type
2223
2230
  * @return {string}
2224
2231
  */
2225
- function whitespace(type) {
2226
- while (character = peek()) if (character < 33) next();else break;
2227
- return token(type) > 2 || token(character) > 3 ? '' : ' ';
2232
+ function whitespace (type) {
2233
+ while (character = peek())
2234
+ if (character < 33)
2235
+ next();
2236
+ else
2237
+ break
2238
+
2239
+ return token(type) > 2 || token(character) > 3 ? '' : ' '
2228
2240
  }
2229
2241
 
2230
2242
  /**
@@ -2232,37 +2244,42 @@ function whitespace(type) {
2232
2244
  * @param {number} count
2233
2245
  * @return {string}
2234
2246
  */
2235
- function escaping(index, count) {
2236
- while (--count && next())
2237
- // not 0-9 A-F a-f
2238
- if (character < 48 || character > 102 || character > 57 && character < 65 || character > 70 && character < 97) break;
2239
- return slice(index, caret() + (count < 6 && peek() == 32 && next() == 32));
2247
+ function escaping (index, count) {
2248
+ while (--count && next())
2249
+ // not 0-9 A-F a-f
2250
+ if (character < 48 || character > 102 || (character > 57 && character < 65) || (character > 70 && character < 97))
2251
+ break
2252
+
2253
+ return slice(index, caret() + (count < 6 && peek() == 32 && next() == 32))
2240
2254
  }
2241
2255
 
2242
2256
  /**
2243
2257
  * @param {number} type
2244
2258
  * @return {number}
2245
2259
  */
2246
- function delimiter(type) {
2247
- while (next()) switch (character) {
2248
- // ] ) " '
2249
- case type:
2250
- return position;
2251
- // " '
2252
- case 34:
2253
- case 39:
2254
- if (type !== 34 && type !== 39) delimiter(character);
2255
- break;
2256
- // (
2257
- case 40:
2258
- if (type === 41) delimiter(type);
2259
- break;
2260
- // \
2261
- case 92:
2262
- next();
2263
- break;
2264
- }
2265
- return position;
2260
+ function delimiter (type) {
2261
+ while (next())
2262
+ switch (character) {
2263
+ // ] ) " '
2264
+ case type:
2265
+ return position
2266
+ // " '
2267
+ case 34: case 39:
2268
+ if (type !== 34 && type !== 39)
2269
+ delimiter(character);
2270
+ break
2271
+ // (
2272
+ case 40:
2273
+ if (type === 41)
2274
+ delimiter(type);
2275
+ break
2276
+ // \
2277
+ case 92:
2278
+ next();
2279
+ break
2280
+ }
2281
+
2282
+ return position
2266
2283
  }
2267
2284
 
2268
2285
  /**
@@ -2270,30 +2287,35 @@ function delimiter(type) {
2270
2287
  * @param {number} index
2271
2288
  * @return {number}
2272
2289
  */
2273
- function commenter(type, index) {
2274
- while (next())
2275
- // //
2276
- if (type + character === 47 + 10) break;
2277
- // /*
2278
- else if (type + character === 42 + 42 && peek() === 47) break;
2279
- return '/*' + slice(index, position - 1) + '*' + from(type === 47 ? type : next());
2290
+ function commenter (type, index) {
2291
+ while (next())
2292
+ // //
2293
+ if (type + character === 47 + 10)
2294
+ break
2295
+ // /*
2296
+ else if (type + character === 42 + 42 && peek() === 47)
2297
+ break
2298
+
2299
+ return '/*' + slice(index, position - 1) + '*' + from(type === 47 ? type : next())
2280
2300
  }
2281
2301
 
2282
2302
  /**
2283
2303
  * @param {number} index
2284
2304
  * @return {string}
2285
2305
  */
2286
- function identifier(index) {
2287
- while (!token(peek())) next();
2288
- return slice(index, position);
2306
+ function identifier (index) {
2307
+ while (!token(peek()))
2308
+ next();
2309
+
2310
+ return slice(index, position)
2289
2311
  }
2290
2312
 
2291
2313
  /**
2292
2314
  * @param {string} value
2293
2315
  * @return {object[]}
2294
2316
  */
2295
- function compile(value) {
2296
- return dealloc(parse('', null, null, null, [''], value = alloc(value), 0, [0], value));
2317
+ function compile (value) {
2318
+ return dealloc(parse('', null, null, null, [''], value = alloc(value), 0, [0], value))
2297
2319
  }
2298
2320
 
2299
2321
  /**
@@ -2308,120 +2330,124 @@ function compile(value) {
2308
2330
  * @param {string[]} declarations
2309
2331
  * @return {object}
2310
2332
  */
2311
- function parse(value, root, parent, rule, rules, rulesets, pseudo, points, declarations) {
2312
- var index = 0;
2313
- var offset = 0;
2314
- var length = pseudo;
2315
- var atrule = 0;
2316
- var property = 0;
2317
- var previous = 0;
2318
- var variable = 1;
2319
- var scanning = 1;
2320
- var ampersand = 1;
2321
- var character = 0;
2322
- var type = '';
2323
- var props = rules;
2324
- var children = rulesets;
2325
- var reference = rule;
2326
- var characters = type;
2327
- while (scanning) switch (previous = character, character = next()) {
2328
- // (
2329
- case 40:
2330
- if (previous != 108 && charat(characters, length - 1) == 58) {
2331
- if (indexof(characters += replace(delimit(character), '&', '&\f'), '&\f') != -1) ampersand = -1;
2332
- break;
2333
- }
2334
- // " ' [
2335
- case 34:
2336
- case 39:
2337
- case 91:
2338
- characters += delimit(character);
2339
- break;
2340
- // \t \n \r \s
2341
- case 9:
2342
- case 10:
2343
- case 13:
2344
- case 32:
2345
- characters += whitespace(previous);
2346
- break;
2347
- // \
2348
- case 92:
2349
- characters += escaping(caret() - 1, 7);
2350
- continue;
2351
- // /
2352
- case 47:
2353
- switch (peek()) {
2354
- case 42:
2355
- case 47:
2356
- append(comment(commenter(next(), caret()), root, parent), declarations);
2357
- break;
2358
- default:
2359
- characters += '/';
2360
- }
2361
- break;
2362
- // {
2363
- case 123 * variable:
2364
- points[index++] = strlen(characters) * ampersand;
2365
- // } ; \0
2366
- case 125 * variable:
2367
- case 59:
2368
- case 0:
2369
- switch (character) {
2370
- // \0 }
2371
- case 0:
2372
- case 125:
2373
- scanning = 0;
2374
- // ;
2375
- case 59 + offset:
2376
- if (ampersand == -1) characters = replace(characters, /\f/g, '');
2377
- if (property > 0 && strlen(characters) - length) append(property > 32 ? declaration(characters + ';', rule, parent, length - 1) : declaration(replace(characters, ' ', '') + ';', rule, parent, length - 2), declarations);
2378
- break;
2379
- // @ ;
2380
- case 59:
2381
- characters += ';';
2382
- // { rule/at-rule
2383
- default:
2384
- append(reference = ruleset(characters, root, parent, index, offset, rules, points, type, props = [], children = [], length), rulesets);
2385
- if (character === 123) if (offset === 0) parse(characters, root, reference, reference, props, rulesets, length, points, children);else switch (atrule === 99 && charat(characters, 3) === 110 ? 100 : atrule) {
2386
- // d l m s
2387
- case 100:
2388
- case 108:
2389
- case 109:
2390
- case 115:
2391
- 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);
2392
- break;
2393
- default:
2394
- parse(characters, reference, reference, reference, [''], children, 0, points, children);
2395
- }
2396
- }
2397
- index = offset = property = 0, variable = ampersand = 1, type = characters = '', length = pseudo;
2398
- break;
2399
- // :
2400
- case 58:
2401
- length = 1 + strlen(characters), property = previous;
2402
- default:
2403
- if (variable < 1) if (character == 123) --variable;else if (character == 125 && variable++ == 0 && prev() == 125) continue;
2404
- switch (characters += from(character), character * variable) {
2405
- // &
2406
- case 38:
2407
- ampersand = offset > 0 ? 1 : (characters += '\f', -1);
2408
- break;
2409
- // ,
2410
- case 44:
2411
- points[index++] = (strlen(characters) - 1) * ampersand, ampersand = 1;
2412
- break;
2413
- // @
2414
- case 64:
2415
- // -
2416
- if (peek() === 45) characters += delimit(next());
2417
- atrule = peek(), offset = length = strlen(type = characters += identifier(caret())), character++;
2418
- break;
2419
- // -
2420
- case 45:
2421
- if (previous === 45 && strlen(characters) == 2) variable = 0;
2422
- }
2423
- }
2424
- return rulesets;
2333
+ function parse (value, root, parent, rule, rules, rulesets, pseudo, points, declarations) {
2334
+ var index = 0;
2335
+ var offset = 0;
2336
+ var length = pseudo;
2337
+ var atrule = 0;
2338
+ var property = 0;
2339
+ var previous = 0;
2340
+ var variable = 1;
2341
+ var scanning = 1;
2342
+ var ampersand = 1;
2343
+ var character = 0;
2344
+ var type = '';
2345
+ var props = rules;
2346
+ var children = rulesets;
2347
+ var reference = rule;
2348
+ var characters = type;
2349
+
2350
+ while (scanning)
2351
+ switch (previous = character, character = next()) {
2352
+ // (
2353
+ case 40:
2354
+ if (previous != 108 && charat(characters, length - 1) == 58) {
2355
+ if (indexof(characters += replace(delimit(character), '&', '&\f'), '&\f') != -1)
2356
+ ampersand = -1;
2357
+ break
2358
+ }
2359
+ // " ' [
2360
+ case 34: case 39: case 91:
2361
+ characters += delimit(character);
2362
+ break
2363
+ // \t \n \r \s
2364
+ case 9: case 10: case 13: case 32:
2365
+ characters += whitespace(previous);
2366
+ break
2367
+ // \
2368
+ case 92:
2369
+ characters += escaping(caret() - 1, 7);
2370
+ continue
2371
+ // /
2372
+ case 47:
2373
+ switch (peek()) {
2374
+ case 42: case 47:
2375
+ append(comment(commenter(next(), caret()), root, parent), declarations);
2376
+ break
2377
+ default:
2378
+ characters += '/';
2379
+ }
2380
+ break
2381
+ // {
2382
+ case 123 * variable:
2383
+ points[index++] = strlen(characters) * ampersand;
2384
+ // } ; \0
2385
+ case 125 * variable: case 59: case 0:
2386
+ switch (character) {
2387
+ // \0 }
2388
+ case 0: case 125: scanning = 0;
2389
+ // ;
2390
+ case 59 + offset: if (ampersand == -1) characters = replace(characters, /\f/g, '');
2391
+ if (property > 0 && (strlen(characters) - length))
2392
+ append(property > 32 ? declaration(characters + ';', rule, parent, length - 1) : declaration(replace(characters, ' ', '') + ';', rule, parent, length - 2), declarations);
2393
+ break
2394
+ // @ ;
2395
+ case 59: characters += ';';
2396
+ // { rule/at-rule
2397
+ default:
2398
+ append(reference = ruleset(characters, root, parent, index, offset, rules, points, type, props = [], children = [], length), rulesets);
2399
+
2400
+ if (character === 123)
2401
+ if (offset === 0)
2402
+ parse(characters, root, reference, reference, props, rulesets, length, points, children);
2403
+ else
2404
+ switch (atrule === 99 && charat(characters, 3) === 110 ? 100 : atrule) {
2405
+ // d l m s
2406
+ case 100: case 108: case 109: case 115:
2407
+ 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);
2408
+ break
2409
+ default:
2410
+ parse(characters, reference, reference, reference, [''], children, 0, points, children);
2411
+ }
2412
+ }
2413
+
2414
+ index = offset = property = 0, variable = ampersand = 1, type = characters = '', length = pseudo;
2415
+ break
2416
+ // :
2417
+ case 58:
2418
+ length = 1 + strlen(characters), property = previous;
2419
+ default:
2420
+ if (variable < 1)
2421
+ if (character == 123)
2422
+ --variable;
2423
+ else if (character == 125 && variable++ == 0 && prev() == 125)
2424
+ continue
2425
+
2426
+ switch (characters += from(character), character * variable) {
2427
+ // &
2428
+ case 38:
2429
+ ampersand = offset > 0 ? 1 : (characters += '\f', -1);
2430
+ break
2431
+ // ,
2432
+ case 44:
2433
+ points[index++] = (strlen(characters) - 1) * ampersand, ampersand = 1;
2434
+ break
2435
+ // @
2436
+ case 64:
2437
+ // -
2438
+ if (peek() === 45)
2439
+ characters += delimit(next());
2440
+
2441
+ atrule = peek(), offset = length = strlen(type = characters += identifier(caret())), character++;
2442
+ break
2443
+ // -
2444
+ case 45:
2445
+ if (previous === 45 && strlen(characters) == 2)
2446
+ variable = 0;
2447
+ }
2448
+ }
2449
+
2450
+ return rulesets
2425
2451
  }
2426
2452
 
2427
2453
  /**
@@ -2438,12 +2464,17 @@ function parse(value, root, parent, rule, rules, rulesets, pseudo, points, decla
2438
2464
  * @param {number} length
2439
2465
  * @return {object}
2440
2466
  */
2441
- function ruleset(value, root, parent, index, offset, rules, points, type, props, children, length) {
2442
- var post = offset - 1;
2443
- var rule = offset === 0 ? rules : [''];
2444
- var size = sizeof(rule);
2445
- for (var i = 0, j = 0, k = 0; i < index; ++i) for (var x = 0, y = substr(value, post + 1, post = abs(j = points[i])), z = value; x < size; ++x) if (z = trim(j > 0 ? rule[x] + ' ' + y : replace(y, /&\f/g, rule[x]))) props[k++] = z;
2446
- return node(value, root, parent, offset === 0 ? RULESET : type, props, children, length);
2467
+ function ruleset (value, root, parent, index, offset, rules, points, type, props, children, length) {
2468
+ var post = offset - 1;
2469
+ var rule = offset === 0 ? rules : [''];
2470
+ var size = sizeof(rule);
2471
+
2472
+ for (var i = 0, j = 0, k = 0; i < index; ++i)
2473
+ for (var x = 0, y = substr(value, post + 1, post = abs(j = points[i])), z = value; x < size; ++x)
2474
+ if (z = trim(j > 0 ? rule[x] + ' ' + y : replace(y, /&\f/g, rule[x])))
2475
+ props[k++] = z;
2476
+
2477
+ return node(value, root, parent, offset === 0 ? RULESET : type, props, children, length)
2447
2478
  }
2448
2479
 
2449
2480
  /**
@@ -2452,8 +2483,8 @@ function ruleset(value, root, parent, index, offset, rules, points, type, props,
2452
2483
  * @param {object?} parent
2453
2484
  * @return {object}
2454
2485
  */
2455
- function comment(value, root, parent) {
2456
- return node(value, root, parent, COMMENT, from(char()), substr(value, 2, -2), 0);
2486
+ function comment (value, root, parent) {
2487
+ return node(value, root, parent, COMMENT, from(char()), substr(value, 2, -2), 0)
2457
2488
  }
2458
2489
 
2459
2490
  /**
@@ -2463,8 +2494,8 @@ function comment(value, root, parent) {
2463
2494
  * @param {number} length
2464
2495
  * @return {object}
2465
2496
  */
2466
- function declaration(value, root, parent, length) {
2467
- return node(value, root, parent, DECLARATION, substr(value, 0, length), substr(value, length + 1, -1), length);
2497
+ function declaration (value, root, parent, length) {
2498
+ return node(value, root, parent, DECLARATION, substr(value, 0, length), substr(value, length + 1, -1), length)
2468
2499
  }
2469
2500
 
2470
2501
  /**
@@ -2472,11 +2503,14 @@ function declaration(value, root, parent, length) {
2472
2503
  * @param {function} callback
2473
2504
  * @return {string}
2474
2505
  */
2475
- function serialize$1(children, callback) {
2476
- var output = '';
2477
- var length = sizeof(children);
2478
- for (var i = 0; i < length; i++) output += callback(children[i], i, children, callback) || '';
2479
- return output;
2506
+ function serialize$1 (children, callback) {
2507
+ var output = '';
2508
+ var length = sizeof(children);
2509
+
2510
+ for (var i = 0; i < length; i++)
2511
+ output += callback(children[i], i, children, callback) || '';
2512
+
2513
+ return output
2480
2514
  }
2481
2515
 
2482
2516
  /**
@@ -2486,44 +2520,45 @@ function serialize$1(children, callback) {
2486
2520
  * @param {function} callback
2487
2521
  * @return {string}
2488
2522
  */
2489
- function stringify$1(element, index, children, callback) {
2490
- switch (element.type) {
2491
- case LAYER:
2492
- if (element.children.length) break;
2493
- case IMPORT:
2494
- case DECLARATION:
2495
- return element.return = element.return || element.value;
2496
- case COMMENT:
2497
- return '';
2498
- case KEYFRAMES:
2499
- return element.return = element.value + '{' + serialize$1(element.children, callback) + '}';
2500
- case RULESET:
2501
- element.value = element.props.join(',');
2502
- }
2503
- return strlen(children = serialize$1(element.children, callback)) ? element.return = element.value + '{' + children + '}' : '';
2523
+ function stringify$1 (element, index, children, callback) {
2524
+ switch (element.type) {
2525
+ case LAYER: if (element.children.length) break
2526
+ case IMPORT: case DECLARATION: return element.return = element.return || element.value
2527
+ case COMMENT: return ''
2528
+ case KEYFRAMES: return element.return = element.value + '{' + serialize$1(element.children, callback) + '}'
2529
+ case RULESET: element.value = element.props.join(',');
2530
+ }
2531
+
2532
+ return strlen(children = serialize$1(element.children, callback)) ? element.return = element.value + '{' + children + '}' : ''
2504
2533
  }
2505
2534
 
2506
2535
  /**
2507
2536
  * @param {function[]} collection
2508
2537
  * @return {function}
2509
2538
  */
2510
- function middleware(collection) {
2511
- var length = sizeof(collection);
2512
- return function (element, index, children, callback) {
2513
- var output = '';
2514
- for (var i = 0; i < length; i++) output += collection[i](element, index, children, callback) || '';
2515
- return output;
2516
- };
2539
+ function middleware (collection) {
2540
+ var length = sizeof(collection);
2541
+
2542
+ return function (element, index, children, callback) {
2543
+ var output = '';
2544
+
2545
+ for (var i = 0; i < length; i++)
2546
+ output += collection[i](element, index, children, callback) || '';
2547
+
2548
+ return output
2549
+ }
2517
2550
  }
2518
2551
 
2519
2552
  /**
2520
2553
  * @param {function} callback
2521
2554
  * @return {function}
2522
2555
  */
2523
- function rulesheet(callback) {
2524
- return function (element) {
2525
- if (!element.root) if (element = element.return) callback(element);
2526
- };
2556
+ function rulesheet (callback) {
2557
+ return function (element) {
2558
+ if (!element.root)
2559
+ if (element = element.return)
2560
+ callback(element);
2561
+ }
2527
2562
  }
2528
2563
 
2529
2564
  var weakMemoize = function weakMemoize(func) {
@@ -2534,6 +2569,7 @@ var weakMemoize = function weakMemoize(func) {
2534
2569
  // $FlowFixMe
2535
2570
  return cache.get(arg);
2536
2571
  }
2572
+
2537
2573
  var ret = func(arg);
2538
2574
  cache.set(arg, ret);
2539
2575
  return ret;
@@ -2551,6 +2587,7 @@ function memoize(fn) {
2551
2587
  var identifierWithPointTracking = function identifierWithPointTracking(begin, points, index) {
2552
2588
  var previous = 0;
2553
2589
  var character = 0;
2590
+
2554
2591
  while (true) {
2555
2592
  previous = character;
2556
2593
  character = peek(); // &\f
@@ -2558,17 +2595,22 @@ var identifierWithPointTracking = function identifierWithPointTracking(begin, po
2558
2595
  if (previous === 38 && character === 12) {
2559
2596
  points[index] = 1;
2560
2597
  }
2598
+
2561
2599
  if (token(character)) {
2562
2600
  break;
2563
2601
  }
2602
+
2564
2603
  next();
2565
2604
  }
2605
+
2566
2606
  return slice(begin, position);
2567
2607
  };
2608
+
2568
2609
  var toRules = function toRules(parsed, points) {
2569
2610
  // pretend we've started with a comma
2570
2611
  var index = -1;
2571
2612
  var character = 44;
2613
+
2572
2614
  do {
2573
2615
  switch (token(character)) {
2574
2616
  case 0:
@@ -2580,11 +2622,14 @@ var toRules = function toRules(parsed, points) {
2580
2622
  // it's very unlikely for this sequence to actually appear in a different context, so we just leverage this fact here
2581
2623
  points[index] = 1;
2582
2624
  }
2625
+
2583
2626
  parsed[index] += identifierWithPointTracking(position - 1, points, index);
2584
2627
  break;
2628
+
2585
2629
  case 2:
2586
2630
  parsed[index] += delimit(character);
2587
2631
  break;
2632
+
2588
2633
  case 4:
2589
2634
  // comma
2590
2635
  if (character === 44) {
@@ -2600,41 +2645,50 @@ var toRules = function toRules(parsed, points) {
2600
2645
  parsed[index] += from(character);
2601
2646
  }
2602
2647
  } while (character = next());
2648
+
2603
2649
  return parsed;
2604
2650
  };
2651
+
2605
2652
  var getRules = function getRules(value, points) {
2606
2653
  return dealloc(toRules(alloc(value), points));
2607
2654
  }; // WeakSet would be more appropriate, but only WeakMap is supported in IE11
2608
2655
 
2656
+
2609
2657
  var fixedElements = /* #__PURE__ */new WeakMap();
2610
2658
  var compat = function compat(element) {
2611
- if (element.type !== 'rule' || !element.parent ||
2612
- // positive .length indicates that this rule contains pseudo
2659
+ if (element.type !== 'rule' || !element.parent || // positive .length indicates that this rule contains pseudo
2613
2660
  // negative .length indicates that this rule has been already prefixed
2614
2661
  element.length < 1) {
2615
2662
  return;
2616
2663
  }
2664
+
2617
2665
  var value = element.value,
2618
- parent = element.parent;
2666
+ parent = element.parent;
2619
2667
  var isImplicitRule = element.column === parent.column && element.line === parent.line;
2668
+
2620
2669
  while (parent.type !== 'rule') {
2621
2670
  parent = parent.parent;
2622
2671
  if (!parent) return;
2623
2672
  } // short-circuit for the simplest case
2624
2673
 
2674
+
2625
2675
  if (element.props.length === 1 && value.charCodeAt(0) !== 58
2626
- /* colon */ && !fixedElements.get(parent)) {
2676
+ /* colon */
2677
+ && !fixedElements.get(parent)) {
2627
2678
  return;
2628
2679
  } // if this is an implicitly inserted rule (the one eagerly inserted at the each new nested level)
2629
2680
  // then the props has already been manipulated beforehand as they that array is shared between it and its "rule parent"
2630
2681
 
2682
+
2631
2683
  if (isImplicitRule) {
2632
2684
  return;
2633
2685
  }
2686
+
2634
2687
  fixedElements.set(element, true);
2635
2688
  var points = [];
2636
2689
  var rules = getRules(value, points);
2637
2690
  var parentRules = parent.props;
2691
+
2638
2692
  for (var i = 0, k = 0; i < rules.length; i++) {
2639
2693
  for (var j = 0; j < parentRules.length; j++, k++) {
2640
2694
  element.props[k] = points[i] ? rules[i].replace(/&\f/g, parentRules[j]) : parentRules[j] + " " + rules[i];
@@ -2644,10 +2698,9 @@ var compat = function compat(element) {
2644
2698
  var removeLabel = function removeLabel(element) {
2645
2699
  if (element.type === 'decl') {
2646
2700
  var value = element.value;
2647
- if (
2648
- // charcode for l
2649
- value.charCodeAt(0) === 108 &&
2650
- // charcode for b
2701
+
2702
+ if ( // charcode for l
2703
+ value.charCodeAt(0) === 108 && // charcode for b
2651
2704
  value.charCodeAt(2) === 98) {
2652
2705
  // this ignores label
2653
2706
  element["return"] = '';
@@ -2656,13 +2709,16 @@ var removeLabel = function removeLabel(element) {
2656
2709
  }
2657
2710
  };
2658
2711
  var ignoreFlag = 'emotion-disable-server-rendering-unsafe-selector-warning-please-do-not-use-this-the-warning-exists-for-a-reason';
2712
+
2659
2713
  var isIgnoringComment = function isIgnoringComment(element) {
2660
2714
  return element.type === 'comm' && element.children.indexOf(ignoreFlag) > -1;
2661
2715
  };
2716
+
2662
2717
  var createUnsafeSelectorsAlarm = function createUnsafeSelectorsAlarm(cache) {
2663
2718
  return function (element, index, children) {
2664
2719
  if (element.type !== 'rule' || cache.compat) return;
2665
2720
  var unsafePseudoClasses = element.value.match(/(:first|:nth|:nth-last)-child/g);
2721
+
2666
2722
  if (unsafePseudoClasses) {
2667
2723
  var isNested = !!element.parent; // in nested rules comments become children of the "auto-inserted" rule and that's always the `element.parent`
2668
2724
  //
@@ -2680,11 +2736,12 @@ var createUnsafeSelectorsAlarm = function createUnsafeSelectorsAlarm(cache) {
2680
2736
  // .b {}
2681
2737
  // }
2682
2738
 
2683
- var commentContainer = isNested ? element.parent.children :
2684
- // global rule at the root level
2739
+ var commentContainer = isNested ? element.parent.children : // global rule at the root level
2685
2740
  children;
2741
+
2686
2742
  for (var i = commentContainer.length - 1; i >= 0; i--) {
2687
2743
  var node = commentContainer[i];
2744
+
2688
2745
  if (node.line < element.line) {
2689
2746
  break;
2690
2747
  } // it is quite weird but comments are *usually* put at `column: element.column - 1`
@@ -2704,33 +2761,40 @@ var createUnsafeSelectorsAlarm = function createUnsafeSelectorsAlarm(cache) {
2704
2761
  // with such inputs we wouldn't have to search for the comment at all
2705
2762
  // TODO: consider changing this comment placement in the next major version
2706
2763
 
2764
+
2707
2765
  if (node.column < element.column) {
2708
2766
  if (isIgnoringComment(node)) {
2709
2767
  return;
2710
2768
  }
2769
+
2711
2770
  break;
2712
2771
  }
2713
2772
  }
2773
+
2714
2774
  unsafePseudoClasses.forEach(function (unsafePseudoClass) {
2715
2775
  console.error("The pseudo class \"" + unsafePseudoClass + "\" is potentially unsafe when doing server-side rendering. Try changing it to \"" + unsafePseudoClass.split('-child')[0] + "-of-type\".");
2716
2776
  });
2717
2777
  }
2718
2778
  };
2719
2779
  };
2780
+
2720
2781
  var isImportRule = function isImportRule(element) {
2721
2782
  return element.type.charCodeAt(1) === 105 && element.type.charCodeAt(0) === 64;
2722
2783
  };
2784
+
2723
2785
  var isPrependedWithRegularRules = function isPrependedWithRegularRules(index, children) {
2724
2786
  for (var i = index - 1; i >= 0; i--) {
2725
2787
  if (!isImportRule(children[i])) {
2726
2788
  return true;
2727
2789
  }
2728
2790
  }
2791
+
2729
2792
  return false;
2730
2793
  }; // use this to remove incorrect elements from further processing
2731
2794
  // so they don't get handed to the `sheet` (or anything else)
2732
2795
  // as that could potentially lead to additional logs which in turn could be overhelming to the user
2733
2796
 
2797
+
2734
2798
  var nullifyElement = function nullifyElement(element) {
2735
2799
  element.type = '';
2736
2800
  element.value = '';
@@ -2738,10 +2802,12 @@ var nullifyElement = function nullifyElement(element) {
2738
2802
  element.children = '';
2739
2803
  element.props = '';
2740
2804
  };
2805
+
2741
2806
  var incorrectImportAlarm = function incorrectImportAlarm(element, index, children) {
2742
2807
  if (!isImportRule(element)) {
2743
2808
  return;
2744
2809
  }
2810
+
2745
2811
  if (element.parent) {
2746
2812
  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.");
2747
2813
  nullifyElement(element);
@@ -2901,6 +2967,7 @@ function prefix(value, length) {
2901
2967
  case 101:
2902
2968
  return replace(value, /(.+:)([^;!]+)(;|!.+)?/, '$1' + WEBKIT + (charat(value, 14) === 45 ? 'inline-' : '') + 'box$3' + '$1' + WEBKIT + '$2$3' + '$1' + MS + '$2box$3') + value;
2903
2969
  }
2970
+
2904
2971
  break;
2905
2972
  // writing-mode
2906
2973
 
@@ -2918,19 +2985,24 @@ function prefix(value, length) {
2918
2985
  case 45:
2919
2986
  return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, 'lr') + value;
2920
2987
  }
2988
+
2921
2989
  return WEBKIT + value + MS + value + value;
2922
2990
  }
2991
+
2923
2992
  return value;
2924
2993
  }
2994
+
2925
2995
  var prefixer = function prefixer(element, index, children, callback) {
2926
2996
  if (element.length > -1) if (!element["return"]) switch (element.type) {
2927
2997
  case DECLARATION:
2928
2998
  element["return"] = prefix(element.value, element.length);
2929
2999
  break;
3000
+
2930
3001
  case KEYFRAMES:
2931
3002
  return serialize$1([copy$1(element, {
2932
3003
  value: replace(element.value, '@', '@' + WEBKIT)
2933
3004
  })], callback);
3005
+
2934
3006
  case RULESET:
2935
3007
  if (element.length) return combine(element.props, function (value) {
2936
3008
  switch (match(value, /(::plac\w+|:read-\w+)/)) {
@@ -2951,10 +3023,12 @@ var prefixer = function prefixer(element, index, children, callback) {
2951
3023
  props: [replace(value, /:(plac\w+)/, MS + 'input-$1')]
2952
3024
  })], callback);
2953
3025
  }
3026
+
2954
3027
  return '';
2955
3028
  });
2956
3029
  }
2957
3030
  };
3031
+
2958
3032
  var isBrowser$1 = typeof document !== 'undefined';
2959
3033
  var getServerStylisCache = isBrowser$1 ? undefined : weakMemoize(function () {
2960
3034
  return memoize(function () {
@@ -2965,11 +3039,14 @@ var getServerStylisCache = isBrowser$1 ? undefined : weakMemoize(function () {
2965
3039
  });
2966
3040
  });
2967
3041
  var defaultStylisPlugins = [prefixer];
3042
+
2968
3043
  var createCache = function createCache(options) {
2969
3044
  var key = options.key;
3045
+
2970
3046
  if (process.env.NODE_ENV !== 'production' && !key) {
2971
3047
  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.");
2972
3048
  }
3049
+
2973
3050
  if (isBrowser$1 && key === 'css') {
2974
3051
  var ssrStyles = document.querySelectorAll("style[data-emotion]:not([data-s])"); // get SSRed styles out of the way of React's hydration
2975
3052
  // document.head is a safe place to move them to(though note document.head is not necessarily the last place they will be)
@@ -2984,6 +3061,7 @@ var createCache = function createCache(options) {
2984
3061
  // so checking for the space ensures that loading Emotion 11 after Emotion 10 has inserted some styles
2985
3062
  // will not result in the Emotion 10 styles being destroyed
2986
3063
  var dataEmotionAttribute = node.getAttribute('data-emotion');
3064
+
2987
3065
  if (dataEmotionAttribute.indexOf(' ') === -1) {
2988
3066
  return;
2989
3067
  }
@@ -2991,20 +3069,23 @@ var createCache = function createCache(options) {
2991
3069
  node.setAttribute('data-s', '');
2992
3070
  });
2993
3071
  }
3072
+
2994
3073
  var stylisPlugins = options.stylisPlugins || defaultStylisPlugins;
3074
+
2995
3075
  if (process.env.NODE_ENV !== 'production') {
2996
3076
  // $FlowFixMe
2997
3077
  if (/[^a-z-]/.test(key)) {
2998
3078
  throw new Error("Emotion key must only contain lower case alphabetical characters and - but \"" + key + "\" was passed");
2999
3079
  }
3000
3080
  }
3081
+
3001
3082
  var inserted = {};
3002
3083
  var container;
3003
3084
  var nodesToHydrate = [];
3085
+
3004
3086
  if (isBrowser$1) {
3005
3087
  container = options.container || document.head;
3006
- Array.prototype.forEach.call(
3007
- // this means we will ignore elements which don't have a space in them which
3088
+ Array.prototype.forEach.call( // this means we will ignore elements which don't have a space in them which
3008
3089
  // means that the style elements we're looking at are only Emotion 11 server-rendered style elements
3009
3090
  document.querySelectorAll("style[data-emotion^=\"" + key + " \"]"), function (node) {
3010
3091
  var attrib = node.getAttribute("data-emotion").split(' '); // $FlowFixMe
@@ -3012,18 +3093,24 @@ var createCache = function createCache(options) {
3012
3093
  for (var i = 1; i < attrib.length; i++) {
3013
3094
  inserted[attrib[i]] = true;
3014
3095
  }
3096
+
3015
3097
  nodesToHydrate.push(node);
3016
3098
  });
3017
3099
  }
3100
+
3018
3101
  var _insert;
3102
+
3019
3103
  var omnipresentPlugins = [compat, removeLabel];
3104
+
3020
3105
  if (process.env.NODE_ENV !== 'production') {
3021
3106
  omnipresentPlugins.push(createUnsafeSelectorsAlarm({
3022
3107
  get compat() {
3023
3108
  return cache.compat;
3024
3109
  }
3110
+
3025
3111
  }), incorrectImportAlarm);
3026
3112
  }
3113
+
3027
3114
  if (isBrowser$1) {
3028
3115
  var currentSheet;
3029
3116
  var finalizingPlugins = [stringify$1, process.env.NODE_ENV !== 'production' ? function (element) {
@@ -3040,11 +3127,14 @@ var createCache = function createCache(options) {
3040
3127
  currentSheet.insert(rule);
3041
3128
  })];
3042
3129
  var serializer = middleware(omnipresentPlugins.concat(stylisPlugins, finalizingPlugins));
3130
+
3043
3131
  var stylis = function stylis(styles) {
3044
3132
  return serialize$1(compile(styles), serializer);
3045
3133
  };
3134
+
3046
3135
  _insert = function insert(selector, serialized, sheet, shouldCache) {
3047
3136
  currentSheet = sheet;
3137
+
3048
3138
  if (process.env.NODE_ENV !== 'production' && serialized.map !== undefined) {
3049
3139
  currentSheet = {
3050
3140
  insert: function insert(rule) {
@@ -3052,29 +3142,39 @@ var createCache = function createCache(options) {
3052
3142
  }
3053
3143
  };
3054
3144
  }
3145
+
3055
3146
  stylis(selector ? selector + "{" + serialized.styles + "}" : serialized.styles);
3147
+
3056
3148
  if (shouldCache) {
3057
3149
  cache.inserted[serialized.name] = true;
3058
3150
  }
3059
3151
  };
3060
3152
  } else {
3061
3153
  var _finalizingPlugins = [stringify$1];
3154
+
3062
3155
  var _serializer = middleware(omnipresentPlugins.concat(stylisPlugins, _finalizingPlugins));
3156
+
3063
3157
  var _stylis = function _stylis(styles) {
3064
3158
  return serialize$1(compile(styles), _serializer);
3065
3159
  }; // $FlowFixMe
3066
3160
 
3161
+
3067
3162
  var serverStylisCache = getServerStylisCache(stylisPlugins)(key);
3163
+
3068
3164
  var getRules = function getRules(selector, serialized) {
3069
3165
  var name = serialized.name;
3166
+
3070
3167
  if (serverStylisCache[name] === undefined) {
3071
3168
  serverStylisCache[name] = _stylis(selector ? selector + "{" + serialized.styles + "}" : serialized.styles);
3072
3169
  }
3170
+
3073
3171
  return serverStylisCache[name];
3074
3172
  };
3173
+
3075
3174
  _insert = function _insert(selector, serialized, sheet, shouldCache) {
3076
3175
  var name = serialized.name;
3077
3176
  var rules = getRules(selector, serialized);
3177
+
3078
3178
  if (cache.compat === undefined) {
3079
3179
  // in regular mode, we don't set the styles on the inserted cache
3080
3180
  // since we don't need to and that would be wasting memory
@@ -3082,12 +3182,13 @@ var createCache = function createCache(options) {
3082
3182
  if (shouldCache) {
3083
3183
  cache.inserted[name] = true;
3084
3184
  }
3085
- if (
3086
- // using === development instead of !== production
3185
+
3186
+ if ( // using === development instead of !== production
3087
3187
  // because if people do ssr in tests, the source maps showing up would be annoying
3088
3188
  process.env.NODE_ENV === 'development' && serialized.map !== undefined) {
3089
3189
  return rules + serialized.map;
3090
3190
  }
3191
+
3091
3192
  return rules;
3092
3193
  } else {
3093
3194
  // in compat mode, we put the styles on the inserted cache so
@@ -3105,6 +3206,7 @@ var createCache = function createCache(options) {
3105
3206
  }
3106
3207
  };
3107
3208
  }
3209
+
3108
3210
  var cache = {
3109
3211
  key: key,
3110
3212
  sheet: new StyleSheet({
@@ -3136,33 +3238,44 @@ function murmur2(str) {
3136
3238
  var h = 0; // Mix 4 bytes at a time into the hash
3137
3239
 
3138
3240
  var k,
3139
- i = 0,
3140
- len = str.length;
3241
+ i = 0,
3242
+ len = str.length;
3243
+
3141
3244
  for (; len >= 4; ++i, len -= 4) {
3142
3245
  k = str.charCodeAt(i) & 0xff | (str.charCodeAt(++i) & 0xff) << 8 | (str.charCodeAt(++i) & 0xff) << 16 | (str.charCodeAt(++i) & 0xff) << 24;
3143
- k = /* Math.imul(k, m): */
3246
+ k =
3247
+ /* Math.imul(k, m): */
3144
3248
  (k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16);
3145
- k ^= /* k >>> r: */
3249
+ k ^=
3250
+ /* k >>> r: */
3146
3251
  k >>> 24;
3147
- h = /* Math.imul(k, m): */
3148
- (k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16) ^ /* Math.imul(h, m): */
3252
+ h =
3253
+ /* Math.imul(k, m): */
3254
+ (k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16) ^
3255
+ /* Math.imul(h, m): */
3149
3256
  (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);
3150
3257
  } // Handle the last few bytes of the input array
3151
3258
 
3259
+
3152
3260
  switch (len) {
3153
3261
  case 3:
3154
3262
  h ^= (str.charCodeAt(i + 2) & 0xff) << 16;
3263
+
3155
3264
  case 2:
3156
3265
  h ^= (str.charCodeAt(i + 1) & 0xff) << 8;
3266
+
3157
3267
  case 1:
3158
3268
  h ^= str.charCodeAt(i) & 0xff;
3159
- h = /* Math.imul(h, m): */
3269
+ h =
3270
+ /* Math.imul(h, m): */
3160
3271
  (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);
3161
3272
  } // Do a few final mixes of the hash to ensure the last few
3162
3273
  // bytes are well-incorporated.
3163
3274
 
3275
+
3164
3276
  h ^= h >>> 13;
3165
- h = /* Math.imul(h, m): */
3277
+ h =
3278
+ /* Math.imul(h, m): */
3166
3279
  (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);
3167
3280
  return ((h ^ h >>> 15) >>> 0).toString(36);
3168
3281
  }
@@ -3221,15 +3334,19 @@ var ILLEGAL_ESCAPE_SEQUENCE_ERROR = "You have illegal escape sequence in your te
3221
3334
  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).";
3222
3335
  var hyphenateRegex = /[A-Z]|^ms/g;
3223
3336
  var animationRegex = /_EMO_([^_]+?)_([^]*?)_EMO_/g;
3337
+
3224
3338
  var isCustomProperty = function isCustomProperty(property) {
3225
3339
  return property.charCodeAt(1) === 45;
3226
3340
  };
3341
+
3227
3342
  var isProcessableValue = function isProcessableValue(value) {
3228
3343
  return value != null && typeof value !== 'boolean';
3229
3344
  };
3345
+
3230
3346
  var processStyleName = /* #__PURE__ */memoize(function (styleName) {
3231
3347
  return isCustomProperty(styleName) ? styleName : styleName.replace(hyphenateRegex, '-$&').toLowerCase();
3232
3348
  });
3349
+
3233
3350
  var processStyleValue = function processStyleValue(key, value) {
3234
3351
  switch (key) {
3235
3352
  case 'animation':
@@ -3247,11 +3364,14 @@ var processStyleValue = function processStyleValue(key, value) {
3247
3364
  }
3248
3365
  }
3249
3366
  }
3367
+
3250
3368
  if (unitlessKeys[key] !== 1 && !isCustomProperty(key) && typeof value === 'number' && value !== 0) {
3251
3369
  return value + 'px';
3252
3370
  }
3371
+
3253
3372
  return value;
3254
3373
  };
3374
+
3255
3375
  if (process.env.NODE_ENV !== 'production') {
3256
3376
  var contentValuePattern = /(var|attr|counters?|url|element|(((repeating-)?(linear|radial))|conic)-gradient)\(|(no-)?(open|close)-quote/;
3257
3377
  var contentValues = ['normal', 'none', 'initial', 'inherit', 'unset'];
@@ -3259,38 +3379,48 @@ if (process.env.NODE_ENV !== 'production') {
3259
3379
  var msPattern = /^-ms-/;
3260
3380
  var hyphenPattern = /-(.)/g;
3261
3381
  var hyphenatedCache = {};
3382
+
3262
3383
  processStyleValue = function processStyleValue(key, value) {
3263
3384
  if (key === 'content') {
3264
3385
  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) !== "'")) {
3265
3386
  throw new Error("You seem to be using a value for 'content' without quotes, try replacing it with `content: '\"" + value + "\"'`");
3266
3387
  }
3267
3388
  }
3389
+
3268
3390
  var processed = oldProcessStyleValue(key, value);
3391
+
3269
3392
  if (processed !== '' && !isCustomProperty(key) && key.indexOf('-') !== -1 && hyphenatedCache[key] === undefined) {
3270
3393
  hyphenatedCache[key] = true;
3271
3394
  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) {
3272
3395
  return _char.toUpperCase();
3273
3396
  }) + "?");
3274
3397
  }
3398
+
3275
3399
  return processed;
3276
3400
  };
3277
3401
  }
3402
+
3278
3403
  var noComponentSelectorMessage = 'Component selectors can only be used in conjunction with ' + '@emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware ' + 'compiler transform.';
3404
+
3279
3405
  function handleInterpolation(mergedProps, registered, interpolation) {
3280
3406
  if (interpolation == null) {
3281
3407
  return '';
3282
3408
  }
3409
+
3283
3410
  if (interpolation.__emotion_styles !== undefined) {
3284
3411
  if (process.env.NODE_ENV !== 'production' && interpolation.toString() === 'NO_COMPONENT_SELECTOR') {
3285
3412
  throw new Error(noComponentSelectorMessage);
3286
3413
  }
3414
+
3287
3415
  return interpolation;
3288
3416
  }
3417
+
3289
3418
  switch (typeof interpolation) {
3290
3419
  case 'boolean':
3291
3420
  {
3292
3421
  return '';
3293
3422
  }
3423
+
3294
3424
  case 'object':
3295
3425
  {
3296
3426
  if (interpolation.anim === 1) {
@@ -3301,8 +3431,10 @@ function handleInterpolation(mergedProps, registered, interpolation) {
3301
3431
  };
3302
3432
  return interpolation.name;
3303
3433
  }
3434
+
3304
3435
  if (interpolation.styles !== undefined) {
3305
3436
  var next = interpolation.next;
3437
+
3306
3438
  if (next !== undefined) {
3307
3439
  // not the most efficient thing ever but this is a pretty rare case
3308
3440
  // and there will be very few iterations of this generally
@@ -3315,14 +3447,19 @@ function handleInterpolation(mergedProps, registered, interpolation) {
3315
3447
  next = next.next;
3316
3448
  }
3317
3449
  }
3450
+
3318
3451
  var styles = interpolation.styles + ";";
3452
+
3319
3453
  if (process.env.NODE_ENV !== 'production' && interpolation.map !== undefined) {
3320
3454
  styles += interpolation.map;
3321
3455
  }
3456
+
3322
3457
  return styles;
3323
3458
  }
3459
+
3324
3460
  return createStringFromObject(mergedProps, registered, interpolation);
3325
3461
  }
3462
+
3326
3463
  case 'function':
3327
3464
  {
3328
3465
  if (mergedProps !== undefined) {
@@ -3333,8 +3470,10 @@ function handleInterpolation(mergedProps, registered, interpolation) {
3333
3470
  } else if (process.env.NODE_ENV !== 'production') {
3334
3471
  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}`");
3335
3472
  }
3473
+
3336
3474
  break;
3337
3475
  }
3476
+
3338
3477
  case 'string':
3339
3478
  if (process.env.NODE_ENV !== 'production') {
3340
3479
  var matched = [];
@@ -3343,21 +3482,27 @@ function handleInterpolation(mergedProps, registered, interpolation) {
3343
3482
  matched.push("const " + fakeVarName + " = keyframes`" + p2.replace(/^@keyframes animation-\w+/, '') + "`");
3344
3483
  return "${" + fakeVarName + "}";
3345
3484
  });
3485
+
3346
3486
  if (matched.length) {
3347
3487
  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 + "`"));
3348
3488
  }
3349
3489
  }
3490
+
3350
3491
  break;
3351
3492
  } // finalize string values (regular strings and functions interpolated into css calls)
3352
3493
 
3494
+
3353
3495
  if (registered == null) {
3354
3496
  return interpolation;
3355
3497
  }
3498
+
3356
3499
  var cached = registered[interpolation];
3357
3500
  return cached !== undefined ? cached : interpolation;
3358
3501
  }
3502
+
3359
3503
  function createStringFromObject(mergedProps, registered, obj) {
3360
3504
  var string = '';
3505
+
3361
3506
  if (Array.isArray(obj)) {
3362
3507
  for (var i = 0; i < obj.length; i++) {
3363
3508
  string += handleInterpolation(mergedProps, registered, obj[i]) + ";";
@@ -3365,6 +3510,7 @@ function createStringFromObject(mergedProps, registered, obj) {
3365
3510
  } else {
3366
3511
  for (var _key in obj) {
3367
3512
  var value = obj[_key];
3513
+
3368
3514
  if (typeof value !== 'object') {
3369
3515
  if (registered != null && registered[value] !== undefined) {
3370
3516
  string += _key + "{" + registered[value] + "}";
@@ -3375,6 +3521,7 @@ function createStringFromObject(mergedProps, registered, obj) {
3375
3521
  if (_key === 'NO_COMPONENT_SELECTOR' && process.env.NODE_ENV !== 'production') {
3376
3522
  throw new Error(noComponentSelectorMessage);
3377
3523
  }
3524
+
3378
3525
  if (Array.isArray(value) && typeof value[0] === 'string' && (registered == null || registered[value[0]] === undefined)) {
3379
3526
  for (var _i = 0; _i < value.length; _i++) {
3380
3527
  if (isProcessableValue(value[_i])) {
@@ -3383,6 +3530,7 @@ function createStringFromObject(mergedProps, registered, obj) {
3383
3530
  }
3384
3531
  } else {
3385
3532
  var interpolated = handleInterpolation(mergedProps, registered, value);
3533
+
3386
3534
  switch (_key) {
3387
3535
  case 'animation':
3388
3536
  case 'animationName':
@@ -3390,11 +3538,13 @@ function createStringFromObject(mergedProps, registered, obj) {
3390
3538
  string += processStyleName(_key) + ":" + interpolated + ";";
3391
3539
  break;
3392
3540
  }
3541
+
3393
3542
  default:
3394
3543
  {
3395
3544
  if (process.env.NODE_ENV !== 'production' && _key === 'undefined') {
3396
3545
  console.error(UNDEFINED_AS_OBJECT_KEY_ERROR);
3397
3546
  }
3547
+
3398
3548
  string += _key + "{" + interpolated + "}";
3399
3549
  }
3400
3550
  }
@@ -3402,24 +3552,30 @@ function createStringFromObject(mergedProps, registered, obj) {
3402
3552
  }
3403
3553
  }
3404
3554
  }
3555
+
3405
3556
  return string;
3406
3557
  }
3558
+
3407
3559
  var labelPattern = /label:\s*([^\s;\n{]+)\s*(;|$)/g;
3408
3560
  var sourceMapPattern;
3561
+
3409
3562
  if (process.env.NODE_ENV !== 'production') {
3410
3563
  sourceMapPattern = /\/\*#\ssourceMappingURL=data:application\/json;\S+\s+\*\//g;
3411
3564
  } // this is the cursor for keyframes
3412
3565
  // keyframes are stored on the SerializedStyles object as a linked list
3413
3566
 
3567
+
3414
3568
  var cursor;
3415
3569
  var serializeStyles = function serializeStyles(args, registered, mergedProps) {
3416
3570
  if (args.length === 1 && typeof args[0] === 'object' && args[0] !== null && args[0].styles !== undefined) {
3417
3571
  return args[0];
3418
3572
  }
3573
+
3419
3574
  var stringMode = true;
3420
3575
  var styles = '';
3421
3576
  cursor = undefined;
3422
3577
  var strings = args[0];
3578
+
3423
3579
  if (strings == null || strings.raw === undefined) {
3424
3580
  stringMode = false;
3425
3581
  styles += handleInterpolation(mergedProps, registered, strings);
@@ -3427,19 +3583,25 @@ var serializeStyles = function serializeStyles(args, registered, mergedProps) {
3427
3583
  if (process.env.NODE_ENV !== 'production' && strings[0] === undefined) {
3428
3584
  console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR);
3429
3585
  }
3586
+
3430
3587
  styles += strings[0];
3431
3588
  } // we start at 1 since we've already handled the first arg
3432
3589
 
3590
+
3433
3591
  for (var i = 1; i < args.length; i++) {
3434
3592
  styles += handleInterpolation(mergedProps, registered, args[i]);
3593
+
3435
3594
  if (stringMode) {
3436
3595
  if (process.env.NODE_ENV !== 'production' && strings[i] === undefined) {
3437
3596
  console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR);
3438
3597
  }
3598
+
3439
3599
  styles += strings[i];
3440
3600
  }
3441
3601
  }
3602
+
3442
3603
  var sourceMap;
3604
+
3443
3605
  if (process.env.NODE_ENV !== 'production') {
3444
3606
  styles = styles.replace(sourceMapPattern, function (match) {
3445
3607
  sourceMap = match;
@@ -3447,16 +3609,18 @@ var serializeStyles = function serializeStyles(args, registered, mergedProps) {
3447
3609
  });
3448
3610
  } // using a global regex with .exec is stateful so lastIndex has to be reset each time
3449
3611
 
3612
+
3450
3613
  labelPattern.lastIndex = 0;
3451
3614
  var identifierName = '';
3452
3615
  var match; // https://esbench.com/bench/5b809c2cf2949800a0f61fb5
3453
3616
 
3454
3617
  while ((match = labelPattern.exec(styles)) !== null) {
3455
- identifierName += '-' +
3456
- // $FlowFixMe we know it's not null
3618
+ identifierName += '-' + // $FlowFixMe we know it's not null
3457
3619
  match[1];
3458
3620
  }
3621
+
3459
3622
  var name = murmur2(styles) + identifierName;
3623
+
3460
3624
  if (process.env.NODE_ENV !== 'production') {
3461
3625
  // $FlowFixMe SerializedStyles type doesn't have toString property (and we don't want to add it)
3462
3626
  return {
@@ -3469,6 +3633,7 @@ var serializeStyles = function serializeStyles(args, registered, mergedProps) {
3469
3633
  }
3470
3634
  };
3471
3635
  }
3636
+
3472
3637
  return {
3473
3638
  name: name,
3474
3639
  styles: styles,
@@ -3490,14 +3655,13 @@ function getRegisteredStyles(registered, registeredStyles, classNames) {
3490
3655
  }
3491
3656
  var registerStyles = function registerStyles(cache, serialized, isStringTag) {
3492
3657
  var className = cache.key + "-" + serialized.name;
3493
- if (
3494
- // we only need to add the styles to the registered cache if the
3658
+
3659
+ if ( // we only need to add the styles to the registered cache if the
3495
3660
  // class name could be used further down
3496
3661
  // the tree but if it's a string tag, we know it won't
3497
3662
  // so we don't have to add it to registered cache.
3498
3663
  // this improves memory usage since we can avoid storing the whole style string
3499
- (isStringTag === false ||
3500
- // we need to always store it if we're in compat mode and
3664
+ (isStringTag === false || // we need to always store it if we're in compat mode and
3501
3665
  // in node since emotion-server relies on whether a style is in
3502
3666
  // the registered cache to know whether a style is global or not
3503
3667
  // also, note that this check will be dead code eliminated in the browser
@@ -3508,16 +3672,21 @@ var registerStyles = function registerStyles(cache, serialized, isStringTag) {
3508
3672
  var insertStyles = function insertStyles(cache, serialized, isStringTag) {
3509
3673
  registerStyles(cache, serialized, isStringTag);
3510
3674
  var className = cache.key + "-" + serialized.name;
3675
+
3511
3676
  if (cache.inserted[serialized.name] === undefined) {
3512
3677
  var stylesForSSR = '';
3513
3678
  var current = serialized;
3679
+
3514
3680
  do {
3515
3681
  var maybeStyles = cache.insert(serialized === current ? "." + className : '', current, cache.sheet, true);
3682
+
3516
3683
  if (!isBrowser && maybeStyles !== undefined) {
3517
3684
  stylesForSSR += maybeStyles;
3518
3685
  }
3686
+
3519
3687
  current = current.next;
3520
3688
  } while (current !== undefined);
3689
+
3521
3690
  if (!isBrowser && stylesForSSR.length !== 0) {
3522
3691
  return stylesForSSR;
3523
3692
  }
@@ -3529,14 +3698,18 @@ function insertWithoutScoping(cache, serialized) {
3529
3698
  return cache.insert('', serialized, cache.sheet, true);
3530
3699
  }
3531
3700
  }
3701
+
3532
3702
  function merge(registered, css, className) {
3533
3703
  var registeredStyles = [];
3534
3704
  var rawClassName = getRegisteredStyles(registered, registeredStyles, className);
3705
+
3535
3706
  if (registeredStyles.length < 2) {
3536
3707
  return className;
3537
3708
  }
3709
+
3538
3710
  return rawClassName + css(registeredStyles);
3539
3711
  }
3712
+
3540
3713
  var createEmotion = function createEmotion(options) {
3541
3714
  var cache = createCache(options); // $FlowFixMe
3542
3715
 
@@ -3544,21 +3717,27 @@ var createEmotion = function createEmotion(options) {
3544
3717
  if (process.env.NODE_ENV !== 'production' && this.ctr !== 0) {
3545
3718
  throw new Error('speedy must be changed before any rules are inserted');
3546
3719
  }
3720
+
3547
3721
  this.isSpeedy = value;
3548
3722
  };
3723
+
3549
3724
  cache.compat = true;
3725
+
3550
3726
  var css = function css() {
3551
3727
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
3552
3728
  args[_key] = arguments[_key];
3553
3729
  }
3730
+
3554
3731
  var serialized = serializeStyles(args, cache.registered, undefined);
3555
3732
  insertStyles(cache, serialized, false);
3556
3733
  return cache.key + "-" + serialized.name;
3557
3734
  };
3735
+
3558
3736
  var keyframes = function keyframes() {
3559
3737
  for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
3560
3738
  args[_key2] = arguments[_key2];
3561
3739
  }
3740
+
3562
3741
  var serialized = serializeStyles(args, cache.registered);
3563
3742
  var animation = "animation-" + serialized.name;
3564
3743
  insertWithoutScoping(cache, {
@@ -3567,19 +3746,24 @@ var createEmotion = function createEmotion(options) {
3567
3746
  });
3568
3747
  return animation;
3569
3748
  };
3749
+
3570
3750
  var injectGlobal = function injectGlobal() {
3571
3751
  for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
3572
3752
  args[_key3] = arguments[_key3];
3573
3753
  }
3754
+
3574
3755
  var serialized = serializeStyles(args, cache.registered);
3575
3756
  insertWithoutScoping(cache, serialized);
3576
3757
  };
3758
+
3577
3759
  var cx = function cx() {
3578
3760
  for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
3579
3761
  args[_key4] = arguments[_key4];
3580
3762
  }
3763
+
3581
3764
  return merge(cache.registered, css, classnames(args));
3582
3765
  };
3766
+
3583
3767
  return {
3584
3768
  css: css,
3585
3769
  cx: cx,
@@ -3602,21 +3786,26 @@ var createEmotion = function createEmotion(options) {
3602
3786
  merge: merge.bind(null, cache.registered, css)
3603
3787
  };
3604
3788
  };
3789
+
3605
3790
  var classnames = function classnames(args) {
3606
3791
  var cls = '';
3792
+
3607
3793
  for (var i = 0; i < args.length; i++) {
3608
3794
  var arg = args[i];
3609
3795
  if (arg == null) continue;
3610
3796
  var toAdd = void 0;
3797
+
3611
3798
  switch (typeof arg) {
3612
3799
  case 'boolean':
3613
3800
  break;
3801
+
3614
3802
  case 'object':
3615
3803
  {
3616
3804
  if (Array.isArray(arg)) {
3617
3805
  toAdd = classnames(arg);
3618
3806
  } else {
3619
3807
  toAdd = '';
3808
+
3620
3809
  for (var k in arg) {
3621
3810
  if (arg[k] && k) {
3622
3811
  toAdd && (toAdd += ' ');
@@ -3624,26 +3813,30 @@ var classnames = function classnames(args) {
3624
3813
  }
3625
3814
  }
3626
3815
  }
3816
+
3627
3817
  break;
3628
3818
  }
3819
+
3629
3820
  default:
3630
3821
  {
3631
3822
  toAdd = arg;
3632
3823
  }
3633
3824
  }
3825
+
3634
3826
  if (toAdd) {
3635
3827
  cls && (cls += ' ');
3636
3828
  cls += toAdd;
3637
3829
  }
3638
3830
  }
3831
+
3639
3832
  return cls;
3640
3833
  };
3641
3834
 
3642
3835
  var _createEmotion = createEmotion({
3643
- key: 'css'
3644
- }),
3645
- cx = _createEmotion.cx,
3646
- css = _createEmotion.css;
3836
+ key: 'css'
3837
+ }),
3838
+ cx = _createEmotion.cx,
3839
+ css = _createEmotion.css;
3647
3840
 
3648
3841
  const ShadowVariants = {
3649
3842
  xs: '0 1px 2px 0 rgb(0 0 0 / 0.05)',
@@ -3950,829 +4143,801 @@ const tokens = {
3950
4143
  }
3951
4144
  };
3952
4145
 
3953
- var DoubleIndexedKV = /** @class */function () {
3954
- function DoubleIndexedKV() {
3955
- this.keyToValue = new Map();
3956
- this.valueToKey = new Map();
3957
- }
3958
- DoubleIndexedKV.prototype.set = function (key, value) {
3959
- this.keyToValue.set(key, value);
3960
- this.valueToKey.set(value, key);
3961
- };
3962
- DoubleIndexedKV.prototype.getByKey = function (key) {
3963
- return this.keyToValue.get(key);
3964
- };
3965
- DoubleIndexedKV.prototype.getByValue = function (value) {
3966
- return this.valueToKey.get(value);
3967
- };
3968
- DoubleIndexedKV.prototype.clear = function () {
3969
- this.keyToValue.clear();
3970
- this.valueToKey.clear();
3971
- };
3972
- return DoubleIndexedKV;
3973
- }();
3974
-
3975
- var Registry = /** @class */function () {
3976
- function Registry(generateIdentifier) {
3977
- this.generateIdentifier = generateIdentifier;
3978
- this.kv = new DoubleIndexedKV();
3979
- }
3980
- Registry.prototype.register = function (value, identifier) {
3981
- if (this.kv.getByValue(value)) {
3982
- return;
3983
- }
3984
- if (!identifier) {
3985
- identifier = this.generateIdentifier(value);
4146
+ var DoubleIndexedKV = /** @class */ (function () {
4147
+ function DoubleIndexedKV() {
4148
+ this.keyToValue = new Map();
4149
+ this.valueToKey = new Map();
3986
4150
  }
3987
- this.kv.set(identifier, value);
3988
- };
3989
- Registry.prototype.clear = function () {
3990
- this.kv.clear();
3991
- };
3992
- Registry.prototype.getIdentifier = function (value) {
3993
- return this.kv.getByValue(value);
3994
- };
3995
- Registry.prototype.getValue = function (identifier) {
3996
- return this.kv.getByKey(identifier);
3997
- };
3998
- return Registry;
3999
- }();
4000
-
4001
- var __extends = undefined && undefined.__extends || function () {
4002
- var extendStatics = function (d, b) {
4003
- extendStatics = Object.setPrototypeOf || {
4004
- __proto__: []
4005
- } instanceof Array && function (d, b) {
4006
- d.__proto__ = b;
4007
- } || function (d, b) {
4008
- for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
4151
+ DoubleIndexedKV.prototype.set = function (key, value) {
4152
+ this.keyToValue.set(key, value);
4153
+ this.valueToKey.set(value, key);
4009
4154
  };
4010
- return extendStatics(d, b);
4011
- };
4012
- return function (d, b) {
4013
- if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
4014
- extendStatics(d, b);
4015
- function __() {
4016
- this.constructor = d;
4017
- }
4018
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
4019
- };
4020
- }();
4021
- var ClassRegistry = /** @class */function (_super) {
4022
- __extends(ClassRegistry, _super);
4023
- function ClassRegistry() {
4024
- var _this = _super.call(this, function (c) {
4025
- return c.name;
4026
- }) || this;
4027
- _this.classToAllowedProps = new Map();
4028
- return _this;
4029
- }
4030
- ClassRegistry.prototype.register = function (value, options) {
4031
- if (typeof options === 'object') {
4032
- if (options.allowProps) {
4033
- this.classToAllowedProps.set(value, options.allowProps);
4034
- }
4035
- _super.prototype.register.call(this, value, options.identifier);
4036
- } else {
4037
- _super.prototype.register.call(this, value, options);
4155
+ DoubleIndexedKV.prototype.getByKey = function (key) {
4156
+ return this.keyToValue.get(key);
4157
+ };
4158
+ DoubleIndexedKV.prototype.getByValue = function (value) {
4159
+ return this.valueToKey.get(value);
4160
+ };
4161
+ DoubleIndexedKV.prototype.clear = function () {
4162
+ this.keyToValue.clear();
4163
+ this.valueToKey.clear();
4164
+ };
4165
+ return DoubleIndexedKV;
4166
+ }());
4167
+
4168
+ var Registry = /** @class */ (function () {
4169
+ function Registry(generateIdentifier) {
4170
+ this.generateIdentifier = generateIdentifier;
4171
+ this.kv = new DoubleIndexedKV();
4038
4172
  }
4039
- };
4040
- ClassRegistry.prototype.getAllowedProps = function (value) {
4041
- return this.classToAllowedProps.get(value);
4042
- };
4043
- return ClassRegistry;
4044
- }(Registry);
4045
-
4046
- var __read$3 = undefined && undefined.__read || function (o, n) {
4047
- var m = typeof Symbol === "function" && o[Symbol.iterator];
4048
- if (!m) return o;
4049
- var i = m.call(o),
4050
- r,
4051
- ar = [],
4052
- e;
4053
- try {
4054
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
4055
- } catch (error) {
4056
- e = {
4057
- error: error
4173
+ Registry.prototype.register = function (value, identifier) {
4174
+ if (this.kv.getByValue(value)) {
4175
+ return;
4176
+ }
4177
+ if (!identifier) {
4178
+ identifier = this.generateIdentifier(value);
4179
+ }
4180
+ this.kv.set(identifier, value);
4058
4181
  };
4059
- } finally {
4182
+ Registry.prototype.clear = function () {
4183
+ this.kv.clear();
4184
+ };
4185
+ Registry.prototype.getIdentifier = function (value) {
4186
+ return this.kv.getByValue(value);
4187
+ };
4188
+ Registry.prototype.getValue = function (identifier) {
4189
+ return this.kv.getByKey(identifier);
4190
+ };
4191
+ return Registry;
4192
+ }());
4193
+
4194
+ var __extends = (undefined && undefined.__extends) || (function () {
4195
+ var extendStatics = function (d, b) {
4196
+ extendStatics = Object.setPrototypeOf ||
4197
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
4198
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
4199
+ return extendStatics(d, b);
4200
+ };
4201
+ return function (d, b) {
4202
+ if (typeof b !== "function" && b !== null)
4203
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
4204
+ extendStatics(d, b);
4205
+ function __() { this.constructor = d; }
4206
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
4207
+ };
4208
+ })();
4209
+ var ClassRegistry = /** @class */ (function (_super) {
4210
+ __extends(ClassRegistry, _super);
4211
+ function ClassRegistry() {
4212
+ var _this = _super.call(this, function (c) { return c.name; }) || this;
4213
+ _this.classToAllowedProps = new Map();
4214
+ return _this;
4215
+ }
4216
+ ClassRegistry.prototype.register = function (value, options) {
4217
+ if (typeof options === 'object') {
4218
+ if (options.allowProps) {
4219
+ this.classToAllowedProps.set(value, options.allowProps);
4220
+ }
4221
+ _super.prototype.register.call(this, value, options.identifier);
4222
+ }
4223
+ else {
4224
+ _super.prototype.register.call(this, value, options);
4225
+ }
4226
+ };
4227
+ ClassRegistry.prototype.getAllowedProps = function (value) {
4228
+ return this.classToAllowedProps.get(value);
4229
+ };
4230
+ return ClassRegistry;
4231
+ }(Registry));
4232
+
4233
+ var __read$3 = (undefined && undefined.__read) || function (o, n) {
4234
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
4235
+ if (!m) return o;
4236
+ var i = m.call(o), r, ar = [], e;
4060
4237
  try {
4061
- if (r && !r.done && (m = i["return"])) m.call(i);
4062
- } finally {
4063
- if (e) throw e.error;
4238
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
4064
4239
  }
4065
- }
4066
- return ar;
4240
+ catch (error) { e = { error: error }; }
4241
+ finally {
4242
+ try {
4243
+ if (r && !r.done && (m = i["return"])) m.call(i);
4244
+ }
4245
+ finally { if (e) throw e.error; }
4246
+ }
4247
+ return ar;
4067
4248
  };
4068
4249
  function valuesOfObj(record) {
4069
- if ('values' in Object) {
4070
- // eslint-disable-next-line es5/no-es6-methods
4071
- return Object.values(record);
4072
- }
4073
- var values = [];
4074
- // eslint-disable-next-line no-restricted-syntax
4075
- for (var key in record) {
4076
- if (record.hasOwnProperty(key)) {
4077
- values.push(record[key]);
4250
+ if ('values' in Object) {
4251
+ // eslint-disable-next-line es5/no-es6-methods
4252
+ return Object.values(record);
4253
+ }
4254
+ var values = [];
4255
+ // eslint-disable-next-line no-restricted-syntax
4256
+ for (var key in record) {
4257
+ if (record.hasOwnProperty(key)) {
4258
+ values.push(record[key]);
4259
+ }
4078
4260
  }
4079
- }
4080
- return values;
4261
+ return values;
4081
4262
  }
4082
4263
  function find(record, predicate) {
4083
- var values = valuesOfObj(record);
4084
- if ('find' in values) {
4085
- // eslint-disable-next-line es5/no-es6-methods
4086
- return values.find(predicate);
4087
- }
4088
- var valuesNotNever = values;
4089
- for (var i = 0; i < valuesNotNever.length; i++) {
4090
- var value = valuesNotNever[i];
4091
- if (predicate(value)) {
4092
- return value;
4264
+ var values = valuesOfObj(record);
4265
+ if ('find' in values) {
4266
+ // eslint-disable-next-line es5/no-es6-methods
4267
+ return values.find(predicate);
4268
+ }
4269
+ var valuesNotNever = values;
4270
+ for (var i = 0; i < valuesNotNever.length; i++) {
4271
+ var value = valuesNotNever[i];
4272
+ if (predicate(value)) {
4273
+ return value;
4274
+ }
4093
4275
  }
4094
- }
4095
- return undefined;
4276
+ return undefined;
4096
4277
  }
4097
4278
  function forEach(record, run) {
4098
- Object.entries(record).forEach(function (_a) {
4099
- var _b = __read$3(_a, 2),
4100
- key = _b[0],
4101
- value = _b[1];
4102
- return run(value, key);
4103
- });
4279
+ Object.entries(record).forEach(function (_a) {
4280
+ var _b = __read$3(_a, 2), key = _b[0], value = _b[1];
4281
+ return run(value, key);
4282
+ });
4104
4283
  }
4105
4284
  function includes(arr, value) {
4106
- return arr.indexOf(value) !== -1;
4285
+ return arr.indexOf(value) !== -1;
4107
4286
  }
4108
4287
  function findArr(record, predicate) {
4109
- for (var i = 0; i < record.length; i++) {
4110
- var value = record[i];
4111
- if (predicate(value)) {
4112
- return value;
4288
+ for (var i = 0; i < record.length; i++) {
4289
+ var value = record[i];
4290
+ if (predicate(value)) {
4291
+ return value;
4292
+ }
4113
4293
  }
4114
- }
4115
- return undefined;
4294
+ return undefined;
4116
4295
  }
4117
4296
 
4118
- var CustomTransformerRegistry = /** @class */function () {
4119
- function CustomTransformerRegistry() {
4120
- this.transfomers = {};
4121
- }
4122
- CustomTransformerRegistry.prototype.register = function (transformer) {
4123
- this.transfomers[transformer.name] = transformer;
4124
- };
4125
- CustomTransformerRegistry.prototype.findApplicable = function (v) {
4126
- return find(this.transfomers, function (transformer) {
4127
- return transformer.isApplicable(v);
4128
- });
4129
- };
4130
- CustomTransformerRegistry.prototype.findByName = function (name) {
4131
- return this.transfomers[name];
4132
- };
4133
- return CustomTransformerRegistry;
4134
- }();
4297
+ var CustomTransformerRegistry = /** @class */ (function () {
4298
+ function CustomTransformerRegistry() {
4299
+ this.transfomers = {};
4300
+ }
4301
+ CustomTransformerRegistry.prototype.register = function (transformer) {
4302
+ this.transfomers[transformer.name] = transformer;
4303
+ };
4304
+ CustomTransformerRegistry.prototype.findApplicable = function (v) {
4305
+ return find(this.transfomers, function (transformer) {
4306
+ return transformer.isApplicable(v);
4307
+ });
4308
+ };
4309
+ CustomTransformerRegistry.prototype.findByName = function (name) {
4310
+ return this.transfomers[name];
4311
+ };
4312
+ return CustomTransformerRegistry;
4313
+ }());
4135
4314
 
4136
4315
  var getType$1 = function (payload) {
4137
- return Object.prototype.toString.call(payload).slice(8, -1);
4316
+ return Object.prototype.toString.call(payload).slice(8, -1);
4138
4317
  };
4139
4318
  var isUndefined = function (payload) {
4140
- return typeof payload === 'undefined';
4141
- };
4142
- var isNull = function (payload) {
4143
- return payload === null;
4319
+ return typeof payload === 'undefined';
4144
4320
  };
4321
+ var isNull = function (payload) { return payload === null; };
4145
4322
  var isPlainObject$1 = function (payload) {
4146
- if (typeof payload !== 'object' || payload === null) return false;
4147
- if (payload === Object.prototype) return false;
4148
- if (Object.getPrototypeOf(payload) === null) return true;
4149
- return payload.constructor === Object && Object.getPrototypeOf(payload) === Object.prototype;
4323
+ if (typeof payload !== 'object' || payload === null)
4324
+ return false;
4325
+ if (payload === Object.prototype)
4326
+ return false;
4327
+ if (Object.getPrototypeOf(payload) === null)
4328
+ return true;
4329
+ return (payload.constructor === Object &&
4330
+ Object.getPrototypeOf(payload) === Object.prototype);
4150
4331
  };
4151
4332
  var isEmptyObject = function (payload) {
4152
- return isPlainObject$1(payload) && Object.keys(payload).length === 0;
4333
+ return isPlainObject$1(payload) && Object.keys(payload).length === 0;
4153
4334
  };
4154
4335
  var isArray$1 = function (payload) {
4155
- return Array.isArray(payload);
4336
+ return Array.isArray(payload);
4156
4337
  };
4157
4338
  var isString = function (payload) {
4158
- return typeof payload === 'string';
4339
+ return typeof payload === 'string';
4159
4340
  };
4160
4341
  var isNumber = function (payload) {
4161
- return typeof payload === 'number' && !isNaN(payload);
4342
+ return typeof payload === 'number' && !isNaN(payload);
4162
4343
  };
4163
4344
  var isBoolean = function (payload) {
4164
- return typeof payload === 'boolean';
4345
+ return typeof payload === 'boolean';
4165
4346
  };
4166
4347
  var isRegExp = function (payload) {
4167
- return payload instanceof RegExp;
4348
+ return payload instanceof RegExp;
4168
4349
  };
4169
4350
  var isMap = function (payload) {
4170
- return payload instanceof Map;
4351
+ return payload instanceof Map;
4171
4352
  };
4172
4353
  var isSet = function (payload) {
4173
- return payload instanceof Set;
4354
+ return payload instanceof Set;
4174
4355
  };
4175
4356
  var isSymbol = function (payload) {
4176
- return getType$1(payload) === 'Symbol';
4357
+ return getType$1(payload) === 'Symbol';
4177
4358
  };
4178
4359
  var isDate = function (payload) {
4179
- return payload instanceof Date && !isNaN(payload.valueOf());
4360
+ return payload instanceof Date && !isNaN(payload.valueOf());
4180
4361
  };
4181
4362
  var isError = function (payload) {
4182
- return payload instanceof Error;
4363
+ return payload instanceof Error;
4183
4364
  };
4184
4365
  var isNaNValue = function (payload) {
4185
- return typeof payload === 'number' && isNaN(payload);
4366
+ return typeof payload === 'number' && isNaN(payload);
4186
4367
  };
4187
4368
  var isPrimitive = function (payload) {
4188
- return isBoolean(payload) || isNull(payload) || isUndefined(payload) || isNumber(payload) || isString(payload) || isSymbol(payload);
4369
+ return isBoolean(payload) ||
4370
+ isNull(payload) ||
4371
+ isUndefined(payload) ||
4372
+ isNumber(payload) ||
4373
+ isString(payload) ||
4374
+ isSymbol(payload);
4189
4375
  };
4190
4376
  var isBigint = function (payload) {
4191
- return typeof payload === 'bigint';
4377
+ return typeof payload === 'bigint';
4192
4378
  };
4193
4379
  var isInfinite = function (payload) {
4194
- return payload === Infinity || payload === -Infinity;
4380
+ return payload === Infinity || payload === -Infinity;
4195
4381
  };
4196
4382
  var isTypedArray = function (payload) {
4197
- return ArrayBuffer.isView(payload) && !(payload instanceof DataView);
4198
- };
4199
- var isURL = function (payload) {
4200
- return payload instanceof URL;
4383
+ return ArrayBuffer.isView(payload) && !(payload instanceof DataView);
4201
4384
  };
4385
+ var isURL = function (payload) { return payload instanceof URL; };
4202
4386
 
4203
- var escapeKey = function (key) {
4204
- return key.replace(/\./g, '\\.');
4205
- };
4387
+ var escapeKey = function (key) { return key.replace(/\./g, '\\.'); };
4206
4388
  var stringifyPath = function (path) {
4207
- return path.map(String).map(escapeKey).join('.');
4389
+ return path
4390
+ .map(String)
4391
+ .map(escapeKey)
4392
+ .join('.');
4208
4393
  };
4209
4394
  var parsePath = function (string) {
4210
- var result = [];
4211
- var segment = '';
4212
- for (var i = 0; i < string.length; i++) {
4213
- var char = string.charAt(i);
4214
- var isEscapedDot = char === '\\' && string.charAt(i + 1) === '.';
4215
- if (isEscapedDot) {
4216
- segment += '.';
4217
- i++;
4218
- continue;
4219
- }
4220
- var isEndOfSegment = char === '.';
4221
- if (isEndOfSegment) {
4222
- result.push(segment);
4223
- segment = '';
4224
- continue;
4395
+ var result = [];
4396
+ var segment = '';
4397
+ for (var i = 0; i < string.length; i++) {
4398
+ var char = string.charAt(i);
4399
+ var isEscapedDot = char === '\\' && string.charAt(i + 1) === '.';
4400
+ if (isEscapedDot) {
4401
+ segment += '.';
4402
+ i++;
4403
+ continue;
4404
+ }
4405
+ var isEndOfSegment = char === '.';
4406
+ if (isEndOfSegment) {
4407
+ result.push(segment);
4408
+ segment = '';
4409
+ continue;
4410
+ }
4411
+ segment += char;
4225
4412
  }
4226
- segment += char;
4227
- }
4228
- var lastSegment = segment;
4229
- result.push(lastSegment);
4230
- return result;
4413
+ var lastSegment = segment;
4414
+ result.push(lastSegment);
4415
+ return result;
4231
4416
  };
4232
4417
 
4233
- var __assign$1 = undefined && undefined.__assign || function () {
4234
- __assign$1 = Object.assign || function (t) {
4235
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4236
- s = arguments[i];
4237
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
4238
- }
4239
- return t;
4240
- };
4241
- return __assign$1.apply(this, arguments);
4242
- };
4243
- var __read$2 = undefined && undefined.__read || function (o, n) {
4244
- var m = typeof Symbol === "function" && o[Symbol.iterator];
4245
- if (!m) return o;
4246
- var i = m.call(o),
4247
- r,
4248
- ar = [],
4249
- e;
4250
- try {
4251
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
4252
- } catch (error) {
4253
- e = {
4254
- error: error
4418
+ var __assign$1 = (undefined && undefined.__assign) || function () {
4419
+ __assign$1 = Object.assign || function(t) {
4420
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4421
+ s = arguments[i];
4422
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
4423
+ t[p] = s[p];
4424
+ }
4425
+ return t;
4255
4426
  };
4256
- } finally {
4427
+ return __assign$1.apply(this, arguments);
4428
+ };
4429
+ var __read$2 = (undefined && undefined.__read) || function (o, n) {
4430
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
4431
+ if (!m) return o;
4432
+ var i = m.call(o), r, ar = [], e;
4257
4433
  try {
4258
- if (r && !r.done && (m = i["return"])) m.call(i);
4259
- } finally {
4260
- if (e) throw e.error;
4434
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
4261
4435
  }
4262
- }
4263
- return ar;
4436
+ catch (error) { e = { error: error }; }
4437
+ finally {
4438
+ try {
4439
+ if (r && !r.done && (m = i["return"])) m.call(i);
4440
+ }
4441
+ finally { if (e) throw e.error; }
4442
+ }
4443
+ return ar;
4264
4444
  };
4265
- var __spreadArray$2 = undefined && undefined.__spreadArray || function (to, from) {
4266
- for (var i = 0, il = from.length, j = to.length; i < il; i++, j++) to[j] = from[i];
4267
- return to;
4445
+ var __spreadArray$2 = (undefined && undefined.__spreadArray) || function (to, from) {
4446
+ for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
4447
+ to[j] = from[i];
4448
+ return to;
4268
4449
  };
4269
4450
  function simpleTransformation(isApplicable, annotation, transform, untransform) {
4270
- return {
4271
- isApplicable: isApplicable,
4272
- annotation: annotation,
4273
- transform: transform,
4274
- untransform: untransform
4275
- };
4451
+ return {
4452
+ isApplicable: isApplicable,
4453
+ annotation: annotation,
4454
+ transform: transform,
4455
+ untransform: untransform
4456
+ };
4276
4457
  }
4277
- var simpleRules = [simpleTransformation(isUndefined, 'undefined', function () {
4278
- return null;
4279
- }, function () {
4280
- return undefined;
4281
- }), simpleTransformation(isBigint, 'bigint', function (v) {
4282
- return v.toString();
4283
- }, function (v) {
4284
- if (typeof BigInt !== 'undefined') {
4285
- return BigInt(v);
4286
- }
4287
- console.error('Please add a BigInt polyfill.');
4288
- return v;
4289
- }), simpleTransformation(isDate, 'Date', function (v) {
4290
- return v.toISOString();
4291
- }, function (v) {
4292
- return new Date(v);
4293
- }), simpleTransformation(isError, 'Error', function (v, superJson) {
4294
- var baseError = {
4295
- name: v.name,
4296
- message: v.message
4297
- };
4298
- superJson.allowedErrorProps.forEach(function (prop) {
4299
- baseError[prop] = v[prop];
4300
- });
4301
- return baseError;
4302
- }, function (v, superJson) {
4303
- var e = new Error(v.message);
4304
- e.name = v.name;
4305
- e.stack = v.stack;
4306
- superJson.allowedErrorProps.forEach(function (prop) {
4307
- e[prop] = v[prop];
4308
- });
4309
- return e;
4310
- }), simpleTransformation(isRegExp, 'regexp', function (v) {
4311
- return '' + v;
4312
- }, function (regex) {
4313
- var body = regex.slice(1, regex.lastIndexOf('/'));
4314
- var flags = regex.slice(regex.lastIndexOf('/') + 1);
4315
- return new RegExp(body, flags);
4316
- }), simpleTransformation(isSet, 'set',
4317
- // (sets only exist in es6+)
4318
- // eslint-disable-next-line es5/no-es6-methods
4319
- function (v) {
4320
- return __spreadArray$2([], __read$2(v.values()));
4321
- }, function (v) {
4322
- return new Set(v);
4323
- }), simpleTransformation(isMap, 'map', function (v) {
4324
- return __spreadArray$2([], __read$2(v.entries()));
4325
- }, function (v) {
4326
- return new Map(v);
4327
- }), simpleTransformation(function (v) {
4328
- return isNaNValue(v) || isInfinite(v);
4329
- }, 'number', function (v) {
4330
- if (isNaNValue(v)) {
4331
- return 'NaN';
4332
- }
4333
- if (v > 0) {
4334
- return 'Infinity';
4335
- } else {
4336
- return '-Infinity';
4337
- }
4338
- }, Number), simpleTransformation(function (v) {
4339
- return v === 0 && 1 / v === -Infinity;
4340
- }, 'number', function () {
4341
- return '-0';
4342
- }, Number), simpleTransformation(isURL, 'URL', function (v) {
4343
- return v.toString();
4344
- }, function (v) {
4345
- return new URL(v);
4346
- })];
4458
+ var simpleRules = [
4459
+ simpleTransformation(isUndefined, 'undefined', function () { return null; }, function () { return undefined; }),
4460
+ simpleTransformation(isBigint, 'bigint', function (v) { return v.toString(); }, function (v) {
4461
+ if (typeof BigInt !== 'undefined') {
4462
+ return BigInt(v);
4463
+ }
4464
+ console.error('Please add a BigInt polyfill.');
4465
+ return v;
4466
+ }),
4467
+ simpleTransformation(isDate, 'Date', function (v) { return v.toISOString(); }, function (v) { return new Date(v); }),
4468
+ simpleTransformation(isError, 'Error', function (v, superJson) {
4469
+ var baseError = {
4470
+ name: v.name,
4471
+ message: v.message
4472
+ };
4473
+ superJson.allowedErrorProps.forEach(function (prop) {
4474
+ baseError[prop] = v[prop];
4475
+ });
4476
+ return baseError;
4477
+ }, function (v, superJson) {
4478
+ var e = new Error(v.message);
4479
+ e.name = v.name;
4480
+ e.stack = v.stack;
4481
+ superJson.allowedErrorProps.forEach(function (prop) {
4482
+ e[prop] = v[prop];
4483
+ });
4484
+ return e;
4485
+ }),
4486
+ simpleTransformation(isRegExp, 'regexp', function (v) { return '' + v; }, function (regex) {
4487
+ var body = regex.slice(1, regex.lastIndexOf('/'));
4488
+ var flags = regex.slice(regex.lastIndexOf('/') + 1);
4489
+ return new RegExp(body, flags);
4490
+ }),
4491
+ simpleTransformation(isSet, 'set',
4492
+ // (sets only exist in es6+)
4493
+ // eslint-disable-next-line es5/no-es6-methods
4494
+ function (v) { return __spreadArray$2([], __read$2(v.values())); }, function (v) { return new Set(v); }),
4495
+ simpleTransformation(isMap, 'map', function (v) { return __spreadArray$2([], __read$2(v.entries())); }, function (v) { return new Map(v); }),
4496
+ simpleTransformation(function (v) { return isNaNValue(v) || isInfinite(v); }, 'number', function (v) {
4497
+ if (isNaNValue(v)) {
4498
+ return 'NaN';
4499
+ }
4500
+ if (v > 0) {
4501
+ return 'Infinity';
4502
+ }
4503
+ else {
4504
+ return '-Infinity';
4505
+ }
4506
+ }, Number),
4507
+ simpleTransformation(function (v) { return v === 0 && 1 / v === -Infinity; }, 'number', function () {
4508
+ return '-0';
4509
+ }, Number),
4510
+ simpleTransformation(isURL, 'URL', function (v) { return v.toString(); }, function (v) { return new URL(v); }),
4511
+ ];
4347
4512
  function compositeTransformation(isApplicable, annotation, transform, untransform) {
4348
- return {
4349
- isApplicable: isApplicable,
4350
- annotation: annotation,
4351
- transform: transform,
4352
- untransform: untransform
4353
- };
4513
+ return {
4514
+ isApplicable: isApplicable,
4515
+ annotation: annotation,
4516
+ transform: transform,
4517
+ untransform: untransform
4518
+ };
4354
4519
  }
4355
4520
  var symbolRule = compositeTransformation(function (s, superJson) {
4356
- if (isSymbol(s)) {
4357
- var isRegistered = !!superJson.symbolRegistry.getIdentifier(s);
4358
- return isRegistered;
4359
- }
4360
- return false;
4521
+ if (isSymbol(s)) {
4522
+ var isRegistered = !!superJson.symbolRegistry.getIdentifier(s);
4523
+ return isRegistered;
4524
+ }
4525
+ return false;
4361
4526
  }, function (s, superJson) {
4362
- var identifier = superJson.symbolRegistry.getIdentifier(s);
4363
- return ['symbol', identifier];
4364
- }, function (v) {
4365
- return v.description;
4366
- }, function (_, a, superJson) {
4367
- var value = superJson.symbolRegistry.getValue(a[1]);
4368
- if (!value) {
4369
- throw new Error('Trying to deserialize unknown symbol');
4370
- }
4371
- return value;
4527
+ var identifier = superJson.symbolRegistry.getIdentifier(s);
4528
+ return ['symbol', identifier];
4529
+ }, function (v) { return v.description; }, function (_, a, superJson) {
4530
+ var value = superJson.symbolRegistry.getValue(a[1]);
4531
+ if (!value) {
4532
+ throw new Error('Trying to deserialize unknown symbol');
4533
+ }
4534
+ return value;
4372
4535
  });
4373
- var constructorToName = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array, Uint8ClampedArray].reduce(function (obj, ctor) {
4374
- obj[ctor.name] = ctor;
4375
- return obj;
4536
+ var constructorToName = [
4537
+ Int8Array,
4538
+ Uint8Array,
4539
+ Int16Array,
4540
+ Uint16Array,
4541
+ Int32Array,
4542
+ Uint32Array,
4543
+ Float32Array,
4544
+ Float64Array,
4545
+ Uint8ClampedArray,
4546
+ ].reduce(function (obj, ctor) {
4547
+ obj[ctor.name] = ctor;
4548
+ return obj;
4376
4549
  }, {});
4377
- var typedArrayRule = compositeTransformation(isTypedArray, function (v) {
4378
- return ['typed-array', v.constructor.name];
4379
- }, function (v) {
4380
- return __spreadArray$2([], __read$2(v));
4381
- }, function (v, a) {
4382
- var ctor = constructorToName[a[1]];
4383
- if (!ctor) {
4384
- throw new Error('Trying to deserialize unknown typed array');
4385
- }
4386
- return new ctor(v);
4550
+ var typedArrayRule = compositeTransformation(isTypedArray, function (v) { return ['typed-array', v.constructor.name]; }, function (v) { return __spreadArray$2([], __read$2(v)); }, function (v, a) {
4551
+ var ctor = constructorToName[a[1]];
4552
+ if (!ctor) {
4553
+ throw new Error('Trying to deserialize unknown typed array');
4554
+ }
4555
+ return new ctor(v);
4387
4556
  });
4388
4557
  function isInstanceOfRegisteredClass(potentialClass, superJson) {
4389
- if (potentialClass === null || potentialClass === void 0 ? void 0 : potentialClass.constructor) {
4390
- var isRegistered = !!superJson.classRegistry.getIdentifier(potentialClass.constructor);
4391
- return isRegistered;
4392
- }
4393
- return false;
4558
+ if (potentialClass === null || potentialClass === void 0 ? void 0 : potentialClass.constructor) {
4559
+ var isRegistered = !!superJson.classRegistry.getIdentifier(potentialClass.constructor);
4560
+ return isRegistered;
4561
+ }
4562
+ return false;
4394
4563
  }
4395
4564
  var classRule = compositeTransformation(isInstanceOfRegisteredClass, function (clazz, superJson) {
4396
- var identifier = superJson.classRegistry.getIdentifier(clazz.constructor);
4397
- return ['class', identifier];
4565
+ var identifier = superJson.classRegistry.getIdentifier(clazz.constructor);
4566
+ return ['class', identifier];
4398
4567
  }, function (clazz, superJson) {
4399
- var allowedProps = superJson.classRegistry.getAllowedProps(clazz.constructor);
4400
- if (!allowedProps) {
4401
- return __assign$1({}, clazz);
4402
- }
4403
- var result = {};
4404
- allowedProps.forEach(function (prop) {
4405
- result[prop] = clazz[prop];
4406
- });
4407
- return result;
4568
+ var allowedProps = superJson.classRegistry.getAllowedProps(clazz.constructor);
4569
+ if (!allowedProps) {
4570
+ return __assign$1({}, clazz);
4571
+ }
4572
+ var result = {};
4573
+ allowedProps.forEach(function (prop) {
4574
+ result[prop] = clazz[prop];
4575
+ });
4576
+ return result;
4408
4577
  }, function (v, a, superJson) {
4409
- var clazz = superJson.classRegistry.getValue(a[1]);
4410
- if (!clazz) {
4411
- throw new Error('Trying to deserialize unknown class - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564');
4412
- }
4413
- return Object.assign(Object.create(clazz.prototype), v);
4578
+ var clazz = superJson.classRegistry.getValue(a[1]);
4579
+ if (!clazz) {
4580
+ throw new Error('Trying to deserialize unknown class - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564');
4581
+ }
4582
+ return Object.assign(Object.create(clazz.prototype), v);
4414
4583
  });
4415
4584
  var customRule = compositeTransformation(function (value, superJson) {
4416
- return !!superJson.customTransformerRegistry.findApplicable(value);
4585
+ return !!superJson.customTransformerRegistry.findApplicable(value);
4417
4586
  }, function (value, superJson) {
4418
- var transformer = superJson.customTransformerRegistry.findApplicable(value);
4419
- return ['custom', transformer.name];
4587
+ var transformer = superJson.customTransformerRegistry.findApplicable(value);
4588
+ return ['custom', transformer.name];
4420
4589
  }, function (value, superJson) {
4421
- var transformer = superJson.customTransformerRegistry.findApplicable(value);
4422
- return transformer.serialize(value);
4590
+ var transformer = superJson.customTransformerRegistry.findApplicable(value);
4591
+ return transformer.serialize(value);
4423
4592
  }, function (v, a, superJson) {
4424
- var transformer = superJson.customTransformerRegistry.findByName(a[1]);
4425
- if (!transformer) {
4426
- throw new Error('Trying to deserialize unknown custom value');
4427
- }
4428
- return transformer.deserialize(v);
4593
+ var transformer = superJson.customTransformerRegistry.findByName(a[1]);
4594
+ if (!transformer) {
4595
+ throw new Error('Trying to deserialize unknown custom value');
4596
+ }
4597
+ return transformer.deserialize(v);
4429
4598
  });
4430
4599
  var compositeRules = [classRule, symbolRule, customRule, typedArrayRule];
4431
4600
  var transformValue = function (value, superJson) {
4432
- var applicableCompositeRule = findArr(compositeRules, function (rule) {
4433
- return rule.isApplicable(value, superJson);
4434
- });
4435
- if (applicableCompositeRule) {
4436
- return {
4437
- value: applicableCompositeRule.transform(value, superJson),
4438
- type: applicableCompositeRule.annotation(value, superJson)
4439
- };
4440
- }
4441
- var applicableSimpleRule = findArr(simpleRules, function (rule) {
4442
- return rule.isApplicable(value, superJson);
4443
- });
4444
- if (applicableSimpleRule) {
4445
- return {
4446
- value: applicableSimpleRule.transform(value, superJson),
4447
- type: applicableSimpleRule.annotation
4448
- };
4449
- }
4450
- return undefined;
4601
+ var applicableCompositeRule = findArr(compositeRules, function (rule) {
4602
+ return rule.isApplicable(value, superJson);
4603
+ });
4604
+ if (applicableCompositeRule) {
4605
+ return {
4606
+ value: applicableCompositeRule.transform(value, superJson),
4607
+ type: applicableCompositeRule.annotation(value, superJson)
4608
+ };
4609
+ }
4610
+ var applicableSimpleRule = findArr(simpleRules, function (rule) {
4611
+ return rule.isApplicable(value, superJson);
4612
+ });
4613
+ if (applicableSimpleRule) {
4614
+ return {
4615
+ value: applicableSimpleRule.transform(value, superJson),
4616
+ type: applicableSimpleRule.annotation
4617
+ };
4618
+ }
4619
+ return undefined;
4451
4620
  };
4452
4621
  var simpleRulesByAnnotation = {};
4453
4622
  simpleRules.forEach(function (rule) {
4454
- simpleRulesByAnnotation[rule.annotation] = rule;
4623
+ simpleRulesByAnnotation[rule.annotation] = rule;
4455
4624
  });
4456
4625
  var untransformValue = function (json, type, superJson) {
4457
- if (isArray$1(type)) {
4458
- switch (type[0]) {
4459
- case 'symbol':
4460
- return symbolRule.untransform(json, type, superJson);
4461
- case 'class':
4462
- return classRule.untransform(json, type, superJson);
4463
- case 'custom':
4464
- return customRule.untransform(json, type, superJson);
4465
- case 'typed-array':
4466
- return typedArrayRule.untransform(json, type, superJson);
4467
- default:
4468
- throw new Error('Unknown transformation: ' + type);
4626
+ if (isArray$1(type)) {
4627
+ switch (type[0]) {
4628
+ case 'symbol':
4629
+ return symbolRule.untransform(json, type, superJson);
4630
+ case 'class':
4631
+ return classRule.untransform(json, type, superJson);
4632
+ case 'custom':
4633
+ return customRule.untransform(json, type, superJson);
4634
+ case 'typed-array':
4635
+ return typedArrayRule.untransform(json, type, superJson);
4636
+ default:
4637
+ throw new Error('Unknown transformation: ' + type);
4638
+ }
4469
4639
  }
4470
- } else {
4471
- var transformation = simpleRulesByAnnotation[type];
4472
- if (!transformation) {
4473
- throw new Error('Unknown transformation: ' + type);
4640
+ else {
4641
+ var transformation = simpleRulesByAnnotation[type];
4642
+ if (!transformation) {
4643
+ throw new Error('Unknown transformation: ' + type);
4644
+ }
4645
+ return transformation.untransform(json, superJson);
4474
4646
  }
4475
- return transformation.untransform(json, superJson);
4476
- }
4477
4647
  };
4478
4648
 
4479
4649
  var getNthKey = function (value, n) {
4480
- var keys = value.keys();
4481
- while (n > 0) {
4482
- keys.next();
4483
- n--;
4484
- }
4485
- return keys.next().value;
4650
+ var keys = value.keys();
4651
+ while (n > 0) {
4652
+ keys.next();
4653
+ n--;
4654
+ }
4655
+ return keys.next().value;
4486
4656
  };
4487
4657
  function validatePath(path) {
4488
- if (includes(path, '__proto__')) {
4489
- throw new Error('__proto__ is not allowed as a property');
4490
- }
4491
- if (includes(path, 'prototype')) {
4492
- throw new Error('prototype is not allowed as a property');
4493
- }
4494
- if (includes(path, 'constructor')) {
4495
- throw new Error('constructor is not allowed as a property');
4496
- }
4658
+ if (includes(path, '__proto__')) {
4659
+ throw new Error('__proto__ is not allowed as a property');
4660
+ }
4661
+ if (includes(path, 'prototype')) {
4662
+ throw new Error('prototype is not allowed as a property');
4663
+ }
4664
+ if (includes(path, 'constructor')) {
4665
+ throw new Error('constructor is not allowed as a property');
4666
+ }
4497
4667
  }
4498
4668
  var getDeep = function (object, path) {
4499
- validatePath(path);
4500
- for (var i = 0; i < path.length; i++) {
4501
- var key = path[i];
4502
- if (isSet(object)) {
4503
- object = getNthKey(object, +key);
4504
- } else if (isMap(object)) {
4505
- var row = +key;
4506
- var type = +path[++i] === 0 ? 'key' : 'value';
4507
- var keyOfRow = getNthKey(object, row);
4508
- switch (type) {
4509
- case 'key':
4510
- object = keyOfRow;
4511
- break;
4512
- case 'value':
4513
- object = object.get(keyOfRow);
4514
- break;
4515
- }
4516
- } else {
4517
- object = object[key];
4669
+ validatePath(path);
4670
+ for (var i = 0; i < path.length; i++) {
4671
+ var key = path[i];
4672
+ if (isSet(object)) {
4673
+ object = getNthKey(object, +key);
4674
+ }
4675
+ else if (isMap(object)) {
4676
+ var row = +key;
4677
+ var type = +path[++i] === 0 ? 'key' : 'value';
4678
+ var keyOfRow = getNthKey(object, row);
4679
+ switch (type) {
4680
+ case 'key':
4681
+ object = keyOfRow;
4682
+ break;
4683
+ case 'value':
4684
+ object = object.get(keyOfRow);
4685
+ break;
4686
+ }
4687
+ }
4688
+ else {
4689
+ object = object[key];
4690
+ }
4518
4691
  }
4519
- }
4520
- return object;
4692
+ return object;
4521
4693
  };
4522
4694
  var setDeep = function (object, path, mapper) {
4523
- validatePath(path);
4524
- if (path.length === 0) {
4525
- return mapper(object);
4526
- }
4527
- var parent = object;
4528
- for (var i = 0; i < path.length - 1; i++) {
4529
- var key = path[i];
4695
+ validatePath(path);
4696
+ if (path.length === 0) {
4697
+ return mapper(object);
4698
+ }
4699
+ var parent = object;
4700
+ for (var i = 0; i < path.length - 1; i++) {
4701
+ var key = path[i];
4702
+ if (isArray$1(parent)) {
4703
+ var index = +key;
4704
+ parent = parent[index];
4705
+ }
4706
+ else if (isPlainObject$1(parent)) {
4707
+ parent = parent[key];
4708
+ }
4709
+ else if (isSet(parent)) {
4710
+ var row = +key;
4711
+ parent = getNthKey(parent, row);
4712
+ }
4713
+ else if (isMap(parent)) {
4714
+ var isEnd = i === path.length - 2;
4715
+ if (isEnd) {
4716
+ break;
4717
+ }
4718
+ var row = +key;
4719
+ var type = +path[++i] === 0 ? 'key' : 'value';
4720
+ var keyOfRow = getNthKey(parent, row);
4721
+ switch (type) {
4722
+ case 'key':
4723
+ parent = keyOfRow;
4724
+ break;
4725
+ case 'value':
4726
+ parent = parent.get(keyOfRow);
4727
+ break;
4728
+ }
4729
+ }
4730
+ }
4731
+ var lastKey = path[path.length - 1];
4530
4732
  if (isArray$1(parent)) {
4531
- var index = +key;
4532
- parent = parent[index];
4533
- } else if (isPlainObject$1(parent)) {
4534
- parent = parent[key];
4535
- } else if (isSet(parent)) {
4536
- var row = +key;
4537
- parent = getNthKey(parent, row);
4538
- } else if (isMap(parent)) {
4539
- var isEnd = i === path.length - 2;
4540
- if (isEnd) {
4541
- break;
4542
- }
4543
- var row = +key;
4544
- var type = +path[++i] === 0 ? 'key' : 'value';
4545
- var keyOfRow = getNthKey(parent, row);
4546
- switch (type) {
4547
- case 'key':
4548
- parent = keyOfRow;
4549
- break;
4550
- case 'value':
4551
- parent = parent.get(keyOfRow);
4552
- break;
4553
- }
4733
+ parent[+lastKey] = mapper(parent[+lastKey]);
4554
4734
  }
4555
- }
4556
- var lastKey = path[path.length - 1];
4557
- if (isArray$1(parent)) {
4558
- parent[+lastKey] = mapper(parent[+lastKey]);
4559
- } else if (isPlainObject$1(parent)) {
4560
- parent[lastKey] = mapper(parent[lastKey]);
4561
- }
4562
- if (isSet(parent)) {
4563
- var oldValue = getNthKey(parent, +lastKey);
4564
- var newValue = mapper(oldValue);
4565
- if (oldValue !== newValue) {
4566
- parent["delete"](oldValue);
4567
- parent.add(newValue);
4735
+ else if (isPlainObject$1(parent)) {
4736
+ parent[lastKey] = mapper(parent[lastKey]);
4568
4737
  }
4569
- }
4570
- if (isMap(parent)) {
4571
- var row = +path[path.length - 2];
4572
- var keyToRow = getNthKey(parent, row);
4573
- var type = +lastKey === 0 ? 'key' : 'value';
4574
- switch (type) {
4575
- case 'key':
4576
- {
4577
- var newKey = mapper(keyToRow);
4578
- parent.set(newKey, parent.get(keyToRow));
4579
- if (newKey !== keyToRow) {
4580
- parent["delete"](keyToRow);
4581
- }
4582
- break;
4738
+ if (isSet(parent)) {
4739
+ var oldValue = getNthKey(parent, +lastKey);
4740
+ var newValue = mapper(oldValue);
4741
+ if (oldValue !== newValue) {
4742
+ parent["delete"](oldValue);
4743
+ parent.add(newValue);
4583
4744
  }
4584
- case 'value':
4585
- {
4586
- parent.set(keyToRow, mapper(parent.get(keyToRow)));
4587
- break;
4745
+ }
4746
+ if (isMap(parent)) {
4747
+ var row = +path[path.length - 2];
4748
+ var keyToRow = getNthKey(parent, row);
4749
+ var type = +lastKey === 0 ? 'key' : 'value';
4750
+ switch (type) {
4751
+ case 'key': {
4752
+ var newKey = mapper(keyToRow);
4753
+ parent.set(newKey, parent.get(keyToRow));
4754
+ if (newKey !== keyToRow) {
4755
+ parent["delete"](keyToRow);
4756
+ }
4757
+ break;
4758
+ }
4759
+ case 'value': {
4760
+ parent.set(keyToRow, mapper(parent.get(keyToRow)));
4761
+ break;
4762
+ }
4588
4763
  }
4589
4764
  }
4590
- }
4591
- return object;
4765
+ return object;
4592
4766
  };
4593
4767
 
4594
- var __read$1 = undefined && undefined.__read || function (o, n) {
4595
- var m = typeof Symbol === "function" && o[Symbol.iterator];
4596
- if (!m) return o;
4597
- var i = m.call(o),
4598
- r,
4599
- ar = [],
4600
- e;
4601
- try {
4602
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
4603
- } catch (error) {
4604
- e = {
4605
- error: error
4606
- };
4607
- } finally {
4768
+ var __read$1 = (undefined && undefined.__read) || function (o, n) {
4769
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
4770
+ if (!m) return o;
4771
+ var i = m.call(o), r, ar = [], e;
4608
4772
  try {
4609
- if (r && !r.done && (m = i["return"])) m.call(i);
4610
- } finally {
4611
- if (e) throw e.error;
4773
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
4612
4774
  }
4613
- }
4614
- return ar;
4775
+ catch (error) { e = { error: error }; }
4776
+ finally {
4777
+ try {
4778
+ if (r && !r.done && (m = i["return"])) m.call(i);
4779
+ }
4780
+ finally { if (e) throw e.error; }
4781
+ }
4782
+ return ar;
4615
4783
  };
4616
- var __spreadArray$1 = undefined && undefined.__spreadArray || function (to, from) {
4617
- for (var i = 0, il = from.length, j = to.length; i < il; i++, j++) to[j] = from[i];
4618
- return to;
4784
+ var __spreadArray$1 = (undefined && undefined.__spreadArray) || function (to, from) {
4785
+ for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
4786
+ to[j] = from[i];
4787
+ return to;
4619
4788
  };
4620
4789
  function traverse(tree, walker, origin) {
4621
- if (origin === void 0) {
4622
- origin = [];
4623
- }
4624
- if (!tree) {
4625
- return;
4626
- }
4627
- if (!isArray$1(tree)) {
4628
- forEach(tree, function (subtree, key) {
4629
- return traverse(subtree, walker, __spreadArray$1(__spreadArray$1([], __read$1(origin)), __read$1(parsePath(key))));
4630
- });
4631
- return;
4632
- }
4633
- var _a = __read$1(tree, 2),
4634
- nodeValue = _a[0],
4635
- children = _a[1];
4636
- if (children) {
4637
- forEach(children, function (child, key) {
4638
- traverse(child, walker, __spreadArray$1(__spreadArray$1([], __read$1(origin)), __read$1(parsePath(key))));
4639
- });
4640
- }
4641
- walker(nodeValue, origin);
4790
+ if (origin === void 0) { origin = []; }
4791
+ if (!tree) {
4792
+ return;
4793
+ }
4794
+ if (!isArray$1(tree)) {
4795
+ forEach(tree, function (subtree, key) {
4796
+ return traverse(subtree, walker, __spreadArray$1(__spreadArray$1([], __read$1(origin)), __read$1(parsePath(key))));
4797
+ });
4798
+ return;
4799
+ }
4800
+ var _a = __read$1(tree, 2), nodeValue = _a[0], children = _a[1];
4801
+ if (children) {
4802
+ forEach(children, function (child, key) {
4803
+ traverse(child, walker, __spreadArray$1(__spreadArray$1([], __read$1(origin)), __read$1(parsePath(key))));
4804
+ });
4805
+ }
4806
+ walker(nodeValue, origin);
4642
4807
  }
4643
4808
  function applyValueAnnotations(plain, annotations, superJson) {
4644
- traverse(annotations, function (type, path) {
4645
- plain = setDeep(plain, path, function (v) {
4646
- return untransformValue(v, type, superJson);
4809
+ traverse(annotations, function (type, path) {
4810
+ plain = setDeep(plain, path, function (v) { return untransformValue(v, type, superJson); });
4647
4811
  });
4648
- });
4649
- return plain;
4812
+ return plain;
4650
4813
  }
4651
4814
  function applyReferentialEqualityAnnotations(plain, annotations) {
4652
- function apply(identicalPaths, path) {
4653
- var object = getDeep(plain, parsePath(path));
4654
- identicalPaths.map(parsePath).forEach(function (identicalObjectPath) {
4655
- plain = setDeep(plain, identicalObjectPath, function () {
4656
- return object;
4657
- });
4658
- });
4659
- }
4660
- if (isArray$1(annotations)) {
4661
- var _a = __read$1(annotations, 2),
4662
- root = _a[0],
4663
- other = _a[1];
4664
- root.forEach(function (identicalPath) {
4665
- plain = setDeep(plain, parsePath(identicalPath), function () {
4666
- return plain;
4667
- });
4668
- });
4669
- if (other) {
4670
- forEach(other, apply);
4815
+ function apply(identicalPaths, path) {
4816
+ var object = getDeep(plain, parsePath(path));
4817
+ identicalPaths.map(parsePath).forEach(function (identicalObjectPath) {
4818
+ plain = setDeep(plain, identicalObjectPath, function () { return object; });
4819
+ });
4671
4820
  }
4672
- } else {
4673
- forEach(annotations, apply);
4674
- }
4675
- return plain;
4821
+ if (isArray$1(annotations)) {
4822
+ var _a = __read$1(annotations, 2), root = _a[0], other = _a[1];
4823
+ root.forEach(function (identicalPath) {
4824
+ plain = setDeep(plain, parsePath(identicalPath), function () { return plain; });
4825
+ });
4826
+ if (other) {
4827
+ forEach(other, apply);
4828
+ }
4829
+ }
4830
+ else {
4831
+ forEach(annotations, apply);
4832
+ }
4833
+ return plain;
4676
4834
  }
4677
4835
  var isDeep = function (object, superJson) {
4678
- return isPlainObject$1(object) || isArray$1(object) || isMap(object) || isSet(object) || isInstanceOfRegisteredClass(object, superJson);
4836
+ return isPlainObject$1(object) ||
4837
+ isArray$1(object) ||
4838
+ isMap(object) ||
4839
+ isSet(object) ||
4840
+ isInstanceOfRegisteredClass(object, superJson);
4679
4841
  };
4680
4842
  function addIdentity(object, path, identities) {
4681
- var existingSet = identities.get(object);
4682
- if (existingSet) {
4683
- existingSet.push(path);
4684
- } else {
4685
- identities.set(object, [path]);
4686
- }
4843
+ var existingSet = identities.get(object);
4844
+ if (existingSet) {
4845
+ existingSet.push(path);
4846
+ }
4847
+ else {
4848
+ identities.set(object, [path]);
4849
+ }
4687
4850
  }
4688
4851
  function generateReferentialEqualityAnnotations(identitites) {
4689
- var result = {};
4690
- var rootEqualityPaths = undefined;
4691
- identitites.forEach(function (paths) {
4692
- if (paths.length <= 1) {
4693
- return;
4694
- }
4695
- var _a = __read$1(paths.map(function (path) {
4696
- return path.map(String);
4697
- }).sort(function (a, b) {
4698
- return a.length - b.length;
4699
- })),
4700
- shortestPath = _a[0],
4701
- identicalPaths = _a.slice(1);
4702
- if (shortestPath.length === 0) {
4703
- rootEqualityPaths = identicalPaths.map(stringifyPath);
4704
- } else {
4705
- result[stringifyPath(shortestPath)] = identicalPaths.map(stringifyPath);
4852
+ var result = {};
4853
+ var rootEqualityPaths = undefined;
4854
+ identitites.forEach(function (paths) {
4855
+ if (paths.length <= 1) {
4856
+ return;
4857
+ }
4858
+ var _a = __read$1(paths
4859
+ .map(function (path) { return path.map(String); })
4860
+ .sort(function (a, b) { return a.length - b.length; })), shortestPath = _a[0], identicalPaths = _a.slice(1);
4861
+ if (shortestPath.length === 0) {
4862
+ rootEqualityPaths = identicalPaths.map(stringifyPath);
4863
+ }
4864
+ else {
4865
+ result[stringifyPath(shortestPath)] = identicalPaths.map(stringifyPath);
4866
+ }
4867
+ });
4868
+ if (rootEqualityPaths) {
4869
+ if (isEmptyObject(result)) {
4870
+ return [rootEqualityPaths];
4871
+ }
4872
+ else {
4873
+ return [rootEqualityPaths, result];
4874
+ }
4706
4875
  }
4707
- });
4708
- if (rootEqualityPaths) {
4709
- if (isEmptyObject(result)) {
4710
- return [rootEqualityPaths];
4711
- } else {
4712
- return [rootEqualityPaths, result];
4876
+ else {
4877
+ return isEmptyObject(result) ? undefined : result;
4713
4878
  }
4714
- } else {
4715
- return isEmptyObject(result) ? undefined : result;
4716
- }
4717
4879
  }
4718
4880
  var walker = function (object, identities, superJson, path, objectsInThisPath) {
4719
- var _a;
4720
- if (path === void 0) {
4721
- path = [];
4722
- }
4723
- if (objectsInThisPath === void 0) {
4724
- objectsInThisPath = [];
4725
- }
4726
- if (!isPrimitive(object)) {
4727
- addIdentity(object, path, identities);
4728
- }
4729
- if (!isDeep(object, superJson)) {
4730
- var transformed_1 = transformValue(object, superJson);
4731
- if (transformed_1) {
4732
- return {
4733
- transformedValue: transformed_1.value,
4734
- annotations: [transformed_1.type]
4735
- };
4736
- } else {
4737
- return {
4738
- transformedValue: object
4739
- };
4881
+ var _a;
4882
+ if (path === void 0) { path = []; }
4883
+ if (objectsInThisPath === void 0) { objectsInThisPath = []; }
4884
+ if (!isPrimitive(object)) {
4885
+ addIdentity(object, path, identities);
4886
+ }
4887
+ if (!isDeep(object, superJson)) {
4888
+ var transformed_1 = transformValue(object, superJson);
4889
+ if (transformed_1) {
4890
+ return {
4891
+ transformedValue: transformed_1.value,
4892
+ annotations: [transformed_1.type]
4893
+ };
4894
+ }
4895
+ else {
4896
+ return {
4897
+ transformedValue: object
4898
+ };
4899
+ }
4740
4900
  }
4741
- }
4742
- if (includes(objectsInThisPath, object)) {
4743
- return {
4744
- transformedValue: null
4745
- };
4746
- }
4747
- var transformationResult = transformValue(object, superJson);
4748
- var transformed = (_a = transformationResult === null || transformationResult === void 0 ? void 0 : transformationResult.value) !== null && _a !== void 0 ? _a : object;
4749
- if (!isPrimitive(object)) {
4750
- objectsInThisPath = __spreadArray$1(__spreadArray$1([], __read$1(objectsInThisPath)), [object]);
4751
- }
4752
- var transformedValue = isArray$1(transformed) ? [] : {};
4753
- var innerAnnotations = {};
4754
- forEach(transformed, function (value, index) {
4755
- var recursiveResult = walker(value, identities, superJson, __spreadArray$1(__spreadArray$1([], __read$1(path)), [index]), objectsInThisPath);
4756
- transformedValue[index] = recursiveResult.transformedValue;
4757
- if (isArray$1(recursiveResult.annotations)) {
4758
- innerAnnotations[index] = recursiveResult.annotations;
4759
- } else if (isPlainObject$1(recursiveResult.annotations)) {
4760
- forEach(recursiveResult.annotations, function (tree, key) {
4761
- innerAnnotations[escapeKey(index) + '.' + key] = tree;
4762
- });
4901
+ if (includes(objectsInThisPath, object)) {
4902
+ return {
4903
+ transformedValue: null
4904
+ };
4905
+ }
4906
+ var transformationResult = transformValue(object, superJson);
4907
+ var transformed = (_a = transformationResult === null || transformationResult === void 0 ? void 0 : transformationResult.value) !== null && _a !== void 0 ? _a : object;
4908
+ if (!isPrimitive(object)) {
4909
+ objectsInThisPath = __spreadArray$1(__spreadArray$1([], __read$1(objectsInThisPath)), [object]);
4910
+ }
4911
+ var transformedValue = isArray$1(transformed) ? [] : {};
4912
+ var innerAnnotations = {};
4913
+ forEach(transformed, function (value, index) {
4914
+ var recursiveResult = walker(value, identities, superJson, __spreadArray$1(__spreadArray$1([], __read$1(path)), [index]), objectsInThisPath);
4915
+ transformedValue[index] = recursiveResult.transformedValue;
4916
+ if (isArray$1(recursiveResult.annotations)) {
4917
+ innerAnnotations[index] = recursiveResult.annotations;
4918
+ }
4919
+ else if (isPlainObject$1(recursiveResult.annotations)) {
4920
+ forEach(recursiveResult.annotations, function (tree, key) {
4921
+ innerAnnotations[escapeKey(index) + '.' + key] = tree;
4922
+ });
4923
+ }
4924
+ });
4925
+ if (isEmptyObject(innerAnnotations)) {
4926
+ return {
4927
+ transformedValue: transformedValue,
4928
+ annotations: !!transformationResult
4929
+ ? [transformationResult.type]
4930
+ : undefined
4931
+ };
4932
+ }
4933
+ else {
4934
+ return {
4935
+ transformedValue: transformedValue,
4936
+ annotations: !!transformationResult
4937
+ ? [transformationResult.type, innerAnnotations]
4938
+ : innerAnnotations
4939
+ };
4763
4940
  }
4764
- });
4765
- if (isEmptyObject(innerAnnotations)) {
4766
- return {
4767
- transformedValue: transformedValue,
4768
- annotations: !!transformationResult ? [transformationResult.type] : undefined
4769
- };
4770
- } else {
4771
- return {
4772
- transformedValue: transformedValue,
4773
- annotations: !!transformationResult ? [transformationResult.type, innerAnnotations] : innerAnnotations
4774
- };
4775
- }
4776
4941
  };
4777
4942
 
4778
4943
  /**
@@ -4780,43 +4945,47 @@ var walker = function (object, identities, superJson, path, objectsInThisPath) {
4780
4945
  *
4781
4946
  * @param {*} payload
4782
4947
  * @returns {string}
4783
- */
4784
- function getType(payload) {
4785
- return Object.prototype.toString.call(payload).slice(8, -1);
4786
- }
4948
+ */
4949
+ function getType(payload) {
4950
+ return Object.prototype.toString.call(payload).slice(8, -1);
4951
+ }
4787
4952
  /**
4788
4953
  * Returns whether the payload is a plain JavaScript object (excluding special classes or objects with other prototypes)
4789
4954
  *
4790
4955
  * @param {*} payload
4791
4956
  * @returns {payload is PlainObject}
4792
- */
4793
- function isPlainObject(payload) {
4794
- if (getType(payload) !== 'Object') return false;
4795
- const prototype = Object.getPrototypeOf(payload);
4796
- return prototype.constructor === Object && prototype === Object.prototype;
4797
- }
4957
+ */
4958
+ function isPlainObject(payload) {
4959
+ if (getType(payload) !== 'Object')
4960
+ return false;
4961
+ const prototype = Object.getPrototypeOf(payload);
4962
+ return prototype.constructor === Object && prototype === Object.prototype;
4963
+ }
4798
4964
  /**
4799
4965
  * Returns whether the payload is an array
4800
4966
  *
4801
4967
  * @param {any} payload
4802
4968
  * @returns {payload is any[]}
4803
- */
4804
- function isArray(payload) {
4805
- return getType(payload) === 'Array';
4806
- }
4807
-
4808
- function assignProp(carry, key, newVal, originalObject, includeNonenumerable) {
4809
- const propType = {}.propertyIsEnumerable.call(originalObject, key) ? 'enumerable' : 'nonenumerable';
4810
- if (propType === 'enumerable') carry[key] = newVal;
4811
- if (includeNonenumerable && propType === 'nonenumerable') {
4812
- Object.defineProperty(carry, key, {
4813
- value: newVal,
4814
- enumerable: false,
4815
- writable: true,
4816
- configurable: true
4817
- });
4818
- }
4819
- }
4969
+ */
4970
+ function isArray(payload) {
4971
+ return getType(payload) === 'Array';
4972
+ }
4973
+
4974
+ function assignProp(carry, key, newVal, originalObject, includeNonenumerable) {
4975
+ const propType = {}.propertyIsEnumerable.call(originalObject, key)
4976
+ ? 'enumerable'
4977
+ : 'nonenumerable';
4978
+ if (propType === 'enumerable')
4979
+ carry[key] = newVal;
4980
+ if (includeNonenumerable && propType === 'nonenumerable') {
4981
+ Object.defineProperty(carry, key, {
4982
+ value: newVal,
4983
+ enumerable: false,
4984
+ writable: true,
4985
+ configurable: true,
4986
+ });
4987
+ }
4988
+ }
4820
4989
  /**
4821
4990
  * Copy (clone) an object and all its props recursively to get rid of any prop referenced of the original object. Arrays are also cloned, however objects inside arrays are still linked.
4822
4991
  *
@@ -4826,140 +4995,126 @@ function assignProp(carry, key, newVal, originalObject, includeNonenumerable) {
4826
4995
  * @param {Options} [options = {}] Options can be `props` or `nonenumerable`
4827
4996
  * @returns {T} the target with replaced values
4828
4997
  * @export
4829
- */
4830
- function copy(target, options = {}) {
4831
- if (isArray(target)) {
4832
- return target.map(item => copy(item, options));
4833
- }
4834
- if (!isPlainObject(target)) {
4835
- return target;
4836
- }
4837
- const props = Object.getOwnPropertyNames(target);
4838
- const symbols = Object.getOwnPropertySymbols(target);
4839
- return [...props, ...symbols].reduce((carry, key) => {
4840
- if (isArray(options.props) && !options.props.includes(key)) {
4841
- return carry;
4842
- }
4843
- const val = target[key];
4844
- const newVal = copy(val, options);
4845
- assignProp(carry, key, newVal, target, options.nonenumerable);
4846
- return carry;
4847
- }, {});
4848
- }
4849
-
4850
- var __assign = undefined && undefined.__assign || function () {
4851
- __assign = Object.assign || function (t) {
4852
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4853
- s = arguments[i];
4854
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
4855
- }
4856
- return t;
4857
- };
4858
- return __assign.apply(this, arguments);
4859
- };
4860
- var __read = undefined && undefined.__read || function (o, n) {
4861
- var m = typeof Symbol === "function" && o[Symbol.iterator];
4862
- if (!m) return o;
4863
- var i = m.call(o),
4864
- r,
4865
- ar = [],
4866
- e;
4867
- try {
4868
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
4869
- } catch (error) {
4870
- e = {
4871
- error: error
4998
+ */
4999
+ function copy(target, options = {}) {
5000
+ if (isArray(target)) {
5001
+ return target.map((item) => copy(item, options));
5002
+ }
5003
+ if (!isPlainObject(target)) {
5004
+ return target;
5005
+ }
5006
+ const props = Object.getOwnPropertyNames(target);
5007
+ const symbols = Object.getOwnPropertySymbols(target);
5008
+ return [...props, ...symbols].reduce((carry, key) => {
5009
+ if (isArray(options.props) && !options.props.includes(key)) {
5010
+ return carry;
5011
+ }
5012
+ const val = target[key];
5013
+ const newVal = copy(val, options);
5014
+ assignProp(carry, key, newVal, target, options.nonenumerable);
5015
+ return carry;
5016
+ }, {});
5017
+ }
5018
+
5019
+ var __assign = (undefined && undefined.__assign) || function () {
5020
+ __assign = Object.assign || function(t) {
5021
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5022
+ s = arguments[i];
5023
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
5024
+ t[p] = s[p];
5025
+ }
5026
+ return t;
4872
5027
  };
4873
- } finally {
5028
+ return __assign.apply(this, arguments);
5029
+ };
5030
+ var __read = (undefined && undefined.__read) || function (o, n) {
5031
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
5032
+ if (!m) return o;
5033
+ var i = m.call(o), r, ar = [], e;
4874
5034
  try {
4875
- if (r && !r.done && (m = i["return"])) m.call(i);
4876
- } finally {
4877
- if (e) throw e.error;
5035
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
4878
5036
  }
4879
- }
4880
- return ar;
5037
+ catch (error) { e = { error: error }; }
5038
+ finally {
5039
+ try {
5040
+ if (r && !r.done && (m = i["return"])) m.call(i);
5041
+ }
5042
+ finally { if (e) throw e.error; }
5043
+ }
5044
+ return ar;
4881
5045
  };
4882
- var __spreadArray = undefined && undefined.__spreadArray || function (to, from) {
4883
- for (var i = 0, il = from.length, j = to.length; i < il; i++, j++) to[j] = from[i];
4884
- return to;
5046
+ var __spreadArray = (undefined && undefined.__spreadArray) || function (to, from) {
5047
+ for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
5048
+ to[j] = from[i];
5049
+ return to;
4885
5050
  };
4886
- var SuperJSON = /** @class */function () {
4887
- function SuperJSON() {
4888
- this.classRegistry = new ClassRegistry();
4889
- this.symbolRegistry = new Registry(function (s) {
4890
- var _a;
4891
- return (_a = s.description) !== null && _a !== void 0 ? _a : '';
4892
- });
4893
- this.customTransformerRegistry = new CustomTransformerRegistry();
4894
- this.allowedErrorProps = [];
4895
- }
4896
- SuperJSON.prototype.serialize = function (object) {
4897
- var identities = new Map();
4898
- var output = walker(object, identities, this);
4899
- var res = {
4900
- json: output.transformedValue
5051
+ var SuperJSON = /** @class */ (function () {
5052
+ function SuperJSON() {
5053
+ this.classRegistry = new ClassRegistry();
5054
+ this.symbolRegistry = new Registry(function (s) { var _a; return (_a = s.description) !== null && _a !== void 0 ? _a : ''; });
5055
+ this.customTransformerRegistry = new CustomTransformerRegistry();
5056
+ this.allowedErrorProps = [];
5057
+ }
5058
+ SuperJSON.prototype.serialize = function (object) {
5059
+ var identities = new Map();
5060
+ var output = walker(object, identities, this);
5061
+ var res = {
5062
+ json: output.transformedValue
5063
+ };
5064
+ if (output.annotations) {
5065
+ res.meta = __assign(__assign({}, res.meta), { values: output.annotations });
5066
+ }
5067
+ var equalityAnnotations = generateReferentialEqualityAnnotations(identities);
5068
+ if (equalityAnnotations) {
5069
+ res.meta = __assign(__assign({}, res.meta), { referentialEqualities: equalityAnnotations });
5070
+ }
5071
+ return res;
4901
5072
  };
4902
- if (output.annotations) {
4903
- res.meta = __assign(__assign({}, res.meta), {
4904
- values: output.annotations
4905
- });
4906
- }
4907
- var equalityAnnotations = generateReferentialEqualityAnnotations(identities);
4908
- if (equalityAnnotations) {
4909
- res.meta = __assign(__assign({}, res.meta), {
4910
- referentialEqualities: equalityAnnotations
4911
- });
4912
- }
4913
- return res;
4914
- };
4915
- SuperJSON.prototype.deserialize = function (payload) {
4916
- var json = payload.json,
4917
- meta = payload.meta;
4918
- var result = copy(json);
4919
- if (meta === null || meta === void 0 ? void 0 : meta.values) {
4920
- result = applyValueAnnotations(result, meta.values, this);
4921
- }
4922
- if (meta === null || meta === void 0 ? void 0 : meta.referentialEqualities) {
4923
- result = applyReferentialEqualityAnnotations(result, meta.referentialEqualities);
4924
- }
4925
- return result;
4926
- };
4927
- SuperJSON.prototype.stringify = function (object) {
4928
- return JSON.stringify(this.serialize(object));
4929
- };
4930
- SuperJSON.prototype.parse = function (string) {
4931
- return this.deserialize(JSON.parse(string));
4932
- };
4933
- SuperJSON.prototype.registerClass = function (v, options) {
4934
- this.classRegistry.register(v, options);
4935
- };
4936
- SuperJSON.prototype.registerSymbol = function (v, identifier) {
4937
- this.symbolRegistry.register(v, identifier);
4938
- };
4939
- SuperJSON.prototype.registerCustom = function (transformer, name) {
4940
- this.customTransformerRegistry.register(__assign({
4941
- name: name
4942
- }, transformer));
4943
- };
4944
- SuperJSON.prototype.allowErrorProps = function () {
4945
- var _a;
4946
- var props = [];
4947
- for (var _i = 0; _i < arguments.length; _i++) {
4948
- props[_i] = arguments[_i];
4949
- }
4950
- (_a = this.allowedErrorProps).push.apply(_a, __spreadArray([], __read(props)));
4951
- };
4952
- SuperJSON.defaultInstance = new SuperJSON();
4953
- SuperJSON.serialize = SuperJSON.defaultInstance.serialize.bind(SuperJSON.defaultInstance);
4954
- SuperJSON.deserialize = SuperJSON.defaultInstance.deserialize.bind(SuperJSON.defaultInstance);
4955
- SuperJSON.stringify = SuperJSON.defaultInstance.stringify.bind(SuperJSON.defaultInstance);
4956
- SuperJSON.parse = SuperJSON.defaultInstance.parse.bind(SuperJSON.defaultInstance);
4957
- SuperJSON.registerClass = SuperJSON.defaultInstance.registerClass.bind(SuperJSON.defaultInstance);
4958
- SuperJSON.registerSymbol = SuperJSON.defaultInstance.registerSymbol.bind(SuperJSON.defaultInstance);
4959
- SuperJSON.registerCustom = SuperJSON.defaultInstance.registerCustom.bind(SuperJSON.defaultInstance);
4960
- SuperJSON.allowErrorProps = SuperJSON.defaultInstance.allowErrorProps.bind(SuperJSON.defaultInstance);
4961
- return SuperJSON;
4962
- }();
5073
+ SuperJSON.prototype.deserialize = function (payload) {
5074
+ var json = payload.json, meta = payload.meta;
5075
+ var result = copy(json);
5076
+ if (meta === null || meta === void 0 ? void 0 : meta.values) {
5077
+ result = applyValueAnnotations(result, meta.values, this);
5078
+ }
5079
+ if (meta === null || meta === void 0 ? void 0 : meta.referentialEqualities) {
5080
+ result = applyReferentialEqualityAnnotations(result, meta.referentialEqualities);
5081
+ }
5082
+ return result;
5083
+ };
5084
+ SuperJSON.prototype.stringify = function (object) {
5085
+ return JSON.stringify(this.serialize(object));
5086
+ };
5087
+ SuperJSON.prototype.parse = function (string) {
5088
+ return this.deserialize(JSON.parse(string));
5089
+ };
5090
+ SuperJSON.prototype.registerClass = function (v, options) {
5091
+ this.classRegistry.register(v, options);
5092
+ };
5093
+ SuperJSON.prototype.registerSymbol = function (v, identifier) {
5094
+ this.symbolRegistry.register(v, identifier);
5095
+ };
5096
+ SuperJSON.prototype.registerCustom = function (transformer, name) {
5097
+ this.customTransformerRegistry.register(__assign({ name: name }, transformer));
5098
+ };
5099
+ SuperJSON.prototype.allowErrorProps = function () {
5100
+ var _a;
5101
+ var props = [];
5102
+ for (var _i = 0; _i < arguments.length; _i++) {
5103
+ props[_i] = arguments[_i];
5104
+ }
5105
+ (_a = this.allowedErrorProps).push.apply(_a, __spreadArray([], __read(props)));
5106
+ };
5107
+ SuperJSON.defaultInstance = new SuperJSON();
5108
+ SuperJSON.serialize = SuperJSON.defaultInstance.serialize.bind(SuperJSON.defaultInstance);
5109
+ SuperJSON.deserialize = SuperJSON.defaultInstance.deserialize.bind(SuperJSON.defaultInstance);
5110
+ SuperJSON.stringify = SuperJSON.defaultInstance.stringify.bind(SuperJSON.defaultInstance);
5111
+ SuperJSON.parse = SuperJSON.defaultInstance.parse.bind(SuperJSON.defaultInstance);
5112
+ SuperJSON.registerClass = SuperJSON.defaultInstance.registerClass.bind(SuperJSON.defaultInstance);
5113
+ SuperJSON.registerSymbol = SuperJSON.defaultInstance.registerSymbol.bind(SuperJSON.defaultInstance);
5114
+ SuperJSON.registerCustom = SuperJSON.defaultInstance.registerCustom.bind(SuperJSON.defaultInstance);
5115
+ SuperJSON.allowErrorProps = SuperJSON.defaultInstance.allowErrorProps.bind(SuperJSON.defaultInstance);
5116
+ return SuperJSON;
5117
+ }());
4963
5118
  var serialize = SuperJSON.serialize;
4964
5119
  var stringify = SuperJSON.stringify;
4965
5120
 
@@ -5070,10 +5225,11 @@ function TanstackLogo() {
5070
5225
  // src/index.ts
5071
5226
  var FALLBACK = Symbol("fallback");
5072
5227
  function dispose(list) {
5073
- for (const o of list) o.dispose();
5228
+ for (const o of list)
5229
+ o.dispose();
5074
5230
  }
5075
5231
  function keyArray(items, keyFn, mapFn, options = {}) {
5076
- const prev = /* @__PURE__ */new Map();
5232
+ const prev = /* @__PURE__ */ new Map();
5077
5233
  onCleanup(() => dispose(prev.values()));
5078
5234
  return () => {
5079
5235
  const list = items() || [];
@@ -5082,11 +5238,10 @@ function keyArray(items, keyFn, mapFn, options = {}) {
5082
5238
  if (!list.length) {
5083
5239
  dispose(prev.values());
5084
5240
  prev.clear();
5085
- if (!options.fallback) return [];
5086
- const fb2 = createRoot(dispose2 => {
5087
- prev.set(FALLBACK, {
5088
- dispose: dispose2
5089
- });
5241
+ if (!options.fallback)
5242
+ return [];
5243
+ const fb2 = createRoot((dispose2) => {
5244
+ prev.set(FALLBACK, { dispose: dispose2 });
5090
5245
  return options.fallback();
5091
5246
  });
5092
5247
  return [fb2];
@@ -5113,7 +5268,8 @@ function keyArray(items, keyFn, mapFn, options = {}) {
5113
5268
  result[i] = lookup.mapped;
5114
5269
  lookup.setIndex?.(i);
5115
5270
  lookup.setItem(() => item);
5116
- } else addNewItem(result, item, i, key);
5271
+ } else
5272
+ addNewItem(result, item, i, key);
5117
5273
  }
5118
5274
  for (const key of prevKeys) {
5119
5275
  prev.get(key)?.dispose();
@@ -5123,29 +5279,30 @@ function keyArray(items, keyFn, mapFn, options = {}) {
5123
5279
  });
5124
5280
  };
5125
5281
  function addNewItem(list, item, i, key) {
5126
- createRoot(dispose2 => {
5282
+ createRoot((dispose2) => {
5127
5283
  const [getItem, setItem] = createSignal(item);
5128
- const save = {
5129
- setItem,
5130
- dispose: dispose2
5131
- };
5284
+ const save = { setItem, dispose: dispose2 };
5132
5285
  if (mapFn.length > 1) {
5133
5286
  const [index, setIndex] = createSignal(i);
5134
5287
  save.setIndex = setIndex;
5135
5288
  save.mapped = mapFn(getItem, index);
5136
- } else save.mapped = mapFn(getItem);
5289
+ } else
5290
+ save.mapped = mapFn(getItem);
5137
5291
  prev.set(key, save);
5138
5292
  list[i] = save.mapped;
5139
5293
  });
5140
5294
  }
5141
5295
  }
5142
5296
  function Key(props) {
5143
- const {
5144
- by
5145
- } = props;
5146
- return createMemo(keyArray(() => props.each, typeof by === "function" ? by : v => v[by], props.children, "fallback" in props ? {
5147
- fallback: () => props.fallback
5148
- } : void 0));
5297
+ const { by } = props;
5298
+ return createMemo(
5299
+ keyArray(
5300
+ () => props.each,
5301
+ typeof by === "function" ? by : (v) => v[by],
5302
+ props.children,
5303
+ "fallback" in props ? { fallback: () => props.fallback } : void 0
5304
+ )
5305
+ );
5149
5306
  }
5150
5307
 
5151
5308
  const _tmpl$$1 = /*#__PURE__*/template(`<span><svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M6 12L10 8L6 4" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path></svg></span>`, 6),
@@ -5571,118 +5728,117 @@ function useQueryDevtoolsContext() {
5571
5728
  }
5572
5729
 
5573
5730
  // src/index.ts
5574
- var noop = () => {};
5731
+ var noop = () => {
5732
+ };
5575
5733
  function createListTransition(source, options) {
5576
5734
  const initSource = untrack(source);
5577
- const {
5578
- onChange
5579
- } = options;
5735
+ const { onChange } = options;
5580
5736
  let prevSet = new Set(options.appear ? void 0 : initSource);
5581
- const exiting = /* @__PURE__ */new WeakSet();
5582
- const [toRemove, setToRemove] = createSignal([], {
5583
- equals: false
5584
- });
5737
+ const exiting = /* @__PURE__ */ new WeakSet();
5738
+ const [toRemove, setToRemove] = createSignal([], { equals: false });
5585
5739
  const [isTransitionPending] = useTransition();
5586
- const finishRemoved = options.exitMethod === "remove" ? noop : els => {
5587
- setToRemove(p => (p.push.apply(p, els), p));
5588
- for (const el of els) exiting.delete(el);
5740
+ const finishRemoved = options.exitMethod === "remove" ? noop : (els) => {
5741
+ setToRemove((p) => (p.push.apply(p, els), p));
5742
+ for (const el of els)
5743
+ exiting.delete(el);
5589
5744
  };
5590
5745
  const handleRemoved = options.exitMethod === "remove" ? noop : options.exitMethod === "keep-index" ? (els, el, i) => els.splice(i, 0, el) : (els, el) => els.push(el);
5591
- return createMemo(prev => {
5592
- const elsToRemove = toRemove();
5593
- const sourceList = source();
5594
- sourceList[$TRACK];
5595
- if (untrack(isTransitionPending)) {
5596
- isTransitionPending();
5597
- return prev;
5598
- }
5599
- if (elsToRemove.length) {
5600
- const next = prev.filter(e => !elsToRemove.includes(e));
5601
- elsToRemove.length = 0;
5602
- onChange({
5603
- list: next,
5604
- added: [],
5605
- removed: [],
5606
- unchanged: next,
5607
- finishRemoved
5608
- });
5609
- return next;
5610
- }
5611
- return untrack(() => {
5612
- const nextSet = new Set(sourceList);
5613
- const next = sourceList.slice();
5614
- const added = [];
5615
- const removed = [];
5616
- const unchanged = [];
5617
- for (const el of sourceList) {
5618
- (prevSet.has(el) ? unchanged : added).push(el);
5619
- }
5620
- let nothingChanged = !added.length;
5621
- for (let i = 0; i < prev.length; i++) {
5622
- const el = prev[i];
5623
- if (!nextSet.has(el)) {
5624
- if (!exiting.has(el)) {
5625
- removed.push(el);
5626
- exiting.add(el);
5746
+ return createMemo(
5747
+ (prev) => {
5748
+ const elsToRemove = toRemove();
5749
+ const sourceList = source();
5750
+ sourceList[$TRACK];
5751
+ if (untrack(isTransitionPending)) {
5752
+ isTransitionPending();
5753
+ return prev;
5754
+ }
5755
+ if (elsToRemove.length) {
5756
+ const next = prev.filter((e) => !elsToRemove.includes(e));
5757
+ elsToRemove.length = 0;
5758
+ onChange({ list: next, added: [], removed: [], unchanged: next, finishRemoved });
5759
+ return next;
5760
+ }
5761
+ return untrack(() => {
5762
+ const nextSet = new Set(sourceList);
5763
+ const next = sourceList.slice();
5764
+ const added = [];
5765
+ const removed = [];
5766
+ const unchanged = [];
5767
+ for (const el of sourceList) {
5768
+ (prevSet.has(el) ? unchanged : added).push(el);
5769
+ }
5770
+ let nothingChanged = !added.length;
5771
+ for (let i = 0; i < prev.length; i++) {
5772
+ const el = prev[i];
5773
+ if (!nextSet.has(el)) {
5774
+ if (!exiting.has(el)) {
5775
+ removed.push(el);
5776
+ exiting.add(el);
5777
+ }
5778
+ handleRemoved(next, el, i);
5627
5779
  }
5628
- handleRemoved(next, el, i);
5780
+ if (nothingChanged && el !== next[i])
5781
+ nothingChanged = false;
5629
5782
  }
5630
- if (nothingChanged && el !== next[i]) nothingChanged = false;
5631
- }
5632
- if (!removed.length && nothingChanged) return prev;
5633
- onChange({
5634
- list: next,
5635
- added,
5636
- removed,
5637
- unchanged,
5638
- finishRemoved
5783
+ if (!removed.length && nothingChanged)
5784
+ return prev;
5785
+ onChange({ list: next, added, removed, unchanged, finishRemoved });
5786
+ prevSet = nextSet;
5787
+ return next;
5639
5788
  });
5640
- prevSet = nextSet;
5641
- return next;
5642
- });
5643
- }, options.appear ? [] : initSource.slice());
5789
+ },
5790
+ options.appear ? [] : initSource.slice()
5791
+ );
5644
5792
  }
5645
5793
 
5646
- var isNonNullable = i => i != null;
5647
- var filterNonNullable = arr => arr.filter(isNonNullable);
5648
- var access = v => typeof v === "function" && !v.length ? v() : v;
5649
- var asArray = value => Array.isArray(value) ? value : value ? [value] : [];
5794
+ var isNonNullable = (i) => i != null;
5795
+ var filterNonNullable = (arr) => arr.filter(isNonNullable);
5796
+ var access = (v) => typeof v === "function" && !v.length ? v() : v;
5797
+ var asArray = (value) => Array.isArray(value) ? value : value ? [value] : [];
5650
5798
  function handleDiffArray(current, prev, handleAdded, handleRemoved) {
5651
5799
  const currLength = current.length;
5652
5800
  const prevLength = prev.length;
5653
5801
  let i = 0;
5654
5802
  if (!prevLength) {
5655
- for (; i < currLength; i++) handleAdded(current[i]);
5803
+ for (; i < currLength; i++)
5804
+ handleAdded(current[i]);
5656
5805
  return;
5657
5806
  }
5658
5807
  if (!currLength) {
5659
- for (; i < prevLength; i++) handleRemoved(prev[i]);
5808
+ for (; i < prevLength; i++)
5809
+ handleRemoved(prev[i]);
5660
5810
  return;
5661
5811
  }
5662
5812
  for (; i < prevLength; i++) {
5663
- if (prev[i] !== current[i]) break;
5813
+ if (prev[i] !== current[i])
5814
+ break;
5664
5815
  }
5665
5816
  let prevEl;
5666
5817
  let currEl;
5667
5818
  prev = prev.slice(i);
5668
5819
  current = current.slice(i);
5669
5820
  for (prevEl of prev) {
5670
- if (!current.includes(prevEl)) handleRemoved(prevEl);
5821
+ if (!current.includes(prevEl))
5822
+ handleRemoved(prevEl);
5671
5823
  }
5672
5824
  for (currEl of current) {
5673
- if (!prev.includes(currEl)) handleAdded(currEl);
5825
+ if (!prev.includes(currEl))
5826
+ handleAdded(currEl);
5674
5827
  }
5675
5828
  }
5676
5829
 
5677
- var defaultElementPredicate = item => item instanceof Element;
5830
+ var defaultElementPredicate = (item) => item instanceof Element;
5678
5831
  function getResolvedElements(value, predicate) {
5679
- if (predicate(value)) return value;
5680
- if (typeof value === "function" && !value.length) return getResolvedElements(value(), predicate);
5832
+ if (predicate(value))
5833
+ return value;
5834
+ if (typeof value === "function" && !value.length)
5835
+ return getResolvedElements(value(), predicate);
5681
5836
  if (Array.isArray(value)) {
5682
5837
  const results = [];
5683
5838
  for (const item of value) {
5684
5839
  const result = getResolvedElements(item, predicate);
5685
- if (result) Array.isArray(result) ? results.push.apply(results, result) : results.push(result);
5840
+ if (result)
5841
+ Array.isArray(result) ? results.push.apply(results, result) : results.push(result);
5686
5842
  }
5687
5843
  return results.length ? results : null;
5688
5844
  }
@@ -5690,7 +5846,9 @@ function getResolvedElements(value, predicate) {
5690
5846
  }
5691
5847
  function resolveElements(fn, predicate = defaultElementPredicate, serverPredicate = defaultElementPredicate) {
5692
5848
  const children2 = createMemo(fn);
5693
- const memo = createMemo(() => getResolvedElements(children2(), predicate));
5849
+ const memo = createMemo(
5850
+ () => getResolvedElements(children2(), predicate)
5851
+ );
5694
5852
  memo.toArray = () => {
5695
5853
  const value = memo();
5696
5854
  return Array.isArray(value) ? value : value ? [value] : [];
@@ -5717,21 +5875,13 @@ function nextFrame(fn) {
5717
5875
  requestAnimationFrame(() => requestAnimationFrame(fn));
5718
5876
  }
5719
5877
  function enterTransition(classnames, events, el, done) {
5720
- const {
5721
- enterClasses,
5722
- enterActiveClasses,
5723
- enterToClasses
5724
- } = classnames,
5725
- {
5726
- onBeforeEnter,
5727
- onEnter,
5728
- onAfterEnter
5729
- } = events;
5878
+ const { enterClasses, enterActiveClasses, enterToClasses } = classnames, { onBeforeEnter, onEnter, onAfterEnter } = events;
5730
5879
  onBeforeEnter?.(el);
5731
5880
  el.classList.add(...enterClasses);
5732
5881
  el.classList.add(...enterActiveClasses);
5733
5882
  queueMicrotask(() => {
5734
- if (!el.parentNode) return done?.();
5883
+ if (!el.parentNode)
5884
+ return done?.();
5735
5885
  onEnter?.(el, () => endTransition());
5736
5886
  });
5737
5887
  nextFrame(() => {
@@ -5754,17 +5904,9 @@ function enterTransition(classnames, events, el, done) {
5754
5904
  }
5755
5905
  }
5756
5906
  function exitTransition(classnames, events, el, done) {
5757
- const {
5758
- exitClasses,
5759
- exitActiveClasses,
5760
- exitToClasses
5761
- } = classnames,
5762
- {
5763
- onBeforeExit,
5764
- onExit,
5765
- onAfterExit
5766
- } = events;
5767
- if (!el.parentNode) return done?.();
5907
+ const { exitClasses, exitActiveClasses, exitToClasses } = classnames, { onBeforeExit, onExit, onAfterExit } = events;
5908
+ if (!el.parentNode)
5909
+ return done?.();
5768
5910
  onBeforeExit?.(el);
5769
5911
  el.classList.add(...exitClasses);
5770
5912
  el.classList.add(...exitActiveClasses);
@@ -5788,17 +5930,12 @@ function exitTransition(classnames, events, el, done) {
5788
5930
  }
5789
5931
  }
5790
5932
  }
5791
- var TransitionGroup = props => {
5933
+ var TransitionGroup = (props) => {
5792
5934
  const classnames = createClassnames(props);
5793
5935
  return createListTransition(resolveElements(() => props.children).toArray, {
5794
5936
  appear: props.appear,
5795
5937
  exitMethod: "keep-index",
5796
- onChange({
5797
- added,
5798
- removed,
5799
- finishRemoved,
5800
- list
5801
- }) {
5938
+ onChange({ added, removed, finishRemoved, list }) {
5802
5939
  const classes = classnames();
5803
5940
  for (const el of added) {
5804
5941
  enterTransition(classes, props, el);
@@ -5806,22 +5943,14 @@ var TransitionGroup = props => {
5806
5943
  const toMove = [];
5807
5944
  for (const el of list) {
5808
5945
  if (el.isConnected && (el instanceof HTMLElement || el instanceof SVGElement)) {
5809
- toMove.push({
5810
- el,
5811
- rect: el.getBoundingClientRect()
5812
- });
5946
+ toMove.push({ el, rect: el.getBoundingClientRect() });
5813
5947
  }
5814
5948
  }
5815
5949
  queueMicrotask(() => {
5816
5950
  const moved = [];
5817
- for (const {
5818
- el,
5819
- rect
5820
- } of toMove) {
5951
+ for (const { el, rect } of toMove) {
5821
5952
  if (el.isConnected) {
5822
- const newRect = el.getBoundingClientRect(),
5823
- dX = rect.left - newRect.left,
5824
- dY = rect.top - newRect.top;
5953
+ const newRect = el.getBoundingClientRect(), dX = rect.left - newRect.left, dY = rect.top - newRect.top;
5825
5954
  if (dX || dY) {
5826
5955
  el.style.transform = `translate(${dX}px, ${dY}px)`;
5827
5956
  el.style.transitionDuration = "0s";
@@ -5831,7 +5960,7 @@ var TransitionGroup = props => {
5831
5960
  }
5832
5961
  document.body.offsetHeight;
5833
5962
  for (const el of moved) {
5834
- let endTransition2 = function (e) {
5963
+ let endTransition2 = function(e) {
5835
5964
  if (e.target === el || /transform$/.test(e.propertyName)) {
5836
5965
  el.removeEventListener("transitionend", endTransition2);
5837
5966
  el.classList.remove(...classes.moveClasses);
@@ -5867,38 +5996,42 @@ function createStorage(props) {
5867
5996
  };
5868
5997
  const apis = props?.api ? Array.isArray(props.api) ? props.api : [props.api] : [globalThis.localStorage].filter(Boolean);
5869
5998
  const prefix = props?.prefix ? `${props.prefix}.` : "";
5870
- const signals = /* @__PURE__ */new Map();
5871
- const store = new Proxy({}, {
5872
- get(_, key) {
5873
- let node = signals.get(key);
5874
- if (!node) {
5875
- node = createSignal(void 0, {
5876
- equals: false
5877
- });
5878
- signals.set(key, node);
5879
- }
5880
- node[0]();
5881
- const value = apis.reduce((result, api) => {
5882
- if (result !== null || !api) {
5883
- return result;
5999
+ const signals = /* @__PURE__ */ new Map();
6000
+ const store = new Proxy(
6001
+ {},
6002
+ {
6003
+ get(_, key) {
6004
+ let node = signals.get(key);
6005
+ if (!node) {
6006
+ node = createSignal(void 0, { equals: false });
6007
+ signals.set(key, node);
5884
6008
  }
5885
- try {
5886
- return api.getItem(`${prefix}${key}`);
5887
- } catch (err) {
5888
- handleError(err, `Error reading ${prefix}${key} from ${api["name"]}`);
5889
- return null;
6009
+ node[0]();
6010
+ const value = apis.reduce(
6011
+ (result, api) => {
6012
+ if (result !== null || !api) {
6013
+ return result;
6014
+ }
6015
+ try {
6016
+ return api.getItem(`${prefix}${key}`);
6017
+ } catch (err) {
6018
+ handleError(err, `Error reading ${prefix}${key} from ${api["name"]}`);
6019
+ return null;
6020
+ }
6021
+ },
6022
+ null
6023
+ );
6024
+ if (value !== null && props?.deserializer) {
6025
+ return props.deserializer(value, key, props.options);
5890
6026
  }
5891
- }, null);
5892
- if (value !== null && props?.deserializer) {
5893
- return props.deserializer(value, key, props.options);
6027
+ return value;
5894
6028
  }
5895
- return value;
5896
6029
  }
5897
- });
6030
+ );
5898
6031
  const setter = (key, value, options) => {
5899
6032
  const filteredValue = props?.serializer ? props.serializer(value, key, options ?? props.options) : value;
5900
6033
  const apiKey = `${prefix}${key}`;
5901
- apis.forEach(api => {
6034
+ apis.forEach((api) => {
5902
6035
  try {
5903
6036
  api.getItem(apiKey) !== filteredValue && api.setItem(apiKey, filteredValue);
5904
6037
  } catch (err) {
@@ -5908,14 +6041,14 @@ function createStorage(props) {
5908
6041
  const node = signals.get(key);
5909
6042
  node && node[1]();
5910
6043
  };
5911
- const remove = key => apis.forEach(api => {
6044
+ const remove = (key) => apis.forEach((api) => {
5912
6045
  try {
5913
6046
  api.removeItem(`${prefix}${key}`);
5914
6047
  } catch (err) {
5915
6048
  handleError(err, `Error removing ${prefix}${key} from ${api.name}`);
5916
6049
  }
5917
6050
  });
5918
- const clear = () => apis.forEach(api => {
6051
+ const clear = () => apis.forEach((api) => {
5919
6052
  try {
5920
6053
  api.clear();
5921
6054
  } catch (err) {
@@ -5932,7 +6065,7 @@ function createStorage(props) {
5932
6065
  }
5933
6066
  }
5934
6067
  };
5935
- apis.forEach(api => {
6068
+ apis.forEach((api) => {
5936
6069
  if (typeof api.getAll === "function") {
5937
6070
  let values;
5938
6071
  try {
@@ -5944,8 +6077,7 @@ function createStorage(props) {
5944
6077
  addValue(key, values[key]);
5945
6078
  }
5946
6079
  } else {
5947
- let index = 0,
5948
- key;
6080
+ let index = 0, key;
5949
6081
  try {
5950
6082
  while (key = api.key(index++)) {
5951
6083
  if (!result.hasOwnProperty(key)) {
@@ -5960,16 +6092,19 @@ function createStorage(props) {
5960
6092
  return result;
5961
6093
  };
5962
6094
  props?.sync !== false && onMount(() => {
5963
- const listener = ev => {
6095
+ const listener = (ev) => {
5964
6096
  let changed = false;
5965
- apis.forEach(api => {
6097
+ apis.forEach((api) => {
5966
6098
  try {
5967
6099
  if (api !== ev.storageArea && ev.key && ev.newValue !== api.getItem(ev.key)) {
5968
6100
  ev.newValue ? api.setItem(ev.key, ev.newValue) : api.removeItem(ev.key);
5969
6101
  changed = true;
5970
6102
  }
5971
6103
  } catch (err) {
5972
- handleError(err, `Error synching api ${api.name} from storage event (${ev.key}=${ev.newValue})`);
6104
+ handleError(
6105
+ err,
6106
+ `Error synching api ${api.name} from storage event (${ev.key}=${ev.newValue})`
6107
+ );
5973
6108
  }
5974
6109
  });
5975
6110
  changed && ev.key && signals.get(ev.key)?.[1]();
@@ -5978,21 +6113,25 @@ function createStorage(props) {
5978
6113
  globalThis.addEventListener("storage", listener);
5979
6114
  onCleanup(() => globalThis.removeEventListener("storage", listener));
5980
6115
  } else {
5981
- apis.forEach(api => api.addEventListener?.("storage", listener));
5982
- onCleanup(() => apis.forEach(api => api.removeEventListener?.("storage", listener)));
6116
+ apis.forEach((api) => api.addEventListener?.("storage", listener));
6117
+ onCleanup(() => apis.forEach((api) => api.removeEventListener?.("storage", listener)));
5983
6118
  }
5984
6119
  });
5985
- return [store, setter, {
5986
- clear,
5987
- error,
5988
- remove,
5989
- toJSON
5990
- }];
6120
+ return [
6121
+ store,
6122
+ setter,
6123
+ {
6124
+ clear,
6125
+ error,
6126
+ remove,
6127
+ toJSON
6128
+ }
6129
+ ];
5991
6130
  }
5992
6131
  var createLocalStorage = createStorage;
5993
6132
 
5994
6133
  // src/tools.ts
5995
- var addClearMethod = storage => {
6134
+ var addClearMethod = (storage) => {
5996
6135
  if (typeof storage.clear === "function") {
5997
6136
  return storage;
5998
6137
  }
@@ -6006,7 +6145,7 @@ var addClearMethod = storage => {
6006
6145
  };
6007
6146
 
6008
6147
  // src/cookies.ts
6009
- var serializeCookieOptions = options => {
6148
+ var serializeCookieOptions = (options) => {
6010
6149
  if (!options) {
6011
6150
  return "";
6012
6151
  }
@@ -6022,10 +6161,12 @@ var serializeCookieOptions = options => {
6022
6161
  };
6023
6162
  var cookieStorage = addClearMethod({
6024
6163
  _cookies: [globalThis.document, "cookie"],
6025
- getItem: key => cookieStorage._cookies[0][cookieStorage._cookies[1]].match("(^|;)\\s*" + key + "\\s*=\\s*([^;]+)")?.pop() ?? null,
6164
+ getItem: (key) => cookieStorage._cookies[0][cookieStorage._cookies[1]].match("(^|;)\\s*" + key + "\\s*=\\s*([^;]+)")?.pop() ?? null,
6026
6165
  setItem: (key, value, options) => {
6027
6166
  const oldValue = cookieStorage.getItem(key);
6028
- cookieStorage._cookies[0][cookieStorage._cookies[1]] = `${key}=${value}${serializeCookieOptions(options)}`;
6167
+ cookieStorage._cookies[0][cookieStorage._cookies[1]] = `${key}=${value}${serializeCookieOptions(
6168
+ options
6169
+ )}`;
6029
6170
  const storageEvent = Object.assign(new Event("storage"), {
6030
6171
  key,
6031
6172
  oldValue,
@@ -6035,28 +6176,34 @@ var cookieStorage = addClearMethod({
6035
6176
  });
6036
6177
  window.dispatchEvent(storageEvent);
6037
6178
  },
6038
- removeItem: key => {
6179
+ removeItem: (key) => {
6039
6180
  cookieStorage._cookies[0][cookieStorage._cookies[1]] = `${key}=deleted${serializeCookieOptions({
6040
- expires: new Date(0)
6181
+ expires: new Date(0)
6041
6182
  })}`;
6042
6183
  },
6043
- key: index => {
6184
+ key: (index) => {
6044
6185
  let key = null;
6045
6186
  let count = 0;
6046
- cookieStorage._cookies[0][cookieStorage._cookies[1]].replace(/(?:^|;)\s*(.+?)\s*=\s*[^;]+/g, (_, found) => {
6047
- if (!key && found && count++ === index) {
6048
- key = found;
6187
+ cookieStorage._cookies[0][cookieStorage._cookies[1]].replace(
6188
+ /(?:^|;)\s*(.+?)\s*=\s*[^;]+/g,
6189
+ (_, found) => {
6190
+ if (!key && found && count++ === index) {
6191
+ key = found;
6192
+ }
6193
+ return "";
6049
6194
  }
6050
- return "";
6051
- });
6195
+ );
6052
6196
  return key;
6053
6197
  },
6054
6198
  get length() {
6055
6199
  let length = 0;
6056
- cookieStorage._cookies[0][cookieStorage._cookies[1]].replace(/(?:^|;)\s*.+?\s*=\s*[^;]+/g, found => {
6057
- length += found ? 1 : 0;
6058
- return "";
6059
- });
6200
+ cookieStorage._cookies[0][cookieStorage._cookies[1]].replace(
6201
+ /(?:^|;)\s*.+?\s*=\s*[^;]+/g,
6202
+ (found) => {
6203
+ length += found ? 1 : 0;
6204
+ return "";
6205
+ }
6206
+ );
6060
6207
  return length;
6061
6208
  }
6062
6209
  });
@@ -6066,34 +6213,21 @@ function makeResizeObserver(callback, options) {
6066
6213
  const observer = new ResizeObserver(callback);
6067
6214
  onCleanup(observer.disconnect.bind(observer));
6068
6215
  return {
6069
- observe: ref => observer.observe(ref, options),
6216
+ observe: (ref) => observer.observe(ref, options),
6070
6217
  unobserve: observer.unobserve.bind(observer)
6071
6218
  };
6072
6219
  }
6073
6220
  function createResizeObserver(targets, onResize, options) {
6074
- const previousMap = /* @__PURE__ */new WeakMap(),
6075
- {
6076
- observe,
6077
- unobserve
6078
- } = makeResizeObserver(entries => {
6079
- for (const entry of entries) {
6080
- const {
6081
- contentRect,
6082
- target
6083
- } = entry,
6084
- width = Math.round(contentRect.width),
6085
- height = Math.round(contentRect.height),
6086
- previous = previousMap.get(target);
6087
- if (!previous || previous.width !== width || previous.height !== height) {
6088
- onResize(contentRect, target, entry);
6089
- previousMap.set(target, {
6090
- width,
6091
- height
6092
- });
6093
- }
6221
+ const previousMap = /* @__PURE__ */ new WeakMap(), { observe, unobserve } = makeResizeObserver((entries) => {
6222
+ for (const entry of entries) {
6223
+ const { contentRect, target } = entry, width = Math.round(contentRect.width), height = Math.round(contentRect.height), previous = previousMap.get(target);
6224
+ if (!previous || previous.width !== width || previous.height !== height) {
6225
+ onResize(contentRect, target, entry);
6226
+ previousMap.set(target, { width, height });
6094
6227
  }
6095
- }, options);
6096
- createEffect(prev => {
6228
+ }
6229
+ }, options);
6230
+ createEffect((prev) => {
6097
6231
  const refs = filterNonNullable(asArray(access(targets)));
6098
6232
  handleDiffArray(refs, prev, observe, unobserve);
6099
6233
  return refs;
@@ -7935,4 +8069,4 @@ class TanstackQueryDevtools {
7935
8069
  }
7936
8070
 
7937
8071
  export { TanstackQueryDevtools };
7938
- //# sourceMappingURL=index.mjs.map
8072
+ //# sourceMappingURL=index.js.map