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